@streamlayer/react 1.18.1 → 1.18.3

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.
@@ -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 fR=FR,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 NR=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 fR(t)}};var YR=NR,ri={exports:{}},Wo={exports:{}},zl,bc;function IR(){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 UR(e){n.debug=n,n.default=n,n.coerce=s,n.disable=i,n.enable=o,n.enabled=a,n.humanize=IR(),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 BR=UR;(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=BR(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 CR=Hs,JR=tr.EventEmitter,vR=rl.inherits,Ze=Wr("avvio"),{AVV_ERR_READY_TIMEOUT:TR}=gr,wl=Symbol.for("plugin-meta");function kR(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 QR(){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=kR(t,n),this.isAfter=l,this.q=CR(e,zR,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vR(jt,JR);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 TR(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=QR(),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=wR,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zR(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 wR(){}ri.exports=jt;ri.exports.loadPlugin=di;var KR=ri.exports;const Vc=Hs,LR=tr.EventEmitter,xR=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Kl,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MR,AVV_ERR_ROOT_PLG_BOOTED:HR,AVV_ERR_READY_TIMEOUT:OR}=gr,DR=YR,Zo=KR,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Ll=Symbol("kThenifyDoNotWrap");function jR(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 Kl(o);if(e[i])throw new Kl(i);if(e[a])throw new Kl(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 Re(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 Re)){const l=new Re(e,t,n);return e&&jR(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 DR,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$R,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PR.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 PR(e,t,n){this._doStart=n,t.autostart&&this.start()}xR(Re,LR);Re.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Re.prototype.override=function(e,t,n){return e};function _R(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MR(typeof e);return e}Re.prototype[qn]=!0;Re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Re.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(Re.prototype,"then",{get:Zr});Re.prototype._addPlugin=function(e,t,n){if(e=_R(e),t=t||{},this.booted)throw new HR;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};Re.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};Re.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};Re.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};Re.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)}})};Re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Re.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[Ll]){this[Ll]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ll]=!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 qR.call(this,e,l,n,t)}function qR(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 OR(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 $R(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=Re;qo.exports.express=function(e){return Re(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")}),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.18.1",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=Lu;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=be;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 QR(){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=kR(t,n),this.isAfter=l,this.q=CR(e,zR,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vR(jt,JR);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 TR(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=QR(),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=wR,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zR(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 wR(){}ri.exports=jt;ri.exports.loadPlugin=di;var KR=ri.exports;const Vc=Hs,LR=tr.EventEmitter,xR=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Kl,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MR,AVV_ERR_ROOT_PLG_BOOTED:HR,AVV_ERR_READY_TIMEOUT:OR}=gr,DR=YR,Zo=KR,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Ll=Symbol("kThenifyDoNotWrap");function jR(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 Kl(o);if(e[i])throw new Kl(i);if(e[a])throw new Kl(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 Re(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 Re)){const l=new Re(e,t,n);return e&&jR(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 DR,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$R,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PR.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 PR(e,t,n){this._doStart=n,t.autostart&&this.start()}xR(Re,LR);Re.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Re.prototype.override=function(e,t,n){return e};function _R(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MR(typeof e);return e}Re.prototype[qn]=!0;Re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Re.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(Re.prototype,"then",{get:Zr});Re.prototype._addPlugin=function(e,t,n){if(e=_R(e),t=t||{},this.booted)throw new HR;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};Re.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};Re.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};Re.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};Re.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)}})};Re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Re.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[Ll]){this[Ll]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ll]=!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 qR.call(this,e,l,n,t)}function qR(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 OR(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 $R(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=Re;qo.exports.express=function(e){return Re(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")}),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.18.3",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=Lu;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=be;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;