forked from googleanalytics/autotrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotrack.js.map
1 lines (1 loc) · 103 KB
/
autotrack.js.map
1
{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/constants.js","lib/plugins/autotrack.js","lib/plugins/clean-url-tracker.js","lib/plugins/event-tracker.js","lib/plugins/impression-tracker.js","lib/plugins/media-query-tracker.js","lib/plugins/outbound-form-tracker.js","lib/plugins/outbound-link-tracker.js","lib/plugins/page-visibility-tracker.js","lib/plugins/social-widget-tracker.js","lib/plugins/url-change-tracker.js","lib/provide.js","lib/usage.js","lib/utilities.js","node_modules/date-now/index.js","node_modules/debounce/index.js","node_modules/dom-utils/lib/closest.js","node_modules/dom-utils/lib/delegate.js","node_modules/dom-utils/lib/get-attributes.js","node_modules/dom-utils/lib/matches.js","node_modules/dom-utils/lib/parents.js","node_modules/dom-utils/lib/parse-url.js","node_modules/object-assign/index.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","VERSION","DEV_ID","VERSION_PARAM","USAGE_PARAM","NULL_DIMENSION","Autotrack","console","error","provide","CleanUrlTracker","tracker","opts","usage","track","plugins","CLEAN_URL_TRACKER","this","assign","stripQuery","queryDimensionIndex","indexFilename","trailingSlash","overrideTrackerBuildHitTask","parseUrl","constants","prototype","cleanUrlTask","model","location","get","page","url","oldPath","pathname","newPath","parts","split","join","replace","isFilename","test","substr","set","query","search","originalTrackerBuildHitTask","bind","remove","originalTrackerSendHitTask","EventTracker","EVENT_TRACKER","window","addEventListener","events","fieldsObj","attributePrefix","hitFilter","handleEvents","selector","delegates","forEach","event","delegate","document","composed","useCapture","createFieldsObj","getAttributeFields","element","prefix","type","getAttribute","defaultFields","transport","attributeFields","userFields","hitType","send","Object","keys","key","destroy","ImpressionTracker","IMPRESSION_TRACKER","IntersectionObserver","MutationObserver","elements","rootMargin","handleDomMutations","walkNodeTree","handleIntersectionChanges","startObserving","observeElement","handleDomElementRemoved","data","deriveDataFromConfigOptions","items","elementMap","threshold","intersectionObserver","initIntersectionObserver","mutationObserver","initMutationObserver","domReady","isTargetVisible","record","intersectionRect","top","bottom","left","right","intersectionRatio","item","id","push","trackFirstImpressionOnly","observe","body","childList","subtree","requestAnimationFrame","getElementById","mutations","mutation","removedEl","k","removedNodes","addedEl","j","addedNodes","node","callback","nodeType","child","childNodes","records","target","handleImpression","splice","possiblyUnobserveElement","eventCategory","eventAction","eventLabel","itemsIncludesId","unobserve","some","disconnect","MediaQueryTracker","MEDIA_QUERY_TRACKER","matchMedia","definitions","changeTemplate","changeTimeout","isObject","toArray","changeListeners","processMediaQueries","getMediaListener","media","mediaMap","debounce","definition","name","dimensionIndex","mediaName","getMatchName","addChangeListeners","match","matches","mql","fn","handleChanges","addListener","newValue","oldValue","listener","removeListener","OutboundFormTracker","OUTBOUND_FORM_TRACKER","formSelector","shouldTrackOutboundForm","handleFormSubmits","withTimeout","form","action","href","navigator","sendBeacon","preventDefault","hitCallback","submit","hostname","protocol","slice","OutboundLinkTracker","OUTBOUND_LINK_TRACKER","linkSelector","shouldTrackOutboundLink","handleLinkInteractions","link","PageVisibilityTracker","PAGE_VISIBILITY_TRACKER","sessionTimeout","DEFAULT_SESSION_TIMEOUT","hiddenMetricIndex","visibleMetricIndex","visibilityState","lastVisibilityChangeTime","Date","handleVisibilityStateChange","overrideTrackerSendMethod","overrideTrackerSendHitTask","prevVisibilityState","sessionHasTimedOut","timeDeltaInSeconds","Math","round","eventValue","nonInteraction","metric","minutesSinceLastHit","lastHitTime","originalTrackerSendMethod","args","Array","arguments","firstArg","isPageview","apply","removeEventListener","SocialWidgetTracker","SOCIAL_WIDGET_TRACKER","addWidgetListeners","addTwitterEventHandlers","handleTweetEvents","handleFollowEvents","handleLikeEvents","handleUnlikeEvents","readyState","FB","addFacebookEventHandlers","twttr","ready","err","removeTwitterEventHandlers","unbind","Event","subscribe","removeFacebookEventHandlers","unsubscribe","region","socialNetwork","socialAction","socialTarget","screenName","screen_name","UrlChangeTracker","URL_CHANGE_TRACKER","history","pushState","shouldTrackUrlChange","path","getPath","updateTrackerData","originalPushState","state","title","originalReplaceState","replaceState","shouldSendPageview","setTimeout","utilities","gaDevIds","pluginName","pluginConstructor","gaAlias","gaplugins","capitalize","convertHexToBin","hex","parseInt","toString","convertBinToHex","bin","padZeros","str","len","toAdd","flipBitOn","index","trackPlugin","pluginIndex","usageHex","usageBin","PLUGIN_COUNT","trackVersion","plugin","getAttributes","opt_tracker","opt_hitFilter","opt_target","originalBuildHitTask","buildHitTask","attributes","attribute","indexOf","value","field","camelCase","wait","called","p1","toUpperCase","charAt","isArray","now","getTime","func","immediate","later","last","timestamp","timeout","result","context","callNow","parents","shouldCheckSelf","parent","parentElements","concat","closest","ancestor","eventType","composedPath","delegateTarget","attrs","map","attr","matchesSelector","nativeMatches","nodes","parentNode","querySelectorAll","proto","Element","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","list","HTTP_PORT","HTTPS_PORT","DEFAULT_PORT","RegExp","createElement","cache","port","host","origin","hash","fragment","toObject","val","undefined","TypeError","shouldUseNative","test1","String","getOwnPropertyNames","test2","fromCharCode","order2","test3","letter","hasOwnProperty","propIsEnumerable","propertyIsEnumerable","source","from","symbols","to","getOwnPropertySymbols"],"mappings":";;;;;;;;;;;;;;;;;;CAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GA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"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nmodule.exports = {\n VERSION: '1.0.0',\n DEV_ID: 'i5iSjo',\n\n VERSION_PARAM: '&_av',\n USAGE_PARAM: '&_au',\n\n NULL_DIMENSION: '(not set)'\n};\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/* eslint no-console: [\"error\", {allow: [\"error\"]}] */\n\n\n// Imports dependencies.\nvar provide = require('../provide');\n\n\n/**\n * Warns users that this functionality is deprecated as of version 1.0\n * @deprecated\n * @constructor\n */\nfunction Autotrack() {\n console.error('Warning! Requiring the `autotrack` plugin no longer ' +\n 'requires ' +' all sub-plugins by default.\\n' +\n 'See https://goo.gl/XsXPg5 for details.');\n}\n\n\nprovide('autotrack', Autotrack);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar parseUrl = require('dom-utils/lib/parse-url');\nvar constants = require('../constants');\nvar provide = require('../provide');\nvar usage = require('../usage');\n\n\n/**\n * Registers clean URL tracking on a tracker object. The clean URL tracker\n * removes query parameters from the page value reported to Google Analytics.\n * It also helps to prevent tracking similar URLs, e.g. sometimes ending a URL\n * with a slash and sometimes not.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction CleanUrlTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.CLEAN_URL_TRACKER);\n\n this.opts = assign({\n stripQuery: false,\n queryDimensionIndex: null,\n indexFilename: null,\n trailingSlash: null\n }, opts);\n\n this.tracker = tracker;\n\n this.overrideTrackerBuildHitTask();\n}\n\n\n/**\n * Cleans the URL based on the preferences set in the configuration options.\n * @param {Object} model An analytics.js Model object.\n */\nCleanUrlTracker.prototype.cleanUrlTask = function(model) {\n\n var location = model.get('location');\n var page = model.get('page');\n var url = parseUrl(page || location);\n\n var oldPath = url.pathname;\n var newPath = oldPath;\n\n // If an index filename was provided, remove it if it appears at the end\n // of the URL.\n if (this.opts.indexFilename) {\n var parts = newPath.split('/');\n if (this.opts.indexFilename == parts[parts.length - 1]) {\n parts[parts.length - 1] = '';\n newPath = parts.join('/');\n }\n }\n\n // Ensure the URL ends with or doesn't end with slash based on the\n // `trailingSlash` option. Note that filename URLs should never contain\n // a trailing slash.\n if (this.opts.trailingSlash == 'remove') {\n newPath = newPath.replace(/\\/+$/, '');\n }\n else if (this.opts.trailingSlash == 'add') {\n var isFilename = /\\.\\w+$/.test(newPath);\n if (!isFilename && newPath.substr(-1) != '/') {\n newPath = newPath + '/';\n }\n }\n\n // If a query dimensions index was provided, set the query string portion\n // of the URL on that dimension. If no query string exists on the URL use\n // the NULL_DIMENSION.\n if (this.opts.stripQuery && this.opts.queryDimensionIndex) {\n model.set('dimension' + this.opts.queryDimensionIndex,\n url.query || constants.NULL_DIMENSION);\n }\n\n model.set('page', newPath + (!this.opts.stripQuery ? url.search : ''));\n};\n\n\n/**\n * Overrides the tracker's `buildHitTask` to check for proper URL formatting\n * on every hit (not just the initial pageview).\n */\nCleanUrlTracker.prototype.overrideTrackerBuildHitTask = function() {\n this.originalTrackerBuildHitTask = this.tracker.get('buildHitTask');\n\n this.tracker.set('buildHitTask', function(model) {\n this.cleanUrlTask(model);\n this.originalTrackerBuildHitTask(model);\n }.bind(this));\n};\n\n\n/**\n * Restores all overridden tasks and methods.\n */\nCleanUrlTracker.prototype.remove = function() {\n this.tracker.set('sendHitTask', this.originalTrackerSendHitTask);\n};\n\n\nprovide('cleanUrlTracker', CleanUrlTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar delegate = require('dom-utils/lib/delegate');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\nvar getAttributeFields = require('../utilities').getAttributeFields;\n\n\n/**\n * Registers declarative event tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction EventTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.EVENT_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = assign({\n events: ['click'],\n fieldsObj: {},\n attributePrefix: 'ga-',\n hitFilter: null\n }, opts);\n\n this.tracker = tracker;\n\n // Binds methods.\n this.handleEvents = this.handleEvents.bind(this);\n\n var selector = '[' + this.opts.attributePrefix + 'on]';\n\n // Creates a mapping of events to their delegates\n this.delegates = {};\n this.opts.events.forEach(function(event) {\n this.delegates[event] = delegate(document, event, selector,\n this.handleEvents, {composed: true, useCapture: true});\n }.bind(this));\n}\n\n\n/**\n * Handles all clicks on elements with event attributes.\n * @param {Event} event The DOM click event.\n * @param {Element} element The delegated DOM element target.\n */\nEventTracker.prototype.handleEvents = function(event, element) {\n\n var prefix = this.opts.attributePrefix;\n\n // Ensures the event type matches the one specified on the element.\n if (event.type != element.getAttribute(prefix + 'on')) return;\n\n var defaultFields = {transport: 'beacon'};\n var attributeFields = getAttributeFields(element, prefix);\n var userFields = assign({}, this.opts.fieldsObj, attributeFields);\n var hitType = attributeFields.hitType || 'event';\n\n this.tracker.send(hitType, createFieldsObj(\n defaultFields, userFields, this.tracker, this.opts.hitFilter, element));\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nEventTracker.prototype.remove = function() {\n Object.keys(this.delegates).forEach(function(key) {\n this.delegates[key].destroy();\n }.bind(this));\n};\n\n\nprovide('eventTracker', EventTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\nvar domReady = require('../utilities').domReady;\nvar getAttributeFields = require('../utilities').getAttributeFields;\n\n\n/**\n * Registers impression tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction ImpressionTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.IMPRESSION_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!(window.IntersectionObserver && window.MutationObserver)) return;\n\n this.opts = assign({\n elements: [],\n rootMargin: '0px',\n fieldsObj: {},\n attributePrefix: 'ga-',\n hitFilter: null\n }, opts);\n\n this.tracker = tracker;\n\n // Binds methods.\n this.handleDomMutations = this.handleDomMutations.bind(this);\n this.walkNodeTree = this.walkNodeTree.bind(this);\n this.handleIntersectionChanges = this.handleIntersectionChanges.bind(this);\n this.startObserving = this.startObserving.bind(this);\n this.observeElement = this.observeElement.bind(this);\n this.handleDomElementRemoved = this.handleDomElementRemoved.bind(this);\n\n var data = this.deriveDataFromConfigOptions();\n\n // The primary list of elements to observe. Each item contains the\n // element ID, threshold, and whether it's currently in-view.\n this.items = data.items;\n\n // A hash map of elements contained in the items array.\n this.elementMap = data.elementMap;\n\n // A sorted list of threshold values contained in the items array.\n this.threshold = data.threshold;\n\n this.intersectionObserver = this.initIntersectionObserver();\n this.mutationObserver = this.initMutationObserver();\n\n // Once the DOM is ready, start observing for changes.\n domReady(this.startObserving);\n}\n\n\n/**\n * Loops through each element in the `elements` configuration option and\n * creates a map of element IDs currently being observed, a list of \"items\"\n * (which contains each element's `threshold` and `trackFirstImpressionOnly`\n * property), and a list of `threshold` values to pass to the\n * `IntersectionObserver` instance.\n * @return {Object} An object with the properties `items`, `elementMap`\n * and `threshold`.\n */\nImpressionTracker.prototype.deriveDataFromConfigOptions = function() {\n var items = [];\n var threshold = [];\n\n // A map of element IDs in the `items` array to DOM elements in the document.\n // The presence of a key indicates that the element ID is in the `items`\n // array, and the presence of an element value indicates that the element\n // is in the DOM.\n var elementMap = {};\n\n this.opts.elements.forEach(function(item) {\n // The item can be just a string if it's OK with all the defaults.\n if (typeof item == 'string') item = {id: item};\n\n items.push(item = assign({\n threshold: 0,\n trackFirstImpressionOnly: true\n }, item));\n\n elementMap[item.id] = null;\n threshold.push(item.threshold);\n });\n\n return {\n items: items,\n elementMap: elementMap,\n threshold: threshold\n };\n};\n\n\n/**\n * Initializes a new `MutationObsever` instance and registers the callback.\n * @return {MutationObserver} The new MutationObserver instance.\n */\nImpressionTracker.prototype.initMutationObserver = function() {\n return new MutationObserver(this.handleDomMutations);\n};\n\n\n/**\n * Initializes a new `IntersectionObsever` instance with the appropriate\n * options and registers the callback.\n * @return {IntersectionObserver} The newly created instance.\n */\nImpressionTracker.prototype.initIntersectionObserver = function() {\n return new IntersectionObserver(this.handleIntersectionChanges, {\n rootMargin: this.opts.rootMargin,\n threshold: this.threshold\n });\n};\n\n\n/**\n * Starts observing each eleemnt to intersections as well as the entire DOM\n * for node changes.\n */\nImpressionTracker.prototype.startObserving = function() {\n // Start observing elements for intersections.\n Object.keys(this.elementMap).forEach(this.observeElement);\n\n // Start observing the DOM for added and removed elements.\n this.mutationObserver.observe(document.body, {\n childList: true,\n subtree: true\n });\n\n // TODO(philipwalton): Remove temporary hack to force a new frame\n // immediately after adding observers.\n // https://bugs.chromium.org/p/chromium/issues/detail?id=612323\n requestAnimationFrame(function() {});\n};\n\n\n/**\n * Adds an element to the `elementMap` map and registers it for observation\n * on `this.intersectionObserver`.\n * @param {string} id The ID of the element to observe.\n */\nImpressionTracker.prototype.observeElement = function(id) {\n var element = this.elementMap[id] ||\n (this.elementMap[id] = document.getElementById(id));\n\n if (element) this.intersectionObserver.observe(element);\n};\n\n\n/**\n * Handles nodes being added or removed from the DOM. This function is passed\n * as the callback to `this.mutationObserver`.\n * @param {Array} mutations A list of `MutationRecord` instances\n */\nImpressionTracker.prototype.handleDomMutations = function(mutations) {\n for (var i = 0, mutation; mutation = mutations[i]; i++) {\n // Handles removed elements.\n for (var k = 0, removedEl; removedEl = mutation.removedNodes[k]; k++) {\n this.walkNodeTree(removedEl, this.handleDomElementRemoved);\n }\n // Handles added elements.\n for (var j = 0, addedEl; addedEl = mutation.addedNodes[j]; j++) {\n this.walkNodeTree(addedEl, this.observeElement);\n }\n }\n};\n\n\n/**\n * Iterates through all descendents of a DOM node and invokes the passed\n * callback if any of them match an elememt in `elementMap`.\n * @param {Node} node The DOM node to walk.\n * @param {Function} callback A function to be invoked if a match is found.\n */\nImpressionTracker.prototype.walkNodeTree = function(node, callback) {\n if (node.nodeType == 1 && node.id in this.elementMap) {\n callback(node.id);\n }\n for (var i = 0, child; child = node.childNodes[i]; i++) {\n this.walkNodeTree(child, callback);\n }\n};\n\n\n/**\n * Handles intersection changes. This function is passed as the callback to\n * `this.intersectionObserver`\n * @param {Array} records A list of `IntersectionObserverEntry` records.\n */\nImpressionTracker.prototype.handleIntersectionChanges = function(records) {\n for (var i = 0, record; record = records[i]; i++) {\n for (var j = 0, item; item = this.items[j]; j++) {\n if (record.target.id !== item.id) continue;\n\n if (isTargetVisible(item.threshold, record)) {\n this.handleImpression(item.id);\n\n if (item.trackFirstImpressionOnly) {\n this.items.splice(j, 1);\n j--;\n this.possiblyUnobserveElement(item.id);\n }\n }\n }\n }\n\n // If all items have been removed, remove the plugin.\n if (this.items.length === 0) this.remove();\n};\n\n\n/**\n * Sends a hit to Google Analytics with the impression data.\n * @param {string} id The ID of the element making the impression.\n */\nImpressionTracker.prototype.handleImpression = function(id) {\n var element = document.getElementById(id);\n\n var defaultFields = {\n transport: 'beacon',\n eventCategory: 'Viewport',\n eventAction: 'impression',\n eventLabel: id\n };\n\n var userFields = assign({}, this.opts.fieldsObj,\n getAttributeFields(element, this.opts.attributePrefix));\n\n this.tracker.send('event', createFieldsObj(defaultFields,\n userFields, this.tracker, this.opts.hitFilter, element));\n};\n\n\n/**\n * Inspects the `items` array after an item was removed. If the removed\n * item's element ID is not found in any other item, the element stops being\n * observed for intersection changes and is removed from `elementMap`.\n * @param {string} id The element ID to check for possible unobservation.\n */\nImpressionTracker.prototype.possiblyUnobserveElement = function(id) {\n if (!this.itemsIncludesId(id)) {\n this.intersectionObserver.unobserve(this.elementMap[id]);\n delete this.elementMap[id];\n }\n};\n\n\n/**\n * Handles an element currently being observed for intersections being removed\n * from the DOM.\n * @param {string} id The ID of the element that was removed.\n */\nImpressionTracker.prototype.handleDomElementRemoved = function(id) {\n this.intersectionObserver.unobserve(this.elementMap[id]);\n this.elementMap[id] = null;\n};\n\n\n/**\n * Scans the `items` array for the presense of an item with the passed ID.\n * @param {string} id The ID of the element to search for.\n * @return {boolean} True if the element ID was found in one of the items.\n */\nImpressionTracker.prototype.itemsIncludesId = function(id) {\n return this.items.some(function(item) {\n return id == item.id;\n });\n};\n\n\n/**\n * Removes all listeners and observers.\n */\nImpressionTracker.prototype.remove = function() {\n this.mutationObserver.disconnect();\n this.intersectionObserver.disconnect();\n};\n\n\nprovide('impressionTracker', ImpressionTracker);\n\n\n/**\n * Detects whether or not an intersection record represents a visible target\n * given a particular threshold.\n * @param {number} threshold The threshold the target is visible above.\n * @param {IntersectionObserverEntry} record The most recent record entry.\n * @return {boolean} True if the target is visible.\n */\nfunction isTargetVisible(threshold, record) {\n if (threshold === 0) {\n var i = record.intersectionRect;\n return i.top > 0 || i.bottom > 0 || i.left > 0 || i.right > 0;\n }\n else {\n return record.intersectionRatio >= threshold;\n }\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar debounce = require('debounce');\nvar constants = require('../constants');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\nvar isObject = require('../utilities').isObject;\nvar toArray = require('../utilities').toArray;\n\n\n/**\n * Declares the MediaQueryListener instance cache.\n */\nvar mediaMap = {};\n\n\n/**\n * Registers media query tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction MediaQueryTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.MEDIA_QUERY_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.matchMedia) return;\n\n this.opts = assign({\n definitions: null,\n changeTemplate: this.changeTemplate,\n changeTimeout: 1000,\n fieldsObj: {},\n hitFilter: null\n }, opts);\n\n // Exits early if media query data doesn't exist.\n if (!isObject(this.opts.definitions)) return;\n\n this.opts.definitions = toArray(this.opts.definitions);\n this.tracker = tracker;\n this.changeListeners = [];\n\n this.processMediaQueries();\n}\n\n\n/**\n * Loops through each media query definition, sets the custom dimenion data,\n * and adds the change listeners.\n */\nMediaQueryTracker.prototype.processMediaQueries = function() {\n this.opts.definitions.forEach(function(definition) {\n // Only processes definitions with a name and index.\n if (definition.name && definition.dimensionIndex) {\n var mediaName = this.getMatchName(definition);\n this.tracker.set('dimension' + definition.dimensionIndex, mediaName);\n\n this.addChangeListeners(definition);\n }\n }.bind(this));\n};\n\n\n/**\n * Takes a definition object and return the name of the matching media item.\n * If no match is found, the NULL_DIMENSION value is returned.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension.\n * @return {string} The name of the matched media or NULL_DIMENSION.\n */\nMediaQueryTracker.prototype.getMatchName = function(definition) {\n var match;\n\n definition.items.forEach(function(item) {\n if (getMediaListener(item.media).matches) {\n match = item;\n }\n });\n return match ? match.name : constants.NULL_DIMENSION;\n};\n\n\n/**\n * Adds change listeners to each media query in the definition list.\n * Debounces the changes to prevent unnecessary hits from being sent.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension\n */\nMediaQueryTracker.prototype.addChangeListeners = function(definition) {\n definition.items.forEach(function(item) {\n var mql = getMediaListener(item.media);\n var fn = debounce(function() {\n this.handleChanges(definition);\n }.bind(this), this.opts.changeTimeout);\n\n mql.addListener(fn);\n this.changeListeners.push({mql: mql, fn: fn});\n }.bind(this));\n};\n\n\n/**\n * Handles changes to the matched media. When the new value differs from\n * the old value, a change event is sent.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension\n */\nMediaQueryTracker.prototype.handleChanges = function(definition) {\n var newValue = this.getMatchName(definition);\n var oldValue = this.tracker.get('dimension' + definition.dimensionIndex);\n\n if (newValue !== oldValue) {\n this.tracker.set('dimension' + definition.dimensionIndex, newValue);\n\n var defaultFields = {\n eventCategory: definition.name,\n eventAction: 'change',\n eventLabel: this.opts.changeTemplate(oldValue, newValue)\n };\n this.tracker.send('event', createFieldsObj(\n defaultFields, this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nMediaQueryTracker.prototype.remove = function() {\n for (var i = 0, listener; listener = this.changeListeners[i]; i++) {\n listener.mql.removeListener(listener.fn);\n }\n};\n\n\n/**\n * Sets the default formatting of the change event label.\n * This can be overridden by setting the `changeTemplate` option.\n * @param {string} oldValue The value of the media query prior to the change.\n * @param {string} newValue The value of the media query after the change.\n * @return {string} The formatted event label.\n */\nMediaQueryTracker.prototype.changeTemplate = function(oldValue, newValue) {\n return oldValue + ' => ' + newValue;\n};\n\n\n/**\n * Accepts a media query and returns a MediaQueryListener object.\n * Caches the values to avoid multiple unnecessary instances.\n * @param {string} media A media query value.\n * @return {MediaQueryListener} The matched media.\n */\nfunction getMediaListener(media) {\n // Returns early if the media is cached.\n if (mediaMap[media]) return mediaMap[media];\n\n mediaMap[media] = window.matchMedia(media);\n return mediaMap[media];\n}\n\n\nprovide('mediaQueryTracker', MediaQueryTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar delegate = require('dom-utils/lib/delegate');\nvar parseUrl = require('dom-utils/lib/parse-url');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\nvar getAttributeFields = require('../utilities').getAttributeFields;\nvar withTimeout = require('../utilities').withTimeout;\n\n\n/**\n * Registers outbound form tracking.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction OutboundFormTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.OUTBOUND_FORM_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = assign({\n formSelector: 'form',\n shouldTrackOutboundForm: this.shouldTrackOutboundForm,\n fieldsObj: {},\n attributePrefix: 'ga-',\n hitFilter: null\n }, opts);\n\n this.tracker = tracker;\n\n this.delegate = delegate(document, 'submit', 'form',\n this.handleFormSubmits.bind(this), {composed: true, useCapture: true});\n}\n\n\n/**\n * Handles all submits on form elements. A form submit is considered outbound\n * if its action attribute starts with http and does not contain\n * location.hostname.\n * When the beacon transport method is not available, the event's default\n * action is prevented and re-emitted after the hit is sent.\n * @param {Event} event The DOM submit event.\n * @param {Element} form The delegated event target.\n */\nOutboundFormTracker.prototype.handleFormSubmits = function(event, form) {\n\n var action = parseUrl(form.action).href;\n var defaultFields = {\n transport: 'beacon',\n eventCategory: 'Outbound Form',\n eventAction: 'submit',\n eventLabel: action\n };\n\n if (this.opts.shouldTrackOutboundForm(form, parseUrl)) {\n\n if (!navigator.sendBeacon) {\n // Stops the submit and waits until the hit is complete (with timeout)\n // for browsers that don't support beacon.\n event.preventDefault();\n defaultFields.hitCallback = withTimeout(function() {\n form.submit();\n });\n }\n\n var userFields = assign({}, this.opts.fieldsObj,\n getAttributeFields(form, this.opts.attributePrefix));\n\n this.tracker.send('event', createFieldsObj(\n defaultFields, userFields, this.tracker, this.opts.hitFilter, form));\n }\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit when a form is\n * submitted. By default, forms with an action attribute that starts with\n * \"http\" and doesn't contain the current hostname are tracked.\n * @param {Element} form The form that was submitted.\n * @param {Function} parseUrl A cross-browser utility method for url parsing.\n * @return {boolean} Whether or not the form should be tracked.\n */\nOutboundFormTracker.prototype.shouldTrackOutboundForm =\n function(form, parseUrl) {\n\n var url = parseUrl(form.action);\n return url.hostname != location.hostname &&\n url.protocol.slice(0, 4) == 'http';\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nOutboundFormTracker.prototype.remove = function() {\n this.delegate.destroy();\n};\n\n\nprovide('outboundFormTracker', OutboundFormTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar delegate = require('dom-utils/lib/delegate');\nvar parseUrl = require('dom-utils/lib/parse-url');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\nvar getAttributeFields = require('../utilities').getAttributeFields;\n\n\n/**\n * Registers outbound link tracking on a tracker object.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction OutboundLinkTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.OUTBOUND_LINK_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = assign({\n events: ['click'],\n linkSelector: 'a',\n shouldTrackOutboundLink: this.shouldTrackOutboundLink,\n fieldsObj: {},\n attributePrefix: 'ga-',\n hitFilter: null\n }, opts);\n\n this.tracker = tracker;\n\n // Binds methods.\n this.handleLinkInteractions = this.handleLinkInteractions.bind(this);\n\n // Creates a mapping of events to their delegates\n this.delegates = {};\n this.opts.events.forEach(function(event) {\n this.delegates[event] = delegate(document, event, this.opts.linkSelector,\n this.handleLinkInteractions, {composed: true, useCapture: true});\n }.bind(this));\n}\n\n\n/**\n * Handles all interactions on link elements. A link is considered an outbound\n * link if its hostname property does not match location.hostname. When the\n * beacon transport method is not available, the links target is set to\n * \"_blank\" to ensure the hit can be sent.\n * @param {Event} event The DOM click event.\n * @param {Element} link The delegated event target.\n */\nOutboundLinkTracker.prototype.handleLinkInteractions = function(event, link) {\n\n if (this.opts.shouldTrackOutboundLink(link, parseUrl)) {\n // Opens outbound links in a new tab if the browser doesn't support\n // the beacon transport method.\n if (!navigator.sendBeacon) {\n link.target = '_blank';\n }\n\n var defaultFields = {\n transport: 'beacon',\n eventCategory: 'Outbound Link',\n eventAction: event.type,\n eventLabel: link.href\n };\n\n var userFields = assign({}, this.opts.fieldsObj,\n getAttributeFields(link, this.opts.attributePrefix));\n\n this.tracker.send('event', createFieldsObj(\n defaultFields, userFields, this.tracker, this.opts.hitFilter, link));\n }\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit when a link is\n * clicked. By default links with a hostname property not equal to the current\n * hostname are tracked.\n * @param {Element} link The link that was clicked on.\n * @param {Function} parseUrl A cross-browser utility method for url parsing.\n * @return {boolean} Whether or not the link should be tracked.\n */\nOutboundLinkTracker.prototype.shouldTrackOutboundLink =\n function(link, parseUrl) {\n\n var url = parseUrl(link.href);\n return url.hostname != location.hostname &&\n url.protocol.slice(0, 4) == 'http';\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nOutboundLinkTracker.prototype.remove = function() {\n Object.keys(this.delegates).forEach(function(key) {\n this.delegates[key].destroy();\n }.bind(this));\n};\n\n\nprovide('outboundLinkTracker', OutboundLinkTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\nvar isObject = require('../utilities').isObject;\n\n\nvar DEFAULT_SESSION_TIMEOUT = 30; // 30 minutes.\n\n\n/**\n * Registers outbound link tracking on tracker object.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction PageVisibilityTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.PAGE_VISIBILITY_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = assign({\n sessionTimeout: DEFAULT_SESSION_TIMEOUT,\n changeTemplate: this.changeTemplate,\n hiddenMetricIndex: null,\n visibleMetricIndex: null,\n fieldsObj: {},\n hitFilter: null\n }, opts);\n\n this.tracker = tracker;\n this.visibilityState = document.visibilityState;\n\n // Consider the plugin creation to be the start of the visibility change\n // time calculations.\n this.lastVisibilityChangeTime = +new Date;\n\n // Binds methods to `this`.\n this.handleVisibilityStateChange =\n this.handleVisibilityStateChange.bind(this);\n\n this.overrideTrackerSendMethod();\n this.overrideTrackerSendHitTask();\n\n document.addEventListener(\n 'visibilitychange', this.handleVisibilityStateChange);\n}\n\n\n/**\n * Handles changes to `document.visibilityState`. This method sends events when\n * the visibility state changes during active sessions (active meaning the\n * session has not timed out). If the session has timed out, a return to a\n * visibility state of visible will trigger a new pageview (instead of a\n * visibility change event). Lastly, this method keeps track of the elapsed\n * time a document's visibility state was visible and sends that as the event\n * value for hidden events, allowing you to more accurately derive how long\n * a user spent active during a session.\n */\nPageVisibilityTracker.prototype.handleVisibilityStateChange = function() {\n\n var defaultFields;\n this.prevVisibilityState = this.visibilityState;\n this.visibilityState = document.visibilityState;\n\n if (this.sessionHasTimedOut()) {\n // Prevents sending 'hidden' state hits when the session has timed out.\n if (this.visibilityState == 'hidden') return;\n\n if (this.visibilityState == 'visible') {\n // If the session has timed out, a transition to \"visible\" should be\n // considered a new pageview and a new session.\n defaultFields = {transport: 'beacon'};\n this.tracker.send('pageview', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n }\n else {\n // Rounds the time up to the nearest second. If the rounded value is zero\n // use 1 instead since unset metrics default to 0.\n var timeDeltaInSeconds = Math.round(\n (new Date - this.lastVisibilityChangeTime) / 1000) || 1;\n\n defaultFields = {\n transport: 'beacon',\n eventCategory: 'Page Visibility',\n eventAction: 'change',\n eventLabel: this.opts.changeTemplate(\n this.prevVisibilityState, this.visibilityState),\n eventValue: timeDeltaInSeconds\n };\n\n // Changes to hidden are non interaction hits by default\n if (this.visibilityState == 'hidden') defaultFields.nonInteraction = true;\n\n // If a custom metric was specified for the current visibility state,\n // give it the same as the event value.\n var metric = this.opts[this.prevVisibilityState + 'MetricIndex'];\n if (metric) defaultFields['metric' + metric] = timeDeltaInSeconds;\n\n this.tracker.send('event', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n\n // Updates the time the last visibility state change event occurred, so\n // change events can report the delta.\n this.lastVisibilityChangeTime = +new Date;\n};\n\n\n/**\n * Returns true if the session has not timed out. A session timeout occurs when\n * more than `this.opts.sessionTimeout` minutes has elapsed since the\n * tracker sent the previous hit.\n * @return {boolean} True if the session has timed out.\n */\nPageVisibilityTracker.prototype.sessionHasTimedOut = function() {\n var minutesSinceLastHit = (new Date - this.lastHitTime) / (60 * 1000);\n return this.opts.sessionTimeout < minutesSinceLastHit;\n};\n\n\n/**\n * Overrides the `tracker.send` method to send a pageview hit before the\n * current hit being sent if the session has timed out and the current hit is\n * not a pageview itself.\n */\nPageVisibilityTracker.prototype.overrideTrackerSendMethod = function() {\n this.originalTrackerSendMethod = this.tracker.send;\n\n this.tracker.send = function() {\n var args = Array.prototype.slice.call(arguments);\n var firstArg = args[0];\n var hitType = isObject(firstArg) ? firstArg.hitType : firstArg;\n var isPageview = hitType == 'pageview';\n\n if (!isPageview && this.sessionHasTimedOut()) {\n var defaultFields = {transport: 'beacon'};\n this.originalTrackerSendMethod.call(this.tracker, 'pageview',\n createFieldsObj(defaultFields, this.opts.fieldsObj,\n this.tracker, this.opts.hitFilter));\n }\n\n this.originalTrackerSendMethod.apply(this.tracker, args);\n }.bind(this);\n};\n\n\n/**\n * Overrides the tracker's `sendHitTask` to record the time of the previous\n * hit. This is used to determine whether or not a session has timed out.\n */\nPageVisibilityTracker.prototype.overrideTrackerSendHitTask = function() {\n this.originalTrackerSendHitTask = this.tracker.get('sendHitTask');\n this.lastHitTime = +new Date;\n\n this.tracker.set('sendHitTask', function(model) {\n this.originalTrackerSendHitTask(model);\n this.lastHitTime = +new Date;\n }.bind(this));\n};\n\n\n/**\n * Sets the default formatting of the change event label.\n * This can be overridden by setting the `changeTemplate` option.\n * @param {string} oldValue The value of the media query prior to the change.\n * @param {string} newValue The value of the media query after the change.\n * @return {string} The formatted event label.\n */\nPageVisibilityTracker.prototype.changeTemplate = function(oldValue, newValue) {\n return oldValue + ' => ' + newValue;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\n PageVisibilityTracker.prototype.remove = function() {\n this.tracker.set('sendHitTask', this.originalTrackerSendHitTask);\n this.tracker.send = this.originalTrackerSendMethod;\n\n document.removeEventListener(\n 'visibilitychange', this.handleVisibilityStateChange);\n};\n\n\nprovide('pageVisibilityTracker', PageVisibilityTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/* global FB, twttr */\n\n\nvar assign = require('object-assign');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\n\n\n/**\n * Registers social tracking on tracker object.\n * Supports both declarative social tracking via HTML attributes as well as\n * tracking for social events when using official Twitter or Facebook widgets.\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction SocialWidgetTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.SOCIAL_WIDGET_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n this.opts = assign({\n fieldsObj: {},\n hitFilter: null\n }, opts);\n\n this.tracker = tracker;\n\n // Binds methods to `this`.\n this.addWidgetListeners = this.addWidgetListeners.bind(this);\n this.addTwitterEventHandlers = this.addTwitterEventHandlers.bind(this);\n this.handleTweetEvents = this.handleTweetEvents.bind(this);\n this.handleFollowEvents = this.handleFollowEvents.bind(this);\n this.handleLikeEvents = this.handleLikeEvents.bind(this);\n this.handleUnlikeEvents = this.handleUnlikeEvents.bind(this);\n\n if (document.readyState != 'complete') {\n // Adds the widget listeners after the window's `load` event fires.\n // If loading widgets using the officially recommended snippets, they\n // will be available at `window.load`. If not users can call the\n // `addWidgetListeners` method manually.\n window.addEventListener('load', this.addWidgetListeners);\n }\n else {\n this.addWidgetListeners();\n }\n}\n\n\n/**\n * Invokes the methods to add Facebook and Twitter widget event listeners.\n * Ensures the respective global namespaces are present before adding.\n */\nSocialWidgetTracker.prototype.addWidgetListeners = function() {\n if (window.FB) this.addFacebookEventHandlers();\n if (window.twttr) this.addTwitterEventHandlers();\n};\n\n\n/**\n * Adds event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons. Note: this does not capture tweet or\n * follow events emitted by other Twitter widgets (tweet, timeline, etc.).\n */\nSocialWidgetTracker.prototype.addTwitterEventHandlers = function() {\n try {\n twttr.ready(function() {\n twttr.events.bind('tweet', this.handleTweetEvents);\n twttr.events.bind('follow', this.handleFollowEvents);\n }.bind(this));\n } catch(err) {}\n};\n\n\n/**\n * Removes event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons.\n */\nSocialWidgetTracker.prototype.removeTwitterEventHandlers = function() {\n try {\n twttr.ready(function() {\n twttr.events.unbind('tweet', this.handleTweetEvents);\n twttr.events.unbind('follow', this.handleFollowEvents);\n }.bind(this));\n } catch(err) {}\n};\n\n\n/**\n * Adds event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\nSocialWidgetTracker.prototype.addFacebookEventHandlers = function() {\n try {\n FB.Event.subscribe('edge.create', this.handleLikeEvents);\n FB.Event.subscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {}\n};\n\n\n/**\n * Removes event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\nSocialWidgetTracker.prototype.removeFacebookEventHandlers = function() {\n try {\n FB.Event.unsubscribe('edge.create', this.handleLikeEvents);\n FB.Event.unsubscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {}\n};\n\n\n/**\n * Handles `tweet` events emitted by the Twitter JS SDK.\n * @param {Object} event The Twitter event object passed to the handler.\n */\nSocialWidgetTracker.prototype.handleTweetEvents = function(event) {\n // Ignores tweets from widgets that aren't the tweet button.\n if (event.region != 'tweet') return;\n\n var url = event.data.url || event.target.getAttribute('data-url') ||\n location.href;\n\n var defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Twitter',\n socialAction: 'tweet',\n socialTarget: url\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n};\n\n\n/**\n * Handles `follow` events emitted by the Twitter JS SDK.\n * @param {Object} event The Twitter event object passed to the handler.\n */\nSocialWidgetTracker.prototype.handleFollowEvents = function(event) {\n // Ignore follows from widgets that aren't the follow button.\n if (event.region != 'follow') return;\n\n var screenName = event.data.screen_name ||\n event.target.getAttribute('data-screen-name');\n\n var defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Twitter',\n socialAction: 'follow',\n socialTarget: screenName\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n};\n\n\n/**\n * Handles `like` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the like event.\n */\nSocialWidgetTracker.prototype.handleLikeEvents = function(url) {\n var defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Facebook',\n socialAction: 'like',\n socialTarget: url\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n};\n\n\n/**\n * Handles `unlike` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the unlike event.\n */\nSocialWidgetTracker.prototype.handleUnlikeEvents = function(url) {\n var defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Facebook',\n socialAction: 'unlike',\n socialTarget: url\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nSocialWidgetTracker.prototype.remove = function() {\n window.removeEventListener('load', this.addWidgetListeners);\n this.removeFacebookEventHandlers();\n this.removeTwitterEventHandlers();\n};\n\n\nprovide('socialWidgetTracker', SocialWidgetTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar provide = require('../provide');\nvar usage = require('../usage');\nvar createFieldsObj = require('../utilities').createFieldsObj;\nvar isObject = require('../utilities').isObject;\n\n\n/**\n * Adds handler for the history API methods\n * @constructor\n * @param {Object} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\nfunction UrlChangeTracker(tracker, opts) {\n\n usage.track(tracker, usage.plugins.URL_CHANGE_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!history.pushState || !window.addEventListener) return;\n\n this.opts = assign({\n shouldTrackUrlChange: this.shouldTrackUrlChange,\n fieldsObj: {},\n hitFilter: null\n }, opts);\n\n this.tracker = tracker;\n\n // Sets the initial page field.\n // Don't set this on the tracker yet so campaign data can be retreived\n // from the location field.\n this.path = getPath();\n\n this.updateTrackerData = this.updateTrackerData.bind(this);\n\n // Overrides history.pushState.\n this.originalPushState = history.pushState;\n history.pushState = function(state, title) {\n // Sets the document title for reference later.\n // TODO(philipwalton): consider using WeakMap for this to not conflict\n // with any user-defined property also called \"title\".\n if (isObject(state) && title) state.title = title;\n\n this.originalPushState.apply(history, arguments);\n this.updateTrackerData();\n }.bind(this);\n\n // Overrides history.repaceState.\n this.originalReplaceState = history.replaceState;\n history.replaceState = function(state, title) {\n // Sets the document title for reference later.\n // TODO(philipwalton): consider using WeakMap for this to not conflict\n // with any user-defined property also called \"title\".\n if (isObject(state) && title) state.title = title;\n\n this.originalReplaceState.apply(history, arguments);\n this.updateTrackerData(false);\n }.bind(this);\n\n // Handles URL changes via user interaction.\n window.addEventListener('popstate', this.updateTrackerData);\n}\n\n\n/**\n * Updates the page and title fields on the tracker if necessary and\n * optionally sends a pageview.\n * @param {boolean} shouldSendPageview Indicates whether the tracker should\n * send a pageview after updating the URL.\n */\nUrlChangeTracker.prototype.updateTrackerData = function(shouldSendPageview) {\n\n // Sets the default.\n shouldSendPageview = shouldSendPageview === false ? false : true;\n\n // Calls the update logic asychronously to help ensure user callbacks\n // happen first.\n setTimeout(function() {\n\n var oldPath = this.path;\n var newPath = getPath();\n\n if (oldPath != newPath &&\n this.opts.shouldTrackUrlChange.call(this, newPath, oldPath)) {\n\n this.path = newPath;\n this.tracker.set({\n page: newPath,\n title: isObject(history.state) && history.state.title || document.title\n });\n\n if (shouldSendPageview) {\n var defaultFields = {transport: 'beacon'};\n this.tracker.send('pageview', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n }\n }.bind(this), 0);\n};\n\n\n/**\n * Determines whether or not the tracker should send a hit with the new page\n * data. This default implementation can be overrided in the config options.\n * @param {string} newPath The path prior to the URL change.\n * @param {string} oldPath The path after the URL change.\n * @return {boolean} Whether or not the URL change should be tracked.\n */\nUrlChangeTracker.prototype.shouldTrackUrlChange = function(newPath, oldPath) {\n return newPath && oldPath;\n};\n\n\n/**\n * Removes all event listeners and instance properties.\n */\nUrlChangeTracker.prototype.remove = function() {\n window.removeEventListener('popstate', this.updateTrackerData);\n history.replaceState = this.originalReplaceState;\n history.pushState = this.originalPushState;\n\n this.tracker = null;\n this.opts = null;\n this.path = null;\n\n this.updateTrackerData = null;\n this.originalReplaceState = null;\n this.originalPushState = null;\n};\n\n\n/**\n * @return {string} The path value of the current URL.\n */\nfunction getPath() {\n return location.pathname + location.search;\n}\n\n\nprovide('urlChangeTracker', UrlChangeTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar constants = require('./constants');\nvar utilities = require('./utilities');\n\n\n// Adds the dev ID to the list of dev IDs if any plugin is used.\n(window.gaDevIds = window.gaDevIds || []).push(constants.DEV_ID);\n\n\n/**\n * Provides a plugin for use with analytics.js, accounting for the possibility\n * that the global command queue has been renamed or not yet defined.\n * @param {string} pluginName The plugin name identifier.\n * @param {Function} pluginConstructor The plugin constructor function.\n */\nmodule.exports = function providePlugin(pluginName, pluginConstructor) {\n var gaAlias = window['GoogleAnalyticsObject'] || 'ga';\n window[gaAlias] = window[gaAlias] || function() {\n (window[gaAlias]['q'] = window[gaAlias]['q'] || []).push(arguments);\n };\n\n // Formally provides the plugin for use with analytics.js.\n window[gaAlias]('provide', pluginName, pluginConstructor);\n\n // Registers the plugin on the global gaplugins object.\n window.gaplugins = window.gaplugins || {};\n window.gaplugins[utilities.capitalize(pluginName)] = pluginConstructor;\n};\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar constants = require('./constants');\n\n\nvar plugins = {\n CLEAN_URL_TRACKER: 1,\n EVENT_TRACKER: 2,\n IMPRESSION_TRACKER: 3,\n MEDIA_QUERY_TRACKER: 4,\n OUTBOUND_FORM_TRACKER: 5,\n OUTBOUND_LINK_TRACKER: 6,\n PAGE_VISIBILITY_TRACKER: 7,\n SOCIAL_WIDGET_TRACKER: 8,\n URL_CHANGE_TRACKER: 9\n};\nvar PLUGIN_COUNT = 9;\n\n\n/**\n * Converts a hexadecimal string to a binary string.\n * @param {string} hex A hexadecimal numeric string.\n * @return {string} a binary numeric string.\n */\nfunction convertHexToBin(hex) {\n return parseInt(hex || '0', 16).toString(2);\n}\n\n\n/**\n * Converts a binary string to a hexadecimal string.\n * @param {string} bin A binary numeric string.\n * @return {string} a hexadecimal numeric string.\n */\nfunction convertBinToHex(bin) {\n return parseInt(bin || '0', 2).toString(16);\n}\n\n\n/**\n * Adds leading zeros to a string if it's less than a minimum length.\n * @param {string} str A string to pad.\n * @param {number} len The minimum length of the string\n * @return {string} The padded string.\n */\nfunction padZeros(str, len) {\n if (str.length < len) {\n var toAdd = len - str.length;\n while (toAdd) {\n str = '0' + str;\n toAdd--;\n }\n }\n return str;\n}\n\n\n/**\n * Accepts a binary numeric string and flips the digit from 0 to 1 at the\n * specified index.\n * @param {string} str The binary numeric string.\n * @param {number} index The index to flip the bit.\n * @return {string} The new binary string with the bit flipped on\n */\nfunction flipBitOn(str, index) {\n return str.substr(0, index) + 1 + str.substr(index + 1);\n}\n\n\n/**\n * Accepts a tracker and a plugin index and flips the bit at the specified\n * index on the tracker's usage parameter.\n * @param {Object} tracker An analytics.js tracker.\n * @param {number} pluginIndex The index of the plugin in the global list.\n */\nfunction trackPlugin(tracker, pluginIndex) {\n var usageHex = tracker.get(constants.USAGE_PARAM);\n var usageBin = padZeros(convertHexToBin(usageHex), PLUGIN_COUNT);\n\n // Flip the bit of the plugin being tracked.\n usageBin = flipBitOn(usageBin, PLUGIN_COUNT - pluginIndex);\n\n // Stores the modified usage string back on the tracker.\n tracker.set(constants.USAGE_PARAM, convertBinToHex(usageBin));\n}\n\n\n/**\n * Accepts a tracker and adds the current version to the version param.\n * @param {Object} tracker An analytics.js tracker.\n */\nfunction trackVersion(tracker) {\n tracker.set(constants.VERSION_PARAM, constants.VERSION);\n}\n\n\nmodule.exports = {\n track: function(tracker, plugin) {\n trackVersion(tracker);\n trackPlugin(tracker, plugin);\n },\n plugins: plugins\n};\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar assign = require('object-assign');\nvar getAttributes = require('dom-utils/lib/get-attributes');\n\n\nvar utilities = {\n\n\n /**\n * Accepts default and user override fields and an optional tracker, hit\n * filter, and target element and returns a single object that can be used in\n * `ga('send', ...)` commands.\n * @param {Object} defaultFields The default fields to return.\n * @param {Object} userFields Fields set by the user to override the defaults.\n * @param {Object} opt_tracker The tracker object to apply the hit filter to.\n * @param {Function} opt_hitFilter A filter function that gets\n * called with the tracker model right before the `buildHitTask`. It can\n * be used to modify the model for the current hit only.\n * @param {Element} opt_target If the hit originated from an interaction\n * with a DOM element, hitFilter is invoked with that element as the\n * second argument.\n * @return {Object} The final fields object.\n */\n createFieldsObj: function(\n defaultFields, userFields, opt_tracker, opt_hitFilter, opt_target) {\n\n if (typeof opt_hitFilter == 'function') {\n var originalBuildHitTask = opt_tracker.get('buildHitTask');\n return {\n buildHitTask: function(model) {\n model.set(defaultFields, null, true);\n model.set(userFields, null, true);\n opt_hitFilter(model, opt_target);\n originalBuildHitTask(model);\n }\n };\n }\n else {\n return assign({}, defaultFields, userFields);\n }\n },\n\n\n /**\n * Retrieves the attributes from an DOM element and returns a fields object\n * for all attributes matching the passed prefix string.\n * @param {Element} element The DOM element to get attributes from.\n * @param {string} prefix An attribute prefix. Only the attributes matching\n * the prefix will be returned on the fields object.\n * @return {Object} An object of analytics.js fields and values\n */\n getAttributeFields: function(element, prefix) {\n var attributes = getAttributes(element);\n var attributeFields = {};\n\n Object.keys(attributes).forEach(function(attribute) {\n\n // The `on` prefix is used for event handling but isn't a field.\n if (attribute.indexOf(prefix) === 0 && attribute != prefix + 'on') {\n\n var value = attributes[attribute];\n\n // Detects Boolean value strings.\n if (value == 'true') value = true;\n if (value == 'false') value = false;\n\n var field = utilities.camelCase(attribute.slice(prefix.length));\n attributeFields[field] = value;\n }\n });\n\n return attributeFields;\n },\n\n\n domReady: function(callback) {\n if (document.readyState == 'loading') {\n document.addEventListener('DOMContentLoaded', function fn() {\n document.removeEventListener('DOMContentLoaded', fn);\n callback();\n });\n } else {\n callback();\n }\n },\n\n\n /**\n * Accepts a function and returns a wrapped version of the function that is\n * expected to be called elsewhere in the system. If it's not called\n * elsewhere after the timeout period, it's called regardless. The wrapper\n * function also prevents the callback from being called more than once.\n * @param {Function} callback The function to call.\n * @param {number} wait How many milliseconds to wait before invoking\n * the callback.\n * @returns {Function} The wrapped version of the passed function.\n */\n withTimeout: function(callback, wait) {\n var called = false;\n setTimeout(callback, wait || 2000);\n return function() {\n if (!called) {\n called = true;\n callback();\n }\n };\n },\n\n\n /**\n * Accepts a string containing hyphen or underscore word separators and\n * converts it to camelCase.\n * @param {string} str The string to camelCase.\n * @return {string} The camelCased version of the string.\n */\n camelCase: function(str) {\n return str.replace(/[\\-\\_]+(\\w?)/g, function(match, p1) {\n return p1.toUpperCase();\n });\n },\n\n\n /**\n * Capitalizes the first letter of a string.\n * @param {string} str The input string.\n * @return {string} The capitalized string\n */\n capitalize: function(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n\n\n /**\n * Indicates whether the passed variable is a JavaScript object.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the test is an object.\n */\n isObject: function(value) {\n return typeof value == 'object' && value !== null;\n },\n\n\n /**\n * Indicates whether the passed variable is a JavaScript array.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the value is an array.\n */\n isArray: Array.isArray || function(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n\n /**\n * Accepts a value that may or may not be an array. If it is not an array,\n * it is returned as the first item in a single-item array.\n * @param {*} value The value to convert to an array if it is not.\n * @return {Array} The array-ified value.\n */\n toArray: function(value) {\n return utilities.isArray(value) ? value : [value];\n }\n};\n\nmodule.exports = utilities;\n","module.exports = Date.now || now\n\nfunction now() {\n return new Date().getTime()\n}\n","\n/**\n * Module dependencies.\n */\n\nvar now = require('date-now');\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\n\nmodule.exports = function debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = now() - timestamp;\n\n if (last < wait && last > 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n }\n }\n };\n\n return function debounced() {\n context = this;\n args = arguments;\n timestamp = now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n};\n","var matches = require('./matches');\nvar parents = require('./parents');\n\n/**\n * Gets the closest parent element that matches the passed selector.\n * @param {Element} element The element whose parents to check.\n * @param {string} selector The CSS selector to match against.\n * @param {boolean} shouldCheckSelf True if the selector should test against\n * the passed element itself.\n * @return {?Element} The matching element or undefined.\n */\nmodule.exports = function closest(element, selector, shouldCheckSelf) {\n if (!(element && element.nodeType == 1 && selector)) return;\n\n var parentElements =\n (shouldCheckSelf ? [element] : []).concat(parents(element));\n\n for (var i = 0, parent; parent = parentElements[i]; i++) {\n if (matches(parent, selector)) return parent;\n }\n};\n","var closest = require('./closest');\nvar matches = require('./matches');\n\n/**\n * Delegates the handling of events for an element matching a selector to an\n * ancestor of the matching element.\n * @param {Element} ancestor The ancestor element to add the listener to.\n * @param {string} eventType The event type to listen to.\n * @param {string} selector A CSS selector to match against child elements.\n * @param {Function} callback A function to run any time the event happens.\n * @param {Object} opts A configuration options object. The available options:\n * - useCapture<boolean>: If true, bind to the event capture phase.\n * - deep<boolean>: If true, delegate into shadow trees.\n * @return {Object} The delegate object. It contains a destroy method.\n */\n module.exports = function delegate(\n ancestor, eventType, selector, callback, opts) {\n\n opts = opts || {};\n\n // Defines the event listener.\n var listener = function(event) {\n\n // If opts.composed is true and the event originated from inside a Shadow\n // tree, check the composed path nodes.\n if (opts.composed && typeof event.composedPath == 'function') {\n var composedPath = event.composedPath();\n for (var i = 0, node; node = composedPath[i]; i++) {\n if (node.nodeType == 1 && matches(node, selector)) {\n delegateTarget = node;\n }\n }\n }\n // Otherwise check the parents.\n else {\n var delegateTarget = closest(event.target, selector, true);\n }\n\n if (delegateTarget) {\n callback.call(delegateTarget, event, delegateTarget);\n }\n };\n\n ancestor.addEventListener(eventType, listener, opts.useCapture);\n\n return {\n destroy: function() {\n ancestor.removeEventListener(eventType, listener, opts.useCapture);\n }\n };\n};\n","/**\n * Gets all attributes of an element as a plain JavaScriot object.\n * @param {Element} element The element whose attributes to get.\n * @return {Object} An object whose keys are the attribute keys and whose\n * values are the attribute values. If no attributes exist, an empty\n * object is returned.\n */\nmodule.exports = function getAttributes(element) {\n var attrs = {};\n\n // Validate input.\n if (!(element && element.nodeType == 1)) return attrs;\n\n // Return an empty object if there are no attributes.\n var map = element.attributes;\n if (map.length === 0) return {};\n\n for (var i = 0, attr; attr = map[i]; i++) {\n attrs[attr.name] = attr.value;\n }\n return attrs;\n};\n","var proto = window.Element.prototype;\nvar nativeMatches = proto.matches ||\n proto.matchesSelector ||\n proto.webkitMatchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector;\n\n\n/**\n * Tests whether a DOM element matches a selector. This polyfills the native\n * Element.prototype.matches method across browsers.\n * @param {Element} element The DOM element to test.\n * @param {string} selector The CSS selector to test element against.\n * @return {boolean} True if the selector matches.\n */\n function matchesSelector(element, selector) {\n if (typeof selector != 'string') return false;\n if (nativeMatches) return nativeMatches.call(element, selector);\n var nodes = element.parentNode.querySelectorAll(selector);\n for (var i = 0, node; node = nodes[i]; i++) {\n if (node == element) return true;\n }\n return false;\n}\n\n\n/**\n * Tests if a DOM elements matches any of the test DOM elements or selectors.\n * @param {Element} element The DOM element to test.\n * @param {Element|string|Array<Element|String>} test A DOM element, a CSS\n * selector, or an array of DOM elements or CSS selectors to match against.\n * @return {boolean} True of any part of the test matches.\n */\nmodule.exports = function matches(element, test) {\n // Validate input.\n if (element && element.nodeType == 1 && test) {\n // if test is a string or DOM element test it.\n if (typeof test == 'string' || test.nodeType == 1) {\n return element == test || matchesSelector(element, test);\n }\n // if it has a length property iterate over the items\n // and return true if any match.\n else if ('length' in test) {\n for (var i = 0, item; item = test[i]; i++) {\n if (element == item || matchesSelector(element, item)) return true;\n }\n }\n }\n // Still here? Return false\n return false;\n};\n","/**\n * Returns an array of a DOM element's parent elements.\n * @param {Element} element The DOM element whose parents to get.\n * @return {Array} An array of all parent elemets, or an empty array if no\n * parent elements are found.\n */\nmodule.exports = function parents(element) {\n var list = [];\n while (element && element.parentNode && element.parentNode.nodeType == 1) {\n list.push(element = element.parentNode);\n }\n return list;\n};\n","var HTTP_PORT = '80';\nvar HTTPS_PORT = '443';\nvar DEFAULT_PORT = RegExp(':(' + HTTP_PORT + '|' + HTTPS_PORT + ')$');\n\n\nvar a = document.createElement('a');\nvar cache = {};\n\n\n/**\n * Parses the given url and returns an object mimicing a `Location` object.\n * @param {string} url The url to parse.\n * @return {Object} An object with the same properties as a `Location`\n * plus the convience properties `path` and `query`.\n */\nmodule.exports = function parseUrl(url) {\n\n // All falsy values (as well as \".\") should map to the current URL.\n url = (!url || url == '.') ? location.href : url;\n\n if (cache[url]) return cache[url];\n\n a.href = url;\n\n // When parsing file relative paths (e.g. `../index.html`), IE will correctly\n // resolve the `href` property but will keep the `..` in the `path` property.\n // To workaround this, we reparse with the full URL from the `href` property.\n if (url.charAt(0) == '.') return parseUrl(a.href);\n\n // Sometimes IE will return no port or just a colon, especially for things\n // like relative port URLs (e.g. \"//google.com\").\n var protocol = !a.protocol || ':' == a.protocol ?\n location.protocol : a.protocol;\n\n // Don't include default ports.\n var port = (a.port == HTTP_PORT || a.port == HTTPS_PORT) ? '' : a.port;\n\n // PhantomJS sets the port to \"0\" when using the file: protocol.\n port = port == '0' ? '' : port;\n\n // IE will return an empty string for host and hostname with a relative URL.\n var host = a.host == '' ? location.host : a.host;\n var hostname = a.hostname == '' ? location.hostname : a.hostname;\n\n // Sometimes IE incorrectly includes a port for default ports\n // (e.g. `:80` or `:443`) even when no port is specified in the URL.\n // http://bit.ly/1rQNoMg\n host = host.replace(DEFAULT_PORT, '');\n\n // Not all browser support `origin` so we have to build it.\n var origin = a.origin ? a.origin : protocol + '//' + host;\n\n // Sometimes IE doesn't include the leading slash for pathname.\n // http://bit.ly/1rQNoMg\n var pathname = a.pathname.charAt(0) == '/' ? a.pathname : '/' + a.pathname;\n\n return cache[url] = {\n hash: a.hash,\n host: host,\n hostname: hostname,\n href: a.href,\n origin: origin,\n\n pathname: pathname,\n port: port,\n protocol: protocol,\n search: a.search,\n\n // Expose additional helpful properties not part of the Location object.\n fragment: a.hash.slice(1), // The hash without the starting \"#\".\n path: pathname + a.search, // The pathname and the search query (w/o hash).\n query: a.search.slice(1) // The search without the starting \"?\".\n };\n};\n","'use strict';\n/* eslint-disable no-unused-vars */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (e) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tsymbols = Object.getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n"],"sourceRoot":"/source/"}