devirt-corpus / real /tranco /twitch.tv__8b1ee027.js
vasie's picture
Expand corpus to ~9.5k: 500 seeds x 19 obfuscation profiles + real samples
c930535
Raw
History Blame Contribute Delete
97.4 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9abacc20-28a5-4d5d-8397-64b6b4ba028b",e._sentryDebugIdIdentifier="sentry-dbid-9abacc20-28a5-4d5d-8397-64b6b4ba028b")}catch(e){}}(),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9abacc20-28a5-4d5d-8397-64b6b4ba028b",e._sentryDebugIdIdentifier="sentry-dbid-9abacc20-28a5-4d5d-8397-64b6b4ba028b")}catch(e){}}(),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9abacc20-28a5-4d5d-8397-64b6b4ba028b",e._sentryDebugIdIdentifier="sentry-dbid-9abacc20-28a5-4d5d-8397-64b6b4ba028b")}catch(e){}}(),(self.webpackChunktwitch_twilight=self.webpackChunktwitch_twilight||[]).push([[88480],{376711:(e,t,n)=>{"use strict";n.d(t,{GL:()=>i,Z0:()=>a});var i,o,r=n(124051),s=n(25470);!function(e){e.Upsell="upsell",e.Tier1="1000",e.Tier2="2000",e.Tier3="3000"}(i||(i={})),function(e){e.InvalidTier="INVALID_TIER",e.SubStatusNotAvailable="SUB_STATUS_NOT_AVAILABLE"}(o||(o={}));var a=function(){function e(e,t){var n=this;this.extensionId=e,this.isSubscriptionStatusAvailable=t,this.subscribeToChannelWhitelist=s.Zn.get("ext_sub_to_channel_whitelist",[]),this.useClientIdWhitelist=s.Zn.get("ext_use_sub_to_channel_whitelist",!0),this.onOpen=function(e){n.sendActionToClient=function(t){e(t)}},this.resultCallback=function(e){n.sendResultToExtension(e)},this.onModalResult=function(e){n.sendResultToExtension=function(t){e({action:r.tv.SubscribeToChannelResult,payload:t})}}}return Object.defineProperty(e.prototype,"defaultResult",{get:function(){return{didSubscribe:!1}},enumerable:!1,configurable:!0}),e.prototype.open=function(e){!this.isSubscriptionStatusAvailable||this.useClientIdWhitelist&&-1===this.subscribeToChannelWhitelist.indexOf(this.extensionId)||(void 0!==Object.values(i).find((function(t){return t===e.payload.tier}))?this.sendActionToClient(e.payload):this.close(o.InvalidTier))},e.prototype.close=function(e){this.sendResultToExtension({didSubscribe:!1,errorCode:e})},e}()},288480:(e,t,n)=>{"use strict";n.d(t,{sh:()=>c.sh,Z1:()=>c.Z1,xF:()=>se,WN:()=>c.WN,Fw:()=>c.Fw,z$:()=>c.z$,MB:()=>c.MB,HY:()=>c.HY,tv:()=>c.tv,ZO:()=>q.ZO});n(937315),n(578624),n(843643);var i=n(331635),o=n(665265),r=n(520309),s="\nquery MobileExtensionData($channelID: ID!, $extensionID: ID!, $version: String) {\n mobileExtensionInstallation(channelID: $channelID, extensionID: $extensionID, version: $version) {\n installation {\n id\n extension {\n id\n name\n authorName\n isBitsEnabled\n clientID\n description\n iconURLs {\n square24\n square100\n }\n hasIdentityLinking\n sku\n summary\n version\n views {\n mobile {\n viewerURL\n }\n }\n vendorCode\n state\n whitelistedConfigURLs\n whitelistedPanelURLs\n }\n activationConfig {\n anchor\n }\n\t\t\tabilities {\n\t\t\t\tisBitsEnabled\n\t\t\t\tisChatEnabled\n\t\t\t\tisSubscriptionStatusAvailable\n\t\t\t}\n }\n token {\n jwt\n }\n helixToken {\n jwt\n }\n configuration {\n broadcaster {\n content\n version\n }\n developer {\n content\n version\n }\n global {\n content\n version\n }\n }\n }\n}\n";function a(e){var t,n,a;return(0,i.__awaiter)(this,void 0,void 0,(function(){var c,u,l,d,h,f,p,b,g,_,v;return(0,i.__generator)(this,(function(y){switch(y.label){case 0:return[4,r.F.graphQLRequest(s,(0,i.__assign)({},e))];case 1:if(c=y.sent(),!(u=null==c?void 0:c.mobileExtensionInstallation))throw new Error("Installation not found. It is likely that the provided extension version is not installed on the provided channel");if(l=u.token,d=u.helixToken,h=u.configuration,f=u.installation,b=(p=null!=f?f:{}).extension,g=p.abilities,_=b&&(0,o.U_)(b.state),v=null===(t=null==f?void 0:f.activationConfig)||void 0===t?void 0:t.anchor,!b||!_||!v)throw new Error("Response body is incomplete. Check the health of extensions services.");return[2,{extension:{authorName:b.authorName,bitsEnabled:b.isBitsEnabled,clientId:b.clientID,description:b.description,iconUrl:b.iconURLs.square100,iconUrls:b.iconURLs,id:b.clientID,name:b.name,requestIdentityLink:b.hasIdentityLinking,sku:b.sku,summary:b.summary,token:null!==(n=null==l?void 0:l.jwt)&&void 0!==n?n:"",helixToken:null!==(a=null==d?void 0:d.jwt)&&void 0!==a?a:"",version:b.version,views:{mobile:{viewerUrl:b.views.mobile.viewerURL}},vendorCode:b.vendorCode,state:_,whitelistedConfigUrls:b.whitelistedConfigURLs,whitelistedPanelUrls:b.whitelistedPanelURLs,allowlistedConfigUrls:b.whitelistedConfigURLs,allowlistedPanelUrls:b.whitelistedPanelURLs,viewerSummary:b.summary},configuration:h||void 0,anchor:(0,o.XB)(v),abilities:g||void 0}]}}))}))}var c=n(124051),u=n(277008),l=n(376711),d=n(458326),h=n(569886),f=function(e,t,n,o,s,a){return(0,i.__awaiter)(void 0,void 0,void 0,(function(){return(0,i.__generator)(this,(function(i){return[2,r.F.graphQLRequest("\nmutation SetExtensionConfiguration(\n $extensionID: ID!\n $channelID: ID!\n $contentType: String!\n $authToken: String!\n $message: String!\n $targets: [String!]!\n) {\n sendExtensionMessage(input: {\n extensionID: $extensionID,\n channelID: $channelID,\n contentType: $contentType,\n extAuthToken: $authToken,\n message: $message,\n targets: $targets,\n }) {\n error {\n code\n }\n rateLimitsApplied {\n isLimitExceeded\n limit\n rateLimiterName\n remainingQuota\n resetsAt\n }\n }\n}\n",{extensionID:e,channelID:t,contentType:o,authToken:n,message:s,targets:a})]}))}))};function p(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n,o,r,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,f(e.extensionID,e.channelID,e.authToken,t.contentType,t.message,t.targets)];case 1:if(n=i.sent(),o=n.sendExtensionMessage,r=o.error,s=o.rateLimitsApplied,r)throw new Error(r.code);return[2,{rateLimitsApplied:s}];case 2:throw i.sent(),new Error("unable to send pubsub message");case 3:return[2]}}))}))}var b,g,_,v=function(e,t,n,o){return(0,i.__awaiter)(void 0,void 0,void 0,(function(){return(0,i.__generator)(this,(function(i){return[2,r.F.graphQLRequest("\nmutation SetExtensionConfiguration(\n $channelID: ID!\n $extensionID: ID!\n $version: String!\n $content: String!\n) {\n setExtensionConfiguration(input: {\n channelID: $channelID\n extensionID: $extensionID\n configVersion: $version\n content: $content\n }) {\n channelID\n extensionID\n configVersion\n content\n error {\n code\n }\n }\n}\n",{channelID:t,extensionID:e,version:n,content:o})]}))}))};function y(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n,o,r,s,a,c;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,v(e.extensionID,e.channelID,t.version,t.content)];case 1:if(n=i.sent().setExtensionConfiguration,o=n.extensionID,r=n.channelID,s=n.configVersion,a=n.content,c=n.error)throw new Error(c.code);return[2,{extensionID:o,channelID:r,configVersion:s,content:a}];case 2:throw i.sent(),new Error("unable to set configuration");case 3:return[2]}}))}))}function m(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,n,o;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e];case 1:return t=i.sent(),[2,{status:g.Ok,result:t}];case 2:return n=i.sent(),o=n instanceof Error?n:new Error("unexpected callback error"),[2,{status:g.Error,error:o}];case 3:return[2]}}))}))}!function(e){e.Broadcaster="broadcaster",e.Developer="developer",e.Global="global"}(b||(b={})),function(e){e.Ok="ok",e.Error="error"}(g||(g={})),function(e){e.SetConfiguration="set-configuration",e.SendMessageToPubsub="send-message-to-pubsub"}(_||(_={}));var x,w=n(265215),I=n(331664);function k(e,t){return"USD"===t?"$".concat(e):"".concat(e," ").concat(t)}!function(e){e.CurrentUser="current_user",e.Other="other"}(x||(x={}));var E=function(e){function t(t){var n=e.call(this)||this;return n.iframe=t,n.destroy=function(){n.iframe.ownerDocument.defaultView.removeEventListener("message",n.handleMessage)},n.sendContext=function(e,t){n.sendMessage({action:c.IX.TwitchExtContext,context:e,updatedFields:t})},n.sendExtensionAuth=function(e){n.sendMessage({action:c.IX.TwitchExtAuth,auth:e})},n.sendExtensionBootstrap=function(e,t,i,o){n.sendMessage({action:c.IX.TwitchExtBootstrap,auth:e,features:t,configuration:i,viewerInfo:o})},n.sendSupervisorInit=function(e){n.sendMessage({action:c.bP.SupervisorInit,options:e})},n.sendFunctionReply=function(e){n.sendMessage(e)},n.sendExtensionReloadEntitlementsMessage=function(){n.sendMessage({action:c.IX.TwitchExtReloadEntitlements})},n.sendVisibilityChanged=function(e,t){n.sendMessage({action:c.IX.TwitchExtVisibilityChanged,isVisible:e,context:t})},n.sendPositionChange=function(e){n.sendMessage({action:c.IX.TwitchExtPositionChanged,position:e})},n.sendHighlightChange=function(e){n.sendMessage({action:c.IX.TwitchExtHighlightChanged,isHighlighted:e})},n.sendBitsProductsMessage=function(e){n.sendMessage({action:c.IX.TwitchExtBitsProducts,products:e})},n.sendBitsTransactionCompleteMessage=function(e){n.sendMessage(e)},n.sendHelperPubsubMessage=function(e,t,i){n.sendMessage({action:c.IX.TwitchExtPubsubMessage,payload:{target:e,contentType:t,content:i}})},n.sendHelperPubsubBindFailure=function(e,t){n.sendMessage({action:c.IX.TwitchExtPubsubBindFailure,payload:{target:e,error:t}})},n.sendViewerUpdateMessage=function(e){n.sendMessage({action:c.IX.TwitchExtViewerUpdate,viewerInfo:e})},n.sendConditionParticipantsResponseMessage=function(e,t,i){n.sendMessage({action:c.tv.ConditionParticipantsResponse,payload:{response:e,error:i,callbackGuid:t}})},n.sendConditionsResponseMessage=function(e,t,i){n.sendMessage({action:c.tv.ConditionsResponse,payload:{response:e,error:i,callbackGuid:t}})},n.sendCreateConditionResponseMessage=function(e,t,i){n.sendMessage({action:c.tv.CreateConditionResponse,payload:{response:e,error:i,callbackGuid:t}})},n.sendCallbackResponseMessage=function(e,t,i){n.sendMessage({action:c.IX.TwitchExtCallbackResponse,name:e,guid:t,payload:i})},n.handleMessage=function(e){var t=e.source,i=e.data;if(t===n.iframe.contentWindow)try{n.handleExtensionAction(i)}catch(e){}},n.handleExtensionAction=function(e){-1!==c.HX.indexOf(e.action)&&n.emit(e.action,e)},n.sendMessage=function(e){n.iframe&&n.iframe.contentWindow&&n.iframe.contentWindow.postMessage(e,I.W.supervisorOrigin)},n.iframe.ownerDocument.defaultView.addEventListener("message",n.handleMessage),n}return(0,i.__extends)(t,e),t.prototype.sendExtensionReloadMessage=function(){this.sendMessage({action:c.IX.TwitchExtReload})},t.prototype.sendExtensionProductPricesMessage=function(e){var t=e.products.reduce((function(e,t){var n=t.sku,i=t.price;return e[n]={displayPrice:k(i.price,i.currency_unit)},e}),{});this.sendMessage({action:c.IX.TwitchExtProductPrices,prices:t})},t}(u.EventEmitter),C=n(281200),P=function(e,t,n,i){var o=this;this.coordinator=e,this.loginId=t,this.extensionId=n,this.emitConfirmationRequest=i,this.functionActionMap=(0,C.j)(),this.functionModalMap=(0,C.j)(),this.registerFunctionModal=function(e,t){t.onOpen((function(n){var i={action:o.loginId?e:c.tv.LoginRequest,extensionId:o.extensionId,resultCallback:t.resultCallback,defaultResult:t.defaultResult};n&&(i.options=n),o.requestConfirmation(i)})),t.onModalResult&&t.onModalResult((function(e){o.sendFunctionReply(e)})),o.functionModalMap[e]=t,o.functionActionMap[e]=o.functionActionHandler(e),o.coordinator.on(e,o.functionActionMap[e])},this.unregisterFunctionModal=function(e){o.coordinator.off(e,o.functionActionMap[e]),delete o.functionActionMap[e],delete o.functionModalMap[e]},this.functionActionHandler=function(e){return function(t){var n=o.functionModalMap[e];n&&n.open(t)}},this.requestConfirmation=function(e){e.action!==c.tv.SubscribeToChannel?o.emitConfirmationRequest(e):q.ZO.emit(c.MB.RequestModal,e)},this.sendFunctionReply=function(e){o.coordinator.sendFunctionReply(e)}},S=n(834302),A=n(23042),O=n(238998);function T(e,t){var n=document.createElement("a");n.href=e;var i=n.search.slice(1),o=i.split("&").filter((function(e){return e.length>0})),r=o.length>0?e.slice(0,e.length-i.length-1):e,s=Object.keys(t).reduce((function(e,n){var i=t[n];return i&&("disable3PT"===n?e.push("disable_3pt"):e.push("".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(i.toString())))),e}),o);return s.length>0?"".concat(r,"?").concat(s.join("&")):e}var M,D,j,B=["yw6kqjk1xujxpvpafcy66ww3913y6c","pgn0bjv51epi7eaekt53tovjnc82qo","u03ulrft3383534y48flsakbewe8hq","vysfim0ck7k5a65fcr0d0t1x5jllpq","7nydnrue11053qmjc6g0fd6einj75p","2d2vfk9d8utgo0e9abb4j8p8po70ym","d0j6f4h633ds71x7mg5pm7uytj2yi8","14kjbovqviiaqi0geamleqffc95s6k","ih4ptg04wzw6nf4qms0612b8uj0tbh","ut0qm2nbknuy64d7t509w616a8d85l","a5qgosum7si05cdwematgg2ozjtaq2","mx8imve9jsliotbt7w6trgj7x9od9f","skt182bso1i1ah7dnmkwqkdk26dak4","sykmdeag9cvscn1y1p5pf0dbxn0fi0","beppk6jwody2s05grs2psadayasnqx","awp6xmg13j98jggleu6paar9cc9372","ypye12ifaxutfrddcm51os0j2szn9r","cs4gh6j6an4y90w3st2l26e39w5erj","gi1bgvj2ila0b89o8al5r9p5refuae","suw0n5ytcycbtvwhcvlgv7i81dz4ol","wt4i4dd9t3zujyxq1huxzs2j77c5so","7vhu0eg4sqer3hhw5xmzk9anb6j4cv","fcpzxwr00t4w3eq3040q7xk4i4oaks"];!function(e){e.Cancelled="cancelled",e.LoggedOut="logged_out_user",e.InvalidId="invalid_id",e.AlreadyFollowed="already_followed"}(M||(M={})),function(e){e.BadArguments="bad_arguments",e.ServiceError="service_error"}(D||(D={})),function(e){e.Cancelled="cancelled",e.LoggedOut="logged_out_user",e.InvalidID="invalid_id",e.UserIneligible="user_ineligible",e.InsufficientBalance="insufficient_balance",e.UnableToGetEligibility="unable_to_get_eligibility",e.UnableToLinkUser="unable_to_link_user",e.UseBitsFailure="use_bits_failure"}(j||(j={}));var R=function(){function e(e){this.developerCustomEventNames=[],this.dobbin=e.dobbin;var t,n,o=(t=e.iframe.ownerDocument.referrer,(n=document.createElement("a")).href=t,{host:n.host});this.trackingProperties=(0,i.__assign)((0,i.__assign)({},e.requiredProps),{url:e.iframe.ownerDocument.location.href,host:e.iframe.ownerDocument.location.host,domain:e.iframe.ownerDocument.domain,user_agent:e.iframe.ownerDocument.defaultView.navigator.userAgent,referrer_url:e.iframe.ownerDocument.referrer,referrer_host:o.host,extension_id:e.extension.clientId,extension_version:e.extension.version,extension_anchor:e.anchor,extension_mode:e.extensionMode})}return e.prototype.trackDeveloperCustomEvent=function(e){if(B.includes(this.trackingProperties.extension_id)&&!("string"!=typeof e.dev_event_name||e.dev_event_name.length>c.sg)&&c.MN.includes(e.category)&&c.E_.includes(e.interaction_type)&&(!e.custom_metadata||!("string"!=typeof e.custom_metadata||e.custom_metadata.length>c.E1))){if(!(e.dev_event_name in this.developerCustomEventNames)){if(this.developerCustomEventNames.length>=c.Nm)return;this.developerCustomEventNames.push(e.dev_event_name)}this.trackEvent("extension_custom_tracking_event",e)}},e.prototype.trackEvent=function(e,t){var n=(0,i.__assign)((0,i.__assign)({},t),this.trackingProperties);this.dobbin.trackEvent(e,n,["spade"])},e}(),U=function(){function e(e,t,n,o,s,a,c){var u=this;this.loginId=e,this.tracker=t,this.pubsub=n,this.onSuccess=o,this.extension=s,this.extensionBitsProducts=a,this.channelId=c,this.useBitsInProgress=!1,this.close=function(e){void 0===e&&(e=!1),u.replyCallback({action:S.t.UseBitsComplete,didConfirm:e,didUseBits:!1}),u.track(A.KA.UseBitsFailure)},this.onModalResult=function(e){u.replyCallback=function(t){u.useBitsInProgress=!1,t.didConfirm&&t.didUseBits&&u.onSuccess(t.bitsBalance||0),u.loginId&&u.offBitsBalanceUpdate(),e((0,i.__assign)({action:S.t.UseBitsComplete},t))}},this.onOpen=function(e){u.openCallback=function(t){u.track(A.KA.UseBitsInitialization),e(t)}},this.resultCallback=function(e){return e.didConfirm?(u.track(A.KA.UseBitsConfirmation),u.useBitsInExtension(u.transactionId,e.didConfirm)):(u.failReason=j.Cancelled,Promise.resolve(u.close()))},this.useBitsPromptRequired=function(e,t,n){return void 0===e&&(e=!1),e||t<n},this.openBitsConfirmationModal=function(e){u.loginId?u.openCallback&&(u.onBitsBalanceUpdate(u.loginId),u.openCallback({payload:(0,i.__assign)({userId:u.loginId,isLoggedIn:!!u.loginId,clientId:u.extension.clientId,extensionName:u.extension.name,track:u.track},e)})):u.failReason=j.LoggedOut},this.unsubscribeCallback=function(){},this.useBitsInExtension=function(e,t){return(0,i.__awaiter)(u,void 0,void 0,(function(){var n,o,s,a,c;return(0,i.__generator)(this,(function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,(0,d.SP)(this.channelId,this.extension.id,this.token,!0)];case 1:n=u.sent().token,O.b.registerToken(this.extension.clientId,this.channelId,n),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,(l=e,(0,i.__awaiter)(void 0,void 0,void 0,(function(){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,r.F.graphQLRequest("\nmutation UseBits($transactionID: ID!) {\n endUseBitsInExtension(input: {\n transactionID: $transactionID\n }) {\n balance\n }\n}\n",{transactionID:l})];case 1:if(!(e=t.sent()).endUseBitsInExtension||!e.endUseBitsInExtension.balance)throw new Error("Failed to useBits");return[2,{bits_balance:e.endUseBitsInExtension.balance}]}}))})))];case 3:return o=u.sent().bits_balance,s={action:S.t.UseBitsComplete,didConfirm:t,didUseBits:!0},this.track(A.KA.UseBitsSuccess),this.replyCallback((0,i.__assign)((0,i.__assign)({},s),{bitsBalance:o})),[2,o];case 4:return a=u.sent(),this.handleUseBitsError(a,j.UseBitsFailure,A.KA.UseBitsFailure),[3,5];case 5:return[3,7];case 6:return c=u.sent(),this.handleUseBitsError(c,j.UnableToLinkUser,A.KA.UseBitsLinkUserFailure),[3,7];case 7:return[2]}var l}))}))},this.handleUseBitsError=function(e,t,n){u.failReason=t,u.openCallback?(u.track(n),u.openCallback({error:e})):u.close(!0)},this.track=function(e,t){void 0===t&&(t={});var n={target_channel_id:u.channelId,user_id:u.loginId,client_id:u.extension.clientId,fail_reason:u.failReason,extension_name:u.extension.name,extension_item_label:u.extensionItemLabel,sku:u.sku,transaction_id:u.transactionId,bits_balance:u.bitsBalance,extension_id:u.extension.id,bits_required:u.bitsRequired};t=Object.assign(n,t),u.tracker.trackEvent(e,t)}}return Object.defineProperty(e.prototype,"defaultResult",{get:function(){return{didConfirm:!1,didUseBits:!1}},enumerable:!1,configurable:!0}),e.prototype.open=function(e){var t=this;if(!this.useBitsInProgress){this.useBitsInProgress=!0;var n,o,s,a=O.b.getToken(this.extension.clientId,this.channelId),c=(n=e.sku,o=this.channelId,s=this.extension.clientId,(0,i.__awaiter)(void 0,void 0,void 0,(function(){var e,t;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return[4,r.F.graphQLRequest("\nmutation IsEligible($channelID: ID!, $extensionID: ID!, $sku: String!) {\n beginUseBitsInExtension(input: {\n channelID: $channelID,\n extensionClientID: $extensionID,\n sku: $sku\n }) {\n balance\n bitsRequired\n isPromptRequired\n transactionID\n }\n}\n",{channelID:o,extensionID:s,sku:n})];case 1:if(e=i.sent(),!((t=e.beginUseBitsInExtension)&&t.transactionID&&t.isPromptRequired&&t.bitsRequired&&null!==t.balance))throw new Error("Extension is not eligible to use bits");return[2,{transaction_id:t.transactionID,prompt_required:t.isPromptRequired,bits_required:t.bitsRequired,bits_balance:t.balance}]}}))}))),u=this.extensionBitsProducts;Promise.all([c,u]).then((function(n){var i=n[0],o=n[1],r=i.bits_required,s=i.transaction_id,c=i.prompt_required,u=i.bits_balance,l=o.products;if(!t.useBitsPromptRequired(c,u,r))throw new Error("Use Bits always requires a prompt for now");var d=l.find((function(t){return t.sku===e.sku})),h=d?d.displayName:"";t.token=a.token,t.bitsBalance=u,t.bitsRequired=r,t.transactionId=s,t.sku=e.sku,t.extensionItemLabel=h,t.channelId||(t.failReason=j.InvalidID),t.openBitsConfirmationModal({channelId:t.channelId,sku:e.sku,bitsRequired:r,transactionId:s,extensionItemLabel:h,bitsBalance:u})})).catch((function(e){t.handleUseBitsError(e,j.UserIneligible,A.KA.UseBitsUserIneligible)}))}},e.prototype.onBitsBalanceUpdate=function(e){var t=this,n=r.F.authToken;this.unsubscribeCallback=this.pubsub.subscribe({token:n,topic:"".concat("user-bits-updates-v1",".").concat(e),success:function(){},failure:function(){},message:function(e){t.bitsBalance=e.data.balance,t.openCallback({payload:{channelId:t.channelId,clientId:t.extension.clientId,userId:t.loginId,isLoggedIn:!!t.loginId,sku:t.sku,bitsRequired:t.bitsRequired,transactionId:t.transactionId,extensionItemLabel:t.extensionItemLabel,extensionName:t.extension.name,bitsBalance:t.bitsBalance,track:t.track}})}})},e.prototype.offBitsBalanceUpdate=function(){this.unsubscribeCallback&&this.unsubscribeCallback()},e}(),q=n(25470);function F(e,t){return!!q.Zn.get(e,[]).find((function(e){return e===t}))}var L,N,$=function(){function e(e,t,n){var o=this;this.tracker=e,this.extensionId=t,this.extensionVersion=n,this.close=function(){o.replyCallback({action:S.t.ConditionConfirmationResponse,payload:{response:o.defaultResult,error:null,callbackGuid:o.callbackGuid}}),o.tracker.trackEvent("condition_confirmation_fail",o.trackerArgs(o.failReason))},this.onModalResult=function(e){o.replyCallback=e},this.onOpen=function(e){o.openCallback=function(t){o.tracker.trackEvent("condition_confirmation_init",o.trackerArgs(null)),e(t)}},this.resultCallback=function(e){e.acceptedCondition?(o.tracker.trackEvent("condition_confirmation_confirmed",o.trackerArgs(null)),o.createConditionParticipantFlow(o.extensionId,o.extensionVersion,o.conditionId,o.conditionOwnerId,o.bitsAmount,o.ttlSeconds)):o.close()},this.createConditionParticipantFlow=function(e,t,n,s,a,c){(function(e,t,n,o,s,a){return(0,i.__awaiter)(void 0,void 0,void 0,(function(){return(0,i.__generator)(this,(function(i){return[2,r.F.graphQLRequest("mutation CreateConditionParticipant(\n $extensionID: ID!\n $conditionID: ID!\n $conditionOwnerID: ID!\n $bitsAmount: Int!\n $ttlSeconds: Int!\n) {\n createBitsChallengeConditionParticipantForExtension(input: {\n conditionID: $conditionID\n conditionOwnerID: $conditionOwnerID\n bitsAmount: $bitsAmount\n ttlSeconds: $ttlSeconds\n extensionID: $extensionID\n }) {\n conditionParticipant {\n id\n endState\n processingState\n }\n }\n}",{extensionID:"".concat(e,":").concat(t),conditionID:n,conditionOwnerID:o,bitsAmount:s,ttlSeconds:a})]}))}))})(e,t,n,s,a,c).then((function(e){o.tracker.trackEvent("extension_condition_create_participant",o.trackerArgs(null)),o.replyCallback({action:S.t.ConditionConfirmationResponse,payload:{response:{acceptedCondition:!0,conditionParticipantId:e.createBitsChallengeConditionParticipantForExtension.conditionParticipant.id},error:null,callbackGuid:o.callbackGuid}})})).catch((function(e){o.tracker.trackEvent("extension_condition_create_service_failure",o.trackerArgs(D.ServiceError)),o.replyCallback({action:S.t.ConditionConfirmationResponse,payload:{response:{acceptedCondition:!0,conditionParticipantId:null},error:JSON.stringify(e),callbackGuid:o.callbackGuid}})}))}}return Object.defineProperty(e.prototype,"defaultResult",{get:function(){return{acceptedCondition:!1,conditionParticipantId:null}},enumerable:!1,configurable:!0}),e.prototype.open=function(e){F("ext_challenges_whitelist",this.extensionId)&&(this.conditionId=e.payload.request.conditionId,this.conditionOwnerId=e.payload.request.conditionOwnerId,this.bitsAmount=e.payload.request.bitsAmount,this.ttlSeconds=e.payload.request.ttlSeconds,this.callbackGuid=e.payload.request.callbackGuid,!(this.conditionId&&this.conditionOwnerId&&this.bitsAmount)||this.bitsAmount<=0||!this.ttlSeconds||this.ttlSeconds<=0?this.failReason=D.BadArguments:this.openCallback(e.payload.request))},e.prototype.trackerArgs=function(e){return{condition_id:this.conditionId,condition_owner_id:this.conditionOwnerId,bits_amount:this.bitsAmount,extension_id:this.extensionId,fail_reason:e}},e}(),V=function(e,t){return(0,i.__awaiter)(void 0,void 0,void 0,(function(){var n,o,s,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,r.F.graphQLRequest("\nmutation FollowChannelByLogin($channelID: ID!, $disableNotifications:Boolean!) {\n followUser(input: {\n targetID: $channelID,\n disableNotifications:$disableNotifications\n }) {\n follow {\n user {\n id\n }\n }\n }\n}\n",{channelID:e,disableNotifications:!t})];case 1:return(n=i.sent())&&n.followUser&&n.followUser.follow&&n.followUser.follow.user?(o=n.followUser.follow.user,s=o.login,a=o.id,[2,{channel:s,channelId:a,isFollowing:!0}]):[2,{channel:null,channelId:null,isFollowing:!1}];case 2:return i.sent(),[2,{channel:null,channelId:null,isFollowing:!1}];case 3:return[2]}}))}))},H=function(){function e(e,t){var n=this;this.loginId=e,this.tracker=t,this.close=function(){n.replyCallback({action:S.t.FollowComplete,channel:n.channel,didFollow:!1}),n.tracker.trackEvent("extension_follow_fail",{target_channel:n.channel,target_channel_id:n.channelId,fail_reason:n.failReason})},this.onModalResult=function(e){n.replyCallback=e},this.onOpen=function(e){n.openCallback=function(t){n.tracker.trackEvent("extension_follow_init",{target_channel:t.channel,target_channel_id:t.channelId}),e(t)}},this.resultCallback=function(e){e.didFollow?(n.tracker.trackEvent("extension_follow_confirm",{target_channel:n.channel,target_channel_id:n.channelId}),n.follow(n.channelId,e.notifications)):n.close()},this.follow=function(e,t){return(0,i.__awaiter)(n,void 0,void 0,(function(){var n,o,r,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return[4,V(e,t)];case 1:return n=i.sent(),o=n.channel,r=n.channelId,s=n.isFollowing,this.tracker.trackEvent("extension_follow",{target_channel:o||this.channel,target_channel_id:r||this.channelId}),this.replyCallback({action:S.t.FollowComplete,channel:o||this.channel,didFollow:s}),[2]}}))}))}}return Object.defineProperty(e.prototype,"defaultResult",{get:function(){return{didFollow:!1,notifications:!1}},enumerable:!1,configurable:!0}),e.prototype.open=function(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,n,o,s;return(0,i.__generator)(this,(function(a){switch(a.label){case 0:return this.channel=e.payload.channel,this.loginId?[4,(c=this.channel,(0,i.__awaiter)(void 0,void 0,void 0,(function(){var e,t,n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return[4,r.F.graphQLRequest("\n query FollowStatusForLogin($login: String) {\n user(login: $login) {\n id\n self {\n follower {\n node {\n id\n }\n }\n }\n }\n }",{login:c})];case 1:return(e=i.sent()).user&&e.user.id?(t=e.user.id,(n=e.user.self)&&n.follower&&n.follower.node&&n.follower.node.id?[2,{channel:c,channelId:t,isFollowing:!0}]:[2,{channel:c,channelId:t,isFollowing:!1}]):[2,{channel:c,channelId:null,isFollowing:!1}]}}))})))]:(this.channelId=null,this.openCallback&&this.openCallback({channel:this.channel,channelId:0,isFollowing:!1,isLoggedIn:!1}),this.failReason=M.LoggedOut,[2]);case 1:return t=a.sent(),n=t.channel,o=t.channelId,s=t.isFollowing,this.channelId=o,this.openCallback&&this.openCallback({channel:n,channelId:this.channelId?parseInt(this.channelId,10):0,isFollowing:s,isLoggedIn:!0}),this.failReason=null===n?M.InvalidId:s?M.AlreadyFollowed:M.Cancelled,[2]}var c}))}))},e}(),X=function(){function e(){var e=this;this.close=function(){},this.onOpen=function(t){e.openCallback=t},this.onModalResult=function(){},this.resultCallback=function(){}}return Object.defineProperty(e.prototype,"defaultResult",{get:function(){return null},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.openCallback()},e}();!function(e){e.UNKNOWN="UNKNOWN",e.UNAUTHORIZED="UNAUTHORIZED"}(L||(L={})),function(e){e.Component="component",e.Config="config",e.Hidden="hidden",e.LiveConfig="liveConfig",e.Mobile="mobile",e.Panel="panel",e.VideoOverlay="videoOverlay"}(N||(N={}));var W,z=function(){function e(e){this.extension=e}return Object.defineProperty(e.prototype,"clientId",{get:function(){return this.extension.clientId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitsEnabled",{get:function(){return this.extension.bitsEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return this.extension.description},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.extension.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.extension.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requestIdentityLink",{get:function(){return this.extension.requestIdentityLink},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sku",{get:function(){return this.extension.sku},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"summary",{get:function(){return this.extension.summary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this.extension.token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this.extension.version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"views",{get:function(){return this.extension.views},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vendorCode",{get:function(){return this.extension.vendorCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this.extension.state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"whitelistedConfigUrls",{get:function(){return this.extension.allowlistedConfigUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"whitelistedPanelUrls",{get:function(){return this.extension.allowlistedPanelUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowlistedConfigUrls",{get:function(){return this.extension.allowlistedConfigUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowlistedPanelUrls",{get:function(){return this.extension.allowlistedPanelUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"asObject",{get:function(){return this.extension},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"panelHeight",{get:function(){return this.extension.views.panel&&this.extension.views.panel.height},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMonetized",{get:function(){return!(!this.extension.sku||!this.extension.vendorCode)},enumerable:!1,configurable:!0}),e.prototype.getViewerUrlForContext=function(e,t,n){var i="";switch(e){case c.z$.Web:i=this.getViewerUrlForWeb(t,n);break;case c.z$.Mobile:i=this.getViewerUrlForMobile()}return i||""},e.prototype.getViewerUrlForWeb=function(e,t){var n=this.extension.views;switch(e){case c.Fw.Config:return n.config&&n.config.viewerUrl;case c.Fw.Dashboard:return n.liveConfig&&n.liveConfig.viewerUrl;case c.Fw.Viewer:return this.getViewerUrlForAnchor(t)}},e.prototype.getViewerUrlForMobile=function(){return this.extension.views.mobile&&this.extension.views.mobile.viewerUrl},e.prototype.getViewerUrlForAnchor=function(e){var t=this.extension.views;switch(e){case c.Z1.Component:return t.component.viewerUrl;case c.Z1.Hidden:return t.hidden.viewerUrl;case c.Z1.Overlay:return t.videoOverlay.viewerUrl;case c.Z1.Panel:return t.panel.viewerUrl}},e}();function Z(e,t){return{isBitsEnabled:t.isBitsEnabled&&e.isBitsEnabled,isChatEnabled:e.isChatEnabled,isSubscriptionStatusAvailable:e.isSubscriptionStatusAvailable,useSharedPubsub:t.useSharedPubsub}}!function(e){e.Unauthorized="UNAUTHORIZED",e.Unknown="UNKNOWN"}(W||(W={}));var G=n(656680),K=function(){function e(e,t,n,i){var o=this;this.coordinator=e,this.tracker=t,this.authData=n,this.unsubscribeMap={},this.lastSequenceInfoMap={},this.onHelperListenMessage=function(e){o.listen(e.target)},this.onHelperUnlistenMessage=function(e){o.unlisten(e.target)},this.onSubscribeSuccess=function(){},this.createSubscribeFailureCallbackForTarget=function(e){return function(t){o.coordinator.sendHelperPubsubBindFailure(e,t)}},this.createCallbackForTarget=function(e){return function(t){o.isExtensionTarget(e)?(o.coordinator.sendHelperPubsubMessage(e,t.content_type,t.content),t.sequence&&o.trackSequence(o.convertToTopic(e),e,t.sequence.start,t.sequence.number)):o.coordinator.sendHelperPubsubMessage(e,"application/plain",[JSON.stringify(t)])}},this.pubsub=i||new G.Q,this.coordinator.on(c.IX.TwitchExtPubsubListen,this.onHelperListenMessage),this.coordinator.on(c.IX.TwitchExtPubsubUnlisten,this.onHelperUnlistenMessage)}return e.prototype.destroy=function(){var e=this;this.coordinator.off(c.IX.TwitchExtPubsubListen,this.onHelperListenMessage),this.coordinator.off(c.IX.TwitchExtPubsubUnlisten,this.onHelperUnlistenMessage),Object.keys(this.unsubscribeMap).forEach((function(t){e.unlisten(t)}))},e.prototype.listen=function(e){this.unsubscribeMap[e]||(this.unsubscribeMap[e]=this.pubsub.subscribe({topic:this.convertToTopic(e),success:this.onSubscribeSuccess,failure:this.createSubscribeFailureCallbackForTarget(e),message:this.createCallbackForTarget(e),token:this.authData&&this.authData.token}),this.lastSequenceInfoMap[e]={})},e.prototype.unlisten=function(e){var t=this.unsubscribeMap[e];t&&(t(),delete this.lastSequenceInfoMap[e])},e.prototype.updateAuthData=function(e){this.authData=e},e.prototype.isExtensionTarget=function(e){return-1===e.indexOf(".")},e.prototype.convertToTopic=function(e){if(this.isExtensionTarget(e)&&this.authData){var t=this.authData.channelId;return"global"===e&&(t="all"),"channel-ext-v1.".concat(t,"-").concat(this.authData.clientId,"-").concat(e)}return e},e.prototype.trackSequence=function(e,t,n,i){if(this.lastSequenceInfoMap[t]){var o=this.lastSequenceInfoMap[t].sequenceTime,r=this.lastSequenceInfoMap[t].sequenceNumber;if(r&&(o!==n&&(r=0),r<i-1)){var s=r+1,a=i-s,c=i-1;this.tracker.trackEvent("extension_pubsub_missed",{topic:e,target:t,sequenceStart:n,firstMissedSequenceNumber:s,lastMissedSequenceNumber:c,missed:a})}this.lastSequenceInfoMap[t]={sequenceNumber:i,sequenceTime:n},this.tracker.trackEvent("extension_pubsub_received",{topic:e,target:t,sequenceStart:n,sequenceNumber:i})}},e}(),Q=n(536455),Y=function(){function e(){}return e.prototype.makePurchase=function(e,t,n){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(i){return[2,Promise.resolve().then((function(){window.open("".concat(e.action_details.destination_url,"&br_id=").concat((0,Q.l)("".concat(t)),"&locale=").concat(n),"Twitch","width=1024,height=600,scrollbars=yes")}))]}))}))},e}(),J=function(){return window.innerHeight},ee=function(e){return e.getBoundingClientRect()},te=n(740115),ne=new(n.n(te)());function ie(e){if(ne.has(e))return ne.get(e);var t=e();return ne.set(e,t),t}var oe,re=["allow-forms","allow-scripts","allow-same-origin","allow-popups","allow-popups-to-escape-sandbox"];!function(e){e[e.SupervisorFrame=0]="SupervisorFrame",e[e.ExtensionFrame=1]="ExtensionFrame"}(oe||(oe={}));var se=function(e){function t(t){var n,o,s,a=e.call(this)||this;return a.lastSequenceInfoMap={},a.bitsMessagePubsubUnsubscribes=[],a.handleUserAction={click:function(e){var t=e.payload,n=this.iframe.getBoundingClientRect(),i=n.width,o=n.height;this.tracker.trackEvent("extension_click",{px_mouse_coord_x:t.clientX,px_mouse_coord_y:t.clientY,pct_mouse_coord_x:t.clientX/i*100,pct_mouse_coord_y:t.clientY/o*100,element_tag:t.elementTag||"",element_class:t.elementClass?t.elementClass.substring(0,255):""})},dblclick:function(e){this.throttleDblClick(this.iframe,e)},mousemove:function(e){var t=e.payload,n=this.iframe.getBoundingClientRect(),i=n.left,o=n.top,r=t.clientX,s=t.clientY,a=i+r,c=o+s;try{this.iframe.dispatchEvent(new MouseEvent("mousemove",{clientX:r,clientY:s,screenX:a,screenY:c,bubbles:!0}))}catch(e){var u=document.createEvent("MouseEvent");u.initMouseEvent("mousemove",!0,!1,window,0,a,c,r,s,!1,!1,!1,!1,0,null),this.iframe.dispatchEvent(u)}},focusin:function(){if(this.activationAnchor===c.Z1.Overlay){for(var e=this.iframe;e&&!e.hasAttribute("tabindex");)e=e.parentElement;e&&e.focus()}}},a.hasSentViewEvent=!1,a.hasBootstrapped=!1,a.hasLoaded=!1,a.throttleDblClick=(n=function(e,t){var n=t.payload,i=e.getBoundingClientRect(),o=i.left,r=i.top;e.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0,clientX:n.clientX,clientY:n.clientY,screenX:o+n.clientX,screenY:r+n.clientY}))},o=1e3,s=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];s||(s=!0,setTimeout((function(){s=!1}),o),n.apply(null,e))}),a.isVisible=!0,a.destroy=function(){a.unsetupListeners(),a.bitsMessagePubsubUnsubscribes.forEach((function(e){e()})),a.coordinator.destroy(),a.iframe.remove()},a.linkIdentity=function(){return(0,i.__awaiter)(a,void 0,void 0,(function(){var e,t,n,o;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return(e=O.b.getToken(this.extension.clientId,this.channelId)).isLinked?[3,2]:[4,(0,d.SP)(this.channelId,this.extension.clientId,e.token,!0)];case 1:t=i.sent(),n=t.token,o=t.helix_token,O.b.registerTokens(this.extension.clientId,this.channelId,{token:n,helixToken:o}),this.tracker.trackEvent("extension_ui_interaction_client",{extension_interaction:"grant"}),i.label=2;case 2:return[2]}}))}))},a.unlinkIdentity=function(){return(0,i.__awaiter)(a,void 0,void 0,(function(){var e,t,n,o;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return(e=O.b.getToken(this.extension.clientId,this.channelId)).isLinked?[4,(0,d.SP)(this.channelId,this.extension.clientId,e.token,!1)]:[3,2];case 1:t=i.sent(),n=t.token,o=t.helix_token,O.b.registerTokens(this.extension.clientId,this.channelId,{token:n,helixToken:o}),this.tracker.trackEvent("extension_ui_interaction_client",{extension_interaction:"revoke"}),i.label=2;case 2:return[2]}}))}))},a.visibilityChanged=function(){if(!a.hasSentViewEvent&&a.activationAnchor===c.Z1.Panel&&a.params.mode===c.Fw.Viewer){var e=ee(a.iframe),t=e.bottom-e.top,n=J();100*(Math.min(Math.max(n-e.top,0),t)/t)>=75&&(a.tracker.trackEvent("extension_view",{pct_view_visible:75,px_view_visible:Math.floor(75*t/100)}),a.hasSentViewEvent=!0)}},a.setVisible=function(e){if(a.hasLoaded&&a.isVisible!==e){var t=e?a.contextManager.context:null;a.coordinator.sendVisibilityChanged(e,t)}a.isVisible=e},a.setPosition=function(e){a.coordinator.sendPositionChange(e)},a.setHighlighted=function(e){a.coordinator.sendHighlightChange(e)},a.buildTracker=function(){var e=a.params;return e.extensionTracker||new R({anchor:a.activationAnchor,dobbin:e.dobbin,extension:a.extension,extensionMode:e.mode,iframe:a.iframe,requiredProps:{login:e.trackingProperties.login,channel:e.trackingProperties.channel,channel_id:e.channelId,device_id:e.trackingProperties.device_id,user_id:e.loginId,platform:e.trackingProperties.platform,player_type:e.trackingProperties.player_type,locale:a.locale,login_id:e.loginId}})},a.getContextManager=function(){return q.ZO.getContextManager()},a.buildCoordinator=function(){return a.params.extensionCoordinator||new E(a.iframe)},a.buildFunctionManager=function(){return a.params.functionManager||new P(a.coordinator,a.params.loginId,a.params.extension.id,a.emitConfirmationRequest)},a.buildPurchaseService=function(){return a.params.purchaseService||new Y},a.getExtensionHeight=function(){var e=a.extension.panelHeight;return e?Number(e):300},a.getDefaultAnchorAttributes=function(){var e={};return a.params.mode===c.Fw.Viewer&&a.extensionOptions.platform!==c.z$.Mobile&&(e.scrolling="no"),e},a.getAnchorAttributes=function(e){var t={};if(a.params.isPopout||!1||[c.Fw.Config,c.Fw.Dashboard].includes(a.params.mode))return e===oe.ExtensionFrame&&(t.style="height: 100%;"),t;switch(a.activationAnchor){case c.Z1.Panel:if(a.extensionOptions.platform===c.z$.Mobile){t.style="height: 100%;";break}var n=a.getExtensionHeight();t.style="height: ".concat(n,"px;");break;case c.Z1.Overlay:case c.Z1.Component:case c.Z1.Hidden:return a.getDefaultAnchorAttributes()}return t},a.applyAnchorAttributesForSupervisor=function(e){var t=a.getAnchorAttributes(oe.SupervisorFrame).style;t&&e.setAttribute("style",t)},a.createSupervisorIFrame=function(e){var t=a.params.mode,n=document.createElement("iframe");switch(n.setAttribute("class",e),n.setAttribute("frameBorder","0"),n.setAttribute("scrolling","no"),n.setAttribute("src",I.W.supervisorURL),n.setAttribute("sandbox",a.getSandboxFlags()),n.setAttribute("allow","encrypted-media *"),t){case c.Fw.Viewer:a.applyAnchorAttributesForSupervisor(n);break;case c.Fw.Dashboard:case c.Fw.Config:a.params.isPopout||n.setAttribute("style","width: 100%; height: 100%;")}return n.style.display="none",n},a.initSupervisedExtension=function(){var e=a.params.mode,t=a.extensionOptions.platform,n=a.extension.getViewerUrlForContext(t,e,a.activationAnchor),i=a.getAnchorAttributes(oe.ExtensionFrame);i.sandbox=a.getSandboxFlags();var o={extensionURL:T(n,a.extensionOptions),hostOrigin:window.location.origin,iframeAttrs:i};a.coordinator.sendSupervisorInit(o);a.extension.state!==c.HY.Released&&(a.helperNotLoadedTimeout=window.setTimeout((function(){console.warn("Extension Warning (".concat(a.extension.id,"): Extension Helper Library Not Loaded"))}),1e4))},a.getExtensionAuth=function(){var e=O.b.getToken(a.extension.clientId,a.channelId),t=O.b.getHelixToken(a.extension.clientId,a.channelId);return{channelId:e.payload.channel_id,clientId:a.extension.clientId,helixToken:t,token:e.token,userId:e.payload.opaque_user_id}},a.onLongtask=function(e){a.tracker.trackEvent("extension_longtask",{longtask_duration:e.payload.longtask_duration})},a.onMouseEnter=function(){a.tracker.trackEvent("extension_mouseenter",{})},a.handleToken=function(e,t){a.helperPubsubAdapter&&a.helperPubsubAdapter.updateAuthData(a.getExtensionAuth()),a.hasLoaded&&!e.isNearExpiration&&(a.hasBootstrapped?a.shouldReloadExtension(e,t)?a.reloadExtension():a.sendAuthUpdate(e):a.sendBootstrap(e))},a.shouldReloadExtension=function(e,t){var n=e.isLinked!==t.isLinked;return n&&!e.isLinked||n&&!a.extension.bitsEnabled},a.onExtensionLoaded=function(){a.hasLoaded=!0,a.contextManager.initializeContext(),a.helperNotLoadedTimeout&&(clearTimeout(a.helperNotLoadedTimeout),delete a.helperNotLoadedTimeout),a.tracker.trackEvent("extension_helper_load_success",{}),a.iframe.style.removeProperty("display");var e=O.b.getToken(a.extension.clientId,a.channelId);a.handleToken(e,e),a.emit(c.WN.ExtensionFrameLoaded,a.extension.asObject),a.sendExtensionProductPrices(),a.sendExtensionBitsProductPrices(),a.sendExtensionDisplayState()},a.onExtensionUserAction=function(e){a.handleUserAction[e.payload.type].call(a,e)},a.onConditionParticipantsRequest=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n;return(0,i.__generator)(this,(function(o){switch(o.label){case 0:return F("ext_challenges_whitelist",this.extension.id)?[4,(s=this.extension.id,a=this.extension.version,c=this.channelId,u=e.payload.participantId,l=e.payload.participantsAfter,(0,i.__awaiter)(void 0,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){return[2,r.F.graphQLRequest("query ChallengeParticipants(\n $extensionID: ID!\n $extensionVersion: String\n $conditionOwnerID: ID!\n $conditionParticipantOwnerID: ID!\n $participantsAfter: Cursor\n) {\n extension(id: $extensionID, version: $extensionVersion) {\n id\n challengeConditionParticipants(\n after: $participantsAfter\n input:{\n endState: PENDING\n conditionOwnerID: $conditionOwnerID\n conditionParticipantOwnerID: $conditionParticipantOwnerID\n })\n {\n pageInfo{\n hasNextPage\n hasPreviousPage\n }\n edges{\n node {\n id\n endState\n processingState\n condition {\n id\n }\n }\n cursor\n }\n }\n }\n }",{extensionID:s,extensionVersion:a,conditionsAfter:l,conditionOwnerID:c,conditionParticipantOwnerID:u})]}))})))]:[2];case 1:t=o.sent();try{n=function(e){if(null===e.extension||null===e.extension.challengeConditionParticipants)return null;for(var t=e.extension.challengeConditionParticipants,n=new Array,i=t.pageInfo.hasNextPage,o="",r=0;r<t.edges.length;r++)n.push(t.edges[r].node),r===t.edges.length-1&&(o=t.edges[r].cursor);return{conditionParticipants:n,cursor:o,hasNextPage:i}}(t),this.coordinator.sendConditionParticipantsResponseMessage(n,e.payload.callbackGuid)}catch(t){this.coordinator.sendConditionParticipantsResponseMessage(null,e.payload.callbackGuid,JSON.stringify(t))}return[2]}var s,a,c,u,l}))}))},a.onConditionsRequest=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n,o;return(0,i.__generator)(this,(function(s){switch(s.label){case 0:if(!F("ext_challenges_whitelist",this.extension.id))return[2];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(a=this.extension.id,c=this.extension.version,u=this.channelId,l=e.payload.conditionsAfter,(0,i.__awaiter)(void 0,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){return[2,r.F.graphQLRequest("query ChallengeConditions(\n $extensionID: ID!\n $extensionVersion: String\n $conditionOwnerID: ID!\n $conditionsAfter: Cursor\n) {\n extension(id: $extensionID, version: $extensionVersion) {\n challengeConditions(after: $conditionsAfter,\n input:{\n conditionOwnerID: $conditionOwnerID,\n state: ACTIVE\n })\n {\n pageInfo{\n hasNextPage\n hasPreviousPage\n }\n edges{\n node {\n id\n name\n state\n createdAt\n timeoutAt\n updatedAt\n participantSummary {\n pending {\n total\n effects {\n useBits {\n totalBitsAmount\n }\n }\n }\n satisfied {\n total\n effects {\n useBits {\n totalBitsAmount\n }\n }\n }\n }\n }\n cursor\n }\n }\n }\n }\n",{extensionID:a,extensionVersion:c,conditionsAfter:l,conditionOwnerID:u})]}))})))];case 2:return t=s.sent(),n=function(e){if(null===e.extension||null===e.extension.challengeConditions)return null;for(var t=e.extension.challengeConditions,n=new Array,i=t.pageInfo.hasNextPage,o="",r=0;r<t.edges.length;r++){var s=t.edges[r].node;n.push({id:s.id,name:s.name,state:s.state,createdAt:s.createdAt,timeoutAt:s.timeoutAt,updatedAt:s.updatedAt,totalBits:s.participantSummary.pending.effects.useBits.totalBitsAmount,totalParticipants:s.participantSummary.pending.total}),r===t.edges.length-1&&(o=t.edges[r].cursor)}return{challengeConditions:n,cursor:o,hasNextPage:i}}(t),this.coordinator.sendConditionsResponseMessage(n,e.payload.callbackGuid),[3,4];case 3:return o=s.sent(),this.coordinator.sendConditionsResponseMessage(null,e.payload.callbackGuid,JSON.stringify(o)),[3,4];case 4:return[2]}var a,c,u,l}))}))},a.onCreateConditionRequest=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n;return(0,i.__generator)(this,(function(o){switch(o.label){case 0:if(!F("ext_challenges_whitelist",this.extension.id))return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,(s=this.extension.id,a=this.channelId,c=this.extension.version,u=e.payload.name,l=e.payload.disableWhenSatisfied,(0,i.__awaiter)(void 0,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){return[2,r.F.graphQLRequest("mutation CreateCondition(\n $extensionID: ID!\n $extensionInstallationChannelID: ID!\n $disableWhenSatisfied: Boolean!\n $name: String!\n) {\n createBitsChallengeConditionForExtension(input: {\n disableWhenSatisfied: $disableWhenSatisfied\n name: $name\n extensionID: $extensionID\n extensionInstallationChannelID: $extensionInstallationChannelID\n }) {\n condition {\n id\n state\n name\n createdAt\n updatedAt\n }\n }\n}",{extensionID:"".concat(s,":").concat(c),extensionInstallationChannelID:a,name:u,disableWhenSatisfied:l})]}))})))];case 2:return t=o.sent(),this.coordinator.sendCreateConditionResponseMessage({condition:t.createBitsChallengeConditionForExtension.condition},e.payload.callbackGuid),[3,4];case 3:return n=o.sent(),this.coordinator.sendCreateConditionResponseMessage(null,e.payload.callbackGuid,JSON.stringify(n)),[3,4];case 4:return[2]}var s,a,c,u,l}))}))},a.onExtensionPubSubRecived=function(e){var t=e.payload;a.trackSequence(t.topic,t.target,t.sequenceStart,t.sequenceNumber)},a.onExtensionNetworkTraffic=function(e){var t;a.tracker.trackEvent("extension_network_request",{request_duration:e.payload.duration,request_end_time:e.payload.endTime,request_file_type:(t=e.payload.url,t&&t.split(".").pop()||""),request_start_time:e.payload.startTime,request_url:e.payload.url})},a.emitConfirmationRequest=function(e){a.emit(c.WN.RequestModal,e)},a.sendAuthUpdate=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return this.sendIdentityLinkUpdate(e),this.coordinator.sendExtensionAuth(this.getExtensionAuth()),t=Z(this.installationAbilities,this.clientAbilities),e.isLinked&&t.isSubscriptionStatusAvailable?[4,q.ZO.getViewerInfoForChannel("".concat(this.params.channelId))]:[3,2];case 1:n=i.sent(),this.coordinator.sendViewerUpdateMessage(n),i.label=2;case 2:return[2]}}))}))},a.sendBootstrap=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return this.hasBootstrapped=!0,this.sendIdentityLinkUpdate(e),(t=Z(this.installationAbilities,this.clientAbilities)).isSubscriptionStatusAvailable&&e.isLinked?[4,q.ZO.getViewerInfoForChannel("".concat(this.params.channelId))]:[3,2];case 1:return n=i.sent(),this.coordinator.sendExtensionBootstrap(this.getExtensionAuth(),t,this.configuration,n),[3,3];case 2:this.coordinator.sendExtensionBootstrap(this.getExtensionAuth(),t,this.configuration,{subscriptionStatus:null}),i.label=3;case 3:return this.activationAnchor===c.Z1.Component&&this.setPosition({x:0,y:0}),[2]}}))}))},a.sendIdentityLinkUpdate=function(e){var t=e.isUserLoggedIn&&a.canRequestIdLink;a.emit(c.WN.IdentityLinked,e.isLinked,t)},a.beginPurchase=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n,o,r,s,a=this;return(0,i.__generator)(this,(function(c){switch(c.label){case 0:return t=e.payload.sku,n=this.extension.vendorCode,[4,this.extensionProducts];case 1:if(o=c.sent(),!(r=o.products.find((function(e){return e.sku===t}))))throw new Error("An extension product with the SKU ".concat(t," could not be found."));return s={asin:r.asin,developer_name:r.developer_name,item_name:r.title,item_description:r.description,item_description_short:r.short_description,item_price:r.price.price,item_price_currency:r.price.currency_unit,vendor_code:n,sku:r.sku},this.tracker.trackEvent("extension_start_buy",s),this.onBeginPurchase&&this.onBeginPurchase(this.formatExtensionProductForDisplay(r),(function(){return(0,i.__awaiter)(a,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){return this.tracker.trackEvent("extension_confirm_buy",s),this.linkIdentity(),this.purchaseService.makePurchase(r,this.params.channelId,this.locale),[2]}))}))})),[2]}}))}))},a.onContextUpdate=function(e,t){a.isVisible&&(a.params.mode===c.Fw.Viewer?(e.game||(e.game=""),e.playbackMode||(e.playbackMode=c.LS.Video)):delete e.game,e.mode=a.params.mode,a.coordinator.sendContext(e,t))},a.onCallbackRequest=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return[4,m(function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(n){switch(n.label){case 0:switch(t.name){case _.SetConfiguration:return[3,1];case _.SendMessageToPubsub:return[3,3]}return[3,5];case 1:return[4,y(e,t)];case 2:case 4:return[2,n.sent()];case 3:return[4,p(e,t)];case 5:throw new Error('unexpected callback "'.concat(t.name,'"'))}}))}))}(this.callbackContext,e.request))];case 1:return t=n.sent(),this.coordinator.sendCallbackResponseMessage(e.request.name,e.guid,t),[2]}}))}))},a.onExtensionClientError=function(e){a.emit(c.WN.ExtensionClientError,e)},a.setupListeners=function(){a.eventListeners=[{target:a.iframe,event:"mouseenter",callback:a.onMouseEnter.bind(a)}],a.eventListeners.forEach((function(e){e.target.addEventListener(e.event,e.callback)})),a.contextManager.on(w.Gt.Context,a.onContextUpdate),a.coordinator.on(c.bP.SupervisorReady,a.initSupervisedExtension),a.coordinator.on(c.IX.TwitchExtLoaded,a.onExtensionLoaded),a.coordinator.on(c.tv.TwitchExtMinimize,a.onMinimize),a.coordinator.on(c.IX.TwitchExtNetworkTiming,a.onExtensionNetworkTraffic),a.coordinator.on(c.IX.TwitchExtUserAction,a.onExtensionUserAction),a.coordinator.on(c.IX.TwitchExtCustomTrackEvent,a.trackDeveloperCustomEvent),a.onBeginPurchase&&a.coordinator.on(c.IX.TwitchExtBeginPurchase,a.beginPurchase),a.coordinator.on(c.IX.TwitchExtBitsOnHover,a.showBitsBalance),a.coordinator.on(c.IX.TwitchExtPubSubReceived,a.onExtensionPubSubRecived),a.coordinator.on(c.IX.TwitchExtLongtask,a.onLongtask),a.coordinator.on(c.tv.ConditionParticipantsRequest,a.onConditionParticipantsRequest),a.coordinator.on(c.tv.ConditionsRequest,a.onConditionsRequest),a.coordinator.on(c.tv.CreateConditionRequest,a.onCreateConditionRequest),a.coordinator.on(c.IX.TwitchExtCallbackRequest,a.onCallbackRequest),a.coordinator.on(c.IX.TwitchExtClientError,a.onExtensionClientError),O.b.subscribe(a.extension.clientId,a.channelId,a.handleToken);var e=O.b.getToken(a.extension.clientId,a.channelId);e&&!e.isNearExpiration&&a.handleToken(e,e),a.bindHelperPubsub()},a.reloadExtension=function(){a.hasLoaded=!1,a.hasBootstrapped=!1,a.coordinator.sendExtensionReloadMessage()},a.unsetupListeners=function(){a.eventListeners.forEach((function(e){e.target.removeEventListener(e.event,e.callback)})),a.contextManager.off(w.Gt.Context,a.coordinator.sendContext),a.coordinator.off(c.IX.TwitchExtLoaded,a.onExtensionLoaded),a.coordinator.off(c.IX.TwitchExtNetworkTiming,a.onExtensionNetworkTraffic),a.coordinator.off(c.IX.TwitchExtUserAction,a.onExtensionUserAction),a.coordinator.off(c.IX.TwitchExtLongtask,a.onLongtask),a.coordinator.off(c.tv.TwitchExtMinimize,a.onMinimize),a.coordinator.off(c.tv.ConditionParticipantsRequest,a.onConditionParticipantsRequest),a.coordinator.off(c.tv.ConditionsRequest,a.onConditionsRequest),a.coordinator.off(c.tv.CreateConditionRequest,a.onCreateConditionRequest),a.unregisterFunctionModals(),O.b.unsubscribe(a.extension.clientId,a.channelId,a.handleToken),a.helperPubsubAdapter&&a.helperPubsubAdapter.destroy()},a.registerFunctionModals=function(){a.functionManager.registerFunctionModal(c.tv.FollowAction,new H(a.params.loginId,a.tracker));var e=Z(a.installationAbilities,a.clientAbilities).isSubscriptionStatusAvailable;a.functionManager.registerFunctionModal(c.tv.SubscribeToChannel,new l.Z0(a.params.extension.clientId,e)),a.canRequestIdLink&&a.functionManager.registerFunctionModal(c.tv.IdShareRequest,new X),a.extension.bitsEnabled&&(a.functionManager.registerFunctionModal(c.tv.UseBits,new U(String(a.params.loginId),a.tracker,new G.Q,a.showUseBitsSuccess,a.extension,a.extensionBitsProducts,a.channelId)),a.functionManager.registerFunctionModal(c.tv.ConditionConfirmationRequest,new $(a.tracker,a.extension.id,a.extension.version)))},a.unregisterFunctionModals=function(){a.functionManager.unregisterFunctionModal(c.tv.FollowAction),a.extension.bitsEnabled&&(a.functionManager.unregisterFunctionModal(c.tv.UseBits),a.functionManager.unregisterFunctionModal(c.tv.ConditionConfirmationRequest))},a.handlePurchaseCompleted=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return t=e.msg.sku,[4,this.extensionProducts];case 1:return n=i.sent(),n.products.find((function(e){return e.sku===t}))&&this.coordinator.sendExtensionReloadEntitlementsMessage(),[2]}}))}))},a.onMinimize=function(){a.emit(c.WN.Minimize)},a.showBitsBalance=function(){a.emit(c.WN.ShowBitsBalance)},a.showUseBitsSuccess=function(e){a.emit(c.WN.ShowUseBitsSuccess,e)},a.handleBitsTransactionCompleted=function(e){return(0,i.__awaiter)(a,void 0,void 0,(function(){var t,n,o,r;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:t=x.Other,String(this.params.loginId)===e.user_id&&(t=x.CurrentUser),n={sku:e.sku,displayName:e.sku,cost:{amount:"",type:""}},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.extensionBitsProducts];case 2:return o=i.sent(),r=o.products.find((function(t){return t.sku===e.sku})),this.coordinator.sendBitsTransactionCompleteMessage({action:c.IX.TwitchExtBitsTransactionComplete,product:r||n,transactionId:e.transaction_id,userId:e.user_id,displayName:e.display_name,transactionReceipt:e.transactionReceipt,initiator:t}),[3,4];case 3:return i.sent(),this.coordinator.sendBitsTransactionCompleteMessage({action:c.IX.TwitchExtBitsTransactionComplete,product:n,transactionId:e.transaction_id,userId:e.user_id,displayName:e.display_name,transactionReceipt:e.transactionReceipt,initiator:t}),[3,4];case 4:return[2]}}))}))},a.trackDeveloperCustomEvent=function(e){var t=e.payload;a.tracker.trackDeveloperCustomEvent({dev_event_name:t.developerName,interaction_type:t.interactionType,category:t.category,custom_metadata:t.customMetadata||null})},a.extension=new z(t.extension),a.params=(0,i.__assign)((0,i.__assign)({},t),{mode:t.platform===c.z$.Mobile?c.Fw.Viewer:t.mode}),a.isVisible=t.anchor!==c.Z1.Component,a.channelId=a.params.channelId.toString(),a.iframe=a.createSupervisorIFrame(t.iframeClassName),void 0!==t.onBeginPurchase&&(a.onBeginPurchase=t.onBeginPurchase),a.setupListeners(),a.extension.token&&!O.b.getToken(a.extension.clientId,a.channelId)&&(t.extension.helixToken&&!O.b.getHelixToken(a.extension.clientId,a.channelId)?O.b.registerTokens(a.extension.clientId,a.channelId,{token:a.extension.token,helixToken:t.extension.helixToken}):O.b.registerToken(a.extension.clientId,a.channelId,a.extension.token)),a.registerFunctionModals(),a.tracker.trackEvent("extension_render",{}),t.parentElement.appendChild(a.iframe),a.visibilityChanged(),a.params.loginId&&a.bitsMessagePubsubUnsubscribes.push(q.ZO.onPurchaseCompleted(a.params.loginId,a.handlePurchaseCompleted)),a.bitsMessagePubsubUnsubscribes.push(q.ZO.onBitsTransactionCompleted(a.params.channelId,a.extension.clientId,a.params.loginId,a.handleBitsTransactionCompleted)),Z(a.installationAbilities,a.clientAbilities).isSubscriptionStatusAvailable&&q.ZO.listenForViewerSubscriptionStatus("".concat(a.params.loginId),"".concat(a.params.channelId),a.params.extension.id,(function(e){a.coordinator.sendViewerUpdateMessage(e)})),a}return(0,i.__extends)(t,e),Object.defineProperty(t.prototype,"activationAnchor",{get:function(){return this.params.anchor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tracker",{get:function(){return ie(this.buildTracker)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contextManager",{get:function(){return ie(this.getContextManager)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"coordinator",{get:function(){return ie(this.buildCoordinator)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensionOptions",{get:function(){return{anchor:this.activationAnchor,language:this.language,locale:this.locale,mode:this.params.mode,state:c.d$[this.extension.state],platform:this.params.platform,popout:this.params.isPopout||!1,disable3PT:this.params.disable3PT}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"functionManager",{get:function(){return ie(this.buildFunctionManager)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this.params.language||"en"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locale",{get:function(){return this.params.locale||"en-US"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"purchaseService",{get:function(){return ie(this.buildPurchaseService)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canRequestIdLink",{get:function(){var e=O.b.getToken(this.extension.clientId,this.channelId);return!e.isBroadcaster&&(e.isLinked||this.extension.requestIdentityLink)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"installationAbilities",{get:function(){return{isChatEnabled:!!this.params.installationAbilities&&this.params.installationAbilities.isChatEnabled,isBitsEnabled:!!this.params.installationAbilities&&this.params.installationAbilities.isBitsEnabled,isSubscriptionStatusAvailable:!!this.params.installationAbilities&&this.params.installationAbilities.isSubscriptionStatusAvailable}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"configuration",{get:function(){return this.params.configuration?this.params.configuration:{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientAbilities",{get:function(){return{isBitsEnabled:!this.params.features||!!this.params.features.bits,useSharedPubsub:!!this.params.features&&!!this.params.features.sharePubsub}},enumerable:!1,configurable:!0}),t.prototype.getSandboxFlags=function(){return re.join(" ")},t.prototype.trackSequence=function(e,t,n,i){this.lastSequenceInfoMap[t]||(this.lastSequenceInfoMap[t]={});var o=this.lastSequenceInfoMap[t].sequenceTime,r=this.lastSequenceInfoMap[t].sequenceNumber;if(r&&(o!==n&&(r=0),r<i-1)){var s=r+1,a=i-s,c=i-1;this.tracker.trackEvent("extension_pubsub_missed",{topic:e,target:t,sequenceStart:n,firstMissedSequenceNumber:s,lastMissedSequenceNumber:c,missed:a})}this.lastSequenceInfoMap[t]={sequenceNumber:i,sequenceTime:n},this.tracker.trackEvent("extension_pubsub_received",{topic:e,target:t,sequenceStart:n,sequenceNumber:i})},Object.defineProperty(t.prototype,"callbackContext",{get:function(){return{channelID:this.channelId,extensionID:this.extension.clientId,authToken:this.getExtensionAuth().token}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensionProducts",{get:function(){var e=this.extensionProductsCache;if(void 0===e){var t=this.extension,n=t.sku,i=t.vendorCode;this.extension.isMonetized?(this.extensionProductsCache=(0,h.gz)(i,n,this.language),e=this.extensionProductsCache):e=Promise.resolve({products:[]})}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensionBitsProducts",{get:function(){var e=this.extensionBitsProductsCache;if(void 0===e){var t=this.extension,n=t.clientId,o=t.version;this.extensionBitsProductsCache=function(e,t){return(0,i.__awaiter)(void 0,void 0,void 0,(function(){var n,o;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return[4,r.F.graphQLRequest("\nquery ExtensionProducts($extensionID: ID!, $version: String) {\n extension(id: $extensionID, version: $version) {\n products {\n sku\n displayName\n cost {\n amount\n type\n }\n isInDevelopment\n }\n }\n}\n",{extensionID:e,version:t})];case 1:return n=i.sent(),(null===(o=null==n?void 0:n.extension)||void 0===o?void 0:o.products)?[2,{products:n.extension.products.map((function(e){return{sku:e.sku,displayName:e.displayName,cost:{amount:e.cost.amount.toString(),type:e.cost.type.toLowerCase()},inDevelopment:e.isInDevelopment}}))}]:[2,{products:[]}]}}))}))}(n,o),e=this.extensionBitsProductsCache}return e},enumerable:!1,configurable:!0}),t.prototype.formatExtensionProductForDisplay=function(e){return{description:e.description,developerName:e.developer_name,displayPrice:k(e.price.price,e.price.currency_unit),extensionName:this.extension.name,shortDescription:e.short_description,sku:e.sku,title:e.title}},t.prototype.sendExtensionProductPrices=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,this.extensionProducts];case 1:return e=t.sent(),this.extension.isMonetized&&this.coordinator.sendExtensionProductPricesMessage(e),[2]}}))}))},t.prototype.sendExtensionBitsProductPrices=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e,t,n=this;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return this.extension.bitsEnabled?[4,this.extensionBitsProducts]:(this.coordinator.sendBitsProductsMessage([]),[2]);case 1:return e=i.sent(),t=e.products.filter((function(e){return n.extension.state!==c.HY.Released||!0!==e.inDevelopment})).map((function(e){var t={cost:e.cost,displayName:e.displayName,sku:e.sku};return n.extension.state!==c.HY.Released&&(t.inDevelopment=e.inDevelopment),t})),this.coordinator.sendBitsProductsMessage(t),[2]}}))}))},t.prototype.sendExtensionDisplayState=function(){var e=this.params.getDisplayState;if(e){var t=e();switch(t.anchor){case c.Z1.Overlay:this.setVisible(t.isVisible);break;case c.Z1.Component:this.setVisible(t.isVisible),this.setPosition(t.position)}}},t.prototype.bindHelperPubsub=function(){this.helperPubsubAdapter=this.params.helperPubsubAdapter||new K(this.coordinator,this.tracker)},t}(u.EventEmitter);function ae(e,t,n,o,r){return(0,i.__awaiter)(this,void 0,void 0,(function(){var s,u,l;return(0,i.__generator)(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,a({channelID:t,extensionID:n,version:o})];case 1:return s=d.sent(),u=(0,i.__assign)((0,i.__assign)({},r),{channelId:parseInt(t,10),loginId:parseInt(e,10),mode:c.Fw.Viewer,platform:c.z$.Mobile,extension:s.extension,anchor:s.anchor,configuration:s.configuration,installationAbilities:s.abilities}),[2,new se(u)];case 2:throw l=d.sent(),new Error("Extension Response was malformed coming back from GQL. Check your network inspector to see if everything is there. Details: ".concat(l.toString()));case 3:return[2]}}))}))}n(237698);!function(){function e(){}e.ExtensionFrame=se,e.ExtensionService=q.ZO,e.createMobileExtensionFrame=ae}()},843643:()=>{"use strict";try{new MouseEvent("test")}catch(e){window.MouseEvent=function(e,t){var n=document.createEvent("MouseEvent"),i=Object.assign({bubbles:!1,cancelable:!1,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},t||{});return n.initMouseEvent(e,i.bubbles,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget),n},window.MouseEvent.prototype=Event.prototype}},937315:function(e){!function(t){var n=setTimeout;function i(){}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function r(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void a(t.promise,e)}s(t.promise,i)}else(1===e._state?s:a)(t.promise,e._value)}))):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void l((i=n,r=t,function(){i.apply(r,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){a(e,t)}var i,r}function a(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)r(e,e._deferreds[t]);e._deferreds=null}function u(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e((function(e){n||(n=!0,s(t,e))}),(function(e){n||(n=!0,a(t,e))}))}catch(e){if(n)return;n=!0,a(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(i);return r(this,new u(e,t,n)),n},o.all=function(e){return new o((function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);var o=i.length;function r(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(t){r(e,t)}),n)}i[e]=s,0==--o&&t(i)}catch(e){n(e)}}for(var s=0;s<i.length;s++)r(s,i[s])}))},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o((function(t){t(e)}))},o.reject=function(e){return new o((function(t,n){n(e)}))},o.race=function(e){return new o((function(t,n){for(var i=0,o=e.length;i<o;i++)e[i].then(t,n)}))},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){n(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(this)},16450:(e,t,n)=>{"use strict";var i,o=n(814913),r=n(747059),s=n(926221),a=n(330203),c=n(690148),u=n(430498),l=Function.prototype.bind,d=Object.defineProperty,h=Object.prototype.hasOwnProperty;i=function(e,t,n){var i,o=r(t)&&s(t.value);return delete(i=a(t)).writable,delete i.value,i.get=function(){return!n.overwriteDefinition&&h.call(this,e)?o:(t.value=l.call(o,n.resolveContext?n.resolveContext(this):this),d(this,e,t),this[e])},i},e.exports=function(e){var t=c(arguments[1]);return o(t.resolveContext)&&s(t.resolveContext),u(e,(function(e,n){return i(n,e,t)}))}},858263:(e,t,n)=>{"use strict";var i=n(814913),o=n(550307),r=n(416596),s=n(690148),a=n(270214);(e.exports=function(e,t){var n,o,c,u,l;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],i(e)?(n=a.call(e,"c"),o=a.call(e,"e"),c=a.call(e,"w")):(n=c=!0,o=!1),l={value:t,configurable:n,enumerable:o,writable:c},u?r(s(u),l):l}).gs=function(e,t,n){var c,u,l,d;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],i(t)?o(t)?i(n)?o(n)||(l=n,n=void 0):n=void 0:(l=t,t=n=void 0):t=void 0,i(e)?(c=a.call(e,"c"),u=a.call(e,"e")):(c=!0,u=!1),d={get:t,set:n,configurable:c,enumerable:u},l?r(s(l),d):d}},731638:(e,t,n)=>{"use strict";var i=n(304844);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!i(e)}},647427:(e,t,n)=>{"use strict";var i=n(814913),o=n(819879),r=n(815180),s=n(619043),a=function(e,t){return e.replace("%v",s(t))};e.exports=function(e,t,n){if(!o(n))throw new TypeError(a(t,e));if(!i(e)){if("default"in n)return n.default;if(n.isOptional)return null}var s=r(n.errorMessage);throw i(s)||(s=t),new TypeError(a(s,e))}},938198:e=>{"use strict";e.exports=function(e){try{return e.toString()}catch(t){try{return String(e)}catch(e){return null}}}},619043:(e,t,n)=>{"use strict";var i=n(938198),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=i(e);return null===t?"<Non-coercible to string value>":(t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(o,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},819879:(e,t,n)=>{"use strict";var i=n(814913),o={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(o,typeof e)}},926221:(e,t,n)=>{"use strict";var i=n(647427),o=n(550307);e.exports=function(e){return o(e)?e:i(e,"%v is not a plain function",arguments[1])}},550307:(e,t,n)=>{"use strict";var i=n(731638),o=/^\s*class[\s{/}]/,r=Function.prototype.toString;e.exports=function(e){return!!i(e)&&!o.test(r.call(e))}},304844:(e,t,n)=>{"use strict";var i=n(819879);e.exports=function(e){if(!i(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},815180:(e,t,n)=>{"use strict";var i=n(814913),o=n(819879),r=Object.prototype.toString;e.exports=function(e){if(!i(e))return null;if(o(e)){var t=e.toString;if("function"!=typeof t)return null;if(t===r)return null}try{return""+e}catch(e){return null}}},747059:(e,t,n)=>{"use strict";var i=n(647427),o=n(814913);e.exports=function(e){return o(e)?e:i(e,"Cannot use %v",arguments[1])}},814913:e=>{"use strict";e.exports=function(e){return null!=e}},410577:(e,t,n)=>{"use strict";var i=n(767134);e.exports=function(){return i(this).length=0,this}},844645:(e,t,n)=>{"use strict";e.exports=n(873916)()?Array.from:n(165552)},873916:e=>{"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},165552:(e,t,n)=>{"use strict";var i=n(372380).iterator,o=n(728746),r=n(992840),s=n(432665),a=n(25499),c=n(767134),u=n(889762),l=n(73748),d=Array.isArray,h=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(e){var t,n,b,g,_,v,y,m,x,w,I=arguments[1],k=arguments[2];if(e=Object(c(e)),u(I)&&a(I),this&&this!==Array&&r(this))t=this;else{if(!I){if(o(e))return 1!==(_=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(d(e)){for(g=new Array(_=e.length),n=0;n<_;++n)g[n]=e[n];return g}}g=[]}if(!d(e))if(void 0!==(x=e[i])){for(y=a(x).call(e),t&&(g=new t),m=y.next(),n=0;!m.done;)w=I?h.call(I,k,m.value,n):m.value,t?(f.value=w,p(g,n,f)):g[n]=w,m=y.next(),++n;_=n}else if(l(e)){for(_=e.length,t&&(g=new t),n=0,b=0;n<_;++n)w=e[n],n+1<_&&(v=w.charCodeAt(0))>=55296&&v<=56319&&(w+=e[++n]),w=I?h.call(I,k,w,b):w,t?(f.value=w,p(g,b,f)):g[b]=w,++b;_=b}if(void 0===_)for(_=s(e.length),t&&(g=new t(_)),n=0;n<_;++n)w=I?h.call(I,k,e[n],n):e[n],t?(f.value=w,p(g,n,f)):g[n]=w;return t&&(f.value=null,g.length=_),g}},728746:e=>{"use strict";var t=Object.prototype.toString,n=t.call(function(){return arguments}());e.exports=function(e){return t.call(e)===n}},992840:e=>{"use strict";var t=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return"function"==typeof e&&n(t.call(e))}},146011:e=>{"use strict";e.exports=function(){}},79911:(e,t,n)=>{"use strict";e.exports=n(492734)()?Math.sign:n(33670)},492734:e=>{"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},33670:e=>{"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},749806:(e,t,n)=>{"use strict";var i=n(79911),o=Math.abs,r=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?i(e)*r(o(e)):e}},432665:(e,t,n)=>{"use strict";var i=n(749806),o=Math.max;e.exports=function(e){return o(0,i(e))}},458191:(e,t,n)=>{"use strict";var i=n(25499),o=n(767134),r=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,c=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,u){var l,d=arguments[2],h=arguments[3];return n=Object(o(n)),i(u),l=a(n),h&&l.sort("function"==typeof h?r.call(h,n):void 0),"function"!=typeof e&&(e=l[e]),s.call(e,l,(function(e,i){return c.call(n,e)?s.call(u,d,n[e],e,n,i):t}))}}},416596:(e,t,n)=>{"use strict";e.exports=n(305339)()?Object.assign:n(933595)},305339:e=>{"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},933595:(e,t,n)=>{"use strict";var i=n(2093),o=n(767134),r=Math.max;e.exports=function(e,t){var n,s,a,c=r(arguments.length,2);for(e=Object(o(e)),a=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},s=1;s<c;++s)i(t=arguments[s]).forEach(a);if(void 0!==n)throw n;return e}},330203:(e,t,n)=>{"use strict";var i=n(844645),o=n(416596),r=n(767134);e.exports=function(e){var t=Object(r(e)),n=arguments[1],s=Object(arguments[2]);if(t!==e&&!n)return t;var a={};return n?i(n,(function(t){(s.ensure||t in e)&&(a[t]=e[t])})):o(a,e),a}},218414:(e,t,n)=>{"use strict";var i,o,r,s,a=Object.create;n(738213)()||(i=n(608793)),e.exports=i?1!==i.level?a:(o={},r={},s={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(e){r[e]="__proto__"!==e?s:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(o,r),Object.defineProperty(i,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:o}),function(e,t){return a(null===e?o:e,t)}):a},555921:(e,t,n)=>{"use strict";e.exports=n(458191)("forEach")},763052:(e,t,n)=>{"use strict";var i=n(889762),o={function:!0,object:!0};e.exports=function(e){return i(e)&&o[typeof e]||!1}},889762:(e,t,n)=>{"use strict";var i=n(146011)();e.exports=function(e){return e!==i&&null!==e}},2093:(e,t,n)=>{"use strict";e.exports=n(863380)()?Object.keys:n(864232)},863380:e=>{"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},864232:(e,t,n)=>{"use strict";var i=n(889762),o=Object.keys;e.exports=function(e){return o(i(e)?Object(e):e)}},430498:(e,t,n)=>{"use strict";var i=n(25499),o=n(555921),r=Function.prototype.call;e.exports=function(e,t){var n={},s=arguments[2];return i(t),o(e,(function(e,i,o,a){n[i]=r.call(t,s,e,i,o,a)})),n}},690148:(e,t,n)=>{"use strict";var i=n(889762),o=Array.prototype.forEach,r=Object.create;e.exports=function(e){var t=r(null);return o.call(arguments,(function(e){i(e)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(e),t)})),t}},488558:(e,t,n)=>{"use strict";e.exports=n(738213)()?Object.setPrototypeOf:n(608793)},738213:e=>{"use strict";var t=Object.create,n=Object.getPrototypeOf,i={};e.exports=function(){var e=Object.setPrototypeOf;return"function"==typeof e&&n(e((arguments[0]||t)(null),i))===i}},608793:(e,t,n)=>{"use strict";var i,o,r,s,a=n(763052),c=n(767134),u=Object.prototype.isPrototypeOf,l=Object.defineProperty,d={configurable:!0,enumerable:!1,writable:!0,value:void 0};i=function(e,t){if(c(e),null===t||a(t))return e;throw new TypeError("Prototype must be null or an object")},e.exports=(o=function(){var e,t=Object.create(null),n={},i=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(i){try{(e=i.set).call(t,n)}catch(e){}if(Object.getPrototypeOf(t)===n)return{set:e,level:2}}return t.__proto__=n,Object.getPrototypeOf(t)===n?{level:2}:((t={}).__proto__=n,Object.getPrototypeOf(t)===n&&{level:1})}(),o?(2===o.level?o.set?(s=o.set,r=function(e,t){return s.call(i(e,t),t),e}):r=function(e,t){return i(e,t).__proto__=t,e}:r=function e(t,n){var o;return i(t,n),(o=u.call(e.nullPolyfill,t))&&delete e.nullPolyfill.__proto__,null===n&&(n=e.nullPolyfill),t.__proto__=n,o&&l(e.nullPolyfill,"__proto__",d),t},Object.defineProperty(r,"level",{configurable:!1,enumerable:!1,writable:!1,value:o.level})):null),n(218414)},25499:e=>{"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},872232:(e,t,n)=>{"use strict";var i=n(763052);e.exports=function(e){if(!i(e))throw new TypeError(e+" is not an Object");return e}},767134:(e,t,n)=>{"use strict";var i=n(889762);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},270214:(e,t,n)=>{"use strict";e.exports=n(740525)()?String.prototype.contains:n(471521)},740525:e=>{"use strict";var t="razdwatrzy";e.exports=function(){return"function"==typeof t.contains&&(!0===t.contains("dwa")&&!1===t.contains("foo"))}},471521:e=>{"use strict";var t=String.prototype.indexOf;e.exports=function(e){return t.call(this,e,arguments[1])>-1}},73748:e=>{"use strict";var t=Object.prototype.toString,n=t.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||t.call(e)===n)||!1}},377165:e=>{"use strict";var t=Object.create(null),n=Math.random;e.exports=function(){var e;do{e=n().toString(36).slice(2)}while(t[e]);return e}},720875:(e,t,n)=>{"use strict";var i,o=n(488558),r=n(270214),s=n(858263),a=n(372380),c=n(888118),u=Object.defineProperty;i=e.exports=function(e,t){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");c.call(this,e),t=t?r.call(t,"key+value")?"key+value":r.call(t,"key")?"key":"value":"value",u(this,"__kind__",s("",t))},o&&o(i,c),delete i.prototype.constructor,i.prototype=Object.create(c.prototype,{_resolve:s((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),u(i.prototype,a.toStringTag,s("c","Array Iterator"))},220271:(e,t,n)=>{"use strict";var i=n(728746),o=n(25499),r=n(73748),s=n(86658),a=Array.isArray,c=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var n,l,d,h,f,p,b,g,_=arguments[2];if(a(e)||i(e)?n="array":r(e)?n="string":e=s(e),o(t),d=function(){h=!0},"array"!==n)if("string"!==n)for(l=e.next();!l.done;){if(c.call(t,_,l.value,d),h)return;l=e.next()}else for(p=e.length,f=0;f<p&&(b=e[f],f+1<p&&(g=b.charCodeAt(0))>=55296&&g<=56319&&(b+=e[++f]),c.call(t,_,b,d),!h);++f);else u.call(e,(function(e){return c.call(t,_,e,d),h}))}},86658:(e,t,n)=>{"use strict";var i=n(728746),o=n(73748),r=n(720875),s=n(947573),a=n(377203),c=n(372380).iterator;e.exports=function(e){return"function"==typeof a(e)[c]?e[c]():i(e)?new r(e):o(e)?new s(e):new r(e)}},888118:(e,t,n)=>{"use strict";var i,o=n(410577),r=n(416596),s=n(25499),a=n(767134),c=n(858263),u=n(16450),l=n(372380),d=Object.defineProperty,h=Object.defineProperties;e.exports=i=function(e,t){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");h(this,{__list__:c("w",a(e)),__context__:c("w",t),__nextIndex__:c("w",0)}),t&&(s(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete i.prototype.constructor,h(i.prototype,r({_next:c((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:c((function(){return this._createResult(this._next())})),_createResult:c((function(e){return void 0===e?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}})),_resolve:c((function(e){return this.__list__[e]})),_unBind:c((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:c((function(){return"[object "+(this[l.toStringTag]||"Object")+"]"}))},u({_onAdd:c((function(e){e>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,n){t>=e&&(this.__redo__[n]=++t)}),this),this.__redo__.push(e)):d(this,"__redo__",c("c",[e])))})),_onDelete:c((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,n){t>e&&(this.__redo__[n]=--t)}),this)))})),_onClear:c((function(){this.__redo__&&o.call(this.__redo__),this.__nextIndex__=0}))}))),d(i.prototype,l.iterator,c((function(){return this})))},967115:(e,t,n)=>{"use strict";var i=n(728746),o=n(889762),r=n(73748),s=n(372380).iterator,a=Array.isArray;e.exports=function(e){return!!o(e)&&(!!a(e)||(!!r(e)||(!!i(e)||"function"==typeof e[s])))}},947573:(e,t,n)=>{"use strict";var i,o=n(488558),r=n(858263),s=n(372380),a=n(888118),c=Object.defineProperty;i=e.exports=function(e){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");e=String(e),a.call(this,e),c(this,"__length__",r("",e.length))},o&&o(i,a),delete i.prototype.constructor,i.prototype=Object.create(a.prototype,{_next:r((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:r((function(e){var t,n=this.__list__[e];return this.__nextIndex__===this.__length__?n:(t=n.charCodeAt(0))>=55296&&t<=56319?n+this.__list__[this.__nextIndex__++]:n}))}),c(i.prototype,s.toStringTag,r("c","String Iterator"))},377203:(e,t,n)=>{"use strict";var i=n(967115);e.exports=function(e){if(!i(e))throw new TypeError(e+" is not iterable");return e}},372380:(e,t,n)=>{"use strict";e.exports=n(34195)()?n(918209).Symbol:n(296613)},34195:(e,t,n)=>{"use strict";var i=n(918209),o={object:!0,symbol:!0};e.exports=function(){var e,t=i.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch(e){return!1}return!!o[typeof t.iterator]&&(!!o[typeof t.toPrimitive]&&!!o[typeof t.toStringTag])}},673055:e=>{"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},882941:(e,t,n)=>{"use strict";var i=n(858263),o=Object.create,r=Object.defineProperty,s=Object.prototype,a=o(null);e.exports=function(e){for(var t,n,o=0;a[e+(o||"")];)++o;return a[e+=o||""]=!0,r(s,t="@@"+e,i.gs(null,(function(e){n||(n=!0,r(this,t,i(e)),n=!1)}))),t}},883333:(e,t,n)=>{"use strict";var i=n(858263),o=n(918209).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:i("",o&&o.hasInstance||e("hasInstance")),isConcatSpreadable:i("",o&&o.isConcatSpreadable||e("isConcatSpreadable")),iterator:i("",o&&o.iterator||e("iterator")),match:i("",o&&o.match||e("match")),replace:i("",o&&o.replace||e("replace")),search:i("",o&&o.search||e("search")),species:i("",o&&o.species||e("species")),split:i("",o&&o.split||e("split")),toPrimitive:i("",o&&o.toPrimitive||e("toPrimitive")),toStringTag:i("",o&&o.toStringTag||e("toStringTag")),unscopables:i("",o&&o.unscopables||e("unscopables"))})}},38118:(e,t,n)=>{"use strict";var i=n(858263),o=n(263297),r=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:i((function(t){return r[t]?r[t]:r[t]=e(String(t))})),keyFor:i((function(e){var t;for(t in o(e),r)if(r[t]===e)return t}))})}},296613:(e,t,n)=>{"use strict";var i,o,r,s=n(858263),a=n(263297),c=n(918209).Symbol,u=n(882941),l=n(883333),d=n(38118),h=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof c)try{String(c()),r=!0}catch(e){}else c=null;o=function(e){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(e)},e.exports=i=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return r?c(t):(n=h(o.prototype),t=void 0===t?"":String(t),f(n,{__description__:s("",t),__name__:s("",u(t))}))},l(i),d(i),f(o.prototype,{constructor:s(i),toString:s("",(function(){return this.__name__}))}),f(i.prototype,{toString:s((function(){return"Symbol ("+a(this).__description__+")"})),valueOf:s((function(){return a(this)}))}),p(i.prototype,i.toPrimitive,s("",(function(){var e=a(this);return"symbol"==typeof e?e:e.toString()}))),p(i.prototype,i.toStringTag,s("c","Symbol")),p(o.prototype,i.toStringTag,s("c",i.prototype[i.toStringTag])),p(o.prototype,i.toPrimitive,s("c",i.prototype[i.toPrimitive]))},263297:(e,t,n)=>{"use strict";var i=n(673055);e.exports=function(e){if(!i(e))throw new TypeError(e+" is not a symbol");return e}},740115:(e,t,n)=>{"use strict";e.exports=n(89050)()?WeakMap:n(649904)},89050:e=>{"use strict";e.exports=function(){var e,t;if("function"!=typeof WeakMap)return!1;try{e=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch(e){return!1}return"[object WeakMap]"===String(e)&&("function"==typeof e.set&&(e.set({},1)===e&&("function"==typeof e.delete&&("function"==typeof e.has&&"one"===e.get(t)))))}},795334:e=>{"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},649904:(e,t,n)=>{"use strict";var i,o=n(889762),r=n(488558),s=n(872232),a=n(767134),c=n(377165),u=n(858263),l=n(86658),d=n(220271),h=n(372380).toStringTag,f=n(795334),p=Array.isArray,b=Object.defineProperty,g=Object.prototype.hasOwnProperty,_=Object.getPrototypeOf;e.exports=i=function(){var e,t=arguments[0];if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");return e=f&&r&&WeakMap!==i?r(new WeakMap,_(this)):this,o(t)&&(p(t)||(t=l(t))),b(e,"__weakMapData__",u("c","$weakMap$"+c())),t?(d(t,(function(t){a(t),e.set(t[0],t[1])})),e):e},f&&(r&&r(i,WeakMap),i.prototype=Object.create(WeakMap.prototype,{constructor:u(i)})),Object.defineProperties(i.prototype,{delete:u((function(e){return!!g.call(s(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)})),get:u((function(e){if(g.call(s(e),this.__weakMapData__))return e[this.__weakMapData__]})),has:u((function(e){return g.call(s(e),this.__weakMapData__)})),set:u((function(e,t){return b(s(e),this.__weakMapData__,u("c",t)),this})),toString:u((function(){return"[object WeakMap]"}))}),b(i.prototype,h,u("c","WeakMap"))},392215:e=>{var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},918209:(e,t,n)=>{"use strict";e.exports=n(774744)()?globalThis:n(392215)},774744:e=>{"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},578624:function(){!function(e){"use strict";if(!e.fetch){var t="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,r="ArrayBuffer"in e;if(r)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(e){return e&&DataView.prototype.isPrototypeOf(e)},c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};p.prototype.append=function(e,t){e=d(e),t=h(t);var n=this.map[e];this.map[e]=n?n+","+t:t},p.prototype.delete=function(e){delete this.map[d(e)]},p.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},p.prototype.set=function(e,t){this.map[d(e)]=h(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),f(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),f(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},y.call(m.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var l=[301,302,303,307,308];w.redirect=function(e,t){if(-1===l.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},e.Headers=p,e.Request=m,e.Response=w,e.fetch=function(e,t){return new Promise((function(n,o){var r=new m(e,t),s=new XMLHttpRequest;s.onload=function(){var e,t,i={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var o=n.join(":").trim();t.append(i,o)}})),t)};i.url="responseURL"in s?s.responseURL:i.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;n(new w(o,i))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.open(r.method,r.url,!0),"include"===r.credentials?s.withCredentials=!0:"omit"===r.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),r.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===r._bodyInit?null:r._bodyInit)}))},e.fetch.polyfill=!0}function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function b(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function g(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function _(e){var t=new FileReader,n=g(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(i&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(o&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(r&&i&&a(e))this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!r||!ArrayBuffer.prototype.isPrototypeOf(e)&&!c(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=b(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?b(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var e,t,n,i=b(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=g(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i<t.length;i++)n[i]=String.fromCharCode(t[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}function m(e,t){var n,i,o=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=t.method||this.method||"GET",i=n.toUpperCase(),u.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)}}]);