@imtbl/sdk 1.45.6 → 1.45.7
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.
- package/dist/blockchain_data.js +2 -2
- package/dist/browser/checkout/{BridgeWidget-5fa24b8e.js → BridgeWidget-64c347f2.js} +1 -1
- package/dist/browser/checkout/{OnRampWidget-39aafca1.js → OnRampWidget-422f0deb.js} +1 -1
- package/dist/browser/checkout/SaleWidget-db0a4da8.js +1 -0
- package/dist/browser/checkout/{SpendingCapHero-7e3d3f29.js → SpendingCapHero-e05cde66.js} +1 -1
- package/dist/browser/checkout/{SwapWidget-19cf44cf.js → SwapWidget-e433536e.js} +1 -1
- package/dist/browser/checkout/{TopUpView-7a1d6bc7.js → TopUpView-e2509396.js} +1 -1
- package/dist/browser/checkout/{WalletWidget-5ac8f34a.js → WalletWidget-e977ad55.js} +1 -1
- package/dist/browser/checkout/{auto-track-19321afd.js → auto-track-4d0daee8.js} +1 -1
- package/dist/browser/checkout/{balance-e52ee518.js → balance-697e25e1.js} +1 -1
- package/dist/browser/checkout/index-0b6090b7.js +1 -0
- package/dist/browser/checkout/{index-8ad826ea.js → index-24dea9a2.js} +1 -1
- package/dist/browser/checkout/{index-f32eb4fe.js → index-2b1e0855.js} +1 -1
- package/dist/browser/checkout/{index-80285e8e.js → index-33d10388.js} +2 -2
- package/dist/browser/checkout/{index-a515997f.js → index-5f876d53.js} +1 -1
- package/dist/browser/checkout/{index-c3da72bf.js → index-6cfa4a78.js} +1 -1
- package/dist/browser/checkout/{index-488c00f8.js → index-7be33d6b.js} +1 -1
- package/dist/browser/checkout/{index-3caa8db4.js → index-f28c8046.js} +1 -1
- package/dist/browser/checkout/{index.umd-22ebb7cf.js → index.umd-0d0184c5.js} +1 -1
- package/dist/browser/checkout/{retry-0079e4e7.js → retry-2ec883f6.js} +1 -1
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/browser/checkout/widgets-esm.js +1 -1
- package/dist/browser/checkout/widgets.js +2 -2
- package/dist/checkout.d.ts +1 -0
- package/dist/checkout.js +4 -4
- package/dist/config.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -7
- package/dist/minting_backend.js +2 -2
- package/dist/orderbook.js +1 -1
- package/dist/passport.js +4 -4
- package/dist/webhook.js +1 -1
- package/dist/x.js +3 -3
- package/package.json +1 -1
- package/dist/browser/checkout/SaleWidget-ad6bf465.js +0 -1
- package/dist/browser/checkout/index-bae887b7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cZ as r,cR as a}from"./index-
|
|
1
|
+
import{cZ as r,cR as a}from"./index-33d10388.js";function s(r,a){return Object.keys(a).reduce((function(s,e){e.startsWith(r)&&(s[e.substr(r.length)]=a[e]);return s}),{})}function e(e,t){var i=document.createElement("a");i.href=t;var n=i.search.slice(1).split("&").reduce((function(a,s){var e=s.split("="),t=e[0],i=e[1];return a[t]=r(i),a}),{}),u=[],d=n.ajs_uid,o=n.ajs_event,j=n.ajs_aid,_=a(e.options.useQueryString)?e.options.useQueryString:{},c=_.aid,v=void 0===c?/.+/:c,f=_.uid,y=void 0===f?/.+/:f;if(j){var p=Array.isArray(n.ajs_aid)?n.ajs_aid[0]:n.ajs_aid;v.test(p)&&e.setAnonymousId(p)}if(d){var l=Array.isArray(n.ajs_uid)?n.ajs_uid[0]:n.ajs_uid;if(y.test(l)){var A=s("ajs_trait_",n);u.push(e.identify(l,A))}}if(o){var h=Array.isArray(n.ajs_event)?n.ajs_event[0]:n.ajs_event,m=s("ajs_prop_",n);u.push(e.track(h,m))}return Promise.all(u)}export{e as queryString};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cE as t,cF as n,cG as i,cH as e,cI as r,cJ as o,cK as s,cL as a,cM as u,cN as c,cO as l,cP as d,cQ as h,cR as v,cS as f,cT as p,cU as g,cV as y,cW as m,cX as w}from"./index-
|
|
1
|
+
import{cE as t,cF as n,cG as i,cH as e,cI as r,cJ as o,cK as s,cL as a,cM as u,cN as c,cO as l,cP as d,cQ as h,cR as v,cS as f,cT as p,cU as g,cV as y,cW as m,cX as w}from"./index-33d10388.js";import{i as b}from"./is-plan-event-enabled-80f76ce6.js";function _(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function S(t,n){return void 0===n&&(n=!1),n?btoa(t).replace(/=/g,""):void 0}function k(r,s,a,u){return t(this,void 0,void 0,(function(){var t,c,l,d,h,v;return n(this,(function(n){switch(n.label){case 0:t=_(s),c=S(t,u),l=e(),d="".concat(l,"/integrations/").concat(null!=c?c:t,"/").concat(a,"/").concat(null!=c?c:t,".dynamic.js.gz"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,i(d)];case 2:return n.sent(),function(t,n,i){var e,r;try{var s=(null!==(r=null===(e=null===window||void 0===window?void 0:window.performance)||void 0===e?void 0:e.getEntriesByName(t,"resource"))&&void 0!==r?r:[])[0];s&&n.stats.gauge("legacy_destination_time",Math.round(s.duration),o([i],s.duration<100?["cached"]:[],!0))}catch(t){}}(d,r,s),[3,4];case 3:throw h=n.sent(),r.stats.gauge("legacy_destination_time",-1,["plugin:".concat(s),"failed"]),h;case 4:return v=window["".concat(t,"Deps")],[4,Promise.all(v.map((function(t){return i(l+t+".gz")})))];case 5:return n.sent(),window["".concat(t,"Loader")](),[2,window["".concat(t,"Integration")]]}}))}))}function z(i,e){return t(this,void 0,void 0,(function(){var r,o=this;return n(this,(function(a){switch(a.label){case 0:return r=[],s()?[2,e]:[4,f((function(){return e.length>0&&m()}),(function(){return t(o,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return(t=e.pop())?[4,y(t,i)]:[2];case 1:return o=n.sent(),o instanceof w||r.push(t),[2]}}))}))}))];case 1:return a.sent(),r.map((function(t){return e.pushWithBackoff(t)})),[2,e]}}))}))}var I=function(){function i(t,n,i,e,r,o){void 0===e&&(e={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=n,this.settings=a({},e),this.disableAutoISOConversion=r.disableAutoISOConversion||!1,this.integrationSource=o,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=r,this.buffer=r.disableClientPersistence?new p(4,[]):new g(4,"".concat(i,":dest-").concat(t)),this.scheduleFlush()}return i.prototype.isLoaded=function(){return this._ready},i.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},i.prototype.load=function(i,e){var r;return t(this,void 0,void 0,(function(){var t,o,s=this;return n(this,(function(n){switch(n.label){case 0:return this._ready||void 0!==this.onReady?[2]:null===(r=this.integrationSource)||void 0===r?[3,1]:(o=r,[3,3]);case 1:return[4,k(i,this.name,this.version,this.options.obfuscate)];case 2:o=n.sent(),n.label=3;case 3:t=o,this.integration=function(t,n,i){var e;"Integration"in t?(t({user:function(){return i.user()},addIntegration:function(){}}),e=t.Integration):e=t;var r=new e(n);return r.analytics=i,r}(t,this.settings,e),this.onReady=new Promise((function(t){s.integration.once("ready",(function(){s._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){s.integration.on("initialize",(function(){s._initialized=!0,t(!0)}))}));try{i.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(t){throw i.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),t}return[2]}}))}))},i.prototype.unload=function(i,o){return function(i,o,s){return t(this,void 0,void 0,(function(){var t,a,u,c;return n(this,(function(n){return t=e(),a=_(i),u=S(i,s),c="".concat(t,"/integrations/").concat(null!=u?u:a,"/").concat(o,"/").concat(null!=u?u:a,".dynamic.js.gz"),[2,r(c)]}))}))}(this.name,this.version,this.options.obfuscate)},i.prototype.addMiddleware=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];this.middleware=(t=this.middleware).concat.apply(t,n)},i.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(s()||!1===this._ready||!1===this._initialized)},i.prototype.send=function(i,e,r){var o,s;return t(this,void 0,void 0,(function(){var t,l,d,h,v,f;return n(this,(function(n){switch(n.label){case 0:if(this.shouldBuffer(i))return this.buffer.push(i),this.scheduleFlush(),[2,i];if(t=null===(s=null===(o=this.options)||void 0===o?void 0:o.plan)||void 0===s?void 0:s.track,l=i.event.event,t&&l&&"Segment.io"!==this.name){if(d=t[l],!b(t,d))return i.updateEvent("integrations",a(a({},i.event.integrations),{All:!1,"Segment.io":!0})),i.cancel(new u({retry:!1,reason:"Event ".concat(l," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,i];if(i.updateEvent("integrations",a(a({},i.event.integrations),null==d?void 0:d.integrations)),(null==d?void 0:d.enabled)&&!1===(null==d?void 0:d.integrations[this.name]))return i.cancel(new u({retry:!1,reason:"Event ".concat(l," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,i]}return[4,c(this.name,i.event,this.middleware)];case 1:if(null===(h=n.sent()))return[2,i];v=new e(h,{traverse:!this.disableAutoISOConversion}),i.stats.increment("analytics_js.integration.invoke",1,["method:".concat(r),"integration_name:".concat(this.name)]),n.label=2;case 2:return n.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,r,v)]:[3,4];case 3:n.sent(),n.label=4;case 4:return[3,6];case 5:throw f=n.sent(),i.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(r),"integration_name:".concat(this.name)]),f;case 6:return[2,i]}}))}))},i.prototype.track=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Track,"track")]}))}))},i.prototype.page=function(i){var e;return t(this,void 0,void 0,(function(){var t=this;return n(this,(function(n){return(null===(e=this.integration)||void 0===e?void 0:e._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return t.send(i,l.Page,"page")}))]}))}))},i.prototype.identify=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Identify,"identify")]}))}))},i.prototype.alias=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Alias,"alias")]}))}))},i.prototype.group=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Group,"group")]}))}))},i.prototype.scheduleFlush=function(){var i=this;this.flushing||setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return this.flushing=!0,t=this,[4,z(this,this.buffer)];case 1:return t.buffer=n.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},i}();function j(t,n,i,e,r,s){var u,c;if(void 0===i&&(i={}),void 0===e&&(e={}),d())return[];n.plan&&((e=null!=e?e:{}).plan=n.plan);var l=null!==(c=null===(u=n.middlewareSettings)||void 0===u?void 0:u.routingRules)&&void 0!==c?c:[],f=n.integrations,p=e.integrations,g=h(n,null!=e?e:{}),y=null==s?void 0:s.reduce((function(t,n){var i;return a(a({},t),((i={})[function(t){return("Integration"in t?t.Integration:t).prototype.name}(n)]=n,i))}),{}),m=new Set(o(o([],Object.keys(f).filter((function(t){return function(t,n){var i,e=n.type,r=n.bundlingStatus,o=n.versionSettings,s="unbundled"!==r&&("browser"===e||(null===(i=null==o?void 0:o.componentTypes)||void 0===i?void 0:i.includes("browser")));return!t.startsWith("Segment")&&"Iterable"!==t&&s}(t,f[t])})),!0),Object.keys(y||{}).filter((function(t){return v(f[t])||v(null==p?void 0:p[t])})),!0));return Array.from(m).filter((function(t){return!function(t,n){var i=!1===n.All&&void 0===n[t];return!1===n[t]||i}(t,i)})).map((function(n){var i=function(t){var n,i,e,r;return null!==(r=null!==(i=null===(n=null==t?void 0:t.versionSettings)||void 0===n?void 0:n.override)&&void 0!==i?i:null===(e=null==t?void 0:t.versionSettings)||void 0===e?void 0:e.version)&&void 0!==r?r:"latest"}(f[n]),o=new I(n,i,t,g[n],e,null==y?void 0:y[n]);return l.filter((function(t){return t.destinationName===n})).length>0&&r&&o.addMiddleware(r),o}))}export{I as LegacyDestination,j as ajsDestinations};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cE as e,cF as t,cP as r,cH as n,cG as a}from"./index-
|
|
1
|
+
import{cE as e,cF as t,cP as r,cH as n,cG as a}from"./index-33d10388.js";function c(c,i,s){var o;return e(this,void 0,void 0,(function(){var l,u,d,f,m=this;return t(this,(function(v){switch(v.label){case 0:return r()?[2,[]]:(l=n(),u=null!==(o=i.enabledMiddleware)&&void 0!==o?o:{},d=Object.entries(u).filter((function(e){return e[0],e[1]})).map((function(e){return e[0]})),f=d.map((function(r){return e(m,void 0,void 0,(function(){var e,n,i,o;return t(this,(function(t){switch(t.label){case 0:e=r.replace("@segment/",""),n=e,s&&(n=btoa(e).replace(/=/g,"")),i="".concat(l,"/middleware/").concat(n,"/latest/").concat(n,".js.gz"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,a(i)];case 2:return t.sent(),[2,window["".concat(e,"Middleware")]];case 3:return o=t.sent(),c.log("error",o),c.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}}))}))})),[4,Promise.all(f)]);case 1:return[2,v.sent().filter(Boolean)]}}))}))}export{c as remoteMiddlewares};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c_ as e}from"./index-80285e8e.js";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(a){if("default"!==a&&!(a in e)){var n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,n.get?n:{enumerable:!0,get:function(){return t[a]}})}}))})),Object.freeze(e)}var a={exports:{}};window;var n=a.exports=function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(n,i,function(t){return e[t]}.bind(null,i));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=2)}([function(e,t,a){a.r(t);var n="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise((function(a,n){var i=new XMLHttpRequest;for(var r in i.open(t.method||"get",e,!0),t.headers)i.setRequestHeader(r,t.headers[r]);function o(){var e,t=[],a=[],n={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,r,o){t.push(r=r.toLowerCase()),a.push([r,o]),e=n[r],n[r]=e?e+","+o:o})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:o,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]))},headers:{keys:function(){return t},entries:function(){return a},get:function(e){return n[e.toLowerCase()]},has:function(e){return e.toLowerCase()in n}}}}i.withCredentials="include"==t.credentials,i.onload=function(){a(o())},i.onerror=n,i.send(t.body)}))};t.default=n},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=function(){function e(t,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginName=t}return n(e,[{key:"track",value:function(e,t){window.analytics.track(e,t,{integration:{name:this.pluginName}})}}]),e}();t.default=i},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeAnalytics=t.VimeoAnalytics=void 0;var n=r(a(3)),i=r(a(4));function r(e){return e&&e.__esModule?e:{default:e}}t.VimeoAnalytics=n.default,t.YouTubeAnalytics=i.default},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=r(a(0));function r(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"VimeoAnalytics"));return n.authToken=a,n.player=e,n.metadata={content:{},playback:{videoPlayer:"Vimeo"}},n.mostRecentHeartbeat=0,n.isPaused=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"initialize",value:function(){var e=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var a in t)this.registerHandler(a,t[a]);this.player.getVideoId().then((function(t){e.retrieveMetadata({id:t})})).catch(console.error)}},{key:"registerHandler",value:function(e,t){var a=this;this.player.on(e,(function(e){a.updateMetadata(e),t.call(a,e)}))}},{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 e=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==e&&t-e>=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(e){var t=this;return new Promise((function(a,n){var r=e.id;(0,i.default)("https://api.vimeo.com/videos/"+r,{headers:{Authorization:"Bearer "+t.authToken}}).then((function(e){return e.ok?e.json():n(e)})).then((function(e){t.metadata.content.title=e.name,t.metadata.content.description=e.description,t.metadata.content.publisher=e.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=e.duration})).catch((function(e){return console.error("Request to Vimeo API Failed with: ",e),n(e)}))}))}},{key:"updateMetadata",value:function(e){var t=this;return new Promise((function(a,n){t.player.getVolume().then((function(n){n&&(t.metadata.playback.sound=100*n),t.metadata.playback.position=e.seconds,a()})).catch(n)}))}}]),t}(r(a(1)).default);t.default=o},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=r(a(0));function r(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return n.player=e,n.apiKey=a,n.playerLoaded=!1,n.playbackStarted=!1,n.contentStarted=!1,n.isPaused=!1,n.isBuffering=!1,n.isSeeking=!1,n.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},n.metadata=[{playback:{video_player:"youtube"},content:{}}],n.playlistIndex=0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(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 t=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=t,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(t,a){var n=e.player.getVideoData(),r=e.player.getPlaylist()||[n.video_id],o=r.join();(0,i.default)("https://www.googleapis.com/youtube/v3/videos?id="+o+"&part=snippet,contentDetails&key="+e.apiKey).then((function(e){if(!e.ok){var t=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 t.response=e,t}return e.json()})).then((function(a){e.metadata=[];for(var n=0,i=0;i<r.length;i++){var o=a.items[i];e.metadata.push({content:{title:o.snippet.title,description:o.snippet.description,keywords:o.snippet.tags,channel:o.snippet.channelTitle,airdate:o.snippet.publishedAt}}),n+=s(o.contentDetails.duration)}for(i=0;i<r.length;i++)e.metadata[i].playback={total_length:n,video_player:"youtube"};t()})).catch((function(t){e.metadata=r.map((function(e){return{playback:{video_player:"youtube"},content:{}}})),a(t)}))}))}},{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 t=this.player.getPlaylist();t&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===t.length-1&&0===this.player.getPlaylistIndex()&&(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(),-1===this.playlistIndex&&(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(),t=this.player.getPlaylist();(t&&e===t.length-1||-1===e)&&(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,t=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-t)>2e3}}]),t}(r(a(1)).default);function s(e){var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map((function(e){if(null!=e)return e.replace(/\D/,"")})),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}t.default=o}]),i=t({__proto__:null,default:e(n)},[n]);export{i};
|
|
1
|
+
import{c_ as e}from"./index-33d10388.js";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(a){if("default"!==a&&!(a in e)){var n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,n.get?n:{enumerable:!0,get:function(){return t[a]}})}}))})),Object.freeze(e)}var a={exports:{}};window;var n=a.exports=function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(n,i,function(t){return e[t]}.bind(null,i));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=2)}([function(e,t,a){a.r(t);var n="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise((function(a,n){var i=new XMLHttpRequest;for(var r in i.open(t.method||"get",e,!0),t.headers)i.setRequestHeader(r,t.headers[r]);function o(){var e,t=[],a=[],n={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,r,o){t.push(r=r.toLowerCase()),a.push([r,o]),e=n[r],n[r]=e?e+","+o:o})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:o,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]))},headers:{keys:function(){return t},entries:function(){return a},get:function(e){return n[e.toLowerCase()]},has:function(e){return e.toLowerCase()in n}}}}i.withCredentials="include"==t.credentials,i.onload=function(){a(o())},i.onerror=n,i.send(t.body)}))};t.default=n},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=function(){function e(t,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginName=t}return n(e,[{key:"track",value:function(e,t){window.analytics.track(e,t,{integration:{name:this.pluginName}})}}]),e}();t.default=i},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeAnalytics=t.VimeoAnalytics=void 0;var n=r(a(3)),i=r(a(4));function r(e){return e&&e.__esModule?e:{default:e}}t.VimeoAnalytics=n.default,t.YouTubeAnalytics=i.default},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=r(a(0));function r(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"VimeoAnalytics"));return n.authToken=a,n.player=e,n.metadata={content:{},playback:{videoPlayer:"Vimeo"}},n.mostRecentHeartbeat=0,n.isPaused=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"initialize",value:function(){var e=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var a in t)this.registerHandler(a,t[a]);this.player.getVideoId().then((function(t){e.retrieveMetadata({id:t})})).catch(console.error)}},{key:"registerHandler",value:function(e,t){var a=this;this.player.on(e,(function(e){a.updateMetadata(e),t.call(a,e)}))}},{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 e=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==e&&t-e>=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(e){var t=this;return new Promise((function(a,n){var r=e.id;(0,i.default)("https://api.vimeo.com/videos/"+r,{headers:{Authorization:"Bearer "+t.authToken}}).then((function(e){return e.ok?e.json():n(e)})).then((function(e){t.metadata.content.title=e.name,t.metadata.content.description=e.description,t.metadata.content.publisher=e.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=e.duration})).catch((function(e){return console.error("Request to Vimeo API Failed with: ",e),n(e)}))}))}},{key:"updateMetadata",value:function(e){var t=this;return new Promise((function(a,n){t.player.getVolume().then((function(n){n&&(t.metadata.playback.sound=100*n),t.metadata.playback.position=e.seconds,a()})).catch(n)}))}}]),t}(r(a(1)).default);t.default=o},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=r(a(0));function r(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return n.player=e,n.apiKey=a,n.playerLoaded=!1,n.playbackStarted=!1,n.contentStarted=!1,n.isPaused=!1,n.isBuffering=!1,n.isSeeking=!1,n.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},n.metadata=[{playback:{video_player:"youtube"},content:{}}],n.playlistIndex=0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(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 t=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=t,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(t,a){var n=e.player.getVideoData(),r=e.player.getPlaylist()||[n.video_id],o=r.join();(0,i.default)("https://www.googleapis.com/youtube/v3/videos?id="+o+"&part=snippet,contentDetails&key="+e.apiKey).then((function(e){if(!e.ok){var t=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 t.response=e,t}return e.json()})).then((function(a){e.metadata=[];for(var n=0,i=0;i<r.length;i++){var o=a.items[i];e.metadata.push({content:{title:o.snippet.title,description:o.snippet.description,keywords:o.snippet.tags,channel:o.snippet.channelTitle,airdate:o.snippet.publishedAt}}),n+=s(o.contentDetails.duration)}for(i=0;i<r.length;i++)e.metadata[i].playback={total_length:n,video_player:"youtube"};t()})).catch((function(t){e.metadata=r.map((function(e){return{playback:{video_player:"youtube"},content:{}}})),a(t)}))}))}},{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 t=this.player.getPlaylist();t&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===t.length-1&&0===this.player.getPlaylistIndex()&&(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(),-1===this.playlistIndex&&(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(),t=this.player.getPlaylist();(t&&e===t.length-1||-1===e)&&(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,t=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-t)>2e3}}]),t}(r(a(1)).default);function s(e){var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map((function(e){if(null!=e)return e.replace(/\D/,"")})),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}t.default=o}]),i=t({__proto__:null,default:e(n)},[n]);export{i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,bg as r,j as t,cm as n}from"./index-
|
|
1
|
+
import{r as e,bg as r,j as t,cm as n}from"./index-33d10388.js";function a({src:n,name:a,environment:s,theme:u,defaultImage:o,...c}){const[i,l]=e.useState(!1),f=e.useMemo((()=>!n||i?o||u&&r(s,u)||"":n),[n,i]);return t("img",{src:f,alt:a,onError:()=>l(!0),...c})}function s(r,t){const a=e.useRef(r),s=e.useRef(0);return n((()=>{a.current=r}),[r]),e.useEffect((()=>{if(t||0===t)return s.current=setInterval((()=>a.current()),t),()=>{clearInterval(s.current)}}),[t]),()=>{s.current&&clearInterval(s.current)}}const u=async(e,{retries:r,retryIntervalMs:t,nonRetryable:n,nonRetryableSilently:a})=>{let s=r;try{return await e()}catch(r){if(a&&a(r))return;if(n&&n(r))throw r;if(void 0!==s){if(s<=0)throw r;s-=1}return await((e=0)=>e&&new Promise((r=>setTimeout(r,e))))(t),u(e,{retries:s,retryIntervalMs:t,nonRetryable:n,nonRetryableSilently:a})}};export{a as T,u as r,s as u};
|