{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/modules/user/analytics.js","webpack:////node_modules/mixpanel-browser/dist/mixpanel.cjs.js","webpack:////node_modules/regenerator-runtime/runtime.js","webpack:///./app/javascript/packs/application.js","webpack:///./app/javascript/application_entry.js","webpack:///./app/javascript/modules/user/utm_to_cookie.js","webpack:////node_modules/@babel/runtime/regenerator/index.js","webpack:////node_modules/js-cookie/dist/js.cookie.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","installedCssChunks","__webpack_require__","exports","module","l","e","promises","Promise","resolve","reject","href","fullhref","p","existingLinkTags","document","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","code","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","error","clearTimeout","chunk","errorType","realSrc","message","name","undefined","setTimeout","head","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice","s","setupMixpanel","MixpanelToken","mixpanel_token","mixpanel","init","debug","mix_panel_debug","mixpanel_identify","identify","people","set","mixpanel_email","setCookiesForMeasurementProtocol","GTAG_POLL_MAX_EXECUTIONS","maybe_start_polling","ga_measurement_id","__rise_gtm_poll","setInterval","fetch_client_id","__rise_gtm_poll_ex","clearInterval","warn","dataLayer","arguments","id","Cookies","ga_debug_mode","set_cookie_client_id","readyState","addEventListener","setGtmPreviewCookie","cookieValue","listenForFAQEvents","dataset","gaEvent","classList","contains","pushSelectContentEvent","innerText","matches","content_type","content_id","log","concat","_typeof","obj","iterator","constructor","window$1","Config","DEBUG","LIB_VERSION","loc","hostname","navigator","userAgent","location","referrer","screen","width","height","at","ch","text","escapee","next","number","string","white","array","T","ArrayProto","Array","FuncProto","Function","ObjProto","toString","windowConsole","navigator$1","document$1","windowOpera","opera","nativeBind","nativeForEach","forEach","nativeIndexOf","indexOf","nativeMap","map","nativeIsArray","isArray","breaker","_","trim","str","replace","isUndefined","apply","each","arg","args","toArray","critical","log_func_with_prefix","func","prefix","console_with_prefix","context","_bound","isFunction","TypeError","this","ctor","self","result","bind_instance_methods","escapeHTML","escaped","isString","extend","source","prop","f","test","x","isArguments","iterable","values","arr","callback","results","item","keys","include","found","includes","needle","inherit","subclass","superclass","isObject","isEmptyObject","isDate","isNumber","isElement","nodeType","encodeDates","v","k","formatDate","timestamp","Date","now","pad","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","safewrap","safewrap_class","klass","functions","safewrap_instance_methods","strip_empty_properties","ret","truncate","val","JSONEncode","mixed_val","quote","escapable","meta","lastIndex","a","charCodeAt","holder","gap","mind","partial","toJSON","isFinite","String","join","JSONDecode","SyntaxError","charAt","hex","uffff","parseInt","fromCharCode","word","base64Encode","h1","h2","h3","h4","bits","b64","ac","enc","tmp_arr","utf8Encode","start","end","stringl","utftext","c1","substring","UUID","se","Math","random","ua","buffer","xor","byte_array","j","tmp","unshift","UA","BLOCKED_UA_STRS","isBlockedUA","toLowerCase","HTTPBuildQuery","formdata","arg_separator","use_val","use_key","encodeURIComponent","getQueryParam","url","param","RegExp","exec","decodeURIComponent","cookie","nameEQ","ca","split","parse","set_seconds","seconds","is_cross_subdomain","is_secure","is_cross_site","domain_override","cdomain","expires","secure","domain","extract_domain","date","setTime","getTime","toGMTString","days","new_cookie_val","remove","_localStorageSupported","localStorageSupported","storage","forceCheck","supported","localStorage","cheap_guid","setItem","getItem","removeItem","is_supported","force_check","msg","register_event","fixEvent","preventDefault","stopPropagation","returnValue","cancelBubble","element","handler","oldSchool","useCapture","ontype","old_handler","new_handler","old_handlers","old_result","new_result","makeHandler","TOKEN_MATCH_REGEX","dom_query","getAllChildren","bad_whitespace","hasClass","elem","selector","className","getElementsBySelector","token","tagName","foundCount","elements","currentContextIndex","tokens","currentContext","getElementById","nodeName","token_match","match","checkFunction","attrName","attrOperator","attrValue","lastIndexOf","query","info","campaignParams","campaign_keywords","kw","params","kwkey","URL","searchEngine","search","searchInfo","keyword","browser","user_agent","vendor","browserVersion","regex","parseFloat","os","device","referringDomain","properties","people_properties","pageviewInfo","page","maxlen","guid","SIMPLE_DOMAIN_MATCH_REGEX","DOMAIN_MATCH_REGEX","domain_regex","parts","tld","JSONStringify","JSONParse","JSON","stringify","DomTracker","create_properties","event_handler","after_track_handler","mixpanel_instance","mp","track","event_name","user_callback","that","override_event","options","props","get_config","track_callback","timeout_occured","callback_fired","LinkTracker","evt","new_tab","which","metaKey","ctrlKey","FormTracker","submit","logger$2","SharedLock","storageKey","pollIntervalMS","timeoutMS","withLock","lockedCB","errorCB","pid","startTime","keyX","keyY","keyZ","reportError","delay","cb","loop","waitFor","predicate","getSetY","valY","criticalSection","logger$1","RequestQueue","lock","memQueue","enqueue","flushInterval","queueEntry","succeeded","storedQueue","readFromStorage","saveToStorage","fillBatch","batchSize","batch","idsInBatch","orphaned","filterOutIDsAndInvalid","items","idSet","filteredItems","removeItemsByID","ids","updatePayloads","existingItems","itemsToUpdate","newItems","newPayload","storageEntry","queue","clear","logger","RequestBatcher","libConfig","sendRequest","sendRequestFunc","beforeSendHook","stopped","flush","stop","timeoutID","resetBatchSize","resetFlush","scheduleFlush","flushMS","requestInProgress","currentBatchSize","dataForRequest","transformedItems","payload","batchSendCallback","res","removeItemsFromQueue","unloading","xhr_req","retryMS","headers","retryAfter","min","halvedBatchSize","max","floor","requestOptions","method","verbose","ignore_json_errors","timeout_ms","transport","GDPR_DEFAULT_PERSISTENCE_PREFIX","optIn","_optInOut","optOut","hasOptedIn","_getStorageValue","hasOptedOut","ignoreDnt","win","nav","hasDntOn","dntValue","_hasDoNotTrackFlagOn","optedOut","addOptOutCheckMixpanelLib","_addOptOutCheck","addOptOutCheckMixpanelPeople","_get_config","addOptOutCheckMixpanelGroup","clearOptInOut","_getStorage","_getStorageKey","crossSubdomainCookie","cookieDomain","persistenceType","persistencePrefix","optValue","cookieExpiration","secureCookie","crossSiteCookie","trackEventName","trackProperties","getConfigValue","SET_ACTION","SET_ONCE_ACTION","UNSET_ACTION","ADD_ACTION","APPEND_ACTION","UNION_ACTION","REMOVE_ACTION","apiActions","set_action","to","$set","_is_reserved_property","unset_action","$unset","set_once_action","$set_once","union_action","list_name","$union","append_action","$append","remove_action","$remove","delete_action","MixpanelGroup","_init","group_key","group_id","_mixpanel","_group_key","_group_id","_send_request","set_once","unset","union","date_encoded_data","_track_or_batch","endpoint","batcher","request_batchers","groups","conf","SET_QUEUE_KEY","SET_ONCE_QUEUE_KEY","UNSET_QUEUE_KEY","ADD_QUEUE_KEY","APPEND_QUEUE_KEY","REMOVE_QUEUE_KEY","UNION_QUEUE_KEY","PEOPLE_DISTINCT_ID_KEY","ALIAS_ID_KEY","CAMPAIGN_IDS_KEY","EVENT_TIMERS_KEY","RESERVED_PROPERTIES","MixpanelPersistence","config","campaign_params_saved","storage_type","load","update_config","upgrade","save","disabled","entry","old_cookie_name","old_cookie","upgrade_from_old_lib","register_once","_expire_notification_campaigns","expire_days","cross_subdomain","cross_site","cookie_domain","default_value","default_expiry","register","unregister","campaigns_shown","EXPIRY_TIME","campaign_id","update_campaign_params","update_search_keyword","update_referrer_info","get_referrer_info","safe_merge","set_disabled","set_cookie_domain","set_cross_site","set_cross_subdomain","set_secure","get_cross_subdomain","_add_to_people_queue","q_key","_get_queue_key","q_data","set_q","_get_or_create_queue","set_once_q","unset_q","add_q","union_q","remove_q","append_q","_pop_from_people_queue","enqueued_obj","append_obj","q","_get_queue","queued_action","default_val","set_event_timer","timers","remove_event_timer","OPERATOR_KEY","PROPERTY_KEY","WINDOW_KEY","UNIT_KEY","VALUE_KEY","HOUR_KEY","DAY_KEY","WEEK_KEY","MONTH_KEY","EVENT_PROPERTY","LITERAL_PROPERTY","AND_OPERATOR","OR_OPERATOR","IN_OPERATOR","NOT_IN_OPERATOR","PLUS_OPERATOR","MINUS_OPERATOR","MUL_OPERATOR","DIV_OPERATOR","MOD_OPERATOR","EQUALS_OPERATOR","NOT_EQUALS_OPERATOR","GREATER_OPERATOR","LESS_OPERATOR","GREATER_EQUAL_OPERATOR","LESS_EQUAL_OPERATOR","BOOLEAN_OPERATOR","DATETIME_OPERATOR","LIST_OPERATOR","NUMBER_OPERATOR","STRING_OPERATOR","NOT_OPERATOR","DEFINED_OPERATOR","NOT_DEFINED_OPERATOR","NOW_LITERAL","toNumber","Number","isNaN","toBoolean","evaluateEquality","op","_isArrayEqual","_isEqual","evaluateSelector","evaluateOperator","evaluateAnd","evaluateOr","leftValue","rightValue","evaluateIn","evaluatePlus","evaluateArithmetic","compare","localeCompare","evaluateComparison","evaluateBoolean","evaluateDateTime","evaluateList","evaluateNumber","evaluateString","b","evaluateDefined","evaluateNot","evaluateOperand","out","evaluateWindow","filters","MixpanelNotification","notif_data","persistence","resource_protocol","cdn_host","message_id","body","cta","notif_type","style","title","video_width","VIDEO_WIDTH","video_height","VIDEO_HEIGHT","display_triggers","dest_url","image_url","thumb_image_url","video_url","clickthrough","mini","notif_width","NOTIF_WIDTH_MINI","NOTIF_WIDTH","_set_client_config","imgs_to_preload","_init_image_html","_init_video","ANIM_TIME","MARKUP_PREFIX","BG_OPACITY","NOTIF_TOP","NOTIF_START_TOP","NOTIF_HEIGHT_MINI","THUMB_BORDER_SIZE","THUMB_IMG_SIZE","THUMB_OFFSET","round","show","body_el","_init_styles","_init_notification_el","_preload_images","_attach_and_animate","dismiss","marked_as_shown","_mark_delivery","notif_attr","notif_start","notif_goal","exiting_el","showing_video","_get_el","_get_notification_display_el","use_transitions","_remove_class","_add_class","_remove_notification_el","_animate_els","el","attr","goal","class_name","anims","mss","done_cb","start_time","ai","anim","time_diff","in_progress","cur_time","anim_diff","anim_dir","suffix","shown","_get_shown_campaigns","notification_el","notif_el","_mark_as_shown","click_el","show_video","_track_event","_switch_to_video","tracking_cb","open","_matches_event_data","event_data","display_trigger","_browser_lte","version","browser_versions","img_html","thumb_img_html","notification_html","video_src","video_html","cancel_html","close_html","play_html","youtube_video","yt_custom","vimeo_video","video_iframe","flip_animate","main_html","innerHTML","style_vals","bg","bg_actions","bg_hover","bg_light","border_gray","cancel_opacity","mini_hover","text_title","text_main","text_tagline","text_hover","shadow","video_shadow","mini_shadow","thumb_total_size","anim_seconds","notif_media_queries","notif_styles","doc_width","doc_height","VENDOR_STYLES","VENDOR_PREFIXES","si","pi","media_queries","create_style_text","style_text","head_el","style_el","style_defs","st","mq_defs","mqt","mq","create_media_query_text","documentElement","styleSheet","cssText","textContent","youtube_match","vimeo_match","_yt_video_ready","firstScriptTag","insertBefore","get_style","style_name","styles","defaultView","getComputedStyle","currentStyle","extra_props","all_loaded_cb","preloaded_imgs","img_objs","img","Image","complete","imgs_loaded","_video_progress_checker","visibility","get_browser_version","browser_ex","ActiveXObject","scrollWidth","offsetWidth","clientWidth","scrollHeight","offsetHeight","clientHeight","ie_ver","sample_styles","is_css_compatible","rule","toUpperCase","overlay","video_ready","video_inited","progress_bar","progress_time","progress_el","ytplayer","video_duration","update_video_time","current_time","secs","mins","hours","clickx","pageX","getBoundingClientRect","left","init_type","mixpanel_master","MixpanelPeople","increment","by","$add","append","track_charge","amount","clear_charges","delete_user","_identify_called","get_distinct_id","device_id","get_property","user_id","had_persisted_distinct_id","_enqueue","status","conf_var","_flags","identify_called","_flush_one_queue","action","action_method","queue_to_params_fn","_this","queued_data","action_params","response","_flush","_set_callback","_add_callback","_append_callback","_set_once_callback","_union_callback","_unset_callback","_remove_callback","$append_queue","$remove_queue","$append_item","append_callback","pop","$remove_item","remove_callback","IDENTITY_FUNC","NOOP_FUNC","PRIMARY_INSTANCE_NAME","USE_XHR","XMLHttpRequest","ENQUEUE_REQUESTS","sendBeacon","DEFAULT_CONFIG","DOM_LOADED","MixpanelLib","create_mplib","instance","_cached_groups","_user_decide_check_complete","_events_tracked_before_user_decide_check_complete","_execute_array","encode_data_for_request","json_data","_loaded","set_config","__dom_loaded_queue","__request_queue","__disabled_events","_batch_requests","init_batchers","flush_on_unload","events","ev","unpersisted_superprops","_gdpr_init","uuid","_set_default_superprops","_dom_loaded","_track_dom","has_opted_out_tracking","DomClass","dt","_prepare_callback","jsc","randomized_cb","callback_string","DEFAULT_OPTIONS","body_data","use_post","use_sendBeacon","verbose_mode","req","headerValue","headerName","setRequestHeader","withCredentials","onreadystatechange","responseText","statusText","send","async","defer","fn_name","alias_calls","other_calls","tracking_calls","execute","calls","caller","are_batchers_initialized","batcher_for","attrs","queue_suffix","_run_hook","start_batch_senders","stop_batch_senders","disable","disable_all_events","truncated_data","should_send_immediately","send_request_options","request_enqueued_or_initiated","send_request_immediately","skip_hooks","_event_is_disabled","start_timestamp","duration_in_ms","toFixed","property_blacklist","blacklisted_prop","_check_and_handle_triggered_notifications","set_group","group_ids","add_group","old_values","remove_group","old_value","idx","splice","track_with_groups","tracking_props","_create_map_key","_remove_group_from_cache","get_group","map_key","group","track_pageview","track_links","track_forms","time_event","REGISTER_DEFAULTS","options_for_register","days_or_options","_register_single","new_distinct_id","previous_distinct_id","_check_and_handle_notifications","reset","alias","original","name_tag","prop_name","hook_name","property_name","_show_notification","distinct_id","notifications","notif","_handle_user_decide_check_complete","has_opted_in_tracking","opt_in_tracking","opt_out_tracking","clear_opt_in_out_tracking","_gdpr_update_persistence","_gdpr_call_func","instances","override_mp_init_func","dom_loaded_handler","done","inst","attachEvent","toplevel","frameElement","doScroll","do_scroll_check","add_dom_loaded_handler","runtime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","define","configurable","writable","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","Context","_invoke","state","GenStateSuspendedStart","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","GenStateSuspendedYield","makeInvokeMethod","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","invoke","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iteratorMethod","displayName","isGeneratorFunction","genFun","mark","setPrototypeOf","__proto__","awrap","iter","reverse","skipTempReset","prev","rootRecord","rval","exception","handle","caught","hasCatch","hasFinally","finallyEntry","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","require","Application","_classCallCheck","URLSearchParams","tn","Analytics","onready","_onready","_regeneratorRuntime","_callee","_yield$import","ScholarApp","_context","querySelectorAll","itemTitle","parentElement","toggle","querySelector","app","Header","factory","assign","api","converter","defaultAttributes","attributes","toUTCString","escape","stringifiedAttributes","attributeName","write","cookies","jar","foundKey","read","withAttributes","withConverter","freeze","path"],"mappings":";2hBACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBV,IAAYU,EAAgBV,IACpFI,EAASO,KAAKD,EAAgBV,GAAS,IAExCU,EAAgBV,GAAW,EAE5B,IAAID,KAAYG,EACZI,OAAOC,UAAUC,eAAeC,KAAKP,EAAaH,KACpDa,EAAQb,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCM,EAASC,QACdD,EAASU,OAATV,EAGF,CAIA,IAAIW,EAAmB,CAAC,EAGpBC,EAAqB,CACxB,EAAG,GAMAN,EAAkB,CACrB,EAAG,GAWJ,SAASO,EAAoBlB,GAG5B,GAAGgB,EAAiBhB,GACnB,OAAOgB,EAAiBhB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0f6e405203f39.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t9: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t9: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"js/\" + ({\"10\":\"header-menu\",\"11\":\"scholarship-app\",\"13\":\"vendors~scholarship-app\"}[chunkId]||chunkId) + \"-\" + {\"0\":\"7bcc94985626f03b5884\",\"1\":\"b0198736da3cc1c3336f\",\"2\":\"18491c744e9b900f692a\",\"3\":\"520d59eab6036a166b1b\",\"4\":\"9b7d05f1126550754c42\",\"5\":\"e2d6a105398624c2ebb8\",\"6\":\"1caf1023c6c0c88c9bc2\",\"7\":\"987e1b77e568272819a1\",\"10\":\"6af55b1097ff4e691cab\",\"11\":\"4d4fd7ed919343d17338\",\"13\":\"eaba3db1057a0176f75f\",\"14\":\"375d37f4900ec987ebd1\",\"15\":\"46456922fa942b403c2a\",\"16\":\"08685ee4720a46a07bb5\",\"17\":\"8f94288345b024cd47a8\",\"18\":\"e6fc8f575a02f72ee62e\",\"19\":\"4cbe4d0ef77f73c281e1\",\"20\":\"74aef5c10f3647749fa4\",\"21\":\"a982534a6b817eda7463\",\"22\":\"48ac1f40cad927914a4d\",\"23\":\"2b08e6340d5794477d6d\",\"24\":\"ff8ec18ca6498c9bcf05\",\"25\":\"b8c23260ecea93968adc\",\"26\":\"786bdbd7f253d4831e2c\",\"27\":\"b468a19f82138f23b69b\",\"28\":\"064c4f63f0bcce460141\"}[chunkId] + \".chunk.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"1\":1,\"2\":1,\"5\":1,\"6\":1,\"11\":1,\"15\":1,\"16\":1,\"17\":1,\"18\":1,\"19\":1,\"20\":1,\"21\":1,\"22\":1,\"23\":1,\"24\":1,\"25\":1,\"26\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"css/\" + ({\"10\":\"header-menu\",\"11\":\"scholarship-app\",\"13\":\"vendors~scholarship-app\"}[chunkId]||chunkId) + \"-\" + {\"0\":\"31d6cfe0\",\"1\":\"f026f77b\",\"2\":\"c831c510\",\"3\":\"31d6cfe0\",\"4\":\"31d6cfe0\",\"5\":\"c57ab829\",\"6\":\"00e3321b\",\"7\":\"31d6cfe0\",\"10\":\"31d6cfe0\",\"11\":\"33e1b139\",\"13\":\"31d6cfe0\",\"14\":\"31d6cfe0\",\"15\":\"69ab8670\",\"16\":\"a8bebb40\",\"17\":\"c615580a\",\"18\":\"85a9c765\",\"19\":\"02deee80\",\"20\":\"3b533475\",\"21\":\"8db316ac\",\"22\":\"32fda3c5\",\"23\":\"593bec8d\",\"24\":\"8419eb9e\",\"25\":\"0ba0211c\",\"26\":\"9cf99d2e\",\"27\":\"31d6cfe0\",\"28\":\"31d6cfe0\"}[chunkId] + \".chunk.css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"https://assets.apply.risefortheworld.org/packs/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 222);\n","/*\n *\n * @file analytics\n * Code for handling our google tag manager instance\n * Note that dataLayer pushes occur in other places (ScholarshipApplication.js)\n */\n\nimport Cookies from \"js-cookie\";\nimport mixpanel from \"mixpanel-browser\";\n\nconst setupMixpanel = function () {\n const MixpanelToken = window.mixpanel_token || false;\n\n if (MixpanelToken) {\n mixpanel.init(MixpanelToken, { debug: window.mix_panel_debug || false });\n if (window.mixpanel_identify) {\n mixpanel.identify(window.mixpanel_identify);\n mixpanel.people.set(\"email\", window.mixpanel_email);\n }\n }\n};\n\n/*\n *\n * We need the client_id from the Gtag so that it can be sent to the back end via a cookie.\n * gtag.js doesn't support event callbacks so we'll poll for 5 seconds or until the client_id is found\n *\n */\nconst setCookiesForMeasurementProtocol = function () {\n const GTAG_POLL_MAX_EXECUTIONS = 10;\n\n /**\n *\n * Starts polling if we have a measurement_id\n *\n */\n function maybe_start_polling() {\n if (typeof window.ga_measurement_id != \"undefined\") {\n window.__rise_gtm_poll = setInterval(fetch_client_id, 500);\n window.__rise_gtm_poll_ex = 0;\n }\n }\n\n /**\n *\n * Worker function that checks for the client_id in the dataLayer\n * and unsets the interval if it finds it\n *\n */\n function fetch_client_id() {\n if (window.__rise_gtm_poll_ex > GTAG_POLL_MAX_EXECUTIONS) {\n clearInterval(window.__rise_gtm_poll);\n console.warn(\"gtag.js client_id not found after \" + GTAG_POLL_MAX_EXECUTIONS + \" attempts\");\n return;\n } else {\n window.__rise_gtm_poll_ex += 1;\n }\n\n if (typeof window.dataLayer != \"undefined\") {\n clearInterval(window.__rise_gtm_poll);\n (function () {\n window.dataLayer.push(arguments);\n })(\"get\", window.ga_measurement_id, \"client_id\", (id) => set_cookie_client_id(id));\n }\n }\n\n /*\n *\n * Create ga_client_id cookie with the ID value if the cookie was not created before\n *\n */\n function set_cookie_client_id(id) {\n const ga_client_id = Cookies.get(\"ga_client_id\");\n if (!ga_client_id) {\n Cookies.set(\"ga_client_id\", id);\n }\n // Also set ga_debug_mode\n if (typeof window.ga_debug_mode != \"undefined\") {\n if (window.ga_debug_mode) {\n Cookies.set(\"ga_debug_mode\", \"1\");\n } else {\n Cookies.set(\"ga_debug_mode\", \"0\");\n }\n }\n }\n\n // Bootstrap the polling\n if (document.readyState === \"complete\") {\n maybe_start_polling();\n } else {\n window.addEventListener(\"DOMContentLoaded\", maybe_start_polling);\n }\n\n window.setGtmPreviewCookie = function (cookieValue) {\n Cookies.set(\"ga_server_preview\", cookieValue);\n return \"Set ga_server_preview cookie to \" + cookieValue;\n };\n};\n\n/*\n Our FAQ accordions need to be instrumented. When expanded, we will\n send the select_content event to the dataLayer including the innerText of the\n clicked accordion title as the content_id. The content_type is 'faq'.\n*/\nconst listenForFAQEvents = function () {\n // attach event listener to the document and listen for clicks\n // on elements with data attribute data-ga-event=\"select_content\"\n // but only send the dataLayer event if the parent node has classs\n // faqs__item--expanded or\n\n document.addEventListener(\"click\", function (event) {\n if (event.target.dataset.gaEvent === \"faq\") {\n if (event.target.parentNode.classList.contains(\"faqs__item--expanded\")) {\n pushSelectContentEvent(\"faq\", event.target.innerText);\n }\n }\n if (event.target.matches(\".essay-question__resources a\")) {\n pushSelectContentEvent(\"resources\", event.target.innerText);\n }\n });\n};\n\nconst pushSelectContentEvent = function (content_type, content_id) {\n console.log(`select_content: ${content_type}: ${content_id}`);\n if (typeof window.dataLayer === \"undefined\") {\n return;\n }\n window.dataLayer.push({\n event: \"select_content\",\n content_type: content_type,\n content_id: content_id,\n });\n};\n\nexport { listenForFAQEvents, pushSelectContentEvent, setCookiesForMeasurementProtocol, setupMixpanel };\n","'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\nvar Config = {\n DEBUG: false,\n LIB_VERSION: '2.42.0'\n};\n\n// since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file\nvar window$1;\nif (typeof window === 'undefined') {\n var loc = {\n hostname: ''\n };\n window$1 = {\n navigator: {\n userAgent: ''\n },\n document: {\n location: loc,\n referrer: ''\n },\n screen: {\n width: 0,\n height: 0\n },\n location: loc\n };\n} else {\n window$1 = window;\n}\n\n/*\n * Saved references to long variable names, so that closure compiler can\n * minimize file size.\n */\n\nvar ArrayProto = Array.prototype;\nvar FuncProto = Function.prototype;\nvar ObjProto = Object.prototype;\nvar slice = ArrayProto.slice;\nvar toString = ObjProto.toString;\nvar hasOwnProperty = ObjProto.hasOwnProperty;\nvar windowConsole = window$1.console;\nvar navigator$1 = window$1.navigator;\nvar document$1 = window$1.document;\nvar windowOpera = window$1.opera;\nvar screen = window$1.screen;\nvar userAgent = navigator$1.userAgent;\nvar nativeBind = FuncProto.bind;\nvar nativeForEach = ArrayProto.forEach;\nvar nativeIndexOf = ArrayProto.indexOf;\nvar nativeMap = ArrayProto.map;\nvar nativeIsArray = Array.isArray;\nvar breaker = {};\nvar _ = {\n trim: function trim(str) {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n};\n\n// Console override\nvar console = {\n /** @type {function(...*)} */\n log: function log() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n try {\n windowConsole.log.apply(windowConsole, arguments);\n } catch (err) {\n _.each(arguments, function (arg) {\n windowConsole.log(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n warn: function warn() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel warning:'].concat(_.toArray(arguments));\n try {\n windowConsole.warn.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function (arg) {\n windowConsole.warn(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n error: function error() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function (arg) {\n windowConsole.error(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n critical: function critical() {\n if (!_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function (arg) {\n windowConsole.error(arg);\n });\n }\n }\n }\n};\nvar log_func_with_prefix = function log_func_with_prefix(func, prefix) {\n return function () {\n arguments[0] = '[' + prefix + '] ' + arguments[0];\n return func.apply(console, arguments);\n };\n};\nvar console_with_prefix = function console_with_prefix(prefix) {\n return {\n log: log_func_with_prefix(console.log, prefix),\n error: log_func_with_prefix(console.error, prefix),\n critical: log_func_with_prefix(console.critical, prefix)\n };\n};\n\n// UNDERSCORE\n// Embed part of the Underscore Library\n_.bind = function (func, context) {\n var args, _bound;\n if (nativeBind && func.bind === nativeBind) {\n return nativeBind.apply(func, slice.call(arguments, 1));\n }\n if (!_.isFunction(func)) {\n throw new TypeError();\n }\n args = slice.call(arguments, 2);\n _bound = function bound() {\n if (!(this instanceof _bound)) {\n return func.apply(context, args.concat(slice.call(arguments)));\n }\n var ctor = {};\n ctor.prototype = func.prototype;\n var self = new ctor();\n ctor.prototype = null;\n var result = func.apply(self, args.concat(slice.call(arguments)));\n if (Object(result) === result) {\n return result;\n }\n return self;\n };\n return _bound;\n};\n_.bind_instance_methods = function (obj) {\n for (var func in obj) {\n if (typeof obj[func] === 'function') {\n obj[func] = _.bind(obj[func], obj);\n }\n }\n};\n\n/**\n * @param {*=} obj\n * @param {function(...*)=} iterator\n * @param {Object=} context\n */\n_.each = function (obj, iterator, context) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) {\n return;\n }\n }\n } else {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) {\n return;\n }\n }\n }\n }\n};\n_.escapeHTML = function (s) {\n var escaped = s;\n if (escaped && _.isString(escaped)) {\n escaped = escaped.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''');\n }\n return escaped;\n};\n_.extend = function (obj) {\n _.each(slice.call(arguments, 1), function (source) {\n for (var prop in source) {\n if (source[prop] !== void 0) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n};\n_.isArray = nativeIsArray || function (obj) {\n return toString.call(obj) === '[object Array]';\n};\n\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// var bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\n_.isFunction = function (f) {\n try {\n return /^\\s*\\bfunction\\b/.test(f);\n } catch (x) {\n return false;\n }\n};\n_.isArguments = function (obj) {\n return !!(obj && hasOwnProperty.call(obj, 'callee'));\n};\n_.toArray = function (iterable) {\n if (!iterable) {\n return [];\n }\n if (iterable.toArray) {\n return iterable.toArray();\n }\n if (_.isArray(iterable)) {\n return slice.call(iterable);\n }\n if (_.isArguments(iterable)) {\n return slice.call(iterable);\n }\n return _.values(iterable);\n};\n_.map = function (arr, callback, context) {\n if (nativeMap && arr.map === nativeMap) {\n return arr.map(callback, context);\n } else {\n var results = [];\n _.each(arr, function (item) {\n results.push(callback.call(context, item));\n });\n return results;\n }\n};\n_.keys = function (obj) {\n var results = [];\n if (obj === null) {\n return results;\n }\n _.each(obj, function (value, key) {\n results[results.length] = key;\n });\n return results;\n};\n_.values = function (obj) {\n var results = [];\n if (obj === null) {\n return results;\n }\n _.each(obj, function (value) {\n results[results.length] = value;\n });\n return results;\n};\n_.include = function (obj, target) {\n var found = false;\n if (obj === null) {\n return found;\n }\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) {\n return obj.indexOf(target) != -1;\n }\n _.each(obj, function (value) {\n if (found || (found = value === target)) {\n return breaker;\n }\n });\n return found;\n};\n_.includes = function (str, needle) {\n return str.indexOf(needle) !== -1;\n};\n\n// Underscore Addons\n_.inherit = function (subclass, superclass) {\n subclass.prototype = new superclass();\n subclass.prototype.constructor = subclass;\n subclass.superclass = superclass.prototype;\n return subclass;\n};\n_.isObject = function (obj) {\n return obj === Object(obj) && !_.isArray(obj);\n};\n_.isEmptyObject = function (obj) {\n if (_.isObject(obj)) {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n return false;\n }\n }\n return true;\n }\n return false;\n};\n_.isUndefined = function (obj) {\n return obj === void 0;\n};\n_.isString = function (obj) {\n return toString.call(obj) == '[object String]';\n};\n_.isDate = function (obj) {\n return toString.call(obj) == '[object Date]';\n};\n_.isNumber = function (obj) {\n return toString.call(obj) == '[object Number]';\n};\n_.isElement = function (obj) {\n return !!(obj && obj.nodeType === 1);\n};\n_.encodeDates = function (obj) {\n _.each(obj, function (v, k) {\n if (_.isDate(v)) {\n obj[k] = _.formatDate(v);\n } else if (_.isObject(v)) {\n obj[k] = _.encodeDates(v); // recurse\n }\n });\n\n return obj;\n};\n_.timestamp = function () {\n Date.now = Date.now || function () {\n return +new Date();\n };\n return Date.now();\n};\n_.formatDate = function (d) {\n // YYYY-MM-DDTHH:MM:SS in UTC\n function pad(n) {\n return n < 10 ? '0' + n : n;\n }\n return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds());\n};\n_.safewrap = function (f) {\n return function () {\n try {\n return f.apply(this, arguments);\n } catch (e) {\n console.critical('Implementation error. Please turn on debug and contact support@mixpanel.com.');\n if (Config.DEBUG) {\n console.critical(e);\n }\n }\n };\n};\n_.safewrap_class = function (klass, functions) {\n for (var i = 0; i < functions.length; i++) {\n klass.prototype[functions[i]] = _.safewrap(klass.prototype[functions[i]]);\n }\n};\n_.safewrap_instance_methods = function (obj) {\n for (var func in obj) {\n if (typeof obj[func] === 'function') {\n obj[func] = _.safewrap(obj[func]);\n }\n }\n};\n_.strip_empty_properties = function (p) {\n var ret = {};\n _.each(p, function (v, k) {\n if (_.isString(v) && v.length > 0) {\n ret[k] = v;\n }\n });\n return ret;\n};\n\n/*\n * this function returns a copy of object after truncating it. If\n * passed an Array or Object it will iterate through obj and\n * truncate all the values recursively.\n */\n_.truncate = function (obj, length) {\n var ret;\n if (typeof obj === 'string') {\n ret = obj.slice(0, length);\n } else if (_.isArray(obj)) {\n ret = [];\n _.each(obj, function (val) {\n ret.push(_.truncate(val, length));\n });\n } else if (_.isObject(obj)) {\n ret = {};\n _.each(obj, function (val, key) {\n ret[key] = _.truncate(val, length);\n });\n } else {\n ret = obj;\n }\n return ret;\n};\n_.JSONEncode = function () {\n return function (mixed_val) {\n var value = mixed_val;\n var quote = function quote(string) {\n var escapable = /[\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g; // eslint-disable-line no-control-regex\n var meta = {\n // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\'\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' ? c : \"\\\\u\" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n };\n var str = function str(key, holder) {\n var gap = '';\n var indent = ' ';\n var i = 0; // The loop counter.\n var k = ''; // The member key.\n var v = ''; // The member value.\n var length = 0;\n var mind = gap;\n var partial = [];\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n if (value && _typeof(value) === 'object' && typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n // What happens next depends on the value's type.\n switch (_typeof(value)) {\n case 'string':\n return quote(value);\n case 'number':\n // JSON numbers must be finite. Encode non-finite numbers as null.\n return isFinite(value) ? String(value) : 'null';\n case 'boolean':\n case 'null':\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 case 'object':\n // If the type is 'object', we might be dealing with an object or an array or\n // null.\n // Due to a specification blunder in ECMAScript, typeof null is 'object',\n // so watch out for that case.\n if (!value) {\n return 'null';\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n gap += indent;\n partial = [];\n\n // Is the value an array?\n if (toString.apply(value) === '[object Array]') {\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 v = partial.length === 0 ? '[]' : gap ? '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + ']' : '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n // Iterate through all of the keys in the object.\n for (k in value) {\n if (hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n v = partial.length === 0 ? '{}' : gap ? '{' + partial.join(',') + '' + mind + '}' : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n };\n\n // Make a fake root object containing our value under the key of ''.\n // Return the result of stringifying the value.\n return str('', {\n '': value\n });\n };\n}();\n\n/**\n * From https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js\n * Slightly modified to throw a real Error rather than a POJO\n */\n_.JSONDecode = function () {\n var at,\n // The index of the current character\n ch,\n // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n 'b': '\\b',\n 'f': '\\f',\n 'n': '\\n',\n 'r': '\\r',\n 't': '\\t'\n },\n text,\n error = function error(m) {\n var e = new SyntaxError(m);\n e.at = at;\n e.text = text;\n throw e;\n },\n next = function next(c) {\n // If a c parameter is provided, verify that it matches the current character.\n if (c && c !== ch) {\n error('Expected \\'' + c + '\\' instead of \\'' + ch + '\\'');\n }\n // Get the next character. When there are no more characters,\n // return the empty string.\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n number = function number() {\n // Parse a number value.\n var number,\n string = '';\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error('Bad number');\n } else {\n return number;\n }\n },\n string = function string() {\n // Parse a string value.\n var hex,\n i,\n string = '',\n uffff;\n // When parsing for string values, we must look for \" and \\ characters.\n if (ch === '\"') {\n while (next()) {\n if (ch === '\"') {\n next();\n return string;\n }\n if (ch === '\\\\') {\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n } else {\n string += ch;\n }\n }\n }\n error('Bad string');\n },\n white = function white() {\n // Skip whitespace.\n while (ch && ch <= ' ') {\n next();\n }\n },\n word = function word() {\n // true, false, or null.\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error('Unexpected \"' + ch + '\"');\n },\n value,\n // Placeholder for the value function.\n array = function array() {\n // Parse an array value.\n var array = [];\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function object() {\n // Parse an object value.\n var key,\n object = {};\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n\n while (ch) {\n key = string();\n white();\n next(':');\n if (Object.hasOwnProperty.call(object, key)) {\n error('Duplicate key \"' + key + '\"');\n }\n object[key] = value();\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n value = function value() {\n // Parse a JSON value. It could be an object, an array, a string,\n // a number, or a word.\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n // Return the json_parse function. It will have access to all of the\n // above functions and variables.\n return function (source) {\n var result;\n text = source;\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error('Syntax error');\n }\n return result;\n };\n}();\n_.base64Encode = function (data) {\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n data = _.utf8Encode(data);\n do {\n // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n bits = o1 << 16 | o2 << 8 | o3;\n h1 = bits >> 18 & 0x3f;\n h2 = bits >> 12 & 0x3f;\n h3 = bits >> 6 & 0x3f;\n h4 = bits & 0x3f;\n\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n enc = tmp_arr.join('');\n switch (data.length % 3) {\n case 1:\n enc = enc.slice(0, -2) + '==';\n break;\n case 2:\n enc = enc.slice(0, -1) + '=';\n break;\n }\n return enc;\n};\n_.utf8Encode = function (string) {\n string = (string + '').replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n var utftext = '',\n start,\n end;\n var stringl = 0,\n n;\n start = end = 0;\n stringl = string.length;\n for (n = 0; n < stringl; n++) {\n var c1 = string.charCodeAt(n);\n var enc = null;\n if (c1 < 128) {\n end++;\n } else if (c1 > 127 && c1 < 2048) {\n enc = String.fromCharCode(c1 >> 6 | 192, c1 & 63 | 128);\n } else {\n enc = String.fromCharCode(c1 >> 12 | 224, c1 >> 6 & 63 | 128, c1 & 63 | 128);\n }\n if (enc !== null) {\n if (end > start) {\n utftext += string.substring(start, end);\n }\n utftext += enc;\n start = end = n + 1;\n }\n }\n if (end > start) {\n utftext += string.substring(start, string.length);\n }\n return utftext;\n};\n_.UUID = function () {\n // Time/ticks information\n // 1*new Date() is a cross browser version of Date.now()\n var T = function T() {\n var d = 1 * new Date(),\n i = 0;\n\n // this while loop figures how many browser ticks go by\n // before 1*new Date() returns a new number, ie the amount\n // of ticks that go by per millisecond\n while (d == 1 * new Date()) {\n i++;\n }\n return d.toString(16) + i.toString(16);\n };\n\n // Math.Random entropy\n var R = function R() {\n return Math.random().toString(16).replace('.', '');\n };\n\n // User agent entropy\n // This function takes the user agent string, and then xors\n // together each sequence of 8 bytes. This produces a final\n // sequence of 8 bytes which it returns as hex.\n var UA = function UA() {\n var ua = userAgent,\n i,\n ch,\n buffer = [],\n ret = 0;\n function xor(result, byte_array) {\n var j,\n tmp = 0;\n for (j = 0; j < byte_array.length; j++) {\n tmp |= buffer[j] << j * 8;\n }\n return result ^ tmp;\n }\n for (i = 0; i < ua.length; i++) {\n ch = ua.charCodeAt(i);\n buffer.unshift(ch & 0xFF);\n if (buffer.length >= 4) {\n ret = xor(ret, buffer);\n buffer = [];\n }\n }\n if (buffer.length > 0) {\n ret = xor(ret, buffer);\n }\n return ret.toString(16);\n };\n return function () {\n var se = (screen.height * screen.width).toString(16);\n return T() + '-' + R() + '-' + UA() + '-' + se + '-' + T();\n };\n}();\n\n// _.isBlockedUA()\n// This is to block various web spiders from executing our JS and\n// sending false tracking data\nvar BLOCKED_UA_STRS = ['baiduspider', 'bingbot', 'bingpreview', 'facebookexternal', 'pinterest', 'screaming frog', 'yahoo! slurp', 'yandexbot',\n// a whole bunch of goog-specific crawlers\n// https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers\n'adsbot-google', 'apis-google', 'duplexweb-google', 'feedfetcher-google', 'google favicon', 'google web preview', 'google-read-aloud', 'googlebot', 'googleweblight', 'mediapartners-google', 'storebot-google'];\n_.isBlockedUA = function (ua) {\n var i;\n ua = ua.toLowerCase();\n for (i = 0; i < BLOCKED_UA_STRS.length; i++) {\n if (ua.indexOf(BLOCKED_UA_STRS[i]) !== -1) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * @param {Object=} formdata\n * @param {string=} arg_separator\n */\n_.HTTPBuildQuery = function (formdata, arg_separator) {\n var use_val,\n use_key,\n tmp_arr = [];\n if (_.isUndefined(arg_separator)) {\n arg_separator = '&';\n }\n _.each(formdata, function (val, key) {\n use_val = encodeURIComponent(val.toString());\n use_key = encodeURIComponent(key);\n tmp_arr[tmp_arr.length] = use_key + '=' + use_val;\n });\n return tmp_arr.join(arg_separator);\n};\n_.getQueryParam = function (url, param) {\n // Expects a raw URL\n\n param = param.replace(/[[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n var regexS = '[\\\\?&]' + param + '=([^&#]*)',\n regex = new RegExp(regexS),\n results = regex.exec(url);\n if (results === null || results && typeof results[1] !== 'string' && results[1].length) {\n return '';\n } else {\n var result = results[1];\n try {\n result = decodeURIComponent(result);\n } catch (err) {\n console.error('Skipping decoding for malformed query param: ' + result);\n }\n return result.replace(/\\+/g, ' ');\n }\n};\n\n// _.cookie\n// Methods partially borrowed from quirksmode.org/js/cookies.html\n_.cookie = {\n get: function get(name) {\n var nameEQ = name + '=';\n var ca = document$1.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1, c.length);\n }\n if (c.indexOf(nameEQ) === 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length));\n }\n }\n return null;\n },\n parse: function parse(name) {\n var cookie;\n try {\n cookie = _.JSONDecode(_.cookie.get(name)) || {};\n } catch (err) {\n // noop\n }\n return cookie;\n },\n set_seconds: function set_seconds(name, value, seconds, is_cross_subdomain, is_secure, is_cross_site, domain_override) {\n var cdomain = '',\n expires = '',\n secure = '';\n if (domain_override) {\n cdomain = '; domain=' + domain_override;\n } else if (is_cross_subdomain) {\n var domain = extract_domain(document$1.location.hostname);\n cdomain = domain ? '; domain=.' + domain : '';\n }\n if (seconds) {\n var date = new Date();\n date.setTime(date.getTime() + seconds * 1000);\n expires = '; expires=' + date.toGMTString();\n }\n if (is_cross_site) {\n is_secure = true;\n secure = '; SameSite=None';\n }\n if (is_secure) {\n secure += '; secure';\n }\n document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n },\n set: function set(name, value, days, is_cross_subdomain, is_secure, is_cross_site, domain_override) {\n var cdomain = '',\n expires = '',\n secure = '';\n if (domain_override) {\n cdomain = '; domain=' + domain_override;\n } else if (is_cross_subdomain) {\n var domain = extract_domain(document$1.location.hostname);\n cdomain = domain ? '; domain=.' + domain : '';\n }\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toGMTString();\n }\n if (is_cross_site) {\n is_secure = true;\n secure = '; SameSite=None';\n }\n if (is_secure) {\n secure += '; secure';\n }\n var new_cookie_val = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n document$1.cookie = new_cookie_val;\n return new_cookie_val;\n },\n remove: function remove(name, is_cross_subdomain, domain_override) {\n _.cookie.set(name, '', -1, is_cross_subdomain, false, false, domain_override);\n }\n};\nvar _localStorageSupported = null;\nvar localStorageSupported = function localStorageSupported(storage, forceCheck) {\n if (_localStorageSupported !== null && !forceCheck) {\n return _localStorageSupported;\n }\n var supported = true;\n try {\n storage = storage || window.localStorage;\n var key = '__mplss_' + cheap_guid(8),\n val = 'xyz';\n storage.setItem(key, val);\n if (storage.getItem(key) !== val) {\n supported = false;\n }\n storage.removeItem(key);\n } catch (err) {\n supported = false;\n }\n _localStorageSupported = supported;\n return supported;\n};\n\n// _.localStorage\n_.localStorage = {\n is_supported: function is_supported(force_check) {\n var supported = localStorageSupported(null, force_check);\n if (!supported) {\n console.error('localStorage unsupported; falling back to cookie store');\n }\n return supported;\n },\n error: function error(msg) {\n console.error('localStorage error: ' + msg);\n },\n get: function get(name) {\n try {\n return window.localStorage.getItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n return null;\n },\n parse: function parse(name) {\n try {\n return _.JSONDecode(_.localStorage.get(name)) || {};\n } catch (err) {\n // noop\n }\n return null;\n },\n set: function set(name, value) {\n try {\n window.localStorage.setItem(name, value);\n } catch (err) {\n _.localStorage.error(err);\n }\n },\n remove: function remove(name) {\n try {\n window.localStorage.removeItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n }\n};\n_.register_event = function () {\n // written by Dean Edwards, 2005\n // with input from Tino Zijdel - crisp@xs4all.nl\n // with input from Carl Sverre - mail@carlsverre.com\n // with input from Mixpanel\n // http://dean.edwards.name/weblog/2005/10/add-event/\n // https://gist.github.com/1930440\n\n /**\n * @param {Object} element\n * @param {string} type\n * @param {function(...*)} handler\n * @param {boolean=} oldSchool\n * @param {boolean=} useCapture\n */\n var register_event = function register_event(element, type, handler, oldSchool, useCapture) {\n if (!element) {\n console.error('No valid element provided to register_event');\n return;\n }\n if (element.addEventListener && !oldSchool) {\n element.addEventListener(type, handler, !!useCapture);\n } else {\n var ontype = 'on' + type;\n var old_handler = element[ontype]; // can be undefined\n element[ontype] = makeHandler(element, handler, old_handler);\n }\n };\n function makeHandler(element, new_handler, old_handlers) {\n var handler = function handler(event) {\n event = event || fixEvent(window.event);\n\n // this basically happens in firefox whenever another script\n // overwrites the onload callback and doesn't pass the event\n // object to previously defined callbacks. All the browsers\n // that don't define window.event implement addEventListener\n // so the dom_loaded handler will still be fired as usual.\n if (!event) {\n return undefined;\n }\n var ret = true;\n var old_result, new_result;\n if (_.isFunction(old_handlers)) {\n old_result = old_handlers(event);\n }\n new_result = new_handler.call(element, event);\n if (false === old_result || false === new_result) {\n ret = false;\n }\n return ret;\n };\n return handler;\n }\n function fixEvent(event) {\n if (event) {\n event.preventDefault = fixEvent.preventDefault;\n event.stopPropagation = fixEvent.stopPropagation;\n }\n return event;\n }\n fixEvent.preventDefault = function () {\n this.returnValue = false;\n };\n fixEvent.stopPropagation = function () {\n this.cancelBubble = true;\n };\n return register_event;\n}();\nvar TOKEN_MATCH_REGEX = new RegExp('^(\\\\w*)\\\\[(\\\\w+)([=~\\\\|\\\\^\\\\$\\\\*]?)=?\"?([^\\\\]\"]*)\"?\\\\]$');\n_.dom_query = function () {\n /* document.getElementsBySelector(selector)\n - returns an array of element objects from the current document\n matching the CSS selector. Selectors can contain element names,\n class names and ids and can be nested. For example:\n elements = document.getElementsBySelector('div#main p a.external')\n Will return an array of all 'a' elements with 'external' in their\n class attribute that are contained inside 'p' elements that are\n contained inside the 'div' element which has id=\"main\"\n New in version 0.4: Support for CSS2 and CSS3 attribute selectors:\n See http://www.w3.org/TR/css3-selectors/#attribute-selectors\n Version 0.4 - Simon Willison, March 25th 2003\n -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows\n -- Opera 7 fails\n Version 0.5 - Carl Sverre, Jan 7th 2013\n -- Now uses jQuery-esque `hasClass` for testing class name\n equality. This fixes a bug related to '-' characters being\n considered not part of a 'word' in regex.\n */\n\n function getAllChildren(e) {\n // Returns all children of element. Workaround required for IE5/Windows. Ugh.\n return e.all ? e.all : e.getElementsByTagName('*');\n }\n var bad_whitespace = /[\\t\\r\\n]/g;\n function hasClass(elem, selector) {\n var className = ' ' + selector + ' ';\n return (' ' + elem.className + ' ').replace(bad_whitespace, ' ').indexOf(className) >= 0;\n }\n function getElementsBySelector(selector) {\n // Attempt to fail gracefully in lesser browsers\n if (!document$1.getElementsByTagName) {\n return [];\n }\n // Split selector in to tokens\n var tokens = selector.split(' ');\n var token, bits, tagName, found, foundCount, i, j, k, elements, currentContextIndex;\n var currentContext = [document$1];\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i].replace(/^\\s+/, '').replace(/\\s+$/, '');\n if (token.indexOf('#') > -1) {\n // Token is an ID selector\n bits = token.split('#');\n tagName = bits[0];\n var id = bits[1];\n var element = document$1.getElementById(id);\n if (!element || tagName && element.nodeName.toLowerCase() != tagName) {\n // element not found or tag with that ID not found, return false\n return [];\n }\n // Set currentContext to contain just this element\n currentContext = [element];\n continue; // Skip to next token\n }\n\n if (token.indexOf('.') > -1) {\n // Token contains a class selector\n bits = token.split('.');\n tagName = bits[0];\n var className = bits[1];\n if (!tagName) {\n tagName = '*';\n }\n // Get elements matching tag, filter them for class selector\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (found[j].className && _.isString(found[j].className) &&\n // some SVG elements have classNames which are not strings\n hasClass(found[j], className)) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n continue; // Skip to next token\n }\n // Code to deal with attribute selectors\n var token_match = token.match(TOKEN_MATCH_REGEX);\n if (token_match) {\n tagName = token_match[1];\n var attrName = token_match[2];\n var attrOperator = token_match[3];\n var attrValue = token_match[4];\n if (!tagName) {\n tagName = '*';\n }\n // Grab all of the tagName elements within current context\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n var checkFunction; // This function will be used to filter the elements\n switch (attrOperator) {\n case '=':\n // Equality\n checkFunction = function checkFunction(e) {\n return e.getAttribute(attrName) == attrValue;\n };\n break;\n case '~':\n // Match one of space seperated words\n checkFunction = function checkFunction(e) {\n return e.getAttribute(attrName).match(new RegExp('\\\\b' + attrValue + '\\\\b'));\n };\n break;\n case '|':\n // Match start with value followed by optional hyphen\n checkFunction = function checkFunction(e) {\n return e.getAttribute(attrName).match(new RegExp('^' + attrValue + '-?'));\n };\n break;\n case '^':\n // Match starts with value\n checkFunction = function checkFunction(e) {\n return e.getAttribute(attrName).indexOf(attrValue) === 0;\n };\n break;\n case '$':\n // Match ends with value - fails with \"Warning\" in Opera 7\n checkFunction = function checkFunction(e) {\n return e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length;\n };\n break;\n case '*':\n // Match ends with value\n checkFunction = function checkFunction(e) {\n return e.getAttribute(attrName).indexOf(attrValue) > -1;\n };\n break;\n default:\n // Just test for existence of attribute\n checkFunction = function checkFunction(e) {\n return e.getAttribute(attrName);\n };\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (checkFunction(found[j])) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);\n continue; // Skip to next token\n }\n // If we get here, token is JUST an element (not a class or ID selector)\n tagName = token;\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n elements = currentContext[j].getElementsByTagName(tagName);\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = found;\n }\n return currentContext;\n }\n return function (query) {\n if (_.isElement(query)) {\n return [query];\n } else if (_.isObject(query) && !_.isUndefined(query.length)) {\n return query;\n } else {\n return getElementsBySelector.call(this, query);\n }\n };\n}();\n_.info = {\n campaignParams: function campaignParams() {\n var campaign_keywords = 'utm_source utm_medium utm_campaign utm_content utm_term'.split(' '),\n kw = '',\n params = {};\n _.each(campaign_keywords, function (kwkey) {\n kw = _.getQueryParam(document$1.URL, kwkey);\n if (kw.length) {\n params[kwkey] = kw;\n }\n });\n return params;\n },\n searchEngine: function searchEngine(referrer) {\n if (referrer.search('https?://(.*)google.([^/?]*)') === 0) {\n return 'google';\n } else if (referrer.search('https?://(.*)bing.com') === 0) {\n return 'bing';\n } else if (referrer.search('https?://(.*)yahoo.com') === 0) {\n return 'yahoo';\n } else if (referrer.search('https?://(.*)duckduckgo.com') === 0) {\n return 'duckduckgo';\n } else {\n return null;\n }\n },\n searchInfo: function searchInfo(referrer) {\n var search = _.info.searchEngine(referrer),\n param = search != 'yahoo' ? 'q' : 'p',\n ret = {};\n if (search !== null) {\n ret['$search_engine'] = search;\n var keyword = _.getQueryParam(referrer, param);\n if (keyword.length) {\n ret['mp_keyword'] = keyword;\n }\n }\n return ret;\n },\n /**\n * This function detects which browser is running this script.\n * The order of the checks are important since many user agents\n * include key words used in later checks.\n */\n browser: function browser(user_agent, vendor, opera) {\n vendor = vendor || ''; // vendor is undefined for at least IE9\n if (opera || _.includes(user_agent, ' OPR/')) {\n if (_.includes(user_agent, 'Mini')) {\n return 'Opera Mini';\n }\n return 'Opera';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (_.includes(user_agent, 'IEMobile') || _.includes(user_agent, 'WPDesktop')) {\n return 'Internet Explorer Mobile';\n } else if (_.includes(user_agent, 'SamsungBrowser/')) {\n // https://developer.samsung.com/internet/user-agent-string-format\n return 'Samsung Internet';\n } else if (_.includes(user_agent, 'Edge') || _.includes(user_agent, 'Edg/')) {\n return 'Microsoft Edge';\n } else if (_.includes(user_agent, 'FBIOS')) {\n return 'Facebook Mobile';\n } else if (_.includes(user_agent, 'Chrome')) {\n return 'Chrome';\n } else if (_.includes(user_agent, 'CriOS')) {\n return 'Chrome iOS';\n } else if (_.includes(user_agent, 'UCWEB') || _.includes(user_agent, 'UCBrowser')) {\n return 'UC Browser';\n } else if (_.includes(user_agent, 'FxiOS')) {\n return 'Firefox iOS';\n } else if (_.includes(vendor, 'Apple')) {\n if (_.includes(user_agent, 'Mobile')) {\n return 'Mobile Safari';\n }\n return 'Safari';\n } else if (_.includes(user_agent, 'Android')) {\n return 'Android Mobile';\n } else if (_.includes(user_agent, 'Konqueror')) {\n return 'Konqueror';\n } else if (_.includes(user_agent, 'Firefox')) {\n return 'Firefox';\n } else if (_.includes(user_agent, 'MSIE') || _.includes(user_agent, 'Trident/')) {\n return 'Internet Explorer';\n } else if (_.includes(user_agent, 'Gecko')) {\n return 'Mozilla';\n } else {\n return '';\n }\n },\n /**\n * This function detects which browser version is running this script,\n * parsing major and minor version (e.g., 42.1). User agent strings from:\n * http://www.useragentstring.com/pages/useragentstring.php\n */\n browserVersion: function browserVersion(userAgent, vendor, opera) {\n var browser = _.info.browser(userAgent, vendor, opera);\n var versionRegexs = {\n 'Internet Explorer Mobile': /rv:(\\d+(\\.\\d+)?)/,\n 'Microsoft Edge': /Edge?\\/(\\d+(\\.\\d+)?)/,\n 'Chrome': /Chrome\\/(\\d+(\\.\\d+)?)/,\n 'Chrome iOS': /CriOS\\/(\\d+(\\.\\d+)?)/,\n 'UC Browser': /(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)/,\n 'Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Mobile Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Opera': /(Opera|OPR)\\/(\\d+(\\.\\d+)?)/,\n 'Firefox': /Firefox\\/(\\d+(\\.\\d+)?)/,\n 'Firefox iOS': /FxiOS\\/(\\d+(\\.\\d+)?)/,\n 'Konqueror': /Konqueror:(\\d+(\\.\\d+)?)/,\n 'BlackBerry': /BlackBerry (\\d+(\\.\\d+)?)/,\n 'Android Mobile': /android\\s(\\d+(\\.\\d+)?)/,\n 'Samsung Internet': /SamsungBrowser\\/(\\d+(\\.\\d+)?)/,\n 'Internet Explorer': /(rv:|MSIE )(\\d+(\\.\\d+)?)/,\n 'Mozilla': /rv:(\\d+(\\.\\d+)?)/\n };\n var regex = versionRegexs[browser];\n if (regex === undefined) {\n return null;\n }\n var matches = userAgent.match(regex);\n if (!matches) {\n return null;\n }\n return parseFloat(matches[matches.length - 2]);\n },\n os: function os() {\n var a = userAgent;\n if (/Windows/i.test(a)) {\n if (/Phone/.test(a) || /WPDesktop/.test(a)) {\n return 'Windows Phone';\n }\n return 'Windows';\n } else if (/(iPhone|iPad|iPod)/.test(a)) {\n return 'iOS';\n } else if (/Android/.test(a)) {\n return 'Android';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(a)) {\n return 'BlackBerry';\n } else if (/Mac/i.test(a)) {\n return 'Mac OS X';\n } else if (/Linux/.test(a)) {\n return 'Linux';\n } else if (/CrOS/.test(a)) {\n return 'Chrome OS';\n } else {\n return '';\n }\n },\n device: function device(user_agent) {\n if (/Windows Phone/i.test(user_agent) || /WPDesktop/.test(user_agent)) {\n return 'Windows Phone';\n } else if (/iPad/.test(user_agent)) {\n return 'iPad';\n } else if (/iPod/.test(user_agent)) {\n return 'iPod Touch';\n } else if (/iPhone/.test(user_agent)) {\n return 'iPhone';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (/Android/.test(user_agent)) {\n return 'Android';\n } else {\n return '';\n }\n },\n referringDomain: function referringDomain(referrer) {\n var split = referrer.split('/');\n if (split.length >= 3) {\n return split[2];\n }\n return '';\n },\n properties: function properties() {\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator$1.vendor, windowOpera),\n '$referrer': document$1.referrer,\n '$referring_domain': _.info.referringDomain(document$1.referrer),\n '$device': _.info.device(userAgent)\n }), {\n '$current_url': window$1.location.href,\n '$browser_version': _.info.browserVersion(userAgent, navigator$1.vendor, windowOpera),\n '$screen_height': screen.height,\n '$screen_width': screen.width,\n 'mp_lib': 'web',\n '$lib_version': Config.LIB_VERSION,\n '$insert_id': cheap_guid(),\n 'time': _.timestamp() / 1000 // epoch time in seconds\n });\n },\n\n people_properties: function people_properties() {\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator$1.vendor, windowOpera)\n }), {\n '$browser_version': _.info.browserVersion(userAgent, navigator$1.vendor, windowOpera)\n });\n },\n pageviewInfo: function pageviewInfo(page) {\n return _.strip_empty_properties({\n 'mp_page': page,\n 'mp_referrer': document$1.referrer,\n 'mp_browser': _.info.browser(userAgent, navigator$1.vendor, windowOpera),\n 'mp_platform': _.info.os()\n });\n }\n};\nvar cheap_guid = function cheap_guid(maxlen) {\n var guid = Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10);\n return maxlen ? guid.substring(0, maxlen) : guid;\n};\n\n// naive way to extract domain name (example.com) from full hostname (my.sub.example.com)\nvar SIMPLE_DOMAIN_MATCH_REGEX = /[a-z0-9][a-z0-9-]*\\.[a-z]+$/i;\n// this next one attempts to account for some ccSLDs, e.g. extracting oxford.ac.uk from www.oxford.ac.uk\nvar DOMAIN_MATCH_REGEX = /[a-z0-9][a-z0-9-]+\\.[a-z.]{2,6}$/i;\n/**\n * Attempts to extract main domain name from full hostname, using a few blunt heuristics. For\n * common TLDs like .com/.org that always have a simple SLD.TLD structure (example.com), we\n * simply extract the last two .-separated parts of the hostname (SIMPLE_DOMAIN_MATCH_REGEX).\n * For others, we attempt to account for short ccSLD+TLD combos (.ac.uk) with the legacy\n * DOMAIN_MATCH_REGEX (kept to maintain backwards compatibility with existing Mixpanel\n * integrations). The only _reliable_ way to extract domain from hostname is with an up-to-date\n * list like at https://publicsuffix.org/ so for cases that this helper fails at, the SDK\n * offers the 'cookie_domain' config option to set it explicitly.\n * @example\n * extract_domain('my.sub.example.com')\n * // 'example.com'\n */\nvar extract_domain = function extract_domain(hostname) {\n var domain_regex = DOMAIN_MATCH_REGEX;\n var parts = hostname.split('.');\n var tld = parts[parts.length - 1];\n if (tld.length > 4 || tld === 'com' || tld === 'org') {\n domain_regex = SIMPLE_DOMAIN_MATCH_REGEX;\n }\n var matches = hostname.match(domain_regex);\n return matches ? matches[0] : '';\n};\nvar JSONStringify = null;\nvar JSONParse = null;\nif (typeof JSON !== 'undefined') {\n JSONStringify = JSON.stringify;\n JSONParse = JSON.parse;\n}\nJSONStringify = JSONStringify || _.JSONEncode;\nJSONParse = JSONParse || _.JSONDecode;\n\n// EXPORTS (for closure compiler)\n_['toArray'] = _.toArray;\n_['isObject'] = _.isObject;\n_['JSONEncode'] = _.JSONEncode;\n_['JSONDecode'] = _.JSONDecode;\n_['isBlockedUA'] = _.isBlockedUA;\n_['isEmptyObject'] = _.isEmptyObject;\n_['info'] = _.info;\n_['info']['device'] = _.info.device;\n_['info']['browser'] = _.info.browser;\n_['info']['browserVersion'] = _.info.browserVersion;\n_['info']['properties'] = _.info.properties;\n\n/**\n * DomTracker Object\n * @constructor\n */\nvar DomTracker = function DomTracker() {};\n\n// interface\nDomTracker.prototype.create_properties = function () {};\nDomTracker.prototype.event_handler = function () {};\nDomTracker.prototype.after_track_handler = function () {};\nDomTracker.prototype.init = function (mixpanel_instance) {\n this.mp = mixpanel_instance;\n return this;\n};\n\n/**\n * @param {Object|string} query\n * @param {string} event_name\n * @param {Object=} properties\n * @param {function=} user_callback\n */\nDomTracker.prototype.track = function (query, event_name, properties, user_callback) {\n var that = this;\n var elements = _.dom_query(query);\n if (elements.length === 0) {\n console.error('The DOM query (' + query + ') returned 0 elements');\n return;\n }\n _.each(elements, function (element) {\n _.register_event(element, this.override_event, function (e) {\n var options = {};\n var props = that.create_properties(properties, this);\n var timeout = that.mp.get_config('track_links_timeout');\n that.event_handler(e, this, options);\n\n // in case the mixpanel servers don't get back to us in time\n window.setTimeout(that.track_callback(user_callback, props, options, true), timeout);\n\n // fire the tracking event\n that.mp.track(event_name, props, that.track_callback(user_callback, props, options));\n });\n }, this);\n return true;\n};\n\n/**\n * @param {function} user_callback\n * @param {Object} props\n * @param {boolean=} timeout_occured\n */\nDomTracker.prototype.track_callback = function (user_callback, props, options, timeout_occured) {\n timeout_occured = timeout_occured || false;\n var that = this;\n return function () {\n // options is referenced from both callbacks, so we can have\n // a 'lock' of sorts to ensure only one fires\n if (options.callback_fired) {\n return;\n }\n options.callback_fired = true;\n if (user_callback && user_callback(timeout_occured, props) === false) {\n // user can prevent the default functionality by\n // returning false from their callback\n return;\n }\n that.after_track_handler(props, options, timeout_occured);\n };\n};\nDomTracker.prototype.create_properties = function (properties, element) {\n var props;\n if (typeof properties === 'function') {\n props = properties(element);\n } else {\n props = _.extend({}, properties);\n }\n return props;\n};\n\n/**\n * LinkTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar LinkTracker = function LinkTracker() {\n this.override_event = 'click';\n};\n_.inherit(LinkTracker, DomTracker);\nLinkTracker.prototype.create_properties = function (properties, element) {\n var props = LinkTracker.superclass.create_properties.apply(this, arguments);\n if (element.href) {\n props['url'] = element.href;\n }\n return props;\n};\nLinkTracker.prototype.event_handler = function (evt, element, options) {\n options.new_tab = evt.which === 2 || evt.metaKey || evt.ctrlKey || element.target === '_blank';\n options.href = element.href;\n if (!options.new_tab) {\n evt.preventDefault();\n }\n};\nLinkTracker.prototype.after_track_handler = function (props, options) {\n if (options.new_tab) {\n return;\n }\n setTimeout(function () {\n window.location = options.href;\n }, 0);\n};\n\n/**\n * FormTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar FormTracker = function FormTracker() {\n this.override_event = 'submit';\n};\n_.inherit(FormTracker, DomTracker);\nFormTracker.prototype.event_handler = function (evt, element, options) {\n options.element = element;\n evt.preventDefault();\n};\nFormTracker.prototype.after_track_handler = function (props, options) {\n setTimeout(function () {\n options.element.submit();\n }, 0);\n};\n\n// eslint-disable-line camelcase\n\nvar logger$2 = console_with_prefix('lock');\n\n/**\n * SharedLock: a mutex built on HTML5 localStorage, to ensure that only one browser\n * window/tab at a time will be able to access shared resources.\n *\n * Based on the Alur and Taubenfeld fast lock\n * (http://www.cs.rochester.edu/research/synchronization/pseudocode/fastlock.html)\n * with an added timeout to ensure there will be eventual progress in the event\n * that a window is closed in the middle of the callback.\n *\n * Implementation based on the original version by David Wolever (https://github.com/wolever)\n * at https://gist.github.com/wolever/5fd7573d1ef6166e8f8c4af286a69432.\n *\n * @example\n * const myLock = new SharedLock('some-key');\n * myLock.withLock(function() {\n * console.log('I hold the mutex!');\n * });\n *\n * @constructor\n */\nvar SharedLock = function SharedLock(key, options) {\n options = options || {};\n this.storageKey = key;\n this.storage = options.storage || window.localStorage;\n this.pollIntervalMS = options.pollIntervalMS || 100;\n this.timeoutMS = options.timeoutMS || 2000;\n};\n\n// pass in a specific pid to test contention scenarios; otherwise\n// it is chosen randomly for each acquisition attempt\nSharedLock.prototype.withLock = function (lockedCB, errorCB, pid) {\n if (!pid && typeof errorCB !== 'function') {\n pid = errorCB;\n errorCB = null;\n }\n var i = pid || new Date().getTime() + '|' + Math.random();\n var startTime = new Date().getTime();\n var key = this.storageKey;\n var pollIntervalMS = this.pollIntervalMS;\n var timeoutMS = this.timeoutMS;\n var storage = this.storage;\n var keyX = key + ':X';\n var keyY = key + ':Y';\n var keyZ = key + ':Z';\n var reportError = function reportError(err) {\n errorCB && errorCB(err);\n };\n var delay = function delay(cb) {\n if (new Date().getTime() - startTime > timeoutMS) {\n logger$2.error('Timeout waiting for mutex on ' + key + '; clearing lock. [' + i + ']');\n storage.removeItem(keyZ);\n storage.removeItem(keyY);\n loop();\n return;\n }\n setTimeout(function () {\n try {\n cb();\n } catch (err) {\n reportError(err);\n }\n }, pollIntervalMS * (Math.random() + 0.1));\n };\n var waitFor = function waitFor(predicate, cb) {\n if (predicate()) {\n cb();\n } else {\n delay(function () {\n waitFor(predicate, cb);\n });\n }\n };\n var getSetY = function getSetY() {\n var valY = storage.getItem(keyY);\n if (valY && valY !== i) {\n // if Y == i then this process already has the lock (useful for test cases)\n return false;\n } else {\n storage.setItem(keyY, i);\n if (storage.getItem(keyY) === i) {\n return true;\n } else {\n if (!localStorageSupported(storage, true)) {\n throw new Error('localStorage support dropped while acquiring lock');\n }\n return false;\n }\n }\n };\n var loop = function loop() {\n storage.setItem(keyX, i);\n waitFor(getSetY, function () {\n if (storage.getItem(keyX) === i) {\n criticalSection();\n return;\n }\n delay(function () {\n if (storage.getItem(keyY) !== i) {\n loop();\n return;\n }\n waitFor(function () {\n return !storage.getItem(keyZ);\n }, criticalSection);\n });\n });\n };\n var criticalSection = function criticalSection() {\n storage.setItem(keyZ, '1');\n try {\n lockedCB();\n } finally {\n storage.removeItem(keyZ);\n if (storage.getItem(keyY) === i) {\n storage.removeItem(keyY);\n }\n if (storage.getItem(keyX) === i) {\n storage.removeItem(keyX);\n }\n }\n };\n try {\n if (localStorageSupported(storage, true)) {\n loop();\n } else {\n throw new Error('localStorage support check failed');\n }\n } catch (err) {\n reportError(err);\n }\n};\n\n// eslint-disable-line camelcase\n\nvar logger$1 = console_with_prefix('batch');\n\n/**\n * RequestQueue: queue for batching API requests with localStorage backup for retries.\n * Maintains an in-memory queue which represents the source of truth for the current\n * page, but also writes all items out to a copy in the browser's localStorage, which\n * can be read on subsequent pageloads and retried. For batchability, all the request\n * items in the queue should be of the same type (events, people updates, group updates)\n * so they can be sent in a single request to the same API endpoint.\n *\n * LocalStorage keying and locking: In order for reloads and subsequent pageloads of\n * the same site to access the same persisted data, they must share the same localStorage\n * key (for instance based on project token and queue type). Therefore access to the\n * localStorage entry is guarded by an asynchronous mutex (SharedLock) to prevent\n * simultaneously open windows/tabs from overwriting each other's data (which would lead\n * to data loss in some situations).\n * @constructor\n */\nvar RequestQueue = function RequestQueue(storageKey, options) {\n options = options || {};\n this.storageKey = storageKey;\n this.storage = options.storage || window.localStorage;\n this.lock = new SharedLock(storageKey, {\n storage: this.storage\n });\n this.pid = options.pid || null; // pass pid to test out storage lock contention scenarios\n\n this.memQueue = [];\n};\n\n/**\n * Add one item to queues (memory and localStorage). The queued entry includes\n * the given item along with an auto-generated ID and a \"flush-after\" timestamp.\n * It is expected that the item will be sent over the network and dequeued\n * before the flush-after time; if this doesn't happen it is considered orphaned\n * (e.g., the original tab where it was enqueued got closed before it could be\n * sent) and the item can be sent by any tab that finds it in localStorage.\n *\n * The final callback param is called with a param indicating success or\n * failure of the enqueue operation; it is asynchronous because the localStorage\n * lock is asynchronous.\n */\nRequestQueue.prototype.enqueue = function (item, flushInterval, cb) {\n var queueEntry = {\n 'id': cheap_guid(),\n 'flushAfter': new Date().getTime() + flushInterval * 2,\n 'payload': item\n };\n this.lock.withLock(_.bind(function lockAcquired() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue.push(queueEntry);\n succeeded = this.saveToStorage(storedQueue);\n if (succeeded) {\n // only add to in-memory queue when storage succeeds\n this.memQueue.push(queueEntry);\n }\n } catch (err) {\n logger$1.error('Error enqueueing item', item);\n succeeded = false;\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), function lockFailure(err) {\n logger$1.error('Error acquiring storage lock', err);\n if (cb) {\n cb(false);\n }\n }, this.pid);\n};\n\n/**\n * Read out the given number of queue entries. If this.memQueue\n * has fewer than batchSize items, then look for \"orphaned\" items\n * in the persisted queue (items where the 'flushAfter' time has\n * already passed).\n */\nRequestQueue.prototype.fillBatch = function (batchSize) {\n var batch = this.memQueue.slice(0, batchSize);\n if (batch.length < batchSize) {\n // don't need lock just to read events; localStorage is thread-safe\n // and the worst that could happen is a duplicate send of some\n // orphaned events, which will be deduplicated on the server side\n var storedQueue = this.readFromStorage();\n if (storedQueue.length) {\n // item IDs already in batch; don't duplicate out of storage\n var idsInBatch = {}; // poor man's Set\n _.each(batch, function (item) {\n idsInBatch[item['id']] = true;\n });\n for (var i = 0; i < storedQueue.length; i++) {\n var item = storedQueue[i];\n if (new Date().getTime() > item['flushAfter'] && !idsInBatch[item['id']]) {\n item.orphaned = true;\n batch.push(item);\n if (batch.length >= batchSize) {\n break;\n }\n }\n }\n }\n }\n return batch;\n};\n\n/**\n * Remove items with matching 'id' from array (immutably)\n * also remove any item without a valid id (e.g., malformed\n * storage entries).\n */\nvar filterOutIDsAndInvalid = function filterOutIDsAndInvalid(items, idSet) {\n var filteredItems = [];\n _.each(items, function (item) {\n if (item['id'] && !idSet[item['id']]) {\n filteredItems.push(item);\n }\n });\n return filteredItems;\n};\n\n/**\n * Remove items with matching IDs from both in-memory queue\n * and persisted queue\n */\nRequestQueue.prototype.removeItemsByID = function (ids, cb) {\n var idSet = {}; // poor man's Set\n _.each(ids, function (id) {\n idSet[id] = true;\n });\n this.memQueue = filterOutIDsAndInvalid(this.memQueue, idSet);\n this.lock.withLock(_.bind(function lockAcquired() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue = filterOutIDsAndInvalid(storedQueue, idSet);\n succeeded = this.saveToStorage(storedQueue);\n } catch (err) {\n logger$1.error('Error removing items', ids);\n succeeded = false;\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), function lockFailure(err) {\n logger$1.error('Error acquiring storage lock', err);\n if (cb) {\n cb(false);\n }\n }, this.pid);\n};\n\n// internal helper for RequestQueue.updatePayloads\nvar updatePayloads = function updatePayloads(existingItems, itemsToUpdate) {\n var newItems = [];\n _.each(existingItems, function (item) {\n var id = item['id'];\n if (id in itemsToUpdate) {\n var newPayload = itemsToUpdate[id];\n if (newPayload !== null) {\n item['payload'] = newPayload;\n newItems.push(item);\n }\n } else {\n // no update\n newItems.push(item);\n }\n });\n return newItems;\n};\n\n/**\n * Update payloads of given items in both in-memory queue and\n * persisted queue. Items set to null are removed from queues.\n */\nRequestQueue.prototype.updatePayloads = function (itemsToUpdate, cb) {\n this.memQueue = updatePayloads(this.memQueue, itemsToUpdate);\n this.lock.withLock(_.bind(function lockAcquired() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue = updatePayloads(storedQueue, itemsToUpdate);\n succeeded = this.saveToStorage(storedQueue);\n } catch (err) {\n logger$1.error('Error updating items', itemsToUpdate);\n succeeded = false;\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), function lockFailure(err) {\n logger$1.error('Error acquiring storage lock', err);\n if (cb) {\n cb(false);\n }\n }, this.pid);\n};\n\n/**\n * Read and parse items array from localStorage entry, handling\n * malformed/missing data if necessary.\n */\nRequestQueue.prototype.readFromStorage = function () {\n var storageEntry;\n try {\n storageEntry = this.storage.getItem(this.storageKey);\n if (storageEntry) {\n storageEntry = JSONParse(storageEntry);\n if (!_.isArray(storageEntry)) {\n logger$1.error('Invalid storage entry:', storageEntry);\n storageEntry = null;\n }\n }\n } catch (err) {\n logger$1.error('Error retrieving queue', err);\n storageEntry = null;\n }\n return storageEntry || [];\n};\n\n/**\n * Serialize the given items array to localStorage.\n */\nRequestQueue.prototype.saveToStorage = function (queue) {\n try {\n this.storage.setItem(this.storageKey, JSONStringify(queue));\n return true;\n } catch (err) {\n logger$1.error('Error saving queue', err);\n return false;\n }\n};\n\n/**\n * Clear out queues (memory and localStorage).\n */\nRequestQueue.prototype.clear = function () {\n this.memQueue = [];\n this.storage.removeItem(this.storageKey);\n};\n\n// eslint-disable-line camelcase\n\n// maximum interval between request retries after exponential backoff\nvar MAX_RETRY_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes\n\nvar logger = console_with_prefix('batch');\n\n/**\n * RequestBatcher: manages the queueing, flushing, retry etc of requests of one\n * type (events, people, groups).\n * Uses RequestQueue to manage the backing store.\n * @constructor\n */\nvar RequestBatcher = function RequestBatcher(storageKey, options) {\n this.queue = new RequestQueue(storageKey, {\n storage: options.storage\n });\n this.libConfig = options.libConfig;\n this.sendRequest = options.sendRequestFunc;\n this.beforeSendHook = options.beforeSendHook;\n\n // seed variable batch size + flush interval with configured values\n this.batchSize = this.libConfig['batch_size'];\n this.flushInterval = this.libConfig['batch_flush_interval_ms'];\n this.stopped = !this.libConfig['batch_autostart'];\n};\n\n/**\n * Add one item to queue.\n */\nRequestBatcher.prototype.enqueue = function (item, cb) {\n this.queue.enqueue(item, this.flushInterval, cb);\n};\n\n/**\n * Start flushing batches at the configured time interval. Must call\n * this method upon SDK init in order to send anything over the network.\n */\nRequestBatcher.prototype.start = function () {\n this.stopped = false;\n this.flush();\n};\n\n/**\n * Stop flushing batches. Can be restarted by calling start().\n */\nRequestBatcher.prototype.stop = function () {\n this.stopped = true;\n if (this.timeoutID) {\n clearTimeout(this.timeoutID);\n this.timeoutID = null;\n }\n};\n\n/**\n * Clear out queue.\n */\nRequestBatcher.prototype.clear = function () {\n this.queue.clear();\n};\n\n/**\n * Restore batch size configuration to whatever is set in the main SDK.\n */\nRequestBatcher.prototype.resetBatchSize = function () {\n this.batchSize = this.libConfig['batch_size'];\n};\n\n/**\n * Restore flush interval time configuration to whatever is set in the main SDK.\n */\nRequestBatcher.prototype.resetFlush = function () {\n this.scheduleFlush(this.libConfig['batch_flush_interval_ms']);\n};\n\n/**\n * Schedule the next flush in the given number of milliseconds.\n */\nRequestBatcher.prototype.scheduleFlush = function (flushMS) {\n this.flushInterval = flushMS;\n if (!this.stopped) {\n // don't schedule anymore if batching has been stopped\n this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);\n }\n};\n\n/**\n * Flush one batch to network. Depending on success/failure modes, it will either\n * remove the batch from the queue or leave it in for retry, and schedule the next\n * flush. In cases of most network or API failures, it will back off exponentially\n * when retrying.\n * @param {Object} [options]\n * @param {boolean} [options.sendBeacon] - whether to send batch with\n * navigator.sendBeacon (only useful for sending batches before page unloads, as\n * sendBeacon offers no callbacks or status indications)\n */\nRequestBatcher.prototype.flush = function (options) {\n try {\n if (this.requestInProgress) {\n logger.log('Flush: Request already in progress');\n return;\n }\n options = options || {};\n var timeoutMS = this.libConfig['batch_request_timeout_ms'];\n var startTime = new Date().getTime();\n var currentBatchSize = this.batchSize;\n var batch = this.queue.fillBatch(currentBatchSize);\n var dataForRequest = [];\n var transformedItems = {};\n _.each(batch, function (item) {\n var payload = item['payload'];\n if (this.beforeSendHook && !item.orphaned) {\n payload = this.beforeSendHook(payload);\n }\n if (payload) {\n dataForRequest.push(payload);\n }\n transformedItems[item['id']] = payload;\n }, this);\n if (dataForRequest.length < 1) {\n this.resetFlush();\n return; // nothing to do\n }\n\n this.requestInProgress = true;\n var batchSendCallback = _.bind(function (res) {\n this.requestInProgress = false;\n try {\n // handle API response in a try-catch to make sure we can reset the\n // flush operation if something goes wrong\n\n var removeItemsFromQueue = false;\n if (options.unloading) {\n // update persisted data to include hook transformations\n this.queue.updatePayloads(transformedItems);\n } else if (_.isObject(res) && res.error === 'timeout' && new Date().getTime() - startTime >= timeoutMS) {\n logger.error('Network timeout; retrying');\n this.flush();\n } else if (_.isObject(res) && res.xhr_req && (res.xhr_req['status'] >= 500 || res.xhr_req['status'] === 429 || res.error === 'timeout')) {\n // network or API error, or 429 Too Many Requests, retry\n var retryMS = this.flushInterval * 2;\n var headers = res.xhr_req['responseHeaders'];\n if (headers) {\n var retryAfter = headers['Retry-After'];\n if (retryAfter) {\n retryMS = parseInt(retryAfter, 10) * 1000 || retryMS;\n }\n }\n retryMS = Math.min(MAX_RETRY_INTERVAL_MS, retryMS);\n logger.error('Error; retry in ' + retryMS + ' ms');\n this.scheduleFlush(retryMS);\n } else if (_.isObject(res) && res.xhr_req && res.xhr_req['status'] === 413) {\n // 413 Payload Too Large\n if (batch.length > 1) {\n var halvedBatchSize = Math.max(1, Math.floor(currentBatchSize / 2));\n this.batchSize = Math.min(this.batchSize, halvedBatchSize, batch.length - 1);\n logger.error('413 response; reducing batch size to ' + this.batchSize);\n this.resetFlush();\n } else {\n logger.error('Single-event request too large; dropping', batch);\n this.resetBatchSize();\n removeItemsFromQueue = true;\n }\n } else {\n // successful network request+response; remove each item in batch from queue\n // (even if it was e.g. a 400, in which case retrying won't help)\n removeItemsFromQueue = true;\n }\n if (removeItemsFromQueue) {\n this.queue.removeItemsByID(_.map(batch, function (item) {\n return item['id'];\n }), _.bind(this.flush, this) // handle next batch if the queue isn't empty\n );\n }\n } catch (err) {\n logger.error('Error handling API response', err);\n this.resetFlush();\n }\n }, this);\n var requestOptions = {\n method: 'POST',\n verbose: true,\n ignore_json_errors: true,\n // eslint-disable-line camelcase\n timeout_ms: timeoutMS // eslint-disable-line camelcase\n };\n\n if (options.unloading) {\n requestOptions.transport = 'sendBeacon';\n }\n logger.log('MIXPANEL REQUEST:', dataForRequest);\n this.sendRequest(dataForRequest, requestOptions, batchSendCallback);\n } catch (err) {\n logger.error('Error flushing request queue', err);\n this.resetFlush();\n }\n};\n\n/**\n * A function used to track a Mixpanel event (e.g. MixpanelLib.track)\n * @callback trackFunction\n * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc.\n * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself.\n * @param {Function} [callback] If provided, the callback function will be called after tracking the event.\n */\n\n/** Public **/\n\nvar GDPR_DEFAULT_PERSISTENCE_PREFIX = '__mp_opt_in_out_';\n\n/**\n * Opt the user in to data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action\n * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action\n * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction optIn(token, options) {\n _optInOut(true, token, options);\n}\n\n/**\n * Opt the user out of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-out cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-out cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-out cookie is set as secure or not\n */\nfunction optOut(token, options) {\n _optInOut(false, token, options);\n}\n\n/**\n * Check whether the user has opted in to data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} whether the user has opted in to the given opt type\n */\nfunction hasOptedIn(token, options) {\n return _getStorageValue(token, options) === '1';\n}\n\n/**\n * Check whether the user has opted out of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {boolean} [options.ignoreDnt] - flag to ignore browser DNT settings and always return false\n * @returns {boolean} whether the user has opted out of the given opt type\n */\nfunction hasOptedOut(token, options) {\n if (_hasDoNotTrackFlagOn(options)) {\n console.warn('This browser has \"Do Not Track\" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the \"Do Not Track\" browser setting, initialize the Mixpanel instance with the config \"ignore_dnt: true\"');\n return true;\n }\n var optedOut = _getStorageValue(token, options) === '0';\n if (optedOut) {\n console.warn('You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data.');\n }\n return optedOut;\n}\n\n/**\n * Wrap a MixpanelLib method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelLib(method) {\n return _addOptOutCheck(method, function (name) {\n return this.get_config(name);\n });\n}\n\n/**\n * Wrap a MixpanelPeople method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelPeople(method) {\n return _addOptOutCheck(method, function (name) {\n return this._get_config(name);\n });\n}\n\n/**\n * Wrap a MixpanelGroup method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelGroup(method) {\n return _addOptOutCheck(method, function (name) {\n return this._get_config(name);\n });\n}\n\n/**\n * Clear the user's opt in/out status of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction clearOptInOut(token, options) {\n options = options || {};\n _getStorage(options).remove(_getStorageKey(token, options), !!options.crossSubdomainCookie, options.cookieDomain);\n}\n\n/** Private **/\n\n/**\n * Get storage util\n * @param {Object} [options]\n * @param {string} [options.persistenceType]\n * @returns {object} either _.cookie or _.localstorage\n */\nfunction _getStorage(options) {\n options = options || {};\n return options.persistenceType === 'localStorage' ? _.localStorage : _.cookie;\n}\n\n/**\n * Get the name of the cookie that is used for the given opt type (tracking, cookie, etc.)\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {string} the name of the cookie for the given opt type\n */\nfunction _getStorageKey(token, options) {\n options = options || {};\n return (options.persistencePrefix || GDPR_DEFAULT_PERSISTENCE_PREFIX) + token;\n}\n\n/**\n * Get the value of the cookie that is used for the given opt type (tracking, cookie, etc.)\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {string} the value of the cookie for the given opt type\n */\nfunction _getStorageValue(token, options) {\n return _getStorage(options).get(_getStorageKey(token, options));\n}\n\n/**\n * Check whether the user has set the DNT/doNotTrack setting to true in their browser\n * @param {Object} [options]\n * @param {string} [options.window] - alternate window object to check; used to force various DNT settings in browser tests\n * @param {boolean} [options.ignoreDnt] - flag to ignore browser DNT settings and always return false\n * @returns {boolean} whether the DNT setting is true\n */\nfunction _hasDoNotTrackFlagOn(options) {\n if (options && options.ignoreDnt) {\n return false;\n }\n var win = options && options.window || window$1;\n var nav = win['navigator'] || {};\n var hasDntOn = false;\n _.each([nav['doNotTrack'],\n // standard\n nav['msDoNotTrack'], win['doNotTrack']], function (dntValue) {\n if (_.includes([true, 1, '1', 'yes'], dntValue)) {\n hasDntOn = true;\n }\n });\n return hasDntOn;\n}\n\n/**\n * Set cookie/localstorage for the user indicating that they are opted in or out for the given opt type\n * @param {boolean} optValue - whether to opt the user in or out for the given opt type\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action\n * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action\n * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction _optInOut(optValue, token, options) {\n if (!_.isString(token) || !token.length) {\n console.error('gdpr.' + (optValue ? 'optIn' : 'optOut') + ' called with an invalid token');\n return;\n }\n options = options || {};\n _getStorage(options).set(_getStorageKey(token, options), optValue ? 1 : 0, _.isNumber(options.cookieExpiration) ? options.cookieExpiration : null, !!options.crossSubdomainCookie, !!options.secureCookie, !!options.crossSiteCookie, options.cookieDomain);\n if (options.track && optValue) {\n // only track event if opting in (optValue=true)\n options.track(options.trackEventName || '$opt_in', options.trackProperties, {\n 'send_immediately': true\n });\n }\n}\n\n/**\n * Wrap a method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @param {function} getConfigValue - getter function for the Mixpanel API token and other options to be used with opt-out check\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction _addOptOutCheck(method, getConfigValue) {\n return function () {\n var optedOut = false;\n try {\n var token = getConfigValue.call(this, 'token');\n var ignoreDnt = getConfigValue.call(this, 'ignore_dnt');\n var persistenceType = getConfigValue.call(this, 'opt_out_tracking_persistence_type');\n var persistencePrefix = getConfigValue.call(this, 'opt_out_tracking_cookie_prefix');\n var win = getConfigValue.call(this, 'window'); // used to override window during browser tests\n\n if (token) {\n // if there was an issue getting the token, continue method execution as normal\n optedOut = hasOptedOut(token, {\n ignoreDnt: ignoreDnt,\n persistenceType: persistenceType,\n persistencePrefix: persistencePrefix,\n window: win\n });\n }\n } catch (err) {\n console.error('Unexpected error when checking tracking opt-out status: ' + err);\n }\n if (!optedOut) {\n return method.apply(this, arguments);\n }\n var callback = arguments[arguments.length - 1];\n if (typeof callback === 'function') {\n callback(0);\n }\n return;\n };\n}\n\n/** @const */\nvar SET_ACTION = '$set';\n/** @const */\nvar SET_ONCE_ACTION = '$set_once';\n/** @const */\nvar UNSET_ACTION = '$unset';\n/** @const */\nvar ADD_ACTION = '$add';\n/** @const */\nvar APPEND_ACTION = '$append';\n/** @const */\nvar UNION_ACTION = '$union';\n/** @const */\nvar REMOVE_ACTION = '$remove';\n/** @const */\nvar DELETE_ACTION = '$delete';\n\n// Common internal methods for mixpanel.people and mixpanel.group APIs.\n// These methods shouldn't involve network I/O.\nvar apiActions = {\n set_action: function set_action(prop, to) {\n var data = {};\n var $set = {};\n if (_.isObject(prop)) {\n _.each(prop, function (v, k) {\n if (!this._is_reserved_property(k)) {\n $set[k] = v;\n }\n }, this);\n } else {\n $set[prop] = to;\n }\n data[SET_ACTION] = $set;\n return data;\n },\n unset_action: function unset_action(prop) {\n var data = {};\n var $unset = [];\n if (!_.isArray(prop)) {\n prop = [prop];\n }\n _.each(prop, function (k) {\n if (!this._is_reserved_property(k)) {\n $unset.push(k);\n }\n }, this);\n data[UNSET_ACTION] = $unset;\n return data;\n },\n set_once_action: function set_once_action(prop, to) {\n var data = {};\n var $set_once = {};\n if (_.isObject(prop)) {\n _.each(prop, function (v, k) {\n if (!this._is_reserved_property(k)) {\n $set_once[k] = v;\n }\n }, this);\n } else {\n $set_once[prop] = to;\n }\n data[SET_ONCE_ACTION] = $set_once;\n return data;\n },\n union_action: function union_action(list_name, values) {\n var data = {};\n var $union = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function (v, k) {\n if (!this._is_reserved_property(k)) {\n $union[k] = _.isArray(v) ? v : [v];\n }\n }, this);\n } else {\n $union[list_name] = _.isArray(values) ? values : [values];\n }\n data[UNION_ACTION] = $union;\n return data;\n },\n append_action: function append_action(list_name, value) {\n var data = {};\n var $append = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function (v, k) {\n if (!this._is_reserved_property(k)) {\n $append[k] = v;\n }\n }, this);\n } else {\n $append[list_name] = value;\n }\n data[APPEND_ACTION] = $append;\n return data;\n },\n remove_action: function remove_action(list_name, value) {\n var data = {};\n var $remove = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function (v, k) {\n if (!this._is_reserved_property(k)) {\n $remove[k] = v;\n }\n }, this);\n } else {\n $remove[list_name] = value;\n }\n data[REMOVE_ACTION] = $remove;\n return data;\n },\n delete_action: function delete_action() {\n var data = {};\n data[DELETE_ACTION] = '';\n return data;\n }\n};\n\n/**\n * Mixpanel Group Object\n * @constructor\n */\nvar MixpanelGroup = function MixpanelGroup() {};\n_.extend(MixpanelGroup.prototype, apiActions);\nMixpanelGroup.prototype._init = function (mixpanel_instance, group_key, group_id) {\n this._mixpanel = mixpanel_instance;\n this._group_key = group_key;\n this._group_id = group_id;\n};\n\n/**\n * Set properties on a group.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').set('Location', '405 Howard');\n *\n * // or set multiple properties at once\n * mixpanel.get_group('company', 'mixpanel').set({\n * 'Location': '405 Howard',\n * 'Founded' : 2009,\n * });\n * // properties can be strings, integers, dates, or lists\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.set = addOptOutCheckMixpanelGroup(function (prop, to, callback) {\n var data = this.set_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/**\n * Set properties on a group, only if they do not yet exist.\n * This will not overwrite previous group property values, unlike\n * group.set().\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').set_once('Location', '405 Howard');\n *\n * // or set multiple properties at once\n * mixpanel.get_group('company', 'mixpanel').set_once({\n * 'Location': '405 Howard',\n * 'Founded' : 2009,\n * });\n * // properties can be strings, integers, lists or dates\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.set_once = addOptOutCheckMixpanelGroup(function (prop, to, callback) {\n var data = this.set_once_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/**\n * Unset properties on a group permanently.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').unset('Founded');\n *\n * @param {String} prop The name of the property.\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.unset = addOptOutCheckMixpanelGroup(function (prop, callback) {\n var data = this.unset_action(prop);\n return this._send_request(data, callback);\n});\n\n/**\n * Merge a given list with a list-valued group property, excluding duplicate values.\n *\n * ### Usage:\n *\n * // merge a value to a list, creating it if needed\n * mixpanel.get_group('company', 'mixpanel').union('Location', ['San Francisco', 'London']);\n *\n * @param {String} list_name Name of the property.\n * @param {Array} values Values to merge with the given property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.union = addOptOutCheckMixpanelGroup(function (list_name, values, callback) {\n if (_.isObject(list_name)) {\n callback = values;\n }\n var data = this.union_action(list_name, values);\n return this._send_request(data, callback);\n});\n\n/**\n * Permanently delete a group.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').delete();\n *\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype['delete'] = addOptOutCheckMixpanelGroup(function (callback) {\n // bracket notation above prevents a minification error related to reserved words\n var data = this.delete_action();\n return this._send_request(data, callback);\n});\n\n/**\n * Remove a property from a group. The value will be ignored if doesn't exist.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').remove('Location', 'London');\n *\n * @param {String} list_name Name of the property.\n * @param {Object} value Value to remove from the given group property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.remove = addOptOutCheckMixpanelGroup(function (list_name, value, callback) {\n var data = this.remove_action(list_name, value);\n return this._send_request(data, callback);\n});\nMixpanelGroup.prototype._send_request = function (data, callback) {\n data['$group_key'] = this._group_key;\n data['$group_id'] = this._group_id;\n data['$token'] = this._get_config('token');\n var date_encoded_data = _.encodeDates(data);\n return this._mixpanel._track_or_batch({\n type: 'groups',\n data: date_encoded_data,\n endpoint: this._get_config('api_host') + '/groups/',\n batcher: this._mixpanel.request_batchers.groups\n }, callback);\n};\nMixpanelGroup.prototype._is_reserved_property = function (prop) {\n return prop === '$group_key' || prop === '$group_id';\n};\nMixpanelGroup.prototype._get_config = function (conf) {\n return this._mixpanel.get_config(conf);\n};\nMixpanelGroup.prototype.toString = function () {\n return this._mixpanel.toString() + '.group.' + this._group_key + '.' + this._group_id;\n};\n\n// MixpanelGroup Exports\nMixpanelGroup.prototype['remove'] = MixpanelGroup.prototype.remove;\nMixpanelGroup.prototype['set'] = MixpanelGroup.prototype.set;\nMixpanelGroup.prototype['set_once'] = MixpanelGroup.prototype.set_once;\nMixpanelGroup.prototype['union'] = MixpanelGroup.prototype.union;\nMixpanelGroup.prototype['unset'] = MixpanelGroup.prototype.unset;\nMixpanelGroup.prototype['toString'] = MixpanelGroup.prototype.toString;\n\n/*\n * Constants\n */\n/** @const */\nvar SET_QUEUE_KEY = '__mps';\n/** @const */\nvar SET_ONCE_QUEUE_KEY = '__mpso';\n/** @const */\nvar UNSET_QUEUE_KEY = '__mpus';\n/** @const */\nvar ADD_QUEUE_KEY = '__mpa';\n/** @const */\nvar APPEND_QUEUE_KEY = '__mpap';\n/** @const */\nvar REMOVE_QUEUE_KEY = '__mpr';\n/** @const */\nvar UNION_QUEUE_KEY = '__mpu';\n// This key is deprecated, but we want to check for it to see whether aliasing is allowed.\n/** @const */\nvar PEOPLE_DISTINCT_ID_KEY = '$people_distinct_id';\n/** @const */\nvar ALIAS_ID_KEY = '__alias';\n/** @const */\nvar CAMPAIGN_IDS_KEY = '__cmpns';\n/** @const */\nvar EVENT_TIMERS_KEY = '__timers';\n/** @const */\nvar RESERVED_PROPERTIES = [SET_QUEUE_KEY, SET_ONCE_QUEUE_KEY, UNSET_QUEUE_KEY, ADD_QUEUE_KEY, APPEND_QUEUE_KEY, REMOVE_QUEUE_KEY, UNION_QUEUE_KEY, PEOPLE_DISTINCT_ID_KEY, ALIAS_ID_KEY, CAMPAIGN_IDS_KEY, EVENT_TIMERS_KEY];\n\n/**\n * Mixpanel Persistence Object\n * @constructor\n */\nvar MixpanelPersistence = function MixpanelPersistence(config) {\n this['props'] = {};\n this.campaign_params_saved = false;\n if (config['persistence_name']) {\n this.name = 'mp_' + config['persistence_name'];\n } else {\n this.name = 'mp_' + config['token'] + '_mixpanel';\n }\n var storage_type = config['persistence'];\n if (storage_type !== 'cookie' && storage_type !== 'localStorage') {\n console.critical('Unknown persistence type ' + storage_type + '; falling back to cookie');\n storage_type = config['persistence'] = 'cookie';\n }\n if (storage_type === 'localStorage' && _.localStorage.is_supported()) {\n this.storage = _.localStorage;\n } else {\n this.storage = _.cookie;\n }\n this.load();\n this.update_config(config);\n this.upgrade(config);\n this.save();\n};\nMixpanelPersistence.prototype.properties = function () {\n var p = {};\n // Filter out reserved properties\n _.each(this['props'], function (v, k) {\n if (!_.include(RESERVED_PROPERTIES, k)) {\n p[k] = v;\n }\n });\n return p;\n};\nMixpanelPersistence.prototype.load = function () {\n if (this.disabled) {\n return;\n }\n var entry = this.storage.parse(this.name);\n if (entry) {\n this['props'] = _.extend({}, entry);\n }\n};\nMixpanelPersistence.prototype.upgrade = function (config) {\n var upgrade_from_old_lib = config['upgrade'],\n old_cookie_name,\n old_cookie;\n if (upgrade_from_old_lib) {\n old_cookie_name = 'mp_super_properties';\n // Case where they had a custom cookie name before.\n if (typeof upgrade_from_old_lib === 'string') {\n old_cookie_name = upgrade_from_old_lib;\n }\n old_cookie = this.storage.parse(old_cookie_name);\n\n // remove the cookie\n this.storage.remove(old_cookie_name);\n this.storage.remove(old_cookie_name, true);\n if (old_cookie) {\n this['props'] = _.extend(this['props'], old_cookie['all'], old_cookie['events']);\n }\n }\n if (!config['cookie_name'] && config['name'] !== 'mixpanel') {\n // special case to handle people with cookies of the form\n // mp_TOKEN_INSTANCENAME from the first release of this library\n old_cookie_name = 'mp_' + config['token'] + '_' + config['name'];\n old_cookie = this.storage.parse(old_cookie_name);\n if (old_cookie) {\n this.storage.remove(old_cookie_name);\n this.storage.remove(old_cookie_name, true);\n\n // Save the prop values that were in the cookie from before -\n // this should only happen once as we delete the old one.\n this.register_once(old_cookie);\n }\n }\n if (this.storage === _.localStorage) {\n old_cookie = _.cookie.parse(this.name);\n _.cookie.remove(this.name);\n _.cookie.remove(this.name, true);\n if (old_cookie) {\n this.register_once(old_cookie);\n }\n }\n};\nMixpanelPersistence.prototype.save = function () {\n if (this.disabled) {\n return;\n }\n this._expire_notification_campaigns();\n this.storage.set(this.name, _.JSONEncode(this['props']), this.expire_days, this.cross_subdomain, this.secure, this.cross_site, this.cookie_domain);\n};\nMixpanelPersistence.prototype.remove = function () {\n // remove both domain and subdomain cookies\n this.storage.remove(this.name, false, this.cookie_domain);\n this.storage.remove(this.name, true, this.cookie_domain);\n};\n\n// removes the storage entry and deletes all loaded data\n// forced name for tests\nMixpanelPersistence.prototype.clear = function () {\n this.remove();\n this['props'] = {};\n};\n\n/**\n* @param {Object} props\n* @param {*=} default_value\n* @param {number=} days\n*/\nMixpanelPersistence.prototype.register_once = function (props, default_value, days) {\n if (_.isObject(props)) {\n if (typeof default_value === 'undefined') {\n default_value = 'None';\n }\n this.expire_days = typeof days === 'undefined' ? this.default_expiry : days;\n _.each(props, function (val, prop) {\n if (!this['props'].hasOwnProperty(prop) || this['props'][prop] === default_value) {\n this['props'][prop] = val;\n }\n }, this);\n this.save();\n return true;\n }\n return false;\n};\n\n/**\n* @param {Object} props\n* @param {number=} days\n*/\nMixpanelPersistence.prototype.register = function (props, days) {\n if (_.isObject(props)) {\n this.expire_days = typeof days === 'undefined' ? this.default_expiry : days;\n _.extend(this['props'], props);\n this.save();\n return true;\n }\n return false;\n};\nMixpanelPersistence.prototype.unregister = function (prop) {\n if (prop in this['props']) {\n delete this['props'][prop];\n this.save();\n }\n};\nMixpanelPersistence.prototype._expire_notification_campaigns = _.safewrap(function () {\n var campaigns_shown = this['props'][CAMPAIGN_IDS_KEY],\n EXPIRY_TIME = Config.DEBUG ? 60 * 1000 : 60 * 60 * 1000; // 1 minute (Config.DEBUG) / 1 hour (PDXN)\n if (!campaigns_shown) {\n return;\n }\n for (var campaign_id in campaigns_shown) {\n if (1 * new Date() - campaigns_shown[campaign_id] > EXPIRY_TIME) {\n delete campaigns_shown[campaign_id];\n }\n }\n if (_.isEmptyObject(campaigns_shown)) {\n delete this['props'][CAMPAIGN_IDS_KEY];\n }\n});\nMixpanelPersistence.prototype.update_campaign_params = function () {\n if (!this.campaign_params_saved) {\n this.register_once(_.info.campaignParams());\n this.campaign_params_saved = true;\n }\n};\nMixpanelPersistence.prototype.update_search_keyword = function (referrer) {\n this.register(_.info.searchInfo(referrer));\n};\n\n// EXPORTED METHOD, we test this directly.\nMixpanelPersistence.prototype.update_referrer_info = function (referrer) {\n // If referrer doesn't exist, we want to note the fact that it was type-in traffic.\n this.register_once({\n '$initial_referrer': referrer || '$direct',\n '$initial_referring_domain': _.info.referringDomain(referrer) || '$direct'\n }, '');\n};\nMixpanelPersistence.prototype.get_referrer_info = function () {\n return _.strip_empty_properties({\n '$initial_referrer': this['props']['$initial_referrer'],\n '$initial_referring_domain': this['props']['$initial_referring_domain']\n });\n};\n\n// safely fills the passed in object with stored properties,\n// does not override any properties defined in both\n// returns the passed in object\nMixpanelPersistence.prototype.safe_merge = function (props) {\n _.each(this['props'], function (val, prop) {\n if (!(prop in props)) {\n props[prop] = val;\n }\n });\n return props;\n};\nMixpanelPersistence.prototype.update_config = function (config) {\n this.default_expiry = this.expire_days = config['cookie_expiration'];\n this.set_disabled(config['disable_persistence']);\n this.set_cookie_domain(config['cookie_domain']);\n this.set_cross_site(config['cross_site_cookie']);\n this.set_cross_subdomain(config['cross_subdomain_cookie']);\n this.set_secure(config['secure_cookie']);\n};\nMixpanelPersistence.prototype.set_disabled = function (disabled) {\n this.disabled = disabled;\n if (this.disabled) {\n this.remove();\n } else {\n this.save();\n }\n};\nMixpanelPersistence.prototype.set_cookie_domain = function (cookie_domain) {\n if (cookie_domain !== this.cookie_domain) {\n this.remove();\n this.cookie_domain = cookie_domain;\n this.save();\n }\n};\nMixpanelPersistence.prototype.set_cross_site = function (cross_site) {\n if (cross_site !== this.cross_site) {\n this.cross_site = cross_site;\n this.remove();\n this.save();\n }\n};\nMixpanelPersistence.prototype.set_cross_subdomain = function (cross_subdomain) {\n if (cross_subdomain !== this.cross_subdomain) {\n this.cross_subdomain = cross_subdomain;\n this.remove();\n this.save();\n }\n};\nMixpanelPersistence.prototype.get_cross_subdomain = function () {\n return this.cross_subdomain;\n};\nMixpanelPersistence.prototype.set_secure = function (secure) {\n if (secure !== this.secure) {\n this.secure = secure ? true : false;\n this.remove();\n this.save();\n }\n};\nMixpanelPersistence.prototype._add_to_people_queue = function (queue, data) {\n var q_key = this._get_queue_key(queue),\n q_data = data[queue],\n set_q = this._get_or_create_queue(SET_ACTION),\n set_once_q = this._get_or_create_queue(SET_ONCE_ACTION),\n unset_q = this._get_or_create_queue(UNSET_ACTION),\n add_q = this._get_or_create_queue(ADD_ACTION),\n union_q = this._get_or_create_queue(UNION_ACTION),\n remove_q = this._get_or_create_queue(REMOVE_ACTION, []),\n append_q = this._get_or_create_queue(APPEND_ACTION, []);\n if (q_key === SET_QUEUE_KEY) {\n // Update the set queue - we can override any existing values\n _.extend(set_q, q_data);\n // if there was a pending increment, override it\n // with the set.\n this._pop_from_people_queue(ADD_ACTION, q_data);\n // if there was a pending union, override it\n // with the set.\n this._pop_from_people_queue(UNION_ACTION, q_data);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === SET_ONCE_QUEUE_KEY) {\n // only queue the data if there is not already a set_once call for it.\n _.each(q_data, function (v, k) {\n if (!(k in set_once_q)) {\n set_once_q[k] = v;\n }\n });\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === UNSET_QUEUE_KEY) {\n _.each(q_data, function (prop) {\n // undo previously-queued actions on this key\n _.each([set_q, set_once_q, add_q, union_q], function (enqueued_obj) {\n if (prop in enqueued_obj) {\n delete enqueued_obj[prop];\n }\n });\n _.each(append_q, function (append_obj) {\n if (prop in append_obj) {\n delete append_obj[prop];\n }\n });\n unset_q[prop] = true;\n });\n } else if (q_key === ADD_QUEUE_KEY) {\n _.each(q_data, function (v, k) {\n // If it exists in the set queue, increment\n // the value\n if (k in set_q) {\n set_q[k] += v;\n } else {\n // If it doesn't exist, update the add\n // queue\n if (!(k in add_q)) {\n add_q[k] = 0;\n }\n add_q[k] += v;\n }\n }, this);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === UNION_QUEUE_KEY) {\n _.each(q_data, function (v, k) {\n if (_.isArray(v)) {\n if (!(k in union_q)) {\n union_q[k] = [];\n }\n // We may send duplicates, the server will dedup them.\n union_q[k] = union_q[k].concat(v);\n }\n });\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === REMOVE_QUEUE_KEY) {\n remove_q.push(q_data);\n this._pop_from_people_queue(APPEND_ACTION, q_data);\n } else if (q_key === APPEND_QUEUE_KEY) {\n append_q.push(q_data);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n }\n console.log('MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):');\n console.log(data);\n this.save();\n};\nMixpanelPersistence.prototype._pop_from_people_queue = function (queue, data) {\n var q = this._get_queue(queue);\n if (!_.isUndefined(q)) {\n _.each(data, function (v, k) {\n if (queue === APPEND_ACTION || queue === REMOVE_ACTION) {\n // list actions: only remove if both k+v match\n // e.g. remove should not override append in a case like\n // append({foo: 'bar'}); remove({foo: 'qux'})\n _.each(q, function (queued_action) {\n if (queued_action[k] === v) {\n delete queued_action[k];\n }\n });\n } else {\n delete q[k];\n }\n }, this);\n this.save();\n }\n};\nMixpanelPersistence.prototype._get_queue_key = function (queue) {\n if (queue === SET_ACTION) {\n return SET_QUEUE_KEY;\n } else if (queue === SET_ONCE_ACTION) {\n return SET_ONCE_QUEUE_KEY;\n } else if (queue === UNSET_ACTION) {\n return UNSET_QUEUE_KEY;\n } else if (queue === ADD_ACTION) {\n return ADD_QUEUE_KEY;\n } else if (queue === APPEND_ACTION) {\n return APPEND_QUEUE_KEY;\n } else if (queue === REMOVE_ACTION) {\n return REMOVE_QUEUE_KEY;\n } else if (queue === UNION_ACTION) {\n return UNION_QUEUE_KEY;\n } else {\n console.error('Invalid queue:', queue);\n }\n};\nMixpanelPersistence.prototype._get_queue = function (queue) {\n return this['props'][this._get_queue_key(queue)];\n};\nMixpanelPersistence.prototype._get_or_create_queue = function (queue, default_val) {\n var key = this._get_queue_key(queue);\n default_val = _.isUndefined(default_val) ? {} : default_val;\n return this['props'][key] || (this['props'][key] = default_val);\n};\nMixpanelPersistence.prototype.set_event_timer = function (event_name, timestamp) {\n var timers = this['props'][EVENT_TIMERS_KEY] || {};\n timers[event_name] = timestamp;\n this['props'][EVENT_TIMERS_KEY] = timers;\n this.save();\n};\nMixpanelPersistence.prototype.remove_event_timer = function (event_name) {\n var timers = this['props'][EVENT_TIMERS_KEY] || {};\n var timestamp = timers[event_name];\n if (!_.isUndefined(timestamp)) {\n delete this['props'][EVENT_TIMERS_KEY][event_name];\n this.save();\n }\n return timestamp;\n};\n\n/*\n * This file is a js implementation for a subset in eval_node.c\n */\n\n/*\n * Constants\n */\n// Metadata keys\n/** @const */\nvar OPERATOR_KEY = 'operator';\n/** @const */\nvar PROPERTY_KEY = 'property';\n/** @const */\nvar WINDOW_KEY = 'window';\n/** @const */\nvar UNIT_KEY = 'unit';\n/** @const */\nvar VALUE_KEY = 'value';\n/** @const */\nvar HOUR_KEY = 'hour';\n/** @const */\nvar DAY_KEY = 'day';\n/** @const */\nvar WEEK_KEY = 'week';\n/** @const */\nvar MONTH_KEY = 'month';\n\n// Operands\n/** @const */\nvar EVENT_PROPERTY = 'event';\n/** @const */\nvar LITERAL_PROPERTY = 'literal';\n\n// Binary Operators\n/** @const */\nvar AND_OPERATOR = 'and';\n/** @const */\nvar OR_OPERATOR = 'or';\n/** @const */\nvar IN_OPERATOR = 'in';\n/** @const */\nvar NOT_IN_OPERATOR = 'not in';\n/** @const */\nvar PLUS_OPERATOR = '+';\n/** @const */\nvar MINUS_OPERATOR = '-';\n/** @const */\nvar MUL_OPERATOR = '*';\n/** @const */\nvar DIV_OPERATOR = '/';\n/** @const */\nvar MOD_OPERATOR = '%';\n/** @const */\nvar EQUALS_OPERATOR = '==';\n/** @const */\nvar NOT_EQUALS_OPERATOR = '!=';\n/** @const */\nvar GREATER_OPERATOR = '>';\n/** @const */\nvar LESS_OPERATOR = '<';\n/** @const */\nvar GREATER_EQUAL_OPERATOR = '>=';\n/** @const */\nvar LESS_EQUAL_OPERATOR = '<=';\n\n// Typecast Operators\n/** @const */\nvar BOOLEAN_OPERATOR = 'boolean';\n/** @const */\nvar DATETIME_OPERATOR = 'datetime';\n/** @const */\nvar LIST_OPERATOR = 'list';\n/** @const */\nvar NUMBER_OPERATOR = 'number';\n/** @const */\nvar STRING_OPERATOR = 'string';\n\n// Unary Operators\n/** @const */\nvar NOT_OPERATOR = 'not';\n/** @const */\nvar DEFINED_OPERATOR = 'defined';\n/** @const */\nvar NOT_DEFINED_OPERATOR = 'not defined';\n\n// Special literals\n/** @const */\nvar NOW_LITERAL = 'now';\n\n// Type cast functions\nfunction toNumber(value) {\n if (value === null) {\n return null;\n }\n switch (_typeof(value)) {\n case 'object':\n if (_.isDate(value) && value.getTime() >= 0) {\n return value.getTime();\n }\n return null;\n case 'boolean':\n return Number(value);\n case 'number':\n return value;\n case 'string':\n value = Number(value);\n if (!isNaN(value)) {\n return value;\n }\n return 0;\n }\n return null;\n}\nfunction evaluateNumber(op, properties) {\n if (!op['operator'] || op['operator'] !== NUMBER_OPERATOR || !op['children'] || op['children'].length !== 1) {\n throw 'Invalid cast operator: number ' + op;\n }\n return toNumber(evaluateSelector(op['children'][0], properties));\n}\nfunction toBoolean(value) {\n if (value === null) {\n return false;\n }\n switch (_typeof(value)) {\n case 'boolean':\n return value;\n case 'number':\n return value !== 0.0;\n case 'string':\n return value.length > 0;\n case 'object':\n if (_.isArray(value) && value.length > 0) {\n return true;\n }\n if (_.isDate(value) && value.getTime() > 0) {\n return true;\n }\n if (_.isObject(value) && !_.isEmptyObject(value)) {\n return true;\n }\n return false;\n }\n return false;\n}\nfunction evaluateBoolean(op, properties) {\n if (!op['operator'] || op['operator'] !== BOOLEAN_OPERATOR || !op['children'] || op['children'].length !== 1) {\n throw 'Invalid cast operator: boolean ' + op;\n }\n return toBoolean(evaluateSelector(op['children'][0], properties));\n}\nfunction evaluateDateTime(op, properties) {\n if (!op['operator'] || op['operator'] !== DATETIME_OPERATOR || !op['children'] || op['children'].length !== 1) {\n throw 'Invalid cast operator: datetime ' + op;\n }\n var v = evaluateSelector(op['children'][0], properties);\n if (v === null) {\n return null;\n }\n switch (_typeof(v)) {\n case 'number':\n case 'string':\n var d = new Date(v);\n if (isNaN(d.getTime())) {\n return null;\n }\n return d;\n case 'object':\n if (_.isDate(v)) {\n return v;\n }\n }\n return null;\n}\nfunction evaluateList(op, properties) {\n if (!op['operator'] || op['operator'] !== LIST_OPERATOR || !op['children'] || op['children'].length !== 1) {\n throw 'Invalid cast operator: list ' + op;\n }\n var v = evaluateSelector(op['children'][0], properties);\n if (v === null) {\n return null;\n }\n if (_.isArray(v)) {\n return v;\n }\n return null;\n}\nfunction evaluateString(op, properties) {\n if (!op['operator'] || op['operator'] !== STRING_OPERATOR || !op['children'] || op['children'].length !== 1) {\n throw 'Invalid cast operator: string ' + op;\n }\n var v = evaluateSelector(op['children'][0], properties);\n switch (_typeof(v)) {\n case 'object':\n if (_.isDate(v)) {\n return v.toJSON();\n }\n return JSON.stringify(v);\n }\n return String(v);\n}\n\n// Operators\nfunction evaluateAnd(op, properties) {\n if (!op['operator'] || op['operator'] !== AND_OPERATOR || !op['children'] || op['children'].length !== 2) {\n throw 'Invalid operator: AND ' + op;\n }\n return toBoolean(evaluateSelector(op['children'][0], properties)) && toBoolean(evaluateSelector(op['children'][1], properties));\n}\nfunction evaluateOr(op, properties) {\n if (!op['operator'] || op['operator'] !== OR_OPERATOR || !op['children'] || op['children'].length !== 2) {\n throw 'Invalid operator: OR ' + op;\n }\n return toBoolean(evaluateSelector(op['children'][0], properties)) || toBoolean(evaluateSelector(op['children'][1], properties));\n}\nfunction evaluateIn(op, properties) {\n if (!op['operator'] || [IN_OPERATOR, NOT_IN_OPERATOR].indexOf(op['operator']) === -1 || !op['children'] || op['children'].length !== 2) {\n throw 'Invalid operator: IN/NOT IN ' + op;\n }\n var leftValue = evaluateSelector(op['children'][0], properties);\n var rightValue = evaluateSelector(op['children'][1], properties);\n if (!_.isArray(rightValue) && !_.isString(rightValue)) {\n throw 'Invalid operand for operator IN: invalid type' + rightValue;\n }\n var v = rightValue.indexOf(leftValue) > -1;\n if (op['operator'] === NOT_IN_OPERATOR) {\n return !v;\n }\n return v;\n}\nfunction evaluatePlus(op, properties) {\n if (!op['operator'] || op['operator'] !== PLUS_OPERATOR || !op['children'] || op['children'].length < 2) {\n throw 'Invalid operator: PLUS ' + op;\n }\n var l = evaluateSelector(op['children'][0], properties);\n var r = evaluateSelector(op['children'][1], properties);\n if (typeof l === 'number' && typeof r === 'number') {\n return l + r;\n }\n if (typeof l === 'string' && typeof r === 'string') {\n return l + r;\n }\n return null;\n}\nfunction evaluateArithmetic(op, properties) {\n if (!op['operator'] || [MINUS_OPERATOR, MUL_OPERATOR, DIV_OPERATOR, MOD_OPERATOR].indexOf(op['operator']) === -1 || !op['children'] || op['children'].length < 2) {\n throw 'Invalid arithmetic operator ' + op;\n }\n var l = evaluateSelector(op['children'][0], properties);\n var r = evaluateSelector(op['children'][1], properties);\n if (typeof l === 'number' && typeof r === 'number') {\n switch (op['operator']) {\n case MINUS_OPERATOR:\n return l - r;\n case MUL_OPERATOR:\n return l * r;\n case DIV_OPERATOR:\n if (r !== 0) {\n return l / r;\n }\n return null;\n case MOD_OPERATOR:\n if (r === 0) {\n return null;\n }\n if (l === 0) {\n return 0;\n }\n if (l < 0 && r > 0 || l > 0 && r < 0) {\n /* Mimic python modulo - result takes sign of the divisor\n * if one operand is negative. */\n return -(Math.floor(l / r) * r - l);\n }\n return l % r;\n default:\n throw 'Unknown operator: ' + op['operator'];\n }\n }\n return null;\n}\nfunction _isArrayEqual(l, r) {\n if (l === r) return true;\n if (l === null || r === null) return false;\n if (l.length !== r.length) return false;\n for (var i = 0; i < l.length; i++) {\n if (l[i] !== r[i]) {\n return false;\n }\n }\n return true;\n}\nfunction _isEqual(l, r) {\n if (l === null && l === r) {\n return true;\n }\n if (_typeof(l) === _typeof(r)) {\n switch (_typeof(l)) {\n case 'number':\n case 'string':\n case 'boolean':\n return l === r;\n case 'object':\n if (_.isArray(l) && _.isArray(r)) {\n return _isArrayEqual(l, r);\n }\n if (_.isDate(l) && _.isDate(r)) {\n return l.getTime() === r.getTime();\n }\n if (_.isObject(l) && _.isObject(r)) {\n return JSON.stringify(l) === JSON.stringify(r);\n }\n }\n }\n return false;\n}\nfunction evaluateEquality(op, properties) {\n if (!op['operator'] || [EQUALS_OPERATOR, NOT_EQUALS_OPERATOR].indexOf(op['operator']) === -1 || !op['children'] || op['children'].length !== 2) {\n throw 'Invalid equality operator ' + op;\n }\n var v = _isEqual(evaluateSelector(op['children'][0], properties), evaluateSelector(op['children'][1], properties));\n switch (op['operator']) {\n case EQUALS_OPERATOR:\n return v;\n case NOT_EQUALS_OPERATOR:\n return !v;\n }\n}\nfunction evaluateComparison(op, properties) {\n if (!op['operator'] || [GREATER_OPERATOR, GREATER_EQUAL_OPERATOR, LESS_OPERATOR, LESS_EQUAL_OPERATOR].indexOf(op['operator']) === -1 || !op['children'] || op['children'].length !== 2) {\n throw 'Invalid comparison operator ' + op;\n }\n var l = evaluateSelector(op['children'][0], properties);\n var r = evaluateSelector(op['children'][1], properties);\n if (_typeof(l) === _typeof(r)) {\n if (typeof r === 'number' || _.isDate(r)) {\n l = toNumber(l);\n r = toNumber(r);\n switch (op['operator']) {\n case GREATER_OPERATOR:\n return l > r;\n case GREATER_EQUAL_OPERATOR:\n return l >= r;\n case LESS_OPERATOR:\n return l < r;\n case LESS_EQUAL_OPERATOR:\n return l <= r;\n }\n } else if (typeof r === 'string') {\n var compare = l.localeCompare(r);\n switch (op['operator']) {\n case GREATER_OPERATOR:\n return compare > 0;\n case GREATER_EQUAL_OPERATOR:\n return compare >= 0;\n case LESS_OPERATOR:\n return compare < 0;\n case LESS_EQUAL_OPERATOR:\n return compare <= 0;\n }\n }\n }\n return null;\n}\nfunction evaluateDefined(op, properties) {\n if (!op['operator'] || [DEFINED_OPERATOR, NOT_DEFINED_OPERATOR].indexOf(op['operator']) === -1 || !op['children'] || op['children'].length !== 1) {\n throw 'Invalid defined/not defined operator: ' + op;\n }\n var b = evaluateSelector(op['children'][0], properties) !== null;\n if (op['operator'] === NOT_DEFINED_OPERATOR) {\n return !b;\n }\n return b;\n}\nfunction evaluateNot(op, properties) {\n if (!op['operator'] || op['operator'] !== NOT_OPERATOR || !op['children'] || op['children'].length !== 1) {\n throw 'Invalid not operator: ' + op;\n }\n var v = evaluateSelector(op['children'][0], properties);\n if (v === null) {\n return true;\n }\n if (typeof v === 'boolean') {\n return !v;\n }\n return null;\n}\nfunction evaluateOperator(op, properties) {\n if (!op['operator']) {\n throw 'Invalid operator: operator key missing ' + op;\n }\n switch (op['operator']) {\n case AND_OPERATOR:\n return evaluateAnd(op, properties);\n case OR_OPERATOR:\n return evaluateOr(op, properties);\n case IN_OPERATOR:\n case NOT_IN_OPERATOR:\n return evaluateIn(op, properties);\n case PLUS_OPERATOR:\n return evaluatePlus(op, properties);\n case MINUS_OPERATOR:\n case MUL_OPERATOR:\n case DIV_OPERATOR:\n case MOD_OPERATOR:\n return evaluateArithmetic(op, properties);\n case EQUALS_OPERATOR:\n case NOT_EQUALS_OPERATOR:\n return evaluateEquality(op, properties);\n case GREATER_OPERATOR:\n case LESS_OPERATOR:\n case GREATER_EQUAL_OPERATOR:\n case LESS_EQUAL_OPERATOR:\n return evaluateComparison(op, properties);\n case BOOLEAN_OPERATOR:\n return evaluateBoolean(op, properties);\n case DATETIME_OPERATOR:\n return evaluateDateTime(op, properties);\n case LIST_OPERATOR:\n return evaluateList(op, properties);\n case NUMBER_OPERATOR:\n return evaluateNumber(op, properties);\n case STRING_OPERATOR:\n return evaluateString(op, properties);\n case DEFINED_OPERATOR:\n case NOT_DEFINED_OPERATOR:\n return evaluateDefined(op, properties);\n case NOT_OPERATOR:\n return evaluateNot(op, properties);\n }\n}\nfunction evaluateWindow(value) {\n var win = value[WINDOW_KEY];\n if (!win || !win[UNIT_KEY] || !win[VALUE_KEY]) {\n throw 'Invalid window: missing required keys ' + JSON.stringify(value);\n }\n var out = new Date();\n switch (win[UNIT_KEY]) {\n case HOUR_KEY:\n out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 60 * 60 * 1000);\n break;\n case DAY_KEY:\n out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 24 * 60 * 60 * 1000);\n break;\n case WEEK_KEY:\n out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 7 * 24 * 60 * 60 * 1000);\n break;\n case MONTH_KEY:\n out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 30 * 24 * 60 * 60 * 1000);\n break;\n default:\n throw 'Invalid unit: ' + win[UNIT_KEY];\n }\n return out;\n}\nfunction evaluateOperand(op, properties) {\n if (!op['property'] || !op['value']) {\n throw 'Invalid operand: missing required keys ' + op;\n }\n switch (op['property']) {\n case EVENT_PROPERTY:\n if (properties[op['value']] !== undefined) {\n return properties[op['value']];\n }\n return null;\n case LITERAL_PROPERTY:\n if (op['value'] === NOW_LITERAL) {\n return new Date();\n }\n if (_typeof(op['value']) === 'object') {\n return evaluateWindow(op['value']);\n }\n return op['value'];\n default:\n throw 'Invalid operand: Invalid property type ' + op['property'];\n }\n}\nfunction evaluateSelector(filters, properties) {\n if (filters[PROPERTY_KEY]) {\n return evaluateOperand(filters, properties);\n }\n if (filters[OPERATOR_KEY]) {\n return evaluateOperator(filters, properties);\n }\n}\n\n// Internal class for notification display\n\nvar MixpanelNotification = function MixpanelNotification(notif_data, mixpanel_instance) {\n _.bind_instance_methods(this);\n this.mixpanel = mixpanel_instance;\n this.persistence = this.mixpanel['persistence'];\n this.resource_protocol = this.mixpanel.get_config('inapp_protocol');\n this.cdn_host = this.mixpanel.get_config('cdn');\n this.campaign_id = _.escapeHTML(notif_data['id']);\n this.message_id = _.escapeHTML(notif_data['message_id']);\n this.body = (_.escapeHTML(notif_data['body']) || '').replace(/\\n/g, '
');\n this.cta = _.escapeHTML(notif_data['cta']) || 'Close';\n this.notif_type = _.escapeHTML(notif_data['type']) || 'takeover';\n this.style = _.escapeHTML(notif_data['style']) || 'light';\n this.title = _.escapeHTML(notif_data['title']) || '';\n this.video_width = MixpanelNotification.VIDEO_WIDTH;\n this.video_height = MixpanelNotification.VIDEO_HEIGHT;\n this.display_triggers = notif_data['display_triggers'] || [];\n\n // These fields are url-sanitized in the backend already.\n this.dest_url = notif_data['cta_url'] || null;\n this.image_url = notif_data['image_url'] || null;\n this.thumb_image_url = notif_data['thumb_image_url'] || null;\n this.video_url = notif_data['video_url'] || null;\n if (this.thumb_image_url && this.thumb_image_url.indexOf('//') === 0) {\n this.thumb_image_url = this.thumb_image_url.replace('//', this.resource_protocol);\n }\n this.clickthrough = true;\n if (!this.dest_url) {\n this.dest_url = '#dismiss';\n this.clickthrough = false;\n }\n this.mini = this.notif_type === 'mini';\n if (!this.mini) {\n this.notif_type = 'takeover';\n }\n this.notif_width = !this.mini ? MixpanelNotification.NOTIF_WIDTH : MixpanelNotification.NOTIF_WIDTH_MINI;\n this._set_client_config();\n this.imgs_to_preload = this._init_image_html();\n this._init_video();\n};\nMixpanelNotification.ANIM_TIME = 200;\nMixpanelNotification.MARKUP_PREFIX = 'mixpanel-notification';\nMixpanelNotification.BG_OPACITY = 0.6;\nMixpanelNotification.NOTIF_TOP = 25;\nMixpanelNotification.NOTIF_START_TOP = 200;\nMixpanelNotification.NOTIF_WIDTH = 388;\nMixpanelNotification.NOTIF_WIDTH_MINI = 420;\nMixpanelNotification.NOTIF_HEIGHT_MINI = 85;\nMixpanelNotification.THUMB_BORDER_SIZE = 5;\nMixpanelNotification.THUMB_IMG_SIZE = 60;\nMixpanelNotification.THUMB_OFFSET = Math.round(MixpanelNotification.THUMB_IMG_SIZE / 2);\nMixpanelNotification.VIDEO_WIDTH = 595;\nMixpanelNotification.VIDEO_HEIGHT = 334;\nMixpanelNotification.prototype.show = function () {\n var self = this;\n this._set_client_config();\n\n // don't display until HTML body exists\n if (!this.body_el) {\n setTimeout(function () {\n self.show();\n }, 300);\n return;\n }\n this._init_styles();\n this._init_notification_el();\n\n // wait for any images to load before showing notification\n this._preload_images(this._attach_and_animate);\n};\nMixpanelNotification.prototype.dismiss = _.safewrap(function () {\n if (!this.marked_as_shown) {\n // unexpected condition: user interacted with notif even though we didn't consider it\n // visible (see _mark_as_shown()); send tracking signals to mark delivery\n this._mark_delivery({\n 'invisible': true\n });\n }\n var exiting_el = this.showing_video ? this._get_el('video') : this._get_notification_display_el();\n if (this.use_transitions) {\n this._remove_class('bg', 'visible');\n this._add_class(exiting_el, 'exiting');\n setTimeout(this._remove_notification_el, MixpanelNotification.ANIM_TIME);\n } else {\n var notif_attr, notif_start, notif_goal;\n if (this.mini) {\n notif_attr = 'right';\n notif_start = 20;\n notif_goal = -100;\n } else {\n notif_attr = 'top';\n notif_start = MixpanelNotification.NOTIF_TOP;\n notif_goal = MixpanelNotification.NOTIF_START_TOP + MixpanelNotification.NOTIF_TOP;\n }\n this._animate_els([{\n el: this._get_el('bg'),\n attr: 'opacity',\n start: MixpanelNotification.BG_OPACITY,\n goal: 0.0\n }, {\n el: exiting_el,\n attr: 'opacity',\n start: 1.0,\n goal: 0.0\n }, {\n el: exiting_el,\n attr: notif_attr,\n start: notif_start,\n goal: notif_goal\n }], MixpanelNotification.ANIM_TIME, this._remove_notification_el);\n }\n});\nMixpanelNotification.prototype._add_class = _.safewrap(function (el, class_name) {\n class_name = MixpanelNotification.MARKUP_PREFIX + '-' + class_name;\n if (typeof el === 'string') {\n el = this._get_el(el);\n }\n if (!el.className) {\n el.className = class_name;\n } else if (!~(' ' + el.className + ' ').indexOf(' ' + class_name + ' ')) {\n el.className += ' ' + class_name;\n }\n});\nMixpanelNotification.prototype._remove_class = _.safewrap(function (el, class_name) {\n class_name = MixpanelNotification.MARKUP_PREFIX + '-' + class_name;\n if (typeof el === 'string') {\n el = this._get_el(el);\n }\n if (el.className) {\n el.className = (' ' + el.className + ' ').replace(' ' + class_name + ' ', '').replace(/^[\\s\\xA0]+/, '').replace(/[\\s\\xA0]+$/, '');\n }\n});\nMixpanelNotification.prototype._animate_els = _.safewrap(function (anims, mss, done_cb, start_time) {\n var self = this,\n in_progress = false,\n ai,\n anim,\n cur_time = 1 * new Date(),\n time_diff;\n start_time = start_time || cur_time;\n time_diff = cur_time - start_time;\n for (ai = 0; ai < anims.length; ai++) {\n anim = anims[ai];\n if (typeof anim.val === 'undefined') {\n anim.val = anim.start;\n }\n if (anim.val !== anim.goal) {\n in_progress = true;\n var anim_diff = anim.goal - anim.start,\n anim_dir = anim.goal >= anim.start ? 1 : -1;\n anim.val = anim.start + anim_diff * time_diff / mss;\n if (anim.attr !== 'opacity') {\n anim.val = Math.round(anim.val);\n }\n if (anim_dir > 0 && anim.val >= anim.goal || anim_dir < 0 && anim.val <= anim.goal) {\n anim.val = anim.goal;\n }\n }\n }\n if (!in_progress) {\n if (done_cb) {\n done_cb();\n }\n return;\n }\n for (ai = 0; ai < anims.length; ai++) {\n anim = anims[ai];\n if (anim.el) {\n var suffix = anim.attr === 'opacity' ? '' : 'px';\n anim.el.style[anim.attr] = String(anim.val) + suffix;\n }\n }\n setTimeout(function () {\n self._animate_els(anims, mss, done_cb, start_time);\n }, 10);\n});\nMixpanelNotification.prototype._attach_and_animate = _.safewrap(function () {\n var self = this;\n\n // no possibility to double-display\n if (this.shown || this._get_shown_campaigns()[this.campaign_id]) {\n return;\n }\n this.shown = true;\n this.body_el.appendChild(this.notification_el);\n setTimeout(function () {\n var notif_el = self._get_notification_display_el();\n if (self.use_transitions) {\n if (!self.mini) {\n self._add_class('bg', 'visible');\n }\n self._add_class(notif_el, 'visible');\n self._mark_as_shown();\n } else {\n var notif_attr, notif_start, notif_goal;\n if (self.mini) {\n notif_attr = 'right';\n notif_start = -100;\n notif_goal = 20;\n } else {\n notif_attr = 'top';\n notif_start = MixpanelNotification.NOTIF_START_TOP + MixpanelNotification.NOTIF_TOP;\n notif_goal = MixpanelNotification.NOTIF_TOP;\n }\n self._animate_els([{\n el: self._get_el('bg'),\n attr: 'opacity',\n start: 0.0,\n goal: MixpanelNotification.BG_OPACITY\n }, {\n el: notif_el,\n attr: 'opacity',\n start: 0.0,\n goal: 1.0\n }, {\n el: notif_el,\n attr: notif_attr,\n start: notif_start,\n goal: notif_goal\n }], MixpanelNotification.ANIM_TIME, self._mark_as_shown);\n }\n }, 100);\n _.register_event(self._get_el('cancel'), 'click', function (e) {\n e.preventDefault();\n self.dismiss();\n });\n var click_el = self._get_el('button') || self._get_el('mini-content');\n _.register_event(click_el, 'click', function (e) {\n e.preventDefault();\n if (self.show_video) {\n self._track_event('$campaign_open', {\n '$resource_type': 'video'\n });\n self._switch_to_video();\n } else {\n self.dismiss();\n if (self.clickthrough) {\n var tracking_cb = null;\n if (self.mixpanel.get_config('inapp_link_new_window')) {\n window.open(self.dest_url);\n } else {\n tracking_cb = function tracking_cb() {\n window.location.href = self.dest_url;\n };\n }\n self._track_event('$campaign_open', {\n '$resource_type': 'link'\n }, tracking_cb);\n }\n }\n });\n});\nMixpanelNotification.prototype._get_el = function (id) {\n return document.getElementById(MixpanelNotification.MARKUP_PREFIX + '-' + id);\n};\nMixpanelNotification.prototype._get_notification_display_el = function () {\n return this._get_el(this.notif_type);\n};\nMixpanelNotification.prototype._get_shown_campaigns = function () {\n return this.persistence['props'][CAMPAIGN_IDS_KEY] || (this.persistence['props'][CAMPAIGN_IDS_KEY] = {});\n};\nMixpanelNotification.prototype._matches_event_data = _.safewrap(function (event_data) {\n var event_name = event_data['event'] || '';\n for (var i = 0; i < this.display_triggers.length; i++) {\n var display_trigger = this.display_triggers[i];\n var match_event = display_trigger['event'] || '';\n if (match_event === '$any_event' || event_name === display_trigger['event']) {\n if (display_trigger['selector'] && !_.isEmptyObject(display_trigger['selector'])) {\n if (evaluateSelector(display_trigger['selector'], event_data['properties'])) {\n return true;\n }\n } else {\n return true;\n }\n }\n }\n return false;\n});\nMixpanelNotification.prototype._browser_lte = function (browser, version) {\n return this.browser_versions[browser] && this.browser_versions[browser] <= version;\n};\nMixpanelNotification.prototype._init_image_html = function () {\n var imgs_to_preload = [];\n if (!this.mini) {\n if (this.image_url) {\n imgs_to_preload.push(this.image_url);\n this.img_html = '';\n } else {\n this.img_html = '';\n }\n if (this.thumb_image_url) {\n imgs_to_preload.push(this.thumb_image_url);\n this.thumb_img_html = '
' + '' + '
';\n } else {\n this.thumb_img_html = '';\n }\n } else {\n this.thumb_image_url = this.thumb_image_url || this.cdn_host + '/site_media/images/icons/notifications/mini-news-dark.png';\n imgs_to_preload.push(this.thumb_image_url);\n }\n return imgs_to_preload;\n};\nMixpanelNotification.prototype._init_notification_el = function () {\n var notification_html = '';\n var video_src = '';\n var video_html = '';\n var cancel_html = '
' + '
' + '
';\n this.notification_el = document.createElement('div');\n this.notification_el.id = MixpanelNotification.MARKUP_PREFIX + '-wrapper';\n if (!this.mini) {\n // TAKEOVER notification\n var close_html = this.clickthrough || this.show_video ? '' : '
',\n play_html = this.show_video ? '
' : '';\n if (this._browser_lte('ie', 7)) {\n close_html = '';\n play_html = '';\n }\n notification_html = '
' + this.thumb_img_html + '
' + cancel_html + '
' + this.img_html + '
' + this.title + '
' + '
' + this.body + '
' + '' + '
' + '
' + close_html + '' + this.cta + '' + play_html + '
' + '
' + '
';\n } else {\n // MINI notification\n notification_html = '
' + '
' + cancel_html + '
' + '
' + '
' + '
' + '
' + '
' + this.body + '
' + '
' + '
' + '
' + '
' + '
';\n }\n if (this.youtube_video) {\n video_src = this.resource_protocol + 'www.youtube.com/embed/' + this.youtube_video + '?wmode=transparent&showinfo=0&modestbranding=0&rel=0&autoplay=1&loop=0&vq=hd1080';\n if (this.yt_custom) {\n video_src += '&enablejsapi=1&html5=1&controls=0';\n video_html = '
' + '
' + '
' + '
' + '
' + '
' + '
';\n }\n } else if (this.vimeo_video) {\n video_src = this.resource_protocol + 'player.vimeo.com/video/' + this.vimeo_video + '?autoplay=1&title=0&byline=0&portrait=0';\n }\n if (this.show_video) {\n this.video_iframe = '';\n video_html = '
' + '
' + '
' + video_html + '
' + '
';\n }\n var main_html = video_html + notification_html;\n if (this.flip_animate) {\n main_html = (this.mini ? notification_html : '') + '
' + (this.mini ? video_html : main_html) + '
';\n }\n this.notification_el.innerHTML = ('
' + '
' + '
' + '
' + main_html + '
' + '
' + '
').replace(/class=\"/g, 'class=\"' + MixpanelNotification.MARKUP_PREFIX + '-').replace(/id=\"/g, 'id=\"' + MixpanelNotification.MARKUP_PREFIX + '-');\n};\nMixpanelNotification.prototype._init_styles = function () {\n if (this.style === 'dark') {\n this.style_vals = {\n bg: '#1d1f25',\n bg_actions: '#282b32',\n bg_hover: '#3a4147',\n bg_light: '#4a5157',\n border_gray: '#32353c',\n cancel_opacity: '0.4',\n mini_hover: '#2a3137',\n text_title: '#fff',\n text_main: '#9498a3',\n text_tagline: '#464851',\n text_hover: '#ddd'\n };\n } else {\n this.style_vals = {\n bg: '#fff',\n bg_actions: '#e7eaee',\n bg_hover: '#eceff3',\n bg_light: '#f5f5f5',\n border_gray: '#e4ecf2',\n cancel_opacity: '1.0',\n mini_hover: '#fafafa',\n text_title: '#5c6578',\n text_main: '#8b949b',\n text_tagline: '#ced9e6',\n text_hover: '#7c8598'\n };\n }\n var shadow = '0px 0px 35px 0px rgba(45, 49, 56, 0.7)',\n video_shadow = shadow,\n mini_shadow = shadow,\n thumb_total_size = MixpanelNotification.THUMB_IMG_SIZE + MixpanelNotification.THUMB_BORDER_SIZE * 2,\n anim_seconds = MixpanelNotification.ANIM_TIME / 1000 + 's';\n if (this.mini) {\n shadow = 'none';\n }\n\n // don't display on small viewports\n var notif_media_queries = {},\n min_width = MixpanelNotification.NOTIF_WIDTH_MINI + 20;\n notif_media_queries['@media only screen and (max-width: ' + (min_width - 1) + 'px)'] = {\n '#overlay': {\n 'display': 'none'\n }\n };\n var notif_styles = {\n '.flipped': {\n 'transform': 'rotateY(180deg)'\n },\n '#overlay': {\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'overflow': 'auto',\n 'text-align': 'center',\n 'z-index': '10000',\n 'font-family': '\"Helvetica\", \"Arial\", sans-serif',\n '-webkit-font-smoothing': 'antialiased',\n '-moz-osx-font-smoothing': 'grayscale'\n },\n '#overlay.mini': {\n 'height': '0',\n 'overflow': 'visible'\n },\n '#overlay a': {\n 'width': 'initial',\n 'padding': '0',\n 'text-decoration': 'none',\n 'text-transform': 'none',\n 'color': 'inherit'\n },\n '#bgwrapper': {\n 'position': 'relative',\n 'width': '100%',\n 'height': '100%'\n },\n '#bg': {\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'min-width': this.doc_width * 4 + 'px',\n 'min-height': this.doc_height * 4 + 'px',\n 'background-color': 'black',\n 'opacity': '0.0',\n '-ms-filter': 'progid:DXImageTransform.Microsoft.Alpha(Opacity=60)',\n // IE8\n 'filter': 'alpha(opacity=60)',\n // IE5-7\n 'transition': 'opacity ' + anim_seconds\n },\n '#bg.visible': {\n 'opacity': MixpanelNotification.BG_OPACITY\n },\n '.mini #bg': {\n 'width': '0',\n 'height': '0',\n 'min-width': '0'\n },\n '#flipcontainer': {\n 'perspective': '1000px',\n 'position': 'absolute',\n 'width': '100%'\n },\n '#flipper': {\n 'position': 'relative',\n 'transform-style': 'preserve-3d',\n 'transition': '0.3s'\n },\n '#takeover': {\n 'position': 'absolute',\n 'left': '50%',\n 'width': MixpanelNotification.NOTIF_WIDTH + 'px',\n 'margin-left': Math.round(-MixpanelNotification.NOTIF_WIDTH / 2) + 'px',\n 'backface-visibility': 'hidden',\n 'transform': 'rotateY(0deg)',\n 'opacity': '0.0',\n 'top': MixpanelNotification.NOTIF_START_TOP + 'px',\n 'transition': 'opacity ' + anim_seconds + ', top ' + anim_seconds\n },\n '#takeover.visible': {\n 'opacity': '1.0',\n 'top': MixpanelNotification.NOTIF_TOP + 'px'\n },\n '#takeover.exiting': {\n 'opacity': '0.0',\n 'top': MixpanelNotification.NOTIF_START_TOP + 'px'\n },\n '#thumbspacer': {\n 'height': MixpanelNotification.THUMB_OFFSET + 'px'\n },\n '#thumbborder-wrapper': {\n 'position': 'absolute',\n 'top': -MixpanelNotification.THUMB_BORDER_SIZE + 'px',\n 'left': MixpanelNotification.NOTIF_WIDTH / 2 - MixpanelNotification.THUMB_OFFSET - MixpanelNotification.THUMB_BORDER_SIZE + 'px',\n 'width': thumb_total_size + 'px',\n 'height': thumb_total_size / 2 + 'px',\n 'overflow': 'hidden'\n },\n '#thumbborder': {\n 'position': 'absolute',\n 'width': thumb_total_size + 'px',\n 'height': thumb_total_size + 'px',\n 'border-radius': thumb_total_size + 'px',\n 'background-color': this.style_vals.bg_actions,\n 'opacity': '0.5'\n },\n '#thumbnail': {\n 'position': 'absolute',\n 'top': '0px',\n 'left': MixpanelNotification.NOTIF_WIDTH / 2 - MixpanelNotification.THUMB_OFFSET + 'px',\n 'width': MixpanelNotification.THUMB_IMG_SIZE + 'px',\n 'height': MixpanelNotification.THUMB_IMG_SIZE + 'px',\n 'overflow': 'hidden',\n 'z-index': '100',\n 'border-radius': MixpanelNotification.THUMB_IMG_SIZE + 'px'\n },\n '#mini': {\n 'position': 'absolute',\n 'right': '20px',\n 'top': MixpanelNotification.NOTIF_TOP + 'px',\n 'width': this.notif_width + 'px',\n 'height': MixpanelNotification.NOTIF_HEIGHT_MINI * 2 + 'px',\n 'margin-top': 20 - MixpanelNotification.NOTIF_HEIGHT_MINI + 'px',\n 'backface-visibility': 'hidden',\n 'opacity': '0.0',\n 'transform': 'rotateX(90deg)',\n 'transition': 'opacity 0.3s, transform 0.3s, right 0.3s'\n },\n '#mini.visible': {\n 'opacity': '1.0',\n 'transform': 'rotateX(0deg)'\n },\n '#mini.exiting': {\n 'opacity': '0.0',\n 'right': '-150px'\n },\n '#mainbox': {\n 'border-radius': '4px',\n 'box-shadow': shadow,\n 'text-align': 'center',\n 'background-color': this.style_vals.bg,\n 'font-size': '14px',\n 'color': this.style_vals.text_main\n },\n '#mini #mainbox': {\n 'height': MixpanelNotification.NOTIF_HEIGHT_MINI + 'px',\n 'margin-top': MixpanelNotification.NOTIF_HEIGHT_MINI + 'px',\n 'border-radius': '3px',\n 'transition': 'background-color ' + anim_seconds\n },\n '#mini-border': {\n 'height': MixpanelNotification.NOTIF_HEIGHT_MINI + 6 + 'px',\n 'width': MixpanelNotification.NOTIF_WIDTH_MINI + 6 + 'px',\n 'position': 'absolute',\n 'top': '-3px',\n 'left': '-3px',\n 'margin-top': MixpanelNotification.NOTIF_HEIGHT_MINI + 'px',\n 'border-radius': '6px',\n 'opacity': '0.25',\n 'background-color': '#fff',\n 'z-index': '-1',\n 'box-shadow': mini_shadow\n },\n '#mini-icon': {\n 'position': 'relative',\n 'display': 'inline-block',\n 'width': '75px',\n 'height': MixpanelNotification.NOTIF_HEIGHT_MINI + 'px',\n 'border-radius': '3px 0 0 3px',\n 'background-color': this.style_vals.bg_actions,\n 'background': 'linear-gradient(135deg, ' + this.style_vals.bg_light + ' 0%, ' + this.style_vals.bg_actions + ' 100%)',\n 'transition': 'background-color ' + anim_seconds\n },\n '#mini:hover #mini-icon': {\n 'background-color': this.style_vals.mini_hover\n },\n '#mini:hover #mainbox': {\n 'background-color': this.style_vals.mini_hover\n },\n '#mini-icon-img': {\n 'position': 'absolute',\n 'background-image': 'url(' + this.thumb_image_url + ')',\n 'width': '48px',\n 'height': '48px',\n 'top': '20px',\n 'left': '12px'\n },\n '#content': {\n 'padding': '30px 20px 0px 20px'\n },\n '#mini-content': {\n 'text-align': 'left',\n 'height': MixpanelNotification.NOTIF_HEIGHT_MINI + 'px',\n 'cursor': 'pointer'\n },\n '#img': {\n 'width': '328px',\n 'margin-top': '30px',\n 'border-radius': '5px'\n },\n '#title': {\n 'max-height': '600px',\n 'overflow': 'hidden',\n 'word-wrap': 'break-word',\n 'padding': '25px 0px 20px 0px',\n 'font-size': '19px',\n 'font-weight': 'bold',\n 'color': this.style_vals.text_title\n },\n '#body': {\n 'max-height': '600px',\n 'margin-bottom': '25px',\n 'overflow': 'hidden',\n 'word-wrap': 'break-word',\n 'line-height': '21px',\n 'font-size': '15px',\n 'font-weight': 'normal',\n 'text-align': 'left'\n },\n '#mini #body': {\n 'display': 'inline-block',\n 'max-width': '250px',\n 'margin': '0 0 0 30px',\n 'height': MixpanelNotification.NOTIF_HEIGHT_MINI + 'px',\n 'font-size': '16px',\n 'letter-spacing': '0.8px',\n 'color': this.style_vals.text_title\n },\n '#mini #body-text': {\n 'display': 'table',\n 'height': MixpanelNotification.NOTIF_HEIGHT_MINI + 'px'\n },\n '#mini #body-text div': {\n 'display': 'table-cell',\n 'vertical-align': 'middle'\n },\n '#tagline': {\n 'margin-bottom': '15px',\n 'font-size': '10px',\n 'font-weight': '600',\n 'letter-spacing': '0.8px',\n 'color': '#ccd7e0',\n 'text-align': 'left'\n },\n '#tagline a': {\n 'color': this.style_vals.text_tagline,\n 'transition': 'color ' + anim_seconds\n },\n '#tagline a:hover': {\n 'color': this.style_vals.text_hover\n },\n '#cancel': {\n 'position': 'absolute',\n 'right': '0',\n 'width': '8px',\n 'height': '8px',\n 'padding': '10px',\n 'border-radius': '20px',\n 'margin': '12px 12px 0 0',\n 'box-sizing': 'content-box',\n 'cursor': 'pointer',\n 'transition': 'background-color ' + anim_seconds\n },\n '#mini #cancel': {\n 'margin': '7px 7px 0 0'\n },\n '#cancel-icon': {\n 'width': '8px',\n 'height': '8px',\n 'overflow': 'hidden',\n 'background-image': 'url(' + this.cdn_host + '/site_media/images/icons/notifications/cancel-x.png)',\n 'opacity': this.style_vals.cancel_opacity\n },\n '#cancel:hover': {\n 'background-color': this.style_vals.bg_hover\n },\n '#button': {\n 'display': 'block',\n 'height': '60px',\n 'line-height': '60px',\n 'text-align': 'center',\n 'background-color': this.style_vals.bg_actions,\n 'border-radius': '0 0 4px 4px',\n 'overflow': 'hidden',\n 'cursor': 'pointer',\n 'transition': 'background-color ' + anim_seconds\n },\n '#button-close': {\n 'display': 'inline-block',\n 'width': '9px',\n 'height': '60px',\n 'margin-right': '8px',\n 'vertical-align': 'top',\n 'background-image': 'url(' + this.cdn_host + '/site_media/images/icons/notifications/close-x-' + this.style + '.png)',\n 'background-repeat': 'no-repeat',\n 'background-position': '0px 25px'\n },\n '#button-play': {\n 'display': 'inline-block',\n 'width': '30px',\n 'height': '60px',\n 'margin-left': '15px',\n 'background-image': 'url(' + this.cdn_host + '/site_media/images/icons/notifications/play-' + this.style + '-small.png)',\n 'background-repeat': 'no-repeat',\n 'background-position': '0px 15px'\n },\n 'a#button-link': {\n 'display': 'inline-block',\n 'vertical-align': 'top',\n 'text-align': 'center',\n 'font-size': '17px',\n 'font-weight': 'bold',\n 'overflow': 'hidden',\n 'word-wrap': 'break-word',\n 'color': this.style_vals.text_title,\n 'transition': 'color ' + anim_seconds\n },\n '#button:hover': {\n 'background-color': this.style_vals.bg_hover,\n 'color': this.style_vals.text_hover\n },\n '#button:hover a': {\n 'color': this.style_vals.text_hover\n },\n '#video-noflip': {\n 'position': 'relative',\n 'top': -this.video_height * 2 + 'px'\n },\n '#video-flip': {\n 'backface-visibility': 'hidden',\n 'transform': 'rotateY(180deg)'\n },\n '#video': {\n 'position': 'absolute',\n 'width': this.video_width - 1 + 'px',\n 'height': this.video_height + 'px',\n 'top': MixpanelNotification.NOTIF_TOP + 'px',\n 'margin-top': '100px',\n 'left': '50%',\n 'margin-left': Math.round(-this.video_width / 2) + 'px',\n 'overflow': 'hidden',\n 'border-radius': '5px',\n 'box-shadow': video_shadow,\n 'transform': 'translateZ(1px)',\n // webkit rendering bug http://stackoverflow.com/questions/18167981/clickable-link-area-unexpectedly-smaller-after-css-transform\n 'transition': 'opacity ' + anim_seconds + ', top ' + anim_seconds\n },\n '#video.exiting': {\n 'opacity': '0.0',\n 'top': this.video_height + 'px'\n },\n '#video-holder': {\n 'position': 'absolute',\n 'width': this.video_width - 1 + 'px',\n 'height': this.video_height + 'px',\n 'overflow': 'hidden',\n 'border-radius': '5px'\n },\n '#video-frame': {\n 'margin-left': '-1px',\n 'width': this.video_width + 'px'\n },\n '#video-controls': {\n 'opacity': '0',\n 'transition': 'opacity 0.5s'\n },\n '#video:hover #video-controls': {\n 'opacity': '1.0'\n },\n '#video .video-progress-el': {\n 'position': 'absolute',\n 'bottom': '0',\n 'height': '25px',\n 'border-radius': '0 0 0 5px'\n },\n '#video-progress': {\n 'width': '90%'\n },\n '#video-progress-total': {\n 'width': '100%',\n 'background-color': this.style_vals.bg,\n 'opacity': '0.7'\n },\n '#video-elapsed': {\n 'width': '0',\n 'background-color': '#6cb6f5',\n 'opacity': '0.9'\n },\n '#video #video-time': {\n 'width': '10%',\n 'right': '0',\n 'font-size': '11px',\n 'line-height': '25px',\n 'color': this.style_vals.text_main,\n 'background-color': '#666',\n 'border-radius': '0 0 5px 0'\n }\n };\n\n // IE hacks\n if (this._browser_lte('ie', 8)) {\n _.extend(notif_styles, {\n '* html #overlay': {\n 'position': 'absolute'\n },\n '* html #bg': {\n 'position': 'absolute'\n },\n 'html, body': {\n 'height': '100%'\n }\n });\n }\n if (this._browser_lte('ie', 7)) {\n _.extend(notif_styles, {\n '#mini #body': {\n 'display': 'inline',\n 'zoom': '1',\n 'border': '1px solid ' + this.style_vals.bg_hover\n },\n '#mini #body-text': {\n 'padding': '20px'\n },\n '#mini #mini-icon': {\n 'display': 'none'\n }\n });\n }\n\n // add vendor-prefixed style rules\n var VENDOR_STYLES = ['backface-visibility', 'border-radius', 'box-shadow', 'opacity', 'perspective', 'transform', 'transform-style', 'transition'],\n VENDOR_PREFIXES = ['khtml', 'moz', 'ms', 'o', 'webkit'];\n for (var selector in notif_styles) {\n for (var si = 0; si < VENDOR_STYLES.length; si++) {\n var prop = VENDOR_STYLES[si];\n if (prop in notif_styles[selector]) {\n var val = notif_styles[selector][prop];\n for (var pi = 0; pi < VENDOR_PREFIXES.length; pi++) {\n notif_styles[selector]['-' + VENDOR_PREFIXES[pi] + '-' + prop] = val;\n }\n }\n }\n }\n var inject_styles = function inject_styles(styles, media_queries) {\n var create_style_text = function create_style_text(style_defs) {\n var st = '';\n for (var selector in style_defs) {\n var mp_selector = selector.replace(/#/g, '#' + MixpanelNotification.MARKUP_PREFIX + '-').replace(/\\./g, '.' + MixpanelNotification.MARKUP_PREFIX + '-');\n st += '\\n' + mp_selector + ' {';\n var props = style_defs[selector];\n for (var k in props) {\n st += k + ':' + props[k] + ';';\n }\n st += '}';\n }\n return st;\n };\n var create_media_query_text = function create_media_query_text(mq_defs) {\n var mqt = '';\n for (var mq in mq_defs) {\n mqt += '\\n' + mq + ' {' + create_style_text(mq_defs[mq]) + '\\n}';\n }\n return mqt;\n };\n var style_text = create_style_text(styles) + create_media_query_text(media_queries),\n head_el = document.head || document.getElementsByTagName('head')[0] || document.documentElement,\n style_el = document.createElement('style');\n head_el.appendChild(style_el);\n style_el.setAttribute('type', 'text/css');\n if (style_el.styleSheet) {\n // IE\n style_el.styleSheet.cssText = style_text;\n } else {\n style_el.textContent = style_text;\n }\n };\n inject_styles(notif_styles, notif_media_queries);\n};\nMixpanelNotification.prototype._init_video = _.safewrap(function () {\n if (!this.video_url) {\n return;\n }\n var self = this;\n\n // Youtube iframe API compatibility\n self.yt_custom = 'postMessage' in window;\n self.dest_url = self.video_url;\n var youtube_match = self.video_url.match(\n // http://stackoverflow.com/questions/2936467/parse-youtube-video-id-using-preg-match\n /(?:youtube(?:-nocookie)?\\.com\\/(?:[^/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?/ ]{11})/i),\n vimeo_match = self.video_url.match(/vimeo\\.com\\/.*?(\\d+)/i);\n if (youtube_match) {\n self.show_video = true;\n self.youtube_video = youtube_match[1];\n if (self.yt_custom) {\n window['onYouTubeIframeAPIReady'] = function () {\n if (self._get_el('video-frame')) {\n self._yt_video_ready();\n }\n };\n\n // load Youtube iframe API; see https://developers.google.com/youtube/iframe_api_reference\n var tag = document.createElement('script');\n tag.src = self.resource_protocol + 'www.youtube.com/iframe_api';\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n }\n } else if (vimeo_match) {\n self.show_video = true;\n self.vimeo_video = vimeo_match[1];\n }\n\n // IE <= 7, FF <= 3: fall through to video link rather than embedded player\n if (self._browser_lte('ie', 7) || self._browser_lte('firefox', 3)) {\n self.show_video = false;\n self.clickthrough = true;\n }\n});\nMixpanelNotification.prototype._mark_as_shown = _.safewrap(function () {\n // click on background to dismiss\n var self = this;\n _.register_event(self._get_el('bg'), 'click', function () {\n self.dismiss();\n });\n var get_style = function get_style(el, style_name) {\n var styles = {};\n if (document.defaultView && document.defaultView.getComputedStyle) {\n styles = document.defaultView.getComputedStyle(el, null); // FF3 requires both args\n } else if (el.currentStyle) {\n // IE\n styles = el.currentStyle;\n }\n return styles[style_name];\n };\n if (this.campaign_id) {\n var notif_el = this._get_el('overlay');\n if (notif_el && get_style(notif_el, 'visibility') !== 'hidden' && get_style(notif_el, 'display') !== 'none') {\n this._mark_delivery();\n }\n }\n});\nMixpanelNotification.prototype._mark_delivery = _.safewrap(function (extra_props) {\n if (!this.marked_as_shown) {\n this.marked_as_shown = true;\n if (this.campaign_id) {\n // mark notification shown (local cache)\n this._get_shown_campaigns()[this.campaign_id] = 1 * new Date();\n this.persistence.save();\n }\n\n // track delivery\n this._track_event('$campaign_delivery', extra_props);\n\n // mark notification shown (mixpanel property)\n this.mixpanel['people']['append']({\n '$campaigns': this.campaign_id,\n '$notifications': {\n 'campaign_id': this.campaign_id,\n 'message_id': this.message_id,\n 'type': 'web',\n 'time': new Date()\n }\n });\n }\n});\nMixpanelNotification.prototype._preload_images = function (all_loaded_cb) {\n var self = this;\n if (this.imgs_to_preload.length === 0) {\n all_loaded_cb();\n return;\n }\n var preloaded_imgs = 0;\n var img_objs = [];\n var onload = function onload() {\n preloaded_imgs++;\n if (preloaded_imgs === self.imgs_to_preload.length && all_loaded_cb) {\n all_loaded_cb();\n all_loaded_cb = null;\n }\n };\n for (var i = 0; i < this.imgs_to_preload.length; i++) {\n var img = new Image();\n img.onload = onload;\n img.src = this.imgs_to_preload[i];\n if (img.complete) {\n onload();\n }\n img_objs.push(img);\n }\n\n // IE6/7 doesn't fire onload reliably\n if (this._browser_lte('ie', 7)) {\n setTimeout(function () {\n var imgs_loaded = true;\n for (i = 0; i < img_objs.length; i++) {\n if (!img_objs[i].complete) {\n imgs_loaded = false;\n }\n }\n if (imgs_loaded && all_loaded_cb) {\n all_loaded_cb();\n all_loaded_cb = null;\n }\n }, 500);\n }\n};\nMixpanelNotification.prototype._remove_notification_el = _.safewrap(function () {\n window.clearInterval(this._video_progress_checker);\n this.notification_el.style.visibility = 'hidden';\n this.body_el.removeChild(this.notification_el);\n});\nMixpanelNotification.prototype._set_client_config = function () {\n var get_browser_version = function get_browser_version(browser_ex) {\n var match = navigator.userAgent.match(browser_ex);\n return match && match[1];\n };\n this.browser_versions = {};\n this.browser_versions['chrome'] = get_browser_version(/Chrome\\/(\\d+)/);\n this.browser_versions['firefox'] = get_browser_version(/Firefox\\/(\\d+)/);\n this.browser_versions['ie'] = get_browser_version(/MSIE (\\d+).+/);\n if (!this.browser_versions['ie'] && !window.ActiveXObject && 'ActiveXObject' in window) {\n this.browser_versions['ie'] = 11;\n }\n this.body_el = document.body || document.getElementsByTagName('body')[0];\n if (this.body_el) {\n this.doc_width = Math.max(this.body_el.scrollWidth, document.documentElement.scrollWidth, this.body_el.offsetWidth, document.documentElement.offsetWidth, this.body_el.clientWidth, document.documentElement.clientWidth);\n this.doc_height = Math.max(this.body_el.scrollHeight, document.documentElement.scrollHeight, this.body_el.offsetHeight, document.documentElement.offsetHeight, this.body_el.clientHeight, document.documentElement.clientHeight);\n }\n\n // detect CSS compatibility\n var ie_ver = this.browser_versions['ie'];\n var sample_styles = document.createElement('div').style,\n is_css_compatible = function is_css_compatible(rule) {\n if (rule in sample_styles) {\n return true;\n }\n if (!ie_ver) {\n rule = rule[0].toUpperCase() + rule.slice(1);\n var props = ['O' + rule, 'Webkit' + rule, 'Moz' + rule];\n for (var i = 0; i < props.length; i++) {\n if (props[i] in sample_styles) {\n return true;\n }\n }\n }\n return false;\n };\n this.use_transitions = this.body_el && is_css_compatible('transition') && is_css_compatible('transform');\n this.flip_animate = (this.browser_versions['chrome'] >= 33 || this.browser_versions['firefox'] >= 15) && this.body_el && is_css_compatible('backfaceVisibility') && is_css_compatible('perspective') && is_css_compatible('transform');\n};\nMixpanelNotification.prototype._switch_to_video = _.safewrap(function () {\n var self = this,\n anims = [{\n el: self._get_notification_display_el(),\n attr: 'opacity',\n start: 1.0,\n goal: 0.0\n }, {\n el: self._get_notification_display_el(),\n attr: 'top',\n start: MixpanelNotification.NOTIF_TOP,\n goal: -500\n }, {\n el: self._get_el('video-noflip'),\n attr: 'opacity',\n start: 0.0,\n goal: 1.0\n }, {\n el: self._get_el('video-noflip'),\n attr: 'top',\n start: -self.video_height * 2,\n goal: 0\n }];\n if (self.mini) {\n var bg = self._get_el('bg'),\n overlay = self._get_el('overlay');\n bg.style.width = '100%';\n bg.style.height = '100%';\n overlay.style.width = '100%';\n self._add_class(self._get_notification_display_el(), 'exiting');\n self._add_class(bg, 'visible');\n anims.push({\n el: self._get_el('bg'),\n attr: 'opacity',\n start: 0.0,\n goal: MixpanelNotification.BG_OPACITY\n });\n }\n var video_el = self._get_el('video-holder');\n video_el.innerHTML = self.video_iframe;\n var video_ready = function video_ready() {\n if (window['YT'] && window['YT']['loaded']) {\n self._yt_video_ready();\n }\n self.showing_video = true;\n self._get_notification_display_el().style.visibility = 'hidden';\n };\n if (self.flip_animate) {\n self._add_class('flipper', 'flipped');\n setTimeout(video_ready, MixpanelNotification.ANIM_TIME);\n } else {\n self._animate_els(anims, MixpanelNotification.ANIM_TIME, video_ready);\n }\n});\nMixpanelNotification.prototype._track_event = function (event_name, properties, cb) {\n if (this.campaign_id) {\n properties = properties || {};\n properties = _.extend(properties, {\n 'campaign_id': this.campaign_id,\n 'message_id': this.message_id,\n 'message_type': 'web_inapp',\n 'message_subtype': this.notif_type\n });\n this.mixpanel['track'](event_name, properties, cb);\n } else if (cb) {\n cb.call();\n }\n};\nMixpanelNotification.prototype._yt_video_ready = _.safewrap(function () {\n var self = this;\n if (self.video_inited) {\n return;\n }\n self.video_inited = true;\n var progress_bar = self._get_el('video-elapsed'),\n progress_time = self._get_el('video-time'),\n progress_el = self._get_el('video-progress');\n new window['YT']['Player'](MixpanelNotification.MARKUP_PREFIX + '-video-frame', {\n 'events': {\n 'onReady': function onReady(event) {\n var ytplayer = event['target'],\n video_duration = ytplayer['getDuration'](),\n pad = function pad(i) {\n return ('00' + i).slice(-2);\n },\n update_video_time = function update_video_time(current_time) {\n var secs = Math.round(video_duration - current_time),\n mins = Math.floor(secs / 60),\n hours = Math.floor(mins / 60);\n secs -= mins * 60;\n mins -= hours * 60;\n progress_time.innerHTML = '-' + (hours ? hours + ':' : '') + pad(mins) + ':' + pad(secs);\n };\n update_video_time(0);\n self._video_progress_checker = window.setInterval(function () {\n var current_time = ytplayer['getCurrentTime']();\n progress_bar.style.width = current_time / video_duration * 100 + '%';\n update_video_time(current_time);\n }, 250);\n _.register_event(progress_el, 'click', function (e) {\n var clickx = Math.max(0, e.pageX - progress_el.getBoundingClientRect().left);\n ytplayer['seekTo'](video_duration * clickx / progress_el.clientWidth, true);\n });\n }\n }\n });\n});\n\n/**\n * Mixpanel People Object\n * @constructor\n */\nvar MixpanelPeople = function MixpanelPeople() {};\n_.extend(MixpanelPeople.prototype, apiActions);\nMixpanelPeople.prototype._init = function (mixpanel_instance) {\n this._mixpanel = mixpanel_instance;\n};\n\n/*\n* Set properties on a user record.\n*\n* ### Usage:\n*\n* mixpanel.people.set('gender', 'm');\n*\n* // or set multiple properties at once\n* mixpanel.people.set({\n* 'Company': 'Acme',\n* 'Plan': 'Premium',\n* 'Upgrade date': new Date()\n* });\n* // properties can be strings, integers, dates, or lists\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [to] A value to set on the given property name\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.set = addOptOutCheckMixpanelPeople(function (prop, to, callback) {\n var data = this.set_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n // make sure that the referrer info has been updated and saved\n if (this._get_config('save_referrer')) {\n this._mixpanel['persistence'].update_referrer_info(document.referrer);\n }\n\n // update $set object with default people properties\n data[SET_ACTION] = _.extend({}, _.info.people_properties(), this._mixpanel['persistence'].get_referrer_info(), data[SET_ACTION]);\n return this._send_request(data, callback);\n});\n\n/*\n* Set properties on a user record, only if they do not yet exist.\n* This will not overwrite previous people property values, unlike\n* people.set().\n*\n* ### Usage:\n*\n* mixpanel.people.set_once('First Login Date', new Date());\n*\n* // or set multiple properties at once\n* mixpanel.people.set_once({\n* 'First Login Date': new Date(),\n* 'Starting Plan': 'Premium'\n* });\n*\n* // properties can be strings, integers or dates\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [to] A value to set on the given property name\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.set_once = addOptOutCheckMixpanelPeople(function (prop, to, callback) {\n var data = this.set_once_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/*\n* Unset properties on a user record (permanently removes the properties and their values from a profile).\n*\n* ### Usage:\n*\n* mixpanel.people.unset('gender');\n*\n* // or unset multiple properties at once\n* mixpanel.people.unset(['gender', 'Company']);\n*\n* @param {Array|String} prop If a string, this is the name of the property. If an array, this is a list of property names.\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.unset = addOptOutCheckMixpanelPeople(function (prop, callback) {\n var data = this.unset_action(prop);\n return this._send_request(data, callback);\n});\n\n/*\n* Increment/decrement numeric people analytics properties.\n*\n* ### Usage:\n*\n* mixpanel.people.increment('page_views', 1);\n*\n* // or, for convenience, if you're just incrementing a counter by\n* // 1, you can simply do\n* mixpanel.people.increment('page_views');\n*\n* // to decrement a counter, pass a negative number\n* mixpanel.people.increment('credits_left', -1);\n*\n* // like mixpanel.people.set(), you can increment multiple\n* // properties at once:\n* mixpanel.people.increment({\n* counter1: 1,\n* counter2: 6\n* });\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and numeric values.\n* @param {Number} [by] An amount to increment the given property\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.increment = addOptOutCheckMixpanelPeople(function (prop, by, callback) {\n var data = {};\n var $add = {};\n if (_.isObject(prop)) {\n _.each(prop, function (v, k) {\n if (!this._is_reserved_property(k)) {\n if (isNaN(parseFloat(v))) {\n console.error('Invalid increment value passed to mixpanel.people.increment - must be a number');\n return;\n } else {\n $add[k] = v;\n }\n }\n }, this);\n callback = by;\n } else {\n // convenience: mixpanel.people.increment('property'); will\n // increment 'property' by 1\n if (_.isUndefined(by)) {\n by = 1;\n }\n $add[prop] = by;\n }\n data[ADD_ACTION] = $add;\n return this._send_request(data, callback);\n});\n\n/*\n* Append a value to a list-valued people analytics property.\n*\n* ### Usage:\n*\n* // append a value to a list, creating it if needed\n* mixpanel.people.append('pages_visited', 'homepage');\n*\n* // like mixpanel.people.set(), you can append multiple\n* // properties at once:\n* mixpanel.people.append({\n* list1: 'bob',\n* list2: 123\n* });\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] value An item to append to the list\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.append = addOptOutCheckMixpanelPeople(function (list_name, value, callback) {\n if (_.isObject(list_name)) {\n callback = value;\n }\n var data = this.append_action(list_name, value);\n return this._send_request(data, callback);\n});\n\n/*\n* Remove a value from a list-valued people analytics property.\n*\n* ### Usage:\n*\n* mixpanel.people.remove('School', 'UCB');\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] value Item to remove from the list\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.remove = addOptOutCheckMixpanelPeople(function (list_name, value, callback) {\n if (_.isObject(list_name)) {\n callback = value;\n }\n var data = this.remove_action(list_name, value);\n return this._send_request(data, callback);\n});\n\n/*\n* Merge a given list with a list-valued people analytics property,\n* excluding duplicate values.\n*\n* ### Usage:\n*\n* // merge a value to a list, creating it if needed\n* mixpanel.people.union('pages_visited', 'homepage');\n*\n* // like mixpanel.people.set(), you can append multiple\n* // properties at once:\n* mixpanel.people.union({\n* list1: 'bob',\n* list2: 123\n* });\n*\n* // like mixpanel.people.append(), you can append multiple\n* // values to the same list:\n* mixpanel.people.union({\n* list1: ['bob', 'billy']\n* });\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] Value / values to merge with the given property\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople(function (list_name, values, callback) {\n if (_.isObject(list_name)) {\n callback = values;\n }\n var data = this.union_action(list_name, values);\n return this._send_request(data, callback);\n});\n\n/*\n* Record that you have charged the current user a certain amount\n* of money. Charges recorded with track_charge() will appear in the\n* Mixpanel revenue report.\n*\n* ### Usage:\n*\n* // charge a user $50\n* mixpanel.people.track_charge(50);\n*\n* // charge a user $30.50 on the 2nd of january\n* mixpanel.people.track_charge(30.50, {\n* '$time': new Date('jan 1 2012')\n* });\n*\n* @param {Number} amount The amount of money charged to the current user\n* @param {Object} [properties] An associative array of properties associated with the charge\n* @param {Function} [callback] If provided, the callback will be called when the server responds\n*/\nMixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function (amount, properties, callback) {\n if (!_.isNumber(amount)) {\n amount = parseFloat(amount);\n if (isNaN(amount)) {\n console.error('Invalid value passed to mixpanel.people.track_charge - must be a number');\n return;\n }\n }\n return this.append('$transactions', _.extend({\n '$amount': amount\n }, properties), callback);\n});\n\n/*\n* Permanently clear all revenue report transactions from the\n* current user's people analytics profile.\n*\n* ### Usage:\n*\n* mixpanel.people.clear_charges();\n*\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.clear_charges = function (callback) {\n return this.set('$transactions', [], callback);\n};\n\n/*\n* Permanently deletes the current people analytics profile from\n* Mixpanel (using the current distinct_id).\n*\n* ### Usage:\n*\n* // remove the all data you have stored about the current user\n* mixpanel.people.delete_user();\n*\n*/\nMixpanelPeople.prototype.delete_user = function () {\n if (!this._identify_called()) {\n console.error('mixpanel.people.delete_user() requires you to call identify() first');\n return;\n }\n var data = {\n '$delete': this._mixpanel.get_distinct_id()\n };\n return this._send_request(data);\n};\nMixpanelPeople.prototype.toString = function () {\n return this._mixpanel.toString() + '.people';\n};\nMixpanelPeople.prototype._send_request = function (data, callback) {\n data['$token'] = this._get_config('token');\n data['$distinct_id'] = this._mixpanel.get_distinct_id();\n var device_id = this._mixpanel.get_property('$device_id');\n var user_id = this._mixpanel.get_property('$user_id');\n var had_persisted_distinct_id = this._mixpanel.get_property('$had_persisted_distinct_id');\n if (device_id) {\n data['$device_id'] = device_id;\n }\n if (user_id) {\n data['$user_id'] = user_id;\n }\n if (had_persisted_distinct_id) {\n data['$had_persisted_distinct_id'] = had_persisted_distinct_id;\n }\n var date_encoded_data = _.encodeDates(data);\n if (!this._identify_called()) {\n this._enqueue(data);\n if (!_.isUndefined(callback)) {\n if (this._get_config('verbose')) {\n callback({\n status: -1,\n error: null\n });\n } else {\n callback(-1);\n }\n }\n return _.truncate(date_encoded_data, 255);\n }\n return this._mixpanel._track_or_batch({\n type: 'people',\n data: date_encoded_data,\n endpoint: this._get_config('api_host') + '/engage/',\n batcher: this._mixpanel.request_batchers.people\n }, callback);\n};\nMixpanelPeople.prototype._get_config = function (conf_var) {\n return this._mixpanel.get_config(conf_var);\n};\nMixpanelPeople.prototype._identify_called = function () {\n return this._mixpanel._flags.identify_called === true;\n};\n\n// Queue up engage operations if identify hasn't been called yet.\nMixpanelPeople.prototype._enqueue = function (data) {\n if (SET_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ACTION, data);\n } else if (SET_ONCE_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ONCE_ACTION, data);\n } else if (UNSET_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(UNSET_ACTION, data);\n } else if (ADD_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(ADD_ACTION, data);\n } else if (APPEND_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, data);\n } else if (REMOVE_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, data);\n } else if (UNION_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(UNION_ACTION, data);\n } else {\n console.error('Invalid call to _enqueue():', data);\n }\n};\nMixpanelPeople.prototype._flush_one_queue = function (action, action_method, callback, queue_to_params_fn) {\n var _this = this;\n var queued_data = _.extend({}, this._mixpanel['persistence']._get_queue(action));\n var action_params = queued_data;\n if (!_.isUndefined(queued_data) && _.isObject(queued_data) && !_.isEmptyObject(queued_data)) {\n _this._mixpanel['persistence']._pop_from_people_queue(action, queued_data);\n if (queue_to_params_fn) {\n action_params = queue_to_params_fn(queued_data);\n }\n action_method.call(_this, action_params, function (response, data) {\n // on bad response, we want to add it back to the queue\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(action, queued_data);\n }\n if (!_.isUndefined(callback)) {\n callback(response, data);\n }\n });\n }\n};\n\n// Flush queued engage operations - order does not matter,\n// and there are network level race conditions anyway\nMixpanelPeople.prototype._flush = function (_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback) {\n var _this = this;\n var $append_queue = this._mixpanel['persistence']._get_queue(APPEND_ACTION);\n var $remove_queue = this._mixpanel['persistence']._get_queue(REMOVE_ACTION);\n this._flush_one_queue(SET_ACTION, this.set, _set_callback);\n this._flush_one_queue(SET_ONCE_ACTION, this.set_once, _set_once_callback);\n this._flush_one_queue(UNSET_ACTION, this.unset, _unset_callback, function (queue) {\n return _.keys(queue);\n });\n this._flush_one_queue(ADD_ACTION, this.increment, _add_callback);\n this._flush_one_queue(UNION_ACTION, this.union, _union_callback);\n\n // we have to fire off each $append individually since there is\n // no concat method server side\n if (!_.isUndefined($append_queue) && _.isArray($append_queue) && $append_queue.length) {\n var $append_item;\n var append_callback = function append_callback(response, data) {\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, $append_item);\n }\n if (!_.isUndefined(_append_callback)) {\n _append_callback(response, data);\n }\n };\n for (var i = $append_queue.length - 1; i >= 0; i--) {\n $append_item = $append_queue.pop();\n if (!_.isEmptyObject($append_item)) {\n _this.append($append_item, append_callback);\n }\n }\n // Save the shortened append queue\n _this._mixpanel['persistence'].save();\n }\n\n // same for $remove\n if (!_.isUndefined($remove_queue) && _.isArray($remove_queue) && $remove_queue.length) {\n var $remove_item;\n var remove_callback = function remove_callback(response, data) {\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, $remove_item);\n }\n if (!_.isUndefined(_remove_callback)) {\n _remove_callback(response, data);\n }\n };\n for (var j = $remove_queue.length - 1; j >= 0; j--) {\n $remove_item = $remove_queue.pop();\n if (!_.isEmptyObject($remove_item)) {\n _this.remove($remove_item, remove_callback);\n }\n }\n _this._mixpanel['persistence'].save();\n }\n};\nMixpanelPeople.prototype._is_reserved_property = function (prop) {\n return prop === '$distinct_id' || prop === '$token' || prop === '$device_id' || prop === '$user_id' || prop === '$had_persisted_distinct_id';\n};\n\n// MixpanelPeople Exports\nMixpanelPeople.prototype['set'] = MixpanelPeople.prototype.set;\nMixpanelPeople.prototype['set_once'] = MixpanelPeople.prototype.set_once;\nMixpanelPeople.prototype['unset'] = MixpanelPeople.prototype.unset;\nMixpanelPeople.prototype['increment'] = MixpanelPeople.prototype.increment;\nMixpanelPeople.prototype['append'] = MixpanelPeople.prototype.append;\nMixpanelPeople.prototype['remove'] = MixpanelPeople.prototype.remove;\nMixpanelPeople.prototype['union'] = MixpanelPeople.prototype.union;\nMixpanelPeople.prototype['track_charge'] = MixpanelPeople.prototype.track_charge;\nMixpanelPeople.prototype['clear_charges'] = MixpanelPeople.prototype.clear_charges;\nMixpanelPeople.prototype['delete_user'] = MixpanelPeople.prototype.delete_user;\nMixpanelPeople.prototype['toString'] = MixpanelPeople.prototype.toString;\n\n/*\n * Mixpanel JS Library\n *\n * Copyright 2012, Mixpanel, Inc. All Rights Reserved\n * http://mixpanel.com/\n *\n * Includes portions of Underscore.js\n * http://documentcloud.github.com/underscore/\n * (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.\n * Released under the MIT License.\n */\n\n// ==ClosureCompiler==\n// @compilation_level ADVANCED_OPTIMIZATIONS\n// @output_file_name mixpanel-2.8.min.js\n// ==/ClosureCompiler==\n\n/*\nSIMPLE STYLE GUIDE:\n\nthis.x === public function\nthis._x === internal - only use within this file\nthis.__x === private - only use within the class\n\nGlobals should be all caps\n*/\n\nvar init_type; // MODULE or SNIPPET loader\nvar mixpanel_master; // main mixpanel instance / object\nvar INIT_MODULE = 0;\nvar INIT_SNIPPET = 1;\nvar IDENTITY_FUNC = function IDENTITY_FUNC(x) {\n return x;\n};\nvar NOOP_FUNC = function NOOP_FUNC() {};\n\n/** @const */\nvar PRIMARY_INSTANCE_NAME = 'mixpanel';\n\n/*\n * Dynamic... constants? Is that an oxymoron?\n */\n// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/\n// https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#withCredentials\nvar USE_XHR = window$1.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest();\n\n// IE<10 does not support cross-origin XHR's but script tags\n// with defer won't block window.onload; ENQUEUE_REQUESTS\n// should only be true for Opera<12\nvar ENQUEUE_REQUESTS = !USE_XHR && userAgent.indexOf('MSIE') === -1 && userAgent.indexOf('Mozilla') === -1;\n\n// save reference to navigator.sendBeacon so it can be minified\nvar sendBeacon = null;\nif (navigator$1['sendBeacon']) {\n sendBeacon = function sendBeacon() {\n // late reference to navigator.sendBeacon to allow patching/spying\n return navigator$1['sendBeacon'].apply(navigator$1, arguments);\n };\n}\n\n/*\n * Module-level globals\n */\nvar DEFAULT_CONFIG = {\n 'api_host': 'https://api-js.mixpanel.com',\n 'api_method': 'POST',\n 'api_transport': 'XHR',\n 'app_host': 'https://mixpanel.com',\n 'cdn': 'https://cdn.mxpnl.com',\n 'cross_site_cookie': false,\n 'cross_subdomain_cookie': true,\n 'persistence': 'cookie',\n 'persistence_name': '',\n 'cookie_domain': '',\n 'cookie_name': '',\n 'loaded': NOOP_FUNC,\n 'store_google': true,\n 'save_referrer': true,\n 'test': false,\n 'verbose': false,\n 'img': false,\n 'debug': false,\n 'track_links_timeout': 300,\n 'cookie_expiration': 365,\n 'upgrade': false,\n 'disable_persistence': false,\n 'disable_cookie': false,\n 'secure_cookie': false,\n 'ip': true,\n 'opt_out_tracking_by_default': false,\n 'opt_out_persistence_by_default': false,\n 'opt_out_tracking_persistence_type': 'localStorage',\n 'opt_out_tracking_cookie_prefix': null,\n 'property_blacklist': [],\n 'xhr_headers': {},\n // { header: value, header2: value }\n 'inapp_protocol': '//',\n 'inapp_link_new_window': false,\n 'ignore_dnt': false,\n 'batch_requests': true,\n 'batch_size': 50,\n 'batch_flush_interval_ms': 5000,\n 'batch_request_timeout_ms': 90000,\n 'batch_autostart': true,\n 'hooks': {}\n};\nvar DOM_LOADED = false;\n\n/**\n * Mixpanel Library Object\n * @constructor\n */\nvar MixpanelLib = function MixpanelLib() {};\n\n/**\n * create_mplib(token:string, config:object, name:string)\n *\n * This function is used by the init method of MixpanelLib objects\n * as well as the main initializer at the end of the JSLib (that\n * initializes document.mixpanel as well as any additional instances\n * declared before this file has loaded).\n */\nvar create_mplib = function create_mplib(token, config, name) {\n var instance,\n target = name === PRIMARY_INSTANCE_NAME ? mixpanel_master : mixpanel_master[name];\n if (target && init_type === INIT_MODULE) {\n instance = target;\n } else {\n if (target && !_.isArray(target)) {\n console.error('You have already initialized ' + name);\n return;\n }\n instance = new MixpanelLib();\n }\n instance._cached_groups = {}; // cache groups in a pool\n instance._user_decide_check_complete = false;\n instance._events_tracked_before_user_decide_check_complete = [];\n instance._init(token, config, name);\n instance['people'] = new MixpanelPeople();\n instance['people']._init(instance);\n\n // if any instance on the page has debug = true, we set the\n // global debug to be true\n Config.DEBUG = Config.DEBUG || instance.get_config('debug');\n\n // if target is not defined, we called init after the lib already\n // loaded, so there won't be an array of things to execute\n if (!_.isUndefined(target) && _.isArray(target)) {\n // Crunch through the people queue first - we queue this data up &\n // flush on identify, so it's better to do all these operations first\n instance._execute_array.call(instance['people'], target['people']);\n instance._execute_array(target);\n }\n return instance;\n};\nvar encode_data_for_request = function encode_data_for_request(data) {\n var json_data = _.JSONEncode(data);\n var encoded_data = _.base64Encode(json_data);\n return {\n 'data': encoded_data\n };\n};\n\n// Initialization methods\n\n/**\n * This function initializes a new instance of the Mixpanel tracking object.\n * All new instances are added to the main mixpanel object as sub properties (such as\n * mixpanel.library_name) and also returned by this function. To define a\n * second instance on the page, you would call:\n *\n * mixpanel.init('new token', { your: 'config' }, 'library_name');\n *\n * and use it like so:\n *\n * mixpanel.library_name.track(...);\n *\n * @param {String} token Your Mixpanel API token\n * @param {Object} [config] A dictionary of config options to override. See a list of default config options.\n * @param {String} [name] The name for the new mixpanel instance that you want created\n */\nMixpanelLib.prototype.init = function (token, config, name) {\n if (_.isUndefined(name)) {\n console.error('You must name your new library: init(token, config, name)');\n return;\n }\n if (name === PRIMARY_INSTANCE_NAME) {\n console.error('You must initialize the main mixpanel object right after you include the Mixpanel js snippet');\n return;\n }\n var instance = create_mplib(token, config, name);\n mixpanel_master[name] = instance;\n instance._loaded();\n return instance;\n};\n\n// mixpanel._init(token:string, config:object, name:string)\n//\n// This function sets up the current instance of the mixpanel\n// library. The difference between this method and the init(...)\n// method is this one initializes the actual instance, whereas the\n// init(...) method sets up a new library and calls _init on it.\n//\nMixpanelLib.prototype._init = function (token, config, name) {\n config = config || {};\n this['__loaded'] = true;\n this['config'] = {};\n this['_triggered_notifs'] = [];\n this.set_config(_.extend({}, DEFAULT_CONFIG, config, {\n 'name': name,\n 'token': token,\n 'callback_fn': (name === PRIMARY_INSTANCE_NAME ? name : PRIMARY_INSTANCE_NAME + '.' + name) + '._jsc'\n }));\n this['_jsc'] = NOOP_FUNC;\n this.__dom_loaded_queue = [];\n this.__request_queue = [];\n this.__disabled_events = [];\n this._flags = {\n 'disable_all_events': false,\n 'identify_called': false\n };\n\n // set up request queueing/batching\n this.request_batchers = {};\n this._batch_requests = this.get_config('batch_requests');\n if (this._batch_requests) {\n if (!_.localStorage.is_supported(true) || !USE_XHR) {\n this._batch_requests = false;\n console.log('Turning off Mixpanel request-queueing; needs XHR and localStorage support');\n } else {\n this.init_batchers();\n if (sendBeacon && window$1.addEventListener) {\n // Before page closes or hides (user tabs away etc), attempt to flush any events\n // queued up via navigator.sendBeacon. Since sendBeacon doesn't report success/failure,\n // events will not be removed from the persistent store; if the site is loaded again,\n // the events will be flushed again on startup and deduplicated on the Mixpanel server\n // side.\n // There is no reliable way to capture only page close events, so we lean on the\n // visibilitychange and pagehide events as recommended at\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event#usage_notes.\n // These events fire when the user clicks away from the current page/tab, so will occur\n // more frequently than page unload, but are the only mechanism currently for capturing\n // this scenario somewhat reliably.\n var flush_on_unload = _.bind(function () {\n if (!this.request_batchers.events.stopped) {\n this.request_batchers.events.flush({\n unloading: true\n });\n }\n }, this);\n window$1.addEventListener('pagehide', function (ev) {\n if (ev['persisted']) {\n flush_on_unload();\n }\n });\n window$1.addEventListener('visibilitychange', function () {\n if (document$1['visibilityState'] === 'hidden') {\n flush_on_unload();\n }\n });\n }\n }\n }\n this['persistence'] = this['cookie'] = new MixpanelPersistence(this['config']);\n this.unpersisted_superprops = {};\n this._gdpr_init();\n var uuid = _.UUID();\n if (!this.get_distinct_id()) {\n // There is no need to set the distinct id\n // or the device id if something was already stored\n // in the persitence\n this.register_once({\n 'distinct_id': uuid,\n '$device_id': uuid\n }, '');\n }\n};\n\n// Private methods\n\nMixpanelLib.prototype._loaded = function () {\n this.get_config('loaded')(this);\n this._set_default_superprops();\n};\n\n// update persistence with info on referrer, UTM params, etc\nMixpanelLib.prototype._set_default_superprops = function () {\n this['persistence'].update_search_keyword(document$1.referrer);\n if (this.get_config('store_google')) {\n this['persistence'].update_campaign_params();\n }\n if (this.get_config('save_referrer')) {\n this['persistence'].update_referrer_info(document$1.referrer);\n }\n};\nMixpanelLib.prototype._dom_loaded = function () {\n _.each(this.__dom_loaded_queue, function (item) {\n this._track_dom.apply(this, item);\n }, this);\n if (!this.has_opted_out_tracking()) {\n _.each(this.__request_queue, function (item) {\n this._send_request.apply(this, item);\n }, this);\n }\n delete this.__dom_loaded_queue;\n delete this.__request_queue;\n};\nMixpanelLib.prototype._track_dom = function (DomClass, args) {\n if (this.get_config('img')) {\n console.error('You can\\'t use DOM tracking functions with img = true.');\n return false;\n }\n if (!DOM_LOADED) {\n this.__dom_loaded_queue.push([DomClass, args]);\n return false;\n }\n var dt = new DomClass().init(this);\n return dt.track.apply(dt, args);\n};\n\n/**\n * _prepare_callback() should be called by callers of _send_request for use\n * as the callback argument.\n *\n * If there is no callback, this returns null.\n * If we are going to make XHR/XDR requests, this returns a function.\n * If we are going to use script tags, this returns a string to use as the\n * callback GET param.\n */\nMixpanelLib.prototype._prepare_callback = function (callback, data) {\n if (_.isUndefined(callback)) {\n return null;\n }\n if (USE_XHR) {\n var callback_function = function callback_function(response) {\n callback(response, data);\n };\n return callback_function;\n } else {\n // if the user gives us a callback, we store as a random\n // property on this instances jsc function and update our\n // callback string to reflect that.\n var jsc = this['_jsc'];\n var randomized_cb = '' + Math.floor(Math.random() * 100000000);\n var callback_string = this.get_config('callback_fn') + '[' + randomized_cb + ']';\n jsc[randomized_cb] = function (response) {\n delete jsc[randomized_cb];\n callback(response, data);\n };\n return callback_string;\n }\n};\nMixpanelLib.prototype._send_request = function (url, data, options, callback) {\n var succeeded = true;\n if (ENQUEUE_REQUESTS) {\n this.__request_queue.push(arguments);\n return succeeded;\n }\n var DEFAULT_OPTIONS = {\n method: this.get_config('api_method'),\n transport: this.get_config('api_transport'),\n verbose: this.get_config('verbose')\n };\n var body_data = null;\n if (!callback && (_.isFunction(options) || typeof options === 'string')) {\n callback = options;\n options = null;\n }\n options = _.extend(DEFAULT_OPTIONS, options || {});\n if (!USE_XHR) {\n options.method = 'GET';\n }\n var use_post = options.method === 'POST';\n var use_sendBeacon = sendBeacon && use_post && options.transport.toLowerCase() === 'sendbeacon';\n\n // needed to correctly format responses\n var verbose_mode = options.verbose;\n if (data['verbose']) {\n verbose_mode = true;\n }\n if (this.get_config('test')) {\n data['test'] = 1;\n }\n if (verbose_mode) {\n data['verbose'] = 1;\n }\n if (this.get_config('img')) {\n data['img'] = 1;\n }\n if (!USE_XHR) {\n if (callback) {\n data['callback'] = callback;\n } else if (verbose_mode || this.get_config('test')) {\n // Verbose output (from verbose mode, or an error in test mode) is a json blob,\n // which by itself is not valid javascript. Without a callback, this verbose output will\n // cause an error when returned via jsonp, so we force a no-op callback param.\n // See the ECMA script spec: http://www.ecma-international.org/ecma-262/5.1/#sec-12.4\n data['callback'] = '(function(){})';\n }\n }\n data['ip'] = this.get_config('ip') ? 1 : 0;\n data['_'] = new Date().getTime().toString();\n if (use_post) {\n body_data = 'data=' + encodeURIComponent(data['data']);\n delete data['data'];\n }\n url += '?' + _.HTTPBuildQuery(data);\n if ('img' in data) {\n var img = document$1.createElement('img');\n img.src = url;\n document$1.body.appendChild(img);\n } else if (use_sendBeacon) {\n try {\n succeeded = sendBeacon(url, body_data);\n } catch (e) {\n console.error(e);\n succeeded = false;\n }\n try {\n if (callback) {\n callback(succeeded ? 1 : 0);\n }\n } catch (e) {\n console.error(e);\n }\n } else if (USE_XHR) {\n try {\n var req = new XMLHttpRequest();\n req.open(options.method, url, true);\n var headers = this.get_config('xhr_headers');\n if (use_post) {\n headers['Content-Type'] = 'application/x-www-form-urlencoded';\n }\n _.each(headers, function (headerValue, headerName) {\n req.setRequestHeader(headerName, headerValue);\n });\n if (options.timeout_ms && typeof req.timeout !== 'undefined') {\n req.timeout = options.timeout_ms;\n var start_time = new Date().getTime();\n }\n\n // send the mp_optout cookie\n // withCredentials cannot be modified until after calling .open on Android and Mobile Safari\n req.withCredentials = true;\n req.onreadystatechange = function () {\n if (req.readyState === 4) {\n // XMLHttpRequest.DONE == 4, except in safari 4\n if (req.status === 200) {\n if (callback) {\n if (verbose_mode) {\n var response;\n try {\n response = _.JSONDecode(req.responseText);\n } catch (e) {\n console.error(e);\n if (options.ignore_json_errors) {\n response = req.responseText;\n } else {\n return;\n }\n }\n callback(response);\n } else {\n callback(Number(req.responseText));\n }\n }\n } else {\n var error;\n if (req.timeout && !req.status && new Date().getTime() - start_time >= req.timeout) {\n error = 'timeout';\n } else {\n error = 'Bad HTTP status: ' + req.status + ' ' + req.statusText;\n }\n console.error(error);\n if (callback) {\n if (verbose_mode) {\n callback({\n status: 0,\n error: error,\n xhr_req: req\n });\n } else {\n callback(0);\n }\n }\n }\n }\n };\n req.send(body_data);\n } catch (e) {\n console.error(e);\n succeeded = false;\n }\n } else {\n var script = document$1.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n var s = document$1.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(script, s);\n }\n return succeeded;\n};\n\n/**\n * _execute_array() deals with processing any mixpanel function\n * calls that were called before the Mixpanel library were loaded\n * (and are thus stored in an array so they can be called later)\n *\n * Note: we fire off all the mixpanel function calls && user defined\n * functions BEFORE we fire off mixpanel tracking calls. This is so\n * identify/register/set_config calls can properly modify early\n * tracking calls.\n *\n * @param {Array} array\n */\nMixpanelLib.prototype._execute_array = function (array) {\n var fn_name,\n alias_calls = [],\n other_calls = [],\n tracking_calls = [];\n _.each(array, function (item) {\n if (item) {\n fn_name = item[0];\n if (_.isArray(fn_name)) {\n tracking_calls.push(item); // chained call e.g. mixpanel.get_group().set()\n } else if (typeof item === 'function') {\n item.call(this);\n } else if (_.isArray(item) && fn_name === 'alias') {\n alias_calls.push(item);\n } else if (_.isArray(item) && fn_name.indexOf('track') !== -1 && typeof this[fn_name] === 'function') {\n tracking_calls.push(item);\n } else {\n other_calls.push(item);\n }\n }\n }, this);\n var execute = function execute(calls, context) {\n _.each(calls, function (item) {\n if (_.isArray(item[0])) {\n // chained call\n var caller = context;\n _.each(item, function (call) {\n caller = caller[call[0]].apply(caller, call.slice(1));\n });\n } else {\n this[item[0]].apply(this, item.slice(1));\n }\n }, context);\n };\n execute(alias_calls, this);\n execute(other_calls, this);\n execute(tracking_calls, this);\n};\n\n// request queueing utils\n\nMixpanelLib.prototype.are_batchers_initialized = function () {\n return !!this.request_batchers.events;\n};\nMixpanelLib.prototype.init_batchers = function () {\n var token = this.get_config('token');\n if (!this.are_batchers_initialized()) {\n var batcher_for = _.bind(function (attrs) {\n return new RequestBatcher('__mpq_' + token + attrs.queue_suffix, {\n libConfig: this['config'],\n sendRequestFunc: _.bind(function (data, options, cb) {\n this._send_request(this.get_config('api_host') + attrs.endpoint, encode_data_for_request(data), options, this._prepare_callback(cb, data));\n }, this),\n beforeSendHook: _.bind(function (item) {\n return this._run_hook('before_send_' + attrs.type, item);\n }, this)\n });\n }, this);\n this.request_batchers = {\n events: batcher_for({\n type: 'events',\n endpoint: '/track/',\n queue_suffix: '_ev'\n }),\n people: batcher_for({\n type: 'people',\n endpoint: '/engage/',\n queue_suffix: '_pp'\n }),\n groups: batcher_for({\n type: 'groups',\n endpoint: '/groups/',\n queue_suffix: '_gr'\n })\n };\n }\n if (this.get_config('batch_autostart')) {\n this.start_batch_senders();\n }\n};\nMixpanelLib.prototype.start_batch_senders = function () {\n if (this.are_batchers_initialized()) {\n this._batch_requests = true;\n _.each(this.request_batchers, function (batcher) {\n batcher.start();\n });\n }\n};\nMixpanelLib.prototype.stop_batch_senders = function () {\n this._batch_requests = false;\n _.each(this.request_batchers, function (batcher) {\n batcher.stop();\n batcher.clear();\n });\n};\n\n/**\n * push() keeps the standard async-array-push\n * behavior around after the lib is loaded.\n * This is only useful for external integrations that\n * do not wish to rely on our convenience methods\n * (created in the snippet).\n *\n * ### Usage:\n * mixpanel.push(['register', { a: 'b' }]);\n *\n * @param {Array} item A [function_name, args...] array to be executed\n */\nMixpanelLib.prototype.push = function (item) {\n this._execute_array([item]);\n};\n\n/**\n * Disable events on the Mixpanel object. If passed no arguments,\n * this function disables tracking of any event. If passed an\n * array of event names, those events will be disabled, but other\n * events will continue to be tracked.\n *\n * Note: this function does not stop other mixpanel functions from\n * firing, such as register() or people.set().\n *\n * @param {Array} [events] An array of event names to disable\n */\nMixpanelLib.prototype.disable = function (events) {\n if (typeof events === 'undefined') {\n this._flags.disable_all_events = true;\n } else {\n this.__disabled_events = this.__disabled_events.concat(events);\n }\n};\n\n// internal method for handling track vs batch-enqueue logic\nMixpanelLib.prototype._track_or_batch = function (options, callback) {\n var truncated_data = _.truncate(options.data, 255);\n var endpoint = options.endpoint;\n var batcher = options.batcher;\n var should_send_immediately = options.should_send_immediately;\n var send_request_options = options.send_request_options || {};\n callback = callback || NOOP_FUNC;\n var request_enqueued_or_initiated = true;\n var send_request_immediately = _.bind(function () {\n if (!send_request_options.skip_hooks) {\n truncated_data = this._run_hook('before_send_' + options.type, truncated_data);\n }\n if (truncated_data) {\n console.log('MIXPANEL REQUEST:');\n console.log(truncated_data);\n return this._send_request(endpoint, encode_data_for_request(truncated_data), send_request_options, this._prepare_callback(callback, truncated_data));\n } else {\n return null;\n }\n }, this);\n if (this._batch_requests && !should_send_immediately) {\n batcher.enqueue(truncated_data, function (succeeded) {\n if (succeeded) {\n callback(1, truncated_data);\n } else {\n send_request_immediately();\n }\n });\n } else {\n request_enqueued_or_initiated = send_request_immediately();\n }\n return request_enqueued_or_initiated && truncated_data;\n};\n\n/**\n * Track an event. This is the most important and\n * frequently used Mixpanel function.\n *\n * ### Usage:\n *\n * // track an event named 'Registered'\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * // track an event using navigator.sendBeacon\n * mixpanel.track('Left page', {'duration_seconds': 35}, {transport: 'sendBeacon'});\n *\n * To track link clicks or form submissions, see track_links() or track_forms().\n *\n * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc.\n * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself.\n * @param {Object} [options] Optional configuration for this track request.\n * @param {String} [options.transport] Transport method for network request ('xhr' or 'sendBeacon').\n * @param {Boolean} [options.send_immediately] Whether to bypass batching/queueing and send track request immediately.\n * @param {Function} [callback] If provided, the callback function will be called after tracking the event.\n * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object\n * with the tracking payload sent to the API server is returned; otherwise false.\n */\nMixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function (event_name, properties, options, callback) {\n if (!callback && typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n var transport = options['transport']; // external API, don't minify 'transport' prop\n if (transport) {\n options.transport = transport; // 'transport' prop name can be minified internally\n }\n\n var should_send_immediately = options['send_immediately'];\n if (typeof callback !== 'function') {\n callback = NOOP_FUNC;\n }\n if (_.isUndefined(event_name)) {\n console.error('No event name provided to mixpanel.track');\n return;\n }\n if (this._event_is_disabled(event_name)) {\n callback(0);\n return;\n }\n\n // set defaults\n properties = properties || {};\n properties['token'] = this.get_config('token');\n\n // set $duration if time_event was previously called for this event\n var start_timestamp = this['persistence'].remove_event_timer(event_name);\n if (!_.isUndefined(start_timestamp)) {\n var duration_in_ms = new Date().getTime() - start_timestamp;\n properties['$duration'] = parseFloat((duration_in_ms / 1000).toFixed(3));\n }\n this._set_default_superprops();\n\n // note: extend writes to the first object, so lets make sure we\n // don't write to the persistence properties object and info\n // properties object by passing in a new object\n\n // update properties with pageview info and super-properties\n properties = _.extend({}, _.info.properties(), this['persistence'].properties(), this.unpersisted_superprops, properties);\n var property_blacklist = this.get_config('property_blacklist');\n if (_.isArray(property_blacklist)) {\n _.each(property_blacklist, function (blacklisted_prop) {\n delete properties[blacklisted_prop];\n });\n } else {\n console.error('Invalid value for property_blacklist config: ' + property_blacklist);\n }\n var data = {\n 'event': event_name,\n 'properties': properties\n };\n var ret = this._track_or_batch({\n type: 'events',\n data: data,\n endpoint: this.get_config('api_host') + '/track/',\n batcher: this.request_batchers.events,\n should_send_immediately: should_send_immediately,\n send_request_options: options\n }, callback);\n this._check_and_handle_triggered_notifications(data);\n return ret;\n});\n\n/**\n * Register the current user into one/many groups.\n *\n * ### Usage:\n *\n * mixpanel.set_group('company', ['mixpanel', 'google']) // an array of IDs\n * mixpanel.set_group('company', 'mixpanel')\n * mixpanel.set_group('company', 128746312)\n *\n * @param {String} group_key Group key\n * @param {Array|String|Number} group_ids An array of group IDs, or a singular group ID\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n *\n */\nMixpanelLib.prototype.set_group = addOptOutCheckMixpanelLib(function (group_key, group_ids, callback) {\n if (!_.isArray(group_ids)) {\n group_ids = [group_ids];\n }\n var prop = {};\n prop[group_key] = group_ids;\n this.register(prop);\n return this['people'].set(group_key, group_ids, callback);\n});\n\n/**\n * Add a new group for this user.\n *\n * ### Usage:\n *\n * mixpanel.add_group('company', 'mixpanel')\n *\n * @param {String} group_key Group key\n * @param {*} group_id A valid Mixpanel property type\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.add_group = addOptOutCheckMixpanelLib(function (group_key, group_id, callback) {\n var old_values = this.get_property(group_key);\n if (old_values === undefined) {\n var prop = {};\n prop[group_key] = [group_id];\n this.register(prop);\n } else {\n if (old_values.indexOf(group_id) === -1) {\n old_values.push(group_id);\n this.register(prop);\n }\n }\n return this['people'].union(group_key, group_id, callback);\n});\n\n/**\n * Remove a group from this user.\n *\n * ### Usage:\n *\n * mixpanel.remove_group('company', 'mixpanel')\n *\n * @param {String} group_key Group key\n * @param {*} group_id A valid Mixpanel property type\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.remove_group = addOptOutCheckMixpanelLib(function (group_key, group_id, callback) {\n var old_value = this.get_property(group_key);\n // if the value doesn't exist, the persistent store is unchanged\n if (old_value !== undefined) {\n var idx = old_value.indexOf(group_id);\n if (idx > -1) {\n old_value.splice(idx, 1);\n this.register({\n group_key: old_value\n });\n }\n if (old_value.length === 0) {\n this.unregister(group_key);\n }\n }\n return this['people'].remove(group_key, group_id, callback);\n});\n\n/**\n * Track an event with specific groups.\n *\n * ### Usage:\n *\n * mixpanel.track_with_groups('purchase', {'product': 'iphone'}, {'University': ['UCB', 'UCLA']})\n *\n * @param {String} event_name The name of the event (see `mixpanel.track()`)\n * @param {Object=} properties A set of properties to include with the event you're sending (see `mixpanel.track()`)\n * @param {Object=} groups An object mapping group name keys to one or more values\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.track_with_groups = addOptOutCheckMixpanelLib(function (event_name, properties, groups, callback) {\n var tracking_props = _.extend({}, properties || {});\n _.each(groups, function (v, k) {\n if (v !== null && v !== undefined) {\n tracking_props[k] = v;\n }\n });\n return this.track(event_name, tracking_props, callback);\n});\nMixpanelLib.prototype._create_map_key = function (group_key, group_id) {\n return group_key + '_' + JSON.stringify(group_id);\n};\nMixpanelLib.prototype._remove_group_from_cache = function (group_key, group_id) {\n delete this._cached_groups[this._create_map_key(group_key, group_id)];\n};\n\n/**\n * Look up reference to a Mixpanel group\n *\n * ### Usage:\n *\n * mixpanel.get_group(group_key, group_id)\n *\n * @param {String} group_key Group key\n * @param {Object} group_id A valid Mixpanel property type\n * @returns {Object} A MixpanelGroup identifier\n */\nMixpanelLib.prototype.get_group = function (group_key, group_id) {\n var map_key = this._create_map_key(group_key, group_id);\n var group = this._cached_groups[map_key];\n if (group === undefined || group._group_key !== group_key || group._group_id !== group_id) {\n group = new MixpanelGroup();\n group._init(this, group_key, group_id);\n this._cached_groups[map_key] = group;\n }\n return group;\n};\n\n/**\n * Track mp_page_view event. This is now ignored by the server.\n *\n * @param {String} [page] The url of the page to record. If you don't include this, it defaults to the current url.\n * @deprecated\n */\nMixpanelLib.prototype.track_pageview = function (page) {\n if (_.isUndefined(page)) {\n page = document$1.location.href;\n }\n this.track('mp_page_view', _.info.pageviewInfo(page));\n};\n\n/**\n * Track clicks on a set of document elements. Selector must be a\n * valid query. Elements must exist on the page at the time track_links is called.\n *\n * ### Usage:\n *\n * // track click for link id #nav\n * mixpanel.track_links('#nav', 'Clicked Nav Link');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the Mixpanel\n * servers to respond. If they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] A properties object or function that returns a dictionary of properties when passed a DOMElement\n */\nMixpanelLib.prototype.track_links = function () {\n return this._track_dom.call(this, LinkTracker, arguments);\n};\n\n/**\n * Track form submissions. Selector must be a valid query.\n *\n * ### Usage:\n *\n * // track submission for form id 'register'\n * mixpanel.track_forms('#register', 'Created Account');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the mixpanel\n * servers to respond, if they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] This can be a set of properties, or a function that returns a set of properties after being passed a DOMElement\n */\nMixpanelLib.prototype.track_forms = function () {\n return this._track_dom.call(this, FormTracker, arguments);\n};\n\n/**\n * Time an event by including the time between this call and a\n * later 'track' call for the same event in the properties sent\n * with the event.\n *\n * ### Usage:\n *\n * // time an event named 'Registered'\n * mixpanel.time_event('Registered');\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * When called for a particular event name, the next track call for that event\n * name will include the elapsed time between the 'time_event' and 'track'\n * calls. This value is stored as seconds in the '$duration' property.\n *\n * @param {String} event_name The name of the event.\n */\nMixpanelLib.prototype.time_event = function (event_name) {\n if (_.isUndefined(event_name)) {\n console.error('No event name provided to mixpanel.time_event');\n return;\n }\n if (this._event_is_disabled(event_name)) {\n return;\n }\n this['persistence'].set_event_timer(event_name, new Date().getTime());\n};\nvar REGISTER_DEFAULTS = {\n 'persistent': true\n};\n/**\n * Helper to parse options param for register methods, maintaining\n * legacy support for plain \"days\" param instead of options object\n * @param {Number|Object} [days_or_options] 'days' option (Number), or Options object for register methods\n * @returns {Object} options object\n */\nvar options_for_register = function options_for_register(days_or_options) {\n var options;\n if (_.isObject(days_or_options)) {\n options = days_or_options;\n } else if (!_.isUndefined(days_or_options)) {\n options = {\n 'days': days_or_options\n };\n } else {\n options = {};\n }\n return _.extend({}, REGISTER_DEFAULTS, options);\n};\n\n/**\n * Register a set of super properties, which are included with all\n * events. This will overwrite previous super property values.\n *\n * ### Usage:\n *\n * // register 'Gender' as a super property\n * mixpanel.register({'Gender': 'Female'});\n *\n * // register several super properties when a user signs up\n * mixpanel.register({\n * 'Email': 'jdoe@example.com',\n * 'Account Type': 'Free'\n * });\n *\n * // register only for the current pageload\n * mixpanel.register({'Name': 'Pat'}, {persistent: false});\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {Number|Object} [days_or_options] Options object or number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.days] - number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.persistent=true] - whether to put in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.register = function (props, days_or_options) {\n var options = options_for_register(days_or_options);\n if (options['persistent']) {\n this['persistence'].register(props, options['days']);\n } else {\n _.extend(this.unpersisted_superprops, props);\n }\n};\n\n/**\n * Register a set of super properties only once. This will not\n * overwrite previous super property values, unlike register().\n *\n * ### Usage:\n *\n * // register a super property for the first time only\n * mixpanel.register_once({\n * 'First Login Date': new Date().toISOString()\n * });\n *\n * // register once, only for the current pageload\n * mixpanel.register_once({\n * 'First interaction time': new Date().toISOString()\n * }, 'None', {persistent: false});\n *\n * ### Notes:\n *\n * If default_value is specified, current super properties\n * with that value will be overwritten.\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {*} [default_value] Value to override if already set in super properties (ex: 'False') Default: 'None'\n * @param {Number|Object} [days_or_options] Options object or number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.days] - number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.persistent=true] - whether to put in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.register_once = function (props, default_value, days_or_options) {\n var options = options_for_register(days_or_options);\n if (options['persistent']) {\n this['persistence'].register_once(props, default_value, options['days']);\n } else {\n if (typeof default_value === 'undefined') {\n default_value = 'None';\n }\n _.each(props, function (val, prop) {\n if (!this.unpersisted_superprops.hasOwnProperty(prop) || this.unpersisted_superprops[prop] === default_value) {\n this.unpersisted_superprops[prop] = val;\n }\n }, this);\n }\n};\n\n/**\n * Delete a super property stored with the current user.\n *\n * @param {String} property The name of the super property to remove\n * @param {Object} [options]\n * @param {boolean} [options.persistent=true] - whether to look in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.unregister = function (property, options) {\n options = options_for_register(options);\n if (options['persistent']) {\n this['persistence'].unregister(property);\n } else {\n delete this.unpersisted_superprops[property];\n }\n};\nMixpanelLib.prototype._register_single = function (prop, value) {\n var props = {};\n props[prop] = value;\n this.register(props);\n};\n\n/**\n * Identify a user with a unique ID to track user activity across\n * devices, tie a user to their events, and create a user profile.\n * If you never call this method, unique visitors are tracked using\n * a UUID generated the first time they visit the site.\n *\n * Call identify when you know the identity of the current user,\n * typically after login or signup. We recommend against using\n * identify for anonymous visitors to your site.\n *\n * ### Notes:\n * If your project has\n * ID Merge\n * enabled, the identify method will connect pre- and\n * post-authentication events when appropriate.\n *\n * If your project does not have ID Merge enabled, identify will\n * change the user's local distinct_id to the unique ID you pass.\n * Events tracked prior to authentication will not be connected\n * to the same user identity. If ID Merge is disabled, alias can\n * be used to connect pre- and post-registration events.\n *\n * @param {String} [unique_id] A string that uniquely identifies a user. If not provided, the distinct_id currently in the persistent store (cookie or localStorage) will be used.\n */\nMixpanelLib.prototype.identify = function (new_distinct_id, _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback) {\n // Optional Parameters\n // _set_callback:function A callback to be run if and when the People set queue is flushed\n // _add_callback:function A callback to be run if and when the People add queue is flushed\n // _append_callback:function A callback to be run if and when the People append queue is flushed\n // _set_once_callback:function A callback to be run if and when the People set_once queue is flushed\n // _union_callback:function A callback to be run if and when the People union queue is flushed\n // _unset_callback:function A callback to be run if and when the People unset queue is flushed\n\n var previous_distinct_id = this.get_distinct_id();\n this.register({\n '$user_id': new_distinct_id\n });\n if (!this.get_property('$device_id')) {\n // The persisted distinct id might not actually be a device id at all\n // it might be a distinct id of the user from before\n var device_id = previous_distinct_id;\n this.register_once({\n '$had_persisted_distinct_id': true,\n '$device_id': device_id\n }, '');\n }\n\n // identify only changes the distinct id if it doesn't match either the existing or the alias;\n // if it's new, blow away the alias as well.\n if (new_distinct_id !== previous_distinct_id && new_distinct_id !== this.get_property(ALIAS_ID_KEY)) {\n this.unregister(ALIAS_ID_KEY);\n this.register({\n 'distinct_id': new_distinct_id\n });\n }\n this._check_and_handle_notifications(this.get_distinct_id());\n this._flags.identify_called = true;\n // Flush any queued up people requests\n this['people']._flush(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback);\n\n // send an $identify event any time the distinct_id is changing - logic on the server\n // will determine whether or not to do anything with it.\n if (new_distinct_id !== previous_distinct_id) {\n this.track('$identify', {\n 'distinct_id': new_distinct_id,\n '$anon_distinct_id': previous_distinct_id\n }, {\n skip_hooks: true\n });\n }\n};\n\n/**\n * Clears super properties and generates a new random distinct_id for this instance.\n * Useful for clearing data when a user logs out.\n */\nMixpanelLib.prototype.reset = function () {\n this['persistence'].clear();\n this._flags.identify_called = false;\n var uuid = _.UUID();\n this.register_once({\n 'distinct_id': uuid,\n '$device_id': uuid\n }, '');\n};\n\n/**\n * Returns the current distinct id of the user. This is either the id automatically\n * generated by the library or the id that has been passed by a call to identify().\n *\n * ### Notes:\n *\n * get_distinct_id() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // set distinct_id after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * distinct_id = mixpanel.get_distinct_id();\n * }\n * });\n */\nMixpanelLib.prototype.get_distinct_id = function () {\n return this.get_property('distinct_id');\n};\n\n/**\n * The alias method creates an alias which Mixpanel will use to\n * remap one id to another. Multiple aliases can point to the\n * same identifier.\n *\n * The following is a valid use of alias:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // You can add multiple id aliases to the existing ID\n * mixpanel.alias('newer_id', 'existing_id');\n *\n * Aliases can also be chained - the following is a valid example:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // chain newer_id - new_id - existing_id\n * mixpanel.alias('newer_id', 'new_id');\n *\n * Aliases cannot point to multiple identifiers - the following\n * example will not work:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // this is invalid as 'new_id' already points to 'existing_id'\n * mixpanel.alias('new_id', 'newer_id');\n *\n * ### Notes:\n *\n * If your project does not have\n * ID Merge\n * enabled, the best practice is to call alias once when a unique\n * ID is first created for a user (e.g., when a user first registers\n * for an account). Do not use alias multiple times for a single\n * user without ID Merge enabled.\n *\n * @param {String} alias A unique identifier that you want to use for this user in the future.\n * @param {String} [original] The current identifier being used for this user.\n */\nMixpanelLib.prototype.alias = function (alias, original) {\n // If the $people_distinct_id key exists in persistence, there has been a previous\n // mixpanel.people.identify() call made for this user. It is VERY BAD to make an alias with\n // this ID, as it will duplicate users.\n if (alias === this.get_property(PEOPLE_DISTINCT_ID_KEY)) {\n console.critical('Attempting to create alias for existing People user - aborting.');\n return -2;\n }\n var _this = this;\n if (_.isUndefined(original)) {\n original = this.get_distinct_id();\n }\n if (alias !== original) {\n this._register_single(ALIAS_ID_KEY, alias);\n return this.track('$create_alias', {\n 'alias': alias,\n 'distinct_id': original\n }, {\n skip_hooks: true\n }, function () {\n // Flush the people queue\n _this.identify(alias);\n });\n } else {\n console.error('alias matches current distinct_id - skipping api call.');\n this.identify(alias);\n return -1;\n }\n};\n\n/**\n * Provide a string to recognize the user by. The string passed to\n * this method will appear in the Mixpanel Streams product rather\n * than an automatically generated name. Name tags do not have to\n * be unique.\n *\n * This value will only be included in Streams data.\n *\n * @param {String} name_tag A human readable name for the user\n * @deprecated\n */\nMixpanelLib.prototype.name_tag = function (name_tag) {\n this._register_single('mp_name_tag', name_tag);\n};\n\n/**\n * Update the configuration of a mixpanel library instance.\n *\n * The default config is:\n *\n * {\n * // HTTP method for tracking requests\n * api_method: 'POST'\n *\n * // transport for sending requests ('XHR' or 'sendBeacon')\n * // NB: sendBeacon should only be used for scenarios such as\n * // page unload where a \"best-effort\" attempt to send is\n * // acceptable; the sendBeacon API does not support callbacks\n * // or any way to know the result of the request. Mixpanel\n * // tracking via sendBeacon will not support any event-\n * // batching or retry mechanisms.\n * api_transport: 'XHR'\n *\n * // turn on request-batching/queueing/retry\n * batch_requests: false,\n *\n * // maximum number of events/updates to send in a single\n * // network request\n * batch_size: 50,\n *\n * // milliseconds to wait between sending batch requests\n * batch_flush_interval_ms: 5000,\n *\n * // milliseconds to wait for network responses to batch requests\n * // before they are considered timed-out and retried\n * batch_request_timeout_ms: 90000,\n *\n * // override value for cookie domain, only useful for ensuring\n * // correct cross-subdomain cookies on unusual domains like\n * // subdomain.mainsite.avocat.fr; NB this cannot be used to\n * // set cookies on a different domain than the current origin\n * cookie_domain: ''\n *\n * // super properties cookie expiration (in days)\n * cookie_expiration: 365\n *\n * // if true, cookie will be set with SameSite=None; Secure\n * // this is only useful in special situations, like embedded\n * // 3rd-party iframes that set up a Mixpanel instance\n * cross_site_cookie: false\n *\n * // super properties span subdomains\n * cross_subdomain_cookie: true\n *\n * // debug mode\n * debug: false\n *\n * // if this is true, the mixpanel cookie or localStorage entry\n * // will be deleted, and no user persistence will take place\n * disable_persistence: false\n *\n * // if this is true, Mixpanel will automatically determine\n * // City, Region and Country data using the IP address of\n * //the client\n * ip: true\n *\n * // opt users out of tracking by this Mixpanel instance by default\n * opt_out_tracking_by_default: false\n *\n * // opt users out of browser data storage by this Mixpanel instance by default\n * opt_out_persistence_by_default: false\n *\n * // persistence mechanism used by opt-in/opt-out methods - cookie\n * // or localStorage - falls back to cookie if localStorage is unavailable\n * opt_out_tracking_persistence_type: 'localStorage'\n *\n * // customize the name of cookie/localStorage set by opt-in/opt-out methods\n * opt_out_tracking_cookie_prefix: null\n *\n * // type of persistent store for super properties (cookie/\n * // localStorage) if set to 'localStorage', any existing\n * // mixpanel cookie value with the same persistence_name\n * // will be transferred to localStorage and deleted\n * persistence: 'cookie'\n *\n * // name for super properties persistent store\n * persistence_name: ''\n *\n * // names of properties/superproperties which should never\n * // be sent with track() calls\n * property_blacklist: []\n *\n * // if this is true, mixpanel cookies will be marked as\n * // secure, meaning they will only be transmitted over https\n * secure_cookie: false\n *\n * // the amount of time track_links will\n * // wait for Mixpanel's servers to respond\n * track_links_timeout: 300\n *\n * // if you set upgrade to be true, the library will check for\n * // a cookie from our old js library and import super\n * // properties from it, then the old cookie is deleted\n * // The upgrade config option only works in the initialization,\n * // so make sure you set it when you create the library.\n * upgrade: false\n *\n * // extra HTTP request headers to set for each API request, in\n * // the format {'Header-Name': value}\n * xhr_headers: {}\n *\n * // protocol for fetching in-app message resources, e.g.\n * // 'https://' or 'http://'; defaults to '//' (which defers to the\n * // current page's protocol)\n * inapp_protocol: '//'\n *\n * // whether to open in-app message link in new tab/window\n * inapp_link_new_window: false\n *\n * // whether to ignore or respect the web browser's Do Not Track setting\n * ignore_dnt: false\n * }\n *\n *\n * @param {Object} config A dictionary of new configuration values to update\n */\nMixpanelLib.prototype.set_config = function (config) {\n if (_.isObject(config)) {\n _.extend(this['config'], config);\n var new_batch_size = config['batch_size'];\n if (new_batch_size) {\n _.each(this.request_batchers, function (batcher) {\n batcher.resetBatchSize();\n });\n }\n if (!this.get_config('persistence_name')) {\n this['config']['persistence_name'] = this['config']['cookie_name'];\n }\n if (!this.get_config('disable_persistence')) {\n this['config']['disable_persistence'] = this['config']['disable_cookie'];\n }\n if (this['persistence']) {\n this['persistence'].update_config(this['config']);\n }\n Config.DEBUG = Config.DEBUG || this.get_config('debug');\n }\n};\n\n/**\n * returns the current config object for the library.\n */\nMixpanelLib.prototype.get_config = function (prop_name) {\n return this['config'][prop_name];\n};\n\n/**\n * Fetch a hook function from config, with safe default, and run it\n * against the given arguments\n * @param {string} hook_name which hook to retrieve\n * @returns {any|null} return value of user-provided hook, or null if nothing was returned\n */\nMixpanelLib.prototype._run_hook = function (hook_name) {\n var ret = (this['config']['hooks'][hook_name] || IDENTITY_FUNC).apply(this, slice.call(arguments, 1));\n if (typeof ret === 'undefined') {\n console.error(hook_name + ' hook did not return a value');\n ret = null;\n }\n return ret;\n};\n\n/**\n * Returns the value of the super property named property_name. If no such\n * property is set, get_property() will return the undefined value.\n *\n * ### Notes:\n *\n * get_property() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // grab value for 'user_id' after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * user_id = mixpanel.get_property('user_id');\n * }\n * });\n *\n * @param {String} property_name The name of the super property you want to retrieve\n */\nMixpanelLib.prototype.get_property = function (property_name) {\n return this['persistence']['props'][property_name];\n};\nMixpanelLib.prototype.toString = function () {\n var name = this.get_config('name');\n if (name !== PRIMARY_INSTANCE_NAME) {\n name = PRIMARY_INSTANCE_NAME + '.' + name;\n }\n return name;\n};\nMixpanelLib.prototype._event_is_disabled = function (event_name) {\n return _.isBlockedUA(userAgent) || this._flags.disable_all_events || _.include(this.__disabled_events, event_name);\n};\nMixpanelLib.prototype._check_and_handle_triggered_notifications = addOptOutCheckMixpanelLib(function (event_data) {\n if (!this._user_decide_check_complete) {\n this._events_tracked_before_user_decide_check_complete.push(event_data);\n } else {\n var arr = this['_triggered_notifs'];\n for (var i = 0; i < arr.length; i++) {\n var notif = new MixpanelNotification(arr[i], this);\n if (notif._matches_event_data(event_data)) {\n this._show_notification(arr[i]);\n return;\n }\n }\n }\n});\nMixpanelLib.prototype._check_and_handle_notifications = addOptOutCheckMixpanelLib(function (distinct_id) {\n if (!distinct_id || this._flags.identify_called || this.get_config('disable_notifications')) {\n return;\n }\n console.log('MIXPANEL NOTIFICATION CHECK');\n var data = {\n 'verbose': true,\n 'version': '3',\n 'lib': 'web',\n 'token': this.get_config('token'),\n 'distinct_id': distinct_id\n };\n this._send_request(this.get_config('api_host') + '/decide/', data, {\n method: 'GET',\n transport: 'XHR'\n }, this._prepare_callback(_.bind(function (result) {\n if (result['notifications'] && result['notifications'].length > 0) {\n this['_triggered_notifs'] = [];\n var notifications = [];\n _.each(result['notifications'], function (notif) {\n (notif['display_triggers'] && notif['display_triggers'].length > 0 ? this['_triggered_notifs'] : notifications).push(notif);\n }, this);\n if (notifications.length > 0) {\n this._show_notification.call(this, notifications[0]);\n }\n }\n this._handle_user_decide_check_complete();\n }, this)));\n});\nMixpanelLib.prototype._handle_user_decide_check_complete = function () {\n this._user_decide_check_complete = true;\n\n // check notifications against events that were tracked before decide call completed\n var events = this._events_tracked_before_user_decide_check_complete;\n while (events.length > 0) {\n var data = events.shift(); // replay in the same order they came in\n this._check_and_handle_triggered_notifications(data);\n }\n};\nMixpanelLib.prototype._show_notification = function (notif_data) {\n var notification = new MixpanelNotification(notif_data, this);\n notification.show();\n};\n\n// perform some housekeeping around GDPR opt-in/out state\nMixpanelLib.prototype._gdpr_init = function () {\n var is_localStorage_requested = this.get_config('opt_out_tracking_persistence_type') === 'localStorage';\n\n // try to convert opt-in/out cookies to localStorage if possible\n if (is_localStorage_requested && _.localStorage.is_supported()) {\n if (!this.has_opted_in_tracking() && this.has_opted_in_tracking({\n 'persistence_type': 'cookie'\n })) {\n this.opt_in_tracking({\n 'enable_persistence': false\n });\n }\n if (!this.has_opted_out_tracking() && this.has_opted_out_tracking({\n 'persistence_type': 'cookie'\n })) {\n this.opt_out_tracking({\n 'clear_persistence': false\n });\n }\n this.clear_opt_in_out_tracking({\n 'persistence_type': 'cookie',\n 'enable_persistence': false\n });\n }\n\n // check whether the user has already opted out - if so, clear & disable persistence\n if (this.has_opted_out_tracking()) {\n this._gdpr_update_persistence({\n 'clear_persistence': true\n });\n\n // check whether we should opt out by default\n // note: we don't clear persistence here by default since opt-out default state is often\n // used as an initial state while GDPR information is being collected\n } else if (!this.has_opted_in_tracking() && (this.get_config('opt_out_tracking_by_default') || _.cookie.get('mp_optout'))) {\n _.cookie.remove('mp_optout');\n this.opt_out_tracking({\n 'clear_persistence': this.get_config('opt_out_persistence_by_default')\n });\n }\n};\n\n/**\n * Enable or disable persistence based on options\n * only enable/disable if persistence is not already in this state\n * @param {boolean} [options.clear_persistence] If true, will delete all data stored by the sdk in persistence and disable it\n * @param {boolean} [options.enable_persistence] If true, will re-enable sdk persistence\n */\nMixpanelLib.prototype._gdpr_update_persistence = function (options) {\n var disabled;\n if (options && options['clear_persistence']) {\n disabled = true;\n } else if (options && options['enable_persistence']) {\n disabled = false;\n } else {\n return;\n }\n if (!this.get_config('disable_persistence') && this['persistence'].disabled !== disabled) {\n this['persistence'].set_disabled(disabled);\n }\n if (disabled) {\n _.each(this.request_batchers, function (batcher) {\n batcher.clear();\n });\n }\n};\n\n// call a base gdpr function after constructing the appropriate token and options args\nMixpanelLib.prototype._gdpr_call_func = function (func, options) {\n options = _.extend({\n 'track': _.bind(this.track, this),\n 'persistence_type': this.get_config('opt_out_tracking_persistence_type'),\n 'cookie_prefix': this.get_config('opt_out_tracking_cookie_prefix'),\n 'cookie_expiration': this.get_config('cookie_expiration'),\n 'cross_site_cookie': this.get_config('cross_site_cookie'),\n 'cross_subdomain_cookie': this.get_config('cross_subdomain_cookie'),\n 'cookie_domain': this.get_config('cookie_domain'),\n 'secure_cookie': this.get_config('secure_cookie'),\n 'ignore_dnt': this.get_config('ignore_dnt')\n }, options);\n\n // check if localStorage can be used for recording opt out status, fall back to cookie if not\n if (!_.localStorage.is_supported()) {\n options['persistence_type'] = 'cookie';\n }\n return func(this.get_config('token'), {\n track: options['track'],\n trackEventName: options['track_event_name'],\n trackProperties: options['track_properties'],\n persistenceType: options['persistence_type'],\n persistencePrefix: options['cookie_prefix'],\n cookieDomain: options['cookie_domain'],\n cookieExpiration: options['cookie_expiration'],\n crossSiteCookie: options['cross_site_cookie'],\n crossSubdomainCookie: options['cross_subdomain_cookie'],\n secureCookie: options['secure_cookie'],\n ignoreDnt: options['ignore_dnt']\n });\n};\n\n/**\n * Opt the user in to data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * // opt user in\n * mixpanel.opt_in_tracking();\n *\n * // opt user in with specific event name, properties, cookie configuration\n * mixpanel.opt_in_tracking({\n * track_event_name: 'User opted in',\n * track_event_properties: {\n * 'Email': 'jdoe@example.com'\n * },\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {function} [options.track] Function used for tracking a Mixpanel event to record the opt-in action (default is this Mixpanel instance's track method)\n * @param {string} [options.track_event_name=$opt_in] Event name to be used for tracking the opt-in action\n * @param {Object} [options.track_properties] Set of properties to be tracked along with the opt-in action\n * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.opt_in_tracking = function (options) {\n options = _.extend({\n 'enable_persistence': true\n }, options);\n this._gdpr_call_func(optIn, options);\n this._gdpr_update_persistence(options);\n};\n\n/**\n * Opt the user out of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * // opt user out\n * mixpanel.opt_out_tracking();\n *\n * // opt user out with different cookie configuration from Mixpanel instance\n * mixpanel.opt_out_tracking({\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {boolean} [options.delete_user=true] If true, will delete the currently identified user's profile and clear all charges after opting the user out\n * @param {boolean} [options.clear_persistence=true] If true, will delete all data stored by the sdk in persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.opt_out_tracking = function (options) {\n options = _.extend({\n 'clear_persistence': true,\n 'delete_user': true\n }, options);\n\n // delete user and clear charges since these methods may be disabled by opt-out\n if (options['delete_user'] && this['people'] && this['people']._identify_called()) {\n this['people'].delete_user();\n this['people'].clear_charges();\n }\n this._gdpr_call_func(optOut, options);\n this._gdpr_update_persistence(options);\n};\n\n/**\n * Check whether the user has opted in to data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * var has_opted_in = mixpanel.has_opted_in_tracking();\n * // use has_opted_in value\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} current opt-in status\n */\nMixpanelLib.prototype.has_opted_in_tracking = function (options) {\n return this._gdpr_call_func(hasOptedIn, options);\n};\n\n/**\n * Check whether the user has opted out of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * var has_opted_out = mixpanel.has_opted_out_tracking();\n * // use has_opted_out value\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} current opt-out status\n */\nMixpanelLib.prototype.has_opted_out_tracking = function (options) {\n return this._gdpr_call_func(hasOptedOut, options);\n};\n\n/**\n * Clear the user's opt in/out status of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * // clear user's opt-in/out status\n * mixpanel.clear_opt_in_out_tracking();\n *\n * // clear user's opt-in/out status with specific cookie configuration - should match\n * // configuration used when opt_in_tracking/opt_out_tracking methods were called.\n * mixpanel.clear_opt_in_out_tracking({\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.clear_opt_in_out_tracking = function (options) {\n options = _.extend({\n 'enable_persistence': true\n }, options);\n this._gdpr_call_func(clearOptInOut, options);\n this._gdpr_update_persistence(options);\n};\n\n// EXPORTS (for closure compiler)\n\n// MixpanelLib Exports\nMixpanelLib.prototype['init'] = MixpanelLib.prototype.init;\nMixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset;\nMixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable;\nMixpanelLib.prototype['time_event'] = MixpanelLib.prototype.time_event;\nMixpanelLib.prototype['track'] = MixpanelLib.prototype.track;\nMixpanelLib.prototype['track_links'] = MixpanelLib.prototype.track_links;\nMixpanelLib.prototype['track_forms'] = MixpanelLib.prototype.track_forms;\nMixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview;\nMixpanelLib.prototype['register'] = MixpanelLib.prototype.register;\nMixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once;\nMixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister;\nMixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify;\nMixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias;\nMixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag;\nMixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config;\nMixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config;\nMixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property;\nMixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id;\nMixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString;\nMixpanelLib.prototype['_check_and_handle_notifications'] = MixpanelLib.prototype._check_and_handle_notifications;\nMixpanelLib.prototype['_handle_user_decide_check_complete'] = MixpanelLib.prototype._handle_user_decide_check_complete;\nMixpanelLib.prototype['_show_notification'] = MixpanelLib.prototype._show_notification;\nMixpanelLib.prototype['opt_out_tracking'] = MixpanelLib.prototype.opt_out_tracking;\nMixpanelLib.prototype['opt_in_tracking'] = MixpanelLib.prototype.opt_in_tracking;\nMixpanelLib.prototype['has_opted_out_tracking'] = MixpanelLib.prototype.has_opted_out_tracking;\nMixpanelLib.prototype['has_opted_in_tracking'] = MixpanelLib.prototype.has_opted_in_tracking;\nMixpanelLib.prototype['clear_opt_in_out_tracking'] = MixpanelLib.prototype.clear_opt_in_out_tracking;\nMixpanelLib.prototype['get_group'] = MixpanelLib.prototype.get_group;\nMixpanelLib.prototype['set_group'] = MixpanelLib.prototype.set_group;\nMixpanelLib.prototype['add_group'] = MixpanelLib.prototype.add_group;\nMixpanelLib.prototype['remove_group'] = MixpanelLib.prototype.remove_group;\nMixpanelLib.prototype['track_with_groups'] = MixpanelLib.prototype.track_with_groups;\nMixpanelLib.prototype['start_batch_senders'] = MixpanelLib.prototype.start_batch_senders;\nMixpanelLib.prototype['stop_batch_senders'] = MixpanelLib.prototype.stop_batch_senders;\n\n// MixpanelPersistence Exports\nMixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties;\nMixpanelPersistence.prototype['update_search_keyword'] = MixpanelPersistence.prototype.update_search_keyword;\nMixpanelPersistence.prototype['update_referrer_info'] = MixpanelPersistence.prototype.update_referrer_info;\nMixpanelPersistence.prototype['get_cross_subdomain'] = MixpanelPersistence.prototype.get_cross_subdomain;\nMixpanelPersistence.prototype['clear'] = MixpanelPersistence.prototype.clear;\n_.safewrap_class(MixpanelLib, ['identify', '_check_and_handle_notifications', '_show_notification']);\nvar instances = {};\nvar extend_mp = function extend_mp() {\n // add all the sub mixpanel instances\n _.each(instances, function (instance, name) {\n if (name !== PRIMARY_INSTANCE_NAME) {\n mixpanel_master[name] = instance;\n }\n });\n\n // add private functions as _\n mixpanel_master['_'] = _;\n};\nvar override_mp_init_func = function override_mp_init_func() {\n // we override the snippets init function to handle the case where a\n // user initializes the mixpanel library after the script loads & runs\n mixpanel_master['init'] = function (token, config, name) {\n if (name) {\n // initialize a sub library\n if (!mixpanel_master[name]) {\n mixpanel_master[name] = instances[name] = create_mplib(token, config, name);\n mixpanel_master[name]._loaded();\n }\n return mixpanel_master[name];\n } else {\n var instance = mixpanel_master;\n if (instances[PRIMARY_INSTANCE_NAME]) {\n // main mixpanel lib already initialized\n instance = instances[PRIMARY_INSTANCE_NAME];\n } else if (token) {\n // intialize the main mixpanel lib\n instance = create_mplib(token, config, PRIMARY_INSTANCE_NAME);\n instance._loaded();\n instances[PRIMARY_INSTANCE_NAME] = instance;\n }\n mixpanel_master = instance;\n if (init_type === INIT_SNIPPET) {\n window$1[PRIMARY_INSTANCE_NAME] = mixpanel_master;\n }\n extend_mp();\n }\n };\n};\nvar add_dom_loaded_handler = function add_dom_loaded_handler() {\n // Cross browser DOM Loaded support\n function dom_loaded_handler() {\n // function flag since we only want to execute this once\n if (dom_loaded_handler.done) {\n return;\n }\n dom_loaded_handler.done = true;\n DOM_LOADED = true;\n ENQUEUE_REQUESTS = false;\n _.each(instances, function (inst) {\n inst._dom_loaded();\n });\n }\n function do_scroll_check() {\n try {\n document$1.documentElement.doScroll('left');\n } catch (e) {\n setTimeout(do_scroll_check, 1);\n return;\n }\n dom_loaded_handler();\n }\n if (document$1.addEventListener) {\n if (document$1.readyState === 'complete') {\n // safari 4 can fire the DOMContentLoaded event before loading all\n // external JS (including this file). you will see some copypasta\n // on the internet that checks for 'complete' and 'loaded', but\n // 'loaded' is an IE thing\n dom_loaded_handler();\n } else {\n document$1.addEventListener('DOMContentLoaded', dom_loaded_handler, false);\n }\n } else if (document$1.attachEvent) {\n // IE\n document$1.attachEvent('onreadystatechange', dom_loaded_handler);\n\n // check to make sure we arn't in a frame\n var toplevel = false;\n try {\n toplevel = window$1.frameElement === null;\n } catch (e) {\n // noop\n }\n if (document$1.documentElement.doScroll && toplevel) {\n do_scroll_check();\n }\n }\n\n // fallback handler, always will work\n _.register_event(window$1, 'load', dom_loaded_handler, true);\n};\nfunction init_as_module() {\n init_type = INIT_MODULE;\n mixpanel_master = new MixpanelLib();\n override_mp_init_func();\n mixpanel_master['init']();\n add_dom_loaded_handler();\n return mixpanel_master;\n}\nvar mixpanel = init_as_module();\nmodule.exports = mixpanel;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// import('scss/app.scss');\nrequire(\"stylesheets/application.scss\");\n\n// This here's the main file for applicant-facing pages\n\nrequire(\"application_entry\");\n","/*\n *\n * This is the main JS file for the Rise Web pathway.\n * It has two functions:\n * - Instantiate Vue components based on data attributes found on the page\n * - Provide centralized functions for cross-cutting concerns like analytics\n *\n */\nimport UtmToCookie from \"user/utm_to_cookie.js\";\nimport * as Analytics from \"user/analytics.js\";\n\nclass Application {\n constructor() {\n UtmToCookie();\n Analytics.setCookiesForMeasurementProtocol();\n Analytics.listenForFAQEvents();\n Analytics.setupMixpanel();\n this.onready = this.onready.bind(this);\n window.addEventListener(\"DOMContentLoaded\", () => this.onready());\n }\n\n async onready() {\n const faqTitles = document.querySelectorAll(\".faqs__item-title\");\n\n faqTitles.forEach((itemTitle) => {\n itemTitle.addEventListener(\"click\", () => {\n const parentItem = itemTitle.parentElement;\n parentItem.classList.toggle(\"faqs__item--expanded\");\n });\n });\n\n if (document.querySelector(\"[data-vue-target=sch]\")) {\n const { default: ScholarApp } = await import(\n /* webpackChunkName: \"scholarship-app\" */ \"user/ScholarshipApplication\"\n );\n this.app = new ScholarApp(this);\n }\n if (document.querySelector(\"#user-menu-button\")) {\n const { default: Header } = await import(/* webpackChunkName: \"header-menu\" */ \"layout/header.js\");\n new Header(this);\n }\n }\n}\n\nnew Application();\n","/*\n *\n * @file utm_to_cookie.js\n * UTM tags need to survive both registration and the change of session in the\n * case of a sign-in to an existing auth0 account. When a user lands on a page\n * with UTM tags present, we store them in a cookie that is processed by the\n * application controller if current_user is present\n *\n */\n\nimport Cookies from \"js-cookie\";\n\nexport default function () {\n const p = new URLSearchParams(window.location.search);\n let v = [\"medium\", \"campaign\", \"term\", \"content\", \"source\"];\n v.forEach((t) => {\n let tn = `utm_${t}`;\n let r = p.get(tn);\n if (r && r != \"\") {\n Cookies.set(tn, r.substring(0, 64));\n }\n });\n}\n","module.exports = require(\"regenerator-runtime\");\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n/*! js-cookie v3.0.1 | MIT */\n;\n(function (global, factory) {\n (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, function () {\n var current = global.Cookies;\n var exports = global.Cookies = factory();\n exports.noConflict = function () {\n global.Cookies = current;\n return exports;\n };\n }());\n})(this, function () {\n 'use strict';\n\n /* eslint-disable no-var */\n function assign(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target;\n }\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n var defaultConverter = {\n read: function read(value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\n },\n write: function write(value) {\n return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);\n }\n };\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n\n function init(converter, defaultAttributes) {\n function set(key, value, attributes) {\n if (typeof document === 'undefined') {\n return;\n }\n attributes = assign({}, defaultAttributes, attributes);\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n key = encodeURIComponent(key).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue;\n }\n stringifiedAttributes += '; ' + attributeName;\n if (attributes[attributeName] === true) {\n continue;\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n return document.cookie = key + '=' + converter.write(value, key) + stringifiedAttributes;\n }\n function get(key) {\n if (typeof document === 'undefined' || arguments.length && !key) {\n return;\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n try {\n var foundKey = decodeURIComponent(parts[0]);\n jar[foundKey] = converter.read(value, foundKey);\n if (key === foundKey) {\n break;\n }\n } catch (e) {}\n }\n return key ? jar[key] : jar;\n }\n return Object.create({\n set: set,\n get: get,\n remove: function remove(key, attributes) {\n set(key, '', assign({}, attributes, {\n expires: -1\n }));\n },\n withAttributes: function withAttributes(attributes) {\n return init(this.converter, assign({}, this.attributes, attributes));\n },\n withConverter: function withConverter(converter) {\n return init(assign({}, this.converter, converter), this.attributes);\n }\n }, {\n attributes: {\n value: Object.freeze(defaultAttributes)\n },\n converter: {\n value: Object.freeze(converter)\n }\n });\n }\n var api = init(defaultConverter, {\n path: '/'\n });\n /* eslint-enable no-var */\n\n return api;\n});"],"sourceRoot":""}