@streamlayer/react 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/dist/cjs/masters.js
CHANGED
|
@@ -196,7 +196,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
196
196
|
--header-offset: 76px;
|
|
197
197
|
`}`;const UG="m1ojpy2l",RC=({children:n,style:a})=>w.jsx("div",{className:"StreamLayerSDKTheme",children:w.jsx("div",{className:UG,style:a,children:n})}),FG=({sdk:n,className:a,scrollStore:o,appNode:l,scrollNode:c,responsiveStore:p})=>{const[,f]=mD(n);return w.jsx(B$,{className:a,scrollNode:c,appNode:l,scrollStore:o,feature:f,responsiveStore:p,sdk:n})},VG=({sdk:n,className:a,appNode:o,responsiveStore:l})=>{const c=Ut(n.featuresList.getStore());return c?Array.from(c,p=>{const f=n.getFeature(p);return f?w.jsx($$,{className:a,appNode:o,feature:f,responsiveStore:l,sdk:n},p):null}):null},jG=({sdk:n,overlays:a,children:o})=>{const l=Q.useRef(null),c=Q.useRef(null),[p]=qD(l),[f,y]=QD(l,p),{sdkEnabled:b,sdkReady:C,activeOverlay:_,activateAndLoadOverlay:N,activateEventWithId:L,deactivate:O,isLogged:D}=PG(n);k5(l,{enabled:b,event:"click",listener:YD}),k5(f,{enabled:b,event:"scrollend",listener:KD,useDomNode:!0}),k5(f,{enabled:b,event:"click",listener:ZD,useDomNode:!0});const F=Q.useMemo(()=>({sdk:n}),[n]);return Q.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature.js"))},[]),w.jsx(iC.Provider,{value:F,children:w.jsxs(BO,{ref:l,children:[b&&w.jsx(oz,{ref:c,sdkReady:C,activeOverlay:_,className:Wh,setActiveOverlay:V=>N("",V),scrollToTop:()=>{var V;return(V=f.current)==null?void 0:V.scrollTo(0,0)},responsiveStore:p}),w.jsxs(YS,{className:"sl-hide-on-modal",ref:f,"data-nav":b.toString(),children:[C&&w.jsx(AG,{sdk:n,scrollNode:f,headerNode:c,appNode:l,scrollStore:y,responsiveStore:p}),w.jsx("div",{style:!b||_===Wi?{}:{display:"none"},children:o&&o({activateEventWithId:L,deactivate:O})}),a&&_===tz&&a[_],C&&_===yu&&w.jsx(FG,{scrollStore:y,responsiveStore:p,scrollNode:f,appNode:l,className:Wh,sdk:n}),C&&w.jsx(VG,{responsiveStore:p,appNode:l,className:Wh,sdk:n})]}),b&&!D&&w.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})})},BG=P("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),$G=P("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),zG=()=>It,HG=P(zG())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),GG=P("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),qG=P("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),WG=P("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),QG=({points:n,onClick:a})=>w.jsxs(BG,{className:Wh,onClick:a,children:[w.jsx($G,{children:w.jsx(HG,{name:"icon-trophy"})}),w.jsxs(GG,{children:[w.jsx(qG,{children:"Total points"}),w.jsx(WG,{children:w.jsx(E6,{value:n})})]})]}),YG=({gamification:n})=>{const a=n.userSummary.$store,[o,l]=Q.useState(0);return Q.useEffect(()=>{const c=a.subscribe(p=>{var f;(f=p==null?void 0:p.summary)!=null&&f.points&&l(p.summary.points)});return()=>{c()}},[a]),w.jsx(QG,{points:o,onClick:()=>{n.status.get()===Qc.Suspended&&n.openFeature()}})},KG=({sdk:n})=>{if(!Ut(n.featuresList.getStore()))return null;const a=n.getFeature(yt.GAMES);return a?w.jsx(YG,{gamification:a}):null},ZG=Q.createContext({sdk:null}),XG=()=>Q.useContext(ZG);Q.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature2.js")));let T9=(n=21)=>crypto.getRandomValues(new Uint8Array(n)).reduce((a,o)=>(o&=63,o<36?a+=o.toString(36):o<62?a+=(o-26).toString(36).toUpperCase():o>62?a+="-":a+="_",a),"");var st;(function(n){n[n.Canceled=1]="Canceled",n[n.Unknown=2]="Unknown",n[n.InvalidArgument=3]="InvalidArgument",n[n.DeadlineExceeded=4]="DeadlineExceeded",n[n.NotFound=5]="NotFound",n[n.AlreadyExists=6]="AlreadyExists",n[n.PermissionDenied=7]="PermissionDenied",n[n.ResourceExhausted=8]="ResourceExhausted",n[n.FailedPrecondition=9]="FailedPrecondition",n[n.Aborted=10]="Aborted",n[n.OutOfRange=11]="OutOfRange",n[n.Unimplemented=12]="Unimplemented",n[n.Internal=13]="Internal",n[n.Unavailable=14]="Unavailable",n[n.DataLoss=15]="DataLoss",n[n.Unauthenticated=16]="Unauthenticated"})(st||(st={}));function Ek(n){const a=st[n];return typeof a!="string"?n.toString():a[0].toLowerCase()+a.substring(1).replace(/[A-Z]/g,o=>"_"+o.toLowerCase())}class zt extends Error{constructor(a,o=st.Unknown,l,c,p){super(JG(a,o)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=a,this.code=o,this.metadata=new Headers(l??{}),this.details=c??[],this.cause=p}static from(a,o=st.Unknown){return a instanceof zt?a:a instanceof Error?a.name=="AbortError"?new zt(a.message,st.Canceled):new zt(a.message,o,void 0,void 0,a):new zt(String(a),o,void 0,void 0,a)}static[Symbol.hasInstance](a){return a instanceof Error?Object.getPrototypeOf(a)===zt.prototype?!0:a.name==="ConnectError"&&"code"in a&&typeof a.code=="number"&&"metadata"in a&&"details"in a&&Array.isArray(a.details)&&"rawMessage"in a&&typeof a.rawMessage=="string"&&"cause"in a:!1}findDetails(a){const o="typeName"in a?{findMessage:c=>c===a.typeName?a:void 0}:a,l=[];for(const c of this.details){if("getType"in c){o.findMessage(c.getType().typeName)&&l.push(c);continue}const p=o.findMessage(c.type);if(p)try{l.push(p.fromBinary(c.value))}catch{}}return l}}function JG(n,a){return n.length?`[${Ek(a)}] ${n}`:`[${Ek(a)}]`}function eq(n,a,o){try{const l=$9.dec(n);return a?a.fromBinary(l,o):l}catch(l){throw zt.from(l,st.DataLoss)}}function tq(n,a){const o={};for(const[l,c]of Object.entries(n.methods)){const p=a(Object.assign(Object.assign({},c),{localName:l,service:n}));p!=null&&(o[l]=p)}return o}const _k=1;function Ik(n){let a,o=new Uint8Array(0);function l(c){const p=new Uint8Array(o.length+c.length);p.set(o),p.set(c,o.length),o=p}return new ReadableStream({start(){a=n.getReader()},async pull(c){let p;for(;;){if(p===void 0&&o.byteLength>=5){let b=0;for(let C=1;C<5;C++)b=(b<<8)+o[C];p={flags:o[0],length:b}}if(p!==void 0&&o.byteLength>=p.length+5)break;const y=await a.read();if(y.done)break;l(y.value)}if(p===void 0){if(o.byteLength==0){c.close();return}c.error(new zt("premature end of stream",st.DataLoss));return}const f=o.subarray(5,5+p.length);o=o.subarray(5+p.length),c.enqueue({flags:p.flags,data:f})}})}function Nk(n,a){const o=new Uint8Array(a.length+5);o.set(a,5);const l=new DataView(o.buffer,o.byteOffset,o.byteLength);return l.setUint8(0,n),l.setUint32(1,a.length),o}var nq=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n[Symbol.asyncIterator],o;return a?a.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),o={},l("next"),l("throw"),l("return"),o[Symbol.asyncIterator]=function(){return this},o);function l(p){o[p]=n[p]&&function(f){return new Promise(function(y,b){f=n[p](f),c(y,b,f.done,f.value)})}}function c(p,f,y,b){Promise.resolve(b).then(function(C){p({value:C,done:y})},f)}},d2=function(n){return this instanceof d2?(this.v=n,this):new d2(n)},aq=function(n,a,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=o.apply(n,a||[]),c,p=[];return c={},y("next"),y("throw"),y("return",f),c[Symbol.asyncIterator]=function(){return this},c;function f(O){return function(D){return Promise.resolve(D).then(O,N)}}function y(O,D){l[O]&&(c[O]=function(F){return new Promise(function(V,G){p.push([O,F,V,G])>1||b(O,F)})},D&&(c[O]=D(c[O])))}function b(O,D){try{C(l[O](D))}catch(F){L(p[0][3],F)}}function C(O){O.value instanceof d2?Promise.resolve(O.value.v).then(_,N):L(p[0][2],O)}function _(O){b("next",O)}function N(O){b("throw",O)}function L(O,D){O(D),p.shift(),p.length&&b(p[0][0],p[0][1])}},rq=function(n){var a,o;return a={},l("next"),l("throw",function(c){throw c}),l("return"),a[Symbol.iterator]=function(){return this},a;function l(c,p){a[c]=n[c]?function(f){return(o=!o)?{value:d2(n[c](f)),done:!1}:p?p(f):f}:p}};function oq(n){return aq(this,arguments,function*(){yield d2(yield*rq(nq(n)))})}var LC=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n[Symbol.asyncIterator],o;return a?a.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),o={},l("next"),l("throw"),l("return"),o[Symbol.asyncIterator]=function(){return this},o);function l(p){o[p]=n[p]&&function(f){return new Promise(function(y,b){f=n[p](f),c(y,b,f.done,f.value)})}}function c(p,f,y,b){Promise.resolve(b).then(function(C){p({value:C,done:y})},f)}},gm=function(n){return this instanceof gm?(this.v=n,this):new gm(n)},sq=function(n){var a,o;return a={},l("next"),l("throw",function(c){throw c}),l("return"),a[Symbol.iterator]=function(){return this},a;function l(c,p){a[c]=n[c]?function(f){return(o=!o)?{value:gm(n[c](f)),done:!1}:p?p(f):f}:p}},iq=function(n,a,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=o.apply(n,a||[]),c,p=[];return c={},y("next"),y("throw"),y("return",f),c[Symbol.asyncIterator]=function(){return this},c;function f(O){return function(D){return Promise.resolve(D).then(O,N)}}function y(O,D){l[O]&&(c[O]=function(F){return new Promise(function(V,G){p.push([O,F,V,G])>1||b(O,F)})},D&&(c[O]=D(c[O])))}function b(O,D){try{C(l[O](D))}catch(F){L(p[0][3],F)}}function C(O){O.value instanceof gm?Promise.resolve(O.value.v).then(_,N):L(p[0][2],O)}function _(O){b("next",O)}function N(O){b("throw",O)}function L(O,D){O(D),p.shift(),p.length&&b(p[0][0],p[0][1])}};function Rk(n,a){return tq(n,o=>{switch(o.kind){case je.Unary:return lq(a,n,o);case je.ServerStreaming:return uq(a,n,o);case je.ClientStreaming:return cq(a,n,o);case je.BiDiStreaming:return dq(a,n,o);default:return null}})}function lq(n,a,o){return async function(l,c){var p,f;const y=await n.unary(a,o,c==null?void 0:c.signal,c==null?void 0:c.timeoutMs,c==null?void 0:c.headers,l,c==null?void 0:c.contextValues);return(p=c==null?void 0:c.onHeader)===null||p===void 0||p.call(c,y.header),(f=c==null?void 0:c.onTrailer)===null||f===void 0||f.call(c,y.trailer),y.message}}function uq(n,a,o){return function(l,c){return OC(n.stream(a,o,c==null?void 0:c.signal,c==null?void 0:c.timeoutMs,c==null?void 0:c.headers,oq([l]),c==null?void 0:c.contextValues),c)}}function cq(n,a,o){return async function(l,c){var p,f,y,b,C,_;const N=await n.stream(a,o,c==null?void 0:c.signal,c==null?void 0:c.timeoutMs,c==null?void 0:c.headers,l,c==null?void 0:c.contextValues);(C=c==null?void 0:c.onHeader)===null||C===void 0||C.call(c,N.header);let L,O=0;try{for(var D=!0,F=LC(N.message),V;V=await F.next(),p=V.done,!p;D=!0)b=V.value,D=!1,L=b,O++}catch(G){f={error:G}}finally{try{!D&&!p&&(y=F.return)&&await y.call(F)}finally{if(f)throw f.error}}if(!L)throw new zt("protocol error: missing response message",st.Unimplemented);if(O>1)throw new zt("protocol error: received extra messages for client streaming method",st.Unimplemented);return(_=c==null?void 0:c.onTrailer)===null||_===void 0||_.call(c,N.trailer),L}}function dq(n,a,o){return function(l,c){return OC(n.stream(a,o,c==null?void 0:c.signal,c==null?void 0:c.timeoutMs,c==null?void 0:c.headers,l,c==null?void 0:c.contextValues),c)}}function OC(n,a){const o=function(){return iq(this,arguments,function*(){var l,c;const p=yield gm(n);(l=a==null?void 0:a.onHeader)===null||l===void 0||l.call(a,p.header),yield gm(yield*sq(LC(p.message))),(c=a==null?void 0:a.onTrailer)===null||c===void 0||c.call(a,p.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>o.next()})}}function mq(...n){const a=new AbortController,o=n.filter(c=>c!==void 0).concat(a.signal);for(const c of o){if(c.aborted){l.apply(c);break}c.addEventListener("abort",l)}function l(){a.signal.aborted||a.abort(xC(this));for(const c of o)c.removeEventListener("abort",l)}return a}function fq(n){const a=new AbortController,o=()=>{a.abort(new zt("the operation timed out",st.DeadlineExceeded))};let l;return n!==void 0&&(n<=0?o():l=setTimeout(o,n)),{signal:a.signal,cleanup:()=>clearTimeout(l)}}function xC(n){if(!n.aborted)return;if(n.reason!==void 0)return n.reason;const a=new Error("This operation was aborted");return a.name="AbortError",a}function b9(){return{get(n){return n.id in this?this[n.id]:n.defaultValue},set(n,a){return this[n.id]=a,this},delete(n){return delete this[n.id],this}}}function d6(n,a){return{id:Symbol(a==null?void 0:a.description),defaultValue:n}}const O5=128;function Lk(n){const a=new Headers,o=new TextDecoder().decode(n).split(`\r
|
|
198
198
|
`);for(const l of o){if(l==="")continue;const c=l.indexOf(":");if(c>0){const p=l.substring(0,c).trim(),f=l.substring(c+1).trim();a.append(p,f)}}return a}const pq="Content-Type",hq="Grpc-Timeout",ym="Grpc-Status",AC="Grpc-Message",gq="Grpc-Status-Details-Bin",yq="X-User-Agent",vq="X-Grpc-Web",Tq="application/grpc-web+proto",bq="application/grpc-web+json";class el extends h2{constructor(a){super(),this.code=0,this.message="",this.details=[],S.util.initPartial(a,this)}static fromBinary(a,o){return new el().fromBinary(a,o)}static fromJson(a,o){return new el().fromJson(a,o)}static fromJsonString(a,o){return new el().fromJsonString(a,o)}static equals(a,o){return S.util.equals(el,a,o)}}el.runtime=S;el.typeName="google.rpc.Status";el.fields=S.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:Ks,repeated:!0}]);const kq="0";function PC(n){var a;const o=n.get(gq);if(o!=null){const c=eq(o,el);if(c.code==0)return;const p=new zt(c.message,c.code,n);return p.details=c.details.map(f=>({type:f.typeUrl.substring(f.typeUrl.lastIndexOf("/")+1),value:f.value})),p}const l=n.get(ym);if(l!=null){if(l===kq)return;const c=parseInt(l,10);return c in st?new zt(decodeURIComponent((a=n.get(AC))!==null&&a!==void 0?a:""),c,n):new zt(`invalid grpc-status: ${l}`,st.Internal,n)}}function Ok(n,a,o){const l=typeof a=="string"?a:a.typeName,c=typeof o=="string"?o:o.name;return n.toString().replace(/\/?$/,`/${l}/${c}`)}function MC(n,a){return a instanceof n?a:new n(a)}function Sq(n,a){function o(l){return l.done===!0?l:{done:l.done,value:MC(n,l.value)}}return{[Symbol.asyncIterator](){const l=a[Symbol.asyncIterator](),c={next:()=>l.next().then(o)};return l.throw!==void 0&&(c.throw=p=>l.throw(p).then(o)),l.return!==void 0&&(c.return=p=>l.return(p).then(o)),c}}}function DC(n,a){var o;return(o=a==null?void 0:a.concat().reverse().reduce((l,c)=>c(l),n))!==null&&o!==void 0?o:n}function wq(n){var a;const o=Object.assign({},n);return(a=o.ignoreUnknownFields)!==null&&a!==void 0||(o.ignoreUnknownFields=!0),o}function xk(n,a,o,l){const c=a?Ak(n.I,l):Pk(n.I,o);return{parse:(a?Ak(n.O,l):Pk(n.O,o)).parse,serialize:c.serialize}}function Ak(n,a){return{parse(o){try{return n.fromBinary(o,a)}catch(l){const c=l instanceof Error?l.message:String(l);throw new zt(`parse binary: ${c}`,st.Internal)}},serialize(o){try{return o.toBinary(a)}catch(l){const c=l instanceof Error?l.message:String(l);throw new zt(`serialize binary: ${c}`,st.Internal)}}}}function Pk(n,a){var o,l;const c=(o=a==null?void 0:a.textEncoder)!==null&&o!==void 0?o:new TextEncoder,p=(l=a==null?void 0:a.textDecoder)!==null&&l!==void 0?l:new TextDecoder,f=wq(a);return{parse(y){try{const b=p.decode(y);return n.fromJsonString(b,f)}catch(b){throw zt.from(b,st.InvalidArgument)}},serialize(y){try{const b=y.toJsonString(f);return c.encode(b)}catch(b){throw zt.from(b,st.Internal)}}}}function Cq(n){const a=DC(n.next,n.interceptors),[o,l,c]=UC(n),p=Object.assign(Object.assign({},n.req),{message:MC(n.req.method.I,n.req.message),signal:o});return a(p).then(f=>(c(),f),l)}function Eq(n){const a=DC(n.next,n.interceptors),[o,l,c]=UC(n),p=Object.assign(Object.assign({},n.req),{message:Sq(n.req.method.I,n.req.message),signal:o});let f=!1;return o.addEventListener("abort",function(){var y,b;const C=n.req.message[Symbol.asyncIterator]();f||(y=C.throw)===null||y===void 0||y.call(C,this.reason).catch(()=>{}),(b=C.return)===null||b===void 0||b.call(C).catch(()=>{})}),a(p).then(y=>Object.assign(Object.assign({},y),{message:{[Symbol.asyncIterator](){const b=y.message[Symbol.asyncIterator]();return{next(){return b.next().then(C=>(C.done==!0&&(f=!0,c()),C),l)}}}}}),l)}function UC(n){const{signal:a,cleanup:o}=fq(n.timeoutMs),l=mq(n.signal,a);return[l.signal,function(p){const f=zt.from(a.aborted?xC(a):p);return l.abort(f),o(),Promise.reject(f)},function(){o(),l.abort()}]}function _q(){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 Mk(n,a){const o=PC(n);if(o)throw a.forEach((l,c)=>{o.metadata.append(c,l)}),o;if(!a.has(ym)&&!n.has(ym))throw new zt("protocol error: missing status",st.Internal)}function Dk(n,a,o,l){const c=new Headers(o??{});return c.set(pq,n?Tq:bq),c.set(vq,"1"),c.set(yq,"connect-es/1.5.0"),a!==void 0&&c.set(hq,`${a}m`),c}function Iq(n){switch(n){case 400:return st.Internal;case 401:return st.Unauthenticated;case 403:return st.PermissionDenied;case 404:return st.Unimplemented;case 429:return st.Unavailable;case 502:return st.Unavailable;case 503:return st.Unavailable;case 504:return st.Unavailable;default:return st.Unknown}}function Uk(n,a){var o;if(n>=200&&n<300)return{foundStatus:a.has(ym),headerError:PC(a)};throw new zt(decodeURIComponent((o=a.get(AC))!==null&&o!==void 0?o:`HTTP ${n}`),Iq(n),a)}var Gc=function(n){return this instanceof Gc?(this.v=n,this):new Gc(n)},Nq=function(n,a,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=o.apply(n,a||[]),c,p=[];return c={},y("next"),y("throw"),y("return",f),c[Symbol.asyncIterator]=function(){return this},c;function f(O){return function(D){return Promise.resolve(D).then(O,N)}}function y(O,D){l[O]&&(c[O]=function(F){return new Promise(function(V,G){p.push([O,F,V,G])>1||b(O,F)})},D&&(c[O]=D(c[O])))}function b(O,D){try{C(l[O](D))}catch(F){L(p[0][3],F)}}function C(O){O.value instanceof Gc?Promise.resolve(O.value.v).then(_,N):L(p[0][2],O)}function _(O){b("next",O)}function N(O){b("throw",O)}function L(O,D){O(D),p.shift(),p.length&&b(p[0][0],p[0][1])}};function Fk(n){var a;_q();const o=(a=n.useBinaryFormat)!==null&&a!==void 0?a:!0;return{async unary(l,c,p,f,y,b,C){var _;const{serialize:N,parse:L}=xk(c,o,n.jsonOptions,n.binaryOptions);return f=f===void 0?n.defaultTimeoutMs:f<=0?void 0:f,await Cq({interceptors:n.interceptors,signal:p,timeoutMs:f,req:{stream:!1,service:l,method:c,url:Ok(n.baseUrl,l,c),init:{method:"POST",credentials:(_=n.credentials)!==null&&_!==void 0?_:"same-origin",redirect:"error",mode:"cors"},header:Dk(o,f,y),contextValues:C??b9(),message:b},next:async O=>{var D;const V=await((D=n.fetch)!==null&&D!==void 0?D:globalThis.fetch)(O.url,Object.assign(Object.assign({},O.init),{headers:O.header,signal:O.signal,body:Nk(0,N(O.message))})),{headerError:G}=Uk(V.status,V.headers);if(!V.body)throw G!==void 0?G:"missing response body";const W=Ik(V.body).getReader();let Z,ne;for(;;){const ee=await W.read();if(ee.done)break;const{flags:ue,data:oe}=ee.value;if((ue&_k)===_k)throw new zt("protocol error: received unsupported compressed output",st.Internal);if(ue===O5){if(Z!==void 0)throw"extra trailer";Z=Lk(oe);continue}if(ne!==void 0)throw new zt("extra message",st.Unimplemented);ne=L(oe)}if(Z===void 0)throw G!==void 0?G:new zt("missing trailer",V.headers.has(ym)?st.Unimplemented:st.Unknown);if(Mk(Z,V.headers),ne===void 0)throw new zt("missing message",Z.has(ym)?st.Unimplemented:st.Unknown);return{stream:!1,service:l,method:c,header:V.headers,message:ne,trailer:Z}}})},async stream(l,c,p,f,y,b,C){var _;const{serialize:N,parse:L}=xk(c,o,n.jsonOptions,n.binaryOptions);function O(F,V,G,W,Z,ne){return Nq(this,arguments,function*(){const ue=Ik(F).getReader();if(V){if(!(yield Gc(ue.read())).done)throw"extra data for trailers-only";return yield Gc(void 0)}let oe=!1;for(;;){const Ne=yield Gc(ue.read());if(Ne.done)break;const{flags:Ie,data:Ze}=Ne.value;if((Ie&O5)===O5){if(oe)throw"extra trailer";oe=!0;const Ge=Lk(Ze);Mk(Ge,W),Ge.forEach((Qe,_e)=>G.set(_e,Qe));continue}if(oe)throw"extra message";yield yield Gc(L(Ze))}if("throwIfAborted"in ne&&ne.throwIfAborted(),!oe)throw Z||"missing trailer"})}async function D(F){if(c.kind!=je.ServerStreaming)throw"The fetch API does not support streaming request bodies";const V=await F[Symbol.asyncIterator]().next();if(V.done==!0)throw"missing request message";return Nk(0,N(V.value))}return f=f===void 0?n.defaultTimeoutMs:f<=0?void 0:f,Eq({interceptors:n.interceptors,signal:p,timeoutMs:f,req:{stream:!0,service:l,method:c,url:Ok(n.baseUrl,l,c),init:{method:"POST",credentials:(_=n.credentials)!==null&&_!==void 0?_:"same-origin",redirect:"error",mode:"cors"},header:Dk(o,f,y),contextValues:C??b9(),message:b},next:async F=>{var V;const W=await((V=n.fetch)!==null&&V!==void 0?V:globalThis.fetch)(F.url,Object.assign(Object.assign({},F.init),{headers:F.header,signal:F.signal,body:await D(F.message)})),{foundStatus:Z,headerError:ne}=Uk(W.status,W.headers);if(!W.body)throw ne??"missing response body";const ee=new Headers;return Object.assign(Object.assign({},F),{header:W.headers,trailer:ee,message:O(W.body,Z,ee,W.headers,ne,F.signal)})}})}}}let Rq=()=>({emit(n,...a){let o=this.events[n]||[];for(let l=0,c=o.length;l<c;l++)o[l](...a)},events:{},on(n,a){var o;return(o=this.events[n])!=null&&o.push(a)||(this.events[n]=[a]),()=>{var l;this.events[n]=(l=this.events[n])==null?void 0:l.filter(c=>a!==c)}}});const Vk=({cache:n=new Map,fetcher:a,...o}={})=>{const l=Rq();let c=!0;Hk("visibilitychange",()=>{c=!document.hidden,c&&l.emit(Bk)}),Hk("online",()=>l.emit($k));const p=new Map,f=new Map,y=new Map;let b={};const C=async([G,W],Z,ne,ee)=>{var ue;if(!c)return;const oe=_e=>{Z.key===G&&(Z.set(_e),l.emit(x5,G,_e,!0))},Ne=()=>{oe({...Z.value,...qk,promise:y.get(G)})},{dedupeTime:Ie=4e3,fetcher:Ze}={...ne,...b},Ge=Gk();if(y.has(G)){Z.value.loading||Ne();return}if(!ee){const _e=n.get(G);_e&&Z.value.data!==_e&&oe({data:_e,...hu});const et=f.get(G);if(et&&et+Ie>Ge)return}const Qe=rD();try{const _e=Ze(...W);f.set(G,Ge),y.set(G,_e),Ne();const et=await _e;n.set(G,et),oe({data:et,...hu}),f.set(G,Gk())}catch(_e){(ue=ne.onError)==null||ue.call(ne,_e),oe({data:Z.value.data,error:_e,...hu})}finally{Qe(),y.delete(G)}},_=(G,{fetcher:W=a,...Z}={})=>{const ne=l9({...hu}),ee={...o,...Z,fetcher:W};ne._=FC,ne.invalidate=()=>{const{key:et}=ne;et&&O(et)},ne.mutate=et=>{const{key:ht}=ne;ht&&D(ht,et)};let ue,oe,Ne,Ie,Ze,Ge=[];lD(ne,()=>{const et=!ue;[Ze,ue]=Lq(G),Ie=Ze.subscribe(Se=>{if(Se){const[ct,B]=Se;ne.key=ct,C([ct,B],ne,ee),oe=ct,Ne=B}else ne.key=oe=Ne=void 0,ne.set({...hu})});const ht=Ze.get();ht&&([oe,Ne]=ht,et&&Qe());const{refetchInterval:Rt=0,refetchOnFocus:Wn,refetchOnReconnect:Te}=ee,Pe=()=>{oe&&C([oe,Ne],ne,ee)};Rt>0&&p.set(G,setInterval(Pe,Rt)),Wn&&Ge.push(l.on(Bk,Pe)),Te&&Ge.push(l.on($k,Pe)),Ge.push(l.on(zk,Se=>{oe&&A5(oe,Se)&&C([oe,Ne],ne,ee,!0)}),l.on(x5,(Se,ct,B)=>{oe&&A5(oe,Se)&&ne.value!==ct&&ne.value.data!==ct&&ne.set(B?ct:{data:ct,...hu})}))});const Qe=()=>{oe&&Ne&&C([oe,Ne],ne,ee)},_e=ne.listen;return ne.listen=et=>{const ht=_e(et);return et(ne.value),Qe(),ht},uD(ne,()=>{ne.value={...hu},ue==null||ue(),Ge.forEach(et=>et()),Ge=[],Ie==null||Ie(),clearInterval(p.get(G))}),ne},N=G=>{n.delete(G),f.delete(G)},L=(G,W)=>{for(const Z of n.keys())A5(Z,G)&&W(Z)},O=G=>{L(G,N),l.emit(zk,G)},D=(G,W)=>{L(G,Z=>{W===void 0?N(Z):n.set(Z,W)}),l.emit(x5,G,W)};function F(G){const W=async ne=>{var ee;const ue=b.fetcher??G,oe=[];try{Z.set({error:void 0,data:void 0,mutate:W,...qk});const Ne=await ue({data:ne,invalidate:Ie=>{oe.push(Ie)},getCacheUpdater:(Ie,Ze=!0)=>[Ge=>{D(Ie,Ge),Ze&&oe.push(Ie)},n.get(Ie)]});return Z.setKey("data",Ne),Ne}catch(Ne){(ee=o==null?void 0:o.onError)==null||ee.call(o,Ne),Z.setKey("error",Ne)}finally{Z.setKey("loading",!1),oe.forEach(O)}},Z=l9({mutate:W,...hu});return Z.mutate=W,Z}return[_,F,{__unsafeOverruleSettings:G=>{console.warn("You should only use __unsafeOverruleSettings in test environment"),b=G},invalidateKeys:O,mutateCache:D}]};function jk(n){return typeof n=="string"||typeof n=="number"||n===!0}const Lq=n=>{if(jk(n))return[ku([""+n,[n]]),()=>{}];let a=ku(null),o=[];const l=()=>{o.some(p=>p==null||p===!1)?a.set(null):a.set([o.join(""),o])},c=[];for(let p=0;p<n.length;p++){const f=n[p];jk(f)?o.push(f):c.push(f.subscribe(y=>{o[p]=Oq(f)?f.value&&"data"in f.value?f.key:null:y,l()}))}return l(),[a,()=>c.forEach(p=>p())]};function Oq(n){return n._===FC}const Bk=1,$k=2,zk=3,x5=4,Hk=(n,a)=>{typeof window>"u"||addEventListener(n,a)},A5=(n,a)=>Array.isArray(a)?a.includes(n):typeof a=="function"?a(n):n===a,Gk=()=>new Date().getTime(),FC=Symbol(),qk={loading:!0},hu={loading:!1};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var Wk;(function(n){n.Init="init",n.Ready="ready",n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected",n.Failed="failed",n.Reconnect="reconnect",n.Reconnecting="reconnecting"})(Wk||(Wk={}));st.Unknown,st.Internal,st.DeadlineExceeded,st.ResourceExhausted,st.FailedPrecondition,st.Unavailable,st.DataLoss;p2("grpc:retry");d6(10,{description:"Number of attempts to retry"}),d6(3e4,{description:"Max delay between retries in milliseconds"});const VC=S.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"}]),jC=S.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"}]),_6=S.makeMessageType("streamlayer.sports.Pagination",()=>[{no:1,name:"page",kind:"scalar",T:5},{no:2,name:"page_size",kind:"scalar",T:5}]),BC=S.makeMessageType("streamlayer.sports.Sort",()=>[{no:1,name:"field",kind:"scalar",T:9},{no:2,name:"order",kind:"scalar",T:9}]),I6=S.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}]),$C=S.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}]),N6=S.makeMessageType("streamlayer.sports.EventTime",()=>[{no:1,name:"clock",kind:"scalar",T:9},{no:2,name:"period",kind:"scalar",T:5}]),xq=S.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}]),Su=S.makeMessageType("streamlayer.sports.TeamRecord",()=>[{no:1,name:"wins",kind:"scalar",T:5},{no:2,name:"losses",kind:"scalar",T:5}]),wu=S.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}]),Aq=S.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}]),Pq=S.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}]),Mq=S.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:wu},{no:6,name:"away",kind:"message",T:wu},{no:7,name:"status",kind:"enum",T:S.getEnumType(VC)},{no:8,name:"custom_fields",kind:"message",T:Aq},{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:$C},{no:12,name:"schedule",kind:"message",T:Pq,repeated:!0},{no:13,name:"endless",kind:"enum",T:S.getEnumType(jC)},{no:14,name:"provider_id",kind:"scalar",T:9}]),Jc=S.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:$C},{no:6,name:"event_time",kind:"message",T:N6},{no:7,name:"home_team",kind:"message",T:wu},{no:8,name:"away_team",kind:"message",T:wu},{no:9,name:"status",kind:"enum",T:S.getEnumType(VC)},{no:10,name:"periods",kind:"message",T:xq,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}]),Dq=S.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"}]),Uq=S.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"}]),Qk=S.makeMessageType("streamlayer.sports.baseball.PitcherSummary",()=>[{no:1,name:"statistics",kind:"message",T:zC},{no:2,name:"status",kind:"enum",T:S.getEnumType(Dq)},{no:3,name:"win_rate",kind:"scalar",T:5},{no:4,name:"loss_rate",kind:"scalar",T:5}]),Fq=S.makeMessageType("streamlayer.sports.baseball.Runner",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"jersey_number",kind:"scalar",T:9}]),Vq=S.makeMessageType("streamlayer.sports.baseball.RunnerOnBase",()=>[{no:1,name:"base_number",kind:"enum",T:S.getEnumType(Uq)},{no:2,name:"player",kind:"message",T:Fq}]),jq=S.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}]),Bq=S.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}]),zC=S.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}]),Yk=S.makeMessageType("streamlayer.sports.baseball.BaseballTeamSummary",()=>[{no:1,name:"hitting",kind:"message",T:jq,repeated:!0},{no:2,name:"batting",kind:"message",T:Bq,repeated:!0},{no:3,name:"pitching",kind:"message",T:zC,repeated:!0}]),$q=S.makeMessageType("streamlayer.sports.baseball.BaseballSummary",()=>[{no:1,name:"home_pitcher",kind:"message",T:Qk},{no:2,name:"away_pitcher",kind:"message",T:Qk},{no:3,name:"home_statistics",kind:"message",T:Yk},{no:4,name:"away_statistics",kind:"message",T:Yk}]),zq=S.makeMessageType("streamlayer.sports.baseball.BaseballPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:wu},{no:2,name:"inning",kind:"scalar",T:9},{no:3,name:"play_text",kind:"scalar",T:9},{no:4,name:"detail",kind:"message",T:Hq,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}]),Hq=S.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"}),Gq=S.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:Vq,repeated:!0},{no:7,name:"taken_bases",kind:"scalar",T:5},{no:8,name:"home_team_record",kind:"message",T:Su},{no:9,name:"away_team_record",kind:"message",T:Su}]),qq=S.makeMessageType("streamlayer.sports.baseball.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:zq,repeated:!0}]),Wq=S.makeMessageType("streamlayer.sports.baseball.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:$q}]),Qq=S.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:Yq},{no:11,name:"rank",kind:"message",T:Kq},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),Yq=S.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"}),Kq=S.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"}),Zq=S.makeMessageType("streamlayer.sports.baseball.Standings",()=>[{no:1,name:"standings",kind:"message",T:Qq,repeated:!0}]),Xq=S.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"}]),Jq=S.makeMessageType("streamlayer.sports.basketball.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:Su},{no:9,name:"away_team_record",kind:"message",T:Su}]),Kk=S.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}]),Zk=S.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}]),eW=S.makeMessageType("streamlayer.sports.basketball.BasketballPerformers",()=>[{no:1,name:"category",kind:"enum",T:S.getEnumType(Xq)},{no:2,name:"home_player",kind:"message",T:Zk},{no:3,name:"away_player",kind:"message",T:Zk}]),tW=S.makeMessageType("streamlayer.sports.basketball.BasketballSummary",()=>[{no:1,name:"home_statistics",kind:"message",T:Kk},{no:2,name:"away_statistics",kind:"message",T:Kk}]),nW=S.makeMessageType("streamlayer.sports.basketball.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:tW},{no:2,name:"top_performers",kind:"message",T:eW,repeated:!0},{no:3,name:"last_games",kind:"message",T:HC}]),aW=S.makeMessageType("streamlayer.sports.basketball.BasketballPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:wu},{no:2,name:"event_time",kind:"message",T:N6},{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}]),rW=S.makeMessageType("streamlayer.sports.basketball.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:aW,repeated:!0}]),Xk=S.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}]),oW=S.makeMessageType("streamlayer.sports.basketball.Boxscore",()=>[{no:1,name:"home_players",kind:"message",T:Xk,repeated:!0},{no:2,name:"away_players",kind:"message",T:Xk,repeated:!0}]),sW=S.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:iW},{no:11,name:"rank",kind:"message",T:lW},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),iW=S.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"}),lW=S.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"}),uW=S.makeMessageType("streamlayer.sports.basketball.Standings",()=>[{no:1,name:"standings",kind:"message",T:sW,repeated:!0}]),Jk=S.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}]),eS=S.makeMessageType("streamlayer.sports.basketball.BasketballMatchLineup",()=>[{no:3,name:"start_players",kind:"message",T:Jk,repeated:!0},{no:4,name:"substitutes",kind:"message",T:Jk,repeated:!0}]),cW=S.makeMessageType("streamlayer.sports.basketball.BasketballMatchLineups",()=>[{no:1,name:"home_team",kind:"message",T:eS},{no:2,name:"away_team",kind:"message",T:eS}]),P5=S.makeMessageType("streamlayer.sports.basketball.BasketballLastGame",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:dW}]),dW=S.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"}),HC=S.makeMessageType("streamlayer.sports.basketball.BasketballLastGames",()=>[{no:1,name:"home",kind:"message",T:P5,repeated:!0},{no:2,name:"away",kind:"message",T:P5,repeated:!0},{no:3,name:"head_to_head",kind:"message",T:P5,repeated:!0}]),mW=S.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"}]),GC=S.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"}]),fW=S.makeMessageType("streamlayer.sports.hockey.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:Su},{no:9,name:"away_team_record",kind:"message",T:Su}]),tS=S.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}]),pW=S.makeMessageType("streamlayer.sports.hockey.HockeyPerformers",()=>[{no:1,name:"category",kind:"enum",T:S.getEnumType(mW)},{no:2,name:"home_player",kind:"message",T:tS,repeated:!0},{no:3,name:"away_player",kind:"message",T:tS,repeated:!0}]),nS=S.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}]),hW=S.makeMessageType("streamlayer.sports.hockey.HockeySummary",()=>[{no:1,name:"home_statistics",kind:"message",T:nS},{no:2,name:"away_statistics",kind:"message",T:nS}]),gW=S.makeMessageType("streamlayer.sports.hockey.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:hW},{no:2,name:"top_performers",kind:"message",T:pW,repeated:!0}]),yW=S.makeMessageType("streamlayer.sports.hockey.HockeyPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:wu},{no:2,name:"event_time",kind:"message",T:N6},{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}]),vW=S.makeMessageType("streamlayer.sports.hockey.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:yW,repeated:!0}]),M5=S.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:S.getEnumType(GC)}]),aS=S.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:S.getEnumType(GC)}]),rS=S.makeMessageType("streamlayer.sports.hockey.PlayerScores",()=>[{no:1,name:"skaters",kind:"message",T:M5,repeated:!0},{no:2,name:"goaltender",kind:"message",T:aS},{no:3,name:"forwards",kind:"message",T:M5,repeated:!0},{no:4,name:"defensemen",kind:"message",T:M5,repeated:!0},{no:5,name:"goaltenders",kind:"message",T:aS,repeated:!0}]),TW=S.makeMessageType("streamlayer.sports.hockey.Boxscore",()=>[{no:1,name:"home_players",kind:"message",T:rS},{no:2,name:"away_players",kind:"message",T:rS}]),bW=S.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:kW},{no:11,name:"rank",kind:"message",T:SW},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),kW=S.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"}),SW=S.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"}),wW=S.makeMessageType("streamlayer.sports.hockey.Standings",()=>[{no:1,name:"standings",kind:"message",T:bW,repeated:!0}]),CW=S.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"}]),EW=S.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"}]),_W=S.makeMessageType("streamlayer.sports.soccer.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:Su},{no:9,name:"away_team_record",kind:"message",T:Su}]),ly=S.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}]),IW=S.makeMessageType("streamlayer.sports.soccer.SoccerAttackPerfomer",()=>[{no:1,name:"perfomer",kind:"message",T:ly},{no:2,name:"attack_stats",kind:"message",T:DW}]),NW=S.makeMessageType("streamlayer.sports.soccer.SoccerMidfieldPerformer",()=>[{no:1,name:"perfomer",kind:"message",T:ly},{no:2,name:"midfield_stats",kind:"message",T:UW}]),RW=S.makeMessageType("streamlayer.sports.soccer.SoccerDefensePerfomer",()=>[{no:1,name:"perfomer",kind:"message",T:ly},{no:2,name:"defense_stats",kind:"message",T:FW}]),LW=S.makeMessageType("streamlayer.sports.soccer.SoccerPerformers",()=>[{no:1,name:"category",kind:"enum",T:S.getEnumType(CW)},{no:2,name:"attack_performer",kind:"message",T:IW},{no:3,name:"midfield_performer",kind:"message",T:NW},{no:4,name:"defense_performer",kind:"message",T:RW}]),OW=S.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}]),xW=S.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}]),AW=S.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}]),oS=S.makeMessageType("streamlayer.sports.soccer.SoccerTeamSummary",()=>[{no:1,name:"top_match_stats",kind:"message",T:OW},{no:2,name:"attacking_stats",kind:"message",T:xW},{no:3,name:"defense_stats",kind:"message",T:AW}]),PW=S.makeMessageType("streamlayer.sports.soccer.SoccerSummary",()=>[{no:1,name:"home_statistics",kind:"message",T:oS},{no:2,name:"away_statistics",kind:"message",T:oS},{no:3,name:"perfomers",kind:"message",T:LW}]),MW=S.makeMessageType("streamlayer.sports.soccer.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:PW},{no:2,name:"last_games",kind:"message",T:qC}]),DW=S.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}]),UW=S.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}]),FW=S.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}]),VW=S.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}]),jW=S.makeMessageType("streamlayer.sports.soccer.SoccerMatchFormationMatrix",()=>[{no:1,name:"row_players",kind:"message",T:VW,repeated:!0}]),sS=S.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}]),iS=S.makeMessageType("streamlayer.sports.soccer.SoccerMatchLineup",()=>[{no:1,name:"formation_string",kind:"scalar",T:9},{no:2,name:"formation_matrix",kind:"message",T:jW,repeated:!0},{no:3,name:"start_players",kind:"message",T:sS,repeated:!0},{no:4,name:"substitutes",kind:"message",T:sS,repeated:!0}]),BW=S.makeMessageType("streamlayer.sports.soccer.SoccerMatchLineups",()=>[{no:1,name:"home_team",kind:"message",T:iS},{no:2,name:"away_team",kind:"message",T:iS}]),$W=S.makeMessageType("streamlayer.sports.soccer.SoccerPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:wu},{no:2,name:"event_time",kind:"message",T:N6},{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:S.getEnumType(EW)}]),zW=S.makeMessageType("streamlayer.sports.soccer.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:$W,repeated:!0}]),HW=S.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}]),GW=S.makeMessageType("streamlayer.sports.soccer.Standings",()=>[{no:1,name:"standings",kind:"message",T:HW,repeated:!0}]),D5=S.makeMessageType("streamlayer.sports.soccer.SoccerLastGame",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:qW}]),qW=S.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"}),qC=S.makeMessageType("streamlayer.sports.soccer.SoccerLastGames",()=>[{no:1,name:"home",kind:"message",T:D5,repeated:!0},{no:2,name:"away",kind:"message",T:D5,repeated:!0},{no:3,name:"head_to_head",kind:"message",T:D5,repeated:!0}]),ed=S.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"}]),WW=S.makeMessageType("streamlayer.sports.events.ScheduleAttributes",()=>[{no:1,name:"summary",kind:"message",T:Jc},{no:2,name:"baseball",kind:"message",T:Gq,oneof:"sport"},{no:3,name:"basketball",kind:"message",T:Jq,oneof:"sport"},{no:4,name:"hockey",kind:"message",T:fW,oneof:"sport"},{no:5,name:"soccer",kind:"message",T:_W,oneof:"sport"}]),QW=S.makeMessageType("streamlayer.sports.events.ScheduleResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:S.getEnumType(ed)},{no:3,name:"attributes",kind:"message",T:WW}]),YW=S.makeMessageType("streamlayer.sports.events.ListResponseAttributes",()=>[{no:1,name:"common",kind:"message",T:Mq}]),WC=S.makeMessageType("streamlayer.sports.events.ListResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:YW}]),KW=S.makeMessageType("streamlayer.sports.events.ListRequest",()=>[{no:1,name:"filter",kind:"message",T:ZW},{no:2,name:"pagination",kind:"message",T:_6},{no:3,name:"sort",kind:"message",T:BC},{no:4,name:"ids",kind:"scalar",T:4,repeated:!0},{no:5,name:"organization_id",kind:"scalar",T:9}]),ZW=S.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:S.getEnumType(jC)}],{localName:"ListRequest_Filter"}),XW=S.makeMessageType("streamlayer.sports.events.DemoListRequest",()=>[{no:1,name:"filter",kind:"message",T:JW},{no:2,name:"pagination",kind:"message",T:_6},{no:3,name:"sort",kind:"message",T:BC}]),JW=S.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"}),eQ=S.makeMessageType("streamlayer.sports.events.DemoListResponse",()=>[{no:1,name:"meta",kind:"message",T:I6},{no:2,name:"data",kind:"message",T:WC,repeated:!0}]),tQ=S.makeMessageType("streamlayer.sports.events.ListResponse",()=>[{no:1,name:"meta",kind:"message",T:I6},{no:2,name:"data",kind:"message",T:WC,repeated:!0}]),lS=S.makeMessageType("streamlayer.sports.events.SummaryRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"organization_id",kind:"scalar",T:9}]),uS=S.makeMessageType("streamlayer.sports.events.SummaryResponse",()=>[{no:1,name:"data",kind:"message",T:nQ}]),nQ=S.makeMessageType("streamlayer.sports.events.SummaryResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:S.getEnumType(ed)},{no:3,name:"attributes",kind:"message",T:aQ}],{localName:"SummaryResponse_ResponseData"}),aQ=S.makeMessageType("streamlayer.sports.events.SummaryResponse.ResponseData.SummaryResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:Jc},{no:2,name:"baseball",kind:"message",T:Wq,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:nW,oneof:"sports"},{no:4,name:"hockey",kind:"message",T:gW,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:MW,oneof:"sports"}],{localName:"SummaryResponse_ResponseData_SummaryResponseAttributes"}),rQ=S.makeMessageType("streamlayer.sports.events.AdminSummaryRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"organization_id",kind:"scalar",T:9}]),oQ=S.makeMessageType("streamlayer.sports.events.AdminSummaryResponse",()=>[{no:1,name:"data",kind:"message",T:sQ}]),sQ=S.makeMessageType("streamlayer.sports.events.AdminSummaryResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:iQ}],{localName:"AdminSummaryResponse_ResponseData"}),iQ=S.makeMessageType("streamlayer.sports.events.AdminSummaryResponse.ResponseData.SummaryResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:Jc},{no:2,name:"provider_id",kind:"scalar",T:9}],{localName:"AdminSummaryResponse_ResponseData_SummaryResponseAttributes"}),lQ=S.makeMessageType("streamlayer.sports.events.PlayByPlayRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"pagination",kind:"message",T:_6},{no:3,name:"order",kind:"scalar",T:9}]),uQ=S.makeMessageType("streamlayer.sports.events.PlayByPlayResponse",()=>[{no:1,name:"data",kind:"message",T:cQ},{no:2,name:"meta",kind:"message",T:I6}]),cQ=S.makeMessageType("streamlayer.sports.events.PlayByPlayResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:S.getEnumType(ed)},{no:3,name:"attributes",kind:"message",T:dQ}],{localName:"PlayByPlayResponse_ResponseData"}),dQ=S.makeMessageType("streamlayer.sports.events.PlayByPlayResponse.ResponseData.PlayByPlayResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:Jc},{no:2,name:"baseball",kind:"message",T:qq,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:rW,oneof:"sports"},{no:4,name:"hockey",kind:"message",T:vW,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:zW,oneof:"sports"}],{localName:"PlayByPlayResponse_ResponseData_PlayByPlayResponseAttributes"}),mQ=S.makeMessageType("streamlayer.sports.events.ScheduleRequest",()=>[{no:1,name:"filter",kind:"message",T:fQ},{no:2,name:"pagination",kind:"message",T:_6}]),fQ=S.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"}),pQ=S.makeMessageType("streamlayer.sports.events.ScheduleResponse",()=>[{no:1,name:"data",kind:"message",T:QW,repeated:!0},{no:2,name:"meta",kind:"message",T:I6}]),hQ=S.makeMessageType("streamlayer.sports.events.ScheduleDatesRequest",()=>[{no:1,name:"filter",kind:"message",T:gQ}]),gQ=S.makeMessageType("streamlayer.sports.events.ScheduleDatesRequest.Filter",()=>[{no:2,name:"league",kind:"scalar",T:9}],{localName:"ScheduleDatesRequest_Filter"}),yQ=S.makeMessageType("streamlayer.sports.events.ScheduleDatesResponse",()=>[{no:1,name:"data",kind:"scalar",T:9,repeated:!0}]),vQ=S.makeMessageType("streamlayer.sports.events.BoxscoreRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),TQ=S.makeMessageType("streamlayer.sports.events.BoxscoreResponse",()=>[{no:1,name:"data",kind:"message",T:bQ}]),bQ=S.makeMessageType("streamlayer.sports.events.BoxscoreResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:S.getEnumType(ed)},{no:3,name:"attributes",kind:"message",T:kQ}],{localName:"BoxscoreResponse_ResponseData"}),kQ=S.makeMessageType("streamlayer.sports.events.BoxscoreResponse.ResponseData.BoxscoreResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:Jc},{no:2,name:"basketball",kind:"message",T:oW,oneof:"sports"},{no:3,name:"hockey",kind:"message",T:TW,oneof:"sports"}],{localName:"BoxscoreResponse_ResponseData_BoxscoreResponseAttributes"}),SQ=S.makeMessageType("streamlayer.sports.events.StandingsRequest",()=>[{no:1,name:"league",kind:"scalar",T:9}]),wQ=S.makeMessageType("streamlayer.sports.events.StandingsResponse",()=>[{no:1,name:"data",kind:"message",T:CQ}]),CQ=S.makeMessageType("streamlayer.sports.events.StandingsResponse.ResponseData",()=>[{no:1,name:"type",kind:"enum",T:S.getEnumType(ed)},{no:2,name:"attributes",kind:"message",T:EQ}],{localName:"StandingsResponse_ResponseData"}),EQ=S.makeMessageType("streamlayer.sports.events.StandingsResponse.ResponseData.StandingsResponseAttributes",()=>[{no:2,name:"basketball",kind:"message",T:uW,oneof:"sports"},{no:3,name:"hockey",kind:"message",T:wW,oneof:"sports"},{no:4,name:"baseball",kind:"message",T:Zq,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:GW,oneof:"sports"}],{localName:"StandingsResponse_ResponseData_StandingsResponseAttributes"}),_Q=S.makeMessageType("streamlayer.sports.events.LineupRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),IQ=S.makeMessageType("streamlayer.sports.events.LineupResponse",()=>[{no:1,name:"data",kind:"message",T:NQ}]),NQ=S.makeMessageType("streamlayer.sports.events.LineupResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:S.getEnumType(ed)},{no:3,name:"attributes",kind:"message",T:RQ}],{localName:"LineupResponse_ResponseData"}),RQ=S.makeMessageType("streamlayer.sports.events.LineupResponse.ResponseData.LineupResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:Jc},{no:2,name:"soccer",kind:"message",T:BW,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:cW,oneof:"sports"}],{localName:"LineupResponse_ResponseData_LineupResponseAttributes"}),LQ=S.makeMessageType("streamlayer.sports.events.LastGamesRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),OQ=S.makeMessageType("streamlayer.sports.events.LastGamesResponse",()=>[{no:1,name:"data",kind:"message",T:xQ}]),xQ=S.makeMessageType("streamlayer.sports.events.LastGamesResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:S.getEnumType(ed)},{no:3,name:"attributes",kind:"message",T:AQ}],{localName:"LastGamesResponse_ResponseData"}),AQ=S.makeMessageType("streamlayer.sports.events.LastGamesResponse.ResponseData.LastGamesResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:Jc},{no:2,name:"soccer",kind:"message",T:qC,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:HC,oneof:"sports"}],{localName:"LastGamesResponse_ResponseData_LastGamesResponseAttributes"}),PQ=S.makeMessageType("streamlayer.sports.events.RetrieveEventIdRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),MQ=S.makeMessageType("streamlayer.sports.events.RetrieveEventIdResponse",()=>[{no:1,name:"data",kind:"message",T:DQ}]),DQ=S.makeMessageType("streamlayer.sports.events.RetrieveEventIdResponse.RetrieveEventIdResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4}],{localName:"RetrieveEventIdResponse_RetrieveEventIdResponseData"}),UQ={typeName:"streamlayer.sports.events.Events",methods:{list:{name:"List",I:KW,O:tQ,kind:je.Unary},demoList:{name:"DemoList",I:XW,O:eQ,kind:je.Unary},summary:{name:"Summary",I:lS,O:uS,kind:je.Unary},adminSummary:{name:"AdminSummary",I:rQ,O:oQ,kind:je.Unary},boxscore:{name:"Boxscore",I:vQ,O:TQ,kind:je.Unary},standings:{name:"Standings",I:SQ,O:wQ,kind:je.Unary},playByPlay:{name:"PlayByPlay",I:lQ,O:uQ,kind:je.Unary},schedule:{name:"Schedule",I:mQ,O:pQ,kind:je.Unary},scheduleDates:{name:"ScheduleDates",I:hQ,O:yQ,kind:je.Unary},lineup:{name:"Lineup",I:_Q,O:IQ,kind:je.Unary},retrieveEventId:{name:"RetrieveEventId",I:PQ,O:MQ,kind:je.Unary},lastGames:{name:"LastGames",I:LQ,O:OQ,kind:je.Unary},summarySubscription:{name:"SummarySubscription",I:lS,O:uS,kind:je.ServerStreaming}}},FQ=S.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"}]),VQ=S.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"}]),jQ=S.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"}]),BQ=S.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"}]),$Q=S.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"}]),zQ=S.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"}]),HQ=S.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"}]),GQ=S.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"}]),QC=S.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"}]),qQ=S.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"}]),WQ=S.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"}]),QQ=S.makeMessageType("streamlayer.sdkSettings.client.NotifySettings",()=>[{no:1,name:"allow",kind:"enum",T:S.getEnumType(QC)}]),YQ=S.makeMessageType("streamlayer.sdkSettings.client.SoundSettings",()=>[{no:1,name:"allow",kind:"enum",T:S.getEnumType(QC)}]),U5=S.makeMessageType("streamlayer.sdkSettings.client.ClientSettingsNotifications",()=>[{no:1,name:"notify",kind:"message",T:QQ},{no:2,name:"sound",kind:"message",T:YQ}]),uy=S.makeMessageType("streamlayer.sdkSettings.client.ClientSettings",()=>[{no:1,name:"visible_status",kind:"enum",T:S.getEnumType(FQ)},{no:2,name:"messages_notify",kind:"enum",T:S.getEnumType(VQ)},{no:3,name:"friends_notify",kind:"enum",T:S.getEnumType(jQ)},{no:4,name:"calls_sound",kind:"enum",T:S.getEnumType($Q)},{no:5,name:"messages_sound",kind:"enum",T:S.getEnumType(zQ)},{no:6,name:"friends_sound",kind:"enum",T:S.getEnumType(HQ)},{no:7,name:"twitter_notify",kind:"enum",T:S.getEnumType(BQ)},{no:8,name:"twitter_sound",kind:"enum",T:S.getEnumType(GQ)},{no:9,name:"gamification",kind:"message",T:U5},{no:10,name:"watch_party_invitation",kind:"message",T:U5},{no:11,name:"twitter_question",kind:"message",T:U5}]),KQ=S.makeMessageType("streamlayer.sdkSettings.client.GetRequest",[]),ZQ=S.makeMessageType("streamlayer.sdkSettings.client.GetResponse",()=>[{no:1,name:"data",kind:"message",T:XQ}]),XQ=S.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:uy}],{localName:"GetResponse_GetResponseData"}),JQ=S.makeMessageType("streamlayer.sdkSettings.client.UpdateRequest",()=>[{no:2,name:"settings",kind:"message",T:uy}]),eY=S.makeMessageType("streamlayer.sdkSettings.client.UpdateResponse",()=>[{no:1,name:"data",kind:"message",T:tY}]),tY=S.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:uy}],{localName:"UpdateResponse_UpdateResponseData"}),nY=S.makeMessageType("streamlayer.sdkSettings.client.GetStreamRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),aY=S.makeMessageType("streamlayer.sdkSettings.client.GetStreamResponse",()=>[{no:1,name:"data",kind:"message",T:rY}]),rY=S.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:Bw}],{localName:"GetStreamResponse_GetResponseData"}),oY=S.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationRequest",[]),sY=S.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationResponse",()=>[{no:1,name:"data",kind:"message",T:iY}]),iY=S.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:$w}],{localName:"GetOrganizationResponse_GetResponseData"}),lY=S.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9,opt:!0}]),uY=S.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingResponse",()=>[{no:1,name:"data",kind:"message",T:cY}]),cY=S.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:aD}],{localName:"GetOrganizationAdvertisingResponse_GetOrganizationAdvertisingResponseData"}),dY=S.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:S.getEnumType(qQ)}]),mY=S.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:dY},{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:S.getEnumType(WQ)}]),fY=S.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkRequest",()=>[{no:1,name:"data",kind:"message",T:mY}]),pY=S.makeMessageType("streamlayer.sdkSettings.client.DeepLink",()=>[{no:1,name:"url",kind:"scalar",T:9},{no:2,name:"link_id",kind:"scalar",T:9}]),hY=S.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkResponse",()=>[{no:1,name:"data",kind:"message",T:gY}]),gY=S.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkResponse.GenerateDeepLinkResponseData",()=>[{no:1,name:"attributes",kind:"message",T:pY}],{localName:"GenerateDeepLinkResponse_GenerateDeepLinkResponseData"}),yY=S.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),vY=S.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionRequest",[]),TY=S.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:bY}]),bY=S.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:Bw}],{localName:"StreamSubscriptionResponse_ResponseData"}),kY=S.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:SY}]),SY=S.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:$w}],{localName:"OrganizationSubscriptionResponse_ResponseData"}),g2={typeName:"streamlayer.sdkSettings.client.Client",methods:{get:{name:"Get",I:KQ,O:ZQ,kind:je.Unary},update:{name:"Update",I:JQ,O:eY,kind:je.Unary},getStream:{name:"GetStream",I:nY,O:aY,kind:je.Unary},getOrganization:{name:"GetOrganization",I:oY,O:sY,kind:je.Unary},getOrganizationAdvertising:{name:"GetOrganizationAdvertising",I:lY,O:uY,kind:je.Unary},generateDeepLink:{name:"GenerateDeepLink",I:fY,O:hY,kind:je.Unary},streamSubscription:{name:"StreamSubscription",I:yY,O:TY,kind:je.ServerStreaming},organizationSubscription:{name:"OrganizationSubscription",I:vY,O:kY,kind:je.ServerStreaming}}},wY=S.makeMessageType("streamlayer.users.PublicChatUser",()=>[{no:1,name:"name",kind:"scalar",T:9}]),CY=S.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:wY},{no:7,name:"public_name",kind:"scalar",T:9}]),cy=S.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:CY}]),EY=S.makeMessageType("streamlayer.users.LoginRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"password",kind:"scalar",T:9}]),_Y=S.makeMessageType("streamlayer.users.AuthResponse",()=>[{no:1,name:"meta",kind:"message",T:IY},{no:2,name:"data",kind:"message",T:cy}]),IY=S.makeMessageType("streamlayer.users.AuthResponse.AuthResponseMetadata",()=>[{no:1,name:"jwt",kind:"scalar",T:9},{no:3,name:"getstream",kind:"scalar",T:9}],{localName:"AuthResponse_AuthResponseMetadata"}),NY=S.makeMessageType("streamlayer.users.RegisterRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),RY=S.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}]),LY=S.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:RY}]),OY=S.makeMessageType("streamlayer.users.RequestPasswordRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),xY=S.makeMessageType("streamlayer.users.RequestPasswordResponse",()=>[{no:1,name:"requested",kind:"scalar",T:8},{no:2,name:"uid",kind:"scalar",T:9}]),AY=S.makeMessageType("streamlayer.users.MeRequest",[]),PY=S.makeMessageType("streamlayer.users.MeResponse",()=>[{no:1,name:"data",kind:"message",T:cy}]),MY=S.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"}]),DY=S.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"}]),UY=S.makeMessageType("streamlayer.users.UpdateAvatarResponse",[]),FY=S.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"}]),VY=S.makeMessageType("streamlayer.users.UpdatePublicChatNameResponse",[]),jY=S.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"}]),BY=S.makeMessageType("streamlayer.users.UpdatePublicNameResponse",[]),$Y=S.makeMessageType("streamlayer.users.UpdateMetadataResponse",[]),zY=S.makeMessageType("streamlayer.users.InviteRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"referral",kind:"message",T:HY}]),HY=S.makeMessageType("streamlayer.users.InviteRequest.InviteReferral",()=>[{no:1,name:"watching_game",kind:"scalar",T:9}],{localName:"InviteRequest_InviteReferral"}),GY=S.makeMessageType("streamlayer.users.InviteResponse",[]),qY=S.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}]),WY=S.makeMessageType("streamlayer.users.BypassAuthResponse",()=>[{no:1,name:"meta",kind:"message",T:QY},{no:2,name:"data",kind:"message",T:cy,opt:!0}]),QY=S.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"}),YY=S.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}]),KY=S.makeMessageType("streamlayer.users.GetFriendsResponse",()=>[{no:1,name:"data",kind:"message",T:XY,repeated:!0},{no:2,name:"metadata",kind:"message",T:ZY}]),ZY=S.makeMessageType("streamlayer.users.GetFriendsResponse.ResponseMeta",()=>[{no:1,name:"last_created_at",kind:"scalar",T:9}],{localName:"GetFriendsResponse_ResponseMeta"}),XY=S.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"}),dy={typeName:"streamlayer.users.Users",methods:{login:{name:"Login",I:EY,O:_Y,kind:je.Unary},register:{name:"Register",I:NY,O:LY,kind:je.Unary},requestPassword:{name:"RequestPassword",I:OY,O:xY,kind:je.Unary},me:{name:"Me",I:AY,O:PY,kind:je.Unary},invite:{name:"Invite",I:zY,O:GY,kind:je.Unary},bypassAuth:{name:"BypassAuth",I:qY,O:WY,kind:je.Unary},updateMetadata:{name:"UpdateMetadata",I:MY,O:$Y,kind:je.Unary},updateAvatar:{name:"UpdateAvatar",I:DY,O:UY,kind:je.Unary},updatePublicChatName:{name:"UpdatePublicChatName",I:FY,O:VY,kind:je.Unary},updatePublicName:{name:"UpdatePublicName",I:jY,O:BY,kind:je.Unary},getFriends:{name:"GetFriends",I:YY,O:KY,kind:je.Unary}}};var Hi;(function(n){n.SCHEMA="schema",n.EXTERNAL_TOKEN="eToken",n.TOKEN="token"})(Hi||(Hi={}));class JY extends iz{constructor(){super("user");M(this,"setSchema",o=>{this.write(Hi.SCHEMA,o)});M(this,"getSchema",()=>this.read(Hi.SCHEMA));M(this,"setToken",o=>{this.write(Hi.TOKEN,o)});M(this,"getToken",()=>this.read(Hi.TOKEN));M(this,"setExternalToken",o=>{this.write(Hi.EXTERNAL_TOKEN,o)});M(this,"getExternalToken",()=>this.read(Hi.EXTERNAL_TOKEN));M(this,"removeToken",()=>{this.remove(Hi.TOKEN)})}}var cS;(function(n){n.DISABLED="disabled",n.INITIALIZATION="initialization",n.READY="ready",n.FAILED="failed",n.SUSPENDED="suspended"})(cS||(cS={}));const Xs={typeName:"streamlayer.interactive.feed.Feed",methods:{get:{name:"Get",I:sM,O:iM,kind:je.Unary},subscription:{name:"Subscription",I:dP,O:mP,kind:je.ServerStreaming},votingSubscription:{name:"VotingSubscription",I:pP,O:hP,kind:je.ServerStreaming},questionSubscription:{name:"QuestionSubscription",I:vP,O:TP,kind:je.ServerStreaming},questionByUser:{name:"QuestionByUser",I:SP,O:wP,kind:je.Unary},syncQuestion:{name:"SyncQuestion",I:EP,O:IP,kind:je.Unary},getQuestion:{name:"GetQuestion",I:RP,O:LP,kind:je.Unary},questionDetail:{name:"QuestionDetail",I:xP,O:AP,kind:je.Unary},submitAnswer:{name:"SubmitAnswer",I:MP,O:UP,kind:je.Unary},submitInplay:{name:"SubmitInplay",I:VP,O:BP,kind:je.Unary},skipQuestion:{name:"SkipQuestion",I:$P,O:HP,kind:je.Unary},pickHistory:{name:"PickHistory",I:qP,O:WP,kind:je.Unary},insightHistory:{name:"InsightHistory",I:KP,O:JP,kind:je.Unary},tweetHistory:{name:"TweetHistory",I:tM,O:nM,kind:je.Unary},promotionHistory:{name:"PromotionHistory",I:uM,O:cM,kind:je.Unary},list:{name:"List",I:fM,O:hM,kind:je.Unary},feedSubscription:{name:"FeedSubscription",I:yM,O:vM,kind:je.ServerStreaming}}},eK=S.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"}]),YC=S.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:S.getEnumType(eK)},{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:YC,repeated:!0},{no:6,name:"created_at",kind:"scalar",T:3}]),my=S.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}]),tK=S.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardSummaryItem",()=>[{no:1,name:"summary",kind:"message",T:my},{no:2,name:"percentage",kind:"message",T:nK}]),nK=S.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"}),aK=S.makeMessageType("streamlayer.interactive.leaderboard.ListRequest",()=>[{no:1,name:"pagination",kind:"message",T:S6},{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}]),rK=S.makeMessageType("streamlayer.interactive.leaderboard.ListResponse",()=>[{no:1,name:"data",kind:"message",T:oK,repeated:!0},{no:2,name:"meta",kind:"message",T:sK}]),oK=S.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:my}],{localName:"ListResponse_ListResponseData"}),sK=S.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"}),iK=S.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}]),lK=S.makeMessageType("streamlayer.interactive.leaderboard.SummaryResponse",()=>[{no:1,name:"data",kind:"message",T:uK}]),uK=S.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:tK}],{localName:"SummaryResponse_SummaryResponseData"}),cK=S.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9}]),dK=S.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsResponse",()=>[{no:2,name:"data",kind:"message",T:mK}]),mK=S.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:YC}],{localName:"EventLeaderboardsResponse_EventLeaderboardsResponseData"}),fK=S.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:S6},{no:4,name:"sort",kind:"message",T:sP}]),pK=S.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardResponse",()=>[{no:1,name:"data",kind:"message",T:hK,repeated:!0},{no:2,name:"meta",kind:"message",T:gK}]),hK=S.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:my}],{localName:"EventLeaderboardResponse_ListResponseData"}),gK=S.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"}),KC={typeName:"streamlayer.interactive.leaderboard.Leaderboard",methods:{list:{name:"List",I:aK,O:rK,kind:je.Unary},summary:{name:"Summary",I:iK,O:lK,kind:je.Unary},eventLeaderboards:{name:"EventLeaderboards",I:cK,O:dK,kind:je.Unary},eventLeaderboard:{name:"EventLeaderboard",I:fK,O:pK,kind:je.Unary}}};var dS;(function(n){n.SHOWED="showed"})(dS||(dS={}));var mS;(function(n){n.ALLOWED="allowed",n.DISALLOWED="disallowed"})(mS||(mS={}));var fS;(function(n){n.UNKNOWN="unknown",n.ALREADY_VOTED="already_voted"})(fS||(fS={}));var pS;(function(n){n.ONBOARDING="onboarding",n.ONBOARDING_IO="onboarding_io"})(pS||(pS={}));p2("deep_link");p2("bypass");new JY;p2("video_player");const yK=S.makeMessageType("streamlayer.shortLinks.GenerateRequest",()=>[{no:1,name:"web",kind:"scalar",T:9},{no:2,name:"mobile",kind:"scalar",T:9}]),vK=S.makeMessageType("streamlayer.shortLinks.GenerateResponse",()=>[{no:1,name:"data",kind:"message",T:TK}]),TK=S.makeMessageType("streamlayer.shortLinks.GenerateResponse.GenerateResponseData",()=>[{no:1,name:"link",kind:"scalar",T:9}],{localName:"GenerateResponse_GenerateResponseData"}),bK={typeName:"streamlayer.shortLinks.LinksClient",methods:{generate:{name:"Generate",I:yK,O:vK,kind:je.Unary}}};var hS;(function(n){n.Unset="unset",n.Required="required",n.Optional="optional",n.Completed="completed",n.Disabled="disabled",n.Unavailable="unavailable"})(hS||(hS={}));ke.POLL,ke.PREDICTION,ke.TRIVIA;const kK={[yt.GAMES]:!0},SK=()=>It,wK=P(SK())({name:"ButtonIcon",class:"b11wpe79",propsAsIs:!0});Q.forwardRef(({sdk:n,className:a},o)=>{const l=Ut(n.sdkStore.organizationSettings),c=Ut(n.sdkStore.streamSettings),p=Ut(n.getActiveFeature()),f=Q.useMemo(()=>{const b=(c==null?void 0:c.data)||(l==null?void 0:l.data);return b!=null&&b.overlays?b.overlays:[]},[l,c]),y=Q.useMemo(()=>[...f.filter(({enableSdkButton:b,type:C})=>C===yt.GAMES||b).map(b=>({id:b.type,onClick:()=>n.openFeature(b.type),disabled:!(b.type in kK),label:b.name,icon:w.jsx("img",{src:b.icon,alt:""}),position:b.position*10}))].sort((b,C)=>b.position-C.position),[f,n]);return w.jsxs(IC,{className:a,children:[y.length!==0&&w.jsx(y9,{children:[w.jsx(am,{id:"Channels",onClick:()=>n.closeFeature(),label:"Channels",active:p===0},"Channels"),...y.map(b=>b.id===yt.GAMES?w.jsx(am,{...b,active:b.id===p,label:"StreamLayer +",id:"featuredGroups",icon:w.jsx(wK,{name:"icon-btn-feature-groups","data-selected":b.id===p})},b.id):w.jsx(am,{...b,icon:void 0,active:b.id===p},b.id))]}),!y.length&&w.jsx(y9,{children:[w.jsx(am,{id:"empty",label:"No Features...",active:!1,disabled:!0},"empty")]}),w.jsx("div",{ref:o})]})});const k9=S.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"}]),qs=S.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"}]),S9=S.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"}]),CK=S.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"}]),EK=S.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"}]),gS=S.makeMessageType("streamlayer.analytics.v2.streaming.SendResponse",()=>[{no:1,name:"result",kind:"enum",T:S.getEnumType(iA)}]),_K=S.makeMessageType("streamlayer.analytics.v2.streaming.SendExtra",[]),gr=S.makeMessageType("streamlayer.analytics.v2.streaming.CommonData",()=>[{no:1,name:"event_id",kind:"scalar",T:4,opt:!0},{no:2,name:"category",kind:"enum",T:S.getEnumType(Ma),opt:!0},{no:3,name:"kind",kind:"enum",T:S.getEnumType(va),opt:!0},{no:4,name:"screen_orientation",kind:"enum",T:S.getEnumType(s9),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:S.getEnumType(Ja),opt:!0},{no:9,name:"parent_topic_id",kind:"scalar",T:9,opt:!0},{no:10,name:"parent_topic_type",kind:"enum",T:S.getEnumType(Ja),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:S.getEnumType(zs),opt:!0},{no:15,name:"country",kind:"scalar",T:9,opt:!0}]),IK=S.makeMessageType("streamlayer.analytics.v2.streaming.SendAuthenticationsMessage",()=>[{no:1,name:"common",kind:"message",T:gr}]),NK=S.makeMessageType("streamlayer.analytics.v2.streaming.SendCallsMessage",()=>[{no:1,name:"common",kind:"message",T:gr}]),RK=S.makeMessageType("streamlayer.analytics.v2.streaming.SendConversationsMessage",()=>[{no:1,name:"common",kind:"message",T:gr}]),LK=S.makeMessageType("streamlayer.analytics.v2.streaming.SendInteractionsMessage",()=>[{no:1,name:"common",kind:"message",T:gr},{no:2,name:"action_type",kind:"enum",T:S.getEnumType(k9)}]),OK=S.makeMessageType("streamlayer.analytics.v2.streaming.EventOpenedMessage",()=>[{no:1,name:"common",kind:"message",T:gr}]),xK=S.makeMessageType("streamlayer.analytics.v2.streaming.SendInvitationsMessage",()=>[{no:1,name:"common",kind:"message",T:gr},{no:2,name:"category",kind:"enum",T:S.getEnumType(i9)},{no:3,name:"from",kind:"enum",T:S.getEnumType(u2)}]),AK=S.makeMessageType("streamlayer.analytics.v2.streaming.LaunchButtonMessage",()=>[{no:1,name:"common",kind:"message",T:gr}]),PK=S.makeMessageType("streamlayer.analytics.v2.streaming.NotificationMessage",()=>[{no:1,name:"common",kind:"message",T:gr},{no:2,name:"notification_kind",kind:"enum",T:S.getEnumType(qs)},{no:3,name:"notification_type",kind:"enum",T:S.getEnumType(S9)}]),MK=S.makeMessageType("streamlayer.analytics.v2.streaming.PermissionMessage",()=>[{no:1,name:"common",kind:"message",T:gr},{no:2,name:"permission",kind:"enum",T:S.getEnumType(CK)}]),DK=S.makeMessageType("streamlayer.analytics.v2.streaming.ButtonInitializedMessage",()=>[{no:1,name:"common",kind:"message",T:gr}]),UK=S.makeMessageType("streamlayer.analytics.v2.streaming.WavesMessage",()=>[{no:1,name:"common",kind:"message",T:gr},{no:2,name:"category",kind:"enum",T:S.getEnumType(EK)}]),FK=S.makeMessageType("streamlayer.analytics.v2.streaming.HeartbeatMessage",()=>[{no:1,name:"common",kind:"message",T:gr}]),VK=S.makeMessageType("streamlayer.analytics.v2.streaming.GamesMessage",()=>[{no:1,name:"common",kind:"message",T:gr},{no:2,name:"poll_opened_from",kind:"enum",T:S.getEnumType(Co)}]),jK=S.makeMessageType("streamlayer.analytics.v2.streaming.Login",()=>[{no:1,name:"common",kind:"message",T:gr},{no:2,name:"token",kind:"scalar",T:9}]),BK=S.makeMessageType("streamlayer.analytics.v2.streaming.Logout",()=>[{no:1,name:"common",kind:"message",T:gr}]),yS=S.makeMessageType("streamlayer.analytics.v2.streaming.SendRequest",()=>[{no:1,name:"auth",kind:"message",T:IK,oneof:"message"},{no:2,name:"call",kind:"message",T:NK,oneof:"message"},{no:3,name:"conversations",kind:"message",T:RK,oneof:"message"},{no:4,name:"interactions",kind:"message",T:LK,oneof:"message"},{no:5,name:"event_opened",kind:"message",T:OK,oneof:"message"},{no:6,name:"invitation",kind:"message",T:xK,oneof:"message"},{no:7,name:"launch_button",kind:"message",T:AK,oneof:"message"},{no:8,name:"notification",kind:"message",T:PK,oneof:"message"},{no:9,name:"permission",kind:"message",T:MK,oneof:"message"},{no:10,name:"button_init",kind:"message",T:DK,oneof:"message"},{no:11,name:"waves",kind:"message",T:UK,oneof:"message"},{no:12,name:"heartbeat",kind:"message",T:FK,oneof:"message"},{no:13,name:"games",kind:"message",T:VK,oneof:"message"},{no:14,name:"login",kind:"message",T:jK,oneof:"message"},{no:15,name:"logout",kind:"message",T:BK,oneof:"message"},{no:100,name:"extra",kind:"message",T:_K}]),ZC={typeName:"streamlayer.analytics.v2.streaming.AnalyticsService",methods:{send:{name:"Send",I:yS,O:gS,kind:je.ClientStreaming},unary:{name:"Unary",I:yS,O:gS,kind:je.Unary}}};function $K(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var XC={exports:{}},Vn=XC.exports={},Ws,Qs;function w9(){throw new Error("setTimeout has not been defined")}function C9(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ws=setTimeout:Ws=w9}catch{Ws=w9}try{typeof clearTimeout=="function"?Qs=clearTimeout:Qs=C9}catch{Qs=C9}})();function JC(n){if(Ws===setTimeout)return setTimeout(n,0);if((Ws===w9||!Ws)&&setTimeout)return Ws=setTimeout,setTimeout(n,0);try{return Ws(n,0)}catch{try{return Ws.call(null,n,0)}catch{return Ws.call(this,n,0)}}}function zK(n){if(Qs===clearTimeout)return clearTimeout(n);if((Qs===C9||!Qs)&&clearTimeout)return Qs=clearTimeout,clearTimeout(n);try{return Qs(n)}catch{try{return Qs.call(null,n)}catch{return Qs.call(this,n)}}}var tl=[],dm=!1,qc,Yh=-1;function HK(){!dm||!qc||(dm=!1,qc.length?tl=qc.concat(tl):Yh=-1,tl.length&&eE())}function eE(){if(!dm){var n=JC(HK);dm=!0;for(var a=tl.length;a;){for(qc=tl,tl=[];++Yh<a;)qc&&qc[Yh].run();Yh=-1,a=tl.length}qc=null,dm=!1,zK(n)}}Vn.nextTick=function(n){var a=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)a[o-1]=arguments[o];tl.push(new tE(n,a)),tl.length===1&&!dm&&JC(eE)};function tE(n,a){this.fun=n,this.array=a}tE.prototype.run=function(){this.fun.apply(null,this.array)};Vn.title="browser";Vn.browser=!0;Vn.env={};Vn.argv=[];Vn.version="";Vn.versions={};function ol(){}Vn.on=ol;Vn.addListener=ol;Vn.once=ol;Vn.off=ol;Vn.removeListener=ol;Vn.removeAllListeners=ol;Vn.emit=ol;Vn.prependListener=ol;Vn.prependOnceListener=ol;Vn.listeners=function(n){return[]};Vn.binding=function(n){throw new Error("process.binding is not supported")};Vn.cwd=function(){return"/"};Vn.chdir=function(n){throw new Error("process.chdir is not supported")};Vn.umask=function(){return 0};var GK=XC.exports;const St=$K(GK),qK=aw({level:"trace",enabled:typeof window<"u"&&!!window.localStorage.getItem("SL_DEBUG"),browser:{write:n=>{console.log(n)}}}),Js=(n,a)=>qK.child({name:n},a);class WK extends Event{constructor(o,l){super(o);M(this,"slEventBus");this.slEventBus=l}}const QK=Js("event-bus");class YK{constructor(a="sl-event-bus"){M(this,"name");M(this,"listeners");M(this,"emit",(a,o)=>{const l=new WK(this.name,{...o,type:a});QK.debug(l,"Emitting event"),window.dispatchEvent(l)});M(this,"destroy",()=>{this.listeners.forEach(a=>{window.removeEventListener(this.name,a),this.listeners.delete(a)}),this.listeners.clear()});this.name=a,this.listeners=new Set}listen(a){return window.addEventListener(this.name,a),this.listeners.add(a),()=>{this.off(a)}}off(a){window.removeEventListener(this.name,a),this.listeners.delete(a)}}class KK{}window.slStore=Object.create(null);class R6{constructor(a,o){M(this,"store");M(this,"name");this.store=a,this.name=o}getStore(){return this.store}}const ZK=n=>{const a=Object.keys(n);return dD(a.map(o=>n[o].getStore()),(...o)=>Object.fromEntries(a.map((l,c)=>[l,o[c]])))};class Yc extends R6{constructor(){super(...arguments);M(this,"getValues",()=>this.getStore().get());M(this,"getValue",o=>this.getStore().get()[o]);M(this,"setValue",(o,l)=>this.getStore().setKey(o,l));M(this,"subscribe",(...o)=>this.getStore().subscribe(...o));M(this,"unsubscribe",()=>this.getStore().off())}}const is=n=>l9(n);var Qi;(function(n){n.ORGANIZATION="ORGANIZATION",n.STREAM="STREAM"})(Qi||(Qi={}));const XK={[yt.BETTING]:"betting",[yt.GAMES]:"games",[yt.PUBLIC_CHAT]:"publicChat",[yt.TWITTER]:"twitter"};var o2;(function(n){n.Ready="ready",n.Suspended="suspended"})(o2||(o2={}));class nE{constructor({settings:a,...o},l){M(this,"status");M(this,"source");M(this,"config");M(this,"settings");M(this,"listeners",new Set);M(this,"settingsKey");M(this,"enable",()=>{this.status.set(o2.Ready)});M(this,"disable",()=>{this.status.set(o2.Suspended)});M(this,"setFeatureConfig",({settings:a,...o})=>{var c;let l;for(l in o)this.config.setValue(l,o[l]);if(((c=a==null?void 0:a.overlaySettings)==null?void 0:c.case)!==void 0&&(a==null?void 0:a.overlaySettings.case)===this.settingsKey){const p=a.overlaySettings.value;if(p!==void 0){let f;for(f in p)p[f]!==0&&p[f]!==""&&this.settings.setValue(f,p[f])}}});M(this,"update",(a,o)=>{this.source===Qi.STREAM&&o===Qi.ORGANIZATION||(this.setFeatureConfig(a),this.source=o)});this.settingsKey=XK[o.type],this.status=ku(o2.Suspended),this.config=new Yc(is(o),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&(a==null?void 0:a.overlaySettings.case)===this.settingsKey?this.settings=new Yc(is(a.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new Yc(is({}),`feature:settings:${this.settingsKey}`),this.source=l}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(a){this.listeners.add(a)}fireEvent(a){for(const o of this.listeners.values())try{o.onEvent(a)}catch(l){console.error(l)}}}class _o extends R6{constructor(){super(...arguments);M(this,"getValue",()=>this.getStore().get());M(this,"setValue",o=>this.getStore().set(o));M(this,"subscribe",o=>this.getStore().subscribe(o));M(this,"unsubscribe",()=>this.getStore().off())}getValues(){throw new Error("not implemented")}listen(o){return this.getStore().listen(o)}get(){return this.getStore().get()}}const ba=n=>ku(n);class Zs extends R6{constructor(o,l,c){super(o,`api:${l}`);M(this,"atomStore");M(this,"getAtomStore",()=>this.atomStore);M(this,"getValue",async()=>{const o=this.getStore();if(o.value===void 0)throw new Error("no store");return await o.value.promise,o.get().data});M(this,"getValues",()=>this.getStore().get());M(this,"setValue",o=>this.getStore().set({loading:!1,data:o==null?void 0:o.data}));M(this,"subscribe",o=>this.getStore().subscribe(o));M(this,"unsubscribe",()=>{throw new Error("not implemented")});M(this,"invalidate",()=>{this.store.invalidate()});M(this,"listen",o=>this.getStore().listen(o));M(this,"key",()=>this.getStore().key);M(this,"off",()=>this.getStore().off());this.atomStore=ku(),c&&o.subscribe(p=>{const f=this.atomStore.get(),y=c(p,f);f!==y&&this.atomStore.set(y)})}get(){throw new Error("not implemented")}}const Io=new YK;async function*JK(n,a){for await(const o of a){n.response.message=o,n.received_at=Date.now(),n.id=aE++;const l={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};window.postMessage(l),yield o}}let aE=0;const eZ=()=>n=>async a=>{const o={id:aE++,name:a.url,stream:a.stream,sent_at:Date.now(),request:{header:Object.fromEntries(a.header.entries()),message:a.message},response:{}};window.postMessage({type:"__GRPC_DEVTOOLS_EXTENSION__",data:o});try{const l=await n(a);if(o.received_at=Date.now(),o.response.header=Object.fromEntries(l.header.entries()),o.response.trailer=Object.fromEntries(l.trailer.entries()),a.stream){const c={type:"__GRPC_DEVTOOLS_EXTENSION__",data:{...o,stream:!1}};return window.postMessage(c),{...l,message:JK(o,l.message)}}else{o.response.message=l.message,o.latency=o.received_at-o.sent_at;const c={type:"__GRPC_DEVTOOLS_EXTENSION__",data:o};window.postMessage(c)}return l}catch(l){o.received_at=Date.now(),o.response.trailer={"grpc-status":l.code,"grpc-message":l.rawMessage},o.response.message=l.rawMessage,o.latency=o.received_at-o.sent_at;const c={type:"__GRPC_DEVTOOLS_EXTENSION__",data:o};throw window.postMessage(c),l}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));function rE(n){return n instanceof DOMException&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")}class Em{constructor(a="main",o=window.localStorage){M(this,"delimiter",":");M(this,"prefix");M(this,"storage");M(this,"clear",()=>{for(const a in window.localStorage)a.startsWith(this.prefix)&&this.storage.removeItem(a)});M(this,"generateKey",a=>`${this.prefix}${this.delimiter}${a.join(this.delimiter)}`);M(this,"write",(...a)=>{const o=a.pop()||"",l=this.generateKey(a);try{this.storage.setItem(l,o)}catch(c){rE(c)&&this.storage===window.sessionStorage&&(window.sessionStorage.removeItem("slstreamlogs"),this.storage.setItem(l,o))}});M(this,"read",(...a)=>{const o=this.storage.getItem(this.generateKey(a));return o===null?void 0:o});M(this,"remove",(...a)=>{this.storage.removeItem(this.generateKey(a))});this.prefix=`sl-sdk${this.delimiter}${a}`,this.storage=o}}var os;(function(n){n.Init="init",n.Ready="ready",n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected",n.Failed="failed",n.Reconnect="reconnect",n.Reconnecting="reconnecting"})(os||(os={}));class tZ{constructor(a,o,l,c){M(this,"params");M(this,"streamCancel");M(this,"method");M(this,"options");M(this,"headers");M(this,"listeners");M(this,"state");M(this,"store");M(this,"paramsListener");M(this,"reconnectTimeout");M(this,"attempt",0);M(this,"updateState",a=>{this.state.setValue("status",a),this.state.setValue("ts",new Date),this.addStateLog(`status => ${a}`)});M(this,"addStateLog",a=>{const o=this.state.getStore().get().log,l=`${this.options.name} ${new Date().toISOString()}: ${a}`;if(o.push(l),this.state.setValue("log",o),localStorage.getItem("SL_DEBUG"))try{window.sessionStorage.setItem("slstreamlogs",window.sessionStorage.getItem("slstreamlogs")+`
|
|
199
|
-
`+l)}catch(c){rE(c)&&window.sessionStorage.removeItem("slstreamlogs"),window.sessionStorage.setItem("slstreamlogs",l)}});M(this,"addListener",(a,o)=>this.listeners.has(a)?(this.addStateLog(`listener '${a}' not added, already exists`),()=>{}):(this.listeners.set(a,o),this.addStateLog(`listener '${a}' added`),()=>this.removeListener(a)));M(this,"removeListener",a=>{this.listeners.delete(a),this.addStateLog(`listener '${a}' removed`)});M(this,"connect",()=>{this.updateState(os.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const a="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const o={headers:this.headers.getValues(),signal:this.streamCancel.signal},l=this.method(a,o);for await(const c of l)this.attempt=0,this.onData(c)}catch(o){o instanceof zt&&o.code!=st.Canceled&&this.onStreamError(o)}})(),this.updateState(os.Connected)});M(this,"disconnect",()=>{var a;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(a=this.paramsListener)==null||a.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(os.Disconnected)});M(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(os.Reconnect);const a=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),o=Math.round(a*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(os.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${o}ms`),this.connect(),this.reconnectTimeout=void 0},o)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});M(this,"getStore",()=>{var a;return(a=this.store)==null?void 0:a.getStore()});M(this,"onData",a=>{try{this.addStateLog(`received data => ${JSON.stringify(a)}`),this.store&&this.store.setValue(a);for(const[,o]of this.listeners)o(a);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(o){this.addStateLog(`error process data => ${o}`)}});M(this,"onStreamError",a=>{if(this.addStateLog(`error => ${a?JSON.stringify(a):"undefined"}}`),a!==void 0){if(a instanceof zt&&a.code!==st.Canceled){this.updateState(os.Failed),this.state.setValue("error",a),this.reconnect();return}this.disconnect()}});const p={status:os.Init,ts:new Date,log:[]};this.state=new Yc(is(p),`subscription:${c.name}:state`),this.options={...c,reconnectDelay:c.reconnectDelay??1e3,reconnectMaxDelay:c.reconnectMaxDelay??3e4,reconnectMaxAttempts:c.reconnectMaxAttempts??10,withStore:c.withStore??!1},this.headers=a,this.listeners=new Map,this.params=l,this.method=o,c.withStore&&(this.store=new _o(ba(null),`subscription:${c.name}:store`)),"subscribe"in l&&typeof l.subscribe=="function"&&(this.paramsListener=l.subscribe(f=>{this.state.getValue("status")===os.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(f)}`),this.reconnect())})),this.updateState(os.Ready)}}const nZ=new Set([st.Unknown,st.Internal,st.DeadlineExceeded,st.ResourceExhausted,st.FailedPrecondition,st.Unavailable,st.DataLoss]),vS=Js("grpc:retry"),aZ=n=>async a=>{const o=a.contextValues.get(E9.retryAttempts),l=300,c=a.contextValues.get(E9.retryDelay);if(a.stream||o===0)return n(a);vS.trace({url:a.url,attempts:o,maxDelay:c},"retry options");for(let p=0;;p++)try{return await n(a)}catch(f){vS.trace({attempt:p,error:f},"retry attempt");const y=zt.from(f);if(p>=o||!(y instanceof zt)||!nZ.has(y.code))throw f;const b=Math.min(c,Math.pow(2,p)*l),C=Math.round(b*(1+Math.random())/2);await new Promise(_=>setTimeout(_,C))}},E9={retryAttempts:d6(10,{description:"Number of attempts to retry"}),retryDelay:d6(3e4,{description:"Max delay between retries in milliseconds"})},rZ=()=>{const n=localStorage.getItem("sl-device-id");if(n)return n;const a=T9();return localStorage.setItem("sl-device-id",a),a},oZ=()=>{var n;return((n=navigator.userAgentData)==null?void 0:n.platform)||navigator.platform};class TS{constructor(a,o){M(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});M(this,"transport");M(this,"streamTransport");M(this,"nanoquery");M(this,"host");M(this,"$headers");M(this,"interceptors",[]);M(this,"clients");M(this,"streamClients");M(this,"subscriptions");M(this,"opts");M(this,"addSubscription",(a,o,l)=>{const c=this.subscriptions.get(o);if(c)return c;const p=new tZ(this.$headers,a,o,l);return this.subscriptions.set(o,p),p});M(this,"removeSubscription",a=>{a.disconnect(),this.subscriptions.delete(a.params)});M(this,"disconnect",()=>{var c,p;for(const[f,y]of this.subscriptions)y.disconnect(),this.subscriptions.delete(f);this.clients.clear(),this.streamClients.clear(),this.subscriptions.clear();const[a,o,l]=Vk({dedupeTime:(c=this.opts)==null?void 0:c.dedupeTime,refetchInterval:(p=this.opts)==null?void 0:p.refetchInterval});this.nanoquery={createFetcherStore:a,createMutatorStore:o,utils:l}});M(this,"registerInterceptor",a=>{this.interceptors.push(a)});M(this,"removeInterceptor",a=>{this.interceptors=this.interceptors.filter(o=>o!==a)});M(this,"getClient",a=>{const o=a.typeName;if(this.clients.has(o))return this.clients.get(o);const l=Rk(a,this.transport);return this.clients.set(o,l),l});M(this,"getStreamClient",a=>{const o=`stream-${a.typeName}`;if(this.clients.has(o))return this.clients.get(o);const l=Rk(a,this.streamTransport);return this.clients.set(o,l),l});M(this,"createPromiseClient",(a,{params:o=[],method:l})=>{const c=this.getClient(a),p=a.methods[l].name,f=[a.typeName,p.charAt(0).toLowerCase()+p.slice(1),...Array.isArray(o)?o:[o]],y=[a.typeName,p.charAt(0).toLowerCase()+p.slice(1)];return{client:c,createRequestOptions:b=>{const C=b9();for(const _ in b){const N=E9[_];C.set(N,b[_])}return C},queryKey:f,queryKeyStr:y.join("")}});M(this,"createStreamClient",a=>({client:this.getStreamClient(a)}));M(this,"setSdkKey",a=>{this.$headers.setValue("sdk",a)});M(this,"setAuth",(a,o)=>{this.$headers.setValue("authorization",a),this.$headers.setValue("sl-user-id",o)});M(this,"setHeader",(a,o)=>this.$headers.setValue(a,o));M(this,"getHeader",a=>this.$headers.getValue(a));M(this,"getHeaders",()=>this.$headers.getValues());M(this,"initInterceptors",()=>{var o;if(this.interceptors.length!==0)return;const a=l=>c=>{const p=this.$headers.getValues();for(const f in p)c.header.set(f,p[f]);return l(c)};this.interceptors.push(a),this.interceptors.push(eZ()),(o=this.opts)!=null&&o.retryable&&this.interceptors.push(aZ)});this.host=a,this.opts=o,this.$headers=new Yc(is({"sl-device-id":rZ(),"sl-device-os":oZ()}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.streamClients=new Map,this.subscriptions=new Map;const[l,c,p]=Vk({dedupeTime:o==null?void 0:o.dedupeTime,refetchInterval:o==null?void 0:o.refetchInterval});this.nanoquery={createFetcherStore:l,createMutatorStore:c,utils:p},this.transport=Fk({baseUrl:a,defaultTimeoutMs:1e4,interceptors:this.interceptors}),this.streamTransport=Fk({baseUrl:a,interceptors:this.interceptors})}}const sZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(UQ,{method:"retrieveEventId",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;if(!f||typeof f!="string")return"";try{return((y=(await o.retrieveEventId({id:f})).data)==null?void 0:y.id)||""}catch{return""}}})},iZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"getStream",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;return f?(y=(await o.getStream({id:f})).data)==null?void 0:y.attributes:void 0}})},lZ=(n,a)=>{const{queryKey:o,client:l}=a.createPromiseClient(dy,{method:"me",params:[n]});return a.nanoquery.createFetcherStore(o,{fetcher:async()=>{const{data:c}=await l.me({});return{data:c}}})},uZ=n=>{const{client:a,createRequestOptions:o}=n.createPromiseClient(dy,{method:"bypassAuth"}),l=o({retryAttempts:0});return({userKey:c,schema:p,init:f,inviterKey:y})=>a.bypassAuth({userKey:c,schema:p,init:f,inviterKey:y},{contextValues:l})},cZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async()=>{var c;return(c=(await o.get({})).data)==null?void 0:c.attributes}})},dZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"getOrganization",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async()=>{const c=await o.getOrganization({});return c.data?{...c.data.attributes,id:c.data.id}:void 0}})},mZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"getOrganizationAdvertising",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async()=>{var c;return(c=(await o.getOrganizationAdvertising({})).data)==null?void 0:c.attributes}})},fZ=(n,a,o)=>{n.transport=new TS(a.host,{dedupeTime:1e3*60*5,refetchInterval:1e3*60*5,retryable:!0}),n.analyticsTransport=new TS(a.analyticsHost),n.sdk.host=n.transport.host,n.transport.setSdkKey(a.sdkKey),n.transport.setHeader("sl-sdk-version",a.version||"-"),n.transport.$headers.subscribe(l=>{n.analyticsTransport.$headers.getStore().set(l)}),n.sdk.onMount({name:"transport"},()=>()=>{n.transport.disconnect(),n.analyticsTransport.disconnect()}),o()};var Gi;(function(n){n.SCHEMA="schema",n.EXTERNAL_TOKEN="eToken",n.TOKEN="token"})(Gi||(Gi={}));class rm extends Em{constructor(){super("user");M(this,"setSchema",o=>{this.write(Gi.SCHEMA,o)});M(this,"getSchema",()=>this.read(Gi.SCHEMA));M(this,"setToken",o=>{this.write(Gi.TOKEN,o)});M(this,"getToken",()=>this.read(Gi.TOKEN));M(this,"setExternalToken",o=>{this.write(Gi.EXTERNAL_TOKEN,o)});M(this,"getExternalToken",()=>this.read(Gi.EXTERNAL_TOKEN));M(this,"removeToken",()=>{this.remove(Gi.TOKEN)})}}var Yi;(function(n){n.DISABLED="disabled",n.INITIALIZATION="initialization",n.READY="ready",n.FAILED="failed",n.SUSPENDED="suspended"})(Yi||(Yi={}));const pZ=n=>{const a=new rm,o=new _o(ba(a.getExternalToken()),"userKey"),l=new _o(ba(a.getToken()),"userToken"),c=new Zs(lZ(l.getStore(),n),"user",({data:f,error:y,loading:b},C)=>{var _;if(!y)return(_=f==null?void 0:f.data)!=null&&_.id?f.data.id:b===!1?void 0:C}),p=new Zs(cZ(l.getStore(),n),"userSettings");return{userKey:o,userToken:l,user:c,userSettings:p}},hZ=n=>{const a=new _o(ba(void 0),"providerStreamId"),o=new Zs(sZ(a.getStore(),n),"slStreamId",c=>c==null?void 0:c.data),l=new Zs(iZ(o.getAtomStore(),n),"streamSettings");return o.getAtomStore().listen(c=>{(c===""||c===void 0)&&l.getStore().mutate(void 0)}),{providerStreamId:a,slStreamId:o,streamSettings:l}},gZ=n=>{const a=new _o(ba(void 0),"enabled"),o=new _o(ba(Yi.DISABLED),"status"),l=new Zs(dZ(a.getStore(),n),"organizationSettings",y=>{var b;return(b=y==null?void 0:y.data)==null?void 0:b.id}),c=new Zs(mZ(l.getAtomStore(),n),"organizationAdvertising"),p=pZ(n),f=hZ(n);return{enabled:a,status:o,providerStreamId:f.providerStreamId,slStreamId:f.slStreamId,streamSettings:f.streamSettings,user:p.user,userKey:p.userKey,userToken:p.userToken,userSettings:p.userSettings,organizationSettings:l,organizationAdvertising:c}};class yZ extends R6{constructor(o){const l=gZ(o),c=ZK(l);super(c,"core");M(this,"stores");M(this,"subscribe",o=>{let l;for(l in this.stores){const c=o[l];l in o&&c!==void 0&&this.stores[l].subscribe(o[l])}});M(this,"unsubscribe",()=>this.getStore().off());this.stores=l}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}const vZ=(n,a,o)=>{n.store=new yZ(n.transport),n.stores=n.store.getValues(),n.sdk.enabled=n.stores.enabled.getStore(),n.sdk.status=n.stores.status.getStore(),n.sdk.sdkStore=Object.fromEntries(Object.entries(n.stores).map(([l,c])=>[l,c.getStore()])),n.sdk.organizationStore=()=>n.stores.organizationSettings.getStore(),n.sdk.streamStore=()=>n.stores.streamSettings.getStore(),n.storeUnsubscribe=()=>{n.store.unsubscribe()},o()},TZ=n=>{const{client:a}=n.createPromiseClient(KC,{method:"list"});return o=>a.list(o)},oE=n=>{const{client:a}=n.createPromiseClient(KC,{method:"summary"});return o=>a.summary(o)},bZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(dy,{method:"getFriends",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{if(!f)return[];try{return(await o.getFriends({})).data}catch{return[]}}})},kZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;return(y=(await o.get({eventId:f})).data)==null?void 0:y.attributes},refetchInterval:0,dedupeTime:1e3*60*60})},SZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"syncQuestion",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;return f?(y=(await o.syncQuestion({filter:{eventId:f}})).data)==null?void 0:y.attributes:void 0},dedupeTime:1e3*60*10,refetchInterval:0})},wZ=(n,a)=>{const{client:o}=a.createStreamClient(Xs),l=ku({eventId:n.get()||"",feedId:""});return n.subscribe((c="")=>{l.set({eventId:c,feedId:""})}),a.addSubscription(o.subscription,l,{name:"feedSubscription"})},CZ=(n,a)=>{const{client:o}=a.createStreamClient(Xs);return a.addSubscription(o.questionSubscription,{questionId:n},{name:"questionSubscription"})},_9=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"questionByUser",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y,b;return(b=(y=(await o.questionByUser({questionId:f})).data)==null?void 0:y.attributes)==null?void 0:b.question},dedupeTime:1e3*60*5})},EZ=async(n,a)=>{var c,p,f,y,b,C;if(!n)return;const{client:o}=a.createPromiseClient(Xs,{method:"getQuestion",params:[n]}),l=await o.getQuestion({id:n});return((f=(p=(c=l.data)==null?void 0:c.attributes)==null?void 0:p.options)==null?void 0:f.options.case)==="promotion"?(C=(b=(y=l.data)==null?void 0:y.attributes)==null?void 0:b.options)==null?void 0:C.options.value:void 0},_Z=(n,a,o)=>{const{client:l,queryKey:c}=o.createPromiseClient(Xs,{method:"list",params:[n,a]});return o.nanoquery.createFetcherStore(c,{fetcher:async(p,f,y,b)=>y?(await l.list({eventId:y,filter:{types:b===Kc.ALLOWED?[]:[ke.FACTOID,ke.PROMOTION,ke.TWEET],statuses:[yn.ACTIVE,yn.RESOLVED]}})).data:[],dedupeTime:0,refetchInterval:0})},IZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"list",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>f?(await o.list({eventId:f,filter:{types:[ke.PROMOTION],statuses:[yn.ACTIVE]}})).data.map(({attributes:y})=>{if(!(!y||y.attributes.case!=="promotion"))return{...y,attributes:y.attributes.value}}).filter(Boolean):[],dedupeTime:0,refetchInterval:0})},NZ=(n,a,o)=>{const l=Lb([a,o],()=>{var C,_;const f=a.get();if(!f)return;const y=(C=o.get().data)==null?void 0:C.find(N=>N.id===(f==null?void 0:f.questionId)),b=(_=f==null?void 0:f.question)==null?void 0:_.openedFrom;return y?(y.openedFrom=b,y):f.question}),c=Lb(l,f=>f&&f.type==="question"?f.id:void 0),p=_9(c,n);return{$store:l,$extendedStore:p,updateExtendedQuestion:f=>{const y=p.get().data,b=(C,_)=>{if(!C||!_)return C||_||[];const N=[];for(let L=0;L<C.length;L++)N.push({...C[L],..._[L],correct:C[L].correct,youVoted:C[L].youVoted,pointsEarned:C[L].pointsEarned});return N};p.mutate({...f,options:y==null?void 0:y.options,subject:y==null?void 0:y.subject,appearance:y==null?void 0:y.appearance,answers:b(y==null?void 0:y.answers,f==null?void 0:f.answers)})}}};var m6;(function(n){n.SHOWED="showed"})(m6||(m6={}));class RZ extends Em{constructor(){super("advertisement");M(this,"setShowed",o=>{this.write(m6.SHOWED,o,"true")});M(this,"isShowed",o=>this.read(m6.SHOWED,o))}}class LZ{constructor(a){M(this,"advertisementList");M(this,"store");M(this,"timeouts");M(this,"waitingQueue");M(this,"activeQueue");M(this,"options");M(this,"logger");M(this,"addToQueue",a=>{if(this.store.has(a.id)){this.logger.debug({advertisement:a},"skip existed advertisement: %o");return}const o=a.close,l=a.action;if(this.store.set(a.id,{...a,close:(...c)=>{o&&o(...c),this.closeAdvertisement(a.id)},action:(...c)=>{l&&l(...c),this.closeAdvertisement(a.id,{animateHiding:!1})}}),this.waitingQueue.add(a.id),this.activeQueue.size===this.options.concurrency){const[c]=this.activeQueue;this.closeAdvertisement(c)}else this.tickWaitingQueue()});M(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[a]=this.waitingQueue;if(!a)return;this.activeQueue.add(a),this.waitingQueue.delete(a),this.logger.debug({job:a},"waiting queue tick"),this.tickActiveQueue(a)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});M(this,"tickActiveQueue",a=>{if(!a)return;const o=this.store.get(a);if(!o){this.logger.debug({advertisementId:a},"active queue tick skipped, advertisement not exist");return}const l=setTimeout(()=>{const c=a,p=new Map(this.advertisementList.get());if(p.set(o.id,o),this.advertisementList.set(p),o.autoHideDuration!==1/0){const f=setTimeout(()=>{this.logger.debug({advertisementId:c,delay:o.autoHideDuration||5e3},"advertisement hiding by autoHideDuration"),this.closeAdvertisement(c)},o.autoHideDuration||5e3);this.timeouts.set(c,f)}this.logger.debug({advertisementId:c,queue:[...p.values()]},"advertisement displayed")},o.delay||0);this.timeouts.set(a,l),this.logger.debug({advertisementId:a},"active queue tick completed"),this.tickWaitingQueue()});M(this,"removeFromList",a=>{const o=new Map(this.advertisementList.get());o.delete(a),this.advertisementList.set(o),this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.logger.debug({advertisementId:a},"advertisement removed from list")});M(this,"closeAdvertisement",(a,{animateHiding:o=!0}={})=>{const l=new Map(this.advertisementList.get()),c=l.get(a);if(c){c.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&o,this.advertisementList.set(l);const p=setTimeout(()=>{const f=new Map(this.advertisementList.get());f.delete(a),this.advertisementList.set(f);const y=this.timeouts.get(a);y!==void 0&&(clearTimeout(y),this.timeouts.delete(a)),this.logger.debug({advertisementId:a},"advertisement hidden")},o&&this.options.animationDelay||0);this.timeouts.set(a,p)}return this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.tickWaitingQueue(),this.logger.debug({advertisementId:a},"advertisement hiding"),c});M(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.advertisementList.off(),this.advertisementList.set(new Map)});this.options=a,this.logger=Js("advertisement_queue"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.advertisementList=ba(new Map)}}const OZ=(n,a,o)=>{const l=Js("advertisement_queue"),c=new LZ({concurrency:1,animationDelay:1e3}),p=new RZ,f=new Zs(IZ(n,o),"gamification:promotionList"),y=(N,L)=>{Io.emit("advertisement",{action:"received",payload:{advertisementId:N,advertisementType:L==null?void 0:L.type}}),c.addToQueue({id:N,autoHideDuration:1/0,data:is({loading:!1,error:void 0,data:void 0}),promise:async function(){this.data.setKey("loading",!0);try{const O=L||await EZ(N,o);O?this.data.setKey("data",O):this.data.setKey("error",new Error("No promotion found"))}catch(O){this.data.setKey("error",O)}finally{this.data.setKey("loading",!1)}}})},b=N=>{l.debug({notificationId:N},"markAsViewed: %o"),p.setShowed(N)},C=N=>{c.closeAdvertisement(N),b(N)},_=N=>{var F;const L=c.advertisementList.get();if(!(L!=null&&L.size))return null;const O=L.values().next().value,D=O.data.get();return!N&&p.isShowed(O.id)?(c.removeFromList(O.id),_(N)):(!D.data&&!D.error&&!D.loading&&O.promise(),Io.emit("advertisement",{action:"opened",payload:{advertisementId:O.id,advertisementType:(F=D.data)==null?void 0:F.type}}),b(O.id),O)};return km(c.advertisementList,()=>{f.subscribe(N=>{if(N.data){const L=N.data[N.data.length-1];L&&y(L.id)}}),a.addListener("promotion",N=>{var D,F,V,G,W,Z,ne,ee,ue;const L=((W=(G=(V=(F=(D=N.data)==null?void 0:D.attributes)==null?void 0:F.feedItem)==null?void 0:V.attributes)==null?void 0:G.attributes)==null?void 0:W.case)==="promotion"?N.data.attributes.feedItem.attributes:void 0,O=((ue=(ee=(ne=(Z=N.data)==null?void 0:Z.attributes)==null?void 0:ne.question)==null?void 0:ee.options)==null?void 0:ue.options.case)==="promotion"?N.data.attributes.question.options.options.value:void 0;if(L===void 0||O===void 0){l.debug("not promotion");return}if(L.status===yn.RESOLVED){C(L.id),l.debug({feedItem:L},"resolved: %o");return}if(L.status===yn.ACTIVE){l.debug({feedItem:L},"active: %o"),y(L.id,O);return}l.debug({feedItem:L},"skip: %o")})}),{hide:C,show:y,$list:c.advertisementList,getActiveAdvertisement:_}};var Kc;(function(n){n.ALLOWED="allowed",n.DISALLOWED="disallowed"})(Kc||(Kc={}));class xZ{constructor(a){M(this,"slStreamId");M(this,"organizationId");M(this,"userId");M(this,"interactiveAllowed");M(this,"openedQuestionId");M(this,"openedQuestion");M(this,"activeQuestionId");M(this,"feedList");M(this,"moderationId");M(this,"moderation");M(this,"feedSubscription");M(this,"questionSubscription");M(this,"advertisement");M(this,"notifications");M(this,"log");M(this,"transport");M(this,"cancels",new Set);M(this,"getCurrentSessionId",a=>{const o=a.eventId||this.slStreamId.get()||"",l=a.userId||this.userId.get()||"",c=a.organizationId||this.organizationId.get()||"",p=a.entity||"",f=a.prefix||"";return[c,o,l,f,p].join(":")});M(this,"disconnect",()=>{var a;(a=this.feedSubscription)==null||a.disconnect(),this.questionSubscription!==void 0&&(this.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0)});M(this,"openQuestion",(a,o)=>{this.openedQuestionId.set({questionId:a,question:o}),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});M(this,"closeQuestion",a=>{this.openedQuestionId.set(void 0),a&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});this.transport=a.transport,this.log=Js("gamification-background"),this.slStreamId=a.stores.slStreamId.getAtomStore(),this.organizationId=a.stores.organizationSettings.getAtomStore(),this.userId=a.stores.user.getAtomStore(),this.moderationId=new _o(ba(void 0),"moderationId").getStore(),this.interactiveAllowed=new _o(ba(Kc.DISALLOWED),"interactiveAllowed").getStore(),this.openedQuestionId=new _o(ba(void 0),"openedQuestionId").getStore(),this.notifications=a.notifications,this.moderation=new Zs(kZ(this.slStreamId,a.transport),"gamification:moderation"),this.feedList=new Zs(_Z(this.slStreamId,this.interactiveAllowed,a.transport),"gamification:feedList"),this.activeQuestionId=SZ(this.slStreamId,a.transport),this.openedQuestion=NZ(a.transport,this.openedQuestionId,this.feedList.getStore()),this.cancels.add(this.openedQuestionId.listen(o=>{this.log.debug({item:o},"received question"),o!=null&&o.questionId?(this.questionSubscription=CZ(o.questionId,a.transport),this.questionSubscription.addListener("feed-subscription-opened-question",l=>{var c,p;this.openedQuestion.updateExtendedQuestion((p=(c=l.data)==null?void 0:c.attributes)==null?void 0:p.question)}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(a.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))})),this.feedSubscription=wZ(this.slStreamId,a.transport),this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question",o=>{var p,f,y,b,C;const l=(f=(p=this.activeQuestionId.get().data)==null?void 0:p.question)==null?void 0:f.id,c=(b=(y=o.data)==null?void 0:y.attributes)==null?void 0:b.question;!c||c.type===ke.PROMOTION||l&&c.status===yn.RESOLVED&&c.id!==l||this.activeQuestionId.mutate((C=o.data)==null?void 0:C.attributes)})),this.cancels.add(this.feedSubscription.addListener("moderation update",o=>{window.requestAnimationFrame(()=>{var l,c,p,f;((c=(l=o.data)==null?void 0:l.attributes)==null?void 0:c.question)===void 0&&((f=(p=o.data)==null?void 0:p.attributes)!=null&&f.moderation)&&this.moderation.invalidate()})})),this.feedSubscription.connect(),this.cancels.add(this.interactiveAllowed.listen(()=>{window.requestAnimationFrame(()=>{this.activeQuestionId.invalidate()})})),a.sdk.onMount({name:"gamification-background"},()=>()=>{this.activeQuestionId.off();for(const o of this.cancels)o(),this.cancels.delete(o)}),this.advertisement=OZ(this.slStreamId,this.feedSubscription,a.transport)}}class AZ{constructor(a){M(this,"notificationsList");M(this,"store");M(this,"timeouts");M(this,"waitingQueue");M(this,"activeQueue");M(this,"options");M(this,"logger");M(this,"addToQueue",a=>{var c;if(this.store.has(a.id)){this.logger.debug({notification:a},"skip existed notification: %o");return}const o=a.close,l=a.action;if(this.store.set(a.id,{...a,close:(...p)=>{o&&o(...p),this.closeNotification(a.id)},action:(...p)=>{l&&l(...p),this.closeNotification(a.id,{animateHiding:!1})}}),this.waitingQueue.add(a.id),this.activeQueue.size===this.options.concurrency){const[p]=this.activeQueue;if(((c=this.store.get(p))==null?void 0:c.persistent)!==!0)this.closeNotification(p);else{const[f]=this.waitingQueue;this.waitingQueue.size>1&&this.closeNotification(f),this.tickWaitingQueue()}}else this.tickWaitingQueue()});M(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[a]=this.waitingQueue;if(!a)return;this.activeQueue.add(a),this.waitingQueue.delete(a),this.logger.debug({job:a},"waiting queue tick"),this.tickActiveQueue(a)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});M(this,"tickActiveQueue",a=>{if(!a)return;const o=this.store.get(a);if(!o){this.logger.debug({notificationId:a},"active queue tick skipped, notification not exist");return}const l=setTimeout(()=>{const c=a,p=new Map(this.notificationsList.get());p.set(o.id,o),this.notificationsList.set(p);const f=setTimeout(()=>{this.logger.debug({notificationId:c,delay:o.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(c)},o.autoHideDuration||5e3);this.timeouts.set(c,f),this.logger.debug({notificationId:c,queue:[...p.values()]},"notification displayed")},o.delay||0);this.timeouts.set(a,l),this.logger.debug({notificationId:a},"active queue tick completed"),this.tickWaitingQueue()});M(this,"closeNotification",(a,{animateHiding:o=!0}={})=>{const l=new Map(this.notificationsList.get()),c=l.get(a);if(c){c.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&o,this.notificationsList.set(l);const p=setTimeout(()=>{const f=new Map(this.notificationsList.get());f.delete(a),this.notificationsList.set(f);const y=this.timeouts.get(a);y!==void 0&&(clearTimeout(y),this.timeouts.delete(a)),this.logger.debug({notificationId:a},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(a,p)}return this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.tickWaitingQueue(),this.logger.debug({notificationId:a},"notification hiding"),c});M(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.notificationsList.off(),this.notificationsList.set(new Map)});this.options=a,this.logger=Js("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notificationsList=ba(new Map)}}var f6;(function(n){n.OPENED="opened"})(f6||(f6={}));class PZ extends Em{constructor(){super("notification");M(this,"setOpened",o=>{this.write(f6.OPENED,o,"true")});M(this,"isOpened",o=>this.read(f6.OPENED,o));M(this,"clearNotification",()=>{this.clear()})}}var vu;(function(n){n[n.ONBOARDING=1]="ONBOARDING",n[n.QUESTION=2]="QUESTION",n[n.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(vu||(vu={}));class MZ{constructor(a={}){M(this,"queue");M(this,"storage");M(this,"isViewed",a=>this.storage.isOpened(a));M(this,"add",a=>{if(!this.isViewed(a.id)){if(a.data&&a.emitEvent){const o=a.action;a.action=(...l)=>{o&&o(...l),Io.emit("notification",{action:"opened",payload:{questionId:a.data.questionId,questionType:a.data.questionType}})}}this.queue.addToQueue(a)}});M(this,"close",(a,{markAsViewed:o=!0,animateHiding:l}={})=>{this.queue.closeNotification(a,{animateHiding:l}),o&&this.markAsViewed(a)});M(this,"getActiveNotification",()=>{const a=this.queue.notificationsList.get();if(!(a!=null&&a.size))return null;for(const o of a.values())if(o.type===vu.ONBOARDING)return o;return a.values().next().value});M(this,"getQueueStore",()=>this.queue.notificationsList);M(this,"markAsViewed",a=>{this.storage.setOpened(a)});this.storage=new PZ,this.queue=new AZ({concurrency:1,animationDelay:1600,...a})}}const DZ=(n,a,o)=>{n.notifications=new MZ(void 0),n.addNotification=n.notifications.add,n.sdk.getNotificationsStore=()=>n.notifications.getQueueStore(),n.sdk.getActiveNotification=()=>n.notifications.getActiveNotification(),n.sdk.onMount({name:"notifications"},()=>()=>{n.notifications.queue.drain()}),o()};var m2;(function(n){n.UNKNOWN="unknown",n.ALREADY_VOTED="already_voted"})(m2||(m2={}));const UZ=async(n,a)=>{var p;const{client:o,createRequestOptions:l}=n.createPromiseClient(Xs,{method:"submitAnswer"}),c=l({retryAttempts:0});try{return await o.submitAnswer({data:a},{contextValues:c})}catch(f){throw((p=zt.from(f))==null?void 0:p.code)===st.AlreadyExists?new Error(m2.ALREADY_VOTED):new Error(m2.UNKNOWN)}},FZ=(n,a)=>{const{client:o,createRequestOptions:l}=n.createPromiseClient(Xs,{method:"submitInplay"}),c=l({retryAttempts:0});return o.submitInplay({data:{eventId:+a}},{contextValues:c})};var om;(function(n){n.ONBOARDING="onboarding",n.ONBOARDING_IO="onboarding_io"})(om||(om={}));class VZ extends Em{constructor(){super("gamification-session",window.sessionStorage);M(this,"writeValue",(o,l)=>{this.write(...o,l)});M(this,"readValue",o=>this.read(...o))}}class sE extends Em{constructor(){super("gamification");M(this,"sessionStorage");M(this,"saveOnboardingStatus",({userId:o,eventId:l,organizationId:c},p)=>{this.write(om.ONBOARDING,c,o,l,p)});M(this,"getOnboardingStatus",({userId:o,eventId:l,organizationId:c})=>this.read(om.ONBOARDING,c,o,l));M(this,"setOnboardingInstantOpen",({userId:o,eventId:l,organizationId:c})=>{this.sessionStorage.writeValue([om.ONBOARDING_IO,c,o,l],"1")});M(this,"getOnboardingInstantOpen",({userId:o,eventId:l,organizationId:c})=>this.sessionStorage.readValue([om.ONBOARDING_IO,c,o,l]));this.sessionStorage=new VZ}}const jZ={pageSize:10},BZ=(n,a,o,l,c)=>{let p=0;const f=ba({pageSize:jZ.pageSize,page:0}),y=is({data:[],key:Date.now(),hasMore:!0,loading:void 0,error:void 0}),b=TZ(n),C=async()=>{var D;const L=a.get(),O=((D=l.getStore().get().data)==null?void 0:D.map(F=>F.slId))||[];if(L&&(O!=null&&O.length)){const F=o.get();F&&O.push(F),y.setKey("loading",!0),y.setKey("data",[]);const V=await b({eventId:L,usersIds:O});y.set({data:V.data.map((G,W)=>({...G.attributes,friendsRank:W+1})),hasMore:!1,key:Date.now(),loading:!1}),V.meta&&(p=Math.round(V.meta.count/V.meta.pageSize))}},_=()=>{C()},N=L=>{const O=f.get(),D=L||O.page+1;D<=p&&f.set({...O,page:D})};return km(y,()=>{const L=a.listen(C),O=l.listen(C);return()=>{L(),O()}}),{$store:y,fetchMore:N,invalidate:_}};class $Z extends Em{constructor(){super("deep-link-context",window.sessionStorage);M(this,"get",this.read);M(this,"set",this.write);M(this,"del",this.remove)}}const bS="sldl",L6="sldl_uid",iE="sldl_eid",lE="sldl_e_eid",zZ=new Set([L6,iE,lE]),kS=n=>{const a={},o={};for(const[l,c]of n)zZ.has(l)?a[l]=c:o[l]=c;return{result:a,remain:o}},HZ=({hash:n,search:a})=>{if(n&&n.includes(bS)){const o=new URLSearchParams(n.substr(1));return{hash:kS(o)}}if(a&&a.includes(bS)){const o=new URLSearchParams(a);return{search:kS(o)}}return null},SS=Js("deep_link"),Ys={debug:(...n)=>{SS.debug(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)},trace:(...n)=>{SS.trace(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)}},GZ=(n,a)=>{const{hash:o,search:l}=window.location;if(Ys.debug({hash:o,search:l},"get deep link data from"),o||l){const c=HZ({hash:o,search:l});if(Ys.debug(c,"parse deep link result"),c){const{hash:p,search:f}=c,{result:y,remain:b}=p||f;if(Object.keys(y).length!==0){n.setValue("data",y);const C=Object.keys(b).length!==0;if(p){let _="";C&&(_=`#${new URLSearchParams(b).toString()}`,Ys.debug({updatedHash:_},"update hash")),window.history.replaceState(null,"",window.location.pathname+window.location.search+_)}if(f){let _="";C&&(_=`?${new URLSearchParams(b).toString()}`,Ys.debug({updatedSearch:_},"update search")),window.history.replaceState(null,"",window.location.pathname+_+window.location.hash)}a(y)}}}n.setValue("parsed",!0)},qZ=(n,a,o)=>{const l=new $Z,c=l.get("sl-deep-link-store");let p={};if(c)try{p=JSON.parse(c)}catch(y){Ys.debug(y)}n.deepLink={$store:new Yc(is(p),"deep-link-context"),getDeepLinkData:()=>{const{data:y,used:b}=n.deepLink.$store.getValues();return{data:y,used:b}},deepLinkUsed:y=>{Ys.debug(`logged in with inviterId: ${y}`),n.deepLink.$store.setValue("used",!0)},onDeepLinkHandlers:new Set},n.sdk.getInviter=()=>{const{data:y,used:b}=n.deepLink.getDeepLinkData();return b?y==null?void 0:y[L6]:void 0},n.sdk.inviteDisplayed=()=>{n.deepLink.$store.getStore().set({}),n.deepLink.$store.getStore().off(),l.del("sl-deep-link-store")},n.deepLink.$store.subscribe(y=>l.set("sl-deep-link-store",JSON.stringify(y))),n.sdk.addDeepLinkHandler=y=>{localStorage.getItem("SL_DEBUG")&&Ys.trace("adding deep link handler"),n.deepLink.onDeepLinkHandlers.add(y)},a.onDeepLinkHandled&&n.sdk.addDeepLinkHandler(a.onDeepLinkHandled),n.sdk.removeDeepLinkHandler=y=>{Ys.trace("removing deep link handler"),n.deepLink.onDeepLinkHandlers.delete(y)};const f=y=>{n.deepLink.$store.setValue("handled",!0),Ys.trace({size:n.deepLink.onDeepLinkHandlers.size},"deep link handled, call callbacks");for(const b of n.deepLink.onDeepLinkHandlers)try{Ys.trace("called handler"),b(y)}catch(C){console.error(C)}};GZ(n.deepLink.$store,f),o()},WZ=Js("bypass");class QZ extends KK{constructor(o,l,c){super();M(this,"$coreStore");M(this,"deepLink");M(this,"transport");M(this,"bypassLogin");M(this,"me",async()=>{var o;return this.$coreStore.getValues().user.invalidate(),(o=await this.$coreStore.getValues().user.getValue())==null?void 0:o.data});M(this,"login",async(o,l)=>{var _,N,L;this.$coreStore.getValues().userKey.setValue(l);const{used:c,data:p}=this.deepLink.getDeepLinkData(),f=c?"":p==null?void 0:p[L6];WZ.debug({inviterKey:f},"login with inviterKey");const y=await this.bypassLogin({schema:o,userKey:l,inviterKey:f,init:!1}),b=(_=y.meta)==null?void 0:_.jwt,C=(N=y.data)==null?void 0:N.id;if(!b||!C)throw new Error("internal: token missing");return(L=y.meta)!=null&&L.inviterKey&&this.deepLink.deepLinkUsed(y.meta.inviterKey),this.$coreStore.getValues().user.getStore().mutate({data:y.data}),this.saveUser(b,C),b});M(this,"isAuthenticated",()=>this.me());M(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new rm().clear()});M(this,"softLogout",()=>{const o=new rm;this.transport.setAuth("",""),o.setToken(""),this.reLogin()});M(this,"reLogin",()=>{const o=new rm,l=o.getToken(),c=o.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(c),l)return this.saveUser(l,""),this.me().then(p=>{if(p!=null&&p.id){const f=p.id;this.saveUser(l,f)}});if(c&&!l){const p=o.getSchema();p&&c&&this.login(p,c).catch(()=>{this.logout()})}});M(this,"saveUser",(o,l)=>{this.transport.setAuth(o,l),this.$coreStore.getValues().userToken.setValue(o),new rm().setToken(o)});M(this,"connect",()=>{this.transport.registerInterceptor(o=>async l=>{try{return await o(l)}catch(c){throw c.code&&(c.code===7||c.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),c}})});this.$coreStore=o,this.deepLink=c,this.transport=l,this.bypassLogin=uZ(this.transport),this.connect()}}const Xf=new rm,YZ=(n,a,o)=>{n.auth=new QZ(n.store,n.transport,n.deepLink),n.stores.status.listen(l=>{l===Yi.READY&&n.auth.reLogin()}),n.sdk.userId=n.stores.user.getAtomStore,n.sdk.authorizationBypass=async(l,c)=>{if(!(Xf.getSchema()===l&&Xf.getExternalToken()===c&&n.transport.getHeader("authorization")))try{await n.auth.login(l,c),Xf.setSchema(l),Xf.setExternalToken(c)}catch{n.sdk.logout()}},n.sdk.logout=()=>{n.auth.logout(),Xf.clear()},n.sdk.getUserStore=()=>n.stores.user.getStore(),n.sdk.isUserAuthorized=()=>n.auth.isAuthenticated(),o()},wS=Js("video_player"),Fh={debug:(...n)=>{wS.debug(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)},trace:(...n)=>{wS.trace(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)}},KZ=(n,a,o)=>{n.videoPlayer={controllers:new Set},n.sdk.addVideoPlayerController=l=>{Fh.trace("adding video player controller"),n.videoPlayer.controllers.add(l)},a.videoPlayerController&&n.sdk.addVideoPlayerController(a.videoPlayerController),n.sdk.removeVideoPlayerController=l=>{Fh.trace("removing video player controller"),n.videoPlayer.controllers.delete(l)},n.sdk.controlVideoPlayer=l=>{Fh.trace("controlling video player");for(const c of n.videoPlayer.controllers){Fh.trace("calling video player controller");try{c(l)}catch(p){console.error(p)}}},o()},ZZ=(n,a,o)=>{const l={onMountedFired:!1},c=new Map,p=new Map;n.sdk=Object.create(null),n.sdk.onMount=({name:f,clear:y},b)=>{var C,_;if(c.has(f)){const N=p.get(f);N&&N(),c.delete(f),p.delete(f)}c.set(f,{cb:b,clear:y}),((_=(C=n==null?void 0:n.stores)==null?void 0:C.enabled)==null?void 0:_.get())==="on"&&p.set(f,b())},n.ready=()=>{n.stores.enabled.subscribe(f=>{f==="on"&&l.onMountedFired===!1&&(c.forEach(({cb:y},b)=>p.set(b,y())),l.onMountedFired=!0),f!=="on"&&l.onMountedFired===!0&&(p.forEach(y=>y()),p.clear(),c.forEach(({clear:y},b)=>y&&c.delete(b)),l.onMountedFired=!1)})},n.sdk.initializeApp=async f=>{if(n.contextConfig=f,n.stores.enabled.get()==="on")return{enabled:!0};n.storeSubscribe(),n.stores.enabled.setValue("on"),n.stores.status.setValue(Yi.INITIALIZATION);try{const y=await n.stores.organizationSettings.getValue();return y?(n.stores.status.setValue(Yi.READY),{enabled:!!y}):(n.stores.status.setValue(Yi.FAILED),{err:"failed"})}catch(y){return n.stores.enabled.setValue(),n.stores.status.setValue(Yi.FAILED),{err:`${y}`}}},n.sdk.disableApp=()=>{n.stores.enabled.get()==="on"&&(n.stores.enabled.setValue(),n.stores.status.setValue(Yi.DISABLED),n.stores.slStreamId.setValue(),n.stores.providerStreamId.setValue(),n.sdk.closeFeature(!0),n.storeUnsubscribe(),n.transport.disconnect())},n.sdk.createEventSession=f=>{n.stores.providerStreamId.setValue(f)},o()},XZ=(n,a)=>{const{client:o,queryKey:l}=n.createPromiseClient(g2,{method:"generateDeepLink",params:a});return n.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f,y)=>{var b;if(!f)return{};try{return(b=(await o.generateDeepLink({data:{gamification:!0,externalEventId:y,eventId:f}})).data)==null?void 0:b.attributes}catch{return}},dedupeTime:1e3*60*60*24,refetchInterval:0})},JZ=(n,{web:a,mobile:o})=>{const{client:l}=n.createPromiseClient(bK,{method:"generate"});return l.generate({web:a,mobile:o})},CS=(n,a)=>{const o=new URLSearchParams(n);for(const[l,c]of Object.entries(a))o.append(l,c);return o.toString()},eX=(n,a,o,l)=>{const c=is({});return km(c,()=>XZ(n,[a,o]).subscribe(async({data:p,error:f,loading:y})=>{var O;const b=f?"https://masters.com":p==null?void 0:p.url,C=l.get()||"",_=a.get()||"",N=o.get()||"",L={[L6]:C,[iE]:_,[lE]:N};if(!y&&b){c.setKey("loading",!0);let D=window.location.search,F=window.location.hash;D&&F||F?D=`?${CS(D,L)}`:F=`#${CS("",L)}`;const V=window.location.origin+window.location.pathname+D+F;try{const G=await JZ(n,{web:V,mobile:b});c.set({data:(O=G.data)==null?void 0:O.link,loading:!1})}catch{c.set({loading:!1,error:"Failed to generate short link",data:void 0})}}else c.setKey("loading",!0)})),{$store:c,fetch}};var ya;(function(n){n.Unset="unset",n.Required="required",n.Optional="optional",n.Completed="completed",n.Disabled="disabled",n.Unavailable="unavailable"})(ya||(ya={}));const tX=(n,a,o,l)=>{const{inplayGame:c}=n.featureSettings.get(),p=a.getCurrentSessionId({prefix:"onboarding"});c&&o.add({type:vu.ONBOARDING,id:p,action:n.openFeature,persistent:!0,autoHideDuration:1e6,data:{questionId:"onboarding",questionType:ke.UNSET,onboarding:{...c,instantOpen:!l.getOnboardingInstantOpen({userId:a.userId.get()||"",organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""})}}})},Vh=(n,a,o,l,c,p)=>{var f,y,b;try{const C=a.userId.get();if(!C)return;if(c.getOnboardingStatus({userId:C,organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""})===ya.Completed){n.set(ya.Completed);for(const D of p)D();return}const _=(f=a.moderation.getStore().value)==null?void 0:f.data,N=o.featureSettings.get().inplayGame;if(_===void 0||N===void 0)return;const L=(y=_==null?void 0:_.options)==null?void 0:y.onboardingEnabled,O=(b=N==null?void 0:N.titleCard)==null?void 0:b.optIn;L?O?n.set(ya.Required):n.set(ya.Optional):(O?n.set(ya.Unavailable):n.set(ya.Disabled),l.close(a.getCurrentSessionId({prefix:"onboarding"}),{markAsViewed:!1}))}catch(C){console.error(C)}},nX=(n,a,o,l)=>{let c=!1;const p=new sE,f=ba(ya.Unset);f.subscribe(b=>{b!==ya.Unset&&((b===ya.Optional||b===ya.Required)&&c===!1&&(tX(n,a,l,p),c=!0),b===ya.Completed&&a.activeQuestionId.invalidate(),p.setOnboardingInstantOpen({userId:a.userId.get()||"",organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""}))});const y=[];return Vh(f,a,n,l,p,y),f.get()!==ya.Completed&&(y.push(a.userId.listen(b=>{b&&Vh(f,a,n,l,p,y)})),y.push(a.moderation.listen(b=>{b.data&&Vh(f,a,n,l,p,y)})),y.push(n.featureSettings.listen(b=>{b&&Vh(f,a,n,l,p,y)}))),{$store:f,submitInplay:async()=>{const b=a.slStreamId.get();if(b){await FZ(o,b),f.set(ya.Completed),p.saveOnboardingStatus({organizationId:a.organizationId.get()||"",userId:a.userId.get()||"",eventId:b},ya.Completed),Io.emit("poll",{action:"onboardingPassed",payload:{}}),n.openFeature();const C=a.getCurrentSessionId({prefix:"onboarding"});l.close(C)}}}},aX=(n,a,o,l)=>{const c=is(void 0),p=oE(l),f=async()=>{var O,D;const b=n.get(),C=a.get(),_=(O=o.getStore().get().data)==null?void 0:O.map(F=>F.slId);if(!_)return;const N={eventId:b,userId:C,usersIds:[..._,C]},L=await p(N);c.set((D=L.data)==null?void 0:D.attributes)},y=()=>{f()};return km(c,()=>{const b=n.listen(f),C=o.listen(f),_=a.listen(f);return()=>{b(),C(),_()}}),{$store:c,invalidate:y}},rX=async(n,a,o,l,c)=>{var _,N,L;const p=oE(c),f=n.get(),y=a.get(),b=((_=o.getStore().get().data)==null?void 0:_.map(O=>O.slId))||[],C={eventId:f,userId:l,usersIds:[...b,y]};return(L=(N=(await p(C)).data)==null?void 0:N.attributes)==null?void 0:L.summary},oX=new Set([ke.POLL,ke.PREDICTION,ke.TRIVIA]);class sX extends nE{constructor(o,l,c){super(o,l);M(this,"userSummary");M(this,"feedList");M(this,"friends");M(this,"leaderboardId");M(this,"leaderboardList");M(this,"deepLink");M(this,"onboardingStatus");M(this,"openedQuestion");M(this,"currentUserId");M(this,"openedUser");M(this,"closeFeature");M(this,"openFeature");M(this,"feedSubscription");M(this,"activeQuestionId");M(this,"openedQuestionId");M(this,"advertisement");M(this,"notifications");M(this,"transport");M(this,"background");M(this,"storage");M(this,"submitAnswerTimeout");M(this,"cancels",new Set);M(this,"checkInteractiveFlag",()=>{var y,b,C,_,N;const o=this.onboardingStatus.$store.get(),l=(C=(b=(y=this.background.moderation.getStore().value)==null?void 0:y.data)==null?void 0:b.options)==null?void 0:C.onboardingEnabled,c=(N=(_=this.settings.getValues().inplayGame)==null?void 0:_.titleCard)==null?void 0:N.optIn,p=o===ya.Completed,f=!l||p||c!==!0;this.background.interactiveAllowed.set(f?Kc.ALLOWED:Kc.DISALLOWED)});M(this,"connect",()=>{this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close",async o=>{var C,_,N,L,O,D,F,V,G,W,Z;if(!this.isInteractiveAllowed)return;const l=(_=(C=o.data)==null?void 0:C.attributes)==null?void 0:_.question,c=(L=(N=o.data)==null?void 0:N.attributes)==null?void 0:L.feedItem;if(!l||!(c!=null&&c.attributes))return;const{status:p,type:f,id:y,answers:b}=l;if(p===yn.RESOLVED&&f===ke.PREDICTION){const ne=this.background.getCurrentSessionId({prefix:`notification-id:${y}`}),ee=[...this.feedList.getValues().data||[]],ue=ee.findIndex(ht=>ht.id===y),oe=ee[ue];let Ne=(F=(D=(O=oe==null?void 0:oe.attributes)==null?void 0:O.attributes)==null?void 0:D.value)==null?void 0:F.answerId;const Ie=_9(y,this.transport),Ze=Ie.subscribe(()=>{});await Ie.get().promise;const Ge=Ie.get().data;Ze(),window.requestAnimationFrame(()=>{Ie.invalidate()}),Ne||(Ne=(V=Ge==null?void 0:Ge.answers.find(({youVoted:ht})=>ht))==null?void 0:V.id);const Qe=b.find(({correct:ht})=>ht),_e=Ne?b.find(({id:ht})=>ht===Ne):void 0,et=!!(_e!=null&&_e.correct);if(oe&&((W=(G=ee[ue])==null?void 0:G.attributes)==null?void 0:W.attributes.case)==="question"){try{ee[ue].attributes.attributes.value.answerId=Ne,ee[ue].attributes.attributes.value.openForVoting=!1,Ne&&(ee[ue].attributes.attributes.value.status=et?Xi.WON:Xi.LOST)}catch{}this.feedList.getStore().mutate(ee)}if(!_e||!Qe)return;((Z=this.openedQuestionId.get())==null?void 0:Z.questionId)!==l.id&&this.notifications.add({type:vu.QUESTION_RESOLVED,action:()=>this.openQuestion(l.id,c),close:()=>this.closeQuestion(y),autoHideDuration:et?15e3:12e3,id:ne,emitEvent:!1,data:{questionId:y,questionType:ke.PREDICTION,question:{title:et?`Congratulations! You answered correctly! You won ${Qe.points} pts!`:`Better luck next time! Correct: ${Qe==null?void 0:Qe.text}!`,votedAnswer:{title:_e==null?void 0:_e.text,points:_e==null?void 0:_e.points},correctAnswerTitle:Qe==null?void 0:Qe.text,correct:!!et,predictionResult:p===yn.RESOLVED,questionTitle:l==null?void 0:l.subject}}}),this.userSummary.invalidate()}})),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list",o=>{var f,y,b,C,_;const l=[...((f=this.feedList.getStore().value)==null?void 0:f.data)||[]],c=(b=(y=o.data)==null?void 0:y.attributes)==null?void 0:b.feedItem,p=l.findIndex(N=>N.id===(c==null?void 0:c.id));if(c!=null&&c.attributes&&c.attributes.attributes.case!=="promotion"&&!(c.attributes.status!==yn.ACTIVE&&c.attributes.status!==yn.RESOLVED)){if(p!==-1)if(c.attributes.attributes.case==="question"&&((C=l[p].attributes)==null?void 0:C.attributes.case)==="question"){const N=l[p];N.attributes&&(l[p]={...l[p],attributes:{...N.attributes,attributes:{...N.attributes.attributes,value:{...N.attributes.attributes.value,...c.attributes.attributes.value,answerId:N.attributes.attributes.value.answerId,status:N.attributes.attributes.value.status,openForVoting:N.attributes.attributes.value.openForVoting}}}})}else{const N=l[p];N.attributes&&c.attributes&&(l[p]={...l[p],attributes:{...N.attributes,attributes:{...N.attributes.attributes,value:{...N.attributes.attributes.value,...c.attributes.attributes.value}}}})}p===-1&&(l.unshift(c),Io.emit("poll",{action:"received",payload:{questionId:c.id,questionType:(_=c.attributes)==null?void 0:_.type}})),this.feedList.getStore().mutate(l)}}))});M(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-prediction-close"),this.background.feedSubscription.removeListener("feed-subscription-questions-list")});M(this,"submitAnswer",async(o,l)=>{const c=_9(o,this.transport),p=c.subscribe(()=>{}),f={...c.get().data||{}},y=()=>{var L;const b=this.feedList.getValues().data;if(!b)return;const C=b.findIndex(O=>O.id===o),_=b[C],N=((L=_==null?void 0:_.attributes)==null?void 0:L.attributes.case)==="question"&&_.attributes.attributes.value;if(N){Io.emit("poll",{action:"voted",payload:{questionId:o,questionType:N.questionType}});const O=c.get().data;if(p(),O){const D=O.answers.find(W=>W.correct===!0),F=O.answers.findIndex(W=>W.id===l),V=O.answers[F],G=O.answers.every(({percentageDecimal:W},Z)=>W===(f==null?void 0:f.answers[Z].percentageDecimal));b[C].attributes.attributes.value.answerId=l,b[C].attributes.attributes.value.openForVoting=!1,b[C].attributes.attributes.value.text=(V==null?void 0:V.text)||"",D&&(b[C].attributes.attributes.value.status=D.id===l?Xi.WON:Xi.LOST),this.feedList.getStore().mutate([...b]),O.answers[F].correct=(D==null?void 0:D.id)===l,O.answers[F].youVoted=!0,G&&O.answers.forEach(W=>{W.percentageDecimal=0}),(D==null?void 0:D.id)===l&&(O.answers[F].pointsEarned=O.status===yn.RESOLVED?0:D.points),c.mutate({...O})}this.submitAnswerTimeout&&clearTimeout(this.submitAnswerTimeout),this.submitAnswerTimeout=setTimeout(()=>{this.userSummary.invalidate()},1e3)}};try{await UZ(this.transport,{questionId:o,answerId:l}),y()}catch(b){if(b.message===m2.ALREADY_VOTED){this.userSummary.invalidate();const C=c.subscribe(()=>{});c.invalidate(),C()}throw b}});M(this,"openQuestion",(o,l)=>{var p,f,y,b;if(!o)return()=>{};this.notifications.close(this.background.getCurrentSessionId({prefix:"notification",entity:o}),{animateHiding:!1});let c=(p=l==null?void 0:l.attributes)==null?void 0:p.type;return c||(c=(b=(y=(((f=this.feedList.getStore().value)==null?void 0:f.data)||[]).find(C=>C.id===o))==null?void 0:y.attributes)==null?void 0:b.type),Io.emit("poll",{action:"opened",payload:{questionId:o,questionType:c,questionOpenedFrom:l==null?void 0:l.openedFrom}}),this.background.openQuestion(o,l)});M(this,"isOpenedQuestion",o=>this.notifications.isViewed(o));M(this,"closeQuestion",o=>this.background.closeQuestion(o));M(this,"openUser",async o=>{var p,f;const l=(p=this.leaderboardList.$store.get().data)==null?void 0:p.find(y=>y.userId===o);if(!l){this.openedUser.set(l);return}if(l.summaryLoaded){this.openedUser.set(l);return}const c={...l};try{const y=await rX(this.background.slStreamId,this.background.userId,this.friends,o,this.transport);(y==null?void 0:y.inTop)!==void 0&&(this.leaderboardList.$store.setKey("data",(f=this.leaderboardList.$store.get().data)==null?void 0:f.map(b=>(b.userId===o&&(b.inTop=y.inTop),b))),c.inTop=y.inTop)}catch(y){console.error(y)}this.openedUser.set(c)});M(this,"closeUser",()=>{this.openedUser.set(void 0)});M(this,"showInApp",o=>{var c,p,f,y,b,C,_,N,L,O,D,F,V,G;const l=this.onboardingStatus.$store.get();if(o&&o.data&&l&&l!==ya.Unset&&((c=o.data.question)==null?void 0:c.id)!==void 0&&o.data.question.notification!==void 0&&((f=(p=o.data.question)==null?void 0:p.bypassNotifications)==null?void 0:f.inAppSilence)!==Nw.ON&&o.data.question.status===yn.ACTIVE&&!o.data.question.marketClosed){if(oX.has(o.data.question.type))this.isInteractiveAllowed&&this.notifications.add({type:vu.QUESTION,action:()=>{var W,Z,ne;return this.openQuestion((Z=(W=o.data)==null?void 0:W.question)==null?void 0:Z.id,(ne=o.data)==null?void 0:ne.feedItem)},close:()=>{var W,Z;return this.closeQuestion((Z=(W=o.data)==null?void 0:W.question)==null?void 0:Z.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),emitEvent:!0,data:{questionId:o.data.question.id,questionType:o.data.question.type,question:{title:o.data.question.notification.title}}});else if(o.data.question.type===ke.FACTOID){const W=(y=o.data.question.options)==null?void 0:y.options.value,Z={heading:o.data.question.notification.title,body:o.data.question.notification.body,imageMode:W==null?void 0:W.imageMode,image:W==null?void 0:W.image,video:{id:((b=W==null?void 0:W.video)==null?void 0:b.id)||"",url:((C=W==null?void 0:W.video)==null?void 0:C.url)||"",thumbnailUrl:((_=W==null?void 0:W.video)==null?void 0:_.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:vu.QUESTION,action:()=>{var ne,ee,ue;return this.openQuestion((ee=(ne=o==null?void 0:o.data)==null?void 0:ne.question)==null?void 0:ee.id,(ue=o==null?void 0:o.data)==null?void 0:ue.feedItem)},close:()=>{var ne,ee;return this.closeQuestion((ee=(ne=o==null?void 0:o.data)==null?void 0:ne.question)==null?void 0:ee.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionId:o.data.question.id,questionType:o.data.question.type,insight:Z}})}else if(o.data.question.type===ke.TWEET){const W=(N=o.data.question.options)==null?void 0:N.options.value,Z={title:(L=o.data.question.notification)==null?void 0:L.title,body:(O=o.data.question.notification)==null?void 0:O.body,image:(D=o.data.question.notification)==null?void 0:D.image,account:((F=W==null?void 0:W.tweetMeta)==null?void 0:F.account)||"",accountVerified:!!((V=W==null?void 0:W.tweetMeta)!=null&&V.accountVerified),tweet:(G=W==null?void 0:W.tweetMeta)==null?void 0:G.tweet,tweetId:o.data.question.id};this.notifications.add({type:vu.QUESTION,action:()=>{var ne,ee,ue;return this.openQuestion((ee=(ne=o.data)==null?void 0:ne.question)==null?void 0:ee.id,(ue=o.data)==null?void 0:ue.feedItem)},close:()=>{var ne,ee;return this.closeQuestion((ee=(ne=o.data)==null?void 0:ne.question)==null?void 0:ee.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionId:o.data.question.id,questionType:o.data.question.type,tweet:Z}})}}});this.background=new xZ(c),this.advertisement=this.background.advertisement,this.feedSubscription=this.background.feedSubscription,this.activeQuestionId=this.background.activeQuestionId,this.openedQuestionId=this.background.openedQuestionId,this.storage=new sE,this.feedList=this.background.feedList,this.friends=new Zs(bZ(this.background.userId,c.transport),"gamification:friends"),this.currentUserId=this.background.userId,this.openedUser=ba(void 0),this.leaderboardId=new _o(ba(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=nX(this,this.background,c.transport,c.notifications),this.notifications=c.notifications,this.transport=c.transport,this.closeFeature=()=>c.sdk.closeFeature(!0),this.openFeature=()=>c.sdk.openFeature(yt.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=eX(this.transport,this.background.slStreamId,c.stores.providerStreamId.getStore(),this.background.userId),this.userSummary=aX(this.background.slStreamId,this.background.userId,this.friends,this.transport),this.leaderboardList=BZ(this.transport,this.background.slStreamId,this.background.userId,this.friends),this.connect(),this.cancels.add(this.userSummary.$store.listen((p,f)=>{f!=null&&f.summary&&(p!=null&&p.summary)&&this.leaderboardList.invalidate()})),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)),km(this.background.activeQuestionId,()=>{this.background.activeQuestionId.listen(this.showInApp)}),c.sdk.onMount({name:"gamification",clear:!0},()=>()=>{for(const p of this.cancels)p(),this.cancels.delete(p)})}get isInteractiveAllowed(){return this.background.interactiveAllowed.get()===Kc.ALLOWED}}const iX={[yt.GAMES]:!0};class lX extends nE{constructor(a,o){super(a,o)}}const uX=(n,a,o)=>n.type===yt.GAMES?new sX(n,a,o):new lX(n,a),cX=(n,a,o)=>{n.features=new Map,n.sdk.featuresList=new _o(ba(new Set),"features-list"),n.activeFeature=new _o(ba(yt.UNSET),"activeFeature"),n.sdk.getFeatures=()=>n.features,n.sdk.getFeature=l=>n.features.get(l),n.sdk.getActiveFeature=()=>n.activeFeature.getStore(),n.sdk.openFeature=l=>{n.activeFeature.setValue(l)},n.sdk.closeFeature=(l=!1)=>{const c=n.activeFeature.getValue();if(n.activeFeature.setValue(yt.UNSET),l&&c){n.features.delete(c);const p=n.sdk.featuresList.getValue();p&&p.delete(c),n.sdk.featuresList.setValue(p)}},n.initFeature=(l,c=Qi.ORGANIZATION)=>{if(l.type in iX&&!n.features.has(l.type)){const p=uX(l,c,n);n.features.set(l.type,p);let f=n.sdk.featuresList.getValue();f?f.add(l.type):f=new Set([l.type]),n.sdk.featuresList.setValue(new Set(f))}},n.updateFeature=(l,c)=>{var p;(p=n.features.get(l.type))==null||p.update(l,c)},n.destroyFeature=l=>{n.features.delete(l.type);const c=n.sdk.featuresList.getValue();c&&c.delete(l.type),n.sdk.featuresList.setValue(new Set(c))},n.reinitializeFeatures=async()=>{const l=await n.stores.organizationSettings.getValue();n.features.clear(),n.sdk.featuresList.setValue(new Set);for(const c of(l==null?void 0:l.overlays)||[])n.initFeature(c,Qi.ORGANIZATION)},n.stores.providerStreamId.listen(l=>{l||n.reinitializeFeatures()}),n.storeSubscribe=()=>{const l=(p,f)=>{var y;if(f!=null&&f.overlays&&!((y=n.contextConfig)!=null&&y.skipOrganizationSettings&&p===Qi.ORGANIZATION))for(const b of f.overlays)b.sdkEnable===!0&&(n.features.has(b.type)?n.updateFeature(b,p):n.initFeature(b,p))},c={organizationSettings:p=>{if(p.data)try{l(Qi.ORGANIZATION,p.data)}catch(f){console.log(f)}},streamSettings:p=>{if(p.data)try{l(Qi.STREAM,p.data)}catch(f){console.log(f)}}};n.store.subscribe(c)},o()};class dX{constructor(a){M(this,"analytics");M(this,"accepted",()=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:va.INVITATION_ACCEPTED},category:i9.GAMES,from:u2.UNSET})});M(this,"sent",({from:a})=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:va.INVITATION_SENT},category:i9.GAMES,from:a||u2.UNSET})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="invitation")switch(l.slEventBus.action){case"sent":this.sent(l.slEventBus.payload);break}};return Io.listen(o)})}}class mX{constructor(a){M(this,"analytics");M(this,"tap",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:va.INTERACTIONS},actionType:k9.TAP})});M(this,"scroll",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:va.INTERACTIONS},actionType:k9.SCROLL})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="interactions")switch(l.slEventBus.action){case"tap":this.tap();break;case"scroll":this.scroll();break}};return Io.listen(o)})}}const fX={[gu.UNSET]:zs.UNSET,[gu.INGAME_IAB21]:zs.PROMOTION_INGAME_IAB21,[gu.INGAME_IAB11_LBAR]:zs.PROMOTION_INGAME_IAB11_LBAR,[gu.INGAME_IAB11]:zs.PROMOTION_INGAME_IAB11,[gu.INGAME_IAB21_LBAR]:zs.PROMOTION_INGAME_IAB21_LBAR,[gu.INGAME_IAB61]:zs.PROMOTION_INGAME_IAB61,[gu.EXTERNAL_AD]:zs.PROMOTION_GAM};class pX{constructor(a){M(this,"analytics");M(this,"received",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_RECEIVED,topicId:a,topicType:Ja.POLLS_PROMOTION,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"opened",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_OPENED,topicId:a,topicType:Ja.POLLS_PROMOTION,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"videoPlay",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:a,kind:va.AD_VIDEO_PLAYED,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"buttonSelect",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:a,kind:va.AD_BUTTON_NAVIGATED,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"bannerSelect",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:a,kind:va.AD_BANNER_NAVIGATED,topicSubType:o},pollOpenedFrom:Co.UNSET})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="advertisement"){const p=l.slEventBus.payload.advertisementType?fX[l.slEventBus.payload.advertisementType]:zs.UNSET;switch(l.slEventBus.action){case"videoPlay":this.videoPlay(l.slEventBus.payload,{topicSubType:p});break;case"buttonSelect":this.buttonSelect(l.slEventBus.payload,{topicSubType:p});break;case"bannerSelect":this.bannerSelect(l.slEventBus.payload,{topicSubType:p});break;case"received":this.received(l.slEventBus.payload,{topicSubType:p});break;case"opened":this.opened(l.slEventBus.payload,{topicSubType:p});break}}};return Io.listen(o)})}}const s2={[ke.UNSET]:Ja.UNSET,[ke.FACTOID]:Ja.POLLS_INSIGHT,[ke.POLL]:Ja.POLLS_POLL,[ke.PREDICTION]:Ja.POLLS_PREDICTION,[ke.PROMOTION]:Ja.POLLS_PROMOTION,[ke.TRIVIA]:Ja.POLLS_TRIVIA,[ke.TWEET]:Ja.POLLS_TWITTER};ke.UNSET+"",qs.UNSET,ke.FACTOID+"",qs.POLLS,ke.POLL+"",qs.POLLS,ke.PREDICTION+"",qs.POLLS,ke.PROMOTION+"",qs.POLLS,ke.TRIVIA+"",qs.POLLS,ke.TWEET+"",qs.POLLS;const hX={[yt.UNSET]:Ma.UNSET,[yt.INPLAY]:Ma.INPLAY,[yt.MESSAGING]:Ma.MESSAGING,[yt.STATISTICS]:Ma.STATS,[yt.BETTING]:Ma.BETTING,[yt.TWITTER]:Ma.TWITTER,[yt.MERCHANDISE]:Ma.MERCHANDISE,[yt.CONTESTS]:Ma.CONTESTS,[yt.VOICE_CHAT]:Ma.CALLING,[yt.TICKETS]:Ma.TICKETS,[yt.WHOIS_WATCHING]:Ma.WHOISWATCHING,[yt.PROFILE]:Ma.PROFILE,[yt.GAMES]:Ma.POLLS,[yt.GOLF_STATISTICS]:Ma.STATS,[yt.HIGHLIGHTS]:Ma.HIGHLIGHTS,[yt.PUBLIC_CHAT]:Ma.PUBLIC_CHAT};class gX{constructor(a){M(this,"analytics");M(this,"received",({questionId:a,questionType:o})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:va.NOTIFICATION_RECEIVED,topicId:a,topicType:o?s2[o]:Ja.UNSET},notificationKind:qs.POLLS,notificationType:S9.IN_APP})});M(this,"opened",({questionId:a,questionType:o})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:va.NOTIFICATION_OPENED,topicId:a,topicType:o?s2[o]:Ja.UNSET},notificationKind:qs.POLLS,notificationType:S9.IN_APP})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="notification")switch(l.slEventBus.action){case"rendered":this.received(l.slEventBus.payload);break;case"opened":this.opened(l.slEventBus.payload);break}};return Io.listen(o)})}}class yX{constructor(a){M(this,"analytics");M(this,"received",({questionId:a,questionType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_RECEIVED,topicId:a,topicType:o?s2[o]:Ja.UNSET},pollOpenedFrom:Co.UNSET})});M(this,"opened",({questionId:a,questionType:o,questionOpenedFrom:l})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_OPENED,topicId:a,topicType:o?s2[o]:Ja.UNSET},pollOpenedFrom:l==="list"?Co.PICK_HISTORY:Co.IN_APP})});M(this,"voted",({questionId:a,questionType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_VOTE,topicId:a,topicType:o?s2[o]:Ja.UNSET},pollOpenedFrom:Co.UNSET})});M(this,"onboardingPassed",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.GAMES_JOINED},pollOpenedFrom:Co.UNSET})});M(this,"navigated",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_NAVIGATED},pollOpenedFrom:Co.UNSET})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="poll")switch(l.slEventBus.action){case"voted":this.voted(l.slEventBus.payload);break;case"navigated":this.navigated();break;case"onboardingPassed":this.onboardingPassed();break;case"received":this.received(l.slEventBus.payload);break;case"opened":this.opened(l.slEventBus.payload);break}};return Io.listen(o)})}}const vX=({transport:n,$commonStore:a})=>{let o;const l=ba(!1),c=5e3,{client:p,queryKey:f}=n.createPromiseClient(ZC,{method:"send",params:[l]}),y=n.nanoquery.createFetcherStore(f,{fetcher:async()=>{const N=a.getStore().get();try{await p.unary({message:{case:"heartbeat",value:{common:{...N,kind:va.SESSION_HEARTBEAT}}}})}catch(L){Ki.error(L,"send heartbeat failed")}return Date.now()},refetchInterval:c}),b=()=>{Ki.debug("mounted heartbeat"),o=y.subscribe(()=>{})},C=()=>{Ki.debug("enabled heartbeat"),l.set(!0),y.lc===0&&b()},_=()=>{Ki.debug("disabled heartbeat"),l.set(!1)};return{enable:C,disable:_,mount:b,unmount:()=>{Ki.debug("unmounted heartbeat"),y.off(),o==null||o(),o=void 0,_()}}},Ki=Js("analytics");class TX{constructor(a){M(this,"commonStore");M(this,"notifications");M(this,"polls");M(this,"invitation");M(this,"interactions");M(this,"advertisement");M(this,"heartbeat");M(this,"analyticsClient");M(this,"listeners");M(this,"listenersCancels");M(this,"connected",!1);M(this,"connect",()=>{this.writeCommon("sessionId",T9()),this.heartbeat.enable(),this.listeners.forEach(a=>this.listenersCancels.add(a())),this.connected=!0,Ki.debug("analytics connected")});M(this,"disconnect",()=>{this.writeCommon("sessionId",""),this.writeCommon("overlaySessionId",""),this.heartbeat.unmount(),this.listenersCancels.forEach(a=>a()),this.connected=!1,Ki.debug("analytics disconnected")});M(this,"write",(a,o)=>{o&&this.analyticsClient.unary({message:{case:a,value:o}}).then(()=>{Ki.trace("send analytics success",a,o)}).catch(l=>{Ki.error(l,"send analytics failed")})});M(this,"writeCommon",(a,o)=>{this.commonStore.setValue(a,o)});M(this,"onConnect",a=>{this.listeners.add(a),this.connected&&this.listenersCancels.add(a())});M(this,"connectToSDK",a=>{this.onConnect(()=>a.stores.slStreamId.getAtomStore().subscribe(o=>{this.writeCommon("eventId",o)})),this.onConnect(()=>a.sdk.getActiveFeature().subscribe(o=>{o&&this.writeCommon("category",hX[o]),o!==yt.UNSET?this.writeCommon("overlaySessionId",T9()):this.writeCommon("overlaySessionId","")})),this.onConnect(()=>{const o=window.matchMedia("(orientation: portrait)"),l=c=>{this.writeCommon("screenOrientation",c.matches?s9.PORTRAIT:s9.LANDSCAPE)};return o.addEventListener("change",l),()=>{o.removeEventListener("change",l)}}),this.onConnect(()=>a.deepLink.$store.subscribe(o=>{o!=null&&o.handled&&this.invitation.accepted()}))});this.listeners=new Set,this.listenersCancels=new Set,this.commonStore=new Yc(is({}),"common-analytics"),this.connectToSDK(a),this.heartbeat=vX({transport:a.analyticsTransport,$commonStore:this.commonStore}),this.notifications=new gX(this),this.polls=new yX(this),this.invitation=new dX(this),this.interactions=new mX(this),this.advertisement=new pX(this);const{client:o}=a.analyticsTransport.createPromiseClient(ZC,{method:"send"});this.analyticsClient=o}}const bX=(n,a,o)=>{n.analytics=new TX(n),n.sdk.onMount({name:"analytics"},()=>(n.analytics.connect(),()=>{n.analytics.disconnect()})),o()};var fy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof f9<"u"?f9:typeof self<"u"?self:{};function kX(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var py={exports:{}},hy={exports:{}};function SX(n){var a=new n,o=a;function l(){var p=a;return p.next?a=p.next:(a=new n,o=a),p.next=null,p}function c(p){o.next=p,o=p}return{get:l,release:c}}var wX=SX,CX=wX;function uE(n,a,o){if(typeof n=="function"&&(o=a,a=n,n=null),!(o>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var l=CX(EX),c=null,p=null,f=0,y=null,b={push:F,drain:wo,saturated:wo,pause:_,paused:!1,get concurrency(){return o},set concurrency(ee){if(!(ee>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(o=ee,!b.paused)for(;c&&f<o;)f++,G()},running:C,resume:O,idle:D,length:N,getQueue:L,unshift:V,empty:wo,kill:W,killAndDrain:Z,error:ne};return b;function C(){return f}function _(){b.paused=!0}function N(){for(var ee=c,ue=0;ee;)ee=ee.next,ue++;return ue}function L(){for(var ee=c,ue=[];ee;)ue.push(ee.value),ee=ee.next;return ue}function O(){if(b.paused){if(b.paused=!1,c===null){f++,G();return}for(;c&&f<o;)f++,G()}}function D(){return f===0&&b.length()===0}function F(ee,ue){var oe=l.get();oe.context=n,oe.release=G,oe.value=ee,oe.callback=ue||wo,oe.errorHandler=y,f>=o||b.paused?p?(p.next=oe,p=oe):(c=oe,p=oe,b.saturated()):(f++,a.call(n,oe.value,oe.worked))}function V(ee,ue){var oe=l.get();oe.context=n,oe.release=G,oe.value=ee,oe.callback=ue||wo,oe.errorHandler=y,f>=o||b.paused?c?(oe.next=c,c=oe):(c=oe,p=oe,b.saturated()):(f++,a.call(n,oe.value,oe.worked))}function G(ee){ee&&l.release(ee);var ue=c;ue&&f<=o?b.paused?f--:(p===c&&(p=null),c=ue.next,ue.next=null,a.call(n,ue.value,ue.worked),p===null&&b.empty()):--f===0&&b.drain()}function W(){c=null,p=null,b.drain=wo}function Z(){c=null,p=null,b.drain(),b.drain=wo}function ne(ee){y=ee}}function wo(){}function EX(){this.value=null,this.callback=wo,this.next=null,this.release=wo,this.context=null,this.errorHandler=null;var n=this;this.worked=function(a,o){var l=n.callback,c=n.errorHandler,p=n.value;n.value=null,n.callback=wo,n.errorHandler&&c(a,p),l.call(n.context,a,o),n.release(n)}}function _X(n,a,o){typeof n=="function"&&(o=a,a=n,n=null);function l(_,N){a.call(this,_).then(function(L){N(null,L)},N)}var c=uE(n,l,o),p=c.push,f=c.unshift;return c.push=y,c.unshift=b,c.drained=C,c;function y(_){var N=new Promise(function(L,O){p(_,function(D,F){if(D){O(D);return}L(F)})});return N.catch(wo),N}function b(_){var N=new Promise(function(L,O){f(_,function(D,F){if(D){O(D);return}L(F)})});return N.catch(wo),N}function C(){if(c.idle())return new Promise(function(L){L()});var _=c.drain,N=new Promise(function(L){c.drain=function(){_(),L()}});return N}}hy.exports=uE;hy.exports.promise=_X;var cE=hy.exports,gy={exports:{}},mm=typeof Reflect=="object"?Reflect:null,ES=mm&&typeof mm.apply=="function"?mm.apply:function(n,a,o){return Function.prototype.apply.call(n,a,o)},Kh;mm&&typeof mm.ownKeys=="function"?Kh=mm.ownKeys:Object.getOwnPropertySymbols?Kh=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Kh=function(n){return Object.getOwnPropertyNames(n)};function IX(n){console&&console.warn&&console.warn(n)}var dE=Number.isNaN||function(n){return n!==n};function Qt(){Qt.init.call(this)}gy.exports=Qt;gy.exports.once=OX;Qt.EventEmitter=Qt;Qt.prototype._events=void 0;Qt.prototype._eventsCount=0;Qt.prototype._maxListeners=void 0;var _S=10;function O6(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return _S},set:function(n){if(typeof n!="number"||n<0||dE(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");_S=n}});Qt.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};Qt.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||dE(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function mE(n){return n._maxListeners===void 0?Qt.defaultMaxListeners:n._maxListeners}Qt.prototype.getMaxListeners=function(){return mE(this)};Qt.prototype.emit=function(n){for(var a=[],o=1;o<arguments.length;o++)a.push(arguments[o]);var l=n==="error",c=this._events;if(c!==void 0)l=l&&c.error===void 0;else if(!l)return!1;if(l){var p;if(a.length>0&&(p=a[0]),p instanceof Error)throw p;var f=new Error("Unhandled error."+(p?" ("+p.message+")":""));throw f.context=p,f}var y=c[n];if(y===void 0)return!1;if(typeof y=="function")ES(y,this,a);else for(var b=y.length,C=yE(y,b),o=0;o<b;++o)ES(C[o],this,a);return!0};function fE(n,a,o,l){var c,p,f;if(O6(o),p=n._events,p===void 0?(p=n._events=Object.create(null),n._eventsCount=0):(p.newListener!==void 0&&(n.emit("newListener",a,o.listener?o.listener:o),p=n._events),f=p[a]),f===void 0)f=p[a]=o,++n._eventsCount;else if(typeof f=="function"?f=p[a]=l?[o,f]:[f,o]:l?f.unshift(o):f.push(o),c=mE(n),c>0&&f.length>c&&!f.warned){f.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=n,y.type=a,y.count=f.length,IX(y)}return n}Qt.prototype.addListener=function(n,a){return fE(this,n,a,!1)};Qt.prototype.on=Qt.prototype.addListener;Qt.prototype.prependListener=function(n,a){return fE(this,n,a,!0)};function NX(){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 pE(n,a,o){var l={fired:!1,wrapFn:void 0,target:n,type:a,listener:o},c=NX.bind(l);return c.listener=o,l.wrapFn=c,c}Qt.prototype.once=function(n,a){return O6(a),this.on(n,pE(this,n,a)),this};Qt.prototype.prependOnceListener=function(n,a){return O6(a),this.prependListener(n,pE(this,n,a)),this};Qt.prototype.removeListener=function(n,a){var o,l,c,p,f;if(O6(a),l=this._events,l===void 0)return this;if(o=l[n],o===void 0)return this;if(o===a||o.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete l[n],l.removeListener&&this.emit("removeListener",n,o.listener||a));else if(typeof o!="function"){for(c=-1,p=o.length-1;p>=0;p--)if(o[p]===a||o[p].listener===a){f=o[p].listener,c=p;break}if(c<0)return this;c===0?o.shift():RX(o,c),o.length===1&&(l[n]=o[0]),l.removeListener!==void 0&&this.emit("removeListener",n,f||a)}return this};Qt.prototype.off=Qt.prototype.removeListener;Qt.prototype.removeAllListeners=function(n){var a,o,l;if(o=this._events,o===void 0)return this;if(o.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):o[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete o[n]),this;if(arguments.length===0){var c=Object.keys(o),p;for(l=0;l<c.length;++l)p=c[l],p!=="removeListener"&&this.removeAllListeners(p);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=o[n],typeof a=="function")this.removeListener(n,a);else if(a!==void 0)for(l=a.length-1;l>=0;l--)this.removeListener(n,a[l]);return this};function hE(n,a,o){var l=n._events;if(l===void 0)return[];var c=l[a];return c===void 0?[]:typeof c=="function"?o?[c.listener||c]:[c]:o?LX(c):yE(c,c.length)}Qt.prototype.listeners=function(n){return hE(this,n,!0)};Qt.prototype.rawListeners=function(n){return hE(this,n,!1)};Qt.listenerCount=function(n,a){return typeof n.listenerCount=="function"?n.listenerCount(a):gE.call(n,a)};Qt.prototype.listenerCount=gE;function gE(n){var a=this._events;if(a!==void 0){var o=a[n];if(typeof o=="function")return 1;if(o!==void 0)return o.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Kh(this._events):[]};function yE(n,a){for(var o=new Array(a),l=0;l<a;++l)o[l]=n[l];return o}function RX(n,a){for(;a+1<n.length;a++)n[a]=n[a+1];n.pop()}function LX(n){for(var a=new Array(n.length),o=0;o<a.length;++o)a[o]=n[o].listener||n[o];return a}function OX(n,a){return new Promise(function(o,l){function c(f){n.removeListener(a,p),l(f)}function p(){typeof n.removeListener=="function"&&n.removeListener("error",c),o([].slice.call(arguments))}vE(n,a,p,{once:!0}),a!=="error"&&xX(n,c,{once:!0})})}function xX(n,a,o){typeof n.on=="function"&&vE(n,"error",a,o)}function vE(n,a,o,l){if(typeof n.on=="function")l.once?n.once(a,o):n.on(a,o);else if(typeof n.addEventListener=="function")n.addEventListener(a,function c(p){l.once&&n.removeEventListener(a,c),o(p)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}var TE=gy.exports,x6={},bE={},kE=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},a=Symbol("test"),o=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var l=42;n[a]=l;for(a in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var c=Object.getOwnPropertySymbols(n);if(c.length!==1||c[0]!==a||!Object.prototype.propertyIsEnumerable.call(n,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(n,a);if(p.value!==l||p.enumerable!==!0)return!1}return!0},AX=kE,A6=function(){return AX()&&!!Symbol.toStringTag},PX=Error,MX=EvalError,DX=RangeError,UX=ReferenceError,SE=SyntaxError,P6=TypeError,FX=URIError,IS=typeof Symbol<"u"&&Symbol,VX=kE,jX=function(){return typeof IS!="function"||typeof Symbol!="function"||typeof IS("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:VX()},F5={__proto__:null,foo:{}},BX=Object,$X=function(){return{__proto__:F5}.foo===F5.foo&&!(F5 instanceof BX)},zX="Function.prototype.bind called on incompatible ",HX=Object.prototype.toString,GX=Math.max,qX="[object Function]",NS=function(n,a){for(var o=[],l=0;l<n.length;l+=1)o[l]=n[l];for(var c=0;c<a.length;c+=1)o[c+n.length]=a[c];return o},WX=function(n,a){for(var o=[],l=a,c=0;l<n.length;l+=1,c+=1)o[c]=n[l];return o},QX=function(n,a){for(var o="",l=0;l<n.length;l+=1)o+=n[l],l+1<n.length&&(o+=a);return o},YX=function(n){var a=this;if(typeof a!="function"||HX.apply(a)!==qX)throw new TypeError(zX+a);for(var o=WX(arguments,1),l,c=function(){if(this instanceof l){var C=a.apply(this,NS(o,arguments));return Object(C)===C?C:this}return a.apply(n,NS(o,arguments))},p=GX(0,a.length-o.length),f=[],y=0;y<p;y++)f[y]="$"+y;if(l=Function("binder","return function ("+QX(f,",")+"){ return binder.apply(this,arguments); }")(c),a.prototype){var b=function(){};b.prototype=a.prototype,l.prototype=new b,b.prototype=null}return l},KX=YX,yy=Function.prototype.bind||KX,ZX=Function.prototype.call,XX=Object.prototype.hasOwnProperty,JX=yy,eJ=JX.call(ZX,XX),Ot,tJ=PX,nJ=MX,aJ=DX,rJ=UX,vm=SE,fm=P6,oJ=FX,wE=Function,V5=function(n){try{return wE('"use strict"; return ('+n+").constructor;")()}catch{}},Zc=Object.getOwnPropertyDescriptor;if(Zc)try{Zc({},"")}catch{Zc=null}var j5=function(){throw new fm},sJ=Zc?function(){try{return arguments.callee,j5}catch{try{return Zc(arguments,"callee").get}catch{return j5}}}():j5,em=jX(),iJ=$X(),ha=Object.getPrototypeOf||(iJ?function(n){return n.__proto__}:null),nm={},lJ=typeof Uint8Array>"u"||!ha?Ot:ha(Uint8Array),Xc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ot:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ot:ArrayBuffer,"%ArrayIteratorPrototype%":em&&ha?ha([][Symbol.iterator]()):Ot,"%AsyncFromSyncIteratorPrototype%":Ot,"%AsyncFunction%":nm,"%AsyncGenerator%":nm,"%AsyncGeneratorFunction%":nm,"%AsyncIteratorPrototype%":nm,"%Atomics%":typeof Atomics>"u"?Ot:Atomics,"%BigInt%":typeof BigInt>"u"?Ot:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ot:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ot:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ot:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":tJ,"%eval%":eval,"%EvalError%":nJ,"%Float32Array%":typeof Float32Array>"u"?Ot:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ot:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ot:FinalizationRegistry,"%Function%":wE,"%GeneratorFunction%":nm,"%Int8Array%":typeof Int8Array>"u"?Ot:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ot:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ot:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":em&&ha?ha(ha([][Symbol.iterator]())):Ot,"%JSON%":typeof JSON=="object"?JSON:Ot,"%Map%":typeof Map>"u"?Ot:Map,"%MapIteratorPrototype%":typeof Map>"u"||!em||!ha?Ot:ha(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ot:Promise,"%Proxy%":typeof Proxy>"u"?Ot:Proxy,"%RangeError%":aJ,"%ReferenceError%":rJ,"%Reflect%":typeof Reflect>"u"?Ot:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ot:Set,"%SetIteratorPrototype%":typeof Set>"u"||!em||!ha?Ot:ha(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ot:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":em&&ha?ha(""[Symbol.iterator]()):Ot,"%Symbol%":em?Symbol:Ot,"%SyntaxError%":vm,"%ThrowTypeError%":sJ,"%TypedArray%":lJ,"%TypeError%":fm,"%Uint8Array%":typeof Uint8Array>"u"?Ot:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ot:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ot:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ot:Uint32Array,"%URIError%":oJ,"%WeakMap%":typeof WeakMap>"u"?Ot:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ot:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ot:WeakSet};if(ha)try{null.error}catch(n){var uJ=ha(ha(n));Xc["%Error.prototype%"]=uJ}var cJ=function n(a){var o;if(a==="%AsyncFunction%")o=V5("async function () {}");else if(a==="%GeneratorFunction%")o=V5("function* () {}");else if(a==="%AsyncGeneratorFunction%")o=V5("async function* () {}");else if(a==="%AsyncGenerator%"){var l=n("%AsyncGeneratorFunction%");l&&(o=l.prototype)}else if(a==="%AsyncIteratorPrototype%"){var c=n("%AsyncGenerator%");c&&ha&&(o=ha(c.prototype))}return Xc[a]=o,o},RS={__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"]},y2=yy,p6=eJ,dJ=y2.call(Function.call,Array.prototype.concat),mJ=y2.call(Function.apply,Array.prototype.splice),LS=y2.call(Function.call,String.prototype.replace),h6=y2.call(Function.call,String.prototype.slice),fJ=y2.call(Function.call,RegExp.prototype.exec),pJ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,hJ=/\\(\\)?/g,gJ=function(n){var a=h6(n,0,1),o=h6(n,-1);if(a==="%"&&o!=="%")throw new vm("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&a!=="%")throw new vm("invalid intrinsic syntax, expected opening `%`");var l=[];return LS(n,pJ,function(c,p,f,y){l[l.length]=f?LS(y,hJ,"$1"):p||c}),l},yJ=function(n,a){var o=n,l;if(p6(RS,o)&&(l=RS[o],o="%"+l[0]+"%"),p6(Xc,o)){var c=Xc[o];if(c===nm&&(c=cJ(o)),typeof c>"u"&&!a)throw new fm("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:l,name:o,value:c}}throw new vm("intrinsic "+n+" does not exist!")},v2=function(n,a){if(typeof n!="string"||n.length===0)throw new fm("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new fm('"allowMissing" argument must be a boolean');if(fJ(/^%?[^%]*%?$/,n)===null)throw new vm("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=gJ(n),l=o.length>0?o[0]:"",c=yJ("%"+l+"%",a),p=c.name,f=c.value,y=!1,b=c.alias;b&&(l=b[0],mJ(o,dJ([0,1],b)));for(var C=1,_=!0;C<o.length;C+=1){var N=o[C],L=h6(N,0,1),O=h6(N,-1);if((L==='"'||L==="'"||L==="`"||O==='"'||O==="'"||O==="`")&&L!==O)throw new vm("property names with quotes must have matching quotes");if((N==="constructor"||!_)&&(y=!0),l+="."+N,p="%"+l+"%",p6(Xc,p))f=Xc[p];else if(f!=null){if(!(N in f)){if(!a)throw new fm("base intrinsic for "+n+" exists, but the property is not available.");return}if(Zc&&C+1>=o.length){var D=Zc(f,N);_=!!D,_&&"get"in D&&!("originalValue"in D.get)?f=D.get:f=f[N]}else _=p6(f,N),f=f[N];_&&!y&&(Xc[p]=f)}}return f},CE={exports:{}},B5,OS;function vy(){if(OS)return B5;OS=1;var n=v2,a=n("%Object.defineProperty%",!0)||!1;if(a)try{a({},"a",{value:1})}catch{a=!1}return B5=a,B5}var vJ=v2,Zh=vJ("%Object.getOwnPropertyDescriptor%",!0);if(Zh)try{Zh([],"length")}catch{Zh=null}var M6=Zh,xS=vy(),TJ=SE,tm=P6,AS=M6,bJ=function(n,a,o){if(!n||typeof n!="object"&&typeof n!="function")throw new tm("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new tm("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new tm("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new tm("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new tm("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new tm("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,y=!!AS&&AS(n,a);if(xS)xS(n,a,{configurable:p===null&&y?y.configurable:!p,enumerable:l===null&&y?y.enumerable:!l,value:o,writable:c===null&&y?y.writable:!c});else if(f||!l&&!c&&!p)n[a]=o;else throw new TJ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},I9=vy(),EE=function(){return!!I9};EE.hasArrayLengthDefineBug=function(){if(!I9)return null;try{return I9([],"length",{value:1}).length!==1}catch{return!0}};var kJ=EE,SJ=v2,PS=bJ,wJ=kJ(),MS=M6,DS=P6,CJ=SJ("%Math.floor%"),EJ=function(n,a){if(typeof n!="function")throw new DS("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||CJ(a)!==a)throw new DS("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in n&&MS){var p=MS(n,"length");p&&!p.configurable&&(l=!1),p&&!p.writable&&(c=!1)}return(l||c||!o)&&(wJ?PS(n,"length",a,!0,!0):PS(n,"length",a)),n};(function(n){var a=yy,o=v2,l=EJ,c=P6,p=o("%Function.prototype.apply%"),f=o("%Function.prototype.call%"),y=o("%Reflect.apply%",!0)||a.call(f,p),b=vy(),C=o("%Math.max%");n.exports=function(N){if(typeof N!="function")throw new c("a function is required");var L=y(a,f,arguments);return l(L,1+C(0,N.length-(arguments.length-1)),!0)};var _=function(){return y(a,p,arguments)};b?b(n.exports,"apply",{value:_}):n.exports.apply=_})(CE);var Ty=CE.exports,_E=v2,IE=Ty,_J=IE(_E("String.prototype.indexOf")),by=function(n,a){var o=_E(n,!!a);return typeof o=="function"&&_J(n,".prototype.")>-1?IE(o):o},IJ=A6(),NJ=by,N9=NJ("Object.prototype.toString"),D6=function(n){return IJ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:N9(n)==="[object Arguments]"},NE=function(n){return D6(n)?!0:n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&N9(n)!=="[object Array]"&&N9(n.callee)==="[object Function]"},RJ=function(){return D6(arguments)}();D6.isLegacyArguments=NE;var LJ=RJ?D6:NE,OJ=Object.prototype.toString,xJ=Function.prototype.toString,AJ=/^\s*(?:function)?\*/,RE=A6(),$5=Object.getPrototypeOf,PJ=function(){if(!RE)return!1;try{return Function("return function*() {}")()}catch{}},z5,MJ=function(n){if(typeof n!="function")return!1;if(AJ.test(xJ.call(n)))return!0;if(!RE){var a=OJ.call(n);return a==="[object GeneratorFunction]"}if(!$5)return!1;if(typeof z5>"u"){var o=PJ();z5=o?$5(o):!1}return $5(n)===z5},LE=Function.prototype.toString,sm=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,R9,Xh;if(typeof sm=="function"&&typeof Object.defineProperty=="function")try{R9=Object.defineProperty({},"length",{get:function(){throw Xh}}),Xh={},sm(function(){throw 42},null,R9)}catch(n){n!==Xh&&(sm=null)}else sm=null;var DJ=/^\s*class\b/,L9=function(n){try{var a=LE.call(n);return DJ.test(a)}catch{return!1}},H5=function(n){try{return L9(n)?!1:(LE.call(n),!0)}catch{return!1}},Jh=Object.prototype.toString,UJ="[object Object]",FJ="[object Function]",VJ="[object GeneratorFunction]",jJ="[object HTMLAllCollection]",BJ="[object HTML document.all class]",$J="[object HTMLCollection]",zJ=typeof Symbol=="function"&&!!Symbol.toStringTag,HJ=!(0 in[,]),O9=function(){return!1};if(typeof document=="object"){var GJ=document.all;Jh.call(GJ)===Jh.call(document.all)&&(O9=function(n){if((HJ||!n)&&(typeof n>"u"||typeof n=="object"))try{var a=Jh.call(n);return(a===jJ||a===BJ||a===$J||a===UJ)&&n("")==null}catch{}return!1})}var qJ=sm?function(n){if(O9(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;try{sm(n,null,R9)}catch(a){if(a!==Xh)return!1}return!L9(n)&&H5(n)}:function(n){if(O9(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;if(zJ)return H5(n);if(L9(n))return!1;var a=Jh.call(n);return a!==FJ&&a!==VJ&&!/^\[object HTML/.test(a)?!1:H5(n)},WJ=qJ,QJ=Object.prototype.toString,OE=Object.prototype.hasOwnProperty,YJ=function(n,a,o){for(var l=0,c=n.length;l<c;l++)OE.call(n,l)&&(o==null?a(n[l],l,n):a.call(o,n[l],l,n))},KJ=function(n,a,o){for(var l=0,c=n.length;l<c;l++)o==null?a(n.charAt(l),l,n):a.call(o,n.charAt(l),l,n)},ZJ=function(n,a,o){for(var l in n)OE.call(n,l)&&(o==null?a(n[l],l,n):a.call(o,n[l],l,n))},XJ=function(n,a,o){if(!WJ(a))throw new TypeError("iterator must be a function");var l;arguments.length>=3&&(l=o),QJ.call(n)==="[object Array]"?YJ(n,a,l):typeof n=="string"?KJ(n,a,l):ZJ(n,a,l)},xE=XJ,JJ=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],G5=JJ,eee=typeof globalThis>"u"?fy:globalThis,AE=function(){for(var n=[],a=0;a<G5.length;a++)typeof eee[G5[a]]=="function"&&(n[n.length]=G5[a]);return n},g6=xE,tee=AE,US=Ty,ky=by,e6=M6,nee=ky("Object.prototype.toString"),PE=A6(),FS=typeof globalThis>"u"?fy:globalThis,x9=tee(),Sy=ky("String.prototype.slice"),q5=Object.getPrototypeOf,aee=ky("Array.prototype.indexOf",!0)||function(n,a){for(var o=0;o<n.length;o+=1)if(n[o]===a)return o;return-1},y6={__proto__:null};PE&&e6&&q5?g6(x9,function(n){var a=new FS[n];if(Symbol.toStringTag in a){var o=q5(a),l=e6(o,Symbol.toStringTag);if(!l){var c=q5(o);l=e6(c,Symbol.toStringTag)}y6["$"+n]=US(l.get)}}):g6(x9,function(n){var a=new FS[n],o=a.slice||a.set;o&&(y6["$"+n]=US(o))});var ree=function(n){var a=!1;return g6(y6,function(o,l){if(!a)try{"$"+o(n)===l&&(a=Sy(l,1))}catch{}}),a},oee=function(n){var a=!1;return g6(y6,function(o,l){if(!a)try{o(n),a=Sy(l,1)}catch{}}),a},see=function(n){if(!n||typeof n!="object")return!1;if(!PE){var a=Sy(nee(n),8,-1);return aee(x9,a)>-1?a:a!=="Object"?!1:oee(n)}return e6?ree(n):null},v6=xE,iee=AE,VS=Ty,wy=by,t6=M6,lee=wy("Object.prototype.toString"),ME=A6(),jS=typeof globalThis>"u"?fy:globalThis,A9=iee(),Cy=wy("String.prototype.slice"),W5=Object.getPrototypeOf,uee=wy("Array.prototype.indexOf",!0)||function(n,a){for(var o=0;o<n.length;o+=1)if(n[o]===a)return o;return-1},T6={__proto__:null};ME&&t6&&W5?v6(A9,function(n){var a=new jS[n];if(Symbol.toStringTag in a){var o=W5(a),l=t6(o,Symbol.toStringTag);if(!l){var c=W5(o);l=t6(c,Symbol.toStringTag)}T6["$"+n]=VS(l.get)}}):v6(A9,function(n){var a=new jS[n],o=a.slice||a.set;o&&(T6["$"+n]=VS(o))});var cee=function(n){var a=!1;return v6(T6,function(o,l){if(!a)try{"$"+o(n)===l&&(a=Cy(l,1))}catch{}}),a},dee=function(n){var a=!1;return v6(T6,function(o,l){if(!a)try{o(n),a=Cy(l,1)}catch{}}),a},mee=function(n){if(!n||typeof n!="object")return!1;if(!ME){var a=Cy(lee(n),8,-1);return uee(A9,a)>-1?a:a!=="Object"?!1:dee(n)}return t6?cee(n):null},fee=mee,pee=function(n){return!!fee(n)};(function(n){var a=LJ,o=MJ,l=see,c=pee;function p(de){return de.call.bind(de)}var f=typeof BigInt<"u",y=typeof Symbol<"u",b=p(Object.prototype.toString),C=p(Number.prototype.valueOf),_=p(String.prototype.valueOf),N=p(Boolean.prototype.valueOf);if(f)var L=p(BigInt.prototype.valueOf);if(y)var O=p(Symbol.prototype.valueOf);function D(de,No){if(typeof de!="object")return!1;try{return No(de),!0}catch{return!1}}n.isArgumentsObject=a,n.isGeneratorFunction=o,n.isTypedArray=c;function F(de){return typeof Promise<"u"&&de instanceof Promise||de!==null&&typeof de=="object"&&typeof de.then=="function"&&typeof de.catch=="function"}n.isPromise=F;function V(de){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(de):c(de)||se(de)}n.isArrayBufferView=V;function G(de){return l(de)==="Uint8Array"}n.isUint8Array=G;function W(de){return l(de)==="Uint8ClampedArray"}n.isUint8ClampedArray=W;function Z(de){return l(de)==="Uint16Array"}n.isUint16Array=Z;function ne(de){return l(de)==="Uint32Array"}n.isUint32Array=ne;function ee(de){return l(de)==="Int8Array"}n.isInt8Array=ee;function ue(de){return l(de)==="Int16Array"}n.isInt16Array=ue;function oe(de){return l(de)==="Int32Array"}n.isInt32Array=oe;function Ne(de){return l(de)==="Float32Array"}n.isFloat32Array=Ne;function Ie(de){return l(de)==="Float64Array"}n.isFloat64Array=Ie;function Ze(de){return l(de)==="BigInt64Array"}n.isBigInt64Array=Ze;function Ge(de){return l(de)==="BigUint64Array"}n.isBigUint64Array=Ge;function Qe(de){return b(de)==="[object Map]"}Qe.working=typeof Map<"u"&&Qe(new Map);function _e(de){return typeof Map>"u"?!1:Qe.working?Qe(de):de instanceof Map}n.isMap=_e;function et(de){return b(de)==="[object Set]"}et.working=typeof Set<"u"&&et(new Set);function ht(de){return typeof Set>"u"?!1:et.working?et(de):de instanceof Set}n.isSet=ht;function Rt(de){return b(de)==="[object WeakMap]"}Rt.working=typeof WeakMap<"u"&&Rt(new WeakMap);function Wn(de){return typeof WeakMap>"u"?!1:Rt.working?Rt(de):de instanceof WeakMap}n.isWeakMap=Wn;function Te(de){return b(de)==="[object WeakSet]"}Te.working=typeof WeakSet<"u"&&Te(new WeakSet);function Pe(de){return Te(de)}n.isWeakSet=Pe;function Se(de){return b(de)==="[object ArrayBuffer]"}Se.working=typeof ArrayBuffer<"u"&&Se(new ArrayBuffer);function ct(de){return typeof ArrayBuffer>"u"?!1:Se.working?Se(de):de instanceof ArrayBuffer}n.isArrayBuffer=ct;function B(de){return b(de)==="[object DataView]"}B.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&B(new DataView(new ArrayBuffer(1),0,1));function se(de){return typeof DataView>"u"?!1:B.working?B(de):de instanceof DataView}n.isDataView=se;var me=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function qe(de){return b(de)==="[object SharedArrayBuffer]"}function gt(de){return typeof me>"u"?!1:(typeof qe.working>"u"&&(qe.working=qe(new me)),qe.working?qe(de):de instanceof me)}n.isSharedArrayBuffer=gt;function it(de){return b(de)==="[object AsyncFunction]"}n.isAsyncFunction=it;function tt(de){return b(de)==="[object Map Iterator]"}n.isMapIterator=tt;function lt(de){return b(de)==="[object Set Iterator]"}n.isSetIterator=lt;function Et(de){return b(de)==="[object Generator]"}n.isGeneratorObject=Et;function Yt(de){return b(de)==="[object WebAssembly.Module]"}n.isWebAssemblyCompiledModule=Yt;function In(de){return D(de,C)}n.isNumberObject=In;function Gt(de){return D(de,_)}n.isStringObject=Gt;function nn(de){return D(de,N)}n.isBooleanObject=nn;function Nt(de){return f&&D(de,L)}n.isBigIntObject=Nt;function sn(de){return y&&D(de,O)}n.isSymbolObject=sn;function Nn(de){return In(de)||Gt(de)||nn(de)||Nt(de)||sn(de)}n.isBoxedPrimitive=Nn;function zr(de){return typeof Uint8Array<"u"&&(ct(de)||gt(de))}n.isAnyArrayBuffer=zr,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(de){Object.defineProperty(n,de,{enumerable:!1,value:function(){throw new Error(de+" is not supported in userland")}})})})(bE);var hee=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"},P9={exports:{}};typeof Object.create=="function"?P9.exports=function(n,a){a&&(n.super_=a,n.prototype=Object.create(a.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:P9.exports=function(n,a){if(a){n.super_=a;var o=function(){};o.prototype=a.prototype,n.prototype=new o,n.prototype.constructor=n}};var gee=P9.exports;(function(n){var a=Object.getOwnPropertyDescriptors||function(B){for(var se=Object.keys(B),me={},qe=0;qe<se.length;qe++)me[se[qe]]=Object.getOwnPropertyDescriptor(B,se[qe]);return me},o=/%[sdj%]/g;n.format=function(B){if(!ee(B)){for(var se=[],me=0;me<arguments.length;me++)se.push(f(arguments[me]));return se.join(" ")}for(var me=1,qe=arguments,gt=qe.length,it=String(B).replace(o,function(Et){if(Et==="%%")return"%";if(me>=gt)return Et;switch(Et){case"%s":return String(qe[me++]);case"%d":return Number(qe[me++]);case"%j":try{return JSON.stringify(qe[me++])}catch{return"[Circular]"}default:return Et}}),tt=qe[me];me<gt;tt=qe[++me])W(tt)||!Ie(tt)?it+=" "+tt:it+=" "+f(tt);return it},n.deprecate=function(B,se){if(typeof St<"u"&&St.noDeprecation===!0)return B;if(typeof St>"u")return function(){return n.deprecate(B,se).apply(this,arguments)};var me=!1;function qe(){if(!me){if(St.throwDeprecation)throw new Error(se);St.traceDeprecation?console.trace(se):console.error(se),me=!0}return B.apply(this,arguments)}return qe};var l={},c=/^$/;if(St.env.NODE_DEBUG){var p=St.env.NODE_DEBUG;p=p.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+p+"$","i")}n.debuglog=function(B){if(B=B.toUpperCase(),!l[B])if(c.test(B)){var se=St.pid;l[B]=function(){var me=n.format.apply(n,arguments);console.error("%s %d: %s",B,se,me)}}else l[B]=function(){};return l[B]};function f(B,se){var me={seen:[],stylize:b};return arguments.length>=3&&(me.depth=arguments[2]),arguments.length>=4&&(me.colors=arguments[3]),G(se)?me.showHidden=se:se&&n._extend(me,se),oe(me.showHidden)&&(me.showHidden=!1),oe(me.depth)&&(me.depth=2),oe(me.colors)&&(me.colors=!1),oe(me.customInspect)&&(me.customInspect=!0),me.colors&&(me.stylize=y),_(me,B,me.depth)}n.inspect=f,f.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]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function y(B,se){var me=f.styles[se];return me?"\x1B["+f.colors[me][0]+"m"+B+"\x1B["+f.colors[me][1]+"m":B}function b(B,se){return B}function C(B){var se={};return B.forEach(function(me,qe){se[me]=!0}),se}function _(B,se,me){if(B.customInspect&&se&&Qe(se.inspect)&&se.inspect!==n.inspect&&!(se.constructor&&se.constructor.prototype===se)){var qe=se.inspect(me,B);return ee(qe)||(qe=_(B,qe,me)),qe}var gt=N(B,se);if(gt)return gt;var it=Object.keys(se),tt=C(it);if(B.showHidden&&(it=Object.getOwnPropertyNames(se)),Ge(se)&&(it.indexOf("message")>=0||it.indexOf("description")>=0))return L(se);if(it.length===0){if(Qe(se)){var lt=se.name?": "+se.name:"";return B.stylize("[Function"+lt+"]","special")}if(Ne(se))return B.stylize(RegExp.prototype.toString.call(se),"regexp");if(Ze(se))return B.stylize(Date.prototype.toString.call(se),"date");if(Ge(se))return L(se)}var Et="",Yt=!1,In=["{","}"];if(V(se)&&(Yt=!0,In=["[","]"]),Qe(se)){var Gt=se.name?": "+se.name:"";Et=" [Function"+Gt+"]"}if(Ne(se)&&(Et=" "+RegExp.prototype.toString.call(se)),Ze(se)&&(Et=" "+Date.prototype.toUTCString.call(se)),Ge(se)&&(Et=" "+L(se)),it.length===0&&(!Yt||se.length==0))return In[0]+Et+In[1];if(me<0)return Ne(se)?B.stylize(RegExp.prototype.toString.call(se),"regexp"):B.stylize("[Object]","special");B.seen.push(se);var nn;return Yt?nn=O(B,se,me,tt,it):nn=it.map(function(Nt){return D(B,se,me,tt,Nt,Yt)}),B.seen.pop(),F(nn,Et,In)}function N(B,se){if(oe(se))return B.stylize("undefined","undefined");if(ee(se)){var me="'"+JSON.stringify(se).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize(me,"string")}if(ne(se))return B.stylize(""+se,"number");if(G(se))return B.stylize(""+se,"boolean");if(W(se))return B.stylize("null","null")}function L(B){return"["+Error.prototype.toString.call(B)+"]"}function O(B,se,me,qe,gt){for(var it=[],tt=0,lt=se.length;tt<lt;++tt)Te(se,String(tt))?it.push(D(B,se,me,qe,String(tt),!0)):it.push("");return gt.forEach(function(Et){Et.match(/^\d+$/)||it.push(D(B,se,me,qe,Et,!0))}),it}function D(B,se,me,qe,gt,it){var tt,lt,Et;if(Et=Object.getOwnPropertyDescriptor(se,gt)||{value:se[gt]},Et.get?Et.set?lt=B.stylize("[Getter/Setter]","special"):lt=B.stylize("[Getter]","special"):Et.set&&(lt=B.stylize("[Setter]","special")),Te(qe,gt)||(tt="["+gt+"]"),lt||(B.seen.indexOf(Et.value)<0?(W(me)?lt=_(B,Et.value,null):lt=_(B,Et.value,me-1),lt.indexOf(`
|
|
199
|
+
`+l)}catch(c){rE(c)&&window.sessionStorage.removeItem("slstreamlogs"),window.sessionStorage.setItem("slstreamlogs",l)}});M(this,"addListener",(a,o)=>this.listeners.has(a)?(this.addStateLog(`listener '${a}' not added, already exists`),()=>{}):(this.listeners.set(a,o),this.addStateLog(`listener '${a}' added`),()=>this.removeListener(a)));M(this,"removeListener",a=>{this.listeners.delete(a),this.addStateLog(`listener '${a}' removed`)});M(this,"connect",()=>{this.updateState(os.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const a="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const o={headers:this.headers.getValues(),signal:this.streamCancel.signal},l=this.method(a,o);for await(const c of l)this.attempt=0,this.onData(c)}catch(o){o instanceof zt&&o.code!=st.Canceled&&this.onStreamError(o)}})(),this.updateState(os.Connected)});M(this,"disconnect",()=>{var a;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(a=this.paramsListener)==null||a.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(os.Disconnected)});M(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(os.Reconnect);const a=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),o=Math.round(a*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(os.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${o}ms`),this.connect(),this.reconnectTimeout=void 0},o)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});M(this,"getStore",()=>{var a;return(a=this.store)==null?void 0:a.getStore()});M(this,"onData",a=>{try{this.addStateLog(`received data => ${JSON.stringify(a)}`),this.store&&this.store.setValue(a);for(const[,o]of this.listeners)o(a);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(o){this.addStateLog(`error process data => ${o}`)}});M(this,"onStreamError",a=>{if(this.addStateLog(`error => ${a?JSON.stringify(a):"undefined"}}`),a!==void 0){if(a instanceof zt&&a.code!==st.Canceled){this.updateState(os.Failed),this.state.setValue("error",a),this.reconnect();return}this.disconnect()}});const p={status:os.Init,ts:new Date,log:[]};this.state=new Yc(is(p),`subscription:${c.name}:state`),this.options={...c,reconnectDelay:c.reconnectDelay??1e3,reconnectMaxDelay:c.reconnectMaxDelay??3e4,reconnectMaxAttempts:c.reconnectMaxAttempts??10,withStore:c.withStore??!1},this.headers=a,this.listeners=new Map,this.params=l,this.method=o,c.withStore&&(this.store=new _o(ba(null),`subscription:${c.name}:store`)),"subscribe"in l&&typeof l.subscribe=="function"&&(this.paramsListener=l.subscribe(f=>{this.state.getValue("status")===os.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(f)}`),this.reconnect())})),this.updateState(os.Ready)}}const nZ=new Set([st.Unknown,st.Internal,st.DeadlineExceeded,st.ResourceExhausted,st.FailedPrecondition,st.Unavailable,st.DataLoss]),vS=Js("grpc:retry"),aZ=n=>async a=>{const o=a.contextValues.get(E9.retryAttempts),l=300,c=a.contextValues.get(E9.retryDelay);if(a.stream||o===0)return n(a);vS.trace({url:a.url,attempts:o,maxDelay:c},"retry options");for(let p=0;;p++)try{return await n(a)}catch(f){vS.trace({attempt:p,error:f},"retry attempt");const y=zt.from(f);if(p>=o||!(y instanceof zt)||!nZ.has(y.code))throw f;const b=Math.min(c,Math.pow(2,p)*l),C=Math.round(b*(1+Math.random())/2);await new Promise(_=>setTimeout(_,C))}},E9={retryAttempts:d6(10,{description:"Number of attempts to retry"}),retryDelay:d6(3e4,{description:"Max delay between retries in milliseconds"})},rZ=()=>{const n=localStorage.getItem("sl-device-id");if(n)return n;const a=T9();return localStorage.setItem("sl-device-id",a),a},oZ=()=>{var n;return((n=navigator.userAgentData)==null?void 0:n.platform)||navigator.platform};class TS{constructor(a,o){M(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});M(this,"transport");M(this,"streamTransport");M(this,"nanoquery");M(this,"host");M(this,"$headers");M(this,"interceptors",[]);M(this,"clients");M(this,"streamClients");M(this,"subscriptions");M(this,"opts");M(this,"addSubscription",(a,o,l)=>{const c=this.subscriptions.get(o);if(c)return c;const p=new tZ(this.$headers,a,o,l);return this.subscriptions.set(o,p),p});M(this,"removeSubscription",a=>{a.disconnect(),this.subscriptions.delete(a.params)});M(this,"disconnect",()=>{var c,p;for(const[f,y]of this.subscriptions)y.disconnect(),this.subscriptions.delete(f);this.clients.clear(),this.streamClients.clear(),this.subscriptions.clear();const[a,o,l]=Vk({dedupeTime:(c=this.opts)==null?void 0:c.dedupeTime,refetchInterval:(p=this.opts)==null?void 0:p.refetchInterval});this.nanoquery={createFetcherStore:a,createMutatorStore:o,utils:l}});M(this,"registerInterceptor",a=>{this.interceptors.push(a)});M(this,"removeInterceptor",a=>{this.interceptors=this.interceptors.filter(o=>o!==a)});M(this,"getClient",a=>{const o=a.typeName;if(this.clients.has(o))return this.clients.get(o);const l=Rk(a,this.transport);return this.clients.set(o,l),l});M(this,"getStreamClient",a=>{const o=`stream-${a.typeName}`;if(this.clients.has(o))return this.clients.get(o);const l=Rk(a,this.streamTransport);return this.clients.set(o,l),l});M(this,"createPromiseClient",(a,{params:o=[],method:l})=>{const c=this.getClient(a),p=a.methods[l].name,f=[a.typeName,p.charAt(0).toLowerCase()+p.slice(1),...Array.isArray(o)?o:[o]],y=[a.typeName,p.charAt(0).toLowerCase()+p.slice(1)];return{client:c,createRequestOptions:b=>{const C=b9();for(const _ in b){const N=E9[_];C.set(N,b[_])}return C},queryKey:f,queryKeyStr:y.join("")}});M(this,"createStreamClient",a=>({client:this.getStreamClient(a)}));M(this,"setSdkKey",a=>{this.$headers.setValue("sdk",a)});M(this,"setAuth",(a,o)=>{this.$headers.setValue("authorization",a),this.$headers.setValue("sl-user-id",o)});M(this,"setHeader",(a,o)=>this.$headers.setValue(a,o));M(this,"getHeader",a=>this.$headers.getValue(a));M(this,"getHeaders",()=>this.$headers.getValues());M(this,"initInterceptors",()=>{var o;if(this.interceptors.length!==0)return;const a=l=>c=>{const p=this.$headers.getValues();for(const f in p)c.header.set(f,p[f]);return l(c)};this.interceptors.push(a),this.interceptors.push(eZ()),(o=this.opts)!=null&&o.retryable&&this.interceptors.push(aZ)});this.host=a,this.opts=o,this.$headers=new Yc(is({"sl-device-id":rZ(),"sl-device-os":oZ()}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.streamClients=new Map,this.subscriptions=new Map;const[l,c,p]=Vk({dedupeTime:o==null?void 0:o.dedupeTime,refetchInterval:o==null?void 0:o.refetchInterval});this.nanoquery={createFetcherStore:l,createMutatorStore:c,utils:p},this.transport=Fk({baseUrl:a,defaultTimeoutMs:1e4,interceptors:this.interceptors}),this.streamTransport=Fk({baseUrl:a,interceptors:this.interceptors})}}const sZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(UQ,{method:"retrieveEventId",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;if(!f||typeof f!="string")return"";try{return((y=(await o.retrieveEventId({id:f})).data)==null?void 0:y.id)||""}catch{return""}}})},iZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"getStream",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;return f?(y=(await o.getStream({id:f})).data)==null?void 0:y.attributes:void 0}})},lZ=(n,a)=>{const{queryKey:o,client:l}=a.createPromiseClient(dy,{method:"me",params:[n]});return a.nanoquery.createFetcherStore(o,{fetcher:async()=>{const{data:c}=await l.me({});return{data:c}}})},uZ=n=>{const{client:a,createRequestOptions:o}=n.createPromiseClient(dy,{method:"bypassAuth"}),l=o({retryAttempts:0});return({userKey:c,schema:p,init:f,inviterKey:y})=>a.bypassAuth({userKey:c,schema:p,init:f,inviterKey:y},{contextValues:l})},cZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async()=>{var c;return(c=(await o.get({})).data)==null?void 0:c.attributes}})},dZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"getOrganization",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async()=>{const c=await o.getOrganization({});return c.data?{...c.data.attributes,id:c.data.id}:void 0}})},mZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(g2,{method:"getOrganizationAdvertising",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async()=>{var c;return(c=(await o.getOrganizationAdvertising({})).data)==null?void 0:c.attributes}})},fZ=(n,a,o)=>{n.transport=new TS(a.host,{dedupeTime:1e3*60*5,refetchInterval:1e3*60*5,retryable:!0}),n.analyticsTransport=new TS(a.analyticsHost),n.sdk.host=n.transport.host,n.transport.setSdkKey(a.sdkKey),n.transport.setHeader("sl-sdk-version",a.version||"-"),n.transport.$headers.subscribe(l=>{n.analyticsTransport.$headers.getStore().set(l)}),n.sdk.onMount({name:"transport"},()=>()=>{n.transport.disconnect(),n.analyticsTransport.disconnect()}),o()};var Gi;(function(n){n.SCHEMA="schema",n.EXTERNAL_TOKEN="eToken",n.TOKEN="token"})(Gi||(Gi={}));class rm extends Em{constructor(){super("user");M(this,"setSchema",o=>{this.write(Gi.SCHEMA,o)});M(this,"getSchema",()=>this.read(Gi.SCHEMA));M(this,"setToken",o=>{this.write(Gi.TOKEN,o)});M(this,"getToken",()=>this.read(Gi.TOKEN));M(this,"setExternalToken",o=>{this.write(Gi.EXTERNAL_TOKEN,o)});M(this,"getExternalToken",()=>this.read(Gi.EXTERNAL_TOKEN));M(this,"removeToken",()=>{this.remove(Gi.TOKEN)})}}var Yi;(function(n){n.DISABLED="disabled",n.INITIALIZATION="initialization",n.READY="ready",n.FAILED="failed",n.SUSPENDED="suspended"})(Yi||(Yi={}));const pZ=n=>{const a=new rm,o=new _o(ba(a.getExternalToken()),"userKey"),l=new _o(ba(a.getToken()),"userToken"),c=new Zs(lZ(l.getStore(),n),"user",({data:f,error:y,loading:b},C)=>{var _;if(!y)return(_=f==null?void 0:f.data)!=null&&_.id?f.data.id:b===!1?void 0:C}),p=new Zs(cZ(l.getStore(),n),"userSettings");return{userKey:o,userToken:l,user:c,userSettings:p}},hZ=n=>{const a=new _o(ba(void 0),"providerStreamId"),o=new Zs(sZ(a.getStore(),n),"slStreamId",c=>c==null?void 0:c.data),l=new Zs(iZ(o.getAtomStore(),n),"streamSettings");return o.getAtomStore().listen(c=>{(c===""||c===void 0)&&l.getStore().mutate(void 0)}),{providerStreamId:a,slStreamId:o,streamSettings:l}},gZ=n=>{const a=new _o(ba(void 0),"enabled"),o=new _o(ba(Yi.DISABLED),"status"),l=new Zs(dZ(a.getStore(),n),"organizationSettings",y=>{var b;return(b=y==null?void 0:y.data)==null?void 0:b.id}),c=new Zs(mZ(l.getAtomStore(),n),"organizationAdvertising"),p=pZ(n),f=hZ(n);return{enabled:a,status:o,providerStreamId:f.providerStreamId,slStreamId:f.slStreamId,streamSettings:f.streamSettings,user:p.user,userKey:p.userKey,userToken:p.userToken,userSettings:p.userSettings,organizationSettings:l,organizationAdvertising:c}};class yZ extends R6{constructor(o){const l=gZ(o),c=ZK(l);super(c,"core");M(this,"stores");M(this,"subscribe",o=>{let l;for(l in this.stores){const c=o[l];l in o&&c!==void 0&&this.stores[l].subscribe(o[l])}});M(this,"unsubscribe",()=>this.getStore().off());this.stores=l}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}const vZ=(n,a,o)=>{n.store=new yZ(n.transport),n.stores=n.store.getValues(),n.sdk.enabled=n.stores.enabled.getStore(),n.sdk.status=n.stores.status.getStore(),n.sdk.sdkStore=Object.fromEntries(Object.entries(n.stores).map(([l,c])=>[l,c.getStore()])),n.sdk.organizationStore=()=>n.stores.organizationSettings.getStore(),n.sdk.streamStore=()=>n.stores.streamSettings.getStore(),n.storeUnsubscribe=()=>{n.store.unsubscribe()},o()},TZ=n=>{const{client:a}=n.createPromiseClient(KC,{method:"list"});return o=>a.list(o)},oE=n=>{const{client:a}=n.createPromiseClient(KC,{method:"summary"});return o=>a.summary(o)},bZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(dy,{method:"getFriends",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{if(!f)return[];try{return(await o.getFriends({})).data}catch{return[]}}})},kZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;return(y=(await o.get({eventId:f})).data)==null?void 0:y.attributes},refetchInterval:0,dedupeTime:1e3*60*60})},SZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"syncQuestion",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y;return f?(y=(await o.syncQuestion({filter:{eventId:f}})).data)==null?void 0:y.attributes:void 0},dedupeTime:1e3*60*10,refetchInterval:0})},wZ=(n,a)=>{const{client:o}=a.createStreamClient(Xs),l=ku({eventId:n.get()||"",feedId:""});return n.subscribe((c="")=>{l.set({eventId:c,feedId:""})}),a.addSubscription(o.subscription,l,{name:"feedSubscription"})},CZ=(n,a)=>{const{client:o}=a.createStreamClient(Xs);return a.addSubscription(o.questionSubscription,{questionId:n},{name:"questionSubscription"})},_9=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"questionByUser",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>{var y,b;return(b=(y=(await o.questionByUser({questionId:f})).data)==null?void 0:y.attributes)==null?void 0:b.question},dedupeTime:1e3*60*5})},EZ=async(n,a)=>{var c,p,f,y,b,C;if(!n)return;const{client:o}=a.createPromiseClient(Xs,{method:"getQuestion",params:[n]}),l=await o.getQuestion({id:n});return((f=(p=(c=l.data)==null?void 0:c.attributes)==null?void 0:p.options)==null?void 0:f.options.case)==="promotion"?(C=(b=(y=l.data)==null?void 0:y.attributes)==null?void 0:b.options)==null?void 0:C.options.value:void 0},_Z=(n,a,o)=>{const{client:l,queryKey:c}=o.createPromiseClient(Xs,{method:"list",params:[n,a]});return o.nanoquery.createFetcherStore(c,{fetcher:async(p,f,y,b)=>y?(await l.list({eventId:y,filter:{types:b===Kc.ALLOWED?[]:[ke.FACTOID,ke.PROMOTION,ke.TWEET],statuses:[yn.ACTIVE,yn.RESOLVED]}})).data:[],dedupeTime:0,refetchInterval:0})},IZ=(n,a)=>{const{client:o,queryKey:l}=a.createPromiseClient(Xs,{method:"list",params:[n]});return a.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f)=>f?(await o.list({eventId:f,filter:{types:[ke.PROMOTION],statuses:[yn.ACTIVE]}})).data.map(({attributes:y})=>{if(!(!y||y.attributes.case!=="promotion"))return{...y,attributes:y.attributes.value}}).filter(Boolean):[],dedupeTime:0,refetchInterval:0})},NZ=(n,a,o)=>{const l=Lb([a,o],()=>{var C,_;const f=a.get();if(!f)return;const y=(C=o.get().data)==null?void 0:C.find(N=>N.id===(f==null?void 0:f.questionId)),b=(_=f==null?void 0:f.question)==null?void 0:_.openedFrom;return y?(y.openedFrom=b,y):f.question}),c=Lb(l,f=>f&&f.type==="question"?f.id:void 0),p=_9(c,n);return{$store:l,$extendedStore:p,updateExtendedQuestion:f=>{const y=p.get().data,b=(C,_)=>{if(!C||!_)return C||_||[];const N=[];for(let L=0;L<C.length;L++)N.push({...C[L],..._[L],correct:C[L].correct,youVoted:C[L].youVoted,pointsEarned:C[L].pointsEarned});return N};p.mutate({...f,options:y==null?void 0:y.options,subject:y==null?void 0:y.subject,appearance:y==null?void 0:y.appearance,answers:b(y==null?void 0:y.answers,f==null?void 0:f.answers)})}}};var m6;(function(n){n.SHOWED="showed"})(m6||(m6={}));class RZ extends Em{constructor(){super("advertisement");M(this,"setShowed",o=>{this.write(m6.SHOWED,o,"true")});M(this,"isShowed",o=>this.read(m6.SHOWED,o))}}class LZ{constructor(a){M(this,"advertisementList");M(this,"store");M(this,"timeouts");M(this,"waitingQueue");M(this,"activeQueue");M(this,"options");M(this,"logger");M(this,"addToQueue",a=>{if(this.store.has(a.id)){this.logger.debug({advertisement:a},"skip existed advertisement: %o");return}const o=a.close,l=a.action;if(this.store.set(a.id,{...a,close:(...c)=>{o&&o(...c),this.closeAdvertisement(a.id)},action:(...c)=>{l&&l(...c),this.closeAdvertisement(a.id,{animateHiding:!1})}}),this.waitingQueue.add(a.id),this.activeQueue.size===this.options.concurrency){const[c]=this.activeQueue;this.closeAdvertisement(c)}else this.tickWaitingQueue()});M(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[a]=this.waitingQueue;if(!a)return;this.activeQueue.add(a),this.waitingQueue.delete(a),this.logger.debug({job:a},"waiting queue tick"),this.tickActiveQueue(a)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});M(this,"tickActiveQueue",a=>{if(!a)return;const o=this.store.get(a);if(!o){this.logger.debug({advertisementId:a},"active queue tick skipped, advertisement not exist");return}const l=setTimeout(()=>{const c=a,p=new Map(this.advertisementList.get());if(p.set(o.id,o),this.advertisementList.set(p),o.autoHideDuration!==1/0){const f=setTimeout(()=>{this.logger.debug({advertisementId:c,delay:o.autoHideDuration||5e3},"advertisement hiding by autoHideDuration"),this.closeAdvertisement(c)},o.autoHideDuration||5e3);this.timeouts.set(c,f)}this.logger.debug({advertisementId:c,queue:[...p.values()]},"advertisement displayed")},o.delay||0);this.timeouts.set(a,l),this.logger.debug({advertisementId:a},"active queue tick completed"),this.tickWaitingQueue()});M(this,"removeFromList",a=>{const o=new Map(this.advertisementList.get());o.delete(a),this.advertisementList.set(o),this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.logger.debug({advertisementId:a},"advertisement removed from list")});M(this,"closeAdvertisement",(a,{animateHiding:o=!0}={})=>{const l=new Map(this.advertisementList.get()),c=l.get(a);if(c){c.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&o,this.advertisementList.set(l);const p=setTimeout(()=>{const f=new Map(this.advertisementList.get());f.delete(a),this.advertisementList.set(f);const y=this.timeouts.get(a);y!==void 0&&(clearTimeout(y),this.timeouts.delete(a)),this.logger.debug({advertisementId:a},"advertisement hidden")},o&&this.options.animationDelay||0);this.timeouts.set(a,p)}return this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.tickWaitingQueue(),this.logger.debug({advertisementId:a},"advertisement hiding"),c});M(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.advertisementList.off(),this.advertisementList.set(new Map)});this.options=a,this.logger=Js("advertisement_queue"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.advertisementList=ba(new Map)}}const OZ=(n,a,o)=>{const l=Js("advertisement_queue"),c=new LZ({concurrency:1,animationDelay:1e3}),p=new RZ,f=new Zs(IZ(n,o),"gamification:promotionList"),y=(N,L)=>{Io.emit("advertisement",{action:"received",payload:{advertisementId:N,advertisementType:L==null?void 0:L.type}}),c.addToQueue({id:N,autoHideDuration:1/0,data:is({loading:!1,error:void 0,data:void 0}),close:()=>C(N),promise:async function(){this.data.setKey("loading",!0);try{const O=L||await EZ(N,o);O?this.data.setKey("data",O):this.data.setKey("error",new Error("No promotion found"))}catch(O){this.data.setKey("error",O)}finally{this.data.setKey("loading",!1)}}})},b=N=>{l.debug({notificationId:N},"markAsViewed: %o"),p.setShowed(N)},C=N=>{c.closeAdvertisement(N),b(N)},_=N=>{var F;const L=c.advertisementList.get();if(!(L!=null&&L.size))return null;const O=L.values().next().value,D=O.data.get();return!N&&p.isShowed(O.id)?(c.removeFromList(O.id),_(N)):(!D.data&&!D.error&&!D.loading&&O.promise(),Io.emit("advertisement",{action:"opened",payload:{advertisementId:O.id,advertisementType:(F=D.data)==null?void 0:F.type}}),O)};return km(c.advertisementList,()=>{f.subscribe(N=>{if(N.data){const L=N.data[N.data.length-1];L&&y(L.id)}}),a.addListener("promotion",N=>{var D,F,V,G,W,Z,ne,ee,ue;const L=((W=(G=(V=(F=(D=N.data)==null?void 0:D.attributes)==null?void 0:F.feedItem)==null?void 0:V.attributes)==null?void 0:G.attributes)==null?void 0:W.case)==="promotion"?N.data.attributes.feedItem.attributes:void 0,O=((ue=(ee=(ne=(Z=N.data)==null?void 0:Z.attributes)==null?void 0:ne.question)==null?void 0:ee.options)==null?void 0:ue.options.case)==="promotion"?N.data.attributes.question.options.options.value:void 0;if(L===void 0||O===void 0){l.debug("not promotion");return}if(L.status===yn.RESOLVED){C(L.id),l.debug({feedItem:L},"resolved: %o");return}if(L.status===yn.ACTIVE){l.debug({feedItem:L},"active: %o"),y(L.id,O);return}l.debug({feedItem:L},"skip: %o")})}),{hide:C,show:y,$list:c.advertisementList,getActiveAdvertisement:_}};var Kc;(function(n){n.ALLOWED="allowed",n.DISALLOWED="disallowed"})(Kc||(Kc={}));class xZ{constructor(a){M(this,"slStreamId");M(this,"organizationId");M(this,"userId");M(this,"interactiveAllowed");M(this,"openedQuestionId");M(this,"openedQuestion");M(this,"activeQuestionId");M(this,"feedList");M(this,"moderationId");M(this,"moderation");M(this,"feedSubscription");M(this,"questionSubscription");M(this,"advertisement");M(this,"notifications");M(this,"log");M(this,"transport");M(this,"cancels",new Set);M(this,"getCurrentSessionId",a=>{const o=a.eventId||this.slStreamId.get()||"",l=a.userId||this.userId.get()||"",c=a.organizationId||this.organizationId.get()||"",p=a.entity||"",f=a.prefix||"";return[c,o,l,f,p].join(":")});M(this,"disconnect",()=>{var a;(a=this.feedSubscription)==null||a.disconnect(),this.questionSubscription!==void 0&&(this.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0)});M(this,"openQuestion",(a,o)=>{this.openedQuestionId.set({questionId:a,question:o}),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});M(this,"closeQuestion",a=>{this.openedQuestionId.set(void 0),a&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});this.transport=a.transport,this.log=Js("gamification-background"),this.slStreamId=a.stores.slStreamId.getAtomStore(),this.organizationId=a.stores.organizationSettings.getAtomStore(),this.userId=a.stores.user.getAtomStore(),this.moderationId=new _o(ba(void 0),"moderationId").getStore(),this.interactiveAllowed=new _o(ba(Kc.DISALLOWED),"interactiveAllowed").getStore(),this.openedQuestionId=new _o(ba(void 0),"openedQuestionId").getStore(),this.notifications=a.notifications,this.moderation=new Zs(kZ(this.slStreamId,a.transport),"gamification:moderation"),this.feedList=new Zs(_Z(this.slStreamId,this.interactiveAllowed,a.transport),"gamification:feedList"),this.activeQuestionId=SZ(this.slStreamId,a.transport),this.openedQuestion=NZ(a.transport,this.openedQuestionId,this.feedList.getStore()),this.cancels.add(this.openedQuestionId.listen(o=>{this.log.debug({item:o},"received question"),o!=null&&o.questionId?(this.questionSubscription=CZ(o.questionId,a.transport),this.questionSubscription.addListener("feed-subscription-opened-question",l=>{var c,p;this.openedQuestion.updateExtendedQuestion((p=(c=l.data)==null?void 0:c.attributes)==null?void 0:p.question)}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(a.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))})),this.feedSubscription=wZ(this.slStreamId,a.transport),this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question",o=>{var p,f,y,b,C;const l=(f=(p=this.activeQuestionId.get().data)==null?void 0:p.question)==null?void 0:f.id,c=(b=(y=o.data)==null?void 0:y.attributes)==null?void 0:b.question;!c||c.type===ke.PROMOTION||l&&c.status===yn.RESOLVED&&c.id!==l||this.activeQuestionId.mutate((C=o.data)==null?void 0:C.attributes)})),this.cancels.add(this.feedSubscription.addListener("moderation update",o=>{window.requestAnimationFrame(()=>{var l,c,p,f;((c=(l=o.data)==null?void 0:l.attributes)==null?void 0:c.question)===void 0&&((f=(p=o.data)==null?void 0:p.attributes)!=null&&f.moderation)&&this.moderation.invalidate()})})),this.feedSubscription.connect(),this.cancels.add(this.interactiveAllowed.listen(()=>{window.requestAnimationFrame(()=>{this.activeQuestionId.invalidate()})})),a.sdk.onMount({name:"gamification-background"},()=>()=>{this.activeQuestionId.off();for(const o of this.cancels)o(),this.cancels.delete(o)}),this.advertisement=OZ(this.slStreamId,this.feedSubscription,a.transport)}}class AZ{constructor(a){M(this,"notificationsList");M(this,"store");M(this,"timeouts");M(this,"waitingQueue");M(this,"activeQueue");M(this,"options");M(this,"logger");M(this,"addToQueue",a=>{var c;if(this.store.has(a.id)){this.logger.debug({notification:a},"skip existed notification: %o");return}const o=a.close,l=a.action;if(this.store.set(a.id,{...a,close:(...p)=>{o&&o(...p),this.closeNotification(a.id)},action:(...p)=>{l&&l(...p),this.closeNotification(a.id,{animateHiding:!1})}}),this.waitingQueue.add(a.id),this.activeQueue.size===this.options.concurrency){const[p]=this.activeQueue;if(((c=this.store.get(p))==null?void 0:c.persistent)!==!0)this.closeNotification(p);else{const[f]=this.waitingQueue;this.waitingQueue.size>1&&this.closeNotification(f),this.tickWaitingQueue()}}else this.tickWaitingQueue()});M(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[a]=this.waitingQueue;if(!a)return;this.activeQueue.add(a),this.waitingQueue.delete(a),this.logger.debug({job:a},"waiting queue tick"),this.tickActiveQueue(a)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});M(this,"tickActiveQueue",a=>{if(!a)return;const o=this.store.get(a);if(!o){this.logger.debug({notificationId:a},"active queue tick skipped, notification not exist");return}const l=setTimeout(()=>{const c=a,p=new Map(this.notificationsList.get());p.set(o.id,o),this.notificationsList.set(p);const f=setTimeout(()=>{this.logger.debug({notificationId:c,delay:o.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(c)},o.autoHideDuration||5e3);this.timeouts.set(c,f),this.logger.debug({notificationId:c,queue:[...p.values()]},"notification displayed")},o.delay||0);this.timeouts.set(a,l),this.logger.debug({notificationId:a},"active queue tick completed"),this.tickWaitingQueue()});M(this,"closeNotification",(a,{animateHiding:o=!0}={})=>{const l=new Map(this.notificationsList.get()),c=l.get(a);if(c){c.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&o,this.notificationsList.set(l);const p=setTimeout(()=>{const f=new Map(this.notificationsList.get());f.delete(a),this.notificationsList.set(f);const y=this.timeouts.get(a);y!==void 0&&(clearTimeout(y),this.timeouts.delete(a)),this.logger.debug({notificationId:a},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(a,p)}return this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.tickWaitingQueue(),this.logger.debug({notificationId:a},"notification hiding"),c});M(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.notificationsList.off(),this.notificationsList.set(new Map)});this.options=a,this.logger=Js("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notificationsList=ba(new Map)}}var f6;(function(n){n.OPENED="opened"})(f6||(f6={}));class PZ extends Em{constructor(){super("notification");M(this,"setOpened",o=>{this.write(f6.OPENED,o,"true")});M(this,"isOpened",o=>this.read(f6.OPENED,o));M(this,"clearNotification",()=>{this.clear()})}}var vu;(function(n){n[n.ONBOARDING=1]="ONBOARDING",n[n.QUESTION=2]="QUESTION",n[n.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(vu||(vu={}));class MZ{constructor(a={}){M(this,"queue");M(this,"storage");M(this,"isViewed",a=>this.storage.isOpened(a));M(this,"add",a=>{if(!this.isViewed(a.id)){if(a.data&&a.emitEvent){const o=a.action;a.action=(...l)=>{o&&o(...l),Io.emit("notification",{action:"opened",payload:{questionId:a.data.questionId,questionType:a.data.questionType}})}}this.queue.addToQueue(a)}});M(this,"close",(a,{markAsViewed:o=!0,animateHiding:l}={})=>{this.queue.closeNotification(a,{animateHiding:l}),o&&this.markAsViewed(a)});M(this,"getActiveNotification",()=>{const a=this.queue.notificationsList.get();if(!(a!=null&&a.size))return null;for(const o of a.values())if(o.type===vu.ONBOARDING)return o;return a.values().next().value});M(this,"getQueueStore",()=>this.queue.notificationsList);M(this,"markAsViewed",a=>{this.storage.setOpened(a)});this.storage=new PZ,this.queue=new AZ({concurrency:1,animationDelay:1600,...a})}}const DZ=(n,a,o)=>{n.notifications=new MZ(void 0),n.addNotification=n.notifications.add,n.sdk.getNotificationsStore=()=>n.notifications.getQueueStore(),n.sdk.getActiveNotification=()=>n.notifications.getActiveNotification(),n.sdk.onMount({name:"notifications"},()=>()=>{n.notifications.queue.drain()}),o()};var m2;(function(n){n.UNKNOWN="unknown",n.ALREADY_VOTED="already_voted"})(m2||(m2={}));const UZ=async(n,a)=>{var p;const{client:o,createRequestOptions:l}=n.createPromiseClient(Xs,{method:"submitAnswer"}),c=l({retryAttempts:0});try{return await o.submitAnswer({data:a},{contextValues:c})}catch(f){throw((p=zt.from(f))==null?void 0:p.code)===st.AlreadyExists?new Error(m2.ALREADY_VOTED):new Error(m2.UNKNOWN)}},FZ=(n,a)=>{const{client:o,createRequestOptions:l}=n.createPromiseClient(Xs,{method:"submitInplay"}),c=l({retryAttempts:0});return o.submitInplay({data:{eventId:+a}},{contextValues:c})};var om;(function(n){n.ONBOARDING="onboarding",n.ONBOARDING_IO="onboarding_io"})(om||(om={}));class VZ extends Em{constructor(){super("gamification-session",window.sessionStorage);M(this,"writeValue",(o,l)=>{this.write(...o,l)});M(this,"readValue",o=>this.read(...o))}}class sE extends Em{constructor(){super("gamification");M(this,"sessionStorage");M(this,"saveOnboardingStatus",({userId:o,eventId:l,organizationId:c},p)=>{this.write(om.ONBOARDING,c,o,l,p)});M(this,"getOnboardingStatus",({userId:o,eventId:l,organizationId:c})=>this.read(om.ONBOARDING,c,o,l));M(this,"setOnboardingInstantOpen",({userId:o,eventId:l,organizationId:c})=>{this.sessionStorage.writeValue([om.ONBOARDING_IO,c,o,l],"1")});M(this,"getOnboardingInstantOpen",({userId:o,eventId:l,organizationId:c})=>this.sessionStorage.readValue([om.ONBOARDING_IO,c,o,l]));this.sessionStorage=new VZ}}const jZ={pageSize:10},BZ=(n,a,o,l,c)=>{let p=0;const f=ba({pageSize:jZ.pageSize,page:0}),y=is({data:[],key:Date.now(),hasMore:!0,loading:void 0,error:void 0}),b=TZ(n),C=async()=>{var D;const L=a.get(),O=((D=l.getStore().get().data)==null?void 0:D.map(F=>F.slId))||[];if(L&&(O!=null&&O.length)){const F=o.get();F&&O.push(F),y.setKey("loading",!0),y.setKey("data",[]);const V=await b({eventId:L,usersIds:O});y.set({data:V.data.map((G,W)=>({...G.attributes,friendsRank:W+1})),hasMore:!1,key:Date.now(),loading:!1}),V.meta&&(p=Math.round(V.meta.count/V.meta.pageSize))}},_=()=>{C()},N=L=>{const O=f.get(),D=L||O.page+1;D<=p&&f.set({...O,page:D})};return km(y,()=>{const L=a.listen(C),O=l.listen(C);return()=>{L(),O()}}),{$store:y,fetchMore:N,invalidate:_}};class $Z extends Em{constructor(){super("deep-link-context",window.sessionStorage);M(this,"get",this.read);M(this,"set",this.write);M(this,"del",this.remove)}}const bS="sldl",L6="sldl_uid",iE="sldl_eid",lE="sldl_e_eid",zZ=new Set([L6,iE,lE]),kS=n=>{const a={},o={};for(const[l,c]of n)zZ.has(l)?a[l]=c:o[l]=c;return{result:a,remain:o}},HZ=({hash:n,search:a})=>{if(n&&n.includes(bS)){const o=new URLSearchParams(n.substr(1));return{hash:kS(o)}}if(a&&a.includes(bS)){const o=new URLSearchParams(a);return{search:kS(o)}}return null},SS=Js("deep_link"),Ys={debug:(...n)=>{SS.debug(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)},trace:(...n)=>{SS.trace(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)}},GZ=(n,a)=>{const{hash:o,search:l}=window.location;if(Ys.debug({hash:o,search:l},"get deep link data from"),o||l){const c=HZ({hash:o,search:l});if(Ys.debug(c,"parse deep link result"),c){const{hash:p,search:f}=c,{result:y,remain:b}=p||f;if(Object.keys(y).length!==0){n.setValue("data",y);const C=Object.keys(b).length!==0;if(p){let _="";C&&(_=`#${new URLSearchParams(b).toString()}`,Ys.debug({updatedHash:_},"update hash")),window.history.replaceState(null,"",window.location.pathname+window.location.search+_)}if(f){let _="";C&&(_=`?${new URLSearchParams(b).toString()}`,Ys.debug({updatedSearch:_},"update search")),window.history.replaceState(null,"",window.location.pathname+_+window.location.hash)}a(y)}}}n.setValue("parsed",!0)},qZ=(n,a,o)=>{const l=new $Z,c=l.get("sl-deep-link-store");let p={};if(c)try{p=JSON.parse(c)}catch(y){Ys.debug(y)}n.deepLink={$store:new Yc(is(p),"deep-link-context"),getDeepLinkData:()=>{const{data:y,used:b}=n.deepLink.$store.getValues();return{data:y,used:b}},deepLinkUsed:y=>{Ys.debug(`logged in with inviterId: ${y}`),n.deepLink.$store.setValue("used",!0)},onDeepLinkHandlers:new Set},n.sdk.getInviter=()=>{const{data:y,used:b}=n.deepLink.getDeepLinkData();return b?y==null?void 0:y[L6]:void 0},n.sdk.inviteDisplayed=()=>{n.deepLink.$store.getStore().set({}),n.deepLink.$store.getStore().off(),l.del("sl-deep-link-store")},n.deepLink.$store.subscribe(y=>l.set("sl-deep-link-store",JSON.stringify(y))),n.sdk.addDeepLinkHandler=y=>{localStorage.getItem("SL_DEBUG")&&Ys.trace("adding deep link handler"),n.deepLink.onDeepLinkHandlers.add(y)},a.onDeepLinkHandled&&n.sdk.addDeepLinkHandler(a.onDeepLinkHandled),n.sdk.removeDeepLinkHandler=y=>{Ys.trace("removing deep link handler"),n.deepLink.onDeepLinkHandlers.delete(y)};const f=y=>{n.deepLink.$store.setValue("handled",!0),Ys.trace({size:n.deepLink.onDeepLinkHandlers.size},"deep link handled, call callbacks");for(const b of n.deepLink.onDeepLinkHandlers)try{Ys.trace("called handler"),b(y)}catch(C){console.error(C)}};GZ(n.deepLink.$store,f),o()},WZ=Js("bypass");class QZ extends KK{constructor(o,l,c){super();M(this,"$coreStore");M(this,"deepLink");M(this,"transport");M(this,"bypassLogin");M(this,"me",async()=>{var o;return this.$coreStore.getValues().user.invalidate(),(o=await this.$coreStore.getValues().user.getValue())==null?void 0:o.data});M(this,"login",async(o,l)=>{var _,N,L;this.$coreStore.getValues().userKey.setValue(l);const{used:c,data:p}=this.deepLink.getDeepLinkData(),f=c?"":p==null?void 0:p[L6];WZ.debug({inviterKey:f},"login with inviterKey");const y=await this.bypassLogin({schema:o,userKey:l,inviterKey:f,init:!1}),b=(_=y.meta)==null?void 0:_.jwt,C=(N=y.data)==null?void 0:N.id;if(!b||!C)throw new Error("internal: token missing");return(L=y.meta)!=null&&L.inviterKey&&this.deepLink.deepLinkUsed(y.meta.inviterKey),this.$coreStore.getValues().user.getStore().mutate({data:y.data}),this.saveUser(b,C),b});M(this,"isAuthenticated",()=>this.me());M(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new rm().clear()});M(this,"softLogout",()=>{const o=new rm;this.transport.setAuth("",""),o.setToken(""),this.reLogin()});M(this,"reLogin",()=>{const o=new rm,l=o.getToken(),c=o.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(c),l)return this.saveUser(l,""),this.me().then(p=>{if(p!=null&&p.id){const f=p.id;this.saveUser(l,f)}});if(c&&!l){const p=o.getSchema();p&&c&&this.login(p,c).catch(()=>{this.logout()})}});M(this,"saveUser",(o,l)=>{this.transport.setAuth(o,l),this.$coreStore.getValues().userToken.setValue(o),new rm().setToken(o)});M(this,"connect",()=>{this.transport.registerInterceptor(o=>async l=>{try{return await o(l)}catch(c){throw c.code&&(c.code===7||c.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),c}})});this.$coreStore=o,this.deepLink=c,this.transport=l,this.bypassLogin=uZ(this.transport),this.connect()}}const Xf=new rm,YZ=(n,a,o)=>{n.auth=new QZ(n.store,n.transport,n.deepLink),n.stores.status.listen(l=>{l===Yi.READY&&n.auth.reLogin()}),n.sdk.userId=n.stores.user.getAtomStore,n.sdk.authorizationBypass=async(l,c)=>{if(!(Xf.getSchema()===l&&Xf.getExternalToken()===c&&n.transport.getHeader("authorization")))try{await n.auth.login(l,c),Xf.setSchema(l),Xf.setExternalToken(c)}catch{n.sdk.logout()}},n.sdk.logout=()=>{n.auth.logout(),Xf.clear()},n.sdk.getUserStore=()=>n.stores.user.getStore(),n.sdk.isUserAuthorized=()=>n.auth.isAuthenticated(),o()},wS=Js("video_player"),Fh={debug:(...n)=>{wS.debug(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)},trace:(...n)=>{wS.trace(...n),localStorage.getItem("SL_DEBUG")&&console.log(...n)}},KZ=(n,a,o)=>{n.videoPlayer={controllers:new Set},n.sdk.addVideoPlayerController=l=>{Fh.trace("adding video player controller"),n.videoPlayer.controllers.add(l)},a.videoPlayerController&&n.sdk.addVideoPlayerController(a.videoPlayerController),n.sdk.removeVideoPlayerController=l=>{Fh.trace("removing video player controller"),n.videoPlayer.controllers.delete(l)},n.sdk.controlVideoPlayer=l=>{Fh.trace("controlling video player");for(const c of n.videoPlayer.controllers){Fh.trace("calling video player controller");try{c(l)}catch(p){console.error(p)}}},o()},ZZ=(n,a,o)=>{const l={onMountedFired:!1},c=new Map,p=new Map;n.sdk=Object.create(null),n.sdk.onMount=({name:f,clear:y},b)=>{var C,_;if(c.has(f)){const N=p.get(f);N&&N(),c.delete(f),p.delete(f)}c.set(f,{cb:b,clear:y}),((_=(C=n==null?void 0:n.stores)==null?void 0:C.enabled)==null?void 0:_.get())==="on"&&p.set(f,b())},n.ready=()=>{n.stores.enabled.subscribe(f=>{f==="on"&&l.onMountedFired===!1&&(c.forEach(({cb:y},b)=>p.set(b,y())),l.onMountedFired=!0),f!=="on"&&l.onMountedFired===!0&&(p.forEach(y=>y()),p.clear(),c.forEach(({clear:y},b)=>y&&c.delete(b)),l.onMountedFired=!1)})},n.sdk.initializeApp=async f=>{if(n.contextConfig=f,n.stores.enabled.get()==="on")return{enabled:!0};n.storeSubscribe(),n.stores.enabled.setValue("on"),n.stores.status.setValue(Yi.INITIALIZATION);try{const y=await n.stores.organizationSettings.getValue();return y?(n.stores.status.setValue(Yi.READY),{enabled:!!y}):(n.stores.status.setValue(Yi.FAILED),{err:"failed"})}catch(y){return n.stores.enabled.setValue(),n.stores.status.setValue(Yi.FAILED),{err:`${y}`}}},n.sdk.disableApp=()=>{n.stores.enabled.get()==="on"&&(n.stores.enabled.setValue(),n.stores.status.setValue(Yi.DISABLED),n.stores.slStreamId.setValue(),n.stores.providerStreamId.setValue(),n.sdk.closeFeature(!0),n.storeUnsubscribe(),n.transport.disconnect())},n.sdk.createEventSession=f=>{n.stores.providerStreamId.setValue(f)},o()},XZ=(n,a)=>{const{client:o,queryKey:l}=n.createPromiseClient(g2,{method:"generateDeepLink",params:a});return n.nanoquery.createFetcherStore(l,{fetcher:async(c,p,f,y)=>{var b;if(!f)return{};try{return(b=(await o.generateDeepLink({data:{gamification:!0,externalEventId:y,eventId:f}})).data)==null?void 0:b.attributes}catch{return}},dedupeTime:1e3*60*60*24,refetchInterval:0})},JZ=(n,{web:a,mobile:o})=>{const{client:l}=n.createPromiseClient(bK,{method:"generate"});return l.generate({web:a,mobile:o})},CS=(n,a)=>{const o=new URLSearchParams(n);for(const[l,c]of Object.entries(a))o.append(l,c);return o.toString()},eX=(n,a,o,l)=>{const c=is({});return km(c,()=>XZ(n,[a,o]).subscribe(async({data:p,error:f,loading:y})=>{var O;const b=f?"https://masters.com":p==null?void 0:p.url,C=l.get()||"",_=a.get()||"",N=o.get()||"",L={[L6]:C,[iE]:_,[lE]:N};if(!y&&b){c.setKey("loading",!0);let D=window.location.search,F=window.location.hash;D&&F||F?D=`?${CS(D,L)}`:F=`#${CS("",L)}`;const V=window.location.origin+window.location.pathname+D+F;try{const G=await JZ(n,{web:V,mobile:b});c.set({data:(O=G.data)==null?void 0:O.link,loading:!1})}catch{c.set({loading:!1,error:"Failed to generate short link",data:void 0})}}else c.setKey("loading",!0)})),{$store:c,fetch}};var ya;(function(n){n.Unset="unset",n.Required="required",n.Optional="optional",n.Completed="completed",n.Disabled="disabled",n.Unavailable="unavailable"})(ya||(ya={}));const tX=(n,a,o,l)=>{const{inplayGame:c}=n.featureSettings.get(),p=a.getCurrentSessionId({prefix:"onboarding"});c&&o.add({type:vu.ONBOARDING,id:p,action:n.openFeature,persistent:!0,autoHideDuration:1e6,data:{questionId:"onboarding",questionType:ke.UNSET,onboarding:{...c,instantOpen:!l.getOnboardingInstantOpen({userId:a.userId.get()||"",organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""})}}})},Vh=(n,a,o,l,c,p)=>{var f,y,b;try{const C=a.userId.get();if(!C)return;if(c.getOnboardingStatus({userId:C,organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""})===ya.Completed){n.set(ya.Completed);for(const D of p)D();return}const _=(f=a.moderation.getStore().value)==null?void 0:f.data,N=o.featureSettings.get().inplayGame;if(_===void 0||N===void 0)return;const L=(y=_==null?void 0:_.options)==null?void 0:y.onboardingEnabled,O=(b=N==null?void 0:N.titleCard)==null?void 0:b.optIn;L?O?n.set(ya.Required):n.set(ya.Optional):(O?n.set(ya.Unavailable):n.set(ya.Disabled),l.close(a.getCurrentSessionId({prefix:"onboarding"}),{markAsViewed:!1}))}catch(C){console.error(C)}},nX=(n,a,o,l)=>{let c=!1;const p=new sE,f=ba(ya.Unset);f.subscribe(b=>{b!==ya.Unset&&((b===ya.Optional||b===ya.Required)&&c===!1&&(tX(n,a,l,p),c=!0),b===ya.Completed&&a.activeQuestionId.invalidate(),p.setOnboardingInstantOpen({userId:a.userId.get()||"",organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""}))});const y=[];return Vh(f,a,n,l,p,y),f.get()!==ya.Completed&&(y.push(a.userId.listen(b=>{b&&Vh(f,a,n,l,p,y)})),y.push(a.moderation.listen(b=>{b.data&&Vh(f,a,n,l,p,y)})),y.push(n.featureSettings.listen(b=>{b&&Vh(f,a,n,l,p,y)}))),{$store:f,submitInplay:async()=>{const b=a.slStreamId.get();if(b){await FZ(o,b),f.set(ya.Completed),p.saveOnboardingStatus({organizationId:a.organizationId.get()||"",userId:a.userId.get()||"",eventId:b},ya.Completed),Io.emit("poll",{action:"onboardingPassed",payload:{}}),n.openFeature();const C=a.getCurrentSessionId({prefix:"onboarding"});l.close(C)}}}},aX=(n,a,o,l)=>{const c=is(void 0),p=oE(l),f=async()=>{var O,D;const b=n.get(),C=a.get(),_=(O=o.getStore().get().data)==null?void 0:O.map(F=>F.slId);if(!_)return;const N={eventId:b,userId:C,usersIds:[..._,C]},L=await p(N);c.set((D=L.data)==null?void 0:D.attributes)},y=()=>{f()};return km(c,()=>{const b=n.listen(f),C=o.listen(f),_=a.listen(f);return()=>{b(),C(),_()}}),{$store:c,invalidate:y}},rX=async(n,a,o,l,c)=>{var _,N,L;const p=oE(c),f=n.get(),y=a.get(),b=((_=o.getStore().get().data)==null?void 0:_.map(O=>O.slId))||[],C={eventId:f,userId:l,usersIds:[...b,y]};return(L=(N=(await p(C)).data)==null?void 0:N.attributes)==null?void 0:L.summary},oX=new Set([ke.POLL,ke.PREDICTION,ke.TRIVIA]);class sX extends nE{constructor(o,l,c){super(o,l);M(this,"userSummary");M(this,"feedList");M(this,"friends");M(this,"leaderboardId");M(this,"leaderboardList");M(this,"deepLink");M(this,"onboardingStatus");M(this,"openedQuestion");M(this,"currentUserId");M(this,"openedUser");M(this,"closeFeature");M(this,"openFeature");M(this,"feedSubscription");M(this,"activeQuestionId");M(this,"openedQuestionId");M(this,"advertisement");M(this,"notifications");M(this,"transport");M(this,"background");M(this,"storage");M(this,"submitAnswerTimeout");M(this,"cancels",new Set);M(this,"checkInteractiveFlag",()=>{var y,b,C,_,N;const o=this.onboardingStatus.$store.get(),l=(C=(b=(y=this.background.moderation.getStore().value)==null?void 0:y.data)==null?void 0:b.options)==null?void 0:C.onboardingEnabled,c=(N=(_=this.settings.getValues().inplayGame)==null?void 0:_.titleCard)==null?void 0:N.optIn,p=o===ya.Completed,f=!l||p||c!==!0;this.background.interactiveAllowed.set(f?Kc.ALLOWED:Kc.DISALLOWED)});M(this,"connect",()=>{this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close",async o=>{var C,_,N,L,O,D,F,V,G,W,Z;if(!this.isInteractiveAllowed)return;const l=(_=(C=o.data)==null?void 0:C.attributes)==null?void 0:_.question,c=(L=(N=o.data)==null?void 0:N.attributes)==null?void 0:L.feedItem;if(!l||!(c!=null&&c.attributes))return;const{status:p,type:f,id:y,answers:b}=l;if(p===yn.RESOLVED&&f===ke.PREDICTION){const ne=this.background.getCurrentSessionId({prefix:`notification-id:${y}`}),ee=[...this.feedList.getValues().data||[]],ue=ee.findIndex(ht=>ht.id===y),oe=ee[ue];let Ne=(F=(D=(O=oe==null?void 0:oe.attributes)==null?void 0:O.attributes)==null?void 0:D.value)==null?void 0:F.answerId;const Ie=_9(y,this.transport),Ze=Ie.subscribe(()=>{});await Ie.get().promise;const Ge=Ie.get().data;Ze(),window.requestAnimationFrame(()=>{Ie.invalidate()}),Ne||(Ne=(V=Ge==null?void 0:Ge.answers.find(({youVoted:ht})=>ht))==null?void 0:V.id);const Qe=b.find(({correct:ht})=>ht),_e=Ne?b.find(({id:ht})=>ht===Ne):void 0,et=!!(_e!=null&&_e.correct);if(oe&&((W=(G=ee[ue])==null?void 0:G.attributes)==null?void 0:W.attributes.case)==="question"){try{ee[ue].attributes.attributes.value.answerId=Ne,ee[ue].attributes.attributes.value.openForVoting=!1,Ne&&(ee[ue].attributes.attributes.value.status=et?Xi.WON:Xi.LOST)}catch{}this.feedList.getStore().mutate(ee)}if(!_e||!Qe)return;((Z=this.openedQuestionId.get())==null?void 0:Z.questionId)!==l.id&&this.notifications.add({type:vu.QUESTION_RESOLVED,action:()=>this.openQuestion(l.id,c),close:()=>this.closeQuestion(y),autoHideDuration:et?15e3:12e3,id:ne,emitEvent:!1,data:{questionId:y,questionType:ke.PREDICTION,question:{title:et?`Congratulations! You answered correctly! You won ${Qe.points} pts!`:`Better luck next time! Correct: ${Qe==null?void 0:Qe.text}!`,votedAnswer:{title:_e==null?void 0:_e.text,points:_e==null?void 0:_e.points},correctAnswerTitle:Qe==null?void 0:Qe.text,correct:!!et,predictionResult:p===yn.RESOLVED,questionTitle:l==null?void 0:l.subject}}}),this.userSummary.invalidate()}})),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list",o=>{var f,y,b,C,_;const l=[...((f=this.feedList.getStore().value)==null?void 0:f.data)||[]],c=(b=(y=o.data)==null?void 0:y.attributes)==null?void 0:b.feedItem,p=l.findIndex(N=>N.id===(c==null?void 0:c.id));if(c!=null&&c.attributes&&c.attributes.attributes.case!=="promotion"&&!(c.attributes.status!==yn.ACTIVE&&c.attributes.status!==yn.RESOLVED)){if(p!==-1)if(c.attributes.attributes.case==="question"&&((C=l[p].attributes)==null?void 0:C.attributes.case)==="question"){const N=l[p];N.attributes&&(l[p]={...l[p],attributes:{...N.attributes,attributes:{...N.attributes.attributes,value:{...N.attributes.attributes.value,...c.attributes.attributes.value,answerId:N.attributes.attributes.value.answerId,status:N.attributes.attributes.value.status,openForVoting:N.attributes.attributes.value.openForVoting}}}})}else{const N=l[p];N.attributes&&c.attributes&&(l[p]={...l[p],attributes:{...N.attributes,attributes:{...N.attributes.attributes,value:{...N.attributes.attributes.value,...c.attributes.attributes.value}}}})}p===-1&&(l.unshift(c),Io.emit("poll",{action:"received",payload:{questionId:c.id,questionType:(_=c.attributes)==null?void 0:_.type}})),this.feedList.getStore().mutate(l)}}))});M(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-prediction-close"),this.background.feedSubscription.removeListener("feed-subscription-questions-list")});M(this,"submitAnswer",async(o,l)=>{const c=_9(o,this.transport),p=c.subscribe(()=>{}),f={...c.get().data||{}},y=()=>{var L;const b=this.feedList.getValues().data;if(!b)return;const C=b.findIndex(O=>O.id===o),_=b[C],N=((L=_==null?void 0:_.attributes)==null?void 0:L.attributes.case)==="question"&&_.attributes.attributes.value;if(N){Io.emit("poll",{action:"voted",payload:{questionId:o,questionType:N.questionType}});const O=c.get().data;if(p(),O){const D=O.answers.find(W=>W.correct===!0),F=O.answers.findIndex(W=>W.id===l),V=O.answers[F],G=O.answers.every(({percentageDecimal:W},Z)=>W===(f==null?void 0:f.answers[Z].percentageDecimal));b[C].attributes.attributes.value.answerId=l,b[C].attributes.attributes.value.openForVoting=!1,b[C].attributes.attributes.value.text=(V==null?void 0:V.text)||"",D&&(b[C].attributes.attributes.value.status=D.id===l?Xi.WON:Xi.LOST),this.feedList.getStore().mutate([...b]),O.answers[F].correct=(D==null?void 0:D.id)===l,O.answers[F].youVoted=!0,G&&O.answers.forEach(W=>{W.percentageDecimal=0}),(D==null?void 0:D.id)===l&&(O.answers[F].pointsEarned=O.status===yn.RESOLVED?0:D.points),c.mutate({...O})}this.submitAnswerTimeout&&clearTimeout(this.submitAnswerTimeout),this.submitAnswerTimeout=setTimeout(()=>{this.userSummary.invalidate()},1e3)}};try{await UZ(this.transport,{questionId:o,answerId:l}),y()}catch(b){if(b.message===m2.ALREADY_VOTED){this.userSummary.invalidate();const C=c.subscribe(()=>{});c.invalidate(),C()}throw b}});M(this,"openQuestion",(o,l)=>{var p,f,y,b;if(!o)return()=>{};this.notifications.close(this.background.getCurrentSessionId({prefix:"notification",entity:o}),{animateHiding:!1});let c=(p=l==null?void 0:l.attributes)==null?void 0:p.type;return c||(c=(b=(y=(((f=this.feedList.getStore().value)==null?void 0:f.data)||[]).find(C=>C.id===o))==null?void 0:y.attributes)==null?void 0:b.type),Io.emit("poll",{action:"opened",payload:{questionId:o,questionType:c,questionOpenedFrom:l==null?void 0:l.openedFrom}}),this.background.openQuestion(o,l)});M(this,"isOpenedQuestion",o=>this.notifications.isViewed(o));M(this,"closeQuestion",o=>this.background.closeQuestion(o));M(this,"openUser",async o=>{var p,f;const l=(p=this.leaderboardList.$store.get().data)==null?void 0:p.find(y=>y.userId===o);if(!l){this.openedUser.set(l);return}if(l.summaryLoaded){this.openedUser.set(l);return}const c={...l};try{const y=await rX(this.background.slStreamId,this.background.userId,this.friends,o,this.transport);(y==null?void 0:y.inTop)!==void 0&&(this.leaderboardList.$store.setKey("data",(f=this.leaderboardList.$store.get().data)==null?void 0:f.map(b=>(b.userId===o&&(b.inTop=y.inTop),b))),c.inTop=y.inTop)}catch(y){console.error(y)}this.openedUser.set(c)});M(this,"closeUser",()=>{this.openedUser.set(void 0)});M(this,"showInApp",o=>{var c,p,f,y,b,C,_,N,L,O,D,F,V,G;const l=this.onboardingStatus.$store.get();if(o&&o.data&&l&&l!==ya.Unset&&((c=o.data.question)==null?void 0:c.id)!==void 0&&o.data.question.notification!==void 0&&((f=(p=o.data.question)==null?void 0:p.bypassNotifications)==null?void 0:f.inAppSilence)!==Nw.ON&&o.data.question.status===yn.ACTIVE&&!o.data.question.marketClosed){if(oX.has(o.data.question.type))this.isInteractiveAllowed&&this.notifications.add({type:vu.QUESTION,action:()=>{var W,Z,ne;return this.openQuestion((Z=(W=o.data)==null?void 0:W.question)==null?void 0:Z.id,(ne=o.data)==null?void 0:ne.feedItem)},close:()=>{var W,Z;return this.closeQuestion((Z=(W=o.data)==null?void 0:W.question)==null?void 0:Z.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),emitEvent:!0,data:{questionId:o.data.question.id,questionType:o.data.question.type,question:{title:o.data.question.notification.title}}});else if(o.data.question.type===ke.FACTOID){const W=(y=o.data.question.options)==null?void 0:y.options.value,Z={heading:o.data.question.notification.title,body:o.data.question.notification.body,imageMode:W==null?void 0:W.imageMode,image:W==null?void 0:W.image,video:{id:((b=W==null?void 0:W.video)==null?void 0:b.id)||"",url:((C=W==null?void 0:W.video)==null?void 0:C.url)||"",thumbnailUrl:((_=W==null?void 0:W.video)==null?void 0:_.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:vu.QUESTION,action:()=>{var ne,ee,ue;return this.openQuestion((ee=(ne=o==null?void 0:o.data)==null?void 0:ne.question)==null?void 0:ee.id,(ue=o==null?void 0:o.data)==null?void 0:ue.feedItem)},close:()=>{var ne,ee;return this.closeQuestion((ee=(ne=o==null?void 0:o.data)==null?void 0:ne.question)==null?void 0:ee.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionId:o.data.question.id,questionType:o.data.question.type,insight:Z}})}else if(o.data.question.type===ke.TWEET){const W=(N=o.data.question.options)==null?void 0:N.options.value,Z={title:(L=o.data.question.notification)==null?void 0:L.title,body:(O=o.data.question.notification)==null?void 0:O.body,image:(D=o.data.question.notification)==null?void 0:D.image,account:((F=W==null?void 0:W.tweetMeta)==null?void 0:F.account)||"",accountVerified:!!((V=W==null?void 0:W.tweetMeta)!=null&&V.accountVerified),tweet:(G=W==null?void 0:W.tweetMeta)==null?void 0:G.tweet,tweetId:o.data.question.id};this.notifications.add({type:vu.QUESTION,action:()=>{var ne,ee,ue;return this.openQuestion((ee=(ne=o.data)==null?void 0:ne.question)==null?void 0:ee.id,(ue=o.data)==null?void 0:ue.feedItem)},close:()=>{var ne,ee;return this.closeQuestion((ee=(ne=o.data)==null?void 0:ne.question)==null?void 0:ee.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionId:o.data.question.id,questionType:o.data.question.type,tweet:Z}})}}});this.background=new xZ(c),this.advertisement=this.background.advertisement,this.feedSubscription=this.background.feedSubscription,this.activeQuestionId=this.background.activeQuestionId,this.openedQuestionId=this.background.openedQuestionId,this.storage=new sE,this.feedList=this.background.feedList,this.friends=new Zs(bZ(this.background.userId,c.transport),"gamification:friends"),this.currentUserId=this.background.userId,this.openedUser=ba(void 0),this.leaderboardId=new _o(ba(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=nX(this,this.background,c.transport,c.notifications),this.notifications=c.notifications,this.transport=c.transport,this.closeFeature=()=>c.sdk.closeFeature(!0),this.openFeature=()=>c.sdk.openFeature(yt.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=eX(this.transport,this.background.slStreamId,c.stores.providerStreamId.getStore(),this.background.userId),this.userSummary=aX(this.background.slStreamId,this.background.userId,this.friends,this.transport),this.leaderboardList=BZ(this.transport,this.background.slStreamId,this.background.userId,this.friends),this.connect(),this.cancels.add(this.userSummary.$store.listen((p,f)=>{f!=null&&f.summary&&(p!=null&&p.summary)&&this.leaderboardList.invalidate()})),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)),km(this.background.activeQuestionId,()=>{this.background.activeQuestionId.listen(this.showInApp)}),c.sdk.onMount({name:"gamification",clear:!0},()=>()=>{for(const p of this.cancels)p(),this.cancels.delete(p)})}get isInteractiveAllowed(){return this.background.interactiveAllowed.get()===Kc.ALLOWED}}const iX={[yt.GAMES]:!0};class lX extends nE{constructor(a,o){super(a,o)}}const uX=(n,a,o)=>n.type===yt.GAMES?new sX(n,a,o):new lX(n,a),cX=(n,a,o)=>{n.features=new Map,n.sdk.featuresList=new _o(ba(new Set),"features-list"),n.activeFeature=new _o(ba(yt.UNSET),"activeFeature"),n.sdk.getFeatures=()=>n.features,n.sdk.getFeature=l=>n.features.get(l),n.sdk.getActiveFeature=()=>n.activeFeature.getStore(),n.sdk.openFeature=l=>{n.activeFeature.setValue(l)},n.sdk.closeFeature=(l=!1)=>{const c=n.activeFeature.getValue();if(n.activeFeature.setValue(yt.UNSET),l&&c){n.features.delete(c);const p=n.sdk.featuresList.getValue();p&&p.delete(c),n.sdk.featuresList.setValue(p)}},n.initFeature=(l,c=Qi.ORGANIZATION)=>{if(l.type in iX&&!n.features.has(l.type)){const p=uX(l,c,n);n.features.set(l.type,p);let f=n.sdk.featuresList.getValue();f?f.add(l.type):f=new Set([l.type]),n.sdk.featuresList.setValue(new Set(f))}},n.updateFeature=(l,c)=>{var p;(p=n.features.get(l.type))==null||p.update(l,c)},n.destroyFeature=l=>{n.features.delete(l.type);const c=n.sdk.featuresList.getValue();c&&c.delete(l.type),n.sdk.featuresList.setValue(new Set(c))},n.reinitializeFeatures=async()=>{const l=await n.stores.organizationSettings.getValue();n.features.clear(),n.sdk.featuresList.setValue(new Set);for(const c of(l==null?void 0:l.overlays)||[])n.initFeature(c,Qi.ORGANIZATION)},n.stores.providerStreamId.listen(l=>{l||n.reinitializeFeatures()}),n.storeSubscribe=()=>{const l=(p,f)=>{var y;if(f!=null&&f.overlays&&!((y=n.contextConfig)!=null&&y.skipOrganizationSettings&&p===Qi.ORGANIZATION))for(const b of f.overlays)b.sdkEnable===!0&&(n.features.has(b.type)?n.updateFeature(b,p):n.initFeature(b,p))},c={organizationSettings:p=>{if(p.data)try{l(Qi.ORGANIZATION,p.data)}catch(f){console.log(f)}},streamSettings:p=>{if(p.data)try{l(Qi.STREAM,p.data)}catch(f){console.log(f)}}};n.store.subscribe(c)},o()};class dX{constructor(a){M(this,"analytics");M(this,"accepted",()=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:va.INVITATION_ACCEPTED},category:i9.GAMES,from:u2.UNSET})});M(this,"sent",({from:a})=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:va.INVITATION_SENT},category:i9.GAMES,from:a||u2.UNSET})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="invitation")switch(l.slEventBus.action){case"sent":this.sent(l.slEventBus.payload);break}};return Io.listen(o)})}}class mX{constructor(a){M(this,"analytics");M(this,"tap",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:va.INTERACTIONS},actionType:k9.TAP})});M(this,"scroll",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:va.INTERACTIONS},actionType:k9.SCROLL})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="interactions")switch(l.slEventBus.action){case"tap":this.tap();break;case"scroll":this.scroll();break}};return Io.listen(o)})}}const fX={[gu.UNSET]:zs.UNSET,[gu.INGAME_IAB21]:zs.PROMOTION_INGAME_IAB21,[gu.INGAME_IAB11_LBAR]:zs.PROMOTION_INGAME_IAB11_LBAR,[gu.INGAME_IAB11]:zs.PROMOTION_INGAME_IAB11,[gu.INGAME_IAB21_LBAR]:zs.PROMOTION_INGAME_IAB21_LBAR,[gu.INGAME_IAB61]:zs.PROMOTION_INGAME_IAB61,[gu.EXTERNAL_AD]:zs.PROMOTION_GAM};class pX{constructor(a){M(this,"analytics");M(this,"received",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_RECEIVED,topicId:a,topicType:Ja.POLLS_PROMOTION,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"opened",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_OPENED,topicId:a,topicType:Ja.POLLS_PROMOTION,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"videoPlay",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:a,kind:va.AD_VIDEO_PLAYED,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"buttonSelect",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:a,kind:va.AD_BUTTON_NAVIGATED,topicSubType:o},pollOpenedFrom:Co.UNSET})});M(this,"bannerSelect",({advertisementId:a},{topicSubType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:a,kind:va.AD_BANNER_NAVIGATED,topicSubType:o},pollOpenedFrom:Co.UNSET})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="advertisement"){const p=l.slEventBus.payload.advertisementType?fX[l.slEventBus.payload.advertisementType]:zs.UNSET;switch(l.slEventBus.action){case"videoPlay":this.videoPlay(l.slEventBus.payload,{topicSubType:p});break;case"buttonSelect":this.buttonSelect(l.slEventBus.payload,{topicSubType:p});break;case"bannerSelect":this.bannerSelect(l.slEventBus.payload,{topicSubType:p});break;case"received":this.received(l.slEventBus.payload,{topicSubType:p});break;case"opened":this.opened(l.slEventBus.payload,{topicSubType:p});break}}};return Io.listen(o)})}}const s2={[ke.UNSET]:Ja.UNSET,[ke.FACTOID]:Ja.POLLS_INSIGHT,[ke.POLL]:Ja.POLLS_POLL,[ke.PREDICTION]:Ja.POLLS_PREDICTION,[ke.PROMOTION]:Ja.POLLS_PROMOTION,[ke.TRIVIA]:Ja.POLLS_TRIVIA,[ke.TWEET]:Ja.POLLS_TWITTER};ke.UNSET+"",qs.UNSET,ke.FACTOID+"",qs.POLLS,ke.POLL+"",qs.POLLS,ke.PREDICTION+"",qs.POLLS,ke.PROMOTION+"",qs.POLLS,ke.TRIVIA+"",qs.POLLS,ke.TWEET+"",qs.POLLS;const hX={[yt.UNSET]:Ma.UNSET,[yt.INPLAY]:Ma.INPLAY,[yt.MESSAGING]:Ma.MESSAGING,[yt.STATISTICS]:Ma.STATS,[yt.BETTING]:Ma.BETTING,[yt.TWITTER]:Ma.TWITTER,[yt.MERCHANDISE]:Ma.MERCHANDISE,[yt.CONTESTS]:Ma.CONTESTS,[yt.VOICE_CHAT]:Ma.CALLING,[yt.TICKETS]:Ma.TICKETS,[yt.WHOIS_WATCHING]:Ma.WHOISWATCHING,[yt.PROFILE]:Ma.PROFILE,[yt.GAMES]:Ma.POLLS,[yt.GOLF_STATISTICS]:Ma.STATS,[yt.HIGHLIGHTS]:Ma.HIGHLIGHTS,[yt.PUBLIC_CHAT]:Ma.PUBLIC_CHAT};class gX{constructor(a){M(this,"analytics");M(this,"received",({questionId:a,questionType:o})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:va.NOTIFICATION_RECEIVED,topicId:a,topicType:o?s2[o]:Ja.UNSET},notificationKind:qs.POLLS,notificationType:S9.IN_APP})});M(this,"opened",({questionId:a,questionType:o})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:va.NOTIFICATION_OPENED,topicId:a,topicType:o?s2[o]:Ja.UNSET},notificationKind:qs.POLLS,notificationType:S9.IN_APP})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="notification")switch(l.slEventBus.action){case"rendered":this.received(l.slEventBus.payload);break;case"opened":this.opened(l.slEventBus.payload);break}};return Io.listen(o)})}}class yX{constructor(a){M(this,"analytics");M(this,"received",({questionId:a,questionType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_RECEIVED,topicId:a,topicType:o?s2[o]:Ja.UNSET},pollOpenedFrom:Co.UNSET})});M(this,"opened",({questionId:a,questionType:o,questionOpenedFrom:l})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_OPENED,topicId:a,topicType:o?s2[o]:Ja.UNSET},pollOpenedFrom:l==="list"?Co.PICK_HISTORY:Co.IN_APP})});M(this,"voted",({questionId:a,questionType:o})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_VOTE,topicId:a,topicType:o?s2[o]:Ja.UNSET},pollOpenedFrom:Co.UNSET})});M(this,"onboardingPassed",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.GAMES_JOINED},pollOpenedFrom:Co.UNSET})});M(this,"navigated",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:va.POLLS_NAVIGATED},pollOpenedFrom:Co.UNSET})});this.analytics=a,this.analytics.onConnect(()=>{const o=l=>{var c;if(((c=l.slEventBus)==null?void 0:c.type)==="poll")switch(l.slEventBus.action){case"voted":this.voted(l.slEventBus.payload);break;case"navigated":this.navigated();break;case"onboardingPassed":this.onboardingPassed();break;case"received":this.received(l.slEventBus.payload);break;case"opened":this.opened(l.slEventBus.payload);break}};return Io.listen(o)})}}const vX=({transport:n,$commonStore:a})=>{let o;const l=ba(!1),c=5e3,{client:p,queryKey:f}=n.createPromiseClient(ZC,{method:"send",params:[l]}),y=n.nanoquery.createFetcherStore(f,{fetcher:async()=>{const N=a.getStore().get();try{await p.unary({message:{case:"heartbeat",value:{common:{...N,kind:va.SESSION_HEARTBEAT}}}})}catch(L){Ki.error(L,"send heartbeat failed")}return Date.now()},refetchInterval:c}),b=()=>{Ki.debug("mounted heartbeat"),o=y.subscribe(()=>{})},C=()=>{Ki.debug("enabled heartbeat"),l.set(!0),y.lc===0&&b()},_=()=>{Ki.debug("disabled heartbeat"),l.set(!1)};return{enable:C,disable:_,mount:b,unmount:()=>{Ki.debug("unmounted heartbeat"),y.off(),o==null||o(),o=void 0,_()}}},Ki=Js("analytics");class TX{constructor(a){M(this,"commonStore");M(this,"notifications");M(this,"polls");M(this,"invitation");M(this,"interactions");M(this,"advertisement");M(this,"heartbeat");M(this,"analyticsClient");M(this,"listeners");M(this,"listenersCancels");M(this,"connected",!1);M(this,"connect",()=>{this.writeCommon("sessionId",T9()),this.heartbeat.enable(),this.listeners.forEach(a=>this.listenersCancels.add(a())),this.connected=!0,Ki.debug("analytics connected")});M(this,"disconnect",()=>{this.writeCommon("sessionId",""),this.writeCommon("overlaySessionId",""),this.heartbeat.unmount(),this.listenersCancels.forEach(a=>a()),this.connected=!1,Ki.debug("analytics disconnected")});M(this,"write",(a,o)=>{o&&this.analyticsClient.unary({message:{case:a,value:o}}).then(()=>{Ki.trace("send analytics success",a,o)}).catch(l=>{Ki.error(l,"send analytics failed")})});M(this,"writeCommon",(a,o)=>{this.commonStore.setValue(a,o)});M(this,"onConnect",a=>{this.listeners.add(a),this.connected&&this.listenersCancels.add(a())});M(this,"connectToSDK",a=>{this.onConnect(()=>a.stores.slStreamId.getAtomStore().subscribe(o=>{this.writeCommon("eventId",o)})),this.onConnect(()=>a.sdk.getActiveFeature().subscribe(o=>{o&&this.writeCommon("category",hX[o]),o!==yt.UNSET?this.writeCommon("overlaySessionId",T9()):this.writeCommon("overlaySessionId","")})),this.onConnect(()=>{const o=window.matchMedia("(orientation: portrait)"),l=c=>{this.writeCommon("screenOrientation",c.matches?s9.PORTRAIT:s9.LANDSCAPE)};return o.addEventListener("change",l),()=>{o.removeEventListener("change",l)}}),this.onConnect(()=>a.deepLink.$store.subscribe(o=>{o!=null&&o.handled&&this.invitation.accepted()}))});this.listeners=new Set,this.listenersCancels=new Set,this.commonStore=new Yc(is({}),"common-analytics"),this.connectToSDK(a),this.heartbeat=vX({transport:a.analyticsTransport,$commonStore:this.commonStore}),this.notifications=new gX(this),this.polls=new yX(this),this.invitation=new dX(this),this.interactions=new mX(this),this.advertisement=new pX(this);const{client:o}=a.analyticsTransport.createPromiseClient(ZC,{method:"send"});this.analyticsClient=o}}const bX=(n,a,o)=>{n.analytics=new TX(n),n.sdk.onMount({name:"analytics"},()=>(n.analytics.connect(),()=>{n.analytics.disconnect()})),o()};var fy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof f9<"u"?f9:typeof self<"u"?self:{};function kX(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var py={exports:{}},hy={exports:{}};function SX(n){var a=new n,o=a;function l(){var p=a;return p.next?a=p.next:(a=new n,o=a),p.next=null,p}function c(p){o.next=p,o=p}return{get:l,release:c}}var wX=SX,CX=wX;function uE(n,a,o){if(typeof n=="function"&&(o=a,a=n,n=null),!(o>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var l=CX(EX),c=null,p=null,f=0,y=null,b={push:F,drain:wo,saturated:wo,pause:_,paused:!1,get concurrency(){return o},set concurrency(ee){if(!(ee>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(o=ee,!b.paused)for(;c&&f<o;)f++,G()},running:C,resume:O,idle:D,length:N,getQueue:L,unshift:V,empty:wo,kill:W,killAndDrain:Z,error:ne};return b;function C(){return f}function _(){b.paused=!0}function N(){for(var ee=c,ue=0;ee;)ee=ee.next,ue++;return ue}function L(){for(var ee=c,ue=[];ee;)ue.push(ee.value),ee=ee.next;return ue}function O(){if(b.paused){if(b.paused=!1,c===null){f++,G();return}for(;c&&f<o;)f++,G()}}function D(){return f===0&&b.length()===0}function F(ee,ue){var oe=l.get();oe.context=n,oe.release=G,oe.value=ee,oe.callback=ue||wo,oe.errorHandler=y,f>=o||b.paused?p?(p.next=oe,p=oe):(c=oe,p=oe,b.saturated()):(f++,a.call(n,oe.value,oe.worked))}function V(ee,ue){var oe=l.get();oe.context=n,oe.release=G,oe.value=ee,oe.callback=ue||wo,oe.errorHandler=y,f>=o||b.paused?c?(oe.next=c,c=oe):(c=oe,p=oe,b.saturated()):(f++,a.call(n,oe.value,oe.worked))}function G(ee){ee&&l.release(ee);var ue=c;ue&&f<=o?b.paused?f--:(p===c&&(p=null),c=ue.next,ue.next=null,a.call(n,ue.value,ue.worked),p===null&&b.empty()):--f===0&&b.drain()}function W(){c=null,p=null,b.drain=wo}function Z(){c=null,p=null,b.drain(),b.drain=wo}function ne(ee){y=ee}}function wo(){}function EX(){this.value=null,this.callback=wo,this.next=null,this.release=wo,this.context=null,this.errorHandler=null;var n=this;this.worked=function(a,o){var l=n.callback,c=n.errorHandler,p=n.value;n.value=null,n.callback=wo,n.errorHandler&&c(a,p),l.call(n.context,a,o),n.release(n)}}function _X(n,a,o){typeof n=="function"&&(o=a,a=n,n=null);function l(_,N){a.call(this,_).then(function(L){N(null,L)},N)}var c=uE(n,l,o),p=c.push,f=c.unshift;return c.push=y,c.unshift=b,c.drained=C,c;function y(_){var N=new Promise(function(L,O){p(_,function(D,F){if(D){O(D);return}L(F)})});return N.catch(wo),N}function b(_){var N=new Promise(function(L,O){f(_,function(D,F){if(D){O(D);return}L(F)})});return N.catch(wo),N}function C(){if(c.idle())return new Promise(function(L){L()});var _=c.drain,N=new Promise(function(L){c.drain=function(){_(),L()}});return N}}hy.exports=uE;hy.exports.promise=_X;var cE=hy.exports,gy={exports:{}},mm=typeof Reflect=="object"?Reflect:null,ES=mm&&typeof mm.apply=="function"?mm.apply:function(n,a,o){return Function.prototype.apply.call(n,a,o)},Kh;mm&&typeof mm.ownKeys=="function"?Kh=mm.ownKeys:Object.getOwnPropertySymbols?Kh=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Kh=function(n){return Object.getOwnPropertyNames(n)};function IX(n){console&&console.warn&&console.warn(n)}var dE=Number.isNaN||function(n){return n!==n};function Qt(){Qt.init.call(this)}gy.exports=Qt;gy.exports.once=OX;Qt.EventEmitter=Qt;Qt.prototype._events=void 0;Qt.prototype._eventsCount=0;Qt.prototype._maxListeners=void 0;var _S=10;function O6(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return _S},set:function(n){if(typeof n!="number"||n<0||dE(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");_S=n}});Qt.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};Qt.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||dE(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function mE(n){return n._maxListeners===void 0?Qt.defaultMaxListeners:n._maxListeners}Qt.prototype.getMaxListeners=function(){return mE(this)};Qt.prototype.emit=function(n){for(var a=[],o=1;o<arguments.length;o++)a.push(arguments[o]);var l=n==="error",c=this._events;if(c!==void 0)l=l&&c.error===void 0;else if(!l)return!1;if(l){var p;if(a.length>0&&(p=a[0]),p instanceof Error)throw p;var f=new Error("Unhandled error."+(p?" ("+p.message+")":""));throw f.context=p,f}var y=c[n];if(y===void 0)return!1;if(typeof y=="function")ES(y,this,a);else for(var b=y.length,C=yE(y,b),o=0;o<b;++o)ES(C[o],this,a);return!0};function fE(n,a,o,l){var c,p,f;if(O6(o),p=n._events,p===void 0?(p=n._events=Object.create(null),n._eventsCount=0):(p.newListener!==void 0&&(n.emit("newListener",a,o.listener?o.listener:o),p=n._events),f=p[a]),f===void 0)f=p[a]=o,++n._eventsCount;else if(typeof f=="function"?f=p[a]=l?[o,f]:[f,o]:l?f.unshift(o):f.push(o),c=mE(n),c>0&&f.length>c&&!f.warned){f.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=n,y.type=a,y.count=f.length,IX(y)}return n}Qt.prototype.addListener=function(n,a){return fE(this,n,a,!1)};Qt.prototype.on=Qt.prototype.addListener;Qt.prototype.prependListener=function(n,a){return fE(this,n,a,!0)};function NX(){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 pE(n,a,o){var l={fired:!1,wrapFn:void 0,target:n,type:a,listener:o},c=NX.bind(l);return c.listener=o,l.wrapFn=c,c}Qt.prototype.once=function(n,a){return O6(a),this.on(n,pE(this,n,a)),this};Qt.prototype.prependOnceListener=function(n,a){return O6(a),this.prependListener(n,pE(this,n,a)),this};Qt.prototype.removeListener=function(n,a){var o,l,c,p,f;if(O6(a),l=this._events,l===void 0)return this;if(o=l[n],o===void 0)return this;if(o===a||o.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete l[n],l.removeListener&&this.emit("removeListener",n,o.listener||a));else if(typeof o!="function"){for(c=-1,p=o.length-1;p>=0;p--)if(o[p]===a||o[p].listener===a){f=o[p].listener,c=p;break}if(c<0)return this;c===0?o.shift():RX(o,c),o.length===1&&(l[n]=o[0]),l.removeListener!==void 0&&this.emit("removeListener",n,f||a)}return this};Qt.prototype.off=Qt.prototype.removeListener;Qt.prototype.removeAllListeners=function(n){var a,o,l;if(o=this._events,o===void 0)return this;if(o.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):o[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete o[n]),this;if(arguments.length===0){var c=Object.keys(o),p;for(l=0;l<c.length;++l)p=c[l],p!=="removeListener"&&this.removeAllListeners(p);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=o[n],typeof a=="function")this.removeListener(n,a);else if(a!==void 0)for(l=a.length-1;l>=0;l--)this.removeListener(n,a[l]);return this};function hE(n,a,o){var l=n._events;if(l===void 0)return[];var c=l[a];return c===void 0?[]:typeof c=="function"?o?[c.listener||c]:[c]:o?LX(c):yE(c,c.length)}Qt.prototype.listeners=function(n){return hE(this,n,!0)};Qt.prototype.rawListeners=function(n){return hE(this,n,!1)};Qt.listenerCount=function(n,a){return typeof n.listenerCount=="function"?n.listenerCount(a):gE.call(n,a)};Qt.prototype.listenerCount=gE;function gE(n){var a=this._events;if(a!==void 0){var o=a[n];if(typeof o=="function")return 1;if(o!==void 0)return o.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Kh(this._events):[]};function yE(n,a){for(var o=new Array(a),l=0;l<a;++l)o[l]=n[l];return o}function RX(n,a){for(;a+1<n.length;a++)n[a]=n[a+1];n.pop()}function LX(n){for(var a=new Array(n.length),o=0;o<a.length;++o)a[o]=n[o].listener||n[o];return a}function OX(n,a){return new Promise(function(o,l){function c(f){n.removeListener(a,p),l(f)}function p(){typeof n.removeListener=="function"&&n.removeListener("error",c),o([].slice.call(arguments))}vE(n,a,p,{once:!0}),a!=="error"&&xX(n,c,{once:!0})})}function xX(n,a,o){typeof n.on=="function"&&vE(n,"error",a,o)}function vE(n,a,o,l){if(typeof n.on=="function")l.once?n.once(a,o):n.on(a,o);else if(typeof n.addEventListener=="function")n.addEventListener(a,function c(p){l.once&&n.removeEventListener(a,c),o(p)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}var TE=gy.exports,x6={},bE={},kE=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},a=Symbol("test"),o=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var l=42;n[a]=l;for(a in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var c=Object.getOwnPropertySymbols(n);if(c.length!==1||c[0]!==a||!Object.prototype.propertyIsEnumerable.call(n,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(n,a);if(p.value!==l||p.enumerable!==!0)return!1}return!0},AX=kE,A6=function(){return AX()&&!!Symbol.toStringTag},PX=Error,MX=EvalError,DX=RangeError,UX=ReferenceError,SE=SyntaxError,P6=TypeError,FX=URIError,IS=typeof Symbol<"u"&&Symbol,VX=kE,jX=function(){return typeof IS!="function"||typeof Symbol!="function"||typeof IS("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:VX()},F5={__proto__:null,foo:{}},BX=Object,$X=function(){return{__proto__:F5}.foo===F5.foo&&!(F5 instanceof BX)},zX="Function.prototype.bind called on incompatible ",HX=Object.prototype.toString,GX=Math.max,qX="[object Function]",NS=function(n,a){for(var o=[],l=0;l<n.length;l+=1)o[l]=n[l];for(var c=0;c<a.length;c+=1)o[c+n.length]=a[c];return o},WX=function(n,a){for(var o=[],l=a,c=0;l<n.length;l+=1,c+=1)o[c]=n[l];return o},QX=function(n,a){for(var o="",l=0;l<n.length;l+=1)o+=n[l],l+1<n.length&&(o+=a);return o},YX=function(n){var a=this;if(typeof a!="function"||HX.apply(a)!==qX)throw new TypeError(zX+a);for(var o=WX(arguments,1),l,c=function(){if(this instanceof l){var C=a.apply(this,NS(o,arguments));return Object(C)===C?C:this}return a.apply(n,NS(o,arguments))},p=GX(0,a.length-o.length),f=[],y=0;y<p;y++)f[y]="$"+y;if(l=Function("binder","return function ("+QX(f,",")+"){ return binder.apply(this,arguments); }")(c),a.prototype){var b=function(){};b.prototype=a.prototype,l.prototype=new b,b.prototype=null}return l},KX=YX,yy=Function.prototype.bind||KX,ZX=Function.prototype.call,XX=Object.prototype.hasOwnProperty,JX=yy,eJ=JX.call(ZX,XX),Ot,tJ=PX,nJ=MX,aJ=DX,rJ=UX,vm=SE,fm=P6,oJ=FX,wE=Function,V5=function(n){try{return wE('"use strict"; return ('+n+").constructor;")()}catch{}},Zc=Object.getOwnPropertyDescriptor;if(Zc)try{Zc({},"")}catch{Zc=null}var j5=function(){throw new fm},sJ=Zc?function(){try{return arguments.callee,j5}catch{try{return Zc(arguments,"callee").get}catch{return j5}}}():j5,em=jX(),iJ=$X(),ha=Object.getPrototypeOf||(iJ?function(n){return n.__proto__}:null),nm={},lJ=typeof Uint8Array>"u"||!ha?Ot:ha(Uint8Array),Xc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ot:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ot:ArrayBuffer,"%ArrayIteratorPrototype%":em&&ha?ha([][Symbol.iterator]()):Ot,"%AsyncFromSyncIteratorPrototype%":Ot,"%AsyncFunction%":nm,"%AsyncGenerator%":nm,"%AsyncGeneratorFunction%":nm,"%AsyncIteratorPrototype%":nm,"%Atomics%":typeof Atomics>"u"?Ot:Atomics,"%BigInt%":typeof BigInt>"u"?Ot:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ot:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ot:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ot:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":tJ,"%eval%":eval,"%EvalError%":nJ,"%Float32Array%":typeof Float32Array>"u"?Ot:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ot:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ot:FinalizationRegistry,"%Function%":wE,"%GeneratorFunction%":nm,"%Int8Array%":typeof Int8Array>"u"?Ot:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ot:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ot:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":em&&ha?ha(ha([][Symbol.iterator]())):Ot,"%JSON%":typeof JSON=="object"?JSON:Ot,"%Map%":typeof Map>"u"?Ot:Map,"%MapIteratorPrototype%":typeof Map>"u"||!em||!ha?Ot:ha(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ot:Promise,"%Proxy%":typeof Proxy>"u"?Ot:Proxy,"%RangeError%":aJ,"%ReferenceError%":rJ,"%Reflect%":typeof Reflect>"u"?Ot:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ot:Set,"%SetIteratorPrototype%":typeof Set>"u"||!em||!ha?Ot:ha(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ot:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":em&&ha?ha(""[Symbol.iterator]()):Ot,"%Symbol%":em?Symbol:Ot,"%SyntaxError%":vm,"%ThrowTypeError%":sJ,"%TypedArray%":lJ,"%TypeError%":fm,"%Uint8Array%":typeof Uint8Array>"u"?Ot:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ot:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ot:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ot:Uint32Array,"%URIError%":oJ,"%WeakMap%":typeof WeakMap>"u"?Ot:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ot:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ot:WeakSet};if(ha)try{null.error}catch(n){var uJ=ha(ha(n));Xc["%Error.prototype%"]=uJ}var cJ=function n(a){var o;if(a==="%AsyncFunction%")o=V5("async function () {}");else if(a==="%GeneratorFunction%")o=V5("function* () {}");else if(a==="%AsyncGeneratorFunction%")o=V5("async function* () {}");else if(a==="%AsyncGenerator%"){var l=n("%AsyncGeneratorFunction%");l&&(o=l.prototype)}else if(a==="%AsyncIteratorPrototype%"){var c=n("%AsyncGenerator%");c&&ha&&(o=ha(c.prototype))}return Xc[a]=o,o},RS={__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"]},y2=yy,p6=eJ,dJ=y2.call(Function.call,Array.prototype.concat),mJ=y2.call(Function.apply,Array.prototype.splice),LS=y2.call(Function.call,String.prototype.replace),h6=y2.call(Function.call,String.prototype.slice),fJ=y2.call(Function.call,RegExp.prototype.exec),pJ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,hJ=/\\(\\)?/g,gJ=function(n){var a=h6(n,0,1),o=h6(n,-1);if(a==="%"&&o!=="%")throw new vm("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&a!=="%")throw new vm("invalid intrinsic syntax, expected opening `%`");var l=[];return LS(n,pJ,function(c,p,f,y){l[l.length]=f?LS(y,hJ,"$1"):p||c}),l},yJ=function(n,a){var o=n,l;if(p6(RS,o)&&(l=RS[o],o="%"+l[0]+"%"),p6(Xc,o)){var c=Xc[o];if(c===nm&&(c=cJ(o)),typeof c>"u"&&!a)throw new fm("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:l,name:o,value:c}}throw new vm("intrinsic "+n+" does not exist!")},v2=function(n,a){if(typeof n!="string"||n.length===0)throw new fm("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new fm('"allowMissing" argument must be a boolean');if(fJ(/^%?[^%]*%?$/,n)===null)throw new vm("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=gJ(n),l=o.length>0?o[0]:"",c=yJ("%"+l+"%",a),p=c.name,f=c.value,y=!1,b=c.alias;b&&(l=b[0],mJ(o,dJ([0,1],b)));for(var C=1,_=!0;C<o.length;C+=1){var N=o[C],L=h6(N,0,1),O=h6(N,-1);if((L==='"'||L==="'"||L==="`"||O==='"'||O==="'"||O==="`")&&L!==O)throw new vm("property names with quotes must have matching quotes");if((N==="constructor"||!_)&&(y=!0),l+="."+N,p="%"+l+"%",p6(Xc,p))f=Xc[p];else if(f!=null){if(!(N in f)){if(!a)throw new fm("base intrinsic for "+n+" exists, but the property is not available.");return}if(Zc&&C+1>=o.length){var D=Zc(f,N);_=!!D,_&&"get"in D&&!("originalValue"in D.get)?f=D.get:f=f[N]}else _=p6(f,N),f=f[N];_&&!y&&(Xc[p]=f)}}return f},CE={exports:{}},B5,OS;function vy(){if(OS)return B5;OS=1;var n=v2,a=n("%Object.defineProperty%",!0)||!1;if(a)try{a({},"a",{value:1})}catch{a=!1}return B5=a,B5}var vJ=v2,Zh=vJ("%Object.getOwnPropertyDescriptor%",!0);if(Zh)try{Zh([],"length")}catch{Zh=null}var M6=Zh,xS=vy(),TJ=SE,tm=P6,AS=M6,bJ=function(n,a,o){if(!n||typeof n!="object"&&typeof n!="function")throw new tm("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new tm("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new tm("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new tm("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new tm("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new tm("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,y=!!AS&&AS(n,a);if(xS)xS(n,a,{configurable:p===null&&y?y.configurable:!p,enumerable:l===null&&y?y.enumerable:!l,value:o,writable:c===null&&y?y.writable:!c});else if(f||!l&&!c&&!p)n[a]=o;else throw new TJ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},I9=vy(),EE=function(){return!!I9};EE.hasArrayLengthDefineBug=function(){if(!I9)return null;try{return I9([],"length",{value:1}).length!==1}catch{return!0}};var kJ=EE,SJ=v2,PS=bJ,wJ=kJ(),MS=M6,DS=P6,CJ=SJ("%Math.floor%"),EJ=function(n,a){if(typeof n!="function")throw new DS("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||CJ(a)!==a)throw new DS("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in n&&MS){var p=MS(n,"length");p&&!p.configurable&&(l=!1),p&&!p.writable&&(c=!1)}return(l||c||!o)&&(wJ?PS(n,"length",a,!0,!0):PS(n,"length",a)),n};(function(n){var a=yy,o=v2,l=EJ,c=P6,p=o("%Function.prototype.apply%"),f=o("%Function.prototype.call%"),y=o("%Reflect.apply%",!0)||a.call(f,p),b=vy(),C=o("%Math.max%");n.exports=function(N){if(typeof N!="function")throw new c("a function is required");var L=y(a,f,arguments);return l(L,1+C(0,N.length-(arguments.length-1)),!0)};var _=function(){return y(a,p,arguments)};b?b(n.exports,"apply",{value:_}):n.exports.apply=_})(CE);var Ty=CE.exports,_E=v2,IE=Ty,_J=IE(_E("String.prototype.indexOf")),by=function(n,a){var o=_E(n,!!a);return typeof o=="function"&&_J(n,".prototype.")>-1?IE(o):o},IJ=A6(),NJ=by,N9=NJ("Object.prototype.toString"),D6=function(n){return IJ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:N9(n)==="[object Arguments]"},NE=function(n){return D6(n)?!0:n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&N9(n)!=="[object Array]"&&N9(n.callee)==="[object Function]"},RJ=function(){return D6(arguments)}();D6.isLegacyArguments=NE;var LJ=RJ?D6:NE,OJ=Object.prototype.toString,xJ=Function.prototype.toString,AJ=/^\s*(?:function)?\*/,RE=A6(),$5=Object.getPrototypeOf,PJ=function(){if(!RE)return!1;try{return Function("return function*() {}")()}catch{}},z5,MJ=function(n){if(typeof n!="function")return!1;if(AJ.test(xJ.call(n)))return!0;if(!RE){var a=OJ.call(n);return a==="[object GeneratorFunction]"}if(!$5)return!1;if(typeof z5>"u"){var o=PJ();z5=o?$5(o):!1}return $5(n)===z5},LE=Function.prototype.toString,sm=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,R9,Xh;if(typeof sm=="function"&&typeof Object.defineProperty=="function")try{R9=Object.defineProperty({},"length",{get:function(){throw Xh}}),Xh={},sm(function(){throw 42},null,R9)}catch(n){n!==Xh&&(sm=null)}else sm=null;var DJ=/^\s*class\b/,L9=function(n){try{var a=LE.call(n);return DJ.test(a)}catch{return!1}},H5=function(n){try{return L9(n)?!1:(LE.call(n),!0)}catch{return!1}},Jh=Object.prototype.toString,UJ="[object Object]",FJ="[object Function]",VJ="[object GeneratorFunction]",jJ="[object HTMLAllCollection]",BJ="[object HTML document.all class]",$J="[object HTMLCollection]",zJ=typeof Symbol=="function"&&!!Symbol.toStringTag,HJ=!(0 in[,]),O9=function(){return!1};if(typeof document=="object"){var GJ=document.all;Jh.call(GJ)===Jh.call(document.all)&&(O9=function(n){if((HJ||!n)&&(typeof n>"u"||typeof n=="object"))try{var a=Jh.call(n);return(a===jJ||a===BJ||a===$J||a===UJ)&&n("")==null}catch{}return!1})}var qJ=sm?function(n){if(O9(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;try{sm(n,null,R9)}catch(a){if(a!==Xh)return!1}return!L9(n)&&H5(n)}:function(n){if(O9(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;if(zJ)return H5(n);if(L9(n))return!1;var a=Jh.call(n);return a!==FJ&&a!==VJ&&!/^\[object HTML/.test(a)?!1:H5(n)},WJ=qJ,QJ=Object.prototype.toString,OE=Object.prototype.hasOwnProperty,YJ=function(n,a,o){for(var l=0,c=n.length;l<c;l++)OE.call(n,l)&&(o==null?a(n[l],l,n):a.call(o,n[l],l,n))},KJ=function(n,a,o){for(var l=0,c=n.length;l<c;l++)o==null?a(n.charAt(l),l,n):a.call(o,n.charAt(l),l,n)},ZJ=function(n,a,o){for(var l in n)OE.call(n,l)&&(o==null?a(n[l],l,n):a.call(o,n[l],l,n))},XJ=function(n,a,o){if(!WJ(a))throw new TypeError("iterator must be a function");var l;arguments.length>=3&&(l=o),QJ.call(n)==="[object Array]"?YJ(n,a,l):typeof n=="string"?KJ(n,a,l):ZJ(n,a,l)},xE=XJ,JJ=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],G5=JJ,eee=typeof globalThis>"u"?fy:globalThis,AE=function(){for(var n=[],a=0;a<G5.length;a++)typeof eee[G5[a]]=="function"&&(n[n.length]=G5[a]);return n},g6=xE,tee=AE,US=Ty,ky=by,e6=M6,nee=ky("Object.prototype.toString"),PE=A6(),FS=typeof globalThis>"u"?fy:globalThis,x9=tee(),Sy=ky("String.prototype.slice"),q5=Object.getPrototypeOf,aee=ky("Array.prototype.indexOf",!0)||function(n,a){for(var o=0;o<n.length;o+=1)if(n[o]===a)return o;return-1},y6={__proto__:null};PE&&e6&&q5?g6(x9,function(n){var a=new FS[n];if(Symbol.toStringTag in a){var o=q5(a),l=e6(o,Symbol.toStringTag);if(!l){var c=q5(o);l=e6(c,Symbol.toStringTag)}y6["$"+n]=US(l.get)}}):g6(x9,function(n){var a=new FS[n],o=a.slice||a.set;o&&(y6["$"+n]=US(o))});var ree=function(n){var a=!1;return g6(y6,function(o,l){if(!a)try{"$"+o(n)===l&&(a=Sy(l,1))}catch{}}),a},oee=function(n){var a=!1;return g6(y6,function(o,l){if(!a)try{o(n),a=Sy(l,1)}catch{}}),a},see=function(n){if(!n||typeof n!="object")return!1;if(!PE){var a=Sy(nee(n),8,-1);return aee(x9,a)>-1?a:a!=="Object"?!1:oee(n)}return e6?ree(n):null},v6=xE,iee=AE,VS=Ty,wy=by,t6=M6,lee=wy("Object.prototype.toString"),ME=A6(),jS=typeof globalThis>"u"?fy:globalThis,A9=iee(),Cy=wy("String.prototype.slice"),W5=Object.getPrototypeOf,uee=wy("Array.prototype.indexOf",!0)||function(n,a){for(var o=0;o<n.length;o+=1)if(n[o]===a)return o;return-1},T6={__proto__:null};ME&&t6&&W5?v6(A9,function(n){var a=new jS[n];if(Symbol.toStringTag in a){var o=W5(a),l=t6(o,Symbol.toStringTag);if(!l){var c=W5(o);l=t6(c,Symbol.toStringTag)}T6["$"+n]=VS(l.get)}}):v6(A9,function(n){var a=new jS[n],o=a.slice||a.set;o&&(T6["$"+n]=VS(o))});var cee=function(n){var a=!1;return v6(T6,function(o,l){if(!a)try{"$"+o(n)===l&&(a=Cy(l,1))}catch{}}),a},dee=function(n){var a=!1;return v6(T6,function(o,l){if(!a)try{o(n),a=Cy(l,1)}catch{}}),a},mee=function(n){if(!n||typeof n!="object")return!1;if(!ME){var a=Cy(lee(n),8,-1);return uee(A9,a)>-1?a:a!=="Object"?!1:dee(n)}return t6?cee(n):null},fee=mee,pee=function(n){return!!fee(n)};(function(n){var a=LJ,o=MJ,l=see,c=pee;function p(de){return de.call.bind(de)}var f=typeof BigInt<"u",y=typeof Symbol<"u",b=p(Object.prototype.toString),C=p(Number.prototype.valueOf),_=p(String.prototype.valueOf),N=p(Boolean.prototype.valueOf);if(f)var L=p(BigInt.prototype.valueOf);if(y)var O=p(Symbol.prototype.valueOf);function D(de,No){if(typeof de!="object")return!1;try{return No(de),!0}catch{return!1}}n.isArgumentsObject=a,n.isGeneratorFunction=o,n.isTypedArray=c;function F(de){return typeof Promise<"u"&&de instanceof Promise||de!==null&&typeof de=="object"&&typeof de.then=="function"&&typeof de.catch=="function"}n.isPromise=F;function V(de){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(de):c(de)||se(de)}n.isArrayBufferView=V;function G(de){return l(de)==="Uint8Array"}n.isUint8Array=G;function W(de){return l(de)==="Uint8ClampedArray"}n.isUint8ClampedArray=W;function Z(de){return l(de)==="Uint16Array"}n.isUint16Array=Z;function ne(de){return l(de)==="Uint32Array"}n.isUint32Array=ne;function ee(de){return l(de)==="Int8Array"}n.isInt8Array=ee;function ue(de){return l(de)==="Int16Array"}n.isInt16Array=ue;function oe(de){return l(de)==="Int32Array"}n.isInt32Array=oe;function Ne(de){return l(de)==="Float32Array"}n.isFloat32Array=Ne;function Ie(de){return l(de)==="Float64Array"}n.isFloat64Array=Ie;function Ze(de){return l(de)==="BigInt64Array"}n.isBigInt64Array=Ze;function Ge(de){return l(de)==="BigUint64Array"}n.isBigUint64Array=Ge;function Qe(de){return b(de)==="[object Map]"}Qe.working=typeof Map<"u"&&Qe(new Map);function _e(de){return typeof Map>"u"?!1:Qe.working?Qe(de):de instanceof Map}n.isMap=_e;function et(de){return b(de)==="[object Set]"}et.working=typeof Set<"u"&&et(new Set);function ht(de){return typeof Set>"u"?!1:et.working?et(de):de instanceof Set}n.isSet=ht;function Rt(de){return b(de)==="[object WeakMap]"}Rt.working=typeof WeakMap<"u"&&Rt(new WeakMap);function Wn(de){return typeof WeakMap>"u"?!1:Rt.working?Rt(de):de instanceof WeakMap}n.isWeakMap=Wn;function Te(de){return b(de)==="[object WeakSet]"}Te.working=typeof WeakSet<"u"&&Te(new WeakSet);function Pe(de){return Te(de)}n.isWeakSet=Pe;function Se(de){return b(de)==="[object ArrayBuffer]"}Se.working=typeof ArrayBuffer<"u"&&Se(new ArrayBuffer);function ct(de){return typeof ArrayBuffer>"u"?!1:Se.working?Se(de):de instanceof ArrayBuffer}n.isArrayBuffer=ct;function B(de){return b(de)==="[object DataView]"}B.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&B(new DataView(new ArrayBuffer(1),0,1));function se(de){return typeof DataView>"u"?!1:B.working?B(de):de instanceof DataView}n.isDataView=se;var me=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function qe(de){return b(de)==="[object SharedArrayBuffer]"}function gt(de){return typeof me>"u"?!1:(typeof qe.working>"u"&&(qe.working=qe(new me)),qe.working?qe(de):de instanceof me)}n.isSharedArrayBuffer=gt;function it(de){return b(de)==="[object AsyncFunction]"}n.isAsyncFunction=it;function tt(de){return b(de)==="[object Map Iterator]"}n.isMapIterator=tt;function lt(de){return b(de)==="[object Set Iterator]"}n.isSetIterator=lt;function Et(de){return b(de)==="[object Generator]"}n.isGeneratorObject=Et;function Yt(de){return b(de)==="[object WebAssembly.Module]"}n.isWebAssemblyCompiledModule=Yt;function In(de){return D(de,C)}n.isNumberObject=In;function Gt(de){return D(de,_)}n.isStringObject=Gt;function nn(de){return D(de,N)}n.isBooleanObject=nn;function Nt(de){return f&&D(de,L)}n.isBigIntObject=Nt;function sn(de){return y&&D(de,O)}n.isSymbolObject=sn;function Nn(de){return In(de)||Gt(de)||nn(de)||Nt(de)||sn(de)}n.isBoxedPrimitive=Nn;function zr(de){return typeof Uint8Array<"u"&&(ct(de)||gt(de))}n.isAnyArrayBuffer=zr,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(de){Object.defineProperty(n,de,{enumerable:!1,value:function(){throw new Error(de+" is not supported in userland")}})})})(bE);var hee=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"},P9={exports:{}};typeof Object.create=="function"?P9.exports=function(n,a){a&&(n.super_=a,n.prototype=Object.create(a.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:P9.exports=function(n,a){if(a){n.super_=a;var o=function(){};o.prototype=a.prototype,n.prototype=new o,n.prototype.constructor=n}};var gee=P9.exports;(function(n){var a=Object.getOwnPropertyDescriptors||function(B){for(var se=Object.keys(B),me={},qe=0;qe<se.length;qe++)me[se[qe]]=Object.getOwnPropertyDescriptor(B,se[qe]);return me},o=/%[sdj%]/g;n.format=function(B){if(!ee(B)){for(var se=[],me=0;me<arguments.length;me++)se.push(f(arguments[me]));return se.join(" ")}for(var me=1,qe=arguments,gt=qe.length,it=String(B).replace(o,function(Et){if(Et==="%%")return"%";if(me>=gt)return Et;switch(Et){case"%s":return String(qe[me++]);case"%d":return Number(qe[me++]);case"%j":try{return JSON.stringify(qe[me++])}catch{return"[Circular]"}default:return Et}}),tt=qe[me];me<gt;tt=qe[++me])W(tt)||!Ie(tt)?it+=" "+tt:it+=" "+f(tt);return it},n.deprecate=function(B,se){if(typeof St<"u"&&St.noDeprecation===!0)return B;if(typeof St>"u")return function(){return n.deprecate(B,se).apply(this,arguments)};var me=!1;function qe(){if(!me){if(St.throwDeprecation)throw new Error(se);St.traceDeprecation?console.trace(se):console.error(se),me=!0}return B.apply(this,arguments)}return qe};var l={},c=/^$/;if(St.env.NODE_DEBUG){var p=St.env.NODE_DEBUG;p=p.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+p+"$","i")}n.debuglog=function(B){if(B=B.toUpperCase(),!l[B])if(c.test(B)){var se=St.pid;l[B]=function(){var me=n.format.apply(n,arguments);console.error("%s %d: %s",B,se,me)}}else l[B]=function(){};return l[B]};function f(B,se){var me={seen:[],stylize:b};return arguments.length>=3&&(me.depth=arguments[2]),arguments.length>=4&&(me.colors=arguments[3]),G(se)?me.showHidden=se:se&&n._extend(me,se),oe(me.showHidden)&&(me.showHidden=!1),oe(me.depth)&&(me.depth=2),oe(me.colors)&&(me.colors=!1),oe(me.customInspect)&&(me.customInspect=!0),me.colors&&(me.stylize=y),_(me,B,me.depth)}n.inspect=f,f.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]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function y(B,se){var me=f.styles[se];return me?"\x1B["+f.colors[me][0]+"m"+B+"\x1B["+f.colors[me][1]+"m":B}function b(B,se){return B}function C(B){var se={};return B.forEach(function(me,qe){se[me]=!0}),se}function _(B,se,me){if(B.customInspect&&se&&Qe(se.inspect)&&se.inspect!==n.inspect&&!(se.constructor&&se.constructor.prototype===se)){var qe=se.inspect(me,B);return ee(qe)||(qe=_(B,qe,me)),qe}var gt=N(B,se);if(gt)return gt;var it=Object.keys(se),tt=C(it);if(B.showHidden&&(it=Object.getOwnPropertyNames(se)),Ge(se)&&(it.indexOf("message")>=0||it.indexOf("description")>=0))return L(se);if(it.length===0){if(Qe(se)){var lt=se.name?": "+se.name:"";return B.stylize("[Function"+lt+"]","special")}if(Ne(se))return B.stylize(RegExp.prototype.toString.call(se),"regexp");if(Ze(se))return B.stylize(Date.prototype.toString.call(se),"date");if(Ge(se))return L(se)}var Et="",Yt=!1,In=["{","}"];if(V(se)&&(Yt=!0,In=["[","]"]),Qe(se)){var Gt=se.name?": "+se.name:"";Et=" [Function"+Gt+"]"}if(Ne(se)&&(Et=" "+RegExp.prototype.toString.call(se)),Ze(se)&&(Et=" "+Date.prototype.toUTCString.call(se)),Ge(se)&&(Et=" "+L(se)),it.length===0&&(!Yt||se.length==0))return In[0]+Et+In[1];if(me<0)return Ne(se)?B.stylize(RegExp.prototype.toString.call(se),"regexp"):B.stylize("[Object]","special");B.seen.push(se);var nn;return Yt?nn=O(B,se,me,tt,it):nn=it.map(function(Nt){return D(B,se,me,tt,Nt,Yt)}),B.seen.pop(),F(nn,Et,In)}function N(B,se){if(oe(se))return B.stylize("undefined","undefined");if(ee(se)){var me="'"+JSON.stringify(se).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize(me,"string")}if(ne(se))return B.stylize(""+se,"number");if(G(se))return B.stylize(""+se,"boolean");if(W(se))return B.stylize("null","null")}function L(B){return"["+Error.prototype.toString.call(B)+"]"}function O(B,se,me,qe,gt){for(var it=[],tt=0,lt=se.length;tt<lt;++tt)Te(se,String(tt))?it.push(D(B,se,me,qe,String(tt),!0)):it.push("");return gt.forEach(function(Et){Et.match(/^\d+$/)||it.push(D(B,se,me,qe,Et,!0))}),it}function D(B,se,me,qe,gt,it){var tt,lt,Et;if(Et=Object.getOwnPropertyDescriptor(se,gt)||{value:se[gt]},Et.get?Et.set?lt=B.stylize("[Getter/Setter]","special"):lt=B.stylize("[Getter]","special"):Et.set&&(lt=B.stylize("[Setter]","special")),Te(qe,gt)||(tt="["+gt+"]"),lt||(B.seen.indexOf(Et.value)<0?(W(me)?lt=_(B,Et.value,null):lt=_(B,Et.value,me-1),lt.indexOf(`
|
|
200
200
|
`)>-1&&(it?lt=lt.split(`
|
|
201
201
|
`).map(function(Yt){return" "+Yt}).join(`
|
|
202
202
|
`).slice(2):lt=`
|
|
@@ -209,4 +209,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
209
209
|
`),y=`
|
|
210
210
|
`+o+(p.length?c("│"):" ")+" ";return o+f.join(y)+`
|
|
211
211
|
`+p.map(function(b,C){var _=C===p.length-1,N=b.nodes&&b.nodes.length,L=o+(_?" ":c("│"))+" ";return o+c(_?"└":"├")+c("─")+c(N?"┬":"─")+" "+n(b,L,l).slice(o.length+2)}).join("")};const Tee=vee,BS=Symbol("avvio.TimeTree.untrackNode"),Y5=Symbol("avvio.TimeTree.trackNode"),$S=Symbol("avvio.TimeTree.getParent"),zS=Symbol("avvio.TimeTree.getNode"),HS=Symbol("avvio.TimeTree.addNode");let bee=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Y5](n){this.tableId.set(n.id,n),this.tableLabel.has(n.label)?this.tableLabel.get(n.label).push(n):this.tableLabel.set(n.label,[n])}[BS](n){this.tableId.delete(n.id);const a=this.tableLabel.get(n.label);if(a.id){this.tableLabel.delete(n.label);return}a.pop(),a.length===0&&this.tableLabel.delete(n.label)}[$S](n){if(n===null)return this.root;const a=this.tableLabel.get(n);return a.id?a:a[a.length-1]}[zS](n){return this.tableId.get(n)}[HS](n,a,o){if(n===null)return this.root={id:"root",label:a,start:o,nodes:[]},this[Y5](this.root),this.root.id;const l=this[$S](n),c=`${a}-${Math.random()}`,p={id:c,parent:n,start:o,label:a,nodes:[]};return l.nodes.push(p),this[Y5](p),c}start(n,a,o=Date.now()){return this[HS](n,a,o)}stop(n,a=Date.now()){const o=this[zS](n);o&&(o.stop=a,o.diff=o.stop-o.start||0,this[BS](o))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const n=o=>(o.label=`${o.label} ${o.diff} ms`,o.nodes.length>0&&(o.nodes=o.nodes.map(l=>n(l))),o),a=n(this.toJSON());return Tee(a)}};var kee=bee,Ey={exports:{}},M9={exports:{}},K5,GS;function See(){if(GS)return K5;GS=1;var n=1e3,a=n*60,o=a*60,l=o*24,c=l*7,p=l*365.25;K5=function(_,N){N=N||{};var L=typeof _;if(L==="string"&&_.length>0)return f(_);if(L==="number"&&isFinite(_))return N.long?b(_):y(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function f(_){if(_=String(_),!(_.length>100)){var N=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(N){var L=parseFloat(N[1]),O=(N[2]||"ms").toLowerCase();switch(O){case"years":case"year":case"yrs":case"yr":case"y":return L*p;case"weeks":case"week":case"w":return L*c;case"days":case"day":case"d":return L*l;case"hours":case"hour":case"hrs":case"hr":case"h":return L*o;case"minutes":case"minute":case"mins":case"min":case"m":return L*a;case"seconds":case"second":case"secs":case"sec":case"s":return L*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return L;default:return}}}}function y(_){var N=Math.abs(_);return N>=l?Math.round(_/l)+"d":N>=o?Math.round(_/o)+"h":N>=a?Math.round(_/a)+"m":N>=n?Math.round(_/n)+"s":_+"ms"}function b(_){var N=Math.abs(_);return N>=l?C(_,N,l,"day"):N>=o?C(_,N,o,"hour"):N>=a?C(_,N,a,"minute"):N>=n?C(_,N,n,"second"):_+" ms"}function C(_,N,L,O){var D=N>=L*1.5;return Math.round(_/L)+" "+O+(D?"s":"")}return K5}function wee(n){o.debug=o,o.default=o,o.coerce=b,o.disable=p,o.enable=c,o.enabled=f,o.humanize=See(),o.destroy=C,Object.keys(n).forEach(_=>{o[_]=n[_]}),o.names=[],o.skips=[],o.formatters={};function a(_){let N=0;for(let L=0;L<_.length;L++)N=(N<<5)-N+_.charCodeAt(L),N|=0;return o.colors[Math.abs(N)%o.colors.length]}o.selectColor=a;function o(_){let N,L=null,O,D;function F(...V){if(!F.enabled)return;const G=F,W=Number(new Date),Z=W-(N||W);G.diff=Z,G.prev=N,G.curr=W,N=W,V[0]=o.coerce(V[0]),typeof V[0]!="string"&&V.unshift("%O");let ne=0;V[0]=V[0].replace(/%([a-zA-Z%])/g,(ee,ue)=>{if(ee==="%%")return"%";ne++;const oe=o.formatters[ue];if(typeof oe=="function"){const Ne=V[ne];ee=oe.call(G,Ne),V.splice(ne,1),ne--}return ee}),o.formatArgs.call(G,V),(G.log||o.log).apply(G,V)}return F.namespace=_,F.useColors=o.useColors(),F.color=o.selectColor(_),F.extend=l,F.destroy=o.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>L!==null?L:(O!==o.namespaces&&(O=o.namespaces,D=o.enabled(_)),D),set:V=>{L=V}}),typeof o.init=="function"&&o.init(F),F}function l(_,N){const L=o(this.namespace+(typeof N>"u"?":":N)+_);return L.log=this.log,L}function c(_){o.save(_),o.namespaces=_,o.names=[],o.skips=[];let N;const L=(typeof _=="string"?_:"").split(/[\s,]+/),O=L.length;for(N=0;N<O;N++)L[N]&&(_=L[N].replace(/\*/g,".*?"),_[0]==="-"?o.skips.push(new RegExp("^"+_.slice(1)+"$")):o.names.push(new RegExp("^"+_+"$")))}function p(){const _=[...o.names.map(y),...o.skips.map(y).map(N=>"-"+N)].join(",");return o.enable(""),_}function f(_){if(_[_.length-1]==="*")return!0;let N,L;for(N=0,L=o.skips.length;N<L;N++)if(o.skips[N].test(_))return!1;for(N=0,L=o.names.length;N<L;N++)if(o.names[N].test(_))return!0;return!1}function y(_){return _.toString().substring(2,_.toString().length-2).replace(/\.\*\?$/,"*")}function b(_){return _ instanceof Error?_.stack||_.message:_}function C(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}var Cee=wee;(function(n,a){a.formatArgs=l,a.save=c,a.load=p,a.useColors=o,a.storage=f(),a.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function o(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;b.splice(1,0,C,"color: inherit");let _=0,N=0;b[0].replace(/%[a-zA-Z%]/g,L=>{L!=="%%"&&(_++,L==="%c"&&(N=_))}),b.splice(N,0,C)}a.log=console.debug||console.log||(()=>{});function c(b){try{b?a.storage.setItem("debug",b):a.storage.removeItem("debug")}catch{}}function p(){let b;try{b=a.storage.getItem("debug")}catch{}return!b&&typeof St<"u"&&"env"in St&&(b=St.env.DEBUG),b}function f(){try{return localStorage}catch{}}n.exports=Cee(a);const{formatters:y}=n.exports;y.j=function(b){try{return JSON.stringify(b)}catch(C){return"[UnexpectedJSONParseError]: "+C.message}}})(M9,M9.exports);var UE=M9.exports;const Eee=cE,_ee=TE.EventEmitter,Iee=x6.inherits,Da=UE("avvio"),{AVV_ERR_READY_TIMEOUT:Nee}=DE,Z5=Symbol.for("plugin-meta");function Ree(n,a){return n[Z5]&&n[Z5].name?n[Z5].name:typeof a<"u"&&typeof a!="function"&&a.name?a.name:n.name?n.name:n.toString().split(`
|
|
212
|
-
`).slice(0,2).map(o=>o.trim()).join(" -- ")}function Lee(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function _m(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Ree(a,o),this.isAfter=l,this.q=Eee(n,Oee,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Iee(_m,_ee);_m.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Da("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Da("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Da("exec",c);let p;const f=b=>{if(l){Da("loading complete",c);return}this._error=b,Da(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Da("setting up timeout",c,this.timeout),p=setTimeout(function(){Da("timed out",c),p=null;const b=new Nee(c);b.fn=o,f(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,f);y&&typeof y.then=="function"&&(Da("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};_m.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Da("rejecting promise",this.name,o),this._promise.reject(o)):(Da("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Lee(),a=this._promise.promise,this.server?n():this.on("start",n)),a};_m.prototype.enqueue=function(n,a){Da("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};_m.prototype.finish=function(n,a){Da("finish",this.name,n);const o=()=>{this.loaded||(Da("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Da("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Da("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Da("delayed",this.name),this.q.drain=()=>{Da("drain",this.name),this.q.drain=xee,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Oee(n,a){const o=this;St.nextTick(_y.bind(o),n,a)}function _y(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,_y.call(this,n,a)},a);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),a(c)})})}function xee(){}Ey.exports=_m;Ey.exports.loadPlugin=_y;var Aee=Ey.exports;const qS=cE,Pee=TE.EventEmitter,Mee=x6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:X5,AVV_ERR_CALLBACK_NOT_FN:i2,AVV_ERR_PLUGIN_NOT_VALID:Dee,AVV_ERR_ROOT_PLG_BOOTED:Uee,AVV_ERR_READY_TIMEOUT:Fee}=DE,Vee=kee,D9=Aee,Tm=UE("avvio"),b6=Symbol("kAvvio"),J5=Symbol("kThenifyDoNotWrap");function jee(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new X5(c);if(n[p])throw new X5(p);if(n[f])throw new X5(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:FE.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(e9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new i2(f,typeof C);return o.ready(C?e9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new i2(y,typeof C);return o.onClose(Gee(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new i2(b,typeof C);return C?(o.close(e9(C,this)),this):o.close()}}function ka(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof ka)){const l=new ka(n,a,o);return n&&jee(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new Vee,this._readyQ=qS(this,VE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=WS},this._closeQ=qS(this,Hee,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=WS},this._doStart=null,this._root=new D9(this,Bee.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),D9.loadPlugin.call(this,this._root,l=>{Tm("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Bee(n,a,o){this._doStart=o,a.autostart&&this.start()}Mee(ka,Pee);ka.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};ka.prototype.override=function(n,a,o){return n};function $ee(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new Dee(typeof n);return n}ka.prototype[b6]=!0;ka.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};ka.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(ka.prototype,"then",{get:FE});ka.prototype._addPlugin=function(n,a,o){if(n=$ee(n),a=a||{},this.booted)throw new Uee;const l=this._current[0],c=new D9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};ka.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){VE.call(this,n,c)}return this};ka.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};ka.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new i2("close",typeof n)}else a=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),a};ka.prototype.ready=function(n){if(n){if(typeof n!="function")throw new i2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};ka.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ka.prototype.toJSON=function(){return this.pluginTree.toJSON()};function WS(){}function FE(){if(this.booted){Tm("thenify returning null because we are already booted");return}if(this[J5]){this[J5]=!1;return}return Tm("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[J5]=!0,n(this._server)),a)}function VE(n,a){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else zee.call(this,n,l,o,a)}function zee(n,a,o,l){const c=n.name;Tm("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{Tm("timed out",c),p=null;const y=new Fee(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Hee(n,a){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(Tm("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function Gee(n,a){return o.bind(a);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function e9(n,a){return o.bind(a);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}py.exports=ka;py.exports.express=function(n){return ka(n,{expose:{use:"load"}})};var qee=py.exports;const Wee=kX(qee);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function Qee(n,a=!0,o=!0,l){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Wee(Object.create({}),{autostart:!1});return f.use(ZZ),f.use(qZ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(KZ,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(fZ,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(vZ),f.use(YZ),f.use(cX),f.use(DZ),f.use(bX),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const Yee=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p})=>{const[f,y]=Q.useState(null);return Q.useEffect(()=>{let b=!1;if(!n)return console.error("streamlayer sdk key should be provided"),y(_=>(_!==null&&typeof _.disableApp=="function"&&_.disableApp(),null)),()=>{b=!0};const C=Qee(n,o,l,{version:"1.1.6",onDeepLinkHandled:c,videoPlayerController:p});if(a)for(const _ of a)C.use(_);return C.ready().then(_=>{b||(y(_.sdk),typeof window<"u")}).catch(_=>console.log(_)),()=>{b=!0,C.close(function(_){if(_)throw _})}},[n,o]),f};var jE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(jE||{});const Iy=Q.createContext({status:0,sdk:null}),Kee=({sdkKey:n,plugins:a,children:o,production:l=!0,autoEnable:c=!0,onDeepLinkHandled:p,videoPlayerController:f})=>{const y=Yee({sdkKey:n,plugins:a,production:l,autoEnable:c,onDeepLinkHandled:p,videoPlayerController:f}),b=Q.useMemo(()=>y?{sdk:y,status:2}:{status:1,sdk:null},[y]);return Q.useEffect(()=>()=>{p&&(y==null||y.removeDeepLinkHandler(p)),f&&(y==null||y.removeVideoPlayerController(f))},[y]),Q.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!p,videoPlayerController:!!f})},[n,p,f]),w.jsx(Iy.Provider,{value:b,children:o})},BE=()=>{const{sdk:n}=Q.useContext(Iy);return n},Zee=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(Kee,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),Xee=({children:n,overlays:a})=>{const{sdk:o,status:l}=Q.useContext(Iy);return l===jE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{style:{height:"100%"},children:w.jsx(jG,{sdk:o,overlays:a,children:n})})}):n({})};class Jee extends Q.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(Xee,{...this.props})}}const ete=({token:n,schema:a})=>{const o=BE();return Q.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n)},[n,a,o]),null},tte=()=>{const n=BE();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{children:w.jsx(KG,{sdk:n})})}):null};exports.C=kC;exports.C$1=XS;exports.C$2=w6;exports.M=iy;exports.MastersStreamLayerProvider=Zee;exports.MastersStreamLayerSDKReact=Jee;exports.O=ey;exports.S=EC;exports.StreamLayerLogin=ete;exports.StreamLayerSDKPoints=tte;exports.T=sy;exports.a=U9;exports.b=bC;exports.k=_C;exports.l=KS;exports.m=r2;exports.m$1=JS;exports.n=f2;exports.p=XG;exports.p$1=ZS;exports.styled_default=P;exports.useStore=Ut;exports.z=F$;
|
|
212
|
+
`).slice(0,2).map(o=>o.trim()).join(" -- ")}function Lee(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function _m(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Ree(a,o),this.isAfter=l,this.q=Eee(n,Oee,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Iee(_m,_ee);_m.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Da("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Da("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Da("exec",c);let p;const f=b=>{if(l){Da("loading complete",c);return}this._error=b,Da(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Da("setting up timeout",c,this.timeout),p=setTimeout(function(){Da("timed out",c),p=null;const b=new Nee(c);b.fn=o,f(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,f);y&&typeof y.then=="function"&&(Da("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};_m.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Da("rejecting promise",this.name,o),this._promise.reject(o)):(Da("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Lee(),a=this._promise.promise,this.server?n():this.on("start",n)),a};_m.prototype.enqueue=function(n,a){Da("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};_m.prototype.finish=function(n,a){Da("finish",this.name,n);const o=()=>{this.loaded||(Da("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Da("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Da("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Da("delayed",this.name),this.q.drain=()=>{Da("drain",this.name),this.q.drain=xee,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Oee(n,a){const o=this;St.nextTick(_y.bind(o),n,a)}function _y(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,_y.call(this,n,a)},a);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),a(c)})})}function xee(){}Ey.exports=_m;Ey.exports.loadPlugin=_y;var Aee=Ey.exports;const qS=cE,Pee=TE.EventEmitter,Mee=x6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:X5,AVV_ERR_CALLBACK_NOT_FN:i2,AVV_ERR_PLUGIN_NOT_VALID:Dee,AVV_ERR_ROOT_PLG_BOOTED:Uee,AVV_ERR_READY_TIMEOUT:Fee}=DE,Vee=kee,D9=Aee,Tm=UE("avvio"),b6=Symbol("kAvvio"),J5=Symbol("kThenifyDoNotWrap");function jee(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new X5(c);if(n[p])throw new X5(p);if(n[f])throw new X5(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:FE.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(e9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new i2(f,typeof C);return o.ready(C?e9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new i2(y,typeof C);return o.onClose(Gee(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new i2(b,typeof C);return C?(o.close(e9(C,this)),this):o.close()}}function ka(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof ka)){const l=new ka(n,a,o);return n&&jee(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new Vee,this._readyQ=qS(this,VE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=WS},this._closeQ=qS(this,Hee,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=WS},this._doStart=null,this._root=new D9(this,Bee.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),D9.loadPlugin.call(this,this._root,l=>{Tm("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Bee(n,a,o){this._doStart=o,a.autostart&&this.start()}Mee(ka,Pee);ka.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};ka.prototype.override=function(n,a,o){return n};function $ee(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new Dee(typeof n);return n}ka.prototype[b6]=!0;ka.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};ka.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(ka.prototype,"then",{get:FE});ka.prototype._addPlugin=function(n,a,o){if(n=$ee(n),a=a||{},this.booted)throw new Uee;const l=this._current[0],c=new D9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};ka.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){VE.call(this,n,c)}return this};ka.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};ka.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new i2("close",typeof n)}else a=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),a};ka.prototype.ready=function(n){if(n){if(typeof n!="function")throw new i2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};ka.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ka.prototype.toJSON=function(){return this.pluginTree.toJSON()};function WS(){}function FE(){if(this.booted){Tm("thenify returning null because we are already booted");return}if(this[J5]){this[J5]=!1;return}return Tm("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[J5]=!0,n(this._server)),a)}function VE(n,a){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else zee.call(this,n,l,o,a)}function zee(n,a,o,l){const c=n.name;Tm("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{Tm("timed out",c),p=null;const y=new Fee(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Hee(n,a){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(Tm("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function Gee(n,a){return o.bind(a);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function e9(n,a){return o.bind(a);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}py.exports=ka;py.exports.express=function(n){return ka(n,{expose:{use:"load"}})};var qee=py.exports;const Wee=kX(qee);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function Qee(n,a=!0,o=!0,l){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Wee(Object.create({}),{autostart:!1});return f.use(ZZ),f.use(qZ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(KZ,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(fZ,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(vZ),f.use(YZ),f.use(cX),f.use(DZ),f.use(bX),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const Yee=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p})=>{const[f,y]=Q.useState(null);return Q.useEffect(()=>{let b=!1;if(!n)return console.error("streamlayer sdk key should be provided"),y(_=>(_!==null&&typeof _.disableApp=="function"&&_.disableApp(),null)),()=>{b=!0};const C=Qee(n,o,l,{version:"1.1.7",onDeepLinkHandled:c,videoPlayerController:p});if(a)for(const _ of a)C.use(_);return C.ready().then(_=>{b||(y(_.sdk),typeof window<"u")}).catch(_=>console.log(_)),()=>{b=!0,C.close(function(_){if(_)throw _})}},[n,o]),f};var jE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(jE||{});const Iy=Q.createContext({status:0,sdk:null}),Kee=({sdkKey:n,plugins:a,children:o,production:l=!0,autoEnable:c=!0,onDeepLinkHandled:p,videoPlayerController:f})=>{const y=Yee({sdkKey:n,plugins:a,production:l,autoEnable:c,onDeepLinkHandled:p,videoPlayerController:f}),b=Q.useMemo(()=>y?{sdk:y,status:2}:{status:1,sdk:null},[y]);return Q.useEffect(()=>()=>{p&&(y==null||y.removeDeepLinkHandler(p)),f&&(y==null||y.removeVideoPlayerController(f))},[y]),Q.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!p,videoPlayerController:!!f})},[n,p,f]),w.jsx(Iy.Provider,{value:b,children:o})},BE=()=>{const{sdk:n}=Q.useContext(Iy);return n},Zee=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(Kee,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),Xee=({children:n,overlays:a})=>{const{sdk:o,status:l}=Q.useContext(Iy);return l===jE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{style:{height:"100%"},children:w.jsx(jG,{sdk:o,overlays:a,children:n})})}):n({})};class Jee extends Q.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(Xee,{...this.props})}}const ete=({token:n,schema:a})=>{const o=BE();return Q.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n)},[n,a,o]),null},tte=()=>{const n=BE();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{children:w.jsx(KG,{sdk:n})})}):null};exports.C=kC;exports.C$1=XS;exports.C$2=w6;exports.M=iy;exports.MastersStreamLayerProvider=Zee;exports.MastersStreamLayerSDKReact=Jee;exports.O=ey;exports.S=EC;exports.StreamLayerLogin=ete;exports.StreamLayerSDKPoints=tte;exports.T=sy;exports.a=U9;exports.b=bC;exports.k=_C;exports.l=KS;exports.m=r2;exports.m$1=JS;exports.n=f2;exports.p=XG;exports.p$1=ZS;exports.styled_default=P;exports.useStore=Ut;exports.z=F$;
|