(()=>{var e,t,n={202:(e,t,n)=>{var r=n(957),o=n(642),i=RegExp.prototype;e.exports=function(e){return e===i||r(i,e)?o(e):e.flags}},642:(e,t,n)=>{n(494);var r=n(348);e.exports=r},926:(e,t,n)=>{var r=n(87),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not an object")}},614:e=>{var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},913:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},535:(e,t,n)=>{var r=n(913);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},635:(e,t,n)=>{var r=n(535),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},628:(e,t,n)=>{var r=n(535),o=Function.prototype,i=o.call,s=r&&o.bind.bind(i,i);e.exports=r?s:function(e){return function(){return i.apply(e,arguments)}}},522:(e,t,n)=>{var r=n(628),o=n(939),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},267:(e,t,n)=>{var r=n(614),o=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===o}:function(e){return"function"==typeof e}},332:e=>{e.exports=function(e){return null==e}},87:(e,t,n)=>{var r=n(267),o=n(614),i=o.all;e.exports=o.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===i}:function(e){return"object"==typeof e?null!==e:r(e)}},957:(e,t,n)=>{var r=n(628);e.exports=r({}.isPrototypeOf)},5:(e,t,n)=>{"use strict";var r=n(926);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},348:(e,t,n)=>{var r=n(635),o=n(522),i=n(957),s=n(5),a=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||o(e,"flags")||!i(a,e)?t:r(s,e)}},683:(e,t,n)=>{var r=n(332),o=TypeError;e.exports=function(e){if(r(e))throw o("Can't call method on "+e);return e}},939:(e,t,n)=>{var r=n(683),o=Object;e.exports=function(e){return o(r(e))}},494:()=>{},554:(e,t,n)=>{var r=n(202);e.exports=r},352:(e,t,n)=>{e.exports=n(554)}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.m=n,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>"build/1a0d4d475384b2ba72d3-"+e+".js",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@boltpay/track:",o.l=(n,r,i,s)=>{if(e[n])e[n].push(r);else{var a,c;if(void 0!==i)for(var u=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="https://connect.bolt.com/4880484/",(()=>{var e={737:0};o.f.j=(t,n)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=i);var s=o.p+o.u(t),a=new Error;o.l(s,(n=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",a.name="ChunkLoadError",a.type=i,a.request=s,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[s,a,c]=n,u=0;if(s.some((t=>0!==e[t]))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);c&&c(o)}for(t&&t(n);u{"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((function(e){n[e]=t[e]}));var r="Datadog Browser SDK:",i={debug:n.debug.bind(t,r),log:n.log.bind(t,r),info:n.info.bind(t,r),warn:n.warn.bind(t,r),error:n.error.bind(t,r)};function s(e,t){return function(){for(var n=[],r=0;r"}finally{r(),o(),i(),s()}}function L(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):D}function A(e,t){return Object.keys(e).some((function(n){return e[n]===t}))}function R(e){return 0===Object.keys(e).length}function P(e){var t=0,n=I((function(n){t=E(O(n)),e()}),200),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(e){R(e)?i():r(e)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}var M=o(352),N=o.n(M);function B(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function U(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=N()(t)||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;it)){for(;i.length>0&&ct){H(t,"truncated",e);break}u.target[f]=d}else for(var f in u.source)if(Object.prototype.hasOwnProperty.call(u.source,f)){var d;if(void 0!==(d=q(u.source[f],u.path,f,i,s))&&(c+=JSON.stringify(d).length+l+f.length+3,l=1),c>t){H(t,"truncated",e);break}u.target[f]=d}}return r(),o(),a}H(t,"discarded",e)}function q(e,t,n,r,o){var i,s=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!s||"object"!=typeof s)return"bigint"==typeof(i=s)?"[BigInt] ".concat(i.toString()):"function"==typeof i?"[Function] ".concat(i.name||"unknown"):"symbol"==typeof i?"[Symbol] ".concat(i.description||i.toString()):i;var a=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"[".concat(t[1],"]")}catch(e){}return"[Unserializable]"}(s);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;var c=e;if(o.has(c))return"[Reference seen at ".concat(o.get(c),"]");var u=void 0!==n?"".concat(t,".").concat(n):t,l=Array.isArray(s)?[]:{};return o.set(c,u),r.push({source:s,target:l,path:u}),l}function H(e,t,n){i.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var G=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function $(){for(var e=[],t=0;t eval")>-1,r=le.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||te,line:t[4]?+t[4]:void 0,url:t[3]}}}(e);n&&(!n.func&&n.line&&(n.func=te),t.push(n))})),{message:fe(e,"message"),name:fe(e,"name"),stack:t}}var re="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet||\\w+\\.|\\/).*?)",oe="(?::(\\d+))",ie=new RegExp("^\\s*at (.*?) ?\\(".concat(re).concat(oe,"?").concat(oe,"?\\)?\\s*$"),"i"),se=new RegExp("\\((\\S*)".concat(oe).concat(oe,"\\)")),ae=new RegExp("^\\s*at ?".concat(re).concat(oe,"?").concat(oe,"??\\s*$"),"i"),ce=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ue=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,le=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function fe(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}var de=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/,pe="No stack, consider using an instance of Error";function he(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,s=e.source,a=e.handling,c=n instanceof Error,u=function(e,t,n,r){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":"".concat(n," ").concat(O(F(r)))}(t,c,i,n),l=function(e,t){return void 0!==t&&(!!e||t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url))}(c,t)?ge(t):pe,f=c?be(n,s):void 0;return{startClocks:o,source:s,handling:a,handlingStack:r,originalError:n,type:null==t?void 0:t.name,message:u,stack:l,causes:f,fingerprint:ve(n)}}function ve(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function ge(e){var t=me(e);return e.stack.forEach((function(e){var n="?"===e.func?"":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function me(e){return"".concat(e.name||"Error",": ").concat(e.message)}function ye(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return p((function(){var n=ne(t);n.stack=n.stack.slice(2),e=ge(n)})),e}function be(e,t){for(var n=e,r=[];(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=ne(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&ge(o)}),n=n.cause}return r.length?r:void 0}var we,_e="agent",Ee="console",Ce="logger",Se="source",ke="report";function Te(){return(new Date).getTime()}function xe(){return Te()}function Ie(){return performance.now()}function De(){return{relative:Ie(),timeStamp:xe()}}function Oe(){return void 0===we&&(we=performance.timing.navigationStart),we}var Le={debug:"debug",error:"error",info:"info",warn:"warn"},Ae="http",Re=Object.keys(Le),Pe=function(){function e(e,t,n,r,o,i){void 0===r&&(r=Ae),void 0===o&&(o=Le.debug),void 0===i&&(i={}),this.handleLogStrategy=e,this.handlerType=r,this.level=o,this.contextManager=V(t),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.log=function(e,t,n,r){var o;if(void 0===n&&(n=Le.info),null!=r){var i=he({stackTrace:r instanceof Error?ne(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Ce,handling:"handled",startClocks:De()});o={stack:i.stack,kind:i.type,message:i.message,causes:i.causes}}var s=F(t),a=o?j({error:o},s):s;this.handleLogStrategy({message:F(e),context:a,status:n},this)},e.prototype.debug=function(e,t,n){this.log(e,t,Le.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,Le.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,Le.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,Le.error,n)},e.prototype.setContext=function(e){this.contextManager.setContext(e)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(e,t){this.contextManager.setContextProperty(e,t)},e.prototype.removeContextProperty=function(e){this.contextManager.removeContextProperty(e)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);i>3&&s&&Object.defineProperty(t,n,s)}([f],e.prototype,"log",null),e}();function Me(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var Ne,Be=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.remove=function(e){Me(this.buffer,e)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return t(e)})),this.buffer.length=0},e}();function Ue(){var e=w().DatadogEventBridge;if(e)return{getCapabilities:function(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel:function(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n,r){var o=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:o}))}}}function Ke(e){var t;void 0===e&&(e=null===(t=w().location)||void 0===t?void 0:t.hostname);var n=Ue();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}!function(e){e.PAGEHIDE="pagehide",e.FEATURE_FLAGS="feature_flags",e.RESOURCE_PAGE_STATES="resource_page_states",e.COLLECT_FLUSH_REASON="collect_flush_reason",e.ZERO_LCP_TELEMETRY="zero_lcp_telemetry",e.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css",e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.CUSTOM_VITALS="custom_vitals"}(Ne||(Ne={}));var je=new Set;function Fe(e){return je.has(e)}function qe(e){return 0!==e&&100*Math.random()<=e}function He(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function Ge(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,Ge)}var $e=/([\w-]+)\s*=\s*([^;]+)/g;function Ve(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}var ze,Je,We,Ye=9e5;function Ze(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),s=r&&r.crossSite?"none":"strict",a=r&&r.domain?";domain=".concat(r.domain):"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(s).concat(a).concat(c).concat(u)}function Xe(e){return function(e,t){for($e.lastIndex=0;;){var n=$e.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function Qe(e){return Je||(Je=function(e){var t=new Map;for($e.lastIndex=0;;){var n=$e.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),Je.get(e)}function et(e,t){Ze(e,"",0,t)}var tt="_dd_s",nt=/^([a-z]+)=([a-z0-9-]+)$/;function rt(e){return R(e)}function ot(e){e.expire=String(Te()+Ye)}function it(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join("&");var t}function st(e){var t={};return function(e){return!!e&&(-1!==e.indexOf("&")||nt.test(e))}(e)&&e.split("&").forEach((function(e){var n=nt.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}function at(){return st(Xe(tt))}function ct(e){return function(){et(tt,e)}}function ut(e){localStorage.setItem(tt,it(e))}function lt(){return st(localStorage.getItem(tt))}function ft(){localStorage.removeItem(tt)}var dt,pt=[];function ht(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.retrieveSession,s=t.persistSession,a=t.clearSession;if(dt||(dt=e),e===dt)if(o&&n>=100)gt(t);else{var c,u=i();if(o){if(u.lock)return void vt(e,t,n);if(c=Ge(),u.lock=c,s(u),(u=i()).lock!==c)return void vt(e,t,n)}var l=e.process(u);if(o&&(u=i()).lock!==c)vt(e,t,n);else{if(l&&(rt(l)?a():(ot(l),s(l))),o&&(!l||!rt(l))){if((u=i()).lock!==c)return void vt(e,t,n);delete u.lock,s(u),l=u}null===(r=e.after)||void 0===r||r.call(e,l||u),gt(t)}}else pt.push(e)}function vt(e,t,n){S((function(){ht(e,t,n+1)}),10)}function gt(e){dt=void 0;var t=pt.shift();t&&ht(t,e)}function mt(e){var t=function(e){var t=function(e){var t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===We){for(var e="dd_site_test_".concat(Ge()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Xe(e);)Ze(e,"test",1e3,{domain:n="".concat(t.pop(),".").concat(n)});et(e,{domain:n}),We=n}return We}()),t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(Ge()),n="test";Ze(t,n,6e4,e);var r=Xe(t)===n;return et(t,e),r}catch(e){return i.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=Ge(),t="".concat("_dd_test_").concat(e);localStorage.setItem(t,e);var n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:"LocalStorage"}:void 0}catch(e){return}}()),t}function yt(e,t,n){var r,o,i,s,a=new G,c=new G,u="Cookie"===e.type?(o=e.cookieOptions,s={isLockEnabled:1===(null!=ze?ze:ze=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?1:0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n)?2:e.document.documentMode?0:3}()),persistSession:(i=o,function(e){Ze(tt,it(e),Ye,i)}),retrieveSession:at,clearSession:ct(o)},function(e){if(!Qe(tt)){var t=Qe("_dd"),n=Qe("_dd_r"),r=Qe("_dd_l"),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o.logs=r),n&&/^[012]$/.test(n)&&(o.rum=n),rt(o)||(ot(o),e.persistSession(o))}}(s),s):{isLockEnabled:!1,persistSession:ut,retrieveSession:lt,clearSession:ft},l=u.clearSession,f=u.retrieveSession,d=T((function(){ht({process:function(e){return b(e)?void 0:{}},after:m},u)}),1e3),p=b(r=f())?r:{},h=I((function(){var e;ht({process:function(r){var o=m(r);return e=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;return e[t]=o,i&&!e.id&&(e.id=Ge(),e.created=String(Te())),i}(o),o},after:function(t){e&&!y()&&function(e){p=e,a.notify()}(t),p=t}},u)}),1e3),v=h.throttled,g=h.cancel;function m(e){return b(e)||(e={}),y()&&(function(e){return p.id!==e.id||p[t]!==e[t]}(e)?(p={},c.notify()):p=e),e}function y(){return void 0!==p[t]}function b(e){return(void 0===e.created||Te()-Number(e.created)<144e5)&&(void 0===e.expire||Te()n||St.test(t))&&i.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function Tt(e){var t,n,r,o;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||He(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||He(e.telemetrySampleRate))if(void 0===e.telemetryConfigurationSampleRate||He(e.telemetryConfigurationSampleRate)){if(void 0===e.trackingConsent||A(J,e.trackingConsent))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return A(Ne,e)})).forEach((function(e){je.add(e)})),b({beforeSend:e.beforeSend&&s(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:mt(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(o=e.trackingConsent)&&void 0!==o?o:J.GRANTED,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144},function(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(kt("env",t)),n&&i.push(kt("service",n)),r&&i.push(kt("version",r)),o&&i.push(kt("datacenter",o)),i}(e),n=function(e,t){return{logsEndpointBuilder:Ct(e,"logs",t),rumEndpointBuilder:Ct(e,"rum",t),sessionReplayEndpointBuilder:Ct(e,"replay",t)}}(e,t),r=m(n).map((function(e){return e.urlPrefix})),o=function(e,t,n){if(e.replica){var r=b({},e,{site:Et,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:Ct(r,"logs",n),rumEndpointBuilder:Ct(r,"rum",n)};return t.push.apply(t,m(o).map((function(e){return e.urlPrefix}))),b({applicationId:e.replica.applicationId},o)}}(e,r,t);return b({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||Et},n)}(e));i.error('Tracking Consent should be either "granted" or "not-granted"')}else i.error("Telemetry Configuration Sample Rate should be a number between 0 and 100");else i.error("Telemetry Sample Rate should be a number between 0 and 100");else i.error("Session Sample Rate should be a number between 0 and 100");else i.error("Client Token is not configured, we will not send any data.")}var xt={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function It(e,t,n,r,o){return n?ge({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}function Dt(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return v(t,e)}))?"all"===e?t:(r=e,o=new Set,r.forEach((function(e){return o.add(e)})),g(o)):void i.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,o}var Ot="logs";function Lt(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var At={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Rt(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Qe("datadog-synthetics-injects-rum"))}function Pt(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Qe("datadog-synthetics-result-id");return"string"==typeof e?e:void 0}var Mt=1/0,Nt=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=T((function(){return n.clearOldValues()}),6e4)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:Mt,remove:function(){Me(n.entries,r)},close:function(e){r.endTime=e}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=Mt);for(var t=0,n=this.entries;t0&&this.entries[this.entries.length-1].endTime"],Ht=["ddog-gov.com"],Gt={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function $t(t,n){h(e.debug,t,n),zt(b({type:"log",message:t,status:"debug"},n))}function Vt(e,t){zt(b({type:"log",status:"error"},function(e){if(e instanceof Error){var t=ne(e);return{error:{kind:t.name,stack:ge(Jt(t))},message:t.message}}return{error:{stack:pe},message:"".concat("Uncaught"," ").concat(O(e))}}(e),t))}function zt(e){Ft&&Gt.sentEventCount=500}function dn(e,t){if(!e.forwardErrorsToLogs)return{stop:D};var n=function(e){return nn||(nn=function(e){return new G((function(t){var n=sn(XMLHttpRequest.prototype,"open",un).stop,r=sn(XMLHttpRequest.prototype,"send",(function(n){!function(e,t,n){var r=e.target,o=cn.get(r);if(o){var i=o;i.state="start",i.startClocks=De(),i.isAborted=!1,i.xhr=r;var s=!1,a=sn(r,"onreadystatechange",(function(){r.readyState===XMLHttpRequest.DONE&&c()})).stop,c=function(){if(u(),a(),!s){s=!0;var e,t=o;t.state="complete",t.duration=(e=i.startClocks.timeStamp,xe()-e),t.status=r.status,n.notify(b({},t))}},u=W(t,r,"loadend",c).stop;n.notify(i)}}(n,e,t)})).stop,o=sn(XMLHttpRequest.prototype,"abort",ln).stop;return function(){n(),r(),o()}}))}(e)),nn}(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=(an||(an=new G((function(e){if(window.fetch){var t=sn(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=n[0],i=n[1],s=i&&i.method;void 0===s&&o instanceof Request&&(s=o.method);var a=void 0!==s?String(s).toUpperCase():"GET",c=o instanceof Request?o.url:bt(String(o)),u={state:"start",init:i,input:o,method:a,startClocks:De(),url:c};t.notify(u),n[0]=u.input,n[1]=u.init,r((function(e){return function(e,t,n){var r=function(t){var r=n;r.state="resolve","stack"in t||t instanceof Error?(r.status=0,r.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t):"status"in t&&(r.response=t,r.responseType=t.type,r.status=t.status,r.isAborted=!1),e.notify(r)};t.then(d(r),d(r))}(t,e,u)}))}(t,e)})).stop;return t}}))),an).subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(hn(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:Le.error,origin:"network"}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!fn(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(pn(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function s(){var e,s;if(r.cancel().catch(D),n.collectStreamBody){var a;if(1===o.length)a=o[0];else{a=new Uint8Array(i);var c=0;o.forEach((function(e){a.set(e,c),c+=e.length}))}e=a.slice(0,n.bytesLimit),s=a.length>n.bytesLimit}t(void 0,e,s)}!function e(){r.read().then(d((function(t){t.done?s():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?s():e())})),d((function(e){return t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):r.text().then(d((function(e){return n(pn(e,t))})),d((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(pn(ge(ne(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function pn(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function hn(e){return"xhr"===e?"XHR":"Fetch"}function vn(e){var t,n=function(t,n){var r=he({stackTrace:t,originalError:n,startClocks:De(),nonErrorPrefix:"Uncaught",source:Se,handling:"unhandled"});e.notify(r)},r=(t=n,sn(window,"onerror",(function(e){var n,r=e.parameters,o=r[0],i=r[1],s=r[2],a=r[3],c=r[4];n=c instanceof Error?ne(c):function(e,t,n,r){var o=[{url:t,column:r,line:n}],i=function(e){var t,n,r;return"[object String]"==={}.toString.call(e)&&(n=(t=de.exec(e))[1],r=t[2]),{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}(o,i,s,a),t(n,null!=c?c:o)}))).stop,o=function(e){return sn(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=ne(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var gn,mn=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}(),yn=((gn={})[Le.debug]=0,gn[Le.info]=1,gn[Le.warn]=2,gn[Le.error]=3,gn);function bn(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return yn[e]>=yn[n.getLevel()]&&v(o,t)}var wn=function(){function e(e,t,n,r){var o=this;this.encoder=e,this.request=t,this.flushController=n,this.messageBytesLimit=r,this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe((function(e){return o.flush(e)}))}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.stop=function(){this.flushSubscription.unsubscribe()},e.prototype.flush=function(e){var t=m(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,v(m(At),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(_n(i,e));var s=[i.pendingData,t].filter(Boolean).join("\n");s&&o({data:s,bytesCount:E(s),flushReason:e.reason})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(t){o(_n(t,e))}))},e.prototype.addOrUpdate=function(e,t){var n=O(e),r=this.encoder.estimateEncodedBytesCount(n);r>=this.messageBytesLimit?i.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(t)&&this.remove(t),this.push(n,r,t))},e.prototype.push=function(e,t,n){var r=this;this.flushController.notifyBeforeAddMessage(t),void 0!==n?(this.upsertBuffer[n]=e,this.flushController.notifyAfterAddMessage()):this.encoder.write(this.encoder.isEmpty?e:"\n".concat(e),(function(e){r.flushController.notifyAfterAddMessage(e-t)}))},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.encoder.estimateEncodedBytesCount(t);this.flushController.notifyAfterRemoveMessage(n)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e}();function _n(e,t){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding,flushReason:t.reason}}function En(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Sn(e,t,n,{onSuccess:function(){return kn(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Cn(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Cn(e,t,n,r){2===e.transportStatus&&S((function(){Sn(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=1e3,kn(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(6e4,2*e.currentBackoffTime),Cn(e,t,n,r)}})}),e.currentBackoffTime)}function Sn(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||fn(e.status))}(n)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},i()):(t.transportStatus=0,o())}))}function kn(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(3,"MiB"),source:_e,startClocks:De()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=Tn();i.size()>0;)En(i.dequeue(),t,n,r,o)}function Tn(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=3145728}}}var xn=!1;function In(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),W(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function Dn(e,t,n,r,o,i){var s=c(e,t),a=n&&c(e,n);function c(e,t){var n=t.endpoint,s=t.encoder;return new wn(s,function(e,t,n,r){var o={transportStatus:0,currentBackoffTime:1e3,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=81920&&this.ongoingRequestCount<32},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Tn(),queueFullReported:!1},i=function(r,o){return function(e,t,n,r,o){if(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&r.bytesCount=r&&d("bytes_limit"),f+=1,l+=e,void 0===t&&(t=S((function(){d("duration_limit")}),o))},notifyAfterAddMessage:function(e){void 0===e&&(e=0),l+=e,f>=n?d("messages_limit"):l>=r&&d("bytes_limit")},notifyAfterRemoveMessage:function(e){l-=e,0==(f-=1)&&p()}}}({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),e.messageBytesLimit)}return{flushObservable:s.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),s.add(e),a&&t&&a.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){s.upsert(e,t),a&&a.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){s.stop(),null==a||a.stop()}}}function On(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=E(n);t+=o,e+=n,r&&r(o)},finish:function(e){e(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(e){return e.length}}}function Ln(e,t,n,r,o){var i=function(e,t){var n,r=new G;Gt.telemetryEnabled=!v(Ht,t.site)&&qe(t.telemetrySampleRate),Gt.telemetryConfigurationEnabled=Gt.telemetryEnabled&&qe(t.telemetryConfigurationSampleRate);var o={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Ft=function(t){if(Gt.telemetryEnabled){var i=function(e,t,r){return j({type:"telemetry",date:xe(),service:e,version:"5.12.0",source:"browser",_dd:{format_version:2},telemetry:j(t,{runtime_env:r,connectivity:jt()}),experimental_features:g(je)},void 0!==n?n():{})}(e,t,o);r.notify(i),Lt("telemetry",i)}},a=Vt,b(Gt,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:r,enabled:Gt.telemetryEnabled}}("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,s;return{application:{id:null===(e=Yt())||void 0===e?void 0:e.application_id},session:{id:null===(t=o.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=Yt())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(s=null===(i=Yt())||void 0===i?void 0:i.user_action)||void 0===s?void 0:s.id}}}));var s=[];if(Ke()){var c=Ue(),u=i.observable.subscribe((function(e){return c.send("internal_telemetry",e)}));s.push((function(){return u.unsubscribe()}))}else{var l=Dn(t,{endpoint:t.rumEndpointBuilder,encoder:On()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:On()},n,r,o.expireObservable);s.push((function(){return l.stop()}));var f=i.observable.subscribe((function(e){return l.add(e,function(e){return"datad0g.com"===e.site}(t))}));s.push((function(){return f.unsubscribe()}))}return function(e){Gt.telemetryConfigurationEnabled&&zt({type:"configuration",configuration:e})}(function(e){var t,n={session_sample_rate:(t=e).sessionSampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:t.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:!!t.proxy,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages,allow_untrusted_events:!!t.allowUntrustedEvents,tracking_consent:t.trackingConsent};return b({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake},n)}(e)),{telemetry:i,stop:function(){s.forEach((function(e){return e()}))}}}var An,Rn,Pn,Mn=function(r){var o,s,a=function(e){void 0===e&&(e=2);var t=new Map,n=!1;function r(r){if(void 0===r&&(r=0),!n&&0!==e){var o=2===e?3072:16384,s=r;t.forEach((function(e){s+=e.getBytesCount()})),s>o&&(function(e){i.warn("Customer data exceeds the recommended ".concat(e/1024,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning"))}(o),n=!0)}}return{createDetachedTracker:function(){var e=P((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,P(r)),t.get(e)},setCompressionStatus:function(t){0===e&&(e=t,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach((function(e){return e.stop()})),t.clear()}}}(),c=V(a.getOrCreateTracker(2)),u=V(a.getOrCreateTracker(1)),f={tryToInit:function(e){o||(o=e)},update:function(e){o=e,s.notify()},isGranted:function(){return o===J.GRANTED},observable:s=new G};function h(){return function(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}(c,u)}var g,y,w=function(t,n,r){var o,s,a=new Be,c=n.observable.subscribe(u);function u(){if(s&&o&&n.isGranted()){c.unsubscribe();var e=r(o,s);a.drain(e)}}return{init:function(t){if(t)if(Ke()&&(t=function(e){return b({},e,{clientToken:"empty"})}(t)),o=t,s)ee("DD_LOGS",t);else{var r=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&i.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var n=Tt(t),r=Dt(t.forwardConsoleLogs,m(e),"Forward Console Logs"),o=Dt(t.forwardReports,m(xt),"Forward Reports");if(n&&r&&o)return t.forwardErrorsToLogs&&!v(r,e.error)&&r.push(e.error),b({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:o,requestErrorResponseLengthLimit:32768},n)}(t);r&&(s=r,n.tryToInit(r.trackingConsent),u())}else i.error("Missing configuration")},get initConfiguration(){return o},getInternalContext:D,handleLog:function(e,n,r,o){void 0===r&&(r=t()),void 0===o&&(o=xe()),a.add((function(t){return t.handleLog(e,n,r,o)}))}}}(h,f,(function(r,o){r.storeContextsAcrossPages&&(X(o,c,Ot,2),X(o,u,Ot,1));var i=function(r,o,i,s){var a=new mn,c=[];a.subscribe(1,(function(e){return Lt("logs",e)}));var u=function(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:_e,status:Le.error}}),$t("Error reported to customer",{"error.message":t.message})}}(a),l=function(e){return new G((function(t){var n=Fe(Ne.PAGEHIDE),r=Y(e,window,[z.VISIBILITY_CHANGE,z.FREEZE,z.PAGE_HIDE],(function(e){e.type===z.PAGE_HIDE&&n?t.notify({reason:At.PAGEHIDE}):e.type===z.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:At.HIDDEN}):e.type===z.FREEZE&&t.notify({reason:At.FROZEN})}),{capture:!0}).stop,o=D;return n||(o=W(e,window,z.BEFORE_UNLOAD,(function(){t.notify({reason:At.UNLOADING})})).stop),function(){r(),o()}}))}(o),f=!o.sessionStoreStrategyType||Ke()||Rt()?function(e){var t="1"===Kt(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new G}}(o):function(e,t){var n=Ut(e,"logs",(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:Kt(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}),t);return{findTrackedSession:function(e){var t=n.findActiveSession(e);return t&&"1"===t.trackingType?{id:t.id}:void 0},expireObservable:n.expireObservable}}(o,s),h=Ln(r,o,u,l,f).stop;c.push((function(){return h()})),dn(o,a),function(e,t){if(!e.forwardErrorsToLogs)return{stop:D};var n=new G;vn(n).stop,n.subscribe((function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,stack:e.stack,causes:e.causes},origin:Se,status:Le.error}})}))}(o,a),function(n,r){var o,i;(o=n.forwardConsoleLogs,i=o.map((function(e){return Qt[e]||(Qt[e]=function(e){return new G((function(n){var r=t[e];return t[e]=function(){for(var t=[],o=0;o= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(Kn[e[t+0]]+Kn[e[t+1]]+Kn[e[t+2]]+Kn[e[t+3]]+"-"+Kn[e[t+4]]+Kn[e[t+5]]+"-"+Kn[e[t+6]]+Kn[e[t+7]]+"-"+Kn[e[t+8]]+Kn[e[t+9]]+"-"+Kn[e[t+10]]+Kn[e[t+11]]+Kn[e[t+12]]+Kn[e[t+13]]+Kn[e[t+14]]+Kn[e[t+15]]).toLowerCase()}(r)}const Fn=function(e,t,n){return!Nn.randomUUID||t||e?jn(e,t,n):Nn.randomUUID()},qn={name:"track",url:"https://connect.bolt.com",storage_key:"checkout"},Hn={timestamp:"1773735783782",build:"4880484",branch:"master",version:"4880484-32d0094951",release_sha:"32d0094951a88cb0843c3f753ada5026a5c1ea2f",isV2Build:!0},Gn=["test","local","development","staging","sandbox","production"];const $n=String.fromCharCode(...Array.from({length:32},((e,t)=>t)));new RegExp(`[${$n}"<>{}]`,"g"),new RegExp(`[${$n}"'<>()*:;'@&[\\]^$%?!{}~#_=+|\\\\,./“”‘’℅£¥€]|--`,"g"),new RegExp(`[${$n}"'<>()*:;'@&[\\]^$%?!{}~#_=+|\\\\/“”‘’℅£¥€]|--`,"g");let Vn=function(e){return e.ttlKeyBufferKey="ttl_key_buffer",e.deviceLogKey="bolt_device_log_timestamp",e.refUrlKey="bolt_ref_url",e.merchantClientDeviceKey="bolt_merchant_client_device_id",e.boltCheckoutFormData="_Bolt_Checkout_Form_Data",e.boltNewAccountIdentifiers="_Bolt_New_Account_Identifiers",e.boltBCCartEncoded="BOLT_BC_CART_ENCODED",e.originalCartLocalStorageKey="bolt-ppc-original-cart",e.currentCartLocalStorageKey="bolt-ppc-current-cart-id",e.boltRouteAdded="boltRouteAdded",e.boltActiveSession="boltActiveSession",e.storageLoginKey="_Bolt_Login",e.isFirstVisitKey="is-first-onboarding-visit",e.debugLocalStorageKey="bolt_debug_event",e.clientDeviceKey="bolt_device_id",e.trackEventsKey="track_events",e.recommendationEventsKey="recommendation_events",e.isShopperLoginDeviceTokenSetCookieKey="is_shopper_login_device_token_set",e.doNotTrackCookie="bolt_do_not_track",e.accessTokenCookieKey="accessToken",e.experimentOverrideCookieKey="bolt_experiments_override",e.boltLoggingConfigCookie="bolt_logging",e.experimentOn="experiment_on",e.propagationOn="propagation_on",e.testLocalStorage="test-local-storage",e.skipAdminGoogleLogin="skip_admin_google_login",e.test="test",e.test2="test2",e.boltSession="bolt_session",e.hasDismissedAccountDashboardWelcome="account_dashboard_welcome_dismissed",e.arrivedFromRegistration="arrived-from-registration",e.selfServiceTrackingKey="self-service-tracking",e.prefetchUser="prefetch_user",e.prefetchOrder="prefetch_order_{orderToken}",e.merchantShippingOptionsTemplate="merchant_shipping_options_response_{merchantToken}",e.merchantResponseKeyTemplate="merchant_response_{merchantToken}{referrer}",e.merchantResponseTimestampKeyTemplate="merchant_response_timestamp_{merchantToken}{referrer}",e.boltCheckoutMerchantAnalyticsTemplate="Bolt_Checkout_Merchant_Analytics_{merchantToken}{referrer}",e.clientDeviceKeyTemplate="bolt_{appKey}_client_device_id",e.clientDeviceIdCookieKeyTemplate="client_device_id_{env}",e.sessionKeyTemplate="bolt_{appKey}_session",e.isVerifiedDeviceSavedKeyTemplate="bolt_{appKey}_is_verified_device_saved",e.deviceKeyTemplate="bolt_{appKey}_device_id",e.isShopperLoginDeviceTokenSetForAppKeyTemplate="bolt_{appKey}_is_shopper_login_device_token_set",e.shopperLoginDeviceTokenKeyForAppTemplate="bolt_{appKey}_shopper_login_device_token",e.isShopperLoginDeviceTokenSetKey="bolt_is_shopper_login_device_token_set",e.shopperLoginDeviceTokenKey="bolt_shopper_login_device_token",e.authenticatedShopperSessionTokenKey="bolt_authenticated_shopper_session_token",e.checkoutSessionKeyTemplate="bolt_{appKey}_checkout_session",e.paymentMethodsSessionToken="payment_methods_session_token",e.BoltShopperAssistantClosedKey="bolt_shopper_assistant_closed",e.BoltShopperAssistantMetadata="bolt_shopper_assistant_metadata",e.sharedClientDeviceKeyTemplate="bolt_client_device_id",e.checkoutPageIdKey="bolt_checkout_page_id",e.isDeviceRecognizedForNoLoginExperiment="is_device_recognized_for_no_login_experiment",e.boltVisitIDKey="bolt_visit_id_{site}",e.boltAnalyticsRules="bolt_analytics_rules",e.boltReferralCode="bolt_referral_code",e.boltHubspotId="bolt_hubspot_id",e.checkInEmail="bolt_check_in_email",e}({});function zn(e,t){let n;return void 0!==t&&(n=function(e,t){return e.replace(/\{(\w+)}/g,((e,n)=>t[n]||e))}(e,t)),n??e}function Jn(e,t,n=-1,r,o){if("undefined"==typeof document)return;const i=zn(e,o),s="https:"===document.location.protocol;document.cookie=function(e,t,n,r=-1,o){let i="",s="",a="",c="";if(r>-1){const e=new Date;e.setTime(e.getTime()+60*r*1e3),i="; expires="+e.toUTCString()}return n&&(s="; SameSite=None",a="; Secure"),null!=o&&(c="; domain="+o),encodeURIComponent(e)+"="+encodeURIComponent(t??"")+i+s+a+c+"; path=/"}(i,t,s,n,r)}function Wn(e,t){if("undefined"==typeof document)return"";const n=zn(e,t),r=encodeURIComponent(n)+"=",o=document.cookie.split(";");for(let e of o)if(e=e.trim(),e.startsWith(r))return decodeURIComponent(e.substring(r.length,e.length));return""}const Yn={},Zn=function(e,...t){const n=e instanceof Error?e:new Error(e);Yn.error?.(n,...t)};const Xn=(()=>{try{return window.localStorage}catch(e){}})(),Qn=new class{constructor(){this.localStorageAvailable=void 0,this.localStorageAvailable=function(){if(null==Xn)return!1;try{return Xn.setItem(Vn.testLocalStorage,"success"),Xn.removeItem(Vn.testLocalStorage),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==Xn.length}}()}avail(){return this.localStorageAvailable}set(e,t,n){const r=zn(e,n);this.localStorageAvailable&&Xn.setItem(r,t)}clear(e,t){const n=zn(e,t);this.localStorageAvailable&&Xn.removeItem(n)}get(e,t){const n=zn(e,t);return this.localStorageAvailable?Xn.getItem(n):void 0}key(e){return this.localStorageAvailable?Xn.key(e):null}clearAll(){this.localStorageAvailable&&Xn.clear()}getLength(){return this.localStorageAvailable?Xn.length:0}},er="bolt"+(Math.random()+1).toString(36).substring(7),tr=(()=>{try{return window.sessionStorage}catch(e){}})(),nr=new class{constructor(){this.sessionStorageAvailable=void 0,this.sessionStorageAvailable=function(){if(null==tr)return!1;try{return tr.setItem(er,"true"),tr.removeItem(er),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==tr.length}}()}avail(){return this.sessionStorageAvailable}set(e,t,n){const r=zn(e,n);this.sessionStorageAvailable&&tr.setItem(r,t)}clear(e,t){const n=zn(e,t);this.sessionStorageAvailable&&tr.removeItem(n)}get(e,t){const n=zn(e,t);return this.sessionStorageAvailable?tr.getItem(n):void 0}key(e){return this.sessionStorageAvailable?tr.key(e):null}clearAll(){this.sessionStorageAvailable&&tr.clear()}getLength(){return this.sessionStorageAvailable?tr.length:0}},rr=new class{constructor(){this.cookie=void 0,this.local=void 0,this.session=void 0,this.transient={},this.usingTransientStorage=!1,this.local=Qn.avail(),this.cookie="undefined"!=typeof navigator&&navigator.cookieEnabled,this.session=nr.avail(),this.usingTransientStorage=!1,this.clearExpiredValues()}setTransientStorage(e){this.usingTransientStorage=e}set(e,t,n){const r=zn(e,n);this.usingTransientStorage?this.transient[r]=t:this.local?Qn.set(e,t,n):this.cookie?Jn(e,t,525600,void 0,n):this.session&&nr.set(e,t,n)}setWithTTL(e,t,n,r){const o={value:t,ttl:(new Date).getTime()+1e3*n};this.set(e,JSON.stringify(o),r),this.trackKey(e,r)}clear(e,t){const n=zn(e,t);this.transient[n]&&delete this.transient[n],this.local&&Qn.clear(e,t),this.cookie&&function(e,t){Jn(e,null,-1,void 0,t)}(e,t),this.session&&nr.clear(e,t)}get(e,t){const n=zn(e,t);let r="";return this.usingTransientStorage?r=this.transient[n]:this.local?r=Qn.get(e,t):this.cookie?r=Wn(e,t):this.session&&(r=nr.get(e,t)),r=this.checkTTL(r,e,t),r}checkTTL(e,t,n){if(null==e||""===e)return e;let r;try{r=JSON.parse(e)}catch{return e}return r?.ttl?this.checkIfExpiredValue(r,t,n)?null:r.value:e}clearExpiredValues(){const e=this.ttlKeyBuffer.filter((e=>null!=this.get(e)));this.ttlKeyBuffer=e}checkIfExpiredValue(e,t,n){return(new Date).getTime()>e.ttl&&(this.untrackKey(t,n),this.clear(t,n),!0)}trackKey(e,t){this.ttlKeyBuffer=[zn(e,t),...this.ttlKeyBuffer]}untrackKey(e,t){this.ttlKeyBuffer=this.ttlKeyBuffer.filter((n=>n===zn(e,t)))}get ttlKeyBuffer(){let e;const t=this.get(Vn.ttlKeyBufferKey);if(null==t||""===t)return[];try{e=JSON.parse(t)}catch{return[]}return e}set ttlKeyBuffer(e){this.set(Vn.ttlKeyBufferKey,JSON.stringify(e))}};class or{constructor(){this.events=new Map,this.previousEmits=new Map}waitForNext(e){return new Promise((t=>{this.once(e,t)}))}on(e,t,{replayLast:n=!1}={}){return this.events.has(e)||this.events.set(e,[]),this.events.get(e).push(t),n&&this.previousEmits.has(e)&&t(this.previousEmits.get(e)),()=>{this.removeListener(e,t)}}once(e,t,n){const r=this.on(e,(function(...e){r(),t(...e)}),n);return r}removeListener(e,t){if(!this.events.has(e))return;const n=this.events.get(e)??[],r=n.findIndex((e=>e===t));n.splice(r,1)}emit(e,t){this.previousEmits.set(e,t);const n=this.events.get(e)??[];for(const e of n.slice())e(t)}clear(){this.events.clear(),this.previousEmits.clear()}}const ir=new or,sr=new or,ar=new class{constructor(){this.session=void 0,this.deviceID=void 0,this.clientDeviceID=void 0,this.merchantClientID=void 0,this.authenticatedShopperSession=void 0,this.shopperLoginDeviceToken=void 0,this.traceID=void 0,this.boltAppSession=void 0,this.boltAppName=void 0,this.isEmbeddedCheckout=void 0,this.boltSourceName=void 0,this.boltSourceBuildNumber=void 0,this.merchantReferrer=void 0,this.checkoutType=void 0}setTraceID(e){this.traceID=e,function(e){sr.emit("trace_id_observed",e)}(e)}},cr=qn.storage_key,ur="production";function lr(){if(ar.clientDeviceID)return ar.clientDeviceID;let e=Wn(Vn.clientDeviceIdCookieKeyTemplate,{env:ur});var t,n;return e||(e=rr.get(Vn.sharedClientDeviceKeyTemplate)||""),e||(e=rr.get(Vn.clientDeviceKeyTemplate,{appKey:cr})||""),e||(e=function(){const e=function(e){if("undefined"==typeof window)return new Error("No window in getRandomBytes");const t=new Uint8Array(16);return window.crypto.getRandomValues(t),t}();return e instanceof Error?(Zn(e),Fn()):e.reduce(((e,t)=>e+("00"+t.toString(16)).slice(-2)),"")}()),t=e,ar.clientDeviceID=t,Jn(Vn.clientDeviceIdCookieKeyTemplate,t,525600,(n="staging",Gn.indexOf("production")>=Gn.indexOf(n)?"bolt.com":"bolt.me"),{env:ur}),rr.set(Vn.sharedClientDeviceKeyTemplate,t),ar.clientDeviceID=e,e}let fr=[];function dr(){return[...fr]}function pr(e){const t=lr();var n,r;e&&Mn.setGlobalContextProperty("merchant_name",e),Mn.setGlobalContextProperty("client_device_id",t),n=e=>{Mn.setGlobalContextProperty("visit_id",e)},r={replayLast:!0},ir.on("visit_id_observed",n,r),sr.on("trace_id_observed",(e=>{Mn.setGlobalContextProperty("trace_id",e)}),{replayLast:!0})}function hr(e){return!!e&&/\.bolt\.com/.test(e)}const vr={app_id:"2eb53753-7dd7-424f-a548-1b8c2e09e2ed",client_token:"pub0103811daaf5d51e6f8400f977439c5a"};let gr={};function mr(){return gr}function yr(e){const t=wr(e);return 3!==t.length?null:t[0]}function br(e){const t=wr(e);return 3!==t.length?null:t[1]}function wr(e){return null==e||""===e?[]:e.split(".")}const _r="undefined"!=typeof window&&void 0!==window.document;const Er=function(e,...t){const{err:n,errMessage:r}=function(e){if(e instanceof Error)return{err:e,errMessage:e.message};if("string"==typeof e)return{err:new Error(e),errMessage:e};const t=`${e.name}: ${e.message}`;return{err:new Error(t),errMessage:t}}(e);_r||console.error(n,...t),_r&&Mn.logger?.error(r,{error:{message:r,kind:n.name,stack:n.stack},errorHandleType:"handled",breadcrumbs:dr(),...t})},Cr=function(e,t){Mn.setGlobalContextProperty(e,t)};const Sr={"*":"warn"},kr=function(){const e=Wn(Vn.boltLoggingConfigCookie);if(!e)return Sr;try{return{...Sr,...JSON.parse(e)}}catch(e){return console.error("can't parse logging configuration",e),Sr}}(),Tr=["trace","debug","info","warn","error"],xr="undefined"!=typeof navigator&&navigator.webdriver;class Ir{constructor(e){this.name=void 0,this.level=void 0,this.levelPriority=void 0,this.name=e,this.level=function(e){return kr[e]||kr["*"]}(e),this.levelPriority=Tr.indexOf(this.level)}trace(e,...t){this.log("trace",e,...t)}debug(e,...t){this.log("debug",e,...t)}info(e,...t){this.log("info",e,...t)}warn(e,...t){this.log("warn",e,...t)}error(e,...t){this.log("error",e,...t)}log(e,t,...n){if(Tr.indexOf(e)this.callback(e)),t))}dispose(){null!=this.timer&&(clearTimeout(this.timer),this.timer=void 0)}}function Ar(e,t){console.error("Unhandled background error",t,e)}function Rr(e,t){if("function"==typeof e)try{e()}catch(e){Ar(e,t)}else e instanceof Promise&&e.catch((e=>{Ar(e,t)}))}const Pr=["name"],Mr=["name","value"],Nr=["name","delta"],Br=["message","name","frames"];function Ur(e,t){return{events:Kr(e.events,t.events),samples:Kr(e.samples,t.samples),counters:Kr(e.counters,t.counters),errors:Kr(e.errors,t.errors)}}function Kr(e,t){return e&&0!==e.length?t&&0!==t.length?[...e,...t]:e:t}class jr extends Error{}let Fr=function(e){return e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.RequestTimeout=408]="RequestTimeout",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.TooManyRequests=429]="TooManyRequests",e}({});class qr extends Error{constructor(e,t,n,r){super(e),this.errorType=t,this.statusCode=n,this.statusText=r}}async function Hr(e,t={}){try{const n=await fetch(e,{method:"GET",...t,headers:{Accept:"application/json;charset=UTF-8",...t.headers}});if(n.ok)return n;if(n.status===Fr.RequestTimeout)throw new jr(`Timeout fetching ${e}`);throw new qr(`Server Error fetching ${e}: ${n.status} ${n.statusText}`,"application",n.status,n.statusText)}catch(t){if(t instanceof Error&&"AbortError"===t.name)throw new jr(`Timeout fetching ${e}`);throw t}}const Gr=new class{constructor(e){this.postFn=e,this.flushLater=new Lr(100,(()=>Rr(this.flush(),"clientLogFlushLater"))),this.postponedInput={},this.experiments={},this.reAddCounter=0,this.authReFlushCounter=0}append(e){e=function(e){const t=[],n={},r=mr();function o(e,n,o){let i=!0;const s=[];return o.forEach((t=>{(void 0===e[t]||null===e[t]||"number"==typeof e[t]&&isNaN(e[t]))&&(s.push(t),i=!1)})),i||t.push({name:"InvalidClientLogInput",properties:{...r,inputName:e.name,inputType:n,invalidKeys:s},delta:1}),i}return e.samples&&(n.samples=e.samples.filter((e=>o(e,"samples",Mr)))),e.events&&(n.events=e.events.filter((e=>o(e,"events",Pr)))),e.counters&&(n.counters=e.counters.filter((e=>o(e,"counters",Nr)))),e.errors&&(n.errors=e.errors.filter((e=>o(e,"errors",Br)))),0===t.length?e:Ur(n,{counters:t})}(e);const t=Ur(this.postponedInput,e);JSON.stringify(t).length>25e4?(Rr(this.flush(),"clientLogSizeCapReached"),this.postponedInput=e):this.postponedInput=t}updateExperiments(e){e.forEach((e=>{this.experiments[e.name]={treatment:e.treatment,version:e.version}}))}updateExperimentsDynamicFeatures(e){e.forEach(((e,t)=>{const n="dynamicFeatures."+t;this.experiments[n]={treatment:e?"on":"off",version:0}}))}postClientLog(e,t){e=function(e){const t=mr(),n={};function r(e){const n={...e};return n.properties={...t,...e.properties},n}return e.samples&&(n.samples=e.samples.map(r)),e.events&&(n.events=e.events.map(r)),e.counters&&(n.counters=e.counters.map(r)),e.errors&&(n.errors=e.errors.map(r)),n}(e),this.append(e),"now"===t?Rr(this.flush(),"clientLogFlushNow"):"later"===t&&this.flushLater.fire(void 0)}async flush(e=!1){if(this.hasContent()){const t={...this.postponedInput};try{await this.postFn(this.flushContent())}catch(n){n instanceof Error&&(!e&&this.reAddCounter<5&&(this.postClientLog(t,"later_no_flush"),this.reAddCounter++),e&&this.authReFlushCounter<3&&(this.postponedInput=t,this.authReFlushCounter++,await this.flush(!0)))}}}hasContent(){return Object.entries(this.postponedInput).length>0}flushContent(){const e={...this.postponedInput,division_id:""};return this.postponedInput={},e}}((async function(e){return await async function(e,t){const n=await Hr("https://connect.bolt.com/v1/log",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(t)});return n.status===Fr.NoContent?null:n.json()}(0,e),!0}));function $r(e,t="later"){Gr.postClientLog(e,t)}function Vr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UNKNOWN"}}const zr="";function Jr(e){let t=0;for(let n=0;n"MerchantSite"===n.experimentType&&n.treatments.some((n=>this.matchMerchant(n,e,t)))))}applyCookieOverride(e,t){return e in this.overrides?{treatment:this.overrides[e],version:t.version}:t}async assignOfConfig(e,t,n){if(!(e in this._config.experiments))return new Wr(zr,0);const r=this._config.experiments[e];if("On"!==r.experimentStatus)return new Wr(zr,r.version);const o=await this.getTreatment(e,r,t,n);return new Wr(o?o.name:zr,r.version)}async getTreatment(e,t,n,r){if("ClientDeviceId"!==t.primaryKeyType)return;const o=function(e,t){let n;switch(e){case"ClientDeviceId":n=t.clientDeviceId;break;case"ServerDeviceId":throw new Error(`Unsupported key type ${e}.`)}if(!n)throw new Error(`Invalid experiment configuration. Empty primary key for type ${e}.`);return n}(t.primaryKeyType,n),i=await async function(e,t,n){const r=n([e,t].join(":"));return Math.abs(r)%100}(e,o,r);for(const r of t.treatments)if(this.matchTreatment(e,r,n,i))return r}matchTreatment(e,t,n,r){return!!this.withinInterval(t.randomInterval,r)&&this.matchCondition(e,t,n)}matchCondition(e,t,n){let r=!1;if(n.merchantPublicId||n.merchantDivisionPublicId)r=this.matchMerchant(t,n.merchantPublicId,n.merchantDivisionPublicId);else{if((!t.includeTier1Merchants||null!=t?.condition?.merchantPublicIds||null!=t?.condition?.merchantDivisionPublicIds||null!=t?.condition?.excludesDivisionPublicIds||null!=t?.condition?.excludesMerchantPublicIds)&&n.allowMerchantTargeting)return Er(new Error(`Cannot evaluate experiment: ${e}. Request does not have merchant public ID and division public ID`)),!1;r=!0}return r&&this.matchLocale(t,n.locale)}matchMerchant(e,t,n){const r=e?.condition;if(!e.includeTier1Merchants){if(this._config.tier1DivisionPublicIds?.includes(n))return!1;if(this._config.tier1MerchantPublicIds?.includes(t))return!1}if(null!=r){if(null!=r?.merchantDivisionPublicIds||null!=r?.merchantPublicIds)return!(null==r?.merchantDivisionPublicIds||!r?.merchantDivisionPublicIds?.includes(n))||!(null==r?.merchantPublicIds||!r?.merchantPublicIds?.includes(t));if(null!=r?.excludesDivisionPublicIds||null!=r?.excludesMerchantPublicIds)return!(null!=r?.excludesDivisionPublicIds&&r?.excludesDivisionPublicIds?.includes(n)||null!=r?.excludesMerchantPublicIds&&r?.excludesMerchantPublicIds?.includes(t))}return!0}matchLocale(e,t){const n=e?.condition;return null==n||(null!=n?.allowedLocales&&null==t?(Er(new Error("[Experiments] Cannot target locale if it is not set in the request")),!1):null==n.allowedLocales||null==t||n.allowedLocales.includes(t))}withinInterval(e,t){return 0!==e.length&&(this.isInterval(e)?this.withinOneInterval(e,t):this.withinIntervals(e,t))}isInterval(e){return"number"==typeof e[0]}withinIntervals(e,t){return e.some((e=>this.withinOneInterval(e,t)))}withinOneInterval(e,t){return t>=e[0]&&t<=e[1]}}const Zr=Or("bolt.experiment");async function Xr(e){return Zr.info("loads.ts loadConfig"),async function(e){Zr.info("load.ts loadFromCloud.");const t=e?`${e}/experiments/config.json`:"/experiments/config.json",n=await async function(e){try{return await e}catch(e){return e instanceof Error?e:new Error(`Unknown error: ${e}`)}}(async function(e,n){return async function(e,t){let n=0;for(;;){const r=await e(n);if(t(r,n))return r;n++}}((()=>async function(e,t={}){return(await Hr(e,t)).json()}(t)),((e,t)=>!(e instanceof Error)||3===t))}());if(n instanceof Error)throw Er(new Error("ExperimentLoadingError"),{info:{config:n}}),n;return n}(e)}const Qr=Date.now();const eo=function(e,t){!function(e,t){const n=n=>{(function(e,t){return"*"===t||e.origin===t})(n,t)&&e(function(e){const t=e.data;return"string"==typeof t&&t.startsWith("{")?JSON.parse(t):t}(n),n)};window.addEventListener("message",n)}(e,t)},to=function(e,t){const n=t.contentWindow;n&&n.postMessage(function(e){return JSON.stringify(e)}(e),"https://connect.bolt.com")};class no extends class{constructor(e,t){this.iframeLink=void 0,this.iframe=void 0,this.iframeId=void 0,this.iframeLink=e,this.iframeId=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{this.initialize()})):this.initialize()}initialize(){const e=this.iframeLink;this.iframe=document.createElement("iframe"),this.iframe.setAttribute("id",this.iframeId??"bolt-tracking-frame"),this.iframe.setAttribute("src",e),this.iframe.style.setProperty("display","none"),document.body.appendChild(this.iframe)}}{sendMessage(e,t){if(!this.iframe)return;to({type:e,properties:t},this.iframe)}}class ro extends Error{}function oo(e,t){try{if(t<0||t>100)return Er(new Error(`isElementInViewPort: Allowed threshold value range is 1 to 100. Given value: ${t}`)),null;const n=io(),r=so(),o=e.offsetHeight,i=e.offsetWidth,s=o*(1-t/100),a=i*(1-t/100),c=n+o*(t/100),u=r+i*(t/100),l=e.getBoundingClientRect();return l.top>=-s&&l.left>=-a&&l.bottom<=c&&l.right<=u}catch(e){return Er(e,{info:{message:"Unable to determine if element is in view port"}}),null}}function io(){return window.innerHeight||document.documentElement.clientHeight}function so(){return window.innerWidth||document.documentElement.clientWidth}const ao="https://connect.bolt.com",co=Or("bolt.track");function uo(){let e={};const t=document.getElementsByTagName("meta");for(const n of t){const t=n.getAttribute("property"),r=n.getAttribute("content");t&&t.startsWith("og:")&&r&&(e={[t.toLowerCase()]:r,...e})}return e}vr&&function(e,t,n,r){try{Mn.init({clientToken:e,service:"track",env:"production",sessionSampleRate:100,forwardErrorsToLogs:!1,allowFallbackToLocalStorage:!0,usePartitionedCrossSiteSessionCookie:!0,telemetrySampleRate:0,version:Hn.build,beforeSend:e=>{const t=undefined;return t?.user_agents,"error"!==e.status||(e.breadcrumbs=dr(),e.errorHandleType=e.errorHandleType||"unhandled",function(e){const t=e.error?.stack,n=e.view?.url||"";return hr(t)||hr(n)}(e))}}),pr(void 0)}catch(e){console.error("Failed to initialize Datadog Logs:",e)}}(vr.client_token),window.BoltTrack||(window.BoltTrack=new class{constructor(){this.clientDeviceIDTimeout=2e3,this.frameManager=void 0,this.merchantKey=function(e){const t=document.getElementById("bolt-track");if(!t)throw new Error("scriptElem is null");const n=t.getAttribute("data-publishable-key");if(null!=n&&""!==n)return n;const r=t.getAttribute("data-merchant-key");if(null!=r&&""!==r)return r;throw new Error("merchant key not found")}(),this.commonEventProps={},this.initBarrier=function(){let e;return{promise:new Promise((t=>{e=t})),resolve:t=>e(t)}}(),this.merchantClientID=void 0,this.handleToHostMessage=e=>{"loadDone"===e.type&&(co.info(`Client Device ID received from track iframe : ${e.clientDeviceID}`),this.setClientDeviceID(e.clientDeviceID),this.initBarrier.resolve(void 0),Rr(this.recordEvent("pageVisit",{referrerURL:document.referrer,url:encodeURI(decodeURI(window.location.href)),canonical_url:document.querySelector("link[rel='canonical']")?.getAttribute("href")||null,...uo()}),"recordEvent"))},this.getClientDeviceID=()=>Qn.get(Vn.clientDeviceKey)||void 0,this.setClientDeviceID=e=>{Qn.set(Vn.clientDeviceKey,e)},this.getBaseEventProps=()=>({url:window.location.href,referrerURL:document.referrer,merchantPublicID:yr(this.merchantKey)||"",userAgent:navigator.userAgent,app:qn.name,time_zone:Vr(),merchantClientID:this.merchantClientID});const e=Date.now();this.merchantClientID=function(){let e=rr.get(Vn.merchantClientDeviceKey);return null!=e&&"undefined"!==e&&"null"!==e||(e=Fn(),rr.set(Vn.merchantClientDeviceKey,e)),e}(),eo(this.handleToHostMessage,"*"),this.frameManager=new no(function(e){const t=(n=e,new URLSearchParams(Object.entries(n)).toString());var n;if("development",Gn.indexOf("production")<=Gn.indexOf("development"))return`${ao}/build/track_iframe.html?${t}`;const r=Hn.version.split("-")[0];return`${ao}/${r}/build/track_iframe.html?${t}`}({merchant_key:this.merchantKey,merchant_client_id:this.merchantClientID})),window.addEventListener("beforeunload",(()=>{Rr(this.recordEvent("pageClose",{url:encodeURI(decodeURI(window.location.href))}),"recordEvent")}),{passive:!0}),this.commonEventProps=this.getBaseEventProps(),Object.entries(this.commonEventProps).forEach((e=>Cr(e[0],e[1])));const t=Date.now();var n;window.addEventListener("load",(()=>{Rr(this.setupViewTrackingExperiment(),"setupViewTrackingExperiment")}),{passive:!0}),n={source:"default",app:qn.name,client_build:Hn.build??"",merchantClientID:this.merchantClientID,userAgent:navigator.userAgent},gr={...gr,...n},$r({samples:[{name:"Track.Initialize.Start",value:e-Qr},{name:"Track.Initialize.End",value:t-Qr},{name:"Track.Initialize.Latency",value:t-e}]});const r=document.createElement("script");r.src=`${qn.url}/bolt.js?publishable_key=${this.merchantKey}`,r.async=!0,document.head.appendChild(r)}version(){return""}async getAssignment(e,t){$r({counters:[{name:"Track.GetAssignment.Invoke",delta:1}]});const n=t??await async function(e,t=1e3,n=10){return await async function(e,t,n=1e3,r=10){return new Promise((o=>{let i=n;const s=setInterval((()=>{if(i<0)return clearInterval(s),void o(new jr(`Timed out while waiting for ${e} (${n}ms)`));const a=e();if(t(a))return clearInterval(s),void o(a);i-=r}),r)}))}(e,Boolean,t,n)}(this.getClientDeviceID,this.clientDeviceIDTimeout);if(n instanceof Error)return Er(new Error("Did not receive client Device ID from track iframe before timeout"),{info:{timeout:this.clientDeviceIDTimeout,merchantClientID:t,clientDeviceID:this.getClientDeviceID()}}),$r({counters:[{name:"Track.GetAssignmentError.MissingClientID",delta:1}]}),zr;const r=await this.loadConfigAndGetAssignment(e,n);return this.commonEventProps[`experiment_${e}`]=r,r}async loadConfigAndGetAssignment(e,t){try{const n=await async function(e,t){try{const n=await Xr(qn.url),r=new Yr;r.config=n;for(const o of Object.keys(n.experiments))if(o===e)return(await r.assign(o,t,Jr)).treatment}catch(t){const n=t instanceof Error?t:new Error(`Unable to get assignment for ${e}: ${t}`);Er(n)}return zr}(e,{merchantPublicId:yr(this.merchantKey),merchantDivisionPublicId:br(this.merchantKey),clientDeviceId:t});return $r({counters:[{name:"Track.GetAssignmentSuccess",delta:1}]}),n}catch(t){const n=t instanceof Error?t:new Error(`Unable to loadConfigAndGetAssignment: ${t}`);Er(n,{info:{message:`Track JS: Unable to get assignment for experiment ${e}`}}),$r({counters:[{name:"Track.GetAssignmentError.Assignment",delta:1}]})}return zr}async recordEvent(e,t){try{await this.initBarrier.promise,localStorage&&localStorage.getItem(Vn.debugLocalStorageKey)&&console.log(`${e} event with param: ${JSON.stringify(t)}`)}catch(e){Er(e)}this.frameManager.sendMessage(e,{clientTimestamp:Date.now(),...this.commonEventProps,...t})}async setupViewTrackingExperiment(){const e=await this.getAssignment("product_view_tracking",this.merchantClientID);if(!e||!e.startsWith("enabled"))return;const t="enabled_with_no_sampling"===e?1:.25,n=function(e,t,n){const r=function(e){if(!("IntersectionObserver"in window))return new ro("IntersectionObserver API not supported.");const t=new IntersectionObserver(e.callback,{threshold:e.threshold}),n=document.querySelectorAll(e.domSelectors);return n.forEach((e=>t.observe(e))),{observer:t,observedItemCount:n.length}}({threshold:.7,callback:(r,o)=>{r.forEach((r=>{t&&o.unobserve(r.target);const i=r.target;(function(e){const t=io()*so();return 0===t?-1:e.clientHeight*e.clientWidth/t*100})(i)<5||Math.random()<=e&&n("image_view",{image_url:i.src,height:i.height,width:i.width,client_height:i.clientHeight,client_width:i.clientWidth,sizes:i.sizes,alt:i.alt,title:i.title,viewport_height:Math.max(window.innerHeight||0,document.documentElement.clientHeight||0),viewport_width:Math.max(window.innerWidth||0,document.documentElement.clientWidth||0),is_intersecting:r.isIntersecting,is_in_viewport:oo(i,70),intersection_threshold:.7,sampling_rate:e})}))},domSelectors:"img"});return r instanceof Error||(o=r.observer,"MutationObserver"in window?(new MutationObserver((e=>{let t=0;e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e.querySelectorAll("img");n.forEach((e=>o.observe(e))),t+=n.length}))})),$r({counters:[{name:"Track.MutationObserver.NewObservables",delta:t}]})})).observe(document.body,{subtree:!0,childList:!0}),$r({counters:[{name:"Track.MutationObserver.Supported",delta:1}]})):$r({counters:[{name:"Track.MutationObserver.Unsupported",delta:1}]})),r;var o}(t,!1,((e,t)=>{Rr(this.recordEvent(e,t),"recordEvent")}));n instanceof Error&&Er(new Error("Unable to setup product image tracking experiment"),{info:{merchantClientID:this.merchantClientID,clientDeviceID:this.getClientDeviceID(),merchantKey:this.merchantKey}}),$r({events:[{name:"view_tracking_setup",properties:{result:n instanceof Error?"failure":"success",observedItemCount:n instanceof Error?0:n.observedItemCount,samplingRate:t,merchantClientID:this.merchantClientID,merchantKey:this.merchantKey,clientDeviceID:this.getClientDeviceID()}}],counters:[{name:"view_tracking_observables",delta:n instanceof Error?0:n.observedItemCount,properties:{merchantKey:this.merchantKey,samplingRate:t}}]})}}),window.BoltTrack})()})(); //# bolt_internal_sourceMappingURL=https://internal.bolt.me/sourcemaps/production/track/4880484/track.js.map.gz