forked from segmentio/analytics.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analytics.component.js
421 lines (362 loc) · 123 KB
/
analytics.component.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
/**
* hasOwnProperty.
*/
var has = Object.prototype.hasOwnProperty;
/**
* Require the given path.
*
* @param {String} path
* @return {Object} exports
* @api public
*/
function require(path, parent, orig) {
var resolved = require.resolve(path);
// lookup failed
if (null == resolved) {
orig = orig || path;
parent = parent || 'root';
var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
err.path = orig;
err.parent = parent;
err.require = true;
throw err;
}
var module = require.modules[resolved];
// perform real require()
// by invoking the module's
// registered function
if (!module.exports) {
module.exports = {};
module.client = module.component = true;
module.call(this, module.exports, require.relative(resolved), module);
}
return module.exports;
}
/**
* Registered modules.
*/
require.modules = {};
/**
* Registered aliases.
*/
require.aliases = {};
/**
* Resolve `path`.
*
* Lookup:
*
* - PATH/index.js
* - PATH.js
* - PATH
*
* @param {String} path
* @return {String} path or null
* @api private
*/
require.resolve = function(path) {
if (path.charAt(0) === '/') path = path.slice(1);
var index = path + '/index.js';
var paths = [
path,
path + '.js',
path + '.json',
path + '/index.js',
path + '/index.json'
];
for (var i = 0; i < paths.length; i++) {
var path = paths[i];
if (has.call(require.modules, path)) return path;
}
if (has.call(require.aliases, index)) {
return require.aliases[index];
}
};
/**
* Normalize `path` relative to the current path.
*
* @param {String} curr
* @param {String} path
* @return {String}
* @api private
*/
require.normalize = function(curr, path) {
var segs = [];
if ('.' != path.charAt(0)) return path;
curr = curr.split('/');
path = path.split('/');
for (var i = 0; i < path.length; ++i) {
if ('..' == path[i]) {
curr.pop();
} else if ('.' != path[i] && '' != path[i]) {
segs.push(path[i]);
}
}
return curr.concat(segs).join('/');
};
/**
* Register module at `path` with callback `definition`.
*
* @param {String} path
* @param {Function} definition
* @api private
*/
require.register = function(path, definition) {
require.modules[path] = definition;
};
/**
* Alias a module definition.
*
* @param {String} from
* @param {String} to
* @api private
*/
require.alias = function(from, to) {
if (!has.call(require.modules, from)) {
throw new Error('Failed to alias "' + from + '", it does not exist');
}
require.aliases[to] = from;
};
/**
* Return a require function relative to the `parent` path.
*
* @param {String} parent
* @return {Function}
* @api private
*/
require.relative = function(parent) {
var p = require.normalize(parent, '..');
/**
* lastIndexOf helper.
*/
function lastIndexOf(arr, obj) {
var i = arr.length;
while (i--) {
if (arr[i] === obj) return i;
}
return -1;
}
/**
* The relative require() itself.
*/
function localRequire(path) {
var resolved = localRequire.resolve(path);
return require(resolved, parent, path);
}
/**
* Resolve relative to the parent.
*/
localRequire.resolve = function(path) {
var c = path.charAt(0);
if ('/' == c) return path.slice(1);
if ('.' == c) return require.normalize(p, path);
// resolve deps by returning
// the dep in the nearest "deps"
// directory
var segs = parent.split('/');
var i = lastIndexOf(segs, 'deps') + 1;
if (!i) i = 0;
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
return path;
};
/**
* Check if module is defined at `path`.
*/
localRequire.exists = function(path) {
return has.call(require.modules, localRequire.resolve(path));
};
return localRequire;
};
require.register("component-clone/index.js", Function("exports, require, module",
"\n/**\n * Module dependencies.\n */\n\nvar type;\n\ntry {\n type = require('type');\n} catch(e){\n type = require('type-component');\n}\n\n/**\n * Module exports.\n */\n\nmodule.exports = clone;\n\n/**\n * Clones objects.\n *\n * @param {Mixed} any object\n * @api public\n */\n\nfunction clone(obj){\n switch (type(obj)) {\n case 'object':\n var copy = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n copy[key] = clone(obj[key]);\n }\n }\n return copy;\n\n case 'array':\n var copy = new Array(obj.length);\n for (var i = 0, l = obj.length; i < l; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n\n case 'regexp':\n // from millermedeiros/amd-utils - MIT\n var flags = '';\n flags += obj.multiline ? 'm' : '';\n flags += obj.global ? 'g' : '';\n flags += obj.ignoreCase ? 'i' : '';\n return new RegExp(obj.source, flags);\n\n case 'date':\n return new Date(obj.getTime());\n\n default: // string, number, boolean, …\n return obj;\n }\n}\n//@ sourceURL=component-clone/index.js"
));
require.register("component-cookie/index.js", Function("exports, require, module",
"/**\n * Encode.\n */\n\nvar encode = encodeURIComponent;\n\n/**\n * Decode.\n */\n\nvar decode = decodeURIComponent;\n\n/**\n * Set or get cookie `name` with `value` and `options` object.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @return {Mixed}\n * @api public\n */\n\nmodule.exports = function(name, value, options){\n switch (arguments.length) {\n case 3:\n case 2:\n return set(name, value, options);\n case 1:\n return get(name);\n default:\n return all();\n }\n};\n\n/**\n * Set cookie `name` to `value`.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @api private\n */\n\nfunction set(name, value, options) {\n options = options || {};\n var str = encode(name) + '=' + encode(value);\n\n if (null == value) options.maxage = -1;\n\n if (options.maxage) {\n options.expires = new Date(+new Date + options.maxage);\n }\n\n if (options.path) str += '; path=' + options.path;\n if (options.domain) str += '; domain=' + options.domain;\n if (options.expires) str += '; expires=' + options.expires.toUTCString();\n if (options.secure) str += '; secure';\n\n document.cookie = str;\n}\n\n/**\n * Return all cookies.\n *\n * @return {Object}\n * @api private\n */\n\nfunction all() {\n return parse(document.cookie);\n}\n\n/**\n * Get cookie `name`.\n *\n * @param {String} name\n * @return {String}\n * @api private\n */\n\nfunction get(name) {\n return all()[name];\n}\n\n/**\n * Parse cookie `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parse(str) {\n var obj = {};\n var pairs = str.split(/ *; */);\n var pair;\n if ('' == pairs[0]) return obj;\n for (var i = 0; i < pairs.length; ++i) {\n pair = pairs[i].split('=');\n obj[decode(pair[0])] = decode(pair[1]);\n }\n return obj;\n}\n//@ sourceURL=component-cookie/index.js"
));
require.register("component-each/index.js", Function("exports, require, module",
"\n/**\n * Module dependencies.\n */\n\nvar type = require('type');\n\n/**\n * HOP reference.\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Iterate the given `obj` and invoke `fn(val, i)`.\n *\n * @param {String|Array|Object} obj\n * @param {Function} fn\n * @api public\n */\n\nmodule.exports = function(obj, fn){\n switch (type(obj)) {\n case 'array':\n return array(obj, fn);\n case 'object':\n if ('number' == typeof obj.length) return array(obj, fn);\n return object(obj, fn);\n case 'string':\n return string(obj, fn);\n }\n};\n\n/**\n * Iterate string chars.\n *\n * @param {String} obj\n * @param {Function} fn\n * @api private\n */\n\nfunction string(obj, fn) {\n for (var i = 0; i < obj.length; ++i) {\n fn(obj.charAt(i), i);\n }\n}\n\n/**\n * Iterate object keys.\n *\n * @param {Object} obj\n * @param {Function} fn\n * @api private\n */\n\nfunction object(obj, fn) {\n for (var key in obj) {\n if (has.call(obj, key)) {\n fn(key, obj[key]);\n }\n }\n}\n\n/**\n * Iterate array-ish.\n *\n * @param {Array|Object} obj\n * @param {Function} fn\n * @api private\n */\n\nfunction array(obj, fn) {\n for (var i = 0; i < obj.length; ++i) {\n fn(obj[i], i);\n }\n}//@ sourceURL=component-each/index.js"
));
require.register("component-event/index.js", Function("exports, require, module",
"\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, type, fn, capture){\n if (el.addEventListener) {\n el.addEventListener(type, fn, capture || false);\n } else {\n el.attachEvent('on' + type, fn);\n }\n return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n if (el.removeEventListener) {\n el.removeEventListener(type, fn, capture || false);\n } else {\n el.detachEvent('on' + type, fn);\n }\n return fn;\n};\n//@ sourceURL=component-event/index.js"
));
require.register("component-json/index.js", Function("exports, require, module",
"\nmodule.exports = 'undefined' == typeof JSON\n ? require('json-fallback')\n : JSON;\n//@ sourceURL=component-json/index.js"
));
require.register("component-json-fallback/index.js", Function("exports, require, module",
"/*\n json2.js\n 2011-10-19\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n See http://www.JSON.org/js.html\n\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n\n\n This file creates a global JSON object containing two methods: stringify\n and parse.\n\n JSON.stringify(value, replacer, space)\n value any JavaScript value, usually an object or array.\n\n replacer an optional parameter that determines how object\n values are stringified for objects. It can be a\n function or an array of strings.\n\n space an optional parameter that specifies the indentation\n of nested structures. If it is omitted, the text will\n be packed without extra whitespace. If it is a number,\n it will specify the number of spaces to indent at each\n level. If it is a string (such as '\\t' or ' '),\n it contains the characters used to indent at each level.\n\n This method produces a JSON text from a JavaScript value.\n\n When an object value is found, if the object contains a toJSON\n method, its toJSON method will be called and the result will be\n stringified. A toJSON method does not serialize: it returns the\n value represented by the name/value pair that should be serialized,\n or undefined if nothing should be serialized. The toJSON method\n will be passed the key associated with the value, and this will be\n bound to the value\n\n For example, this would serialize Dates as ISO strings.\n\n Date.prototype.toJSON = function (key) {\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n return this.getUTCFullYear() + '-' +\n f(this.getUTCMonth() + 1) + '-' +\n f(this.getUTCDate()) + 'T' +\n f(this.getUTCHours()) + ':' +\n f(this.getUTCMinutes()) + ':' +\n f(this.getUTCSeconds()) + 'Z';\n };\n\n You can provide an optional replacer method. It will be passed the\n key and value of each member, with this bound to the containing\n object. The value that is returned from your method will be\n serialized. If your method returns undefined, then the member will\n be excluded from the serialization.\n\n If the replacer parameter is an array of strings, then it will be\n used to select the members to be serialized. It filters the results\n such that only members with keys listed in the replacer array are\n stringified.\n\n Values that do not have JSON representations, such as undefined or\n functions, will not be serialized. Such values in objects will be\n dropped; in arrays they will be replaced with null. You can use\n a replacer function to replace those with JSON values.\n JSON.stringify(undefined) returns undefined.\n\n The optional space parameter produces a stringification of the\n value that is filled with line breaks and indentation to make it\n easier to read.\n\n If the space parameter is a non-empty string, then that string will\n be used for indentation. If the space parameter is a number, then\n the indentation will be that many spaces.\n\n Example:\n\n text = JSON.stringify(['e', {pluribus: 'unum'}]);\n // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n\n text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\\t');\n // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n text = JSON.stringify([new Date()], function (key, value) {\n return this[key] instanceof Date ?\n 'Date(' + this[key] + ')' : value;\n });\n // text is '[\"Date(---current time---)\"]'\n\n\n JSON.parse(text, reviver)\n This method parses a JSON text to produce an object or array.\n It can throw a SyntaxError exception.\n\n The optional reviver parameter is a function that can filter and\n transform the results. It receives each of the keys and values,\n and its return value is used instead of the original value.\n If it returns what it received, then the structure is not modified.\n If it returns undefined then the member is deleted.\n\n Example:\n\n // Parse the text. Values that look like ISO date strings will\n // be converted to Date objects.\n\n myData = JSON.parse(text, function (key, value) {\n var a;\n if (typeof value === 'string') {\n a =\n/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n if (a) {\n return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n +a[5], +a[6]));\n }\n }\n return value;\n });\n\n myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n var d;\n if (typeof value === 'string' &&\n value.slice(0, 5) === 'Date(' &&\n value.slice(-1) === ')') {\n d = new Date(value.slice(5, -1));\n if (d) {\n return d;\n }\n }\n return value;\n });\n\n\n This is a reference implementation. You are free to copy, modify, or\n redistribute.\n*/\n\n/*jslint evil: true, regexp: true */\n\n/*members \"\", \"\\b\", \"\\t\", \"\\n\", \"\\f\", \"\\r\", \"\\\"\", JSON, \"\\\\\", apply,\n call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n*/\n\n\n// Create a JSON object only if one does not already exist. We create the\n// methods in a closure to avoid creating global variables.\n\nvar JSON = {};\n\n(function () {\n 'use strict';\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n if (typeof Date.prototype.toJSON !== 'function') {\n\n Date.prototype.toJSON = function (key) {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + '-' +\n f(this.getUTCMonth() + 1) + '-' +\n f(this.getUTCDate()) + 'T' +\n f(this.getUTCHours()) + ':' +\n f(this.getUTCMinutes()) + ':' +\n f(this.getUTCSeconds()) + 'Z'\n : null;\n };\n\n String.prototype.toJSON =\n Number.prototype.toJSON =\n Boolean.prototype.toJSON = function (key) {\n return this.valueOf();\n };\n }\n\n var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n gap,\n indent,\n meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n },\n rep;\n\n\n function quote(string) {\n\n// If the string contains no control characters, no quote characters, and no\n// backslash characters, then we can safely slap some quotes around it.\n// Otherwise we must also replace the offending characters with safe escape\n// sequences.\n\n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string'\n ? c\n : '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n }\n\n\n function str(key, holder) {\n\n// Produce a string from holder[key].\n\n var i, // The loop counter.\n k, // The member key.\n v, // The member value.\n length,\n mind = gap,\n partial,\n value = holder[key];\n\n// If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n// If we were called with a replacer function, then call the replacer to\n// obtain a replacement value.\n\n if (typeof rep === 'function') {\n value = rep.call(holder, key, value);\n }\n\n// What happens next depends on the value's type.\n\n switch (typeof value) {\n case 'string':\n return quote(value);\n\n case 'number':\n\n// JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n\n// If the value is a boolean or null, convert it to a string. Note:\n// typeof null does not produce 'null'. The case is included here in\n// the remote chance that this gets fixed someday.\n\n return String(value);\n\n// If the type is 'object', we might be dealing with an object or an array or\n// null.\n\n case 'object':\n\n// Due to a specification blunder in ECMAScript, typeof null is 'object',\n// so watch out for that case.\n\n if (!value) {\n return 'null';\n }\n\n// Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n// Is the value an array?\n\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n\n// The value is an array. Stringify every element. Use null as a placeholder\n// for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n// Join all of the elements together, separated with commas, and wrap them in\n// brackets.\n\n v = partial.length === 0\n ? '[]'\n : gap\n ? '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + ']'\n : '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n// If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === 'object') {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === 'string') {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n } else {\n\n// Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n }\n\n// Join all of the member texts together, separated with commas,\n// and wrap them in braces.\n\n v = partial.length === 0\n ? '{}'\n : gap\n ? '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + '}'\n : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n }\n\n// If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== 'function') {\n JSON.stringify = function (value, replacer, space) {\n\n// The stringify method takes a value and an optional replacer, and an optional\n// space parameter, and returns a JSON text. The replacer can be a function\n// that can replace values, or an array of strings that will select the keys.\n// A default replacer method can be provided. Use of the space parameter can\n// produce text that is more easily readable.\n\n var i;\n gap = '';\n indent = '';\n\n// If the space parameter is a number, make an indent string containing that\n// many spaces.\n\n if (typeof space === 'number') {\n for (i = 0; i < space; i += 1) {\n indent += ' ';\n }\n\n// If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === 'string') {\n indent = space;\n }\n\n// If there is a replacer, it must be a function or an array.\n// Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== 'function' &&\n (typeof replacer !== 'object' ||\n typeof replacer.length !== 'number')) {\n throw new Error('JSON.stringify');\n }\n\n// Make a fake root object containing our value under the key of ''.\n// Return the result of stringifying the value.\n\n return str('', {'': value});\n };\n }\n\n\n// If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== 'function') {\n JSON.parse = function (text, reviver) {\n\n// The parse method takes a text and an optional reviver function, and returns\n// a JavaScript value if the text is a valid JSON text.\n\n var j;\n\n function walk(holder, key) {\n\n// The walk method is used to recursively walk the resulting structure so\n// that modifications can be made.\n\n var k, v, value = holder[key];\n if (value && typeof value === 'object') {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n }\n }\n }\n return reviver.call(holder, key, value);\n }\n\n\n// Parsing happens in four stages. In the first stage, we replace certain\n// Unicode characters with escape sequences. JavaScript handles many characters\n// incorrectly, either silently deleting them, or treating them as line endings.\n\n text = String(text);\n cx.lastIndex = 0;\n if (cx.test(text)) {\n text = text.replace(cx, function (a) {\n return '\\\\u' +\n ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n });\n }\n\n// In the second stage, we run the text against regular expressions that look\n// for non-JSON patterns. We are especially concerned with '()' and 'new'\n// because they can cause invocation, and '=' because it can cause mutation.\n// But just to be safe, we want to reject all unexpected forms.\n\n// We split the second stage into 4 regexp operations in order to work around\n// crippling inefficiencies in IE's and Safari's regexp engines. First we\n// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we\n// replace all simple value tokens with ']' characters. Third, we delete all\n// open brackets that follow a colon or comma or that begin the text. Finally,\n// we look to see that the remaining characters are only whitespace or ']' or\n// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\n\n if (/^[\\],:{}\\s]*$/\n .test(text.replace(/\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')\n .replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']')\n .replace(/(?:^|:|,)(?:\\s*\\[)+/g, ''))) {\n\n// In the third stage we use the eval function to compile the text into a\n// JavaScript structure. The '{' operator is subject to a syntactic ambiguity\n// in JavaScript: it can begin a block or an object literal. We wrap the text\n// in parens to eliminate the ambiguity.\n\n j = eval('(' + text + ')');\n\n// In the optional fourth stage, we recursively walk the new structure, passing\n// each name/value pair to a reviver function for possible transformation.\n\n return typeof reviver === 'function'\n ? walk({'': j}, '')\n : j;\n }\n\n// If the text is not JSON parseable, then a SyntaxError is thrown.\n\n throw new SyntaxError('JSON.parse');\n };\n }\n}());\n\nmodule.exports = JSON//@ sourceURL=component-json-fallback/index.js"
));
require.register("component-object/index.js", Function("exports, require, module",
"\n/**\n * HOP ref.\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Return own keys in `obj`.\n *\n * @param {Object} obj\n * @return {Array}\n * @api public\n */\n\nexports.keys = Object.keys || function(obj){\n var keys = [];\n for (var key in obj) {\n if (has.call(obj, key)) {\n keys.push(key);\n }\n }\n return keys;\n};\n\n/**\n * Return own values in `obj`.\n *\n * @param {Object} obj\n * @return {Array}\n * @api public\n */\n\nexports.values = function(obj){\n var vals = [];\n for (var key in obj) {\n if (has.call(obj, key)) {\n vals.push(obj[key]);\n }\n }\n return vals;\n};\n\n/**\n * Merge `b` into `a`.\n *\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n * @api public\n */\n\nexports.merge = function(a, b){\n for (var key in b) {\n if (has.call(b, key)) {\n a[key] = b[key];\n }\n }\n return a;\n};\n\n/**\n * Return length of `obj`.\n *\n * @param {Object} obj\n * @return {Number}\n * @api public\n */\n\nexports.length = function(obj){\n return exports.keys(obj).length;\n};\n\n/**\n * Check if `obj` is empty.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api public\n */\n\nexports.isEmpty = function(obj){\n return 0 == exports.length(obj);\n};//@ sourceURL=component-object/index.js"
));
require.register("component-trim/index.js", Function("exports, require, module",
"\nexports = module.exports = trim;\n\nfunction trim(str){\n return str.replace(/^\\s*|\\s*$/g, '');\n}\n\nexports.left = function(str){\n return str.replace(/^\\s*/, '');\n};\n\nexports.right = function(str){\n return str.replace(/\\s*$/, '');\n};\n//@ sourceURL=component-trim/index.js"
));
require.register("component-querystring/index.js", Function("exports, require, module",
"\n/**\n * Module dependencies.\n */\n\nvar trim = require('trim');\n\n/**\n * Parse the given query `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api public\n */\n\nexports.parse = function(str){\n if ('string' != typeof str) return {};\n\n str = trim(str);\n if ('' == str) return {};\n\n var obj = {};\n var pairs = str.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var parts = pairs[i].split('=');\n obj[parts[0]] = null == parts[1]\n ? ''\n : decodeURIComponent(parts[1]);\n }\n\n return obj;\n};\n\n/**\n * Stringify the given `obj`.\n *\n * @param {Object} obj\n * @return {String}\n * @api public\n */\n\nexports.stringify = function(obj){\n if (!obj) return '';\n var pairs = [];\n for (var key in obj) {\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]));\n }\n return pairs.join('&');\n};\n//@ sourceURL=component-querystring/index.js"
));
require.register("component-type/index.js", Function("exports, require, module",
"\n/**\n * toString ref.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Return the type of `val`.\n *\n * @param {Mixed} val\n * @return {String}\n * @api public\n */\n\nmodule.exports = function(val){\n switch (toString.call(val)) {\n case '[object Function]': return 'function';\n case '[object Date]': return 'date';\n case '[object RegExp]': return 'regexp';\n case '[object Arguments]': return 'arguments';\n case '[object Array]': return 'array';\n case '[object String]': return 'string';\n }\n\n if (val === null) return 'null';\n if (val === undefined) return 'undefined';\n if (val && val.nodeType === 1) return 'element';\n if (val === Object(val)) return 'object';\n\n return typeof val;\n};\n//@ sourceURL=component-type/index.js"
));
require.register("component-url/index.js", Function("exports, require, module",
"\n/**\n * Parse the given `url`.\n *\n * @param {String} str\n * @return {Object}\n * @api public\n */\n\nexports.parse = function(url){\n var a = document.createElement('a');\n a.href = url;\n return {\n href: a.href,\n host: a.host || location.host,\n port: a.port || location.port,\n hash: a.hash,\n hostname: a.hostname || location.hostname,\n pathname: a.pathname.charAt(0) != '/' ? '/' + a.pathname : a.pathname,\n protocol: !a.protocol || ':' == a.protocol ? location.protocol : a.protocol,\n search: a.search,\n query: a.search.slice(1)\n };\n};\n\n/**\n * Check if `url` is absolute.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isAbsolute = function(url){\n return 0 == url.indexOf('//') || !!~url.indexOf('://');\n};\n\n/**\n * Check if `url` is relative.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isRelative = function(url){\n return !exports.isAbsolute(url);\n};\n\n/**\n * Check if `url` is cross domain.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isCrossDomain = function(url){\n url = exports.parse(url);\n return url.hostname !== location.hostname\n || url.port !== location.port\n || url.protocol !== location.protocol;\n};//@ sourceURL=component-url/index.js"
));
require.register("segmentio-after/index.js", Function("exports, require, module",
"\nmodule.exports = function after (times, func) {\n // After 0, really?\n if (times <= 0) return func();\n\n // That's more like it.\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n};//@ sourceURL=segmentio-after/index.js"
));
require.register("segmentio-alias/index.js", Function("exports, require, module",
"\nmodule.exports = function alias (object, aliases) {\n // For each of our aliases, rename our object's keys.\n for (var oldKey in aliases) {\n var newKey = aliases[oldKey];\n if (object[oldKey] !== undefined) {\n object[newKey] = object[oldKey];\n delete object[oldKey];\n }\n }\n};//@ sourceURL=segmentio-alias/index.js"
));
require.register("segmentio-canonical/index.js", Function("exports, require, module",
"module.exports = function canonical () {\n var tags = document.getElementsByTagName('link');\n for (var i = 0, tag; tag = tags[i]; i++) {\n if ('canonical' == tag.getAttribute('rel')) return tag.getAttribute('href');\n }\n};//@ sourceURL=segmentio-canonical/index.js"
));
require.register("segmentio-extend/index.js", Function("exports, require, module",
"\nmodule.exports = function extend (object) {\n // Takes an unlimited number of extenders.\n var args = Array.prototype.slice.call(arguments, 1);\n\n // For each extender, copy their properties on our object.\n for (var i = 0, source; source = args[i]; i++) {\n if (!source) continue;\n for (var property in source) {\n object[property] = source[property];\n }\n }\n\n return object;\n};//@ sourceURL=segmentio-extend/index.js"
));
require.register("segmentio-is-email/index.js", Function("exports, require, module",
"\nmodule.exports = function isEmail (string) {\n return (/.+\\@.+\\..+/).test(string);\n};//@ sourceURL=segmentio-is-email/index.js"
));
require.register("segmentio-load-date/index.js", Function("exports, require, module",
"\n\n/*\n * Load date.\n *\n * For reference: http://www.html5rocks.com/en/tutorials/webperformance/basics/\n */\n\nvar time = new Date()\n , perf = window.performance;\n\nif (perf && perf.timing && perf.timing.responseEnd) {\n time = new Date(perf.timing.responseEnd);\n}\n\nmodule.exports = time;//@ sourceURL=segmentio-load-date/index.js"
));
require.register("segmentio-load-script/index.js", Function("exports, require, module",
"var type = require('type');\n\n\nmodule.exports = function loadScript (options, callback) {\n if (!options) throw new Error('Cant load nothing...');\n\n // Allow for the simplest case, just passing a `src` string.\n if (type(options) === 'string') options = { src : options };\n\n var https = document.location.protocol === 'https:';\n\n // If you use protocol relative URLs, third-party scripts like Google\n // Analytics break when testing with `file:` so this fixes that.\n if (options.src && options.src.indexOf('//') === 0) {\n options.src = https ? 'https:' + options.src : 'http:' + options.src;\n }\n\n // Allow them to pass in different URLs depending on the protocol.\n if (https && options.https) options.src = options.https;\n else if (!https && options.http) options.src = options.http;\n\n // Make the `<script>` element and insert it before the first script on the\n // page, which is guaranteed to exist since this Javascript is running.\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.src = options.src;\n\n var firstScript = document.getElementsByTagName('script')[0];\n firstScript.parentNode.insertBefore(script, firstScript);\n\n // If we have a callback, attach event handlers, even in IE. Based off of\n // the Third-Party Javascript script loading example:\n // https://github.com/thirdpartyjs/thirdpartyjs-code/blob/master/examples/templates/02/loading-files/index.html\n if (callback && type(callback) === 'function') {\n if (script.addEventListener) {\n script.addEventListener('load', callback, false);\n } else if (script.attachEvent) {\n script.attachEvent('onreadystatechange', function () {\n if (/complete|loaded/.test(script.readyState)) callback();\n });\n }\n }\n\n // Return the script element in case they want to do anything special, like\n // give it an ID or attributes.\n return script;\n};//@ sourceURL=segmentio-load-script/index.js"
));
require.register("yields-prevent/index.js", Function("exports, require, module",
"\n/**\n * prevent default on the given `e`.\n * \n * examples:\n * \n * anchor.onclick = prevent;\n * anchor.onclick = function(e){\n * if (something) return prevent(e);\n * };\n * \n * @param {Event} e\n */\n\nmodule.exports = function(e){\n e = e || window.event\n return e.preventDefault\n ? e.preventDefault()\n : e.returnValue = false;\n};\n//@ sourceURL=yields-prevent/index.js"
));
require.register("analytics/src/index.js", Function("exports, require, module",
"// Analytics.js\n// (c) 2013 Segment.io Inc.\n// Analytics.js may be freely distributed under the MIT license.\n\nvar Analytics = require('./analytics')\n , providers = require('./providers');\n\n\nmodule.exports = new Analytics(providers);//@ sourceURL=analytics/src/index.js"
));
require.register("analytics/src/analytics.js", Function("exports, require, module",
"var after = require('after')\n , bind = require('event').bind\n , clone = require('clone')\n , each = require('each')\n , extend = require('extend')\n , size = require('object').length\n , preventDefault = require('prevent')\n , Provider = require('./provider')\n , providers = require('./providers')\n , querystring = require('querystring')\n , type = require('type')\n , url = require('url')\n , user = require('./user')\n , utils = require('./utils');\n\n\nmodule.exports = Analytics;\n\n\nfunction Analytics (Providers) {\n this.VERSION = '0.8.8';\n\n var self = this;\n // Loop through and add each of our `Providers`, so they can be initialized\n // later by the user.\n each(Providers, function (key, Provider) {\n self.addProvider(key, Provider);\n });\n // Wrap any existing `onload` function with our own that will cache the\n // loaded state of the page.\n var oldonload = window.onload;\n window.onload = function () {\n self.loaded = true;\n if (type(oldonload) === 'function') oldonload();\n };\n}\n\n\n// Add to the `Analytics` prototype.\nextend(Analytics.prototype, {\n\n // Providers that can be initialized. Add using `this.addProvider`.\n initializableProviders : {},\n\n // Store the date when the page loaded, for services that depend on it.\n date : new Date(),\n\n // Store window.onload state so that analytics that rely on it can be loaded\n // even after onload fires.\n loaded : false,\n\n // Whether analytics.js has been initialized with providers.\n initialized : false,\n\n // Whether all of our providers have loaded.\n isReady : false,\n\n // A queue for storing `ready` callback functions to get run when\n // analytics have been initialized.\n readyCallbacks : [],\n\n // The amount of milliseconds to wait for requests to providers to clear\n // before navigating away from the current page.\n timeout : 300,\n\n // Ability to access the user object.\n // TODO: Should be removed eventually\n user : user,\n\n providers : [],\n\n Provider : Provider,\n\n // Adds a provider to the list of available providers that can be\n // initialized.\n addProvider : function (name, Provider) {\n this.initializableProviders[name] = Provider;\n // add the provider's name so that we can later match turned\n // off providers to their context map position\n Provider.prototype.name = name;\n },\n\n\n // Initialize\n // ----------\n // Call **initialize** to setup analytics.js before identifying or\n // tracking any users or events. Here's what a call to **initialize**\n // might look like:\n //\n // analytics.initialize({\n // 'Google Analytics' : 'UA-XXXXXXX-X',\n // 'Segment.io' : 'XXXXXXXXXXX',\n // 'KISSmetrics' : 'XXXXXXXXXXX'\n // });\n //\n // * `providers` is a dictionary of the providers you want to enabled.\n // The keys are the names of the providers and their values are either\n // an api key, or dictionary of extra settings (including the api key).\n initialize : function (providers, options) {\n var self = this;\n\n // Reset our state.\n this.providers = [];\n this.initialized = false;\n this.isReady = false;\n\n // Set the user options, and load the user from our cookie.\n user.options(options);\n user.load();\n\n // Create a ready method that will run after all of our providers have been\n // initialized and loaded. We'll pass the function into each provider's\n // initialize method, so they can callback when they've loaded successfully.\n var ready = after(size(providers), function () {\n self.isReady = true;\n // Take each callback off the queue and call it.\n var callback;\n while(callback = self.readyCallbacks.shift()) {\n callback();\n }\n });\n\n // Initialize a new instance of each provider with their `options`, and\n // copy the provider into `this.providers`.\n each(providers, function (key, options) {\n var Provider = self.initializableProviders[key];\n if (!Provider) throw new Error('Could not find a provider named \"'+key+'\"');\n\n self.providers.push(new Provider(options, ready));\n });\n\n // Identify/track any `ajs_uid` and `ajs_event` parameters in the URL.\n var query = url.parse(window.location.href).query;\n var queries = querystring.parse(query);\n if (queries.ajs_uid) this.identify(queries.ajs_uid);\n if (queries.ajs_event) this.track(queries.ajs_event);\n\n // Update the initialized state that other methods rely on.\n this.initialized = true;\n },\n\n\n // Ready\n // -----\n // Ready lets you pass in a callback that will get called when your\n // analytics services have been initialized. It's like jQuery's `ready`\n // expect for analytics instead of the DOM.\n ready : function (callback) {\n if (type(callback) !== 'function') return;\n\n // If we're already initialized, do it right away. Otherwise, add it to the\n // queue for when we do get initialized.\n if (this.isReady) {\n callback();\n } else {\n this.readyCallbacks.push(callback);\n }\n },\n\n\n // Identify\n // --------\n // Identifying a user ties all of their actions to an ID you recognize\n // and records properties about a user. An example identify:\n //\n // analytics.identify('4d3ed089fb60ab534684b7e0', {\n // name : 'Achilles',\n // email : '[email protected]',\n // age : 23\n // });\n //\n // * `userId` (optional) is the ID you know the user by. Ideally this\n // isn't an email, because the user might be able to change their email\n // and you don't want that to affect your analytics.\n //\n // * `traits` (optional) is a dictionary of traits to tie your user.\n // Things like `name`, `age` or `friendCount`. If you have them, you\n // should always store a `name` and `email`.\n //\n // * `context` (optional) is a dictionary of options that provide more\n // information to the providers about this identify.\n // * `providers` {optional}: a dictionary of provider names to a\n // boolean specifying whether that provider will receive this identify.\n //\n // * `callback` (optional) is a function to call after the a small\n // timeout to give the identify requests a chance to be sent.\n identify : function (userId, traits, context, callback) {\n if (!this.initialized) return;\n\n // Allow for not passing context, but passing a callback.\n if (type(context) === 'function') {\n callback = context;\n context = null;\n }\n\n // Allow for not passing traits, but passing a callback.\n if (type(traits) === 'function') {\n callback = traits;\n traits = null;\n }\n\n // Allow for identifying traits without setting a `userId`, for\n // anonymous users whose traits you learn.\n if (type(userId) === 'object') {\n if (traits && type(traits) === 'function') callback = traits;\n traits = userId;\n userId = null;\n }\n\n // Use the saved userId.\n if (userId === null) userId = user.id();\n\n // Update the cookie with new userId and traits.\n var alias = user.update(userId, traits);\n\n // Before we manipulate traits, clone it so we don't do anything uncouth.\n traits = clone(traits);\n\n // Test for a `created` that's a valid date string or number and convert it.\n if (traits && traits.created) {\n // Test for a `created` that's a valid date string\n if (type(traits.created) === 'string' && Date.parse(traits.created)) {\n traits.created = new Date(traits.created);\n }\n // Test for a `created` that's a number.\n else if (type(traits.created) === 'number') {\n // If the \"created\" number has units of \"seconds since the epoch\" then it will\n // certainly be less than 31557600000 seconds (January 7, 2970).\n if (traits.created < 31557600000) {\n traits.created = new Date(traits.created * 1000);\n }\n // If the \"created\" number has units of \"milliseconds since the epoch\" then it\n // will certainly be greater than 31557600000 milliseconds (December 31, 1970).\n else {\n traits.created = new Date(traits.created);\n }\n }\n }\n\n // Call `identify` on all of our enabled providers that support it.\n each(this.providers, function (provider) {\n if (provider.identify && utils.isEnabled(provider, context)) {\n var args = [userId, clone(traits), clone(context)];\n\n if (provider.ready) provider.identify.apply(provider, args);\n else provider.enqueue('identify', args);\n }\n });\n\n // TODO: auto-alias once mixpanel API doesn't error\n // If we should alias, go ahead and do it.\n // if (alias) this.alias(userId);\n\n if (callback && type(callback) === 'function') {\n setTimeout(callback, this.timeout);\n }\n },\n\n\n // Track\n // -----\n // Whenever a visitor triggers an event on your site that you're\n // interested in, you'll want to track it. An example track:\n //\n // analytics.track('Added a Friend', {\n // level : 'hard',\n // volume : 11\n // });\n //\n // * `event` is the name of the event. The best names are human-readable\n // so that your whole team knows what they mean when they analyze your\n // data.\n //\n // * `properties` (optional) is a dictionary of properties of the event.\n // Property keys are all camelCase (we'll alias to non-camelCase for\n // you automatically for providers that require it).\n //\n // * `context` (optional) is a dictionary of options that provide more\n // information to the providers about this track.\n // * `providers` {optional}: a dictionary of provider names to a\n // boolean specifying whether that provider will receive this track.\n //\n // * `callback` (optional) is a function to call after the a small\n // timeout to give the track requests a chance to be sent.\n track : function (event, properties, context, callback) {\n if (!this.initialized) return;\n\n // Allow for not passing context, but passing a callback.\n if (type(context) === 'function') {\n callback = context;\n context = null;\n }\n\n // Allow for not passing properties, but passing a callback.\n if (type(properties) === 'function') {\n callback = properties;\n properties = null;\n }\n\n // Call `track` on all of our enabled providers that support it.\n each(this.providers, function (provider) {\n if (provider.track && utils.isEnabled(provider, context)) {\n var args = [event, clone(properties), clone(context)];\n\n if (provider.ready) provider.track.apply(provider, args);\n else provider.enqueue('track', args);\n }\n });\n\n if (callback && type(callback) === 'function') {\n setTimeout(callback, this.timeout);\n }\n },\n\n\n // ### trackLink\n // A helper for tracking outbound links that would normally leave the\n // page before the track calls went out. It works by wrapping the calls\n // in as short of a timeout as possible to fire the track call, because\n // [response times matter](http://theixdlibrary.com/pdf/Miller1968.pdf).\n //\n // * `links` is either a single link DOM element, or an array of link\n // elements like jQuery gives you.\n //\n // * `event` and `properties` are passed directly to `analytics.track`\n // and take the same options. `properties` can also be a function that\n // will get passed the link that was clicked, and should return a\n // dictionary of event properties.\n trackLink : function (links, event, properties) {\n if (!links) return;\n\n // Turn a single link into an array so that we're always handling\n // arrays, which allows for passing jQuery objects.\n if (utils.isElement(links)) links = [links];\n\n var self = this\n , isFunction = 'function' === type(properties);\n\n // Bind to all the links in the array.\n each(links, function (el) {\n\n bind(el, 'click', function (e) {\n\n // Allow for properties to be a function. And pass it the\n // link element that was clicked.\n var props = isFunction ? properties(el) : properties;\n\n self.track(event, props);\n\n // To justify us preventing the default behavior we must:\n //\n // * Have an `href` to use.\n // * Not have a `target=\"_blank\"` attribute.\n // * Not have any special keys pressed, because they might be trying to\n // open in a new tab, or window, or download.\n //\n // This might not cover all cases, but we'd rather throw out an event\n // than miss a case that breaks the experience.\n if (el.href && el.target !== '_blank' && !utils.isMeta(e)) {\n\n preventDefault(e);\n\n // Navigate to the url after a small timeout, giving the providers\n // time to track the event.\n setTimeout(function () {\n window.location.href = el.href;\n }, self.timeout);\n }\n });\n });\n },\n\n\n // ### trackForm\n // Similar to `trackClick`, this is a helper for tracking form\n // submissions that would normally leave the page before a track call\n // can be sent. It works by preventing the default submit, sending a\n // track call, and then submitting the form programmatically.\n //\n // * `forms` is either a single form DOM element, or an array of\n // form elements like jQuery gives you.\n //\n // * `event` and `properties` are passed directly to `analytics.track`\n // and take the same options. `properties` can also be a function that\n // will get passed the form that was submitted, and should return a\n // dictionary of event properties.\n trackForm : function (form, event, properties) {\n if (!form) return;\n\n // Turn a single element into an array so that we're always handling arrays,\n // which allows for passing jQuery objects.\n if (utils.isElement(form)) form = [form];\n\n var self = this\n , isFunction = 'function' === type(properties);\n\n each(form, function (el) {\n var handler = function (e) {\n\n // Allow for properties to be a function. And pass it the form element\n // that was submitted.\n var props = isFunction ? properties(el) : properties;\n\n self.track(event, props);\n\n preventDefault(e);\n\n // Submit the form after a timeout, giving the event time to fire.\n setTimeout(function () {\n el.submit();\n }, self.timeout);\n };\n\n // Support the form being submitted via jQuery instead of for real. This\n // doesn't happen automatically because `el.submit()` doesn't actually\n // fire submit handlers, which is what jQuery has to user internally. >_<\n var dom = window.jQuery || window.Zepto;\n if (dom)\n dom(el).submit(handler);\n else\n bind(el, 'submit', handler);\n });\n },\n\n\n // Pageview\n // --------\n // For single-page applications where real page loads don't happen, the\n // **pageview** method simulates a page loading event for all providers\n // that track pageviews and support it. This is the equivalent of\n // calling `_gaq.push(['trackPageview'])` in Google Analytics.\n //\n // **pageview** is _not_ for sending events about which pages in your\n // app the user has loaded. For that, use a regular track call like:\n // `analytics.track('View Signup Page')`. Or, if you think you've come\n // up with a badass abstraction, submit a pull request!\n //\n // * `url` (optional) is the url path that you want to be associated\n // with the page. You only need to pass this argument if the URL hasn't\n // changed but you want to register a new pageview.\n pageview : function (url) {\n if (!this.initialized) return;\n\n // Call `pageview` on all of our enabled providers that support it.\n each(this.providers, function (provider) {\n if (provider.pageview) {\n if (provider.ready) provider.pageview(url);\n else provider.enqueue('pageview', [url]);\n }\n });\n },\n\n\n // Alias\n // -----\n // Alias combines two previously unassociated user identities. This\n // comes in handy if the same user visits from two different devices and\n // you want to combine their history. Some providers also don't alias\n // automatically for you when an anonymous user signs up (like\n // Mixpanel), so you need to call `alias` manually right after sign up\n // with their brand new `userId`.\n //\n // * `newId` is the new ID you want to associate the user with.\n //\n // * `originalId` (optional) is the original ID that the user was\n // recognized by. This defaults to the currently identified user's ID if\n // there is one. In most cases you don't need to pass this argument.\n alias : function (newId, originalId) {\n if (!this.initialized) return;\n\n // Call `alias` on all of our enabled providers that support it.\n each(this.providers, function (provider) {\n if (provider.alias) {\n if (provider.ready) provider.alias(newId, originalId);\n else provider.enqueue('alias', [newId, originalId]);\n }\n });\n }\n\n});\n\n\n// Alias `trackClick` and `trackSubmit` for backwards compatibility.\nAnalytics.prototype.trackClick = Analytics.prototype.trackLink;\nAnalytics.prototype.trackSubmit = Analytics.prototype.trackForm;\n//@ sourceURL=analytics/src/analytics.js"
));
require.register("analytics/src/provider.js", Function("exports, require, module",
"var each = require('each')\n , extend = require('extend')\n , type = require('type');\n\n\nmodule.exports = Provider;\n\n\nfunction Provider (options, ready) {\n var self = this;\n // Set up a queue of { method : 'identify', args : [] } to call\n // once we are ready.\n this.queue = [];\n this.ready = false;\n\n // Allow for `options` to only be a string if the provider has specified\n // a default `key`, in which case convert `options` into a dictionary.\n if (type(options) !== 'object') {\n if (type(options) === 'string' && this.key) {\n var key = options;\n options = {};\n options[this.key] = key;\n } else {\n throw new Error('Could not resolve options.');\n }\n }\n // Extend the options passed in with the provider's defaults.\n extend(this.options, options);\n\n // Wrap our ready function to first read from the queue.\n var dequeue = function () {\n each(self.queue, function (call) {\n var method = call.method\n , args = call.args;\n self[method].apply(self, args);\n });\n self.ready = true;\n self.queue = [];\n ready();\n };\n\n // Call the provider's initialize object.\n this.initialize.call(this, this.options, dequeue);\n}\n\n\n// Helper to add provider methods to the prototype chain, for adding custom\n// providers. Modeled after [Backbone's `extend` method](https://github.com/documentcloud/backbone/blob/master/backbone.js#L1464).\nProvider.extend = function (properties) {\n var parent = this;\n var child = function () { return parent.apply(this, arguments); };\n var Surrogate = function () { this.constructor = child; };\n Surrogate.prototype = parent.prototype;\n child.prototype = new Surrogate();\n extend(child.prototype, properties);\n return child;\n};\n\n\n// Add to the default Provider prototype.\nextend(Provider.prototype, {\n\n // Override this with any default options.\n options : {},\n\n // Override this if our provider only needs a single API key to\n // initialize itself, in which case we can use the terse initialization\n // syntax:\n //\n // analytics.initialize({\n // 'Provider' : 'XXXXXXX'\n // });\n //\n key : undefined,\n\n // Override to provider your own initialization logic, usually a snippet\n // and loading a Javascript library.\n initialize : function (options, ready) {\n ready();\n },\n\n /**\n * Adds an item to the queue\n * @param {String} method ('track' or 'identify')\n * @param {Object} args\n */\n enqueue : function (method, args) {\n this.queue.push({\n method : method,\n args : args\n });\n }\n});//@ sourceURL=analytics/src/provider.js"
));
require.register("analytics/src/user.js", Function("exports, require, module",
"\nvar cookieStore = require('cookie')\n , clone = require('clone')\n , extend = require('extend')\n , json = require('json')\n , type = require('type');\n\n\nvar user = newUser();\n\nvar cookie = exports.cookie = {\n name : 'ajs_user',\n maxage : 31536000000, // default to a year\n enabled : true,\n path : '/',\n};\n\n\n/**\n * Set the options for our user storage.\n * @param {Object} options\n * @field {Boolean|Object} cookie - whether to use a cookie\n * @field {String} name - what to call the cookie ('ajs_user')\n * @field {Number} maxage - time in ms to keep the cookie. (one year)\n * @field {\n */\nexports.options = function (options) {\n\n options || (options = {});\n\n if (type(options.cookie) === 'boolean') {\n\n cookie.enabled = options.cookie;\n\n } else if (type(options.cookie) === 'object') {\n cookie.enabled = true;\n if (options.cookie.name) cookie.name = options.cookie.name;\n if (options.cookie.maxage) cookie.maxage = options.cookie.maxage;\n if (options.cookie.domain) cookie.domain = options.cookie.domain;\n if (options.cookie.path) cookie.path = options.cookie.path;\n\n if (cookie.domain && cookie.domain.charAt(0) !== '.')\n cookie.domain = '.' + cookie.domain;\n }\n};\n\n\nexports.id = function () {\n return user.id;\n};\n\n\nexports.traits = function () {\n return clone(user.traits);\n};\n\n\n/**\n * Updates the stored user with id and trait information\n * @param {String} userId\n * @param {Object} traits\n * @return {Boolean} whether alias should be called\n */\nexports.update = function (userId, traits) {\n\n // Make an alias call if there was no previous userId, there is one\n // now, and we are using a cookie between page loads.\n var alias = !user.id && userId && cookie.enabled;\n\n traits || (traits = {});\n\n // If there is a current user and the new user isn't the same,\n // we want to just replace their traits. Otherwise extend.\n if (user.id && userId && user.id !== userId) user.traits = traits;\n else extend(user.traits, traits);\n\n if (userId) user.id = userId;\n\n if (cookie.enabled) save(user);\n\n return alias;\n};\n\n\n/**\n * Clears the user, wipes the cookie.\n */\nexports.clear = function () {\n if (cookie.enabled) cookieStore(cookie.name, null, clone(cookie));\n user = newUser();\n};\n\n\n/**\n * Save the user object to a cookie\n * @param {Object} user\n * @return {Boolean} saved\n */\nvar save = function (user) {\n try {\n cookieStore(cookie.name, json.stringify(user), clone(cookie));\n return true;\n } catch (e) {\n return false;\n }\n};\n\n\n/**\n * Load the data from our cookie.\n *\n * @return {Object}\n * @field {String} id\n * @field {Object} traits\n */\nexports.load = function () {\n\n if (!cookie.enabled) return user;\n\n var storedUser = cookieStore(cookie.name);\n\n if (storedUser) {\n try {\n user = json.parse(storedUser);\n } catch (e) {\n // if we got bad json, toss the entire thing.\n user = newUser();\n }\n }\n\n return user;\n};\n\n\n/**\n * Returns a new user object\n */\nfunction newUser() {\n return {\n id : null,\n traits : {}\n };\n}//@ sourceURL=analytics/src/user.js"
));
require.register("analytics/src/utils.js", Function("exports, require, module",
"\nvar type = require('type')\n , each = require('each')\n , clone = require('clone');\n\n\nexports.clone = clone;\n\n// A helper to alias certain object's keys to different key names.\n// Useful for abstracting over providers that require specific key\n// names.\nexports.alias = function (obj, aliases) {\n if (isObject(obj)) return;\n\n each(aliases, function (property, alias) {\n if (obj[property] !== undefined) {\n obj[alias] = obj[property];\n delete obj[property];\n }\n });\n};\n\n\n// Attach an event handler to a DOM element, even in IE.\nexports.bind = function (el, event, callback) {\n if (el.addEventListener) {\n el.addEventListener(event, callback, false);\n } else if (el.attachEvent) {\n el.attachEvent('on' + event, callback);\n }\n};\n\n// Given a DOM event, tell us whether a meta key or button was\n// pressed that would make a link open in a new tab, window,\n// start a download, or anything else that wouldn't take the user to\n// a new page.\nexports.isMeta = function (e) {\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return true;\n\n // Logic that handles checks for the middle mouse button, based\n // on [jQuery](https://github.com/jquery/jquery/blob/master/src/event.js#L466).\n var which = e.which, button = e.button;\n if (!which && button !== undefined) {\n return (!button & 1) && (!button & 2) && (button & 4);\n } else if (which === 2) {\n return true;\n }\n\n return false;\n};\n\n// Given a timestamp, return its value in seconds. For providers\n// that rely on Unix time instead of millis.\nexports.getSeconds = function (time) {\n return Math.floor((+(new Date(time))) / 1000);\n};\n\n// A helper to extend objects with properties from other objects.\n// Based off of the [underscore](https://github.com/documentcloud/underscore/blob/master/underscore.js#L763)\n// method.\nexports.extend = function (obj) {\n if (!isObject(obj)) return;\n\n var args = Array.prototype.slice.call(arguments, 1);\n each(args, function (source) {\n if (!isObject(source)) return;\n\n each(source, function (key, property) {\n obj[key] = property;\n });\n });\n\n return obj;\n};\n\n// Type detection helpers, copied from\n// [underscore](https://github.com/documentcloud/underscore/blob/master/underscore.js#L926-L946).\nexports.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n};\n\n\nexports.isArray = Array.isArray || function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n};\n\nvar isObject = exports.isObject = function (obj) {\n return obj === Object(obj);\n};\n\nvar isString = exports.isString = function (obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n};\n\nexports.isFunction = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n};\n\nexports.isNumber = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Number]';\n};\n\nvar isBoolean = exports.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) == '[object Boolean]';\n};\n\n// Email detection helper to loosely validate emails.\nexports.isEmail = function (string) {\n return (/.+\\@.+\\..+/).test(string);\n};\n\n\n// A helper to resolve a settings object. It allows for `settings`\n// to be a string in the case of using the shorthand where just an\n// api key is passed. `fieldName` is what the provider calls their\n// api key.\nexports.resolveSettings = function (settings, fieldName) {\n if (!isString(settings) && !isObject(settings))\n throw new Error('Could not resolve settings.');\n if (!fieldName)\n throw new Error('You must provide an api key field name.');\n\n // Allow for settings to just be an API key, for example:\n //\n // { 'Google Analytics : 'UA-XXXXXXX-X' }\n if (isString(settings)) {\n var apiKey = settings;\n settings = {};\n settings[fieldName] = apiKey;\n }\n\n return settings;\n};\n\n// A helper to track events based on the 'anjs' url parameter\nexports.getUrlParameter = function (urlSearchParameter, paramKey) {\n var params = urlSearchParameter.replace('?', '').split('&');\n for (var i = 0; i < params.length; i += 1) {\n var param = params[i].split('=');\n if (param.length === 2 && param[0] === paramKey) {\n return decodeURIComponent(param[1]);\n }\n }\n};\n\n// Uses the context to determine if a provider is enabled\nexports.isEnabled = function (provider, context) {\n // if there is no context, then the provider is enabled\n if (!isObject(context)) return true;\n if (!isObject(context.providers)) return true;\n\n var map = context.providers;\n\n // determine the default provider setting\n // if the user passes \"all\" or \"All\" : false\n // then the provider is disabled unless told otherwise\n var all = true;\n if (isBoolean(map.all)) all = map.all;\n if (isBoolean(map.All)) all = map.All;\n\n if (isBoolean(map[provider.name]))\n return map[provider.name];\n else\n return all;\n};//@ sourceURL=analytics/src/utils.js"
));
require.register("analytics/src/providers/bitdeli.js", Function("exports, require, module",
"// Bitdeli\n// -------\n// * [Documentation](https://bitdeli.com/docs)\n// * [JavaScript API Reference](https://bitdeli.com/docs/javascript-api.html)\n\nvar Provider = require('../provider')\n , type = require('type')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n options : {\n // BitDeli requires two options: `inputId` and `authToken`.\n inputId : null,\n authToken : null,\n // Whether or not to track an initial pageview when the page first\n // loads. You might not want this if you're using a single-page app.\n initialPageview : true\n },\n\n\n initialize : function (options, ready) {\n window._bdq = window._bdq || [];\n window._bdq.push([\"setAccount\", options.inputId, options.authToken]);\n\n if (options.initialPageview) this.pageview();\n\n load('//d2flrkr957qc5j.cloudfront.net/bitdeli.min.js');\n\n // Bitdeli just uses a queue, so it's ready right away.\n ready();\n },\n\n\n // Bitdeli uses two separate methods: `identify` for storing the `userId`\n // and `set` for storing `traits`.\n identify : function (userId, traits) {\n if (userId) window._bdq.push(['identify', userId]);\n if (traits) window._bdq.push(['set', traits]);\n },\n\n\n track : function (event, properties) {\n window._bdq.push(['track', event, properties]);\n },\n\n\n // If `url` is undefined, Bitdeli uses the current page URL instead.\n pageview : function (url) {\n window._bdq.push(['trackPageview', url]);\n }\n\n});//@ sourceURL=analytics/src/providers/bitdeli.js"
));
require.register("analytics/src/providers/bugherd.js", Function("exports, require, module",
"// BugHerd\n// -------\n// [Documentation](http://support.bugherd.com/home).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'apiKey',\n\n options : {\n apiKey : null\n },\n\n initialize : function (options, ready) {\n load('//www.bugherd.com/sidebarv2.js?apikey=' + options.apiKey, ready);\n }\n\n});//@ sourceURL=analytics/src/providers/bugherd.js"
));
require.register("analytics/src/providers/chartbeat.js", Function("exports, require, module",
"// Chartbeat\n// ---------\n// [Documentation](http://chartbeat.com/docs/adding_the_code/),\n// [documentation](http://chartbeat.com/docs/configuration_variables/),\n// [documentation](http://chartbeat.com/docs/handling_virtual_page_changes/).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n options : {\n // Chartbeat requires two options: `domain` and `uid`. All other\n // configuration options are passed straight in!\n domain : null,\n uid : null\n },\n\n\n initialize : function (options, ready) {\n // Since all the custom options just get passed through, update the\n // Chartbeat `_sf_async_config` variable with options.\n window._sf_async_config = options;\n\n // Chartbeat's javascript should only load after the body\n // is available, see https://github.com/segmentio/analytics.js/issues/107\n var loadChartbeat = function () {\n // We loop until the body is available.\n if (!document.body) return setTimeout(loadChartbeat, 5);\n\n // Use the stored date from when chartbeat was loaded.\n window._sf_endpt = (new Date()).getTime();\n\n // Load the Chartbeat javascript.\n load({\n https : 'https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/js/chartbeat.js',\n http : 'http://static.chartbeat.com/js/chartbeat.js'\n }, ready);\n };\n loadChartbeat();\n },\n\n\n pageview : function (url) {\n // In case the Chartbeat library hasn't loaded yet.\n if (!window.pSUPERFLY) return;\n\n // Requires a path, so default to the current one.\n window.pSUPERFLY.virtualPage(url || window.location.pathname);\n }\n\n});//@ sourceURL=analytics/src/providers/chartbeat.js"
));
require.register("analytics/src/providers/clicktale.js", Function("exports, require, module",
"// ClickTale\n// ---------\n// [Documentation](http://wiki.clicktale.com/Article/JavaScript_API).\n\nvar date = require('load-date')\n , Provider = require('../provider')\n , load = require('load-script');\n\nmodule.exports = Provider.extend({\n\n key : 'projectId',\n\n options : {\n\n // If you sign up for a free account, this is the default http (non-ssl) CDN URL\n // that you get. If you sign up for a premium account, you get a different\n // custom CDN URL, so we have to leave it as an option.\n httpCdnUrl : 'http://s.clicktale.net/WRe0.js',\n\n // SSL support is only for premium accounts. Each premium account seems to have\n // a different custom secure CDN URL, so we have to leave it as an option.\n httpsCdnUrl : null,\n\n // The Project ID is loaded in after the ClickTale CDN javascript has loaded.\n projectId : null,\n\n // The recording ratio specifies what fraction of people to screen-record.\n // ClickTale has a special calculator in their setup flow that tells you\n // what number to set for this.\n recordingRatio : 0.01,\n\n // The Partition ID determines where ClickTale stores the data according to \n // http://wiki.clicktale.com/Article/JavaScript_API\n partitionId : null\n },\n\n\n initialize : function (options, ready) {\n\n // ClickTale wants this at the \"top\" of the page. The\n // analytics.js snippet sets this date synchronously now,\n // and makes it available via load-date.\n window.WRInitTime = date.getTime();\n\n\n // Make the `<div>` element and insert it at the end of the body.\n var createClickTaleDiv = function () {\n // loop until the body is actually available\n if (!document.body) return setTimeout(createClickTaleDiv, 5);\n\n var div = document.createElement('div');\n div.setAttribute('id', 'ClickTaleDiv');\n div.setAttribute('style', 'display: none;');\n document.body.appendChild(div);\n };\n createClickTaleDiv();\n\n var onloaded = function () {\n window.ClickTale(options.projectId, options.recordingRatio, options.partitionId);\n ready();\n };\n\n // Load the appropriate CDN library, if no\n // ssl library is provided and we're on ssl then\n // we can't load anything (always true for non-premium accounts.)\n load({\n http : options.httpCdnUrl,\n https : options.httpsCdnUrl\n }, onloaded);\n },\n\n identify : function (userId, traits) {\n // We set the userId as the ClickTale UID.\n if (window.ClickTaleSetUID) window.ClickTaleSetUID(userId);\n\n // We iterate over all the traits and set them as key-value field pairs.\n if (window.ClickTaleField) {\n for (var traitKey in traits) {\n window.ClickTaleField(traitKey, traits[traitKey]);\n }\n }\n },\n\n track : function (event, properties) {\n // ClickTaleEvent is an alias for ClickTaleTag\n if (window.ClickTaleEvent) window.ClickTaleEvent(event);\n }\n\n});//@ sourceURL=analytics/src/providers/clicktale.js"
));
require.register("analytics/src/providers/clicky.js", Function("exports, require, module",
"// Clicky\n// ------\n// [Documentation](http://clicky.com/help/customization/manual?new-domain).\n// [Session info](http://clicky.com/help/customization/manual?new-domain#/help/customization#session)\n\nvar Provider = require('../provider')\n , user = require('../user')\n , extend = require('extend')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'siteId',\n\n options : {\n siteId : null\n },\n\n\n initialize : function (options, ready) {\n window.clicky_site_ids = window.clicky_site_ids || [];\n window.clicky_site_ids.push(options.siteId);\n\n var userId = user.id()\n , traits = user.traits()\n , session = {};\n\n if (userId) session.username = userId;\n extend(session, traits);\n\n window.clicky_custom = { session : session };\n\n load('//static.getclicky.com/js', ready);\n },\n\n\n track : function (event, properties) {\n // In case the Clicky library hasn't loaded yet.\n if (!window.clicky) return;\n\n // We aren't guaranteed `clicky` is available until the script has been\n // requested and run, hence the check.\n window.clicky.log(window.location.href, event);\n }\n\n});//@ sourceURL=analytics/src/providers/clicky.js"
));
require.register("analytics/src/providers/comscore.js", Function("exports, require, module",
"// comScore\n// ---------\n// [Documentation](http://direct.comscore.com/clients/help/FAQ.aspx#faqTagging)\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'c2',\n\n options : {\n c1 : '2',\n c2 : null\n },\n\n\n // Pass the entire options object directly into comScore.\n initialize : function (options, ready) {\n window._comscore = window._comscore || [];\n window._comscore.push(options);\n load({\n http : 'http://b.scorecardresearch.com/beacon.js',\n https : 'https://sb.scorecardresearch.com/beacon.js'\n }, ready);\n }\n\n});//@ sourceURL=analytics/src/providers/comscore.js"
));
require.register("analytics/src/providers/crazyegg.js", Function("exports, require, module",
"// CrazyEgg\n// --------\n// [Documentation](www.crazyegg.com).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'accountNumber',\n\n options : {\n accountNumber : null\n },\n\n\n initialize : function (options, ready) {\n var accountPath = options.accountNumber.slice(0,4) + '/' + options.accountNumber.slice(4);\n load('//dnn506yrbagrg.cloudfront.net/pages/scripts/'+accountPath+'.js?'+Math.floor(new Date().getTime()/3600000), ready);\n }\n\n});//@ sourceURL=analytics/src/providers/crazyegg.js"
));
require.register("analytics/src/providers/customerio.js", Function("exports, require, module",
"// Customer.io\n// -----------\n// [Documentation](http://customer.io/docs/api/javascript.html).\n\nvar Provider = require('../provider')\n , isEmail = require('is-email')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'siteId',\n\n options : {\n siteId : null\n },\n\n\n initialize : function (options, ready) {\n var _cio = window._cio = window._cio || [];\n (function() {\n var a,b,c;\n a = function (f) {\n return function () {\n _cio.push([f].concat(Array.prototype.slice.call(arguments,0)));\n };\n };\n b = ['identify', 'track'];\n for (c = 0; c < b.length; c++) {\n _cio[b[c]] = a(b[c]);\n }\n })();\n\n // Load the Customer.io script and add the required `id` and `data-site-id`.\n var script = load('https://assets.customer.io/assets/track.js');\n script.id = 'cio-tracker';\n script.setAttribute('data-site-id', options.siteId);\n\n // Since Customer.io creates their required methods in their snippet, we\n // don't need to wait to be ready.\n ready();\n },\n\n\n identify : function (userId, traits) {\n // Don't do anything if we just have traits, because Customer.io\n // requires a `userId`.\n if (!userId) return;\n\n traits || (traits = {});\n\n // Customer.io takes the `userId` as part of the traits object.\n traits.id = userId;\n\n // If there wasn't already an email and the userId is one, use it.\n if (!traits.email && isEmail(userId)) traits.email = userId;\n\n // Swap the `created` trait to the `created_at` that Customer.io needs\n // and convert it from milliseconds to seconds.\n if (traits.created) {\n traits.created_at = Math.floor(traits.created/1000);\n delete traits.created;\n }\n\n window._cio.identify(traits);\n },\n\n\n track : function (event, properties) {\n window._cio.track(event, properties);\n }\n\n});//@ sourceURL=analytics/src/providers/customerio.js"
));
require.register("analytics/src/providers/errorception.js", Function("exports, require, module",
"// Errorception\n// ------------\n// [Documentation](http://errorception.com/).\n\nvar Provider = require('../provider')\n , extend = require('extend')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'projectId',\n\n options : {\n projectId : null,\n\n // Whether to store metadata about the user on `identify` calls, using\n // the [Errorception `meta` API](http://blog.errorception.com/2012/11/capture-custom-data-with-your-errors.html).\n meta : true\n },\n\n\n initialize : function (options, ready) {\n window._errs = window._errs || [options.projectId];\n load('//d15qhc0lu1ghnk.cloudfront.net/beacon.js');\n\n // Attach the window `onerror` event.\n window.onerror = function () {\n window._errs.push(arguments);\n };\n\n // Errorception makes a queue, so it's ready immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n if (!this.options.meta) return;\n\n // If the custom metadata object hasn't ever been made, make it.\n window._errs.meta || (window._errs.meta = {});\n\n // Add `userId` to traits.\n traits || (traits = {});\n if (userId) traits.id = userId;\n\n // Add all of the traits as metadata.\n extend(window._errs.meta, traits);\n }\n\n});//@ sourceURL=analytics/src/providers/errorception.js"
));
require.register("analytics/src/providers/foxmetrics.js", Function("exports, require, module",
"// FoxMetrics\r\n// -----------\r\n// [Website] (http://foxmetrics.com)\r\n// [Documentation](http://foxmetrics.com/documentation)\r\n// [Documentation - JS](http://foxmetrics.com/documentation/apijavascript)\r\n// [Support](http://support.foxmetrics.com)\r\n\r\nvar Provider = require('../provider')\r\n , load = require('load-script');\r\n\r\n\r\nmodule.exports = Provider.extend({\r\n\r\n key : 'appId',\r\n\r\n options : {\r\n appId : null\r\n },\r\n\r\n\r\n initialize : function (options, ready) {\r\n var _fxm = window._fxm || {};\r\n window._fxm = _fxm.events || [];\r\n load('//d35tca7vmefkrc.cloudfront.net/scripts/' + options.appId + '.js');\r\n\r\n // FoxMetrics makes a queue, so it's ready immediately.\r\n ready();\r\n },\r\n\r\n\r\n identify : function (userId, traits) {\r\n // A `userId` is required for profile updates, otherwise its a waste of\r\n // resources as nothing will get updated.\r\n if (!userId) return;\r\n\r\n // FoxMetrics needs the first and last name seperately.\r\n var firstName = null\r\n , lastName = null\r\n , email = null;\r\n if (traits && traits.name) {\r\n firstName = traits.name.split(' ')[0];\r\n lastName = traits.name.split(' ')[1];\r\n }\r\n if (traits && traits.email) {\r\n email = traits.email;\r\n }\r\n\r\n // We should probably remove name and email before passing as attributes.\r\n window._fxm.push([\r\n '_fxm.visitor.profile',\r\n userId, // user id\r\n firstName, // first name\r\n lastName, // last name\r\n email, // email\r\n null, // address\r\n null, // social\r\n null, // partners\r\n traits || null // attributes\r\n ]);\r\n },\r\n\r\n\r\n track : function (event, properties) {\r\n window._fxm.push([\r\n event, // event name\r\n null, // category\r\n properties // properties\r\n ]);\r\n },\r\n\r\n\r\n pageview : function (url) {\r\n window._fxm.push([\r\n '_fxm.pages.view',\r\n null, // title\r\n null, // name\r\n null, // category\r\n url || null, // url\r\n null // referrer\r\n ]);\r\n }\r\n\r\n});//@ sourceURL=analytics/src/providers/foxmetrics.js"
));
require.register("analytics/src/providers/gauges.js", Function("exports, require, module",
"// Gauges\n// -------\n// [Documentation](http://get.gaug.es/documentation/tracking/).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'siteId',\n\n options : {\n siteId : null\n },\n\n\n // Load the library and add the `id` and `data-site-id` Gauges needs.\n initialize : function (options, ready) {\n window._gauges = window._gauges || [];\n var script = load('//secure.gaug.es/track.js');\n script.id = 'gauges-tracker';\n script.setAttribute('data-site-id', options.siteId);\n\n // Gauges make a queue so it's ready immediately.\n ready();\n },\n\n\n pageview : function (url) {\n window._gauges.push(['track']);\n }\n\n});//@ sourceURL=analytics/src/providers/gauges.js"
));
require.register("analytics/src/providers/google-analytics.js", Function("exports, require, module",
"// Google Analytics\n// ----------------\n// [Documentation](https://developers.google.com/analytics/devguides/collection/gajs/).\n\nvar Provider = require('../provider')\n , load = require('load-script')\n , type = require('type')\n , url = require('url')\n , canonical = require('canonical');\n\n\nmodule.exports = Provider.extend({\n\n key : 'trackingId',\n\n options : {\n // Your Google Analytics Tracking ID.\n trackingId : null,\n // Whether or not to track and initial pageview when initialized.\n initialPageview : true,\n // An optional domain setting, to restrict where events can originate from.\n domain : null,\n // Whether to anonymize the IP address collected for the user.\n anonymizeIp : false,\n // Whether to use Google Analytics's Enhanced Link Attribution feature:\n // http://support.google.com/analytics/bin/answer.py?hl=en&answer=2558867\n enhancedLinkAttribution : false,\n // The setting to use for Google Analytics's Site Speed Sample Rate feature:\n // https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._setSiteSpeedSampleRate\n siteSpeedSampleRate : null,\n // Whether to enable GOogle's DoubleClick remarketing feature.\n doubleClick : false\n },\n\n\n initialize : function (options, ready) {\n window._gaq = window._gaq || [];\n window._gaq.push(['_setAccount', options.trackingId]);\n\n // Apply a bunch of optional settings.\n if (options.domain) {\n window._gaq.push(['_setDomainName', options.domain]);\n }\n if (options.enhancedLinkAttribution) {\n var protocol = 'https:' === document.location.protocol ? 'https:' : 'http:';\n var pluginUrl = protocol + '//www.google-analytics.com/plugins/ga/inpage_linkid.js';\n window._gaq.push(['_require', 'inpage_linkid', pluginUrl]);\n }\n if (type(options.siteSpeedSampleRate) === 'number') {\n window._gaq.push(['_setSiteSpeedSampleRate', options.siteSpeedSampleRate]);\n }\n if (options.anonymizeIp) {\n window._gaq.push(['_gat._anonymizeIp']);\n }\n if (options.initialPageview) {\n var path, canon = canonical();\n if (canon) path = url.parse(canon).pathname;\n this.pageview(path);\n }\n\n // URLs change if DoubleClick is on.\n if (options.doubleClick) {\n load('//stats.g.doubleclick.net/dc.js');\n } else {\n load({\n http : 'http://www.google-analytics.com/ga.js',\n https : 'https://ssl.google-analytics.com/ga.js'\n });\n }\n\n // Google makes a queue so it's ready immediately.\n ready();\n },\n\n\n track : function (event, properties) {\n properties || (properties = {});\n\n var value;\n\n // Since value is a common property name, ensure it is a number\n if (type(properties.value) === 'number') value = properties.value;\n\n // Try to check for a `category` and `label`. A `category` is required,\n // so if it's not there we use `'All'` as a default. We can safely push\n // undefined if the special properties don't exist. Try using revenue\n // first, but fall back to a generic `value` as well.\n window._gaq.push([\n '_trackEvent',\n properties.category || 'All',\n event,\n properties.label,\n Math.round(properties.revenue) || value,\n properties.noninteraction\n ]);\n },\n\n\n pageview : function (url) {\n // If there isn't a url, that's fine.\n window._gaq.push(['_trackPageview', url]);\n }\n\n});//@ sourceURL=analytics/src/providers/google-analytics.js"
));
require.register("analytics/src/providers/gosquared.js", Function("exports, require, module",
"// GoSquared\n// ---------\n// [Documentation](www.gosquared.com/support).\n// [Tracker Functions](https://www.gosquared.com/customer/portal/articles/612063-tracker-functions)\n// Will automatically [integrate with Olark](https://www.gosquared.com/support/articles/721791-setting-up-olark-live-chat).\n\nvar Provider = require('../provider')\n , user = require('../user')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'siteToken',\n\n options : {\n siteToken : null\n },\n\n\n initialize : function (options, ready) {\n var GoSquared = window.GoSquared = {};\n GoSquared.acct = options.siteToken;\n GoSquared.q = [];\n window._gstc_lt =+ (new Date());\n\n GoSquared.VisitorName = user.id();\n GoSquared.Visitor = user.traits();\n\n load('//d1l6p2sc9645hc.cloudfront.net/tracker.js');\n\n // GoSquared makes a queue, so it's ready immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n // TODO figure out if this will actually work. Seems like GoSquared will\n // never know these values are updated.\n if (userId) window.GoSquared.UserName = userId;\n if (traits) window.GoSquared.Visitor = traits;\n },\n\n\n track : function (event, properties) {\n // GoSquared sets a `gs_evt_name` property with a value of the event\n // name, so it relies on properties being an object.\n window.GoSquared.q.push(['TrackEvent', event, properties || {}]);\n },\n\n\n pageview : function (url) {\n window.GoSquared.q.push(['TrackView', url]);\n }\n\n});//@ sourceURL=analytics/src/providers/gosquared.js"
));
require.register("analytics/src/providers/hittail.js", Function("exports, require, module",
"// HitTail\n// -------\n// [Documentation](www.hittail.com).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'siteId',\n\n options : {\n siteId : null\n },\n\n\n initialize : function (options, ready) {\n load('//' + options.siteId + '.hittail.com/mlt.js', ready);\n }\n\n});//@ sourceURL=analytics/src/providers/hittail.js"
));
require.register("analytics/src/providers/hubspot.js", Function("exports, require, module",
"// HubSpot\n// -------\n// [Documentation](http://hubspot.clarify-it.com/d/4m62hl)\n\nvar Provider = require('../provider')\n , isEmail = require('is-email')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'portalId',\n\n options : {\n portalId : null\n },\n\n\n initialize : function (options, ready) {\n // HubSpot checks in their snippet to make sure another script with\n // `hs-analytics` isn't already in the DOM. Seems excessive, but who knows\n // if there's weird deprecation going on :p\n if (!document.getElementById('hs-analytics')) {\n window._hsq = window._hsq || [];\n var script = load('https://js.hubspot.com/analytics/' + (Math.ceil(new Date()/300000)*300000) + '/' + options.portalId + '.js');\n script.id = 'hs-analytics';\n }\n\n // HubSpot makes a queue, so it's ready immediately.\n ready();\n },\n\n\n // HubSpot does not use a userId, but the email address is required on\n // the traits object.\n identify : function (userId, traits) {\n // If there wasn't already an email and the userId is one, use it.\n if ((!traits || !traits.email) && isEmail(userId)) {\n traits || (traits = {});\n traits.email = userId;\n }\n\n // Still don't have any traits? Get out.\n if (!traits) return;\n\n window._hsq.push([\"identify\", traits]);\n },\n\n\n // Event Tracking is available to HubSpot Enterprise customers only. In\n // addition to adding any unique event name, you can also use the id of an\n // existing custom event as the event variable.\n track : function (event, properties) {\n window._hsq.push([\"trackEvent\", event, properties]);\n },\n\n\n // HubSpot doesn't support passing in a custom URL.\n pageview : function (url) {\n window._hsq.push(['_trackPageview']);\n }\n\n});//@ sourceURL=analytics/src/providers/hubspot.js"
));
require.register("analytics/src/providers/index.js", Function("exports, require, module",
"\nexports['Bitdeli'] = require('./bitdeli');\nexports['BugHerd'] = require('./bugherd');\nexports['Chartbeat'] = require('./chartbeat');\nexports['ClickTale'] = require('./clicktale');\nexports['Clicky'] = require('./clicky');\nexports['comScore'] = require('./comscore');\nexports['CrazyEgg'] = require('./crazyegg');\nexports['Customer.io'] = require('./customerio');\nexports['Errorception'] = require('./errorception');\nexports['FoxMetrics'] = require('./foxmetrics');\nexports['Gauges'] = require('./gauges');\nexports['Google Analytics'] = require('./google-analytics');\nexports['GoSquared'] = require('./gosquared');\nexports['HitTail'] = require('./hittail');\nexports['HubSpot'] = require('./hubspot');\nexports['Intercom'] = require('./intercom');\nexports['Keen IO'] = require('./keen-io');\nexports['KISSmetrics'] = require('./kissmetrics');\nexports['Klaviyo'] = require('./klaviyo');\nexports['LiveChat'] = require('./livechat');\nexports['Mixpanel'] = require('./mixpanel');\nexports['Olark'] = require('./olark');\nexports['Perfect Audience'] = require('./perfect-audience');\nexports['Qualaroo'] = require('./qualaroo');\nexports['Quantcast'] = require('./quantcast');\nexports['Sentry'] = require('./sentry');\nexports['SnapEngage'] = require('./snapengage');\nexports['Storyberg'] = require('./storyberg');\nexports['USERcycle'] = require('./usercycle');\nexports['UserVoice'] = require('./uservoice');\nexports['Vero'] = require('./vero');\nexports['Woopra'] = require('./woopra');\n//@ sourceURL=analytics/src/providers/index.js"
));
require.register("analytics/src/providers/intercom.js", Function("exports, require, module",
"// Intercom\n// --------\n// [Documentation](http://docs.intercom.io/).\n// http://docs.intercom.io/#IntercomJS\n\nvar Provider = require('../provider')\n , extend = require('extend')\n , load = require('load-script')\n , isEmail = require('is-email');\n\n\nmodule.exports = Provider.extend({\n\n // Whether Intercom has already been booted or not. Intercom becomes booted\n // after Intercom('boot', ...) has been called on the first identify.\n booted : false,\n\n key : 'appId',\n\n options : {\n // Intercom's required key.\n appId : null,\n // An optional setting to display the Intercom inbox widget.\n activator : null,\n // Whether to show the count of messages for the inbox widget.\n counter : true\n },\n\n initialize : function (options, ready) {\n load('https://api.intercom.io/api/js/library.js', ready);\n },\n\n identify : function (userId, traits) {\n // Intercom requires a `userId` to associate data to a user.\n if (!userId) return;\n\n // Don't do anything if we just have traits.\n if (!this.booted && !userId) return;\n\n // Pass traits directly in to Intercom's `custom_data`.\n var settings = {\n custom_data : traits || {}\n };\n\n // They need `created_at` as a Unix timestamp (seconds).\n if (traits && traits.created) {\n settings.created_at = Math.floor(traits.created/1000);\n delete traits.created;\n }\n\n // Pull out an email field. Falling back to the `userId` if possible.\n if (traits && traits.email) {\n settings.email = traits.email;\n delete traits.email;\n } else if (isEmail(userId)) {\n settings.email = userId;\n }\n\n // Pull out a name field, or combine one from `firstName` and `lastName`.\n if (traits && traits.name) {\n settings.name = traits.name;\n delete traits.name;\n } else if (traits && traits.firstName && traits.lastName) {\n settings.name = traits.firstName + ' ' + traits.lastName;\n }\n\n // Pull out a company field.\n if (traits && traits.company) {\n settings.company = traits.company;\n delete traits.company;\n }\n\n // Optionally add the inbox widget.\n if (this.options.activator) {\n settings.widget = {\n activator : this.options.activator,\n use_counter : this.options.counter\n };\n }\n\n // If this is the first time we've identified, `boot` instead of `update`\n // and add our one-time boot settings.\n if (this.booted) {\n window.Intercom('update', settings);\n } else {\n extend(settings, {\n app_id : this.options.appId,\n user_hash : this.options.userHash,\n user_id : userId\n });\n window.Intercom('boot', settings);\n }\n\n // Set the booted state, so that we know to call 'update' next time.\n this.booted = true;\n }\n\n});\n//@ sourceURL=analytics/src/providers/intercom.js"
));
require.register("analytics/src/providers/keen-io.js", Function("exports, require, module",
"// Keen IO\n// -------\n// [Documentation](https://keen.io/docs/).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n options : {\n // Keen IO has two required options: `projectId` and `apiKey`.\n projectId : null,\n apiKey : null,\n // Whether or not to pass pageviews on to Keen IO.\n pageview : false,\n // Whether or not to track an initial pageview on initialize.\n initialPageview : false\n },\n\n\n initialize : function (options, ready) {\n window.Keen = window.Keen||{configure:function(a,b,c){this._pId=a;this._ak=b;this._op=c},addEvent:function(a,b,c,d){this._eq=this._eq||[];this._eq.push([a,b,c,d])},setGlobalProperties:function(a){this._gp=a},onChartsReady:function(a){this._ocrq=this._ocrq||[];this._ocrq.push(a)}};\n window.Keen.configure(options.projectId, options.apiKey);\n\n load('//dc8na2hxrj29i.cloudfront.net/code/keen-2.0.0-min.js');\n\n if (options.initialPageview) this.pageview();\n\n // Keen IO defines all their functions in the snippet, so they\n // are ready immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n // Use Keen IO global properties to include `userId` and `traits` on\n // every event sent to Keen IO.\n var globalUserProps = {};\n if (userId) globalUserProps.userId = userId;\n if (traits) globalUserProps.traits = traits;\n if (userId || traits) {\n window.Keen.setGlobalProperties(function(eventCollection) {\n return { user: globalUserProps };\n });\n }\n },\n\n\n track : function (event, properties) {\n window.Keen.addEvent(event, properties);\n },\n\n\n pageview : function (url) {\n if (!this.options.pageview) return;\n\n var properties;\n if (url) properties = { url : url };\n\n this.track('Loaded a Page', properties);\n }\n\n});//@ sourceURL=analytics/src/providers/keen-io.js"
));
require.register("analytics/src/providers/kissmetrics.js", Function("exports, require, module",
"// KISSmetrics\n// -----------\n// [Documentation](http://support.kissmetrics.com/apis/javascript).\n\nvar Provider = require('../provider')\n , alias = require('alias')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'apiKey',\n\n options : {\n apiKey : null\n },\n\n\n initialize : function (options, ready) {\n window._kmq = window._kmq || [];\n load('//i.kissmetrics.com/i.js');\n load('//doug1izaerwt3.cloudfront.net/' + options.apiKey + '.1.js');\n\n // KISSmetrics creates a queue, so it's ready immediately.\n ready();\n },\n\n\n // KISSmetrics uses two separate methods: `identify` for storing the\n // `userId`, and `set` for storing `traits`.\n identify : function (userId, traits) {\n if (userId) window._kmq.push(['identify', userId]);\n if (traits) window._kmq.push(['set', traits]);\n },\n\n\n track : function (event, properties) {\n // KISSmetrics handles revenue with the `'Billing Amount'` property by\n // default, although it's changeable in the interface.\n if (properties) {\n alias(properties, {\n 'revenue' : 'Billing Amount'\n });\n }\n\n window._kmq.push(['record', event, properties]);\n },\n\n\n // Although undocumented, KISSmetrics actually supports not passing a second\n // ID, in which case it uses the currenty identified user's ID.\n alias : function (newId, originalId) {\n window._kmq.push(['alias', newId, originalId]);\n }\n\n});//@ sourceURL=analytics/src/providers/kissmetrics.js"
));
require.register("analytics/src/providers/klaviyo.js", Function("exports, require, module",
"// Klaviyo\n// -------\n// [Documentation](https://www.klaviyo.com/docs).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'apiKey',\n\n options : {\n apiKey : null\n },\n\n\n initialize : function (options, ready) {\n window._learnq = window._learnq || [];\n window._learnq.push(['account', options.apiKey]);\n load('//a.klaviyo.com/media/js/learnmarklet.js');\n\n // Klaviyo creats a queue, so it's ready immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n if (!userId && !traits) return;\n\n // Klaviyo takes the user ID on the traits object itself.\n traits || (traits = {});\n if (userId) traits.$id = userId;\n\n window._learnq.push(['identify', traits]);\n },\n\n\n track : function (event, properties) {\n window._learnq.push(['track', event, properties]);\n }\n\n});//@ sourceURL=analytics/src/providers/klaviyo.js"
));
require.register("analytics/src/providers/livechat.js", Function("exports, require, module",
"// LiveChat\n// --------\n// [Documentation](http://www.livechatinc.com/api/javascript-api).\n\nvar Provider = require('../provider')\n , each = require('each')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'license',\n\n options : {\n license : null\n },\n\n initialize : function (options, ready) {\n window.__lc = { license : options.license };\n load('//cdn.livechatinc.com/tracking.js', ready);\n },\n\n\n // LiveChat isn't an analytics service, but we can use the `userId` and\n // `traits` to tag the user with their real name in the chat console.\n identify : function (userId, traits) {\n // In case the LiveChat library hasn't loaded yet.\n if (!window.LC_API) return;\n\n // We need either a `userId` or `traits`.\n if (!userId && !traits) return;\n\n // LiveChat takes them in an array format.\n var variables = [];\n\n if (userId) variables.push({ name: 'User ID', value: userId });\n if (traits) {\n each(traits, function (key, value) {\n variables.push({\n name : key,\n value : value\n });\n });\n }\n\n window.LC_API.set_custom_variables(variables);\n }\n\n});//@ sourceURL=analytics/src/providers/livechat.js"
));
require.register("analytics/src/providers/mixpanel.js", Function("exports, require, module",
"// Mixpanel\n// --------\n// [Documentation](https://mixpanel.com/docs/integration-libraries/javascript),\n// [documentation](https://mixpanel.com/docs/people-analytics/javascript),\n// [documentation](https://mixpanel.com/docs/integration-libraries/javascript-full-api).\n\nvar Provider = require('../provider')\n , alias = require('alias')\n , isEmail = require('is-email');\n\n\nmodule.exports = Provider.extend({\n\n key : 'token',\n\n options : {\n // Whether to call `mixpanel.nameTag` on `identify`.\n nameTag : true,\n // Whether to use Mixpanel's People API.\n people : false,\n // The Mixpanel API token for your account.\n token : null,\n // Whether to track pageviews to Mixpanel.\n pageview : false,\n // Whether to track an initial pageview on initialize.\n initialPageview : false\n },\n\n initialize : function (options, ready) {\n (function (c, a) {\n window.mixpanel = a;\n var b, d, h, e;\n b = c.createElement('script');\n b.type = 'text/javascript';\n b.async = true;\n b.src = ('https:' === c.location.protocol ? 'https:' : 'http:') + '//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';\n d = c.getElementsByTagName('script')[0];\n d.parentNode.insertBefore(b, d);\n a._i = [];\n a.init = function (b, c, f) {\n function d(a, b) {\n var c = b.split('.');\n 2 == c.length && (a = a[c[0]], b = c[1]);\n a[b] = function () {\n a.push([b].concat(Array.prototype.slice.call(arguments, 0)));\n };\n }\n var g = a;\n 'undefined' !== typeof f ? g = a[f] = [] : f = 'mixpanel';\n g.people = g.people || [];\n h = ['disable', 'track', 'track_pageview', 'track_links', 'track_forms', 'register', 'register_once', 'unregister', 'identify', 'alias', 'name_tag', 'set_config', 'people.set', 'people.increment', 'people.track_charge', 'people.append'];\n for (e = 0; e < h.length; e++) d(g, h[e]);\n a._i.push([b, c, f]);\n };\n a.__SV = 1.2;\n })(document, window.mixpanel || []);\n\n // Pass options directly to `init` as the second argument.\n window.mixpanel.init(options.token, options);\n\n if (options.initialPageview) this.pageview();\n\n // Mixpanel creats all of its methods in the snippet, so it's ready\n // immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n // If we have an email and no email trait, set the email trait.\n if (userId && isEmail(userId) && (traits && !traits.email)) {\n traits || (traits = {});\n traits.email = userId;\n }\n\n // Alias the traits' keys with dollar signs for Mixpanel's API.\n if (traits) {\n alias(traits, {\n 'created' : '$created',\n 'email' : '$email',\n 'firstName' : '$first_name',\n 'lastName' : '$last_name',\n 'lastSeen' : '$last_seen',\n 'name' : '$name',\n 'username' : '$username'\n });\n }\n\n // Finally, call all of the identify equivalents. Verify certain calls\n // against options to make sure they're enabled.\n if (userId) {\n window.mixpanel.identify(userId);\n if (this.options.nameTag) window.mixpanel.name_tag(traits && traits.$email || userId);\n }\n if (traits) {\n window.mixpanel.register(traits);\n if (this.options.people) window.mixpanel.people.set(traits);\n }\n },\n\n\n track : function (event, properties) {\n window.mixpanel.track(event, properties);\n\n // Mixpanel handles revenue with a `transaction` call in their People\n // feature. So if we're using people, record a transcation.\n if (properties && properties.revenue && this.options.people) {\n window.mixpanel.people.track_charge(properties.revenue);\n }\n },\n\n\n // Mixpanel doesn't actually track the pageviews, but they do show up in the\n // Mixpanel stream.\n pageview : function (url) {\n window.mixpanel.track_pageview(url);\n\n // If they don't want pageviews tracked, leave now.\n if (!this.options.pageview) return;\n\n var properties;\n if (url) properties = { url : url };\n this.track('Loaded a Page', properties);\n },\n\n\n // Although undocumented, Mixpanel actually supports the `originalId`. It\n // just usually defaults to the current user's `distinct_id`.\n alias : function (newId, originalId) {\n\n if(window.mixpanel.get_distinct_id &&\n window.mixpanel.get_distinct_id() === newId) return;\n\n // HACK: internal mixpanel API to ensure we don't overwrite.\n if(window.mixpanel.get_property &&\n window.mixpanel.get_property('$people_distinct_id')) return;\n\n window.mixpanel.alias(newId, originalId);\n }\n\n});//@ sourceURL=analytics/src/providers/mixpanel.js"
));
require.register("analytics/src/providers/olark.js", Function("exports, require, module",
"// Olark\n// -----\n// [Documentation](http://www.olark.com/documentation).\n\nvar Provider = require('../provider');\n\n\nmodule.exports = Provider.extend({\n\n key : 'siteId',\n\n options : {\n siteId : null,\n identify : true,\n track : false,\n pageview : true\n },\n\n\n initialize : function (options, ready) {\n window.olark||(function(c){var f=window,d=document,l=f.location.protocol==\"https:\"?\"https:\":\"http:\",z=c.name,r=\"load\";var nt=function(){f[z]=function(){(a.s=a.s||[]).push(arguments)};var a=f[z]._={},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){f[z](\"call\",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={0:+new Date};a.P=function(u){a.p[u]=new Date-a.p[0]};function s(){a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent(\"on\"+r,s);var ld=function(){function p(hd){hd=\"head\";return[\"<\",hd,\"></\",hd,\"><\",i,' onl' + 'oad=\"var d=',g,\";d.getElementsByTagName('head')[0].\",j,\"(d.\",h,\"('script')).\",k,\"='\",l,\"//\",a.l,\"'\",'\"',\"></\",i,\">\"].join(\"\")}var i=\"body\",m=d[i];if(!m){return setTimeout(ld,100)}a.P(1);var j=\"appendChild\",h=\"createElement\",k=\"src\",n=d[h](\"div\"),v=n[j](d[h](z)),b=d[h](\"iframe\"),g=\"document\",e=\"domain\",o;n.style.display=\"none\";m.insertBefore(n,m.firstChild).id=z;b.frameBorder=\"0\";b.id=z+\"-loader\";if(/MSIE[ ]+6/.test(navigator.userAgent)){b.src=\"javascript:false\"}b.allowTransparency=\"true\";v[j](b);try{b.contentWindow[g].open()}catch(w){c[e]=d[e];o=\"javascript:var d=\"+g+\".open();d.domain='\"+d.domain+\"';\";b[k]=o+\"void(0);\"}try{var t=b.contentWindow[g];t.write(p());t.close()}catch(x){b[k]=o+'d.write(\"'+p().replace(/\"/g,String.fromCharCode(92)+'\"')+'\");d.close();'}a.P(2)};ld()};nt()})({loader: \"static.olark.com/jsclient/loader0.js\",name:\"olark\",methods:[\"configure\",\"extend\",\"declare\",\"identify\"]});\n window.olark.identify(options.siteId);\n\n // Olark creates all of it's method in the snippet, so it's ready\n // immediately.\n ready();\n },\n\n\n // Olark isn't an analytics service, but we can use the `userId` and\n // `traits` to tag the user with their real name in the chat console.\n identify : function (userId, traits) {\n if (!this.options.identify) return;\n\n // Choose the best name for the user that we can get.\n var name = userId;\n if (traits && traits.email) name = traits.email;\n if (traits && traits.name) name = traits.name;\n if (traits && traits.name && traits.email) name += ' ('+traits.email+')';\n\n // If we ended up with no name after all that, get out of there.\n if (!name) return;\n\n window.olark('api.chat.updateVisitorNickname', {\n snippet : name\n });\n },\n\n\n // Again, all we're doing is logging events the user triggers to the chat\n // console, if you so desire it.\n track : function (event, properties) {\n // Check the `track` setting to know whether log events or not.\n if (!this.options.track) return;\n\n // To stay consistent with olark's default messages, it's all lowercase.\n window.olark('api.chat.sendNotificationToOperator', {\n body : 'visitor triggered \"'+event+'\"'\n });\n },\n\n\n // Again, not analytics, but we can mimic the functionality Olark has for\n // normal pageviews with pseudo-pageviews, telling the operator when a\n // visitor changes pages.\n pageview : function (url) {\n // Check the `pageview` settings to know whether they want this or not.\n if (!this.options.pageview) return;\n\n // To stay consistent with olark's default messages, it's all lowercase.\n window.olark('api.chat.sendNotificationToOperator', {\n body : 'looking at ' + window.location.href\n });\n }\n\n});//@ sourceURL=analytics/src/providers/olark.js"
));
require.register("analytics/src/providers/perfect-audience.js", Function("exports, require, module",
"// Perfect Audience\n// ----------------\n// [Documentation](https://www.perfectaudience.com/docs#javascript_api_autoopen)\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'siteId',\n\n options : {\n siteId : null\n },\n\n\n initialize : function (options, ready) {\n window._pa = window._pa || {};\n load('//tag.perfectaudience.com/serve/' + options.siteId + '.js', ready);\n },\n\n\n track : function (event, properties) {\n // In case the Perfect Audience library hasn't loaded yet.\n if (!window._pa.track) return;\n\n window._pa.track(event, properties);\n }\n\n});//@ sourceURL=analytics/src/providers/perfect-audience.js"
));
require.register("analytics/src/providers/qualaroo.js", Function("exports, require, module",
"// Qualaroo\n// --------\n// [Identify Docs](http://help.qualaroo.com/customer/portal/articles/731085-identify-survey-nudge-takers)\n// [Set Docs](http://help.qualaroo.com/customer/portal/articles/731091-set-additional-user-properties)\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n options : {\n // Qualaroo has two required options.\n customerId : null,\n siteToken : null,\n // Whether to record traits when a user triggers an event. This can be\n // useful for sending targetted questionnaries.\n track : false\n },\n\n\n // Qualaroo's script has two options in its URL.\n initialize : function (options, ready) {\n window._kiq = window._kiq || [];\n load('//s3.amazonaws.com/ki.js/' + options.customerId + '/' + options.siteToken + '.js');\n\n // Qualaroo creates a queue, so it's ready immediately.\n ready();\n },\n\n\n // Qualaroo uses two separate methods: `identify` for storing the `userId`,\n // and `set` for storing `traits`.\n identify : function (userId, traits) {\n if (userId) window._kiq.push(['identify', userId]);\n if (traits) window._kiq.push(['set', traits]);\n },\n\n\n // Qualaroo doesn't have `track` method yet, but to allow the users to do\n // targetted questionnaires we can set name-value pairs on the user properties\n // that apply to the current visit.\n track : function (event, properties) {\n if (!this.options.track) return;\n\n // Create a name-value pair that will be pretty unique. For an event like\n // 'Loaded a Page' this will make it 'Triggered: Loaded a Page'.\n var traits = {};\n traits['Triggered: ' + event] = true;\n\n // Fire a normal identify, with traits only.\n this.identify(null, traits);\n }\n\n});//@ sourceURL=analytics/src/providers/qualaroo.js"
));
require.register("analytics/src/providers/quantcast.js", Function("exports, require, module",
"// Quantcast\n// ---------\n// [Documentation](https://www.quantcast.com/learning-center/guides/using-the-quantcast-asynchronous-tag/)\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'pCode',\n\n options : {\n pCode : null\n },\n\n\n initialize : function (options, ready) {\n window._qevents = window._qevents || [];\n window._qevents.push({ qacct: options.pCode });\n load({\n http : 'http://edge.quantserve.com/quant.js',\n https : 'https://secure.quantserve.com/quant.js'\n }, ready);\n }\n\n});//@ sourceURL=analytics/src/providers/quantcast.js"
));
require.register("analytics/src/providers/sentry.js", Function("exports, require, module",
"// Sentry\n// ------\n// http://raven-js.readthedocs.org/en/latest/config/index.html\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'config',\n\n options : {\n config : null\n },\n\n\n initialize : function (options, ready) {\n load('//d3nslu0hdya83q.cloudfront.net/dist/1.0/raven.min.js', function () {\n // For now, Raven basically requires `install` to be called.\n // https://github.com/getsentry/raven-js/blob/master/src/raven.js#L87\n window.Raven.config(options.config).install();\n ready();\n });\n },\n\n\n identify : function (userId, traits) {\n traits || (traits = {});\n if (userId) traits.id = userId;\n window.Raven.setUser(traits);\n }\n\n});//@ sourceURL=analytics/src/providers/sentry.js"
));
require.register("analytics/src/providers/snapengage.js", Function("exports, require, module",
"// SnapEngage\n// ----------\n// [Documentation](http://help.snapengage.com/installation-guide-getting-started-in-a-snap/).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'apiKey',\n\n options : {\n apiKey : null\n },\n\n\n initialize : function (options, ready) {\n load('//commondatastorage.googleapis.com/code.snapengage.com/js/' + options.apiKey + '.js', ready);\n }\n\n});//@ sourceURL=analytics/src/providers/snapengage.js"
));
require.register("analytics/src/providers/storyberg.js", Function("exports, require, module",
"// Storyberg\n// -----------\n// [Documentation](https://github.com/Storyberg/Docs/wiki/Javascript-Library).\n\nvar Provider = require('../provider')\n , isEmail = require('is-email')\n , load = require('load-script');\n\nmodule.exports = Provider.extend({\n\n key : 'apiKey',\n\n options : {\n apiKey : null\n },\n\n\n initialize : function (options, ready) {\n window._sbq = window._sbq || [];\n window._sbk = options.apiKey;\n load('//storyberg.com/analytics.js');\n\n // Storyberg creates a queue, so it's ready immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n // Don't do anything if we just have traits, because Storyberg\n // requires a `userId`.\n if (!userId) return;\n\n traits || (traits = {});\n\n // Storyberg takes the `userId` as part of the traits object\n traits.user_id = userId;\n\n // If there wasn't already an email and the userId is one, use it.\n if (!traits.email && isEmail(userId)) traits.email = userId;\n\n window._sbq.push(['identify', traits]);\n },\n\n\n track : function (event, properties) {\n properties || (properties = {});\n\n // Storyberg uses the event for the name, to avoid losing data\n if (properties.name) properties._name = properties.name;\n // Storyberg takes the `userId` as part of the properties object\n properties.name = event;\n\n window._sbq.push(['event', properties]);\n }\n\n});\n//@ sourceURL=analytics/src/providers/storyberg.js"
));
require.register("analytics/src/providers/usercycle.js", Function("exports, require, module",
"// USERcycle\n// -----------\n// [Documentation](http://docs.usercycle.com/javascript_api).\n\nvar Provider = require('../provider')\n , load = require('load-script')\n , user = require('../user');\n\n\nmodule.exports = Provider.extend({\n\n key : 'key',\n\n options : {\n key : null\n },\n\n\n initialize : function (options, ready) {\n window._uc = window._uc || [];\n window._uc.push(['_key', options.key]);\n load('//api.usercycle.com/javascripts/track.js');\n\n // USERcycle makes a queue, so it's ready immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n if (userId) window._uc.push(['uid', userId]);\n },\n\n\n track : function (event, properties) {\n // Usercycle seems to use traits instead of properties.\n var traits = user.traits();\n window._uc.push(['action', event, traits]);\n }\n\n});//@ sourceURL=analytics/src/providers/usercycle.js"
));
require.register("analytics/src/providers/uservoice.js", Function("exports, require, module",
"// UserVoice\n// ---------\n// [Documentation](http://feedback.uservoice.com/knowledgebase/articles/16797-how-do-i-customize-and-install-the-uservoice-feedb).\n\nvar Provider = require('../provider')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'widgetId',\n\n options : {\n widgetId : null\n },\n\n\n initialize : function (options, ready) {\n window.uvOptions = {};\n load('//widget.uservoice.com/' + options.widgetId + '.js', ready);\n }\n\n});//@ sourceURL=analytics/src/providers/uservoice.js"
));
require.register("analytics/src/providers/vero.js", Function("exports, require, module",
"// GetVero.com\n// -----------\n// [Documentation](https://github.com/getvero/vero-api/blob/master/sections/js.md).\n\nvar Provider = require('../provider')\n , isEmail = require('is-email')\n , load = require('load-script');\n\n\nmodule.exports = Provider.extend({\n\n key : 'apiKey',\n\n options : {\n apiKey : null\n },\n\n\n initialize : function (options, ready) {\n window._veroq = window._veroq || [];\n window._veroq.push(['init', { api_key: options.apiKey }]);\n load('//www.getvero.com/assets/m.js');\n\n // Vero creates a queue, so it's ready immediately.\n ready();\n },\n\n\n identify : function (userId, traits) {\n // Don't do anything if we just have traits, because Vero\n // requires a `userId`.\n if (!userId) return;\n\n traits || (traits = {});\n\n // Vero takes the `userId` as part of the traits object.\n traits.id = userId;\n\n // If there wasn't already an email and the userId is one, use it.\n if (!traits.email && isEmail(userId)) traits.email = userId;\n\n // Vero *requires* an email and an id\n if (!traits.id || !traits.email) return;\n\n window._veroq.push(['user', traits]);\n },\n\n\n track : function (event, properties) {\n window._veroq.push(['track', event, properties]);\n }\n\n});//@ sourceURL=analytics/src/providers/vero.js"
));
require.register("analytics/src/providers/woopra.js", Function("exports, require, module",
"// Woopra\n// ------\n// [Documentation](http://www.woopra.com/docs/setup/javascript-tracking/).\n\nvar Provider = require('../provider')\n , each = require('each')\n , extend = require('extend')\n , isEmail = require('is-email')\n , load = require('load-script')\n , type = require('type')\n , user = require('../user');\n\n\nmodule.exports = Provider.extend({\n\n key : 'domain',\n\n options : {\n domain : null\n },\n\n\n initialize : function (options, ready) {\n // Woopra gives us a nice ready callback.\n var self = this;\n\n window.woopraReady = function (tracker) {\n tracker.setDomain(self.options.domain);\n tracker.setIdleTimeout(300000);\n\n var userId = user.id()\n , traits = user.traits();\n\n self.addTraits(userId, traits, tracker);\n\n tracker.track();\n\n ready();\n return false;\n };\n\n load('//static.woopra.com/js/woopra.js');\n },\n\n\n identify : function (userId, traits) {\n\n if (!window.woopraTracker) return;\n\n this.addTraits(userId, traits, window.woopraTracker);\n window.woopraTracker.track();\n },\n\n\n // Convenience function for updating the userId and traits.\n addTraits : function (userId, traits, tracker) {\n\n var addTrait = tracker.addVisitorProperty;\n\n if (userId) addTrait('id', userId);\n if (isEmail(userId)) addTrait('email', userId);\n\n // Seems to only support strings\n each(traits, function (name, trait) {\n if (type(trait) === 'string') addTrait(name, trait);\n });\n },\n\n\n track : function (event, properties) {\n // We aren't guaranteed a tracker.\n if (!window.woopraTracker) return;\n\n // Woopra takes its event as dictionaries with the `name` key.\n var settings = {};\n settings.name = event;\n\n // If we have properties, add them to the settings.\n if (properties) settings = extend({}, properties, settings);\n\n window.woopraTracker.pushEvent(settings);\n }\n\n});//@ sourceURL=analytics/src/providers/woopra.js"
));
require.alias("component-clone/index.js", "analytics/deps/clone/index.js");
require.alias("component-type/index.js", "component-clone/deps/type/index.js");
require.alias("component-cookie/index.js", "analytics/deps/cookie/index.js");
require.alias("component-each/index.js", "analytics/deps/each/index.js");
require.alias("component-type/index.js", "component-each/deps/type/index.js");
require.alias("component-event/index.js", "analytics/deps/event/index.js");
require.alias("component-json/index.js", "analytics/deps/json/index.js");
require.alias("component-json-fallback/index.js", "analytics/deps/json-fallback/index.js");
require.alias("component-object/index.js", "analytics/deps/object/index.js");
require.alias("component-querystring/index.js", "analytics/deps/querystring/index.js");
require.alias("component-trim/index.js", "component-querystring/deps/trim/index.js");
require.alias("component-type/index.js", "analytics/deps/type/index.js");
require.alias("component-url/index.js", "analytics/deps/url/index.js");
require.alias("segmentio-after/index.js", "analytics/deps/after/index.js");
require.alias("segmentio-alias/index.js", "analytics/deps/alias/index.js");
require.alias("segmentio-canonical/index.js", "analytics/deps/canonical/index.js");
require.alias("segmentio-extend/index.js", "analytics/deps/extend/index.js");
require.alias("segmentio-is-email/index.js", "analytics/deps/is-email/index.js");
require.alias("segmentio-load-date/index.js", "analytics/deps/load-date/index.js");
require.alias("segmentio-load-script/index.js", "analytics/deps/load-script/index.js");
require.alias("component-type/index.js", "segmentio-load-script/deps/type/index.js");
require.alias("yields-prevent/index.js", "analytics/deps/prevent/index.js");
require.alias("analytics/src/index.js", "analytics/index.js");