@streamlayer/web-os 0.3.3 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index2.js +1 -1
- package/lib/classic/cjs/classic.js +1 -1
- package/lib/classic/cjs/classic2.js +4 -4
- package/lib/classic/cjs/gamification-feature2.js +1 -1
- package/lib/classic/cjs/index2.js +1 -1
- package/lib/classic/es/classic.js +2 -2
- package/lib/classic/es/classic2.js +8992 -9348
- package/lib/classic/es/gamification-feature2.js +2 -2
- package/lib/classic/es/index2.js +1 -1
- package/lib/es/index2.js +1 -1
- package/package.json +16 -17
package/lib/cjs/index2.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
`),o=`
|
|
17
17
|
`+n+(a.length?l("│"):" ")+" ";return n+i.join(o)+`
|
|
18
18
|
`+a.map(function(s,c){var u=c===a.length-1,d=s.nodes&&s.nodes.length,g=n+(u?" ":l("│"))+" ";return n+l(u?"└":"├")+l("─")+l(d?"┬":"─")+" "+e(s,g,r).slice(n.length+2)}).join("")};const yre=bre,tS=Symbol("avvio.TimeTree.untrackNode"),$9=Symbol("avvio.TimeTree.trackNode"),nS=Symbol("avvio.TimeTree.getParent"),rS=Symbol("avvio.TimeTree.getNode"),lS=Symbol("avvio.TimeTree.addNode");let Vre=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[$9](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])}[tS](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)}[nS](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[rS](e){return this.tableId.get(e)}[lS](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[$9](this.root),this.root.id;const r=this[nS](e),l=`${t}-${Math.random()}`,a={id:l,parent:e,start:n,label:t,nodes:[]};return r.nodes.push(a),this[$9](a),l}start(e,t,n=Date.now()){return this[lS](e,t,n)}stop(e,t=Date.now()){const n=this[rS](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[tS](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(r=>e(r))),n),t=e(this.toJSON());return yre(t)}};var Rre=Vre,My={exports:{}},mg={exports:{}},q9,aS;function Ere(){if(aS)return q9;aS=1;var e=1e3,t=e*60,n=t*60,r=n*24,l=r*7,a=r*365.25;q9=function(u,d){d=d||{};var g=typeof u;if(g==="string"&&u.length>0)return i(u);if(g==="number"&&isFinite(u))return d.long?s(u):o(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function i(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 g=parseFloat(d[1]),p=(d[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return g*a;case"weeks":case"week":case"w":return g*l;case"days":case"day":case"d":return g*r;case"hours":case"hour":case"hrs":case"hr":case"h":return g*n;case"minutes":case"minute":case"mins":case"min":case"m":return g*t;case"seconds":case"second":case"secs":case"sec":case"s":return g*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function o(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"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 s(u){var d=Math.abs(u);return d>=r?c(u,d,r,"day"):d>=n?c(u,d,n,"hour"):d>=t?c(u,d,t,"minute"):d>=e?c(u,d,e,"second"):u+" ms"}function c(u,d,g,p){var V=d>=g*1.5;return Math.round(u/g)+" "+p+(V?"s":"")}return q9}function Are(e){n.debug=n,n.default=n,n.coerce=s,n.disable=a,n.enable=l,n.enabled=i,n.humanize=Ere(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let g=0;g<u.length;g++)d=(d<<5)-d+u.charCodeAt(g),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,g=null,p,V;function y(...E){if(!y.enabled)return;const h=y,f=Number(new Date),b=f-(d||f);h.diff=b,h.prev=d,h.curr=f,d=f,E[0]=n.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let A=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(N,C)=>{if(N==="%%")return"%";A++;const S=n.formatters[C];if(typeof S=="function"){const I=E[A];N=S.call(h,I),E.splice(A,1),A--}return N}),n.formatArgs.call(h,E),(h.log||n.log).apply(h,E)}return y.namespace=u,y.useColors=n.useColors(),y.color=n.selectColor(u),y.extend=r,y.destroy=n.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(p!==n.namespaces&&(p=n.namespaces,V=n.enabled(u)),V),set:E=>{g=E}}),typeof n.init=="function"&&n.init(y),y}function r(u,d){const g=n(this.namespace+(typeof d>"u"?":":d)+u);return g.log=this.log,g}function l(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const g=(typeof u=="string"?u:"").split(/[\s,]+/),p=g.length;for(d=0;d<p;d++)g[d]&&(u=g[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function a(){const u=[...n.names.map(o),...n.skips.map(o).map(d=>"-"+d)].join(",");return n.enable(""),u}function i(u){if(u[u.length-1]==="*")return!0;let d,g;for(d=0,g=n.skips.length;d<g;d++)if(n.skips[d].test(u))return!1;for(d=0,g=n.names.length;d<g;d++)if(n.names[d].test(u))return!0;return!1}function o(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function s(u){return u instanceof Error?u.stack||u.message:u}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 n.enable(n.load()),n}var Cre=Are;(function(e,t){t.formatArgs=r,t.save=l,t.load=a,t.useColors=n,t.storage=i(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;s.splice(1,0,c,"color: inherit");let u=0,d=0;s[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(u++,g==="%c"&&(d=u))}),s.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function l(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function a(){let s;try{s=t.storage.getItem("debug")}catch{}return!s&&typeof Fe<"u"&&"env"in Fe&&(s=Fe.env.DEBUG),s}function i(){try{return localStorage}catch{}}e.exports=Cre(t);const{formatters:o}=e.exports;o.j=function(s){try{return JSON.stringify(s)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(mg,mg.exports);var FY=mg.exports;const vre=rY,Sre=hY.EventEmitter,Nre=h5.inherits,nn=FY("avvio"),{AVV_ERR_READY_TIMEOUT:Zre}=IY,eh=Symbol.for("plugin-meta");function Wre(e,t){return e[eh]&&e[eh].name?e[eh].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
19
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function Ire(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function T1(e,t,n,r,l){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=l===void 0?e._timeout:l,this.name=Wre(t,n),this.isAfter=r,this.q=vre(e,Fre,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Nre(T1,Sre);T1.prototype.exec=function(e,t){const n=this.func;let r=!1;const l=this.name;if(this.parent._error&&!this.isAfter){nn("skipping loading of plugin as parent errored and it is not an after",l),Fe.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return nn("override errored",l),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,nn("exec",l);let a;const i=s=>{if(r){nn("loading complete",l);return}this._error=s,nn(s?"exec errored":"exec completed",l),r=!0,a&&clearTimeout(a),t(s)};this.timeout>0&&(nn("setting up timeout",l,this.timeout),a=setTimeout(function(){nn("timed out",l),a=null;const s=new Zre(l);s.fn=n,i(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const o=n(this.server,this.opts,i);o&&typeof o.then=="function"&&(nn("exec: resolving promise",l),o.then(()=>Fe.nextTick(i),s=>Fe.nextTick(i,s)))};T1.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,r)=>{this._error=n,this.q.pause(),n?(nn("rejecting promise",this.name,n),this._promise.reject(n)):(nn("resolving promise",this.name),this._promise.resolve()),this._promise=null,Fe.nextTick(r,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Ire(),t=this._promise.promise,this.server?e():this.on("start",e)),t};T1.prototype.enqueue=function(e,t){nn("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};T1.prototype.finish=function(e,t){nn("finish",this.name,e);const n=()=>{this.loaded||(nn("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 r=()=>{if(nn("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const l=()=>{nn("wrap"),queueMicrotask(r)};this._promise.resolve(),this._promise.promise.then(l,l),this._promise=null}else n();else nn("delayed",this.name),this.q.drain=()=>{nn("drain",this.name),this.q.drain=Ure,queueMicrotask(r)}};queueMicrotask(r),this.q.resume()};function Fre(e,t){const n=this;Fe.nextTick(zy.bind(n),e,t)}function zy(e,t){if(typeof e.func.then=="function"){e.func.then(r=>{typeof r.default=="function"&&(r=r.default),e.func=r,zy.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,r=>{e.finish(r,l=>{this._current.shift(),t(l)})})}function Ure(){}My.exports=T1;My.exports.loadPlugin=zy;var Gre=My.exports;const iS=rY,Xre=hY.EventEmitter,Bre=h5.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:th,AVV_ERR_CALLBACK_NOT_FN:Lc,AVV_ERR_PLUGIN_NOT_VALID:wre,AVV_ERR_ROOT_PLG_BOOTED:Tre,AVV_ERR_READY_TIMEOUT:Yre}=IY,kre=Rre,gg=Gre,b1=FY("avvio"),_2=Symbol("kAvvio"),nh=Symbol("kThenifyDoNotWrap");function Lre(e,t,n){const r=t.expose||{},l=r.use||"use",a=r.after||"after",i=r.ready||"ready",o=r.onClose||"onClose",s=r.close||"close";if(e[l])throw new th(l);if(e[a])throw new th(a);if(e[i])throw new th(i);e[l]=function(c,u){return n.use(c,u),this},Object.defineProperty(e,"then",{get:UY.bind(n)}),e[_2]=!0,e[a]=function(c){return typeof c!="function"?n._loadRegistered():(n.after(rh(c,this)),this)},e[i]=function(c){if(c&&typeof c!="function")throw new Lc(i,typeof c);return n.ready(c?rh(c,this):void 0)},e[o]=function(c){if(typeof c!="function")throw new Lc(o,typeof c);return n.onClose(Mre(c,this)),this},e[s]=function(c){if(c&&typeof c!="function")throw new Lc(s,typeof c);return c?(n.close(rh(c,this)),this):n.close()}}function _t(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 _t)){const r=new _t(e,t,n);return e&&Lre(e,t,r),r}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 kre,this._readyQ=iS(this,GY,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=oS},this._closeQ=iS(this,Kre,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=oS},this._doStart=null,this._root=new gg(this,xre.bind(this),t,!1,0),this._root.once("start",(r,l,a)=>{const i=this.pluginTree.start(null,l,a);this._root.once("loaded",(o,s,c)=>{this.pluginTree.stop(i,c)})}),gg.loadPlugin.call(this,this._root,r=>{b1("root plugin ready");try{this.emit("preReady"),this._root=null}catch(l){r=r||this._error||l}if(r){if(this._error=r,this._readyQ.length()===0)throw r}else this.booted=!0;this._readyQ.resume()})}function xre(e,t,n){this._doStart=n,t.autostart&&this.start()}Bre(_t,Xre);_t.prototype.start=function(){return this.started=!0,Fe.nextTick(this._doStart),this};_t.prototype.override=function(e,t,n){return e};function Jre(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new wre(typeof e);return e}_t.prototype[_2]=!0;_t.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};_t.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&Fe.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(_t.prototype,"then",{get:UY});_t.prototype._addPlugin=function(e,t,n){if(e=Jre(e),t=t||{},this.booted)throw new Tre;const r=this._current[0],l=new gg(this,e,t,n);if(l.once("start",(a,i,o)=>{const s=this.pluginTree.start(r.name,i,o);l.once("loaded",(c,u,d)=>{this.pluginTree.stop(s,d)})}),r.loaded)throw new Error(l.name,r.name);return r.enqueue(l,a=>{a&&(this._error=a)}),l};_t.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,r,l){GY.call(this,e,l)}return this};_t.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};_t.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Lc("close",typeof e)}else t=new Promise(function(n,r){e=function(l){if(l)return r(l);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),Fe.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};_t.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Lc("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(l),this.start();const r=this._current[0].server;function l(a,i,o){a?n(a):t(r),Fe.nextTick(o)}})};_t.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};_t.prototype.toJSON=function(){return this.pluginTree.toJSON()};function oS(){}function UY(){if(this.booted){b1("thenify returning null because we are already booted");return}if(this[nh]){this[nh]=!1;return}return b1("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[nh]=!0,e(this._server)),t)}function GY(e,t){const n=this._server,r=this._error;let l;if(this._error=null,e.length===0)this._error=r,l=e(),l&&!l[_2]&&typeof l.then=="function"?l.then(()=>Fe.nextTick(t),a=>Fe.nextTick(t,a)):Fe.nextTick(t);else if(e.length===1)l=e(r),l&&!l[_2]&&typeof l.then=="function"?l.then(()=>Fe.nextTick(t),a=>Fe.nextTick(t,a)):Fe.nextTick(t);else if(this._timeout===0){const a=i=>{this._error=i,t(this._error)};e.length===2?e(r,a):e(r,n,a)}else Qre.call(this,e,r,n,t)}function Qre(e,t,n,r){const l=e.name;b1("setting up ready timeout",l,this._timeout);let a=setTimeout(()=>{b1("timed out",l),a=null;const o=new Yre(l);o.fn=e,this._error=o,r(o)},this._timeout);e.length===2?e(t,i.bind(this)):e(t,n,i.bind(this));function i(o){a&&(clearTimeout(a),this._error=o,r(this._error))}}function Kre(e,t){const n=this._server,r=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let l;r?l=e(n):l=e(this._error),l&&typeof l.then=="function"?(b1("resolving close/onClose promise"),l.then(()=>Fe.nextTick(t),a=>Fe.nextTick(t,a))):Fe.nextTick(t)}else e.length===2?e(r?n:this._error,t):r?e(n,t):e(this._error,n,t)}function Mre(e,t){return n.bind(t);function n(r,l){let a;e.length===0?(a=e(),a&&a.then?a.then(function(){Fe.nextTick(l)},l):Fe.nextTick(l)):e.length===1?(a=e(this),a&&a.then?a.then(function(){Fe.nextTick(l)},l):Fe.nextTick(l)):e(this,l)}}function rh(e,t){return n.bind(t);function n(r,l){let a;e?e.length===0?(a=e(),a&&a.then?a.then(function(){Fe.nextTick(l,r)},l):Fe.nextTick(l,r)):e.length===1?(a=e(r),a&&a.then?a.then(function(){Fe.nextTick(l)},l):Fe.nextTick(l)):e.length===2?e(r,l):e(r,this,l):Fe.nextTick(l)}}Xy.exports=_t;Xy.exports.express=function(e){return _t(e,{expose:{use:"load"}})};var zre=Xy.exports;const Ore=Rte(zre);(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(r){const l=n?window.performance.now():new Date().getTime(),a=Math.max(0,16-(l-t)),i=window.setTimeout(function(){r(l+a)},a);return t=l+a,i},window.cancelAnimationFrame=clearTimeout}})();function Hre(e,t=!0,n=!0,r={friendsTab:"enabled"}){const l=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",a=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",i=Ore(Object.create({}),{autostart:!1});return i.use(Pee,{hideFriends:r.hideFriends,skipOnboarding:r.skipOnboarding,betPack:r.betPack,friendsTab:r.friendsTab,theme:r.theme,themeMode:r.themeMode}),i.use(Mee,{onDeepLinkHandled:r==null?void 0:r.onDeepLinkHandled}),i.use(Dee,{videoPlayerController:r==null?void 0:r.videoPlayerController}),i.use(jee,{onContentActivate:r==null?void 0:r.onContentActivate,withAd:r==null?void 0:r.withAd,withAdNotification:r==null?void 0:r.withAdNotification}),i.use(uee,{sdkKey:e,host:l,analyticsHost:a,version:r==null?void 0:r.version,webOS:r==null?void 0:r.webOS}),i.use(mee),i.use(Hee),i.use(ste),i.use(Yee),i.use(Vte),i.after((o,s,c)=>{if(o)throw o;s.ready(),c()}),n&&i.after(async(o,s,c)=>{if(o)throw o;await s.sdk.initializeApp(),c()}),i.onClose(()=>{console.log("close StreamLayer instance")}),i}const Dre=({sdkKey:e,plugins:t,production:n,autoEnable:r,onDeepLinkHandled:l,videoPlayerController:a,onContentActivate:i,hideFriends:o,skipOnboarding:s,withAdNotification:c,withAd:u,friendsTab:d,betPack:g,webOS:p})=>{const[V,y]=X.useState(null);return X.useEffect(()=>{let E=!1;if(!e)return console.error("streamlayer sdk key should be provided"),y(f=>(f!==null&&typeof f.disableApp=="function"&&f.disableApp(),null)),()=>{E=!0};const h=Hre(e,n,r,{version:"1.20.1",onDeepLinkHandled:l,videoPlayerController:a,onContentActivate:i,skipOnboarding:s,withAdNotification:c,withAd:u,hideFriends:o,friendsTab:d,betPack:g,webOS:p});if(t)for(const f of t)h.use(f);return h.ready().then(f=>{E||(y(f.sdk),typeof window<"u")}).catch(f=>console.log(f)),()=>{E=!0,h.close(function(f){if(f)throw f})}},[e,n]),V};var _re=Object.defineProperty,jre=(e,t,n)=>t in e?_re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t,n)=>jre(e,typeof t!="symbol"?t+"":t,n),ca=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof M6<"u"?M6:typeof self<"u"?self:{};function Pre(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $re(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}),n}const qre=Xw({level:"trace",enabled:typeof window<"u"&&!!window.localStorage.getItem("SL_DEBUG"),browser:{write:e=>{console.log(e)}}}),Y1=(e,t)=>qre.child({name:e},t);class ele extends Event{constructor(t,n){super(t),mt(this,"slEventBus"),this.slEventBus=n}}const tle=Y1("event-bus");class nle{constructor(t="sl-event-bus"){mt(this,"name"),mt(this,"listeners"),mt(this,"emit",(n,r)=>{const l=new ele(this.name,{...r,type:n});tle.debug(l,"Emitting event"),window.dispatchEvent(l)}),mt(this,"destroy",()=>{this.listeners.forEach(n=>{window.removeEventListener(this.name,n),this.listeners.delete(n)}),this.listeners.clear()}),this.name=t,this.listeners=new Set}listen(t){return window.addEventListener(this.name,t),this.listeners.add(t),()=>{this.off(t)}}off(t){window.removeEventListener(this.name,t),this.listeners.delete(t)}}var sS;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(sS||(sS={}));function rle(e,t,n){let r=new Set(t).add(void 0);return e.listen((l,a,i)=>{r.has(i)&&n(l,a,i)})}window.slStore=Object.create(null);var cS;(function(e){e.ORGANIZATION="ORGANIZATION",e.STREAM="STREAM"})(cS||(cS={}));Xe.BETTING+"",Xe.GAMES+"",Xe.PUBLIC_CHAT+"",Xe.TWITTER+"";var uS;(function(e){e.Ready="ready",e.Suspended="suspended"})(uS||(uS={}));const lle=new nle;window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));function ale(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")}class ile{constructor(t="main",n=window.localStorage){mt(this,"delimiter",":"),mt(this,"prefix"),mt(this,"storage"),mt(this,"clear",()=>{for(const r in window.localStorage)r.startsWith(this.prefix)&&this.storage.removeItem(r)}),mt(this,"generateKey",r=>`${this.prefix}${this.delimiter}${r.join(this.delimiter)}`),mt(this,"write",(...r)=>{const l=r.pop()||"",a=this.generateKey(r);try{this.storage.setItem(a,l)}catch(i){ale(i)&&this.storage===window.sessionStorage&&(window.sessionStorage.removeItem("slstreamlogs"),this.storage.setItem(a,l))}}),mt(this,"read",(...r)=>{const l=this.storage.getItem(this.generateKey(r));return l===null?void 0:l}),mt(this,"remove",(...r)=>{this.storage.removeItem(this.generateKey(r))}),this.prefix=`sl-sdk${this.delimiter}${t}`,this.storage=n}}var dS;(function(e){e.Init="init",e.Ready="ready",e.Connecting="connecting",e.Connected="connected",e.Disconnected="disconnected",e.Failed="failed",e.Reconnect="reconnect",e.Reconnecting="reconnecting"})(dS||(dS={}));Y1("grpc:stream");Ae.Unknown,Ae.Internal,Ae.DeadlineExceeded,Ae.ResourceExhausted,Ae.FailedPrecondition,Ae.Unavailable,Ae.DataLoss;Y1("grpc:retry");J2(10,{description:"Number of attempts to retry"}),J2(3e4,{description:"Max delay between retries in milliseconds"});var zl;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(zl||(zl={}));class ole extends ile{constructor(){super("user"),mt(this,"setSchema",t=>{this.write(zl.SCHEMA,t)}),mt(this,"getSchema",()=>this.read(zl.SCHEMA)),mt(this,"setToken",t=>{this.write(zl.TOKEN,t)}),mt(this,"getToken",()=>this.read(zl.TOKEN)),mt(this,"setExternalToken",t=>{this.write(zl.EXTERNAL_TOKEN,t)}),mt(this,"getExternalToken",()=>this.read(zl.EXTERNAL_TOKEN)),mt(this,"removeToken",()=>{this.remove(zl.TOKEN)})}}var hS;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(hS||(hS={}));Y1("deep_link");Y1("bypass");new ole;Y1("video_player");Re.FACTOID+"",Re.POLL+"",Re.TRIVIA+"",Re.PREDICTION+"",Re.TWEET+"";var fS;(function(e){e.SHOWED="showed",e.EVENT="ev"})(fS||(fS={}));var pS;(function(e){e.ONBOARDING="onboarding",e.ONBOARDING_IO="onboarding_io",e.QUESTION_RECEIVED="q-received",e.QUESTION_OPENED="q-opened"})(pS||(pS={}));var mS;(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(mS||(mS={}));var gS;(function(e){e.OPENED="opened"})(gS||(gS={}));var bS;(function(e){e.UNKNOWN="unknown",e.ALREADY_VOTED="already_voted"})(bS||(bS={}));var yS;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(yS||(yS={}));Re.POLL,Re.PREDICTION,Re.TRIVIA;const sle={[Xe.GAMES]:!0};var cle=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(l=>{(l?l.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,i]=a.split("_");t[i]=a}else n.push(a)})});const r=[];for(const l in t)Object.prototype.hasOwnProperty.call(t,l)&&r.push(t[l]);return r.push(...n),r.join(" ")},Vo=cle;function ule(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var dle=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,lh=ule(function(e){return dle.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),hle=e=>e.toUpperCase()===e,fle=e=>t=>e.indexOf(t)===-1,XY=(e,t)=>{const n={};return Object.keys(e).filter(fle(t)).forEach(r=>{n[r]=e[r]}),n};function ple(e,t,n){const r=XY(t,n);if(!e){const l=typeof lh=="function"?{default:lh}:lh;Object.keys(r).forEach(a=>{l.default(a)||delete r[a]})}return r}var mle=(e,t)=>{};function gle(e){let t="";return n=>{const r=(a,i)=>{const{as:o=e,class:s=t}=a,c=n.propsAsIs===void 0?!(typeof o=="string"&&o.indexOf("-")===-1&&!hle(o[0])):n.propsAsIs,u=ple(c,a,["as","class"]);u.ref=i,u.className=n.atomic?Vo(n.class,u.className||s):Vo(u.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const y in d){const E=d[y],h=E[0],f=E[1]||"",b=typeof h=="function"?h(a):h;mle(b,n.name),g[`--${y}`]=`${b}${f}`}const p=u.style||{},V=Object.keys(p);V.length>0&&V.forEach(y=>{g[y]=p[y]}),u.style=g}return e.__wyw_meta&&e!==o?(u.as=o,X.createElement(e,u)):X.createElement(o,u)},l=X.forwardRef?X.forwardRef(r):a=>{const i=XY(a,["innerRef"]);return r(i,a.innerRef)};return l.displayName=n.name,l.__wyw_meta={className:n.class||t,extends:e},l}}var z=gle;const Oy=z("div")({name:"SDKContentContainer",class:"s1meqjjv",propsAsIs:!1}),ble=()=>Oy,BY=z(ble())({name:"SDKWhiteContainer",class:"s1burm22",propsAsIs:!0}),yle=()=>BY,Vle=z(yle())({name:"SDKSummaryContainer",class:"sm5r3j5",propsAsIs:!0}),Rle=z("div")({name:"TabsContainer",class:"tysxwr6",propsAsIs:!1}),Ele=()=>Oy,Ale=z(Ele())({name:"LeaderboardContainer",class:"l9er3b1",propsAsIs:!0}),Cle=()=>BY,vle=z(Cle())({name:"TabsNavContainer",class:"t19dtrb3",propsAsIs:!0}),Sle=z("div")({name:"UserSummaryContainer",class:"u1552n3j",propsAsIs:!1});function Nle(e,t={}){let n=X.useCallback(l=>t.keys?rle(e,t.keys,l):e.listen(l),[t.keys,e]),r=e.get.bind(e);return X.useSyncExternalStore(n,r,r)}/**
|
|
19
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function Ire(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function T1(e,t,n,r,l){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=l===void 0?e._timeout:l,this.name=Wre(t,n),this.isAfter=r,this.q=vre(e,Fre,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Nre(T1,Sre);T1.prototype.exec=function(e,t){const n=this.func;let r=!1;const l=this.name;if(this.parent._error&&!this.isAfter){nn("skipping loading of plugin as parent errored and it is not an after",l),Fe.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return nn("override errored",l),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,nn("exec",l);let a;const i=s=>{if(r){nn("loading complete",l);return}this._error=s,nn(s?"exec errored":"exec completed",l),r=!0,a&&clearTimeout(a),t(s)};this.timeout>0&&(nn("setting up timeout",l,this.timeout),a=setTimeout(function(){nn("timed out",l),a=null;const s=new Zre(l);s.fn=n,i(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const o=n(this.server,this.opts,i);o&&typeof o.then=="function"&&(nn("exec: resolving promise",l),o.then(()=>Fe.nextTick(i),s=>Fe.nextTick(i,s)))};T1.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,r)=>{this._error=n,this.q.pause(),n?(nn("rejecting promise",this.name,n),this._promise.reject(n)):(nn("resolving promise",this.name),this._promise.resolve()),this._promise=null,Fe.nextTick(r,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Ire(),t=this._promise.promise,this.server?e():this.on("start",e)),t};T1.prototype.enqueue=function(e,t){nn("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};T1.prototype.finish=function(e,t){nn("finish",this.name,e);const n=()=>{this.loaded||(nn("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 r=()=>{if(nn("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const l=()=>{nn("wrap"),queueMicrotask(r)};this._promise.resolve(),this._promise.promise.then(l,l),this._promise=null}else n();else nn("delayed",this.name),this.q.drain=()=>{nn("drain",this.name),this.q.drain=Ure,queueMicrotask(r)}};queueMicrotask(r),this.q.resume()};function Fre(e,t){const n=this;Fe.nextTick(zy.bind(n),e,t)}function zy(e,t){if(typeof e.func.then=="function"){e.func.then(r=>{typeof r.default=="function"&&(r=r.default),e.func=r,zy.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,r=>{e.finish(r,l=>{this._current.shift(),t(l)})})}function Ure(){}My.exports=T1;My.exports.loadPlugin=zy;var Gre=My.exports;const iS=rY,Xre=hY.EventEmitter,Bre=h5.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:th,AVV_ERR_CALLBACK_NOT_FN:Lc,AVV_ERR_PLUGIN_NOT_VALID:wre,AVV_ERR_ROOT_PLG_BOOTED:Tre,AVV_ERR_READY_TIMEOUT:Yre}=IY,kre=Rre,gg=Gre,b1=FY("avvio"),_2=Symbol("kAvvio"),nh=Symbol("kThenifyDoNotWrap");function Lre(e,t,n){const r=t.expose||{},l=r.use||"use",a=r.after||"after",i=r.ready||"ready",o=r.onClose||"onClose",s=r.close||"close";if(e[l])throw new th(l);if(e[a])throw new th(a);if(e[i])throw new th(i);e[l]=function(c,u){return n.use(c,u),this},Object.defineProperty(e,"then",{get:UY.bind(n)}),e[_2]=!0,e[a]=function(c){return typeof c!="function"?n._loadRegistered():(n.after(rh(c,this)),this)},e[i]=function(c){if(c&&typeof c!="function")throw new Lc(i,typeof c);return n.ready(c?rh(c,this):void 0)},e[o]=function(c){if(typeof c!="function")throw new Lc(o,typeof c);return n.onClose(Mre(c,this)),this},e[s]=function(c){if(c&&typeof c!="function")throw new Lc(s,typeof c);return c?(n.close(rh(c,this)),this):n.close()}}function _t(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 _t)){const r=new _t(e,t,n);return e&&Lre(e,t,r),r}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 kre,this._readyQ=iS(this,GY,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=oS},this._closeQ=iS(this,Kre,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=oS},this._doStart=null,this._root=new gg(this,xre.bind(this),t,!1,0),this._root.once("start",(r,l,a)=>{const i=this.pluginTree.start(null,l,a);this._root.once("loaded",(o,s,c)=>{this.pluginTree.stop(i,c)})}),gg.loadPlugin.call(this,this._root,r=>{b1("root plugin ready");try{this.emit("preReady"),this._root=null}catch(l){r=r||this._error||l}if(r){if(this._error=r,this._readyQ.length()===0)throw r}else this.booted=!0;this._readyQ.resume()})}function xre(e,t,n){this._doStart=n,t.autostart&&this.start()}Bre(_t,Xre);_t.prototype.start=function(){return this.started=!0,Fe.nextTick(this._doStart),this};_t.prototype.override=function(e,t,n){return e};function Jre(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new wre(typeof e);return e}_t.prototype[_2]=!0;_t.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};_t.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&Fe.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(_t.prototype,"then",{get:UY});_t.prototype._addPlugin=function(e,t,n){if(e=Jre(e),t=t||{},this.booted)throw new Tre;const r=this._current[0],l=new gg(this,e,t,n);if(l.once("start",(a,i,o)=>{const s=this.pluginTree.start(r.name,i,o);l.once("loaded",(c,u,d)=>{this.pluginTree.stop(s,d)})}),r.loaded)throw new Error(l.name,r.name);return r.enqueue(l,a=>{a&&(this._error=a)}),l};_t.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,r,l){GY.call(this,e,l)}return this};_t.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};_t.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Lc("close",typeof e)}else t=new Promise(function(n,r){e=function(l){if(l)return r(l);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),Fe.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};_t.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Lc("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(l),this.start();const r=this._current[0].server;function l(a,i,o){a?n(a):t(r),Fe.nextTick(o)}})};_t.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};_t.prototype.toJSON=function(){return this.pluginTree.toJSON()};function oS(){}function UY(){if(this.booted){b1("thenify returning null because we are already booted");return}if(this[nh]){this[nh]=!1;return}return b1("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[nh]=!0,e(this._server)),t)}function GY(e,t){const n=this._server,r=this._error;let l;if(this._error=null,e.length===0)this._error=r,l=e(),l&&!l[_2]&&typeof l.then=="function"?l.then(()=>Fe.nextTick(t),a=>Fe.nextTick(t,a)):Fe.nextTick(t);else if(e.length===1)l=e(r),l&&!l[_2]&&typeof l.then=="function"?l.then(()=>Fe.nextTick(t),a=>Fe.nextTick(t,a)):Fe.nextTick(t);else if(this._timeout===0){const a=i=>{this._error=i,t(this._error)};e.length===2?e(r,a):e(r,n,a)}else Qre.call(this,e,r,n,t)}function Qre(e,t,n,r){const l=e.name;b1("setting up ready timeout",l,this._timeout);let a=setTimeout(()=>{b1("timed out",l),a=null;const o=new Yre(l);o.fn=e,this._error=o,r(o)},this._timeout);e.length===2?e(t,i.bind(this)):e(t,n,i.bind(this));function i(o){a&&(clearTimeout(a),this._error=o,r(this._error))}}function Kre(e,t){const n=this._server,r=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let l;r?l=e(n):l=e(this._error),l&&typeof l.then=="function"?(b1("resolving close/onClose promise"),l.then(()=>Fe.nextTick(t),a=>Fe.nextTick(t,a))):Fe.nextTick(t)}else e.length===2?e(r?n:this._error,t):r?e(n,t):e(this._error,n,t)}function Mre(e,t){return n.bind(t);function n(r,l){let a;e.length===0?(a=e(),a&&a.then?a.then(function(){Fe.nextTick(l)},l):Fe.nextTick(l)):e.length===1?(a=e(this),a&&a.then?a.then(function(){Fe.nextTick(l)},l):Fe.nextTick(l)):e(this,l)}}function rh(e,t){return n.bind(t);function n(r,l){let a;e?e.length===0?(a=e(),a&&a.then?a.then(function(){Fe.nextTick(l,r)},l):Fe.nextTick(l,r)):e.length===1?(a=e(r),a&&a.then?a.then(function(){Fe.nextTick(l)},l):Fe.nextTick(l)):e.length===2?e(r,l):e(r,this,l):Fe.nextTick(l)}}Xy.exports=_t;Xy.exports.express=function(e){return _t(e,{expose:{use:"load"}})};var zre=Xy.exports;const Ore=Rte(zre);(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(r){const l=n?window.performance.now():new Date().getTime(),a=Math.max(0,16-(l-t)),i=window.setTimeout(function(){r(l+a)},a);return t=l+a,i},window.cancelAnimationFrame=clearTimeout}})();function Hre(e,t=!0,n=!0,r={friendsTab:"enabled"}){const l=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",a=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",i=Ore(Object.create({}),{autostart:!1});return i.use(Pee,{hideFriends:r.hideFriends,skipOnboarding:r.skipOnboarding,betPack:r.betPack,friendsTab:r.friendsTab,theme:r.theme,themeMode:r.themeMode}),i.use(Mee,{onDeepLinkHandled:r==null?void 0:r.onDeepLinkHandled}),i.use(Dee,{videoPlayerController:r==null?void 0:r.videoPlayerController}),i.use(jee,{onContentActivate:r==null?void 0:r.onContentActivate,withAd:r==null?void 0:r.withAd,withAdNotification:r==null?void 0:r.withAdNotification}),i.use(uee,{sdkKey:e,host:l,analyticsHost:a,version:r==null?void 0:r.version,webOS:r==null?void 0:r.webOS}),i.use(mee),i.use(Hee),i.use(ste),i.use(Yee),i.use(Vte),i.after((o,s,c)=>{if(o)throw o;s.ready(),c()}),n&&i.after(async(o,s,c)=>{if(o)throw o;await s.sdk.initializeApp(),c()}),i.onClose(()=>{console.log("close StreamLayer instance")}),i}const Dre=({sdkKey:e,plugins:t,production:n,autoEnable:r,onDeepLinkHandled:l,videoPlayerController:a,onContentActivate:i,hideFriends:o,skipOnboarding:s,withAdNotification:c,withAd:u,friendsTab:d,betPack:g,webOS:p})=>{const[V,y]=X.useState(null);return X.useEffect(()=>{let E=!1;if(!e)return console.error("streamlayer sdk key should be provided"),y(f=>(f!==null&&typeof f.disableApp=="function"&&f.disableApp(),null)),()=>{E=!0};const h=Hre(e,n,r,{version:"1.20.4",onDeepLinkHandled:l,videoPlayerController:a,onContentActivate:i,skipOnboarding:s,withAdNotification:c,withAd:u,hideFriends:o,friendsTab:d,betPack:g,webOS:p});if(t)for(const f of t)h.use(f);return h.ready().then(f=>{E||(y(f.sdk),typeof window<"u")}).catch(f=>console.log(f)),()=>{E=!0,h.close(function(f){if(f)throw f})}},[e,n]),V};var _re=Object.defineProperty,jre=(e,t,n)=>t in e?_re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t,n)=>jre(e,typeof t!="symbol"?t+"":t,n),ca=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof M6<"u"?M6:typeof self<"u"?self:{};function Pre(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $re(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}),n}const qre=Xw({level:"trace",enabled:typeof window<"u"&&!!window.localStorage.getItem("SL_DEBUG"),browser:{write:e=>{console.log(e)}}}),Y1=(e,t)=>qre.child({name:e},t);class ele extends Event{constructor(t,n){super(t),mt(this,"slEventBus"),this.slEventBus=n}}const tle=Y1("event-bus");class nle{constructor(t="sl-event-bus"){mt(this,"name"),mt(this,"listeners"),mt(this,"emit",(n,r)=>{const l=new ele(this.name,{...r,type:n});tle.debug(l,"Emitting event"),window.dispatchEvent(l)}),mt(this,"destroy",()=>{this.listeners.forEach(n=>{window.removeEventListener(this.name,n),this.listeners.delete(n)}),this.listeners.clear()}),this.name=t,this.listeners=new Set}listen(t){return window.addEventListener(this.name,t),this.listeners.add(t),()=>{this.off(t)}}off(t){window.removeEventListener(this.name,t),this.listeners.delete(t)}}var sS;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(sS||(sS={}));function rle(e,t,n){let r=new Set(t).add(void 0);return e.listen((l,a,i)=>{r.has(i)&&n(l,a,i)})}window.slStore=Object.create(null);var cS;(function(e){e.ORGANIZATION="ORGANIZATION",e.STREAM="STREAM"})(cS||(cS={}));Xe.BETTING+"",Xe.GAMES+"",Xe.PUBLIC_CHAT+"",Xe.TWITTER+"";var uS;(function(e){e.Ready="ready",e.Suspended="suspended"})(uS||(uS={}));const lle=new nle;window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));function ale(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")}class ile{constructor(t="main",n=window.localStorage){mt(this,"delimiter",":"),mt(this,"prefix"),mt(this,"storage"),mt(this,"clear",()=>{for(const r in window.localStorage)r.startsWith(this.prefix)&&this.storage.removeItem(r)}),mt(this,"generateKey",r=>`${this.prefix}${this.delimiter}${r.join(this.delimiter)}`),mt(this,"write",(...r)=>{const l=r.pop()||"",a=this.generateKey(r);try{this.storage.setItem(a,l)}catch(i){ale(i)&&this.storage===window.sessionStorage&&(window.sessionStorage.removeItem("slstreamlogs"),this.storage.setItem(a,l))}}),mt(this,"read",(...r)=>{const l=this.storage.getItem(this.generateKey(r));return l===null?void 0:l}),mt(this,"remove",(...r)=>{this.storage.removeItem(this.generateKey(r))}),this.prefix=`sl-sdk${this.delimiter}${t}`,this.storage=n}}var dS;(function(e){e.Init="init",e.Ready="ready",e.Connecting="connecting",e.Connected="connected",e.Disconnected="disconnected",e.Failed="failed",e.Reconnect="reconnect",e.Reconnecting="reconnecting"})(dS||(dS={}));Y1("grpc:stream");Ae.Unknown,Ae.Internal,Ae.DeadlineExceeded,Ae.ResourceExhausted,Ae.FailedPrecondition,Ae.Unavailable,Ae.DataLoss;Y1("grpc:retry");J2(10,{description:"Number of attempts to retry"}),J2(3e4,{description:"Max delay between retries in milliseconds"});var zl;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(zl||(zl={}));class ole extends ile{constructor(){super("user"),mt(this,"setSchema",t=>{this.write(zl.SCHEMA,t)}),mt(this,"getSchema",()=>this.read(zl.SCHEMA)),mt(this,"setToken",t=>{this.write(zl.TOKEN,t)}),mt(this,"getToken",()=>this.read(zl.TOKEN)),mt(this,"setExternalToken",t=>{this.write(zl.EXTERNAL_TOKEN,t)}),mt(this,"getExternalToken",()=>this.read(zl.EXTERNAL_TOKEN)),mt(this,"removeToken",()=>{this.remove(zl.TOKEN)})}}var hS;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(hS||(hS={}));Y1("deep_link");Y1("bypass");new ole;Y1("video_player");Re.FACTOID+"",Re.POLL+"",Re.TRIVIA+"",Re.PREDICTION+"",Re.TWEET+"";var fS;(function(e){e.SHOWED="showed",e.EVENT="ev"})(fS||(fS={}));var pS;(function(e){e.ONBOARDING="onboarding",e.ONBOARDING_IO="onboarding_io",e.QUESTION_RECEIVED="q-received",e.QUESTION_OPENED="q-opened"})(pS||(pS={}));var mS;(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(mS||(mS={}));var gS;(function(e){e.OPENED="opened"})(gS||(gS={}));var bS;(function(e){e.UNKNOWN="unknown",e.ALREADY_VOTED="already_voted"})(bS||(bS={}));var yS;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(yS||(yS={}));Re.POLL,Re.PREDICTION,Re.TRIVIA;const sle={[Xe.GAMES]:!0};var cle=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(l=>{(l?l.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,i]=a.split("_");t[i]=a}else n.push(a)})});const r=[];for(const l in t)Object.prototype.hasOwnProperty.call(t,l)&&r.push(t[l]);return r.push(...n),r.join(" ")},Vo=cle;function ule(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var dle=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,lh=ule(function(e){return dle.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),hle=e=>e.toUpperCase()===e,fle=e=>t=>e.indexOf(t)===-1,XY=(e,t)=>{const n={};return Object.keys(e).filter(fle(t)).forEach(r=>{n[r]=e[r]}),n};function ple(e,t,n){const r=XY(t,n);if(!e){const l=typeof lh=="function"?{default:lh}:lh;Object.keys(r).forEach(a=>{l.default(a)||delete r[a]})}return r}var mle=(e,t)=>{};function gle(e){let t="";return n=>{const r=(a,i)=>{const{as:o=e,class:s=t}=a,c=n.propsAsIs===void 0?!(typeof o=="string"&&o.indexOf("-")===-1&&!hle(o[0])):n.propsAsIs,u=ple(c,a,["as","class"]);u.ref=i,u.className=n.atomic?Vo(n.class,u.className||s):Vo(u.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const y in d){const E=d[y],h=E[0],f=E[1]||"",b=typeof h=="function"?h(a):h;mle(b,n.name),g[`--${y}`]=`${b}${f}`}const p=u.style||{},V=Object.keys(p);V.length>0&&V.forEach(y=>{g[y]=p[y]}),u.style=g}return e.__wyw_meta&&e!==o?(u.as=o,X.createElement(e,u)):X.createElement(o,u)},l=X.forwardRef?X.forwardRef(r):a=>{const i=XY(a,["innerRef"]);return r(i,a.innerRef)};return l.displayName=n.name,l.__wyw_meta={className:n.class||t,extends:e},l}}var z=gle;const Oy=z("div")({name:"SDKContentContainer",class:"s1meqjjv",propsAsIs:!1}),ble=()=>Oy,BY=z(ble())({name:"SDKWhiteContainer",class:"s1burm22",propsAsIs:!0}),yle=()=>BY,Vle=z(yle())({name:"SDKSummaryContainer",class:"sm5r3j5",propsAsIs:!0}),Rle=z("div")({name:"TabsContainer",class:"tysxwr6",propsAsIs:!1}),Ele=()=>Oy,Ale=z(Ele())({name:"LeaderboardContainer",class:"l9er3b1",propsAsIs:!0}),Cle=()=>BY,vle=z(Cle())({name:"TabsNavContainer",class:"t19dtrb3",propsAsIs:!0}),Sle=z("div")({name:"UserSummaryContainer",class:"u1552n3j",propsAsIs:!1});function Nle(e,t={}){let n=X.useCallback(l=>t.keys?rle(e,t.keys,l):e.listen(l),[t.keys,e]),r=e.get.bind(e);return X.useSyncExternalStore(n,r,r)}/**
|
|
20
20
|
* @license React
|
|
21
21
|
* use-sync-external-store-shim.production.js
|
|
22
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("react/jsx-runtime"),require("./index3.js");const e=require("./classic2.js");require("react"),exports.StreamLayerProvider=e.StreamLayerProvider,exports.StreamLayerSDKTv=e.StreamLayerSDKTv,exports.useStreamLayer=e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("react/jsx-runtime"),require("./index3.js");const e=require("./classic2.js");require("react"),exports.StreamLayerProvider=e.StreamLayerProvider,exports.StreamLayerSDKTv=e.StreamLayerSDKTv,exports.useStreamLayer=e.ST,exports.useStreamLayerUI=e.xT;
|