@dcl/jump-site 0.0.3 → 0.0.4-15333861590.commit-7791f49

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.
@@ -1 +1 @@
1
- import{g as _}from"./index-DqK5yzRc.js";function I(g,S){for(var f=0;f<S.length;f++){const l=S[f];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in g)){const i=Object.getOwnPropertyDescriptor(l,s);i&&Object.defineProperty(g,s,i.get?i:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}var w={exports:{}};(function(g,S){(function(f,l){g.exports=l()})(window,function(){return function(f){var l={};function s(i){if(l[i])return l[i].exports;var u=l[i]={i,l:!1,exports:{}};return f[i].call(u.exports,u,u.exports,s),u.l=!0,u.exports}return s.m=f,s.c=l,s.d=function(i,u,c){s.o(i,u)||Object.defineProperty(i,u,{enumerable:!0,get:c})},s.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},s.t=function(i,u){if(1&u&&(i=s(i)),8&u||4&u&&typeof i=="object"&&i&&i.__esModule)return i;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:i}),2&u&&typeof i!="string")for(var d in i)s.d(c,d,(function(p){return i[p]}).bind(null,d));return c},s.n=function(i){var u=i&&i.__esModule?function(){return i.default}:function(){return i};return s.d(u,"a",u),u},s.o=function(i,u){return Object.prototype.hasOwnProperty.call(i,u)},s.p="",s(s.s=2)}([function(f,l,s){s.r(l);var i=typeof fetch=="function"?fetch.bind():function(u,c){return c=c||{},new Promise(function(d,p){var r=new XMLHttpRequest;for(var a in r.open(c.method||"get",u,!0),c.headers)r.setRequestHeader(a,c.headers[a]);function t(){var e,n=[],o=[],h={};return r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(y,m,b){n.push(m=m.toLowerCase()),o.push([m,b]),e=h[m],h[m]=e?e+","+b:b}),{ok:(r.status/100|0)==2,status:r.status,statusText:r.statusText,url:r.responseURL,clone:t,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},headers:{keys:function(){return n},entries:function(){return o},get:function(y){return h[y.toLowerCase()]},has:function(y){return y.toLowerCase()in h}}}}r.withCredentials=c.credentials=="include",r.onload=function(){d(t())},r.onerror=p,r.send(c.body)})};l.default=i},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function c(d,p){for(var r=0;r<p.length;r++){var a=p[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}}return function(d,p,r){return p&&c(d.prototype,p),r&&c(d,r),d}}(),u=function(){function c(d,p){(function(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")})(this,c),this.pluginName=d}return i(c,[{key:"track",value:function(d,p){window.analytics.track(d,p,{integration:{name:this.pluginName}})}}]),c}();l.default=u},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.YouTubeAnalytics=l.VimeoAnalytics=void 0;var i=c(s(3)),u=c(s(4));function c(d){return d&&d.__esModule?d:{default:d}}l.VimeoAnalytics=i.default,l.YouTubeAnalytics=u.default},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function p(r,a){for(var t=0;t<a.length;t++){var e=a[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,e.key,e)}}return function(r,a,t){return a&&p(r.prototype,a),t&&p(r,t),r}}(),u=c(s(0));function c(p){return p&&p.__esModule?p:{default:p}}var d=function(p){function r(a,t){(function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")})(this,r);var e=function(n,o){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||typeof o!="object"&&typeof o!="function"?n:o}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,"VimeoAnalytics"));return e.authToken=t,e.player=a,e.metadata={content:{},playback:{videoPlayer:"Vimeo"}},e.mostRecentHeartbeat=0,e.isPaused=!1,e}return function(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(a,t):a.__proto__=t)}(r,p),i(r,[{key:"initialize",value:function(){var a=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var e in t)this.registerHandler(e,t[e]);this.player.getVideoId().then(function(n){a.retrieveMetadata({id:n})}).catch(console.error)}},{key:"registerHandler",value:function(a,t){var e=this;this.player.on(a,function(n){e.updateMetadata(n),t.call(e,n)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var a=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==a&&t-a>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(t))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(a){var t=this;return new Promise(function(e,n){var o=a.id;(0,u.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+t.authToken}}).then(function(h){return h.ok?h.json():n(h)}).then(function(h){t.metadata.content.title=h.name,t.metadata.content.description=h.description,t.metadata.content.publisher=h.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=h.duration}).catch(function(h){return console.error("Request to Vimeo API Failed with: ",h),n(h)})})}},{key:"updateMetadata",value:function(a){var t=this;return new Promise(function(e,n){t.player.getVolume().then(function(o){o&&(t.metadata.playback.sound=100*o),t.metadata.playback.position=a.seconds,e()}).catch(n)})}}]),r}(c(s(1)).default);l.default=d},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}}(),u=d(s(0)),c=d(s(1));function d(a){return a&&a.__esModule?a:{default:a}}var p=function(a){function t(e,n){(function(h,y){if(!(h instanceof y))throw new TypeError("Cannot call a class as a function")})(this,t);var o=function(h,y){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!y||typeof y!="object"&&typeof y!="function"?h:y}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return o.player=e,o.apiKey=n,o.playerLoaded=!1,o.playbackStarted=!1,o.contentStarted=!1,o.isPaused=!1,o.isBuffering=!1,o.isSeeking=!1,o.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},o.metadata=[{playback:{video_player:"youtube"},content:{}}],o.playlistIndex=0,o}return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(t,a),i(t,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(e){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(e){var n=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=n,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),e.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var e=this;return new Promise(function(n,o){var h=e.player.getVideoData(),y=e.player.getPlaylist()||[h.video_id],m=y.join();(0,u.default)("https://www.googleapis.com/youtube/v3/videos?id="+m+"&part=snippet,contentDetails&key="+e.apiKey).then(function(b){if(!b.ok){var v=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw v.response=b,v}return b.json()}).then(function(b){e.metadata=[];for(var v=0,k=0;k<y.length;k++){var P=b.items[k];e.metadata.push({content:{title:P.snippet.title,description:P.snippet.description,keywords:P.snippet.tags,channel:P.snippet.channelTitle,airdate:P.snippet.publishedAt}}),v+=r(P.contentDetails.duration)}for(k=0;k<y.length;k++)e.metadata[k].playback={total_length:v,video_player:"youtube"};n()}).catch(function(b){e.metadata=y.map(function(v){return{playback:{video_player:"youtube"},content:{}}}),o(b)})})}},{key:"handleBuffer",value:function(){var e=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),e&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var n=this.player.getPlaylist();n&&this.player.getCurrentTime()===0&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===n.length-1&&this.player.getPlaylistIndex()===0&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),this.playlistIndex===-1&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var e=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(e?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var e=this.player.getPlaylistIndex(),n=this.player.getPlaylist();(n&&e===n.length-1||e===-1)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var e=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,n=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-n)>2e3}}]),t}(c.default);function r(a){var t=a.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map(function(e){if(e!=null)return e.replace(/\D/,"")}),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}l.default=p}])})})(w);var x=w.exports;const O=_(x),C=I({__proto__:null,default:O},[x]);export{C as i};
1
+ import{j as _}from"./index-BshNlYaQ.js";function I(g,S){for(var f=0;f<S.length;f++){const l=S[f];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in g)){const i=Object.getOwnPropertyDescriptor(l,s);i&&Object.defineProperty(g,s,i.get?i:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}var w={exports:{}};(function(g,S){(function(f,l){g.exports=l()})(window,function(){return function(f){var l={};function s(i){if(l[i])return l[i].exports;var u=l[i]={i,l:!1,exports:{}};return f[i].call(u.exports,u,u.exports,s),u.l=!0,u.exports}return s.m=f,s.c=l,s.d=function(i,u,c){s.o(i,u)||Object.defineProperty(i,u,{enumerable:!0,get:c})},s.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},s.t=function(i,u){if(1&u&&(i=s(i)),8&u||4&u&&typeof i=="object"&&i&&i.__esModule)return i;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:i}),2&u&&typeof i!="string")for(var d in i)s.d(c,d,(function(p){return i[p]}).bind(null,d));return c},s.n=function(i){var u=i&&i.__esModule?function(){return i.default}:function(){return i};return s.d(u,"a",u),u},s.o=function(i,u){return Object.prototype.hasOwnProperty.call(i,u)},s.p="",s(s.s=2)}([function(f,l,s){s.r(l);var i=typeof fetch=="function"?fetch.bind():function(u,c){return c=c||{},new Promise(function(d,p){var r=new XMLHttpRequest;for(var a in r.open(c.method||"get",u,!0),c.headers)r.setRequestHeader(a,c.headers[a]);function t(){var e,n=[],o=[],h={};return r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(y,m,b){n.push(m=m.toLowerCase()),o.push([m,b]),e=h[m],h[m]=e?e+","+b:b}),{ok:(r.status/100|0)==2,status:r.status,statusText:r.statusText,url:r.responseURL,clone:t,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},headers:{keys:function(){return n},entries:function(){return o},get:function(y){return h[y.toLowerCase()]},has:function(y){return y.toLowerCase()in h}}}}r.withCredentials=c.credentials=="include",r.onload=function(){d(t())},r.onerror=p,r.send(c.body)})};l.default=i},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function c(d,p){for(var r=0;r<p.length;r++){var a=p[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}}return function(d,p,r){return p&&c(d.prototype,p),r&&c(d,r),d}}(),u=function(){function c(d,p){(function(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")})(this,c),this.pluginName=d}return i(c,[{key:"track",value:function(d,p){window.analytics.track(d,p,{integration:{name:this.pluginName}})}}]),c}();l.default=u},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.YouTubeAnalytics=l.VimeoAnalytics=void 0;var i=c(s(3)),u=c(s(4));function c(d){return d&&d.__esModule?d:{default:d}}l.VimeoAnalytics=i.default,l.YouTubeAnalytics=u.default},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function p(r,a){for(var t=0;t<a.length;t++){var e=a[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,e.key,e)}}return function(r,a,t){return a&&p(r.prototype,a),t&&p(r,t),r}}(),u=c(s(0));function c(p){return p&&p.__esModule?p:{default:p}}var d=function(p){function r(a,t){(function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")})(this,r);var e=function(n,o){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||typeof o!="object"&&typeof o!="function"?n:o}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,"VimeoAnalytics"));return e.authToken=t,e.player=a,e.metadata={content:{},playback:{videoPlayer:"Vimeo"}},e.mostRecentHeartbeat=0,e.isPaused=!1,e}return function(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(a,t):a.__proto__=t)}(r,p),i(r,[{key:"initialize",value:function(){var a=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var e in t)this.registerHandler(e,t[e]);this.player.getVideoId().then(function(n){a.retrieveMetadata({id:n})}).catch(console.error)}},{key:"registerHandler",value:function(a,t){var e=this;this.player.on(a,function(n){e.updateMetadata(n),t.call(e,n)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var a=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==a&&t-a>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(t))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(a){var t=this;return new Promise(function(e,n){var o=a.id;(0,u.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+t.authToken}}).then(function(h){return h.ok?h.json():n(h)}).then(function(h){t.metadata.content.title=h.name,t.metadata.content.description=h.description,t.metadata.content.publisher=h.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=h.duration}).catch(function(h){return console.error("Request to Vimeo API Failed with: ",h),n(h)})})}},{key:"updateMetadata",value:function(a){var t=this;return new Promise(function(e,n){t.player.getVolume().then(function(o){o&&(t.metadata.playback.sound=100*o),t.metadata.playback.position=a.seconds,e()}).catch(n)})}}]),r}(c(s(1)).default);l.default=d},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}}(),u=d(s(0)),c=d(s(1));function d(a){return a&&a.__esModule?a:{default:a}}var p=function(a){function t(e,n){(function(h,y){if(!(h instanceof y))throw new TypeError("Cannot call a class as a function")})(this,t);var o=function(h,y){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!y||typeof y!="object"&&typeof y!="function"?h:y}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return o.player=e,o.apiKey=n,o.playerLoaded=!1,o.playbackStarted=!1,o.contentStarted=!1,o.isPaused=!1,o.isBuffering=!1,o.isSeeking=!1,o.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},o.metadata=[{playback:{video_player:"youtube"},content:{}}],o.playlistIndex=0,o}return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(t,a),i(t,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(e){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(e){var n=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=n,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),e.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var e=this;return new Promise(function(n,o){var h=e.player.getVideoData(),y=e.player.getPlaylist()||[h.video_id],m=y.join();(0,u.default)("https://www.googleapis.com/youtube/v3/videos?id="+m+"&part=snippet,contentDetails&key="+e.apiKey).then(function(b){if(!b.ok){var v=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw v.response=b,v}return b.json()}).then(function(b){e.metadata=[];for(var v=0,k=0;k<y.length;k++){var P=b.items[k];e.metadata.push({content:{title:P.snippet.title,description:P.snippet.description,keywords:P.snippet.tags,channel:P.snippet.channelTitle,airdate:P.snippet.publishedAt}}),v+=r(P.contentDetails.duration)}for(k=0;k<y.length;k++)e.metadata[k].playback={total_length:v,video_player:"youtube"};n()}).catch(function(b){e.metadata=y.map(function(v){return{playback:{video_player:"youtube"},content:{}}}),o(b)})})}},{key:"handleBuffer",value:function(){var e=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),e&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var n=this.player.getPlaylist();n&&this.player.getCurrentTime()===0&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===n.length-1&&this.player.getPlaylistIndex()===0&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),this.playlistIndex===-1&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var e=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(e?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var e=this.player.getPlaylistIndex(),n=this.player.getPlaylist();(n&&e===n.length-1||e===-1)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var e=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,n=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-n)>2e3}}]),t}(c.default);function r(a){var t=a.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map(function(e){if(e!=null)return e.replace(/\D/,"")}),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}l.default=p}])})})(w);var x=w.exports;const O=_(x),C=I({__proto__:null,default:O},[x]);export{C as i};
@@ -0,0 +1 @@
1
+ import{H as Qt,c as Nt,a as Et,t as Jt,b as de,w as he,r as P,d as ge,e as we,f as pe,g as be}from"./index.es-Dfb5Cko7.js";import"./index-BshNlYaQ.js";function ye(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const o=BigInt(32),s=BigInt(4294967295),c=Number(t>>o&s),f=Number(t&s),i=r?4:0,u=r?0:4;n.setUint32(e+i,c,r),n.setUint32(e+u,f,r)}function me(n,e,t){return n&e^~n&t}function xe(n,e,t){return n&e^n&t^e&t}class Ee extends Qt{constructor(e,t,r,o){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Nt(this.buffer)}update(e){Et(this);const{view:t,buffer:r,blockLen:o}=this;e=Jt(e);const s=e.length;for(let c=0;c<s;){const f=Math.min(o-this.pos,s-c);if(f===o){const i=Nt(e);for(;o<=s-c;c+=o)this.process(i,c);continue}r.set(e.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Et(this),de(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:s}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(r,0),c=0);for(let h=c;h<o;h++)t[h]=0;ye(r,o-8,BigInt(this.length*8),s),this.process(r,0);const f=Nt(e),i=this.outputLen;if(i%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=i/4,y=this.get();if(u>y.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)f.setUint32(4*h,y[h],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:o,finished:s,destroyed:c,pos:f}=this;return e.length=o,e.pos=f,e.finished=s,e.destroyed=c,o%t&&e.buffer.set(r),e}}const Be=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),J=new Uint32Array(64);class ve extends Ee{constructor(){super(64,32,8,!1),this.A=Q[0]|0,this.B=Q[1]|0,this.C=Q[2]|0,this.D=Q[3]|0,this.E=Q[4]|0,this.F=Q[5]|0,this.G=Q[6]|0,this.H=Q[7]|0}get(){const{A:e,B:t,C:r,D:o,E:s,F:c,G:f,H:i}=this;return[e,t,r,o,s,c,f,i]}set(e,t,r,o,s,c,f,i){this.A=e|0,this.B=t|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=c|0,this.G=f|0,this.H=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)J[h]=e.getUint32(t,!1);for(let h=16;h<64;h++){const l=J[h-15],m=J[h-2],N=P(l,7)^P(l,18)^l>>>3,b=P(m,17)^P(m,19)^m>>>10;J[h]=b+J[h-7]+N+J[h-16]|0}let{A:r,B:o,C:s,D:c,E:f,F:i,G:u,H:y}=this;for(let h=0;h<64;h++){const l=P(f,6)^P(f,11)^P(f,25),m=y+l+me(f,i,u)+Be[h]+J[h]|0,b=(P(r,2)^P(r,13)^P(r,22))+xe(r,o,s)|0;y=u,u=i,i=f,f=c+m|0,c=s,s=o,o=r,r=m+b|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,c=c+this.D|0,f=f+this.E|0,i=i+this.F|0,u=u+this.G|0,y=y+this.H|0,this.set(r,o,s,c,f,i,u,y)}roundClean(){J.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Se=he(()=>new ve);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Bt=BigInt(0),vt=BigInt(1),Ae=BigInt(2);function it(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function yt(n){if(!it(n))throw new Error("Uint8Array expected")}function ut(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}const Ie=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function lt(n){yt(n);let e="";for(let t=0;t<n.length;t++)e+=Ie[n[t]];return e}function at(n){const e=n.toString(16);return e.length&1?"0"+e:e}function Rt(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?Bt:BigInt("0x"+n)}const D={_0:48,_9:57,A:65,F:70,a:97,f:102};function Yt(n){if(n>=D._0&&n<=D._9)return n-D._0;if(n>=D.A&&n<=D.F)return n-(D.A-10);if(n>=D.a&&n<=D.f)return n-(D.a-10)}function dt(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let o=0,s=0;o<t;o++,s+=2){const c=Yt(n.charCodeAt(s)),f=Yt(n.charCodeAt(s+1));if(c===void 0||f===void 0){const i=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+i+'" at index '+s)}r[o]=c*16+f}return r}function rt(n){return Rt(lt(n))}function Mt(n){return yt(n),Rt(lt(Uint8Array.from(n).reverse()))}function ht(n,e){return dt(n.toString(16).padStart(e*2,"0"))}function Vt(n,e){return ht(n,e).reverse()}function Ne(n){return dt(at(n))}function K(n,e,t){let r;if(typeof e=="string")try{r=dt(e)}catch(s){throw new Error(n+" must be hex string or Uint8Array, cause: "+s)}else if(it(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const o=r.length;if(typeof t=="number"&&o!==t)throw new Error(n+" of length "+t+" expected, got "+o);return r}function bt(...n){let e=0;for(let r=0;r<n.length;r++){const o=n[r];yt(o),e+=o.length}const t=new Uint8Array(e);for(let r=0,o=0;r<n.length;r++){const s=n[r];t.set(s,o),o+=s.length}return t}function qe(n,e){if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++)t|=n[r]^e[r];return t===0}function Oe(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}const qt=n=>typeof n=="bigint"&&Bt<=n;function St(n,e,t){return qt(n)&&qt(e)&&qt(t)&&e<=n&&n<t}function ot(n,e,t,r){if(!St(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function te(n){let e;for(e=0;n>Bt;n>>=vt,e+=1);return e}function Le(n,e){return n>>BigInt(e)&vt}function He(n,e,t){return n|(t?vt:Bt)<<BigInt(e)}const jt=n=>(Ae<<BigInt(n-1))-vt,Ot=n=>new Uint8Array(n),Ft=n=>Uint8Array.from(n);function ee(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=Ot(n),o=Ot(n),s=0;const c=()=>{r.fill(1),o.fill(0),s=0},f=(...h)=>t(o,r,...h),i=(h=Ot())=>{o=f(Ft([0]),h),r=f(),h.length!==0&&(o=f(Ft([1]),h),r=f())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const l=[];for(;h<e;){r=f();const m=r.slice();l.push(m),h+=r.length}return bt(...l)};return(h,l)=>{c(),i(h);let m;for(;!(m=l(u()));)i();return c(),m}}const Ue={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||it(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function mt(n,e,t={}){const r=(o,s,c)=>{const f=Ue[s];if(typeof f!="function")throw new Error("invalid validator function");const i=n[o];if(!(c&&i===void 0)&&!f(i,n))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+i)};for(const[o,s]of Object.entries(e))r(o,s,!1);for(const[o,s]of Object.entries(t))r(o,s,!0);return n}const Te=()=>{throw new Error("not implemented")};function _t(n){const e=new WeakMap;return(t,...r)=>{const o=e.get(t);if(o!==void 0)return o;const s=n(t,...r);return e.set(t,s),s}}const _e=Object.freeze(Object.defineProperty({__proto__:null,aInRange:ot,abool:ut,abytes:yt,bitGet:Le,bitLen:te,bitMask:jt,bitSet:He,bytesToHex:lt,bytesToNumberBE:rt,bytesToNumberLE:Mt,concatBytes:bt,createHmacDrbg:ee,ensureBytes:K,equalBytes:qe,hexToBytes:dt,hexToNumber:Rt,inRange:St,isBytes:it,memoized:_t,notImplemented:Te,numberToBytesBE:ht,numberToBytesLE:Vt,numberToHexUnpadded:at,numberToVarBytesBE:Ne,utf8ToBytes:Oe,validateObject:mt},Symbol.toStringTag,{value:"Module"}));class ne extends Qt{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ge(e);const r=Jt(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?e.create().update(r).digest():r);for(let c=0;c<s.length;c++)s[c]^=54;this.iHash.update(s),this.oHash=e.create();for(let c=0;c<s.length;c++)s[c]^=106;this.oHash.update(s),s.fill(0)}update(e){return Et(this),this.iHash.update(e),this}digestInto(e){Et(this),we(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:o,destroyed:s,blockLen:c,outputLen:f}=this;return e=e,e.finished=o,e.destroyed=s,e.blockLen=c,e.outputLen=f,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const re=(n,e,t)=>new ne(n,e).update(t).digest();re.create=(n,e)=>new ne(n,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const z=BigInt(0),T=BigInt(1),nt=BigInt(2),ke=BigInt(3),kt=BigInt(4),Kt=BigInt(5),Pt=BigInt(8);function V(n,e){const t=n%e;return t>=z?t:e+t}function ze(n,e,t){if(e<z)throw new Error("invalid exponent, negatives unsupported");if(t<=z)throw new Error("invalid modulus");if(t===T)return z;let r=T;for(;e>z;)e&T&&(r=r*n%t),n=n*n%t,e>>=T;return r}function Y(n,e,t){let r=n;for(;e-- >z;)r*=r,r%=t;return r}function zt(n,e){if(n===z)throw new Error("invert: expected non-zero number");if(e<=z)throw new Error("invert: expected positive modulus, got "+e);let t=V(n,e),r=e,o=z,s=T;for(;t!==z;){const f=r/t,i=r%t,u=o-s*f;r=t,t=i,o=s,s=u}if(r!==T)throw new Error("invert: does not exist");return V(o,e)}function Ce(n){const e=(n-T)/nt;let t,r,o;for(t=n-T,r=0;t%nt===z;t/=nt,r++);for(o=nt;o<n&&ze(o,e,n)!==n-T;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const c=(n+T)/kt;return function(i,u){const y=i.pow(u,c);if(!i.eql(i.sqr(y),u))throw new Error("Cannot find square root");return y}}const s=(t+T)/nt;return function(f,i){if(f.pow(i,e)===f.neg(f.ONE))throw new Error("Cannot find square root");let u=r,y=f.pow(f.mul(f.ONE,o),t),h=f.pow(i,s),l=f.pow(i,t);for(;!f.eql(l,f.ONE);){if(f.eql(l,f.ZERO))return f.ZERO;let m=1;for(let b=f.sqr(l);m<u&&!f.eql(b,f.ONE);m++)b=f.sqr(b);const N=f.pow(y,T<<BigInt(u-m-1));y=f.sqr(N),h=f.mul(h,N),l=f.mul(l,y),u=m}return h}}function Ze(n){if(n%kt===ke){const e=(n+T)/kt;return function(r,o){const s=r.pow(o,e);if(!r.eql(r.sqr(s),o))throw new Error("Cannot find square root");return s}}if(n%Pt===Kt){const e=(n-Kt)/Pt;return function(r,o){const s=r.mul(o,nt),c=r.pow(s,e),f=r.mul(o,c),i=r.mul(r.mul(f,nt),c),u=r.mul(f,r.sub(i,r.ONE));if(!r.eql(r.sqr(u),o))throw new Error("Cannot find square root");return u}}return Ce(n)}const Re=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Me(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=Re.reduce((r,o)=>(r[o]="function",r),e);return mt(n,t)}function Ve(n,e,t){if(t<z)throw new Error("invalid exponent, negatives unsupported");if(t===z)return n.ONE;if(t===T)return e;let r=n.ONE,o=e;for(;t>z;)t&T&&(r=n.mul(r,o)),o=n.sqr(o),t>>=T;return r}function je(n,e){const t=new Array(e.length),r=e.reduce((s,c,f)=>n.is0(c)?s:(t[f]=s,n.mul(s,c)),n.ONE),o=n.inv(r);return e.reduceRight((s,c,f)=>n.is0(c)?s:(t[f]=n.mul(s,t[f]),n.mul(s,c)),o),t}function oe(n,e){const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function ie(n,e,t=!1,r={}){if(n<=z)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:o,nByteLength:s}=oe(n,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:n,isLE:t,BITS:o,BYTES:s,MASK:jt(o),ZERO:z,ONE:T,create:i=>V(i,n),isValid:i=>{if(typeof i!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof i);return z<=i&&i<n},is0:i=>i===z,isOdd:i=>(i&T)===T,neg:i=>V(-i,n),eql:(i,u)=>i===u,sqr:i=>V(i*i,n),add:(i,u)=>V(i+u,n),sub:(i,u)=>V(i-u,n),mul:(i,u)=>V(i*u,n),pow:(i,u)=>Ve(f,i,u),div:(i,u)=>V(i*zt(u,n),n),sqrN:i=>i*i,addN:(i,u)=>i+u,subN:(i,u)=>i-u,mulN:(i,u)=>i*u,inv:i=>zt(i,n),sqrt:r.sqrt||(i=>(c||(c=Ze(n)),c(f,i))),invertBatch:i=>je(f,i),cmov:(i,u,y)=>y?u:i,toBytes:i=>t?Vt(i,s):ht(i,s),fromBytes:i=>{if(i.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+i.length);return t?Mt(i):rt(i)}});return Object.freeze(f)}function se(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function ce(n){const e=se(n);return e+Math.ceil(e/2)}function Ye(n,e,t=!1){const r=n.length,o=se(e),s=ce(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const c=t?Mt(n):rt(n),f=V(c,e-T)+T;return t?Vt(f,o):ht(f,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Gt=BigInt(0),xt=BigInt(1);function Lt(n,e){const t=e.negate();return n?t:e}function fe(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function Ht(n,e){fe(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1);return{windows:t,windowSize:r}}function Fe(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function Ke(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const Ut=new WeakMap,ae=new WeakMap;function Tt(n){return ae.get(n)||1}function Pe(n,e){return{constTimeNegate:Lt,hasPrecomputes(t){return Tt(t)!==1},unsafeLadder(t,r,o=n.ZERO){let s=t;for(;r>Gt;)r&xt&&(o=o.add(s)),s=s.double(),r>>=xt;return o},precomputeWindow(t,r){const{windows:o,windowSize:s}=Ht(r,e),c=[];let f=t,i=f;for(let u=0;u<o;u++){i=f,c.push(i);for(let y=1;y<s;y++)i=i.add(f),c.push(i);f=i.double()}return c},wNAF(t,r,o){const{windows:s,windowSize:c}=Ht(t,e);let f=n.ZERO,i=n.BASE;const u=BigInt(2**t-1),y=2**t,h=BigInt(t);for(let l=0;l<s;l++){const m=l*c;let N=Number(o&u);o>>=h,N>c&&(N-=y,o+=xt);const b=m,a=m+Math.abs(N)-1,g=l%2!==0,x=N<0;N===0?i=i.add(Lt(g,r[b])):f=f.add(Lt(x,r[a]))}return{p:f,f:i}},wNAFUnsafe(t,r,o,s=n.ZERO){const{windows:c,windowSize:f}=Ht(t,e),i=BigInt(2**t-1),u=2**t,y=BigInt(t);for(let h=0;h<c;h++){const l=h*f;if(o===Gt)break;let m=Number(o&i);if(o>>=y,m>f&&(m-=u,o+=xt),m===0)continue;let N=r[l+Math.abs(m)-1];m<0&&(N=N.negate()),s=s.add(N)}return s},getPrecomputes(t,r,o){let s=Ut.get(r);return s||(s=this.precomputeWindow(r,t),t!==1&&Ut.set(r,o(s))),s},wNAFCached(t,r,o){const s=Tt(t);return this.wNAF(s,this.getPrecomputes(s,t,o),r)},wNAFCachedUnsafe(t,r,o,s){const c=Tt(t);return c===1?this.unsafeLadder(t,r,s):this.wNAFUnsafe(c,this.getPrecomputes(c,t,o),r,s)},setWindowSize(t,r){fe(r,e),ae.set(t,r),Ut.delete(t)}}}function Ge(n,e,t,r){if(Fe(t,n),Ke(r,e),t.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=n.ZERO,s=te(BigInt(t.length)),c=s>12?s-3:s>4?s-2:s?2:1,f=(1<<c)-1,i=new Array(f+1).fill(o),u=Math.floor((e.BITS-1)/c)*c;let y=o;for(let h=u;h>=0;h-=c){i.fill(o);for(let m=0;m<r.length;m++){const N=r[m],b=Number(N>>BigInt(h)&BigInt(f));i[b]=i[b].add(t[m])}let l=o;for(let m=i.length-1,N=o;m>0;m--)N=N.add(i[m]),l=l.add(N);if(y=y.add(l),h!==0)for(let m=0;m<c;m++)y=y.double()}return y}function ue(n){return Me(n.Fp),mt(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...oe(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Dt(n){n.lowS!==void 0&&ut("lowS",n.lowS),n.prehash!==void 0&&ut("prehash",n.prehash)}function De(n){const e=ue(n);mt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:o}=e;if(t){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:$e,hexToBytes:We}=_e;class Xe extends Error{constructor(e=""){super(e)}}const $={Err:Xe,_tlv:{encode:(n,e)=>{const{Err:t}=$;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,o=at(r);if(o.length/2&128)throw new t("tlv.encode: long form length too big");const s=r>127?at(o.length/2|128):"";return at(n)+s+o+e},decode(n,e){const{Err:t}=$;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const o=e[r++],s=!!(o&128);let c=0;if(!s)c=o;else{const i=o&127;if(!i)throw new t("tlv.decode(long): indefinite length not supported");if(i>4)throw new t("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+i);if(u.length!==i)throw new t("tlv.decode: length bytes not complete");if(u[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const y of u)c=c<<8|y;if(r+=i,c<128)throw new t("tlv.decode(long): not minimal encoding")}const f=e.subarray(r,r+c);if(f.length!==c)throw new t("tlv.decode: wrong value length");return{v:f,l:e.subarray(r+c)}}},_int:{encode(n){const{Err:e}=$;if(n<W)throw new e("integer: negative integers are not allowed");let t=at(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=$;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return $e(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=$,o=typeof n=="string"?We(n):n;yt(o);const{v:s,l:c}=r.decode(48,o);if(c.length)throw new e("invalid signature: left bytes after parsing");const{v:f,l:i}=r.decode(2,s),{v:u,l:y}=r.decode(2,i);if(y.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(f),s:t.decode(u)}},hexFromSig(n){const{_tlv:e,_int:t}=$,r=e.encode(2,t.encode(n.r)),o=e.encode(2,t.encode(n.s)),s=r+o;return e.encode(48,s)}},W=BigInt(0),k=BigInt(1);BigInt(2);const $t=BigInt(3);BigInt(4);function Qe(n){const e=De(n),{Fp:t}=e,r=ie(e.n,e.nBitLength),o=e.toBytes||((b,a,g)=>{const x=a.toAffine();return bt(Uint8Array.from([4]),t.toBytes(x.x),t.toBytes(x.y))}),s=e.fromBytes||(b=>{const a=b.subarray(1),g=t.fromBytes(a.subarray(0,t.BYTES)),x=t.fromBytes(a.subarray(t.BYTES,2*t.BYTES));return{x:g,y:x}});function c(b){const{a,b:g}=e,x=t.sqr(b),E=t.mul(x,b);return t.add(t.add(E,t.mul(b,a)),g)}if(!t.eql(t.sqr(e.Gy),c(e.Gx)))throw new Error("bad generator point: equation left != right");function f(b){return St(b,k,e.n)}function i(b){const{allowedPrivateKeyLengths:a,nByteLength:g,wrapPrivateKey:x,n:E}=e;if(a&&typeof b!="bigint"){if(it(b)&&(b=lt(b)),typeof b!="string"||!a.includes(b.length))throw new Error("invalid private key");b=b.padStart(g*2,"0")}let q;try{q=typeof b=="bigint"?b:rt(K("private key",b,g))}catch{throw new Error("invalid private key, expected hex or "+g+" bytes, got "+typeof b)}return x&&(q=V(q,E)),ot("private key",q,k,E),q}function u(b){if(!(b instanceof l))throw new Error("ProjectivePoint expected")}const y=_t((b,a)=>{const{px:g,py:x,pz:E}=b;if(t.eql(E,t.ONE))return{x:g,y:x};const q=b.is0();a==null&&(a=q?t.ONE:t.inv(E));const L=t.mul(g,a),I=t.mul(x,a),B=t.mul(E,a);if(q)return{x:t.ZERO,y:t.ZERO};if(!t.eql(B,t.ONE))throw new Error("invZ was invalid");return{x:L,y:I}}),h=_t(b=>{if(b.is0()){if(e.allowInfinityPoint&&!t.is0(b.py))return;throw new Error("bad point: ZERO")}const{x:a,y:g}=b.toAffine();if(!t.isValid(a)||!t.isValid(g))throw new Error("bad point: x or y not FE");const x=t.sqr(g),E=c(a);if(!t.eql(x,E))throw new Error("bad point: equation left != right");if(!b.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class l{constructor(a,g,x){if(this.px=a,this.py=g,this.pz=x,a==null||!t.isValid(a))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(x==null||!t.isValid(x))throw new Error("z required");Object.freeze(this)}static fromAffine(a){const{x:g,y:x}=a||{};if(!a||!t.isValid(g)||!t.isValid(x))throw new Error("invalid affine point");if(a instanceof l)throw new Error("projective point not allowed");const E=q=>t.eql(q,t.ZERO);return E(g)&&E(x)?l.ZERO:new l(g,x,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(a){const g=t.invertBatch(a.map(x=>x.pz));return a.map((x,E)=>x.toAffine(g[E])).map(l.fromAffine)}static fromHex(a){const g=l.fromAffine(s(K("pointHex",a)));return g.assertValidity(),g}static fromPrivateKey(a){return l.BASE.multiply(i(a))}static msm(a,g){return Ge(l,r,a,g)}_setWindowSize(a){N.setWindowSize(this,a)}assertValidity(){h(this)}hasEvenY(){const{y:a}=this.toAffine();if(t.isOdd)return!t.isOdd(a);throw new Error("Field doesn't support isOdd")}equals(a){u(a);const{px:g,py:x,pz:E}=this,{px:q,py:L,pz:I}=a,B=t.eql(t.mul(g,I),t.mul(q,E)),A=t.eql(t.mul(x,I),t.mul(L,E));return B&&A}negate(){return new l(this.px,t.neg(this.py),this.pz)}double(){const{a,b:g}=e,x=t.mul(g,$t),{px:E,py:q,pz:L}=this;let I=t.ZERO,B=t.ZERO,A=t.ZERO,v=t.mul(E,E),C=t.mul(q,q),U=t.mul(L,L),H=t.mul(E,q);return H=t.add(H,H),A=t.mul(E,L),A=t.add(A,A),I=t.mul(a,A),B=t.mul(x,U),B=t.add(I,B),I=t.sub(C,B),B=t.add(C,B),B=t.mul(I,B),I=t.mul(H,I),A=t.mul(x,A),U=t.mul(a,U),H=t.sub(v,U),H=t.mul(a,H),H=t.add(H,A),A=t.add(v,v),v=t.add(A,v),v=t.add(v,U),v=t.mul(v,H),B=t.add(B,v),U=t.mul(q,L),U=t.add(U,U),v=t.mul(U,H),I=t.sub(I,v),A=t.mul(U,C),A=t.add(A,A),A=t.add(A,A),new l(I,B,A)}add(a){u(a);const{px:g,py:x,pz:E}=this,{px:q,py:L,pz:I}=a;let B=t.ZERO,A=t.ZERO,v=t.ZERO;const C=e.a,U=t.mul(e.b,$t);let H=t.mul(g,q),j=t.mul(x,L),d=t.mul(E,I),w=t.add(g,x),p=t.add(q,L);w=t.mul(w,p),p=t.add(H,j),w=t.sub(w,p),p=t.add(g,E);let S=t.add(q,I);return p=t.mul(p,S),S=t.add(H,d),p=t.sub(p,S),S=t.add(x,E),B=t.add(L,I),S=t.mul(S,B),B=t.add(j,d),S=t.sub(S,B),v=t.mul(C,p),B=t.mul(U,d),v=t.add(B,v),B=t.sub(j,v),v=t.add(j,v),A=t.mul(B,v),j=t.add(H,H),j=t.add(j,H),d=t.mul(C,d),p=t.mul(U,p),j=t.add(j,d),d=t.sub(H,d),d=t.mul(C,d),p=t.add(p,d),H=t.mul(j,p),A=t.add(A,H),H=t.mul(S,p),B=t.mul(w,B),B=t.sub(B,H),H=t.mul(w,j),v=t.mul(S,v),v=t.add(v,H),new l(B,A,v)}subtract(a){return this.add(a.negate())}is0(){return this.equals(l.ZERO)}wNAF(a){return N.wNAFCached(this,a,l.normalizeZ)}multiplyUnsafe(a){const{endo:g,n:x}=e;ot("scalar",a,W,x);const E=l.ZERO;if(a===W)return E;if(this.is0()||a===k)return this;if(!g||N.hasPrecomputes(this))return N.wNAFCachedUnsafe(this,a,l.normalizeZ);let{k1neg:q,k1:L,k2neg:I,k2:B}=g.splitScalar(a),A=E,v=E,C=this;for(;L>W||B>W;)L&k&&(A=A.add(C)),B&k&&(v=v.add(C)),C=C.double(),L>>=k,B>>=k;return q&&(A=A.negate()),I&&(v=v.negate()),v=new l(t.mul(v.px,g.beta),v.py,v.pz),A.add(v)}multiply(a){const{endo:g,n:x}=e;ot("scalar",a,k,x);let E,q;if(g){const{k1neg:L,k1:I,k2neg:B,k2:A}=g.splitScalar(a);let{p:v,f:C}=this.wNAF(I),{p:U,f:H}=this.wNAF(A);v=N.constTimeNegate(L,v),U=N.constTimeNegate(B,U),U=new l(t.mul(U.px,g.beta),U.py,U.pz),E=v.add(U),q=C.add(H)}else{const{p:L,f:I}=this.wNAF(a);E=L,q=I}return l.normalizeZ([E,q])[0]}multiplyAndAddUnsafe(a,g,x){const E=l.BASE,q=(I,B)=>B===W||B===k||!I.equals(E)?I.multiplyUnsafe(B):I.multiply(B),L=q(this,g).add(q(a,x));return L.is0()?void 0:L}toAffine(a){return y(this,a)}isTorsionFree(){const{h:a,isTorsionFree:g}=e;if(a===k)return!0;if(g)return g(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:a,clearCofactor:g}=e;return a===k?this:g?g(l,this):this.multiplyUnsafe(e.h)}toRawBytes(a=!0){return ut("isCompressed",a),this.assertValidity(),o(l,this,a)}toHex(a=!0){return ut("isCompressed",a),lt(this.toRawBytes(a))}}l.BASE=new l(e.Gx,e.Gy,t.ONE),l.ZERO=new l(t.ZERO,t.ONE,t.ZERO);const m=e.nBitLength,N=Pe(l,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:i,weierstrassEquation:c,isWithinCurveOrder:f}}function Je(n){const e=ue(n);return mt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function tn(n){const e=Je(n),{Fp:t,n:r}=e,o=t.BYTES+1,s=2*t.BYTES+1;function c(d){return V(d,r)}function f(d){return zt(d,r)}const{ProjectivePoint:i,normPrivateKeyToScalar:u,weierstrassEquation:y,isWithinCurveOrder:h}=Qe({...e,toBytes(d,w,p){const S=w.toAffine(),O=t.toBytes(S.x),_=bt;return ut("isCompressed",p),p?_(Uint8Array.from([w.hasEvenY()?2:3]),O):_(Uint8Array.from([4]),O,t.toBytes(S.y))},fromBytes(d){const w=d.length,p=d[0],S=d.subarray(1);if(w===o&&(p===2||p===3)){const O=rt(S);if(!St(O,k,t.ORDER))throw new Error("Point is not on curve");const _=y(O);let R;try{R=t.sqrt(_)}catch(F){const M=F instanceof Error?": "+F.message:"";throw new Error("Point is not on curve"+M)}const Z=(R&k)===k;return(p&1)===1!==Z&&(R=t.neg(R)),{x:O,y:R}}else if(w===s&&p===4){const O=t.fromBytes(S.subarray(0,t.BYTES)),_=t.fromBytes(S.subarray(t.BYTES,2*t.BYTES));return{x:O,y:_}}else{const O=o,_=s;throw new Error("invalid Point, expected length of "+O+", or uncompressed "+_+", got "+w)}}}),l=d=>lt(ht(d,e.nByteLength));function m(d){const w=r>>k;return d>w}function N(d){return m(d)?c(-d):d}const b=(d,w,p)=>rt(d.slice(w,p));class a{constructor(w,p,S){this.r=w,this.s=p,this.recovery=S,this.assertValidity()}static fromCompact(w){const p=e.nByteLength;return w=K("compactSignature",w,p*2),new a(b(w,0,p),b(w,p,2*p))}static fromDER(w){const{r:p,s:S}=$.toSig(K("DER",w));return new a(p,S)}assertValidity(){ot("r",this.r,k,r),ot("s",this.s,k,r)}addRecoveryBit(w){return new a(this.r,this.s,w)}recoverPublicKey(w){const{r:p,s:S,recovery:O}=this,_=I(K("msgHash",w));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const R=O===2||O===3?p+e.n:p;if(R>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const Z=O&1?"03":"02",G=i.fromHex(Z+l(R)),F=f(R),M=c(-_*F),st=c(S*F),X=i.BASE.multiplyAndAddUnsafe(G,M,st);if(!X)throw new Error("point at infinify");return X.assertValidity(),X}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new a(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return dt(this.toDERHex())}toDERHex(){return $.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return dt(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const g={isValidPrivateKey(d){try{return u(d),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const d=ce(e.n);return Ye(e.randomBytes(d),e.n)},precompute(d=8,w=i.BASE){return w._setWindowSize(d),w.multiply(BigInt(3)),w}};function x(d,w=!0){return i.fromPrivateKey(d).toRawBytes(w)}function E(d){const w=it(d),p=typeof d=="string",S=(w||p)&&d.length;return w?S===o||S===s:p?S===2*o||S===2*s:d instanceof i}function q(d,w,p=!0){if(E(d))throw new Error("first arg must be private key");if(!E(w))throw new Error("second arg must be public key");return i.fromHex(w).multiply(u(d)).toRawBytes(p)}const L=e.bits2int||function(d){if(d.length>8192)throw new Error("input is too large");const w=rt(d),p=d.length*8-e.nBitLength;return p>0?w>>BigInt(p):w},I=e.bits2int_modN||function(d){return c(L(d))},B=jt(e.nBitLength);function A(d){return ot("num < 2^"+e.nBitLength,d,W,B),ht(d,e.nByteLength)}function v(d,w,p=C){if(["recovered","canonical"].some(tt=>tt in p))throw new Error("sign() legacy options not supported");const{hash:S,randomBytes:O}=e;let{lowS:_,prehash:R,extraEntropy:Z}=p;_==null&&(_=!0),d=K("msgHash",d),Dt(p),R&&(d=K("prehashed msgHash",S(d)));const G=I(d),F=u(w),M=[A(F),A(G)];if(Z!=null&&Z!==!1){const tt=Z===!0?O(t.BYTES):Z;M.push(K("extraEntropy",tt))}const st=bt(...M),X=G;function At(tt){const ct=L(tt);if(!h(ct))return;const It=f(ct),gt=i.BASE.multiply(ct).toAffine(),et=c(gt.x);if(et===W)return;const wt=c(It*c(X+et*F));if(wt===W)return;let pt=(gt.x===et?0:2)|Number(gt.y&k),ft=wt;return _&&m(wt)&&(ft=N(wt),pt^=1),new a(et,ft,pt)}return{seed:st,k2sig:At}}const C={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function H(d,w,p=C){const{seed:S,k2sig:O}=v(d,w,p),_=e;return ee(_.hash.outputLen,_.nByteLength,_.hmac)(S,O)}i.BASE._setWindowSize(8);function j(d,w,p,S=U){var pt;const O=d;w=K("msgHash",w),p=K("publicKey",p);const{lowS:_,prehash:R,format:Z}=S;if(Dt(S),"strict"in S)throw new Error("options.strict was renamed to lowS");if(Z!==void 0&&Z!=="compact"&&Z!=="der")throw new Error("format must be compact or der");const G=typeof O=="string"||it(O),F=!G&&!Z&&typeof O=="object"&&O!==null&&typeof O.r=="bigint"&&typeof O.s=="bigint";if(!G&&!F)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let M,st;try{if(F&&(M=new a(O.r,O.s)),G){try{Z!=="compact"&&(M=a.fromDER(O))}catch(ft){if(!(ft instanceof $.Err))throw ft}!M&&Z!=="der"&&(M=a.fromCompact(O))}st=i.fromHex(p)}catch{return!1}if(!M||_&&M.hasHighS())return!1;R&&(w=e.hash(w));const{r:X,s:At}=M,tt=I(w),ct=f(At),It=c(tt*ct),gt=c(X*ct),et=(pt=i.BASE.multiplyAndAddUnsafe(st,It,gt))==null?void 0:pt.toAffine();return et?c(et.x)===X:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:q,sign:H,verify:j,ProjectivePoint:i,Signature:a,utils:g}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function en(n){return{hash:n,hmac:(e,...t)=>re(n,e,pe(...t)),randomBytes:be}}function nn(n,e){const t=r=>tn({...n,...en(r)});return{...t(e),create:t}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const le=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Wt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),rn=BigInt(1),Ct=BigInt(2),Xt=(n,e)=>(n+e/Ct)/e;function on(n){const e=le,t=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),c=BigInt(23),f=BigInt(44),i=BigInt(88),u=n*n*n%e,y=u*u*n%e,h=Y(y,t,e)*y%e,l=Y(h,t,e)*y%e,m=Y(l,Ct,e)*u%e,N=Y(m,o,e)*m%e,b=Y(N,s,e)*N%e,a=Y(b,f,e)*b%e,g=Y(a,i,e)*a%e,x=Y(g,f,e)*b%e,E=Y(x,t,e)*y%e,q=Y(E,c,e)*N%e,L=Y(q,r,e)*u%e,I=Y(L,Ct,e);if(!Zt.eql(Zt.sqr(I),n))throw new Error("Cannot find square root");return I}const Zt=ie(le,void 0,void 0,{sqrt:on}),sn=nn({a:BigInt(0),b:BigInt(7),Fp:Zt,n:Wt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=Wt,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-rn*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,c=BigInt("0x100000000000000000000000000000000"),f=Xt(s*n,e),i=Xt(-r*n,e);let u=V(n-f*t-i*o,e),y=V(-f*r-i*s,e);const h=u>c,l=y>c;if(h&&(u=e-u),l&&(y=e-y),u>c||y>c)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:h,k1:u,k2neg:l,k2:y}}}},Se);BigInt(0);sn.ProjectivePoint;export{sn as secp256k1};
package/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  <meta name="twitter:description" content="Jump into Decentraland." />
15
15
  <meta name="twitter:card" content="summary_large_image" />
16
16
  <meta name="twitter:site" content="@decentraland" />
17
- <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/jump-site/0.0.3/assets/index-DqK5yzRc.js"></script>
17
+ <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/jump-site/0.0.4-15333861590.commit-7791f49/assets/index-BshNlYaQ.js"></script>
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/jump-site",
3
- "version": "0.0.3",
3
+ "version": "0.0.4-15333861590.commit-7791f49",
4
4
  "description": "Jump In site",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,6 @@
17
17
  "type": "git",
18
18
  "url": "https://github.com/decentraland/jump-site.git"
19
19
  },
20
- "homepage": "https://cdn.decentraland.org/@dcl/jump-site/0.0.3",
21
- "commit": "7e733fdb37116dcc2a1e75acbd03d169bc561ed0"
20
+ "homepage": "https://cdn.decentraland.org/@dcl/jump-site/0.0.4-15333861590.commit-7791f49",
21
+ "commit": "7791f496f131fbbfc0645465b3e016e5e0e2384c"
22
22
  }
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{_ as p,a as v,j as g,b as M,l as _}from"./index-DVdcljqq.js";import"./index-DqK5yzRc.js";function P(s,w,h){var i;return p(this,void 0,void 0,function(){var o,l,c,d,a,b=this;return v(this,function(u){switch(u.label){case 0:return g()?[2,[]]:(o=M(),l=(i=w.enabledMiddleware)!==null&&i!==void 0?i:{},c=Object.entries(l).filter(function(r){r[0];var e=r[1];return e}).map(function(r){var e=r[0];return e}),d=c.map(function(r){return p(b,void 0,void 0,function(){var e,n,m,f;return v(this,function(t){switch(t.label){case 0:e=r.replace("@segment/",""),n=e,h&&(n=btoa(e).replace(/=/g,"")),m="".concat(o,"/middleware/").concat(n,"/latest/").concat(n,".js.gz"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,_(m)];case 2:return t.sent(),[2,window["".concat(e,"Middleware")]];case 3:return f=t.sent(),s.log("error",f),s.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}})})}),[4,Promise.all(d)]);case 1:return a=u.sent(),a=a.filter(Boolean),[2,a]}})})}export{P as remoteMiddlewares};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.umd-DNNVL3en.js","assets/index-DqK5yzRc.js"])))=>i.map(i=>d[i]);
2
- import{_ as n}from"./index-DqK5yzRc.js";import{_ as o,a}from"./index-DVdcljqq.js";function u(i){return o(this,void 0,void 0,function(){var r;return a(this,function(t){switch(t.label){case 0:return[4,n(()=>import("./index.umd-DNNVL3en.js").then(e=>e.i),__vite__mapDeps([0,1]))];case 1:return r=t.sent(),i._plugins=r,[2]}})})}export{u as loadLegacyVideoPlugins};
@@ -1 +0,0 @@
1
- import{e as a}from"./index-DVdcljqq.js";import{i as c}from"./is-plan-event-enabled-DS1Agtkw.js";import"./index-DqK5yzRc.js";function l(r,u){var i,n;if(!r||!Object.keys(r))return{};var o=r.integrations?Object.keys(r.integrations).filter(function(e){return r.integrations[e]===!1}):[],s=[];return((i=u.remotePlugins)!==null&&i!==void 0?i:[]).forEach(function(e){o.forEach(function(t){e.creationName==t&&s.push(e.name)})}),((n=u.remotePlugins)!==null&&n!==void 0?n:[]).reduce(function(e,t){return t.settings.subscriptions&&s.includes(t.name)&&t.settings.subscriptions.forEach(function(f){return e["".concat(t.name," ").concat(f.partnerAction)]=!1}),e},{})}function v(r,u){function i(n){var o=r,s=n.event.event;if(o&&s){var e=o[s];if(c(o,e)){var t=l(e,u);n.updateEvent("integrations",a(a(a({},n.event.integrations),e==null?void 0:e.integrations),t))}else return n.updateEvent("integrations",a(a({},n.event.integrations),{All:!1,"Segment.io":!0})),n}return n}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:i,alias:i,track:i,identify:i,group:i}}export{v as schemaFilter};
@@ -1 +0,0 @@
1
- import{_ as v,a as f,l as z,b as k,u as j,c as _,r as w,d as P,e as p,C as N,f as C,h as y,j as F,m as L,i as S,k as R,n as B,P as Q,o as W,q as G,s as T,t as U}from"./index-DVdcljqq.js";import{i as V}from"./is-plan-event-enabled-DS1Agtkw.js";import"./index-DqK5yzRc.js";function D(i){return i.toLowerCase().replace(".","").replace(/\s+/g,"-")}function E(i,t){return t===void 0&&(t=!1),t?btoa(i).replace(/=/g,""):void 0}function H(i){return("Integration"in i?i.Integration:i).prototype.name}function J(i,t,n){var e,a;try{var r=((a=(e=window==null?void 0:window.performance)===null||e===void 0?void 0:e.getEntriesByName(i,"resource"))!==null&&a!==void 0?a:[])[0];r&&t.stats.gauge("legacy_destination_time",Math.round(r.duration),_([n],r.duration<100?["cached"]:[],!0))}catch{}}function K(i,t,n){var e;if("Integration"in i){var a={user:function(){return n.user()},addIntegration:function(){}};i(a),e=i.Integration}else e=i;var r=new e(t);return r.analytics=n,r}function X(i,t,n,e){return v(this,void 0,void 0,function(){var a,r,s,u,o,d;return f(this,function(c){switch(c.label){case 0:a=D(t),r=E(a,e),s=k(),u="".concat(s,"/integrations/").concat(r??a,"/").concat(n,"/").concat(r??a,".dynamic.js.gz"),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,z(u)];case 2:return c.sent(),J(u,i,t),[3,4];case 3:throw o=c.sent(),i.stats.gauge("legacy_destination_time",-1,["plugin:".concat(t),"failed"]),o;case 4:return d=window["".concat(a,"Deps")],[4,Promise.all(d.map(function(g){return z(s+g+".gz")}))];case 5:return c.sent(),window["".concat(a,"Loader")](),[2,window["".concat(a,"Integration")]]}})})}function Y(i,t,n){return v(this,void 0,void 0,function(){var e,a,r,s;return f(this,function(u){return e=k(),a=D(i),r=E(i,n),s="".concat(e,"/integrations/").concat(r??a,"/").concat(t,"/").concat(r??a,".dynamic.js.gz"),[2,j(s)]})})}function Z(i){var t,n,e,a;return(a=(n=(t=i==null?void 0:i.versionSettings)===null||t===void 0?void 0:t.override)!==null&&n!==void 0?n:(e=i==null?void 0:i.versionSettings)===null||e===void 0?void 0:e.version)!==null&&a!==void 0?a:"latest"}var $=function(i,t){var n,e=t.type,a=t.bundlingStatus,r=t.versionSettings,s=a!=="unbundled"&&(e==="browser"||((n=r==null?void 0:r.componentTypes)===null||n===void 0?void 0:n.includes("browser")));return!i.startsWith("Segment")&&i!=="Iterable"&&s},q=function(i,t){var n=t.All===!1&&t[i]===void 0;return t[i]===!1||n};function x(i,t){return v(this,void 0,void 0,function(){var n,e=this;return f(this,function(a){switch(a.label){case 0:return n=[],P()?[2,t]:[4,R(function(){return t.length>0&&T()},function(){return v(e,void 0,void 0,function(){var r,s,u;return f(this,function(o){switch(o.label){case 0:return r=t.pop(),r?[4,G(r,i)]:[2];case 1:return s=o.sent(),u=s instanceof U,u||n.push(r),[2]}})})})];case 1:return a.sent(),n.map(function(r){return t.pushWithBackoff(r)}),[2,t]}})})}var tt=function(){function i(t,n,e,a,r,s){a===void 0&&(a={});var u=this;this.options={},this.type="destination",this.middleware=[],this.initializePromise=B(),this.flushing=!1,this.name=t,this.version=n,this.settings=p({},a),this.disableAutoISOConversion=r.disableAutoISOConversion||!1,this.integrationSource=s,this.settings.type&&this.settings.type==="browser"&&delete this.settings.type,this.initializePromise.promise.then(function(o){return u._initialized=o},function(){}),this.options=r,this.buffer=r.disableClientPersistence?new Q(4,[]):new W(4,"".concat(e,":dest-").concat(t)),this.scheduleFlush()}return i.prototype.isLoaded=function(){return!!this._ready},i.prototype.ready=function(){var t=this;return this.initializePromise.promise.then(function(){var n;return(n=t.onReady)!==null&&n!==void 0?n:Promise.resolve()})},i.prototype.load=function(t,n){var e;return v(this,void 0,void 0,function(){var a,r,s=this;return f(this,function(u){switch(u.label){case 0:return this._ready||this.onReady!==void 0?[2]:(e=this.integrationSource)!==null&&e!==void 0?(r=e,[3,3]):[3,1];case 1:return[4,X(t,this.name,this.version,this.options.obfuscate)];case 2:r=u.sent(),u.label=3;case 3:a=r,this.integration=K(a,this.settings,n),this.onReady=new Promise(function(o){var d=function(){s._ready=!0,o(!0)};s.integration.once("ready",d)}),this.integration.on("initialize",function(){s.initializePromise.resolve(!0)});try{w(t,{integrationName:this.name,methodName:"initialize",type:"classic"}),this.integration.initialize()}catch(o){throw w(t,{integrationName:this.name,methodName:"initialize",type:"classic",didError:!0}),this.initializePromise.resolve(!1),o}return[2]}})})},i.prototype.unload=function(t,n){return Y(this.name,this.version,this.options.obfuscate)},i.prototype.addMiddleware=function(){for(var t,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.middleware=(t=this.middleware).concat.apply(t,n)},i.prototype.shouldBuffer=function(t){return t.event.type!=="page"&&(P()||this._ready!==!0||this._initialized!==!0)},i.prototype.send=function(t,n,e){var a,r;return v(this,void 0,void 0,function(){var s,u,o,d,c,g;return f(this,function(h){switch(h.label){case 0:return this.shouldBuffer(t)?(this.buffer.push(t),this.scheduleFlush(),[2,t]):(s=(r=(a=this.options)===null||a===void 0?void 0:a.plan)===null||r===void 0?void 0:r.track,u=t.event.event,s&&u&&this.name!=="Segment.io"&&(o=s[u],V(s,o)?t.updateEvent("integrations",p(p({},t.event.integrations),o==null?void 0:o.integrations)):(t.updateEvent("integrations",p(p({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new N({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),o!=null&&o.enabled&&(o==null?void 0:o.integrations[this.name])===!1&&t.cancel(new N({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),[4,C(this.name,t.event,this.middleware)]);case 1:if(d=h.sent(),d===null)return[2,t];c=new n(d,{traverse:!this.disableAutoISOConversion}),w(t,{integrationName:this.name,methodName:e,type:"classic"}),h.label=2;case 2:return h.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,e,c)]:[3,4];case 3:h.sent(),h.label=4;case 4:return[3,6];case 5:throw g=h.sent(),w(t,{integrationName:this.name,methodName:e,type:"classic",didError:!0}),g;case 6:return[2,t]}})})},i.prototype.track=function(t){return v(this,void 0,void 0,function(){return f(this,function(n){return[2,this.send(t,y.Track,"track")]})})},i.prototype.page=function(t){var n;return v(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return!((n=this.integration)===null||n===void 0)&&n._assumesPageview&&!this._initialized&&this.integration.initialize(),[4,this.initializePromise.promise];case 1:return e.sent(),[2,this.send(t,y.Page,"page")]}})})},i.prototype.identify=function(t){return v(this,void 0,void 0,function(){return f(this,function(n){return[2,this.send(t,y.Identify,"identify")]})})},i.prototype.alias=function(t){return v(this,void 0,void 0,function(){return f(this,function(n){return[2,this.send(t,y.Alias,"alias")]})})},i.prototype.group=function(t){return v(this,void 0,void 0,function(){return f(this,function(n){return[2,this.send(t,y.Group,"group")]})})},i.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout(function(){return v(t,void 0,void 0,function(){var n;return f(this,function(e){switch(e.label){case 0:return P()||this._ready!==!0||this._initialized!==!0?(this.scheduleFlush(),[2]):(this.flushing=!0,n=this,[4,x(this,this.buffer)]);case 1:return n.buffer=e.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}})})},Math.random()*5e3)},i}();function rt(i,t,n,e,a,r){var s,u;if(n===void 0&&(n={}),e===void 0&&(e={}),F())return[];t.plan&&(e=e??{},e.plan=t.plan);var o=(u=(s=t.middlewareSettings)===null||s===void 0?void 0:s.routingRules)!==null&&u!==void 0?u:[],d=t.integrations,c=e.integrations,g=L(t,e??{}),h=r==null?void 0:r.reduce(function(l,b){var m;return p(p({},l),(m={},m[H(b)]=b,m))},{}),O=new Set(_(_([],Object.keys(d).filter(function(l){return $(l,d[l])}),!0),Object.keys(h||{}).filter(function(l){return S(d[l])||S(c==null?void 0:c[l])}),!0));return Array.from(O).filter(function(l){return!q(l,n)}).map(function(l){var b=d[l],m=Z(b),I=new tt(l,m,i,g[l],e,h==null?void 0:h[l]),A=o.filter(function(M){return M.destinationName===l});return A.length>0&&a&&I.addMiddleware(a),I})}export{tt as LegacyDestination,rt as ajsDestinations};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/auto-track-CESKe-vL.js","assets/index-DqK5yzRc.js","assets/index-BcyYnbGB.js","assets/index-DGSVm7Cr.js","assets/is-plan-event-enabled-DS1Agtkw.js","assets/index-BiLuWLjK.js","assets/index-D76Uxjzx.js","assets/index-BfYbKzUW.js"])))=>i.map(i=>d[i]);
2
- import{c as M,_ as U}from"./index-DqK5yzRc.js";var Xe=function(e,t){return Xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Xe(e,t)};function L(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xe(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var d=function(){return d=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},d.apply(this,arguments)};function Yt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function y(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function u(l){try{c(n.next(l))}catch(f){a(f)}}function s(l){try{c(n.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((n=n.apply(e,t||[])).next())})}function g(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function C(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Ye(e,t,r){t.split&&(t=t.split("."));for(var n=0,i=t.length,o=e,a,u;n<i&&(u=""+t[n++],!(u==="__proto__"||u==="constructor"||u==="prototype"));)o=o[u]=n===i?r:typeof(a=o[u])==typeof t?a:t[n]*0!==0||~(""+t[n]).indexOf(".")?{}:[]}var Nr=function(e,t){return Object.keys(e).filter(function(r){return t(r,e[r])}).reduce(function(r,n){return r[n]=e[n],r},{})},oe=function(e){L(t,e);function t(r,n){var i=e.call(this,"".concat(r," ").concat(n))||this;return i.field=r,i}return t}(Error);function ee(e){return typeof e=="string"}function Ze(e){return typeof e=="number"}function he(e){return typeof e=="function"}function qr(e){return e!=null}function q(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()==="object"}var lt="is not a string",ft="is not an object",Ur="is nil";function $r(e){if(!qr(e))throw new oe("Event",Ur);if(typeof e!="object")throw new oe("Event",ft)}function zr(e){if(!ee(e.type))throw new oe(".type",lt)}function Br(e){if(!ee(e.event))throw new oe(".event",lt)}function Kr(e){if(!q(e.properties))throw new oe(".properties",ft)}function Vr(e){if(!q(e.traits))throw new oe(".traits",ft)}function Gr(e){if(!ee(e.messageId))throw new oe(".messageId",lt)}function Jr(e){$r(e),zr(e),Gr(e),e.type==="track"&&(Br(e),Kr(e)),["group","identify"].includes(e.type)&&Vr(e)}var Wr=function(){function e(t){var r,n;this.settings=t,this.createMessageId=t.createMessageId,this.onEventMethodCall=(r=t.onEventMethodCall)!==null&&r!==void 0?r:function(){},this.onFinishedEvent=(n=t.onFinishedEvent)!==null&&n!==void 0?n:function(){}}return e}(),Qr=function(){function e(t){this.settings=new Wr(t)}return e.prototype.track=function(t,r,n,i){return this.settings.onEventMethodCall({type:"track",options:n}),this.normalize(d(d({},this.baseEvent()),{event:t,type:"track",properties:r??{},options:d({},n),integrations:d({},i)}))},e.prototype.page=function(t,r,n,i,o){var a;this.settings.onEventMethodCall({type:"page",options:i});var u={type:"page",properties:d({},n),options:d({},i),integrations:d({},o)};return t!==null&&(u.category=t,u.properties=(a=u.properties)!==null&&a!==void 0?a:{},u.properties.category=t),r!==null&&(u.name=r),this.normalize(d(d({},this.baseEvent()),u))},e.prototype.screen=function(t,r,n,i,o){this.settings.onEventMethodCall({type:"screen",options:i});var a={type:"screen",properties:d({},n),options:d({},i),integrations:d({},o)};return t!==null&&(a.category=t),r!==null&&(a.name=r),this.normalize(d(d({},this.baseEvent()),a))},e.prototype.identify=function(t,r,n,i){return this.settings.onEventMethodCall({type:"identify",options:n}),this.normalize(d(d({},this.baseEvent()),{type:"identify",userId:t,traits:r??{},options:d({},n),integrations:i}))},e.prototype.group=function(t,r,n,i){return this.settings.onEventMethodCall({type:"group",options:n}),this.normalize(d(d({},this.baseEvent()),{type:"group",traits:r??{},options:d({},n),integrations:d({},i),groupId:t}))},e.prototype.alias=function(t,r,n,i){this.settings.onEventMethodCall({type:"alias",options:n});var o={userId:t,type:"alias",options:d({},n),integrations:d({},i)};return r!==null&&(o.previousId=r),t===void 0?this.normalize(d(d({},o),this.baseEvent())):this.normalize(d(d({},this.baseEvent()),o))},e.prototype.baseEvent=function(){return{integrations:{},options:{}}},e.prototype.context=function(t){var r,n=["userId","anonymousId","timestamp","messageId"];delete t.integrations;var i=Object.keys(t),o=(r=t.context)!==null&&r!==void 0?r:{},a={};return i.forEach(function(u){u!=="context"&&(n.includes(u)?Ye(a,u,t[u]):Ye(o,u,t[u]))}),[o,a]},e.prototype.normalize=function(t){var r,n,i=Object.keys((r=t.integrations)!==null&&r!==void 0?r:{}).reduce(function(p,h){var v,m;return d(d({},p),(v={},v[h]=!!(!((m=t.integrations)===null||m===void 0)&&m[h]),v))},{});t.options=Nr(t.options||{},function(p,h){return h!==void 0});var o=d(d({},i),(n=t.options)===null||n===void 0?void 0:n.integrations),a=t.options?this.context(t.options):[],u=a[0],s=a[1],c=t.options,l=Yt(t,["options"]),f=d(d(d(d({timestamp:new Date},l),{context:u,integrations:o}),s),{messageId:c.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(f),Jr(f),f},e}();function Hr(e,t){return new Promise(function(r,n){var i=setTimeout(function(){n(Error("Promise timed out"))},t);e.then(function(o){return clearTimeout(i),r(o)}).catch(n)})}function Xr(e){return new Promise(function(t){return setTimeout(t,e)})}function Yr(e,t,r){var n=function(){try{return Promise.resolve(t(e))}catch(i){return Promise.reject(i)}};return Xr(r).then(function(){return Hr(n(),1e3)}).catch(function(i){e==null||e.log("warn","Callback Error",{error:i}),e==null||e.stats.increment("callback_error")}).then(function(){return e})}var Zt=function(){var e,t,r=!1,n=new Promise(function(i,o){e=function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];r=!0,i.apply(void 0,a)},t=function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];r=!0,o.apply(void 0,a)}});return{resolve:e,reject:t,promise:n,isSettled:function(){return r}}},dt=function(){function e(t){var r;this.callbacks={},this.warned=!1,this.maxListeners=(r=t==null?void 0:t.maxListeners)!==null&&r!==void 0?r:10}return e.prototype.warnIfPossibleMemoryLeak=function(t){this.warned||this.maxListeners&&this.callbacks[t].length>this.maxListeners&&(console.warn("Event Emitter: Possible memory leak detected; ".concat(String(t)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0)},e.prototype.on=function(t,r){return this.callbacks[t]?(this.callbacks[t].push(r),this.warnIfPossibleMemoryLeak(t)):this.callbacks[t]=[r],this},e.prototype.once=function(t,r){var n=this,i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];n.off(t,i),r.apply(n,o)};return this.on(t,i),this},e.prototype.off=function(t,r){var n,i=(n=this.callbacks[t])!==null&&n!==void 0?n:[],o=i.filter(function(a){return a!==r});return this.callbacks[t]=o,this},e.prototype.emit=function(t){for(var r=this,n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var a=(n=this.callbacks[t])!==null&&n!==void 0?n:[];return a.forEach(function(u){u.apply(r,i)}),this},e}();function Zr(e){var t=Math.random()+1,r=e.minTimeout,n=r===void 0?500:r,i=e.factor,o=i===void 0?2:i,a=e.attempt,u=e.maxTimeout,s=u===void 0?1/0:u;return Math.min(t*n*Math.pow(o,a),s)}var er="onRemoveFromFuture",vt=function(e){L(t,e);function t(r,n,i){var o=e.call(this)||this;return o.future=[],o.maxAttempts=r,o.queue=n,o.seen=i??{},o}return t.prototype.push=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=n.map(function(a){var u=r.updateAttempts(a);return u>r.maxAttempts||r.includes(a)?!1:(r.queue.push(a),!0)});return this.queue=this.queue.sort(function(a,u){return r.getAttempts(a)-r.getAttempts(u)}),o},t.prototype.pushWithBackoff=function(r,n){var i=this;if(n===void 0&&(n=0),n==0&&this.getAttempts(r)===0)return this.push(r)[0];var o=this.updateAttempts(r);if(o>this.maxAttempts||this.includes(r))return!1;var a=Zr({attempt:o-1});return n>0&&a<n&&(a=n),setTimeout(function(){i.queue.push(r),i.future=i.future.filter(function(u){return u.id!==r.id}),i.emit(er)},a),this.future.push(r),!0},t.prototype.getAttempts=function(r){var n;return(n=this.seen[r.id])!==null&&n!==void 0?n:0},t.prototype.updateAttempts=function(r){return this.seen[r.id]=this.getAttempts(r)+1,this.getAttempts(r)},t.prototype.includes=function(r){return this.queue.includes(r)||this.future.includes(r)||!!this.queue.find(function(n){return n.id===r.id})||!!this.future.find(function(n){return n.id===r.id})},t.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(t.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),t}(dt),ne=256,Ce=[],Pe;for(;ne--;)Ce[ne]=(ne+256).toString(16).substring(1);function ht(){var e=0,t,r="";if(!Pe||ne+16>256){for(Pe=Array(e=256);e--;)Pe[e]=256*Math.random()|0;e=ne=0}for(;e<16;e++)t=Pe[ne+e],e==6?r+=Ce[t&15|64]:e==8?r+=Ce[t&63|128]:r+=Ce[t],e&1&&e>1&&e<11&&(r+="-");return ne++,r}var en=function(){function e(){this._logs=[]}return e.prototype.log=function(t,r,n){var i=new Date;this._logs.push({level:t,message:r,time:i,extras:n})},Object.defineProperty(e.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),e.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(r,n){var i,o,a,u=d(d({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete u.time;var s=(a=(o=n.time)===null||o===void 0?void 0:o.toISOString())!==null&&a!==void 0?a:"";return r[s]&&(s="".concat(s,"-").concat(Math.random())),d(d({},r),(i={},i[s]=u,i))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(r){var n=r.level,i=r.message,o=r.extras;n==="info"||n==="debug"?console.log(i,o??""):console[n](i,o??"")});this._logs=[]},e}(),tn=function(e){var t={gauge:"g",counter:"c"};return t[e]},tr=function(){function e(){this.metrics=[]}return e.prototype.increment=function(t,r,n){r===void 0&&(r=1),this.metrics.push({metric:t,value:r,tags:n??[],type:"counter",timestamp:Date.now()})},e.prototype.gauge=function(t,r,n){this.metrics.push({metric:t,value:r,tags:n??[],type:"gauge",timestamp:Date.now()})},e.prototype.flush=function(){var t=this.metrics.map(function(r){return d(d({},r),{tags:r.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},e.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:tn(t.type),e:t.timestamp}})},e}(),rn=function(e){L(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.gauge=function(){},t.prototype.increment=function(){},t.prototype.flush=function(){},t.prototype.serialize=function(){return[]},t}(tr),ae=function(){function e(t){var r,n,i;this.retry=(r=t.retry)!==null&&r!==void 0?r:!0,this.type=(n=t.type)!==null&&n!==void 0?n:"plugin Error",this.reason=(i=t.reason)!==null&&i!==void 0?i:""}return e}(),De=function(){function e(t,r,n,i){r===void 0&&(r=ht()),n===void 0&&(n=new rn),i===void 0&&(i=new en),this.attempts=0,this.event=t,this._id=r,this.logger=i,this.stats=n}return e.system=function(){},e.prototype.isSame=function(t){return t.id===this.id},e.prototype.cancel=function(t){throw t||new ae({reason:"Context Cancel"})},e.prototype.log=function(t,r,n){this.logger.log(t,r,n)},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),e.prototype.updateEvent=function(t,r){var n;if(t.split(".")[0]==="integrations"){var i=t.split(".")[1];if(((n=this.event.integrations)===null||n===void 0?void 0:n[i])===!1)return this.event}return Ye(this.event,t,r),this.event},e.prototype.failedDelivery=function(){return this._failedDelivery},e.prototype.setFailedDelivery=function(t){this._failedDelivery=t},e.prototype.logs=function(){return this.logger.logs},e.prototype.flush=function(){this.logger.flush(),this.stats.flush()},e.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},e}();function nn(e,t){var r={};return e.forEach(function(n){var i,o=void 0;{var a=n[t];o=typeof a!="string"?JSON.stringify(a):a}o!==void 0&&(r[o]=C(C([],(i=r[o])!==null&&i!==void 0?i:[],!0),[n],!1))}),r}var on=function(e){return typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"},an=function(){var e,t,r=0;return{done:function(){return e},run:function(n){var i=n();return on(i)&&(++r===1&&(e=new Promise(function(o){return t=o})),i.finally(function(){return--r===0&&t()})),i}}};function un(e){return y(this,void 0,void 0,function(){var t;return g(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e()];case 1:return[2,r.sent()];case 2:return t=r.sent(),[2,Promise.reject(t)];case 3:return[2]}})})}function we(e,t){e.log("debug","plugin",{plugin:t.name});var r=new Date().getTime(),n=t[e.event.type];if(n===void 0)return Promise.resolve(e);var i=un(function(){return n.apply(t,[e])}).then(function(o){var a=new Date().getTime()-r;return o.stats.gauge("plugin_time",a,["plugin:".concat(t.name)]),o}).catch(function(o){if(o instanceof ae&&o.type==="middleware_cancellation")throw o;return o instanceof ae?(e.log("warn",o.type,{plugin:t.name,error:o}),o):(e.log("error","plugin Error",{plugin:t.name,error:o}),e.stats.increment("plugin_error",1,["plugin:".concat(t.name)]),o)});return i}function sn(e,t){return we(e,t).then(function(r){if(r instanceof De)return r;e.log("debug","Context canceled"),e.stats.increment("context_canceled"),e.cancel(r)})}var cn=function(e){L(t,e);function t(r){var n=e.call(this)||this;return n.criticalTasks=an(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=r,n.queue.on(er,function(){n.scheduleFlush(0)}),n}return t.prototype.register=function(r,n,i){return y(this,void 0,void 0,function(){var o,a,u=this;return g(this,function(s){switch(s.label){case 0:return this.plugins.push(n),o=function(c){u.failedInitializations.push(n.name),u.emit("initialization_failure",n),console.warn(n.name,c),r.log("warn","Failed to load destination",{plugin:n.name,error:c}),u.plugins=u.plugins.filter(function(l){return l!==n})},n.type==="destination"&&n.name!=="Segment.io"?(n.load(r,i).catch(o),[3,4]):[3,1];case 1:return s.trys.push([1,3,,4]),[4,n.load(r,i)];case 2:return s.sent(),[3,4];case 3:return a=s.sent(),o(a),[3,4];case 4:return[2]}})})},t.prototype.deregister=function(r,n,i){return y(this,void 0,void 0,function(){var o;return g(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),n.unload?[4,Promise.resolve(n.unload(r,i))]:[3,2];case 1:a.sent(),a.label=2;case 2:return this.plugins=this.plugins.filter(function(u){return u.name!==n.name}),[3,4];case 3:return o=a.sent(),r.log("warn","Failed to unload destination",{plugin:n.name,error:o}),[3,4];case 4:return[2]}})})},t.prototype.dispatch=function(r){return y(this,void 0,void 0,function(){var n;return g(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.push(r),n=this.subscribeToDelivery(r),this.scheduleFlush(0),[2,n]})})},t.prototype.subscribeToDelivery=function(r){return y(this,void 0,void 0,function(){var n=this;return g(this,function(i){return[2,new Promise(function(o){var a=function(u,s){u.isSame(r)&&(n.off("flush",a),o(u))};n.on("flush",a)})]})})},t.prototype.dispatchSingle=function(r){return y(this,void 0,void 0,function(){var n=this;return g(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.updateAttempts(r),r.attempts=1,[2,this.deliver(r).catch(function(o){var a=n.enqueuRetry(o,r);return a?n.subscribeToDelivery(r):(r.setFailedDelivery({reason:o}),r)})]})})},t.prototype.isEmpty=function(){return this.queue.length===0},t.prototype.scheduleFlush=function(r){var n=this;r===void 0&&(r=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){n.flush().then(function(){setTimeout(function(){n.flushing=!1,n.queue.length&&n.scheduleFlush(0)},0)})},r))},t.prototype.deliver=function(r){return y(this,void 0,void 0,function(){var n,i,o,a;return g(this,function(u){switch(u.label){case 0:return[4,this.criticalTasks.done()];case 1:u.sent(),n=Date.now(),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,this.flushOne(r)];case 3:return r=u.sent(),i=Date.now()-n,this.emit("delivery_success",r),r.stats.gauge("delivered",i),r.log("debug","Delivered",r.event),[2,r];case 4:throw o=u.sent(),a=o,r.log("error","Failed to deliver",a),this.emit("delivery_failure",r,a),r.stats.increment("delivery_failed"),o;case 5:return[2]}})})},t.prototype.enqueuRetry=function(r,n){var i=!(r instanceof ae)||r.retry;return i?this.queue.pushWithBackoff(n):!1},t.prototype.flush=function(){return y(this,void 0,void 0,function(){var r,n,i;return g(this,function(o){switch(o.label){case 0:if(this.queue.length===0)return[2,[]];if(r=this.queue.pop(),!r)return[2,[]];r.attempts=this.queue.getAttempts(r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.deliver(r)];case 2:return r=o.sent(),this.emit("flush",r,!0),[3,4];case 3:return n=o.sent(),i=this.enqueuRetry(n,r),i||(r.setFailedDelivery({reason:n}),this.emit("flush",r,!1)),[2,[]];case 4:return[2,[r]]}})})},t.prototype.isReady=function(){return!0},t.prototype.availableExtensions=function(r){var n=this.plugins.filter(function(h){var v,m,S;if(h.type!=="destination"&&h.name!=="Segment.io")return!0;var w=void 0;return(v=h.alternativeNames)===null||v===void 0||v.forEach(function(b){r[b]!==void 0&&(w=r[b])}),(S=(m=r[h.name])!==null&&m!==void 0?m:w)!==null&&S!==void 0?S:(h.name==="Segment.io"?!0:r.All)!==!1}),i=nn(n,"type"),o=i.before,a=o===void 0?[]:o,u=i.enrichment,s=u===void 0?[]:u,c=i.destination,l=c===void 0?[]:c,f=i.after,p=f===void 0?[]:f;return{before:a,enrichment:s,destinations:l,after:p}},t.prototype.flushOne=function(r){var n,i;return y(this,void 0,void 0,function(){var o,a,u,s,c,l,v,f,p,h,v,m,S,w,b;return g(this,function(E){switch(E.label){case 0:if(!this.isReady())throw new Error("Not ready");r.attempts>1&&this.emit("delivery_retry",r),o=this.availableExtensions((n=r.event.integrations)!==null&&n!==void 0?n:{}),a=o.before,u=o.enrichment,s=0,c=a,E.label=1;case 1:return s<c.length?(l=c[s],[4,sn(r,l)]):[3,4];case 2:v=E.sent(),v instanceof De&&(r=v),this.emit("message_enriched",r,l),E.label=3;case 3:return s++,[3,1];case 4:f=0,p=u,E.label=5;case 5:return f<p.length?(h=p[f],[4,we(r,h)]):[3,8];case 6:v=E.sent(),v instanceof De&&(r=v),this.emit("message_enriched",r,h),E.label=7;case 7:return f++,[3,5];case 8:return m=this.availableExtensions((i=r.event.integrations)!==null&&i!==void 0?i:{}),S=m.destinations,w=m.after,[4,new Promise(function(A,I){setTimeout(function(){var x=S.map(function(k){return we(r,k)});Promise.all(x).then(A).catch(I)},0)})];case 9:return E.sent(),r.stats.increment("message_delivered"),this.emit("message_delivered",r),b=w.map(function(A){return we(r,A)}),[4,Promise.all(b)];case 10:return E.sent(),[2,r]}})})},t}(dt),ln=function(e,t){var r=Date.now()-e;return Math.max((t??300)-r,0)};function fn(e,t,r,n){return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return r.emit("dispatch_start",e),i=Date.now(),t.isEmpty()?[4,t.dispatchSingle(e)]:[3,2];case 1:return o=a.sent(),[3,4];case 2:return[4,t.dispatch(e)];case 3:o=a.sent(),a.label=4;case 4:return n!=null&&n.callback?[4,Yr(o,n.callback,ln(i,n.timeout))]:[3,6];case 5:o=a.sent(),a.label=6;case 6:return n!=null&&n.debug&&o.flush(),[2,o]}})})}function rr(e,t,r,n){var i,o=[e,t,r,n],a=q(e)?e.event:e;if(!a||!ee(a))throw new Error("Event missing");var u=q(e)?(i=e.properties)!==null&&i!==void 0?i:{}:q(t)?t:{},s={};he(r)||(s=r??{}),q(e)&&!he(t)&&(s=t??{});var c=o.find(he);return[a,u,s,c]}function et(e,t,r,n,i){var o,a,u=null,s=null,c=[e,t,r,n,i],l=c.filter(ee);l.length===1?ee(c[1])?(s=c[1],u=null):(s=l[0],u=null):l.length===2&&(typeof c[0]=="string"&&(u=c[0]),typeof c[1]=="string"&&(s=c[1]));var f=c.find(he),p=c.filter(q);return p.length===1?q(c[2])?(a={},o=c[2]):q(c[3])?(o={},a=c[3]):(o=p[0],a={}):p.length===2&&(o=p[0],a=p[1]),[u,s,o??(o={}),a??(a={}),f]}var tt=function(e){return function(){for(var t,r,n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];for(var a={},u=["callback","options","traits","id"],s=0,c=i;s<c.length;s++){var l=c[s],f=u.pop();if(f==="id"){if(ee(l)||Ze(l)){a.id=l.toString();continue}if(l==null)continue;f=u.pop()}if((f==="traits"||f==="options")&&(l==null||q(l))&&(a[f]=l),he(l)){a.callback=l;break}}return[(t=a.id)!==null&&t!==void 0?t:e.id(),(r=a.traits)!==null&&r!==void 0?r:{},(n=a.options)!==null&&n!==void 0?n:{},a.callback]}};function nr(e,t,r,n){Ze(e)&&(e=e.toString()),Ze(t)&&(t=t.toString());var i=[e,t,r,n],o=i.filter(ee),a=o[0],u=a===void 0?e:a,s=o[1],c=s===void 0?null:s,l=i.filter(q)[0],f=l===void 0?{}:l,p=i.find(he);return[u,c,f,p]}function pt(){return typeof window<"u"}function Io(){return!pt()}function dn(){return pt()?window.navigator.onLine:!0}function Se(){return!dn()}function vn(e,t){return t=t||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],a=[],u={},s=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:s,headers:{keys:function(){return o},entries:function(){return a},get:function(l){return u[l.toLowerCase()]},has:function(l){return l.toLowerCase()in u}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(l,f,p){o.push(f=f.toLowerCase()),a.push([f,p]),u[f]=u[f]?u[f]+","+p:p}),r(s())},i.onerror=n,i.withCredentials=t.credentials=="include",t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)})}var yt=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:null},Te=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=yt();return(r&&r.fetch||vn).apply(void 0,e)},je="1.79.0",ir="api.segment.io/v1",hn=function(e,t,r){var n=t.reduce(function(i,o){var a=o.split(":"),u=a[0],s=a[1];return i[u]=s,i},{});return{type:"Counter",metric:e,value:1,tags:d(d({},n),{library:"analytics.js",library_version:"npm:next-".concat(je)})}};function Ve(e){console.error("Error sending segment performance metrics",e)}var pn=function(){function e(t){var r=this,n,i,o,a,u;if(this.host=(n=t==null?void 0:t.host)!==null&&n!==void 0?n:ir,this.sampleRate=(i=t==null?void 0:t.sampleRate)!==null&&i!==void 0?i:1,this.flushTimer=(o=t==null?void 0:t.flushTimer)!==null&&o!==void 0?o:30*1e3,this.maxQueueSize=(a=t==null?void 0:t.maxQueueSize)!==null&&a!==void 0?a:20,this.protocol=(u=t==null?void 0:t.protocol)!==null&&u!==void 0?u:"https",this.queue=[],this.sampleRate>0){var s=!1,c=function(){s||(s=!0,r.flush().catch(Ve),s=!1,setTimeout(c,r.flushTimer))};c()}}return e.prototype.increment=function(t,r){if(t.includes("analytics_js.")&&r.length!==0&&!(Math.random()>this.sampleRate)&&!(this.queue.length>=this.maxQueueSize)){var n=hn(t,r);this.queue.push(n),t.includes("error")&&this.flush().catch(Ve)}},e.prototype.flush=function(){return y(this,void 0,void 0,function(){var t=this;return g(this,function(r){switch(r.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(n){Ve(n),t.sampleRate=0})];case 1:return r.sent(),[2]}})})},e.prototype.send=function(){return y(this,void 0,void 0,function(){var t,r,n;return g(this,function(i){return t={series:this.queue},this.queue=[],r={"Content-Type":"text/plain"},n="".concat(this.protocol,"://").concat(this.host,"/m"),[2,Te(n,{headers:r,body:JSON.stringify(t),method:"POST"})]})})},e}(),Ae,or=function(e){L(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.initRemoteMetrics=function(r){Ae=new pn(r)},t.prototype.increment=function(r,n,i){e.prototype.increment.call(this,r,n,i),Ae==null||Ae.increment(r,i??[])},t}(tr),K=function(e){L(t,e);function t(r,n){return e.call(this,r,n,new or)||this}return t.system=function(){return new this({type:"track",event:"system"})},t}(De),ar="bpc",ur=function(e,t,r,n,i,o){return{__t:ar,c:t,p:n,u:e,s:r,t:i,r:o}},yn=Object.keys(ur("","","","","",""));function gn(e){if(!q(e)||e.__t!==ar)return!1;for(var t in e)if(!yn.includes(t))return!1;return!0}var mn=function(e,t){return e.indexOf("?")>-1?e:e+t},bn=function(e){var t=e.indexOf("#");return t===-1?e:e.slice(0,t)},_n=function(e){try{return new URL(e).pathname}catch{return e[0]==="/"?e:"/"+e}},sr=function(e){var t=e.c,r=e.p,n=e.s,i=e.u,o=e.r,a=e.t,u=t?_n(t):r,s=t?mn(t,n):bn(i);return{path:u,referrer:o,search:n,title:a,url:s}},cr=function(){var e=document.querySelector("link[rel='canonical']");return ur(location.href,e&&e.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},wn=function(){return sr(cr())};function Sn(e,t){return Object.assign.apply(Object,C([{}],t.map(function(r){var n;if(e&&Object.prototype.hasOwnProperty.call(e,r))return n={},n[r]=e[r],n}),!1))}var le=function(e,t){t===void 0&&(t=wn());var r=e.context,n;e.type==="page"&&(n=e.properties&&Sn(e.properties,Object.keys(t)),e.properties=d(d(d({},t),e.properties),e.name?{name:e.name}:{})),r.page=d(d(d({},t),n),r.page)},lr=function(e){L(t,e);function t(r){var n=e.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(ht())},onEventMethodCall:function(i){var o=i.options;n.maybeUpdateAnonId(o)},onFinishedEvent:function(i){return n.addIdentity(i),i}})||this;return n.user=r,n}return t.prototype.maybeUpdateAnonId=function(r){r!=null&&r.anonymousId&&this.user.anonymousId(r.anonymousId)},t.prototype.addIdentity=function(r){this.user.id()&&(r.userId=this.user.id()),this.user.anonymousId()&&(r.anonymousId=this.user.anonymousId())},t.prototype.track=function(r,n,i,o,a){var u=e.prototype.track.call(this,r,n,i,o);return le(u,a),u},t.prototype.page=function(r,n,i,o,a,u){var s=e.prototype.page.call(this,r,n,i,o,a);return le(s,u),s},t.prototype.screen=function(r,n,i,o,a,u){var s=e.prototype.screen.call(this,r,n,i,o,a);return le(s,u),s},t.prototype.identify=function(r,n,i,o,a){var u=e.prototype.identify.call(this,r,n,i,o);return le(u,a),u},t.prototype.group=function(r,n,i,o,a){var u=e.prototype.group.call(this,r,n,i,o);return le(u,a),u},t.prototype.alias=function(r,n,i,o,a){var u=e.prototype.alias.call(this,r,n,i,o);return le(u,a),u},t}(Qr),fr=function(e){return"addMiddleware"in e&&e.type==="destination"},V={getItem:function(){},setItem:function(){},removeItem:function(){}};try{V=pt()&&window.localStorage?window.localStorage:V}catch(e){console.warn("Unable to access localStorage",e)}function dr(e){var t=V.getItem(e);return(t?JSON.parse(t):[]).map(function(r){return new K(r.event,r.id)})}function En(e,t){var r=dr(e),n=C(C([],t,!0),r,!0),i=n.reduce(function(o,a){var u;return d(d({},o),(u={},u[a.id]=a,u))},{});V.setItem(e,JSON.stringify(Object.values(i)))}function vr(e){var t=V.getItem(e);return t?JSON.parse(t):{}}function In(e,t){var r=vr(e);V.setItem(e,JSON.stringify(d(d({},r),t)))}function zt(e){V.removeItem(e)}var On=function(){return new Date().getTime()};function rt(e,t,r){r===void 0&&(r=0);var n=50,i="persisted-queue:v1:".concat(e,":lock"),o=function(c){return new Date().getTime()>c},a=V.getItem(i),u=a?JSON.parse(a):null,s=u===null||o(u);if(s){V.setItem(i,JSON.stringify(On()+n)),t(),V.removeItem(i);return}!s&&r<3?setTimeout(function(){rt(e,t,r+1)},n):console.error("Unable to retrieve lock")}var gt=function(e){L(t,e);function t(r,n){var i=e.call(this,r,[])||this,o="persisted-queue:v1:".concat(n,":items"),a="persisted-queue:v1:".concat(n,":seen"),u=[],s={};return rt(n,function(){try{u=dr(o),s=vr(a),zt(o),zt(a),i.queue=C(C([],u,!0),i.queue,!0),i.seen=d(d({},s),i.seen)}catch(c){console.error(c)}}),window.addEventListener("pagehide",function(){if(i.todo>0){var c=C(C([],i.queue,!0),i.future,!0);try{rt(n,function(){En(o,c),In(a,i.seen)})}catch(l){console.error(l)}}}),i}return t}(vt),Pn=function(e){L(t,e);function t(r){return e.call(this,typeof r=="string"?new gt(4,r):r)||this}return t.prototype.flush=function(){return y(this,void 0,void 0,function(){return g(this,function(r){return Se()?[2,[]]:[2,e.prototype.flush.call(this)]})})},t}(cn);function mt(e){for(var t=e.constructor.prototype,r=0,n=Object.getOwnPropertyNames(t);r<n.length;r++){var i=n[r];if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);o&&typeof o.value=="function"&&(e[i]=e[i].bind(e))}}return e}/*! js-cookie v3.0.1 | MIT */function xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var An={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function nt(e,t){function r(i,o,a){if(!(typeof document>"u")){a=xe({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var s in a)a[s]&&(u+="; "+s,a[s]!==!0&&(u+="="+a[s].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+u}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},u=0;u<o.length;u++){var s=o[u].split("="),c=s.slice(1).join("=");try{var l=decodeURIComponent(s[0]);if(a[l]=e.read(c,l),i===l)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",xe({},o,{expires:-1}))},withAttributes:function(i){return nt(this.converter,xe({},this.attributes,i))},withConverter:function(i){return nt(xe({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var W=nt(An,{path:"/"});function xn(e){var t=e.hostname,r=t.split("."),n=r[r.length-1],i=[];if(r.length===4&&parseInt(n,10)>0||r.length<=1)return i;for(var o=r.length-2;o>=0;--o)i.push(r.slice(o).join("."));return i}function Mn(e){try{return new URL(e)}catch{return}}function hr(e){var t=Mn(e);if(t)for(var r=xn(t),n=0;n<r.length;++n){var i="__tld__",o=r[n],a={domain:"."+o};try{if(W.set(i,"1",a),W.get(i))return W.remove(i,a),o}catch{return}}}var Cn=365,pr=function(){function e(t){t===void 0&&(t=e.defaults),this.options=d(d({},e.defaults),t)}return Object.defineProperty(e,"defaults",{get:function(){return{maxage:Cn,domain:hr(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),e.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},e.prototype.get=function(t){var r;try{var n=W.get(t);if(n==null)return null;try{return(r=JSON.parse(n))!==null&&r!==void 0?r:null}catch{return n??null}}catch{return null}},e.prototype.set=function(t,r){typeof r=="string"?W.set(t,r,this.opts()):r===null?W.remove(t,this.opts()):W.set(t,JSON.stringify(r),this.opts())},e.prototype.remove=function(t){return W.remove(t,this.opts())},e}(),kn=function(){function e(){}return e.prototype.localStorageWarning=function(t,r){console.warn("Unable to access ".concat(t,", localStorage may be ").concat(r))},e.prototype.get=function(t){var r;try{var n=localStorage.getItem(t);if(n===null)return null;try{return(r=JSON.parse(n))!==null&&r!==void 0?r:null}catch{return n??null}}catch{return this.localStorageWarning(t,"unavailable"),null}},e.prototype.set=function(t,r){try{localStorage.setItem(t,JSON.stringify(r))}catch{this.localStorageWarning(t,"full")}},e.prototype.remove=function(t){try{return localStorage.removeItem(t)}catch{this.localStorageWarning(t,"unavailable")}},e}(),bt=function(){function e(){this.cache={}}return e.prototype.get=function(t){var r;return(r=this.cache[t])!==null&&r!==void 0?r:null},e.prototype.set=function(t,r){this.cache[t]=r},e.prototype.remove=function(t){delete this.cache[t]},e}(),j={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function yr(e){return e&&e.stores&&Array.isArray(e.stores)&&e.stores.every(function(t){return Object.values(j).includes(t)})}function Dn(e){return typeof e=="object"&&e.name!==void 0}var Ge=function(e,t,r,n){console.warn("".concat(e.constructor.name,": Can't ").concat(t,' key "').concat(r,'" | Err: ').concat(n))},Z=function(){function e(t){this.stores=t}return e.prototype.get=function(t){for(var r=null,n=0,i=this.stores;n<i.length;n++){var o=i[n];try{if(r=o.get(t),r!=null)return r}catch(a){Ge(o,"get",t,a)}}return null},e.prototype.set=function(t,r){this.stores.forEach(function(n){try{n.set(t,r)}catch(i){Ge(n,"set",t,i)}})},e.prototype.clear=function(t){this.stores.forEach(function(r){try{r.remove(t)}catch(n){Ge(r,"remove",t,n)}})},e.prototype.getAndSync=function(t){var r=this.get(t),n=typeof r=="number"?r.toString():r;return this.set(t,n),n},e}();function it(e){var t=e.map(function(r){var n,i;switch(Dn(r)?(n=r.name,i=r.settings):n=r,n){case j.Cookie:return new pr(i);case j.LocalStorage:return new kn;case j.Memory:return new bt;default:throw new Error("Unknown Store Type: ".concat(r))}});return t}function gr(e,t){return e.map(function(r){return t&&r===j.Cookie?{name:r,settings:t}:r})}var re={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},_t=function(){function e(t,r){t===void 0&&(t=re);var n=this,i,o,a,u;this.options={},this.id=function(c){if(n.options.disable)return null;var l=n.identityStore.getAndSync(n.idKey);if(c!==void 0){n.identityStore.set(n.idKey,c);var f=c!==l&&l!==null&&c!==null;f&&n.anonymousId(null)}var p=n.identityStore.getAndSync(n.idKey);if(p)return p;var h=n.legacyUserStore.get(re.cookie.oldKey);return h?typeof h=="object"?h.id:h:null},this.anonymousId=function(c){var l,f;if(n.options.disable)return null;if(c===void 0){var p=(l=n.identityStore.getAndSync(n.anonKey))!==null&&l!==void 0?l:(f=n.legacySIO())===null||f===void 0?void 0:f[0];if(p)return p}return c===null?(n.identityStore.set(n.anonKey,null),n.identityStore.getAndSync(n.anonKey)):(n.identityStore.set(n.anonKey,c??ht()),n.identityStore.getAndSync(n.anonKey))},this.traits=function(c){var l;if(!n.options.disable)return c===null&&(c={}),c&&n.traitsStore.set(n.traitsKey,c??{}),(l=n.traitsStore.get(n.traitsKey))!==null&&l!==void 0?l:{}},this.options=d(d({},re),t),this.cookieOptions=r,this.idKey=(o=(i=t.cookie)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:re.cookie.key,this.traitsKey=(u=(a=t.localStorage)===null||a===void 0?void 0:a.key)!==null&&u!==void 0?u:re.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,r),this.legacyUserStore=this.createStorage(this.options,r,function(c){return c===j.Cookie}),this.traitsStore=this.createStorage(this.options,r,function(c){return c!==j.Cookie});var s=this.legacyUserStore.get(re.cookie.oldKey);s&&typeof s=="object"&&(s.id&&this.id(s.id),s.traits&&this.traits(s.traits)),mt(this)}return e.prototype.legacySIO=function(){var t=this.legacyUserStore.get("_sio");if(!t)return null;var r=t.split("----"),n=r[0],i=r[1];return[n,i]},e.prototype.identify=function(t,r){if(!this.options.disable){r=r??{};var n=this.id();(n===null||n===t)&&(r=d(d({},this.traits()),r)),t&&this.id(t),this.traits(r)}},e.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},e.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},e.prototype.load=function(){return new e(this.options,this.cookieOptions)},e.prototype.save=function(){return!0},e.prototype.createStorage=function(t,r,n){var i=[j.LocalStorage,j.Cookie,j.Memory];return t.disable?new Z([]):t.persist?(t.storage!==void 0&&t.storage!==null&&yr(t.storage)&&(i=t.storage.stores),t.localStorageFallbackDisabled&&(i=i.filter(function(o){return o!==j.LocalStorage})),n&&(i=i.filter(n)),new Z(it(gr(i,r)))):new Z([new bt])},e.defaults=re,e}(),Bt={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},mr=function(e){L(t,e);function t(r,n){r===void 0&&(r=Bt);var i=e.call(this,d(d({},Bt),r),n)||this;return i.anonymousId=function(o){},mt(i),i}return t}(_t),wt="analytics";function St(){return window[wt]}function Fn(e){wt=e}function Tn(e){window[wt]=e}var jn=function(e){return typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"},br=function(e,t,r){r.getAndRemove(e).forEach(function(n){Re(t,n).catch(console.error)})},Rn=function(e,t){return y(void 0,void 0,void 0,function(){var r,n,i;return g(this,function(o){switch(o.label){case 0:r=0,n=t.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return r<n.length?(i=n[r],[4,Re(e,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},Ln=function(e,t){return y(void 0,void 0,void 0,function(){var r,n,i;return g(this,function(o){switch(o.label){case 0:r=0,n=t.getAndRemove("register"),o.label=1;case 1:return r<n.length?(i=n[r],[4,Re(e,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},Nn=br.bind(void 0,"on"),qn=br.bind(void 0,"setAnonymousId"),Un=function(e,t){Object.keys(t.calls).forEach(function(r){t.getAndRemove(r).forEach(function(n){setTimeout(function(){Re(e,n).catch(console.error)},0)})})},fe=function(e){if(_r(e)){var t=e.pop();return sr(t)}},_r=function(e){var t=e[e.length-1];return gn(t)},ot=function(){function e(t,r,n,i){n===void 0&&(n=function(){}),i===void 0&&(i=console.error),this.method=t,this.resolve=n,this.reject=i,this.called=!1,this.args=r}return e}(),$n=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._callMap={},this.add.apply(this,t)}return Object.defineProperty(e.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(t){this._callMap=t},enumerable:!1,configurable:!0}),e.prototype.get=function(t){var r;return(r=this.calls[t])!==null&&r!==void 0?r:[]},e.prototype.getAndRemove=function(t){var r=this.get(t);return this.calls[t]=[],r},e.prototype.add=function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];r.forEach(function(i){var o=["track","screen","alias","group","page","identify"];o.includes(i.method)&&!_r(i.args)&&(i.args=C(C([],i.args,!0),[cr()],!1)),t.calls[i.method]?t.calls[i.method].push(i):t.calls[i.method]=[i]})},e.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},e.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this.calls))},e.prototype._pushSnippetWindowBuffer=function(){},e}();function Re(e,t){return y(this,void 0,void 0,function(){var r,n;return g(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t.called?[2,void 0]:(t.called=!0,r=e[t.method].apply(e,t.args),jn(r)?[4,r]:[3,2]);case 1:i.sent(),i.label=2;case 2:return t.resolve(r),[3,4];case 3:return n=i.sent(),t.reject(n),[3,4];case 4:return[2]}})})}var zn=function(){function e(t){var r=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=je,this._preInitBuffer=new $n,this._promise=t(this._preInitBuffer),this._promise.then(function(n){var i=n[0],o=n[1];r.instance=i,r.ctx=o}).catch(function(){})}return e.prototype.then=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).then.apply(t,r)},e.prototype.catch=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).catch.apply(t,r)},e.prototype.finally=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).finally.apply(t,r)},e.prototype._createMethod=function(t){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(r.instance){var a=(n=r.instance)[t].apply(n,i);return Promise.resolve(a)}return new Promise(function(u,s){r._preInitBuffer.add(new ot(t,i,u,s))})}},e.prototype._createChainableMethod=function(t){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return r.instance?((n=r.instance)[t].apply(n,i),r):(r._preInitBuffer.add(new ot(t,i)),r)}},e}(),X={},G={},Et={},wr={exports:{}};(function(e){e.exports=t(r),e.exports.find=e.exports,e.exports.replace=function(u,s,c,l){return t(i).call(this,u,s,c,l),u},e.exports.del=function(u,s,c){return t(n).call(this,u,s,null,c),u};function t(u){return function(s,c,l,f){var p=f&&a(f.normalizer)?f.normalizer:o;c=p(c);for(var h,v=!1;!v;)m();function m(){for(h in s){var S=p(h);if(c.indexOf(S)===0){var w=c.substr(S.length);if(w.charAt(0)==="."||w.length===0){c=w.substr(1);var b=s[h];if(b==null){v=!0;return}if(!c.length){v=!0;return}s=b;return}}}h=void 0,v=!0}if(h)return s==null?s:u(s,h,l)}}function r(u,s){if(u.hasOwnProperty(s))return u[s]}function n(u,s){return u.hasOwnProperty(s)&&delete u[s],u}function i(u,s,c){return u.hasOwnProperty(s)&&(u[s]=c),u}function o(u){return u.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}function a(u){return typeof u=="function"}})(wr);var Le=wr.exports,Bn=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});var H=Bn(Le);function de(e,t){return function(){var r=this.traits(),n=this.properties?this.properties():{};return H.default(r,"address."+e)||H.default(r,e)||(t?H.default(r,"address."+t):null)||(t?H.default(r,t):null)||H.default(n,"address."+e)||H.default(n,e)||(t?H.default(n,"address."+t):null)||(t?H.default(n,t):null)}}function Kn(e){e.zip=de("postalCode","zip"),e.country=de("country"),e.street=de("street"),e.state=de("state"),e.city=de("city"),e.region=de("region")}Et.default=Kn;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.clone=void 0;function at(e){if(typeof e!="object")return e;if(Object.prototype.toString.call(e)==="[object Object]"){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=at(e[r]));return t}else return Array.isArray(e)?e.map(at):e}Ne.clone=at;var It={};Object.defineProperty(It,"__esModule",{value:!0});var Vn={Salesforce:!0};function Gn(e){return!Vn[e]}It.default=Gn;var qe={},Sr=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;qe.parse=function(e){var t=[1,5,6,7,11,12],r=Sr.exec(e),n=0;if(!r)return new Date(e);for(var i=0,o;o=t[i];i++)r[o]=parseInt(r[o],10)||0;r[2]=parseInt(r[2],10)||1,r[3]=parseInt(r[3],10)||1,r[2]--,r[8]=r[8]?(r[8]+"00").substring(0,3):0,r[4]===" "?n=new Date().getTimezoneOffset():r[9]!=="Z"&&r[10]&&(n=r[11]*60+r[12],r[10]==="+"&&(n=0-n));var a=Date.UTC(r[1],r[2],r[3],r[5],r[6]+n,r[7],r[8]);return new Date(a)};qe.is=function(e,t){return typeof e!="string"||t&&/^\d{4}-\d{2}-\d{2}/.test(e)===!1?!1:Sr.test(e)};var Ot={},Jn=/\d{13}/;Ot.is=function(e){return Jn.test(e)};Ot.parse=function(e){return e=parseInt(e,10),new Date(e)};var Pt={},Wn=/\d{10}/;Pt.is=function(e){return Wn.test(e)};Pt.parse=function(e){var t=parseInt(e,10)*1e3;return new Date(t)};var Kt=qe,Vt=Ot,Gt=Pt,Qn=Object.prototype,Er=Qn.toString;function Hn(e){return Er.call(e)==="[object Date]"}function Xn(e){return Er.call(e)==="[object Number]"}var At=function(t){return Hn(t)?t:Xn(t)?new Date(Yn(t)):Kt.is(t)?Kt.parse(t):Vt.is(t)?Vt.parse(t):Gt.is(t)?Gt.parse(t):new Date(t)};function Yn(e){return e<315576e5?e*1e3:e}var Jt=qe,Zn=xt;function xt(e,t){return t===void 0&&(t=!0),e&&typeof e=="object"?ei(e,t):Array.isArray(e)?ti(e,t):Jt.is(e,t)?Jt.parse(e):e}function ei(e,t){return Object.keys(e).forEach(function(r){e[r]=xt(e[r],t)}),e}function ti(e,t){return e.forEach(function(r,n){e[n]=xt(r,t)}),e}var Ee=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(G,"__esModule",{value:!0});G.Facade=void 0;var ri=Ee(Et),ye=Ne,ni=Ee(It),ii=Ee(At),ut=Ee(Le),oi=Ee(Zn);function N(e,t){t=t||{},this.raw=ye.clone(e),"clone"in t||(t.clone=!0),t.clone&&(e=ye.clone(e)),"traverse"in t||(t.traverse=!0),"timestamp"in e?e.timestamp=ii.default(e.timestamp):e.timestamp=new Date,t.traverse&&oi.default(e),this.opts=t,this.obj=e}G.Facade=N;var O=N.prototype;O.proxy=function(e){var t=e.split(".");e=t.shift();var r=this[e]||this.obj[e];return r&&(typeof r=="function"&&(r=r.call(this)||{}),t.length===0?this.opts.clone?st(r):r:(r=ut.default(r,t.join(".")),this.opts.clone?st(r):r))};O.field=function(e){var t=this.obj[e];return this.opts.clone?st(t):t};N.proxy=function(e){return function(){return this.proxy(e)}};N.field=function(e){return function(){return this.field(e)}};N.multi=function(e){return function(){var t=this.proxy(e+"s");if(Array.isArray(t))return t;var r=this.proxy(e);return r&&(r=[this.opts.clone?ye.clone(r):r]),r||[]}};N.one=function(e){return function(){var t=this.proxy(e);if(t)return t;var r=this.proxy(e+"s");if(Array.isArray(r))return r[0]}};O.json=function(){var e=this.opts.clone?ye.clone(this.obj):this.obj;return this.type&&(e.type=this.type()),e};O.rawEvent=function(){return this.raw};O.options=function(e){var t=this.obj.options||this.obj.context||{},r=this.opts.clone?ye.clone(t):t;if(!e)return r;if(this.enabled(e)){var n=this.integrations(),i=n[e]||ut.default(n,e);return typeof i!="object"&&(i=ut.default(this.options(),e)),typeof i=="object"?i:{}}};O.context=O.options;O.enabled=function(e){var t=this.proxy("options.providers.all");typeof t!="boolean"&&(t=this.proxy("options.all")),typeof t!="boolean"&&(t=this.proxy("integrations.all")),typeof t!="boolean"&&(t=!0);var r=t&&ni.default(e),n=this.integrations();if(n.providers&&n.providers.hasOwnProperty(e)&&(r=n.providers[e]),n.hasOwnProperty(e)){var i=n[e];typeof i=="boolean"?r=i:r=!0}return!!r};O.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()};O.active=function(){var e=this.proxy("options.active");return e==null&&(e=!0),e};O.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")};O.sessionId=O.anonymousId;O.groupId=N.proxy("options.groupId");O.traits=function(e){var t=this.proxy("options.traits")||{},r=this.userId();e=e||{},r&&(t.id=r);for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=this[n]==null?this.proxy("options.traits."+n):this[n]();if(i==null)continue;t[e[n]]=i,delete t[n]}return t};O.library=function(){var e=this.proxy("options.library");return e?typeof e=="string"?{name:e,version:null}:e:{name:"unknown",version:null}};O.device=function(){var e=this.proxy("context.device");(typeof e!="object"||e===null)&&(e={});var t=this.library().name;return e.type||(t.indexOf("ios")>-1&&(e.type="ios"),t.indexOf("android")>-1&&(e.type="android")),e};O.userAgent=N.proxy("context.userAgent");O.timezone=N.proxy("context.timezone");O.timestamp=N.field("timestamp");O.channel=N.field("channel");O.ip=N.proxy("context.ip");O.userId=N.field("userId");ri.default(O);function st(e){return ye.clone(e)}var Ue={},ct={exports:{}};typeof Object.create=="function"?ct.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ct.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var se=ct.exports,ai=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Alias=void 0;var ui=ai(se),Ir=G;function $(e,t){Ir.Facade.call(this,e,t)}Ue.Alias=$;ui.default($,Ir.Facade);$.prototype.action=function(){return"alias"};$.prototype.type=$.prototype.action;$.prototype.previousId=function(){return this.field("previousId")||this.field("from")};$.prototype.from=$.prototype.previousId;$.prototype.userId=function(){return this.field("userId")||this.field("to")};$.prototype.to=$.prototype.userId;var $e={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});var si=/.+\@.+\..+/;function ci(e){return si.test(e)}ge.default=ci;var Mt=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($e,"__esModule",{value:!0});$e.Group=void 0;var li=Mt(se),fi=Mt(ge),di=Mt(At),me=G;function Ct(e,t){me.Facade.call(this,e,t)}$e.Group=Ct;li.default(Ct,me.Facade);var z=Ct.prototype;z.action=function(){return"group"};z.type=z.action;z.groupId=me.Facade.field("groupId");z.created=function(){var e=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(e)return di.default(e)};z.email=function(){var e=this.proxy("traits.email");if(e)return e;var t=this.groupId();if(fi.default(t))return t};z.traits=function(e){var t=this.properties(),r=this.groupId();e=e||{},r&&(t.id=r);for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=this[n]==null?this.proxy("traits."+n):this[n]();if(i==null)continue;t[e[n]]=i,delete t[n]}return t};z.name=me.Facade.proxy("traits.name");z.industry=me.Facade.proxy("traits.industry");z.employees=me.Facade.proxy("traits.employees");z.properties=function(){return this.field("traits")||this.field("properties")||{}};var Ie={},ze=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.Identify=void 0;var J=G,pe=ze(Le),vi=ze(se),hi=ze(ge),Or=ze(At),ie=function(e){return e.trim()};function kt(e,t){J.Facade.call(this,e,t)}Ie.Identify=kt;vi.default(kt,J.Facade);var P=kt.prototype;P.action=function(){return"identify"};P.type=P.action;P.traits=function(e){var t=this.field("traits")||{},r=this.userId();e=e||{},r&&(t.id=r);for(var n in e){var i=this[n]==null?this.proxy("traits."+n):this[n]();i!=null&&(t[e[n]]=i,n!==e[n]&&delete t[n])}return t};P.email=function(){var e=this.proxy("traits.email");if(e)return e;var t=this.userId();if(hi.default(t))return t};P.created=function(){var e=this.proxy("traits.created")||this.proxy("traits.createdAt");if(e)return Or.default(e)};P.companyCreated=function(){var e=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(e)return Or.default(e)};P.companyName=function(){return this.proxy("traits.company.name")};P.name=function(){var e=this.proxy("traits.name");if(typeof e=="string")return ie(e);var t=this.firstName(),r=this.lastName();if(t&&r)return ie(t+" "+r)};P.firstName=function(){var e=this.proxy("traits.firstName");if(typeof e=="string")return ie(e);var t=this.proxy("traits.name");if(typeof t=="string")return ie(t).split(" ")[0]};P.lastName=function(){var e=this.proxy("traits.lastName");if(typeof e=="string")return ie(e);var t=this.proxy("traits.name");if(typeof t=="string"){var r=ie(t).indexOf(" ");if(r!==-1)return ie(t.substr(r+1))}};P.uid=function(){return this.userId()||this.username()||this.email()};P.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")};P.age=function(){var e=this.birthday(),t=pe.default(this.traits(),"age");if(t!=null)return t;if(e instanceof Date){var r=new Date;return r.getFullYear()-e.getFullYear()}};P.avatar=function(){var e=this.traits();return pe.default(e,"avatar")||pe.default(e,"photoUrl")||pe.default(e,"avatarUrl")};P.position=function(){var e=this.traits();return pe.default(e,"position")||pe.default(e,"jobTitle")};P.username=J.Facade.proxy("traits.username");P.website=J.Facade.one("traits.website");P.websites=J.Facade.multi("traits.website");P.phone=J.Facade.one("traits.phone");P.phones=J.Facade.multi("traits.phone");P.address=J.Facade.proxy("traits.address");P.gender=J.Facade.proxy("traits.gender");P.birthday=J.Facade.proxy("traits.birthday");var be={},Dt=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(be,"__esModule",{value:!0});be.Track=void 0;var pi=Dt(se),D=G,yi=Ie,gi=Dt(ge),Pr=Dt(Le);function Ft(e,t){D.Facade.call(this,e,t)}be.Track=Ft;pi.default(Ft,D.Facade);var _=Ft.prototype;_.action=function(){return"track"};_.type=_.action;_.event=D.Facade.field("event");_.value=D.Facade.proxy("properties.value");_.category=D.Facade.proxy("properties.category");_.id=D.Facade.proxy("properties.id");_.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")};_.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")};_.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")};_.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")};_.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")};_.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")};_.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")};_.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")};_.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")};_.sku=D.Facade.proxy("properties.sku");_.tax=D.Facade.proxy("properties.tax");_.name=D.Facade.proxy("properties.name");_.price=D.Facade.proxy("properties.price");_.total=D.Facade.proxy("properties.total");_.repeat=D.Facade.proxy("properties.repeat");_.coupon=D.Facade.proxy("properties.coupon");_.shipping=D.Facade.proxy("properties.shipping");_.discount=D.Facade.proxy("properties.discount");_.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")};_.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")};_.description=D.Facade.proxy("properties.description");_.plan=D.Facade.proxy("properties.plan");_.subtotal=function(){var e=Pr.default(this.properties(),"subtotal"),t=this.total()||this.revenue();if(e)return e;if(!t)return 0;if(this.total()){var r=this.tax();r&&(t-=r),r=this.shipping(),r&&(t-=r),r=this.discount(),r&&(t+=r)}return t};_.products=function(){var e=this.properties(),t=Pr.default(e,"products");return Array.isArray(t)?t.filter(function(r){return r!==null}):[]};_.quantity=function(){var e=this.obj.properties||{};return e.quantity||1};_.currency=function(){var e=this.obj.properties||{};return e.currency||"USD"};_.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};_.query=D.Facade.proxy("options.query");_.properties=function(e){var t=this.field("properties")||{};e=e||{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=this[r]==null?this.proxy("properties."+r):this[r]();if(n==null)continue;t[e[r]]=n,delete t[r]}return t};_.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()};_.email=function(){var e=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(e)return e;var t=this.userId();if(gi.default(t))return t};_.revenue=function(){var e=this.proxy("properties.revenue"),t=this.event(),r=/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;return!e&&t&&t.match(r)&&(e=this.proxy("properties.total")),mi(e)};_.cents=function(){var e=this.revenue();return typeof e!="number"?this.value()||0:e*100};_.identify=function(){var e=this.json();return e.traits=this.traits(),new yi.Identify(e,this.opts)};function mi(e){if(e){if(typeof e=="number")return e;if(typeof e=="string"&&(e=e.replace(/\$/g,""),e=parseFloat(e),!isNaN(e)))return e}}var Oe={},Ar=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.Page=void 0;var bi=Ar(se),ce=G,_i=be,wi=Ar(ge);function Tt(e,t){ce.Facade.call(this,e,t)}Oe.Page=Tt;bi.default(Tt,ce.Facade);var R=Tt.prototype;R.action=function(){return"page"};R.type=R.action;R.category=ce.Facade.field("category");R.name=ce.Facade.field("name");R.title=ce.Facade.proxy("properties.title");R.path=ce.Facade.proxy("properties.path");R.url=ce.Facade.proxy("properties.url");R.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};R.properties=function(e){var t=this.field("properties")||{},r=this.category(),n=this.name();e=e||{},r&&(t.category=r),n&&(t.name=n);for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=this[i]==null?this.proxy("properties."+i):this[i]();if(o==null)continue;t[e[i]]=o,i!==e[i]&&delete t[i]}return t};R.email=function(){var e=this.proxy("context.traits.email")||this.proxy("properties.email");if(e)return e;var t=this.userId();if(wi.default(t))return t};R.fullName=function(){var e=this.category(),t=this.name();return t&&e?e+" "+t:t};R.event=function(e){return e?"Viewed "+e+" Page":"Loaded a Page"};R.track=function(e){var t=this.json();return t.event=this.event(e),t.timestamp=this.timestamp(),t.properties=this.properties(),new _i.Track(t,this.opts)};var Be={},Si=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Be,"__esModule",{value:!0});Be.Screen=void 0;var Ei=Si(se),xr=Oe,Ii=be;function ue(e,t){xr.Page.call(this,e,t)}Be.Screen=ue;Ei.default(ue,xr.Page);ue.prototype.action=function(){return"screen"};ue.prototype.type=ue.prototype.action;ue.prototype.event=function(e){return e?"Viewed "+e+" Screen":"Loaded a Screen"};ue.prototype.track=function(e){var t=this.json();return t.event=this.event(e),t.timestamp=this.timestamp(),t.properties=this.properties(),new Ii.Track(t,this.opts)};var Ke={},Oi=M&&M.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Delete=void 0;var Pi=Oi(se),Mr=G;function jt(e,t){Mr.Facade.call(this,e,t)}Ke.Delete=jt;Pi.default(jt,Mr.Facade);jt.prototype.type=function(){return"delete"};(function(e){var t=M&&M.__assign||function(){return t=Object.assign||function(l){for(var f,p=1,h=arguments.length;p<h;p++){f=arguments[p];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(l[v]=f[v])}return l},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Delete=e.Screen=e.Page=e.Track=e.Identify=e.Group=e.Alias=e.Facade=void 0;var r=G;Object.defineProperty(e,"Facade",{enumerable:!0,get:function(){return r.Facade}});var n=Ue;Object.defineProperty(e,"Alias",{enumerable:!0,get:function(){return n.Alias}});var i=$e;Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return i.Group}});var o=Ie;Object.defineProperty(e,"Identify",{enumerable:!0,get:function(){return o.Identify}});var a=be;Object.defineProperty(e,"Track",{enumerable:!0,get:function(){return a.Track}});var u=Oe;Object.defineProperty(e,"Page",{enumerable:!0,get:function(){return u.Page}});var s=Be;Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return s.Screen}});var c=Ke;Object.defineProperty(e,"Delete",{enumerable:!0,get:function(){return c.Delete}}),e.default=t(t({},r.Facade),{Alias:n.Alias,Group:i.Group,Identify:o.Identify,Track:a.Track,Page:u.Page,Screen:s.Screen,Delete:c.Delete})})(X);function Fe(e,t){var r=new X.Facade(e,t);return e.type==="track"&&(r=new X.Track(e,t)),e.type==="identify"&&(r=new X.Identify(e,t)),e.type==="page"&&(r=new X.Page(e,t)),e.type==="alias"&&(r=new X.Alias(e,t)),e.type==="group"&&(r=new X.Group(e,t)),e.type==="screen"&&(r=new X.Screen(e,t)),Object.defineProperty(r,"obj",{value:e,writable:!0}),r}var Ai=function(e){var t=!1;window.addEventListener("pagehide",function(){t||(t=!0,e(t))}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(t)return;t=!0}else t=!1;e(t)})},Cr=function(e){L(t,e);function t(r,n){var i=e.call(this,r)||this;return i.retryTimeout=n,i.name="RateLimitError",i}return t}(Error),kr=function(e){return d({"Content-Type":"text/plain"},typeof e=="function"?e():e)},xi=500,Mi=64;function Rt(e){var t=encodeURI(JSON.stringify(e)).split(/%..|./).length-1;return t/1024}function Ci(e){return Rt(e)>=xi-50}function ki(e){return Rt(e)>=Mi-10}function Di(e){var t=[],r=0;return e.forEach(function(n){var i=Rt(t[r]);i>=64&&r++,t[r]?t[r].push(n):t[r]=[n]}),t}function Fi(e,t){var r,n,i=[],o=!1,a=(r=t==null?void 0:t.size)!==null&&r!==void 0?r:10,u=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:5e3,s=0;function c(v){var m;if(v.length!==0){var S=(m=v[0])===null||m===void 0?void 0:m.writeKey,w=v.map(function(b){var E=b;E.sentAt;var A=Yt(E,["sentAt"]);return A});return Te("https://".concat(e,"/b"),{credentials:t==null?void 0:t.credentials,keepalive:(t==null?void 0:t.keepalive)||o,headers:kr(t==null?void 0:t.headers),method:"post",body:JSON.stringify({writeKey:S,batch:w,sentAt:new Date().toISOString()}),priority:t==null?void 0:t.priority}).then(function(b){var E;if(b.status>=500)throw new Error("Bad response from server: ".concat(b.status));if(b.status===429){var A=(E=b.headers)===null||E===void 0?void 0:E.get("x-ratelimit-reset"),I=typeof A=="string"?parseInt(A)*1e3:u;throw new Cr("Rate limit exceeded: ".concat(b.status),I)}})}}function l(v){var m;return v===void 0&&(v=1),y(this,void 0,void 0,function(){var S;return g(this,function(w){return i.length?(S=i,i=[],[2,(m=c(S))===null||m===void 0?void 0:m.catch(function(b){var E,A=K.system();A.log("error","Error sending batch",b),v<=((E=t==null?void 0:t.maxRetries)!==null&&E!==void 0?E:10)&&(b.name==="RateLimitError"&&(s=b.retryTimeout),i.push.apply(i,S),i.map(function(I){if("_metadata"in I){var x=I;x._metadata=d(d({},x._metadata),{retryCount:v})}}),p(v+1))})]):[2]})})}var f;function p(v){v===void 0&&(v=1),!f&&(f=setTimeout(function(){f=void 0,l(v).catch(console.error)},s||u),s=0)}Ai(function(v){if(o=v,o&&i.length){var m=Di(i).map(c);Promise.all(m).catch(console.error)}});function h(v,m){return y(this,void 0,void 0,function(){var S;return g(this,function(w){return i.push(m),S=i.length>=a||Ci(i)||(t==null?void 0:t.keepalive)&&ki(i),[2,S||o?l():p()]})})}return{dispatch:h}}function Ti(e){function t(r,n){return Te(r,{credentials:e==null?void 0:e.credentials,keepalive:e==null?void 0:e.keepalive,headers:kr(e==null?void 0:e.headers),method:"post",body:JSON.stringify(n),priority:e==null?void 0:e.priority}).then(function(i){var o;if(i.status>=500)throw new Error("Bad response from server: ".concat(i.status));if(i.status===429){var a=(o=i.headers)===null||o===void 0?void 0:o.get("x-ratelimit-reset"),u=a?parseInt(a)*1e3:5e3;throw new Cr("Rate limit exceeded: ".concat(i.status),u)}})}return{dispatch:t}}function ji(e,t,r,n,i){var o,a=e.user();delete t.options,t.writeKey=r==null?void 0:r.apiKey,t.userId=t.userId||a.id(),t.anonymousId=t.anonymousId||a.anonymousId(),t.sentAt=new Date;var u=e.queue.failedInitializations||[];u.length>0&&(t._metadata={failedInitializations:u}),i!=null&&(i.attempts>1&&(t._metadata=d(d({},t._metadata),{retryCount:i.attempts})),i.attempts++);var s=[],c=[];for(var l in n){var f=n[l];l==="Segment.io"&&s.push(l),f.bundlingStatus==="bundled"&&s.push(l),f.bundlingStatus==="unbundled"&&c.push(l)}for(var p=0,h=(r==null?void 0:r.unbundledIntegrations)||[];p<h.length;p++){var v=h[p];c.includes(v)||c.push(v)}var m=(o=r==null?void 0:r.maybeBundledConfigIds)!==null&&o!==void 0?o:{},S=[];return s.sort().forEach(function(w){var b;((b=m[w])!==null&&b!==void 0?b:[]).forEach(function(E){S.push(E)})}),(r==null?void 0:r.addBundledMetadata)!==!1&&(t._metadata=d(d({},t._metadata),{bundled:s.sort(),unbundled:c.sort(),bundledIds:S})),t}var Ri=function(e,t){return y(void 0,void 0,void 0,function(){var r;return g(this,function(n){return r=function(i){return y(void 0,void 0,void 0,function(){var o;return g(this,function(a){switch(a.label){case 0:return e(i)?(o=r,[4,t()]):[3,2];case 1:return[2,o.apply(void 0,[a.sent()])];case 2:return[2]}})})},[2,r(void 0)]})})};function Li(e,t){return y(this,void 0,void 0,function(){var r,n=this;return g(this,function(i){switch(i.label){case 0:return r=[],Se()?[2,t]:[4,Ri(function(){return t.length>0&&!Se()},function(){return y(n,void 0,void 0,function(){var o,a,u;return g(this,function(s){switch(s.label){case 0:return o=t.pop(),o?[4,we(o,e)]:[2];case 1:return a=s.sent(),u=a instanceof K,u||r.push(o),[2]}})})})];case 1:return i.sent(),r.map(function(o){return t.pushWithBackoff(o)}),[2,t]}})})}function ve(e,t,r,n){var i=this;e||setTimeout(function(){return y(i,void 0,void 0,function(){var o,a;return g(this,function(u){switch(u.label){case 0:return o=!0,[4,Li(r,t)];case 1:return a=u.sent(),o=!1,t.todo>0&&n(o,a,r,n),[2]}})})},Math.random()*5e3)}function Ni(e,t){var r,n,i,o,a=e.user();return t.previousId=(i=(n=(r=t.previousId)!==null&&r!==void 0?r:t.from)!==null&&n!==void 0?n:a.id())!==null&&i!==void 0?i:a.anonymousId(),t.userId=(o=t.userId)!==null&&o!==void 0?o:t.to,delete t.from,delete t.to,t}var qi=function(e){return e.name==="Segment.io"};function Dr(e,t,r){var n,i,o;window.addEventListener("pagehide",function(){u.push.apply(u,Array.from(s)),s.clear()});var a=(n=t==null?void 0:t.apiKey)!==null&&n!==void 0?n:"",u=e.options.disableClientPersistence?new vt(e.queue.queue.maxAttempts,[]):new gt(e.queue.queue.maxAttempts,"".concat(a,":dest-Segment.io")),s=new Set,c=!1,l=(i=t==null?void 0:t.apiHost)!==null&&i!==void 0?i:ir,f=(o=t==null?void 0:t.protocol)!==null&&o!==void 0?o:"https",p="".concat(f,"://").concat(l),h=t==null?void 0:t.deliveryStrategy,v=h&&"strategy"in h&&h.strategy==="batching"?Fi(l,h.config):Ti(h==null?void 0:h.config);function m(w){return y(this,void 0,void 0,function(){var b,E;return g(this,function(A){return Se()?(u.push(w),ve(c,u,S,ve),[2,w]):(s.add(w),b=w.event.type.charAt(0),E=Fe(w.event).json(),w.event.type==="track"&&delete E.traits,w.event.type==="alias"&&(E=Ni(e,E)),[2,v.dispatch("".concat(p,"/").concat(b),ji(e,E,t,r,w)).then(function(){return w}).catch(function(I){if(w.log("error","Error sending event",I),I.name==="RateLimitError"){var x=I.retryTimeout;u.pushWithBackoff(w,x)}else u.pushWithBackoff(w);return ve(c,u,S,ve),w}).finally(function(){s.delete(w)})])})})}var S={metadata:{writeKey:a,apiHost:l,protocol:f},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:m,identify:m,page:m,alias:m,group:m,screen:m};return u.todo&&ve(c,u,S,ve),S}var Y="This is being deprecated and will be not be available in future releases of Analytics JS",Je=yt(),We=Je==null?void 0:Je.analytics;function Ui(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=t?10:1,i=r?new vt(n,[]):new gt(n,e);return new Pn(i)}var $i=function(){function e(t,r){var n;this.timeout=300,this._getSegmentPluginMetadata=function(){var o;return(o=r.plugins.find(qi))===null||o===void 0?void 0:o.metadata},this.writeKey=t.writeKey;var i={integrations:{"Segment.io":{apiKey:""}}};this.cdnSettings=(n=t.cdnSettings)!==null&&n!==void 0?n:i,this.cdnURL=t.cdnURL}return Object.defineProperty(e.prototype,"apiHost",{get:function(){var t,r;return(r=(t=this._getSegmentPluginMetadata)===null||t===void 0?void 0:t.call(this))===null||r===void 0?void 0:r.apiHost},enumerable:!1,configurable:!0}),e}();function B(){console.warn(Y)}var Lt=function(e){L(t,e);function t(r,n,i,o,a){var u=this,s,c;u=e.call(this)||this,u._debug=!1,u.initialized=!1,u.user=function(){return u._user},u.init=u.initialize.bind(u),u.log=B,u.addIntegrationMiddleware=B,u.listeners=B,u.addEventListener=B,u.removeAllListeners=B,u.removeListener=B,u.removeEventListener=B,u.hasListeners=B,u.add=B,u.addIntegration=B;var l=n==null?void 0:n.cookie,f=(s=n==null?void 0:n.disableClientPersistence)!==null&&s!==void 0?s:!1;u.queue=i??Ui("".concat(r.writeKey,":event-queue"),n==null?void 0:n.retryQueue,f),u.settings=new $i(r,u.queue);var p=n==null?void 0:n.storage;return u._universalStorage=u.createStore(f,p,l),u._user=o??new _t(d({persist:!f,storage:n==null?void 0:n.storage},n==null?void 0:n.user),l).load(),u._group=a??new mr(d({persist:!f,storage:n==null?void 0:n.storage},n==null?void 0:n.group),l).load(),u.eventFactory=new lr(u._user),u.integrations=(c=n==null?void 0:n.integrations)!==null&&c!==void 0?c:{},u.options=n??{},mt(u),u}return t.prototype.createStore=function(r,n,i){return r?new Z([new bt]):n&&yr(n)?new Z(it(gr(n.stores,i))):new Z(it([j.LocalStorage,{name:j.Cookie,settings:i},j.Memory]))},Object.defineProperty(t.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),t.prototype.track=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,f=this;return g(this,function(p){return i=fe(r),o=rr.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=this.eventFactory.track(a,u,s,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return f.emit("track",a,h.event.properties,h.event.options),h})]})})},t.prototype.page=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,f,p=this;return g(this,function(h){return i=fe(r),o=et.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=o[4],f=this.eventFactory.page(a,u,s,c,this.integrations,i),[2,this._dispatch(f,l).then(function(v){return p.emit("page",a,u,v.event.properties,v.event.options),v})]})})},t.prototype.identify=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,f=this;return g(this,function(p){return i=fe(r),o=tt(this._user).apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],this._user.identify(a,u),l=this.eventFactory.identify(this._user.id(),this._user.traits(),s,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return f.emit("identify",h.event.userId,h.event.traits,h.event.options),h})]})})},t.prototype.group=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=fe(n);if(n.length===0)return this._group;var a=tt(this._group).apply(void 0,n),u=a[0],s=a[1],c=a[2],l=a[3];this._group.identify(u,s);var f=this._group.id(),p=this._group.traits(),h=this.eventFactory.group(f,p,c,this.integrations,o);return this._dispatch(h,l).then(function(v){return r.emit("group",v.event.groupId,v.event.traits,v.event.options),v})},t.prototype.alias=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,f=this;return g(this,function(p){return i=fe(r),o=nr.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=this.eventFactory.alias(a,u,s,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return f.emit("alias",a,u,h.event.options),h})]})})},t.prototype.screen=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,f,p=this;return g(this,function(h){return i=fe(r),o=et.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=o[4],f=this.eventFactory.screen(a,u,s,c,this.integrations,i),[2,this._dispatch(f,l).then(function(v){return p.emit("screen",a,u,v.event.properties,v.event.options),v})]})})},t.prototype.trackClick=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-CESKe-vL.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,C([this],r,!1))]}})})},t.prototype.trackLink=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-CESKe-vL.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,C([this],r,!1))]}})})},t.prototype.trackSubmit=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-CESKe-vL.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,C([this],r,!1))]}})})},t.prototype.trackForm=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-CESKe-vL.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,C([this],r,!1))]}})})},t.prototype.register=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a=this;return g(this,function(u){switch(u.label){case 0:return i=K.system(),o=r.map(function(s){return a.queue.register(i,s,a)}),[4,Promise.all(o)];case 1:return u.sent(),[2,i]}})})},t.prototype.deregister=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a=this;return g(this,function(u){switch(u.label){case 0:return i=K.system(),o=r.map(function(s){var c=a.queue.plugins.find(function(l){return l.name===s});if(c)return a.queue.deregister(i,c,a);i.log("warn","plugin ".concat(s," not found"))}),[4,Promise.all(o)];case 1:return u.sent(),[2,i]}})})},t.prototype.debug=function(r){return r===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=r,this},t.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},t.prototype.timeout=function(r){this.settings.timeout=r},t.prototype._dispatch=function(r,n){return y(this,void 0,void 0,function(){var i;return g(this,function(o){return i=new K(r),i.stats.increment("analytics_js.invoke",1,[r.type]),Se()&&!this.options.retryQueue?[2,i]:[2,fn(i,this.queue,this,{callback:n,debug:this._debug,timeout:this.settings.timeout})]})})},t.prototype.addSourceMiddleware=function(r){return y(this,void 0,void 0,function(){var n=this;return g(this,function(i){switch(i.label){case 0:return[4,this.queue.criticalTasks.run(function(){return y(n,void 0,void 0,function(){var o,a,u;return g(this,function(s){switch(s.label){case 0:return[4,U(()=>Promise.resolve().then(()=>io),void 0)];case 1:return o=s.sent().sourceMiddlewarePlugin,a={},this.queue.plugins.forEach(function(c){if(c.type==="destination")return a[c.name]=!0}),u=o(r,a),[4,this.register(u)];case 2:return s.sent(),[2]}})})})];case 1:return i.sent(),[2,this]}})})},t.prototype.addDestinationMiddleware=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return this.queue.plugins.filter(fr).forEach(function(o){(r==="*"||o.name.toLowerCase()===r.toLowerCase())&&o.addMiddleware.apply(o,n)}),Promise.resolve(this)},t.prototype.setAnonymousId=function(r){return this._user.anonymousId(r)},t.prototype.queryString=function(r){return y(this,void 0,void 0,function(){var n;return g(this,function(i){switch(i.label){case 0:return this.options.useQueryString===!1?[2,[]]:[4,U(()=>import("./index-BcyYnbGB.js"),__vite__mapDeps([2,1]))];case 1:return n=i.sent().queryString,[2,n(this,r)]}})})},t.prototype.use=function(r){return r(this),this},t.prototype.ready=function(r){return r===void 0&&(r=function(n){return n}),y(this,void 0,void 0,function(){return g(this,function(n){return[2,Promise.all(this.queue.plugins.map(function(i){return i.ready?i.ready():Promise.resolve()})).then(function(i){return r(i),i})]})})},t.prototype.noConflict=function(){return console.warn(Y),Tn(We??this),this},t.prototype.normalize=function(r){return console.warn(Y),this.eventFactory.normalize(r)},Object.defineProperty(t.prototype,"failedInitializations",{get:function(){return console.warn(Y),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VERSION",{get:function(){return je},enumerable:!1,configurable:!0}),t.prototype.initialize=function(r,n){return y(this,void 0,void 0,function(){return g(this,function(i){return console.warn(Y),[2,Promise.resolve(this)]})})},t.prototype.pageview=function(r){return y(this,void 0,void 0,function(){return g(this,function(n){switch(n.label){case 0:return console.warn(Y),[4,this.page({path:r})];case 1:return n.sent(),[2,this]}})})},Object.defineProperty(t.prototype,"plugins",{get:function(){var r;return console.warn(Y),(r=this._plugins)!==null&&r!==void 0?r:{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Integrations",{get:function(){console.warn(Y);var r=this.queue.plugins.filter(function(n){return n.type==="destination"}).reduce(function(n,i){var o="".concat(i.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),a=window[o];if(!a)return n;var u=a.Integration;return u?(n[i.name]=u,n):(n[i.name]=a,n)},{});return r},enumerable:!1,configurable:!0}),t.prototype.push=function(r){var n=this,i=r.shift();i&&!n[i]||n[i].apply(this,r)},t}(dt),Wt=function(e){L(t,e);function t(){var r=e.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return r.initialized=!0,r}return t}(Lt),Qt={VITE_SEGMENT_DEV_API_KEY:"UJLmm39XefLTcE55pRdWiwBT1JoTs6OI",VITE_SEGMENT_PRD_API_KEY:"uMHQo9dBTi626Bv11I3RxcH3Jui8lKMm"};function Fr(){return typeof process>"u"||!Qt?{}:Qt}var zi=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,Bi=function(){var e,t=Array.prototype.slice.call(document.querySelectorAll("script"));return t.forEach(function(r){var n,i=(n=r.getAttribute("src"))!==null&&n!==void 0?n:"",o=zi.exec(i);o&&o[1]&&(e=o[1])}),e},ke,Ki=function(){var e,t=ke??((e=St())===null||e===void 0?void 0:e._cdn);return t},Vi=function(e){var t=St();t&&(t._cdn=e),ke=e},Nt=function(){var e=Ki();if(e)return e;var t=Bi();return t||"https://cdn.segment.com"},Oo=function(){var e=Nt();return"".concat(e,"/next-integrations")};function Gi(e,t){var r,n=Object.entries((r=t.integrations)!==null&&r!==void 0?r:{}).reduce(function(i,o){var a,u,s=o[0],c=o[1];return typeof c=="object"?d(d({},i),(a={},a[s]=c,a)):d(d({},i),(u={},u[s]={},u))},{});return Object.entries(e.integrations).reduce(function(i,o){var a,u=o[0],s=o[1];return d(d({},i),(a={},a[u]=d(d({},s),n[u]),a))},{})}function Ji(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Wi(e){return y(this,void 0,void 0,function(){var t;return g(this,function(r){return t=navigator.userAgentData,t?e?[2,t.getHighEntropyValues(e).catch(function(){return t.toJSON()})]:[2,t.toJSON()]:[2,void 0]})})}var _e;function Qi(){if(_e)return _e;var e=hr(window.location.href);return _e={expires:31536e6,secure:!1,path:"/"},e&&(_e.domain=e),_e}function Hi(e){var t={btid:"dataxu",urid:"millennial-media"};e.startsWith("?")&&(e=e.substring(1)),e=e.replace(/\?/g,"&");for(var r=e.split("&"),n=0,i=r;n<i.length;n++){var o=i[n],a=o.split("="),u=a[0],s=a[1];if(t[u])return{id:s,type:t[u]}}}function Xi(e){return e.startsWith("?")&&(e=e.substring(1)),e=e.replace(/\?/g,"&"),e.split("&").reduce(function(t,r){var n=r.split("="),i=n[0],o=n[1],a=o===void 0?"":o;if(i.includes("utm_")&&i.length>4){var u=i.slice(4);u==="campaign"&&(u="name"),t[u]=Ji(a)}return t},{})}function Yi(){var e=W.get("_ga");if(e&&e.startsWith("amp"))return e}function Zi(e,t,r){var n,i=new Z(r?[]:[new pr(Qi())]),o=i.get("s:context.referrer"),a=(n=Hi(e))!==null&&n!==void 0?n:o;a&&(t&&(t.referrer=d(d({},t.referrer),a)),i.set("s:context.referrer",a))}var eo=function(e){try{var t=new URLSearchParams;return Object.entries(e).forEach(function(r){var n=r[0],i=r[1];Array.isArray(i)?i.forEach(function(o){return t.append(n,o)}):t.append(n,i)}),t.toString()}catch{return""}},to=function(){function e(){var t=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(r,n){return y(t,void 0,void 0,function(){var i;return g(this,function(o){switch(o.label){case 0:this.instance=n,o.label=1;case 1:return o.trys.push([1,3,,4]),i=this,[4,Wi(this.instance.options.highEntropyValuesClientHints)];case 2:return i.userAgentData=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(r){var n,i,o=r.event.context,a=o.page.search||"",u=typeof a=="object"?eo(a):a;o.userAgent=navigator.userAgent,o.userAgentData=t.userAgentData;var s=navigator.userLanguage||navigator.language;typeof o.locale>"u"&&typeof s<"u"&&(o.locale=s),(n=o.library)!==null&&n!==void 0||(o.library={name:"analytics.js",version:"".concat("npm:next","-").concat(je)}),u&&!o.campaign&&(o.campaign=Xi(u));var c=Yi();c&&(o.amp={id:c}),Zi(u,o,(i=t.instance.options.disableClientPersistence)!==null&&i!==void 0?i:!1);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}return r},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}return e}(),ro=new to;function Tr(e){var t=Array.prototype.slice.call(window.document.querySelectorAll("script"));return t.find(function(r){return r.src===e})}function Qe(e,t){var r=Tr(e);if(r!==void 0){var n=r==null?void 0:r.getAttribute("status");if(n==="loaded")return Promise.resolve(r);if(n==="loading")return new Promise(function(i,o){r.addEventListener("load",function(){return i(r)}),r.addEventListener("error",function(a){return o(a)})})}return new Promise(function(i,o){var a,u=window.document.createElement("script");u.type="text/javascript",u.src=e,u.async=!0,u.setAttribute("status","loading");for(var s=0,c=Object.entries({});s<c.length;s++){var l=c[s],f=l[0],p=l[1];u.setAttribute(f,p)}u.onload=function(){u.onerror=u.onload=null,u.setAttribute("status","loaded"),i(u)},u.onerror=function(){u.onerror=u.onload=null,u.setAttribute("status","error"),o(new Error("Failed to load ".concat(e)))};var h=window.document.querySelector("script");h?(a=h.parentElement)===null||a===void 0||a.insertBefore(u,h):window.document.head.appendChild(u)})}function Po(e){var t=Tr(e);return t!==void 0&&t.remove(),Promise.resolve()}function jr(e,t,r){return y(this,void 0,void 0,function(){function n(c,l){return y(this,void 0,void 0,function(){var f,p,h;return g(this,function(v){switch(v.label){case 0:return f=!1,p=null,[4,l({payload:Fe(c,{clone:!0,traverse:!1}),integration:e,next:function(m){f=!0,m===null&&(p=null),m&&(p=m.obj)}})];case 1:return v.sent(),!f&&p!==null&&(p=p,p.integrations=d(d({},c.integrations),(h={},h[e]=!1,h))),[2,p]}})})}var i,o,a,u,s;return g(this,function(c){switch(c.label){case 0:i=Fe(t,{clone:!0,traverse:!1}).rawEvent(),o=0,a=r,c.label=1;case 1:return o<a.length?(u=a[o],[4,n(i,u)]):[3,4];case 2:if(s=c.sent(),s===null)return[2,null];i=s,c.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})}function no(e,t){function r(n){return y(this,void 0,void 0,function(){var i;return g(this,function(o){switch(o.label){case 0:return i=!1,[4,e({payload:Fe(n.event,{clone:!0,traverse:!1}),integrations:t??{},next:function(a){i=!0,a&&(n.event=a.obj)}})];case 1:if(o.sent(),!i)throw new ae({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(e.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(n){return Promise.resolve(n)},track:r,page:r,screen:r,identify:r,alias:r,group:r}}const io=Object.freeze(Object.defineProperty({__proto__:null,applyDestinationMiddleware:jr,sourceMiddlewarePlugin:no},Symbol.toStringTag,{value:"Module"}));function Me(e,t){var r=t.methodName,n=t.integrationName,i=t.type,o=t.didError,a=o===void 0?!1:o;e.stats.increment("analytics_js.integration.invoke".concat(a?".error":""),1,["method:".concat(r),"integration_name:".concat(n),"type:".concat(i)])}var oo=function(){function e(t,r){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=Zt(),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=r,this.name=t,this.type=r.type,this.alternativeNames.push(r.name)}return e.prototype.addMiddleware=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];this.type==="destination"&&(t=this.middleware).push.apply(t,r)},e.prototype.transform=function(t){return y(this,void 0,void 0,function(){var r;return g(this,function(n){switch(n.label){case 0:return[4,jr(this.name,t.event,this.middleware)];case 1:return r=n.sent(),r===null&&t.cancel(new ae({retry:!1,reason:"dropped by destination middleware"})),[2,new K(r)]}})})},e.prototype._createMethod=function(t){var r=this;return function(n){return y(r,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return this.action[t]?(i=n,this.type!=="destination"?[3,2]:[4,this.transform(n)]):[2,n];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!a.sent())throw new Error("Something prevented the destination from getting ready");return Me(n,{integrationName:this.action.name,methodName:t,type:"action"}),[4,this.action[t](i)];case 4:return a.sent(),[3,6];case 5:throw o=a.sent(),Me(n,{integrationName:this.action.name,methodName:t,type:"action",didError:!0}),o;case 6:return[2,n]}})})}},e.prototype.isLoaded=function(){return this.action.isLoaded()},e.prototype.ready=function(){return y(this,void 0,void 0,function(){return g(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.loadPromise.promise];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}})})},e.prototype.load=function(t,r){return y(this,void 0,void 0,function(){var n,i,o,a;return g(this,function(u){switch(u.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];u.label=1;case 1:return u.trys.push([1,3,,4]),Me(t,{integrationName:this.action.name,methodName:"load",type:"action"}),n=this.action.load(t,r),o=(i=this.loadPromise).resolve,[4,n];case 2:return o.apply(i,[u.sent()]),[2,n];case 3:throw a=u.sent(),Me(t,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(a),a;case 4:return[2]}})})},e.prototype.unload=function(t,r){var n,i;return(i=(n=this.action).unload)===null||i===void 0?void 0:i.call(n,t,r)},e}();function ao(e){if(!Array.isArray(e))throw new Error("Not a valid list of plugins");var t=["load","isLoaded","name","version","type"];return e.forEach(function(r){t.forEach(function(n){var i;if(r[n]===void 0)throw new Error("Plugin: ".concat((i=r.name)!==null&&i!==void 0?i:"unknown"," missing required function ").concat(n))})}),!0}function uo(e,t){var r=e[t.creationName],n=e[t.name];return e.All===!1&&!r&&!n||r===!1||n===!1}function so(e,t){return y(this,void 0,void 0,function(){var r,n,i,o,a,u;return g(this,function(s){switch(s.label){case 0:if(s.trys.push([0,9,,10]),r=new RegExp("https://cdn.segment.(com|build)"),n=Nt(),!t)return[3,6];i=e.url.split("/"),o=i[i.length-2],a=e.url.replace(o,btoa(o).replace(/=/g,"")),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Qe(a.replace(r,n))];case 2:return s.sent(),[3,5];case 3:return s.sent(),[4,Qe(e.url.replace(r,n))];case 4:return s.sent(),[3,5];case 5:return[3,8];case 6:return[4,Qe(e.url.replace(r,n))];case 7:s.sent(),s.label=8;case 8:return typeof window[e.libraryName]=="function"?[2,window[e.libraryName]]:[3,10];case 9:throw u=s.sent(),console.error("Failed to create PluginFactory",e),u;case 10:return[2]}})})}function co(e,t,r,n,i,o){var a,u,s;return y(this,void 0,void 0,function(){var c,l,f,p=this;return g(this,function(h){switch(h.label){case 0:return c=[],l=(u=(a=e.middlewareSettings)===null||a===void 0?void 0:a.routingRules)!==null&&u!==void 0?u:[],f=((s=e.remotePlugins)!==null&&s!==void 0?s:[]).map(function(v){return y(p,void 0,void 0,function(){var m,S,w,b,E,A,I;return g(this,function(x){switch(x.label){case 0:if(uo(t,v))return[2];x.label=1;case 1:return x.trys.push([1,6,,7]),S=o==null?void 0:o.find(function(k){var Q=k.pluginName;return Q===v.name}),S?[3,3]:[4,so(v,n==null?void 0:n.obfuscate)];case 2:S=x.sent(),x.label=3;case 3:return m=S,m?(w=r[v.name],[4,m(d(d({},v.settings),w))]):[3,5];case 4:b=x.sent(),E=Array.isArray(b)?b:[b],ao(E),A=l.filter(function(k){return k.destinationName===v.creationName}),E.forEach(function(k){var Q=new oo(v.creationName,k);A.length&&i&&Q.addMiddleware(i),c.push(Q)}),x.label=5;case 5:return[3,7];case 6:return I=x.sent(),console.warn("Failed to load Remote Plugin",I),[3,7];case 7:return[2]}})})}),[4,Promise.all(f)];case 1:return h.sent(),[2,c.filter(Boolean)]}})})}var He,Ht,lo=yt(),Xt=(He=(Ht=lo).__SEGMENT_INSPECTOR__)!==null&&He!==void 0?He:Ht.__SEGMENT_INSPECTOR__={},fo=function(e){var t;return(t=Xt.attach)===null||t===void 0?void 0:t.call(Xt,e)};function vo(e,t){return Te("".concat(t,"/v1/projects/").concat(e,"/settings")).then(function(r){return r.ok?r.json():r.text().then(function(n){throw new Error(n)})}).catch(function(r){throw console.error(r.message),r})}function ho(e){return Fr().NODE_ENV!=="test"&&Object.keys(e.integrations).length>1}function po(e){var t,r,n;return Fr().NODE_ENV!=="test"&&((n=(r=(t=e.middlewareSettings)===null||t===void 0?void 0:t.routingRules)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0)>0}function yo(e,t){qn(e,t),Nn(e,t)}function go(e,t,r){return y(this,void 0,void 0,function(){return g(this,function(n){switch(n.label){case 0:return[4,bo(e,t)];case 1:return n.sent(),Un(e,r),[2]}})})}var mo=function(){var e,t,r=(e=window.location.hash)!==null&&e!==void 0?e:"",n=(t=window.location.search)!==null&&t!==void 0?t:"",i=n.length?n:r.replace(/(?=#).*(?=\?)/,"");return i},bo=function(e,t){return y(void 0,void 0,void 0,function(){return g(this,function(r){switch(r.label){case 0:return t.includes("ajs_")?[4,e.queryString(t).catch(console.error)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})};function _o(e,t,r,n,i,o,a){var u,s,c;return i===void 0&&(i=[]),y(this,void 0,void 0,function(){var l,f,p,h,v,m,S,w,b,E,A,I,x,k,Q,Rr=this;return g(this,function(F){switch(F.label){case 0:return yo(r,a),l=i==null?void 0:i.filter(function(T){return typeof T=="object"}),f=i==null?void 0:i.filter(function(T){return typeof T=="function"&&typeof T.pluginName=="string"}),po(t)?[4,U(()=>import("./index-D6ZMQedT.js"),[]).then(function(T){return T.tsubMiddleware(t.middlewareSettings.routingRules)})]:[3,2];case 1:return h=F.sent(),[3,3];case 2:h=void 0,F.label=3;case 3:return p=h,ho(t)||o.length>0?[4,U(()=>import("./index-DGSVm7Cr.js"),__vite__mapDeps([3,4,1])).then(function(T){return T.ajsDestinations(e,t,r.integrations,n,p,o)})]:[3,5];case 4:return m=F.sent(),[3,6];case 5:m=[],F.label=6;case 6:return v=m,t.legacyVideoPluginsEnabled?[4,U(()=>import("./index-BiLuWLjK.js"),__vite__mapDeps([5,1])).then(function(T){return T.loadLegacyVideoPlugins(r)})]:[3,8];case 7:F.sent(),F.label=8;case 8:return!((u=n.plan)===null||u===void 0)&&u.track?[4,U(()=>import("./index-D76Uxjzx.js"),__vite__mapDeps([6,4,1])).then(function(T){var te;return T.schemaFilter((te=n.plan)===null||te===void 0?void 0:te.track,t)})]:[3,10];case 9:return w=F.sent(),[3,11];case 10:w=void 0,F.label=11;case 11:return S=w,b=Gi(t,n),[4,co(t,r.integrations,b,n,p,f).catch(function(){return[]})];case 12:return E=F.sent(),A=C(C([ro],v,!0),E,!0),S&&A.push(S),I=((s=n.integrations)===null||s===void 0?void 0:s.All)===!1&&!n.integrations["Segment.io"]||n.integrations&&n.integrations["Segment.io"]===!1,I?[3,14]:(k=(x=A).push,[4,Dr(r,b["Segment.io"],t.integrations)]);case 13:k.apply(x,[F.sent()]),F.label=14;case 14:return[4,r.register.apply(r,C(C([],A,!1),l,!1))];case 15:return Q=F.sent(),[4,Ln(r,a)];case 16:return F.sent(),Object.entries((c=t.enabledMiddleware)!==null&&c!==void 0?c:{}).some(function(T){var te=T[1];return te})?[4,U(()=>import("./index-BfYbKzUW.js"),__vite__mapDeps([7,1])).then(function(T){var te=T.remoteMiddlewares;return y(Rr,void 0,void 0,function(){var qt,Ut;return g(this,function($t){switch($t.label){case 0:return[4,te(Q,t,n.obfuscate)];case 1:return qt=$t.sent(),Ut=qt.map(function(Lr){return r.addSourceMiddleware(Lr)}),[2,Promise.all(Ut)]}})})})]:[3,18];case 17:F.sent(),F.label=18;case 18:return[4,Rn(r,a)];case 19:return F.sent(),[2,Q]}})})}function wo(e,t,r){var n,i,o,a,u,s,c,l,f;return t===void 0&&(t={}),y(this,void 0,void 0,function(){var p,h,v,m,S,w,b,E,A,I,x;return g(this,function(k){switch(k.label){case 0:return t.disable===!0?[2,[new Wt,K.system()]]:(t.globalAnalyticsKey&&Fn(t.globalAnalyticsKey),e.cdnURL&&Vi(e.cdnURL),t.initialPageview&&r.add(new ot("page",[])),p=mo(),h=(n=e.cdnURL)!==null&&n!==void 0?n:Nt(),(i=e.cdnSettings)!==null&&i!==void 0?(m=i,[3,3]):[3,1]);case 1:return[4,vo(e.writeKey,h)];case 2:m=k.sent(),k.label=3;case 3:return v=m,t.updateCDNSettings&&(v=t.updateCDNSettings(v)),typeof t.disable!="function"?[3,5]:[4,t.disable(v)];case 4:if(S=k.sent(),S)return[2,[new Wt,K.system()]];k.label=5;case 5:return w=(a=(o=v.integrations["Segment.io"])===null||o===void 0?void 0:o.retryQueue)!==null&&a!==void 0?a:!0,t=d({retryQueue:w},t),b=new Lt(d(d({},e),{cdnSettings:v,cdnURL:h}),t),fo(b),E=(u=e.plugins)!==null&&u!==void 0?u:[],A=(s=e.classicIntegrations)!==null&&s!==void 0?s:[],I=(c=t.integrations)===null||c===void 0?void 0:c["Segment.io"],or.initRemoteMetrics(d(d({},v.metrics),{host:(l=I==null?void 0:I.apiHost)!==null&&l!==void 0?l:(f=v.metrics)===null||f===void 0?void 0:f.host,protocol:I==null?void 0:I.protocol})),[4,_o(e.writeKey,v,b,t,E,A,r)];case 6:return x=k.sent(),b.initialized=!0,b.emit("initialize",e,t),[4,go(b,p,r)];case 7:return k.sent(),[2,[b,x]]}})})}var So=function(e){L(t,e);function t(){var r=this,n=Zt(),i=n.promise,o=n.resolve;return r=e.call(this,function(a){return i.then(function(u){var s=u[0],c=u[1];return wo(s,c,a)})})||this,r._resolveLoadStart=function(a,u){return o([a,u])},r}return t.prototype.load=function(r,n){return n===void 0&&(n={}),this._resolveLoadStart(r,n),this},t.load=function(r,n){return n===void 0&&(n={}),new t().load(r,n)},t.standalone=function(r,n){return t.load({writeKey:r},n).then(function(i){return i[0]})},t}(zn);const Ao=Object.freeze(Object.defineProperty({__proto__:null,Analytics:Lt,AnalyticsBrowser:So,Context:K,ContextCancelation:ae,EventFactory:lr,Group:mr,UniversalStorage:Z,User:_t,getGlobalAnalytics:St,isDestinationPluginWithAddMiddleware:fr,resolveAliasArguments:nr,resolveArguments:rr,resolvePageArguments:et,resolveUserArguments:tt,segmentio:Dr},Symbol.toStringTag,{value:"Module"}));export{ae as C,vt as P,y as _,g as a,Oo as b,C as c,Se as d,d as e,jr as f,Ji as g,X as h,q as i,Io as j,Ri as k,Qe as l,Gi as m,Zt as n,gt as o,Hr as p,we as q,Me as r,dn as s,K as t,Po as u,Ao as v};