(()=>{"use strict";var e,t,n={},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,n)=>(i.f[n](e,t),t)),[])),i.u=e=>e+"/b71991e64b93843f6eeb.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="Destination:",i.l=(n,s,r,o)=>{if(e[n])e[n].push(s);else{var a,l;if(void 0!==r)for(var d=document.getElementsByTagName("script"),c=0;c{a.onerror=a.onload=null,clearTimeout(f);var i=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(s))),t)return t(s)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var s=n.length-1;s>-1&&!e;)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../"})(),(()=>{var e={238:0};i.f.j=(t,n)=>{var s=i.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var r=new Promise(((n,i)=>s=e[t]=[n,i]));n.push(s[2]=r);var o=i.p+i.u(t),a=new Error;i.l(o,(n=>{if(i.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,s[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var s,r,[o,a,l]=n,d=0;if(o.some((t=>0!==e[t]))){for(s in a)i.o(a,s)&&(i.m[s]=a[s]);if(l)l(i)}for(t&&t(n);dl});const o=18e5;function a(){return(new Date).getTime()}const l=function(e){const t=async t=>(await i.e(845).then(i.bind(i,3962))).generatePlugins(e,t,t.subscriptions||[]);return t.pluginName=e.name,t}({name:"Amplitude (Actions)",mode:"device",actions:{sessionId:{title:"Session Plugin",description:"Generates a Session ID and attaches it to every Amplitude browser based event.",platform:"web",defaultSubscription:'type = "track" or type = "identify" or type = "group" or type = "page" or type = "alias"',fields:{sessionLength:{label:"Session Length",type:"number",required:!1,description:"Time in milliseconds to be used before considering a session stale.",default:o},triggerSessionEvents:{label:"Allow Session Tracking",type:"boolean",default:!1,required:!1,description:"if set to true, 'Session Started' and 'Session Ended' events will be triggered from the user's browser. These events will be forwarded to all connected Destinations."},sessionStartEvent:{label:"Session Start Event",type:"string",default:"session_started",required:!1,description:"The event name to use for the session start event.",depends_on:{conditions:[{fieldKey:"triggerSessionEvents",operator:"is",value:!0}]}},sessionEndEvent:{label:"Session End Event",type:"string",default:"session_ended",required:!1,description:"The event name to use for the session end event.",depends_on:{conditions:[{fieldKey:"triggerSessionEvents",operator:"is",value:!0}]}}},lifecycleHook:"enrichment",perform:(e,{context:t,payload:n,analytics:s})=>{const i={get:e=>{const t=window.localStorage.getItem(e);return null===t?null:parseInt(t,10)},set:(e,t)=>window.localStorage.setItem(e,t.toString())},r=a(),o=s.storage?s.storage:i,l=o.get("analytics_session_id"),d=o.get("analytics_session_id.last_access"),c=function(e,t,n=18e5){return e-(t??0)!0)).catch((()=>!0))}(s,n.sessionEndEvent);let u=l;!function(e,t,n=18e5){if(null===e||null===t)return!0;const s=t;return a()-s>=n}(l,d,n.sessionLength)?o.set("analytics_session_id",u):(u=r,o.set("analytics_session_id",u),n.triggerSessionEvents&&function(e,t="session_started"){e.track(t,{}).then((()=>!0)).catch((()=>!0))}(s,n.sessionStartEvent)),o.set("analytics_session_id.last_access",r),(!1!==t.event.integrations?.All||t.event.integrations["Actions Amplitude"])&&(t.updateEvent("integrations.Actions Amplitude",{}),t.updateEvent("integrations.Actions Amplitude.session_id",u))}}},initialize:async()=>({})});window["amplitude-pluginsDestination"]=r.default})(); //# sourceMappingURL=ea20d1af3c8baa2ea75e.js.map