(()=>{"use strict";var e,t,r={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.m=r,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+"/bfba63ca3870acbc5783.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="[name]Destination:",n.l=(r,o,i,a)=>{if(e[r])e[r].push(o);else{var s,l;if(void 0!==i)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var c=u[d];if(c.getAttribute("src")==r||c.getAttribute("data-webpack")==t+i){s=c;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+i),s.src=r),e[r]=[o];var p=(t,o)=>{s.onerror=s.onload=null,clearTimeout(h);var n=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),t)return t(o)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e+"../"})(),(()=>{var e={648:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=i);var a=n.p+n.u(t),s=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,[a,s,l]=r,u=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(r);u<a.length;u++)i=a[u],n.o(e,i)&&e[i]&&e[i][0](),e[a[u]]=0},r=self.webpackChunk_name_Destination=self.webpackChunk_name_Destination||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};n.d(i,{default:()=>a});const a=(s={name:"Segment Utilities Web",slug:"actions-segment-utilities-web",mode:"device",settings:{throttleWindow:{label:"Throttle time",description:"The window of time in milliseconds to throttle events.",type:"number",default:3e3},passThroughCount:{label:"Number of events to pass through",description:"Number of events to pass through while waiting for the throttle time to expire.",type:"number",default:1}},initialize:async()=>({eventMap:{}}),actions:{throttle:{title:"Throttle by event name",description:"Throttle events sent to Segment. Throttling is on a per event name basis.",platform:"web",defaultSubscription:'type = "track"',fields:{passThroughCount:{label:"Number of events to pass through",description:"Override the global pass through count.",type:"integer",allowNull:!0},throttleWindow:{label:"Throttle time",description:"Override the global throttle time.",type:"number",allowNull:!0}},lifecycleHook:"before",perform:({eventMap:e},t)=>{const{context:r,settings:o,payload:n}=t,i=isNaN(Number(n.passThroughCount))?void 0:Number(n.passThroughCount),a=isNaN(Number(n.throttleWindow))?void 0:Number(n.throttleWindow),s=i??o.passThroughCount??1,l=a??o.throttleWindow??0,u=r.event.event;if(u){if(e[u]){const{windowStarted:t}=e[u];Date.now()-t<l?e[u].receivedCount++:e[u]={windowStarted:Date.now(),receivedCount:1}}else e[u]={windowStarted:Date.now(),receivedCount:1};e[u].receivedCount>s&&r.updateEvent("integrations",{...r.event.integrations,"Segment.io":!1})}}}}},async e=>(await n.e(688).then(n.bind(n,8688))).generatePlugins(s,e,e.subscriptions||[]));var s;window["segment-utilities-webDestination"]=i.default})();
//# sourceMappingURL=9cc15a032667eb2f671a.js.map