@streamlayer/react 1.1.0 → 1.1.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.
@@ -1,7 +1,7 @@
1
1
  "use strict";var vc=Object.defineProperty;var Oc=(e,t,n)=>t in e?vc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var p=(e,t,n)=>Oc(e,typeof t!="symbol"?t+"":t,n);const Ds=require("react");function Ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _o={exports:{}},Z=_o.exports={},be,Ie;function va(){throw new Error("setTimeout has not been defined")}function Oa(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?be=setTimeout:be=va}catch{be=va}try{typeof clearTimeout=="function"?Ie=clearTimeout:Ie=Oa}catch{Ie=Oa}})();function Eo(e){if(be===setTimeout)return setTimeout(e,0);if((be===va||!be)&&setTimeout)return be=setTimeout,setTimeout(e,0);try{return be(e,0)}catch{try{return be.call(null,e,0)}catch{return be.call(this,e,0)}}}function wc(e){if(Ie===clearTimeout)return clearTimeout(e);if((Ie===Oa||!Ie)&&clearTimeout)return Ie=clearTimeout,clearTimeout(e);try{return Ie(e)}catch{try{return Ie.call(null,e)}catch{return Ie.call(this,e)}}}var Be=[],vt=!1,it,un=-1;function Rc(){!vt||!it||(vt=!1,it.length?Be=it.concat(Be):un=-1,Be.length&&bo())}function bo(){if(!vt){var e=Eo(Rc);vt=!0;for(var t=Be.length;t;){for(it=Be,Be=[];++un<t;)it&&it[un].run();un=-1,t=Be.length}it=null,vt=!1,wc(e)}}Z.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Be.push(new Io(e,t)),Be.length===1&&!vt&&Eo(bo)};function Io(e,t){this.fun=e,this.array=t}Io.prototype.run=function(){this.fun.apply(null,this.array)};Z.title="browser";Z.browser=!0;Z.env={};Z.argv=[];Z.version="";Z.versions={};function Qe(){}Z.on=Qe;Z.addListener=Qe;Z.once=Qe;Z.off=Qe;Z.removeListener=Qe;Z.removeAllListeners=Qe;Z.emit=Qe;Z.prependListener=Qe;Z.prependOnceListener=Qe;Z.listeners=function(e){return[]};Z.binding=function(e){throw new Error("process.binding is not supported")};Z.cwd=function(){return"/"};Z.chdir=function(e){throw new Error("process.chdir is not supported")};Z.umask=function(){return 0};var Lc=_o.exports;const Us=Ac(Lc);var es={exports:{}};function Mc(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Pc=Cc;function Cc(e,t,n){var a=n&&n.stringify||Mc,s=1;if(typeof e=="object"&&e!==null){var r=t.length+s;if(r===1)return e;var o=new Array(r);o[0]=a(e);for(var c=1;c<r;c++)o[c]=a(t[c]);return o.join(" ")}if(typeof e!="string")return e;var l=t.length;if(l===0)return e;for(var m="",u=1-s,d=-1,y=e&&e.length||0,T=0;T<y;){if(e.charCodeAt(T)===37&&T+1<y){switch(d=d>-1?d:0,e.charCodeAt(T+1)){case 100:case 102:if(u>=l||t[u]==null)break;d<T&&(m+=e.slice(d,T)),m+=Number(t[u]),d=T+2,T++;break;case 105:if(u>=l||t[u]==null)break;d<T&&(m+=e.slice(d,T)),m+=Math.floor(Number(t[u])),d=T+2,T++;break;case 79:case 111:case 106:if(u>=l||t[u]===void 0)break;d<T&&(m+=e.slice(d,T));var f=typeof t[u];if(f==="string"){m+="'"+t[u]+"'",d=T+2,T++;break}if(f==="function"){m+=t[u].name||"<anonymous>",d=T+2,T++;break}m+=a(t[u]),d=T+2,T++;break;case 115:if(u>=l)break;d<T&&(m+=e.slice(d,T)),m+=String(t[u]),d=T+2,T++;break;case 37:d<T&&(m+=e.slice(d,T)),m+="%",d=T+2,T++,u--;break}++u}++T}return d===-1?e:(d<y&&(m+=e.slice(d)),m)}const Fs=Pc;es.exports=qe;const jt=Kc().console||{},Dc={mapHttpRequest:an,mapHttpResponse:an,wrapRequestSerializer:Jn,wrapResponseSerializer:Jn,wrapErrorSerializer:Jn,req:an,res:an,err:Bs,errWithCause:Bs};function In(e,t){return e==="silent"?1/0:t.levels.values[e]}const ts=Symbol("pino.logFuncs"),Aa=Symbol("pino.hierarchy"),Uc={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Gs(e,t){const n={logger:t,parent:e[Aa]};t[Aa]=n}function Fc(e,t,n){const a={};t.forEach(s=>{a[s]=n[s]?n[s]:jt[s]||jt[Uc[s]||"log"]||$t}),e[ts]=a}function Gc(e,t){return Array.isArray(e)?e.filter(function(a){return a!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function qe(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||jt;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},s=Gc(e.browser.serialize,a);let r=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(r=!1);const o=Object.keys(e.customLevels||{}),c=["error","fatal","warn","info","debug","trace"].concat(o);typeof n=="function"&&c.forEach(function(_){n[_]=n}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");const l=e.level||"info",m=Object.create(n);m.log||(m.log=$t),Fc(m,c,n),Gs({},m),Object.defineProperty(m,"levelVal",{get:d}),Object.defineProperty(m,"level",{get:y,set:T});const u={transmit:t,serialize:s,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:c,timestamp:jc(e),messageKey:e.messageKey||"msg"};m.levels=Bc(e),m.level=l,m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=$t,m.serializers=a,m._serialize=s,m._stdErrSerialize=r,m.child=f,t&&(m._logEvent=wa());function d(){return In(this.level,this)}function y(){return this._level}function T(_){if(_!=="silent"&&!this.levels.values[_])throw Error("unknown level "+_);this._level=_,st(this,u,m,"error"),st(this,u,m,"fatal"),st(this,u,m,"warn"),st(this,u,m,"info"),st(this,u,m,"debug"),st(this,u,m,"trace"),o.forEach(v=>{st(this,u,m,v)})}function f(_,v){if(!_)throw new Error("missing bindings for child Pino");v=v||{},s&&_.serializers&&(v.serializers=_.serializers);const I=v.serializers;if(s&&I){var E=Object.assign({},a,I),R=e.browser.serialize===!0?Object.keys(E):s;delete _.serializers,ns([_],R,E,this._stdErrSerialize)}function O(L){this._childLevel=(L._childLevel|0)+1,this.bindings=_,E&&(this.serializers=E,this._serialize=R),t&&(this._logEvent=wa([].concat(L._logEvent.bindings,_)))}O.prototype=this;const N=new O(this);return Gs(this,N),N.level=v.level||this.level,N}return m}function Bc(e){const t=e.customLevels||{},n=Object.assign({},qe.levels.values,t),a=Object.assign({},qe.levels.labels,Vc(t));return{values:n,labels:a}}function Vc(e){const t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}qe.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};qe.stdSerializers=Dc;qe.stdTimeFunctions=Object.assign({},{nullTime:No,epochTime:vo,unixTime:$c,isoTime:Wc});function xc(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[Aa];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function st(e,t,n,a){if(Object.defineProperty(e,a,{value:In(e.level,n)>In(a,n)?$t:n[ts][a],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[a]===$t)return;e[a]=Hc(e,t,n,a);const s=xc(e);s.length!==0&&(e[a]=qc(s,e[a]))}function qc(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Hc(e,t,n,a){return function(s){return function(){const o=t.timestamp(),c=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===jt?jt:this;for(var m=0;m<c.length;m++)c[m]=arguments[m];var u=!1;if(t.serialize&&(ns(c,this._serialize,this.serializers,this._stdErrSerialize),u=!0),t.asObject||t.formatters?s.call(l,Qc(this,a,c,o,t)):s.apply(l,c),t.transmit){const d=t.transmit.level||e._level,y=n.levels.values[d],T=n.levels.values[a];if(T<y)return;Yc(this,{ts:o,methodLevel:a,methodValue:T,transmitLevel:d,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:In(e._level,n)},c,u)}}}(e[ts][a])}function Qc(e,t,n,a,s){const{level:r,log:o=y=>y}=s.formatters||{},c=n.slice();let l=c[0];const m={};if(a&&(m.time=a),r){const y=r(t,e.levels.values[t]);Object.assign(m,y)}else m.level=e.levels.values[t];let u=(e._childLevel|0)+1;if(u<1&&(u=1),l!==null&&typeof l=="object"){for(;u--&&typeof c[0]=="object";)Object.assign(m,c.shift());l=c.length?Fs(c.shift(),c):void 0}else typeof l=="string"&&(l=Fs(c.shift(),c));return l!==void 0&&(m[s.messageKey]=l),o(m)}function ns(e,t,n,a){for(const s in e)if(a&&e[s]instanceof Error)e[s]=qe.stdSerializers.err(e[s]);else if(typeof e[s]=="object"&&!Array.isArray(e[s])&&t)for(const r in e[s])t.indexOf(r)>-1&&r in n&&(e[s][r]=n[r](e[s][r]))}function Yc(e,t,n,a=!1){const s=t.send,r=t.ts,o=t.methodLevel,c=t.methodValue,l=t.val,m=e._logEvent.bindings;a||ns(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=r,e._logEvent.messages=n.filter(function(u){return m.indexOf(u)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=c,s(o,e._logEvent,l),e._logEvent=wa(m)}function wa(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Bs(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)t[n]===void 0&&(t[n]=e[n]);return t}function jc(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?No:vo}function an(){return{}}function Jn(e){return e}function $t(){}function No(){return!1}function vo(){return Date.now()}function $c(){return Math.round(Date.now()/1e3)}function Wc(){return new Date(Date.now()).toISOString()}function Kc(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}es.exports.default=qe;var Oo=es.exports.pino=qe;function z(e,t){if(!e)throw new Error(t)}const zc=34028234663852886e22,Jc=-34028234663852886e22,Xc=4294967295,Zc=2147483647,el=-2147483648;function dn(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Zc||e<el)throw new Error("invalid int 32: "+e)}function Ra(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>Xc||e<0)throw new Error("invalid uint 32: "+e)}function Ao(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>zc||e<Jc))throw new Error("invalid float 32: "+e)}const wo=Symbol("@bufbuild/protobuf/enum-type");function tl(e){const t=e[wo];return z(t,"missing enum type on enum object"),t}function Ro(e,t,n,a){e[wo]=Lo(t,n.map(s=>({no:s.no,name:s.name,localName:e[s.no]})))}function Lo(e,t,n){const a=Object.create(null),s=Object.create(null),r=[];for(const o of t){const c=Mo(o);r.push(c),a[o.name]=c,s[o.no]=c}return{typeName:e,values:r,findName(o){return a[o]},findNumber(o){return s[o]}}}function nl(e,t,n){const a={};for(const s of t){const r=Mo(s);a[r.localName]=r.no,a[r.no]=r.localName}return Ro(a,e,t),a}function Mo(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}class zt{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){const a=this.getType(),s=a.runtime.bin,r=s.makeReadOptions(n);return s.readMessage(this,r.readerFactory(t),t.byteLength,r),this}fromJson(t,n){const a=this.getType(),s=a.runtime.json,r=s.makeReadOptions(n);return s.readMessage(a,t,r,this),this}fromJsonString(t,n){let a;try{a=JSON.parse(t)}catch(s){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${s instanceof Error?s.message:String(s)}`)}return this.fromJson(a,n)}toBinary(t){const n=this.getType(),a=n.runtime.bin,s=a.makeWriteOptions(t),r=s.writerFactory();return a.writeMessage(this,r,s),r.finish()}toJson(t){const n=this.getType(),a=n.runtime.json,s=a.makeWriteOptions(t);return a.writeMessage(this,s)}toJsonString(t){var n;const a=this.toJson(t);return JSON.stringify(a,null,(n=t==null?void 0:t.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function al(e,t,n,a){var s;const r=(s=a==null?void 0:a.localName)!==null&&s!==void 0?s:t.substring(t.lastIndexOf(".")+1),o={[r]:function(c){e.util.initFields(this),e.util.initPartial(c,this)}}[r];return Object.setPrototypeOf(o.prototype,new zt),Object.assign(o,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(c,l){return new o().fromBinary(c,l)},fromJson(c,l){return new o().fromJson(c,l)},fromJsonString(c,l){return new o().fromJsonString(c,l)},equals(c,l){return e.util.equals(o,c,l)}}),o}function sl(){let e=0,t=0;for(let a=0;a<28;a+=7){let s=this.buf[this.pos++];if(e|=(s&127)<<a,!(s&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let a=3;a<=31;a+=7){let s=this.buf[this.pos++];if(t|=(s&127)<<a,!(s&128))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Xn(e,t,n){for(let r=0;r<28;r=r+7){const o=e>>>r,c=!(!(o>>>7)&&t==0),l=(c?o|128:o)&255;if(n.push(l),!c)return}const a=e>>>28&15|(t&7)<<4,s=!!(t>>3);if(n.push((s?a|128:a)&255),!!s){for(let r=3;r<31;r=r+7){const o=t>>>r,c=!!(o>>>7),l=(c?o|128:o)&255;if(n.push(l),!c)return}n.push(t>>>31&1)}}const pn=4294967296;function Vs(e){const t=e[0]==="-";t&&(e=e.slice(1));const n=1e6;let a=0,s=0;function r(o,c){const l=Number(e.slice(o,c));s*=n,a=a*n+l,a>=pn&&(s=s+(a/pn|0),a=a%pn)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),t?Co(a,s):as(a,s)}function rl(e,t){let n=as(e,t);const a=n.hi&2147483648;a&&(n=Co(n.lo,n.hi));const s=Po(n.lo,n.hi);return a?"-"+s:s}function Po(e,t){if({lo:e,hi:t}=ol(e,t),t<=2097151)return String(pn*t+e);const n=e&16777215,a=(e>>>24|t<<8)&16777215,s=t>>16&65535;let r=n+a*6777216+s*6710656,o=a+s*8147497,c=s*2;const l=1e7;return r>=l&&(o+=Math.floor(r/l),r%=l),o>=l&&(c+=Math.floor(o/l),o%=l),c.toString()+xs(o)+xs(r)}function ol(e,t){return{lo:e>>>0,hi:t>>>0}}function as(e,t){return{lo:e|0,hi:t|0}}function Co(e,t){return t=~t,e?e=~e+1:t+=1,as(e,t)}const xs=e=>{const t=String(e);return"0000000".slice(t.length)+t};function qs(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function il(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}function cl(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof Us!="object"||typeof Us.env!="object"||!1)){const s=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),o=BigInt("0"),c=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){const m=typeof l=="bigint"?l:BigInt(l);if(m>r||m<s)throw new Error(`int64 invalid: ${l}`);return m},uParse(l){const m=typeof l=="bigint"?l:BigInt(l);if(m>c||m<o)throw new Error(`uint64 invalid: ${l}`);return m},enc(l){return e.setBigInt64(0,this.parse(l),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(l){return e.setBigInt64(0,this.uParse(l),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(l,m){return e.setInt32(0,l,!0),e.setInt32(4,m,!0),e.getBigInt64(0,!0)},uDec(l,m){return e.setInt32(0,l,!0),e.setInt32(4,m,!0),e.getBigUint64(0,!0)}}}const n=s=>z(/^-?[0-9]+$/.test(s),`int64 invalid: ${s}`),a=s=>z(/^[0-9]+$/.test(s),`uint64 invalid: ${s}`);return{zero:"0",supported:!1,parse(s){return typeof s!="string"&&(s=s.toString()),n(s),s},uParse(s){return typeof s!="string"&&(s=s.toString()),a(s),s},enc(s){return typeof s!="string"&&(s=s.toString()),n(s),Vs(s)},uEnc(s){return typeof s!="string"&&(s=s.toString()),a(s),Vs(s)},dec(s,r){return rl(s,r)},uDec(s,r){return Po(s,r)}}}const me=cl();var h;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(h||(h={}));var Je;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(Je||(Je={}));function We(e,t,n){if(t===n)return!0;if(e==h.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let a=0;a<t.length;a++)if(t[a]!==n[a])return!1;return!0}switch(e){case h.UINT64:case h.FIXED64:case h.INT64:case h.SFIXED64:case h.SINT64:return t==n}return!1}function Rt(e,t){switch(e){case h.BOOL:return!1;case h.UINT64:case h.FIXED64:case h.INT64:case h.SFIXED64:case h.SINT64:return t==0?me.zero:"0";case h.DOUBLE:case h.FLOAT:return 0;case h.BYTES:return new Uint8Array(0);case h.STRING:return"";default:return 0}}function Do(e,t){switch(e){case h.BOOL:return t===!1;case h.STRING:return t==="";case h.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}var X;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(X||(X={}));class ll{constructor(t){this.stack=[],this.textEncoder=t??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let s=0;s<this.chunks.length;s++)t+=this.chunks[s].length;let n=new Uint8Array(t),a=0;for(let s=0;s<this.chunks.length;s++)n.set(this.chunks[s],a),a+=this.chunks[s].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Ra(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return dn(t),qs(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){Ao(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Ra(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){dn(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return dn(t),t=(t<<1^t>>31)>>>0,qs(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),a=new DataView(n.buffer),s=me.enc(t);return a.setInt32(0,s.lo,!0),a.setInt32(4,s.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),a=new DataView(n.buffer),s=me.uEnc(t);return a.setInt32(0,s.lo,!0),a.setInt32(4,s.hi,!0),this.raw(n)}int64(t){let n=me.enc(t);return Xn(n.lo,n.hi,this.buf),this}sint64(t){let n=me.enc(t),a=n.hi>>31,s=n.lo<<1^a,r=(n.hi<<1|n.lo>>>31)^a;return Xn(s,r,this.buf),this}uint64(t){let n=me.uEnc(t);return Xn(n.lo,n.hi,this.buf),this}}class ml{constructor(t,n){this.varint64=sl,this.uint32=il,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n??new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,a=t&7;if(n<=0||a<0||a>5)throw new Error("illegal tag: field no "+n+" wire type "+a);return[n,a]}skip(t,n){let a=this.pos;switch(t){case X.Varint:for(;this.buf[this.pos++]&128;);break;case X.Bit64:this.pos+=4;case X.Bit32:this.pos+=4;break;case X.LengthDelimited:let s=this.uint32();this.pos+=s;break;case X.StartGroup:for(;;){const[r,o]=this.tag();if(o===X.EndGroup){if(n!==void 0&&r!==n)throw new Error("invalid end group tag");break}this.skip(o,r)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(a,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return me.dec(...this.varint64())}uint64(){return me.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),a=-(t&1);return t=(t>>>1|(n&1)<<31)^a,n=n>>>1^a,me.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return me.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return me.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}}function ul(e,t,n,a){let s;return{typeName:t,extendee:n,get field(){if(!s){const r=typeof a=="function"?a():a;r.name=t.split(".").pop(),r.jsonName=`[${t}]`,s=e.util.newFieldList([r]).list()[0]}return s},runtime:e}}function Uo(e){const t=e.field.localName,n=Object.create(null);return n[t]=dl(e),[n,()=>n[t]]}function dl(e){const t=e.field;if(t.repeated)return[];if(t.default!==void 0)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return Rt(t.T,t.L);case"message":const n=t.T,a=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(a):a;case"map":throw"map fields are not allowed to be extensions"}}function pl(e,t){if(!t.repeated&&(t.kind=="enum"||t.kind=="scalar")){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter(n=>n.no===t.no)}let De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Gn=[];for(let e=0;e<De.length;e++)Gn[De[e].charCodeAt(0)]=e;Gn[45]=De.indexOf("+");Gn[95]=De.indexOf("/");const ss={dec(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let n=new Uint8Array(t),a=0,s=0,r,o=0;for(let c=0;c<e.length;c++){if(r=Gn[e.charCodeAt(c)],r===void 0)switch(e[c]){case"=":s=0;case`
2
2
  `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(s){case 0:o=r,s=1;break;case 1:n[a++]=o<<2|(r&48)>>4,o=r,s=2;break;case 2:n[a++]=(o&15)<<4|(r&60)>>2,o=r,s=3;break;case 3:n[a++]=(o&3)<<6|r,s=0;break}}if(s==1)throw Error("invalid base64 string.");return n.subarray(0,a)},enc(e){let t="",n=0,a,s=0;for(let r=0;r<e.length;r++)switch(a=e[r],n){case 0:t+=De[a>>2],s=(a&3)<<4,n=1;break;case 1:t+=De[s|a>>4],s=(a&15)<<2,n=2;break;case 2:t+=De[s|a>>6],t+=De[a&63],n=0;break}return n&&(t+=De[s],t+="=",n==1&&(t+="=")),t}};function Tl(e,t,n){Go(t,e);const a=t.runtime.bin.makeReadOptions(n),s=pl(e.getType().runtime.bin.listUnknownFields(e),t.field),[r,o]=Uo(t);for(const c of s)t.runtime.bin.readField(r,a.readerFactory(c.data),t.field,c.wireType,a);return o()}function yl(e,t,n,a){Go(t,e);const s=t.runtime.bin.makeReadOptions(a),r=t.runtime.bin.makeWriteOptions(a);if(Fo(e,t)){const m=e.getType().runtime.bin.listUnknownFields(e).filter(u=>u.no!=t.field.no);e.getType().runtime.bin.discardUnknownFields(e);for(const u of m)e.getType().runtime.bin.onUnknownField(e,u.no,u.wireType,u.data)}const o=r.writerFactory();let c=t.field;!c.opt&&!c.repeated&&(c.kind=="enum"||c.kind=="scalar")&&(c=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(c,n,o,r);const l=s.readerFactory(o.finish());for(;l.pos<l.len;){const[m,u]=l.tag(),d=l.skip(u,m);e.getType().runtime.bin.onUnknownField(e,m,u,d)}}function Fo(e,t){const n=e.getType();return t.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(e).find(a=>a.no==t.field.no)}function Go(e,t){z(e.extendee.typeName==t.getType().typeName,`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}function Bo(e,t){const n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?t[n]!==void 0:e.kind=="enum"?t[n]!==e.T.values[0].no:!Do(e.T,t[n]);case"message":return t[n]!==void 0;case"map":return Object.keys(t[n]).length>0}}function Hs(e,t){const n=e.localName,a=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=a?e.T.values[0].no:void 0;break;case"scalar":t[n]=a?Rt(e.T,e.L):void 0;break;case"message":t[n]=void 0;break}}function mt(e,t){if(e===null||typeof e!="object"||!Object.getOwnPropertyNames(zt.prototype).every(a=>a in e&&typeof e[a]=="function"))return!1;const n=e.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:t===void 0?!0:n.typeName==t.typeName}function Vo(e,t){return mt(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}h.DOUBLE,h.FLOAT,h.INT64,h.UINT64,h.INT32,h.UINT32,h.BOOL,h.STRING,h.BYTES;const Qs={ignoreUnknownFields:!1},Ys={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function gl(e){return e?Object.assign(Object.assign({},Qs),e):Qs}function fl(e){return e?Object.assign(Object.assign({},Ys),e):Ys}const Nn=Symbol(),Tn=Symbol();function kl(){return{makeReadOptions:gl,makeWriteOptions:fl,readMessage(e,t,n,a){if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.typeName} from JSON: ${Ne(t)}`);a=a??new e;const s=new Map,r=n.typeRegistry;for(const[o,c]of Object.entries(t)){const l=e.fields.findJsonName(o);if(l){if(l.oneof){if(c===null&&l.kind=="scalar")continue;const m=s.get(l.oneof);if(m!==void 0)throw new Error(`cannot decode message ${e.typeName} from JSON: multiple keys for oneof "${l.oneof.name}" present: "${m}", "${o}"`);s.set(l.oneof,o)}js(a,c,l,n,e)}else{let m=!1;if(r!=null&&r.findExtension&&o.startsWith("[")&&o.endsWith("]")){const u=r.findExtension(o.substring(1,o.length-1));if(u&&u.extendee.typeName==e.typeName){m=!0;const[d,y]=Uo(u);js(d,c,u.field,n,u),yl(a,u,y(),n)}}if(!m&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${e.typeName} from JSON: key "${o}" is unknown`)}}return a},writeMessage(e,t){const n=e.getType(),a={};let s;try{for(s of n.fields.byNumber()){if(!Bo(s,e)){if(s.req)throw"required field not set";if(!t.emitDefaultValues||!Sl(s))continue}const o=s.oneof?e[s.oneof.localName].value:e[s.localName],c=$s(s,o,t);c!==void 0&&(a[t.useProtoFieldName?s.name:s.jsonName]=c)}const r=t.typeRegistry;if(r!=null&&r.findExtensionFor)for(const o of n.runtime.bin.listUnknownFields(e)){const c=r.findExtensionFor(n.typeName,o.no);if(c&&Fo(e,c)){const l=Tl(e,c,t),m=$s(c.field,l,t);m!==void 0&&(a[c.field.jsonName]=m)}}}catch(r){const o=s?`cannot encode field ${n.typeName}.${s.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,c=r instanceof Error?r.message:String(r);throw new Error(o+(c.length>0?`: ${c}`:""))}return a},readScalar(e,t,n){return xt(e,t,n??Je.BIGINT,!0)},writeScalar(e,t,n){if(t!==void 0&&(n||Do(e,t)))return yn(e,t)},debug:Ne}}function Ne(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function js(e,t,n,a,s){let r=n.localName;if(n.repeated){if(z(n.kind!="map"),t===null)return;if(!Array.isArray(t))throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: ${Ne(t)}`);const o=e[r];for(const c of t){if(c===null)throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: ${Ne(c)}`);switch(n.kind){case"message":o.push(n.T.fromJson(c,a));break;case"enum":const l=Zn(n.T,c,a.ignoreUnknownFields,!0);l!==Tn&&o.push(l);break;case"scalar":try{o.push(xt(n.T,c,n.L,!0))}catch(m){let u=`cannot decode field ${s.typeName}.${n.name} from JSON: ${Ne(c)}`;throw m instanceof Error&&m.message.length>0&&(u+=`: ${m.message}`),new Error(u)}break}}}else if(n.kind=="map"){if(t===null)return;if(typeof t!="object"||Array.isArray(t))throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: ${Ne(t)}`);const o=e[r];for(const[c,l]of Object.entries(t)){if(l===null)throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: map value null`);let m;try{m=hl(n.K,c)}catch(u){let d=`cannot decode map key for field ${s.typeName}.${n.name} from JSON: ${Ne(t)}`;throw u instanceof Error&&u.message.length>0&&(d+=`: ${u.message}`),new Error(d)}switch(n.V.kind){case"message":o[m]=n.V.T.fromJson(l,a);break;case"enum":const u=Zn(n.V.T,l,a.ignoreUnknownFields,!0);u!==Tn&&(o[m]=u);break;case"scalar":try{o[m]=xt(n.V.T,l,Je.BIGINT,!0)}catch(d){let y=`cannot decode map value for field ${s.typeName}.${n.name} from JSON: ${Ne(t)}`;throw d instanceof Error&&d.message.length>0&&(y+=`: ${d.message}`),new Error(y)}break}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:r},r="value"),n.kind){case"message":const o=n.T;if(t===null&&o.typeName!="google.protobuf.Value")return;let c=e[r];mt(c)?c.fromJson(t,a):(e[r]=c=o.fromJson(t,a),o.fieldWrapper&&!n.oneof&&(e[r]=o.fieldWrapper.unwrapField(c)));break;case"enum":const l=Zn(n.T,t,a.ignoreUnknownFields,!1);switch(l){case Nn:Hs(n,e);break;case Tn:break;default:e[r]=l;break}break;case"scalar":try{const m=xt(n.T,t,n.L,!1);switch(m){case Nn:Hs(n,e);break;default:e[r]=m;break}}catch(m){let u=`cannot decode field ${s.typeName}.${n.name} from JSON: ${Ne(t)}`;throw m instanceof Error&&m.message.length>0&&(u+=`: ${m.message}`),new Error(u)}break}}function hl(e,t){if(e===h.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1;break}return xt(e,t,Je.BIGINT,!0).toString()}function xt(e,t,n,a){if(t===null)return a?Rt(e,n):Nn;switch(e){case h.DOUBLE:case h.FLOAT:if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;const s=Number(t);if(Number.isNaN(s)||!Number.isFinite(s))break;return e==h.FLOAT&&Ao(s),s;case h.INT32:case h.FIXED32:case h.SFIXED32:case h.SINT32:case h.UINT32:let r;if(typeof t=="number"?r=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(r=Number(t)),r===void 0)break;return e==h.UINT32||e==h.FIXED32?Ra(r):dn(r),r;case h.INT64:case h.SFIXED64:case h.SINT64:if(typeof t!="number"&&typeof t!="string")break;const o=me.parse(t);return n?o.toString():o;case h.FIXED64:case h.UINT64:if(typeof t!="number"&&typeof t!="string")break;const c=me.uParse(t);return n?c.toString():c;case h.BOOL:if(typeof t!="boolean")break;return t;case h.STRING:if(typeof t!="string")break;try{encodeURIComponent(t)}catch{throw new Error("invalid UTF8")}return t;case h.BYTES:if(t==="")return new Uint8Array(0);if(typeof t!="string")break;return ss.dec(t)}throw new Error}function Zn(e,t,n,a){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:a?e.values[0].no:Nn;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const s=e.findName(t);if(s!==void 0)return s.no;if(n)return Tn;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${Ne(t)}`)}function Sl(e){return e.repeated||e.kind=="map"?!0:!(e.oneof||e.kind=="message"||e.opt||e.req)}function $s(e,t,n){if(e.kind=="map"){z(typeof t=="object"&&t!=null);const a={},s=Object.entries(t);switch(e.V.kind){case"scalar":for(const[o,c]of s)a[o.toString()]=yn(e.V.T,c);break;case"message":for(const[o,c]of s)a[o.toString()]=c.toJson(n);break;case"enum":const r=e.V.T;for(const[o,c]of s)a[o.toString()]=ea(r,c,n.enumAsInteger);break}return n.emitDefaultValues||s.length>0?a:void 0}if(e.repeated){z(Array.isArray(t));const a=[];switch(e.kind){case"scalar":for(let s=0;s<t.length;s++)a.push(yn(e.T,t[s]));break;case"enum":for(let s=0;s<t.length;s++)a.push(ea(e.T,t[s],n.enumAsInteger));break;case"message":for(let s=0;s<t.length;s++)a.push(t[s].toJson(n));break}return n.emitDefaultValues||a.length>0?a:void 0}switch(e.kind){case"scalar":return yn(e.T,t);case"enum":return ea(e.T,t,n.enumAsInteger);case"message":return Vo(e.T,t).toJson(n)}}function ea(e,t,n){var a;if(z(typeof t=="number"),e.typeName=="google.protobuf.NullValue")return null;if(n)return t;const s=e.findNumber(t);return(a=s==null?void 0:s.name)!==null&&a!==void 0?a:t}function yn(e,t){switch(e){case h.INT32:case h.SFIXED32:case h.SINT32:case h.FIXED32:case h.UINT32:return z(typeof t=="number"),t;case h.FLOAT:case h.DOUBLE:return z(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case h.STRING:return z(typeof t=="string"),t;case h.BOOL:return z(typeof t=="boolean"),t;case h.UINT64:case h.FIXED64:case h.INT64:case h.SFIXED64:case h.SINT64:return z(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),t.toString();case h.BYTES:return z(t instanceof Uint8Array),ss.enc(t)}}const kt=Symbol("@bufbuild/protobuf/unknown-fields"),Ws={readUnknownFields:!0,readerFactory:e=>new ml(e)},Ks={writeUnknownFields:!0,writerFactory:()=>new ll};function _l(e){return e?Object.assign(Object.assign({},Ws),e):Ws}function El(e){return e?Object.assign(Object.assign({},Ks),e):Ks}function bl(){return{makeReadOptions:_l,makeWriteOptions:El,listUnknownFields(e){var t;return(t=e[kt])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[kt]},writeUnknownFields(e,t){const a=e[kt];if(a)for(const s of a)t.tag(s.no,s.wireType).raw(s.data)},onUnknownField(e,t,n,a){const s=e;Array.isArray(s[kt])||(s[kt]=[]),s[kt].push({no:t,wireType:n,data:a})},readMessage(e,t,n,a,s){const r=e.getType(),o=s?t.len:t.pos+n;let c,l;for(;t.pos<o&&([c,l]=t.tag(),!(s===!0&&l==X.EndGroup));){const m=r.fields.find(c);if(!m){const u=t.skip(l,c);a.readUnknownFields&&this.onUnknownField(e,c,l,u);continue}zs(e,t,m,l,a)}if(s&&(l!=X.EndGroup||c!==n))throw new Error("invalid end group tag")},readField:zs,writeMessage(e,t,n){const a=e.getType();for(const s of a.fields.byNumber()){if(!Bo(s,e)){if(s.req)throw new Error(`cannot encode field ${a.typeName}.${s.name} to binary: required field not set`);continue}const r=s.oneof?e[s.oneof.localName].value:e[s.localName];Js(s,r,t,n)}return n.writeUnknownFields&&this.writeUnknownFields(e,t),t},writeField(e,t,n,a){t!==void 0&&Js(e,t,n,a)}}}function zs(e,t,n,a,s){let{repeated:r,localName:o}=n;switch(n.oneof&&(e=e[n.oneof.localName],e.case!=o&&delete e.value,e.case=o,o="value"),n.kind){case"scalar":case"enum":const c=n.kind=="enum"?h.INT32:n.T;let l=vn;if(n.kind=="scalar"&&n.L>0&&(l=Nl),r){let y=e[o];if(a==X.LengthDelimited&&c!=h.STRING&&c!=h.BYTES){let f=t.uint32()+t.pos;for(;t.pos<f;)y.push(l(t,c))}else y.push(l(t,c))}else e[o]=l(t,c);break;case"message":const m=n.T;r?e[o].push(gn(t,new m,s,n)):mt(e[o])?gn(t,e[o],s,n):(e[o]=gn(t,new m,s,n),m.fieldWrapper&&!n.oneof&&!n.repeated&&(e[o]=m.fieldWrapper.unwrapField(e[o])));break;case"map":let[u,d]=Il(n,t,s);e[o][u]=d;break}}function gn(e,t,n,a){const s=t.getType().runtime.bin,r=a==null?void 0:a.delimited;return s.readMessage(t,e,r?a.no:e.uint32(),n,r),t}function Il(e,t,n){const a=t.uint32(),s=t.pos+a;let r,o;for(;t.pos<s;){const[c]=t.tag();switch(c){case 1:r=vn(t,e.K);break;case 2:switch(e.V.kind){case"scalar":o=vn(t,e.V.T);break;case"enum":o=t.int32();break;case"message":o=gn(t,new e.V.T,n,void 0);break}break}}if(r===void 0&&(r=Rt(e.K,Je.BIGINT)),typeof r!="string"&&typeof r!="number"&&(r=r.toString()),o===void 0)switch(e.V.kind){case"scalar":o=Rt(e.V.T,Je.BIGINT);break;case"enum":o=e.V.T.values[0].no;break;case"message":o=new e.V.T;break}return[r,o]}function Nl(e,t){const n=vn(e,t);return typeof n=="bigint"?n.toString():n}function vn(e,t){switch(t){case h.STRING:return e.string();case h.BOOL:return e.bool();case h.DOUBLE:return e.double();case h.FLOAT:return e.float();case h.INT32:return e.int32();case h.INT64:return e.int64();case h.UINT64:return e.uint64();case h.FIXED64:return e.fixed64();case h.BYTES:return e.bytes();case h.FIXED32:return e.fixed32();case h.SFIXED32:return e.sfixed32();case h.SFIXED64:return e.sfixed64();case h.SINT64:return e.sint64();case h.UINT32:return e.uint32();case h.SINT32:return e.sint32()}}function Js(e,t,n,a){z(t!==void 0);const s=e.repeated;switch(e.kind){case"scalar":case"enum":let r=e.kind=="enum"?h.INT32:e.T;if(s)if(z(Array.isArray(t)),e.packed)Ol(n,r,e.no,t);else for(const o of t)qt(n,r,e.no,o);else qt(n,r,e.no,t);break;case"message":if(s){z(Array.isArray(t));for(const o of t)Xs(n,a,e,o)}else Xs(n,a,e,t);break;case"map":z(typeof t=="object"&&t!=null);for(const[o,c]of Object.entries(t))vl(n,a,e,o,c);break}}function vl(e,t,n,a,s){e.tag(n.no,X.LengthDelimited),e.fork();let r=a;switch(n.K){case h.INT32:case h.FIXED32:case h.UINT32:case h.SFIXED32:case h.SINT32:r=Number.parseInt(a);break;case h.BOOL:z(a=="true"||a=="false"),r=a=="true";break}switch(qt(e,n.K,1,r),n.V.kind){case"scalar":qt(e,n.V.T,2,s);break;case"enum":qt(e,h.INT32,2,s);break;case"message":z(s!==void 0),e.tag(2,X.LengthDelimited).bytes(s.toBinary(t));break}e.join()}function Xs(e,t,n,a){const s=Vo(n.T,a);n.delimited?e.tag(n.no,X.StartGroup).raw(s.toBinary(t)).tag(n.no,X.EndGroup):e.tag(n.no,X.LengthDelimited).bytes(s.toBinary(t))}function qt(e,t,n,a){z(a!==void 0);let[s,r]=xo(t);e.tag(n,s)[r](a)}function Ol(e,t,n,a){if(!a.length)return;e.tag(n,X.LengthDelimited).fork();let[,s]=xo(t);for(let r=0;r<a.length;r++)e[s](a[r]);e.join()}function xo(e){let t=X.Varint;switch(e){case h.BYTES:case h.STRING:t=X.LengthDelimited;break;case h.DOUBLE:case h.FIXED64:case h.SFIXED64:t=X.Bit64;break;case h.FIXED32:case h.SFIXED32:case h.FLOAT:t=X.Bit32;break}const n=h[e].toLowerCase();return[t,n]}function Al(){return{setEnumType:Ro,initPartial(e,t){if(e===void 0)return;const n=t.getType();for(const a of n.fields.byMember()){const s=a.localName,r=t,o=e;if(o[s]!=null)switch(a.kind){case"oneof":const c=o[s].case;if(c===void 0)continue;const l=a.findField(c);let m=o[s].value;l&&l.kind=="message"&&!mt(m,l.T)?m=new l.T(m):l&&l.kind==="scalar"&&l.T===h.BYTES&&(m=Gt(m)),r[s]={case:c,value:m};break;case"scalar":case"enum":let u=o[s];a.T===h.BYTES&&(u=a.repeated?u.map(Gt):Gt(u)),r[s]=u;break;case"map":switch(a.V.kind){case"scalar":case"enum":if(a.V.T===h.BYTES)for(const[T,f]of Object.entries(o[s]))r[s][T]=Gt(f);else Object.assign(r[s],o[s]);break;case"message":const y=a.V.T;for(const T of Object.keys(o[s])){let f=o[s][T];y.fieldWrapper||(f=new y(f)),r[s][T]=f}break}break;case"message":const d=a.T;if(a.repeated)r[s]=o[s].map(y=>mt(y,d)?y:new d(y));else{const y=o[s];d.fieldWrapper?d.typeName==="google.protobuf.BytesValue"?r[s]=Gt(y):r[s]=y:r[s]=mt(y,d)?y:new d(y)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(a=>{const s=t[a.localName],r=n[a.localName];if(a.repeated){if(s.length!==r.length)return!1;switch(a.kind){case"message":return s.every((o,c)=>a.T.equals(o,r[c]));case"scalar":return s.every((o,c)=>We(a.T,o,r[c]));case"enum":return s.every((o,c)=>We(h.INT32,o,r[c]))}throw new Error(`repeated cannot contain ${a.kind}`)}switch(a.kind){case"message":return a.T.equals(s,r);case"enum":return We(h.INT32,s,r);case"scalar":return We(a.T,s,r);case"oneof":if(s.case!==r.case)return!1;const o=a.findField(s.case);if(o===void 0)return!0;switch(o.kind){case"message":return o.T.equals(s.value,r.value);case"enum":return We(h.INT32,s.value,r.value);case"scalar":return We(o.T,s.value,r.value)}throw new Error(`oneof cannot contain ${o.kind}`);case"map":const c=Object.keys(s).concat(Object.keys(r));switch(a.V.kind){case"message":const l=a.V.T;return c.every(u=>l.equals(s[u],r[u]));case"enum":return c.every(u=>We(h.INT32,s[u],r[u]));case"scalar":const m=a.V.T;return c.every(u=>We(m,s[u],r[u]))}break}})},clone(e){const t=e.getType(),n=new t,a=n;for(const s of t.fields.byMember()){const r=e[s.localName];let o;if(s.repeated)o=r.map(sn);else if(s.kind=="map"){o=a[s.localName];for(const[c,l]of Object.entries(r))o[c]=sn(l)}else s.kind=="oneof"?o=s.findField(r.case)?{case:r.case,value:sn(r.value)}:{case:void 0}:o=sn(r);a[s.localName]=o}for(const s of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(a,s.no,s.wireType,s.data);return n}}}function sn(e){if(e===void 0)return e;if(mt(e))return e.clone();if(e instanceof Uint8Array){const t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function Gt(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function wl(e,t,n){return{syntax:e,json:kl(),bin:bl(),util:Object.assign(Object.assign({},Al()),{newFieldList:t,initFields:n}),makeMessageType(a,s,r){return al(this,a,s,r)},makeEnum:nl,makeEnumType:Lo,getEnumType:tl,makeExtension(a,s,r){return ul(this,a,s,r)}}}class Rl{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){const n={};for(const a of this.list())n[a.jsonName]=n[a.name]=a;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){const n={};for(const a of this.list())n[a.no]=a;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const t=this.members;let n;for(const a of this.list())a.oneof?a.oneof!==n&&(n=a.oneof,t.push(n)):t.push(a)}return this.members}}function qo(e,t){const n=Ho(e);return t?n:Ul(Dl(n))}function Ll(e){return qo(e,!1)}const Ml=Ho;function Ho(e){let t=!1;const n=[];for(let a=0;a<e.length;a++){let s=e.charAt(a);switch(s){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(s),t=!1;break;default:t&&(t=!1,s=s.toUpperCase()),n.push(s);break}}return n.join("")}const Pl=new Set(["constructor","toString","toJSON","valueOf"]),Cl=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Qo=e=>`${e}$`,Dl=e=>Cl.has(e)?Qo(e):e,Ul=e=>Pl.has(e)?Qo(e):e;class Fl{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=Ll(t)}addField(t){z(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[t]}}function Gl(e,t){var n,a,s,r,o,c;const l=[];let m;for(const u of typeof e=="function"?e():e){const d=u;if(d.localName=qo(u.name,u.oneof!==void 0),d.jsonName=(n=u.jsonName)!==null&&n!==void 0?n:Ml(u.name),d.repeated=(a=u.repeated)!==null&&a!==void 0?a:!1,u.kind=="scalar"&&(d.L=(s=u.L)!==null&&s!==void 0?s:Je.BIGINT),d.delimited=(r=u.delimited)!==null&&r!==void 0?r:!1,d.req=(o=u.req)!==null&&o!==void 0?o:!1,d.opt=(c=u.opt)!==null&&c!==void 0?c:!1,u.packed===void 0&&(d.packed=u.kind=="enum"||u.kind=="scalar"&&u.T!=h.BYTES&&u.T!=h.STRING),u.oneof!==void 0){const y=typeof u.oneof=="string"?u.oneof:u.oneof.name;(!m||m.name!=y)&&(m=new Fl(y)),d.oneof=m,m.addField(d)}l.push(d)}return l}const i=wl("proto3",e=>new Rl(e,t=>Gl(t)),e=>{for(const t of e.getType().fields.byMember()){if(t.opt)continue;const n=t.localName,a=e;if(t.repeated){a[n]=[];continue}switch(t.kind){case"oneof":a[n]={case:void 0};break;case"enum":a[n]=0;break;case"map":a[n]={};break;case"scalar":a[n]=Rt(t.T,t.L);break}}});var w;(function(e){e[e.Unary=0]="Unary",e[e.ServerStreaming=1]="ServerStreaming",e[e.ClientStreaming=2]="ClientStreaming",e[e.BiDiStreaming=3]="BiDiStreaming"})(w||(w={}));var Zs;(function(e){e[e.NoSideEffects=1]="NoSideEffects",e[e.Idempotent=2]="Idempotent"})(Zs||(Zs={}));class ue extends zt{constructor(t){super(),this.seconds=me.zero,this.nanos=0,i.util.initPartial(t,this)}fromJson(t,n){if(typeof t!="string")throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${i.json.debug(t)}`);const a=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!a)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const s=Date.parse(a[1]+"-"+a[2]+"-"+a[3]+"T"+a[4]+":"+a[5]+":"+a[6]+(a[8]?a[8]:"Z"));if(Number.isNaN(s))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=me.parse(s/1e3),this.nanos=0,a[7]&&(this.nanos=parseInt("1"+a[7]+"0".repeat(9-a[7].length))-1e9),this}toJson(t){const n=Number(this.seconds)*1e3;if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let a="Z";if(this.nanos>0){const s=(this.nanos+1e9).toString().substring(1);s.substring(3)==="000000"?a="."+s.substring(0,3)+"Z":s.substring(6)==="000"?a="."+s.substring(0,6)+"Z":a="."+s+"Z"}return new Date(n).toISOString().replace(".000Z",a)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return ue.fromDate(new Date)}static fromDate(t){const n=t.getTime();return new ue({seconds:me.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}static fromBinary(t,n){return new ue().fromBinary(t,n)}static fromJson(t,n){return new ue().fromJson(t,n)}static fromJsonString(t,n){return new ue().fromJsonString(t,n)}static equals(t,n){return i.util.equals(ue,t,n)}}ue.runtime=i;ue.typeName="google.protobuf.Timestamp";ue.fields=i.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);class Re extends zt{constructor(t){super(),this.typeUrl="",this.value=new Uint8Array(0),i.util.initPartial(t,this)}toJson(t){var n;if(this.typeUrl==="")return{};const a=this.typeUrlToName(this.typeUrl),s=(n=t==null?void 0:t.typeRegistry)===null||n===void 0?void 0:n.findMessage(a);if(!s)throw new Error(`cannot encode message google.protobuf.Any to JSON: "${this.typeUrl}" is not in the type registry`);let o=s.fromBinary(this.value).toJson(t);return(a.startsWith("google.protobuf.")||o===null||Array.isArray(o)||typeof o!="object")&&(o={value:o}),o["@type"]=this.typeUrl,o}fromJson(t,n){var a;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${t===null?"null":Array.isArray(t)?"array":typeof t}`);if(Object.keys(t).length==0)return this;const s=t["@type"];if(typeof s!="string"||s=="")throw new Error('cannot decode message google.protobuf.Any from JSON: "@type" is empty');const r=this.typeUrlToName(s),o=(a=n==null?void 0:n.typeRegistry)===null||a===void 0?void 0:a.findMessage(r);if(!o)throw new Error(`cannot decode message google.protobuf.Any from JSON: ${s} is not in the type registry`);let c;if(r.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value"))c=o.fromJson(t.value,n);else{const l=Object.assign({},t);delete l["@type"],c=o.fromJson(l,n)}return this.packFrom(c),this}packFrom(t){this.value=t.toBinary(),this.typeUrl=this.typeNameToUrl(t.getType().typeName)}unpackTo(t){return this.is(t.getType())?(t.fromBinary(this.value),!0):!1}unpack(t){if(this.typeUrl==="")return;const n=t.findMessage(this.typeUrlToName(this.typeUrl));if(n)return n.fromBinary(this.value)}is(t){if(this.typeUrl==="")return!1;const n=this.typeUrlToName(this.typeUrl);let a="";return typeof t=="string"?a=t:a=t.typeName,n===a}typeNameToUrl(t){return`type.googleapis.com/${t}`}typeUrlToName(t){if(!t.length)throw new Error(`invalid type url: ${t}`);const n=t.lastIndexOf("/"),a=n>=0?t.substring(n+1):t;if(!a.length)throw new Error(`invalid type url: ${t}`);return a}static pack(t){const n=new Re;return n.packFrom(t),n}static fromBinary(t,n){return new Re().fromBinary(t,n)}static fromJson(t,n){return new Re().fromJson(t,n)}static fromJsonString(t,n){return new Re().fromJsonString(t,n)}static equals(t,n){return i.util.equals(Re,t,n)}}Re.runtime=i;Re.typeName="google.protobuf.Any";Re.fields=i.util.newFieldList(()=>[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}]);const Bl=i.makeEnum("streamlayer.analytics.v1.common.ResultStatus",[{no:0,name:"RESULT_STATUS_UNSET",localName:"UNSET"},{no:1,name:"RESULT_STATUS_OK",localName:"OK"},{no:2,name:"RESULT_STATUS_ERROR",localName:"ERROR"}]),fe=i.makeEnum("streamlayer.analytics.v1.common.Kind",[{no:0,name:"KIND_UNSET",localName:"UNSET"},{no:1,name:"KIND_VIEWERS",localName:"VIEWERS"},{no:2,name:"KIND_EVENT_OPENED",localName:"EVENT_OPENED"},{no:3,name:"KIND_AUTHENTICATION_ATTEMPTED",localName:"AUTHENTICATION_ATTEMPTED"},{no:4,name:"KIND_AUTHENTICATION_COMPLETED",localName:"AUTHENTICATION_COMPLETED"},{no:5,name:"KIND_LAUNCH_BUTTON",localName:"LAUNCH_BUTTON"},{no:6,name:"KIND_PERMISSION_PROVIDED",localName:"PERMISSION_PROVIDED"},{no:7,name:"KIND_PERMISSION_NOT_PROVIDED",localName:"PERMISSION_NOT_PROVIDED"},{no:8,name:"KIND_INTERACTIONS",localName:"INTERACTIONS"},{no:9,name:"KIND_CONVERSATION_CREATED",localName:"CONVERSATION_CREATED"},{no:10,name:"KIND_CONVERSATION_JOINED",localName:"CONVERSATION_JOINED"},{no:11,name:"KIND_CONVERSATION_DELETED",localName:"CONVERSATION_DELETED"},{no:12,name:"KIND_NEW_CALL",localName:"NEW_CALL"},{no:13,name:"KIND_CALL_JOINED",localName:"CALL_JOINED"},{no:14,name:"KIND_CALL_FINISHED",localName:"CALL_FINISHED"},{no:15,name:"KIND_INVITATION_SENT",localName:"INVITATION_SENT"},{no:16,name:"KIND_INVITATION_ACCEPTED",localName:"INVITATION_ACCEPTED"},{no:17,name:"KIND_WAVES_SENT",localName:"WAVES_SENT"},{no:18,name:"KIND_WAVES_REPLIES",localName:"WAVES_REPLIES"},{no:19,name:"KIND_NOTIFICATION_RECEIVED",localName:"NOTIFICATION_RECEIVED"},{no:20,name:"KIND_NOTIFICATION_OPENED",localName:"NOTIFICATION_OPENED"},{no:21,name:"KIND_SESSION_HEARTBEAT",localName:"SESSION_HEARTBEAT"},{no:22,name:"KIND_CONVERSATION_OPENED",localName:"CONVERSATION_OPENED"},{no:23,name:"KIND_GROUP_CONVERSATION_OPENED",localName:"GROUP_CONVERSATION_OPENED"},{no:24,name:"KIND_GROUP_CALL_JOINED",localName:"GROUP_CALL_JOINED"},{no:25,name:"KIND_POLLS_VOTE",localName:"POLLS_VOTE"},{no:26,name:"KIND_POLLS_RECEIVED",localName:"POLLS_RECEIVED"},{no:27,name:"KIND_POLLS_OPENED",localName:"POLLS_OPENED"},{no:28,name:"KIND_GAMES_JOINED",localName:"GAMES_JOINED"},{no:29,name:"KIND_BUTTON_INITIALIZED",localName:"BUTTON_INITIALIZED"},{no:30,name:"KIND_POLLS_NAVIGATED",localName:"POLLS_NAVIGATED"}]),ie=i.makeEnum("streamlayer.analytics.v1.common.Category",[{no:0,name:"CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"CATEGORY_STATS_HOME",localName:"STATS_HOME"},{no:2,name:"CATEGORY_STATS",localName:"STATS"},{no:3,name:"CATEGORY_TWITTER_HOME",localName:"TWITTER_HOME"},{no:4,name:"CATEGORY_TWITTER",localName:"TWITTER"},{no:5,name:"CATEGORY_MESSAGING_HOME",localName:"MESSAGING_HOME"},{no:6,name:"CATEGORY_MESSAGING",localName:"MESSAGING"},{no:7,name:"CATEGORY_CALLING_HOME",localName:"CALLING_HOME"},{no:8,name:"CATEGORY_CALLING",localName:"CALLING"},{no:9,name:"CATEGORY_PROFILE_HOME",localName:"PROFILE_HOME"},{no:10,name:"CATEGORY_PROFILE",localName:"PROFILE"},{no:11,name:"CATEGORY_WHOISWATCHING",localName:"WHOISWATCHING"},{no:12,name:"CATEGORY_WHOISWATCHING_HOME",localName:"WHOISWATCHING_HOME"},{no:13,name:"CATEGORY_INTERSTITIAL",localName:"INTERSTITIAL"},{no:14,name:"CATEGORY_BETTING",localName:"BETTING"},{no:15,name:"CATEGORY_BETTING_HOME",localName:"BETTING_HOME"},{no:16,name:"CATEGORY_INPLAY",localName:"INPLAY"},{no:17,name:"CATEGORY_INPLAY_HOME",localName:"INPLAY_HOME"},{no:18,name:"CATEGORY_MERCHANDISE",localName:"MERCHANDISE"},{no:19,name:"CATEGORY_MERCHANDISE_HOME",localName:"MERCHANDISE_HOME"},{no:20,name:"CATEGORY_CONTESTS",localName:"CONTESTS"},{no:21,name:"CATEGORY_CONTESTS_HOME",localName:"CONTESTS_HOME"},{no:22,name:"CATEGORY_TICKETS",localName:"TICKETS"},{no:23,name:"CATEGORY_TICKETS_HOME",localName:"TICKETS_HOME"},{no:24,name:"CATEGORY_INVITATION",localName:"INVITATION"},{no:25,name:"CATEGORY_INVITATION_HOME",localName:"INVITATION_HOME"},{no:26,name:"CATEGORY_POLLS",localName:"POLLS"},{no:27,name:"CATEGORY_POLLS_HOME",localName:"POLLS_HOME"},{no:28,name:"CATEGORY_FANTASY",localName:"FANTASY"},{no:29,name:"CATEGORY_WP",localName:"WP"},{no:30,name:"CATEGORY_HIGHLIGHTS_HOME",localName:"HIGHLIGHTS_HOME"},{no:31,name:"CATEGORY_HIGHLIGHTS",localName:"HIGHLIGHTS"},{no:32,name:"CATEGORY_PUBLIC_CHAT_HOME",localName:"PUBLIC_CHAT_HOME"},{no:33,name:"CATEGORY_PUBLIC_CHAT",localName:"PUBLIC_CHAT"}]),La=i.makeEnum("streamlayer.analytics.v1.common.ScreenOrientation",[{no:0,name:"SCREEN_ORIENTATION_UNSET",localName:"UNSET"},{no:1,name:"SCREEN_ORIENTATION_PORTRAIT",localName:"PORTRAIT"},{no:2,name:"SCREEN_ORIENTATION_LANDSCAPE",localName:"LANDSCAPE"}]),pe=i.makeEnum("streamlayer.analytics.v1.common.TopicType",[{no:0,name:"TOPIC_TYPE_UNSET",localName:"UNSET"},{no:1,name:"TOPIC_TYPE_CALL",localName:"CALL"},{no:2,name:"TOPIC_TYPE_CHAT",localName:"CHAT"},{no:3,name:"TOPIC_TYPE_FANTASY",localName:"FANTASY"},{no:4,name:"TOPIC_TYPE_POLLS",localName:"POLLS"},{no:5,name:"TOPIC_TYPE_POLLS_POLL",localName:"POLLS_POLL"},{no:6,name:"TOPIC_TYPE_POLLS_TRIVIA",localName:"POLLS_TRIVIA"},{no:7,name:"TOPIC_TYPE_POLLS_PREDICTION",localName:"POLLS_PREDICTION"},{no:8,name:"TOPIC_TYPE_POLLS_INSIGHT",localName:"POLLS_INSIGHT"},{no:9,name:"TOPIC_TYPE_POLLS_TWITTER",localName:"POLLS_TWITTER"},{no:10,name:"TOPIC_TYPE_LINK",localName:"LINK"},{no:11,name:"TOPIC_TYPE_MESSAGE",localName:"MESSAGE"},{no:12,name:"TOPIC_TYPE_POLLS_PROMOTION",localName:"POLLS_PROMOTION"},{no:13,name:"TOPIC_TYPE_PUBLIC_CHAT",localName:"PUBLIC_CHAT"}]),Yo=i.makeEnum("streamlayer.analytics.v1.common.TopicSubType",[{no:0,name:"TOPIC_SUB_TYPE_UNSET",localName:"UNSET"},{no:1,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB21",localName:"PROMOTION_INGAME_IAB21"},{no:2,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB11",localName:"PROMOTION_INGAME_IAB11"},{no:3,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB61",localName:"PROMOTION_INGAME_IAB61"},{no:4,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB21_LBAR",localName:"PROMOTION_INGAME_IAB21_LBAR"},{no:5,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB11_LBAR",localName:"PROMOTION_INGAME_IAB11_LBAR"},{no:6,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB21_LBAR_ADDITIONAL",localName:"PROMOTION_INGAME_IAB21_LBAR_ADDITIONAL"},{no:7,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB11_LBAR_ADDITIONAL",localName:"PROMOTION_INGAME_IAB11_LBAR_ADDITIONAL"}]),ot=i.makeEnum("streamlayer.analytics.v1.common.PollOpenedFrom",[{no:0,name:"POLL_OPENED_FROM_UNSET",localName:"UNSET"},{no:1,name:"POLL_OPENED_FROM_IN_APP",localName:"IN_APP"},{no:2,name:"POLL_OPENED_FROM_HISTORY",localName:"HISTORY"},{no:3,name:"POLL_OPENED_FROM_PICK_HISTORY",localName:"PICK_HISTORY"},{no:4,name:"POLL_OPENED_FROM_INSIGHT_HISTORY",localName:"INSIGHT_HISTORY"},{no:5,name:"POLL_OPENED_FROM_TWEETS_HISTORY",localName:"TWEETS_HISTORY"},{no:6,name:"POLL_OPENED_FROM_PROMOTION_HISTORY",localName:"PROMOTION_HISTORY"}]),Vl=i.makeMessageType("streamlayer.social.TweetHashtags",()=>[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"indices",kind:"scalar",T:5,repeated:!0}]),xl=i.makeMessageType("streamlayer.social.TweetUrls",()=>[{no:1,name:"url",kind:"scalar",T:9},{no:2,name:"display_url",kind:"scalar",T:9},{no:3,name:"expanded_url",kind:"scalar",T:9},{no:4,name:"indices",kind:"scalar",T:5,repeated:!0}]),ql=i.makeMessageType("streamlayer.social.TweetMedia",()=>[{no:1,name:"id",kind:"scalar",T:3},{no:2,name:"id_str",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"url",kind:"scalar",T:9},{no:5,name:"media_url",kind:"scalar",T:9},{no:6,name:"display_url",kind:"scalar",T:9},{no:7,name:"expanded_url",kind:"scalar",T:9},{no:8,name:"media_url_https",kind:"scalar",T:9},{no:9,name:"source_user_id",kind:"scalar",T:3},{no:10,name:"source_user_id_str",kind:"scalar",T:9},{no:11,name:"source_status_id",kind:"scalar",T:3},{no:12,name:"source_status_id_str",kind:"scalar",T:9},{no:13,name:"sizes",kind:"message",T:jo},{no:14,name:"indices",kind:"scalar",T:5,repeated:!0}]),Hl=i.makeMessageType("streamlayer.social.TweetExtendedMedia",()=>[{no:1,name:"id",kind:"scalar",T:3},{no:2,name:"id_str",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"url",kind:"scalar",T:9},{no:5,name:"media_url",kind:"scalar",T:9},{no:6,name:"display_url",kind:"scalar",T:9},{no:7,name:"expanded_url",kind:"scalar",T:9},{no:8,name:"media_url_https",kind:"scalar",T:9},{no:9,name:"sizes",kind:"message",T:jo},{no:10,name:"indices",kind:"scalar",T:5,repeated:!0},{no:11,name:"video_info",kind:"message",T:Yl},{no:12,name:"additional_media_info",kind:"message",T:Ql}]),Ql=i.makeMessageType("streamlayer.social.TweetExtendedMedia.TweetAdditionalMediaInfo",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"embeddable",kind:"scalar",T:8},{no:4,name:"monetizable",kind:"scalar",T:8}],{localName:"TweetExtendedMedia_TweetAdditionalMediaInfo"}),Yl=i.makeMessageType("streamlayer.social.TweetMediaVideoInfo",()=>[{no:1,name:"aspect_ratio",kind:"scalar",T:5,repeated:!0},{no:2,name:"duration_millis",kind:"scalar",T:5},{no:3,name:"variants",kind:"message",T:jl,repeated:!0}]),jl=i.makeMessageType("streamlayer.social.TweetMediaVideoInfo.TweetVideoVariants",()=>[{no:1,name:"bitrate",kind:"scalar",T:5},{no:2,name:"content_type",kind:"scalar",T:9},{no:3,name:"url",kind:"scalar",T:9}],{localName:"TweetMediaVideoInfo_TweetVideoVariants"}),jo=i.makeMessageType("streamlayer.social.TweetMediaSizes",()=>[{no:1,name:"thumb",kind:"message",T:rn},{no:2,name:"large",kind:"message",T:rn},{no:3,name:"medium",kind:"message",T:rn},{no:4,name:"small",kind:"message",T:rn}]),rn=i.makeMessageType("streamlayer.social.TweetMediaSize",()=>[{no:1,name:"w",kind:"scalar",T:5},{no:2,name:"h",kind:"scalar",T:5},{no:3,name:"resize",kind:"scalar",T:9}]),$l=i.makeMessageType("streamlayer.social.TweetUserMentions",()=>[{no:1,name:"id",kind:"scalar",T:3},{no:2,name:"id_str",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"screen_name",kind:"scalar",T:9},{no:5,name:"indices",kind:"scalar",T:5,repeated:!0}]),Wl=i.makeMessageType("streamlayer.social.TweetSymbol",()=>[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"indices",kind:"scalar",T:5,repeated:!0}]),Kl=i.makeMessageType("streamlayer.social.TweetPoll",()=>[{no:1,name:"duration_minutes",kind:"scalar",T:9},{no:2,name:"end_datetime",kind:"scalar",T:9},{no:3,name:"options",kind:"message",T:zl,repeated:!0}]),zl=i.makeMessageType("streamlayer.social.TweetPoll.TweetPollOption",()=>[{no:1,name:"position",kind:"scalar",T:5},{no:2,name:"text",kind:"scalar",T:9}],{localName:"TweetPoll_TweetPollOption"}),Jl=i.makeMessageType("streamlayer.social.TweetMetadata",()=>[{no:1,name:"id_str",kind:"scalar",T:9},{no:2,name:"account",kind:"scalar",T:9},{no:3,name:"account_id",kind:"scalar",T:9},{no:4,name:"account_image",kind:"scalar",T:9},{no:8,name:"account_name",kind:"scalar",T:9},{no:9,name:"account_verified",kind:"scalar",T:8},{no:5,name:"retweeted_status",kind:"message",T:rs},{no:6,name:"entities",kind:"message",T:Xl},{no:7,name:"extended_entities",kind:"message",T:Zl},{no:10,name:"retweet_count",kind:"scalar",T:4},{no:11,name:"favorite_count",kind:"scalar",T:4}]),Xl=i.makeMessageType("streamlayer.social.TweetMetadata.TweetEntities",()=>[{no:1,name:"urls",kind:"message",T:xl,repeated:!0},{no:2,name:"hashtags",kind:"message",T:Vl,repeated:!0},{no:3,name:"media",kind:"message",T:ql,repeated:!0},{no:4,name:"user_mentions",kind:"message",T:$l,repeated:!0},{no:5,name:"symbols",kind:"message",T:Wl,repeated:!0},{no:6,name:"polls",kind:"message",T:Kl,repeated:!0}],{localName:"TweetMetadata_TweetEntities"}),Zl=i.makeMessageType("streamlayer.social.TweetMetadata.TweetExtendedEntities",()=>[{no:1,name:"media",kind:"message",T:Hl,repeated:!0}],{localName:"TweetMetadata_TweetExtendedEntities"}),rs=i.makeMessageType("streamlayer.social.Tweet",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"date",kind:"scalar",T:9},{no:3,name:"text",kind:"scalar",T:9},{no:4,name:"meta",kind:"message",T:Jl}]),F=i.makeEnum("streamlayer.interactive.QuestionType",[{no:0,name:"QUESTION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_TYPE_POLL",localName:"POLL"},{no:2,name:"QUESTION_TYPE_TRIVIA",localName:"TRIVIA"},{no:3,name:"QUESTION_TYPE_PREDICTION",localName:"PREDICTION"},{no:4,name:"QUESTION_TYPE_FACTOID",localName:"FACTOID"},{no:5,name:"QUESTION_TYPE_TWEET",localName:"TWEET"},{no:6,name:"QUESTION_TYPE_PROMOTION",localName:"PROMOTION"}]),em=i.makeEnum("streamlayer.interactive.QuestionSource",[{no:0,name:"QUESTION_SOURCE_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_SOURCE_AI",localName:"AI"},{no:2,name:"QUESTION_SOURCE_CSV_IMPORT",localName:"CSV_IMPORT"}]),le=i.makeEnum("streamlayer.interactive.QuestionStatus",[{no:0,name:"QUESTION_STATUS_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_STATUS_NOT_SCHEDULED",localName:"NOT_SCHEDULED"},{no:2,name:"QUESTION_STATUS_SCHEDULED",localName:"SCHEDULED"},{no:3,name:"QUESTION_STATUS_ACTIVE",localName:"ACTIVE"},{no:4,name:"QUESTION_STATUS_RESOLVED",localName:"RESOLVED"}]),tm=i.makeEnum("streamlayer.interactive.QuestionPosition",[{no:0,name:"QUESTION_POSITION_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_POSITION_DEFAULT",localName:"DEFAULT"},{no:2,name:"QUESTION_POSITION_FIXED_BOTTOM",localName:"FIXED_BOTTOM"}]),nm=i.makeEnum("streamlayer.interactive.QuestionLayout",[{no:0,name:"QUESTION_LAYOUT_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_LAYOUT_LIST_VIEW",localName:"LIST_VIEW"},{no:2,name:"QUESTION_LAYOUT_GRID_VIEW",localName:"GRID_VIEW"}]),nt=i.makeEnum("streamlayer.interactive.QuestionImages",[{no:0,name:"QUESTION_IMAGES_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_IMAGES_NONE",localName:"NONE"},{no:2,name:"QUESTION_IMAGES_ROUNDED",localName:"ROUNDED"},{no:3,name:"QUESTION_IMAGES_TRANSPARENT",localName:"TRANSPARENT"},{no:4,name:"QUESTION_IMAGES_CENTERED",localName:"CENTERED"}]),am=i.makeEnum("streamlayer.interactive.NotificationPromotionMode",[{no:0,name:"NOTIFICATION_PROMOTION_MODE_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_PROMOTION_MODE_CLASSIC",localName:"CLASSIC"},{no:2,name:"NOTIFICATION_PROMOTION_MODE_LOWER_THIRD",localName:"LOWER_THIRD"},{no:3,name:"NOTIFICATION_PROMOTION_MODE_RICH_NOTIFICATION",localName:"RICH_NOTIFICATION"}]),sm=i.makeEnum("streamlayer.interactive.NotificationPromotionImagePosition",[{no:0,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_FIT",localName:"FIT"},{no:2,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_CENTERED",localName:"CENTERED"},{no:3,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_BOTTOM",localName:"BOTTOM"},{no:4,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_SOLID",localName:"SOLID"},{no:5,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_MIDDLE",localName:"MIDDLE"}]),rm=i.makeEnum("streamlayer.interactive.NotificationSponsorLogoMode",[{no:0,name:"NOTIFICATION_SPONSOR_LOGO_UNSET"},{no:1,name:"NOTIFICATION_SPONSOR_LOGO_NONE"},{no:2,name:"NOTIFICATION_SPONSOR_LOGO_TRANSPARENT"}]),om=i.makeEnum("streamlayer.interactive.CtaIconMode",[{no:0,name:"CTA_ICON_UNSET"},{no:1,name:"CTA_ICON_NONE"},{no:2,name:"CTA_ICON_TRANSPARENT"}]),$o=i.makeEnum("streamlayer.interactive.ImagePosition",[{no:0,name:"IMAGE_POSITION_UNSET",localName:"UNSET"},{no:1,name:"IMAGE_POSITION_LEFT",localName:"LEFT"},{no:2,name:"IMAGE_POSITION_RIGHT",localName:"RIGHT"}]),im=i.makeEnum("streamlayer.interactive.PromotionType",[{no:0,name:"PROMOTION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"PROMOTION_TYPE_INGAME_IAB21",localName:"INGAME_IAB21"},{no:2,name:"PROMOTION_TYPE_INGAME_IAB11",localName:"INGAME_IAB11"},{no:3,name:"PROMOTION_TYPE_INGAME_IAB61",localName:"INGAME_IAB61"},{no:4,name:"PROMOTION_TYPE_INGAME_IAB11_LBAR",localName:"INGAME_IAB11_LBAR"},{no:5,name:"PROMOTION_TYPE_INGAME_IAB21_LBAR",localName:"INGAME_IAB21_LBAR"}]),cm=i.makeEnum("streamlayer.interactive.PromotionWallet",[{no:0,name:"PROMOTION_WALLET_UNSET",localName:"UNSET"},{no:1,name:"PROMOTION_WALLET_ENABLED",localName:"ENABLED"},{no:2,name:"PROMOTION_WALLET_DISABLED",localName:"DISABLED"}]),lm=i.makeEnum("streamlayer.interactive.PromotionLogoMode",[{no:0,name:"PROMOTION_LOGO_MODE_UNSET",localName:"UNSET"},{no:1,name:"PROMOTION_LOGO_MODE_LEFT",localName:"LEFT"},{no:2,name:"PROMOTION_LOGO_MODE_CENTER",localName:"CENTER"},{no:3,name:"PROMOTION_LOGO_MODE_MINMAL",localName:"MINMAL"}]),Wo=i.makeEnum("streamlayer.interactive.UseAsNotification",[{no:0,name:"USE_AS_NOTIFICATION_UNSET",localName:"UNSET"},{no:1,name:"USE_AS_NOTIFICATION_ENABLED",localName:"ENABLED"},{no:2,name:"USE_AS_NOTIFICATION_DISABLED",localName:"DISABLED"}]),mm=i.makeEnum("streamlayer.interactive.NotificationEnabled",[{no:0,name:"NOTIFICATION_ENABLED_UNSET"},{no:1,name:"NOTIFICATION_ENABLED"},{no:2,name:"NOTIFICATION_DISABLED"}]),um=i.makeEnum("streamlayer.interactive.QuestionAutoPostState",[{no:0,name:"QUESTION_AUTO_POST_STATE_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_AUTO_POST_STATE_ON",localName:"ON"},{no:2,name:"QUESTION_AUTO_POST_STATE_OFF",localName:"OFF"},{no:3,name:"QUESTION_AUTO_POST_STATE_PAUSED",localName:"PAUSED"},{no:4,name:"QUESTION_AUTO_POST_STATE_IDLE",localName:"IDLE"},{no:5,name:"QUESTION_AUTO_POST_STATE_RESET",localName:"RESET"}]),dm=i.makeEnum("streamlayer.interactive.QuestionAutoPostStart",[{no:0,name:"QUESTION_AUTO_POST_START_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_AUTO_POST_START_SCHEDULE",localName:"SCHEDULE"},{no:2,name:"QUESTION_AUTO_POST_START_NOW",localName:"NOW"}]),pm=i.makeEnum("streamlayer.interactive.QuestionSkipReason",[{no:0,name:"QUESTION_SKIP_REASON_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_SKIP_REASON_OVERDUE",localName:"OVERDUE"}]),Ko=i.makeEnum("streamlayer.interactive.SilenceSetting",[{no:0,name:"SILENCE_SETTING_UNSET",localName:"UNSET"},{no:1,name:"SILENCE_SETTING_ON",localName:"ON"},{no:2,name:"SILENCE_SETTING_OFF",localName:"OFF"}]),Tm=i.makeEnum("streamlayer.interactive.ImportStatus",[{no:0,name:"IMPORT_STATUS_UNSET",localName:"UNSET"},{no:1,name:"IMPORT_STATUS_PLANNED",localName:"PLANNED"},{no:2,name:"IMPORT_STATUS_RUNNING",localName:"RUNNING"},{no:3,name:"IMPORT_STATUS_COMPLETED",localName:"COMPLETED"},{no:4,name:"IMPORT_STATUS_FAILED",localName:"FAILED"}]),os=i.makeMessageType("streamlayer.interactive.QuestionAppearance",()=>[{no:1,name:"layout",kind:"enum",T:i.getEnumType(nm)},{no:2,name:"images",kind:"enum",T:i.getEnumType(nt)},{no:3,name:"primary_color",kind:"scalar",T:9},{no:4,name:"position",kind:"enum",T:i.getEnumType(tm)},{no:5,name:"auto_hide_interval",kind:"scalar",T:4}]),Ct=i.makeMessageType("streamlayer.interactive.Sponsorship",()=>[{no:1,name:"logo",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),ym=i.makeMessageType("streamlayer.interactive.PromotionNotification",()=>[{no:1,name:"sponsor_logo",kind:"scalar",T:9},{no:2,name:"sponsor_logo_mode",kind:"enum",T:i.getEnumType(rm)},{no:3,name:"cta_button",kind:"message",T:Jo},{no:4,name:"image_position",kind:"enum",T:i.getEnumType(sm)},{no:5,name:"mode",kind:"enum",T:i.getEnumType(am)}]),is=i.makeMessageType("streamlayer.interactive.QuestionNotification",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:9},{no:3,name:"indicator_color",kind:"scalar",T:9},{no:4,name:"image_position",kind:"enum",T:i.getEnumType($o)},{no:5,name:"body",kind:"scalar",T:9},{no:6,name:"image_mode",kind:"enum",T:i.getEnumType(nt)},{no:7,name:"promotion",kind:"message",T:ym},{no:8,name:"enabled",kind:"enum",T:i.getEnumType(mm)}]),gm=i.makeMessageType("streamlayer.interactive.QuestionAnswer",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"icon",kind:"scalar",T:9},{no:4,name:"correct",kind:"scalar",T:8},{no:5,name:"points",kind:"scalar",T:13}]),fm=i.makeMessageType("streamlayer.interactive.ExtendedQuestionAnswer",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"icon",kind:"scalar",T:9},{no:4,name:"correct",kind:"scalar",T:8},{no:5,name:"points",kind:"scalar",T:13},{no:6,name:"percentage",kind:"scalar",T:13},{no:7,name:"you_voted",kind:"scalar",T:8},{no:8,name:"percentage_decimal",kind:"scalar",T:1},{no:9,name:"points_earned",kind:"scalar",T:13}]),Xe=i.makeMessageType("streamlayer.interactive.AnswerFeedback",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9}]),cs=i.makeMessageType("streamlayer.interactive.FileLink",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"thumbnail_url",kind:"scalar",T:9}]),zo=i.makeMessageType("streamlayer.interactive.WebLink",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9}]),Jo=i.makeMessageType("streamlayer.interactive.CTAButton",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"color",kind:"scalar",T:9},{no:3,name:"text_color",kind:"scalar",T:9,opt:!0},{no:4,name:"cta_icon",kind:"scalar",T:9},{no:5,name:"cta_icon_mode",kind:"enum",T:i.getEnumType(om)}]),er=i.makeMessageType("streamlayer.interactive.Banner",()=>[{no:1,name:"image_url",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"cta_button",kind:"message",T:Jo},{no:4,name:"video",kind:"message",T:cs},{no:5,name:"body",kind:"scalar",T:9,opt:!0},{no:6,name:"analytics_topic_sub_type",kind:"enum",T:i.getEnumType(Yo),opt:!0},{no:7,name:"title",kind:"scalar",T:9,opt:!0}]),Xo=i.makeMessageType("streamlayer.interactive.QuestionOptions",()=>[{no:1,name:"poll",kind:"message",T:km,oneof:"options"},{no:2,name:"trivia",kind:"message",T:hm,oneof:"options"},{no:3,name:"prediction",kind:"message",T:Sm,oneof:"options"},{no:4,name:"factoid",kind:"message",T:_m,oneof:"options"},{no:5,name:"tweet",kind:"message",T:Em,oneof:"options"},{no:6,name:"promotion",kind:"message",T:Im,oneof:"options"}]),km=i.makeMessageType("streamlayer.interactive.QuestionOptions.PollOptions",[],{localName:"QuestionOptions_PollOptions"}),hm=i.makeMessageType("streamlayer.interactive.QuestionOptions.TriviaOptions",()=>[{no:1,name:"correct_feedback",kind:"message",T:Xe},{no:2,name:"incorrect_feedback",kind:"message",T:Xe},{no:3,name:"points",kind:"scalar",T:4}],{localName:"QuestionOptions_TriviaOptions"}),Sm=i.makeMessageType("streamlayer.interactive.QuestionOptions.PredictionOptions",()=>[{no:1,name:"correct_feedback",kind:"message",T:Xe},{no:2,name:"incorrect_feedback",kind:"message",T:Xe}],{localName:"QuestionOptions_PredictionOptions"}),_m=i.makeMessageType("streamlayer.interactive.QuestionOptions.FactoidOptions",()=>[{no:1,name:"image",kind:"scalar",T:9},{no:2,name:"body",kind:"scalar",T:9},{no:3,name:"video",kind:"message",T:cs},{no:4,name:"web_link",kind:"message",T:zo},{no:5,name:"image_mode",kind:"enum",T:i.getEnumType(nt)},{no:6,name:"use_as_notification",kind:"enum",T:i.getEnumType(Wo)}],{localName:"QuestionOptions_FactoidOptions"}),Em=i.makeMessageType("streamlayer.interactive.QuestionOptions.TweetOptions",()=>[{no:1,name:"tweet_url",kind:"scalar",T:9},{no:2,name:"tweet_id",kind:"scalar",T:9},{no:3,name:"tweet_meta",kind:"message",T:bm}],{localName:"QuestionOptions_TweetOptions"}),bm=i.makeMessageType("streamlayer.interactive.QuestionOptions.TweetOptions.TweetMetadata",()=>[{no:1,name:"account",kind:"scalar",T:9},{no:2,name:"account_verified",kind:"scalar",T:8},{no:3,name:"has_media",kind:"scalar",T:8},{no:4,name:"tweet",kind:"message",T:rs}],{localName:"QuestionOptions_TweetOptions_TweetMetadata"}),Im=i.makeMessageType("streamlayer.interactive.QuestionOptions.PromotionOptions",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(im)},{no:2,name:"sponsor",kind:"message",T:Ct},{no:3,name:"banner",kind:"message",T:er},{no:4,name:"enable_wallet",kind:"enum",T:i.getEnumType(cm)},{no:5,name:"additional_banner",kind:"message",T:er},{no:6,name:"coupon",kind:"scalar",T:9},{no:7,name:"logo_mode",kind:"enum",T:i.getEnumType(lm)},{no:8,name:"coupon_zip",kind:"scalar",T:9},{no:9,name:"coupon_barcode_url",kind:"scalar",T:9}],{localName:"QuestionOptions_PromotionOptions"}),Nm=i.makeMessageType("streamlayer.interactive.Tag",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"label",kind:"scalar",T:9},{no:3,name:"last_used_time",kind:"scalar",T:4}]),vm=i.makeMessageType("streamlayer.interactive.QuestionAi",()=>[{no:1,name:"verified",kind:"scalar",T:8}]),Zo=i.makeMessageType("streamlayer.interactive.Question",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(F)},{no:3,name:"subject",kind:"scalar",T:9,opt:!0},{no:4,name:"options",kind:"message",T:Xo},{no:5,name:"appearance",kind:"message",T:os},{no:6,name:"sponsorship",kind:"message",T:Ct},{no:7,name:"notification",kind:"message",T:is},{no:8,name:"answers",kind:"message",T:gm,repeated:!0},{no:9,name:"status",kind:"enum",T:i.getEnumType(le)},{no:10,name:"position",kind:"scalar",T:13,opt:!0},{no:11,name:"market_closed",kind:"scalar",T:8},{no:12,name:"activated_at",kind:"scalar",T:9},{no:13,name:"answer_set_at",kind:"scalar",T:9},{no:14,name:"overrides",kind:"map",K:9,V:{kind:"scalar",T:8}},{no:15,name:"event_id",kind:"scalar",T:9},{no:16,name:"stream_timestamp",kind:"message",T:ue},{no:17,name:"tags",kind:"message",T:Nm,repeated:!0},{no:18,name:"bypass_notifications",kind:"message",T:ms},{no:19,name:"import_id",kind:"scalar",T:9},{no:20,name:"activation_trigger_count",kind:"scalar",T:13,opt:!0},{no:21,name:"source",kind:"enum",T:i.getEnumType(em)},{no:22,name:"ai",kind:"message",T:vm},{no:23,name:"has_triggers",kind:"scalar",T:8,opt:!0}]),ls=i.makeMessageType("streamlayer.interactive.ExtendedQuestion",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(F)},{no:3,name:"subject",kind:"scalar",T:9},{no:4,name:"options",kind:"message",T:Xo},{no:5,name:"appearance",kind:"message",T:os},{no:6,name:"sponsorship",kind:"message",T:Ct},{no:7,name:"notification",kind:"message",T:is},{no:8,name:"answers",kind:"message",T:fm,repeated:!0},{no:9,name:"status",kind:"enum",T:i.getEnumType(le)},{no:10,name:"position",kind:"scalar",T:13},{no:11,name:"market_closed",kind:"scalar",T:8},{no:12,name:"activated_at",kind:"scalar",T:9},{no:13,name:"answer_set_at",kind:"scalar",T:9},{no:14,name:"event_id",kind:"scalar",T:9},{no:15,name:"bypass_notifications",kind:"message",T:ms}]),ei=i.makeMessageType("streamlayer.interactive.EventModeration",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9},{no:3,name:"sponsorship",kind:"message",T:Ct},{no:4,name:"onboarding_enabled",kind:"scalar",T:8},{no:5,name:"question",kind:"message",T:Om},{no:6,name:"sponsors",kind:"message",T:Rm},{no:7,name:"notification",kind:"message",T:Lm},{no:8,name:"activated_at",kind:"message",T:ue},{no:9,name:"deactivated_at",kind:"message",T:ue},{no:10,name:"question_auto_post",kind:"message",T:Mm},{no:11,name:"bypass_notifications",kind:"message",T:ms},{no:12,name:"importer_collaboration",kind:"message",T:Gm}]),Om=i.makeMessageType("streamlayer.interactive.EventModeration.QuestionSettings",()=>[{no:1,name:"appearance",kind:"message",T:os},{no:2,name:"trivia",kind:"message",T:Am},{no:3,name:"prediction",kind:"message",T:wm},{no:4,name:"correct_feedbacks",kind:"message",T:Xe,repeated:!0},{no:5,name:"incorrect_feedbacks",kind:"message",T:Xe,repeated:!0}],{localName:"EventModeration_QuestionSettings"}),Am=i.makeMessageType("streamlayer.interactive.EventModeration.QuestionSettings.TriviaCardSettings",()=>[{no:1,name:"points",kind:"scalar",T:13}],{localName:"EventModeration_QuestionSettings_TriviaCardSettings"}),wm=i.makeMessageType("streamlayer.interactive.EventModeration.QuestionSettings.PredictionCardSettings",()=>[{no:1,name:"max_points",kind:"scalar",T:13}],{localName:"EventModeration_QuestionSettings_PredictionCardSettings"}),Rm=i.makeMessageType("streamlayer.interactive.EventModeration.SponsorshipSettings",()=>[{no:1,name:"sponsors",kind:"message",T:Ct,repeated:!0}],{localName:"EventModeration_SponsorshipSettings"}),Lm=i.makeMessageType("streamlayer.interactive.EventModeration.NotificationSettings",()=>[{no:1,name:"image",kind:"scalar",T:9},{no:2,name:"indicator_color",kind:"scalar",T:9},{no:3,name:"image_position",kind:"enum",T:i.getEnumType($o)},{no:4,name:"image_mode",kind:"enum",T:i.getEnumType(nt)}],{localName:"EventModeration_NotificationSettings"}),Mm=i.makeMessageType("streamlayer.interactive.QuestionAutoPost",()=>[{no:1,name:"state",kind:"enum",T:i.getEnumType(um)},{no:2,name:"interval",kind:"scalar",T:13},{no:3,name:"next_post_time",kind:"message",T:ue},{no:4,name:"start_mode",kind:"enum",T:i.getEnumType(dm)},{no:5,name:"start_options",kind:"message",T:Pm}]),Pm=i.makeMessageType("streamlayer.interactive.QuestionAutoPostStartOptions",()=>[{no:1,name:"schedule",kind:"message",T:Cm,oneof:"options"}]),Cm=i.makeMessageType("streamlayer.interactive.QuestionAutoPostStartOptions.ScheduleOptions",()=>[{no:1,name:"timestamp",kind:"scalar",T:4}],{localName:"QuestionAutoPostStartOptions_ScheduleOptions"}),Bn=i.makeMessageType("streamlayer.interactive.Pagination",()=>[{no:1,name:"page",kind:"scalar",T:5},{no:2,name:"page_size",kind:"scalar",T:5},{no:3,name:"cursor",kind:"scalar",T:9}]),Dm=i.makeMessageType("streamlayer.interactive.Sort",()=>[{no:1,name:"field",kind:"scalar",T:9},{no:2,name:"order",kind:"scalar",T:9}]),ms=i.makeMessageType("streamlayer.interactive.BypassNotifications",()=>[{no:1,name:"in_app_silence",kind:"enum",T:i.getEnumType(Ko)}]),Um=i.makeMessageType("streamlayer.interactive.ImportError",()=>[{no:1,name:"row_id",kind:"scalar",T:9},{no:2,name:"message",kind:"scalar",T:9}]),Fm=i.makeMessageType("streamlayer.interactive.ImportProgress",()=>[{no:1,name:"import_id",kind:"scalar",T:9},{no:2,name:"status",kind:"enum",T:i.getEnumType(Tm)},{no:3,name:"errors",kind:"message",T:Um,repeated:!0},{no:4,name:"last_updated",kind:"message",T:ue}]),Gm=i.makeMessageType("streamlayer.interactive.ImporterCollaboration",()=>[{no:1,name:"imports",kind:"map",K:9,V:{kind:"message",T:Fm}}]),Et=i.makeEnum("streamlayer.interactive.feed.PickHistoryStatus",[{no:0,name:"PICK_HISTORY_STATUS_UNSET",localName:"UNSET"},{no:1,name:"PICK_HISTORY_STATUS_WON",localName:"WON"},{no:2,name:"PICK_HISTORY_STATUS_LOST",localName:"LOST"},{no:3,name:"PICK_HISTORY_STATUS_DNP",localName:"DNP"}]),Bm=i.makeEnum("streamlayer.interactive.feed.FeedUpdateType",[{no:0,name:"UPDATE_TYPE_UNSET"},{no:1,name:"UPDATE_TYPE_QUESTION_ACTIVATE"},{no:2,name:"UPDATE_TYPE_QUESTION_SET_CORRECT_ANSWER"},{no:3,name:"UPDATE_TYPE_QUESTION_RESOLVE"}]),ti=i.makeMessageType("streamlayer.interactive.feed.FeedQuestion",()=>[{no:1,name:"question",kind:"message",T:Zo},{no:2,name:"notification",kind:"message",T:is},{no:3,name:"moderation",kind:"message",T:ei},{no:4,name:"feed_item",kind:"message",T:ds}]),Vm=i.makeMessageType("streamlayer.interactive.feed.SubscriptionRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9},{no:2,name:"feed_id",kind:"scalar",T:9}]),xm=i.makeMessageType("streamlayer.interactive.feed.SubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:qm}]),qm=i.makeMessageType("streamlayer.interactive.feed.SubscriptionResponse.SubscriptionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ti}],{localName:"SubscriptionResponse_SubscriptionResponseData"}),Hm=i.makeMessageType("streamlayer.interactive.feed.VotingSubscriptionRequest",()=>[{no:1,name:"feed_id",kind:"scalar",T:9},{no:2,name:"question_id",kind:"scalar",T:9}]),Qm=i.makeMessageType("streamlayer.interactive.feed.VotingSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:Ym}]),Ym=i.makeMessageType("streamlayer.interactive.feed.VotingSubscriptionResponse.VotingSubscriptionResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:us,repeated:!0}],{localName:"VotingSubscriptionResponse_VotingSubscriptionResponseData"}),jm=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscription",()=>[{no:1,name:"question",kind:"message",T:ls}]),$m=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscriptionRequest",()=>[{no:1,name:"question_id",kind:"scalar",T:9}]),Wm=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:Km}]),Km=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscriptionResponse.QuestionSubscriptionResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:jm}],{localName:"QuestionSubscriptionResponse_QuestionSubscriptionResponseData"}),zm=i.makeMessageType("streamlayer.interactive.feed.QuestionByUser",()=>[{no:1,name:"question",kind:"message",T:ls}]),Jm=i.makeMessageType("streamlayer.interactive.feed.QuestionByUserRequest",()=>[{no:1,name:"question_id",kind:"scalar",T:9}]),Xm=i.makeMessageType("streamlayer.interactive.feed.QuestionByUserResponse",()=>[{no:1,name:"data",kind:"message",T:Zm}]),Zm=i.makeMessageType("streamlayer.interactive.feed.QuestionByUserResponse.QuestionByUserResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:zm}],{localName:"QuestionByUserResponse_QuestionByUserResponseData"}),eu=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionRequest",()=>[{no:1,name:"filter",kind:"message",T:tu}]),tu=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionRequest.SyncQuestionRequestFilter",()=>[{no:1,name:"event_id",kind:"scalar",T:9}],{localName:"SyncQuestionRequest_SyncQuestionRequestFilter"}),nu=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionResponse",()=>[{no:1,name:"data",kind:"message",T:au}]),au=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionResponse.SyncQuestionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ti}],{localName:"SyncQuestionResponse_SyncQuestionResponseData"}),su=i.makeMessageType("streamlayer.interactive.feed.GetQuestionRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),ru=i.makeMessageType("streamlayer.interactive.feed.GetQuestionResponse",()=>[{no:1,name:"data",kind:"message",T:ou}]),ou=i.makeMessageType("streamlayer.interactive.feed.GetQuestionResponse.GetQuestionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Zo}],{localName:"GetQuestionResponse_GetQuestionResponseData"}),iu=i.makeMessageType("streamlayer.interactive.feed.QuestionDetailRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),cu=i.makeMessageType("streamlayer.interactive.feed.QuestionDetailResponse",()=>[{no:1,name:"data",kind:"message",T:lu}]),lu=i.makeMessageType("streamlayer.interactive.feed.QuestionDetailResponse.QuestionDetailResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ls}],{localName:"QuestionDetailResponse_QuestionDetailResponseData"}),us=i.makeMessageType("streamlayer.interactive.feed.AnswerVoteResult",()=>[{no:1,name:"answer_id",kind:"scalar",T:9},{no:2,name:"percentage",kind:"scalar",T:13},{no:3,name:"voted",kind:"scalar",T:8},{no:4,name:"correct",kind:"scalar",T:8}]),mu=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerRequest",()=>[{no:1,name:"data",kind:"message",T:uu}]),uu=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerRequest.SubmitRequestData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"answer_id",kind:"scalar",T:9}],{localName:"SubmitAnswerRequest_SubmitRequestData"}),du=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerResponse",()=>[{no:1,name:"data",kind:"message",T:pu}]),pu=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerResponse.SubmitAnswerResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:us,repeated:!0}],{localName:"SubmitAnswerResponse_SubmitAnswerResponseData"}),Tu=i.makeMessageType("streamlayer.interactive.feed.SubmitInplayRequest",()=>[{no:1,name:"data",kind:"message",T:yu}]),yu=i.makeMessageType("streamlayer.interactive.feed.SubmitInplayRequest.SubmitRequestData",()=>[{no:1,name:"event_id",kind:"scalar",T:13}],{localName:"SubmitInplayRequest_SubmitRequestData"}),gu=i.makeMessageType("streamlayer.interactive.feed.SubmitInplayResponse",[]),fu=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionRequest",()=>[{no:1,name:"data",kind:"message",T:ku}]),ku=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionRequest.SkipQuestionRequestData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"reason",kind:"enum",T:i.getEnumType(pm)}],{localName:"SkipQuestionRequest_SkipQuestionRequestData"}),hu=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionResponse",()=>[{no:1,name:"data",kind:"message",T:Su}]),Su=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionResponse.SkipQuestionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:us,repeated:!0}],{localName:"SkipQuestionResponse_SkipQuestionResponseData"}),_u=i.makeMessageType("streamlayer.interactive.feed.PickHistoryRequest",()=>[{no:1,name:"question_type",kind:"enum",T:i.getEnumType(F),repeated:!0},{no:3,name:"event_id",kind:"scalar",T:9},{no:2,name:"pagination",kind:"message",T:Bn}]),ni=i.makeMessageType("streamlayer.interactive.feed.PickHistory",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"answer_id",kind:"scalar",T:9},{no:3,name:"status",kind:"enum",T:i.getEnumType(Et)},{no:4,name:"question_type",kind:"enum",T:i.getEnumType(F)},{no:5,name:"subject",kind:"scalar",T:9},{no:6,name:"text",kind:"scalar",T:9},{no:7,name:"open_for_voting",kind:"scalar",T:8},{no:8,name:"question_status",kind:"enum",T:i.getEnumType(le)}]),Eu=i.makeMessageType("streamlayer.interactive.feed.PickHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:bu,repeated:!0},{no:2,name:"meta",kind:"message",T:Iu}]),bu=i.makeMessageType("streamlayer.interactive.feed.PickHistoryResponse.PickHistoryResponseData",()=>[{no:1,name:"attributes",kind:"message",T:ni}],{localName:"PickHistoryResponse_PickHistoryResponseData"}),Iu=i.makeMessageType("streamlayer.interactive.feed.PickHistoryResponse.PickHistoryResponseMetadata",()=>[{no:1,name:"total",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"PickHistoryResponse_PickHistoryResponseMetadata"}),Nu=i.makeMessageType("streamlayer.interactive.feed.InsightHistoryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),vu=i.makeMessageType("streamlayer.interactive.feed.InstantView",()=>[{no:1,name:"heading",kind:"scalar",T:9,opt:!0},{no:2,name:"body",kind:"scalar",T:9,opt:!0},{no:3,name:"image",kind:"scalar",T:9,opt:!0},{no:4,name:"video",kind:"message",T:cs,opt:!0},{no:5,name:"web_link",kind:"message",T:zo,opt:!0},{no:6,name:"image_mode",kind:"enum",T:i.getEnumType(nt)}]),Ou=i.makeMessageType("streamlayer.interactive.feed.InsightNotification",()=>[{no:1,name:"title",kind:"scalar",T:9,opt:!0},{no:2,name:"body",kind:"scalar",T:9,opt:!0},{no:3,name:"image_position",kind:"scalar",T:5,opt:!0}]),ai=i.makeMessageType("streamlayer.interactive.feed.InsightHistory",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"image",kind:"scalar",T:9},{no:4,name:"image_mode",kind:"enum",T:i.getEnumType(nt)},{no:5,name:"instant_view",kind:"message",T:vu,opt:!0},{no:6,name:"notification",kind:"message",T:Ou,opt:!0},{no:7,name:"use_as_notification",kind:"enum",T:i.getEnumType(Wo)}]),Au=i.makeMessageType("streamlayer.interactive.feed.InsightHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:wu,repeated:!0}]),wu=i.makeMessageType("streamlayer.interactive.feed.InsightHistoryResponse.InsightHistoryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ai}],{localName:"InsightHistoryResponse_InsightHistoryResponseData"}),Ru=i.makeMessageType("streamlayer.interactive.feed.TweetHistoryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),si=i.makeMessageType("streamlayer.interactive.feed.TweetHistory",()=>[{no:1,name:"tweet_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"image",kind:"scalar",T:9},{no:4,name:"body",kind:"scalar",T:9},{no:5,name:"account",kind:"scalar",T:9},{no:6,name:"account_verified",kind:"scalar",T:8},{no:7,name:"tweet",kind:"message",T:rs}]),Lu=i.makeMessageType("streamlayer.interactive.feed.TweetHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:Mu,repeated:!0}]),Mu=i.makeMessageType("streamlayer.interactive.feed.TweetHistoryResponse.TweetHistoryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:si}],{localName:"TweetHistoryResponse_TweetHistoryResponseData"}),Pu=i.makeMessageType("streamlayer.interactive.feed.InteractiveFeed",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"options",kind:"message",T:Cu},{no:3,name:"moderation",kind:"message",T:ei}]),Cu=i.makeMessageType("streamlayer.interactive.feed.FeedOptions",()=>[{no:1,name:"onboarding_enabled",kind:"scalar",T:8}]),Du=i.makeMessageType("streamlayer.interactive.feed.GetRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),Uu=i.makeMessageType("streamlayer.interactive.feed.GetResponse",()=>[{no:1,name:"data",kind:"message",T:Fu}]),Fu=i.makeMessageType("streamlayer.interactive.feed.GetResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Pu}],{localName:"GetResponse_GetResponseData"}),Gu=i.makeMessageType("streamlayer.interactive.feed.PromotionHistoryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),ri=i.makeMessageType("streamlayer.interactive.feed.PromotionHistory",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"image",kind:"scalar",T:9}]),Bu=i.makeMessageType("streamlayer.interactive.feed.PromotionHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:Vu,repeated:!0}]),Vu=i.makeMessageType("streamlayer.interactive.feed.PromotionHistoryResponse.PromotionHistoryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ri}],{localName:"PromotionHistoryResponse_PromotionHistoryResponseData"}),xu=i.makeMessageType("streamlayer.interactive.feed.FeedItemAttributes",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(F)},{no:3,name:"status",kind:"enum",T:i.getEnumType(le)},{no:8,name:"created",kind:"scalar",T:9},{no:4,name:"question",kind:"message",T:ni,oneof:"attributes"},{no:5,name:"tweet",kind:"message",T:si,oneof:"attributes"},{no:6,name:"insight",kind:"message",T:ai,oneof:"attributes"},{no:7,name:"promotion",kind:"message",T:ri,oneof:"attributes"}]),ds=i.makeMessageType("streamlayer.interactive.feed.FeedItem",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:xu}]),qu=i.makeMessageType("streamlayer.interactive.feed.FeedListRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9},{no:2,name:"filter",kind:"message",T:Hu},{no:3,name:"pagination",kind:"message",T:Bn}]),Hu=i.makeMessageType("streamlayer.interactive.feed.FeedListRequest.FeedListFilter",()=>[{no:1,name:"types",kind:"enum",T:i.getEnumType(F),repeated:!0},{no:2,name:"statuses",kind:"enum",T:i.getEnumType(le),repeated:!0}],{localName:"FeedListRequest_FeedListFilter"}),Qu=i.makeMessageType("streamlayer.interactive.feed.FeedListResponse",()=>[{no:1,name:"data",kind:"message",T:ds,repeated:!0},{no:2,name:"meta",kind:"message",T:Yu}]),Yu=i.makeMessageType("streamlayer.interactive.feed.FeedListResponse.FeedListResponseMetadata",()=>[{no:1,name:"total",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"FeedListResponse_FeedListResponseMetadata"}),ju=i.makeMessageType("streamlayer.interactive.feed.FeedSubscriptionRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),$u=i.makeMessageType("streamlayer.interactive.feed.FeedSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:ds},{no:2,name:"meta",kind:"message",T:Wu}]),Wu=i.makeMessageType("streamlayer.interactive.feed.FeedSubscriptionResponse.FeedSubscriptionMeta",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(Bm)}],{localName:"FeedSubscriptionResponse_FeedSubscriptionMeta"}),Ku=i.makeMessageType("streamlayer.sdkSettings.game.common.GameAppearance",()=>[{no:1,name:"primary_color",kind:"scalar",T:9},{no:2,name:"secondary_color",kind:"scalar",T:9},{no:3,name:"accent_color",kind:"scalar",T:9}]),zu=i.makeMessageType("streamlayer.sdkSettings.game.common.GameMedia",()=>[{no:1,name:"game_icon",kind:"scalar",T:9},{no:2,name:"sponsor_logo",kind:"scalar",T:9}]),Ju=i.makeMessageType("streamlayer.sdkSettings.game.common.GamePrize",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:9}]),Xu=i.makeMessageType("streamlayer.sdkSettings.game.common.GameOverview",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"auto_activate",kind:"scalar",T:8},{no:4,name:"scoring",kind:"scalar",T:8},{no:5,name:"media",kind:"message",T:zu},{no:6,name:"appearance",kind:"message",T:Ku},{no:7,name:"prizes",kind:"message",T:Ju,repeated:!0},{no:8,name:"completed",kind:"scalar",T:8}]),Zu=i.makeMessageType("streamlayer.sdkSettings.game.common.TitleCardMedia",()=>[{no:1,name:"icon",kind:"scalar",T:9},{no:2,name:"sponsor_logo",kind:"scalar",T:9}]),ed=i.makeMessageType("streamlayer.sdkSettings.game.common.TitleCardAppearance",()=>[{no:1,name:"graphic",kind:"scalar",T:9}]),td=i.makeMessageType("streamlayer.sdkSettings.game.common.GameTitleCard",()=>[{no:1,name:"visible",kind:"scalar",T:8},{no:2,name:"opt_in",kind:"scalar",T:8},{no:3,name:"title",kind:"scalar",T:9},{no:4,name:"subtitle",kind:"scalar",T:9},{no:5,name:"header",kind:"scalar",T:9},{no:6,name:"media",kind:"message",T:Zu},{no:7,name:"appearance",kind:"message",T:ed},{no:8,name:"completed",kind:"scalar",T:8}]),nd=i.makeMessageType("streamlayer.sdkSettings.game.common.OnboardingStep",()=>[{no:1,name:"headline",kind:"scalar",T:9},{no:2,name:"body",kind:"scalar",T:9},{no:3,name:"graphic",kind:"scalar",T:9}]),ad=i.makeMessageType("streamlayer.sdkSettings.game.common.GameOnboarding",()=>[{no:1,name:"steps",kind:"message",T:nd,repeated:!0},{no:2,name:"completed",kind:"scalar",T:8}]),sd=i.makeMessageType("streamlayer.sdkSettings.game.common.GameRules",()=>[{no:1,name:"heading",kind:"scalar",T:9},{no:2,name:"typeface",kind:"scalar",T:9},{no:3,name:"button_label",kind:"scalar",T:9},{no:4,name:"numbers_color",kind:"scalar",T:9},{no:5,name:"rules",kind:"scalar",T:9,repeated:!0},{no:6,name:"completed",kind:"scalar",T:8},{no:7,name:"terms",kind:"scalar",T:9},{no:8,name:"terms_url",kind:"scalar",T:9}]),rd=i.makeMessageType("streamlayer.sdkSettings.game.common.GameInviteCard",()=>[{no:1,name:"heading",kind:"scalar",T:9},{no:2,name:"typeface",kind:"scalar",T:9},{no:3,name:"subtext",kind:"scalar",T:9},{no:4,name:"button_label",kind:"scalar",T:9},{no:5,name:"icon_color",kind:"scalar",T:9},{no:6,name:"terms",kind:"scalar",T:9},{no:7,name:"completed",kind:"scalar",T:8}]),od=i.makeMessageType("streamlayer.sdkSettings.game.common.GameSettings",()=>[{no:1,name:"overview",kind:"message",T:Xu},{no:2,name:"title_card",kind:"message",T:td},{no:3,name:"onboarding",kind:"message",T:ad},{no:4,name:"rules",kind:"message",T:sd},{no:5,name:"invite_card",kind:"message",T:rd},{no:6,name:"completed",kind:"scalar",T:8},{no:7,name:"enable",kind:"scalar",T:8}]),id=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationGeneral",()=>[{no:1,name:"default_color",kind:"scalar",T:9},{no:2,name:"points",kind:"scalar",T:13},{no:3,name:"auto_hide_interval",kind:"scalar",T:4},{no:4,name:"insights_history_enabled",kind:"scalar",T:8},{no:5,name:"pick_history_enabled",kind:"scalar",T:8},{no:6,name:"correct_feedbacks",kind:"message",T:Xe,repeated:!0},{no:7,name:"incorrect_feedbacks",kind:"message",T:Xe,repeated:!0}]),cd=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationNotifications",()=>[{no:1,name:"default_image",kind:"scalar",T:9},{no:2,name:"image_mode",kind:"enum",T:i.getEnumType(nt)}]),ld=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationSponsorships",()=>[{no:1,name:"rotate",kind:"scalar",T:8},{no:2,name:"no_sponsor",kind:"scalar",T:8},{no:3,name:"sponsors",kind:"message",T:Ct,repeated:!0}]),md=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationSettings",()=>[{no:1,name:"general",kind:"message",T:id},{no:2,name:"notifications",kind:"message",T:cd},{no:3,name:"sponsorships",kind:"message",T:ld}]),q=i.makeEnum("streamlayer.sdkSettings.SdkOverlayType",[{no:0,name:"SDK_OVERLAY_TYPE_UNSET",localName:"UNSET"},{no:1,name:"SDK_OVERLAY_TYPE_INPLAY",localName:"INPLAY"},{no:2,name:"SDK_OVERLAY_TYPE_MESSAGING",localName:"MESSAGING"},{no:3,name:"SDK_OVERLAY_TYPE_STATISTICS",localName:"STATISTICS"},{no:4,name:"SDK_OVERLAY_TYPE_BETTING",localName:"BETTING"},{no:5,name:"SDK_OVERLAY_TYPE_TWITTER",localName:"TWITTER"},{no:6,name:"SDK_OVERLAY_TYPE_MERCHANDISE",localName:"MERCHANDISE"},{no:7,name:"SDK_OVERLAY_TYPE_CONTESTS",localName:"CONTESTS"},{no:8,name:"SDK_OVERLAY_TYPE_VOICE_CHAT",localName:"VOICE_CHAT"},{no:9,name:"SDK_OVERLAY_TYPE_TICKETS",localName:"TICKETS"},{no:10,name:"SDK_OVERLAY_TYPE_WHOIS_WATCHING",localName:"WHOIS_WATCHING"},{no:11,name:"SDK_OVERLAY_TYPE_PROFILE",localName:"PROFILE"},{no:12,name:"SDK_OVERLAY_TYPE_GAMES",localName:"GAMES"},{no:13,name:"SDK_OVERLAY_TYPE_GOLF_STATISTICS",localName:"GOLF_STATISTICS"},{no:14,name:"SDK_OVERLAY_TYPE_HIGHLIGHTS",localName:"HIGHLIGHTS"},{no:15,name:"SDK_OVERLAY_TYPE_PUBLIC_CHAT",localName:"PUBLIC_CHAT"}]),ud=i.makeEnum("streamlayer.sdkSettings.BettingFavoriteType",[{no:0,name:"BETTING_FAVORITE_TYPE_UNSET",localName:"UNSET"},{no:1,name:"BETTING_FAVORITE_TYPE_LEAGUE",localName:"LEAGUE"},{no:2,name:"BETTING_FAVORITE_TYPE_TEAM",localName:"TEAM"}]),dd=i.makeEnum("streamlayer.sdkSettings.BettingSettingsTextColor",[{no:0,name:"BETTING_SETTINGS_TEXT_COLOR_UNSET",localName:"UNSET"},{no:1,name:"BETTING_SETTINGS_TEXT_COLOR_PRIMARY",localName:"PRIMARY"},{no:2,name:"BETTING_SETTINGS_TEXT_COLOR_GREY",localName:"GREY"},{no:3,name:"BETTING_SETTINGS_TEXT_COLOR_CUSTOM",localName:"CUSTOM"}]),ps=i.makeEnum("streamlayer.sdkSettings.GetStreamChannelType",[{no:0,name:"GETSTREAM_CHANNEL_TYPE_UNSET"},{no:1,name:"GETSTREAM_CHANNEL_TYPE_LIVESTREAM"},{no:2,name:"GETSTREAM_CHANNEL_TYPE_MESSAGING"},{no:3,name:"GETSTREAM_CHANNEL_TYPE_TEAM"},{no:4,name:"GETSTREAM_CHANNEL_TYPE_COMMERCE"},{no:5,name:"GETSTREAM_CHANNEL_TYPE_GAMING"},{no:6,name:"GETSTREAM_CHANNEL_TYPE_CUSTOM"}]),pd=i.makeEnum("streamlayer.sdkSettings.GetStreamChannelDefault",[{no:0,name:"GETSTREAM_CHANNEL_DEFAULT_UNSET"},{no:1,name:"GETSTREAM_CHANNEL_DEFAULT_TRUE"},{no:2,name:"GETSTREAM_CHANNEL_DEFAULT_FALSE"}]),oi=i.makeEnum("streamlayer.sdkSettings.GetStreamEnabled",[{no:0,name:"GETSTREAM_ENABLED_UNSET"},{no:1,name:"GETSTREAM_ENABLED_TRUE"},{no:2,name:"GETSTREAM_ENABLED_FALSE"}]),Td=i.makeEnum("streamlayer.sdkSettings.PublicName",[{no:0,name:"PUBLIC_NAME_UNSET",localName:"UNSET"},{no:1,name:"PUBLIC_NAME_ENABLED",localName:"ENABLED"},{no:2,name:"PUBLIC_NAME_DISABLED",localName:"DISABLED"}]),yd=i.makeEnum("streamlayer.sdkSettings.AnalyticsVersion",[{no:0,name:"ANALYTICS_VERSION_UNSET",localName:"UNSET"},{no:1,name:"ANALYTICS_VERSION_V1",localName:"V1"},{no:2,name:"ANALYTICS_VERSION_V2",localName:"V2"}]),gd=i.makeEnum("streamlayer.sdkSettings.LeaderboardKind",[{no:0,name:"LEADERBOARD_KIND_UNSET",localName:"UNSET"},{no:1,name:"LEADERBOARD_KIND_GLOBAL",localName:"GLOBAL"},{no:2,name:"LEADERBOARD_KIND_FRIENDS",localName:"FRIENDS"}]),fd=i.makeEnum("streamlayer.sdkSettings.AdvertisingPlacement",[{no:0,name:"ADVERTISING_PLACEMENT_UNSET",localName:"UNSET"},{no:1,name:"ADVERTISING_PLACEMENT_DEFAULT",localName:"DEFAULT"},{no:2,name:"ADVERTISING_PLACEMENT_WATCHPARTY_FULLSIZE",localName:"WATCHPARTY_FULLSIZE"},{no:3,name:"ADVERTISING_PLACEMENT_WATCHPARTY_VIDEOPANEL",localName:"WATCHPARTY_VIDEOPANEL"},{no:4,name:"ADVERTISING_PLACEMENT_OVERLAY_NAVBAR",localName:"OVERLAY_NAVBAR"}]),kd=i.makeMessageType("streamlayer.sdkSettings.TwitterOverlaySettings",()=>[{no:1,name:"accounts",kind:"scalar",T:9,repeated:!0}]),hd=i.makeMessageType("streamlayer.sdkSettings.BettingFavorite",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"icon",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"type",kind:"enum",T:i.getEnumType(ud)}]),Sd=i.makeMessageType("streamlayer.sdkSettings.CtaImage",()=>[{no:1,name:"url",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),ii=i.makeMessageType("streamlayer.sdkSettings.BrandDefaults",()=>[{no:1,name:"appearance",kind:"message",T:_d}]),_d=i.makeMessageType("streamlayer.sdkSettings.BrandDefaults.Appearance",()=>[{no:1,name:"primary_color",kind:"scalar",T:9},{no:2,name:"secondary_color",kind:"scalar",T:9},{no:3,name:"accent_color",kind:"scalar",T:9}],{localName:"BrandDefaults_Appearance"}),tr=i.makeMessageType("streamlayer.sdkSettings.BettingOverlaySettings",()=>[{no:1,name:"favorites",kind:"message",T:hd,repeated:!0},{no:2,name:"primary_color",kind:"scalar",T:9},{no:3,name:"button_icon",kind:"scalar",T:9},{no:4,name:"text_color",kind:"enum",T:i.getEnumType(dd)},{no:5,name:"app_installed_text",kind:"scalar",T:9},{no:6,name:"app_not_installed_text",kind:"scalar",T:9},{no:7,name:"text_color_custom",kind:"scalar",T:9},{no:8,name:"cta_image",kind:"message",T:Sd}]),Ed=i.makeMessageType("streamlayer.sdkSettings.GetStreamSettingsClient",()=>[{no:1,name:"enabled",kind:"enum",T:i.getEnumType(oi)},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"app_id",kind:"scalar",T:9},{no:5,name:"default_channel_type",kind:"enum",T:i.getEnumType(ps)}]),On=i.makeMessageType("streamlayer.sdkSettings.GetStreamChannel",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9},{no:3,name:"channel_id",kind:"scalar",T:9},{no:4,name:"channel_type",kind:"enum",T:i.getEnumType(ps)},{no:5,name:"is_default",kind:"enum",T:i.getEnumType(pd)}]),bd=i.makeMessageType("streamlayer.sdkSettings.GetStreamChannels",()=>[{no:1,name:"enabled",kind:"enum",T:i.getEnumType(oi)},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"app_id",kind:"scalar",T:9},{no:4,name:"default_channel_type",kind:"enum",T:i.getEnumType(ps)},{no:5,name:"default_channel",kind:"message",T:On},{no:6,name:"channels",kind:"message",T:On,repeated:!0}]),ci=i.makeMessageType("streamlayer.sdkSettings.StreamSettings",()=>[{no:1,name:"overlays",kind:"message",T:mi,repeated:!0},{no:2,name:"custom",kind:"scalar",T:8},{no:3,name:"button_icon",kind:"scalar",T:9},{no:4,name:"primary_color",kind:"scalar",T:9},{no:5,name:"secondary_color",kind:"scalar",T:9},{no:6,name:"moderation_primary_color",kind:"scalar",T:9},{no:7,name:"link_share_icon",kind:"scalar",T:9},{no:8,name:"link_share_text",kind:"scalar",T:9},{no:9,name:"brand_defaults",kind:"message",T:ii},{no:10,name:"getstream",kind:"message",T:bd}]),Id=i.makeMessageType("streamlayer.sdkSettings.JWK",()=>[{no:1,name:"alg",kind:"scalar",T:9,opt:!0},{no:2,name:"crv",kind:"scalar",T:9,opt:!0},{no:3,name:"d",kind:"scalar",T:9,opt:!0},{no:4,name:"dp",kind:"scalar",T:9,opt:!0},{no:5,name:"dq",kind:"scalar",T:9,opt:!0},{no:6,name:"e",kind:"scalar",T:9,opt:!0},{no:7,name:"ext",kind:"scalar",T:8,opt:!0},{no:8,name:"k",kind:"scalar",T:9,opt:!0},{no:9,name:"key_ops",kind:"scalar",T:9,repeated:!0},{no:10,name:"kid",kind:"scalar",T:9,opt:!0},{no:11,name:"kty",kind:"scalar",T:9,opt:!0},{no:12,name:"n",kind:"scalar",T:9,opt:!0},{no:13,name:"oth",kind:"message",T:Nd,repeated:!0},{no:14,name:"p",kind:"scalar",T:9,opt:!0},{no:15,name:"q",kind:"scalar",T:9,opt:!0},{no:16,name:"qi",kind:"scalar",T:9,opt:!0},{no:17,name:"use",kind:"scalar",T:9,opt:!0},{no:18,name:"x",kind:"scalar",T:9,opt:!0},{no:19,name:"y",kind:"scalar",T:9,opt:!0},{no:20,name:"x5c",kind:"scalar",T:9,repeated:!0},{no:21,name:"x5t",kind:"scalar",T:9,opt:!0},{no:22,name:"x5u",kind:"scalar",T:9,opt:!0}]),Nd=i.makeMessageType("streamlayer.sdkSettings.JWK.OTH",()=>[{no:1,name:"d",kind:"scalar",T:9,opt:!0},{no:2,name:"r",kind:"scalar",T:9,opt:!0},{no:3,name:"t",kind:"scalar",T:9,opt:!0}],{localName:"JWK_OTH"}),li=i.makeMessageType("streamlayer.sdkSettings.OrganizationSettings",()=>[{no:1,name:"overlays",kind:"message",T:mi,repeated:!0},{no:2,name:"button_icon",kind:"scalar",T:9},{no:3,name:"tinode_host",kind:"scalar",T:9},{no:4,name:"audience",kind:"scalar",T:9},{no:5,name:"name",kind:"scalar",T:9},{no:6,name:"provider",kind:"scalar",T:9},{no:7,name:"primary_color",kind:"scalar",T:9},{no:8,name:"secondary_color",kind:"scalar",T:9},{no:9,name:"moderation_primary_color",kind:"scalar",T:9},{no:10,name:"link_share_icon",kind:"scalar",T:9},{no:11,name:"link_share_text",kind:"scalar",T:9},{no:12,name:"brand_defaults",kind:"message",T:ii},{no:13,name:"pub",kind:"message",T:Id},{no:14,name:"getstream",kind:"message",T:Ed},{no:15,name:"public_name",kind:"enum",T:i.getEnumType(Td)},{no:16,name:"analytics_version",kind:"enum",T:i.getEnumType(yd)}]),vd=i.makeMessageType("streamlayer.sdkSettings.GamesOverlaySettings",()=>[{no:1,name:"inplay_game",kind:"message",T:od},{no:2,name:"moderation",kind:"message",T:md},{no:3,name:"pinned_leaderboard_id",kind:"scalar",T:9},{no:4,name:"leaderboard_kind",kind:"enum",T:i.getEnumType(gd)}]),nr=i.makeMessageType("streamlayer.sdkSettings.GetStreamOverlaySettings",()=>[{no:1,name:"default_channel",kind:"message",T:On},{no:2,name:"channels",kind:"message",T:On,repeated:!0}]),Vt=i.makeMessageType("streamlayer.sdkSettings.SdkOverlaySettings",()=>[{no:4,name:"twitter",kind:"message",T:kd,oneof:"overlay_settings"},{no:5,name:"betting",kind:"message",T:tr,oneof:"overlay_settings"},{no:6,name:"inplay",kind:"message",T:tr,oneof:"overlay_settings"},{no:7,name:"games",kind:"message",T:vd,oneof:"overlay_settings"},{no:8,name:"getstream",kind:"message",T:nr,oneof:"overlay_settings"},{no:9,name:"public_chat",kind:"message",T:nr,oneof:"overlay_settings"}]),Od=i.makeMessageType("streamlayer.sdkSettings.SdkOverlayMeta",()=>[{no:1,name:"organization",kind:"message",T:Vt},{no:2,name:"global_preset",kind:"message",T:Vt},{no:3,name:"preset",kind:"message",T:Vt},{no:4,name:"stream",kind:"message",T:Vt}]),mi=i.makeMessageType("streamlayer.sdkSettings.SdkOverlay",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(q)},{no:3,name:"position",kind:"scalar",T:5},{no:4,name:"overwrite",kind:"scalar",T:8},{no:5,name:"settings",kind:"message",T:Vt},{no:6,name:"meta",kind:"message",T:Od},{no:7,name:"enable",kind:"scalar",T:8},{no:8,name:"sdk_enable",kind:"scalar",T:8},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"icon",kind:"scalar",T:9},{no:11,name:"svg_icon",kind:"scalar",T:9},{no:12,name:"enable_overwrite",kind:"scalar",T:9,oneof:"overwrite_flag"},{no:13,name:"disable_overwrite",kind:"scalar",T:9,oneof:"overwrite_flag"},{no:14,name:"enable_sdk_button",kind:"scalar",T:8}]),Ad=i.makeMessageType("streamlayer.sdkSettings.AdvertisingImage",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"preview_url",kind:"scalar",T:9},{no:3,name:"file_url",kind:"scalar",T:9},{no:4,name:"placement",kind:"enum",T:i.getEnumType(fd)}]),wd=i.makeMessageType("streamlayer.sdkSettings.AdvertisingVideo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"preview_url",kind:"scalar",T:9},{no:3,name:"file_url",kind:"scalar",T:9},{no:4,name:"background_color",kind:"scalar",T:9}]),Rd=i.makeMessageType("streamlayer.sdkSettings.AdvertisingSettings",()=>[{no:1,name:"frequency",kind:"scalar",T:5},{no:2,name:"images",kind:"message",T:Ad,repeated:!0},{no:3,name:"videos",kind:"message",T:wd,repeated:!0}]),Ld=i.makeMessageType("streamlayer.sdkSettings.AdvertisingOverlaySettings",()=>[{no:1,name:"overlay_type",kind:"enum",T:i.getEnumType(q)},{no:2,name:"settings",kind:"map",K:9,V:{kind:"message",T:Rd}},{no:3,name:"enabled",kind:"scalar",T:8},{no:4,name:"overlay_name",kind:"scalar",T:9},{no:5,name:"use_custom",kind:"scalar",T:8,opt:!0}]),Md=i.makeMessageType("streamlayer.sdkSettings.Advertising",()=>[{no:1,name:"template_id",kind:"scalar",T:9},{no:2,name:"overlay_settings",kind:"map",K:9,V:{kind:"message",T:Ld}}]),Ma=i.makeEnum("streamlayer.analytics.v1.invitations.InvitationCategory",[{no:0,name:"INVITATION_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"INVITATION_CATEGORY_WATCHING",localName:"WATCHING"},{no:2,name:"INVITATION_CATEGORY_MESSAGING",localName:"MESSAGING"},{no:3,name:"INVITATION_CATEGORY_VOICING",localName:"VOICING"},{no:4,name:"INVITATION_CATEGORY_GAMES",localName:"GAMES"}]),An=i.makeEnum("streamlayer.analytics.v1.invitations.InvitationFrom",[{no:0,name:"INVITATION_FROM_UNSET",localName:"UNSET"},{no:1,name:"INVITATION_FROM_TITLE_CARD",localName:"TITLE_CARD"},{no:2,name:"INVITATION_FROM_MENU",localName:"MENU"}]);let ta=0,ar=[];function Pd(){return ta+=1,()=>{if(ta-=1,ta===0){let e=ar;ar=[];for(let t of e)t()}}}let oe=[],Ze=(e,t)=>{let n=[],a={get(){return a.lc||a.listen(()=>{})(),a.value},l:t||0,lc:0,listen(s,r){return a.lc=n.push(s,r||a.l)/2,()=>{let o=n.indexOf(s);~o&&(n.splice(o,2),--a.lc||a.off())}},notify(s,r){let o=!oe.length;for(let c=0;c<n.length;c+=2)oe.push(n[c],n[c+1],a.value,s,r);if(o){for(let c=0;c<oe.length;c+=5){let l;for(let m=c+1;!l&&(m+=5)<oe.length;)oe[m]<oe[c+1]&&(l=oe.push(oe[c],oe[c+1],oe[c+2],oe[c+3],oe[c+4]));l||oe[c](oe[c+2],oe[c+3],oe[c+4])}oe.length=0}},off(){},set(s){let r=a.value;r!==s&&(a.value=s,a.notify(r))},subscribe(s,r){let o=a.listen(s,r);return s(a.value),o},value:e};return a};const Cd=0,Dd=1,Ud=5,on=6,cn=10;let Ts=(e,t,n,a)=>(e.events=e.events||{},e.events[n+cn]||(e.events[n+cn]=a(s=>{e.events[n].reduceRight((r,o)=>(o(r),r),{shared:{},...s})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let s=e.events[n],r=s.indexOf(t);s.splice(r,1),s.length||(delete e.events[n],e.events[n+cn](),delete e.events[n+cn])}),Fd=(e,t)=>Ts(e,t,Cd,n=>{let a=e.listen;return e.listen=s=>(!e.lc&&!e.starting&&(e.starting=!0,n(),delete e.starting),a(s)),()=>{e.listen=a}}),Gd=(e,t)=>Ts(e,t,Dd,n=>{let a=e.off;return e.off=()=>{n(),a()},()=>{e.off=a}}),Bd=1e3,Jt=(e,t)=>Ts(e,a=>{let s=t(a);s&&e.events[on].push(s)},Ud,a=>{let s=e.listen;e.listen=(...o)=>(!e.lc&&!e.active&&(e.active=!0,a()),s(...o));let r=e.off;return e.events[on]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let o of e.events[on])o();e.events[on]=[]}},Bd)},()=>{e.listen=s,e.off=r}}),ui=(e,t,n)=>{Array.isArray(e)||(e=[e]);let a,s=0,r=()=>{let m=e.map(u=>u.get());if(a===void 0||m.some((u,d)=>u!==a[d])){let u=++s;a=m;let d=t(...m);d&&d.then&&d.t?d.then(y=>{u===s&&o.set(y)}):o.set(d)}},o=Ze(void 0,Math.max(...e.map(m=>m.l))+1),c,l=n?()=>{clearTimeout(c),c=setTimeout(r)}:r;return Jt(o,()=>{let m=e.map(u=>u.listen(l,-1/o.l));return r(),()=>{for(let u of m)u()}}),o},di=(e,t)=>ui(e,t),sr=(e,t)=>ui(e,t,!0),Pa=(e={})=>{let t=Ze(e);return t.setKey=function(n,a){let s=t.value;typeof a>"u"&&n in t.value?(t.value={...t.value},delete t.value[n],t.notify(s,n)):t.value[n]!==a&&(t.value={...t.value,[n]:a},t.notify(s,n))},t},Ca=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");exports.Code=void 0;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(exports.Code||(exports.Code={}));function rr(e){const t=exports.Code[e];return typeof t!="string"?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}class W extends Error{constructor(t,n=exports.Code.Unknown,a,s,r){super(Vd(t,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=t,this.code=n,this.metadata=new Headers(a??{}),this.details=s??[],this.cause=r}static from(t,n=exports.Code.Unknown){return t instanceof W?t:t instanceof Error?t.name=="AbortError"?new W(t.message,exports.Code.Canceled):new W(t.message,n,void 0,void 0,t):new W(String(t),n,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error?Object.getPrototypeOf(t)===W.prototype?!0:t.name==="ConnectError"&&"code"in t&&typeof t.code=="number"&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&typeof t.rawMessage=="string"&&"cause"in t:!1}findDetails(t){const n="typeName"in t?{findMessage:s=>s===t.typeName?t:void 0}:t,a=[];for(const s of this.details){if("getType"in s){n.findMessage(s.getType().typeName)&&a.push(s);continue}const r=n.findMessage(s.type);if(r)try{a.push(r.fromBinary(s.value))}catch{}}return a}}function Vd(e,t){return e.length?`[${rr(t)}] ${e}`:`[${rr(t)}]`}function xd(e,t,n){try{const a=ss.dec(e);return t?t.fromBinary(a,n):a}catch(a){throw W.from(a,exports.Code.DataLoss)}}function qd(e,t){const n={};for(const[a,s]of Object.entries(e.methods)){const r=t(Object.assign(Object.assign({},s),{localName:a,service:e}));r!=null&&(n[a]=r)}return n}function or(e){let t,n=new Uint8Array(0);function a(s){const r=new Uint8Array(n.length+s.length);r.set(n),r.set(s,n.length),n=r}return new ReadableStream({start(){t=e.getReader()},async pull(s){let r;for(;;){if(r===void 0&&n.byteLength>=5){let l=0;for(let m=1;m<5;m++)l=(l<<8)+n[m];r={flags:n[0],length:l}}if(r!==void 0&&n.byteLength>=r.length+5)break;const c=await t.read();if(c.done)break;a(c.value)}if(r===void 0){if(n.byteLength==0){s.close();return}s.error(new W("premature end of stream",exports.Code.DataLoss));return}const o=n.subarray(5,5+r.length);n=n.subarray(5+r.length),s.enqueue({flags:r.flags,data:o})}})}function ir(e,t){const n=new Uint8Array(t.length+5);n.set(t,5);const a=new DataView(n.buffer,n.byteOffset,n.byteLength);return a.setUint8(0,e),a.setUint32(1,t.length),n}var Hd=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n);function a(r){n[r]=e[r]&&function(o){return new Promise(function(c,l){o=e[r](o),s(c,l,o.done,o.value)})}}function s(r,o,c,l){Promise.resolve(l).then(function(m){r({value:m,done:c})},o)}},Wt=function(e){return this instanceof Wt?(this.v=e,this):new Wt(e)},Qd=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n.apply(e,t||[]),s,r=[];return s={},c("next"),c("throw"),c("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(T){return function(f){return Promise.resolve(f).then(T,d)}}function c(T,f){a[T]&&(s[T]=function(_){return new Promise(function(v,I){r.push([T,_,v,I])>1||l(T,_)})},f&&(s[T]=f(s[T])))}function l(T,f){try{m(a[T](f))}catch(_){y(r[0][3],_)}}function m(T){T.value instanceof Wt?Promise.resolve(T.value.v).then(u,d):y(r[0][2],T)}function u(T){l("next",T)}function d(T){l("throw",T)}function y(T,f){T(f),r.shift(),r.length&&l(r[0][0],r[0][1])}},Yd=function(e){var t,n;return t={},a("next"),a("throw",function(s){throw s}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(s,r){t[s]=e[s]?function(o){return(n=!n)?{value:Wt(e[s](o)),done:!1}:r?r(o):o}:r}};function jd(e){return Qd(this,arguments,function*(){yield Wt(yield*Yd(Hd(e)))})}var pi=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n);function a(r){n[r]=e[r]&&function(o){return new Promise(function(c,l){o=e[r](o),s(c,l,o.done,o.value)})}}function s(r,o,c,l){Promise.resolve(l).then(function(m){r({value:m,done:c})},o)}},Lt=function(e){return this instanceof Lt?(this.v=e,this):new Lt(e)},$d=function(e){var t,n;return t={},a("next"),a("throw",function(s){throw s}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(s,r){t[s]=e[s]?function(o){return(n=!n)?{value:Lt(e[s](o)),done:!1}:r?r(o):o}:r}},Wd=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n.apply(e,t||[]),s,r=[];return s={},c("next"),c("throw"),c("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(T){return function(f){return Promise.resolve(f).then(T,d)}}function c(T,f){a[T]&&(s[T]=function(_){return new Promise(function(v,I){r.push([T,_,v,I])>1||l(T,_)})},f&&(s[T]=f(s[T])))}function l(T,f){try{m(a[T](f))}catch(_){y(r[0][3],_)}}function m(T){T.value instanceof Lt?Promise.resolve(T.value.v).then(u,d):y(r[0][2],T)}function u(T){l("next",T)}function d(T){l("throw",T)}function y(T,f){T(f),r.shift(),r.length&&l(r[0][0],r[0][1])}};function cr(e,t){return qd(e,n=>{switch(n.kind){case w.Unary:return Kd(t,e,n);case w.ServerStreaming:return zd(t,e,n);case w.ClientStreaming:return Jd(t,e,n);case w.BiDiStreaming:return Xd(t,e,n);default:return null}})}function Kd(e,t,n){return async function(a,s){var r,o;const c=await e.unary(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,a,s==null?void 0:s.contextValues);return(r=s==null?void 0:s.onHeader)===null||r===void 0||r.call(s,c.header),(o=s==null?void 0:s.onTrailer)===null||o===void 0||o.call(s,c.trailer),c.message}}function zd(e,t,n){return function(a,s){return Ti(e.stream(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,jd([a]),s==null?void 0:s.contextValues),s)}}function Jd(e,t,n){return async function(a,s){var r,o,c,l,m,u;const d=await e.stream(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,a,s==null?void 0:s.contextValues);(m=s==null?void 0:s.onHeader)===null||m===void 0||m.call(s,d.header);let y;try{for(var T=!0,f=pi(d.message),_;_=await f.next(),r=_.done,!r;T=!0)l=_.value,T=!1,y=l}catch(v){o={error:v}}finally{try{!T&&!r&&(c=f.return)&&await c.call(f)}finally{if(o)throw o.error}}if(!y)throw new W("protocol error: missing response message",exports.Code.Internal);return(u=s==null?void 0:s.onTrailer)===null||u===void 0||u.call(s,d.trailer),y}}function Xd(e,t,n){return function(a,s){return Ti(e.stream(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,a,s==null?void 0:s.contextValues),s)}}function Ti(e,t){const n=function(){var a,s;return Wd(this,arguments,function*(){const r=yield Lt(e);(a=t==null?void 0:t.onHeader)===null||a===void 0||a.call(t,r.header),yield Lt(yield*$d(pi(r.message))),(s=t==null?void 0:t.onTrailer)===null||s===void 0||s.call(t,r.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function Zd(...e){const t=new AbortController,n=e.filter(s=>s!==void 0).concat(t.signal);for(const s of n){if(s.aborted){a.apply(s);break}s.addEventListener("abort",a)}function a(){t.signal.aborted||t.abort(yi(this));for(const s of n)s.removeEventListener("abort",a)}return t}function ep(e){const t=new AbortController,n=()=>{t.abort(new W("the operation timed out",exports.Code.DeadlineExceeded))};let a;return e!==void 0&&(e<=0?n():a=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(a)}}function yi(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;const t=new Error("This operation was aborted");return t.name="AbortError",t}function Da(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}function Ua(e,t){return{id:Symbol(t==null?void 0:t.description),defaultValue:e}}const na=128;function lr(e){const t=new Headers,n=new TextDecoder().decode(e).split(`\r
3
3
  `);for(const a of n){if(a==="")continue;const s=a.indexOf(":");if(s>0){const r=a.substring(0,s).trim(),o=a.substring(s+1).trim();t.append(r,o)}}return t}const tp="Content-Type",np="Grpc-Timeout",gi="Grpc-Status",fi="Grpc-Message",ap="Grpc-Status-Details-Bin",sp="X-User-Agent",rp="X-Grpc-Web",op="application/grpc-web+proto",ip="application/grpc-web+json";class Ve extends zt{constructor(t){super(),this.code=0,this.message="",this.details=[],i.util.initPartial(t,this)}static fromBinary(t,n){return new Ve().fromBinary(t,n)}static fromJson(t,n){return new Ve().fromJson(t,n)}static fromJsonString(t,n){return new Ve().fromJsonString(t,n)}static equals(t,n){return i.util.equals(Ve,t,n)}}Ve.runtime=i;Ve.typeName="google.rpc.Status";Ve.fields=i.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",T:Re,repeated:!0}]);const cp="0";function ki(e){var t;const n=e.get(ap);if(n!=null){const s=xd(n,Ve);if(s.code==0)return;const r=new W(s.message,s.code,e);return r.details=s.details.map(o=>({type:o.typeUrl.substring(o.typeUrl.lastIndexOf("/")+1),value:o.value})),r}const a=e.get(gi);if(a!=null){if(a===cp)return;const s=parseInt(a,10);return s in exports.Code?new W(decodeURIComponent((t=e.get(fi))!==null&&t!==void 0?t:""),s,e):new W(`invalid grpc-status: ${a}`,exports.Code.Internal,e)}}function mr(e,t,n){const a=typeof t=="string"?t:t.typeName,s=typeof n=="string"?n:n.name;return e.toString().replace(/\/?$/,`/${a}/${s}`)}function hi(e,t){return t instanceof e?t:new e(t)}function lp(e,t){function n(a){return a.done===!0?a:{done:a.done,value:hi(e,a.value)}}return{[Symbol.asyncIterator](){const a=t[Symbol.asyncIterator](),s={next:()=>a.next().then(n)};return a.throw!==void 0&&(s.throw=r=>a.throw(r).then(n)),a.return!==void 0&&(s.return=r=>a.return(r).then(n)),s}}}function Si(e,t){var n;return(n=t==null?void 0:t.concat().reverse().reduce((a,s)=>s(a),e))!==null&&n!==void 0?n:e}function mp(e){var t;const n=Object.assign({},e);return(t=n.ignoreUnknownFields)!==null&&t!==void 0||(n.ignoreUnknownFields=!0),n}function ur(e,t,n,a){const s=t?dr(e.I,a):pr(e.I,n);return{parse:(t?dr(e.O,a):pr(e.O,n)).parse,serialize:s.serialize}}function dr(e,t){return{parse(n){try{return e.fromBinary(n,t)}catch(a){const s=a instanceof Error?a.message:String(a);throw new W(`parse binary: ${s}`,exports.Code.InvalidArgument)}},serialize(n){try{return n.toBinary(t)}catch(a){const s=a instanceof Error?a.message:String(a);throw new W(`serialize binary: ${s}`,exports.Code.Internal)}}}}function pr(e,t){var n,a;const s=(n=t==null?void 0:t.textEncoder)!==null&&n!==void 0?n:new TextEncoder,r=(a=t==null?void 0:t.textDecoder)!==null&&a!==void 0?a:new TextDecoder,o=mp(t);return{parse(c){try{const l=r.decode(c);return e.fromJsonString(l,o)}catch(l){throw W.from(l,exports.Code.InvalidArgument)}},serialize(c){try{const l=c.toJsonString(o);return s.encode(l)}catch(l){throw W.from(l,exports.Code.Internal)}}}}function up(e){const t=Si(e.next,e.interceptors),[n,a,s]=_i(e),r=Object.assign(Object.assign({},e.req),{message:hi(e.req.method.I,e.req.message),signal:n});return t(r).then(o=>(s(),o),a)}function dp(e){const t=Si(e.next,e.interceptors),[n,a,s]=_i(e),r=Object.assign(Object.assign({},e.req),{message:lp(e.req.method.I,e.req.message),signal:n});let o=!1;return n.addEventListener("abort",function(){var c,l;const m=e.req.message[Symbol.asyncIterator]();o||(c=m.throw)===null||c===void 0||c.call(m,this.reason).catch(()=>{}),(l=m.return)===null||l===void 0||l.call(m).catch(()=>{})}),t(r).then(c=>Object.assign(Object.assign({},c),{message:{[Symbol.asyncIterator](){const l=c.message[Symbol.asyncIterator]();return{next(){return l.next().then(m=>(m.done==!0&&(o=!0,s()),m),a)}}}}}),a)}function _i(e){const{signal:t,cleanup:n}=ep(e.timeoutMs),a=Zd(e.signal,t);return[a.signal,function(r){const o=W.from(t.aborted?yi(t):r);return a.abort(o),n(),Promise.reject(o)},function(){n(),a.abort()}]}function pp(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function Tr(e,t){const n=ki(e);if(n)throw t.forEach((a,s)=>{n.metadata.append(s,a)}),n}function yr(e,t,n,a){const s=new Headers(n??{});return s.set(tp,e?op:ip),s.set(rp,"1"),s.set(sp,"connect-es/1.4.0"),t!==void 0&&s.set(np,`${t}m`),s}function Tp(e){switch(e){case 400:return exports.Code.Internal;case 401:return exports.Code.Unauthenticated;case 403:return exports.Code.PermissionDenied;case 404:return exports.Code.Unimplemented;case 429:return exports.Code.Unavailable;case 502:return exports.Code.Unavailable;case 503:return exports.Code.Unavailable;case 504:return exports.Code.Unavailable;default:return exports.Code.Unknown}}function gr(e,t){var n;if(e>=200&&e<300){const a=ki(t);if(a)throw a;return{foundStatus:t.has(gi)}}throw new W(decodeURIComponent((n=t.get(fi))!==null&&n!==void 0?n:`HTTP ${e}`),Tp(e),t)}var ct=function(e){return this instanceof ct?(this.v=e,this):new ct(e)},yp=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n.apply(e,t||[]),s,r=[];return s={},c("next"),c("throw"),c("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(T){return function(f){return Promise.resolve(f).then(T,d)}}function c(T,f){a[T]&&(s[T]=function(_){return new Promise(function(v,I){r.push([T,_,v,I])>1||l(T,_)})},f&&(s[T]=f(s[T])))}function l(T,f){try{m(a[T](f))}catch(_){y(r[0][3],_)}}function m(T){T.value instanceof ct?Promise.resolve(T.value.v).then(u,d):y(r[0][2],T)}function u(T){l("next",T)}function d(T){l("throw",T)}function y(T,f){T(f),r.shift(),r.length&&l(r[0][0],r[0][1])}};function fr(e){var t;pp();const n=(t=e.useBinaryFormat)!==null&&t!==void 0?t:!0;return{async unary(a,s,r,o,c,l,m){var u;const{serialize:d,parse:y}=ur(s,n,e.jsonOptions,e.binaryOptions);return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,await up({interceptors:e.interceptors,signal:r,timeoutMs:o,req:{stream:!1,service:a,method:s,url:mr(e.baseUrl,a,s),init:{method:"POST",credentials:(u=e.credentials)!==null&&u!==void 0?u:"same-origin",redirect:"error",mode:"cors"},header:yr(n,o,c),contextValues:m??Da(),message:l},next:async T=>{var f;const v=await((f=e.fetch)!==null&&f!==void 0?f:globalThis.fetch)(T.url,Object.assign(Object.assign({},T.init),{headers:T.header,signal:T.signal,body:ir(0,d(T.message))}));if(gr(v.status,v.headers),!v.body)throw"missing response body";const I=or(v.body).getReader();let E,R;for(;;){const O=await I.read();if(O.done)break;const{flags:N,data:L}=O.value;if(N===na){if(E!==void 0)throw"extra trailer";E=lr(L);continue}if(R!==void 0)throw"extra message";R=y(L)}if(E===void 0)throw"missing trailer";if(Tr(E,v.headers),R===void 0)throw"missing message";return{stream:!1,service:a,method:s,header:v.headers,message:R,trailer:E}}})},async stream(a,s,r,o,c,l,m){var u;const{serialize:d,parse:y}=ur(s,n,e.jsonOptions,e.binaryOptions);function T(_,v,I,E){return yp(this,arguments,function*(){const O=or(_).getReader();if(v){if(!(yield ct(O.read())).done)throw"extra data for trailers-only";return yield ct(void 0)}let N=!1;for(;;){const L=yield ct(O.read());if(L.done)break;const{flags:A,data:C}=L.value;if((A&na)===na){if(N)throw"extra trailer";N=!0;const H=lr(C);Tr(H,E),H.forEach((te,j)=>I.set(j,te));continue}if(N)throw"extra message";yield yield ct(y(C))}if(!N)throw"missing trailer"})}async function f(_){if(s.kind!=w.ServerStreaming)throw"The fetch API does not support streaming request bodies";const v=await _[Symbol.asyncIterator]().next();if(v.done==!0)throw"missing request message";return ir(0,d(v.value))}return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,dp({interceptors:e.interceptors,signal:r,timeoutMs:o,req:{stream:!0,service:a,method:s,url:mr(e.baseUrl,a,s),init:{method:"POST",credentials:(u=e.credentials)!==null&&u!==void 0?u:"same-origin",redirect:"error",mode:"cors"},header:yr(n,o,c),contextValues:m??Da(),message:l},next:async _=>{var v;const E=await((v=e.fetch)!==null&&v!==void 0?v:globalThis.fetch)(_.url,Object.assign(Object.assign({},_.init),{headers:_.header,signal:_.signal,body:await f(_.message)})),{foundStatus:R}=gr(E.status,E.headers);if(!E.body)throw"missing response body";const O=new Headers;return Object.assign(Object.assign({},_),{header:E.headers,trailer:O,message:T(E.body,R,O,E.headers)})}})}}}let gp=()=>({emit(e,...t){let n=this.events[e]||[];for(let a=0,s=n.length;a<s;a++)n[a](...t)},events:{},on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var a;this.events[e]=(a=this.events[e])==null?void 0:a.filter(s=>t!==s)}}});const kr=({cache:e=new Map,fetcher:t,...n}={})=>{const a=gp();let s=!0;br("visibilitychange",()=>{s=!document.hidden,s&&a.emit(Sr)}),br("online",()=>a.emit(_r));const r=new Map,o=new Map,c=new Map;let l={};const m=async([I,E],R,O,N)=>{var L;if(!s)return;const A=x=>{R.key===I&&(R.set(x),a.emit(aa,I,x,!0))},C=()=>{A({...R.value,...Nr,promise:c.get(I)})},{dedupeTime:H=4e3,fetcher:te}={...O,...l},j=Ir();if(c.has(I)){R.value.loading||C();return}if(!N){const x=e.get(I);x&&R.value.data!==x&&A({data:x,...Ke});const G=o.get(I);if(G&&G+H>j)return}const K=Pd();try{const x=te(...E);o.set(I,j),c.set(I,x),C();const G=await x;e.set(I,G),A({data:G,...Ke}),o.set(I,Ir())}catch(x){(L=O.onError)==null||L.call(O,x),A({data:R.value.data,error:x,...Ke})}finally{K(),c.delete(I)}},u=(I,{fetcher:E=t,...R}={})=>{const O=Pa({...Ke}),N={...n,...R,fetcher:E};O._=Ei,O.invalidate=()=>{const{key:G}=O;G&&T(G)},O.mutate=G=>{const{key:J}=O;J&&f(J,G)};let L,A,C,H,te,j=[];Fd(O,()=>{const G=!L;[te,L]=fp(I),H=te.subscribe(ye=>{if(ye){const[ge,g]=ye;O.key=ge,m([ge,g],O,N),A=ge,C=g}else O.key=A=C=void 0,O.set({...Ke})});const J=te.get();J&&([A,C]=J,G&&K());const{refetchInterval:Pe=0,refetchOnFocus:Ft,refetchOnReconnect:$e}=N,Te=()=>{A&&m([A,C],O,N)};Pe>0&&r.set(I,setInterval(Te,Pe)),Ft&&j.push(a.on(Sr,Te)),$e&&j.push(a.on(_r,Te)),j.push(a.on(Er,ye=>{A&&sa(A,ye)&&m([A,C],O,N,!0)}),a.on(aa,(ye,ge,g)=>{A&&sa(A,ye)&&O.value!==ge&&O.value.data!==ge&&O.set(g?ge:{data:ge,...Ke})}))});const K=()=>{A&&C&&m([A,C],O,N)},x=O.listen;return O.listen=G=>{const J=x(G);return G(O.value),K(),J},Gd(O,()=>{O.value={...Ke},L==null||L(),j.forEach(G=>G()),j=[],H==null||H(),clearInterval(r.get(I))}),O},d=I=>{e.delete(I),o.delete(I)},y=(I,E)=>{for(const R of e.keys())sa(R,I)&&E(R)},T=I=>{y(I,d),a.emit(Er,I)},f=(I,E)=>{y(I,R=>{E===void 0?d(R):e.set(R,E)}),a.emit(aa,I,E)};function _(I){const E=async O=>{var N;const L=l.fetcher??I,A=[];try{R.set({error:void 0,data:void 0,mutate:E,...Nr});const C=await L({data:O,invalidate:H=>{A.push(H)},getCacheUpdater:(H,te=!0)=>[j=>{f(H,j),te&&A.push(H)},e.get(H)]});return R.setKey("data",C),C}catch(C){(N=n==null?void 0:n.onError)==null||N.call(n,C),R.setKey("error",C)}finally{R.setKey("loading",!1),A.forEach(T)}},R=Pa({mutate:E,...Ke});return R.mutate=E,R}return[u,_,{__unsafeOverruleSettings:I=>{console.warn("You should only use __unsafeOverruleSettings in test environment"),l=I},invalidateKeys:T,mutateCache:f}]};function hr(e){return typeof e=="string"||typeof e=="number"||e===!0}const fp=e=>{if(hr(e))return[Ze([""+e,[e]]),()=>{}];let t=Ze(null),n=[];const a=()=>{n.some(r=>r==null||r===!1)?t.set(null):t.set([n.join(""),n])},s=[];for(let r=0;r<e.length;r++){const o=e[r];hr(o)?n.push(o):s.push(o.subscribe(c=>{n[r]=kp(o)?o.value&&"data"in o.value?o.key:null:c,a()}))}return a(),[t,()=>s.forEach(r=>r())]};function kp(e){return e._===Ei}const Sr=1,_r=2,Er=3,aa=4,br=(e,t)=>{typeof window>"u"||addEventListener(e,t)},sa=(e,t)=>Array.isArray(t)?t.includes(e):typeof t=="function"?t(e):e===t,Ir=()=>new Date().getTime(),Ei=Symbol(),Nr={loading:!0},Ke={loading:!1},bi=i.makeEnum("streamlayer.sports.EventStatus",[{no:0,name:"EVENT_STATUS_UNSET",localName:"UNSET"},{no:1,name:"EVENT_STATUS_PREGAME",localName:"PREGAME"},{no:2,name:"EVENT_STATUS_ACTIVE",localName:"ACTIVE"},{no:3,name:"EVENT_STATUS_BREAK",localName:"BREAK"},{no:4,name:"EVENT_STATUS_OVERTIME",localName:"OVERTIME"},{no:5,name:"EVENT_STATUS_SHOOTOUTS",localName:"SHOOTOUTS"},{no:6,name:"EVENT_STATUS_POSTGAME",localName:"POSTGAME"},{no:7,name:"EVENT_STATUS_CANCELLED",localName:"CANCELLED"}]),Ii=i.makeEnum("streamlayer.sports.EventEndless",[{no:0,name:"EVENT_ENDLESS_UNSET",localName:"UNSET"},{no:1,name:"EVENT_ENDLESS_ENABLED",localName:"ENABLED"},{no:2,name:"EVENT_ENDLESS_DISABLED",localName:"DISABLED"}]),Vn=i.makeMessageType("streamlayer.sports.Pagination",()=>[{no:1,name:"page",kind:"scalar",T:5},{no:2,name:"page_size",kind:"scalar",T:5}]),Ni=i.makeMessageType("streamlayer.sports.Sort",()=>[{no:1,name:"field",kind:"scalar",T:9},{no:2,name:"order",kind:"scalar",T:9}]),xn=i.makeMessageType("streamlayer.sports.Meta",()=>[{no:1,name:"count",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}]),vi=i.makeMessageType("streamlayer.sports.Venue",()=>[{no:1,name:"city",kind:"scalar",T:9},{no:2,name:"country",kind:"scalar",T:9},{no:3,name:"stadium",kind:"scalar",T:9}]),qn=i.makeMessageType("streamlayer.sports.EventTime",()=>[{no:1,name:"clock",kind:"scalar",T:9},{no:2,name:"period",kind:"scalar",T:5}]),hp=i.makeMessageType("streamlayer.sports.EventPeriod",()=>[{no:1,name:"number",kind:"scalar",T:5},{no:2,name:"score_home",kind:"scalar",T:5},{no:3,name:"score_away",kind:"scalar",T:5}]),et=i.makeMessageType("streamlayer.sports.TeamRecord",()=>[{no:1,name:"wins",kind:"scalar",T:5},{no:2,name:"losses",kind:"scalar",T:5}]),tt=i.makeMessageType("streamlayer.sports.EventTeam",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"is_winner",kind:"scalar",T:8}]),Sp=i.makeMessageType("streamlayer.sports.EventCustomFields",()=>[{no:1,name:"preview",kind:"scalar",T:9},{no:2,name:"stream",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"event_ids",kind:"scalar",T:9,repeated:!0},{no:6,name:"subtitle",kind:"scalar",T:9},{no:7,name:"promotitle",kind:"scalar",T:9},{no:8,name:"slate",kind:"scalar",T:9},{no:9,name:"horizontal_preview",kind:"scalar",T:9},{no:10,name:"small_logo",kind:"scalar",T:9},{no:11,name:"description",kind:"scalar",T:9}]),_p=i.makeMessageType("streamlayer.sports.EventProgram",()=>[{no:1,name:"id",kind:"scalar",T:9,opt:!0},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:9},{no:4,name:"end_time",kind:"scalar",T:9},{no:5,name:"thumbnail_url",kind:"scalar",T:9},{no:6,name:"square_thumbnail_url",kind:"scalar",T:9}]),Ep=i.makeMessageType("streamlayer.sports.EventData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"sport",kind:"scalar",T:9},{no:3,name:"league",kind:"scalar",T:9},{no:4,name:"scheduled",kind:"scalar",T:9},{no:5,name:"home",kind:"message",T:tt},{no:6,name:"away",kind:"message",T:tt},{no:7,name:"status",kind:"enum",T:i.getEnumType(bi)},{no:8,name:"custom_fields",kind:"message",T:Sp},{no:9,name:"start_time",kind:"scalar",T:9},{no:10,name:"end_time",kind:"scalar",T:9},{no:11,name:"venue",kind:"message",T:vi},{no:12,name:"schedule",kind:"message",T:_p,repeated:!0},{no:13,name:"endless",kind:"enum",T:i.getEnumType(Ii)},{no:14,name:"provider_id",kind:"scalar",T:9}]),yt=i.makeMessageType("streamlayer.sports.EventSummary",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"scheduled",kind:"scalar",T:9},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"venue",kind:"message",T:vi},{no:6,name:"event_time",kind:"message",T:qn},{no:7,name:"home_team",kind:"message",T:tt},{no:8,name:"away_team",kind:"message",T:tt},{no:9,name:"status",kind:"enum",T:i.getEnumType(bi)},{no:10,name:"periods",kind:"message",T:hp,repeated:!0},{no:11,name:"league",kind:"scalar",T:9},{no:12,name:"start_time",kind:"scalar",T:9},{no:13,name:"end_time",kind:"scalar",T:9},{no:14,name:"name",kind:"scalar",T:9},{no:15,name:"logo",kind:"scalar",T:9},{no:16,name:"stream",kind:"scalar",T:9}]),bp=i.makeEnum("streamlayer.sports.baseball.PitcherStatus",[{no:0,name:"PITCHER_STATUS_UNSET",localName:"UNSET"},{no:1,name:"PITCHER_STATUS_WIN",localName:"WIN"},{no:2,name:"PITCHER_STATUS_LOSS",localName:"LOSS"}]),Ip=i.makeEnum("streamlayer.sports.baseball.BaseballBase",[{no:0,name:"BASEBALL_BASE_UNSET",localName:"UNSET"},{no:1,name:"BASEBALL_BASE_FIRST",localName:"FIRST"},{no:2,name:"BASEBALL_BASE_SECOND",localName:"SECOND"},{no:3,name:"BASEBALL_BASE_THIRD",localName:"THIRD"}]),vr=i.makeMessageType("streamlayer.sports.baseball.PitcherSummary",()=>[{no:1,name:"statistics",kind:"message",T:Oi},{no:2,name:"status",kind:"enum",T:i.getEnumType(bp)},{no:3,name:"win_rate",kind:"scalar",T:5},{no:4,name:"loss_rate",kind:"scalar",T:5}]),Np=i.makeMessageType("streamlayer.sports.baseball.Runner",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"jersey_number",kind:"scalar",T:9}]),vp=i.makeMessageType("streamlayer.sports.baseball.RunnerOnBase",()=>[{no:1,name:"base_number",kind:"enum",T:i.getEnumType(Ip)},{no:2,name:"player",kind:"message",T:Np}]),Op=i.makeMessageType("streamlayer.sports.baseball.Hitting",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"hits_per_bat",kind:"scalar",T:9},{no:3,name:"runs",kind:"scalar",T:9},{no:4,name:"run_batted_in",kind:"scalar",T:9},{no:5,name:"walks",kind:"scalar",T:9},{no:6,name:"batting_average",kind:"scalar",T:9}]),Ap=i.makeMessageType("streamlayer.sports.baseball.Batting",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"at_bat",kind:"scalar",T:9},{no:3,name:"runs",kind:"scalar",T:9},{no:4,name:"hits",kind:"scalar",T:9},{no:5,name:"batting_average",kind:"scalar",T:9}]),Oi=i.makeMessageType("streamlayer.sports.baseball.Pitching",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"innings_pitched",kind:"scalar",T:9},{no:3,name:"hits_by_pitch",kind:"scalar",T:9},{no:4,name:"earned_runs",kind:"scalar",T:9},{no:5,name:"walks",kind:"scalar",T:9},{no:6,name:"strikeouts",kind:"scalar",T:9}]),Or=i.makeMessageType("streamlayer.sports.baseball.BaseballTeamSummary",()=>[{no:1,name:"hitting",kind:"message",T:Op,repeated:!0},{no:2,name:"batting",kind:"message",T:Ap,repeated:!0},{no:3,name:"pitching",kind:"message",T:Oi,repeated:!0}]),wp=i.makeMessageType("streamlayer.sports.baseball.BaseballSummary",()=>[{no:1,name:"home_pitcher",kind:"message",T:vr},{no:2,name:"away_pitcher",kind:"message",T:vr},{no:3,name:"home_statistics",kind:"message",T:Or},{no:4,name:"away_statistics",kind:"message",T:Or}]),Rp=i.makeMessageType("streamlayer.sports.baseball.BaseballPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:tt},{no:2,name:"inning",kind:"scalar",T:9},{no:3,name:"play_text",kind:"scalar",T:9},{no:4,name:"detail",kind:"message",T:Lp,repeated:!0},{no:5,name:"runs",kind:"scalar",T:5},{no:6,name:"hits",kind:"scalar",T:5},{no:7,name:"errors",kind:"scalar",T:5}]),Lp=i.makeMessageType("streamlayer.sports.baseball.BaseballPlayByPlayStatistics.BaseballPlayByPlayDetailStatistics",()=>[{no:1,name:"score_home",kind:"scalar",T:5},{no:2,name:"score_away",kind:"scalar",T:5},{no:3,name:"play_text",kind:"scalar",T:9},{no:4,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5}],{localName:"BaseballPlayByPlayStatistics_BaseballPlayByPlayDetailStatistics"}),Mp=i.makeMessageType("streamlayer.sports.baseball.EventScore",()=>[{no:1,name:"outs",kind:"scalar",T:5},{no:2,name:"inning",kind:"scalar",T:5},{no:3,name:"inning_division",kind:"scalar",T:9},{no:4,name:"is_delayed",kind:"scalar",T:8},{no:5,name:"reason_for_delay",kind:"scalar",T:9},{no:6,name:"runners_on_base",kind:"message",T:vp,repeated:!0},{no:7,name:"taken_bases",kind:"scalar",T:5},{no:8,name:"home_team_record",kind:"message",T:et},{no:9,name:"away_team_record",kind:"message",T:et}]),Pp=i.makeMessageType("streamlayer.sports.baseball.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:Rp,repeated:!0}]),Cp=i.makeMessageType("streamlayer.sports.baseball.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:wp}]),Dp=i.makeMessageType("streamlayer.sports.baseball.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"pct",kind:"scalar",T:1},{no:9,name:"games_behind",kind:"scalar",T:5},{no:10,name:"streak",kind:"message",T:Up},{no:11,name:"rank",kind:"message",T:Fp},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),Up=i.makeMessageType("streamlayer.sports.baseball.TeamStanding.Streak",()=>[{no:1,name:"losses",kind:"scalar",T:5},{no:2,name:"wins",kind:"scalar",T:5}],{localName:"TeamStanding_Streak"}),Fp=i.makeMessageType("streamlayer.sports.baseball.TeamStanding.Rank",()=>[{no:1,name:"division",kind:"scalar",T:5},{no:2,name:"conference",kind:"scalar",T:5}],{localName:"TeamStanding_Rank"}),Gp=i.makeMessageType("streamlayer.sports.baseball.Standings",()=>[{no:1,name:"standings",kind:"message",T:Dp,repeated:!0}]),Bp=i.makeEnum("streamlayer.sports.basketball.BasketballPerformerCategory",[{no:0,name:"BASKETBALL_PERFORMER_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"BASKETBALL_PERFORMER_CATEGORY_POINTS",localName:"POINTS"},{no:2,name:"BASKETBALL_PERFORMER_CATEGORY_REBOUNDS",localName:"REBOUNDS"},{no:3,name:"BASKETBALL_PERFORMER_CATEGORY_ASSISTS",localName:"ASSISTS"}]),Vp=i.makeMessageType("streamlayer.sports.basketball.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:et},{no:9,name:"away_team_record",kind:"message",T:et}]),Ar=i.makeMessageType("streamlayer.sports.basketball.BasketballTeamSummary",()=>[{no:1,name:"field_goal_percentage",kind:"scalar",T:1},{no:2,name:"three_pts_percentage",kind:"scalar",T:1},{no:3,name:"free_throw_percentage",kind:"scalar",T:1},{no:4,name:"assists",kind:"scalar",T:5},{no:5,name:"rebounds",kind:"scalar",T:5}]),wr=i.makeMessageType("streamlayer.sports.basketball.BasketballPerformer",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"photo",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:9}]),xp=i.makeMessageType("streamlayer.sports.basketball.BasketballPerformers",()=>[{no:1,name:"category",kind:"enum",T:i.getEnumType(Bp)},{no:2,name:"home_player",kind:"message",T:wr},{no:3,name:"away_player",kind:"message",T:wr}]),qp=i.makeMessageType("streamlayer.sports.basketball.BasketballSummary",()=>[{no:1,name:"home_statistics",kind:"message",T:Ar},{no:2,name:"away_statistics",kind:"message",T:Ar}]),Hp=i.makeMessageType("streamlayer.sports.basketball.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:qp},{no:2,name:"top_performers",kind:"message",T:xp,repeated:!0},{no:3,name:"last_games",kind:"message",T:Ai}]),Qp=i.makeMessageType("streamlayer.sports.basketball.BasketballPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:tt},{no:2,name:"event_time",kind:"message",T:qn},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"play_text",kind:"scalar",T:9},{no:6,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5}]),Yp=i.makeMessageType("streamlayer.sports.basketball.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:Qp,repeated:!0}]),Rr=i.makeMessageType("streamlayer.sports.basketball.PlayerScores",()=>[{no:1,name:"jersey",kind:"scalar",T:5},{no:2,name:"full_name",kind:"scalar",T:9},{no:3,name:"points",kind:"scalar",T:5},{no:4,name:"assists",kind:"scalar",T:5},{no:5,name:"rebounds",kind:"scalar",T:5},{no:6,name:"minutes",kind:"scalar",T:1},{no:7,name:"starter",kind:"scalar",T:8}]),jp=i.makeMessageType("streamlayer.sports.basketball.Boxscore",()=>[{no:1,name:"home_players",kind:"message",T:Rr,repeated:!0},{no:2,name:"away_players",kind:"message",T:Rr,repeated:!0}]),$p=i.makeMessageType("streamlayer.sports.basketball.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"pct",kind:"scalar",T:1},{no:9,name:"games_behind",kind:"scalar",T:5},{no:10,name:"streak",kind:"message",T:Wp},{no:11,name:"rank",kind:"message",T:Kp},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),Wp=i.makeMessageType("streamlayer.sports.basketball.TeamStanding.Streak",()=>[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"length",kind:"scalar",T:5}],{localName:"TeamStanding_Streak"}),Kp=i.makeMessageType("streamlayer.sports.basketball.TeamStanding.Rank",()=>[{no:1,name:"division",kind:"scalar",T:5},{no:2,name:"conference",kind:"scalar",T:5}],{localName:"TeamStanding_Rank"}),zp=i.makeMessageType("streamlayer.sports.basketball.Standings",()=>[{no:1,name:"standings",kind:"message",T:$p,repeated:!0}]),Lr=i.makeMessageType("streamlayer.sports.basketball.BasketballMatchPlayer",()=>[{no:1,name:"first_name",kind:"scalar",T:9},{no:2,name:"last_name",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"photo",kind:"scalar",T:9},{no:5,name:"position",kind:"scalar",T:9},{no:6,name:"jersey",kind:"scalar",T:5}]),Mr=i.makeMessageType("streamlayer.sports.basketball.BasketballMatchLineup",()=>[{no:3,name:"start_players",kind:"message",T:Lr,repeated:!0},{no:4,name:"substitutes",kind:"message",T:Lr,repeated:!0}]),Jp=i.makeMessageType("streamlayer.sports.basketball.BasketballMatchLineups",()=>[{no:1,name:"home_team",kind:"message",T:Mr},{no:2,name:"away_team",kind:"message",T:Mr}]),ra=i.makeMessageType("streamlayer.sports.basketball.BasketballLastGame",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:Xp}]),Xp=i.makeMessageType("streamlayer.sports.basketball.BasketballLastGame.BasketballLastGameAttributes",()=>[{no:1,name:"league",kind:"scalar",T:9},{no:2,name:"home_team",kind:"scalar",T:9},{no:3,name:"away_team",kind:"scalar",T:9},{no:5,name:"home_score",kind:"scalar",T:5},{no:6,name:"away_score",kind:"scalar",T:5},{no:7,name:"date",kind:"scalar",T:9}],{localName:"BasketballLastGame_BasketballLastGameAttributes"}),Ai=i.makeMessageType("streamlayer.sports.basketball.BasketballLastGames",()=>[{no:1,name:"home",kind:"message",T:ra,repeated:!0},{no:2,name:"away",kind:"message",T:ra,repeated:!0},{no:3,name:"head_to_head",kind:"message",T:ra,repeated:!0}]),Zp=i.makeEnum("streamlayer.sports.hockey.HockeyPerformerCategory",[{no:0,name:"HOCKEY_PERFORMER_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"HOCKEY_PERFORMER_CATEGORY_GOALS",localName:"GOALS"},{no:2,name:"HOCKEY_PERFORMER_CATEGORY_SHOTS",localName:"SHOTS"},{no:3,name:"HOCKEY_PERFORMER_CATEGORY_HITS",localName:"HITS"},{no:4,name:"HOCKEY_PERFORMER_CATEGORY_SAVES",localName:"SAVES"}]),wi=i.makeEnum("streamlayer.sports.hockey.HockeyPlayerPosition",[{no:0,name:"HOCKEY_PLAYER_POSITION_UNSET",localName:"UNSET"},{no:1,name:"HOCKEY_PLAYER_POSITION_CENTER",localName:"CENTER"},{no:2,name:"HOCKEY_PLAYER_POSITION_LEFT_WIND",localName:"LEFT_WIND"},{no:3,name:"HOCKEY_PLAYER_POSITION_RIGHT_WING",localName:"RIGHT_WING"},{no:4,name:"HOCKEY_PLAYER_POSITION_DEFENSE",localName:"DEFENSE"},{no:5,name:"HOCKEY_PLAYER_POSITION_GOALTENDER",localName:"GOALTENDER"}]),eT=i.makeMessageType("streamlayer.sports.hockey.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:et},{no:9,name:"away_team_record",kind:"message",T:et}]),Pr=i.makeMessageType("streamlayer.sports.hockey.HockeyPerformer",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"photo",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5}]),tT=i.makeMessageType("streamlayer.sports.hockey.HockeyPerformers",()=>[{no:1,name:"category",kind:"enum",T:i.getEnumType(Zp)},{no:2,name:"home_player",kind:"message",T:Pr,repeated:!0},{no:3,name:"away_player",kind:"message",T:Pr,repeated:!0}]),Cr=i.makeMessageType("streamlayer.sports.hockey.HockeyTeamSummary",()=>[{no:1,name:"shots_on_goal",kind:"scalar",T:5},{no:2,name:"faceoff",kind:"scalar",T:1},{no:3,name:"powerplay",kind:"scalar",T:5},{no:4,name:"penalty_minutes",kind:"scalar",T:5},{no:5,name:"hits",kind:"scalar",T:5},{no:6,name:"blocks",kind:"scalar",T:5},{no:7,name:"giveaways",kind:"scalar",T:5},{no:8,name:"takeaways",kind:"scalar",T:5}]),nT=i.makeMessageType("streamlayer.sports.hockey.HockeySummary",()=>[{no:1,name:"home_statistics",kind:"message",T:Cr},{no:2,name:"away_statistics",kind:"message",T:Cr}]),aT=i.makeMessageType("streamlayer.sports.hockey.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:nT},{no:2,name:"top_performers",kind:"message",T:tT,repeated:!0}]),sT=i.makeMessageType("streamlayer.sports.hockey.HockeyPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:tt},{no:2,name:"event_time",kind:"message",T:qn},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"play_text",kind:"scalar",T:9},{no:6,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5}]),rT=i.makeMessageType("streamlayer.sports.hockey.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:sT,repeated:!0}]),oa=i.makeMessageType("streamlayer.sports.hockey.PlayerScore",()=>[{no:1,name:"jersey",kind:"scalar",T:5},{no:2,name:"full_name",kind:"scalar",T:9},{no:3,name:"goals",kind:"scalar",T:5},{no:4,name:"assists",kind:"scalar",T:5},{no:5,name:"shots",kind:"scalar",T:5},{no:6,name:"penalty_minutes",kind:"scalar",T:1},{no:7,name:"minutes",kind:"scalar",T:9},{no:8,name:"position",kind:"enum",T:i.getEnumType(wi)}]),Dr=i.makeMessageType("streamlayer.sports.hockey.GoaltenderScore",()=>[{no:1,name:"jersey",kind:"scalar",T:5},{no:2,name:"full_name",kind:"scalar",T:9},{no:3,name:"shots_againts",kind:"scalar",T:5},{no:4,name:"goals_againts",kind:"scalar",T:5},{no:5,name:"saves",kind:"scalar",T:5},{no:6,name:"saves_pct",kind:"scalar",T:5},{no:7,name:"minutes",kind:"scalar",T:9},{no:8,name:"position",kind:"enum",T:i.getEnumType(wi)}]),Ur=i.makeMessageType("streamlayer.sports.hockey.PlayerScores",()=>[{no:1,name:"skaters",kind:"message",T:oa,repeated:!0},{no:2,name:"goaltender",kind:"message",T:Dr},{no:3,name:"forwards",kind:"message",T:oa,repeated:!0},{no:4,name:"defensemen",kind:"message",T:oa,repeated:!0},{no:5,name:"goaltenders",kind:"message",T:Dr,repeated:!0}]),oT=i.makeMessageType("streamlayer.sports.hockey.Boxscore",()=>[{no:1,name:"home_players",kind:"message",T:Ur},{no:2,name:"away_players",kind:"message",T:Ur}]),iT=i.makeMessageType("streamlayer.sports.hockey.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"pct",kind:"scalar",T:1},{no:9,name:"games_behind",kind:"scalar",T:5},{no:10,name:"streak",kind:"message",T:cT},{no:11,name:"rank",kind:"message",T:lT},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),cT=i.makeMessageType("streamlayer.sports.hockey.TeamStanding.Streak",()=>[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"length",kind:"scalar",T:5}],{localName:"TeamStanding_Streak"}),lT=i.makeMessageType("streamlayer.sports.hockey.TeamStanding.Rank",()=>[{no:1,name:"division",kind:"scalar",T:5},{no:2,name:"conference",kind:"scalar",T:5}],{localName:"TeamStanding_Rank"}),mT=i.makeMessageType("streamlayer.sports.hockey.Standings",()=>[{no:1,name:"standings",kind:"message",T:iT,repeated:!0}]),uT=i.makeEnum("streamlayer.sports.soccer.SoccerPerformerCategory",[{no:0,name:"SOCCER_PERFORMER_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"SOCCER_PERFORMER_CATEGORY_ATTACK",localName:"ATTACK"},{no:2,name:"SOCCER_PERFORMER_CATEGORY_MIDFIELD",localName:"MIDFIELD"},{no:3,name:"SOCCER_PERFORMER_CATEGORY_DEFENSE",localName:"DEFENSE"}]),dT=i.makeEnum("streamlayer.sports.soccer.SoccerMatchActivityType",[{no:0,name:"SOCCER_MATCH_ACTIVITY_UNSET"},{no:1,name:"SOCCER_MATCH_ACTIVITY_GOAL"},{no:2,name:"SOCCER_MATCH_ACTIVITY_YELLOW_CARD"},{no:3,name:"SOCCER_MATCH_ACTIVITY_RED_CARD"},{no:4,name:"SOCCER_MATCH_ACTIVITY_SUBSTITUTION"},{no:5,name:"SOCCER_MATCH_ACTIVITY_HALF_TIME"},{no:6,name:"SOCCER_MATCH_ACTIVITY_FULL_TIME"}]),pT=i.makeMessageType("streamlayer.sports.soccer.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:et},{no:9,name:"away_team_record",kind:"message",T:et}]),ys=i.makeMessageType("streamlayer.sports.soccer.SoccerPerformer",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"photo",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5}]),TT=i.makeMessageType("streamlayer.sports.soccer.SoccerAttackPerfomer",()=>[{no:1,name:"perfomer",kind:"message",T:ys},{no:2,name:"attack_stats",kind:"message",T:bT}]),yT=i.makeMessageType("streamlayer.sports.soccer.SoccerMidfieldPerformer",()=>[{no:1,name:"perfomer",kind:"message",T:ys},{no:2,name:"midfield_stats",kind:"message",T:IT}]),gT=i.makeMessageType("streamlayer.sports.soccer.SoccerDefensePerfomer",()=>[{no:1,name:"perfomer",kind:"message",T:ys},{no:2,name:"defense_stats",kind:"message",T:NT}]),fT=i.makeMessageType("streamlayer.sports.soccer.SoccerPerformers",()=>[{no:1,name:"category",kind:"enum",T:i.getEnumType(uT)},{no:2,name:"attack_performer",kind:"message",T:TT},{no:3,name:"midfield_performer",kind:"message",T:yT},{no:4,name:"defense_performer",kind:"message",T:gT}]),kT=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamTopMatchStats",()=>[{no:1,name:"possession",kind:"scalar",T:1},{no:2,name:"shots",kind:"scalar",T:5},{no:3,name:"shots_on_target",kind:"scalar",T:5},{no:4,name:"passes",kind:"scalar",T:5},{no:5,name:"offsides",kind:"scalar",T:5},{no:6,name:"yellow_cards",kind:"scalar",T:5},{no:7,name:"corner_kicks",kind:"scalar",T:5},{no:8,name:"free_kicks",kind:"scalar",T:5},{no:9,name:"red_cards",kind:"scalar",T:5}]),hT=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamAttackingStats",()=>[{no:1,name:"possession",kind:"scalar",T:1},{no:2,name:"passing_accuracy",kind:"scalar",T:1},{no:3,name:"chances_created",kind:"scalar",T:5},{no:4,name:"successful_crosses",kind:"scalar",T:1}]),ST=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamDefenseStats",()=>[{no:1,name:"tackles_made",kind:"scalar",T:5},{no:2,name:"interceptions",kind:"scalar",T:5},{no:3,name:"blocked_shots",kind:"scalar",T:5},{no:4,name:"clearances",kind:"scalar",T:5},{no:5,name:"duels_won",kind:"scalar",T:5}]),Fr=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamSummary",()=>[{no:1,name:"top_match_stats",kind:"message",T:kT},{no:2,name:"attacking_stats",kind:"message",T:hT},{no:3,name:"defense_stats",kind:"message",T:ST}]),_T=i.makeMessageType("streamlayer.sports.soccer.SoccerSummary",()=>[{no:1,name:"home_statistics",kind:"message",T:Fr},{no:2,name:"away_statistics",kind:"message",T:Fr},{no:3,name:"perfomers",kind:"message",T:fT}]),ET=i.makeMessageType("streamlayer.sports.soccer.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:_T},{no:2,name:"last_games",kind:"message",T:Ri}]),bT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayerAttackingStats",()=>[{no:1,name:"goals",kind:"scalar",T:5},{no:2,name:"assists",kind:"scalar",T:5},{no:3,name:"shots",kind:"scalar",T:5},{no:4,name:"shots_on_goal",kind:"scalar",T:5},{no:5,name:"penalty_kick_goals",kind:"scalar",T:5}]),IT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayerMidfieldStats",()=>[{no:1,name:"goals",kind:"scalar",T:5},{no:2,name:"assists",kind:"scalar",T:5},{no:3,name:"key_passes",kind:"scalar",T:5},{no:4,name:"crosses",kind:"scalar",T:5},{no:5,name:"corners",kind:"scalar",T:5}]),NT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayerDefenseStats",()=>[{no:1,name:"goals",kind:"scalar",T:5},{no:2,name:"assists",kind:"scalar",T:5},{no:3,name:"tackles_made",kind:"scalar",T:5},{no:4,name:"interceptions",kind:"scalar",T:5},{no:5,name:"blocked_shots",kind:"scalar",T:5}]),vT=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchFormationMatrixPlayer",()=>[{no:1,name:"jersey_number",kind:"scalar",T:5},{no:2,name:"player_name",kind:"scalar",T:9},{no:3,name:"photo",kind:"scalar",T:9}]),OT=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchFormationMatrix",()=>[{no:1,name:"row_players",kind:"message",T:vT,repeated:!0}]),Gr=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchPlayer",()=>[{no:1,name:"first_name",kind:"scalar",T:9},{no:2,name:"last_name",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"photo",kind:"scalar",T:9},{no:5,name:"position",kind:"scalar",T:9},{no:6,name:"jersey",kind:"scalar",T:5}]),Br=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchLineup",()=>[{no:1,name:"formation_string",kind:"scalar",T:9},{no:2,name:"formation_matrix",kind:"message",T:OT,repeated:!0},{no:3,name:"start_players",kind:"message",T:Gr,repeated:!0},{no:4,name:"substitutes",kind:"message",T:Gr,repeated:!0}]),AT=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchLineups",()=>[{no:1,name:"home_team",kind:"message",T:Br},{no:2,name:"away_team",kind:"message",T:Br}]),wT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:tt},{no:2,name:"event_time",kind:"message",T:qn},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"play_text",kind:"scalar",T:9},{no:6,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5},{no:8,name:"type",kind:"enum",T:i.getEnumType(dT)}]),RT=i.makeMessageType("streamlayer.sports.soccer.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:wT,repeated:!0}]),LT=i.makeMessageType("streamlayer.sports.soccer.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"draws",kind:"scalar",T:5},{no:9,name:"games_behind",kind:"scalar",T:5},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"points",kind:"scalar",T:5},{no:14,name:"position",kind:"scalar",T:5},{no:15,name:"total_goals",kind:"scalar",T:5},{no:16,name:"total_goals_received",kind:"scalar",T:5}]),MT=i.makeMessageType("streamlayer.sports.soccer.Standings",()=>[{no:1,name:"standings",kind:"message",T:LT,repeated:!0}]),ia=i.makeMessageType("streamlayer.sports.soccer.SoccerLastGame",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:PT}]),PT=i.makeMessageType("streamlayer.sports.soccer.SoccerLastGame.SoccerLastGameAttributes",()=>[{no:1,name:"league",kind:"scalar",T:9},{no:2,name:"home_team",kind:"scalar",T:9},{no:3,name:"away_team",kind:"scalar",T:9},{no:5,name:"home_score",kind:"scalar",T:5},{no:6,name:"away_score",kind:"scalar",T:5},{no:7,name:"date",kind:"scalar",T:9}],{localName:"SoccerLastGame_SoccerLastGameAttributes"}),Ri=i.makeMessageType("streamlayer.sports.soccer.SoccerLastGames",()=>[{no:1,name:"home",kind:"message",T:ia,repeated:!0},{no:2,name:"away",kind:"message",T:ia,repeated:!0},{no:3,name:"head_to_head",kind:"message",T:ia,repeated:!0}]),gt=i.makeEnum("streamlayer.sports.events.EventType",[{no:0,name:"EVENT_TYPE_UNSET",localName:"UNSET"},{no:1,name:"EVENT_TYPE_BASEBALL",localName:"BASEBALL"},{no:2,name:"EVENT_TYPE_BASKETBALL",localName:"BASKETBALL"},{no:3,name:"EVENT_TYPE_HOCKEY",localName:"HOCKEY"},{no:4,name:"EVENT_TYPE_SOCCER",localName:"SOCCER"},{no:5,name:"EVENT_TYPE_GOLF",localName:"GOLF"}]),CT=i.makeMessageType("streamlayer.sports.events.ScheduleAttributes",()=>[{no:1,name:"summary",kind:"message",T:yt},{no:2,name:"baseball",kind:"message",T:Mp,oneof:"sport"},{no:3,name:"basketball",kind:"message",T:Vp,oneof:"sport"},{no:4,name:"hockey",kind:"message",T:eT,oneof:"sport"},{no:5,name:"soccer",kind:"message",T:pT,oneof:"sport"}]),DT=i.makeMessageType("streamlayer.sports.events.ScheduleResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(gt)},{no:3,name:"attributes",kind:"message",T:CT}]),UT=i.makeMessageType("streamlayer.sports.events.ListResponseAttributes",()=>[{no:1,name:"common",kind:"message",T:Ep}]),Li=i.makeMessageType("streamlayer.sports.events.ListResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:UT}]),FT=i.makeMessageType("streamlayer.sports.events.ListRequest",()=>[{no:1,name:"filter",kind:"message",T:GT},{no:2,name:"pagination",kind:"message",T:Vn},{no:3,name:"sort",kind:"message",T:Ni},{no:4,name:"ids",kind:"scalar",T:4,repeated:!0},{no:5,name:"organization_id",kind:"scalar",T:9}]),GT=i.makeMessageType("streamlayer.sports.events.ListRequest.Filter",()=>[{no:1,name:"date",kind:"scalar",T:9},{no:2,name:"league",kind:"scalar",T:9},{no:3,name:"start_date_time",kind:"scalar",T:9},{no:4,name:"end_date_time",kind:"scalar",T:9},{no:5,name:"sport",kind:"scalar",T:9},{no:6,name:"name",kind:"scalar",T:9},{no:7,name:"endless",kind:"enum",T:i.getEnumType(Ii)}],{localName:"ListRequest_Filter"}),BT=i.makeMessageType("streamlayer.sports.events.DemoListRequest",()=>[{no:1,name:"filter",kind:"message",T:VT},{no:2,name:"pagination",kind:"message",T:Vn},{no:3,name:"sort",kind:"message",T:Ni}]),VT=i.makeMessageType("streamlayer.sports.events.DemoListRequest.Filter",()=>[{no:1,name:"date",kind:"scalar",T:9},{no:2,name:"league",kind:"scalar",T:9}],{localName:"DemoListRequest_Filter"}),xT=i.makeMessageType("streamlayer.sports.events.DemoListResponse",()=>[{no:1,name:"meta",kind:"message",T:xn},{no:2,name:"data",kind:"message",T:Li,repeated:!0}]),qT=i.makeMessageType("streamlayer.sports.events.ListResponse",()=>[{no:1,name:"meta",kind:"message",T:xn},{no:2,name:"data",kind:"message",T:Li,repeated:!0}]),Vr=i.makeMessageType("streamlayer.sports.events.SummaryRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"organization_id",kind:"scalar",T:9}]),xr=i.makeMessageType("streamlayer.sports.events.SummaryResponse",()=>[{no:1,name:"data",kind:"message",T:HT}]),HT=i.makeMessageType("streamlayer.sports.events.SummaryResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(gt)},{no:3,name:"attributes",kind:"message",T:QT}],{localName:"SummaryResponse_ResponseData"}),QT=i.makeMessageType("streamlayer.sports.events.SummaryResponse.ResponseData.SummaryResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:yt},{no:2,name:"baseball",kind:"message",T:Cp,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:Hp,oneof:"sports"},{no:4,name:"hockey",kind:"message",T:aT,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:ET,oneof:"sports"}],{localName:"SummaryResponse_ResponseData_SummaryResponseAttributes"}),YT=i.makeMessageType("streamlayer.sports.events.AdminSummaryRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"organization_id",kind:"scalar",T:9}]),jT=i.makeMessageType("streamlayer.sports.events.AdminSummaryResponse",()=>[{no:1,name:"data",kind:"message",T:$T}]),$T=i.makeMessageType("streamlayer.sports.events.AdminSummaryResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:WT}],{localName:"AdminSummaryResponse_ResponseData"}),WT=i.makeMessageType("streamlayer.sports.events.AdminSummaryResponse.ResponseData.SummaryResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:yt},{no:2,name:"provider_id",kind:"scalar",T:9}],{localName:"AdminSummaryResponse_ResponseData_SummaryResponseAttributes"}),KT=i.makeMessageType("streamlayer.sports.events.PlayByPlayRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"pagination",kind:"message",T:Vn},{no:3,name:"order",kind:"scalar",T:9}]),zT=i.makeMessageType("streamlayer.sports.events.PlayByPlayResponse",()=>[{no:1,name:"data",kind:"message",T:JT},{no:2,name:"meta",kind:"message",T:xn}]),JT=i.makeMessageType("streamlayer.sports.events.PlayByPlayResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(gt)},{no:3,name:"attributes",kind:"message",T:XT}],{localName:"PlayByPlayResponse_ResponseData"}),XT=i.makeMessageType("streamlayer.sports.events.PlayByPlayResponse.ResponseData.PlayByPlayResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:yt},{no:2,name:"baseball",kind:"message",T:Pp,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:Yp,oneof:"sports"},{no:4,name:"hockey",kind:"message",T:rT,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:RT,oneof:"sports"}],{localName:"PlayByPlayResponse_ResponseData_PlayByPlayResponseAttributes"}),ZT=i.makeMessageType("streamlayer.sports.events.ScheduleRequest",()=>[{no:1,name:"filter",kind:"message",T:ey},{no:2,name:"pagination",kind:"message",T:Vn}]),ey=i.makeMessageType("streamlayer.sports.events.ScheduleRequest.Filter",()=>[{no:1,name:"date",kind:"scalar",T:9},{no:2,name:"league",kind:"scalar",T:9}],{localName:"ScheduleRequest_Filter"}),ty=i.makeMessageType("streamlayer.sports.events.ScheduleResponse",()=>[{no:1,name:"data",kind:"message",T:DT,repeated:!0},{no:2,name:"meta",kind:"message",T:xn}]),ny=i.makeMessageType("streamlayer.sports.events.ScheduleDatesRequest",()=>[{no:1,name:"filter",kind:"message",T:ay}]),ay=i.makeMessageType("streamlayer.sports.events.ScheduleDatesRequest.Filter",()=>[{no:2,name:"league",kind:"scalar",T:9}],{localName:"ScheduleDatesRequest_Filter"}),sy=i.makeMessageType("streamlayer.sports.events.ScheduleDatesResponse",()=>[{no:1,name:"data",kind:"scalar",T:9,repeated:!0}]),ry=i.makeMessageType("streamlayer.sports.events.BoxscoreRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),oy=i.makeMessageType("streamlayer.sports.events.BoxscoreResponse",()=>[{no:1,name:"data",kind:"message",T:iy}]),iy=i.makeMessageType("streamlayer.sports.events.BoxscoreResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(gt)},{no:3,name:"attributes",kind:"message",T:cy}],{localName:"BoxscoreResponse_ResponseData"}),cy=i.makeMessageType("streamlayer.sports.events.BoxscoreResponse.ResponseData.BoxscoreResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:yt},{no:2,name:"basketball",kind:"message",T:jp,oneof:"sports"},{no:3,name:"hockey",kind:"message",T:oT,oneof:"sports"}],{localName:"BoxscoreResponse_ResponseData_BoxscoreResponseAttributes"}),ly=i.makeMessageType("streamlayer.sports.events.StandingsRequest",()=>[{no:1,name:"league",kind:"scalar",T:9}]),my=i.makeMessageType("streamlayer.sports.events.StandingsResponse",()=>[{no:1,name:"data",kind:"message",T:uy}]),uy=i.makeMessageType("streamlayer.sports.events.StandingsResponse.ResponseData",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(gt)},{no:2,name:"attributes",kind:"message",T:dy}],{localName:"StandingsResponse_ResponseData"}),dy=i.makeMessageType("streamlayer.sports.events.StandingsResponse.ResponseData.StandingsResponseAttributes",()=>[{no:2,name:"basketball",kind:"message",T:zp,oneof:"sports"},{no:3,name:"hockey",kind:"message",T:mT,oneof:"sports"},{no:4,name:"baseball",kind:"message",T:Gp,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:MT,oneof:"sports"}],{localName:"StandingsResponse_ResponseData_StandingsResponseAttributes"}),py=i.makeMessageType("streamlayer.sports.events.LineupRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),Ty=i.makeMessageType("streamlayer.sports.events.LineupResponse",()=>[{no:1,name:"data",kind:"message",T:yy}]),yy=i.makeMessageType("streamlayer.sports.events.LineupResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(gt)},{no:3,name:"attributes",kind:"message",T:gy}],{localName:"LineupResponse_ResponseData"}),gy=i.makeMessageType("streamlayer.sports.events.LineupResponse.ResponseData.LineupResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:yt},{no:2,name:"soccer",kind:"message",T:AT,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:Jp,oneof:"sports"}],{localName:"LineupResponse_ResponseData_LineupResponseAttributes"}),fy=i.makeMessageType("streamlayer.sports.events.LastGamesRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),ky=i.makeMessageType("streamlayer.sports.events.LastGamesResponse",()=>[{no:1,name:"data",kind:"message",T:hy}]),hy=i.makeMessageType("streamlayer.sports.events.LastGamesResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(gt)},{no:3,name:"attributes",kind:"message",T:Sy}],{localName:"LastGamesResponse_ResponseData"}),Sy=i.makeMessageType("streamlayer.sports.events.LastGamesResponse.ResponseData.LastGamesResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:yt},{no:2,name:"soccer",kind:"message",T:Ri,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:Ai,oneof:"sports"}],{localName:"LastGamesResponse_ResponseData_LastGamesResponseAttributes"}),_y=i.makeMessageType("streamlayer.sports.events.RetrieveEventIdRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Ey=i.makeMessageType("streamlayer.sports.events.RetrieveEventIdResponse",()=>[{no:1,name:"data",kind:"message",T:by}]),by=i.makeMessageType("streamlayer.sports.events.RetrieveEventIdResponse.RetrieveEventIdResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4}],{localName:"RetrieveEventIdResponse_RetrieveEventIdResponseData"}),Iy={typeName:"streamlayer.sports.events.Events",methods:{list:{name:"List",I:FT,O:qT,kind:w.Unary},demoList:{name:"DemoList",I:BT,O:xT,kind:w.Unary},summary:{name:"Summary",I:Vr,O:xr,kind:w.Unary},adminSummary:{name:"AdminSummary",I:YT,O:jT,kind:w.Unary},boxscore:{name:"Boxscore",I:ry,O:oy,kind:w.Unary},standings:{name:"Standings",I:ly,O:my,kind:w.Unary},playByPlay:{name:"PlayByPlay",I:KT,O:zT,kind:w.Unary},schedule:{name:"Schedule",I:ZT,O:ty,kind:w.Unary},scheduleDates:{name:"ScheduleDates",I:ny,O:sy,kind:w.Unary},lineup:{name:"Lineup",I:py,O:Ty,kind:w.Unary},retrieveEventId:{name:"RetrieveEventId",I:_y,O:Ey,kind:w.Unary},lastGames:{name:"LastGames",I:fy,O:ky,kind:w.Unary},summarySubscription:{name:"SummarySubscription",I:Vr,O:xr,kind:w.ServerStreaming}}},Ny=i.makeEnum("streamlayer.sdkSettings.client.VisibleStatus",[{no:0,name:"VISIBLE_STATUS_UNSET",localName:"UNSET"},{no:1,name:"VISIBLE_STATUS_INCOGNITO",localName:"INCOGNITO"},{no:2,name:"VISIBLE_STATUS_VISIBLE",localName:"VISIBLE"}]),vy=i.makeEnum("streamlayer.sdkSettings.client.MessagesNotify",[{no:0,name:"MESSAGES_NOTIFY_UNSET",localName:"UNSET"},{no:1,name:"MESSAGES_NOTIFY_DISALLOW",localName:"DISALLOW"},{no:2,name:"MESSAGES_NOTIFY_ALLOW",localName:"ALLOW"}]),Oy=i.makeEnum("streamlayer.sdkSettings.client.FriendsNotify",[{no:0,name:"FRIENDS_NOTIFY_UNSET",localName:"UNSET"},{no:1,name:"FRIENDS_NOTIFY_DISALLOW",localName:"DISALLOW"},{no:2,name:"FRIENDS_NOTIFY_ALLOW",localName:"ALLOW"}]),Ay=i.makeEnum("streamlayer.sdkSettings.client.TwitterNotify",[{no:0,name:"TWITTER_NOTIFY_UNSET",localName:"UNSET"},{no:1,name:"TWITTER_NOTIFY_DISALLOW",localName:"DISALLOW"},{no:2,name:"TWITTER_NOTIFY_ALLOW",localName:"ALLOW"}]),wy=i.makeEnum("streamlayer.sdkSettings.client.CallsSound",[{no:0,name:"CALLS_SOUND_UNSET",localName:"UNSET"},{no:1,name:"CALLS_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"CALLS_SOUND_ALLOW",localName:"ALLOW"}]),Ry=i.makeEnum("streamlayer.sdkSettings.client.MessagesSound",[{no:0,name:"MESSAGES_SOUND_UNSET",localName:"UNSET"},{no:1,name:"MESSAGES_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"MESSAGES_SOUND_ALLOW",localName:"ALLOW"}]),Ly=i.makeEnum("streamlayer.sdkSettings.client.FriendsSound",[{no:0,name:"FRIENDS_SOUND_UNSET",localName:"UNSET"},{no:1,name:"FRIENDS_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"FRIENDS_SOUND_ALLOW",localName:"ALLOW"}]),My=i.makeEnum("streamlayer.sdkSettings.client.TwitterSound",[{no:0,name:"TWITTER_SOUND_UNSET",localName:"UNSET"},{no:1,name:"TWITTER_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"TWITTER_SOUND_ALLOW",localName:"ALLOW"}]),Mi=i.makeEnum("streamlayer.sdkSettings.client.SettingsAllow",[{no:0,name:"SETTINGS_ALLOW_UNSET",localName:"UNSET"},{no:1,name:"SETTINGS_ALLOW_DISALLOW",localName:"DISALLOW"},{no:2,name:"SETTINGS_ALLOW_ALLOW",localName:"ALLOW"}]),Py=i.makeEnum("streamlayer.sdkSettings.client.ManagedGroupType",[{no:0,name:"MANAGED_GROUP_TYPE_UNSET",localName:"UNSET"},{no:1,name:"MANAGED_GROUP_TYPE_CHAT",localName:"CHAT"},{no:2,name:"MANAGED_GROUP_TYPE_WP",localName:"WP"}]),Cy=i.makeEnum("streamlayer.sdkSettings.client.GroupType",[{no:0,name:"GROUP_TYPE_UNSET",localName:"UNSET"},{no:1,name:"GROUP_TYPE_CHAT",localName:"CHAT"},{no:2,name:"GROUP_TYPE_WP",localName:"WP"}]),Dy=i.makeMessageType("streamlayer.sdkSettings.client.NotifySettings",()=>[{no:1,name:"allow",kind:"enum",T:i.getEnumType(Mi)}]),Uy=i.makeMessageType("streamlayer.sdkSettings.client.SoundSettings",()=>[{no:1,name:"allow",kind:"enum",T:i.getEnumType(Mi)}]),ca=i.makeMessageType("streamlayer.sdkSettings.client.ClientSettingsNotifications",()=>[{no:1,name:"notify",kind:"message",T:Dy},{no:2,name:"sound",kind:"message",T:Uy}]),gs=i.makeMessageType("streamlayer.sdkSettings.client.ClientSettings",()=>[{no:1,name:"visible_status",kind:"enum",T:i.getEnumType(Ny)},{no:2,name:"messages_notify",kind:"enum",T:i.getEnumType(vy)},{no:3,name:"friends_notify",kind:"enum",T:i.getEnumType(Oy)},{no:4,name:"calls_sound",kind:"enum",T:i.getEnumType(wy)},{no:5,name:"messages_sound",kind:"enum",T:i.getEnumType(Ry)},{no:6,name:"friends_sound",kind:"enum",T:i.getEnumType(Ly)},{no:7,name:"twitter_notify",kind:"enum",T:i.getEnumType(Ay)},{no:8,name:"twitter_sound",kind:"enum",T:i.getEnumType(My)},{no:9,name:"gamification",kind:"message",T:ca},{no:10,name:"watch_party_invitation",kind:"message",T:ca},{no:11,name:"twitter_question",kind:"message",T:ca}]),Fy=i.makeMessageType("streamlayer.sdkSettings.client.GetRequest",[]),Gy=i.makeMessageType("streamlayer.sdkSettings.client.GetResponse",()=>[{no:1,name:"data",kind:"message",T:By}]),By=i.makeMessageType("streamlayer.sdkSettings.client.GetResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:gs}],{localName:"GetResponse_GetResponseData"}),Vy=i.makeMessageType("streamlayer.sdkSettings.client.UpdateRequest",()=>[{no:2,name:"settings",kind:"message",T:gs}]),xy=i.makeMessageType("streamlayer.sdkSettings.client.UpdateResponse",()=>[{no:1,name:"data",kind:"message",T:qy}]),qy=i.makeMessageType("streamlayer.sdkSettings.client.UpdateResponse.UpdateResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:gs}],{localName:"UpdateResponse_UpdateResponseData"}),Hy=i.makeMessageType("streamlayer.sdkSettings.client.GetStreamRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Qy=i.makeMessageType("streamlayer.sdkSettings.client.GetStreamResponse",()=>[{no:1,name:"data",kind:"message",T:Yy}]),Yy=i.makeMessageType("streamlayer.sdkSettings.client.GetStreamResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ci}],{localName:"GetStreamResponse_GetResponseData"}),jy=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationRequest",[]),$y=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationResponse",()=>[{no:1,name:"data",kind:"message",T:Wy}]),Wy=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:li}],{localName:"GetOrganizationResponse_GetResponseData"}),Ky=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9,opt:!0}]),zy=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingResponse",()=>[{no:1,name:"data",kind:"message",T:Jy}]),Jy=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingResponse.GetOrganizationAdvertisingResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Md}],{localName:"GetOrganizationAdvertisingResponse_GetOrganizationAdvertisingResponseData"}),Xy=i.makeMessageType("streamlayer.sdkSettings.client.ManagedGroup",()=>[{no:1,name:"group_id",kind:"scalar",T:9},{no:2,name:"fantasy_group_id",kind:"scalar",T:9},{no:3,name:"group_type",kind:"enum",T:i.getEnumType(Py)}]),Zy=i.makeMessageType("streamlayer.sdkSettings.client.DeepLinkData",()=>[{no:1,name:"group_id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9},{no:3,name:"gamification",kind:"scalar",T:8},{no:4,name:"managed_group",kind:"message",T:Xy},{no:5,name:"external_event_id",kind:"scalar",T:9},{no:6,name:"external_group_id",kind:"scalar",T:9},{no:7,name:"group_type",kind:"enum",T:i.getEnumType(Cy)}]),eg=i.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkRequest",()=>[{no:1,name:"data",kind:"message",T:Zy}]),tg=i.makeMessageType("streamlayer.sdkSettings.client.DeepLink",()=>[{no:1,name:"url",kind:"scalar",T:9},{no:2,name:"link_id",kind:"scalar",T:9}]),ng=i.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkResponse",()=>[{no:1,name:"data",kind:"message",T:ag}]),ag=i.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkResponse.GenerateDeepLinkResponseData",()=>[{no:1,name:"attributes",kind:"message",T:tg}],{localName:"GenerateDeepLinkResponse_GenerateDeepLinkResponseData"}),sg=i.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),rg=i.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionRequest",[]),og=i.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:ig}]),ig=i.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ci}],{localName:"StreamSubscriptionResponse_ResponseData"}),cg=i.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:lg}]),lg=i.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:li}],{localName:"OrganizationSubscriptionResponse_ResponseData"}),Xt={typeName:"streamlayer.sdkSettings.client.Client",methods:{get:{name:"Get",I:Fy,O:Gy,kind:w.Unary},update:{name:"Update",I:Vy,O:xy,kind:w.Unary},getStream:{name:"GetStream",I:Hy,O:Qy,kind:w.Unary},getOrganization:{name:"GetOrganization",I:jy,O:$y,kind:w.Unary},getOrganizationAdvertising:{name:"GetOrganizationAdvertising",I:Ky,O:zy,kind:w.Unary},generateDeepLink:{name:"GenerateDeepLink",I:eg,O:ng,kind:w.Unary},streamSubscription:{name:"StreamSubscription",I:sg,O:og,kind:w.ServerStreaming},organizationSubscription:{name:"OrganizationSubscription",I:rg,O:cg,kind:w.ServerStreaming}}},mg=i.makeMessageType("streamlayer.users.PublicChatUser",()=>[{no:1,name:"name",kind:"scalar",T:9}]),ug=i.makeMessageType("streamlayer.users.UserAttributes",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:5,name:"avatar",kind:"scalar",T:9},{no:6,name:"public_chat",kind:"message",T:mg},{no:7,name:"public_name",kind:"scalar",T:9}]),fs=i.makeMessageType("streamlayer.users.User",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ug}]),dg=i.makeMessageType("streamlayer.users.LoginRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"password",kind:"scalar",T:9}]),pg=i.makeMessageType("streamlayer.users.AuthResponse",()=>[{no:1,name:"meta",kind:"message",T:Tg},{no:2,name:"data",kind:"message",T:fs}]),Tg=i.makeMessageType("streamlayer.users.AuthResponse.AuthResponseMetadata",()=>[{no:1,name:"jwt",kind:"scalar",T:9},{no:3,name:"getstream",kind:"scalar",T:9}],{localName:"AuthResponse_AuthResponseMetadata"}),yg=i.makeMessageType("streamlayer.users.RegisterRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),gg=i.makeMessageType("streamlayer.users.Referral",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"watching_game",kind:"scalar",T:9}]),fg=i.makeMessageType("streamlayer.users.RegisterResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"requires_activation",kind:"scalar",T:8},{no:3,name:"referral",kind:"message",T:gg}]),kg=i.makeMessageType("streamlayer.users.RequestPasswordRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),hg=i.makeMessageType("streamlayer.users.RequestPasswordResponse",()=>[{no:1,name:"requested",kind:"scalar",T:8},{no:2,name:"uid",kind:"scalar",T:9}]),Sg=i.makeMessageType("streamlayer.users.MeRequest",[]),_g=i.makeMessageType("streamlayer.users.MeResponse",()=>[{no:1,name:"data",kind:"message",T:fs}]),Eg=i.makeMessageType("streamlayer.users.UpdateMetadataRequest",()=>[{no:1,name:"set_name",kind:"scalar",T:9,oneof:"name"},{no:2,name:"del_name",kind:"scalar",T:9,oneof:"name"}]),bg=i.makeMessageType("streamlayer.users.UpdateAvatarRequest",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"set_avatar",kind:"scalar",T:9,oneof:"avatar"},{no:3,name:"del_avatar",kind:"scalar",T:9,oneof:"avatar"}]),Ig=i.makeMessageType("streamlayer.users.UpdateAvatarResponse",[]),Ng=i.makeMessageType("streamlayer.users.UpdatePublicChatNameRequest",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"set_name",kind:"scalar",T:9,oneof:"name"},{no:3,name:"del_name",kind:"scalar",T:9,oneof:"name"}]),vg=i.makeMessageType("streamlayer.users.UpdatePublicChatNameResponse",[]),Og=i.makeMessageType("streamlayer.users.UpdatePublicNameRequest",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"set_name",kind:"scalar",T:9,oneof:"name"},{no:3,name:"del_name",kind:"scalar",T:9,oneof:"name"}]),Ag=i.makeMessageType("streamlayer.users.UpdatePublicNameResponse",[]),wg=i.makeMessageType("streamlayer.users.UpdateMetadataResponse",[]),Rg=i.makeMessageType("streamlayer.users.InviteRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"referral",kind:"message",T:Lg}]),Lg=i.makeMessageType("streamlayer.users.InviteRequest.InviteReferral",()=>[{no:1,name:"watching_game",kind:"scalar",T:9}],{localName:"InviteRequest_InviteReferral"}),Mg=i.makeMessageType("streamlayer.users.InviteResponse",[]),Pg=i.makeMessageType("streamlayer.users.BypassAuthRequest",()=>[{no:1,name:"user_key",kind:"scalar",T:9},{no:2,name:"schema",kind:"scalar",T:9},{no:3,name:"init",kind:"scalar",T:8},{no:4,name:"inviter_key",kind:"scalar",T:9,opt:!0}]),Cg=i.makeMessageType("streamlayer.users.BypassAuthResponse",()=>[{no:1,name:"meta",kind:"message",T:Dg},{no:2,name:"data",kind:"message",T:fs,opt:!0}]),Dg=i.makeMessageType("streamlayer.users.BypassAuthResponse.AuthResponseMetadata",()=>[{no:1,name:"jwt",kind:"scalar",T:9,opt:!0},{no:3,name:"token",kind:"scalar",T:9,opt:!0},{no:4,name:"getstream",kind:"scalar",T:9},{no:5,name:"inviter_key",kind:"scalar",T:9,opt:!0}],{localName:"BypassAuthResponse_AuthResponseMetadata"}),Ug=i.makeMessageType("streamlayer.users.GetFriendsRequest",()=>[{no:1,name:"last_created_at",kind:"scalar",T:9,opt:!0},{no:2,name:"limit",kind:"scalar",T:5,opt:!0}]),Fg=i.makeMessageType("streamlayer.users.GetFriendsResponse",()=>[{no:1,name:"data",kind:"message",T:Bg,repeated:!0},{no:2,name:"metadata",kind:"message",T:Gg}]),Gg=i.makeMessageType("streamlayer.users.GetFriendsResponse.ResponseMeta",()=>[{no:1,name:"last_created_at",kind:"scalar",T:9}],{localName:"GetFriendsResponse_ResponseMeta"}),Bg=i.makeMessageType("streamlayer.users.GetFriendsResponse.FriendData",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"tinode_id",kind:"scalar",T:9},{no:3,name:"sl_id",kind:"scalar",T:9}],{localName:"GetFriendsResponse_FriendData"}),ks={typeName:"streamlayer.users.Users",methods:{login:{name:"Login",I:dg,O:pg,kind:w.Unary},register:{name:"Register",I:yg,O:fg,kind:w.Unary},requestPassword:{name:"RequestPassword",I:kg,O:hg,kind:w.Unary},me:{name:"Me",I:Sg,O:_g,kind:w.Unary},invite:{name:"Invite",I:Rg,O:Mg,kind:w.Unary},bypassAuth:{name:"BypassAuth",I:Pg,O:Cg,kind:w.Unary},updateMetadata:{name:"UpdateMetadata",I:Eg,O:wg,kind:w.Unary},updateAvatar:{name:"UpdateAvatar",I:bg,O:Ig,kind:w.Unary},updatePublicChatName:{name:"UpdatePublicChatName",I:Ng,O:vg,kind:w.Unary},updatePublicName:{name:"UpdatePublicName",I:Og,O:Ag,kind:w.Unary},getFriends:{name:"GetFriends",I:Ug,O:Fg,kind:w.Unary}}},Ye={typeName:"streamlayer.interactive.feed.Feed",methods:{get:{name:"Get",I:Du,O:Uu,kind:w.Unary},subscription:{name:"Subscription",I:Vm,O:xm,kind:w.ServerStreaming},votingSubscription:{name:"VotingSubscription",I:Hm,O:Qm,kind:w.ServerStreaming},questionSubscription:{name:"QuestionSubscription",I:$m,O:Wm,kind:w.ServerStreaming},questionByUser:{name:"QuestionByUser",I:Jm,O:Xm,kind:w.Unary},syncQuestion:{name:"SyncQuestion",I:eu,O:nu,kind:w.Unary},getQuestion:{name:"GetQuestion",I:su,O:ru,kind:w.Unary},questionDetail:{name:"QuestionDetail",I:iu,O:cu,kind:w.Unary},submitAnswer:{name:"SubmitAnswer",I:mu,O:du,kind:w.Unary},submitInplay:{name:"SubmitInplay",I:Tu,O:gu,kind:w.Unary},skipQuestion:{name:"SkipQuestion",I:fu,O:hu,kind:w.Unary},pickHistory:{name:"PickHistory",I:_u,O:Eu,kind:w.Unary},insightHistory:{name:"InsightHistory",I:Nu,O:Au,kind:w.Unary},tweetHistory:{name:"TweetHistory",I:Ru,O:Lu,kind:w.Unary},promotionHistory:{name:"PromotionHistory",I:Gu,O:Bu,kind:w.Unary},list:{name:"List",I:qu,O:Qu,kind:w.Unary},feedSubscription:{name:"FeedSubscription",I:ju,O:$u,kind:w.ServerStreaming}}},Vg=i.makeEnum("streamlayer.interactive.leaderboard.LeaderboardType",[{no:0,name:"LEADERBOARD_TYPE_UNSET",localName:"UNSET"},{no:1,name:"LEADERBOARD_TYPE_TOURNAMENT",localName:"TOURNAMENT"},{no:2,name:"LEADERBOARD_TYPE_EVENT",localName:"EVENT"}]),Pi=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(Vg)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"event_ids",kind:"scalar",T:3,repeated:!0},{no:5,name:"leaderboards",kind:"message",T:Pi,repeated:!0},{no:6,name:"created_at",kind:"scalar",T:3}]),hs=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardItem",()=>[{no:1,name:"streak",kind:"scalar",T:5},{no:2,name:"correct",kind:"scalar",T:5},{no:3,name:"incorrect",kind:"scalar",T:5},{no:4,name:"points",kind:"scalar",T:5},{no:5,name:"rank",kind:"scalar",T:5},{no:6,name:"name",kind:"scalar",T:9},{no:7,name:"avatar",kind:"scalar",T:9},{no:8,name:"user_id",kind:"scalar",T:9},{no:9,name:"recent_correct",kind:"scalar",T:5},{no:10,name:"streak_loss",kind:"scalar",T:5},{no:11,name:"friends_rank",kind:"scalar",T:5},{no:12,name:"in_top",kind:"scalar",T:5}]),xg=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardSummaryItem",()=>[{no:1,name:"summary",kind:"message",T:hs},{no:2,name:"percentage",kind:"message",T:qg}]),qg=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardSummaryItem.SummaryPercentage",()=>[{no:1,name:"correct",kind:"scalar",T:5},{no:2,name:"average",kind:"scalar",T:5}],{localName:"LeaderboardSummaryItem_SummaryPercentage"}),Hg=i.makeMessageType("streamlayer.interactive.leaderboard.ListRequest",()=>[{no:1,name:"pagination",kind:"message",T:Bn},{no:2,name:"users_ids",kind:"scalar",T:9,repeated:!0},{no:3,name:"event_id",kind:"scalar",T:4},{no:4,name:"leaderboard_id",kind:"scalar",T:9}]),Qg=i.makeMessageType("streamlayer.interactive.leaderboard.ListResponse",()=>[{no:1,name:"data",kind:"message",T:Yg,repeated:!0},{no:2,name:"meta",kind:"message",T:jg}]),Yg=i.makeMessageType("streamlayer.interactive.leaderboard.ListResponse.ListResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:hs}],{localName:"ListResponse_ListResponseData"}),jg=i.makeMessageType("streamlayer.interactive.leaderboard.ListResponse.ListResponseMeta",()=>[{no:1,name:"count",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"ListResponse_ListResponseMeta"}),$g=i.makeMessageType("streamlayer.interactive.leaderboard.SummaryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:4},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"leaderboard_id",kind:"scalar",T:9},{no:4,name:"users_ids",kind:"scalar",T:9,repeated:!0}]),Wg=i.makeMessageType("streamlayer.interactive.leaderboard.SummaryResponse",()=>[{no:1,name:"data",kind:"message",T:Kg}]),Kg=i.makeMessageType("streamlayer.interactive.leaderboard.SummaryResponse.SummaryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:xg}],{localName:"SummaryResponse_SummaryResponseData"}),zg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9}]),Jg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsResponse",()=>[{no:2,name:"data",kind:"message",T:Xg}]),Xg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsResponse.EventLeaderboardsResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Pi}],{localName:"EventLeaderboardsResponse_EventLeaderboardsResponseData"}),Zg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"pagination",kind:"message",T:Bn},{no:4,name:"sort",kind:"message",T:Dm}]),ef=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardResponse",()=>[{no:1,name:"data",kind:"message",T:tf,repeated:!0},{no:2,name:"meta",kind:"message",T:nf}]),tf=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardResponse.ListResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:hs}],{localName:"EventLeaderboardResponse_ListResponseData"}),nf=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardResponse.ListResponseMeta",()=>[{no:1,name:"count",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"EventLeaderboardResponse_ListResponseMeta"}),Ci={typeName:"streamlayer.interactive.leaderboard.Leaderboard",methods:{list:{name:"List",I:Hg,O:Qg,kind:w.Unary},summary:{name:"Summary",I:$g,O:Wg,kind:w.Unary},eventLeaderboards:{name:"EventLeaderboards",I:zg,O:Jg,kind:w.Unary},eventLeaderboard:{name:"EventLeaderboard",I:Zg,O:ef,kind:w.Unary}}},af=i.makeMessageType("streamlayer.shortLinks.GenerateRequest",()=>[{no:1,name:"web",kind:"scalar",T:9},{no:2,name:"mobile",kind:"scalar",T:9}]),sf=i.makeMessageType("streamlayer.shortLinks.GenerateResponse",()=>[{no:1,name:"data",kind:"message",T:rf}]),rf=i.makeMessageType("streamlayer.shortLinks.GenerateResponse.GenerateResponseData",()=>[{no:1,name:"link",kind:"scalar",T:9}],{localName:"GenerateResponse_GenerateResponseData"}),of={typeName:"streamlayer.shortLinks.LinksClient",methods:{generate:{name:"Generate",I:af,O:sf,kind:w.Unary}}},Fa=globalThis||void 0||self,Ga=i.makeEnum("streamlayer.analytics.v1.interactions.InteractionActionType",[{no:0,name:"INTERACTION_ACTION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"INTERACTION_ACTION_TYPE_TAP",localName:"TAP"},{no:2,name:"INTERACTION_ACTION_TYPE_CALL",localName:"CALL"},{no:3,name:"INTERACTION_ACTION_TYPE_MESSAGE",localName:"MESSAGE"},{no:4,name:"INTERACTION_ACTION_TYPE_SCROLL",localName:"SCROLL"}]),ve=i.makeEnum("streamlayer.analytics.v1.notifications.NotificationKind",[{no:0,name:"NOTIFICATION_KIND_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_KIND_MESSAGE",localName:"MESSAGE"},{no:2,name:"NOTIFICATION_KIND_CALL",localName:"CALL"},{no:3,name:"NOTIFICATION_KIND_TWITTER",localName:"TWITTER"},{no:4,name:"NOTIFICATION_KIND_WAVE",localName:"WAVE"},{no:5,name:"NOTIFICATION_KIND_INPLAY",localName:"INPLAY"},{no:6,name:"NOTIFICATION_KIND_GROUP_CALL",localName:"GROUP_CALL"},{no:7,name:"NOTIFICATION_KIND_MISSED_CALL",localName:"MISSED_CALL"},{no:8,name:"NOTIFICATION_KIND_MISSED_GROUP_CALL",localName:"MISSED_GROUP_CALL"},{no:9,name:"NOTIFICATION_KIND_WATCH_PARTY",localName:"WATCH_PARTY"},{no:10,name:"NOTIFICATION_KIND_POLLS",localName:"POLLS"}]),Ba=i.makeEnum("streamlayer.analytics.v1.notifications.NotificationType",[{no:0,name:"NOTIFICATION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_TYPE_IN_APP",localName:"IN_APP"},{no:2,name:"NOTIFICATION_TYPE_PUSH",localName:"PUSH"}]),cf=i.makeEnum("streamlayer.analytics.v1.permissions.PermissionType",[{no:0,name:"PERMISSION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"PERMISSION_TYPE_ADDRESS_BOOK",localName:"ADDRESS_BOOK"},{no:2,name:"PERMISSION_TYPE_CALLING",localName:"CALLING"},{no:3,name:"PERMISSION_TYPE_CAMERA",localName:"CAMERA"}]),lf=i.makeEnum("streamlayer.analytics.v1.waves.WaveCategory",[{no:0,name:"WAVE_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"WAVE_CATEGORY_WATCHING",localName:"WATCHING"},{no:2,name:"WAVE_CATEGORY_MESSAGING",localName:"MESSAGING"},{no:3,name:"WAVE_CATEGORY_VOICING",localName:"VOICING"}]),qr=i.makeMessageType("streamlayer.analytics.v2.streaming.SendResponse",()=>[{no:1,name:"result",kind:"enum",T:i.getEnumType(Bl)}]),mf=i.makeMessageType("streamlayer.analytics.v2.streaming.SendExtra",[]),de=i.makeMessageType("streamlayer.analytics.v2.streaming.CommonData",()=>[{no:1,name:"event_id",kind:"scalar",T:4,opt:!0},{no:2,name:"category",kind:"enum",T:i.getEnumType(ie),opt:!0},{no:3,name:"kind",kind:"enum",T:i.getEnumType(fe),opt:!0},{no:4,name:"screen_orientation",kind:"enum",T:i.getEnumType(La),opt:!0},{no:5,name:"session_id",kind:"scalar",T:9,opt:!0},{no:6,name:"overlay_session_id",kind:"scalar",T:9,opt:!0},{no:7,name:"topic_id",kind:"scalar",T:9,opt:!0},{no:8,name:"topic_type",kind:"enum",T:i.getEnumType(pe),opt:!0},{no:9,name:"parent_topic_id",kind:"scalar",T:9,opt:!0},{no:10,name:"parent_topic_type",kind:"enum",T:i.getEnumType(pe),opt:!0},{no:11,name:"participants_count",kind:"scalar",T:13,opt:!0},{no:12,name:"route_map",kind:"scalar",T:9,opt:!0},{no:13,name:"track_timestamp",kind:"scalar",T:4,opt:!0},{no:14,name:"topic_sub_type",kind:"enum",T:i.getEnumType(Yo),opt:!0},{no:15,name:"country",kind:"scalar",T:9,opt:!0}]),uf=i.makeMessageType("streamlayer.analytics.v2.streaming.SendAuthenticationsMessage",()=>[{no:1,name:"common",kind:"message",T:de}]),df=i.makeMessageType("streamlayer.analytics.v2.streaming.SendCallsMessage",()=>[{no:1,name:"common",kind:"message",T:de}]),pf=i.makeMessageType("streamlayer.analytics.v2.streaming.SendConversationsMessage",()=>[{no:1,name:"common",kind:"message",T:de}]),Tf=i.makeMessageType("streamlayer.analytics.v2.streaming.SendInteractionsMessage",()=>[{no:1,name:"common",kind:"message",T:de},{no:2,name:"action_type",kind:"enum",T:i.getEnumType(Ga)}]),yf=i.makeMessageType("streamlayer.analytics.v2.streaming.EventOpenedMessage",()=>[{no:1,name:"common",kind:"message",T:de}]),gf=i.makeMessageType("streamlayer.analytics.v2.streaming.SendInvitationsMessage",()=>[{no:1,name:"common",kind:"message",T:de},{no:2,name:"category",kind:"enum",T:i.getEnumType(Ma)},{no:3,name:"from",kind:"enum",T:i.getEnumType(An)}]),ff=i.makeMessageType("streamlayer.analytics.v2.streaming.LaunchButtonMessage",()=>[{no:1,name:"common",kind:"message",T:de}]),kf=i.makeMessageType("streamlayer.analytics.v2.streaming.NotificationMessage",()=>[{no:1,name:"common",kind:"message",T:de},{no:2,name:"notification_kind",kind:"enum",T:i.getEnumType(ve)},{no:3,name:"notification_type",kind:"enum",T:i.getEnumType(Ba)}]),hf=i.makeMessageType("streamlayer.analytics.v2.streaming.PermissionMessage",()=>[{no:1,name:"common",kind:"message",T:de},{no:2,name:"permission",kind:"enum",T:i.getEnumType(cf)}]),Sf=i.makeMessageType("streamlayer.analytics.v2.streaming.ButtonInitializedMessage",()=>[{no:1,name:"common",kind:"message",T:de}]),_f=i.makeMessageType("streamlayer.analytics.v2.streaming.WavesMessage",()=>[{no:1,name:"common",kind:"message",T:de},{no:2,name:"category",kind:"enum",T:i.getEnumType(lf)}]),Ef=i.makeMessageType("streamlayer.analytics.v2.streaming.HeartbeatMessage",()=>[{no:1,name:"common",kind:"message",T:de}]),bf=i.makeMessageType("streamlayer.analytics.v2.streaming.GamesMessage",()=>[{no:1,name:"common",kind:"message",T:de},{no:2,name:"poll_opened_from",kind:"enum",T:i.getEnumType(ot)}]),If=i.makeMessageType("streamlayer.analytics.v2.streaming.Login",()=>[{no:1,name:"common",kind:"message",T:de},{no:2,name:"token",kind:"scalar",T:9}]),Nf=i.makeMessageType("streamlayer.analytics.v2.streaming.Logout",()=>[{no:1,name:"common",kind:"message",T:de}]),Hr=i.makeMessageType("streamlayer.analytics.v2.streaming.SendRequest",()=>[{no:1,name:"auth",kind:"message",T:uf,oneof:"message"},{no:2,name:"call",kind:"message",T:df,oneof:"message"},{no:3,name:"conversations",kind:"message",T:pf,oneof:"message"},{no:4,name:"interactions",kind:"message",T:Tf,oneof:"message"},{no:5,name:"event_opened",kind:"message",T:yf,oneof:"message"},{no:6,name:"invitation",kind:"message",T:gf,oneof:"message"},{no:7,name:"launch_button",kind:"message",T:ff,oneof:"message"},{no:8,name:"notification",kind:"message",T:kf,oneof:"message"},{no:9,name:"permission",kind:"message",T:hf,oneof:"message"},{no:10,name:"button_init",kind:"message",T:Sf,oneof:"message"},{no:11,name:"waves",kind:"message",T:_f,oneof:"message"},{no:12,name:"heartbeat",kind:"message",T:Ef,oneof:"message"},{no:13,name:"games",kind:"message",T:bf,oneof:"message"},{no:14,name:"login",kind:"message",T:If,oneof:"message"},{no:15,name:"logout",kind:"message",T:Nf,oneof:"message"},{no:100,name:"extra",kind:"message",T:mf}]),Di={typeName:"streamlayer.analytics.v2.streaming.AnalyticsService",methods:{send:{name:"Send",I:Hr,O:qr,kind:w.ClientStreaming},unary:{name:"Unary",I:Hr,O:qr,kind:w.Unary}}};function vf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ui={exports:{}},ee=Ui.exports={},Oe,Ae;function Va(){throw new Error("setTimeout has not been defined")}function xa(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Oe=setTimeout:Oe=Va}catch{Oe=Va}try{typeof clearTimeout=="function"?Ae=clearTimeout:Ae=xa}catch{Ae=xa}})();function Fi(e){if(Oe===setTimeout)return setTimeout(e,0);if((Oe===Va||!Oe)&&setTimeout)return Oe=setTimeout,setTimeout(e,0);try{return Oe(e,0)}catch{try{return Oe.call(null,e,0)}catch{return Oe.call(this,e,0)}}}function Of(e){if(Ae===clearTimeout)return clearTimeout(e);if((Ae===xa||!Ae)&&clearTimeout)return Ae=clearTimeout,clearTimeout(e);try{return Ae(e)}catch{try{return Ae.call(null,e)}catch{return Ae.call(this,e)}}}var xe=[],Ot=!1,lt,fn=-1;function Af(){!Ot||!lt||(Ot=!1,lt.length?xe=lt.concat(xe):fn=-1,xe.length&&Gi())}function Gi(){if(!Ot){var e=Fi(Af);Ot=!0;for(var t=xe.length;t;){for(lt=xe,xe=[];++fn<t;)lt&&lt[fn].run();fn=-1,t=xe.length}lt=null,Ot=!1,Of(e)}}ee.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];xe.push(new Bi(e,t)),xe.length===1&&!Ot&&Fi(Gi)};function Bi(e,t){this.fun=e,this.array=t}Bi.prototype.run=function(){this.fun.apply(null,this.array)};ee.title="browser";ee.browser=!0;ee.env={};ee.argv=[];ee.version="";ee.versions={};function je(){}ee.on=je;ee.addListener=je;ee.once=je;ee.off=je;ee.removeListener=je;ee.removeAllListeners=je;ee.emit=je;ee.prependListener=je;ee.prependOnceListener=je;ee.listeners=function(e){return[]};ee.binding=function(e){throw new Error("process.binding is not supported")};ee.cwd=function(){return"/"};ee.chdir=function(e){throw new Error("process.chdir is not supported")};ee.umask=function(){return 0};var wf=Ui.exports;const P=vf(wf),Rf=Oo({level:"trace",enabled:typeof window<"u"&&!!window.localStorage.getItem("SL_DEBUG"),browser:{write:e=>{console.log(e)}}}),Me=(e,t)=>Rf.child({name:e},t);class Lf extends Event{constructor(n,a){super(n);p(this,"slEventBus");this.slEventBus=a}}const Mf=Me("event-bus");class Pf{constructor(t="sl-event-bus"){p(this,"name");p(this,"listeners");p(this,"emit",(t,n)=>{const a=new Lf(this.name,{...n,type:t});Mf.debug(a,"Emitting event"),window.dispatchEvent(a)});p(this,"destroy",()=>{this.listeners.forEach(t=>{window.removeEventListener(this.name,t),this.listeners.delete(t)}),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)}}class Cf{}window.slStore=Object.create(null);class Hn{constructor(t,n){p(this,"store");p(this,"name");this.store=t,this.name=n}getStore(){return this.store}}const Df=e=>{const t=Object.keys(e);return di(t.map(n=>e[n].getStore()),(...n)=>Object.fromEntries(t.map((a,s)=>[a,n[s]])))};class ut extends Hn{constructor(){super(...arguments);p(this,"getValues",()=>this.getStore().get());p(this,"getValue",n=>this.getStore().get()[n]);p(this,"setValue",(n,a)=>this.getStore().setKey(n,a));p(this,"subscribe",(...n)=>this.getStore().subscribe(...n));p(this,"unsubscribe",()=>this.getStore().off())}}const _e=e=>Pa(e);var Ue;(function(e){e.ORGANIZATION="ORGANIZATION",e.STREAM="STREAM"})(Ue||(Ue={}));const Uf={[q.BETTING]:"betting",[q.GAMES]:"games",[q.PUBLIC_CHAT]:"publicChat",[q.TWITTER]:"twitter"};var Ht;(function(e){e.Ready="ready",e.Suspended="suspended"})(Ht||(Ht={}));class Vi{constructor({settings:t,...n},a){p(this,"status");p(this,"source");p(this,"config");p(this,"settings");p(this,"listeners",new Set);p(this,"settingsKey");p(this,"enable",()=>{this.status.set(Ht.Ready)});p(this,"disable",()=>{this.status.set(Ht.Suspended)});p(this,"setFeatureConfig",({settings:t,...n})=>{var s;let a;for(a in n)this.config.setValue(a,n[a]);if(((s=t==null?void 0:t.overlaySettings)==null?void 0:s.case)!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey){const r=t.overlaySettings.value;if(r!==void 0){let o;for(o in r)r[o]!==0&&r[o]!==""&&this.settings.setValue(o,r[o])}}});p(this,"update",(t,n)=>{this.source===Ue.STREAM&&n===Ue.ORGANIZATION||(this.setFeatureConfig(t),this.source=n)});this.settingsKey=Uf[n.type],this.status=Ze(Ht.Suspended),this.config=new ut(_e(n),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey?this.settings=new ut(_e(t.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new ut(_e({}),`feature:settings:${this.settingsKey}`),this.source=a}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(t){this.listeners.add(t)}fireEvent(t){for(const n of this.listeners.values())try{n.onEvent(t)}catch(a){console.error(a)}}}class he extends Hn{constructor(){super(...arguments);p(this,"getValue",()=>this.getStore().get());p(this,"setValue",n=>this.getStore().set(n));p(this,"subscribe",n=>this.getStore().subscribe(n));p(this,"unsubscribe",()=>this.getStore().off())}getValues(){throw new Error("not implemented")}listen(n){return this.getStore().listen(n)}get(){return this.getStore().get()}}const se=e=>Ze(e),Ff=(e,t)=>di(e,t);class He extends Hn{constructor(n,a,s){super(n,`api:${a}`);p(this,"atomStore");p(this,"getAtomStore",()=>this.atomStore);p(this,"getValue",async()=>{const n=this.getStore();if(n.value===void 0)throw new Error("no store");return await n.value.promise,n.get().data});p(this,"getValues",()=>this.getStore().get());p(this,"setValue",n=>this.getStore().set({loading:!1,data:n==null?void 0:n.data}));p(this,"subscribe",n=>this.getStore().subscribe(n));p(this,"unsubscribe",()=>{throw new Error("not implemented")});p(this,"invalidate",()=>{this.store.invalidate()});p(this,"listen",n=>this.getStore().listen(n));p(this,"key",()=>this.getStore().key);p(this,"off",()=>this.getStore().off());this.atomStore=Ze(),s&&n.subscribe(r=>{const o=this.atomStore.get(),c=s(r,o);o!==c&&this.atomStore.set(c)})}get(){throw new Error("not implemented")}}const Le=new Pf;async function*Gf(e,t){for await(const n of t){e.response.message=n,e.received_at=Date.now();const a={type:"__GRPC_DEVTOOLS_EXTENSION__",data:e};window.postMessage(a),yield n}}const Bf=()=>e=>async t=>{const n={name:t.url,stream:t.stream,sent_at:Date.now(),request:{header:Object.fromEntries(t.header.entries())},response:{}};try{const a=await e(t);if(n.received_at=Date.now(),n.response.header=Object.fromEntries(a.header.entries()),n.response.trailer=Object.fromEntries(a.trailer.entries()),t.stream){n.request.message=t.message;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:{...n,stream:!1}};return window.postMessage(s),{...a,message:Gf(n,a.message)}}else{n.request.message=t.message,n.response.message=a.message,n.latency=n.received_at-n.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};window.postMessage(s)}return a}catch(a){n.received_at=Date.now(),n.request.message=t.message,n.response.trailer={"grpc-status":a.code,"grpc-message":a.rawMessage},n.response.message=a.rawMessage,n.latency=n.received_at-n.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};throw window.postMessage(s),a}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));function xi(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")}class Dt{constructor(t="main",n=window.localStorage){p(this,"delimiter",":");p(this,"prefix");p(this,"storage");p(this,"clear",()=>{for(const t in window.localStorage)t.startsWith(this.prefix)&&this.storage.removeItem(t)});p(this,"generateKey",t=>`${this.prefix}${this.delimiter}${t.join(this.delimiter)}`);p(this,"write",(...t)=>{const n=t.pop()||"",a=this.generateKey(t);try{this.storage.setItem(a,n)}catch(s){xi(s)&&this.storage===window.sessionStorage&&(window.sessionStorage.removeItem("slstreamlogs"),this.storage.setItem(a,n))}});p(this,"read",(...t)=>{const n=this.storage.getItem(this.generateKey(t));return n===null?void 0:n});p(this,"remove",(...t)=>{this.storage.removeItem(this.generateKey(t))});this.prefix=`sl-sdk${this.delimiter}${t}`,this.storage=n}}var Se;(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"})(Se||(Se={}));class Vf{constructor(t,n,a,s){p(this,"params");p(this,"streamCancel");p(this,"method");p(this,"options");p(this,"headers");p(this,"listeners");p(this,"state");p(this,"store");p(this,"paramsListener");p(this,"reconnectTimeout");p(this,"attempt",0);p(this,"updateState",t=>{this.state.setValue("status",t),this.state.setValue("ts",new Date),this.addStateLog(`status => ${t}`)});p(this,"addStateLog",t=>{const n=this.state.getStore().get().log,a=`${this.options.name} ${new Date().toISOString()}: ${t}`;if(n.push(a),this.state.setValue("log",n),localStorage.getItem("SL_DEBUG"))try{window.sessionStorage.setItem("slstreamlogs",window.sessionStorage.getItem("slstreamlogs")+`
4
- `+a)}catch(s){xi(s)&&window.sessionStorage.removeItem("slstreamlogs"),window.sessionStorage.setItem("slstreamlogs",a)}});p(this,"addListener",(t,n)=>this.listeners.has(t)?(this.addStateLog(`listener '${t}' not added, already exists`),()=>{}):(this.listeners.set(t,n),this.addStateLog(`listener '${t}' added`),()=>this.removeListener(t)));p(this,"removeListener",t=>{this.listeners.delete(t),this.addStateLog(`listener '${t}' removed`)});p(this,"connect",()=>{this.updateState(Se.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const t="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const n={headers:this.headers.getValues(),signal:this.streamCancel.signal},a=this.method(t,n);for await(const s of a)this.attempt=0,this.onData(s)}catch(n){n instanceof W&&n.code!=exports.Code.Canceled&&this.onStreamError(n)}})(),this.updateState(Se.Connected)});p(this,"disconnect",()=>{var t;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(t=this.paramsListener)==null||t.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(Se.Disconnected)});p(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(Se.Reconnect);const t=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),n=Math.round(t*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(Se.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${n}ms`),this.connect(),this.reconnectTimeout=void 0},n)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});p(this,"getStore",()=>{var t;return(t=this.store)==null?void 0:t.getStore()});p(this,"onData",t=>{try{this.addStateLog(`received data => ${JSON.stringify(t)}`),this.store&&this.store.setValue(t);for(const[,n]of this.listeners)n(t);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(n){this.addStateLog(`error process data => ${n}`)}});p(this,"onStreamError",t=>{if(this.addStateLog(`error => ${t?JSON.stringify(t):"undefined"}}`),t!==void 0){if(t instanceof W&&t.code!==exports.Code.Canceled){this.updateState(Se.Failed),this.state.setValue("error",t),this.reconnect();return}this.disconnect()}});const r={status:Se.Init,ts:new Date,log:[]};this.state=new ut(_e(r),`subscription:${s.name}:state`),this.options={...s,reconnectDelay:s.reconnectDelay??1e3,reconnectMaxDelay:s.reconnectMaxDelay??3e4,reconnectMaxAttempts:s.reconnectMaxAttempts??10,withStore:s.withStore??!1},this.headers=t,this.listeners=new Map,this.params=a,this.method=n,s.withStore&&(this.store=new he(se(null),`subscription:${s.name}:store`)),"subscribe"in a&&typeof a.subscribe=="function"&&(this.paramsListener=a.subscribe(o=>{this.state.getValue("status")===Se.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(o)}`),this.reconnect())})),this.updateState(Se.Ready)}}const xf=new Set([exports.Code.Unknown,exports.Code.Internal,exports.Code.DeadlineExceeded,exports.Code.ResourceExhausted,exports.Code.FailedPrecondition,exports.Code.Unavailable,exports.Code.DataLoss]),Qr=Me("grpc:retry"),qf=e=>async t=>{const n=t.contextValues.get(qa.retryAttempts),a=300,s=t.contextValues.get(qa.retryDelay);if(t.stream||n===0)return e(t);Qr.trace({url:t.url,attempts:n,maxDelay:s},"retry options");for(let r=0;;r++)try{return await e(t)}catch(o){Qr.trace({attempt:r,error:o},"retry attempt");const c=W.from(o);if(r>=n||!(c instanceof W)||!xf.has(c.code))throw o;const l=Math.min(s,Math.pow(2,r)*a),m=Math.round(l*(1+Math.random())/2);await new Promise(u=>setTimeout(u,m))}},qa={retryAttempts:Ua(10,{description:"Number of attempts to retry"}),retryDelay:Ua(3e4,{description:"Max delay between retries in milliseconds"})},Hf=()=>{const e=localStorage.getItem("sl-device-id");if(e)return e;const t=Ca();return localStorage.setItem("sl-device-id",t),t},Qf=()=>{var e;return((e=navigator.userAgentData)==null?void 0:e.platform)||navigator.platform};class Yr{constructor(t,n){p(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});p(this,"transport");p(this,"streamTransport");p(this,"nanoquery");p(this,"host");p(this,"$headers");p(this,"interceptors",[]);p(this,"clients");p(this,"streamClients");p(this,"subscriptions");p(this,"opts");p(this,"addSubscription",(t,n,a)=>{const s=this.subscriptions.get(n);if(s)return s;const r=new Vf(this.$headers,t,n,a);return this.subscriptions.set(n,r),r});p(this,"removeSubscription",t=>{t.disconnect(),this.subscriptions.delete(t.params)});p(this,"disconnect",()=>{var s,r;for(const[o,c]of this.subscriptions)c.disconnect(),this.subscriptions.delete(o);this.clients.clear(),this.streamClients.clear(),this.subscriptions.clear();const[t,n,a]=kr({dedupeTime:(s=this.opts)==null?void 0:s.dedupeTime,refetchInterval:(r=this.opts)==null?void 0:r.refetchInterval});this.nanoquery={createFetcherStore:t,createMutatorStore:n,utils:a}});p(this,"registerInterceptor",t=>{this.interceptors.push(t)});p(this,"removeInterceptor",t=>{this.interceptors=this.interceptors.filter(n=>n!==t)});p(this,"getClient",t=>{const n=t.typeName;if(this.clients.has(n))return this.clients.get(n);const a=cr(t,this.transport);return this.clients.set(n,a),a});p(this,"getStreamClient",t=>{const n=`stream-${t.typeName}`;if(this.clients.has(n))return this.clients.get(n);const a=cr(t,this.streamTransport);return this.clients.set(n,a),a});p(this,"createPromiseClient",(t,{params:n=[],method:a})=>{const s=this.getClient(t),r=t.methods[a].name,o=[t.typeName,r.charAt(0).toLowerCase()+r.slice(1),...Array.isArray(n)?n:[n]],c=[t.typeName,r.charAt(0).toLowerCase()+r.slice(1)];return{client:s,createRequestOptions:l=>{const m=Da();for(const u in l){const d=qa[u];m.set(d,l[u])}return m},queryKey:o,queryKeyStr:c.join("")}});p(this,"createStreamClient",t=>({client:this.getStreamClient(t)}));p(this,"setSdkKey",t=>{this.$headers.setValue("sdk",t)});p(this,"setAuth",(t,n)=>{this.$headers.setValue("authorization",t),this.$headers.setValue("sl-user-id",n)});p(this,"setHeader",(t,n)=>this.$headers.setValue(t,n));p(this,"getHeader",t=>this.$headers.getValue(t));p(this,"getHeaders",()=>this.$headers.getValues());p(this,"initInterceptors",()=>{var n;if(this.interceptors.length!==0)return;const t=a=>s=>{const r=this.$headers.getValues();for(const o in r)s.header.set(o,r[o]);return a(s)};this.interceptors.push(t),this.interceptors.push(Bf()),(n=this.opts)!=null&&n.retryable&&this.interceptors.push(qf)});this.host=t,this.opts=n,this.$headers=new ut(_e({"sl-device-id":Hf(),"sl-device-os":Qf()}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.streamClients=new Map,this.subscriptions=new Map;const[a,s,r]=kr({dedupeTime:n==null?void 0:n.dedupeTime,refetchInterval:n==null?void 0:n.refetchInterval});this.nanoquery={createFetcherStore:a,createMutatorStore:s,utils:r},this.transport=fr({baseUrl:t,defaultTimeoutMs:1e4,interceptors:this.interceptors}),this.streamTransport=fr({baseUrl:t,interceptors:this.interceptors})}}const Yf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Iy,{method:"retrieveEventId",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;if(!o||typeof o!="string")return"";try{return((c=(await n.retrieveEventId({id:o})).data)==null?void 0:c.id)||""}catch{return""}}})},jf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"getStream",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;return o?(c=(await n.getStream({id:o})).data)==null?void 0:c.attributes:void 0}})},$f=(e,t)=>{const{queryKey:n,client:a}=t.createPromiseClient(ks,{method:"me",params:[e]});return t.nanoquery.createFetcherStore(n,{fetcher:async()=>{const{data:s}=await a.me({});return{data:s}}})},Wf=e=>{const{client:t,createRequestOptions:n}=e.createPromiseClient(ks,{method:"bypassAuth"}),a=n({retryAttempts:0});return({userKey:s,schema:r,init:o,inviterKey:c})=>t.bypassAuth({userKey:s,schema:r,init:o,inviterKey:c},{contextValues:a})},Kf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.get({})).data)==null?void 0:s.attributes}})},zf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"getOrganization",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{const s=await n.getOrganization({});return s.data?{...s.data.attributes,id:s.data.id}:void 0}})},Jf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"getOrganizationAdvertising",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.getOrganizationAdvertising({})).data)==null?void 0:s.attributes}})},Xf=(e,t,n)=>{e.transport=new Yr(t.host,{dedupeTime:1e3*60*5,refetchInterval:1e3*60*5,retryable:!0}),e.analyticsTransport=new Yr(t.analyticsHost),e.sdk.host=e.transport.host,e.transport.setSdkKey(t.sdkKey),e.transport.setHeader("sl-sdk-version",t.version||"-"),e.transport.$headers.subscribe(a=>{e.analyticsTransport.$headers.getStore().set(a)}),e.sdk.onMount({name:"transport"},()=>()=>{e.transport.disconnect(),e.analyticsTransport.disconnect()}),n()};var Ce;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(Ce||(Ce={}));class bt extends Dt{constructor(){super("user");p(this,"setSchema",n=>{this.write(Ce.SCHEMA,n)});p(this,"getSchema",()=>this.read(Ce.SCHEMA));p(this,"setToken",n=>{this.write(Ce.TOKEN,n)});p(this,"getToken",()=>this.read(Ce.TOKEN));p(this,"setExternalToken",n=>{this.write(Ce.EXTERNAL_TOKEN,n)});p(this,"getExternalToken",()=>this.read(Ce.EXTERNAL_TOKEN));p(this,"removeToken",()=>{this.remove(Ce.TOKEN)})}}var Fe;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(Fe||(Fe={}));const Zf=e=>{const t=new bt,n=new he(se(t.getExternalToken()),"userKey"),a=new he(se(t.getToken()),"userToken"),s=new He($f(a.getStore(),e),"user",({data:o,error:c,loading:l},m)=>{var u;if(!c)return(u=o==null?void 0:o.data)!=null&&u.id?o.data.id:l===!1?void 0:m}),r=new He(Kf(a.getStore(),e),"userSettings");return{userKey:n,userToken:a,user:s,userSettings:r}},ek=e=>{const t=new he(se(void 0),"providerStreamId"),n=new He(Yf(t.getStore(),e),"slStreamId",s=>s==null?void 0:s.data),a=new He(jf(n.getAtomStore(),e),"streamSettings");return n.getAtomStore().listen(s=>{(s===""||s===void 0)&&a.getStore().mutate(void 0)}),{providerStreamId:t,slStreamId:n,streamSettings:a}},tk=e=>{const t=new he(se(void 0),"enabled"),n=new he(se(Fe.DISABLED),"status"),a=new He(zf(t.getStore(),e),"organizationSettings",c=>{var l;return(l=c==null?void 0:c.data)==null?void 0:l.id}),s=new He(Jf(a.getAtomStore(),e),"organizationAdvertising"),r=Zf(e),o=ek(e);return{enabled:t,status:n,providerStreamId:o.providerStreamId,slStreamId:o.slStreamId,streamSettings:o.streamSettings,user:r.user,userKey:r.userKey,userToken:r.userToken,userSettings:r.userSettings,organizationSettings:a,organizationAdvertising:s}};class nk extends Hn{constructor(n){const a=tk(n),s=Df(a);super(s,"core");p(this,"stores");p(this,"subscribe",n=>{let a;for(a in this.stores){const s=n[a];a in n&&s!==void 0&&this.stores[a].subscribe(n[a])}});p(this,"unsubscribe",()=>this.getStore().off());this.stores=a}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}const ak=(e,t,n)=>{e.store=new nk(e.transport),e.stores=e.store.getValues(),e.sdk.enabled=e.stores.enabled.getStore(),e.sdk.status=e.stores.status.getStore(),e.sdk.sdkStore=Object.fromEntries(Object.entries(e.stores).map(([a,s])=>[a,s.getStore()])),e.sdk.organizationStore=()=>e.stores.organizationSettings.getStore(),e.sdk.streamStore=()=>e.stores.streamSettings.getStore(),e.storeUnsubscribe=()=>{e.store.unsubscribe()},n()},sk=e=>{const{client:t}=e.createPromiseClient(Ci,{method:"list"});return n=>t.list(n)},qi=e=>{const{client:t}=e.createPromiseClient(Ci,{method:"summary"});return n=>t.summary(n)},rk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(ks,{method:"getFriends",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>o?(await n.getFriends({})).data:[]})},ok=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ye,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;return(c=(await n.get({eventId:o})).data)==null?void 0:c.attributes},refetchInterval:0,dedupeTime:1e3*60*60})},ik=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ye,{method:"syncQuestion",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;return o?(c=(await n.syncQuestion({filter:{eventId:o}})).data)==null?void 0:c.attributes:void 0},dedupeTime:1e3*60*10,refetchInterval:0})},ck=(e,t)=>{console.log("feedSubscription",e);const{client:n}=t.createStreamClient(Ye),a=Ze({eventId:e.get()||"",feedId:""});return e.subscribe((s="")=>{a.set({eventId:s,feedId:""})}),t.addSubscription(n.subscription,a,{name:"feedSubscription"})},lk=(e,t)=>{const{client:n}=t.createStreamClient(Ye);return t.addSubscription(n.questionSubscription,{questionId:e},{name:"questionSubscription"})},Ha=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ye,{method:"questionByUser",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c,l;return(l=(c=(await n.questionByUser({questionId:o})).data)==null?void 0:c.attributes)==null?void 0:l.question},dedupeTime:1e3*60*5})},mk=async(e,t)=>{var s,r,o,c,l,m;if(!e)return;const{client:n}=t.createPromiseClient(Ye,{method:"getQuestion",params:[e]}),a=await n.getQuestion({id:e});return((o=(r=(s=a.data)==null?void 0:s.attributes)==null?void 0:r.options)==null?void 0:o.options.case)==="promotion"?(m=(l=(c=a.data)==null?void 0:c.attributes)==null?void 0:l.options)==null?void 0:m.options.value:void 0},uk=(e,t,n)=>{const{client:a,queryKey:s}=n.createPromiseClient(Ye,{method:"list",params:[e,t]});return n.nanoquery.createFetcherStore(s,{fetcher:async(r,o,c,l)=>c?(await a.list({eventId:c,filter:{types:l===dt.ALLOWED?[]:[F.FACTOID,F.PROMOTION,F.TWEET],statuses:[le.ACTIVE,le.RESOLVED]}})).data:[],dedupeTime:0,refetchInterval:0})},dk=(e,t,n)=>{const a=sr([t,n],()=>{var m,u;const o=t.get();if(!o)return;const c=(m=n.get().data)==null?void 0:m.find(d=>d.id===(o==null?void 0:o.questionId)),l=(u=o==null?void 0:o.question)==null?void 0:u.openedFrom;return c?(c.openedFrom=l,c):o.question}),s=sr(a,o=>o&&o.type==="question"?o.id:void 0),r=Ha(s,e);return{$store:a,$extendedStore:r,updateExtendedQuestion:o=>{const c=r.get().data,l=(m,u)=>{if(!m||!u)return m||u||[];const d=[];for(let y=0;y<m.length;y++)d.push({...m[y],...u[y],correct:m[y].correct,youVoted:m[y].youVoted,pointsEarned:m[y].pointsEarned});return d};r.mutate({...o,options:c==null?void 0:c.options,subject:c==null?void 0:c.subject,appearance:c==null?void 0:c.appearance,answers:l(c==null?void 0:c.answers,o==null?void 0:o.answers)})}}};var wn;(function(e){e.SHOWED="showed"})(wn||(wn={}));class pk extends Dt{constructor(){super("advertisement");p(this,"setShowed",n=>{this.write(wn.SHOWED,n,"true")});p(this,"isShowed",n=>this.read(wn.SHOWED,n))}}class Tk{constructor(t){p(this,"advertisementList");p(this,"store");p(this,"timeouts");p(this,"waitingQueue");p(this,"activeQueue");p(this,"options");p(this,"logger");p(this,"addToQueue",t=>{if(this.store.has(t.id)){this.logger.debug({advertisement:t},"skip existed advertisement: %o");return}const n=t.close,a=t.action;if(this.store.set(t.id,{...t,close:(...s)=>{n&&n(...s),this.closeAdvertisement(t.id)},action:(...s)=>{a&&a(...s),this.closeAdvertisement(t.id,{animateHiding:!1})}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[s]=this.activeQueue;this.closeAdvertisement(s)}else this.tickWaitingQueue()});p(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});p(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({advertisementId:t},"active queue tick skipped, advertisement not exist");return}const a=setTimeout(()=>{const s=t,r=new Map(this.advertisementList.get());if(r.set(n.id,n),this.advertisementList.set(r),n.autoHideDuration!==1/0){const o=setTimeout(()=>{this.logger.debug({advertisementId:s,delay:n.autoHideDuration||5e3},"advertisement hiding by autoHideDuration"),this.closeAdvertisement(s)},n.autoHideDuration||5e3);this.timeouts.set(s,o)}this.logger.debug({advertisementId:s,queue:[...r.values()]},"advertisement displayed")},n.delay||0);this.timeouts.set(t,a),this.logger.debug({advertisementId:t},"active queue tick completed"),this.tickWaitingQueue()});p(this,"closeAdvertisement",(t,{animateHiding:n=!0}={})=>{const a=new Map(this.advertisementList.get()),s=a.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&n,this.advertisementList.set(a);const r=setTimeout(()=>{const o=new Map(this.advertisementList.get());o.delete(t),this.advertisementList.set(o);const c=this.timeouts.get(t);c!==void 0&&(clearTimeout(c),this.timeouts.delete(t)),this.logger.debug({advertisementId:t},"advertisement hidden")},this.options.animationDelay||0);this.timeouts.set(t,r)}return this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({advertisementId:t},"advertisement hiding"),s});p(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.advertisementList.off(),this.advertisementList.set(new Map)});this.options=t,this.logger=Me("advertisement_queue"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.advertisementList=se(new Map)}}const yk=(e,t,n)=>{const a=Me("advertisement_queue"),s=new Tk({concurrency:1,animationDelay:0}),r=new pk,o=Ff(e.getStore(),d=>{var y;return(y=d.data)==null?void 0:y.filter(T=>T.type==="promotion")}),c=d=>{r.isShowed(d)||s.addToQueue({id:d,autoHideDuration:1/0,data:_e({loading:!1,error:void 0,data:void 0}),promise:async function(){this.data.setKey("loading",!0);try{const y=await mk(d,n);y?this.data.setKey("data",y):this.data.setKey("error",new Error("No promotion found"))}catch(y){this.data.setKey("error",y)}finally{this.data.setKey("loading",!1)}}})},l=d=>{a.debug({notificationId:d},"markAsViewed: %o"),r.setShowed(d)},m=d=>{s.closeAdvertisement(d),l(d)},u=()=>{const d=s.advertisementList.get();if(!(d!=null&&d.size))return null;const y=d.values().next().value,T=y.data.get();return!T.data&&!T.error&&!T.loading&&(y.promise(),Le.emit("poll",{action:"opened",payload:{questionId:y.id,questionType:F.PROMOTION,questionOpenedFrom:"notification"}}),l(y.id)),y};return Jt(s.advertisementList,()=>{o.subscribe(d=>{if(d){const y=d[d.length-1];c(y.id)}}),t.addListener("promotion",d=>{var T,f,_;const y=(f=(T=d.data)==null?void 0:T.attributes)==null?void 0:f.feedItem;if(((_=y==null?void 0:y.attributes)==null?void 0:_.attributes.case)!=="promotion"){a.debug("not promotion");return}if(y.attributes.status===le.RESOLVED){m(y.id),a.debug({feedItem:y},"resolved: %o");return}if(y.attributes.status===le.ACTIVE){a.debug({feedItem:y},"active: %o"),c(y.id);return}a.debug({feedItem:y},"skip: %o")})}),{hide:m,show:c,$list:s.advertisementList,getActiveAdvertisement:u}};var dt;(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(dt||(dt={}));class gk{constructor(t){p(this,"slStreamId");p(this,"organizationId");p(this,"userId");p(this,"interactiveAllowed");p(this,"openedQuestionId");p(this,"openedQuestion");p(this,"activeQuestionId");p(this,"feedList");p(this,"moderationId");p(this,"moderation");p(this,"feedSubscription");p(this,"questionSubscription");p(this,"advertisement");p(this,"notifications");p(this,"log");p(this,"transport");p(this,"cancels",new Set);p(this,"getCurrentSessionId",t=>{const n=t.eventId||this.slStreamId.get()||"",a=t.userId||this.userId.get()||"",s=t.organizationId||this.organizationId.get()||"",r=t.entity||"",o=t.prefix||"";return[s,n,a,o,r].join(":")});p(this,"disconnect",()=>{var t;(t=this.feedSubscription)==null||t.disconnect(),this.questionSubscription!==void 0&&(this.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0)});p(this,"openQuestion",(t,n)=>{this.openedQuestionId.set({questionId:t,question:n}),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});p(this,"closeQuestion",t=>{this.openedQuestionId.set(void 0),t&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});this.transport=t.transport,this.log=Me("gamification-background"),this.slStreamId=t.stores.slStreamId.getAtomStore(),this.organizationId=t.stores.organizationSettings.getAtomStore(),this.userId=t.stores.user.getAtomStore(),this.moderationId=new he(se(void 0),"moderationId").getStore(),this.interactiveAllowed=new he(se(dt.DISALLOWED),"interactiveAllowed").getStore(),this.openedQuestionId=new he(se(void 0),"openedQuestionId").getStore(),this.notifications=t.notifications,this.moderation=new He(ok(this.slStreamId,t.transport),"gamification:moderation"),this.feedList=new He(uk(this.slStreamId,this.interactiveAllowed,t.transport),"gamification:feedList"),this.activeQuestionId=ik(this.slStreamId,t.transport),this.openedQuestion=dk(t.transport,this.openedQuestionId,this.feedList.getStore()),this.cancels.add(this.openedQuestionId.listen(n=>{this.log.debug({item:n},"received question"),n!=null&&n.questionId?(this.questionSubscription=lk(n.questionId,t.transport),this.questionSubscription.addListener("feed-subscription-opened-question",a=>{var s,r;this.openedQuestion.updateExtendedQuestion((r=(s=a.data)==null?void 0:s.attributes)==null?void 0:r.question)}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(t.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))})),this.feedSubscription=ck(this.slStreamId,t.transport),this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question",n=>{var r,o,c,l,m;const a=(o=(r=this.activeQuestionId.get().data)==null?void 0:r.question)==null?void 0:o.id,s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.question;s&&(a&&s.status===le.RESOLVED&&s.id!==a||this.activeQuestionId.mutate((m=n.data)==null?void 0:m.attributes))})),this.cancels.add(this.feedSubscription.addListener("moderation update",n=>{window.requestAnimationFrame(()=>{var a,s,r,o;((s=(a=n.data)==null?void 0:a.attributes)==null?void 0:s.question)===void 0&&((o=(r=n.data)==null?void 0:r.attributes)!=null&&o.moderation)&&this.moderation.invalidate()})})),this.feedSubscription.connect(),this.cancels.add(this.interactiveAllowed.listen(()=>{window.requestAnimationFrame(()=>{this.activeQuestionId.invalidate()})})),t.sdk.onMount({name:"gamification-background"},()=>()=>{this.activeQuestionId.off();for(const n of this.cancels)n(),this.cancels.delete(n)}),this.advertisement=yk(this.feedList,this.feedSubscription,t.transport)}}class fk{constructor(t){p(this,"notificationsList");p(this,"store");p(this,"timeouts");p(this,"waitingQueue");p(this,"activeQueue");p(this,"options");p(this,"logger");p(this,"addToQueue",t=>{var s;if(this.store.has(t.id)){this.logger.debug({notification:t},"skip existed notification: %o");return}const n=t.close,a=t.action;if(this.store.set(t.id,{...t,close:(...r)=>{n&&n(...r),this.closeNotification(t.id)},action:(...r)=>{a&&a(...r),this.closeNotification(t.id,{animateHiding:!1})}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[r]=this.activeQueue;if(((s=this.store.get(r))==null?void 0:s.persistent)!==!0)this.closeNotification(r);else{const[o]=this.waitingQueue;this.waitingQueue.size>1&&this.closeNotification(o),this.tickWaitingQueue()}}else this.tickWaitingQueue()});p(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});p(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({notificationId:t},"active queue tick skipped, notification not exist");return}const a=setTimeout(()=>{const s=t,r=new Map(this.notificationsList.get());r.set(n.id,n),this.notificationsList.set(r);const o=setTimeout(()=>{this.logger.debug({notificationId:s,delay:n.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(s)},n.autoHideDuration||5e3);this.timeouts.set(s,o),this.logger.debug({notificationId:s,queue:[...r.values()]},"notification displayed")},n.delay||0);this.timeouts.set(t,a),this.logger.debug({notificationId:t},"active queue tick completed"),this.tickWaitingQueue()});p(this,"closeNotification",(t,{animateHiding:n=!0}={})=>{const a=new Map(this.notificationsList.get()),s=a.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&n,this.notificationsList.set(a);const r=setTimeout(()=>{const o=new Map(this.notificationsList.get());o.delete(t),this.notificationsList.set(o);const c=this.timeouts.get(t);c!==void 0&&(clearTimeout(c),this.timeouts.delete(t)),this.logger.debug({notificationId:t},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(t,r)}return this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({notificationId:t},"notification hiding"),s});p(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.notificationsList.off(),this.notificationsList.set(new Map)});this.options=t,this.logger=Me("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notificationsList=se(new Map)}}var Rn;(function(e){e.OPENED="opened"})(Rn||(Rn={}));class kk extends Dt{constructor(){super("notification");p(this,"setOpened",n=>{this.write(Rn.OPENED,n,"true")});p(this,"isOpened",n=>this.read(Rn.OPENED,n));p(this,"clearNotification",()=>{this.clear()})}}var ze;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(ze||(ze={}));class hk{constructor(t={}){p(this,"queue");p(this,"storage");p(this,"add",t=>{if(!this.storage.isOpened(t.id)){if(t.data&&t.emitEvent){const n=t.action;t.action=(...a)=>{n&&n(...a),Le.emit("notification",{action:"opened",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})}}this.queue.addToQueue(t)}});p(this,"close",(t,{markAsViewed:n=!0,animateHiding:a}={})=>{this.queue.closeNotification(t,{animateHiding:a}),n&&this.markAsViewed(t)});p(this,"getActiveNotification",()=>{const t=this.queue.notificationsList.get();if(!(t!=null&&t.size))return null;for(const n of t.values())if(n.type===ze.ONBOARDING)return n;return t.values().next().value});p(this,"getQueueStore",()=>this.queue.notificationsList);p(this,"markAsViewed",t=>{this.storage.setOpened(t)});this.storage=new kk,this.queue=new fk({concurrency:1,animationDelay:1600,...t})}}const Sk=(e,t,n)=>{e.notifications=new hk(void 0),e.addNotification=e.notifications.add,e.sdk.getNotificationsStore=()=>e.notifications.getQueueStore(),e.sdk.getActiveNotification=()=>e.notifications.getActiveNotification(),e.sdk.onMount({name:"notifications"},()=>()=>{e.notifications.queue.drain()}),n()};var Kt;(function(e){e.UNKNOWN="unknown",e.ALREADY_VOTED="already_voted"})(Kt||(Kt={}));const _k=async(e,t)=>{var r;const{client:n,createRequestOptions:a}=e.createPromiseClient(Ye,{method:"submitAnswer"}),s=a({retryAttempts:0});try{return await n.submitAnswer({data:t},{contextValues:s})}catch(o){throw((r=W.from(o))==null?void 0:r.code)===exports.Code.AlreadyExists?new Error(Kt.ALREADY_VOTED):new Error(Kt.UNKNOWN)}},Ek=(e,t)=>{const{client:n,createRequestOptions:a}=e.createPromiseClient(Ye,{method:"submitInplay"}),s=a({retryAttempts:0});return n.submitInplay({data:{eventId:+t}},{contextValues:s})};var It;(function(e){e.ONBOARDING="onboarding",e.ONBOARDING_IO="onboarding_io"})(It||(It={}));class bk extends Dt{constructor(){super("gamification-session",window.sessionStorage);p(this,"writeValue",(n,a)=>{this.write(...n,a)});p(this,"readValue",n=>this.read(...n))}}class Hi extends Dt{constructor(){super("gamification");p(this,"sessionStorage");p(this,"saveOnboardingStatus",({userId:n,eventId:a,organizationId:s},r)=>{this.write(It.ONBOARDING,s,n,a,r)});p(this,"getOnboardingStatus",({userId:n,eventId:a,organizationId:s})=>this.read(It.ONBOARDING,s,n,a));p(this,"setOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>{this.sessionStorage.writeValue([It.ONBOARDING_IO,s,n,a],"1")});p(this,"getOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>this.sessionStorage.readValue([It.ONBOARDING_IO,s,n,a]));this.sessionStorage=new bk}}const Ik={pageSize:10},Nk=(e,t,n,a,s)=>{let r=0;const o=se({pageSize:Ik.pageSize,page:0}),c=_e({data:[],key:Date.now(),hasMore:!0,loading:void 0,error:void 0}),l=sk(e),m=async()=>{var f;const y=t.get(),T=((f=a.getStore().get().data)==null?void 0:f.map(_=>_.slId))||[];if(y&&(T!=null&&T.length)){const _=n.get();_&&T.push(_),c.setKey("loading",!0),c.setKey("data",[]);const v=await l({eventId:y,usersIds:T});c.set({data:v.data.map((I,E)=>({...I.attributes,friendsRank:E+1})),hasMore:!1,key:Date.now(),loading:!1}),v.meta&&(r=Math.round(v.meta.count/v.meta.pageSize))}},u=()=>{m()},d=y=>{const T=o.get(),f=y||T.page+1;f<=r&&o.set({...T,page:f})};return Jt(c,()=>{const y=t.listen(m),T=a.listen(m);return()=>{y(),T()}}),{$store:c,fetchMore:d,invalidate:u}};class vk extends Dt{constructor(){super("deep-link-context",window.sessionStorage);p(this,"get",this.read);p(this,"set",this.write);p(this,"del",this.remove)}}const jr="sldl",Qn="sldl_uid",Qi="sldl_eid",Yi="sldl_e_eid",Ok=new Set([Qn,Qi,Yi]),$r=e=>{const t={},n={};for(const[a,s]of e)Ok.has(a)?t[a]=s:n[a]=s;return{result:t,remain:n}},Ak=({hash:e,search:t})=>{if(e&&e.includes(jr)){const n=new URLSearchParams(e.substr(1));return{hash:$r(n)}}if(t&&t.includes(jr)){const n=new URLSearchParams(t);return{search:$r(n)}}return null},Wr=Me("deep_link"),we={debug:(...e)=>{Wr.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{Wr.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},wk=(e,t)=>{const{hash:n,search:a}=window.location;if(we.debug({hash:n,search:a},"get deep link data from"),n||a){const s=Ak({hash:n,search:a});if(we.debug(s,"parse deep link result"),s){const{hash:r,search:o}=s,{result:c,remain:l}=r||o;if(Object.keys(c).length!==0){e.setValue("data",c);const m=Object.keys(l).length!==0;if(r){let u="";m&&(u=`#${new URLSearchParams(l).toString()}`,we.debug({updatedHash:u},"update hash")),window.history.replaceState(null,"",window.location.pathname+window.location.search+u)}if(o){let u="";m&&(u=`?${new URLSearchParams(l).toString()}`,we.debug({updatedSearch:u},"update search")),window.history.replaceState(null,"",window.location.pathname+u+window.location.hash)}t(c)}}}e.setValue("parsed",!0)},Rk=(e,t,n)=>{const a=new vk,s=a.get("sl-deep-link-store");let r={};if(s)try{r=JSON.parse(s)}catch(c){we.debug(c)}e.deepLink={$store:new ut(_e(r),"deep-link-context"),getDeepLinkData:()=>{const{data:c,used:l}=e.deepLink.$store.getValues();return{data:c,used:l}},deepLinkUsed:c=>{we.debug(`logged in with inviterId: ${c}`),e.deepLink.$store.setValue("used",!0)},onDeepLinkHandlers:new Set},e.sdk.getInviter=()=>{const{data:c,used:l}=e.deepLink.getDeepLinkData();return l?c==null?void 0:c[Qn]:void 0},e.sdk.inviteDisplayed=()=>{e.deepLink.$store.getStore().set({}),e.deepLink.$store.getStore().off(),a.del("sl-deep-link-store")},e.deepLink.$store.subscribe(c=>a.set("sl-deep-link-store",JSON.stringify(c))),e.sdk.addDeepLinkHandler=c=>{localStorage.getItem("SL_DEBUG")&&we.trace("adding deep link handler"),e.deepLink.onDeepLinkHandlers.add(c)},t.onDeepLinkHandled&&e.sdk.addDeepLinkHandler(t.onDeepLinkHandled),e.sdk.removeDeepLinkHandler=c=>{we.trace("removing deep link handler"),e.deepLink.onDeepLinkHandlers.delete(c)};const o=c=>{e.deepLink.$store.setValue("handled",!0),we.trace({size:e.deepLink.onDeepLinkHandlers.size},"deep link handled, call callbacks");for(const l of e.deepLink.onDeepLinkHandlers)try{we.trace("called handler"),l(c)}catch(m){console.error(m)}};wk(e.deepLink.$store,o),n()},Lk=Me("bypass");class Mk extends Cf{constructor(n,a,s){super();p(this,"$coreStore");p(this,"deepLink");p(this,"transport");p(this,"bypassLogin");p(this,"me",async()=>{var n;return this.$coreStore.getValues().user.invalidate(),(n=await this.$coreStore.getValues().user.getValue())==null?void 0:n.data});p(this,"login",async(n,a)=>{var u,d,y;this.$coreStore.getValues().userKey.setValue(a);const{used:s,data:r}=this.deepLink.getDeepLinkData(),o=s?"":r==null?void 0:r[Qn];Lk.debug({inviterKey:o},"login with inviterKey");const c=await this.bypassLogin({schema:n,userKey:a,inviterKey:o,init:!1}),l=(u=c.meta)==null?void 0:u.jwt,m=(d=c.data)==null?void 0:d.id;if(!l||!m)throw new Error("internal: token missing");return(y=c.meta)!=null&&y.inviterKey&&this.deepLink.deepLinkUsed(c.meta.inviterKey),this.$coreStore.getValues().user.getStore().mutate({data:c.data}),this.saveUser(l,m),l});p(this,"isAuthenticated",()=>this.me());p(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new bt().clear()});p(this,"softLogout",()=>{const n=new bt;this.transport.setAuth("",""),n.setToken(""),this.reLogin()});p(this,"reLogin",()=>{const n=new bt,a=n.getToken(),s=n.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(s),a)return this.saveUser(a,""),this.me().then(r=>{if(r!=null&&r.id){const o=r.id;this.saveUser(a,o)}});if(s&&!a){const r=n.getSchema();r&&s&&this.login(r,s).catch(()=>{this.logout()})}});p(this,"saveUser",(n,a)=>{this.transport.setAuth(n,a),this.$coreStore.getValues().userToken.setValue(n),new bt().setToken(n)});p(this,"connect",()=>{this.transport.registerInterceptor(n=>async a=>{try{return await n(a)}catch(s){throw s.code&&(s.code===7||s.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),s}})});this.$coreStore=n,this.deepLink=s,this.transport=a,this.bypassLogin=Wf(this.transport),this.connect()}}const Bt=new bt,Pk=(e,t,n)=>{e.auth=new Mk(e.store,e.transport,e.deepLink),e.stores.status.listen(a=>{a===Fe.READY&&e.auth.reLogin()}),e.sdk.userId=e.stores.user.getAtomStore,e.sdk.authorizationBypass=async(a,s)=>{if(!(Bt.getSchema()===a&&Bt.getExternalToken()===s&&e.transport.getHeader("authorization")))try{await e.auth.login(a,s),Bt.setSchema(a),Bt.setExternalToken(s)}catch{e.sdk.logout()}},e.sdk.logout=()=>{e.auth.logout(),Bt.clear()},e.sdk.getUserStore=()=>e.stores.user.getStore(),e.sdk.isUserAuthorized=()=>e.auth.isAuthenticated(),n()},Kr=Me("video_player"),ln={debug:(...e)=>{Kr.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{Kr.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},Ck=(e,t,n)=>{e.videoPlayer={controllers:new Set},e.sdk.addVideoPlayerController=a=>{ln.trace("adding video player controller"),e.videoPlayer.controllers.add(a)},t.videoPlayerController&&e.sdk.addVideoPlayerController(t.videoPlayerController),e.sdk.removeVideoPlayerController=a=>{ln.trace("removing video player controller"),e.videoPlayer.controllers.delete(a)},e.sdk.controlVideoPlayer=a=>{ln.trace("controlling video player");for(const s of e.videoPlayer.controllers){ln.trace("calling video player controller");try{s(a)}catch(r){console.error(r)}}},n()},Dk=(e,t,n)=>{const a={onMountedFired:!1},s=new Map,r=new Map;e.sdk=Object.create(null),e.sdk.onMount=({name:o,clear:c},l)=>{var m,u;if(s.has(o)){const d=r.get(o);d&&d(),s.delete(o),r.delete(o)}s.set(o,{cb:l,clear:c}),((u=(m=e==null?void 0:e.stores)==null?void 0:m.enabled)==null?void 0:u.get())==="on"&&r.set(o,l())},e.ready=()=>{e.stores.enabled.subscribe(o=>{o==="on"&&a.onMountedFired===!1&&(s.forEach(({cb:c},l)=>r.set(l,c())),a.onMountedFired=!0),o!=="on"&&a.onMountedFired===!0&&(r.forEach(c=>c()),r.clear(),s.forEach(({clear:c},l)=>c&&s.delete(l)),a.onMountedFired=!1)})},e.sdk.initializeApp=async o=>{if(e.contextConfig=o,e.stores.enabled.get()==="on")return{enabled:!0};e.storeSubscribe(),e.stores.enabled.setValue("on"),e.stores.status.setValue(Fe.INITIALIZATION);try{const c=await e.stores.organizationSettings.getValue();return c?(e.stores.status.setValue(Fe.READY),{enabled:!!c}):(e.stores.status.setValue(Fe.FAILED),{err:"failed"})}catch(c){return e.stores.enabled.setValue(),e.stores.status.setValue(Fe.FAILED),{err:`${c}`}}},e.sdk.disableApp=()=>{e.stores.enabled.get()==="on"&&(e.stores.enabled.setValue(),e.stores.status.setValue(Fe.DISABLED),e.stores.slStreamId.setValue(),e.stores.providerStreamId.setValue(),e.sdk.closeFeature(!0),e.storeUnsubscribe(),e.transport.disconnect())},e.sdk.createEventSession=o=>{e.stores.providerStreamId.setValue(o)},n()},Uk=(e,t)=>{const{client:n,queryKey:a}=e.createPromiseClient(Xt,{method:"generateDeepLink",params:t});return e.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o,c)=>{var l;if(!o)return{};try{return(l=(await n.generateDeepLink({data:{gamification:!0,externalEventId:c,eventId:o}})).data)==null?void 0:l.attributes}catch{return}},dedupeTime:1e3*60*60*24,refetchInterval:0})},Fk=(e,{web:t,mobile:n})=>{const{client:a}=e.createPromiseClient(of,{method:"generate"});return a.generate({web:t,mobile:n})},zr=(e,t)=>{const n=new URLSearchParams(e);for(const[a,s]of Object.entries(t))n.append(a,s);return n.toString()},Gk=(e,t,n,a)=>{const s=_e({});return Jt(s,()=>Uk(e,[t,n]).subscribe(async({data:r,error:o,loading:c})=>{var T;const l=o?"https://masters.com":r==null?void 0:r.url,m=a.get()||"",u=t.get()||"",d=n.get()||"",y={[Qn]:m,[Qi]:u,[Yi]:d};if(!c&&l){s.setKey("loading",!0);let f=window.location.search,_=window.location.hash;f&&_||_?f=`?${zr(f,y)}`:_=`#${zr("",y)}`;const v=window.location.origin+window.location.pathname+f+_;try{const I=await Fk(e,{web:v,mobile:l});s.set({data:(T=I.data)==null?void 0:T.link,loading:!1})}catch{s.set({loading:!1,error:"Failed to generate short link",data:void 0})}}else s.setKey("loading",!0)})),{$store:s,fetch}};var ae;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(ae||(ae={}));const Bk=(e,t,n,a)=>{const{inplayGame:s}=e.featureSettings.get(),r=t.getCurrentSessionId({prefix:"onboarding"});s&&n.add({type:ze.ONBOARDING,id:r,action:e.openFeature,persistent:!0,autoHideDuration:1e6,data:{questionId:"onboarding",questionType:F.UNSET,onboarding:{...s,instantOpen:!a.getOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})}}})},mn=(e,t,n,a,s,r)=>{var o,c,l;try{const m=t.userId.get();if(!m)return;if(s.getOnboardingStatus({userId:m,organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})===ae.Completed){e.set(ae.Completed);for(const f of r)f();return}const u=(o=t.moderation.getStore().value)==null?void 0:o.data,d=n.featureSettings.get().inplayGame;if(u===void 0||d===void 0)return;const y=(c=u==null?void 0:u.options)==null?void 0:c.onboardingEnabled,T=(l=d==null?void 0:d.titleCard)==null?void 0:l.optIn;y?T?e.set(ae.Required):e.set(ae.Optional):(T?e.set(ae.Unavailable):e.set(ae.Disabled),a.close(t.getCurrentSessionId({prefix:"onboarding"}),{markAsViewed:!1}))}catch(m){console.error(m)}},Vk=(e,t,n,a)=>{let s=!1;const r=new Hi,o=se(ae.Unset);o.subscribe(l=>{l!==ae.Unset&&((l===ae.Optional||l===ae.Required)&&s===!1&&(Bk(e,t,a,r),s=!0),l===ae.Completed&&t.activeQuestionId.invalidate(),r.setOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""}))});const c=[];return mn(o,t,e,a,r,c),o.get()!==ae.Completed&&(c.push(t.userId.listen(l=>{l&&mn(o,t,e,a,r,c)})),c.push(t.moderation.listen(l=>{l.data&&mn(o,t,e,a,r,c)})),c.push(e.featureSettings.listen(l=>{l&&mn(o,t,e,a,r,c)}))),{$store:o,submitInplay:async()=>{const l=t.slStreamId.get();if(l){await Ek(n,l),o.set(ae.Completed),r.saveOnboardingStatus({organizationId:t.organizationId.get()||"",userId:t.userId.get()||"",eventId:l},ae.Completed),Le.emit("poll",{action:"onboardingPassed",payload:{}}),e.openFeature();const m=t.getCurrentSessionId({prefix:"onboarding"});a.close(m)}}}},xk=(e,t,n,a)=>{const s=_e(void 0),r=qi(a),o=async()=>{var T,f;const l=e.get(),m=t.get(),u=(T=n.getStore().get().data)==null?void 0:T.map(_=>_.slId);if(!u)return;const d={eventId:l,userId:m,usersIds:[...u,m]},y=await r(d);s.set((f=y.data)==null?void 0:f.attributes)},c=()=>{o()};return Jt(s,()=>{const l=e.listen(o),m=n.listen(o),u=t.listen(o);return()=>{l(),m(),u()}}),{$store:s,invalidate:c}},qk=async(e,t,n,a,s)=>{var u,d,y;const r=qi(s),o=e.get(),c=t.get(),l=((u=n.getStore().get().data)==null?void 0:u.map(T=>T.slId))||[],m={eventId:o,userId:a,usersIds:[...l,c]};return(y=(d=(await r(m)).data)==null?void 0:d.attributes)==null?void 0:y.summary},Hk=new Set([F.POLL,F.PREDICTION,F.TRIVIA]);class Qk extends Vi{constructor(n,a,s){super(n,a);p(this,"userSummary");p(this,"feedList");p(this,"friends");p(this,"leaderboardId");p(this,"leaderboardList");p(this,"deepLink");p(this,"onboardingStatus");p(this,"openedQuestion");p(this,"currentUserId");p(this,"openedUser");p(this,"closeFeature");p(this,"openFeature");p(this,"feedSubscription");p(this,"activeQuestionId");p(this,"openedQuestionId");p(this,"advertisement");p(this,"notifications");p(this,"transport");p(this,"background");p(this,"storage");p(this,"submitAnswerTimeout");p(this,"cancels",new Set);p(this,"checkInteractiveFlag",()=>{var c,l,m,u,d;const n=this.onboardingStatus.$store.get(),a=(m=(l=(c=this.background.moderation.getStore().value)==null?void 0:c.data)==null?void 0:l.options)==null?void 0:m.onboardingEnabled,s=(d=(u=this.settings.getValues().inplayGame)==null?void 0:u.titleCard)==null?void 0:d.optIn,r=n===ae.Completed,o=!a||r||s!==!0;this.background.interactiveAllowed.set(o?dt.ALLOWED:dt.DISALLOWED)});p(this,"connect",()=>{this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close",async n=>{var m,u,d,y,T,f,_,v,I,E,R;if(!this.isInteractiveAllowed)return;const a=(u=(m=n.data)==null?void 0:m.attributes)==null?void 0:u.question,s=(y=(d=n.data)==null?void 0:d.attributes)==null?void 0:y.feedItem;if(!a||!(s!=null&&s.attributes))return;const{status:r,type:o,id:c,answers:l}=a;if(r===le.RESOLVED&&o===F.PREDICTION){const O=this.background.getCurrentSessionId({prefix:`notification-id:${c}`}),N=[...this.feedList.getValues().data||[]],L=N.findIndex(J=>J.id===c),A=N[L];let C=(_=(f=(T=A==null?void 0:A.attributes)==null?void 0:T.attributes)==null?void 0:f.value)==null?void 0:_.answerId;const H=Ha(c,this.transport),te=H.subscribe(()=>{});await H.get().promise;const j=H.get().data;te(),window.requestAnimationFrame(()=>{H.invalidate()}),C||(C=(v=j==null?void 0:j.answers.find(({youVoted:J})=>J))==null?void 0:v.id);const K=l.find(({correct:J})=>J),x=C?l.find(({id:J})=>J===C):void 0,G=!!(x!=null&&x.correct);if(A&&((E=(I=N[L])==null?void 0:I.attributes)==null?void 0:E.attributes.case)==="question"){try{N[L].attributes.attributes.value.answerId=C,N[L].attributes.attributes.value.openForVoting=!1,C&&(N[L].attributes.attributes.value.status=G?Et.WON:Et.LOST)}catch{}this.feedList.getStore().mutate(N)}if(!x||!K)return;((R=this.openedQuestionId.get())==null?void 0:R.questionId)!==a.id&&this.notifications.add({type:ze.QUESTION_RESOLVED,action:()=>this.openQuestion(a.id,s),close:()=>this.closeQuestion(c),autoHideDuration:G?15e3:12e3,id:O,emitEvent:!1,data:{questionId:c,questionType:F.PREDICTION,question:{title:G?`Congratulations! You answered correctly! You won ${K.points} pts!`:`Better luck next time! Correct: ${K==null?void 0:K.text}!`,votedAnswer:{title:x==null?void 0:x.text,points:x==null?void 0:x.points},correctAnswerTitle:K==null?void 0:K.text,correct:!!G,predictionResult:r===le.RESOLVED,questionTitle:a==null?void 0:a.subject}}}),this.userSummary.invalidate()}})),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list",n=>{var o,c,l,m,u;const a=[...((o=this.feedList.getStore().value)==null?void 0:o.data)||[]],s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.feedItem,r=a.findIndex(d=>d.id===(s==null?void 0:s.id));if(s!=null&&s.attributes&&s.attributes.attributes.case!=="promotion"&&!(s.attributes.status!==le.ACTIVE&&s.attributes.status!==le.RESOLVED)){if(r!==-1)if(s.attributes.attributes.case==="question"&&((m=a[r].attributes)==null?void 0:m.attributes.case)==="question"){const d=a[r];d.attributes&&(a[r]={...a[r],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value,answerId:d.attributes.attributes.value.answerId,status:d.attributes.attributes.value.status,openForVoting:d.attributes.attributes.value.openForVoting}}}})}else{const d=a[r];d.attributes&&s.attributes&&(a[r]={...a[r],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value}}}})}r===-1&&(a.unshift(s),console.log("feedItem",s),Le.emit("poll",{action:"received",payload:{questionId:s.id,questionType:(u=s.attributes)==null?void 0:u.type}})),this.feedList.getStore().mutate(a)}}))});p(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-prediction-close"),this.background.feedSubscription.removeListener("feed-subscription-questions-list")});p(this,"submitAnswer",async(n,a)=>{const s=Ha(n,this.transport),r=s.subscribe(()=>{}),o={...s.get().data||{}},c=()=>{var y;const l=this.feedList.getValues().data;if(!l)return;const m=l.findIndex(T=>T.id===n),u=l[m],d=((y=u==null?void 0:u.attributes)==null?void 0:y.attributes.case)==="question"&&u.attributes.attributes.value;if(d){Le.emit("poll",{action:"voted",payload:{questionId:n,questionType:d.questionType}});const T=s.get().data;if(r(),T){const f=T.answers.find(E=>E.correct===!0),_=T.answers.findIndex(E=>E.id===a),v=T.answers[_],I=T.answers.every(({percentageDecimal:E},R)=>E===(o==null?void 0:o.answers[R].percentageDecimal));l[m].attributes.attributes.value.answerId=a,l[m].attributes.attributes.value.openForVoting=!1,l[m].attributes.attributes.value.text=(v==null?void 0:v.text)||"",f&&(l[m].attributes.attributes.value.status=f.id===a?Et.WON:Et.LOST),this.feedList.getStore().mutate([...l]),T.answers[_].correct=(f==null?void 0:f.id)===a,T.answers[_].youVoted=!0,I&&T.answers.forEach(E=>{E.percentageDecimal=0}),(f==null?void 0:f.id)===a&&(T.answers[_].pointsEarned=T.status===le.RESOLVED?0:f.points),s.mutate({...T})}this.submitAnswerTimeout&&clearTimeout(this.submitAnswerTimeout),this.submitAnswerTimeout=setTimeout(()=>{this.userSummary.invalidate()},1e3)}};try{await _k(this.transport,{questionId:n,answerId:a}),c()}catch(l){if(l.message===Kt.ALREADY_VOTED){this.userSummary.invalidate();const m=s.subscribe(()=>{});s.invalidate(),m()}throw l}});p(this,"openQuestion",(n,a)=>{var r,o,c,l;if(!n)return()=>{};this.notifications.close(this.background.getCurrentSessionId({prefix:"notification",entity:n}),{animateHiding:!1});let s=(r=a==null?void 0:a.attributes)==null?void 0:r.type;return s||(s=(l=(c=(((o=this.feedList.getStore().value)==null?void 0:o.data)||[]).find(m=>m.id===n))==null?void 0:c.attributes)==null?void 0:l.type),Le.emit("poll",{action:"opened",payload:{questionId:n,questionType:s,questionOpenedFrom:a==null?void 0:a.openedFrom}}),this.background.openQuestion(n,a)});p(this,"closeQuestion",n=>this.background.closeQuestion(n));p(this,"openUser",async n=>{var r,o;const a=(r=this.leaderboardList.$store.get().data)==null?void 0:r.find(c=>c.userId===n);if(!a){this.openedUser.set(a);return}if(a.summaryLoaded){this.openedUser.set(a);return}const s={...a};try{const c=await qk(this.background.slStreamId,this.background.userId,this.friends,n,this.transport);(c==null?void 0:c.inTop)!==void 0&&(this.leaderboardList.$store.setKey("data",(o=this.leaderboardList.$store.get().data)==null?void 0:o.map(l=>(l.userId===n&&(l.inTop=c.inTop),l))),s.inTop=c.inTop)}catch(c){console.error(c)}this.openedUser.set(s)});p(this,"closeUser",()=>{this.openedUser.set(void 0)});p(this,"showInApp",n=>{var s,r,o,c,l,m,u,d,y,T,f,_,v,I;const a=this.onboardingStatus.$store.get();if(n&&n.data&&a&&a!==ae.Unset&&((s=n.data.question)==null?void 0:s.id)!==void 0&&n.data.question.notification!==void 0&&((o=(r=n.data.question)==null?void 0:r.bypassNotifications)==null?void 0:o.inAppSilence)!==Ko.ON&&n.data.question.status===le.ACTIVE&&!n.data.question.marketClosed){if(Hk.has(n.data.question.type))this.isInteractiveAllowed&&this.notifications.add({type:ze.QUESTION,action:()=>{var E,R,O;return this.openQuestion((R=(E=n.data)==null?void 0:E.question)==null?void 0:R.id,(O=n.data)==null?void 0:O.feedItem)},close:()=>{var E,R;return this.closeQuestion((R=(E=n.data)==null?void 0:E.question)==null?void 0:R.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),emitEvent:!0,data:{questionId:n.data.question.id,questionType:n.data.question.type,question:{title:n.data.question.notification.title}}});else if(n.data.question.type===F.FACTOID){const E=(c=n.data.question.options)==null?void 0:c.options.value,R={heading:n.data.question.notification.title,body:n.data.question.notification.body,imageMode:E==null?void 0:E.imageMode,image:E==null?void 0:E.image,video:{id:((l=E==null?void 0:E.video)==null?void 0:l.id)||"",url:((m=E==null?void 0:E.video)==null?void 0:m.url)||"",thumbnailUrl:((u=E==null?void 0:E.video)==null?void 0:u.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:ze.QUESTION,action:()=>{var O,N,L;return this.openQuestion((N=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:N.id,(L=n==null?void 0:n.data)==null?void 0:L.feedItem)},close:()=>{var O,N;return this.closeQuestion((N=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:N.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,insight:R}})}else if(n.data.question.type===F.TWEET){const E=(d=n.data.question.options)==null?void 0:d.options.value,R={title:(y=n.data.question.notification)==null?void 0:y.title,body:(T=n.data.question.notification)==null?void 0:T.body,image:(f=n.data.question.notification)==null?void 0:f.image,account:((_=E==null?void 0:E.tweetMeta)==null?void 0:_.account)||"",accountVerified:!!((v=E==null?void 0:E.tweetMeta)!=null&&v.accountVerified),tweet:(I=E==null?void 0:E.tweetMeta)==null?void 0:I.tweet,tweetId:n.data.question.id};this.notifications.add({type:ze.QUESTION,action:()=>{var O,N,L;return this.openQuestion((N=(O=n.data)==null?void 0:O.question)==null?void 0:N.id,(L=n.data)==null?void 0:L.feedItem)},close:()=>{var O,N;return this.closeQuestion((N=(O=n.data)==null?void 0:O.question)==null?void 0:N.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,tweet:R}})}}});this.background=new gk(s),this.advertisement=this.background.advertisement,this.feedSubscription=this.background.feedSubscription,this.activeQuestionId=this.background.activeQuestionId,this.openedQuestionId=this.background.openedQuestionId,this.storage=new Hi,this.feedList=this.background.feedList,this.friends=new He(rk(this.background.userId,s.transport),"gamification:friends"),this.currentUserId=this.background.userId,this.openedUser=se(void 0),this.leaderboardId=new he(se(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=Vk(this,this.background,s.transport,s.notifications),this.notifications=s.notifications,this.transport=s.transport,this.closeFeature=()=>s.sdk.closeFeature(!0),this.openFeature=()=>s.sdk.openFeature(q.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=Gk(this.transport,this.background.slStreamId,s.stores.providerStreamId.getStore(),this.background.userId),this.userSummary=xk(this.background.slStreamId,this.background.userId,this.friends,this.transport),this.leaderboardList=Nk(this.transport,this.background.slStreamId,this.background.userId,this.friends),this.connect(),this.cancels.add(this.userSummary.$store.listen((r,o)=>{o!=null&&o.summary&&(r!=null&&r.summary)&&this.leaderboardList.invalidate()})),this.cancels.add(this.background.activeQuestionId.listen(this.showInApp)),this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)),this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)),this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)),s.sdk.onMount({name:"gamification",clear:!0},()=>()=>{for(const r of this.cancels)r(),this.cancels.delete(r)})}get isInteractiveAllowed(){return this.background.interactiveAllowed.get()===dt.ALLOWED}}const Yk={[q.GAMES]:!0};class jk extends Vi{constructor(t,n){super(t,n)}}const $k=(e,t,n)=>e.type===q.GAMES?new Qk(e,t,n):new jk(e,t),Wk=(e,t,n)=>{e.features=new Map,e.sdk.featuresList=new he(se(new Set),"features-list"),e.activeFeature=new he(se(q.UNSET),"activeFeature"),e.sdk.getFeatures=()=>e.features,e.sdk.getFeature=a=>e.features.get(a),e.sdk.getActiveFeature=()=>e.activeFeature.getStore(),e.sdk.openFeature=a=>{e.activeFeature.setValue(a)},e.sdk.closeFeature=(a=!1)=>{const s=e.activeFeature.getValue();if(e.activeFeature.setValue(q.UNSET),a&&s){e.features.delete(s);const r=e.sdk.featuresList.getValue();r&&r.delete(s),e.sdk.featuresList.setValue(r)}},e.initFeature=(a,s=Ue.ORGANIZATION)=>{if(a.type in Yk&&!e.features.has(a.type)){const r=$k(a,s,e);e.features.set(a.type,r);let o=e.sdk.featuresList.getValue();o?o.add(a.type):o=new Set([a.type]),e.sdk.featuresList.setValue(new Set(o))}},e.updateFeature=(a,s)=>{var r;(r=e.features.get(a.type))==null||r.update(a,s)},e.destroyFeature=a=>{e.features.delete(a.type);const s=e.sdk.featuresList.getValue();s&&s.delete(a.type),e.sdk.featuresList.setValue(new Set(s))},e.reinitializeFeatures=async()=>{const a=await e.stores.organizationSettings.getValue();e.features.clear(),e.sdk.featuresList.setValue(new Set);for(const s of(a==null?void 0:a.overlays)||[])e.initFeature(s,Ue.ORGANIZATION)},e.stores.providerStreamId.listen(a=>{a||e.reinitializeFeatures()}),e.storeSubscribe=()=>{const a=(r,o)=>{var c;if(o!=null&&o.overlays&&!((c=e.contextConfig)!=null&&c.skipOrganizationSettings&&r===Ue.ORGANIZATION))for(const l of o.overlays)l.sdkEnable===!0&&(e.features.has(l.type)?e.updateFeature(l,r):e.initFeature(l,r))},s={organizationSettings:r=>{if(r.data)try{a(Ue.ORGANIZATION,r.data)}catch(o){console.log(o)}},streamSettings:r=>{if(r.data)try{a(Ue.STREAM,r.data)}catch(o){console.log(o)}}};e.store.subscribe(s)},n()};class Kk{constructor(t){p(this,"analytics");p(this,"accepted",()=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:fe.INVITATION_ACCEPTED},category:Ma.GAMES,from:An.UNSET})});p(this,"sent",({from:t})=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:fe.INVITATION_SENT},category:Ma.GAMES,from:t||An.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="invitation")switch(a.slEventBus.action){case"sent":this.sent(a.slEventBus.payload);break}};return Le.listen(n)})}}class zk{constructor(t){p(this,"analytics");p(this,"tap",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:fe.INTERACTIONS},actionType:Ga.TAP})});p(this,"scroll",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:fe.INTERACTIONS},actionType:Ga.SCROLL})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="interactions")switch(a.slEventBus.action){case"tap":this.tap();break;case"scroll":this.scroll();break}};return Le.listen(n)})}}const Qt={[F.UNSET]:pe.UNSET,[F.FACTOID]:pe.POLLS_INSIGHT,[F.POLL]:pe.POLLS_POLL,[F.PREDICTION]:pe.POLLS_PREDICTION,[F.PROMOTION]:pe.POLLS_PROMOTION,[F.TRIVIA]:pe.POLLS_TRIVIA,[F.TWEET]:pe.POLLS_TWITTER};F.UNSET+"",ve.UNSET,F.FACTOID+"",ve.POLLS,F.POLL+"",ve.POLLS,F.PREDICTION+"",ve.POLLS,F.PROMOTION+"",ve.POLLS,F.TRIVIA+"",ve.POLLS,F.TWEET+"",ve.POLLS;const Jk={[q.UNSET]:ie.UNSET,[q.INPLAY]:ie.INPLAY,[q.MESSAGING]:ie.MESSAGING,[q.STATISTICS]:ie.STATS,[q.BETTING]:ie.BETTING,[q.TWITTER]:ie.TWITTER,[q.MERCHANDISE]:ie.MERCHANDISE,[q.CONTESTS]:ie.CONTESTS,[q.VOICE_CHAT]:ie.CALLING,[q.TICKETS]:ie.TICKETS,[q.WHOIS_WATCHING]:ie.WHOISWATCHING,[q.PROFILE]:ie.PROFILE,[q.GAMES]:ie.POLLS,[q.GOLF_STATISTICS]:ie.STATS,[q.HIGHLIGHTS]:ie.HIGHLIGHTS,[q.PUBLIC_CHAT]:ie.PUBLIC_CHAT};class Xk{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:fe.NOTIFICATION_RECEIVED,topicId:t,topicType:n?Qt[n]:pe.UNSET},notificationKind:ve.POLLS,notificationType:Ba.IN_APP})});p(this,"opened",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:fe.NOTIFICATION_OPENED,topicId:t,topicType:n?Qt[n]:pe.UNSET},notificationKind:ve.POLLS,notificationType:Ba.IN_APP})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="notification")switch(a.slEventBus.action){case"rendered":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return Le.listen(n)})}}class Zk{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_RECEIVED,topicId:t,topicType:n?Qt[n]:pe.UNSET},pollOpenedFrom:ot.UNSET})});p(this,"opened",({questionId:t,questionType:n,questionOpenedFrom:a})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_OPENED,topicId:t,topicType:n?Qt[n]:pe.UNSET},pollOpenedFrom:a==="list"?ot.PICK_HISTORY:ot.IN_APP})});p(this,"voted",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_VOTE,topicId:t,topicType:n?Qt[n]:pe.UNSET},pollOpenedFrom:ot.UNSET})});p(this,"onboardingPassed",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.GAMES_JOINED},pollOpenedFrom:ot.UNSET})});p(this,"navigated",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_NAVIGATED},pollOpenedFrom:ot.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="poll")switch(a.slEventBus.action){case"voted":this.voted(a.slEventBus.payload);break;case"navigated":this.navigated();break;case"onboardingPassed":this.onboardingPassed();break;case"received":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return Le.listen(n)})}}const eh=({transport:e,$commonStore:t})=>{let n;const a=se(!1),s=5e3,{client:r,queryKey:o}=e.createPromiseClient(Di,{method:"send",params:[a]}),c=e.nanoquery.createFetcherStore(o,{fetcher:async()=>{const d=t.getStore().get();try{await r.unary({message:{case:"heartbeat",value:{common:{...d,kind:fe.SESSION_HEARTBEAT}}}})}catch(y){Ge.error(y,"send heartbeat failed")}return Date.now()},refetchInterval:s}),l=()=>{Ge.debug("mounted heartbeat"),n=c.subscribe(()=>{})},m=()=>{Ge.debug("enabled heartbeat"),a.set(!0),c.lc===0&&l()},u=()=>{Ge.debug("disabled heartbeat"),a.set(!1)};return{enable:m,disable:u,mount:l,unmount:()=>{Ge.debug("unmounted heartbeat"),c.off(),n==null||n(),n=void 0,u()}}},Ge=Me("analytics");class th{constructor(t){p(this,"commonStore");p(this,"notifications");p(this,"polls");p(this,"invitation");p(this,"interactions");p(this,"heartbeat");p(this,"analyticsClient");p(this,"listeners");p(this,"listenersCancels");p(this,"connected",!1);p(this,"connect",()=>{this.writeCommon("sessionId",Ca()),this.heartbeat.enable(),this.listeners.forEach(t=>this.listenersCancels.add(t())),this.connected=!0,Ge.debug("analytics connected")});p(this,"disconnect",()=>{this.writeCommon("sessionId",""),this.writeCommon("overlaySessionId",""),this.heartbeat.unmount(),this.listenersCancels.forEach(t=>t()),this.connected=!1,Ge.debug("analytics disconnected")});p(this,"write",(t,n)=>{n&&this.analyticsClient.unary({message:{case:t,value:n}}).then(()=>{Ge.trace("send analytics success",t,n)}).catch(a=>{Ge.error(a,"send analytics failed")})});p(this,"writeCommon",(t,n)=>{this.commonStore.setValue(t,n)});p(this,"onConnect",t=>{this.listeners.add(t),this.connected&&this.listenersCancels.add(t())});p(this,"connectToSDK",t=>{this.onConnect(()=>t.stores.slStreamId.getAtomStore().subscribe(n=>{this.writeCommon("eventId",n)})),this.onConnect(()=>t.sdk.getActiveFeature().subscribe(n=>{n&&this.writeCommon("category",Jk[n]),n!==q.UNSET?this.writeCommon("overlaySessionId",Ca()):this.writeCommon("overlaySessionId","")})),this.onConnect(()=>{const n=window.matchMedia("(orientation: portrait)"),a=s=>{this.writeCommon("screenOrientation",s.matches?La.PORTRAIT:La.LANDSCAPE)};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a)}}),this.onConnect(()=>t.deepLink.$store.subscribe(n=>{n!=null&&n.handled&&this.invitation.accepted()}))});this.listeners=new Set,this.listenersCancels=new Set,this.commonStore=new ut(_e({}),"common-analytics"),this.connectToSDK(t),this.heartbeat=eh({transport:t.analyticsTransport,$commonStore:this.commonStore}),this.notifications=new Xk(this),this.polls=new Zk(this),this.invitation=new Kk(this),this.interactions=new zk(this);const{client:n}=t.analyticsTransport.createPromiseClient(Di,{method:"send"});this.analyticsClient=n}}const nh=(e,t,n)=>{e.analytics=new th(e),e.sdk.onMount({name:"analytics"},()=>(e.analytics.connect(),()=>{e.analytics.disconnect()})),n()};var Ss=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Fa<"u"?Fa:typeof self<"u"?self:{};function ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _s={exports:{}},Es={exports:{}};function sh(e){var t=new e,n=t;function a(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function s(r){n.next=r,n=r}return{get:a,release:s}}var rh=sh,oh=rh;function ji(e,t,n){if(typeof e=="function"&&(n=t,t=e,e=null),!(n>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var a=oh(ih),s=null,r=null,o=0,c=null,l={push:_,drain:ke,saturated:ke,pause:u,paused:!1,get concurrency(){return n},set concurrency(N){if(!(N>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(n=N,!l.paused)for(;s&&o<n;)o++,I()},running:m,resume:T,idle:f,length:d,getQueue:y,unshift:v,empty:ke,kill:E,killAndDrain:R,error:O};return l;function m(){return o}function u(){l.paused=!0}function d(){for(var N=s,L=0;N;)N=N.next,L++;return L}function y(){for(var N=s,L=[];N;)L.push(N.value),N=N.next;return L}function T(){if(l.paused){if(l.paused=!1,s===null){o++,I();return}for(;s&&o<n;)o++,I()}}function f(){return o===0&&l.length()===0}function _(N,L){var A=a.get();A.context=e,A.release=I,A.value=N,A.callback=L||ke,A.errorHandler=c,o>=n||l.paused?r?(r.next=A,r=A):(s=A,r=A,l.saturated()):(o++,t.call(e,A.value,A.worked))}function v(N,L){var A=a.get();A.context=e,A.release=I,A.value=N,A.callback=L||ke,A.errorHandler=c,o>=n||l.paused?s?(A.next=s,s=A):(s=A,r=A,l.saturated()):(o++,t.call(e,A.value,A.worked))}function I(N){N&&a.release(N);var L=s;L&&o<=n?l.paused?o--:(r===s&&(r=null),s=L.next,L.next=null,t.call(e,L.value,L.worked),r===null&&l.empty()):--o===0&&l.drain()}function E(){s=null,r=null,l.drain=ke}function R(){s=null,r=null,l.drain(),l.drain=ke}function O(N){c=N}}function ke(){}function ih(){this.value=null,this.callback=ke,this.next=null,this.release=ke,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var a=e.callback,s=e.errorHandler,r=e.value;e.value=null,e.callback=ke,e.errorHandler&&s(t,r),a.call(e.context,t,n),e.release(e)}}function ch(e,t,n){typeof e=="function"&&(n=t,t=e,e=null);function a(u,d){t.call(this,u).then(function(y){d(null,y)},d)}var s=ji(e,a,n),r=s.push,o=s.unshift;return s.push=c,s.unshift=l,s.drained=m,s;function c(u){var d=new Promise(function(y,T){r(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(ke),d}function l(u){var d=new Promise(function(y,T){o(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(ke),d}function m(){if(s.idle())return new Promise(function(y){y()});var u=s.drain,d=new Promise(function(y){s.drain=function(){u(),y()}});return d}}Es.exports=ji;Es.exports.promise=ch;var $i=Es.exports,bs={exports:{}},At=typeof Reflect=="object"?Reflect:null,Jr=At&&typeof At.apply=="function"?At.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},kn;At&&typeof At.ownKeys=="function"?kn=At.ownKeys:Object.getOwnPropertySymbols?kn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:kn=function(e){return Object.getOwnPropertyNames(e)};function lh(e){console&&console.warn&&console.warn(e)}var Wi=Number.isNaN||function(e){return e!==e};function Y(){Y.init.call(this)}bs.exports=Y;bs.exports.once=ph;Y.EventEmitter=Y;Y.prototype._events=void 0;Y.prototype._eventsCount=0;Y.prototype._maxListeners=void 0;var Xr=10;function Yn(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Y,"defaultMaxListeners",{enumerable:!0,get:function(){return Xr},set:function(e){if(typeof e!="number"||e<0||Wi(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Xr=e}});Y.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Y.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Wi(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Ki(e){return e._maxListeners===void 0?Y.defaultMaxListeners:e._maxListeners}Y.prototype.getMaxListeners=function(){return Ki(this)};Y.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var a=e==="error",s=this._events;if(s!==void 0)a=a&&s.error===void 0;else if(!a)return!1;if(a){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Jr(c,this,t);else for(var l=c.length,m=ec(c,l),n=0;n<l;++n)Jr(m[n],this,t);return!0};function zi(e,t,n,a){var s,r,o;if(Yn(n),r=e._events,r===void 0?(r=e._events=Object.create(null),e._eventsCount=0):(r.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),r=e._events),o=r[t]),o===void 0)o=r[t]=n,++e._eventsCount;else if(typeof o=="function"?o=r[t]=a?[n,o]:[o,n]:a?o.unshift(n):o.push(n),s=Ki(e),s>0&&o.length>s&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,lh(c)}return e}Y.prototype.addListener=function(e,t){return zi(this,e,t,!1)};Y.prototype.on=Y.prototype.addListener;Y.prototype.prependListener=function(e,t){return zi(this,e,t,!0)};function mh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ji(e,t,n){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=mh.bind(a);return s.listener=n,a.wrapFn=s,s}Y.prototype.once=function(e,t){return Yn(t),this.on(e,Ji(this,e,t)),this};Y.prototype.prependOnceListener=function(e,t){return Yn(t),this.prependListener(e,Ji(this,e,t)),this};Y.prototype.removeListener=function(e,t){var n,a,s,r,o;if(Yn(t),a=this._events,a===void 0)return this;if(n=a[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,r=n.length-1;r>=0;r--)if(n[r]===t||n[r].listener===t){o=n[r].listener,s=r;break}if(s<0)return this;s===0?n.shift():uh(n,s),n.length===1&&(a[e]=n[0]),a.removeListener!==void 0&&this.emit("removeListener",e,o||t)}return this};Y.prototype.off=Y.prototype.removeListener;Y.prototype.removeAllListeners=function(e){var t,n,a;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),r;for(a=0;a<s.length;++a)r=s[a],r!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this};function Xi(e,t,n){var a=e._events;if(a===void 0)return[];var s=a[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?dh(s):ec(s,s.length)}Y.prototype.listeners=function(e){return Xi(this,e,!0)};Y.prototype.rawListeners=function(e){return Xi(this,e,!1)};Y.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Zi.call(e,t)};Y.prototype.listenerCount=Zi;function Zi(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Y.prototype.eventNames=function(){return this._eventsCount>0?kn(this._events):[]};function ec(e,t){for(var n=new Array(t),a=0;a<t;++a)n[a]=e[a];return n}function uh(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function dh(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function ph(e,t){return new Promise(function(n,a){function s(o){e.removeListener(t,r),a(o)}function r(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}tc(e,t,r,{once:!0}),t!=="error"&&Th(e,s,{once:!0})})}function Th(e,t,n){typeof e.on=="function"&&tc(e,"error",t,n)}function tc(e,t,n,a){if(typeof e.on=="function")a.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(r){a.once&&e.removeEventListener(t,s),n(r)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var nc=bs.exports,jn={},ac={},sc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(e,t);if(r.value!==a||r.enumerable!==!0)return!1}return!0},yh=sc,$n=function(){return yh()&&!!Symbol.toStringTag},gh=Error,fh=EvalError,kh=RangeError,hh=ReferenceError,rc=SyntaxError,Wn=TypeError,Sh=URIError,Zr=typeof Symbol<"u"&&Symbol,_h=sc,Eh=function(){return typeof Zr!="function"||typeof Symbol!="function"||typeof Zr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_h()},la={__proto__:null,foo:{}},bh=Object,Ih=function(){return{__proto__:la}.foo===la.foo&&!(la instanceof bh)},Nh="Function.prototype.bind called on incompatible ",vh=Object.prototype.toString,Oh=Math.max,Ah="[object Function]",eo=function(e,t){for(var n=[],a=0;a<e.length;a+=1)n[a]=e[a];for(var s=0;s<t.length;s+=1)n[s+e.length]=t[s];return n},wh=function(e,t){for(var n=[],a=t,s=0;a<e.length;a+=1,s+=1)n[s]=e[a];return n},Rh=function(e,t){for(var n="",a=0;a<e.length;a+=1)n+=e[a],a+1<e.length&&(n+=t);return n},Lh=function(e){var t=this;if(typeof t!="function"||vh.apply(t)!==Ah)throw new TypeError(Nh+t);for(var n=wh(arguments,1),a,s=function(){if(this instanceof a){var m=t.apply(this,eo(n,arguments));return Object(m)===m?m:this}return t.apply(e,eo(n,arguments))},r=Oh(0,t.length-n.length),o=[],c=0;c<r;c++)o[c]="$"+c;if(a=Function("binder","return function ("+Rh(o,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var l=function(){};l.prototype=t.prototype,a.prototype=new l,l.prototype=null}return a},Mh=Lh,Is=Function.prototype.bind||Mh,Ph=Function.prototype.call,Ch=Object.prototype.hasOwnProperty,Dh=Is,Uh=Dh.call(Ph,Ch),U,Fh=gh,Gh=fh,Bh=kh,Vh=hh,Mt=rc,wt=Wn,xh=Sh,oc=Function,ma=function(e){try{return oc('"use strict"; return ('+e+").constructor;")()}catch{}},pt=Object.getOwnPropertyDescriptor;if(pt)try{pt({},"")}catch{pt=null}var ua=function(){throw new wt},qh=pt?function(){try{return arguments.callee,ua}catch{try{return pt(arguments,"callee").get}catch{return ua}}}():ua,ht=Eh(),Hh=Ih(),ne=Object.getPrototypeOf||(Hh?function(e){return e.__proto__}:null),_t={},Qh=typeof Uint8Array>"u"||!ne?U:ne(Uint8Array),Tt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":ht&&ne?ne([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":_t,"%AsyncGenerator%":_t,"%AsyncGeneratorFunction%":_t,"%AsyncIteratorPrototype%":_t,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Fh,"%eval%":eval,"%EvalError%":Gh,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":oc,"%GeneratorFunction%":_t,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ht&&ne?ne(ne([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ht||!ne?U:ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Bh,"%ReferenceError%":Vh,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ht||!ne?U:ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ht&&ne?ne(""[Symbol.iterator]()):U,"%Symbol%":ht?Symbol:U,"%SyntaxError%":Mt,"%ThrowTypeError%":qh,"%TypedArray%":Qh,"%TypeError%":wt,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":xh,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet};if(ne)try{null.error}catch(e){var Yh=ne(ne(e));Tt["%Error.prototype%"]=Yh}var jh=function e(t){var n;if(t==="%AsyncFunction%")n=ma("async function () {}");else if(t==="%GeneratorFunction%")n=ma("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ma("async function* () {}");else if(t==="%AsyncGenerator%"){var a=e("%AsyncGeneratorFunction%");a&&(n=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&ne&&(n=ne(s.prototype))}return Tt[t]=n,n},to={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Zt=Is,Ln=Uh,$h=Zt.call(Function.call,Array.prototype.concat),Wh=Zt.call(Function.apply,Array.prototype.splice),no=Zt.call(Function.call,String.prototype.replace),Mn=Zt.call(Function.call,String.prototype.slice),Kh=Zt.call(Function.call,RegExp.prototype.exec),zh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jh=/\\(\\)?/g,Xh=function(e){var t=Mn(e,0,1),n=Mn(e,-1);if(t==="%"&&n!=="%")throw new Mt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Mt("invalid intrinsic syntax, expected opening `%`");var a=[];return no(e,zh,function(s,r,o,c){a[a.length]=o?no(c,Jh,"$1"):r||s}),a},Zh=function(e,t){var n=e,a;if(Ln(to,n)&&(a=to[n],n="%"+a[0]+"%"),Ln(Tt,n)){var s=Tt[n];if(s===_t&&(s=jh(n)),typeof s>"u"&&!t)throw new wt("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Mt("intrinsic "+e+" does not exist!")},en=function(e,t){if(typeof e!="string"||e.length===0)throw new wt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new wt('"allowMissing" argument must be a boolean');if(Kh(/^%?[^%]*%?$/,e)===null)throw new Mt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Xh(e),a=n.length>0?n[0]:"",s=Zh("%"+a+"%",t),r=s.name,o=s.value,c=!1,l=s.alias;l&&(a=l[0],Wh(n,$h([0,1],l)));for(var m=1,u=!0;m<n.length;m+=1){var d=n[m],y=Mn(d,0,1),T=Mn(d,-1);if((y==='"'||y==="'"||y==="`"||T==='"'||T==="'"||T==="`")&&y!==T)throw new Mt("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(c=!0),a+="."+d,r="%"+a+"%",Ln(Tt,r))o=Tt[r];else if(o!=null){if(!(d in o)){if(!t)throw new wt("base intrinsic for "+e+" exists, but the property is not available.");return}if(pt&&m+1>=n.length){var f=pt(o,d);u=!!f,u&&"get"in f&&!("originalValue"in f.get)?o=f.get:o=o[d]}else u=Ln(o,d),o=o[d];u&&!c&&(Tt[r]=o)}}return o},ic={exports:{}},da,ao;function Ns(){if(ao)return da;ao=1;var e=en,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return da=t,da}var eS=en,hn=eS("%Object.getOwnPropertyDescriptor%",!0);if(hn)try{hn([],"length")}catch{hn=null}var Kn=hn,so=Ns(),tS=rc,St=Wn,ro=Kn,nS=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new St("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new St("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new St("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new St("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new St("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new St("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,c=!!ro&&ro(e,t);if(so)so(e,t,{configurable:r===null&&c?c.configurable:!r,enumerable:a===null&&c?c.enumerable:!a,value:n,writable:s===null&&c?c.writable:!s});else if(o||!a&&!s&&!r)e[t]=n;else throw new tS("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Qa=Ns(),cc=function(){return!!Qa};cc.hasArrayLengthDefineBug=function(){if(!Qa)return null;try{return Qa([],"length",{value:1}).length!==1}catch{return!0}};var aS=cc,sS=en,oo=nS,rS=aS(),io=Kn,co=Wn,oS=sS("%Math.floor%"),iS=function(e,t){if(typeof e!="function")throw new co("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||oS(t)!==t)throw new co("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,s=!0;if("length"in e&&io){var r=io(e,"length");r&&!r.configurable&&(a=!1),r&&!r.writable&&(s=!1)}return(a||s||!n)&&(rS?oo(e,"length",t,!0,!0):oo(e,"length",t)),e};(function(e){var t=Is,n=en,a=iS,s=Wn,r=n("%Function.prototype.apply%"),o=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(o,r),l=Ns(),m=n("%Math.max%");e.exports=function(d){if(typeof d!="function")throw new s("a function is required");var y=c(t,o,arguments);return a(y,1+m(0,d.length-(arguments.length-1)),!0)};var u=function(){return c(t,r,arguments)};l?l(e.exports,"apply",{value:u}):e.exports.apply=u})(ic);var vs=ic.exports,lc=en,mc=vs,cS=mc(lc("String.prototype.indexOf")),Os=function(e,t){var n=lc(e,!!t);return typeof n=="function"&&cS(e,".prototype.")>-1?mc(n):n},lS=$n(),mS=Os,Ya=mS("Object.prototype.toString"),zn=function(e){return lS&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Ya(e)==="[object Arguments]"},uc=function(e){return zn(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Ya(e)!=="[object Array]"&&Ya(e.callee)==="[object Function]"},uS=function(){return zn(arguments)}();zn.isLegacyArguments=uc;var dS=uS?zn:uc,pS=Object.prototype.toString,TS=Function.prototype.toString,yS=/^\s*(?:function)?\*/,dc=$n(),pa=Object.getPrototypeOf,gS=function(){if(!dc)return!1;try{return Function("return function*() {}")()}catch{}},Ta,fS=function(e){if(typeof e!="function")return!1;if(yS.test(TS.call(e)))return!0;if(!dc){var t=pS.call(e);return t==="[object GeneratorFunction]"}if(!pa)return!1;if(typeof Ta>"u"){var n=gS();Ta=n?pa(n):!1}return pa(e)===Ta},pc=Function.prototype.toString,Nt=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ja,Sn;if(typeof Nt=="function"&&typeof Object.defineProperty=="function")try{ja=Object.defineProperty({},"length",{get:function(){throw Sn}}),Sn={},Nt(function(){throw 42},null,ja)}catch(e){e!==Sn&&(Nt=null)}else Nt=null;var kS=/^\s*class\b/,$a=function(e){try{var t=pc.call(e);return kS.test(t)}catch{return!1}},ya=function(e){try{return $a(e)?!1:(pc.call(e),!0)}catch{return!1}},_n=Object.prototype.toString,hS="[object Object]",SS="[object Function]",_S="[object GeneratorFunction]",ES="[object HTMLAllCollection]",bS="[object HTML document.all class]",IS="[object HTMLCollection]",NS=typeof Symbol=="function"&&!!Symbol.toStringTag,vS=!(0 in[,]),Wa=function(){return!1};if(typeof document=="object"){var OS=document.all;_n.call(OS)===_n.call(document.all)&&(Wa=function(e){if((vS||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=_n.call(e);return(t===ES||t===bS||t===IS||t===hS)&&e("")==null}catch{}return!1})}var AS=Nt?function(e){if(Wa(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Nt(e,null,ja)}catch(t){if(t!==Sn)return!1}return!$a(e)&&ya(e)}:function(e){if(Wa(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(NS)return ya(e);if($a(e))return!1;var t=_n.call(e);return t!==SS&&t!==_S&&!/^\[object HTML/.test(t)?!1:ya(e)},wS=AS,RS=Object.prototype.toString,Tc=Object.prototype.hasOwnProperty,LS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)Tc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},MS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)n==null?t(e.charAt(a),a,e):t.call(n,e.charAt(a),a,e)},PS=function(e,t,n){for(var a in e)Tc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},CS=function(e,t,n){if(!wS(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=n),RS.call(e)==="[object Array]"?LS(e,t,a):typeof e=="string"?MS(e,t,a):PS(e,t,a)},yc=CS,DS=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ga=DS,US=typeof globalThis>"u"?Ss:globalThis,gc=function(){for(var e=[],t=0;t<ga.length;t++)typeof US[ga[t]]=="function"&&(e[e.length]=ga[t]);return e},Pn=yc,FS=gc,lo=vs,As=Os,En=Kn,GS=As("Object.prototype.toString"),fc=$n(),mo=typeof globalThis>"u"?Ss:globalThis,Ka=FS(),ws=As("String.prototype.slice"),fa=Object.getPrototypeOf,BS=As("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Cn={__proto__:null};fc&&En&&fa?Pn(Ka,function(e){var t=new mo[e];if(Symbol.toStringTag in t){var n=fa(t),a=En(n,Symbol.toStringTag);if(!a){var s=fa(n);a=En(s,Symbol.toStringTag)}Cn["$"+e]=lo(a.get)}}):Pn(Ka,function(e){var t=new mo[e],n=t.slice||t.set;n&&(Cn["$"+e]=lo(n))});var VS=function(e){var t=!1;return Pn(Cn,function(n,a){if(!t)try{"$"+n(e)===a&&(t=ws(a,1))}catch{}}),t},xS=function(e){var t=!1;return Pn(Cn,function(n,a){if(!t)try{n(e),t=ws(a,1)}catch{}}),t},qS=function(e){if(!e||typeof e!="object")return!1;if(!fc){var t=ws(GS(e),8,-1);return BS(Ka,t)>-1?t:t!=="Object"?!1:xS(e)}return En?VS(e):null},Dn=yc,HS=gc,uo=vs,Rs=Os,bn=Kn,QS=Rs("Object.prototype.toString"),kc=$n(),po=typeof globalThis>"u"?Ss:globalThis,za=HS(),Ls=Rs("String.prototype.slice"),ka=Object.getPrototypeOf,YS=Rs("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Un={__proto__:null};kc&&bn&&ka?Dn(za,function(e){var t=new po[e];if(Symbol.toStringTag in t){var n=ka(t),a=bn(n,Symbol.toStringTag);if(!a){var s=ka(n);a=bn(s,Symbol.toStringTag)}Un["$"+e]=uo(a.get)}}):Dn(za,function(e){var t=new po[e],n=t.slice||t.set;n&&(Un["$"+e]=uo(n))});var jS=function(e){var t=!1;return Dn(Un,function(n,a){if(!t)try{"$"+n(e)===a&&(t=Ls(a,1))}catch{}}),t},$S=function(e){var t=!1;return Dn(Un,function(n,a){if(!t)try{n(e),t=Ls(a,1)}catch{}}),t},WS=function(e){if(!e||typeof e!="object")return!1;if(!kc){var t=Ls(QS(e),8,-1);return YS(za,t)>-1?t:t!=="Object"?!1:$S(e)}return bn?jS(e):null},KS=WS,zS=function(e){return!!KS(e)};(function(e){var t=dS,n=fS,a=qS,s=zS;function r(S){return S.call.bind(S)}var o=typeof BigInt<"u",c=typeof Symbol<"u",l=r(Object.prototype.toString),m=r(Number.prototype.valueOf),u=r(String.prototype.valueOf),d=r(Boolean.prototype.valueOf);if(o)var y=r(BigInt.prototype.valueOf);if(c)var T=r(Symbol.prototype.valueOf);function f(S,Nc){if(typeof S!="object")return!1;try{return Nc(S),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=s;function _(S){return typeof Promise<"u"&&S instanceof Promise||S!==null&&typeof S=="object"&&typeof S.then=="function"&&typeof S.catch=="function"}e.isPromise=_;function v(S){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(S):s(S)||k(S)}e.isArrayBufferView=v;function I(S){return a(S)==="Uint8Array"}e.isUint8Array=I;function E(S){return a(S)==="Uint8ClampedArray"}e.isUint8ClampedArray=E;function R(S){return a(S)==="Uint16Array"}e.isUint16Array=R;function O(S){return a(S)==="Uint32Array"}e.isUint32Array=O;function N(S){return a(S)==="Int8Array"}e.isInt8Array=N;function L(S){return a(S)==="Int16Array"}e.isInt16Array=L;function A(S){return a(S)==="Int32Array"}e.isInt32Array=A;function C(S){return a(S)==="Float32Array"}e.isFloat32Array=C;function H(S){return a(S)==="Float64Array"}e.isFloat64Array=H;function te(S){return a(S)==="BigInt64Array"}e.isBigInt64Array=te;function j(S){return a(S)==="BigUint64Array"}e.isBigUint64Array=j;function K(S){return l(S)==="[object Map]"}K.working=typeof Map<"u"&&K(new Map);function x(S){return typeof Map>"u"?!1:K.working?K(S):S instanceof Map}e.isMap=x;function G(S){return l(S)==="[object Set]"}G.working=typeof Set<"u"&&G(new Set);function J(S){return typeof Set>"u"?!1:G.working?G(S):S instanceof Set}e.isSet=J;function Pe(S){return l(S)==="[object WeakMap]"}Pe.working=typeof WeakMap<"u"&&Pe(new WeakMap);function Ft(S){return typeof WeakMap>"u"?!1:Pe.working?Pe(S):S instanceof WeakMap}e.isWeakMap=Ft;function $e(S){return l(S)==="[object WeakSet]"}$e.working=typeof WeakSet<"u"&&$e(new WeakSet);function Te(S){return $e(S)}e.isWeakSet=Te;function ye(S){return l(S)==="[object ArrayBuffer]"}ye.working=typeof ArrayBuffer<"u"&&ye(new ArrayBuffer);function ge(S){return typeof ArrayBuffer>"u"?!1:ye.working?ye(S):S instanceof ArrayBuffer}e.isArrayBuffer=ge;function g(S){return l(S)==="[object DataView]"}g.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&g(new DataView(new ArrayBuffer(1),0,1));function k(S){return typeof DataView>"u"?!1:g.working?g(S):S instanceof DataView}e.isDataView=k;var b=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function M(S){return l(S)==="[object SharedArrayBuffer]"}function $(S){return typeof b>"u"?!1:(typeof M.working>"u"&&(M.working=M(new b)),M.working?M(S):S instanceof b)}e.isSharedArrayBuffer=$;function B(S){return l(S)==="[object AsyncFunction]"}e.isAsyncFunction=B;function D(S){return l(S)==="[object Map Iterator]"}e.isMapIterator=D;function V(S){return l(S)==="[object Set Iterator]"}e.isSetIterator=V;function Q(S){return l(S)==="[object Generator]"}e.isGeneratorObject=Q;function Ee(S){return l(S)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=Ee;function at(S){return f(S,m)}e.isNumberObject=at;function tn(S){return f(S,u)}e.isStringObject=tn;function ft(S){return f(S,d)}e.isBooleanObject=ft;function nn(S){return o&&f(S,y)}e.isBigIntObject=nn;function Cs(S){return c&&f(S,T)}e.isSymbolObject=Cs;function bc(S){return at(S)||tn(S)||ft(S)||nn(S)||Cs(S)}e.isBoxedPrimitive=bc;function Ic(S){return typeof Uint8Array<"u"&&(ge(S)||$(S))}e.isAnyArrayBuffer=Ic,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(S){Object.defineProperty(e,S,{enumerable:!1,value:function(){throw new Error(S+" is not supported in userland")}})})})(ac);var JS=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},Ja={exports:{}};typeof Object.create=="function"?Ja.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ja.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var XS=Ja.exports;(function(e){var t=Object.getOwnPropertyDescriptors||function(g){for(var k=Object.keys(g),b={},M=0;M<k.length;M++)b[k[M]]=Object.getOwnPropertyDescriptor(g,k[M]);return b},n=/%[sdj%]/g;e.format=function(g){if(!N(g)){for(var k=[],b=0;b<arguments.length;b++)k.push(o(arguments[b]));return k.join(" ")}for(var b=1,M=arguments,$=M.length,B=String(g).replace(n,function(Q){if(Q==="%%")return"%";if(b>=$)return Q;switch(Q){case"%s":return String(M[b++]);case"%d":return Number(M[b++]);case"%j":try{return JSON.stringify(M[b++])}catch{return"[Circular]"}default:return Q}}),D=M[b];b<$;D=M[++b])E(D)||!H(D)?B+=" "+D:B+=" "+o(D);return B},e.deprecate=function(g,k){if(typeof P<"u"&&P.noDeprecation===!0)return g;if(typeof P>"u")return function(){return e.deprecate(g,k).apply(this,arguments)};var b=!1;function M(){if(!b){if(P.throwDeprecation)throw new Error(k);P.traceDeprecation?console.trace(k):console.error(k),b=!0}return g.apply(this,arguments)}return M};var a={},s=/^$/;if(P.env.NODE_DEBUG){var r=P.env.NODE_DEBUG;r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+r+"$","i")}e.debuglog=function(g){if(g=g.toUpperCase(),!a[g])if(s.test(g)){var k=P.pid;a[g]=function(){var b=e.format.apply(e,arguments);console.error("%s %d: %s",g,k,b)}}else a[g]=function(){};return a[g]};function o(g,k){var b={seen:[],stylize:l};return arguments.length>=3&&(b.depth=arguments[2]),arguments.length>=4&&(b.colors=arguments[3]),I(k)?b.showHidden=k:k&&e._extend(b,k),A(b.showHidden)&&(b.showHidden=!1),A(b.depth)&&(b.depth=2),A(b.colors)&&(b.colors=!1),A(b.customInspect)&&(b.customInspect=!0),b.colors&&(b.stylize=c),u(b,g,b.depth)}e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(g,k){var b=o.styles[k];return b?"\x1B["+o.colors[b][0]+"m"+g+"\x1B["+o.colors[b][1]+"m":g}function l(g,k){return g}function m(g){var k={};return g.forEach(function(b,M){k[b]=!0}),k}function u(g,k,b){if(g.customInspect&&k&&K(k.inspect)&&k.inspect!==e.inspect&&!(k.constructor&&k.constructor.prototype===k)){var M=k.inspect(b,g);return N(M)||(M=u(g,M,b)),M}var $=d(g,k);if($)return $;var B=Object.keys(k),D=m(B);if(g.showHidden&&(B=Object.getOwnPropertyNames(k)),j(k)&&(B.indexOf("message")>=0||B.indexOf("description")>=0))return y(k);if(B.length===0){if(K(k)){var V=k.name?": "+k.name:"";return g.stylize("[Function"+V+"]","special")}if(C(k))return g.stylize(RegExp.prototype.toString.call(k),"regexp");if(te(k))return g.stylize(Date.prototype.toString.call(k),"date");if(j(k))return y(k)}var Q="",Ee=!1,at=["{","}"];if(v(k)&&(Ee=!0,at=["[","]"]),K(k)){var tn=k.name?": "+k.name:"";Q=" [Function"+tn+"]"}if(C(k)&&(Q=" "+RegExp.prototype.toString.call(k)),te(k)&&(Q=" "+Date.prototype.toUTCString.call(k)),j(k)&&(Q=" "+y(k)),B.length===0&&(!Ee||k.length==0))return at[0]+Q+at[1];if(b<0)return C(k)?g.stylize(RegExp.prototype.toString.call(k),"regexp"):g.stylize("[Object]","special");g.seen.push(k);var ft;return Ee?ft=T(g,k,b,D,B):ft=B.map(function(nn){return f(g,k,b,D,nn,Ee)}),g.seen.pop(),_(ft,Q,at)}function d(g,k){if(A(k))return g.stylize("undefined","undefined");if(N(k)){var b="'"+JSON.stringify(k).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(b,"string")}if(O(k))return g.stylize(""+k,"number");if(I(k))return g.stylize(""+k,"boolean");if(E(k))return g.stylize("null","null")}function y(g){return"["+Error.prototype.toString.call(g)+"]"}function T(g,k,b,M,$){for(var B=[],D=0,V=k.length;D<V;++D)$e(k,String(D))?B.push(f(g,k,b,M,String(D),!0)):B.push("");return $.forEach(function(Q){Q.match(/^\d+$/)||B.push(f(g,k,b,M,Q,!0))}),B}function f(g,k,b,M,$,B){var D,V,Q;if(Q=Object.getOwnPropertyDescriptor(k,$)||{value:k[$]},Q.get?Q.set?V=g.stylize("[Getter/Setter]","special"):V=g.stylize("[Getter]","special"):Q.set&&(V=g.stylize("[Setter]","special")),$e(M,$)||(D="["+$+"]"),V||(g.seen.indexOf(Q.value)<0?(E(b)?V=u(g,Q.value,null):V=u(g,Q.value,b-1),V.indexOf(`
4
+ `+a)}catch(s){xi(s)&&window.sessionStorage.removeItem("slstreamlogs"),window.sessionStorage.setItem("slstreamlogs",a)}});p(this,"addListener",(t,n)=>this.listeners.has(t)?(this.addStateLog(`listener '${t}' not added, already exists`),()=>{}):(this.listeners.set(t,n),this.addStateLog(`listener '${t}' added`),()=>this.removeListener(t)));p(this,"removeListener",t=>{this.listeners.delete(t),this.addStateLog(`listener '${t}' removed`)});p(this,"connect",()=>{this.updateState(Se.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const t="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const n={headers:this.headers.getValues(),signal:this.streamCancel.signal},a=this.method(t,n);for await(const s of a)this.attempt=0,this.onData(s)}catch(n){n instanceof W&&n.code!=exports.Code.Canceled&&this.onStreamError(n)}})(),this.updateState(Se.Connected)});p(this,"disconnect",()=>{var t;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(t=this.paramsListener)==null||t.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(Se.Disconnected)});p(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(Se.Reconnect);const t=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),n=Math.round(t*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(Se.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${n}ms`),this.connect(),this.reconnectTimeout=void 0},n)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});p(this,"getStore",()=>{var t;return(t=this.store)==null?void 0:t.getStore()});p(this,"onData",t=>{try{this.addStateLog(`received data => ${JSON.stringify(t)}`),this.store&&this.store.setValue(t);for(const[,n]of this.listeners)n(t);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(n){this.addStateLog(`error process data => ${n}`)}});p(this,"onStreamError",t=>{if(this.addStateLog(`error => ${t?JSON.stringify(t):"undefined"}}`),t!==void 0){if(t instanceof W&&t.code!==exports.Code.Canceled){this.updateState(Se.Failed),this.state.setValue("error",t),this.reconnect();return}this.disconnect()}});const r={status:Se.Init,ts:new Date,log:[]};this.state=new ut(_e(r),`subscription:${s.name}:state`),this.options={...s,reconnectDelay:s.reconnectDelay??1e3,reconnectMaxDelay:s.reconnectMaxDelay??3e4,reconnectMaxAttempts:s.reconnectMaxAttempts??10,withStore:s.withStore??!1},this.headers=t,this.listeners=new Map,this.params=a,this.method=n,s.withStore&&(this.store=new he(se(null),`subscription:${s.name}:store`)),"subscribe"in a&&typeof a.subscribe=="function"&&(this.paramsListener=a.subscribe(o=>{this.state.getValue("status")===Se.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(o)}`),this.reconnect())})),this.updateState(Se.Ready)}}const xf=new Set([exports.Code.Unknown,exports.Code.Internal,exports.Code.DeadlineExceeded,exports.Code.ResourceExhausted,exports.Code.FailedPrecondition,exports.Code.Unavailable,exports.Code.DataLoss]),Qr=Me("grpc:retry"),qf=e=>async t=>{const n=t.contextValues.get(qa.retryAttempts),a=300,s=t.contextValues.get(qa.retryDelay);if(t.stream||n===0)return e(t);Qr.trace({url:t.url,attempts:n,maxDelay:s},"retry options");for(let r=0;;r++)try{return await e(t)}catch(o){Qr.trace({attempt:r,error:o},"retry attempt");const c=W.from(o);if(r>=n||!(c instanceof W)||!xf.has(c.code))throw o;const l=Math.min(s,Math.pow(2,r)*a),m=Math.round(l*(1+Math.random())/2);await new Promise(u=>setTimeout(u,m))}},qa={retryAttempts:Ua(10,{description:"Number of attempts to retry"}),retryDelay:Ua(3e4,{description:"Max delay between retries in milliseconds"})},Hf=()=>{const e=localStorage.getItem("sl-device-id");if(e)return e;const t=Ca();return localStorage.setItem("sl-device-id",t),t},Qf=()=>{var e;return((e=navigator.userAgentData)==null?void 0:e.platform)||navigator.platform};class Yr{constructor(t,n){p(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});p(this,"transport");p(this,"streamTransport");p(this,"nanoquery");p(this,"host");p(this,"$headers");p(this,"interceptors",[]);p(this,"clients");p(this,"streamClients");p(this,"subscriptions");p(this,"opts");p(this,"addSubscription",(t,n,a)=>{const s=this.subscriptions.get(n);if(s)return s;const r=new Vf(this.$headers,t,n,a);return this.subscriptions.set(n,r),r});p(this,"removeSubscription",t=>{t.disconnect(),this.subscriptions.delete(t.params)});p(this,"disconnect",()=>{var s,r;for(const[o,c]of this.subscriptions)c.disconnect(),this.subscriptions.delete(o);this.clients.clear(),this.streamClients.clear(),this.subscriptions.clear();const[t,n,a]=kr({dedupeTime:(s=this.opts)==null?void 0:s.dedupeTime,refetchInterval:(r=this.opts)==null?void 0:r.refetchInterval});this.nanoquery={createFetcherStore:t,createMutatorStore:n,utils:a}});p(this,"registerInterceptor",t=>{this.interceptors.push(t)});p(this,"removeInterceptor",t=>{this.interceptors=this.interceptors.filter(n=>n!==t)});p(this,"getClient",t=>{const n=t.typeName;if(this.clients.has(n))return this.clients.get(n);const a=cr(t,this.transport);return this.clients.set(n,a),a});p(this,"getStreamClient",t=>{const n=`stream-${t.typeName}`;if(this.clients.has(n))return this.clients.get(n);const a=cr(t,this.streamTransport);return this.clients.set(n,a),a});p(this,"createPromiseClient",(t,{params:n=[],method:a})=>{const s=this.getClient(t),r=t.methods[a].name,o=[t.typeName,r.charAt(0).toLowerCase()+r.slice(1),...Array.isArray(n)?n:[n]],c=[t.typeName,r.charAt(0).toLowerCase()+r.slice(1)];return{client:s,createRequestOptions:l=>{const m=Da();for(const u in l){const d=qa[u];m.set(d,l[u])}return m},queryKey:o,queryKeyStr:c.join("")}});p(this,"createStreamClient",t=>({client:this.getStreamClient(t)}));p(this,"setSdkKey",t=>{this.$headers.setValue("sdk",t)});p(this,"setAuth",(t,n)=>{this.$headers.setValue("authorization",t),this.$headers.setValue("sl-user-id",n)});p(this,"setHeader",(t,n)=>this.$headers.setValue(t,n));p(this,"getHeader",t=>this.$headers.getValue(t));p(this,"getHeaders",()=>this.$headers.getValues());p(this,"initInterceptors",()=>{var n;if(this.interceptors.length!==0)return;const t=a=>s=>{const r=this.$headers.getValues();for(const o in r)s.header.set(o,r[o]);return a(s)};this.interceptors.push(t),this.interceptors.push(Bf()),(n=this.opts)!=null&&n.retryable&&this.interceptors.push(qf)});this.host=t,this.opts=n,this.$headers=new ut(_e({"sl-device-id":Hf(),"sl-device-os":Qf()}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.streamClients=new Map,this.subscriptions=new Map;const[a,s,r]=kr({dedupeTime:n==null?void 0:n.dedupeTime,refetchInterval:n==null?void 0:n.refetchInterval});this.nanoquery={createFetcherStore:a,createMutatorStore:s,utils:r},this.transport=fr({baseUrl:t,defaultTimeoutMs:1e4,interceptors:this.interceptors}),this.streamTransport=fr({baseUrl:t,interceptors:this.interceptors})}}const Yf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Iy,{method:"retrieveEventId",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;if(!o||typeof o!="string")return"";try{return((c=(await n.retrieveEventId({id:o})).data)==null?void 0:c.id)||""}catch{return""}}})},jf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"getStream",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;return o?(c=(await n.getStream({id:o})).data)==null?void 0:c.attributes:void 0}})},$f=(e,t)=>{const{queryKey:n,client:a}=t.createPromiseClient(ks,{method:"me",params:[e]});return t.nanoquery.createFetcherStore(n,{fetcher:async()=>{const{data:s}=await a.me({});return{data:s}}})},Wf=e=>{const{client:t,createRequestOptions:n}=e.createPromiseClient(ks,{method:"bypassAuth"}),a=n({retryAttempts:0});return({userKey:s,schema:r,init:o,inviterKey:c})=>t.bypassAuth({userKey:s,schema:r,init:o,inviterKey:c},{contextValues:a})},Kf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.get({})).data)==null?void 0:s.attributes}})},zf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"getOrganization",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{const s=await n.getOrganization({});return s.data?{...s.data.attributes,id:s.data.id}:void 0}})},Jf=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Xt,{method:"getOrganizationAdvertising",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.getOrganizationAdvertising({})).data)==null?void 0:s.attributes}})},Xf=(e,t,n)=>{e.transport=new Yr(t.host,{dedupeTime:1e3*60*5,refetchInterval:1e3*60*5,retryable:!0}),e.analyticsTransport=new Yr(t.analyticsHost),e.sdk.host=e.transport.host,e.transport.setSdkKey(t.sdkKey),e.transport.setHeader("sl-sdk-version",t.version||"-"),e.transport.$headers.subscribe(a=>{e.analyticsTransport.$headers.getStore().set(a)}),e.sdk.onMount({name:"transport"},()=>()=>{e.transport.disconnect(),e.analyticsTransport.disconnect()}),n()};var Ce;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(Ce||(Ce={}));class bt extends Dt{constructor(){super("user");p(this,"setSchema",n=>{this.write(Ce.SCHEMA,n)});p(this,"getSchema",()=>this.read(Ce.SCHEMA));p(this,"setToken",n=>{this.write(Ce.TOKEN,n)});p(this,"getToken",()=>this.read(Ce.TOKEN));p(this,"setExternalToken",n=>{this.write(Ce.EXTERNAL_TOKEN,n)});p(this,"getExternalToken",()=>this.read(Ce.EXTERNAL_TOKEN));p(this,"removeToken",()=>{this.remove(Ce.TOKEN)})}}var Fe;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(Fe||(Fe={}));const Zf=e=>{const t=new bt,n=new he(se(t.getExternalToken()),"userKey"),a=new he(se(t.getToken()),"userToken"),s=new He($f(a.getStore(),e),"user",({data:o,error:c,loading:l},m)=>{var u;if(!c)return(u=o==null?void 0:o.data)!=null&&u.id?o.data.id:l===!1?void 0:m}),r=new He(Kf(a.getStore(),e),"userSettings");return{userKey:n,userToken:a,user:s,userSettings:r}},ek=e=>{const t=new he(se(void 0),"providerStreamId"),n=new He(Yf(t.getStore(),e),"slStreamId",s=>s==null?void 0:s.data),a=new He(jf(n.getAtomStore(),e),"streamSettings");return n.getAtomStore().listen(s=>{(s===""||s===void 0)&&a.getStore().mutate(void 0)}),{providerStreamId:t,slStreamId:n,streamSettings:a}},tk=e=>{const t=new he(se(void 0),"enabled"),n=new he(se(Fe.DISABLED),"status"),a=new He(zf(t.getStore(),e),"organizationSettings",c=>{var l;return(l=c==null?void 0:c.data)==null?void 0:l.id}),s=new He(Jf(a.getAtomStore(),e),"organizationAdvertising"),r=Zf(e),o=ek(e);return{enabled:t,status:n,providerStreamId:o.providerStreamId,slStreamId:o.slStreamId,streamSettings:o.streamSettings,user:r.user,userKey:r.userKey,userToken:r.userToken,userSettings:r.userSettings,organizationSettings:a,organizationAdvertising:s}};class nk extends Hn{constructor(n){const a=tk(n),s=Df(a);super(s,"core");p(this,"stores");p(this,"subscribe",n=>{let a;for(a in this.stores){const s=n[a];a in n&&s!==void 0&&this.stores[a].subscribe(n[a])}});p(this,"unsubscribe",()=>this.getStore().off());this.stores=a}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}const ak=(e,t,n)=>{e.store=new nk(e.transport),e.stores=e.store.getValues(),e.sdk.enabled=e.stores.enabled.getStore(),e.sdk.status=e.stores.status.getStore(),e.sdk.sdkStore=Object.fromEntries(Object.entries(e.stores).map(([a,s])=>[a,s.getStore()])),e.sdk.organizationStore=()=>e.stores.organizationSettings.getStore(),e.sdk.streamStore=()=>e.stores.streamSettings.getStore(),e.storeUnsubscribe=()=>{e.store.unsubscribe()},n()},sk=e=>{const{client:t}=e.createPromiseClient(Ci,{method:"list"});return n=>t.list(n)},qi=e=>{const{client:t}=e.createPromiseClient(Ci,{method:"summary"});return n=>t.summary(n)},rk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(ks,{method:"getFriends",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>o?(await n.getFriends({})).data:[]})},ok=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ye,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;return(c=(await n.get({eventId:o})).data)==null?void 0:c.attributes},refetchInterval:0,dedupeTime:1e3*60*60})},ik=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ye,{method:"syncQuestion",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c;return o?(c=(await n.syncQuestion({filter:{eventId:o}})).data)==null?void 0:c.attributes:void 0},dedupeTime:1e3*60*10,refetchInterval:0})},ck=(e,t)=>{console.log("feedSubscription",e);const{client:n}=t.createStreamClient(Ye),a=Ze({eventId:e.get()||"",feedId:""});return e.subscribe((s="")=>{a.set({eventId:s,feedId:""})}),t.addSubscription(n.subscription,a,{name:"feedSubscription"})},lk=(e,t)=>{const{client:n}=t.createStreamClient(Ye);return t.addSubscription(n.questionSubscription,{questionId:e},{name:"questionSubscription"})},Ha=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ye,{method:"questionByUser",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o)=>{var c,l;return(l=(c=(await n.questionByUser({questionId:o})).data)==null?void 0:c.attributes)==null?void 0:l.question},dedupeTime:1e3*60*5})},mk=async(e,t)=>{var s,r,o,c,l,m;if(!e)return;const{client:n}=t.createPromiseClient(Ye,{method:"getQuestion",params:[e]}),a=await n.getQuestion({id:e});return((o=(r=(s=a.data)==null?void 0:s.attributes)==null?void 0:r.options)==null?void 0:o.options.case)==="promotion"?(m=(l=(c=a.data)==null?void 0:c.attributes)==null?void 0:l.options)==null?void 0:m.options.value:void 0},uk=(e,t,n)=>{const{client:a,queryKey:s}=n.createPromiseClient(Ye,{method:"list",params:[e,t]});return n.nanoquery.createFetcherStore(s,{fetcher:async(r,o,c,l)=>c?(await a.list({eventId:c,filter:{types:l===dt.ALLOWED?[]:[F.FACTOID,F.PROMOTION,F.TWEET],statuses:[le.ACTIVE,le.RESOLVED]}})).data:[],dedupeTime:0,refetchInterval:0})},dk=(e,t,n)=>{const a=sr([t,n],()=>{var m,u;const o=t.get();if(!o)return;const c=(m=n.get().data)==null?void 0:m.find(d=>d.id===(o==null?void 0:o.questionId)),l=(u=o==null?void 0:o.question)==null?void 0:u.openedFrom;return c?(c.openedFrom=l,c):o.question}),s=sr(a,o=>o&&o.type==="question"?o.id:void 0),r=Ha(s,e);return{$store:a,$extendedStore:r,updateExtendedQuestion:o=>{const c=r.get().data,l=(m,u)=>{if(!m||!u)return m||u||[];const d=[];for(let y=0;y<m.length;y++)d.push({...m[y],...u[y],correct:m[y].correct,youVoted:m[y].youVoted,pointsEarned:m[y].pointsEarned});return d};r.mutate({...o,options:c==null?void 0:c.options,subject:c==null?void 0:c.subject,appearance:c==null?void 0:c.appearance,answers:l(c==null?void 0:c.answers,o==null?void 0:o.answers)})}}};var wn;(function(e){e.SHOWED="showed"})(wn||(wn={}));class pk extends Dt{constructor(){super("advertisement");p(this,"setShowed",n=>{this.write(wn.SHOWED,n,"true")});p(this,"isShowed",n=>this.read(wn.SHOWED,n))}}class Tk{constructor(t){p(this,"advertisementList");p(this,"store");p(this,"timeouts");p(this,"waitingQueue");p(this,"activeQueue");p(this,"options");p(this,"logger");p(this,"addToQueue",t=>{if(this.store.has(t.id)){this.logger.debug({advertisement:t},"skip existed advertisement: %o");return}const n=t.close,a=t.action;if(this.store.set(t.id,{...t,close:(...s)=>{n&&n(...s),this.closeAdvertisement(t.id)},action:(...s)=>{a&&a(...s),this.closeAdvertisement(t.id,{animateHiding:!1})}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[s]=this.activeQueue;this.closeAdvertisement(s)}else this.tickWaitingQueue()});p(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});p(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({advertisementId:t},"active queue tick skipped, advertisement not exist");return}const a=setTimeout(()=>{const s=t,r=new Map(this.advertisementList.get());if(r.set(n.id,n),this.advertisementList.set(r),n.autoHideDuration!==1/0){const o=setTimeout(()=>{this.logger.debug({advertisementId:s,delay:n.autoHideDuration||5e3},"advertisement hiding by autoHideDuration"),this.closeAdvertisement(s)},n.autoHideDuration||5e3);this.timeouts.set(s,o)}this.logger.debug({advertisementId:s,queue:[...r.values()]},"advertisement displayed")},n.delay||0);this.timeouts.set(t,a),this.logger.debug({advertisementId:t},"active queue tick completed"),this.tickWaitingQueue()});p(this,"closeAdvertisement",(t,{animateHiding:n=!0}={})=>{const a=new Map(this.advertisementList.get()),s=a.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&n,this.advertisementList.set(a);const r=setTimeout(()=>{const o=new Map(this.advertisementList.get());o.delete(t),this.advertisementList.set(o);const c=this.timeouts.get(t);c!==void 0&&(clearTimeout(c),this.timeouts.delete(t)),this.logger.debug({advertisementId:t},"advertisement hidden")},this.options.animationDelay||0);this.timeouts.set(t,r)}return this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({advertisementId:t},"advertisement hiding"),s});p(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.advertisementList.off(),this.advertisementList.set(new Map)});this.options=t,this.logger=Me("advertisement_queue"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.advertisementList=se(new Map)}}const yk=(e,t,n)=>{const a=Me("advertisement_queue"),s=new Tk({concurrency:1,animationDelay:1e3}),r=new pk,o=Ff(e.getStore(),d=>{var y;return(y=d.data)==null?void 0:y.filter(T=>T.type==="promotion")}),c=(d,y)=>{r.isShowed(d)&&!y||s.addToQueue({id:d,autoHideDuration:1/0,data:_e({loading:!1,error:void 0,data:void 0}),promise:async function(){this.data.setKey("loading",!0);try{const T=await mk(d,n);T?this.data.setKey("data",T):this.data.setKey("error",new Error("No promotion found"))}catch(T){this.data.setKey("error",T)}finally{this.data.setKey("loading",!1)}}})},l=d=>{a.debug({notificationId:d},"markAsViewed: %o"),r.setShowed(d)},m=d=>{s.closeAdvertisement(d),l(d)},u=()=>{const d=s.advertisementList.get();if(!(d!=null&&d.size))return null;const y=d.values().next().value,T=y.data.get();return!T.data&&!T.error&&!T.loading&&(y.promise(),Le.emit("poll",{action:"opened",payload:{questionId:y.id,questionType:F.PROMOTION,questionOpenedFrom:"notification"}}),l(y.id)),y};return Jt(s.advertisementList,()=>{o.subscribe(d=>{if(d){const y=d[d.length-1];c(y.id)}}),t.addListener("promotion",d=>{var T,f,_;const y=(f=(T=d.data)==null?void 0:T.attributes)==null?void 0:f.feedItem;if(((_=y==null?void 0:y.attributes)==null?void 0:_.attributes.case)!=="promotion"){a.debug("not promotion");return}if(y.attributes.status===le.RESOLVED){m(y.id),a.debug({feedItem:y},"resolved: %o");return}if(y.attributes.status===le.ACTIVE){a.debug({feedItem:y},"active: %o"),c(y.id);return}a.debug({feedItem:y},"skip: %o")})}),{hide:m,show:c,$list:s.advertisementList,getActiveAdvertisement:u}};var dt;(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(dt||(dt={}));class gk{constructor(t){p(this,"slStreamId");p(this,"organizationId");p(this,"userId");p(this,"interactiveAllowed");p(this,"openedQuestionId");p(this,"openedQuestion");p(this,"activeQuestionId");p(this,"feedList");p(this,"moderationId");p(this,"moderation");p(this,"feedSubscription");p(this,"questionSubscription");p(this,"advertisement");p(this,"notifications");p(this,"log");p(this,"transport");p(this,"cancels",new Set);p(this,"getCurrentSessionId",t=>{const n=t.eventId||this.slStreamId.get()||"",a=t.userId||this.userId.get()||"",s=t.organizationId||this.organizationId.get()||"",r=t.entity||"",o=t.prefix||"";return[s,n,a,o,r].join(":")});p(this,"disconnect",()=>{var t;(t=this.feedSubscription)==null||t.disconnect(),this.questionSubscription!==void 0&&(this.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0)});p(this,"openQuestion",(t,n)=>{this.openedQuestionId.set({questionId:t,question:n}),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});p(this,"closeQuestion",t=>{this.openedQuestionId.set(void 0),t&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});this.transport=t.transport,this.log=Me("gamification-background"),this.slStreamId=t.stores.slStreamId.getAtomStore(),this.organizationId=t.stores.organizationSettings.getAtomStore(),this.userId=t.stores.user.getAtomStore(),this.moderationId=new he(se(void 0),"moderationId").getStore(),this.interactiveAllowed=new he(se(dt.DISALLOWED),"interactiveAllowed").getStore(),this.openedQuestionId=new he(se(void 0),"openedQuestionId").getStore(),this.notifications=t.notifications,this.moderation=new He(ok(this.slStreamId,t.transport),"gamification:moderation"),this.feedList=new He(uk(this.slStreamId,this.interactiveAllowed,t.transport),"gamification:feedList"),this.activeQuestionId=ik(this.slStreamId,t.transport),this.openedQuestion=dk(t.transport,this.openedQuestionId,this.feedList.getStore()),this.cancels.add(this.openedQuestionId.listen(n=>{this.log.debug({item:n},"received question"),n!=null&&n.questionId?(this.questionSubscription=lk(n.questionId,t.transport),this.questionSubscription.addListener("feed-subscription-opened-question",a=>{var s,r;this.openedQuestion.updateExtendedQuestion((r=(s=a.data)==null?void 0:s.attributes)==null?void 0:r.question)}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(t.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))})),this.feedSubscription=ck(this.slStreamId,t.transport),this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question",n=>{var r,o,c,l,m;const a=(o=(r=this.activeQuestionId.get().data)==null?void 0:r.question)==null?void 0:o.id,s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.question;s&&(a&&s.status===le.RESOLVED&&s.id!==a||this.activeQuestionId.mutate((m=n.data)==null?void 0:m.attributes))})),this.cancels.add(this.feedSubscription.addListener("moderation update",n=>{window.requestAnimationFrame(()=>{var a,s,r,o;((s=(a=n.data)==null?void 0:a.attributes)==null?void 0:s.question)===void 0&&((o=(r=n.data)==null?void 0:r.attributes)!=null&&o.moderation)&&this.moderation.invalidate()})})),this.feedSubscription.connect(),this.cancels.add(this.interactiveAllowed.listen(()=>{window.requestAnimationFrame(()=>{this.activeQuestionId.invalidate()})})),t.sdk.onMount({name:"gamification-background"},()=>()=>{this.activeQuestionId.off();for(const n of this.cancels)n(),this.cancels.delete(n)}),this.advertisement=yk(this.feedList,this.feedSubscription,t.transport)}}class fk{constructor(t){p(this,"notificationsList");p(this,"store");p(this,"timeouts");p(this,"waitingQueue");p(this,"activeQueue");p(this,"options");p(this,"logger");p(this,"addToQueue",t=>{var s;if(this.store.has(t.id)){this.logger.debug({notification:t},"skip existed notification: %o");return}const n=t.close,a=t.action;if(this.store.set(t.id,{...t,close:(...r)=>{n&&n(...r),this.closeNotification(t.id)},action:(...r)=>{a&&a(...r),this.closeNotification(t.id,{animateHiding:!1})}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[r]=this.activeQueue;if(((s=this.store.get(r))==null?void 0:s.persistent)!==!0)this.closeNotification(r);else{const[o]=this.waitingQueue;this.waitingQueue.size>1&&this.closeNotification(o),this.tickWaitingQueue()}}else this.tickWaitingQueue()});p(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});p(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({notificationId:t},"active queue tick skipped, notification not exist");return}const a=setTimeout(()=>{const s=t,r=new Map(this.notificationsList.get());r.set(n.id,n),this.notificationsList.set(r);const o=setTimeout(()=>{this.logger.debug({notificationId:s,delay:n.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(s)},n.autoHideDuration||5e3);this.timeouts.set(s,o),this.logger.debug({notificationId:s,queue:[...r.values()]},"notification displayed")},n.delay||0);this.timeouts.set(t,a),this.logger.debug({notificationId:t},"active queue tick completed"),this.tickWaitingQueue()});p(this,"closeNotification",(t,{animateHiding:n=!0}={})=>{const a=new Map(this.notificationsList.get()),s=a.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&n,this.notificationsList.set(a);const r=setTimeout(()=>{const o=new Map(this.notificationsList.get());o.delete(t),this.notificationsList.set(o);const c=this.timeouts.get(t);c!==void 0&&(clearTimeout(c),this.timeouts.delete(t)),this.logger.debug({notificationId:t},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(t,r)}return this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({notificationId:t},"notification hiding"),s});p(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.notificationsList.off(),this.notificationsList.set(new Map)});this.options=t,this.logger=Me("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notificationsList=se(new Map)}}var Rn;(function(e){e.OPENED="opened"})(Rn||(Rn={}));class kk extends Dt{constructor(){super("notification");p(this,"setOpened",n=>{this.write(Rn.OPENED,n,"true")});p(this,"isOpened",n=>this.read(Rn.OPENED,n));p(this,"clearNotification",()=>{this.clear()})}}var ze;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(ze||(ze={}));class hk{constructor(t={}){p(this,"queue");p(this,"storage");p(this,"add",t=>{if(!this.storage.isOpened(t.id)){if(t.data&&t.emitEvent){const n=t.action;t.action=(...a)=>{n&&n(...a),Le.emit("notification",{action:"opened",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})}}this.queue.addToQueue(t)}});p(this,"close",(t,{markAsViewed:n=!0,animateHiding:a}={})=>{this.queue.closeNotification(t,{animateHiding:a}),n&&this.markAsViewed(t)});p(this,"getActiveNotification",()=>{const t=this.queue.notificationsList.get();if(!(t!=null&&t.size))return null;for(const n of t.values())if(n.type===ze.ONBOARDING)return n;return t.values().next().value});p(this,"getQueueStore",()=>this.queue.notificationsList);p(this,"markAsViewed",t=>{this.storage.setOpened(t)});this.storage=new kk,this.queue=new fk({concurrency:1,animationDelay:1600,...t})}}const Sk=(e,t,n)=>{e.notifications=new hk(void 0),e.addNotification=e.notifications.add,e.sdk.getNotificationsStore=()=>e.notifications.getQueueStore(),e.sdk.getActiveNotification=()=>e.notifications.getActiveNotification(),e.sdk.onMount({name:"notifications"},()=>()=>{e.notifications.queue.drain()}),n()};var Kt;(function(e){e.UNKNOWN="unknown",e.ALREADY_VOTED="already_voted"})(Kt||(Kt={}));const _k=async(e,t)=>{var r;const{client:n,createRequestOptions:a}=e.createPromiseClient(Ye,{method:"submitAnswer"}),s=a({retryAttempts:0});try{return await n.submitAnswer({data:t},{contextValues:s})}catch(o){throw((r=W.from(o))==null?void 0:r.code)===exports.Code.AlreadyExists?new Error(Kt.ALREADY_VOTED):new Error(Kt.UNKNOWN)}},Ek=(e,t)=>{const{client:n,createRequestOptions:a}=e.createPromiseClient(Ye,{method:"submitInplay"}),s=a({retryAttempts:0});return n.submitInplay({data:{eventId:+t}},{contextValues:s})};var It;(function(e){e.ONBOARDING="onboarding",e.ONBOARDING_IO="onboarding_io"})(It||(It={}));class bk extends Dt{constructor(){super("gamification-session",window.sessionStorage);p(this,"writeValue",(n,a)=>{this.write(...n,a)});p(this,"readValue",n=>this.read(...n))}}class Hi extends Dt{constructor(){super("gamification");p(this,"sessionStorage");p(this,"saveOnboardingStatus",({userId:n,eventId:a,organizationId:s},r)=>{this.write(It.ONBOARDING,s,n,a,r)});p(this,"getOnboardingStatus",({userId:n,eventId:a,organizationId:s})=>this.read(It.ONBOARDING,s,n,a));p(this,"setOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>{this.sessionStorage.writeValue([It.ONBOARDING_IO,s,n,a],"1")});p(this,"getOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>this.sessionStorage.readValue([It.ONBOARDING_IO,s,n,a]));this.sessionStorage=new bk}}const Ik={pageSize:10},Nk=(e,t,n,a,s)=>{let r=0;const o=se({pageSize:Ik.pageSize,page:0}),c=_e({data:[],key:Date.now(),hasMore:!0,loading:void 0,error:void 0}),l=sk(e),m=async()=>{var f;const y=t.get(),T=((f=a.getStore().get().data)==null?void 0:f.map(_=>_.slId))||[];if(y&&(T!=null&&T.length)){const _=n.get();_&&T.push(_),c.setKey("loading",!0),c.setKey("data",[]);const v=await l({eventId:y,usersIds:T});c.set({data:v.data.map((I,E)=>({...I.attributes,friendsRank:E+1})),hasMore:!1,key:Date.now(),loading:!1}),v.meta&&(r=Math.round(v.meta.count/v.meta.pageSize))}},u=()=>{m()},d=y=>{const T=o.get(),f=y||T.page+1;f<=r&&o.set({...T,page:f})};return Jt(c,()=>{const y=t.listen(m),T=a.listen(m);return()=>{y(),T()}}),{$store:c,fetchMore:d,invalidate:u}};class vk extends Dt{constructor(){super("deep-link-context",window.sessionStorage);p(this,"get",this.read);p(this,"set",this.write);p(this,"del",this.remove)}}const jr="sldl",Qn="sldl_uid",Qi="sldl_eid",Yi="sldl_e_eid",Ok=new Set([Qn,Qi,Yi]),$r=e=>{const t={},n={};for(const[a,s]of e)Ok.has(a)?t[a]=s:n[a]=s;return{result:t,remain:n}},Ak=({hash:e,search:t})=>{if(e&&e.includes(jr)){const n=new URLSearchParams(e.substr(1));return{hash:$r(n)}}if(t&&t.includes(jr)){const n=new URLSearchParams(t);return{search:$r(n)}}return null},Wr=Me("deep_link"),we={debug:(...e)=>{Wr.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{Wr.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},wk=(e,t)=>{const{hash:n,search:a}=window.location;if(we.debug({hash:n,search:a},"get deep link data from"),n||a){const s=Ak({hash:n,search:a});if(we.debug(s,"parse deep link result"),s){const{hash:r,search:o}=s,{result:c,remain:l}=r||o;if(Object.keys(c).length!==0){e.setValue("data",c);const m=Object.keys(l).length!==0;if(r){let u="";m&&(u=`#${new URLSearchParams(l).toString()}`,we.debug({updatedHash:u},"update hash")),window.history.replaceState(null,"",window.location.pathname+window.location.search+u)}if(o){let u="";m&&(u=`?${new URLSearchParams(l).toString()}`,we.debug({updatedSearch:u},"update search")),window.history.replaceState(null,"",window.location.pathname+u+window.location.hash)}t(c)}}}e.setValue("parsed",!0)},Rk=(e,t,n)=>{const a=new vk,s=a.get("sl-deep-link-store");let r={};if(s)try{r=JSON.parse(s)}catch(c){we.debug(c)}e.deepLink={$store:new ut(_e(r),"deep-link-context"),getDeepLinkData:()=>{const{data:c,used:l}=e.deepLink.$store.getValues();return{data:c,used:l}},deepLinkUsed:c=>{we.debug(`logged in with inviterId: ${c}`),e.deepLink.$store.setValue("used",!0)},onDeepLinkHandlers:new Set},e.sdk.getInviter=()=>{const{data:c,used:l}=e.deepLink.getDeepLinkData();return l?c==null?void 0:c[Qn]:void 0},e.sdk.inviteDisplayed=()=>{e.deepLink.$store.getStore().set({}),e.deepLink.$store.getStore().off(),a.del("sl-deep-link-store")},e.deepLink.$store.subscribe(c=>a.set("sl-deep-link-store",JSON.stringify(c))),e.sdk.addDeepLinkHandler=c=>{localStorage.getItem("SL_DEBUG")&&we.trace("adding deep link handler"),e.deepLink.onDeepLinkHandlers.add(c)},t.onDeepLinkHandled&&e.sdk.addDeepLinkHandler(t.onDeepLinkHandled),e.sdk.removeDeepLinkHandler=c=>{we.trace("removing deep link handler"),e.deepLink.onDeepLinkHandlers.delete(c)};const o=c=>{e.deepLink.$store.setValue("handled",!0),we.trace({size:e.deepLink.onDeepLinkHandlers.size},"deep link handled, call callbacks");for(const l of e.deepLink.onDeepLinkHandlers)try{we.trace("called handler"),l(c)}catch(m){console.error(m)}};wk(e.deepLink.$store,o),n()},Lk=Me("bypass");class Mk extends Cf{constructor(n,a,s){super();p(this,"$coreStore");p(this,"deepLink");p(this,"transport");p(this,"bypassLogin");p(this,"me",async()=>{var n;return this.$coreStore.getValues().user.invalidate(),(n=await this.$coreStore.getValues().user.getValue())==null?void 0:n.data});p(this,"login",async(n,a)=>{var u,d,y;this.$coreStore.getValues().userKey.setValue(a);const{used:s,data:r}=this.deepLink.getDeepLinkData(),o=s?"":r==null?void 0:r[Qn];Lk.debug({inviterKey:o},"login with inviterKey");const c=await this.bypassLogin({schema:n,userKey:a,inviterKey:o,init:!1}),l=(u=c.meta)==null?void 0:u.jwt,m=(d=c.data)==null?void 0:d.id;if(!l||!m)throw new Error("internal: token missing");return(y=c.meta)!=null&&y.inviterKey&&this.deepLink.deepLinkUsed(c.meta.inviterKey),this.$coreStore.getValues().user.getStore().mutate({data:c.data}),this.saveUser(l,m),l});p(this,"isAuthenticated",()=>this.me());p(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new bt().clear()});p(this,"softLogout",()=>{const n=new bt;this.transport.setAuth("",""),n.setToken(""),this.reLogin()});p(this,"reLogin",()=>{const n=new bt,a=n.getToken(),s=n.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(s),a)return this.saveUser(a,""),this.me().then(r=>{if(r!=null&&r.id){const o=r.id;this.saveUser(a,o)}});if(s&&!a){const r=n.getSchema();r&&s&&this.login(r,s).catch(()=>{this.logout()})}});p(this,"saveUser",(n,a)=>{this.transport.setAuth(n,a),this.$coreStore.getValues().userToken.setValue(n),new bt().setToken(n)});p(this,"connect",()=>{this.transport.registerInterceptor(n=>async a=>{try{return await n(a)}catch(s){throw s.code&&(s.code===7||s.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),s}})});this.$coreStore=n,this.deepLink=s,this.transport=a,this.bypassLogin=Wf(this.transport),this.connect()}}const Bt=new bt,Pk=(e,t,n)=>{e.auth=new Mk(e.store,e.transport,e.deepLink),e.stores.status.listen(a=>{a===Fe.READY&&e.auth.reLogin()}),e.sdk.userId=e.stores.user.getAtomStore,e.sdk.authorizationBypass=async(a,s)=>{if(!(Bt.getSchema()===a&&Bt.getExternalToken()===s&&e.transport.getHeader("authorization")))try{await e.auth.login(a,s),Bt.setSchema(a),Bt.setExternalToken(s)}catch{e.sdk.logout()}},e.sdk.logout=()=>{e.auth.logout(),Bt.clear()},e.sdk.getUserStore=()=>e.stores.user.getStore(),e.sdk.isUserAuthorized=()=>e.auth.isAuthenticated(),n()},Kr=Me("video_player"),ln={debug:(...e)=>{Kr.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{Kr.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},Ck=(e,t,n)=>{e.videoPlayer={controllers:new Set},e.sdk.addVideoPlayerController=a=>{ln.trace("adding video player controller"),e.videoPlayer.controllers.add(a)},t.videoPlayerController&&e.sdk.addVideoPlayerController(t.videoPlayerController),e.sdk.removeVideoPlayerController=a=>{ln.trace("removing video player controller"),e.videoPlayer.controllers.delete(a)},e.sdk.controlVideoPlayer=a=>{ln.trace("controlling video player");for(const s of e.videoPlayer.controllers){ln.trace("calling video player controller");try{s(a)}catch(r){console.error(r)}}},n()},Dk=(e,t,n)=>{const a={onMountedFired:!1},s=new Map,r=new Map;e.sdk=Object.create(null),e.sdk.onMount=({name:o,clear:c},l)=>{var m,u;if(s.has(o)){const d=r.get(o);d&&d(),s.delete(o),r.delete(o)}s.set(o,{cb:l,clear:c}),((u=(m=e==null?void 0:e.stores)==null?void 0:m.enabled)==null?void 0:u.get())==="on"&&r.set(o,l())},e.ready=()=>{e.stores.enabled.subscribe(o=>{o==="on"&&a.onMountedFired===!1&&(s.forEach(({cb:c},l)=>r.set(l,c())),a.onMountedFired=!0),o!=="on"&&a.onMountedFired===!0&&(r.forEach(c=>c()),r.clear(),s.forEach(({clear:c},l)=>c&&s.delete(l)),a.onMountedFired=!1)})},e.sdk.initializeApp=async o=>{if(e.contextConfig=o,e.stores.enabled.get()==="on")return{enabled:!0};e.storeSubscribe(),e.stores.enabled.setValue("on"),e.stores.status.setValue(Fe.INITIALIZATION);try{const c=await e.stores.organizationSettings.getValue();return c?(e.stores.status.setValue(Fe.READY),{enabled:!!c}):(e.stores.status.setValue(Fe.FAILED),{err:"failed"})}catch(c){return e.stores.enabled.setValue(),e.stores.status.setValue(Fe.FAILED),{err:`${c}`}}},e.sdk.disableApp=()=>{e.stores.enabled.get()==="on"&&(e.stores.enabled.setValue(),e.stores.status.setValue(Fe.DISABLED),e.stores.slStreamId.setValue(),e.stores.providerStreamId.setValue(),e.sdk.closeFeature(!0),e.storeUnsubscribe(),e.transport.disconnect())},e.sdk.createEventSession=o=>{e.stores.providerStreamId.setValue(o)},n()},Uk=(e,t)=>{const{client:n,queryKey:a}=e.createPromiseClient(Xt,{method:"generateDeepLink",params:t});return e.nanoquery.createFetcherStore(a,{fetcher:async(s,r,o,c)=>{var l;if(!o)return{};try{return(l=(await n.generateDeepLink({data:{gamification:!0,externalEventId:c,eventId:o}})).data)==null?void 0:l.attributes}catch{return}},dedupeTime:1e3*60*60*24,refetchInterval:0})},Fk=(e,{web:t,mobile:n})=>{const{client:a}=e.createPromiseClient(of,{method:"generate"});return a.generate({web:t,mobile:n})},zr=(e,t)=>{const n=new URLSearchParams(e);for(const[a,s]of Object.entries(t))n.append(a,s);return n.toString()},Gk=(e,t,n,a)=>{const s=_e({});return Jt(s,()=>Uk(e,[t,n]).subscribe(async({data:r,error:o,loading:c})=>{var T;const l=o?"https://masters.com":r==null?void 0:r.url,m=a.get()||"",u=t.get()||"",d=n.get()||"",y={[Qn]:m,[Qi]:u,[Yi]:d};if(!c&&l){s.setKey("loading",!0);let f=window.location.search,_=window.location.hash;f&&_||_?f=`?${zr(f,y)}`:_=`#${zr("",y)}`;const v=window.location.origin+window.location.pathname+f+_;try{const I=await Fk(e,{web:v,mobile:l});s.set({data:(T=I.data)==null?void 0:T.link,loading:!1})}catch{s.set({loading:!1,error:"Failed to generate short link",data:void 0})}}else s.setKey("loading",!0)})),{$store:s,fetch}};var ae;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(ae||(ae={}));const Bk=(e,t,n,a)=>{const{inplayGame:s}=e.featureSettings.get(),r=t.getCurrentSessionId({prefix:"onboarding"});s&&n.add({type:ze.ONBOARDING,id:r,action:e.openFeature,persistent:!0,autoHideDuration:1e6,data:{questionId:"onboarding",questionType:F.UNSET,onboarding:{...s,instantOpen:!a.getOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})}}})},mn=(e,t,n,a,s,r)=>{var o,c,l;try{const m=t.userId.get();if(!m)return;if(s.getOnboardingStatus({userId:m,organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})===ae.Completed){e.set(ae.Completed);for(const f of r)f();return}const u=(o=t.moderation.getStore().value)==null?void 0:o.data,d=n.featureSettings.get().inplayGame;if(u===void 0||d===void 0)return;const y=(c=u==null?void 0:u.options)==null?void 0:c.onboardingEnabled,T=(l=d==null?void 0:d.titleCard)==null?void 0:l.optIn;y?T?e.set(ae.Required):e.set(ae.Optional):(T?e.set(ae.Unavailable):e.set(ae.Disabled),a.close(t.getCurrentSessionId({prefix:"onboarding"}),{markAsViewed:!1}))}catch(m){console.error(m)}},Vk=(e,t,n,a)=>{let s=!1;const r=new Hi,o=se(ae.Unset);o.subscribe(l=>{l!==ae.Unset&&((l===ae.Optional||l===ae.Required)&&s===!1&&(Bk(e,t,a,r),s=!0),l===ae.Completed&&t.activeQuestionId.invalidate(),r.setOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""}))});const c=[];return mn(o,t,e,a,r,c),o.get()!==ae.Completed&&(c.push(t.userId.listen(l=>{l&&mn(o,t,e,a,r,c)})),c.push(t.moderation.listen(l=>{l.data&&mn(o,t,e,a,r,c)})),c.push(e.featureSettings.listen(l=>{l&&mn(o,t,e,a,r,c)}))),{$store:o,submitInplay:async()=>{const l=t.slStreamId.get();if(l){await Ek(n,l),o.set(ae.Completed),r.saveOnboardingStatus({organizationId:t.organizationId.get()||"",userId:t.userId.get()||"",eventId:l},ae.Completed),Le.emit("poll",{action:"onboardingPassed",payload:{}}),e.openFeature();const m=t.getCurrentSessionId({prefix:"onboarding"});a.close(m)}}}},xk=(e,t,n,a)=>{const s=_e(void 0),r=qi(a),o=async()=>{var T,f;const l=e.get(),m=t.get(),u=(T=n.getStore().get().data)==null?void 0:T.map(_=>_.slId);if(!u)return;const d={eventId:l,userId:m,usersIds:[...u,m]},y=await r(d);s.set((f=y.data)==null?void 0:f.attributes)},c=()=>{o()};return Jt(s,()=>{const l=e.listen(o),m=n.listen(o),u=t.listen(o);return()=>{l(),m(),u()}}),{$store:s,invalidate:c}},qk=async(e,t,n,a,s)=>{var u,d,y;const r=qi(s),o=e.get(),c=t.get(),l=((u=n.getStore().get().data)==null?void 0:u.map(T=>T.slId))||[],m={eventId:o,userId:a,usersIds:[...l,c]};return(y=(d=(await r(m)).data)==null?void 0:d.attributes)==null?void 0:y.summary},Hk=new Set([F.POLL,F.PREDICTION,F.TRIVIA]);class Qk extends Vi{constructor(n,a,s){super(n,a);p(this,"userSummary");p(this,"feedList");p(this,"friends");p(this,"leaderboardId");p(this,"leaderboardList");p(this,"deepLink");p(this,"onboardingStatus");p(this,"openedQuestion");p(this,"currentUserId");p(this,"openedUser");p(this,"closeFeature");p(this,"openFeature");p(this,"feedSubscription");p(this,"activeQuestionId");p(this,"openedQuestionId");p(this,"advertisement");p(this,"notifications");p(this,"transport");p(this,"background");p(this,"storage");p(this,"submitAnswerTimeout");p(this,"cancels",new Set);p(this,"checkInteractiveFlag",()=>{var c,l,m,u,d;const n=this.onboardingStatus.$store.get(),a=(m=(l=(c=this.background.moderation.getStore().value)==null?void 0:c.data)==null?void 0:l.options)==null?void 0:m.onboardingEnabled,s=(d=(u=this.settings.getValues().inplayGame)==null?void 0:u.titleCard)==null?void 0:d.optIn,r=n===ae.Completed,o=!a||r||s!==!0;this.background.interactiveAllowed.set(o?dt.ALLOWED:dt.DISALLOWED)});p(this,"connect",()=>{this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close",async n=>{var m,u,d,y,T,f,_,v,I,E,R;if(!this.isInteractiveAllowed)return;const a=(u=(m=n.data)==null?void 0:m.attributes)==null?void 0:u.question,s=(y=(d=n.data)==null?void 0:d.attributes)==null?void 0:y.feedItem;if(!a||!(s!=null&&s.attributes))return;const{status:r,type:o,id:c,answers:l}=a;if(r===le.RESOLVED&&o===F.PREDICTION){const O=this.background.getCurrentSessionId({prefix:`notification-id:${c}`}),N=[...this.feedList.getValues().data||[]],L=N.findIndex(J=>J.id===c),A=N[L];let C=(_=(f=(T=A==null?void 0:A.attributes)==null?void 0:T.attributes)==null?void 0:f.value)==null?void 0:_.answerId;const H=Ha(c,this.transport),te=H.subscribe(()=>{});await H.get().promise;const j=H.get().data;te(),window.requestAnimationFrame(()=>{H.invalidate()}),C||(C=(v=j==null?void 0:j.answers.find(({youVoted:J})=>J))==null?void 0:v.id);const K=l.find(({correct:J})=>J),x=C?l.find(({id:J})=>J===C):void 0,G=!!(x!=null&&x.correct);if(A&&((E=(I=N[L])==null?void 0:I.attributes)==null?void 0:E.attributes.case)==="question"){try{N[L].attributes.attributes.value.answerId=C,N[L].attributes.attributes.value.openForVoting=!1,C&&(N[L].attributes.attributes.value.status=G?Et.WON:Et.LOST)}catch{}this.feedList.getStore().mutate(N)}if(!x||!K)return;((R=this.openedQuestionId.get())==null?void 0:R.questionId)!==a.id&&this.notifications.add({type:ze.QUESTION_RESOLVED,action:()=>this.openQuestion(a.id,s),close:()=>this.closeQuestion(c),autoHideDuration:G?15e3:12e3,id:O,emitEvent:!1,data:{questionId:c,questionType:F.PREDICTION,question:{title:G?`Congratulations! You answered correctly! You won ${K.points} pts!`:`Better luck next time! Correct: ${K==null?void 0:K.text}!`,votedAnswer:{title:x==null?void 0:x.text,points:x==null?void 0:x.points},correctAnswerTitle:K==null?void 0:K.text,correct:!!G,predictionResult:r===le.RESOLVED,questionTitle:a==null?void 0:a.subject}}}),this.userSummary.invalidate()}})),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list",n=>{var o,c,l,m,u;const a=[...((o=this.feedList.getStore().value)==null?void 0:o.data)||[]],s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.feedItem,r=a.findIndex(d=>d.id===(s==null?void 0:s.id));if(s!=null&&s.attributes&&s.attributes.attributes.case!=="promotion"&&!(s.attributes.status!==le.ACTIVE&&s.attributes.status!==le.RESOLVED)){if(r!==-1)if(s.attributes.attributes.case==="question"&&((m=a[r].attributes)==null?void 0:m.attributes.case)==="question"){const d=a[r];d.attributes&&(a[r]={...a[r],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value,answerId:d.attributes.attributes.value.answerId,status:d.attributes.attributes.value.status,openForVoting:d.attributes.attributes.value.openForVoting}}}})}else{const d=a[r];d.attributes&&s.attributes&&(a[r]={...a[r],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value}}}})}r===-1&&(a.unshift(s),console.log("feedItem",s),Le.emit("poll",{action:"received",payload:{questionId:s.id,questionType:(u=s.attributes)==null?void 0:u.type}})),this.feedList.getStore().mutate(a)}}))});p(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-prediction-close"),this.background.feedSubscription.removeListener("feed-subscription-questions-list")});p(this,"submitAnswer",async(n,a)=>{const s=Ha(n,this.transport),r=s.subscribe(()=>{}),o={...s.get().data||{}},c=()=>{var y;const l=this.feedList.getValues().data;if(!l)return;const m=l.findIndex(T=>T.id===n),u=l[m],d=((y=u==null?void 0:u.attributes)==null?void 0:y.attributes.case)==="question"&&u.attributes.attributes.value;if(d){Le.emit("poll",{action:"voted",payload:{questionId:n,questionType:d.questionType}});const T=s.get().data;if(r(),T){const f=T.answers.find(E=>E.correct===!0),_=T.answers.findIndex(E=>E.id===a),v=T.answers[_],I=T.answers.every(({percentageDecimal:E},R)=>E===(o==null?void 0:o.answers[R].percentageDecimal));l[m].attributes.attributes.value.answerId=a,l[m].attributes.attributes.value.openForVoting=!1,l[m].attributes.attributes.value.text=(v==null?void 0:v.text)||"",f&&(l[m].attributes.attributes.value.status=f.id===a?Et.WON:Et.LOST),this.feedList.getStore().mutate([...l]),T.answers[_].correct=(f==null?void 0:f.id)===a,T.answers[_].youVoted=!0,I&&T.answers.forEach(E=>{E.percentageDecimal=0}),(f==null?void 0:f.id)===a&&(T.answers[_].pointsEarned=T.status===le.RESOLVED?0:f.points),s.mutate({...T})}this.submitAnswerTimeout&&clearTimeout(this.submitAnswerTimeout),this.submitAnswerTimeout=setTimeout(()=>{this.userSummary.invalidate()},1e3)}};try{await _k(this.transport,{questionId:n,answerId:a}),c()}catch(l){if(l.message===Kt.ALREADY_VOTED){this.userSummary.invalidate();const m=s.subscribe(()=>{});s.invalidate(),m()}throw l}});p(this,"openQuestion",(n,a)=>{var r,o,c,l;if(!n)return()=>{};this.notifications.close(this.background.getCurrentSessionId({prefix:"notification",entity:n}),{animateHiding:!1});let s=(r=a==null?void 0:a.attributes)==null?void 0:r.type;return s||(s=(l=(c=(((o=this.feedList.getStore().value)==null?void 0:o.data)||[]).find(m=>m.id===n))==null?void 0:c.attributes)==null?void 0:l.type),Le.emit("poll",{action:"opened",payload:{questionId:n,questionType:s,questionOpenedFrom:a==null?void 0:a.openedFrom}}),this.background.openQuestion(n,a)});p(this,"closeQuestion",n=>this.background.closeQuestion(n));p(this,"openUser",async n=>{var r,o;const a=(r=this.leaderboardList.$store.get().data)==null?void 0:r.find(c=>c.userId===n);if(!a){this.openedUser.set(a);return}if(a.summaryLoaded){this.openedUser.set(a);return}const s={...a};try{const c=await qk(this.background.slStreamId,this.background.userId,this.friends,n,this.transport);(c==null?void 0:c.inTop)!==void 0&&(this.leaderboardList.$store.setKey("data",(o=this.leaderboardList.$store.get().data)==null?void 0:o.map(l=>(l.userId===n&&(l.inTop=c.inTop),l))),s.inTop=c.inTop)}catch(c){console.error(c)}this.openedUser.set(s)});p(this,"closeUser",()=>{this.openedUser.set(void 0)});p(this,"showInApp",n=>{var s,r,o,c,l,m,u,d,y,T,f,_,v,I;const a=this.onboardingStatus.$store.get();if(n&&n.data&&a&&a!==ae.Unset&&((s=n.data.question)==null?void 0:s.id)!==void 0&&n.data.question.notification!==void 0&&((o=(r=n.data.question)==null?void 0:r.bypassNotifications)==null?void 0:o.inAppSilence)!==Ko.ON&&n.data.question.status===le.ACTIVE&&!n.data.question.marketClosed){if(Hk.has(n.data.question.type))this.isInteractiveAllowed&&this.notifications.add({type:ze.QUESTION,action:()=>{var E,R,O;return this.openQuestion((R=(E=n.data)==null?void 0:E.question)==null?void 0:R.id,(O=n.data)==null?void 0:O.feedItem)},close:()=>{var E,R;return this.closeQuestion((R=(E=n.data)==null?void 0:E.question)==null?void 0:R.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),emitEvent:!0,data:{questionId:n.data.question.id,questionType:n.data.question.type,question:{title:n.data.question.notification.title}}});else if(n.data.question.type===F.FACTOID){const E=(c=n.data.question.options)==null?void 0:c.options.value,R={heading:n.data.question.notification.title,body:n.data.question.notification.body,imageMode:E==null?void 0:E.imageMode,image:E==null?void 0:E.image,video:{id:((l=E==null?void 0:E.video)==null?void 0:l.id)||"",url:((m=E==null?void 0:E.video)==null?void 0:m.url)||"",thumbnailUrl:((u=E==null?void 0:E.video)==null?void 0:u.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:ze.QUESTION,action:()=>{var O,N,L;return this.openQuestion((N=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:N.id,(L=n==null?void 0:n.data)==null?void 0:L.feedItem)},close:()=>{var O,N;return this.closeQuestion((N=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:N.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,insight:R}})}else if(n.data.question.type===F.TWEET){const E=(d=n.data.question.options)==null?void 0:d.options.value,R={title:(y=n.data.question.notification)==null?void 0:y.title,body:(T=n.data.question.notification)==null?void 0:T.body,image:(f=n.data.question.notification)==null?void 0:f.image,account:((_=E==null?void 0:E.tweetMeta)==null?void 0:_.account)||"",accountVerified:!!((v=E==null?void 0:E.tweetMeta)!=null&&v.accountVerified),tweet:(I=E==null?void 0:E.tweetMeta)==null?void 0:I.tweet,tweetId:n.data.question.id};this.notifications.add({type:ze.QUESTION,action:()=>{var O,N,L;return this.openQuestion((N=(O=n.data)==null?void 0:O.question)==null?void 0:N.id,(L=n.data)==null?void 0:L.feedItem)},close:()=>{var O,N;return this.closeQuestion((N=(O=n.data)==null?void 0:O.question)==null?void 0:N.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,tweet:R}})}}});this.background=new gk(s),this.advertisement=this.background.advertisement,this.feedSubscription=this.background.feedSubscription,this.activeQuestionId=this.background.activeQuestionId,this.openedQuestionId=this.background.openedQuestionId,this.storage=new Hi,this.feedList=this.background.feedList,this.friends=new He(rk(this.background.userId,s.transport),"gamification:friends"),this.currentUserId=this.background.userId,this.openedUser=se(void 0),this.leaderboardId=new he(se(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=Vk(this,this.background,s.transport,s.notifications),this.notifications=s.notifications,this.transport=s.transport,this.closeFeature=()=>s.sdk.closeFeature(!0),this.openFeature=()=>s.sdk.openFeature(q.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=Gk(this.transport,this.background.slStreamId,s.stores.providerStreamId.getStore(),this.background.userId),this.userSummary=xk(this.background.slStreamId,this.background.userId,this.friends,this.transport),this.leaderboardList=Nk(this.transport,this.background.slStreamId,this.background.userId,this.friends),this.connect(),this.cancels.add(this.userSummary.$store.listen((r,o)=>{o!=null&&o.summary&&(r!=null&&r.summary)&&this.leaderboardList.invalidate()})),this.cancels.add(this.background.activeQuestionId.listen(this.showInApp)),this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)),this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)),this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)),s.sdk.onMount({name:"gamification",clear:!0},()=>()=>{for(const r of this.cancels)r(),this.cancels.delete(r)})}get isInteractiveAllowed(){return this.background.interactiveAllowed.get()===dt.ALLOWED}}const Yk={[q.GAMES]:!0};class jk extends Vi{constructor(t,n){super(t,n)}}const $k=(e,t,n)=>e.type===q.GAMES?new Qk(e,t,n):new jk(e,t),Wk=(e,t,n)=>{e.features=new Map,e.sdk.featuresList=new he(se(new Set),"features-list"),e.activeFeature=new he(se(q.UNSET),"activeFeature"),e.sdk.getFeatures=()=>e.features,e.sdk.getFeature=a=>e.features.get(a),e.sdk.getActiveFeature=()=>e.activeFeature.getStore(),e.sdk.openFeature=a=>{e.activeFeature.setValue(a)},e.sdk.closeFeature=(a=!1)=>{const s=e.activeFeature.getValue();if(e.activeFeature.setValue(q.UNSET),a&&s){e.features.delete(s);const r=e.sdk.featuresList.getValue();r&&r.delete(s),e.sdk.featuresList.setValue(r)}},e.initFeature=(a,s=Ue.ORGANIZATION)=>{if(a.type in Yk&&!e.features.has(a.type)){const r=$k(a,s,e);e.features.set(a.type,r);let o=e.sdk.featuresList.getValue();o?o.add(a.type):o=new Set([a.type]),e.sdk.featuresList.setValue(new Set(o))}},e.updateFeature=(a,s)=>{var r;(r=e.features.get(a.type))==null||r.update(a,s)},e.destroyFeature=a=>{e.features.delete(a.type);const s=e.sdk.featuresList.getValue();s&&s.delete(a.type),e.sdk.featuresList.setValue(new Set(s))},e.reinitializeFeatures=async()=>{const a=await e.stores.organizationSettings.getValue();e.features.clear(),e.sdk.featuresList.setValue(new Set);for(const s of(a==null?void 0:a.overlays)||[])e.initFeature(s,Ue.ORGANIZATION)},e.stores.providerStreamId.listen(a=>{a||e.reinitializeFeatures()}),e.storeSubscribe=()=>{const a=(r,o)=>{var c;if(o!=null&&o.overlays&&!((c=e.contextConfig)!=null&&c.skipOrganizationSettings&&r===Ue.ORGANIZATION))for(const l of o.overlays)l.sdkEnable===!0&&(e.features.has(l.type)?e.updateFeature(l,r):e.initFeature(l,r))},s={organizationSettings:r=>{if(r.data)try{a(Ue.ORGANIZATION,r.data)}catch(o){console.log(o)}},streamSettings:r=>{if(r.data)try{a(Ue.STREAM,r.data)}catch(o){console.log(o)}}};e.store.subscribe(s)},n()};class Kk{constructor(t){p(this,"analytics");p(this,"accepted",()=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:fe.INVITATION_ACCEPTED},category:Ma.GAMES,from:An.UNSET})});p(this,"sent",({from:t})=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:fe.INVITATION_SENT},category:Ma.GAMES,from:t||An.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="invitation")switch(a.slEventBus.action){case"sent":this.sent(a.slEventBus.payload);break}};return Le.listen(n)})}}class zk{constructor(t){p(this,"analytics");p(this,"tap",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:fe.INTERACTIONS},actionType:Ga.TAP})});p(this,"scroll",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:fe.INTERACTIONS},actionType:Ga.SCROLL})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="interactions")switch(a.slEventBus.action){case"tap":this.tap();break;case"scroll":this.scroll();break}};return Le.listen(n)})}}const Qt={[F.UNSET]:pe.UNSET,[F.FACTOID]:pe.POLLS_INSIGHT,[F.POLL]:pe.POLLS_POLL,[F.PREDICTION]:pe.POLLS_PREDICTION,[F.PROMOTION]:pe.POLLS_PROMOTION,[F.TRIVIA]:pe.POLLS_TRIVIA,[F.TWEET]:pe.POLLS_TWITTER};F.UNSET+"",ve.UNSET,F.FACTOID+"",ve.POLLS,F.POLL+"",ve.POLLS,F.PREDICTION+"",ve.POLLS,F.PROMOTION+"",ve.POLLS,F.TRIVIA+"",ve.POLLS,F.TWEET+"",ve.POLLS;const Jk={[q.UNSET]:ie.UNSET,[q.INPLAY]:ie.INPLAY,[q.MESSAGING]:ie.MESSAGING,[q.STATISTICS]:ie.STATS,[q.BETTING]:ie.BETTING,[q.TWITTER]:ie.TWITTER,[q.MERCHANDISE]:ie.MERCHANDISE,[q.CONTESTS]:ie.CONTESTS,[q.VOICE_CHAT]:ie.CALLING,[q.TICKETS]:ie.TICKETS,[q.WHOIS_WATCHING]:ie.WHOISWATCHING,[q.PROFILE]:ie.PROFILE,[q.GAMES]:ie.POLLS,[q.GOLF_STATISTICS]:ie.STATS,[q.HIGHLIGHTS]:ie.HIGHLIGHTS,[q.PUBLIC_CHAT]:ie.PUBLIC_CHAT};class Xk{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:fe.NOTIFICATION_RECEIVED,topicId:t,topicType:n?Qt[n]:pe.UNSET},notificationKind:ve.POLLS,notificationType:Ba.IN_APP})});p(this,"opened",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:fe.NOTIFICATION_OPENED,topicId:t,topicType:n?Qt[n]:pe.UNSET},notificationKind:ve.POLLS,notificationType:Ba.IN_APP})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="notification")switch(a.slEventBus.action){case"rendered":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return Le.listen(n)})}}class Zk{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_RECEIVED,topicId:t,topicType:n?Qt[n]:pe.UNSET},pollOpenedFrom:ot.UNSET})});p(this,"opened",({questionId:t,questionType:n,questionOpenedFrom:a})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_OPENED,topicId:t,topicType:n?Qt[n]:pe.UNSET},pollOpenedFrom:a==="list"?ot.PICK_HISTORY:ot.IN_APP})});p(this,"voted",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_VOTE,topicId:t,topicType:n?Qt[n]:pe.UNSET},pollOpenedFrom:ot.UNSET})});p(this,"onboardingPassed",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.GAMES_JOINED},pollOpenedFrom:ot.UNSET})});p(this,"navigated",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:fe.POLLS_NAVIGATED},pollOpenedFrom:ot.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="poll")switch(a.slEventBus.action){case"voted":this.voted(a.slEventBus.payload);break;case"navigated":this.navigated();break;case"onboardingPassed":this.onboardingPassed();break;case"received":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return Le.listen(n)})}}const eh=({transport:e,$commonStore:t})=>{let n;const a=se(!1),s=5e3,{client:r,queryKey:o}=e.createPromiseClient(Di,{method:"send",params:[a]}),c=e.nanoquery.createFetcherStore(o,{fetcher:async()=>{const d=t.getStore().get();try{await r.unary({message:{case:"heartbeat",value:{common:{...d,kind:fe.SESSION_HEARTBEAT}}}})}catch(y){Ge.error(y,"send heartbeat failed")}return Date.now()},refetchInterval:s}),l=()=>{Ge.debug("mounted heartbeat"),n=c.subscribe(()=>{})},m=()=>{Ge.debug("enabled heartbeat"),a.set(!0),c.lc===0&&l()},u=()=>{Ge.debug("disabled heartbeat"),a.set(!1)};return{enable:m,disable:u,mount:l,unmount:()=>{Ge.debug("unmounted heartbeat"),c.off(),n==null||n(),n=void 0,u()}}},Ge=Me("analytics");class th{constructor(t){p(this,"commonStore");p(this,"notifications");p(this,"polls");p(this,"invitation");p(this,"interactions");p(this,"heartbeat");p(this,"analyticsClient");p(this,"listeners");p(this,"listenersCancels");p(this,"connected",!1);p(this,"connect",()=>{this.writeCommon("sessionId",Ca()),this.heartbeat.enable(),this.listeners.forEach(t=>this.listenersCancels.add(t())),this.connected=!0,Ge.debug("analytics connected")});p(this,"disconnect",()=>{this.writeCommon("sessionId",""),this.writeCommon("overlaySessionId",""),this.heartbeat.unmount(),this.listenersCancels.forEach(t=>t()),this.connected=!1,Ge.debug("analytics disconnected")});p(this,"write",(t,n)=>{n&&this.analyticsClient.unary({message:{case:t,value:n}}).then(()=>{Ge.trace("send analytics success",t,n)}).catch(a=>{Ge.error(a,"send analytics failed")})});p(this,"writeCommon",(t,n)=>{this.commonStore.setValue(t,n)});p(this,"onConnect",t=>{this.listeners.add(t),this.connected&&this.listenersCancels.add(t())});p(this,"connectToSDK",t=>{this.onConnect(()=>t.stores.slStreamId.getAtomStore().subscribe(n=>{this.writeCommon("eventId",n)})),this.onConnect(()=>t.sdk.getActiveFeature().subscribe(n=>{n&&this.writeCommon("category",Jk[n]),n!==q.UNSET?this.writeCommon("overlaySessionId",Ca()):this.writeCommon("overlaySessionId","")})),this.onConnect(()=>{const n=window.matchMedia("(orientation: portrait)"),a=s=>{this.writeCommon("screenOrientation",s.matches?La.PORTRAIT:La.LANDSCAPE)};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a)}}),this.onConnect(()=>t.deepLink.$store.subscribe(n=>{n!=null&&n.handled&&this.invitation.accepted()}))});this.listeners=new Set,this.listenersCancels=new Set,this.commonStore=new ut(_e({}),"common-analytics"),this.connectToSDK(t),this.heartbeat=eh({transport:t.analyticsTransport,$commonStore:this.commonStore}),this.notifications=new Xk(this),this.polls=new Zk(this),this.invitation=new Kk(this),this.interactions=new zk(this);const{client:n}=t.analyticsTransport.createPromiseClient(Di,{method:"send"});this.analyticsClient=n}}const nh=(e,t,n)=>{e.analytics=new th(e),e.sdk.onMount({name:"analytics"},()=>(e.analytics.connect(),()=>{e.analytics.disconnect()})),n()};var Ss=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Fa<"u"?Fa:typeof self<"u"?self:{};function ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _s={exports:{}},Es={exports:{}};function sh(e){var t=new e,n=t;function a(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function s(r){n.next=r,n=r}return{get:a,release:s}}var rh=sh,oh=rh;function ji(e,t,n){if(typeof e=="function"&&(n=t,t=e,e=null),!(n>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var a=oh(ih),s=null,r=null,o=0,c=null,l={push:_,drain:ke,saturated:ke,pause:u,paused:!1,get concurrency(){return n},set concurrency(N){if(!(N>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(n=N,!l.paused)for(;s&&o<n;)o++,I()},running:m,resume:T,idle:f,length:d,getQueue:y,unshift:v,empty:ke,kill:E,killAndDrain:R,error:O};return l;function m(){return o}function u(){l.paused=!0}function d(){for(var N=s,L=0;N;)N=N.next,L++;return L}function y(){for(var N=s,L=[];N;)L.push(N.value),N=N.next;return L}function T(){if(l.paused){if(l.paused=!1,s===null){o++,I();return}for(;s&&o<n;)o++,I()}}function f(){return o===0&&l.length()===0}function _(N,L){var A=a.get();A.context=e,A.release=I,A.value=N,A.callback=L||ke,A.errorHandler=c,o>=n||l.paused?r?(r.next=A,r=A):(s=A,r=A,l.saturated()):(o++,t.call(e,A.value,A.worked))}function v(N,L){var A=a.get();A.context=e,A.release=I,A.value=N,A.callback=L||ke,A.errorHandler=c,o>=n||l.paused?s?(A.next=s,s=A):(s=A,r=A,l.saturated()):(o++,t.call(e,A.value,A.worked))}function I(N){N&&a.release(N);var L=s;L&&o<=n?l.paused?o--:(r===s&&(r=null),s=L.next,L.next=null,t.call(e,L.value,L.worked),r===null&&l.empty()):--o===0&&l.drain()}function E(){s=null,r=null,l.drain=ke}function R(){s=null,r=null,l.drain(),l.drain=ke}function O(N){c=N}}function ke(){}function ih(){this.value=null,this.callback=ke,this.next=null,this.release=ke,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var a=e.callback,s=e.errorHandler,r=e.value;e.value=null,e.callback=ke,e.errorHandler&&s(t,r),a.call(e.context,t,n),e.release(e)}}function ch(e,t,n){typeof e=="function"&&(n=t,t=e,e=null);function a(u,d){t.call(this,u).then(function(y){d(null,y)},d)}var s=ji(e,a,n),r=s.push,o=s.unshift;return s.push=c,s.unshift=l,s.drained=m,s;function c(u){var d=new Promise(function(y,T){r(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(ke),d}function l(u){var d=new Promise(function(y,T){o(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(ke),d}function m(){if(s.idle())return new Promise(function(y){y()});var u=s.drain,d=new Promise(function(y){s.drain=function(){u(),y()}});return d}}Es.exports=ji;Es.exports.promise=ch;var $i=Es.exports,bs={exports:{}},At=typeof Reflect=="object"?Reflect:null,Jr=At&&typeof At.apply=="function"?At.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},kn;At&&typeof At.ownKeys=="function"?kn=At.ownKeys:Object.getOwnPropertySymbols?kn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:kn=function(e){return Object.getOwnPropertyNames(e)};function lh(e){console&&console.warn&&console.warn(e)}var Wi=Number.isNaN||function(e){return e!==e};function Y(){Y.init.call(this)}bs.exports=Y;bs.exports.once=ph;Y.EventEmitter=Y;Y.prototype._events=void 0;Y.prototype._eventsCount=0;Y.prototype._maxListeners=void 0;var Xr=10;function Yn(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Y,"defaultMaxListeners",{enumerable:!0,get:function(){return Xr},set:function(e){if(typeof e!="number"||e<0||Wi(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Xr=e}});Y.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Y.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Wi(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Ki(e){return e._maxListeners===void 0?Y.defaultMaxListeners:e._maxListeners}Y.prototype.getMaxListeners=function(){return Ki(this)};Y.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var a=e==="error",s=this._events;if(s!==void 0)a=a&&s.error===void 0;else if(!a)return!1;if(a){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Jr(c,this,t);else for(var l=c.length,m=ec(c,l),n=0;n<l;++n)Jr(m[n],this,t);return!0};function zi(e,t,n,a){var s,r,o;if(Yn(n),r=e._events,r===void 0?(r=e._events=Object.create(null),e._eventsCount=0):(r.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),r=e._events),o=r[t]),o===void 0)o=r[t]=n,++e._eventsCount;else if(typeof o=="function"?o=r[t]=a?[n,o]:[o,n]:a?o.unshift(n):o.push(n),s=Ki(e),s>0&&o.length>s&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,lh(c)}return e}Y.prototype.addListener=function(e,t){return zi(this,e,t,!1)};Y.prototype.on=Y.prototype.addListener;Y.prototype.prependListener=function(e,t){return zi(this,e,t,!0)};function mh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ji(e,t,n){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=mh.bind(a);return s.listener=n,a.wrapFn=s,s}Y.prototype.once=function(e,t){return Yn(t),this.on(e,Ji(this,e,t)),this};Y.prototype.prependOnceListener=function(e,t){return Yn(t),this.prependListener(e,Ji(this,e,t)),this};Y.prototype.removeListener=function(e,t){var n,a,s,r,o;if(Yn(t),a=this._events,a===void 0)return this;if(n=a[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,r=n.length-1;r>=0;r--)if(n[r]===t||n[r].listener===t){o=n[r].listener,s=r;break}if(s<0)return this;s===0?n.shift():uh(n,s),n.length===1&&(a[e]=n[0]),a.removeListener!==void 0&&this.emit("removeListener",e,o||t)}return this};Y.prototype.off=Y.prototype.removeListener;Y.prototype.removeAllListeners=function(e){var t,n,a;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),r;for(a=0;a<s.length;++a)r=s[a],r!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this};function Xi(e,t,n){var a=e._events;if(a===void 0)return[];var s=a[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?dh(s):ec(s,s.length)}Y.prototype.listeners=function(e){return Xi(this,e,!0)};Y.prototype.rawListeners=function(e){return Xi(this,e,!1)};Y.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Zi.call(e,t)};Y.prototype.listenerCount=Zi;function Zi(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Y.prototype.eventNames=function(){return this._eventsCount>0?kn(this._events):[]};function ec(e,t){for(var n=new Array(t),a=0;a<t;++a)n[a]=e[a];return n}function uh(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function dh(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function ph(e,t){return new Promise(function(n,a){function s(o){e.removeListener(t,r),a(o)}function r(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}tc(e,t,r,{once:!0}),t!=="error"&&Th(e,s,{once:!0})})}function Th(e,t,n){typeof e.on=="function"&&tc(e,"error",t,n)}function tc(e,t,n,a){if(typeof e.on=="function")a.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(r){a.once&&e.removeEventListener(t,s),n(r)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var nc=bs.exports,jn={},ac={},sc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(e,t);if(r.value!==a||r.enumerable!==!0)return!1}return!0},yh=sc,$n=function(){return yh()&&!!Symbol.toStringTag},gh=Error,fh=EvalError,kh=RangeError,hh=ReferenceError,rc=SyntaxError,Wn=TypeError,Sh=URIError,Zr=typeof Symbol<"u"&&Symbol,_h=sc,Eh=function(){return typeof Zr!="function"||typeof Symbol!="function"||typeof Zr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_h()},la={__proto__:null,foo:{}},bh=Object,Ih=function(){return{__proto__:la}.foo===la.foo&&!(la instanceof bh)},Nh="Function.prototype.bind called on incompatible ",vh=Object.prototype.toString,Oh=Math.max,Ah="[object Function]",eo=function(e,t){for(var n=[],a=0;a<e.length;a+=1)n[a]=e[a];for(var s=0;s<t.length;s+=1)n[s+e.length]=t[s];return n},wh=function(e,t){for(var n=[],a=t,s=0;a<e.length;a+=1,s+=1)n[s]=e[a];return n},Rh=function(e,t){for(var n="",a=0;a<e.length;a+=1)n+=e[a],a+1<e.length&&(n+=t);return n},Lh=function(e){var t=this;if(typeof t!="function"||vh.apply(t)!==Ah)throw new TypeError(Nh+t);for(var n=wh(arguments,1),a,s=function(){if(this instanceof a){var m=t.apply(this,eo(n,arguments));return Object(m)===m?m:this}return t.apply(e,eo(n,arguments))},r=Oh(0,t.length-n.length),o=[],c=0;c<r;c++)o[c]="$"+c;if(a=Function("binder","return function ("+Rh(o,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var l=function(){};l.prototype=t.prototype,a.prototype=new l,l.prototype=null}return a},Mh=Lh,Is=Function.prototype.bind||Mh,Ph=Function.prototype.call,Ch=Object.prototype.hasOwnProperty,Dh=Is,Uh=Dh.call(Ph,Ch),U,Fh=gh,Gh=fh,Bh=kh,Vh=hh,Mt=rc,wt=Wn,xh=Sh,oc=Function,ma=function(e){try{return oc('"use strict"; return ('+e+").constructor;")()}catch{}},pt=Object.getOwnPropertyDescriptor;if(pt)try{pt({},"")}catch{pt=null}var ua=function(){throw new wt},qh=pt?function(){try{return arguments.callee,ua}catch{try{return pt(arguments,"callee").get}catch{return ua}}}():ua,ht=Eh(),Hh=Ih(),ne=Object.getPrototypeOf||(Hh?function(e){return e.__proto__}:null),_t={},Qh=typeof Uint8Array>"u"||!ne?U:ne(Uint8Array),Tt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":ht&&ne?ne([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":_t,"%AsyncGenerator%":_t,"%AsyncGeneratorFunction%":_t,"%AsyncIteratorPrototype%":_t,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Fh,"%eval%":eval,"%EvalError%":Gh,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":oc,"%GeneratorFunction%":_t,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ht&&ne?ne(ne([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ht||!ne?U:ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Bh,"%ReferenceError%":Vh,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ht||!ne?U:ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ht&&ne?ne(""[Symbol.iterator]()):U,"%Symbol%":ht?Symbol:U,"%SyntaxError%":Mt,"%ThrowTypeError%":qh,"%TypedArray%":Qh,"%TypeError%":wt,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":xh,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet};if(ne)try{null.error}catch(e){var Yh=ne(ne(e));Tt["%Error.prototype%"]=Yh}var jh=function e(t){var n;if(t==="%AsyncFunction%")n=ma("async function () {}");else if(t==="%GeneratorFunction%")n=ma("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ma("async function* () {}");else if(t==="%AsyncGenerator%"){var a=e("%AsyncGeneratorFunction%");a&&(n=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&ne&&(n=ne(s.prototype))}return Tt[t]=n,n},to={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Zt=Is,Ln=Uh,$h=Zt.call(Function.call,Array.prototype.concat),Wh=Zt.call(Function.apply,Array.prototype.splice),no=Zt.call(Function.call,String.prototype.replace),Mn=Zt.call(Function.call,String.prototype.slice),Kh=Zt.call(Function.call,RegExp.prototype.exec),zh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jh=/\\(\\)?/g,Xh=function(e){var t=Mn(e,0,1),n=Mn(e,-1);if(t==="%"&&n!=="%")throw new Mt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Mt("invalid intrinsic syntax, expected opening `%`");var a=[];return no(e,zh,function(s,r,o,c){a[a.length]=o?no(c,Jh,"$1"):r||s}),a},Zh=function(e,t){var n=e,a;if(Ln(to,n)&&(a=to[n],n="%"+a[0]+"%"),Ln(Tt,n)){var s=Tt[n];if(s===_t&&(s=jh(n)),typeof s>"u"&&!t)throw new wt("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Mt("intrinsic "+e+" does not exist!")},en=function(e,t){if(typeof e!="string"||e.length===0)throw new wt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new wt('"allowMissing" argument must be a boolean');if(Kh(/^%?[^%]*%?$/,e)===null)throw new Mt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Xh(e),a=n.length>0?n[0]:"",s=Zh("%"+a+"%",t),r=s.name,o=s.value,c=!1,l=s.alias;l&&(a=l[0],Wh(n,$h([0,1],l)));for(var m=1,u=!0;m<n.length;m+=1){var d=n[m],y=Mn(d,0,1),T=Mn(d,-1);if((y==='"'||y==="'"||y==="`"||T==='"'||T==="'"||T==="`")&&y!==T)throw new Mt("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(c=!0),a+="."+d,r="%"+a+"%",Ln(Tt,r))o=Tt[r];else if(o!=null){if(!(d in o)){if(!t)throw new wt("base intrinsic for "+e+" exists, but the property is not available.");return}if(pt&&m+1>=n.length){var f=pt(o,d);u=!!f,u&&"get"in f&&!("originalValue"in f.get)?o=f.get:o=o[d]}else u=Ln(o,d),o=o[d];u&&!c&&(Tt[r]=o)}}return o},ic={exports:{}},da,ao;function Ns(){if(ao)return da;ao=1;var e=en,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return da=t,da}var eS=en,hn=eS("%Object.getOwnPropertyDescriptor%",!0);if(hn)try{hn([],"length")}catch{hn=null}var Kn=hn,so=Ns(),tS=rc,St=Wn,ro=Kn,nS=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new St("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new St("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new St("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new St("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new St("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new St("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,c=!!ro&&ro(e,t);if(so)so(e,t,{configurable:r===null&&c?c.configurable:!r,enumerable:a===null&&c?c.enumerable:!a,value:n,writable:s===null&&c?c.writable:!s});else if(o||!a&&!s&&!r)e[t]=n;else throw new tS("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Qa=Ns(),cc=function(){return!!Qa};cc.hasArrayLengthDefineBug=function(){if(!Qa)return null;try{return Qa([],"length",{value:1}).length!==1}catch{return!0}};var aS=cc,sS=en,oo=nS,rS=aS(),io=Kn,co=Wn,oS=sS("%Math.floor%"),iS=function(e,t){if(typeof e!="function")throw new co("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||oS(t)!==t)throw new co("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,s=!0;if("length"in e&&io){var r=io(e,"length");r&&!r.configurable&&(a=!1),r&&!r.writable&&(s=!1)}return(a||s||!n)&&(rS?oo(e,"length",t,!0,!0):oo(e,"length",t)),e};(function(e){var t=Is,n=en,a=iS,s=Wn,r=n("%Function.prototype.apply%"),o=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(o,r),l=Ns(),m=n("%Math.max%");e.exports=function(d){if(typeof d!="function")throw new s("a function is required");var y=c(t,o,arguments);return a(y,1+m(0,d.length-(arguments.length-1)),!0)};var u=function(){return c(t,r,arguments)};l?l(e.exports,"apply",{value:u}):e.exports.apply=u})(ic);var vs=ic.exports,lc=en,mc=vs,cS=mc(lc("String.prototype.indexOf")),Os=function(e,t){var n=lc(e,!!t);return typeof n=="function"&&cS(e,".prototype.")>-1?mc(n):n},lS=$n(),mS=Os,Ya=mS("Object.prototype.toString"),zn=function(e){return lS&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Ya(e)==="[object Arguments]"},uc=function(e){return zn(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Ya(e)!=="[object Array]"&&Ya(e.callee)==="[object Function]"},uS=function(){return zn(arguments)}();zn.isLegacyArguments=uc;var dS=uS?zn:uc,pS=Object.prototype.toString,TS=Function.prototype.toString,yS=/^\s*(?:function)?\*/,dc=$n(),pa=Object.getPrototypeOf,gS=function(){if(!dc)return!1;try{return Function("return function*() {}")()}catch{}},Ta,fS=function(e){if(typeof e!="function")return!1;if(yS.test(TS.call(e)))return!0;if(!dc){var t=pS.call(e);return t==="[object GeneratorFunction]"}if(!pa)return!1;if(typeof Ta>"u"){var n=gS();Ta=n?pa(n):!1}return pa(e)===Ta},pc=Function.prototype.toString,Nt=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ja,Sn;if(typeof Nt=="function"&&typeof Object.defineProperty=="function")try{ja=Object.defineProperty({},"length",{get:function(){throw Sn}}),Sn={},Nt(function(){throw 42},null,ja)}catch(e){e!==Sn&&(Nt=null)}else Nt=null;var kS=/^\s*class\b/,$a=function(e){try{var t=pc.call(e);return kS.test(t)}catch{return!1}},ya=function(e){try{return $a(e)?!1:(pc.call(e),!0)}catch{return!1}},_n=Object.prototype.toString,hS="[object Object]",SS="[object Function]",_S="[object GeneratorFunction]",ES="[object HTMLAllCollection]",bS="[object HTML document.all class]",IS="[object HTMLCollection]",NS=typeof Symbol=="function"&&!!Symbol.toStringTag,vS=!(0 in[,]),Wa=function(){return!1};if(typeof document=="object"){var OS=document.all;_n.call(OS)===_n.call(document.all)&&(Wa=function(e){if((vS||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=_n.call(e);return(t===ES||t===bS||t===IS||t===hS)&&e("")==null}catch{}return!1})}var AS=Nt?function(e){if(Wa(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Nt(e,null,ja)}catch(t){if(t!==Sn)return!1}return!$a(e)&&ya(e)}:function(e){if(Wa(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(NS)return ya(e);if($a(e))return!1;var t=_n.call(e);return t!==SS&&t!==_S&&!/^\[object HTML/.test(t)?!1:ya(e)},wS=AS,RS=Object.prototype.toString,Tc=Object.prototype.hasOwnProperty,LS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)Tc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},MS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)n==null?t(e.charAt(a),a,e):t.call(n,e.charAt(a),a,e)},PS=function(e,t,n){for(var a in e)Tc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},CS=function(e,t,n){if(!wS(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=n),RS.call(e)==="[object Array]"?LS(e,t,a):typeof e=="string"?MS(e,t,a):PS(e,t,a)},yc=CS,DS=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ga=DS,US=typeof globalThis>"u"?Ss:globalThis,gc=function(){for(var e=[],t=0;t<ga.length;t++)typeof US[ga[t]]=="function"&&(e[e.length]=ga[t]);return e},Pn=yc,FS=gc,lo=vs,As=Os,En=Kn,GS=As("Object.prototype.toString"),fc=$n(),mo=typeof globalThis>"u"?Ss:globalThis,Ka=FS(),ws=As("String.prototype.slice"),fa=Object.getPrototypeOf,BS=As("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Cn={__proto__:null};fc&&En&&fa?Pn(Ka,function(e){var t=new mo[e];if(Symbol.toStringTag in t){var n=fa(t),a=En(n,Symbol.toStringTag);if(!a){var s=fa(n);a=En(s,Symbol.toStringTag)}Cn["$"+e]=lo(a.get)}}):Pn(Ka,function(e){var t=new mo[e],n=t.slice||t.set;n&&(Cn["$"+e]=lo(n))});var VS=function(e){var t=!1;return Pn(Cn,function(n,a){if(!t)try{"$"+n(e)===a&&(t=ws(a,1))}catch{}}),t},xS=function(e){var t=!1;return Pn(Cn,function(n,a){if(!t)try{n(e),t=ws(a,1)}catch{}}),t},qS=function(e){if(!e||typeof e!="object")return!1;if(!fc){var t=ws(GS(e),8,-1);return BS(Ka,t)>-1?t:t!=="Object"?!1:xS(e)}return En?VS(e):null},Dn=yc,HS=gc,uo=vs,Rs=Os,bn=Kn,QS=Rs("Object.prototype.toString"),kc=$n(),po=typeof globalThis>"u"?Ss:globalThis,za=HS(),Ls=Rs("String.prototype.slice"),ka=Object.getPrototypeOf,YS=Rs("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Un={__proto__:null};kc&&bn&&ka?Dn(za,function(e){var t=new po[e];if(Symbol.toStringTag in t){var n=ka(t),a=bn(n,Symbol.toStringTag);if(!a){var s=ka(n);a=bn(s,Symbol.toStringTag)}Un["$"+e]=uo(a.get)}}):Dn(za,function(e){var t=new po[e],n=t.slice||t.set;n&&(Un["$"+e]=uo(n))});var jS=function(e){var t=!1;return Dn(Un,function(n,a){if(!t)try{"$"+n(e)===a&&(t=Ls(a,1))}catch{}}),t},$S=function(e){var t=!1;return Dn(Un,function(n,a){if(!t)try{n(e),t=Ls(a,1)}catch{}}),t},WS=function(e){if(!e||typeof e!="object")return!1;if(!kc){var t=Ls(QS(e),8,-1);return YS(za,t)>-1?t:t!=="Object"?!1:$S(e)}return bn?jS(e):null},KS=WS,zS=function(e){return!!KS(e)};(function(e){var t=dS,n=fS,a=qS,s=zS;function r(S){return S.call.bind(S)}var o=typeof BigInt<"u",c=typeof Symbol<"u",l=r(Object.prototype.toString),m=r(Number.prototype.valueOf),u=r(String.prototype.valueOf),d=r(Boolean.prototype.valueOf);if(o)var y=r(BigInt.prototype.valueOf);if(c)var T=r(Symbol.prototype.valueOf);function f(S,Nc){if(typeof S!="object")return!1;try{return Nc(S),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=s;function _(S){return typeof Promise<"u"&&S instanceof Promise||S!==null&&typeof S=="object"&&typeof S.then=="function"&&typeof S.catch=="function"}e.isPromise=_;function v(S){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(S):s(S)||k(S)}e.isArrayBufferView=v;function I(S){return a(S)==="Uint8Array"}e.isUint8Array=I;function E(S){return a(S)==="Uint8ClampedArray"}e.isUint8ClampedArray=E;function R(S){return a(S)==="Uint16Array"}e.isUint16Array=R;function O(S){return a(S)==="Uint32Array"}e.isUint32Array=O;function N(S){return a(S)==="Int8Array"}e.isInt8Array=N;function L(S){return a(S)==="Int16Array"}e.isInt16Array=L;function A(S){return a(S)==="Int32Array"}e.isInt32Array=A;function C(S){return a(S)==="Float32Array"}e.isFloat32Array=C;function H(S){return a(S)==="Float64Array"}e.isFloat64Array=H;function te(S){return a(S)==="BigInt64Array"}e.isBigInt64Array=te;function j(S){return a(S)==="BigUint64Array"}e.isBigUint64Array=j;function K(S){return l(S)==="[object Map]"}K.working=typeof Map<"u"&&K(new Map);function x(S){return typeof Map>"u"?!1:K.working?K(S):S instanceof Map}e.isMap=x;function G(S){return l(S)==="[object Set]"}G.working=typeof Set<"u"&&G(new Set);function J(S){return typeof Set>"u"?!1:G.working?G(S):S instanceof Set}e.isSet=J;function Pe(S){return l(S)==="[object WeakMap]"}Pe.working=typeof WeakMap<"u"&&Pe(new WeakMap);function Ft(S){return typeof WeakMap>"u"?!1:Pe.working?Pe(S):S instanceof WeakMap}e.isWeakMap=Ft;function $e(S){return l(S)==="[object WeakSet]"}$e.working=typeof WeakSet<"u"&&$e(new WeakSet);function Te(S){return $e(S)}e.isWeakSet=Te;function ye(S){return l(S)==="[object ArrayBuffer]"}ye.working=typeof ArrayBuffer<"u"&&ye(new ArrayBuffer);function ge(S){return typeof ArrayBuffer>"u"?!1:ye.working?ye(S):S instanceof ArrayBuffer}e.isArrayBuffer=ge;function g(S){return l(S)==="[object DataView]"}g.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&g(new DataView(new ArrayBuffer(1),0,1));function k(S){return typeof DataView>"u"?!1:g.working?g(S):S instanceof DataView}e.isDataView=k;var b=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function M(S){return l(S)==="[object SharedArrayBuffer]"}function $(S){return typeof b>"u"?!1:(typeof M.working>"u"&&(M.working=M(new b)),M.working?M(S):S instanceof b)}e.isSharedArrayBuffer=$;function B(S){return l(S)==="[object AsyncFunction]"}e.isAsyncFunction=B;function D(S){return l(S)==="[object Map Iterator]"}e.isMapIterator=D;function V(S){return l(S)==="[object Set Iterator]"}e.isSetIterator=V;function Q(S){return l(S)==="[object Generator]"}e.isGeneratorObject=Q;function Ee(S){return l(S)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=Ee;function at(S){return f(S,m)}e.isNumberObject=at;function tn(S){return f(S,u)}e.isStringObject=tn;function ft(S){return f(S,d)}e.isBooleanObject=ft;function nn(S){return o&&f(S,y)}e.isBigIntObject=nn;function Cs(S){return c&&f(S,T)}e.isSymbolObject=Cs;function bc(S){return at(S)||tn(S)||ft(S)||nn(S)||Cs(S)}e.isBoxedPrimitive=bc;function Ic(S){return typeof Uint8Array<"u"&&(ge(S)||$(S))}e.isAnyArrayBuffer=Ic,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(S){Object.defineProperty(e,S,{enumerable:!1,value:function(){throw new Error(S+" is not supported in userland")}})})})(ac);var JS=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},Ja={exports:{}};typeof Object.create=="function"?Ja.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ja.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var XS=Ja.exports;(function(e){var t=Object.getOwnPropertyDescriptors||function(g){for(var k=Object.keys(g),b={},M=0;M<k.length;M++)b[k[M]]=Object.getOwnPropertyDescriptor(g,k[M]);return b},n=/%[sdj%]/g;e.format=function(g){if(!N(g)){for(var k=[],b=0;b<arguments.length;b++)k.push(o(arguments[b]));return k.join(" ")}for(var b=1,M=arguments,$=M.length,B=String(g).replace(n,function(Q){if(Q==="%%")return"%";if(b>=$)return Q;switch(Q){case"%s":return String(M[b++]);case"%d":return Number(M[b++]);case"%j":try{return JSON.stringify(M[b++])}catch{return"[Circular]"}default:return Q}}),D=M[b];b<$;D=M[++b])E(D)||!H(D)?B+=" "+D:B+=" "+o(D);return B},e.deprecate=function(g,k){if(typeof P<"u"&&P.noDeprecation===!0)return g;if(typeof P>"u")return function(){return e.deprecate(g,k).apply(this,arguments)};var b=!1;function M(){if(!b){if(P.throwDeprecation)throw new Error(k);P.traceDeprecation?console.trace(k):console.error(k),b=!0}return g.apply(this,arguments)}return M};var a={},s=/^$/;if(P.env.NODE_DEBUG){var r=P.env.NODE_DEBUG;r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+r+"$","i")}e.debuglog=function(g){if(g=g.toUpperCase(),!a[g])if(s.test(g)){var k=P.pid;a[g]=function(){var b=e.format.apply(e,arguments);console.error("%s %d: %s",g,k,b)}}else a[g]=function(){};return a[g]};function o(g,k){var b={seen:[],stylize:l};return arguments.length>=3&&(b.depth=arguments[2]),arguments.length>=4&&(b.colors=arguments[3]),I(k)?b.showHidden=k:k&&e._extend(b,k),A(b.showHidden)&&(b.showHidden=!1),A(b.depth)&&(b.depth=2),A(b.colors)&&(b.colors=!1),A(b.customInspect)&&(b.customInspect=!0),b.colors&&(b.stylize=c),u(b,g,b.depth)}e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(g,k){var b=o.styles[k];return b?"\x1B["+o.colors[b][0]+"m"+g+"\x1B["+o.colors[b][1]+"m":g}function l(g,k){return g}function m(g){var k={};return g.forEach(function(b,M){k[b]=!0}),k}function u(g,k,b){if(g.customInspect&&k&&K(k.inspect)&&k.inspect!==e.inspect&&!(k.constructor&&k.constructor.prototype===k)){var M=k.inspect(b,g);return N(M)||(M=u(g,M,b)),M}var $=d(g,k);if($)return $;var B=Object.keys(k),D=m(B);if(g.showHidden&&(B=Object.getOwnPropertyNames(k)),j(k)&&(B.indexOf("message")>=0||B.indexOf("description")>=0))return y(k);if(B.length===0){if(K(k)){var V=k.name?": "+k.name:"";return g.stylize("[Function"+V+"]","special")}if(C(k))return g.stylize(RegExp.prototype.toString.call(k),"regexp");if(te(k))return g.stylize(Date.prototype.toString.call(k),"date");if(j(k))return y(k)}var Q="",Ee=!1,at=["{","}"];if(v(k)&&(Ee=!0,at=["[","]"]),K(k)){var tn=k.name?": "+k.name:"";Q=" [Function"+tn+"]"}if(C(k)&&(Q=" "+RegExp.prototype.toString.call(k)),te(k)&&(Q=" "+Date.prototype.toUTCString.call(k)),j(k)&&(Q=" "+y(k)),B.length===0&&(!Ee||k.length==0))return at[0]+Q+at[1];if(b<0)return C(k)?g.stylize(RegExp.prototype.toString.call(k),"regexp"):g.stylize("[Object]","special");g.seen.push(k);var ft;return Ee?ft=T(g,k,b,D,B):ft=B.map(function(nn){return f(g,k,b,D,nn,Ee)}),g.seen.pop(),_(ft,Q,at)}function d(g,k){if(A(k))return g.stylize("undefined","undefined");if(N(k)){var b="'"+JSON.stringify(k).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(b,"string")}if(O(k))return g.stylize(""+k,"number");if(I(k))return g.stylize(""+k,"boolean");if(E(k))return g.stylize("null","null")}function y(g){return"["+Error.prototype.toString.call(g)+"]"}function T(g,k,b,M,$){for(var B=[],D=0,V=k.length;D<V;++D)$e(k,String(D))?B.push(f(g,k,b,M,String(D),!0)):B.push("");return $.forEach(function(Q){Q.match(/^\d+$/)||B.push(f(g,k,b,M,Q,!0))}),B}function f(g,k,b,M,$,B){var D,V,Q;if(Q=Object.getOwnPropertyDescriptor(k,$)||{value:k[$]},Q.get?Q.set?V=g.stylize("[Getter/Setter]","special"):V=g.stylize("[Getter]","special"):Q.set&&(V=g.stylize("[Setter]","special")),$e(M,$)||(D="["+$+"]"),V||(g.seen.indexOf(Q.value)<0?(E(b)?V=u(g,Q.value,null):V=u(g,Q.value,b-1),V.indexOf(`
5
5
  `)>-1&&(B?V=V.split(`
6
6
  `).map(function(Ee){return" "+Ee}).join(`
7
7
  `).slice(2):V=`
@@ -14,4 +14,4 @@
14
14
  `),c=`
15
15
  `+n+(r.length?s("│"):" ")+" ";return n+o.join(c)+`
16
16
  `+r.map(function(l,m){var u=m===r.length-1,d=l.nodes&&l.nodes.length,y=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,y,a).slice(n.length+2)}).join("")};const t_=e_,To=Symbol("avvio.TimeTree.untrackNode"),Sa=Symbol("avvio.TimeTree.trackNode"),yo=Symbol("avvio.TimeTree.getParent"),go=Symbol("avvio.TimeTree.getNode"),fo=Symbol("avvio.TimeTree.addNode");let n_=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Sa](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])}[To](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)}[yo](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[go](e){return this.tableId.get(e)}[fo](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Sa](this.root),this.root.id;const a=this[yo](e),s=`${t}-${Math.random()}`,r={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(r),this[Sa](r),s}start(e,t,n=Date.now()){return this[fo](e,t,n)}stop(e,t=Date.now()){const n=this[go](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[To](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 t_(t)}};var a_=n_,Ms={exports:{}},Xa={exports:{}},_a,ko;function s_(){if(ko)return _a;ko=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,r=a*365.25;_a=function(u,d){d=d||{};var y=typeof u;if(y==="string"&&u.length>0)return o(u);if(y==="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 o(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 y=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return y*r;case"weeks":case"week":case"w":return y*s;case"days":case"day":case"d":return y*a;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;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,y,T){var f=d>=y*1.5;return Math.round(u/y)+" "+T+(f?"s":"")}return _a}function r_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=r,n.enable=s,n.enabled=o,n.humanize=s_(),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 y=0;y<u.length;y++)d=(d<<5)-d+u.charCodeAt(y),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,y=null,T,f;function _(...v){if(!_.enabled)return;const I=_,E=Number(new Date),R=E-(d||E);I.diff=R,I.prev=d,I.curr=E,d=E,v[0]=n.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let O=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(N,L)=>{if(N==="%%")return"%";O++;const A=n.formatters[L];if(typeof A=="function"){const C=v[O];N=A.call(I,C),v.splice(O,1),O--}return N}),n.formatArgs.call(I,v),(I.log||n.log).apply(I,v)}return _.namespace=u,_.useColors=n.useColors(),_.color=n.selectColor(u),_.extend=a,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,f=n.enabled(u)),f),set:v=>{y=v}}),typeof n.init=="function"&&n.init(_),_}function a(u,d){const y=n(this.namespace+(typeof d>"u"?":":d)+u);return y.log=this.log,y}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const y=(typeof u=="string"?u:"").split(/[\s,]+/),T=y.length;for(d=0;d<T;d++)y[d]&&(u=y[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function r(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,y;for(d=0,y=n.skips.length;d<y;d++)if(n.skips[d].test(u))return!1;for(d=0,y=n.names.length;d<y;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 o_=r_;(function(e,t){t.formatArgs=a,t.save=s,t.load=r,t.useColors=n,t.storage=o(),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,y=>{y!=="%%"&&(u++,y==="%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 r(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof P<"u"&&"env"in P&&(l=P.env.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=o_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(Xa,Xa.exports);var Sc=Xa.exports;const i_=$i,c_=nc.EventEmitter,l_=jn.inherits,ce=Sc("avvio"),{AVV_ERR_READY_TIMEOUT:m_}=hc,Ea=Symbol.for("plugin-meta");function u_(e,t){return e[Ea]&&e[Ea].name?e[Ea].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 Ut(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=u_(t,n),this.isAfter=a,this.q=i_(e,p_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}l_(Ut,c_);Ut.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){ce("skipping loading of plugin as parent errored and it is not an after",s),P.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return ce("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,ce("exec",s);let r;const o=l=>{if(a){ce("loading complete",s);return}this._error=l,ce(l?"exec errored":"exec completed",s),a=!0,r&&clearTimeout(r),t(l)};this.timeout>0&&(ce("setting up timeout",s,this.timeout),r=setTimeout(function(){ce("timed out",s),r=null;const l=new m_(s);l.fn=n,o(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,o);c&&typeof c.then=="function"&&(ce("exec: resolving promise",s),c.then(()=>P.nextTick(o),l=>P.nextTick(o,l)))};Ut.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(ce("rejecting promise",this.name,n),this._promise.reject(n)):(ce("resolving promise",this.name),this._promise.resolve()),this._promise=null,P.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};Ut.prototype.enqueue=function(e,t){ce("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Ut.prototype.finish=function(e,t){ce("finish",this.name,e);const n=()=>{this.loaded||(ce("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(ce("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{ce("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else ce("delayed",this.name),this.q.drain=()=>{ce("drain",this.name),this.q.drain=T_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function p_(e,t){const n=this;P.nextTick(Ps.bind(n),e,t)}function Ps(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Ps.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 T_(){}Ms.exports=Ut;Ms.exports.loadPlugin=Ps;var y_=Ms.exports;const ho=$i,g_=nc.EventEmitter,f_=jn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:ba,AVV_ERR_CALLBACK_NOT_FN:Yt,AVV_ERR_PLUGIN_NOT_VALID:k_,AVV_ERR_ROOT_PLG_BOOTED:h_,AVV_ERR_READY_TIMEOUT:S_}=hc,__=a_,Za=y_,Pt=Sc("avvio"),Fn=Symbol("kAvvio"),Ia=Symbol("kThenifyDoNotWrap");function E_(e,t,n){const a=t.expose||{},s=a.use||"use",r=a.after||"after",o=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new ba(s);if(e[r])throw new ba(r);if(e[o])throw new ba(o);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:_c.bind(n)}),e[Fn]=!0,e[r]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Na(m,this)),this)},e[o]=function(m){if(m&&typeof m!="function")throw new Yt(o,typeof m);return n.ready(m?Na(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Yt(c,typeof m);return n.onClose(O_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Yt(l,typeof m);return m?(n.close(Na(m,this)),this):n.close()}}function re(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof re)){const a=new re(e,t,n);return e&&E_(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 __,this._readyQ=ho(this,Ec,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=So},this._closeQ=ho(this,v_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=So},this._doStart=null,this._root=new Za(this,b_.bind(this),t,!1,0),this._root.once("start",(a,s,r)=>{const o=this.pluginTree.start(null,s,r);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(o,m)})}),Za.loadPlugin.call(this,this._root,a=>{Pt("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 b_(e,t,n){this._doStart=n,t.autostart&&this.start()}f_(re,g_);re.prototype.start=function(){return this.started=!0,P.nextTick(this._doStart),this};re.prototype.override=function(e,t,n){return e};function I_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new k_(typeof e);return e}re.prototype[Fn]=!0;re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&P.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(re.prototype,"then",{get:_c});re.prototype._addPlugin=function(e,t,n){if(e=I_(e),t=t||{},this.booted)throw new h_;const a=this._current[0],s=new Za(this,e,t,n);if(s.once("start",(r,o,c)=>{const l=this.pluginTree.start(a.name,o,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,r=>{r&&(this._error=r)}),s};re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Ec.call(this,e,s)}return this};re.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Yt("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),P.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Yt("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(r,o,c){r?n(r):t(a),P.nextTick(c)}})};re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function So(){}function _c(){if(this.booted){Pt("thenify returning null because we are already booted");return}if(this[Ia]){this[Ia]=!1;return}return Pt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ia]=!0,e(this._server)),t)}function Ec(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[Fn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),r=>P.nextTick(t,r)):P.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Fn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),r=>P.nextTick(t,r)):P.nextTick(t);else if(this._timeout===0){const r=o=>{this._error=o,t(this._error)};e.length===2?e(a,r):e(a,n,r)}else N_.call(this,e,a,n,t)}function N_(e,t,n,a){const s=e.name;Pt("setting up ready timeout",s,this._timeout);let r=setTimeout(()=>{Pt("timed out",s),r=null;const c=new S_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,o.bind(this)):e(t,n,o.bind(this));function o(c){r&&(clearTimeout(r),this._error=c,a(this._error))}}function v_(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"?(Pt("resolving close/onClose promise"),s.then(()=>P.nextTick(t),r=>P.nextTick(t,r))):P.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function O_(e,t){return n.bind(t);function n(a,s){let r;e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===1?(r=e(this),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e(this,s)}}function Na(e,t){return n.bind(t);function n(a,s){let r;e?e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s,a)},s):P.nextTick(s,a)):e.length===1?(r=e(a),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===2?e(a,s):e(a,this,s):P.nextTick(s)}}_s.exports=re;_s.exports.express=function(e){return re(e,{expose:{use:"load"}})};var A_=_s.exports;const w_=ah(A_);(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(),r=Math.max(0,16-(s-t)),o=window.setTimeout(function(){a(s+r)},r);return t=s+r,o},window.cancelAnimationFrame=clearTimeout}})();function R_(e,t=!0,n=!0,a){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",r=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",o=w_(Object.create({}),{autostart:!1});return o.use(Dk),o.use(Rk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),o.use(Ck,{videoPlayerController:a==null?void 0:a.videoPlayerController}),o.use(Xf,{sdkKey:e,host:s,analyticsHost:r,version:a==null?void 0:a.version}),o.use(ak),o.use(Pk),o.use(Wk),o.use(Sk),o.use(nh),o.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&o.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),o.onClose(()=>{console.log("close")}),o}const L_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:r})=>{const[o,c]=Ds.useState(null);return Ds.useEffect(()=>{let l=!1;if(!e)return console.error("streamlayer sdk key should be provided"),c(u=>(u!==null&&typeof u.disableApp=="function"&&u.disableApp(),null)),()=>{l=!0};const m=R_(e,n,a,{version:"1.1.0",onDeepLinkHandled:s,videoPlayerController:r});if(t)for(const u of t)m.use(u);return m.ready().then(u=>{l||(c(u.sdk),typeof window<"u")}).catch(u=>console.log(u)),()=>{l=!0,m.close(function(u){if(u)throw u})}},[e,n]),o};exports.InvitationFrom=An;exports.PickHistoryStatus=Et;exports.QuestionImages=nt;exports.QuestionStatus=le;exports.QuestionType=F;exports.SdkOverlayType=q;exports.createContextKey=Ua;exports.global=Fa;exports.pino_1=Oo;exports.useStreamLayerApp=L_;
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 Ut(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=u_(t,n),this.isAfter=a,this.q=i_(e,p_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}l_(Ut,c_);Ut.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){ce("skipping loading of plugin as parent errored and it is not an after",s),P.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return ce("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,ce("exec",s);let r;const o=l=>{if(a){ce("loading complete",s);return}this._error=l,ce(l?"exec errored":"exec completed",s),a=!0,r&&clearTimeout(r),t(l)};this.timeout>0&&(ce("setting up timeout",s,this.timeout),r=setTimeout(function(){ce("timed out",s),r=null;const l=new m_(s);l.fn=n,o(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,o);c&&typeof c.then=="function"&&(ce("exec: resolving promise",s),c.then(()=>P.nextTick(o),l=>P.nextTick(o,l)))};Ut.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(ce("rejecting promise",this.name,n),this._promise.reject(n)):(ce("resolving promise",this.name),this._promise.resolve()),this._promise=null,P.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};Ut.prototype.enqueue=function(e,t){ce("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Ut.prototype.finish=function(e,t){ce("finish",this.name,e);const n=()=>{this.loaded||(ce("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(ce("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{ce("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else ce("delayed",this.name),this.q.drain=()=>{ce("drain",this.name),this.q.drain=T_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function p_(e,t){const n=this;P.nextTick(Ps.bind(n),e,t)}function Ps(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Ps.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 T_(){}Ms.exports=Ut;Ms.exports.loadPlugin=Ps;var y_=Ms.exports;const ho=$i,g_=nc.EventEmitter,f_=jn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:ba,AVV_ERR_CALLBACK_NOT_FN:Yt,AVV_ERR_PLUGIN_NOT_VALID:k_,AVV_ERR_ROOT_PLG_BOOTED:h_,AVV_ERR_READY_TIMEOUT:S_}=hc,__=a_,Za=y_,Pt=Sc("avvio"),Fn=Symbol("kAvvio"),Ia=Symbol("kThenifyDoNotWrap");function E_(e,t,n){const a=t.expose||{},s=a.use||"use",r=a.after||"after",o=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new ba(s);if(e[r])throw new ba(r);if(e[o])throw new ba(o);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:_c.bind(n)}),e[Fn]=!0,e[r]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Na(m,this)),this)},e[o]=function(m){if(m&&typeof m!="function")throw new Yt(o,typeof m);return n.ready(m?Na(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Yt(c,typeof m);return n.onClose(O_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Yt(l,typeof m);return m?(n.close(Na(m,this)),this):n.close()}}function re(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof re)){const a=new re(e,t,n);return e&&E_(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 __,this._readyQ=ho(this,Ec,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=So},this._closeQ=ho(this,v_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=So},this._doStart=null,this._root=new Za(this,b_.bind(this),t,!1,0),this._root.once("start",(a,s,r)=>{const o=this.pluginTree.start(null,s,r);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(o,m)})}),Za.loadPlugin.call(this,this._root,a=>{Pt("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 b_(e,t,n){this._doStart=n,t.autostart&&this.start()}f_(re,g_);re.prototype.start=function(){return this.started=!0,P.nextTick(this._doStart),this};re.prototype.override=function(e,t,n){return e};function I_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new k_(typeof e);return e}re.prototype[Fn]=!0;re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&P.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(re.prototype,"then",{get:_c});re.prototype._addPlugin=function(e,t,n){if(e=I_(e),t=t||{},this.booted)throw new h_;const a=this._current[0],s=new Za(this,e,t,n);if(s.once("start",(r,o,c)=>{const l=this.pluginTree.start(a.name,o,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,r=>{r&&(this._error=r)}),s};re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Ec.call(this,e,s)}return this};re.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Yt("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),P.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Yt("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(r,o,c){r?n(r):t(a),P.nextTick(c)}})};re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function So(){}function _c(){if(this.booted){Pt("thenify returning null because we are already booted");return}if(this[Ia]){this[Ia]=!1;return}return Pt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ia]=!0,e(this._server)),t)}function Ec(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[Fn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),r=>P.nextTick(t,r)):P.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Fn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),r=>P.nextTick(t,r)):P.nextTick(t);else if(this._timeout===0){const r=o=>{this._error=o,t(this._error)};e.length===2?e(a,r):e(a,n,r)}else N_.call(this,e,a,n,t)}function N_(e,t,n,a){const s=e.name;Pt("setting up ready timeout",s,this._timeout);let r=setTimeout(()=>{Pt("timed out",s),r=null;const c=new S_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,o.bind(this)):e(t,n,o.bind(this));function o(c){r&&(clearTimeout(r),this._error=c,a(this._error))}}function v_(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"?(Pt("resolving close/onClose promise"),s.then(()=>P.nextTick(t),r=>P.nextTick(t,r))):P.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function O_(e,t){return n.bind(t);function n(a,s){let r;e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===1?(r=e(this),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e(this,s)}}function Na(e,t){return n.bind(t);function n(a,s){let r;e?e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s,a)},s):P.nextTick(s,a)):e.length===1?(r=e(a),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===2?e(a,s):e(a,this,s):P.nextTick(s)}}_s.exports=re;_s.exports.express=function(e){return re(e,{expose:{use:"load"}})};var A_=_s.exports;const w_=ah(A_);(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(),r=Math.max(0,16-(s-t)),o=window.setTimeout(function(){a(s+r)},r);return t=s+r,o},window.cancelAnimationFrame=clearTimeout}})();function R_(e,t=!0,n=!0,a){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",r=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",o=w_(Object.create({}),{autostart:!1});return o.use(Dk),o.use(Rk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),o.use(Ck,{videoPlayerController:a==null?void 0:a.videoPlayerController}),o.use(Xf,{sdkKey:e,host:s,analyticsHost:r,version:a==null?void 0:a.version}),o.use(ak),o.use(Pk),o.use(Wk),o.use(Sk),o.use(nh),o.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&o.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),o.onClose(()=>{console.log("close")}),o}const L_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:r})=>{const[o,c]=Ds.useState(null);return Ds.useEffect(()=>{let l=!1;if(!e)return console.error("streamlayer sdk key should be provided"),c(u=>(u!==null&&typeof u.disableApp=="function"&&u.disableApp(),null)),()=>{l=!0};const m=R_(e,n,a,{version:"1.1.1",onDeepLinkHandled:s,videoPlayerController:r});if(t)for(const u of t)m.use(u);return m.ready().then(u=>{l||(c(u.sdk),typeof window<"u")}).catch(u=>console.log(u)),()=>{l=!0,m.close(function(u){if(u)throw u})}},[e,n]),o};exports.InvitationFrom=An;exports.PickHistoryStatus=Et;exports.QuestionImages=nt;exports.QuestionStatus=le;exports.QuestionType=F;exports.SdkOverlayType=q;exports.createContextKey=Ua;exports.global=Fa;exports.pino_1=Oo;exports.useStreamLayerApp=L_;