@apollosproject/canvas-embeds 2.1.645 → 2.1.647

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/widget/index.js +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apollosproject/canvas-embeds",
3
3
  "description": "Apollos React embed widgets",
4
- "version": "2.1.645",
4
+ "version": "2.1.647",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.umd.js",
7
7
  "module": "./dist/index.es.js",
package/widget/index.js CHANGED
@@ -1949,7 +1949,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1949
1949
  }
1950
1950
  }
1951
1951
  }
1952
- `;function UP(t={}){var n;const a=ri(av1,{fetchPolicy:"cache-and-network",errorPolicy:"all",...t});return{campuses:((n=a==null?void 0:a.data)==null?void 0:n.campuses)||[],...a}}function BP(t){return t?t.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""):""}function Zr(t,a){if(!t||!a)return!1;const n=BP(a);return t===n||t===n.replace(/-/g,"_")||t===n.replace(/_/g,"-")}function nv1(t,a,n){return e.useMemo(()=>{if(!t||t.length===0)return{matchedCampus:null,matchedFund:null};if(a){const r=rv1(t,a);if(!r)return{matchedCampus:null,matchedFund:null};const l=n?qP(r,n):null;return{matchedCampus:r,matchedFund:l}}return n?lv1(t,n):{matchedCampus:null,matchedFund:null}},[t,a,n])}function rv1(t,a){const n=a.startsWith("Campus:")?a.substring(7):a,r=a.startsWith("Campus:")?a:`Campus:${a}`;let l=t.find(o=>o.id===a);return l||(l=t.find(o=>o.id===n)),l||(l=t.find(o=>o.id===r)),l||(l=t.find(o=>Zr(a,o.name))),l||null}function qP(t,a){if(!t.donationFunds||t.donationFunds.length===0)return null;let n=t.donationFunds.find(r=>r.id===a);return n||(n=t.donationFunds.find(r=>Zr(a,r.name)||r.displayName&&Zr(a,r.displayName))),n||null}function lv1(t,a){const n=i=>i.donationFunds?i.donationFunds.some(c=>c.id===a||Zr(a,c.name)||c.displayName&&Zr(a,c.displayName)):!1,r=t.find(i=>i.digital===!0&&n(i));if(r){const i=qP(r,a);return{matchedCampus:r,matchedFund:i}}const l=t.find(n);if(!l)return{matchedCampus:null,matchedFund:null};const o=qP(l,a);return{matchedCampus:l,matchedFund:o}}var $2;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})($2||($2={}));var Hi;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(Hi||(Hi={}));var j7;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(j7||(j7={}));var Hr;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(Hr||(Hr={}));var E4;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(E4||(E4={}));var LM;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(LM||(LM={}));var z2;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(z2||(z2={}));var SM;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(SM||(SM={}));var aE0="-",ov1="AMP",iv1="".concat(ov1,"_unsent"),nE0="https://api2.amplitude.com/2/httpapi",cv1="https://api.eu.amplitude.com/2/httpapi",sv1="https://api2.amplitude.com/batch",uv1="https://api.eu.amplitude.com/batch",mv1=1e3,WP=function(t){if(Object.keys(t).length>mv1)return!1;for(var a in t){var n=t[a];if(!rE0(a,n))return!1}return!0},rE0=function(t,a){var n,r;if(typeof t!="string")return!1;if(Array.isArray(a)){var l=!0;try{for(var o=Yo(a),i=o.next();!i.done;i=o.next()){var c=i.value;if(Array.isArray(c))return!1;if(typeof c=="object")l=l&&WP(c);else if(!["number","string"].includes(typeof c))return!1;if(!l)return!1}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(a==null)return!1;if(typeof a=="object")return WP(a);if(!["number","string","boolean"].includes(typeof a))return!1}return!0},GP=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return q({},this._properties)},t.prototype.set=function(a,n){return this._safeSet($2.SET,a,n),this},t.prototype.setOnce=function(a,n){return this._safeSet($2.SET_ONCE,a,n),this},t.prototype.append=function(a,n){return this._safeSet($2.APPEND,a,n),this},t.prototype.prepend=function(a,n){return this._safeSet($2.PREPEND,a,n),this},t.prototype.postInsert=function(a,n){return this._safeSet($2.POSTINSERT,a,n),this},t.prototype.preInsert=function(a,n){return this._safeSet($2.PREINSERT,a,n),this},t.prototype.remove=function(a,n){return this._safeSet($2.REMOVE,a,n),this},t.prototype.add=function(a,n){return this._safeSet($2.ADD,a,n),this},t.prototype.unset=function(a){return this._safeSet($2.UNSET,a,aE0),this},t.prototype.clearAll=function(){return this._properties={},this._properties[$2.CLEAR_ALL]=aE0,this},t.prototype._safeSet=function(a,n,r){if(this._validate(a,n,r)){var l=this._properties[a];return l===void 0&&(l={},this._properties[a]=l),l[n]=r,this._propertySet.add(n),!0}return!1},t.prototype._validate=function(a,n,r){return this._properties[$2.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:a===$2.ADD?typeof r=="number":a!==$2.UNSET&&a!==$2.REMOVE?rE0(n,r):!0},t}(),dv1=function(t,a,n){var r=typeof t=="string"?{event_type:t}:t;return q(q(q({},r),n),a&&{event_properties:a})},hv1=function(t,a){var n=q(q({},a),{event_type:j7.IDENTIFY,user_properties:t.getUserProperties()});return n},pv1=function(t,a,n,r){var l,o=q(q({},r),{event_type:j7.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(l={},l[t]=a,l)});return o},fv1=function(t,a,n){var r,l=new GP;l.set(t,a);var o=q(q({},n),{event_type:j7.IDENTIFY,user_properties:l.getUserProperties(),groups:(r={},r[t]=a,r)});return o},vv1=function(t,a){return q(q({},a),{event_type:j7.REVENUE,event_properties:t.getEventProperties()})},dp=function(t,a,n){return a===void 0&&(a=0),n===void 0&&(n=z2.Unknown),{event:t,code:a,message:n}},Av1=function(){function t(a){this.client=a,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(a,n){return H0(this,void 0,void 0,function(){return M0(this,function(r){switch(r.label){case 0:return[4,a.setup(n,this.client)];case 1:return r.sent(),this.plugins.push(a),[2]}})})},t.prototype.deregister=function(a,n){var r;return H0(this,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return l=this.plugins.findIndex(function(c){return c.name===a}),l===-1?(n.loggerProvider.warn("Plugin with name ".concat(a," does not exist, skipping deregistration")),[2]):(o=this.plugins[l],this.plugins.splice(l,1),[4,(r=o.teardown)===null||r===void 0?void 0:r.call(o)]);case 1:return i.sent(),[2]}})})},t.prototype.reset=function(a){this.applying=!1;var n=this.plugins;n.map(function(r){var l;return(l=r.teardown)===null||l===void 0?void 0:l.call(r)}),this.plugins=[],this.client=a},t.prototype.push=function(a){var n=this;return new Promise(function(r){n.queue.push([a,r]),n.scheduleApply(0)})},t.prototype.scheduleApply=function(a){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},a))},t.prototype.apply=function(a){return H0(this,void 0,void 0,function(){var n,r,l,o,i,c,u,Z,H,d,h,f,A,Z,H,y,b,S,_,w,T,N;return M0(this,function(P){switch(P.label){case 0:if(!a)return[2];n=wt(a,1),r=n[0],l=wt(a,2),o=l[1],i=this.plugins.filter(function(x){return x.type===E4.BEFORE}),P.label=1;case 1:P.trys.push([1,6,7,8]),c=Yo(i),u=c.next(),P.label=2;case 2:return u.done?[3,5]:(Z=u.value,[4,Z.execute(q({},r))]);case 3:if(H=P.sent(),H===null)return o({event:r,code:0,message:""}),[2];r=H,P.label=4;case 4:return u=c.next(),[3,2];case 5:return[3,8];case 6:return d=P.sent(),_={error:d},[3,8];case 7:try{u&&!u.done&&(w=c.return)&&w.call(c)}finally{if(_)throw _.error}return[7];case 8:h=this.plugins.filter(function(x){return x.type===E4.ENRICHMENT}),P.label=9;case 9:P.trys.push([9,14,15,16]),f=Yo(h),A=f.next(),P.label=10;case 10:return A.done?[3,13]:(Z=A.value,[4,Z.execute(q({},r))]);case 11:if(H=P.sent(),H===null)return o({event:r,code:0,message:""}),[2];r=H,P.label=12;case 12:return A=f.next(),[3,10];case 13:return[3,16];case 14:return y=P.sent(),T={error:y},[3,16];case 15:try{A&&!A.done&&(N=f.return)&&N.call(f)}finally{if(T)throw T.error}return[7];case 16:return b=this.plugins.filter(function(x){return x.type===E4.DESTINATION}),S=b.map(function(x){var z=q({},r);return x.execute(z).catch(function(Y){return dp(z,0,String(Y))})}),Promise.all(S).then(function(x){var z=wt(x,1),Y=z[0];o(Y)}),[2]}})})},t.prototype.flush=function(){return H0(this,void 0,void 0,function(){var a,n,r,l=this;return M0(this,function(o){switch(o.label){case 0:return a=this.queue,this.queue=[],[4,Promise.all(a.map(function(i){return l.apply(i)}))];case 1:return o.sent(),n=this.plugins.filter(function(i){return i.type===E4.DESTINATION}),r=n.map(function(i){return i.flush&&i.flush()}),[4,Promise.all(r)];case 2:return o.sent(),[2]}})})},t}(),gv1="Event tracked successfully",Zv1="Unexpected error occurred",Hv1="Event rejected due to exceeded retry count",Mv1="Event skipped due to optOut config",Ev1="Event rejected due to missing API key",Vv1="Invalid API key",yv1="Client not initialized",Mr=function(t){return{promise:t||Promise.resolve()}},bv1=function(){function t(a){a===void 0&&(a="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Av1(this),this.name=a}return t.prototype._init=function(a){return H0(this,void 0,void 0,function(){return M0(this,function(n){switch(n.label){case 0:return this.config=a,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return n.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(a){return H0(this,void 0,void 0,function(){var n,r,l,o,i,c,u;return M0(this,function(d){switch(d.label){case 0:n=this[a],this[a]=[],d.label=1;case 1:d.trys.push([1,6,7,8]),r=Yo(n),l=r.next(),d.label=2;case 2:return l.done?[3,5]:(o=l.value,[4,o()]);case 3:d.sent(),d.label=4;case 4:return l=r.next(),[3,2];case 5:return[3,8];case 6:return i=d.sent(),c={error:i},[3,8];case 7:try{l&&!l.done&&(u=r.return)&&u.call(r)}finally{if(c)throw c.error}return[7];case 8:return[2]}})})},t.prototype.track=function(a,n,r){var l=dv1(a,n,r);return Mr(this.dispatch(l))},t.prototype.identify=function(a,n){var r=hv1(a,n);return Mr(this.dispatch(r))},t.prototype.groupIdentify=function(a,n,r,l){var o=pv1(a,n,r,l);return Mr(this.dispatch(o))},t.prototype.setGroup=function(a,n,r){var l=fv1(a,n,r);return Mr(this.dispatch(l))},t.prototype.revenue=function(a,n){var r=vv1(a,n);return Mr(this.dispatch(r))},t.prototype.add=function(a){return this.config?Mr(this.timeline.register(a,this.config)):(this.q.push(this.add.bind(this,a)),Mr())},t.prototype.remove=function(a){return this.config?Mr(this.timeline.deregister(a,this.config)):(this.q.push(this.remove.bind(this,a)),Mr())},t.prototype.dispatchWithCallback=function(a,n){if(!this.config)return n(dp(a,0,yv1));this.process(a).then(n)},t.prototype.dispatch=function(a){return H0(this,void 0,void 0,function(){var n=this;return M0(this,function(r){return this.config?[2,this.process(a)]:[2,new Promise(function(l){n.dispatchQ.push(n.dispatchWithCallback.bind(n,a,l))})]})})},t.prototype.process=function(a){return H0(this,void 0,void 0,function(){var l,n,r,l;return M0(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,dp(a,0,Mv1)]:[4,this.timeline.push(a)];case 1:return l=o.sent(),l.code===200?this.config.loggerProvider.log(l.message):this.config.loggerProvider.error(l.message),[2,l];case 2:return n=o.sent(),this.config.loggerProvider.error(n),r=String(n),l=dp(a,0,r),[2,l];case 3:return[2]}})})},t.prototype.setOptOut=function(a){if(!this.config){this.q.push(this.setOptOut.bind(this,!!a));return}this.config.optOut=!!a},t.prototype.flush=function(){return Mr(this.timeline.flush())},t}(),Lv1=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(a){return this.productId=a,this},t.prototype.setQuantity=function(a){return a>0&&(this.quantity=a),this},t.prototype.setPrice=function(a){return this.price=a,this},t.prototype.setRevenueType=function(a){return this.revenueType=a,this},t.prototype.setCurrency=function(a){return this.currency=a,this},t.prototype.setRevenue=function(a){return this.revenue=a,this},t.prototype.setEventProperties=function(a){return WP(a)&&(this.properties=a),this},t.prototype.getEventProperties=function(){var a=this.properties?q({},this.properties):{};return a[Hi.REVENUE_PRODUCT_ID]=this.productId,a[Hi.REVENUE_QUANTITY]=this.quantity,a[Hi.REVENUE_PRICE]=this.price,a[Hi.REVENUE_TYPE]=this.revenueType,a[Hi.REVENUE_CURRENCY]=this.currency,a[Hi.REVENUE]=this.revenue,a},t}(),Sv1=function(t,a){var n=Math.max(a,1);return t.reduce(function(r,l,o){var i=Math.floor(o/n);return r[i]||(r[i]=[]),r[i].push(l),r},[])},FM="Amplitude Logger ",Fv1=function(){function t(){this.logLevel=Hr.None}return t.prototype.disable=function(){this.logLevel=Hr.None},t.prototype.enable=function(a){a===void 0&&(a=Hr.Warn),this.logLevel=a},t.prototype.log=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Verbose||console.log("".concat(FM,"[Log]: ").concat(a.join(" ")))},t.prototype.warn=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Warn||console.warn("".concat(FM,"[Warn]: ").concat(a.join(" ")))},t.prototype.error=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Error||console.error("".concat(FM,"[Error]: ").concat(a.join(" ")))},t.prototype.debug=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Debug||console.log("".concat(FM,"[Debug]: ").concat(a.join(" ")))},t}(),_M=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:Hr.Warn,loggerProvider:new Fv1,optOut:!1,serverUrl:nE0,serverZone:LM.US,useBatch:!1}},_v1=function(){function t(a){var n,r,l,o;this._optOut=!1;var i=_M();this.apiKey=a.apiKey,this.flushIntervalMillis=(n=a.flushIntervalMillis)!==null&&n!==void 0?n:i.flushIntervalMillis,this.flushMaxRetries=a.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=a.flushQueueSize||i.flushQueueSize,this.instanceName=a.instanceName||i.instanceName,this.loggerProvider=a.loggerProvider||i.loggerProvider,this.logLevel=(r=a.logLevel)!==null&&r!==void 0?r:i.logLevel,this.minIdLength=a.minIdLength,this.plan=a.plan,this.ingestionMetadata=a.ingestionMetadata,this.optOut=(l=a.optOut)!==null&&l!==void 0?l:i.optOut,this.serverUrl=a.serverUrl,this.serverZone=a.serverZone||i.serverZone,this.storageProvider=a.storageProvider,this.transportProvider=a.transportProvider,this.useBatch=(o=a.useBatch)!==null&&o!==void 0?o:i.useBatch,this.loggerProvider.enable(this.logLevel);var c=lE0(a.serverUrl,a.serverZone,a.useBatch);this.serverZone=c.serverZone,this.serverUrl=c.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(a){this._optOut=a},enumerable:!1,configurable:!0}),t}(),kv1=function(t,a){return t===LM.EU?a?uv1:cv1:a?sv1:nE0},lE0=function(t,a,n){if(t===void 0&&(t=""),a===void 0&&(a=_M().serverZone),n===void 0&&(n=_M().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=["US","EU"].includes(a)?a:_M().serverZone;return{serverZone:r,serverUrl:kv1(r,n)}};function wv1(t){return t instanceof Error?t.message:String(t)}function kM(t){var a="";try{"body"in t&&(a=JSON.stringify(t.body))}catch{}return a}var Cv1=function(){function t(){this.name="amplitude",this.type=E4.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(a){var n;return H0(this,void 0,void 0,function(){var r,l=this;return M0(this,function(o){switch(o.label){case 0:return this.config=a,this.storageKey="".concat(iv1,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=o.sent(),this.saveEvents(),r&&r.length>0&&Promise.all(r.map(function(i){return l.execute(i)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(a){var n=this;return new Promise(function(r){var l={event:a,attempts:0,callback:function(o){return r(o)},timeout:0};n.addToQueue(l)})},t.prototype.addToQueue=function(){for(var a=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var l=n.filter(function(o){return o.attempts<a.config.flushMaxRetries?(o.attempts+=1,!0):(a.fulfillRequest([o],500,Hv1),!1)});l.forEach(function(o){if(a.queue=a.queue.concat(o),o.timeout===0){a.schedule(a.config.flushIntervalMillis);return}setTimeout(function(){o.timeout=0,a.schedule(0)},o.timeout)}),this.saveEvents()},t.prototype.schedule=function(a){var n=this;this.scheduled||(this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(a)})},a))},t.prototype.flush=function(a){return a===void 0&&(a=!1),H0(this,void 0,void 0,function(){var n,r,l,o=this;return M0(this,function(i){switch(i.label){case 0:return n=[],r=[],this.queue.forEach(function(c){return c.timeout===0?n.push(c):r.push(c)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),l=Sv1(n,this.config.flushQueueSize),[4,Promise.all(l.map(function(c){return o.send(c,a)}))];case 1:return i.sent(),[2]}})})},t.prototype.send=function(a,n){return n===void 0&&(n=!0),H0(this,void 0,void 0,function(){var r,l,o,i,c;return M0(this,function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(a,400,Ev1)];r={api_key:this.config.apiKey,events:a.map(function(d){var h=d.event;h.extra;var f=Gt(h,["extra"]);return f}),options:{min_id_length:this.config.minIdLength}},u.label=1;case 1:return u.trys.push([1,3,,4]),l=lE0(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(l,r)];case 2:return o=u.sent(),o===null?(this.fulfillRequest(a,0,Zv1),[2]):n?(this.handleResponse(o,a),[3,4]):("body"in o?this.fulfillRequest(a,o.statusCode,"".concat(o.status,": ").concat(kM(o))):this.fulfillRequest(a,o.statusCode,o.status),[2]);case 3:return i=u.sent(),this.config.loggerProvider.error(i),c=wv1(i),this.fulfillRequest(a,0,c),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(a,n){var r=a.status;switch(r){case z2.Success:{this.handleSuccessResponse(a,n);break}case z2.Invalid:{this.handleInvalidResponse(a,n);break}case z2.PayloadTooLarge:{this.handlePayloadTooLargeResponse(a,n);break}case z2.RateLimit:{this.handleRateLimitResponse(a,n);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(r,"' provided for ").concat(n.length,' events"}')),this.handleOtherResponse(n);break}}},t.prototype.handleSuccessResponse=function(a,n){this.fulfillRequest(n,a.statusCode,gv1)},t.prototype.handleInvalidResponse=function(a,n){var r=this;if(a.body.missingField||a.body.error.startsWith(Vv1)){this.fulfillRequest(n,a.statusCode,a.body.error);return}var l=K1(K1(K1(K1([],wt(Object.values(a.body.eventsWithInvalidFields)),!1),wt(Object.values(a.body.eventsWithMissingFields)),!1),wt(Object.values(a.body.eventsWithInvalidIdLengths)),!1),wt(a.body.silencedEvents),!1).flat(),o=new Set(l),i=n.filter(function(c,u){if(o.has(u)){r.fulfillRequest([c],a.statusCode,a.body.error);return}return!0});i.length>0&&this.config.loggerProvider.warn(kM(a)),this.addToQueue.apply(this,K1([],wt(i),!1))},t.prototype.handlePayloadTooLargeResponse=function(a,n){if(n.length===1){this.fulfillRequest(n,a.statusCode,a.body.error);return}this.config.loggerProvider.warn(kM(a)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,K1([],wt(n),!1))},t.prototype.handleRateLimitResponse=function(a,n){var r=this,l=Object.keys(a.body.exceededDailyQuotaUsers),o=Object.keys(a.body.exceededDailyQuotaDevices),i=a.body.throttledEvents,c=new Set(l),u=new Set(o),d=new Set(i),h=n.filter(function(f,A){if(f.event.user_id&&c.has(f.event.user_id)||f.event.device_id&&u.has(f.event.device_id)){r.fulfillRequest([f],a.statusCode,a.body.error);return}return d.has(A)&&(f.timeout=r.throttleTimeout),!0});h.length>0&&this.config.loggerProvider.warn(kM(a)),this.addToQueue.apply(this,K1([],wt(h),!1))},t.prototype.handleOtherResponse=function(a){var n=this;this.addToQueue.apply(this,K1([],wt(a.map(function(r){return r.timeout=r.attempts*n.retryTimeout,r})),!1))},t.prototype.fulfillRequest=function(a,n,r){this.saveEvents(),a.forEach(function(l){return l.callback(dp(l.event,n,r))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var a=Array.from(this.queue.map(function(n){return n.event}));this.config.storageProvider.set(this.storageKey,a)}},t}(),Nv1=function(t){var a=new Error().stack||"";return a.split(`
1952
+ `;function UP(t={}){var l;const a=ri(av1,{fetchPolicy:"cache-and-network",errorPolicy:"all",...t});return{campuses:[...((l=a==null?void 0:a.data)==null?void 0:l.campuses)||[]].sort((o,i)=>o.digital&&!i.digital?-1:!o.digital&&i.digital?1:o.name.localeCompare(i.name)),...a}}function BP(t){return t?t.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""):""}function Zr(t,a){if(!t||!a)return!1;const n=BP(a);return t===n||t===n.replace(/-/g,"_")||t===n.replace(/_/g,"-")}function nv1(t,a,n){return e.useMemo(()=>{if(!t||t.length===0)return{matchedCampus:null,matchedFund:null};if(a){const r=rv1(t,a);if(!r)return{matchedCampus:null,matchedFund:null};const l=n?qP(r,n):null;return{matchedCampus:r,matchedFund:l}}return n?lv1(t,n):{matchedCampus:null,matchedFund:null}},[t,a,n])}function rv1(t,a){const n=a.startsWith("Campus:")?a.substring(7):a,r=a.startsWith("Campus:")?a:`Campus:${a}`;let l=t.find(o=>o.id===a);return l||(l=t.find(o=>o.id===n)),l||(l=t.find(o=>o.id===r)),l||(l=t.find(o=>Zr(a,o.name))),l||null}function qP(t,a){if(!t.donationFunds||t.donationFunds.length===0)return null;let n=t.donationFunds.find(r=>r.id===a);return n||(n=t.donationFunds.find(r=>Zr(a,r.name)||r.displayName&&Zr(a,r.displayName))),n||null}function lv1(t,a){const n=i=>i.donationFunds?i.donationFunds.some(c=>c.id===a||Zr(a,c.name)||c.displayName&&Zr(a,c.displayName)):!1,r=t.find(i=>i.digital===!0&&n(i));if(r){const i=qP(r,a);return{matchedCampus:r,matchedFund:i}}const l=t.find(n);if(!l)return{matchedCampus:null,matchedFund:null};const o=qP(l,a);return{matchedCampus:l,matchedFund:o}}var $2;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})($2||($2={}));var Hi;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(Hi||(Hi={}));var j7;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(j7||(j7={}));var Hr;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(Hr||(Hr={}));var E4;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(E4||(E4={}));var LM;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(LM||(LM={}));var z2;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(z2||(z2={}));var SM;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(SM||(SM={}));var aE0="-",ov1="AMP",iv1="".concat(ov1,"_unsent"),nE0="https://api2.amplitude.com/2/httpapi",cv1="https://api.eu.amplitude.com/2/httpapi",sv1="https://api2.amplitude.com/batch",uv1="https://api.eu.amplitude.com/batch",mv1=1e3,WP=function(t){if(Object.keys(t).length>mv1)return!1;for(var a in t){var n=t[a];if(!rE0(a,n))return!1}return!0},rE0=function(t,a){var n,r;if(typeof t!="string")return!1;if(Array.isArray(a)){var l=!0;try{for(var o=Yo(a),i=o.next();!i.done;i=o.next()){var c=i.value;if(Array.isArray(c))return!1;if(typeof c=="object")l=l&&WP(c);else if(!["number","string"].includes(typeof c))return!1;if(!l)return!1}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(a==null)return!1;if(typeof a=="object")return WP(a);if(!["number","string","boolean"].includes(typeof a))return!1}return!0},GP=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return q({},this._properties)},t.prototype.set=function(a,n){return this._safeSet($2.SET,a,n),this},t.prototype.setOnce=function(a,n){return this._safeSet($2.SET_ONCE,a,n),this},t.prototype.append=function(a,n){return this._safeSet($2.APPEND,a,n),this},t.prototype.prepend=function(a,n){return this._safeSet($2.PREPEND,a,n),this},t.prototype.postInsert=function(a,n){return this._safeSet($2.POSTINSERT,a,n),this},t.prototype.preInsert=function(a,n){return this._safeSet($2.PREINSERT,a,n),this},t.prototype.remove=function(a,n){return this._safeSet($2.REMOVE,a,n),this},t.prototype.add=function(a,n){return this._safeSet($2.ADD,a,n),this},t.prototype.unset=function(a){return this._safeSet($2.UNSET,a,aE0),this},t.prototype.clearAll=function(){return this._properties={},this._properties[$2.CLEAR_ALL]=aE0,this},t.prototype._safeSet=function(a,n,r){if(this._validate(a,n,r)){var l=this._properties[a];return l===void 0&&(l={},this._properties[a]=l),l[n]=r,this._propertySet.add(n),!0}return!1},t.prototype._validate=function(a,n,r){return this._properties[$2.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:a===$2.ADD?typeof r=="number":a!==$2.UNSET&&a!==$2.REMOVE?rE0(n,r):!0},t}(),dv1=function(t,a,n){var r=typeof t=="string"?{event_type:t}:t;return q(q(q({},r),n),a&&{event_properties:a})},hv1=function(t,a){var n=q(q({},a),{event_type:j7.IDENTIFY,user_properties:t.getUserProperties()});return n},pv1=function(t,a,n,r){var l,o=q(q({},r),{event_type:j7.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(l={},l[t]=a,l)});return o},fv1=function(t,a,n){var r,l=new GP;l.set(t,a);var o=q(q({},n),{event_type:j7.IDENTIFY,user_properties:l.getUserProperties(),groups:(r={},r[t]=a,r)});return o},vv1=function(t,a){return q(q({},a),{event_type:j7.REVENUE,event_properties:t.getEventProperties()})},dp=function(t,a,n){return a===void 0&&(a=0),n===void 0&&(n=z2.Unknown),{event:t,code:a,message:n}},Av1=function(){function t(a){this.client=a,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(a,n){return H0(this,void 0,void 0,function(){return M0(this,function(r){switch(r.label){case 0:return[4,a.setup(n,this.client)];case 1:return r.sent(),this.plugins.push(a),[2]}})})},t.prototype.deregister=function(a,n){var r;return H0(this,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return l=this.plugins.findIndex(function(c){return c.name===a}),l===-1?(n.loggerProvider.warn("Plugin with name ".concat(a," does not exist, skipping deregistration")),[2]):(o=this.plugins[l],this.plugins.splice(l,1),[4,(r=o.teardown)===null||r===void 0?void 0:r.call(o)]);case 1:return i.sent(),[2]}})})},t.prototype.reset=function(a){this.applying=!1;var n=this.plugins;n.map(function(r){var l;return(l=r.teardown)===null||l===void 0?void 0:l.call(r)}),this.plugins=[],this.client=a},t.prototype.push=function(a){var n=this;return new Promise(function(r){n.queue.push([a,r]),n.scheduleApply(0)})},t.prototype.scheduleApply=function(a){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},a))},t.prototype.apply=function(a){return H0(this,void 0,void 0,function(){var n,r,l,o,i,c,u,Z,H,d,h,f,A,Z,H,y,b,S,_,w,T,N;return M0(this,function(P){switch(P.label){case 0:if(!a)return[2];n=wt(a,1),r=n[0],l=wt(a,2),o=l[1],i=this.plugins.filter(function(x){return x.type===E4.BEFORE}),P.label=1;case 1:P.trys.push([1,6,7,8]),c=Yo(i),u=c.next(),P.label=2;case 2:return u.done?[3,5]:(Z=u.value,[4,Z.execute(q({},r))]);case 3:if(H=P.sent(),H===null)return o({event:r,code:0,message:""}),[2];r=H,P.label=4;case 4:return u=c.next(),[3,2];case 5:return[3,8];case 6:return d=P.sent(),_={error:d},[3,8];case 7:try{u&&!u.done&&(w=c.return)&&w.call(c)}finally{if(_)throw _.error}return[7];case 8:h=this.plugins.filter(function(x){return x.type===E4.ENRICHMENT}),P.label=9;case 9:P.trys.push([9,14,15,16]),f=Yo(h),A=f.next(),P.label=10;case 10:return A.done?[3,13]:(Z=A.value,[4,Z.execute(q({},r))]);case 11:if(H=P.sent(),H===null)return o({event:r,code:0,message:""}),[2];r=H,P.label=12;case 12:return A=f.next(),[3,10];case 13:return[3,16];case 14:return y=P.sent(),T={error:y},[3,16];case 15:try{A&&!A.done&&(N=f.return)&&N.call(f)}finally{if(T)throw T.error}return[7];case 16:return b=this.plugins.filter(function(x){return x.type===E4.DESTINATION}),S=b.map(function(x){var z=q({},r);return x.execute(z).catch(function(Y){return dp(z,0,String(Y))})}),Promise.all(S).then(function(x){var z=wt(x,1),Y=z[0];o(Y)}),[2]}})})},t.prototype.flush=function(){return H0(this,void 0,void 0,function(){var a,n,r,l=this;return M0(this,function(o){switch(o.label){case 0:return a=this.queue,this.queue=[],[4,Promise.all(a.map(function(i){return l.apply(i)}))];case 1:return o.sent(),n=this.plugins.filter(function(i){return i.type===E4.DESTINATION}),r=n.map(function(i){return i.flush&&i.flush()}),[4,Promise.all(r)];case 2:return o.sent(),[2]}})})},t}(),gv1="Event tracked successfully",Zv1="Unexpected error occurred",Hv1="Event rejected due to exceeded retry count",Mv1="Event skipped due to optOut config",Ev1="Event rejected due to missing API key",Vv1="Invalid API key",yv1="Client not initialized",Mr=function(t){return{promise:t||Promise.resolve()}},bv1=function(){function t(a){a===void 0&&(a="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Av1(this),this.name=a}return t.prototype._init=function(a){return H0(this,void 0,void 0,function(){return M0(this,function(n){switch(n.label){case 0:return this.config=a,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return n.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(a){return H0(this,void 0,void 0,function(){var n,r,l,o,i,c,u;return M0(this,function(d){switch(d.label){case 0:n=this[a],this[a]=[],d.label=1;case 1:d.trys.push([1,6,7,8]),r=Yo(n),l=r.next(),d.label=2;case 2:return l.done?[3,5]:(o=l.value,[4,o()]);case 3:d.sent(),d.label=4;case 4:return l=r.next(),[3,2];case 5:return[3,8];case 6:return i=d.sent(),c={error:i},[3,8];case 7:try{l&&!l.done&&(u=r.return)&&u.call(r)}finally{if(c)throw c.error}return[7];case 8:return[2]}})})},t.prototype.track=function(a,n,r){var l=dv1(a,n,r);return Mr(this.dispatch(l))},t.prototype.identify=function(a,n){var r=hv1(a,n);return Mr(this.dispatch(r))},t.prototype.groupIdentify=function(a,n,r,l){var o=pv1(a,n,r,l);return Mr(this.dispatch(o))},t.prototype.setGroup=function(a,n,r){var l=fv1(a,n,r);return Mr(this.dispatch(l))},t.prototype.revenue=function(a,n){var r=vv1(a,n);return Mr(this.dispatch(r))},t.prototype.add=function(a){return this.config?Mr(this.timeline.register(a,this.config)):(this.q.push(this.add.bind(this,a)),Mr())},t.prototype.remove=function(a){return this.config?Mr(this.timeline.deregister(a,this.config)):(this.q.push(this.remove.bind(this,a)),Mr())},t.prototype.dispatchWithCallback=function(a,n){if(!this.config)return n(dp(a,0,yv1));this.process(a).then(n)},t.prototype.dispatch=function(a){return H0(this,void 0,void 0,function(){var n=this;return M0(this,function(r){return this.config?[2,this.process(a)]:[2,new Promise(function(l){n.dispatchQ.push(n.dispatchWithCallback.bind(n,a,l))})]})})},t.prototype.process=function(a){return H0(this,void 0,void 0,function(){var l,n,r,l;return M0(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,dp(a,0,Mv1)]:[4,this.timeline.push(a)];case 1:return l=o.sent(),l.code===200?this.config.loggerProvider.log(l.message):this.config.loggerProvider.error(l.message),[2,l];case 2:return n=o.sent(),this.config.loggerProvider.error(n),r=String(n),l=dp(a,0,r),[2,l];case 3:return[2]}})})},t.prototype.setOptOut=function(a){if(!this.config){this.q.push(this.setOptOut.bind(this,!!a));return}this.config.optOut=!!a},t.prototype.flush=function(){return Mr(this.timeline.flush())},t}(),Lv1=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(a){return this.productId=a,this},t.prototype.setQuantity=function(a){return a>0&&(this.quantity=a),this},t.prototype.setPrice=function(a){return this.price=a,this},t.prototype.setRevenueType=function(a){return this.revenueType=a,this},t.prototype.setCurrency=function(a){return this.currency=a,this},t.prototype.setRevenue=function(a){return this.revenue=a,this},t.prototype.setEventProperties=function(a){return WP(a)&&(this.properties=a),this},t.prototype.getEventProperties=function(){var a=this.properties?q({},this.properties):{};return a[Hi.REVENUE_PRODUCT_ID]=this.productId,a[Hi.REVENUE_QUANTITY]=this.quantity,a[Hi.REVENUE_PRICE]=this.price,a[Hi.REVENUE_TYPE]=this.revenueType,a[Hi.REVENUE_CURRENCY]=this.currency,a[Hi.REVENUE]=this.revenue,a},t}(),Sv1=function(t,a){var n=Math.max(a,1);return t.reduce(function(r,l,o){var i=Math.floor(o/n);return r[i]||(r[i]=[]),r[i].push(l),r},[])},FM="Amplitude Logger ",Fv1=function(){function t(){this.logLevel=Hr.None}return t.prototype.disable=function(){this.logLevel=Hr.None},t.prototype.enable=function(a){a===void 0&&(a=Hr.Warn),this.logLevel=a},t.prototype.log=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Verbose||console.log("".concat(FM,"[Log]: ").concat(a.join(" ")))},t.prototype.warn=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Warn||console.warn("".concat(FM,"[Warn]: ").concat(a.join(" ")))},t.prototype.error=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Error||console.error("".concat(FM,"[Error]: ").concat(a.join(" ")))},t.prototype.debug=function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this.logLevel<Hr.Debug||console.log("".concat(FM,"[Debug]: ").concat(a.join(" ")))},t}(),_M=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:Hr.Warn,loggerProvider:new Fv1,optOut:!1,serverUrl:nE0,serverZone:LM.US,useBatch:!1}},_v1=function(){function t(a){var n,r,l,o;this._optOut=!1;var i=_M();this.apiKey=a.apiKey,this.flushIntervalMillis=(n=a.flushIntervalMillis)!==null&&n!==void 0?n:i.flushIntervalMillis,this.flushMaxRetries=a.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=a.flushQueueSize||i.flushQueueSize,this.instanceName=a.instanceName||i.instanceName,this.loggerProvider=a.loggerProvider||i.loggerProvider,this.logLevel=(r=a.logLevel)!==null&&r!==void 0?r:i.logLevel,this.minIdLength=a.minIdLength,this.plan=a.plan,this.ingestionMetadata=a.ingestionMetadata,this.optOut=(l=a.optOut)!==null&&l!==void 0?l:i.optOut,this.serverUrl=a.serverUrl,this.serverZone=a.serverZone||i.serverZone,this.storageProvider=a.storageProvider,this.transportProvider=a.transportProvider,this.useBatch=(o=a.useBatch)!==null&&o!==void 0?o:i.useBatch,this.loggerProvider.enable(this.logLevel);var c=lE0(a.serverUrl,a.serverZone,a.useBatch);this.serverZone=c.serverZone,this.serverUrl=c.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(a){this._optOut=a},enumerable:!1,configurable:!0}),t}(),kv1=function(t,a){return t===LM.EU?a?uv1:cv1:a?sv1:nE0},lE0=function(t,a,n){if(t===void 0&&(t=""),a===void 0&&(a=_M().serverZone),n===void 0&&(n=_M().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=["US","EU"].includes(a)?a:_M().serverZone;return{serverZone:r,serverUrl:kv1(r,n)}};function wv1(t){return t instanceof Error?t.message:String(t)}function kM(t){var a="";try{"body"in t&&(a=JSON.stringify(t.body))}catch{}return a}var Cv1=function(){function t(){this.name="amplitude",this.type=E4.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(a){var n;return H0(this,void 0,void 0,function(){var r,l=this;return M0(this,function(o){switch(o.label){case 0:return this.config=a,this.storageKey="".concat(iv1,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=o.sent(),this.saveEvents(),r&&r.length>0&&Promise.all(r.map(function(i){return l.execute(i)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(a){var n=this;return new Promise(function(r){var l={event:a,attempts:0,callback:function(o){return r(o)},timeout:0};n.addToQueue(l)})},t.prototype.addToQueue=function(){for(var a=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var l=n.filter(function(o){return o.attempts<a.config.flushMaxRetries?(o.attempts+=1,!0):(a.fulfillRequest([o],500,Hv1),!1)});l.forEach(function(o){if(a.queue=a.queue.concat(o),o.timeout===0){a.schedule(a.config.flushIntervalMillis);return}setTimeout(function(){o.timeout=0,a.schedule(0)},o.timeout)}),this.saveEvents()},t.prototype.schedule=function(a){var n=this;this.scheduled||(this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(a)})},a))},t.prototype.flush=function(a){return a===void 0&&(a=!1),H0(this,void 0,void 0,function(){var n,r,l,o=this;return M0(this,function(i){switch(i.label){case 0:return n=[],r=[],this.queue.forEach(function(c){return c.timeout===0?n.push(c):r.push(c)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),l=Sv1(n,this.config.flushQueueSize),[4,Promise.all(l.map(function(c){return o.send(c,a)}))];case 1:return i.sent(),[2]}})})},t.prototype.send=function(a,n){return n===void 0&&(n=!0),H0(this,void 0,void 0,function(){var r,l,o,i,c;return M0(this,function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(a,400,Ev1)];r={api_key:this.config.apiKey,events:a.map(function(d){var h=d.event;h.extra;var f=Gt(h,["extra"]);return f}),options:{min_id_length:this.config.minIdLength}},u.label=1;case 1:return u.trys.push([1,3,,4]),l=lE0(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(l,r)];case 2:return o=u.sent(),o===null?(this.fulfillRequest(a,0,Zv1),[2]):n?(this.handleResponse(o,a),[3,4]):("body"in o?this.fulfillRequest(a,o.statusCode,"".concat(o.status,": ").concat(kM(o))):this.fulfillRequest(a,o.statusCode,o.status),[2]);case 3:return i=u.sent(),this.config.loggerProvider.error(i),c=wv1(i),this.fulfillRequest(a,0,c),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(a,n){var r=a.status;switch(r){case z2.Success:{this.handleSuccessResponse(a,n);break}case z2.Invalid:{this.handleInvalidResponse(a,n);break}case z2.PayloadTooLarge:{this.handlePayloadTooLargeResponse(a,n);break}case z2.RateLimit:{this.handleRateLimitResponse(a,n);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(r,"' provided for ").concat(n.length,' events"}')),this.handleOtherResponse(n);break}}},t.prototype.handleSuccessResponse=function(a,n){this.fulfillRequest(n,a.statusCode,gv1)},t.prototype.handleInvalidResponse=function(a,n){var r=this;if(a.body.missingField||a.body.error.startsWith(Vv1)){this.fulfillRequest(n,a.statusCode,a.body.error);return}var l=K1(K1(K1(K1([],wt(Object.values(a.body.eventsWithInvalidFields)),!1),wt(Object.values(a.body.eventsWithMissingFields)),!1),wt(Object.values(a.body.eventsWithInvalidIdLengths)),!1),wt(a.body.silencedEvents),!1).flat(),o=new Set(l),i=n.filter(function(c,u){if(o.has(u)){r.fulfillRequest([c],a.statusCode,a.body.error);return}return!0});i.length>0&&this.config.loggerProvider.warn(kM(a)),this.addToQueue.apply(this,K1([],wt(i),!1))},t.prototype.handlePayloadTooLargeResponse=function(a,n){if(n.length===1){this.fulfillRequest(n,a.statusCode,a.body.error);return}this.config.loggerProvider.warn(kM(a)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,K1([],wt(n),!1))},t.prototype.handleRateLimitResponse=function(a,n){var r=this,l=Object.keys(a.body.exceededDailyQuotaUsers),o=Object.keys(a.body.exceededDailyQuotaDevices),i=a.body.throttledEvents,c=new Set(l),u=new Set(o),d=new Set(i),h=n.filter(function(f,A){if(f.event.user_id&&c.has(f.event.user_id)||f.event.device_id&&u.has(f.event.device_id)){r.fulfillRequest([f],a.statusCode,a.body.error);return}return d.has(A)&&(f.timeout=r.throttleTimeout),!0});h.length>0&&this.config.loggerProvider.warn(kM(a)),this.addToQueue.apply(this,K1([],wt(h),!1))},t.prototype.handleOtherResponse=function(a){var n=this;this.addToQueue.apply(this,K1([],wt(a.map(function(r){return r.timeout=r.attempts*n.retryTimeout,r})),!1))},t.prototype.fulfillRequest=function(a,n,r){this.saveEvents(),a.forEach(function(l){return l.callback(dp(l.event,n,r))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var a=Array.from(this.queue.map(function(n){return n.event}));this.config.storageProvider.set(this.storageKey,a)}},t}(),Nv1=function(t){var a=new Error().stack||"";return a.split(`
1953
1953
  `).slice(2+t).map(function(n){return n.trim()})},$t=function(t){return function(){var a=q({},t.config),n=a.loggerProvider,r=a.logLevel;return{logger:n,logLevel:r}}},Pv1=function(t,a){var n,r;a=a.replace(/\[(\w+)\]/g,".$1"),a=a.replace(/^\./,"");try{for(var l=Yo(a.split(".")),o=l.next();!o.done;o=l.next()){var i=o.value;if(i in t)t=t[i];else return}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return t},It=function(t,a){return function(){var n,r,l={};try{for(var o=Yo(a),i=o.next();!i.done;i=o.next()){var c=i.value;l[c]=Pv1(t,c)}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return l}},Ot=function(t,a,n,r,l){return l===void 0&&(l=null),function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var c=n(),u=c.logger,d=c.logLevel;if(d&&d<Hr.Debug||!d||!u)return t.apply(l,o);var h={type:"invoke public method",name:a,args:o,stacktrace:Nv1(1),time:{start:new Date().toISOString()},states:{}};r&&h.states&&(h.states.before=r());var f=t.apply(l,o);return f&&f.promise?f.promise.then(function(){r&&h.states&&(h.states.after=r()),h.time&&(h.time.end=new Date().toISOString()),u.debug(JSON.stringify(h,null,2))}):(r&&h.states&&(h.states.after=r()),h.time&&(h.time.end=new Date().toISOString()),u.debug(JSON.stringify(h,null,2))),f}},wM=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,wM)},oE0=function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return H0(this,void 0,void 0,function(){return M0(this,function(a){return[2,!0]})})},t.prototype.get=function(a){return H0(this,void 0,void 0,function(){return M0(this,function(n){return[2,this.memoryStorage.get(a)]})})},t.prototype.getRaw=function(a){return H0(this,void 0,void 0,function(){var n;return M0(this,function(r){switch(r.label){case 0:return[4,this.get(a)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},t.prototype.set=function(a,n){return H0(this,void 0,void 0,function(){return M0(this,function(r){return this.memoryStorage.set(a,n),[2]})})},t.prototype.remove=function(a){return H0(this,void 0,void 0,function(){return M0(this,function(n){return this.memoryStorage.delete(a),[2]})})},t.prototype.reset=function(){return H0(this,void 0,void 0,function(){return M0(this,function(a){return this.memoryStorage.clear(),[2]})})},t}(),iE0=function(){function t(){}return t.prototype.send=function(a,n){return Promise.resolve(null)},t.prototype.buildResponse=function(a){var n,r,l,o,i,c,u,d,h,f,A,Z,H,y,b,S,_,w,T,N,P,x;if(typeof a!="object")return null;var z=a.code||0,Y=this.buildStatus(z);switch(Y){case z2.Success:return{status:Y,statusCode:z,body:{eventsIngested:(n=a.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=a.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(l=a.server_upload_time)!==null&&l!==void 0?l:0}};case z2.Invalid:return{status:Y,statusCode:z,body:{error:(o=a.error)!==null&&o!==void 0?o:"",missingField:(i=a.missing_field)!==null&&i!==void 0?i:"",eventsWithInvalidFields:(c=a.events_with_invalid_fields)!==null&&c!==void 0?c:{},eventsWithMissingFields:(u=a.events_with_missing_fields)!==null&&u!==void 0?u:{},eventsWithInvalidIdLengths:(d=a.events_with_invalid_id_lengths)!==null&&d!==void 0?d:{},epsThreshold:(h=a.eps_threshold)!==null&&h!==void 0?h:0,exceededDailyQuotaDevices:(f=a.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(A=a.silenced_devices)!==null&&A!==void 0?A:[],silencedEvents:(Z=a.silenced_events)!==null&&Z!==void 0?Z:[],throttledDevices:(H=a.throttled_devices)!==null&&H!==void 0?H:{},throttledEvents:(y=a.throttled_events)!==null&&y!==void 0?y:[]}};case z2.PayloadTooLarge:return{status:Y,statusCode:z,body:{error:(b=a.error)!==null&&b!==void 0?b:""}};case z2.RateLimit:return{status:Y,statusCode:z,body:{error:(S=a.error)!==null&&S!==void 0?S:"",epsThreshold:(_=a.eps_threshold)!==null&&_!==void 0?_:0,throttledDevices:(w=a.throttled_devices)!==null&&w!==void 0?w:{},throttledUsers:(T=a.throttled_users)!==null&&T!==void 0?T:{},exceededDailyQuotaDevices:(N=a.exceeded_daily_quota_devices)!==null&&N!==void 0?N:{},exceededDailyQuotaUsers:(P=a.exceeded_daily_quota_users)!==null&&P!==void 0?P:{},throttledEvents:(x=a.throttled_events)!==null&&x!==void 0?x:[]}};case z2.Timeout:default:return{status:Y,statusCode:z}}},t.prototype.buildStatus=function(a){return a>=200&&a<300?z2.Success:a===429?z2.RateLimit:a===413?z2.PayloadTooLarge:a===408?z2.Timeout:a>=400&&a<500?z2.Invalid:a>=500?z2.Failed:z2.Unknown},t}(),Tv1=function(){function t(){}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:$v1(),platform:"Web",os:void 0,deviceModel:void 0}},t}(),$v1=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Iv1=function(){function t(){this.queue=[]}return t.prototype.logEvent=function(a){this.receiver?this.receiver(a):this.queue.length<512&&this.queue.push(a)},t.prototype.setEventReceiver=function(a){this.receiver=a,this.queue.length>0&&(this.queue.forEach(function(n){a(n)}),this.queue=[])},t}(),Mi=function(){return Mi=Object.assign||function(a){for(var n,r=1,l=arguments.length;r<l;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(a[o]=n[o])}return a},Mi.apply(this,arguments)};function CM(t){var a=typeof Symbol=="function"&&Symbol.iterator,n=a&&t[a],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function cE0(t,a){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),l,o=[],i;try{for(;(a===void 0||a-- >0)&&!(l=r.next()).done;)o.push(l.value)}catch(c){i={error:c}}finally{try{l&&!l.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o}typeof SuppressedError=="function"&&SuppressedError;var NM=function(t,a){var n,r,l=["string","number","boolean","undefined"],o=typeof t,i=typeof a;if(o!==i)return!1;try{for(var c=CM(l),u=c.next();!u.done;u=c.next()){var d=u.value;if(d===o)return t===a}}catch(b){n={error:b}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(t==null&&a==null)return!0;if(t==null||a==null||t.length!==a.length)return!1;var h=Array.isArray(t),f=Array.isArray(a);if(h!==f)return!1;if(h&&f){for(var A=0;A<t.length;A++)if(!NM(t[A],a[A]))return!1}else{var Z=Object.keys(t).sort(),H=Object.keys(a).sort();if(!NM(Z,H))return!1;var y=!0;return Object.keys(t).forEach(function(b){NM(t[b],a[b])||(y=!1)}),y}return!0},Ov1="$set",xv1="$unset",jv1="$clearAll";Object.entries||(Object.entries=function(t){for(var a=Object.keys(t),n=a.length,r=new Array(n);n--;)r[n]=[a[n],t[a[n]]];return r});var Rv1=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var a=this,n=Mi({},this.identity.userProperties),r=Mi(Mi({},this.identity),{userProperties:n});return{setUserId:function(l){return r.userId=l,this},setDeviceId:function(l){return r.deviceId=l,this},setUserProperties:function(l){return r.userProperties=l,this},setOptOut:function(l){return r.optOut=l,this},updateUserProperties:function(l){var o,i,c,u,d,h,f=r.userProperties||{};try{for(var A=CM(Object.entries(l)),Z=A.next();!Z.done;Z=A.next()){var H=cE0(Z.value,2),y=H[0],b=H[1];switch(y){case Ov1:try{for(var S=(c=void 0,CM(Object.entries(b))),_=S.next();!_.done;_=S.next()){var w=cE0(_.value,2),T=w[0],N=w[1];f[T]=N}}catch(z){c={error:z}}finally{try{_&&!_.done&&(u=S.return)&&u.call(S)}finally{if(c)throw c.error}}break;case xv1:try{for(var P=(d=void 0,CM(Object.keys(b))),x=P.next();!x.done;x=P.next()){var T=x.value;delete f[T]}}catch(z){d={error:z}}finally{try{x&&!x.done&&(h=P.return)&&h.call(P)}finally{if(d)throw d.error}}break;case jv1:f={};break}}}catch(z){o={error:z}}finally{try{Z&&!Z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}return r.userProperties=f,this},commit:function(){return a.setIdentity(r),this}}},t.prototype.getIdentity=function(){return Mi({},this.identity)},t.prototype.setIdentity=function(a){var n=Mi({},this.identity);this.identity=Mi({},a),NM(n,this.identity)||this.listeners.forEach(function(r){r(a)})},t.prototype.addIdentityListener=function(a){this.listeners.add(a)},t.prototype.removeIdentityListener=function(a){this.listeners.delete(a)},t}(),hp=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,Dv1=function(){function t(){this.identityStore=new Rv1,this.eventBridge=new Iv1,this.applicationContextProvider=new Tv1}return t.getInstance=function(a){return hp.analyticsConnectorInstances||(hp.analyticsConnectorInstances={}),hp.analyticsConnectorInstances[a]||(hp.analyticsConnectorInstances[a]=new t),hp.analyticsConnectorInstances[a]},t}(),W9=function(t){return t===void 0&&(t="$default_instance"),Dv1.getInstance(t)},zv1=function(t,a){W9(a).identityStore.editIdentity().setUserId(t).commit()},Uv1=function(t,a){W9(a).identityStore.editIdentity().setDeviceId(t).commit()},Bv1=function(t,a){W9(a).identityStore.editIdentity().setOptOut(t).commit()},Er=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},YP=function(){var t,a=Er();if(!(!((t=a==null?void 0:a.location)===null||t===void 0)&&t.search))return{};var n=a.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(l,o){var i=o.split("=",2),c=sE0(i[0]),u=sE0(i[1]);return u&&(l[c]=u),l},{});return r},sE0=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}},qv1="utm_campaign",Wv1="utm_content",Gv1="utm_id",Yv1="utm_medium",Kv1="utm_source",Qv1="utm_term",uE0="dclid",mE0="fbclid",dE0="gbraid",hE0="gclid",pE0="ko_click_id",fE0="li_fat_id",vE0="msclkid",AE0="rtd_cid",gE0="ttclid",ZE0="twclid",HE0="wbraid",KP={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},ME0=function(){function t(){}return t.prototype.parse=function(){return H0(this,void 0,void 0,function(){return M0(this,function(a){return[2,q(q(q(q({},KP),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var a=YP(),n=a[qv1],r=a[Wv1],l=a[Gv1],o=a[Yv1],i=a[Kv1],c=a[Qv1];return{utm_campaign:n,utm_content:r,utm_id:l,utm_medium:o,utm_source:i,utm_term:c}},t.prototype.getReferrer=function(){var a,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(a=r.referrer)===null||a===void 0?void 0:a.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},t.prototype.getClickIds=function(){var a,n=YP();return a={},a[uE0]=n[uE0],a[mE0]=n[mE0],a[dE0]=n[dE0],a[hE0]=n[hE0],a[pE0]=n[pE0],a[fE0]=n[fE0],a[vE0]=n[vE0],a[AE0]=n[AE0],a[gE0]=n[gE0],a[ZE0]=n[ZE0],a[HE0]=n[HE0],a},t}(),EE0="AMP",Xv1=function(){function t(){}return t.prototype.send=function(a,n){return Promise.resolve(null)},t.prototype.buildResponse=function(a){var n,r,l,o,i,c,u,d,h,f,A,Z,H,y,b,S,_,w,T,N,P,x;if(typeof a!="object")return null;var z=a.code||0,Y=this.buildStatus(z);switch(Y){case z2.Success:return{status:Y,statusCode:z,body:{eventsIngested:(n=a.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=a.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(l=a.server_upload_time)!==null&&l!==void 0?l:0}};case z2.Invalid:return{status:Y,statusCode:z,body:{error:(o=a.error)!==null&&o!==void 0?o:"",missingField:(i=a.missing_field)!==null&&i!==void 0?i:"",eventsWithInvalidFields:(c=a.events_with_invalid_fields)!==null&&c!==void 0?c:{},eventsWithMissingFields:(u=a.events_with_missing_fields)!==null&&u!==void 0?u:{},eventsWithInvalidIdLengths:(d=a.events_with_invalid_id_lengths)!==null&&d!==void 0?d:{},epsThreshold:(h=a.eps_threshold)!==null&&h!==void 0?h:0,exceededDailyQuotaDevices:(f=a.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(A=a.silenced_devices)!==null&&A!==void 0?A:[],silencedEvents:(Z=a.silenced_events)!==null&&Z!==void 0?Z:[],throttledDevices:(H=a.throttled_devices)!==null&&H!==void 0?H:{},throttledEvents:(y=a.throttled_events)!==null&&y!==void 0?y:[]}};case z2.PayloadTooLarge:return{status:Y,statusCode:z,body:{error:(b=a.error)!==null&&b!==void 0?b:""}};case z2.RateLimit:return{status:Y,statusCode:z,body:{error:(S=a.error)!==null&&S!==void 0?S:"",epsThreshold:(_=a.eps_threshold)!==null&&_!==void 0?_:0,throttledDevices:(w=a.throttled_devices)!==null&&w!==void 0?w:{},throttledUsers:(T=a.throttled_users)!==null&&T!==void 0?T:{},exceededDailyQuotaDevices:(N=a.exceeded_daily_quota_devices)!==null&&N!==void 0?N:{},exceededDailyQuotaUsers:(P=a.exceeded_daily_quota_users)!==null&&P!==void 0?P:{},throttledEvents:(x=a.throttled_events)!==null&&x!==void 0?x:[]}};case z2.Timeout:default:return{status:Y,statusCode:z}}},t.prototype.buildStatus=function(a){return a>=200&&a<300?z2.Success:a===429?z2.RateLimit:a===413?z2.PayloadTooLarge:a===408?z2.Timeout:a>=400&&a<500?z2.Invalid:a>=500?z2.Failed:z2.Unknown},t}(),VE0=function(t,a,n){return a===void 0&&(a=""),n===void 0&&(n=10),[EE0,a,t.substring(0,n)].filter(Boolean).join("_")},Jv1=function(t){return"".concat(EE0.toLowerCase(),"_").concat(t.substring(0,6))},eA1=function(t){return typeof t=="boolean"?t:!!(t!=null&&t.fileDownloads)},tA1=function(t){return typeof t=="boolean"?t:!!(t!=null&&t.formInteractions)},aA1=function(t){return typeof t=="boolean"?t:!!((t==null?void 0:t.pageViews)===!0||t!=null&&t.pageViews&&typeof t.pageViews=="object")},nA1=function(t){return typeof t=="boolean"?t:!!(t!=null&&t.sessions)},rA1=function(t){var a,n=!((a=t.attribution)===null||a===void 0)&&a.trackPageViews?"attribution":function(){return!1},r=void 0,l="Page View",o=aA1(t.defaultTracking);return o&&(n=void 0,l=void 0,t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.pageViews&&typeof t.defaultTracking.pageViews=="object"&&("trackOn"in t.defaultTracking.pageViews&&(n=t.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in t.defaultTracking.pageViews&&(r=t.defaultTracking.pageViews.trackHistoryChanges),"eventType"in t.defaultTracking.pageViews&&t.defaultTracking.pageViews.eventType&&(l=t.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:l}},lA1=function(){var t,a,n,r;if(typeof navigator>"u")return"";var l=navigator.userLanguage;return(r=(n=(a=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&a!==void 0?a:navigator.language)!==null&&n!==void 0?n:l)!==null&&r!==void 0?r:""},oA1=function(){function t(){this.name="identity",this.type=E4.BEFORE,this.identityStore=W9().identityStore}return t.prototype.execute=function(a){return H0(this,void 0,void 0,function(){var n;return M0(this,function(r){return n=a.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,a]})})},t.prototype.setup=function(a){return H0(this,void 0,void 0,function(){return M0(this,function(n){return a.instanceName&&(this.identityStore=W9(a.instanceName).identityStore),[2]})})},t}(),QP=function(){function t(a){this.options=q({},a)}return t.prototype.isEnabled=function(){return H0(this,void 0,void 0,function(){var a,n,r;return M0(this,function(l){switch(l.label){case 0:if(!Er())return[2,!1];t.testValue=String(Date.now()),a=new t(this.options),n="AMP_TEST",l.label=1;case 1:return l.trys.push([1,4,5,7]),[4,a.set(n,t.testValue)];case 2:return l.sent(),[4,a.get(n)];case 3:return r=l.sent(),[2,r===t.testValue];case 4:return l.sent(),[2,!1];case 5:return[4,a.remove(n)];case 6:return l.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(a){return H0(this,void 0,void 0,function(){var n;return M0(this,function(r){switch(r.label){case 0:return[4,this.getRaw(a)];case 1:if(n=r.sent(),!n)return[2,void 0];try{try{n=decodeURIComponent(atob(n))}catch{}return[2,JSON.parse(n)]}catch{return[2,void 0]}return[2]}})})},t.prototype.getRaw=function(a){var n;return H0(this,void 0,void 0,function(){var r,l,o;return M0(this,function(i){return r=Er(),l=(n=r==null?void 0:r.document.cookie.split("; "))!==null&&n!==void 0?n:[],o=l.find(function(c){return c.indexOf(a+"=")===0}),o?[2,o.substring(a.length+1)]:[2,void 0]})})},t.prototype.set=function(a,n){var r;return H0(this,void 0,void 0,function(){var l,o,i,c,u,d;return M0(this,function(h){try{l=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,o=n!==null?l:-1,i=void 0,o&&(c=new Date,c.setTime(c.getTime()+o*24*60*60*1e3),i=c),u="".concat(a,"=").concat(btoa(encodeURIComponent(JSON.stringify(n)))),i&&(u+="; expires=".concat(i.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),d=Er(),d&&(d.document.cookie=u)}catch{}return[2]})})},t.prototype.remove=function(a){return H0(this,void 0,void 0,function(){return M0(this,function(n){switch(n.label){case 0:return[4,this.set(a,null)];case 1:return n.sent(),[2]}})})},t.prototype.reset=function(){return H0(this,void 0,void 0,function(){return M0(this,function(a){return[2]})})},t}(),iA1=function(t){Ke(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}return a.prototype.send=function(n,r){return H0(this,void 0,void 0,function(){var l,o,i;return M0(this,function(c){switch(c.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return l={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(r),method:"POST"},[4,fetch(n,l)];case 1:return o=c.sent(),[4,o.text()];case 2:i=c.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},a}(Xv1),cA1=function(t){var a={};for(var n in t){var r=t[n];r&&(a[n]=r)}return a},sA1=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var n,r={},l=Er(),o=void 0,i,c=wt(t,2),u=c[0],d=c[1];u&&"init"in u?(n=u,d&&(r=d)):u&&(r=u);var h=function(){return H0(void 0,void 0,void 0,function(){var b,S,_;return M0(this,function(w){switch(w.label){case 0:return S={event_type:(_=r.eventType)!==null&&_!==void 0?_:"Page View"},b=[{}],[4,uA1()];case 1:return[2,(S.event_properties=q.apply(void 0,[q.apply(void 0,b.concat([w.sent()])),{page_domain:typeof location<"u"&&location.hostname||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||"",page_title:typeof document<"u"&&document.title||"",page_url:typeof location<"u"&&location.href.split("?")[0]||""}]),S)]}})})},f=function(){return typeof r.trackOn>"u"||typeof r.trackOn=="function"&&r.trackOn()},A=typeof location<"u"?location.href:null,Z=function(){return H0(void 0,void 0,void 0,function(){var b,S,_,w;return M0(this,function(T){switch(T.label){case 0:return b=location.href,S=dA1(r.trackHistoryChanges,b,A||"")&&f(),A=b,S?(o==null||o.log("Tracking page view event"),n!=null?[3,1]:[3,3]):[3,4];case 1:return w=(_=n).track,[4,h()];case 2:w.apply(_,[T.sent()]),T.label=3;case 3:T.label=4;case 4:return[2]}})})},H=function(){Z()},y={name:"page-view-tracking",type:E4.ENRICHMENT,setup:function(b,S){return H0(void 0,void 0,void 0,function(){var _,w,T,N,P;return M0(this,function(x){switch(x.label){case 0:return n=n??S,n?(o=b.loggerProvider,o.log("Installing @amplitude/plugin-page-view-tracking-browser"),r.trackOn=!((N=b.attribution)===null||N===void 0)&&N.trackPageViews?"attribution":r.trackOn,!S&&(!((P=b.attribution)===null||P===void 0)&&P.trackPageViews)&&(o.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser."),b.attribution.trackPageViews=!1),r.trackHistoryChanges&&l&&(l.addEventListener("popstate",H),i=l.history.pushState,l.history.pushState=new Proxy(l.history.pushState,{apply:function(z,Y,j){var X=wt(j,3),G=X[0],t0=X[1],o0=X[2];z.apply(Y,[G,t0,o0]),Z()}})),f()?(o.log("Tracking page view event"),T=(w=n).track,[4,h()]):[3,2]):(_=u?"Options":"undefined",b.loggerProvider.error("Argument of type '".concat(_,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:T.apply(w,[x.sent()]),x.label=2;case 2:return[2]}})})},execute:function(b){return H0(void 0,void 0,void 0,function(){var S;return M0(this,function(_){switch(_.label){case 0:return r.trackOn==="attribution"&&mA1(b)?(o==null||o.log("Enriching campaign event to page view event with campaign parameters"),[4,h()]):[3,2];case 1:S=_.sent(),b.event_type=S.event_type,b.event_properties=q(q({},b.event_properties),S.event_properties),_.label=2;case 2:return[2,b]}})})},teardown:function(){return H0(void 0,void 0,void 0,function(){return M0(this,function(b){return l&&(l.removeEventListener("popstate",H),i&&(l.history.pushState=i)),[2]})})}};return y.__trackHistoryPageView=Z,y},uA1=function(){return H0(void 0,void 0,void 0,function(){var t;return M0(this,function(a){switch(a.label){case 0:return t=cA1,[4,new ME0().parse()];case 1:return[2,t.apply(void 0,[a.sent()])]}})})},mA1=function(t){if(t.event_type==="$identify"&&t.user_properties){var a=t.user_properties,n=a[$2.SET]||{},r=a[$2.UNSET]||{},l=K1(K1([],wt(Object.keys(n)),!1),wt(Object.keys(r)),!1);return Object.keys(KP).every(function(o){return l.includes(o)})}return!1},dA1=function(t,a,n){switch(t){case"pathOnly":return a.split("?")[0]!==n.split("?")[0];default:return a!==n}},yE0="-",hA1="AMP",pA1=1e3,bE0=function(t){if(Object.keys(t).length>pA1)return!1;for(var a in t){var n=t[a];if(!LE0(a,n))return!1}return!0},LE0=function(t,a){var n,r;if(typeof t!="string")return!1;if(Array.isArray(a)){var l=!0;try{for(var o=Yo(a),i=o.next();!i.done;i=o.next()){var c=i.value;if(Array.isArray(c))return!1;if(typeof c=="object")l=l&&bE0(c);else if(!["number","string"].includes(typeof c))return!1;if(!l)return!1}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(a==null)return!1;if(typeof a=="object")return bE0(a);if(!["number","string","boolean"].includes(typeof a))return!1}return!0},fA1=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return q({},this._properties)},t.prototype.set=function(a,n){return this._safeSet($2.SET,a,n),this},t.prototype.setOnce=function(a,n){return this._safeSet($2.SET_ONCE,a,n),this},t.prototype.append=function(a,n){return this._safeSet($2.APPEND,a,n),this},t.prototype.prepend=function(a,n){return this._safeSet($2.PREPEND,a,n),this},t.prototype.postInsert=function(a,n){return this._safeSet($2.POSTINSERT,a,n),this},t.prototype.preInsert=function(a,n){return this._safeSet($2.PREINSERT,a,n),this},t.prototype.remove=function(a,n){return this._safeSet($2.REMOVE,a,n),this},t.prototype.add=function(a,n){return this._safeSet($2.ADD,a,n),this},t.prototype.unset=function(a){return this._safeSet($2.UNSET,a,yE0),this},t.prototype.clearAll=function(){return this._properties={},this._properties[$2.CLEAR_ALL]=yE0,this},t.prototype._safeSet=function(a,n,r){if(this._validate(a,n,r)){var l=this._properties[a];return l===void 0&&(l={},this._properties[a]=l),l[n]=r,this._propertySet.add(n),!0}return!1},t.prototype._validate=function(a,n,r){return this._properties[$2.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:a===$2.ADD?typeof r=="number":a!==$2.UNSET&&a!==$2.REMOVE?LE0(n,r):!0},t}(),vA1=function(t,a){var n=q(q({},a),{event_type:j7.IDENTIFY,user_properties:t.getUserProperties()});return n},AA1=function(t,a,n){return n===void 0&&(n=10),[hA1,a,t.substring(0,n)].filter(Boolean).join("_")},SE0=function(t){var a=t.split(".");return a.length<=2?t:a.slice(a.length-2,a.length).join(".")},gA1=function(t,a,n){var r;t.referrer;var l=t.referring_domain,o=Gt(t,["referrer","referring_domain"]),i=a||{};i.referrer;var c=i.referring_domain,u=Gt(i,["referrer","referring_domain"]);if(t.referring_domain&&(!((r=n.excludeReferrers)===null||r===void 0)&&r.includes(t.referring_domain)))return!1;var d=JSON.stringify(o)!==JSON.stringify(u),h=SE0(l||"")!==SE0(c||"");return!a||d||h},ZA1=function(t,a){var n=q(q({},KP),t),r=Object.entries(n).reduce(function(l,o){var i,c=wt(o,2),u=c[0],d=c[1];return l.setOnce("initial_".concat(u),(i=d??a.initialEmptyValue)!==null&&i!==void 0?i:"EMPTY"),d?l.set(u,d):l.unset(u)},new fA1);return vA1(r)},HA1=function(){for(var t=this,a,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var l,o={},i=wt(n,2),c=i[0],u=i[1];c&&"init"in c?(l=c,u&&(o=u)):c&&(o=c);var d=(a=o.excludeReferrers)!==null&&a!==void 0?a:[];typeof location<"u"&&d.unshift(location.hostname),o=q(q({disabled:!1,initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1},o),{excludeReferrers:d});var h={name:"web-attribution",type:E4.BEFORE,setup:function(f,A){var Z;return H0(this,void 0,void 0,function(){var H,y,b,S,_,w,T,N;return M0(this,function(P){switch(P.label){case 0:return l=l??A,l?o.disabled?(f.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked."),[2]):(f.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser."),!A&&!(!((Z=f.attribution)===null||Z===void 0)&&Z.disabled)&&(f.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser."),f.attribution={disabled:!0}),y=f.cookieStorage,b=AA1(f.apiKey,"MKTG"),[4,Promise.all([new ME0().parse(),y.get(b)])]):(H=c?"Options":"undefined",f.loggerProvider.error("Argument of type '".concat(H,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:return S=wt.apply(void 0,[P.sent(),2]),_=S[0],w=S[1],T=this.__pluginEnabledOverride,(T??gA1(_,w,o))&&(o.resetSessionOnNewCampaign&&(l.setSessionId(Date.now()),f.loggerProvider.log("Created a new session for new campaign.")),f.loggerProvider.log("Tracking attribution."),N=ZA1(_,o),l.track(N),y.set(b,_)),[2]}})})},execute:function(f){return H0(t,void 0,void 0,function(){return M0(this,function(A){return[2,f]})})}};return h.__pluginEnabledOverride=void 0,h},PM=1e3,FE0=function(){function t(a){this.loggerProvider=a==null?void 0:a.loggerProvider}return t.prototype.isEnabled=function(){return H0(this,void 0,void 0,function(){var a,n,r,l;return M0(this,function(o){switch(o.label){case 0:if(!Er())return[2,!1];a=String(Date.now()),n=new t,r="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,n.set(r,a)];case 2:return o.sent(),[4,n.get(r)];case 3:return l=o.sent(),[2,l===a];case 4:return o.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return o.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(a){return H0(this,void 0,void 0,function(){var n;return M0(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(a)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),[2,void 0];case 3:return[2]}})})},t.prototype.getRaw=function(a){var n;return H0(this,void 0,void 0,function(){return M0(this,function(r){return[2,((n=Er())===null||n===void 0?void 0:n.localStorage.getItem(a))||void 0]})})},t.prototype.set=function(a,n){var r,l;return H0(this,void 0,void 0,function(){var o,i,c;return M0(this,function(u){o=Array.isArray(n)&&n.length>PM;try{i=JSON.stringify(o?n.slice(0,PM):n),(r=Er())===null||r===void 0||r.localStorage.setItem(a,i)}catch{}return o&&(c=n.length-PM,(l=this.loggerProvider)===null||l===void 0||l.error("Failed to save ".concat(c," events because the queue length exceeded ").concat(PM,"."))),[2]})})},t.prototype.remove=function(a){var n;return H0(this,void 0,void 0,function(){return M0(this,function(r){try{(n=Er())===null||n===void 0||n.localStorage.removeItem(a)}catch{}return[2]})})},t.prototype.reset=function(){var a;return H0(this,void 0,void 0,function(){return M0(this,function(n){try{(a=Er())===null||a===void 0||a.localStorage.clear()}catch{}return[2]})})},t}(),MA1=function(t){Ke(a,t);function a(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={done:4},n}return a.prototype.send=function(n,r){return H0(this,void 0,void 0,function(){var l=this;return M0(this,function(o){return[2,new Promise(function(i,c){typeof XMLHttpRequest>"u"&&c(new Error("XHRTransport is not supported."));var u=new XMLHttpRequest;u.open("POST",n,!0),u.onreadystatechange=function(){if(u.readyState===l.state.done){var d=u.responseText;try{i(l.buildResponse(JSON.parse(d)))}catch{i(l.buildResponse({code:u.status}))}}},u.setRequestHeader("Content-Type","application/json"),u.setRequestHeader("Accept","*/*"),u.send(JSON.stringify(r))})]})})},a}(iE0),EA1=function(t){Ke(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}return a.prototype.send=function(n,r){return H0(this,void 0,void 0,function(){var l=this;return M0(this,function(o){return[2,new Promise(function(i,c){var u=Er();if(!(u!=null&&u.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var d=JSON.stringify(r),h=u.navigator.sendBeacon(n,JSON.stringify(r));return i(h?l.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:d.length,server_upload_time:Date.now()}):l.buildResponse({code:500}))}catch(f){c(f)}})]})})},a}(iE0),_E0="1.14.0",pp=function(){var t=new oE0,a={deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0};return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionTimeout:30*60*1e3,trackingOptions:a,transportProvider:new iA1}},kE0=function(t){Ke(a,t);function a(n,r){var l=this,o,i,c,u,d,h,f,A,Z,H=pp();return l=t.call(this,q(q({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30,transportProvider:H.transportProvider},r),{apiKey:n}))||this,l.version=_E0,l._optOut=!1,l.cookieStorage=(o=r==null?void 0:r.cookieStorage)!==null&&o!==void 0?o:H.cookieStorage,l.deviceId=r==null?void 0:r.deviceId,l.lastEventId=r==null?void 0:r.lastEventId,l.lastEventTime=r==null?void 0:r.lastEventTime,l.optOut=!!(r!=null&&r.optOut),l.sessionId=r==null?void 0:r.sessionId,l.userId=r==null?void 0:r.userId,l.appVersion=r==null?void 0:r.appVersion,l.attribution=r==null?void 0:r.attribution,l.cookieExpiration=(i=r==null?void 0:r.cookieExpiration)!==null&&i!==void 0?i:H.cookieExpiration,l.cookieSameSite=(c=r==null?void 0:r.cookieSameSite)!==null&&c!==void 0?c:H.cookieSameSite,l.cookieSecure=(u=r==null?void 0:r.cookieSecure)!==null&&u!==void 0?u:H.cookieSecure,l.cookieUpgrade=(d=r==null?void 0:r.cookieUpgrade)!==null&&d!==void 0?d:H.cookieUpgrade,l.defaultTracking=r==null?void 0:r.defaultTracking,l.disableCookies=(h=r==null?void 0:r.disableCookies)!==null&&h!==void 0?h:H.disableCookies,l.defaultTracking=r==null?void 0:r.defaultTracking,l.domain=(f=r==null?void 0:r.domain)!==null&&f!==void 0?f:H.domain,l.partnerId=r==null?void 0:r.partnerId,l.sessionTimeout=(A=r==null?void 0:r.sessionTimeout)!==null&&A!==void 0?A:H.sessionTimeout,l.trackingOptions=(Z=r==null?void 0:r.trackingOptions)!==null&&Z!==void 0?Z:H.trackingOptions,l}return Object.defineProperty(a.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(n){this._lastEventId!==n&&(this._lastEventId=n,this.updateStorage())},enumerable:!1,configurable:!0}),a.prototype.updateStorage=function(){var n,r={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};(n=this.cookieStorage)===null||n===void 0||n.set(VE0(this.apiKey),r)},a}(_v1),VA1=function(t,a){return H0(void 0,void 0,void 0,function(){var n,r,l,o,i,c,u,d,h,f,A,Z,H,y,b;return M0(this,function(S){switch(S.label){case 0:return n=pp(),r=(y=a==null?void 0:a.deviceId)!==null&&y!==void 0?y:wM(),l=a==null?void 0:a.lastEventId,o=a==null?void 0:a.lastEventTime,i=a==null?void 0:a.optOut,c=a==null?void 0:a.sessionId,u=a==null?void 0:a.userId,d=a==null?void 0:a.cookieStorage,h=a==null?void 0:a.domain,f=kE0.bind,A=[void 0,t],Z=[q({},a)],H={cookieStorage:d,deviceId:r,domain:h,lastEventId:l,lastEventTime:o,optOut:i,sessionId:c},[4,bA1(a)];case 1:return[2,new(f.apply(kE0,A.concat([q.apply(void 0,Z.concat([(H.storageProvider=S.sent(),H.trackingOptions=q(q({},n.trackingOptions),a==null?void 0:a.trackingOptions),H.transportProvider=(b=a==null?void 0:a.transportProvider)!==null&&b!==void 0?b:CE0(a==null?void 0:a.transport),H.userId=u,H)]))])))]}})})},wE0=function(t,a){return a===void 0&&(a=pp()),H0(void 0,void 0,void 0,function(){var n,r,l;return M0(this,function(o){switch(o.label){case 0:return n=q(q({},a),t),r=t==null?void 0:t.cookieStorage,l=!r,l?[3,2]:[4,r.isEnabled()];case 1:l=!o.sent(),o.label=2;case 2:return l?[2,yA1(n)]:[2,r]}})})},yA1=function(t){return H0(void 0,void 0,void 0,function(){var a,n;return M0(this,function(r){switch(r.label){case 0:return a=new QP({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),n=t.disableCookies,n?[3,2]:[4,a.isEnabled()];case 1:n=!r.sent(),r.label=2;case 2:return n?(a=new FE0,[4,a.isEnabled()]):[3,4];case 3:r.sent()||(a=new oE0),r.label=4;case 4:return[2,a]}})})},bA1=function(t){return H0(void 0,void 0,void 0,function(){var a,n,r,l,o,i,c,u,d;return M0(this,function(h){switch(h.label){case 0:if(a=t&&Object.prototype.hasOwnProperty.call(t,"storageProvider"),n=t&&t.loggerProvider,!(!a||t.storageProvider))return[3,9];h.label=1;case 1:h.trys.push([1,7,8,9]),r=Yo([t==null?void 0:t.storageProvider,new FE0({loggerProvider:n})]),l=r.next(),h.label=2;case 2:return l.done?[3,6]:(o=l.value,i=o,i?[4,o.isEnabled()]:[3,4]);case 3:i=h.sent(),h.label=4;case 4:if(i)return[2,o];h.label=5;case 5:return l=r.next(),[3,2];case 6:return[3,9];case 7:return c=h.sent(),u={error:c},[3,9];case 8:try{l&&!l.done&&(d=r.return)&&d.call(r)}finally{if(u)throw u.error}return[7];case 9:return[2,void 0]}})})},CE0=function(t){return t===SM.XHR?new MA1:t===SM.SendBeacon?new EA1:pp().transportProvider},LA1=function(t){return H0(void 0,void 0,void 0,function(){var a,n,r,l,o,o,i,c,u,d;return M0(this,function(h){switch(h.label){case 0:return[4,new QP().isEnabled()];case 1:if(!h.sent()||typeof location>"u"||!location.hostname)return[2,""];for(a=location.hostname,n=a.split("."),r=[],l="AMP_TLDTEST",o=n.length-2;o>=0;--o)r.push(n.slice(o).join("."));o=0,h.label=2;case 2:return o<r.length?(i=r[o],c={domain:"."+i},u=new QP(c),[4,u.set(l,1)]):[3,7];case 3:return h.sent(),[4,u.get(l)];case 4:return d=h.sent(),d?[4,u.remove(l)]:[3,6];case 5:return h.sent(),[2,"."+i];case 6:return o++,[3,2];case 7:return[2,""]}})})},I6="[Amplitude]",NE0="".concat(I6," Page Viewed"),PE0="".concat(I6," Form Started"),SA1="".concat(I6," Form Submitted"),FA1="".concat(I6," File Downloaded"),TE0="session_start",$E0="session_end",_A1="".concat(I6," File Extension"),kA1="".concat(I6," File Name"),wA1="".concat(I6," Link ID"),CA1="".concat(I6," Link Text"),NA1="".concat(I6," Link URL"),XP="".concat(I6," Form ID"),JP="".concat(I6," Form Name"),eT="".concat(I6," Form Destination"),PA1=function(t,a){return H0(void 0,void 0,void 0,function(){var n,r,l,o,i,c,u,d,h,f,A;return M0(this,function(Z){switch(Z.label){case 0:return[4,wE0(a)];case 1:return n=Z.sent(),r=Jv1(t),[4,n.getRaw(r)];case 2:return l=Z.sent(),l?((A=a.cookieUpgrade)!==null&&A!==void 0?A:pp().cookieUpgrade)?[4,n.remove(r)]:[3,4]:[2,{optOut:!1}];case 3:Z.sent(),Z.label=4;case 4:return o=wt(l.split("."),6),i=o[0],c=o[1],u=o[2],d=o[3],h=o[4],f=o[5],[2,{deviceId:i,userId:TA1(c),sessionId:tT(d),lastEventId:tT(f),lastEventTime:tT(h),optOut:!!u}]}})})},tT=function(t){var a=parseInt(t,32);if(!isNaN(a))return a},TA1=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}},$A1="Web",IA1="$remote",OA1=function(){function t(){this.name="context",this.type=E4.BEFORE,this.library="amplitude-ts/".concat(_E0),typeof navigator<"u"&&(this.userAgent=navigator.userAgent),this.uaResult=new JA0(this.userAgent).getResult()}return t.prototype.setup=function(a){return this.config=a,Promise.resolve(void 0)},t.prototype.execute=function(a){var n,r;return H0(this,void 0,void 0,function(){var l,o,i,c,u,d,h,f;return M0(this,function(A){return l=new Date().getTime(),o=this.uaResult.browser.name,i=this.uaResult.browser.version,c=this.uaResult.device.model||this.uaResult.os.name,u=this.uaResult.device.vendor,d=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1,h=(r=a.event_id)!==null&&r!==void 0?r:d+1,this.config.lastEventId=h,a.time||(this.config.lastEventTime=l),f=q(q(q(q(q(q(q(q(q(q(q(q({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:l},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:$A1}),this.config.trackingOptions.osName&&{os_name:o}),this.config.trackingOptions.osVersion&&{os_version:i}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),this.config.trackingOptions.deviceModel&&{device_model:c}),this.config.trackingOptions.language&&{language:lA1()}),this.config.trackingOptions.ipAddress&&{ip:IA1}),{insert_id:wM(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),a),{event_id:h,library:this.library,user_agent:this.userAgent}),[2,f]})})},t}(),xA1={page_domain:"".concat(I6," Page Domain"),page_location:"".concat(I6," Page Location"),page_path:"".concat(I6," Page Path"),page_title:"".concat(I6," Page Title"),page_url:"".concat(I6," Page URL")},jA1=function(){var t="@amplitude/plugin-default-page-view-event-enrichment-browser",a=E4.ENRICHMENT,n=function(){return H0(void 0,void 0,void 0,function(){return M0(this,function(l){return[2,void 0]})})},r=function(l){return H0(void 0,void 0,void 0,function(){return M0(this,function(o){return l.event_type===NE0&&l.event_properties&&(l.event_properties=Object.entries(l.event_properties).reduce(function(i,c){var u=wt(c,2),d=u[0],h=u[1],f=xA1[d];return f?i[f]=h:i[d]=h,i},{})),[2,l]})})};return{name:t,type:a,setup:n,execute:r}},RA1=function(){var t,a=[],n=function(d,h,f){d.addEventListener(h,f),a.push({element:d,type:h,handler:f})},r=function(){a.forEach(function(d){var h=d.element,f=d.type,A=d.handler;h==null||h.removeEventListener(f,A)}),a=[]},l="@amplitude/plugin-file-download-tracking-browser",o=E4.ENRICHMENT,i=function(d,h){return H0(void 0,void 0,void 0,function(){var f,A,Z;return M0(this,function(H){return h?typeof document>"u"?[2]:(f=function(y){var b;try{b=new URL(y.href,window.location.href)}catch{return}var S=A.exec(b.href),_=S==null?void 0:S[1];_&&n(y,"click",function(){var w;_&&h.track(FA1,(w={},w[_A1]=_,w[kA1]=b.pathname,w[wA1]=y.id,w[CA1]=y.text,w[NA1]=y.href,w))})},A=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/,Z=Array.from(document.getElementsByTagName("a")),Z.forEach(f),typeof MutationObserver<"u"&&(t=new MutationObserver(function(y){y.forEach(function(b){b.addedNodes.forEach(function(S){S.nodeName==="A"&&f(S),"querySelectorAll"in S&&typeof S.querySelectorAll=="function"&&Array.from(S.querySelectorAll("a")).map(f)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(d.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked."),[2])})})},c=function(d){return H0(void 0,void 0,void 0,function(){return M0(this,function(h){return[2,d]})})},u=function(){return H0(void 0,void 0,void 0,function(){return M0(this,function(d){return t==null||t.disconnect(),r(),[2]})})};return{name:l,type:o,setup:i,execute:c,teardown:u}},DA1=function(){var t,a=[],n=function(h,f,A){h.addEventListener(f,A),a.push({element:h,type:f,handler:A})},r=function(){a.forEach(function(h){var f=h.element,A=h.type,Z=h.handler;f==null||f.removeEventListener(A,Z)}),a=[]},l=function(h){var f=h.getAttribute("action");try{f=new URL(encodeURI(f??""),window.location.href).href}catch{}return f},o="@amplitude/plugin-form-interaction-tracking-browser",i=E4.ENRICHMENT,c=function(h,f){return H0(void 0,void 0,void 0,function(){var A,Z;return M0(this,function(H){return f?typeof document>"u"?[2]:(A=function(y){var b=!1;n(y,"change",function(){var S;if(!b){var _=l(y);f.track(PE0,(S={},S[XP]=y.getAttribute("id"),S[JP]=y.getAttribute("name"),S[eT]=_,S))}b=!0}),n(y,"submit",function(){var S,_,w=l(y);b||f.track(PE0,(S={},S[XP]=y.getAttribute("id"),S[JP]=y.getAttribute("name"),S[eT]=w,S)),f.track(SA1,(_={},_[XP]=y.getAttribute("id"),_[JP]=y.getAttribute("name"),_[eT]=w,_)),b=!1})},Z=Array.from(document.getElementsByTagName("form")),Z.forEach(A),typeof MutationObserver<"u"&&(t=new MutationObserver(function(y){y.forEach(function(b){b.addedNodes.forEach(function(S){S.nodeName==="FORM"&&A(S),"querySelectorAll"in S&&typeof S.querySelectorAll=="function"&&Array.from(S.querySelectorAll("form")).map(A)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(h.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked."),[2])})})},u=function(h){return H0(void 0,void 0,void 0,function(){return M0(this,function(f){return[2,h]})})},d=function(){return H0(void 0,void 0,void 0,function(){return M0(this,function(h){return t==null||t.disconnect(),r(),[2]})})};return{name:o,type:i,setup:c,execute:u,teardown:d}},aT=function(t,a){for(var n=0;n<a.length;n++){var r=a[n],l=r.name,o=r.args,i=r.resolve,c=t&&t[l];if(typeof c=="function"){var u=c.apply(t,o);typeof i=="function"&&i(u==null?void 0:u.promise)}}return t},nT=function(t){var a=t;return a&&a._q!==void 0},zA1=function(t){Ke(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}return a.prototype.init=function(n,r,l){return n===void 0&&(n=""),Mr(this._init(q(q({},l),{userId:r,apiKey:n})))},a.prototype._init=function(n){var r,l,o,i,c,u,d,h,f,A,Z,H,y,b,S,_,w,T,N,P;return H0(this,void 0,void 0,function(){var x,z,Y,j,X,G,t0,o0,K,N0,y0,u0,b0,R,n0,s0,W,l0,d0=this;return M0(this,function(e0){switch(e0.label){case 0:return this.initializing?[2]:(this.initializing=!0,x=n,n.disableCookies?(z="",[3,5]):[3,1]);case 1:return(r=n.domain)!==null&&r!==void 0?(Y=r,[3,4]):[3,2];case 2:return[4,LA1()];case 3:Y=e0.sent(),e0.label=4;case 4:z=Y,e0.label=5;case 5:return x.domain=z,[4,PA1(n.apiKey,n)];case 6:return j=e0.sent(),[4,wE0(n)];case 7:return X=e0.sent(),[4,X.get(VE0(n.apiKey))];case 8:return G=e0.sent(),t0=YP(),o0=(i=(o=(l=n.deviceId)!==null&&l!==void 0?l:t0.deviceId)!==null&&o!==void 0?o:G==null?void 0:G.deviceId)!==null&&i!==void 0?i:j.deviceId,K=(c=G==null?void 0:G.sessionId)!==null&&c!==void 0?c:j.sessionId,N0=(d=(u=n.optOut)!==null&&u!==void 0?u:G==null?void 0:G.optOut)!==null&&d!==void 0?d:j.optOut,y0=(h=G==null?void 0:G.lastEventId)!==null&&h!==void 0?h:j.lastEventId,u0=(f=G==null?void 0:G.lastEventTime)!==null&&f!==void 0?f:j.lastEventTime,b0=(Z=(A=n.userId)!==null&&A!==void 0?A:G==null?void 0:G.userId)!==null&&Z!==void 0?Z:j.userId,this.previousSessionDeviceId=(H=G==null?void 0:G.deviceId)!==null&&H!==void 0?H:j.deviceId,this.previousSessionUserId=(y=G==null?void 0:G.userId)!==null&&y!==void 0?y:j.userId,[4,VA1(n.apiKey,q(q({},n),{deviceId:o0,sessionId:K,optOut:N0,lastEventId:y0,lastEventTime:u0,userId:b0,cookieStorage:X}))];case 9:return R=e0.sent(),[4,t.prototype._init.call(this,R)];case 10:return e0.sent(),n0=!1,(!this.config.lastEventTime||!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId((S=(b=n.sessionId)!==null&&b!==void 0?b:this.config.sessionId)!==null&&S!==void 0?S:Date.now()),n0=!0),s0=W9(n.instanceName),s0.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new Cv1).promise];case 11:return e0.sent(),[4,this.add(new OA1).promise];case 12:return e0.sent(),[4,this.add(new oA1).promise];case 13:return e0.sent(),eA1(this.config.defaultTracking)?[4,this.add(RA1()).promise]:[3,15];case 14:e0.sent(),e0.label=15;case 15:return tA1(this.config.defaultTracking)?[4,this.add(DA1()).promise]:[3,17];case 16:e0.sent(),e0.label=17;case 17:return!((_=this.config.attribution)===null||_===void 0)&&_.disabled?[3,19]:(W=HA1({excludeReferrers:(w=this.config.attribution)===null||w===void 0?void 0:w.excludeReferrers,initialEmptyValue:(T=this.config.attribution)===null||T===void 0?void 0:T.initialEmptyValue,resetSessionOnNewCampaign:(N=this.config.attribution)===null||N===void 0?void 0:N.resetSessionOnNewCampaign}),W.__pluginEnabledOverride=n0||!((P=this.config.attribution)===null||P===void 0)&&P.trackNewCampaigns?void 0:!1,[4,this.add(W).promise]);case 18:e0.sent(),e0.label=19;case 19:return l0=rA1(this.config),l0.eventType=l0.eventType||NE0,[4,this.add(sA1(l0)).promise];case 20:return e0.sent(),[4,this.add(jA1()).promise];case 21:return e0.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 22:return e0.sent(),s0.eventBridge.setEventReceiver(function(L0){d0.track(L0.eventType,L0.eventProperties)}),[2]}})})},a.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},a.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}(n!==this.config.userId||n===void 0)&&(this.config.userId=n,zv1(n,this.config.instanceName))},a.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},a.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.deviceId=n,Uv1(n,this.config.instanceName)},a.prototype.setOptOut=function(n){Bv1(n,this.config.instanceName),t.prototype.setOptOut.call(this,n)},a.prototype.reset=function(){this.setDeviceId(wM()),this.setUserId(void 0)},a.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},a.prototype.setSessionId=function(n){var r;if(!this.config){this.q.push(this.setSessionId.bind(this,n));return}if(n!==this.config.sessionId){var l=this.getSessionId(),o=this.config.lastEventTime,i=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1;this.config.sessionId=n,this.config.lastEventTime=void 0,nA1(this.config.defaultTracking)&&(l&&o&&this.track($E0,void 0,{device_id:this.previousSessionDeviceId,event_id:++i,session_id:l,time:o+1,user_id:this.previousSessionUserId}),this.config.lastEventTime=this.config.sessionId,this.track(TE0,void 0,{event_id:++i,session_id:this.config.sessionId,time:this.config.lastEventTime})),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}},a.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},a.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=CE0(n)},a.prototype.identify=function(n,r){if(nT(n)){var l=n._q;n._q=[],n=aT(new GP,l)}return r!=null&&r.user_id&&this.setUserId(r.user_id),r!=null&&r.device_id&&this.setDeviceId(r.device_id),t.prototype.identify.call(this,n,r)},a.prototype.groupIdentify=function(n,r,l,o){if(nT(l)){var i=l._q;l._q=[],l=aT(new GP,i)}return t.prototype.groupIdentify.call(this,n,r,l,o)},a.prototype.revenue=function(n,r){if(nT(n)){var l=n._q;n._q=[],n=aT(new Lv1,l)}return t.prototype.revenue.call(this,n,r)},a.prototype.process=function(n){return H0(this,void 0,void 0,function(){var r,l,o;return M0(this,function(i){return r=Date.now(),l=this.config.lastEventTime||Date.now(),o=r-l,n.event_type!==TE0&&n.event_type!==$E0&&(!n.session_id||n.session_id===this.getSessionId())&&o>this.config.sessionTimeout&&this.setSessionId(r),[2,t.prototype.process.call(this,n)]})})},a}(bv1),UA1=function(){var t=new zA1;return{init:Ot(t.init.bind(t),"init",$t(t),It(t,["config"])),add:Ot(t.add.bind(t),"add",$t(t),It(t,["config.apiKey","timeline.plugins"])),remove:Ot(t.remove.bind(t),"remove",$t(t),It(t,["config.apiKey","timeline.plugins"])),track:Ot(t.track.bind(t),"track",$t(t),It(t,["config.apiKey","timeline.queue.length"])),logEvent:Ot(t.logEvent.bind(t),"logEvent",$t(t),It(t,["config.apiKey","timeline.queue.length"])),identify:Ot(t.identify.bind(t),"identify",$t(t),It(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Ot(t.groupIdentify.bind(t),"groupIdentify",$t(t),It(t,["config.apiKey","timeline.queue.length"])),setGroup:Ot(t.setGroup.bind(t),"setGroup",$t(t),It(t,["config.apiKey","timeline.queue.length"])),revenue:Ot(t.revenue.bind(t),"revenue",$t(t),It(t,["config.apiKey","timeline.queue.length"])),flush:Ot(t.flush.bind(t),"flush",$t(t),It(t,["config.apiKey","timeline.queue.length"])),getUserId:Ot(t.getUserId.bind(t),"getUserId",$t(t),It(t,["config","config.userId"])),setUserId:Ot(t.setUserId.bind(t),"setUserId",$t(t),It(t,["config","config.userId"])),getDeviceId:Ot(t.getDeviceId.bind(t),"getDeviceId",$t(t),It(t,["config","config.deviceId"])),setDeviceId:Ot(t.setDeviceId.bind(t),"setDeviceId",$t(t),It(t,["config","config.deviceId"])),reset:Ot(t.reset.bind(t),"reset",$t(t),It(t,["config","config.userId","config.deviceId"])),getSessionId:Ot(t.getSessionId.bind(t),"getSessionId",$t(t),It(t,["config"])),setSessionId:Ot(t.setSessionId.bind(t),"setSessionId",$t(t),It(t,["config"])),extendSession:Ot(t.extendSession.bind(t),"extendSession",$t(t),It(t,["config"])),setOptOut:Ot(t.setOptOut.bind(t),"setOptOut",$t(t),It(t,["config"])),setTransport:Ot(t.setTransport.bind(t),"setTransport",$t(t),It(t,["config"]))}};const IE0=UA1();var BA1=IE0.init,OE0=IE0.track,qA1=function(t,a){return Object.keys(t).filter(function(n){return a(n,t[n])}).reduce(function(n,r){return n[r]=t[r],n},{})},R7=function(t){Ke(a,t);function a(n,r){var l=t.call(this,"".concat(n," ").concat(r))||this;return l.field=n,l}return a}(Error);function Ei(t){return typeof t=="string"}function rT(t){return typeof t=="number"}function G9(t){return typeof t=="function"}function WA1(t){return t!=null}function V4(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()==="object"}var lT="is not a string",oT="is not an object",GA1="is nil";function YA1(t){if(!WA1(t))throw new R7("Event",GA1);if(typeof t!="object")throw new R7("Event",oT)}function KA1(t){if(!Ei(t.type))throw new R7(".type",lT)}function QA1(t){if(!Ei(t.event))throw new R7(".event",lT)}function XA1(t){if(!V4(t.properties))throw new R7(".properties",oT)}function JA1(t){if(!V4(t.traits))throw new R7(".traits",oT)}function eg1(t){if(!Ei(t.messageId))throw new R7(".messageId",lT)}function tg1(t){YA1(t),KA1(t),eg1(t),t.type==="track"&&(QA1(t),XA1(t)),["group","identify"].includes(t.type)&&JA1(t)}var ag1=function(){function t(a){var n,r;this.settings=a,this.createMessageId=a.createMessageId,this.onEventMethodCall=(n=a.onEventMethodCall)!==null&&n!==void 0?n:function(){},this.onFinishedEvent=(r=a.onFinishedEvent)!==null&&r!==void 0?r:function(){}}return t}(),ng1=function(){function t(a){this.settings=new ag1(a)}return t.prototype.track=function(a,n,r,l){return this.settings.onEventMethodCall({type:"track",options:r}),this.normalize(q(q({},this.baseEvent()),{event:a,type:"track",properties:n??{},options:q({},r),integrations:q({},l)}))},t.prototype.page=function(a,n,r,l,o){var i;this.settings.onEventMethodCall({type:"page",options:l});var c={type:"page",properties:q({},r),options:q({},l),integrations:q({},o)};return a!==null&&(c.category=a,c.properties=(i=c.properties)!==null&&i!==void 0?i:{},c.properties.category=a),n!==null&&(c.name=n),this.normalize(q(q({},this.baseEvent()),c))},t.prototype.screen=function(a,n,r,l,o){this.settings.onEventMethodCall({type:"screen",options:l});var i={type:"screen",properties:q({},r),options:q({},l),integrations:q({},o)};return a!==null&&(i.category=a),n!==null&&(i.name=n),this.normalize(q(q({},this.baseEvent()),i))},t.prototype.identify=function(a,n,r,l){return this.settings.onEventMethodCall({type:"identify",options:r}),this.normalize(q(q({},this.baseEvent()),{type:"identify",userId:a,traits:n??{},options:q({},r),integrations:l}))},t.prototype.group=function(a,n,r,l){return this.settings.onEventMethodCall({type:"group",options:r}),this.normalize(q(q({},this.baseEvent()),{type:"group",traits:n??{},options:q({},r),integrations:q({},l),groupId:a}))},t.prototype.alias=function(a,n,r,l){this.settings.onEventMethodCall({type:"alias",options:r});var o={userId:a,type:"alias",options:q({},r),integrations:q({},l)};return n!==null&&(o.previousId=n),a===void 0?this.normalize(q(q({},o),this.baseEvent())):this.normalize(q(q({},this.baseEvent()),o))},t.prototype.baseEvent=function(){return{integrations:{},options:{}}},t.prototype.context=function(a){var n,r=["userId","anonymousId","timestamp","messageId"];delete a.integrations;var l=Object.keys(a),o=(n=a.context)!==null&&n!==void 0?n:{},i={};return l.forEach(function(c){c!=="context"&&(r.includes(c)?A9(i,c,a[c]):A9(o,c,a[c]))}),[o,i]},t.prototype.normalize=function(a){var n,r,l=Object.keys((n=a.integrations)!==null&&n!==void 0?n:{}).reduce(function(A,Z){var H,y;return q(q({},A),(H={},H[Z]=!!(!((y=a.integrations)===null||y===void 0)&&y[Z]),H))},{});a.options=qA1(a.options||{},function(A,Z){return Z!==void 0});var o=q(q({},l),(r=a.options)===null||r===void 0?void 0:r.integrations),i=a.options?this.context(a.options):[],c=i[0],u=i[1],d=a.options,h=Gt(a,["options"]),f=q(q(q(q({timestamp:new Date},h),{context:c,integrations:o}),u),{messageId:d.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(f),tg1(f),f},t}();function iT(t,a){return new Promise(function(n,r){var l=setTimeout(function(){r(Error("Promise timed out"))},a);t.then(function(o){return clearTimeout(l),n(o)}).catch(r)})}function rg1(t){return new Promise(function(a){return setTimeout(a,t)})}function lg1(t,a,n){var r=function(){try{return Promise.resolve(a(t))}catch(l){return Promise.reject(l)}};return rg1(n).then(function(){return iT(r(),1e3)}).catch(function(l){t==null||t.log("warn","Callback Error",{error:l}),t==null||t.stats.increment("callback_error")}).then(function(){return t})}function og1(t){var a=Math.random()+1,n=t.minTimeout,r=n===void 0?500:n,l=t.factor,o=l===void 0?2:l,i=t.attempt,c=t.maxTimeout,u=c===void 0?1/0:c;return Math.min(a*r*Math.pow(o,i),u)}var xE0="onRemoveFromFuture",TM=function(t){Ke(a,t);function a(n,r,l){var o=t.call(this)||this;return o.future=[],o.maxAttempts=n,o.queue=r,o.seen=l??{},o}return a.prototype.push=function(){for(var n=this,r=[],l=0;l<arguments.length;l++)r[l]=arguments[l];var o=r.map(function(i){var c=n.updateAttempts(i);return c>n.maxAttempts||n.includes(i)?!1:(n.queue.push(i),!0)});return this.queue=this.queue.sort(function(i,c){return n.getAttempts(i)-n.getAttempts(c)}),o},a.prototype.pushWithBackoff=function(n,r){var l=this;if(r===void 0&&(r=0),r==0&&this.getAttempts(n)===0)return this.push(n)[0];var o=this.updateAttempts(n);if(o>this.maxAttempts||this.includes(n))return!1;var i=og1({attempt:o-1});return r>0&&i<r&&(i=r),setTimeout(function(){l.queue.push(n),l.future=l.future.filter(function(c){return c.id!==n.id}),l.emit(xE0)},i),this.future.push(n),!0},a.prototype.getAttempts=function(n){var r;return(r=this.seen[n.id])!==null&&r!==void 0?r:0},a.prototype.updateAttempts=function(n){return this.seen[n.id]=this.getAttempts(n)+1,this.getAttempts(n)},a.prototype.includes=function(n){return this.queue.includes(n)||this.future.includes(n)||!!this.queue.find(function(r){return r.id===n.id})||!!this.future.find(function(r){return r.id===n.id})},a.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(a.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),a}(H9),ig1=function(){function t(){this._logs=[]}return t.prototype.log=function(a,n,r){var l=new Date;this._logs.push({level:a,message:n,time:l,extras:r})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var a=this._logs.reduce(function(n,r){var l,o,i,c=q(q({},r),{json:JSON.stringify(r.extras,null," "),extras:r.extras});delete c.time;var u=(i=(o=r.time)===null||o===void 0?void 0:o.toISOString())!==null&&i!==void 0?i:"";return n[u]&&(u="".concat(u,"-").concat(Math.random())),q(q({},n),(l={},l[u]=c,l))},{});console.table?console.table(a):console.log(a)}else this.logs.forEach(function(n){var r=n.level,l=n.message,o=n.extras;r==="info"||r==="debug"?console.log(l,o??""):console[r](l,o??"")});this._logs=[]},t}(),cg1=function(t){var a={gauge:"g",counter:"c"};return a[t]},jE0=function(){function t(){this.metrics=[]}return t.prototype.increment=function(a,n,r){n===void 0&&(n=1),this.metrics.push({metric:a,value:n,tags:r??[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(a,n,r){this.metrics.push({metric:a,value:n,tags:r??[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var a=this.metrics.map(function(n){return q(q({},n),{tags:n.tags.join(",")})});console.table?console.table(a):console.log(a),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(a){return{m:a.metric,v:a.value,t:a.tags,k:cg1(a.type),e:a.timestamp}})},t}(),sg1=function(t){Ke(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}return a.prototype.gauge=function(){},a.prototype.increment=function(){},a.prototype.flush=function(){},a.prototype.serialize=function(){return[]},a}(jE0),Vi=function(){function t(a){var n,r,l;this.retry=(n=a.retry)!==null&&n!==void 0?n:!0,this.type=(r=a.type)!==null&&r!==void 0?r:"plugin Error",this.reason=(l=a.reason)!==null&&l!==void 0?l:""}return t}(),$M=function(){function t(a,n,r,l){n===void 0&&(n=M9()),r===void 0&&(r=new sg1),l===void 0&&(l=new ig1),this.attempts=0,this.event=a,this._id=n,this.logger=l,this.stats=r}return t.system=function(){},t.prototype.isSame=function(a){return a.id===this.id},t.prototype.cancel=function(a){throw a||new Vi({reason:"Context Cancel"})},t.prototype.log=function(a,n,r){this.logger.log(a,n,r)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(a,n){var r;if(a.split(".")[0]==="integrations"){var l=a.split(".")[1];if(((r=this.event.integrations)===null||r===void 0?void 0:r[l])===!1)return this.event}return A9(this.event,a,n),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(a){this._failedDelivery=a},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}();function ug1(t,a){var n={};return t.forEach(function(r){var l,o=void 0;{var i=r[a];o=typeof i!="string"?JSON.stringify(i):i}o!==void 0&&(n[o]=K1(K1([],(l=n[o])!==null&&l!==void 0?l:[],!0),[r],!1))}),n}var mg1=function(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"},dg1=function(){var t,a,n=0;return{done:function(){return t},run:function(r){var l=r();return mg1(l)&&(++n===1&&(t=new Promise(function(o){return a=o})),l.finally(function(){return--n===0&&a()})),l}}};function hg1(t){return H0(this,void 0,void 0,function(){var a;return M0(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 a=n.sent(),[2,Promise.reject(a)];case 3:return[2]}})})}function Y9(t,a){t.log("debug","plugin",{plugin:a.name});var n=new Date().getTime(),r=a[t.event.type];if(r===void 0)return Promise.resolve(t);var l=hg1(function(){return r.apply(a,[t])}).then(function(o){var i=new Date().getTime()-n;return o.stats.gauge("plugin_time",i,["plugin:".concat(a.name)]),o}).catch(function(o){if(o instanceof Vi&&o.type==="middleware_cancellation")throw o;return o instanceof Vi?(t.log("warn",o.type,{plugin:a.name,error:o}),o):(t.log("error","plugin Error",{plugin:a.name,error:o}),t.stats.increment("plugin_error",1,["plugin:".concat(a.name)]),o)});return l}function pg1(t,a){return Y9(t,a).then(function(n){if(n instanceof $M)return n;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(n)})}var fg1=function(t){Ke(a,t);function a(n){var r=t.call(this)||this;return r.criticalTasks=dg1(),r.plugins=[],r.failedInitializations=[],r.flushing=!1,r.queue=n,r.queue.on(xE0,function(){r.scheduleFlush(0)}),r}return a.prototype.register=function(n,r,l){return H0(this,void 0,void 0,function(){var o,i,c=this;return M0(this,function(u){switch(u.label){case 0:return this.plugins.push(r),o=function(d){c.failedInitializations.push(r.name),c.emit("initialization_failure",r),console.warn(r.name,d),n.log("warn","Failed to load destination",{plugin:r.name,error:d}),c.plugins=c.plugins.filter(function(h){return h!==r})},r.type==="destination"&&r.name!=="Segment.io"?(r.load(n,l).catch(o),[3,4]):[3,1];case 1:return u.trys.push([1,3,,4]),[4,r.load(n,l)];case 2:return u.sent(),[3,4];case 3:return i=u.sent(),o(i),[3,4];case 4:return[2]}})})},a.prototype.deregister=function(n,r,l){return H0(this,void 0,void 0,function(){var o;return M0(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),r.unload?[4,Promise.resolve(r.unload(n,l))]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.plugins=this.plugins.filter(function(c){return c.name!==r.name}),[3,4];case 3:return o=i.sent(),n.log("warn","Failed to unload destination",{plugin:r.name,error:o}),[3,4];case 4:return[2]}})})},a.prototype.dispatch=function(n){return H0(this,void 0,void 0,function(){var r;return M0(this,function(l){return n.log("debug","Dispatching"),n.stats.increment("message_dispatched"),this.queue.push(n),r=this.subscribeToDelivery(n),this.scheduleFlush(0),[2,r]})})},a.prototype.subscribeToDelivery=function(n){return H0(this,void 0,void 0,function(){var r=this;return M0(this,function(l){return[2,new Promise(function(o){var i=function(c,u){c.isSame(n)&&(r.off("flush",i),o(c))};r.on("flush",i)})]})})},a.prototype.dispatchSingle=function(n){return H0(this,void 0,void 0,function(){var r=this;return M0(this,function(l){return n.log("debug","Dispatching"),n.stats.increment("message_dispatched"),this.queue.updateAttempts(n),n.attempts=1,[2,this.deliver(n).catch(function(o){var i=r.enqueuRetry(o,n);return i?r.subscribeToDelivery(n):(n.setFailedDelivery({reason:o}),n)})]})})},a.prototype.isEmpty=function(){return this.queue.length===0},a.prototype.scheduleFlush=function(n){var r=this;n===void 0&&(n=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){r.flush().then(function(){setTimeout(function(){r.flushing=!1,r.queue.length&&r.scheduleFlush(0)},0)})},n))},a.prototype.deliver=function(n){return H0(this,void 0,void 0,function(){var r,l,o,i;return M0(this,function(c){switch(c.label){case 0:return[4,this.criticalTasks.done()];case 1:c.sent(),r=Date.now(),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.flushOne(n)];case 3:return n=c.sent(),l=Date.now()-r,this.emit("delivery_success",n),n.stats.gauge("delivered",l),n.log("debug","Delivered",n.event),[2,n];case 4:throw o=c.sent(),i=o,n.log("error","Failed to deliver",i),this.emit("delivery_failure",n,i),n.stats.increment("delivery_failed"),o;case 5:return[2]}})})},a.prototype.enqueuRetry=function(n,r){var l=!(n instanceof Vi)||n.retry;return l?this.queue.pushWithBackoff(r):!1},a.prototype.flush=function(){return H0(this,void 0,void 0,function(){var n,r,l;return M0(this,function(o){switch(o.label){case 0:if(this.queue.length===0)return[2,[]];if(n=this.queue.pop(),!n)return[2,[]];n.attempts=this.queue.getAttempts(n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.deliver(n)];case 2:return n=o.sent(),this.emit("flush",n,!0),[3,4];case 3:return r=o.sent(),l=this.enqueuRetry(r,n),l||(n.setFailedDelivery({reason:r}),this.emit("flush",n,!1)),[2,[]];case 4:return[2,[n]]}})})},a.prototype.isReady=function(){return!0},a.prototype.availableExtensions=function(n){var r=this.plugins.filter(function(Z){var H,y,b;if(Z.type!=="destination"&&Z.name!=="Segment.io")return!0;var S=void 0;return(H=Z.alternativeNames)===null||H===void 0||H.forEach(function(_){n[_]!==void 0&&(S=n[_])}),(b=(y=n[Z.name])!==null&&y!==void 0?y:S)!==null&&b!==void 0?b:(Z.name==="Segment.io"?!0:n.All)!==!1}),l=ug1(r,"type"),o=l.before,i=o===void 0?[]:o,c=l.enrichment,u=c===void 0?[]:c,d=l.destination,h=d===void 0?[]:d,f=l.after,A=f===void 0?[]:f;return{before:i,enrichment:u,destinations:h,after:A}},a.prototype.flushOne=function(n){var r,l;return H0(this,void 0,void 0,function(){var o,i,c,u,d,h,H,f,A,Z,H,y,b,S,_;return M0(this,function(w){switch(w.label){case 0:if(!this.isReady())throw new Error("Not ready");n.attempts>1&&this.emit("delivery_retry",n),o=this.availableExtensions((r=n.event.integrations)!==null&&r!==void 0?r:{}),i=o.before,c=o.enrichment,u=0,d=i,w.label=1;case 1:return u<d.length?(h=d[u],[4,pg1(n,h)]):[3,4];case 2:H=w.sent(),H instanceof $M&&(n=H),this.emit("message_enriched",n,h),w.label=3;case 3:return u++,[3,1];case 4:f=0,A=c,w.label=5;case 5:return f<A.length?(Z=A[f],[4,Y9(n,Z)]):[3,8];case 6:H=w.sent(),H instanceof $M&&(n=H),this.emit("message_enriched",n,Z),w.label=7;case 7:return f++,[3,5];case 8:return y=this.availableExtensions((l=n.event.integrations)!==null&&l!==void 0?l:{}),b=y.destinations,S=y.after,[4,new Promise(function(T,N){setTimeout(function(){var P=b.map(function(x){return Y9(n,x)});Promise.all(P).then(T).catch(N)},0)})];case 9:return w.sent(),n.stats.increment("message_delivered"),this.emit("message_delivered",n),_=S.map(function(T){return Y9(n,T)}),[4,Promise.all(_)];case 10:return w.sent(),[2,n]}})})},a}(H9),vg1=function(t,a){var n=Date.now()-t;return Math.max((a??300)-n,0)};function Ag1(t,a,n,r){return H0(this,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return n.emit("dispatch_start",t),l=Date.now(),a.isEmpty()?[4,a.dispatchSingle(t)]:[3,2];case 1:return o=i.sent(),[3,4];case 2:return[4,a.dispatch(t)];case 3:o=i.sent(),i.label=4;case 4:return r!=null&&r.callback?[4,lg1(o,r.callback,vg1(l,r.timeout))]:[3,6];case 5:o=i.sent(),i.label=6;case 6:return r!=null&&r.debug&&o.flush(),[2,o]}})})}function gg1(t,a,n,r){var l,o=[t,a,n,r],i=V4(t)?t.event:t;if(!i||!Ei(i))throw new Error("Event missing");var c=V4(t)?(l=t.properties)!==null&&l!==void 0?l:{}:V4(a)?a:{},u={};G9(n)||(u=n??{}),V4(t)&&!G9(a)&&(u=a??{});var d=o.find(G9);return[i,c,u,d]}function RE0(t,a,n,r,l){var o,i,c=null,u=null,d=[t,a,n,r,l],h=d.filter(Ei);h.length===1?Ei(d[1])?(u=d[1],c=null):(u=h[0],c=null):h.length===2&&(typeof d[0]=="string"&&(c=d[0]),typeof d[1]=="string"&&(u=d[1]));var f=d.find(G9),A=d.filter(V4);return A.length===1?V4(d[2])?(i={},o=d[2]):V4(d[3])?(o={},i=d[3]):(o=A[0],i={}):A.length===2&&(o=A[0],i=A[1]),[c,u,o??(o={}),i??(i={}),f]}var DE0=function(t){return function(){for(var a,n,r,l=[],o=0;o<arguments.length;o++)l[o]=arguments[o];for(var i={},c=["callback","options","traits","id"],u=0,d=l;u<d.length;u++){var h=d[u],f=c.pop();if(f==="id"){if(Ei(h)||rT(h)){i.id=h.toString();continue}if(h==null)continue;f=c.pop()}if((f==="traits"||f==="options")&&(h==null||V4(h))&&(i[f]=h),G9(h)){i.callback=h;break}}return[(a=i.id)!==null&&a!==void 0?a:t.id(),(n=i.traits)!==null&&n!==void 0?n:{},(r=i.options)!==null&&r!==void 0?r:{},i.callback]}};function Zg1(t,a,n,r){rT(t)&&(t=t.toString()),rT(a)&&(a=a.toString());var l=[t,a,n,r],o=l.filter(Ei),i=o[0],c=i===void 0?t:i,u=o[1],d=u===void 0?null:u,h=l.filter(V4)[0],f=h===void 0?{}:h,A=l.find(G9);return[c,d,f,A]}function cT(){return typeof window<"u"}function zE0(){return!cT()}function UE0(){return cT()?window.navigator.onLine:!0}function yi(){return!UE0()}var sT=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:null},IM=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var n=sT();return(n&&n.fetch||yg0).apply(void 0,t)},OM="1.81.1",BE0="api.segment.io/v1",Hg1=function(t,a,n){var r=a.reduce(function(l,o){var i=o.split(":"),c=i[0],u=i[1];return l[c]=u,l},{});return{type:"Counter",metric:t,value:1,tags:q(q({},r),{library:"analytics.js",library_version:"npm:next-".concat(OM)})}};function uT(t){console.error("Error sending segment performance metrics",t)}var Mg1=function(){function t(a){var n=this,r,l,o,i,c;if(this.host=(r=a==null?void 0:a.host)!==null&&r!==void 0?r:BE0,this.sampleRate=(l=a==null?void 0:a.sampleRate)!==null&&l!==void 0?l:1,this.flushTimer=(o=a==null?void 0:a.flushTimer)!==null&&o!==void 0?o:30*1e3,this.maxQueueSize=(i=a==null?void 0:a.maxQueueSize)!==null&&i!==void 0?i:20,this.protocol=(c=a==null?void 0:a.protocol)!==null&&c!==void 0?c:"https",this.queue=[],this.sampleRate>0){var u=!1,d=function(){u||(u=!0,n.flush().catch(uT),u=!1,setTimeout(d,n.flushTimer))};d()}}return t.prototype.increment=function(a,n){if(a.includes("analytics_js.")&&n.length!==0&&!(Math.random()>this.sampleRate)&&!(this.queue.length>=this.maxQueueSize)){var r=Hg1(a,n);this.queue.push(r),a.includes("error")&&this.flush().catch(uT)}},t.prototype.flush=function(){return H0(this,void 0,void 0,function(){var a=this;return M0(this,function(n){switch(n.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(r){uT(r),a.sampleRate=0})];case 1:return n.sent(),[2]}})})},t.prototype.send=function(){return H0(this,void 0,void 0,function(){var a,n,r;return M0(this,function(l){return a={series:this.queue},this.queue=[],n={"Content-Type":"text/plain"},r="".concat(this.protocol,"://").concat(this.host,"/m"),[2,IM(r,{headers:n,body:JSON.stringify(a),method:"POST"})]})})},t}(),xM,qE0=function(t){Ke(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}return a.initRemoteMetrics=function(n){xM=new Mg1(n)},a.prototype.increment=function(n,r,l){t.prototype.increment.call(this,n,r,l),xM==null||xM.increment(n,l??[])},a}(jE0),bl=function(t){Ke(a,t);function a(n,r){return t.call(this,n,r,new qE0)||this}return a.system=function(){return new this({type:"track",event:"system"})},a}($M);function Eg1(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()==="object"}var WE0="bpc",GE0=function(t,a,n,r,l,o){return{__t:WE0,c:a,p:r,u:t,s:n,t:l,r:o}},Vg1=Object.keys(GE0("","","","","",""));function yg1(t){if(!Eg1(t)||t.__t!==WE0)return!1;for(var a in t)if(!Vg1.includes(a))return!1;return!0}var bg1=function(t,a){return t.indexOf("?")>-1?t:t+a},Lg1=function(t){var a=t.indexOf("#");return a===-1?t:t.slice(0,a)},Sg1=function(t){try{return new URL(t).pathname}catch{return t[0]==="/"?t:"/"+t}},YE0=function(t){var a=t.c,n=t.p,r=t.s,l=t.u,o=t.r,i=t.t,c=a?Sg1(a):n,u=a?bg1(a,r):Lg1(l);return{path:c,referrer:o,search:r,title:i,url:u}},KE0=function(){var t=document.querySelector("link[rel='canonical']");return GE0(location.href,t&&t.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},Fg1=function(){return YE0(KE0())};function _g1(t,a){return Object.assign.apply(Object,K1([{}],a.map(function(n){var r;if(t&&Object.prototype.hasOwnProperty.call(t,n))return r={},r[n]=t[n],r}),!1))}var K9=function(t,a){a===void 0&&(a=Fg1());var n=t.context,r;t.type==="page"&&(r=t.properties&&_g1(t.properties,Object.keys(a)),t.properties=q(q(q({},a),t.properties),t.name?{name:t.name}:{})),n.page=q(q(q({},a),r),n.page)},kg1=function(t){Ke(a,t);function a(n){var r=t.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(M9())},onEventMethodCall:function(l){var o=l.options;r.maybeUpdateAnonId(o)},onFinishedEvent:function(l){return r.addIdentity(l),l}})||this;return r.user=n,r}return a.prototype.maybeUpdateAnonId=function(n){n!=null&&n.anonymousId&&this.user.anonymousId(n.anonymousId)},a.prototype.addIdentity=function(n){this.user.id()&&(n.userId=this.user.id()),this.user.anonymousId()&&(n.anonymousId=this.user.anonymousId())},a.prototype.track=function(n,r,l,o,i){var c=t.prototype.track.call(this,n,r,l,o);return K9(c,i),c},a.prototype.page=function(n,r,l,o,i,c){var u=t.prototype.page.call(this,n,r,l,o,i);return K9(u,c),u},a.prototype.screen=function(n,r,l,o,i,c){var u=t.prototype.screen.call(this,n,r,l,o,i);return K9(u,c),u},a.prototype.identify=function(n,r,l,o,i){var c=t.prototype.identify.call(this,n,r,l,o);return K9(c,i),c},a.prototype.group=function(n,r,l,o,i){var c=t.prototype.group.call(this,n,r,l,o);return K9(c,i),c},a.prototype.alias=function(n,r,l,o,i){var c=t.prototype.alias.call(this,n,r,l,o);return K9(c,i),c},a}(ng1),wg1=function(t){return"addMiddleware"in t&&t.type==="destination"},Ll={getItem:function(){},setItem:function(){},removeItem:function(){}};try{Ll=cT()&&window.localStorage?window.localStorage:Ll}catch(t){console.warn("Unable to access localStorage",t)}function QE0(t){var a=Ll.getItem(t);return(a?JSON.parse(a):[]).map(function(n){return new bl(n.event,n.id)})}function Cg1(t,a){var n=QE0(t),r=K1(K1([],a,!0),n,!0),l=r.reduce(function(o,i){var c;return q(q({},o),(c={},c[i.id]=i,c))},{});Ll.setItem(t,JSON.stringify(Object.values(l)))}function XE0(t){var a=Ll.getItem(t);return a?JSON.parse(a):{}}function Ng1(t,a){var n=XE0(t);Ll.setItem(t,JSON.stringify(q(q({},n),a)))}function JE0(t){Ll.removeItem(t)}var Pg1=function(){return new Date().getTime()};function mT(t,a,n){n===void 0&&(n=0);var r=50,l="persisted-queue:v1:".concat(t,":lock"),o=function(d){return new Date().getTime()>d},i=Ll.getItem(l),c=i?JSON.parse(i):null,u=c===null||o(c);if(u){Ll.setItem(l,JSON.stringify(Pg1()+r)),a(),Ll.removeItem(l);return}!u&&n<3?setTimeout(function(){mT(t,a,n+1)},r):console.error("Unable to retrieve lock")}var jM=function(t){Ke(a,t);function a(n,r){var l=t.call(this,n,[])||this,o="persisted-queue:v1:".concat(r,":items"),i="persisted-queue:v1:".concat(r,":seen"),c=[],u={};return mT(r,function(){try{c=QE0(o),u=XE0(i),JE0(o),JE0(i),l.queue=K1(K1([],c,!0),l.queue,!0),l.seen=q(q({},u),l.seen)}catch(d){console.error(d)}}),window.addEventListener("pagehide",function(){if(l.todo>0){var d=K1(K1([],l.queue,!0),l.future,!0);try{mT(r,function(){Cg1(o,d),Ng1(i,l.seen)})}catch(h){console.error(h)}}}),l}return a}(TM),Tg1=function(t){Ke(a,t);function a(n){return t.call(this,typeof n=="string"?new jM(4,n):n)||this}return a.prototype.flush=function(){return H0(this,void 0,void 0,function(){return M0(this,function(n){return yi()?[2,[]]:[2,t.prototype.flush.call(this)]})})},a}(fg1);function dT(t){for(var a=t.constructor.prototype,n=0,r=Object.getOwnPropertyNames(a);n<r.length;n++){var l=r[n];if(l!=="constructor"){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,l);o&&typeof o.value=="function"&&(t[l]=t[l].bind(t))}}return t}function $g1(t){var a=t.hostname,n=a.split("."),r=n[n.length-1],l=[];if(n.length===4&&parseInt(r,10)>0||n.length<=1)return l;for(var o=n.length-2;o>=0;--o)l.push(n.slice(o).join("."));return l}function Ig1(t){try{return new URL(t)}catch{return}}function eV0(t){var a=Ig1(t);if(a)for(var n=$g1(a),r=0;r<n.length;++r){var l="__tld__",o=n[r],i={domain:"."+o};try{if(E6.set(l,"1",i),E6.get(l))return E6.remove(l,i),o}catch{return}}}var Og1=365,tV0=function(){function t(a){a===void 0&&(a=t.defaults),this.options=q(q({},t.defaults),a)}return Object.defineProperty(t,"defaults",{get:function(){return{maxage:Og1,domain:eV0(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(a){var n;try{var r=E6.get(a);if(r==null)return null;try{return(n=JSON.parse(r))!==null&&n!==void 0?n:null}catch{return r??null}}catch{return null}},t.prototype.set=function(a,n){typeof n=="string"?E6.set(a,n,this.opts()):n===null?E6.remove(a,this.opts()):E6.set(a,JSON.stringify(n),this.opts())},t.prototype.remove=function(a){return E6.remove(a,this.opts())},t}(),xg1=function(){function t(){}return t.prototype.localStorageWarning=function(a,n){console.warn("Unable to access ".concat(a,", localStorage may be ").concat(n))},t.prototype.get=function(a){var n;try{var r=localStorage.getItem(a);if(r===null)return null;try{return(n=JSON.parse(r))!==null&&n!==void 0?n:null}catch{return r??null}}catch{return this.localStorageWarning(a,"unavailable"),null}},t.prototype.set=function(a,n){try{localStorage.setItem(a,JSON.stringify(n))}catch{this.localStorageWarning(a,"full")}},t.prototype.remove=function(a){try{return localStorage.removeItem(a)}catch{this.localStorageWarning(a,"unavailable")}},t}(),hT=function(){function t(){this.cache={}}return t.prototype.get=function(a){var n;return(n=this.cache[a])!==null&&n!==void 0?n:null},t.prototype.set=function(a,n){this.cache[a]=n},t.prototype.remove=function(a){delete this.cache[a]},t}(),y4={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function aV0(t){return t&&t.stores&&Array.isArray(t.stores)&&t.stores.every(function(a){return Object.values(y4).includes(a)})}function jg1(t){return typeof t=="object"&&t.name!==void 0}var pT=function(t,a,n,r){console.warn("".concat(t.constructor.name,": Can't ").concat(a,' key "').concat(n,'" | Err: ').concat(r))},D7=function(){function t(a){this.stores=a}return t.prototype.get=function(a){for(var n=null,r=0,l=this.stores;r<l.length;r++){var o=l[r];try{if(n=o.get(a),n!=null)return n}catch(i){pT(o,"get",a,i)}}return null},t.prototype.set=function(a,n){this.stores.forEach(function(r){try{r.set(a,n)}catch(l){pT(r,"set",a,l)}})},t.prototype.clear=function(a){this.stores.forEach(function(n){try{n.remove(a)}catch(r){pT(n,"remove",a,r)}})},t.prototype.getAndSync=function(a){var n=this.get(a),r=typeof n=="number"?n.toString():n;return this.set(a,r),r},t}();function fT(t){var a=t.map(function(n){var r,l;switch(jg1(n)?(r=n.name,l=n.settings):r=n,r){case y4.Cookie:return new tV0(l);case y4.LocalStorage:return new xg1;case y4.Memory:return new hT;default:throw new Error("Unknown Store Type: ".concat(n))}});return a}function nV0(t,a){return t.map(function(n){return a&&n===y4.Cookie?{name:n,settings:a}:n})}var z7={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},rV0=function(){function t(a,n){a===void 0&&(a=z7);var r=this,l,o,i,c;this.options={},this.id=function(d){if(r.options.disable)return null;var h=r.identityStore.getAndSync(r.idKey);if(d!==void 0){r.identityStore.set(r.idKey,d);var f=d!==h&&h!==null&&d!==null;f&&r.anonymousId(null)}var A=r.identityStore.getAndSync(r.idKey);if(A)return A;var Z=r.legacyUserStore.get(z7.cookie.oldKey);return Z?typeof Z=="object"?Z.id:Z:null},this.anonymousId=function(d){var h,f;if(r.options.disable)return null;if(d===void 0){var A=(h=r.identityStore.getAndSync(r.anonKey))!==null&&h!==void 0?h:(f=r.legacySIO())===null||f===void 0?void 0:f[0];if(A)return A}return d===null?(r.identityStore.set(r.anonKey,null),r.identityStore.getAndSync(r.anonKey)):(r.identityStore.set(r.anonKey,d??M9()),r.identityStore.getAndSync(r.anonKey))},this.traits=function(d){var h;if(!r.options.disable)return d===null&&(d={}),d&&r.traitsStore.set(r.traitsKey,d??{}),(h=r.traitsStore.get(r.traitsKey))!==null&&h!==void 0?h:{}},this.options=q(q({},z7),a),this.cookieOptions=n,this.idKey=(o=(l=a.cookie)===null||l===void 0?void 0:l.key)!==null&&o!==void 0?o:z7.cookie.key,this.traitsKey=(c=(i=a.localStorage)===null||i===void 0?void 0:i.key)!==null&&c!==void 0?c:z7.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,n),this.legacyUserStore=this.createStorage(this.options,n,function(d){return d===y4.Cookie}),this.traitsStore=this.createStorage(this.options,n,function(d){return d!==y4.Cookie});var u=this.legacyUserStore.get(z7.cookie.oldKey);u&&typeof u=="object"&&(u.id&&this.id(u.id),u.traits&&this.traits(u.traits)),dT(this)}return t.prototype.legacySIO=function(){var a=this.legacyUserStore.get("_sio");if(!a)return null;var n=a.split("----"),r=n[0],l=n[1];return[r,l]},t.prototype.identify=function(a,n){if(!this.options.disable){n=n??{};var r=this.id();(r===null||r===a)&&(n=q(q({},this.traits()),n)),a&&this.id(a),this.traits(n)}},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.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(a,n,r){var l=[y4.LocalStorage,y4.Cookie,y4.Memory];return a.disable?new D7([]):a.persist?(a.storage!==void 0&&a.storage!==null&&aV0(a.storage)&&(l=a.storage.stores),a.localStorageFallbackDisabled&&(l=l.filter(function(o){return o!==y4.LocalStorage})),r&&(l=l.filter(r)),new D7(fT(nV0(l,n)))):new D7([new hT])},t.defaults=z7,t}(),lV0={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},Rg1=function(t){Ke(a,t);function a(n,r){n===void 0&&(n=lV0);var l=t.call(this,q(q({},lV0),n),r)||this;return l.anonymousId=function(o){},dT(l),l}return a}(rV0),vT="analytics";function oV0(){return window[vT]}function Dg1(t){vT=t}function zg1(t){window[vT]=t}var Ug1=function(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"},iV0=function(t,a,n){n.getAndRemove(t).forEach(function(r){RM(a,r).catch(console.error)})},Bg1=function(t,a){return H0(void 0,void 0,void 0,function(){var n,r,l;return M0(this,function(o){switch(o.label){case 0:n=0,r=a.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return n<r.length?(l=r[n],[4,RM(t,l).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},qg1=function(t,a){return H0(void 0,void 0,void 0,function(){var n,r,l;return M0(this,function(o){switch(o.label){case 0:n=0,r=a.getAndRemove("register"),o.label=1;case 1:return n<r.length?(l=r[n],[4,RM(t,l).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},Wg1=iV0.bind(void 0,"on"),Gg1=iV0.bind(void 0,"setAnonymousId"),Yg1=function(t,a){Object.keys(a.calls).forEach(function(n){a.getAndRemove(n).forEach(function(r){setTimeout(function(){RM(t,r).catch(console.error)},0)})})},Q9=function(t){if(cV0(t)){var a=t.pop();return YE0(a)}},cV0=function(t){var a=t[t.length-1];return yg1(a)},AT=function(){function t(a,n,r,l){r===void 0&&(r=function(){}),l===void 0&&(l=console.error),this.method=a,this.resolve=r,this.reject=l,this.called=!1,this.args=n}return t}(),Kg1=function(){function t(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];this._callMap={},this.add.apply(this,a)}return Object.defineProperty(t.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(a){this._callMap=a},enumerable:!1,configurable:!0}),t.prototype.get=function(a){var n;return(n=this.calls[a])!==null&&n!==void 0?n:[]},t.prototype.getAndRemove=function(a){var n=this.get(a);return this.calls[a]=[],n},t.prototype.add=function(){for(var a=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];n.forEach(function(l){var o=["track","screen","alias","group","page","identify"];o.includes(l.method)&&!cV0(l.args)&&(l.args=K1(K1([],l.args,!0),[KE0()],!1)),a.calls[l.method]?a.calls[l.method].push(l):a.calls[l.method]=[l]})},t.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},t.prototype.toArray=function(){var a;return(a=[]).concat.apply(a,Object.values(this.calls))},t.prototype._pushSnippetWindowBuffer=function(){},t}();function RM(t,a){return H0(this,void 0,void 0,function(){var n,r;return M0(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),a.called?[2,void 0]:(a.called=!0,n=t[a.method].apply(t,a.args),Ug1(n)?[4,n]:[3,2]);case 1:l.sent(),l.label=2;case 2:return a.resolve(n),[3,4];case 3:return r=l.sent(),a.reject(r),[3,4];case 4:return[2]}})})}var Qg1=function(){function t(a){var n=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=OM,this._preInitBuffer=new Kg1,this._promise=a(this._preInitBuffer),this._promise.then(function(r){var l=r[0],o=r[1];n.instance=l,n.ctx=o}).catch(function(){})}return t.prototype.then=function(){for(var a,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(a=this._promise).then.apply(a,n)},t.prototype.catch=function(){for(var a,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(a=this._promise).catch.apply(a,n)},t.prototype.finally=function(){for(var a,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(a=this._promise).finally.apply(a,n)},t.prototype._createMethod=function(a){var n=this;return function(){for(var r,l=[],o=0;o<arguments.length;o++)l[o]=arguments[o];if(n.instance){var i=(r=n.instance)[a].apply(r,l);return Promise.resolve(i)}return new Promise(function(c,u){n._preInitBuffer.add(new AT(a,l,c,u))})}},t.prototype._createChainableMethod=function(a){var n=this;return function(){for(var r,l=[],o=0;o<arguments.length;o++)l[o]=arguments[o];return n.instance?((r=n.instance)[a].apply(r,l),n):(n._preInitBuffer.add(new AT(a,l)),n)}},t}();function DM(t,a){var n=new I8.Facade(t,a);return t.type==="track"&&(n=new I8.Track(t,a)),t.type==="identify"&&(n=new I8.Identify(t,a)),t.type==="page"&&(n=new I8.Page(t,a)),t.type==="alias"&&(n=new I8.Alias(t,a)),t.type==="group"&&(n=new I8.Group(t,a)),t.type==="screen"&&(n=new I8.Screen(t,a)),Object.defineProperty(n,"obj",{value:t,writable:!0}),n}var Xg1=function(t){var a=!1;window.addEventListener("pagehide",function(){a||(a=!0,t(a))}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(a)return;a=!0}else a=!1;t(a)})},sV0=function(t){Ke(a,t);function a(n,r){var l=t.call(this,n)||this;return l.retryTimeout=r,l.name="RateLimitError",l}return a}(Error),uV0=function(t){return q({"Content-Type":"text/plain"},typeof t=="function"?t():t)},Jg1=500,eZ1=64;function gT(t){var a=encodeURI(JSON.stringify(t)).split(/%..|./).length-1;return a/1024}function tZ1(t){return gT(t)>=Jg1-50}function aZ1(t){return gT(t)>=eZ1-10}function nZ1(t){var a=[],n=0;return t.forEach(function(r){var l=gT(a[n]);l>=64&&n++,a[n]?a[n].push(r):a[n]=[r]}),a}function rZ1(t,a){var n,r,l=[],o=!1,i=(n=a==null?void 0:a.size)!==null&&n!==void 0?n:10,c=(r=a==null?void 0:a.timeout)!==null&&r!==void 0?r:5e3,u=0;function d(H){var y;if(H.length!==0){var b=(y=H[0])===null||y===void 0?void 0:y.writeKey,S=H.map(function(_){var w=_;w.sentAt;var T=Gt(w,["sentAt"]);return T});return IM("https://".concat(t,"/b"),{credentials:a==null?void 0:a.credentials,keepalive:(a==null?void 0:a.keepalive)||o,headers:uV0(a==null?void 0:a.headers),method:"post",body:JSON.stringify({writeKey:b,batch:S,sentAt:new Date().toISOString()}),priority:a==null?void 0:a.priority}).then(function(_){var w;if(_.status>=500)throw new Error("Bad response from server: ".concat(_.status));if(_.status===429){var T=(w=_.headers)===null||w===void 0?void 0:w.get("x-ratelimit-reset"),N=typeof T=="string"?parseInt(T)*1e3:c;throw new sV0("Rate limit exceeded: ".concat(_.status),N)}})}}function h(H){var y;return H===void 0&&(H=1),H0(this,void 0,void 0,function(){var b;return M0(this,function(S){return l.length?(b=l,l=[],[2,(y=d(b))===null||y===void 0?void 0:y.catch(function(_){var w,T=bl.system();T.log("error","Error sending batch",_),H<=((w=a==null?void 0:a.maxRetries)!==null&&w!==void 0?w:10)&&(_.name==="RateLimitError"&&(u=_.retryTimeout),l.push.apply(l,b),l.map(function(N){if("_metadata"in N){var P=N;P._metadata=q(q({},P._metadata),{retryCount:H})}}),A(H+1))})]):[2]})})}var f;function A(H){H===void 0&&(H=1),!f&&(f=setTimeout(function(){f=void 0,h(H).catch(console.error)},u||c),u=0)}Xg1(function(H){if(o=H,o&&l.length){var y=nZ1(l).map(d);Promise.all(y).catch(console.error)}});function Z(H,y){return H0(this,void 0,void 0,function(){var b;return M0(this,function(S){return l.push(y),b=l.length>=i||tZ1(l)||(a==null?void 0:a.keepalive)&&aZ1(l),[2,b||o?h():A()]})})}return{dispatch:Z}}function lZ1(t){function a(n,r){return IM(n,{credentials:t==null?void 0:t.credentials,keepalive:t==null?void 0:t.keepalive,headers:uV0(t==null?void 0:t.headers),method:"post",body:JSON.stringify(r),priority:t==null?void 0:t.priority}).then(function(l){var o;if(l.status>=500)throw new Error("Bad response from server: ".concat(l.status));if(l.status===429){var i=(o=l.headers)===null||o===void 0?void 0:o.get("x-ratelimit-reset"),c=i?parseInt(i)*1e3:5e3;throw new sV0("Rate limit exceeded: ".concat(l.status),c)}})}return{dispatch:a}}function oZ1(t,a,n,r,l){var o,i=t.user();delete a.options,a.writeKey=n==null?void 0:n.apiKey,a.userId=a.userId||i.id(),a.anonymousId=a.anonymousId||i.anonymousId(),a.sentAt=new Date;var c=t.queue.failedInitializations||[];c.length>0&&(a._metadata={failedInitializations:c}),l!=null&&(l.attempts>1&&(a._metadata=q(q({},a._metadata),{retryCount:l.attempts})),l.attempts++);var u=[],d=[];for(var h in r){var f=r[h];h==="Segment.io"&&u.push(h),f.bundlingStatus==="bundled"&&u.push(h),f.bundlingStatus==="unbundled"&&d.push(h)}for(var A=0,Z=(n==null?void 0:n.unbundledIntegrations)||[];A<Z.length;A++){var H=Z[A];d.includes(H)||d.push(H)}var y=(o=n==null?void 0:n.maybeBundledConfigIds)!==null&&o!==void 0?o:{},b=[];return u.sort().forEach(function(S){var _;((_=y[S])!==null&&_!==void 0?_:[]).forEach(function(w){b.push(w)})}),(n==null?void 0:n.addBundledMetadata)!==!1&&(a._metadata=q(q({},a._metadata),{bundled:u.sort(),unbundled:d.sort(),bundledIds:b})),a}var mV0=function(t,a){return H0(void 0,void 0,void 0,function(){var n;return M0(this,function(r){return n=function(l){return H0(void 0,void 0,void 0,function(){var o;return M0(this,function(i){switch(i.label){case 0:return t(l)?(o=n,[4,a()]):[3,2];case 1:return[2,o.apply(void 0,[i.sent()])];case 2:return[2]}})})},[2,n(void 0)]})})};function iZ1(t,a){return H0(this,void 0,void 0,function(){var n,r=this;return M0(this,function(l){switch(l.label){case 0:return n=[],yi()?[2,a]:[4,mV0(function(){return a.length>0&&!yi()},function(){return H0(r,void 0,void 0,function(){var o,i,c;return M0(this,function(u){switch(u.label){case 0:return o=a.pop(),o?[4,Y9(o,t)]:[2];case 1:return i=u.sent(),c=i instanceof bl,c||n.push(o),[2]}})})})];case 1:return l.sent(),n.map(function(o){return a.pushWithBackoff(o)}),[2,a]}})})}function X9(t,a,n,r){var l=this;t||setTimeout(function(){return H0(l,void 0,void 0,function(){var o,i;return M0(this,function(c){switch(c.label){case 0:return o=!0,[4,iZ1(n,a)];case 1:return i=c.sent(),o=!1,a.todo>0&&r(o,i,n,r),[2]}})})},Math.random()*5e3)}function cZ1(t,a){var n,r,l,o,i=t.user();return a.previousId=(l=(r=(n=a.previousId)!==null&&n!==void 0?n:a.from)!==null&&r!==void 0?r:i.id())!==null&&l!==void 0?l:i.anonymousId(),a.userId=(o=a.userId)!==null&&o!==void 0?o:a.to,delete a.from,delete a.to,a}var sZ1=function(t){return t.name==="Segment.io"};function uZ1(t,a,n){var r,l,o;window.addEventListener("pagehide",function(){c.push.apply(c,Array.from(u)),u.clear()});var i=(r=a==null?void 0:a.apiKey)!==null&&r!==void 0?r:"",c=t.options.disableClientPersistence?new TM(t.queue.queue.maxAttempts,[]):new jM(t.queue.queue.maxAttempts,"".concat(i,":dest-Segment.io")),u=new Set,d=!1,h=(l=a==null?void 0:a.apiHost)!==null&&l!==void 0?l:BE0,f=(o=a==null?void 0:a.protocol)!==null&&o!==void 0?o:"https",A="".concat(f,"://").concat(h),Z=a==null?void 0:a.deliveryStrategy,H=Z&&"strategy"in Z&&Z.strategy==="batching"?rZ1(h,Z.config):lZ1(Z==null?void 0:Z.config);function y(S){return H0(this,void 0,void 0,function(){var _,w;return M0(this,function(T){return yi()?(c.push(S),X9(d,c,b,X9),[2,S]):(u.add(S),_=S.event.type.charAt(0),w=DM(S.event).json(),S.event.type==="track"&&delete w.traits,S.event.type==="alias"&&(w=cZ1(t,w)),c.getAttempts(S)>=c.maxAttempts?(u.delete(S),[2,S]):[2,H.dispatch("".concat(A,"/").concat(_),oZ1(t,w,a,n,S)).then(function(){return S}).catch(function(N){if(S.log("error","Error sending event",N),N.name==="RateLimitError"){var P=N.retryTimeout;c.pushWithBackoff(S,P)}else c.pushWithBackoff(S);return X9(d,c,b,X9),S}).finally(function(){u.delete(S)})])})})}var b={metadata:{writeKey:i,apiHost:h,protocol:f},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:y,identify:y,page:y,alias:y,group:y,screen:y};return c.todo&&X9(d,c,b,X9),b}var bi="This is being deprecated and will be not be available in future releases of Analytics JS",ZT=sT(),HT=ZT==null?void 0:ZT.analytics;function mZ1(t,a,n){a===void 0&&(a=!1),n===void 0&&(n=!1);var r=a?10:1,l=n?new TM(r,[]):new jM(r,t);return new Tg1(l)}var dZ1=function(){function t(a,n){var r;this.timeout=300,this._getSegmentPluginMetadata=function(){var o;return(o=n.plugins.find(sZ1))===null||o===void 0?void 0:o.metadata},this.writeKey=a.writeKey;var l={integrations:{"Segment.io":{apiKey:""}}};this.cdnSettings=(r=a.cdnSettings)!==null&&r!==void 0?r:l,this.cdnURL=a.cdnURL}return Object.defineProperty(t.prototype,"apiHost",{get:function(){var a,n;return(n=(a=this._getSegmentPluginMetadata)===null||a===void 0?void 0:a.call(this))===null||n===void 0?void 0:n.apiHost},enumerable:!1,configurable:!0}),t}();function Sl(){console.warn(bi)}var dV0=function(t){Ke(a,t);function a(n,r,l,o,i){var c=this,u,d;c=t.call(this)||this,c._debug=!1,c.initialized=!1,c.user=function(){return c._user},c.init=c.initialize.bind(c),c.log=Sl,c.addIntegrationMiddleware=Sl,c.listeners=Sl,c.addEventListener=Sl,c.removeAllListeners=Sl,c.removeListener=Sl,c.removeEventListener=Sl,c.hasListeners=Sl,c.add=Sl,c.addIntegration=Sl;var h=r==null?void 0:r.cookie,f=(u=r==null?void 0:r.disableClientPersistence)!==null&&u!==void 0?u:!1;c.queue=l??mZ1("".concat(n.writeKey,":event-queue"),r==null?void 0:r.retryQueue,f),c.settings=new dZ1(n,c.queue);var A=r==null?void 0:r.storage;return c._universalStorage=c.createStore(f,A,h),c._user=o??new rV0(q({persist:!f,storage:r==null?void 0:r.storage},r==null?void 0:r.user),h).load(),c._group=i??new Rg1(q({persist:!f,storage:r==null?void 0:r.storage},r==null?void 0:r.group),h).load(),c.eventFactory=new kg1(c._user),c.integrations=(d=r==null?void 0:r.integrations)!==null&&d!==void 0?d:{},c.options=r??{},dT(c),c}return a.prototype.createStore=function(n,r,l){return n?new D7([new hT]):r&&aV0(r)?new D7(fT(nV0(r.stores,l))):new D7(fT([y4.LocalStorage,{name:y4.Cookie,settings:l},y4.Memory]))},Object.defineProperty(a.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),a.prototype.track=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o,i,c,u,d,h,f=this;return M0(this,function(A){return l=Q9(n),o=gg1.apply(void 0,n),i=o[0],c=o[1],u=o[2],d=o[3],h=this.eventFactory.track(i,c,u,this.integrations,l),[2,this._dispatch(h,d).then(function(Z){return f.emit("track",i,Z.event.properties,Z.event.options),Z})]})})},a.prototype.page=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o,i,c,u,d,h,f,A=this;return M0(this,function(Z){return l=Q9(n),o=RE0.apply(void 0,n),i=o[0],c=o[1],u=o[2],d=o[3],h=o[4],f=this.eventFactory.page(i,c,u,d,this.integrations,l),[2,this._dispatch(f,h).then(function(H){return A.emit("page",i,c,H.event.properties,H.event.options),H})]})})},a.prototype.identify=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o,i,c,u,d,h,f=this;return M0(this,function(A){return l=Q9(n),o=DE0(this._user).apply(void 0,n),i=o[0],c=o[1],u=o[2],d=o[3],this._user.identify(i,c),h=this.eventFactory.identify(this._user.id(),this._user.traits(),u,this.integrations,l),[2,this._dispatch(h,d).then(function(Z){return f.emit("identify",Z.event.userId,Z.event.traits,Z.event.options),Z})]})})},a.prototype.group=function(){for(var n=this,r=[],l=0;l<arguments.length;l++)r[l]=arguments[l];var o=Q9(r);if(r.length===0)return this._group;var i=DE0(this._group).apply(void 0,r),c=i[0],u=i[1],d=i[2],h=i[3];this._group.identify(c,u);var f=this._group.id(),A=this._group.traits(),Z=this.eventFactory.group(f,A,d,this.integrations,o);return this._dispatch(Z,h).then(function(H){return n.emit("group",H.event.groupId,H.event.traits,H.event.options),H})},a.prototype.alias=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o,i,c,u,d,h,f=this;return M0(this,function(A){return l=Q9(n),o=Zg1.apply(void 0,n),i=o[0],c=o[1],u=o[2],d=o[3],h=this.eventFactory.alias(i,c,u,this.integrations,l),[2,this._dispatch(h,d).then(function(Z){return f.emit("alias",i,c,Z.event.options),Z})]})})},a.prototype.screen=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o,i,c,u,d,h,f,A=this;return M0(this,function(Z){return l=Q9(n),o=RE0.apply(void 0,n),i=o[0],c=o[1],u=o[2],d=o[3],h=o[4],f=this.eventFactory.screen(i,c,u,d,this.integrations,l),[2,this._dispatch(f,h).then(function(H){return A.emit("screen",i,c,H.event.properties,H.event.options),H})]})})},a.prototype.trackClick=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return[4,Promise.resolve().then(()=>_E)];case 1:return l=i.sent(),[2,(o=l.link).call.apply(o,K1([this],n,!1))]}})})},a.prototype.trackLink=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return[4,Promise.resolve().then(()=>_E)];case 1:return l=i.sent(),[2,(o=l.link).call.apply(o,K1([this],n,!1))]}})})},a.prototype.trackSubmit=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return[4,Promise.resolve().then(()=>_E)];case 1:return l=i.sent(),[2,(o=l.form).call.apply(o,K1([this],n,!1))]}})})},a.prototype.trackForm=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return[4,Promise.resolve().then(()=>_E)];case 1:return l=i.sent(),[2,(o=l.form).call.apply(o,K1([this],n,!1))]}})})},a.prototype.register=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o,i=this;return M0(this,function(c){switch(c.label){case 0:return l=bl.system(),o=n.map(function(u){return i.queue.register(l,u,i)}),[4,Promise.all(o)];case 1:return c.sent(),[2,l]}})})},a.prototype.deregister=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return H0(this,void 0,void 0,function(){var l,o,i=this;return M0(this,function(c){switch(c.label){case 0:return l=bl.system(),o=n.map(function(u){var d=i.queue.plugins.find(function(h){return h.name===u});if(d)return i.queue.deregister(l,d,i);l.log("warn","plugin ".concat(u," not found"))}),[4,Promise.all(o)];case 1:return c.sent(),[2,l]}})})},a.prototype.debug=function(n){return n===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=n,this},a.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},a.prototype.timeout=function(n){this.settings.timeout=n},a.prototype._dispatch=function(n,r){return H0(this,void 0,void 0,function(){var l;return M0(this,function(o){return l=new bl(n),l.stats.increment("analytics_js.invoke",1,[n.type]),yi()&&!this.options.retryQueue?[2,l]:[2,Ag1(l,this.queue,this,{callback:r,debug:this._debug,timeout:this.settings.timeout})]})})},a.prototype.addSourceMiddleware=function(n){return H0(this,void 0,void 0,function(){var r=this;return M0(this,function(l){switch(l.label){case 0:return[4,this.queue.criticalTasks.run(function(){return H0(r,void 0,void 0,function(){var o,i,c;return M0(this,function(u){switch(u.label){case 0:return[4,Promise.resolve().then(()=>FZ1)];case 1:return o=u.sent().sourceMiddlewarePlugin,i={},this.queue.plugins.forEach(function(d){if(d.type==="destination")return i[d.name]=!0}),c=o(n,i),[4,this.register(c)];case 2:return u.sent(),[2]}})})})];case 1:return l.sent(),[2,this]}})})},a.prototype.addDestinationMiddleware=function(n){for(var r=[],l=1;l<arguments.length;l++)r[l-1]=arguments[l];return this.queue.plugins.filter(wg1).forEach(function(o){(n==="*"||o.name.toLowerCase()===n.toLowerCase())&&o.addMiddleware.apply(o,r)}),Promise.resolve(this)},a.prototype.setAnonymousId=function(n){return this._user.anonymousId(n)},a.prototype.queryString=function(n){return H0(this,void 0,void 0,function(){var r;return M0(this,function(l){switch(l.label){case 0:return this.options.useQueryString===!1?[2,[]]:[4,Promise.resolve().then(()=>Ife)];case 1:return r=l.sent().queryString,[2,r(this,n)]}})})},a.prototype.use=function(n){return n(this),this},a.prototype.ready=function(n){return n===void 0&&(n=function(r){return r}),H0(this,void 0,void 0,function(){return M0(this,function(r){return[2,Promise.all(this.queue.plugins.map(function(l){return l.ready?l.ready():Promise.resolve()})).then(function(l){return n(l),l})]})})},a.prototype.noConflict=function(){return console.warn(bi),zg1(HT??this),this},a.prototype.normalize=function(n){return console.warn(bi),this.eventFactory.normalize(n)},Object.defineProperty(a.prototype,"failedInitializations",{get:function(){return console.warn(bi),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"VERSION",{get:function(){return OM},enumerable:!1,configurable:!0}),a.prototype.initialize=function(n,r){return H0(this,void 0,void 0,function(){return M0(this,function(l){return console.warn(bi),[2,Promise.resolve(this)]})})},a.prototype.pageview=function(n){return H0(this,void 0,void 0,function(){return M0(this,function(r){switch(r.label){case 0:return console.warn(bi),[4,this.page({path:n})];case 1:return r.sent(),[2,this]}})})},Object.defineProperty(a.prototype,"plugins",{get:function(){var n;return console.warn(bi),(n=this._plugins)!==null&&n!==void 0?n:{}},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Integrations",{get:function(){console.warn(bi);var n=this.queue.plugins.filter(function(r){return r.type==="destination"}).reduce(function(r,l){var o="".concat(l.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),i=window[o];if(!i)return r;var c=i.Integration;return c?(r[l.name]=c,r):(r[l.name]=i,r)},{});return n},enumerable:!1,configurable:!0}),a.prototype.push=function(n){var r=this,l=n.shift();l&&!r[l]||r[l].apply(this,n)},a}(H9),hV0=function(t){Ke(a,t);function a(){var n=t.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return n.initialized=!0,n}return a}(dV0),pV0={};function fV0(){return typeof process>"u"||!pV0?{}:pV0}var hZ1=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,pZ1=function(){var t,a=Array.prototype.slice.call(document.querySelectorAll("script"));return a.forEach(function(n){var r,l=(r=n.getAttribute("src"))!==null&&r!==void 0?r:"",o=hZ1.exec(l);o&&o[1]&&(t=o[1])}),t},zM,fZ1=function(){var t,a=zM??((t=oV0())===null||t===void 0?void 0:t._cdn);return a},vZ1=function(t){var a=oV0();a&&(a._cdn=t),zM=t},MT=function(){var t=fZ1();if(t)return t;var a=pZ1();return a||"https://cdn.segment.com"},ET=function(){var t=MT();return"".concat(t,"/next-integrations")};function vV0(t,a){var n,r=Object.entries((n=a.integrations)!==null&&n!==void 0?n:{}).reduce(function(l,o){var i,c,u=o[0],d=o[1];return typeof d=="object"?q(q({},l),(i={},i[u]=d,i)):q(q({},l),(c={},c[u]={},c))},{});return Object.entries(t.integrations).reduce(function(l,o){var i,c=o[0],u=o[1];return q(q({},l),(i={},i[c]=q(q({},u),r[c]),i))},{})}function AV0(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return t}}function AZ1(t){return H0(this,void 0,void 0,function(){var a;return M0(this,function(n){return a=navigator.userAgentData,a?t?[2,a.getHighEntropyValues(t).catch(function(){return a.toJSON()})]:[2,a.toJSON()]:[2,void 0]})})}var fp;function gZ1(){if(fp)return fp;var t=eV0(window.location.href);return fp={expires:31536e6,secure:!1,path:"/"},t&&(fp.domain=t),fp}function ZZ1(t){var a={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1)),t=t.replace(/\?/g,"&");for(var n=t.split("&"),r=0,l=n;r<l.length;r++){var o=l[r],i=o.split("="),c=i[0],u=i[1];if(a[c])return{id:u,type:a[c]}}}function HZ1(t){return t.startsWith("?")&&(t=t.substring(1)),t=t.replace(/\?/g,"&"),t.split("&").reduce(function(a,n){var r=n.split("="),l=r[0],o=r[1],i=o===void 0?"":o;if(l.includes("utm_")&&l.length>4){var c=l.slice(4);c==="campaign"&&(c="name"),a[c]=AV0(i)}return a},{})}function MZ1(){var t=E6.get("_ga");if(t&&t.startsWith("amp"))return t}function EZ1(t,a,n){var r,l=new D7(n?[]:[new tV0(gZ1())]),o=l.get("s:context.referrer"),i=(r=ZZ1(t))!==null&&r!==void 0?r:o;i&&(a&&(a.referrer=q(q({},a.referrer),i)),l.set("s:context.referrer",i))}var VZ1=function(t){try{var a=new URLSearchParams;return Object.entries(t).forEach(function(n){var r=n[0],l=n[1];Array.isArray(l)?l.forEach(function(o){return a.append(r,o)}):a.append(r,l)}),a.toString()}catch{return""}},yZ1=function(){function t(){var a=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(n,r){return H0(a,void 0,void 0,function(){var l;return M0(this,function(o){switch(o.label){case 0:this.instance=r,o.label=1;case 1:return o.trys.push([1,3,,4]),l=this,[4,AZ1(this.instance.options.highEntropyValuesClientHints)];case 2:return l.userAgentData=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(n){var r,l,o=n.event.context,i=o.page.search||"",c=typeof i=="object"?VZ1(i):i;o.userAgent=navigator.userAgent,o.userAgentData=a.userAgentData;var u=navigator.userLanguage||navigator.language;typeof o.locale>"u"&&typeof u<"u"&&(o.locale=u),(r=o.library)!==null&&r!==void 0||(o.library={name:"analytics.js",version:"".concat("npm:next","-").concat(OM)}),c&&!o.campaign&&(o.campaign=HZ1(c));var d=MZ1();d&&(o.amp={id:d}),EZ1(c,o,(l=a.instance.options.disableClientPersistence)!==null&&l!==void 0?l:!1);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}return n},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}return t}(),bZ1=new yZ1;function gV0(t){var a=Array.prototype.slice.call(window.document.querySelectorAll("script"));return a.find(function(n){return n.src===t})}function J9(t,a){var n=gV0(t);if(n!==void 0){var r=n==null?void 0:n.getAttribute("status");if(r==="loaded")return Promise.resolve(n);if(r==="loading")return new Promise(function(l,o){n.addEventListener("load",function(){return l(n)}),n.addEventListener("error",function(i){return o(i)})})}return new Promise(function(l,o){var i,c=window.document.createElement("script");c.type="text/javascript",c.src=t,c.async=!0,c.setAttribute("status","loading");for(var u=0,d=Object.entries({});u<d.length;u++){var h=d[u],f=h[0],A=h[1];c.setAttribute(f,A)}c.onload=function(){c.onerror=c.onload=null,c.setAttribute("status","loaded"),l(c)},c.onerror=function(){c.onerror=c.onload=null,c.setAttribute("status","error"),o(new Error("Failed to load ".concat(t)))};var Z=window.document.querySelector("script");Z?(i=Z.parentElement)===null||i===void 0||i.insertBefore(c,Z):window.document.head.appendChild(c)})}function LZ1(t){var a=gV0(t);return a!==void 0&&a.remove(),Promise.resolve()}function VT(t,a,n){return H0(this,void 0,void 0,function(){function r(d,h){return H0(this,void 0,void 0,function(){var f,A,Z;return M0(this,function(H){switch(H.label){case 0:return f=!1,A=null,[4,h({payload:DM(d,{clone:!0,traverse:!1}),integration:t,next:function(y){f=!0,y===null&&(A=null),y&&(A=y.obj)}})];case 1:return H.sent(),!f&&A!==null&&(A=A,A.integrations=q(q({},d.integrations),(Z={},Z[t]=!1,Z))),[2,A]}})})}var l,o,i,c,u;return M0(this,function(d){switch(d.label){case 0:l=DM(a,{clone:!0,traverse:!1}).rawEvent(),o=0,i=n,d.label=1;case 1:return o<i.length?(c=i[o],[4,r(l,c)]):[3,4];case 2:if(u=d.sent(),u===null)return[2,null];l=u,d.label=3;case 3:return o++,[3,1];case 4:return[2,l]}})})}function SZ1(t,a){function n(r){return H0(this,void 0,void 0,function(){var l;return M0(this,function(o){switch(o.label){case 0:return l=!1,[4,t({payload:DM(r.event,{clone:!0,traverse:!1}),integrations:a??{},next:function(i){l=!0,i&&(r.event=i.obj)}})];case 1:if(o.sent(),!l)throw new Vi({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,r]}})})}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(r){return Promise.resolve(r)},track:n,page:n,screen:n,identify:n,alias:n,group:n}}const FZ1=Object.freeze(Object.defineProperty({__proto__:null,applyDestinationMiddleware:VT,sourceMiddlewarePlugin:SZ1},Symbol.toStringTag,{value:"Module"}));function Li(t,a){var n=a.methodName,r=a.integrationName,l=a.type,o=a.didError,i=o===void 0?!1:o;t.stats.increment("analytics_js.integration.invoke".concat(i?".error":""),1,["method:".concat(n),"integration_name:".concat(r),"type:".concat(l)])}var _Z1=function(){function t(a,n){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=Z9(),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=n,this.name=a,this.type=n.type,this.alternativeNames.push(n.name)}return t.prototype.addMiddleware=function(){for(var a,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this.type==="destination"&&(a=this.middleware).push.apply(a,n)},t.prototype.transform=function(a){return H0(this,void 0,void 0,function(){var n;return M0(this,function(r){switch(r.label){case 0:return[4,VT(this.name,a.event,this.middleware)];case 1:return n=r.sent(),n===null&&a.cancel(new Vi({retry:!1,reason:"dropped by destination middleware"})),[2,new bl(n)]}})})},t.prototype._createMethod=function(a){var n=this;return function(r){return H0(n,void 0,void 0,function(){var l,o;return M0(this,function(i){switch(i.label){case 0:return this.action[a]?(l=r,this.type!=="destination"?[3,2]:[4,this.transform(r)]):[2,r];case 1:l=i.sent(),i.label=2;case 2:return i.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!i.sent())throw new Error("Something prevented the destination from getting ready");return Li(r,{integrationName:this.action.name,methodName:a,type:"action"}),[4,this.action[a](l)];case 4:return i.sent(),[3,6];case 5:throw o=i.sent(),Li(r,{integrationName:this.action.name,methodName:a,type:"action",didError:!0}),o;case 6:return[2,r]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return H0(this,void 0,void 0,function(){return M0(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.loadPromise.promise];case 1:return a.sent(),[2,!0];case 2:return a.sent(),[2,!1];case 3:return[2]}})})},t.prototype.load=function(a,n){return H0(this,void 0,void 0,function(){var r,l,o,i;return M0(this,function(c){switch(c.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];c.label=1;case 1:return c.trys.push([1,3,,4]),Li(a,{integrationName:this.action.name,methodName:"load",type:"action"}),r=this.action.load(a,n),o=(l=this.loadPromise).resolve,[4,r];case 2:return o.apply(l,[c.sent()]),[2,r];case 3:throw i=c.sent(),Li(a,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(i),i;case 4:return[2]}})})},t.prototype.unload=function(a,n){var r,l;return(l=(r=this.action).unload)===null||l===void 0?void 0:l.call(r,a,n)},t}();function kZ1(t){if(!Array.isArray(t))throw new Error("Not a valid list of plugins");var a=["load","isLoaded","name","version","type"];return t.forEach(function(n){a.forEach(function(r){var l;if(n[r]===void 0)throw new Error("Plugin: ".concat((l=n.name)!==null&&l!==void 0?l:"unknown"," missing required function ").concat(r))})}),!0}function wZ1(t,a){var n=t[a.creationName],r=t[a.name];return t.All===!1&&!n&&!r||n===!1||r===!1}function CZ1(t,a){return H0(this,void 0,void 0,function(){var n,r,l,o,i,c;return M0(this,function(u){switch(u.label){case 0:if(u.trys.push([0,9,,10]),n=new RegExp("https://cdn.segment.(com|build)"),r=MT(),!a)return[3,6];l=t.url.split("/"),o=l[l.length-2],i=t.url.replace(o,btoa(o).replace(/=/g,"")),u.label=1;case 1:return u.trys.push([1,3,,5]),[4,J9(i.replace(n,r))];case 2:return u.sent(),[3,5];case 3:return u.sent(),[4,J9(t.url.replace(n,r))];case 4:return u.sent(),[3,5];case 5:return[3,8];case 6:return[4,J9(t.url.replace(n,r))];case 7:u.sent(),u.label=8;case 8:return typeof window[t.libraryName]=="function"?[2,window[t.libraryName]]:[3,10];case 9:throw c=u.sent(),console.error("Failed to create PluginFactory",t),c;case 10:return[2]}})})}function NZ1(t,a,n,r,l,o){var i,c,u;return H0(this,void 0,void 0,function(){var d,h,f,A=this;return M0(this,function(Z){switch(Z.label){case 0:return d=[],h=(c=(i=t.middlewareSettings)===null||i===void 0?void 0:i.routingRules)!==null&&c!==void 0?c:[],f=((u=t.remotePlugins)!==null&&u!==void 0?u:[]).map(function(H){return H0(A,void 0,void 0,function(){var y,b,S,_,w,T,N;return M0(this,function(P){switch(P.label){case 0:if(wZ1(a,H))return[2];P.label=1;case 1:return P.trys.push([1,6,,7]),b=o==null?void 0:o.find(function(x){var z=x.pluginName;return z===H.name}),b?[3,3]:[4,CZ1(H,r==null?void 0:r.obfuscate)];case 2:b=P.sent(),P.label=3;case 3:return y=b,y?(S=n[H.name],[4,y(q(q({},H.settings),S))]):[3,5];case 4:_=P.sent(),w=Array.isArray(_)?_:[_],kZ1(w),T=h.filter(function(x){return x.destinationName===H.creationName}),w.forEach(function(x){var z=new _Z1(H.creationName,x);T.length&&l&&z.addMiddleware(l),d.push(z)}),P.label=5;case 5:return[3,7];case 6:return N=P.sent(),console.warn("Failed to load Remote Plugin",N),[3,7];case 7:return[2]}})})}),[4,Promise.all(f)];case 1:return Z.sent(),[2,d.filter(Boolean)]}})})}var yT,ZV0,PZ1=sT(),HV0=(yT=(ZV0=PZ1).__SEGMENT_INSPECTOR__)!==null&&yT!==void 0?yT:ZV0.__SEGMENT_INSPECTOR__={},TZ1=function(t){var a;return(a=HV0.attach)===null||a===void 0?void 0:a.call(HV0,t)};function $Z1(t,a){return IM("".concat(a,"/v1/projects/").concat(t,"/settings")).then(function(n){return n.ok?n.json():n.text().then(function(r){throw new Error(r)})}).catch(function(n){throw console.error(n.message),n})}function IZ1(t){return fV0().NODE_ENV!=="test"&&Object.keys(t.integrations).length>1}function OZ1(t){var a,n,r;return fV0().NODE_ENV!=="test"&&((r=(n=(a=t.middlewareSettings)===null||a===void 0?void 0:a.routingRules)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0)>0}function xZ1(t,a){Gg1(t,a),Wg1(t,a)}function jZ1(t,a,n){return H0(this,void 0,void 0,function(){return M0(this,function(r){switch(r.label){case 0:return[4,DZ1(t,a)];case 1:return r.sent(),Yg1(t,n),[2]}})})}var RZ1=function(){var t,a,n=(t=window.location.hash)!==null&&t!==void 0?t:"",r=(a=window.location.search)!==null&&a!==void 0?a:"",l=r.length?r:n.replace(/(?=#).*(?=\?)/,"");return l},DZ1=function(t,a){return H0(void 0,void 0,void 0,function(){return M0(this,function(n){switch(n.label){case 0:return a.includes("ajs_")?[4,t.queryString(a).catch(console.error)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})};function zZ1(t,a,n,r,l,o,i){var c,u,d;return l===void 0&&(l=[]),H0(this,void 0,void 0,function(){var h,f,A,Z,H,y,b,S,_,w,T,N,P,x,z,Y=this;return M0(this,function(j){switch(j.label){case 0:return xZ1(n,i),h=l==null?void 0:l.filter(function(X){return typeof X=="object"}),f=l==null?void 0:l.filter(function(X){return typeof X=="function"&&typeof X.pluginName=="string"}),OZ1(a)?[4,Promise.resolve().then(()=>xfe).then(function(X){return X.tsubMiddleware(a.middlewareSettings.routingRules)})]:[3,2];case 1:return Z=j.sent(),[3,3];case 2:Z=void 0,j.label=3;case 3:return A=Z,IZ1(a)||o.length>0?[4,Promise.resolve().then(()=>Kfe).then(function(X){return X.ajsDestinations(t,a,n.integrations,r,A,o)})]:[3,5];case 4:return y=j.sent(),[3,6];case 5:y=[],j.label=6;case 6:return H=y,a.legacyVideoPluginsEnabled?[4,Promise.resolve().then(()=>Xfe).then(function(X){return X.loadLegacyVideoPlugins(n)})]:[3,8];case 7:j.sent(),j.label=8;case 8:return!((c=r.plan)===null||c===void 0)&&c.track?[4,Promise.resolve().then(()=>tve).then(function(X){var G;return X.schemaFilter((G=r.plan)===null||G===void 0?void 0:G.track,a)})]:[3,10];case 9:return S=j.sent(),[3,11];case 10:S=void 0,j.label=11;case 11:return b=S,_=vV0(a,r),[4,NZ1(a,n.integrations,_,r,A,f).catch(function(){return[]})];case 12:return w=j.sent(),T=K1(K1([bZ1],H,!0),w,!0),b&&T.push(b),N=((u=r.integrations)===null||u===void 0?void 0:u.All)===!1&&!r.integrations["Segment.io"]||r.integrations&&r.integrations["Segment.io"]===!1,N?[3,14]:(x=(P=T).push,[4,uZ1(n,_["Segment.io"],a.integrations)]);case 13:x.apply(P,[j.sent()]),j.label=14;case 14:return[4,n.register.apply(n,K1(K1([],T,!1),h,!1))];case 15:return z=j.sent(),[4,qg1(n,i)];case 16:return j.sent(),Object.entries((d=a.enabledMiddleware)!==null&&d!==void 0?d:{}).some(function(X){var G=X[1];return G})?[4,Promise.resolve().then(()=>nve).then(function(X){var G=X.remoteMiddlewares;return H0(Y,void 0,void 0,function(){var t0,o0;return M0(this,function(K){switch(K.label){case 0:return[4,G(z,a,r.obfuscate)];case 1:return t0=K.sent(),o0=t0.map(function(N0){return n.addSourceMiddleware(N0)}),[2,Promise.all(o0)]}})})})]:[3,18];case 17:j.sent(),j.label=18;case 18:return[4,Bg1(n,i)];case 19:return j.sent(),[2,z]}})})}function UZ1(t,a,n){var r,l,o,i,c,u,d,h,f;return a===void 0&&(a={}),H0(this,void 0,void 0,function(){var A,Z,H,y,b,S,_,w,T,N,P;return M0(this,function(x){switch(x.label){case 0:return a.disable===!0?[2,[new hV0,bl.system()]]:(a.globalAnalyticsKey&&Dg1(a.globalAnalyticsKey),t.cdnURL&&vZ1(t.cdnURL),a.initialPageview&&n.add(new AT("page",[])),A=RZ1(),Z=(r=t.cdnURL)!==null&&r!==void 0?r:MT(),(l=t.cdnSettings)!==null&&l!==void 0?(y=l,[3,3]):[3,1]);case 1:return[4,$Z1(t.writeKey,Z)];case 2:y=x.sent(),x.label=3;case 3:return H=y,a.updateCDNSettings&&(H=a.updateCDNSettings(H)),typeof a.disable!="function"?[3,5]:[4,a.disable(H)];case 4:if(b=x.sent(),b)return[2,[new hV0,bl.system()]];x.label=5;case 5:return S=(i=(o=H.integrations["Segment.io"])===null||o===void 0?void 0:o.retryQueue)!==null&&i!==void 0?i:!0,a=q({retryQueue:S},a),_=new dV0(q(q({},t),{cdnSettings:H,cdnURL:Z}),a),TZ1(_),w=(c=t.plugins)!==null&&c!==void 0?c:[],T=(u=t.classicIntegrations)!==null&&u!==void 0?u:[],N=(d=a.integrations)===null||d===void 0?void 0:d["Segment.io"],qE0.initRemoteMetrics(q(q({},H.metrics),{host:(h=N==null?void 0:N.apiHost)!==null&&h!==void 0?h:(f=H.metrics)===null||f===void 0?void 0:f.host,protocol:N==null?void 0:N.protocol})),[4,zZ1(t.writeKey,H,_,a,w,T,n)];case 6:return P=x.sent(),_.initialized=!0,_.emit("initialize",t,a),[4,jZ1(_,A,n)];case 7:return x.sent(),[2,[_,P]]}})})}var BZ1=function(t){Ke(a,t);function a(){var n=this,r=Z9(),l=r.promise,o=r.resolve;return n=t.call(this,function(i){return l.then(function(c){var u=c[0],d=c[1];return UZ1(u,d,i)})})||this,n._resolveLoadStart=function(i,c){return o([i,c])},n}return a.prototype.load=function(n,r){return r===void 0&&(r={}),this._resolveLoadStart(n,r),this},a.load=function(n,r){return r===void 0&&(r={}),new a().load(n,r)},a.standalone=function(n,r){return a.load({writeKey:n},r).then(function(l){return l[0]})},a}(Qg1);function MV0(){const{currentChurch:t}=mp(),a=e.useMemo(()=>t!=null&&t.webSegmentKey?BZ1.load({writeKey:t.webSegmentKey}):null,[t==null?void 0:t.webSegmentKey]);e.useEffect(()=>{t!=null&&t.webAmplitudeKey&&BA1(t.webAmplitudeKey)},[t==null?void 0:t.webAmplitudeKey]);const n=e.useCallback(({userId:o,event:i,properties:c={}})=>{try{a&&a.track(i,{...c,userId:o}),t!=null&&t.webAmplitudeKey&&OE0(i,c,{...c,user_id:o})}catch(u){console.error("Analytics tracking error:",u)}},[a,t==null?void 0:t.webAmplitudeKey]),r=e.useCallback(o=>{try{a&&a.page({name:o.title,properties:{path:o.path,title:o.title,url:typeof window<"u"?window.location.href:"",userId:o.userId,email:o.email,...o.properties}}),t!=null&&t.webAmplitudeKey&&OE0("Page View",{path:o.path,title:o.title,userId:o.userId,email:o.email,...o.properties})}catch(i){console.error("Analytics page view tracking error:",i)}},[a,t==null?void 0:t.webAmplitudeKey]),l=e.useCallback(o=>{try{a&&a.identify(o.id,{...o})}catch(i){console.error("Analytics user identification error:",i)}},[a]);return{trackEvent:n,trackPageView:r,identifyUser:l}}const EV0=e.createContext("light"),VV0=e.createContext(null),yV0=()=>{const t=e.useContext(EV0);if(t===void 0)throw new Error("useColorScheme must be used within a ThemeProvider");return t},qZ1=()=>{const t=e.useContext(VV0);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},bT=t=>{if(!t)return null;const a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return a?`${parseInt(a[1],16)} ${parseInt(a[2],16)} ${parseInt(a[3],16)}`:null},bV0=()=>{if(typeof window>"u")return"light";const t=document.documentElement;return t.classList.contains("dark")?"dark":t.classList.contains("light")?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};function LV0({theme:t=n2,...a}){const[n,r]=e.useState(bV0),[l,o]=e.useState({...n2,colors:{...n2.colors[n],base:{...n2.colors[n].base,primary:n2.colors[n].base.primary,secondary:n2.colors[n].base.secondary,tertiary:n2.colors[n].base.tertiary},text:{...n2.colors[n].text,action:n2.colors[n].text.action}}}),{currentChurch:i,loading:c,error:u}=mp();return e.useEffect(()=>{if(typeof window>"u")return;const d=()=>{const Z=bV0();Z!==n&&r(Z)},h=new MutationObserver(d);h.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const f=window.matchMedia("(prefers-color-scheme: dark)"),A=Z=>{const H=document.documentElement;!H.classList.contains("dark")&&!H.classList.contains("light")&&r(Z.matches?"dark":"light")};return f.addEventListener("change",A),()=>{h.disconnect(),f.removeEventListener("change",A)}},[n]),e.useEffect(()=>{o({...n2,colors:{...n2.colors[n],base:{...n2.colors[n].base,primary:n2.colors[n].base.primary,secondary:n2.colors[n].base.secondary,tertiary:n2.colors[n].base.tertiary},text:{...n2.colors[n].text,action:n2.colors[n].text.action}}})},[n]),e.useEffect(()=>{var d,h,f,A,Z,H,y;if(i&&i.theme)try{const b=JSON.parse(i==null?void 0:i.theme);o({...n2,colors:{...n2.colors[n],base:{...n2.colors[n].base,primary:((d=b==null?void 0:b.colors)==null?void 0:d.primary)||n2.colors[n].base.primary,secondary:((h=b==null?void 0:b.colors)==null?void 0:h.secondary)||n2.colors[n].base.secondary,tertiary:((f=b==null?void 0:b.colors)==null?void 0:f.tertiary)||n2.colors[n].base.tertiary},text:{...n2.colors[n].text,action:((A=b==null?void 0:b.colors)==null?void 0:A.secondary)||n2.colors[n].text.action}}});const S=document.documentElement;if((Z=b==null?void 0:b.colors)!=null&&Z.primary){const _=bT(b.colors.primary);_&&S.style.setProperty("--color-brand-primary",_)}if((H=b==null?void 0:b.colors)!=null&&H.secondary){const _=bT(b.colors.secondary);_&&S.style.setProperty("--color-brand-secondary",_)}if((y=b==null?void 0:b.colors)!=null&&y.tertiary){const _=bT(b.colors.tertiary);_&&S.style.setProperty("--color-brand-tertiary",_)}}catch(b){console.error("ThemeProvider - Error parsing church theme:",b),console.error("ThemeProvider - Raw theme string:",i.theme)}},[i,n]),F.jsx(YZ0,{theme:l,children:F.jsx(EV0.Provider,{value:n,children:F.jsx(VV0.Provider,{value:l,children:a.children})})})}LV0.propTypes={children:t1.node.isRequired,theme:t1.object};const LT=t=>t&&t.id?t.id:!1,SV0=t=>{if(!LT(t))return"one-time";const a=t.id.toLowerCase();return a==="monthly"?"monthly":a==="weekly"?"weekly":a==="every 2 weeks"?"every-2-weeks":"monthly"},WZ1=t=>{switch(t){case"weekly":return"Weekly";case"every-2-weeks":return"Every 2 Weeks";case"monthly":return"Monthly";case"one-time":return null;case void 0:return null;default:return"Monthly"}},UM=t=>{if(t==="one-time")return null;const a=WZ1(t);return x7.find(n=>n.id===a)||null},GZ1=(t,a)=>{if(t==="one-time")return{interval:"off",intervalCount:1};const n=UM(t);return n?{interval:n.intervalUnit,intervalCount:n.intervalCount,...a&&{startDate:a}}:{interval:"month",intervalCount:1}},YZ1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,24V88H36V68ZM36,188V112H220v76Zm172-24a12,12,0,0,1-12,12H164a12,12,0,0,1,0-24h32A12,12,0,0,1,208,164Zm-68,0a12,12,0,0,1-12,12H116a12,12,0,0,1,0-24h12A12,12,0,0,1,140,164Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M232,96v96a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V96Z",opacity:"0.2"}),e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM136,176H120a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm64,0H168a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16ZM32,88V64H224V88Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM32,62H224a2,2,0,0,1,2,2V90H30V64A2,2,0,0,1,32,62ZM224,194H32a2,2,0,0,1-2-2V102H226v90A2,2,0,0,1,224,194Zm-18-26a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h32A6,6,0,0,1,206,168Zm-64,0a6,6,0,0,1-6,6H120a6,6,0,0,1,0-12h16A6,6,0,0,1,142,168Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM32,60H224a4,4,0,0,1,4,4V92H28V64A4,4,0,0,1,32,60ZM224,196H32a4,4,0,0,1-4-4V100H228v92A4,4,0,0,1,224,196Zm-20-28a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h32A4,4,0,0,1,204,168Zm-64,0a4,4,0,0,1-4,4H120a4,4,0,0,1,0-8h16A4,4,0,0,1,140,168Z"}))]]),ST=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:YZ1}));ST.displayName="CreditCardIcon";const FV0=ST,KZ1=Object.freeze(Object.defineProperty({__proto__:null,CreditCard:FV0,CreditCardIcon:ST},Symbol.toStringTag,{value:"Module"}));function QZ1(t){if(typeof t!="string"||!t.length)return!1;const a=t.match(/^[0-9]{10,10}$/);return a?a.length===1:!1}function T3(t){if(t===null||t===!0||t===!1)return NaN;var a=Number(t);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}function O6(t,a){if(a.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+a.length+" present")}function yn(t){O6(1,arguments);var a=Object.prototype.toString.call(t);return t instanceof Date||mM(t)==="object"&&a==="[object Date]"?new Date(t.getTime()):typeof t=="number"||a==="[object Number]"?new Date(t):((typeof t=="string"||a==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function XZ1(t,a){O6(2,arguments);var n=yn(t),r=T3(a);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function JZ1(t,a){O6(2,arguments);var n=yn(t),r=T3(a);if(isNaN(r))return new Date(NaN);if(!r)return n;var l=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var i=o.getDate();return l>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),l),n)}function eH1(t,a){O6(2,arguments);var n=yn(t).getTime(),r=T3(a);return new Date(n+r)}var tH1={};function BM(){return tH1}function aH1(t){var a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),t.getTime()-a.getTime()}function nH1(t){return O6(1,arguments),t instanceof Date||mM(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function rH1(t){if(O6(1,arguments),!nH1(t)&&typeof t!="number")return!1;var a=yn(t);return!isNaN(Number(a))}function lH1(t,a){O6(2,arguments);var n=T3(a);return eH1(t,-n)}var oH1=864e5;function iH1(t){O6(1,arguments);var a=yn(t),n=a.getTime();a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0);var r=a.getTime(),l=n-r;return Math.floor(l/oH1)+1}function qM(t){O6(1,arguments);var a=1,n=yn(t),r=n.getUTCDay(),l=(r<a?7:0)+r-a;return n.setUTCDate(n.getUTCDate()-l),n.setUTCHours(0,0,0,0),n}function _V0(t){O6(1,arguments);var a=yn(t),n=a.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var l=qM(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var i=qM(o);return a.getTime()>=l.getTime()?n+1:a.getTime()>=i.getTime()?n:n-1}function cH1(t){O6(1,arguments);var a=_V0(t),n=new Date(0);n.setUTCFullYear(a,0,4),n.setUTCHours(0,0,0,0);var r=qM(n);return r}var sH1=6048e5;function uH1(t){O6(1,arguments);var a=yn(t),n=qM(a).getTime()-cH1(a).getTime();return Math.round(n/sH1)+1}function WM(t,a){var n,r,l,o,i,c,u,d;O6(1,arguments);var h=BM(),f=T3((n=(r=(l=(o=a==null?void 0:a.weekStartsOn)!==null&&o!==void 0?o:a==null||(i=a.locale)===null||i===void 0||(c=i.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&l!==void 0?l:h.weekStartsOn)!==null&&r!==void 0?r:(u=h.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var A=yn(t),Z=A.getUTCDay(),H=(Z<f?7:0)+Z-f;return A.setUTCDate(A.getUTCDate()-H),A.setUTCHours(0,0,0,0),A}function kV0(t,a){var n,r,l,o,i,c,u,d;O6(1,arguments);var h=yn(t),f=h.getUTCFullYear(),A=BM(),Z=T3((n=(r=(l=(o=a==null?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:a==null||(i=a.locale)===null||i===void 0||(c=i.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&l!==void 0?l:A.firstWeekContainsDate)!==null&&r!==void 0?r:(u=A.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(Z>=1&&Z<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var H=new Date(0);H.setUTCFullYear(f+1,0,Z),H.setUTCHours(0,0,0,0);var y=WM(H,a),b=new Date(0);b.setUTCFullYear(f,0,Z),b.setUTCHours(0,0,0,0);var S=WM(b,a);return h.getTime()>=y.getTime()?f+1:h.getTime()>=S.getTime()?f:f-1}function mH1(t,a){var n,r,l,o,i,c,u,d;O6(1,arguments);var h=BM(),f=T3((n=(r=(l=(o=a==null?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:a==null||(i=a.locale)===null||i===void 0||(c=i.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&l!==void 0?l:h.firstWeekContainsDate)!==null&&r!==void 0?r:(u=h.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1),A=kV0(t,a),Z=new Date(0);Z.setUTCFullYear(A,0,f),Z.setUTCHours(0,0,0,0);var H=WM(Z,a);return H}var dH1=6048e5;function hH1(t,a){O6(1,arguments);var n=yn(t),r=WM(n,a).getTime()-mH1(n,a).getTime();return Math.round(r/dH1)+1}function c8(t,a){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<a;)r="0"+r;return n+r}var Si={y:function(a,n){var r=a.getUTCFullYear(),l=r>0?r:1-r;return c8(n==="yy"?l%100:l,n.length)},M:function(a,n){var r=a.getUTCMonth();return n==="M"?String(r+1):c8(r+1,2)},d:function(a,n){return c8(a.getUTCDate(),n.length)},a:function(a,n){var r=a.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(a,n){return c8(a.getUTCHours()%12||12,n.length)},H:function(a,n){return c8(a.getUTCHours(),n.length)},m:function(a,n){return c8(a.getUTCMinutes(),n.length)},s:function(a,n){return c8(a.getUTCSeconds(),n.length)},S:function(a,n){var r=n.length,l=a.getUTCMilliseconds(),o=Math.floor(l*Math.pow(10,r-3));return c8(o,n.length)}},eu={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},pH1={G:function(a,n,r){var l=a.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(l,{width:"abbreviated"});case"GGGGG":return r.era(l,{width:"narrow"});case"GGGG":default:return r.era(l,{width:"wide"})}},y:function(a,n,r){if(n==="yo"){var l=a.getUTCFullYear(),o=l>0?l:1-l;return r.ordinalNumber(o,{unit:"year"})}return Si.y(a,n)},Y:function(a,n,r,l){var o=kV0(a,l),i=o>0?o:1-o;if(n==="YY"){var c=i%100;return c8(c,2)}return n==="Yo"?r.ordinalNumber(i,{unit:"year"}):c8(i,n.length)},R:function(a,n){var r=_V0(a);return c8(r,n.length)},u:function(a,n){var r=a.getUTCFullYear();return c8(r,n.length)},Q:function(a,n,r){var l=Math.ceil((a.getUTCMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return c8(l,2);case"Qo":return r.ordinalNumber(l,{unit:"quarter"});case"QQQ":return r.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(l,{width:"wide",context:"formatting"})}},q:function(a,n,r){var l=Math.ceil((a.getUTCMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return c8(l,2);case"qo":return r.ordinalNumber(l,{unit:"quarter"});case"qqq":return r.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(l,{width:"wide",context:"standalone"})}},M:function(a,n,r){var l=a.getUTCMonth();switch(n){case"M":case"MM":return Si.M(a,n);case"Mo":return r.ordinalNumber(l+1,{unit:"month"});case"MMM":return r.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(l,{width:"wide",context:"formatting"})}},L:function(a,n,r){var l=a.getUTCMonth();switch(n){case"L":return String(l+1);case"LL":return c8(l+1,2);case"Lo":return r.ordinalNumber(l+1,{unit:"month"});case"LLL":return r.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(l,{width:"wide",context:"standalone"})}},w:function(a,n,r,l){var o=hH1(a,l);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):c8(o,n.length)},I:function(a,n,r){var l=uH1(a);return n==="Io"?r.ordinalNumber(l,{unit:"week"}):c8(l,n.length)},d:function(a,n,r){return n==="do"?r.ordinalNumber(a.getUTCDate(),{unit:"date"}):Si.d(a,n)},D:function(a,n,r){var l=iH1(a);return n==="Do"?r.ordinalNumber(l,{unit:"dayOfYear"}):c8(l,n.length)},E:function(a,n,r){var l=a.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(l,{width:"short",context:"formatting"});case"EEEE":default:return r.day(l,{width:"wide",context:"formatting"})}},e:function(a,n,r,l){var o=a.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return c8(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(a,n,r,l){var o=a.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return c8(i,n.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(a,n,r){var l=a.getUTCDay(),o=l===0?7:l;switch(n){case"i":return String(o);case"ii":return c8(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(l,{width:"short",context:"formatting"});case"iiii":default:return r.day(l,{width:"wide",context:"formatting"})}},a:function(a,n,r){var l=a.getUTCHours(),o=l/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(a,n,r){var l=a.getUTCHours(),o;switch(l===12?o=eu.noon:l===0?o=eu.midnight:o=l/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(a,n,r){var l=a.getUTCHours(),o;switch(l>=17?o=eu.evening:l>=12?o=eu.afternoon:l>=4?o=eu.morning:o=eu.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(a,n,r){if(n==="ho"){var l=a.getUTCHours()%12;return l===0&&(l=12),r.ordinalNumber(l,{unit:"hour"})}return Si.h(a,n)},H:function(a,n,r){return n==="Ho"?r.ordinalNumber(a.getUTCHours(),{unit:"hour"}):Si.H(a,n)},K:function(a,n,r){var l=a.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(l,{unit:"hour"}):c8(l,n.length)},k:function(a,n,r){var l=a.getUTCHours();return l===0&&(l=24),n==="ko"?r.ordinalNumber(l,{unit:"hour"}):c8(l,n.length)},m:function(a,n,r){return n==="mo"?r.ordinalNumber(a.getUTCMinutes(),{unit:"minute"}):Si.m(a,n)},s:function(a,n,r){return n==="so"?r.ordinalNumber(a.getUTCSeconds(),{unit:"second"}):Si.s(a,n)},S:function(a,n){return Si.S(a,n)},X:function(a,n,r,l){var o=l._originalDate||a,i=o.getTimezoneOffset();if(i===0)return"Z";switch(n){case"X":return CV0(i);case"XXXX":case"XX":return U7(i);case"XXXXX":case"XXX":default:return U7(i,":")}},x:function(a,n,r,l){var o=l._originalDate||a,i=o.getTimezoneOffset();switch(n){case"x":return CV0(i);case"xxxx":case"xx":return U7(i);case"xxxxx":case"xxx":default:return U7(i,":")}},O:function(a,n,r,l){var o=l._originalDate||a,i=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+wV0(i,":");case"OOOO":default:return"GMT"+U7(i,":")}},z:function(a,n,r,l){var o=l._originalDate||a,i=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+wV0(i,":");case"zzzz":default:return"GMT"+U7(i,":")}},t:function(a,n,r,l){var o=l._originalDate||a,i=Math.floor(o.getTime()/1e3);return c8(i,n.length)},T:function(a,n,r,l){var o=l._originalDate||a,i=o.getTime();return c8(i,n.length)}};function wV0(t,a){var n=t>0?"-":"+",r=Math.abs(t),l=Math.floor(r/60),o=r%60;if(o===0)return n+String(l);var i=a;return n+String(l)+i+c8(o,2)}function CV0(t,a){if(t%60===0){var n=t>0?"-":"+";return n+c8(Math.abs(t)/60,2)}return U7(t,a)}function U7(t,a){var n=a||"",r=t>0?"-":"+",l=Math.abs(t),o=c8(Math.floor(l/60),2),i=c8(l%60,2);return r+o+n+i}var NV0=function(a,n){switch(a){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},PV0=function(a,n){switch(a){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},fH1=function(a,n){var r=a.match(/(P+)(p+)?/)||[],l=r[1],o=r[2];if(!o)return NV0(a,n);var i;switch(l){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",NV0(l,n)).replace("{{time}}",PV0(o,n))},vH1={p:PV0,P:fH1},AH1=["D","DD"],gH1=["YY","YYYY"];function ZH1(t){return AH1.indexOf(t)!==-1}function HH1(t){return gH1.indexOf(t)!==-1}function TV0(t,a,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(a,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(a,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(a,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(a,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var MH1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},EH1=function(a,n,r){var l,o=MH1[a];return typeof o=="string"?l=o:n===1?l=o.one:l=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+l:l+" ago":l};function FT(t){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=a.width?String(a.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var VH1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yH1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bH1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},LH1={date:FT({formats:VH1,defaultWidth:"full"}),time:FT({formats:yH1,defaultWidth:"full"}),dateTime:FT({formats:bH1,defaultWidth:"full"})},SH1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},FH1=function(a,n,r,l){return SH1[a]};function vp(t){return function(a,n){var r=n!=null&&n.context?String(n.context):"standalone",l;if(r==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,i=n!=null&&n.width?String(n.width):o;l=t.formattingValues[i]||t.formattingValues[o]}else{var c=t.defaultWidth,u=n!=null&&n.width?String(n.width):t.defaultWidth;l=t.values[u]||t.values[c]}var d=t.argumentCallback?t.argumentCallback(a):a;return l[d]}}var _H1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kH1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wH1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},CH1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},NH1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},PH1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},TH1=function(a,n){var r=Number(a),l=r%100;if(l>20||l<10)switch(l%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},$H1={ordinalNumber:TH1,era:vp({values:_H1,defaultWidth:"wide"}),quarter:vp({values:kH1,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:vp({values:wH1,defaultWidth:"wide"}),day:vp({values:CH1,defaultWidth:"wide"}),dayPeriod:vp({values:NH1,defaultWidth:"wide",formattingValues:PH1,defaultFormattingWidth:"wide"})};function Ap(t){return function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,l=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=a.match(l);if(!o)return null;var i=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(c)?OH1(c,function(f){return f.test(i)}):IH1(c,function(f){return f.test(i)}),d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;var h=a.slice(i.length);return{value:d,rest:h}}}function IH1(t,a){for(var n in t)if(t.hasOwnProperty(n)&&a(t[n]))return n}function OH1(t,a){for(var n=0;n<t.length;n++)if(a(t[n]))return n}function xH1(t){return function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.match(t.matchPattern);if(!r)return null;var l=r[0],o=a.match(t.parsePattern);if(!o)return null;var i=t.valueCallback?t.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;var c=a.slice(l.length);return{value:i,rest:c}}}var jH1=/^(\d+)(th|st|nd|rd)?/i,RH1=/\d+/i,DH1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},zH1={any:[/^b/i,/^(a|c)/i]},UH1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BH1={any:[/1/i,/2/i,/3/i,/4/i]},qH1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},WH1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},GH1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},YH1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},KH1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},QH1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},XH1={ordinalNumber:xH1({matchPattern:jH1,parsePattern:RH1,valueCallback:function(a){return parseInt(a,10)}}),era:Ap({matchPatterns:DH1,defaultMatchWidth:"wide",parsePatterns:zH1,defaultParseWidth:"any"}),quarter:Ap({matchPatterns:UH1,defaultMatchWidth:"wide",parsePatterns:BH1,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:Ap({matchPatterns:qH1,defaultMatchWidth:"wide",parsePatterns:WH1,defaultParseWidth:"any"}),day:Ap({matchPatterns:GH1,defaultMatchWidth:"wide",parsePatterns:YH1,defaultParseWidth:"any"}),dayPeriod:Ap({matchPatterns:KH1,defaultMatchWidth:"any",parsePatterns:QH1,defaultParseWidth:"any"})},JH1={code:"en-US",formatDistance:EH1,formatLong:LH1,formatRelative:FH1,localize:$H1,match:XH1,options:{weekStartsOn:0,firstWeekContainsDate:1}},eM1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tM1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aM1=/^'([^]*?)'?$/,nM1=/''/g,rM1=/[a-zA-Z]/;function lM1(t,a,n){var r,l,o,i,c,u,d,h,f,A,Z,H,y,b;O6(2,arguments);var S=String(a),_=BM(),w=(r=(l=void 0)!==null&&l!==void 0?l:_.locale)!==null&&r!==void 0?r:JH1,T=T3((o=(i=(c=(u=void 0)!==null&&u!==void 0?u:void 0)!==null&&c!==void 0?c:_.firstWeekContainsDate)!==null&&i!==void 0?i:(d=_.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=T3((f=(A=(Z=(H=void 0)!==null&&H!==void 0?H:void 0)!==null&&Z!==void 0?Z:_.weekStartsOn)!==null&&A!==void 0?A:(y=_.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&f!==void 0?f:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!w.localize)throw new RangeError("locale must contain localize property");if(!w.formatLong)throw new RangeError("locale must contain formatLong property");var P=yn(t);if(!rH1(P))throw new RangeError("Invalid time value");var x=aH1(P),z=lH1(P,x),Y={firstWeekContainsDate:T,weekStartsOn:N,locale:w,_originalDate:P},j=S.match(tM1).map(function(X){var G=X[0];if(G==="p"||G==="P"){var t0=vH1[G];return t0(X,w.formatLong)}return X}).join("").match(eM1).map(function(X){if(X==="''")return"'";var G=X[0];if(G==="'")return oM1(X);var t0=pH1[G];if(t0)return HH1(X)&&TV0(X,a,String(t)),ZH1(X)&&TV0(X,a,String(t)),t0(z,X,w.localize,Y);if(G.match(rM1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+G+"`");return X}).join("");return j}function oM1(t){var a=t.match(aM1);return a?a[1].replace(nM1,"'"):t}const iM1=t=>{const[a,n,r]=t.split("-").map(Number);return new Date(a,n-1,r)},_T=t=>{const a=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${a}-${n}-${r}`},$V0=()=>_T(new Date),IV0=t=>{const a=new Date;return t.intervalUnit==="month"?JZ1(a,t.intervalCount):XZ1(a,t.intervalCount)},cM1=(t,a)=>{if(!t)return!0;const n=$V0(),r=IV0(a),l=_T(r);return t>=n&&t<=l},OV0=t=>!(t!=null&&t.donationFunds)||t.donationFunds.length===0?null:[...t.donationFunds].sort((n,r)=>(n.displayOrder??0)-(r.displayOrder??0))[0];function sM1(t,a){if(!(a!=null&&a.donationFunds)||a.donationFunds.length===0)return null;if(!t)return OV0(a);const n=a.donationFunds.find(i=>i.id===t.id);if(n)return n;if(t.parentFund){const i=a.donationFunds.find(c=>{var u,d;return((u=c.parentFund)==null?void 0:u.id)===((d=t.parentFund)==null?void 0:d.id)});if(i)return i}const r=BP(t.name.replace(/_/g," ")),l=t.displayName?BP(t.displayName.replace(/_/g," ")):null,o=a.donationFunds.find(i=>!!(r&&Zr(r,i.name)||l&&Zr(l,i.name)||r&&i.displayName&&Zr(r,i.displayName)||l&&i.displayName&&Zr(l,i.displayName)));return o||OV0(a)}const GM=t=>Number(t).toFixed(2),bn=t=>{if(typeof t=="string"){const a=parseFloat(t);return isNaN(a)?0:a}return t||0},kT=({churchName:t,churchLogo:a,message:n,title:r,displayLogo:l,theme:o})=>{var u,d;const i=l!=="false"&&a,c=r&&r.trim()!==""?r:`Give to ${t}`;return F.jsxs("div",{className:"sticky top-0 z-10 px-6 py-4 bg-system-chrome dark:bg-system-chrome-dark text-center",children:[i?F.jsx("div",{className:"mb-3",children:F.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mx-auto",style:{backgroundColor:((d=(u=o==null?void 0:o.colors)==null?void 0:u.base)==null?void 0:d.primary)||"#00676D"},children:F.jsx("img",{src:a,alt:`${t} logo`,className:"max-w-[60px] max-h-[60px] object-contain"})})}):null,c?F.jsx(re,{as:"h4",className:"text-lg font-medium",children:c}):null,n&&n!==""?F.jsx(re,{className:"text-sm mt-2",fg:"secondary",children:n}):null]})};kT.propTypes={churchName:t1.string.isRequired,churchLogo:t1.string,message:t1.string,title:t1.string,displayLogo:t1.string};const xV0=({amount:t,selectedFrequency:a,selectedCampusId:n,selectedFundId:r,clientSecret:l,onSuccess:o,onError:i,isProcessing:c=!1,onProcessingChange:u,onBack:d,userFullName:h,userEmail:f,userPhone:A,churchName:Z,churchLogo:H,message:y,displayLogo:b,title:S,displayHeader:_})=>{var Q0;const w=Yf1(),T=Uf1(),{currentChurch:N}=mp(),{campuses:P}=UP(),{trackEvent:x}=MV0(),[z,Y]=e.useState(!1),[j,X]=e.useState(h||""),[G,t0]=e.useState(f||""),K=yV0()==="dark",N0=h0=>{const G0=h0.replace(/\D/g,"").slice(0,10);return G0.length===0?"":G0.length<=3?G0:G0.length<=6?`(${G0.slice(0,3)}) ${G0.slice(3)}`:`(${G0.slice(0,3)}) ${G0.slice(3,6)}-${G0.slice(6)}`},[y0,u0]=e.useState(A?N0(A):""),b0=h0=>{const a1=N0(h0.target.value);u0(a1)},R=LT(a),n0=P.find(h0=>h0.id===n),s0=(Q0=n0==null?void 0:n0.donationFunds)==null?void 0:Q0.find(h0=>h0.id===r),W=()=>{const h0={name:`${(n0==null?void 0:n0.name)||"Church"} Donation`,amount:Math.round(bn(t)*100)};return s0&&(h0.name=`${s0.displayName||s0.name} Donation`),[h0]},l0=()=>!R||!a?void 0:{recurringPaymentRequest:{paymentDescription:`${Z} ${a.id} donation`,managementURL:(N==null?void 0:N.givingWebUrl)||window.location.href,regularBilling:{amount:Math.round(bn(t)*100),label:`${a.id} donation`,recurringPaymentIntervalUnit:a.intervalUnit,recurringPaymentIntervalCount:a.intervalCount}}},d0=async h0=>{const{error:a1,paymentIntent:G0,setupIntent:h1}=h0;if(a1){console.error("Payment error:",a1);const g1=new Error(a1.message||"Payment failed");throw i(g1),g1}const S1=G0||h1;if(S1&&S1.status==="succeeded")return x({event:"Donation Completed",properties:{user_id:"",group_id:(N==null?void 0:N.slug)||"",email:G,phone:y0,is_logged_in:!1,amount:bn(t),fund:r||"",schedule:R&&a?`${a.intervalCount} ${a.intervalUnit}`:"one-time",is_recurring:!!(R&&a)},userId:G}),typeof o=="function"&&o(),!0;if(S1&&S1.status==="requires_action")console.warn("Payment requires additional action:",S1),i(new Error("Payment requires additional authentication"));else{if(S1&&S1.status==="processing")return console.warn("Payment is being processed:",S1),x({event:"Donation Completed",properties:{user_id:"",group_id:(N==null?void 0:N.slug)||"",email:G,phone:y0,is_logged_in:!1,amount:bn(t),fund:r||"",schedule:R&&a?`${a.intervalCount} ${a.intervalUnit}`:"one-time",is_recurring:!!(R&&a)},userId:G}),typeof o=="function"&&o(),!0;console.warn("Payment not successful, status:",S1==null?void 0:S1.status),i(new Error(`Payment not successful. Status: ${(S1==null?void 0:S1.status)||"unknown"}`))}return!1},e0=async(h0={})=>{var S1;if(!w||!T)throw new Error("Stripe or Elements not available");const a1=((S1=T._lastSubmittedOptions)==null?void 0:S1.clientSecret)||l,G0=a1==null?void 0:a1.includes("seti_"),h1={elements:T,redirect:"if_required",confirmParams:{payment_method_data:{billing_details:{name:j,email:G,phone:y0},metadata:{amount:bn(t).toString(),frequency:a?a.id:"one-time",campusId:n||"",fundId:r||"",isRecurring:R&&a?"true":"false",churchSlug:(N==null?void 0:N.slug)||""}},...h0}};return G0?await w.confirmSetup(h1):await w.confirmPayment(h1)},L0=async h0=>{var a1,G0,h1,S1;if(!w||!T)throw new Error("Stripe or Elements not available");try{const{error:g1}=await T.submit();if(g1)throw g1;const{error:v1,confirmationToken:e1}=await w.createConfirmationToken({elements:T,params:{payment_method_data:{billing_details:{email:(a1=h0.detail)==null?void 0:a1.email,phone:(G0=h0.detail)==null?void 0:G0.phone,name:(h1=h0.detail)==null?void 0:h1.name},metadata:{amount:bn(t).toString(),frequency:a?a.id:"one-time",campusId:n||"",fundId:r||"",isRecurring:R&&a?"true":"false",churchSlug:(N==null?void 0:N.slug)||""}},return_url:window.location.href}});if(v1)throw v1;const K0=((S1=T._lastSubmittedOptions)==null?void 0:S1.clientSecret)||l,j0=K0==null?void 0:K0.includes("seti_"),i1={clientSecret:K0,confirmParams:{confirmation_token:e1.id}};return j0?await w.confirmSetup(i1):await w.confirmPayment(i1)}catch(g1){throw console.error("Express checkout payment error:",g1),g1}},a0=async h0=>{if(h0.preventDefault(),!w||!T)return;if(!j.trim()){i(new Error("Please enter your full name"));return}if(!G.trim()){i(new Error("Please enter your email address"));return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(G)){i(new Error("Please enter a valid email address"));return}if(!QZ1(y0.replace(/\D/g,""))){i(new Error("Please enter a valid 10-digit phone number"));return}u(!0);let G0=!1;try{const h1=await e0();G0=await d0(h1)}catch(h1){console.error("Payment error:",h1),i(h1 instanceof Error?h1:new Error("Payment failed"))}finally{G0||u(!1)}},g0=async h0=>{if(!w)return;x({event:"Apple Pay Button Tapped",properties:{}}),u(!0);let a1=!1;try{const G0=await L0(h0);a1=await d0(G0)}catch(G0){console.error("Express checkout payment error:",G0),i(G0 instanceof Error?G0:new Error("Express checkout payment failed"))}finally{a1||u(!1)}},A0=()=>{Y(!0)},E0=(N==null?void 0:N.givingFullPlatform)===!0?void 0:W(),Z0=(N==null?void 0:N.givingFullPlatform)===!0?void 0:l0(),c0=(N==null?void 0:N.givingFullPlatform)===!0?void 0:{emailRequired:!0,phoneNumberRequired:!0,lineItems:E0,applePay:Z0,buttonType:{applePay:"donate",googlePay:"donate"},buttonTheme:{applePay:K?"white":"black",googlePay:K?"white":"black"},paymentMethods:{amazonPay:"never",applePay:"auto",googlePay:"auto",link:"never",paypal:"never",klarna:"never"}};return F.jsx("div",{className:"flex flex-col h-full min-h-[400px]","data-testid":"donation-payment-form",children:F.jsxs("form",{onSubmit:a0,className:"h-full flex flex-col",children:[F.jsx(qe,{type:"button",onClick:d,disabled:c,surface:"tinted",circular:!0,className:"absolute top-4 left-4 z-20 w-10 h-10 flex items-center justify-center",children:F.jsx(HP,{size:20})}),_!=="false"?F.jsx(kT,{churchName:Z,churchLogo:H,message:y,title:S,displayLogo:b,theme:void 0}):null,(N==null?void 0:N.givingFullPlatform)===!0?F.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:F.jsxs("div",{className:"space-y-4",children:[F.jsxs($x0,{className:"space-y-2",children:[F.jsxs(dS,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-1",children:[F.jsx(hS,{htmlFor:"fullName",className:"!font-normal !text-gray-700 dark:!text-gray-300",children:"Full Name"}),F.jsx(il,{type:"text",id:"fullName",name:"fullName",value:j,onChange:h0=>X(h0.target.value),required:!0,placeholder:"Enter your full name",className:"text-sm h-11 px-3 py-2"})]}),F.jsxs(dS,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-1",children:[F.jsx(hS,{htmlFor:"email",className:"!font-normal !text-gray-700 dark:!text-gray-300",children:"Email Address"}),F.jsx(il,{type:"email",id:"email",name:"email",value:G,onChange:h0=>t0(h0.target.value),required:!0,placeholder:"Enter your email address",className:"text-sm h-11 px-3 py-2"})]}),F.jsxs(dS,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-1",children:[F.jsx(hS,{htmlFor:"phoneNumber",className:"!font-normal !text-gray-700 dark:!text-gray-300",children:"Phone Number"}),F.jsx(il,{type:"tel",id:"phoneNumber",name:"phoneNumber",value:y0,onChange:b0,required:!0,placeholder:"(555) 555-5555",className:"text-sm h-11 px-3 py-2"})]})]}),F.jsx("div",{children:F.jsx(Kf1,{options:{paymentMethodOrder:["us_bank_account","card"],wallets:{applePay:"auto",googlePay:"auto",link:"never"},fields:{billingDetails:{name:"never",email:"never",phone:"never",address:"auto"}}}})})]})}):F.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:F.jsx("div",{className:"h-full flex items-center justify-center",children:F.jsxs("div",{className:"text-center space-y-2",children:[F.jsxs("div",{className:"flex items-start justify-center",children:[F.jsx("span",{className:"text-3xl leading-normal font-bold text-brand",children:"$"}),F.jsx("span",{className:"text-[60px] font-bold text-brand leading-none",children:GM(bn(t))})]}),F.jsxs("div",{className:"space-y-1",children:[F.jsxs("div",{className:"flex items-center justify-center gap-2",children:[F.jsxs(re,{className:"text-sm",fg:"secondary",children:[R&&a?a.id:"One-time"," ","Donation"]}),R&&a?F.jsx(re,{className:"text-sm",fg:"secondary",children:"Recurring payment"}):null]}),n0&&s0?F.jsxs("div",{className:"flex items-center justify-center gap-2",children:[F.jsx(re,{className:"text-sm",fg:"secondary",children:n0.name}),F.jsx(re,{className:"text-sm",fg:"secondary",children:"•"}),F.jsx(re,{className:"text-sm",fg:"secondary",children:s0.displayName||s0.name})]}):null]})]})})}),F.jsx("div",{className:"sticky bottom-0 z-10 p-4 border-t border-system-regular bg-system-chrome dark:bg-system-chrome-dark dark:border-white/5",children:(N==null?void 0:N.givingFullPlatform)===!0?F.jsxs("div",{className:"space-y-4",children:[F.jsx(qe,{type:"submit",className:"w-full",disabled:!w||c,surface:"solid",children:c?"Processing...":`Complete $${GM(bn(t))} ${R&&a?a.id:"one-time"} Donation`}),F.jsx(re,{className:"text-sm text-center",fg:"secondary",children:"Your payment is secure and encrypted"})]}):F.jsxs("div",{className:"space-y-4",style:{display:z?"block":"none"},children:[F.jsx(Qf1,{options:c0,onConfirm:g0,onReady:A0}),F.jsxs(qe,{href:N==null?void 0:N.givingWebUrl,target:"_blank",rel:"noopener noreferrer",className:"w-full !rounded-[5px]",disabled:!w||c,surface:"system",children:[F.jsx(FV0,{size:20}),"Other Payment Methods"]})]})})]})})};xV0.propTypes={amount:t1.oneOfType([t1.string,t1.number]).isRequired,selectedFrequency:t1.object,selectedCampusId:t1.string,selectedFundId:t1.string,onSuccess:t1.func.isRequired,onError:t1.func.isRequired,isProcessing:t1.bool,onProcessingChange:t1.func.isRequired,onBack:t1.func.isRequired,churchName:t1.string.isRequired,churchLogo:t1.string,message:t1.string,displayLogo:t1.string,title:t1.string,displayHeader:t1.string};const uM1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),e.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"}))]]),wT=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:uM1}));wT.displayName="ArrowsClockwiseIcon";const jV0=wT,mM1=Object.freeze(Object.defineProperty({__proto__:null,ArrowsClockwise:jV0,ArrowsClockwiseIcon:wT},Symbol.toStringTag,{value:"Module"})),dM1=({startDate:t,frequency:a,onStartDateChange:n,disabled:r=!1})=>{const l=e.useRef(null),o=e.useMemo(()=>$V0(),[]),i=e.useMemo(()=>IV0(a),[a]),c=_T(i),u=A=>{if(A===null)return"Today";const Z=iM1(A);return lM1(Z,"MMMM d, yyyy")},d=A=>{const Z=A.target.value;Z===o?n(null):Z&&n(Z)},h=()=>{var A;if(!r&&l.current)try{l.current.focus(),l.current.showPicker()}catch{(A=l.current)==null||A.focus()}},f=t||o;return F.jsxs("div",{children:[F.jsx(re,{className:"mb-2 text-sm",fg:"secondary",children:"Starting"}),F.jsxs("div",{className:"relative",children:[F.jsx(il,{type:"text",value:u(t),readOnly:!0,onClick:h,className:"cursor-pointer"}),F.jsx("input",{ref:l,type:"date",value:f,min:o,max:c,onChange:d,disabled:r,tabIndex:-1,className:"absolute top-0 left-0 w-full h-full opacity-0 pointer-events-none"})]})]})},hM1=`
1954
1954
  /* Custom selection color using theme colors */
1955
1955
  input::selection {