@streamlayer/react 1.20.4 → 1.20.6
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/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/provider.js +21 -21
- package/lib/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/provider.js +20 -20
- package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/es/pause-ad.js +75 -76
- package/lib/classic/es/provider.js +6461 -6117
- package/lib/classic/es/useStreamLayerApp2.js +1 -1
- package/lib/dist/cjs/masters.js +12 -12
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/style.css +1 -1
- package/lib/es/pause-ad.js +75 -76
- package/lib/es/provider.js +2840 -2852
- package/lib/es/useStreamLayerApp2.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +14 -14
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`),c=`
|
|
15
15
|
`+n+(i.length?o("│"):" ")+" ";return n+a.join(c)+`
|
|
16
16
|
`+i.map(function(s,r){var d=r===i.length-1,b=s.nodes&&s.nodes.length,h=n+(d?" ":o("│"))+" ";return n+o(d?"└":"├")+o("─")+o(b?"┬":"─")+" "+e(s,h,l).slice(n.length+2)}).join("")};const FA=fA,sc=Symbol("avvio.TimeTree.untrackNode"),Ql=Symbol("avvio.TimeTree.trackNode"),rc=Symbol("avvio.TimeTree.getParent"),dc=Symbol("avvio.TimeTree.getNode"),uc=Symbol("avvio.TimeTree.addNode");let NA=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Ql](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[sc](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[rc](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[dc](e){return this.tableId.get(e)}[uc](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Ql](this.root),this.root.id;const l=this[rc](e),o=`${t}-${Math.random()}`,i={id:o,parent:e,start:n,label:t,nodes:[]};return l.nodes.push(i),this[Ql](i),o}start(e,t,n=Date.now()){return this[uc](e,t,n)}stop(e,t=Date.now()){const n=this[dc](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[sc](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(l=>e(l))),n),t=e(this.toJSON());return FA(t)}};var YA=NA,ri={exports:{}},Wo={exports:{}},zl,bc;function IA(){if(bc)return zl;bc=1;var e=1e3,t=e*60,n=t*60,l=n*24,o=l*7,i=l*365.25;zl=function(d,b){b=b||{};var h=typeof d;if(h==="string"&&d.length>0)return a(d);if(h==="number"&&isFinite(d))return b.long?s(d):c(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function a(d){if(d=String(d),!(d.length>100)){var b=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(b){var h=parseFloat(b[1]),V=(b[2]||"ms").toLowerCase();switch(V){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*o;case"days":case"day":case"d":return h*l;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function c(d){var b=Math.abs(d);return b>=l?Math.round(d/l)+"d":b>=n?Math.round(d/n)+"h":b>=t?Math.round(d/t)+"m":b>=e?Math.round(d/e)+"s":d+"ms"}function s(d){var b=Math.abs(d);return b>=l?r(d,b,l,"day"):b>=n?r(d,b,n,"hour"):b>=t?r(d,b,t,"minute"):b>=e?r(d,b,e,"second"):d+" ms"}function r(d,b,h,V){var m=b>=h*1.5;return Math.round(d/h)+" "+V+(m?"s":"")}return zl}function UA(e){n.debug=n,n.default=n,n.coerce=s,n.disable=i,n.enable=o,n.enabled=a,n.humanize=IA(),n.destroy=r,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let b=0;for(let h=0;h<d.length;h++)b=(b<<5)-b+d.charCodeAt(h),b|=0;return n.colors[Math.abs(b)%n.colors.length]}n.selectColor=t;function n(d){let b,h=null,V,m;function Z(...y){if(!Z.enabled)return;const A=Z,W=Number(new Date),S=W-(b||W);A.diff=S,A.prev=b,A.curr=W,b=W,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let p=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(F,N)=>{if(F==="%%")return"%";p++;const f=n.formatters[N];if(typeof f=="function"){const U=y[p];F=f.call(A,U),y.splice(p,1),p--}return F}),n.formatArgs.call(A,y),(A.log||n.log).apply(A,y)}return Z.namespace=d,Z.useColors=n.useColors(),Z.color=n.selectColor(d),Z.extend=l,Z.destroy=n.destroy,Object.defineProperty(Z,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(V!==n.namespaces&&(V=n.namespaces,m=n.enabled(d)),m),set:y=>{h=y}}),typeof n.init=="function"&&n.init(Z),Z}function l(d,b){const h=n(this.namespace+(typeof b>"u"?":":b)+d);return h.log=this.log,h}function o(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let b;const h=(typeof d=="string"?d:"").split(/[\s,]+/),V=h.length;for(b=0;b<V;b++)h[b]&&(d=h[b].replace(/\*/g,".*?"),d[0]==="-"?n.skips.push(new RegExp("^"+d.slice(1)+"$")):n.names.push(new RegExp("^"+d+"$")))}function i(){const d=[...n.names.map(c),...n.skips.map(c).map(b=>"-"+b)].join(",");return n.enable(""),d}function a(d){if(d[d.length-1]==="*")return!0;let b,h;for(b=0,h=n.skips.length;b<h;b++)if(n.skips[b].test(d))return!1;for(b=0,h=n.names.length;b<h;b++)if(n.names[b].test(d))return!0;return!1}function c(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function s(d){return d instanceof Error?d.stack||d.message:d}function r(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var BA=UA;(function(e,t){t.formatArgs=l,t.save=o,t.load=i,t.useColors=n,t.storage=a(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;s.splice(1,0,r,"color: inherit");let d=0,b=0;s[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(d++,h==="%c"&&(b=d))}),s.splice(b,0,r)}t.log=console.debug||console.log||(()=>{});function o(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function i(){let s;try{s=t.storage.getItem("debug")}catch{}return!s&&typeof B<"u"&&"env"in B&&(s=B.env.DEBUG),s}function a(){try{return localStorage}catch{}}e.exports=BA(t);const{formatters:c}=e.exports;c.j=function(s){try{return JSON.stringify(s)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}})(Wo,Wo.exports);var Wr=Wo.exports;const CA=Hs,JA=tr.EventEmitter,vA=rl.inherits,Ze=Wr("avvio"),{AVV_ERR_READY_TIMEOUT:TA}=gr,wl=Symbol.for("plugin-meta");function kA(e,t){return e[wl]&&e[wl].name?e[wl].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
17
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function QA(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function jt(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=kA(t,n),this.isAfter=l,this.q=CA(e,zA,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vA(jt,JA);jt.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){Ze("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return Ze("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ze("exec",o);let i;const a=s=>{if(l){Ze("loading complete",o);return}this._error=s,Ze(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(Ze("setting up timeout",o,this.timeout),i=setTimeout(function(){Ze("timed out",o),i=null;const s=new TA(o);s.fn=n,a(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,a);c&&typeof c.then=="function"&&(Ze("exec: resolving promise",o),c.then(()=>B.nextTick(a),s=>B.nextTick(a,s)))};jt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(Ze("rejecting promise",this.name,n),this._promise.reject(n)):(Ze("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=QA(),t=this._promise.promise,this.server?e():this.on("start",e)),t};jt.prototype.enqueue=function(e,t){Ze("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};jt.prototype.finish=function(e,t){Ze("finish",this.name,e);const n=()=>{this.loaded||(Ze("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(Ze("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{Ze("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else Ze("delayed",this.name),this.q.drain=()=>{Ze("drain",this.name),this.q.drain=wA,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zA(e,t){const n=this;B.nextTick(di.bind(n),e,t)}function di(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,di.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function wA(){}ri.exports=jt;ri.exports.loadPlugin=di;var LA=ri.exports;const Vc=Hs,KA=tr.EventEmitter,xA=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ll,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MA,AVV_ERR_ROOT_PLG_BOOTED:HA,AVV_ERR_READY_TIMEOUT:OA}=gr,DA=YA,Zo=LA,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Kl=Symbol("kThenifyDoNotWrap");function jA(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",a=l.ready||"ready",c=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new Ll(o);if(e[i])throw new Ll(i);if(e[a])throw new Ll(a);e[o]=function(r,d){return n.use(r,d),this},Object.defineProperty(e,"then",{get:Zr.bind(n)}),e[qn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(xl(r,this)),this)},e[a]=function(r){if(r&&typeof r!="function")throw new nn(a,typeof r);return n.ready(r?xl(r,this):void 0)},e[c]=function(r){if(typeof r!="function")throw new nn(c,typeof r);return n.onClose(eg(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new nn(s,typeof r);return r?(n.close(xl(r,this)),this):n.close()}}function Ae(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Ae)){const l=new Ae(e,t,n);return e&&jA(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new DA,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$A,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PA.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const a=this.pluginTree.start(null,o,i);this._root.once("loaded",(c,s,r)=>{this.pluginTree.stop(a,r)})}),Zo.loadPlugin.call(this,this._root,l=>{Ht("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function PA(e,t,n){this._doStart=n,t.autostart&&this.start()}xA(Ae,KA);Ae.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ae.prototype.override=function(e,t,n){return e};function _A(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MA(typeof e);return e}Ae.prototype[qn]=!0;Ae.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ae.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ae.prototype,"then",{get:Zr});Ae.prototype._addPlugin=function(e,t,n){if(e=_A(e),t=t||{},this.booted)throw new HA;const l=this._current[0],o=new Zo(this,e,t,n);if(o.once("start",(i,a,c)=>{const s=this.pluginTree.start(l.name,a,c);o.once("loaded",(r,d,b)=>{this.pluginTree.stop(s,b)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ae.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Er.call(this,e,o)}return this};Ae.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Ae.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new nn("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ae.prototype.ready=function(e){if(e){if(typeof e!="function")throw new nn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,a,c){i?n(i):t(l),B.nextTick(c)}})};Ae.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ae.prototype.toJSON=function(){return this.pluginTree.toJSON()};function hc(){}function Zr(){if(this.booted){Ht("thenify returning null because we are already booted");return}if(this[Kl]){this[Kl]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Kl]=!0,e(this._server)),t)}function Er(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=a=>{this._error=a,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else qA.call(this,e,l,n,t)}function qA(e,t,n,l){const o=e.name;Ht("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ht("timed out",o),i=null;const c=new OA(o);c.fn=e,this._error=c,l(c)},this._timeout);e.length===2?e(t,a.bind(this)):e(t,n,a.bind(this));function a(c){i&&(clearTimeout(i),this._error=c,l(this._error))}}function $A(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ht("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function eg(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function xl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}qo.exports=Ae;qo.exports.express=function(e){return Ae(e,{expose:{use:"load"}})};var tg=qo.exports;const ng=Ym(tg);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),a=window.setTimeout(function(){l(o+i)},i);return t=o+i,a},window.cancelAnimationFrame=clearTimeout}})();function lg(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",a=ng(Object.create({}),{autostart:!1});return a.use(cm,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),a.use(em,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),a.use(om,{videoPlayerController:l==null?void 0:l.videoPlayerController}),a.use(am,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),a.use(Zh,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),a.use(Xh),a.use(lm),a.use(gm),a.use(Oh),a.use(Nm),a.after((c,s,r)=>{if(c)throw c;s.ready(),r()}),n&&a.after(async(c,s,r)=>{if(c)throw c;await s.sdk.initializeApp(),r()}),a.onClose(()=>{console.log("close StreamLayer instance")}),a}const og=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,hideFriends:c,skipOnboarding:s,withAdNotification:r,withAd:d,friendsTab:b,betPack:h,webOS:V})=>{const[m,Z]=bi.useState(null);return bi.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),Z(W=>(W!==null&&typeof W.disableApp=="function"&&W.disableApp(),null)),()=>{y=!0};const A=lg(e,n,l,{version:"1.20.4",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,skipOnboarding:s,withAdNotification:r,withAd:d,hideFriends:c,friendsTab:b,betPack:h,webOS:V});if(t)for(const W of t)A.use(W);return A.ready().then(W=>{y||(Z(W.sdk),typeof window<"u")}).catch(W=>console.log(W)),()=>{y=!0,A.close(function(W){if(W)throw W})}},[e,n]),m};exports.AdUnit=Fe;exports.AutoPlayVideo=Du;exports.CloseTimerAuto=Hu;exports.ConnectError=x;exports.CtaIconMode=Bu;exports.InvitationFrom=to;exports.NotificationEnabled=eo;exports.NotificationPromotionImagePosition=Nu;exports.NotificationPromotionMode=fu;exports.NotificationSponsorLogoMode=Iu;exports.NotificationUseContentMedia=Ku;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=me;exports.QuestionType=C;exports.SdkOverlayType=ee;exports.createContextKey=oo;exports.global=io;exports.pino_1=Ec;exports.unsafeStringify=Vs;exports.useStreamLayerApp=og;exports.v4=sn;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function QA(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function jt(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=kA(t,n),this.isAfter=l,this.q=CA(e,zA,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vA(jt,JA);jt.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){Ze("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return Ze("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ze("exec",o);let i;const a=s=>{if(l){Ze("loading complete",o);return}this._error=s,Ze(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(Ze("setting up timeout",o,this.timeout),i=setTimeout(function(){Ze("timed out",o),i=null;const s=new TA(o);s.fn=n,a(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,a);c&&typeof c.then=="function"&&(Ze("exec: resolving promise",o),c.then(()=>B.nextTick(a),s=>B.nextTick(a,s)))};jt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(Ze("rejecting promise",this.name,n),this._promise.reject(n)):(Ze("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=QA(),t=this._promise.promise,this.server?e():this.on("start",e)),t};jt.prototype.enqueue=function(e,t){Ze("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};jt.prototype.finish=function(e,t){Ze("finish",this.name,e);const n=()=>{this.loaded||(Ze("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(Ze("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{Ze("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else Ze("delayed",this.name),this.q.drain=()=>{Ze("drain",this.name),this.q.drain=wA,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zA(e,t){const n=this;B.nextTick(di.bind(n),e,t)}function di(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,di.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function wA(){}ri.exports=jt;ri.exports.loadPlugin=di;var LA=ri.exports;const Vc=Hs,KA=tr.EventEmitter,xA=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ll,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MA,AVV_ERR_ROOT_PLG_BOOTED:HA,AVV_ERR_READY_TIMEOUT:OA}=gr,DA=YA,Zo=LA,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Kl=Symbol("kThenifyDoNotWrap");function jA(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",a=l.ready||"ready",c=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new Ll(o);if(e[i])throw new Ll(i);if(e[a])throw new Ll(a);e[o]=function(r,d){return n.use(r,d),this},Object.defineProperty(e,"then",{get:Zr.bind(n)}),e[qn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(xl(r,this)),this)},e[a]=function(r){if(r&&typeof r!="function")throw new nn(a,typeof r);return n.ready(r?xl(r,this):void 0)},e[c]=function(r){if(typeof r!="function")throw new nn(c,typeof r);return n.onClose(eg(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new nn(s,typeof r);return r?(n.close(xl(r,this)),this):n.close()}}function Ae(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Ae)){const l=new Ae(e,t,n);return e&&jA(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new DA,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$A,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PA.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const a=this.pluginTree.start(null,o,i);this._root.once("loaded",(c,s,r)=>{this.pluginTree.stop(a,r)})}),Zo.loadPlugin.call(this,this._root,l=>{Ht("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function PA(e,t,n){this._doStart=n,t.autostart&&this.start()}xA(Ae,KA);Ae.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ae.prototype.override=function(e,t,n){return e};function _A(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MA(typeof e);return e}Ae.prototype[qn]=!0;Ae.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ae.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ae.prototype,"then",{get:Zr});Ae.prototype._addPlugin=function(e,t,n){if(e=_A(e),t=t||{},this.booted)throw new HA;const l=this._current[0],o=new Zo(this,e,t,n);if(o.once("start",(i,a,c)=>{const s=this.pluginTree.start(l.name,a,c);o.once("loaded",(r,d,b)=>{this.pluginTree.stop(s,b)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ae.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Er.call(this,e,o)}return this};Ae.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Ae.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new nn("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ae.prototype.ready=function(e){if(e){if(typeof e!="function")throw new nn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,a,c){i?n(i):t(l),B.nextTick(c)}})};Ae.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ae.prototype.toJSON=function(){return this.pluginTree.toJSON()};function hc(){}function Zr(){if(this.booted){Ht("thenify returning null because we are already booted");return}if(this[Kl]){this[Kl]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Kl]=!0,e(this._server)),t)}function Er(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=a=>{this._error=a,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else qA.call(this,e,l,n,t)}function qA(e,t,n,l){const o=e.name;Ht("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ht("timed out",o),i=null;const c=new OA(o);c.fn=e,this._error=c,l(c)},this._timeout);e.length===2?e(t,a.bind(this)):e(t,n,a.bind(this));function a(c){i&&(clearTimeout(i),this._error=c,l(this._error))}}function $A(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ht("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function eg(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function xl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}qo.exports=Ae;qo.exports.express=function(e){return Ae(e,{expose:{use:"load"}})};var tg=qo.exports;const ng=Ym(tg);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),a=window.setTimeout(function(){l(o+i)},i);return t=o+i,a},window.cancelAnimationFrame=clearTimeout}})();function lg(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",a=ng(Object.create({}),{autostart:!1});return a.use(cm,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),a.use(em,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),a.use(om,{videoPlayerController:l==null?void 0:l.videoPlayerController}),a.use(am,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),a.use(Zh,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),a.use(Xh),a.use(lm),a.use(gm),a.use(Oh),a.use(Nm),a.after((c,s,r)=>{if(c)throw c;s.ready(),r()}),n&&a.after(async(c,s,r)=>{if(c)throw c;await s.sdk.initializeApp(),r()}),a.onClose(()=>{console.log("close StreamLayer instance")}),a}const og=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,hideFriends:c,skipOnboarding:s,withAdNotification:r,withAd:d,friendsTab:b,betPack:h,webOS:V})=>{const[m,Z]=bi.useState(null);return bi.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),Z(W=>(W!==null&&typeof W.disableApp=="function"&&W.disableApp(),null)),()=>{y=!0};const A=lg(e,n,l,{version:"1.20.6",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,skipOnboarding:s,withAdNotification:r,withAd:d,hideFriends:c,friendsTab:b,betPack:h,webOS:V});if(t)for(const W of t)A.use(W);return A.ready().then(W=>{y||(Z(W.sdk),typeof window<"u")}).catch(W=>console.log(W)),()=>{y=!0,A.close(function(W){if(W)throw W})}},[e,n]),m};exports.AdUnit=Fe;exports.AutoPlayVideo=Du;exports.CloseTimerAuto=Hu;exports.ConnectError=x;exports.CtaIconMode=Bu;exports.InvitationFrom=to;exports.NotificationEnabled=eo;exports.NotificationPromotionImagePosition=Nu;exports.NotificationPromotionMode=fu;exports.NotificationSponsorLogoMode=Iu;exports.NotificationUseContentMedia=Ku;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=me;exports.QuestionType=C;exports.SdkOverlayType=ee;exports.createContextKey=oo;exports.global=io;exports.pino_1=Ec;exports.unsafeStringify=Vs;exports.useStreamLayerApp=og;exports.v4=sn;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as K, i as V, s as p, e as
|
|
3
|
-
import { useRef as
|
|
1
|
+
import { jsx as a, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import { c as K, i as V, s as p, e as L, f as F, j as M, a as _, u as $, b as j, h as q } from "./provider.js";
|
|
3
|
+
import { useRef as x, useCallback as C, useState as R, useEffect as b, Component as z } from "react";
|
|
4
4
|
import { c as N } from "./vast-client.min-B0NUra1B.js";
|
|
5
|
-
const
|
|
5
|
+
const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Promise((e, t) => {
|
|
6
6
|
const s = new Image();
|
|
7
|
-
s.onload = () => e(r), s.onerror = () =>
|
|
7
|
+
s.onload = () => e(r), s.onerror = () => t(), s.src = r;
|
|
8
8
|
}), D = () => {
|
|
9
|
-
const r =
|
|
9
|
+
const r = x(0);
|
|
10
10
|
return [C(async (e) => {
|
|
11
|
-
var
|
|
12
|
-
if ((
|
|
11
|
+
var t, s, c, o, l, n, u, i, h, m, f;
|
|
12
|
+
if ((t = w.get()[e]) != null && t.imageSrc)
|
|
13
13
|
return { success: !0 };
|
|
14
14
|
const v = Date.now();
|
|
15
15
|
r.current = v, w.setKey(e, { url: e });
|
|
16
16
|
try {
|
|
17
|
-
const d = await
|
|
17
|
+
const d = await H.get(e);
|
|
18
18
|
if (E.debug(d, "parsedVAST"), r.current === v && w.get()[e].url) {
|
|
19
19
|
const y = d.ads.find((g) => g.creatives.length > 0);
|
|
20
20
|
if (y) {
|
|
@@ -28,7 +28,7 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
28
28
|
}
|
|
29
29
|
const A = y.creatives.find((S) => S.type === "companion");
|
|
30
30
|
E.debug(A, "companion");
|
|
31
|
-
const T = (
|
|
31
|
+
const T = (h = (i = (u = (n = A == null ? void 0 : A.variations) == null ? void 0 : n[0]) == null ? void 0 : u.staticResources) == null ? void 0 : i[0]) == null ? void 0 : h.url, P = (f = (m = A == null ? void 0 : A.variations) == null ? void 0 : m[0]) == null ? void 0 : f.companionClickThroughURLTemplate;
|
|
32
32
|
if (T)
|
|
33
33
|
return await U(T), w.setKey(e, { url: e, imageSrc: T, adUrl: P }), { success: !0 };
|
|
34
34
|
}
|
|
@@ -38,60 +38,60 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
38
38
|
}
|
|
39
39
|
return { success: !1 };
|
|
40
40
|
}, []), w];
|
|
41
|
-
},
|
|
41
|
+
}, O = /* @__PURE__ */ p("div")({
|
|
42
42
|
name: "PauseAdOverlay",
|
|
43
43
|
class: "pw9gih8",
|
|
44
44
|
propsAsIs: !1
|
|
45
|
-
}),
|
|
45
|
+
}), J = /* @__PURE__ */ p("div")({
|
|
46
46
|
name: "PauseAdContent",
|
|
47
47
|
class: "p8lpomy",
|
|
48
48
|
propsAsIs: !1
|
|
49
|
-
}),
|
|
50
|
-
name: "
|
|
49
|
+
}), Q = /* @__PURE__ */ p("div")({
|
|
50
|
+
name: "PauseAdGradientRight",
|
|
51
51
|
class: "pv7u167",
|
|
52
52
|
propsAsIs: !1
|
|
53
|
-
}),
|
|
54
|
-
name: "
|
|
53
|
+
}), W = /* @__PURE__ */ p("div")({
|
|
54
|
+
name: "PauseAdGradientBottom",
|
|
55
55
|
class: "p1kh2yb0",
|
|
56
56
|
propsAsIs: !1
|
|
57
|
-
}),
|
|
58
|
-
name: "
|
|
57
|
+
}), X = /* @__PURE__ */ p("div")({
|
|
58
|
+
name: "PauseAdTopLeft",
|
|
59
59
|
class: "pl8f94x",
|
|
60
60
|
propsAsIs: !1
|
|
61
|
-
}),
|
|
62
|
-
name: "
|
|
61
|
+
}), Y = /* @__PURE__ */ p("h2")({
|
|
62
|
+
name: "PauseAdTitle",
|
|
63
63
|
class: "p1m6zmrt",
|
|
64
64
|
propsAsIs: !1
|
|
65
|
-
}),
|
|
66
|
-
name: "
|
|
65
|
+
}), Z = /* @__PURE__ */ p("p")({
|
|
66
|
+
name: "PauseAdCaption",
|
|
67
67
|
class: "pm3vwfa",
|
|
68
68
|
propsAsIs: !1
|
|
69
|
-
}), ee = /* @__PURE__ */ p("
|
|
70
|
-
name: "
|
|
69
|
+
}), ee = /* @__PURE__ */ p("div")({
|
|
70
|
+
name: "PauseAdBottomLeft",
|
|
71
71
|
class: "p1tibuhw",
|
|
72
72
|
propsAsIs: !1
|
|
73
|
-
}), re = /* @__PURE__ */ p("
|
|
74
|
-
name: "
|
|
73
|
+
}), re = /* @__PURE__ */ p("button")({
|
|
74
|
+
name: "PauseAdPlayButton",
|
|
75
75
|
class: "ptqqrqd",
|
|
76
76
|
propsAsIs: !1
|
|
77
|
-
}), se = /* @__PURE__ */ p("
|
|
78
|
-
name: "
|
|
77
|
+
}), se = /* @__PURE__ */ p("div")({
|
|
78
|
+
name: "PauseAdSidebar",
|
|
79
79
|
class: "p14estxv",
|
|
80
80
|
propsAsIs: !1
|
|
81
|
-
}),
|
|
82
|
-
name: "
|
|
81
|
+
}), ne = /* @__PURE__ */ p("span")({
|
|
82
|
+
name: "PauseAdTitleDescription",
|
|
83
83
|
class: "p1dpvfl1",
|
|
84
84
|
propsAsIs: !1
|
|
85
85
|
}), k = /* @__PURE__ */ p("img")({
|
|
86
86
|
name: "ExternalAdContainer",
|
|
87
87
|
class: "ezfmabr",
|
|
88
88
|
propsAsIs: !1
|
|
89
|
-
}),
|
|
89
|
+
}), te = ({ vastUrl: r }) => {
|
|
90
90
|
var e;
|
|
91
|
-
const [,
|
|
92
|
-
return (e = s == null ? void 0 : s[r]) != null && e.imageSrc ? s[r].adUrl ? /* @__PURE__ */
|
|
93
|
-
}, ae = ({ isClosing: r, title: e, caption:
|
|
94
|
-
const
|
|
91
|
+
const [, t] = D(), s = _(t, { keys: [r] });
|
|
92
|
+
return (e = s == null ? void 0 : s[r]) != null && e.imageSrc ? s[r].adUrl ? /* @__PURE__ */ a("a", { href: s[r].adUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ a(k, { src: s[r].imageSrc }) }) : /* @__PURE__ */ a(k, { src: s[r].imageSrc }) : null;
|
|
93
|
+
}, ae = ({ isClosing: r, title: e, caption: t, onPlay: s, onClose: c, vastUrl: o, options: l }) => {
|
|
94
|
+
const n = (l == null ? void 0 : l.showPauseButton) ?? !0, { ref: u, focusSelf: i } = F.useFocusable({
|
|
95
95
|
focusKey: "sl-pause-ad-play",
|
|
96
96
|
onEnterRelease: s,
|
|
97
97
|
isFocusBoundary: !0,
|
|
@@ -100,24 +100,23 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
100
100
|
return b(() => {
|
|
101
101
|
u.current && i();
|
|
102
102
|
}, [u, i]), b(() => {
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
103
|
+
const h = (m) => {
|
|
104
|
+
const f = m.keyCode;
|
|
105
|
+
if (f === 461 || f === 10009 || f === 27 || f === 8) {
|
|
106
106
|
m.preventDefault(), m.stopPropagation(), m.stopImmediatePropagation(), c == null || c();
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
return window.addEventListener("keydown",
|
|
111
|
-
}, [c]), /* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */ n(ee, { children: a })
|
|
110
|
+
return window.addEventListener("keydown", h, { capture: !0 }), () => window.removeEventListener("keydown", h, { capture: !0 });
|
|
111
|
+
}, [c]), /* @__PURE__ */ a(O, { className: M(r && "pause-ad-closing"), children: /* @__PURE__ */ I(J, { children: [
|
|
112
|
+
/* @__PURE__ */ a(Q, {}),
|
|
113
|
+
/* @__PURE__ */ a(W, {}),
|
|
114
|
+
/* @__PURE__ */ I(X, { children: [
|
|
115
|
+
/* @__PURE__ */ a(Y, { children: e }),
|
|
116
|
+
/* @__PURE__ */ a(Z, { children: t })
|
|
118
117
|
] }),
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
n && /* @__PURE__ */ a(ee, { children: /* @__PURE__ */ a(
|
|
119
|
+
re,
|
|
121
120
|
{
|
|
122
121
|
ref: u,
|
|
123
122
|
onClick: s,
|
|
@@ -125,27 +124,27 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
125
124
|
"aria-label": "Resume playback"
|
|
126
125
|
}
|
|
127
126
|
) }),
|
|
128
|
-
/* @__PURE__ */ I(
|
|
129
|
-
o && /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ I(se, { children: [
|
|
128
|
+
o && /* @__PURE__ */ a(te, { vastUrl: o }),
|
|
129
|
+
/* @__PURE__ */ a(ne, { children: "ADVERTISEMENT" })
|
|
131
130
|
] })
|
|
132
131
|
] }) });
|
|
133
132
|
}, oe = ({
|
|
134
133
|
showPauseAd: r,
|
|
135
134
|
vastUrls: e,
|
|
136
|
-
title:
|
|
135
|
+
title: t,
|
|
137
136
|
caption: s,
|
|
138
137
|
onPlay: c,
|
|
139
138
|
onClose: o,
|
|
140
139
|
onRender: l,
|
|
141
|
-
options:
|
|
140
|
+
options: n
|
|
142
141
|
}) => {
|
|
143
|
-
const u = (
|
|
142
|
+
const u = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [i, h] = R(!1), [m, f] = R(!1), v = x(), d = e == null ? void 0 : e[0].url, y = x(d);
|
|
144
143
|
y.current = d;
|
|
145
144
|
const [g, A] = D();
|
|
146
145
|
return b(() => {
|
|
147
146
|
if (r && d) {
|
|
148
|
-
|
|
147
|
+
L.emit("exposedPauseAd", {
|
|
149
148
|
action: "enabled",
|
|
150
149
|
payload: {}
|
|
151
150
|
}), g(d).then((P) => {
|
|
@@ -155,7 +154,7 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
155
154
|
});
|
|
156
155
|
const T = () => {
|
|
157
156
|
var P;
|
|
158
|
-
(P = A.get()[y.current]) != null && P.imageSrc ? (clearTimeout(v.current),
|
|
157
|
+
(P = A.get()[y.current]) != null && P.imageSrc ? (clearTimeout(v.current), f(!1), h(!0), L.emit("exposedPauseAd", {
|
|
159
158
|
action: "rendered",
|
|
160
159
|
payload: {}
|
|
161
160
|
})) : v.current = setTimeout(() => {
|
|
@@ -166,11 +165,11 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
166
165
|
T();
|
|
167
166
|
}, u);
|
|
168
167
|
} else
|
|
169
|
-
|
|
168
|
+
L.emit("exposedPauseAd", {
|
|
170
169
|
action: "disabled",
|
|
171
170
|
payload: {}
|
|
172
|
-
}),
|
|
173
|
-
|
|
171
|
+
}), f(!0), v.current = setTimeout(() => {
|
|
172
|
+
h(!1);
|
|
174
173
|
}, 400);
|
|
175
174
|
return () => {
|
|
176
175
|
v.current && clearTimeout(v.current);
|
|
@@ -179,49 +178,49 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
179
178
|
l == null || l({ rendered: i });
|
|
180
179
|
}, [i, l]), b(() => () => {
|
|
181
180
|
l == null || l({ rendered: !1 });
|
|
182
|
-
}, [l]), i ? /* @__PURE__ */
|
|
181
|
+
}, [l]), i ? /* @__PURE__ */ a(
|
|
183
182
|
ae,
|
|
184
183
|
{
|
|
185
184
|
onClose: o,
|
|
186
185
|
isClosing: m,
|
|
187
|
-
title:
|
|
186
|
+
title: t,
|
|
188
187
|
caption: s,
|
|
189
188
|
onPlay: c,
|
|
190
189
|
vastUrl: d,
|
|
191
|
-
options:
|
|
190
|
+
options: n
|
|
192
191
|
}
|
|
193
192
|
) : null;
|
|
194
193
|
}, le = ({
|
|
195
194
|
showPauseAd: r,
|
|
196
195
|
pauseAdVastUrl: e,
|
|
197
|
-
videoPlayerController:
|
|
196
|
+
videoPlayerController: t,
|
|
198
197
|
onRenderPauseAd: s,
|
|
199
198
|
onClosePauseAd: c,
|
|
200
199
|
children: o,
|
|
201
200
|
options: l
|
|
202
201
|
}) => {
|
|
203
|
-
const
|
|
202
|
+
const n = $(), u = j(), i = x(), h = C(() => {
|
|
204
203
|
c == null || c();
|
|
205
204
|
}, [c]), m = C(() => {
|
|
206
|
-
|
|
207
|
-
}, [
|
|
208
|
-
return b(() =>
|
|
209
|
-
i.current &&
|
|
205
|
+
n == null || n.controlVideoPlayer({ play: !0 });
|
|
206
|
+
}, [n]);
|
|
207
|
+
return b(() => n ? (t && (i.current = t, n.addVideoPlayerController(i.current)), () => {
|
|
208
|
+
i.current && n.removeVideoPlayerController(i.current);
|
|
210
209
|
}) : () => {
|
|
211
|
-
}, [
|
|
212
|
-
|
|
210
|
+
}, [n, t]), n ? /* @__PURE__ */ a("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ I(
|
|
211
|
+
q,
|
|
213
212
|
{
|
|
214
213
|
style: { position: "relative" },
|
|
215
214
|
customTheme: u.theme,
|
|
216
215
|
themeMode: u.themeMode,
|
|
217
216
|
children: [
|
|
218
217
|
o,
|
|
219
|
-
e && /* @__PURE__ */
|
|
218
|
+
e && /* @__PURE__ */ a(
|
|
220
219
|
oe,
|
|
221
220
|
{
|
|
222
221
|
showPauseAd: r,
|
|
223
222
|
vastUrls: e,
|
|
224
|
-
onClose:
|
|
223
|
+
onClose: h,
|
|
225
224
|
onRender: s,
|
|
226
225
|
onPlay: m,
|
|
227
226
|
options: l
|
|
@@ -231,18 +230,18 @@ const H = {}, O = new N(), w = V(H), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
231
230
|
}
|
|
232
231
|
) }) : o;
|
|
233
232
|
};
|
|
234
|
-
class pe extends
|
|
233
|
+
class pe extends z {
|
|
235
234
|
constructor(e) {
|
|
236
235
|
super(e), this.state = { hasError: !1 };
|
|
237
236
|
}
|
|
238
237
|
static getDerivedStateFromError() {
|
|
239
238
|
return { hasError: !0 };
|
|
240
239
|
}
|
|
241
|
-
componentDidCatch(e,
|
|
242
|
-
console.error(e,
|
|
240
|
+
componentDidCatch(e, t) {
|
|
241
|
+
console.error(e, t.componentStack);
|
|
243
242
|
}
|
|
244
243
|
render() {
|
|
245
|
-
return this.state.hasError ? this.props.children : /* @__PURE__ */
|
|
244
|
+
return this.state.hasError ? this.props.children : /* @__PURE__ */ a(le, { ...this.props });
|
|
246
245
|
}
|
|
247
246
|
}
|
|
248
247
|
export {
|