UNPKG

@convious/convious-analytics

Version:

A library that allows recording page views and transactions for Convious pricing API

16 lines (14 loc) 36.8 kB
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.conviousPricing=n():t.conviousPricing=n()}(window,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=54)}([function(t,n,e){(function(n){var e="object",r=function(t){return t&&t.Math==Math&&t};t.exports=r(typeof globalThis==e&&globalThis)||r(typeof window==e&&window)||r(typeof self==e&&self)||r(typeof n==e&&n)||Function("return this")()}).call(this,e(58))},function(t,n,e){var r=e(0),o=e(17),i=e(38),u=e(61),c=r.Symbol,a=o("wks");t.exports=function(t){return a[t]||(a[t]=u&&c[t]||(u?c:i)("Symbol."+t))}},function(t,n,e){var r=e(9),o=e(12),i=e(18);t.exports=r?function(t,n,e){return o.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(6);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){var r=e(0),o=e(29).f,i=e(2),u=e(8),c=e(23),a=e(66),s=e(43);t.exports=function(t,n){var e,f,l,p,v,d=t.target,h=t.global,y=t.stat;if(e=h?r:y?r[d]||c(d,{}):(r[d]||{}).prototype)for(f in n){if(p=n[f],l=t.noTargetGet?(v=o(e,f))&&v.value:e[f],!s(h?f:d+(y?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;a(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),u(e,f,p,t)}}},function(t,n,e){var r=e(0),o=e(17),i=e(2),u=e(4),c=e(23),a=e(37),s=e(19),f=s.get,l=s.enforce,p=String(a).split("toString");o("inspectSource",(function(t){return a.call(t)})),(t.exports=function(t,n,e,o){var a=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,f=!!o&&!!o.noTargetGet;"function"==typeof e&&("string"!=typeof n||u(e,"name")||i(e,"name",n),l(e).source=p.join("string"==typeof n?n:"")),t!==r?(a?!f&&t[n]&&(s=!0):delete t[n],s?t[n]=e:i(t,n,e)):s?t[n]=e:c(n,e)})(Function.prototype,"toString",(function(){return"function"==typeof this&&f(this).source||a.call(this)}))},function(t,n,e){var r=e(5);t.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(30),o=e(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][n]||o[t]&&o[t][n]}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,n,e){var r=e(9),o=e(35),i=e(3),u=e(36),c=Object.defineProperty;n.f=r?c:function(t,n,e){if(i(t),n=u(n,!0),i(e),o)try{return c(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},function(t,n){t.exports=!1},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports={}},function(t,n,e){"use strict";var r=e(11),o=function(t){var n,e;this.promise=new t((function(t,r){if(void 0!==n||void 0!==e)throw TypeError("Bad Promise constructor");n=t,e=r})),this.resolve=r(n),this.reject=r(e)};t.exports.f=function(t){return new o(t)}},function(t,n,e){var r=e(0),o=e(23),i=e(13),u=r["__core-js_shared__"]||o("__core-js_shared__",{});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:i?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r,o,i,u=e(59),c=e(0),a=e(6),s=e(2),f=e(4),l=e(25),p=e(26),v=c.WeakMap;if(u){var d=new v,h=d.get,y=d.has,g=d.set;r=function(t,n){return g.call(d,t,n),n},o=function(t){return h.call(d,t)||{}},i=function(t){return y.call(d,t)}}else{var m=l("state");p[m]=!0,r=function(t,n){return s(t,m,n),n},o=function(t){return f(t,m)?t[m]:{}},i=function(t){return f(t,m)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(n){var e;if(!a(n)||(e=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}}},function(t,n,e){var r=e(65),o=e(28);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(3),o=e(86),i=e(42),u=e(48),c=e(87),a=e(88),s=function(t,n){this.stopped=t,this.result=n};(t.exports=function(t,n,e,f,l){var p,v,d,h,y,g,m=u(n,e,f?2:1);if(l)p=t;else{if("function"!=typeof(v=c(t)))throw TypeError("Target is not iterable");if(o(v)){for(d=0,h=i(t.length);h>d;d++)if((y=f?m(r(g=t[d])[0],g[1]):m(t[d]))&&y instanceof s)return y;return new s(!1)}p=v.call(t)}for(;!(g=p.next()).done;)if((y=a(p,m,g.value,f))&&y instanceof s)return y;return new s(!1)}).stop=function(t){return new s(!0,t)}},function(t,n){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,n,e){var r=e(0),o=e(2);t.exports=function(t,n){try{o(r,t,n)}catch(e){r[t]=n}return n}},function(t,n,e){var r=e(0),o=e(6),i=r.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,n,e){var r=e(17),o=e(38),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n){t.exports={}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){var r=e(9),o=e(64),i=e(18),u=e(20),c=e(36),a=e(4),s=e(35),f=Object.getOwnPropertyDescriptor;n.f=r?f:function(t,n){if(t=u(t),n=c(n,!0),s)try{return f(t,n)}catch(t){}if(a(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n,e){t.exports=e(0)},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n,e){var r=e(4),o=e(73),i=e(25),u=e(74),c=i("IE_PROTO"),a=Object.prototype;t.exports=u?Object.getPrototypeOf:function(t){return t=o(t),r(t,c)?t[c]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,n,e){var r=e(3),o=e(75),i=e(31),u=e(26),c=e(45),a=e(24),s=e(25)("IE_PROTO"),f=function(){},l=function(){var t,n=a("iframe"),e=i.length;for(n.style.display="none",c.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;e--;)delete l.prototype[i[e]];return l()};t.exports=Object.create||function(t,n){var e;return null!==t?(f.prototype=r(t),e=new f,f.prototype=null,e[s]=t):e=l(),void 0===n?e:o(e,n)},u[s]=!0},function(t,n,e){var r=e(12).f,o=e(4),i=e(1)("toStringTag");t.exports=function(t,n,e){t&&!o(t=e?t:t.prototype,i)&&r(t,i,{configurable:!0,value:n})}},function(t,n,e){var r=e(9),o=e(5),i=e(24);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(6);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,e){var r=e(17);t.exports=r("native-function-to-string",Function.toString)},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+r).toString(36)}},function(t,n,e){var r=e(14),o=e(1)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var n,e,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),o))?e:i?r(n):"Object"==(u=r(n))&&"function"==typeof n.callee?"Arguments":u}},function(t,n,e){"use strict";var r=e(7),o=e(72),i=e(32),u=e(46),c=e(34),a=e(2),s=e(8),f=e(1),l=e(13),p=e(15),v=e(44),d=v.IteratorPrototype,h=v.BUGGY_SAFARI_ITERATORS,y=f("iterator"),g=function(){return this};t.exports=function(t,n,e,f,v,m,w){o(e,n,f);var b,x,_,S=function(t){if(t===v&&E)return E;if(!h&&t in P)return P[t];switch(t){case"keys":case"values":case"entries":return function(){return new e(this,t)}}return function(){return new e(this)}},O=n+" Iterator",j=!1,P=t.prototype,k=P[y]||P["@@iterator"]||v&&P[v],E=!h&&k||S(v),T="Array"==n&&P.entries||k;if(T&&(b=i(T.call(new t)),d!==Object.prototype&&b.next&&(l||i(b)===d||(u?u(b,d):"function"!=typeof b[y]&&a(b,y,g)),c(b,O,!0,!0),l&&(p[O]=g))),"values"==v&&k&&"values"!==k.name&&(j=!0,E=function(){return k.call(this)}),l&&!w||P[y]===E||a(P,y,E),p[n]=E,v)if(x={values:S("values"),keys:m?E:S("keys"),entries:S("entries")},w)for(_ in x)!h&&!j&&_ in P||s(P,_,x[_]);else r({target:n,proto:!0,forced:h||j},x);return x}},function(t,n,e){var r=e(4),o=e(20),i=e(69).indexOf,u=e(26);t.exports=function(t,n){var e,c=o(t),a=0,s=[];for(e in c)!r(u,e)&&r(c,e)&&s.push(e);for(;n.length>a;)r(c,e=n[a++])&&(~i(s,e)||s.push(e));return s}},function(t,n,e){var r=e(27),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(5),o=/#|\.prototype\./,i=function(t,n){var e=c[u(t)];return e==s||e!=a&&("function"==typeof n?r(n):!!n)},u=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=i.data={},a=i.NATIVE="N",s=i.POLYFILL="P";t.exports=i},function(t,n,e){"use strict";var r,o,i,u=e(32),c=e(2),a=e(4),s=e(1),f=e(13),l=s("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(r=o):p=!0),null==r&&(r={}),f||a(r,l)||c(r,l,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},function(t,n,e){var r=e(10);t.exports=r("document","documentElement")},function(t,n,e){var r=e(3),o=e(77);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,e={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),n=e instanceof Array}catch(t){}return function(e,i){return r(e),o(i),n?t.call(e,i):e.__proto__=i,e}}():void 0)},function(t,n,e){var r=e(0);t.exports=r.Promise},function(t,n,e){var r=e(11);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n,e){var r=e(3),o=e(11),i=e(1)("species");t.exports=function(t,n){var e,u=r(t).constructor;return void 0===u||null==(e=r(u)[i])?n:o(e)}},function(t,n,e){var r,o,i,u=e(0),c=e(5),a=e(14),s=e(48),f=e(45),l=e(24),p=u.location,v=u.setImmediate,d=u.clearImmediate,h=u.process,y=u.MessageChannel,g=u.Dispatch,m=0,w={},b=function(t){if(w.hasOwnProperty(t)){var n=w[t];delete w[t],n()}},x=function(t){return function(){b(t)}},_=function(t){b(t.data)},S=function(t){u.postMessage(t+"",p.protocol+"//"+p.host)};v&&d||(v=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return w[++m]=function(){("function"==typeof t?t:Function(t)).apply(void 0,n)},r(m),m},d=function(t){delete w[t]},"process"==a(h)?r=function(t){h.nextTick(x(t))}:g&&g.now?r=function(t){g.now(x(t))}:y?(i=(o=new y).port2,o.port1.onmessage=_,r=s(i.postMessage,i,1)):!u.addEventListener||"function"!=typeof postMessage||u.importScripts||c(S)?r="onreadystatechange"in l("script")?function(t){f.appendChild(l("script")).onreadystatechange=function(){f.removeChild(this),b(t)}}:function(t){setTimeout(x(t),0)}:(r=S,u.addEventListener("message",_,!1))),t.exports={set:v,clear:d}},function(t,n,e){var r=e(10);t.exports=r("navigator","userAgent")||""},function(t,n,e){var r=e(3),o=e(6),i=e(16);t.exports=function(t,n){if(r(t),o(n)&&n.constructor===t)return n;var e=i.f(t);return(0,e.resolve)(n),e.promise}},function(t,n,e){"use strict";var r=e(7),o=e(11),i=e(16),u=e(22),c=e(21);r({target:"Promise",stat:!0},{allSettled:function(t){var n=this,e=i.f(n),r=e.resolve,a=e.reject,s=u((function(){var e=o(n.resolve),i=[],u=0,a=1;c(t,(function(t){var o=u++,c=!1;i.push(void 0),a++,e.call(n,t).then((function(t){c||(c=!0,i[o]={status:"fulfilled",value:t},--a||r(i))}),(function(t){c||(c=!0,i[o]={status:"rejected",reason:t},--a||r(i))}))})),--a||r(i)}));return s.error&&a(s.value),e.promise}})},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),e(55);var r,o,i,u=e(97);function c(t,n){if(!i)throw new Error("Convious Analytics have not been initialized. Please call init() first.");return i.logEvent(t,r,o,n)}function a(t,n){return c("PageViewed",{referer_url:t,current_url:n,browser_info:{screen:{height:window.screen?window.screen.height:"unknown",width:window.screen?window.screen.width:"unknown",orientation:window.screen&&window.screen.orientation?window.screen.orientation.type:"unknown"},user_agent:navigator.userAgent,platform:navigator.platform}})}n.logPageView=a,n.logUserEnteredCheckout=function(){return c("UserEnteredCheckout",{})},n.logUserSelectedDate=function(){return c("UserSelectedDate",{})},n.logUserViewedProducts=function(){return c("UserViewedProducts",{})},n.logUserViewedPrices=function(){return c("UserViewedPrices",{})},n.logUserAddedAnItemToCart=function(){return c("UserAddedAnItemToCart",{})},n.logOrderCreated=function(t){return c("OrderCreated",{order_id:t.orderId,items:t.items.map((function(t){return{product_id:t.productId,amount:t.amount,price:t.price,event_date:t.eventDate,location:t.location}}))})},n.logTransaction=function(t,n){return c("OrderPaird",{order_id:t,total_amount:n})},n.init=function(t,n){r=t,o=n,i=u.createEventLogger(),a(document.referrer,window.location.href)}},function(t,n,e){t.exports=e(56),e(93),e(94),e(95),e(96)},function(t,n,e){e(57),e(62),e(78),e(82),e(53),e(92);var r=e(30);t.exports=r.Promise},function(t,n,e){var r=e(8),o=e(60),i=Object.prototype;o!==i.toString&&r(i,"toString",o,{unsafe:!0})},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){var r=e(0),o=e(37),i=r.WeakMap;t.exports="function"==typeof i&&/native code/.test(o.call(i))},function(t,n,e){"use strict";var r=e(39),o={};o[e(1)("toStringTag")]="z",t.exports="[object z]"!==String(o)?function(){return"[object "+r(this)+"]"}:o.toString},function(t,n,e){var r=e(5);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(t,n,e){"use strict";var r=e(63).charAt,o=e(19),i=e(40),u=o.set,c=o.getterFor("String Iterator");i(String,"String",(function(t){u(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,n=c(this),e=n.string,o=n.index;return o>=e.length?{value:void 0,done:!0}:(t=r(e,o),n.index+=t.length,{value:t,done:!1})}))},function(t,n,e){var r=e(27),o=e(28),i=function(t){return function(n,e){var i,u,c=String(o(n)),a=r(e),s=c.length;return a<0||a>=s?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===s||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,n,e){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:r},function(t,n,e){var r=e(5),o=e(14),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,n,e){var r=e(4),o=e(67),i=e(29),u=e(12);t.exports=function(t,n){for(var e=o(n),c=u.f,a=i.f,s=0;s<e.length;s++){var f=e[s];r(t,f)||c(t,f,a(n,f))}}},function(t,n,e){var r=e(10),o=e(68),i=e(71),u=e(3);t.exports=r("Reflect","ownKeys")||function(t){var n=o.f(u(t)),e=i.f;return e?n.concat(e(t)):n}},function(t,n,e){var r=e(41),o=e(31).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,n,e){var r=e(20),o=e(42),i=e(70),u=function(t){return function(n,e,u){var c,a=r(n),s=o(a.length),f=i(u,s);if(t&&e!=e){for(;s>f;)if((c=a[f++])!=c)return!0}else for(;s>f;f++)if((t||f in a)&&a[f]===e)return t||f||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},function(t,n,e){var r=e(27),o=Math.max,i=Math.min;t.exports=function(t,n){var e=r(t);return e<0?o(e+n,0):i(e,n)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,e){"use strict";var r=e(44).IteratorPrototype,o=e(33),i=e(18),u=e(34),c=e(15),a=function(){return this};t.exports=function(t,n,e){var s=n+" Iterator";return t.prototype=o(r,{next:i(1,e)}),u(t,s,!1,!0),c[s]=a,t}},function(t,n,e){var r=e(28);t.exports=function(t){return Object(r(t))}},function(t,n,e){var r=e(5);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,n,e){var r=e(9),o=e(12),i=e(3),u=e(76);t.exports=r?Object.defineProperties:function(t,n){i(t);for(var e,r=u(n),c=r.length,a=0;c>a;)o.f(t,e=r[a++],n[e]);return t}},function(t,n,e){var r=e(41),o=e(31);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n,e){var r=e(6);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,n,e){var r=e(0),o=e(79),i=e(80),u=e(2),c=e(1),a=c("iterator"),s=c("toStringTag"),f=i.values;for(var l in o){var p=r[l],v=p&&p.prototype;if(v){if(v[a]!==f)try{u(v,a,f)}catch(t){v[a]=f}if(v[s]||u(v,s,l),o[l])for(var d in i)if(v[d]!==i[d])try{u(v,d,i[d])}catch(t){v[d]=i[d]}}}},function(t,n){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,n,e){"use strict";var r=e(20),o=e(81),i=e(15),u=e(19),c=e(40),a=u.set,s=u.getterFor("Array Iterator");t.exports=c(Array,"Array",(function(t,n){a(this,{type:"Array Iterator",target:r(t),index:0,kind:n})}),(function(){var t=s(this),n=t.target,e=t.kind,r=t.index++;return!n||r>=n.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==e?{value:r,done:!1}:"values"==e?{value:n[r],done:!1}:{value:[r,n[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,n,e){var r=e(1),o=e(33),i=e(2),u=r("unscopables"),c=Array.prototype;null==c[u]&&i(c,u,o(null)),t.exports=function(t){c[u][t]=!0}},function(t,n,e){"use strict";var r,o,i,u,c=e(7),a=e(13),s=e(0),f=e(30),l=e(47),p=e(8),v=e(83),d=e(34),h=e(84),y=e(6),g=e(11),m=e(85),w=e(14),b=e(21),x=e(89),_=e(49),S=e(50).set,O=e(90),j=e(52),P=e(91),k=e(16),E=e(22),T=e(51),A=e(19),L=e(43),I=e(1)("species"),M="Promise",C=A.get,R=A.set,D=A.getterFor(M),F=l,U=s.TypeError,V=s.document,G=s.process,N=s.fetch,H=G&&G.versions,z=H&&H.v8||"",W=k.f,q=W,B="process"==w(G),J=!!(V&&V.createEvent&&s.dispatchEvent),Y=L(M,(function(){var t=F.resolve(1),n=function(){},e=(t.constructor={})[I]=function(t){t(n,n)};return!((B||"function"==typeof PromiseRejectionEvent)&&(!a||t.finally)&&t.then(n)instanceof e&&0!==z.indexOf("6.6")&&-1===T.indexOf("Chrome/66"))})),K=Y||!x((function(t){F.all(t).catch((function(){}))})),Q=function(t){var n;return!(!y(t)||"function"!=typeof(n=t.then))&&n},X=function(t,n,e){if(!n.notified){n.notified=!0;var r=n.reactions;O((function(){for(var o=n.value,i=1==n.state,u=0;r.length>u;){var c,a,s,f=r[u++],l=i?f.ok:f.fail,p=f.resolve,v=f.reject,d=f.domain;try{l?(i||(2===n.rejection&&nt(t,n),n.rejection=1),!0===l?c=o:(d&&d.enter(),c=l(o),d&&(d.exit(),s=!0)),c===f.promise?v(U("Promise-chain cycle")):(a=Q(c))?a.call(c,p,v):p(c)):v(o)}catch(t){d&&!s&&d.exit(),v(t)}}n.reactions=[],n.notified=!1,e&&!n.rejection&&$(t,n)}))}},Z=function(t,n,e){var r,o;J?((r=V.createEvent("Event")).promise=n,r.reason=e,r.initEvent(t,!1,!0),s.dispatchEvent(r)):r={promise:n,reason:e},(o=s["on"+t])?o(r):"unhandledrejection"===t&&P("Unhandled promise rejection",e)},$=function(t,n){S.call(s,(function(){var e,r=n.value;if(tt(n)&&(e=E((function(){B?G.emit("unhandledRejection",r,t):Z("unhandledrejection",t,r)})),n.rejection=B||tt(n)?2:1,e.error))throw e.value}))},tt=function(t){return 1!==t.rejection&&!t.parent},nt=function(t,n){S.call(s,(function(){B?G.emit("rejectionHandled",t):Z("rejectionhandled",t,n.value)}))},et=function(t,n,e,r){return function(o){t(n,e,o,r)}},rt=function(t,n,e,r){n.done||(n.done=!0,r&&(n=r),n.value=e,n.state=2,X(t,n,!0))},ot=function(t,n,e,r){if(!n.done){n.done=!0,r&&(n=r);try{if(t===e)throw U("Promise can't be resolved itself");var o=Q(e);o?O((function(){var r={done:!1};try{o.call(e,et(ot,t,r,n),et(rt,t,r,n))}catch(e){rt(t,r,e,n)}})):(n.value=e,n.state=1,X(t,n,!1))}catch(e){rt(t,{done:!1},e,n)}}};Y&&(F=function(t){m(this,F,M),g(t),r.call(this);var n=C(this);try{t(et(ot,this,n),et(rt,this,n))}catch(t){rt(this,n,t)}},(r=function(t){R(this,{type:M,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=v(F.prototype,{then:function(t,n){var e=D(this),r=W(_(this,F));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=B?G.domain:void 0,e.parent=!0,e.reactions.push(r),0!=e.state&&X(this,e,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,n=C(t);this.promise=t,this.resolve=et(ot,t,n),this.reject=et(rt,t,n)},k.f=W=function(t){return t===F||t===i?new o(t):q(t)},a||"function"!=typeof l||(u=l.prototype.then,p(l.prototype,"then",(function(t,n){var e=this;return new F((function(t,n){u.call(e,t,n)})).then(t,n)})),"function"==typeof N&&c({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return j(F,N.apply(s,arguments))}}))),c({global:!0,wrap:!0,forced:Y},{Promise:F}),d(F,M,!1,!0),h(M),i=f.Promise,c({target:M,stat:!0,forced:Y},{reject:function(t){var n=W(this);return n.reject.call(void 0,t),n.promise}}),c({target:M,stat:!0,forced:a||Y},{resolve:function(t){return j(a&&this===i?F:this,t)}}),c({target:M,stat:!0,forced:K},{all:function(t){var n=this,e=W(n),r=e.resolve,o=e.reject,i=E((function(){var e=g(n.resolve),i=[],u=0,c=1;b(t,(function(t){var a=u++,s=!1;i.push(void 0),c++,e.call(n,t).then((function(t){s||(s=!0,i[a]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),e.promise},race:function(t){var n=this,e=W(n),r=e.reject,o=E((function(){var o=g(n.resolve);b(t,(function(t){o.call(n,t).then(e.resolve,r)}))}));return o.error&&r(o.value),e.promise}})},function(t,n,e){var r=e(8);t.exports=function(t,n,e){for(var o in n)r(t,o,n[o],e);return t}},function(t,n,e){"use strict";var r=e(10),o=e(12),i=e(1),u=e(9),c=i("species");t.exports=function(t){var n=r(t),e=o.f;u&&n&&!n[c]&&e(n,c,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,e){if(!(t instanceof n))throw TypeError("Incorrect "+(e?e+" ":"")+"invocation");return t}},function(t,n,e){var r=e(1),o=e(15),i=r("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||u[i]===t)}},function(t,n,e){var r=e(39),o=e(15),i=e(1)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,n,e){var r=e(3);t.exports=function(t,n,e,o){try{return o?n(r(e)[0],e[1]):n(e)}catch(n){var i=t.return;throw void 0!==i&&r(i.call(t)),n}}},function(t,n,e){var r=e(1)("iterator"),o=!1;try{var i=0,u={next:function(){return{done:!!i++}},return:function(){o=!0}};u[r]=function(){return this},Array.from(u,(function(){throw 2}))}catch(t){}t.exports=function(t,n){if(!n&&!o)return!1;var e=!1;try{var i={};i[r]=function(){return{next:function(){return{done:e=!0}}}},t(i)}catch(t){}return e}},function(t,n,e){var r,o,i,u,c,a,s,f,l=e(0),p=e(29).f,v=e(14),d=e(50).set,h=e(51),y=l.MutationObserver||l.WebKitMutationObserver,g=l.process,m=l.Promise,w="process"==v(g),b=p(l,"queueMicrotask"),x=b&&b.value;x||(r=function(){var t,n;for(w&&(t=g.domain)&&t.exit();o;){n=o.fn,o=o.next;try{n()}catch(t){throw o?u():i=void 0,t}}i=void 0,t&&t.enter()},w?u=function(){g.nextTick(r)}:y&&!/(iphone|ipod|ipad).*applewebkit/i.test(h)?(c=!0,a=document.createTextNode(""),new y(r).observe(a,{characterData:!0}),u=function(){a.data=c=!c}):m&&m.resolve?(s=m.resolve(void 0),f=s.then,u=function(){f.call(s,r)}):u=function(){d.call(l,r)}),t.exports=x||function(t){var n={fn:t,next:void 0};i&&(i.next=n),o||(o=n,u()),i=n}},function(t,n,e){var r=e(0);t.exports=function(t,n){var e=r.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}},function(t,n,e){"use strict";var r=e(7),o=e(13),i=e(47),u=e(10),c=e(49),a=e(52),s=e(8);r({target:"Promise",proto:!0,real:!0},{finally:function(t){var n=c(this,u("Promise")),e="function"==typeof t;return this.then(e?function(e){return a(n,t()).then((function(){return e}))}:t,e?function(e){return a(n,t()).then((function(){throw e}))}:t)}}),o||"function"!=typeof i||i.prototype.finally||s(i.prototype,"finally",u("Promise").prototype.finally)},function(t,n,e){var r=e(7),o=e(32),i=e(46),u=e(33),c=e(18),a=e(21),s=e(2),f=function(t,n){var e=this;if(!(e instanceof f))return new f(t,n);i&&(e=i(new Error(n),o(e)));var r=[];return a(t,r.push,r),s(e,"errors",r),void 0!==n&&s(e,"message",String(n)),e};f.prototype=u(Error.prototype,{constructor:c(5,f),name:c(5,"AggregateError")}),r({global:!0},{AggregateError:f})},function(t,n,e){e(53)},function(t,n,e){"use strict";var r=e(7),o=e(16),i=e(22);r({target:"Promise",stat:!0},{try:function(t){var n=o.f(this),e=i(t);return(e.error?n.reject:n.resolve)(e.value),n.promise}})},function(t,n,e){"use strict";var r=e(7),o=e(11),i=e(10),u=e(16),c=e(22),a=e(21);r({target:"Promise",stat:!0},{any:function(t){var n=this,e=u.f(n),r=e.resolve,s=e.reject,f=c((function(){var e=o(n.resolve),u=[],c=0,f=1,l=!1;a(t,(function(t){var o=c++,a=!1;u.push(void 0),f++,e.call(n,t).then((function(t){a||l||(l=!0,r(t))}),(function(t){a||l||(a=!0,u[o]=t,--f||s(new(i("AggregateError"))(u,"No one promise resolved")))}))})),--f||s(new(i("AggregateError"))(u,"No one promise resolved"))}));return f.error&&s(f.value),e.promise}})},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(98);n.ConsoleEventLogger={logEvent:function(t,n,e,r){return console.log(t,r),Promise.resolve()}};var o=function(){function t(t){void 0===t&&(t=1),this.concurrency=t,this.tasks=[],this.running=0}return t.prototype.runTask=function(t){return r.__awaiter(this,void 0,void 0,(function(){var n,e,o;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,3,4]),this.running++,[4,t.work()];case 1:return n=r.sent(),t.resolve(n),[3,4];case 2:return e=r.sent(),t.reject(e),[3,4];case 3:return this.running--,(o=this.tasks.shift())&&this.runTask(o),[7];case 4:return[2]}}))}))},t.prototype.enqueue=function(t){var n=this;return new Promise((function(e,r){var o={work:t,resolve:e,reject:r};n.running<n.concurrency?n.runTask(o):n.tasks.push(o)}))},t}();var i=function(){function t(t){var n=this;this.charonUrl=t,this.socket=null,this.logQueue=new o,this.ackHandlers=[],this.closeSocket=function(){n.socket&&(n.socket.close(),n.socket.removeEventListener("error",n.closeSocket),n.socket.removeEventListener("close",n.closeSocket),n.socket.removeEventListener("message",n.handleAcks)),n.socket=null},this.handleAcks=function(){for(var t=0;t<n.ackHandlers.length;t++)n.ackHandlers[t]();n.ackHandlers=[]}}return t.prototype.openSocket=function(){var t=this;return new Promise((function(n,e){try{var r=new WebSocket(t.charonUrl);r.addEventListener("open",(function(){n(r),r.removeEventListener("error",e)})),r.addEventListener("error",e)}catch(t){e(t)}}))},t.prototype.ensureSocketOpen=function(){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:return this.socket?[2]:(t=this,[4,this.openSocket()]);case 1:return t.socket=n.sent(),this.socket.addEventListener("error",this.closeSocket),this.socket.addEventListener("close",this.closeSocket),this.socket.addEventListener("message",this.handleAcks),[2]}}))}))},t.prototype.expectAck=function(){var t=this;return new Promise((function(n){t.ackHandlers.push(n)}))},t.prototype.logEventJob=function(t,n,e,o){return r.__awaiter(this,void 0,void 0,(function(){var i;return r.__generator(this,(function(u){switch(u.label){case 0:return[4,this.ensureSocketOpen()];case 1:return u.sent(),i=this.expectAck(),this.socket.send(JSON.stringify({event_type:"pricing_api_events",cookie_id:e,event_data:r.__assign(r.__assign({},o),{event_type:t,account_slug:n,timestamp:new Date})})),[4,(c=i,a=500,new Promise((function(t,n){var e=!1;c.then((function(n){e||(e=!0,t(n))}),(function(t){e||(e=!0,n(t))})),setTimeout((function(){e||(e=!0,n(new Error("Operation timed out after "+a+" ms")))}),a)})))];case 2:return u.sent(),[2]}var c,a}))}))},t.prototype.logEvent=function(t,n,e,o){return r.__awaiter(this,void 0,void 0,(function(){var i=this;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,this.logQueue.enqueue((function(){return i.logEventJob(t,n,e,o)}))];case 1:return r.sent(),[2]}}))}))},t}();n.WebsocketEventLogger=i,n.createEventLogger=function(){return new i("wss://charon.convious.com")}},function(t,n,e){"use strict";e.r(n),e.d(n,"__extends",(function(){return o})),e.d(n,"__assign",(function(){return i})),e.d(n,"__rest",(function(){return u})),e.d(n,"__decorate",(function(){return c})),e.d(n,"__param",(function(){return a})),e.d(n,"__metadata",(function(){return s})),e.d(n,"__awaiter",(function(){return f})),e.d(n,"__generator",(function(){return l})),e.d(n,"__exportStar",(function(){return p})),e.d(n,"__values",(function(){return v})),e.d(n,"__read",(function(){return d})),e.d(n,"__spread",(function(){return h})),e.d(n,"__spreadArrays",(function(){return y})),e.d(n,"__await",(function(){return g})),e.d(n,"__asyncGenerator",(function(){return m})),e.d(n,"__asyncDelegator",(function(){return w})),e.d(n,"__asyncValues",(function(){return b})),e.d(n,"__makeTemplateObject",(function(){return x})),e.d(n,"__importStar",(function(){return _})),e.d(n,"__importDefault",(function(){return S})); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};function o(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var i=function(){return(i=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function u(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function c(t,n,e,r){var o,i=arguments.length,u=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,e,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(u=(i<3?o(u):i>3?o(n,e,u):o(n,e))||u);return i>3&&u&&Object.defineProperty(n,e,u),u}function a(t,n){return function(e,r){n(e,r,t)}}function s(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function f(t,n,e,r){return new(e||(e=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new e((function(n){n(t.value)})).then(u,c)}a((r=r.apply(t,n||[])).next())}))}function l(t,n){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(t,u)}catch(t){i=[6,t],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function p(t,n){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}function v(t){var n="function"==typeof Symbol&&t[Symbol.iterator],e=0;return n?n.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}function d(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function h(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(d(arguments[n]));return t}function y(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r}function g(t){return this instanceof g?(this.v=t,this):new g(t)}function m(t,n,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e.apply(t,n||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){o[t]&&(r[t]=function(n){return new Promise((function(e,r){i.push([t,n,e,r])>1||c(t,n)}))})}function c(t,n){try{(e=o[t](n)).value instanceof g?Promise.resolve(e.value.v).then(a,s):f(i[0][2],e)}catch(t){f(i[0][3],t)}var e}function a(t){c("next",t)}function s(t){c("throw",t)}function f(t,n){t(n),i.shift(),i.length&&c(i[0][0],i[0][1])}}function w(t){var n,e;return n={},r("next"),r("throw",(function(t){throw t})),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,o){n[r]=t[r]?function(n){return(e=!e)?{value:g(t[r](n)),done:"return"===r}:o?o(n):n}:o}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,e=t[Symbol.asyncIterator];return e?e.call(t):(t=v(t),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(e){n[e]=t[e]&&function(n){return new Promise((function(r,o){(function(t,n,e,r){Promise.resolve(r).then((function(n){t({value:n,done:e})}),n)})(r,o,(n=t[e](n)).done,n.value)}))}}}function x(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t}function _(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}function S(t){return t&&t.__esModule?t:{default:t}}}])}));