@ht-sdks/events-sdk-js-browser 1.5.5 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.HtEvents=e():t.HtEvents=e()}(self,function(){return function(){var t,e,n,r,i={8971:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(8578));function o(t,e){return function(){var n=this.traits(),r=this.properties?this.properties():{};return i.default(n,"address."+t)||i.default(n,t)||(e?i.default(n,"address."+e):null)||(e?i.default(n,e):null)||i.default(r,"address."+t)||i.default(r,t)||(e?i.default(r,"address."+e):null)||(e?i.default(r,e):null)}}e.default=function(t){t.zip=o("postalCode","zip"),t.country=o("country"),t.street=o("street"),t.state=o("state"),t.city=o("city"),t.region=o("region")}},7663:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Alias=void 0;var i=r(n(5615)),o=n(2265);function s(t,e){o.Facade.call(this,t,e)}e.Alias=s,i.default(s,o.Facade),s.prototype.action=function(){return"alias"},s.prototype.type=s.prototype.action,s.prototype.previousId=function(){return this.field("previousId")||this.field("from")},s.prototype.from=s.prototype.previousId,s.prototype.userId=function(){return this.field("userId")||this.field("to")},s.prototype.to=s.prototype.userId},3194:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clone=void 0,e.clone=function t(e){if("[object Object]"===Object.prototype.toString.call(e)){var n={};for(var r in e)n[r]=t(e[r]);return n}return Array.isArray(e)?e.map(t):e}},7532:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Delete=void 0;var i=r(n(5615)),o=n(2265);function s(t,e){o.Facade.call(this,t,e)}e.Delete=s,i.default(s,o.Facade),s.prototype.type=function(){return"delete"}},2265:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Facade=void 0;var i=r(n(8971)),o=n(3194),s=r(n(7751)),u=r(n(7639)),a=r(n(8578)),c=r(n(518));function l(t,e){e=e||{},this.raw=o.clone(t),"clone"in e||(e.clone=!0),e.clone&&(t=o.clone(t)),"traverse"in e||(e.traverse=!0),t.timestamp="timestamp"in t?u.default(t.timestamp):new Date,e.traverse&&c.default(t),this.opts=e,this.obj=t}e.Facade=l;var f=l.prototype;function p(t){return o.clone(t)}f.proxy=function(t){var e=t.split("."),n=this[t=e.shift()]||this.field(t);return n?("function"==typeof n&&(n=n.call(this)||{}),0===e.length||(n=a.default(n,e.join("."))),this.opts.clone?p(n):n):n},f.field=function(t){var e=this.obj[t];return this.opts.clone?p(e):e},l.proxy=function(t){return function(){return this.proxy(t)}},l.field=function(t){return function(){return this.field(t)}},l.multi=function(t){return function(){var e=this.proxy(t+"s");if(Array.isArray(e))return e;var n=this.proxy(t);return n&&(n=[this.opts.clone?o.clone(n):n]),n||[]}},l.one=function(t){return function(){var e=this.proxy(t);if(e)return e;var n=this.proxy(t+"s");return Array.isArray(n)?n[0]:void 0}},f.json=function(){var t=this.opts.clone?o.clone(this.obj):this.obj;return this.type&&(t.type=this.type()),t},f.rawEvent=function(){return this.raw},f.options=function(t){var e=this.obj.options||this.obj.context||{},n=this.opts.clone?o.clone(e):e;if(!t)return n;if(this.enabled(t)){var r=this.integrations(),i=r[t]||a.default(r,t);return"object"!=typeof i&&(i=a.default(this.options(),t)),"object"==typeof i?i:{}}},f.context=f.options,f.enabled=function(t){var e=this.proxy("options.providers.all");"boolean"!=typeof e&&(e=this.proxy("options.all")),"boolean"!=typeof e&&(e=this.proxy("integrations.all")),"boolean"!=typeof e&&(e=!0);var n=e&&s.default(t),r=this.integrations();if(r.providers&&r.providers.hasOwnProperty(t)&&(n=r.providers[t]),r.hasOwnProperty(t)){var i=r[t];n="boolean"!=typeof i||i}return!!n},f.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()},f.active=function(){var t=this.proxy("options.active");return null==t&&(t=!0),t},f.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")},f.sessionId=f.anonymousId,f.groupId=l.proxy("options.groupId"),f.traits=function(t){var e=this.proxy("options.traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("options.traits."+r):this[r]();null!=i&&(e[t[r]]=i,delete e[r])}return e},f.library=function(){var t=this.proxy("options.library");return t?"string"==typeof t?{name:t,version:null}:t:{name:"unknown",version:null}},f.device=function(){var t=this.proxy("context.device");"object"==typeof t&&null!==t||(t={});var e=this.library().name;return t.type||(e.indexOf("ios")>-1&&(t.type="ios"),e.indexOf("android")>-1&&(t.type="android")),t},f.userAgent=l.proxy("context.userAgent"),f.timezone=l.proxy("context.timezone"),f.timestamp=l.field("timestamp"),f.channel=l.field("channel"),f.ip=l.proxy("context.ip"),f.userId=l.field("userId"),i.default(f)},7748:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;var i=r(n(5615)),o=r(n(6362)),s=r(n(7639)),u=n(2265);function a(t,e){u.Facade.call(this,t,e)}e.Group=a,i.default(a,u.Facade);var c=a.prototype;c.action=function(){return"group"},c.type=c.action,c.groupId=u.Facade.field("groupId"),c.created=function(){var t=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(t)return s.default(t)},c.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.groupId();return o.default(e)?e:void 0},c.traits=function(t){var e=this.properties(),n=this.groupId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("traits."+r):this[r]();null!=i&&(e[t[r]]=i,delete e[r])}return e},c.name=u.Facade.proxy("traits.name"),c.industry=u.Facade.proxy("traits.industry"),c.employees=u.Facade.proxy("traits.employees"),c.properties=function(){return this.field("traits")||this.field("properties")||{}}},5543:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Identify=void 0;var i=n(2265),o=r(n(8578)),s=r(n(5615)),u=r(n(6362)),a=r(n(7639)),c=function(t){return t.trim()};function l(t,e){i.Facade.call(this,t,e)}e.Identify=l,s.default(l,i.Facade);var f=l.prototype;f.action=function(){return"identify"},f.type=f.action,f.traits=function(t){var e=this.field("traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("traits."+r):this[r]();null!=i&&(e[t[r]]=i,r!==t[r]&&delete e[r])}return e},f.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.userId();return u.default(e)?e:void 0},f.created=function(){var t=this.proxy("traits.created")||this.proxy("traits.createdAt");if(t)return a.default(t)},f.companyCreated=function(){var t=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(t)return a.default(t)},f.companyName=function(){return this.proxy("traits.company.name")},f.name=function(){var t=this.proxy("traits.name");if("string"==typeof t)return c(t);var e=this.firstName(),n=this.lastName();return e&&n?c(e+" "+n):void 0},f.firstName=function(){var t=this.proxy("traits.firstName");if("string"==typeof t)return c(t);var e=this.proxy("traits.name");return"string"==typeof e?c(e).split(" ")[0]:void 0},f.lastName=function(){var t=this.proxy("traits.lastName");if("string"==typeof t)return c(t);var e=this.proxy("traits.name");if("string"==typeof e){var n=c(e).indexOf(" ");if(-1!==n)return c(e.substr(n+1))}},f.uid=function(){return this.userId()||this.username()||this.email()},f.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")},f.age=function(){var t=this.birthday(),e=o.default(this.traits(),"age");return null!=e?e:t instanceof Date?(new Date).getFullYear()-t.getFullYear():void 0},f.avatar=function(){var t=this.traits();return o.default(t,"avatar")||o.default(t,"photoUrl")||o.default(t,"avatarUrl")},f.position=function(){var t=this.traits();return o.default(t,"position")||o.default(t,"jobTitle")},f.username=i.Facade.proxy("traits.username"),f.website=i.Facade.one("traits.website"),f.websites=i.Facade.multi("traits.website"),f.phone=i.Facade.one("traits.phone"),f.phones=i.Facade.multi("traits.phone"),f.address=i.Facade.proxy("traits.address"),f.gender=i.Facade.proxy("traits.gender"),f.birthday=i.Facade.proxy("traits.birthday")},4303:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Delete=e.Screen=e.Page=e.Track=e.Identify=e.Group=e.Alias=e.Facade=void 0;var i=n(2265);Object.defineProperty(e,"Facade",{enumerable:!0,get:function(){return i.Facade}});var o=n(7663);Object.defineProperty(e,"Alias",{enumerable:!0,get:function(){return o.Alias}});var s=n(7748);Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return s.Group}});var u=n(5543);Object.defineProperty(e,"Identify",{enumerable:!0,get:function(){return u.Identify}});var a=n(5616);Object.defineProperty(e,"Track",{enumerable:!0,get:function(){return a.Track}});var c=n(3644);Object.defineProperty(e,"Page",{enumerable:!0,get:function(){return c.Page}});var l=n(6871);Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return l.Screen}});var f=n(7532);Object.defineProperty(e,"Delete",{enumerable:!0,get:function(){return f.Delete}}),e.default=r(r({},i.Facade),{Alias:o.Alias,Group:s.Group,Identify:u.Identify,Track:a.Track,Page:c.Page,Screen:l.Screen,Delete:f.Delete})},6362:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=/.+\@.+\..+/;e.default=function(t){return n.test(t)}},7751:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={Salesforce:!0};e.default=function(t){return!n[t]}},3644:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;var i=r(n(5615)),o=n(2265),s=n(5616),u=r(n(6362));function a(t,e){o.Facade.call(this,t,e)}e.Page=a,i.default(a,o.Facade);var c=a.prototype;c.action=function(){return"page"},c.type=c.action,c.category=o.Facade.field("category"),c.name=o.Facade.field("name"),c.title=o.Facade.proxy("properties.title"),c.path=o.Facade.proxy("properties.path"),c.url=o.Facade.proxy("properties.url"),c.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},c.properties=function(t){var e=this.field("properties")||{},n=this.category(),r=this.name();for(var i in t=t||{},n&&(e.category=n),r&&(e.name=r),t){var o=null==this[i]?this.proxy("properties."+i):this[i]();null!=o&&(e[t[i]]=o,i!==t[i]&&delete e[i])}return e},c.email=function(){var t=this.proxy("context.traits.email")||this.proxy("properties.email");if(t)return t;var e=this.userId();return u.default(e)?e:void 0},c.fullName=function(){var t=this.category(),e=this.name();return e&&t?t+" "+e:e},c.event=function(t){return t?"Viewed "+t+" Page":"Loaded a Page"},c.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new s.Track(e,this.opts)}},6871:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Screen=void 0;var i=r(n(5615)),o=n(3644),s=n(5616);function u(t,e){o.Page.call(this,t,e)}e.Screen=u,i.default(u,o.Page),u.prototype.action=function(){return"screen"},u.prototype.type=u.prototype.action,u.prototype.event=function(t){return t?"Viewed "+t+" Screen":"Loaded a Screen"},u.prototype.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new s.Track(e,this.opts)}},5616:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Track=void 0;var i=r(n(5615)),o=n(2265),s=n(5543),u=r(n(6362)),a=r(n(8578));function c(t,e){o.Facade.call(this,t,e)}e.Track=c,i.default(c,o.Facade);var l=c.prototype;l.action=function(){return"track"},l.type=l.action,l.event=o.Facade.field("event"),l.value=o.Facade.proxy("properties.value"),l.category=o.Facade.proxy("properties.category"),l.id=o.Facade.proxy("properties.id"),l.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")},l.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")},l.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")},l.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")},l.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")},l.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")},l.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")},l.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")},l.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")},l.sku=o.Facade.proxy("properties.sku"),l.tax=o.Facade.proxy("properties.tax"),l.name=o.Facade.proxy("properties.name"),l.price=o.Facade.proxy("properties.price"),l.total=o.Facade.proxy("properties.total"),l.repeat=o.Facade.proxy("properties.repeat"),l.coupon=o.Facade.proxy("properties.coupon"),l.shipping=o.Facade.proxy("properties.shipping"),l.discount=o.Facade.proxy("properties.discount"),l.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")},l.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")},l.description=o.Facade.proxy("properties.description"),l.plan=o.Facade.proxy("properties.plan"),l.subtotal=function(){var t=a.default(this.properties(),"subtotal"),e=this.total()||this.revenue();if(t)return t;if(!e)return 0;if(this.total()){var n=this.tax();n&&(e-=n),(n=this.shipping())&&(e-=n),(n=this.discount())&&(e+=n)}return e},l.products=function(){var t=this.properties(),e=a.default(t,"products");return Array.isArray(e)?e.filter(function(t){return null!==t}):[]},l.quantity=function(){return(this.obj.properties||{}).quantity||1},l.currency=function(){return(this.obj.properties||{}).currency||"USD"},l.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},l.query=o.Facade.proxy("options.query"),l.properties=function(t){var e=this.field("properties")||{};for(var n in t=t||{}){var r=null==this[n]?this.proxy("properties."+n):this[n]();null!=r&&(e[t[n]]=r,delete e[n])}return e},l.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()},l.email=function(){var t=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(t)return t;var e=this.userId();return u.default(e)?e:void 0},l.revenue=function(){var t=this.proxy("properties.revenue"),e=this.event();return!t&&e&&e.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(t=this.proxy("properties.total")),function(t){if(!t)return;if("number"==typeof t)return t;if("string"!=typeof t)return;if(t=t.replace(/\$/g,""),t=parseFloat(t),!isNaN(t))return t}(t)},l.cents=function(){var t=this.revenue();return"number"!=typeof t?this.value()||0:100*t},l.identify=function(){var t=this.json();return t.traits=this.traits(),new s.Identify(t,this.opts)}},518:function(t,e,n){"use strict";var r=n(7237);function i(t,e){return void 0===e&&(e=!0),t&&"object"==typeof t?function(t,e){return Object.keys(t).forEach(function(n){t[n]=i(t[n],e)}),t}(t,e):Array.isArray(t)?function(t,e){return t.forEach(function(n,r){t[r]=i(n,e)}),t}(t,e):r.is(t,e)?r.parse(t):t}t.exports=i},7237:function(t,e){"use strict";var n=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;e.parse=function(t){var e=[1,5,6,7,11,12],r=n.exec(t),i=0;if(!r)return new Date(t);for(var o,s=0;o=e[s];s++)r[o]=parseInt(r[o],10)||0;r[2]=parseInt(r[2],10)||1,r[3]=parseInt(r[3],10)||1,r[2]--,r[8]=r[8]?(r[8]+"00").substring(0,3):0," "===r[4]?i=(new Date).getTimezoneOffset():"Z"!==r[9]&&r[10]&&(i=60*r[11]+r[12],"+"===r[10]&&(i=0-i));var u=Date.UTC(r[1],r[2],r[3],r[5],r[6]+i,r[7],r[8]);return new Date(u)},e.is=function(t,e){return"string"==typeof t&&((!e||!1!==/^\d{4}-\d{2}-\d{2}/.test(t))&&n.test(t))}},5615:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},7639:function(t,e,n){"use strict";var r=n(7237),i=n(8101),o=n(4834),s=Object.prototype.toString;t.exports=function(t){return e=t,"[object Date]"===s.call(e)?t:function(t){return"[object Number]"===s.call(t)}(t)?new Date((n=t)<315576e5?1e3*n:n):r.is(t)?r.parse(t):i.is(t)?i.parse(t):o.is(t)?o.parse(t):new Date(t);var e,n}},8101:function(t,e){"use strict";var n=/\d{13}/;e.is=function(t){return n.test(t)},e.parse=function(t){return t=parseInt(t,10),new Date(t)}},4834:function(t,e){"use strict";var n=/\d{10}/;e.is=function(t){return n.test(t)},e.parse=function(t){var e=1e3*parseInt(t,10);return new Date(e)}},8578:function(t){function e(t){return function(e,n,r,o){var s,u=o&&function(t){return"function"==typeof t}(o.normalizer)?o.normalizer:i;n=u(n);for(var a=!1;!a;)c();function c(){for(s in e){var t=u(s);if(0===n.indexOf(t)){var r=n.substr(t.length);if("."===r.charAt(0)||0===r.length){n=r.substr(1);var i=e[s];return null==i?void(a=!0):n.length?void(e=i):void(a=!0)}}}s=void 0,a=!0}if(s)return null==e?e:t(e,s,r)}}function n(t,e){return t.hasOwnProperty(e)&&delete t[e],t}function r(t,e,n){return t.hasOwnProperty(e)&&(t[e]=n),t}function i(t){return t.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}t.exports=e(function(t,e){if(t.hasOwnProperty(e))return t[e]}),t.exports.find=t.exports,t.exports.replace=function(t,n,i,o){return e(r).call(this,t,n,i,o),t},t.exports.del=function(t,r,i){return e(n).call(this,t,r,null,i),t}},8110:function(t){t.exports=function(t){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(t,e){var n=t[0],r=t[1],i=t[2],o=t[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+e[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+e[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+e[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+e[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+e[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+e[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+e[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+e[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+e[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|r>>>11)+i|0,t[0]=n+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function i(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function o(t){var e,i,o,s,u,a,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,r(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)o[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,o[14]=u,o[15]=a,n(l,o),l}function s(t){var e,r,o,s,u,a,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,i(t.subarray(e-64,e)));for(r=(t=e-64<c?t.subarray(e-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<r;e+=1)o[e>>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,o[14]=u,o[15]=a,n(l,o),l}function u(t){var n,r="";for(n=0;n<4;n+=1)r+=e[t>>8*n+4&15]+e[t>>8*n&15];return r}function a(t){var e;for(e=0;e<t.length;e+=1)t[e]=u(t[e]);return t.join("")}function c(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function l(t,e){var n,r=t.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n<r;n+=1)o[n]=t.charCodeAt(n);return e?o:i}function f(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function p(t,e,n){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(new Uint8Array(t)),r.set(new Uint8Array(e),t.byteLength),n?r:r.buffer}function h(t){var e,n=[],r=t.length;for(e=0;e<r-1;e+=2)n.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,n)}function d(){this.reset()}return a(o("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return(t=0|t||0)<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(n,r){var i,o,s,u,a=this.byteLength,c=e(n,a),l=a;return r!==t&&(l=e(r,a)),c>l?new ArrayBuffer(0):(i=l-c,o=new ArrayBuffer(i),s=new Uint8Array(o),u=new Uint8Array(this,c,i),s.set(u),o)}}(),d.prototype.append=function(t){return this.appendBinary(c(t)),this},d.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)n(this._hash,r(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},d.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),n=a(this._hash),t&&(n=h(n)),this.reset(),n},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},d.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(t,e){var r,i,o,s=e;if(t[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,t),s=0;s<16;s+=1)t[s]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,t[14]=i,t[15]=o,n(this._hash,t)},d.hash=function(t,e){return d.hashBinary(c(t),e)},d.hashBinary=function(t,e){var n=a(o(t));return e?h(n):n},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(t){var e,r=p(this._buff.buffer,t,!0),o=r.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)n(this._hash,i(r.subarray(e-64,e)));return this._buff=e-64<o?new Uint8Array(r.buffer.slice(e-64)):new Uint8Array(0),this},d.ArrayBuffer.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r[e]<<(e%4<<3);return this._finish(o,i),n=a(this._hash),t&&(n=h(n)),this.reset(),n},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var t=d.prototype.getState.call(this);return t.buff=f(t.buff),t},d.ArrayBuffer.prototype.setState=function(t){return t.buff=l(t.buff,!0),d.prototype.setState.call(this,t)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(t,e){var n=a(s(new Uint8Array(t)));return e?h(n):n},d}()},6789:function(t,e,n){"use strict";n.d(e,{a:function(){return o},s:function(){return i}});var r=n(4082);function i(){return!(0,r.B)()||window.navigator.onLine}function o(){return!i()}},3858:function(t,e,n){"use strict";n.d(e,{a:function(){return r}});var r="us-east-1.hightouch-events.com"},5956:function(t,e,n){"use strict";n.d(e,{o:function(){return d}});var r=n(5608),i=n(9752),o=n(4034),s=n(824),u=n(6452),a=n(3831),c=n(3858);function l(t){console.error("Error sending hightouch performance metrics",t)}var f,p=function(){function t(t){var e,n,r,i,o=this;if(this.host=null!==(e=null==t?void 0:t.host)&&void 0!==e?e:c.a,this.sampleRate=null!==(n=null==t?void 0:t.sampleRate)&&void 0!==n?n:1,this.flushTimer=null!==(r=null==t?void 0:t.flushTimer)&&void 0!==r?r:3e4,this.maxQueueSize=null!==(i=null==t?void 0:t.maxQueueSize)&&void 0!==i?i:20,this.queue=[],this.sampleRate>0){var s=!1,u=function(){s||(s=!0,o.flush().catch(l),s=!1,setTimeout(u,o.flushTimer))};u()}}return t.prototype.increment=function(t,e){if(t.includes("analytics_js.")&&0!==e.length&&!(Math.random()>this.sampleRate||this.queue.length>=this.maxQueueSize)){var n=function(t,e,n){var i=e.reduce(function(t,e){var n=e.split(":"),r=n[0],i=n[1];return t[r]=i,t},{});return{type:"Counter",metric:t,value:1,tags:(0,r.Cl)((0,r.Cl)({},i),{library:"analytics.js",library_version:"web"===n?"next-".concat(u.r):"npm:next-".concat(u.r)})}}(t,e,(0,a.X)());this.queue.push(n),t.includes("error")&&this.flush().catch(l)}},t.prototype.flush=function(){return(0,r.sH)(this,void 0,Promise,function(){var t=this;return(0,r.YH)(this,function(e){switch(e.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(e){l(e),t.sampleRate=0})];case 1:return e.sent(),[2]}})})},t.prototype.send=function(){return(0,r.sH)(this,void 0,Promise,function(){var t,e,n;return(0,r.YH)(this,function(r){return t={series:this.queue},this.queue=[],e={Accept:"application/json","Content-Type":"application/json"},n="https://".concat(this.host,"/v1/m"),[2,(0,s.h)(n,{headers:e,body:JSON.stringify(t),method:"POST"})]})})},t}(),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.C6)(e,t),e.initRemoteMetrics=function(t){f=new p(t)},e.prototype.increment=function(e,n,r){t.prototype.increment.call(this,e,n,r),null==f||f.increment(e,null!=r?r:[])},e}(o.p),d=function(t){function e(e,n){return t.call(this,e,n,new h)||this}return(0,r.C6)(e,t),e.system=function(){return new this({type:"track",event:"system"})},e}(i.j)},4082:function(t,e,n){"use strict";function r(){return"undefined"!=typeof window}function i(){return!r()}n.d(e,{B:function(){return r},S:function(){return i}})},9059:function(t,e,n){"use strict";function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}}n.d(e,{p:function(){return r}})},6452:function(t,e,n){"use strict";n.d(e,{r:function(){return r}});var r="1.5.5"},824:function(t,e,n){"use strict";function r(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],s=[],u={},a=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return s},get:function(t){return u[t.toLowerCase()]},has:function(t){return t.toLowerCase()in u}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,n){o.push(e=e.toLowerCase()),s.push([e,n]),u[e]=u[e]?u[e]+","+n:n}),n(a())},i.onerror=r,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)})}n.d(e,{h:function(){return o}});var i=n(5120),o=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=(0,i.m)();return(n&&n.fetch||r).apply(void 0,t)}},5120:function(t,e,n){"use strict";n.d(e,{m:function(){return r}});var r=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:null}},6091:function(t,e,n){"use strict";n.d(e,{Ud:function(){return s},kJ:function(){return i},rY:function(){return o}});var r="htevents";function i(){return window[r]}function o(t){r=t}function s(t){window[r]=t}},6238:function(t,e,n){"use strict";function r(t){return Array.prototype.slice.call(window.document.querySelectorAll("script")).find(function(e){return e.src===t})}function i(t,e){var n=r(t);if(void 0!==n){var i=null==n?void 0:n.getAttribute("status");if("loaded"===i)return Promise.resolve(n);if("loading"===i)return new Promise(function(t,e){n.addEventListener("load",function(){return t(n)}),n.addEventListener("error",function(t){return e(t)})})}return new Promise(function(n,r){var i,o=window.document.createElement("script");o.type="text/javascript",o.src=t,o.async=!0,o.setAttribute("status","loading");for(var s=0,u=Object.entries(null!=e?e:{});s<u.length;s++){var a=u[s],c=a[0],l=a[1];o.setAttribute(c,l)}o.onload=function(){o.onerror=o.onload=null,o.setAttribute("status","loaded"),n(o)},o.onerror=function(){o.onerror=o.onload=null,o.setAttribute("status","error"),r(new Error("Failed to load ".concat(t)))};var f=window.document.getElementsByTagName("script")[0];null===(i=f.parentElement)||void 0===i||i.insertBefore(o,f)})}function o(t){var e=r(t);return void 0!==e&&e.remove(),Promise.resolve()}n.d(e,{d:function(){return o},k:function(){return i}})},5835:function(t,e,n){"use strict";n.d(e,{J:function(){return i}});var r=n(5608);function i(t,e){var n,i=Object.entries(null!==(n=e.integrations)&&void 0!==n?n:{}).reduce(function(t,e){var n,i,o=e[0],s=e[1];return"object"==typeof s?(0,r.Cl)((0,r.Cl)({},t),((n={})[o]=s,n)):(0,r.Cl)((0,r.Cl)({},t),((i={})[o]={},i))},{});return Object.entries(t.integrations).reduce(function(t,e){var n,o=e[0],s=e[1];return(0,r.Cl)((0,r.Cl)({},t),((n={})[o]=(0,r.Cl)((0,r.Cl)({},s),i[o]),n))},{})}},7106:function(t,e,n){"use strict";n.d(e,{_:function(){return i}});var r=n(5608),i=function(t,e){return(0,r.sH)(void 0,void 0,Promise,function(){var n;return(0,r.YH)(this,function(i){return n=function(i){return(0,r.sH)(void 0,void 0,Promise,function(){var o;return(0,r.YH)(this,function(r){switch(r.label){case 0:return t(i)?(o=n,[4,e()]):[3,2];case 1:return[2,o.apply(void 0,[r.sent()])];case 2:return[2]}})})},[2,n(void 0)]})})}},2911:function(t,e,n){"use strict";n.d(e,{I2:function(){return u},YM:function(){return a},qQ:function(){return s}});var r,i=n(6091),o=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,s=function(t){var e=(0,i.kJ)();e&&(e._cdn=t),r=t},u=function(){var t,e=null!=r?r:null===(t=(0,i.kJ)())||void 0===t?void 0:t._cdn;if(e)return e;var n,s=(Array.prototype.slice.call(document.querySelectorAll("script")).forEach(function(t){var e,r=null!==(e=t.getAttribute("src"))&&void 0!==e?e:"",i=o.exec(r);i&&i[1]&&(n=i[1])}),n);return s||"https://cdn.hightouch-events.com"},a=function(){var t=u();return"".concat(t,"/next-integrations")}},9732:function(t,e,n){"use strict";n.d(e,{x:function(){return p}});var r=n(5608),i=n(2939),o=n(5956),s=n(4082),u={getItem:function(){},setItem:function(){},removeItem:function(){}};try{u=(0,s.B)()&&window.localStorage?window.localStorage:u}catch(t){console.warn("Unable to access localStorage",t)}function a(t){var e=u.getItem(t);return(e?JSON.parse(e):[]).map(function(t){return new o.o(t.event,t.id)})}function c(t){var e=u.getItem(t);return e?JSON.parse(e):{}}function l(t){u.removeItem(t)}function f(t,e,n){void 0===n&&(n=0);var r="persisted-queue:v1:".concat(t,":lock"),i=u.getItem(r),o=i?JSON.parse(i):null,s=null===o||function(t){return(new Date).getTime()>t}(o);if(s)return u.setItem(r,JSON.stringify((new Date).getTime()+50)),e(),void u.removeItem(r);!s&&n<3?setTimeout(function(){f(t,e,n+1)},50):console.error("Unable to retrieve lock")}var p=function(t){function e(e,n){var i=t.call(this,e,[])||this,o="persisted-queue:v1:".concat(n,":items"),s="persisted-queue:v1:".concat(n,":seen"),p=[],h={};return f(n,function(){try{p=a(o),h=c(s),l(o),l(s),i.queue=(0,r.fX)((0,r.fX)([],p,!0),i.queue,!0),i.seen=(0,r.Cl)((0,r.Cl)({},h),i.seen)}catch(t){console.error(t)}}),window.addEventListener("pagehide",function(){if(i.todo>0){var t=(0,r.fX)((0,r.fX)([],i.queue,!0),i.future,!0);try{f(n,function(){!function(t,e){var n=a(t),i=(0,r.fX)((0,r.fX)([],e,!0),n,!0).reduce(function(t,e){var n;return(0,r.Cl)((0,r.Cl)({},t),((n={})[e.id]=e,n))},{});u.setItem(t,JSON.stringify(Object.values(i)))}(o,t),function(t,e){var n=c(t);u.setItem(t,JSON.stringify((0,r.Cl)((0,r.Cl)({},n),e)))}(s,i.seen)})}catch(t){console.error(t)}}}),i}return(0,r.C6)(e,t),e}(i.M)},7536:function(t,e,n){"use strict";n.d(e,{W:function(){return i}});var r=n(4303);function i(t,e){var n=new r.Facade(t,e);return"track"===t.type&&(n=new r.Track(t,e)),"identify"===t.type&&(n=new r.Identify(t,e)),"page"===t.type&&(n=new r.Page(t,e)),"alias"===t.type&&(n=new r.Alias(t,e)),"group"===t.type&&(n=new r.Group(t,e)),"screen"===t.type&&(n=new r.Screen(t,e)),Object.defineProperty(n,"obj",{value:t,writable:!0}),n}},3831:function(t,e,n){"use strict";n.d(e,{J:function(){return i},X:function(){return o}});var r="npm";function i(t){r=t}function o(){return r}},1418:function(t,e,n){"use strict";n.r(e),n.d(e,{applyDestinationMiddleware:function(){return s},sourceMiddlewarePlugin:function(){return u}});var r=n(5608),i=n(9752),o=n(7536);function s(t,e,n){return(0,r.sH)(this,void 0,Promise,function(){function i(e,n){return(0,r.sH)(this,void 0,Promise,function(){var i,s,u;return(0,r.YH)(this,function(a){switch(a.label){case 0:return i=!1,s=null,[4,n({payload:(0,o.W)(e,{clone:!0,traverse:!1}),integration:t,next:function(t){i=!0,null===t&&(s=null),t&&(s=t.obj)}})];case 1:return a.sent(),i||null===s||(s.integrations=(0,r.Cl)((0,r.Cl)({},e.integrations),((u={})[t]=!1,u))),[2,s]}})})}var s,u,a,c,l;return(0,r.YH)(this,function(t){switch(t.label){case 0:s=(0,o.W)(e,{clone:!0,traverse:!1}).rawEvent(),u=0,a=n,t.label=1;case 1:return u<a.length?(c=a[u],[4,i(s,c)]):[3,4];case 2:if(null===(l=t.sent()))return[2,null];s=l,t.label=3;case 3:return u++,[3,1];case 4:return[2,s]}})})}function u(t,e){function n(n){return(0,r.sH)(this,void 0,Promise,function(){var s;return(0,r.YH)(this,function(r){switch(r.label){case 0:return s=!1,[4,t({payload:(0,o.W)(n.event,{clone:!0,traverse:!1}),integrations:null!=e?e:{},next:function(t){s=!0,t&&(n.event=t.obj)}})];case 1:if(r.sent(),!s)throw new i.d({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(t){return Promise.resolve(t)},track:n,page:n,identify:n,alias:n,group:n}}},7764:function(t,e,n){"use strict";function r(t,e){return new Promise(function(n,r){var i=setTimeout(function(){r(Error("Promise timed out"))},e);t.then(function(t){return clearTimeout(i),n(t)}).catch(r)})}function i(t,e,n){var i;return(i=n,new Promise(function(t){return setTimeout(t,i)})).then(function(){return r(function(){try{return Promise.resolve(e(t))}catch(t){return Promise.reject(t)}}(),1e3)}).catch(function(e){null==t||t.log("warn","Callback Error",{error:e}),null==t||t.stats.increment("callback_error")}).then(function(){return t})}n.d(e,{s2:function(){return r},w_:function(){return i}})},9752:function(t,e,n){"use strict";n.d(e,{d:function(){return a},j:function(){return c}});var r=n(9659),i=n(3435),o=n(5608),s=function(){function t(){this._logs=[]}return t.prototype.log=function(t,e,n){var r=new Date;this._logs.push({level:t,message:e,time:r,extras:n})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(t,e){var n,r,i,s=(0,o.Cl)((0,o.Cl)({},e),{json:JSON.stringify(e.extras,null," "),extras:e.extras});delete s.time;var u=null!==(i=null===(r=e.time)||void 0===r?void 0:r.toISOString())&&void 0!==i?i:"";return t[u]&&(u="".concat(u,"-").concat(Math.random())),(0,o.Cl)((0,o.Cl)({},t),((n={})[u]=s,n))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(t){var e=t.level,n=t.message,r=t.extras;"info"===e||"debug"===e?console.log(n,null!=r?r:""):console[e](n,null!=r?r:"")});this._logs=[]},t}(),u=n(4034),a=function(t){var e,n,r;this.retry=null===(e=t.retry)||void 0===e||e,this.type=null!==(n=t.type)&&void 0!==n?n:"plugin Error",this.reason=null!==(r=t.reason)&&void 0!==r?r:""},c=function(){function t(t,e,n,i){void 0===e&&(e=(0,r.v4)()),void 0===n&&(n=new u.r),void 0===i&&(i=new s),this.attempts=0,this.event=t,this._id=e,this.logger=i,this.stats=n}return t.system=function(){},t.prototype.isSame=function(t){return t.id===this.id},t.prototype.cancel=function(t){if(t)throw t;throw new a({reason:"Context Cancel"})},t.prototype.log=function(t,e,n){this.logger.log(t,e,n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(t,e){var n;if("integrations"===t.split(".")[0]){var r=t.split(".")[1];if(!1===(null===(n=this.event.integrations)||void 0===n?void 0:n[r]))return this.event}return(0,i.J)(this.event,t,e),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(t){this._failedDelivery=t},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t}()},6551:function(t,e,n){"use strict";n.d(e,{v:function(){return r}});var r=function(){function t(){this.callbacks={}}return t.prototype.on=function(t,e){return this.callbacks[t]?this.callbacks[t].push(e):this.callbacks[t]=[e],this},t.prototype.once=function(t,e){var n=this,r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];n.off(t,r),e.apply(n,i)};return this.on(t,r),this},t.prototype.off=function(t,e){var n,r=(null!==(n=this.callbacks[t])&&void 0!==n?n:[]).filter(function(t){return t!==e});return this.callbacks[t]=r,this},t.prototype.emit=function(t){for(var e,n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(null!==(e=this.callbacks[t])&&void 0!==e?e:[]).forEach(function(t){t.apply(n,r)}),this},t}()},2939:function(t,e,n){"use strict";n.d(e,{g:function(){return o},M:function(){return s}});var r=n(5608),i=n(6551);var o="onRemoveFromFuture",s=function(t){function e(e,n,r){var i=t.call(this)||this;return i.future=[],i.maxAttempts=e,i.queue=n,i.seen=null!=r?r:{},i}return(0,r.C6)(e,t),e.prototype.push=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.map(function(e){return!(t.updateAttempts(e)>t.maxAttempts||t.includes(e))&&(t.queue.push(e),!0)});return this.queue=this.queue.sort(function(e,n){return t.getAttempts(e)-t.getAttempts(n)}),r},e.prototype.pushWithBackoff=function(t){var e=this;if(0===this.getAttempts(t))return this.push(t)[0];var n=this.updateAttempts(t);if(n>this.maxAttempts||this.includes(t))return!1;var r=function(t){var e=Math.random()+1,n=t.minTimeout,r=void 0===n?500:n,i=t.factor,o=void 0===i?2:i,s=t.attempt,u=t.maxTimeout,a=void 0===u?1/0:u;return Math.min(e*r*Math.pow(o,s),a)}({attempt:n-1});return setTimeout(function(){e.queue.push(t),e.future=e.future.filter(function(e){return e.id!==t.id}),e.emit(o)},r),this.future.push(t),!0},e.prototype.getAttempts=function(t){var e;return null!==(e=this.seen[t.id])&&void 0!==e?e:0},e.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},e.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find(function(e){return e.id===t.id}))||Boolean(this.future.find(function(e){return e.id===t.id}))},e.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e}(i.v)},2620:function(t,e,n){"use strict";n.d(e,{C:function(){return o},D:function(){return s}});var r=n(5608),i=n(9752);function o(t,e){t.log("debug","plugin",{plugin:e.name});var n=(new Date).getTime(),o=e[t.event.type];return void 0===o?Promise.resolve(t):function(t){return(0,r.sH)(this,void 0,void 0,function(){var e;return(0,r.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return[2,n.sent()];case 2:return e=n.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}(function(){return o.apply(e,[t])}).then(function(t){var r=(new Date).getTime()-n;return t.stats.gauge("plugin_time",r,["plugin:".concat(e.name)]),t}).catch(function(n){if(n instanceof i.d&&"middleware_cancellation"===n.type)throw n;return n instanceof i.d?(t.log("warn",n.type,{plugin:e.name,error:n}),n):(t.log("error","plugin Error",{plugin:e.name,error:n}),t.stats.increment("plugin_error",1,["plugin:".concat(e.name)]),n)})}function s(t,e){return o(t,e).then(function(e){if(e instanceof i.j)return e;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(e)})}},4034:function(t,e,n){"use strict";n.d(e,{p:function(){return i},r:function(){return o}});var r=n(5608),i=function(){function t(){this.metrics=[]}return t.prototype.increment=function(t,e,n){void 0===e&&(e=1),this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(t,e,n){this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var t=this.metrics.map(function(t){return(0,r.Cl)((0,r.Cl)({},t),{tags:t.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:(e=t.type,{gauge:"g",counter:"c"}[e]),e:t.timestamp};var e})},t}(),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.C6)(e,t),e.prototype.gauge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.increment=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.flush=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.serialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return[]},e}(i)},441:function(t,e,n){"use strict";function r(t){return"string"==typeof t}function i(t){return"number"==typeof t}function o(t){return"function"==typeof t}function s(t){return null!=t}function u(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}n.d(e,{Et:function(){return i},Kg:function(){return r},Qd:function(){return u},Tn:function(){return o},t2:function(){return s}})},9659:function(t,e,n){"use strict";n.d(e,{v4:function(){return s}});for(var r,i=256,o=[];i--;)o[i]=(i+256).toString(16).substring(1);function s(){var t,e=0,n="";if(!r||i+16>256){for(r=Array(e=256);e--;)r[e]=256*Math.random()|0;e=i=0}for(;e<16;e++)t=r[i+e],n+=6==e?o[15&t|64]:8==e?o[63&t|128]:o[t],1&e&&e>1&&e<11&&(n+="-");return i++,n}},3435:function(t,e,n){"use strict";function r(t,e,n){e.split&&(e=e.split("."));for(var r,i,o=0,s=e.length,u=t;o<s&&"__proto__"!=(i=""+e[o++])&&"constructor"!==i&&"prototype"!==i;)u=u[i]=o===s?n:typeof(r=u[i])==typeof e?r:0*e[o]!=0||~(""+e[o]).indexOf(".")?{}:[]}n.d(e,{J:function(){return r}})},5608:function(t,e,n){"use strict";n.d(e,{C6:function(){return i},Cl:function(){return o},Tt:function(){return s},YH:function(){return a},fX:function(){return c},sH:function(){return u}});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function u(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{a(r.next(t))}catch(t){o(t)}}function u(t){try{a(r.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,u)}a((r=r.apply(t,e||[])).next())})}function a(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}Object.create;function c(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;"function"==typeof SuppressedError&&SuppressedError}},o={};function s(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={exports:{}};return i[t].call(n.exports,n,n.exports,s),n.exports}s.m=i,s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},e=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);s.r(i);var o={};t=t||[null,e({}),e([]),e(e)];for(var u=2&r&&n;("object"==typeof u||"function"==typeof u)&&!~t.indexOf(u);u=e(u))Object.getOwnPropertyNames(u).forEach(function(t){o[t]=function(){return n[t]}});return o.default=function(){return n},s.d(i,o),i},s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.f={},s.e=function(t){return Promise.all(Object.keys(s.f).reduce(function(e,n){return s.f[n](t,e),e},[]))},s.u=function(t){return({10:"tsub-middleware",50:"ajs-destination",104:"schemaFilter",248:"auto-track",391:"google-tag-manager",521:"remoteMiddleware",538:"queryString",666:"gtag",694:"legacyVideos"}[t]||t)+".bundle."+{10:"b717b62fe947259b0454",50:"b5407b09b321c1d47d7c",104:"babb6cdbe396c20dc88f",248:"68ce13c2007188a9368d",391:"5dbd0ff300a5c429a406",407:"5cd2d2d625cfaa9e2f6e",521:"9945b0dd526dedecf614",538:"b86b3b6ef44fbbb98ec4",666:"fa18b007fc2891339158",694:"d1d6291274937f505b12"}[t]+".js"},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n={},r="@ht-sdks/events-sdk-js-browser:",s.l=function(t,e,i,o){if(n[t])n[t].push(e);else{var u,a;if(void 0!==i)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var f=c[l];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+i){u=f;break}}u||(a=!0,(u=document.createElement("script")).charset="utf-8",s.nc&&u.setAttribute("nonce",s.nc),u.setAttribute("data-webpack",r+i),u.src=t),n[t]=[e];var p=function(e,r){u.onerror=u.onload=null,clearTimeout(h);var i=n[t];if(delete n[t],u.parentNode&&u.parentNode.removeChild(u),i&&i.forEach(function(t){return t(r)}),e)return e(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),a&&document.head.appendChild(u)}},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.p="",function(){var t={57:0};s.f.j=function(e,n){var r=s.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(function(n,i){r=t[e]=[n,i]});n.push(r[2]=i);var o=s.p+s.u(e),u=new Error;s.l(o,function(n){if(s.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",u.name="ChunkLoadError",u.type=i,u.request=o,r[1](u)}},"chunk-"+e,e)}};var e=function(e,n){var r,i,o=n[0],u=n[1],a=n[2],c=0;if(o.some(function(e){return 0!==t[e]})){for(r in u)s.o(u,r)&&(s.m[r]=u[r]);if(a)a(s)}for(e&&e(n);c<o.length;c++)i=o[c],s.o(t,i)&&t[i]&&t[i][0](),t[i]=0},n=self.webpackChunk_ht_sdks_events_sdk_js_browser=self.webpackChunk_ht_sdks_events_sdk_js_browser||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))}();var u={};return function(){"use strict";s.r(u),s.d(u,{HtEventsBrowser:function(){return gn},loadLegacySettings:function(){return fn}});var t=s(2911),e=s(3831),n=s(5608);function r(){return"undefined"!=typeof process&&process.env?process.env:{}}var i=s(824),o=s(441);function a(t,e,n,r){var i,s=[t,e,n,r],u=(0,o.Qd)(t)?t.event:t;if(!u||!(0,o.Kg)(u))throw new Error("Event missing");var a=(0,o.Qd)(t)?null!==(i=t.properties)&&void 0!==i?i:{}:(0,o.Qd)(e)?e:{},c={};return(0,o.Tn)(n)||(c=null!=n?n:{}),(0,o.Qd)(t)&&!(0,o.Tn)(e)&&(c=null!=e?e:{}),[u,a,c,s.find(o.Tn)]}function c(t,e,n,r,i){var s,u,a=null,c=null,l=[t,e,n,r,i],f=l.filter(o.Kg);void 0!==f[0]&&void 0!==f[1]&&(a=f[0],c=f[1]),1===f.length&&(a=null,c=f[0]);var p=l.find(o.Tn),h=l.filter(function(t){return null===c?(0,o.Qd)(t):(0,o.Qd)(t)||null===t}),d=null!==(s=h[0])&&void 0!==s?s:{},v=null!==(u=h[1])&&void 0!==u?u:{};return[a,c,d,v,p]}var l=function(t){return function(){for(var e,n,r,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];for(var u={},a=["callback","options","traits","id"],c=0,l=i;c<l.length;c++){var f=l[c],p=a.pop();if("id"===p){if((0,o.Kg)(f)||(0,o.Et)(f)){u.id=f.toString();continue}if(null==f)continue;p=a.pop()}if("traits"!==p&&"options"!==p||null!=f&&!(0,o.Qd)(f)||(u[p]=f),(0,o.Tn)(f)){u.callback=f;break}}return[null!==(e=u.id)&&void 0!==e?e:t.id(),null!==(n=u.traits)&&void 0!==n?n:{},null!==(r=u.options)&&void 0!==r?r:{},u.callback]}};function f(t,e,n,r){(0,o.Et)(t)&&(t=t.toString()),(0,o.Et)(e)&&(e=e.toString());var i=[t,e,n,r],s=i.filter(o.Kg),u=s[0],a=void 0===u?t:u,c=s[1],l=void 0===c?null:c,f=i.filter(o.Qd)[0];return[a,l,void 0===f?{}:f,i.find(o.Tn)]}var p=s(6789),h=s(5956),d=s(7764);function v(t,e,r,i){return(0,n.sH)(this,void 0,void 0,function(){var o,s;return(0,n.YH)(this,function(n){switch(n.label){case 0:return r.emit("dispatch_start",t),o=Date.now(),e.isEmpty()?[4,e.dispatchSingle(t)]:[3,2];case 1:return s=n.sent(),[3,4];case 2:return[4,e.dispatch(t)];case 3:s=n.sent(),n.label=4;case 4:return(null==i?void 0:i.callback)?[4,(0,d.w_)(s,i.callback,(u=o,a=i.timeout,c=Date.now()-u,Math.max((null!=a?a:300)-c,0)))]:[3,6];case 5:s=n.sent(),n.label=6;case 6:return(null==i?void 0:i.debug)&&s.flush(),[2,s]}var u,a,c})})}var y=s(6551),g=s(9659),m=s(3435),b=s(8110),w=s.n(b);var _=function(t,e,n,r,i,o){return{__t:"bpc",c:e,p:r,u:t,s:n,t:i,r:o}},S=Object.keys(_("","","","","",""));var C=function(t){var e,n,r=t.c,i=t.p,o=t.s,s=t.u,u=t.r,a=t.t,c=r?function(t){try{return new URL(t).pathname}catch(e){return"/"===t[0]?t:"/"+t}}(r):i,l=r?function(t,e){return t.indexOf("?")>-1?t:t+e}(r,o):-1===(n=(e=s).indexOf("#"))?e:e.slice(0,n);return{path:c,referrer:u,search:o,title:a,url:l}},k=function(){var t=document.querySelector("link[rel='canonical']");return _(location.href,t&&t.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},x=function(t,e){void 0===e&&(e=C(k()));var r,i,o,s=t.context;"page"===t.type&&(r=t.properties&&(i=t.properties,o=Object.keys(e),Object.assign.apply(Object,(0,n.fX)([{}],o.map(function(t){var e;if(i&&Object.prototype.hasOwnProperty.call(i,t))return(e={})[t]=i[t],e}),!1))),t.properties=(0,n.Cl)((0,n.Cl)((0,n.Cl)({},e),t.properties),t.name?{name:t.name}:{})),s.page=(0,n.Cl)((0,n.Cl)((0,n.Cl)({},e),r),s.page)},I=function(){function t(t){this.user=t}return t.prototype.track=function(t,e,r,i,o){return this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),{event:t,type:"track",properties:e,options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i)}),o)},t.prototype.page=function(t,e,r,i,o,s){var u,a={type:"page",properties:(0,n.Cl)({},r),options:(0,n.Cl)({},i),integrations:(0,n.Cl)({},o)};return null!==t&&(a.category=t,a.properties=null!==(u=a.properties)&&void 0!==u?u:{},a.properties.category=t),null!==e&&(a.name=e),this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),a),s)},t.prototype.screen=function(t,e,r,i,o,s){var u={type:"screen",properties:(0,n.Cl)({},r),options:(0,n.Cl)({},i),integrations:(0,n.Cl)({},o)};return null!==t&&(u.category=t),null!==e&&(u.name=e),this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),u),s)},t.prototype.identify=function(t,e,r,i,o){return this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),{type:"identify",userId:t,traits:e,options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i)}),o)},t.prototype.group=function(t,e,r,i,o){return this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),{type:"group",traits:e,options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i),groupId:t}),o)},t.prototype.alias=function(t,e,r,i,o){var s={userId:t,type:"alias",options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i)};return null!==e&&(s.previousId=e),void 0===t?this.normalize((0,n.Cl)((0,n.Cl)({},s),this.baseEvent())):this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),s),o)},t.prototype.baseEvent=function(){var t={integrations:{},options:{}},e=this.user;return e.id()&&(t.userId=e.id()),e.anonymousId()&&(t.anonymousId=e.anonymousId()),t},t.prototype.context=function(t){var e,n,r,i=["integrations","anonymousId","timestamp","userId"],o=null!==(e=t.options)&&void 0!==e?e:{};delete o.integrations;var s=Object.keys(o),u=null!==(r=null===(n=t.options)||void 0===n?void 0:n.context)&&void 0!==r?r:{},a={};return s.forEach(function(t){"context"!==t&&(i.includes(t)?(0,m.J)(a,t,o[t]):(0,m.J)(u,t,o[t]))}),[u,a]},t.prototype.normalize=function(t,e){var r,i,o;(null===(r=t.options)||void 0===r?void 0:r.anonymousId)&&this.user.anonymousId(t.options.anonymousId);var s=Object.keys(null!==(i=t.integrations)&&void 0!==i?i:{}).reduce(function(e,r){var i,o;return(0,n.Cl)((0,n.Cl)({},e),((i={})[r]=Boolean(null===(o=t.integrations)||void 0===o?void 0:o[r]),i))},{}),u=(0,n.Cl)((0,n.Cl)({},s),null===(o=t.options)||void 0===o?void 0:o.integrations),a=this.context(t),c=a[0],l=a[1],f=(t.options,(0,n.Tt)(t,["options"])),p=(0,n.Cl)((0,n.Cl)((0,n.Cl)((0,n.Cl)({timestamp:new Date},f),{context:c,integrations:u}),l),{messageId:w().hash(JSON.stringify(t)+(0,g.v4)())});x(p,e);var h=this.user.getAndUpdateSession();return null!=h&&(p.context=(0,n.Cl)((0,n.Cl)({},p.context),h)),p},t}(),j=s(9732);var P=s(2939),O=s(9752),A=s(2620),H=function(t){function e(e){var n,r,i,o=t.call(this)||this;return o.criticalTasks=(i=0,{done:function(){return n},run:function(t){var e,o=t();return"object"==typeof(e=o)&&null!==e&&"then"in e&&"function"==typeof e.then&&(1===++i&&(n=new Promise(function(t){return r=t})),o.finally(function(){return 0===--i&&r()})),o}}),o.plugins=[],o.failedInitializations=[],o.flushing=!1,o.queue=e,o.queue.on(P.g,function(){o.scheduleFlush(0)}),o}return(0,n.C6)(e,t),e.prototype.register=function(t,e,r){return(0,n.sH)(this,void 0,void 0,function(){var i=this;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,Promise.resolve(e.load(t,r)).then(function(){i.plugins.push(e)}).catch(function(n){if("destination"===e.type)return i.failedInitializations.push(e.name),console.warn(e.name,n),void t.log("warn","Failed to load destination",{plugin:e.name,error:n});throw n})];case 1:return n.sent(),[2]}})})},e.prototype.deregister=function(t,e,r){return(0,n.sH)(this,void 0,void 0,function(){var i;return(0,n.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),e.unload?[4,Promise.resolve(e.unload(t,r))]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.plugins=this.plugins.filter(function(t){return t.name!==e.name}),[3,4];case 3:return i=n.sent(),t.log("warn","Failed to unload destination",{plugin:e.name,error:i}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e;return(0,n.YH)(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),e=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,e]})})},e.prototype.subscribeToDelivery=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e=this;return(0,n.YH)(this,function(n){return[2,new Promise(function(n){var r=function(i,o){i.isSame(t)&&(e.off("flush",r),n(i))};e.on("flush",r)})]})})},e.prototype.dispatchSingle=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e=this;return(0,n.YH)(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(n){return e.enqueuRetry(n,t)?e.subscribeToDelivery(t):(t.setFailedDelivery({reason:n}),t)})]})})},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype.scheduleFlush=function(t){var e=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout(function(){e.flush().then(function(){setTimeout(function(){e.flushing=!1,e.queue.length&&e.scheduleFlush(0)},0)})},t))},e.prototype.deliver=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e,r,i,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,this.criticalTasks.done()];case 1:n.sent(),e=Date.now(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=n.sent(),r=Date.now()-e,this.emit("delivery_success",t),t.stats.gauge("delivered",r),t.log("debug","Delivered",t.event),[2,t];case 4:throw i=n.sent(),o=i,t.log("error","Failed to deliver",o),this.emit("delivery_failure",t,o),t.stats.increment("delivery_failed"),i;case 5:return[2]}})})},e.prototype.enqueuRetry=function(t,e){return!(t instanceof O.d&&!t.retry)&&this.queue.pushWithBackoff(e)},e.prototype.flush=function(){return(0,n.sH)(this,void 0,void 0,function(){var t,e;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(0===this.queue.length)return[2,[]];if(!(t=this.queue.pop()))return[2,[]];t.attempts=this.queue.getAttempts(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=n.sent(),this.emit("flush",t,!0),[3,4];case 3:return e=n.sent(),this.enqueuRetry(e,t)||(t.setFailedDelivery({reason:e}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var e,r,i=this.plugins.filter(function(e){var n,r,i;if("destination"!==e.type&&"Hightouch.io"!==e.name)return!0;var o=void 0;return null===(n=e.alternativeNames)||void 0===n||n.forEach(function(e){void 0!==t[e]&&(o=t[e])}),null!==(i=null!==(r=t[e.name])&&void 0!==r?r:o)&&void 0!==i?i:!1!==("Hightouch.io"===e.name||t.All)}),o=(e="type",r={},i.forEach(function(t){var i,o=void 0;if("string"==typeof e){var s=t[e];o="string"!=typeof s?JSON.stringify(s):s}else e instanceof Function&&(o=e(t));void 0!==o&&(r[o]=(0,n.fX)((0,n.fX)([],null!==(i=r[o])&&void 0!==i?i:[],!0),[t],!1))}),r),s=o.before,u=void 0===s?[]:s,a=o.enrichment,c=void 0===a?[]:a,l=o.destination,f=void 0===l?[]:l,p=o.after;return{before:u,enrichment:c,destinations:f,after:void 0===p?[]:p}},e.prototype.flushOne=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e,r,i,o,s,u,a,c,l,f,p,h,d,v,y,g;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),e=this.availableExtensions(null!==(y=t.event.integrations)&&void 0!==y?y:{}),r=e.before,i=e.enrichment,o=0,s=r,n.label=1;case 1:return o<s.length?(u=s[o],[4,(0,A.D)(t,u)]):[3,4];case 2:(f=n.sent())instanceof O.j&&(t=f),this.emit("message_enriched",t,u),n.label=3;case 3:return o++,[3,1];case 4:a=0,c=i,n.label=5;case 5:return a<c.length?(l=c[a],[4,(0,A.C)(t,l)]):[3,8];case 6:(f=n.sent())instanceof O.j&&(t=f),this.emit("message_enriched",t,l),n.label=7;case 7:return a++,[3,5];case 8:return p=this.availableExtensions(null!==(g=t.event.integrations)&&void 0!==g?g:{}),h=p.destinations,d=p.after,[4,new Promise(function(e,n){setTimeout(function(){var r=h.map(function(e){return(0,A.C)(t,e)});Promise.all(r).then(e).catch(n)},0)})];case 9:return n.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),v=d.map(function(e){return(0,A.C)(t,e)}),[4,Promise.all(v)];case 10:return n.sent(),[2,t]}})})},e}(y.v),M=function(t){function e(e){return t.call(this,"string"==typeof e?new j.x(4,e):e)||this}return(0,n.C6)(e,t),e.prototype.flush=function(){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){return(0,p.a)()?[2,[]]:[2,t.prototype.flush.call(this)]})})},e}(H);function E(t){for(var e=t.constructor.prototype,n=0,r=Object.getOwnPropertyNames(e);n<r.length;n++){var i=r[n];if("constructor"!==i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&"function"==typeof o.value&&(t[i]=t[i].bind(t))}}return t}var T={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"},F=function(t,e,n,r){console.warn("".concat(t.constructor.name,": Can't ").concat(e,' key "').concat(n,'" | Err: ').concat(r))},D=function(){function t(t){this.stores=t}return t.prototype.get=function(t){for(var e=null,n=0,r=this.stores;n<r.length;n++){var i=r[n];try{if(null!=(e=i.get(t)))return e}catch(e){F(i,"get",t,e)}}return null},t.prototype.set=function(t,e){this.stores.forEach(function(n){try{n.set(t,e)}catch(e){F(n,"set",t,e)}})},t.prototype.clear=function(t){this.stores.forEach(function(e){try{e.remove(t)}catch(n){F(e,"remove",t,n)}})},t.prototype.getAndSync=function(t){var e=this.get(t),n="number"==typeof e?e.toString():e;return this.set(t,n),n},t}(),B=function(){function t(){this.cache={}}return t.prototype.get=function(t){var e;return null!==(e=this.cache[t])&&void 0!==e?e:null},t.prototype.set=function(t,e){this.cache[t]=e},t.prototype.remove=function(t){delete this.cache[t]},t}();function z(t){return t&&t.stores&&Array.isArray(t.stores)&&t.stores.every(function(t){return Object.values(T).includes(t)})}function q(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var U=function t(e,n){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=q({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var s in i)i[s]&&(o+="; "+s,!0!==i[s]&&(o+="="+i[s].split(";")[0]));return document.cookie=t+"="+e.write(r,t)+o}}return Object.create({set:r,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),s=o.slice(1).join("=");try{var u=decodeURIComponent(o[0]);if(r[u]=e.read(s,u),t===u)break}catch(t){}}return t?r[t]:r}},remove:function(t,e){r(t,"",q({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,q({},this.attributes,e))},withConverter:function(e){return t(q({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Y=U;function N(t){var e=function(t){try{return new URL(t)}catch(t){return}}(t);if(e)for(var n=function(t){var e=t.hostname.split("."),n=e[e.length-1],r=[];if(4===e.length&&parseInt(n,10)>0)return r;if(e.length<=1)return r;for(var i=e.length-2;i>=0;--i)r.push(e.slice(i).join("."));return r}(e),r=0;r<n.length;++r){var i=Math.round(1e4*Math.random()).toString(),o=n[r],s={domain:"."+o,path:"/",sameSite:"Lax"};try{if(Y.set(i,"1",s),Y.get(i))return Y.remove(i,s),o}catch(t){return}}}var R,K,L,J,X,Q,W=function(){function t(e){void 0===e&&(e=t.defaults),this.options=(0,n.Cl)((0,n.Cl)({},t.defaults),e)}return Object.defineProperty(t,"defaults",{get:function(){return{maxage:365,domain:N(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),t.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},t.prototype.get=function(t){var e;try{var n=Y.get(t);if(null==n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(t){return null}},t.prototype.set=function(t,e){"string"==typeof e?Y.set(t,e,this.opts()):null===e?Y.remove(t,this.opts()):Y.set(t,JSON.stringify(e),this.opts())},t.prototype.remove=function(t){return Y.remove(t,this.opts())},t}(),V=function(){function t(){}return t.prototype.localStorageWarning=function(t,e){console.warn("Unable to access ".concat(t,", localStorage may be ").concat(e))},t.prototype.get=function(t){var e;try{var n=localStorage.getItem(t);if(null===n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(e){return this.localStorageWarning(t,"unavailable"),null}},t.prototype.set=function(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){this.localStorageWarning(t,"full")}},t.prototype.remove=function(t){try{return localStorage.removeItem(t)}catch(e){this.localStorageWarning(t,"unavailable")}},t}();function G(t){return t.map(function(t){var e,n;switch(!function(t){return"object"==typeof t&&void 0!==t.name}(t)?e=t:(e=t.name,n=t.settings),e){case T.Cookie:return new W(n);case T.LocalStorage:return new V;case T.Memory:return new B;default:throw new Error("Unknown Store Type: ".concat(t))}})}function $(t,e){return t.map(function(t){return e&&t===T.Cookie?{name:t,settings:e}:t})}var Z,tt=(null===(R="undefined"!=typeof globalThis?globalThis:void 0)||void 0===R?void 0:R.crypto)||(null===(K="undefined"!=typeof global?global:void 0)||void 0===K?void 0:K.crypto)||(null===(L="undefined"!=typeof window?window:void 0)||void 0===L?void 0:L.crypto)||(null===(J="undefined"!=typeof self?self:void 0)||void 0===J?void 0:J.crypto)||(null===(Q=null===(X="undefined"!=typeof frames?frames:void 0)||void 0===X?void 0:X[0])||void 0===Q?void 0:Q.crypto);Z=tt?function(t){for(var e=[],n=0;n<t;n+=4)e.push(tt.getRandomValues(new Uint32Array(1))[0]);return new nt(e,t)}:function(t){for(var e=[],n=function(t){var e=t,n=987654321,r=4294967295;return function(){var t=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return t/=4294967296,(t+=.5)*(Math.random()>.5?1:-1)}},r=0,i=void 0;r<t;r+=4){var o=n(4294967296*(i||Math.random()));i=987654071*o(),e.push(4294967296*o()|0)}return new nt(e,t)};for(var et=function(){function t(){}return t.create=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(this.bind.apply(this,(0,n.fX)([void 0],t,!1)))},t.prototype.mixIn=function(t){return Object.assign(this,t)},t.prototype.clone=function(){var t=new this.constructor;return Object.assign(t,this),t},t}(),nt=function(t){function e(e,n){void 0===e&&(e=[]),void 0===n&&(n=4*e.length);var r=t.call(this)||this,i=e;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),(i instanceof Int8Array||i instanceof Uint8ClampedArray||i instanceof Int16Array||i instanceof Uint16Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Float32Array||i instanceof Float64Array)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),i instanceof Uint8Array){for(var o=i.byteLength,s=[],u=0;u<o;u+=1)s[u>>>2]|=i[u]<<24-u%4*8;r.words=s,r.sigBytes=o}else r.words=e,r.sigBytes=n;return r}return(0,n.C6)(e,t),e.prototype.toString=function(t){return void 0===t&&(t=rt),t.stringify(this)},e.prototype.concat=function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o+=1){var s=n[o>>>2]>>>24-o%4*8&255;e[r+o>>>2]|=s<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)e[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},e.prototype.clamp=function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=Math.ceil(e/4)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e.words=this.words.slice(0),e},e.random=Z,e}(et),rt={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i+=1){var o=e[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new nt(n,e/2)}},it=function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i+=1){var o=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},ot=function(t){for(var e=t.length,n=[],r=0;r<e;r+=1)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new nt(n,e)},st={stringify:function(t){try{return decodeURIComponent(escape(it(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return ot(unescape(encodeURIComponent(t)))}},ut=function(t){function e(){var e=t.call(this)||this;return e._minBufferSize=0,e}return(0,n.C6)(e,t),e.prototype.reset=function(){this._data=new nt,this._nDataBytes=0},e.prototype._append=function(t){var e=t;"string"==typeof e&&(e=st.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},e.prototype._process=function(t){var e,n=this._data,r=this.blockSize,i=n.words,o=n.sigBytes,s=o/(4*r),u=(s=t?Math.ceil(s):Math.max((0|s)-this._minBufferSize,0))*r,a=Math.min(4*u,o);if(u){for(var c=0;c<u;c+=r)this._doProcessBlock(i,c);e=i.splice(0,u),n.sigBytes-=a}return new nt(e,a)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._data=this._data.clone(),e},e}(et),at=function(t){function e(e){var n=t.call(this)||this;return n.blockSize=16,n.cfg=Object.assign(new et,e),n.reset(),n}return(0,n.C6)(e,t),e._createHelper=function(t){return function(e,n){return new t(n).finalize(e)}},e._createHmacHelper=function(t){return function(e,n){return new ct(t,n).finalize(e)}},e.prototype.reset=function(){t.prototype.reset.call(this),this._doReset()},e.prototype.update=function(t){return this._append(t),this._process(),this},e.prototype.finalize=function(t){return t&&this._append(t),this._doFinalize()},e}(ut),ct=function(t){function e(e,n){var r=t.call(this)||this,i=new e;r._hasher=i;var o=n;"string"==typeof o&&(o=st.parse(o));var s=i.blockSize,u=4*s;o.sigBytes>u&&(o=i.finalize(n)),o.clamp();var a=o.clone();r._oKey=a;var c=o.clone();r._iKey=c;for(var l=a.words,f=c.words,p=0;p<s;p+=1)l[p]^=1549556828,f[p]^=909522486;return a.sigBytes=u,c.sigBytes=u,r.reset(),r}return(0,n.C6)(e,t),e.prototype.reset=function(){var t=this._hasher;t.reset(),t.update(this._iKey)},e.prototype.update=function(t){return this._hasher.update(t),this},e.prototype.finalize=function(t){var e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))},e}(et),lt={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,u=0;u<4&&o+.75*u<n;u+=1)i.push(r.charAt(s>>>6*(3-u)&63));var a=r.charAt(64);if(a)for(;i.length%4;)i.push(a);return i.join("")},parse:function(t){var e=t.length,n=this._map,r=this._reverseMap;if(!r){this._reverseMap=[],r=this._reverseMap;for(var i=0;i<n.length;i+=1)r[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var s=t.indexOf(o);-1!==s&&(e=s)}return function(t,e,n){for(var r=[],i=0,o=0;o<e;o+=1)if(o%4){var s=n[t.charCodeAt(o-1)]<<o%4*2|n[t.charCodeAt(o)]>>>6-o%4*2;r[i>>>2]|=s<<24-i%4*8,i+=1}return nt.create(r,i)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},ft=[],pt=0;pt<64;pt+=1)ft[pt]=4294967296*Math.abs(Math.sin(pt+1))|0;var ht=function(t,e,n,r,i,o,s){var u=t+(e&n|~e&r)+i+s;return(u<<o|u>>>32-o)+e},dt=function(t,e,n,r,i,o,s){var u=t+(e&r|n&~r)+i+s;return(u<<o|u>>>32-o)+e},vt=function(t,e,n,r,i,o,s){var u=t+(e^n^r)+i+s;return(u<<o|u>>>32-o)+e},yt=function(t,e,n,r,i,o,s){var u=t+(n^(e|~r))+i+s;return(u<<o|u>>>32-o)+e},gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype._doReset=function(){this._hash=new nt([1732584193,4023233417,2562383102,271733878])},e.prototype._doProcessBlock=function(t,e){for(var n=t,r=0;r<16;r+=1){var i=e+r,o=t[i];n[i]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var s=this._hash.words,u=n[e+0],a=n[e+1],c=n[e+2],l=n[e+3],f=n[e+4],p=n[e+5],h=n[e+6],d=n[e+7],v=n[e+8],y=n[e+9],g=n[e+10],m=n[e+11],b=n[e+12],w=n[e+13],_=n[e+14],S=n[e+15],C=s[0],k=s[1],x=s[2],I=s[3];C=ht(C,k,x,I,u,7,ft[0]),I=ht(I,C,k,x,a,12,ft[1]),x=ht(x,I,C,k,c,17,ft[2]),k=ht(k,x,I,C,l,22,ft[3]),C=ht(C,k,x,I,f,7,ft[4]),I=ht(I,C,k,x,p,12,ft[5]),x=ht(x,I,C,k,h,17,ft[6]),k=ht(k,x,I,C,d,22,ft[7]),C=ht(C,k,x,I,v,7,ft[8]),I=ht(I,C,k,x,y,12,ft[9]),x=ht(x,I,C,k,g,17,ft[10]),k=ht(k,x,I,C,m,22,ft[11]),C=ht(C,k,x,I,b,7,ft[12]),I=ht(I,C,k,x,w,12,ft[13]),x=ht(x,I,C,k,_,17,ft[14]),k=ht(k,x,I,C,S,22,ft[15]),C=dt(C,k,x,I,a,5,ft[16]),I=dt(I,C,k,x,h,9,ft[17]),x=dt(x,I,C,k,m,14,ft[18]),k=dt(k,x,I,C,u,20,ft[19]),C=dt(C,k,x,I,p,5,ft[20]),I=dt(I,C,k,x,g,9,ft[21]),x=dt(x,I,C,k,S,14,ft[22]),k=dt(k,x,I,C,f,20,ft[23]),C=dt(C,k,x,I,y,5,ft[24]),I=dt(I,C,k,x,_,9,ft[25]),x=dt(x,I,C,k,l,14,ft[26]),k=dt(k,x,I,C,v,20,ft[27]),C=dt(C,k,x,I,w,5,ft[28]),I=dt(I,C,k,x,c,9,ft[29]),x=dt(x,I,C,k,d,14,ft[30]),k=dt(k,x,I,C,b,20,ft[31]),C=vt(C,k,x,I,p,4,ft[32]),I=vt(I,C,k,x,v,11,ft[33]),x=vt(x,I,C,k,m,16,ft[34]),k=vt(k,x,I,C,_,23,ft[35]),C=vt(C,k,x,I,a,4,ft[36]),I=vt(I,C,k,x,f,11,ft[37]),x=vt(x,I,C,k,d,16,ft[38]),k=vt(k,x,I,C,g,23,ft[39]),C=vt(C,k,x,I,w,4,ft[40]),I=vt(I,C,k,x,u,11,ft[41]),x=vt(x,I,C,k,l,16,ft[42]),k=vt(k,x,I,C,h,23,ft[43]),C=vt(C,k,x,I,y,4,ft[44]),I=vt(I,C,k,x,b,11,ft[45]),x=vt(x,I,C,k,S,16,ft[46]),k=vt(k,x,I,C,c,23,ft[47]),C=yt(C,k,x,I,u,6,ft[48]),I=yt(I,C,k,x,d,10,ft[49]),x=yt(x,I,C,k,_,15,ft[50]),k=yt(k,x,I,C,p,21,ft[51]),C=yt(C,k,x,I,b,6,ft[52]),I=yt(I,C,k,x,l,10,ft[53]),x=yt(x,I,C,k,g,15,ft[54]),k=yt(k,x,I,C,a,21,ft[55]),C=yt(C,k,x,I,v,6,ft[56]),I=yt(I,C,k,x,S,10,ft[57]),x=yt(x,I,C,k,h,15,ft[58]),k=yt(k,x,I,C,w,21,ft[59]),C=yt(C,k,x,I,f,6,ft[60]),I=yt(I,C,k,x,m,10,ft[61]),x=yt(x,I,C,k,c,15,ft[62]),k=yt(k,x,I,C,y,21,ft[63]),s[0]=s[0]+C|0,s[1]=s[1]+k|0,s[2]=s[2]+x|0,s[3]=s[3]+I|0},e.prototype._doFinalize=function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32;var i=Math.floor(n/4294967296),o=n;e[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(e.length+1),this._process();for(var s=this._hash,u=s.words,a=0;a<4;a+=1){var c=u[a];u[a]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._hash=this._hash.clone(),e},e}(at),mt=(at._createHelper(gt),at._createHmacHelper(gt),function(t){function e(e){var n=t.call(this)||this;return n.cfg=Object.assign(new et,{keySize:4,hasher:gt,iterations:1},e),n}return(0,n.C6)(e,t),e.prototype.compute=function(t,e){for(var n,r=this.cfg,i=r.hasher.create(),o=nt.create(),s=o.words,u=r.keySize,a=r.iterations;s.length<u;){n&&i.update(n),n=i.update(t).finalize(e),i.reset();for(var c=1;c<a;c+=1)n=i.finalize(n),i.reset();o.concat(n)}return o.sigBytes=4*u,o},e}(et)),bt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.cfg=Object.assign(new et,r),i._xformMode=e,i._key=n,i.reset(),i}return(0,n.C6)(e,t),e.createEncryptor=function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},e.createDecryptor=function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},e._createHelper=function(t){var e=function(t){return"string"==typeof t?Pt:It};return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}},e.prototype.reset=function(){t.prototype.reset.call(this),this._doReset()},e.prototype.process=function(t){return this._append(t),this._process()},e.prototype.finalize=function(t){return t&&this._append(t),this._doFinalize()},e}(ut);bt._ENC_XFORM_MODE=1,bt._DEC_XFORM_MODE=2,bt.keySize=4,bt.ivSize=4;!function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,e)||this;return r.blockSize=1,r}(0,n.C6)(e,t),e.prototype._doFinalize=function(){return this._process(!0)}}(bt);function wt(t,e,n){var r,i=t,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var s=0;s<n;s+=1)i[e+s]^=r[s]}var _t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e}(function(t){function e(e,n){var r=t.call(this)||this;return r._cipher=e,r._iv=n,r}return(0,n.C6)(e,t),e.createEncryptor=function(t,e){return this.Encryptor.create(t,e)},e.createDecryptor=function(t,e){return this.Decryptor.create(t,e)},e}(et));_t.Encryptor=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype.processBlock=function(t,e){var n=this._cipher,r=n.blockSize;wt.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)},e}(_t),_t.Decryptor=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype.processBlock=function(t,e){var n=this._cipher,r=n.blockSize,i=t.slice(e,e+r);n.decryptBlock(t,e),wt.call(this,t,e,r),this._prevBlock=i},e}(_t);var St={pad:function(t,e){for(var n=4*e,r=n-t.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var u=nt.create(o,r);t.concat(u)},unpad:function(t){var e=t,n=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=n}},Ct=function(t){function e(e,n,r){var i=t.call(this,e,n,Object.assign({mode:_t,padding:St},r))||this;return i.blockSize=4,i}return(0,n.C6)(e,t),e.prototype.reset=function(){var e;t.prototype.reset.call(this);var n=this.cfg,r=n.iv,i=n.mode;this._xformMode===this.constructor._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode=e.call(i,this,r&&r.words),this._mode.__creator=e},e.prototype._doProcessBlock=function(t,e){this._mode.processBlock(t,e)},e.prototype._doFinalize=function(){var t,e=this.cfg.padding;return this._xformMode===this.constructor._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},e}(bt),kt=function(t){function e(e){var n=t.call(this)||this;return n.mixIn(e),n}return(0,n.C6)(e,t),e.prototype.toString=function(t){return(t||this.formatter).stringify(this)},e}(et),xt={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?nt.create([1398893684,1701076831]).concat(n).concat(e):e).toString(lt)},parse:function(t){var e,n=lt.parse(t),r=n.words;return 1398893684===r[0]&&1701076831===r[1]&&(e=nt.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),kt.create({ciphertext:n,salt:e})}},It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.encrypt=function(t,e,n,r){var i=Object.assign(new et,this.cfg,r),o=t.createEncryptor(n,i),s=o.finalize(e),u=o.cfg;return kt.create({ciphertext:s,key:n,iv:u.iv,algorithm:t,mode:u.mode,padding:u.padding,blockSize:o.blockSize,formatter:i.format})},e.decrypt=function(t,e,n,r){var i=e,o=Object.assign(new et,this.cfg,r);return i=this._parse(i,o.format),t.createDecryptor(n,o).finalize(i.ciphertext)},e._parse=function(t,e){return"string"==typeof t?e.parse(t,this):t},e}(et);It.cfg=Object.assign(new et,{format:xt});var jt={execute:function(t,e,n,r,i){var o,s=r;s||(s=nt.random(8)),o=i?mt.create({keySize:e+n,hasher:i}).compute(t,s):mt.create({keySize:e+n}).compute(t,s);var u=nt.create(o.words.slice(e),4*n);return o.sigBytes=4*e,kt.create({key:o,iv:u,salt:s})}},Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.encrypt=function(t,e,n,r){var i=Object.assign(new et,this.cfg,r),o=i.kdf.execute(n,t.keySize,t.ivSize,i.salt,i.hasher);i.iv=o.iv;var s=It.encrypt.call(this,t,e,o.key,i);return s.mixIn(o),s},e.decrypt=function(t,e,n,r){var i=e,o=Object.assign(new et,this.cfg,r);i=this._parse(i,o.format);var s=o.kdf.execute(n,t.keySize,t.ivSize,i.salt,o.hasher);return o.iv=s.iv,It.decrypt.call(this,t,i,s.key,o)},e}(It);Pt.cfg=Object.assign(It.cfg,{kdf:jt});for(var Ot=[],At=[],Ht=[],Mt=[],Et=[],Tt=[],Ft=[],Dt=[],Bt=[],zt=[],qt=[],Ut=0;Ut<256;Ut+=1)qt[Ut]=Ut<128?Ut<<1:Ut<<1^283;var Yt=0,Nt=0;for(Ut=0;Ut<256;Ut+=1){var Rt=Nt^Nt<<1^Nt<<2^Nt<<3^Nt<<4;Rt=Rt>>>8^255&Rt^99,Ot[Yt]=Rt,At[Rt]=Yt;var Kt=qt[Yt],Lt=qt[Kt],Jt=qt[Lt],Xt=257*qt[Rt]^16843008*Rt;Ht[Yt]=Xt<<24|Xt>>>8,Mt[Yt]=Xt<<16|Xt>>>16,Et[Yt]=Xt<<8|Xt>>>24,Tt[Yt]=Xt,Xt=16843009*Jt^65537*Lt^257*Kt^16843008*Yt,Ft[Rt]=Xt<<24|Xt>>>8,Dt[Rt]=Xt<<16|Xt>>>16,Bt[Rt]=Xt<<8|Xt>>>24,zt[Rt]=Xt,Yt?(Yt=Kt^qt[qt[qt[Jt^Kt]]],Nt^=qt[qt[Nt]]):Yt=Nt=1}var Qt=[0,1,2,4,8,16,32,64,128,27,54],Wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype._doReset=function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){this._keyPriorReset=this._key;var e=this._keyPriorReset,n=e.words,r=e.sigBytes/4;this._nRounds=r+6;var i=4*(this._nRounds+1);this._keySchedule=[];for(var o=this._keySchedule,s=0;s<i;s+=1)s<r?o[s]=n[s]:(t=o[s-1],s%r?r>6&&s%r===4&&(t=Ot[t>>>24]<<24|Ot[t>>>16&255]<<16|Ot[t>>>8&255]<<8|Ot[255&t]):(t=Ot[(t=t<<8|t>>>24)>>>24]<<24|Ot[t>>>16&255]<<16|Ot[t>>>8&255]<<8|Ot[255&t],t^=Qt[s/r|0]<<24),o[s]=o[s-r]^t);this._invKeySchedule=[];for(var u=this._invKeySchedule,a=0;a<i;a+=1){s=i-a;t=a%4?o[s]:o[s-4],u[a]=a<4||s<=4?t:Ft[Ot[t>>>24]]^Dt[Ot[t>>>16&255]]^Bt[Ot[t>>>8&255]]^zt[Ot[255&t]]}}},e.prototype.encryptBlock=function(t,e){this._doCryptBlock(t,e,this._keySchedule,Ht,Mt,Et,Tt,Ot)},e.prototype.decryptBlock=function(t,e){var n=t,r=n[e+1];n[e+1]=n[e+3],n[e+3]=r,this._doCryptBlock(n,e,this._invKeySchedule,Ft,Dt,Bt,zt,At),r=n[e+1],n[e+1]=n[e+3],n[e+3]=r},e.prototype._doCryptBlock=function(t,e,n,r,i,o,s,u){for(var a=t,c=this._nRounds,l=a[e]^n[0],f=a[e+1]^n[1],p=a[e+2]^n[2],h=a[e+3]^n[3],d=4,v=1;v<c;v+=1){var y=r[l>>>24]^i[f>>>16&255]^o[p>>>8&255]^s[255&h]^n[d];d+=1;var g=r[f>>>24]^i[p>>>16&255]^o[h>>>8&255]^s[255&l]^n[d];d+=1;var m=r[p>>>24]^i[h>>>16&255]^o[l>>>8&255]^s[255&f]^n[d];d+=1;var b=r[h>>>24]^i[l>>>16&255]^o[f>>>8&255]^s[255&p]^n[d];d+=1,l=y,f=g,p=m,h=b}var w=(u[l>>>24]<<24|u[f>>>16&255]<<16|u[p>>>8&255]<<8|u[255&h])^n[d];d+=1;var _=(u[f>>>24]<<24|u[p>>>16&255]<<16|u[h>>>8&255]<<8|u[255&l])^n[d];d+=1;var S=(u[p>>>24]<<24|u[h>>>16&255]<<16|u[l>>>8&255]<<8|u[255&f])^n[d];d+=1;var C=(u[h>>>24]<<24|u[l>>>16&255]<<16|u[f>>>8&255]<<8|u[255&p])^n[d];d+=1,a[e]=w,a[e+1]=_,a[e+2]=S,a[e+3]=C},e}(Ct);Wt.keySize=8;var Vt=Ct._createHelper(Wt),Gt=function(t){return(new TextDecoder).decode(function(t){var e,n=(null!==(e=null===window||void 0===window?void 0:window.atob(t))&&void 0!==e?e:"").split("").map(function(t){return t.charCodeAt(0)});return new Uint8Array(n)}(t))};function $t(t){try{return t?JSON.parse(t):null}catch(e){return t||null}}var Zt="HtEvEncrypt:";var te="RudderEncrypt:",ee="RS_ENC_v3_";var ne=function(t){var e=Date.now(),n=t||18e5;return n<1e4&&console.warn("Session timeouts of less than 10 seconds are not recommended"),{id:e,expiresAt:e+n,timeout:n,sessionStart:!0,autoTrack:!0}},re=function(t){return{id:function(t){return!(!t||t.toString().startsWith("-")||t.toString().length<10)}(t)?t:Date.now(),sessionStart:!0,manualTrack:!0}},ie={persist:!0,cookie:{key:"htjs_user_id",oldKey:"ajs_user"},localStorage:{key:"htjs_user_traits"},sessions:{autoTrack:!0}},oe=function(){function t(t,e){void 0===t&&(t=ie);var r,i,o,s,u,a=this;this.options={},this.id=function(t){var e,n,r,i;if(a.options.disable)return null;var o=a.identityStore.getAndSync(a.idKey);if(void 0!==t){var s=null===t,u=t!==o&&null!==o&&null!==t,c=t!==o&&null===o&&null!==t;a.identityStore.set(a.idKey,t),s&&(null===(n=null===(e=a.options)||void 0===e?void 0:e.httpCookieService)||void 0===n||n.dispatchClear()),u&&a.anonymousId(null),(u||c)&&(null===(i=null===(r=a.options)||void 0===r?void 0:r.httpCookieService)||void 0===i||i.dispatchCreate())}var l=a.identityStore.getAndSync(a.idKey);if(l)return l;var f=a.legacyUserStore.get(ie.cookie.oldKey);return f?"object"==typeof f?f.id:f:null},this.anonymousId=function(t){var e,n,r,i,o,s,u,c,l,f;if(a.options.disable)return null;if(void 0===t){var p=a.identityStore.getAndSync(a.anonKey),h=!1;if(p||(p=function(t){try{if(!t||"string"!=typeof t||""===t.trim())return null;if(t.substring(0,12)===Zt)return $t(Vt.decrypt(t.substring(12),"HTEV").toString(st))}catch(t){console.error(t)}return t}(null!==(e=a.identityStore.getAndSync("htev_anonymous_id"))&&void 0!==e?e:""),h=Boolean(p),p&&a.identityStore.set(a.anonKey,p)),p||(p=a.identityStore.getAndSync("ajs_anonymous_id"),h=Boolean(p),p&&a.identityStore.set(a.anonKey,p)),p||(p=function(t){try{if(!t||"string"!=typeof t||""===t.trim())return null;if(t.substring(0,14)===te)return $t(Vt.decrypt(t.substring(14),"Rudder").toString(st));if(t.substring(0,10)===ee){var e=$t(Gt(t.substring(10)));return e&&"string"==typeof e&&""!==e.trim()?e:null}}catch(t){console.error(t)}return t}(null!==(n=a.identityStore.getAndSync("rl_anonymous_id"))&&void 0!==n?n:""),h=Boolean(p),p&&a.identityStore.set(a.anonKey,p)),p||(p=null!==(i=null===(r=a.legacySIO())||void 0===r?void 0:r[0])&&void 0!==i?i:null),h&&(null===(s=null===(o=a.options)||void 0===o?void 0:o.httpCookieService)||void 0===s||s.dispatchCreate()),p)return p}if(null===t){a.identityStore.set(a.anonKey,null);var d=a.identityStore.getAndSync(a.anonKey);return null===(c=null===(u=a.options)||void 0===u?void 0:u.httpCookieService)||void 0===c||c.dispatchClear(),d}a.identityStore.set(a.anonKey,null!=t?t:(0,g.v4)());var v=a.identityStore.getAndSync(a.anonKey);return null===(f=null===(l=a.options)||void 0===l?void 0:l.httpCookieService)||void 0===f||f.dispatchCreate(),v},this.traits=function(t){var e;if(!a.options.disable)return null===t&&(t={}),t&&a.traitsStore.set(a.traitsKey,null!=t?t:{}),null!==(e=a.traitsStore.get(a.traitsKey))&&void 0!==e?e:{}},this.options=(0,n.Cl)((0,n.Cl)({},ie),t),this.cookieOptions=e,this.idKey=null!==(i=null===(r=t.cookie)||void 0===r?void 0:r.key)&&void 0!==i?i:ie.cookie.key,this.traitsKey=null!==(s=null===(o=t.localStorage)||void 0===o?void 0:o.key)&&void 0!==s?s:ie.localStorage.key,this.anonKey="htjs_anonymous_id",this.seshKey="htjs_sesh",this.identityStore=this.createStorage(this.options,e),this.sessionStore=this.createStorage(this.options,e),this.legacyUserStore=this.createStorage(this.options,e,function(t){return t===T.Cookie}),this.traitsStore=this.createStorage(this.options,e,function(t){return t!==T.Cookie});var c=this.legacyUserStore.get(ie.cookie.oldKey);c&&"object"==typeof c&&(c.id&&this.id(c.id),c.traits&&this.traits(c.traits)),this.options.httpCookieService&&(this.identityStore.getAndSync(this.anonKey),this.identityStore.getAndSync(this.idKey),null===(u=this.options.httpCookieService)||void 0===u||u.dispatchCreate()),E(this)}return t.prototype.legacySIO=function(){var t=this.legacyUserStore.get("_sio");if(!t)return null;var e=t.split("----");return[e[0],e[1]]},t.prototype.identify=function(t,e){if(!this.options.disable){e=null!=e?e:{};var r=this.id();null!==r&&r!==t||(e=(0,n.Cl)((0,n.Cl)({},this.traits()),e)),t&&this.id(t),this.traits(e)}},t.prototype.startManualSession=function(t){if(!this.options.disable){this.sessionStore.clear(this.seshKey);var e=re(t);this.sessionStore.set(this.seshKey,e)}},t.prototype.endManualSession=function(){this.sessionStore.clear(this.seshKey)},t.prototype.getAndUpdateSessionInfo=function(){var t,e,n,r,i,o;if(this.options.disable)return null;var s,u,a=this.sessionStore.getAndSync(this.seshKey);return null==a?(null===(e=null===(t=this.options)||void 0===t?void 0:t.sessions)||void 0===e?void 0:e.autoTrack)?(a=ne(null===(r=null===(n=this.options)||void 0===n?void 0:n.sessions)||void 0===r?void 0:r.timeout),this.sessionStore.set(this.seshKey,a),a):null:(null==a?void 0:a.autoTrack)&&(s=a.expiresAt,u=Date.now(),Boolean(u>s))?(a=ne(null===(o=null===(i=this.options)||void 0===i?void 0:i.sessions)||void 0===o?void 0:o.timeout),this.sessionStore.set(this.seshKey,a),a):(a=function(t){return t.sessionStart=!1,t.autoTrack&&(t.expiresAt=Date.now()+t.timeout),t}(a),this.sessionStore.set(this.seshKey,a),a)},t.prototype.getAndUpdateSession=function(){var t=this.getAndUpdateSessionInfo(),e={};return(null==t?void 0:t.id)&&(e.sessionId=t.id),(null==t?void 0:t.sessionStart)&&(e.sessionStart=t.sessionStart),e},t.prototype.sessionId=function(){var t,e=this.sessionStore.getAndSync(this.seshKey);return null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null},t.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},t.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.sessionStore.clear(this.seshKey),this.traitsStore.clear(this.traitsKey)},t.prototype.load=function(){return new t(this.options,this.cookieOptions)},t.prototype.save=function(){return!0},t.prototype.createStorage=function(t,e,n){var r=[T.LocalStorage,T.Cookie,T.Memory];return t.disable?new D([]):t.persist?(void 0!==t.storage&&null!==t.storage&&z(t.storage)&&(r=t.storage.stores),t.localStorageFallbackDisabled&&(r=r.filter(function(t){return t!==T.LocalStorage})),n&&(r=r.filter(n)),new D(G($(r,e)))):new D([new B])},t.defaults=ie,t}(),se={persist:!0,cookie:{key:"htjs_group_id"},localStorage:{key:"htjs_group_properties"}},ue=function(t){function e(e,r){void 0===e&&(e=se);var i=t.call(this,(0,n.Cl)((0,n.Cl)({},se),e),r)||this;return i.anonymousId=function(t){},E(i),i}return(0,n.C6)(e,t),e}(oe),ae=s(6452),ce=s(5120),le=s(6091),fe=function(t,e,n){n.getCalls(t).forEach(function(t){be(e,t).catch(console.error)})},pe=function(t,e){return(0,n.sH)(void 0,void 0,void 0,function(){var r,i,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:r=0,i=e.getCalls("addSourceMiddleware"),n.label=1;case 1:return r<i.length?(o=i[r],[4,be(t,o).catch(console.error)]):[3,4];case 2:n.sent(),n.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},he=fe.bind(void 0,"on"),de=fe.bind(void 0,"setAnonymousId"),ve=function(t){if(ye(t)){var e=t.pop();return C(e)}},ye=function(t){return function(t){if(!(0,o.Qd)(t))return!1;if("bpc"!==t.__t)return!1;for(var e in t)if(!S.includes(e))return!1;return!0}(t[t.length-1])},ge=function(t,e,n,r){void 0===n&&(n=function(){}),void 0===r&&(r=console.error),this.method=t,this.resolve=n,this.reject=r,this.called=!1,this.args=e},me=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._callMap={},this.push.apply(this,t)}return Object.defineProperty(t.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(t){this._callMap=t},enumerable:!1,configurable:!0}),t.prototype.getCalls=function(t){var e;return null!==(e=this.calls[t])&&void 0!==e?e:[]},t.prototype.push=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];e.forEach(function(e){["track","screen","alias","group","page","identify"].includes(e.method)&&!ye(e.args)&&(e.args=(0,n.fX)((0,n.fX)([],e.args,!0),[k()],!1)),t.calls[e.method]?t.calls[e.method].push(e):t.calls[e.method]=[e]})},t.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},t.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this.calls))},t.prototype._pushSnippetWindowBuffer=function(){var t=(0,le.kJ)();if(Array.isArray(t)){var e=t.splice(0,t.length).map(function(t){var e=t[0],n=t.slice(1);return new ge(e,n)});this.push.apply(this,e)}},t}();function be(t,e){return(0,n.sH)(this,void 0,Promise,function(){var r,i;return(0,n.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,r=t[e.method].apply(t,e.args),"object"==typeof(o=r)&&null!==o&&"then"in o&&"function"==typeof o.then?[4,r]:[3,2]);case 1:n.sent(),n.label=2;case 2:return e.resolve(r),[3,4];case 3:return i=n.sent(),e.reject(i),[3,4];case 4:return[2]}var o})})}var we=function(){function t(t){var e=this;this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=ae.r,this._preInitBuffer=new me,this._promise=t(this._preInitBuffer),this._promise.then(function(t){var n=t[0],r=t[1];e.instance=n,e.ctx=r}).catch(function(){})}return t.prototype.then=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).then.apply(t,e)},t.prototype.catch=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).catch.apply(t,e)},t.prototype.finally=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).finally.apply(t,e)},t.prototype._createMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(e.instance){var o=(n=e.instance)[t].apply(n,r);return Promise.resolve(o)}return new Promise(function(n,i){e._preInitBuffer.push(new ge(t,r,n,i))})}},t.prototype._createChainableMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.instance?((n=e.instance)[t].apply(n,r),e):(e._preInitBuffer.push(new ge(t,r)),e)}},t}(),_e="This is being deprecated and will be not be available in future releases of Analytics JS",Se=(0,ce.m)(),Ce=null==Se?void 0:Se.analytics;function ke(){console.warn(_e)}var xe=function(t){function e(e,r,i,o,s){var u,a,c,l=t.call(this)||this;l._debug=!1,l.initialized=!1,l.user=function(){return l._user},l.init=l.initialize.bind(l),l.log=ke,l.addIntegrationMiddleware=ke,l.listeners=ke,l.addEventListener=ke,l.removeAllListeners=ke,l.removeListener=ke,l.removeEventListener=ke,l.hasListeners=ke,l.add=ke,l.addIntegration=ke;var f=null==r?void 0:r.cookie,p=null!==(u=null==r?void 0:r.disableClientPersistence)&&void 0!==u&&u;l.settings=e,l.settings.timeout=null!==(a=l.settings.timeout)&&void 0!==a?a:300,l.queue=null!=i?i:function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var r=e?4:1,i=n?new P.M(r,[]):new j.x(r,t);return new M(i)}("".concat(e.writeKey,":event-queue"),null==r?void 0:r.retryQueue,p);var h=null==r?void 0:r.storage;return l._universalStorage=l.createStore(p,h,f),l._user=null!=o?o:new oe((0,n.Cl)({persist:!p,storage:null==r?void 0:r.storage,httpCookieService:null==r?void 0:r.httpCookieService},null==r?void 0:r.user),f).load(),l._group=null!=s?s:new ue((0,n.Cl)({persist:!p,storage:null==r?void 0:r.storage},null==r?void 0:r.group),f).load(),l.eventFactory=new I(l._user),l.integrations=null!==(c=null==r?void 0:r.integrations)&&void 0!==c?c:{},l.options=null!=r?r:{},E(l),l}return(0,n.C6)(e,t),e.prototype.createStore=function(t,e,n){return t?new D([new B]):e&&z(e)?new D(G($(e.stores,n))):new D(G([T.LocalStorage,{name:T.Cookie,settings:n},T.Memory]))},Object.defineProperty(e.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),e.prototype.track=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,c,l=this;return(0,n.YH)(this,function(n){return e=ve(t),r=a.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],c=this.eventFactory.track(i,o,s,this.integrations,e),[2,this._dispatch(c,u).then(function(t){return l.emit("track",i,t.event.properties,t.event.options),t})]})})},e.prototype.page=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,l,f=this;return(0,n.YH)(this,function(n){return e=ve(t),r=c.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],a=r[4],l=this.eventFactory.page(i,o,s,u,this.integrations,e),[2,this._dispatch(l,a).then(function(t){return f.emit("page",i,o,t.event.properties,t.event.options),t})]})})},e.prototype.identify=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,c=this;return(0,n.YH)(this,function(n){return e=ve(t),r=l(this._user).apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],this._user.identify(i,o),a=this.eventFactory.identify(this._user.id(),this._user.traits(),s,this.integrations,e),[2,this._dispatch(a,u).then(function(t){return c.emit("identify",t.event.userId,t.event.traits,t.event.options),t})]})})},e.prototype.group=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=ve(e);if(0===e.length)return this._group;var i=l(this._group).apply(void 0,e),o=i[0],s=i[1],u=i[2],a=i[3];this._group.identify(o,s);var c=this._group.id(),f=this._group.traits(),p=this.eventFactory.group(c,f,u,this.integrations,r);return this._dispatch(p,a).then(function(e){return t.emit("group",e.event.groupId,e.event.traits,e.event.options),e})},e.prototype.alias=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,c=this;return(0,n.YH)(this,function(n){return e=ve(t),r=f.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],a=this.eventFactory.alias(i,o,s,this.integrations,e),[2,this._dispatch(a,u).then(function(t){return c.emit("alias",i,o,t.event.options),t})]})})},e.prototype.screen=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,l,f=this;return(0,n.YH)(this,function(n){return e=ve(t),r=c.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],a=r[4],l=this.eventFactory.screen(i,o,s,u,this.integrations,e),[2,this._dispatch(l,a).then(function(t){return f.emit("screen",i,o,t.event.properties,t.event.options),t})]})})},e.prototype.trackClick=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.link).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.trackLink=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.link).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.trackSubmit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.form).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.trackForm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.form).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.register=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i=this;return(0,n.YH)(this,function(n){switch(n.label){case 0:return e=h.o.system(),r=t.map(function(t){return i.queue.register(e,t,i)}),[4,Promise.all(r)];case 1:return n.sent(),[2,e]}})})},e.prototype.deregister=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i=this;return(0,n.YH)(this,function(n){switch(n.label){case 0:return e=h.o.system(),r=t.map(function(t){var n=i.queue.plugins.find(function(e){return e.name===t});if(n)return i.queue.deregister(e,n,i);e.log("warn","plugin ".concat(t," not found"))}),[4,Promise.all(r)];case 1:return n.sent(),[2,e]}})})},e.prototype.debug=function(t){return!1===t&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=t,this},e.prototype.startSession=function(t){this._user.startManualSession(t)},e.prototype.endSession=function(){this._user.endManualSession()},e.prototype.getSessionId=function(){var t;return null!==(t=this._user.sessionId())&&void 0!==t?t:null},e.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},e.prototype.timeout=function(t){this.settings.timeout=t},e.prototype._dispatch=function(t,e){return(0,n.sH)(this,void 0,Promise,function(){var r;return(0,n.YH)(this,function(n){return r=new h.o(t),(0,p.a)()&&!this.options.retryQueue?[2,r]:[2,v(r,this.queue,this,{callback:e,debug:this._debug,timeout:this.settings.timeout})]})})},e.prototype.addSourceMiddleware=function(t){return(0,n.sH)(this,void 0,Promise,function(){var e=this;return(0,n.YH)(this,function(r){switch(r.label){case 0:return[4,this.queue.criticalTasks.run(function(){return(0,n.sH)(e,void 0,void 0,function(){var e,r,i;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,Promise.resolve().then(s.bind(s,1418))];case 1:return e=n.sent().sourceMiddlewarePlugin,r={},this.queue.plugins.forEach(function(t){if("destination"===t.type)return r[t.name]=!0}),i=e(t,r),[4,this.register(i)];case 2:return n.sent(),[2]}})})})];case 1:return r.sent(),[2,this]}})})},e.prototype.addDestinationMiddleware=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.queue.plugins.filter(function(e){return e.name.toLowerCase()===t.toLowerCase()}).forEach(function(t){t.addMiddleware.apply(t,e)}),Promise.resolve(this)},e.prototype.setAnonymousId=function(t){return this._user.anonymousId(t)},e.prototype.queryString=function(t){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){switch(e.label){case 0:return!1===this.options.useQueryString?[2,[]]:[4,s.e(538).then(s.bind(s,6346))];case 1:return[2,(0,e.sent().queryString)(this,t)]}})})},e.prototype.use=function(t){return t(this),this},e.prototype.ready=function(){return(0,n.sH)(this,arguments,Promise,function(t){return void 0===t&&(t=function(t){return t}),(0,n.YH)(this,function(e){return[2,Promise.all(this.queue.plugins.map(function(t){return t.ready?t.ready():Promise.resolve()})).then(function(e){return t(e),e})]})})},e.prototype.noConflict=function(){return console.warn(_e),(0,le.Ud)(null!=Ce?Ce:this),this},e.prototype.normalize=function(t){return console.warn(_e),this.eventFactory.normalize(t)},Object.defineProperty(e.prototype,"failedInitializations",{get:function(){return console.warn(_e),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"VERSION",{get:function(){return ae.r},enumerable:!1,configurable:!0}),e.prototype.initialize=function(t,e){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(t){return console.warn(_e),[2,Promise.resolve(this)]})})},e.prototype.pageview=function(t){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){switch(e.label){case 0:return console.warn(_e),[4,this.page({path:t})];case 1:return e.sent(),[2,this]}})})},Object.defineProperty(e.prototype,"plugins",{get:function(){var t;return console.warn(_e),null!==(t=this._plugins)&&void 0!==t?t:{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Integrations",{get:function(){return console.warn(_e),this.queue.plugins.filter(function(t){return"destination"===t.type}).reduce(function(t,e){var n="".concat(e.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),r=window[n];if(!r)return t;var i=r.Integration;return i?(t[e.name]=i,t):(t[e.name]=r,t)},{})},enumerable:!1,configurable:!0}),e.prototype.push=function(t){var e=t.shift();e&&!this[e]||this[e].apply(this,t)},e}(y.v),Ie=function(){function t(e){var n,r,i,o=t.urlHelper(e);this.renewUrl=o.renewUrl,this.clearUrl=o.clearUrl,this.backoff=null!==(n=e.backoff)&&void 0!==n?n:300,this.retries=null!==(r=e.retries)&&void 0!==r?r:3,this.flushInterval=null!==(i=e.flushInterval)&&void 0!==i?i:1e3,this.queue=[]}return t.urlHelper=function(t){var e=window.location.origin;return{renewUrl:new URL(t.renewUrl,e).href,clearUrl:new URL(t.clearUrl,e).href}},t.load=function(e){return(0,n.sH)(this,void 0,Promise,function(){var r;return(0,n.YH)(this,function(n){switch(n.label){case 0:return r=new t(e),[4,Pe(r.sendHTTPCookies(r.renewUrl),r.retries,r.backoff).catch(console.error)];case 1:return n.sent(),r.startQueueConsumer(),[2,r]}})})},t.prototype.dispatchCreate=function(){this.queue.push(this.sendHTTPCookies(this.renewUrl))},t.prototype.dispatchClear=function(){this.queue.push(this.sendHTTPCookies(this.clearUrl))},t.prototype.startQueueConsumer=function(){if(this.flushIntervalId)console.error("HTTPCookie queue consumer is already running.");else{var t=this.consumeQueue.bind(this);this.flushIntervalId=setInterval(function(){return t().catch(console.error)},this.flushInterval)}},t.prototype.stopQueueConsumer=function(){this.flushIntervalId?(clearInterval(this.flushIntervalId),this.flushIntervalId=void 0):console.error("HTTPCookie queue consumer is already stopped.")},t.prototype.sendHTTPCookies=function(t){return function(){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){switch(e.label){case 0:return[4,(0,i.h)(t,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify({sentAt:(new Date).toISOString()})})];case 1:return[2,e.sent()]}})})}},t.prototype.consumeQueue=function(){return(0,n.sH)(this,void 0,void 0,function(){return(0,n.YH)(this,function(t){switch(t.label){case 0:return this.queue.length>0?[4,Pe(this.queue.shift(),this.retries,this.backoff).catch(console.error)]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})},t}();function je(t){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){return[2,new Promise(function(e){return setTimeout(e,t)})]})})}function Pe(t,e,r){return(0,n.sH)(this,void 0,Promise,function(){var i;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(!(e>=0))return[3,6];n.label=1;case 1:return n.trys.push([1,3,,5]),[4,t().then(function(t){if(t.ok)return t;throw new Error("Status: ".concat(t.status," ").concat(t.statusText))})];case 2:return[2,n.sent()];case 3:if(i=n.sent(),(e-=1)<=0)throw i;return[4,je(r)];case 4:return n.sent(),[3,5];case 5:return[3,0];case 6:throw Error("HtEvents: Problem with DeferredRequest")}})})}var Oe,Ae=s(5835),He=s(9059);function Me(t){return(0,n.sH)(this,void 0,Promise,function(){var e;return(0,n.YH)(this,function(n){return(e=navigator.userAgentData)?t?[2,e.getHighEntropyValues(t).catch(function(){return e.toJSON()})]:[2,e.toJSON()]:[2,void 0]})})}function Ee(){if(Oe)return Oe;var t=N(window.location.href);return Oe={expires:31536e6,secure:!1,path:"/"},t&&(Oe.domain=t),Oe}var Te=function(){var t=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(e,r){return(0,n.sH)(t,void 0,void 0,function(){var t;return(0,n.YH)(this,function(e){switch(e.label){case 0:this.instance=r,e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,Me(this.instance.options.highEntropyValuesClientHints)];case 2:return t.userAgentData=e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(r){var i,o,s=r.event.context,u=s.page.search||"",a="object"==typeof u?function(t){try{var e=new URLSearchParams;return Object.entries(t).forEach(function(t){var n=t[0],r=t[1];Array.isArray(r)?r.forEach(function(t){return e.append(n,t)}):e.append(n,r)}),e.toString()}catch(t){return""}}(u):u;s.userAgent=navigator.userAgent,s.userAgentData=t.userAgentData;var c=navigator.userLanguage||navigator.language;void 0===s.locale&&void 0!==c&&(s.locale=c),null!==(i=s.library)&&void 0!==i||(s.library={name:"events-sdk-js",version:"".concat("web"===(0,e.X)()?"web":"npm","-").concat(ae.r)}),a&&!s.campaign&&(s.campaign=function(t){return t.startsWith("?")&&(t=t.substring(1)),(t=t.replace(/\?/g,"&")).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1],o=void 0===i?"":i;if(r.startsWith("utm_")&&r.length>4){var s=r.slice(4);"campaign"===s&&(s="name"),t[s]=(0,He.p)(o)}return t},{})}(a));var l=function(){var t=Y.get("_ga");if(t&&t.startsWith("amp"))return t}();l&&(s.amp={id:l}),function(t,e,r){var i,o=new D(r?[]:[new W(Ee())]),s=o.get("s:context.referrer"),u=null!==(i=function(t){var e={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1));for(var n=0,r=(t=t.replace(/\?/g,"&")).split("&");n<r.length;n++){var i=r[n].split("="),o=i[0],s=i[1];if(e[o])return{id:s,type:e[o]}}}(t))&&void 0!==i?i:s;u&&(e&&(e.referrer=(0,n.Cl)((0,n.Cl)({},e.referrer),u)),o.set("s:context.referrer",u))}(a,s,null!==(o=t.instance.options.disableClientPersistence)&&void 0!==o&&o);try{s.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){}return r},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich},Fe=new Te,De=s(6238),Be=s(1418),ze=function(){function t(t,e){this.version="1.0.0",this.alternativeNames=[],this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=e,this.name=t,this.type=e.type,this.alternativeNames.push(e.name)}return t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];"destination"===this.type&&(t=this.middleware).push.apply(t,e)},t.prototype.transform=function(t){return(0,n.sH)(this,void 0,Promise,function(){var e;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,(0,Be.applyDestinationMiddleware)(this.name,t.event,this.middleware)];case 1:return null===(e=n.sent())&&t.cancel(new O.d({retry:!1,reason:"dropped by destination middleware"})),[2,new h.o(e)]}})})},t.prototype._createMethod=function(t){var e=this;return function(r){return(0,n.sH)(e,void 0,Promise,function(){var e;return(0,n.YH)(this,function(n){switch(n.label){case 0:return this.action[t]?(e=r,"destination"!==this.type?[3,2]:[4,this.transform(r)]):[2,r];case 1:e=n.sent(),n.label=2;case 2:return[4,this.action[t](e)];case 3:return n.sent(),[2,r]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return this.action.ready?this.action.ready():Promise.resolve()},t.prototype.load=function(t,e){return this.action.load(t,e)},t.prototype.unload=function(t,e){var n,r;return null===(r=(n=this.action).unload)||void 0===r?void 0:r.call(n,t,e)},t}();function qe(e,r){return(0,n.sH)(this,void 0,Promise,function(){var i,o,s,u,a;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(i=new RegExp("https://cdn.hightouch-events.(com|build)"),o=(0,t.I2)(),!r)return[3,6];s=e.url.split("/"),u=s[s.length-2],a=e.url.replace(u,btoa(u).replace(/=/g,"")),n.label=1;case 1:return n.trys.push([1,3,,5]),[4,(0,De.k)(a.replace(i,o))];case 2:return n.sent(),[3,5];case 3:return n.sent(),[4,(0,De.k)(e.url.replace(i,o))];case 4:return n.sent(),[3,5];case 5:return[3,8];case 6:return[4,(0,De.k)(e.url.replace(i,o))];case 7:n.sent(),n.label=8;case 8:return"function"==typeof window[e.libraryName]?[2,window[e.libraryName]]:[2]}})})}function Ue(t,e,r,i,o,s){return(0,n.sH)(this,void 0,Promise,function(){var u,a,c,l,f,p,h=this;return(0,n.YH)(this,function(d){switch(d.label){case 0:return u=[],a=null!==(f=null===(l=t.middlewareSettings)||void 0===l?void 0:l.routingRules)&&void 0!==f?f:[],c=(null!==(p=t.remotePlugins)&&void 0!==p?p:[]).map(function(t){return(0,n.sH)(h,void 0,void 0,function(){var c,l,f,p,h,d;return(0,n.YH)(this,function(v){switch(v.label){case 0:if(function(t,e){var n=t[e.creationName],r=t[e.name];return!1===t.All&&!n&&!r||!1===n||!1===r}(e,t))return[2];v.label=1;case 1:return v.trys.push([1,6,,7]),(l=null==s?void 0:s.find(function(e){return e.pluginName===t.name}))?[3,3]:[4,qe(t,i)];case 2:l=v.sent(),v.label=3;case 3:return(c=l)?[4,c((0,n.Cl)((0,n.Cl)({},t.settings),r[t.name]))]:[3,5];case 4:f=v.sent(),function(t){if(!Array.isArray(t))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];t.forEach(function(t){e.forEach(function(e){var n;if(void 0===t[e])throw new Error("Plugin: ".concat(null!==(n=t.name)&&void 0!==n?n:"unknown"," missing required function ").concat(e))})})}(p=Array.isArray(f)?f:[f]),h=a.filter(function(e){return e.destinationName===t.creationName}),p.forEach(function(e){var n=new ze(t.creationName,e);h.length&&o&&"destination"===e.type&&n.addMiddleware(o),u.push(n)}),v.label=5;case 5:return[3,7];case 6:return d=v.sent(),console.warn("Failed to load Remote Plugin",d),[3,7];case 7:return[2]}})})}),[4,Promise.all(c)];case 1:return d.sent(),[2,u.filter(Boolean)]}})})}var Ye=s(7536);function Ne(t){return(encodeURI(JSON.stringify(t)).split(/%..|./).length-1)/1024}function Re(t,e,r){var o,s;void 0===r&&(r="https");var u,a,c,l=[],f=!1,p=null!==(o=null==e?void 0:e.size)&&void 0!==o?o:10,h=null!==(s=null==e?void 0:e.timeout)&&void 0!==s?s:5e3;function d(e){var o;if(0!==e.length){var s=null===(o=e[0])||void 0===o?void 0:o.writeKey,u=e.map(function(t){var e=t;e.sentAt;return(0,n.Tt)(e,["sentAt"])});return(0,i.h)("".concat(r,"://").concat(t,"/v1/batch"),{keepalive:f,headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify({writeKey:s,batch:u,sentAt:(new Date).toISOString()})})}}function v(){return(0,n.sH)(this,void 0,Promise,function(){var t;return(0,n.YH)(this,function(e){return l.length?(t=l,l=[],[2,d(t)]):[2]})})}return a=function(t){if((f=t)&&l.length){var e=function(t){var e=[],n=0;return t.forEach(function(t){Ne(e[n])>=64&&n++,e[n]?e[n].push(t):e[n]=[t]}),e}(l).map(d);Promise.all(e).catch(console.error)}},c=!1,window.addEventListener("pagehide",function(){c||a(c=!0)}),document.addEventListener("visibilitychange",function(){if("hidden"==document.visibilityState){if(c)return;c=!0}else c=!1;a(c)}),{dispatch:function(t,e){return(0,n.sH)(this,void 0,Promise,function(){var t;return(0,n.YH)(this,function(n){return l.push(e),t=l.length>=p||function(t){return Ne(t)>=450}(l),[2,t||f?v():void(u||(u=setTimeout(function(){u=void 0,v().catch(console.error)},h)))]})})}}}function Ke(t,e,r,i){var o,s=t.user();delete e.options,e.writeKey=null==r?void 0:r.apiKey,e.userId=e.userId||s.id(),e.anonymousId=e.anonymousId||s.anonymousId(),e.sentAt=new Date;var u=t.queue.failedInitializations||[];u.length>0&&(e._metadata={failedInitializations:u});var a=[],c=[];for(var l in i){var f=i[l];"Hightouch.io"===l&&a.push(l),"bundled"===f.bundlingStatus&&a.push(l),"unbundled"===f.bundlingStatus&&c.push(l)}for(var p=0,h=(null==r?void 0:r.unbundledIntegrations)||[];p<h.length;p++){var d=h[p];c.includes(d)||c.push(d)}var v=null!==(o=null==r?void 0:r.maybeBundledConfigIds)&&void 0!==o?o:{},y=[];return a.sort().forEach(function(t){var e;(null!==(e=v[t])&&void 0!==e?e:[]).forEach(function(t){y.push(t)})}),!1!==(null==r?void 0:r.addBundledMetadata)&&(e._metadata=(0,n.Cl)((0,n.Cl)({},e._metadata),{bundled:a.sort(),unbundled:c.sort(),bundledIds:y})),e}var Le=s(7106);function Je(t,e){return(0,n.sH)(this,void 0,Promise,function(){var r,i=this;return(0,n.YH)(this,function(o){switch(o.label){case 0:return r=[],(0,p.a)()?[2,e]:[4,(0,Le._)(function(){return e.length>0&&!(0,p.a)()},function(){return(0,n.sH)(i,void 0,void 0,function(){var i,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:return(i=e.pop())?[4,(0,A.C)(i,t)]:[2];case 1:return o=n.sent(),o instanceof h.o||r.push(i),[2]}})})})];case 1:return o.sent(),r.map(function(t){return e.pushWithBackoff(t)}),[2,e]}})})}function Xe(t,e,r,i){var o=this;t||setTimeout(function(){return(0,n.sH)(o,void 0,void 0,function(){var t,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:return t=!0,[4,Je(r,e)];case 1:return o=n.sent(),t=!1,e.todo>0&&i(t,o,r,i),[2]}})})},5e3*Math.random())}var Qe=s(3858);function We(t,e,r){var o,s,u;window.addEventListener("pagehide",function(){l.push.apply(l,Array.from(f)),f.clear()});var a,c=null!==(o=null==e?void 0:e.apiKey)&&void 0!==o?o:"",l=t.options.disableClientPersistence?new P.M(t.queue.queue.maxAttempts,[]):new j.x(t.queue.queue.maxAttempts,"".concat(c,":dest-Hightouch.io")),f=new Set,h=!1,d=null!==(s=null==e?void 0:e.apiHost)&&void 0!==s?s:Qe.a,v=null!==(u=null==e?void 0:e.protocol)&&void 0!==u?u:"https",y="".concat(v,"://").concat(d),g=null==e?void 0:e.deliveryStrategy,m="batching"===(null==g?void 0:g.strategy)?Re(d,g.config,v):(a=null==g?void 0:g.config,{dispatch:function(t,e){return(0,i.h)(t,{keepalive:null==a?void 0:a.keepalive,headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify(e)})}});function b(i){return(0,n.sH)(this,void 0,Promise,function(){var o,s;return(0,n.YH)(this,function(n){return(0,p.a)()?(l.push(i),Xe(h,l,w,Xe),[2,i]):(f.add(i),o=i.event.type,s=(0,Ye.W)(i.event).json(),"track"===i.event.type&&delete s.traits,"alias"===i.event.type&&(s=function(t,e){var n,r,i,o,s=t.user();return e.previousId=null!==(i=null!==(r=null!==(n=e.previousId)&&void 0!==n?n:e.from)&&void 0!==r?r:s.id())&&void 0!==i?i:s.anonymousId(),e.userId=null!==(o=e.userId)&&void 0!==o?o:e.to,delete e.from,delete e.to,e}(t,s)),[2,m.dispatch("".concat(y,"/v1/").concat(o),Ke(t,s,e,r)).then(function(){return i}).catch(function(){return l.pushWithBackoff(i),Xe(h,l,w,Xe),i}).finally(function(){f.delete(i)})])})})}var w={name:"Hightouch.io",type:"after",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:b,identify:b,page:b,alias:b,group:b,screen:b};return l.todo&&Xe(h,l,w,Xe),w}var Ve=function(t){function e(e,n){var r=t.call(this,"".concat(e," ").concat(n))||this;return r.field=e,r}return(0,n.C6)(e,t),e}(Error),Ge="is not a string",$e="is not an object",Ze="is nil";function tn(t){var e=".userId/anonymousId/previousId/groupId",n=function(t){var e,n,r;return null!==(r=null!==(n=null!==(e=t.userId)&&void 0!==e?e:t.anonymousId)&&void 0!==n?n:t.groupId)&&void 0!==r?r:t.previousId}(t);if(!(0,o.t2)(n))throw new Ve(e,Ze);if(!(0,o.Kg)(n))throw new Ve(e,Ge)}function en(t){if(!(0,o.t2)(t))throw new Ve("Event",Ze);if("object"!=typeof t)throw new Ve("Event",$e)}function nn(t){if(!(0,o.Kg)(t.type))throw new Ve(".type",Ge)}function rn(t){if(!(0,o.Kg)(t.event))throw new Ve(".event",Ge)}function on(t){var e,n=t.event;en(n),nn(n),"track"===n.type&&rn(n);var r=null!==(e=n.properties)&&void 0!==e?e:n.traits;if("alias"!==n.type&&!(0,o.Qd)(r))throw new Ve(".properties","is not an object");return tn(n),t}var sn,un,an={name:"Event Validation",type:"before",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:on,identify:on,page:on,alias:on,group:on,screen:on},cn=null!==(sn=(un=(0,ce.m)()).__HIGHTOUCH_INSPECTOR__)&&void 0!==sn?sn:un.__HIGHTOUCH_INSPECTOR__={};function ln(t,e){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(n){switch(t){case"gtag":return[2,s.e(666).then(s.bind(s,124)).then(function(t){return t.default(e)})];case"Google Tag Manager":return[2,s.e(391).then(s.bind(s,9827)).then(function(t){return t.default(e)})];default:return[2,void 0]}return[2]})})}function fn(e,n){var r=null!=n?n:(0,t.I2)();return(0,i.h)("".concat(r,"/v1/projects/").concat(e,"/settings")).then(function(t){return t.ok?t.json():t.text().then(function(t){throw new Error(t)})}).catch(function(t){throw console.error(t.message),t})}function pn(t,e){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,pe(t,e)];case 1:return n.sent(),function(t,e){e.toArray().forEach(function(e){setTimeout(function(){be(t,e).catch(console.error)},0)})}(t,e),e.clear(),[2]}})})}function hn(t,e,i,o,u){return(0,n.sH)(this,arguments,Promise,function(t,e,i,o,u,a,c){var l,f,p,h,d,v,y,g,m,b,w,_,S,C,k,x,I,j,P=this;return void 0===a&&(a=[]),(0,n.YH)(this,function(O){switch(O.label){case 0:return l=null==a?void 0:a.filter(function(t){return"object"==typeof t}),f=null==a?void 0:a.filter(function(t){return"function"==typeof t&&"string"==typeof t.pluginName}),function(t){var e,n,i;return"test"!==r().NODE_ENV&&(null!==(i=null===(n=null===(e=t.middlewareSettings)||void 0===e?void 0:e.routingRules)||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0}(e)?[4,s.e(10).then(s.bind(s,2888)).then(function(t){return t.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return h=O.sent(),[3,3];case 2:h=void 0,O.label=3;case 3:return p=h,A=e,"test"!==r().NODE_ENV&&Object.keys(A.integrations).length>1||c.length>0?[4,s.e(50).then(s.bind(s,3771)).then(function(n){return n.ajsDestinations(t,e,i.integrations,o,p,c)})]:[3,5];case 4:return v=O.sent(),[3,6];case 5:v=[],O.label=6;case 6:return d=v,e.legacyVideoPluginsEnabled?[4,s.e(694).then(s.bind(s,8162)).then(function(t){return t.loadLegacyVideoPlugins(i)})]:[3,8];case 7:O.sent(),O.label=8;case 8:return(null===(k=o.plan)||void 0===k?void 0:k.track)?[4,s.e(104).then(s.bind(s,3542)).then(function(t){var n;return t.schemaFilter(null===(n=o.plan)||void 0===n?void 0:n.track,e)})]:[3,10];case 9:return g=O.sent(),[3,11];case 10:g=void 0,O.label=11;case 11:return y=g,m=(0,Ae.J)(e,u),[4,Ue(e,i.integrations,m,u.obfuscate,p,f).catch(function(){return[]})];case 12:return b=O.sent(),w=(0,n.fX)((0,n.fX)((0,n.fX)([an,Fe],l,!0),d,!0),b,!0),y&&w.push(y),!1===(null===(x=o.integrations)||void 0===x?void 0:x.All)&&!o.integrations["Hightouch.io"]||o.integrations&&!1===o.integrations["Hightouch.io"]?[3,14]:(S=(_=w).push,[4,We(i,m["Hightouch.io"],e.integrations)]);case 13:S.apply(_,[O.sent()]),O.label=14;case 14:return[4,Promise.allSettled(Object.entries(null!==(I=u.destinations)&&void 0!==I?I:{}).map(function(t){return(0,n.sH)(P,[t],void 0,function(t){var e,r=t[0],i=t[1];return(0,n.YH)(this,function(t){switch(t.label){case 0:return[4,ln(r,i)];case 1:return(e=t.sent())?w.push(e):console.warn("failed to load destination plugin: ".concat(r)),[2]}})})}))];case 15:return O.sent(),[4,i.register.apply(i,w)];case 16:return C=O.sent(),Object.entries(null!==(j=e.enabledMiddleware)&&void 0!==j?j:{}).some(function(t){return t[1]})?[4,s.e(521).then(s.bind(s,9231)).then(function(t){return(0,n.sH)(P,[t],void 0,function(t){var r,o,s=t.remoteMiddlewares;return(0,n.YH)(this,function(t){switch(t.label){case 0:return[4,s(C,e,u.obfuscate)];case 1:return r=t.sent(),o=r.map(function(t){return i.addSourceMiddleware(t)}),[2,Promise.all(o)]}})})})]:[3,18];case 17:O.sent(),O.label=18;case 18:return[2,C]}var A})})}var dn={apiKey:"WRITE_KEY",apiHost:"us-east-1.hightouch-events.com",protocol:"https",unbundledIntegrations:[],addBundledMetadata:!1,maybeBundledConfigIds:{},deliveryStrategy:{strategy:"standard"}},vn={integrations:{},plan:{track:{__default:{enabled:!0,integrations:{}}},identify:{__default:{enabled:!0}},group:{__default:{enabled:!0}}},enabledMiddleware:{},metrics:{sampleRate:0},legacyVideoPluginsEnabled:!1,remotePlugins:[]};function yn(e){return(0,n.sH)(this,arguments,Promise,function(e,r,i){var o,s,u,a,c,l,f,p,h,d,v,y,g,m,b,w,_;return void 0===r&&(r={}),(0,n.YH)(this,function(S){switch(S.label){case 0:return r.globalAnalyticsKey&&(0,le.rY)(r.globalAnalyticsKey),e.cdnURL&&(0,t.qQ)(e.cdnURL),e.cdnSettings?o=e.cdnSettings:(vn.integrations["Hightouch.io"]=(0,n.Cl)((0,n.Cl)((0,n.Cl)((0,n.Cl)((0,n.Cl)({},dn),e.writeKey?{apiKey:e.writeKey}:{}),r.apiHost?{apiHost:r.apiHost}:{}),r.protocol?{protocol:r.protocol}:{}),1==r.batching?{deliveryStrategy:{strategy:"batching",config:{timeout:1e3,size:10}}}:{}),o=vn),r.updateCDNSettings&&(o=r.updateCDNSettings(o)),s=null===(g=null===(y=o.integrations["Hightouch.io"])||void 0===y?void 0:y.retryQueue)||void 0===g||g,r.disableClientPersistence||!r.httpCookieServiceOptions?[3,2]:(u=r,[4,Ie.load(r.httpCookieServiceOptions).catch(function(t){return console.error(t)})]);case 1:u.httpCookieService=S.sent(),S.label=2;case 2:return a=(0,n.Cl)({retryQueue:s},r),function(t){var e;null===(e=cn.attach)||void 0===e||e.call(cn,t)}(c=new xe(e,a)),l=null!==(m=e.plugins)&&void 0!==m?m:[],f=null!==(b=e.classicIntegrations)&&void 0!==b?b:[],function(t,e){de(t,e),he(t,e)}(c,i),[4,hn(e.writeKey,o,c,a,r,l,f)];case 3:return p=S.sent(),h=null!==(w=window.location.search)&&void 0!==w?w:"",d=null!==(_=window.location.hash)&&void 0!==_?_:"",(v=h.length?h:d.replace(/(?=#).*(?=\?)/,"")).includes("ajs_")?[4,c.queryString(v).catch(console.error)]:[3,5];case 4:S.sent(),S.label=5;case 5:return c.initialized=!0,c.emit("initialize",e,r),r.initialPageview&&c.page().catch(console.error),[4,pn(c,i)];case 6:return S.sent(),[2,[c,p]]}})})}var gn=function(t){function e(){var e,n,r,i=this,o=(r=new Promise(function(t,r){e=t,n=r}),{resolve:e,reject:n,promise:r}),s=o.promise,u=o.resolve;return i=t.call(this,function(t){return s.then(function(e){return yn(e[0],e[1],t)})})||this,i._resolveLoadStart=function(t,e){return u([t,e])},i}return(0,n.C6)(e,t),e.prototype.load=function(t,e){return void 0===e&&(e={}),this._resolveLoadStart(t,e),this},e.load=function(t,n){return void 0===n&&(n={}),(new e).load(t,n)},e.standalone=function(t,n){return e.load({writeKey:t},n).then(function(t){return t[0]})},e}(we),mn=(0,t.I2)();(0,t.qQ)(mn),s.p=mn+"/".concat("browser/candidate","/").concat("1.5.5","/"),(0,e.J)("web")}(),u}()});
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.HtEvents=e():t.HtEvents=e()}(self,function(){return function(){var t,e,n,r,i={8971:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(8578));function o(t,e){return function(){var n=this.traits(),r=this.properties?this.properties():{};return i.default(n,"address."+t)||i.default(n,t)||(e?i.default(n,"address."+e):null)||(e?i.default(n,e):null)||i.default(r,"address."+t)||i.default(r,t)||(e?i.default(r,"address."+e):null)||(e?i.default(r,e):null)}}e.default=function(t){t.zip=o("postalCode","zip"),t.country=o("country"),t.street=o("street"),t.state=o("state"),t.city=o("city"),t.region=o("region")}},7663:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Alias=void 0;var i=r(n(5615)),o=n(2265);function s(t,e){o.Facade.call(this,t,e)}e.Alias=s,i.default(s,o.Facade),s.prototype.action=function(){return"alias"},s.prototype.type=s.prototype.action,s.prototype.previousId=function(){return this.field("previousId")||this.field("from")},s.prototype.from=s.prototype.previousId,s.prototype.userId=function(){return this.field("userId")||this.field("to")},s.prototype.to=s.prototype.userId},3194:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clone=void 0,e.clone=function t(e){if("[object Object]"===Object.prototype.toString.call(e)){var n={};for(var r in e)n[r]=t(e[r]);return n}return Array.isArray(e)?e.map(t):e}},7532:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Delete=void 0;var i=r(n(5615)),o=n(2265);function s(t,e){o.Facade.call(this,t,e)}e.Delete=s,i.default(s,o.Facade),s.prototype.type=function(){return"delete"}},2265:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Facade=void 0;var i=r(n(8971)),o=n(3194),s=r(n(7751)),u=r(n(7639)),a=r(n(8578)),c=r(n(518));function l(t,e){e=e||{},this.raw=o.clone(t),"clone"in e||(e.clone=!0),e.clone&&(t=o.clone(t)),"traverse"in e||(e.traverse=!0),t.timestamp="timestamp"in t?u.default(t.timestamp):new Date,e.traverse&&c.default(t),this.opts=e,this.obj=t}e.Facade=l;var f=l.prototype;function p(t){return o.clone(t)}f.proxy=function(t){var e=t.split("."),n=this[t=e.shift()]||this.field(t);return n?("function"==typeof n&&(n=n.call(this)||{}),0===e.length||(n=a.default(n,e.join("."))),this.opts.clone?p(n):n):n},f.field=function(t){var e=this.obj[t];return this.opts.clone?p(e):e},l.proxy=function(t){return function(){return this.proxy(t)}},l.field=function(t){return function(){return this.field(t)}},l.multi=function(t){return function(){var e=this.proxy(t+"s");if(Array.isArray(e))return e;var n=this.proxy(t);return n&&(n=[this.opts.clone?o.clone(n):n]),n||[]}},l.one=function(t){return function(){var e=this.proxy(t);if(e)return e;var n=this.proxy(t+"s");return Array.isArray(n)?n[0]:void 0}},f.json=function(){var t=this.opts.clone?o.clone(this.obj):this.obj;return this.type&&(t.type=this.type()),t},f.rawEvent=function(){return this.raw},f.options=function(t){var e=this.obj.options||this.obj.context||{},n=this.opts.clone?o.clone(e):e;if(!t)return n;if(this.enabled(t)){var r=this.integrations(),i=r[t]||a.default(r,t);return"object"!=typeof i&&(i=a.default(this.options(),t)),"object"==typeof i?i:{}}},f.context=f.options,f.enabled=function(t){var e=this.proxy("options.providers.all");"boolean"!=typeof e&&(e=this.proxy("options.all")),"boolean"!=typeof e&&(e=this.proxy("integrations.all")),"boolean"!=typeof e&&(e=!0);var n=e&&s.default(t),r=this.integrations();if(r.providers&&r.providers.hasOwnProperty(t)&&(n=r.providers[t]),r.hasOwnProperty(t)){var i=r[t];n="boolean"!=typeof i||i}return!!n},f.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()},f.active=function(){var t=this.proxy("options.active");return null==t&&(t=!0),t},f.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")},f.sessionId=f.anonymousId,f.groupId=l.proxy("options.groupId"),f.traits=function(t){var e=this.proxy("options.traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("options.traits."+r):this[r]();null!=i&&(e[t[r]]=i,delete e[r])}return e},f.library=function(){var t=this.proxy("options.library");return t?"string"==typeof t?{name:t,version:null}:t:{name:"unknown",version:null}},f.device=function(){var t=this.proxy("context.device");"object"==typeof t&&null!==t||(t={});var e=this.library().name;return t.type||(e.indexOf("ios")>-1&&(t.type="ios"),e.indexOf("android")>-1&&(t.type="android")),t},f.userAgent=l.proxy("context.userAgent"),f.timezone=l.proxy("context.timezone"),f.timestamp=l.field("timestamp"),f.channel=l.field("channel"),f.ip=l.proxy("context.ip"),f.userId=l.field("userId"),i.default(f)},7748:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;var i=r(n(5615)),o=r(n(6362)),s=r(n(7639)),u=n(2265);function a(t,e){u.Facade.call(this,t,e)}e.Group=a,i.default(a,u.Facade);var c=a.prototype;c.action=function(){return"group"},c.type=c.action,c.groupId=u.Facade.field("groupId"),c.created=function(){var t=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(t)return s.default(t)},c.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.groupId();return o.default(e)?e:void 0},c.traits=function(t){var e=this.properties(),n=this.groupId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("traits."+r):this[r]();null!=i&&(e[t[r]]=i,delete e[r])}return e},c.name=u.Facade.proxy("traits.name"),c.industry=u.Facade.proxy("traits.industry"),c.employees=u.Facade.proxy("traits.employees"),c.properties=function(){return this.field("traits")||this.field("properties")||{}}},5543:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Identify=void 0;var i=n(2265),o=r(n(8578)),s=r(n(5615)),u=r(n(6362)),a=r(n(7639)),c=function(t){return t.trim()};function l(t,e){i.Facade.call(this,t,e)}e.Identify=l,s.default(l,i.Facade);var f=l.prototype;f.action=function(){return"identify"},f.type=f.action,f.traits=function(t){var e=this.field("traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("traits."+r):this[r]();null!=i&&(e[t[r]]=i,r!==t[r]&&delete e[r])}return e},f.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.userId();return u.default(e)?e:void 0},f.created=function(){var t=this.proxy("traits.created")||this.proxy("traits.createdAt");if(t)return a.default(t)},f.companyCreated=function(){var t=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(t)return a.default(t)},f.companyName=function(){return this.proxy("traits.company.name")},f.name=function(){var t=this.proxy("traits.name");if("string"==typeof t)return c(t);var e=this.firstName(),n=this.lastName();return e&&n?c(e+" "+n):void 0},f.firstName=function(){var t=this.proxy("traits.firstName");if("string"==typeof t)return c(t);var e=this.proxy("traits.name");return"string"==typeof e?c(e).split(" ")[0]:void 0},f.lastName=function(){var t=this.proxy("traits.lastName");if("string"==typeof t)return c(t);var e=this.proxy("traits.name");if("string"==typeof e){var n=c(e).indexOf(" ");if(-1!==n)return c(e.substr(n+1))}},f.uid=function(){return this.userId()||this.username()||this.email()},f.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")},f.age=function(){var t=this.birthday(),e=o.default(this.traits(),"age");return null!=e?e:t instanceof Date?(new Date).getFullYear()-t.getFullYear():void 0},f.avatar=function(){var t=this.traits();return o.default(t,"avatar")||o.default(t,"photoUrl")||o.default(t,"avatarUrl")},f.position=function(){var t=this.traits();return o.default(t,"position")||o.default(t,"jobTitle")},f.username=i.Facade.proxy("traits.username"),f.website=i.Facade.one("traits.website"),f.websites=i.Facade.multi("traits.website"),f.phone=i.Facade.one("traits.phone"),f.phones=i.Facade.multi("traits.phone"),f.address=i.Facade.proxy("traits.address"),f.gender=i.Facade.proxy("traits.gender"),f.birthday=i.Facade.proxy("traits.birthday")},4303:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Delete=e.Screen=e.Page=e.Track=e.Identify=e.Group=e.Alias=e.Facade=void 0;var i=n(2265);Object.defineProperty(e,"Facade",{enumerable:!0,get:function(){return i.Facade}});var o=n(7663);Object.defineProperty(e,"Alias",{enumerable:!0,get:function(){return o.Alias}});var s=n(7748);Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return s.Group}});var u=n(5543);Object.defineProperty(e,"Identify",{enumerable:!0,get:function(){return u.Identify}});var a=n(5616);Object.defineProperty(e,"Track",{enumerable:!0,get:function(){return a.Track}});var c=n(3644);Object.defineProperty(e,"Page",{enumerable:!0,get:function(){return c.Page}});var l=n(6871);Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return l.Screen}});var f=n(7532);Object.defineProperty(e,"Delete",{enumerable:!0,get:function(){return f.Delete}}),e.default=r(r({},i.Facade),{Alias:o.Alias,Group:s.Group,Identify:u.Identify,Track:a.Track,Page:c.Page,Screen:l.Screen,Delete:f.Delete})},6362:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=/.+\@.+\..+/;e.default=function(t){return n.test(t)}},7751:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={Salesforce:!0};e.default=function(t){return!n[t]}},3644:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;var i=r(n(5615)),o=n(2265),s=n(5616),u=r(n(6362));function a(t,e){o.Facade.call(this,t,e)}e.Page=a,i.default(a,o.Facade);var c=a.prototype;c.action=function(){return"page"},c.type=c.action,c.category=o.Facade.field("category"),c.name=o.Facade.field("name"),c.title=o.Facade.proxy("properties.title"),c.path=o.Facade.proxy("properties.path"),c.url=o.Facade.proxy("properties.url"),c.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},c.properties=function(t){var e=this.field("properties")||{},n=this.category(),r=this.name();for(var i in t=t||{},n&&(e.category=n),r&&(e.name=r),t){var o=null==this[i]?this.proxy("properties."+i):this[i]();null!=o&&(e[t[i]]=o,i!==t[i]&&delete e[i])}return e},c.email=function(){var t=this.proxy("context.traits.email")||this.proxy("properties.email");if(t)return t;var e=this.userId();return u.default(e)?e:void 0},c.fullName=function(){var t=this.category(),e=this.name();return e&&t?t+" "+e:e},c.event=function(t){return t?"Viewed "+t+" Page":"Loaded a Page"},c.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new s.Track(e,this.opts)}},6871:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Screen=void 0;var i=r(n(5615)),o=n(3644),s=n(5616);function u(t,e){o.Page.call(this,t,e)}e.Screen=u,i.default(u,o.Page),u.prototype.action=function(){return"screen"},u.prototype.type=u.prototype.action,u.prototype.event=function(t){return t?"Viewed "+t+" Screen":"Loaded a Screen"},u.prototype.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new s.Track(e,this.opts)}},5616:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Track=void 0;var i=r(n(5615)),o=n(2265),s=n(5543),u=r(n(6362)),a=r(n(8578));function c(t,e){o.Facade.call(this,t,e)}e.Track=c,i.default(c,o.Facade);var l=c.prototype;l.action=function(){return"track"},l.type=l.action,l.event=o.Facade.field("event"),l.value=o.Facade.proxy("properties.value"),l.category=o.Facade.proxy("properties.category"),l.id=o.Facade.proxy("properties.id"),l.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")},l.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")},l.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")},l.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")},l.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")},l.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")},l.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")},l.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")},l.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")},l.sku=o.Facade.proxy("properties.sku"),l.tax=o.Facade.proxy("properties.tax"),l.name=o.Facade.proxy("properties.name"),l.price=o.Facade.proxy("properties.price"),l.total=o.Facade.proxy("properties.total"),l.repeat=o.Facade.proxy("properties.repeat"),l.coupon=o.Facade.proxy("properties.coupon"),l.shipping=o.Facade.proxy("properties.shipping"),l.discount=o.Facade.proxy("properties.discount"),l.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")},l.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")},l.description=o.Facade.proxy("properties.description"),l.plan=o.Facade.proxy("properties.plan"),l.subtotal=function(){var t=a.default(this.properties(),"subtotal"),e=this.total()||this.revenue();if(t)return t;if(!e)return 0;if(this.total()){var n=this.tax();n&&(e-=n),(n=this.shipping())&&(e-=n),(n=this.discount())&&(e+=n)}return e},l.products=function(){var t=this.properties(),e=a.default(t,"products");return Array.isArray(e)?e.filter(function(t){return null!==t}):[]},l.quantity=function(){return(this.obj.properties||{}).quantity||1},l.currency=function(){return(this.obj.properties||{}).currency||"USD"},l.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},l.query=o.Facade.proxy("options.query"),l.properties=function(t){var e=this.field("properties")||{};for(var n in t=t||{}){var r=null==this[n]?this.proxy("properties."+n):this[n]();null!=r&&(e[t[n]]=r,delete e[n])}return e},l.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()},l.email=function(){var t=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(t)return t;var e=this.userId();return u.default(e)?e:void 0},l.revenue=function(){var t=this.proxy("properties.revenue"),e=this.event();return!t&&e&&e.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(t=this.proxy("properties.total")),function(t){if(!t)return;if("number"==typeof t)return t;if("string"!=typeof t)return;if(t=t.replace(/\$/g,""),t=parseFloat(t),!isNaN(t))return t}(t)},l.cents=function(){var t=this.revenue();return"number"!=typeof t?this.value()||0:100*t},l.identify=function(){var t=this.json();return t.traits=this.traits(),new s.Identify(t,this.opts)}},518:function(t,e,n){"use strict";var r=n(7237);function i(t,e){return void 0===e&&(e=!0),t&&"object"==typeof t?function(t,e){return Object.keys(t).forEach(function(n){t[n]=i(t[n],e)}),t}(t,e):Array.isArray(t)?function(t,e){return t.forEach(function(n,r){t[r]=i(n,e)}),t}(t,e):r.is(t,e)?r.parse(t):t}t.exports=i},7237:function(t,e){"use strict";var n=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;e.parse=function(t){var e=[1,5,6,7,11,12],r=n.exec(t),i=0;if(!r)return new Date(t);for(var o,s=0;o=e[s];s++)r[o]=parseInt(r[o],10)||0;r[2]=parseInt(r[2],10)||1,r[3]=parseInt(r[3],10)||1,r[2]--,r[8]=r[8]?(r[8]+"00").substring(0,3):0," "===r[4]?i=(new Date).getTimezoneOffset():"Z"!==r[9]&&r[10]&&(i=60*r[11]+r[12],"+"===r[10]&&(i=0-i));var u=Date.UTC(r[1],r[2],r[3],r[5],r[6]+i,r[7],r[8]);return new Date(u)},e.is=function(t,e){return"string"==typeof t&&((!e||!1!==/^\d{4}-\d{2}-\d{2}/.test(t))&&n.test(t))}},5615:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},7639:function(t,e,n){"use strict";var r=n(7237),i=n(8101),o=n(4834),s=Object.prototype.toString;t.exports=function(t){return e=t,"[object Date]"===s.call(e)?t:function(t){return"[object Number]"===s.call(t)}(t)?new Date((n=t)<315576e5?1e3*n:n):r.is(t)?r.parse(t):i.is(t)?i.parse(t):o.is(t)?o.parse(t):new Date(t);var e,n}},8101:function(t,e){"use strict";var n=/\d{13}/;e.is=function(t){return n.test(t)},e.parse=function(t){return t=parseInt(t,10),new Date(t)}},4834:function(t,e){"use strict";var n=/\d{10}/;e.is=function(t){return n.test(t)},e.parse=function(t){var e=1e3*parseInt(t,10);return new Date(e)}},8578:function(t){function e(t){return function(e,n,r,o){var s,u=o&&function(t){return"function"==typeof t}(o.normalizer)?o.normalizer:i;n=u(n);for(var a=!1;!a;)c();function c(){for(s in e){var t=u(s);if(0===n.indexOf(t)){var r=n.substr(t.length);if("."===r.charAt(0)||0===r.length){n=r.substr(1);var i=e[s];return null==i?void(a=!0):n.length?void(e=i):void(a=!0)}}}s=void 0,a=!0}if(s)return null==e?e:t(e,s,r)}}function n(t,e){return t.hasOwnProperty(e)&&delete t[e],t}function r(t,e,n){return t.hasOwnProperty(e)&&(t[e]=n),t}function i(t){return t.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}t.exports=e(function(t,e){if(t.hasOwnProperty(e))return t[e]}),t.exports.find=t.exports,t.exports.replace=function(t,n,i,o){return e(r).call(this,t,n,i,o),t},t.exports.del=function(t,r,i){return e(n).call(this,t,r,null,i),t}},8110:function(t){t.exports=function(t){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(t,e){var n=t[0],r=t[1],i=t[2],o=t[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+e[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+e[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+e[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+e[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+e[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+e[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+e[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+e[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+e[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|r>>>11)+i|0,t[0]=n+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function i(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function o(t){var e,i,o,s,u,a,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,r(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)o[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,o[14]=u,o[15]=a,n(l,o),l}function s(t){var e,r,o,s,u,a,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,i(t.subarray(e-64,e)));for(r=(t=e-64<c?t.subarray(e-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<r;e+=1)o[e>>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,o[14]=u,o[15]=a,n(l,o),l}function u(t){var n,r="";for(n=0;n<4;n+=1)r+=e[t>>8*n+4&15]+e[t>>8*n&15];return r}function a(t){var e;for(e=0;e<t.length;e+=1)t[e]=u(t[e]);return t.join("")}function c(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function l(t,e){var n,r=t.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n<r;n+=1)o[n]=t.charCodeAt(n);return e?o:i}function f(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function p(t,e,n){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(new Uint8Array(t)),r.set(new Uint8Array(e),t.byteLength),n?r:r.buffer}function h(t){var e,n=[],r=t.length;for(e=0;e<r-1;e+=2)n.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,n)}function d(){this.reset()}return a(o("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return(t=0|t||0)<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(n,r){var i,o,s,u,a=this.byteLength,c=e(n,a),l=a;return r!==t&&(l=e(r,a)),c>l?new ArrayBuffer(0):(i=l-c,o=new ArrayBuffer(i),s=new Uint8Array(o),u=new Uint8Array(this,c,i),s.set(u),o)}}(),d.prototype.append=function(t){return this.appendBinary(c(t)),this},d.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)n(this._hash,r(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},d.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),n=a(this._hash),t&&(n=h(n)),this.reset(),n},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},d.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(t,e){var r,i,o,s=e;if(t[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,t),s=0;s<16;s+=1)t[s]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,t[14]=i,t[15]=o,n(this._hash,t)},d.hash=function(t,e){return d.hashBinary(c(t),e)},d.hashBinary=function(t,e){var n=a(o(t));return e?h(n):n},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(t){var e,r=p(this._buff.buffer,t,!0),o=r.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)n(this._hash,i(r.subarray(e-64,e)));return this._buff=e-64<o?new Uint8Array(r.buffer.slice(e-64)):new Uint8Array(0),this},d.ArrayBuffer.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r[e]<<(e%4<<3);return this._finish(o,i),n=a(this._hash),t&&(n=h(n)),this.reset(),n},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var t=d.prototype.getState.call(this);return t.buff=f(t.buff),t},d.ArrayBuffer.prototype.setState=function(t){return t.buff=l(t.buff,!0),d.prototype.setState.call(this,t)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(t,e){var n=a(s(new Uint8Array(t)));return e?h(n):n},d}()},6789:function(t,e,n){"use strict";n.d(e,{a:function(){return o},s:function(){return i}});var r=n(4082);function i(){return!(0,r.B)()||window.navigator.onLine}function o(){return!i()}},3858:function(t,e,n){"use strict";n.d(e,{a:function(){return r}});var r="us-east-1.hightouch-events.com"},5956:function(t,e,n){"use strict";n.d(e,{o:function(){return d}});var r=n(5608),i=n(9752),o=n(4034),s=n(824),u=n(6452),a=n(3831),c=n(3858);function l(t){console.error("Error sending hightouch performance metrics",t)}var f,p=function(){function t(t){var e,n,r,i,o=this;if(this.host=null!==(e=null==t?void 0:t.host)&&void 0!==e?e:c.a,this.sampleRate=null!==(n=null==t?void 0:t.sampleRate)&&void 0!==n?n:1,this.flushTimer=null!==(r=null==t?void 0:t.flushTimer)&&void 0!==r?r:3e4,this.maxQueueSize=null!==(i=null==t?void 0:t.maxQueueSize)&&void 0!==i?i:20,this.queue=[],this.sampleRate>0){var s=!1,u=function(){s||(s=!0,o.flush().catch(l),s=!1,setTimeout(u,o.flushTimer))};u()}}return t.prototype.increment=function(t,e){if(t.includes("analytics_js.")&&0!==e.length&&!(Math.random()>this.sampleRate||this.queue.length>=this.maxQueueSize)){var n=function(t,e,n){var i=e.reduce(function(t,e){var n=e.split(":"),r=n[0],i=n[1];return t[r]=i,t},{});return{type:"Counter",metric:t,value:1,tags:(0,r.Cl)((0,r.Cl)({},i),{library:"analytics.js",library_version:"web"===n?"next-".concat(u.r):"npm:next-".concat(u.r)})}}(t,e,(0,a.X)());this.queue.push(n),t.includes("error")&&this.flush().catch(l)}},t.prototype.flush=function(){return(0,r.sH)(this,void 0,Promise,function(){var t=this;return(0,r.YH)(this,function(e){switch(e.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(e){l(e),t.sampleRate=0})];case 1:return e.sent(),[2]}})})},t.prototype.send=function(){return(0,r.sH)(this,void 0,Promise,function(){var t,e,n;return(0,r.YH)(this,function(r){return t={series:this.queue},this.queue=[],e={Accept:"application/json","Content-Type":"application/json"},n="https://".concat(this.host,"/v1/m"),[2,(0,s.h)(n,{headers:e,body:JSON.stringify(t),method:"POST"})]})})},t}(),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.C6)(e,t),e.initRemoteMetrics=function(t){f=new p(t)},e.prototype.increment=function(e,n,r){t.prototype.increment.call(this,e,n,r),null==f||f.increment(e,null!=r?r:[])},e}(o.p),d=function(t){function e(e,n){return t.call(this,e,n,new h)||this}return(0,r.C6)(e,t),e.system=function(){return new this({type:"track",event:"system"})},e}(i.j)},4082:function(t,e,n){"use strict";function r(){return"undefined"!=typeof window}function i(){return!r()}n.d(e,{B:function(){return r},S:function(){return i}})},9059:function(t,e,n){"use strict";function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}}n.d(e,{p:function(){return r}})},6452:function(t,e,n){"use strict";n.d(e,{r:function(){return r}});var r="1.5.7"},824:function(t,e,n){"use strict";function r(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],s=[],u={},a=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return s},get:function(t){return u[t.toLowerCase()]},has:function(t){return t.toLowerCase()in u}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,n){o.push(e=e.toLowerCase()),s.push([e,n]),u[e]=u[e]?u[e]+","+n:n}),n(a())},i.onerror=r,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)})}n.d(e,{h:function(){return o}});var i=n(5120),o=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=(0,i.m)();return(n&&n.fetch||r).apply(void 0,t)}},5120:function(t,e,n){"use strict";n.d(e,{m:function(){return r}});var r=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:null}},6091:function(t,e,n){"use strict";n.d(e,{Ud:function(){return s},kJ:function(){return i},rY:function(){return o}});var r="htevents";function i(){return window[r]}function o(t){r=t}function s(t){window[r]=t}},6238:function(t,e,n){"use strict";function r(t){return Array.prototype.slice.call(window.document.querySelectorAll("script")).find(function(e){return e.src===t})}function i(t,e){var n=r(t);if(void 0!==n){var i=null==n?void 0:n.getAttribute("status");if("loaded"===i)return Promise.resolve(n);if("loading"===i)return new Promise(function(t,e){n.addEventListener("load",function(){return t(n)}),n.addEventListener("error",function(t){return e(t)})})}return new Promise(function(n,r){var i,o=window.document.createElement("script");o.type="text/javascript",o.src=t,o.async=!0,o.setAttribute("status","loading");for(var s=0,u=Object.entries(null!=e?e:{});s<u.length;s++){var a=u[s],c=a[0],l=a[1];o.setAttribute(c,l)}o.onload=function(){o.onerror=o.onload=null,o.setAttribute("status","loaded"),n(o)},o.onerror=function(){o.onerror=o.onload=null,o.setAttribute("status","error"),r(new Error("Failed to load ".concat(t)))};var f=window.document.getElementsByTagName("script")[0];null===(i=f.parentElement)||void 0===i||i.insertBefore(o,f)})}function o(t){var e=r(t);return void 0!==e&&e.remove(),Promise.resolve()}n.d(e,{d:function(){return o},k:function(){return i}})},5835:function(t,e,n){"use strict";n.d(e,{J:function(){return i}});var r=n(5608);function i(t,e){var n,i=Object.entries(null!==(n=e.integrations)&&void 0!==n?n:{}).reduce(function(t,e){var n,i,o=e[0],s=e[1];return"object"==typeof s?(0,r.Cl)((0,r.Cl)({},t),((n={})[o]=s,n)):(0,r.Cl)((0,r.Cl)({},t),((i={})[o]={},i))},{});return Object.entries(t.integrations).reduce(function(t,e){var n,o=e[0],s=e[1];return(0,r.Cl)((0,r.Cl)({},t),((n={})[o]=(0,r.Cl)((0,r.Cl)({},s),i[o]),n))},{})}},7106:function(t,e,n){"use strict";n.d(e,{_:function(){return i}});var r=n(5608),i=function(t,e){return(0,r.sH)(void 0,void 0,Promise,function(){var n;return(0,r.YH)(this,function(i){return n=function(i){return(0,r.sH)(void 0,void 0,Promise,function(){var o;return(0,r.YH)(this,function(r){switch(r.label){case 0:return t(i)?(o=n,[4,e()]):[3,2];case 1:return[2,o.apply(void 0,[r.sent()])];case 2:return[2]}})})},[2,n(void 0)]})})}},2911:function(t,e,n){"use strict";n.d(e,{I2:function(){return u},YM:function(){return a},qQ:function(){return s}});var r,i=n(6091),o=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,s=function(t){var e=(0,i.kJ)();e&&(e._cdn=t),r=t},u=function(){var t,e=null!=r?r:null===(t=(0,i.kJ)())||void 0===t?void 0:t._cdn;if(e)return e;var n,s=(Array.prototype.slice.call(document.querySelectorAll("script")).forEach(function(t){var e,r=null!==(e=t.getAttribute("src"))&&void 0!==e?e:"",i=o.exec(r);i&&i[1]&&(n=i[1])}),n);return s||"https://cdn.hightouch-events.com"},a=function(){var t=u();return"".concat(t,"/next-integrations")}},9732:function(t,e,n){"use strict";n.d(e,{x:function(){return p}});var r=n(5608),i=n(2939),o=n(5956),s=n(4082),u={getItem:function(){},setItem:function(){},removeItem:function(){}};try{u=(0,s.B)()&&window.localStorage?window.localStorage:u}catch(t){console.warn("Unable to access localStorage",t)}function a(t){var e=u.getItem(t);return(e?JSON.parse(e):[]).map(function(t){return new o.o(t.event,t.id)})}function c(t){var e=u.getItem(t);return e?JSON.parse(e):{}}function l(t){u.removeItem(t)}function f(t,e,n){void 0===n&&(n=0);var r="persisted-queue:v1:".concat(t,":lock"),i=u.getItem(r),o=i?JSON.parse(i):null,s=null===o||function(t){return(new Date).getTime()>t}(o);if(s)return u.setItem(r,JSON.stringify((new Date).getTime()+50)),e(),void u.removeItem(r);!s&&n<3?setTimeout(function(){f(t,e,n+1)},50):console.error("Unable to retrieve lock")}var p=function(t){function e(e,n){var i=t.call(this,e,[])||this,o="persisted-queue:v1:".concat(n,":items"),s="persisted-queue:v1:".concat(n,":seen"),p=[],h={};return f(n,function(){try{p=a(o),h=c(s),l(o),l(s),i.queue=(0,r.fX)((0,r.fX)([],p,!0),i.queue,!0),i.seen=(0,r.Cl)((0,r.Cl)({},h),i.seen)}catch(t){console.error(t)}}),window.addEventListener("pagehide",function(){if(i.todo>0){var t=(0,r.fX)((0,r.fX)([],i.queue,!0),i.future,!0);try{f(n,function(){!function(t,e){var n=a(t),i=(0,r.fX)((0,r.fX)([],e,!0),n,!0).reduce(function(t,e){var n;return(0,r.Cl)((0,r.Cl)({},t),((n={})[e.id]=e,n))},{});u.setItem(t,JSON.stringify(Object.values(i)))}(o,t),function(t,e){var n=c(t);u.setItem(t,JSON.stringify((0,r.Cl)((0,r.Cl)({},n),e)))}(s,i.seen)})}catch(t){console.error(t)}}}),i}return(0,r.C6)(e,t),e}(i.M)},7536:function(t,e,n){"use strict";n.d(e,{W:function(){return i}});var r=n(4303);function i(t,e){var n=new r.Facade(t,e);return"track"===t.type&&(n=new r.Track(t,e)),"identify"===t.type&&(n=new r.Identify(t,e)),"page"===t.type&&(n=new r.Page(t,e)),"alias"===t.type&&(n=new r.Alias(t,e)),"group"===t.type&&(n=new r.Group(t,e)),"screen"===t.type&&(n=new r.Screen(t,e)),Object.defineProperty(n,"obj",{value:t,writable:!0}),n}},3831:function(t,e,n){"use strict";n.d(e,{J:function(){return i},X:function(){return o}});var r="npm";function i(t){r=t}function o(){return r}},1418:function(t,e,n){"use strict";n.r(e),n.d(e,{applyDestinationMiddleware:function(){return s},sourceMiddlewarePlugin:function(){return u}});var r=n(5608),i=n(9752),o=n(7536);function s(t,e,n){return(0,r.sH)(this,void 0,Promise,function(){function i(e,n){return(0,r.sH)(this,void 0,Promise,function(){var i,s,u;return(0,r.YH)(this,function(a){switch(a.label){case 0:return i=!1,s=null,[4,n({payload:(0,o.W)(e,{clone:!0,traverse:!1}),integration:t,next:function(t){i=!0,null===t&&(s=null),t&&(s=t.obj)}})];case 1:return a.sent(),i||null===s||(s.integrations=(0,r.Cl)((0,r.Cl)({},e.integrations),((u={})[t]=!1,u))),[2,s]}})})}var s,u,a,c,l;return(0,r.YH)(this,function(t){switch(t.label){case 0:s=(0,o.W)(e,{clone:!0,traverse:!1}).rawEvent(),u=0,a=n,t.label=1;case 1:return u<a.length?(c=a[u],[4,i(s,c)]):[3,4];case 2:if(null===(l=t.sent()))return[2,null];s=l,t.label=3;case 3:return u++,[3,1];case 4:return[2,s]}})})}function u(t,e){function n(n){return(0,r.sH)(this,void 0,Promise,function(){var s;return(0,r.YH)(this,function(r){switch(r.label){case 0:return s=!1,[4,t({payload:(0,o.W)(n.event,{clone:!0,traverse:!1}),integrations:null!=e?e:{},next:function(t){s=!0,t&&(n.event=t.obj)}})];case 1:if(r.sent(),!s)throw new i.d({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(t){return Promise.resolve(t)},track:n,page:n,identify:n,alias:n,group:n}}},7764:function(t,e,n){"use strict";function r(t,e){return new Promise(function(n,r){var i=setTimeout(function(){r(Error("Promise timed out"))},e);t.then(function(t){return clearTimeout(i),n(t)}).catch(r)})}function i(t,e,n){var i;return(i=n,new Promise(function(t){return setTimeout(t,i)})).then(function(){return r(function(){try{return Promise.resolve(e(t))}catch(t){return Promise.reject(t)}}(),1e3)}).catch(function(e){null==t||t.log("warn","Callback Error",{error:e}),null==t||t.stats.increment("callback_error")}).then(function(){return t})}n.d(e,{s2:function(){return r},w_:function(){return i}})},9752:function(t,e,n){"use strict";n.d(e,{d:function(){return a},j:function(){return c}});var r=n(9659),i=n(3435),o=n(5608),s=function(){function t(){this._logs=[]}return t.prototype.log=function(t,e,n){var r=new Date;this._logs.push({level:t,message:e,time:r,extras:n})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(t,e){var n,r,i,s=(0,o.Cl)((0,o.Cl)({},e),{json:JSON.stringify(e.extras,null," "),extras:e.extras});delete s.time;var u=null!==(i=null===(r=e.time)||void 0===r?void 0:r.toISOString())&&void 0!==i?i:"";return t[u]&&(u="".concat(u,"-").concat(Math.random())),(0,o.Cl)((0,o.Cl)({},t),((n={})[u]=s,n))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(t){var e=t.level,n=t.message,r=t.extras;"info"===e||"debug"===e?console.log(n,null!=r?r:""):console[e](n,null!=r?r:"")});this._logs=[]},t}(),u=n(4034),a=function(t){var e,n,r;this.retry=null===(e=t.retry)||void 0===e||e,this.type=null!==(n=t.type)&&void 0!==n?n:"plugin Error",this.reason=null!==(r=t.reason)&&void 0!==r?r:""},c=function(){function t(t,e,n,i){void 0===e&&(e=(0,r.v4)()),void 0===n&&(n=new u.r),void 0===i&&(i=new s),this.attempts=0,this.event=t,this._id=e,this.logger=i,this.stats=n}return t.system=function(){},t.prototype.isSame=function(t){return t.id===this.id},t.prototype.cancel=function(t){if(t)throw t;throw new a({reason:"Context Cancel"})},t.prototype.log=function(t,e,n){this.logger.log(t,e,n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(t,e){var n;if("integrations"===t.split(".")[0]){var r=t.split(".")[1];if(!1===(null===(n=this.event.integrations)||void 0===n?void 0:n[r]))return this.event}return(0,i.J)(this.event,t,e),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(t){this._failedDelivery=t},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t}()},6551:function(t,e,n){"use strict";n.d(e,{v:function(){return r}});var r=function(){function t(){this.callbacks={}}return t.prototype.on=function(t,e){return this.callbacks[t]?this.callbacks[t].push(e):this.callbacks[t]=[e],this},t.prototype.once=function(t,e){var n=this,r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];n.off(t,r),e.apply(n,i)};return this.on(t,r),this},t.prototype.off=function(t,e){var n,r=(null!==(n=this.callbacks[t])&&void 0!==n?n:[]).filter(function(t){return t!==e});return this.callbacks[t]=r,this},t.prototype.emit=function(t){for(var e,n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(null!==(e=this.callbacks[t])&&void 0!==e?e:[]).forEach(function(t){t.apply(n,r)}),this},t}()},2939:function(t,e,n){"use strict";n.d(e,{g:function(){return o},M:function(){return s}});var r=n(5608),i=n(6551);var o="onRemoveFromFuture",s=function(t){function e(e,n,r){var i=t.call(this)||this;return i.future=[],i.maxAttempts=e,i.queue=n,i.seen=null!=r?r:{},i}return(0,r.C6)(e,t),e.prototype.push=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.map(function(e){return!(t.updateAttempts(e)>t.maxAttempts||t.includes(e))&&(t.queue.push(e),!0)});return this.queue=this.queue.sort(function(e,n){return t.getAttempts(e)-t.getAttempts(n)}),r},e.prototype.pushWithBackoff=function(t){var e=this;if(0===this.getAttempts(t))return this.push(t)[0];var n=this.updateAttempts(t);if(n>this.maxAttempts||this.includes(t))return!1;var r=function(t){var e=Math.random()+1,n=t.minTimeout,r=void 0===n?500:n,i=t.factor,o=void 0===i?2:i,s=t.attempt,u=t.maxTimeout,a=void 0===u?1/0:u;return Math.min(e*r*Math.pow(o,s),a)}({attempt:n-1});return setTimeout(function(){e.queue.push(t),e.future=e.future.filter(function(e){return e.id!==t.id}),e.emit(o)},r),this.future.push(t),!0},e.prototype.getAttempts=function(t){var e;return null!==(e=this.seen[t.id])&&void 0!==e?e:0},e.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},e.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find(function(e){return e.id===t.id}))||Boolean(this.future.find(function(e){return e.id===t.id}))},e.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e}(i.v)},2620:function(t,e,n){"use strict";n.d(e,{C:function(){return o},D:function(){return s}});var r=n(5608),i=n(9752);function o(t,e){t.log("debug","plugin",{plugin:e.name});var n=(new Date).getTime(),o=e[t.event.type];return void 0===o?Promise.resolve(t):function(t){return(0,r.sH)(this,void 0,void 0,function(){var e;return(0,r.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return[2,n.sent()];case 2:return e=n.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}(function(){return o.apply(e,[t])}).then(function(t){var r=(new Date).getTime()-n;return t.stats.gauge("plugin_time",r,["plugin:".concat(e.name)]),t}).catch(function(n){if(n instanceof i.d&&"middleware_cancellation"===n.type)throw n;return n instanceof i.d?(t.log("warn",n.type,{plugin:e.name,error:n}),n):(t.log("error","plugin Error",{plugin:e.name,error:n}),t.stats.increment("plugin_error",1,["plugin:".concat(e.name)]),n)})}function s(t,e){return o(t,e).then(function(e){if(e instanceof i.j)return e;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(e)})}},4034:function(t,e,n){"use strict";n.d(e,{p:function(){return i},r:function(){return o}});var r=n(5608),i=function(){function t(){this.metrics=[]}return t.prototype.increment=function(t,e,n){void 0===e&&(e=1),this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(t,e,n){this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var t=this.metrics.map(function(t){return(0,r.Cl)((0,r.Cl)({},t),{tags:t.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:(e=t.type,{gauge:"g",counter:"c"}[e]),e:t.timestamp};var e})},t}(),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.C6)(e,t),e.prototype.gauge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.increment=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.flush=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.serialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return[]},e}(i)},441:function(t,e,n){"use strict";function r(t){return"string"==typeof t}function i(t){return"number"==typeof t}function o(t){return"function"==typeof t}function s(t){return null!=t}function u(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}n.d(e,{Et:function(){return i},Kg:function(){return r},Qd:function(){return u},Tn:function(){return o},t2:function(){return s}})},9659:function(t,e,n){"use strict";n.d(e,{v4:function(){return s}});for(var r,i=256,o=[];i--;)o[i]=(i+256).toString(16).substring(1);function s(){var t,e=0,n="";if(!r||i+16>256){for(r=Array(e=256);e--;)r[e]=256*Math.random()|0;e=i=0}for(;e<16;e++)t=r[i+e],n+=6==e?o[15&t|64]:8==e?o[63&t|128]:o[t],1&e&&e>1&&e<11&&(n+="-");return i++,n}},3435:function(t,e,n){"use strict";function r(t,e,n){e.split&&(e=e.split("."));for(var r,i,o=0,s=e.length,u=t;o<s&&"__proto__"!=(i=""+e[o++])&&"constructor"!==i&&"prototype"!==i;)u=u[i]=o===s?n:typeof(r=u[i])==typeof e?r:0*e[o]!=0||~(""+e[o]).indexOf(".")?{}:[]}n.d(e,{J:function(){return r}})},5608:function(t,e,n){"use strict";n.d(e,{C6:function(){return i},Cl:function(){return o},Tt:function(){return s},YH:function(){return a},fX:function(){return c},sH:function(){return u}});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function u(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{a(r.next(t))}catch(t){o(t)}}function u(t){try{a(r.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,u)}a((r=r.apply(t,e||[])).next())})}function a(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}Object.create;function c(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;"function"==typeof SuppressedError&&SuppressedError}},o={};function s(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={exports:{}};return i[t].call(n.exports,n,n.exports,s),n.exports}s.m=i,s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},e=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);s.r(i);var o={};t=t||[null,e({}),e([]),e(e)];for(var u=2&r&&n;("object"==typeof u||"function"==typeof u)&&!~t.indexOf(u);u=e(u))Object.getOwnPropertyNames(u).forEach(function(t){o[t]=function(){return n[t]}});return o.default=function(){return n},s.d(i,o),i},s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.f={},s.e=function(t){return Promise.all(Object.keys(s.f).reduce(function(e,n){return s.f[n](t,e),e},[]))},s.u=function(t){return({10:"tsub-middleware",50:"ajs-destination",104:"schemaFilter",248:"auto-track",391:"google-tag-manager",521:"remoteMiddleware",538:"queryString",666:"gtag",694:"legacyVideos"}[t]||t)+".bundle."+{10:"b717b62fe947259b0454",50:"b5407b09b321c1d47d7c",104:"babb6cdbe396c20dc88f",248:"68ce13c2007188a9368d",391:"5dbd0ff300a5c429a406",407:"5cd2d2d625cfaa9e2f6e",521:"9945b0dd526dedecf614",538:"b86b3b6ef44fbbb98ec4",666:"fa18b007fc2891339158",694:"d1d6291274937f505b12"}[t]+".js"},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n={},r="@ht-sdks/events-sdk-js-browser:",s.l=function(t,e,i,o){if(n[t])n[t].push(e);else{var u,a;if(void 0!==i)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var f=c[l];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+i){u=f;break}}u||(a=!0,(u=document.createElement("script")).charset="utf-8",s.nc&&u.setAttribute("nonce",s.nc),u.setAttribute("data-webpack",r+i),u.src=t),n[t]=[e];var p=function(e,r){u.onerror=u.onload=null,clearTimeout(h);var i=n[t];if(delete n[t],u.parentNode&&u.parentNode.removeChild(u),i&&i.forEach(function(t){return t(r)}),e)return e(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),a&&document.head.appendChild(u)}},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.p="",function(){var t={57:0};s.f.j=function(e,n){var r=s.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(function(n,i){r=t[e]=[n,i]});n.push(r[2]=i);var o=s.p+s.u(e),u=new Error;s.l(o,function(n){if(s.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",u.name="ChunkLoadError",u.type=i,u.request=o,r[1](u)}},"chunk-"+e,e)}};var e=function(e,n){var r,i,o=n[0],u=n[1],a=n[2],c=0;if(o.some(function(e){return 0!==t[e]})){for(r in u)s.o(u,r)&&(s.m[r]=u[r]);if(a)a(s)}for(e&&e(n);c<o.length;c++)i=o[c],s.o(t,i)&&t[i]&&t[i][0](),t[i]=0},n=self.webpackChunk_ht_sdks_events_sdk_js_browser=self.webpackChunk_ht_sdks_events_sdk_js_browser||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))}();var u={};return function(){"use strict";s.r(u),s.d(u,{HtEventsBrowser:function(){return gn},loadLegacySettings:function(){return fn}});var t=s(2911),e=s(3831),n=s(5608);function r(){return"undefined"!=typeof process&&process.env?process.env:{}}var i=s(824),o=s(441);function a(t,e,n,r){var i,s=[t,e,n,r],u=(0,o.Qd)(t)?t.event:t;if(!u||!(0,o.Kg)(u))throw new Error("Event missing");var a=(0,o.Qd)(t)?null!==(i=t.properties)&&void 0!==i?i:{}:(0,o.Qd)(e)?e:{},c={};return(0,o.Tn)(n)||(c=null!=n?n:{}),(0,o.Qd)(t)&&!(0,o.Tn)(e)&&(c=null!=e?e:{}),[u,a,c,s.find(o.Tn)]}function c(t,e,n,r,i){var s,u,a=null,c=null,l=[t,e,n,r,i],f=l.filter(o.Kg);void 0!==f[0]&&void 0!==f[1]&&(a=f[0],c=f[1]),1===f.length&&(a=null,c=f[0]);var p=l.find(o.Tn),h=l.filter(function(t){return null===c?(0,o.Qd)(t):(0,o.Qd)(t)||null===t}),d=null!==(s=h[0])&&void 0!==s?s:{},v=null!==(u=h[1])&&void 0!==u?u:{};return[a,c,d,v,p]}var l=function(t){return function(){for(var e,n,r,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];for(var u={},a=["callback","options","traits","id"],c=0,l=i;c<l.length;c++){var f=l[c],p=a.pop();if("id"===p){if((0,o.Kg)(f)||(0,o.Et)(f)){u.id=f.toString();continue}if(null==f)continue;p=a.pop()}if("traits"!==p&&"options"!==p||null!=f&&!(0,o.Qd)(f)||(u[p]=f),(0,o.Tn)(f)){u.callback=f;break}}return[null!==(e=u.id)&&void 0!==e?e:t.id(),null!==(n=u.traits)&&void 0!==n?n:{},null!==(r=u.options)&&void 0!==r?r:{},u.callback]}};function f(t,e,n,r){(0,o.Et)(t)&&(t=t.toString()),(0,o.Et)(e)&&(e=e.toString());var i=[t,e,n,r],s=i.filter(o.Kg),u=s[0],a=void 0===u?t:u,c=s[1],l=void 0===c?null:c,f=i.filter(o.Qd)[0];return[a,l,void 0===f?{}:f,i.find(o.Tn)]}var p=s(6789),h=s(5956),d=s(7764);function v(t,e,r,i){return(0,n.sH)(this,void 0,void 0,function(){var o,s;return(0,n.YH)(this,function(n){switch(n.label){case 0:return r.emit("dispatch_start",t),o=Date.now(),e.isEmpty()?[4,e.dispatchSingle(t)]:[3,2];case 1:return s=n.sent(),[3,4];case 2:return[4,e.dispatch(t)];case 3:s=n.sent(),n.label=4;case 4:return(null==i?void 0:i.callback)?[4,(0,d.w_)(s,i.callback,(u=o,a=i.timeout,c=Date.now()-u,Math.max((null!=a?a:300)-c,0)))]:[3,6];case 5:s=n.sent(),n.label=6;case 6:return(null==i?void 0:i.debug)&&s.flush(),[2,s]}var u,a,c})})}var y=s(6551),g=s(9659),m=s(3435),b=s(8110),w=s.n(b);var _=function(t,e,n,r,i,o){return{__t:"bpc",c:e,p:r,u:t,s:n,t:i,r:o}},S=Object.keys(_("","","","","",""));var C=function(t){var e,n,r=t.c,i=t.p,o=t.s,s=t.u,u=t.r,a=t.t,c=r?function(t){try{return new URL(t).pathname}catch(e){return"/"===t[0]?t:"/"+t}}(r):i,l=r?function(t,e){return t.indexOf("?")>-1?t:t+e}(r,o):-1===(n=(e=s).indexOf("#"))?e:e.slice(0,n);return{path:c,referrer:u,search:o,title:a,url:l}},k=function(){var t=document.querySelector("link[rel='canonical']");return _(location.href,t&&t.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},x=function(t,e){void 0===e&&(e=C(k()));var r,i,o,s=t.context;"page"===t.type&&(r=t.properties&&(i=t.properties,o=Object.keys(e),Object.assign.apply(Object,(0,n.fX)([{}],o.map(function(t){var e;if(i&&Object.prototype.hasOwnProperty.call(i,t))return(e={})[t]=i[t],e}),!1))),t.properties=(0,n.Cl)((0,n.Cl)((0,n.Cl)({},e),t.properties),t.name?{name:t.name}:{})),s.page=(0,n.Cl)((0,n.Cl)((0,n.Cl)({},e),r),s.page)},I=function(){function t(t){this.user=t}return t.prototype.track=function(t,e,r,i,o){return this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),{event:t,type:"track",properties:e,options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i)}),o)},t.prototype.page=function(t,e,r,i,o,s){var u,a={type:"page",properties:(0,n.Cl)({},r),options:(0,n.Cl)({},i),integrations:(0,n.Cl)({},o)};return null!==t&&(a.category=t,a.properties=null!==(u=a.properties)&&void 0!==u?u:{},a.properties.category=t),null!==e&&(a.name=e),this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),a),s)},t.prototype.screen=function(t,e,r,i,o,s){var u={type:"screen",properties:(0,n.Cl)({},r),options:(0,n.Cl)({},i),integrations:(0,n.Cl)({},o)};return null!==t&&(u.category=t),null!==e&&(u.name=e),this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),u),s)},t.prototype.identify=function(t,e,r,i,o){return this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),{type:"identify",userId:t,traits:e,options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i)}),o)},t.prototype.group=function(t,e,r,i,o){return this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),{type:"group",traits:e,options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i),groupId:t}),o)},t.prototype.alias=function(t,e,r,i,o){var s={userId:t,type:"alias",options:(0,n.Cl)({},r),integrations:(0,n.Cl)({},i)};return null!==e&&(s.previousId=e),void 0===t?this.normalize((0,n.Cl)((0,n.Cl)({},s),this.baseEvent())):this.normalize((0,n.Cl)((0,n.Cl)({},this.baseEvent()),s),o)},t.prototype.baseEvent=function(){var t={integrations:{},options:{}},e=this.user;return e.id()&&(t.userId=e.id()),e.anonymousId()&&(t.anonymousId=e.anonymousId()),t},t.prototype.context=function(t){var e,n,r,i=["integrations","anonymousId","timestamp","userId"],o=null!==(e=t.options)&&void 0!==e?e:{};delete o.integrations;var s=Object.keys(o),u=null!==(r=null===(n=t.options)||void 0===n?void 0:n.context)&&void 0!==r?r:{},a={};return s.forEach(function(t){"context"!==t&&(i.includes(t)?(0,m.J)(a,t,o[t]):(0,m.J)(u,t,o[t]))}),[u,a]},t.prototype.normalize=function(t,e){var r,i,o;(null===(r=t.options)||void 0===r?void 0:r.anonymousId)&&this.user.anonymousId(t.options.anonymousId);var s=Object.keys(null!==(i=t.integrations)&&void 0!==i?i:{}).reduce(function(e,r){var i,o;return(0,n.Cl)((0,n.Cl)({},e),((i={})[r]=Boolean(null===(o=t.integrations)||void 0===o?void 0:o[r]),i))},{}),u=(0,n.Cl)((0,n.Cl)({},s),null===(o=t.options)||void 0===o?void 0:o.integrations),a=this.context(t),c=a[0],l=a[1],f=(t.options,(0,n.Tt)(t,["options"])),p=(0,n.Cl)((0,n.Cl)((0,n.Cl)((0,n.Cl)({timestamp:new Date},f),{context:c,integrations:u}),l),{messageId:w().hash(JSON.stringify(t)+(0,g.v4)())});x(p,e);var h=this.user.getAndUpdateSession();return null!=h&&(p.context=(0,n.Cl)((0,n.Cl)({},p.context),h)),p},t}(),j=s(9732);var P=s(2939),O=s(9752),A=s(2620),H=function(t){function e(e){var n,r,i,o=t.call(this)||this;return o.criticalTasks=(i=0,{done:function(){return n},run:function(t){var e,o=t();return"object"==typeof(e=o)&&null!==e&&"then"in e&&"function"==typeof e.then&&(1===++i&&(n=new Promise(function(t){return r=t})),o.finally(function(){return 0===--i&&r()})),o}}),o.plugins=[],o.failedInitializations=[],o.flushing=!1,o.queue=e,o.queue.on(P.g,function(){o.scheduleFlush(0)}),o}return(0,n.C6)(e,t),e.prototype.register=function(t,e,r){return(0,n.sH)(this,void 0,void 0,function(){var i=this;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,Promise.resolve(e.load(t,r)).then(function(){i.plugins.push(e)}).catch(function(n){if("destination"===e.type)return i.failedInitializations.push(e.name),console.warn(e.name,n),void t.log("warn","Failed to load destination",{plugin:e.name,error:n});throw n})];case 1:return n.sent(),[2]}})})},e.prototype.deregister=function(t,e,r){return(0,n.sH)(this,void 0,void 0,function(){var i;return(0,n.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),e.unload?[4,Promise.resolve(e.unload(t,r))]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.plugins=this.plugins.filter(function(t){return t.name!==e.name}),[3,4];case 3:return i=n.sent(),t.log("warn","Failed to unload destination",{plugin:e.name,error:i}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e;return(0,n.YH)(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),e=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,e]})})},e.prototype.subscribeToDelivery=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e=this;return(0,n.YH)(this,function(n){return[2,new Promise(function(n){var r=function(i,o){i.isSame(t)&&(e.off("flush",r),n(i))};e.on("flush",r)})]})})},e.prototype.dispatchSingle=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e=this;return(0,n.YH)(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(n){return e.enqueuRetry(n,t)?e.subscribeToDelivery(t):(t.setFailedDelivery({reason:n}),t)})]})})},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype.scheduleFlush=function(t){var e=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout(function(){e.flush().then(function(){setTimeout(function(){e.flushing=!1,e.queue.length&&e.scheduleFlush(0)},0)})},t))},e.prototype.deliver=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e,r,i,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,this.criticalTasks.done()];case 1:n.sent(),e=Date.now(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=n.sent(),r=Date.now()-e,this.emit("delivery_success",t),t.stats.gauge("delivered",r),t.log("debug","Delivered",t.event),[2,t];case 4:throw i=n.sent(),o=i,t.log("error","Failed to deliver",o),this.emit("delivery_failure",t,o),t.stats.increment("delivery_failed"),i;case 5:return[2]}})})},e.prototype.enqueuRetry=function(t,e){return!(t instanceof O.d&&!t.retry)&&this.queue.pushWithBackoff(e)},e.prototype.flush=function(){return(0,n.sH)(this,void 0,void 0,function(){var t,e;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(0===this.queue.length)return[2,[]];if(!(t=this.queue.pop()))return[2,[]];t.attempts=this.queue.getAttempts(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=n.sent(),this.emit("flush",t,!0),[3,4];case 3:return e=n.sent(),this.enqueuRetry(e,t)||(t.setFailedDelivery({reason:e}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var e,r,i=this.plugins.filter(function(e){var n,r,i;if("destination"!==e.type&&"Hightouch.io"!==e.name)return!0;var o=void 0;return null===(n=e.alternativeNames)||void 0===n||n.forEach(function(e){void 0!==t[e]&&(o=t[e])}),null!==(i=null!==(r=t[e.name])&&void 0!==r?r:o)&&void 0!==i?i:!1!==("Hightouch.io"===e.name||t.All)}),o=(e="type",r={},i.forEach(function(t){var i,o=void 0;if("string"==typeof e){var s=t[e];o="string"!=typeof s?JSON.stringify(s):s}else e instanceof Function&&(o=e(t));void 0!==o&&(r[o]=(0,n.fX)((0,n.fX)([],null!==(i=r[o])&&void 0!==i?i:[],!0),[t],!1))}),r),s=o.before,u=void 0===s?[]:s,a=o.enrichment,c=void 0===a?[]:a,l=o.destination,f=void 0===l?[]:l,p=o.after;return{before:u,enrichment:c,destinations:f,after:void 0===p?[]:p}},e.prototype.flushOne=function(t){return(0,n.sH)(this,void 0,void 0,function(){var e,r,i,o,s,u,a,c,l,f,p,h,d,v,y,g;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),e=this.availableExtensions(null!==(y=t.event.integrations)&&void 0!==y?y:{}),r=e.before,i=e.enrichment,o=0,s=r,n.label=1;case 1:return o<s.length?(u=s[o],[4,(0,A.D)(t,u)]):[3,4];case 2:(f=n.sent())instanceof O.j&&(t=f),this.emit("message_enriched",t,u),n.label=3;case 3:return o++,[3,1];case 4:a=0,c=i,n.label=5;case 5:return a<c.length?(l=c[a],[4,(0,A.C)(t,l)]):[3,8];case 6:(f=n.sent())instanceof O.j&&(t=f),this.emit("message_enriched",t,l),n.label=7;case 7:return a++,[3,5];case 8:return p=this.availableExtensions(null!==(g=t.event.integrations)&&void 0!==g?g:{}),h=p.destinations,d=p.after,[4,new Promise(function(e,n){setTimeout(function(){var r=h.map(function(e){return(0,A.C)(t,e)});Promise.all(r).then(e).catch(n)},0)})];case 9:return n.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),v=d.map(function(e){return(0,A.C)(t,e)}),[4,Promise.all(v)];case 10:return n.sent(),[2,t]}})})},e}(y.v),M=function(t){function e(e){return t.call(this,"string"==typeof e?new j.x(4,e):e)||this}return(0,n.C6)(e,t),e.prototype.flush=function(){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){return(0,p.a)()?[2,[]]:[2,t.prototype.flush.call(this)]})})},e}(H);function E(t){for(var e=t.constructor.prototype,n=0,r=Object.getOwnPropertyNames(e);n<r.length;n++){var i=r[n];if("constructor"!==i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&"function"==typeof o.value&&(t[i]=t[i].bind(t))}}return t}var T={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"},F=function(t,e,n,r){console.warn("".concat(t.constructor.name,": Can't ").concat(e,' key "').concat(n,'" | Err: ').concat(r))},B=function(){function t(t){this.stores=t}return t.prototype.get=function(t){for(var e=null,n=0,r=this.stores;n<r.length;n++){var i=r[n];try{if(null!=(e=i.get(t)))return e}catch(e){F(i,"get",t,e)}}return null},t.prototype.set=function(t,e){this.stores.forEach(function(n){try{n.set(t,e)}catch(e){F(n,"set",t,e)}})},t.prototype.clear=function(t){this.stores.forEach(function(e){try{e.remove(t)}catch(n){F(e,"remove",t,n)}})},t.prototype.getAndSync=function(t){var e=this.get(t),n="number"==typeof e?e.toString():e;return this.set(t,n),n},t}(),D=function(){function t(){this.cache={}}return t.prototype.get=function(t){var e;return null!==(e=this.cache[t])&&void 0!==e?e:null},t.prototype.set=function(t,e){this.cache[t]=e},t.prototype.remove=function(t){delete this.cache[t]},t}();function z(t){return t&&t.stores&&Array.isArray(t.stores)&&t.stores.every(function(t){return Object.values(T).includes(t)})}function q(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var U=function t(e,n){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=q({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var s in i)i[s]&&(o+="; "+s,!0!==i[s]&&(o+="="+i[s].split(";")[0]));return document.cookie=t+"="+e.write(r,t)+o}}return Object.create({set:r,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),s=o.slice(1).join("=");try{var u=decodeURIComponent(o[0]);if(r[u]=e.read(s,u),t===u)break}catch(t){}}return t?r[t]:r}},remove:function(t,e){r(t,"",q({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,q({},this.attributes,e))},withConverter:function(e){return t(q({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Y=U;function N(t){var e=function(t){try{return new URL(t)}catch(t){return}}(t);if(e)for(var n=function(t){var e=t.hostname.split("."),n=e[e.length-1],r=[];if(4===e.length&&parseInt(n,10)>0)return r;if(e.length<=1)return r;for(var i=e.length-2;i>=0;--i)r.push(e.slice(i).join("."));return r}(e),r=0;r<n.length;++r){var i="__tld__",o=n[r],s={domain:"."+o,path:"/",sameSite:"Lax"};try{if(Y.set(i,"1",s),Y.get(i))return Y.remove(i,s),o}catch(t){return}}}var R,K,L,J,X,Q,W=function(){function t(e){void 0===e&&(e=t.defaults),this.options=(0,n.Cl)((0,n.Cl)({},t.defaults),e)}return Object.defineProperty(t,"defaults",{get:function(){return{maxage:365,domain:N(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),t.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},t.prototype.get=function(t){var e;try{var n=Y.get(t);if(null==n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(t){return null}},t.prototype.set=function(t,e){"string"==typeof e?Y.set(t,e,this.opts()):null===e?Y.remove(t,this.opts()):Y.set(t,JSON.stringify(e),this.opts())},t.prototype.remove=function(t){return Y.remove(t,this.opts())},t}(),V=function(){function t(){}return t.prototype.localStorageWarning=function(t,e){console.warn("Unable to access ".concat(t,", localStorage may be ").concat(e))},t.prototype.get=function(t){var e;try{var n=localStorage.getItem(t);if(null===n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(e){return this.localStorageWarning(t,"unavailable"),null}},t.prototype.set=function(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){this.localStorageWarning(t,"full")}},t.prototype.remove=function(t){try{return localStorage.removeItem(t)}catch(e){this.localStorageWarning(t,"unavailable")}},t}();function G(t){return t.map(function(t){var e,n;switch(!function(t){return"object"==typeof t&&void 0!==t.name}(t)?e=t:(e=t.name,n=t.settings),e){case T.Cookie:return new W(n);case T.LocalStorage:return new V;case T.Memory:return new D;default:throw new Error("Unknown Store Type: ".concat(t))}})}function $(t,e){return t.map(function(t){return e&&t===T.Cookie?{name:t,settings:e}:t})}var Z,tt=(null===(R="undefined"!=typeof globalThis?globalThis:void 0)||void 0===R?void 0:R.crypto)||(null===(K="undefined"!=typeof global?global:void 0)||void 0===K?void 0:K.crypto)||(null===(L="undefined"!=typeof window?window:void 0)||void 0===L?void 0:L.crypto)||(null===(J="undefined"!=typeof self?self:void 0)||void 0===J?void 0:J.crypto)||(null===(Q=null===(X="undefined"!=typeof frames?frames:void 0)||void 0===X?void 0:X[0])||void 0===Q?void 0:Q.crypto);Z=tt?function(t){for(var e=[],n=0;n<t;n+=4)e.push(tt.getRandomValues(new Uint32Array(1))[0]);return new nt(e,t)}:function(t){for(var e=[],n=function(t){var e=t,n=987654321,r=4294967295;return function(){var t=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return t/=4294967296,(t+=.5)*(Math.random()>.5?1:-1)}},r=0,i=void 0;r<t;r+=4){var o=n(4294967296*(i||Math.random()));i=987654071*o(),e.push(4294967296*o()|0)}return new nt(e,t)};for(var et=function(){function t(){}return t.create=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(this.bind.apply(this,(0,n.fX)([void 0],t,!1)))},t.prototype.mixIn=function(t){return Object.assign(this,t)},t.prototype.clone=function(){var t=new this.constructor;return Object.assign(t,this),t},t}(),nt=function(t){function e(e,n){void 0===e&&(e=[]),void 0===n&&(n=4*e.length);var r=t.call(this)||this,i=e;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),(i instanceof Int8Array||i instanceof Uint8ClampedArray||i instanceof Int16Array||i instanceof Uint16Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Float32Array||i instanceof Float64Array)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),i instanceof Uint8Array){for(var o=i.byteLength,s=[],u=0;u<o;u+=1)s[u>>>2]|=i[u]<<24-u%4*8;r.words=s,r.sigBytes=o}else r.words=e,r.sigBytes=n;return r}return(0,n.C6)(e,t),e.prototype.toString=function(t){return void 0===t&&(t=rt),t.stringify(this)},e.prototype.concat=function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o+=1){var s=n[o>>>2]>>>24-o%4*8&255;e[r+o>>>2]|=s<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)e[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},e.prototype.clamp=function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=Math.ceil(e/4)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e.words=this.words.slice(0),e},e.random=Z,e}(et),rt={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i+=1){var o=e[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new nt(n,e/2)}},it=function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i+=1){var o=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},ot=function(t){for(var e=t.length,n=[],r=0;r<e;r+=1)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new nt(n,e)},st={stringify:function(t){try{return decodeURIComponent(escape(it(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return ot(unescape(encodeURIComponent(t)))}},ut=function(t){function e(){var e=t.call(this)||this;return e._minBufferSize=0,e}return(0,n.C6)(e,t),e.prototype.reset=function(){this._data=new nt,this._nDataBytes=0},e.prototype._append=function(t){var e=t;"string"==typeof e&&(e=st.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},e.prototype._process=function(t){var e,n=this._data,r=this.blockSize,i=n.words,o=n.sigBytes,s=o/(4*r),u=(s=t?Math.ceil(s):Math.max((0|s)-this._minBufferSize,0))*r,a=Math.min(4*u,o);if(u){for(var c=0;c<u;c+=r)this._doProcessBlock(i,c);e=i.splice(0,u),n.sigBytes-=a}return new nt(e,a)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._data=this._data.clone(),e},e}(et),at=function(t){function e(e){var n=t.call(this)||this;return n.blockSize=16,n.cfg=Object.assign(new et,e),n.reset(),n}return(0,n.C6)(e,t),e._createHelper=function(t){return function(e,n){return new t(n).finalize(e)}},e._createHmacHelper=function(t){return function(e,n){return new ct(t,n).finalize(e)}},e.prototype.reset=function(){t.prototype.reset.call(this),this._doReset()},e.prototype.update=function(t){return this._append(t),this._process(),this},e.prototype.finalize=function(t){return t&&this._append(t),this._doFinalize()},e}(ut),ct=function(t){function e(e,n){var r=t.call(this)||this,i=new e;r._hasher=i;var o=n;"string"==typeof o&&(o=st.parse(o));var s=i.blockSize,u=4*s;o.sigBytes>u&&(o=i.finalize(n)),o.clamp();var a=o.clone();r._oKey=a;var c=o.clone();r._iKey=c;for(var l=a.words,f=c.words,p=0;p<s;p+=1)l[p]^=1549556828,f[p]^=909522486;return a.sigBytes=u,c.sigBytes=u,r.reset(),r}return(0,n.C6)(e,t),e.prototype.reset=function(){var t=this._hasher;t.reset(),t.update(this._iKey)},e.prototype.update=function(t){return this._hasher.update(t),this},e.prototype.finalize=function(t){var e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))},e}(et),lt={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,u=0;u<4&&o+.75*u<n;u+=1)i.push(r.charAt(s>>>6*(3-u)&63));var a=r.charAt(64);if(a)for(;i.length%4;)i.push(a);return i.join("")},parse:function(t){var e=t.length,n=this._map,r=this._reverseMap;if(!r){this._reverseMap=[],r=this._reverseMap;for(var i=0;i<n.length;i+=1)r[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var s=t.indexOf(o);-1!==s&&(e=s)}return function(t,e,n){for(var r=[],i=0,o=0;o<e;o+=1)if(o%4){var s=n[t.charCodeAt(o-1)]<<o%4*2|n[t.charCodeAt(o)]>>>6-o%4*2;r[i>>>2]|=s<<24-i%4*8,i+=1}return nt.create(r,i)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},ft=[],pt=0;pt<64;pt+=1)ft[pt]=4294967296*Math.abs(Math.sin(pt+1))|0;var ht=function(t,e,n,r,i,o,s){var u=t+(e&n|~e&r)+i+s;return(u<<o|u>>>32-o)+e},dt=function(t,e,n,r,i,o,s){var u=t+(e&r|n&~r)+i+s;return(u<<o|u>>>32-o)+e},vt=function(t,e,n,r,i,o,s){var u=t+(e^n^r)+i+s;return(u<<o|u>>>32-o)+e},yt=function(t,e,n,r,i,o,s){var u=t+(n^(e|~r))+i+s;return(u<<o|u>>>32-o)+e},gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype._doReset=function(){this._hash=new nt([1732584193,4023233417,2562383102,271733878])},e.prototype._doProcessBlock=function(t,e){for(var n=t,r=0;r<16;r+=1){var i=e+r,o=t[i];n[i]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var s=this._hash.words,u=n[e+0],a=n[e+1],c=n[e+2],l=n[e+3],f=n[e+4],p=n[e+5],h=n[e+6],d=n[e+7],v=n[e+8],y=n[e+9],g=n[e+10],m=n[e+11],b=n[e+12],w=n[e+13],_=n[e+14],S=n[e+15],C=s[0],k=s[1],x=s[2],I=s[3];C=ht(C,k,x,I,u,7,ft[0]),I=ht(I,C,k,x,a,12,ft[1]),x=ht(x,I,C,k,c,17,ft[2]),k=ht(k,x,I,C,l,22,ft[3]),C=ht(C,k,x,I,f,7,ft[4]),I=ht(I,C,k,x,p,12,ft[5]),x=ht(x,I,C,k,h,17,ft[6]),k=ht(k,x,I,C,d,22,ft[7]),C=ht(C,k,x,I,v,7,ft[8]),I=ht(I,C,k,x,y,12,ft[9]),x=ht(x,I,C,k,g,17,ft[10]),k=ht(k,x,I,C,m,22,ft[11]),C=ht(C,k,x,I,b,7,ft[12]),I=ht(I,C,k,x,w,12,ft[13]),x=ht(x,I,C,k,_,17,ft[14]),k=ht(k,x,I,C,S,22,ft[15]),C=dt(C,k,x,I,a,5,ft[16]),I=dt(I,C,k,x,h,9,ft[17]),x=dt(x,I,C,k,m,14,ft[18]),k=dt(k,x,I,C,u,20,ft[19]),C=dt(C,k,x,I,p,5,ft[20]),I=dt(I,C,k,x,g,9,ft[21]),x=dt(x,I,C,k,S,14,ft[22]),k=dt(k,x,I,C,f,20,ft[23]),C=dt(C,k,x,I,y,5,ft[24]),I=dt(I,C,k,x,_,9,ft[25]),x=dt(x,I,C,k,l,14,ft[26]),k=dt(k,x,I,C,v,20,ft[27]),C=dt(C,k,x,I,w,5,ft[28]),I=dt(I,C,k,x,c,9,ft[29]),x=dt(x,I,C,k,d,14,ft[30]),k=dt(k,x,I,C,b,20,ft[31]),C=vt(C,k,x,I,p,4,ft[32]),I=vt(I,C,k,x,v,11,ft[33]),x=vt(x,I,C,k,m,16,ft[34]),k=vt(k,x,I,C,_,23,ft[35]),C=vt(C,k,x,I,a,4,ft[36]),I=vt(I,C,k,x,f,11,ft[37]),x=vt(x,I,C,k,d,16,ft[38]),k=vt(k,x,I,C,g,23,ft[39]),C=vt(C,k,x,I,w,4,ft[40]),I=vt(I,C,k,x,u,11,ft[41]),x=vt(x,I,C,k,l,16,ft[42]),k=vt(k,x,I,C,h,23,ft[43]),C=vt(C,k,x,I,y,4,ft[44]),I=vt(I,C,k,x,b,11,ft[45]),x=vt(x,I,C,k,S,16,ft[46]),k=vt(k,x,I,C,c,23,ft[47]),C=yt(C,k,x,I,u,6,ft[48]),I=yt(I,C,k,x,d,10,ft[49]),x=yt(x,I,C,k,_,15,ft[50]),k=yt(k,x,I,C,p,21,ft[51]),C=yt(C,k,x,I,b,6,ft[52]),I=yt(I,C,k,x,l,10,ft[53]),x=yt(x,I,C,k,g,15,ft[54]),k=yt(k,x,I,C,a,21,ft[55]),C=yt(C,k,x,I,v,6,ft[56]),I=yt(I,C,k,x,S,10,ft[57]),x=yt(x,I,C,k,h,15,ft[58]),k=yt(k,x,I,C,w,21,ft[59]),C=yt(C,k,x,I,f,6,ft[60]),I=yt(I,C,k,x,m,10,ft[61]),x=yt(x,I,C,k,c,15,ft[62]),k=yt(k,x,I,C,y,21,ft[63]),s[0]=s[0]+C|0,s[1]=s[1]+k|0,s[2]=s[2]+x|0,s[3]=s[3]+I|0},e.prototype._doFinalize=function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32;var i=Math.floor(n/4294967296),o=n;e[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(e.length+1),this._process();for(var s=this._hash,u=s.words,a=0;a<4;a+=1){var c=u[a];u[a]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._hash=this._hash.clone(),e},e}(at),mt=(at._createHelper(gt),at._createHmacHelper(gt),function(t){function e(e){var n=t.call(this)||this;return n.cfg=Object.assign(new et,{keySize:4,hasher:gt,iterations:1},e),n}return(0,n.C6)(e,t),e.prototype.compute=function(t,e){for(var n,r=this.cfg,i=r.hasher.create(),o=nt.create(),s=o.words,u=r.keySize,a=r.iterations;s.length<u;){n&&i.update(n),n=i.update(t).finalize(e),i.reset();for(var c=1;c<a;c+=1)n=i.finalize(n),i.reset();o.concat(n)}return o.sigBytes=4*u,o},e}(et)),bt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.cfg=Object.assign(new et,r),i._xformMode=e,i._key=n,i.reset(),i}return(0,n.C6)(e,t),e.createEncryptor=function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},e.createDecryptor=function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},e._createHelper=function(t){var e=function(t){return"string"==typeof t?Pt:It};return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}},e.prototype.reset=function(){t.prototype.reset.call(this),this._doReset()},e.prototype.process=function(t){return this._append(t),this._process()},e.prototype.finalize=function(t){return t&&this._append(t),this._doFinalize()},e}(ut);bt._ENC_XFORM_MODE=1,bt._DEC_XFORM_MODE=2,bt.keySize=4,bt.ivSize=4;!function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,e)||this;return r.blockSize=1,r}(0,n.C6)(e,t),e.prototype._doFinalize=function(){return this._process(!0)}}(bt);function wt(t,e,n){var r,i=t,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var s=0;s<n;s+=1)i[e+s]^=r[s]}var _t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e}(function(t){function e(e,n){var r=t.call(this)||this;return r._cipher=e,r._iv=n,r}return(0,n.C6)(e,t),e.createEncryptor=function(t,e){return this.Encryptor.create(t,e)},e.createDecryptor=function(t,e){return this.Decryptor.create(t,e)},e}(et));_t.Encryptor=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype.processBlock=function(t,e){var n=this._cipher,r=n.blockSize;wt.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)},e}(_t),_t.Decryptor=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype.processBlock=function(t,e){var n=this._cipher,r=n.blockSize,i=t.slice(e,e+r);n.decryptBlock(t,e),wt.call(this,t,e,r),this._prevBlock=i},e}(_t);var St={pad:function(t,e){for(var n=4*e,r=n-t.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var u=nt.create(o,r);t.concat(u)},unpad:function(t){var e=t,n=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=n}},Ct=function(t){function e(e,n,r){var i=t.call(this,e,n,Object.assign({mode:_t,padding:St},r))||this;return i.blockSize=4,i}return(0,n.C6)(e,t),e.prototype.reset=function(){var e;t.prototype.reset.call(this);var n=this.cfg,r=n.iv,i=n.mode;this._xformMode===this.constructor._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode=e.call(i,this,r&&r.words),this._mode.__creator=e},e.prototype._doProcessBlock=function(t,e){this._mode.processBlock(t,e)},e.prototype._doFinalize=function(){var t,e=this.cfg.padding;return this._xformMode===this.constructor._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},e}(bt),kt=function(t){function e(e){var n=t.call(this)||this;return n.mixIn(e),n}return(0,n.C6)(e,t),e.prototype.toString=function(t){return(t||this.formatter).stringify(this)},e}(et),xt={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?nt.create([1398893684,1701076831]).concat(n).concat(e):e).toString(lt)},parse:function(t){var e,n=lt.parse(t),r=n.words;return 1398893684===r[0]&&1701076831===r[1]&&(e=nt.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),kt.create({ciphertext:n,salt:e})}},It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.encrypt=function(t,e,n,r){var i=Object.assign(new et,this.cfg,r),o=t.createEncryptor(n,i),s=o.finalize(e),u=o.cfg;return kt.create({ciphertext:s,key:n,iv:u.iv,algorithm:t,mode:u.mode,padding:u.padding,blockSize:o.blockSize,formatter:i.format})},e.decrypt=function(t,e,n,r){var i=e,o=Object.assign(new et,this.cfg,r);return i=this._parse(i,o.format),t.createDecryptor(n,o).finalize(i.ciphertext)},e._parse=function(t,e){return"string"==typeof t?e.parse(t,this):t},e}(et);It.cfg=Object.assign(new et,{format:xt});var jt={execute:function(t,e,n,r,i){var o,s=r;s||(s=nt.random(8)),o=i?mt.create({keySize:e+n,hasher:i}).compute(t,s):mt.create({keySize:e+n}).compute(t,s);var u=nt.create(o.words.slice(e),4*n);return o.sigBytes=4*e,kt.create({key:o,iv:u,salt:s})}},Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.encrypt=function(t,e,n,r){var i=Object.assign(new et,this.cfg,r),o=i.kdf.execute(n,t.keySize,t.ivSize,i.salt,i.hasher);i.iv=o.iv;var s=It.encrypt.call(this,t,e,o.key,i);return s.mixIn(o),s},e.decrypt=function(t,e,n,r){var i=e,o=Object.assign(new et,this.cfg,r);i=this._parse(i,o.format);var s=o.kdf.execute(n,t.keySize,t.ivSize,i.salt,o.hasher);return o.iv=s.iv,It.decrypt.call(this,t,i,s.key,o)},e}(It);Pt.cfg=Object.assign(It.cfg,{kdf:jt});for(var Ot=[],At=[],Ht=[],Mt=[],Et=[],Tt=[],Ft=[],Bt=[],Dt=[],zt=[],qt=[],Ut=0;Ut<256;Ut+=1)qt[Ut]=Ut<128?Ut<<1:Ut<<1^283;var Yt=0,Nt=0;for(Ut=0;Ut<256;Ut+=1){var Rt=Nt^Nt<<1^Nt<<2^Nt<<3^Nt<<4;Rt=Rt>>>8^255&Rt^99,Ot[Yt]=Rt,At[Rt]=Yt;var Kt=qt[Yt],Lt=qt[Kt],Jt=qt[Lt],Xt=257*qt[Rt]^16843008*Rt;Ht[Yt]=Xt<<24|Xt>>>8,Mt[Yt]=Xt<<16|Xt>>>16,Et[Yt]=Xt<<8|Xt>>>24,Tt[Yt]=Xt,Xt=16843009*Jt^65537*Lt^257*Kt^16843008*Yt,Ft[Rt]=Xt<<24|Xt>>>8,Bt[Rt]=Xt<<16|Xt>>>16,Dt[Rt]=Xt<<8|Xt>>>24,zt[Rt]=Xt,Yt?(Yt=Kt^qt[qt[qt[Jt^Kt]]],Nt^=qt[qt[Nt]]):Yt=Nt=1}var Qt=[0,1,2,4,8,16,32,64,128,27,54],Wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.C6)(e,t),e.prototype._doReset=function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){this._keyPriorReset=this._key;var e=this._keyPriorReset,n=e.words,r=e.sigBytes/4;this._nRounds=r+6;var i=4*(this._nRounds+1);this._keySchedule=[];for(var o=this._keySchedule,s=0;s<i;s+=1)s<r?o[s]=n[s]:(t=o[s-1],s%r?r>6&&s%r===4&&(t=Ot[t>>>24]<<24|Ot[t>>>16&255]<<16|Ot[t>>>8&255]<<8|Ot[255&t]):(t=Ot[(t=t<<8|t>>>24)>>>24]<<24|Ot[t>>>16&255]<<16|Ot[t>>>8&255]<<8|Ot[255&t],t^=Qt[s/r|0]<<24),o[s]=o[s-r]^t);this._invKeySchedule=[];for(var u=this._invKeySchedule,a=0;a<i;a+=1){s=i-a;t=a%4?o[s]:o[s-4],u[a]=a<4||s<=4?t:Ft[Ot[t>>>24]]^Bt[Ot[t>>>16&255]]^Dt[Ot[t>>>8&255]]^zt[Ot[255&t]]}}},e.prototype.encryptBlock=function(t,e){this._doCryptBlock(t,e,this._keySchedule,Ht,Mt,Et,Tt,Ot)},e.prototype.decryptBlock=function(t,e){var n=t,r=n[e+1];n[e+1]=n[e+3],n[e+3]=r,this._doCryptBlock(n,e,this._invKeySchedule,Ft,Bt,Dt,zt,At),r=n[e+1],n[e+1]=n[e+3],n[e+3]=r},e.prototype._doCryptBlock=function(t,e,n,r,i,o,s,u){for(var a=t,c=this._nRounds,l=a[e]^n[0],f=a[e+1]^n[1],p=a[e+2]^n[2],h=a[e+3]^n[3],d=4,v=1;v<c;v+=1){var y=r[l>>>24]^i[f>>>16&255]^o[p>>>8&255]^s[255&h]^n[d];d+=1;var g=r[f>>>24]^i[p>>>16&255]^o[h>>>8&255]^s[255&l]^n[d];d+=1;var m=r[p>>>24]^i[h>>>16&255]^o[l>>>8&255]^s[255&f]^n[d];d+=1;var b=r[h>>>24]^i[l>>>16&255]^o[f>>>8&255]^s[255&p]^n[d];d+=1,l=y,f=g,p=m,h=b}var w=(u[l>>>24]<<24|u[f>>>16&255]<<16|u[p>>>8&255]<<8|u[255&h])^n[d];d+=1;var _=(u[f>>>24]<<24|u[p>>>16&255]<<16|u[h>>>8&255]<<8|u[255&l])^n[d];d+=1;var S=(u[p>>>24]<<24|u[h>>>16&255]<<16|u[l>>>8&255]<<8|u[255&f])^n[d];d+=1;var C=(u[h>>>24]<<24|u[l>>>16&255]<<16|u[f>>>8&255]<<8|u[255&p])^n[d];d+=1,a[e]=w,a[e+1]=_,a[e+2]=S,a[e+3]=C},e}(Ct);Wt.keySize=8;var Vt=Ct._createHelper(Wt),Gt=function(t){return(new TextDecoder).decode(function(t){var e,n=(null!==(e=null===window||void 0===window?void 0:window.atob(t))&&void 0!==e?e:"").split("").map(function(t){return t.charCodeAt(0)});return new Uint8Array(n)}(t))};function $t(t){try{return t?JSON.parse(t):null}catch(e){return t||null}}var Zt="HtEvEncrypt:";var te="RudderEncrypt:",ee="RS_ENC_v3_";var ne=function(t){var e=Date.now(),n=t||18e5;return n<1e4&&console.warn("Session timeouts of less than 10 seconds are not recommended"),{id:e,expiresAt:e+n,timeout:n,sessionStart:!0,autoTrack:!0}},re=function(t){return{id:function(t){return!(!t||t.toString().startsWith("-")||t.toString().length<10)}(t)?t:Date.now(),sessionStart:!0,manualTrack:!0}},ie={persist:!0,cookie:{key:"htjs_user_id",oldKey:"ajs_user"},localStorage:{key:"htjs_user_traits"},sessions:{autoTrack:!0}},oe=function(){function t(t,e){void 0===t&&(t=ie);var r,i,o,s,u,a=this;this.options={},this.id=function(t){var e,n,r,i;if(a.options.disable)return null;var o=a.identityStore.getAndSync(a.idKey);if(void 0!==t){var s=null===t,u=t!==o&&null!==o&&null!==t,c=t!==o&&null===o&&null!==t;a.identityStore.set(a.idKey,t),s&&(null===(n=null===(e=a.options)||void 0===e?void 0:e.httpCookieService)||void 0===n||n.dispatchClear()),u&&a.anonymousId(null),(u||c)&&(null===(i=null===(r=a.options)||void 0===r?void 0:r.httpCookieService)||void 0===i||i.dispatchCreate())}var l=a.identityStore.getAndSync(a.idKey);if(l)return l;var f=a.legacyUserStore.get(ie.cookie.oldKey);return f?"object"==typeof f?f.id:f:null},this.anonymousId=function(t){var e,n,r,i,o,s,u,c,l,f;if(a.options.disable)return null;if(void 0===t){var p=a.identityStore.getAndSync(a.anonKey),h=!1;if(p||(p=function(t){try{if(!t||"string"!=typeof t||""===t.trim())return null;if(t.substring(0,12)===Zt)return $t(Vt.decrypt(t.substring(12),"HTEV").toString(st))}catch(t){console.error(t)}return t}(null!==(e=a.identityStore.getAndSync("htev_anonymous_id"))&&void 0!==e?e:""),h=Boolean(p),p&&a.identityStore.set(a.anonKey,p)),p||(p=a.identityStore.getAndSync("ajs_anonymous_id"),h=Boolean(p),p&&a.identityStore.set(a.anonKey,p)),p||(p=function(t){try{if(!t||"string"!=typeof t||""===t.trim())return null;if(t.substring(0,14)===te)return $t(Vt.decrypt(t.substring(14),"Rudder").toString(st));if(t.substring(0,10)===ee){var e=$t(Gt(t.substring(10)));return e&&"string"==typeof e&&""!==e.trim()?e:null}}catch(t){console.error(t)}return t}(null!==(n=a.identityStore.getAndSync("rl_anonymous_id"))&&void 0!==n?n:""),h=Boolean(p),p&&a.identityStore.set(a.anonKey,p)),p||(p=null!==(i=null===(r=a.legacySIO())||void 0===r?void 0:r[0])&&void 0!==i?i:null),h&&(null===(s=null===(o=a.options)||void 0===o?void 0:o.httpCookieService)||void 0===s||s.dispatchCreate()),p)return p}if(null===t){a.identityStore.set(a.anonKey,null);var d=a.identityStore.getAndSync(a.anonKey);return null===(c=null===(u=a.options)||void 0===u?void 0:u.httpCookieService)||void 0===c||c.dispatchClear(),d}a.identityStore.set(a.anonKey,null!=t?t:(0,g.v4)());var v=a.identityStore.getAndSync(a.anonKey);return null===(f=null===(l=a.options)||void 0===l?void 0:l.httpCookieService)||void 0===f||f.dispatchCreate(),v},this.traits=function(t){var e;if(!a.options.disable)return null===t&&(t={}),t&&a.traitsStore.set(a.traitsKey,null!=t?t:{}),null!==(e=a.traitsStore.get(a.traitsKey))&&void 0!==e?e:{}},this.options=(0,n.Cl)((0,n.Cl)({},ie),t),this.cookieOptions=e,this.idKey=null!==(i=null===(r=t.cookie)||void 0===r?void 0:r.key)&&void 0!==i?i:ie.cookie.key,this.traitsKey=null!==(s=null===(o=t.localStorage)||void 0===o?void 0:o.key)&&void 0!==s?s:ie.localStorage.key,this.anonKey="htjs_anonymous_id",this.seshKey="htjs_sesh",this.identityStore=this.createStorage(this.options,e),this.sessionStore=this.createStorage(this.options,e),this.legacyUserStore=this.createStorage(this.options,e,function(t){return t===T.Cookie}),this.traitsStore=this.createStorage(this.options,e,function(t){return t!==T.Cookie});var c=this.legacyUserStore.get(ie.cookie.oldKey);c&&"object"==typeof c&&(c.id&&this.id(c.id),c.traits&&this.traits(c.traits)),this.options.httpCookieService&&(this.identityStore.getAndSync(this.anonKey),this.identityStore.getAndSync(this.idKey),null===(u=this.options.httpCookieService)||void 0===u||u.dispatchCreate()),E(this)}return t.prototype.legacySIO=function(){var t=this.legacyUserStore.get("_sio");if(!t)return null;var e=t.split("----");return[e[0],e[1]]},t.prototype.identify=function(t,e){if(!this.options.disable){e=null!=e?e:{};var r=this.id();null!==r&&r!==t||(e=(0,n.Cl)((0,n.Cl)({},this.traits()),e)),t&&this.id(t),this.traits(e)}},t.prototype.startManualSession=function(t){if(!this.options.disable){this.sessionStore.clear(this.seshKey);var e=re(t);this.sessionStore.set(this.seshKey,e)}},t.prototype.endManualSession=function(){this.sessionStore.clear(this.seshKey)},t.prototype.getAndUpdateSessionInfo=function(){var t,e,n,r,i,o;if(this.options.disable)return null;var s,u,a=this.sessionStore.getAndSync(this.seshKey);return null==a?(null===(e=null===(t=this.options)||void 0===t?void 0:t.sessions)||void 0===e?void 0:e.autoTrack)?(a=ne(null===(r=null===(n=this.options)||void 0===n?void 0:n.sessions)||void 0===r?void 0:r.timeout),this.sessionStore.set(this.seshKey,a),a):null:(null==a?void 0:a.autoTrack)&&(s=a.expiresAt,u=Date.now(),Boolean(u>s))?(a=ne(null===(o=null===(i=this.options)||void 0===i?void 0:i.sessions)||void 0===o?void 0:o.timeout),this.sessionStore.set(this.seshKey,a),a):(a=function(t){return t.sessionStart=!1,t.autoTrack&&(t.expiresAt=Date.now()+t.timeout),t}(a),this.sessionStore.set(this.seshKey,a),a)},t.prototype.getAndUpdateSession=function(){var t=this.getAndUpdateSessionInfo(),e={};return(null==t?void 0:t.id)&&(e.sessionId=t.id),(null==t?void 0:t.sessionStart)&&(e.sessionStart=t.sessionStart),e},t.prototype.sessionId=function(){var t,e=this.sessionStore.getAndSync(this.seshKey);return null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null},t.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},t.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.sessionStore.clear(this.seshKey),this.traitsStore.clear(this.traitsKey)},t.prototype.load=function(){return new t(this.options,this.cookieOptions)},t.prototype.save=function(){return!0},t.prototype.createStorage=function(t,e,n){var r=[T.LocalStorage,T.Cookie,T.Memory];return t.disable?new B([]):t.persist?(void 0!==t.storage&&null!==t.storage&&z(t.storage)&&(r=t.storage.stores),t.localStorageFallbackDisabled&&(r=r.filter(function(t){return t!==T.LocalStorage})),n&&(r=r.filter(n)),new B(G($(r,e)))):new B([new D])},t.defaults=ie,t}(),se={persist:!0,cookie:{key:"htjs_group_id"},localStorage:{key:"htjs_group_properties"}},ue=function(t){function e(e,r){void 0===e&&(e=se);var i=t.call(this,(0,n.Cl)((0,n.Cl)({},se),e),r)||this;return i.anonymousId=function(t){},E(i),i}return(0,n.C6)(e,t),e}(oe),ae=s(6452),ce=s(5120),le=s(6091),fe=function(t,e,n){n.getCalls(t).forEach(function(t){be(e,t).catch(console.error)})},pe=function(t,e){return(0,n.sH)(void 0,void 0,void 0,function(){var r,i,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:r=0,i=e.getCalls("addSourceMiddleware"),n.label=1;case 1:return r<i.length?(o=i[r],[4,be(t,o).catch(console.error)]):[3,4];case 2:n.sent(),n.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},he=fe.bind(void 0,"on"),de=fe.bind(void 0,"setAnonymousId"),ve=function(t){if(ye(t)){var e=t.pop();return C(e)}},ye=function(t){return function(t){if(!(0,o.Qd)(t))return!1;if("bpc"!==t.__t)return!1;for(var e in t)if(!S.includes(e))return!1;return!0}(t[t.length-1])},ge=function(t,e,n,r){void 0===n&&(n=function(){}),void 0===r&&(r=console.error),this.method=t,this.resolve=n,this.reject=r,this.called=!1,this.args=e},me=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._callMap={},this.push.apply(this,t)}return Object.defineProperty(t.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(t){this._callMap=t},enumerable:!1,configurable:!0}),t.prototype.getCalls=function(t){var e;return null!==(e=this.calls[t])&&void 0!==e?e:[]},t.prototype.push=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];e.forEach(function(e){["track","screen","alias","group","page","identify"].includes(e.method)&&!ye(e.args)&&(e.args=(0,n.fX)((0,n.fX)([],e.args,!0),[k()],!1)),t.calls[e.method]?t.calls[e.method].push(e):t.calls[e.method]=[e]})},t.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},t.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this.calls))},t.prototype._pushSnippetWindowBuffer=function(){var t=(0,le.kJ)();if(Array.isArray(t)){var e=t.splice(0,t.length).map(function(t){var e=t[0],n=t.slice(1);return new ge(e,n)});this.push.apply(this,e)}},t}();function be(t,e){return(0,n.sH)(this,void 0,Promise,function(){var r,i;return(0,n.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,r=t[e.method].apply(t,e.args),"object"==typeof(o=r)&&null!==o&&"then"in o&&"function"==typeof o.then?[4,r]:[3,2]);case 1:n.sent(),n.label=2;case 2:return e.resolve(r),[3,4];case 3:return i=n.sent(),e.reject(i),[3,4];case 4:return[2]}var o})})}var we=function(){function t(t){var e=this;this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=ae.r,this._preInitBuffer=new me,this._promise=t(this._preInitBuffer),this._promise.then(function(t){var n=t[0],r=t[1];e.instance=n,e.ctx=r}).catch(function(){})}return t.prototype.then=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).then.apply(t,e)},t.prototype.catch=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).catch.apply(t,e)},t.prototype.finally=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).finally.apply(t,e)},t.prototype._createMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(e.instance){var o=(n=e.instance)[t].apply(n,r);return Promise.resolve(o)}return new Promise(function(n,i){e._preInitBuffer.push(new ge(t,r,n,i))})}},t.prototype._createChainableMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.instance?((n=e.instance)[t].apply(n,r),e):(e._preInitBuffer.push(new ge(t,r)),e)}},t}(),_e="This is being deprecated and will be not be available in future releases of Analytics JS",Se=(0,ce.m)(),Ce=null==Se?void 0:Se.analytics;function ke(){console.warn(_e)}var xe=function(t){function e(e,r,i,o,s){var u,a,c,l=t.call(this)||this;l._debug=!1,l.initialized=!1,l.user=function(){return l._user},l.init=l.initialize.bind(l),l.log=ke,l.addIntegrationMiddleware=ke,l.listeners=ke,l.addEventListener=ke,l.removeAllListeners=ke,l.removeListener=ke,l.removeEventListener=ke,l.hasListeners=ke,l.add=ke,l.addIntegration=ke;var f=null==r?void 0:r.cookie,p=null!==(u=null==r?void 0:r.disableClientPersistence)&&void 0!==u&&u;l.settings=e,l.settings.timeout=null!==(a=l.settings.timeout)&&void 0!==a?a:300,l.queue=null!=i?i:function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var r=e?4:1,i=n?new P.M(r,[]):new j.x(r,t);return new M(i)}("".concat(e.writeKey,":event-queue"),null==r?void 0:r.retryQueue,p);var h=null==r?void 0:r.storage;return l._universalStorage=l.createStore(p,h,f),l._user=null!=o?o:new oe((0,n.Cl)({persist:!p,storage:null==r?void 0:r.storage,httpCookieService:null==r?void 0:r.httpCookieService},null==r?void 0:r.user),f).load(),l._group=null!=s?s:new ue((0,n.Cl)({persist:!p,storage:null==r?void 0:r.storage},null==r?void 0:r.group),f).load(),l.eventFactory=new I(l._user),l.integrations=null!==(c=null==r?void 0:r.integrations)&&void 0!==c?c:{},l.options=null!=r?r:{},E(l),l}return(0,n.C6)(e,t),e.prototype.createStore=function(t,e,n){return t?new B([new D]):e&&z(e)?new B(G($(e.stores,n))):new B(G([T.LocalStorage,{name:T.Cookie,settings:n},T.Memory]))},Object.defineProperty(e.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),e.prototype.track=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,c,l=this;return(0,n.YH)(this,function(n){return e=ve(t),r=a.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],c=this.eventFactory.track(i,o,s,this.integrations,e),[2,this._dispatch(c,u).then(function(t){return l.emit("track",i,t.event.properties,t.event.options),t})]})})},e.prototype.page=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,l,f=this;return(0,n.YH)(this,function(n){return e=ve(t),r=c.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],a=r[4],l=this.eventFactory.page(i,o,s,u,this.integrations,e),[2,this._dispatch(l,a).then(function(t){return f.emit("page",i,o,t.event.properties,t.event.options),t})]})})},e.prototype.identify=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,c=this;return(0,n.YH)(this,function(n){return e=ve(t),r=l(this._user).apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],this._user.identify(i,o),a=this.eventFactory.identify(this._user.id(),this._user.traits(),s,this.integrations,e),[2,this._dispatch(a,u).then(function(t){return c.emit("identify",t.event.userId,t.event.traits,t.event.options),t})]})})},e.prototype.group=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=ve(e);if(0===e.length)return this._group;var i=l(this._group).apply(void 0,e),o=i[0],s=i[1],u=i[2],a=i[3];this._group.identify(o,s);var c=this._group.id(),f=this._group.traits(),p=this.eventFactory.group(c,f,u,this.integrations,r);return this._dispatch(p,a).then(function(e){return t.emit("group",e.event.groupId,e.event.traits,e.event.options),e})},e.prototype.alias=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,c=this;return(0,n.YH)(this,function(n){return e=ve(t),r=f.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],a=this.eventFactory.alias(i,o,s,this.integrations,e),[2,this._dispatch(a,u).then(function(t){return c.emit("alias",i,o,t.event.options),t})]})})},e.prototype.screen=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i,o,s,u,a,l,f=this;return(0,n.YH)(this,function(n){return e=ve(t),r=c.apply(void 0,t),i=r[0],o=r[1],s=r[2],u=r[3],a=r[4],l=this.eventFactory.screen(i,o,s,u,this.integrations,e),[2,this._dispatch(l,a).then(function(t){return f.emit("screen",i,o,t.event.properties,t.event.options),t})]})})},e.prototype.trackClick=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.link).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.trackLink=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.link).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.trackSubmit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.form).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.trackForm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r;return(0,n.YH)(this,function(i){switch(i.label){case 0:return[4,s.e(248).then(s.bind(s,4875))];case 1:return e=i.sent(),[2,(r=e.form).call.apply(r,(0,n.fX)([this],t,!1))]}})})},e.prototype.register=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i=this;return(0,n.YH)(this,function(n){switch(n.label){case 0:return e=h.o.system(),r=t.map(function(t){return i.queue.register(e,t,i)}),[4,Promise.all(r)];case 1:return n.sent(),[2,e]}})})},e.prototype.deregister=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.sH)(this,void 0,Promise,function(){var e,r,i=this;return(0,n.YH)(this,function(n){switch(n.label){case 0:return e=h.o.system(),r=t.map(function(t){var n=i.queue.plugins.find(function(e){return e.name===t});if(n)return i.queue.deregister(e,n,i);e.log("warn","plugin ".concat(t," not found"))}),[4,Promise.all(r)];case 1:return n.sent(),[2,e]}})})},e.prototype.debug=function(t){return!1===t&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=t,this},e.prototype.startSession=function(t){this._user.startManualSession(t)},e.prototype.endSession=function(){this._user.endManualSession()},e.prototype.getSessionId=function(){var t;return null!==(t=this._user.sessionId())&&void 0!==t?t:null},e.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},e.prototype.timeout=function(t){this.settings.timeout=t},e.prototype._dispatch=function(t,e){return(0,n.sH)(this,void 0,Promise,function(){var r;return(0,n.YH)(this,function(n){return r=new h.o(t),(0,p.a)()&&!this.options.retryQueue?[2,r]:[2,v(r,this.queue,this,{callback:e,debug:this._debug,timeout:this.settings.timeout})]})})},e.prototype.addSourceMiddleware=function(t){return(0,n.sH)(this,void 0,Promise,function(){var e=this;return(0,n.YH)(this,function(r){switch(r.label){case 0:return[4,this.queue.criticalTasks.run(function(){return(0,n.sH)(e,void 0,void 0,function(){var e,r,i;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,Promise.resolve().then(s.bind(s,1418))];case 1:return e=n.sent().sourceMiddlewarePlugin,r={},this.queue.plugins.forEach(function(t){if("destination"===t.type)return r[t.name]=!0}),i=e(t,r),[4,this.register(i)];case 2:return n.sent(),[2]}})})})];case 1:return r.sent(),[2,this]}})})},e.prototype.addDestinationMiddleware=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.queue.plugins.filter(function(e){return e.name.toLowerCase()===t.toLowerCase()}).forEach(function(t){t.addMiddleware.apply(t,e)}),Promise.resolve(this)},e.prototype.setAnonymousId=function(t){return this._user.anonymousId(t)},e.prototype.queryString=function(t){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){switch(e.label){case 0:return!1===this.options.useQueryString?[2,[]]:[4,s.e(538).then(s.bind(s,6346))];case 1:return[2,(0,e.sent().queryString)(this,t)]}})})},e.prototype.use=function(t){return t(this),this},e.prototype.ready=function(){return(0,n.sH)(this,arguments,Promise,function(t){return void 0===t&&(t=function(t){return t}),(0,n.YH)(this,function(e){return[2,Promise.all(this.queue.plugins.map(function(t){return t.ready?t.ready():Promise.resolve()})).then(function(e){return t(e),e})]})})},e.prototype.noConflict=function(){return console.warn(_e),(0,le.Ud)(null!=Ce?Ce:this),this},e.prototype.normalize=function(t){return console.warn(_e),this.eventFactory.normalize(t)},Object.defineProperty(e.prototype,"failedInitializations",{get:function(){return console.warn(_e),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"VERSION",{get:function(){return ae.r},enumerable:!1,configurable:!0}),e.prototype.initialize=function(t,e){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(t){return console.warn(_e),[2,Promise.resolve(this)]})})},e.prototype.pageview=function(t){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){switch(e.label){case 0:return console.warn(_e),[4,this.page({path:t})];case 1:return e.sent(),[2,this]}})})},Object.defineProperty(e.prototype,"plugins",{get:function(){var t;return console.warn(_e),null!==(t=this._plugins)&&void 0!==t?t:{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Integrations",{get:function(){return console.warn(_e),this.queue.plugins.filter(function(t){return"destination"===t.type}).reduce(function(t,e){var n="".concat(e.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),r=window[n];if(!r)return t;var i=r.Integration;return i?(t[e.name]=i,t):(t[e.name]=r,t)},{})},enumerable:!1,configurable:!0}),e.prototype.push=function(t){var e=t.shift();e&&!this[e]||this[e].apply(this,t)},e}(y.v),Ie=function(){function t(e){var n,r,i,o=t.urlHelper(e);this.renewUrl=o.renewUrl,this.clearUrl=o.clearUrl,this.backoff=null!==(n=e.backoff)&&void 0!==n?n:300,this.retries=null!==(r=e.retries)&&void 0!==r?r:3,this.flushInterval=null!==(i=e.flushInterval)&&void 0!==i?i:1e3,this.queue=[]}return t.urlHelper=function(t){var e=window.location.origin;return{renewUrl:new URL(t.renewUrl,e).href,clearUrl:new URL(t.clearUrl,e).href}},t.load=function(e){return(0,n.sH)(this,void 0,Promise,function(){var r;return(0,n.YH)(this,function(n){switch(n.label){case 0:return r=new t(e),[4,Pe(r.sendHTTPCookies(r.renewUrl),r.retries,r.backoff).catch(console.error)];case 1:return n.sent(),r.startQueueConsumer(),[2,r]}})})},t.prototype.dispatchCreate=function(){this.queue.push(this.sendHTTPCookies(this.renewUrl))},t.prototype.dispatchClear=function(){this.queue.push(this.sendHTTPCookies(this.clearUrl))},t.prototype.startQueueConsumer=function(){if(this.flushIntervalId)console.error("HTTPCookie queue consumer is already running.");else{var t=this.consumeQueue.bind(this);this.flushIntervalId=setInterval(function(){return t().catch(console.error)},this.flushInterval)}},t.prototype.stopQueueConsumer=function(){this.flushIntervalId?(clearInterval(this.flushIntervalId),this.flushIntervalId=void 0):console.error("HTTPCookie queue consumer is already stopped.")},t.prototype.sendHTTPCookies=function(t){return function(){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){switch(e.label){case 0:return[4,(0,i.h)(t,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify({sentAt:(new Date).toISOString()})})];case 1:return[2,e.sent()]}})})}},t.prototype.consumeQueue=function(){return(0,n.sH)(this,void 0,void 0,function(){return(0,n.YH)(this,function(t){switch(t.label){case 0:return this.queue.length>0?[4,Pe(this.queue.shift(),this.retries,this.backoff).catch(console.error)]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})},t}();function je(t){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(e){return[2,new Promise(function(e){return setTimeout(e,t)})]})})}function Pe(t,e,r){return(0,n.sH)(this,void 0,Promise,function(){var i;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(!(e>=0))return[3,6];n.label=1;case 1:return n.trys.push([1,3,,5]),[4,t().then(function(t){if(t.ok)return t;throw new Error("Status: ".concat(t.status," ").concat(t.statusText))})];case 2:return[2,n.sent()];case 3:if(i=n.sent(),(e-=1)<=0)throw i;return[4,je(r)];case 4:return n.sent(),[3,5];case 5:return[3,0];case 6:throw Error("HtEvents: Problem with DeferredRequest")}})})}var Oe,Ae=s(5835),He=s(9059);function Me(t){return(0,n.sH)(this,void 0,Promise,function(){var e,r,i;return(0,n.YH)(this,function(o){switch(o.label){case 0:return(e=navigator.userAgentData)?t?[3,1]:(i=e.toJSON(),[3,3]):[2,void 0];case 1:return[4,e.getHighEntropyValues(t).catch(function(){return e.toJSON()})];case 2:i=o.sent(),o.label=3;case 3:return r=i,[2,(0,n.Cl)((0,n.Cl)({},r),{brands:(s=r.brands,null==s?void 0:s.map(function(t){var e=t.Brand,r=t.Version,i=t.brand,o=t.version,s=(0,n.Tt)(t,["Brand","Version","brand","version"]);return(0,n.Cl)((0,n.Cl)({},s),{brand:null!=i?i:e,version:null!=o?o:r})}))})]}var s})})}function Ee(){if(Oe)return Oe;var t=N(window.location.href);return Oe={expires:31536e6,secure:!1,path:"/"},t&&(Oe.domain=t),Oe}var Te=function(){var t=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(e,r){return(0,n.sH)(t,void 0,void 0,function(){var t;return(0,n.YH)(this,function(e){switch(e.label){case 0:this.instance=r,e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,Me(this.instance.options.highEntropyValuesClientHints)];case 2:return t.userAgentData=e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(r){var i,o,s=r.event.context,u=s.page.search||"",a="object"==typeof u?function(t){try{var e=new URLSearchParams;return Object.entries(t).forEach(function(t){var n=t[0],r=t[1];Array.isArray(r)?r.forEach(function(t){return e.append(n,t)}):e.append(n,r)}),e.toString()}catch(t){return""}}(u):u;s.userAgent=navigator.userAgent,s.userAgentData=t.userAgentData;var c=navigator.userLanguage||navigator.language;void 0===s.locale&&void 0!==c&&(s.locale=c),null!==(i=s.library)&&void 0!==i||(s.library={name:"events-sdk-js",version:"".concat("web"===(0,e.X)()?"web":"npm","-").concat(ae.r)}),a&&!s.campaign&&(s.campaign=function(t){return t.startsWith("?")&&(t=t.substring(1)),(t=t.replace(/\?/g,"&")).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1],o=void 0===i?"":i;if(r.startsWith("utm_")&&r.length>4){var s=r.slice(4);"campaign"===s&&(s="name"),t[s]=(0,He.p)(o)}return t},{})}(a));var l=function(){var t=Y.get("_ga");if(t&&t.startsWith("amp"))return t}();l&&(s.amp={id:l}),function(t,e,r){var i,o=new B(r?[]:[new W(Ee())]),s=o.get("s:context.referrer"),u=null!==(i=function(t){var e={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1));for(var n=0,r=(t=t.replace(/\?/g,"&")).split("&");n<r.length;n++){var i=r[n].split("="),o=i[0],s=i[1];if(e[o])return{id:s,type:e[o]}}}(t))&&void 0!==i?i:s;u&&(e&&(e.referrer=(0,n.Cl)((0,n.Cl)({},e.referrer),u)),o.set("s:context.referrer",u))}(a,s,null!==(o=t.instance.options.disableClientPersistence)&&void 0!==o&&o);try{s.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){}return r},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich},Fe=new Te,Be=s(6238),De=s(1418),ze=function(){function t(t,e){this.version="1.0.0",this.alternativeNames=[],this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=e,this.name=t,this.type=e.type,this.alternativeNames.push(e.name)}return t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];"destination"===this.type&&(t=this.middleware).push.apply(t,e)},t.prototype.transform=function(t){return(0,n.sH)(this,void 0,Promise,function(){var e;return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,(0,De.applyDestinationMiddleware)(this.name,t.event,this.middleware)];case 1:return null===(e=n.sent())&&t.cancel(new O.d({retry:!1,reason:"dropped by destination middleware"})),[2,new h.o(e)]}})})},t.prototype._createMethod=function(t){var e=this;return function(r){return(0,n.sH)(e,void 0,Promise,function(){var e;return(0,n.YH)(this,function(n){switch(n.label){case 0:return this.action[t]?(e=r,"destination"!==this.type?[3,2]:[4,this.transform(r)]):[2,r];case 1:e=n.sent(),n.label=2;case 2:return[4,this.action[t](e)];case 3:return n.sent(),[2,r]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return this.action.ready?this.action.ready():Promise.resolve()},t.prototype.load=function(t,e){return this.action.load(t,e)},t.prototype.unload=function(t,e){var n,r;return null===(r=(n=this.action).unload)||void 0===r?void 0:r.call(n,t,e)},t}();function qe(e,r){return(0,n.sH)(this,void 0,Promise,function(){var i,o,s,u,a;return(0,n.YH)(this,function(n){switch(n.label){case 0:if(i=new RegExp("https://cdn.hightouch-events.(com|build)"),o=(0,t.I2)(),!r)return[3,6];s=e.url.split("/"),u=s[s.length-2],a=e.url.replace(u,btoa(u).replace(/=/g,"")),n.label=1;case 1:return n.trys.push([1,3,,5]),[4,(0,Be.k)(a.replace(i,o))];case 2:return n.sent(),[3,5];case 3:return n.sent(),[4,(0,Be.k)(e.url.replace(i,o))];case 4:return n.sent(),[3,5];case 5:return[3,8];case 6:return[4,(0,Be.k)(e.url.replace(i,o))];case 7:n.sent(),n.label=8;case 8:return"function"==typeof window[e.libraryName]?[2,window[e.libraryName]]:[2]}})})}function Ue(t,e,r,i,o,s){return(0,n.sH)(this,void 0,Promise,function(){var u,a,c,l,f,p,h=this;return(0,n.YH)(this,function(d){switch(d.label){case 0:return u=[],a=null!==(f=null===(l=t.middlewareSettings)||void 0===l?void 0:l.routingRules)&&void 0!==f?f:[],c=(null!==(p=t.remotePlugins)&&void 0!==p?p:[]).map(function(t){return(0,n.sH)(h,void 0,void 0,function(){var c,l,f,p,h,d;return(0,n.YH)(this,function(v){switch(v.label){case 0:if(function(t,e){var n=t[e.creationName],r=t[e.name];return!1===t.All&&!n&&!r||!1===n||!1===r}(e,t))return[2];v.label=1;case 1:return v.trys.push([1,6,,7]),(l=null==s?void 0:s.find(function(e){return e.pluginName===t.name}))?[3,3]:[4,qe(t,i)];case 2:l=v.sent(),v.label=3;case 3:return(c=l)?[4,c((0,n.Cl)((0,n.Cl)({},t.settings),r[t.name]))]:[3,5];case 4:f=v.sent(),function(t){if(!Array.isArray(t))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];t.forEach(function(t){e.forEach(function(e){var n;if(void 0===t[e])throw new Error("Plugin: ".concat(null!==(n=t.name)&&void 0!==n?n:"unknown"," missing required function ").concat(e))})})}(p=Array.isArray(f)?f:[f]),h=a.filter(function(e){return e.destinationName===t.creationName}),p.forEach(function(e){var n=new ze(t.creationName,e);h.length&&o&&"destination"===e.type&&n.addMiddleware(o),u.push(n)}),v.label=5;case 5:return[3,7];case 6:return d=v.sent(),console.warn("Failed to load Remote Plugin",d),[3,7];case 7:return[2]}})})}),[4,Promise.all(c)];case 1:return d.sent(),[2,u.filter(Boolean)]}})})}var Ye=s(7536);function Ne(t){return(encodeURI(JSON.stringify(t)).split(/%..|./).length-1)/1024}function Re(t,e,r){var o,s;void 0===r&&(r="https");var u,a,c,l=[],f=!1,p=null!==(o=null==e?void 0:e.size)&&void 0!==o?o:10,h=null!==(s=null==e?void 0:e.timeout)&&void 0!==s?s:5e3;function d(e){var o;if(0!==e.length){var s=null===(o=e[0])||void 0===o?void 0:o.writeKey,u=e.map(function(t){var e=t;e.sentAt;return(0,n.Tt)(e,["sentAt"])});return(0,i.h)("".concat(r,"://").concat(t,"/v1/batch"),{keepalive:f,headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify({writeKey:s,batch:u,sentAt:(new Date).toISOString()})})}}function v(){return(0,n.sH)(this,void 0,Promise,function(){var t;return(0,n.YH)(this,function(e){return l.length?(t=l,l=[],[2,d(t)]):[2]})})}return a=function(t){if((f=t)&&l.length){var e=function(t){var e=[],n=0;return t.forEach(function(t){Ne(e[n])>=64&&n++,e[n]?e[n].push(t):e[n]=[t]}),e}(l).map(d);Promise.all(e).catch(console.error)}},c=!1,window.addEventListener("pagehide",function(){c||a(c=!0)}),document.addEventListener("visibilitychange",function(){if("hidden"==document.visibilityState){if(c)return;c=!0}else c=!1;a(c)}),{dispatch:function(t,e){return(0,n.sH)(this,void 0,Promise,function(){var t;return(0,n.YH)(this,function(n){return l.push(e),t=l.length>=p||function(t){return Ne(t)>=450}(l),[2,t||f?v():void(u||(u=setTimeout(function(){u=void 0,v().catch(console.error)},h)))]})})}}}function Ke(t,e,r,i){var o,s=t.user();delete e.options,e.writeKey=null==r?void 0:r.apiKey,e.userId=e.userId||s.id(),e.anonymousId=e.anonymousId||s.anonymousId(),e.sentAt=new Date;var u=t.queue.failedInitializations||[];u.length>0&&(e._metadata={failedInitializations:u});var a=[],c=[];for(var l in i){var f=i[l];"Hightouch.io"===l&&a.push(l),"bundled"===f.bundlingStatus&&a.push(l),"unbundled"===f.bundlingStatus&&c.push(l)}for(var p=0,h=(null==r?void 0:r.unbundledIntegrations)||[];p<h.length;p++){var d=h[p];c.includes(d)||c.push(d)}var v=null!==(o=null==r?void 0:r.maybeBundledConfigIds)&&void 0!==o?o:{},y=[];return a.sort().forEach(function(t){var e;(null!==(e=v[t])&&void 0!==e?e:[]).forEach(function(t){y.push(t)})}),!1!==(null==r?void 0:r.addBundledMetadata)&&(e._metadata=(0,n.Cl)((0,n.Cl)({},e._metadata),{bundled:a.sort(),unbundled:c.sort(),bundledIds:y})),e}var Le=s(7106);function Je(t,e){return(0,n.sH)(this,void 0,Promise,function(){var r,i=this;return(0,n.YH)(this,function(o){switch(o.label){case 0:return r=[],(0,p.a)()?[2,e]:[4,(0,Le._)(function(){return e.length>0&&!(0,p.a)()},function(){return(0,n.sH)(i,void 0,void 0,function(){var i,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:return(i=e.pop())?[4,(0,A.C)(i,t)]:[2];case 1:return o=n.sent(),o instanceof h.o||r.push(i),[2]}})})})];case 1:return o.sent(),r.map(function(t){return e.pushWithBackoff(t)}),[2,e]}})})}function Xe(t,e,r,i){var o=this;t||setTimeout(function(){return(0,n.sH)(o,void 0,void 0,function(){var t,o;return(0,n.YH)(this,function(n){switch(n.label){case 0:return t=!0,[4,Je(r,e)];case 1:return o=n.sent(),t=!1,e.todo>0&&i(t,o,r,i),[2]}})})},5e3*Math.random())}var Qe=s(3858);function We(t,e,r){var o,s,u;window.addEventListener("pagehide",function(){l.push.apply(l,Array.from(f)),f.clear()});var a,c=null!==(o=null==e?void 0:e.apiKey)&&void 0!==o?o:"",l=t.options.disableClientPersistence?new P.M(t.queue.queue.maxAttempts,[]):new j.x(t.queue.queue.maxAttempts,"".concat(c,":dest-Hightouch.io")),f=new Set,h=!1,d=null!==(s=null==e?void 0:e.apiHost)&&void 0!==s?s:Qe.a,v=null!==(u=null==e?void 0:e.protocol)&&void 0!==u?u:"https",y="".concat(v,"://").concat(d),g=null==e?void 0:e.deliveryStrategy,m="batching"===(null==g?void 0:g.strategy)?Re(d,g.config,v):(a=null==g?void 0:g.config,{dispatch:function(t,e){return(0,i.h)(t,{keepalive:null==a?void 0:a.keepalive,headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify(e)})}});function b(i){return(0,n.sH)(this,void 0,Promise,function(){var o,s;return(0,n.YH)(this,function(n){return(0,p.a)()?(l.push(i),Xe(h,l,w,Xe),[2,i]):(f.add(i),o=i.event.type,s=(0,Ye.W)(i.event).json(),"track"===i.event.type&&delete s.traits,"alias"===i.event.type&&(s=function(t,e){var n,r,i,o,s=t.user();return e.previousId=null!==(i=null!==(r=null!==(n=e.previousId)&&void 0!==n?n:e.from)&&void 0!==r?r:s.id())&&void 0!==i?i:s.anonymousId(),e.userId=null!==(o=e.userId)&&void 0!==o?o:e.to,delete e.from,delete e.to,e}(t,s)),[2,m.dispatch("".concat(y,"/v1/").concat(o),Ke(t,s,e,r)).then(function(){return i}).catch(function(){return l.pushWithBackoff(i),Xe(h,l,w,Xe),i}).finally(function(){f.delete(i)})])})})}var w={name:"Hightouch.io",type:"after",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:b,identify:b,page:b,alias:b,group:b,screen:b};return l.todo&&Xe(h,l,w,Xe),w}var Ve=function(t){function e(e,n){var r=t.call(this,"".concat(e," ").concat(n))||this;return r.field=e,r}return(0,n.C6)(e,t),e}(Error),Ge="is not a string",$e="is not an object",Ze="is nil";function tn(t){var e=".userId/anonymousId/previousId/groupId",n=function(t){var e,n,r;return null!==(r=null!==(n=null!==(e=t.userId)&&void 0!==e?e:t.anonymousId)&&void 0!==n?n:t.groupId)&&void 0!==r?r:t.previousId}(t);if(!(0,o.t2)(n))throw new Ve(e,Ze);if(!(0,o.Kg)(n))throw new Ve(e,Ge)}function en(t){if(!(0,o.t2)(t))throw new Ve("Event",Ze);if("object"!=typeof t)throw new Ve("Event",$e)}function nn(t){if(!(0,o.Kg)(t.type))throw new Ve(".type",Ge)}function rn(t){if(!(0,o.Kg)(t.event))throw new Ve(".event",Ge)}function on(t){var e,n=t.event;en(n),nn(n),"track"===n.type&&rn(n);var r=null!==(e=n.properties)&&void 0!==e?e:n.traits;if("alias"!==n.type&&!(0,o.Qd)(r))throw new Ve(".properties","is not an object");return tn(n),t}var sn,un,an={name:"Event Validation",type:"before",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:on,identify:on,page:on,alias:on,group:on,screen:on},cn=null!==(sn=(un=(0,ce.m)()).__HIGHTOUCH_INSPECTOR__)&&void 0!==sn?sn:un.__HIGHTOUCH_INSPECTOR__={};function ln(t,e){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(n){switch(t){case"gtag":return[2,s.e(666).then(s.bind(s,124)).then(function(t){return t.default(e)})];case"Google Tag Manager":return[2,s.e(391).then(s.bind(s,9827)).then(function(t){return t.default(e)})];default:return[2,void 0]}return[2]})})}function fn(e,n){var r=null!=n?n:(0,t.I2)();return(0,i.h)("".concat(r,"/v1/projects/").concat(e,"/settings")).then(function(t){return t.ok?t.json():t.text().then(function(t){throw new Error(t)})}).catch(function(t){throw console.error(t.message),t})}function pn(t,e){return(0,n.sH)(this,void 0,Promise,function(){return(0,n.YH)(this,function(n){switch(n.label){case 0:return[4,pe(t,e)];case 1:return n.sent(),function(t,e){e.toArray().forEach(function(e){setTimeout(function(){be(t,e).catch(console.error)},0)})}(t,e),e.clear(),[2]}})})}function hn(t,e,i,o,u){return(0,n.sH)(this,arguments,Promise,function(t,e,i,o,u,a,c){var l,f,p,h,d,v,y,g,m,b,w,_,S,C,k,x,I,j,P=this;return void 0===a&&(a=[]),(0,n.YH)(this,function(O){switch(O.label){case 0:return l=null==a?void 0:a.filter(function(t){return"object"==typeof t}),f=null==a?void 0:a.filter(function(t){return"function"==typeof t&&"string"==typeof t.pluginName}),function(t){var e,n,i;return"test"!==r().NODE_ENV&&(null!==(i=null===(n=null===(e=t.middlewareSettings)||void 0===e?void 0:e.routingRules)||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0}(e)?[4,s.e(10).then(s.bind(s,2888)).then(function(t){return t.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return h=O.sent(),[3,3];case 2:h=void 0,O.label=3;case 3:return p=h,A=e,"test"!==r().NODE_ENV&&Object.keys(A.integrations).length>1||c.length>0?[4,s.e(50).then(s.bind(s,3771)).then(function(n){return n.ajsDestinations(t,e,i.integrations,o,p,c)})]:[3,5];case 4:return v=O.sent(),[3,6];case 5:v=[],O.label=6;case 6:return d=v,e.legacyVideoPluginsEnabled?[4,s.e(694).then(s.bind(s,8162)).then(function(t){return t.loadLegacyVideoPlugins(i)})]:[3,8];case 7:O.sent(),O.label=8;case 8:return(null===(k=o.plan)||void 0===k?void 0:k.track)?[4,s.e(104).then(s.bind(s,3542)).then(function(t){var n;return t.schemaFilter(null===(n=o.plan)||void 0===n?void 0:n.track,e)})]:[3,10];case 9:return g=O.sent(),[3,11];case 10:g=void 0,O.label=11;case 11:return y=g,m=(0,Ae.J)(e,u),[4,Ue(e,i.integrations,m,u.obfuscate,p,f).catch(function(){return[]})];case 12:return b=O.sent(),w=(0,n.fX)((0,n.fX)((0,n.fX)([an,Fe],l,!0),d,!0),b,!0),y&&w.push(y),!1===(null===(x=o.integrations)||void 0===x?void 0:x.All)&&!o.integrations["Hightouch.io"]||o.integrations&&!1===o.integrations["Hightouch.io"]?[3,14]:(S=(_=w).push,[4,We(i,m["Hightouch.io"],e.integrations)]);case 13:S.apply(_,[O.sent()]),O.label=14;case 14:return[4,Promise.allSettled(Object.entries(null!==(I=u.destinations)&&void 0!==I?I:{}).map(function(t){return(0,n.sH)(P,[t],void 0,function(t){var e,r=t[0],i=t[1];return(0,n.YH)(this,function(t){switch(t.label){case 0:return[4,ln(r,i)];case 1:return(e=t.sent())?w.push(e):console.warn("failed to load destination plugin: ".concat(r)),[2]}})})}))];case 15:return O.sent(),[4,i.register.apply(i,w)];case 16:return C=O.sent(),Object.entries(null!==(j=e.enabledMiddleware)&&void 0!==j?j:{}).some(function(t){return t[1]})?[4,s.e(521).then(s.bind(s,9231)).then(function(t){return(0,n.sH)(P,[t],void 0,function(t){var r,o,s=t.remoteMiddlewares;return(0,n.YH)(this,function(t){switch(t.label){case 0:return[4,s(C,e,u.obfuscate)];case 1:return r=t.sent(),o=r.map(function(t){return i.addSourceMiddleware(t)}),[2,Promise.all(o)]}})})})]:[3,18];case 17:O.sent(),O.label=18;case 18:return[2,C]}var A})})}var dn={apiKey:"WRITE_KEY",apiHost:"us-east-1.hightouch-events.com",protocol:"https",unbundledIntegrations:[],addBundledMetadata:!1,maybeBundledConfigIds:{},deliveryStrategy:{strategy:"standard"}},vn={integrations:{},plan:{track:{__default:{enabled:!0,integrations:{}}},identify:{__default:{enabled:!0}},group:{__default:{enabled:!0}}},enabledMiddleware:{},metrics:{sampleRate:0},legacyVideoPluginsEnabled:!1,remotePlugins:[]};function yn(e){return(0,n.sH)(this,arguments,Promise,function(e,r,i){var o,s,u,a,c,l,f,p,h,d,v,y,g,m,b,w,_;return void 0===r&&(r={}),(0,n.YH)(this,function(S){switch(S.label){case 0:return r.globalAnalyticsKey&&(0,le.rY)(r.globalAnalyticsKey),e.cdnURL&&(0,t.qQ)(e.cdnURL),e.cdnSettings?o=e.cdnSettings:(vn.integrations["Hightouch.io"]=(0,n.Cl)((0,n.Cl)((0,n.Cl)((0,n.Cl)((0,n.Cl)({},dn),e.writeKey?{apiKey:e.writeKey}:{}),r.apiHost?{apiHost:r.apiHost}:{}),r.protocol?{protocol:r.protocol}:{}),1==r.batching?{deliveryStrategy:{strategy:"batching",config:{timeout:1e3,size:10}}}:{}),o=vn),r.updateCDNSettings&&(o=r.updateCDNSettings(o)),s=null===(g=null===(y=o.integrations["Hightouch.io"])||void 0===y?void 0:y.retryQueue)||void 0===g||g,r.disableClientPersistence||!r.httpCookieServiceOptions?[3,2]:(u=r,[4,Ie.load(r.httpCookieServiceOptions).catch(function(t){return console.error(t)})]);case 1:u.httpCookieService=S.sent(),S.label=2;case 2:return a=(0,n.Cl)({retryQueue:s},r),function(t){var e;null===(e=cn.attach)||void 0===e||e.call(cn,t)}(c=new xe(e,a)),l=null!==(m=e.plugins)&&void 0!==m?m:[],f=null!==(b=e.classicIntegrations)&&void 0!==b?b:[],function(t,e){de(t,e),he(t,e)}(c,i),[4,hn(e.writeKey,o,c,a,r,l,f)];case 3:return p=S.sent(),h=null!==(w=window.location.search)&&void 0!==w?w:"",d=null!==(_=window.location.hash)&&void 0!==_?_:"",(v=h.length?h:d.replace(/(?=#).*(?=\?)/,"")).includes("ajs_")?[4,c.queryString(v).catch(console.error)]:[3,5];case 4:S.sent(),S.label=5;case 5:return c.initialized=!0,c.emit("initialize",e,r),r.initialPageview&&c.page().catch(console.error),[4,pn(c,i)];case 6:return S.sent(),[2,[c,p]]}})})}var gn=function(t){function e(){var e,n,r,i=this,o=(r=new Promise(function(t,r){e=t,n=r}),{resolve:e,reject:n,promise:r}),s=o.promise,u=o.resolve;return i=t.call(this,function(t){return s.then(function(e){return yn(e[0],e[1],t)})})||this,i._resolveLoadStart=function(t,e){return u([t,e])},i}return(0,n.C6)(e,t),e.prototype.load=function(t,e){return void 0===e&&(e={}),this._resolveLoadStart(t,e),this},e.load=function(t,n){return void 0===n&&(n={}),(new e).load(t,n)},e.standalone=function(t,n){return e.load({writeKey:t},n).then(function(t){return t[0]})},e}(we),mn=(0,t.I2)();(0,t.qQ)(mn),s.p=mn+"/".concat("browser/candidate","/").concat("1.5.7","/"),(0,e.J)("web")}(),u}()});
2
2
  //# sourceMappingURL=index.js.map