@streamlayer/react 1.11.0 → 1.11.1

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+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
16
16
  `+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,f=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,f,a).slice(n.length+2)}).join("")};const N_=b_,Or=Symbol("avvio.TimeTree.untrackNode"),Aa=Symbol("avvio.TimeTree.trackNode"),vr=Symbol("avvio.TimeTree.getParent"),Ar=Symbol("avvio.TimeTree.getNode"),wr=Symbol("avvio.TimeTree.addNode");let I_=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Aa](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])}[Or](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)}[vr](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Ar](e){return this.tableId.get(e)}[wr](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Aa](this.root),this.root.id;const a=this[vr](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[Aa](o),s}start(e,t,n=Date.now()){return this[wr](e,t,n)}stop(e,t=Date.now()){const n=this[Ar](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Or](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(a=>e(a))),n),t=e(this.toJSON());return N_(t)}};var O_=I_,xs={exports:{}},is={exports:{}},wa,Rr;function v_(){if(Rr)return wa;Rr=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;wa=function(u,d){d=d||{};var f=typeof u;if(f==="string"&&u.length>0)return r(u);if(f==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var f=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*s;case"days":case"day":case"d":return f*a;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,f,T){var y=d>=f*1.5;return Math.round(u/f)+" "+T+(y?"s":"")}return wa}function A_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=v_(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,f=null,T,y;function k(...b){if(!k.enabled)return;const h=k,O=Number(new Date),w=O-(d||O);h.diff=w,h.prev=d,h.curr=O,d=O,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let R=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(v,M)=>{if(v==="%%")return"%";R++;const N=n.formatters[M];if(typeof N=="function"){const F=b[R];v=N.call(h,F),b.splice(R,1),R--}return v}),n.formatArgs.call(h,b),(h.log||n.log).apply(h,b)}return k.namespace=u,k.useColors=n.useColors(),k.color=n.selectColor(u),k.extend=a,k.destroy=n.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(T!==n.namespaces&&(T=n.namespaces,y=n.enabled(u)),y),set:b=>{f=b}}),typeof n.init=="function"&&n.init(k),k}function a(u,d){const f=n(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const f=(typeof u=="string"?u:"").split(/[\s,]+/),T=f.length;for(d=0;d<T;d++)f[d]&&(u=f[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,f;for(d=0,f=n.skips.length;d<f;d++)if(n.skips[d].test(u))return!1;for(d=0,f=n.names.length;d<f;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){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 w_=A_;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof B<"u"&&"env"in B&&(l=B.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=w_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(is,is.exports);var Bc=is.exports;const R_=uc,L_=Sc.EventEmitter,M_=ea.inherits,de=Bc("avvio"),{AVV_ERR_READY_TIMEOUT:P_}=Fc,Ra=Symbol.for("plugin-meta");function C_(e,t){return e[Ra]&&e[Ra].name?e[Ra].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 D_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=C_(t,n),this.isAfter=a,this.q=R_(e,U_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}M_(qt,L_);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){de("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return de("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,de("exec",s);let o;const r=l=>{if(a){de("loading complete",s);return}this._error=l,de(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(de("setting up timeout",s,this.timeout),o=setTimeout(function(){de("timed out",s),o=null;const l=new P_(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(de("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(de("rejecting promise",this.name,n),this._promise.reject(n)):(de("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=D_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){de("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){de("finish",this.name,e);const n=()=>{this.loaded||(de("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 a=()=>{if(de("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{de("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else de("delayed",this.name),this.q.drain=()=>{de("drain",this.name),this.q.drain=F_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function U_(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function F_(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var B_=xs.exports;const Lr=uc,G_=Sc.EventEmitter,V_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:q_,AVV_ERR_ROOT_PLG_BOOTED:x_,AVV_ERR_READY_TIMEOUT:H_}=Fc,Q_=O_,cs=B_,Bt=Bc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function Y_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new La(s);if(e[o])throw new La(o);if(e[r])throw new La(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Gc.bind(n)}),e[xn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Pa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(z_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function le(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 le)){const a=new le(e,t,n);return e&&Y_(e,t,a),a}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 Q_,this._readyQ=Lr(this,Vc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Lr(this,W_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new cs(this,j_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function j_(e,t,n){this._doStart=n,t.autostart&&this.start()}V_(le,G_);le.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};le.prototype.override=function(e,t,n){return e};function $_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new q_(typeof e);return e}le.prototype[xn]=!0;le.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};le.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(le.prototype,"then",{get:Gc});le.prototype._addPlugin=function(e,t,n){if(e=$_(e),t=t||{},this.booted)throw new x_;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};le.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Vc.call(this,e,s)}return this};le.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};le.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};le.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};le.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};le.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function Gc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Vc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else K_.call(this,e,a,n,t)}function K_(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new H_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function W_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function z_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Pa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=le;Ls.exports.express=function(e){return le(e,{expose:{use:"load"}})};var J_=Ls.exports;const X_=Oh(J_);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function Z_(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=X_(Object.create({}),{autostart:!1});return r.use(nh,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(Wk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(th,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Tk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(hk),r.use(Xk),r.use(yh),r.use(Gk),r.use(Ih),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const eE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=Z_(e,n,a,{version:"1.11.0",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=ce;exports.QuestionType=D;exports.SdkOverlayType=$;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Gr;exports.useStreamLayerApp=eE;
17
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function D_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=C_(t,n),this.isAfter=a,this.q=R_(e,U_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}M_(qt,L_);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){de("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return de("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,de("exec",s);let o;const r=l=>{if(a){de("loading complete",s);return}this._error=l,de(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(de("setting up timeout",s,this.timeout),o=setTimeout(function(){de("timed out",s),o=null;const l=new P_(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(de("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(de("rejecting promise",this.name,n),this._promise.reject(n)):(de("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=D_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){de("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){de("finish",this.name,e);const n=()=>{this.loaded||(de("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 a=()=>{if(de("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{de("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else de("delayed",this.name),this.q.drain=()=>{de("drain",this.name),this.q.drain=F_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function U_(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function F_(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var B_=xs.exports;const Lr=uc,G_=Sc.EventEmitter,V_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:q_,AVV_ERR_ROOT_PLG_BOOTED:x_,AVV_ERR_READY_TIMEOUT:H_}=Fc,Q_=O_,cs=B_,Bt=Bc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function Y_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new La(s);if(e[o])throw new La(o);if(e[r])throw new La(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Gc.bind(n)}),e[xn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Pa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(z_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function le(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 le)){const a=new le(e,t,n);return e&&Y_(e,t,a),a}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 Q_,this._readyQ=Lr(this,Vc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Lr(this,W_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new cs(this,j_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function j_(e,t,n){this._doStart=n,t.autostart&&this.start()}V_(le,G_);le.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};le.prototype.override=function(e,t,n){return e};function $_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new q_(typeof e);return e}le.prototype[xn]=!0;le.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};le.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(le.prototype,"then",{get:Gc});le.prototype._addPlugin=function(e,t,n){if(e=$_(e),t=t||{},this.booted)throw new x_;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};le.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Vc.call(this,e,s)}return this};le.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};le.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};le.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};le.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};le.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function Gc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Vc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else K_.call(this,e,a,n,t)}function K_(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new H_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function W_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function z_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Pa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=le;Ls.exports.express=function(e){return le(e,{expose:{use:"load"}})};var J_=Ls.exports;const X_=Oh(J_);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function Z_(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=X_(Object.create({}),{autostart:!1});return r.use(nh,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(Wk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(th,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Tk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(hk),r.use(Xk),r.use(yh),r.use(Gk),r.use(Ih),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const eE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=Z_(e,n,a,{version:"1.11.1",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=ce;exports.QuestionType=D;exports.SdkOverlayType=$;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Gr;exports.useStreamLayerApp=eE;
@@ -14,4 +14,4 @@
14
14
  `),c=`
15
15
  `+n+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
16
16
  `+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,f=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,f,a).slice(n.length+2)}).join("")};const N_=b_,Or=Symbol("avvio.TimeTree.untrackNode"),Aa=Symbol("avvio.TimeTree.trackNode"),vr=Symbol("avvio.TimeTree.getParent"),Ar=Symbol("avvio.TimeTree.getNode"),wr=Symbol("avvio.TimeTree.addNode");let I_=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Aa](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])}[Or](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)}[vr](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Ar](e){return this.tableId.get(e)}[wr](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Aa](this.root),this.root.id;const a=this[vr](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[Aa](o),s}start(e,t,n=Date.now()){return this[wr](e,t,n)}stop(e,t=Date.now()){const n=this[Ar](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Or](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(a=>e(a))),n),t=e(this.toJSON());return N_(t)}};var O_=I_,xs={exports:{}},is={exports:{}},wa,Rr;function v_(){if(Rr)return wa;Rr=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;wa=function(u,d){d=d||{};var f=typeof u;if(f==="string"&&u.length>0)return r(u);if(f==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var f=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*s;case"days":case"day":case"d":return f*a;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,f,T){var y=d>=f*1.5;return Math.round(u/f)+" "+T+(y?"s":"")}return wa}function A_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=v_(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,f=null,T,y;function k(...b){if(!k.enabled)return;const h=k,O=Number(new Date),w=O-(d||O);h.diff=w,h.prev=d,h.curr=O,d=O,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let R=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(v,M)=>{if(v==="%%")return"%";R++;const N=n.formatters[M];if(typeof N=="function"){const F=b[R];v=N.call(h,F),b.splice(R,1),R--}return v}),n.formatArgs.call(h,b),(h.log||n.log).apply(h,b)}return k.namespace=u,k.useColors=n.useColors(),k.color=n.selectColor(u),k.extend=a,k.destroy=n.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(T!==n.namespaces&&(T=n.namespaces,y=n.enabled(u)),y),set:b=>{f=b}}),typeof n.init=="function"&&n.init(k),k}function a(u,d){const f=n(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const f=(typeof u=="string"?u:"").split(/[\s,]+/),T=f.length;for(d=0;d<T;d++)f[d]&&(u=f[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,f;for(d=0,f=n.skips.length;d<f;d++)if(n.skips[d].test(u))return!1;for(d=0,f=n.names.length;d<f;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){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 w_=A_;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof B<"u"&&"env"in B&&(l=B.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=w_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(is,is.exports);var Bc=is.exports;const R_=uc,L_=Sc.EventEmitter,M_=ea.inherits,de=Bc("avvio"),{AVV_ERR_READY_TIMEOUT:P_}=Fc,Ra=Symbol.for("plugin-meta");function C_(e,t){return e[Ra]&&e[Ra].name?e[Ra].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 D_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=C_(t,n),this.isAfter=a,this.q=R_(e,U_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}M_(qt,L_);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){de("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return de("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,de("exec",s);let o;const r=l=>{if(a){de("loading complete",s);return}this._error=l,de(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(de("setting up timeout",s,this.timeout),o=setTimeout(function(){de("timed out",s),o=null;const l=new P_(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(de("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(de("rejecting promise",this.name,n),this._promise.reject(n)):(de("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=D_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){de("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){de("finish",this.name,e);const n=()=>{this.loaded||(de("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 a=()=>{if(de("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{de("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else de("delayed",this.name),this.q.drain=()=>{de("drain",this.name),this.q.drain=F_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function U_(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function F_(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var B_=xs.exports;const Lr=uc,G_=Sc.EventEmitter,V_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:q_,AVV_ERR_ROOT_PLG_BOOTED:x_,AVV_ERR_READY_TIMEOUT:H_}=Fc,Q_=O_,cs=B_,Bt=Bc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function Y_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new La(s);if(e[o])throw new La(o);if(e[r])throw new La(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Gc.bind(n)}),e[xn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Pa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(z_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function le(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 le)){const a=new le(e,t,n);return e&&Y_(e,t,a),a}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 Q_,this._readyQ=Lr(this,Vc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Lr(this,W_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new cs(this,j_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function j_(e,t,n){this._doStart=n,t.autostart&&this.start()}V_(le,G_);le.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};le.prototype.override=function(e,t,n){return e};function $_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new q_(typeof e);return e}le.prototype[xn]=!0;le.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};le.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(le.prototype,"then",{get:Gc});le.prototype._addPlugin=function(e,t,n){if(e=$_(e),t=t||{},this.booted)throw new x_;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};le.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Vc.call(this,e,s)}return this};le.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};le.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};le.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};le.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};le.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function Gc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Vc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else K_.call(this,e,a,n,t)}function K_(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new H_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function W_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function z_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Pa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=le;Ls.exports.express=function(e){return le(e,{expose:{use:"load"}})};var J_=Ls.exports;const X_=Oh(J_);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function Z_(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=X_(Object.create({}),{autostart:!1});return r.use(nh,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(Wk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(th,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Tk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(hk),r.use(Xk),r.use(yh),r.use(Gk),r.use(Ih),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const eE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=Z_(e,n,a,{version:"1.11.0",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=ce;exports.QuestionType=D;exports.SdkOverlayType=$;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Gr;exports.useStreamLayerApp=eE;
17
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function D_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=C_(t,n),this.isAfter=a,this.q=R_(e,U_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}M_(qt,L_);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){de("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return de("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,de("exec",s);let o;const r=l=>{if(a){de("loading complete",s);return}this._error=l,de(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(de("setting up timeout",s,this.timeout),o=setTimeout(function(){de("timed out",s),o=null;const l=new P_(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(de("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(de("rejecting promise",this.name,n),this._promise.reject(n)):(de("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=D_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){de("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){de("finish",this.name,e);const n=()=>{this.loaded||(de("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 a=()=>{if(de("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{de("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else de("delayed",this.name),this.q.drain=()=>{de("drain",this.name),this.q.drain=F_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function U_(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function F_(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var B_=xs.exports;const Lr=uc,G_=Sc.EventEmitter,V_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:q_,AVV_ERR_ROOT_PLG_BOOTED:x_,AVV_ERR_READY_TIMEOUT:H_}=Fc,Q_=O_,cs=B_,Bt=Bc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function Y_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new La(s);if(e[o])throw new La(o);if(e[r])throw new La(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Gc.bind(n)}),e[xn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Pa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(z_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function le(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 le)){const a=new le(e,t,n);return e&&Y_(e,t,a),a}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 Q_,this._readyQ=Lr(this,Vc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Lr(this,W_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new cs(this,j_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function j_(e,t,n){this._doStart=n,t.autostart&&this.start()}V_(le,G_);le.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};le.prototype.override=function(e,t,n){return e};function $_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new q_(typeof e);return e}le.prototype[xn]=!0;le.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};le.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(le.prototype,"then",{get:Gc});le.prototype._addPlugin=function(e,t,n){if(e=$_(e),t=t||{},this.booted)throw new x_;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};le.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Vc.call(this,e,s)}return this};le.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};le.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};le.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};le.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};le.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function Gc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Vc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else K_.call(this,e,a,n,t)}function K_(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new H_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function W_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function z_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Pa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=le;Ls.exports.express=function(e){return le(e,{expose:{use:"load"}})};var J_=Ls.exports;const X_=Oh(J_);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function Z_(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=X_(Object.create({}),{autostart:!1});return r.use(nh,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(Wk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(th,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Tk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(hk),r.use(Xk),r.use(yh),r.use(Gk),r.use(Ih),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const eE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=Z_(e,n,a,{version:"1.11.1",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=ce;exports.QuestionType=D;exports.SdkOverlayType=$;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Gr;exports.useStreamLayerApp=eE;
@@ -17978,7 +17978,7 @@ const sE = ({
17978
17978
  f = !0;
17979
17979
  };
17980
17980
  const T = tE(e, n, a, {
17981
- version: "1.11.0",
17981
+ version: "1.11.1",
17982
17982
  onDeepLinkHandled: s,
17983
17983
  videoPlayerController: o,
17984
17984
  onContentActivate: r,
@@ -216,4 +216,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
216
216
  `),y=`
217
217
  `+o+(p.length?c("│"):" ")+" ";return o+f.join(y)+`
218
218
  `+p.map(function(b,C){var _=C===p.length-1,N=b.nodes&&b.nodes.length,L=o+(_?" ":c("│"))+" ";return o+c(_?"└":"├")+c("─")+c(N?"┬":"─")+" "+n(b,L,l).slice(o.length+2)}).join("")};const Vte=Fte,JS=Symbol("avvio.TimeTree.untrackNode"),J5=Symbol("avvio.TimeTree.trackNode"),ew=Symbol("avvio.TimeTree.getParent"),tw=Symbol("avvio.TimeTree.getNode"),nw=Symbol("avvio.TimeTree.addNode");let jte=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[J5](n){this.tableId.set(n.id,n),this.tableLabel.has(n.label)?this.tableLabel.get(n.label).push(n):this.tableLabel.set(n.label,[n])}[JS](n){this.tableId.delete(n.id);const a=this.tableLabel.get(n.label);if(a.id){this.tableLabel.delete(n.label);return}a.pop(),a.length===0&&this.tableLabel.delete(n.label)}[ew](n){if(n===null)return this.root;const a=this.tableLabel.get(n);return a.id?a:a[a.length-1]}[tw](n){return this.tableId.get(n)}[nw](n,a,o){if(n===null)return this.root={id:"root",label:a,start:o,nodes:[]},this[J5](this.root),this.root.id;const l=this[ew](n),c=`${a}-${Math.random()}`,p={id:c,parent:n,start:o,label:a,nodes:[]};return l.nodes.push(p),this[J5](p),c}start(n,a,o=Date.now()){return this[nw](n,a,o)}stop(n,a=Date.now()){const o=this[tw](n);o&&(o.stop=a,o.diff=o.stop-o.start||0,this[JS](o))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const n=o=>(o.label=`${o.label} ${o.diff} ms`,o.nodes.length>0&&(o.nodes=o.nodes.map(l=>n(l))),o),a=n(this.toJSON());return Vte(a)}};var Bte=jte,My={exports:{}},B9={exports:{}},e9,aw;function $te(){if(aw)return e9;aw=1;var n=1e3,a=n*60,o=a*60,l=o*24,c=l*7,p=l*365.25;e9=function(_,N){N=N||{};var L=typeof _;if(L==="string"&&_.length>0)return f(_);if(L==="number"&&isFinite(_))return N.long?b(_):y(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function f(_){if(_=String(_),!(_.length>100)){var N=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(N){var L=parseFloat(N[1]),O=(N[2]||"ms").toLowerCase();switch(O){case"years":case"year":case"yrs":case"yr":case"y":return L*p;case"weeks":case"week":case"w":return L*c;case"days":case"day":case"d":return L*l;case"hours":case"hour":case"hrs":case"hr":case"h":return L*o;case"minutes":case"minute":case"mins":case"min":case"m":return L*a;case"seconds":case"second":case"secs":case"sec":case"s":return L*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return L;default:return}}}}function y(_){var N=Math.abs(_);return N>=l?Math.round(_/l)+"d":N>=o?Math.round(_/o)+"h":N>=a?Math.round(_/a)+"m":N>=n?Math.round(_/n)+"s":_+"ms"}function b(_){var N=Math.abs(_);return N>=l?C(_,N,l,"day"):N>=o?C(_,N,o,"hour"):N>=a?C(_,N,a,"minute"):N>=n?C(_,N,n,"second"):_+" ms"}function C(_,N,L,O){var x=N>=L*1.5;return Math.round(_/L)+" "+O+(x?"s":"")}return e9}function zte(n){o.debug=o,o.default=o,o.coerce=b,o.disable=p,o.enable=c,o.enabled=f,o.humanize=$te(),o.destroy=C,Object.keys(n).forEach(_=>{o[_]=n[_]}),o.names=[],o.skips=[],o.formatters={};function a(_){let N=0;for(let L=0;L<_.length;L++)N=(N<<5)-N+_.charCodeAt(L),N|=0;return o.colors[Math.abs(N)%o.colors.length]}o.selectColor=a;function o(_){let N,L=null,O,x;function D(...j){if(!D.enabled)return;const V=D,Q=Number(new Date),K=Q-(N||Q);V.diff=K,V.prev=N,V.curr=Q,N=Q,j[0]=o.coerce(j[0]),typeof j[0]!="string"&&j.unshift("%O");let re=0;j[0]=j[0].replace(/%([a-zA-Z%])/g,(te,ue)=>{if(te==="%%")return"%";re++;const oe=o.formatters[ue];if(typeof oe=="function"){const Ne=j[re];te=oe.call(V,Ne),j.splice(re,1),re--}return te}),o.formatArgs.call(V,j),(V.log||o.log).apply(V,j)}return D.namespace=_,D.useColors=o.useColors(),D.color=o.selectColor(_),D.extend=l,D.destroy=o.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>L!==null?L:(O!==o.namespaces&&(O=o.namespaces,x=o.enabled(_)),x),set:j=>{L=j}}),typeof o.init=="function"&&o.init(D),D}function l(_,N){const L=o(this.namespace+(typeof N>"u"?":":N)+_);return L.log=this.log,L}function c(_){o.save(_),o.namespaces=_,o.names=[],o.skips=[];let N;const L=(typeof _=="string"?_:"").split(/[\s,]+/),O=L.length;for(N=0;N<O;N++)L[N]&&(_=L[N].replace(/\*/g,".*?"),_[0]==="-"?o.skips.push(new RegExp("^"+_.slice(1)+"$")):o.names.push(new RegExp("^"+_+"$")))}function p(){const _=[...o.names.map(y),...o.skips.map(y).map(N=>"-"+N)].join(",");return o.enable(""),_}function f(_){if(_[_.length-1]==="*")return!0;let N,L;for(N=0,L=o.skips.length;N<L;N++)if(o.skips[N].test(_))return!1;for(N=0,L=o.names.length;N<L;N++)if(o.names[N].test(_))return!0;return!1}function y(_){return _.toString().substring(2,_.toString().length-2).replace(/\.\*\?$/,"*")}function b(_){return _ instanceof Error?_.stack||_.message:_}function C(){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 o.enable(o.load()),o}var Hte=zte;(function(n,a){a.formatArgs=l,a.save=c,a.load=p,a.useColors=o,a.storage=f(),a.destroy=(()=>{let b=!1;return()=>{b||(b=!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`."))}})(),a.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 o(){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(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;b.splice(1,0,C,"color: inherit");let _=0,N=0;b[0].replace(/%[a-zA-Z%]/g,L=>{L!=="%%"&&(_++,L==="%c"&&(N=_))}),b.splice(N,0,C)}a.log=console.debug||console.log||(()=>{});function c(b){try{b?a.storage.setItem("debug",b):a.storage.removeItem("debug")}catch{}}function p(){let b;try{b=a.storage.getItem("debug")}catch{}return!b&&typeof St<"u"&&"env"in St&&(b=St.env.DEBUG),b}function f(){try{return localStorage}catch{}}n.exports=Hte(a);const{formatters:y}=n.exports;y.j=function(b){try{return JSON.stringify(b)}catch(C){return"[UnexpectedJSONParseError]: "+C.message}}})(B9,B9.exports);var ZE=B9.exports;const qte=CE,Gte=xE.EventEmitter,Wte=M6.inherits,Va=ZE("avvio"),{AVV_ERR_READY_TIMEOUT:Qte}=KE,t9=Symbol.for("plugin-meta");function Yte(n,a){return n[t9]&&n[t9].name?n[t9].name:typeof a<"u"&&typeof a!="function"&&a.name?a.name:n.name?n.name:n.toString().split(`
219
- `).slice(0,2).map(o=>o.trim()).join(" -- ")}function Kte(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function L0(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Yte(a,o),this.isAfter=l,this.q=qte(n,Zte,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Wte(L0,Gte);L0.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Va("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Va("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Va("exec",c);let p;const f=b=>{if(l){Va("loading complete",c);return}this._error=b,Va(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Va("setting up timeout",c,this.timeout),p=setTimeout(function(){Va("timed out",c),p=null;const b=new Qte(c);b.fn=o,f(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,f);y&&typeof y.then=="function"&&(Va("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};L0.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Va("rejecting promise",this.name,o),this._promise.reject(o)):(Va("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Kte(),a=this._promise.promise,this.server?n():this.on("start",n)),a};L0.prototype.enqueue=function(n,a){Va("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};L0.prototype.finish=function(n,a){Va("finish",this.name,n);const o=()=>{this.loaded||(Va("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Va("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Va("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Va("delayed",this.name),this.q.drain=()=>{Va("drain",this.name),this.q.drain=Xte,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Zte(n,a){const o=this;St.nextTick(Dy.bind(o),n,a)}function Dy(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,Dy.call(this,n,a)},a);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),a(c)})})}function Xte(){}My.exports=L0;My.exports.loadPlugin=Dy;var Jte=My.exports;const rw=CE,ene=xE.EventEmitter,tne=M6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:n9,AVV_ERR_CALLBACK_NOT_FN:l2,AVV_ERR_PLUGIN_NOT_VALID:nne,AVV_ERR_ROOT_PLG_BOOTED:ane,AVV_ERR_READY_TIMEOUT:rne}=KE,one=Bte,$9=Jte,w0=ZE("avvio"),b6=Symbol("kAvvio"),a9=Symbol("kThenifyDoNotWrap");function sne(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new n9(c);if(n[p])throw new n9(p);if(n[f])throw new n9(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:XE.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(r9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new l2(f,typeof C);return o.ready(C?r9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new l2(y,typeof C);return o.onClose(dne(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new l2(b,typeof C);return C?(o.close(r9(C,this)),this):o.close()}}function Ca(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof Ca)){const l=new Ca(n,a,o);return n&&sne(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new one,this._readyQ=rw(this,JE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=ow},this._closeQ=rw(this,cne,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=ow},this._doStart=null,this._root=new $9(this,ine.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),$9.loadPlugin.call(this,this._root,l=>{w0("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function ine(n,a,o){this._doStart=o,a.autostart&&this.start()}tne(Ca,ene);Ca.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};Ca.prototype.override=function(n,a,o){return n};function lne(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new nne(typeof n);return n}Ca.prototype[b6]=!0;Ca.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};Ca.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(Ca.prototype,"then",{get:XE});Ca.prototype._addPlugin=function(n,a,o){if(n=lne(n),a=a||{},this.booted)throw new ane;const l=this._current[0],c=new $9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};Ca.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){JE.call(this,n,c)}return this};Ca.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};Ca.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new l2("close",typeof n)}else a=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),a};Ca.prototype.ready=function(n){if(n){if(typeof n!="function")throw new l2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};Ca.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ca.prototype.toJSON=function(){return this.pluginTree.toJSON()};function ow(){}function XE(){if(this.booted){w0("thenify returning null because we are already booted");return}if(this[a9]){this[a9]=!1;return}return w0("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[a9]=!0,n(this._server)),a)}function JE(n,a){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else une.call(this,n,l,o,a)}function une(n,a,o,l){const c=n.name;w0("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{w0("timed out",c),p=null;const y=new rne(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function cne(n,a){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(w0("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function dne(n,a){return o.bind(a);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function r9(n,a){return o.bind(a);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}Cy.exports=Ca;Cy.exports.express=function(n){return Ca(n,{expose:{use:"load"}})};var mne=Cy.exports;const fne=BJ(mne);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function pne(n,a=!0,o=!0,l={friendsTab:"enabled"}){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=fne(Object.create({}),{autostart:!1});return f.use(yJ,{friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),f.use(cJ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(pJ,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(gJ,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),f.use(RX,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(PX),f.use(fJ),f.use(LJ),f.use(eJ),f.use(jJ),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const hne=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C})=>{const[_,N]=W.useState(null);return W.useEffect(()=>{let L=!1;if(!n)return console.error("streamlayer sdk key should be provided"),N(x=>(x!==null&&typeof x.disableApp=="function"&&x.disableApp(),null)),()=>{L=!0};const O=pne(n,o,l,{version:"1.11.0",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C});if(a)for(const x of a)O.use(x);return O.ready().then(x=>{L||(N(x.sdk),typeof window<"u")}).catch(x=>console.log(x)),()=>{L=!0,O.close(function(x){if(x)throw x})}},[n,o]),_},gne=({event:n})=>{const a=Uy(),o=Tne();return W.useEffect(()=>(a&&(n&&(a.createEventSession(n),o&&(o.current=n)),!n&&(o!=null&&o.current)&&(a.createEventSession(""),o.current="")),()=>{a&&a.disableApp()}),[n,o,a]),null};var e_=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(e_||{});const yne={status:0,sdk:null},j6=W.createContext(yne),vne=({sdkKey:n,theme:a,themeMode:o,plugins:l,children:c,event:p,production:f=!0,autoEnable:y=!0,withAdNotification:b,withAd:C=!0,friendsTab:_="enabled",onDeepLinkHandled:N,videoPlayerController:L,onContentActivate:O})=>{const x=hne({sdkKey:n,plugins:l,production:f,autoEnable:y,onDeepLinkHandled:N,videoPlayerController:L,onContentActivate:O,withAdNotification:b,withAd:C,friendsTab:_}),D=W.useRef(""),j=W.useMemo(()=>x?{sdk:x,status:2,event:D}:{status:1,sdk:null,event:D},[x]);return W.useEffect(()=>{x&&(x.options.setKey("friendsTab",_),x.options.setKey("theme",a),x.options.setKey("themeMode",o))},[x,_,a,o]),W.useEffect(()=>()=>{N&&(x==null||x.removeDeepLinkHandler(N)),L&&(x==null||x.removeVideoPlayerController(L))},[x]),W.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!N,videoPlayerController:!!L})},[n,N,L]),w.jsxs(j6.Provider,{value:j,children:[p!==void 0&&w.jsx(gne,{event:p}),c]})},Uy=()=>{const{sdk:n}=W.useContext(j6);return n},Tne=()=>{const{event:n}=W.useContext(j6);return n},bne=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(vne,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),kne=({children:n,overlays:a})=>{const{sdk:o,status:l}=W.useContext(j6);return l===e_.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(jC,{style:{height:"100%"},children:w.jsx(WG,{sdk:o,overlays:a,children:n})})}):n({})};class Sne extends W.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(kne,{...this.props})}}const wne=({token:n,schema:a})=>{const o=Uy();return W.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n),o&&(o.withAuth=!0)},[n,a,o]),null},Cne=()=>{const n=Uy();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(jC,{children:w.jsx(aW,{sdk:n})})}):null};exports.A=ca;exports.C=LC;exports.C$1=lj;exports.M=gy;exports.MastersStreamLayerProvider=bne;exports.MastersStreamLayerSDKReact=Sne;exports.O=ly;exports.S=PC;exports.S$1=cj;exports.StreamLayerLogin=wne;exports.StreamLayerSDKPoints=Cne;exports.T=hy;exports.b=RC;exports.cx_default=ku;exports.d=dj;exports.k=DC;exports.l=sj;exports.m=o2;exports.m$1=oj;exports.n=cy;exports.p=oW;exports.styled_default=P;exports.useStore=Ut;exports.useTransition=cw;exports.z=jz;
219
+ `).slice(0,2).map(o=>o.trim()).join(" -- ")}function Kte(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function L0(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Yte(a,o),this.isAfter=l,this.q=qte(n,Zte,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Wte(L0,Gte);L0.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Va("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Va("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Va("exec",c);let p;const f=b=>{if(l){Va("loading complete",c);return}this._error=b,Va(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Va("setting up timeout",c,this.timeout),p=setTimeout(function(){Va("timed out",c),p=null;const b=new Qte(c);b.fn=o,f(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,f);y&&typeof y.then=="function"&&(Va("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};L0.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Va("rejecting promise",this.name,o),this._promise.reject(o)):(Va("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Kte(),a=this._promise.promise,this.server?n():this.on("start",n)),a};L0.prototype.enqueue=function(n,a){Va("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};L0.prototype.finish=function(n,a){Va("finish",this.name,n);const o=()=>{this.loaded||(Va("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Va("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Va("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Va("delayed",this.name),this.q.drain=()=>{Va("drain",this.name),this.q.drain=Xte,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Zte(n,a){const o=this;St.nextTick(Dy.bind(o),n,a)}function Dy(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,Dy.call(this,n,a)},a);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),a(c)})})}function Xte(){}My.exports=L0;My.exports.loadPlugin=Dy;var Jte=My.exports;const rw=CE,ene=xE.EventEmitter,tne=M6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:n9,AVV_ERR_CALLBACK_NOT_FN:l2,AVV_ERR_PLUGIN_NOT_VALID:nne,AVV_ERR_ROOT_PLG_BOOTED:ane,AVV_ERR_READY_TIMEOUT:rne}=KE,one=Bte,$9=Jte,w0=ZE("avvio"),b6=Symbol("kAvvio"),a9=Symbol("kThenifyDoNotWrap");function sne(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new n9(c);if(n[p])throw new n9(p);if(n[f])throw new n9(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:XE.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(r9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new l2(f,typeof C);return o.ready(C?r9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new l2(y,typeof C);return o.onClose(dne(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new l2(b,typeof C);return C?(o.close(r9(C,this)),this):o.close()}}function Ca(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof Ca)){const l=new Ca(n,a,o);return n&&sne(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new one,this._readyQ=rw(this,JE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=ow},this._closeQ=rw(this,cne,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=ow},this._doStart=null,this._root=new $9(this,ine.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),$9.loadPlugin.call(this,this._root,l=>{w0("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function ine(n,a,o){this._doStart=o,a.autostart&&this.start()}tne(Ca,ene);Ca.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};Ca.prototype.override=function(n,a,o){return n};function lne(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new nne(typeof n);return n}Ca.prototype[b6]=!0;Ca.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};Ca.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(Ca.prototype,"then",{get:XE});Ca.prototype._addPlugin=function(n,a,o){if(n=lne(n),a=a||{},this.booted)throw new ane;const l=this._current[0],c=new $9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};Ca.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){JE.call(this,n,c)}return this};Ca.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};Ca.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new l2("close",typeof n)}else a=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),a};Ca.prototype.ready=function(n){if(n){if(typeof n!="function")throw new l2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};Ca.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ca.prototype.toJSON=function(){return this.pluginTree.toJSON()};function ow(){}function XE(){if(this.booted){w0("thenify returning null because we are already booted");return}if(this[a9]){this[a9]=!1;return}return w0("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[a9]=!0,n(this._server)),a)}function JE(n,a){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else une.call(this,n,l,o,a)}function une(n,a,o,l){const c=n.name;w0("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{w0("timed out",c),p=null;const y=new rne(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function cne(n,a){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(w0("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function dne(n,a){return o.bind(a);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function r9(n,a){return o.bind(a);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}Cy.exports=Ca;Cy.exports.express=function(n){return Ca(n,{expose:{use:"load"}})};var mne=Cy.exports;const fne=BJ(mne);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function pne(n,a=!0,o=!0,l={friendsTab:"enabled"}){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=fne(Object.create({}),{autostart:!1});return f.use(yJ,{friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),f.use(cJ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(pJ,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(gJ,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),f.use(RX,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(PX),f.use(fJ),f.use(LJ),f.use(eJ),f.use(jJ),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const hne=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C})=>{const[_,N]=W.useState(null);return W.useEffect(()=>{let L=!1;if(!n)return console.error("streamlayer sdk key should be provided"),N(x=>(x!==null&&typeof x.disableApp=="function"&&x.disableApp(),null)),()=>{L=!0};const O=pne(n,o,l,{version:"1.11.1",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C});if(a)for(const x of a)O.use(x);return O.ready().then(x=>{L||(N(x.sdk),typeof window<"u")}).catch(x=>console.log(x)),()=>{L=!0,O.close(function(x){if(x)throw x})}},[n,o]),_},gne=({event:n})=>{const a=Uy(),o=Tne();return W.useEffect(()=>(a&&(n&&(a.createEventSession(n),o&&(o.current=n)),!n&&(o!=null&&o.current)&&(a.createEventSession(""),o.current="")),()=>{a&&a.disableApp()}),[n,o,a]),null};var e_=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(e_||{});const yne={status:0,sdk:null},j6=W.createContext(yne),vne=({sdkKey:n,theme:a,themeMode:o,plugins:l,children:c,event:p,production:f=!0,autoEnable:y=!0,withAdNotification:b,withAd:C=!0,friendsTab:_="enabled",onDeepLinkHandled:N,videoPlayerController:L,onContentActivate:O})=>{const x=hne({sdkKey:n,plugins:l,production:f,autoEnable:y,onDeepLinkHandled:N,videoPlayerController:L,onContentActivate:O,withAdNotification:b,withAd:C,friendsTab:_}),D=W.useRef(""),j=W.useMemo(()=>x?{sdk:x,status:2,event:D}:{status:1,sdk:null,event:D},[x]);return W.useEffect(()=>{x&&(x.options.setKey("friendsTab",_),x.options.setKey("theme",a),x.options.setKey("themeMode",o))},[x,_,a,o]),W.useEffect(()=>()=>{N&&(x==null||x.removeDeepLinkHandler(N)),L&&(x==null||x.removeVideoPlayerController(L))},[x]),W.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!N,videoPlayerController:!!L})},[n,N,L]),w.jsxs(j6.Provider,{value:j,children:[p!==void 0&&w.jsx(gne,{event:p}),c]})},Uy=()=>{const{sdk:n}=W.useContext(j6);return n},Tne=()=>{const{event:n}=W.useContext(j6);return n},bne=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(vne,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),kne=({children:n,overlays:a})=>{const{sdk:o,status:l}=W.useContext(j6);return l===e_.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(jC,{style:{height:"100%"},children:w.jsx(WG,{sdk:o,overlays:a,children:n})})}):n({})};class Sne extends W.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(kne,{...this.props})}}const wne=({token:n,schema:a})=>{const o=Uy();return W.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n),o&&(o.withAuth=!0)},[n,a,o]),null},Cne=()=>{const n=Uy();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(jC,{children:w.jsx(aW,{sdk:n})})}):null};exports.A=ca;exports.C=LC;exports.C$1=lj;exports.M=gy;exports.MastersStreamLayerProvider=bne;exports.MastersStreamLayerSDKReact=Sne;exports.O=ly;exports.S=PC;exports.S$1=cj;exports.StreamLayerLogin=wne;exports.StreamLayerSDKPoints=Cne;exports.T=hy;exports.b=RC;exports.cx_default=ku;exports.d=dj;exports.k=DC;exports.l=sj;exports.m=o2;exports.m$1=oj;exports.n=cy;exports.p=oW;exports.styled_default=P;exports.useStore=Ut;exports.useTransition=cw;exports.z=jz;
@@ -42552,7 +42552,7 @@ const Cne = ({
42552
42552
  L = !0;
42553
42553
  };
42554
42554
  const O = wne(n, o, l, {
42555
- version: "1.11.0",
42555
+ version: "1.11.1",
42556
42556
  onDeepLinkHandled: c,
42557
42557
  videoPlayerController: p,
42558
42558
  onContentActivate: f,
@@ -17978,7 +17978,7 @@ const sE = ({
17978
17978
  f = !0;
17979
17979
  };
17980
17980
  const T = tE(e, n, a, {
17981
- version: "1.11.0",
17981
+ version: "1.11.1",
17982
17982
  onDeepLinkHandled: s,
17983
17983
  videoPlayerController: o,
17984
17984
  onContentActivate: r,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "type": "module",
5
5
  "author": "StreamLayer, Inc (https://streamlayer.io)",
6
6
  "maintainers": [
@@ -123,18 +123,18 @@
123
123
  }
124
124
  ],
125
125
  "dependencies": {
126
- "@streamlayer/sdk-web": "^1.7.1",
127
- "@streamlayer/feature-gamification": "^1.13.1",
128
- "@streamlayer/sdk-web-api": "^1.6.18",
129
- "@streamlayer/sdk-web-core": "^1.9.1",
130
- "@streamlayer/sdk-web-analytics": "^1.5.5",
131
- "@streamlayer/sdk-web-features": "^1.0.39",
132
- "@streamlayer/sdk-web-interfaces": "^1.4.5",
133
- "@streamlayer/sdk-web-notifications": "^1.3.1",
134
- "@streamlayer/sdk-web-logger": "^1.0.39",
135
- "@streamlayer/sdk-web-storage": "^1.0.39",
136
- "@streamlayer/react-polyfills": "^0.0.1",
137
- "@streamlayer/sdk-web-types": "^1.9.1"
126
+ "@streamlayer/sdk-web": "^1.7.2",
127
+ "@streamlayer/sdk-web-analytics": "^1.5.6",
128
+ "@streamlayer/feature-gamification": "^1.13.2",
129
+ "@streamlayer/sdk-web-api": "^1.6.19",
130
+ "@streamlayer/sdk-web-core": "^1.9.2",
131
+ "@streamlayer/sdk-web-features": "^1.0.40",
132
+ "@streamlayer/sdk-web-interfaces": "^1.4.6",
133
+ "@streamlayer/sdk-web-logger": "^1.0.40",
134
+ "@streamlayer/sdk-web-notifications": "^1.3.2",
135
+ "@streamlayer/sdk-web-storage": "^1.0.40",
136
+ "@streamlayer/react-polyfills": "^0.1.0",
137
+ "@streamlayer/sdk-web-types": "^1.9.2"
138
138
  },
139
139
  "peerDependencies": {
140
140
  "@bufbuild/protobuf": "^1.10.0",
@@ -190,7 +190,7 @@
190
190
  "size-limit": "^11.1.6",
191
191
  "url-loader": "^4.1.1",
192
192
  "vite-plugin-dts": "^4.2.3",
193
- "@streamlayer/react-ui": "^1.16.0"
193
+ "@streamlayer/react-ui": "^1.16.1"
194
194
  },
195
195
  "scripts": {
196
196
  "size-limit": "size-limit"