@streamlayer/web-os 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -1174,10 +1174,10 @@ t.code===22||// Firefox
1174
1174
  t.code===1014||// test name field too, because code might not be present
1175
1175
  // everything except Firefox
1176
1176
  t.name==="QuotaExceededError"||// Firefox
1177
- t.name==="NS_ERROR_DOM_QUOTA_REACHED");}var tW=/*#__PURE__*/_createClass(function tW(){var _this133=this;var _e28=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"main";var _n22=arguments.length>1&&arguments[1]!==undefined?arguments[1]:window.localStorage;_classCallCheck(this,tW);_defineProperty(this,"delimiter",":");_defineProperty(this,"prefix",void 0);_defineProperty(this,"storage",void 0);_defineProperty(this,"clear",function(){for(var e in window.localStorage)e.startsWith(_this133.prefix)&&_this133.storage.removeItem(e);});_defineProperty(this,"generateKey",function(e){return "".concat(_this133.prefix).concat(_this133.delimiter).concat(e.join(_this133.delimiter));});_defineProperty(this,"write",function(){for(var _len16=arguments.length,e=new Array(_len16),_key16=0;_key16<_len16;_key16++){e[_key16]=arguments[_key16];}var n=e.pop()||"",i=_this133.generateKey(e);try{_this133.storage.setItem(i,n);}catch(s){eW(s)&&_this133.storage===window.sessionStorage&&(window.sessionStorage.removeItem("slstreamlogs"),_this133.storage.setItem(i,n));}});_defineProperty(this,"read",function(){for(var _len17=arguments.length,e=new Array(_len17),_key17=0;_key17<_len17;_key17++){e[_key17]=arguments[_key17];}var n=_this133.storage.getItem(_this133.generateKey(e));return n===null?void 0:n;});_defineProperty(this,"remove",function(){for(var _len18=arguments.length,e=new Array(_len18),_key18=0;_key18<_len18;_key18++){e[_key18]=arguments[_key18];}_this133.storage.removeItem(_this133.generateKey(e));});this.prefix="sl-sdk".concat(this.delimiter).concat(_e28),this.storage=_n22;});var _u;(function(t){t.OPENED="opened";})(_u||(_u={}));var nW=/* @__PURE__ */V("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:false}),oW=function oW(){return oe;},lW=/* @__PURE__ */V(oW())({name:"QuestionTypeIcon",class:"qmg0vkx",propsAsIs:true}),aW=/* @__PURE__ */V("div")({name:"QuestionTypeLabel",class:"q1uz5j1g",propsAsIs:false});rn.LOST+"",rn.WON+"",rn.UNSET+"",rn.DNP+"";var cW=function cW(_ref223){var t=_ref223.questionTypeData,e=_ref223.questionType,n=_ref223.questionStatus;return/* @__PURE__ */jsxRuntime.jsxs(nW,{className:"SL_QuestionCaption",children:[/* @__PURE__ */jsxRuntime.jsx(lW,{className:"SL_QuestionTypeIcon","data-testid":"question-type-icon","data-type-trivia":e===M.TRIVIA,"data-type-poll":e===M.POLL,name:t.iconName}),/* @__PURE__ */jsxRuntime.jsxs(aW,{className:"SL_QuestionTypeLabel",children:[t.label,e===M.TRIVIA&&n===Ze$1.RESOLVED&&" • Expired"]})]});},hW=function hW(){return function(_ref224){var t=_ref224.color;return t||"transparent";};},ju=/* @__PURE__ */V("div")({name:"MediaComponentWrap",class:"mek728j",propsAsIs:false,vars:{"mek728j-0":[hW()]}}),Gn=/* @__PURE__ */V("div")({name:"Media",class:"m461t56",propsAsIs:false}),uW=function uW(){return Gn;},dW=/* @__PURE__ */V(uW())({name:"MediaImgBottom",class:"m22bh04",propsAsIs:true}),mW=function mW(){return Gn;},pW=/* @__PURE__ */V(mW())({name:"MediaVideo",class:"m17u1e34",propsAsIs:true}),gW=function gW(){return Gn;},fW=/* @__PURE__ */V(gW())({name:"MediaImgContentMedia",class:"m4j3eds",propsAsIs:true}),bW=function bW(){return Gn;},AW=/* @__PURE__ */V(bW())({name:"MediaImgSolid",class:"m1lp3swr",propsAsIs:true}),VW=function VW(){return Gn;},RW=/* @__PURE__ */V(VW())({name:"MediaImgRounded",class:"mc7lij",propsAsIs:true}),EW=function EW(){return Gn;},yW=/* @__PURE__ */V(EW())({name:"MediaImgCentered",class:"mwwaw7o",propsAsIs:true}),CW=function CW(){return Gn;},Wl=/* @__PURE__ */V(CW())({name:"MediaNone",class:"mqfzyyr",propsAsIs:true}),WW="v170mtgf",SW=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},ke$1.UNSET,Wl),ke$1.NONE,Wl),ke$1.ROUNDED,RW),ke$1.CENTERED,yW),ke$1.TRANSPARENT,dW),ke$1.SOLID,AW),$u=function $u(_ref225){var t=_ref225.src,_ref225$imageMode=_ref225.imageMode,e=_ref225$imageMode===void 0?ke$1.UNSET:_ref225$imageMode,n=_ref225.withVideo,i=_ref225.color,s=_ref225.useContentMedia,r=_ref225.thumbnailUrl;if(!t)return/* @__PURE__ */jsxRuntime.jsx(ju,{color:i,children:/* @__PURE__ */jsxRuntime.jsx(Wl,{})});var o=s===sl.ENABLED?fW:SW[e];return/* @__PURE__ */jsxRuntime.jsx(ju,{color:i,children:n?/* @__PURE__ */jsxRuntime.jsx(pW,{children:/* @__PURE__ */jsxRuntime.jsx(Hi,{className:WW,source:t,poster:r||""})}):/* @__PURE__ */jsxRuntime.jsx(o,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:t,alt:""})})});},ZW=function ZW(){return function(_ref226){var t=_ref226.withoutPadding;return t?"0px":"1rem";};},q2=/* @__PURE__ */V("div")({name:"NotificationContent",class:"n1p3bk1c",propsAsIs:false,vars:{"n1p3bk1c-0":[ZW()]}}),IW=/* @__PURE__ */V("div")({name:"MainContent",class:"m1g211mu",propsAsIs:false}),vW=function vW(){return oe;},NW=/* @__PURE__ */V(vW())({name:"StyledChevronRight",class:"sx1hq4c",propsAsIs:true}),e3=/* @__PURE__ */V("div")({name:"NotificationContainer",class:"n1fcriet",propsAsIs:false}),FW=function FW(){return function(_ref227){var t=_ref227.questionType;return t===M.FACTOID?"7.3rem":"4.5rem";};},GW=function GW(){return function(_ref228){var t=_ref228.webos;return t?"11px 0px 8px 0px":"11px 0px";};},XW=function XW(){return function(_ref229){var t=_ref229.imageMode,e=_ref229.webos;return e?"330px":t===ke$1.SOLID?"310px":t===ke$1.CENTERED||t===ke$1.ROUNDED||t===ke$1.TRANSPARENT?"370px":"430px";};},UW=/* @__PURE__ */V("div")({name:"Body",class:"b1byyovs",propsAsIs:false,vars:{"b1byyovs-0":[FW()],"b1byyovs-1":[GW()],"b1byyovs-2":[XW()]}}),wW=function wW(){return function(_ref230){var t=_ref230.webos;return t?"0.85rem":"1.033rem";};},BW=function BW(){return function(_ref231){var t=_ref231.webos;return t?"0.95rem":"1.25rem";};},YW=function YW(){return function(_ref232){var t=_ref232.webos;return t?"4.7rem":"2.25rem";};},TW=function TW(){return function(_ref233){var t=_ref233.webos;return t?"pre-wrap":"nowrap";};},LW=/* @__PURE__ */V("div")({name:"Title",class:"t1y5k5id",propsAsIs:false,vars:{"t1y5k5id-0":[wW()],"t1y5k5id-1":[BW()],"t1y5k5id-2":[YW()],"t1y5k5id-3":[TW()]}}),kW=/* @__PURE__ */V("div")({name:"Description",class:"dw9eb7l",propsAsIs:false}),JW=/* @__PURE__ */V("div")({name:"LogoImgContainer",class:"ldu8wgy",propsAsIs:false}),t3=/* @__PURE__ */V("img")({name:"LogoImg",class:"ln4a3eh",propsAsIs:false}),xW=function xW(){return e3;},MW=/* @__PURE__ */V(xW())({name:"NotificationInterstitialContainer",class:"no2k63v",propsAsIs:true}),QW=/* @__PURE__ */V("div")({name:"TVButtons",class:"th9nn6a",propsAsIs:false}),n3=/* @__PURE__ */V("button")({name:"TVButton",class:"t1eee77p",propsAsIs:false}),zW=function zW(){return n3;},KW=/* @__PURE__ */V(zW())({name:"DismissButton",class:"ds000hw",propsAsIs:true}),HW=function HW(){return n3;},OW=/* @__PURE__ */V(HW())({name:"AnswerButton",class:"a1nz9hoe",propsAsIs:true}),DW=function DW(_ref234){var t=_ref234.title,e=_ref234.questionType,n=_ref234.questionTypeData,i=_ref234.description,s=_ref234.imageMode,r=_ref234.webos;return/* @__PURE__ */jsxRuntime.jsxs(UW,{imageMode:s,questionType:e,webos:r,children:[/* @__PURE__ */jsxRuntime.jsx(cW,{questionTypeData:n,questionType:e,questionStatus:Ze$1.UNSET}),t&&/* @__PURE__ */jsxRuntime.jsx(LW,{webos:r,children:t}),i&&/* @__PURE__ */jsxRuntime.jsx(kW,{children:i})]});},PW=ut(MW),_W=ut(KW),jW=ut(OW),$W=function $W(_ref235){var t=_ref235.className,e=_ref235.sponsorLogo,n=_ref235.onClick,i=_ref235.webos;return/* @__PURE__ */jsxRuntime.jsx(PW,{className:t,autoFocus:true,webos:i,onClick:n,"data-webos":i,children:/* @__PURE__ */jsxRuntime.jsx(q2,{withoutPadding:true,children:/* @__PURE__ */jsxRuntime.jsx(t3,{src:e})})});},qW=function qW(_ref236){var _s$video,_s$video2,_s$video3;var t=_ref236.action,e=_ref236.close,n=_ref236.questionType,i=_ref236.inApp,s=_ref236.insight,r=_ref236.color,o=_ref236.webos,l=_ref236.className;var _re71=y.useState(false),_re72=_slicedToArray(_re71,2),a=_re72[0],c=_re72[1],h=y.useRef();y.useEffect(function(){return i!==null&&i!==void 0&&i.sponsorLogo&&(c(true),h.current=setTimeout(function(){c(false);},5e3)),function(){return clearTimeout(h.current);};},[i===null||i===void 0?void 0:i.sponsorLogo]);var u=H2[n];if(!u||!i||!i.notification)return null;var _i$notification=i.notification,d=_i$notification.title,m=_i$notification.image,p=_i$notification.imageMode,g=_i$notification.useContentMedia,A=n===M.FACTOID?s===null||s===void 0?void 0:s.heading:d,b=n===M.FACTOID?s===null||s===void 0?void 0:s.body:"",R=m,S=n===M.FACTOID&&(s===null||s===void 0||(_s$video=s.video)===null||_s$video===void 0?void 0:_s$video.url)&&(i===null||i===void 0?void 0:i.isVideo)&&g===sl.ENABLED,E=g===sl.ENABLED?S?s===null||s===void 0||(_s$video2=s.video)===null||_s$video2===void 0?void 0:_s$video2.url:s===null||s===void 0?void 0:s.image:"";return i!==null&&i!==void 0&&i.sponsorLogo&&a?/* @__PURE__ */jsxRuntime.jsx($W,{className:l,sponsorLogo:i===null||i===void 0?void 0:i.sponsorLogo,webos:o,onClick:function onClick(){return c(false);}}):/* @__PURE__ */jsxRuntime.jsxs(e3,{"data-a":"intr",className:Oe("SL_InApp",l),onClick:function onClick(v){o||(t===null||t===void 0?void 0:t(v));},"data-is-insight":n===M.FACTOID,"data-webos":o,children:[(i===null||i===void 0?void 0:i.sponsorLogo)&&/* @__PURE__ */jsxRuntime.jsx(JW,{children:/* @__PURE__ */jsxRuntime.jsx(t3,{src:i===null||i===void 0?void 0:i.sponsorLogo})}),/* @__PURE__ */jsxRuntime.jsxs(q2,{children:[/* @__PURE__ */jsxRuntime.jsxs(IW,{children:[!E&&/* @__PURE__ */jsxRuntime.jsx($u,{src:R,imageMode:p,withVideo:!!S,color:r}),E&&/* @__PURE__ */jsxRuntime.jsx($u,{src:E,imageMode:p,withVideo:!!S,color:r,useContentMedia:g,thumbnailUrl:s===null||s===void 0||(_s$video3=s.video)===null||_s$video3===void 0?void 0:_s$video3.thumbnailUrl}),/* @__PURE__ */jsxRuntime.jsx(DW,{questionTypeData:u,questionType:n,title:A,description:b,imageMode:p,webos:o})]}),!o&&/* @__PURE__ */jsxRuntime.jsx(NW,{name:"chevronRight"}),o&&/* @__PURE__ */jsxRuntime.jsxs(QW,{children:[/* @__PURE__ */jsxRuntime.jsx(_W,{webos:true,"data-close-btn":"true",onClick:function onClick(v){v.stopPropagation(),e===null||e===void 0?void 0:e(v);},children:"Dismiss"}),/* @__PURE__ */jsxRuntime.jsx(jW,{webos:true,autoFocus:true,onClick:t,children:"Answer"})]})]})]});},eS=/* @__PURE__ */V("div")({name:"Container",class:"cef8huz",propsAsIs:false}),tS=function tS(){return oe;},nS=/* @__PURE__ */V(tS())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:true}),iS=function iS(){return oe;},sS=/* @__PURE__ */V(iS())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:true}),rS=/* @__PURE__ */V("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:false}),oS=/* @__PURE__ */V("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:false}),lS=/* @__PURE__ */V("div")({name:"Body",class:"barrbyu",propsAsIs:false}),aS=/* @__PURE__ */V("div")({name:"Subtitle",class:"sz7237i",propsAsIs:false}),cS=function cS(_ref237){var t=_ref237.step,e=_ref237.children,n=_ref237.answer,_ref237$state=_ref237.state,i=_ref237$state===void 0?"pending":_ref237$state;var _re73=y.useState(0),_re74=_slicedToArray(_re73,2),s=_re74[0],r=_re74[1],_re75=y.useState(function(){return new ResizeObserver(function(a){window.requestAnimationFrame(function(){var _a$0$contentRect$widt,_a$4;r((_a$0$contentRect$widt=a===null||a===void 0||(_a$4=a[0])===null||_a$4===void 0||(_a$4=_a$4.contentRect)===null||_a$4===void 0?void 0:_a$4.width)!==null&&_a$0$contentRect$widt!==void 0?_a$0$contentRect$widt:0);});});}),_re76=_slicedToArray(_re75,1),o=_re76[0],l=y.useCallback(function(a){a?o.observe(a):o.disconnect();},[o]);return y.useEffect(function(){return function(){o.disconnect();};},[o]),/* @__PURE__ */jsxRuntime.jsxs(eS,{children:[/* @__PURE__ */jsxRuntime.jsx(rS,{children:/* @__PURE__ */jsxRuntime.jsx(sS,{name:"icon-prediction"})}),/* @__PURE__ */jsxRuntime.jsx(oS,{style:{minWidth:"".concat(s,"px")},children:/* @__PURE__ */jsxRuntime.jsx(lS,{children:e},t)}),/* @__PURE__ */jsxRuntime.jsx(aS,{ref:l,className:i,children:/* @__PURE__ */jsxRuntime.jsxs("div",{children:[/* @__PURE__ */jsxRuntime.jsx(nS,{name:"icon-check"}),"Your Pick: ",n]})})]});},hS=/* @__PURE__ */V("div")({name:"Container",class:"ckyzolp",propsAsIs:false}),Ra=/* @__PURE__ */V("div")({name:"Line",class:"l16t1zr7",propsAsIs:false}),uS=function uS(){return Ra;},dS=/* @__PURE__ */V(uS())({name:"Line1",class:"le78kvg",propsAsIs:true}),mS=function mS(){return Ra;},pS=/* @__PURE__ */V(mS())({name:"Line2",class:"l1o7966d",propsAsIs:true}),gS=function gS(){return Ra;},fS=/* @__PURE__ */V(gS())({name:"Line3",class:"lu9lyxq",propsAsIs:true}),bS=function bS(){return/* @__PURE__ */jsxRuntime.jsxs(hS,{children:[/* @__PURE__ */jsxRuntime.jsx(dS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(pS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(fS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})})]});},AS=/* @__PURE__ */V("div")({name:"Container",class:"c10jy6zf",propsAsIs:false}),VS=function VS(){return oe;},RS=/* @__PURE__ */V(VS())({name:"CheckIcon",class:"c1c7scay",propsAsIs:true}),ES=function ES(){return/* @__PURE__ */jsxRuntime.jsxs(AS,{children:[/* @__PURE__ */jsxRuntime.jsx(RS,{name:"icon-check"})," Prediction results are in!"]});},yS=/* @__PURE__ */V("div")({name:"Container",class:"cf6k2yy",propsAsIs:false}),CS=/* @__PURE__ */V("div")({name:"Caption",class:"c1c8xjus",propsAsIs:false}),WS=/* @__PURE__ */V("div")({name:"Title",class:"t1d1uekn",propsAsIs:false}),SS=function SS(_ref238){var t=_ref238.title;return/* @__PURE__ */jsxRuntime.jsxs(yS,{children:[/* @__PURE__ */jsxRuntime.jsx(CS,{children:"Results for"}),/* @__PURE__ */jsxRuntime.jsx(WS,{children:t})]});},i3=/* @__PURE__ */V("div")({name:"Container",class:"c181a1as",propsAsIs:false}),s3=/* @__PURE__ */V("div")({name:"Title",class:"t1cduox6",propsAsIs:false}),ZS=function ZS(){return oe;},r3=/* @__PURE__ */V(ZS())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:true}),IS=function IS(){return r3;},vS=/* @__PURE__ */V(IS())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:true}),NS=function NS(){return/* @__PURE__ */jsxRuntime.jsxs(i3,{children:[/* @__PURE__ */jsxRuntime.jsxs(s3,{children:["Congratulations!",/* @__PURE__ */jsxRuntime.jsx("br",{}),"You answered correctly."]}),/* @__PURE__ */jsxRuntime.jsx(r3,{name:"icon-check"})]});},FS=function FS(_ref239){var t=_ref239.title;return/* @__PURE__ */jsxRuntime.jsxs(i3,{children:[/* @__PURE__ */jsxRuntime.jsxs(s3,{children:["Better luck next time!",/* @__PURE__ */jsxRuntime.jsx("br",{}),"Correct: ",t]}),/* @__PURE__ */jsxRuntime.jsx(vS,{name:"icon-cross"})]});},GS=/* @__PURE__ */V("div")({name:"Container",class:"cnxgcs2",propsAsIs:false}),XS=/* @__PURE__ */V("div")({name:"Title",class:"t903f8n",propsAsIs:false}),US=function US(){return oe;},wS=/* @__PURE__ */V(US())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:true}),BS=function BS(_ref240){var t=_ref240.points;return/* @__PURE__ */jsxRuntime.jsxs(GS,{children:[/* @__PURE__ */jsxRuntime.jsxs(XS,{children:["You won ",/* @__PURE__ */jsxRuntime.jsx(Va,{delay:0.5,prefix:"+",suffix:" points",value:t})]}),/* @__PURE__ */jsxRuntime.jsx(wS,{name:"icon-trophy-solid"})]});},qu=/* @__PURE__ */V("div")({name:"Container",class:"cq3agu2",propsAsIs:false}),ed=/* @__PURE__ */V("div")({name:"Body",class:"b16qj0do",propsAsIs:false}),td={1:3e3,2:4e3,3:4e3,4:4e3},YS=function YS(_ref241){var t=_ref241.close,e=_ref241.action,n=_ref241.setStep,i=_ref241.votedAnswer,s=_ref241.correct,r=_ref241.correctAnswerTitle,o=_ref241.questionTitle,l=_ref241.step;if(y.useEffect(function(){if(n){var _c38=setTimeout(function(){td[l+1]&&(s||l<3)?n(l+1):t===null||t===void 0?void 0:t();},td[l]);return function(){_c38&&clearTimeout(_c38);};}return function(){};},[n,l,t,s]),l===1)return/* @__PURE__ */jsxRuntime.jsx(qu,{children:/* @__PURE__ */jsxRuntime.jsx(ed,{children:/* @__PURE__ */jsxRuntime.jsx(ES,{})})});var a="pending";return (l===3||l===4)&&(a=s?"correct":"incorrect"),/* @__PURE__ */jsxRuntime.jsx(qu,{"data-a":"intr",onClick:function onClick(){return e===null||e===void 0?void 0:e();},children:/* @__PURE__ */jsxRuntime.jsxs(ed,{children:[l!==1&&/* @__PURE__ */jsxRuntime.jsx(bS,{},l),/* @__PURE__ */jsxRuntime.jsxs(cS,{state:a,step:l,answer:(i===null||i===void 0?void 0:i.title)||"unknown",children:[l===2&&/* @__PURE__ */jsxRuntime.jsx(SS,{title:o||"unknown"}),l===3&&s&&/* @__PURE__ */jsxRuntime.jsx(NS,{}),l===3&&!s&&/* @__PURE__ */jsxRuntime.jsx(FS,{title:r||"unknown"}),l===4&&/* @__PURE__ */jsxRuntime.jsx(BS,{points:(i===null||i===void 0?void 0:i.points)||0})]})]})});},TS=function TS(_ref242){var t=_ref242.close,e=_ref242.action,n=_ref242.votedAnswer,i=_ref242.correct,s=_ref242.correctAnswerTitle,r=_ref242.questionTitle;var _re77=y.useState(1),_re78=_slicedToArray(_re77,2),o=_re78[0],l=_re78[1];return/* @__PURE__ */jsxRuntime.jsx(YS,{close:t,action:e,votedAnswer:n,correct:i,correctAnswerTitle:s,questionTitle:r,setStep:l,step:o,title:""});},LS=/* @__PURE__ */V("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:false}),kS=function kS(_ref243){var t=_ref243.className,e=_objectWithoutProperties(_ref243,_excluded13);return/* @__PURE__ */jsxRuntime.jsx(LS,{className:t,children:/* @__PURE__ */jsxRuntime.jsx(TS,_objectSpread2({},e))});},JS=/* @__PURE__ */V("div")({name:"Container",class:"cwa9tgs",propsAsIs:false}),xS=/* @__PURE__ */V("div")({name:"BodyContainer",class:"b1xx7swj",propsAsIs:false}),MS=/* @__PURE__ */V("div")({name:"Body",class:"b1a21en",propsAsIs:false}),QS=function QS(_ref244){var t=_ref244.step,e=_ref244.children,_ref244$state=_ref244.state,n=_ref244$state===void 0?"pending":_ref244$state;var _re79=y.useState(0),_re80=_slicedToArray(_re79,2),i=_re80[0],s=_re80[1];return y.useEffect(function(){var r=new ResizeObserver(function(o){window.requestAnimationFrame(function(){var _o$0$contentRect$widt,_o$;var l=(_o$0$contentRect$widt=o===null||o===void 0||(_o$=o[0])===null||_o$===void 0||(_o$=_o$.contentRect)===null||_o$===void 0?void 0:_o$.width)!==null&&_o$0$contentRect$widt!==void 0?_o$0$contentRect$widt:0;s(l);});});return function(){r.disconnect();};},[]),/* @__PURE__ */jsxRuntime.jsx(JS,{style:{padding:"".concat(t===3&&n==="incorrect"||t===1?"5px 100px":"5px 40px")},children:/* @__PURE__ */jsxRuntime.jsx(xS,{style:{minWidth:"".concat(i,"px")},children:/* @__PURE__ */jsxRuntime.jsx(MS,{children:e},t)})});},zS=/* @__PURE__ */V("div")({name:"Container",class:"c1nd5cu8",propsAsIs:false}),Ea=/* @__PURE__ */V("div")({name:"Line",class:"lgbipw0",propsAsIs:false}),KS=function KS(){return Ea;},HS=/* @__PURE__ */V(KS())({name:"Line1",class:"l1anth16",propsAsIs:true}),OS=function OS(){return Ea;},DS=/* @__PURE__ */V(OS())({name:"Line2",class:"l193yd7v",propsAsIs:true}),PS=function PS(){return Ea;},_S=/* @__PURE__ */V(PS())({name:"Line3",class:"lhbflsp",propsAsIs:true}),jS=function jS(){return/* @__PURE__ */jsxRuntime.jsxs(zS,{children:[/* @__PURE__ */jsxRuntime.jsx(HS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(DS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(_S,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})})]});},$S=/* @__PURE__ */V("div")({name:"Container",class:"c1lvd429",propsAsIs:false}),qS=function qS(){return oe;},eZ=/* @__PURE__ */V(qS())({name:"PredictionIcon",class:"p1n4m87t",propsAsIs:true}),tZ=function tZ(){return/* @__PURE__ */jsxRuntime.jsxs($S,{children:[/* @__PURE__ */jsxRuntime.jsx(eZ,{name:"icon-prediction"})," Prediction results are in!"]});},nZ=function nZ(){return oe;},iZ=/* @__PURE__ */V(nZ())({name:"CheckIcon",class:"c126r8f9",propsAsIs:true}),sZ=/* @__PURE__ */V("div")({name:"Answer",class:"a1o2rpgl",propsAsIs:false}),rZ=/* @__PURE__ */V("div")({name:"Container",class:"cej6ci1",propsAsIs:false}),oZ=/* @__PURE__ */V("div")({name:"Title",class:"tob24mr",propsAsIs:false}),lZ=function lZ(_ref245){var t=_ref245.title,e=_ref245.answer;return/* @__PURE__ */jsxRuntime.jsxs(rZ,{children:[/* @__PURE__ */jsxRuntime.jsx(oZ,{children:t}),/* @__PURE__ */jsxRuntime.jsxs(sZ,{children:[/* @__PURE__ */jsxRuntime.jsx(iZ,{name:"icon-prediction"}),"Your Pick: ",e]})]});},o3=/* @__PURE__ */V("div")({name:"Container",class:"c1lesal4",propsAsIs:false}),l3=/* @__PURE__ */V("div")({name:"Title",class:"tv66n4w",propsAsIs:false}),aZ=function aZ(){return oe;},cZ=/* @__PURE__ */V(aZ())({name:"CorrectIcon",class:"cx0vlv2",propsAsIs:true}),a3=/* @__PURE__ */V("div")({name:"Answer",class:"akfh4v5",propsAsIs:false}),hZ=function hZ(_ref246){var t=_ref246.answer;return/* @__PURE__ */jsxRuntime.jsxs(o3,{children:[/* @__PURE__ */jsxRuntime.jsx(l3,{children:"Congratulations! You answered correctly."}),/* @__PURE__ */jsxRuntime.jsxs(a3,{children:[/* @__PURE__ */jsxRuntime.jsx(cZ,{name:"icon-correct"}),"Your Pick: ",t]})]});},uZ=function uZ(_ref247){var t=_ref247.title,e=_ref247.answer;return/* @__PURE__ */jsxRuntime.jsxs(o3,{children:[/* @__PURE__ */jsxRuntime.jsxs(l3,{children:["Better luck next time!",/* @__PURE__ */jsxRuntime.jsx("br",{}),"Correct: ",t]}),/* @__PURE__ */jsxRuntime.jsxs(a3,{children:["Your Pick: ",e]})]});},nd=/* @__PURE__ */V("div")({name:"Container",class:"cmox3ot",propsAsIs:false}),id=/* @__PURE__ */V("div")({name:"Body",class:"bqq1ix4",propsAsIs:false}),sd={1:3e3,2:4e3,3:4e3},dZ=function dZ(_ref248){var t=_ref248.close,e=_ref248.action,n=_ref248.setStep,i=_ref248.votedAnswer,s=_ref248.correct,r=_ref248.correctAnswerTitle,o=_ref248.questionTitle,l=_ref248.step;if(y.useEffect(function(){if(n){var _c39=setTimeout(function(){sd[l+1]&&(s||l<3)?n(l+1):t===null||t===void 0?void 0:t();},sd[l]);return function(){_c39&&clearTimeout(_c39);};}return function(){};},[n,l,t,s]),l===1)return/* @__PURE__ */jsxRuntime.jsx(nd,{children:/* @__PURE__ */jsxRuntime.jsx(id,{children:/* @__PURE__ */jsxRuntime.jsx(tZ,{})})});var a="pending";return l===3&&(a=s?"correct":"incorrect"),/* @__PURE__ */jsxRuntime.jsx(nd,{"data-a":"intr",onClick:function onClick(){return e===null||e===void 0?void 0:e();},children:/* @__PURE__ */jsxRuntime.jsxs(id,{children:[l!==1&&/* @__PURE__ */jsxRuntime.jsx(jS,{},l),/* @__PURE__ */jsxRuntime.jsxs(QS,{state:a,step:l,children:[l===2&&/* @__PURE__ */jsxRuntime.jsx(lZ,{title:o||"unknown",answer:(i===null||i===void 0?void 0:i.title)||"unknown"}),l===3&&s&&/* @__PURE__ */jsxRuntime.jsx(hZ,{answer:(i===null||i===void 0?void 0:i.title)||"unknown"}),l===3&&!s&&/* @__PURE__ */jsxRuntime.jsx(uZ,{title:r||"unknown",answer:(i===null||i===void 0?void 0:i.title)||"unknown"})]})]})});},mZ=function mZ(_ref249){var t=_ref249.close,e=_ref249.action,n=_ref249.votedAnswer,i=_ref249.correct,s=_ref249.correctAnswerTitle,r=_ref249.questionTitle;var _re81=y.useState(1),_re82=_slicedToArray(_re81,2),o=_re82[0],l=_re82[1];return/* @__PURE__ */jsxRuntime.jsx(dZ,{close:t,action:e,votedAnswer:n,correct:i,correctAnswerTitle:s,questionTitle:r,setStep:l,step:o,title:""});},c3=/* @__PURE__ */V("div")({name:"NotificationContainer",class:"nn0nqh6",propsAsIs:false}),pZ=function pZ(){return function(_ref250){var t=_ref250.withoutPadding;return t?"0px":"1rem";};},gZ=/* @__PURE__ */V("div")({name:"NotificationContent",class:"n1bcdf3j",propsAsIs:false,vars:{"n1bcdf3j-0":[pZ()]}}),h3=/* @__PURE__ */V("img")({name:"LogoImg",class:"l8jorbq",propsAsIs:false}),fZ=function fZ(){return c3;},bZ=/* @__PURE__ */V(fZ())({name:"NotificationInterstitialContainer",class:"nf920y3",propsAsIs:true}),AZ=/* @__PURE__ */V("div")({name:"LogoImgContainer",class:"lzsmehn",propsAsIs:false}),VZ=function VZ(_ref251){var t=_ref251.className,e=_ref251.sponsorLogo,n=_ref251.onClick;return/* @__PURE__ */jsxRuntime.jsx(bZ,{className:t,onClick:n,children:/* @__PURE__ */jsxRuntime.jsx(gZ,{withoutPadding:true,children:/* @__PURE__ */jsxRuntime.jsx(h3,{src:e})})});},RZ=function RZ(_ref252){var _e$inApp2,_e$inApp3,_e$inApp4,_e$inApp5,_e$inApp6;var t=_ref252.className,e=_objectWithoutProperties(_ref252,_excluded14);var _re83=y.useState(false),_re84=_slicedToArray(_re83,2),n=_re84[0],i=_re84[1],s=y.useRef();return y.useEffect(function(){var _e$inApp;return e!==null&&e!==void 0&&(_e$inApp=e.inApp)!==null&&_e$inApp!==void 0&&_e$inApp.sponsorLogo&&(i(true),s.current=setTimeout(function(){i(false);},5e3)),function(){return clearTimeout(s.current);};},[e===null||e===void 0||(_e$inApp2=e.inApp)===null||_e$inApp2===void 0?void 0:_e$inApp2.sponsorLogo]),e!==null&&e!==void 0&&(_e$inApp3=e.inApp)!==null&&_e$inApp3!==void 0&&_e$inApp3.sponsorLogo&&n?/* @__PURE__ */jsxRuntime.jsx(VZ,{className:t,sponsorLogo:(_e$inApp4=e.inApp)===null||_e$inApp4===void 0?void 0:_e$inApp4.sponsorLogo,onClick:function onClick(){return i(false);}}):/* @__PURE__ */jsxRuntime.jsx(c3,{className:t,children:/* @__PURE__ */jsxRuntime.jsxs("div",{children:[(e===null||e===void 0||(_e$inApp5=e.inApp)===null||_e$inApp5===void 0?void 0:_e$inApp5.sponsorLogo)&&/* @__PURE__ */jsxRuntime.jsx(AZ,{children:/* @__PURE__ */jsxRuntime.jsx(h3,{src:e===null||e===void 0||(_e$inApp6=e.inApp)===null||_e$inApp6===void 0?void 0:_e$inApp6.sponsorLogo})}),/* @__PURE__ */jsxRuntime.jsx(mZ,_objectSpread2({},e))]})});},EZ=function EZ(){return Aa;},yZ=/* @__PURE__ */V(EZ())({name:"OpenedContainer",class:"osyjgip",propsAsIs:true}),Qs=function Qs(_ref253){var _a$data$inApp,_a$data$inApp2,_a$data,_a$data2;var t=_ref253.sdk,e=_ref253.notification;var n=He(t.featuresList.getStore()),_ga3=ga(),i=_ga3.hiding,s=_ga3.onAnimationEnd,r=_ga3.finished,_re85=y.useState(t.getNotificationsStore()),_re86=_slicedToArray(_re85,1),o=_re86[0],l=He(o),a=y.useMemo(function(){return t.getActiveNotification();},[t,l]);y.useEffect(function(){a&&Ke$1.emit("notification",{action:"rendered",payload:{questionId:a.data.questionId,questionType:a.data.questionType}});},[a]);var c=t.getFeature(pe.GAMES);return y.useEffect(function(){r&&(c===null||c===void 0?void 0:c.closeQuestion());},[r,c]),!n||!c?null:e&&a&&a.type===yl.QUESTION_RESOLVED&&a.data.questionType===M.PREDICTION&&a.data.question?((_a$data$inApp=a.data.inApp)===null||_a$data$inApp===void 0?void 0:_a$data$inApp.adUnit)===Qe.STANDART?/* @__PURE__ */jsxRuntime.jsx(RZ,_objectSpread2(_objectSpread2({className:"SL-CardNotificationWebOs",action:a.action,close:a.close},a.data.question),{},{inApp:a.data.inApp})):/* @__PURE__ */jsxRuntime.jsx(kS,_objectSpread2({className:"SL-CardNotificationWebOs",action:a.action,close:a.close},a.data.question)):e&&a&&((_a$data$inApp2=a.data.inApp)===null||_a$data$inApp2===void 0?void 0:_a$data$inApp2.adUnit)===Qe.STANDART?/* @__PURE__ */jsxRuntime.jsx(qW,_objectSpread2(_objectSpread2({className:"SL-CardNotificationWebOs"},a.data),{},{action:a.action,close:a.close,color:(a===null||a===void 0||(_a$data=a.data)===null||_a$data===void 0||(_a$data=_a$data.inApp)===null||_a$data===void 0||(_a$data=_a$data.notification)===null||_a$data===void 0?void 0:_a$data.indicatorColor)||(a===null||a===void 0||(_a$data2=a.data)===null||_a$data2===void 0||(_a$data2=_a$data2.inApp)===null||_a$data2===void 0||(_a$data2=_a$data2.appearance)===null||_a$data2===void 0?void 0:_a$data2.primaryColor)||"",webos:true})):e?null:/* @__PURE__ */jsxRuntime.jsx(yZ,{hiding:i,onAnimationEnd:s,children:/* @__PURE__ */jsxRuntime.jsx(qC,{sdk:t,gamification:c,className:"SL-CardWebOs",webos:true})});};noriginSpatialNavigation.init({shouldFocusDOMNode:true});var CZ=function CZ(_ref254){var t=_ref254.persistent,e=_ref254.children,n=_ref254.sdk,i=_ref254.showPauseAd,s=_ref254.pauseAdVastUrl,r=_ref254.onClosePauseAd,o=_ref254.onRenderPauseAd,l=_ref254.options;var a=He(n.uiState),c=y.useCallback(function(){r===null||r===void 0||r();},[r]);return/* @__PURE__ */jsxRuntime.jsxs(y5,{sdk:n,sidebar:function sidebar(_ref255){var h=_ref255.promo;return a.exposedPauseAd?null:a.polymarket?/* @__PURE__ */jsxRuntime.jsx(_A,{sdk:n,webos:true}):h?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:n,persistent:t,sidebar:"right"}):/* @__PURE__ */jsxRuntime.jsx(Qs,{sdk:n,persistent:t});},notification:function notification(_ref256){var h=_ref256.promo;return a.exposedPauseAd||a.polymarket?null:h?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:n,notification:true,persistent:t}):/* @__PURE__ */jsxRuntime.jsx(Qs,{notification:true,sdk:n,persistent:t});},banner:a.exposedPauseAd||a.polymarket?null:/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:n,persistent:t,banner:"bottom"}),webos:true,children:[e,s&&/* @__PURE__ */jsxRuntime.jsx(K2,{showPauseAd:i,vastUrls:s,sdk:n,onClose:c,onRender:o,options:l}),/* @__PURE__ */jsxRuntime.jsx(PA,{sdk:n})]});};var WZ=/*#__PURE__*/function(_G2){function WZ(e){var _this134;_classCallCheck(this,WZ);_this134=_callSuper(this,WZ,[e]),_this134.state={hasError:false};return _this134;}_inherits(WZ,_G2);return _createClass(WZ,[{key:"componentDidCatch",value:function componentDidCatch(e,n){console.error("StreamLayerSDKTv error:",e,n.componentStack);}},{key:"render",value:function render(){return this.state.hasError?this.props.children:/* @__PURE__ */jsxRuntime.jsx(CZ,_objectSpread2({},this.props));}}],[{key:"getDerivedStateFromError",value:function getDerivedStateFromError(){return {hasError:true};}}]);}(y.Component);window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var rd;(function(t){t.Init="init",t.Ready="ready",t.Connecting="connecting",t.Connected="connected",t.Disconnected="disconnected",t.Failed="failed",t.Reconnect="reconnect",t.Reconnecting="reconnecting";})(rd||(rd={}));Ki("grpc:stream");se.Unknown,se.Internal,se.DeadlineExceeded,se.ResourceExhausted,se.FailedPrecondition,se.Unavailable,se.DataLoss;Ki("grpc:retry");Bs(10,{description:"Number of attempts to retry"}),Bs(3e4,{description:"Max delay between retries in milliseconds"});var SZ=function SZ(t,e){var _t$createPromiseClien9=t.createPromiseClient(qs,{method:"bypassAuth"}),n=_t$createPromiseClien9.client,i=_t$createPromiseClien9.createRequestOptions,s=i({retryAttempts:0});return n.bypassAuth(e,{contextValues:s});},ve=crypto,Ft=function Ft(t){return t instanceof CryptoKey;},ZZ=/*#__PURE__*/function(){var _ref257=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(t,e){var n;return _regeneratorRuntime().wrap(function _callee63$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:n="SHA-".concat(t.slice(-3));_context70.t0=Uint8Array;_context70.next=4;return ve.subtle.digest(n,e);case 4:_context70.t1=_context70.sent;return _context70.abrupt("return",new _context70.t0(_context70.t1));case 6:case "end":return _context70.stop();}},_callee63);}));return function ZZ(_x97,_x98){return _ref257.apply(this,arguments);};}(),an=new TextEncoder(),u3=new TextDecoder(),zs=Math.pow(2,32);function Oi(){for(var _len19=arguments.length,t=new Array(_len19),_key19=0;_key19<_len19;_key19++){t[_key19]=arguments[_key19];}var e=t.reduce(function(s,_ref258){var r=_ref258.length;return s+r;},0),n=new Uint8Array(e);var i=0;for(var _i66=0,_t7=t;_i66<_t7.length;_i66++){var _s59=_t7[_i66];n.set(_s59,i),i+=_s59.length;}return n;}function IZ(t,e){return Oi(an.encode(t),new Uint8Array([0]),e);}function Sl(t,e,n){if(e<0||e>=zs)throw new RangeError("value must be >= 0 and <= ".concat(zs-1,". Received ").concat(e));t.set([e>>>24,e>>>16,e>>>8,e&255],n);}function vZ(t){var e=Math.floor(t/zs),n=t%zs,i=new Uint8Array(8);return Sl(i,e,0),Sl(i,n,4),i;}function ya(t){var e=new Uint8Array(4);return Sl(e,t),e;}function Ho(t){return Oi(ya(t.length),t);}function NZ(_x99,_x100,_x101){return _NZ.apply(this,arguments);}function _NZ(){_NZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t,e,n){var i,s,_r62,o;return _regeneratorRuntime().wrap(function _callee78$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:i=Math.ceil((e>>3)/32),s=new Uint8Array(i*32);_r62=0;case 2:if(!(_r62<i)){_context85.next=16;break;}o=new Uint8Array(4+t.length+n.length);o.set(ya(_r62+1));o.set(t,4);o.set(n,4+t.length);_context85.t0=s;_context85.next=10;return ZZ("sha256",o);case 10:_context85.t1=_context85.sent;_context85.t2=_r62*32;_context85.t0.set.call(_context85.t0,_context85.t1,_context85.t2);case 13:_r62++;_context85.next=2;break;case 16:return _context85.abrupt("return",s.slice(0,e>>3));case 17:case "end":return _context85.stop();}},_callee78);}));return _NZ.apply(this,arguments);}var FZ=function FZ(t){var e=t;typeof e=="string"&&(e=an.encode(e));var n=32768,i=[];for(var _s60=0;_s60<e.length;_s60+=n)i.push(String.fromCharCode.apply(null,e.subarray(_s60,_s60+n)));return btoa(i.join(""));},lt=function lt(t){return FZ(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");},GZ=function GZ(t){var e=atob(t),n=new Uint8Array(e.length);for(var _i67=0;_i67<e.length;_i67++)n[_i67]=e.charCodeAt(_i67);return n;},mr$1=function mr(t){var e=t;e instanceof Uint8Array&&(e=u3.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return GZ(e);}catch(_unused55){throw new TypeError("The input to be decoded is not correctly encoded.");}};var d3=/*#__PURE__*/function(_Error3){function d3(e){var _Error$captureStackTr;var _this135;_classCallCheck(this,d3);_this135=_callSuper(this,d3,[e]),_this135.code="ERR_JOSE_GENERIC",_this135.name=_this135.constructor.name,(_Error$captureStackTr=Error.captureStackTrace)===null||_Error$captureStackTr===void 0?void 0:_Error$captureStackTr.call(Error,_assertThisInitialized(_this135),_this135.constructor);return _this135;}_inherits(d3,_Error3);return _createClass(d3,null,[{key:"code",get:function get(){return "ERR_JOSE_GENERIC";}}]);}(/*#__PURE__*/_wrapNativeSuper(Error));var _e=/*#__PURE__*/function(_d9){function _e(){var _this136;_classCallCheck(this,_e);_this136=_callSuper(this,_e,arguments),_this136.code="ERR_JOSE_NOT_SUPPORTED";return _this136;}_inherits(_e,_d9);return _createClass(_e,null,[{key:"code",get:function get(){return "ERR_JOSE_NOT_SUPPORTED";}}]);}(d3);var sn=/*#__PURE__*/function(_d0){function sn(){var _this137;_classCallCheck(this,sn);_this137=_callSuper(this,sn,arguments),_this137.code="ERR_JWE_INVALID";return _this137;}_inherits(sn,_d0);return _createClass(sn,null,[{key:"code",get:function get(){return "ERR_JWE_INVALID";}}]);}(d3);var Ca=ve.getRandomValues.bind(ve);function m3(t){switch(t){case "A128GCM":case "A128GCMKW":case "A192GCM":case "A192GCMKW":case "A256GCM":case "A256GCMKW":return 96;case "A128CBC-HS256":case "A192CBC-HS384":case "A256CBC-HS512":return 128;default:throw new _e("Unsupported JWE Algorithm: ".concat(t));}}var XZ=function XZ(t){return Ca(new Uint8Array(m3(t)>>3));},UZ=function UZ(t,e){if(e.length<<3!==m3(t))throw new sn("Invalid Initialization Vector length");},od=function od(t,e){var n=t.byteLength<<3;if(n!==e)throw new sn("Invalid Content Encryption Key length. Expected ".concat(e," bits, got ").concat(n," bits"));};function nn(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"algorithm.name";return new TypeError("CryptoKey does not support this operation, its ".concat(e," must be ").concat(t));}function bs(t,e){return t.name===e;}function wZ(t){return parseInt(t.name.slice(4),10);}function BZ(t,e){if(e.length&&!e.some(function(n){return t.usages.includes(n);})){var n="CryptoKey does not support this operation, its usages must include ";if(e.length>2){var _i68=e.pop();n+="one of ".concat(e.join(", "),", or ").concat(_i68,".");}else e.length===2?n+="one of ".concat(e[0]," or ").concat(e[1],"."):n+="".concat(e[0],".");throw new TypeError(n);}}function ci(t,e){switch(e){case "A128GCM":case "A192GCM":case "A256GCM":{if(!bs(t.algorithm,"AES-GCM"))throw nn("AES-GCM");var _i69=parseInt(e.slice(1,4),10);if(t.algorithm.length!==_i69)throw nn(_i69,"algorithm.length");break;}case "A128KW":case "A192KW":case "A256KW":{if(!bs(t.algorithm,"AES-KW"))throw nn("AES-KW");var _i70=parseInt(e.slice(1,4),10);if(t.algorithm.length!==_i70)throw nn(_i70,"algorithm.length");break;}case "ECDH":{switch(t.algorithm.name){case "ECDH":case "X25519":case "X448":break;default:throw nn("ECDH, X25519, or X448");}break;}case "PBES2-HS256+A128KW":case "PBES2-HS384+A192KW":case "PBES2-HS512+A256KW":if(!bs(t.algorithm,"PBKDF2"))throw nn("PBKDF2");break;case "RSA-OAEP":case "RSA-OAEP-256":case "RSA-OAEP-384":case "RSA-OAEP-512":{if(!bs(t.algorithm,"RSA-OAEP"))throw nn("RSA-OAEP");var _i71=parseInt(e.slice(9),10)||1;if(wZ(t.algorithm.hash)!==_i71)throw nn("SHA-".concat(_i71),"algorithm.hash");break;}default:throw new TypeError("CryptoKey does not support this operation");}for(var _len20=arguments.length,n=new Array(_len20>2?_len20-2:0),_key20=2;_key20<_len20;_key20++){n[_key20-2]=arguments[_key20];}BZ(t,n);}function p3(t,e){var _e$constructor;for(var _len21=arguments.length,n=new Array(_len21>2?_len21-2:0),_key21=2;_key21<_len21;_key21++){n[_key21-2]=arguments[_key21];}if(n=n.filter(Boolean),n.length>2){var _i72=n.pop();t+="one of type ".concat(n.join(", "),", or ").concat(_i72,".");}else n.length===2?t+="one of type ".concat(n[0]," or ").concat(n[1],"."):t+="of type ".concat(n[0],".");return e==null?t+=" Received ".concat(e):typeof e=="function"&&e.name?t+=" Received function ".concat(e.name):_typeof(e)=="object"&&e!=null&&((_e$constructor=e.constructor)===null||_e$constructor===void 0?void 0:_e$constructor.name)&&(t+=" Received an instance of ".concat(e.constructor.name)),t;}var Gt=function Gt(t){for(var _len22=arguments.length,e=new Array(_len22>1?_len22-1:0),_key22=1;_key22<_len22;_key22++){e[_key22-1]=arguments[_key22];}return p3.apply(void 0,["Key must be ",t].concat(e));};function g3(t,e){for(var _len23=arguments.length,n=new Array(_len23>2?_len23-2:0),_key23=2;_key23<_len23;_key23++){n[_key23-2]=arguments[_key23];}return p3.apply(void 0,["Key for the ".concat(t," algorithm must be "),e].concat(n));}var f3=function f3(t){return Ft(t)?true:(t===null||t===void 0?void 0:t[Symbol.toStringTag])==="KeyObject";},Vt=["CryptoKey"],YZ=function YZ(){for(var _len24=arguments.length,t=new Array(_len24),_key24=0;_key24<_len24;_key24++){t[_key24]=arguments[_key24];}var e=t.filter(Boolean);if(e.length===0||e.length===1)return true;var n;var _iterator127=_createForOfIteratorHelper(e),_step127;try{for(_iterator127.s();!(_step127=_iterator127.n()).done;){var _i73=_step127.value;var _s61=Object.keys(_i73);if(!n||n.size===0){n=new Set(_s61);continue;}for(var _i74=0,_s62=_s61;_i74<_s62.length;_i74++){var _r61=_s62[_i74];if(n.has(_r61))return !1;n.add(_r61);}}}catch(err){_iterator127.e(err);}finally{_iterator127.f();}return true;};function TZ(t){return _typeof(t)=="object"&&t!==null;}function Wa(t){if(!TZ(t)||Object.prototype.toString.call(t)!=="[object Object]")return false;if(Object.getPrototypeOf(t)===null)return true;var e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e;}var b3=[{hash:"SHA-256",name:"HMAC"},true,["sign"]];function LZ(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError("Invalid key size for alg: ".concat(e));}function kZ(t,e,n){if(Ft(t))return ci(t,e,n),t;if(t instanceof Uint8Array)return ve.subtle.importKey("raw",t,"AES-KW",true,[n]);throw new TypeError(Gt.apply(void 0,[t].concat(Vt,["Uint8Array"])));}var Zl=/*#__PURE__*/function(){var _ref259=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(t,e,n){var _ve$subtle;var i,s;return _regeneratorRuntime().wrap(function _callee64$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:_context71.next=2;return kZ(e,t,"wrapKey");case 2:i=_context71.sent;LZ(i,t);_context71.next=6;return (_ve$subtle=ve.subtle).importKey.apply(_ve$subtle,["raw",n].concat(b3));case 6:s=_context71.sent;_context71.t0=Uint8Array;_context71.next=10;return ve.subtle.wrapKey("raw",s,i,"AES-KW");case 10:_context71.t1=_context71.sent;return _context71.abrupt("return",new _context71.t0(_context71.t1));case 12:case "end":return _context71.stop();}},_callee64);}));return function Zl(_x102,_x103,_x104){return _ref259.apply(this,arguments);};}();function JZ(_x105,_x106,_x107,_x108){return _JZ.apply(this,arguments);}function _JZ(){_JZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,e,n,i){var s,r,o,l,a,_args86=arguments;return _regeneratorRuntime().wrap(function _callee79$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:s=_args86.length>4&&_args86[4]!==undefined?_args86[4]:new Uint8Array(0);r=_args86.length>5&&_args86[5]!==undefined?_args86[5]:new Uint8Array(0);if(Ft(t)){_context86.next=4;break;}throw new TypeError(Gt.apply(void 0,[t].concat(Vt)));case 4:if(!(ci(t,"ECDH"),!Ft(e))){_context86.next=6;break;}throw new TypeError(Gt.apply(void 0,[e].concat(Vt)));case 6:ci(e,"ECDH","deriveBits");o=Oi(Ho(an.encode(n)),Ho(s),Ho(r),ya(i));t.algorithm.name==="X25519"?l=256:t.algorithm.name==="X448"?l=448:l=Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3),10)/8)<<3;_context86.t0=Uint8Array;_context86.next=12;return ve.subtle.deriveBits({name:t.algorithm.name,public:t},e,l);case 12:_context86.t1=_context86.sent;a=new _context86.t0(_context86.t1);return _context86.abrupt("return",NZ(a,i,o));case 15:case "end":return _context86.stop();}},_callee79);}));return _JZ.apply(this,arguments);}function xZ(_x109){return _xZ.apply(this,arguments);}function _xZ(){_xZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){return _regeneratorRuntime().wrap(function _callee80$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:if(Ft(t)){_context87.next=2;break;}throw new TypeError(Gt.apply(void 0,[t].concat(Vt)));case 2:return _context87.abrupt("return",ve.subtle.generateKey(t.algorithm,true,["deriveBits"]));case 3:case "end":return _context87.stop();}},_callee80);}));return _xZ.apply(this,arguments);}function MZ(t){if(!Ft(t))throw new TypeError(Gt.apply(void 0,[t].concat(Vt)));return ["P-256","P-384","P-521"].includes(t.algorithm.namedCurve)||t.algorithm.name==="X25519"||t.algorithm.name==="X448";}function QZ(t){if(!(t instanceof Uint8Array)||t.length<8)throw new sn("PBES2 Salt Input must be 8 or more octets");}function zZ(t,e){if(t instanceof Uint8Array)return ve.subtle.importKey("raw",t,"PBKDF2",false,["deriveBits"]);if(Ft(t))return ci(t,e,"deriveBits","deriveKey"),t;throw new TypeError(Gt.apply(void 0,[t].concat(Vt,["Uint8Array"])));}function KZ(_x110,_x111,_x112,_x113){return _KZ.apply(this,arguments);}function _KZ(){_KZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(t,e,n,i){var s,r,o,l,a;return _regeneratorRuntime().wrap(function _callee81$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:QZ(t);s=IZ(e,t);r=parseInt(e.slice(13,16),10);o={hash:"SHA-".concat(e.slice(8,11)),iterations:n,name:"PBKDF2",salt:s};l={length:r,name:"AES-KW"};_context88.next=7;return zZ(i,e);case 7:a=_context88.sent;if(!a.usages.includes("deriveBits")){_context88.next=14;break;}_context88.t0=Uint8Array;_context88.next=12;return ve.subtle.deriveBits(o,a,r);case 12:_context88.t1=_context88.sent;return _context88.abrupt("return",new _context88.t0(_context88.t1));case 14:if(!a.usages.includes("deriveKey")){_context88.next=16;break;}return _context88.abrupt("return",ve.subtle.deriveKey(o,a,l,false,["wrapKey","unwrapKey"]));case 16:throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');case 17:case "end":return _context88.stop();}},_callee81);}));return _KZ.apply(this,arguments);}var HZ=/*#__PURE__*/function(){var _ref260=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t,e,n){var i,s,r,_args72=arguments;return _regeneratorRuntime().wrap(function _callee65$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:i=_args72.length>3&&_args72[3]!==undefined?_args72[3]:2048;s=_args72.length>4&&_args72[4]!==undefined?_args72[4]:Ca(new Uint8Array(16));_context72.next=4;return KZ(s,t,i,e);case 4:r=_context72.sent;_context72.next=7;return Zl(t.slice(-6),r,n);case 7:_context72.t0=_context72.sent;_context72.t1=i;_context72.t2=lt(s);return _context72.abrupt("return",{encryptedKey:_context72.t0,p2c:_context72.t1,p2s:_context72.t2});case 11:case "end":return _context72.stop();}},_callee65);}));return function HZ(_x114,_x115,_x116){return _ref260.apply(this,arguments);};}();function ld(t){switch(t){case "RSA-OAEP":case "RSA-OAEP-256":case "RSA-OAEP-384":case "RSA-OAEP-512":return "RSA-OAEP";default:throw new _e("alg ".concat(t," is not supported either by JOSE or your javascript runtime"));}}var OZ=function OZ(t,e){if(t.startsWith("RS")||t.startsWith("PS")){var n=e.algorithm.modulusLength;if(typeof n!="number"||n<2048)throw new TypeError("".concat(t," requires key modulusLength to be 2048 bits or larger"));}},DZ=/*#__PURE__*/function(){var _ref261=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t,e,n){var _ve$subtle2,_i75;return _regeneratorRuntime().wrap(function _callee66$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:if(Ft(e)){_context73.next=2;break;}throw new TypeError(Gt.apply(void 0,[e].concat(Vt)));case 2:if(!(ci(e,t,"encrypt","wrapKey"),OZ(t,e),e.usages.includes("encrypt"))){_context73.next=8;break;}_context73.t0=Uint8Array;_context73.next=6;return ve.subtle.encrypt(ld(t),e,n);case 6:_context73.t1=_context73.sent;return _context73.abrupt("return",new _context73.t0(_context73.t1));case 8:if(!e.usages.includes("wrapKey")){_context73.next=17;break;}_context73.next=11;return (_ve$subtle2=ve.subtle).importKey.apply(_ve$subtle2,["raw",n].concat(b3));case 11:_i75=_context73.sent;_context73.t2=Uint8Array;_context73.next=15;return ve.subtle.wrapKey("raw",_i75,e,ld(t));case 15:_context73.t3=_context73.sent;return _context73.abrupt("return",new _context73.t2(_context73.t3));case 17:throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation');case 18:case "end":return _context73.stop();}},_callee66);}));return function DZ(_x117,_x118,_x119){return _ref261.apply(this,arguments);};}();function Di(t){return Wa(t)&&typeof t.kty=="string";}function PZ(t){return t.kty!=="oct"&&typeof t.d=="string";}function _Z(t){return t.kty!=="oct"&&_typeof(t.d)>"u";}function jZ(t){return Di(t)&&t.kty==="oct"&&typeof t.k=="string";}function $Z(t){var e,n;switch(t.kty){case "RSA":{switch(t.alg){case "PS256":case "PS384":case "PS512":e={name:"RSA-PSS",hash:"SHA-".concat(t.alg.slice(-3))},n=t.d?["sign"]:["verify"];break;case "RS256":case "RS384":case "RS512":e={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(t.alg.slice(-3))},n=t.d?["sign"]:["verify"];break;case "RSA-OAEP":case "RSA-OAEP-256":case "RSA-OAEP-384":case "RSA-OAEP-512":e={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(t.alg.slice(-3),10)||1)},n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new _e('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');}break;}case "EC":{switch(t.alg){case "ES256":e={name:"ECDSA",namedCurve:"P-256"},n=t.d?["sign"]:["verify"];break;case "ES384":e={name:"ECDSA",namedCurve:"P-384"},n=t.d?["sign"]:["verify"];break;case "ES512":e={name:"ECDSA",namedCurve:"P-521"},n=t.d?["sign"]:["verify"];break;case "ECDH-ES":case "ECDH-ES+A128KW":case "ECDH-ES+A192KW":case "ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new _e('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');}break;}case "OKP":{switch(t.alg){case "EdDSA":e={name:t.crv},n=t.d?["sign"]:["verify"];break;case "ECDH-ES":case "ECDH-ES+A128KW":case "ECDH-ES+A192KW":case "ECDH-ES+A256KW":e={name:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new _e('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');}break;}default:throw new _e('Invalid or unsupported JWK "kty" (Key Type) Parameter value');}return {algorithm:e,keyUsages:n};}var A3=/*#__PURE__*/function(){var _ref262=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var _t$ext,_t$key_ops,_ve$subtle3;var _$Z,e,n,i,s;return _regeneratorRuntime().wrap(function _callee67$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:if(t.alg){_context74.next=2;break;}throw new TypeError('"alg" argument is required when "jwk.alg" is not present');case 2:_$Z=$Z(t),e=_$Z.algorithm,n=_$Z.keyUsages,i=[e,(_t$ext=t.ext)!==null&&_t$ext!==void 0?_t$ext:false,(_t$key_ops=t.key_ops)!==null&&_t$key_ops!==void 0?_t$key_ops:n],s=_objectSpread2({},t);return _context74.abrupt("return",(delete s.alg,delete s.use,(_ve$subtle3=ve.subtle).importKey.apply(_ve$subtle3,["jwk",s].concat(i))));case 4:case "end":return _context74.stop();}},_callee67);}));return function A3(_x120){return _ref262.apply(this,arguments);};}(),V3=function V3(t){return mr$1(t);};var Jn,xn;var R3=function R3(t){return (t===null||t===void 0?void 0:t[Symbol.toStringTag])==="KeyObject";},Ks=/*#__PURE__*/function(){var _ref263=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t,e,n,i){var s,r,o,_args75=arguments;return _regeneratorRuntime().wrap(function _callee68$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:s=_args75.length>4&&_args75[4]!==undefined?_args75[4]:false;r=t.get(e);if(!(r!==null&&r!==void 0&&r[i])){_context75.next=4;break;}return _context75.abrupt("return",r[i]);case 4:_context75.next=6;return A3(_objectSpread2(_objectSpread2({},n),{},{alg:i}));case 6:o=_context75.sent;return _context75.abrupt("return",(s&&Object.freeze(e),r?r[i]=o:t.set(e,_defineProperty({},i,o)),o));case 8:case "end":return _context75.stop();}},_callee68);}));return function Ks(_x121,_x122,_x123,_x124){return _ref263.apply(this,arguments);};}(),qZ=function qZ(t,e){if(R3(t)){var n=t.export({format:"jwk"});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?V3(n.k):(xn||(xn=/* @__PURE__ */new WeakMap()),Ks(xn,t,n,e));}return Di(t)?t.k?mr$1(t.k):(xn||(xn=/* @__PURE__ */new WeakMap()),Ks(xn,t,t,e,true)):t;},eI=function eI(t,e){if(R3(t)){var n=t.export({format:"jwk"});return n.k?V3(n.k):(Jn||(Jn=/* @__PURE__ */new WeakMap()),Ks(Jn,t,n,e));}return Di(t)?t.k?mr$1(t.k):(Jn||(Jn=/* @__PURE__ */new WeakMap()),Ks(Jn,t,t,e,true)):t;},tI={normalizePublicKey:qZ,normalizePrivateKey:eI};function E3(t){switch(t){case "A128GCM":return 128;case "A192GCM":return 192;case "A256GCM":case "A128CBC-HS256":return 256;case "A192CBC-HS384":return 384;case "A256CBC-HS512":return 512;default:throw new _e("Unsupported JWE Algorithm: ".concat(t));}}var Ei=function Ei(t){return Ca(new Uint8Array(E3(t)>>3));};function nI(_x125,_x126){return _nI.apply(this,arguments);}function _nI(){_nI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t,e){return _regeneratorRuntime().wrap(function _callee82$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:if(Wa(t)){_context89.next=2;break;}throw new TypeError("JWK must be an object");case 2:_context89.t0=(e||(e=t.alg),t.kty);_context89.next=_context89.t0==="oct"?5:_context89.t0==="RSA"?8:_context89.t0==="EC"?10:_context89.t0==="OKP"?10:11;break;case 5:if(!(typeof t.k!="string"||!t.k)){_context89.next=7;break;}throw new TypeError('missing "k" (Key Value) Parameter value');case 7:return _context89.abrupt("return",mr$1(t.k));case 8:if(!(t.oth!==void 0)){_context89.next=10;break;}throw new _e('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case 10:return _context89.abrupt("return",A3(_objectSpread2(_objectSpread2({},t),{},{alg:e})));case 11:throw new _e('Unsupported "kty" (Key Type) Parameter value');case 12:case "end":return _context89.stop();}},_callee82);}));return _nI.apply(this,arguments);}var Qn=function Qn(t){return t===null||t===void 0?void 0:t[Symbol.toStringTag];},Il=function Il(t,e,n){var _e$key_ops$includes,_e$key_ops;if(e.use!==void 0&&e.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(e.key_ops!==void 0&&((_e$key_ops$includes=(_e$key_ops=e.key_ops).includes)===null||_e$key_ops$includes===void 0?void 0:_e$key_ops$includes.call(_e$key_ops,n))!==true)throw new TypeError("Invalid key for this operation, when present its key_ops must include ".concat(n));if(e.alg!==void 0&&e.alg!==t)throw new TypeError("Invalid key for this operation, when present its alg must be ".concat(t));return true;},iI=function iI(t,e,n,i){if(!(e instanceof Uint8Array)){if(i&&Di(e)){if(jZ(e)&&Il(t,e,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');}if(!f3(e))throw new TypeError(g3.apply(void 0,[t,e].concat(Vt,["Uint8Array",i?"JSON Web Key":null])));if(e.type!=="secret")throw new TypeError("".concat(Qn(e)," instances for symmetric algorithms must be of type \"secret\""));}},sI=function sI(t,e,n,i){if(i&&Di(e))switch(n){case "sign":if(PZ(e)&&Il(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case "verify":if(_Z(e)&&Il(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK");}if(!f3(e))throw new TypeError(g3.apply(void 0,[t,e].concat(Vt,[i?"JSON Web Key":null])));if(e.type==="secret")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithms must not be of type \"secret\""));if(n==="sign"&&e.type==="public")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm signing must be of type \"private\""));if(n==="decrypt"&&e.type==="public")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm decryption must be of type \"private\""));if(e.algorithm&&n==="verify"&&e.type==="private")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm verifying must be of type \"public\""));if(e.algorithm&&n==="encrypt"&&e.type==="private")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm encryption must be of type \"public\""));};function y3(t,e,n,i){e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?iI(e,n,i,t):sI(e,n,i,t);}var rI=y3.bind(void 0,false);y3.bind(void 0,true);function oI(_x127,_x128,_x129,_x130,_x131){return _oI.apply(this,arguments);}function _oI(){_oI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(t,e,n,i,s){var r,o,l,a,c,h;return _regeneratorRuntime().wrap(function _callee83$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:if(n instanceof Uint8Array){_context90.next=2;break;}throw new TypeError(Gt(n,"Uint8Array"));case 2:r=parseInt(t.slice(1,4),10);_context90.next=5;return ve.subtle.importKey("raw",n.subarray(r>>3),"AES-CBC",false,["encrypt"]);case 5:o=_context90.sent;_context90.next=8;return ve.subtle.importKey("raw",n.subarray(0,r>>3),{hash:"SHA-".concat(r<<1),name:"HMAC"},false,["sign"]);case 8:l=_context90.sent;_context90.t0=Uint8Array;_context90.next=12;return ve.subtle.encrypt({iv:i,name:"AES-CBC"},o,e);case 12:_context90.t1=_context90.sent;a=new _context90.t0(_context90.t1);c=Oi(s,i,a,vZ(s.length<<3));_context90.t2=Uint8Array;_context90.next=18;return ve.subtle.sign("HMAC",l,c);case 18:_context90.t3=_context90.sent.slice(0,r>>3);h=new _context90.t2(_context90.t3);return _context90.abrupt("return",{ciphertext:a,tag:h,iv:i});case 21:case "end":return _context90.stop();}},_callee83);}));return _oI.apply(this,arguments);}function lI(_x132,_x133,_x134,_x135,_x136){return _lI.apply(this,arguments);}function _lI(){_lI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(t,e,n,i,s){var r,o,l;return _regeneratorRuntime().wrap(function _callee84$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:if(!(n instanceof Uint8Array)){_context91.next=6;break;}_context91.next=3;return ve.subtle.importKey("raw",n,"AES-GCM",false,["encrypt"]);case 3:r=_context91.sent;_context91.next=7;break;case 6:ci(n,t,"encrypt"),r=n;case 7:_context91.t0=Uint8Array;_context91.next=10;return ve.subtle.encrypt({additionalData:s,iv:i,name:"AES-GCM",tagLength:128},r,e);case 10:_context91.t1=_context91.sent;o=new _context91.t0(_context91.t1);l=o.slice(-16);return _context91.abrupt("return",{ciphertext:o.slice(0,-16),tag:l,iv:i});case 14:case "end":return _context91.stop();}},_callee84);}));return _lI.apply(this,arguments);}var C3=/*#__PURE__*/function(){var _ref264=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(t,e,n,i,s){return _regeneratorRuntime().wrap(function _callee69$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:if(!(!Ft(n)&&!(n instanceof Uint8Array))){_context76.next=2;break;}throw new TypeError(Gt.apply(void 0,[n].concat(Vt,["Uint8Array"])));case 2:_context76.t0=(i?UZ(t,i):i=XZ(t),t);_context76.next=_context76.t0==="A128CBC-HS256"?5:_context76.t0==="A192CBC-HS384"?5:_context76.t0==="A256CBC-HS512"?5:_context76.t0==="A128GCM"?6:_context76.t0==="A192GCM"?6:_context76.t0==="A256GCM"?6:7;break;case 5:return _context76.abrupt("return",(n instanceof Uint8Array&&od(n,parseInt(t.slice(-3),10)),oI(t,e,n,i,s)));case 6:return _context76.abrupt("return",(n instanceof Uint8Array&&od(n,parseInt(t.slice(1,4),10)),lI(t,e,n,i,s)));case 7:throw new _e("Unsupported JWE Content Encryption Algorithm");case 8:case "end":return _context76.stop();}},_callee69);}));return function C3(_x137,_x138,_x139,_x140,_x141){return _ref264.apply(this,arguments);};}();function aI(_x142,_x143,_x144,_x145){return _aI.apply(this,arguments);}function _aI(){_aI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t,e,n,i){var s,r;return _regeneratorRuntime().wrap(function _callee85$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:s=t.slice(0,7);_context92.next=3;return C3(s,n,e,i,new Uint8Array(0));case 3:r=_context92.sent;return _context92.abrupt("return",{encryptedKey:r.ciphertext,iv:lt(r.iv),tag:lt(r.tag)});case 5:case "end":return _context92.stop();}},_callee85);}));return _aI.apply(this,arguments);}function cI(t,e,n,i,s){if(s.crit!==void 0&&(i===null||i===void 0?void 0:i.crit)===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||i.crit===void 0)return/* @__PURE__ */new Set();if(!Array.isArray(i.crit)||i.crit.length===0||i.crit.some(function(o){return typeof o!="string"||o.length===0;}))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');var r;n!==void 0?r=new Map([].concat(_toConsumableArray(Object.entries(n)),_toConsumableArray(e.entries()))):r=e;var _iterator128=_createForOfIteratorHelper(i.crit),_step128;try{for(_iterator128.s();!(_step128=_iterator128.n()).done;){var o=_step128.value;if(!r.has(o))throw new _e("Extension Header Parameter \"".concat(o,"\" is not recognized"));if(s[o]===void 0)throw new t("Extension Header Parameter \"".concat(o,"\" is missing"));if(r.get(o)&&i[o]===void 0)throw new t("Extension Header Parameter \"".concat(o,"\" MUST be integrity protected"));}}catch(err){_iterator128.e(err);}finally{_iterator128.f();}return new Set(i.crit);}var hI=/* @__PURE__ */Symbol(),uI=/*#__PURE__*/function(){var _ref265=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t){var _yield$ve$subtle$expo,r;return _regeneratorRuntime().wrap(function _callee70$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:if(!(t instanceof Uint8Array)){_context77.next=2;break;}return _context77.abrupt("return",{kty:"oct",k:lt(t)});case 2:if(Ft(t)){_context77.next=4;break;}throw new TypeError(Gt.apply(void 0,[t].concat(Vt,["Uint8Array"])));case 4:if(t.extractable){_context77.next=6;break;}throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");case 6:_context77.next=8;return ve.subtle.exportKey("jwk",t);case 8:_yield$ve$subtle$expo=_context77.sent;_yield$ve$subtle$expo.ext;_yield$ve$subtle$expo.key_ops;_yield$ve$subtle$expo.alg;_yield$ve$subtle$expo.use;r=_objectWithoutProperties(_yield$ve$subtle$expo,_excluded15);return _context77.abrupt("return",r);case 15:case "end":return _context77.stop();}},_callee70);}));return function uI(_x146){return _ref265.apply(this,arguments);};}();function dI(_x147){return _dI.apply(this,arguments);}function _dI(){_dI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t){return _regeneratorRuntime().wrap(function _callee86$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:return _context93.abrupt("return",uI(t));case 1:case "end":return _context93.stop();}},_callee86);}));return _dI.apply(this,arguments);}function mI(_x148,_x149,_x150,_x151){return _mI.apply(this,arguments);}function _mI(){_mI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t,e,n,i){var _tI$normalizePublicKe;var s,r,o,l,a,_c40,_h30,_yield$dI,u,d,m,p,g,A,_a16,_c41,_yield$HZ,_a17,_yield$aI,_args94=arguments;return _regeneratorRuntime().wrap(function _callee87$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:s=_args94.length>4&&_args94[4]!==undefined?_args94[4]:{};rI(t,n,"encrypt");_context94.next=4;return (_tI$normalizePublicKe=tI.normalizePublicKey)===null||_tI$normalizePublicKe===void 0?void 0:_tI$normalizePublicKe.call(tI,n,t);case 4:_context94.t1=_context94.sent;if(_context94.t1){_context94.next=7;break;}_context94.t1=n;case 7:n=_context94.t1;_context94.t0=t;_context94.next=_context94.t0==="dir"?11:_context94.t0==="ECDH-ES"?13:_context94.t0==="ECDH-ES+A128KW"?13:_context94.t0==="ECDH-ES+A192KW"?13:_context94.t0==="ECDH-ES+A256KW"?13:_context94.t0==="RSA1_5"?41:_context94.t0==="RSA-OAEP"?41:_context94.t0==="RSA-OAEP-256"?41:_context94.t0==="RSA-OAEP-384"?41:_context94.t0==="RSA-OAEP-512"?41:_context94.t0==="PBES2-HS256+A128KW"?46:_context94.t0==="PBES2-HS384+A192KW"?46:_context94.t0==="PBES2-HS512+A256KW"?46:_context94.t0==="A128KW"?55:_context94.t0==="A192KW"?55:_context94.t0==="A256KW"?55:_context94.t0==="A128GCMKW"?60:_context94.t0==="A192GCMKW"?60:_context94.t0==="A256GCMKW"?60:69;break;case 11:l=n;return _context94.abrupt("break",70);case 13:if(MZ(n)){_context94.next=15;break;}throw new _e("ECDH with the provided key is not allowed or not supported by your javascript runtime");case 15:a=s.apu,_c40=s.apv;_h30=s.epk;_context94.t2=_h30;if(_context94.t2){_context94.next=22;break;}_context94.next=21;return xZ(n);case 21:_h30=_context94.sent.privateKey;case 22:_context94.next=24;return dI(_h30);case 24:_yield$dI=_context94.sent;u=_yield$dI.x;d=_yield$dI.y;m=_yield$dI.crv;p=_yield$dI.kty;_context94.next=31;return JZ(n,_h30,t==="ECDH-ES"?e:t,t==="ECDH-ES"?E3(e):parseInt(t.slice(-5,-2),10),a,_c40);case 31:g=_context94.sent;if(!(o={epk:{x:u,crv:m,kty:p}},p==="EC"&&(o.epk.y=d),a&&(o.apu=lt(a)),_c40&&(o.apv=lt(_c40)),t==="ECDH-ES")){_context94.next=35;break;}l=g;return _context94.abrupt("break",70);case 35:l=i||Ei(e);A=t.slice(-6);_context94.next=39;return Zl(A,g,l);case 39:r=_context94.sent;return _context94.abrupt("break",70);case 41:l=i||Ei(e);_context94.next=44;return DZ(t,n,l);case 44:r=_context94.sent;return _context94.abrupt("break",70);case 46:l=i||Ei(e);_a16=s.p2c,_c41=s.p2s;_context94.next=50;return HZ(t,n,l,_a16,_c41);case 50:_yield$HZ=_context94.sent;r=_yield$HZ.encryptedKey;o=_objectWithoutProperties(_yield$HZ,_excluded18);return _context94.abrupt("break",70);case 55:l=i||Ei(e);_context94.next=58;return Zl(t,n,l);case 58:r=_context94.sent;return _context94.abrupt("break",70);case 60:l=i||Ei(e);_a17=s.iv;_context94.next=64;return aI(t,n,l,_a17);case 64:_yield$aI=_context94.sent;r=_yield$aI.encryptedKey;o=_objectWithoutProperties(_yield$aI,_excluded19);return _context94.abrupt("break",70);case 69:throw new _e('Invalid or unsupported "alg" (JWE Algorithm) header value');case 70:return _context94.abrupt("return",{cek:l,encryptedKey:r,parameters:o});case 71:case "end":return _context94.stop();}},_callee87);}));return _mI.apply(this,arguments);}var pI=/*#__PURE__*/function(){function pI(e){_classCallCheck(this,pI);if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e;}return _createClass(pI,[{key:"setKeyManagementParameters",value:function setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this;}},{key:"setProtectedHeader",value:function setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this;}},{key:"setSharedUnprotectedHeader",value:function setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this;}},{key:"setUnprotectedHeader",value:function setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this;}},{key:"setAdditionalAuthenticatedData",value:function setAdditionalAuthenticatedData(e){return this._aad=e,this;}},{key:"setContentEncryptionKey",value:function setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this;}},{key:"setInitializationVector",value:function setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this;}},{key:"encrypt",value:function(){var _encrypt=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e,n){var i,s,r,o,l,_yield$mI,g,a,c,h,_yield$C,u,d,m,p;return _regeneratorRuntime().wrap(function _callee71$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:if(!(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)){_context78.next=2;break;}throw new sn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");case 2:if(YZ(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader)){_context78.next=4;break;}throw new sn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");case 4:i=_objectSpread2(_objectSpread2(_objectSpread2({},this._protectedHeader),this._unprotectedHeader),this._sharedUnprotectedHeader);if(!(cI(sn,/* @__PURE__ */new Map(),n===null||n===void 0?void 0:n.crit,this._protectedHeader,i),i.zip!==void 0)){_context78.next=7;break;}throw new _e('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');case 7:s=i.alg,r=i.enc;if(!(typeof s!="string"||!s)){_context78.next=10;break;}throw new sn('JWE "alg" (Algorithm) Header Parameter missing or invalid');case 10:if(!(typeof r!="string"||!r)){_context78.next=12;break;}throw new sn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');case 12:if(!(this._cek&&(s==="dir"||s==="ECDH-ES"))){_context78.next=14;break;}throw new TypeError("setContentEncryptionKey cannot be called with JWE \"alg\" (Algorithm) Header ".concat(s));case 14:_context78.next=16;return mI(s,r,e,this._cek,this._keyManagementParameters);case 16:_yield$mI=_context78.sent;l=_yield$mI.cek;o=_yield$mI.encryptedKey;g=_yield$mI.parameters;g&&(n&&hI in n?this._unprotectedHeader?this._unprotectedHeader=_objectSpread2(_objectSpread2({},this._unprotectedHeader),g):this.setUnprotectedHeader(g):this._protectedHeader?this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),g):this.setProtectedHeader(g));this._protectedHeader?c=an.encode(lt(JSON.stringify(this._protectedHeader))):c=an.encode(""),this._aad?(h=lt(this._aad),a=Oi(c,an.encode("."),an.encode(h))):a=c;_context78.next=24;return C3(r,this._plaintext,l,this._iv,a);case 24:_yield$C=_context78.sent;u=_yield$C.ciphertext;d=_yield$C.tag;m=_yield$C.iv;p={ciphertext:lt(u)};return _context78.abrupt("return",(m&&(p.iv=lt(m)),d&&(p.tag=lt(d)),o&&(p.encrypted_key=lt(o)),h&&(p.aad=h),this._protectedHeader&&(p.protected=u3.decode(c)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p));case 30:case "end":return _context78.stop();}},_callee71,this);}));function encrypt(_x152,_x153){return _encrypt.apply(this,arguments);}return encrypt;}()}]);}();var pn=function pn(t){return Math.floor(t.getTime()/1e3);},W3=60,S3=W3*60,Sa=S3*24,gI=Sa*7,fI=Sa*365.25,bI=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Oo=function Oo(t){var e=bI.exec(t);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");var n=parseFloat(e[2]),i=e[3].toLowerCase();var s;switch(i){case "sec":case "secs":case "second":case "seconds":case "s":s=Math.round(n);break;case "minute":case "minutes":case "min":case "mins":case "m":s=Math.round(n*W3);break;case "hour":case "hours":case "hr":case "hrs":case "h":s=Math.round(n*S3);break;case "day":case "days":case "d":s=Math.round(n*Sa);break;case "week":case "weeks":case "w":s=Math.round(n*gI);break;default:s=Math.round(n*fI);break;}return e[1]==="-"||e[4]==="ago"?-s:s;};var AI=/*#__PURE__*/function(){function AI(e){_classCallCheck(this,AI);this._flattened=new pI(e);}return _createClass(AI,[{key:"setContentEncryptionKey",value:function setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this;}},{key:"setInitializationVector",value:function setInitializationVector(e){return this._flattened.setInitializationVector(e),this;}},{key:"setProtectedHeader",value:function setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this;}},{key:"setKeyManagementParameters",value:function setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this;}},{key:"encrypt",value:function(){var _encrypt2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e,n){var i;return _regeneratorRuntime().wrap(function _callee72$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_context79.next=2;return this._flattened.encrypt(e,n);case 2:i=_context79.sent;return _context79.abrupt("return",[i.protected,i.encrypted_key,i.iv,i.ciphertext,i.tag].join("."));case 4:case "end":return _context79.stop();}},_callee72,this);}));function encrypt(_x154,_x155){return _encrypt2.apply(this,arguments);}return encrypt;}()}]);}();function gn(t,e){if(!Number.isFinite(e))throw new TypeError("Invalid ".concat(t," input"));return e;}var VI=/*#__PURE__*/function(){function VI(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,VI);if(!Wa(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e;}return _createClass(VI,[{key:"setIssuer",value:function setIssuer(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iss:e}),this;}},{key:"setSubject",value:function setSubject(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{sub:e}),this;}},{key:"setAudience",value:function setAudience(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{aud:e}),this;}},{key:"setJti",value:function setJti(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{jti:e}),this;}},{key:"setNotBefore",value:function setNotBefore(e){return typeof e=="number"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{nbf:gn("setNotBefore",e)}):e instanceof Date?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{nbf:gn("setNotBefore",pn(e))}):this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{nbf:pn(/* @__PURE__ */new Date())+Oo(e)}),this;}},{key:"setExpirationTime",value:function setExpirationTime(e){return typeof e=="number"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{exp:gn("setExpirationTime",e)}):e instanceof Date?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{exp:gn("setExpirationTime",pn(e))}):this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{exp:pn(/* @__PURE__ */new Date())+Oo(e)}),this;}},{key:"setIssuedAt",value:function setIssuedAt(e){return _typeof(e)>"u"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:pn(/* @__PURE__ */new Date())}):e instanceof Date?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:gn("setIssuedAt",pn(e))}):typeof e=="string"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:gn("setIssuedAt",pn(/* @__PURE__ */new Date())+Oo(e))}):this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:gn("setIssuedAt",e)}),this;}}]);}();var RI=/*#__PURE__*/function(_VI){function RI(){_classCallCheck(this,RI);return _callSuper(this,RI,arguments);}_inherits(RI,_VI);return _createClass(RI,[{key:"setProtectedHeader",value:function setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this;}},{key:"setKeyManagementParameters",value:function setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this;}},{key:"setContentEncryptionKey",value:function setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this;}},{key:"setInitializationVector",value:function setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this;}},{key:"replicateIssuerAsHeader",value:function replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=true,this;}},{key:"replicateSubjectAsHeader",value:function replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=true,this;}},{key:"replicateAudienceAsHeader",value:function replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=true,this;}},{key:"encrypt",value:function(){var _encrypt3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e,n){var i;return _regeneratorRuntime().wrap(function _callee73$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:i=new AI(an.encode(JSON.stringify(this._payload)));return _context80.abrupt("return",(this._replicateIssuerAsHeader&&(this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),{},{iss:this._payload.iss})),this._replicateSubjectAsHeader&&(this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),{},{sub:this._payload.sub})),this._replicateAudienceAsHeader&&(this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),{},{aud:this._payload.aud})),i.setProtectedHeader(this._protectedHeader),this._iv&&i.setInitializationVector(this._iv),this._cek&&i.setContentEncryptionKey(this._cek),this._keyManagementParameters&&i.setKeyManagementParameters(this._keyManagementParameters),i.encrypt(e,n)));case 2:case "end":return _context80.stop();}},_callee73,this);}));function encrypt(_x156,_x157){return _encrypt3.apply(this,arguments);}return encrypt;}()}]);}(VI);var Tt;(function(t){t.SCHEMA="schema",t.EXTERNAL_TOKEN="eToken",t.TOKEN="token";})(Tt||(Tt={}));var EI=/*#__PURE__*/function(_tW2){function EI(){var _this138;_classCallCheck(this,EI);_this138=_callSuper(this,EI,["user"]);// Schema
1177
+ t.name==="NS_ERROR_DOM_QUOTA_REACHED");}var tW=/*#__PURE__*/_createClass(function tW(){var _this133=this;var _e28=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"main";var _n22=arguments.length>1&&arguments[1]!==undefined?arguments[1]:window.localStorage;_classCallCheck(this,tW);_defineProperty(this,"delimiter",":");_defineProperty(this,"prefix",void 0);_defineProperty(this,"storage",void 0);_defineProperty(this,"clear",function(){for(var e in window.localStorage)e.startsWith(_this133.prefix)&&_this133.storage.removeItem(e);});_defineProperty(this,"generateKey",function(e){return "".concat(_this133.prefix).concat(_this133.delimiter).concat(e.join(_this133.delimiter));});_defineProperty(this,"write",function(){for(var _len16=arguments.length,e=new Array(_len16),_key16=0;_key16<_len16;_key16++){e[_key16]=arguments[_key16];}var n=e.pop()||"",i=_this133.generateKey(e);try{_this133.storage.setItem(i,n);}catch(s){eW(s)&&_this133.storage===window.sessionStorage&&(window.sessionStorage.removeItem("slstreamlogs"),_this133.storage.setItem(i,n));}});_defineProperty(this,"read",function(){for(var _len17=arguments.length,e=new Array(_len17),_key17=0;_key17<_len17;_key17++){e[_key17]=arguments[_key17];}var n=_this133.storage.getItem(_this133.generateKey(e));return n===null?void 0:n;});_defineProperty(this,"remove",function(){for(var _len18=arguments.length,e=new Array(_len18),_key18=0;_key18<_len18;_key18++){e[_key18]=arguments[_key18];}_this133.storage.removeItem(_this133.generateKey(e));});this.prefix="sl-sdk".concat(this.delimiter).concat(_e28),this.storage=_n22;});var _u;(function(t){t.OPENED="opened";})(_u||(_u={}));var nW=/* @__PURE__ */V("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:false}),oW=function oW(){return oe;},lW=/* @__PURE__ */V(oW())({name:"QuestionTypeIcon",class:"qmg0vkx",propsAsIs:true}),aW=/* @__PURE__ */V("div")({name:"QuestionTypeLabel",class:"q1uz5j1g",propsAsIs:false});rn.LOST+"",rn.WON+"",rn.UNSET+"",rn.DNP+"";var cW=function cW(_ref223){var t=_ref223.questionTypeData,e=_ref223.questionType,n=_ref223.questionStatus;return/* @__PURE__ */jsxRuntime.jsxs(nW,{className:"SL_QuestionCaption",children:[/* @__PURE__ */jsxRuntime.jsx(lW,{className:"SL_QuestionTypeIcon","data-testid":"question-type-icon","data-type-trivia":e===M.TRIVIA,"data-type-poll":e===M.POLL,name:t.iconName}),/* @__PURE__ */jsxRuntime.jsxs(aW,{className:"SL_QuestionTypeLabel",children:[t.label,e===M.TRIVIA&&n===Ze$1.RESOLVED&&" • Expired"]})]});},hW=function hW(){return function(_ref224){var t=_ref224.color;return t||"transparent";};},ju=/* @__PURE__ */V("div")({name:"MediaComponentWrap",class:"mek728j",propsAsIs:false,vars:{"mek728j-0":[hW()]}}),Gn=/* @__PURE__ */V("div")({name:"Media",class:"m461t56",propsAsIs:false}),uW=function uW(){return Gn;},dW=/* @__PURE__ */V(uW())({name:"MediaImgBottom",class:"m22bh04",propsAsIs:true}),mW=function mW(){return Gn;},pW=/* @__PURE__ */V(mW())({name:"MediaVideo",class:"m17u1e34",propsAsIs:true}),gW=function gW(){return Gn;},fW=/* @__PURE__ */V(gW())({name:"MediaImgContentMedia",class:"m4j3eds",propsAsIs:true}),bW=function bW(){return Gn;},AW=/* @__PURE__ */V(bW())({name:"MediaImgSolid",class:"m1lp3swr",propsAsIs:true}),VW=function VW(){return Gn;},RW=/* @__PURE__ */V(VW())({name:"MediaImgRounded",class:"mc7lij",propsAsIs:true}),EW=function EW(){return Gn;},yW=/* @__PURE__ */V(EW())({name:"MediaImgCentered",class:"mwwaw7o",propsAsIs:true}),CW=function CW(){return Gn;},Wl=/* @__PURE__ */V(CW())({name:"MediaNone",class:"mqfzyyr",propsAsIs:true}),WW="v170mtgf",SW=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},ke$1.UNSET,Wl),ke$1.NONE,Wl),ke$1.ROUNDED,RW),ke$1.CENTERED,yW),ke$1.TRANSPARENT,dW),ke$1.SOLID,AW),$u=function $u(_ref225){var t=_ref225.src,_ref225$imageMode=_ref225.imageMode,e=_ref225$imageMode===void 0?ke$1.UNSET:_ref225$imageMode,n=_ref225.withVideo,i=_ref225.color,s=_ref225.useContentMedia,r=_ref225.thumbnailUrl;if(!t)return/* @__PURE__ */jsxRuntime.jsx(ju,{color:i,children:/* @__PURE__ */jsxRuntime.jsx(Wl,{})});var o=s===sl.ENABLED?fW:SW[e];return/* @__PURE__ */jsxRuntime.jsx(ju,{color:i,children:n?/* @__PURE__ */jsxRuntime.jsx(pW,{children:/* @__PURE__ */jsxRuntime.jsx(Hi,{className:WW,source:t,poster:r||""})}):/* @__PURE__ */jsxRuntime.jsx(o,{children:/* @__PURE__ */jsxRuntime.jsx("img",{src:t,alt:""})})});},ZW=function ZW(){return function(_ref226){var t=_ref226.withoutPadding;return t?"0px":"1rem";};},q2=/* @__PURE__ */V("div")({name:"NotificationContent",class:"n1p3bk1c",propsAsIs:false,vars:{"n1p3bk1c-0":[ZW()]}}),IW=/* @__PURE__ */V("div")({name:"MainContent",class:"m1g211mu",propsAsIs:false}),vW=function vW(){return oe;},NW=/* @__PURE__ */V(vW())({name:"StyledChevronRight",class:"sx1hq4c",propsAsIs:true}),e3=/* @__PURE__ */V("div")({name:"NotificationContainer",class:"n1fcriet",propsAsIs:false}),FW=function FW(){return function(_ref227){var t=_ref227.questionType;return t===M.FACTOID?"7.3rem":"4.5rem";};},GW=function GW(){return function(_ref228){var t=_ref228.webos;return t?"11px 0px 8px 0px":"11px 0px";};},XW=function XW(){return function(_ref229){var t=_ref229.imageMode,e=_ref229.webos;return e?"330px":t===ke$1.SOLID?"310px":t===ke$1.CENTERED||t===ke$1.ROUNDED||t===ke$1.TRANSPARENT?"370px":"430px";};},UW=/* @__PURE__ */V("div")({name:"Body",class:"b1byyovs",propsAsIs:false,vars:{"b1byyovs-0":[FW()],"b1byyovs-1":[GW()],"b1byyovs-2":[XW()]}}),wW=function wW(){return function(_ref230){var t=_ref230.webos;return t?"0.85rem":"1.033rem";};},BW=function BW(){return function(_ref231){var t=_ref231.webos;return t?"0.95rem":"1.25rem";};},YW=function YW(){return function(_ref232){var t=_ref232.webos;return t?"4.7rem":"2.25rem";};},TW=function TW(){return function(_ref233){var t=_ref233.webos;return t?"pre-wrap":"nowrap";};},LW=/* @__PURE__ */V("div")({name:"Title",class:"t1y5k5id",propsAsIs:false,vars:{"t1y5k5id-0":[wW()],"t1y5k5id-1":[BW()],"t1y5k5id-2":[YW()],"t1y5k5id-3":[TW()]}}),kW=/* @__PURE__ */V("div")({name:"Description",class:"dw9eb7l",propsAsIs:false}),JW=/* @__PURE__ */V("div")({name:"LogoImgContainer",class:"ldu8wgy",propsAsIs:false}),t3=/* @__PURE__ */V("img")({name:"LogoImg",class:"ln4a3eh",propsAsIs:false}),xW=function xW(){return e3;},MW=/* @__PURE__ */V(xW())({name:"NotificationInterstitialContainer",class:"no2k63v",propsAsIs:true}),QW=/* @__PURE__ */V("div")({name:"TVButtons",class:"th9nn6a",propsAsIs:false}),n3=/* @__PURE__ */V("button")({name:"TVButton",class:"t1eee77p",propsAsIs:false}),zW=function zW(){return n3;},KW=/* @__PURE__ */V(zW())({name:"DismissButton",class:"ds000hw",propsAsIs:true}),HW=function HW(){return n3;},OW=/* @__PURE__ */V(HW())({name:"AnswerButton",class:"a1nz9hoe",propsAsIs:true}),DW=function DW(_ref234){var t=_ref234.title,e=_ref234.questionType,n=_ref234.questionTypeData,i=_ref234.description,s=_ref234.imageMode,r=_ref234.webos;return/* @__PURE__ */jsxRuntime.jsxs(UW,{imageMode:s,questionType:e,webos:r,children:[/* @__PURE__ */jsxRuntime.jsx(cW,{questionTypeData:n,questionType:e,questionStatus:Ze$1.UNSET}),t&&/* @__PURE__ */jsxRuntime.jsx(LW,{webos:r,children:t}),i&&/* @__PURE__ */jsxRuntime.jsx(kW,{children:i})]});},PW=ut(MW),_W=ut(KW),jW=ut(OW),$W=function $W(_ref235){var t=_ref235.className,e=_ref235.sponsorLogo,n=_ref235.onClick,i=_ref235.webos;return/* @__PURE__ */jsxRuntime.jsx(PW,{className:t,autoFocus:true,webos:i,onClick:n,"data-webos":i,children:/* @__PURE__ */jsxRuntime.jsx(q2,{withoutPadding:true,children:/* @__PURE__ */jsxRuntime.jsx(t3,{src:e})})});},qW=function qW(_ref236){var _s$video,_s$video2,_s$video3;var t=_ref236.action,e=_ref236.close,n=_ref236.questionType,i=_ref236.inApp,s=_ref236.insight,r=_ref236.color,o=_ref236.webos,l=_ref236.className;var _re71=y.useState(false),_re72=_slicedToArray(_re71,2),a=_re72[0],c=_re72[1],h=y.useRef();y.useEffect(function(){return i!==null&&i!==void 0&&i.sponsorLogo&&(c(true),h.current=setTimeout(function(){c(false);},5e3)),function(){return clearTimeout(h.current);};},[i===null||i===void 0?void 0:i.sponsorLogo]);var u=H2[n];if(!u||!i||!i.notification)return null;var _i$notification=i.notification,d=_i$notification.title,m=_i$notification.image,p=_i$notification.imageMode,g=_i$notification.useContentMedia,A=n===M.FACTOID?s===null||s===void 0?void 0:s.heading:d,b=n===M.FACTOID?s===null||s===void 0?void 0:s.body:"",R=m,S=n===M.FACTOID&&(s===null||s===void 0||(_s$video=s.video)===null||_s$video===void 0?void 0:_s$video.url)&&(i===null||i===void 0?void 0:i.isVideo)&&g===sl.ENABLED,E=g===sl.ENABLED?S?s===null||s===void 0||(_s$video2=s.video)===null||_s$video2===void 0?void 0:_s$video2.url:s===null||s===void 0?void 0:s.image:"";return i!==null&&i!==void 0&&i.sponsorLogo&&a?/* @__PURE__ */jsxRuntime.jsx($W,{className:l,sponsorLogo:i===null||i===void 0?void 0:i.sponsorLogo,webos:o,onClick:function onClick(){return c(false);}}):/* @__PURE__ */jsxRuntime.jsxs(e3,{"data-a":"intr",className:Oe("SL_InApp",l),onClick:function onClick(v){o||(t===null||t===void 0?void 0:t(v));},"data-is-insight":n===M.FACTOID,"data-webos":o,children:[(i===null||i===void 0?void 0:i.sponsorLogo)&&/* @__PURE__ */jsxRuntime.jsx(JW,{children:/* @__PURE__ */jsxRuntime.jsx(t3,{src:i===null||i===void 0?void 0:i.sponsorLogo})}),/* @__PURE__ */jsxRuntime.jsxs(q2,{children:[/* @__PURE__ */jsxRuntime.jsxs(IW,{children:[!E&&/* @__PURE__ */jsxRuntime.jsx($u,{src:R,imageMode:p,withVideo:!!S,color:r}),E&&/* @__PURE__ */jsxRuntime.jsx($u,{src:E,imageMode:p,withVideo:!!S,color:r,useContentMedia:g,thumbnailUrl:s===null||s===void 0||(_s$video3=s.video)===null||_s$video3===void 0?void 0:_s$video3.thumbnailUrl}),/* @__PURE__ */jsxRuntime.jsx(DW,{questionTypeData:u,questionType:n,title:A,description:b,imageMode:p,webos:o})]}),!o&&/* @__PURE__ */jsxRuntime.jsx(NW,{name:"chevronRight"}),o&&/* @__PURE__ */jsxRuntime.jsxs(QW,{children:[/* @__PURE__ */jsxRuntime.jsx(_W,{webos:true,"data-close-btn":"true",onClick:function onClick(v){v.stopPropagation(),e===null||e===void 0?void 0:e(v);},children:"Dismiss"}),/* @__PURE__ */jsxRuntime.jsx(jW,{webos:true,autoFocus:true,onClick:t,children:"Answer"})]})]})]});},eS=/* @__PURE__ */V("div")({name:"Container",class:"cef8huz",propsAsIs:false}),tS=function tS(){return oe;},nS=/* @__PURE__ */V(tS())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:true}),iS=function iS(){return oe;},sS=/* @__PURE__ */V(iS())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:true}),rS=/* @__PURE__ */V("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:false}),oS=/* @__PURE__ */V("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:false}),lS=/* @__PURE__ */V("div")({name:"Body",class:"barrbyu",propsAsIs:false}),aS=/* @__PURE__ */V("div")({name:"Subtitle",class:"sz7237i",propsAsIs:false}),cS=function cS(_ref237){var t=_ref237.step,e=_ref237.children,n=_ref237.answer,_ref237$state=_ref237.state,i=_ref237$state===void 0?"pending":_ref237$state;var _re73=y.useState(0),_re74=_slicedToArray(_re73,2),s=_re74[0],r=_re74[1],_re75=y.useState(function(){return new ResizeObserver(function(a){window.requestAnimationFrame(function(){var _a$0$contentRect$widt,_a$4;r((_a$0$contentRect$widt=a===null||a===void 0||(_a$4=a[0])===null||_a$4===void 0||(_a$4=_a$4.contentRect)===null||_a$4===void 0?void 0:_a$4.width)!==null&&_a$0$contentRect$widt!==void 0?_a$0$contentRect$widt:0);});});}),_re76=_slicedToArray(_re75,1),o=_re76[0],l=y.useCallback(function(a){a?o.observe(a):o.disconnect();},[o]);return y.useEffect(function(){return function(){o.disconnect();};},[o]),/* @__PURE__ */jsxRuntime.jsxs(eS,{children:[/* @__PURE__ */jsxRuntime.jsx(rS,{children:/* @__PURE__ */jsxRuntime.jsx(sS,{name:"icon-prediction"})}),/* @__PURE__ */jsxRuntime.jsx(oS,{style:{minWidth:"".concat(s,"px")},children:/* @__PURE__ */jsxRuntime.jsx(lS,{children:e},t)}),/* @__PURE__ */jsxRuntime.jsx(aS,{ref:l,className:i,children:/* @__PURE__ */jsxRuntime.jsxs("div",{children:[/* @__PURE__ */jsxRuntime.jsx(nS,{name:"icon-check"}),"Your Pick: ",n]})})]});},hS=/* @__PURE__ */V("div")({name:"Container",class:"ckyzolp",propsAsIs:false}),Ra=/* @__PURE__ */V("div")({name:"Line",class:"l16t1zr7",propsAsIs:false}),uS=function uS(){return Ra;},dS=/* @__PURE__ */V(uS())({name:"Line1",class:"le78kvg",propsAsIs:true}),mS=function mS(){return Ra;},pS=/* @__PURE__ */V(mS())({name:"Line2",class:"l1o7966d",propsAsIs:true}),gS=function gS(){return Ra;},fS=/* @__PURE__ */V(gS())({name:"Line3",class:"lu9lyxq",propsAsIs:true}),bS=function bS(){return/* @__PURE__ */jsxRuntime.jsxs(hS,{children:[/* @__PURE__ */jsxRuntime.jsx(dS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(pS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(fS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})})]});},AS=/* @__PURE__ */V("div")({name:"Container",class:"c10jy6zf",propsAsIs:false}),VS=function VS(){return oe;},RS=/* @__PURE__ */V(VS())({name:"CheckIcon",class:"c1c7scay",propsAsIs:true}),ES=function ES(){return/* @__PURE__ */jsxRuntime.jsxs(AS,{children:[/* @__PURE__ */jsxRuntime.jsx(RS,{name:"icon-check"})," Prediction results are in!"]});},yS=/* @__PURE__ */V("div")({name:"Container",class:"cf6k2yy",propsAsIs:false}),CS=/* @__PURE__ */V("div")({name:"Caption",class:"c1c8xjus",propsAsIs:false}),WS=/* @__PURE__ */V("div")({name:"Title",class:"t1d1uekn",propsAsIs:false}),SS=function SS(_ref238){var t=_ref238.title;return/* @__PURE__ */jsxRuntime.jsxs(yS,{children:[/* @__PURE__ */jsxRuntime.jsx(CS,{children:"Results for"}),/* @__PURE__ */jsxRuntime.jsx(WS,{children:t})]});},i3=/* @__PURE__ */V("div")({name:"Container",class:"c181a1as",propsAsIs:false}),s3=/* @__PURE__ */V("div")({name:"Title",class:"t1cduox6",propsAsIs:false}),ZS=function ZS(){return oe;},r3=/* @__PURE__ */V(ZS())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:true}),IS=function IS(){return r3;},vS=/* @__PURE__ */V(IS())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:true}),NS=function NS(){return/* @__PURE__ */jsxRuntime.jsxs(i3,{children:[/* @__PURE__ */jsxRuntime.jsxs(s3,{children:["Congratulations!",/* @__PURE__ */jsxRuntime.jsx("br",{}),"You answered correctly."]}),/* @__PURE__ */jsxRuntime.jsx(r3,{name:"icon-check"})]});},FS=function FS(_ref239){var t=_ref239.title;return/* @__PURE__ */jsxRuntime.jsxs(i3,{children:[/* @__PURE__ */jsxRuntime.jsxs(s3,{children:["Better luck next time!",/* @__PURE__ */jsxRuntime.jsx("br",{}),"Correct: ",t]}),/* @__PURE__ */jsxRuntime.jsx(vS,{name:"icon-cross"})]});},GS=/* @__PURE__ */V("div")({name:"Container",class:"cnxgcs2",propsAsIs:false}),XS=/* @__PURE__ */V("div")({name:"Title",class:"t903f8n",propsAsIs:false}),US=function US(){return oe;},wS=/* @__PURE__ */V(US())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:true}),BS=function BS(_ref240){var t=_ref240.points;return/* @__PURE__ */jsxRuntime.jsxs(GS,{children:[/* @__PURE__ */jsxRuntime.jsxs(XS,{children:["You won ",/* @__PURE__ */jsxRuntime.jsx(Va,{delay:0.5,prefix:"+",suffix:" points",value:t})]}),/* @__PURE__ */jsxRuntime.jsx(wS,{name:"icon-trophy-solid"})]});},qu=/* @__PURE__ */V("div")({name:"Container",class:"cq3agu2",propsAsIs:false}),ed=/* @__PURE__ */V("div")({name:"Body",class:"b16qj0do",propsAsIs:false}),td={1:3e3,2:4e3,3:4e3,4:4e3},YS=function YS(_ref241){var t=_ref241.close,e=_ref241.action,n=_ref241.setStep,i=_ref241.votedAnswer,s=_ref241.correct,r=_ref241.correctAnswerTitle,o=_ref241.questionTitle,l=_ref241.step;if(y.useEffect(function(){if(n){var _c38=setTimeout(function(){td[l+1]&&(s||l<3)?n(l+1):t===null||t===void 0?void 0:t();},td[l]);return function(){_c38&&clearTimeout(_c38);};}return function(){};},[n,l,t,s]),l===1)return/* @__PURE__ */jsxRuntime.jsx(qu,{children:/* @__PURE__ */jsxRuntime.jsx(ed,{children:/* @__PURE__ */jsxRuntime.jsx(ES,{})})});var a="pending";return (l===3||l===4)&&(a=s?"correct":"incorrect"),/* @__PURE__ */jsxRuntime.jsx(qu,{"data-a":"intr",onClick:function onClick(){return e===null||e===void 0?void 0:e();},children:/* @__PURE__ */jsxRuntime.jsxs(ed,{children:[l!==1&&/* @__PURE__ */jsxRuntime.jsx(bS,{},l),/* @__PURE__ */jsxRuntime.jsxs(cS,{state:a,step:l,answer:(i===null||i===void 0?void 0:i.title)||"unknown",children:[l===2&&/* @__PURE__ */jsxRuntime.jsx(SS,{title:o||"unknown"}),l===3&&s&&/* @__PURE__ */jsxRuntime.jsx(NS,{}),l===3&&!s&&/* @__PURE__ */jsxRuntime.jsx(FS,{title:r||"unknown"}),l===4&&/* @__PURE__ */jsxRuntime.jsx(BS,{points:(i===null||i===void 0?void 0:i.points)||0})]})]})});},TS=function TS(_ref242){var t=_ref242.close,e=_ref242.action,n=_ref242.votedAnswer,i=_ref242.correct,s=_ref242.correctAnswerTitle,r=_ref242.questionTitle;var _re77=y.useState(1),_re78=_slicedToArray(_re77,2),o=_re78[0],l=_re78[1];return/* @__PURE__ */jsxRuntime.jsx(YS,{close:t,action:e,votedAnswer:n,correct:i,correctAnswerTitle:s,questionTitle:r,setStep:l,step:o,title:""});},LS=/* @__PURE__ */V("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:false}),kS=function kS(_ref243){var t=_ref243.className,e=_objectWithoutProperties(_ref243,_excluded13);return/* @__PURE__ */jsxRuntime.jsx(LS,{className:t,children:/* @__PURE__ */jsxRuntime.jsx(TS,_objectSpread2({},e))});},JS=/* @__PURE__ */V("div")({name:"Container",class:"cwa9tgs",propsAsIs:false}),xS=/* @__PURE__ */V("div")({name:"BodyContainer",class:"b1xx7swj",propsAsIs:false}),MS=/* @__PURE__ */V("div")({name:"Body",class:"b1a21en",propsAsIs:false}),QS=function QS(_ref244){var t=_ref244.step,e=_ref244.children,_ref244$state=_ref244.state,n=_ref244$state===void 0?"pending":_ref244$state;var _re79=y.useState(0),_re80=_slicedToArray(_re79,2),i=_re80[0],s=_re80[1];return y.useEffect(function(){var r=new ResizeObserver(function(o){window.requestAnimationFrame(function(){var _o$0$contentRect$widt,_o$;var l=(_o$0$contentRect$widt=o===null||o===void 0||(_o$=o[0])===null||_o$===void 0||(_o$=_o$.contentRect)===null||_o$===void 0?void 0:_o$.width)!==null&&_o$0$contentRect$widt!==void 0?_o$0$contentRect$widt:0;s(l);});});return function(){r.disconnect();};},[]),/* @__PURE__ */jsxRuntime.jsx(JS,{style:{padding:"".concat(t===3&&n==="incorrect"||t===1?"5px 100px":"5px 40px")},children:/* @__PURE__ */jsxRuntime.jsx(xS,{style:{minWidth:"".concat(i,"px")},children:/* @__PURE__ */jsxRuntime.jsx(MS,{children:e},t)})});},zS=/* @__PURE__ */V("div")({name:"Container",class:"c1nd5cu8",propsAsIs:false}),Ea=/* @__PURE__ */V("div")({name:"Line",class:"lgbipw0",propsAsIs:false}),KS=function KS(){return Ea;},HS=/* @__PURE__ */V(KS())({name:"Line1",class:"l1anth16",propsAsIs:true}),OS=function OS(){return Ea;},DS=/* @__PURE__ */V(OS())({name:"Line2",class:"l193yd7v",propsAsIs:true}),PS=function PS(){return Ea;},_S=/* @__PURE__ */V(PS())({name:"Line3",class:"lhbflsp",propsAsIs:true}),jS=function jS(){return/* @__PURE__ */jsxRuntime.jsxs(zS,{children:[/* @__PURE__ */jsxRuntime.jsx(HS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(DS,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})}),/* @__PURE__ */jsxRuntime.jsx(_S,{children:/* @__PURE__ */jsxRuntime.jsx("div",{})})]});},$S=/* @__PURE__ */V("div")({name:"Container",class:"c1lvd429",propsAsIs:false}),qS=function qS(){return oe;},eZ=/* @__PURE__ */V(qS())({name:"PredictionIcon",class:"p1n4m87t",propsAsIs:true}),tZ=function tZ(){return/* @__PURE__ */jsxRuntime.jsxs($S,{children:[/* @__PURE__ */jsxRuntime.jsx(eZ,{name:"icon-prediction"})," Prediction results are in!"]});},nZ=function nZ(){return oe;},iZ=/* @__PURE__ */V(nZ())({name:"CheckIcon",class:"c126r8f9",propsAsIs:true}),sZ=/* @__PURE__ */V("div")({name:"Answer",class:"a1o2rpgl",propsAsIs:false}),rZ=/* @__PURE__ */V("div")({name:"Container",class:"cej6ci1",propsAsIs:false}),oZ=/* @__PURE__ */V("div")({name:"Title",class:"tob24mr",propsAsIs:false}),lZ=function lZ(_ref245){var t=_ref245.title,e=_ref245.answer;return/* @__PURE__ */jsxRuntime.jsxs(rZ,{children:[/* @__PURE__ */jsxRuntime.jsx(oZ,{children:t}),/* @__PURE__ */jsxRuntime.jsxs(sZ,{children:[/* @__PURE__ */jsxRuntime.jsx(iZ,{name:"icon-prediction"}),"Your Pick: ",e]})]});},o3=/* @__PURE__ */V("div")({name:"Container",class:"c1lesal4",propsAsIs:false}),l3=/* @__PURE__ */V("div")({name:"Title",class:"tv66n4w",propsAsIs:false}),aZ=function aZ(){return oe;},cZ=/* @__PURE__ */V(aZ())({name:"CorrectIcon",class:"cx0vlv2",propsAsIs:true}),a3=/* @__PURE__ */V("div")({name:"Answer",class:"akfh4v5",propsAsIs:false}),hZ=function hZ(_ref246){var t=_ref246.answer;return/* @__PURE__ */jsxRuntime.jsxs(o3,{children:[/* @__PURE__ */jsxRuntime.jsx(l3,{children:"Congratulations! You answered correctly."}),/* @__PURE__ */jsxRuntime.jsxs(a3,{children:[/* @__PURE__ */jsxRuntime.jsx(cZ,{name:"icon-correct"}),"Your Pick: ",t]})]});},uZ=function uZ(_ref247){var t=_ref247.title,e=_ref247.answer;return/* @__PURE__ */jsxRuntime.jsxs(o3,{children:[/* @__PURE__ */jsxRuntime.jsxs(l3,{children:["Better luck next time!",/* @__PURE__ */jsxRuntime.jsx("br",{}),"Correct: ",t]}),/* @__PURE__ */jsxRuntime.jsxs(a3,{children:["Your Pick: ",e]})]});},nd=/* @__PURE__ */V("div")({name:"Container",class:"cmox3ot",propsAsIs:false}),id=/* @__PURE__ */V("div")({name:"Body",class:"bqq1ix4",propsAsIs:false}),sd={1:3e3,2:4e3,3:4e3},dZ=function dZ(_ref248){var t=_ref248.close,e=_ref248.action,n=_ref248.setStep,i=_ref248.votedAnswer,s=_ref248.correct,r=_ref248.correctAnswerTitle,o=_ref248.questionTitle,l=_ref248.step;if(y.useEffect(function(){if(n){var _c39=setTimeout(function(){sd[l+1]&&(s||l<3)?n(l+1):t===null||t===void 0?void 0:t();},sd[l]);return function(){_c39&&clearTimeout(_c39);};}return function(){};},[n,l,t,s]),l===1)return/* @__PURE__ */jsxRuntime.jsx(nd,{children:/* @__PURE__ */jsxRuntime.jsx(id,{children:/* @__PURE__ */jsxRuntime.jsx(tZ,{})})});var a="pending";return l===3&&(a=s?"correct":"incorrect"),/* @__PURE__ */jsxRuntime.jsx(nd,{"data-a":"intr",onClick:function onClick(){return e===null||e===void 0?void 0:e();},children:/* @__PURE__ */jsxRuntime.jsxs(id,{children:[l!==1&&/* @__PURE__ */jsxRuntime.jsx(jS,{},l),/* @__PURE__ */jsxRuntime.jsxs(QS,{state:a,step:l,children:[l===2&&/* @__PURE__ */jsxRuntime.jsx(lZ,{title:o||"unknown",answer:(i===null||i===void 0?void 0:i.title)||"unknown"}),l===3&&s&&/* @__PURE__ */jsxRuntime.jsx(hZ,{answer:(i===null||i===void 0?void 0:i.title)||"unknown"}),l===3&&!s&&/* @__PURE__ */jsxRuntime.jsx(uZ,{title:r||"unknown",answer:(i===null||i===void 0?void 0:i.title)||"unknown"})]})]})});},mZ=function mZ(_ref249){var t=_ref249.close,e=_ref249.action,n=_ref249.votedAnswer,i=_ref249.correct,s=_ref249.correctAnswerTitle,r=_ref249.questionTitle;var _re81=y.useState(1),_re82=_slicedToArray(_re81,2),o=_re82[0],l=_re82[1];return/* @__PURE__ */jsxRuntime.jsx(dZ,{close:t,action:e,votedAnswer:n,correct:i,correctAnswerTitle:s,questionTitle:r,setStep:l,step:o,title:""});},c3=/* @__PURE__ */V("div")({name:"NotificationContainer",class:"nn0nqh6",propsAsIs:false}),pZ=function pZ(){return function(_ref250){var t=_ref250.withoutPadding;return t?"0px":"1rem";};},gZ=/* @__PURE__ */V("div")({name:"NotificationContent",class:"n1bcdf3j",propsAsIs:false,vars:{"n1bcdf3j-0":[pZ()]}}),h3=/* @__PURE__ */V("img")({name:"LogoImg",class:"l8jorbq",propsAsIs:false}),fZ=function fZ(){return c3;},bZ=/* @__PURE__ */V(fZ())({name:"NotificationInterstitialContainer",class:"nf920y3",propsAsIs:true}),AZ=/* @__PURE__ */V("div")({name:"LogoImgContainer",class:"lzsmehn",propsAsIs:false}),VZ=function VZ(_ref251){var t=_ref251.className,e=_ref251.sponsorLogo,n=_ref251.onClick;return/* @__PURE__ */jsxRuntime.jsx(bZ,{className:t,onClick:n,children:/* @__PURE__ */jsxRuntime.jsx(gZ,{withoutPadding:true,children:/* @__PURE__ */jsxRuntime.jsx(h3,{src:e})})});},RZ=function RZ(_ref252){var _e$inApp2,_e$inApp3,_e$inApp4,_e$inApp5,_e$inApp6;var t=_ref252.className,e=_objectWithoutProperties(_ref252,_excluded14);var _re83=y.useState(false),_re84=_slicedToArray(_re83,2),n=_re84[0],i=_re84[1],s=y.useRef();return y.useEffect(function(){var _e$inApp;return e!==null&&e!==void 0&&(_e$inApp=e.inApp)!==null&&_e$inApp!==void 0&&_e$inApp.sponsorLogo&&(i(true),s.current=setTimeout(function(){i(false);},5e3)),function(){return clearTimeout(s.current);};},[e===null||e===void 0||(_e$inApp2=e.inApp)===null||_e$inApp2===void 0?void 0:_e$inApp2.sponsorLogo]),e!==null&&e!==void 0&&(_e$inApp3=e.inApp)!==null&&_e$inApp3!==void 0&&_e$inApp3.sponsorLogo&&n?/* @__PURE__ */jsxRuntime.jsx(VZ,{className:t,sponsorLogo:(_e$inApp4=e.inApp)===null||_e$inApp4===void 0?void 0:_e$inApp4.sponsorLogo,onClick:function onClick(){return i(false);}}):/* @__PURE__ */jsxRuntime.jsx(c3,{className:t,children:/* @__PURE__ */jsxRuntime.jsxs("div",{children:[(e===null||e===void 0||(_e$inApp5=e.inApp)===null||_e$inApp5===void 0?void 0:_e$inApp5.sponsorLogo)&&/* @__PURE__ */jsxRuntime.jsx(AZ,{children:/* @__PURE__ */jsxRuntime.jsx(h3,{src:e===null||e===void 0||(_e$inApp6=e.inApp)===null||_e$inApp6===void 0?void 0:_e$inApp6.sponsorLogo})}),/* @__PURE__ */jsxRuntime.jsx(mZ,_objectSpread2({},e))]})});},EZ=function EZ(){return Aa;},yZ=/* @__PURE__ */V(EZ())({name:"OpenedContainer",class:"osyjgip",propsAsIs:true}),Qs=function Qs(_ref253){var _a$data$inApp,_a$data$inApp2,_a$data,_a$data2;var t=_ref253.sdk,e=_ref253.notification;var n=He(t.featuresList.getStore()),_ga3=ga(),i=_ga3.hiding,s=_ga3.onAnimationEnd,r=_ga3.finished,_re85=y.useState(t.getNotificationsStore()),_re86=_slicedToArray(_re85,1),o=_re86[0],l=He(o),a=y.useMemo(function(){return t.getActiveNotification();},[t,l]);y.useEffect(function(){a&&Ke$1.emit("notification",{action:"rendered",payload:{questionId:a.data.questionId,questionType:a.data.questionType}});},[a]);var c=t.getFeature(pe.GAMES);return y.useEffect(function(){r&&(c===null||c===void 0?void 0:c.closeQuestion());},[r,c]),!n||!c?null:e&&a&&a.type===yl.QUESTION_RESOLVED&&a.data.questionType===M.PREDICTION&&a.data.question?((_a$data$inApp=a.data.inApp)===null||_a$data$inApp===void 0?void 0:_a$data$inApp.adUnit)===Qe.STANDART?/* @__PURE__ */jsxRuntime.jsx(RZ,_objectSpread2(_objectSpread2({className:"SL-CardNotificationWebOs",action:a.action,close:a.close},a.data.question),{},{inApp:a.data.inApp})):/* @__PURE__ */jsxRuntime.jsx(kS,_objectSpread2({className:"SL-CardNotificationWebOs",action:a.action,close:a.close},a.data.question)):e&&a&&((_a$data$inApp2=a.data.inApp)===null||_a$data$inApp2===void 0?void 0:_a$data$inApp2.adUnit)===Qe.STANDART?/* @__PURE__ */jsxRuntime.jsx(qW,_objectSpread2(_objectSpread2({className:"SL-CardNotificationWebOs"},a.data),{},{action:a.action,close:a.close,color:(a===null||a===void 0||(_a$data=a.data)===null||_a$data===void 0||(_a$data=_a$data.inApp)===null||_a$data===void 0||(_a$data=_a$data.notification)===null||_a$data===void 0?void 0:_a$data.indicatorColor)||(a===null||a===void 0||(_a$data2=a.data)===null||_a$data2===void 0||(_a$data2=_a$data2.inApp)===null||_a$data2===void 0||(_a$data2=_a$data2.appearance)===null||_a$data2===void 0?void 0:_a$data2.primaryColor)||"",webos:true})):e?null:/* @__PURE__ */jsxRuntime.jsx(yZ,{hiding:i,onAnimationEnd:s,children:/* @__PURE__ */jsxRuntime.jsx(qC,{sdk:t,gamification:c,className:"SL-CardWebOs",webos:true})});};noriginSpatialNavigation.init({shouldFocusDOMNode:true});var CZ=function CZ(_ref254){var t=_ref254.persistent,e=_ref254.children,n=_ref254.sdk,i=_ref254.showPauseAd,s=_ref254.pauseAdVastUrl,r=_ref254.onClosePauseAd,o=_ref254.onRenderPauseAd,l=_ref254.options;var a=He(n.uiState),c=y.useCallback(function(){r===null||r===void 0||r();},[r]);return/* @__PURE__ */jsxRuntime.jsxs(y5,{sdk:n,sidebar:function sidebar(_ref255){var h=_ref255.promo;return a.exposedPauseAd?null:a.polymarket?/* @__PURE__ */jsxRuntime.jsx(_A,{sdk:n,webos:true}):h?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:n,persistent:t,sidebar:"right"}):/* @__PURE__ */jsxRuntime.jsx(Qs,{sdk:n,persistent:t});},notification:function notification(_ref256){var h=_ref256.promo;return a.exposedPauseAd||a.polymarket?null:h?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:n,notification:true,persistent:t}):/* @__PURE__ */jsxRuntime.jsx(Qs,{notification:true,sdk:n,persistent:t});},banner:a.exposedPauseAd||a.polymarket?null:/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:n,persistent:t,banner:"bottom"}),webos:true,children:[e,s&&/* @__PURE__ */jsxRuntime.jsx(K2,{showPauseAd:i,vastUrls:s,sdk:n,onClose:c,onRender:o,options:l}),(l===null||l===void 0?void 0:l.showPolymarketButton)&&/* @__PURE__ */jsxRuntime.jsx(PA,{sdk:n})]});};var WZ=/*#__PURE__*/function(_G2){function WZ(e){var _this134;_classCallCheck(this,WZ);_this134=_callSuper(this,WZ,[e]),_this134.state={hasError:false};return _this134;}_inherits(WZ,_G2);return _createClass(WZ,[{key:"componentDidCatch",value:function componentDidCatch(e,n){console.error("StreamLayerSDKTv error:",e,n.componentStack);}},{key:"render",value:function render(){return this.state.hasError?this.props.children:/* @__PURE__ */jsxRuntime.jsx(CZ,_objectSpread2({},this.props));}}],[{key:"getDerivedStateFromError",value:function getDerivedStateFromError(){return {hasError:true};}}]);}(y.Component);window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var rd;(function(t){t.Init="init",t.Ready="ready",t.Connecting="connecting",t.Connected="connected",t.Disconnected="disconnected",t.Failed="failed",t.Reconnect="reconnect",t.Reconnecting="reconnecting";})(rd||(rd={}));Ki("grpc:stream");se.Unknown,se.Internal,se.DeadlineExceeded,se.ResourceExhausted,se.FailedPrecondition,se.Unavailable,se.DataLoss;Ki("grpc:retry");Bs(10,{description:"Number of attempts to retry"}),Bs(3e4,{description:"Max delay between retries in milliseconds"});var SZ=function SZ(t,e){var _t$createPromiseClien9=t.createPromiseClient(qs,{method:"bypassAuth"}),n=_t$createPromiseClien9.client,i=_t$createPromiseClien9.createRequestOptions,s=i({retryAttempts:0});return n.bypassAuth(e,{contextValues:s});},ve=crypto,Ft=function Ft(t){return t instanceof CryptoKey;},ZZ=/*#__PURE__*/function(){var _ref257=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(t,e){var n;return _regeneratorRuntime().wrap(function _callee63$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:n="SHA-".concat(t.slice(-3));_context70.t0=Uint8Array;_context70.next=4;return ve.subtle.digest(n,e);case 4:_context70.t1=_context70.sent;return _context70.abrupt("return",new _context70.t0(_context70.t1));case 6:case "end":return _context70.stop();}},_callee63);}));return function ZZ(_x97,_x98){return _ref257.apply(this,arguments);};}(),an=new TextEncoder(),u3=new TextDecoder(),zs=Math.pow(2,32);function Oi(){for(var _len19=arguments.length,t=new Array(_len19),_key19=0;_key19<_len19;_key19++){t[_key19]=arguments[_key19];}var e=t.reduce(function(s,_ref258){var r=_ref258.length;return s+r;},0),n=new Uint8Array(e);var i=0;for(var _i66=0,_t7=t;_i66<_t7.length;_i66++){var _s59=_t7[_i66];n.set(_s59,i),i+=_s59.length;}return n;}function IZ(t,e){return Oi(an.encode(t),new Uint8Array([0]),e);}function Sl(t,e,n){if(e<0||e>=zs)throw new RangeError("value must be >= 0 and <= ".concat(zs-1,". Received ").concat(e));t.set([e>>>24,e>>>16,e>>>8,e&255],n);}function vZ(t){var e=Math.floor(t/zs),n=t%zs,i=new Uint8Array(8);return Sl(i,e,0),Sl(i,n,4),i;}function ya(t){var e=new Uint8Array(4);return Sl(e,t),e;}function Ho(t){return Oi(ya(t.length),t);}function NZ(_x99,_x100,_x101){return _NZ.apply(this,arguments);}function _NZ(){_NZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t,e,n){var i,s,_r62,o;return _regeneratorRuntime().wrap(function _callee78$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:i=Math.ceil((e>>3)/32),s=new Uint8Array(i*32);_r62=0;case 2:if(!(_r62<i)){_context85.next=16;break;}o=new Uint8Array(4+t.length+n.length);o.set(ya(_r62+1));o.set(t,4);o.set(n,4+t.length);_context85.t0=s;_context85.next=10;return ZZ("sha256",o);case 10:_context85.t1=_context85.sent;_context85.t2=_r62*32;_context85.t0.set.call(_context85.t0,_context85.t1,_context85.t2);case 13:_r62++;_context85.next=2;break;case 16:return _context85.abrupt("return",s.slice(0,e>>3));case 17:case "end":return _context85.stop();}},_callee78);}));return _NZ.apply(this,arguments);}var FZ=function FZ(t){var e=t;typeof e=="string"&&(e=an.encode(e));var n=32768,i=[];for(var _s60=0;_s60<e.length;_s60+=n)i.push(String.fromCharCode.apply(null,e.subarray(_s60,_s60+n)));return btoa(i.join(""));},lt=function lt(t){return FZ(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");},GZ=function GZ(t){var e=atob(t),n=new Uint8Array(e.length);for(var _i67=0;_i67<e.length;_i67++)n[_i67]=e.charCodeAt(_i67);return n;},mr$1=function mr(t){var e=t;e instanceof Uint8Array&&(e=u3.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return GZ(e);}catch(_unused55){throw new TypeError("The input to be decoded is not correctly encoded.");}};var d3=/*#__PURE__*/function(_Error3){function d3(e){var _Error$captureStackTr;var _this135;_classCallCheck(this,d3);_this135=_callSuper(this,d3,[e]),_this135.code="ERR_JOSE_GENERIC",_this135.name=_this135.constructor.name,(_Error$captureStackTr=Error.captureStackTrace)===null||_Error$captureStackTr===void 0?void 0:_Error$captureStackTr.call(Error,_assertThisInitialized(_this135),_this135.constructor);return _this135;}_inherits(d3,_Error3);return _createClass(d3,null,[{key:"code",get:function get(){return "ERR_JOSE_GENERIC";}}]);}(/*#__PURE__*/_wrapNativeSuper(Error));var _e=/*#__PURE__*/function(_d9){function _e(){var _this136;_classCallCheck(this,_e);_this136=_callSuper(this,_e,arguments),_this136.code="ERR_JOSE_NOT_SUPPORTED";return _this136;}_inherits(_e,_d9);return _createClass(_e,null,[{key:"code",get:function get(){return "ERR_JOSE_NOT_SUPPORTED";}}]);}(d3);var sn=/*#__PURE__*/function(_d0){function sn(){var _this137;_classCallCheck(this,sn);_this137=_callSuper(this,sn,arguments),_this137.code="ERR_JWE_INVALID";return _this137;}_inherits(sn,_d0);return _createClass(sn,null,[{key:"code",get:function get(){return "ERR_JWE_INVALID";}}]);}(d3);var Ca=ve.getRandomValues.bind(ve);function m3(t){switch(t){case "A128GCM":case "A128GCMKW":case "A192GCM":case "A192GCMKW":case "A256GCM":case "A256GCMKW":return 96;case "A128CBC-HS256":case "A192CBC-HS384":case "A256CBC-HS512":return 128;default:throw new _e("Unsupported JWE Algorithm: ".concat(t));}}var XZ=function XZ(t){return Ca(new Uint8Array(m3(t)>>3));},UZ=function UZ(t,e){if(e.length<<3!==m3(t))throw new sn("Invalid Initialization Vector length");},od=function od(t,e){var n=t.byteLength<<3;if(n!==e)throw new sn("Invalid Content Encryption Key length. Expected ".concat(e," bits, got ").concat(n," bits"));};function nn(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"algorithm.name";return new TypeError("CryptoKey does not support this operation, its ".concat(e," must be ").concat(t));}function bs(t,e){return t.name===e;}function wZ(t){return parseInt(t.name.slice(4),10);}function BZ(t,e){if(e.length&&!e.some(function(n){return t.usages.includes(n);})){var n="CryptoKey does not support this operation, its usages must include ";if(e.length>2){var _i68=e.pop();n+="one of ".concat(e.join(", "),", or ").concat(_i68,".");}else e.length===2?n+="one of ".concat(e[0]," or ").concat(e[1],"."):n+="".concat(e[0],".");throw new TypeError(n);}}function ci(t,e){switch(e){case "A128GCM":case "A192GCM":case "A256GCM":{if(!bs(t.algorithm,"AES-GCM"))throw nn("AES-GCM");var _i69=parseInt(e.slice(1,4),10);if(t.algorithm.length!==_i69)throw nn(_i69,"algorithm.length");break;}case "A128KW":case "A192KW":case "A256KW":{if(!bs(t.algorithm,"AES-KW"))throw nn("AES-KW");var _i70=parseInt(e.slice(1,4),10);if(t.algorithm.length!==_i70)throw nn(_i70,"algorithm.length");break;}case "ECDH":{switch(t.algorithm.name){case "ECDH":case "X25519":case "X448":break;default:throw nn("ECDH, X25519, or X448");}break;}case "PBES2-HS256+A128KW":case "PBES2-HS384+A192KW":case "PBES2-HS512+A256KW":if(!bs(t.algorithm,"PBKDF2"))throw nn("PBKDF2");break;case "RSA-OAEP":case "RSA-OAEP-256":case "RSA-OAEP-384":case "RSA-OAEP-512":{if(!bs(t.algorithm,"RSA-OAEP"))throw nn("RSA-OAEP");var _i71=parseInt(e.slice(9),10)||1;if(wZ(t.algorithm.hash)!==_i71)throw nn("SHA-".concat(_i71),"algorithm.hash");break;}default:throw new TypeError("CryptoKey does not support this operation");}for(var _len20=arguments.length,n=new Array(_len20>2?_len20-2:0),_key20=2;_key20<_len20;_key20++){n[_key20-2]=arguments[_key20];}BZ(t,n);}function p3(t,e){var _e$constructor;for(var _len21=arguments.length,n=new Array(_len21>2?_len21-2:0),_key21=2;_key21<_len21;_key21++){n[_key21-2]=arguments[_key21];}if(n=n.filter(Boolean),n.length>2){var _i72=n.pop();t+="one of type ".concat(n.join(", "),", or ").concat(_i72,".");}else n.length===2?t+="one of type ".concat(n[0]," or ").concat(n[1],"."):t+="of type ".concat(n[0],".");return e==null?t+=" Received ".concat(e):typeof e=="function"&&e.name?t+=" Received function ".concat(e.name):_typeof(e)=="object"&&e!=null&&((_e$constructor=e.constructor)===null||_e$constructor===void 0?void 0:_e$constructor.name)&&(t+=" Received an instance of ".concat(e.constructor.name)),t;}var Gt=function Gt(t){for(var _len22=arguments.length,e=new Array(_len22>1?_len22-1:0),_key22=1;_key22<_len22;_key22++){e[_key22-1]=arguments[_key22];}return p3.apply(void 0,["Key must be ",t].concat(e));};function g3(t,e){for(var _len23=arguments.length,n=new Array(_len23>2?_len23-2:0),_key23=2;_key23<_len23;_key23++){n[_key23-2]=arguments[_key23];}return p3.apply(void 0,["Key for the ".concat(t," algorithm must be "),e].concat(n));}var f3=function f3(t){return Ft(t)?true:(t===null||t===void 0?void 0:t[Symbol.toStringTag])==="KeyObject";},Vt=["CryptoKey"],YZ=function YZ(){for(var _len24=arguments.length,t=new Array(_len24),_key24=0;_key24<_len24;_key24++){t[_key24]=arguments[_key24];}var e=t.filter(Boolean);if(e.length===0||e.length===1)return true;var n;var _iterator127=_createForOfIteratorHelper(e),_step127;try{for(_iterator127.s();!(_step127=_iterator127.n()).done;){var _i73=_step127.value;var _s61=Object.keys(_i73);if(!n||n.size===0){n=new Set(_s61);continue;}for(var _i74=0,_s62=_s61;_i74<_s62.length;_i74++){var _r61=_s62[_i74];if(n.has(_r61))return !1;n.add(_r61);}}}catch(err){_iterator127.e(err);}finally{_iterator127.f();}return true;};function TZ(t){return _typeof(t)=="object"&&t!==null;}function Wa(t){if(!TZ(t)||Object.prototype.toString.call(t)!=="[object Object]")return false;if(Object.getPrototypeOf(t)===null)return true;var e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e;}var b3=[{hash:"SHA-256",name:"HMAC"},true,["sign"]];function LZ(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError("Invalid key size for alg: ".concat(e));}function kZ(t,e,n){if(Ft(t))return ci(t,e,n),t;if(t instanceof Uint8Array)return ve.subtle.importKey("raw",t,"AES-KW",true,[n]);throw new TypeError(Gt.apply(void 0,[t].concat(Vt,["Uint8Array"])));}var Zl=/*#__PURE__*/function(){var _ref259=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(t,e,n){var _ve$subtle;var i,s;return _regeneratorRuntime().wrap(function _callee64$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:_context71.next=2;return kZ(e,t,"wrapKey");case 2:i=_context71.sent;LZ(i,t);_context71.next=6;return (_ve$subtle=ve.subtle).importKey.apply(_ve$subtle,["raw",n].concat(b3));case 6:s=_context71.sent;_context71.t0=Uint8Array;_context71.next=10;return ve.subtle.wrapKey("raw",s,i,"AES-KW");case 10:_context71.t1=_context71.sent;return _context71.abrupt("return",new _context71.t0(_context71.t1));case 12:case "end":return _context71.stop();}},_callee64);}));return function Zl(_x102,_x103,_x104){return _ref259.apply(this,arguments);};}();function JZ(_x105,_x106,_x107,_x108){return _JZ.apply(this,arguments);}function _JZ(){_JZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t,e,n,i){var s,r,o,l,a,_args86=arguments;return _regeneratorRuntime().wrap(function _callee79$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:s=_args86.length>4&&_args86[4]!==undefined?_args86[4]:new Uint8Array(0);r=_args86.length>5&&_args86[5]!==undefined?_args86[5]:new Uint8Array(0);if(Ft(t)){_context86.next=4;break;}throw new TypeError(Gt.apply(void 0,[t].concat(Vt)));case 4:if(!(ci(t,"ECDH"),!Ft(e))){_context86.next=6;break;}throw new TypeError(Gt.apply(void 0,[e].concat(Vt)));case 6:ci(e,"ECDH","deriveBits");o=Oi(Ho(an.encode(n)),Ho(s),Ho(r),ya(i));t.algorithm.name==="X25519"?l=256:t.algorithm.name==="X448"?l=448:l=Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3),10)/8)<<3;_context86.t0=Uint8Array;_context86.next=12;return ve.subtle.deriveBits({name:t.algorithm.name,public:t},e,l);case 12:_context86.t1=_context86.sent;a=new _context86.t0(_context86.t1);return _context86.abrupt("return",NZ(a,i,o));case 15:case "end":return _context86.stop();}},_callee79);}));return _JZ.apply(this,arguments);}function xZ(_x109){return _xZ.apply(this,arguments);}function _xZ(){_xZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){return _regeneratorRuntime().wrap(function _callee80$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:if(Ft(t)){_context87.next=2;break;}throw new TypeError(Gt.apply(void 0,[t].concat(Vt)));case 2:return _context87.abrupt("return",ve.subtle.generateKey(t.algorithm,true,["deriveBits"]));case 3:case "end":return _context87.stop();}},_callee80);}));return _xZ.apply(this,arguments);}function MZ(t){if(!Ft(t))throw new TypeError(Gt.apply(void 0,[t].concat(Vt)));return ["P-256","P-384","P-521"].includes(t.algorithm.namedCurve)||t.algorithm.name==="X25519"||t.algorithm.name==="X448";}function QZ(t){if(!(t instanceof Uint8Array)||t.length<8)throw new sn("PBES2 Salt Input must be 8 or more octets");}function zZ(t,e){if(t instanceof Uint8Array)return ve.subtle.importKey("raw",t,"PBKDF2",false,["deriveBits"]);if(Ft(t))return ci(t,e,"deriveBits","deriveKey"),t;throw new TypeError(Gt.apply(void 0,[t].concat(Vt,["Uint8Array"])));}function KZ(_x110,_x111,_x112,_x113){return _KZ.apply(this,arguments);}function _KZ(){_KZ=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(t,e,n,i){var s,r,o,l,a;return _regeneratorRuntime().wrap(function _callee81$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:QZ(t);s=IZ(e,t);r=parseInt(e.slice(13,16),10);o={hash:"SHA-".concat(e.slice(8,11)),iterations:n,name:"PBKDF2",salt:s};l={length:r,name:"AES-KW"};_context88.next=7;return zZ(i,e);case 7:a=_context88.sent;if(!a.usages.includes("deriveBits")){_context88.next=14;break;}_context88.t0=Uint8Array;_context88.next=12;return ve.subtle.deriveBits(o,a,r);case 12:_context88.t1=_context88.sent;return _context88.abrupt("return",new _context88.t0(_context88.t1));case 14:if(!a.usages.includes("deriveKey")){_context88.next=16;break;}return _context88.abrupt("return",ve.subtle.deriveKey(o,a,l,false,["wrapKey","unwrapKey"]));case 16:throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');case 17:case "end":return _context88.stop();}},_callee81);}));return _KZ.apply(this,arguments);}var HZ=/*#__PURE__*/function(){var _ref260=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t,e,n){var i,s,r,_args72=arguments;return _regeneratorRuntime().wrap(function _callee65$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:i=_args72.length>3&&_args72[3]!==undefined?_args72[3]:2048;s=_args72.length>4&&_args72[4]!==undefined?_args72[4]:Ca(new Uint8Array(16));_context72.next=4;return KZ(s,t,i,e);case 4:r=_context72.sent;_context72.next=7;return Zl(t.slice(-6),r,n);case 7:_context72.t0=_context72.sent;_context72.t1=i;_context72.t2=lt(s);return _context72.abrupt("return",{encryptedKey:_context72.t0,p2c:_context72.t1,p2s:_context72.t2});case 11:case "end":return _context72.stop();}},_callee65);}));return function HZ(_x114,_x115,_x116){return _ref260.apply(this,arguments);};}();function ld(t){switch(t){case "RSA-OAEP":case "RSA-OAEP-256":case "RSA-OAEP-384":case "RSA-OAEP-512":return "RSA-OAEP";default:throw new _e("alg ".concat(t," is not supported either by JOSE or your javascript runtime"));}}var OZ=function OZ(t,e){if(t.startsWith("RS")||t.startsWith("PS")){var n=e.algorithm.modulusLength;if(typeof n!="number"||n<2048)throw new TypeError("".concat(t," requires key modulusLength to be 2048 bits or larger"));}},DZ=/*#__PURE__*/function(){var _ref261=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t,e,n){var _ve$subtle2,_i75;return _regeneratorRuntime().wrap(function _callee66$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:if(Ft(e)){_context73.next=2;break;}throw new TypeError(Gt.apply(void 0,[e].concat(Vt)));case 2:if(!(ci(e,t,"encrypt","wrapKey"),OZ(t,e),e.usages.includes("encrypt"))){_context73.next=8;break;}_context73.t0=Uint8Array;_context73.next=6;return ve.subtle.encrypt(ld(t),e,n);case 6:_context73.t1=_context73.sent;return _context73.abrupt("return",new _context73.t0(_context73.t1));case 8:if(!e.usages.includes("wrapKey")){_context73.next=17;break;}_context73.next=11;return (_ve$subtle2=ve.subtle).importKey.apply(_ve$subtle2,["raw",n].concat(b3));case 11:_i75=_context73.sent;_context73.t2=Uint8Array;_context73.next=15;return ve.subtle.wrapKey("raw",_i75,e,ld(t));case 15:_context73.t3=_context73.sent;return _context73.abrupt("return",new _context73.t2(_context73.t3));case 17:throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation');case 18:case "end":return _context73.stop();}},_callee66);}));return function DZ(_x117,_x118,_x119){return _ref261.apply(this,arguments);};}();function Di(t){return Wa(t)&&typeof t.kty=="string";}function PZ(t){return t.kty!=="oct"&&typeof t.d=="string";}function _Z(t){return t.kty!=="oct"&&_typeof(t.d)>"u";}function jZ(t){return Di(t)&&t.kty==="oct"&&typeof t.k=="string";}function $Z(t){var e,n;switch(t.kty){case "RSA":{switch(t.alg){case "PS256":case "PS384":case "PS512":e={name:"RSA-PSS",hash:"SHA-".concat(t.alg.slice(-3))},n=t.d?["sign"]:["verify"];break;case "RS256":case "RS384":case "RS512":e={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(t.alg.slice(-3))},n=t.d?["sign"]:["verify"];break;case "RSA-OAEP":case "RSA-OAEP-256":case "RSA-OAEP-384":case "RSA-OAEP-512":e={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(t.alg.slice(-3),10)||1)},n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new _e('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');}break;}case "EC":{switch(t.alg){case "ES256":e={name:"ECDSA",namedCurve:"P-256"},n=t.d?["sign"]:["verify"];break;case "ES384":e={name:"ECDSA",namedCurve:"P-384"},n=t.d?["sign"]:["verify"];break;case "ES512":e={name:"ECDSA",namedCurve:"P-521"},n=t.d?["sign"]:["verify"];break;case "ECDH-ES":case "ECDH-ES+A128KW":case "ECDH-ES+A192KW":case "ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new _e('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');}break;}case "OKP":{switch(t.alg){case "EdDSA":e={name:t.crv},n=t.d?["sign"]:["verify"];break;case "ECDH-ES":case "ECDH-ES+A128KW":case "ECDH-ES+A192KW":case "ECDH-ES+A256KW":e={name:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new _e('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');}break;}default:throw new _e('Invalid or unsupported JWK "kty" (Key Type) Parameter value');}return {algorithm:e,keyUsages:n};}var A3=/*#__PURE__*/function(){var _ref262=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){var _t$ext,_t$key_ops,_ve$subtle3;var _$Z,e,n,i,s;return _regeneratorRuntime().wrap(function _callee67$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:if(t.alg){_context74.next=2;break;}throw new TypeError('"alg" argument is required when "jwk.alg" is not present');case 2:_$Z=$Z(t),e=_$Z.algorithm,n=_$Z.keyUsages,i=[e,(_t$ext=t.ext)!==null&&_t$ext!==void 0?_t$ext:false,(_t$key_ops=t.key_ops)!==null&&_t$key_ops!==void 0?_t$key_ops:n],s=_objectSpread2({},t);return _context74.abrupt("return",(delete s.alg,delete s.use,(_ve$subtle3=ve.subtle).importKey.apply(_ve$subtle3,["jwk",s].concat(i))));case 4:case "end":return _context74.stop();}},_callee67);}));return function A3(_x120){return _ref262.apply(this,arguments);};}(),V3=function V3(t){return mr$1(t);};var Jn,xn;var R3=function R3(t){return (t===null||t===void 0?void 0:t[Symbol.toStringTag])==="KeyObject";},Ks=/*#__PURE__*/function(){var _ref263=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t,e,n,i){var s,r,o,_args75=arguments;return _regeneratorRuntime().wrap(function _callee68$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:s=_args75.length>4&&_args75[4]!==undefined?_args75[4]:false;r=t.get(e);if(!(r!==null&&r!==void 0&&r[i])){_context75.next=4;break;}return _context75.abrupt("return",r[i]);case 4:_context75.next=6;return A3(_objectSpread2(_objectSpread2({},n),{},{alg:i}));case 6:o=_context75.sent;return _context75.abrupt("return",(s&&Object.freeze(e),r?r[i]=o:t.set(e,_defineProperty({},i,o)),o));case 8:case "end":return _context75.stop();}},_callee68);}));return function Ks(_x121,_x122,_x123,_x124){return _ref263.apply(this,arguments);};}(),qZ=function qZ(t,e){if(R3(t)){var n=t.export({format:"jwk"});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?V3(n.k):(xn||(xn=/* @__PURE__ */new WeakMap()),Ks(xn,t,n,e));}return Di(t)?t.k?mr$1(t.k):(xn||(xn=/* @__PURE__ */new WeakMap()),Ks(xn,t,t,e,true)):t;},eI=function eI(t,e){if(R3(t)){var n=t.export({format:"jwk"});return n.k?V3(n.k):(Jn||(Jn=/* @__PURE__ */new WeakMap()),Ks(Jn,t,n,e));}return Di(t)?t.k?mr$1(t.k):(Jn||(Jn=/* @__PURE__ */new WeakMap()),Ks(Jn,t,t,e,true)):t;},tI={normalizePublicKey:qZ,normalizePrivateKey:eI};function E3(t){switch(t){case "A128GCM":return 128;case "A192GCM":return 192;case "A256GCM":case "A128CBC-HS256":return 256;case "A192CBC-HS384":return 384;case "A256CBC-HS512":return 512;default:throw new _e("Unsupported JWE Algorithm: ".concat(t));}}var Ei=function Ei(t){return Ca(new Uint8Array(E3(t)>>3));};function nI(_x125,_x126){return _nI.apply(this,arguments);}function _nI(){_nI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(t,e){return _regeneratorRuntime().wrap(function _callee82$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:if(Wa(t)){_context89.next=2;break;}throw new TypeError("JWK must be an object");case 2:_context89.t0=(e||(e=t.alg),t.kty);_context89.next=_context89.t0==="oct"?5:_context89.t0==="RSA"?8:_context89.t0==="EC"?10:_context89.t0==="OKP"?10:11;break;case 5:if(!(typeof t.k!="string"||!t.k)){_context89.next=7;break;}throw new TypeError('missing "k" (Key Value) Parameter value');case 7:return _context89.abrupt("return",mr$1(t.k));case 8:if(!(t.oth!==void 0)){_context89.next=10;break;}throw new _e('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case 10:return _context89.abrupt("return",A3(_objectSpread2(_objectSpread2({},t),{},{alg:e})));case 11:throw new _e('Unsupported "kty" (Key Type) Parameter value');case 12:case "end":return _context89.stop();}},_callee82);}));return _nI.apply(this,arguments);}var Qn=function Qn(t){return t===null||t===void 0?void 0:t[Symbol.toStringTag];},Il=function Il(t,e,n){var _e$key_ops$includes,_e$key_ops;if(e.use!==void 0&&e.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(e.key_ops!==void 0&&((_e$key_ops$includes=(_e$key_ops=e.key_ops).includes)===null||_e$key_ops$includes===void 0?void 0:_e$key_ops$includes.call(_e$key_ops,n))!==true)throw new TypeError("Invalid key for this operation, when present its key_ops must include ".concat(n));if(e.alg!==void 0&&e.alg!==t)throw new TypeError("Invalid key for this operation, when present its alg must be ".concat(t));return true;},iI=function iI(t,e,n,i){if(!(e instanceof Uint8Array)){if(i&&Di(e)){if(jZ(e)&&Il(t,e,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');}if(!f3(e))throw new TypeError(g3.apply(void 0,[t,e].concat(Vt,["Uint8Array",i?"JSON Web Key":null])));if(e.type!=="secret")throw new TypeError("".concat(Qn(e)," instances for symmetric algorithms must be of type \"secret\""));}},sI=function sI(t,e,n,i){if(i&&Di(e))switch(n){case "sign":if(PZ(e)&&Il(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case "verify":if(_Z(e)&&Il(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK");}if(!f3(e))throw new TypeError(g3.apply(void 0,[t,e].concat(Vt,[i?"JSON Web Key":null])));if(e.type==="secret")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithms must not be of type \"secret\""));if(n==="sign"&&e.type==="public")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm signing must be of type \"private\""));if(n==="decrypt"&&e.type==="public")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm decryption must be of type \"private\""));if(e.algorithm&&n==="verify"&&e.type==="private")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm verifying must be of type \"public\""));if(e.algorithm&&n==="encrypt"&&e.type==="private")throw new TypeError("".concat(Qn(e)," instances for asymmetric algorithm encryption must be of type \"public\""));};function y3(t,e,n,i){e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?iI(e,n,i,t):sI(e,n,i,t);}var rI=y3.bind(void 0,false);y3.bind(void 0,true);function oI(_x127,_x128,_x129,_x130,_x131){return _oI.apply(this,arguments);}function _oI(){_oI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(t,e,n,i,s){var r,o,l,a,c,h;return _regeneratorRuntime().wrap(function _callee83$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:if(n instanceof Uint8Array){_context90.next=2;break;}throw new TypeError(Gt(n,"Uint8Array"));case 2:r=parseInt(t.slice(1,4),10);_context90.next=5;return ve.subtle.importKey("raw",n.subarray(r>>3),"AES-CBC",false,["encrypt"]);case 5:o=_context90.sent;_context90.next=8;return ve.subtle.importKey("raw",n.subarray(0,r>>3),{hash:"SHA-".concat(r<<1),name:"HMAC"},false,["sign"]);case 8:l=_context90.sent;_context90.t0=Uint8Array;_context90.next=12;return ve.subtle.encrypt({iv:i,name:"AES-CBC"},o,e);case 12:_context90.t1=_context90.sent;a=new _context90.t0(_context90.t1);c=Oi(s,i,a,vZ(s.length<<3));_context90.t2=Uint8Array;_context90.next=18;return ve.subtle.sign("HMAC",l,c);case 18:_context90.t3=_context90.sent.slice(0,r>>3);h=new _context90.t2(_context90.t3);return _context90.abrupt("return",{ciphertext:a,tag:h,iv:i});case 21:case "end":return _context90.stop();}},_callee83);}));return _oI.apply(this,arguments);}function lI(_x132,_x133,_x134,_x135,_x136){return _lI.apply(this,arguments);}function _lI(){_lI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(t,e,n,i,s){var r,o,l;return _regeneratorRuntime().wrap(function _callee84$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:if(!(n instanceof Uint8Array)){_context91.next=6;break;}_context91.next=3;return ve.subtle.importKey("raw",n,"AES-GCM",false,["encrypt"]);case 3:r=_context91.sent;_context91.next=7;break;case 6:ci(n,t,"encrypt"),r=n;case 7:_context91.t0=Uint8Array;_context91.next=10;return ve.subtle.encrypt({additionalData:s,iv:i,name:"AES-GCM",tagLength:128},r,e);case 10:_context91.t1=_context91.sent;o=new _context91.t0(_context91.t1);l=o.slice(-16);return _context91.abrupt("return",{ciphertext:o.slice(0,-16),tag:l,iv:i});case 14:case "end":return _context91.stop();}},_callee84);}));return _lI.apply(this,arguments);}var C3=/*#__PURE__*/function(){var _ref264=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(t,e,n,i,s){return _regeneratorRuntime().wrap(function _callee69$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:if(!(!Ft(n)&&!(n instanceof Uint8Array))){_context76.next=2;break;}throw new TypeError(Gt.apply(void 0,[n].concat(Vt,["Uint8Array"])));case 2:_context76.t0=(i?UZ(t,i):i=XZ(t),t);_context76.next=_context76.t0==="A128CBC-HS256"?5:_context76.t0==="A192CBC-HS384"?5:_context76.t0==="A256CBC-HS512"?5:_context76.t0==="A128GCM"?6:_context76.t0==="A192GCM"?6:_context76.t0==="A256GCM"?6:7;break;case 5:return _context76.abrupt("return",(n instanceof Uint8Array&&od(n,parseInt(t.slice(-3),10)),oI(t,e,n,i,s)));case 6:return _context76.abrupt("return",(n instanceof Uint8Array&&od(n,parseInt(t.slice(1,4),10)),lI(t,e,n,i,s)));case 7:throw new _e("Unsupported JWE Content Encryption Algorithm");case 8:case "end":return _context76.stop();}},_callee69);}));return function C3(_x137,_x138,_x139,_x140,_x141){return _ref264.apply(this,arguments);};}();function aI(_x142,_x143,_x144,_x145){return _aI.apply(this,arguments);}function _aI(){_aI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t,e,n,i){var s,r;return _regeneratorRuntime().wrap(function _callee85$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:s=t.slice(0,7);_context92.next=3;return C3(s,n,e,i,new Uint8Array(0));case 3:r=_context92.sent;return _context92.abrupt("return",{encryptedKey:r.ciphertext,iv:lt(r.iv),tag:lt(r.tag)});case 5:case "end":return _context92.stop();}},_callee85);}));return _aI.apply(this,arguments);}function cI(t,e,n,i,s){if(s.crit!==void 0&&(i===null||i===void 0?void 0:i.crit)===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||i.crit===void 0)return/* @__PURE__ */new Set();if(!Array.isArray(i.crit)||i.crit.length===0||i.crit.some(function(o){return typeof o!="string"||o.length===0;}))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');var r;n!==void 0?r=new Map([].concat(_toConsumableArray(Object.entries(n)),_toConsumableArray(e.entries()))):r=e;var _iterator128=_createForOfIteratorHelper(i.crit),_step128;try{for(_iterator128.s();!(_step128=_iterator128.n()).done;){var o=_step128.value;if(!r.has(o))throw new _e("Extension Header Parameter \"".concat(o,"\" is not recognized"));if(s[o]===void 0)throw new t("Extension Header Parameter \"".concat(o,"\" is missing"));if(r.get(o)&&i[o]===void 0)throw new t("Extension Header Parameter \"".concat(o,"\" MUST be integrity protected"));}}catch(err){_iterator128.e(err);}finally{_iterator128.f();}return new Set(i.crit);}var hI=/* @__PURE__ */Symbol(),uI=/*#__PURE__*/function(){var _ref265=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t){var _yield$ve$subtle$expo,r;return _regeneratorRuntime().wrap(function _callee70$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:if(!(t instanceof Uint8Array)){_context77.next=2;break;}return _context77.abrupt("return",{kty:"oct",k:lt(t)});case 2:if(Ft(t)){_context77.next=4;break;}throw new TypeError(Gt.apply(void 0,[t].concat(Vt,["Uint8Array"])));case 4:if(t.extractable){_context77.next=6;break;}throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");case 6:_context77.next=8;return ve.subtle.exportKey("jwk",t);case 8:_yield$ve$subtle$expo=_context77.sent;_yield$ve$subtle$expo.ext;_yield$ve$subtle$expo.key_ops;_yield$ve$subtle$expo.alg;_yield$ve$subtle$expo.use;r=_objectWithoutProperties(_yield$ve$subtle$expo,_excluded15);return _context77.abrupt("return",r);case 15:case "end":return _context77.stop();}},_callee70);}));return function uI(_x146){return _ref265.apply(this,arguments);};}();function dI(_x147){return _dI.apply(this,arguments);}function _dI(){_dI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t){return _regeneratorRuntime().wrap(function _callee86$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:return _context93.abrupt("return",uI(t));case 1:case "end":return _context93.stop();}},_callee86);}));return _dI.apply(this,arguments);}function mI(_x148,_x149,_x150,_x151){return _mI.apply(this,arguments);}function _mI(){_mI=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t,e,n,i){var _tI$normalizePublicKe;var s,r,o,l,a,_c40,_h30,_yield$dI,u,d,m,p,g,A,_a16,_c41,_yield$HZ,_a17,_yield$aI,_args94=arguments;return _regeneratorRuntime().wrap(function _callee87$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:s=_args94.length>4&&_args94[4]!==undefined?_args94[4]:{};rI(t,n,"encrypt");_context94.next=4;return (_tI$normalizePublicKe=tI.normalizePublicKey)===null||_tI$normalizePublicKe===void 0?void 0:_tI$normalizePublicKe.call(tI,n,t);case 4:_context94.t1=_context94.sent;if(_context94.t1){_context94.next=7;break;}_context94.t1=n;case 7:n=_context94.t1;_context94.t0=t;_context94.next=_context94.t0==="dir"?11:_context94.t0==="ECDH-ES"?13:_context94.t0==="ECDH-ES+A128KW"?13:_context94.t0==="ECDH-ES+A192KW"?13:_context94.t0==="ECDH-ES+A256KW"?13:_context94.t0==="RSA1_5"?41:_context94.t0==="RSA-OAEP"?41:_context94.t0==="RSA-OAEP-256"?41:_context94.t0==="RSA-OAEP-384"?41:_context94.t0==="RSA-OAEP-512"?41:_context94.t0==="PBES2-HS256+A128KW"?46:_context94.t0==="PBES2-HS384+A192KW"?46:_context94.t0==="PBES2-HS512+A256KW"?46:_context94.t0==="A128KW"?55:_context94.t0==="A192KW"?55:_context94.t0==="A256KW"?55:_context94.t0==="A128GCMKW"?60:_context94.t0==="A192GCMKW"?60:_context94.t0==="A256GCMKW"?60:69;break;case 11:l=n;return _context94.abrupt("break",70);case 13:if(MZ(n)){_context94.next=15;break;}throw new _e("ECDH with the provided key is not allowed or not supported by your javascript runtime");case 15:a=s.apu,_c40=s.apv;_h30=s.epk;_context94.t2=_h30;if(_context94.t2){_context94.next=22;break;}_context94.next=21;return xZ(n);case 21:_h30=_context94.sent.privateKey;case 22:_context94.next=24;return dI(_h30);case 24:_yield$dI=_context94.sent;u=_yield$dI.x;d=_yield$dI.y;m=_yield$dI.crv;p=_yield$dI.kty;_context94.next=31;return JZ(n,_h30,t==="ECDH-ES"?e:t,t==="ECDH-ES"?E3(e):parseInt(t.slice(-5,-2),10),a,_c40);case 31:g=_context94.sent;if(!(o={epk:{x:u,crv:m,kty:p}},p==="EC"&&(o.epk.y=d),a&&(o.apu=lt(a)),_c40&&(o.apv=lt(_c40)),t==="ECDH-ES")){_context94.next=35;break;}l=g;return _context94.abrupt("break",70);case 35:l=i||Ei(e);A=t.slice(-6);_context94.next=39;return Zl(A,g,l);case 39:r=_context94.sent;return _context94.abrupt("break",70);case 41:l=i||Ei(e);_context94.next=44;return DZ(t,n,l);case 44:r=_context94.sent;return _context94.abrupt("break",70);case 46:l=i||Ei(e);_a16=s.p2c,_c41=s.p2s;_context94.next=50;return HZ(t,n,l,_a16,_c41);case 50:_yield$HZ=_context94.sent;r=_yield$HZ.encryptedKey;o=_objectWithoutProperties(_yield$HZ,_excluded18);return _context94.abrupt("break",70);case 55:l=i||Ei(e);_context94.next=58;return Zl(t,n,l);case 58:r=_context94.sent;return _context94.abrupt("break",70);case 60:l=i||Ei(e);_a17=s.iv;_context94.next=64;return aI(t,n,l,_a17);case 64:_yield$aI=_context94.sent;r=_yield$aI.encryptedKey;o=_objectWithoutProperties(_yield$aI,_excluded19);return _context94.abrupt("break",70);case 69:throw new _e('Invalid or unsupported "alg" (JWE Algorithm) header value');case 70:return _context94.abrupt("return",{cek:l,encryptedKey:r,parameters:o});case 71:case "end":return _context94.stop();}},_callee87);}));return _mI.apply(this,arguments);}var pI=/*#__PURE__*/function(){function pI(e){_classCallCheck(this,pI);if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e;}return _createClass(pI,[{key:"setKeyManagementParameters",value:function setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this;}},{key:"setProtectedHeader",value:function setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this;}},{key:"setSharedUnprotectedHeader",value:function setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this;}},{key:"setUnprotectedHeader",value:function setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this;}},{key:"setAdditionalAuthenticatedData",value:function setAdditionalAuthenticatedData(e){return this._aad=e,this;}},{key:"setContentEncryptionKey",value:function setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this;}},{key:"setInitializationVector",value:function setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this;}},{key:"encrypt",value:function(){var _encrypt=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e,n){var i,s,r,o,l,_yield$mI,g,a,c,h,_yield$C,u,d,m,p;return _regeneratorRuntime().wrap(function _callee71$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:if(!(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)){_context78.next=2;break;}throw new sn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");case 2:if(YZ(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader)){_context78.next=4;break;}throw new sn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");case 4:i=_objectSpread2(_objectSpread2(_objectSpread2({},this._protectedHeader),this._unprotectedHeader),this._sharedUnprotectedHeader);if(!(cI(sn,/* @__PURE__ */new Map(),n===null||n===void 0?void 0:n.crit,this._protectedHeader,i),i.zip!==void 0)){_context78.next=7;break;}throw new _e('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');case 7:s=i.alg,r=i.enc;if(!(typeof s!="string"||!s)){_context78.next=10;break;}throw new sn('JWE "alg" (Algorithm) Header Parameter missing or invalid');case 10:if(!(typeof r!="string"||!r)){_context78.next=12;break;}throw new sn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');case 12:if(!(this._cek&&(s==="dir"||s==="ECDH-ES"))){_context78.next=14;break;}throw new TypeError("setContentEncryptionKey cannot be called with JWE \"alg\" (Algorithm) Header ".concat(s));case 14:_context78.next=16;return mI(s,r,e,this._cek,this._keyManagementParameters);case 16:_yield$mI=_context78.sent;l=_yield$mI.cek;o=_yield$mI.encryptedKey;g=_yield$mI.parameters;g&&(n&&hI in n?this._unprotectedHeader?this._unprotectedHeader=_objectSpread2(_objectSpread2({},this._unprotectedHeader),g):this.setUnprotectedHeader(g):this._protectedHeader?this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),g):this.setProtectedHeader(g));this._protectedHeader?c=an.encode(lt(JSON.stringify(this._protectedHeader))):c=an.encode(""),this._aad?(h=lt(this._aad),a=Oi(c,an.encode("."),an.encode(h))):a=c;_context78.next=24;return C3(r,this._plaintext,l,this._iv,a);case 24:_yield$C=_context78.sent;u=_yield$C.ciphertext;d=_yield$C.tag;m=_yield$C.iv;p={ciphertext:lt(u)};return _context78.abrupt("return",(m&&(p.iv=lt(m)),d&&(p.tag=lt(d)),o&&(p.encrypted_key=lt(o)),h&&(p.aad=h),this._protectedHeader&&(p.protected=u3.decode(c)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p));case 30:case "end":return _context78.stop();}},_callee71,this);}));function encrypt(_x152,_x153){return _encrypt.apply(this,arguments);}return encrypt;}()}]);}();var pn=function pn(t){return Math.floor(t.getTime()/1e3);},W3=60,S3=W3*60,Sa=S3*24,gI=Sa*7,fI=Sa*365.25,bI=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Oo=function Oo(t){var e=bI.exec(t);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");var n=parseFloat(e[2]),i=e[3].toLowerCase();var s;switch(i){case "sec":case "secs":case "second":case "seconds":case "s":s=Math.round(n);break;case "minute":case "minutes":case "min":case "mins":case "m":s=Math.round(n*W3);break;case "hour":case "hours":case "hr":case "hrs":case "h":s=Math.round(n*S3);break;case "day":case "days":case "d":s=Math.round(n*Sa);break;case "week":case "weeks":case "w":s=Math.round(n*gI);break;default:s=Math.round(n*fI);break;}return e[1]==="-"||e[4]==="ago"?-s:s;};var AI=/*#__PURE__*/function(){function AI(e){_classCallCheck(this,AI);this._flattened=new pI(e);}return _createClass(AI,[{key:"setContentEncryptionKey",value:function setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this;}},{key:"setInitializationVector",value:function setInitializationVector(e){return this._flattened.setInitializationVector(e),this;}},{key:"setProtectedHeader",value:function setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this;}},{key:"setKeyManagementParameters",value:function setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this;}},{key:"encrypt",value:function(){var _encrypt2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e,n){var i;return _regeneratorRuntime().wrap(function _callee72$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_context79.next=2;return this._flattened.encrypt(e,n);case 2:i=_context79.sent;return _context79.abrupt("return",[i.protected,i.encrypted_key,i.iv,i.ciphertext,i.tag].join("."));case 4:case "end":return _context79.stop();}},_callee72,this);}));function encrypt(_x154,_x155){return _encrypt2.apply(this,arguments);}return encrypt;}()}]);}();function gn(t,e){if(!Number.isFinite(e))throw new TypeError("Invalid ".concat(t," input"));return e;}var VI=/*#__PURE__*/function(){function VI(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,VI);if(!Wa(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e;}return _createClass(VI,[{key:"setIssuer",value:function setIssuer(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iss:e}),this;}},{key:"setSubject",value:function setSubject(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{sub:e}),this;}},{key:"setAudience",value:function setAudience(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{aud:e}),this;}},{key:"setJti",value:function setJti(e){return this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{jti:e}),this;}},{key:"setNotBefore",value:function setNotBefore(e){return typeof e=="number"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{nbf:gn("setNotBefore",e)}):e instanceof Date?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{nbf:gn("setNotBefore",pn(e))}):this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{nbf:pn(/* @__PURE__ */new Date())+Oo(e)}),this;}},{key:"setExpirationTime",value:function setExpirationTime(e){return typeof e=="number"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{exp:gn("setExpirationTime",e)}):e instanceof Date?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{exp:gn("setExpirationTime",pn(e))}):this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{exp:pn(/* @__PURE__ */new Date())+Oo(e)}),this;}},{key:"setIssuedAt",value:function setIssuedAt(e){return _typeof(e)>"u"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:pn(/* @__PURE__ */new Date())}):e instanceof Date?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:gn("setIssuedAt",pn(e))}):typeof e=="string"?this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:gn("setIssuedAt",pn(/* @__PURE__ */new Date())+Oo(e))}):this._payload=_objectSpread2(_objectSpread2({},this._payload),{},{iat:gn("setIssuedAt",e)}),this;}}]);}();var RI=/*#__PURE__*/function(_VI){function RI(){_classCallCheck(this,RI);return _callSuper(this,RI,arguments);}_inherits(RI,_VI);return _createClass(RI,[{key:"setProtectedHeader",value:function setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this;}},{key:"setKeyManagementParameters",value:function setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this;}},{key:"setContentEncryptionKey",value:function setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this;}},{key:"setInitializationVector",value:function setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this;}},{key:"replicateIssuerAsHeader",value:function replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=true,this;}},{key:"replicateSubjectAsHeader",value:function replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=true,this;}},{key:"replicateAudienceAsHeader",value:function replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=true,this;}},{key:"encrypt",value:function(){var _encrypt3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e,n){var i;return _regeneratorRuntime().wrap(function _callee73$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:i=new AI(an.encode(JSON.stringify(this._payload)));return _context80.abrupt("return",(this._replicateIssuerAsHeader&&(this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),{},{iss:this._payload.iss})),this._replicateSubjectAsHeader&&(this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),{},{sub:this._payload.sub})),this._replicateAudienceAsHeader&&(this._protectedHeader=_objectSpread2(_objectSpread2({},this._protectedHeader),{},{aud:this._payload.aud})),i.setProtectedHeader(this._protectedHeader),this._iv&&i.setInitializationVector(this._iv),this._cek&&i.setContentEncryptionKey(this._cek),this._keyManagementParameters&&i.setKeyManagementParameters(this._keyManagementParameters),i.encrypt(e,n)));case 2:case "end":return _context80.stop();}},_callee73,this);}));function encrypt(_x156,_x157){return _encrypt3.apply(this,arguments);}return encrypt;}()}]);}(VI);var Tt;(function(t){t.SCHEMA="schema",t.EXTERNAL_TOKEN="eToken",t.TOKEN="token";})(Tt||(Tt={}));var EI=/*#__PURE__*/function(_tW2){function EI(){var _this138;_classCallCheck(this,EI);_this138=_callSuper(this,EI,["user"]);// Schema
1178
1178
  _defineProperty(_this138,"setSchema",function(e){_this138.write(Tt.SCHEMA,e);});_defineProperty(_this138,"getSchema",function(){return _this138.read(Tt.SCHEMA);});// Token
1179
1179
  _defineProperty(_this138,"setToken",function(e){_this138.write(Tt.TOKEN,e);});_defineProperty(_this138,"getToken",function(){return _this138.read(Tt.TOKEN);});// External Token
1180
- _defineProperty(_this138,"setExternalToken",function(e){_this138.write(Tt.EXTERNAL_TOKEN,e);});_defineProperty(_this138,"getExternalToken",function(){return _this138.read(Tt.EXTERNAL_TOKEN);});_defineProperty(_this138,"removeToken",function(){_this138.remove(Tt.TOKEN);});return _this138;}_inherits(EI,_tW2);return _createClass(EI);}(tW);var ad;(function(t){t.DISABLED="disabled",t.INITIALIZATION="initialization",t.READY="ready",t.FAILED="failed",t.SUSPENDED="suspended";})(ad||(ad={}));Ki("deep_link");Ki("bypass");var cd=new EI(),hd=/*#__PURE__*/function(){var _ref266=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t){var _s$pub,_yield$SZ$meta;var e,_schemaName$issuer$e,n,i,s,r,o,a,c,h,u,d,_args81=arguments;return _regeneratorRuntime().wrap(function _callee74$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:e=_args81.length>1&&_args81[1]!==undefined?_args81[1]:{};_schemaName$issuer$e=_objectSpread2({schemaName:"slra",issuer:"sdk-web"},e),n=_schemaName$issuer$e.schemaName,i=_schemaName$issuer$e.issuer;t.sdk.withAuth=true;_context81.next=5;return t.stores.organizationSettings.getValue();case 5:s=_context81.sent;if(s){_context81.next=8;break;}throw new Error("unknown organization");case 8:r="".concat((_s$pub=s.pub)===null||_s$pub===void 0?void 0:_s$pub.kid);o="".concat(n,":").concat(s.id);_context81.next=12;return SZ(t.transport,{userKey:r,schema:o,init:true});case 12:_context81.t1=_yield$SZ$meta=_context81.sent.meta;_context81.t0=_context81.t1===null;if(_context81.t0){_context81.next=16;break;}_context81.t0=_yield$SZ$meta===void 0;case 16:if(!_context81.t0){_context81.next=20;break;}_context81.t2=void 0;_context81.next=21;break;case 20:_context81.t2=_yield$SZ$meta.token;case 21:a=_context81.t2;c=s.pub;_context81.next=25;return nI(_objectSpread2({},c));case 25:h=_context81.sent;u=window.crypto.randomUUID();_context81.next=29;return new RI({"device-id":u,totp:a}).setProtectedHeader({alg:c.alg||"",enc:"A256CBC-HS512",kid:c.kid}).setIssuedAt().setIssuer(i).setAudience(s.id).setExpirationTime("2m").encrypt(h);case 29:d=_context81.sent;_context81.next=32;return t.auth.login(o,d);case 32:cd.setSchema("streamlayer:streamlayer");cd.setExternalToken(d);case 34:case "end":return _context81.stop();}},_callee74);}));return function hd(_x158){return _ref266.apply(this,arguments);};}(),yI=/*#__PURE__*/function(){var _ref267=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t){var e,_args82=arguments;return _regeneratorRuntime().wrap(function _callee75$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:e=_args82.length>1&&_args82[1]!==undefined?_args82[1]:{};_context82.prev=1;_context82.next=4;return t.auth.reLogin({skipLogin:true});case 4:_context82.t0=_context82.sent;if(_context82.t0){_context82.next=8;break;}_context82.next=8;return hd(t,e).catch(function(i){console.error(i,"fail anon login");});case 8:_context82.next=15;break;case 10:_context82.prev=10;_context82.t1=_context82["catch"](1);console.log(_context82.t1,"fail anon re-login");_context82.next=15;return hd(t,e);case 15:case "end":return _context82.stop();}},_callee75,null,[[1,10]]);}));return function yI(_x159){return _ref267.apply(this,arguments);};}(),CI=function CI(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){var s=setTimeout(function(){i(new Error("timeout"));},3e4);t.stores.status.subscribe(/*#__PURE__*/function(){var _ref268=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(r){return _regeneratorRuntime().wrap(function _callee76$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:if(!(r==="ready")){_context83.next=13;break;}_context83.prev=1;_context83.next=4;return yI(t,e);case 4:n(true);_context83.next=10;break;case 7:_context83.prev=7;_context83.t0=_context83["catch"](1);i(_context83.t0);case 10:_context83.prev=10;clearTimeout(s);return _context83.finish(10);case 13:case "end":return _context83.stop();}},_callee76,null,[[1,7,10,13]]);}));return function(_x160){return _ref268.apply(this,arguments);};}());});},WI=function WI(t,e,n){t.sdk.anonymousAuthorization=/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(){return _regeneratorRuntime().wrap(function _callee77$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:_context84.next=2;return CI(t,e);case 2:case "end":return _context84.stop();}},_callee77);})),n();},SI=/* @__PURE__ */new Set([WI]),Z3=function Z3(_ref270){var t=_ref270.videoPlayerController;var e=Qi(),n=y.useRef();return y.useEffect(function(){if(e)return n.current=t,e.addVideoPlayerController(n.current),function(){n.current&&e.removeVideoPlayerController(n.current);};},[e]),null;},Ev=function Ev(_ref271){var t=_ref271.children,e=_ref271.videoPlayerController,n=_objectWithoutProperties(_ref271,_excluded16);return/* @__PURE__ */jsxRuntime.jsxs(p4,_objectSpread2(_objectSpread2({},n),{},{themeMode:"dark",withAd:true,skipOnboarding:true,withAdNotification:true,autoEnable:true,plugins:SI,friendsTab:"disabled",hideFriends:true,webOS:true,children:[t,e&&/* @__PURE__ */jsxRuntime.jsx(Z3,{videoPlayerController:e})]}));},ZI=function ZI(_ref272){var t=_ref272.sdk;return y.useEffect(function(){t.anonymousAuthorization();},[t]),null;},II=function II(_ref273){var t=_ref273.persistent,e=_ref273.notification,n=_ref273.banner,i=_ref273.sdk;var s=He(i.uiState);return s.exposedPauseAd?null:n?s.promotionBanner||s.appBanner?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:i,persistent:t,banner:"bottom"}):null:e?s.promotionNotification?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:i,notification:true,persistent:t}):s.onboardingNotification||s.appNotification?/* @__PURE__ */jsxRuntime.jsx(Qs,{sdk:i,notification:true,persistent:t}):null:s.promotionSidebar?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:i,persistent:t,sidebar:"right"}):s.app||s.appSidebar?/* @__PURE__ */jsxRuntime.jsx(Qs,{sdk:i,persistent:t}):null;},yv=function yv(t){var e=Qi(),n=aa();return e?/* @__PURE__ */jsxRuntime.jsx("div",{className:"StreamLayerSDK StreamLayerSDKTvContent",children:/* @__PURE__ */jsxRuntime.jsx(Nl,{customTheme:n.theme,themeMode:n.themeMode,children:/* @__PURE__ */jsxRuntime.jsx(II,_objectSpread2({sdk:e},t))})}):null;},Cv=function Cv(_ref274){var t=_ref274.videoPlayerController,e=_objectWithoutProperties(_ref274,_excluded17);var n=Qi(),i=aa();return n?/* @__PURE__ */jsxRuntime.jsxs("div",{className:"StreamLayerSDK StreamLayerSDKTvPauseAd",children:[/* @__PURE__ */jsxRuntime.jsx(Nl,{customTheme:i.theme,themeMode:i.themeMode,children:/* @__PURE__ */jsxRuntime.jsx(K2,_objectSpread2(_objectSpread2({},e),{},{sdk:n,isDesktop:false}))}),t&&/* @__PURE__ */jsxRuntime.jsx(Z3,{videoPlayerController:t})]}):null;},Wv=function Wv(_ref275){var t=_ref275.persistent,e=_ref275.children,n=_ref275.showPauseAd,i=_ref275.pauseAdVastUrl,s=_ref275.videoPlayerController,r=_ref275.onRenderPauseAd,o=_ref275.onClosePauseAd,l=_ref275.options;var a=Qi(),c=aa(),h=y.useRef();return y.useEffect(function(){if(a)return s&&(h.current=s,a.addVideoPlayerController(h.current)),function(){h.current&&a.removeVideoPlayerController(h.current);};},[a]),a?/* @__PURE__ */jsxRuntime.jsx("div",{className:"StreamLayerSDK StreamLayerSDKTv",children:/* @__PURE__ */jsxRuntime.jsxs(Nl,{customTheme:c.theme,themeMode:c.themeMode,children:[/* @__PURE__ */jsxRuntime.jsx(WZ,{sdk:a,persistent:t,showPauseAd:n,onRenderPauseAd:r,pauseAdVastUrl:i,onClosePauseAd:o,options:l,children:e}),/* @__PURE__ */jsxRuntime.jsx(ZI,{sdk:a})]})}):null;};
1180
+ _defineProperty(_this138,"setExternalToken",function(e){_this138.write(Tt.EXTERNAL_TOKEN,e);});_defineProperty(_this138,"getExternalToken",function(){return _this138.read(Tt.EXTERNAL_TOKEN);});_defineProperty(_this138,"removeToken",function(){_this138.remove(Tt.TOKEN);});return _this138;}_inherits(EI,_tW2);return _createClass(EI);}(tW);var ad;(function(t){t.DISABLED="disabled",t.INITIALIZATION="initialization",t.READY="ready",t.FAILED="failed",t.SUSPENDED="suspended";})(ad||(ad={}));Ki("deep_link");Ki("bypass");var cd=new EI(),hd=/*#__PURE__*/function(){var _ref266=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t){var _s$pub,_yield$SZ$meta;var e,_schemaName$issuer$e,n,i,s,r,o,a,c,h,u,d,m,p,_args81=arguments;return _regeneratorRuntime().wrap(function _callee74$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:e=_args81.length>1&&_args81[1]!==undefined?_args81[1]:{};_schemaName$issuer$e=_objectSpread2({schemaName:"slra",issuer:"sdk-web"},e),n=_schemaName$issuer$e.schemaName,i=_schemaName$issuer$e.issuer;t.sdk.withAuth=true;_context81.next=5;return t.stores.organizationSettings.getValue();case 5:s=_context81.sent;if(s){_context81.next=8;break;}throw new Error("unknown organization");case 8:r="".concat((_s$pub=s.pub)===null||_s$pub===void 0?void 0:_s$pub.kid);o="".concat(n,":").concat(s.id);_context81.next=12;return SZ(t.transport,{userKey:r,schema:o,init:true});case 12:_context81.t1=_yield$SZ$meta=_context81.sent.meta;_context81.t0=_context81.t1===null;if(_context81.t0){_context81.next=16;break;}_context81.t0=_yield$SZ$meta===void 0;case 16:if(!_context81.t0){_context81.next=20;break;}_context81.t2=void 0;_context81.next=21;break;case 20:_context81.t2=_yield$SZ$meta.token;case 21:a=_context81.t2;c=s.pub;_context81.next=25;return nI(_objectSpread2({},c));case 25:h=_context81.sent;u=crypto.getRandomValues(new Uint8Array(16));u[6]=u[6]&15|64,u[8]=u[8]&63|128;d=Array.from(u,function(g){return g.toString(16).padStart(2,"0");}).join("");m="".concat(d.slice(0,8),"-").concat(d.slice(8,12),"-").concat(d.slice(12,16),"-").concat(d.slice(16,20),"-").concat(d.slice(20));_context81.next=32;return new RI({"device-id":m,totp:a}).setProtectedHeader({alg:c.alg||"",enc:"A256CBC-HS512",kid:c.kid}).setIssuedAt().setIssuer(i).setAudience(s.id).setExpirationTime("2m").encrypt(h);case 32:p=_context81.sent;_context81.next=35;return t.auth.login(o,p);case 35:cd.setSchema("streamlayer:streamlayer");cd.setExternalToken(p);case 37:case "end":return _context81.stop();}},_callee74);}));return function hd(_x158){return _ref266.apply(this,arguments);};}(),yI=/*#__PURE__*/function(){var _ref267=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t){var e,_args82=arguments;return _regeneratorRuntime().wrap(function _callee75$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:e=_args82.length>1&&_args82[1]!==undefined?_args82[1]:{};_context82.prev=1;_context82.next=4;return t.auth.reLogin({skipLogin:true});case 4:_context82.t0=_context82.sent;if(_context82.t0){_context82.next=8;break;}_context82.next=8;return hd(t,e).catch(function(i){console.error(i,"fail anon login");});case 8:_context82.next=15;break;case 10:_context82.prev=10;_context82.t1=_context82["catch"](1);console.log(_context82.t1,"fail anon re-login");_context82.next=15;return hd(t,e);case 15:case "end":return _context82.stop();}},_callee75,null,[[1,10]]);}));return function yI(_x159){return _ref267.apply(this,arguments);};}(),CI=function CI(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(n,i){var s=setTimeout(function(){i(new Error("timeout"));},3e4);t.stores.status.subscribe(/*#__PURE__*/function(){var _ref268=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(r){return _regeneratorRuntime().wrap(function _callee76$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:if(!(r==="ready")){_context83.next=13;break;}_context83.prev=1;_context83.next=4;return yI(t,e);case 4:n(true);_context83.next=10;break;case 7:_context83.prev=7;_context83.t0=_context83["catch"](1);i(_context83.t0);case 10:_context83.prev=10;clearTimeout(s);return _context83.finish(10);case 13:case "end":return _context83.stop();}},_callee76,null,[[1,7,10,13]]);}));return function(_x160){return _ref268.apply(this,arguments);};}());});},WI=function WI(t,e,n){t.sdk.anonymousAuthorization=/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(){return _regeneratorRuntime().wrap(function _callee77$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:_context84.next=2;return CI(t,e);case 2:case "end":return _context84.stop();}},_callee77);})),n();},SI=/* @__PURE__ */new Set([WI]),Z3=function Z3(_ref270){var t=_ref270.videoPlayerController;var e=Qi(),n=y.useRef();return y.useEffect(function(){if(e)return n.current=t,e.addVideoPlayerController(n.current),function(){n.current&&e.removeVideoPlayerController(n.current);};},[e]),null;},Ev=function Ev(_ref271){var t=_ref271.children,e=_ref271.videoPlayerController,n=_objectWithoutProperties(_ref271,_excluded16);return/* @__PURE__ */jsxRuntime.jsxs(p4,_objectSpread2(_objectSpread2({},n),{},{themeMode:"dark",withAd:true,skipOnboarding:true,withAdNotification:true,autoEnable:true,plugins:SI,friendsTab:"disabled",hideFriends:true,webOS:true,children:[t,e&&/* @__PURE__ */jsxRuntime.jsx(Z3,{videoPlayerController:e})]}));},ZI=function ZI(_ref272){var t=_ref272.sdk;return y.useEffect(function(){t.anonymousAuthorization();},[t]),null;},II=function II(_ref273){var t=_ref273.persistent,e=_ref273.notification,n=_ref273.banner,i=_ref273.sdk;var s=He(i.uiState);return s.exposedPauseAd?null:n?s.promotionBanner||s.appBanner?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:i,persistent:t,banner:"bottom"}):null:e?s.promotionNotification?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:i,notification:true,persistent:t}):s.onboardingNotification||s.appNotification?/* @__PURE__ */jsxRuntime.jsx(Qs,{sdk:i,notification:true,persistent:t}):null:s.promotionSidebar?/* @__PURE__ */jsxRuntime.jsx(qn,{sdk:i,persistent:t,sidebar:"right"}):s.app||s.appSidebar?/* @__PURE__ */jsxRuntime.jsx(Qs,{sdk:i,persistent:t}):null;},yv=function yv(t){var e=Qi(),n=aa();return e?/* @__PURE__ */jsxRuntime.jsx("div",{className:"StreamLayerSDK StreamLayerSDKTvContent",children:/* @__PURE__ */jsxRuntime.jsx(Nl,{customTheme:n.theme,themeMode:n.themeMode,children:/* @__PURE__ */jsxRuntime.jsx(II,_objectSpread2({sdk:e},t))})}):null;},Cv=function Cv(_ref274){var t=_ref274.videoPlayerController,e=_objectWithoutProperties(_ref274,_excluded17);var n=Qi(),i=aa();return n?/* @__PURE__ */jsxRuntime.jsxs("div",{className:"StreamLayerSDK StreamLayerSDKTvPauseAd",children:[/* @__PURE__ */jsxRuntime.jsx(Nl,{customTheme:i.theme,themeMode:i.themeMode,children:/* @__PURE__ */jsxRuntime.jsx(K2,_objectSpread2(_objectSpread2({},e),{},{sdk:n,isDesktop:false}))}),t&&/* @__PURE__ */jsxRuntime.jsx(Z3,{videoPlayerController:t})]}):null;},Wv=function Wv(_ref275){var t=_ref275.persistent,e=_ref275.children,n=_ref275.showPauseAd,i=_ref275.pauseAdVastUrl,s=_ref275.videoPlayerController,r=_ref275.onRenderPauseAd,o=_ref275.onClosePauseAd,l=_ref275.options;var a=Qi(),c=aa(),h=y.useRef();return y.useEffect(function(){if(a)return s&&(h.current=s,a.addVideoPlayerController(h.current)),function(){h.current&&a.removeVideoPlayerController(h.current);};},[a]),a?/* @__PURE__ */jsxRuntime.jsx("div",{className:"StreamLayerSDK StreamLayerSDKTv",children:/* @__PURE__ */jsxRuntime.jsxs(Nl,{customTheme:c.theme,themeMode:c.themeMode,children:[/* @__PURE__ */jsxRuntime.jsx(WZ,{sdk:a,persistent:t,showPauseAd:n,onRenderPauseAd:r,pauseAdVastUrl:i,onClosePauseAd:o,options:l,children:e}),/* @__PURE__ */jsxRuntime.jsx(ZI,{sdk:a})]})}):null;};
1181
1181
 
1182
1182
  function sr(A, S) {
1183
1183
  var _loop = function _loop() {
@@ -6,151 +6,6 @@ var _textEncoding = require('text-encoding-utf-8');
6
6
  if (typeof window.TextEncoder === 'undefined') window.TextEncoder = _textEncoding.TextEncoder;
7
7
  if (typeof window.TextDecoder === 'undefined') window.TextDecoder = _textEncoding.TextDecoder;
8
8
  require('intersection-observer'); // IntersectionObserver polyfill (Chrome 51)
9
- // Web Crypto SubtleCrypto polyfill (Chrome 37)
10
- // Chrome 32 has crypto.getRandomValues but no crypto.subtle.
11
- // webcrypto-liner provides a full SubtleCrypto implementation in pure JS.
12
- // window.crypto is a read-only accessor on many browsers, so direct assignment
13
- // silently fails. Instead, define/overwrite the property or patch subtle in-place.
14
- if (!window.crypto || !window.crypto.subtle) {
15
- var _liner = require('webcrypto-liner');
16
- if (window.crypto && !window.crypto.subtle) {
17
- // Native crypto exists (getRandomValues) but no subtle — patch subtle in
18
- Object.defineProperty(window.crypto, 'subtle', {
19
- value: _liner.crypto.subtle,
20
- writable: true,
21
- configurable: true
22
- });
23
- } else {
24
- // No native crypto at all — replace entirely
25
- Object.defineProperty(window, 'crypto', {
26
- value: _liner.crypto,
27
- writable: true,
28
- configurable: true
29
- });
30
- }
31
- // CryptoKey global (Chrome 37) — used by SDK's JOSE library for instanceof checks
32
- if (typeof window.CryptoKey === 'undefined') window.CryptoKey = _liner.CryptoKey;
33
- // webcrypto-liner leaves AES-KW onImportKey/onExportKey/onGenerateKey as
34
- // "not implemented" stubs (it expects native SubtleCrypto for these).
35
- // Chrome 32 has no native SubtleCrypto, so patch them from AES-CBC provider
36
- // which shares the same AesCrypto key import/export/generate logic.
37
- var _subtle = _liner.crypto.subtle;
38
- var _aesKw = _subtle.providers && _subtle.providers.get('AES-KW');
39
- var _aesCbc = _subtle.providers && _subtle.providers.get('AES-CBC');
40
- if (_aesKw && _aesCbc) {
41
- _aesKw.onImportKey = _aesCbc.onImportKey;
42
- _aesKw.onExportKey = _aesCbc.onExportKey;
43
- _aesKw.onGenerateKey = _aesCbc.onGenerateKey;
44
- }
45
- // AES-KW wrap/unwrap (RFC 3394) implementation using AES-ECB from asmcrypto.js.
46
- // webcrypto-liner stubs onEncrypt/onDecrypt as "not implemented" because it
47
- // expects a native SubtleCrypto fallback, which Chrome 32 doesn't have.
48
- var _AES_ECB = require('asmcrypto.js/asmcrypto.all.js').AES_ECB;
49
- if (_aesKw && _AES_ECB) {
50
- // RFC 3394 §2.2.1 — Key Wrap
51
- _aesKw.onEncrypt = function(_algorithm, key, data) {
52
- return Promise.resolve().then(function() {
53
- var keyData = new Uint8Array(key.raw);
54
- var P = new Uint8Array(data);
55
- var n = P.length / 8; // number of 64-bit blocks
56
- if (P.length % 8 !== 0) throw new Error('AES-KW: data must be a multiple of 8 bytes');
57
- // Initial value (IV) per RFC 3394
58
- var A = new Uint8Array([0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6]);
59
- // R[1..n] = plaintext blocks
60
- var R = [];
61
- for (var i = 0; i < n; i++) {
62
- R[i] = P.slice(i * 8, i * 8 + 8);
63
- }
64
- var ecb = new _AES_ECB(keyData);
65
- var B = new Uint8Array(16);
66
- for (var j = 0; j < 6; j++) {
67
- for (var i = 0; i < n; i++) {
68
- // B = AES(K, A | R[i])
69
- B.set(A, 0);
70
- B.set(R[i], 8);
71
- var encrypted = ecb.encrypt(B);
72
- // t = n*j + i + 1 (MSB first XOR into A)
73
- var t = n * j + i + 1;
74
- // A = MSB(64, B) ^ t
75
- A = new Uint8Array(encrypted.slice(0, 8));
76
- A[7] ^= t & 0xff;
77
- A[6] ^= (t >> 8) & 0xff;
78
- A[5] ^= (t >> 16) & 0xff;
79
- A[4] ^= (t >> 24) & 0xff;
80
- // R[i] = LSB(64, B)
81
- R[i] = new Uint8Array(encrypted.slice(8, 16));
82
- }
83
- }
84
- // Output: A | R[1] | R[2] | ... | R[n]
85
- var C = new Uint8Array(8 + n * 8);
86
- C.set(A, 0);
87
- for (var i = 0; i < n; i++) {
88
- C.set(R[i], 8 + i * 8);
89
- }
90
- return C.buffer;
91
- });
92
- };
93
- // RFC 3394 §2.2.2 — Key Unwrap
94
- _aesKw.onDecrypt = function(_algorithm, key, data) {
95
- return Promise.resolve().then(function() {
96
- var keyData = new Uint8Array(key.raw);
97
- var C = new Uint8Array(data);
98
- var n = C.length / 8 - 1; // number of 64-bit blocks (minus IV)
99
- if (C.length % 8 !== 0) throw new Error('AES-KW: data must be a multiple of 8 bytes');
100
- // A = C[0]
101
- var A = C.slice(0, 8);
102
- var R = [];
103
- for (var i = 0; i < n; i++) {
104
- R[i] = C.slice(8 + i * 8, 16 + i * 8);
105
- }
106
- var ecb = new _AES_ECB(keyData);
107
- var B = new Uint8Array(16);
108
- for (var j = 5; j >= 0; j--) {
109
- for (var i = n - 1; i >= 0; i--) {
110
- var t = n * j + i + 1;
111
- // A ^ t
112
- var Ax = new Uint8Array(A);
113
- Ax[7] ^= t & 0xff;
114
- Ax[6] ^= (t >> 8) & 0xff;
115
- Ax[5] ^= (t >> 16) & 0xff;
116
- Ax[4] ^= (t >> 24) & 0xff;
117
- // B = AES-1(K, (A ^ t) | R[i])
118
- B.set(Ax, 0);
119
- B.set(R[i], 8);
120
- var decrypted = ecb.decrypt(B);
121
- A = new Uint8Array(decrypted.slice(0, 8));
122
- R[i] = new Uint8Array(decrypted.slice(8, 16));
123
- }
124
- }
125
- // Verify IV
126
- var IV = [0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6];
127
- for (var i = 0; i < 8; i++) {
128
- if (A[i] !== IV[i]) throw new Error('AES-KW: integrity check failed');
129
- }
130
- var P = new Uint8Array(n * 8);
131
- for (var i = 0; i < n; i++) {
132
- P.set(R[i], i * 8);
133
- }
134
- return P.buffer;
135
- });
136
- };
137
- }
138
- }
139
- // crypto.randomUUID() polyfill (Chrome 92)
140
- if (typeof window.crypto.randomUUID !== 'function') {
141
- window.crypto.randomUUID = function() {
142
- var b = new Uint8Array(16);
143
- window.crypto.getRandomValues(b);
144
- b[6] = (b[6] & 0x0f) | 0x40; // version 4
145
- b[8] = (b[8] & 0x3f) | 0x80; // variant 10
146
- var h = '';
147
- for (var i = 0; i < 16; i++) {
148
- if (i === 4 || i === 6 || i === 8 || i === 10) h += '-';
149
- h += (b[i] < 16 ? '0' : '') + b[i].toString(16);
150
- }
151
- return h;
152
- };
153
- }
154
9
  if (typeof window.ResizeObserver === 'undefined') { // ResizeObserver polyfill (Chrome 64)
155
10
  var _RO = require('resize-observer-polyfill');
156
11
  window.ResizeObserver = _RO.default || _RO;
package/lib/es/index2.js CHANGED
@@ -24333,7 +24333,7 @@ const CZ = ({
24333
24333
  options: l
24334
24334
  }
24335
24335
  ),
24336
- /* @__PURE__ */ f(PA, { sdk: n })
24336
+ l?.showPolymarketButton && /* @__PURE__ */ f(PA, { sdk: n })
24337
24337
  ]
24338
24338
  }
24339
24339
  );
@@ -25291,8 +25291,10 @@ const cd = new EI(), hd = async (t, e = {}) => {
25291
25291
  const s = await t.stores.organizationSettings.getValue();
25292
25292
  if (!s)
25293
25293
  throw new Error("unknown organization");
25294
- const r = `${s.pub?.kid}`, o = `${n}:${s.id}`, a = (await SZ(t.transport, { userKey: r, schema: o, init: !0 })).meta?.token, c = s.pub, h = await nI({ ...c }), u = window.crypto.randomUUID(), d = await new RI({ "device-id": u, totp: a }).setProtectedHeader({ alg: c.alg || "", enc: "A256CBC-HS512", kid: c.kid }).setIssuedAt().setIssuer(i).setAudience(s.id).setExpirationTime("2m").encrypt(h);
25295
- await t.auth.login(o, d), cd.setSchema("streamlayer:streamlayer"), cd.setExternalToken(d);
25294
+ const r = `${s.pub?.kid}`, o = `${n}:${s.id}`, a = (await SZ(t.transport, { userKey: r, schema: o, init: !0 })).meta?.token, c = s.pub, h = await nI({ ...c }), u = crypto.getRandomValues(new Uint8Array(16));
25295
+ u[6] = u[6] & 15 | 64, u[8] = u[8] & 63 | 128;
25296
+ const d = Array.from(u, (g) => g.toString(16).padStart(2, "0")).join(""), m = `${d.slice(0, 8)}-${d.slice(8, 12)}-${d.slice(12, 16)}-${d.slice(16, 20)}-${d.slice(20)}`, p = await new RI({ "device-id": m, totp: a }).setProtectedHeader({ alg: c.alg || "", enc: "A256CBC-HS512", kid: c.kid }).setIssuedAt().setIssuer(i).setAudience(s.id).setExpirationTime("2m").encrypt(h);
25297
+ await t.auth.login(o, p), cd.setSchema("streamlayer:streamlayer"), cd.setExternalToken(p);
25296
25298
  }, yI = async (t, e = {}) => {
25297
25299
  try {
25298
25300
  await t.auth.reLogin({ skipLogin: !0 }) || await hd(t, e).catch((i) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/web-os",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "author": "StreamLayer, Inc (https://streamlayer.io)",
5
5
  "maintainers": [
6
6
  {
@@ -47,20 +47,20 @@
47
47
  "nanostores": "^1.1.0",
48
48
  "pino": "^9.4.0",
49
49
  "uuid": "^11.1.0",
50
- "@streamlayer/feature-gamification": "^1.25.1",
51
- "@streamlayer/react-polyfills": "^0.2.9",
52
- "@streamlayer/react-ui": "^1.36.1",
53
- "@streamlayer/sdk-web": "^1.18.1",
54
- "@streamlayer/sdk-web-analytics": "^1.16.1",
55
- "@streamlayer/sdk-web-anonymous-auth": "^1.4.1",
56
- "@streamlayer/sdk-web-api": "^1.16.1",
57
- "@streamlayer/sdk-web-core": "^1.21.1",
58
- "@streamlayer/sdk-web-features": "^1.0.103",
59
- "@streamlayer/sdk-web-interfaces": "^1.9.9",
60
- "@streamlayer/sdk-web-logger": "^1.0.103",
61
- "@streamlayer/sdk-web-notifications": "^1.3.65",
62
- "@streamlayer/sdk-web-storage": "^1.0.103",
63
- "@streamlayer/sdk-web-types": "^1.17.1"
50
+ "@streamlayer/feature-gamification": "^1.25.3",
51
+ "@streamlayer/react-polyfills": "^0.2.11",
52
+ "@streamlayer/react-ui": "^1.36.3",
53
+ "@streamlayer/sdk-web": "^1.18.3",
54
+ "@streamlayer/sdk-web-analytics": "^1.16.3",
55
+ "@streamlayer/sdk-web-anonymous-auth": "^1.4.3",
56
+ "@streamlayer/sdk-web-api": "^1.16.3",
57
+ "@streamlayer/sdk-web-core": "^1.21.3",
58
+ "@streamlayer/sdk-web-features": "^1.0.105",
59
+ "@streamlayer/sdk-web-interfaces": "^1.9.11",
60
+ "@streamlayer/sdk-web-logger": "^1.0.105",
61
+ "@streamlayer/sdk-web-notifications": "^1.3.67",
62
+ "@streamlayer/sdk-web-storage": "^1.0.105",
63
+ "@streamlayer/sdk-web-types": "^1.17.3"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@lottiefiles/react-lottie-player": "^3.5.4",
@@ -72,15 +72,12 @@
72
72
  "react-dom": "^17.0.0 || ^18.0.0",
73
73
  "react-infinite-scroller": "^1.2.6",
74
74
  "abortcontroller-polyfill": "^1.7.8",
75
- "asmcrypto.js": "^2.3.2",
76
75
  "core-js": "^3.48.0",
77
- "elliptic": "^6.6.1",
78
76
  "intersection-observer": "^0.12.2",
79
77
  "regenerator-runtime": "^0.14.1",
80
78
  "resize-observer-polyfill": "^1.5.1",
81
79
  "text-encoding-utf-8": "^1.0.2",
82
80
  "web-streams-polyfill": "3",
83
- "webcrypto-liner": "^1.4.3",
84
81
  "whatwg-fetch": "^3.6.20"
85
82
  }
86
83
  }