@inappstory/react-sdk 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lodash/isFunction.js"),require("uuid"),require("mobx"),require("lodash/isString.js"),require("bowser"),require("lodash/isEqual.js"),require("lodash/head.js"),require("deepmerge"),require("lodash/debounce.js"),require("@inappstory/slide-api"),require("async-mutex"),require("lodash/isObject.js"),require("lodash/isNumber.js"),require("react/jsx-runtime"),require("react"),require("css-font-parser"),require("parse-css-sides"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("lit"),require("lit/decorators.js"),require("lit/directives/style-map.js"),require("lit/static-html.js"),require("lit/directives/class-map.js"),require("lit/directives/unsafe-html.js"));else if("function"==typeof define&&define.amd)define(["lodash/isFunction.js","uuid","mobx","lodash/isString.js","bowser","lodash/isEqual.js","lodash/head.js","deepmerge","lodash/debounce.js","@inappstory/slide-api","async-mutex","lodash/isObject.js","lodash/isNumber.js","react/jsx-runtime","react","css-font-parser","parse-css-sides","classnames","mobx-react-lite","react-dom","lit","lit/decorators.js","lit/directives/style-map.js","lit/static-html.js","lit/directives/class-map.js","lit/directives/unsafe-html.js"],t);else{var r="object"==typeof exports?t(require("lodash/isFunction.js"),require("uuid"),require("mobx"),require("lodash/isString.js"),require("bowser"),require("lodash/isEqual.js"),require("lodash/head.js"),require("deepmerge"),require("lodash/debounce.js"),require("@inappstory/slide-api"),require("async-mutex"),require("lodash/isObject.js"),require("lodash/isNumber.js"),require("react/jsx-runtime"),require("react"),require("css-font-parser"),require("parse-css-sides"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("lit"),require("lit/decorators.js"),require("lit/directives/style-map.js"),require("lit/static-html.js"),require("lit/directives/class-map.js"),require("lit/directives/unsafe-html.js")):t(e["lodash/isFunction.js"],e.uuid,e.mobx,e["lodash/isString.js"],e.bowser,e["lodash/isEqual.js"],e["lodash/head.js"],e.deepmerge,e["lodash/debounce.js"],e["@inappstory/slide-api"],e["async-mutex"],e["lodash/isObject.js"],e["lodash/isNumber.js"],e["react/jsx-runtime"],e.react,e["css-font-parser"],e["parse-css-sides"],e.classnames,e["mobx-react-lite"],e["react-dom"],e.lit,e["lit/decorators.js"],e["lit/directives/style-map.js"],e["lit/static-html.js"],e["lit/directives/class-map.js"],e["lit/directives/unsafe-html.js"]);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(self,(e,t,r,i,s,a,o,n,l,c,d,h,u,p,g,f,m,y,v,b,w,S,_,O,k,x)=>(()=>{var C={6644(e,t,r){"use strict";r.d(t,{Ay:()=>d,B2:()=>l,Iu:()=>c,jW:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".aspect-ratio-box--eXqK8{overflow:hidden;position:relative}.aspect-ratio-box--eXqK8.aspect-ratio-box--centered--DTJHL{width:auto;height:100%;left:50%;transform:translateX(-50%)}.aspect-ratio-box-inside--oX1Yl{position:absolute;top:0;left:0;width:100%;height:100%}",""]);var n="aspect-ratio-box--eXqK8",l="aspect-ratio-box--centered--DTJHL",c="aspect-ratio-box-inside--oX1Yl";const d=o},8034(e,t,r){"use strict";r.d(t,{A:()=>l,G:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".close-btn--NQCck{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:20px;z-index:1140;pointer-events:all;cursor:pointer;outline:none;color:#c2c2c4}.close-btn--NQCck:focus{outline:none}.close-btn--NQCck{width:40px;height:40px;display:flex;justify-content:center;align-items:center}.close-btn--NQCck svg{overflow:visible;width:40px;height:40px}.close-btn--NQCck[data-position=start],.close-btn--NQCck[data-position=left]{left:10px}.close-btn--NQCck[data-position=start][dir=rtl],.close-btn--NQCck[data-position=left][dir=rtl]{left:auto;right:10px}.close-btn--NQCck[data-position=end],.close-btn--NQCck[data-position=right]{right:10px}.close-btn--NQCck[data-position=end][dir=rtl],.close-btn--NQCck[data-position=right][dir=rtl]{left:10px;right:auto}",""]);var n="close-btn--NQCck";const l=o},9678(e,t,r){"use strict";r.d(t,{Ay:()=>p,Hi:()=>h,IY:()=>d,O2:()=>n,Vv:()=>l,gt:()=>u,np:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'@keyframes spin--iLxiu{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.splash-container--_EF2B{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;z-index:-1}.splash-container--_EF2B .splash-container__image--nU3Il{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.splash-container--_EF2B .splash-container__image--nU3Il img{width:100%;height:100%;object-fit:cover}.splash-container--_EF2B .splash-container__lottie--vpoIB{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1}.splash-container--_EF2B .splash-container__lottie--vpoIB canvas{width:100%;height:100%}.splash-container--_EF2B.splash-container--isLoading--pvfb0:after{display:inline-block;position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);content:"";width:2rem;height:2rem;border:solid 2px var(--GRLoaderBackgroundColor, white);border-color:var(--GRLoaderBackgroundAccentColor, transparent) var(--GRLoaderBackgroundColor, white) var(--GRLoaderBackgroundColor, white) var(--GRLoaderBackgroundColor, white);border-radius:50%;animation:spin--iLxiu .6s infinite linear;z-index:10}.splash-container--_EF2B.splash-container--fadeIn--MV9sw{opacity:1;transition:opacity ease-in .2s}.splash-container--_EF2B.splash-container--fadeOut--RPYXS{opacity:0;transition:opacity ease-out .3s}',""]);var n="splash-container--_EF2B",l="splash-container__image--nU3Il",c="splash-container__lottie--vpoIB",d="splash-container--isLoading--pvfb0",h="splash-container--fadeIn--MV9sw",u="splash-container--fadeOut--RPYXS";const p=o},4978(e,t,r){"use strict";r.d(t,{Ay:()=>f,F2:()=>d,JF:()=>u,Pe:()=>n,QP:()=>h,X7:()=>l,be:()=>p,fN:()=>g,vK:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,':root{--ias-sat: env(safe-area-inset-top);--ias-sar: env(safe-area-inset-right);--ias-sab: env(safe-area-inset-bottom);--ias-sal: env(safe-area-inset-left)}.game-reader-container--AH81u{background-color:rgba(0,0,0,0);position:fixed;left:0px;top:0px;padding:0px;border:0px;z-index:2147483645;width:100%;height:100vh;height:100dvh;overflow:hidden;color-scheme:auto}.game-reader--GGgPJ{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";position:absolute;top:0;left:0;right:0;bottom:0;box-sizing:border-box;background:rgba(0,0,0,0);z-index:1;user-select:none;pointer-events:all;color:#fff}.game-reader--GGgPJ.game-reader--desktop-mode--DdyrA{padding:50px 0}.game-reader--GGgPJ.game-reader--desktop-mode--DdyrA .game-reader__game-box--xbnK1{border-radius:var(--game-box-border-radius)}.game-reader--GGgPJ.game-reader--widescreen--m24df{padding:0 0}.game-reader--GGgPJ.game-reader--widescreen--m24df .game-reader__game-box--xbnK1{border-radius:0px}.game-reader--GGgPJ .game-reader__refresh-btn--sESRO{cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);z-index:2}.game-reader--GGgPJ .game-reader__game-box--xbnK1.game-reader__game-box--widescreen--PC_5t{border-radius:0px}.game-reader--GGgPJ .game-reader__iframe--TPOmh{width:100%;height:100%;transition:opacity ease-in .3s}.game-reader--GGgPJ .game-reader__backdrop--iVnAT{position:fixed;inset:0;z-index:-1}',""]);var n="game-reader-container--AH81u",l="game-reader--GGgPJ",c="game-reader--desktop-mode--DdyrA",d="game-reader__game-box--xbnK1",h="game-reader--widescreen--m24df",u="game-reader__refresh-btn--sESRO",p="game-reader__iframe--TPOmh",g="game-reader__backdrop--iVnAT";const f=o},763(e,t,r){"use strict";r.d(t,{A:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,":root{--ias-sat: env(safe-area-inset-top);--ias-sar: env(safe-area-inset-right);--ias-sab: env(safe-area-inset-bottom);--ias-sal: env(safe-area-inset-left)}",""]);const n=o},5213(e,t,r){"use strict";r.d(t,{$X:()=>d,Ay:()=>b,FU:()=>m,L6:()=>l,RI:()=>h,XI:()=>n,Yb:()=>g,bj:()=>c,cT:()=>u,ch:()=>p,fT:()=>y,s$:()=>f,zL:()=>v});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,"h3{margin:0}.stories-list-wrapper--DKVYb{background-color:var(--background-color, transparent);height:auto;padding:0;position:relative}.stories-list-wrapper--DKVYb.mode-desktop--zBsR0.with-list-controls--ePWkN{position:relative}.stories-list--bGIwH{position:relative;overflow:visible}@media(min-width: 767.99px){.stories-list--bGIwH{overflow:hidden}}.stories-list__actions--Fa6mf{position:absolute;right:0;top:0}.stories-list__viewport--PtGCL{overflow:hidden;height:auto}.stories-list__viewport--PtGCL:not(.mode-desktop--zBsR0){display:flex}.stories-list__viewport-inner--dHTNA{display:flex;flex-wrap:nowrap;-webkit-overflow-scrolling:touch}.stories-list__viewport-inner--dHTNA::-webkit-scrollbar{display:none}.stories-list__viewport-inner--dHTNA{scrollbar-width:none}.stories-list__viewport-inner--dHTNA.mode-desktop--zBsR0{scroll-behavior:unset;cursor:grab}.stories-list__viewport-inner--dHTNA.isVerticalDirection--u5egA{display:grid;grid-template-columns:repeat(auto-fill, var(--story-card-width, 174px));justify-content:center;width:100%}.stories-list__viewport-inner--dHTNA{padding-top:var(--storiesListTopPadding, 0);padding-bottom:var(--storiesListBottomPadding, 0);box-sizing:content-box}.stories-list__viewport-inner--dHTNA.align-center--j1sjW{margin-left:auto;margin-right:auto}.stories-list__viewport-inner--dHTNA.align-left--CZ_qv{margin-right:auto}.stories-list__viewport-inner--dHTNA.align-right--QmW75{margin-left:auto}.stories-list__viewport-inner--dHTNA.isTitleCardOutsideTop--QzZ2U{align-items:flex-end}.stories-list__viewport-inner--dHTNA.isTitleCardOutsideBottom--G8KrN{align-items:flex-start}",""]);var n="stories-list-wrapper--DKVYb",l="mode-desktop--zBsR0",c="with-list-controls--ePWkN",d="stories-list--bGIwH",h="stories-list__viewport--PtGCL",u="stories-list__viewport-inner--dHTNA",p="isVerticalDirection--u5egA",g="align-center--j1sjW",f="align-left--CZ_qv",m="align-right--QmW75",y="isTitleCardOutsideTop--QzZ2U",v="isTitleCardOutsideBottom--G8KrN";const b=o},7966(e,t,r){"use strict";r.d(t,{Ay:()=>u,Nb:()=>d,Vl:()=>l,_m:()=>n,lc:()=>c,nC:()=>h});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".favorite-images-wrapper--rqD8L{display:flex;flex-direction:row;flex-wrap:wrap;padding:var(--storiesListCardFavoriteTitle, --storiesListItemTitlePadding, 0px);gap:var(--storiesListCardFavoriteGap, 3px);box-sizing:border-box}.favorite-image-wrapper--i4ncN{flex:0 1 calc(50% - var(--storiesListCardFavoriteGap, 3px));position:relative}.favorite-image--eMgYI{position:relative}.favorite-image-item--vwzcf{position:absolute;inset:0px;border-radius:calc(var(--storiesListInnerBorderRadiusRead, 0)/4);background-position:50% 50%;background-size:cover}.circle_style--c7LWV .favorite-image-item--vwzcf{border-radius:50%}",""]);var n="favorite-images-wrapper--rqD8L",l="favorite-image-wrapper--i4ncN",c="favorite-image--eMgYI",d="favorite-image-item--vwzcf",h="circle_style--c7LWV";const u=o},6892(e,t,r){"use strict";r.d(t,{Ay:()=>ee,B6:()=>f,F:()=>T,FU:()=>H,IW:()=>G,Iu:()=>l,OC:()=>k,P2:()=>_,Pr:()=>d,Qo:()=>O,Vf:()=>x,W7:()=>D,XW:()=>A,Xz:()=>J,Yb:()=>$,Yo:()=>M,ZE:()=>P,_d:()=>z,_m:()=>K,a1:()=>B,aA:()=>p,aF:()=>h,aI:()=>v,av:()=>S,cp:()=>w,cw:()=>b,dl:()=>L,eQ:()=>R,fT:()=>m,hS:()=>E,i4:()=>U,jw:()=>Z,m4:()=>C,m7:()=>F,mW:()=>q,nU:()=>Q,nj:()=>u,oe:()=>N,om:()=>I,p_:()=>g,qE:()=>V,ro:()=>j,s$:()=>W,sB:()=>X,sr:()=>Y,uk:()=>n,zL:()=>y,zc:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'.stories-slide-wrapper--yq3Zk:not(:last-child){margin-right:var(--storiesGap, 20px)}.stories-slide-wrapper--yq3Zk{display:flex;flex-direction:column;flex:0 0 auto;box-sizing:content-box;width:var(--story-card-width);cursor:pointer}.stories-slide-wrapper--yq3Zk:hover{text-decoration:none}.stories-slide-wrapper--yq3Zk{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm{display:block;box-sizing:border-box;text-align:left;position:relative;overflow:visible;width:var(--story-card-width);-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);border:var(--storiesListBorderNotReadWidth, 2px) solid var(--storiesBorderNotReadColor, #00b956);padding:var(--storiesListBorderGapNotRead, 2px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp{border-radius:var(--storiesListBorderRadius, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide-image--tHOh7,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide-image--tHOh7{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide-image__image--UXctk video,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide-image__image--UXctk video{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide__mask--N1bZK,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide__mask--N1bZK{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide__content--e0Oyv,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide__content--e0Oyv{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR{border-radius:var(--storiesListBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide-image--tHOh7,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide-image--tHOh7{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide-image__image--UXctk video,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide-image__image--UXctk video{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide__mask--N1bZK,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide__mask--N1bZK{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide__content--e0Oyv,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide__content--e0Oyv{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._is-read--GNVqR{border:var(--storiesListBorderReadWidth, 1px) solid var(--storiesBorderReadColor, #ededed)}.stories-slide-wrapper--yq3Zk.isTitleCardOutsideTop--qrtQC{justify-content:flex-end}.stories-slide-wrapper--yq3Zk.isTitleCardOutsideBottom--lXtXr{justify-content:flex-start}.stories-slide-wrapper--yq3Zk .stories-slide__inner--Fhgjf{display:block;position:relative;width:100%;height:100%}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-black--GMC_A{background:#000}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-white--GA_HZ{background:#fff}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-red--IeWZj{background:#ff1a36}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-yellow--MjuAF{background:#fff000}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-green--d_u0t{background:#0be361}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-violet--_Pws4{background:#b300bc}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-blue--nf2Wk{background:#0761db}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-grey--ho5xA{background:#a8a8a8}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-black-gradient--ScIpU{background:#fff;background:linear-gradient(0deg, #c1c1c1, #000)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-white-gradient--KFVbd{background:#fff;background:linear-gradient(180deg, #fff, #ffc800)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-red-gradient--FlHVF{background:#ff1a36;background:linear-gradient(180deg, #c90174, #eb5c57)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-yellow-gradient--Na5gP{background:#fff000;background:linear-gradient(0deg, #fbda61, #f76b1c)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-green-gradient--bBwZa{background:#0be361;background:linear-gradient(0deg, #b4ed50, #429321)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-violet-gradient--zMsPH{background:#b300bc;background:linear-gradient(180deg, #c90174, #0164fd)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-blue-gradient--tqRAH{background:#0761db;background:linear-gradient(180deg, #3023ae, #53a0fe 48%, #b4ed50)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-grey-gradient--m9xqh{background:#a8a8a8;background:linear-gradient(0deg, #e2e2e2, #959595)}.stories-slide-wrapper--yq3Zk .stories-slide-image--tHOh7{position:relative;width:100%;height:100%}.stories-slide-wrapper--yq3Zk .stories-slide-image__wrap--QgNhx{position:absolute;top:0;bottom:0;left:0;right:0}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk{position:relative;opacity:1;transition:opacity .3s ease-in-out;overflow:hidden}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk._mode_list--dEj_1{width:100%;height:100%}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk.ugc-card-cell--rJcS4 img{object-fit:contain}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk img{width:100%;height:100%;object-fit:cover}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk video{min-height:100%;min-width:100%;width:100%;background-position:center center;background-repeat:no-repeat;object-fit:cover;opacity:0}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk.video-loaded--dk0k5 img{display:none}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk.video-loaded--dk0k5 video{opacity:1}.stories-slide-wrapper--yq3Zk .stories-slide__mask--N1bZK{position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;background-color:var(--storiesListItemMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemMaskLinearGradient, none);opacity:1}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._is-read--GNVqR .stories-slide__mask--N1bZK{background-color:var(--storiesListItemOpenedMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemOpenedMaskLinearGradient, none)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._ugc-cell--szjgS .stories-slide__mask--N1bZK{background-color:var(--storiesListCardUgcMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListCardUgcMaskLinearGradient, none)}.stories-slide-wrapper--yq3Zk .stories-slide__content--e0Oyv{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;height:100%;max-height:100%;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;font-family:var(--storiesListItemTitleFontFamily);font-weight:normal;font-size:1rem;line-height:normal;font:var(--storiesListItemTitleFont, normal);text-decoration:none;padding:var(--storiesListItemTitlePadding, 0px)}.stories-slide-wrapper--yq3Zk .stories-slide__content--e0Oyv.__position_outside_top--tOlX7,.stories-slide-wrapper--yq3Zk .stories-slide__content--e0Oyv.__position_outside_bottom--EUvwa{position:relative;top:unset;right:unset;bottom:unset;left:unset;height:auto}.stories-slide-wrapper--yq3Zk .clamp--JfKw3{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ.align-left--H2od3{text-align:left}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ.align-center--iwQ73{text-align:center}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ.align-right--zzy4Y{text-align:right}.stories-slide--JIrrm._format-circle--GuDY7,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide-image__image--UXctk,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide-image__image--UXctk video,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide__mask--N1bZK,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide-image--tHOh7{border-radius:50%}.stories-slide--JIrrm._favorite-cell--UoDmM .stories-slide__mask--N1bZK{background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%)}.stories-slide--JIrrm._favorite-cell--UoDmM._format-circle--GuDY7 .stories-slide-image__wrap--QgNhx{display:flex}.stories-slide--JIrrm._favorite-cell--UoDmM._format-circle--GuDY7 .stories-slide-image__image--UXctk{width:85%;height:85%;overflow:visible;margin:auto}.stories-slide--JIrrm._favorite-cell--UoDmM._format-circle--GuDY7 .favorite-images-wrapper--Hm4wF{margin:0;padding:0}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z{filter:drop-shadow(var(--storiesListCardDropShadow, none))}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z._is-read--GNVqR{filter:drop-shadow(var(--storiesListCardOpenedDropShadow, none))}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z._favorite-cell--UoDmM{filter:drop-shadow(var(--storiesListCardFavoriteDropShadow, none))}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z._ugc-cell--szjgS{filter:drop-shadow(var(--storiesListCardUgcDropShadow, none))}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardMask);mask-image:var(--storiesListCardMask)}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd._is-read--GNVqR .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardOpenedMask);mask-image:var(--storiesListCardOpenedMask)}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd._favorite-cell--UoDmM .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardFavoriteMask);mask-image:var(--storiesListCardFavoriteMask)}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd._ugc-cell--szjgS .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardUgcMask);mask-image:var(--storiesListCardUgcMask)}.stories-slide--JIrrm .card-overlay-svg-mask--ggkSQ{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:3}@supports(((mask-image: linear-gradient(0deg, #fff, #fff), linear-gradient(0deg, #fff, #fff)) and (mask-clip: content-box, border-box)) or ((-webkit-mask-image: linear-gradient(0deg, #fff, #fff), linear-gradient(0deg, #fff, #fff)) and (-webkit-mask-clip: content-box, border-box))) and ((mask-composite: exclude) or (-webkit-mask-composite: xor)){.stories-slide--JIrrm._has-border-gradient-color--BniDY{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY:before{content:"";position:absolute;border-radius:inherit;box-sizing:border-box;-webkit-mask-composite:xor;mask-composite:exclude;padding:var(--storiesListBorderNotReadWidth, 2px);top:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);right:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);left:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);background:var(--storiesBorderNotReadGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}.stories-slide--JIrrm._has-border-gradient-color--BniDY._is-read--GNVqR{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY._is-read--GNVqR:before{padding:var(--storiesListBorderReadWidth, 2px);top:calc(var(--storiesListBorderReadWidth, 2px)*-1);right:calc(var(--storiesListBorderReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderReadWidth, 2px)*-1);left:calc(var(--storiesListBorderReadWidth, 2px)*-1);background:var(--storiesBorderReadGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}.stories-slide--JIrrm._has-border-gradient-color--BniDY._favorite-cell--UoDmM{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY._favorite-cell--UoDmM:before{padding:var(--storiesListBorderNotReadWidth, 2px);top:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);right:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);left:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);background:var(--storiesListCardFavoriteGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}.stories-slide--JIrrm._has-border-gradient-color--BniDY._ugc-cell--szjgS{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY._ugc-cell--szjgS:before{padding:var(--storiesListBorderNotReadWidth, 2px);top:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);right:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);left:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);background:var(--storiesListCardUgcGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}}',""]);var n="stories-slide-wrapper--yq3Zk",l="stories-slide--JIrrm",c="_format-quad--v6wDk",d="_format-rectangle--Ta5cp",h="stories-slide-image--tHOh7",u="stories-slide-image__image--UXctk",p="stories-slide__mask--N1bZK",g="stories-slide__content--e0Oyv",f="_is-read--GNVqR",m="isTitleCardOutsideTop--qrtQC",y="isTitleCardOutsideBottom--lXtXr",v="stories-slide__inner--Fhgjf",b="_background-color-black--GMC_A",w="_background-color-white--GA_HZ",S="_background-color-red--IeWZj",_="_background-color-yellow--MjuAF",O="_background-color-green--d_u0t",k="_background-color-violet--_Pws4",x="_background-color-blue--nf2Wk",C="_background-color-grey--ho5xA",P="_background-color-black-gradient--ScIpU",j="_background-color-white-gradient--KFVbd",E="_background-color-red-gradient--FlHVF",I="_background-color-yellow-gradient--Na5gP",T="_background-color-green-gradient--bBwZa",A="_background-color-violet-gradient--zMsPH",M="_background-color-blue-gradient--tqRAH",L="_background-color-grey-gradient--m9xqh",R="stories-slide-image__wrap--QgNhx",B="_mode_list--dEj_1",D="ugc-card-cell--rJcS4",N="video-loaded--dk0k5",F="_ugc-cell--szjgS",U="__position_outside_top--tOlX7",G="__position_outside_bottom--EUvwa",V="clamp--JfKw3",z="stories-slide__title--qq_kQ",W="align-left--H2od3",$="align-center--iwQ73",H="align-right--zzy4Y",q="_format-circle--GuDY7",J="_favorite-cell--UoDmM",K="favorite-images-wrapper--Hm4wF",Z="_has-drop-shadow--Rrc2Z",Q="_has-card-svg-mask--Pjyjd",Y="card-overlay-svg-mask--ggkSQ",X="_has-border-gradient-color--BniDY";const ee=o},1980(e,t,r){"use strict";r.d(t,{Ay:()=>k,ED:()=>y,P0:()=>f,Rh:()=>w,SV:()=>O,Vd:()=>S,uT:()=>g,w0:()=>b,w2:()=>_,xM:()=>v,yt:()=>m});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a),n=r(62),l=r.n(n),c=new URL(r(487),r.b),d=new URL(r(5720),r.b),h=o()(s()),u=l()(c),p=l()(d);h.push([e.id,`.stories-list-controls--lCJNC{pointer-events:none}.stories-list-controls--lCJNC .control-start--eUcK_,.stories-list-controls--lCJNC .control-end--zHGpG{cursor:pointer;position:absolute;background-color:var(--storiesListControlsBackgroundColor, white);border-radius:50%;z-index:10;height:var(--storiesListControlsSize);width:var(--storiesListControlsSize);top:50%;display:flex;justify-content:center;align-items:center;pointer-events:all}.stories-list-controls--lCJNC .control-icon--RZK51{width:7px;height:12px;background-color:var(--storiesListControlsColor, black)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-start--eUcK_{left:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-start--eUcK_.control-start_dir_rtl--qVqiV{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-end--zHGpG{right:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-end--zHGpG.control-end_dir_rtl--iekZd{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--lCJNC.vertical--F1syL .control-start--eUcK_{top:var(--storiesListTopPadding, 0);left:50%;transform:translate3d(-50%, 0, 0) rotate(90deg)}.stories-list-controls--lCJNC.vertical--F1syL .control-end--zHGpG{top:auto;bottom:var(--storiesListBottomPadding, 0);right:50%;transform:translate3d(50%, 0, 0) rotate(90deg)}.stories-list-controls--lCJNC .control-start--eUcK_{display:flex}.stories-list-controls--lCJNC .control-start--eUcK_ .control-icon--RZK51{-webkit-mask-image:url(${u});mask-image:url(${u})}.stories-list-controls--lCJNC .control-start--eUcK_.control-start_reach-start--DHQQF{display:none}.stories-list-controls--lCJNC .control-end--zHGpG{display:flex}.stories-list-controls--lCJNC .control-end--zHGpG .control-icon--RZK51{-webkit-mask-image:url(${p});mask-image:url(${p})}.stories-list-controls--lCJNC .control-end--zHGpG.control-end_reach-end--z6db0{display:none}`,""]);var g="stories-list-controls--lCJNC",f="control-start--eUcK_",m="control-end--zHGpG",y="control-icon--RZK51",v="horizontal--vfM2_",b="control-start_dir_rtl--qVqiV",w="control-end_dir_rtl--iekZd",S="vertical--F1syL",_="control-start_reach-start--DHQQF",O="control-end_reach-end--z6db0";const k=h},3476(e,t,r){"use strict";r.d(t,{Ay:()=>u,Lb:()=>d,SG:()=>c,YE:()=>h,eS:()=>l,uT:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-list-controls--j6ogL .stories-list-controls__btn_next--hEemh,.stories-list-controls--j6ogL .stories-list-controls__btn_prev--gxn67{display:none}.stories-list-controls--j6ogL.stories-list-controls_desktop--Z1cW_ .stories-list-controls__btn_next--hEemh,.stories-list-controls--j6ogL.stories-list-controls_desktop--Z1cW_ .stories-list-controls__btn_prev--gxn67{display:block;position:absolute;top:50%;transform:translateY(-50%);left:50%}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0:focus{outline:0}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0{background-color:rgba(0,0,0,0);border:none;color:#fff;cursor:pointer}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0:disabled{color:#464646;cursor:not-allowed}",""]);var n="stories-list-controls--j6ogL",l="stories-list-controls__btn_next--hEemh",c="stories-list-controls__btn_prev--gxn67",d="stories-list-controls_desktop--Z1cW_",h="stories-list-controls__btn-icon--aH7V0";const u=o},4267(e,t,r){"use strict";r.d(t,{$X:()=>d,Ay:()=>p,GQ:()=>l,N1:()=>h,fo:()=>n,uY:()=>u,yU:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-list-container--m977t{left:50%;transform:translateX(-50%);overflow:hidden;box-sizing:border-box;z-index:1;position:relative;height:100%}.stories-list-container--m977t.stories-list-container_swipe-up--jwCM8.stories-list-container_swipe-up--jwCM8{background-color:rgba(0,0,0,0)}.stories-list-container--m977t.stories-list-container_desktop--ASkve{padding:50px 0}.stories-list-container--m977t *,.stories-list-container--m977t ::after,.stories-list-container--m977t ::before{box-sizing:border-box}.stories-list-container--m977t .stories-list--yA6Px{position:relative;height:100%;transform-style:preserve-3d}.stories-list-container--m977t .stories-list--yA6Px .stories-list__effect-viewer--mpRIQ{position:relative;top:0;left:0;right:0;width:100%;width:calc(100% + .01px);height:100%;transform-style:preserve-3d}.stories-list-container--m977t .stories-list--yA6Px .stories-list__item--Ubk5o{position:absolute;width:100%;height:auto;bottom:0;border-radius:var(--slide-border-radius, 0);left:0;top:0;backface-visibility:hidden}",""]);var n="stories-list-container--m977t",l="stories-list-container_swipe-up--jwCM8",c="stories-list-container_desktop--ASkve",d="stories-list--yA6Px",h="stories-list__effect-viewer--mpRIQ",u="stories-list__item--Ubk5o";const p=o},6778(e,t,r){"use strict";r.d(t,{Ay:()=>p,Tr:()=>u,XX:()=>h,cW:()=>n,d9:()=>l,j:()=>c,qU:()=>d});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-list-controls--v8JVG{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:100000;transition:opacity 300ms}.story-list-controls--v8JVG.story-list-controls_hidden--MwhKk{opacity:0}.story-list-controls--v8JVG.story-list-controls_hidden--MwhKk .story-list-controls__item--MgB7Q{pointer-events:none}.story-list-controls--v8JVG:hover .story-list-controls__btn--r96Si{color:#fff}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q{position:absolute;top:0;bottom:0;display:flex;flex-direction:column;justify-content:center;pointer-events:all}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q.story-list-controls__item_next--n9YHk{right:-42px}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q.story-list-controls__item_prev--WCiBG{left:-42px}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0);padding:10px}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si:focus{outline:0}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si :active{opacity:.3}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si{border:none;color:#fff;cursor:pointer}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si:disabled{color:#464646;cursor:not-allowed}",""]);var n="story-list-controls--v8JVG",l="story-list-controls_hidden--MwhKk",c="story-list-controls__item--MgB7Q",d="story-list-controls__btn--r96Si",h="story-list-controls__item_next--n9YHk",u="story-list-controls__item_prev--WCiBG";const p=o},9037(e,t,r){"use strict";r.d(t,{$X:()=>l,Ay:()=>h,fo:()=>n,tB:()=>d,uY:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-list-container--EK5f1{width:100%;height:100%;height:inherit;overflow:hidden;padding:50px 0;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;margin:0 auto}.stories-list-container--EK5f1 .stories-list--N4TGU{display:flex;width:100%;height:inherit;position:relative}.stories-list-container--EK5f1 .stories-list--N4TGU .stories-list__item--CV1pG{box-sizing:border-box;height:100%;position:relative;flex-shrink:0;display:flex;align-items:center;cursor:pointer;transition:transform .3s ease-in;transform:scale(0.7);will-change:transform}.stories-list-container--EK5f1 .stories-list--N4TGU .stories-list__item--CV1pG.stories-list__item_active--Ssw9w{transform:scale(1);cursor:inherit}",""]);var n="stories-list-container--EK5f1",l="stories-list--N4TGU",c="stories-list__item--CV1pG",d="stories-list__item_active--Ssw9w";const h=o},1239(e,t,r){"use strict";r.d(t,{Ay:()=>p,GJ:()=>c,Xr:()=>h,Z2:()=>l,m9:()=>u,qc:()=>d,vi:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-viewer--I2zsy{position:fixed;z-index:1100;top:0;left:0;width:100%;height:100%;display:block;transition:opacity .3s ease;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stories-viewer--I2zsy:-webkit-full-screen,.stories-viewer--I2zsy:-moz-full-screen,.stories-viewer--I2zsy:-ms-fullscreen,.stories-viewer--I2zsy :fullscreen{width:100% !important;height:100% !important}.stories-viewer--I2zsy.no-select--hmeyj{user-select:none}.stories-viewer--I2zsy .stories-viewer-background--po1OR{position:fixed;top:-60px;left:-60px;width:calc(100% + 120px);height:calc(100% + 120px);background-position:center;background-repeat:no-repeat;background-size:cover}.stories-viewer--I2zsy .stories-viewer-backdrop--ITihi{position:fixed;top:0;right:0;bottom:0;left:0;z-index:11;background-color:hsla(0,0%,100%,.5)}.stories-viewer--I2zsy .stories-viewer-backdrop--ITihi._desktopMode--eez8K{display:none}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy{width:40px;height:40px;position:absolute;top:15px;color:#c2c2c4;z-index:100001}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=start],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=left]{left:15px}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=start][dir=rtl],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=left][dir=rtl]{left:auto;right:15px}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=end],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=right]{right:15px}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=end][dir=rtl],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=right][dir=rtl]{left:15px;right:auto}",""]);var n="stories-viewer--I2zsy",l="no-select--hmeyj",c="stories-viewer-background--po1OR",d="stories-viewer-backdrop--ITihi",h="_desktopMode--eez8K",u="stories-viewer__close-btn--kO4wy";const p=o},6028(e,t,r){"use strict";r.d(t,{Ay:()=>p,NG:()=>l,OI:()=>n,i2:()=>u,km:()=>c,lL:()=>d,x3:()=>h});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-action-panel--KnNNl{position:absolute;z-index:10001;bottom:0;left:0;right:0;padding:0 8px 8px 8px;height:50px;pointer-events:none}.story-action-panel--KnNNl.story-action-panel_hidden--tAyow .story-action-panel-actions--i4Tz_{opacity:0}.story-action-panel--KnNNl.story-action-panel_hidden--tAyow .story-action-panel-actions--i4Tz_ .story-action-panel-actions__item--lH6jO{pointer-events:none}.story-action-panel--KnNNl.story-action-panel_mobile--AhdCB{background-color:#000}.story-action-panel--KnNNl[dir=rtl] .story-action-panel-actions--i4Tz_ .story-action-panel-actions__right-container--P4Mxa{margin-left:0;margin-right:auto}.story-action-panel--KnNNl[dir=rtl] .story-action-panel-actions--i4Tz_ .story-action-panel-actions__item--lH6jO{transform:scaleX(-1)}.story-action-panel-actions--i4Tz_{width:100%;height:100%;display:flex;flex-direction:row;color:#fff;align-items:center;transition:opacity 300ms}.story-action-panel-actions--i4Tz_>span{display:flex}.story-action-panel-actions--i4Tz_ .story-action-panel-actions__right-container--P4Mxa{margin-left:auto;display:flex}.story-action-panel-actions__item--lH6jO{cursor:pointer;pointer-events:all}.story-action-panel-actions__item--lH6jO>*{pointer-events:none}.story-action-panel-actions__item--lH6jO{display:flex;align-items:center;justify-content:center;filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.5));padding:5px;transition:background-color .2s ease-in-out}.story-action-panel-actions__item--lH6jO:not(:last-child){margin-right:5px}.story-action-panel-actions__item--lH6jO:hover{filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.9))}",""]);var n="story-action-panel--KnNNl",l="story-action-panel_hidden--tAyow",c="story-action-panel-actions--i4Tz_",d="story-action-panel-actions__item--lH6jO",h="story-action-panel_mobile--AhdCB",u="story-action-panel-actions__right-container--P4Mxa";const p=o},2004(e,t,r){"use strict";r.d(t,{At:()=>l,Ay:()=>c,hH:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-backdrop--lKunK{position:absolute;left:0;right:0;top:0;bottom:0;background-color:rgba(0,0,0,.2);z-index:10000;backdrop-filter:blur(3px);pointer-events:none;border-radius:var(--slide-border-radius, 0);transition:opacity 300ms}.story-backdrop--lKunK.story-backdrop_hidden--AVOQS{opacity:0;pointer-events:none}",""]);var n="story-backdrop--lKunK",l="story-backdrop_hidden--AVOQS";const c=o},3910(e,t,r){"use strict";r.d(t,{Ay:()=>g,BL:()=>c,K0:()=>h,KH:()=>l,Pl:()=>u,Uv:()=>p,Xs:()=>d,bA:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-controls--ZifWj{display:flex;margin-top:8px}.story-controls--ZifWj[dir=rtl] .story-controls__item--KfHhY:first-child{margin-right:auto;margin-left:0px}.story-controls--ZifWj .story-controls__item--KfHhY{transition:opacity 300ms;color:#fff;width:32px;height:32px}.story-controls--ZifWj .story-controls__item--KfHhY:first-child{margin-left:auto}.story-controls--ZifWj .story-controls__item--KfHhY.story-controls__item_hidden--NBUBi{opacity:0;pointer-events:none}.story-controls--ZifWj .story-controls__item--KfHhY.story-controls__item_hidden--NBUBi .story-controls__btn--iA2Aa{pointer-events:none}.story-controls--ZifWj .story-controls__item--KfHhY .story-controls__btn_close--GjcEj{color:#fff}.story-controls--ZifWj .story-controls__btn-group--fWH9s{position:relative}.story-controls--ZifWj .story-controls__btn-group--fWH9s .story-controls__btn--iA2Aa{position:absolute;left:0;right:0;bottom:0;top:0}.story-controls--ZifWj .story-controls__btn--iA2Aa{border:0;padding:0;background:rgba(0,0,0,0);pointer-events:all;cursor:pointer;outline:none;color:inherit;padding:8px;border-radius:9999px;filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.5))}.story-controls--ZifWj .story-controls__btn--iA2Aa svg{overflow:visible}.story-controls--ZifWj .story-controls__btn--iA2Aa:focus{outline:none}.story-controls--ZifWj .story-controls__btn--iA2Aa.story-controls__btn_hidden--I6nRx{visibility:hidden;pointer-events:none}.story-controls--ZifWj .story-controls__btn--iA2Aa:active{opacity:.5}",""]);var n="story-controls--ZifWj",l="story-controls__item--KfHhY",c="story-controls__item_hidden--NBUBi",d="story-controls__btn--iA2Aa",h="story-controls__btn_close--GjcEj",u="story-controls__btn-group--fWH9s",p="story-controls__btn_hidden--I6nRx";const g=o},114(e,t,r){"use strict";r.d(t,{Ay:()=>f,JS:()=>d,Wr:()=>g,cQ:()=>u,d:()=>p,dP:()=>l,tG:()=>c,wY:()=>h,wg:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-timeline--TQcGl{pointer-events:none;transition:opacity 300ms}.story-timeline--TQcGl.story-timeline_hidden--wSei3{opacity:0}.story-timeline--TQcGl.story-timeline_desktop--SFzsq{border-top-left-radius:5px;border-top-right-radius:5px}.story-timeline--TQcGl .story-timeline-ticks--YTuXL{height:3px;display:flex}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick--uu9gA{background-color:var(--story-timeline-background, rgba(255, 255, 255, 0.6));width:100%;margin:0 2px;overflow:hidden;position:relative;border-radius:10px}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick--uu9gA:first-child{margin-left:0}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick--uu9gA:last-child{margin-right:0}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick-progress--scl_I{width:100%;height:3px}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick-progress--scl_I.story-timeline-ticks__tick-progress_active--YV2F9{background-color:var(--story-timeline-tick-foreground, rgb(255, 255, 255))}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick-progress-loader--bJk1d{width:100%;height:3px;position:absolute;top:0;left:0;background:linear-gradient(to right, var(--story-timeline-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}.story-timeline--TQcGl[dir=rtl] .story-timeline-ticks__tick-progress-loader--bJk1d{background:linear-gradient(to left, var(--story-timeline-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}",""]);var n="story-timeline--TQcGl",l="story-timeline_hidden--wSei3",c="story-timeline_desktop--SFzsq",d="story-timeline-ticks--YTuXL",h="story-timeline-ticks__tick--uu9gA",u="story-timeline-ticks__tick-progress--scl_I",p="story-timeline-ticks__tick-progress_active--YV2F9",g="story-timeline-ticks__tick-progress-loader--bJk1d";const f=o},2208(e,t,r){"use strict";r.d(t,{A:()=>l,h:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-header--wyX63{z-index:1131;position:relative;display:flex;padding:var(--timelineBlockTopOffset, 8px) 8px 32px 8px;pointer-events:none;flex-direction:column;background-image:linear-gradient(180deg, rgba(0, 0, 0, 0.104) 0%, rgba(0, 0, 0, 0) 100%)}",""]);var n="story-header--wyX63";const l=o},2621(e,t,r){"use strict";r.d(t,{Ay:()=>h,Vt:()=>l,gS:()=>n,ld:()=>c,vP:()=>d});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".goods-card--txNHz{width:100px}.goods-card--txNHz:first-of-type{margin-left:.5rem}.goods-card--txNHz:not(:last-child){margin-right:.5rem}.prices--Z5Jsc{display:flex}.prices--Z5Jsc>div:not(:last-child){margin-right:.5rem}.typography--dc2T_{text-decoration:none}.typography--old-price--r6Qv7{text-decoration:line-through}.figure--CECUA{margin:0;margin-bottom:.5rem;width:100px;height:100px}.figure--CECUA>img{width:inherit;height:inherit;max-width:100%;border-radius:var(--figure-border-radius, 0px);background-color:var(--figure-background-color, #ffffff)}",""]);var n="goods-card--txNHz",l="prices--Z5Jsc",c="typography--old-price--r6Qv7",d="figure--CECUA";const h=o},2561(e,t,r){"use strict";r.d(t,{Ay:()=>g,GW:()=>c,Nd:()=>d,PP:()=>u,Su:()=>h,gE:()=>l,gN:()=>p,tK:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".scrolling-carousel--OODdy{position:relative}.scrolling-carousel__wrapper--vqD_y{position:relative;overflow:hidden}.scrolling-carousel__item--W39h7{display:flex;flex-wrap:nowrap;cursor:pointer}.scrolling-carousel__arrow-button--RK6S_{width:36px;height:36px;color:#757575;margin-top:auto;margin-bottom:auto;box-shadow:0 0 0 1px rgba(0,0,0,.04),0 4px 8px 0 rgba(0,0,0,.2);background:#fff;border-radius:50%;cursor:pointer;position:absolute;top:0;bottom:0;opacity:0;transition:opacity .5s}.scrolling-carousel__arrow-button--RK6S_>svg{position:absolute;left:0;right:0;bottom:0;top:0;margin:auto;width:24px;height:24px;fill:#757575}.scrolling-carousel__arrow-button--RK6S_:hover svg{fill:#000}.scrolling-carousel__arrow-button--show--RTHxp{opacity:.9}.scrolling-carousel__arrow-button--show--RTHxp:hover{opacity:1}.scrolling-carousel__arrow-button--right--HLaJI{right:-18px}.scrolling-carousel__arrow-button--left--kfi5d{left:-18px}@media(pointer: coarse){.scrolling-carousel__arrow-button--RK6S_{display:none !important}}",""]);var n="scrolling-carousel--OODdy",l="scrolling-carousel__wrapper--vqD_y",c="scrolling-carousel__item--W39h7",d="scrolling-carousel__arrow-button--RK6S_",h="scrolling-carousel__arrow-button--show--RTHxp",u="scrolling-carousel__arrow-button--right--HLaJI",p="scrolling-carousel__arrow-button--left--kfi5d";const g=o},4354(e,t,r){"use strict";r.d(t,{A:()=>l,H:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".btn--cfI9O{margin:auto auto 10px;padding:10px;cursor:pointer}",""]);var n="btn--cfI9O";const l=o},9406(e,t,r){"use strict";r.d(t,{Ay:()=>l,u1:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,"@keyframes spin--QyVKJ{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner--bikAS{position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);width:2rem;height:2rem;border-radius:50%;animation:spin--QyVKJ .6s infinite linear;border:var(--border, 2px solid transparent);border-color:var(--border-color, black)}",""]);var n="spinner--bikAS";const l=o},777(e,t,r){"use strict";r.d(t,{Ay:()=>h,NM:()=>l,bt:()=>c,fY:()=>d,rq:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,"@keyframes fadeInFrames--BAAcK{from{opacity:0}to{opacity:1}}@keyframes fadeOutFrames--iXdQ3{from{opacity:1}to{opacity:0}}.goods-container--ylLse{position:relative;margin-left:auto;margin-right:auto;display:flex;flex-direction:column;width:100%;height:100%;margin-top:0px}.goods-container--visible--Zwg46{animation:300ms fadeInFrames--BAAcK}.goods-container--hidden--T79T4{animation:300ms normal forwards fadeOutFrames--iXdQ3}.goods-container__backdrop--Gb82L{flex:1}.goods-list--w7fw3{position:relative;display:flex;flex-direction:column}",""]);var n="goods-container--ylLse",l="goods-container--visible--Zwg46",c="goods-container--hidden--T79T4",d="goods-container__backdrop--Gb82L";const h=o},9111(e,t,r){"use strict";r.d(t,{A:()=>l,L:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".goods-widget-viewer--Yv1dR{position:absolute;inset:0;z-index:30000;text-align:left}",""]);var n="goods-widget-viewer--Yv1dR";const l=o},7656(e,t,r){"use strict";r.d(t,{Ay:()=>O,HE:()=>b,Q$:()=>m,Xn:()=>_,b1:()=>d,fg:()=>y,hF:()=>u,iE:()=>n,iW:()=>c,kJ:()=>v,nl:()=>f,qG:()=>S,rL:()=>h,rN:()=>p,tB:()=>l,wU:()=>g,x6:()=>w});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'.wrapper--SCmz9{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";position:absolute;inset:0;z-index:30000;border-radius:inherit}.wrapper--SCmz9 .backdrop--seLwi{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5);border-radius:inherit}.main--XK4rj{position:absolute;z-index:2;user-select:none;display:flex;flex-direction:column;text-rendering:geometricprecision;overflow:hidden}.main--XK4rj .question--MqYwv:empty{display:none}.main--XK4rj .question--MqYwv{width:100%;height:auto}.main--XK4rj .input-group--lMzQE{display:flex}.main--XK4rj .input-group--lMzQE .input--YmfeI{width:100%}.main--XK4rj .input-group--lMzQE .input-group__prepend--n6ARX{display:flex;flex:.35}.main--XK4rj .input-group--lMzQE .input-group__separator--OnA4C{border-right:1px solid #fff;margin-right:.5rem}.main--XK4rj .input-group--lMzQE .input--YmfeI{flex:1}.main--XK4rj .input-wrapper--QCAEu{overflow:hidden;box-sizing:content-box;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.main--XK4rj .input-wrapper--QCAEu .input--YmfeI{background:none;-webkit-tap-highlight-color:rgba(0,0,0,0);text-rendering:inherit;outline:none;border:none}.main--XK4rj .input-wrapper--QCAEu .input--YmfeI::placeholder{color:inherit}.main--XK4rj .input-wrapper--QCAEu .input--YmfeI.input_centered--Yi3YX{text-align:center}.main--XK4rj .input-wrapper--QCAEu.is-invalid--X7GYL{border-color:#dc3545 !important;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.textarea-grow-wrap--QgfQG{display:grid;max-width:100%;word-break:break-all}.textarea-grow-wrap--QgfQG::after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.textarea-grow-wrap--QgfQG>.input--YmfeI{resize:none;overflow:hidden}.textarea-grow-wrap--QgfQG>.input--YmfeI,.textarea-grow-wrap--QgfQG::after{border:inherit;padding:inherit;font:inherit;text-rendering:inherit;text-align:inherit;line-height:normal;color:inherit;grid-area:1/1/2/2}.button-wrapper--q9QcI{width:100%}.button-wrapper--q9QcI .button--H5mC8{width:100%;cursor:pointer}.button-wrapper--q9QcI .button--H5mC8:disabled,.button-wrapper--q9QcI .button--H5mC8[disabled=true]{cursor:not-allowed;pointer-events:none;background-color:#272727 !important}@keyframes fadeIn--Zufa6{from{opacity:0}to{opacity:1}}@keyframes fadeOut--ojkit{from{opacity:1}to{opacity:0}}.fadeIn--Zufa6{animation:fadeIn--Zufa6 300ms forwards}.fadeOut--ojkit{animation:fadeOut--ojkit 0ms forwards}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}',""]);var n="wrapper--SCmz9",l="backdrop--seLwi",c="main--XK4rj",d="question--MqYwv",h="input-group--lMzQE",u="input--YmfeI",p="input-group__prepend--n6ARX",g="input-group__separator--OnA4C",f="input-wrapper--QCAEu",m="input_centered--Yi3YX",y="is-invalid--X7GYL",v="textarea-grow-wrap--QgfQG",b="button-wrapper--q9QcI",w="button--H5mC8",S="fadeIn--Zufa6",_="fadeOut--ojkit";const O=o},6349(e,t,r){"use strict";r.d(t,{Ay:()=>d,Z8:()=>l,_7:()=>n,rE:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story--FKtqL{height:100%;width:100%;position:relative;backface-visibility:hidden;transform:translateZ(0);overflow:hidden;border-radius:var(--slide-border-radius, 0)}@supports(clip-path: inset(0 round 0)){.story--FKtqL{overflow:visible;border-radius:0;clip-path:inset(0 round var(--slide-border-radius, 0px))}}.story--FKtqL.story_mobile--nWF1r{border-radius:0}.story--FKtqL.story_mobile--nWF1r .story-slides--HJ7Kh{border-radius:var(--slide-border-radius, 0)}.story--FKtqL .story-slides--HJ7Kh{position:absolute;overflow:hidden;top:0;left:0;bottom:0;right:0}",""]);var n="story--FKtqL",l="story_mobile--nWF1r",c="story-slides--HJ7Kh";const d=o},8790(e,t,r){"use strict";r.d(t,{Ay:()=>d,Gp:()=>c,Kk:()=>n,dG:()=>l});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".close-btn-wrapper--bHM7p{transition:opacity 300ms;width:100%;height:100%;color:#c2c2c4}.close-btn-wrapper--bHM7p.close-btn-wrapper_hidden--msWNU{opacity:0}.close-btn-wrapper--bHM7p.close-btn-wrapper_hidden--msWNU .close-btn--SAMXI{pointer-events:none}.close-btn--SAMXI{border:0;padding:0;background:rgba(0,0,0,0);pointer-events:all;cursor:pointer;outline:none;color:inherit;width:100%;height:100%}.close-btn--SAMXI:focus{outline:none}.close-btn--SAMXI{display:flex;justify-content:center;align-items:center}.close-btn--SAMXI svg{overflow:visible;width:100%;height:100%}.close-btn--SAMXI:active{opacity:.5}",""]);var n="close-btn-wrapper--bHM7p",l="close-btn-wrapper_hidden--msWNU",c="close-btn--SAMXI";const d=o},5479(e,t,r){"use strict";r.d(t,{Ay:()=>d,MU:()=>l,Xr:()=>c,wG:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".loader--hPq1w{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background, black)}.loader--hPq1w .loader__refresh-btn--qI2it{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader--hPq1w .loader__spinner--W3Lnd{-ms-flex-negative:0;flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor, white);border-color:var(--loaderBackgroundAccentColor, transparent) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white);-webkit-animation:loading-spinner--Nh9wv .6s infinite linear;animation:loading-spinner--Nh9wv .6s infinite linear}@keyframes loading-spinner--Nh9wv{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]);var n="loader--hPq1w",l="loader__refresh-btn--qI2it",c="loader__spinner--W3Lnd";const d=o},3639(e,t,r){"use strict";r.d(t,{A:()=>p,g:()=>u});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a),n=r(62),l=r.n(n),c=new URL(r(6040),r.b),d=o()(s()),h=l()(c);d.push([e.id,`.screen-orientation-lock--jmBZa{pointer-events:all;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fff;z-index:1;user-select:none;background-position:center center;background-size:cover;background-repeat:no-repeat;background-image:url(${h})}`,""]);var u="screen-orientation-lock--jmBZa";const p=d},7231(e,t,r){"use strict";r.d(t,{Ay:()=>b,HM:()=>l,Km:()=>h,OL:()=>u,Oy:()=>m,PH:()=>y,Rg:()=>v,UH:()=>d,Wz:()=>g,cU:()=>f,ge:()=>n,l9:()=>c,xG:()=>p});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".share-panel__body_screenshot--jKMDk{display:flex;flex-direction:column}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1{cursor:pointer;background:rgba(0,0,0,0);border:none;width:100%;height:100%;display:flex;text-align:left;justify-content:center;align-items:center;color:#fff}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B{margin-right:5px;position:relative;width:30px;height:30px;flex-shrink:0}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B .btn-copy__icon-state--jy0bV{position:absolute;inset:0px;opacity:0;transition:opacity 300ms ease-in-out}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B .btn-copy__icon-state--jy0bV.btn-copy__icon-state_default--CA8xO{opacity:1;visibility:visible}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B .btn-copy__icon-state--jy0bV.btn-copy__icon-state_done--qiZIb{opacity:1;visibility:visible}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__text--dZSfK{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:5px}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1:active{transform:scale(0.96)}.share-panel__body_screenshot--jKMDk .share-panel-row--_zeGB{justify-content:center;height:auto;padding:16px}.share-panel__body_screenshot--jKMDk .share-panel-row--_zeGB:first-child{height:450px;box-sizing:border-box}.share-panel__body_screenshot--jKMDk .share-panel-row__image-link--T18rs{width:100%;height:100%;display:flex;justify-content:center}.share-panel__body_screenshot--jKMDk .share-panel-row__image--JcHq6{max-width:100%;height:100%;object-fit:cover;border-radius:20px}.share-panel__body_screenshot--jKMDk .share-item__download-button--G5qRF{align-self:center;cursor:pointer;height:100%;width:100%;text-decoration:none;color:#fff;display:flex;align-items:center;justify-content:center}.share-panel__body_screenshot--jKMDk .share-item__download-button--G5qRF:active{transform:scale(0.96)}",""]);var n="share-panel__body_screenshot--jKMDk",l="btn--QKddA",c="btn-copy--cEip1",d="btn-copy__icon--QTB7B",h="btn-copy__icon-state--jy0bV",u="btn-copy__icon-state_default--CA8xO",p="btn-copy__icon-state_done--qiZIb",g="btn-copy__text--dZSfK",f="share-panel-row--_zeGB",m="share-panel-row__image-link--T18rs",y="share-panel-row__image--JcHq6",v="share-item__download-button--G5qRF";const b=o},6827(e,t,r){"use strict";r.d(t,{A:()=>l,l:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".ias-copy-button--C5qry{color:#fff}.ias-copy-button--C5qry:hover{color:#fff}",""]);var n="ias-copy-button--C5qry";const l=o},9749(e,t,r){"use strict";r.d(t,{Ay:()=>d,KY:()=>c,Kw:()=>n,X$:()=>l});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".share-item--JUUkd{color:#fff}a.share-item--JUUkd{color:#fff;transition:none}a.share-item--JUUkd:hover{color:#fff}.social-list--Vfhck{flex-wrap:wrap;height:auto;padding-bottom:1rem}.social-list--Vfhck .social-list__item--QGZS7{margin-top:1rem}",""]);var n="share-item--JUUkd",l="social-list--Vfhck",c="social-list__item--QGZS7";const d=o},5839(e,t,r){"use strict";r.d(t,{$9:()=>m,Ay:()=>_,DD:()=>f,Kw:()=>h,Xn:()=>b,YX:()=>p,Zu:()=>g,cU:()=>d,fP:()=>n,jk:()=>c,ly:()=>w,md:()=>S,pX:()=>u,qG:()=>v,yg:()=>l,z5:()=>y});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'.share-panel-wrapper--wPNgv{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";position:absolute;top:0;left:0;right:0;bottom:0;z-index:10001}.share-panel-wrapper--wPNgv .share-panel-backdrop--EELt8{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5)}.share-panel--yiLza{position:absolute;top:auto;left:0;right:0;bottom:0;z-index:2;user-select:none}.share-panel-row--d_Y3g{width:100%;height:150px;display:flex;flex-direction:row;align-items:center;box-sizing:border-box}.share-panel-row--d_Y3g .share-item--EJDtg{cursor:pointer;flex:0 0 auto;width:69px;height:90px;margin:0 10px}.share-panel-row--d_Y3g .share-item--EJDtg:first-child{margin-left:20px}.share-panel-row--d_Y3g .share-item--EJDtg:last-child{margin-right:20px}.share-panel-row--d_Y3g .share-item--EJDtg{display:flex;flex-direction:column;align-items:center;text-align:center}.share-panel-row--d_Y3g .share-item--EJDtg,.share-panel-row--d_Y3g .share-item--EJDtg:visited,.share-panel-row--d_Y3g .share-item--EJDtg:active,.share-panel-row--d_Y3g .share-item--EJDtg:focus{text-decoration:none}.share-panel-row--d_Y3g .share-item--EJDtg .share-item-title--GZtlK{margin-top:20px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:.2rem}.share-panel-row--d_Y3g.title-row--yXCRX{height:120px;padding-top:30px;padding-bottom:30px;padding-left:20px;padding-right:20px}.share-panel-row--d_Y3g.title-row--yXCRX .share-url-favicon--WRXRp{width:60px;height:60px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.share-panel-row--d_Y3g.title-row--yXCRX .share-url-favicon--WRXRp img{width:30px;height:30px}.share-panel-row--d_Y3g.title-row--yXCRX .title--kyfw7{font-size:16px;line-height:1.4rem;margin-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.share-panel-row--d_Y3g.title-row--yXCRX .title--kyfw7[dir=rtl]{margin-left:0px;margin-right:15px}.share-panel-separator--OU12s{width:100%;height:1px}.share-panel--yiLza{will-change:transform;transition:transform 300ms}.share-panel__body--YRkXN{width:100%;height:100%}@keyframes slideIn--TAzsm{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slideOut--Tgy4R{from{transform:translateY(0%)}to{transform:translateY(100%)}}@keyframes fadeIn--BJJpX{from{opacity:0}to{opacity:1}}@keyframes fadeOut--qKRjj{from{opacity:1}to{opacity:0}}.fadeIn--BJJpX{animation:fadeIn--BJJpX 300ms forwards}.fadeOut--qKRjj{animation:fadeOut--qKRjj 300ms forwards}.slideIn--TAzsm{animation:slideIn--TAzsm 300ms forwards}.slideOut--Tgy4R{animation:slideOut--Tgy4R 300ms forwards}',""]);var n="share-panel-wrapper--wPNgv",l="share-panel-backdrop--EELt8",c="share-panel--yiLza",d="share-panel-row--d_Y3g",h="share-item--EJDtg",u="share-item-title--GZtlK",p="title-row--yXCRX",g="share-url-favicon--WRXRp",f="title--kyfw7",m="share-panel-separator--OU12s",y="share-panel__body--YRkXN",v="fadeIn--BJJpX",b="fadeOut--qKRjj",w="slideIn--TAzsm",S="slideOut--Tgy4R";const _=o},4456(e,t,r){"use strict";r.d(t,{A:()=>l,K:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".icon--PiVau{width:2rem;height:2rem}",""]);var n="icon--PiVau";const l=o},935(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r="",i=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),i&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),i&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r}).join("")},t.i=function(e,r,i,s,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(i)for(var n=0;n<this.length;n++){var l=this[n][0];null!=l&&(o[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);i&&o[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),r&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=r):d[2]=r),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},62(e){"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},6758(e){"use strict";e.exports=function(e){return e[1]}},46(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(r,i){function s(r){e.removeListener(t,a),i(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}f(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&f(e,"error",t,r)}(e,s,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function n(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,i){var s,a,o,c;if(n(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(s=l(e))>0&&o.length>s&&!o.warned){o.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=o.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=d.bind(i);return s.listener=r,i.wrapFn=s,s}function u(e,t,r){var i=e._events;if(void 0===i)return[];var s=i[t];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(s):g(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function f(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function s(a){i.once&&e.removeEventListener(t,s),r(a)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var s="error"===e,a=this._events;if(void 0!==a)s=s&&void 0===a.error;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var n=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw n.context=o,n}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var c=l.length,d=g(l,c);for(r=0;r<c;++r)i(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return c(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return c(this,e,t,!0)},a.prototype.once=function(e,t){return n(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return n(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,i,s,a,o;if(n(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(s=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,s=a;break}if(s<0)return this;0===s?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,s),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,a=Object.keys(r);for(i=0;i<a.length;++i)"removeListener"!==(s=a[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return u(this,e,!0)},a.prototype.rawListeners=function(e){return u(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},1580(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2591(e){"use strict";var t=[];function r(e){for(var r=-1,i=0;i<t.length;i++)if(t[i].identifier===e){r=i;break}return r}function i(e,i){for(var a={},o=[],n=0;n<e.length;n++){var l=e[n],c=i.base?l[0]+i.base:l[0],d=a[c]||0,h="".concat(c," ").concat(d);a[c]=d+1;var u=r(h),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var g=s(p,i);i.byIndex=n,t.splice(n,0,{identifier:h,updater:g,references:1})}o.push(h)}return o}function s(e,t){var r=t.domAPI(t);r.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;r.update(e=t)}else r.remove()}}e.exports=function(e,s){var a=i(e=e||[],s=s||{});return function(e){e=e||[];for(var o=0;o<a.length;o++){var n=r(a[o]);t[n].references--}for(var l=i(e,s),c=0;c<a.length;c++){var d=r(a[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=l}}},8128(e){"use strict";var t={};e.exports=function(e,r){var i=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},3051(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855(e,t,r){"use strict";e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},1740(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var i="";r.supports&&(i+="@supports (".concat(r.supports,") {")),r.media&&(i+="@media ".concat(r.media," {"));var s=void 0!==r.layer;s&&(i+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),i+=r.css,s&&(i+="}"),r.media&&(i+="}"),r.supports&&(i+="}");var a=r.sourceMap;a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},3656(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},5016(e,t,r){"use strict";const i=document.querySelector("[nonce]");i&&(r.nc=i.nonce||i.getAttribute("nonce")),window.litNonce=r.nc},5720(e){"use strict";e.exports="data:image/svg+xml,%3Csvg width=%277%27 height=%2712%27 viewBox=%270 0 7 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M1 11L6 6L1 1%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E"},487(e){"use strict";e.exports="data:image/svg+xml,%3Csvg width=%277%27 height=%2712%27 viewBox=%270 0 7 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M6 11L1 6L6 1%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E"},6040(e){"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTc2MiIgaGVpZ2h0PSI4MjkiIHZpZXdCb3g9IjAgMCAxNzYyIDgyOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxyZWN0IHdpZHRoPSIxNzYyIiBoZWlnaHQ9IjgyOSIgZmlsbD0iIzIxMjEyMSIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02NjYgNTQ5QzY2MS41ODIgNTQ5IDY1OCA1NDUuNDE4IDY1OCA1NDFMNjU4IDM0OUM2NTggMzQ0LjU4MiA2NjEuNTgyIDM0MSA2NjYgMzQxTDk5NCAzNDFDOTk4LjQxOCAzNDEgMTAwMiAzNDQuNTgyIDEwMDIgMzQ5TDEwMDIgNTQxQzEwMDIgNTQ1LjQxOCA5OTguNDE4IDU0OSA5OTQgNTQ5TDY2NiA1NDlaTTY2OCA1NDFMOTYyIDU0MUw5NjIgMzQ5TDY2OCAzNDlMNjY4IDU0MVoiIGZpbGw9IiMzRjNGM0YiLz4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAwIDIxNEM5MDAgMjA5LjU4MiA5MDMuNTgyIDIwNiA5MDggMjA2SDExMDBDMTEwNC40MiAyMDYgMTEwOCAyMDkuNTgyIDExMDggMjE0VjU0MkMxMTA4IDU0Ni40MTggMTEwNC40MiA1NTAgMTEwMCA1NTBIOTA4QzkwMy41ODIgNTUwIDkwMCA1NDYuNDE4IDkwMCA1NDJWMjE0Wk05MDggMjE2VjUxMEgxMTAwVjIxNkg5MDhaIiBmaWxsPSJ3aGl0ZSIvPg0KPHBhdGggZD0iTTgwMy41IDIxNkM3NTggMjIwLjUgNzEzLjUgMjU3IDcxNyAzMTcuNUM3MjEgMjc4IDc1OCAyMzcuNSA4MDMuNSAyNDIuNVYyNjRMODQ1LjUgMjI5TDgwMy41IDE5NS41VjIxNloiIGZpbGw9IndoaXRlIi8+DQo8L3N2Zz4="},5136(e){"use strict";e.exports=c},6166(e){"use strict";e.exports=d},122(e){"use strict";e.exports=s},992(e){"use strict";e.exports=y},405(e){"use strict";e.exports=f},5714(e){"use strict";e.exports=n},7161(e){"use strict";e.exports=w},429(e){"use strict";e.exports=S},5125(e){"use strict";e.exports=k},318(e){"use strict";e.exports=_},6968(e){"use strict";e.exports=x},2083(e){"use strict";e.exports=O},7326(e){"use strict";e.exports=l},4977(e){"use strict";e.exports=o},6099(e){"use strict";e.exports=a},2883(t){"use strict";t.exports=e},7144(e){"use strict";e.exports=u},9498(e){"use strict";e.exports=h},5824(e){"use strict";e.exports=i},5314(e){"use strict";e.exports=r},5299(e){"use strict";e.exports=v},9780(e){"use strict";e.exports=m},9155(e){"use strict";e.exports=g},9514(e){"use strict";e.exports=b},5272(e){"use strict";e.exports=p},7315(e){"use strict";e.exports=t}},P={};function j(e){var t=P[e];if(void 0!==t)return t.exports;var r=P[e]={id:e,exports:{}};return C[e](r,r.exports,j),r.exports}j.m=C,j.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return j.d(t,{a:t}),t},j.d=(e,t)=>{for(var r in t)j.o(t,r)&&!j.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},j.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),j.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},j.b="undefined"!=typeof document&&document.baseURI||self.location.href,j.nc=void 0;var E={};return(()=>{"use strict";j.r(E),j.d(E,{AppearanceManager:()=>hl,AppearanceManagerEvents:()=>dl,CloseButtonPosition:()=>nt,FavoriteStoryList:()=>Tp,GoodsWidgetRenderingType:()=>gt,IASContainer:()=>Ap,IASProvider:()=>lp,IamCheckDisplayTimeRangeError:()=>Ka,IamFrequencyLimitError:()=>Ja,IamMessageLimitExceededError:()=>Za,IamMessageOpenError:()=>oo,IamNotFoundByEventError:()=>mn,IamNotFoundByIdError:()=>ia,IamNotFoundLimitError:()=>sa,IamOtherReaderIsOpenError:()=>Ha,IamShowOnlyIfLoadedError:()=>qa,IasNetworkError:()=>h,StackFeedStory:()=>No,StackedStoryListViewModel:()=>zo,StoriesListCardCoverQuality:()=>Ue,StoriesListCardTitlePosition:()=>Fe,StoriesListCardTitleTextAlign:()=>Ne,StoriesListCardViewVariant:()=>De,StoriesListDirection:()=>Ge,StoryFeedType:()=>me,StoryList:()=>Ep,StoryManager:()=>al,StoryReaderSwipeStyle:()=>vt,UGCFeedSlug:()=>Pe,UGCStoryList:()=>Ip,__IAS_INTERNAL_API__:()=>nl,storyManager:()=>ol,useIASProvider:()=>cp});var e={};j.r(e),j.d(e,{__position_outside_bottom:()=>fp.IW,__position_outside_top:()=>fp.i4,"_background-color-black":()=>fp.cw,"_background-color-black-gradient":()=>fp.ZE,"_background-color-blue":()=>fp.Vf,"_background-color-blue-gradient":()=>fp.Yo,"_background-color-green":()=>fp.Qo,"_background-color-green-gradient":()=>fp.F,"_background-color-grey":()=>fp.m4,"_background-color-grey-gradient":()=>fp.dl,"_background-color-red":()=>fp.av,"_background-color-red-gradient":()=>fp.hS,"_background-color-violet":()=>fp.OC,"_background-color-violet-gradient":()=>fp.XW,"_background-color-white":()=>fp.cp,"_background-color-white-gradient":()=>fp.ro,"_background-color-yellow":()=>fp.P2,"_background-color-yellow-gradient":()=>fp.om,"_favorite-cell":()=>fp.Xz,"_format-circle":()=>fp.mW,"_format-quad":()=>fp.zc,"_format-rectangle":()=>fp.Pr,"_has-border-gradient-color":()=>fp.sB,"_has-card-svg-mask":()=>fp.nU,"_has-drop-shadow":()=>fp.jw,"_is-read":()=>fp.B6,_mode_list:()=>fp.a1,"_ugc-cell":()=>fp.m7,"align-center":()=>fp.Yb,"align-left":()=>fp.s$,"align-right":()=>fp.FU,"card-overlay-svg-mask":()=>fp.sr,clamp:()=>fp.qE,default:()=>yp,"favorite-images-wrapper":()=>fp._m,isTitleCardOutsideBottom:()=>fp.zL,isTitleCardOutsideTop:()=>fp.fT,"stories-slide":()=>fp.Iu,"stories-slide-image":()=>fp.aF,"stories-slide-image__image":()=>fp.nj,"stories-slide-image__wrap":()=>fp.eQ,"stories-slide-wrapper":()=>fp.uk,"stories-slide__content":()=>fp.p_,"stories-slide__inner":()=>fp.aI,"stories-slide__mask":()=>fp.aA,"stories-slide__title":()=>fp._d,"ugc-card-cell":()=>fp.W7,"video-loaded":()=>fp.oe});var t={};j.r(t),j.d(t,{"control-end":()=>bp.yt,"control-end_dir_rtl":()=>bp.Rh,"control-end_reach-end":()=>bp.SV,"control-icon":()=>bp.ED,"control-start":()=>bp.P0,"control-start_dir_rtl":()=>bp.w0,"control-start_reach-start":()=>bp.w2,default:()=>Sp,horizontal:()=>bp.xM,"stories-list-controls":()=>bp.uT,vertical:()=>bp.Vd});j(5016);var r=j(2883),i=j.n(r),s=j(46),a=j.n(s);class o extends s.EventEmitter{}var n=j(7315);function l(e){return e.replace(/\/$/,"")}function c(e){return e.replace(/^\//,"")}function d(e,t=new FormData,r){const i=e=>"object"!=typeof e||null===e||e instanceof Blob||e instanceof File,s=(e,r)=>{if(null!=e)if(i(e))((e,r)=>{r instanceof Blob||r instanceof File?t.append(e,r):t.append(e,String(r))})(r,e);else{if(Array.isArray(e)){const t=e.every(i);return void e.forEach((e,i)=>{s(e,t?`${r}[]`:`${r}[${i}]`)})}Object.entries(e).forEach(([e,t])=>{s(t,`${r}[${e}]`)})}};return Object.entries(e).forEach(([e,t])=>{s(t,r?`${r}[${e}]`:e)}),t}class h extends Error{constructor(e,t,r){super(t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"networkStatus",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"networkMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="IasNetworkError",this.networkStatus=e,this.networkMessage=t,this.response=null!=r?r:null}static createByRequestError(e){return new h(null,JSON.stringify(e.data),e)}static createByFetchError(e){const t=window.navigator&&window.navigator.onLine;return new h(null,t?"AbortError"===e.name?"The operation was aborted by the AbortController signal. Make sure you don't destroy the InAppStoryManager while it's running.":e.message:"net::ERR_INTERNET_DISCONNECTED")}}function u(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}class p{constructor(){Object.defineProperty(this,"textArea",{enumerable:!0,configurable:!0,writable:!0,value:null})}async copy(e){try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(e):this.copyLegacy(e)}catch(t){this.copyLegacy(e)}}isIOS(){return/ipad|iphone/i.test(navigator.userAgent)}createTextArea(e){this.textArea=document.createElement("textarea"),this.textArea.value=e,document.body.appendChild(this.textArea)}selectText(){if(this.textArea)if(this.isIOS()){const e=document.createRange();e.selectNodeContents(this.textArea);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e)),this.textArea.setSelectionRange(0,999999)}else this.textArea.select()}copyLegacy(e){this.createTextArea(e),this.selectText();try{document.execCommand("copy")}catch(e){console.error("Copy failed:",e)}this.textArea&&(document.body.removeChild(this.textArea),this.textArea=null)}}let g;g=function(){};var f=j(5314);function m(e){return class extends e{constructor(...e){super(...e),Object.defineProperty(this,"_mobxReaction",{enumerable:!0,configurable:!0,writable:!0,value:null})}update(e){this._mobxReaction?this._mobxReaction.track(()=>{super.update(e)}):super.update(e)}connectedCallback(){super.connectedCallback(),this._mobxReaction||(this._mobxReaction=new f.Reaction(`${this.constructor.name||this.nodeName}.update()`,()=>this.requestUpdate())),this.hasUpdated&&this.requestUpdate()}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._mobxReaction)||void 0===e||e.dispose(),this._mobxReaction=null}}}function y(e,t){let r=null;return async function(...t){return r||(r=(async()=>{try{return await e.apply(this,t)}catch(e){throw e}finally{r=null}})(),r)}}function v(e,t){let r=null,i=null;return async function(...t){const s=JSON.stringify(t);if(r===s)return i;try{return i=await e.apply(this,t),r=s,i}catch(e){throw i=null,r=null,e}}}function b(e){return function(t,r){const i=t=>{customElements.get(e)?console.warn(`[IAS] Element "${e}" is already registered. Skipping re-definition`):customElements.define(e,t)};return r&&"function"==typeof r.addInitializer?r.addInitializer(()=>i(t)):i(t),t}}const w=/[\r\n%#()<>?[\\\]^`{|}]/g;function S(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(w,encodeURIComponent)}const _=e=>{const t=/^[\p{L}_\d][\p{L}_\d\-]{0,49}$/u;return e.filter(e=>{const r=t.test(e);return r||console.error(`[IAS]: The tag <${e}> does not match the regular expression <${t.toString()}>`),r})},O=e=>{const t=document.createElement("input");t.setAttribute("type","text"),t.style.position="absolute",t.style.opacity="0.1001",t.style.height="0",t.style.fontSize="16px",t.readOnly=!0,document.body.prepend(t),t.focus();return setTimeout(()=>{e.focus(),t.remove()},300)},k=()=>null!==j.nc&&void 0!==j.nc?j.nc:"";function x(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),()=>r)}const C=["InternalPrimaryFont","InternalSecondaryFont"];function P(e,t){if(!t)return e;let r=e;for(const e of C)r=x(r,e,`${t}${e}`);return r}const I=!!(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}}),r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch(e){}return e})()&&{passive:!0};var T=j(5824),A=j.n(T);const M=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();function L(e){let t=null;if(M){let r=window.localStorage.getItem(e);null!==r&&A()(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}function R(e,t){M&&window.localStorage.setItem(e,JSON.stringify(t))}function B(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}function D(e){return e.map(e=>function(e){var t,r,i;if(!e.url)return null;let s={"font-family":null!==(t=e.family)&&void 0!==t?t:"normal",src:`url('${B(String(e.url))}')`,"font-style":null!==(r=e.style)&&void 0!==r?r:"normal","font-weight":null!==(i=e.weight)&&void 0!==i?i:"normal"};e.title&&(s.src+=`, local('${e.title}')`);return`@font-face {${a=s,Object.keys(a).reduce((e,t)=>e+t.split(/(?=[A-Z])/).join("-").toLowerCase()+":"+a[t]+";","")}}\n`;var a}(e)).filter(Boolean).join("")}function N(e){"fonts"in document?e.forEach(e=>{const t=new FontFace(e.family,`url(${e.url})`,{style:e.style,weight:e.weight,display:"block"});document.fonts.add&&document.fonts.add(t),t.load()}):function(e){const t=D(e);if(null!=t){const e="stories-font-style";let r=document.getElementById(e);null===r?(r=document.createElement("style"),r.type="text/css",r.id=e,r.attributes.setNamedItem(document.createAttribute("scoped")),r.setAttribute("nonce",k()),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t)),document.body.appendChild(r)):r.styleSheet?r.styleSheet.cssText=t:(r.textContent="",r.appendChild(document.createTextNode(t)))}}(e)}let F=null;async function U(){return null!=F?F:new Promise(e=>{!function(e,t){const r=new Image;r.onload=function(){var i=r.width>0&&r.height>0;t(e,i)},r.onerror=function(){t(e,!1)},r.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"}[e]}("lossy",(t,r)=>{F=r,e(r)})})}function G(){if(window){var e,t=window.screen;return e="function"==typeof window.ScreenOrientation&&t.orientation instanceof ScreenOrientation&&"function"==typeof t.orientation.addEventListener&&null===t.orientation.onchange&&"string"==typeof t.orientation.type?t.orientation:function(){var e={90:V.LANDSCAPE_PRIMARY,"-90":V.LANDSCAPE_SECONDARY,0:V.PORTRAIT_PRIMARY,180:V.PORTRAIT_SECONDARY};function t(){}var r=new t,i=function(e){for(var t=["orientationchange","mozorientationchange","msorientationchange"],r=window.screen,i=0;i<t.length;i++)if(null===r["on"+t[i]])return{delegate:r,event:t[i]};if(void 0!==window.onorientationchange)return{delegate:window,event:"orientationchange"};return{delegate:J(e),event:"change"}}(r);return t.prototype.addEventListener=z("addEventListener",i.delegate,i.event),t.prototype.dispatchEvent=z("dispatchEvent",i.delegate,i.event),t.prototype.removeEventListener=z("removeEventListener",i.delegate,i.event),t.prototype.lock=function(){var e,t="lockOrientation() is not available on this device.",r=window.screen;e=void 0===r?function(){return!1}:"function"==typeof r.msLockOrientation?r.msLockOrientation.bind(r):"function"==typeof r.mozLockOrientation?r.mozLockOrientation.bind(r):function(){return!1};return function(r){const i=window.Promise;return e(r)?i.resolve(r):i.reject(new Error(t))}}(),t.prototype.unlock=function(){var e=window.screen;return e&&e.orientation&&e.orientation.unlock.bind(e.orientation)||e.msUnlockOrientation&&e.msUnlockOrientation.bind(e)||e.mozUnlockOrientation&&e.mozUnlockOrientation.bind(e)||function(){}}(),Object.defineProperties(r,{onchange:{get:function(){return i.delegate["on"+i.event]||null},set:function(e){i.delegate["on"+i.event]=H(e,r)}},type:{get:function(){var t=window.screen;return t.msOrientation||t.mozOrientation||e[window.orientation+""]||(K().matches?"landscape-primary":"portrait-primary")}},angle:{value:0}}),r}(),e}}var V;function z(e,t,r){var i=this;return function(){var s=Array.prototype.slice.call(arguments);if("change"===(s[0].type?s[0].type:s[0])){s[0].type?s[0]=q(r,s[0]):s[0]=r;var a,o,n=H(s[1],i);return"addEventListener"===e&&function(e,t){var r=$.indexOf(e);r>-1?W[r]=t:($.push(e),W.push(t))}(s[1],n),"removeEventListener"===e&&(a=s[1],(o=$.indexOf(a))>-1&&($.splice(o,1),W.splice(o,1))),s[1]=n,t[e].apply(t,s)}}}!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(V||(V={}));var W=[],$=[];function H(e,t){var r=$.indexOf(e);return r>-1?W[r]:function(r){r.target!==t&&Z(r,"target",t),r.currentTarget!==t&&Z(r,"currentTarget",t),"change"!==r.type&&Z(r,"type","change"),e(r)}}function q(e,t){var r;try{r=new Event(e,t)}catch(e){r={type:"change"}}return r}function J(e){var t=Object.create({addEventListener:function(e,t){this.listeners[e]||(this.listeners[e]=[]),-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)},dispatchEvent:function(t){this.listeners[t.type]&&(this.listeners[t.type].forEach(function(e){e(t)}),"function"==typeof e.onchange&&e.onchange(t))},removeEventListener:function(e,t){if(this.listeners[e]){var r=this.listeners[e].indexOf(t);r>-1&&this.listeners[e].splice(r,1)}}});t.listeners={};var r=K();return r&&"boolean"==typeof r.matches&&r.addListener(function(){t.dispatchEvent(q("change"))}),t}function K(){return"function"!=typeof window.matchMedia?{}:window.matchMedia("(orientation: landscape)")}function Z(e,t,r){Object.defineProperty(e,t,{value:r})}var Q=j(122);const Y="mobile"!==j.n(Q)().getParser(window.navigator.userAgent).parse().getPlatformType();function X(e){if("string"!=typeof e)return null;if(!e.trim())return null;try{const t=JSON.parse(e);return null!=t?t:null}catch(e){return null}}const ee=new class{constructor(){Object.defineProperty(this,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_platform",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const e=this.loadOrCreateDeviceData();this._deviceId=e.device_id,this._platform=e.platform}get deviceId(){return this._deviceId}get platform(){return this._platform}loadOrCreateDeviceData(){const e=L("device_data");if(this.isValidDeviceData(e))return e;const t={platform:"web",device_id:(0,n.v4)()};return R("device_data",t),t}isValidDeviceData(e){return Boolean(e&&"string"==typeof e.device_id&&36===e.device_id.trim().length)}};class te{constructor(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1}async run(e){let t=Promise.resolve(e);for(const e of this.handlers)t=t.then(e.fulfilled,e.rejected);return t}}class re extends Error{constructor(e){super(`The request with URL <${e}> was aborted. Make sure you don't destroy the InAppStoryManager while it's running.`),this.name="IasAbortRequestError"}}class ie extends Error{constructor(){super("[IAS] Make sure you don't destroy the InAppStoryManager while it's running and pass the config before using the InAppStoryManager API."),this.name="IasConfigReferenceError"}}class se{async open(e){const t=await this.getOpenSessionPayload(e);return(await ra.post("session/open",t,{params:{expand:"cache",fields:"session,server_timestamp,user_key,share,preview_aspect_ratio,placeholders,image_placeholders,is_allow_ugc,is_allow_statistic_v2,is_game_reader_default_fullscreen"},meta:{public:!0}})).data}async getOpenSessionPayload(e){const t=await U(),r={platform:ee.platform,features:"animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder,vod,closeStoryApi,slideTimerEndApi,multislideIam,scrollview"};return e.anonymous&&(r.anonymous=e.anonymous),e.anonymous||(r.device_id=ee.deviceId),e.userId&&!e.anonymous&&(r.user_id=e.userId,r.user_sign=e.userIdSign),t&&(r.features+=",webp"),r}}var ae;!function(e){e.TEXT="text",e.IMAGE="image"}(ae||(ae={}));class oe{constructor(e,t,r,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"priority",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class ne extends oe{constructor(e,t){super(ae.IMAGE,e,t,0)}}class le extends oe{constructor(e,t){super(ae.TEXT,e,t,2)}}class ce extends oe{constructor(e,t){super(ae.IMAGE,e,t,1)}}class de extends oe{constructor(e,t){super(ae.TEXT,e,t,3)}}const he="default";class ue{get textPlaceholders(){return this._textPlaceholders}get imagePlaceholders(){return this._imagePlaceholders}constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"sessionStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_textPlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_imagePlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expireIn",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"share",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"previewAspectRatio",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"resources",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"isAllowStatisticV2",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontsResources",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"isGameReaderDefaultFullscreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=r.session.id,this.expireIn=r.session.expire_in,this.userKey=r.user_key||he,this.previewAspectRatio=r.preview_aspect_ratio,this.share=r.share,this.resources=this.getResources(r),this.fontsResources=this.applyFontPrefix(this.resources.filter(e=>"font-face"===e.type)),this._textPlaceholders=this.mapTextPlaceholders(r.placeholders),this._imagePlaceholders=this.mapImagePlaceholders(r.image_placeholders),this.isAllowStatisticV2=Boolean(r.is_allow_statistic_v2),this.isGameReaderDefaultFullscreen=Boolean(r.is_game_reader_default_fullscreen)}loadResources(){N(this.fontsResources)}getAllFontFamilies(){return[...new Set(this.fontsResources.map(e=>e.family))]}applyFontPrefix(e){return e.map(e=>Object.assign(Object.assign({},e),{family:`${this.storyManager.config.fontPrefix}${e.family}`}))}getResources(e){return e.cache&&Array.isArray(e.cache)?e.cache:[]}mapTextPlaceholders(e){return e.map(e=>new le(e.name,e.default_value))}mapImagePlaceholders(e){return e.map(e=>new ne(e.name,e.default_value))}}class pe extends Error{constructor(e){super(`Story with ID ${e} has already been shown to the user`),this.name="IasStoryAlreadyShownError"}}class ge extends Error{constructor(e){super(`Like undefined on story with ID ${e}`),this.name="IasLikeUndefinedError"}}class fe extends Error{constructor(e){super(`Share url undefined on story with ID ${e}`),this.name="IasShareUrlUndefinedError"}}var me,ye=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ve=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},be=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},we=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.UGC=1]="UGC",e[e.FAVORITE=2]="FAVORITE",e[e.ONBOARDING=3]="ONBOARDING"}(me||(me={}));let Se=(()=>{var e,t;let r,i,s,a=[],o=[],n=[];return e=class{get _stories(){return be(this,t,"f")}set _stories(e){we(this,t,e,"f")}constructor(e,r,i){var s;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:ye(this,a)}),Object.defineProperty(this,"slug",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasFavorite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cover",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:me.DEFAULT}),t.set(this,ye(this,o,f.observable.array())),ye(this,n),this.id=e.id,this.slug=e.feedSlug,this.hasFavorite=Boolean(e.hasFavorite),this._cover=qe.createByRawData(null!==(s=e.cover)&&void 0!==s?s:{}),this._stories=r}get stories(){return this._stories}get type(){return this._type}get cover(){return this._cover}get coverSrc(){var e;const t=null===(e=this._cover)||void 0===e?void 0:e.findOneByType("h");return null==t?void 0:t.url}removeById(e){const t=this._stories.findIndex(t=>t.id===e);-1!==t&&(0,f.remove)(this._stories,t.toString())}unshiftStory(e){-1===this._stories.indexOf(e)&&this._stories.unshift(e)}getStoryById(e){return this.stories.find(t=>t.id===e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.action],s=[f.action],ve(e,null,r,{kind:"accessor",name:"_stories",static:!1,private:!1,access:{has:e=>"_stories"in e,get:e=>e._stories,set:(e,t)=>{e._stories=t}},metadata:t},o,n),ve(e,null,i,{kind:"method",name:"removeById",static:!1,private:!1,access:{has:e=>"removeById"in e,get:e=>e.removeById},metadata:t},null,a),ve(e,null,s,{kind:"method",name:"unshiftStory",static:!1,private:!1,access:{has:e=>"unshiftStory"in e,get:e=>e.unshiftStory},metadata:t},null,a),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const _e="{{__favorite__}}";class Oe extends Se{constructor(e,t){super(e,t),this._type=me.FAVORITE}static createByStories(e){return new Oe({feedSlug:_e},e)}}var ke=j(6099),xe=j.n(ke);class Ce extends Se{constructor(e,t,r){super(e,t),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"limit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._type=me.ONBOARDING,this.tags=r.tags,this.limit=r.limit,this.filterOpenedStories()}static getDefaultSlug(){return"onboarding"}isEqualParams(e){return xe()(this.tags,e.tags)&&this.limit===e.limit}filterOpenedStories(){this._stories=this._stories.filter(e=>!e.isOpened)}}const Pe="{{__ugc__}}";class je extends Se{constructor(e,t,r={}){super(e,t),Object.defineProperty(this,"_filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._type=me.UGC,this._filter=r.filter}get filter(){var e;return null!==(e=this._filter)&&void 0!==e?e:null}static createByStories(e,t={}){return new je({feedSlug:Pe},e,t)}}var Ee=j(1580),Ie=j.n(Ee);class Te{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV1Api",{enumerable:!0,configurable:!0,writable:!0,value:t})}sendCoverageEvent(e,t){if(0===e.length)return;const r=e.map(e=>e.id);t.type===me.DEFAULT&&this.sendCoverageStatistic(r),this.emitFeedImpressionEvent(e,t)}sendDeeplinkClickEvent(e){this.sendStatisticData([1,0,e,0,0])}emitFeedImpressionEvent(e,t){const r={stories:e.map(e=>this.createEventPayloadByStory(e,t)),feed:t.type===me.DEFAULT?t.slug:null};this.storyManager.emit("feedImpression",r)}sendCoverageStatistic(e){this.sendStatisticData([5,0,...e])}createEventPayloadByStory(e,t){const r={id:e.id,title:e.statTitle,slidesCount:e.slidesCount};return t.type===me.UGC&&(r.ugcPayload=Ie()(e.ugcPayload)?e.ugcPayload:{}),r}async sendStatisticData(e){try{if(this.storyManager.isStatisticsDisabled)return;await this.statisticV1Api.sendStatisticEvent({data:[e]})}catch(e){console.error(e)}}}class Ae{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchStorySlides({id:e,feedSlug:t}){const{url:r,params:i}=this.getStoryRequestConfig(e,t);return(await ra.get(r,{params:i})).data}async fetchStory({id:e,feedSlug:t,fetchShareUrl:r,once:i}){const{url:s,params:a}=this.getStoryRequestConfig(e,t,!0,r,i),o=await ra.get(s,{params:a});if(204===o.status&&i)throw new pe(e.toString());return o.data}async fetchStoryContext({ids:e}){const{url:t,params:r}=this.getStoryContextRequestConfig(e);return(await ra.get(t,{params:r})).data}async fetchStoryCSS(){var e;const{url:t,params:r}=this.getStoryCSSRequestConfig();return null!==(e=(await ra.get(t,{params:r})).data.style)&&void 0!==e?e:""}async setStoryLike(e,t){if(this.storyManager.isStatisticsDisabled)return t;const r=await ra.post(`story-like/${e}`,{value:t});if(null==r.data.like)throw new ge(e);return r.data.like}async setStoryBookmark(e,t){if(this.storyManager.isStatisticsDisabled)return t;return(await ra.post(`story-favorite/${e}`,{value:t})).data.favorite}markStoryAsOpened(e,t){const r=`u/${e}/s_opened`;let i=L(r);Array.isArray(i)||(i=[]);const s=new Set(i);s.add(t),i=Array.from(s),R(r,i)}async fetchStorySharePath(e){const t=await ra.get(`story-share/${e}`);if(!t.data.url)throw new fe(e);return t.data.url}async updateNarrativeData(e,t){if(!this.storyManager.isStatisticsDisabled)return ra.request({url:"story-data/"+e,method:"put",data:{data:t}})}getStoryRequestConfig(e,t,r=!1,i,s){const a=["slides"];i&&a.push("share_url");const o={url:`${t===Pe?"ugc/":""}story/${e}`,method:"GET",params:{expand:a.join(",")}};return o.params.once=Number(Boolean(s)),r||null!=o.params&&(o.params.fields=["id","slides"].join(",")),o}getStoryCSSRequestConfig(){return{url:"story-context",method:"GET",params:{fields:"style"}}}getStoryContextRequestConfig(e){return{url:"story-context",method:"GET",params:{id:e.join(","),fields:"widgetsData"}}}}class Me{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcFeed({filter:e,tags:t,testKey:r,options:i}){const s={tags:t.join(","),test:r,f:e&&JSON.stringify(e),options:i};return(await ra.get("ugc/feed",{params:s})).data}async fetchDefaultFeed({feedSlug:e,tags:t,testKey:r,options:i}){const s=`feed/${e}`,a=await ra.post(s,{tags:t.join(","),options:i},{params:{test:r}});return a.data.feedSlug=e,a.data}async fetchFavoriteFeed({tags:e}){return(await ra.get("story",{params:{tags:e.join(","),favorite:1}})).data}async fetchOnboardingFeed(e){const t=`feed/${e.feedSlug}/onboarding`,r=await ra.post(t,{tags:e.tags.join(","),options:e.options},{params:{limit:e.limit}});return r.data.feedSlug=e.feedSlug,r.data}}class Le{async sendStatisticEvent(e){await ra.sendBeacon("session/update",{data:e.data})}}class Re{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendStatisticEvent(e,t=!1){try{if(!this.isAllowStatisticV2(t))return;const r=this.getParamsByEvent(e),i=`stat/${e.type}`;"sendBeacon"in navigator?this.sendBeacon(i,r):await this.sendFallbackFetch(i,r)}catch(e){console.error(e)}}getParamsByEvent(e){var t;const r=null===(t=this.storyManager.rootStore.sessionStore.session)||void 0===t?void 0:t.id,i=this.storyManager.config.userId.toString(),s=Date.now();return Object.assign(Object.assign({},e.toQueryParams()),{x_user_agent:this.storyManager.userAgent,s:r,u:i,ts:s})}isAllowStatisticV2(e){var t;if(this.storyManager.config.anonymous)return!1;const r=e||Boolean(null===(t=this.storyManager.rootStore.sessionStore.session)||void 0===t?void 0:t.isAllowStatisticV2);return!(this.storyManager.isStatisticsDisabled||!r)}sendBeacon(e,t){t=new URLSearchParams(t);const r=`${l(ii.apiUrl)}/${c(e)}?${t.toString()}`;navigator.sendBeacon(r)}async sendFallbackFetch(e,t){const r=new ea({baseURL:ii.apiUrl});await r.get(e,{params:t})}}var Be,De,Ne,Fe,Ue,Ge,Ve;!function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Be||(Be={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(De||(De={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(Ne||(Ne={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(Fe||(Fe={})),function(e){e.Medium="medium",e.High="high"}(Ue||(Ue={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(Ge||(Ge={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(Ve||(Ve={}));const ze={direction:Ge.ROW,card:{title:{font:'16px system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',padding:10.6,textAlign:Ne.START,position:Fe.CARD_INSIDE_BOTTOM,display:!0,lineClamp:4},gap:10,height:178,aspectRatio:null,coverQuality:Ue.High,variant:De.RECTANGLE,border:{radius:21,color:"black",width:2,gap:5},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null,opened:{border:{radius:null,color:null,width:null,gap:null,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null},coverLazyLoading:!1},favoriteCard:{title:{content:"Favorite",font:"normal",color:"white",padding:15,textAlign:Ne.START,position:Fe.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:Ue.High,coverLazyLoading:!1,variant:De.CIRCLE,border:{radius:0,color:"black",width:2,gap:3,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null,opened:{border:{radius:null,color:null,width:null,gap:null,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null}},sidePadding:20,topPadding:20,bottomPadding:20,bottomMargin:17,layout:{height:"auto",backgroundColor:"transparent",sliderAlign:Be.START},navigation:{speed:300,showControls:!1,controlsSize:48,controlsBackgroundColor:"white",controlsColor:"black"},autoScrollOnStoryClose:!0,ugcCard:{title:{content:null,font:'16px system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',color:"#000",padding:15,textAlign:Ne.START,position:Fe.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:Ue.High,coverLazyLoading:!1,variant:De.CIRCLE,border:{radius:0,color:"transparent",width:0,gap:0,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null,image:{svgSrc:{baseState:'<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M50 85.5C69.6061 85.5 85.5 69.6061 85.5 50C85.5 30.3939 69.6061 14.5 50 14.5C30.3939 14.5 14.5 30.3939 14.5 50C14.5 69.6061 30.3939 85.5 50 85.5Z" stroke="white" stroke-width="2"/>\n<path d="M50.5 34.5V65.5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M34.5 49.5H65.5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n'}},backgroundColor:"#0c62f3"}};var We=j(4977),$e=j.n(We);class He{constructor(e){Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.width=e.width,this.height=e.height,this.type=e.type,this.url=this.changeUrlProtocol(e.url)}changeUrlProtocol(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}}class qe{constructor(){Object.defineProperty(this,"images",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"gradient",{enumerable:!0,configurable:!0,writable:!0,value:!1})}static createByRawData(e){const t=new qe;for(let r in e)e.hasOwnProperty(r)&&t.images.push(new He(e[r]));return t}findOneByType(e){var t;return null!==(t=this.images.find(t=>t.type===e))&&void 0!==t?t:null}findOneByCoverQuality(e){return this.findOneByType(this.mapCoverQualityToImageType(e))}findOneByWidth(e,t=!1){var r;let i=null;return this.images.forEach(t=>{t.width===e&&(i=t)}),null!==i?i:(i=null!==(r=$e()(this.images))&&void 0!==r?r:null,t&&null!=i?i:null)}mapCoverQualityToImageType(e){switch(e){case Ue.Medium:return"m";case Ue.High:return"h"}}}var Je=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ke=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ze=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Qe=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Ye=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _html(){return Ze(this,t,"f")}set _html(e){Qe(this,t,e,"f")}get html(){return this._html}constructor(e){var r,i;Object.defineProperty(this,"_rawHtml",{enumerable:!0,configurable:!0,writable:!0,value:(Je(this,s),"")}),t.set(this,Je(this,a,"")),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:Je(this,o)}),Object.defineProperty(this,"timeline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"screenshotShare",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"eventPayload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resources",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resourcesByBlob",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.index=e.index,this.timeline={foreground:e.timeline.foreground,background:e.timeline.background},this.duration=e.duration,this.screenshotShare=e.screenshot_share,this.eventPayload=e.event_payload,this.resources=null!==(i=null===(r=e.resources)||void 0===r?void 0:r.map(e=>({type:e.type,key:e.key,url:e.url,rangeStart:e.range_start,rangeEnd:e.range_end,contentType:e.content_type})))&&void 0!==i?i:[],this._rawHtml=this.replaceSlideNonce(e.html),this._html=this._rawHtml}static createEmpty(){return new e({index:0,timeline:{foreground:"",background:""},duration:0,screenshot_share:!1,html:""})}applyFontPrefix(e){this._rawHtml=P(this._rawHtml,e),this._html=this._rawHtml}updatePlaceholders(e){let t=this._rawHtml;for(const r of e)t=x(t,`%${r.key}%`,r.value);this._html=t}applyBlobUrls(e,t){var r;let i=this._html;for(const s of e){const e=null===(r=t[s])||void 0===r?void 0:r.blobUrl;e&&(i=x(i,s,e),this._resourcesByBlob[s]=e)}this._html=i}restoreOriginalResourceUrls(){let e=this._html;for(const[t,r]of Object.entries(this._resourcesByBlob))e=x(e,r,t);this._html=e}parseResources(){const e=Array.from(this._html.matchAll(/src="([^"]+)"/gi),e=>e[1]).filter(e=>!e.startsWith("blob:"));return Array.from(new Set(e))}replaceSlideNonce(e){var t;return x(e,"{{nonce}}",null!==(t=k())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.computed],Ke(e,null,r,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},a,o),Ke(e,null,i,{kind:"getter",name:"html",static:!1,private:!1,access:{has:e=>"html"in e,get:e=>e.html},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Xe{constructor(e,t){var r;Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.widgetsData=this.mapStoryContextDto(e,t),this.style=null!==(r=t.style)&&void 0!==r?r:""}mapStoryContextDto(e,t){var r;const i={},s=null!==(r=t.widgetsData)&&void 0!==r?r:{};for(const t in s)Array.isArray(s[t])||(i[t]=s[t][e]);return i}updateNarrativeData(e){this.widgetsData._narrative_saved_data=e}}var et=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},tt=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},rt=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},it=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let st=(()=>{var e,t,r,i,s,a,o,n,l,c,d;let h,u,p,g,m,y,v,b,w,S,_,O,k=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[],V=[],z=[],W=[],$=[];return e=class{get _slidesLoaded(){return rt(this,t,"f")}set _slidesLoaded(e){it(this,t,e,"f")}get _error(){return rt(this,r,"f")}set _error(e){it(this,r,e,"f")}get _context(){return rt(this,i,"f")}set _context(e){it(this,i,e,"f")}get _like(){return rt(this,s,"f")}set _like(e){it(this,s,e,"f")}get _favorite(){return rt(this,a,"f")}set _favorite(e){it(this,a,e,"f")}get _shareUrl(){return rt(this,o,"f")}set _shareUrl(e){it(this,o,e,"f")}get _slides(){return rt(this,n,"f")}set _slides(e){it(this,n,e,"f")}get _isOpened(){return rt(this,l,"f")}set _isOpened(e){it(this,l,e,"f")}get _canBeShown(){return rt(this,c,"f")}set _canBeShown(e){it(this,c,e,"f")}get _title(){return rt(this,d,"f")}set _title(e){it(this,d,e,"f")}constructor(e){var h,u,p,g,f,m,y,v,b,w,S,_,O,x,H,q,J,K,Z,Q,Y,X,ee;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:et(this,k)}),Object.defineProperty(this,"stringId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"statTitle",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"titleColor",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:{color:"",gradient:!1}}),Object.defineProperty(this,"backgroundColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slidesCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"source",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"deeplink",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInReader",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"disableClose",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"likeFunctional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"favoriteFunctional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shareFunctional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"needPlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"gameInstance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideTimeline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasAudio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasPlaceholder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasSwipeUp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ugcPayload",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_rawTitle",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parsedSlideImage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_videoCoverSrc",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_videoCover",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_wasShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t.set(this,et(this,C,!1)),r.set(this,(et(this,P),et(this,j,null))),i.set(this,(et(this,E),et(this,I,void 0))),s.set(this,(et(this,T),et(this,A,0))),a.set(this,(et(this,M),et(this,L,!1))),o.set(this,(et(this,R),et(this,B,null))),n.set(this,(et(this,D),et(this,N,[]))),l.set(this,(et(this,F),et(this,U,!1))),c.set(this,(et(this,G),et(this,V,!1))),d.set(this,(et(this,z),et(this,W,void 0))),et(this,$),this.id=e.id,this._context=new Xe(this.id,{style:"",widgetsData:{}}),this._rawTitle=null!==(h=e.title)&&void 0!==h?h:"",this._title=this._rawTitle,this._isOpened=null!==(u=e.is_opened)&&void 0!==u&&u,this.statTitle=null!==(p=e.stat_title)&&void 0!==p?p:"",this.titleColor=null!==(g=e.title_color)&&void 0!==g?g:"",this.background=null!==(f=e.background)&&void 0!==f?f:{},this.backgroundColor=null!==(m=e.background_color)&&void 0!==m?m:"",this.slidesCount=null!==(y=e.slides_count)&&void 0!==y?y:0,this.disableClose=null!==(v=e.disable_close)&&void 0!==v&&v,this.hideInReader=null!==(b=e.hide_in_reader)&&void 0!==b&&b,this.likeFunctional=null!==(w=e.like_functional)&&void 0!==w&&w,this.favoriteFunctional=null!==(S=e.favorite_functional)&&void 0!==S&&S,this.shareFunctional=null!==(_=e.share_functional)&&void 0!==_&&_,this.needPlaceholders=null!==(O=e.need_placeholders)&&void 0!==O&&O,this.gameInstance=e.game_instance,this.hasAudio=null!==(x=e.has_audio)&&void 0!==x&&x,this.hasSwipeUp=null!==(H=e.has_swipe_up)&&void 0!==H&&H,this.stringId=null!==(q=e.string_id)&&void 0!==q?q:"",this._like=null!==(J=e.like)&&void 0!==J?J:0,this._favorite=null!==(K=e.favorite)&&void 0!==K&&K,this.deeplink=null!==(Z=e.deeplink)&&void 0!==Z?Z:"",this.hideTimeline=null!==(Q=e.hide_timeline)&&void 0!==Q&&Q,this.ugcPayload=null!==(Y=e.payload)&&void 0!==Y?Y:{},this._shareUrl=null!==(X=e.share_url)&&void 0!==X?X:null,this._image=qe.createByRawData(e.image),this._videoCover=qe.createByRawData(e.video_cover);const te=null!==(ee=e.slides)&&void 0!==ee?ee:[];this.setSlides(te)}get like(){return this._like}get favorite(){return this._favorite}get isOpened(){return this._isOpened}get shareUrl(){return this._shareUrl}get title(){return this._title}get slidesLoaded(){return this._slidesLoaded}get canBeShown(){return this._canBeShown}get error(){return this._error}get slides(){return this._slides}get context(){return this._context}get image(){return this._image}get wasShown(){return this._wasShown}get videoCover(){return this._videoCover}get videoCoverSrc(){if(!1===this._videoCoverSrc)return null;if(null===this._videoCoverSrc){const e=this.videoCover;if(null===e)return this._videoCoverSrc=!1,null;const t=e.findOneByType("h");if(null!==t)return t.url}return"string"==typeof this._videoCoverSrc?this._videoCoverSrc:null}setSlides(e){!this._slidesLoaded&&e.length&&(this._slides=this.mapSlidesByDto(e),this._slidesLoaded=!0)}setCanBeShown(e){this._canBeShown=e}setError(e){this._error=e}setContext(e){this._context=e}setLike(e){this._like=e}setFavorite(e){this._favorite=e}markIsOpened(){this.markWasShown(),this._isOpened=!0}markWasShown(){this._wasShown=!0}setShareUrl(e){this._shareUrl=e}applyFontPrefix(e){for(const t of this.slides)t.applyFontPrefix(e)}updatePlaceholders(e){this.needPlaceholders&&(this.updateSlidesPlaceholders(e),this.updateTitlePlaceholders(e))}updateSlidesPlaceholders(e){for(const t of this.slides)t.updatePlaceholders(e)}updateTitlePlaceholders(e){let t=this._rawTitle;for(const r of e)t=x(t,`%${r.key}%`,r.value);this._title=t}mapSlidesByDto(e){return e.map(e=>new Ye(e))}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;h=[f.observable],u=[f.observable],p=[f.observable],g=[f.observable],m=[f.observable],y=[f.observable],v=[f.observable],b=[f.observable],w=[f.observable],S=[f.observable],_=[f.action],O=[f.action],tt(e,null,h,{kind:"accessor",name:"_slidesLoaded",static:!1,private:!1,access:{has:e=>"_slidesLoaded"in e,get:e=>e._slidesLoaded,set:(e,t)=>{e._slidesLoaded=t}},metadata:t},C,P),tt(e,null,u,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:t},j,E),tt(e,null,p,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},I,T),tt(e,null,g,{kind:"accessor",name:"_like",static:!1,private:!1,access:{has:e=>"_like"in e,get:e=>e._like,set:(e,t)=>{e._like=t}},metadata:t},A,M),tt(e,null,m,{kind:"accessor",name:"_favorite",static:!1,private:!1,access:{has:e=>"_favorite"in e,get:e=>e._favorite,set:(e,t)=>{e._favorite=t}},metadata:t},L,R),tt(e,null,y,{kind:"accessor",name:"_shareUrl",static:!1,private:!1,access:{has:e=>"_shareUrl"in e,get:e=>e._shareUrl,set:(e,t)=>{e._shareUrl=t}},metadata:t},B,D),tt(e,null,v,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},N,F),tt(e,null,b,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:t},U,G),tt(e,null,w,{kind:"accessor",name:"_canBeShown",static:!1,private:!1,access:{has:e=>"_canBeShown"in e,get:e=>e._canBeShown,set:(e,t)=>{e._canBeShown=t}},metadata:t},V,z),tt(e,null,S,{kind:"accessor",name:"_title",static:!1,private:!1,access:{has:e=>"_title"in e,get:e=>e._title,set:(e,t)=>{e._title=t}},metadata:t},W,$),tt(e,null,_,{kind:"method",name:"setSlides",static:!1,private:!1,access:{has:e=>"setSlides"in e,get:e=>e.setSlides},metadata:t},null,k),tt(e,null,O,{kind:"method",name:"setCanBeShown",static:!1,private:!1,access:{has:e=>"setCanBeShown"in e,get:e=>e.setCanBeShown},metadata:t},null,k),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class at{constructor(e){Object.defineProperty(this,"storyId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activeSlideIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"feedSlug",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storyId=e.storyId,this.activeSlideIndex=e.activeSlideIndex,this.feedSlug=e.feedSlug}toQueryParams(){return{i:this.storyId,si:this.activeSlideIndex,f:this.feedSlug}}}var ot,nt;!function(e){e.Next="next",e.Prev="prev",e.SwipeClose="swipe-close",e.ButtonClose="button-close",e.CustomClose="custom-close",e.AutoClose="auto-close",e.AppClose="app-close"}(ot||(ot={}));class lt extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{c:this.payload.cause,st:this.payload.totalSlides,d:this.payload.durationMs})}}!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(nt||(nt={}));const ct={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:nt.END,loader:{default:{color:"white",accentColor:"transparent"},custom:null},closeButton:{svgSrc:{baseState:'<svg width="32" height="32" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.8309 10.0424C10.0969 9.77646 10.5281 9.77646 10.7941 10.0424L15 14.2483L19.2059 10.0424C19.4719 9.77646 19.9031 9.77646 20.1691 10.0424C20.4351 10.3084 20.4351 10.7397 20.1691 11.0057L15.9632 15.2115L20.1691 19.4174C20.4351 19.6834 20.4351 20.1147 20.1691 20.3807C19.9031 20.6466 19.4719 20.6466 19.2059 20.3807L15 16.1748L10.7941 20.3807C10.5281 20.6466 10.0969 20.6466 9.8309 20.3807C9.56492 20.1147 9.56492 19.6834 9.8309 19.4174L14.0368 15.2115L9.8309 11.0057C9.56492 10.7397 9.56492 10.3084 9.8309 10.0424Z" fill="currentColor"/>\n</svg>'}},forceDesktopMode:void 0};var dt;!function(e){e.Text="text",e.Link="link",e.Image="image"}(dt||(dt={}));const ht={label:"X",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="0 0 195 195" xmlns="http://www.w3.org/2000/svg">\n<g transform="matrix(.20227 0 0 .20302 -71 -26.7)">\n<circle cx="834.3" cy="610.6" r="481.3" stroke="#fff" strokeMiterlimit="10"/>\n<path d="m537.8 331.8 230 307.6-231.4 250.1h52.2l202.6-219 163.8 219h177.3l-243-324.9 215.5-232.8h-52l-187 201.7-150.7-201.7zm76.6 38.4h81.5l359.7 481h-81.5z" fill="#fff"/>\n</g>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://twitter.com/share?url=${e}&text=${t}`},ut={targets:["vk","ok","facebook","x","linkedin","telegram"],targetParams:{vk:{label:"VK",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">\n<circle cx="24" cy="24" r="21.3" fill="#fff"/>\n<path d="M22.3.7a23.3 23.3 0 0 0-5 45.6A23.4 23.4 0 0 0 30.7 1.7C28 .8 25.2.6 22.3.7Zm1.8 14.5c1.2.1 1.8.3 2 .6l.3.6c.2.4.2.8 0 4.3 0 2.2 0 2.9.2 3.4s.7.8 1.1.6a8 8 0 0 0 1.8-2 29 29 0 0 0 3-5.8c.3-.4.5-.7.8-.8h7.1a.7.7 0 0 1 .5.8c0 .7-.8 2.2-2 4a92.7 92.7 0 0 1-3.5 4.8c-.3.5-.2 1 .2 1.6l1.4 1.4c1.8 1.7 2.6 2.6 3.3 3.6.4.7.6 1.2.5 1.7 0 .2-.2.5-.5.6-.4.2-.9.2-3.7.3H34l-.5-.1c-1-.4-1.8-1-3.5-3-.9-1-1.6-1.5-2-1.5-.5 0-1 .6-1.3 1.3-.1.5-.2.8-.2 1.7-.1 1-.2 1.2-.8 1.5H22a9.5 9.5 0 0 1-4.2-1.4c-1.9-1.1-3-2.2-4.4-3.8a48.7 48.7 0 0 1-7.2-12.5c-.1-.5 0-.9.5-1l3-.1h3c.5.3.7.5 1 1.4L16 22c.5.9 1 1.6 1.5 2 .6.6.9.7 1.3.7.3 0 .4-.1.6-.6.5-1 .6-4.8.1-6.3-.2-.8-.6-1.1-1.7-1.3-.2 0-.2-.2 0-.4.4-.6 1.1-.9 2.6-1H24Z" fill="#45668E"/>\n</svg>'}},getUrl:({url:e,text:t})=>`https://vk.com/share.php?url=${e}&title=${t}`},facebook:{label:"Facebook",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="126.4 2.3 589 589" xmlns="http://www.w3.org/2000/svg">\n<circle cx="420.9" cy="296.8" r="294.5" fill="#3c5a9a"/>\n<path d="M516.7 92.7h-65.2c-38.8 0-81.8 16.3-81.8 72.4.2 19.5 0 38.3 0 59.3h-44.8v71.3h46.2V501h84.8V294.4h56l5-70.2h-62.4V184c0-22.2 23-21 24.4-21h37.8V92.8z" fill="#fff"/>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://www.facebook.com/sharer.php?u=${e}&t=${t}`},x:ht,twitter:ht,linkedin:{label:"LinkedIn",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" enableBackground="new 0 0 550 550" version="1.1" viewBox="0 0 550 550" xmlSpace="preserve" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">\n<circle cx="275" cy="275" r="256" fill="#04689B"/>\n<path d="m219.2 366.5h-38.8v-124.3h38.8v124.3zm-20.4-139.9h-0.3c-14.1 0-23.2-9.5-23.2-21.6 0-12.3 9.4-21.6 23.7-21.6s23.1 9.3 23.4 21.5c0.1 12.2-9 21.7-23.6 21.7zm175.8 139.9h-44v-64.3c0-16.8-6.9-28.3-22-28.3-11.6 0-18 7.7-21 15.2-1.1 2.7-0.9 6.4-0.9 10.2v67.3h-43.7s0.6-113.9 0-124.3h43.6v19.5c2.6-8.5 16.5-20.7 38.8-20.7 27.6 0 49.3 17.9 49.3 56.4v69z" fill="#fff"/>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://www.linkedin.com/sharing/share-offsite/?url=${e}&title=${t}`},telegram:{label:"Telegram",icon:{svgSrc:{baseState:'<svg data-v-05f1b0f5="" data-v-b5b60290="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50px" height="50px"><defs data-v-05f1b0f5=""><linearGradient data-v-05f1b0f5="" id="a" x1="120" y1="240" x2="120" gradientUnits="userSpaceOnUse"><stop data-v-05f1b0f5="" offset="0" stop-color="#1d93d2"></stop><stop data-v-05f1b0f5="" offset="1" stop-color="#38b0e3"></stop></linearGradient></defs><circle data-v-05f1b0f5="" cx="120" cy="120" r="120" fill="url(#a)"></circle><path data-v-05f1b0f5="" d="m81.2 128.8 14.3 39.4s1.7 3.7 3.7 3.7 30.2-29.5 30.2-29.5l31.5-61-79.2 37.2Z" fill="#c8daea"></path><path data-v-05f1b0f5="" d="m100.1 138.9-2.7 29s-1.2 9 7.7 0 17.4-15.7 17.4-15.7" fill="#a9c6d8"></path><path data-v-05f1b0f5="" d="m81.5 130.2-29.3-9.6s-3.5-1.4-2.4-4.6c.3-.7.7-1.2 2.1-2.2C58.4 109.3 172 68.4 172 68.4s3.2-1 5.1-.3a2.8 2.8 0 0 1 2 2 9.4 9.4 0 0 1 .2 2.6l-.2 2.6c-.7 11.1-21.4 94.4-21.4 94.4s-1.2 5-5.7 5a8.1 8.1 0 0 1-5.9-2.2 797.1 797.1 0 0 0-45.5-32.2 1.3 1.3 0 0 1-.5-.9c-.1-.4.4-1 .4-1s52.4-46.6 53.8-51.5c.1-.4-.3-.6-.8-.4C150 87.8 89.6 125.9 83 130a3.2 3.2 0 0 1-1.5 0Z" fill="#fff"></path></svg>\n'}},getUrl:({url:e,text:t})=>`https://t.me/share/url?url=${e}&text=${t}`},ok:{label:"OK",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="0 0 388.4 387.1" xmlSpace="preserve" xmlns="http://www.w3.org/2000/svg">\n<path d="M331.7 330.2a194.2 193.5 0 0 1-273.9 1.1 194.2 193.5 0 0 1-2.6-272.9A194.2 193.5 0 0 1 329 54.2a194.2 193.5 0 0 1 5.7 273" fill="#faab62" style="mixBlendMode:normal"/>\n<path d="m328.7 327.1a189.2 188.5 0 0 1-266.9 1.2 189.2 188.5 0 0 1-2.5-266 189.2 188.5 0 0 1 266.7-4 189.2 188.5 0 0 1 5.6 265.9" fill="#f7931e" style="mixBlendMode:normal"/>\n<g fill="#fff" style="mixBlendMode:normal">\n<path d="m217.4 253.5c28-5.7 44.7-19 45.6-19.7a19 19 0 0 0-23.8-29.6c-0.2 0.1-18 13.8-47.5 13.8a84.5 84.5 0 0 1-47.8-13.8 19 19 0 0 0-23.8 29.6c1 0.7 18.4 14.3 47.1 19.9l-40 41.9a19 19 0 1 0 27.3 26.3l37.2-39.6 41 39.9a19 19 0 1 0 26.9-26.9z"/>\n<path transform="translate(-1.8 .2)" d="m194.5 57.9a69.9 69.9 0 1 0 0 139.8 69.9 69.9 0 0 0 0-139.8zm0 98.8a28.9 28.9 0 1 1 0-57.8 28.9 28.9 0 0 1 0 57.8z" style="mixBlendMode:normal"/>\n</g>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://connect.ok.ru/offer?url=${e}&title=${t}`}},copyButton:{label:"Copy link",getLabel:({url:e,text:t,type:r})=>{var i;return r===dt.Link?null!==(i=ut.copyButton.label)&&void 0!==i?i:"Copy link":r===dt.Text?"Copy text":""},svgSrc:{baseState:'<svg width="30px" height="30px" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 20"><path d="M6.6 0a2 2 0 0 0-2 2v12c0 1.2.9 2 2 2h9a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2h-9Zm0 2h9v12h-9V2Z" fill="currentColor"/><path d="M2.6 20a2 2 0 0 1-2-2V5h2v13h10v2h-10Z" fill="currentColor"/></svg>',doneState:'<svg width="30px" height="30px" fill="none" viewBox="0 0 386 264" xmlns="http://www.w3.org/2000/svg">\n<path d="m379.05 7.3156c8.855 8.8533 8.855 23.207 0 32.06l-210.67 210.67c-17.707 17.707-46.414 17.707-64.121 0l-97.319-97.319c-8.8531-8.855-8.8531-23.208 0-32.061 8.853-8.853 23.207-8.853 32.06 0l97.319 97.319 210.67-210.67c8.852-8.8531 23.206-8.8531 32.058 0z" clip-rule="evenodd" fill="currentColor" fill-rule="evenodd"/>\n</svg>'}},downloadButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="currentColor"><path d="M31 22a1 1 0 0 0-1 1v7H2v-7a1 1 0 0 0-2 0v8c0 .6.4 1 1 1h30c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"/><path d="M15.3 23.7c.4.4 1 .4 1.4 0l7-6.9c.4-.4.4-1 0-1.4a1 1 0 0 0-1.4 0L17 20.6V1a1 1 0 0 0-2 0v19.6l-5.3-5.2a1 1 0 0 0-1.4 0 1 1 0 0 0 0 1.4l7 7z"/></g></svg>'}},title:{favicon:{background:"white",display:!0},getValue:({url:e,text:t})=>e||t||""},background:"#202125",borderRadius:20,divider:{background:"#36373b"},text:{color:"white",font:"inherit"}},pt={borderRadius:5,loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:ct.forceDesktopMode,forceCheckOrientation:!0,sharePanel:ut};var gt;!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(gt||(gt={}));const ft={goodsWidgetRenderingType:gt.DEFAULT,goodsList:{renderingType:gt.DEFAULT,closeBackgroundColor:"#000000",substrateHeight:200,substrateColor:"#FFFFFF",dimColor:"rgba(0, 0, 0, 0.5)"},goodsCard:{mainTextColor:"#000000",oldPriceTextColor:"#CCCCCC",imageBackgroundColor:"transparent",imageCornerRadius:8},openGoodsWidgetHandler:e=>Promise.resolve(e),loader:{default:{color:"gray",accentColor:"transparent"}}};var mt,yt,vt,bt;!function(e){e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(mt||(mt={})),function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader",e.BANNERS="banners"}(yt||(yt={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(vt||(vt={})),function(e){e.Classic="classic",e.Modern="modern"}(bt||(bt={}));const wt={scrollStyle:vt.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,useExperimentalModernVariant:!1,layout:bt.Classic,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:ut,commonBackdrop:{color:"rgba(51, 51, 51, 1)",backdropFilter:null},slideBackdrop:{opacity:.56,blur:30,linearGradientOverlay:["rgba(0, 0, 0, 0.1) 0%","rgba(0, 0, 0, 0.9) 100%"]},faviconApiUrl:"",navigation:{prevButton:{svgSrc:{baseState:'<svg width="24" height="24" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M19.8076 6.80761L9.20101 17.4142L7.7868 16L18.3934 5.3934L19.8076 6.80761Z" fill="currentColor" />\n <path d="M18.3934 26.6066L7.7868 16L9.20101 14.5858L19.8076 25.1924L18.3934 26.6066Z" fill="currentColor" />\n </svg>'}},nextButton:{svgSrc:{baseState:'<svg width="24" height="24" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.1924 25.1924L22.799 14.5858L24.2132 16L13.6066 26.6066L12.1924 25.1924Z" fill="currentColor" />\n <path d="M13.6066 5.3934L24.2132 16L22.799 17.4142L12.1924 6.80761L13.6066 5.3934Z" fill="currentColor" />\n </svg>'}}},likeButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.96277 15.177L8.11552 15.1837C8.75334 15.1873 9.26846 15.7054 9.26846 16.3433V22.7329C9.26846 23.376 8.74519 23.8962 8.10215 23.8925L6.94939 23.8859C6.31157 23.8822 5.79645 23.3641 5.79645 22.7263V16.3366C5.79645 15.6936 6.31972 15.1733 6.96277 15.177Z" stroke="white" stroke-width="1.21546"/>\n<path d="M11.2546 15.0917L11.3801 23.0645C11.3867 23.4802 11.6013 23.8648 11.9516 24.0886C12.119 24.1955 12.4834 24.2735 12.4834 24.2735L13.1084 24.3569L13.9973 24.4541L15.9789 24.5912L17.4834 24.6365H18.9642L19.282 24.6229C19.7715 24.6018 20.258 24.5358 20.7354 24.4256L21.1038 24.3406C21.3122 24.2925 21.516 24.2263 21.7128 24.1428L21.7439 24.1295C22.0493 23.9999 22.3342 23.8269 22.59 23.6157L22.717 23.5108C22.873 23.382 23.0108 23.2326 23.1265 23.0666L23.1451 23.04C23.2426 22.9003 23.3217 22.7485 23.3804 22.5886L23.428 22.4586C23.5278 22.1867 23.5473 21.8918 23.4842 21.6092L23.4296 21.3645C23.4285 21.3594 23.4265 21.3544 23.4237 21.3499C23.4102 21.3285 23.4163 21.3002 23.4374 21.2862L23.7911 21.0504V21.0504C23.8452 21.0143 23.8957 20.9723 23.9416 20.9263V20.9263C23.99 20.8728 24.0444 20.8083 24.0805 20.7458L24.1361 20.6625C24.2924 20.3945 24.3931 20.0167 24.4083 19.7069L24.4118 19.6352C24.4205 19.458 24.4079 19.2804 24.3744 19.1062L24.3305 18.8986C24.325 18.8696 24.2749 18.7163 24.2611 18.6902L24.1718 18.5154C24.1644 18.5014 24.1898 18.473 24.1898 18.473L24.3653 18.2658C24.4983 18.1109 24.6033 17.9305 24.673 17.7386C24.7222 17.6035 24.7532 17.4657 24.775 17.3153L24.7889 17.1764L24.7957 17.0468C24.8164 16.8366 24.7978 16.6244 24.7409 16.421C24.6929 16.2496 24.6183 16.0868 24.5198 15.9385L24.1983 15.4542C24.1843 15.4367 24.1808 15.413 24.1891 15.3922L24.3081 15.1055C24.3652 14.9628 24.4224 14.6641 24.4391 14.4717L24.4307 14.2984C24.4026 14.0113 24.2405 13.6815 24.0757 13.4238L23.9912 13.3055C23.7236 12.9608 23.3474 12.7334 22.9388 12.5804L22.706 12.4932C22.3923 12.3758 22.0667 12.3327 21.7279 12.2916L21.3444 12.2597C20.89 12.2378 20.2444 12.2651 19.7945 12.3327L18.1092 12.5861C18.1014 12.5873 18.0935 12.5879 18.0857 12.5879H18.0692C17.991 12.5879 17.9276 12.5245 17.9276 12.4462C17.9276 12.4387 17.9282 12.4312 17.9293 12.4238L18.1222 11.3847L18.5408 9.72426C18.6303 9.39087 18.6888 9.04995 18.7158 8.70582L18.7581 8.1657C18.7857 7.81269 18.746 7.45764 18.6411 7.11944L18.6144 7.03332C18.52 6.72899 18.3649 6.44697 18.1583 6.20434L18.1116 6.14941C17.819 5.80563 17.4249 5.56351 16.9859 5.45788L16.7169 5.39313C16.4437 5.32739 16.1567 5.3518 15.8986 5.46269C15.6593 5.56548 15.4564 5.73766 15.316 5.95699L15.2994 5.98302C15.155 6.20866 15.0783 6.47094 15.0783 6.73882V7.10777C15.0783 7.45352 15.0109 7.79596 14.88 8.11598L14.1668 9.85969C13.9176 10.4691 13.6196 11.0573 13.2758 11.6188L12.5778 12.7586C12.4514 12.9651 12.3013 13.1561 12.1306 13.3278L12.0855 13.3731C11.6243 13.837 11.3317 14.442 11.2546 15.0917Z" stroke="white" stroke-width="1.21546"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.96277 15.1771L8.11552 15.1838C8.75334 15.1875 9.26846 15.7056 9.26846 16.3434V22.733C9.26846 23.3761 8.74519 23.8964 8.10215 23.8926L6.94939 23.886C6.31157 23.8823 5.79645 23.3642 5.79645 22.7264V16.3368C5.79645 15.6937 6.31972 15.1734 6.96277 15.1771Z" fill="white" stroke="white" stroke-width="1.21546"/>\n<path d="M11.2546 15.0918L11.3801 23.0646C11.3867 23.4803 11.6013 23.8649 11.9516 24.0888C12.119 24.1957 12.4834 24.2737 12.4834 24.2737L13.1084 24.357L13.9973 24.4542L15.9789 24.5913L17.4834 24.6367H18.9642L19.282 24.623C19.7715 24.6019 20.258 24.5359 20.7354 24.4257L21.1038 24.3407C21.3122 24.2926 21.516 24.2264 21.7128 24.1429L21.7439 24.1297C22.0493 24.0001 22.3342 23.827 22.59 23.6158L22.717 23.5109C22.873 23.3821 23.0108 23.2327 23.1265 23.0668L23.1451 23.0401C23.2426 22.9004 23.3217 22.7487 23.3804 22.5887L23.428 22.4588C23.5278 22.1868 23.5473 21.892 23.4842 21.6093L23.4296 21.3647C23.4285 21.3595 23.4265 21.3545 23.4237 21.3501C23.4102 21.3286 23.4163 21.3004 23.4374 21.2863L23.7911 21.0505V21.0505C23.8452 21.0144 23.8957 20.9724 23.9416 20.9265V20.9265C23.99 20.8729 24.0444 20.8084 24.0805 20.7459L24.1361 20.6626C24.2924 20.3946 24.3931 20.0168 24.4083 19.707L24.4118 19.6353C24.4205 19.4581 24.4079 19.2805 24.3744 19.1063L24.3305 18.8987C24.325 18.8697 24.2749 18.7165 24.2611 18.6904L24.1718 18.5155C24.1644 18.5015 24.1898 18.4732 24.1898 18.4732L24.3653 18.2659C24.4983 18.1111 24.6033 17.9306 24.673 17.7387C24.7222 17.6036 24.7532 17.4658 24.775 17.3154L24.7889 17.1765L24.7957 17.0469C24.8164 16.8367 24.7978 16.6245 24.7409 16.4211C24.6929 16.2497 24.6183 16.0869 24.5198 15.9386L24.1983 15.4543C24.1843 15.4368 24.1808 15.4131 24.1891 15.3923L24.3081 15.1056C24.3652 14.9629 24.4224 14.6642 24.4391 14.4718L24.4307 14.2985C24.4026 14.0114 24.2405 13.6817 24.0757 13.4239L23.9912 13.3056C23.7236 12.9609 23.3474 12.7336 22.9388 12.5805L22.706 12.4934C22.3923 12.3759 22.0667 12.3329 21.7279 12.2918L21.3444 12.2598C20.89 12.2379 20.2444 12.2652 19.7945 12.3329L18.1092 12.5863C18.1014 12.5874 18.0935 12.588 18.0857 12.588H18.0692C17.991 12.588 17.9276 12.5246 17.9276 12.4464C17.9276 12.4389 17.9282 12.4313 17.9293 12.4239L18.1222 11.3849L18.5408 9.72438C18.6303 9.391 18.6888 9.05007 18.7158 8.70594L18.7581 8.16582C18.7857 7.81281 18.746 7.45776 18.6411 7.11956L18.6144 7.03344C18.52 6.72911 18.3649 6.4471 18.1583 6.20446L18.1116 6.14953C17.819 5.80575 17.4249 5.56363 16.9859 5.458L16.7169 5.39325C16.4437 5.32751 16.1567 5.35192 15.8986 5.46281C15.6593 5.5656 15.4564 5.73778 15.316 5.95711L15.2994 5.98314C15.155 6.20878 15.0783 6.47106 15.0783 6.73895V7.10789C15.0783 7.45364 15.0109 7.79608 14.88 8.1161L14.1668 9.85982C13.9176 10.4692 13.6196 11.0574 13.2758 11.6189L12.5778 12.7588C12.4514 12.9652 12.3013 13.1562 12.1306 13.3279L12.0855 13.3732C11.6243 13.8371 11.3317 14.4421 11.2546 15.0918Z" fill="white" stroke="white" stroke-width="1.21546"/>\n</svg>'}},dislikeButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M24.2033 13.6632C24.2033 14.3062 23.68 14.8265 23.037 14.8228L21.8842 14.8161C21.2464 14.8125 20.7313 14.2944 20.7313 13.6565V7.2669C20.7313 6.62385 21.2546 6.10359 21.8976 6.1073L23.0504 6.11395C23.6882 6.11762 24.2033 6.63572 24.2033 7.27355V13.6632Z" stroke="white" stroke-width="1.21547"/>\n<path d="M18.7451 14.9082L18.6196 6.93531C18.6131 6.51965 18.3984 6.13499 18.0481 5.91118C17.8808 5.80428 17.5164 5.72628 17.5164 5.72628L16.8914 5.64295L16.0025 5.54572L14.0208 5.4086L12.5164 5.36328H11.0356L10.7178 5.37695C10.2283 5.398 9.74173 5.46403 9.26432 5.57421L8.89596 5.65921C8.68758 5.7073 8.4838 5.7735 8.28695 5.85706L8.25581 5.87027C7.95049 5.99987 7.66551 6.17296 7.40975 6.38416L7.28278 6.48901C7.12677 6.61783 6.989 6.76725 6.87323 6.93318L6.85466 6.95981C6.75716 7.09955 6.67809 7.25128 6.6194 7.41124L6.57172 7.54119C6.47196 7.81311 6.45245 8.10797 6.51553 8.39066L6.57011 8.63528C6.57127 8.64045 6.57329 8.64539 6.5761 8.64989C6.58951 8.67134 6.58343 8.69958 6.56238 8.71361L6.20864 8.94944V8.94944C6.15453 8.98551 6.10408 9.0275 6.05811 9.07348V9.07348C6.00973 9.12703 5.95532 9.19155 5.91922 9.25403L5.86366 9.33737C5.70735 9.60533 5.60662 9.98309 5.59145 10.2929L5.58794 10.3646C5.57927 10.5418 5.59182 10.7194 5.62532 10.8937L5.66922 11.1012C5.6748 11.1302 5.72484 11.2835 5.73866 11.3096L5.82792 11.4845C5.83532 11.4984 5.80994 11.5268 5.80994 11.5268L5.63444 11.734C5.50143 11.8889 5.3965 12.0693 5.32674 12.2612C5.27758 12.3964 5.24658 12.5341 5.22478 12.6846L5.21089 12.8235L5.20405 12.953C5.18333 13.1632 5.20192 13.3755 5.25887 13.5788C5.30686 13.7503 5.38145 13.9131 5.47991 14.0614L5.80147 14.5456C5.81547 14.5631 5.81898 14.5868 5.81066 14.6076L5.69163 14.8944C5.63456 15.037 5.57739 15.3357 5.56065 15.5282L5.5691 15.7014C5.5972 15.9885 5.75924 16.3183 5.92402 16.576L6.00853 16.6943C6.2762 17.039 6.65231 17.2664 7.06099 17.4194L7.2938 17.5066C7.60742 17.624 7.93309 17.6671 8.27189 17.7082L8.65531 17.7401C9.10973 17.762 9.75538 17.7347 10.2053 17.6671L11.8906 17.4137C11.8984 17.4125 11.9062 17.4119 11.9141 17.4119H11.9305C12.0088 17.4119 12.0722 17.4753 12.0722 17.5536C12.0722 17.5611 12.0716 17.5686 12.0704 17.576L11.8775 18.6151L11.459 20.2756C11.3695 20.6089 11.3109 20.9499 11.284 21.294L11.2417 21.8341C11.214 22.1871 11.2537 22.5422 11.3586 22.8804L11.3853 22.9665C11.4797 23.2708 11.6349 23.5528 11.8414 23.7955L11.8882 23.8504C12.1808 24.1942 12.5749 24.4363 13.0138 24.5419L13.2829 24.6067C13.556 24.6724 13.8431 24.648 14.1012 24.5371C14.3404 24.4343 14.5434 24.2622 14.6837 24.0428L14.7004 24.0168C14.8448 23.7912 14.9215 23.5289 14.9215 23.261V22.892C14.9215 22.5463 14.9888 22.2039 15.1197 21.8838L15.8329 20.1401C16.0821 19.5308 16.3801 18.9425 16.7239 18.381L17.4219 17.2412C17.5483 17.0347 17.6984 16.8437 17.8691 16.6721L17.9142 16.6267C18.3755 16.1629 18.668 15.5578 18.7451 14.9082Z" stroke="white" stroke-width="1.21547"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M24.2035 13.6629C24.2035 14.3059 23.6803 14.8262 23.0372 14.8225L21.8845 14.8158C21.2466 14.8122 20.7315 14.2941 20.7315 13.6562V7.26655C20.7315 6.62348 21.2548 6.10322 21.8978 6.10693L23.0506 6.11358C23.6884 6.11725 24.2035 6.63535 24.2035 7.27319V13.6629Z" fill="white" stroke="white" stroke-width="1.21547"/>\n<path d="M18.7454 14.9079L18.6199 6.93496C18.6133 6.51929 18.3987 6.13463 18.0484 5.91082C17.881 5.80392 17.5166 5.72592 17.5166 5.72592L16.8916 5.64258L16.0027 5.54536L14.021 5.40824L12.5166 5.36292H11.0358L10.718 5.37659C10.2285 5.39764 9.74192 5.46367 9.26451 5.57384L8.89614 5.65885C8.68776 5.70694 8.48398 5.77314 8.28713 5.8567L8.25599 5.86991C7.95066 5.99951 7.66569 6.1726 7.40992 6.3838L7.28295 6.48865C7.12694 6.61747 6.98917 6.7669 6.8734 6.93283L6.85483 6.95946C6.75733 7.0992 6.67826 7.25093 6.61957 7.41088L6.57189 7.54084C6.47212 7.81276 6.45262 8.10762 6.5157 8.39032L6.57028 8.63494C6.57143 8.64011 6.57346 8.64505 6.57627 8.64954C6.58968 8.671 6.5836 8.69923 6.56255 8.71327L6.2088 8.9491C6.1547 8.98517 6.10425 9.02716 6.05827 9.07314C6.0099 9.12669 5.95549 9.19121 5.91938 9.25369L5.86383 9.33703C5.70751 9.60499 5.60678 9.98276 5.59161 10.2926L5.58811 10.3643C5.57943 10.5415 5.59198 10.7191 5.62549 10.8933L5.66938 11.1009C5.67496 11.1299 5.72501 11.2831 5.73883 11.3092L5.82808 11.4841C5.83549 11.4981 5.8101 11.5264 5.8101 11.5264L5.63461 11.7337C5.50159 11.8886 5.39666 12.069 5.3269 12.2609C5.27775 12.396 5.24674 12.5338 5.22494 12.6842L5.21105 12.8231L5.20421 12.9527C5.18349 13.1629 5.20208 13.3751 5.25903 13.5785C5.30702 13.7499 5.38161 13.9128 5.48007 14.061L5.80163 14.5453C5.81564 14.5628 5.81915 14.5865 5.81082 14.6073L5.69179 14.894C5.63472 15.0367 5.57755 15.3354 5.56081 15.5279L5.56926 15.7011C5.59737 15.9882 5.7594 16.318 5.92419 16.5757L6.0087 16.694C6.27636 17.0387 6.65248 17.2661 7.06116 17.4191L7.29397 17.5063C7.6076 17.6237 7.93327 17.6668 8.27207 17.7079L8.65549 17.7398C9.10991 17.7617 9.75557 17.7344 10.2055 17.6668L11.8908 17.4134C11.8986 17.4122 11.9064 17.4116 11.9143 17.4116H11.9307C12.009 17.4116 12.0724 17.4751 12.0724 17.5533C12.0724 17.5608 12.0718 17.5683 12.0706 17.5757L11.8777 18.6148L11.4592 20.2753C11.3697 20.6087 11.3111 20.9496 11.2842 21.2937L11.2419 21.8339C11.2142 22.1869 11.2539 22.5419 11.3588 22.8801L11.3855 22.9662C11.4799 23.2706 11.6351 23.5526 11.8416 23.7952L11.8884 23.8502C12.181 24.1939 12.5751 24.4361 13.014 24.5417L13.2831 24.6064C13.5562 24.6722 13.8433 24.6478 14.1014 24.5369C14.3407 24.4341 14.5436 24.2619 14.6839 24.0426L14.7006 24.0166C14.845 23.7909 14.9217 23.5286 14.9217 23.2607V22.8918C14.9217 22.546 14.989 22.2036 15.1199 21.8836L15.8331 20.1399C16.0824 19.5305 16.3803 18.9422 16.7241 18.3808L17.4221 17.2409C17.5486 17.0344 17.6987 16.8434 17.8694 16.6718L17.9144 16.6264C18.3757 16.1626 18.6683 15.5575 18.7454 14.9079Z" fill="white" stroke="white" stroke-width="1.21547"/>\n</svg>'}},favoriteButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49976 7.25225V23.2366C7.49976 24.6882 9.33429 25.321 10.2292 24.1782L13.7974 19.6218C14.4088 18.8411 15.5907 18.8411 16.2021 19.6218L19.7703 24.1782C20.6652 25.321 22.4998 24.6882 22.4998 23.2366V7.25225C22.4998 5.98711 21.4742 4.96152 20.209 4.96152H9.79048C8.52535 4.96152 7.49976 5.98712 7.49976 7.25225Z" stroke="white" stroke-width="1.29808"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49976 7.04073V23.0251C7.49976 24.4767 9.33429 25.1095 10.2292 23.9667L13.7974 19.4103C14.4088 18.6296 15.5907 18.6296 16.2021 19.4103L19.7703 23.9667C20.6652 25.1095 22.4998 24.4766 22.4998 23.0251V7.04072C22.4998 5.77559 21.4742 4.75 20.209 4.75H9.79048C8.52535 4.75 7.49976 5.77559 7.49976 7.04073Z" fill="white" stroke="white" stroke-width="1.29808"/>\n</svg>'}},muteButton:{svgSrc:{baseState:'<svg width="30" height="31" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.40625 13.5734V18.7664C3.40625 19.7239 4.18245 20.5001 5.13993 20.5001H8.04633C8.6342 20.5001 9.17511 20.8213 9.45654 21.3374L11.903 25.8242C12.271 26.4992 12.9783 26.9192 13.7471 26.9192C14.9072 26.9192 15.8477 25.9788 15.8477 24.8187V7.52486C15.8477 6.36469 14.9072 5.42416 13.747 5.42412C12.9783 5.42409 12.2709 5.84393 11.9028 6.51875L9.45651 11.0026C9.17509 11.5184 8.63442 11.8394 8.04683 11.8394H5.14027C4.1826 11.8394 3.40625 12.6157 3.40625 13.5734Z" fill="white"/>\n<path d="M19.8477 13.0466L26.0976 19.2966M26.0976 13.0466L19.8477 19.2966" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.40625 12.5733V17.7663C3.40625 18.7238 4.18245 19.5 5.13993 19.5H8.04633C8.6342 19.5 9.17511 19.8212 9.45654 20.3373L11.903 24.8241C12.271 25.4991 12.9783 25.919 13.7471 25.9191C14.9072 25.9191 15.8477 24.9787 15.8477 23.8186V6.52474C15.8477 5.36457 14.9072 4.42404 13.747 4.424C12.9783 4.42397 12.2709 4.84381 11.9028 5.51863L9.45651 10.0025C9.17509 10.5183 8.63442 10.8392 8.04683 10.8392H5.14027C4.1826 10.8392 3.40625 11.6156 3.40625 12.5733Z" fill="white"/>\n<path d="M19.8477 11.4215C20.6323 12.4661 21.0972 13.7645 21.0972 15.1715C21.0972 16.5785 20.6323 17.8769 19.8477 18.9215M22.3472 6.78613C24.6487 8.84608 26.0972 11.8396 26.0972 15.1715C26.0972 18.5034 24.6487 21.4969 22.3472 23.5569" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>'}},shareButton:{svgSrc:{baseState:'<svg width="30" height="31" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 10.9038C20.8488 10.9038 21.9423 9.81036 21.9423 8.46151C21.9423 7.11266 20.8488 6.01921 19.5 6.01921C18.1512 6.01921 17.0577 7.11266 17.0577 8.46151C17.0577 9.81036 18.1512 10.9038 19.5 10.9038ZM19.5 12.2115C21.5711 12.2115 23.25 10.5326 23.25 8.46151C23.25 6.39045 21.5711 4.71151 19.5 4.71151C17.4289 4.71151 15.75 6.39045 15.75 8.46151C15.75 8.98692 15.8581 9.48709 16.0531 9.94101L12.288 12.4511C11.6202 11.8367 10.7288 11.4615 9.74976 11.4615C7.67869 11.4615 5.99976 13.1404 5.99976 15.2115C5.99976 17.2826 7.67869 18.9615 9.74976 18.9615C10.7325 18.9615 11.6269 18.5835 12.2956 17.9649L16.018 20.5665C15.8451 20.9977 15.75 21.4685 15.75 21.9615C15.75 24.0326 17.4289 25.7115 19.5 25.7115C21.5711 25.7115 23.25 24.0326 23.25 21.9615C23.25 19.8904 21.5711 18.2115 19.5 18.2115C18.3369 18.2115 17.2974 18.7411 16.6096 19.5722L13.0138 17.0591C13.3231 16.5138 13.4998 15.8833 13.4998 15.2115C13.4998 14.5368 13.3216 13.9037 13.0097 13.3567L16.667 10.9185C17.3545 11.7106 18.3688 12.2115 19.5 12.2115ZM12.1921 15.2115C12.1921 16.5604 11.0986 17.6538 9.74976 17.6538C8.40091 17.6538 7.30745 16.5604 7.30745 15.2115C7.30745 13.8627 8.40091 12.7692 9.74976 12.7692C11.0986 12.7692 12.1921 13.8627 12.1921 15.2115ZM21.9423 21.9615C21.9423 23.3104 20.8488 24.4038 19.5 24.4038C18.1512 24.4038 17.0577 23.3104 17.0577 21.9615C17.0577 20.6127 18.1512 19.5192 19.5 19.5192C20.8488 19.5192 21.9423 20.6127 21.9423 21.9615Z" fill="white"/>\n</svg>'}}};var St;!function(e){e.STYLE_CIRCLE="circle",e.STYLE_QUAD="quad",e.STYLE_RECTANGLE="rectangle",e.SWIPE_CUBE="cube",e.SWIPE_FLAT="flat",e.SWIPE_COVER="cover",e.CLOSE_BUTTON_LEFT="left",e.CLOSE_BUTTON_RIGHT="right"}(St||(St={}));const _t={};var Ot,kt,xt,Ct;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(Ot||(Ot={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(kt||(kt={})),function(e){e.LTR="ltr",e.RTL="rtl"}(xt||(xt={})),function(e){e.StoryList="storyList",e.StoryReader="storyReader",e.GameReader="gameReader",e.StackStoryList="stackStoryList",e.IamReader="iamReader",e.Banners="banners"}(Ct||(Ct={}));class Pt extends s.EventEmitter{emit(e,t){return super.emit(e,t)}on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}}var jt,Et,It=j(5714),Tt=j.n(It);!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.TouchMoveHorizontal="touchMoveHorizontal",e.TouchMoveVertical="touchMoveVertical",e.LongTouchDetected="longTouchDetected"}(jt||(jt={}));class At{constructor(e,t){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}}class Mt{constructor(e,t,r,i){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"dx",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dy",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class Lt extends(a()){constructor(e){super(),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"$grabHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"startPoint",{enumerable:!0,configurable:!0,writable:!0,value:new At(0,0)}),Object.defineProperty(this,"touchStartTimerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_isSwiping",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"touched",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_horizontalSwipeGesture",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_verticalSwipeGesture",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isLongTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:{threshold:10,touchStartTimeout:-1}}),Object.defineProperty(this,"_verticalSwipeGestureDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_horizontalSwipeGestureDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),e&&(this.options=Tt()(this.options,e)),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),Y&&this.disable()}get isSwiping(){return this._isSwiping}get horizontalSwipeGesture(){return this._horizontalSwipeGesture}get verticalSwipeGesture(){return this._verticalSwipeGesture}forceEnable(){this.enabled=!0}enable(){Y||(this.enabled=!0)}disable(){this.enabled=!1}disableVerticalSwipeGesture(){this._verticalSwipeGestureDisabled=!0}enableVerticalSwipeGesture(){this._verticalSwipeGestureDisabled=!1}disableHorizontalSwipeGesture(){this._horizontalSwipeGestureDisabled=!0}enableHorizontalSwipeGesture(){this._horizontalSwipeGestureDisabled=!1}destroy(){this.$el&&this.$grabHandler&&(this.reset(),this.clearTouchStartTimeout(),Y?(this.$grabHandler.removeEventListener("mousedown",this.handleTouchStart),this.$el.removeEventListener("mousemove",this.handleTouchMove),window.removeEventListener("mouseup",this.handleTouchEnd)):(this.$grabHandler.removeEventListener("touchstart",this.handleTouchStart),this.$el.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)),this.$el=null,this.$grabHandler=null)}init(e,t){this.$el||(this.$el=e,this.$grabHandler=null!=t?t:this.$el,Y?(this.$grabHandler.addEventListener("mousedown",this.handleTouchStart,{passive:!0}),this.$el.addEventListener("mousemove",this.handleTouchMove,{passive:!0}),window.addEventListener("mouseup",this.handleTouchEnd)):(this.$grabHandler.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),this.$el.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),window.addEventListener("touchend",this.handleTouchEnd)))}resetGrabHandler(){this.$el&&this.updateGrabHandler(this.$el)}setGrabHandler(e){e&&this.updateGrabHandler(e)}updateGrabHandler(e){var t,r;Y?(null===(t=this.$grabHandler)||void 0===t||t.removeEventListener("mousedown",this.handleTouchStart),e.addEventListener("mousedown",this.handleTouchStart)):(null===(r=this.$grabHandler)||void 0===r||r.removeEventListener("touchstart",this.handleTouchStart),e.addEventListener("touchstart",this.handleTouchStart)),this.$grabHandler=e}handleTouchStart(e){this.enabled&&!this.touched&&(this.touched=!0,this.clearTouchStartTimeout(),this.startPoint=this.getPointByEvent(e),this.emit(jt.TouchStart,new Mt(this.startPoint.x,this.startPoint.y,0,0)),this.startTouchStartTimer(this.startPoint))}handleTouchMove(e){if(!this.touched)return;const t=this.getPointByEvent(e),r=this.getDeltaPoint(t),i=new Mt(t.x,t.y,r.x,r.y);this.isThresholdExceed(r)&&(this._isSwiping=!0),this._isSwiping&&(this.emit(jt.TouchMove,i),this.determineSwipeGestureDirection(r),this.handleHorizontalSwipeGesture(i),this.handleVerticalSwipeGesture(i))}isThresholdExceed(e){return Math.abs(e.x)>this.options.threshold||Math.abs(e.y)>this.options.threshold}handleTouchEnd(e){if(!this.touched)return;this._isLongTouch&&e.preventDefault(),this.clearTouchStartTimeout();const t=this.getPointByEvent(e),r=this.getDeltaPoint(t);this.emit(jt.TouchEnd,new Mt(t.x,t.y,r.x,r.y)),this.reset()}clearTouchStartTimeout(){this.touchStartTimerId&&(clearTimeout(this.touchStartTimerId),this.touchStartTimerId=null)}startTouchStartTimer(e){null!=this.options.touchStartTimeout&&-1!==this.options.touchStartTimeout&&(this.touchStartTimerId=setTimeout(()=>{this._isLongTouch=!0,this.emit(jt.LongTouchDetected,e)},this.options.touchStartTimeout))}getPointByEvent(e){if("changedTouches"in e){const t=e.changedTouches[0];return new At(t.pageX,t.pageY)}return new At(e.pageX,e.pageY)}getDeltaPoint(e){const t=e.x-this.startPoint.x,r=e.y-this.startPoint.y;return new At(t,r)}determineSwipeGestureDirection(e){Math.abs(e.x)>Math.abs(e.y)?this._verticalSwipeGesture||this._horizontalSwipeGestureDisabled||(this._horizontalSwipeGesture=!0):this._horizontalSwipeGesture||this._verticalSwipeGestureDisabled||(this._verticalSwipeGesture=!0)}handleVerticalSwipeGesture(e){this._verticalSwipeGesture&&!this._verticalSwipeGestureDisabled&&this.emit(jt.TouchMoveVertical,e)}handleHorizontalSwipeGesture(e){this._horizontalSwipeGesture&&!this._horizontalSwipeGestureDisabled&&this.emit(jt.TouchMoveHorizontal,e)}reset(){this._isSwiping=!1,this.touched=!1,this._isLongTouch=!1,this._horizontalSwipeGesture=!1,this._verticalSwipeGesture=!1}}!function(e){e.Top="top",e.Bottom="bottom"}(Et||(Et={}));const Rt=Et.Bottom;class Bt{constructor(e){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:Rt}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toastContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.initializeOptions(e),this.mountPoint=e.mountPoint}show(e){return this.content=e,this.destroy(),this.createAndShowToast(),!0}hide(){if(!this.toastContainer)return!1;clearTimeout(this.timeoutId),this.toastContainer.className+=" toast_fadeout";return this.addAnimationEndListeners(this.toastContainer,()=>{var e,t;null===(t=null===(e=this.toastContainer)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.toastContainer),this.toastContainer=null}),!0}destroy(){var e;this.toastContainer&&(clearTimeout(this.timeoutId),null===(e=this.toastContainer.parentNode)||void 0===e||e.removeChild(this.toastContainer),this.toastContainer=null)}initializeOptions(e){if(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.position){const t=e.position.toLowerCase();this.position="top"===t||"bottom"===t?t:Rt}}createAndShowToast(){const e=this.createToastContainer(),t=this.createToastElement(),r=this.createToastTextElement();t.appendChild(r),e.appendChild(t),this.mountPoint.appendChild(e),this.timeoutId=window.setTimeout(()=>this.hide(),this.duration),this.toastContainer=e}createToastContainer(){const e=document.createElement("div");return e.id="toast_container",e.className="toast_fadein",e.style.zIndex="1130",e}createToastElement(){const e=document.createElement("div");return e.id="toast",e}createToastTextElement(){const e=document.createElement("span");return e.innerHTML=this.content,e}addAnimationEndListeners(e,t){["animationend","webkitAnimationEnd","msAnimationEnd","oAnimationEnd"].forEach(r=>{e.addEventListener(r,t,{once:!0})})}}var Dt=j(7326),Nt=j.n(Dt);class Ft{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"debouncedTryEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:Nt()(()=>{this.slider.notifyScrollEnd()},200)}),this.handleScroll=this.handleScroll.bind(this),this.init(),this.addEventListeners()}destroy(){this.slider.getElementRef().removeEventListener("scroll",this.handleScroll)}init(){const e=this.slider.getElementRef();e.style.overflowX=this.slider.isHorizontal()?"scroll":"hidden",e.style.overflowY=this.slider.isHorizontal()?"hidden":"scroll"}addEventListeners(){this.slider.getElementRef().addEventListener("scroll",this.handleScroll)}scrollTo(e){const t=this.slider.getElementRef(),r=this.slider.dir===xt.LTR?1:-1;t.scrollLeft=r*e.x,t.scrollTop=e.y}scrollWithAnimation(e,t){const r=this.slider.getElementRef(),i=this.slider.dir===xt.LTR?1:-1;r.scrollTo({left:i*e.x,top:e.y,behavior:"smooth"})}stopAnimation(){}handleScroll(){this.slider.notifyScrollStart();const e=this.slider.getElementRef();this.slider.updatePosition(Math.abs(e.scrollLeft),Math.abs(e.scrollTop)),this.slider.testAttraction(e.scrollLeft,e.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition()),this.debouncedTryEndScroll()}}class Ut{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"lastClientX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastClientY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pushed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isAnimating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"debouncedTryAnimationEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:Nt()(()=>{this.isAnimating=!1,this.slider.notifyScrollEnd()},200)}),Object.defineProperty(this,"debouncedTryMouseWheelEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:Nt()(()=>{this.slider.notifyScrollEnd()},200)}),this.handleScroll=this.handleScroll.bind(this),this.init(),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.addEventListeners()}init(){const e=this.slider.getElementRef();e.style.overflowX=this.slider.isHorizontal()?"scroll":"hidden",e.style.overflowY=this.slider.isHorizontal()?"hidden":"scroll"}addEventListeners(){const e=this.slider.getElementRef();e.addEventListener("scroll",this.handleScroll),e.addEventListener("mousedown",this.handleMouseDown,I),e.addEventListener("touchstart",this.handleMouseDown,I)}scrollTo(e){const t=this.slider.getElementRef(),r=this.slider.dir===xt.LTR?1:-1;t.scrollLeft=r*e.x,t.scrollTop=e.y,this.slider.updatePosition(Math.abs(t.scrollLeft),Math.abs(t.scrollTop)),this.slider.testAttraction(t.scrollLeft,t.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition())}scrollWithAnimation(e,t){this.isAnimating=!0;const r=this.slider.getElementRef(),i=this.slider.dir===xt.LTR?1:-1;r.scrollTo({left:i*e.x,top:e.y,behavior:"smooth"})}stopAnimation(){}destroy(){const e=this.slider.getElementRef();e.removeEventListener("mousedown",this.handleMouseDown,I),e.removeEventListener("touchstart",this.handleMouseDown,I),e.removeEventListener("mouseup",this.handleMouseUp,I),e.removeEventListener("touchend",this.handleMouseUp,I),e.removeEventListener("mousemove",this.handleMouseMove,I),e.removeEventListener("touchmove",this.handleMouseMove,I),e.removeEventListener("scroll",this.handleScroll)}handleMouseDown(e){this.pushed=!0,this.isDragging=!1;const{clientX:t,clientY:r}=this.extractPointerPosition(e);this.lastClientX=t,this.lastClientY=r,window.addEventListener("mouseup",this.handleMouseUp,I),window.addEventListener("touchend",this.handleMouseUp,I),window.addEventListener("mousemove",this.handleMouseMove,I),window.addEventListener("touchmove",this.handleMouseMove,I)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.slider.notifyScrollEnd(),window.removeEventListener("mouseup",this.handleMouseUp,I),window.removeEventListener("touchend",this.handleMouseUp,I),window.removeEventListener("mousemove",this.handleMouseMove,I),window.removeEventListener("touchmove",this.handleMouseMove,I))}handleMouseMove(e){if(!this.pushed)return;const{clientX:t,clientY:r}=this.extractPointerPosition(e),i=t-this.lastClientX,s=r-this.lastClientY;this.lastClientX=t,this.lastClientY=r;const a=this.slider.dir===xt.LTR?-1:1,{x:o,y:n}=this.slider.preparePosition(this.slider.getCurrentPosition().x+a*i,this.slider.getCurrentPosition().y+a*s);!this.isDragging&&(Math.abs(i)>=1||Math.abs(s)>=1)&&(this.isDragging=!0),this.isDragging&&this.scrollTo({x:o,y:n})}extractPointerPosition(e){return e instanceof MouseEvent?{clientX:e.clientX,clientY:e.clientY}:{clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}}handleScroll(){this.isDragging?this.handleScrollByDraggable():this.isAnimating?this.handleScrollByAnimation():this.handleScrollByMouseWheel()}handleScrollByMouseWheel(){this.slider.notifyScrollStart();const e=this.slider.getElementRef();this.slider.updatePosition(Math.abs(e.scrollLeft),Math.abs(e.scrollTop)),this.slider.testAttraction(e.scrollLeft,e.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition()),this.debouncedTryMouseWheelEndScroll()}handleScrollByDraggable(){this.slider.notifyScrollStart()}handleScrollByAnimation(){if(!this.isAnimating)return;this.slider.notifyScrollStart();const e=this.slider.getElementRef();this.slider.updatePosition(Math.abs(e.scrollLeft),Math.abs(e.scrollTop)),this.slider.testAttraction(e.scrollLeft,e.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition()),this.debouncedTryAnimationEndScroll()}}var Gt;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(Gt||(Gt={}));class Vt extends s.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"scrollStrategy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isScrolling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPosition",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:Gt.Horizontal}),Object.defineProperty(this,"gap",{enumerable:!0,configurable:!0,writable:!0,value:20}),Object.defineProperty(this,"_reachStart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_reachEnd",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_dir",{enumerable:!0,configurable:!0,writable:!0,value:xt.LTR})}get isScrolling(){return this._isScrolling}get slides(){return this.slider.children[0]instanceof HTMLSlotElement?this.slider.children[0].assignedElements({flatten:!1}):Array.from(this.slider.children)}get elementRef(){return this.slider}get reachStart(){return this._reachStart}get reachEnd(){return this._reachEnd}get scrollWidth(){return this.slider.scrollWidth}get dir(){return this._dir}mount(e){this.slider=e,this.changeScrollStrategy()}destroy(){this.removeAllListeners(),this.scrollStrategy.destroy()}getLength(){var e,t;return null!==(t=null===(e=this.slider)||void 0===e?void 0:e.children.length)&&void 0!==t?t:0}changeDirection(e){this.direction=e,this.scrollTo(0,0),this.changeScrollStrategy()}setGap(e){this.gap=e}setDesktopMode(e){this.desktopMode=e,this.changeScrollStrategy()}getGap(){return this.gap}scrollTo(e,t=300){e=Math.trunc(e);const r=this.preparePosition(e,e);this.isTheSamePosition(r.x,r.y)||(t>0?this.scrollStrategy.scrollWithAnimation(r,t):this.scrollStrategy.scrollTo(r))}isHorizontal(){return this.direction===Gt.Horizontal}updatePosition(e,t){this.currentPosition={x:Math.trunc(e),y:Math.trunc(t)}}getElementRef(){return this.slider}getCurrentPosition(){return this.currentPosition}preparePosition(e,t){let r={x:e,y:t};return this.isHorizontal()?r.y=0:r.x=0,this.attractToBounds(r.x,r.y)}attractToBounds(e,t){return{x:this.attractToBoundsByX(e),y:this.attractToBoundsByY(t)}}attractToBoundsByX(e){return e<=0?0:e+this.slider.clientWidth>=this.slider.scrollWidth?this.slider.scrollWidth-this.slider.clientWidth:e}attractToBoundsByY(e){return e<=0?0:e+this.slider.clientHeight>=this.slider.scrollHeight?this.slider.scrollHeight-this.slider.clientHeight:e}testAttraction(e,t){const r=this._dir===xt.LTR?1:-1,i=r*e+this.slider.clientWidth>=Math.max(this.slider.scrollWidth-1,0),s=r*t+this.slider.clientHeight>=Math.max(this.slider.scrollHeight-1,0);this._reachStart=r*e<=0&&r*t<=0,this._reachEnd=this.isHorizontal()?i:s,this.emit("reachStart",this._reachStart),this.emit("reachEnd",this._reachEnd)}setTextDirection(e){this._dir=e;const{x:t,y:r}=this.getCurrentPosition();this.testAttraction(t,r)}scrollBySlideIndex(e,t){this.isHorizontal()?this.scrollTo(this.slides[e].offsetLeft,t):this.scrollTo(this.slides[e].offsetTop,t)}scrollByDirection(e,t){const{x:r,y:i}=this.getCurrentPosition(),s=this.isHorizontal()?r:i,a=this.getSlidesPerView(),o=this.getStoryWidth(),n=this.getStoryHeight(),l=s+e*a*(this.isHorizontal()?o:n);this.scrollTo(l,t)}notifyScrollStart(){this.isScrolling||(this._isScrolling=!0,this.emit("scrollstart",this.currentPosition))}notifyScrollEnd(){this.isScrolling&&(this._isScrolling=!1,this.emit("scrollend",this.currentPosition))}async waitStoryListClientWidth(){const e=t=>{this.elementRef.clientWidth>0?t():requestAnimationFrame(()=>e(t))};return new Promise(t=>{requestAnimationFrame(()=>e(t))})}isTheSamePosition(e,t){return e===this.currentPosition.x&&t===this.currentPosition.y}getSlidesPerView(){if(this.isHorizontal()&&this.slider.clientWidth){const e=this.slider.children[0].clientWidth+this.gap;return Math.round(this.slider.clientWidth/e)}if(!this.isHorizontal()&&this.slider.clientHeight){const e=this.slider.children[0].clientHeight+this.gap;return Math.round(this.slider.clientHeight/e)}return 1}getStoryWidth(){var e;return(null===(e=this.slides[0])||void 0===e?void 0:e.clientWidth)+this.gap}getStoryHeight(){var e;return(null===(e=this.slides[0])||void 0===e?void 0:e.clientHeight)+this.gap}changeScrollStrategy(){this.scrollStrategy&&this.scrollStrategy.destroy(),this.scrollStrategy=this.desktopMode?new Ut(this):new Ft(this)}}class zt{constructor(e){Object.defineProperty(this,"window",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get width(){const e=this.window.document.documentElement.clientWidth;return Math.abs(this.window.innerWidth-e)}hide(){this.hidden||(this.disableOverFlow(),this.disablePullToRefresh(),this.setBodyContainer(),this.setElementAttributes("body","paddingRight",e=>e+this.width),this.hidden=!0)}show(){this.hidden&&(this.resetElementAttributes("html","overflow"),this.resetElementAttributes("body","overflow"),this.resetElementAttributes("body","paddingRight"),this.resetBodyContainer(),this.enablePullToRefresh(),this.hidden=!1)}disablePullToRefresh(){if(this.style)return;this.style=this.window.document.createElement("style"),this.style.setAttribute("nonce",k()),this.style.textContent="\n @media screen and (pointer: coarse) {\n html, body {\n overscroll-behavior-y: none;\n touch-action: none;\n }\n }\n body {\n overscroll-behavior-y: none;\n }\n ",this.window.document.body.appendChild(this.style)}enablePullToRefresh(){var e;this.style&&(null===(e=this.style.parentElement)||void 0===e||e.removeChild(this.style),this.style=null)}disableOverFlow(){const e=this.window.document,t=e.documentElement.style.overflow,r=e.body.style.overflow;r&&(e.body.dataset.overflow=r),t&&(e.documentElement.dataset.overflow=t),e.body.style.overflow="hidden",e.documentElement.style.overflow="hidden"}setElementAttributes(e,t,r){const i=this.width;this.window.document.querySelectorAll(e).forEach(e=>{if(e!==this.window.document.body&&this.window.innerWidth>e.clientWidth+i)return;const s=e.style[t],a=this.window.getComputedStyle(e)[t],o=parseFloat(a||"0");e.dataset[t]=s,e.style[t]=`${r(o)}px`})}resetElementAttributes(e,t){this.window.document.querySelectorAll(e).forEach(e=>{const r=e.dataset[t];void 0===r?e.style.removeProperty(t):(delete e.dataset[t],e.style[t]=r)})}setBodyContainer(){const e=this.window.document,t=e.body.style.container;t&&(e.body.dataset.container=t),e.body.style.container="unset"}resetBodyContainer(){this.resetElementAttributes("body","container")}}var Wt=j(5136);const $t=async e=>(await fetch(e)).blob(),Ht=async e=>{const t=await $t(e);return function(e,t=!0){return new Promise(function(r){var i=new FileReader;i.onloadend=function(){if(t){var e=String(i.result).replace("data:","").replace(/^.+,/,"");r(e)}else r(String(i.result))},i.readAsDataURL(e)})}(new File([t],"image",{type:t.type,lastModified:(new Date).getTime()}),!1)};function qt(e,t,r,i){var s=e.indexOf(r,t);if(-1===s)return null;for(var a="",o=s+r.length;o<e.length&&-1===i.indexOf(e[o]);o++)a+=e[o];return{foundAtIndex:s,value:a}}function Jt(e){return e.replace(/["']/g,"")}function Kt(e,t){const r=document.createElementNS("http://www.w3.org/2000/svg",e);for(let e in t)r.setAttributeNS(null,e.replace(/[A-Z]/g,function(e,t,r,i){return"-"+e.toLowerCase()}),t[e]);return r}var Zt;function Qt(e,t,r,i,s,a,o,n,l,c){var d=Kt("svg",{width:String(s),height:String(a),style:"background-color: #fff;"}),h=Kt("foreignObject",{x:"0",y:"0",width:"100%",height:"100%"});d.appendChild(h);try{h.style.fontSize=document.body.style.fontSize}catch(e){console.error(e)}!function(){const u=t.cloneNode(!0);if(null!=i&&"string"==typeof i&&i.length>0){const e=Array.prototype.slice.call(u.querySelectorAll(i));for(let t=0;t<e.length;t++){const r=e[t];r&&r.style&&r.style.setProperty&&r.style.setProperty("display","none")}}h.appendChild(u);var p=[];(function(e){for(var t=[],r=0;;){var i=qt(e,r,"src: url(",[" ",")","\t"]);if(null==i)break;r=i.foundAtIndex+i.value.length,t.push(Jt(i.value))}return t})(r).forEach(function(e){p.push(new Promise(function(t,i){Ht(e).then(function(i){r=r.replace(e,i),t()}).catch(function(e){t()})}))}),h.querySelectorAll("img").forEach(function(e){e.crossOrigin="Anonymous",p.push(new Promise(function(t,r){Ht(e.src).then(function(r){e.onload=r=>e.decode().then(()=>t()),e.onerror=e=>{console.error(e),t()},e.decoding="sync",e.src=r}).catch(function(e){t()})}))}),h.querySelectorAll("video").forEach(function(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}),h.querySelectorAll(".narrative-element-video").forEach(function(e){e.classList.add("init")}),Promise.all(p).then(function(){const t=Kt("style",{});t.textContent=r,d.appendChild(t);const i=(new XMLSerializer).serializeToString(d),h=new Image;h.onload=t=>{h.decode().then(function(){setTimeout(function(){const e=document.createElement("canvas"),t=e.getContext("2d");if(t){e.style.width=s+"px",e.style.height=a+"px",e.width=2*s,e.height=2*a,t.scale(2,2),t.drawImage(h,0,0);const r=e.toDataURL(o,n);$t(r).then(function(t){l(t),e.remove()})}},e===Zt.IOS?200:void 0)}).catch(e=>{console.log({image:h,encodingError:e},"onDecodeError"),c("error render svg image: "+e)})},h.onerror=e=>{c("error render svg image: "+e)},h.setAttribute("crossOrigin","Anonymous"),h.crossOrigin="Anonymous",h.decoding="sync",h.src="data:image/svg+xml;base64,"+btoa(encodeURIComponent(i).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}))})}()}function Yt(e,t,r,i){return new Promise(function(s,a){null==i&&(i=""),function(e,t,r,i,s,a){Qt(e,t,r,i,t.clientWidth,t.clientHeight,"image/jpeg",1,s,a)}(e,t,r,i,function(e){s(new File([e],"image.jpeg",{type:e.type,lastModified:(new Date).getTime()}))},function(){console.error("Image fail");const e=new Error;e.name="ImageFail",a(e)})})}!function(e){e[e.IOS=0]="IOS",e[e.ANDROID=1]="ANDROID",e[e.OTHER=2]="OTHER"}(Zt||(Zt={}));class Xt{async getScreenShot({hideElementsSelector:e,slideContent:t}){const r=await Yt(Zt.IOS,t,function(e){let t="";return Array.prototype.slice.call(window.document.styleSheets).forEach(r=>{e(r)&&(t+=Array.prototype.slice.call(r.rules).map(e=>e.cssText).join(""))}),t}(function(){return!0}),e);return{file:r,url:URL.createObjectURL(r)}}getFilteredConfigDto(e){const t={};for(const[r,i]of Object.entries(null!=e?e:{}))null!==i&&(t[r]=i);return t}}var er=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},tr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},rr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},ir=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let sr=(()=>{var e,t,r;let i,s,a,o,n,l,c=[],d=[],h=[],u=[],p=[];return e=class{get _isOpened(){return rr(this,t,"f")}set _isOpened(e){ir(this,t,e,"f")}get _params(){return rr(this,r,"f")}set _params(e){ir(this,r,e,"f")}constructor(e,i,s){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(er(this,c),e)}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"nativeSharingId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"nativeSharingRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"sharingService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,er(this,d,!1)),r.set(this,(er(this,h),er(this,u,{id:"",type:dt.Link,link:""}))),Object.defineProperty(this,"currentStorySlide",{enumerable:!0,configurable:!0,writable:!0,value:(er(this,p),null)}),this.sharingService=new Xt}get isOpened(){return this._isOpened}get params(){return this._params}open(e){this.story.pauseUI(e.id),this._params={link:e.link,type:e.type,text:e.text,id:e.id},this._isOpened=!0,this.touchController.disable()}close(){this.story.resumeUI(this._params.id),this._isOpened=!1,this._params={id:"",type:dt.Image,link:""},this.touchController.enable()}handleShareComplete(e,t){var r;null===(r=this.currentStorySlide)||void 0===r||r.setShareComplete(e,t),this.close()}async shareScreenShot({shareId:e,shareText:t,hideElementsSelector:r,storySlide:i}){let s=null;this.currentStorySlide=i;try{if(!this.story.$root)return;const i=await this.sharingService.getScreenShot({hideElementsSelector:r,slideContent:this.story.$root});s=i.url;const a={files:[i.file],text:t};if(Y)return void this.open({type:dt.Image,id:e,link:s,text:t});await this.startNativeSharing(e,a)}catch(r){console.error(r),s&&this.open({type:dt.Image,id:e,link:s,text:t})}}async shareText({shareId:e,config:t,storySlide:r}){var i;this.currentStorySlide=r,null==e&&(e="story-share");const s=this.sharingService.getFilteredConfigDto(t),a=s.url=null!==(i=s.url)&&void 0!==i?i:s.text,o={type:dt.Link,id:e,link:a};try{if(Y)return void this.open(o);await this.startNativeSharing(e,s)}catch(e){this.open(o)}}async startNativeSharing(e,t){if(!this.storyManager.shareHandler)throw new Error;try{this.story.pauseUI(e),this.runNativeSharing({id:e}),await this.storyManager.shareHandler(t),this.completeNativeSharing({result:!0})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;throw e}finally{this.completeNativeSharing({result:!1})}}runNativeSharing({id:e}){this.nativeSharingId=e,this.nativeSharingRunning=!0}completeNativeSharing({result:e}){this.nativeSharingRunning&&(this.handleShareComplete(this.nativeSharingId,e),this.story.resumeUI(this.nativeSharingId),this.nativeSharingRunning=!1,this.nativeSharingId="")}},t=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;i=[f.observable],s=[f.observable],a=[f.computed],o=[f.computed],n=[f.action],l=[f.action],tr(e,null,i,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:t},d,h),tr(e,null,s,{kind:"accessor",name:"_params",static:!1,private:!1,access:{has:e=>"_params"in e,get:e=>e._params,set:(e,t)=>{e._params=t}},metadata:t},u,p),tr(e,null,a,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:t},null,c),tr(e,null,o,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:t},null,c),tr(e,null,n,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:t},null,c),tr(e,null,l,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:t},null,c),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var ar=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},or=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},nr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},lr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};var cr;!function(e){e.Init="🔧",e.Start="🚀",e.Pause="⏸️",e.Resume="↩️",e.Stop="🛑",e.Destroy="🗑️",e.Restart="🔄"}(cr||(cr={}));let dr=(()=>{var e,t,r;let i,s,a,o=[],n=[],l=[],c=[],d=[];return e=class{get _disabledNextClick(){return nr(this,t,"f")}set _disabledNextClick(e){lr(this,t,e,"f")}get _cover(){return nr(this,r,"f")}set _cover(e){lr(this,r,e,"f")}constructor(e,i,s,a,h){Object.defineProperty(this,"_story",{enumerable:!0,configurable:!0,writable:!0,value:(ar(this,o),e)}),Object.defineProperty(this,"_index",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"cacheManager",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,ar(this,n,!1)),r.set(this,(ar(this,l),ar(this,c,null))),Object.defineProperty(this,"preloaded",{enumerable:!0,configurable:!0,writable:!0,value:(ar(this,d),!1)}),Object.defineProperty(this,"isPreloading",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:f.observable.object({inited:!1,started:!1,paused:!1})}),Object.defineProperty(this,"handleTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:({dy:e})=>{this.story.touchController&&e<10&&this.story.touchController.verticalSwipeGesture&&this.slideApi.slideSwipeUpHandler()}})}get index(){return this._index}get story(){return this._story}get navigationDisabled(){return!1}get timeline(){return this.slide.timeline}get duration(){return this.slide.duration}get screenshotShare(){return this.slide.screenshotShare}get html(){return this.slide.html}get eventPayload(){return this.slide.eventPayload}get disabledNextClick(){return this._disabledNextClick}get cover(){return this._cover}mute(){this.slideApi.disableAudio()}unmute(){this.slideApi.enableAudio()}notifyTimerEnd(){this.slideApi.slideTimerEnd()}setTextInputResult(e,t){this.slideApi.setTextInputResult(e,t)}setShareComplete(e,t){this.slideApi.setShareComplete(e,t)}closeLegacyGoodsWidget(e){this.slideApi.setWidgetGoodsComplete(e)}async init(){if(this.state.inited)return;let e=this.story.needShowLoaderScreen,t=Date.now();const r=setTimeout(()=>{this.story.showLoaderScreen(),e=!0,t=Date.now()},500);let i=!1;try{const e=await this.slideApi.showSlide(this.html);if(i=e.result,!e.result)throw new Error(e.reason);this.commit({inited:!0}),this.debug(`${cr.Init} [Slide Lifecycle] inited: `)}catch(e){this.handleSlideError(e)}finally{clearTimeout(r),await this.cleanupLoaderIfNeeded(Date.now()-t,e),i&&(this._cover=this.getCoverByLayer())}}async start(){if(this.state.inited&&!this.state.started){try{await this.slideApi.slideStart({muted:this._story.muted}),this.story.touchController.on(jt.TouchEnd,this.handleTouchEnd)}catch(e){this.handleSlideError(e)}this.commit({started:!0}),this.debug(`${cr.Start} [Slide Lifecycle] started: `)}}async recover(){await this.init(),await this.start()}async restart(){try{this.story.hideErrorScreen(),this.story.showLoaderScreen(),await this.slideApi.slideRestart({muted:this._story.muted}),this.commit({inited:!0,started:!0,paused:!1})}catch(e){this.handleSlideError(e)}finally{this.story.hideLoaderScreen()}this.debug(`${cr.Restart} [Slide Lifecycle] restarted: `)}async resumeByApp(){if(this.state.paused){try{await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}this.commit({paused:!1}),this.debug(`${cr.Resume} [Slide Lifecycle] resume by app: `)}}async pauseByApp(){if(!this.state.paused){try{await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}this.debug(`${cr.Pause} [Slide Lifecycle] pause by app: `),this.commit({paused:!0})}}async resumeByUser(){if(this.state.paused){try{await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}this.commit({paused:!1}),this.debug(`${cr.Resume} [Slide Lifecycle] resume by user: `)}}async pauseByUser(){if(!this.state.paused){try{await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}this.commit({paused:!0}),this.debug(`${cr.Pause} [Slide Lifecycle] pause by user: `)}}async stop(e){this.state.started&&(await this.stopAndCleanup(e),1===e.prepareForRestart?this.commit({started:!1,paused:!1}):this.commit({started:!1,inited:!1,paused:!1}),this.debug(`${cr.Stop} [Slide Lifecycle] stopped: `))}async stopAndCleanup(e){try{this.story.touchController.off(jt.TouchEnd,this.handleTouchEnd),await this.slideApi.slideStop(e)}catch(e){this.handleSlideError(e)}}showLayerByIndex(e){this.slideApi.showLayer(e),this._cover=this.getCoverByLayer()}canGoNext(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"forward");return e}canGoPrev(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"backward");return e}async preload(e){if(!this.cacheManager||this.preloaded||this.isPreloading)return;this.isPreloading=!0;const t=this.slide.parseResources(),r=await this.cacheManager.preload(t.map(t=>({url:t,priority:e}))),i={};for(const e of r)i[e.url]=e;this.cacheManager.isDestroyed||this.slide.applyBlobUrls(t,i),this.preloaded=!0,this.isPreloading=!1}onClick({event:e,currentTarget:t,preventNavigation:r=!1}){if(e.target)try{e.preventDefault(),e.stopPropagation();const i=this.getNavigationDirection(e,t),{canClickNext:s}=this.slideApi.slideClickHandler(e.target,i>0?"forward":"backward");s&&!r&&this.navigate(i)}catch(e){console.error(e)}}async destroy(){try{this.cacheManager&&this.slide.restoreOriginalResourceUrls(),this.story.touchController.off(jt.TouchEnd,this.handleTouchEnd),this.commit({inited:!1,started:!1,paused:!1}),this.debug(`${cr.Destroy} [Slide Lifecycle] destroyed: `),await this.slideApi.slideStop({prepareForRestart:2})}catch(e){console.error(e)}}getNavigationDirection(e,t){const r=this.getClickPosition(e,t),i="ltr"===this.slideApi.layoutDirection?1:-1;return r>=.3?i:-i}getClickPosition(e,t){const r=t.getBoundingClientRect(),i=r.width;if(i<=0)return 0;let s;if(e instanceof MouseEvent)s=e.pageX-r.left;else{if(!(e.touches&&e.touches.length>0))return 0;s=e.touches[0].pageX-r.left}return Math.max(0,Math.min(1,s/i))}navigate(e){e>0?this.story.nextSlideOrStory():this.story.prevSlideOrStory()}handleSlideError(e){console.warn(e),this.story.showErrorScreen(),this.story.touchController.off(jt.TouchEnd,this.handleTouchEnd)}delay(e){return new Promise(t=>setTimeout(t,e))}async cleanupLoaderIfNeeded(e,t){t&&(await this.delay(Math.max(500-e,0)),this.story.hideLoaderScreen())}getCoverByLayer(){var e,t;const r=this.slideApi.activeLayer.nodeRef,i=null===(e=r.querySelector(".narrative-element-image img"))||void 0===e?void 0:e.src,s=null===(t=r.querySelector(".narrative-element-video video"))||void 0===t?void 0:t.getAttribute("poster-remote-src");return i||s||null}commit(e){Object.assign(this.state,e),this.state.inited||(this.state.started=!1,this.state.paused=!1),this.state.started||(this.state.paused=!1)}debug(e){g(e,{cardId:this.story.id,slideIndex:this.index})}},t=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;i=[f.observable],s=[f.observable],a=[f.action],or(e,null,i,{kind:"accessor",name:"_disabledNextClick",static:!1,private:!1,access:{has:e=>"_disabledNextClick"in e,get:e=>e._disabledNextClick,set:(e,t)=>{e._disabledNextClick=t}},metadata:t},n,l),or(e,null,s,{kind:"accessor",name:"_cover",static:!1,private:!1,access:{has:e=>"_cover"in e,get:e=>e._cover,set:(e,t)=>{e._cover=t}},metadata:t},c,d),or(e,null,a,{kind:"method",name:"commit",static:!1,private:!1,access:{has:e=>"commit"in e,get:e=>e.commit},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class hr{get index(){return 0}get navigationDisabled(){return!1}get timeline(){return{foreground:"",background:""}}get duration(){return 0}get screenshotShare(){return!1}get html(){return""}get eventPayload(){return{}}get disabledNextClick(){return!1}mute(){}unmute(){}notifyTimerEnd(){}setTextInputResult(e,t){}setShareComplete(e,t){}async init(){}async start(){}async restart(){}async stop(){}async resumeByApp(){}async pauseByApp(){}async resumeByUser(){}async pauseByUser(){}showLayerByIndex(e){}onClick(e){}closeLegacyGoodsWidget(e){}async destroy(){}canGoNext(){return!1}canGoPrev(){return!1}}var ur=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},pr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0};let gr=(()=>{var e;let t,r,i,s=[];return e=class{constructor(){Object.defineProperty(this,"refs",{enumerable:!0,configurable:!0,writable:!0,value:(ur(this,s),f.observable.map())})}get isPaused(){return this.refs.size>0}pause(e){var t;const r=null!==(t=this.refs.get(e))&&void 0!==t?t:0;this.refs.set(e,r+1)}resume(e){const t=this.refs.get(e);void 0!==t&&(t<=1?this.refs.delete(e):this.refs.set(e,t-1))}getActiveSources(){return Array.from(this.refs.keys())}clear(){this.refs.clear()}},(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[f.computed],r=[f.action],i=[f.action],pr(e,null,t,{kind:"getter",name:"isPaused",static:!1,private:!1,access:{has:e=>"isPaused"in e,get:e=>e.isPaused},metadata:a},null,s),pr(e,null,r,{kind:"method",name:"pause",static:!1,private:!1,access:{has:e=>"pause"in e,get:e=>e.pause},metadata:a},null,s),pr(e,null,i,{kind:"method",name:"resume",static:!1,private:!1,access:{has:e=>"resume"in e,get:e=>e.resume},metadata:a},null,s),a&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),e})();var fr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},mr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},yr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},vr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let br=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,h,u,p,g,m,y,v,b,w=[],S=[],_=[],O=[],k=[],x=[],C=[];return e=class{get _userPaused(){return yr(this,t,"f")}set _userPaused(e){vr(this,t,e,"f")}get _systemPause(){return yr(this,r,"f")}set _systemPause(e){vr(this,r,e,"f")}get _uiPause(){return yr(this,i,"f")}set _uiPause(e){vr(this,i,e,"f")}constructor(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:(fr(this,w),e)}),t.set(this,fr(this,S,!1)),r.set(this,(fr(this,_),fr(this,O,new gr))),i.set(this,(fr(this,k),fr(this,x,new gr))),fr(this,C),this.ctx=e}get isPaused(){return this._userPaused||this._systemPause.isPaused||this._uiPause.isPaused}get isAppPaused(){return this._systemPause.isPaused||this._uiPause.isPaused}get isSystemPaused(){return this._systemPause.isPaused}get isUIPaused(){return this._uiPause.isPaused}get isUserPaused(){return this._userPaused}pauseUser(){this.isAppPaused||(this._userPaused=!0)}resumeUser(){this.isAppPaused||(this._userPaused=!1)}pauseUI(e){this._uiPause.pause(e),this.ctx.notifyPauseStateChange()}resumeUI(e){this._uiPause.isPaused&&(this._uiPause.resume(e),this.ctx.notifyPauseStateChange())}pauseSystem(e){this._systemPause.pause(e),this.ctx.notifyPauseStateChange()}resumeSystem(e){this._systemPause.isPaused&&(this._systemPause.resume(e),this.ctx.notifyPauseStateChange())}resumeAll(){this.isPaused&&(this._uiPause.clear(),this._systemPause.clear(),this._userPaused=!1,this.ctx.notifyPauseStateChange())}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[f.observable],a=[f.observable],o=[f.observable],n=[f.computed],l=[f.computed],c=[f.computed],d=[f.computed],h=[f.computed],u=[f.action],p=[f.action],g=[f.action],m=[f.action],y=[f.action],v=[f.action],b=[f.action],mr(e,null,s,{kind:"accessor",name:"_userPaused",static:!1,private:!1,access:{has:e=>"_userPaused"in e,get:e=>e._userPaused,set:(e,t)=>{e._userPaused=t}},metadata:t},S,_),mr(e,null,a,{kind:"accessor",name:"_systemPause",static:!1,private:!1,access:{has:e=>"_systemPause"in e,get:e=>e._systemPause,set:(e,t)=>{e._systemPause=t}},metadata:t},O,k),mr(e,null,o,{kind:"accessor",name:"_uiPause",static:!1,private:!1,access:{has:e=>"_uiPause"in e,get:e=>e._uiPause,set:(e,t)=>{e._uiPause=t}},metadata:t},x,C),mr(e,null,n,{kind:"getter",name:"isPaused",static:!1,private:!1,access:{has:e=>"isPaused"in e,get:e=>e.isPaused},metadata:t},null,w),mr(e,null,l,{kind:"getter",name:"isAppPaused",static:!1,private:!1,access:{has:e=>"isAppPaused"in e,get:e=>e.isAppPaused},metadata:t},null,w),mr(e,null,c,{kind:"getter",name:"isSystemPaused",static:!1,private:!1,access:{has:e=>"isSystemPaused"in e,get:e=>e.isSystemPaused},metadata:t},null,w),mr(e,null,d,{kind:"getter",name:"isUIPaused",static:!1,private:!1,access:{has:e=>"isUIPaused"in e,get:e=>e.isUIPaused},metadata:t},null,w),mr(e,null,h,{kind:"getter",name:"isUserPaused",static:!1,private:!1,access:{has:e=>"isUserPaused"in e,get:e=>e.isUserPaused},metadata:t},null,w),mr(e,null,u,{kind:"method",name:"pauseUser",static:!1,private:!1,access:{has:e=>"pauseUser"in e,get:e=>e.pauseUser},metadata:t},null,w),mr(e,null,p,{kind:"method",name:"resumeUser",static:!1,private:!1,access:{has:e=>"resumeUser"in e,get:e=>e.resumeUser},metadata:t},null,w),mr(e,null,g,{kind:"method",name:"pauseUI",static:!1,private:!1,access:{has:e=>"pauseUI"in e,get:e=>e.pauseUI},metadata:t},null,w),mr(e,null,m,{kind:"method",name:"resumeUI",static:!1,private:!1,access:{has:e=>"resumeUI"in e,get:e=>e.resumeUI},metadata:t},null,w),mr(e,null,y,{kind:"method",name:"pauseSystem",static:!1,private:!1,access:{has:e=>"pauseSystem"in e,get:e=>e.pauseSystem},metadata:t},null,w),mr(e,null,v,{kind:"method",name:"resumeSystem",static:!1,private:!1,access:{has:e=>"resumeSystem"in e,get:e=>e.resumeSystem},metadata:t},null,w),mr(e,null,b,{kind:"method",name:"resumeAll",static:!1,private:!1,access:{has:e=>"resumeAll"in e,get:e=>e.resumeAll},metadata:t},null,w),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var wr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Sr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},_r=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Or=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let kr=(()=>{var e,t,r,i,s;let a,o,n,l,c,d,h,u,p,g,m=[],y=[],v=[],b=[],w=[],S=[],_=[],O=[],k=[];return e=class{get _hasShare(){return _r(this,t,"f")}set _hasShare(e){Or(this,t,e,"f")}get _hasFavorite(){return _r(this,r,"f")}set _hasFavorite(e){Or(this,r,e,"f")}get _hasLike(){return _r(this,i,"f")}set _hasLike(e){Or(this,i,e,"f")}get _height(){return _r(this,s,"f")}set _height(e){Or(this,s,e,"f")}constructor(e,a,o,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(wr(this,m),e)}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"sharePanel",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,wr(this,y,!1)),r.set(this,(wr(this,v),wr(this,b,!1))),i.set(this,(wr(this,w),wr(this,S,!1))),s.set(this,(wr(this,_),wr(this,O,0))),wr(this,k),this.storyManager=e,this.story=a,this.sharePanel=o,this.storyReaderStatisticV2Service=n}get model(){return this.story.model}get like(){return this.model.like}get favorite(){return this.model.favorite}get hasLike(){return this._hasLike&&!this.storyManager.config.anonymous}get hasShare(){return this._hasShare}get hasFavorite(){return this._hasFavorite&&!this.storyManager.config.anonymous}get hasAudio(){return Boolean(this.model.hasAudio)}get muted(){return this.story.muted}get needShown(){return this._hasLike||this._hasFavorite||this._hasShare||this.hasAudio}get height(){return this.needShown?this._height:0}async setLike(e){var t;if(this.like===e)return;const r=this.like;this.model.setLike(e);try{await this.storyManager.rootStore.storyStore.setStoryLike(this.story.id,e),this.model.setLike(e)}catch(e){this.model.setLike(r),console.error(e)}finally{const r=new Ki(this.story,{value:1===e});this.storyManager.emit(r.name,r.toJSON()),this.storyReaderStatisticV2Service.sendLikeEvent({storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}}async setDislike(e){var t;if(this.like===e)return;const r=this.like;this.model.setLike(e);try{await this.storyManager.rootStore.storyStore.setStoryLike(this.story.id,e),this.model.setLike(e)}catch(e){this.model.setLike(r),console.error(e)}finally{const r=new qi(this.story,{value:-1===e});this.storyManager.emit(r.name,r.toJSON()),this.storyReaderStatisticV2Service.sendDislikeEvent({storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}}async setBookmark(e){var t;if(this.favorite===e)return;const r=this.favorite;try{this.model.setFavorite(e),await this.storyManager.rootStore.storyStore.setStoryBookmark(this.model,e)}catch(e){console.error(e),this.model.setFavorite(r)}finally{const r=new Ji(this.story,{value:e});this.storyManager.emit(r.name,r.toJSON()),this.storyReaderStatisticV2Service.sendFavoriteEvent({storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}}async share(){var e,t;const r=new Zi(this.story);if(this.storyManager.emit(r.name,r.toJSON()),this.story.activeSlide.screenshotShare)return this.sharePanel.shareScreenShot({shareId:"slide-screenshot-share",hideElementsSelector:"",storySlide:this.story.activeSlide}),void this.storyReaderStatisticV2Service.sendShareEvent({mode:1,storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(e=this.story.feed)||void 0===e?void 0:e.slug});await this.performShareText(),this.storyReaderStatisticV2Service.sendShareEvent({mode:0,storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}mute(){this.story.mute()}unmute(){this.story.unmute()}setOptions(e){var t;this._hasLike=Boolean(this.model.likeFunctional)&&Boolean(e.hasLike),this._hasShare=Boolean(this.model.shareFunctional)&&Boolean(null===(t=this.storyManager.rootStore.sessionStore.session)||void 0===t?void 0:t.share)&&Boolean(e.hasShare),this._hasFavorite=Boolean(this.model.favoriteFunctional)&&Boolean(e.hasFavorite)}setActionPanelHeight(e){this._height=50+e}async performShareText(){try{const e=await this.storyManager.rootStore.storyStore.fetchSharePathByStory(this.model);if(!e)return;this.model.setShareUrl(e);const t=new Qi(this.story,{url:e});this.storyManager.emit(t.name,t.toJSON());const r={title:this.story.title,text:"",url:e};this.sharePanel.shareText({shareId:"story-share",config:r,storySlide:this.story.activeSlide})}catch(e){console.error(e)}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;a=[f.observable],o=[f.observable],n=[f.observable],l=[f.observable],c=[f.computed],d=[f.computed],h=[f.action],u=[f.action],p=[f.action],g=[f.action],Sr(e,null,a,{kind:"accessor",name:"_hasShare",static:!1,private:!1,access:{has:e=>"_hasShare"in e,get:e=>e._hasShare,set:(e,t)=>{e._hasShare=t}},metadata:t},y,v),Sr(e,null,o,{kind:"accessor",name:"_hasFavorite",static:!1,private:!1,access:{has:e=>"_hasFavorite"in e,get:e=>e._hasFavorite,set:(e,t)=>{e._hasFavorite=t}},metadata:t},b,w),Sr(e,null,n,{kind:"accessor",name:"_hasLike",static:!1,private:!1,access:{has:e=>"_hasLike"in e,get:e=>e._hasLike,set:(e,t)=>{e._hasLike=t}},metadata:t},S,_),Sr(e,null,l,{kind:"accessor",name:"_height",static:!1,private:!1,access:{has:e=>"_height"in e,get:e=>e._height,set:(e,t)=>{e._height=t}},metadata:t},O,k),Sr(e,null,c,{kind:"getter",name:"needShown",static:!1,private:!1,access:{has:e=>"needShown"in e,get:e=>e.needShown},metadata:t},null,m),Sr(e,null,d,{kind:"getter",name:"height",static:!1,private:!1,access:{has:e=>"height"in e,get:e=>e.height},metadata:t},null,m),Sr(e,null,h,{kind:"method",name:"setLike",static:!1,private:!1,access:{has:e=>"setLike"in e,get:e=>e.setLike},metadata:t},null,m),Sr(e,null,u,{kind:"method",name:"setDislike",static:!1,private:!1,access:{has:e=>"setDislike"in e,get:e=>e.setDislike},metadata:t},null,m),Sr(e,null,p,{kind:"method",name:"setBookmark",static:!1,private:!1,access:{has:e=>"setBookmark"in e,get:e=>e.setBookmark},metadata:t},null,m),Sr(e,null,g,{kind:"method",name:"share",static:!1,private:!1,access:{has:e=>"share"in e,get:e=>e.share},metadata:t},null,m),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var xr,Cr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Pr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},jr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Er=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Close="closeGoodsWidget",e.Open="openGoodsWidget"}(xr||(xr={}));let Ir=(()=>{var e,t;let r,i=s.EventEmitter,a=[],o=[];return e=class extends i{get params(){return jr(this,t,"f")}set params(e){Er(this,t,e,"f")}constructor(e,r,i){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),t.set(this,Pr(this,a,{elementId:"",target:""})),Pr(this,o),this.storyManager=e,this.story=r,this.storyReaderStatisticV2Service=i}close(){this.story.touchController.enable(),this.story.resumeUI(this),this.story.activeSlide.closeLegacyGoodsWidget(this.params.elementId),this.emit(xr.Close)}open(e){var t;this.story.touchController.disable(),this.story.pauseUI(this),this.params=e,this.emit(xr.Open,e),this.storyManager.emit("widgetEvent",{name:"w-goods-open",data:{story_id:this.story.id,slide_index:this.story.activeSlideIndex,widget_id:e.elementId,skus:this.parseGoodsSkus(e.target)}}),this.storyReaderStatisticV2Service.sendEvent(new Es({widget_id:null!==(t=e.elementId)&&void 0!==t?t:""}),!0)}onClick(e){var t;this.storyManager.emit("widgetEvent",{name:"w-goods-click",data:{story_id:this.story.id,slide_index:this.story.activeSlideIndex,widget_id:this.params.elementId,widget_value:e.sku}}),this.storyReaderStatisticV2Service.sendEvent(new js({widget_id:null!==(t=this.params.elementId)&&void 0!==t?t:"",widget_value:e.sku}),!0)}parseGoodsSkus(e){try{return JSON.parse(e)}catch(e){return[]}}},t=new WeakMap,(()=>{var t;const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=i[Symbol.metadata])&&void 0!==t?t:null):void 0;r=[f.observable],Cr(e,null,r,{kind:"accessor",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params,set:(e,t)=>{e.params=t}},metadata:s},a,o),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();var Tr;!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(Tr||(Tr={}));class Ar extends s.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"currentProgress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progressBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timerPaused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"rafId",{enumerable:!0,configurable:!0,writable:!0,value:0})}get started(){return!this.isCompleted}get paused(){return this.timerPaused}setTimer(e){0!==e?(this.timerId=setTimeout(()=>this.complete({}),e),this.currentProgress=0,this.runTimerTicks(e)):this.forceEnd()}start(e){this.timerPaused||(this.stop(),this.progressBeforePause=0,this.timeout=e,this.enabled&&(this.isCompleted=!1,this.emit(Tr.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(Tr.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(Tr.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(Tr.Resume)}forceEnd(){this.complete({forceEnd:!0})}disable(){this.enabled=!1,this.stop()}enable(){this.enabled=!0,this.start(this.timeout)}complete({forceEnd:e=!1}){this.isCompleted=!0,this.progressBeforePause=0,this.clearTimer(),this.emit(Tr.Complete,{forceEnd:e})}clearTimer(){cancelAnimationFrame(this.rafId),null!==this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}updateProgress(e){const t=1-this.progressBeforePause;this.currentProgress=this.progressBeforePause+e*t;const r=100*this.currentProgress;this.emit(Tr.Progress,r)}runTimerTicks(e){let t=performance.now();const r=i=>{let s=(i-t)/e;s>1&&(s=1);let a=s;this.updateProgress(a),s<1&&(this.rafId=requestAnimationFrame(r))};this.rafId=requestAnimationFrame(r)}}var Mr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Lr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Rr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Br=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Dr=(()=>{var e,t;let r,i,s,a,o=[],n=[],l=[];return e=class{get _hiddenTimeline(){return Rr(this,t,"f")}set _hiddenTimeline(e){Br(this,t,e,"f")}constructor(e){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:(Mr(this,o),e)}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new Ar}),t.set(this,Mr(this,n,!1)),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:(Mr(this,l),({forceEnd:e})=>{e||this.story.activeSlide.notifyTimerEnd()})}),this.timer.on(Tr.Complete,this.handleTimerComplete)}get hiddenTimeline(){return 1===this.story.slides.length&&0===this.story.slides[0].duration||this.story.model.hideTimeline||this._hiddenTimeline}get paused(){return this.timer.paused}hide(){this._hiddenTimeline=!0}show(){this._hiddenTimeline=!1}destroy(){this.timer.off(Tr.Complete,this.handleTimerComplete)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.computed],s=[f.action],a=[f.action],Lr(e,null,r,{kind:"accessor",name:"_hiddenTimeline",static:!1,private:!1,access:{has:e=>"_hiddenTimeline"in e,get:e=>e._hiddenTimeline,set:(e,t)=>{e._hiddenTimeline=t}},metadata:t},n,l),Lr(e,null,i,{kind:"getter",name:"hiddenTimeline",static:!1,private:!1,access:{has:e=>"hiddenTimeline"in e,get:e=>e.hiddenTimeline},metadata:t},null,o),Lr(e,null,s,{kind:"method",name:"hide",static:!1,private:!1,access:{has:e=>"hide"in e,get:e=>e.hide},metadata:t},null,o),Lr(e,null,a,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Nr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Fr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ur=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Gr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Vr=(()=>{var e,t,r,i;let s,a,o,n=[],l=[],c=[],d=[],h=[],u=[];return e=class{get _isOpened(){return Ur(this,t,"f")}set _isOpened(e){Gr(this,t,e,"f")}get _id(){return Ur(this,r,"f")}set _id(e){Gr(this,r,e,"f")}get _config(){return Ur(this,i,"f")}set _config(e){Gr(this,i,e,"f")}constructor(e,s){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,Fr(this,n,!1)),r.set(this,(Fr(this,l),Fr(this,c,null))),i.set(this,(Fr(this,d),Fr(this,h,null))),Fr(this,u),this.story=e,this.storyReaderStatisticV2Service=s}get id(){return this._id}get config(){return this._config}get isOpened(){return this._isOpened}show(e,t){this._id=e,this._config=t,this._isOpened=!0,this.storyReaderStatisticV2Service.sendEvent(new Is({widget_id:e,widget_label:String(t.configV2.main.question.text.value).trim()}),!0)}completeInput(e){this._id&&this._config&&this.storyReaderStatisticV2Service.sendEvent(new Ts({widget_id:this._id,widget_label:String(this._config.configV2.main.question.text.value).trim(),widget_value:e}),!0)}close(){this._config=null,this._isOpened=!1}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[f.observable],a=[f.observable],o=[f.observable],Nr(e,null,s,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:t},n,l),Nr(e,null,a,{kind:"accessor",name:"_id",static:!1,private:!1,access:{has:e=>"_id"in e,get:e=>e._id,set:(e,t)=>{e._id=t}},metadata:t},c,d),Nr(e,null,o,{kind:"accessor",name:"_config",static:!1,private:!1,access:{has:e=>"_config"in e,get:e=>e._config,set:(e,t)=>{e._config=t}},metadata:t},h,u),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const zr=310/480,Wr=428/805;var $r,Hr,qr=j(6166),Jr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Kr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Zr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Qr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Started="started"}($r||($r={})),function(e){e.Prefetch="🔄",e.Init="🔧",e.Start="🟢",e.Stop="🛑",e.Attach="🔗",e.Detach="🗑️"}(Hr||(Hr={}));let Yr=(()=>{var e,t,r,i,s,a;let n,l,c,d,h,u,p,g,m,y,v,b,w,S,_,O,x,C,P,j,E,I=o,T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[];return e=class extends I{get _activeSlideIndex(){return Zr(this,t,"f")}set _activeSlideIndex(e){Qr(this,t,e,"f")}get _slides(){return Zr(this,r,"f")}set _slides(e){Qr(this,r,e,"f")}get _needShowErrorScreen(){return Zr(this,i,"f")}set _needShowErrorScreen(e){Qr(this,i,e,"f")}get _needShowLoaderScreen(){return Zr(this,s,"f")}set _needShowLoaderScreen(e){Qr(this,s,e,"f")}get _$root(){return Zr(this,a,"f")}set _$root(e){Qr(this,a,e,"f")}constructor(e,o,n,l,c,d,h){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Jr(this,T),e)}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"storySlideApiHandlersFactory",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"statisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"statisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:d}),Object.defineProperty(this,"cacheManager",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,Jr(this,A,0)),r.set(this,(Jr(this,M),Jr(this,L,[]))),i.set(this,(Jr(this,R),Jr(this,B,!1))),s.set(this,(Jr(this,D),Jr(this,N,!1))),a.set(this,(Jr(this,F),Jr(this,U,null))),Object.defineProperty(this,"_activeSlideStartTime",{enumerable:!0,configurable:!0,writable:!0,value:(Jr(this,G),0)}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pauseManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textInput",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sharePanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"actionPanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"goodsWidget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new qr.Mutex}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:f.observable.object({attached:!1,inited:!1,started:!1,prefetched:!1})}),Object.defineProperty(this,"isLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleKeydown",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.handleSpaceKeydown(e),this.handleMKeydown(e)}}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{document.hidden?this.pauseSystem(this):this.resumeSystem(this)}}),this.pauseManager=new br(this),this.touchController=this.storyReader.touchController,this.slideApiHandlers=this.storySlideApiHandlersFactory.create(this),this.goodsWidget=new Ir(this.storyManager,this,this.statisticV2Service),this.textInput=new Vr(this,this.statisticV2Service),this.timeline=new Dr(this),this.sharePanel=new sr(this.storyManager,this,this.storyReader.touchController),this.actionPanel=new kr(this.storyManager,this,this.sharePanel,this.statisticV2Service),this.isLoaded=this.story.canBeShown&&this.story.slides.length>0}get needShowErrorScreen(){return this._needShowErrorScreen||Boolean(this.error)}get needShowLoaderScreen(){return this.isLoaded?!this.slides.length||this._needShowLoaderScreen:!this.slides.length||!this.state.inited||this._needShowLoaderScreen}get id(){return this.story.id}get slides(){return this._slides}get $root(){return this._$root}get title(){return this.story.title}get statTitle(){return this.story.statTitle}get ugcPayload(){return this.story.ugcPayload}get displayStrategy(){return this.storyReader.displayStrategy}get context(){return this.story.context}get feed(){return this.storyReader.feed}get wasShown(){return this.story.wasShown}get model(){return this.story}get activeSlideIndex(){return this._activeSlideIndex}get activeSlide(){return this.getSlideByIndex(this._activeSlideIndex)}get activeSlideDuration(){return Date.now()-this._activeSlideStartTime}get slidesCount(){return this.story.slidesCount}get reachEnd(){return 0===this.slides.length||this.activeSlideIndex===this.slides.length-1}get reachStart(){return 0===this.activeSlideIndex}get disableClose(){return this.story.disableClose}get error(){return this.story.error}get pauseState(){return{isUserPaused:this.pauseManager.isUserPaused,isUIPaused:this.pauseManager.isUIPaused,isSystemPaused:this.pauseManager.isSystemPaused}}get muted(){return this.storyReader.muted}get isOpened(){return this.story.isOpened}get dir(){return this.storyReader.dir}get isSlideRendered(){return this.state.inited}get cover(){return this.activeSlide.cover}get isNextDisabled(){return this.storyReader.reachEnd&&this.reachEnd||this.activeSlide.disabledNextClick||this.activeSlide.navigationDisabled||this.pauseManager.isUIPaused}get isPrevDisabled(){return this.storyReader.reachStart&&this.reachStart||this.activeSlide.navigationDisabled||this.pauseManager.isUIPaused}nextSlide(){this.reachEnd||this.showSlide(this.activeSlideIndex+1)}prevSlide(){this.reachStart||this.showSlide(this.activeSlideIndex-1)}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}getSlideByIndex(e){var t;return null!==(t=this.slides[e])&&void 0!==t?t:new hr}async showSlide(e){var t;if(null===(t=this.toast)||void 0===t||t.destroy(),this.activeSlideIndex===e)return void await this.activeSlide.restart();const r=this.activeSlideIndex;await this.onSlideChange(e),this.emitSlideV1Stat(this.activeSlideIndex),this.emitSlideV2Stat(r,this.activeSlideDuration)}markAsOpened(){this.storyManager.rootStore.storyStore.markIsOpenedById(this.story.id)}markWasShown(){this.story.markWasShown()}setError(e){this.story.setError(e),e&&this.handleStoryError(e)}async reset(){this.textInput.close(),await this.slideApiHandlers.resetStory(this.id)}async recover(){const e=Boolean(this.error);this.hideErrorScreen(),this.showLoaderScreen();try{e?await this.storyReader.reloadStory(this):(await this.activeSlide.recover(),this._activeSlideStartTime=Date.now())}catch(e){console.error(e)}}nextSlideOrStory(){this.reachEnd?this.storyReader.nextStoryWithAnimation():this.nextSlide()}async prevSlideOrStory(){if(this.reachStart&&this.storyReader.reachStart){if(!this.state.started)return;await this.activeSlide.restart()}else this.reachStart?this.storyReader.prevStoryWithAnimation():this.prevSlide()}mute(){this.storyReader.mute(),this.activeSlide.mute()}unmute(){this.storyReader.unmute(),this.activeSlide.unmute()}showLayer(e){var t;this.statisticV2Service.sendSlideLayout({layoutIndex:e,storyId:this.id,activeSlideIndex:this.activeSlideIndex,feedSlug:null===(t=this.feed)||void 0===t?void 0:t.slug}),this.resumeUser(),this.activeSlide.showLayerByIndex(e)}pauseUser(){this.timeline.paused||(this.pauseManager.pauseUser(),this.pauseManager.isUserPaused&&this.activeSlide.pauseByUser())}resumeUser(){this.pauseManager.resumeUser(),this.pauseManager.isUserPaused||this.activeSlide.resumeByUser()}pauseUI(e){this.pauseManager.pauseUI(e)}resumeUI(e){this.pauseManager.resumeUI(e)}pauseSystem(e){this.pauseManager.pauseSystem(e)}resumeSystem(e){this.pauseManager.resumeSystem(e)}resumeAll(){this.pauseManager.resumeAll()}async updateNarrativeData(e){await this.storyManager.rootStore.storyStore.updateNarrativeData(this.id,e)}async detach(e){var t,r;if(!e.container&&this.state.attached){this._$root=null,null===(t=this.toast)||void 0===t||t.destroy(),this.slideApiHandlers.clearSlideSession(),this.resumeAll(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),null===(r=this.slideApi)||void 0===r||r.destroy();for(const e of this._slides)await e.destroy();this.debug(`${Hr.Detach} [Story Lifecycle] detached: `),this.commit({attached:!1,inited:!1,started:!1})}}async attach(e){e.container&&!this.state.attached&&(this._$root=e.container,await(0,f.when)(()=>this.story.canBeShown&&Boolean(this.story.slides.length)),this.slideApi=this.createSlideApi(e.container),this.createSlidesViewModels(this.story.slides,this.slideApi),this.debug(`${Hr.Attach} [Story Lifecycle] attached: `),this.commit({attached:!0}))}async prefetch(e){e.canBeInited&&!this.state.prefetched&&(this===e.activeStory?await this.preload(1e3):await this.preload(0,2),this.debug(`${Hr.Prefetch} [Story Lifecycle] prefetched: `),this.commit({prefetched:!0}))}async preload(e=1e3,t=this.slidesCount){const r=this.storyManager.config.cache;r&&(r.prefetch?await this.preloadSlides(0,t,e):await this.preloadActiveSlide(e))}async preloadSlides(e,t,r){t=null!=t?t:this._slides.length,r=null!=r?r:0,await Promise.all(this._slides.slice(e,t).map((e,i)=>e.preload(t-i+r)))}async preloadActiveSlide(e){this.preloadSlides(this._activeSlideIndex,this._activeSlideIndex+1,e)}async init(e){e.canBeInited&&this.state.attached&&!this.state.inited&&(await this.activeSlide.init(),this.debug(`${Hr.Init} [Story Lifecycle] inited: `),this.commit({inited:!0}),this.isLoaded=!0)}async start(e){e.canBeStarted&&this.state.inited&&!this.state.started&&(this.emit($r.Started),await this.activeSlide.start(),document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("keydown",this.handleKeydown),this._activeSlideStartTime=Date.now(),this.debug(`${Hr.Start} [Story Lifecycle] started: `),this.commit({started:!0}))}async stop(e){var t;!e.canBeStarted&&this.state.started&&(null===(t=this.toast)||void 0===t||t.destroy(),this.slideApiHandlers.clearSlideSession(),this.resumeAll(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),await this.activeSlide.stop({prepareForRestart:1}),this.debug(`${Hr.Stop} [Story Lifecycle] stopped: `),this.commit({started:!1}))}canGoNext(){return this.activeSlide.canGoNext()}canGoPrev(){return this.activeSlide.canGoPrev()}showToast(e){var t;null===(t=this.toast)||void 0===t||t.destroy(),this.toast=new Bt(Object.assign(Object.assign({},e),{mountPoint:this.$root})),this.toast.show(e.content)}async destroy(){var e,t;document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),this.sharePanel.close(),this.textInput.close(),this.timeline.destroy(),this.goodsWidget.close(),this.slideApiHandlers.clearSlideSession(),null===(e=this.slideApi)||void 0===e||e.destroy(),null===(t=this.toast)||void 0===t||t.destroy()}notifyPauseStateChange(){this.pauseManager.isUserPaused||(this.pauseManager.isAppPaused?this.activeSlide.pauseByApp():this.activeSlide.resumeByApp())}emitSlideV2Stat(e,t){var r;this.statisticV2Service.sendSlideEvent({durationMs:t,storyId:this.id,activeSlideIndex:e,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}emitSlideV1Stat(e){const t=new Yi(this);this.storyManager.emit(t.name,t.toJSON()),this.statisticV1Service.sendOpenStoryEvent({storyId:this.id,slideIndex:e})}createSlideApi(e){const t=new Wt.SlideApi(this.slideApiHandlers,{root:e,slideRatio:zr,isFullscreen:!1,nonce:k(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:this.actionPanel.height,useSdkCacheForMultislideMode:!1});return t.setSdkClientVariables(this.storyManager.config.options),t}async createSlidesViewModels(e,t){this._slides=e.map((e,r)=>new dr(this,r,t,e,this.cacheManager))}handleSpaceKeydown(e){"Space"===e.code&&(this.pauseState.isUserPaused?this.resumeUser():this.pauseUser())}handleMKeydown(e){"KeyM"===e.code&&(this.muted?this.unmute():this.mute())}async onSlideChange(e){var t;try{const r=this.getSlideByIndex(this._activeSlideIndex),i=this.getSlideByIndex(e);this._activeSlideIndex=e,this.hideErrorScreen(),this.resumeAll(),(null===(t=this.storyManager.config.cache)||void 0===t?void 0:t.prefetch)||await this.preloadActiveSlide(1e3),await(null==r?void 0:r.stop({prepareForRestart:2})),await i.init(),await i.start(),this._activeSlideStartTime=Date.now()}catch(e){console.error(e)}}handleStoryError(e){const t=new es({id:this.id,title:this.title,name:e.name,message:e.message});this.storyManager.emit(t.name,t.toJSON())}async update(e){try{await this.mutex.runExclusive(async()=>{await this.detach(e),await this.attach(e),await this.prefetch(e),await this.init(e),await this.stop(e),await this.start(e)})}catch(e){console.error(e)}}commit(e){Object.assign(this.state,e),this.state.attached||(this.state.inited=!1,this.state.started=!1,this.state.prefetched=!1),this.state.inited||(this.state.started=!1,this.state.prefetched=!1)}debug(e){}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=I[Symbol.metadata])&&void 0!==t?t:null):void 0;n=[f.observable],l=[f.observable],c=[f.observable],d=[f.observable],h=[f.observable],u=[f.computed],p=[f.computed],g=[f.computed],m=[f.computed],y=[f.computed],v=[(t=f.computed).struct.bind(t)],b=[f.computed],w=[f.computed],S=[f.action],_=[f.action],O=[f.action],x=[f.action],C=[f.action],P=[f.action],j=[f.action],E=[f.action],Kr(e,null,n,{kind:"accessor",name:"_activeSlideIndex",static:!1,private:!1,access:{has:e=>"_activeSlideIndex"in e,get:e=>e._activeSlideIndex,set:(e,t)=>{e._activeSlideIndex=t}},metadata:r},A,M),Kr(e,null,l,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:r},L,R),Kr(e,null,c,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:r},B,D),Kr(e,null,d,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:r},N,F),Kr(e,null,h,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:r},U,G),Kr(e,null,u,{kind:"getter",name:"needShowErrorScreen",static:!1,private:!1,access:{has:e=>"needShowErrorScreen"in e,get:e=>e.needShowErrorScreen},metadata:r},null,T),Kr(e,null,p,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:r},null,T),Kr(e,null,g,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:r},null,T),Kr(e,null,m,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,T),Kr(e,null,y,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,T),Kr(e,null,v,{kind:"getter",name:"pauseState",static:!1,private:!1,access:{has:e=>"pauseState"in e,get:e=>e.pauseState},metadata:r},null,T),Kr(e,null,b,{kind:"getter",name:"isNextDisabled",static:!1,private:!1,access:{has:e=>"isNextDisabled"in e,get:e=>e.isNextDisabled},metadata:r},null,T),Kr(e,null,w,{kind:"getter",name:"isPrevDisabled",static:!1,private:!1,access:{has:e=>"isPrevDisabled"in e,get:e=>e.isPrevDisabled},metadata:r},null,T),Kr(e,null,S,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,T),Kr(e,null,_,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,T),Kr(e,null,O,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,T),Kr(e,null,x,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,T),Kr(e,null,C,{kind:"method",name:"showSlide",static:!1,private:!1,access:{has:e=>"showSlide"in e,get:e=>e.showSlide},metadata:r},null,T),Kr(e,null,P,{kind:"method",name:"markAsOpened",static:!1,private:!1,access:{has:e=>"markAsOpened"in e,get:e=>e.markAsOpened},metadata:r},null,T),Kr(e,null,j,{kind:"method",name:"markWasShown",static:!1,private:!1,access:{has:e=>"markWasShown"in e,get:e=>e.markWasShown},metadata:r},null,T),Kr(e,null,E,{kind:"method",name:"commit",static:!1,private:!1,access:{has:e=>"commit"in e,get:e=>e.commit},metadata:r},null,T),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();var Xr,ei=j(9498),ti=j.n(ei);class ri{async openGame({gameInstanceId:e,gameOptions:t}){const r={};t&&ti()(t)&&null!=t.demoMode&&(r.demoMode=Boolean(t.demoMode));return(await ra.post(`game/${e}/launch`,r,{params:{expand:"config",fields:"splashScreen,splashLandscapeScreen,splashLottieScreen,screenOptions,config,resources,url,downloadUrl,instanceUserData,canTryReloadCount,loggerLevel,lottie,languageDirection"}})).data}}!function(e){e.Close="closeReader",e.OpenSharePanel="openSharePanel",e.StartGame="startGame",e.CloseGame="closeGame",e.EventGame="eventGame",e.RestartGame="restartGame",e.ErrorGame="errorGame"}(Xr||(Xr={}));const ii=new class{constructor(){Object.defineProperty(this,"_apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:"https://api.inappstory.ru"})}get apiUrl(){return this._apiUrl}parseAndDefine(e){const t=this.parseApiKey(e);return t&&(this._apiUrl=t),this._apiUrl}parseApiKey(e){if(!this.isValidApiKey(e))return null;try{const t=this.base64urlDecode(e),r=this.readHostLength(t);if(r>0){const e=this.readHostData(t,r),i=this.expandMask("{QQN{xuV?1Dv16j3",r),s=this.xorDecrypt(e,i,r),a=new URL(this.ensureHttps(s));return this.trimEndSlash(a.toString())}}catch(e){console.error(e)}return null}isValidApiKey(e){return e&&e.length>32}readHostLength(e){return e.charCodeAt(13)}readHostData(e,t){return e.slice(14,14+t).replace(/\0+$/,"")}xorDecrypt(e,t,r){let i="";for(let s=0;s<r;s++)i+=String.fromCharCode(e.charCodeAt(s)^t.charCodeAt(s));return i}ensureHttps(e){const t=e.trim();return t.startsWith("https://")?t:t.startsWith("http://")?"https://"+t.slice(7):"https://"+t}expandMask(e,t){let r=e,i=0;for(;r.length<t;)r+=e[i],i=(i+1)%e.length;return r}base64urlDecode(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=this.padRight(t);return window.atob(r)}padRight(e){const t=e.length%4;return 0===t?e:e+"=".repeat(4-t)}trimEndSlash(e){return e.replace(/\/$/,"")}};var si;!function(e){e.TEXT="text",e.IMAGE="image"}(si||(si={}));class ai{constructor(e){var t;Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lang",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appPackageId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sdkVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiBaseUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userAgent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placeholders",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const r=this.storyManager.config,i=this.storyManager.rootStore.placeholderStore.placeholders,s=this.storyManager.rootStore.sessionStore.session;this.sessionId=s.id,this.userKey=s.userKey,this.apiKey=r.apiKey,this.sdkVersion="1.14.0",this.apiBaseUrl=ii.apiUrl,this.userAgent=e.userAgent,this.appPackageId=r.appPackageId,this.deviceId=ee.deviceId,this.userId=null!==(t=r.userId)&&void 0!==t?t:"",this.lang=r.lang.toString(),this.placeholders=i.map(e=>this.mapPlaceholder(e))}mapPlaceholder(e){return{type:this.mapPlaceholderType(e.type),name:e.key,value:e.value}}mapPlaceholderType(e){switch(e){case ae.TEXT:return si.TEXT;case ae.IMAGE:return si.IMAGE}}toJSON(){return{sessionId:this.sessionId,lang:this.lang,apiKey:this.apiKey,userKey:this.userKey,appPackageId:this.appPackageId,deviceId:this.deviceId,userId:this.userId,sdkVersion:this.sdkVersion,apiBaseUrl:this.apiBaseUrl,userAgent:this.userAgent,placeholders:this.placeholders}}}class oi{constructor(e){Object.defineProperty(this,"rawData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"gameInstanceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.gameInstanceId=e.gameInstanceId,this.rawData=e}toJSON(){return this.rawData}}class ni{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.key=e.key,this.sha1=e.sha1}}class li{constructor(e){Object.defineProperty(this,"fullScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"widescreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fullScreen=e.fullScreen,this.widescreen=e.widescreen,this.orientation=e.orientation}}class ci{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.sha1=e.sha1}}class di{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"durationMinimalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.sha1=e.sha1,this.durationMinimalMs=e.durationMinimalMs}}class hi{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.sha1=e.sha1}}class ui{constructor(e,t,r,i){var s,a,o,n;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"gameDto",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"splashScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"splashLandscapeScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"splashLottieScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"screenOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resources",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"downloadUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"instanceUserData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"canTryReloadCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"loggerLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lottie",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"languageDirection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.splashScreen=r.splashScreen?new hi(r.splashScreen):void 0,this.splashLandscapeScreen=r.splashLandscapeScreen?new ci(r.splashLandscapeScreen):void 0,this.splashLottieScreen=r.splashLottieScreen?new di(r.splashLottieScreen):void 0,this.screenOptions=new li(r.screenOptions),this.config=new oi(r.config),this.resources=null!==(a=null===(s=r.resources)||void 0===s?void 0:s.map(e=>new ni(e)))&&void 0!==a?a:[],this.url=r.url,this.downloadUrl=r.downloadUrl,this.instanceUserData=r.instanceUserData,this.clientConfig=new ai(t),this.canTryReloadCount=r.canTryReloadCount,this.loggerLevel=r.loggerLevel,this.lottie=r.lottie?{src:r.lottie.src}:void 0;const l=null!==(n=null===(o=r.languageDirection)||void 0===o?void 0:o.toLowerCase())&&void 0!==n?n:"auto";this.languageDirection="auto"===l?this.storyManager.config.dir:l}toInitDto(e){return Tt()(this.config.toJSON(),{clientConfig:Object.assign({fullScreen:this.isReaderInFullscreen(),screenOrientation:this.screenOptions.orientation,variables:this.storyManager.config.options,safeAreaInsets:e.safeAreaInsets,widescreen:e.isWidescreen,dir:this.languageDirection,nonce:k(),sdkFeatures:{gameShouldForegroundCallback:!0,writeToClipboard:!0}},this.clientConfig.toJSON())})}isReaderInFullscreen(){var e;const t=Boolean(null===(e=this.storyManager.config.hybridApp)||void 0===e?void 0:e.fullscreen);return Boolean(this.screenOptions.fullScreen)&&t}}class pi extends Error{constructor(e,t){super(e),Object.defineProperty(this,"canTryReload",{enumerable:!0,configurable:!0,writable:!0,value:t})}}class gi extends Error{constructor(){super("[IAS]: game foreground timeout exceeded 60 seconds")}}class fi extends s.EventEmitter{constructor(e,t){super(),Object.defineProperty(this,"iframe",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"origin",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.messageListener=this.messageListener.bind(this),window.addEventListener("message",this.messageListener,!1)}open(e){return new Promise((t,r)=>{this.once("gameLoadFailed",(e,t)=>{r(new pi(e,t))}),this.once("gameLoaded",()=>t()),this.sendMessage("cb",{cb:"initGame",arguments:JSON.stringify([e])})})}waitForeground(e=6e4){return new Promise((t,r)=>{let i=null;const s=e=>{var r;a();const i=null!==(r=X(e))&&void 0!==r?r:{};t("object"==typeof i?i:{})},a=()=>{i&&(clearTimeout(i),i=null),this.off("gameShouldForegroundCallback",s)};this.once("gameShouldForegroundCallback",s),i=setTimeout(()=>{a(),r(new gi)},e)})}close(){window.removeEventListener("message",this.messageListener,!1),this.removeAllListeners()}sendMessage(e,t){var r;null===(r=this.iframe.contentWindow)||void 0===r||r.postMessage([e,t],this.origin)}pauseGameUI(){this.sendMessage("cb",{cb:"pauseUI",arguments:JSON.stringify([])})}resumeGameUI(){this.sendMessage("cb",{cb:"resumeUI",arguments:JSON.stringify([])})}shareComplete(e,t){this.sendMessage("shareComplete",{id:e,isSuccess:t})}closeGameReader(){this.sendMessage("closeGameReader")}sendGameCenterEventByApiRequest(e,t){this.sendMessage("cb",{cb:e,plainData:t})}notifyGameCanBeStarted(){this.sendMessage("gameShouldForeground")}messageListener(e){if(e.origin===this.origin)try{if(!Array.isArray(e.data))return void console.warn(`[IAS]: Invalid game MessageEvent data format ${e.data}`);const[t,...r]=e.data;this.emit(t,...r)}catch(e){console.error(e)}}}class mi{create(e,t){return new fi(e,t)}}class yi{attach(e,t){e.on("sendApiRequest",async t=>{let r,i,s;try{const a=X(t);r=a.id,i=a.data,s=a.cb,await ra.request({url:a.url,method:a.method,params:a.params,data:a.data,headers:a.headers}).catch(console.error),e.sendGameCenterEventByApiRequest(s,JSON.stringify({requestId:r,data:JSON.stringify(i.data),status:i.status,headers:i.headers}))}catch(t){if(t instanceof SyntaxError)return;if(!s)return;e.sendGameCenterEventByApiRequest(s,JSON.stringify({requestId:r,data:JSON.stringify(t),status:400,headers:[{}]}))}})}}class vi{attach(e,t){e.on("writeToClipboard",e=>{var t;try{const{textValue:r}=null!==(t=X(e))&&void 0!==t?t:{textValue:""};(new p).copy(r)}catch(e){console.error("[IAS]: ",e.message)}})}}class bi{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}attach(e,t){e.on("event",(e,t)=>{this.storyManager.emit("gameEvent",{name:e,payload:t}),this.storyManager.emit(Xr.EventGame,{name:e,payload:t})})}}class wi{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}attach(e,t){e.on("openUrl",e=>{var r;const{url:i}=null!==(r=X(e))&&void 0!==r?r:{url:""},s={src:Ct.GameReader,data:{id:t.id,url:i,gameInstanceId:t.id}};this.storyManager.storyLinkClickHandler(s),this.storyManager.emit("clickOnButton",s)})}}class Si{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"shareNotifier",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"handleShare",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{var r;const i=this.getFilteredConfigDto(t);let s=null!==(r=null==i?void 0:i.url)&&void 0!==r?r:"";try{const r=await this.getShareFiles(t);if(i.files=r.length>0?r:void 0,Y)return void this.openSharePanel({shareConfig:i,shareLink:s,shareId:e,shareText:i.text});await this.startNativeSharing(e,i)}catch(t){this.openSharePanel({shareConfig:i,shareLink:s,shareId:e,shareText:i.text})}}})}attach(e,t){e.on("share",this.handleShare)}async getShareFiles(e){const{files:t}=e;if(!Array.isArray(t)||0===t.length)return[];try{const e=t.map(e=>(async({file:e,name:t,type:r})=>{const i=await fetch(`data:${r};base64,${e}`),s=await i.blob();return new File([s],t,{type:r,lastModified:(new Date).getTime()})})(e));return await Promise.all(e)}catch(e){return console.warn("[IAS]: Error converting data URLs to files:",e),[]}}async startNativeSharing(e,t){try{await this.storyManager.shareHandler(t),this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!0})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;throw console.error(`[IAS]: Native sharing error: ${e.message}`),e}finally{this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!1})}}getFilteredConfigDto(e){const t={};for(const[r,i]of Object.entries(null!=e?e:{}))null!==i&&(t[r]=i);return t}openSharePanel({shareConfig:e,shareLink:t,shareId:r,shareText:i}){let s=dt.Link;t||(s=dt.Text),e.files&&e.files.length>0&&(s=dt.Image,t=URL.createObjectURL(e.files[0])),this.shareNotifier.notifyOpenSharePanel({shareId:r,shareType:s,shareLink:t,shareText:i})}}class _i{constructor(e,t,r){Object.defineProperty(this,"userKey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"gameInstanceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"instanceUserData",{enumerable:!0,configurable:!0,writable:!0,value:r})}set(e){window.localStorage.setItem(this.key,JSON.stringify(e))}get(){var e;let t={};const r=ti()(this.instanceUserData)?this.instanceUserData:{};try{const r=JSON.parse(null!==(e=window.localStorage.getItem(this.key))&&void 0!==e?e:"{}");ti()(r)&&(t=r)}catch(e){console.error(e)}return Tt()(t,r)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class Oi{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"handleSetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t,r)=>{try{const e=JSON.parse(r);if(new _i(t.clientConfig.userKey,t.config.gameInstanceId,t.instanceUserData).set(e.data),this.storyManager.isStatisticsDisabled||!e.sendToServer)return;await ra.post(`game/${e.gameInstanceId}/instance-user-data`,{data:e.data})}catch(e){console.error(e)}}}),Object.defineProperty(this,"handleGetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:(e,t,r)=>{const{id:i,callback:s}=JSON.parse(r),a=new _i(t.clientConfig.userKey,t.config.gameInstanceId,t.instanceUserData).get();e.sendMessage("cb",{cb:s,arguments:JSON.stringify([i,JSON.stringify(a)])})}})}attach(e,t){e.on("gameInstanceSetLocalData",r=>this.handleSetLocalData(e,t,r)),e.on("gameInstanceGetLocalData",r=>this.handleGetLocalData(e,t,r))}}class ki{constructor(e){Object.defineProperty(this,"storyId",{enumerable:!0,configurable:!0,writable:!0,value:e})}set(e){sessionStorage.setItem(this.key,JSON.stringify(e))}get(){var e;const t=null!==(e=sessionStorage.getItem(this.key))&&void 0!==e?e:"{}";return window.__activeNarrativeId?JSON.parse(t):{}}get key(){return`narrative_${this.storyId}_data`}}class xi{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"session",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleSetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{try{const t=JSON.parse(e);if(!Ie()(t))return;if(new ki(t.storyId).set(t.data),this.storyManager.isStatisticsDisabled||!t.sendToServer)return;await ra.request({url:"story-data/"+t.storyId,method:"put",data:{data:t.data}})}catch(e){console.error(e)}}}),Object.defineProperty(this,"handleGetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=JSON.parse(e);if(!Ie()(t))return;const{id:r,storyId:i,callback:s}=t;let a=new ki(i).get();this.session.sendMessage("cb",{cb:s,arguments:JSON.stringify([r,JSON.stringify(a)])})}})}attach(e,t){this.session=e,e.on("storySetLocalData",this.handleSetLocalData),e.on("storyGetLocalData",this.handleGetLocalData)}}class Ci{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{const t=this.storyManager.gameReader,r=this.storyManager.storyReader;if(await t.openGame(e.gameInstanceId),!t.isOpened)return;r.pauseUI(),t.once(Xr.Close,()=>{r.resumeUI()})}catch(e){console.error(e)}}}class Pi{constructor(e,t,r,i,s){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s})}handle(e){var t;try{const r=e.linkTarget;this.storyReaderStatisticV2Service.sendLinkEvent({target:r,storyId:this.activeStory.id,activeSlideIndex:this.activeStory.activeSlideIndex,feedSlug:null===(t=this.storyReader.feed)||void 0===t?void 0:t.slug}),this.handleClickOnButton({url:r,elementId:e.elementId})}catch(t){t instanceof URIError?console.error(`[IAS]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}async handleClickOnButton(e){this.storyReaderStatisticV1Service.sendClickOnButtonEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),await this.storyReaderStatisticV1Service.sendData();const t={src:Ct.StoryReader,data:{id:this.activeStory.id,index:this.activeStory.activeSlideIndex,url:e.url,elementId:e.elementId}};this.storyManager.storyLinkClickHandler(t),this.storyManager.emit("clickOnButton",t)}}class ji{constructor(e,t,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i})}async handle(e){try{this.emitClickOnButtonEvent({src:Ct.StoryReader,data:{id:e.storyId,index:e.slideIndex,url:e.storyId.toString()}}),await this.storyReader.showStory(e.storyId)}catch(e){console.error(e)}}async emitClickOnButtonEvent(e){try{this.storyReaderStatisticV1Service.sendClickOnButtonEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),await this.storyReaderStatisticV1Service.sendData(),this.storyManager.storyLinkClickHandler(e),this.storyManager.emit("clickOnButton",e)}catch(e){console.error(e)}}}class Ei{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class Ii{constructor(e){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e})}toggleLoaderScreen(e){e?this.story.showLoaderScreen():this.story.hideLoaderScreen()}toggleErrorScreen(e){e?this.story.showErrorScreen():this.story.hideErrorScreen()}manageTimer(e,t){const r=this.story.timeline.timer;switch(e){case"start":this.startTimer(r,t);break;case"pause":r.pause();break;case"stop":case"before_start":r.stop()}}startTimer(e,t){e.paused?e.resume():e.started?(e.stop(),e.start(t)):e.start(t)}}class Ti{constructor(e,t){Object.defineProperty(this,"statisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"maxScrollPercent",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"layerIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isScrollableLayer",{enumerable:!0,configurable:!0,writable:!0,value:!1})}onVerticalScrollChange(e){e.isScrollableLayer&&(this.isScrollableLayer=!0,this.switchSwipeGestureByScrollPercent(e.scrollPercent),this.updateMaxScrollPercent(e.scrollPercent),this.layerIndex=e.layerIndex)}clear(){this.isScrollableLayer&&(this.sendStatistic(),this.maxScrollPercent=0,this.layerIndex=0,this.isScrollableLayer=!1)}switchSwipeGestureByScrollPercent(e){e>0?this.story.touchController.disableVerticalSwipeGesture():this.story.touchController.enableVerticalSwipeGesture()}updateMaxScrollPercent(e){e>this.maxScrollPercent&&(this.maxScrollPercent=e)}sendStatistic(){this.statisticV2Service.sendEvent(new As({storyId:this.story.id,slideIndex:this.story.activeSlideIndex,scrollPercent:this.maxScrollPercent,layerIndex:this.layerIndex}),!0)}}class Ai{constructor(e,t,r,i,s){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"statisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"statisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"sessionNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Ei}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Ei}),Object.defineProperty(this,"widgetScrollViewController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.widgetScrollViewController=new Ti(this.statisticV2Service,this.story)}onVerticalScrollChange(e){this.widgetScrollViewController.onVerticalScrollChange(e)}onWidgetRequirePauseUI(){this.story.pauseUI(this)}onWidgetRequireResumeUI(){this.story.resumeUI(this)}productCartUpdate(e){return new Promise((t,r)=>{this.storyManager.emit("productCartUpdated",{offer:e.offer,onSuccess:t,onError:r})})}productCartClicked(){this.storyManager.emit("productCartClicked")}async productCartGetState(){return this.storyManager.products.getProductCartState()}onEvent(e,t){}onCardLoadingStateChange(e){}clearSlideSession(){this.sessionNarrativeDataCache.clear(),this.widgetScrollViewController.clear()}writeToClipboard(e){(new p).copy(e.textValue)}disableVerticalSwipeGesture(){this.storyReader.touchController.disableVerticalSwipeGesture()}enableVerticalSwipeGesture(){this.storyReader.touchController.enableVerticalSwipeGesture()}disableHorizontalSwipeGesture(){this.storyReader.touchController.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.storyReader.touchController.enableHorizontalSwipeGesture()}async getCardLocalData(){const e=this.storyManager.rootStore.sessionStore.userId;let t=this.narrativeDataCache.get(`narrative_${this.story.id}_data_${e}`);return t?JSON.parse(t):{}}setCardLocalData(e,t){const r=this.storyManager.rootStore.sessionStore.userId;let i=JSON.stringify(e);this.narrativeDataCache.set(`narrative_${this.story.id}_data_${r}`,i),this.story.context.updateNarrativeData(e),this.story.resumeUser(),t&&this.story.updateNarrativeData(i).catch(console.error)}getCardServerData(e){var t;return null!==(t=this.story.context.widgetsData._narrative_saved_data)&&void 0!==t?t:null}showCardTextInput(e,t){this.story.textInput.show(e,t)}setCardSessionValue(e,t){this.sessionNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.sessionNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const r=this.story.context.widgetsData;switch(t){case"rangeSlider":return r._narrative_range_slider_data;case"poll":return r._narrative_poll_data;case"vote":return r._narrative_vote_data;case"reactions":return r._narrative_reactions_data}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await ra.request({url:e,method:t,params:null!=r?r:{},headers:null!=i?i:{},data:null!=s?s:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof h)return{status:null!==(o=e.networkStatus)&&void 0!==o?o:400,headers:null===(n=e.response)||void 0===n?void 0:n.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){null==e&&(e="story-share"),this.story.sharePanel.shareText({shareId:e,config:t,storySlide:this.story.activeSlide})}shareSlideScreenshot(e,t,r){null==e&&(e="slide-screenshot-share"),this.story.sharePanel.shareScreenShot({shareId:e,hideElementsSelector:null!=t?t:"",shareText:r,storySlide:this.story.activeSlide})}showLayer(e){this.story.showLayer(e)}showCardSlide(e){this.story.showSlide(e)}cardShowNext(){this.storyReader.nextStoryWithAnimation()}showNextSlide(){this.story.nextSlide()}sendStatisticEvent(e,t,r,i){var s,a;this.storyManager.emit("widgetEvent",{name:e,data:Object.assign(Object.assign({},r),{feed:null===(s=this.storyReader.feed)||void 0===s?void 0:s.slug})}),this.statisticV2Service.sendWidgetEvent({type:e,widgetPayload:t,activeSlideIndex:this.story.activeSlideIndex,storyId:this.story.id,feedSlug:null===(a=this.story.feed)||void 0===a?void 0:a.slug},i)}async resetStory(e){var t;let r={},i=await this.getCardLocalData();i=Object.assign({},null!==(t=this.getCardServerData(e))&&void 0!==t?t:{},i);for(let e in i)i.hasOwnProperty(e)&&/^_gm_[A-z0-9-_]+_attempts$/.test(e)&&(r[e]=i[e]);this.updateCardServerDataLocally(r),this.setCardLocalData(r,!0),this.showCardSlide(0),this.showLayer(0)}getCardFonts(){var e;const t=this.storyManager.rootStore.sessionStore.session;return null!==(e=null==t?void 0:t.fontsResources)&&void 0!==e?e:[]}async updateTimeline(e,t,r,i,s,a){if(this.story.activeSlideIndex!==e)return;const o=new Ii(this.story);"before_start"!==t&&(o.toggleLoaderScreen(s),o.toggleErrorScreen(a)),o.manageTimer(t,i)}updateCardServerDataLocally(e){this.story.context.updateNarrativeData(e)}showToast(e){this.story.showToast({content:e})}openUrl(e){var t;"swipeUpItems"===e.type?this.story.goodsWidget.open({elementId:null!==(t=e.elementId)&&void 0!==t?t:"",target:e.link.target}):new Pi(this.storyManager,this.storyReader,this.story,this.statisticV1Service,this.statisticV2Service).handle({elementId:e.elementId,linkTarget:e.link.target})}closeCard(e){this.storyReader.close(ds.CloseCustom)}openStory(e,t){this.story.id===e?this.story.showSlide(t):new ji(this.storyManager,this.storyReader,this.story,this.statisticV1Service).handle({storyId:e,slideIndex:t})}openGame(e){new Ci(this.storyManager,this.story).handle({gameInstanceId:e})}}class Mi{constructor(e,t,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:i})}create(e){return new Ai(this.storyManager,this.storyReader,e,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service)}}class Li{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get contentRatio(){return this.calculateWidth()/this.calculateHeight()}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this._vh*zr)}calculateHeight(){return Math.ceil(this.calculateWidth()/zr)}}class Ri{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get vw(){return this._vw}get vh(){return this._vh}get contentRatio(){return this.calculateWidth()/this.calculateHeight()}getWidth(){return"auto"}getHeight(){return"100%"}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this._vw)}calculateHeight(){return Math.ceil(this._vw/Wr)}}class Bi{constructor(e,t,r,i){Object.defineProperty(this,"windowViewport",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"desktopStoryViewport",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"actionPanelHeight",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"safeAreaFrameCalculator",{enumerable:!0,configurable:!0,writable:!0,value:i})}create(){const e=this.windowViewport.vw/this.windowViewport.vh;if(Y&&e>zr)return this.createDesktopStoryGeometry({vw:this.windowViewport.vw,vh:this.desktopStoryViewport.vh});{const e=this.safeAreaFrameCalculator.getViewportCorrectionPadding();return this.createMobileStoryGeometry({vw:this.windowViewport.vw,vh:this.windowViewport.vh-(e.top+e.bottom+this.actionPanelHeight)})}}createDesktopStoryGeometry(e){return new Li(e.vw,e.vh)}createMobileStoryGeometry(e){return new Ri(e.vw,e.vh)}}class Di{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get shouldBeShownSafeAreaInsets(){return this.viewportRatio<Wr}getViewportCorrectionPadding(){const e=this._vh-this._vw/Wr,t=Math.max(Math.min(e-50,50),0);return{top:Math.max(e-t,0),bottom:t}}}class Ni{constructor(e,t){Object.defineProperty(this,"showMultipleStoriesStrategy",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_feed",{enumerable:!0,configurable:!0,writable:!0,value:null})}get feed(){return this._feed}async show(e){var t,r;const i=this.storyManager.rootStore.onboardingFeedStore;this.throwIfAborted(e.signal);const s=await i.fetchOnboardingFeed({feedSlug:e.feedSlug,tags:null!==(t=e.customTags)&&void 0!==t?t:[],limit:null!==(r=e.limit)&&void 0!==r?r:void 0});this.throwIfAborted(e.signal),this._feed=s;const a=this.getFeedLoadEvent(s.slug,s.stories);return this.emitFeedLoad(a),s.stories.length?(await this.showMultipleStoriesStrategy.show({windowReferer:kt.default,storyFeed:s,storyId:s.stories[0].id}),a):a}async handleNextStoryByIndex(e){this.showMultipleStoriesStrategy.handleNextStoryByIndex(e)}emitFeedLoad(e){this.storyManager.emit("feedLoad",e)}getFeedLoadEvent(e,t){const r={stories:t.map(e=>{const t={title:null,slidesCount:null};return e&&(t.title=e.statTitle,t.slidesCount=e.slidesCount),Object.assign({id:e.id},t)}),feed:null,filter:null};return r.feed=e,r}async reload(e){this.showMultipleStoriesStrategy.reload(e)}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}}class Fi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stories",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"storyIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storyStore=this.storyManager.rootStore.storyStore}get feed(){return this.storyFeed}async show(e){const{storyId:t,windowReferer:r}=e;this.storyFeed=e.storyFeed,this.stories=this.getVisibleStoriesByStoryFeed(this.storyFeed),this.storyIndex=this.findStoryIndex(this.stories,t),this.storyReaderViewModel.open({windowReferer:r,id:t,stories:this.stories}),await this.storyStore.fetchStoriesSlides({stories:this.getStoriesByRange(this.storyIndex),feedSlug:this.storyFeed.slug})}async reload(e){const t=this.findStoryIndex(this.stories,e.storyId);await this.storyStore.fetchStoriesSlides({stories:this.getStoriesByRange(t),feedSlug:this.storyFeed.slug})}async handleNextStoryByIndex(e){await this.storyStore.fetchStoriesSlides({stories:this.getStoriesByRange(e),feedSlug:this.storyFeed.slug})}getVisibleStoriesByStoryFeed(e){var t;return null!==(t=e.stories.filter(e=>!e.hideInReader))&&void 0!==t?t:[]}findStoryIndex(e,t){return e.findIndex(e=>e.id===t)}getStoriesByRange(e){const t=e-2,r=e+2;return this.stories.slice(Math.max(t,0),r+1)}}class Ui{constructor(e){Object.defineProperty(this,"showStoryStrategy",{enumerable:!0,configurable:!0,writable:!0,value:e})}get feed(){return null}async show(e){await this.showStoryStrategy.show({storyId:e.storyId,fetchShareUrl:e.fetchShareUrl,signal:e.signal})}async reload(e){return this.showStoryStrategy.reload(e)}async handleNextStoryByIndex(e){}}class Gi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){try{this.throwIfAborted(e.signal);const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",once:!0});if(this.throwIfAborted(e.signal),r.error)throw r.error;if(r.isOpened)throw new pe(e.storyId.toString());this.openStoryReader(r)}catch(e){throw this.storyReaderViewModel.close(),e}}openStoryReader(e){this.storyReaderViewModel.open({windowReferer:kt.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}}class Vi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){this.throwIfAborted(e.signal);const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",fetchShareUrl:e.fetchShareUrl});this.throwIfAborted(e.signal),this.openStoryReader(r,e)}openStoryReader(e,t){this.storyReaderViewModel.open({windowReferer:kt.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}}class zi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}createShowStory(){return new Vi(this.storyManager,this.storyReaderViewModel)}createShowStoryOnce(){return new Gi(this.storyManager,this.storyReaderViewModel)}createShowStoryFromSharePage(){return new Ui(new Vi(this.storyManager,this.storyReaderViewModel))}createShowOnboardingStories(){return new Ni(new Fi(this.storyManager,this.storyReaderViewModel),this.storyManager)}createShowMultipleStories(){return new Fi(this.storyManager,this.storyReaderViewModel)}}class Wi{constructor(e,t={}){var r,i,s,a;Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"title",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slidesCount",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"feedSlug",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"actionSource",{enumerable:!0,configurable:!0,writable:!0,value:Ot.list}),Object.defineProperty(this,"ugcPayload",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slideEventPayload",{enumerable:!0,configurable:!0,writable:!0,value:null});const o=null===(r=this.story.displayStrategy)||void 0===r?void 0:r.feed,n=null==o?void 0:o.type,l=null!==(i=null==o?void 0:o.slug)&&void 0!==i?i:null,c=o instanceof je?o.filter:null;this.title=this.story.statTitle,this.slidesCount=this.story.slidesCount,this.ugcPayload=n===me.UGC?this.story.ugcPayload:null,this.feedSlug=n===me.DEFAULT?l:null,this.filter=c,this.actionSource=null!=n?this.getStorySourceByFeedType(n):Ot.direct,this.slideEventPayload=null!==(a=null===(s=e.activeSlide.eventPayload)||void 0===s?void 0:s.payload)&&void 0!==a?a:null}toJSON(){return Object.assign({id:this.story.id,index:this.story.activeSlideIndex,title:this.title,tags:this.tags,slidesCount:this.slidesCount,feed:this.feedSlug,filter:this.filter,source:this.actionSource,ugcPayload:this.ugcPayload,payload:this.slideEventPayload},this.payload)}getStorySourceByFeedType(e){switch(e){case me.DEFAULT:case me.UGC:return Ot.list;case me.FAVORITE:return Ot.favorite;case me.ONBOARDING:return Ot.onboarding;default:return Ot.list}}}class $i extends Wi{get name(){return"closeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class Hi extends Wi{get name(){return"closeStoryReader"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class qi extends Wi{get name(){return"dislikeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class Ji extends Wi{get name(){return"favoriteStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class Ki extends Wi{get name(){return"likeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class Zi extends Wi{get name(){return"shareStory"}}class Qi extends Wi{get name(){return"shareStoryWithPath"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.url})}}class Yi extends Wi{get name(){return"showSlide"}}class Xi extends Wi{get name(){return"showStory"}toJSON(){const e=super.toJSON();return e.payload=null,e}}class es{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get name(){return"showStoryFailed"}toJSON(){return{id:this.payload.id,title:this.payload.title,name:this.payload.name,message:this.payload.message}}}class ts{constructor(e,t,r,i,s){Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s})}emitTransitionEvents(e,t,r,i,s){this.emitOpenV1(r,i),r?(this.emitOpenV2(e,t,i),r&&this.emitCloseV2(e,t,r,s)):this.emitOpenReaderEvents(i)}emitOpenReaderEvents(e){var t;let r="list";this.storyReader.feed?this.storyReader.feed instanceof Oe?r="favorite":this.storyReader.feed instanceof Ce&&(r="onboarding"):r="direct";const i={whence:r,storyId:e.id,activeSlideIndex:e.activeSlideIndex,feedSlug:null===(t=this.storyReader.feed)||void 0===t?void 0:t.slug};this.storyReaderStatisticV2Service.sendOpenEvent(i),e.wasShown||this.storyReaderStatisticV2Service.sendViewEvent(i)}emitOpenV2(e,t,r){var i;const s={whence:t>e?"next":"prev",storyId:r.id,activeSlideIndex:r.activeSlideIndex,feedSlug:null===(i=this.storyReader.feed)||void 0===i?void 0:i.slug};this.storyReaderStatisticV2Service.sendOpenEvent(s),r.wasShown||this.storyReaderStatisticV2Service.sendViewEvent(s)}emitOpenV1(e,t){this.storyReader.feed&&!t.wasShown&&this.storyFeedStatisticV1Service.sendCoverageEvent([t.model],this.storyReader.feed),e&&this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:e.id,slideIndex:e.activeSlideIndex});const r=new Xi(t),i=new Yi(t);this.storyManager.emit(r.name,r.toJSON()),this.storyManager.emit(i.name,i.toJSON())}emitCloseV2(e,t,r,i){var s;const a=t>e?ot.Next:ot.Prev;this.storyReaderStatisticV2Service.sendCloseEvent({cause:a,totalSlides:r.slidesCount,durationMs:i,storyId:r.id,activeSlideIndex:r.activeSlideIndex,feedSlug:null===(s=this.storyReader.feed)||void 0===s?void 0:s.slug})}}class rs{constructor(e,t,r=Date.now()){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blob",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lastAccessed",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"blobUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}updateLastAccessed(){this.lastAccessed=Date.now()}getOrCreateBlobUrl(){return this.blobUrl||(this.blobUrl=URL.createObjectURL(this.blob)),this.blobUrl}unlinkBlob(){this.blobUrl&&URL.revokeObjectURL(this.blobUrl)}destroy(){this.unlinkBlob()}}class is{constructor(e){Object.defineProperty(this,"driver",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"entries",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}async get(e){let t=this.entries.get(e);if(!t){const r=await this.driver.get(e);if(!r)return;t=new rs(r.url,r.blob,r.lastAccessed),this.entries.set(e,t)}return t}async loadAllEntries(){const e=await this.driver.getAll(),t=[];for(const r of e){const e=new rs(r.url,r.blob,r.lastAccessed);this.entries.set(r.url,e),t.push(e)}return t}async save(e){this.entries.set(e.url,e),await this.driver.set({url:e.url,blob:e.blob,lastAccessed:e.lastAccessed})}async updateAccessTime(e){this.entries.set(e.url,e),await this.driver.updateAccessTime(e.url,e.lastAccessed)}async delete(e){this.entries.delete(e),await this.driver.delete(e)}async getAll(){return Array.from(this.entries.values())}async clear(){for(const e of this.entries.values())e.destroy();this.entries.clear()}}class ss{constructor(e,t){Object.defineProperty(this,"dbName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storeName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dbName=e,this.storeName=t}async getDB(){return new Promise((e,t)=>{const r=indexedDB.open(this.dbName,1);r.onupgradeneeded=()=>{const e=r.result;if(!e.objectStoreNames.contains(this.storeName)){e.createObjectStore(this.storeName,{keyPath:"url"}).createIndex("lastAccessed","lastAccessed")}},r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}async get(e){const t=await this.getDB();return new Promise((r,i)=>{const s=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);s.onsuccess=()=>{const t=s.result;r(t?{url:e,lastAccessed:t.lastAccessed,blob:t.blob}:void 0)},s.onerror=()=>i(s.error)})}async set(e){const t=await this.getDB();return new Promise((r,i)=>{const s=t.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).put(e),s.oncomplete=()=>r(),s.onerror=()=>i(s.error)})}async updateAccessTime(e,t){const r=(await this.getDB()).transaction(this.storeName,"readwrite"),i=r.objectStore(this.storeName),s=await new Promise((t,r)=>{const s=i.get(e);s.onsuccess=()=>t(s.result),s.onerror=()=>r(s.error)});return s&&(s.lastAccessed=t,i.put(s)),new Promise((e,t)=>{r.oncomplete=()=>e(),r.onerror=()=>t(r.error)})}async delete(e){const t=await this.getDB();return new Promise((r,i)=>{const s=t.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).delete(e),s.oncomplete=()=>r(),s.onerror=()=>i(s.error)})}async getAll(){const e=await this.getDB();return new Promise((t,r)=>{const i=e.transaction(this.storeName,"readonly").objectStore(this.storeName).getAll();i.onsuccess=()=>t(i.result),i.onerror=()=>r(i.error)})}async clear(){const e=await this.getDB();return new Promise((t,r)=>{const i=e.transaction(this.storeName,"readwrite");i.objectStore(this.storeName).clear(),i.oncomplete=()=>t(),i.onerror=()=>r(i.error)})}}class as{constructor(){Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}async get(e){return this.store.get(e)}async set(e){this.store.set(e.url,e)}async delete(e){this.store.delete(e)}async getAll(){return Array.from(this.store.values())}async clear(){this.store.clear()}async updateAccessTime(e,t){const r=await this.get(e);r&&(r.lastAccessed=t,this.set(r))}}class os{constructor(e,t,r){var i,s;Object.defineProperty(this,"repository",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"urlLocks",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.options={maxSize:null!==(i=null==r?void 0:r.maxSize)&&void 0!==i?i:20,debug:Boolean(null==r?void 0:r.debug),ttl:null!==(s=null==r?void 0:r.ttl)&&void 0!==s?s:3600}}async init(){await this.repository.loadAllEntries(),await this.tryEvict()}async getAll(){return this.repository.getAll()}async get(e,t){const r=this.getMutexForUrl(e),i=await r.acquire();try{let r=await this.repository.get(e);return r||(r=await this.add(e,t)),r.updateLastAccessed(),r.getOrCreateBlobUrl(),this.options.debug&&console.log("[IAS]: Get from cache",r),await this.repository.updateAccessTime(r),r}finally{i()}}async tryEvict(){return[...await this.evictExpired(),...await this.evictOldest()]}async evictOldest(){const e=await this.repository.getAll();if(e.length<=this.options.maxSize)return[];const t=[],r=e.sort((e,t)=>e.lastAccessed-t.lastAccessed);for(;r.length>this.options.maxSize;){const e=r.shift();e&&(this.options.debug&&console.log("[IAS]: Remove oldest entry from cache",e),await this.removeEntry(e),t.push(e))}return t}async wait(){await Promise.all(Array.from(this.urlLocks.values()).map(e=>e.waitForUnlock()))}async evictExpired(){if(0===this.options.ttl)return[];const e=await this.repository.getAll(),t=Date.now(),r=[];for(const i of e)i.lastAccessed+1e3*this.options.ttl<t&&(this.options.debug&&console.log("[IAS]: Remove expired entry from cache",i),await this.removeEntry(i),r.push(i));return r}async add(e,t){const r=await this.loader.enqueue(e,t),i=new rs(e,r);return await this.repository.save(i),await this.tryEvict(),this.options.debug&&console.log("[IAS]: Add to cache",i),i}getMutexForUrl(e){let t=this.urlLocks.get(e);return t||(t=new qr.Mutex,this.urlLocks.set(e,t)),t}cleanupLock(e){this.urlLocks.delete(e)}async removeEntry(e){e.destroy(),this.cleanupLock(e.url),await this.repository.delete(e.url)}}class ns{constructor(e){Object.defineProperty(this,"concurrency",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"semaphore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.semaphore=new qr.Semaphore(e)}async enqueue(e,t){return await this.semaphore.runExclusive(async()=>{const t=await fetch(e,{cache:"no-store"});return await t.blob()},1,t)}wait(){return this.semaphore.waitForUnlock(this.concurrency)}clear(){this.semaphore.cancel()}async destroy(){this.clear(),await this.wait()}}class ls{get isDestroyed(){return this._isDestroyed}constructor(e){var t,r,i,s,a;Object.defineProperty(this,"lruCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"loader",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cacheRepository",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDestroyed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.options={maxSize:null!==(t=e.maxSize)&&void 0!==t?t:20,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5,debug:Boolean(e.debug),ttl:null!==(i=e.ttl)&&void 0!==i?i:3600,type:null!==(s=e.type)&&void 0!==s?s:"indexeddb",storeName:null!==(a=e.storeName)&&void 0!==a?a:"resources"};const o=this.createCacheDriver();this.cacheRepository=new is(o),this.loader=new ns(this.options.concurrency),this.lruCache=new os(this.cacheRepository,this.loader,{maxSize:this.options.maxSize,debug:this.options.debug,ttl:this.options.ttl}),this.lruCache.init().catch(e=>console.error("[IAS]: LRU cache init error",e))}async preload(e){return(await Promise.allSettled(e.map(async e=>await this.lruCache.get(e.url,e.priority)))).filter(e=>"fulfilled"===e.status&&null!==e.value).map(e=>e.value)}async destroy(){try{this._isDestroyed=!0,await this.loader.destroy(),await this.lruCache.wait()}finally{await this.cacheRepository.clear(),this.options.debug&&console.log("[IAS]: Destroy LRU cache")}}createCacheDriver(){return"indexeddb"===this.options.type?new ss("ias-cache-v1",this.options.storeName):new as}}var cs,ds,hs=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},us=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ps=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},gs=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Close="closeStoryReader"}(cs||(cs={})),function(e){e.CloseByBtn="closeReaderByCloseBtn",e.CloseByTimer="auto",e.CloseByEsc="closeReaderByEscBtn",e.CloseByLastSlideClick="lastSlideClick",e.CloseBySwipeDown="swipeDown",e.CloseCustom="customClose",e.AppClose="app-close"}(ds||(ds={}));let fs=(()=>{var e,t,r,i,s,a,n;let l,c,d,h,u,p,g,m,v,b,w,S,_,O,k,x,C,P,j,E,I,T,A,M,L,R,B,D,N,F,U=o,G=[],V=[],z=[],W=[],$=[],H=[],q=[],J=[],K=[],Z=[],Q=[],Y=[],X=[];return e=class extends U{get _muted(){return ps(this,t,"f")}set _muted(e){gs(this,t,e,"f")}get _closeGestureInAction(){return ps(this,r,"f")}set _closeGestureInAction(e){gs(this,r,e,"f")}get _stories(){return ps(this,i,"f")}set _stories(e){gs(this,i,e,"f")}get _activeStory(){return ps(this,s,"f")}set _activeStory(e){gs(this,s,e,"f")}get _activeStoryIndex(){return ps(this,a,"f")}set _activeStoryIndex(e){gs(this,a,e,"f")}get _targetTransitionIndex(){return ps(this,n,"f")}set _targetTransitionIndex(e){gs(this,n,e,"f")}constructor(e,o,l,c){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(hs(this,G),e)}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,hs(this,V,!0)),r.set(this,(hs(this,z),hs(this,W,!1))),i.set(this,(hs(this,$),hs(this,H,f.observable.array()))),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:(hs(this,q),new zt(window))}),Object.defineProperty(this,"windowReferer",{enumerable:!0,configurable:!0,writable:!0,value:kt.default}),Object.defineProperty(this,"_currentStoryDisplayStrategy",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"storyDisplayStrategyFactory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_touchController",{enumerable:!0,configurable:!0,writable:!0,value:new Lt({touchStartTimeout:200})}),s.set(this,hs(this,J,null)),a.set(this,(hs(this,K),hs(this,Z,0))),n.set(this,(hs(this,Q),hs(this,Y,-1))),Object.defineProperty(this,"animatedNavigationController",{enumerable:!0,configurable:!0,writable:!0,value:(hs(this,X),null)}),Object.defineProperty(this,"_activeStoryStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"useModernLayout",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cacheManager",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"statisticsController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.handleWindowUnload=this.handleWindowUnload.bind(this),this.handleKeydown=this.handleKeydown.bind(this),window.addEventListener("beforeunload",this.handleWindowUnload),this.storyDisplayStrategyFactory=new zi(e,this),this.statisticsController=new ts(this,this.storyManager,this.storyReaderStatisticV1Service,this.storyFeedStatisticV1Service,this.storyReaderStatisticV2Service)}get targetTransitionStory(){return this.stories[this._targetTransitionIndex]}get targetTransitionIndex(){return this._targetTransitionIndex}get touchController(){return this._touchController}get feed(){var e;return null===(e=this._currentStoryDisplayStrategy)||void 0===e?void 0:e.feed}get displayStrategy(){return this._currentStoryDisplayStrategy}get muted(){return this._muted}get closeGestureInAction(){return this._closeGestureInAction}get stories(){return this._stories}get activeStory(){return this._activeStory}get activeStoryDuration(){return Date.now()-this._activeStoryStartTime}get dir(){return this.storyManager.config.dir}get isOpened(){return Boolean(this.activeStory)}get activeStoryIndex(){return this._activeStoryIndex}get reachStart(){return 0===this._activeStoryIndex||this._stories[0]===this.targetTransitionStory}get reachEnd(){return this._activeStoryIndex===this.stories.length-1||this._stories[this._stories.length-1]===this.targetTransitionStory}open(e){var t,r;this.activeStory&&this.resetReaderToDefaultState(this.activeStory),this.storyManager.config.cache&&(this.cacheManager=new ls(this.storyManager.config.cache)),this.windowReferer=e.windowReferer,this.setStories(e.stories),this.setActiveStoryById(e.id),this.storyReaderStatisticV1Service.init({feedSlug:null===(r=null===(t=this._currentStoryDisplayStrategy)||void 0===t?void 0:t.feed)||void 0===r?void 0:r.slug}),this._touchController.init(document.body),this.hideScrollbar(e.windowReferer),document.addEventListener("keydown",this.handleKeydown)}close(e=ds.CloseByBtn,t=!1){var r;!t&&(null===(r=this.activeStory)||void 0===r?void 0:r.disableClose)||!this.activeStory||(this.emitCloseEvents(this.activeStory,e),this.resetReaderToDefaultState(this.activeStory,e))}emitCloseEvents(e,t){var r,i;this.emitStatisticV2StoryCloseEvent(e,t),this.emit(cs.Close,{id:e.id,type:null===(r=this.feed)||void 0===r?void 0:r.type,feed:null===(i=this.feed)||void 0===i?void 0:i.slug});const s=new Hi(e,{action:t});this.storyManager.emit(s.name,s.toJSON())}emitStatisticV2StoryCloseEvent(e,t){var r;this.storyReaderStatisticV2Service.sendCloseReaderEvent({action:t,totalSlides:e.slidesCount,durationMs:this.activeStoryDuration,storyId:e.id,activeSlideIndex:e.activeSlideIndex,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}resetReaderToDefaultState(e,t){var r;const i=new $i(e,{action:t});this.storyManager.emit(i.name,i.toJSON()),this.showScrollbar(this.windowReferer);const s=e.id,a=e.activeSlideIndex;this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:s,slideIndex:a}),e.markAsOpened(),this.storyReaderStatisticV1Service.destroy(),this.clearStoryViewModels(),this._touchController.destroy(),document.removeEventListener("keydown",this.handleKeydown),this._activeStory=null,null===(r=this.cacheManager)||void 0===r||r.destroy()}canBeClosed(){return!!this.activeStory&&!this.activeStory.disableClose}async showStory(e,t={}){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStory(),await this._currentStoryDisplayStrategy.show(Object.assign({storyId:e},t))}async showStoryOnce(e,t={}){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStoryOnce(),await this._currentStoryDisplayStrategy.show(Object.assign({storyId:e},t))}async showStoryFromSharePage(e,t={}){const r=this.storyDisplayStrategyFactory.createShowStoryFromSharePage();this._currentStoryDisplayStrategy=r,await r.show(Object.assign({storyId:e,fetchShareUrl:this.storyManager.isStatisticsDisabled},t))}async showOnboardingStories(e){if(this.storyManager.config.anonymous)return console.warn("[IAS]: You can't open onboarding in anonymous access mode"),{stories:[]};const t=this.storyDisplayStrategyFactory.createShowOnboardingStories();return this._currentStoryDisplayStrategy=t,t.show(e)}async showMultipleStories(e){var t;const r=this.storyDisplayStrategyFactory.createShowMultipleStories();this._currentStoryDisplayStrategy=r,await r.show({storyId:e.storyId,storyFeed:e.storyFeed,windowReferer:null!==(t=e.windowReferer)&&void 0!==t?t:kt.default,filter:e.filter})}async reloadStory(e){var t;e.setError(null),null===(t=this._currentStoryDisplayStrategy)||void 0===t||t.reload({storyId:e.id})}nextStory(){this.reachEnd||this.setActiveStoryByIndex(this._activeStoryIndex+1)}prevStory(){this.reachStart||this.setActiveStoryByIndex(this._activeStoryIndex-1)}nextStoryWithAnimation(e){this.reachEnd?this.handleStoryReaderReachEnd(e):this.navigateStoryWithAnimation(this._activeStoryIndex+1,e)}prevStoryWithAnimation(e){this.reachStart||this.navigateStoryWithAnimation(this._activeStoryIndex-1,e)}toStoryWithAnimationByIndex(e){if(this.activeStoryIndex!==e)return this.navigateStoryWithAnimation(e,"")}navigateStoryWithAnimationByIndex(e,t){this.navigateStoryWithAnimation(e,t)}destroy(){var e;this.activeStory&&(this.emitCloseEvents(this.activeStory,ds.AppClose),this.resetReaderToDefaultState(this.activeStory)),this.removeAllListeners(),window.removeEventListener("beforeunload",this.handleWindowUnload),null===(e=this.cacheManager)||void 0===e||e.destroy()}closeGoodsWidget(){var e;null===(e=this.activeStory)||void 0===e||e.goodsWidget.close()}setAnimatedNavigationController(e){this.animatedNavigationController=e}mute(){this._muted=!0}unmute(){this._muted=!1}enableCloseGesture(){this._closeGestureInAction=!0}disableCloseGesture(){this._closeGestureInAction=!1}pauseUI(){var e;this.storyReaderStatisticV1Service.pause(),null===(e=this.activeStory)||void 0===e||e.pauseUI(this)}resumeUI(){var e;this.storyReaderStatisticV1Service.resume(),null===(e=this.activeStory)||void 0===e||e.resumeUI(this)}goNext(){this.navigate(1)}goPrev(){this.navigate(-1)}navigate(e){if(!this.activeStory||this.activeStory.pauseState.isUIPaused)return;e=this.storyManager.config.isLtr?e:-e,this.useModernLayout?this.handleModernNavigation(this.activeStory,e):this.handleLegacyNavigation(e)}handleModernNavigation(e,t){1===t?!e.isNextDisabled&&e.canGoNext()&&e.nextSlideOrStory():!e.isPrevDisabled&&e.canGoPrev()&&e.prevSlideOrStory()}handleLegacyNavigation(e){1!==e||this.reachEnd?-1!==e||this.reachStart||this.prevStoryWithAnimation():this.nextStoryWithAnimation()}setStories(e){const t=new Mi(this.storyManager,this,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service);for(const r of e)this._stories.push(new Yr(this.storyManager,this,r,t,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service,this.cacheManager))}handleKeydown(e){this.handleEscKeydown(e),this.handleArrowKeydown(e)}handleEscKeydown(e){"Escape"===e.code&&this.close(ds.CloseByEsc)}handleArrowKeydown(e){"ArrowRight"===e.code&&this.goNext(),"ArrowLeft"===e.code&&this.goPrev()}clearStoryViewModels(){for(const e of this._stories)e.destroy();this._stories=f.observable.array()}hideScrollbar(e){e===kt.default&&this.scrollbarHelper.hide()}showScrollbar(e){e===kt.default&&this.scrollbarHelper.show()}handleWindowUnload(e){this.activeStory&&(this.emitStatisticV2StoryCloseEvent(this.activeStory,ds.AppClose),this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),this.storyReaderStatisticV1Service.sendData())}setActiveStoryById(e){const t=this.stories.findIndex(t=>t.id===e);if(-1===t)throw new Error(`[IAS]: No story found with ID ${e}`);return this.setActiveStoryByIndex(t)}setActiveStoryByIndex(e){const t=this._activeStoryIndex,r=this._activeStory,i=this.stories[e];if(i)return this.updateActiveStory(e,r,i),i.once($r.Started,()=>{this.statisticsController.emitTransitionEvents(t,e,r,i,this.activeStoryDuration),this._activeStoryStartTime=Date.now()}),i.markAsOpened(),i}updateActiveStory(e,t,r){return this._activeStoryIndex=e,this._activeStory=r,r}handleStoryReaderReachEnd(e){var t;e!==ds.CloseByTimer?this.close(ds.CloseByLastSlideClick):(null===(t=this.animatedNavigationController)||void 0===t?void 0:t.options.closeOnLastSlideByTimer)&&this.close(ds.CloseByTimer)}async navigateStoryWithAnimation(e,t="lastSlideClick"){this.animatedNavigationController&&!this.animatedNavigationController.animating&&-1===this._targetTransitionIndex&&(e=this.limitIndex(e),this._targetTransitionIndex=e,this._currentStoryDisplayStrategy.handleNextStoryByIndex(e),await this.animatedNavigationController.transitionByIndex(e,this._activeStoryIndex),await this.handleTransitionEnd(e,t))}limitIndex(e){return Math.max(0,Math.min(this.stories.length-1,e))}async handleTransitionEnd(e,t){if(this.activeStory){const e=new $i(this.activeStory,{action:t});this.storyManager.emit(e.name,e.toJSON())}await this.setActiveStoryByIndex(e),this._targetTransitionIndex=-1}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,n=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=U[Symbol.metadata])&&void 0!==t?t:null):void 0;l=[f.observable],c=[f.observable],d=[f.observable],h=[f.observable],u=[f.observable],p=[f.observable],g=[f.computed],m=[f.computed],v=[f.computed],b=[f.computed],w=[f.action],S=[f.action],_=[y],O=[y],k=[y],x=[y],C=[y],P=[f.action],j=[f.action],E=[f.action],I=[f.action],T=[f.action],A=[f.action],M=[f.action],L=[f.action],R=[f.action],B=[f.action],D=[f.action],N=[f.action],F=[f.action],us(e,null,l,{kind:"accessor",name:"_muted",static:!1,private:!1,access:{has:e=>"_muted"in e,get:e=>e._muted,set:(e,t)=>{e._muted=t}},metadata:r},V,z),us(e,null,c,{kind:"accessor",name:"_closeGestureInAction",static:!1,private:!1,access:{has:e=>"_closeGestureInAction"in e,get:e=>e._closeGestureInAction,set:(e,t)=>{e._closeGestureInAction=t}},metadata:r},W,$),us(e,null,d,{kind:"accessor",name:"_stories",static:!1,private:!1,access:{has:e=>"_stories"in e,get:e=>e._stories,set:(e,t)=>{e._stories=t}},metadata:r},H,q),us(e,null,h,{kind:"accessor",name:"_activeStory",static:!1,private:!1,access:{has:e=>"_activeStory"in e,get:e=>e._activeStory,set:(e,t)=>{e._activeStory=t}},metadata:r},J,K),us(e,null,u,{kind:"accessor",name:"_activeStoryIndex",static:!1,private:!1,access:{has:e=>"_activeStoryIndex"in e,get:e=>e._activeStoryIndex,set:(e,t)=>{e._activeStoryIndex=t}},metadata:r},Z,Q),us(e,null,p,{kind:"accessor",name:"_targetTransitionIndex",static:!1,private:!1,access:{has:e=>"_targetTransitionIndex"in e,get:e=>e._targetTransitionIndex,set:(e,t)=>{e._targetTransitionIndex=t}},metadata:r},Y,X),us(e,null,g,{kind:"getter",name:"targetTransitionStory",static:!1,private:!1,access:{has:e=>"targetTransitionStory"in e,get:e=>e.targetTransitionStory},metadata:r},null,G),us(e,null,m,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:r},null,G),us(e,null,v,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,G),us(e,null,b,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,G),us(e,null,w,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:r},null,G),us(e,null,S,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:r},null,G),us(e,null,_,{kind:"method",name:"showStory",static:!1,private:!1,access:{has:e=>"showStory"in e,get:e=>e.showStory},metadata:r},null,G),us(e,null,O,{kind:"method",name:"showStoryOnce",static:!1,private:!1,access:{has:e=>"showStoryOnce"in e,get:e=>e.showStoryOnce},metadata:r},null,G),us(e,null,k,{kind:"method",name:"showStoryFromSharePage",static:!1,private:!1,access:{has:e=>"showStoryFromSharePage"in e,get:e=>e.showStoryFromSharePage},metadata:r},null,G),us(e,null,x,{kind:"method",name:"showOnboardingStories",static:!1,private:!1,access:{has:e=>"showOnboardingStories"in e,get:e=>e.showOnboardingStories},metadata:r},null,G),us(e,null,C,{kind:"method",name:"showMultipleStories",static:!1,private:!1,access:{has:e=>"showMultipleStories"in e,get:e=>e.showMultipleStories},metadata:r},null,G),us(e,null,P,{kind:"method",name:"reloadStory",static:!1,private:!1,access:{has:e=>"reloadStory"in e,get:e=>e.reloadStory},metadata:r},null,G),us(e,null,j,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:r},null,G),us(e,null,E,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:r},null,G),us(e,null,I,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:r},null,G),us(e,null,T,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:r},null,G),us(e,null,A,{kind:"method",name:"toStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"toStoryWithAnimationByIndex"in e,get:e=>e.toStoryWithAnimationByIndex},metadata:r},null,G),us(e,null,M,{kind:"method",name:"navigateStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimationByIndex"in e,get:e=>e.navigateStoryWithAnimationByIndex},metadata:r},null,G),us(e,null,L,{kind:"method",name:"mute",static:!1,private:!1,access:{has:e=>"mute"in e,get:e=>e.mute},metadata:r},null,G),us(e,null,R,{kind:"method",name:"unmute",static:!1,private:!1,access:{has:e=>"unmute"in e,get:e=>e.unmute},metadata:r},null,G),us(e,null,B,{kind:"method",name:"enableCloseGesture",static:!1,private:!1,access:{has:e=>"enableCloseGesture"in e,get:e=>e.enableCloseGesture},metadata:r},null,G),us(e,null,D,{kind:"method",name:"disableCloseGesture",static:!1,private:!1,access:{has:e=>"disableCloseGesture"in e,get:e=>e.disableCloseGesture},metadata:r},null,G),us(e,null,N,{kind:"method",name:"navigateStoryWithAnimation",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimation"in e,get:e=>e.navigateStoryWithAnimation},metadata:r},null,G),us(e,null,F,{kind:"method",name:"handleTransitionEnd",static:!1,private:!1,access:{has:e=>"handleTransitionEnd"in e,get:e=>e.handleTransitionEnd},metadata:r},null,G),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class ms{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new Le,t=new Bs(this.storyManager,e);return new fs(this.storyManager,t,new Ds(this.storyManager,new Re(this.storyManager)),new Te(this.storyManager,e))}}class ys extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{c:this.mapCloseStoryReaderActionToCause(this.payload.action),st:this.payload.totalSlides,d:this.payload.durationMs})}mapCloseStoryReaderActionToCause(e){switch(e){case ds.CloseByBtn:return ot.ButtonClose;case ds.CloseByTimer:return ot.AutoClose;case ds.CloseByEsc:return ot.ButtonClose;case ds.CloseByLastSlideClick:return ot.AutoClose;case ds.CloseBySwipeDown:return ot.SwipeClose;case ds.CloseCustom:return ot.CustomClose;case ds.AppClose:return ot.AppClose;default:ot.AppClose}}}class vs extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"open"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{w:this.payload.whence})}}class bs extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"dislike"}}class ws extends at{constructor(e){super(e)}get type(){return"favorite"}}class Ss extends at{constructor(e){super(e)}get type(){return"like"}}class _s extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"share"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{m:this.payload.mode})}}class Os extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"layout-show"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{li:this.payload.layoutIndex})}}class ks extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"link"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{t:this.payload.target})}}class xs extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"slide"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{d:this.payload.durationMs})}}class Cs extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"view"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{w:this.payload.whence})}}class Ps extends at{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return this.payload.type}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),this.payload.widgetPayload)}}class js{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-goods-click"}toQueryParams(){return{wi:this.payload.widget_id,wv:this.payload.widget_value}}toJSON(){return this.payload}}class Es{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-goods-open"}toQueryParams(){return{wi:this.payload.widget_id}}toJSON(){return this.payload}}class Is{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-data-input-focus"}toQueryParams(){return{wi:this.payload.widget_id,wl:this.payload.widget_label}}}class Ts{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-data-input-save"}toQueryParams(){return{wi:this.payload.widget_id,wl:this.payload.widget_label,wv:this.payload.widget_value}}toJSON(){return this.payload}}class As{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-scrollview-impression"}toQueryParams(){return{i:this.payload.storyId,si:this.payload.slideIndex,li:this.payload.layerIndex,v:this.payload.scrollPercent}}toJSON(){return this.payload}}class Ms{constructor(e){Object.defineProperty(this,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null})}start(){this.schedule(1e4)}stop(){null!=this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}async flush(){g(`[${Bs.name}]: flush statistics by timer`);this.statisticsService.getEvents().length>0?this.schedule(1e4):this.schedule(3e4),await this.statisticsService.sendData()}schedule(e){g(`[${Bs.name}]: schedule flush statistics on ${e}ms`),this.timerId=setTimeout(()=>this.flush(),e)}}class Ls{constructor(){Object.defineProperty(this,"startTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"durationBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0})}calculate(){const e=Date.now(),t=e-this.startTime+this.durationBeforePause;return this.startTime=e,this.durationBeforePause=0,t}init(){this.durationBeforePause=0,this.startTime=Date.now()}pause(){this.durationBeforePause+=Date.now()-this.startTime}resume(){this.startTime=Date.now()}}class Rs{constructor(e,t,r,i,s){Object.defineProperty(this,"action",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"lastIndex",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"slideIndex",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideDuration",{enumerable:!0,configurable:!0,writable:!0,value:s})}toDTO(){return[this.action,this.lastIndex,this.storyId,this.slideIndex,this.slideDuration]}}class Bs extends(a()){constructor(e,t){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV1Api",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lastIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sourceInfo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"flushSheduler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideDurationCalculator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lastClickOnButtonEvent",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.flushSheduler=new Ms(this),this.slideDurationCalculator=new Ls}init(e){this.events=[],this.lastClickOnButtonEvent=null,this.sourceInfo=e,this.lastIndex=0,this.slideDurationCalculator.init(),this.flushSheduler.start()}getEvents(){return this.events.slice()}getLastIndex(){return this.lastIndex}async pause(){this.slideDurationCalculator.pause(),this.flushSheduler.stop(),await this.sendData()}resume(){this.slideDurationCalculator.resume(),this.flushSheduler.start()}sendOpenStoryEvent(e){if(this.wasClickOnButtonEvent(e))return void(this.lastClickOnButtonEvent=null);const t=this.slideDurationCalculator.calculate(),r=new Rs(1,this.lastIndex,e.storyId,e.slideIndex,t);this.addSlideEvent(r)}sendClickOnButtonEvent(e){const t=this.slideDurationCalculator.calculate(),r=new Rs(2,this.lastIndex,e.storyId,e.slideIndex,t);this.lastClickOnButtonEvent=r,this.addSlideEvent(r)}async sendData(){if(!this.sourceInfo)throw new Error("[IAS STAT V1]: You need pass source info!");const e=this.getEvents();if(!this.isEventsSendDisabled(e))try{this.cleanupData(),await this.statisticV1Api.sendStatisticEvent({data:e.map(e=>e.toDTO())})}catch(t){this.events.push(...e),console.error(t)}}async destroy(){this.flushSheduler.stop(),await this.sendData()}addSlideEvent(e){this.storyManager.isStatisticsDisabled||(this.events.push(e),this.lastIndex++)}cleanupData(){this.events=[]}wasClickOnButtonEvent(e){return this.lastClickOnButtonEvent&&this.lastClickOnButtonEvent.storyId===e.storyId&&this.lastClickOnButtonEvent.slideIndex===e.slideIndex}isEventsSendDisabled(e){var t;return 0===e.length||this.storyManager.isStatisticsDisabled||(null===(t=this.sourceInfo)||void 0===t?void 0:t.feedSlug)===Pe}}class Ds{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV2Api",{enumerable:!0,configurable:!0,writable:!0,value:t})}sendViewEvent(e){this.sendEvent(new Cs(e))}sendOpenEvent(e){this.sendEvent(new vs(e))}sendCloseEvent(e){this.sendEvent(new lt(e))}sendCloseReaderEvent(e){this.sendEvent(new ys(e))}sendSlideLayout(e){this.sendEvent(new Os(e))}sendLinkEvent(e){this.sendEvent(new ks(e))}sendLikeEvent(e){this.sendEvent(new Ss(e))}sendDislikeEvent(e){this.sendEvent(new bs(e))}sendFavoriteEvent(e){this.sendEvent(new ws(e))}sendShareEvent(e){this.sendEvent(new _s(e))}sendSlideEvent(e){this.sendEvent(new xs(e))}sendWidgetEvent(e,t=!1){this.sendEvent(new Ps(e),t)}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class Ns extends Error{constructor(e){super(`Invalid language tag: ${e}. The "lang" value must be comply with the RFC 5646 (also known as BCP 47). Examples of valid language tags include "en-US", "fr-FR", "es-ES", etc.`),this.name="IasInvalidLanguageTagError"}}const Fs="en-US";class Us{constructor(e=Fs){Object.defineProperty(this,"languageCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"countryCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tag",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rawData",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.rawData=e;const t=this.normalizeAndEnsureCompatibility(e),r=this.validateTag(t);this.parseTag(r)}isValidTag(e){return/^[a-z]+-[a-zA-Z]+$/.test(e)}toRawData(){return this.rawData}toString(){return this.tag}normalizeAndEnsureCompatibility(e){const t=e.toLowerCase();return this.ensureBackwardCompatibility(t)}ensureBackwardCompatibility(e){var t;return null!==(t={ru:"ru-RU",en:"en-US"}[e])&&void 0!==t?t:e}validateTag(e){return this.isValidTag(e)?e:(console.error(new Ns(e).message),this.getNavigatorTag())}getNavigatorTag(){const e=navigator.language.toLowerCase();return this.isValidTag(e)?e:(console.error(`Invalid navigator language tag: ${e}`),Fs)}parseTag(e){const[t,r]=e.split("-");this.languageCode=t,this.countryCode=r.toUpperCase(),this.tag=`${this.languageCode}-${this.countryCode}`}}class Gs{constructor(e){var t,r;Object.defineProperty(this,"fullscreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"safeAreaInsets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fullscreen=null!==(t=e.fullscreen)&&void 0!==t&&t,this.safeAreaInsets=null!==(r=e.safeAreaInsets)&&void 0!==r?r:null}}var Vs=j(7144),zs=j.n(Vs);class Ws extends Error{constructor(){super("[IAS]: you must pass the <userId> value"),this.name="IasEmptyUserIdError"}}class $s extends Error{constructor(e,t){super(`[IAS]: tags (joined by ',') "${e.join(",")}" is bigger then ${t} bytes`),this.name="IasTagsLengthError"}}class Hs extends Error{constructor(e,t){super(`[IAS]: userId "${e}" is bigger then ${t} bytes`),this.name="IasUserIdLengthError"}}var qs=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Js=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ks=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Zs=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Qs=(()=>{var e,t,r,i,a,o,n,l;let c,d,h,u,p,g,m,v,b=s.EventEmitter,w=[],S=[],O=[],k=[],x=[],C=[],P=[],j=[],E=[],I=[],T=[],M=[],L=[],R=[],B=[];return e=class extends b{get _apiKey(){return Ks(this,t,"f")}set _apiKey(e){Zs(this,t,e,"f")}get _tags(){return Ks(this,r,"f")}set _tags(e){Zs(this,r,e,"f")}get _lang(){return Ks(this,i,"f")}set _lang(e){Zs(this,i,e,"f")}get _dir(){return Ks(this,a,"f")}set _dir(e){Zs(this,a,e,"f")}get _anonymous(){return Ks(this,o,"f")}set _anonymous(e){Zs(this,o,e,"f")}get _options(){return Ks(this,n,"f")}set _options(e){Zs(this,n,e,"f")}get _userId(){return Ks(this,l,"f")}set _userId(e){Zs(this,l,e,"f")}constructor(e,s){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(qs(this,w),e)}),t.set(this,qs(this,S,"")),r.set(this,(qs(this,O),qs(this,k,[]))),i.set(this,(qs(this,x),qs(this,C,new Us))),a.set(this,(qs(this,P),qs(this,j,xt.LTR))),o.set(this,(qs(this,E),qs(this,I,!1))),n.set(this,(qs(this,T),qs(this,M,{}))),l.set(this,(qs(this,L),qs(this,R,""))),Object.defineProperty(this,"_disableDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:(qs(this,B),!1)}),Object.defineProperty(this,"_appPackageId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_textPlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_imagePlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isStatisticsDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userIdSign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isInited",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_hybridApp",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_fontsPrefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.update(s),this._isInited=!0}get userId(){return this._userId}get userIdSign(){return this._userIdSign}get isStatisticsDisabled(){return this._isStatisticsDisabled||"com.inappstory.webpreview"===this._appPackageId||this._anonymous}get appPackageId(){return this._appPackageId}get apiKey(){return this._apiKey}get tags(){return this._tags}get lang(){return this._lang}get disableDeviceId(){return this._disableDeviceId}get textPlaceholders(){return this._textPlaceholders}get imagePlaceholders(){return this._imagePlaceholders}get dir(){return this._dir}get isLtr(){return this._dir===xt.LTR}get anonymous(){return this._anonymous}get fontPrefix(){return this._fontsPrefix}get hybridApp(){return this._hybridApp}get options(){return this._options}get cache(){return this._cache}disableStatistic(){this._isStatisticsDisabled=!0}enableStatistic(){this._isStatisticsDisabled=!1}async setApiKey(e){this._apiKey!==e&&(this.defineApiBaseUrlByKey(e),this._apiKey=e,this._isInited&&await this.reloadSdk())}async setUserId(e,t){if(this._disableDeviceId&&(null==e||""===e))throw new Ws;if((A()(e)||zs()(e))&&this._userId!==e){if(this._anonymous)return this._userId="",this._userIdSign=void 0,void console.warn("[IAS]: user ID in anonymous access mode will be ignored");(new Xs).checkUserIdLength(e.toString()).validate(),this._userId=e,this._userIdSign=t,this._isInited&&await this.reloadSdk()}}async setLang(e){e&&A()(e)&&this._lang.toRawData()!==e&&(this._lang=new Us(e),this._isInited&&await this.reloadSdk())}setTextPlaceholders(e={}){if(!ti()(e))return;const t=this.mapTextPlaceholders(e);xe()(this._textPlaceholders,t)||(this._textPlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._textPlaceholders))}setImagePlaceholders(e={}){if(!ti()(e))return;const t=this.mapImagePlaceholders(e);xe()(this._imagePlaceholders,t)||(this._imagePlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._imagePlaceholders))}setTags(e){xe()(this._tags,e)||((new Xs).checkTagsLength(e).validate(),this._tags=_(e))}setDir(e){var t;this._dir=e?e.toString():null!==(t=getComputedStyle(document.documentElement).direction)&&void 0!==t?t:xt.LTR}async setAnonymous(e){this._anonymous!==Boolean(e)&&(this._anonymous=Boolean(e),this._isInited&&await this.reloadSdk())}setOptions(e={}){JSON.stringify(e)!==JSON.stringify(this._options)&&(this._options=e)}setHybridApp(e){this._hybridApp=e?new Gs(e):null}update(e){var t,r,i,s,a,o,n;this._fontsPrefix=null!==(t=e.fontPrefix)&&void 0!==t?t:"",this._appPackageId=null!==(r=e.appPackageId)&&void 0!==r?r:"",this._disableDeviceId=Boolean(e.disableDeviceId),this.setOptions(e.options),this.setApiKey(e.apiKey).catch(console.error),this.setAnonymous(e.anonymous),this.setUserId(null!==(i=e.userId)&&void 0!==i?i:"",e.userIdSign).catch(console.error),this.setLang(e.lang).catch(console.error),this.setTextPlaceholders(null!==(s=e.placeholders)&&void 0!==s?s:{}),this.setImagePlaceholders(null!==(a=e.imagePlaceholders)&&void 0!==a?a:{}),this.setTags(null!==(o=e.tags)&&void 0!==o?o:[]),this.setDir(e.dir),this.setHybridApp(e.hybridApp),this._cache=e.cache?Object.assign(Object.assign({},e.cache),{prefetch:null===(n=e.cache.prefetch)||void 0===n||n}):null}mapTextPlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new de(r,i));return t}mapImagePlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new ce(r,i));return t}defineApiBaseUrlByKey(e){const t=ii.parseAndDefine(e);ra.baseURL=`${t}/v2/`}async reloadSdk(){try{this.storyManager.emit("requestSDKReload"),this.storyManager.rootStore.sessionStore.close(),this.storyManager.closeAllReaders(),await this.storyManager.reloadAllStoryLists(),await this.storyManager.reloadAllStackedStoryLists()}catch(e){console.error(e)}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=b[Symbol.metadata])&&void 0!==t?t:null):void 0;c=[f.observable],d=[f.observable],h=[f.observable],u=[f.observable],p=[f.observable],g=[f.observable],m=[f.observable],v=[y],Js(e,null,c,{kind:"accessor",name:"_apiKey",static:!1,private:!1,access:{has:e=>"_apiKey"in e,get:e=>e._apiKey,set:(e,t)=>{e._apiKey=t}},metadata:r},S,O),Js(e,null,d,{kind:"accessor",name:"_tags",static:!1,private:!1,access:{has:e=>"_tags"in e,get:e=>e._tags,set:(e,t)=>{e._tags=t}},metadata:r},k,x),Js(e,null,h,{kind:"accessor",name:"_lang",static:!1,private:!1,access:{has:e=>"_lang"in e,get:e=>e._lang,set:(e,t)=>{e._lang=t}},metadata:r},C,P),Js(e,null,u,{kind:"accessor",name:"_dir",static:!1,private:!1,access:{has:e=>"_dir"in e,get:e=>e._dir,set:(e,t)=>{e._dir=t}},metadata:r},j,E),Js(e,null,p,{kind:"accessor",name:"_anonymous",static:!1,private:!1,access:{has:e=>"_anonymous"in e,get:e=>e._anonymous,set:(e,t)=>{e._anonymous=t}},metadata:r},I,T),Js(e,null,g,{kind:"accessor",name:"_options",static:!1,private:!1,access:{has:e=>"_options"in e,get:e=>e._options,set:(e,t)=>{e._options=t}},metadata:r},M,L),Js(e,null,m,{kind:"accessor",name:"_userId",static:!1,private:!1,access:{has:e=>"_userId"in e,get:e=>e._userId,set:(e,t)=>{e._userId=t}},metadata:r},R,B),Js(e,null,v,{kind:"method",name:"reloadSdk",static:!1,private:!1,access:{has:e=>"reloadSdk"in e,get:e=>e.reloadSdk},metadata:r},null,w),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Ys{get userId(){return""}get userIdSign(){return""}get isStatisticsDisabled(){return!1}get appPackageId(){return""}get apiKey(){return""}get tags(){return[]}get lang(){return new Us}get disableDeviceId(){return!1}get textPlaceholders(){return[]}get imagePlaceholders(){return[]}get dir(){return xt.LTR}get isLtr(){return!0}get anonymous(){return!1}get fontPrefix(){return""}get hybridApp(){return null}get options(){return{}}get cache(){return null}disableStatistic(){}enableStatistic(){}async setApiKey(e){}async setUserId(e,t){}async setLang(e){}setTextPlaceholders(e){}setImagePlaceholders(e){}setTags(e){}setDir(e){}update(e){}on(e,t){return this}off(e,t){return this}emit(e,...t){}}class Xs{constructor(){Object.defineProperty(this,"errors",{enumerable:!0,configurable:!0,writable:!0,value:[]})}checkUserIdLength(e){return e.length>0&&this.getByteLength(e.toString())>255&&this.errors.push(new Hs(e,255)),this}checkTagsLength(e){return e.length>0&&this.getByteLength(e.join(","))>4e3&&this.errors.push(new $s(e,4e3)),this}validate(){if(this.errors.length>0)throw this.errors.shift()}getByteLength(e){let t=e.length;for(let r=e.length-1;r>=0;r--){const i=e.charCodeAt(r);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&r--}return t}}class ea{constructor(e){var t;Object.defineProperty(this,"_baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_baseHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"interceptors",{enumerable:!0,configurable:!0,writable:!0,value:{request:new te,response:new te}}),this._baseURL=null!==(t=null==e?void 0:e.baseURL)&&void 0!==t?t:""}get baseURL(){return this._baseURL}set baseURL(e){this._baseURL=e}set baseHeaders(e){this._baseHeaders=e}async request(e){try{const t=await this.interceptors.request.run(e),r=await this.dispatchRequest(t);return await this.interceptors.response.run(r)}catch(e){if(e instanceof h)throw e;throw h.createByFetchError(e)}}get(e,t={}){return this.request(Object.assign(Object.assign({},t),{method:"get",url:e}))}post(e,t,r={}){return this.request(Object.assign(Object.assign({},r),{method:"post",url:e,data:t}))}put(e,t,r={}){return this.request(Object.assign(Object.assign({},r),{method:"put",url:e,data:t}))}patch(e,t,r={}){return this.request(Object.assign(Object.assign({},r),{method:"patch",url:e,data:t}))}sendBeacon(e,t){return new Promise(r=>{if("sendBeacon"in navigator){const i=this.createBeaconParams(),s=`${l(this.baseURL)}/${c(e)}?${i.toString()}`,a=d(t);this.isEmptyFormData(a)||navigator.sendBeacon(s,a),r()}else this.post(e,t).then(()=>r(),()=>r())})}createBeaconParams(){const e=ol.rootStore.sessionStore.session,t=new URLSearchParams({access_token:ol.config.apiKey,session_id:(null==e?void 0:e.id)||"",x_user_agent:ol.userAgent}),r=ol.config;return null!=r.appPackageId&&t.append("x_app_package_id",r.appPackageId),t}isEmptyFormData(e){let t=!1;return null!=Array.from&&null!=e.keys&&(t=0===Array.from(e.keys()).length),t}async dispatchRequest(e){const t=Object.assign(Object.assign({},this._baseHeaders),e.headers),r=this.buildURL(e.url,e.params),i=e.method?e.method.toUpperCase():"GET";let s=null;e.data&&(s=JSON.stringify(this.buildBody(e.data)),t["Content-Type"]="application/json");const a=await fetch(r.toString(),{method:i,body:"GET"===i||"HEAD"===i?null:s,headers:t,credentials:"omit",signal:e.signal});let o={};if(204!==a.status)try{o=await a.json()}catch(e){o={}}const n={data:o,status:a.status,statusText:a.statusText,headersRaw:a.headers,headers:Object.fromEntries(a.headers.entries()),ok:a.ok};if(!a.ok)throw h.createByRequestError(n);return n}buildURL(e,t){const r=t?new URLSearchParams(this.buildQuery(t)).toString():"";return new URL(`${c(e)}${r?"?"+r:""}`,this._baseURL)}buildQuery(e,t){const r=[];for(const[i,s]of Object.entries(e)){if(null==s||""===s||Number.isNaN(s))continue;const e=t?`${t}[${i}]`:i;"object"!=typeof s||Array.isArray(s)?r.push([e,s]):r.push(...this.buildQuery(s,e))}return r}buildBody(e){const t={};for(const[r,i]of Object.entries(e))if(null!=i&&""!==i)if("object"!=typeof i||Array.isArray(i))t[r]=i;else{const e=this.buildBody(i);Object.keys(e).length&&(t[r]=e)}return t}}const ta=new ea;ta.interceptors.request.use(e=>{var t;const r=ol.config,i=ol.rootStore.sessionStore.session,s=null==i?void 0:i.id;if(r instanceof Ys)throw new ie;if(!r.apiKey)throw new re(e.url);if(!Boolean(null===(t=e.meta)||void 0===t?void 0:t.public)&&!s)throw new re(e.url);return e.headers=Object.assign(Object.assign({},e.headers),{Authorization:`Bearer ${r.apiKey}`,"Accept-Language":r.lang.toString(),"X-Request-Id":(0,n.v4)(),"X-User-Agent":ol.userAgent}),r.userId&&!r.anonymous&&(e.headers["X-User-Id"]=r.userId.toString()),s&&(e.headers["Auth-Session-Id"]=s),null!=r.appPackageId&&(e.headers["X-App-Package-Id"]=r.appPackageId),r.disableDeviceId||r.anonymous||(e.headers["X-Device-Id"]=ee.deviceId),e});const ra=ta;class ia extends Error{constructor(e){super(`[IAM]: not found IAM for ID <${e}>`),this.name="IamNotFoundByIdError"}}class sa extends Error{constructor(e){super(`[IAM]: not found IAM limit for ID <${e}>`),this.name="IamNotFoundLimitError"}}var aa=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},oa=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0};const na="campaign_name,id,events,appearance,type,frequency_limit,display_to,display_from,disable_close,need_placeholders,has_limit,slides",la=na.split(",").map(e=>`messages.${e}`).join(",");let ca=(()=>{var e;let t,r,i,s=[];return e=class{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(aa(this,s),e)})}async fetchAll({tags:e,options:t}){return(await ra.post("inappmessaging",{tags:e.join(","),options:t},{params:{fields:la,expand:"messages.slides"}})).data.messages}async fetchContext({needFetchStyles:e,messageIds:t}){return(await ra.get("inappmessaging/message-context",{params:{fields:"widgetsData"+(e?",style":""),id:t.join()}})).data}async fetchById(e){const t=(await ra.get(`inappmessaging/message/${e}`,{params:{expand:"slides",fields:na}})).data;if(!t)throw new ia(e);return t}async emitMessageEvent(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log(`[IAM]: message <${t.type.toUpperCase()}> event`,{messageId:e,messageEvent:t,type:t.type});await ra.sendBeacon(`/inappmessaging/message/${e}/event/${t.type}`,t.toQueryParams())}catch(e){console.error(e)}}async fetchUserData(e){try{return(await ra.get(`/inappmessaging/message/${e}/data`)).data.data}catch(e){console.error(e)}}async updateUserData(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log("[IAM]: update user data",{messageId:e,payload:t});await ra.request({url:`/inappmessaging/message/${e}/data`,method:"put",data:{data:t}})}catch(e){console.error(e)}}async checkMesageLimit(e){if(this.storyManager.isStatisticsDisabled)return{canOpen:!0};const t=(await ra.post("inappmessaging/message-limit",{id:[e]})).data.find(t=>t.messageId.toString()===e.toString());if(!t)throw new sa(e);return t}},(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[y],r=[y],i=[y],oa(e,null,t,{kind:"method",name:"fetchAll",static:!1,private:!1,access:{has:e=>"fetchAll"in e,get:e=>e.fetchAll},metadata:a},null,s),oa(e,null,r,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:a},null,s),oa(e,null,i,{kind:"method",name:"fetchById",static:!1,private:!1,access:{has:e=>"fetchById"in e,get:e=>e.fetchById},metadata:a},null,s),a&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),e})();class da{constructor(e){var t;Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cardAppearance",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_zIndex",{enumerable:!0,configurable:!0,writable:!0,value:1e3}),this.background=this.mapBackgroundDtoToModel(e.background),this.cardAppearance=null!==(t=e.card_appearance)&&void 0!==t?t:{}}get zIndex(){return this._zIndex}mapBackgroundDtoToModel(e){if(!e||0===e.alpha)return"transparent";if("solid"in e)return this.applyAlphaToColor(e.solid,e.alpha);if("linear_gradient"in e){const{angle:t,color_step_list:r}=e.linear_gradient;return`linear-gradient(${t}deg, ${r.map(t=>`${this.applyAlphaToColor(t.color,e.alpha)} ${t.position}%`).join(", ")})`}return"transparent"}applyAlphaToColor(e,t){if(e.startsWith("#")){const r=e.slice(1),i=3===r.length;return`rgba(${parseInt(i?r[0]+r[0]:r.slice(0,2),16)}, ${parseInt(i?r[1]+r[1]:r.slice(2,4),16)}, ${parseInt(i?r[2]+r[2]:r.slice(4,6),16)}, ${t})`}return e}applyClientAppearance(e){const t=null==e?void 0:e.zIndex;this._zIndex=null!=t?parseInt(t.toString()):this._zIndex}}class ha extends da{constructor(e){var t,r,i,s,a,o,n,l,c,d,h;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"borderRadius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"backdrop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closeButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.borderRadius=null!==(t=e.corner_radius)&&void 0!==t?t:16,this.contentRatio=e.content_ratio||.64,this.backdrop={opacity:null!==(i=null===(r=e.backdrop)||void 0===r?void 0:r.alpha)&&void 0!==i?i:.3},this.closeButton={marginTop:null!==(a=null===(s=e.close_button)||void 0===s?void 0:s.top_margin)&&void 0!==a?a:8,width:null!==(n=null===(o=e.close_button)||void 0===o?void 0:o.width)&&void 0!==n?n:32,height:null!==(c=null===(l=e.close_button)||void 0===l?void 0:l.height)&&void 0!==c?c:4,backgroundColor:null!==(h=null===(d=e.close_button)||void 0===d?void 0:d.color)&&void 0!==h?h:"#00000080"}}}var ua,pa,ga,fa,ma,ya;!function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(ua||(ua={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(pa||(pa={}));class va extends da{constructor(e){var t,r,i,s,a,o,n;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"borderRadius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"animationType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"backdrop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"backgroundColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closeBtnPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"horizontalPadding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.borderRadius=null!==(t=e.corner_radius)&&void 0!==t?t:16,this.contentRatio=e.content_ratio||.64,this.animationType=null!==(r=e.animation_type)&&void 0!==r?r:ua.None,this.backdrop={opacity:null!==(s=null===(i=e.backdrop)||void 0===i?void 0:i.alpha)&&void 0!==s?s:.3},this.backgroundColor=null!==(a=e.background_color)&&void 0!==a?a:"#FFFFFFFF",this.closeBtnPosition=null!==(o=e.close_button_position)&&void 0!==o?o:pa.End,this.horizontalPadding=null!==(n=e.horizontal_padding)&&void 0!==n?n:16}}class ba extends da{constructor(e){var t,r;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:9/16}),Object.defineProperty(this,"animationType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closeBtnPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.animationType=null!==(t=e.animation_type)&&void 0!==t?t:ua.None,this.closeBtnPosition=null!==(r=e.close_button_position)&&void 0!==r?r:pa.End}}!function(e){e[e.None=0]="None",e[e.TransitionFromNearestVerticalEdge=1]="TransitionFromNearestVerticalEdge",e[e.AlphaAndZoom=2]="AlphaAndZoom"}(ga||(ga={})),function(e){e[e.Bottom=0]="Bottom",e[e.Top=1]="Top"}(fa||(fa={})),function(e){e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End"}(ma||(ma={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(ya||(ya={}));class wa extends da{constructor(e){var t,r,i,s,a,o,n,l;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:320}),Object.defineProperty(this,"closeBtnPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"animationType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"borderRadius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"horizontalOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"horizontalPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.contentRatio=null!==(t=e.content_ratio)&&void 0!==t?t:6.4,this.closeBtnPosition=null!==(r=e.close_button_position)&&void 0!==r?r:ya.End,this.animationType=null!==(i=e.animation_type)&&void 0!==i?i:ga.None,this.borderRadius=null!==(s=e.corner_radius)&&void 0!==s?s:16,this.verticalOffset=null!==(a=e.vertical_offset)&&void 0!==a?a:16,this.horizontalOffset=null!==(o=e.horizontal_offset)&&void 0!==o?o:16,this.verticalPosition=null!==(n=e.vertical_position)&&void 0!==n?n:fa.Bottom,this.horizontalPosition=null!==(l=e.horizontal_position)&&void 0!==l?l:ma.Center}applyClientAppearance(e){var t;super.applyClientAppearance(e);const r=null===(t=null==e?void 0:e.toast)||void 0===t?void 0:t.width;this.maxWidth=null!=r?parseInt(r.toString()):this.maxWidth}}class Sa{create(e,t){switch(e){case Pa.BottomSheet:return new ha(t);case Pa.Modal:return new va(t);case Pa.Fullscreen:return new ba(t);case Pa.Toast:return new wa(t)}}}var _a=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Oa=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ka=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},xa=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Ca=(()=>{var e,t;let r,i=[],s=[];return e=class{get _html(){return ka(this,t,"f")}set _html(e){xa(this,t,e,"f")}constructor(e){Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.set(this,Oa(this,i,"")),Object.defineProperty(this,"_payload",{enumerable:!0,configurable:!0,writable:!0,value:Oa(this,s)}),Object.defineProperty(this,"_rawHtml",{enumerable:!0,configurable:!0,writable:!0,value:""})}get html(){return this._html}get payload(){return this._payload}updateByDto(e){var t;this._rawHtml=this.getSlideHtml(e),this._html=this._rawHtml,this._payload=null===(t=e.event_payload)||void 0===t?void 0:t.payload}applyFontPrefix(e){this._rawHtml=P(this._rawHtml,e),this._html=this._rawHtml}updatePlaceholders(e){let t=this._rawHtml;for(const r of e)t=x(t,`%${r.key}%`,r.value);this._html=t}getSlideHtml(e){var t;let r=e.html;return r=x(r,"{{nonce}}",null!==(t=k())&&void 0!==t?t:""),r}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],_a(e,null,r,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},i,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Pa,ja,Ea,Ia,Ta,Aa,Ma;!function(e){e[e.BottomSheet=1]="BottomSheet",e[e.Modal=2]="Modal",e[e.Fullscreen=3]="Fullscreen",e[e.Toast=4]="Toast"}(Pa||(Pa={})),function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(ja||(ja={})),function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right"}(Ea||(Ea={})),function(e){e[e.None=0]="None",e[e.TransitionFromNearestVerticalEdge=1]="TransitionFromNearestVerticalEdge",e[e.AlphaAndZoom=2]="AlphaAndZoom"}(Ia||(Ia={})),function(e){e[e.Bottom=0]="Bottom",e[e.Top=1]="Top"}(Ta||(Ta={})),function(e){e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End"}(Aa||(Aa={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(Ma||(Ma={}));class La{constructor(e,t){Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=t.style,this.widgetsData=this.mapIamMessageContextDto(e,t)}mapIamMessageContextDto(e,t){var r;const i={},s=null!==(r=t.widgetsData)&&void 0!==r?r:{};for(const t in s)Array.isArray(s[t])||(i[t]=s[t][e]);return i}updateNarrativeData(e){this.widgetsData._narrative_saved_data=e}}var Ra=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ba=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Da=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Na=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const Fa=(0,n.v4)();let Ua=(()=>{var e,t,r,i,s,a,o,l,c,d,h;let u,p,g,m,y,v,b,w,S,_,O,k,x=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[],V=[],z=[],W=[],$=[];return e=class{get _id(){return Da(this,t,"f")}set _id(e){Na(this,t,e,"f")}get _events(){return Da(this,r,"f")}set _events(e){Na(this,r,e,"f")}get _type(){return Da(this,i,"f")}set _type(e){Na(this,i,e,"f")}get _slides(){return Da(this,s,"f")}set _slides(e){Na(this,s,e,"f")}get _appearanceOptions(){return Da(this,a,"f")}set _appearanceOptions(e){Na(this,a,e,"f")}get _needPlaceholders(){return Da(this,o,"f")}set _needPlaceholders(e){Na(this,o,e,"f")}get _hasLimit(){return Da(this,l,"f")}set _hasLimit(e){Na(this,l,e,"f")}get _disableClose(){return Da(this,c,"f")}set _disableClose(e){Na(this,c,e,"f")}get _isOnceOpened(){return Da(this,d,"f")}set _isOnceOpened(e){Na(this,d,e,"f")}get _context(){return Da(this,h,"f")}set _context(e){Na(this,h,e,"f")}constructor(e){t.set(this,(Ra(this,x),Ra(this,C,void 0))),r.set(this,(Ra(this,P),Ra(this,j,{}))),i.set(this,(Ra(this,E),Ra(this,I,void 0))),s.set(this,(Ra(this,T),Ra(this,A,[]))),a.set(this,(Ra(this,M),Ra(this,L,(new Sa).create(Pa.BottomSheet,{})))),o.set(this,(Ra(this,R),Ra(this,B,!1))),l.set(this,(Ra(this,D),Ra(this,N,!1))),c.set(this,(Ra(this,F),Ra(this,U,!1))),d.set(this,(Ra(this,G),Ra(this,V,!1))),h.set(this,(Ra(this,z),Ra(this,W,void 0))),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:(Ra(this,$),null)}),Object.defineProperty(this,"_displayFrom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_displayTo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_campaignName",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_iterationId",{enumerable:!0,configurable:!0,writable:!0,value:Fa}),this._id=e,this._context=new La(this._id,{style:"",widgetsData:{}})}get id(){return this._id}get openTime(){return this._openTime}get iterationId(){return this._iterationId}get timeSinceLastShow(){return Date.now()-this._openTime}get needPlaceholders(){return this._needPlaceholders}get frequencyLimitTimeExceeded(){return null===this._frequencyLimit?this._isOnceOpened:0!==this._frequencyLimit&&Math.trunc(this.timeSinceLastShow/1e3)<=this._frequencyLimit}get withinDisplayTimeRange(){const e=Math.trunc(Date.now()/1e3);return(!this._displayFrom||e>=this._displayFrom)&&(!this._displayTo||e<=this._displayTo)}get isOnceOpened(){return this._isOnceOpened}get hasLimit(){return this._hasLimit}get events(){return this._events}get slides(){return this._slides}get context(){return this._context}get appearanceOptions(){return this._appearanceOptions}get type(){return this._type}get disableClose(){return this._disableClose}destroy(){}updateByDto(e){var t,r,i;this._events=this.mapMessageEventsByDto(null!==(t=e.events)&&void 0!==t?t:[]),this._type=e.type,this._disableClose=Boolean(e.disable_close),this._campaignName=e.campaign_name,this._frequencyLimit=e.frequency_limit,this._displayFrom=null!==(r=e.display_from)&&void 0!==r?r:null,this._displayTo=null!==(i=e.display_to)&&void 0!==i?i:null,this._hasLimit=Boolean(e.has_limit),this._appearanceOptions=(new Sa).create(this._type,e.appearance),this._needPlaceholders=e.need_placeholders,this.updateMessageSlides(e.slides)}hasEvent(e){return Boolean(this._events[e])}getEventByName(e){return this._events[e]}setContext(e){this._context=e}toPublicDto(){return{id:this._id,campaignName:this._campaignName,type:this._type}}updateMessageSlides(e){const t=[];for(const r of e){const e=new Ca(this);e.updateByDto(r),t.push(e)}this._slides=t}mapMessageEventsByDto(e){const t={};for(const r of e)t[r.name]=r;return t}static createByDto(t){const r=new e(t.id);return r.updateByDto(t),r}trackOpen(){return this._isOnceOpened=!0,this._iterationId=(0,n.v4)(),this._openTime=Date.now(),this._iterationId}applyFontPrefix(e){for(const t of this._slides)t.applyFontPrefix(e)}updatePlaceholders(e){for(const t of this._slides)t.updatePlaceholders(e)}applyClientAppearance(e){this.appearanceOptions.applyClientAppearance(e)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;u=[f.observable],p=[f.observable],g=[f.observable],m=[f.observable],y=[f.observable],v=[f.observable],b=[f.observable],w=[f.observable],S=[f.observable],_=[f.observable],O=[f.action],k=[f.action],Ba(e,null,u,{kind:"accessor",name:"_id",static:!1,private:!1,access:{has:e=>"_id"in e,get:e=>e._id,set:(e,t)=>{e._id=t}},metadata:t},C,P),Ba(e,null,p,{kind:"accessor",name:"_events",static:!1,private:!1,access:{has:e=>"_events"in e,get:e=>e._events,set:(e,t)=>{e._events=t}},metadata:t},j,E),Ba(e,null,g,{kind:"accessor",name:"_type",static:!1,private:!1,access:{has:e=>"_type"in e,get:e=>e._type,set:(e,t)=>{e._type=t}},metadata:t},I,T),Ba(e,null,m,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},A,M),Ba(e,null,y,{kind:"accessor",name:"_appearanceOptions",static:!1,private:!1,access:{has:e=>"_appearanceOptions"in e,get:e=>e._appearanceOptions,set:(e,t)=>{e._appearanceOptions=t}},metadata:t},L,R),Ba(e,null,v,{kind:"accessor",name:"_needPlaceholders",static:!1,private:!1,access:{has:e=>"_needPlaceholders"in e,get:e=>e._needPlaceholders,set:(e,t)=>{e._needPlaceholders=t}},metadata:t},B,D),Ba(e,null,b,{kind:"accessor",name:"_hasLimit",static:!1,private:!1,access:{has:e=>"_hasLimit"in e,get:e=>e._hasLimit,set:(e,t)=>{e._hasLimit=t}},metadata:t},N,F),Ba(e,null,w,{kind:"accessor",name:"_disableClose",static:!1,private:!1,access:{has:e=>"_disableClose"in e,get:e=>e._disableClose,set:(e,t)=>{e._disableClose=t}},metadata:t},U,G),Ba(e,null,S,{kind:"accessor",name:"_isOnceOpened",static:!1,private:!1,access:{has:e=>"_isOnceOpened"in e,get:e=>e._isOnceOpened,set:(e,t)=>{e._isOnceOpened=t}},metadata:t},V,z),Ba(e,null,_,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},W,$),Ba(e,null,O,{kind:"method",name:"updateByDto",static:!1,private:!1,access:{has:e=>"updateByDto"in e,get:e=>e.updateByDto},metadata:t},null,x),Ba(e,null,k,{kind:"method",name:"applyClientAppearance",static:!1,private:!1,access:{has:e=>"applyClientAppearance"in e,get:e=>e.applyClientAppearance},metadata:t},null,x),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Ga{constructor(e,t,r){Object.defineProperty(this,"iterationId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"slideIndex",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideTotal",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,n.v4)()})}toQueryParams(){return{ei:this.eventId,ii:this.iterationId,si:this.slideIndex,st:this.slideTotal}}}class Va extends Ga{constructor(e){super(e.iterationId,e.slideIndex,e.slidesTotal),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{d:this.payload.duration,sa:JSON.stringify(this.payload.slideAnalytics.map(({slideIndex:e,duration:t})=>({si:e,d:t})))})}}class za extends Ga{constructor(e){super(e.iterationId,e.slideIndex,e.slidesTotal)}get type(){return"open"}}class Wa extends Ga{constructor(e){super(e.iterationId,e.slideIndex,e.slideTotal),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return this.payload.type}toQueryParams(){return Object.assign(Object.assign(Object.assign({},super.toQueryParams()),{d:this.payload.duration}),this.payload.widgetPayload)}}class $a{constructor(e){Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendOpenEvent(e){const t=new za(e);await this.iamApi.emitMessageEvent(e.messageId,t)}async sendCloseEvent(e){const t=new Va(e);await this.iamApi.emitMessageEvent(e.messageId,t)}async sendWidgetEvent(e){const t=new Wa(e);return this.iamApi.emitMessageEvent(e.messageId,t)}}class Ha extends Error{constructor(){super("[IAM]: you must close other opened readers"),this.name="IamOtherReaderIsOpenError"}}class qa extends Error{constructor(){super("[IAM]: you need preload in app messages"),this.name="IamShowOnlyIfLoadedError"}}class Ja extends Error{constructor(){super("[IAM]: show message frequency limit exceeded"),this.name="IamFrequencyLimitError"}}class Ka extends Error{constructor(){super("[IAM]: not in display time range"),this.name="IamCheckDisplayTimeRangeError"}}class Za extends Error{constructor(e){super(`[IAM]: the limit for displaying IAM with ID ${e} has been reached`),this.name="IamMessageLimitExceededError"}}class Qa{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"errors",{enumerable:!0,configurable:!0,writable:!0,value:[]})}checkOtherReadersAreClosed(){return(this.storyManager.storyReader.isOpened||this.storyManager.gameReader.isOpened)&&this.errors.push(new Ha),this}checkShowOnlyIfLoaded(e){return!this.iamStore.isLoaded&&e&&this.errors.push(new qa),this}checkFrequencyLimit(e){return e.frequencyLimitTimeExceeded&&this.errors.push(new Ja),this}checkDisplayTimeRange(e){return e.withinDisplayTimeRange||this.errors.push(new Ka),this}validate(){if(this.errors.length>0)throw this.errors.shift()}}class Ya{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:r})}async getMessageById(e,t){new Qa(this.storyManager,this.iamStore).checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t.showOnlyIfLoaded).validate();const r=await this.iamStore.findById(e);return r.hasLimit&&await this.checkMesageLimit(e),r}async getMessageByEvent(e,t){new Qa(this.storyManager,this.iamStore).checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t.showOnlyIfLoaded).validate(),await this.iamStore.preload({tags:t.tags});const r=this.iamStore.findAllByEvent(e),i=this.getMessagesSortedByEventPriority(e,r);return this.getFirstValidMessageByEvent(i)}async getFirstValidMessageByEvent(e){let t=new Error;for(const r of e)try{return await this.validateMessageByEvent(r)}catch(e){t=e}throw t}async validateMessageByEvent(e){return new Qa(this.storyManager,this.iamStore).checkFrequencyLimit(e).checkDisplayTimeRange(e).validate(),e.hasLimit&&await this.checkMesageLimit(e.id),e}async checkMesageLimit(e){const{canOpen:t}=await this.iamApi.checkMesageLimit(e);if(!t)throw new Za(e)}getMessagesSortedByEventPriority(e,t){return t.slice().sort((t,r)=>{const i=t.events[e].priority;return r.events[e].priority-i})}}class Xa{constructor(e,t,r,i){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:i}),this.desktopMode&&this.initViewportWidthForDesktopMode()}get contentRatio(){return this._contentRatio}getWidth(){return this._vw}getHeight(){return Math.ceil(this._vw/this._contentRatio)}initViewportWidthForDesktopMode(){this._vw>557&&(this._vw=557)}}class eo{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t})}get contentRatio(){return 9/16}getWidth(){return this._vw}getHeight(){return this._vh}}class to{constructor(e,t,r,i){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:i}),this.desktopMode&&this.initViewportWidthForDesktopMode()}get contentRatio(){return this._contentRatio}getWidth(){return this._vw}getHeight(){return Math.ceil(this._vw/this._contentRatio)}initViewportWidthForDesktopMode(){this._vw>557&&(this._vw=557)}}class ro{constructor(e){Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:e})}get contentRatio(){return this.params.contentRatio}getWidth(){const e=Math.max(this.params.vw-2*this.params.horizontalOffset,0);return this.params.desktopMode?Math.min(this.params.maxWidth,e):e}getHeight(){return Math.round(this.getWidth()/this.params.contentRatio)}}class io{create(e,t){switch(e){case Pa.BottomSheet:return new Xa(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case Pa.Modal:return new to(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case Pa.Fullscreen:return new eo(t.vw,t.vh);case Pa.Toast:{const e=t.appearanceOptions;return new ro({vw:t.vw,vh:t.vh,desktopMode:t.desktopMode,contentRatio:t.appearanceOptions.contentRatio,horizontalOffset:e.horizontalOffset,maxWidth:e.maxWidth})}}}}class so{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{await this.storyManager.openGame(e.gameInstanceId),this.iamMessage.pauseAndLock(),this.storyManager.gameReader.once(Xr.Close,()=>{this.iamMessage.resumeAndUnlock()})}catch(e){console.error(e)}}}class ao{constructor(e,t){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}subscribe(){document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange)}unsubscribe(){document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange)}handleDocumentVisibilityChange(){const e=this.iamReader.activeMessage;if(document.hidden)this.iamStatisticsService.sendCloseEvent({messageId:e.id,iterationId:e.iterationId,slidesTotal:e.slides.length,slideIndex:e.activeSlideIndex,duration:e.timeSinceLastShow,slideAnalytics:e.slidesAnalytics});else{const{iterationId:t}=e.open();this.iamStatisticsService.sendOpenEvent({messageId:e.id,iterationId:t,slidesTotal:e.slides.length,slideIndex:e.activeSlideIndex})}}}class oo extends Error{constructor(e){super(`[IAS]: you must close IAM with ID ${e}`),this.name="IamMessageOpenError"}}class no extends Error{constructor(e){super(`[IAS]: You can't open IAM ${e} in anonymous access mode`),this.name="IamMessageAnonymousOpen"}}class lo extends Error{constructor(e){super(`[IAS]: IAM with ID ${e} does not contain any content`),this.name="IamMessageEmptyContent"}}var co,ho=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},uo=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},po=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},go=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Loaded="loaded",e.Close="close",e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(co||(co={}));let fo=(()=>{var e,t,r;let i,s,a,n,l,c=o,d=[],h=[],u=[],p=[],g=[];return e=class extends c{get _activeMessage(){return po(this,t,"f")}set _activeMessage(e){go(this,t,e,"f")}get _closeRequested(){return po(this,r,"f")}set _closeRequested(e){go(this,r,e,"f")}constructor(e,i,s,a){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(ho(this,d),e)}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"iamDisplayService",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:a}),t.set(this,ho(this,h,null)),r.set(this,(ho(this,u),ho(this,p,!1))),Object.defineProperty(this,"visibilityObserver",{enumerable:!0,configurable:!0,writable:!0,value:ho(this,g)}),Object.defineProperty(this,"_touchController",{enumerable:!0,configurable:!0,writable:!0,value:new Lt}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new zt(window)}),this.visibilityObserver=new ao(this,this.iamStatisticsService)}get touchController(){return this._touchController}get activeMessage(){return this._activeMessage}get isLoaded(){return this.iamStore.isLoaded}get isLoading(){return this.iamStore.isLoading}get isOpened(){return Boolean(this._activeMessage)}get closeRequested(){return Boolean(this._closeRequested)}async preload(e){if(this.storyManager.config.anonymous)return console.warn("[IAS]: You can't preload IAM in anonymous access mode"),[];const t=await this.iamStore.preload(e);return this.emit(co.Loaded,{messages:t}),t}async showMessageById(e,t={}){this.throwIfAborted(t.signal),this.throwIfAnonymousUser(e),this.throwIfMessageOpened(),this.throwIfAborted(t.signal);const r=await this.iamDisplayService.getMessageById(e,t);return this.throwIfAborted(t.signal),this.throwIfEmptyContent(r),await this.open(r,t.appearance),r}async showMessageByEvent(e,t={}){this.throwIfAborted(t.signal),this.throwIfAnonymousUser(e),this.throwIfMessageOpened(),this.throwIfAborted(t.signal);const r=await this.iamDisplayService.getMessageByEvent(e,t);return this.throwIfAborted(t.signal),this.throwIfEmptyContent(r),await this.open(r,t.appearance),r}async close(){var e;(null===(e=this._activeMessage)||void 0===e?void 0:e.disableClose)||(this.forceClose(),this._closeRequested&&await new Promise(e=>{this.once(co.Close,e)}))}forceClose(){this._activeMessage&&(this._closeRequested=!0)}notifyCanBeClosed(){if(!this._activeMessage)return;const e=this._activeMessage;this._closeRequested=!1,this.clearActiveMessage(),this.visibilityObserver.unsubscribe(),this.touchController.destroy(),this.scrollbarHelper.show(),this.emitCloseEvent(e)}async open(e,t){e.updatePlaceholders(this.storyManager.rootStore.placeholderStore.placeholders),e.applyClientAppearance(t),this.touchController.init(document.body),this.setActiveMessage(e),this.visibilityObserver.subscribe(),e.type!==Pa.Toast&&this.scrollbarHelper.hide()}destroy(){}emitWidgetEvent(e){this.activeMessage&&(this.emit(co.WidgetEvent,{payload:this.activeMessage.payload,message:this.activeMessage.toPublicDto(),name:e.type,data:e.widgetPayload}),this.storyManager.emit(mt.WidgetEvent,{name:e.type,data:e.widgetPayload}))}emitCloseEvent(e){this.emit(co.Close,{payload:e.payload,message:e.toPublicDto()})}setActiveMessage(e){const t=new ko(this,this.storyManager,e,this.iamStatisticsService),{iterationId:r}=t.open();this._activeMessage=t,this.iamStatisticsService.sendOpenEvent({messageId:t.id,iterationId:r,slidesTotal:t.slides.length,slideIndex:t.activeSlideIndex})}clearActiveMessage(){if(!this._activeMessage)return;const e=this._activeMessage;this._activeMessage=null,this.iamStatisticsService.sendCloseEvent({messageId:e.id,iterationId:e.iterationId,slidesTotal:e.slides.length,slideIndex:e.activeSlideIndex,duration:e.timeSinceLastShow,slideAnalytics:e.slidesAnalytics}),e.destroy()}throwIfMessageOpened(){if(this.activeMessage)throw new oo(this.activeMessage.id)}throwIfAnonymousUser(e){if(this.storyManager.config.anonymous)throw new no(e)}throwIfEmptyContent(e){if(!e.slides.length)throw new lo(e.id)}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}},t=new WeakMap,r=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=c[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[f.observable],s=[f.observable],a=[f.action],n=[f.action],l=[f.action],uo(e,null,i,{kind:"accessor",name:"_activeMessage",static:!1,private:!1,access:{has:e=>"_activeMessage"in e,get:e=>e._activeMessage,set:(e,t)=>{e._activeMessage=t}},metadata:r},h,u),uo(e,null,s,{kind:"accessor",name:"_closeRequested",static:!1,private:!1,access:{has:e=>"_closeRequested"in e,get:e=>e._closeRequested,set:(e,t)=>{e._closeRequested=t}},metadata:r},p,g),uo(e,null,a,{kind:"method",name:"showMessageById",static:!1,private:!1,access:{has:e=>"showMessageById"in e,get:e=>e.showMessageById},metadata:r},null,d),uo(e,null,n,{kind:"method",name:"showMessageByEvent",static:!1,private:!1,access:{has:e=>"showMessageByEvent"in e,get:e=>e.showMessageByEvent},metadata:r},null,d),uo(e,null,l,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:r},null,d),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:"IamReaderViewModel"}),e})();class mo{constructor(e,t,r){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:r})}handle(e){const t=e.linkTarget,r={src:Ct.IamReader,data:{type:this.iamMessage.type,id:this.iamMessage.id,index:this.iamMessage.activeSlideIndex,url:t,elementId:e.elementId,payload:this.iamMessage.payload}};this.storyManager.storyLinkClickHandler(r),this.storyManager.emit("clickOnButton",r),this.iamReader.emit(co.ClickOnButton,r)}}class yo{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{await this.storyManager.showStory(e.storyId),this.message.pauseAndLock(),this.storyManager.storyReader.once(cs.Close,()=>{this.message.resumeAndUnlock()})}catch(e){console.error(e)}}}class vo{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class bo{constructor(e,t,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"activeMessageNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new vo}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new vo})}onVerticalScrollChange(e){}onWidgetRequirePauseUI(){this.iamMessage.pauseAndLock()}onWidgetRequireResumeUI(){this.iamMessage.resumeAndUnlock()}productCartUpdate(e){return Promise.reject({message:"Not implemented"})}productCartClicked(){}async productCartGetState(){return Promise.reject("Not implemented")}onEvent(e,t){try{switch(e){case"showSlide":this.iamMessage.onShowSlide(t.index);case"slideLeft":this.iamMessage.onSlideLeft(t.index)}}catch(e){console.error(e)}}onCardLoadingStateChange(e){switch(e){case 0:this.iamMessage.showLoaderScreen();break;case 1:this.iamMessage.hideErrorScreen(),this.iamMessage.hideLoaderScreen();break;case 2:this.iamMessage.showErrorScreen()}}clearActiveNarrativeDataCache(){this.activeMessageNarrativeDataCache.clear()}writeToClipboard(e){(new p).copy(e.textValue)}updateCardServerDataLocally(e){this.iamMessage.context.updateNarrativeData(e)}openUrl(e){"swipeUpItems"!==e.type&&new mo(this.iamReader,this.storyManager,this.iamMessage).handle({linkTarget:e.link.target,elementId:e.elementId})}closeCard(e){this.iamReader.forceClose()}openStory(e,t){new yo(this.storyManager,this.iamMessage).handle({storyId:e})}openGame(e){new so(this.storyManager,this.iamMessage).handle({gameInstanceId:e})}disableVerticalSwipeGesture(){this.iamReader.touchController.disableVerticalSwipeGesture()}enableVerticalSwipeGesture(){this.iamReader.touchController.enableVerticalSwipeGesture()}disableHorizontalSwipeGesture(){this.iamReader.touchController.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.iamReader.touchController.enableHorizontalSwipeGesture()}async getCardLocalData(){let e=this.narrativeDataCache.get(`iam_${this.iamMessage.id}_data_${this.storyManager.rootStore.sessionStore.userId}`);return e?JSON.parse(e):{}}setCardLocalData(e,t){let r=JSON.stringify(e);this.narrativeDataCache.set(`iam_${this.iamMessage.id}_data_${this.storyManager.rootStore.sessionStore.userId}`,r),this.iamMessage.context.updateNarrativeData(e),t&&this.iamMessage.updateUserData(r).catch(console.error)}getCardServerData(e){var t;return null!==(t=this.iamMessage.context.widgetsData._narrative_saved_data)&&void 0!==t?t:null}showCardTextInput(e,t){}setCardSessionValue(e,t){this.activeMessageNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.activeMessageNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const r=this.iamMessage.context.widgetsData;switch(t){case"rangeSlider":return r._narrative_range_slider_data;case"poll":return r._narrative_poll_data;case"vote":return r._narrative_vote_data;case"reactions":return r._narrative_reactions_data}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await ra.request({url:e,method:t,params:null!=r?r:{},headers:null!=i?i:{},data:null!=s?s:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof h)return{status:null!==(o=e.networkStatus)&&void 0!==o?o:400,headers:null===(n=e.response)||void 0===n?void 0:n.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){}shareSlideScreenshot(e,t,r){}showLayer(e){this.iamMessage.showLayerByIndex(e)}showCardSlide(e){}cardShowNext(){}showNextSlide(){}sendStatisticEvent(e,t,r,i){this.iamStatisticsService.sendWidgetEvent({iterationId:this.iamMessage.iterationId,messageId:this.iamMessage.id,slideIndex:this.iamMessage.activeSlideIndex,slideTotal:this.iamMessage.slides.length,duration:this.iamMessage.timeSinceLastShow,type:e,widgetPayload:t}),this.iamReader.emitWidgetEvent({type:e,widgetPayload:null!=r?r:{}})}async resetCard(e){}getCardFonts(){var e,t;return null!==(t=null===(e=this.storyManager.rootStore.sessionStore.session)||void 0===e?void 0:e.fontsResources)&&void 0!==t?t:[]}async updateTimeline(e,t,r,i,s,a){s?this.iamMessage.showLoaderScreen():this.iamMessage.hideLoaderScreen(),a?this.iamMessage.showErrorScreen():this.iamMessage.hideErrorScreen()}showToast(e){this.iamMessage.showToast({content:e})}}var wo=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},So=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},_o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Oo=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let ko=(()=>{var e,t,r,i,a,o;let n,l,c,d,h,u,p,g,m,y=s.EventEmitter,v=[],b=[],w=[],S=[],_=[],O=[],x=[],C=[],P=[],j=[],E=[];return e=class extends y{get _isOnceOpened(){return _o(this,t,"f")}set _isOnceOpened(e){Oo(this,t,e,"f")}get _$root(){return _o(this,r,"f")}set _$root(e){Oo(this,r,e,"f")}get _needShowErrorScreen(){return _o(this,i,"f")}set _needShowErrorScreen(e){Oo(this,i,e,"f")}get _needShowLoaderScreen(){return _o(this,a,"f")}set _needShowLoaderScreen(e){Oo(this,a,e,"f")}get _disabledNextClick(){return _o(this,o,"f")}set _disabledNextClick(e){Oo(this,o,e,"f")}constructor(e,s,n,l){super(),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:(wo(this,v),e)}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,wo(this,b,!1)),r.set(this,(wo(this,w),wo(this,S,null))),i.set(this,(wo(this,_),wo(this,O,!1))),a.set(this,(wo(this,x),wo(this,C,!1))),o.set(this,(wo(this,P),wo(this,j,!1))),Object.defineProperty(this,"_activeSlideIndex",{enumerable:!0,configurable:!0,writable:!0,value:(wo(this,E),0)}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"slidesMetrics",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this._$root=e,this.slideApi=this.createSlideApi()}}),Object.defineProperty(this,"handleTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:({dy:e})=>{this.touchController&&e<10&&this.touchController.verticalSwipeGesture&&this.slideApi.slideSwipeUpHandler()}}),this.touchController=e.touchController,this.slideApiHandlers=new bo(this.storyManager,this.iamReader,this,this.iamStatisticsService),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}get id(){return this.iamMessage.id}get $root(){return this._$root}get activeSlideIndex(){return this._activeSlideIndex}get slides(){return[]}get context(){return this.iamMessage.context}get appearanceOptions(){return this.iamMessage.appearanceOptions}get iterationId(){return this.iamMessage.iterationId}get type(){return this.iamMessage.type}get payload(){var e;const t=this.iamMessage.slides[this._activeSlideIndex];return null!==(e=null==t?void 0:t.payload)&&void 0!==e?e:null}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get timeSinceLastShow(){return this.iamMessage.timeSinceLastShow}get disableClose(){return this.iamMessage.disableClose}get slidesAnalytics(){return Array.from(this.slidesMetrics.values()).map(e=>{var t;return{slideIndex:e.slideIndex,duration:null!==(t=e.leftTime)&&void 0!==t?t:Date.now()-e.showTime}})}open(){this._isOnceOpened=!0;return{iterationId:this.iamMessage.trackOpen()}}async updateUserData(e){return this.storyManager.rootStore.iamStore.updateMessageUserData(this.id,e)}async init(e){var t,r,i,s;const a={safeAreaInsetTop:null!==(r=null===(t=null==e?void 0:e.safeArea)||void 0===t?void 0:t.top)&&void 0!==r?r:0,safeAreaInsetBottom:null!==(s=null===(i=null==e?void 0:e.safeArea)||void 0===i?void 0:i.bottom)&&void 0!==s?s:0};await this.slideApi.showSlides(this.iamMessage.slides.map(e=>e.html),this.appearanceOptions.cardAppearance,0,a)}async start(){document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.touchController.on(jt.TouchEnd,this.handleTouchEnd)}async stop(){var e;null===(e=this.slideApi)||void 0===e||e.slideStop({prepareForRestart:2}),document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.touchController.off(jt.TouchEnd,this.handleTouchEnd)}onClick(e,t){if(!e.target||!this.slideApi)return;e.preventDefault(),e.stopPropagation();const r=this.getNavigationDirection(e,t),{canClickNext:i}=this.slideApi.slideClickHandler(e.target,r);this._disabledNextClick=!i}toPublicDto(){return this.iamMessage.toPublicDto()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}async destroy(){var e;return this.stop(),null===(e=this.slideApi)||void 0===e?void 0:e.destroy()}async resumeAndUnlock(){var e;try{this.locked=!1,await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppResume())}catch(e){this.handleSlideError(e)}}async pauseAndLock(){var e;try{this.locked=!0,await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppPause())}catch(e){this.handleSlideError(e)}}showLayerByIndex(e){var t;null===(t=this.slideApi)||void 0===t||t.showLayer(e)}showToast(e){this.toast=new Bt(Object.assign(Object.assign({},e),{mountPoint:this.$root})),this.toast.show(e.content)}onShowSlide(e){this._activeSlideIndex=e,this.slidesMetrics.set(e,{slideIndex:e,showTime:Date.now(),leftTime:null})}onSlideLeft(e){const t=this.slidesMetrics.get(e);if(!t)throw new Error(`[IAS]: Not found slide <${e}> time metrics`);t.leftTime=Date.now(),this.slidesMetrics.set(e,t)}async restart(){await this.init()}createSlideApi(){const e=this.type===Pa.Fullscreen;return new Wt.SlideApi(this.slideApiHandlers,{root:this._$root,slideRatio:this.getContentRatio(),isFullscreen:e,nonce:k(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand,useSdkCacheForMultislideMode:!1})}getContentRatio(){return this.appearanceOptions.contentRatio}handleSlideError(e){console.warn(e),this.showErrorScreen(),this.touchController.off(jt.TouchEnd,this.handleTouchEnd)}getNavigationDirection(e,t){const r=this.getClickPosition(e,t),i="ltr"===this.slideApi.layoutDirection?1:-1;return(r>=.3?i:-i)>0?"forward":"backward"}getClickPosition(e,t){const r=t.getBoundingClientRect(),i=r.width;if(i<=0)return 0;let s;if(e instanceof MouseEvent)s=e.pageX-r.left;else{if(!(e.touches&&e.touches.length>0))return 0;s=e.touches[0].pageX-r.left}return Math.max(0,Math.min(1,s/i))}handleDocumentVisibilityChange(){this.locked||("hidden"===document.visibilityState&&this.pauseByApp(),"visible"===document.visibilityState&&this.resumeByApp())}async resumeByApp(){var e;try{await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppResume())}catch(e){this.handleSlideError(e)}}async pauseByApp(){var e;try{await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppPause())}catch(e){this.handleSlideError(e)}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=y[Symbol.metadata])&&void 0!==t?t:null):void 0;n=[f.observable],l=[f.observable],c=[f.observable],d=[f.observable],h=[f.observable],u=[f.action],p=[f.action],g=[f.action],m=[f.action],So(e,null,n,{kind:"accessor",name:"_isOnceOpened",static:!1,private:!1,access:{has:e=>"_isOnceOpened"in e,get:e=>e._isOnceOpened,set:(e,t)=>{e._isOnceOpened=t}},metadata:r},b,w),So(e,null,l,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:r},S,_),So(e,null,c,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:r},O,x),So(e,null,d,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:r},C,P),So(e,null,h,{kind:"accessor",name:"_disabledNextClick",static:!1,private:!1,access:{has:e=>"_disabledNextClick"in e,get:e=>e._disabledNextClick,set:(e,t)=>{e._disabledNextClick=t}},metadata:r},j,E),So(e,null,u,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,v),So(e,null,p,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,v),So(e,null,g,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,v),So(e,null,m,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,v),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class xo extends Error{constructor(e){super(`Game with ID ${e} has already been open`),this.name="IasGameAlreadyOpenError"}}class Co extends Error{constructor(e){super(`[IAS]: You can't open game ${e} in anonymous access mode `),this.name="IasGameAnonymousOpen"}}class Po extends Error{constructor(){super("[IAS]: You must open the game first"),this.name="IasNoOpenedGameError"}}var jo=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Eo=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Io=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},To=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Ao=(()=>{var e,t,r,i,s,a,n,l;let c,d,h,u,p,g,m,y,v,b,w,S,_,O,k,x,C,P,j=o,E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[],V=[],z=[];return e=class extends j{get _isOpened(){return Io(this,t,"f")}set _isOpened(e){To(this,t,e,"f")}get _isGameInited(){return Io(this,r,"f")}set _isGameInited(e){To(this,r,e,"f")}get _isGameLoading(){return Io(this,i,"f")}set _isGameLoading(e){To(this,i,e,"f")}get _game(){return Io(this,s,"f")}set _game(e){To(this,s,e,"f")}get _gameError(){return Io(this,a,"f")}set _gameError(e){To(this,a,e,"f")}get _closeBtnVisible(){return Io(this,n,"f")}set _closeBtnVisible(e){To(this,n,e,"f")}get _gameShouldBeShown(){return Io(this,l,"f")}set _gameShouldBeShown(e){To(this,l,e,"f")}constructor(e,o,c,d){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(jo(this,E),e)}),Object.defineProperty(this,"gameCenterApi",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"gameSessionFactory",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:d}),t.set(this,jo(this,I,!1)),r.set(this,(jo(this,T),jo(this,A,!1))),i.set(this,(jo(this,M),jo(this,L,!1))),s.set(this,(jo(this,R),jo(this,B,null))),a.set(this,(jo(this,D),jo(this,N,null))),n.set(this,(jo(this,F),jo(this,U,!1))),l.set(this,(jo(this,G),jo(this,V,!1))),Object.defineProperty(this,"isOpenGameInProgress",{enumerable:!0,configurable:!0,writable:!0,value:(jo(this,z),!1)}),Object.defineProperty(this,"retryAttempts",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"gameSession",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"modules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"safeAreaInsets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}}),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.modules=[new yi,new vi,new bi(this.storyManager),new wi(this.storyManager),new xi(this.storyManager),new Oi(this.storyManager),new Si(this.storyManager,this)],this.safeAreaInsets=this.getSafeAreaInsets()}get needApplySafeAreaInsets(){var e,t,r,i;const s=Boolean(null===(e=this.storyManager.config.hybridApp)||void 0===e?void 0:e.fullscreen);return!Boolean(null!==(r=null===(t=this.game)||void 0===t?void 0:t.screenOptions.fullScreen)&&void 0!==r?r:null===(i=this.storyManager.rootStore.sessionStore.session)||void 0===i?void 0:i.isGameReaderDefaultFullscreen)&&s}get closeBtnVisible(){return this._closeBtnVisible}get isGameLoading(){return this._isGameLoading}get isGameInited(){return this._isGameInited}get gameError(){return this._gameError}get game(){return this._game}get isOpened(){return this._isOpened}get gameShouldBeShown(){return this._gameShouldBeShown}get dir(){var e,t;return null!==(t=null===(e=this.game)||void 0===e?void 0:e.languageDirection)&&void 0!==t?t:this.storyManager.config.dir}async openGame(e,t={}){if(e=String(e),!this.isOpenGameInProgress&&!this.preventReopen(e))try{this.isOpenGameInProgress=!0,await this.ensureCanOpen(e),await this.launchGameById(e,t),this._isOpened=!0,this._gameShouldBeShown=!1,this.scrollbarHelper.hide()}catch(e){throw e}finally{this.isOpenGameInProgress=!1}}preventReopen(e){var t;return e===(null===(t=this.game)||void 0===t?void 0:t.id)&&(console.warn(`[IAS]: Prevented reopening of game with ID ${e}`),!0)}async ensureCanOpen(e){if(this.storyManager.config.anonymous)throw console.warn(`[IAS]: You can't open game ${e} in anonymous access mode`),new Co(e);if(this.game)throw new xo(this.game.id)}async launchGameById(e,t){this._gameError=null,this._isGameLoading=!0,await this.storyManager.rootStore.sessionStore.open();const r=await this.gameCenterApi.openGame({gameInstanceId:e,gameOptions:t});this._game=new ui(e,this.storyManager,r,t)}async initGame(e,t){if(!this._game)throw new Po;if(!this._isGameInited)try{this.closeSession();const r=await this.createAndOpenSession({iframe:e,game:this._game,params:t});this.subscribeToGameSession(r),this.gameSession=r,this._isGameInited=!0,this._isGameLoading=!1,await this.waitForeground(r)}catch(e){this.handleGameLoadError(e)}}async createAndOpenSession({iframe:e,game:t,params:r}){const i=new URL(t.url).origin,s=this.gameSessionFactory.create(e,i);this.useGameModules(s,t);const a=t.toInitDto(Object.assign(Object.assign({},r),{safeAreaInsets:this.safeAreaInsets}));return await s.open(a),this.storyManager.emit(Xr.StartGame,{id:t.id}),s}useGameModules(e,t){for(const r of this.modules)r.attach(e,t)}async closeGame(){var e;return!!this._isOpened&&(this._isGameInited?null===(e=this.gameSession)||void 0===e||e.closeGameReader():this.finishGame(),!0)}async reloadGame(){const e=this._game;if(this._game=null,!e)throw new Po;await this.launchGameById(e.id,e.options)}handleGameLoadError(e){e instanceof pi&&e.canTryReload&&this.canRestartGame()?(this.storyManager.emit(Xr.ErrorGame,e),this.restartGame(),this.retryAttempts++):e instanceof Error&&this.handleError(e)}subscribeToGameSession(e){e.on("gameComplete",(e,t,r,i,s)=>{this.finishGame({openStory:i,gameInstance:s})}),e.on("reloadGameReader",()=>{this.restartGame()})}pauseGameUI(){var e;null===(e=this.gameSession)||void 0===e||e.pauseGameUI()}resumeGameUI(){var e;null===(e=this.gameSession)||void 0===e||e.resumeGameUI()}notifyGameCanBeStarted(){var e;null===(e=this.gameSession)||void 0===e||e.notifyGameCanBeStarted()}notifyShareCompleted({shareId:e,isSuccess:t}){var r;null===(r=this.gameSession)||void 0===r||r.shareComplete(e,t)}notifyOpenSharePanel(e){this.emit(Xr.OpenSharePanel,e)}async waitForeground(e){const t=await e.waitForeground();this._gameShouldBeShown=!0,this._closeBtnVisible=Boolean(t.showClose)}restartGame(){const e=this._game;this._game=null,this._isGameInited=!1,this._isGameLoading=!0,this._gameShouldBeShown=!1,this.storyManager.emit(Xr.RestartGame),setTimeout((0,f.action)(()=>{this._game=e}))}canRestartGame(){return this._game&&this.retryAttempts<this._game.canTryReloadCount}handleError(e){this._gameError=e,console.error(e.message),this.storyManager.emit(Xr.ErrorGame,e)}destroy(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.resetScrollbar(),this.closeSession(),this.resetFlags(),this.resetGameData()}finishGame(e={}){this.resetScrollbar(),this.closeSession(),this.resetFlags(),this.resetGameData(),this.resetCounters(),this.storyManager.emit(Xr.CloseGame),this.navigateAfterGame(e)}resetScrollbar(){this.scrollbarHelper.show()}closeSession(){var e;null===(e=this.gameSession)||void 0===e||e.close()}resetFlags(){this._isGameInited=!1,this._isOpened=!1,this._isGameLoading=!1}resetGameData(){this._game=null,this.retryAttempts=0}resetCounters(){this.retryAttempts=0}navigateAfterGame(e){var t,r;(null===(t=e.gameInstance)||void 0===t?void 0:t.id)?this.openGame(e.gameInstance.id,{}):((null===(r=e.openStory)||void 0===r?void 0:r.id)&&this.storyManager.showStory(e.openStory.id),this.emit(Xr.Close))}getSafeAreaInsets(){var e;const t=this.storyManager.config.hybridApp;return null!==(e=null==t?void 0:t.safeAreaInsets)&&void 0!==e?e:this.getFallbackSafeAreaInsets()}getFallbackSafeAreaInsets(){const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t))||0,r=t("--ias-sat"),i=t("--ias-sab");return{left:t("--ias-sal"),right:t("--ias-sar"),top:r,bottom:i}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,n=new WeakMap,l=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=j[Symbol.metadata])&&void 0!==t?t:null):void 0;c=[f.observable],d=[f.observable],h=[f.observable],u=[f.observable],p=[f.observable],g=[f.observable],m=[f.observable],y=[f.computed],v=[f.computed],b=[f.computed],w=[f.action],S=[f.action],_=[f.action],O=[f.action],k=[f.action],x=[f.action],C=[f.action],P=[f.action],Eo(e,null,c,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:r},I,T),Eo(e,null,d,{kind:"accessor",name:"_isGameInited",static:!1,private:!1,access:{has:e=>"_isGameInited"in e,get:e=>e._isGameInited,set:(e,t)=>{e._isGameInited=t}},metadata:r},A,M),Eo(e,null,h,{kind:"accessor",name:"_isGameLoading",static:!1,private:!1,access:{has:e=>"_isGameLoading"in e,get:e=>e._isGameLoading,set:(e,t)=>{e._isGameLoading=t}},metadata:r},L,R),Eo(e,null,u,{kind:"accessor",name:"_game",static:!1,private:!1,access:{has:e=>"_game"in e,get:e=>e._game,set:(e,t)=>{e._game=t}},metadata:r},B,D),Eo(e,null,p,{kind:"accessor",name:"_gameError",static:!1,private:!1,access:{has:e=>"_gameError"in e,get:e=>e._gameError,set:(e,t)=>{e._gameError=t}},metadata:r},N,F),Eo(e,null,g,{kind:"accessor",name:"_closeBtnVisible",static:!1,private:!1,access:{has:e=>"_closeBtnVisible"in e,get:e=>e._closeBtnVisible,set:(e,t)=>{e._closeBtnVisible=t}},metadata:r},U,G),Eo(e,null,m,{kind:"accessor",name:"_gameShouldBeShown",static:!1,private:!1,access:{has:e=>"_gameShouldBeShown"in e,get:e=>e._gameShouldBeShown,set:(e,t)=>{e._gameShouldBeShown=t}},metadata:r},V,z),Eo(e,null,y,{kind:"getter",name:"needApplySafeAreaInsets",static:!1,private:!1,access:{has:e=>"needApplySafeAreaInsets"in e,get:e=>e.needApplySafeAreaInsets},metadata:r},null,E),Eo(e,null,v,{kind:"getter",name:"closeBtnVisible",static:!1,private:!1,access:{has:e=>"closeBtnVisible"in e,get:e=>e.closeBtnVisible},metadata:r},null,E),Eo(e,null,b,{kind:"getter",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir},metadata:r},null,E),Eo(e,null,w,{kind:"method",name:"openGame",static:!1,private:!1,access:{has:e=>"openGame"in e,get:e=>e.openGame},metadata:r},null,E),Eo(e,null,S,{kind:"method",name:"initGame",static:!1,private:!1,access:{has:e=>"initGame"in e,get:e=>e.initGame},metadata:r},null,E),Eo(e,null,_,{kind:"method",name:"closeGame",static:!1,private:!1,access:{has:e=>"closeGame"in e,get:e=>e.closeGame},metadata:r},null,E),Eo(e,null,O,{kind:"method",name:"reloadGame",static:!1,private:!1,access:{has:e=>"reloadGame"in e,get:e=>e.reloadGame},metadata:r},null,E),Eo(e,null,k,{kind:"method",name:"waitForeground",static:!1,private:!1,access:{has:e=>"waitForeground"in e,get:e=>e.waitForeground},metadata:r},null,E),Eo(e,null,x,{kind:"method",name:"restartGame",static:!1,private:!1,access:{has:e=>"restartGame"in e,get:e=>e.restartGame},metadata:r},null,E),Eo(e,null,C,{kind:"method",name:"handleError",static:!1,private:!1,access:{has:e=>"handleError"in e,get:e=>e.handleError},metadata:r},null,E),Eo(e,null,P,{kind:"method",name:"finishGame",static:!1,private:!1,access:{has:e=>"finishGame"in e,get:e=>e.finishGame},metadata:r},null,E),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Mo{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){return new Ao(this.storyManager,new ri,new mi,new zt(window))}}const Lo=.64516129032;class Ro{constructor(e,t,r){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"padding",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t,this._vh=this.calcVH()}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return this.viewportRatio>Lo&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>Lo&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return Math.ceil(this._vh*Lo)}calcHeightByVW(){return this._vh}isDiffAspectRatioEqualToEps(){return this.viewportRatio>Lo&&this.viewportRatio-Lo<=.1}isPortraitOrientation(){let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches}calcVH(){let e=this._vh;return e-=this.padding.top+this.padding.bottom,e}}class Bo{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return this.viewportRatio>Lo&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>Lo&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return this.viewportRatio>Lo?this._vw:Math.ceil(this._vh*Lo)}calcHeightByVW(){return Math.ceil(this._vw/Lo)}isDiffAspectRatioEqualToEps(){return this.viewportRatio>Lo&&this.viewportRatio-Lo<=.1}isPortraitOrientation(){let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches}}class Do{constructor(){}create(e){return Y&&e.vw>=e.vh?this.createDesktopGameGeometry(e):this.createMobileGameGeometry(e)}createDesktopGameGeometry(e){return new Ro(e.vw,e.vh,{top:50,bottom:50})}createMobileGameGeometry(e){return new Bo(e.vw,e.vh)}}class No{constructor(e,t){var r,i,s,a,o,n;Object.defineProperty(this,"storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"title",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"titleColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasAudio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasSwipeUp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isOpened",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"deeplink",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"gameInstanceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideInReader",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"hideTimeline",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.id=e.id,this.title=e.title,this.titleColor=e.titleColor,this.hasAudio=null!==(r=e.hasAudio)&&void 0!==r&&r,this.hasSwipeUp=null!==(i=e.hasSwipeUp)&&void 0!==i&&i,this.isOpened=e.isOpened,this.deeplink=null!==(s=e.deeplink)&&void 0!==s?s:void 0,this.gameInstanceId=null!==(o=null===(a=e.gameInstance)||void 0===a?void 0:a.id)&&void 0!==o?o:void 0,this.hideInReader=null!==(n=e.hideInReader)&&void 0!==n&&n,this.hideTimeline=e.hideTimeline,this.isOpened=e.isOpened,this.story=e}get wasShown(){return this.story.wasShown}markWasShown(){this.story.markWasShown()}getCover(e){var t,r,i,s;return{imageSrc:null===(r=null===(t=this.story.image)||void 0===t?void 0:t.findOneByCoverQuality(e))||void 0===r?void 0:r.url,videoSrc:null!==(i=this.story.videoCoverSrc)&&void 0!==i?i:void 0,backgroundColor:this.story.backgroundColor,feedCoverSrc:null===(s=this.storyFeed)||void 0===s?void 0:s.coverSrc}}}var Fo=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Uo=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Go=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Vo=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let zo=(()=>{var e,t;let r,i=o,s=[],a=[];return e=class extends i{get topStory(){return Go(this,t,"f")}set topStory(e){Vo(this,t,e,"f")}constructor(e={feed:"default"}){super(),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"firstStoryShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyModels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"unreadedStoryModels",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeIndex",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"storyFeedImpressionService",{enumerable:!0,configurable:!0,writable:!0,value:new Te(ol,new Le)}),t.set(this,Uo(this,s,null)),Uo(this,a),this.options=e,this._id=(0,n.v4)(),this.handleShowStory=this.handleShowStory.bind(this),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.subscribeToStoryReader().catch(console.error),ol.addStoryFeed(this)}get stories(){return this.storyFeed?this.storyModels.map(e=>new No(e,this.storyFeed)):[]}get length(){return this.storyModels.length}get activeIndex(){return this._activeIndex}get feedCoverSrc(){var e;return null===(e=this.storyFeed)||void 0===e?void 0:e.coverSrc}get top(){return this.topStory}async reload(){this.firstStoryShown=!1,this.storyModels=[],this.unreadedStoryModels=new Map,await this.loadStories()}destroy(){const e=ol.storyReader;null==e||e.off(cs.Close,this.handleCloseStoryReader),ol.off("showStory",this.handleShowStory),this.emit("destroy"),ol.removeStoryFeed(this)}async showStory(e){if(!e)return;const t=al.instance,r=A()(e.deeplink)&&e.deeplink.trim().length>0,i=e.gameInstanceId;if(!e.hideInReader||r||i)return r&&null!=e.deeplink?(t.storyLinkClickHandler({src:Ct.StackStoryList,data:{id:e.id,isDeeplink:!0,url:e.deeplink}}),void this.markStoryAsOpened(e.id)):i?(t.openGame(i).catch(console.error),void this.markStoryAsOpened(e.id)):void(this.storyFeed&&(t.storyReader.showMultipleStories({storyId:e.id,storyFeed:this.storyFeed,windowReferer:kt.stacked}),this.markStoryAsOpened(e.id)));console.error("[StackedStoryList]: Cannot open hidden story id "+e.id)}async loadStories(){try{this.emit("startLoad"),this.storyFeed=await ol.rootStore.storyFeedStore.fetchDefaultFeed({feedSlug:this.options.feed}),this.emit("endLoad"),this.storyFeed.stories&&this.handleStoriesChange(this.storyFeed.stories)}catch(e){console.error("[StackedStoryList]: error while story list loaded")}}update(){const e=this.unreadedStoryModels.values().next().value;if(!e)throw new Error("[StackedStoryList]: Empty stacked story list");this._activeIndex=this.storyModels.indexOf(e),this.topStory=new No(e,this.storyFeed),this.onUpdateTopStory(this.topStory),this.emit("update",this.topStory)}handleCloseStoryReader(){this.top&&this.markStoryAsShownById(this.top.id)}markStoryAsOpened(e){ol.rootStore.storyStore.markIsOpenedById(e),this.markStoryAsShownById(e),this.unreadedStoryModels.delete(e),this.resetUnreadedStories(),this.update()}onUpdateTopStory(e){!this.firstStoryShown&&this.storyFeed&&(this.firstStoryShown=!0,this.markStoryAsShownById(e.id))}handleShowStory({id:e}){this.markStoryAsOpened(e)}async subscribeToStoryReader(){try{ol.on("showStory",this.handleShowStory),ol.storyReader.on(cs.Close,this.handleCloseStoryReader)}catch(e){console.error("[StackedStoryList]: error while story reader init")}}resetUnreadedStories(){0===this.unreadedStoryModels.size&&(this.unreadedStoryModels=new Map(this.storyModels.map(e=>[e.id,e])))}handleStoriesChange(e){this.storyModels=e.slice(),this.resetUnreadedStories(),this.update()}markStoryAsShownById(e){const t=ol.rootStore.storyStore.findStoryById(e);t&&this.storyFeed&&!t.wasShown&&(this.storyFeedImpressionService.sendCoverageEvent([t],this.storyFeed),t.markWasShown())}},t=new WeakMap,(()=>{var t;const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=i[Symbol.metadata])&&void 0!==t?t:null):void 0;r=[f.observable],Fo(e,null,r,{kind:"accessor",name:"topStory",static:!1,private:!1,access:{has:e=>"topStory"in e,get:e=>e.topStory,set:(e,t)=>{e.topStory=t}},metadata:o},s,a),o&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),e})();class Wo{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}createStoryReader(){return new ms(this.storyManager).create()}createGameReader(){return new Mo(this.storyManager).create()}createStoryList(){return new un(this.storyManager).create()}createInAppMessagingReader(){const e=this.storyManager.rootStore.iamStore,t=new ca(this.storyManager),r=new $a(t);return new fo(this.storyManager,e,new Ya(this.storyManager,e,t),r)}}class $o extends o{constructor(e,t){super(),Object.defineProperty(this,"storyListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t})}get id(){return this.story.id}get title(){return this.story.title}get titleColor(){return this.story.titleColor}get backgroundColor(){return this.story.backgroundColor}get background(){return this.story.background}get deeplink(){return this.story.deeplink}get hideInReader(){return this.story.hideInReader}get gameInstance(){return this.story.gameInstance}get image(){return this.story.image}get videoCoverSrc(){return this.story.videoCoverSrc}get videoCover(){return this.story.videoCover}get like(){return this.story.like}get favorite(){return this.story.favorite}get isOpened(){return this.story.isOpened}get wasShown(){return this.story.wasShown}getAspectRatio(e){return this.storyListViewModel.getAspectRatio(e)}getImageSrcByCoverQuality(e){var t,r;return null===(r=null===(t=this.story.image)||void 0===t?void 0:t.findOneByCoverQuality(e))||void 0===r?void 0:r.url}onClick(e){this.storyListViewModel.onStoryClick(this,e)}markWasShown(){this.story.markWasShown()}destroy(){}}class Ho extends $o{static create(e,t){var r;const i=new st({id:-100,title:null!==(r=e.title.content)&&void 0!==r?r:"",title_color:e.title.color,is_opened:!1,background_color:e.backgroundColor,image:Ho.getBgImage(e)});return new Ho(t,i)}static getBgImage(e){let t=[];return e.image&&e.image.svgSrc&&e.image.svgSrc.baseState&&t.push({width:100,height:100,type:"h",url:`data:image/svg+xml,${S(e.image.svgSrc.baseState)}`}),t}}class qo{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e,t){var r;this.storyManager.rootStore.storyStore.markIsOpenedById(e.id);const i={src:Ct.StoryList,data:{id:e.id,index:t.index,isDeeplink:!0,url:null!==(r=e.deeplink)&&void 0!==r?r:""}};this.storyListViewModel.params.listType!==me.UGC&&await this.storyFeedStatisticV1Service.sendDeeplinkClickEvent(e.id),this.storyManager.storyLinkClickHandler(i),this.storyManager.emit("clickOnButton",i)}}class Jo{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e,t){var r;this.storyManager.rootStore.storyStore.markIsOpenedById(e.id);const i=null===(r=e.gameInstance)||void 0===r?void 0:r.id;this.storyManager.gameReader.openGame(i,{}).catch(console.error)}}class Ko{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e,t){const r=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(this.storyList.params.feedSlug),i={storyId:e.id,storyFeed:r,windowReferer:this.storyList.params.isFavorite?kt.favorite:kt.default};this.openStoryReader(i),this.emitClickOnStory({id:e.id,index:t.index,isDeeplink:!1,storyFeed:r,filter:this.storyList.params.filter})}async openStoryReader(e){try{await this.storyManager.storyReader.showMultipleStories({storyId:e.storyId,storyFeed:e.storyFeed,filter:this.storyList.params.filter,windowReferer:e.windowReferer})}catch(e){console.error(e)}}emitClickOnStory(e){const t=e.storyFeed,r=t.slug,i=e.filter,s=t.getStoryById(e.id),a={title:null,slidesCount:null,feed:null,filter:null,source:null};a.title=s.statTitle,a.slidesCount=s.slidesCount,t.type===me.DEFAULT?a.feed=r:t.type===me.UGC&&(a.filter=i),a.source=Ot.list,this.storyManager.emit("clickOnStory",Object.assign({id:e.id,index:e.index,isDeeplink:e.isDeeplink},a))}}class Zo{static createHandler(e,t,r,i){const{deeplink:s,hideInReader:a,gameInstance:o}=e,n=A()(s)&&s.trim().length>0,l=null==o?void 0:o.id;return this.isInvalidStoryClick(Boolean(a),n,l,e.id)?null:n?new qo(t,r,i):l?new Jo(t,r):new Ko(t,r)}static isInvalidStoryClick(e,t,r,i){return!(!e||t||r)&&(console.error(`Cannot open hidden story id ${i}`),!0)}}class Qo extends $o{constructor(e,t){super(e,t)}}class Yo extends $o{constructor(e,t,r){super(t,r),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:e})}get favoriteStories(){return this.rootStore.storyFeedStore.getFavoriteFeed().stories.map(e=>new Qo(this.storyListViewModel,e))}static create(e,t,r){const i=new st({id:0,title:e.title.content,title_color:e.title.color,is_opened:!0,background_color:"white"});return new Yo(r,t,i)}}class Xo{constructor(e=0,t=0,r=0,i=0){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.x=e,this.y=t,this.width=r,this.height=i}overlaps(e){return this.x+this.width>=e.x&&this.x<=e.x+e.width&&this.y+this.height>=e.y&&this.y<=e.y+e.height}getIntersection(e){const t=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.x,e.x),i=Math.min(this.y+this.height,e.y+e.height),s=Math.max(this.y,e.y);return new Xo(Math.min(t,r),Math.min(i,s),Math.max(0,t-r),Math.max(0,i-s))}getArea(){return this.width*this.height}getAreaFraction(e){return+(this.getArea()/e.getArea()*100).toFixed(2)}static clone(e){return new Xo(e.x,e.y,e.width,e.height)}}class en{constructor(){Object.defineProperty(this,"storyRects",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:new Xo}),Object.defineProperty(this,"filterStoryRectIntersections",{enumerable:!0,configurable:!0,writable:!0,value:e=>e.filter(e=>-100!==e.id&&e.areaFraction>0)})}calculate(e){const t=this.getScrollViewportByCalculationParams(e),r=this.getStoryRectIntersectionsWithViewport(t);return this.filterStoryRectIntersections(r)}setViewport(e){this.viewport=e}setStoryRects(e){this.storyRects=e}getScrollViewportByCalculationParams(e){const t=Xo.clone(this.viewport);return t.x+=e.minOffsetLeft,t.y+=e.minOffsetTop,t.width+=e.maxOffsetLeft-e.minOffsetLeft,t.height+=e.maxOffsetTop-e.minOffsetTop,t}getStoryRectIntersectionsWithViewport(e){const t=[];for(const r of this.storyRects)if(r.overlaps(e)){const i=r.getIntersection(e);t.push({id:r.id,areaFraction:i.getAreaFraction(r)})}else t.push({id:r.id,areaFraction:0});return t}}class tn extends Xo{constructor(e,t=0,r=0,i=0,s=0){super(t,r,i,s),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e}static clone(e){return new tn(e.id,e.x,e.y,e.width,e.height)}}class rn{constructor(e){Object.defineProperty(this,"feedCoverageAnalyticsCalculator",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"viewportPadding",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"minOffsetLeft",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maxOffsetLeft",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minOffsetTop",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maxOffsetTop",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"metrics",{enumerable:!0,configurable:!0,writable:!0,value:[]})}startScroll({x:e,y:t}){this.minOffsetLeft=e,this.minOffsetTop=t,this.maxOffsetLeft=e,this.maxOffsetTop=t}endScroll({x:e,y:t}){this.minOffsetLeft=Math.min(e,this.minOffsetLeft),this.maxOffsetLeft=Math.max(e,this.maxOffsetLeft),this.minOffsetTop=Math.min(t,this.minOffsetTop),this.maxOffsetTop=Math.max(t,this.maxOffsetTop);const r=this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:this.minOffsetLeft,maxOffsetLeft:this.maxOffsetLeft,minOffsetTop:this.minOffsetTop,maxOffsetTop:this.maxOffsetTop});this.metrics.forEach(e=>e.calculate(r))}calculate(e,t){const r=this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:e,maxOffsetLeft:e,minOffsetTop:t,maxOffsetTop:t});this.metrics.forEach(e=>e.calculate(r))}addMetric(e){this.metrics.push(e)}updateGeometry({stories:e,storyListRect:t,windowRect:r,viewportPadding:i}){this.viewportPadding=i,this.setViewport(t,r),this.setStoryRects(e,t)}destroy(){this.metrics=[]}setViewport(e,t){const r=this.getViewportByWindowAndStoryList(t,e);this.applyPaddingToViewport(r,e),this.feedCoverageAnalyticsCalculator.setViewport(r)}getViewportByWindowAndStoryList(e,t){let r=new Xo;return t.overlaps(e)?(r=t.getIntersection(e),r):r}applyPaddingToViewport(e,t){t.width<768||(e.x+=this.viewportPadding.left,e.y+=this.viewportPadding.top,e.height-=this.viewportPadding.top+this.viewportPadding.bottom,e.width-=this.viewportPadding.left+this.viewportPadding.right)}setStoryRects(e,t){const r=[];e.forEach((i,s)=>{const a=Number(i.dataset.id),o=new tn(a,i.offsetLeft,i.offsetTop,i.clientWidth,i.clientHeight);r.push(o),o.x+=t.x,o.y+=t.y,this.applyPaddingAndNegativeMarginToStoryRect(o,s,e.length-1)}),this.feedCoverageAnalyticsCalculator.setStoryRects(r)}applyPaddingAndNegativeMarginToStoryRect(e,t,r){const i=this.viewportPadding;0===t&&(e.x+=i.left,e.width-=i.left),t===r&&(e.width-=i.right)}}class sn{create(){const e=new en;return new rn(e)}}class an{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:t})}calculate(e){const t=e.map(({id:e,areaFraction:t})=>({storyId:e,visibleArea:Math.round(t)/100}));0!==t.length&&this.emitVisibleAreaUpdatedEvent(t)}emitVisibleAreaUpdatedEvent(e){const t=this.storyList.params.feedSlug,r=this.storyList.params.filter,i=this.storyList.params.listType,s={stories:e.map(({storyId:e,visibleArea:t})=>{const r={title:null,slidesCount:null,visibleArea:t},s=this.storyManager.rootStore.storyStore.findStoryById(e);return s&&(r.title=s.statTitle,r.slidesCount=s.slidesCount,i===me.UGC&&(r.ugcPayload=Ie()(s.ugcPayload)?s.ugcPayload:{})),Object.assign({id:e},r)}),feed:null,filter:null};i===me.DEFAULT?s.feed=t:i===me.UGC&&(s.filter=r),this.storyManager.emit("visibleAreaUpdated",s)}}class on{constructor(e,t,r){Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyFeedStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"getNewStoriesIds",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=[];for(const r of e){const e=this.storyList.stories.find(e=>e.id===r);e&&!e.wasShown&&t.push(e)}return t}})}calculate(e){const t=this.getNewStoriesIds(e.map(({id:e})=>e)),r=this.storyList.storyFeed;if(0===t.length||!r)return;const i=t.map(e=>r.getStoryById(e.id)).filter(e=>!!e);this.emitStatisticEvents(i,r)}emitStatisticEvents(e,t){this.storyFeedStatisticV1Service.sendCoverageEvent(e,t),this.storyFeedStatisticV2Service.sendViewEventByIds({storyIds:e.map(e=>e.id),feedSlug:t.slug}),this.markStoriesAsShown(e)}markStoriesAsShown(e){e.forEach(e=>e.markWasShown())}}var nn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ln=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},cn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},dn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let hn=(()=>{var e,t,r,i;let s,a,n,l,c,d,u,p,g,m,y=o,v=[],b=[],w=[],S=[],_=[],O=[],k=[];return e=class extends y{get ugcCardOptions(){return cn(this,t,"f")}set ugcCardOptions(e){dn(this,t,e,"f")}get favoriteCardOptions(){return cn(this,r,"f")}set favoriteCardOptions(e){dn(this,r,e,"f")}get _params(){return cn(this,i,"f")}set _params(e){dn(this,i,e,"f")}constructor(s,a,o,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(nn(this,v),s)}),Object.defineProperty(this,"storiesService",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"storyFeedStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,nn(this,b,null)),r.set(this,(nn(this,w),nn(this,S,null))),i.set(this,(nn(this,_),nn(this,O,{listType:me.DEFAULT,feedSlug:"",useUgcCard:!1,isFavorite:!1,hasFavorite:!1}))),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:(nn(this,k),!1)}),Object.defineProperty(this,"feedCoverageAnalytics",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_favoriteFeed",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._id="StoryListViewModel"+e.index++,this.storyManager.addStoryFeed(this),this.feedCoverageAnalytics=(new sn).create(),this.feedCoverageAnalytics.addMetric(new on(this,this.storyFeedStatisticV1Service,this.storyFeedStatisticV2Service)),this.feedCoverageAnalytics.addMetric(new an(this.storyManager,this))}get id(){return this._id}get session(){return this.storyManager.rootStore.sessionStore.session}get storyFeed(){return this._storyFeed}get favoriteFeed(){return this._favoriteFeed}get stories(){const e=this._params.feedSlug,t=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(e);if(!t)return[];const r=t.stories.map(e=>new $o(this,e));return this.hasFavoriteCard&&this.favoriteCardOptions&&r.push(this.createFavoriteCard(this.favoriteCardOptions)),this.hasUgcCard&&this.ugcCardOptions&&r.unshift(this.createUgcStoryCard(this.ugcCardOptions)),r}get params(){return this._params}get hasFavoriteCard(){const e=this.storyManager.rootStore.storyFeedStore.getFavoriteFeed();return this._params.hasFavorite&&this._params.listType===me.DEFAULT&&e.stories.length>0}get hasUgcCard(){return this._params.useUgcCard}get dir(){return this.storyManager.config.dir}setParams(e){this._params=e}onStoryClick(e,t=0){var r;null===(r=Zo.createHandler(e,this.storyManager,this,this.storyFeedStatisticV1Service))||void 0===r||r.handle(e,{index:t})}destroy(){this.removeAllListeners(),this.storyManager.removeStoryFeed(this),this.feedCoverageAnalytics.destroy()}async reload(){await this.loadStories({needFavorite:!0})}getAspectRatio(e){var t,r;switch(e){case St.STYLE_CIRCLE:case St.STYLE_QUAD:return 1;case St.STYLE_RECTANGLE:return null!==(r=null===(t=this.session)||void 0===t?void 0:t.previewAspectRatio)&&void 0!==r?r:.8;default:return 1}}async loadStories(e){var t,r,i;if(this.isLoading||this._params.feedSlug===_e)return;const s=Boolean(this._params.hasFavorite)&&e.needFavorite,a={feed:this._params.feedSlug,filter:{},defaultListLength:0,favoriteListLength:0,success:!0,error:{name:"",networkStatus:200,networkMessage:""}};try{this.emit("startLoading"),this.isLoading=!0;const{storyFeed:e,favoriteFeed:i}=await this.storiesService.loadStories(Object.assign(Object.assign({},this._params),{needFavorite:s})),o=null!==(t=e.stories)&&void 0!==t?t:[],n=null!==(r=null==i?void 0:i.stories)&&void 0!==r?r:[];this._storyFeed=e,this._favoriteFeed=i,a.success=!0,a.error=null,a.defaultListLength=o.length,this._params.hasFavorite&&this._params.listType===me.DEFAULT&&(a.favoriteListLength=n.length)}catch(e){console.error(e),a.success=!1,e instanceof h&&(a.error={name:e.name,networkMessage:e.networkMessage,networkStatus:e.networkStatus})}finally{this.isLoading=!1,a.filter=null!==(i=this._params.filter)&&void 0!==i?i:{},this.emit("endLoading",a)}}setUgcCardOptions(e){this.ugcCardOptions=e}setFavoriteCardOptions(e){this.favoriteCardOptions=e}createUgcStoryCard(e){return Ho.create(e,this)}createFavoriteCard(e){return Yo.create(e,this,this.storyManager.rootStore)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=y[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[f.observable],a=[f.observable],n=[f.observable],l=[f.computed],c=[f.computed],d=[f.computed],u=[f.computed],p=[f.computed],g=[f.action],m=[f.action],ln(e,null,s,{kind:"accessor",name:"ugcCardOptions",static:!1,private:!1,access:{has:e=>"ugcCardOptions"in e,get:e=>e.ugcCardOptions,set:(e,t)=>{e.ugcCardOptions=t}},metadata:r},b,w),ln(e,null,a,{kind:"accessor",name:"favoriteCardOptions",static:!1,private:!1,access:{has:e=>"favoriteCardOptions"in e,get:e=>e.favoriteCardOptions,set:(e,t)=>{e.favoriteCardOptions=t}},metadata:r},S,_),ln(e,null,n,{kind:"accessor",name:"_params",static:!1,private:!1,access:{has:e=>"_params"in e,get:e=>e._params,set:(e,t)=>{e._params=t}},metadata:r},O,k),ln(e,null,l,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:r},null,v),ln(e,null,c,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:r},null,v),ln(e,null,d,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:r},null,v),ln(e,null,u,{kind:"getter",name:"hasFavoriteCard",static:!1,private:!1,access:{has:e=>"hasFavoriteCard"in e,get:e=>e.hasFavoriteCard},metadata:r},null,v),ln(e,null,p,{kind:"getter",name:"hasUgcCard",static:!1,private:!1,access:{has:e=>"hasUgcCard"in e,get:e=>e.hasUgcCard},metadata:r},null,v),ln(e,null,g,{kind:"method",name:"setParams",static:!1,private:!1,access:{has:e=>"setParams"in e,get:e=>e.setParams},metadata:r},null,v),ln(e,null,m,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:r},null,v),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),Object.defineProperty(e,"index",{enumerable:!0,configurable:!0,writable:!0,value:0}),e})();class un{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new pn(this.storyManager);return new hn(this.storyManager,e,new Te(this.storyManager,new Le),new fn(this.storyManager,new Re(this.storyManager)))}}class pn{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async loadStories({feedSlug:e,filter:t={},listType:r,testKey:i,needFavorite:s=!0}){const a=this.storyManager.config,o=r===me.DEFAULT&&s,n=this.storyManager.rootStore.storyFeedStore,l=await this.fetchStoryFeed(n,e,t,i);let c=null;o&&(c=await this.fetchFavoriteFeed({storyFeedStore:n,anonymous:a.anonymous}));const d=this.getFeedLoadEventStoryDtos(l);return this.emitFeedLoadEvent(l,d,e,t),{storyFeed:l,favoriteFeed:c}}async fetchStoryFeed(e,t,r,i){return t===Pe?e.fetchUgcFeed({filter:r,testKey:i}):e.fetchDefaultFeed({feedSlug:t,testKey:i})}getFeedLoadEventStoryDtos(e){return e.stories.map(t=>{const r={title:null,slidesCount:null};return r.title=t.statTitle,r.slidesCount=t.slidesCount,e.type===me.UGC&&(r.ugcPayload=ti()(t.ugcPayload)?t.ugcPayload:{}),Object.assign({id:t.id},r)})}async fetchFavoriteFeed({storyFeedStore:e,anonymous:t}){return t?(console.warn("[IAS]: The favorites feed is not available in anonymous access mode"),null):await e.fetchFavoriteFeed()}emitFeedLoadEvent(e,t,r,i){const s={stories:t,feed:null,filter:null};e.type===me.DEFAULT?s.feed=r:e.type===me.UGC&&(s.filter=i),this.storyManager.emit("feedLoad",s)}}class gn{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"view"}toQueryParams(){return{i:this.payload.storyIds.join(","),f:this.payload.feedSlug,w:"list"}}}class fn{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV2Api",{enumerable:!0,configurable:!0,writable:!0,value:t})}async sendViewEventByIds(e){const t=new gn(e);await this.statisticV2Api.sendStatisticEvent(t)}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class mn extends Error{constructor(e){super(`[IAM]: not found IAM for event <${e}>`),this.name="IamNotFoundByEventError"}}var yn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},vn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},bn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},wn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Sn=(()=>{var e,t,r,i;let s,a,o,n,l,c=[],d=[],h=[],u=[],p=[],g=[],m=[];return e=class{get _messages(){return bn(this,t,"f")}set _messages(e){wn(this,t,e,"f")}get _isLoaded(){return bn(this,r,"f")}set _isLoaded(e){wn(this,r,e,"f")}get _isLoading(){return bn(this,i,"f")}set _isLoading(e){wn(this,i,e,"f")}constructor(e,s){Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:(yn(this,c),e)}),Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,yn(this,d,f.observable.map())),r.set(this,(yn(this,h),yn(this,u,!1))),i.set(this,(yn(this,p),yn(this,g,!1))),Object.defineProperty(this,"iamCSS",{enumerable:!0,configurable:!0,writable:!0,value:(yn(this,m),"")})}get messages(){return Array.from(this._messages.values())}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}async preload(e){try{this._isLoaded=!1,this._isLoading=!0;const t=await this.fetchAll(e);return this._isLoaded=!0,t}catch(e){throw console.error(e),e}finally{this._isLoading=!1}}async findById(e){const t=this._messages.get(e.toString());return t||this.fetchById(e)}findAllByEvent(e){let t=Array.from(this._messages.values()).filter(t=>t.hasEvent(e));if(t.length>0)return t;throw new mn(e)}async updateMessageUserData(e,t){return this.iamApi.updateUserData(e,t)}async fetchById(e){await this.rootStore.sessionStore.open();const t=await this.fetchMessageContext({messageIds:[e]}),r=await this.iamApi.fetchById(e);return this.createMessageByDto(r,t)}async fetchAll(e){await this.rootStore.sessionStore.open();const t=this.rootStore.storyManagerConfigStore.config,r=e.tags?e.tags:t.tags,i=await this.iamApi.fetchAll({tags:_(r),options:t.options}),s=await this.fetchMessageContext({messageIds:i.map(e=>e.id)});return this.createMessagesByDtos(i,s)}async fetchMessageContext({messageIds:e}){await this.rootStore.sessionStore.open();const t=await this.iamApi.fetchContext({needFetchStyles:!this.iamCSS,messageIds:e});return!this.iamCSS&&t.style&&(this.iamCSS=P(t.style,this.rootStore.storyManagerConfigStore.config.fontPrefix)),t.style=this.iamCSS,t}createMessagesByDtos(e,t){this._messages.clear();const r=[];for(const i of e){const e=this.createMessageByDto(i,t);r.push(e)}return r}createMessageByDto(e,t){const r=Ua.createByDto(e),i=new La(e.id,t);return r.applyFontPrefix(this.rootStore.storyManagerConfigStore.config.fontPrefix),r.setContext(i),this._messages.has(r.id.toString())||this._messages.set(r.id.toString(),r),r}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[f.observable],a=[f.observable],o=[f.observable],n=[f.computed],l=[y,v],vn(e,null,s,{kind:"accessor",name:"_messages",static:!1,private:!1,access:{has:e=>"_messages"in e,get:e=>e._messages,set:(e,t)=>{e._messages=t}},metadata:t},d,h),vn(e,null,a,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:t},u,p),vn(e,null,o,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:t},g,m),vn(e,null,n,{kind:"getter",name:"messages",static:!1,private:!1,access:{has:e=>"messages"in e,get:e=>e.messages},metadata:t},null,c),vn(e,null,l,{kind:"method",name:"preload",static:!1,private:!1,access:{has:e=>"preload"in e,get:e=>e.preload},metadata:t},null,c),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var _n=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},On=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},kn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},xn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Cn=(()=>{var e,t;let r,i,s,a,o=[],n=[],l=[];return e=class{get _session(){return kn(this,t,"f")}set _session(e){xn(this,t,e,"f")}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(_n(this,o),e)}),Object.defineProperty(this,"sessionApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:i}),t.set(this,_n(this,n,null)),_n(this,l),this.storyManager=e,this.sessionApi=r,this.rootStore=i}get session(){return this._session}get userId(){var e,t;return null!==(t=null===(e=this._session)||void 0===e?void 0:e.userKey)&&void 0!==t?t:he}async open(){if(this._session)return this._session;const e=this.storyManager.config,t=await this.sessionApi.open({userId:e.userId,userIdSign:e.userIdSign,anonymous:e.anonymous}),r=new ue(this.storyManager,this,t);return r.loadResources(),this.updatePlaceholders(r),this._session=r,r}close(){this._session=null}updatePlaceholders(e){this.rootStore.placeholderStore.addPlaceholders([...e.imagePlaceholders,...e.textPlaceholders])}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.computed],s=[f.computed],a=[y],On(e,null,r,{kind:"accessor",name:"_session",static:!1,private:!1,access:{has:e=>"_session"in e,get:e=>e._session,set:(e,t)=>{e._session=t}},metadata:t},n,l),On(e,null,i,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:t},null,o),On(e,null,s,{kind:"getter",name:"userId",static:!1,private:!1,access:{has:e=>"userId"in e,get:e=>e.userId},metadata:t},null,o),On(e,null,a,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Pn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},jn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},En=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},In=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const Tn=f.observable.map();let An=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storiesByUserId(){return En(this,t,"f")}set _storiesByUserId(e){In(this,t,e,"f")}get activeUserStories(){var e;const t=this.rootStore.sessionStore.userId;return t&&null!==(e=this._storiesByUserId.get(t))&&void 0!==e?e:Tn}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Pn(this,s),e)}),Object.defineProperty(this,"storiesApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:i}),t.set(this,Pn(this,a,f.observable.map())),Object.defineProperty(this,"storyCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Pn(this,o),"")}),(0,f.reaction)(()=>i.placeholderStore.placeholders,e=>{for(const t of this.activeUserStories.values())t.updatePlaceholders(e)})}addStoriesByDtos(e){const t=[];for(const r of e){const e=this.addStoryByDto(r);t.push(e)}return t}addStoryByDto(e){const t=this.getOrCreateStoriesMap();if(t.has(e.id))return t.get(e.id);const r=new st(e);return r.applyFontPrefix(this.storyManager.config.fontPrefix),r.updatePlaceholders(this.rootStore.placeholderStore.placeholders),t.set(e.id,r),r}async setStoryLike(e,t){await this.storiesApi.setStoryLike(e,t)}async setStoryBookmark(e,t){await this.storiesApi.setStoryBookmark(e.id,t);const r=this.rootStore.storyFeedStore.getFavoriteFeed();t?r.unshiftStory(e):r.removeById(e.id)}async updateNarrativeData(e,t){await this.storiesApi.updateNarrativeData(e,t)}async fetchSharePathByStory(e){return null!=e.shareUrl?e.shareUrl:this.storiesApi.fetchStorySharePath(e.id)}markIsOpenedById(e){const t=this.storyManager.rootStore.storyStore.findStoryById(e);if(!t)return;const r=this.storyManager.rootStore.sessionStore.session;!t.isOpened&&(null==r?void 0:r.userKey)&&(t.markIsOpened(),this.storiesApi.markStoryAsOpened(r.userKey,t.id),this.rootStore.onboardingFeedStore.removeStoryFromOnboardingFeedsById(t.id))}async fetchStoryById({storyId:e,feedSlug:t,fetchShareUrl:r,once:i}){let s=this.findStoryById(e);if(null==s?void 0:s.slidesLoaded)return s;await this.rootStore.sessionStore.open(),await this.fetchStoryCSS(),s=await this.fetchStory({storyId:e,feedSlug:t,fetchShareUrl:r,once:i});const a=await this.fetchStoryContext({id:s.id,feedSlug:t});return s.setContext(a),s.setCanBeShown(!0),s}async fetchStoriesSlides(e){const t=this.filterStoriesWithoutSlides(e.stories);if(t.length)try{const r=(new Date).getTime();await this.fetchStoryCSS();const i=await this.fetchStoryContextByIds({storyIds:t.map(e=>e.id),feedSlug:e.feedSlug});await Promise.all(t.map((t,s)=>this.processSingleStory(r,t,i[s],e.feedSlug)))}catch(e){for(const r of t)r.setError(e)}}findStoryById(e){return"number"==typeof e?this.activeUserStories.get(e):Array.from(this.activeUserStories.values()).find(t=>t.stringId===e)}filterStoriesWithoutSlides(e){return e.filter(e=>!e.slidesLoaded)}async processSingleStory(e,t,r,i){var s;try{t.error&&t.setError(null),t.setContext(r);const a=await this.storiesApi.fetchStorySlides({id:t.id,feedSlug:i});t.setSlides(null!==(s=a.slides)&&void 0!==s?s:[]),t.applyFontPrefix(this.storyManager.config.fontPrefix),t.updatePlaceholders(this.rootStore.placeholderStore.placeholders),await(async(e,t=300)=>new Promise(r=>{const i=Math.max(0,t-((new Date).getTime()-e));i?setTimeout(r,i):r()}))(e),t.setCanBeShown(!0)}catch(e){t.setError(e)}}async fetchStory({storyId:e,feedSlug:t,fetchShareUrl:r,once:i}){var s;const a=await this.storiesApi.fetchStory({id:e,feedSlug:t,fetchShareUrl:r,once:i}),o=this.addStoryByDto(a);return o.setSlides(null!==(s=a.slides)&&void 0!==s?s:[]),o.applyFontPrefix(this.storyManager.config.fontPrefix),o.updatePlaceholders(this.rootStore.placeholderStore.placeholders),o}async fetchStoryCSS(){this.storyCSS||(this.storyCSS=await this.storiesApi.fetchStoryCSS(),this.storyCSS=P(this.storyCSS,this.storyManager.config.fontPrefix))}async fetchStoryContext({id:e,feedSlug:t}){const r=await this.storiesApi.fetchStoryContext({ids:[e],feedSlug:t});return new Xe(e,Object.assign(Object.assign({},r),{style:this.storyCSS}))}async fetchStoryContextByIds({storyIds:e,feedSlug:t}){const r=await this.storiesApi.fetchStoryContext({ids:e,feedSlug:t});return e.map(e=>new Xe(e,Object.assign(Object.assign({},r),{style:this.storyCSS})))}getOrCreateStoriesMap(){const e=this.rootStore.sessionStore.userId;let t=f.observable.map();return this._storiesByUserId.has(e)?t=this._storiesByUserId.get(e):this._storiesByUserId.set(e,t),t}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.computed],jn(e,null,r,{kind:"accessor",name:"_storiesByUserId",static:!1,private:!1,access:{has:e=>"_storiesByUserId"in e,get:e=>e._storiesByUserId,set:(e,t)=>{e._storiesByUserId=t}},metadata:t},a,o),jn(e,null,i,{kind:"getter",name:"activeUserStories",static:!1,private:!1,access:{has:e=>"activeUserStories"in e,get:e=>e.activeUserStories},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Mn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ln=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Rn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Bn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const Dn=f.observable.map();let Nn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storyFeedsByUserId(){return Rn(this,t,"f")}set _storyFeedsByUserId(e){Bn(this,t,e,"f")}constructor(e,r){Object.defineProperty(this,"storyFeedsApi",{enumerable:!0,configurable:!0,writable:!0,value:(Mn(this,s),e)}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,Mn(this,a,f.observable.map())),Mn(this,o),this.storyFeedsApi=e,this.rootStore=r}get activeUserFeeds(){var e;const t=this.rootStore.sessionStore.userId;return t&&null!==(e=this._storyFeedsByUserId.get(t))&&void 0!==e?e:Dn}getUgcFeed(){var e;return null!==(e=this.getFeedBySlug(Pe))&&void 0!==e?e:je.createByStories([])}getFavoriteFeed(){var e;return null!==(e=this.getFeedBySlug(_e))&&void 0!==e?e:Oe.createByStories([])}getFeedBySlug(e){return this.activeUserFeeds.get(e)}async fetchDefaultFeed({feedSlug:e,testKey:t}){const r=await this.rootStore.sessionStore.open(),i=this.rootStore.storyManagerConfigStore.config,s=await this.storyFeedsApi.fetchDefaultFeed({feedSlug:e,tags:i.tags,testKey:t,options:{pos:i.options.pos}}),a=this.rootStore.storyStore.addStoriesByDtos(s.stories),o=new Se(s,a,{testKey:t});return this.addStoryFeed(r.userKey,o),o}async fetchFavoriteFeed(){const e=await this.rootStore.sessionStore.open(),t=this.rootStore.storyManagerConfigStore.config.tags,r=await this.storyFeedsApi.fetchFavoriteFeed({tags:t}),i=this.rootStore.storyStore.addStoriesByDtos(r),s=Oe.createByStories(i);return this.addStoryFeed(e.userKey,s),s}async fetchUgcFeed({filter:e,testKey:t}){const r=await this.rootStore.sessionStore.open(),i=this.rootStore.storyManagerConfigStore.config,s=await this.storyFeedsApi.fetchUgcFeed({filter:e,tags:i.tags,testKey:t,options:{pos:i.options.pos}}),a=this.rootStore.storyStore.addStoriesByDtos(s),o=je.createByStories(a,{filter:e});return this.addStoryFeed(r.userKey,o),o}addStoryFeed(e,t){let r=f.observable.map();this._storyFeedsByUserId.has(e)?r=this._storyFeedsByUserId.get(e):this._storyFeedsByUserId.set(e,r),r.set(t.slug,t)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.computed],Ln(e,null,r,{kind:"accessor",name:"_storyFeedsByUserId",static:!1,private:!1,access:{has:e=>"_storyFeedsByUserId"in e,get:e=>e._storyFeedsByUserId,set:(e,t)=>{e._storyFeedsByUserId=t}},metadata:t},a,o),Ln(e,null,i,{kind:"getter",name:"activeUserFeeds",static:!1,private:!1,access:{has:e=>"activeUserFeeds"in e,get:e=>e.activeUserFeeds},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Fn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Un=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Gn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Vn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const zn=f.observable.map();let Wn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _onboardingFeedsByUserId(){return Gn(this,t,"f")}set _onboardingFeedsByUserId(e){Vn(this,t,e,"f")}constructor(e,r){Object.defineProperty(this,"storyFeedsApi",{enumerable:!0,configurable:!0,writable:!0,value:(Fn(this,s),e)}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,Fn(this,a,f.observable.map())),Object.defineProperty(this,"cacheDataInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:(Fn(this,o),!1)}),(0,f.reaction)(()=>{const e=this.rootStore.storyManagerConfigStore.config;return e?[e.lang,e.apiKey,e.options]:null},()=>{this.invalidateCacheData()})}get activeUserFeeds(){var e;const t=this.rootStore.sessionStore.userId;return t&&null!==(e=this._onboardingFeedsByUserId.get(t))&&void 0!==e?e:zn}getFeedBySlug(e){return this.activeUserFeeds.get(null!=e?e:Ce.getDefaultSlug())}removeStoryFromOnboardingFeedsById(e){for(const t of this.activeUserFeeds.values())t.removeById(e)}invalidateCacheData(){this.cacheDataInvalidated=!0}async fetchOnboardingFeed(e){let t=e.feedSlug||Ce.getDefaultSlug();const r=this.getOnboardingParams(e);let i=this.activeUserFeeds.get(t);if(i&&!this.cacheDataInvalidated&&i.isEqualParams(r))return i;const s=await this.rootStore.sessionStore.open(),a=this.rootStore.storyManagerConfigStore.config,o=await this.storyFeedsApi.fetchOnboardingFeed(Object.assign(Object.assign({},r),{feedSlug:t,options:{pos:a.options.pos}})),n=this.rootStore.storyStore.addStoriesByDtos(o.stories);return i=new Ce(o,n,r),this.addOnboardingFeed(s.userKey,i),this.commitCacheData(),i}addOnboardingFeed(e,t){let r=f.observable.map();this._onboardingFeedsByUserId.has(e)?r=this._onboardingFeedsByUserId.get(e):this._onboardingFeedsByUserId.set(e,r),r.set(t.slug,t)}getOnboardingParams(e){const t=e.tags.length>0?e.tags:this.rootStore.storyManagerConfigStore.config.tags;return{tags:_(t),limit:e.limit}}commitCacheData(){this.cacheDataInvalidated=!1}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.computed],Un(e,null,r,{kind:"accessor",name:"_onboardingFeedsByUserId",static:!1,private:!1,access:{has:e=>"_onboardingFeedsByUserId"in e,get:e=>e._onboardingFeedsByUserId,set:(e,t)=>{e._onboardingFeedsByUserId=t}},metadata:t},a,o),Un(e,null,i,{kind:"getter",name:"activeUserFeeds",static:!1,private:!1,access:{has:e=>"activeUserFeeds"in e,get:e=>e.activeUserFeeds},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class $n{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ugcEditorApi",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_config",{enumerable:!0,configurable:!0,writable:!0,value:null})}async getUgcEditorConfig(){if(this._config)return this._config;const e=await this.storyManager.rootStore.sessionStore.open(),t=await this.ugcEditorApi.fetchUgcEditorConfig(),r=this.storyManager.config,i="1.14.0";return this._config={sessionId:e.id,apiKey:r.apiKey,editor:null!=t?t:{},sdkVersion:i,appPackageId:r.appPackageId,deviceId:ee.deviceId,userId:null!=r.userId?String(r.userId):void 0,lang:r.lang.toString()},this._config}}class Hn{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcEditorConfig(){return(await ra.request({method:"GET",url:"ugc/editor-config"})).data}}var qn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Jn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Kn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Zn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Qn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _placeholders(){return Kn(this,t,"f")}set _placeholders(e){Zn(this,t,e,"f")}get placeholders(){return Array.from(this._placeholders.values())}addPlaceholders(e){for(const t of e){const e=this._placeholders.get(t.key);e&&e.priority>t.priority||this._placeholders.set(t.key,t)}}clear(){this._placeholders=f.observable.map()}constructor(){t.set(this,(qn(this,s),qn(this,a,f.observable.map()))),qn(this,o)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],i=[f.computed],Jn(e,null,r,{kind:"accessor",name:"_placeholders",static:!1,private:!1,access:{has:e=>"_placeholders"in e,get:e=>e._placeholders,set:(e,t)=>{e._placeholders=t}},metadata:t},a,o),Jn(e,null,i,{kind:"getter",name:"placeholders",static:!1,private:!1,access:{has:e=>"placeholders"in e,get:e=>e.placeholders},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Yn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Xn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},el=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},tl=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let rl=(()=>{var e,t;let r,i=[],s=[];return e=class{get _config(){return el(this,t,"f")}set _config(e){tl(this,t,e,"f")}constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.set(this,Xn(this,i,new Ys)),Xn(this,s),this.storyManager=e}get config(){return this._config}setConfig(e){this._config instanceof Qs?this.updateConfig(e):this.initializeConfig(e)}clear(){this._config=new Ys,this.storyManager.rootStore.sessionStore.close()}initializeConfig(e){this._config=new Qs(this.storyManager,e)}updateConfig(e){this._config.update(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[f.observable],Yn(e,null,r,{kind:"accessor",name:"_config",static:!1,private:!1,access:{has:e=>"_config"in e,get:e=>e._config,set:(e,t)=>{e._config=t}},metadata:t},i,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class il{constructor(e){Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sessionStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyFeedStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onboardingFeedStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ugcEditorStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placeholderStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyManagerConfigStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=new Ae(e),r=new Me(e);this.storyManagerConfigStore=new rl(e),this.placeholderStore=new Qn,this.iamStore=new Sn(this,new ca(e)),this.sessionStore=new Cn(e,new se,this),this.storyStore=new An(e,t,this),this.storyFeedStore=new Nn(r,this),this.onboardingFeedStore=new Wn(r,this),this.ugcEditorStore=new $n(e,new Hn(e))}}class sl{constructor(){Object.defineProperty(this,"_getProductCartState",{enumerable:!0,configurable:!0,writable:!0,value:async()=>({offers:[],price:"0",priceCurrency:""})})}set getProductCartState(e){"function"==typeof e&&(this._getProductCartState=e)}get getProductCartState(){return this._getProductCartState}}class al extends Pt{constructor(){if(super(),Object.defineProperty(this,"_rootStore",{enumerable:!0,configurable:!0,writable:!0,value:new il(this)}),Object.defineProperty(this,"_storyLinkClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:e=>{window.open(e.data.url,"_self")}}),Object.defineProperty(this,"_userAgent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyFeeds",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"globalProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"gameReader",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_shareHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"products",{enumerable:!0,configurable:!0,writable:!0,value:new sl}),al.isSingletonInstanceExists())return al.instance;al.instance=this,this.setUserAgent(`InAppStoryReactSDK/${this.sdkVersionCode}`);const e=new Wo(this);return this.storyReader=e.createStoryReader(),this.gameReader=e.createGameReader(),this.inAppMessaging=e.createInAppMessagingReader(),al.instance}get rootStore(){return this._rootStore}get httpClient(){return ra}get userAgent(){return this._userAgent}get deviceId(){return ee.deviceId}get sdkVersionName(){return"1.14.0"}get sdkVersionCode(){return parseInt(11400)}get lang(){return this.rootStore.storyManagerConfigStore.config.lang}set storyLinkClickHandler(e){i()(e)&&(this._storyLinkClickHandler=t=>{try{e(t)}catch(e){console.error(e)}})}get storyLinkClickHandler(){return this._storyLinkClickHandler}get shareHandler(){var e;return null!==(e=this._shareHandler)&&void 0!==e?e:this.getNavigatorShareFunction()}set shareHandler(e){this._shareHandler=e}get isStatisticsDisabled(){return this.config.isStatisticsDisabled}get config(){return this.rootStore.storyManagerConfigStore.config}getNonce(){return k()}getConfig(){return this.config}static getInstance(){return al.instance?al.instance:null}addStoryFeed(e){this.storyFeeds.push(e)}removeStoryFeed(e){const t=this.storyFeeds.indexOf(e);-1!==t&&this.storyFeeds.splice(t,1)}createStoryFeed(){return new Wo(this).createStoryList()}setConfig(e){this.rootStore.storyManagerConfigStore.setConfig(e)}setUserAgent(e){parseInt(11400);this._userAgent=`${e} ${(e=>{let t="";for(let r=0;r<e.length;r++)t+=e.charCodeAt(r)<=255?e[r]:"?";return t})(navigator.userAgent)}`}async showOnboardingStories(e){var t,r;return this.storyReader.showOnboardingStories({feedSlug:null!==(t=null==e?void 0:e.feed)&&void 0!==t?t:void 0,customTags:null==e?void 0:e.customTags,limit:null!==(r=null==e?void 0:e.limit)&&void 0!==r?r:void 0,signal:null==e?void 0:e.signal})}async showStory(e,t={}){"string"==typeof e&&(e=+e||e),await this.storyReader.showStory(e,t)}async showStoryOnce(e,t={}){"string"==typeof e&&(e=+e||e),await this.storyReader.showStoryOnce(e,t)}async showSharePage(e,t={}){"string"==typeof e&&(e=+e||e),await this.storyReader.showStoryFromSharePage(e,t)}closeAllReaders(){this.storyReader.close(),this.gameReader.closeGame()}closeGoodsWidget(){this.storyReader.closeGoodsWidget()}async openGame(e,t={}){await this.gameReader.openGame(e,t)}async closeGame(){return this.gameReader.closeGame()}async closeStoryReader(){this.storyReader.close()}async getUgcEditorConfig(){return this.rootStore.ugcEditorStore.getUgcEditorConfig()}reloadAllStoryLists(){const e=this.storyFeeds.filter(e=>e instanceof hn).map(e=>e.reload());return Promise.all(e)}reloadAllStackedStoryLists(){const e=this.storyFeeds.filter(e=>e instanceof zo).map(e=>e.reload());return Promise.all(e)}clearConfig(){this.storyReader.close(ds.AppClose,!0),this.gameReader.closeGame(),this.inAppMessaging.forceClose(),this.rootStore.storyManagerConfigStore.clear()}getNavigatorShareFunction(){var e,t;let r=null===(e=navigator.share)||void 0===e?void 0:e.bind(navigator);return!r&&(null===(t=window.parent)||void 0===t?void 0:t.navigator.share)&&(r=window.parent.navigator.share.bind(window.parent.navigator)),r}static isSingletonInstanceExists(){return!!al.instance&&(console.warn("[IAS]: StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),!0)}static use(e,t){e.install({INTERNAL_API:nl,HOST:al},t)}}const ol=new al,nl=ol;var ll;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(ll||(ll={}));const cl={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};var dl;!function(e){e.UPDATE="update",e.EVENT_UPDATED_COMMON_OPTIONS="updatedCommonOptions",e.EVENT_UPDATED_STORIES_LIST_OPTIONS="updatedStoriesListOptions",e.EVENT_UPDATED_STORY_READER_OPTIONS="updatedStoryReaderOptions",e.EVENT_UPDATED_FAVORITE_READER_OPTIONS="updatedFavoriteReaderOptions",e.EVENT_UPDATED_GAME_READER_OPTIONS="updatedGameReaderOptions",e.EVENT_UPDATED_GOODS_WIDGET_OPTIONS="updatedGoodsWidgetOptions",e.EVENT_UPDATED_INAPPMESSAGING_WIDGET_OPTIONS="updatedInAppMessagingWidgetOptions"}(dl||(dl={}));Error;class hl extends s.EventEmitter{constructor(){super(),Object.defineProperty(this,"_commonOptions",{enumerable:!0,configurable:!0,writable:!0,value:ct}),Object.defineProperty(this,"_storiesListOptions",{enumerable:!0,configurable:!0,writable:!0,value:ze}),Object.defineProperty(this,"_storyReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:wt}),Object.defineProperty(this,"_storyFavoriteReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:cl}),Object.defineProperty(this,"_goodsWidgetOptions",{enumerable:!0,configurable:!0,writable:!0,value:ft}),Object.defineProperty(this,"_gameReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:pt})}setCommonOptions(e,t=!0){return this._commonOptions=Tt()(this._commonOptions,e),this.emit(dl.UPDATE,this.commonOptions),this}get commonOptions(){return this._commonOptions}setStoriesListOptions(e,t=!0){return this._storiesListOptions=Tt()(this._storiesListOptions,e),t&&(this.emit(dl.UPDATE,this.storiesListOptions),this.emit(dl.EVENT_UPDATED_STORIES_LIST_OPTIONS,this.storiesListOptions)),this}get storiesListOptions(){return this._storiesListOptions}setStoryReaderOptions(e,t=!0){return null==e.layout&&null!=e.useExperimentalModernVariant&&(e.layout=e.useExperimentalModernVariant?bt.Modern:bt.Classic),this._storyReaderOptions=Tt()(this._storyReaderOptions,e,{arrayMerge:(e,t,r)=>t}),t&&this.emit(dl.UPDATE,{storyReaderOptions:this.storyReaderOptions,gameReaderOptions:this.gameReaderOptions,appearanceCommon:this.commonOptions}),this}get storyReaderOptions(){const e={closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton,loader:this.commonOptions.loader};return Object.assign(Object.assign({},e),this._storyReaderOptions)}setStoryFavoriteReaderOptions(e,t=!0){return this._storyFavoriteReaderOptions=Tt()(this._storyFavoriteReaderOptions,e),t&&this.emit(dl.UPDATE,this.storyFavoriteReaderOptions),this}get storyFavoriteReaderOptions(){const e={closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton};return Object.assign(Object.assign({},e),this._storyFavoriteReaderOptions)}setGoodsWidgetOptions(e,t=!0){return this._goodsWidgetOptions=Tt()(this._goodsWidgetOptions,e),t&&this.emit(dl.UPDATE,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}setGameReaderOptions(e,t=!0){return this._gameReaderOptions=Tt()(this._gameReaderOptions,e),t&&this.emit(dl.UPDATE,this.gameReaderOptions),this}get gameReaderOptions(){const e={closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton,loader:this.commonOptions.loader,forceDesktopMode:this.commonOptions.forceDesktopMode};return Object.assign(Object.assign({},e),this._gameReaderOptions)}}(0,f.configure)({enforceActions:"never"}),window.__IAS__={storyManager:ol},(0,f.configure)({enforceActions:"never"});var ul=j(5272),pl=j(9155),gl=j.n(pl);var fl=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const ml=e=>{var{listType:t,feedSlug:r,testKey:i,storyManager:s,options:a,filter:o,useUgcCard:n=!1,hasFavorite:l,isFavorite:c}=e,d=fl(e,["listType","feedSlug","testKey","storyManager","options","filter","useUgcCard","hasFavorite","isFavorite"]);const[h,u]=(0,pl.useState)(),{storyListOptions:p}=(e=>{const t=(0,pl.useRef)(new hl).current;return{storyListOptions:(0,pl.useMemo)(()=>(e&&t.setStoriesListOptions(e),t.storiesListOptions),[JSON.stringify(e)])}})(a),g=()=>{var e;null===(e=d.onLoadStart)||void 0===e||e.call(d)},f=e=>{var t;null===(t=d.onLoadEnd)||void 0===t||t.call(d,e)};return(0,pl.useEffect)(()=>{const e=s.createStoryFeed();return e.on("startLoading",g),e.on("endLoading",f),u(e),()=>{e.off("startLoading",g),e.off("endLoading",f),e.destroy()}},[s]),(0,pl.useEffect)(()=>{h&&(h.setParams({listType:t,testKey:i,feedSlug:r,filter:o,useUgcCard:n,isFavorite:c,hasFavorite:l}),c||h.loadStories({needFavorite:!0}))},[h,i,r,o]),{storyListViewModel:h,storyListOptions:p}};var yl=j(405),vl=j(9780),bl=j.n(vl);class wl{constructor(){Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}toString(){return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${this.fontSize}px/${this.lineHeight} ${this.fontFamily.join(", ")}`}clone(){const e=new wl;return e.fontStyle=this.fontStyle,e.fontVariant=this.fontVariant,e.fontWeight=this.fontWeight,e.fontSize=this.fontSize,e.lineHeight=this.lineHeight,e.fontFamily=this.fontFamily.slice(),e}}class Sl{constructor(e,t){Object.defineProperty(this,"obj",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cardTitleOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cardTitleFont",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cardTitleFont=this.getCardTitleParsedFont(t.font)}getCardTitleFont(){return this.cardTitleFont.clone()}getScaledFontSizeInWebView(){const e=this.measureScaledFontSizeInWebView(this.cardTitleFont.fontSize)/this.cardTitleFont.fontSize;return this.cardTitleFont.fontSize/e}getStoryTitleBlockHeight(){if(!this.isOutsideTitle())return 0;const e=this.cardTitleOptions.padding,t={top:0,bottom:0};try{if("number"==typeof e)t.top=e,t.bottom=e;else{const r=bl()(e);t.top=parseFloat(r.top),t.bottom=parseFloat(r.bottom)}}catch(e){console.error(e)}const r=this.cardTitleOptions.lineClamp,i=Math.round(this.cardTitleFont.fontSize*this.cardTitleFont.lineHeight*100)/100;return t.top+t.bottom+r*i}measureScaledFontSizeInWebView(e){const t=document.createElement("span");t.style.fontSize=e+"px",t.style.display="none",this.obj.append(t);const r=getComputedStyle(t).fontSize;return this.obj.removeChild(t),parseFloat(r)||e}isOutsideTitle(){return this.cardTitleOptions.display&&(this.cardTitleOptions.position===Fe.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===Fe.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new wl;t.fontStyle="normal",t.fontVariant="normal",t.fontWeight="normal",t.fontSize=14,t.lineHeight=1.2,t.fontFamily=["system-ui",'"Segoe UI"',"Roboto","Helvetica","Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'];try{const r=(0,yl.parseFont)(e);if(null!=r["font-style"]&&(t.fontStyle=r["font-style"]),null!=r["font-variant"]&&(t.fontVariant=r["font-variant"]),null!=r["font-weight"]&&(t.fontWeight=r["font-weight"]),null!=r["font-size"]){const e=parseFloat(r["font-size"]);String(`${e}px`)===r["font-size"]&&(t.fontSize=e)}if(null!=r["line-height"]){const e=parseFloat(r["line-height"]);String(`${e}px`)===r["line-height"]?t.lineHeight=Math.round(e/t.fontSize*100)/100:String(e)===r["line-height"]&&(t.lineHeight=parseFloat(r["line-height"]))}null!=r["font-family"]&&Array.isArray(r["font-family"])&&(t.fontFamily=r["font-family"])}catch(e){console.error(e)}return t}}var _l=j(992),Ol=j.n(_l),kl=j(2591),xl=j.n(kl),Cl=j(1740),Pl=j.n(Cl),jl=j(8128),El=j.n(jl),Il=j(855),Tl=j.n(Il),Al=j(3051),Ml=j.n(Al),Ll=j(3656),Rl=j.n(Ll),Bl=j(5213),Dl={};Dl.styleTagTransform=Rl(),Dl.setAttributes=Tl(),Dl.insert=El().bind(null,"head"),Dl.domAPI=Pl(),Dl.insertStyleElement=Ml();xl()(Bl.Ay,Dl);Bl.Ay&&Bl.Ay.locals&&Bl.Ay.locals;var Nl=j(4978),Fl={};Fl.styleTagTransform=Rl(),Fl.setAttributes=Tl(),Fl.insert=El().bind(null,"head"),Fl.domAPI=Pl(),Fl.insertStyleElement=Ml();xl()(Nl.Ay,Fl);Nl.Ay&&Nl.Ay.locals&&Nl.Ay.locals;var Ul=j(4456),Gl={};Gl.styleTagTransform=Rl(),Gl.setAttributes=Tl(),Gl.insert=El().bind(null,"head"),Gl.domAPI=Pl(),Gl.insertStyleElement=Ml();xl()(Ul.A,Gl);Ul.A&&Ul.A.locals&&Ul.A.locals;const Vl=({onClick:e,className:t})=>(0,ul.jsx)("div",{className:Ol()(Ul.K,t),onClick:e,children:(0,ul.jsx)("svg",{viewBox:"0 0 24 24",children:(0,ul.jsx)("path",{fill:"currentColor",d:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"})})});var zl=j(6644),Wl={};Wl.styleTagTransform=Rl(),Wl.setAttributes=Tl(),Wl.insert=El().bind(null,"head"),Wl.domAPI=Pl(),Wl.insertStyleElement=Ml();xl()(zl.Ay,Wl);zl.Ay&&zl.Ay.locals&&zl.Ay.locals;const $l=({geometry:e,children:t,style:r,isWidescreen:i,className:s})=>{const a=i?{width:"100%",height:"100%"}:{width:e.getWidth(),height:e.getHeight()};return(0,ul.jsx)("div",{className:Ol()(zl.jW,s,{[zl.B2]:!i}),style:Object.assign(Object.assign({},r),a),children:(0,ul.jsx)("div",{className:zl.Iu,children:t})})};var Hl=j(3639),ql={};ql.styleTagTransform=Rl(),ql.setAttributes=Tl(),ql.insert=El().bind(null,"head"),ql.domAPI=Pl(),ql.insertStyleElement=Ml();xl()(Hl.A,ql);Hl.A&&Hl.A.locals&&Hl.A.locals;const Jl=G(),Kl=e=>{const[t,r]=(0,pl.useState)(!1),i=(0,pl.useCallback)(()=>{if(Y)return;const t=Jl.type!==e.orientation;e.onOrientationChange({type:Jl.type,isWrong:t}),r(t)},[e.orientation]);return(0,pl.useEffect)(()=>(i(),Jl.addEventListener("change",i),()=>{Jl.removeEventListener("change",i)}),[i]),t?(0,ul.jsx)("div",{className:Hl.g}):null};var Zl=j(5839),Ql={};Ql.styleTagTransform=Rl(),Ql.setAttributes=Tl(),Ql.insert=El().bind(null,"head"),Ql.domAPI=Pl(),Ql.insertStyleElement=Ml();xl()(Zl.Ay,Ql);Zl.Ay&&Zl.Ay.locals&&Zl.Ay.locals;var Yl=j(7231),Xl={};Xl.styleTagTransform=Rl(),Xl.setAttributes=Tl(),Xl.insert=El().bind(null,"head"),Xl.domAPI=Pl(),Xl.insertStyleElement=Ml();xl()(Yl.Ay,Xl);Yl.Ay&&Yl.Ay.locals&&Yl.Ay.locals;const ec=({shareText:e,shareLink:t,sharePanelOptions:r,onShareComplete:i})=>{var s,a,o,n,l,c,d,h,u,g,f;const[m,y]=(0,pl.useState)(!1),[v,b]=(0,pl.useState)(!1),w=()=>{b(!0),!m&&e||i()};return(0,ul.jsxs)("div",{className:`${Zl.z5} ${Yl.ge}`,children:[(0,ul.jsx)("div",{className:`${Zl.cU} ${Yl.cU}`,children:(0,ul.jsx)("a",{className:Yl.Oy,onClick:w,href:t,download:"image.jpeg",children:(0,ul.jsx)("img",{src:t,className:Yl.PH})})}),(0,ul.jsx)("div",{className:Zl.$9,style:{background:null===(s=r.divider)||void 0===s?void 0:s.background}}),(0,ul.jsx)("div",{className:`${Zl.cU} ${Yl.cU}`,children:(0,ul.jsx)("a",{className:Yl.Rg,onClick:w,href:t,download:"image.jpeg",children:(0,ul.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(n=null===(o=null===(a=r.downloadButton)||void 0===a?void 0:a.svgSrc)||void 0===o?void 0:o.baseState)&&void 0!==n?n:""}})})}),e?(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)("div",{className:Zl.$9,style:{background:null===(l=r.divider)||void 0===l?void 0:l.background}}),(0,ul.jsx)("div",{className:`${Zl.cU} ${Yl.cU}`,children:(0,ul.jsxs)("button",{className:Ol()(Yl.HM,Yl.l9),onClick:()=>{(new p).copy(null!=e?e:""),y(!0),v&&i()},children:[(0,ul.jsxs)("div",{className:Yl.UH,children:[(0,ul.jsx)("span",{className:Ol()(Yl.Km,{[Yl.OL]:!m}),dangerouslySetInnerHTML:{__html:null!==(h=null===(d=null===(c=r.copyButton)||void 0===c?void 0:c.svgSrc)||void 0===d?void 0:d.baseState)&&void 0!==h?h:""}}),(0,ul.jsx)("span",{className:Ol()(Yl.Km,{[Yl.xG]:m}),dangerouslySetInnerHTML:{__html:null!==(f=null===(g=null===(u=r.copyButton)||void 0===u?void 0:u.svgSrc)||void 0===g?void 0:g.doneState)&&void 0!==f?f:""}})]}),(0,ul.jsx)("div",{className:Yl.Wz,children:e})]})})]}):null]})};var tc=j(9749),rc={};rc.styleTagTransform=Rl(),rc.setAttributes=Tl(),rc.insert=El().bind(null,"head"),rc.domAPI=Pl(),rc.insertStyleElement=Ml();xl()(tc.Ay,rc);tc.Ay&&tc.Ay.locals&&tc.Ay.locals;var ic=j(6827),sc={};sc.styleTagTransform=Rl(),sc.setAttributes=Tl(),sc.insert=El().bind(null,"head"),sc.domAPI=Pl(),sc.insertStyleElement=Ml();xl()(ic.A,sc);ic.A&&ic.A.locals&&ic.A.locals;const ac=e=>{var t,r,i;return(0,ul.jsxs)("a",{className:`${Zl.Kw} ${ic.l}`,onClick:e.onClick,children:[(0,ul.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(i=null===(r=null===(t=e.options.copyButton)||void 0===t?void 0:t.svgSrc)||void 0===r?void 0:r.baseState)&&void 0!==i?i:""}}),(0,ul.jsx)("span",{className:Zl.pX,style:e.options.text,children:e.label})]})},oc=e=>{var t;return(0,ul.jsx)("div",{className:Zl.$9,style:{background:null===(t=e.options.divider)||void 0===t?void 0:t.background}})},nc=(0,ul.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",viewBox:"0 0 24 24",stroke:"white",fill:"black",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ul.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ul.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,ul.jsx)("path",{d:"M4 8h16"}),(0,ul.jsx)("path",{d:"M4 16h16"})]}),lc=e=>{var t;const[r,i]=(0,pl.useState)(!1),s=null===(t=e.sharePanelOptions.title)||void 0===t?void 0:t.favicon;return e.shareDomain&&(null==s?void 0:s.display)&&(0,ul.jsx)("div",{className:Zl.Zu,style:{background:s.background},children:r?nc:(0,ul.jsx)("img",{src:`${ra.baseURL}/favicon?sz=64&domain_url=${e.shareDomain}`,onError:()=>i(!0),alt:"favicon"})})};var cc=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const dc=e=>{var t,r,i,s,a,o,n,{shareLink:l,shareText:c,sharePanelOptions:d,onShareComplete:h}=e,u=cc(e,["shareLink","shareText","sharePanelOptions","onShareComplete"]);const g=e=>{try{return new URL(e).host}catch(e){return console.error(e),null}},f=()=>{window.removeEventListener("focus",f),h()},m=e=>{var t,r,i,s;const a=l?null!==(t=(e=>{try{return new URL(e)}catch(e){return console.error(e),null}})(l))&&void 0!==t?t:"":null!==(r=window.location.origin)&&void 0!==r?r:window.parent.location.origin,o=null===(i=d.targetParams)||void 0===i?void 0:i[e];return null===(s=null==o?void 0:o.getUrl)||void 0===s?void 0:s.call(o,{url:a.toString(),text:l?g(l)?"":encodeURIComponent(l):null!=c?c:""})},y=d.text,v=null===(t=d.title)||void 0===t?void 0:t.favicon;return(0,ul.jsxs)("div",{className:Zl.z5,children:[(0,ul.jsxs)("div",{className:`${Zl.cU} ${Zl.YX}`,children:[l&&g(l)&&Boolean(null==v?void 0:v.display)&&(0,ul.jsx)(lc,{shareDomain:g(l),sharePanelOptions:d}),(0,ul.jsxs)("span",{className:Zl.DD,dir:u.dir,style:y,children:[u.type===dt.Link&&l?null===(i=null===(r=d.title)||void 0===r?void 0:r.getValue)||void 0===i?void 0:i.call(r,{url:l,text:g(l)?"":encodeURIComponent(l)}):"",u.type===dt.Text&&c?null===(a=null===(s=d.title)||void 0===s?void 0:s.getValue)||void 0===a?void 0:a.call(s,{url:l,text:c}):""]})]}),(0,ul.jsx)(oc,{options:d}),(0,ul.jsx)("div",{className:`${Zl.cU} ${tc.X$}`,children:null===(o=d.targets)||void 0===o?void 0:o.map((e,t)=>{var r,i,s;const a=null===(r=d.targetParams)||void 0===r?void 0:r[e],o=null!==(s=null===(i=null==a?void 0:a.icon)||void 0===i?void 0:i.svgSrc.baseState)&&void 0!==s?s:"<svg></svg>";return(0,ul.jsx)("div",{className:tc.KY,children:(0,ul.jsxs)("a",{href:m(e),onClick:()=>((e,t,r)=>{window.addEventListener("focus",f),window.open(e,t,r)})(m(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${Zl.Kw} ${tc.Kw}`,children:[(0,ul.jsx)("div",{dangerouslySetInnerHTML:{__html:o}}),(0,ul.jsx)("span",{className:Zl.pX,style:y,children:null==a?void 0:a.label})]})},t)})}),(0,ul.jsx)(oc,{options:d}),(0,ul.jsx)("div",{className:Zl.cU,children:(0,ul.jsx)(ac,{options:d,label:null===(n=d.copyButton)||void 0===n?void 0:n.getLabel({url:l,text:c,type:u.type}),onClick:()=>{let e="";switch(u.type){case dt.Text:e=null!=c?c:"";break;case dt.Link:e=null!=l?l:""}(e=>{(new p).copy(e),h()})(e)}})})]})},hc=({shareType:e,shareLink:t,shareText:r,onShareCompelete:i,sharePanelOptions:s,className:a,dir:o})=>{const[n,l]=(0,pl.useState)(!1),[c,d]=(0,pl.useState)(!0),h=()=>{l(!0),d(!1)};return(0,ul.jsxs)("div",{dir:o,className:Ol()(Zl.fP,a),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,ul.jsx)("div",{className:Ol()(Zl.yg,{[Zl.qG]:c,[Zl.Xn]:!c}),onClick:()=>{l(!1),d(!1)}}),(0,ul.jsxs)("div",{className:Ol()(Zl.jk,{[Zl.ly]:c,[Zl.md]:!c}),onAnimationEnd:()=>{c||i(n)},style:{"--height":"100%",background:s.background,borderTopLeftRadius:s.borderRadius+"px",borderTopRightRadius:s.borderRadius+"px"},children:[e===dt.Image&&(0,ul.jsx)(ec,{shareText:r,shareLink:t,onShareComplete:h,sharePanelOptions:s}),(e===dt.Link||e===dt.Text)&&(0,ul.jsx)(dc,{shareLink:t,shareText:r,onShareComplete:h,sharePanelOptions:s,type:e,dir:o})]})]})};var uc=j(9678),pc={};pc.styleTagTransform=Rl(),pc.setAttributes=Tl(),pc.insert=El().bind(null,"head"),pc.domAPI=Pl(),pc.insertStyleElement=Ml();xl()(uc.Ay,pc);uc.Ay&&uc.Ay.locals&&uc.Ay.locals;const gc=e=>{const t=(0,pl.useRef)(null),[r,i]=(0,pl.useState)(null);return(0,pl.useEffect)(()=>{const r=e.$dotLottie.create(t.current,e.config);return i(r),()=>{r.destroy()}},[e.config.sha1,e.$dotLottie]),(0,pl.useEffect)(()=>{r&&e.forceEnd&&r.stop()},[r,e.forceEnd]),(0,pl.useEffect)(()=>{if(!r)return;const e=Nt()(()=>{r.resize()},300);return window.addEventListener("resize",e),()=>{window.addEventListener("resize",e)}},[r]),(0,pl.useEffect)(()=>{if(r)return r.on("play",e.onPlay),r.on("complete",e.onComplete),r.on("beforeLoad",e.onBeforeLoad),r.on("load",e.onLoad),r.on("minPlayingTimeExpired",e.onMinPlayingTimeExpired),r.on("loadError",e.onError),r.load(),()=>{r.off("play",e.onPlay),r.off("complete",e.onComplete),r.off("beforeLoad",e.onBeforeLoad),r.off("load",e.onLoad),r.off("minPlayingTimeExpired",e.onMinPlayingTimeExpired),r.off("loadError",e.onError)}},[r,e.onError,e.onPlay,e.onComplete,e.onLoad,e.onBeforeLoad,e.onMinPlayingTimeExpired]),(0,ul.jsx)("canvas",{ref:t,style:{width:"100%",height:"100%"}})},fc=e=>{var t,r,i;const{storyManager:s}=cp(),[a,o]=(0,pl.useState)(!1),[n,l]=(0,pl.useState)(!1),[c,d]=(0,pl.useState)(!1),[h,u]=(0,pl.useState)(!1),[p,g]=(0,pl.useState)(!1),[f,m]=(0,pl.useState)(!1),y=n||h||e.isGameLoading||!e.gameShouldBeShown,v=s.globalProperties.$dotLottie,b=c||!v||e.isGameLoadingError?null:(null===(r=null===(t=e.game)||void 0===t?void 0:t.splashLottieScreen)||void 0===r?void 0:r.url)&&(null===(i=e.game)||void 0===i?void 0:i.splashLottieScreen),w=e.game&&!e.isGameLoadingError&&y&&!n&&!b,S=()=>{var t,r,i,s;return e.isDesktopGeometry&&(null===(r=null===(t=e.game)||void 0===t?void 0:t.splashLandscapeScreen)||void 0===r?void 0:r.url)?e.game.splashLandscapeScreen.url:null===(s=null===(i=e.game)||void 0===i?void 0:i.splashScreen)||void 0===s?void 0:s.url},_=e.isGameInited&&(!b||p);(0,pl.useEffect)(()=>{_&&e.onSplashCanBeHidden()},[_]);return(0,ul.jsxs)("div",{className:Ol()(uc.O2,{[uc.Hi]:e.game,[uc.gt]:e.gameShouldBeShown,[uc.IY]:w}),children:[(0,ul.jsx)("div",{className:uc.Vv,style:{backgroundColor:e.splashImageBackgroundColor},children:S()&&(0,ul.jsx)("img",{src:S(),onLoad:()=>{m(!0)}})}),b&&v&&(0,ul.jsx)("div",{className:uc.np,children:(0,ul.jsx)(gc,{$dotLottie:v,forceEnd:e.gameShouldBeShown,config:b,onError:()=>{d(!0)},onPlay:()=>{l(!0),o(!1)},onComplete:()=>{l(!1),o(!0)},onLoad:()=>{u(!1)},onBeforeLoad:()=>{u(!0)},onMinPlayingTimeExpired:()=>{g(!0)}})})]})};var mc=j(8034),yc={};yc.styleTagTransform=Rl(),yc.setAttributes=Tl(),yc.insert=El().bind(null,"head"),yc.domAPI=Pl(),yc.insertStyleElement=Ml();xl()(mc.A,yc);mc.A&&mc.A.locals&&mc.A.locals;const vc=e=>{var t,r;return(0,ul.jsx)("button",{dir:e.dir,onClick:e.onCloseGame,className:mc.G,"data-position":e.closeButtonPosition,dangerouslySetInnerHTML:{__html:null!==(r=null===(t=e.closeButtonOptions)||void 0===t?void 0:t.svgSrc.baseState)&&void 0!==r?r:""}})};var bc=j(5299),wc=j(9514);G();const Sc=()=>{const e=window.innerWidth;return{vh:window.innerHeight,vw:e}},_c=()=>{const[e,t]=(0,pl.useState)(()=>Sc()),r=(0,pl.useCallback)(()=>{t(Sc())},[]);return(0,pl.useEffect)(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[]),e},Oc=50,kc=50;var xc=j(763),Cc={};Cc.styleTagTransform=Rl(),Cc.setAttributes=Tl(),Cc.insert=El().bind(null,"head"),Cc.domAPI=Pl(),Cc.insertStyleElement=Ml();xl()(xc.A,Cc);xc.A&&xc.A.locals&&xc.A.locals;const Pc=(0,bc.observer)(({gameReader:e})=>{var t,r,i,s,a,o,n,l,c;const{gameReaderOptions:d}=cp(),h=(0,pl.useRef)(null),{sharePanelOpeningParams:u,handleShareComplete:p,closeSharePanel:g}=(e=>{const[t,r]=(0,pl.useState)(null);return(0,pl.useEffect)(()=>(null==e||e.on("openSharePanel",r),()=>{null==e||e.off("openSharePanel",r)}),[e]),{sharePanelOpeningParams:t,handleShareComplete:i=>{t&&e&&(e.notifyShareCompleted({shareId:t.shareId,isSuccess:i}),r(null))},closeSharePanel:()=>{r(null)}}})(e),{gameGeometry:f,isDesktopGeometry:m}=(()=>{const{vw:e,vh:t}=_c(),r=(new Do).create({vw:e,vh:t});return{isDesktopGeometry:r instanceof Ro,gameGeometry:r}})(),y=e.game,v=m&&(null===(t=null==y?void 0:y.screenOptions.widescreen)||void 0===t||t);(e=>{const t=t=>{27===t.keyCode&&e()};(0,pl.useEffect)(()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[])})(()=>{b()});const b=()=>{e.closeGame(),g()},{gameError:w,isGameLoading:S,closeBtnVisible:_}=e,O=Ol()(Nl.X7,{[Nl.vK]:m,[Nl.QP]:v}),k=e.needApplySafeAreaInsets?{paddingTop:e.safeAreaInsets.top,paddingRight:e.safeAreaInsets.right,paddingBottom:e.safeAreaInsets.bottom,paddingLeft:e.safeAreaInsets.left}:void 0,x={background:null!==(i=null===(r=d.backdrop)||void 0===r?void 0:r.background)&&void 0!==i?i:"",opacity:null!==(a=null===(s=d.backdrop)||void 0===s?void 0:s.opacity)&&void 0!==a?a:0,filter:(null===(o=d.backdrop)||void 0===o?void 0:o.blur)?`blur(${d.backdrop.blur}px)`:"none"},C=null!==(l=null===(n=d.game)||void 0===n?void 0:n.backdropColor)&&void 0!==l?l:"";return(0,wc.createPortal)((0,ul.jsx)("div",{className:Nl.Pe,style:{"--game-box-border-radius":`${parseFloat(String(d.borderRadius))}px`},children:(0,ul.jsxs)("div",{className:O,style:k,children:[(0,ul.jsx)("div",{className:Nl.fN,style:x}),(0,ul.jsxs)($l,{className:Nl.F2,isWidescreen:v,geometry:f,children:[(0,ul.jsx)(fc,{onSplashCanBeHidden:()=>{e.notifyGameCanBeStarted()},isDesktopGeometry:m,isWidescreen:v,isGameInited:e.isGameInited,isGameLoading:S,isGameLoadingError:Boolean(e.gameError),gameShouldBeShown:e.gameShouldBeShown,game:null!==(c=e.game)&&void 0!==c?c:void 0,splashImageBackgroundColor:e.game?C:x.background}),w&&(0,ul.jsx)(Vl,{className:Nl.JF,onClick:()=>{e.reloadGame().catch(console.error)}}),(!e.gameShouldBeShown||_)&&(0,ul.jsx)(vc,{closeButtonPosition:d.closeButtonPosition,dir:e.dir,onCloseGame:b,closeButtonOptions:d.closeButton}),y&&(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)("iframe",{src:y.url,onLoad:t=>{h.current=t.target,e.initGame(h.current,{isWidescreen:v}).catch(console.error)},style:{opacity:e.gameShouldBeShown?1:0},frameBorder:"0",className:Nl.be,sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),u&&(0,ul.jsx)(hc,{dir:e.dir,shareText:u.shareText,shareType:u.shareType,shareLink:u.shareLink,onShareCompelete:p,sharePanelOptions:d.sharePanel})]})]}),y&&d.forceCheckOrientation&&(0,ul.jsx)(Kl,{orientation:V.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.isGameInited&&(t?e.pauseGameUI():e.resumeGameUI())}})]})}),document.body)});var jc=j(1239),Ec={};Ec.styleTagTransform=Rl(),Ec.setAttributes=Tl(),Ec.insert=El().bind(null,"head"),Ec.domAPI=Pl(),Ec.insertStyleElement=Ml();xl()(jc.Ay,Ec);jc.Ay&&jc.Ay.locals&&jc.Ay.locals;class Ic{constructor(e,t,r){Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storiesViewer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"backdropRef",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"deltaValY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"windowHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"swipeUpGestureInAction",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startMove(){this.storyReaderViewModel.disableCloseGesture(),this.windowHeight=this.storiesViewer.clientHeight,this.storiesViewer.style.setProperty("transition","")}move(e){e>10||this.storyReaderViewModel.closeGestureInAction?(this.storyReaderViewModel.enableCloseGesture(),this.moveDownAndScaleReader(e)):(e<-10||this.swipeUpGestureInAction)&&this.moveUp(e)}endMove(){var e;null===(e=this.storyReaderViewModel.activeStory)||void 0===e||e.resumeSystem(this.storyReaderViewModel.touchController),this.deltaValY>=0&&this.handleSwipeDown(),this.storyReaderViewModel.disableCloseGesture()}moveDownAndScaleReader(e){this.deltaValY=e/this.windowHeight;let t=1-(1-.9)*this.deltaValY;t>=1&&(t=1);let r=100*this.deltaValY*.45;r<=0&&(r=0),this.storiesViewer.style.setProperty("transform",`scale(${t}) translateY(${r}%)`)}moveUp(e){this.swipeUpGestureInAction=!0,this.deltaValY=e/this.windowHeight}returnToDefaultState(){this.storiesViewer.style.setProperty("transition","all .3s"),this.storiesViewer.style.setProperty("transform","scale(1) translateY(0%)")}closeStoryReader(){this.storiesViewer.style.setProperty("transition","opacity .3s"),this.storiesViewer.style.setProperty("opacity","0"),this.backdropRef.style.setProperty("transition","opacity .3s"),this.backdropRef.style.setProperty("opacity","0"),setTimeout(()=>{this.storyReaderViewModel.close(ds.CloseBySwipeDown)},400)}handleSwipeDown(){this.deltaValY<=.15||!this.storyReaderViewModel.canBeClosed()?this.returnToDefaultState():this.closeStoryReader()}}var Tc=j(8790),Ac={};Ac.styleTagTransform=Rl(),Ac.setAttributes=Tl(),Ac.insert=El().bind(null,"head"),Ac.domAPI=Pl(),Ac.insertStyleElement=Ml();xl()(Tc.Ay,Ac);Tc.Ay&&Tc.Ay.locals&&Tc.Ay.locals;const Mc=e=>{var t,r;const{storyReaderOptions:i}=cp();return(0,ul.jsx)("div",{dir:e.dir,"data-position":i.closeButtonPosition,className:Ol()(Tc.Kk,{[Tc.dG]:e.hidden},e.className),children:(0,ul.jsx)("button",{className:Ol()(Tc.Gp,{}),onClick:t=>{t.stopPropagation(),t.preventDefault(),e.onClose()},dangerouslySetInnerHTML:{__html:null!==(r=null===(t=i.closeButton)||void 0===t?void 0:t.svgSrc.baseState)&&void 0!==r?r:""}})})},Lc=(0,bc.observer)(e=>{const t=(0,pl.useRef)(null),r=(0,pl.useRef)(null),{storyReaderOptions:i}=cp();(({storyReaderViewModel:e,storiesViewerRef:t,backdropRef:r})=>{const i=(0,pl.useRef)(null);(0,pl.useEffect)(()=>{i.current=new Ic(e,t.current,r.current)},[]);const s=()=>{var e;t.current.classList.add(jc.Z2),null===(e=i.current)||void 0===e||e.startMove()},a=({dy:e})=>{var t;null===(t=i.current)||void 0===t||t.move(e)},o=()=>{var r;t.current.classList.remove(jc.Z2),e.touchController.verticalSwipeGesture&&(null===(r=i.current)||void 0===r||r.endMove())};(0,pl.useEffect)(()=>{const t=e.touchController;return t.on(jt.TouchStart,s),t.on(jt.TouchMoveVertical,a),t.on(jt.TouchEnd,o),()=>{t.off(jt.TouchStart,s),t.off(jt.TouchMoveVertical,a),t.off(jt.TouchEnd,o)}},[e.touchController])})({storyReaderViewModel:e.storyReader,backdropRef:t,storiesViewerRef:r});const s=e.storyReader.activeStory;return(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsxs)("div",{ref:r,className:Ol()("stories-viewer",jc.vi),style:Object.assign(Object.assign({},{"--loaderBackgroundColor":null===(a=i.loader)||void 0===a?void 0:a.default.color,"--loaderBackgroundAccentColor":null===(o=i.loader)||void 0===o?void 0:o.default.accentColor,"--timelineBlockTopOffset":`${parseFloat(String(i.timelineBlockTopOffset))}px`}),(()=>{var e,t,r,s;return{backgroundColor:null!==(t=null===(e=i.commonBackdrop)||void 0===e?void 0:e.color)&&void 0!==t?t:void 0,backdropFilter:null!==(s=null===(r=i.commonBackdrop)||void 0===r?void 0:r.backdropFilter)&&void 0!==s?s:void 0}})()),children:[Y&&(0,ul.jsx)("div",{className:jc.GJ,style:(()=>{var t,r,s;const a=[],o=null===(t=e.storyReader.activeStory)||void 0===t?void 0:t.cover;return null!=i.slideBackdrop&&Array.isArray(i.slideBackdrop.linearGradientOverlay)&&a.push(`linear-gradient(${i.slideBackdrop.linearGradientOverlay.join(", ")})`),null!=o&&a.push(`url(${o})`),{backgroundImage:a.join(", "),opacity:(null===(r=i.slideBackdrop)||void 0===r?void 0:r.opacity)||0,filter:(null===(s=i.slideBackdrop)||void 0===s?void 0:s.blur)?`blur(${i.slideBackdrop.blur}px)`:"none"}})()}),e.children,e.isDesktopGeometry&&s&&!s.disableClose&&(0,ul.jsx)(Mc,{dir:e.storyReader.dir,className:jc.m9,hidden:Boolean(s.pauseState.isUIPaused),onClose:()=>{e.storyReader.close()}})]}),(0,ul.jsx)("div",{ref:t,className:Ol()(jc.qc,{[jc.Xr]:Y})})]});var a,o});var Rc=j(9037),Bc={};Bc.styleTagTransform=Rl(),Bc.setAttributes=Tl(),Bc.insert=El().bind(null,"head"),Bc.domAPI=Pl(),Bc.insertStyleElement=Ml();xl()(Rc.Ay,Bc);Rc.Ay&&Rc.Ay.locals&&Rc.Ay.locals;var Dc=j(6349),Nc={};Nc.styleTagTransform=Rl(),Nc.setAttributes=Tl(),Nc.insert=El().bind(null,"head"),Nc.domAPI=Pl(),Nc.insertStyleElement=Ml();xl()(Dc.Ay,Nc);Dc.Ay&&Dc.Ay.locals&&Dc.Ay.locals;var Fc=j(6028),Uc={};Uc.styleTagTransform=Rl(),Uc.setAttributes=Tl(),Uc.insert=El().bind(null,"head"),Uc.domAPI=Pl(),Uc.insertStyleElement=Ml();xl()(Fc.Ay,Uc);Fc.Ay&&Fc.Ay.locals&&Fc.Ay.locals;const Gc=e=>{const t=0===e.value||1===e.value;return(0,ul.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(-1===e.value?0:-1)}})},Vc=e=>(0,ul.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.activeState:e.options.svgSrc.baseState},onClick:()=>e.onClick(!e.value)}),zc=e=>{const t=0===e.value||-1===e.value;return(0,ul.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(1===e.value?0:1)}})},Wc=e=>(0,ul.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:e.onClick}),$c=e=>(0,ul.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.options.svgSrc.baseState},onClick:e.onClick});var Hc=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const qc=(0,bc.observer)(e=>{var{actionPanel:t,commonOptions:r,storyReaderOptions:i,nodeRef:s,hidden:a}=e,o=Hc(e,["actionPanel","commonOptions","storyReaderOptions","nodeRef","hidden"]);const n=t.hasLike&&Boolean(r.hasLike),l=t.hasShare&&Boolean(r.hasShare),c=t.hasFavorite&&Boolean(r.hasFavorite),d=t.hasAudio;return(0,ul.jsx)("div",{ref:s,dir:o.dir,className:Ol()(Fc.OI,{[Fc.NG]:a,[Fc.x3]:!o.isDesktopGeometry}),children:(0,ul.jsxs)("div",{className:Fc.km,children:[n&&(0,ul.jsx)(zc,{className:Fc.lL,value:t.like,options:i.likeButton,onClick:e=>{t.setLike(e)}}),n&&(0,ul.jsx)(Gc,{className:Fc.lL,value:t.like,options:i.dislikeButton,onClick:e=>{t.setDislike(e)}}),c&&(0,ul.jsx)(Vc,{className:Fc.lL,value:t.favorite,options:i.favoriteButton,onClick:e=>{t.setBookmark(e)}}),(0,ul.jsxs)("div",{className:Fc.i2,children:[d&&(0,ul.jsx)(Wc,{className:Fc.lL,value:t.muted,options:i.muteButton,onClick:()=>{t.muted?t.unmute():t.mute()}}),l&&(0,ul.jsx)($c,{className:Fc.lL,options:i.shareButton,onClick:()=>{t.share()}})]})]})})});var Jc=j(2208),Kc={};Kc.styleTagTransform=Rl(),Kc.setAttributes=Tl(),Kc.insert=El().bind(null,"head"),Kc.domAPI=Pl(),Kc.insertStyleElement=Ml();xl()(Jc.A,Kc);Jc.A&&Jc.A.locals&&Jc.A.locals;var Zc=j(114),Qc={};Qc.styleTagTransform=Rl(),Qc.setAttributes=Tl(),Qc.insert=El().bind(null,"head"),Qc.domAPI=Pl(),Qc.insertStyleElement=Ml();xl()(Zc.Ay,Qc);Zc.Ay&&Zc.Ay.locals&&Zc.Ay.locals;const Yc=(0,bc.observer)(e=>{const{ref:t}=(e=>{const t=(0,pl.useRef)(null);return(0,pl.useEffect)(()=>{const r=e.timeline.timer,i=e=>{var r;null===(r=t.current)||void 0===r||r.style.setProperty("--tick",e+"%")},s=()=>{var e;null===(e=t.current)||void 0===e||e.style.setProperty("--tick","0%")},a=()=>{var e;null===(e=t.current)||void 0===e||e.style.setProperty("--tick","0%")};return r.on(Tr.Start,s),r.on(Tr.Stop,a),r.on(Tr.Progress,i),()=>{r.off(Tr.Start,s),r.off(Tr.Progress,i),r.off(Tr.Stop,a)}},[e]),{ref:t}})(e.story),r=e.story.activeSlide.timeline;return(0,ul.jsx)("div",{ref:t,dir:e.dir,className:Ol()(Zc.wg,{[Zc.tG]:Y,[Zc.dP]:e.hidden}),style:{"--story-timeline-tick-foreground":null==r?void 0:r.foreground,"--story-timeline-background":null==r?void 0:r.background},children:(0,ul.jsx)("div",{className:`${Zc.JS}`,children:new Array(e.story.slidesCount).fill(0).map((t,r)=>(0,ul.jsxs)("div",{className:Zc.wY,children:[(0,ul.jsx)("div",{className:Ol()(Zc.cQ,{[Zc.d]:r+1<=e.story.activeSlideIndex})}),(0,ul.jsx)("div",{className:Zc.Wr,style:{display:r+1===e.story.activeSlideIndex+1?"block":"none"}})]},r+1))})})});var Xc=j(3910),ed={};ed.styleTagTransform=Rl(),ed.setAttributes=Tl(),ed.insert=El().bind(null,"head"),ed.domAPI=Pl(),ed.insertStyleElement=Ml();xl()(Xc.Ay,ed);Xc.Ay&&Xc.Ay.locals&&Xc.Ay.locals;const td=()=>(0,ul.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ul.jsxs)("g",{children:[(0,ul.jsx)("path",{fill:"currentColor",d:"M224,435.8V76.1c0-6.7-5.4-12.1-12.2-12.1h-71.6c-6.8,0-12.2,5.4-12.2,12.1v359.7c0,6.7,5.4,12.2,12.2,12.2h71.6 C218.6,448,224,442.6,224,435.8z"}),(0,ul.jsx)("path",{fill:"currentColor",d:"M371.8,64h-71.6c-6.7,0-12.2,5.4-12.2,12.1v359.7c0,6.7,5.4,12.2,12.2,12.2h71.6c6.7,0,12.2-5.4,12.2-12.2V76.1 C384,69.4,378.6,64,371.8,64z"})]})}),rd=()=>(0,ul.jsx)("svg",{width:"16",height:"16",viewBox:"-40 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ul.jsx)("path",{fill:"currentColor",d:"M405.2,232.9L126.8,67.2c-3.4-2-6.9-3.2-10.9-3.2c-10.9,0-19.8,9-19.8,20H96v344h0.1c0,11,8.9,20,19.8,20 c4.1,0,7.5-1.4,11.2-3.4l278.1-165.5c6.6-5.5,10.8-13.8,10.8-23.1C416,246.7,411.8,238.5,405.2,232.9z"})}),id=(0,bc.observer)(e=>(0,ul.jsxs)("div",{className:Ol()(Xc.bA),dir:e.dir,children:[Y&&(0,ul.jsxs)("div",{className:Ol()(Xc.KH,Xc.Pl,{[Xc.BL]:e.hidden||e.story.timeline.hiddenTimeline}),children:[(0,ul.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:Ol()(Xc.Xs,{[Xc.Uv]:!e.story.pauseState.isUserPaused}),onClick:()=>{e.story.resumeUser()},children:(0,ul.jsx)(rd,{})}),(0,ul.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:Ol()(Xc.Xs,{[Xc.Uv]:e.story.pauseState.isUserPaused}),onClick:()=>{e.story.pauseUser()},children:(0,ul.jsx)(td,{})})]}),!e.story.disableClose&&!e.isDesktopGeometry&&(0,ul.jsx)("div",{className:Ol()(Xc.KH),children:(0,ul.jsx)(Mc,{dir:e.story.dir,className:Ol()(Xc.K0),hidden:e.hidden,onClose:()=>{e.onClose()}})})]})),sd=(0,bc.observer)(e=>(0,ul.jsxs)("div",{ref:e.nodeRef,className:Ol()(Jc.h),children:[(0,ul.jsx)(Yc,{dir:e.story.dir,story:e.story,hidden:e.hidden||e.story.timeline.hiddenTimeline}),(0,ul.jsx)(id,{dir:e.story.dir,story:e.story,onClose:e.onClose,isDesktopGeometry:e.isDesktopGeometry,hidden:e.hidden})]}));var ad=j(2004),od={};od.styleTagTransform=Rl(),od.setAttributes=Tl(),od.insert=El().bind(null,"head"),od.domAPI=Pl(),od.insertStyleElement=Ml();xl()(ad.Ay,od);ad.Ay&&ad.Ay.locals&&ad.Ay.locals;const nd=e=>(0,ul.jsx)("div",{ref:e.nodeRef,className:Ol()(ad.hH,{[ad.At]:e.hidden})});var ld=j(5479),cd={};cd.styleTagTransform=Rl(),cd.setAttributes=Tl(),cd.insert=El().bind(null,"head"),cd.domAPI=Pl(),cd.insertStyleElement=Ml();xl()(ld.Ay,cd);ld.Ay&&ld.Ay.locals&&ld.Ay.locals;const dd=(0,bc.observer)(e=>{const t=e.needShowErrorScreen,r=e.needShowLoaderScreen;return r||t?(0,ul.jsx)("div",{className:Ol()(ld.wG),style:Object.assign({"--loader-background":e.background,"--loaderBackgroundColor":e.color},e.style),onClick:e=>{e.preventDefault()},children:t?(0,ul.jsx)(Vl,{className:ld.MU,onClick:t=>{t.stopPropagation(),e.onReload()}}):r&&(0,ul.jsx)("div",{className:ld.Xr})}):null});const hd=function(){let e;const t=document.createElement("div"),r={transition:"transitionend",OTransition:"otransitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&void 0!==t.style[e])return r[e]}();function ud(e,t,r){return new Promise(i=>{let s=!1;const a=()=>{s=!0,clearTimeout(n),void 0!==hd&&e.removeEventListener(hd,o),e.style.setProperty("transition",`${t} 0ms`),i()},o=e=>{e.propertyName===t&&(s||a())};void 0!==hd&&e.addEventListener(hd,o,!1);const n=setTimeout(()=>{s||a()},r+20);e.style.setProperty("transition",`${t} ${r}ms`)})}var pd=j(2561),gd={};gd.styleTagTransform=Rl(),gd.setAttributes=Tl(),gd.insert=El().bind(null,"head"),gd.domAPI=Pl(),gd.insertStyleElement=Ml();xl()(pd.Ay,gd);pd.Ay&&pd.Ay.locals&&pd.Ay.locals;const fd=e=>{const t=(0,pl.useRef)(null),r=(0,pl.useRef)(null),i=(0,pl.useRef)(0),s=(0,pl.useRef)(0);let a;const o=()=>{r.current&&(s.current=-1*function(e){const t=window.getComputedStyle(e),r=t.transform||t.webkitTransform||t.mozTransform;if("none"===r)return{x:0,y:0,z:0};const i=r.includes("3d")?"3d":"2d",s=r.match(/matrix.*\((.+)\)/)[1].split(", ");return"2d"===i?{x:isNaN(s[4])?0:s[4],y:isNaN(s[5])?0:s[5],z:0}:"3d"===i?{x:isNaN(s[12])?0:s[12],y:isNaN(s[13])?0:s[13],z:isNaN(s[14])?0:s[14]}:{x:0,y:0,z:0}}(r.current).x)},[n,l]=(0,pl.useState)(!1),[c,d]=(0,pl.useState)(!1),h=(0,pl.useRef)(!1),u=()=>{const t=pl.Children.count(e.children);return r.current&&t?r.current.scrollWidth/t:0};let p=!1;(0,pl.useEffect)(()=>{var e;return("ontouchstart"in window||window.navigator.msPointerEnabled||"ontouchstart"in document.documentElement)&&(p=!0),p||(r.current&&(a=null===(e=r.current.children[0])||void 0===e?void 0:e.offsetWidth),r.current&&(i.current=r.current.scrollWidth-r.current.clientWidth,o()),i.current===s.current?d(!1):d(!0),0===s.current?l(!1):l(!0)),()=>{}},[]);const g=(0,pl.useRef)(!1),f=(0,pl.useRef)(0);let m=0;const y=(0,pl.useRef)(!1),[v,b]=(0,pl.useState)(0),w=e=>{e<0&&(e=0),e>i.current&&(e=i.current),b(e)};(0,pl.useEffect)(()=>{v===i.current?d(!1):d(!0),l(0!==v)},[v]);const S=e=>{if(!h.current)if(g.current){const t=e instanceof MouseEvent?e.pageX:e.touches&&e.touches[0].pageX;if(t!==f.current){y.current=!0,m=t;const e=f.current-m,r=s.current+e;w(r)}}else y.current=!1},_=e=>{y.current&&e.preventDefault(),setTimeout(()=>{y.current=!1}),g.current=!1,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",S),document.removeEventListener("touchend",_)};return(0,ul.jsxs)("div",{className:pd.tK,style:e.style,children:[(0,ul.jsx)("div",{className:pd.gE,ref:t,onMouseDown:e=>{h.current||(e.preventDefault(),g.current=!0,f.current=e.pageX,r.current&&(i.current=r.current.scrollWidth-r.current.clientWidth),r.current&&o(),document.addEventListener("mousemove",S),document.addEventListener("mouseup",_))},onTouchStart:e=>{h.current||(e.preventDefault(),g.current=!0,f.current=e.touches&&e.touches[0].pageX,r.current&&(i.current=r.current.scrollWidth-r.current.clientWidth),r.current&&o(),document.addEventListener("touchmove",S),document.addEventListener("touchend",_))},onClickCapture:e=>{y.current&&(e.preventDefault(),e.stopPropagation())},children:(0,ul.jsx)("div",{className:pd.GW,ref:r,style:{transform:`translateX(${-1*v}px)`},children:e.children})}),!p&&(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)("div",{className:Ol()(pd.Nd,pd.gN,{[pd.Su]:n}),onClick:async()=>{if(h.current)return;o();const e=s.current-u();w(e),h.current=!0,r.current&&await ud(r.current,"transform",300),h.current=!1},children:(0,ul.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ul.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),(0,ul.jsx)("div",{className:Ol()(pd.Nd,pd.PP,{[pd.Su]:c}),onClick:async()=>{if(h.current)return;o();const e=s.current+u();w(e),h.current=!0,r.current&&await ud(r.current,"transform",300),h.current=!1},children:(0,ul.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ul.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})})]})]})},md=({children:e,style:t,color:r,font:i,className:s})=>(0,ul.jsx)("div",{className:s,style:Object.assign({color:r,font:i},t),children:e});var yd=j(2621),vd={};vd.styleTagTransform=Rl(),vd.setAttributes=Tl(),vd.insert=El().bind(null,"head"),vd.domAPI=Pl(),vd.insertStyleElement=Ml();xl()(yd.Ay,vd);yd.Ay&&yd.Ay.locals&&yd.Ay.locals;const bd=({goods:e,onClick:t,options:r})=>{var i;const{imgSrc:s,title:a,subTitle:o,price:n,oldPrice:l}=e;return(0,ul.jsxs)("div",{className:Ol()(yd.gS),style:{color:null!==(i=r.mainTextColor)&&void 0!==i?i:"black"},onClick:t,children:[(0,ul.jsx)("div",{className:Ol()(yd.vP),style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor},children:s&&(0,ul.jsx)("img",{src:s,alt:a,style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor}})}),(0,ul.jsx)(md,{font:r.subtitleFont,children:o}),(0,ul.jsx)(md,{font:r.titleFont,children:a}),(0,ul.jsxs)("div",{className:yd.Vt,children:[(0,ul.jsx)(md,{font:r.priceFont,children:n}),(0,ul.jsx)(md,{className:yd.ld,font:r.oldPriceFont,color:r.oldPriceTextColor,children:l})]})]})},wd=e=>{const t=e.goodsWidgetOptions,r=t.goodsWidgetRenderingType||t.goodsList.renderingType;let s=[];return r===gt.DEFAULT?s=e.goodsList.map((r,i)=>(0,ul.jsx)(bd,{options:t.goodsCard,goods:r,onClick:()=>e.onGoodsCardClick(r)},i)):r===gt.CUSTOM_CARD&&i()(t.getCardHtml)&&(s=e.goodsList.map((r,i)=>{var s,a;return(0,ul.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(a=null===(s=t.getCardHtml)||void 0===s?void 0:s.call(t,r,i))&&void 0!==a?a:""},onClick:()=>e.onGoodsCardClick(r)},i)})),(0,ul.jsx)(fd,{style:{marginTop:"-15px"},children:s})};var Sd=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const _d=e=>{var{arrowColor:t}=e,r=Sd(e,["arrowColor"]);return(0,ul.jsx)("svg",Object.assign({},r,{width:"32",height:"12.5",viewBox:"0 0 64 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ul.jsx)("path",{d:"M56.293 1.23375C58.054 -0.41125 60.846 -0.41125 62.607 1.23375C64.464 2.96775 64.464 5.85675 62.607 7.59075L35.157 23.2288C33.396 24.8738 30.604 24.8738 28.843 23.2288L1.393 7.59075C0.494002 6.75175 0 5.62775 0 4.41275C0 3.19775 0.494002 2.07375 1.393 1.23475C3.154 -0.410251 5.946 -0.410251 7.707 1.23475L32 13.9237L56.293 1.23375Z",fill:t})}))};var Od=j(4354),kd={};kd.styleTagTransform=Rl(),kd.setAttributes=Tl(),kd.insert=El().bind(null,"head"),kd.domAPI=Pl(),kd.insertStyleElement=Ml();xl()(Od.A,kd);Od.A&&Od.A.locals&&Od.A.locals;const xd=({closeImage:e,arrowColor:t,onClick:r})=>(0,ul.jsx)("div",{className:Od.H,onClick:r,onTouchStart:r,children:e?(0,ul.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}):(0,ul.jsx)(_d,{arrowColor:t})});var Cd=j(9406),Pd={};Pd.styleTagTransform=Rl(),Pd.setAttributes=Tl(),Pd.insert=El().bind(null,"head"),Pd.domAPI=Pl(),Pd.insertStyleElement=Ml();xl()(Cd.Ay,Pd);Cd.Ay&&Cd.Ay.locals&&Cd.Ay.locals;const jd=({isLoading:e,backgroundColor:t="white",accentBackgroundColor:r="transparent"})=>e?(0,ul.jsx)("div",{className:Cd.u1,style:{border:`solid 2px ${t}`,borderColor:`${r} ${t} ${t} ${t}`}}):null;var Ed=j(777),Id={};Id.styleTagTransform=Rl(),Id.setAttributes=Tl(),Id.insert=El().bind(null,"head"),Id.domAPI=Pl(),Id.insertStyleElement=Ml();xl()(Ed.Ay,Id);Ed.Ay&&Ed.Ay.locals&&Ed.Ay.locals;const Td=e=>{let t=[];return t=e.goodsList.map((t,r)=>e.renderGoods({goods:t,index:r,onClick:t=>{e.onGoodsCardClick(t)}})),(0,ul.jsx)(fd,{children:t})};var Ad;!function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"}(Ad||(Ad={}));const Md=({open:e,url:t,goodsWidgetOptions:r,onClosed:i,onClose:s,onGoodsCardClick:a})=>{const o=(0,pl.useRef)(null),[n,l]=(0,pl.useState)([]),[c,d]=(0,pl.useState)(Ad.IN),h=r,{dimColor:u,substrateHeight:p,substrateColor:g,closeImage:f,closeBackgroundColor:m}=h.goodsList;(0,pl.useEffect)(()=>{d(e?Ad.IN:Ad.OUT)},[e]),(0,pl.useEffect)(()=>{t&&y()},[t]);const y=async()=>{const e=v(),t=await r.openGoodsWidgetHandler(e);l(t)},v=()=>{try{return JSON.parse(t).map(e=>({sku:e,title:"",subTitle:"",price:"",oldPrice:""}))}catch(e){return console.error(e),[]}};(0,pl.useEffect)(()=>{const e=o.current;if(c===Ad.OUT)return e.addEventListener("animationend",i),()=>{e.removeEventListener("animationend",i)}},[c]);const b=h.loader.custom?(0,ul.jsx)("div",{dangerouslySetInnerHTML:{__html:h.loader.custom}}):(0,ul.jsx)(jd,{isLoading:Boolean(r.isLoading),backgroundColor:h.loader.default.color,accentBackgroundColor:h.loader.default.accentColor});return(0,ul.jsxs)("div",{className:Ol()(Ed.rq,{[Ed.NM]:c===Ad.IN,[Ed.bt]:c===Ad.OUT}),ref:o,children:[(0,ul.jsx)("div",{className:Ol()(Ed.fY),style:{backgroundColor:u},onClick:s}),(0,ul.jsxs)("div",{className:Ol()(Ed.rq),style:{height:p+"px",backgroundColor:null!=g?g:"white"},children:[b,r.renderItem?(0,ul.jsx)(Td,{goodsWidgetOptions:r,goodsList:n,renderGoods:r.renderItem,onGoodsCardClick:a}):(0,ul.jsx)(wd,{goodsList:n,onGoodsCardClick:a,goodsWidgetOptions:r}),(0,ul.jsx)(xd,{onClick:s,closeImage:f,arrowColor:m})]})]})};var Ld=j(9111),Rd={};Rd.styleTagTransform=Rl(),Rd.setAttributes=Tl(),Rd.insert=El().bind(null,"head"),Rd.domAPI=Pl(),Rd.insertStyleElement=Ml();xl()(Ld.A,Rd);Ld.A&&Ld.A.locals&&Ld.A.locals;const Bd=(0,bc.observer)(e=>{const[t,r]=(0,pl.useState)(!1),[i,s]=(0,pl.useState)(!1),a=()=>{s(!0),r(!0)},o=()=>{r(!1)};(0,pl.useEffect)(()=>{const t=e.story.goodsWidget;return t.on(xr.Open,a),t.on(xr.Close,o),()=>{t.off(xr.Open,a),t.off(xr.Close,o)}},[e.story]);return i&&e.story.goodsWidget.params.elementId?(0,ul.jsx)("div",{className:Ld.L,children:(0,ul.jsx)(Md,{open:t,url:e.story.goodsWidget.params.target,goodsWidgetOptions:e.goodsWidgetOptions,onClose:()=>{r(!1)},onClosed:()=>{e.story.goodsWidget.close(),s(!1)},onGoodsCardClick:t=>{var r,i;e.story.goodsWidget.onClick(t),null===(i=(r=e.goodsWidgetOptions).itemClickHandler)||void 0===i||i.call(r,t)}})}):null});class Dd{static isEmailValid(e){return/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(e)}static isTelephoneValid(e,t){return e?e.replace(/\s/g,"").length===t.length&&t.length>0:/^\d+$/.test(t)}}const Nd=e=>{switch(e){case"":default:return"text";case"tel":return"tel";case"email":return"email"}},Fd={247:"9999",376:"99 99 99",971:"99 999 9999",93:"99 999 9999",1268:"999 9999",1264:"999 9999",355:"999 999 999",374:"99 999 999",599:"999 9999",244:"999 999 999",672:"9 99 999",54:"999 999 9999",1684:"999 9999",43:"999 999 9999",61:"9 9999 9999",297:"999 9999",994:"99 999 99 99",387:"99 999 999",1246:"999 9999",880:"99 999 999",32:"999 999 999",226:"99 99 9999",359:"999 999 999",973:"9999 9999",257:"99 99 9999",229:"99 99 9999",1441:"999 9999",673:"999 9999",591:"9 999 9999",55:"99 99999 9999",1242:"999 9999",975:"99 999 999",267:"99 999 999",375:"99 999 99 99",501:"999 9999",243:"999 999 999",236:"99 99 9999",242:"99 999 9999",41:"99 999 9999",225:"99 999 999",682:"99 999",56:"9 9999 9999",237:"9999 9999",86:"999 9999 9999",57:"999 999 9999",506:"9999 9999",53:"9 999 9999",238:"999 99 99",357:"99 999 999",420:"999 999 999",49:"9999 999 9999",253:"99 99 99 99",45:"99 99 99 99",1767:"999 9999",1809:"999 9999",1829:"999 9999",1849:"999 9999",213:"99 999 9999",593:"99 999 9999",372:"9999 9999",20:"999 999 9999",291:"9 999 999",34:"999 999 999",251:"99 999 9999",358:"999 999 99 99",679:"99 99999",500:"99999",691:"999 9999",298:"999 999",262:"99999 9999",33:"999 999 999",508:"99 9999",590:"999 999 999",241:"9 99 99 99",1473:"999 9999",995:"999 999 999",594:"99999 9999",233:"999 999 999",350:"999 99999",299:"99 99 99",220:"999 99 99",224:"99 999 999",240:"99 999 9999",30:"999 999 9999",502:"9 999 9999",1671:"999 9999",245:"9 999999",592:"999 9999",852:"9999 9999",504:"9999 9999",385:"99 999 999",509:"99 99 9999",36:"999 999 999",628:"99 999 9999",62:"99 999 99",353:"999 999 999",972:"99 999 9999",91:"9999 999 999",246:"999 9999",964:"999 999 9999",98:"999 999 9999",354:"999 9999",39:"999 9999 999",1876:"999 9999",962:"9 9999 9999",81:"99 9999 9999",254:"999 999999",996:"999 999 999",855:"99 999 999",686:"99 999",269:"99 99999",1869:"999 9999",850:"999 999 9999",82:"99 999 9999",965:"9999 9999",1345:"999 9999",76:"99 999 99 99",77:"99 999 99 99",856:"99 99 999 999",961:"99 999 999",1758:"999 9999",423:"999 999 9999",94:"99 999 9999",231:"99 999 999",266:"9 999 9999",370:"999 99 999",352:"999 999 999",371:"99 999 999",218:"99 999 9999",212:"99 9999 999",377:"9999 9999",373:"9999 9999",382:"99 999 999",261:"99 99 99999",692:"999 9999",389:"99 999 999",223:"99 99 9999",95:"99 999 999",976:"99 99 9999",853:"9999 9999",1670:"999 9999",596:"999 99 99 99",222:"99 99 9999",1664:"999 9999",356:"9999 9999",230:"999 9999",960:"999 9999",265:"99 999 9999",52:"999 999 9999",60:"99 999 9999",258:"99 999 999",264:"99 999 9999",687:"99 9999",227:"99 99 9999",234:"999 999 9999",505:"9999 9999",31:"99 999 9999",47:"999 99 999",977:"99 999 999",674:"999 9999",683:"9999",64:"999 999 999",968:"99 999 999",507:"999 9999",51:"999 999 999",689:"99 99 99",675:"999 99 999",63:"999 999 9999",92:"999 999 9999",48:"999 999 999",970:"99 999 9999",351:"99 999 9999",680:"999 9999",595:"999 999 999",974:"9999 9999",40:"99 999 9999",381:"99 999 9999",7:"999 999 99 99",250:"999 999 999",966:"99 999 9999",677:"999 9999",248:"9 999 999",249:"99 999 9999",46:"99 999 9999",65:"9999 9999",290:"99 999",386:"99 999 999",421:"999 999 999",232:"99 999999",378:"9999 999999",221:"99 999 9999",252:"99 999 999",597:"999 9999",211:"99 999 9999",239:"99 99999",503:"99 99 9999",1721:"999 9999",963:"99 9999 999",268:"99 99 9999",1649:"999 9999",235:"99 99 99 99",228:"99 999 999",66:"99 999 9999",992:"99 999 9999",690:"9999",670:"999 9999",993:"9 999 9999",216:"99 999 999",676:"99999",90:"999 999 9999",1868:"999 9999",688:"99 9999",886:"999 999 999",255:"99 999 9999",380:"99 999 99 99",256:"999 999 999",44:"99 9999 9999",598:"9 999 99 99",998:"99 999 9999",396:"999 99999",1784:"999 9999",58:"999 999 9999",1284:"999 9999",1340:"999 9999",84:"99 9999 999",678:"99 99999",681:"99 9999",685:"99 9999",967:"999 999 999",27:"99 999 9999",260:"99 999 9999",263:"9 999999",1:"999 999 9999",383:"9999 9999"},Ud=e=>{const[t,r]=(0,pl.useState)({countryCode:"",phone:""}),[i,s]=(0,pl.useState)(""),[a,o]=(0,pl.useState)(!0),n=r=>{var i;const s=Nd(null!==(i=null==e?void 0:e.configV2.main.input.type)&&void 0!==i?i:"");return"email"===s?Dd.isEmailValid(r):"tel"!==s||Dd.isTelephoneValid((()=>{var e;const r=t.countryCode.substring(1);return r&&null!==(e=Fd[r])&&void 0!==e?e:""})(),t.phone)};return{value:i,telephone:t,isValid:a,handleTelephoneChange:e=>{r(e),e.phone.length>0?s("+"+e.countryCode+e.phone):s("")},handleChange:e=>{s(e)},handleSubmit:e=>{const t=i.trim(),r=n(i);o(r),r&&e({value:t})},reset:()=>{o(!0),s(""),r({countryCode:"",phone:""})}}};var Gd=j(7656),Vd={};Vd.styleTagTransform=Rl(),Vd.setAttributes=Tl(),Vd.insert=El().bind(null,"head"),Vd.domAPI=Pl(),Vd.insertStyleElement=Ml();xl()(Gd.Ay,Vd);Gd.Ay&&Gd.Ay.locals&&Gd.Ay.locals;const zd=e=>{const t=(0,pl.useRef)(null);return(0,pl.useEffect)(()=>{t.current&&(O(t.current),t.current.focus())},[]),(0,ul.jsx)("input",{type:"email",className:Ol()(Gd.hF,Gd.Q$),placeholder:e.placeholder,value:e.value,ref:t,onChange:t=>e.onChange(t.target.value)})};class Wd{constructor(e,t={}){Object.defineProperty(this,"pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"patternChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placeholderChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lastValue",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lastSelectionStart",{enumerable:!0,configurable:!0,writable:!0,value:0});const{pattern:r="+7 (___) ___-__-__",patternChar:i="_",placeholderChar:s="_"}=t;this.inputElement=e,this.pattern=r,this.patternChar=i,this.placeholderChar=s,this.handleBeforeInput=this.handleBeforeInput.bind(this),this.handleInput=this.handleInput.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handlePaste=this.handlePaste.bind(this),this.setupEventListeners(),this.initializeMask()}setupEventListeners(){this.inputElement.addEventListener("beforeinput",this.handleBeforeInput),this.inputElement.addEventListener("input",this.handleInput),this.inputElement.addEventListener("keydown",this.handleKeyDown),this.inputElement.addEventListener("focus",this.handleFocus),this.inputElement.addEventListener("paste",this.handlePaste)}removeEventListeners(){this.inputElement.removeEventListener("beforeinput",this.handleBeforeInput),this.inputElement.removeEventListener("input",this.handleInput),this.inputElement.removeEventListener("keydown",this.handleKeyDown),this.inputElement.removeEventListener("focus",this.handleFocus),this.inputElement.removeEventListener("paste",this.handlePaste)}destroy(){this.removeEventListeners(),this.inputElement=null}initializeMask(){""===this.inputElement.value&&(this.inputElement.value=this.getEmptyMask(),this.lastValue=this.inputElement.value,this.lastSelectionStart=0)}handleFocus(){this.initializeMask();const e=this.findNextEditablePos(0);-1!==e&&0===this.inputElement.selectionStart&&this.setSelection(e)}isStaticMaskChar(e){if(e<0||e>=this.pattern.length)return!1;const t=this.pattern[e];return t!==this.patternChar&&!/\d/.test(t)}handleBeforeInput(e){e.data&&e.data.includes(" ")?e.preventDefault():"insertText"!==e.inputType||!e.data||/^\d+$/.test(e.data)?(this.lastValue=this.inputElement.value,this.lastSelectionStart=this.inputElement.selectionStart||0):e.preventDefault()}handlePaste(e){var t;e.preventDefault();const r=(null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain"))||"";this.processPastedText(r)}handleKeyDown(e){const{key:t}=e,r=this.inputElement.selectionStart||0,i=this.inputElement.selectionEnd||0,s=r!==i;if(" "!==t)if(/^\d$/.test(t)||["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","Tab"].includes(t)){if("Backspace"===t)s?this.processSelectionDelete(r,i):this.processBackspace(r),e.preventDefault();else if("Delete"===t)s?this.processSelectionDelete(r,i):this.processDelete(r),e.preventDefault();else if(/^\d$/.test(t)){const e=r;this.isStaticMaskChar(e)&&this.setSelection(e+1)}}else e.preventDefault();else e.preventDefault()}handleInput(e){"insertText"!==e.inputType&&"insertFromPaste"!==e.inputType||this.processTextInput(e.data||"")}processTextInput(e){const t=e.replace(/\D/g,"");if(!t)return;const r=this.lastValue.split("");let i=this.lastSelectionStart;for(let e=0;e<t.length;e++){const s=this.findNextEditablePos(i);if(-1===s)break;for(r[s]=t[e],i=s+1;i<this.pattern.length&&this.isStaticMaskChar(i);)i++}this.updateValue(r.join(""),i)}processPastedText(e){const t=e.replace(/\D/g,"");if(!t)return;const r=this.lastValue.split("");let i=this.lastSelectionStart;for(let e=0;e<t.length;e++){const s=this.findNextEditablePos(i);if(-1===s)break;for(r[s]=t[e],i=s+1;i<this.pattern.length&&this.isStaticMaskChar(i);)i++}this.updateValue(r.join(""),i)}processBackspace(e){let t=e-1;for(;t>=0&&this.isStaticMaskChar(t);)t--;if(t>=0&&this.isEditablePosition(t)){const e=this.lastValue.split("");e[t]=this.placeholderChar,this.updateValue(e.join(""),t)}}processDelete(e){const t=[...this.lastValue];let r=e,i=!1;for(;r<this.pattern.length;){if(this.isEditablePosition(r)){t[r]=this.placeholderChar,i=!0;break}r++}if(i){let e=r+1;for(;e<this.pattern.length&&this.isStaticMaskChar(e);)e++;this.updateValue(t.join(""),e)}}processSelectionDelete(e,t){const r=this.lastValue.split("");for(let i=e;i<t;i++)this.isEditablePosition(i)&&(r[i]=this.placeholderChar);this.updateValue(r.join(""),e)}updateValue(e,t){e!==this.inputElement.value&&(this.inputElement.value=e),this.setSelection(t),this.lastValue=e;const r=new Event("input",{bubbles:!0});this.inputElement.dispatchEvent(r)}setSelection(e){this.inputElement.setSelectionRange(e,e),this.lastSelectionStart=e}findNextEditablePos(e){for(let t=e;t<this.pattern.length;t++)if(this.isEditablePosition(t))return t;return-1}findPrevEditablePos(e){for(let t=e;t>=0;t--)if(this.isEditablePosition(t))return t;return-1}isEditablePosition(e){if(e<0||e>=this.pattern.length)return!1;const t=this.pattern[e];return t===this.patternChar||/\d/.test(t)}getEmptyMask(){return this.pattern.replace(new RegExp(this.patternChar,"g"),this.placeholderChar||"​")}getCleanPhoneNumber(){return this.lastValue.replace(/\D/g,"")}isValid(){const e=this.getCleanPhoneNumber(),t=this.pattern.split("").filter(e=>e===this.patternChar||/\d/.test(e)).length;return e.length>=t}isPartial(){return this.getCleanPhoneNumber().length>0&&!this.isValid()}setValue(e){if(null==e)return this.inputElement.value="",void this.initializeMask();const t=e.replace(/\D/g,""),r=this.getEmptyMask().split("");let i=0;for(let e=0;e<r.length&&i<t.length;e++)this.isEditablePosition(e)&&(r[e]=t[i],i++);this.updateValue(r.filter(e=>"​"!=e).join(""),this.findNextEditablePos(0))}}const $d=e=>{const{value:t="",pattern:r="+7 (___) ___-__-__",patternChar:i="9",placeholderChar:s="_",className:a="",onChange:o}=e,n=(0,pl.useRef)(null),l=(0,pl.useRef)(null);(0,pl.useEffect)(()=>(n.current&&(l.current=new Wd(n.current,{pattern:r,patternChar:i,placeholderChar:s}),l.current.setValue(t)),()=>{var e;null===(e=l.current)||void 0===e||e.destroy()}),[r,i,s]),(0,pl.useEffect)(()=>{l.current&&t!==l.current.getCleanPhoneNumber()&&l.current.setValue(t)},[t]);return(0,pl.useImperativeHandle)(e.inputRef,()=>({focus:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()},blur:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.blur()},setValue:e=>{var t;return null===(t=l.current)||void 0===t?void 0:t.setValue(e)},getCleanValue:()=>{var e;return(null===(e=l.current)||void 0===e?void 0:e.getCleanPhoneNumber())||""},getInputElement:()=>n.current})),(0,ul.jsx)("input",{ref:n,type:"tel",placeholder:e.placeholder,className:a,onInput:()=>{var e;if(l.current){const t=(null===(e=n.current)||void 0===e?void 0:e.value)||"",r=l.current.getCleanPhoneNumber();o(t,r)}}})},Hd=e=>{const t=(0,pl.useRef)(null),r=e.value.countryCode?Fd[e.value.countryCode]:"";return(0,pl.useEffect)(()=>{var e;const r=null===(e=t.current)||void 0===e?void 0:e.getInputElement();var i;r&&(i=r,setTimeout(()=>{O(i),i.focus()}))},[]),(0,ul.jsxs)("div",{className:Gd.rL,children:[(0,ul.jsxs)("div",{className:Gd.rN,children:[(0,ul.jsx)($d,{value:e.value.countryCode,inputRef:t,pattern:"+999",placeholderChar:"",className:Gd.hF,onChange:(t,r)=>{e.onChange({countryCode:r,phone:e.value.phone})}}),(0,ul.jsx)("div",{className:Gd.wU})]}),(null==r?void 0:r.length)?(0,ul.jsx)($d,{value:e.value.phone,pattern:r,placeholder:e.placeholder,className:Gd.hF,onChange:(t,r)=>{e.onChange({countryCode:e.value.countryCode,phone:r})}}):(0,ul.jsx)("input",{type:"tel",className:Gd.hF,placeholder:e.placeholder,value:e.value.phone,onChange:t=>{const r=t.target;r&&(r.value=r.value.replace(/\D/g,""),e.onChange({countryCode:e.value.countryCode,phone:r.value}))}})]})},qd=e=>{const t=(0,pl.useRef)(null),r=(0,pl.useRef)(null);(0,pl.useEffect)(()=>{r.current.dataset.replicatedValue=e.value,O(t.current),t.current.focus(),t.current.setSelectionRange(e.value.length,e.value.length)},[]);return(0,ul.jsx)("div",{className:Gd.kJ,ref:r,style:e.style,children:(0,ul.jsx)("textarea",{className:Gd.hF,placeholder:e.placeholder,rows:1,ref:t,maxLength:e.maxLength,value:e.value,onChange:t=>e.onChange(t.target.value),onInput:e=>{r.current.dataset.replicatedValue=e.currentTarget.value}})})};var Jd=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Kd=e=>{var{form:t,config:r}=e,i=Jd(e,["form","config"]);const[s,a]=(0,pl.useState)(!0),{getMainStyle:o,getMainElementsStyle:n,getQuestionStyle:l,getInputWrapperStyle:c,getButtonStyle:d,getTextareaStyle:h}=(({config:e})=>{const t=t=>t*(e.size.viewportWidth/(e.size.viewportWidth/e.size.fontSize));return{getMainStyle:()=>{const r=e.configV2.main;return{width:`${e.size.absolute.width}px`,height:"auto",left:e.size.absolute.center.x-e.size.absolute.width/2-e.size.slideOffsetX+"px",top:e.size.absolute.center.y-e.size.absolute.height/2-e.size.slideOffsetY+"px",backgroundColor:`${r.background.color}`,border:`${r.border.visible&&`${t(r.border.width)}px solid ${r.border.color}`}`,borderRadius:`${t(r.border.radius)}px`}},getMainElementsStyle:()=>{const r=e.configV2.main;return{width:"100%",padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`}},getQuestionStyle:()=>{const r=e.configV2.main.question;return{padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`,color:`${r.text.color}`,fontSize:`${t(r.text.size)}px`,lineHeight:`${r.text.lineHeight}`,textAlign:`${r.text.align}`,fontFamily:`${r.text.type}`,fontWeight:`${r.text.weight}`,fontStyle:`${r.text.style}`}},getInputWrapperStyle:()=>{const r=e.configV2.main.input;let i=e.configV2.main.input.text.maxLines;return i=i>0?i:1,{padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`,backgroundColor:`${r.background.color}`,border:`${t(r.border.width)}px solid ${r.border.color}`,borderRadius:`${t(r.border.radius)}px`,lineHeight:`${r.text.lineHeight}`,maxHeight:r.text.lineHeight*i+"em",fontSize:`${t(r.text.size)}px`,overflowY:"scroll",scrollbarWidth:"none"}},getButtonStyle:()=>{const r=e.configV2.main.button;return{padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`,backgroundColor:`${r.background.color}`,border:`${t(r.border.width)}px solid ${r.border.color}`,color:`${r.text.color}`,fontSize:`${t(r.text.size)}px`,lineHeight:`${r.text.lineHeight}`,textAlign:`${r.text.align}`,fontFamily:`${r.text.type}`,fontWeight:`${r.text.weight}`,fontStyle:`${r.text.style}`}},getTextareaStyle:()=>{const r=e.configV2.main.input;return{color:`${r.text.color}`,fontSize:`${t(r.text.size)}px`,lineHeight:`${r.text.lineHeight}`,textAlign:`${r.text.align}`,fontFamily:`${r.text.type}`,fontWeight:`${r.text.weight}`,fontStyle:`${r.text.style}`}}}})({config:r}),u=Math.max(r.configV2.main.input.text.limit,0),p=String(r.configV2.main.input.text.placeholder).trim(),g=String(r.configV2.main.button.text.value).trim(),f=String(r.configV2.main.question.text.value).trim(),m=Nd(r.configV2.main.input.type),y=({value:e})=>{i.onComplete({result:!0,value:e}),a(!1)};return(0,ul.jsxs)("div",{className:Gd.iE,children:[(0,ul.jsx)("div",{className:Ol()(Gd.tB,{[Gd.qG]:s,[Gd.Xn]:!s}),onAnimationEnd:()=>{s||i.onClose()},onClick:()=>{i.onComplete({result:!1,value:t.value}),a(!1)}}),(0,ul.jsxs)("div",{className:Gd.iW,style:o(),children:[(0,ul.jsxs)("div",{style:n(),children:[(0,ul.jsx)("div",{className:Gd.b1,style:l(),children:f}),(0,ul.jsxs)("div",{className:Ol()(Gd.nl,{[Gd.fg]:!t.isValid}),style:c(),children:["text"===m&&(0,ul.jsx)(qd,{value:t.value,onChange:t.handleChange,style:h(),placeholder:p,maxLength:u}),"email"===m&&(0,ul.jsx)(zd,{value:t.value,onChange:t.handleChange,placeholder:p}),"tel"===m&&(0,ul.jsx)(Hd,{value:t.telephone,onChange:t.handleTelephoneChange,placeholder:p})]})]}),t.value.trim().length>0&&(0,ul.jsx)("div",{className:Gd.HE,children:(0,ul.jsx)("button",{className:Gd.x6,style:d(),onClick:()=>t.handleSubmit(y),children:g})})]})]})},Zd=(0,bc.observer)(({storyGeometry:e,story:t,storyRef:r})=>{const[i,s]=(0,pl.useState)(null),a=Ud(i),o=t.textInput;(0,pl.useEffect)(()=>{o.config&&o.isOpened&&(t.pauseUI(o),t.touchController.disable(),(t=>{t.size.fontSize=parseFloat(e.getFontSize()),t.size.viewportWidth=e.calculateWidth();const i=r.current.getBoundingClientRect();t.size.slideOffsetX=i.x,t.size.slideOffsetY=i.y,t.size.slideHeight=i.height,s(t)})(o.config))},[o.isOpened]);return(0,pl.useLayoutEffect)(()=>()=>{a.reset()},[o.id]),i?(0,ul.jsx)(Kd,{form:a,config:i,onComplete:e=>{if(!o.id)return;const r=e.result?e.value:"";t.textInput.completeInput(r),t.activeSlide.setTextInputResult(o.id,r),t.resumeUI(o)},onClose:()=>{s(null),t.touchController.enable(),o.close()}}):null});class Qd extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"preventNavigation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleClick",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.shadowRoot&&this.dispatchEvent(new CustomEvent("click",{detail:{event:e,currentTarget:this._mountPoint}}))}})}getMountPoint(){return this._mountPoint}setStyle(e){if(!this._mountPoint)return;this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement);const t=document.createElement("style");t.textContent=e,t.setAttribute("nonce",k()),this.styleElement=t,this._mountPoint.prepend(t)}connectedCallback(){const e=this.attachShadow({mode:"open"});this._mountPoint=document.createElement("div"),this._mountPoint.style.height="100%",this._mountPoint.style.width="100%",this._mountPoint.addEventListener("click",this.handleClick),e.appendChild(this._mountPoint)}disconnectedCallback(){var e;null===(e=this._mountPoint)||void 0===e||e.removeEventListener("click",this.handleClick)}}function Yd(e){return"function"==typeof pl.forwardRef?pl.forwardRef(e):function(t){return e(t,t.ref)}}customElements.get("story-slides-container")||customElements.define("story-slides-container",Qd);var Xd=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const eh=(0,bc.observer)(Yd((e,t)=>{var{className:r,story:i}=e,s=Xd(e,["className","story"]);const a=(0,pl.useRef)(null);(0,pl.useImperativeHandle)(t,()=>({setStyle:e=>{var t;null===(t=a.current)||void 0===t||t.setStyle(e)},getMountPoint:()=>{var e,t;return null!==(t=null===(e=a.current)||void 0===e?void 0:e.getMountPoint())&&void 0!==t?t:null}}),[t,a]),(0,pl.useEffect)(()=>{if(!a.current)return;const e=a.current,t=e=>{s.onClick(e.detail)};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[s.onClick]);const o=s.isDesktopGeometry?"0px":`${i.actionPanel.height}px`;return(0,ul.jsx)("story-slides-container",{ref:a,style:{bottom:o},class:r,dir:i.dir})}));var th=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const rh=(0,bc.observer)(e=>{var{story:t,geometry:r,className:i}=e,s=th(e,["story","geometry","className"]);const a=(0,pl.useRef)(null),o=(0,pl.useRef)(null),{storyReaderOptions:n,commonOptions:l,goodsWidgetOptions:c}=cp();var d;(({geometry:e,story:t})=>{const{storyReaderOptions:r,commonOptions:i}=cp(),s=e instanceof Li;(0,pl.useLayoutEffect)(()=>{const e=parseFloat(String(r.actionPanelBottomOffset));t.actionPanel.setOptions(i),t.actionPanel.setActionPanelHeight(e)},[t,i,r.actionPanelBottomOffset,s])})({geometry:r,story:t}),(({story:e,slideRef:t})=>{(0,pl.useLayoutEffect)(()=>{t.current&&t.current.setStyle(e.context.style)},[e.context.style,t])})({story:t,slideRef:o}),d={story:t,canBeInited:s.canBeInited,canBeStarted:s.canBeStarted,activeStory:s.activeStory,slideRef:o},(0,pl.useEffect)(()=>{d.slideRef.current&&d.story.update({container:d.slideRef.current.getMountPoint(),canBeInited:d.canBeInited,canBeStarted:d.canBeStarted,activeStory:d.activeStory})},[d.canBeInited,d.canBeStarted,d.slideRef,d.story]),(0,pl.useEffect)(()=>()=>{d.story.update({container:null,canBeInited:!1,canBeStarted:!1,activeStory:null})},[]);const h=r instanceof Li,u=t===s.activeStory,p=n.layout===bt.Modern,g=h&&p&&!u||t.pauseState.isUIPaused,f=h&&(p&&!u||t.textInput.isOpened);return(0,ul.jsxs)("div",{ref:a,className:Ol()(Dc._7,i,{[Dc.Z8]:!h}),onMouseDown:()=>{t.sharePanel.completeNativeSharing({result:!1})},onTouchStart:()=>{t.sharePanel.completeNativeSharing({result:!1})},"data-testid":"story",children:[h&&p&&t.isSlideRendered&&(0,ul.jsx)(nd,{hidden:u}),t.isSlideRendered&&(0,ul.jsx)(sd,{hidden:g,story:t,onClose:s.onClose,isDesktopGeometry:h}),(0,ul.jsx)(eh,{className:Dc.rE,story:t,ref:o,isDesktopGeometry:h,onClick:({event:e,currentTarget:r})=>{u&&t.activeSlide.onClick({event:e,currentTarget:r,preventNavigation:p&&h})}}),t.actionPanel.needShown&&t.isSlideRendered&&(0,ul.jsx)(qc,{dir:t.dir,isDesktopGeometry:h,hidden:f,actionPanel:t.actionPanel,commonOptions:l,storyReaderOptions:n}),s.activeStory===t&&(0,ul.jsx)(Bd,{story:t,goodsWidgetOptions:c}),s.activeStory===t&&(0,ul.jsx)(Zd,{story:t,storyRef:a,storyGeometry:r}),t.sharePanel.isOpened&&(0,ul.jsx)(hc,{dir:t.dir,shareText:t.sharePanel.params.text,shareType:t.sharePanel.params.type,shareLink:t.sharePanel.params.link,onShareCompelete:e=>t.sharePanel.handleShareComplete(t.sharePanel.params.id,e),sharePanelOptions:n.sharePanel}),(0,ul.jsx)(dd,{needShowErrorScreen:t.needShowErrorScreen,needShowLoaderScreen:t.needShowLoaderScreen,onReload:()=>{t.recover()}})]})});var ih=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},sh=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ah=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},oh=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let nh=(()=>{var e,t,r;let i,a,o,n,l,c,d=s.EventEmitter,h=[],u=[],p=[],g=[],m=[];return e=class extends d{constructor(){super(...arguments),t.set(this,(ih(this,h),ih(this,u,!1))),r.set(this,(ih(this,p),ih(this,g,0))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:ih(this,m)}),Object.defineProperty(this,"handleViewportResize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{requestAnimationFrame(()=>{this.translateSlideTrack(this._currentIndex)})}}),Object.defineProperty(this,"getSlideTrackXOffset",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{const{width:r}=e.getBoundingClientRect(),i=e.children[t];if(!i)return;return r/2-i.offsetLeft-i.clientWidth/2}})}get _animating(){return ah(this,t,"f")}set _animating(e){oh(this,t,e,"f")}get _currentIndex(){return ah(this,r,"f")}set _currentIndex(e){oh(this,r,e,"f")}get currentIndex(){return this._currentIndex}get animating(){return this._animating}set currentIndex(e){this._currentIndex=e}init({$el:e}){this.$el=e,this.go(this._currentIndex,0),window.addEventListener("resize",this.handleViewportResize)}async go(e,t=300){this._animating||(this._animating=!0,this.startTransition(t),this.translateSlideTrack(e),t>0?await this.waitTransitionEnd(t):this.translateSlideTrack(this._currentIndex),this.endTransition(),this._animating=!1)}destroy(){window.removeEventListener("resize",this.handleViewportResize)}waitTransitionEnd(e){return new Promise(t=>{const r=i=>{Math.round(1e3*i.elapsedTime)===e&&"transform"===i.propertyName&&(this.$el.removeEventListener("transitionend",r),t())};this.$el.addEventListener("transitionend",r)})}startTransition(e){this.$el.style.transition=`transform ${e}ms ease-in-out`}endTransition(){this.$el.style.transition=""}translateSlideTrack(e){const t=this.getSlideTrackXOffset(this.$el,e);this.$el.style.transform=`translateX(${t}px)`}},t=new WeakMap,r=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=d[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[f.observable],a=[f.observable],o=[f.computed],n=[f.computed],l=[f.action],c=[f.action],sh(e,null,i,{kind:"accessor",name:"_animating",static:!1,private:!1,access:{has:e=>"_animating"in e,get:e=>e._animating,set:(e,t)=>{e._animating=t}},metadata:r},u,p),sh(e,null,a,{kind:"accessor",name:"_currentIndex",static:!1,private:!1,access:{has:e=>"_currentIndex"in e,get:e=>e._currentIndex,set:(e,t)=>{e._currentIndex=t}},metadata:r},g,m),sh(e,null,o,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,h),sh(e,null,n,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,h),sh(e,null,l,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:r},null,h),sh(e,null,c,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,h),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class lh{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t})}get animating(){return this.slider.animating}transitionByIndex(e,t){return this.slider.go(e)}}var ch=j(6778),dh={};dh.styleTagTransform=Rl(),dh.setAttributes=Tl(),dh.insert=El().bind(null,"head"),dh.domAPI=Pl(),dh.insertStyleElement=Ml();xl()(ch.Ay,dh);ch.Ay&&ch.Ay.locals&&ch.Ay.locals;var hh=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const uh=e=>{var{disabled:t,navigationOptions:r,display:i}=e,s=hh(e,["disabled","navigationOptions","display"]);const a=s.dir===xt.LTR,o=a?s.isNextDisabled:s.isPrevDisabled,n=a?s.isPrevDisabled:s.isNextDisabled,l=o||t,c=n||t;return(0,ul.jsxs)("div",{ref:s.nodeRef,className:Ol()(ch.cW,{[ch.d9]:!i}),children:[(0,ul.jsx)("div",{className:Ol()(ch.j,ch.Tr),children:(0,ul.jsx)("button",{className:ch.qU,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onPrev()},disabled:c,dangerouslySetInnerHTML:{__html:r.prevButton.svgSrc.baseState}})}),(0,ul.jsx)("div",{className:Ol()(ch.j,ch.XX),children:(0,ul.jsx)("button",{className:ch.qU,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onNext()},disabled:l,dangerouslySetInnerHTML:{__html:r.nextButton.svgSrc.baseState}})})]})},ph=(0,bc.observer)(e=>{const{storyReaderOptions:t}=cp(),{ref:r,slider:i}=(e=>{const[t]=(0,pl.useState)(()=>new nh),{storyReaderOptions:r}=cp(),i=(0,pl.useRef)(null);return t.currentIndex=e.activeStoryIndex,(0,pl.useEffect)(()=>(t.init({$el:i.current}),()=>{t.destroy()}),[e.stories,e.dir]),(0,pl.useEffect)(()=>{e.setAnimatedNavigationController(new lh(t,{closeOnLastSlideByTimer:Boolean(r.closeOnLastSlideByTimer)}))},[e,r.closeOnLastSlideByTimer]),{ref:i,slider:t}})(e.storyReader),s=e.storyReader.targetTransitionStory||e.storyReader.activeStory,a=parseFloat(String(t.borderRadius)),o=3*parseFloat(e.storyGeometry.getWidth()),n=s.pauseState.isUIPaused||i.animating,l=(t,r=2)=>{const i=-1===e.storyReader.targetTransitionIndex?e.storyReader.activeStoryIndex:e.storyReader.targetTransitionIndex,s=Math.max(i-r,0),a=Math.min(i+r,e.storyReader.stories.length-1);return t>=s&&t<=a},c=t=>e.storyReader.activeStoryIndex===t;return(0,ul.jsx)("div",{className:Ol()(Rc.fo),style:{"--slide-border-radius":`${a}px`,maxWidth:o},children:(0,ul.jsx)("div",{className:Rc.$X,ref:r,dir:s.dir,children:e.storyReader.stories.map((r,i)=>{const a=r===s,o=r.isNextDisabled,d=r.isPrevDisabled;return(0,ul.jsxs)("div",{style:{width:e.storyGeometry.getWidth()},className:Ol()(Rc.uY,{[Rc.tB]:a}),onClick:()=>{n||e.storyReader.toStoryWithAnimationByIndex(i)},children:[(0,ul.jsx)(rh,{index:i,story:r,slideClickDisabled:n,activeStory:s,geometry:e.storyGeometry,onClose:e.onCloseStory,canBeInited:l(i),canBeStarted:c(i)}),(e.storyReader.stories.length>1||r.slidesCount>1)&&s.isSlideRendered&&(0,ul.jsx)(uh,{dir:e.storyReader.dir,display:a&&s.isSlideRendered,disabled:n,isNextDisabled:o,isPrevDisabled:d,navigationOptions:t.navigation,onNext:()=>{e.storyReader.goNext()},onPrev:()=>{e.storyReader.goPrev()}})]},r.id)})})})});var gh=j(4267),fh={};fh.styleTagTransform=Rl(),fh.setAttributes=Tl(),fh.insert=El().bind(null,"head"),fh.domAPI=Pl(),fh.insertStyleElement=Ml();xl()(gh.Ay,fh);gh.Ay&&gh.Ay.locals&&gh.Ay.locals;const mh=({className:e,style:t})=>(0,ul.jsx)("div",{className:Ol()(Dc._7,e),style:t}),yh=350,vh="linear",bh=1.6,wh=2*Math.tan(45*Math.PI/360),Sh=yh/1e3;class _h{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e})}get perspective(){return 0}get depth(){return 0}get dirFactor(){return this.slider.dir===xt.RTL?-1:1}destroy(){}}const Oh=.05;class kh extends _h{constructor(){super(...arguments),Object.defineProperty(this,"shift",{enumerable:!0,configurable:!0,writable:!0,value:0})}init(){}transform(e){let t=this.slider.leftElement,r=this.slider.rightElement;const i=this.slider.frontElement;this.slider.isLtr||(t=this.slider.rightElement,r=this.slider.leftElement),null==t||t.style.setProperty("transform",`translate3d(${-100*(.1- -1*e/10)}%, 0, 0) scale(${Math.min(.9+-1*e/10,1)})`),null==r||r.style.setProperty("transform",`translate3d(${100*(1-e)}%, 0, 0)`),null==i||i.style.setProperty("transform",`translate3d(${e<=0?-100*e:-100*(0- -1*e/10)}%, 0, 0) scale(${e<=0?1:1+-1*e/10})`)}startMove(){this.shift=0}move(e){this.shift=this.dirFactor*e/this.slider.clientWidth,this.shift=this.applyBoundsConstraint(this.shift),this.transform(this.shift)}endMove(){if(!this.shift)return;const e=Math.round(this.shift);this.slider.emit("touchEnd",e)}getCSSStyle(e,t){return{visibility:Math.abs(e-t)<=1?"visible":"hidden",transition:"inherit",transform:`translate3d(${0===e?-10:-100*t+100*e}%, 0, 0) scale(${0===e?.9:1})`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=Oh&&this.slider.isEnd?Oh:e<=-.05&&this.slider.isBeginning?-.05:e:e}}const xh=.05;class Ch extends _h{constructor(){super(...arguments),Object.defineProperty(this,"shift",{enumerable:!0,configurable:!0,writable:!0,value:0})}init(){}transform(e){const t=this.slider.leftElement,r=this.slider.rightElement,i=this.slider.frontElement;e=this.dirFactor*e,null==t||t.style.setProperty("transform",`translate3d(${-100*(1+e)}%, 0, 0)`),null==r||r.style.setProperty("transform",`translate3d(${100*(1-e)}%, 0, 0)`),null==i||i.style.setProperty("transform",`translate3d(${-100*e}%, 0, 0)`)}startMove(){this.shift=0}move(e){this.shift=this.dirFactor*e/this.slider.clientWidth,this.shift=this.applyBoundsConstraint(this.shift),this.transform(this.shift)}endMove(){if(!this.shift)return;const e=Math.round(this.shift);this.slider.emit("touchEnd",e)}getCSSStyle(e,t){return{visibility:Math.abs(e-t)<=1?"visible":"hidden",transition:"inherit",transform:`translate3d(${this.dirFactor*(-100*t+100*e)}%, 0, 0)`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=xh&&this.slider.isEnd?xh:e<=-.05&&this.slider.isBeginning?-.05:e:e}}class Ph extends _h{constructor(){super(...arguments),Object.defineProperty(this,"newAngle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"angleDelta",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"normalizedShift",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"movementStartAt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentAngle",{enumerable:!0,configurable:!0,writable:!0,value:0})}get perspective(){return this.slider.clientWidth*bh}get depth(){return this.slider.clientWidth/wh}init(){this.transform(this.slider.currentIndex)}destroy(){this.slider.setTransform("")}async transform(e){this._currentAngle=this._currentAngle+45*e*this.dirFactor,this.slider.setTransform(`rotateY(${-this._currentAngle}deg)`)}startMove(){this.newAngle=0,this.angleDelta=0,this.normalizedShift=0,this.movementStartAt=Date.now()}move(e){this.normalizedShift=e/this.slider.clientWidth*bh,this.newAngle=this._currentAngle+45*this.normalizedShift,this.angleDelta=this.newAngle-this._currentAngle,this.newAngle=this.applyBoundsConstraint(this.angleDelta),this.slider.setTransform(`rotateY(${-this.newAngle}deg)`)}endMove(){if(!this.normalizedShift)return;let e=Math.round(this.dirFactor*this.angleDelta/45);e=this.limitByFastMovement(e),e=this.limitBySliderEdges(e),this.slider.emit("touchEnd",e)}limitByFastMovement(e){return this.isFastMovement(e)?this.normalizedShift*this.dirFactor<0?-1:1:e}isFastMovement(e){return Date.now()-this.movementStartAt<=500&&0===e}limitBySliderEdges(e){return e<0&&this.slider.isBeginning||e>0&&this.slider.isEnd?0:e}getCSSStyle(e,t){const r=this.dirFactor;return{visibility:Math.abs(e-t)<=1?"visible":"hidden",transition:"",transform:`rotateY(${45*e*r}deg) translateZ(${this.depth}px)`}}applyBoundsConstraint(e){if(!this.slider.isBeginning&&!this.slider.isEnd)return this.newAngle;const t=this.dirFactor;return e*t>=5&&this.slider.isEnd?this._currentAngle+5*t:e*t<=-5&&this.slider.isBeginning?this._currentAngle-5*t:this.newAngle}}class jh{static create(e,t){switch(t){case vt.FLAT:return new Ch(e);case vt.COVER:return new kh(e);case vt.CUBE:return new Ph(e);default:return new Ch(e)}}}var Eh=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ih=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Th=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Ah=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Mh=(()=>{var e,t,r,i;let a,o,n,l,c,d,h,u,p,g,m,y,v,b,w,S,_,O=s.EventEmitter,k=[],x=[],C=[],P=[],j=[],E=[],I=[];return e=class extends O{constructor(){super(...arguments),t.set(this,(Eh(this,k),Eh(this,x,!1))),r.set(this,(Eh(this,C),Eh(this,P,0))),i.set(this,(Eh(this,j),Eh(this,E,null))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:Eh(this,I)}),Object.defineProperty(this,"_dir",{enumerable:!0,configurable:!0,writable:!0,value:xt.LTR})}get _animating(){return Th(this,t,"f")}set _animating(e){Ah(this,t,e,"f")}get _currentIndex(){return Th(this,r,"f")}set _currentIndex(e){Ah(this,r,e,"f")}get effect(){return Th(this,i,"f")}set effect(e){Ah(this,i,e,"f")}get dir(){return this._dir}get isLtr(){return this._dir===xt.LTR}get clientWidth(){return this.$el.clientWidth}get animating(){return this._animating}get leftElement(){const e=this.dir===xt.RTL?1:-1;return this.$el.children.item(this._currentIndex+e)}get rightElement(){const e=this.dir===xt.RTL?-1:1;return this.$el.children.item(this._currentIndex+e)}get frontElement(){return this.$el.children.item(this._currentIndex)}get isBeginning(){return this._currentIndex-1==0}get isEnd(){return this._currentIndex+1===this.$el.children.length-1}get perspective(){var e,t;return null!==(t=null===(e=this.effect)||void 0===e?void 0:e.perspective)&&void 0!==t?t:0}get depth(){var e,t;return null!==(t=null===(e=this.effect)||void 0===e?void 0:e.depth)&&void 0!==t?t:0}get currentIndex(){return this._currentIndex}set currentIndex(e){this._currentIndex=e}getCSSStyle(e,t){var r,i;return null!==(i=null===(r=this.effect)||void 0===r?void 0:r.getCSSStyle(e,t))&&void 0!==i?i:{}}init({$el:e,transformStyle:t}){this.$el=e,this.effect&&this.effect.destroy(),this.effect=jh.create(this,t),this.effect.init(),this.setTransition("transform 0s"),this.updateSlidesStyle(0)}async transformWithAmimation(e){this.emit("transitionStart"),this._animating=!0,this.setTransition(`transform ${Sh}s ${vh}`),this.effect.transform(e),await this.waitTransitionEnd(),this.updateSlidesStyle(e),this._animating=!1,this.emit("transitionEnd")}startMove(){this.effect.startMove()}move(e){this._animating=!0,this.emit("touchMove"),this.effect.move(e)}endMove(){this._animating=!1,this.effect.endMove()}setTransform(e){this.$el.style.setProperty("transform",e)}setDir(e){this._dir=e}updateSlidesStyle(e){const t=Array.from(this.$el.children);for(let r=0;r<t.length;r++){const i=t[r],s=this.effect.getCSSStyle(r,this.currentIndex+e);i.style.visibility=s.visibility,i.style.transform=s.transform,i.style.transition=s.transition}}setTransition(e){this.$el.style.setProperty("transition",e)}waitTransitionEnd(){return new Promise(e=>{const t=r=>{Math.round(100*r.elapsedTime)/100===Sh&&"transform"===r.propertyName&&(this.setTransition("transform 0s"),this.$el.removeEventListener("transitionend",t),e())};this.$el.addEventListener("transitionend",t)})}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=O[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[f.observable],o=[f.observable],n=[f.observable],l=[f.computed],c=[f.computed],d=[f.computed],h=[f.computed],u=[f.computed],p=[f.computed],g=[f.computed],m=[f.computed],y=[f.computed],v=[f.action],b=[f.action],w=[f.action],S=[f.action],_=[f.action],Ih(e,null,a,{kind:"accessor",name:"_animating",static:!1,private:!1,access:{has:e=>"_animating"in e,get:e=>e._animating,set:(e,t)=>{e._animating=t}},metadata:r},x,C),Ih(e,null,o,{kind:"accessor",name:"_currentIndex",static:!1,private:!1,access:{has:e=>"_currentIndex"in e,get:e=>e._currentIndex,set:(e,t)=>{e._currentIndex=t}},metadata:r},P,j),Ih(e,null,n,{kind:"accessor",name:"effect",static:!1,private:!1,access:{has:e=>"effect"in e,get:e=>e.effect,set:(e,t)=>{e.effect=t}},metadata:r},E,I),Ih(e,null,l,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,k),Ih(e,null,c,{kind:"getter",name:"leftElement",static:!1,private:!1,access:{has:e=>"leftElement"in e,get:e=>e.leftElement},metadata:r},null,k),Ih(e,null,d,{kind:"getter",name:"rightElement",static:!1,private:!1,access:{has:e=>"rightElement"in e,get:e=>e.rightElement},metadata:r},null,k),Ih(e,null,h,{kind:"getter",name:"frontElement",static:!1,private:!1,access:{has:e=>"frontElement"in e,get:e=>e.frontElement},metadata:r},null,k),Ih(e,null,u,{kind:"getter",name:"isBeginning",static:!1,private:!1,access:{has:e=>"isBeginning"in e,get:e=>e.isBeginning},metadata:r},null,k),Ih(e,null,p,{kind:"getter",name:"isEnd",static:!1,private:!1,access:{has:e=>"isEnd"in e,get:e=>e.isEnd},metadata:r},null,k),Ih(e,null,g,{kind:"getter",name:"perspective",static:!1,private:!1,access:{has:e=>"perspective"in e,get:e=>e.perspective},metadata:r},null,k),Ih(e,null,m,{kind:"getter",name:"depth",static:!1,private:!1,access:{has:e=>"depth"in e,get:e=>e.depth},metadata:r},null,k),Ih(e,null,y,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,k),Ih(e,null,v,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:r},null,k),Ih(e,null,b,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,k),Ih(e,null,w,{kind:"method",name:"transformWithAmimation",static:!1,private:!1,access:{has:e=>"transformWithAmimation"in e,get:e=>e.transformWithAmimation},metadata:r},null,k),Ih(e,null,S,{kind:"method",name:"move",static:!1,private:!1,access:{has:e=>"move"in e,get:e=>e.move},metadata:r},null,k),Ih(e,null,_,{kind:"method",name:"endMove",static:!1,private:!1,access:{has:e=>"endMove"in e,get:e=>e.endMove},metadata:r},null,k),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Lh{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t})}get animating(){return this.slider.animating}async transitionByIndex(e,t){const r=e-t;return this.slider.transformWithAmimation(r)}}const Rh=e=>{const t=(0,pl.useRef)(null),[r]=(0,pl.useState)(()=>new Mh),{storyReaderOptions:i}=cp();(({slider:e,touchController:t})=>{const r=()=>{e.startMove()},i=({dx:t})=>{e.move(-t)},s=()=>{t.horizontalSwipeGesture&&e.endMove()};(0,pl.useEffect)(()=>(t.on(jt.TouchStart,r),t.on(jt.TouchMoveHorizontal,i),t.on(jt.TouchEnd,s),()=>{t.off(jt.TouchStart,r),t.off(jt.TouchMoveHorizontal,i),t.off(jt.TouchEnd,s)}),[e,t])})({slider:r,touchController:e.touchController});const s=i.scrollStyle;r.currentIndex=e.activeStoryIndex+1;const a=e.touchController;(0,pl.useLayoutEffect)(()=>{const i=()=>{r.setDir(e.dir),r.init({$el:t.current,transformStyle:s})};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[r,e.stories,s,e.dir]),(0,pl.useLayoutEffect)(()=>{e.setAnimatedNavigationController(new Lh(r,{closeOnLastSlideByTimer:Boolean(i.closeOnLastSlideByTimer)}))},[r,e,i.closeOnLastSlideByTimer]),(0,pl.useEffect)(()=>(r.on("transitionStart",n),r.on("transitionEnd",l),r.on("touchMove",o),r.on("touchEnd",c),()=>{r.off("transitionStart",n),r.off("transitionEnd",l),r.off("touchMove",o),r.off("touchEnd",c)}),[r,e]);const o=()=>{a.disable()},n=()=>{a.disable()},l=()=>{a.enable()},c=t=>{var i;if(null===(i=e.activeStory)||void 0===i||i.resumeSystem(a),0===t)r.transformWithAmimation(0);else{t=Math.sign(t)*Math.min(Math.abs(t),1),e.navigateStoryWithAnimationByIndex(e.activeStoryIndex+t)}};return{ref:t,api:r,perspective:r.perspective,depth:r.depth}};var Bh=j(3476),Dh={};Dh.styleTagTransform=Rl(),Dh.setAttributes=Tl(),Dh.insert=El().bind(null,"head"),Dh.domAPI=Pl(),Dh.insertStyleElement=Ml();xl()(Bh.Ay,Dh);Bh.Ay&&Bh.Ay.locals&&Bh.Ay.locals;var Nh=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Fh=e=>{var{width:t,disabledByUI:r,navigationOptions:i}=e,s=Nh(e,["width","disabledByUI","navigationOptions"]);const a=s.dir===xt.LTR,o=(a?s.reachEnd:s.reachStart)||r,n=(a?s.reachStart:s.reachEnd)||r;return(0,ul.jsxs)("div",{className:Ol()([Bh.uT],{[Bh.Lb]:Y}),children:[(0,ul.jsx)("div",{className:Bh.eS,style:{transform:`translateY(-50%) translateX(calc(${t/2}px + 100%))`},children:(0,ul.jsx)("button",{className:Bh.YE,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onNext()},disabled:o,dangerouslySetInnerHTML:{__html:i.nextButton.svgSrc.baseState}})}),(0,ul.jsx)("div",{className:Bh.SG,style:{transform:`translateY(-50%) translateX(calc(-${t/2}px - 200%))`},children:(0,ul.jsx)("button",{className:Bh.YE,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onPrev()},disabled:n,dangerouslySetInnerHTML:{__html:i.prevButton.svgSrc.baseState}})})]})},Uh=(0,bc.observer)(e=>{const{storyReaderOptions:t}=cp(),r=Rh(e.storyReader),i=e.storyReader.targetTransitionStory||e.storyReader.activeStory,s=e.storyReader.stories,a=e.isDesktopGeometry||e.safeAreaFrameCalculator.shouldBeShownSafeAreaInsets?parseFloat(String(t.borderRadius)):0,o=i.pauseState.isUIPaused||r.api.animating,n=t.layout===bt.Modern,l=(t,r=2)=>{const i=-1===e.storyReader.targetTransitionIndex?e.storyReader.activeStoryIndex:e.storyReader.targetTransitionIndex,s=Math.max(i-r,0),a=Math.min(i+r,e.storyReader.stories.length-1);return t>=s&&t<=a},c=t=>e.storyReader.activeStoryIndex===t;return(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)("div",{className:Ol()(gh.fo,{[gh.GQ]:e.storyReader.closeGestureInAction,[gh.yU]:e.isDesktopGeometry}),style:Object.assign({WebkitPerspective:`${r.perspective}px`,perspective:`${r.perspective}px`,width:e.storyGeometry.getWidth(),backgroundColor:!e.isDesktopGeometry&&e.safeAreaFrameCalculator.shouldBeShownSafeAreaInsets&&"#000","--slide-border-radius":`${a}px`},e.correctionPaddingStyle),children:(0,ul.jsx)("div",{className:gh.$X,style:{transform:`translateZ(-${r.depth}px)`},children:(0,ul.jsxs)("div",{className:Ol()(gh.N1),ref:r.ref,children:[(0,ul.jsx)("div",{className:Ol()(gh.uY),children:(0,ul.jsx)(mh,{})}),s.map((t,r)=>(0,ul.jsx)("div",{className:Ol()(gh.uY),children:(0,ul.jsx)(rh,{slideClickDisabled:o,index:r,story:t,activeStory:i,geometry:e.storyGeometry,onClose:e.onCloseStory,canBeInited:l(r),canBeStarted:c(r)})},t.id)),(0,ul.jsx)("div",{className:Ol()(gh.uY),children:(0,ul.jsx)(mh,{})})]})})}),!n&&(0,ul.jsx)(Fh,{dir:e.storyReader.dir,disabledByUI:i.pauseState.isUIPaused,disabled:o,reachEnd:e.storyReader.reachEnd,reachStart:e.storyReader.reachStart,navigationOptions:t.navigation,width:e.storyGeometry.calculateWidth(),onNext:()=>e.storyReader.goNext(),onPrev:()=>e.storyReader.goPrev()})]})}),Gh=(0,bc.observer)(({storyReader:e})=>{const{storyReaderOptions:t}=cp(),r=_c();(({touchController:e,activeStory:t})=>{(0,pl.useEffect)(()=>(e.on(jt.LongTouchDetected,r),e.on(jt.TouchEnd,i),()=>{e.off(jt.LongTouchDetected,r),e.off(jt.TouchEnd,i)}),[e,t]);const r=()=>{null==t||t.pauseSystem(e)},i=()=>{e.isSwiping||null==t||t.resumeSystem(e)}})({touchController:e.touchController,activeStory:e.activeStory});const{safeAreaFrameCalculator:i,storyGeometry:s,isDesktopGeometry:a,correctionPaddingStyle:o}=((e,t)=>{const{storyReaderOptions:r}=cp();return(0,pl.useMemo)(()=>{var r;const i=new Di(e.vw,e.vh),s=i.getViewportCorrectionPadding(),a=new Bi(e,{vw:e.vw,vh:e.vh-(Oc+kc)},null!==(r=null==t?void 0:t.actionPanel.height)&&void 0!==r?r:0,i).create(),o=a instanceof Li;return{safeAreaFrameCalculator:i,storyGeometry:a,isDesktopGeometry:o,correctionPaddingStyle:o?{}:{paddingTop:s.top+"px",paddingBottom:s.bottom+"px"}}},[r.actionPanelBottomOffset,e,t])})(r,e.activeStory),n=t.layout===bt.Modern;return(0,pl.useEffect)(()=>{e.useModernLayout=n},[e,n]),(0,wc.createPortal)((0,ul.jsxs)(Lc,{isDesktopGeometry:a,viewport:r,storyReader:e,children:[a&&n?(0,ul.jsx)(ph,{storyGeometry:s,storyReader:e,onCloseStory:()=>{e.close()}}):(0,ul.jsx)(Uh,{isDesktopGeometry:a,storyGeometry:s,safeAreaFrameCalculator:i,correctionPaddingStyle:o,storyReader:e,onCloseStory:()=>{e.close()}}),(0,ul.jsx)(Kl,{orientation:V.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.activeStory&&(t?e.activeStory.pauseUI(e):e.activeStory.resumeUI(e))}})]}),document.body)});var Vh=j(7161),zh=j(429),Wh=j(318);class $h{constructor(e){Object.defineProperty(this,"host",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.host.addController(this),this.calculateViewport=this.calculateViewport.bind(this)}get vw(){return this._vw}get vh(){return this._vh}hostConnected(){window.addEventListener("resize",this.calculateViewport)}hostDisconnected(){window.removeEventListener("resize",this.calculateViewport),this.host.removeController(this)}calculateViewport(){this._vw=window.innerWidth,this._vh=window.innerHeight,this.host.requestUpdate()}}var Hh=j(2083);const qh={[Pa.BottomSheet]:Hh.literal`iam-bottom-sheet`,[Pa.Fullscreen]:Hh.literal`iam-fullscreen-modal`,[Pa.Modal]:Hh.literal`iam-modal`,[Pa.Toast]:Hh.literal`iam-toast`},Jh=Vh.css`.bottom-sheet{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:999}.bottom-sheet__backdrop{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:-1;background-color:rgba(0,0,0,var(--backdrop-opacity,.5));opacity:0;transition:opacity 225ms cubic-bezier(.4,0,.2,1);pointer-events:none}.bottom-sheet__backdrop--visible{animation:fade-in .3s forwards}.bottom-sheet__backdrop--hidden{animation:fade-out .3s forwards}.bottom-sheet__box{position:absolute;left:0;right:0;bottom:0;will-change:transform;border-top-left-radius:var(--slide-border-top-left-radius,0);border-top-right-radius:var(--slide-border-top-right-radius,0);background-color:transparent;transition:opacity .3s ease,transform .3s ease;transform:translate3d(0,120%,0);pointer-events:all;overflow:hidden}.bottom-sheet__box-wrapper{position:absolute;inset:0;pointer-events:none}.bottom-sheet__box-wrapper.bottom-sheet__box-wrapper--desktop-mode{position:absolute;bottom:0;left:50%;transform:translate3d(-50%,0,0)}.bottom-sheet__box.bottom-sheet__box--open{opacity:1;transform:translate3d(0,0,0)}.bottom-sheet__backdrop.bottom-sheet__backdrop--open{opacity:1;pointer-events:all}.bottom-sheet__header .grab-handler-area{position:absolute;left:50%;transform:translate3d(-50%,0,0);padding:0 32px 16px;z-index:10000;cursor:grab;user-select:none}.bottom-sheet__header .grab-handler{margin-top:8px;width:32px;height:4px;background-color:#00000080;border-radius:var(--grab-handler-border-radius)}`;var Kh=j(5125);class Zh{constructor(e){Object.defineProperty(this,"host",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.host.addController(this),this.handleTouchMoveVertical=this.handleTouchMoveVertical.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}hostConnected(){}hostDisconnected(){var e,t,r;null===(e=this.touchController)||void 0===e||e.off(jt.TouchMoveVertical,this.handleTouchMoveVertical),null===(t=this.touchController)||void 0===t||t.off(jt.TouchEnd,this.handleTouchEnd),null===(r=this.touchController)||void 0===r||r.disable()}setTouchController(e){this.touchController=e,this.touchController.forceEnable(),this.touchController.on(jt.TouchMoveVertical,this.handleTouchMoveVertical),this.touchController.on(jt.TouchEnd,this.handleTouchEnd)}handleTouchMoveVertical({dy:e}){const t=this.getTranslateYByDeltaY(e);this.disableBoxTransition(),this.translateBoxOnY(t)}handleTouchEnd({dy:e}){if(!this.touchController.isSwiping)return;this.enableBoxTransition();this.getTranslateYByDeltaY(e)>20&&!this.host.disableClose?(this.touchController.disable(),this.translateBoxOnY(120),this.host.close()):this.resetToDefaultState()}resetToDefaultState(){this.host.bottomSheetBoxRef.style.transform=""}translateBoxOnY(e){this.host.bottomSheetBoxRef.style.transform=`translate3d(0, ${e}%, 0)`}disableBoxTransition(){this.host.bottomSheetBoxRef.style.transition="none"}enableBoxTransition(){this.host.bottomSheetBoxRef.style.transition="opacity 0.3s ease, transform 0.3s ease"}getTranslateYByDeltaY(e){let t=50*(e/this.host.bottomSheetBoxRef.clientHeight);return t<=0&&(t=0),t}}var Qh=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Yh=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Xh=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},eu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},tu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n,l,c,d,h;let u,p,g,f,m,y,v,w,S,_,O,k,x,C,P=[b("iam-bottom-sheet")],j=[],E=Vh.LitElement,I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[],V=[],z=[],W=[],$=[],H=[],q=[],J=[],K=[],Z=[],Q=[],X=[],ee=[];p=class extends E{get open(){return eu(this,e,"f")}set open(t){tu(this,e,t,"f")}get disableClose(){return eu(this,t,"f")}set disableClose(e){tu(this,t,e,"f")}get geometry(){return eu(this,r,"f")}set geometry(e){tu(this,r,e,"f")}get appearanceOptions(){return eu(this,i,"f")}set appearanceOptions(e){tu(this,i,e,"f")}get touchController(){return eu(this,s,"f")}set touchController(e){tu(this,s,e,"f")}get desktopMode(){return eu(this,a,"f")}set desktopMode(e){tu(this,a,e,"f")}get isVisible(){return eu(this,o,"f")}set isVisible(e){tu(this,o,e,"f")}get isClosed(){return eu(this,n,"f")}set isClosed(e){tu(this,n,e,"f")}get backdropRef(){return eu(this,l,"f")}set backdropRef(e){tu(this,l,e,"f")}get bottomSheetBoxRef(){return eu(this,c,"f")}set bottomSheetBoxRef(e){tu(this,c,e,"f")}get bottomSheetRef(){return eu(this,d,"f")}set bottomSheetRef(e){tu(this,d,e,"f")}get grabHandlerAreaRef(){return eu(this,h,"f")}set grabHandlerAreaRef(e){tu(this,h,e,"f")}constructor(){super(),e.set(this,Yh(this,I,!1)),t.set(this,(Yh(this,T),Yh(this,A,!1))),r.set(this,(Yh(this,M),Yh(this,L,void 0))),i.set(this,(Yh(this,R),Yh(this,B,void 0))),s.set(this,(Yh(this,D),Yh(this,N,void 0))),a.set(this,(Yh(this,F),Yh(this,U,void 0))),o.set(this,(Yh(this,G),Yh(this,V,!1))),n.set(this,(Yh(this,z),Yh(this,W,!0))),l.set(this,(Yh(this,$),Yh(this,H,null))),c.set(this,(Yh(this,q),Yh(this,J,null))),d.set(this,(Yh(this,K),Yh(this,Z,null))),h.set(this,(Yh(this,Q),Yh(this,X,null))),Object.defineProperty(this,"bottomSheetSwipeController",{enumerable:!0,configurable:!0,writable:!0,value:(Yh(this,ee),new Zh(this))}),this.handleTransitionEnd=this.handleTransitionEnd.bind(this)}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,(({frames:e=3,timeout:t=100,checkStyle:r=()=>!0}={})=>new Promise(i=>{let s,a=0,o=!1;const n=()=>{a++,!o&&r()&&(o=!0),a>=e&&o?(clearTimeout(s),i()):requestAnimationFrame(n)};s=setTimeout(()=>i(),t),requestAnimationFrame(n)}))().then(()=>{this.isVisible=!0})):this.isClosed||this.close()}connectedCallback(){super.connectedCallback(),setTimeout(()=>{const e=this.grabHandlerAreaRef,t=e&&!this.disableClose;Y&&t&&this.touchController.setGrabHandler(e),Y&&!t||this.bottomSheetSwipeController.setTouchController(this.touchController)})}disconnectedCallback(){super.disconnectedCallback(),this.touchController.resetGrabHandler()}close(){this.disableClose||(this.backdropRef.addEventListener("transitionend",this.handleTransitionEnd),this.isVisible=!1)}handleTransitionEnd(){this.backdropRef.removeEventListener("transitionend",this.handleTransitionEnd),setTimeout(()=>{this.isClosed=!0,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))},50)}render(){var e;if(this.isClosed)return Vh.nothing;const t={background:this.appearanceOptions.background,height:this.geometry.getHeight()+"px",width:this.geometry.getWidth()+"px","--slide-border-top-left-radius":`${this.appearanceOptions.borderRadius}px`,"--slide-border-top-right-radius":`${this.appearanceOptions.borderRadius}px`,"--grab-handler-border-radius":this.appearanceOptions.closeButton.width/2+"px"},r={width:this.geometry.getWidth()+"px"},i={backgroundColor:this.appearanceOptions.closeButton.backgroundColor,width:`${this.appearanceOptions.closeButton.width}px`,height:`${this.appearanceOptions.closeButton.height}px`,marginTop:`${this.appearanceOptions.closeButton.marginTop}px`},s={zIndex:null!==(e=this.appearanceOptions.zIndex)&&void 0!==e?e:999};return Vh.html`<div id="bottom-sheet" class="bottom-sheet" style="${(0,Wh.styleMap)(s)}"><div id="bottom-sheet__backdrop" style="${(0,Wh.styleMap)({"--backdrop-opacity":this.appearanceOptions.backdrop.opacity})}" @click="${this.close}" class="bottom-sheet__backdrop ${(0,Kh.classMap)({"bottom-sheet__backdrop--open":this.isVisible})}"></div><div class="bottom-sheet__box-wrapper ${(0,Kh.classMap)({"bottom-sheet__box-wrapper--desktop-mode":this.desktopMode})}" style="${(0,Wh.styleMap)(r)}"><div style="${(0,Wh.styleMap)(t)}" id="bottom-sheet__box" class="bottom-sheet__box ${(0,Kh.classMap)({"bottom-sheet__box--open":this.isVisible})}"><div class="bottom-sheet__header">${this.disableClose?Vh.nothing:Vh.html`<div id="grab-handler-area" class="grab-handler-area"><div class="grab-handler" style="${(0,Wh.styleMap)(i)}"></div></div>`}</div><slot></slot></div></div></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,Xh(p,"BottomSheet"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=E[Symbol.metadata])&&void 0!==e?e:null):void 0;g=[(0,zh.property)({type:Boolean})],f=[(0,zh.property)({type:Boolean})],m=[(0,zh.property)({type:Object})],y=[(0,zh.property)({type:Object})],v=[(0,zh.property)({type:Object})],w=[(0,zh.property)({type:Boolean})],S=[(0,zh.state)()],_=[(0,zh.state)()],O=[(0,zh.query)("#bottom-sheet__backdrop")],k=[(0,zh.query)("#bottom-sheet__box")],x=[(0,zh.query)("#bottom-sheet")],C=[(0,zh.query)("#grab-handler-area")],Qh(p,null,g,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},I,T),Qh(p,null,f,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},A,M),Qh(p,null,m,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},L,R),Qh(p,null,y,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},B,D),Qh(p,null,v,{kind:"accessor",name:"touchController",static:!1,private:!1,access:{has:e=>"touchController"in e,get:e=>e.touchController,set:(e,t)=>{e.touchController=t}},metadata:t},N,F),Qh(p,null,w,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},U,G),Qh(p,null,S,{kind:"accessor",name:"isVisible",static:!1,private:!1,access:{has:e=>"isVisible"in e,get:e=>e.isVisible,set:(e,t)=>{e.isVisible=t}},metadata:t},V,z),Qh(p,null,_,{kind:"accessor",name:"isClosed",static:!1,private:!1,access:{has:e=>"isClosed"in e,get:e=>e.isClosed,set:(e,t)=>{e.isClosed=t}},metadata:t},W,$),Qh(p,null,O,{kind:"accessor",name:"backdropRef",static:!1,private:!1,access:{has:e=>"backdropRef"in e,get:e=>e.backdropRef,set:(e,t)=>{e.backdropRef=t}},metadata:t},H,q),Qh(p,null,k,{kind:"accessor",name:"bottomSheetBoxRef",static:!1,private:!1,access:{has:e=>"bottomSheetBoxRef"in e,get:e=>e.bottomSheetBoxRef,set:(e,t)=>{e.bottomSheetBoxRef=t}},metadata:t},J,K),Qh(p,null,x,{kind:"accessor",name:"bottomSheetRef",static:!1,private:!1,access:{has:e=>"bottomSheetRef"in e,get:e=>e.bottomSheetRef,set:(e,t)=>{e.bottomSheetRef=t}},metadata:t},Z,Q),Qh(p,null,C,{kind:"accessor",name:"grabHandlerAreaRef",static:!1,private:!1,access:{has:e=>"grabHandlerAreaRef"in e,get:e=>e.grabHandlerAreaRef,set:(e,t)=>{e.grabHandlerAreaRef=t}},metadata:t},X,ee),Qh(null,u={value:p},P,{kind:"class",name:p.name,metadata:t},null,j),p=u.value,t&&Object.defineProperty(p,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(p,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Jh}),Yh(p,j)})();const ru=Vh.css`.modal{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:1000}.modal__backdrop{background-color:rgba(0,0,0,var(--backdrop-opacity,.3));position:fixed;z-index:-1;inset:0;left:0;bottom:0;right:0;pointer-events:none}.modal__backdrop.modal__backdrop--open{pointer-events:all}.modal__box{display:flex;align-items:center;justify-content:center;position:relative;outline:0;height:100%}.modal__box-content{position:relative;border-top-left-radius:var(--slide-border-top-left-radius,0);border-top-right-radius:var(--slide-border-top-right-radius,0);border-bottom-left-radius:var(--slide-border-bottom-left-radius,0);border-bottom-right-radius:var(--slide-border-bottom-right-radius,0);overflow:hidden}.modal__box-content.modal__box-content--fullscreen{position:relative;align-self:flex-end}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes fadeInWithZoom{from{opacity:0;transform:scale(.7)}to{transform:scale(1);opacity:1}}@keyframes fadeOutWithZoom{from{opacity:1;transform:scale(1)}to{transform:scale(.7);opacity:0}}@keyframes slideInUp{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInOut{from{transform:translateY(0)}to{transform:translateY(100%)}}.fadeIn{animation:fadeIn 255ms forwards}.fadeOut{animation:fadeOut 255ms forwards}.fadeInWithZoom{animation:fadeInWithZoom .3s forwards}.fadeOutWithZoom{animation:fadeOutWithZoom .3s forwards}.slideInUp{animation:slideInUp .3s forwards}.slideInOut{animation:slideInOut .3s forwards}`;var iu=j(6968);const su=Vh.css`.close-btn{position:absolute;top:1rem;z-index:10000;padding:0;background-color:transparent;border:0;-webkit-appearance:none;cursor:pointer}.close-btn.close-btn--position_start{left:1rem}.close-btn.close-btn--position_end{right:1rem}.close-btn.close-btn--position_start.close-btn--dir_rtl{left:auto;right:1rem}.close-btn.close-btn--position_end.close-btn--dir_rtl{left:1rem;right:auto}.close-btn.close-btn--position_none{display:none}`;var au=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ou=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},nu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},lu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},cu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t;let r,i,s,a,o=[b("iam-modal-close-btn")],n=[],l=Vh.LitElement,c=[],d=[],h=[],u=[];i=class extends l{get closeBtnPosition(){return lu(this,e,"f")}set closeBtnPosition(t){cu(this,e,t,"f")}get dir(){return lu(this,t,"f")}set dir(e){cu(this,t,e,"f")}render(){var e;return Vh.html`<button class="close-btn ${(0,Kh.classMap)({"close-btn--position_start":this.closeBtnPosition===pa.Start,"close-btn--position_end":this.closeBtnPosition===pa.End,"close-btn--position_none":this.closeBtnPosition===pa.None,"close-btn--dir_ltr":this.dir===xt.LTR,"close-btn--dir_rtl":this.dir===xt.RTL})}">${(0,iu.unsafeHTML)(null===(e=ct.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>`}constructor(){super(...arguments),e.set(this,ou(this,c,void 0)),t.set(this,(ou(this,d),ou(this,h,void 0))),ou(this,u)}};e=new WeakMap,t=new WeakMap,nu(i,"Modal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=l[Symbol.metadata])&&void 0!==e?e:null):void 0;s=[(0,zh.property)({type:Number})],a=[(0,zh.property)({type:String})],au(i,null,s,{kind:"accessor",name:"closeBtnPosition",static:!1,private:!1,access:{has:e=>"closeBtnPosition"in e,get:e=>e.closeBtnPosition,set:(e,t)=>{e.closeBtnPosition=t}},metadata:t},c,d),au(i,null,a,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},h,u),au(null,r={value:i},o,{kind:"class",name:i.name,metadata:t},null,n),i=r.value,t&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(i,"styles",{enumerable:!0,configurable:!0,writable:!0,value:su}),ou(i,n)})();var du=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},hu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},uu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},pu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},gu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n,l;let c,d,h,u,p,g,f,m,y,v,w,S=[b("iam-modal")],_=[],O=Vh.LitElement,k=[],x=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[];d=class extends O{get open(){return pu(this,e,"f")}set open(t){gu(this,e,t,"f")}get disableClose(){return pu(this,t,"f")}set disableClose(e){gu(this,t,e,"f")}get fullscreen(){return pu(this,r,"f")}set fullscreen(e){gu(this,r,e,"f")}get geometry(){return pu(this,i,"f")}set geometry(e){gu(this,i,e,"f")}get appearanceOptions(){return pu(this,s,"f")}set appearanceOptions(e){gu(this,s,e,"f")}get dir(){return pu(this,a,"f")}set dir(e){gu(this,a,e,"f")}get isVisible(){return pu(this,o,"f")}set isVisible(e){gu(this,o,e,"f")}get isClosed(){return pu(this,n,"f")}set isClosed(e){gu(this,n,e,"f")}get backdropRef(){return pu(this,l,"f")}set backdropRef(e){gu(this,l,e,"f")}constructor(){super(),e.set(this,hu(this,k,!1)),t.set(this,(hu(this,x),hu(this,C,!1))),r.set(this,(hu(this,P),hu(this,j,!1))),i.set(this,(hu(this,E),hu(this,I,void 0))),s.set(this,(hu(this,T),hu(this,A,void 0))),a.set(this,(hu(this,M),hu(this,L,void 0))),o.set(this,(hu(this,R),hu(this,B,!1))),n.set(this,(hu(this,D),hu(this,N,!0))),l.set(this,(hu(this,F),hu(this,U,null))),hu(this,G)}close(){if(this.disableClose)return;const e=this.appearanceOptions.animationType===ua.None?0:350;setTimeout(()=>{this.isClosed=!0,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))},e),this.isVisible=!1}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,this.isVisible=!0):this.isClosed||this.close()}getEnterModalAnimationCSSClass(e){switch(e){case ua.SlideInUp:return"slideInUp";case ua.FadeIn:return"fadeInWithZoom";default:return""}}getOutModalAnimationCSSClass(e){switch(e){case ua.SlideInUp:return"slideInOut";case ua.FadeIn:return"fadeOutWithZoom";default:return""}}getBackdropAnimationCSSClass(e){return e?"fadeIn":"fadeOut"}render(){var e;const t=this.fullscreen?0:this.appearanceOptions.borderRadius,r={background:this.appearanceOptions.background,height:this.geometry.getHeight()+"px",width:this.geometry.getWidth()+"px","--slide-border-top-left-radius":`${t}px`,"--slide-border-top-right-radius":`${t}px`,"--slide-border-bottom-left-radius":`${t}px`,"--slide-border-bottom-right-radius":`${t}px`},i=this.appearanceOptions.animationType,s=this.isVisible?this.getEnterModalAnimationCSSClass(i):this.getOutModalAnimationCSSClass(i),a=this.getBackdropAnimationCSSClass(this.isVisible),o={zIndex:null!==(e=this.appearanceOptions.zIndex)&&void 0!==e?e:1e3};return Vh.html`<div class="modal" style="${(0,Wh.styleMap)(o)}"><div id="modal__backdrop" style="${(0,Wh.styleMap)({"--backdrop-opacity":this.appearanceOptions instanceof va?this.appearanceOptions.backdrop.opacity:void 0})}" class="modal__backdrop ${(0,Kh.classMap)({[a]:i!==ua.None})}"></div><div @click="${this.close}" class="modal__box ${(0,Kh.classMap)({[s]:!0})}">${this.fullscreen?Vh.html`<div class="modal__header"><iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn></div>`:Vh.nothing}<div style="${(0,Wh.styleMap)(r)}" class="modal__box-content ${(0,Kh.classMap)({"modal__box-content--fullscreen":this.fullscreen})}">${this.fullscreen?Vh.nothing:Vh.html`<div class="modal__header">${this.disableClose?Vh.nothing:Vh.html`<iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn>`}</div>`}<slot></slot></div></div></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,uu(d,"Modal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=O[Symbol.metadata])&&void 0!==e?e:null):void 0;h=[(0,zh.property)({type:Boolean})],u=[(0,zh.property)({type:Boolean})],p=[(0,zh.property)({type:Boolean})],g=[(0,zh.property)({type:Object})],f=[(0,zh.property)({type:Object})],m=[(0,zh.property)({type:String})],y=[(0,zh.state)()],v=[(0,zh.state)()],w=[(0,zh.query)("#modal__backdrop")],du(d,null,h,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},k,x),du(d,null,u,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},C,P),du(d,null,p,{kind:"accessor",name:"fullscreen",static:!1,private:!1,access:{has:e=>"fullscreen"in e,get:e=>e.fullscreen,set:(e,t)=>{e.fullscreen=t}},metadata:t},j,E),du(d,null,g,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},I,T),du(d,null,f,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},A,M),du(d,null,m,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},L,R),du(d,null,y,{kind:"accessor",name:"isVisible",static:!1,private:!1,access:{has:e=>"isVisible"in e,get:e=>e.isVisible,set:(e,t)=>{e.isVisible=t}},metadata:t},B,D),du(d,null,v,{kind:"accessor",name:"isClosed",static:!1,private:!1,access:{has:e=>"isClosed"in e,get:e=>e.isClosed,set:(e,t)=>{e.isClosed=t}},metadata:t},N,F),du(d,null,w,{kind:"accessor",name:"backdropRef",static:!1,private:!1,access:{has:e=>"backdropRef"in e,get:e=>e.backdropRef,set:(e,t)=>{e.backdropRef=t}},metadata:t},U,G),du(null,c={value:d},S,{kind:"class",name:d.name,metadata:t},null,_),d=c.value,t&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(d,"styles",{enumerable:!0,configurable:!0,writable:!0,value:ru}),hu(d,_)})();var fu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},mu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},yu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},vu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},bu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r;let i,s,a,o,n,l=[b("iam-fullscreen-modal")],c=[],d=Vh.LitElement,h=[],u=[],p=[],g=[],f=[],m=[];s=class extends d{get open(){return vu(this,e,"f")}set open(t){bu(this,e,t,"f")}get geometry(){return vu(this,t,"f")}set geometry(e){bu(this,t,e,"f")}get appearanceOptions(){return vu(this,r,"f")}set appearanceOptions(e){bu(this,r,e,"f")}render(){return Vh.html`<iam-modal ?open="${this.open}" .fullscreen="${!0}" .geometry="${this.geometry}" .appearanceOptions="${this.appearanceOptions}"><slot></slot></iam-modal>`}constructor(){super(...arguments),e.set(this,mu(this,h,!1)),t.set(this,(mu(this,u),mu(this,p,void 0))),r.set(this,(mu(this,g),mu(this,f,void 0))),mu(this,m)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,yu(s,"FullscreenModal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=d[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[(0,zh.property)({type:Boolean})],o=[(0,zh.property)({type:Object})],n=[(0,zh.property)({type:Object})],fu(s,null,a,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},h,u),fu(s,null,o,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},p,g),fu(s,null,n,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},f,m),fu(null,i={value:s},l,{kind:"class",name:s.name,metadata:t},null,c),s=i.value,t&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t}),mu(s,c)})()})();const wu=Vh.css`.toast{position:fixed;z-index:10000;pointer-events:all;opacity:0}.toast.toast--open{opacity:1}.toast.toast--dir-rtl{direction:rtl}.toast.toast--dir-ltr{direction:ltr}.toast--vertical-top{top:var(--toast-vertical-offset);bottom:auto}.toast--vertical-bottom{bottom:var(--toast-vertical-offset);top:auto}.toast.toast--widescreen.toast--horizontal-start{left:var(--toast-horizontal-offset);right:auto;width:var(--toast-width)}.toast.toast--widescreen.toast--horizontal-center{left:50%;width:var(--toast-width);transform:translate3d(-50%,0,0)}.toast.toast--widescreen.toast--horizontal-end{right:var(--toast-horizontal-offset);left:auto;width:var(--toast-width)}.toast:not(.toast--widescreen){left:var(--toast-horizontal-offset);right:var(--toast-horizontal-offset)}.toast__box{position:relative;width:var(--toast-width,320px);height:var(--toast-height,50px);background:var(--toast-background,#fff);border-radius:var(--toast-border-radius,16px);overflow:hidden;display:flex;align-items:center;justify-content:center}.toast__content{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.toast--animation-slide-in-from-bottom{animation:toastSlideInFromBottom .3s forwards}.toast--animation-slide-in-from-top{animation:toastSlideInFromTop .3s forwards}.toast--animation-slide-out-to-bottom{animation:toastSlideOutToBottom .3s forwards}.toast--animation-slide-out-to-top{animation:toastSlideOutToTop .3s forwards}.toast--animation-fade-in-zoom{animation:toastFadeInZoom .3s forwards}.toast--animation-fade-out-zoom{animation:toastFadeOutZoom .3s forwards}.toast--animation-slide-in-from-bottom.toast--horizontal-center{animation:toastSlideInFromBottomCenter .3s forwards}.toast--animation-slide-in-from-top.toast--horizontal-center{animation:toastSlideInFromTopCenter .3s forwards}.toast--animation-slide-out-to-bottom.toast--horizontal-center{animation:toastSlideOutToBottomCenter .3s forwards}.toast--animation-slide-out-to-top.toast--horizontal-center{animation:toastSlideOutToTopCenter .3s forwards}.toast--animation-fade-in-zoom.toast--horizontal-center{animation:toastFadeInZoomCenter .3s forwards}.toast--animation-fade-out-zoom.toast--horizontal-center{animation:toastFadeOutZoomCenter .3s forwards}@keyframes toastSlideInFromBottom{from{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:translate3d(0,0,0)}}@keyframes toastSlideOutToBottom{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(0,100%,0)}}@keyframes toastSlideInFromTop{from{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:translate3d(0,0,0)}}@keyframes toastSlideOutToTop{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(0,-100%,0)}}@keyframes toastFadeInZoom{from{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}@keyframes toastFadeOutZoom{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.7)}}@keyframes toastSlideInFromBottomCenter{from{opacity:0;transform:translate3d(-50%,100%,0)}to{opacity:1;transform:translate3d(-50%,0,0)}}@keyframes toastSlideOutToBottomCenter{from{opacity:1;transform:translate3d(-50%,0,0)}to{opacity:0;transform:translate3d(-50%,100%,0)}}@keyframes toastSlideInFromTopCenter{from{opacity:0;transform:translate3d(-50%,-100%,0)}to{opacity:1;transform:translate3d(-50%,0,0)}}@keyframes toastSlideOutToTopCenter{from{opacity:1;transform:translate3d(-50%,0,0)}to{opacity:0;transform:translate3d(-50%,-100%,0)}}@keyframes toastFadeInZoomCenter{from{opacity:0;transform:translate3d(-50%,0,0) scale(.7)}to{opacity:1;transform:translate3d(-50%,0,0) scale(1)}}@keyframes toastFadeOutZoomCenter{from{opacity:1;transform:translate3d(-50%,0,0) scale(1)}to{opacity:0;transform:translate3d(-50%,0,0) scale(.7)}}`,Su=Vh.css`.close-btn{position:absolute;top:.2rem;z-index:10000;padding:0;background-color:transparent;border:0;-webkit-appearance:none;cursor:pointer}.close-btn.close-btn--position_start{left:.2rem}.close-btn.close-btn--position_end{right:.2rem}.close-btn.close-btn--position_start.close-btn--dir_rtl{left:auto;right:.2rem}.close-btn.close-btn--position_end.close-btn--dir_rtl{left:.2rem;right:auto}.close-btn.close-btn--position_none{display:none}`;var _u=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ou=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ku=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},xu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Cu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t;let r,i,s,a,o=[b("iam-toast-close-btn")],n=[],l=Vh.LitElement,c=[],d=[],h=[],u=[];i=class extends l{get closeBtnPosition(){return xu(this,e,"f")}set closeBtnPosition(t){Cu(this,e,t,"f")}get dir(){return xu(this,t,"f")}set dir(e){Cu(this,t,e,"f")}render(){var e;return Vh.html`<button class="close-btn ${(0,Kh.classMap)({"close-btn--position_start":this.closeBtnPosition===ya.Start,"close-btn--position_end":this.closeBtnPosition===ya.End,"close-btn--position_none":this.closeBtnPosition===ya.None,"close-btn--dir_ltr":this.dir===xt.LTR,"close-btn--dir_rtl":this.dir===xt.RTL})}">${(0,iu.unsafeHTML)(null===(e=ct.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>`}constructor(){super(...arguments),e.set(this,Ou(this,c,void 0)),t.set(this,(Ou(this,d),Ou(this,h,void 0))),Ou(this,u)}};e=new WeakMap,t=new WeakMap,ku(i,"ToastCloseButton"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=l[Symbol.metadata])&&void 0!==e?e:null):void 0;s=[(0,zh.property)({type:Number})],a=[(0,zh.property)({type:String})],_u(i,null,s,{kind:"accessor",name:"closeBtnPosition",static:!1,private:!1,access:{has:e=>"closeBtnPosition"in e,get:e=>e.closeBtnPosition,set:(e,t)=>{e.closeBtnPosition=t}},metadata:t},c,d),_u(i,null,a,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},h,u),_u(null,r={value:i},o,{kind:"class",name:i.name,metadata:t},null,n),i=r.value,t&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(i,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Su}),Ou(i,n)})();var Pu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ju=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Eu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Iu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Tu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n,l;let c,d,h,u,p,g,f,m,y,v,w,S=[b("iam-toast")],_=[],O=Vh.LitElement,k=[],x=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[];d=class extends O{get open(){return Iu(this,e,"f")}set open(t){Tu(this,e,t,"f")}get disableClose(){return Iu(this,t,"f")}set disableClose(e){Tu(this,t,e,"f")}get geometry(){return Iu(this,r,"f")}set geometry(e){Tu(this,r,e,"f")}get appearanceOptions(){return Iu(this,i,"f")}set appearanceOptions(e){Tu(this,i,e,"f")}get desktopMode(){return Iu(this,s,"f")}set desktopMode(e){Tu(this,s,e,"f")}get dir(){return Iu(this,a,"f")}set dir(e){Tu(this,a,e,"f")}get isVisible(){return Iu(this,o,"f")}set isVisible(e){Tu(this,o,e,"f")}get isClosed(){return Iu(this,n,"f")}set isClosed(e){Tu(this,n,e,"f")}get toastRef(){return Iu(this,l,"f")}set toastRef(e){Tu(this,l,e,"f")}constructor(){super(),e.set(this,ju(this,k,!1)),t.set(this,(ju(this,x),ju(this,C,!1))),r.set(this,(ju(this,P),ju(this,j,void 0))),i.set(this,(ju(this,E),ju(this,I,void 0))),s.set(this,(ju(this,T),ju(this,A,void 0))),a.set(this,(ju(this,M),ju(this,L,void 0))),o.set(this,(ju(this,R),ju(this,B,!1))),n.set(this,(ju(this,D),ju(this,N,!0))),l.set(this,(ju(this,F),ju(this,U,null))),ju(this,G)}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,this.isVisible=!0):this.isClosed||this.close()}close(){if(this.disableClose)return;const e=this.appearanceOptions.animationType===ga.None?0:300;this.isVisible=!1,setTimeout(()=>{this.isClosed=!0,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))},e)}shouldShowCloseButton(){return!this.disableClose&&this.appearanceOptions.closeBtnPosition!==ya.None}getAnimationClass(){if(!this.isVisible)switch(this.appearanceOptions.animationType){case ga.TransitionFromNearestVerticalEdge:return this.getSlideOutAnimationClass();case ga.AlphaAndZoom:return"toast--animation-fade-out-zoom";default:return""}switch(this.appearanceOptions.animationType){case ga.TransitionFromNearestVerticalEdge:return this.getSlideInAnimationClass();case ga.AlphaAndZoom:return"toast--animation-fade-in-zoom";default:return""}}getSlideInAnimationClass(){return this.appearanceOptions.verticalPosition===fa.Top?"toast--animation-slide-in-from-top":"toast--animation-slide-in-from-bottom"}getSlideOutAnimationClass(){return this.appearanceOptions.verticalPosition===fa.Top?"toast--animation-slide-out-to-top":"toast--animation-slide-out-to-bottom"}getVerticalPositionVars(){return{"--toast-vertical-offset":`${this.appearanceOptions.verticalOffset}px`}}getEffectiveHorizontalPosition(){const e=this.dir===xt.RTL,t=this.appearanceOptions.horizontalPosition;return e?t===ma.Start?ma.End:t===ma.End?ma.Start:t:t}getWidescreenHorizontalVars(){return{"--toast-width":`${this.geometry.getWidth()}px`,"--toast-horizontal-offset":`${this.appearanceOptions.horizontalOffset}px`}}getMobileHorizontalVars(){return{"--toast-horizontal-offset":`${this.appearanceOptions.horizontalOffset}px`}}getPositionVars(){const e=this.getVerticalPositionVars(),t=this.desktopMode?this.getWidescreenHorizontalVars():this.getMobileHorizontalVars();return Object.assign(Object.assign({},e),t)}render(){if(this.isClosed)return Vh.nothing;const e=this.getPositionVars(),t=this.getAnimationClass(),r=this.getEffectiveHorizontalPosition(),i=Object.assign({"--toast-width":`${this.geometry.getWidth()}px`,"--toast-height":`${this.geometry.getHeight()}px`,"--toast-background":this.appearanceOptions.background,"--toast-border-radius":`${this.appearanceOptions.borderRadius}px`},e);return Vh.html`<div id="toast" class="toast ${(0,Kh.classMap)({"toast--open":this.isVisible,"toast--widescreen":this.desktopMode,"toast--dir-ltr":this.dir===xt.LTR,"toast--dir-rtl":this.dir===xt.RTL,"toast--vertical-top":this.appearanceOptions.verticalPosition===fa.Top,"toast--vertical-bottom":this.appearanceOptions.verticalPosition!==fa.Top,"toast--horizontal-start":this.desktopMode&&r===ma.Start,"toast--horizontal-center":this.desktopMode&&r===ma.Center,"toast--horizontal-end":this.desktopMode&&r===ma.End,[t]:!0})}" style="${(0,Wh.styleMap)(i)}"><div class="toast__box">${this.shouldShowCloseButton()?Vh.html`<iam-toast-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-toast-close-btn>`:Vh.nothing}<div class="toast__content"><slot></slot></div></div></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,Eu(d,"Toast"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=O[Symbol.metadata])&&void 0!==e?e:null):void 0;h=[(0,zh.property)({type:Boolean})],u=[(0,zh.property)({type:Boolean})],p=[(0,zh.property)({type:Object})],g=[(0,zh.property)({type:Object})],f=[(0,zh.property)({type:Boolean})],m=[(0,zh.property)({type:String})],y=[(0,zh.state)()],v=[(0,zh.state)()],w=[(0,zh.query)("#toast")],Pu(d,null,h,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},k,x),Pu(d,null,u,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},C,P),Pu(d,null,p,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},j,E),Pu(d,null,g,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},I,T),Pu(d,null,f,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},A,M),Pu(d,null,m,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},L,R),Pu(d,null,y,{kind:"accessor",name:"isVisible",static:!1,private:!1,access:{has:e=>"isVisible"in e,get:e=>e.isVisible,set:(e,t)=>{e.isVisible=t}},metadata:t},B,D),Pu(d,null,v,{kind:"accessor",name:"isClosed",static:!1,private:!1,access:{has:e=>"isClosed"in e,get:e=>e.isClosed,set:(e,t)=>{e.isClosed=t}},metadata:t},N,F),Pu(d,null,w,{kind:"accessor",name:"toastRef",static:!1,private:!1,access:{has:e=>"toastRef"in e,get:e=>e.toastRef,set:(e,t)=>{e.toastRef=t}},metadata:t},U,G),Pu(null,c={value:d},S,{kind:"class",name:d.name,metadata:t},null,_),d=c.value,t&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(d,"styles",{enumerable:!0,configurable:!0,writable:!0,value:wu}),ju(d,_)})();var Au=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Mu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Lu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Ru=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Bu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n;let l,c,d,h,u,p,g,f,m,y,v=[b("message-view-factory")],w=[],S=Vh.LitElement,_=[],O=[],k=[],x=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[];c=class extends S{get appearanceOptions(){return Ru(this,e,"f")}set appearanceOptions(t){Bu(this,e,t,"f")}get type(){return Ru(this,t,"f")}set type(e){Bu(this,t,e,"f")}get open(){return Ru(this,r,"f")}set open(e){Bu(this,r,e,"f")}get disableClose(){return Ru(this,i,"f")}set disableClose(e){Bu(this,i,e,"f")}get geometry(){return Ru(this,s,"f")}set geometry(e){Bu(this,s,e,"f")}get touchController(){return Ru(this,a,"f")}set touchController(e){Bu(this,a,e,"f")}get desktopMode(){return Ru(this,o,"f")}set desktopMode(e){Bu(this,o,e,"f")}get dir(){return Ru(this,n,"f")}set dir(e){Bu(this,n,e,"f")}render(){const e=qh[this.type];return e?Hh.html`
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lodash-es"),require("uuid"),require("mobx"),require("bowser"),require("deepmerge"),require("@inappstory/slide-api"),require("async-mutex"),require("react/jsx-runtime"),require("react"),require("css-font-parser"),require("parse-css-sides"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("lit"),require("lit/decorators.js"),require("lit/directives/style-map.js"),require("lit/static-html.js"),require("lit/directives/class-map.js"),require("lit/directives/unsafe-html.js"));else if("function"==typeof define&&define.amd)define(["lodash-es","uuid","mobx","bowser","deepmerge","@inappstory/slide-api","async-mutex","react/jsx-runtime","react","css-font-parser","parse-css-sides","classnames","mobx-react-lite","react-dom","lit","lit/decorators.js","lit/directives/style-map.js","lit/static-html.js","lit/directives/class-map.js","lit/directives/unsafe-html.js"],t);else{var r="object"==typeof exports?t(require("lodash-es"),require("uuid"),require("mobx"),require("bowser"),require("deepmerge"),require("@inappstory/slide-api"),require("async-mutex"),require("react/jsx-runtime"),require("react"),require("css-font-parser"),require("parse-css-sides"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("lit"),require("lit/decorators.js"),require("lit/directives/style-map.js"),require("lit/static-html.js"),require("lit/directives/class-map.js"),require("lit/directives/unsafe-html.js")):t(e["lodash-es"],e.uuid,e.mobx,e.bowser,e.deepmerge,e["@inappstory/slide-api"],e["async-mutex"],e["react/jsx-runtime"],e.react,e["css-font-parser"],e["parse-css-sides"],e.classnames,e["mobx-react-lite"],e["react-dom"],e.lit,e["lit/decorators.js"],e["lit/directives/style-map.js"],e["lit/static-html.js"],e["lit/directives/class-map.js"],e["lit/directives/unsafe-html.js"]);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(self,(e,t,r,i,s,a,o,n,l,c,d,h,u,p,g,f,m,y,v,b)=>(()=>{"use strict";var w={6644(e,t,r){r.d(t,{Ay:()=>d,B2:()=>l,Iu:()=>c,jW:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".aspect-ratio-box--eXqK8{overflow:hidden;position:relative}.aspect-ratio-box--eXqK8.aspect-ratio-box--centered--DTJHL{width:auto;height:100%;left:50%;transform:translateX(-50%)}.aspect-ratio-box-inside--oX1Yl{position:absolute;top:0;left:0;width:100%;height:100%}",""]);var n="aspect-ratio-box--eXqK8",l="aspect-ratio-box--centered--DTJHL",c="aspect-ratio-box-inside--oX1Yl";const d=o},8034(e,t,r){r.d(t,{A:()=>l,G:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".close-btn--NQCck{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:20px;z-index:1140;pointer-events:all;cursor:pointer;outline:none;color:#c2c2c4}.close-btn--NQCck:focus{outline:none}.close-btn--NQCck{width:40px;height:40px;display:flex;justify-content:center;align-items:center}.close-btn--NQCck svg{overflow:visible;width:40px;height:40px}.close-btn--NQCck[data-position=start],.close-btn--NQCck[data-position=left]{left:10px}.close-btn--NQCck[data-position=start][dir=rtl],.close-btn--NQCck[data-position=left][dir=rtl]{left:auto;right:10px}.close-btn--NQCck[data-position=end],.close-btn--NQCck[data-position=right]{right:10px}.close-btn--NQCck[data-position=end][dir=rtl],.close-btn--NQCck[data-position=right][dir=rtl]{left:10px;right:auto}",""]);var n="close-btn--NQCck";const l=o},9678(e,t,r){r.d(t,{Ay:()=>p,Hi:()=>h,IY:()=>d,O2:()=>n,Vv:()=>l,gt:()=>u,np:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'@keyframes spin--iLxiu{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.splash-container--_EF2B{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;z-index:-1}.splash-container--_EF2B .splash-container__image--nU3Il{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.splash-container--_EF2B .splash-container__image--nU3Il img{width:100%;height:100%;object-fit:cover}.splash-container--_EF2B .splash-container__lottie--vpoIB{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1}.splash-container--_EF2B .splash-container__lottie--vpoIB canvas{width:100%;height:100%}.splash-container--_EF2B.splash-container--isLoading--pvfb0:after{display:inline-block;position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);content:"";width:2rem;height:2rem;border:solid 2px var(--GRLoaderBackgroundColor, white);border-color:var(--GRLoaderBackgroundAccentColor, transparent) var(--GRLoaderBackgroundColor, white) var(--GRLoaderBackgroundColor, white) var(--GRLoaderBackgroundColor, white);border-radius:50%;animation:spin--iLxiu .6s infinite linear;z-index:10}.splash-container--_EF2B.splash-container--fadeIn--MV9sw{opacity:1;transition:opacity ease-in .2s}.splash-container--_EF2B.splash-container--fadeOut--RPYXS{opacity:0;transition:opacity ease-out .3s}',""]);var n="splash-container--_EF2B",l="splash-container__image--nU3Il",c="splash-container__lottie--vpoIB",d="splash-container--isLoading--pvfb0",h="splash-container--fadeIn--MV9sw",u="splash-container--fadeOut--RPYXS";const p=o},4978(e,t,r){r.d(t,{Ay:()=>f,F2:()=>d,JF:()=>u,Pe:()=>n,QP:()=>h,X7:()=>l,be:()=>p,fN:()=>g,vK:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,':root{--ias-sat: env(safe-area-inset-top);--ias-sar: env(safe-area-inset-right);--ias-sab: env(safe-area-inset-bottom);--ias-sal: env(safe-area-inset-left)}.game-reader-container--AH81u{background-color:rgba(0,0,0,0);position:fixed;left:0px;top:0px;padding:0px;border:0px;z-index:2147483645;width:100%;height:100vh;height:100dvh;overflow:hidden;color-scheme:auto}.game-reader--GGgPJ{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";position:absolute;top:0;left:0;right:0;bottom:0;box-sizing:border-box;background:rgba(0,0,0,0);z-index:1;user-select:none;pointer-events:all;color:#fff}.game-reader--GGgPJ.game-reader--desktop-mode--DdyrA{padding:50px 0}.game-reader--GGgPJ.game-reader--desktop-mode--DdyrA .game-reader__game-box--xbnK1{border-radius:var(--game-box-border-radius)}.game-reader--GGgPJ.game-reader--widescreen--m24df{padding:0 0}.game-reader--GGgPJ.game-reader--widescreen--m24df .game-reader__game-box--xbnK1{border-radius:0px}.game-reader--GGgPJ .game-reader__refresh-btn--sESRO{cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);z-index:2}.game-reader--GGgPJ .game-reader__game-box--xbnK1.game-reader__game-box--widescreen--PC_5t{border-radius:0px}.game-reader--GGgPJ .game-reader__iframe--TPOmh{width:100%;height:100%;transition:opacity ease-in .3s}.game-reader--GGgPJ .game-reader__backdrop--iVnAT{position:fixed;inset:0;z-index:-1}',""]);var n="game-reader-container--AH81u",l="game-reader--GGgPJ",c="game-reader--desktop-mode--DdyrA",d="game-reader__game-box--xbnK1",h="game-reader--widescreen--m24df",u="game-reader__refresh-btn--sESRO",p="game-reader__iframe--TPOmh",g="game-reader__backdrop--iVnAT";const f=o},763(e,t,r){r.d(t,{A:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,":root{--ias-sat: env(safe-area-inset-top);--ias-sar: env(safe-area-inset-right);--ias-sab: env(safe-area-inset-bottom);--ias-sal: env(safe-area-inset-left)}",""]);const n=o},5213(e,t,r){r.d(t,{$X:()=>d,Ay:()=>b,FU:()=>m,L6:()=>l,RI:()=>h,XI:()=>n,Yb:()=>g,bj:()=>c,cT:()=>u,ch:()=>p,fT:()=>y,s$:()=>f,zL:()=>v});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,"h3{margin:0}.stories-list-wrapper--DKVYb{background-color:var(--background-color, transparent);height:auto;padding:0;position:relative}.stories-list-wrapper--DKVYb.mode-desktop--zBsR0.with-list-controls--ePWkN{position:relative}.stories-list--bGIwH{position:relative;overflow:visible}@media(min-width: 767.99px){.stories-list--bGIwH{overflow:hidden}}.stories-list__actions--Fa6mf{position:absolute;right:0;top:0}.stories-list__viewport--PtGCL{overflow:hidden;height:auto}.stories-list__viewport--PtGCL:not(.mode-desktop--zBsR0){display:flex}.stories-list__viewport-inner--dHTNA{display:flex;flex-wrap:nowrap;-webkit-overflow-scrolling:touch}.stories-list__viewport-inner--dHTNA::-webkit-scrollbar{display:none}.stories-list__viewport-inner--dHTNA{scrollbar-width:none}.stories-list__viewport-inner--dHTNA.mode-desktop--zBsR0{scroll-behavior:unset;cursor:grab}.stories-list__viewport-inner--dHTNA.isVerticalDirection--u5egA{display:grid;grid-template-columns:repeat(auto-fill, var(--story-card-width, 174px));justify-content:center;width:100%}.stories-list__viewport-inner--dHTNA{padding-top:var(--storiesListTopPadding, 0);padding-bottom:var(--storiesListBottomPadding, 0);box-sizing:content-box}.stories-list__viewport-inner--dHTNA.align-center--j1sjW{margin-left:auto;margin-right:auto}.stories-list__viewport-inner--dHTNA.align-left--CZ_qv{margin-right:auto}.stories-list__viewport-inner--dHTNA.align-right--QmW75{margin-left:auto}.stories-list__viewport-inner--dHTNA.isTitleCardOutsideTop--QzZ2U{align-items:flex-end}.stories-list__viewport-inner--dHTNA.isTitleCardOutsideBottom--G8KrN{align-items:flex-start}",""]);var n="stories-list-wrapper--DKVYb",l="mode-desktop--zBsR0",c="with-list-controls--ePWkN",d="stories-list--bGIwH",h="stories-list__viewport--PtGCL",u="stories-list__viewport-inner--dHTNA",p="isVerticalDirection--u5egA",g="align-center--j1sjW",f="align-left--CZ_qv",m="align-right--QmW75",y="isTitleCardOutsideTop--QzZ2U",v="isTitleCardOutsideBottom--G8KrN";const b=o},7966(e,t,r){r.d(t,{Ay:()=>u,Nb:()=>d,Vl:()=>l,_m:()=>n,lc:()=>c,nC:()=>h});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".favorite-images-wrapper--rqD8L{display:flex;flex-direction:row;flex-wrap:wrap;padding:var(--storiesListCardFavoriteTitle, --storiesListItemTitlePadding, 0px);gap:var(--storiesListCardFavoriteGap, 3px);box-sizing:border-box}.favorite-image-wrapper--i4ncN{flex:0 1 calc(50% - var(--storiesListCardFavoriteGap, 3px));position:relative}.favorite-image--eMgYI{position:relative}.favorite-image-item--vwzcf{position:absolute;inset:0px;border-radius:calc(var(--storiesListInnerBorderRadiusRead, 0)/4);background-position:50% 50%;background-size:cover}.circle_style--c7LWV .favorite-image-item--vwzcf{border-radius:50%}",""]);var n="favorite-images-wrapper--rqD8L",l="favorite-image-wrapper--i4ncN",c="favorite-image--eMgYI",d="favorite-image-item--vwzcf",h="circle_style--c7LWV";const u=o},6892(e,t,r){r.d(t,{Ay:()=>ee,B6:()=>f,F:()=>T,FU:()=>H,IW:()=>G,Iu:()=>l,OC:()=>x,P2:()=>_,Pr:()=>d,Qo:()=>O,Vf:()=>k,W7:()=>D,XW:()=>A,Xz:()=>J,Yb:()=>$,Yo:()=>M,ZE:()=>P,_d:()=>z,_m:()=>K,a1:()=>B,aA:()=>p,aF:()=>h,aI:()=>v,av:()=>S,cp:()=>w,cw:()=>b,dl:()=>L,eQ:()=>R,fT:()=>m,hS:()=>E,i4:()=>U,jw:()=>Z,m4:()=>C,m7:()=>F,mW:()=>q,nU:()=>Q,nj:()=>u,oe:()=>N,om:()=>I,p_:()=>g,qE:()=>V,ro:()=>j,s$:()=>W,sB:()=>X,sr:()=>Y,uk:()=>n,zL:()=>y,zc:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'.stories-slide-wrapper--yq3Zk:not(:last-child){margin-right:var(--storiesGap, 20px)}.stories-slide-wrapper--yq3Zk{display:flex;flex-direction:column;flex:0 0 auto;box-sizing:content-box;width:var(--story-card-width);cursor:pointer}.stories-slide-wrapper--yq3Zk:hover{text-decoration:none}.stories-slide-wrapper--yq3Zk{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm{display:block;box-sizing:border-box;text-align:left;position:relative;overflow:visible;width:var(--story-card-width);-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);border:var(--storiesListBorderNotReadWidth, 2px) solid var(--storiesBorderNotReadColor, #00b956);padding:var(--storiesListBorderGapNotRead, 2px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp{border-radius:var(--storiesListBorderRadius, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide-image--tHOh7,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide-image--tHOh7{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide-image__image--UXctk video,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide-image__image--UXctk video{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide__mask--N1bZK,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide__mask--N1bZK{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk .stories-slide__content--e0Oyv,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp .stories-slide__content--e0Oyv{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR{border-radius:var(--storiesListBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide-image--tHOh7,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide-image--tHOh7{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide-image__image--UXctk video,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide-image__image--UXctk,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide-image__image--UXctk video{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide__mask--N1bZK,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide__mask--N1bZK{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-quad--v6wDk._is-read--GNVqR .stories-slide__content--e0Oyv,.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._format-rectangle--Ta5cp._is-read--GNVqR .stories-slide__content--e0Oyv{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._is-read--GNVqR{border:var(--storiesListBorderReadWidth, 1px) solid var(--storiesBorderReadColor, #ededed)}.stories-slide-wrapper--yq3Zk.isTitleCardOutsideTop--qrtQC{justify-content:flex-end}.stories-slide-wrapper--yq3Zk.isTitleCardOutsideBottom--lXtXr{justify-content:flex-start}.stories-slide-wrapper--yq3Zk .stories-slide__inner--Fhgjf{display:block;position:relative;width:100%;height:100%}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-black--GMC_A{background:#000}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-white--GA_HZ{background:#fff}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-red--IeWZj{background:#ff1a36}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-yellow--MjuAF{background:#fff000}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-green--d_u0t{background:#0be361}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-violet--_Pws4{background:#b300bc}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-blue--nf2Wk{background:#0761db}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-grey--ho5xA{background:#a8a8a8}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-black-gradient--ScIpU{background:#fff;background:linear-gradient(0deg, #c1c1c1, #000)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-white-gradient--KFVbd{background:#fff;background:linear-gradient(180deg, #fff, #ffc800)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-red-gradient--FlHVF{background:#ff1a36;background:linear-gradient(180deg, #c90174, #eb5c57)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-yellow-gradient--Na5gP{background:#fff000;background:linear-gradient(0deg, #fbda61, #f76b1c)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-green-gradient--bBwZa{background:#0be361;background:linear-gradient(0deg, #b4ed50, #429321)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-violet-gradient--zMsPH{background:#b300bc;background:linear-gradient(180deg, #c90174, #0164fd)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-blue-gradient--tqRAH{background:#0761db;background:linear-gradient(180deg, #3023ae, #53a0fe 48%, #b4ed50)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._background-color-grey-gradient--m9xqh{background:#a8a8a8;background:linear-gradient(0deg, #e2e2e2, #959595)}.stories-slide-wrapper--yq3Zk .stories-slide-image--tHOh7{position:relative;width:100%;height:100%}.stories-slide-wrapper--yq3Zk .stories-slide-image__wrap--QgNhx{position:absolute;top:0;bottom:0;left:0;right:0}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk{position:relative;opacity:1;transition:opacity .3s ease-in-out;overflow:hidden}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk._mode_list--dEj_1{width:100%;height:100%}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk.ugc-card-cell--rJcS4 img{object-fit:contain}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk img{width:100%;height:100%;object-fit:cover}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk video{min-height:100%;min-width:100%;width:100%;background-position:center center;background-repeat:no-repeat;object-fit:cover;opacity:0}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk.video-loaded--dk0k5 img{display:none}.stories-slide-wrapper--yq3Zk .stories-slide-image__image--UXctk.video-loaded--dk0k5 video{opacity:1}.stories-slide-wrapper--yq3Zk .stories-slide__mask--N1bZK{position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;background-color:var(--storiesListItemMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemMaskLinearGradient, none);opacity:1}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._is-read--GNVqR .stories-slide__mask--N1bZK{background-color:var(--storiesListItemOpenedMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemOpenedMaskLinearGradient, none)}.stories-slide-wrapper--yq3Zk .stories-slide--JIrrm._ugc-cell--szjgS .stories-slide__mask--N1bZK{background-color:var(--storiesListCardUgcMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListCardUgcMaskLinearGradient, none)}.stories-slide-wrapper--yq3Zk .stories-slide__content--e0Oyv{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;height:100%;max-height:100%;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;font-family:var(--storiesListItemTitleFontFamily);font-weight:normal;font-size:1rem;line-height:normal;font:var(--storiesListItemTitleFont, normal);text-decoration:none;padding:var(--storiesListItemTitlePadding, 0px)}.stories-slide-wrapper--yq3Zk .stories-slide__content--e0Oyv.__position_outside_top--tOlX7,.stories-slide-wrapper--yq3Zk .stories-slide__content--e0Oyv.__position_outside_bottom--EUvwa{position:relative;top:unset;right:unset;bottom:unset;left:unset;height:auto}.stories-slide-wrapper--yq3Zk .clamp--JfKw3{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ.align-left--H2od3{text-align:left}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ.align-center--iwQ73{text-align:center}.stories-slide-wrapper--yq3Zk .stories-slide__title--qq_kQ.align-right--zzy4Y{text-align:right}.stories-slide--JIrrm._format-circle--GuDY7,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide-image__image--UXctk,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide-image__image--UXctk video,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide__mask--N1bZK,.stories-slide--JIrrm._format-circle--GuDY7 .stories-slide-image--tHOh7{border-radius:50%}.stories-slide--JIrrm._favorite-cell--UoDmM .stories-slide__mask--N1bZK{background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%)}.stories-slide--JIrrm._favorite-cell--UoDmM._format-circle--GuDY7 .stories-slide-image__wrap--QgNhx{display:flex}.stories-slide--JIrrm._favorite-cell--UoDmM._format-circle--GuDY7 .stories-slide-image__image--UXctk{width:85%;height:85%;overflow:visible;margin:auto}.stories-slide--JIrrm._favorite-cell--UoDmM._format-circle--GuDY7 .favorite-images-wrapper--Hm4wF{margin:0;padding:0}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z{filter:drop-shadow(var(--storiesListCardDropShadow, none))}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z._is-read--GNVqR{filter:drop-shadow(var(--storiesListCardOpenedDropShadow, none))}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z._favorite-cell--UoDmM{filter:drop-shadow(var(--storiesListCardFavoriteDropShadow, none))}.stories-slide--JIrrm._has-drop-shadow--Rrc2Z._ugc-cell--szjgS{filter:drop-shadow(var(--storiesListCardUgcDropShadow, none))}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardMask);mask-image:var(--storiesListCardMask)}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd._is-read--GNVqR .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardOpenedMask);mask-image:var(--storiesListCardOpenedMask)}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd._favorite-cell--UoDmM .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardFavoriteMask);mask-image:var(--storiesListCardFavoriteMask)}.stories-slide--JIrrm._has-card-svg-mask--Pjyjd._ugc-cell--szjgS .stories-slide__inner--Fhgjf{-webkit-mask-image:var(--storiesListCardUgcMask);mask-image:var(--storiesListCardUgcMask)}.stories-slide--JIrrm .card-overlay-svg-mask--ggkSQ{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:3}@supports(((mask-image: linear-gradient(0deg, #fff, #fff), linear-gradient(0deg, #fff, #fff)) and (mask-clip: content-box, border-box)) or ((-webkit-mask-image: linear-gradient(0deg, #fff, #fff), linear-gradient(0deg, #fff, #fff)) and (-webkit-mask-clip: content-box, border-box))) and ((mask-composite: exclude) or (-webkit-mask-composite: xor)){.stories-slide--JIrrm._has-border-gradient-color--BniDY{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY:before{content:"";position:absolute;border-radius:inherit;box-sizing:border-box;-webkit-mask-composite:xor;mask-composite:exclude;padding:var(--storiesListBorderNotReadWidth, 2px);top:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);right:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);left:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);background:var(--storiesBorderNotReadGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}.stories-slide--JIrrm._has-border-gradient-color--BniDY._is-read--GNVqR{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY._is-read--GNVqR:before{padding:var(--storiesListBorderReadWidth, 2px);top:calc(var(--storiesListBorderReadWidth, 2px)*-1);right:calc(var(--storiesListBorderReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderReadWidth, 2px)*-1);left:calc(var(--storiesListBorderReadWidth, 2px)*-1);background:var(--storiesBorderReadGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}.stories-slide--JIrrm._has-border-gradient-color--BniDY._favorite-cell--UoDmM{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY._favorite-cell--UoDmM:before{padding:var(--storiesListBorderNotReadWidth, 2px);top:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);right:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);left:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);background:var(--storiesListCardFavoriteGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}.stories-slide--JIrrm._has-border-gradient-color--BniDY._ugc-cell--szjgS{border-color:rgba(0,0,0,0)}.stories-slide--JIrrm._has-border-gradient-color--BniDY._ugc-cell--szjgS:before{padding:var(--storiesListBorderNotReadWidth, 2px);top:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);right:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);bottom:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);left:calc(var(--storiesListBorderNotReadWidth, 2px)*-1);background:var(--storiesListCardUgcGradientColor, transparent);-webkit-mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);-webkit-mask-clip:content-box,border-box;mask-image:linear-gradient(0deg, #fff, #fff),linear-gradient(0deg, #fff, #fff);mask-clip:content-box,border-box}}',""]);var n="stories-slide-wrapper--yq3Zk",l="stories-slide--JIrrm",c="_format-quad--v6wDk",d="_format-rectangle--Ta5cp",h="stories-slide-image--tHOh7",u="stories-slide-image__image--UXctk",p="stories-slide__mask--N1bZK",g="stories-slide__content--e0Oyv",f="_is-read--GNVqR",m="isTitleCardOutsideTop--qrtQC",y="isTitleCardOutsideBottom--lXtXr",v="stories-slide__inner--Fhgjf",b="_background-color-black--GMC_A",w="_background-color-white--GA_HZ",S="_background-color-red--IeWZj",_="_background-color-yellow--MjuAF",O="_background-color-green--d_u0t",x="_background-color-violet--_Pws4",k="_background-color-blue--nf2Wk",C="_background-color-grey--ho5xA",P="_background-color-black-gradient--ScIpU",j="_background-color-white-gradient--KFVbd",E="_background-color-red-gradient--FlHVF",I="_background-color-yellow-gradient--Na5gP",T="_background-color-green-gradient--bBwZa",A="_background-color-violet-gradient--zMsPH",M="_background-color-blue-gradient--tqRAH",L="_background-color-grey-gradient--m9xqh",R="stories-slide-image__wrap--QgNhx",B="_mode_list--dEj_1",D="ugc-card-cell--rJcS4",N="video-loaded--dk0k5",F="_ugc-cell--szjgS",U="__position_outside_top--tOlX7",G="__position_outside_bottom--EUvwa",V="clamp--JfKw3",z="stories-slide__title--qq_kQ",W="align-left--H2od3",$="align-center--iwQ73",H="align-right--zzy4Y",q="_format-circle--GuDY7",J="_favorite-cell--UoDmM",K="favorite-images-wrapper--Hm4wF",Z="_has-drop-shadow--Rrc2Z",Q="_has-card-svg-mask--Pjyjd",Y="card-overlay-svg-mask--ggkSQ",X="_has-border-gradient-color--BniDY";const ee=o},1980(e,t,r){r.d(t,{Ay:()=>x,ED:()=>y,P0:()=>f,Rh:()=>w,SV:()=>O,Vd:()=>S,uT:()=>g,w0:()=>b,w2:()=>_,xM:()=>v,yt:()=>m});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a),n=r(62),l=r.n(n),c=new URL(r(487),r.b),d=new URL(r(5720),r.b),h=o()(s()),u=l()(c),p=l()(d);h.push([e.id,`.stories-list-controls--lCJNC{pointer-events:none}.stories-list-controls--lCJNC .control-start--eUcK_,.stories-list-controls--lCJNC .control-end--zHGpG{cursor:pointer;position:absolute;background-color:var(--storiesListControlsBackgroundColor, white);border-radius:50%;z-index:10;height:var(--storiesListControlsSize);width:var(--storiesListControlsSize);top:50%;display:flex;justify-content:center;align-items:center;pointer-events:all}.stories-list-controls--lCJNC .control-icon--RZK51{width:7px;height:12px;background-color:var(--storiesListControlsColor, black)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-start--eUcK_{left:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-start--eUcK_.control-start_dir_rtl--qVqiV{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-end--zHGpG{right:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--lCJNC.horizontal--vfM2_ .control-end--zHGpG.control-end_dir_rtl--iekZd{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--lCJNC.vertical--F1syL .control-start--eUcK_{top:var(--storiesListTopPadding, 0);left:50%;transform:translate3d(-50%, 0, 0) rotate(90deg)}.stories-list-controls--lCJNC.vertical--F1syL .control-end--zHGpG{top:auto;bottom:var(--storiesListBottomPadding, 0);right:50%;transform:translate3d(50%, 0, 0) rotate(90deg)}.stories-list-controls--lCJNC .control-start--eUcK_{display:flex}.stories-list-controls--lCJNC .control-start--eUcK_ .control-icon--RZK51{-webkit-mask-image:url(${u});mask-image:url(${u})}.stories-list-controls--lCJNC .control-start--eUcK_.control-start_reach-start--DHQQF{display:none}.stories-list-controls--lCJNC .control-end--zHGpG{display:flex}.stories-list-controls--lCJNC .control-end--zHGpG .control-icon--RZK51{-webkit-mask-image:url(${p});mask-image:url(${p})}.stories-list-controls--lCJNC .control-end--zHGpG.control-end_reach-end--z6db0{display:none}`,""]);var g="stories-list-controls--lCJNC",f="control-start--eUcK_",m="control-end--zHGpG",y="control-icon--RZK51",v="horizontal--vfM2_",b="control-start_dir_rtl--qVqiV",w="control-end_dir_rtl--iekZd",S="vertical--F1syL",_="control-start_reach-start--DHQQF",O="control-end_reach-end--z6db0";const x=h},3476(e,t,r){r.d(t,{Ay:()=>u,Lb:()=>d,SG:()=>c,YE:()=>h,eS:()=>l,uT:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-list-controls--j6ogL .stories-list-controls__btn_next--hEemh,.stories-list-controls--j6ogL .stories-list-controls__btn_prev--gxn67{display:none}.stories-list-controls--j6ogL.stories-list-controls_desktop--Z1cW_ .stories-list-controls__btn_next--hEemh,.stories-list-controls--j6ogL.stories-list-controls_desktop--Z1cW_ .stories-list-controls__btn_prev--gxn67{display:block;position:absolute;top:50%;transform:translateY(-50%);left:50%}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0:focus{outline:0}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0{background-color:rgba(0,0,0,0);border:none;color:#fff;cursor:pointer}.stories-list-controls--j6ogL .stories-list-controls__btn-icon--aH7V0:disabled{color:#464646;cursor:not-allowed}",""]);var n="stories-list-controls--j6ogL",l="stories-list-controls__btn_next--hEemh",c="stories-list-controls__btn_prev--gxn67",d="stories-list-controls_desktop--Z1cW_",h="stories-list-controls__btn-icon--aH7V0";const u=o},4267(e,t,r){r.d(t,{$X:()=>d,Ay:()=>p,GQ:()=>l,N1:()=>h,fo:()=>n,uY:()=>u,yU:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-list-container--m977t{left:50%;transform:translateX(-50%);overflow:hidden;box-sizing:border-box;z-index:1;position:relative;height:100%}.stories-list-container--m977t.stories-list-container_swipe-up--jwCM8.stories-list-container_swipe-up--jwCM8{background-color:rgba(0,0,0,0)}.stories-list-container--m977t.stories-list-container_desktop--ASkve{padding:50px 0}.stories-list-container--m977t *,.stories-list-container--m977t ::after,.stories-list-container--m977t ::before{box-sizing:border-box}.stories-list-container--m977t .stories-list--yA6Px{position:relative;height:100%;transform-style:preserve-3d}.stories-list-container--m977t .stories-list--yA6Px .stories-list__effect-viewer--mpRIQ{position:relative;top:0;left:0;right:0;width:100%;width:calc(100% + .01px);height:100%;transform-style:preserve-3d}.stories-list-container--m977t .stories-list--yA6Px .stories-list__item--Ubk5o{position:absolute;width:100%;height:auto;bottom:0;border-radius:var(--slide-border-radius, 0);left:0;top:0;backface-visibility:hidden}",""]);var n="stories-list-container--m977t",l="stories-list-container_swipe-up--jwCM8",c="stories-list-container_desktop--ASkve",d="stories-list--yA6Px",h="stories-list__effect-viewer--mpRIQ",u="stories-list__item--Ubk5o";const p=o},6778(e,t,r){r.d(t,{Ay:()=>p,Tr:()=>u,XX:()=>h,cW:()=>n,d9:()=>l,j:()=>c,qU:()=>d});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-list-controls--v8JVG{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:100000;transition:opacity 300ms}.story-list-controls--v8JVG.story-list-controls_hidden--MwhKk{opacity:0}.story-list-controls--v8JVG.story-list-controls_hidden--MwhKk .story-list-controls__item--MgB7Q{pointer-events:none}.story-list-controls--v8JVG:hover .story-list-controls__btn--r96Si{color:#fff}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q{position:absolute;top:0;bottom:0;display:flex;flex-direction:column;justify-content:center;pointer-events:all}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q.story-list-controls__item_next--n9YHk{right:-42px}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q.story-list-controls__item_prev--WCiBG{left:-42px}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0);padding:10px}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si:focus{outline:0}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si :active{opacity:.3}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si{border:none;color:#fff;cursor:pointer}.story-list-controls--v8JVG .story-list-controls__item--MgB7Q .story-list-controls__btn--r96Si:disabled{color:#464646;cursor:not-allowed}",""]);var n="story-list-controls--v8JVG",l="story-list-controls_hidden--MwhKk",c="story-list-controls__item--MgB7Q",d="story-list-controls__btn--r96Si",h="story-list-controls__item_next--n9YHk",u="story-list-controls__item_prev--WCiBG";const p=o},9037(e,t,r){r.d(t,{$X:()=>l,Ay:()=>h,fo:()=>n,tB:()=>d,uY:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-list-container--EK5f1{width:100%;height:100%;height:inherit;overflow:hidden;padding:50px 0;box-sizing:border-box;display:flex;align-items:center;overflow:hidden;margin:0 auto}.stories-list-container--EK5f1 .stories-list--N4TGU{display:flex;width:100%;height:inherit;position:relative}.stories-list-container--EK5f1 .stories-list--N4TGU .stories-list__item--CV1pG{box-sizing:border-box;height:100%;position:relative;flex-shrink:0;display:flex;align-items:center;cursor:pointer;transition:transform .3s ease-in;transform:scale(0.7);will-change:transform}.stories-list-container--EK5f1 .stories-list--N4TGU .stories-list__item--CV1pG.stories-list__item_active--Ssw9w{transform:scale(1);cursor:inherit}",""]);var n="stories-list-container--EK5f1",l="stories-list--N4TGU",c="stories-list__item--CV1pG",d="stories-list__item_active--Ssw9w";const h=o},1239(e,t,r){r.d(t,{Ay:()=>p,GJ:()=>c,Xr:()=>h,Z2:()=>l,m9:()=>u,qc:()=>d,vi:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".stories-viewer--I2zsy{position:fixed;z-index:1100;top:0;left:0;width:100%;height:100%;display:block;transition:opacity .3s ease;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stories-viewer--I2zsy:-webkit-full-screen,.stories-viewer--I2zsy:-moz-full-screen,.stories-viewer--I2zsy:-ms-fullscreen,.stories-viewer--I2zsy :fullscreen{width:100% !important;height:100% !important}.stories-viewer--I2zsy.no-select--hmeyj{user-select:none}.stories-viewer--I2zsy .stories-viewer-background--po1OR{position:fixed;top:-60px;left:-60px;width:calc(100% + 120px);height:calc(100% + 120px);background-position:center;background-repeat:no-repeat;background-size:cover}.stories-viewer--I2zsy .stories-viewer-backdrop--ITihi{position:fixed;top:0;right:0;bottom:0;left:0;z-index:11;background-color:hsla(0,0%,100%,.5)}.stories-viewer--I2zsy .stories-viewer-backdrop--ITihi._desktopMode--eez8K{display:none}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy{width:40px;height:40px;position:absolute;top:15px;color:#c2c2c4;z-index:100001}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=start],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=left]{left:15px}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=start][dir=rtl],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=left][dir=rtl]{left:auto;right:15px}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=end],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=right]{right:15px}.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=end][dir=rtl],.stories-viewer--I2zsy .stories-viewer__close-btn--kO4wy[data-position=right][dir=rtl]{left:15px;right:auto}",""]);var n="stories-viewer--I2zsy",l="no-select--hmeyj",c="stories-viewer-background--po1OR",d="stories-viewer-backdrop--ITihi",h="_desktopMode--eez8K",u="stories-viewer__close-btn--kO4wy";const p=o},6028(e,t,r){r.d(t,{Ay:()=>p,NG:()=>l,OI:()=>n,i2:()=>u,km:()=>c,lL:()=>d,x3:()=>h});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-action-panel--KnNNl{position:absolute;z-index:10001;bottom:0;left:0;right:0;padding:0 8px 8px 8px;height:50px;pointer-events:none}.story-action-panel--KnNNl.story-action-panel_hidden--tAyow .story-action-panel-actions--i4Tz_{opacity:0}.story-action-panel--KnNNl.story-action-panel_hidden--tAyow .story-action-panel-actions--i4Tz_ .story-action-panel-actions__item--lH6jO{pointer-events:none}.story-action-panel--KnNNl.story-action-panel_mobile--AhdCB{background-color:#000}.story-action-panel--KnNNl[dir=rtl] .story-action-panel-actions--i4Tz_ .story-action-panel-actions__right-container--P4Mxa{margin-left:0;margin-right:auto}.story-action-panel--KnNNl[dir=rtl] .story-action-panel-actions--i4Tz_ .story-action-panel-actions__item--lH6jO{transform:scaleX(-1)}.story-action-panel-actions--i4Tz_{width:100%;height:100%;display:flex;flex-direction:row;color:#fff;align-items:center;transition:opacity 300ms}.story-action-panel-actions--i4Tz_>span{display:flex}.story-action-panel-actions--i4Tz_ .story-action-panel-actions__right-container--P4Mxa{margin-left:auto;display:flex}.story-action-panel-actions__item--lH6jO{cursor:pointer;pointer-events:all}.story-action-panel-actions__item--lH6jO>*{pointer-events:none}.story-action-panel-actions__item--lH6jO{display:flex;align-items:center;justify-content:center;filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.5));padding:5px;transition:background-color .2s ease-in-out}.story-action-panel-actions__item--lH6jO:not(:last-child){margin-right:5px}.story-action-panel-actions__item--lH6jO:hover{filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.9))}",""]);var n="story-action-panel--KnNNl",l="story-action-panel_hidden--tAyow",c="story-action-panel-actions--i4Tz_",d="story-action-panel-actions__item--lH6jO",h="story-action-panel_mobile--AhdCB",u="story-action-panel-actions__right-container--P4Mxa";const p=o},2004(e,t,r){r.d(t,{At:()=>l,Ay:()=>c,hH:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-backdrop--lKunK{position:absolute;left:0;right:0;top:0;bottom:0;background-color:rgba(0,0,0,.2);z-index:10000;backdrop-filter:blur(3px);pointer-events:none;border-radius:var(--slide-border-radius, 0);transition:opacity 300ms}.story-backdrop--lKunK.story-backdrop_hidden--AVOQS{opacity:0;pointer-events:none}",""]);var n="story-backdrop--lKunK",l="story-backdrop_hidden--AVOQS";const c=o},3910(e,t,r){r.d(t,{Ay:()=>g,BL:()=>c,K0:()=>h,KH:()=>l,Pl:()=>u,Uv:()=>p,Xs:()=>d,bA:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-controls--ZifWj{display:flex;margin-top:8px}.story-controls--ZifWj[dir=rtl] .story-controls__item--KfHhY:first-child{margin-right:auto;margin-left:0px}.story-controls--ZifWj .story-controls__item--KfHhY{transition:opacity 300ms;color:#fff;width:32px;height:32px}.story-controls--ZifWj .story-controls__item--KfHhY:first-child{margin-left:auto}.story-controls--ZifWj .story-controls__item--KfHhY.story-controls__item_hidden--NBUBi{opacity:0;pointer-events:none}.story-controls--ZifWj .story-controls__item--KfHhY.story-controls__item_hidden--NBUBi .story-controls__btn--iA2Aa{pointer-events:none}.story-controls--ZifWj .story-controls__item--KfHhY .story-controls__btn_close--GjcEj{color:#fff}.story-controls--ZifWj .story-controls__btn-group--fWH9s{position:relative}.story-controls--ZifWj .story-controls__btn-group--fWH9s .story-controls__btn--iA2Aa{position:absolute;left:0;right:0;bottom:0;top:0}.story-controls--ZifWj .story-controls__btn--iA2Aa{border:0;padding:0;background:rgba(0,0,0,0);pointer-events:all;cursor:pointer;outline:none;color:inherit;padding:8px;border-radius:9999px;filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.5))}.story-controls--ZifWj .story-controls__btn--iA2Aa svg{overflow:visible}.story-controls--ZifWj .story-controls__btn--iA2Aa:focus{outline:none}.story-controls--ZifWj .story-controls__btn--iA2Aa.story-controls__btn_hidden--I6nRx{visibility:hidden;pointer-events:none}.story-controls--ZifWj .story-controls__btn--iA2Aa:active{opacity:.5}",""]);var n="story-controls--ZifWj",l="story-controls__item--KfHhY",c="story-controls__item_hidden--NBUBi",d="story-controls__btn--iA2Aa",h="story-controls__btn_close--GjcEj",u="story-controls__btn-group--fWH9s",p="story-controls__btn_hidden--I6nRx";const g=o},114(e,t,r){r.d(t,{Ay:()=>f,JS:()=>d,Wr:()=>g,cQ:()=>u,d:()=>p,dP:()=>l,tG:()=>c,wY:()=>h,wg:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-timeline--TQcGl{pointer-events:none;transition:opacity 300ms}.story-timeline--TQcGl.story-timeline_hidden--wSei3{opacity:0}.story-timeline--TQcGl.story-timeline_desktop--SFzsq{border-top-left-radius:5px;border-top-right-radius:5px}.story-timeline--TQcGl .story-timeline-ticks--YTuXL{height:3px;display:flex}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick--uu9gA{background-color:var(--story-timeline-background, rgba(255, 255, 255, 0.6));width:100%;margin:0 2px;overflow:hidden;position:relative;border-radius:10px}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick--uu9gA:first-child{margin-left:0}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick--uu9gA:last-child{margin-right:0}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick-progress--scl_I{width:100%;height:3px}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick-progress--scl_I.story-timeline-ticks__tick-progress_active--YV2F9{background-color:var(--story-timeline-tick-foreground, rgb(255, 255, 255))}.story-timeline--TQcGl .story-timeline-ticks--YTuXL .story-timeline-ticks__tick-progress-loader--bJk1d{width:100%;height:3px;position:absolute;top:0;left:0;background:linear-gradient(to right, var(--story-timeline-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}.story-timeline--TQcGl[dir=rtl] .story-timeline-ticks__tick-progress-loader--bJk1d{background:linear-gradient(to left, var(--story-timeline-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}",""]);var n="story-timeline--TQcGl",l="story-timeline_hidden--wSei3",c="story-timeline_desktop--SFzsq",d="story-timeline-ticks--YTuXL",h="story-timeline-ticks__tick--uu9gA",u="story-timeline-ticks__tick-progress--scl_I",p="story-timeline-ticks__tick-progress_active--YV2F9",g="story-timeline-ticks__tick-progress-loader--bJk1d";const f=o},2208(e,t,r){r.d(t,{A:()=>l,h:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story-header--wyX63{z-index:1131;position:relative;display:flex;padding:var(--timelineBlockTopOffset, 8px) 8px 32px 8px;pointer-events:none;flex-direction:column;background-image:linear-gradient(180deg, rgba(0, 0, 0, 0.104) 0%, rgba(0, 0, 0, 0) 100%)}",""]);var n="story-header--wyX63";const l=o},2621(e,t,r){r.d(t,{Ay:()=>h,Vt:()=>l,gS:()=>n,ld:()=>c,vP:()=>d});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".goods-card--txNHz{width:100px}.goods-card--txNHz:first-of-type{margin-left:.5rem}.goods-card--txNHz:not(:last-child){margin-right:.5rem}.prices--Z5Jsc{display:flex}.prices--Z5Jsc>div:not(:last-child){margin-right:.5rem}.typography--dc2T_{text-decoration:none}.typography--old-price--r6Qv7{text-decoration:line-through}.figure--CECUA{margin:0;margin-bottom:.5rem;width:100px;height:100px}.figure--CECUA>img{width:inherit;height:inherit;max-width:100%;border-radius:var(--figure-border-radius, 0px);background-color:var(--figure-background-color, #ffffff)}",""]);var n="goods-card--txNHz",l="prices--Z5Jsc",c="typography--old-price--r6Qv7",d="figure--CECUA";const h=o},2561(e,t,r){r.d(t,{Ay:()=>g,GW:()=>c,Nd:()=>d,PP:()=>u,Su:()=>h,gE:()=>l,gN:()=>p,tK:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".scrolling-carousel--OODdy{position:relative}.scrolling-carousel__wrapper--vqD_y{position:relative;overflow:hidden}.scrolling-carousel__item--W39h7{display:flex;flex-wrap:nowrap;cursor:pointer}.scrolling-carousel__arrow-button--RK6S_{width:36px;height:36px;color:#757575;margin-top:auto;margin-bottom:auto;box-shadow:0 0 0 1px rgba(0,0,0,.04),0 4px 8px 0 rgba(0,0,0,.2);background:#fff;border-radius:50%;cursor:pointer;position:absolute;top:0;bottom:0;opacity:0;transition:opacity .5s}.scrolling-carousel__arrow-button--RK6S_>svg{position:absolute;left:0;right:0;bottom:0;top:0;margin:auto;width:24px;height:24px;fill:#757575}.scrolling-carousel__arrow-button--RK6S_:hover svg{fill:#000}.scrolling-carousel__arrow-button--show--RTHxp{opacity:.9}.scrolling-carousel__arrow-button--show--RTHxp:hover{opacity:1}.scrolling-carousel__arrow-button--right--HLaJI{right:-18px}.scrolling-carousel__arrow-button--left--kfi5d{left:-18px}@media(pointer: coarse){.scrolling-carousel__arrow-button--RK6S_{display:none !important}}",""]);var n="scrolling-carousel--OODdy",l="scrolling-carousel__wrapper--vqD_y",c="scrolling-carousel__item--W39h7",d="scrolling-carousel__arrow-button--RK6S_",h="scrolling-carousel__arrow-button--show--RTHxp",u="scrolling-carousel__arrow-button--right--HLaJI",p="scrolling-carousel__arrow-button--left--kfi5d";const g=o},4354(e,t,r){r.d(t,{A:()=>l,H:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".btn--cfI9O{margin:auto auto 10px;padding:10px;cursor:pointer}",""]);var n="btn--cfI9O";const l=o},9406(e,t,r){r.d(t,{Ay:()=>l,u1:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,"@keyframes spin--QyVKJ{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner--bikAS{position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);width:2rem;height:2rem;border-radius:50%;animation:spin--QyVKJ .6s infinite linear;border:var(--border, 2px solid transparent);border-color:var(--border-color, black)}",""]);var n="spinner--bikAS";const l=o},777(e,t,r){r.d(t,{Ay:()=>h,NM:()=>l,bt:()=>c,fY:()=>d,rq:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,"@keyframes fadeInFrames--BAAcK{from{opacity:0}to{opacity:1}}@keyframes fadeOutFrames--iXdQ3{from{opacity:1}to{opacity:0}}.goods-container--ylLse{position:relative;margin-left:auto;margin-right:auto;display:flex;flex-direction:column;width:100%;height:100%;margin-top:0px}.goods-container--visible--Zwg46{animation:300ms fadeInFrames--BAAcK}.goods-container--hidden--T79T4{animation:300ms normal forwards fadeOutFrames--iXdQ3}.goods-container__backdrop--Gb82L{flex:1}.goods-list--w7fw3{position:relative;display:flex;flex-direction:column}",""]);var n="goods-container--ylLse",l="goods-container--visible--Zwg46",c="goods-container--hidden--T79T4",d="goods-container__backdrop--Gb82L";const h=o},9111(e,t,r){r.d(t,{A:()=>l,L:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".goods-widget-viewer--Yv1dR{position:absolute;inset:0;z-index:30000;text-align:left}",""]);var n="goods-widget-viewer--Yv1dR";const l=o},7656(e,t,r){r.d(t,{Ay:()=>O,HE:()=>b,Q$:()=>m,Xn:()=>_,b1:()=>d,fg:()=>y,hF:()=>u,iE:()=>n,iW:()=>c,kJ:()=>v,nl:()=>f,qG:()=>S,rL:()=>h,rN:()=>p,tB:()=>l,wU:()=>g,x6:()=>w});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'.wrapper--SCmz9{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";position:absolute;inset:0;z-index:30000;border-radius:inherit}.wrapper--SCmz9 .backdrop--seLwi{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5);border-radius:inherit}.main--XK4rj{position:absolute;z-index:2;user-select:none;display:flex;flex-direction:column;text-rendering:geometricprecision;overflow:hidden}.main--XK4rj .question--MqYwv:empty{display:none}.main--XK4rj .question--MqYwv{width:100%;height:auto}.main--XK4rj .input-group--lMzQE{display:flex}.main--XK4rj .input-group--lMzQE .input--YmfeI{width:100%}.main--XK4rj .input-group--lMzQE .input-group__prepend--n6ARX{display:flex;flex:.35}.main--XK4rj .input-group--lMzQE .input-group__separator--OnA4C{border-right:1px solid #fff;margin-right:.5rem}.main--XK4rj .input-group--lMzQE .input--YmfeI{flex:1}.main--XK4rj .input-wrapper--QCAEu{overflow:hidden;box-sizing:content-box;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.main--XK4rj .input-wrapper--QCAEu .input--YmfeI{background:none;-webkit-tap-highlight-color:rgba(0,0,0,0);text-rendering:inherit;outline:none;border:none}.main--XK4rj .input-wrapper--QCAEu .input--YmfeI::placeholder{color:inherit}.main--XK4rj .input-wrapper--QCAEu .input--YmfeI.input_centered--Yi3YX{text-align:center}.main--XK4rj .input-wrapper--QCAEu.is-invalid--X7GYL{border-color:#dc3545 !important;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.textarea-grow-wrap--QgfQG{display:grid;max-width:100%;word-break:break-all}.textarea-grow-wrap--QgfQG::after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.textarea-grow-wrap--QgfQG>.input--YmfeI{resize:none;overflow:hidden}.textarea-grow-wrap--QgfQG>.input--YmfeI,.textarea-grow-wrap--QgfQG::after{border:inherit;padding:inherit;font:inherit;text-rendering:inherit;text-align:inherit;line-height:normal;color:inherit;grid-area:1/1/2/2}.button-wrapper--q9QcI{width:100%}.button-wrapper--q9QcI .button--H5mC8{width:100%;cursor:pointer}.button-wrapper--q9QcI .button--H5mC8:disabled,.button-wrapper--q9QcI .button--H5mC8[disabled=true]{cursor:not-allowed;pointer-events:none;background-color:#272727 !important}@keyframes fadeIn--Zufa6{from{opacity:0}to{opacity:1}}@keyframes fadeOut--ojkit{from{opacity:1}to{opacity:0}}.fadeIn--Zufa6{animation:fadeIn--Zufa6 300ms forwards}.fadeOut--ojkit{animation:fadeOut--ojkit 0ms forwards}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}',""]);var n="wrapper--SCmz9",l="backdrop--seLwi",c="main--XK4rj",d="question--MqYwv",h="input-group--lMzQE",u="input--YmfeI",p="input-group__prepend--n6ARX",g="input-group__separator--OnA4C",f="input-wrapper--QCAEu",m="input_centered--Yi3YX",y="is-invalid--X7GYL",v="textarea-grow-wrap--QgfQG",b="button-wrapper--q9QcI",w="button--H5mC8",S="fadeIn--Zufa6",_="fadeOut--ojkit";const O=o},6349(e,t,r){r.d(t,{Ay:()=>d,Z8:()=>l,_7:()=>n,rE:()=>c});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".story--FKtqL{height:100%;width:100%;position:relative;backface-visibility:hidden;transform:translateZ(0);overflow:hidden;border-radius:var(--slide-border-radius, 0)}@supports(clip-path: inset(0 round 0)){.story--FKtqL{overflow:visible;border-radius:0;clip-path:inset(0 round var(--slide-border-radius, 0px))}}.story--FKtqL.story_mobile--nWF1r{border-radius:0}.story--FKtqL.story_mobile--nWF1r .story-slides--HJ7Kh{border-radius:var(--slide-border-radius, 0)}.story--FKtqL .story-slides--HJ7Kh{position:absolute;overflow:hidden;top:0;left:0;bottom:0;right:0}",""]);var n="story--FKtqL",l="story_mobile--nWF1r",c="story-slides--HJ7Kh";const d=o},8790(e,t,r){r.d(t,{Ay:()=>d,Gp:()=>c,Kk:()=>n,dG:()=>l});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".close-btn-wrapper--bHM7p{transition:opacity 300ms;width:100%;height:100%;color:#c2c2c4}.close-btn-wrapper--bHM7p.close-btn-wrapper_hidden--msWNU{opacity:0}.close-btn-wrapper--bHM7p.close-btn-wrapper_hidden--msWNU .close-btn--SAMXI{pointer-events:none}.close-btn--SAMXI{border:0;padding:0;background:rgba(0,0,0,0);pointer-events:all;cursor:pointer;outline:none;color:inherit;width:100%;height:100%}.close-btn--SAMXI:focus{outline:none}.close-btn--SAMXI{display:flex;justify-content:center;align-items:center}.close-btn--SAMXI svg{overflow:visible;width:100%;height:100%}.close-btn--SAMXI:active{opacity:.5}",""]);var n="close-btn-wrapper--bHM7p",l="close-btn-wrapper_hidden--msWNU",c="close-btn--SAMXI";const d=o},5479(e,t,r){r.d(t,{Ay:()=>d,MU:()=>l,Xr:()=>c,wG:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".loader--hPq1w{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background, black)}.loader--hPq1w .loader__refresh-btn--qI2it{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader--hPq1w .loader__spinner--W3Lnd{-ms-flex-negative:0;flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor, white);border-color:var(--loaderBackgroundAccentColor, transparent) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white) var(--loaderBackgroundColor, white);-webkit-animation:loading-spinner--Nh9wv .6s infinite linear;animation:loading-spinner--Nh9wv .6s infinite linear}@keyframes loading-spinner--Nh9wv{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]);var n="loader--hPq1w",l="loader__refresh-btn--qI2it",c="loader__spinner--W3Lnd";const d=o},3639(e,t,r){r.d(t,{A:()=>p,g:()=>u});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a),n=r(62),l=r.n(n),c=new URL(r(6040),r.b),d=o()(s()),h=l()(c);d.push([e.id,`.screen-orientation-lock--jmBZa{pointer-events:all;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fff;z-index:1;user-select:none;background-position:center center;background-size:cover;background-repeat:no-repeat;background-image:url(${h})}`,""]);var u="screen-orientation-lock--jmBZa";const p=d},7231(e,t,r){r.d(t,{Ay:()=>b,HM:()=>l,Km:()=>h,OL:()=>u,Oy:()=>m,PH:()=>y,Rg:()=>v,UH:()=>d,Wz:()=>g,cU:()=>f,ge:()=>n,l9:()=>c,xG:()=>p});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".share-panel__body_screenshot--jKMDk{display:flex;flex-direction:column}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1{cursor:pointer;background:rgba(0,0,0,0);border:none;width:100%;height:100%;display:flex;text-align:left;justify-content:center;align-items:center;color:#fff}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B{margin-right:5px;position:relative;width:30px;height:30px;flex-shrink:0}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B .btn-copy__icon-state--jy0bV{position:absolute;inset:0px;opacity:0;transition:opacity 300ms ease-in-out}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B .btn-copy__icon-state--jy0bV.btn-copy__icon-state_default--CA8xO{opacity:1;visibility:visible}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__icon--QTB7B .btn-copy__icon-state--jy0bV.btn-copy__icon-state_done--qiZIb{opacity:1;visibility:visible}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1 .btn-copy__text--dZSfK{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:5px}.share-panel__body_screenshot--jKMDk .btn--QKddA.btn-copy--cEip1:active{transform:scale(0.96)}.share-panel__body_screenshot--jKMDk .share-panel-row--_zeGB{justify-content:center;height:auto;padding:16px}.share-panel__body_screenshot--jKMDk .share-panel-row--_zeGB:first-child{height:450px;box-sizing:border-box}.share-panel__body_screenshot--jKMDk .share-panel-row__image-link--T18rs{width:100%;height:100%;display:flex;justify-content:center}.share-panel__body_screenshot--jKMDk .share-panel-row__image--JcHq6{max-width:100%;height:100%;object-fit:cover;border-radius:20px}.share-panel__body_screenshot--jKMDk .share-item__download-button--G5qRF{align-self:center;cursor:pointer;height:100%;width:100%;text-decoration:none;color:#fff;display:flex;align-items:center;justify-content:center}.share-panel__body_screenshot--jKMDk .share-item__download-button--G5qRF:active{transform:scale(0.96)}",""]);var n="share-panel__body_screenshot--jKMDk",l="btn--QKddA",c="btn-copy--cEip1",d="btn-copy__icon--QTB7B",h="btn-copy__icon-state--jy0bV",u="btn-copy__icon-state_default--CA8xO",p="btn-copy__icon-state_done--qiZIb",g="btn-copy__text--dZSfK",f="share-panel-row--_zeGB",m="share-panel-row__image-link--T18rs",y="share-panel-row__image--JcHq6",v="share-item__download-button--G5qRF";const b=o},6827(e,t,r){r.d(t,{A:()=>l,l:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".ias-copy-button--C5qry{color:#fff}.ias-copy-button--C5qry:hover{color:#fff}",""]);var n="ias-copy-button--C5qry";const l=o},9749(e,t,r){r.d(t,{Ay:()=>d,KY:()=>c,Kw:()=>n,X$:()=>l});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".share-item--JUUkd{color:#fff}a.share-item--JUUkd{color:#fff;transition:none}a.share-item--JUUkd:hover{color:#fff}.social-list--Vfhck{flex-wrap:wrap;height:auto;padding-bottom:1rem}.social-list--Vfhck .social-list__item--QGZS7{margin-top:1rem}",""]);var n="share-item--JUUkd",l="social-list--Vfhck",c="social-list__item--QGZS7";const d=o},5839(e,t,r){r.d(t,{$9:()=>m,Ay:()=>_,DD:()=>f,Kw:()=>h,Xn:()=>b,YX:()=>p,Zu:()=>g,cU:()=>d,fP:()=>n,jk:()=>c,ly:()=>w,md:()=>S,pX:()=>u,qG:()=>v,yg:()=>l,z5:()=>y});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,'.share-panel-wrapper--wPNgv{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";position:absolute;top:0;left:0;right:0;bottom:0;z-index:10001}.share-panel-wrapper--wPNgv .share-panel-backdrop--EELt8{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5)}.share-panel--yiLza{position:absolute;top:auto;left:0;right:0;bottom:0;z-index:2;user-select:none}.share-panel-row--d_Y3g{width:100%;height:150px;display:flex;flex-direction:row;align-items:center;box-sizing:border-box}.share-panel-row--d_Y3g .share-item--EJDtg{cursor:pointer;flex:0 0 auto;width:69px;height:90px;margin:0 10px}.share-panel-row--d_Y3g .share-item--EJDtg:first-child{margin-left:20px}.share-panel-row--d_Y3g .share-item--EJDtg:last-child{margin-right:20px}.share-panel-row--d_Y3g .share-item--EJDtg{display:flex;flex-direction:column;align-items:center;text-align:center}.share-panel-row--d_Y3g .share-item--EJDtg,.share-panel-row--d_Y3g .share-item--EJDtg:visited,.share-panel-row--d_Y3g .share-item--EJDtg:active,.share-panel-row--d_Y3g .share-item--EJDtg:focus{text-decoration:none}.share-panel-row--d_Y3g .share-item--EJDtg .share-item-title--GZtlK{margin-top:20px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:.2rem}.share-panel-row--d_Y3g.title-row--yXCRX{height:120px;padding-top:30px;padding-bottom:30px;padding-left:20px;padding-right:20px}.share-panel-row--d_Y3g.title-row--yXCRX .share-url-favicon--WRXRp{width:60px;height:60px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.share-panel-row--d_Y3g.title-row--yXCRX .share-url-favicon--WRXRp img{width:30px;height:30px}.share-panel-row--d_Y3g.title-row--yXCRX .title--kyfw7{font-size:16px;line-height:1.4rem;margin-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.share-panel-row--d_Y3g.title-row--yXCRX .title--kyfw7[dir=rtl]{margin-left:0px;margin-right:15px}.share-panel-separator--OU12s{width:100%;height:1px}.share-panel--yiLza{will-change:transform;transition:transform 300ms}.share-panel__body--YRkXN{width:100%;height:100%}@keyframes slideIn--TAzsm{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slideOut--Tgy4R{from{transform:translateY(0%)}to{transform:translateY(100%)}}@keyframes fadeIn--BJJpX{from{opacity:0}to{opacity:1}}@keyframes fadeOut--qKRjj{from{opacity:1}to{opacity:0}}.fadeIn--BJJpX{animation:fadeIn--BJJpX 300ms forwards}.fadeOut--qKRjj{animation:fadeOut--qKRjj 300ms forwards}.slideIn--TAzsm{animation:slideIn--TAzsm 300ms forwards}.slideOut--Tgy4R{animation:slideOut--Tgy4R 300ms forwards}',""]);var n="share-panel-wrapper--wPNgv",l="share-panel-backdrop--EELt8",c="share-panel--yiLza",d="share-panel-row--d_Y3g",h="share-item--EJDtg",u="share-item-title--GZtlK",p="title-row--yXCRX",g="share-url-favicon--WRXRp",f="title--kyfw7",m="share-panel-separator--OU12s",y="share-panel__body--YRkXN",v="fadeIn--BJJpX",b="fadeOut--qKRjj",w="slideIn--TAzsm",S="slideOut--Tgy4R";const _=o},4456(e,t,r){r.d(t,{A:()=>l,K:()=>n});var i=r(6758),s=r.n(i),a=r(935),o=r.n(a)()(s());o.push([e.id,".icon--PiVau{width:2rem;height:2rem}",""]);var n="icon--PiVau";const l=o},935(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r="",i=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),i&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),i&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r}).join("")},t.i=function(e,r,i,s,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(i)for(var n=0;n<this.length;n++){var l=this[n][0];null!=l&&(o[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);i&&o[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),r&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=r):d[2]=r),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},62(e){e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},6758(e){e.exports=function(e){return e[1]}},46(e){var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(r,i){function s(r){e.removeListener(t,a),i(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}f(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&f(e,"error",t,r)}(e,s,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function n(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,i){var s,a,o,c;if(n(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(s=l(e))>0&&o.length>s&&!o.warned){o.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=o.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=d.bind(i);return s.listener=r,i.wrapFn=s,s}function u(e,t,r){var i=e._events;if(void 0===i)return[];var s=i[t];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(s):g(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function f(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function s(a){i.once&&e.removeEventListener(t,s),r(a)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var s="error"===e,a=this._events;if(void 0!==a)s=s&&void 0===a.error;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var n=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw n.context=o,n}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var c=l.length,d=g(l,c);for(r=0;r<c;++r)i(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return c(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return c(this,e,t,!0)},a.prototype.once=function(e,t){return n(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return n(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,i,s,a,o;if(n(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(s=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,s=a;break}if(s<0)return this;0===s?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,s),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,a=Object.keys(r);for(i=0;i<a.length;++i)"removeListener"!==(s=a[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return u(this,e,!0)},a.prototype.rawListeners=function(e){return u(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},2591(e){var t=[];function r(e){for(var r=-1,i=0;i<t.length;i++)if(t[i].identifier===e){r=i;break}return r}function i(e,i){for(var a={},o=[],n=0;n<e.length;n++){var l=e[n],c=i.base?l[0]+i.base:l[0],d=a[c]||0,h="".concat(c," ").concat(d);a[c]=d+1;var u=r(h),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var g=s(p,i);i.byIndex=n,t.splice(n,0,{identifier:h,updater:g,references:1})}o.push(h)}return o}function s(e,t){var r=t.domAPI(t);r.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;r.update(e=t)}else r.remove()}}e.exports=function(e,s){var a=i(e=e||[],s=s||{});return function(e){e=e||[];for(var o=0;o<a.length;o++){var n=r(a[o]);t[n].references--}for(var l=i(e,s),c=0;c<a.length;c++){var d=r(a[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=l}}},8128(e){var t={};e.exports=function(e,r){var i=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},3051(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855(e,t,r){e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},1740(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var i="";r.supports&&(i+="@supports (".concat(r.supports,") {")),r.media&&(i+="@media ".concat(r.media," {"));var s=void 0!==r.layer;s&&(i+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),i+=r.css,s&&(i+="}"),r.media&&(i+="}"),r.supports&&(i+="}");var a=r.sourceMap;a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},3656(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},5016(e,t,r){const i=document.querySelector("[nonce]");i&&(r.nc=i.nonce||i.getAttribute("nonce")),window.litNonce=r.nc},5720(e){e.exports="data:image/svg+xml,%3Csvg width=%277%27 height=%2712%27 viewBox=%270 0 7 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M1 11L6 6L1 1%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E"},487(e){e.exports="data:image/svg+xml,%3Csvg width=%277%27 height=%2712%27 viewBox=%270 0 7 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M6 11L1 6L6 1%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E"},6040(e){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTc2MiIgaGVpZ2h0PSI4MjkiIHZpZXdCb3g9IjAgMCAxNzYyIDgyOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxyZWN0IHdpZHRoPSIxNzYyIiBoZWlnaHQ9IjgyOSIgZmlsbD0iIzIxMjEyMSIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02NjYgNTQ5QzY2MS41ODIgNTQ5IDY1OCA1NDUuNDE4IDY1OCA1NDFMNjU4IDM0OUM2NTggMzQ0LjU4MiA2NjEuNTgyIDM0MSA2NjYgMzQxTDk5NCAzNDFDOTk4LjQxOCAzNDEgMTAwMiAzNDQuNTgyIDEwMDIgMzQ5TDEwMDIgNTQxQzEwMDIgNTQ1LjQxOCA5OTguNDE4IDU0OSA5OTQgNTQ5TDY2NiA1NDlaTTY2OCA1NDFMOTYyIDU0MUw5NjIgMzQ5TDY2OCAzNDlMNjY4IDU0MVoiIGZpbGw9IiMzRjNGM0YiLz4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAwIDIxNEM5MDAgMjA5LjU4MiA5MDMuNTgyIDIwNiA5MDggMjA2SDExMDBDMTEwNC40MiAyMDYgMTEwOCAyMDkuNTgyIDExMDggMjE0VjU0MkMxMTA4IDU0Ni40MTggMTEwNC40MiA1NTAgMTEwMCA1NTBIOTA4QzkwMy41ODIgNTUwIDkwMCA1NDYuNDE4IDkwMCA1NDJWMjE0Wk05MDggMjE2VjUxMEgxMTAwVjIxNkg5MDhaIiBmaWxsPSJ3aGl0ZSIvPg0KPHBhdGggZD0iTTgwMy41IDIxNkM3NTggMjIwLjUgNzEzLjUgMjU3IDcxNyAzMTcuNUM3MjEgMjc4IDc1OCAyMzcuNSA4MDMuNSAyNDIuNVYyNjRMODQ1LjUgMjI5TDgwMy41IDE5NS41VjIxNloiIGZpbGw9IndoaXRlIi8+DQo8L3N2Zz4="},5136(e){e.exports=a},6166(e){e.exports=o},122(e){e.exports=i},992(e){e.exports=h},405(e){e.exports=c},5714(e){e.exports=s},7161(e){e.exports=g},429(e){e.exports=f},5125(e){e.exports=v},318(e){e.exports=m},6968(e){e.exports=b},2083(e){e.exports=y},6076(t){t.exports=e},5314(e){e.exports=r},5299(e){e.exports=u},9780(e){e.exports=d},9155(e){e.exports=l},9514(e){e.exports=p},5272(e){e.exports=n},7315(e){e.exports=t}},S={};function _(e){var t=S[e];if(void 0!==t)return t.exports;var r=S[e]={id:e,exports:{}};return w[e](r,r.exports,_),r.exports}_.m=w,_.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return _.d(t,{a:t}),t},_.d=(e,t)=>{for(var r in t)_.o(t,r)&&!_.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},_.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},_.b="undefined"!=typeof document&&document.baseURI||self.location.href,_.nc=void 0;var O={};_.r(O),_.d(O,{AppearanceManager:()=>wl,AppearanceManagerEvents:()=>bl,CloseButtonPosition:()=>wt,FavoriteStoryList:()=>Up,GoodsWidgetRenderingType:()=>Pt,IASContainer:()=>Gp,IASProvider:()=>yp,IamCheckDisplayTimeRangeError:()=>io,IamFrequencyLimitError:()=>ro,IamMessageLimitExceededError:()=>so,IamMessageOpenError:()=>fo,IamNotFoundByEventError:()=>kn,IamNotFoundByIdError:()=>da,IamNotFoundLimitError:()=>ha,IamOtherReaderIsOpenError:()=>eo,IamShowOnlyIfLoadedError:()=>to,IasNetworkError:()=>L,StackFeedStory:()=>qo,StackedStoryListViewModel:()=>Yo,StoriesListCardCoverQuality:()=>tt,StoriesListCardTitlePosition:()=>et,StoriesListCardTitleTextAlign:()=>Xe,StoriesListCardViewVariant:()=>Ye,StoriesListDirection:()=>rt,StoryFeedType:()=>Re,StoryList:()=>Np,StoryManager:()=>gl,StoryReaderSwipeStyle:()=>Tt,UGCFeedSlug:()=>We,UGCStoryList:()=>Fp,__IAS_INTERNAL_API__:()=>ml,storyManager:()=>fl,useIASProvider:()=>vp});var x={};_.r(x),_.d(x,{__position_outside_bottom:()=>xp.IW,__position_outside_top:()=>xp.i4,"_background-color-black":()=>xp.cw,"_background-color-black-gradient":()=>xp.ZE,"_background-color-blue":()=>xp.Vf,"_background-color-blue-gradient":()=>xp.Yo,"_background-color-green":()=>xp.Qo,"_background-color-green-gradient":()=>xp.F,"_background-color-grey":()=>xp.m4,"_background-color-grey-gradient":()=>xp.dl,"_background-color-red":()=>xp.av,"_background-color-red-gradient":()=>xp.hS,"_background-color-violet":()=>xp.OC,"_background-color-violet-gradient":()=>xp.XW,"_background-color-white":()=>xp.cp,"_background-color-white-gradient":()=>xp.ro,"_background-color-yellow":()=>xp.P2,"_background-color-yellow-gradient":()=>xp.om,"_favorite-cell":()=>xp.Xz,"_format-circle":()=>xp.mW,"_format-quad":()=>xp.zc,"_format-rectangle":()=>xp.Pr,"_has-border-gradient-color":()=>xp.sB,"_has-card-svg-mask":()=>xp.nU,"_has-drop-shadow":()=>xp.jw,"_is-read":()=>xp.B6,_mode_list:()=>xp.a1,"_ugc-cell":()=>xp.m7,"align-center":()=>xp.Yb,"align-left":()=>xp.s$,"align-right":()=>xp.FU,"card-overlay-svg-mask":()=>xp.sr,clamp:()=>xp.qE,default:()=>Cp,"favorite-images-wrapper":()=>xp._m,isTitleCardOutsideBottom:()=>xp.zL,isTitleCardOutsideTop:()=>xp.fT,"stories-slide":()=>xp.Iu,"stories-slide-image":()=>xp.aF,"stories-slide-image__image":()=>xp.nj,"stories-slide-image__wrap":()=>xp.eQ,"stories-slide-wrapper":()=>xp.uk,"stories-slide__content":()=>xp.p_,"stories-slide__inner":()=>xp.aI,"stories-slide__mask":()=>xp.aA,"stories-slide__title":()=>xp._d,"ugc-card-cell":()=>xp.W7,"video-loaded":()=>xp.oe});var k={};_.r(k),_.d(k,{"control-end":()=>jp.yt,"control-end_dir_rtl":()=>jp.Rh,"control-end_reach-end":()=>jp.SV,"control-icon":()=>jp.ED,"control-start":()=>jp.P0,"control-start_dir_rtl":()=>jp.w0,"control-start_reach-start":()=>jp.w2,default:()=>Ip,horizontal:()=>jp.xM,"stories-list-controls":()=>jp.uT,vertical:()=>jp.Vd});_(5016);var C=_(6076),P=_(46),j=_.n(P);class E extends P.EventEmitter{}var I=_(7315);function T(e){return e.replace(/\/$/,"")}function A(e){return e.replace(/^\//,"")}function M(e,t=new FormData,r){const i=e=>"object"!=typeof e||null===e||e instanceof Blob||e instanceof File,s=(e,r)=>{if(null!=e)if(i(e))((e,r)=>{r instanceof Blob||r instanceof File?t.append(e,r):t.append(e,String(r))})(r,e);else{if(Array.isArray(e)){const t=e.every(i);return void e.forEach((e,i)=>{s(e,t?`${r}[]`:`${r}[${i}]`)})}Object.entries(e).forEach(([e,t])=>{s(t,`${r}[${e}]`)})}};return Object.entries(e).forEach(([e,t])=>{s(t,r?`${r}[${e}]`:e)}),t}class L extends Error{constructor(e,t,r){super(t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"networkStatus",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"networkMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="IasNetworkError",this.networkStatus=e,this.networkMessage=t,this.response=null!=r?r:null}static createByRequestError(e){return new L(null,JSON.stringify(e.data),e)}static createByFetchError(e){const t=window.navigator&&window.navigator.onLine;return new L(null,t?"AbortError"===e.name?"The operation was aborted by the AbortController signal. Make sure you don't destroy the InAppStoryManager while it's running.":e.message:"net::ERR_INTERNET_DISCONNECTED")}}function R(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}class B{constructor(){Object.defineProperty(this,"textArea",{enumerable:!0,configurable:!0,writable:!0,value:null})}async copy(e){try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(e):this.copyLegacy(e)}catch(t){this.copyLegacy(e)}}isIOS(){return/ipad|iphone/i.test(navigator.userAgent)}createTextArea(e){this.textArea=document.createElement("textarea"),this.textArea.value=e,document.body.appendChild(this.textArea)}selectText(){if(this.textArea)if(this.isIOS()){const e=document.createRange();e.selectNodeContents(this.textArea);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e)),this.textArea.setSelectionRange(0,999999)}else this.textArea.select()}copyLegacy(e){this.createTextArea(e),this.selectText();try{document.execCommand("copy")}catch(e){console.error("Copy failed:",e)}this.textArea&&(document.body.removeChild(this.textArea),this.textArea=null)}}let D;D=function(){};var N=_(5314);function F(e){return class extends e{constructor(...e){super(...e),Object.defineProperty(this,"_mobxReaction",{enumerable:!0,configurable:!0,writable:!0,value:null})}update(e){this._mobxReaction?this._mobxReaction.track(()=>{super.update(e)}):super.update(e)}connectedCallback(){super.connectedCallback(),this._mobxReaction||(this._mobxReaction=new N.Reaction(`${this.constructor.name||this.nodeName}.update()`,()=>this.requestUpdate())),this.hasUpdated&&this.requestUpdate()}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._mobxReaction)||void 0===e||e.dispose(),this._mobxReaction=null}}}function U(e,t){let r=null;return async function(...t){return r||(r=(async()=>{try{return await e.apply(this,t)}catch(e){throw e}finally{r=null}})(),r)}}function G(e,t){let r=null,i=null;return async function(...t){const s=JSON.stringify(t);if(r===s)return i;try{return i=await e.apply(this,t),r=s,i}catch(e){throw i=null,r=null,e}}}function V(e){return function(t,r){const i=t=>{customElements.get(e)?console.warn(`[IAS] Element "${e}" is already registered. Skipping re-definition`):customElements.define(e,t)};return r&&"function"==typeof r.addInitializer?r.addInitializer(()=>i(t)):i(t),t}}const z=/[\r\n%#()<>?[\\\]^`{|}]/g;function W(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(z,encodeURIComponent)}const $=e=>{const t=/^[\p{L}_\d][\p{L}_\d\-]{0,49}$/u;return e.filter(e=>{const r=t.test(e);return r||console.error(`[IAS]: The tag <${e}> does not match the regular expression <${t.toString()}>`),r})},H=e=>{const t=document.createElement("input");t.setAttribute("type","text"),t.style.position="absolute",t.style.opacity="0.1001",t.style.height="0",t.style.fontSize="16px",t.readOnly=!0,document.body.prepend(t),t.focus();return setTimeout(()=>{e.focus(),t.remove()},300)},q=()=>null!==_.nc&&void 0!==_.nc?_.nc:"";function J(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),()=>r)}const K=["InternalPrimaryFont","InternalSecondaryFont"];function Z(e,t){if(!t)return e;let r=e;for(const e of K)r=J(r,e,`${t}${e}`);return r}const Q=!!(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}}),r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch(e){}return e})()&&{passive:!0};const Y=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();function X(e){let t=null;if(Y){let r=window.localStorage.getItem(e);null!==r&&(0,C.isString)(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}function ee(e,t){Y&&window.localStorage.setItem(e,JSON.stringify(t))}function te(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}function re(e){return e.map(e=>function(e){var t,r,i;if(!e.url)return null;let s={"font-family":null!==(t=e.family)&&void 0!==t?t:"normal",src:`url('${te(String(e.url))}')`,"font-style":null!==(r=e.style)&&void 0!==r?r:"normal","font-weight":null!==(i=e.weight)&&void 0!==i?i:"normal"};e.title&&(s.src+=`, local('${e.title}')`);return`@font-face {${a=s,Object.keys(a).reduce((e,t)=>e+t.split(/(?=[A-Z])/).join("-").toLowerCase()+":"+a[t]+";","")}}\n`;var a}(e)).filter(Boolean).join("")}function ie(e){"fonts"in document?e.forEach(e=>{const t=new FontFace(e.family,`url(${e.url})`,{style:e.style,weight:e.weight,display:"block"});document.fonts.add&&document.fonts.add(t),t.load()}):function(e){const t=re(e);if(null!=t){const e="stories-font-style";let r=document.getElementById(e);null===r?(r=document.createElement("style"),r.type="text/css",r.id=e,r.attributes.setNamedItem(document.createAttribute("scoped")),r.setAttribute("nonce",q()),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t)),document.body.appendChild(r)):r.styleSheet?r.styleSheet.cssText=t:(r.textContent="",r.appendChild(document.createTextNode(t)))}}(e)}let se=null;async function ae(){return null!=se?se:new Promise(e=>{!function(e,t){const r=new Image;r.onload=function(){var i=r.width>0&&r.height>0;t(e,i)},r.onerror=function(){t(e,!1)},r.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"}[e]}("lossy",(t,r)=>{se=r,e(r)})})}function oe(){if(window){var e,t=window.screen;return e="function"==typeof window.ScreenOrientation&&t.orientation instanceof ScreenOrientation&&"function"==typeof t.orientation.addEventListener&&null===t.orientation.onchange&&"string"==typeof t.orientation.type?t.orientation:function(){var e={90:ne.LANDSCAPE_PRIMARY,"-90":ne.LANDSCAPE_SECONDARY,0:ne.PORTRAIT_PRIMARY,180:ne.PORTRAIT_SECONDARY};function t(){}var r=new t,i=function(e){for(var t=["orientationchange","mozorientationchange","msorientationchange"],r=window.screen,i=0;i<t.length;i++)if(null===r["on"+t[i]])return{delegate:r,event:t[i]};if(void 0!==window.onorientationchange)return{delegate:window,event:"orientationchange"};return{delegate:pe(e),event:"change"}}(r);return t.prototype.addEventListener=le("addEventListener",i.delegate,i.event),t.prototype.dispatchEvent=le("dispatchEvent",i.delegate,i.event),t.prototype.removeEventListener=le("removeEventListener",i.delegate,i.event),t.prototype.lock=function(){var e,t="lockOrientation() is not available on this device.",r=window.screen;e=void 0===r?function(){return!1}:"function"==typeof r.msLockOrientation?r.msLockOrientation.bind(r):"function"==typeof r.mozLockOrientation?r.mozLockOrientation.bind(r):function(){return!1};return function(r){const i=window.Promise;return e(r)?i.resolve(r):i.reject(new Error(t))}}(),t.prototype.unlock=function(){var e=window.screen;return e&&e.orientation&&e.orientation.unlock.bind(e.orientation)||e.msUnlockOrientation&&e.msUnlockOrientation.bind(e)||e.mozUnlockOrientation&&e.mozUnlockOrientation.bind(e)||function(){}}(),Object.defineProperties(r,{onchange:{get:function(){return i.delegate["on"+i.event]||null},set:function(e){i.delegate["on"+i.event]=he(e,r)}},type:{get:function(){var t=window.screen;return t.msOrientation||t.mozOrientation||e[window.orientation+""]||(ge().matches?"landscape-primary":"portrait-primary")}},angle:{value:0}}),r}(),e}}var ne;function le(e,t,r){var i=this;return function(){var s=Array.prototype.slice.call(arguments);if("change"===(s[0].type?s[0].type:s[0])){s[0].type?s[0]=ue(r,s[0]):s[0]=r;var a,o,n=he(s[1],i);return"addEventListener"===e&&function(e,t){var r=de.indexOf(e);r>-1?ce[r]=t:(de.push(e),ce.push(t))}(s[1],n),"removeEventListener"===e&&(a=s[1],(o=de.indexOf(a))>-1&&(de.splice(o,1),ce.splice(o,1))),s[1]=n,t[e].apply(t,s)}}}!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(ne||(ne={}));var ce=[],de=[];function he(e,t){var r=de.indexOf(e);return r>-1?ce[r]:function(r){r.target!==t&&fe(r,"target",t),r.currentTarget!==t&&fe(r,"currentTarget",t),"change"!==r.type&&fe(r,"type","change"),e(r)}}function ue(e,t){var r;try{r=new Event(e,t)}catch(e){r={type:"change"}}return r}function pe(e){var t=Object.create({addEventListener:function(e,t){this.listeners[e]||(this.listeners[e]=[]),-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)},dispatchEvent:function(t){this.listeners[t.type]&&(this.listeners[t.type].forEach(function(e){e(t)}),"function"==typeof e.onchange&&e.onchange(t))},removeEventListener:function(e,t){if(this.listeners[e]){var r=this.listeners[e].indexOf(t);r>-1&&this.listeners[e].splice(r,1)}}});t.listeners={};var r=ge();return r&&"boolean"==typeof r.matches&&r.addListener(function(){t.dispatchEvent(ue("change"))}),t}function ge(){return"function"!=typeof window.matchMedia?{}:window.matchMedia("(orientation: landscape)")}function fe(e,t,r){Object.defineProperty(e,t,{value:r})}var me=_(122);const ye="mobile"!==_.n(me)().getParser(window.navigator.userAgent).parse().getPlatformType();function ve(e){if("string"!=typeof e)return null;if(!e.trim())return null;try{const t=JSON.parse(e);return null!=t?t:null}catch(e){return null}}const be=new class{constructor(){Object.defineProperty(this,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_platform",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const e=this.loadOrCreateDeviceData();this._deviceId=e.device_id,this._platform=e.platform}get deviceId(){return this._deviceId}get platform(){return this._platform}loadOrCreateDeviceData(){const e=X("device_data");if(this.isValidDeviceData(e))return e;const t={platform:"web",device_id:(0,I.v4)()};return ee("device_data",t),t}isValidDeviceData(e){return Boolean(e&&"string"==typeof e.device_id&&36===e.device_id.trim().length)}};class we{constructor(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1}async run(e){let t=Promise.resolve(e);for(const e of this.handlers)t=t.then(e.fulfilled,e.rejected);return t}}class Se extends Error{constructor(e){super(`The request with URL <${e}> was aborted. Make sure you don't destroy the InAppStoryManager while it's running.`),this.name="IasAbortRequestError"}}class _e extends Error{constructor(){super("[IAS] Make sure you don't destroy the InAppStoryManager while it's running and pass the config before using the InAppStoryManager API."),this.name="IasConfigReferenceError"}}class Oe{async open(e){const t=await this.getOpenSessionPayload(e);return(await ca.post("session/open",t,{params:{expand:"cache",fields:"session,server_timestamp,user_key,share,preview_aspect_ratio,placeholders,image_placeholders,is_allow_ugc,is_allow_statistic_v2,is_game_reader_default_fullscreen"},meta:{public:!0}})).data}async getOpenSessionPayload(e){const t=await ae(),r={platform:be.platform,features:"animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder,vod,closeStoryApi,slideTimerEndApi,multislideIam,scrollview"};return e.anonymous&&(r.anonymous=e.anonymous),e.anonymous||(r.device_id=be.deviceId),e.userId&&!e.anonymous&&(r.user_id=e.userId,r.user_sign=e.userIdSign),t&&(r.features+=",webp"),r}}var xe;!function(e){e.TEXT="text",e.IMAGE="image"}(xe||(xe={}));class ke{constructor(e,t,r,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"priority",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class Ce extends ke{constructor(e,t){super(xe.IMAGE,e,t,0)}}class Pe extends ke{constructor(e,t){super(xe.TEXT,e,t,2)}}class je extends ke{constructor(e,t){super(xe.IMAGE,e,t,1)}}class Ee extends ke{constructor(e,t){super(xe.TEXT,e,t,3)}}const Ie="default";class Te{get textPlaceholders(){return this._textPlaceholders}get imagePlaceholders(){return this._imagePlaceholders}constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"sessionStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_textPlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_imagePlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expireIn",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"share",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"previewAspectRatio",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"resources",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"isAllowStatisticV2",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontsResources",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"isGameReaderDefaultFullscreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=r.session.id,this.expireIn=r.session.expire_in,this.userKey=r.user_key||Ie,this.previewAspectRatio=r.preview_aspect_ratio,this.share=r.share,this.resources=this.getResources(r),this.fontsResources=this.applyFontPrefix(this.resources.filter(e=>"font-face"===e.type)),this._textPlaceholders=this.mapTextPlaceholders(r.placeholders),this._imagePlaceholders=this.mapImagePlaceholders(r.image_placeholders),this.isAllowStatisticV2=Boolean(r.is_allow_statistic_v2),this.isGameReaderDefaultFullscreen=Boolean(r.is_game_reader_default_fullscreen)}loadResources(){ie(this.fontsResources)}getAllFontFamilies(){return[...new Set(this.fontsResources.map(e=>e.family))]}applyFontPrefix(e){return e.map(e=>Object.assign(Object.assign({},e),{family:`${this.storyManager.config.fontPrefix}${e.family}`}))}getResources(e){return e.cache&&Array.isArray(e.cache)?e.cache:[]}mapTextPlaceholders(e){return e.map(e=>new Pe(e.name,e.default_value))}mapImagePlaceholders(e){return e.map(e=>new Ce(e.name,e.default_value))}}class Ae extends Error{constructor(e){super(`Story with ID ${e} has already been shown to the user`),this.name="IasStoryAlreadyShownError"}}class Me extends Error{constructor(e){super(`Like undefined on story with ID ${e}`),this.name="IasLikeUndefinedError"}}class Le extends Error{constructor(e){super(`Share url undefined on story with ID ${e}`),this.name="IasShareUrlUndefinedError"}}var Re,Be=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},De=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ne=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Fe=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.UGC=1]="UGC",e[e.FAVORITE=2]="FAVORITE",e[e.ONBOARDING=3]="ONBOARDING"}(Re||(Re={}));let Ue=(()=>{var e,t;let r,i,s,a=[],o=[],n=[];return e=class{get _stories(){return Ne(this,t,"f")}set _stories(e){Fe(this,t,e,"f")}constructor(e,r,i){var s;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Be(this,a)}),Object.defineProperty(this,"slug",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasFavorite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cover",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:Re.DEFAULT}),t.set(this,Be(this,o,N.observable.array())),Be(this,n),this.id=e.id,this.slug=e.feedSlug,this.hasFavorite=Boolean(e.hasFavorite),this._cover=ot.createByRawData(null!==(s=e.cover)&&void 0!==s?s:{}),this._stories=r}get stories(){return this._stories}get type(){return this._type}get cover(){return this._cover}get coverSrc(){var e;const t=null===(e=this._cover)||void 0===e?void 0:e.findOneByType("h");return null==t?void 0:t.url}removeById(e){const t=this._stories.findIndex(t=>t.id===e);-1!==t&&(0,N.remove)(this._stories,t.toString())}unshiftStory(e){-1===this._stories.indexOf(e)&&this._stories.unshift(e)}getStoryById(e){return this.stories.find(t=>t.id===e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.action],s=[N.action],De(e,null,r,{kind:"accessor",name:"_stories",static:!1,private:!1,access:{has:e=>"_stories"in e,get:e=>e._stories,set:(e,t)=>{e._stories=t}},metadata:t},o,n),De(e,null,i,{kind:"method",name:"removeById",static:!1,private:!1,access:{has:e=>"removeById"in e,get:e=>e.removeById},metadata:t},null,a),De(e,null,s,{kind:"method",name:"unshiftStory",static:!1,private:!1,access:{has:e=>"unshiftStory"in e,get:e=>e.unshiftStory},metadata:t},null,a),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const Ge="{{__favorite__}}";class Ve extends Ue{constructor(e,t){super(e,t),this._type=Re.FAVORITE}static createByStories(e){return new Ve({feedSlug:Ge},e)}}class ze extends Ue{constructor(e,t,r){super(e,t),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"limit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._type=Re.ONBOARDING,this.tags=r.tags,this.limit=r.limit,this.filterOpenedStories()}static getDefaultSlug(){return"onboarding"}isEqualParams(e){return(0,C.isEqual)(this.tags,e.tags)&&this.limit===e.limit}filterOpenedStories(){this._stories=this._stories.filter(e=>!e.isOpened)}}const We="{{__ugc__}}";class $e extends Ue{constructor(e,t,r={}){super(e,t),Object.defineProperty(this,"_filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._type=Re.UGC,this._filter=r.filter}get filter(){var e;return null!==(e=this._filter)&&void 0!==e?e:null}static createByStories(e,t={}){return new $e({feedSlug:We},e,t)}}class He{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV1Api",{enumerable:!0,configurable:!0,writable:!0,value:t})}sendCoverageEvent(e,t){if(0===e.length)return;const r=e.map(e=>e.id);t.type===Re.DEFAULT&&this.sendCoverageStatistic(r),this.emitFeedImpressionEvent(e,t)}sendDeeplinkClickEvent(e){this.sendStatisticData([1,0,e,0,0])}emitFeedImpressionEvent(e,t){const r={stories:e.map(e=>this.createEventPayloadByStory(e,t)),feed:t.type===Re.DEFAULT?t.slug:null};this.storyManager.emit("feedImpression",r)}sendCoverageStatistic(e){this.sendStatisticData([5,0,...e])}createEventPayloadByStory(e,t){const r={id:e.id,title:e.statTitle,slidesCount:e.slidesCount};return t.type===Re.UGC&&(r.ugcPayload=(0,C.isObject)(e.ugcPayload)?e.ugcPayload:{}),r}async sendStatisticData(e){try{if(this.storyManager.isStatisticsDisabled)return;await this.statisticV1Api.sendStatisticEvent({data:[e]})}catch(e){console.error(e)}}}class qe{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchStorySlides({id:e,feedSlug:t}){const{url:r,params:i}=this.getStoryRequestConfig(e,t);return(await ca.get(r,{params:i})).data}async fetchStory({id:e,feedSlug:t,fetchShareUrl:r,once:i}){const{url:s,params:a}=this.getStoryRequestConfig(e,t,!0,r,i),o=await ca.get(s,{params:a});if(204===o.status&&i)throw new Ae(e.toString());return o.data}async fetchStoryContext({ids:e}){const{url:t,params:r}=this.getStoryContextRequestConfig(e);return(await ca.get(t,{params:r})).data}async fetchStoryCSS(){var e;const{url:t,params:r}=this.getStoryCSSRequestConfig();return null!==(e=(await ca.get(t,{params:r})).data.style)&&void 0!==e?e:""}async setStoryLike(e,t){if(this.storyManager.isStatisticsDisabled)return t;const r=await ca.post(`story-like/${e}`,{value:t});if(null==r.data.like)throw new Me(e);return r.data.like}async setStoryBookmark(e,t){if(this.storyManager.isStatisticsDisabled)return t;return(await ca.post(`story-favorite/${e}`,{value:t})).data.favorite}markStoryAsOpened(e,t){const r=`u/${e}/s_opened`;let i=X(r);Array.isArray(i)||(i=[]);const s=new Set(i);s.add(t),i=Array.from(s),ee(r,i)}async fetchStorySharePath(e){const t=await ca.get(`story-share/${e}`);if(!t.data.url)throw new Le(e);return t.data.url}async updateNarrativeData(e,t){if(!this.storyManager.isStatisticsDisabled)return ca.request({url:"story-data/"+e,method:"put",data:{data:t}})}getStoryRequestConfig(e,t,r=!1,i,s){const a=["slides"];i&&a.push("share_url");const o={url:`${t===We?"ugc/":""}story/${e}`,method:"GET",params:{expand:a.join(",")}};return o.params.once=Number(Boolean(s)),r||null!=o.params&&(o.params.fields=["id","slides"].join(",")),o}getStoryCSSRequestConfig(){return{url:"story-context",method:"GET",params:{fields:"style"}}}getStoryContextRequestConfig(e){return{url:"story-context",method:"GET",params:{id:e.join(","),fields:"widgetsData"}}}}class Je{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcFeed({filter:e,tags:t,testKey:r,options:i}){const s={tags:t.join(","),test:r,f:e&&JSON.stringify(e),options:i};return(await ca.get("ugc/feed",{params:s})).data}async fetchDefaultFeed({feedSlug:e,tags:t,testKey:r,options:i}){const s=`feed/${e}`,a=await ca.post(s,{tags:t.join(","),options:i},{params:{test:r}});return a.data.feedSlug=e,a.data}async fetchFavoriteFeed({tags:e}){return(await ca.get("story",{params:{tags:e.join(","),favorite:1}})).data}async fetchOnboardingFeed(e){const t=`feed/${e.feedSlug}/onboarding`,r=await ca.post(t,{tags:e.tags.join(","),options:e.options},{params:{limit:e.limit}});return r.data.feedSlug=e.feedSlug,r.data}}class Ke{async sendStatisticEvent(e){await ca.sendBeacon("session/update",{data:e.data})}}class Ze{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendStatisticEvent(e,t=!1){try{if(!this.isAllowStatisticV2(t))return;const r=this.getParamsByEvent(e),i=`stat/${e.type}`;"sendBeacon"in navigator?this.sendBeacon(i,r):await this.sendFallbackFetch(i,r)}catch(e){console.error(e)}}getParamsByEvent(e){var t;const r=null===(t=this.storyManager.rootStore.sessionStore.session)||void 0===t?void 0:t.id,i=this.storyManager.config.userId.toString(),s=Date.now();return Object.assign(Object.assign({},e.toQueryParams()),{x_user_agent:this.storyManager.userAgent,s:r,u:i,ts:s})}isAllowStatisticV2(e){var t;if(this.storyManager.config.anonymous)return!1;const r=e||Boolean(null===(t=this.storyManager.rootStore.sessionStore.session)||void 0===t?void 0:t.isAllowStatisticV2);return!(this.storyManager.isStatisticsDisabled||!r)}sendBeacon(e,t){t=new URLSearchParams(t);const r=`${T(ui.apiUrl)}/${A(e)}?${t.toString()}`;navigator.sendBeacon(r)}async sendFallbackFetch(e,t){const r=new na({baseURL:ui.apiUrl});await r.get(e,{params:t})}}var Qe,Ye,Xe,et,tt,rt,it;!function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(Qe||(Qe={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(Ye||(Ye={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(Xe||(Xe={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(et||(et={})),function(e){e.Medium="medium",e.High="high"}(tt||(tt={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(rt||(rt={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(it||(it={}));const st={direction:rt.ROW,card:{title:{font:'16px system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',padding:10.6,textAlign:Xe.START,position:et.CARD_INSIDE_BOTTOM,display:!0,lineClamp:4},gap:10,height:178,aspectRatio:null,coverQuality:tt.High,variant:Ye.RECTANGLE,border:{radius:21,color:"black",width:2,gap:5},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null,opened:{border:{radius:null,color:null,width:null,gap:null,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null},coverLazyLoading:!1},favoriteCard:{title:{content:"Favorite",font:"normal",color:"white",padding:15,textAlign:Xe.START,position:et.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:tt.High,coverLazyLoading:!1,variant:Ye.CIRCLE,border:{radius:0,color:"black",width:2,gap:3,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null,opened:{border:{radius:null,color:null,width:null,gap:null,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null}},sidePadding:20,topPadding:20,bottomPadding:20,bottomMargin:17,layout:{height:"auto",backgroundColor:"transparent",sliderAlign:Qe.START},navigation:{speed:300,showControls:!1,controlsSize:48,controlsBackgroundColor:"white",controlsColor:"black"},autoScrollOnStoryClose:!0,ugcCard:{title:{content:null,font:'16px system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',color:"#000",padding:15,textAlign:Xe.START,position:et.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:tt.High,coverLazyLoading:!1,variant:Ye.CIRCLE,border:{radius:0,color:"transparent",width:0,gap:0,gradient:null},boxShadow:null,dropShadow:null,opacity:null,mask:{color:null,linearGradient:null},svgMask:null,image:{svgSrc:{baseState:'<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M50 85.5C69.6061 85.5 85.5 69.6061 85.5 50C85.5 30.3939 69.6061 14.5 50 14.5C30.3939 14.5 14.5 30.3939 14.5 50C14.5 69.6061 30.3939 85.5 50 85.5Z" stroke="white" stroke-width="2"/>\n<path d="M50.5 34.5V65.5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M34.5 49.5H65.5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n'}},backgroundColor:"#0c62f3"}};class at{constructor(e){Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.width=e.width,this.height=e.height,this.type=e.type,this.url=this.changeUrlProtocol(e.url)}changeUrlProtocol(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}}class ot{constructor(){Object.defineProperty(this,"images",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"gradient",{enumerable:!0,configurable:!0,writable:!0,value:!1})}static createByRawData(e){const t=new ot;for(let r in e)e.hasOwnProperty(r)&&t.images.push(new at(e[r]));return t}findOneByType(e){var t;return null!==(t=this.images.find(t=>t.type===e))&&void 0!==t?t:null}findOneByCoverQuality(e){return this.findOneByType(this.mapCoverQualityToImageType(e))}findOneByWidth(e,t=!1){var r;let i=null;return this.images.forEach(t=>{t.width===e&&(i=t)}),null!==i?i:(i=null!==(r=(0,C.head)(this.images))&&void 0!==r?r:null,t&&null!=i?i:null)}mapCoverQualityToImageType(e){switch(e){case tt.Medium:return"m";case tt.High:return"h"}}}var nt=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},lt=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ct=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},dt=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let ht=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _html(){return ct(this,t,"f")}set _html(e){dt(this,t,e,"f")}get html(){return this._html}constructor(e){var r,i;Object.defineProperty(this,"_rawHtml",{enumerable:!0,configurable:!0,writable:!0,value:(nt(this,s),"")}),t.set(this,nt(this,a,"")),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:nt(this,o)}),Object.defineProperty(this,"timeline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"screenshotShare",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"eventPayload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resources",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resourcesByBlob",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.index=e.index,this.timeline={foreground:e.timeline.foreground,background:e.timeline.background},this.duration=e.duration,this.screenshotShare=e.screenshot_share,this.eventPayload=e.event_payload,this.resources=null!==(i=null===(r=e.resources)||void 0===r?void 0:r.map(e=>({type:e.type,key:e.key,url:e.url,rangeStart:e.range_start,rangeEnd:e.range_end,contentType:e.content_type})))&&void 0!==i?i:[],this._rawHtml=this.replaceSlideNonce(e.html),this._html=this._rawHtml}static createEmpty(){return new e({index:0,timeline:{foreground:"",background:""},duration:0,screenshot_share:!1,html:""})}applyFontPrefix(e){this._rawHtml=Z(this._rawHtml,e),this._html=this._rawHtml}updatePlaceholders(e){let t=this._rawHtml;for(const r of e)t=J(t,`%${r.key}%`,r.value);this._html=t}applyBlobUrls(e,t){var r;let i=this._html;for(const s of e){const e=null===(r=t[s])||void 0===r?void 0:r.blobUrl;e&&(i=J(i,s,e),this._resourcesByBlob[s]=e)}this._html=i}restoreOriginalResourceUrls(){let e=this._html;for(const[t,r]of Object.entries(this._resourcesByBlob))e=J(e,r,t);this._html=e}parseResources(){const e=Array.from(this._html.matchAll(/src="([^"]+)"/gi),e=>e[1]).filter(e=>!e.startsWith("blob:"));return Array.from(new Set(e))}replaceSlideNonce(e){var t;return J(e,"{{nonce}}",null!==(t=q())&&void 0!==t?t:"")}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.computed],lt(e,null,r,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},a,o),lt(e,null,i,{kind:"getter",name:"html",static:!1,private:!1,access:{has:e=>"html"in e,get:e=>e.html},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class ut{constructor(e,t){var r;Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.widgetsData=this.mapStoryContextDto(e,t),this.style=null!==(r=t.style)&&void 0!==r?r:""}mapStoryContextDto(e,t){var r;const i={},s=null!==(r=t.widgetsData)&&void 0!==r?r:{};for(const t in s)Array.isArray(s[t])||(i[t]=s[t][e]);return i}updateNarrativeData(e){this.widgetsData._narrative_saved_data=e}}var pt=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},gt=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ft=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},mt=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let yt=(()=>{var e,t,r,i,s,a,o,n,l,c,d;let h,u,p,g,f,m,y,v,b,w,S,_,O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],F=[],U=[],G=[],V=[],z=[],W=[];return e=class{get _slidesLoaded(){return ft(this,t,"f")}set _slidesLoaded(e){mt(this,t,e,"f")}get _error(){return ft(this,r,"f")}set _error(e){mt(this,r,e,"f")}get _context(){return ft(this,i,"f")}set _context(e){mt(this,i,e,"f")}get _like(){return ft(this,s,"f")}set _like(e){mt(this,s,e,"f")}get _favorite(){return ft(this,a,"f")}set _favorite(e){mt(this,a,e,"f")}get _shareUrl(){return ft(this,o,"f")}set _shareUrl(e){mt(this,o,e,"f")}get _slides(){return ft(this,n,"f")}set _slides(e){mt(this,n,e,"f")}get _isOpened(){return ft(this,l,"f")}set _isOpened(e){mt(this,l,e,"f")}get _canBeShown(){return ft(this,c,"f")}set _canBeShown(e){mt(this,c,e,"f")}get _title(){return ft(this,d,"f")}set _title(e){mt(this,d,e,"f")}constructor(e){var h,u,p,g,f,m,y,v,b,w,S,_,N,$,H,q,J,K,Z,Q,Y,X,ee;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:pt(this,O)}),Object.defineProperty(this,"stringId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"statTitle",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"titleColor",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:{color:"",gradient:!1}}),Object.defineProperty(this,"backgroundColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slidesCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"source",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"deeplink",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInReader",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"disableClose",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"likeFunctional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"favoriteFunctional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shareFunctional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"needPlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"gameInstance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideTimeline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasAudio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasPlaceholder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasSwipeUp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ugcPayload",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_rawTitle",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parsedSlideImage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_videoCoverSrc",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_videoCover",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_wasShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t.set(this,pt(this,x,!1)),r.set(this,(pt(this,k),pt(this,C,null))),i.set(this,(pt(this,P),pt(this,j,void 0))),s.set(this,(pt(this,E),pt(this,I,0))),a.set(this,(pt(this,T),pt(this,A,!1))),o.set(this,(pt(this,M),pt(this,L,null))),n.set(this,(pt(this,R),pt(this,B,[]))),l.set(this,(pt(this,D),pt(this,F,!1))),c.set(this,(pt(this,U),pt(this,G,!1))),d.set(this,(pt(this,V),pt(this,z,void 0))),pt(this,W),this.id=e.id,this._context=new ut(this.id,{style:"",widgetsData:{}}),this._rawTitle=null!==(h=e.title)&&void 0!==h?h:"",this._title=this._rawTitle,this._isOpened=null!==(u=e.is_opened)&&void 0!==u&&u,this.statTitle=null!==(p=e.stat_title)&&void 0!==p?p:"",this.titleColor=null!==(g=e.title_color)&&void 0!==g?g:"",this.background=null!==(f=e.background)&&void 0!==f?f:{},this.backgroundColor=null!==(m=e.background_color)&&void 0!==m?m:"",this.slidesCount=null!==(y=e.slides_count)&&void 0!==y?y:0,this.disableClose=null!==(v=e.disable_close)&&void 0!==v&&v,this.hideInReader=null!==(b=e.hide_in_reader)&&void 0!==b&&b,this.likeFunctional=null!==(w=e.like_functional)&&void 0!==w&&w,this.favoriteFunctional=null!==(S=e.favorite_functional)&&void 0!==S&&S,this.shareFunctional=null!==(_=e.share_functional)&&void 0!==_&&_,this.needPlaceholders=null!==(N=e.need_placeholders)&&void 0!==N&&N,this.gameInstance=e.game_instance,this.hasAudio=null!==($=e.has_audio)&&void 0!==$&&$,this.hasSwipeUp=null!==(H=e.has_swipe_up)&&void 0!==H&&H,this.stringId=null!==(q=e.string_id)&&void 0!==q?q:"",this._like=null!==(J=e.like)&&void 0!==J?J:0,this._favorite=null!==(K=e.favorite)&&void 0!==K&&K,this.deeplink=null!==(Z=e.deeplink)&&void 0!==Z?Z:"",this.hideTimeline=null!==(Q=e.hide_timeline)&&void 0!==Q&&Q,this.ugcPayload=null!==(Y=e.payload)&&void 0!==Y?Y:{},this._shareUrl=null!==(X=e.share_url)&&void 0!==X?X:null,this._image=ot.createByRawData(e.image),this._videoCover=ot.createByRawData(e.video_cover);const te=null!==(ee=e.slides)&&void 0!==ee?ee:[];this.setSlides(te)}get like(){return this._like}get favorite(){return this._favorite}get isOpened(){return this._isOpened}get shareUrl(){return this._shareUrl}get title(){return this._title}get slidesLoaded(){return this._slidesLoaded}get canBeShown(){return this._canBeShown}get error(){return this._error}get slides(){return this._slides}get context(){return this._context}get image(){return this._image}get wasShown(){return this._wasShown}get videoCover(){return this._videoCover}get videoCoverSrc(){if(!1===this._videoCoverSrc)return null;if(null===this._videoCoverSrc){const e=this.videoCover;if(null===e)return this._videoCoverSrc=!1,null;const t=e.findOneByType("h");if(null!==t)return t.url}return"string"==typeof this._videoCoverSrc?this._videoCoverSrc:null}setSlides(e){!this._slidesLoaded&&e.length&&(this._slides=this.mapSlidesByDto(e),this._slidesLoaded=!0)}setCanBeShown(e){this._canBeShown=e}setError(e){this._error=e}setContext(e){this._context=e}setLike(e){this._like=e}setFavorite(e){this._favorite=e}markIsOpened(){this.markWasShown(),this._isOpened=!0}markWasShown(){this._wasShown=!0}setShareUrl(e){this._shareUrl=e}applyFontPrefix(e){for(const t of this.slides)t.applyFontPrefix(e)}updatePlaceholders(e){this.needPlaceholders&&(this.updateSlidesPlaceholders(e),this.updateTitlePlaceholders(e))}updateSlidesPlaceholders(e){for(const t of this.slides)t.updatePlaceholders(e)}updateTitlePlaceholders(e){let t=this._rawTitle;for(const r of e)t=J(t,`%${r.key}%`,r.value);this._title=t}mapSlidesByDto(e){return e.map(e=>new ht(e))}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;h=[N.observable],u=[N.observable],p=[N.observable],g=[N.observable],f=[N.observable],m=[N.observable],y=[N.observable],v=[N.observable],b=[N.observable],w=[N.observable],S=[N.action],_=[N.action],gt(e,null,h,{kind:"accessor",name:"_slidesLoaded",static:!1,private:!1,access:{has:e=>"_slidesLoaded"in e,get:e=>e._slidesLoaded,set:(e,t)=>{e._slidesLoaded=t}},metadata:t},x,k),gt(e,null,u,{kind:"accessor",name:"_error",static:!1,private:!1,access:{has:e=>"_error"in e,get:e=>e._error,set:(e,t)=>{e._error=t}},metadata:t},C,P),gt(e,null,p,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},j,E),gt(e,null,g,{kind:"accessor",name:"_like",static:!1,private:!1,access:{has:e=>"_like"in e,get:e=>e._like,set:(e,t)=>{e._like=t}},metadata:t},I,T),gt(e,null,f,{kind:"accessor",name:"_favorite",static:!1,private:!1,access:{has:e=>"_favorite"in e,get:e=>e._favorite,set:(e,t)=>{e._favorite=t}},metadata:t},A,M),gt(e,null,m,{kind:"accessor",name:"_shareUrl",static:!1,private:!1,access:{has:e=>"_shareUrl"in e,get:e=>e._shareUrl,set:(e,t)=>{e._shareUrl=t}},metadata:t},L,R),gt(e,null,y,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},B,D),gt(e,null,v,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:t},F,U),gt(e,null,b,{kind:"accessor",name:"_canBeShown",static:!1,private:!1,access:{has:e=>"_canBeShown"in e,get:e=>e._canBeShown,set:(e,t)=>{e._canBeShown=t}},metadata:t},G,V),gt(e,null,w,{kind:"accessor",name:"_title",static:!1,private:!1,access:{has:e=>"_title"in e,get:e=>e._title,set:(e,t)=>{e._title=t}},metadata:t},z,W),gt(e,null,S,{kind:"method",name:"setSlides",static:!1,private:!1,access:{has:e=>"setSlides"in e,get:e=>e.setSlides},metadata:t},null,O),gt(e,null,_,{kind:"method",name:"setCanBeShown",static:!1,private:!1,access:{has:e=>"setCanBeShown"in e,get:e=>e.setCanBeShown},metadata:t},null,O),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class vt{constructor(e){Object.defineProperty(this,"storyId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activeSlideIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"feedSlug",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storyId=e.storyId,this.activeSlideIndex=e.activeSlideIndex,this.feedSlug=e.feedSlug}toQueryParams(){return{i:this.storyId,si:this.activeSlideIndex,f:this.feedSlug}}}var bt,wt;!function(e){e.Next="next",e.Prev="prev",e.SwipeClose="swipe-close",e.ButtonClose="button-close",e.CustomClose="custom-close",e.AutoClose="auto-close",e.AppClose="app-close"}(bt||(bt={}));class St extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{c:this.payload.cause,st:this.payload.totalSlides,d:this.payload.durationMs})}}!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(wt||(wt={}));const _t={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:wt.END,loader:{default:{color:"white",accentColor:"transparent"},custom:null},closeButton:{svgSrc:{baseState:'<svg width="32" height="32" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.8309 10.0424C10.0969 9.77646 10.5281 9.77646 10.7941 10.0424L15 14.2483L19.2059 10.0424C19.4719 9.77646 19.9031 9.77646 20.1691 10.0424C20.4351 10.3084 20.4351 10.7397 20.1691 11.0057L15.9632 15.2115L20.1691 19.4174C20.4351 19.6834 20.4351 20.1147 20.1691 20.3807C19.9031 20.6466 19.4719 20.6466 19.2059 20.3807L15 16.1748L10.7941 20.3807C10.5281 20.6466 10.0969 20.6466 9.8309 20.3807C9.56492 20.1147 9.56492 19.6834 9.8309 19.4174L14.0368 15.2115L9.8309 11.0057C9.56492 10.7397 9.56492 10.3084 9.8309 10.0424Z" fill="currentColor"/>\n</svg>'}},forceDesktopMode:void 0};var Ot;!function(e){e.Text="text",e.Link="link",e.Image="image"}(Ot||(Ot={}));const xt={label:"X",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="0 0 195 195" xmlns="http://www.w3.org/2000/svg">\n<g transform="matrix(.20227 0 0 .20302 -71 -26.7)">\n<circle cx="834.3" cy="610.6" r="481.3" stroke="#fff" strokeMiterlimit="10"/>\n<path d="m537.8 331.8 230 307.6-231.4 250.1h52.2l202.6-219 163.8 219h177.3l-243-324.9 215.5-232.8h-52l-187 201.7-150.7-201.7zm76.6 38.4h81.5l359.7 481h-81.5z" fill="#fff"/>\n</g>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://twitter.com/share?url=${e}&text=${t}`},kt={targets:["vk","ok","facebook","x","linkedin","telegram"],targetParams:{vk:{label:"VK",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">\n<circle cx="24" cy="24" r="21.3" fill="#fff"/>\n<path d="M22.3.7a23.3 23.3 0 0 0-5 45.6A23.4 23.4 0 0 0 30.7 1.7C28 .8 25.2.6 22.3.7Zm1.8 14.5c1.2.1 1.8.3 2 .6l.3.6c.2.4.2.8 0 4.3 0 2.2 0 2.9.2 3.4s.7.8 1.1.6a8 8 0 0 0 1.8-2 29 29 0 0 0 3-5.8c.3-.4.5-.7.8-.8h7.1a.7.7 0 0 1 .5.8c0 .7-.8 2.2-2 4a92.7 92.7 0 0 1-3.5 4.8c-.3.5-.2 1 .2 1.6l1.4 1.4c1.8 1.7 2.6 2.6 3.3 3.6.4.7.6 1.2.5 1.7 0 .2-.2.5-.5.6-.4.2-.9.2-3.7.3H34l-.5-.1c-1-.4-1.8-1-3.5-3-.9-1-1.6-1.5-2-1.5-.5 0-1 .6-1.3 1.3-.1.5-.2.8-.2 1.7-.1 1-.2 1.2-.8 1.5H22a9.5 9.5 0 0 1-4.2-1.4c-1.9-1.1-3-2.2-4.4-3.8a48.7 48.7 0 0 1-7.2-12.5c-.1-.5 0-.9.5-1l3-.1h3c.5.3.7.5 1 1.4L16 22c.5.9 1 1.6 1.5 2 .6.6.9.7 1.3.7.3 0 .4-.1.6-.6.5-1 .6-4.8.1-6.3-.2-.8-.6-1.1-1.7-1.3-.2 0-.2-.2 0-.4.4-.6 1.1-.9 2.6-1H24Z" fill="#45668E"/>\n</svg>'}},getUrl:({url:e,text:t})=>`https://vk.com/share.php?url=${e}&title=${t}`},facebook:{label:"Facebook",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="126.4 2.3 589 589" xmlns="http://www.w3.org/2000/svg">\n<circle cx="420.9" cy="296.8" r="294.5" fill="#3c5a9a"/>\n<path d="M516.7 92.7h-65.2c-38.8 0-81.8 16.3-81.8 72.4.2 19.5 0 38.3 0 59.3h-44.8v71.3h46.2V501h84.8V294.4h56l5-70.2h-62.4V184c0-22.2 23-21 24.4-21h37.8V92.8z" fill="#fff"/>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://www.facebook.com/sharer.php?u=${e}&t=${t}`},x:xt,twitter:xt,linkedin:{label:"LinkedIn",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" enableBackground="new 0 0 550 550" version="1.1" viewBox="0 0 550 550" xmlSpace="preserve" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">\n<circle cx="275" cy="275" r="256" fill="#04689B"/>\n<path d="m219.2 366.5h-38.8v-124.3h38.8v124.3zm-20.4-139.9h-0.3c-14.1 0-23.2-9.5-23.2-21.6 0-12.3 9.4-21.6 23.7-21.6s23.1 9.3 23.4 21.5c0.1 12.2-9 21.7-23.6 21.7zm175.8 139.9h-44v-64.3c0-16.8-6.9-28.3-22-28.3-11.6 0-18 7.7-21 15.2-1.1 2.7-0.9 6.4-0.9 10.2v67.3h-43.7s0.6-113.9 0-124.3h43.6v19.5c2.6-8.5 16.5-20.7 38.8-20.7 27.6 0 49.3 17.9 49.3 56.4v69z" fill="#fff"/>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://www.linkedin.com/sharing/share-offsite/?url=${e}&title=${t}`},telegram:{label:"Telegram",icon:{svgSrc:{baseState:'<svg data-v-05f1b0f5="" data-v-b5b60290="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50px" height="50px"><defs data-v-05f1b0f5=""><linearGradient data-v-05f1b0f5="" id="a" x1="120" y1="240" x2="120" gradientUnits="userSpaceOnUse"><stop data-v-05f1b0f5="" offset="0" stop-color="#1d93d2"></stop><stop data-v-05f1b0f5="" offset="1" stop-color="#38b0e3"></stop></linearGradient></defs><circle data-v-05f1b0f5="" cx="120" cy="120" r="120" fill="url(#a)"></circle><path data-v-05f1b0f5="" d="m81.2 128.8 14.3 39.4s1.7 3.7 3.7 3.7 30.2-29.5 30.2-29.5l31.5-61-79.2 37.2Z" fill="#c8daea"></path><path data-v-05f1b0f5="" d="m100.1 138.9-2.7 29s-1.2 9 7.7 0 17.4-15.7 17.4-15.7" fill="#a9c6d8"></path><path data-v-05f1b0f5="" d="m81.5 130.2-29.3-9.6s-3.5-1.4-2.4-4.6c.3-.7.7-1.2 2.1-2.2C58.4 109.3 172 68.4 172 68.4s3.2-1 5.1-.3a2.8 2.8 0 0 1 2 2 9.4 9.4 0 0 1 .2 2.6l-.2 2.6c-.7 11.1-21.4 94.4-21.4 94.4s-1.2 5-5.7 5a8.1 8.1 0 0 1-5.9-2.2 797.1 797.1 0 0 0-45.5-32.2 1.3 1.3 0 0 1-.5-.9c-.1-.4.4-1 .4-1s52.4-46.6 53.8-51.5c.1-.4-.3-.6-.8-.4C150 87.8 89.6 125.9 83 130a3.2 3.2 0 0 1-1.5 0Z" fill="#fff"></path></svg>\n'}},getUrl:({url:e,text:t})=>`https://t.me/share/url?url=${e}&text=${t}`},ok:{label:"OK",icon:{svgSrc:{baseState:'\n<svg width="50px" height="50px" viewBox="0 0 388.4 387.1" xmlSpace="preserve" xmlns="http://www.w3.org/2000/svg">\n<path d="M331.7 330.2a194.2 193.5 0 0 1-273.9 1.1 194.2 193.5 0 0 1-2.6-272.9A194.2 193.5 0 0 1 329 54.2a194.2 193.5 0 0 1 5.7 273" fill="#faab62" style="mixBlendMode:normal"/>\n<path d="m328.7 327.1a189.2 188.5 0 0 1-266.9 1.2 189.2 188.5 0 0 1-2.5-266 189.2 188.5 0 0 1 266.7-4 189.2 188.5 0 0 1 5.6 265.9" fill="#f7931e" style="mixBlendMode:normal"/>\n<g fill="#fff" style="mixBlendMode:normal">\n<path d="m217.4 253.5c28-5.7 44.7-19 45.6-19.7a19 19 0 0 0-23.8-29.6c-0.2 0.1-18 13.8-47.5 13.8a84.5 84.5 0 0 1-47.8-13.8 19 19 0 0 0-23.8 29.6c1 0.7 18.4 14.3 47.1 19.9l-40 41.9a19 19 0 1 0 27.3 26.3l37.2-39.6 41 39.9a19 19 0 1 0 26.9-26.9z"/>\n<path transform="translate(-1.8 .2)" d="m194.5 57.9a69.9 69.9 0 1 0 0 139.8 69.9 69.9 0 0 0 0-139.8zm0 98.8a28.9 28.9 0 1 1 0-57.8 28.9 28.9 0 0 1 0 57.8z" style="mixBlendMode:normal"/>\n</g>\n</svg>\n'}},getUrl:({url:e,text:t})=>`https://connect.ok.ru/offer?url=${e}&title=${t}`}},copyButton:{label:"Copy link",getLabel:({url:e,text:t,type:r})=>{var i;return r===Ot.Link?null!==(i=kt.copyButton.label)&&void 0!==i?i:"Copy link":r===Ot.Text?"Copy text":""},svgSrc:{baseState:'<svg width="30px" height="30px" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 20"><path d="M6.6 0a2 2 0 0 0-2 2v12c0 1.2.9 2 2 2h9a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2h-9Zm0 2h9v12h-9V2Z" fill="currentColor"/><path d="M2.6 20a2 2 0 0 1-2-2V5h2v13h10v2h-10Z" fill="currentColor"/></svg>',doneState:'<svg width="30px" height="30px" fill="none" viewBox="0 0 386 264" xmlns="http://www.w3.org/2000/svg">\n<path d="m379.05 7.3156c8.855 8.8533 8.855 23.207 0 32.06l-210.67 210.67c-17.707 17.707-46.414 17.707-64.121 0l-97.319-97.319c-8.8531-8.855-8.8531-23.208 0-32.061 8.853-8.853 23.207-8.853 32.06 0l97.319 97.319 210.67-210.67c8.852-8.8531 23.206-8.8531 32.058 0z" clip-rule="evenodd" fill="currentColor" fill-rule="evenodd"/>\n</svg>'}},downloadButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="currentColor"><path d="M31 22a1 1 0 0 0-1 1v7H2v-7a1 1 0 0 0-2 0v8c0 .6.4 1 1 1h30c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"/><path d="M15.3 23.7c.4.4 1 .4 1.4 0l7-6.9c.4-.4.4-1 0-1.4a1 1 0 0 0-1.4 0L17 20.6V1a1 1 0 0 0-2 0v19.6l-5.3-5.2a1 1 0 0 0-1.4 0 1 1 0 0 0 0 1.4l7 7z"/></g></svg>'}},title:{favicon:{background:"white",display:!0},getValue:({url:e,text:t})=>e||t||""},background:"#202125",borderRadius:20,divider:{background:"#36373b"},text:{color:"white",font:"inherit"}},Ct={borderRadius:5,loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:_t.forceDesktopMode,forceCheckOrientation:!0,sharePanel:kt};var Pt;!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(Pt||(Pt={}));const jt={goodsWidgetRenderingType:Pt.DEFAULT,goodsList:{renderingType:Pt.DEFAULT,closeBackgroundColor:"#000000",substrateHeight:200,substrateColor:"#FFFFFF",dimColor:"rgba(0, 0, 0, 0.5)"},goodsCard:{mainTextColor:"#000000",oldPriceTextColor:"#CCCCCC",imageBackgroundColor:"transparent",imageCornerRadius:8},openGoodsWidgetHandler:e=>Promise.resolve(e),loader:{default:{color:"gray",accentColor:"transparent"}}};var Et,It,Tt,At;!function(e){e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(Et||(Et={})),function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader",e.BANNERS="banners"}(It||(It={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(Tt||(Tt={})),function(e){e.Classic="classic",e.Modern="modern"}(At||(At={}));const Mt={scrollStyle:Tt.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,useExperimentalModernVariant:!1,layout:At.Classic,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:kt,commonBackdrop:{color:"rgba(51, 51, 51, 1)",backdropFilter:null},slideBackdrop:{opacity:.56,blur:30,linearGradientOverlay:["rgba(0, 0, 0, 0.1) 0%","rgba(0, 0, 0, 0.9) 100%"]},faviconApiUrl:"",navigation:{prevButton:{svgSrc:{baseState:'<svg width="24" height="24" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M19.8076 6.80761L9.20101 17.4142L7.7868 16L18.3934 5.3934L19.8076 6.80761Z" fill="currentColor" />\n <path d="M18.3934 26.6066L7.7868 16L9.20101 14.5858L19.8076 25.1924L18.3934 26.6066Z" fill="currentColor" />\n </svg>'}},nextButton:{svgSrc:{baseState:'<svg width="24" height="24" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.1924 25.1924L22.799 14.5858L24.2132 16L13.6066 26.6066L12.1924 25.1924Z" fill="currentColor" />\n <path d="M13.6066 5.3934L24.2132 16L22.799 17.4142L12.1924 6.80761L13.6066 5.3934Z" fill="currentColor" />\n </svg>'}}},likeButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.96277 15.177L8.11552 15.1837C8.75334 15.1873 9.26846 15.7054 9.26846 16.3433V22.7329C9.26846 23.376 8.74519 23.8962 8.10215 23.8925L6.94939 23.8859C6.31157 23.8822 5.79645 23.3641 5.79645 22.7263V16.3366C5.79645 15.6936 6.31972 15.1733 6.96277 15.177Z" stroke="white" stroke-width="1.21546"/>\n<path d="M11.2546 15.0917L11.3801 23.0645C11.3867 23.4802 11.6013 23.8648 11.9516 24.0886C12.119 24.1955 12.4834 24.2735 12.4834 24.2735L13.1084 24.3569L13.9973 24.4541L15.9789 24.5912L17.4834 24.6365H18.9642L19.282 24.6229C19.7715 24.6018 20.258 24.5358 20.7354 24.4256L21.1038 24.3406C21.3122 24.2925 21.516 24.2263 21.7128 24.1428L21.7439 24.1295C22.0493 23.9999 22.3342 23.8269 22.59 23.6157L22.717 23.5108C22.873 23.382 23.0108 23.2326 23.1265 23.0666L23.1451 23.04C23.2426 22.9003 23.3217 22.7485 23.3804 22.5886L23.428 22.4586C23.5278 22.1867 23.5473 21.8918 23.4842 21.6092L23.4296 21.3645C23.4285 21.3594 23.4265 21.3544 23.4237 21.3499C23.4102 21.3285 23.4163 21.3002 23.4374 21.2862L23.7911 21.0504V21.0504C23.8452 21.0143 23.8957 20.9723 23.9416 20.9263V20.9263C23.99 20.8728 24.0444 20.8083 24.0805 20.7458L24.1361 20.6625C24.2924 20.3945 24.3931 20.0167 24.4083 19.7069L24.4118 19.6352C24.4205 19.458 24.4079 19.2804 24.3744 19.1062L24.3305 18.8986C24.325 18.8696 24.2749 18.7163 24.2611 18.6902L24.1718 18.5154C24.1644 18.5014 24.1898 18.473 24.1898 18.473L24.3653 18.2658C24.4983 18.1109 24.6033 17.9305 24.673 17.7386C24.7222 17.6035 24.7532 17.4657 24.775 17.3153L24.7889 17.1764L24.7957 17.0468C24.8164 16.8366 24.7978 16.6244 24.7409 16.421C24.6929 16.2496 24.6183 16.0868 24.5198 15.9385L24.1983 15.4542C24.1843 15.4367 24.1808 15.413 24.1891 15.3922L24.3081 15.1055C24.3652 14.9628 24.4224 14.6641 24.4391 14.4717L24.4307 14.2984C24.4026 14.0113 24.2405 13.6815 24.0757 13.4238L23.9912 13.3055C23.7236 12.9608 23.3474 12.7334 22.9388 12.5804L22.706 12.4932C22.3923 12.3758 22.0667 12.3327 21.7279 12.2916L21.3444 12.2597C20.89 12.2378 20.2444 12.2651 19.7945 12.3327L18.1092 12.5861C18.1014 12.5873 18.0935 12.5879 18.0857 12.5879H18.0692C17.991 12.5879 17.9276 12.5245 17.9276 12.4462C17.9276 12.4387 17.9282 12.4312 17.9293 12.4238L18.1222 11.3847L18.5408 9.72426C18.6303 9.39087 18.6888 9.04995 18.7158 8.70582L18.7581 8.1657C18.7857 7.81269 18.746 7.45764 18.6411 7.11944L18.6144 7.03332C18.52 6.72899 18.3649 6.44697 18.1583 6.20434L18.1116 6.14941C17.819 5.80563 17.4249 5.56351 16.9859 5.45788L16.7169 5.39313C16.4437 5.32739 16.1567 5.3518 15.8986 5.46269C15.6593 5.56548 15.4564 5.73766 15.316 5.95699L15.2994 5.98302C15.155 6.20866 15.0783 6.47094 15.0783 6.73882V7.10777C15.0783 7.45352 15.0109 7.79596 14.88 8.11598L14.1668 9.85969C13.9176 10.4691 13.6196 11.0573 13.2758 11.6188L12.5778 12.7586C12.4514 12.9651 12.3013 13.1561 12.1306 13.3278L12.0855 13.3731C11.6243 13.837 11.3317 14.442 11.2546 15.0917Z" stroke="white" stroke-width="1.21546"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.96277 15.1771L8.11552 15.1838C8.75334 15.1875 9.26846 15.7056 9.26846 16.3434V22.733C9.26846 23.3761 8.74519 23.8964 8.10215 23.8926L6.94939 23.886C6.31157 23.8823 5.79645 23.3642 5.79645 22.7264V16.3368C5.79645 15.6937 6.31972 15.1734 6.96277 15.1771Z" fill="white" stroke="white" stroke-width="1.21546"/>\n<path d="M11.2546 15.0918L11.3801 23.0646C11.3867 23.4803 11.6013 23.8649 11.9516 24.0888C12.119 24.1957 12.4834 24.2737 12.4834 24.2737L13.1084 24.357L13.9973 24.4542L15.9789 24.5913L17.4834 24.6367H18.9642L19.282 24.623C19.7715 24.6019 20.258 24.5359 20.7354 24.4257L21.1038 24.3407C21.3122 24.2926 21.516 24.2264 21.7128 24.1429L21.7439 24.1297C22.0493 24.0001 22.3342 23.827 22.59 23.6158L22.717 23.5109C22.873 23.3821 23.0108 23.2327 23.1265 23.0668L23.1451 23.0401C23.2426 22.9004 23.3217 22.7487 23.3804 22.5887L23.428 22.4588C23.5278 22.1868 23.5473 21.892 23.4842 21.6093L23.4296 21.3647C23.4285 21.3595 23.4265 21.3545 23.4237 21.3501C23.4102 21.3286 23.4163 21.3004 23.4374 21.2863L23.7911 21.0505V21.0505C23.8452 21.0144 23.8957 20.9724 23.9416 20.9265V20.9265C23.99 20.8729 24.0444 20.8084 24.0805 20.7459L24.1361 20.6626C24.2924 20.3946 24.3931 20.0168 24.4083 19.707L24.4118 19.6353C24.4205 19.4581 24.4079 19.2805 24.3744 19.1063L24.3305 18.8987C24.325 18.8697 24.2749 18.7165 24.2611 18.6904L24.1718 18.5155C24.1644 18.5015 24.1898 18.4732 24.1898 18.4732L24.3653 18.2659C24.4983 18.1111 24.6033 17.9306 24.673 17.7387C24.7222 17.6036 24.7532 17.4658 24.775 17.3154L24.7889 17.1765L24.7957 17.0469C24.8164 16.8367 24.7978 16.6245 24.7409 16.4211C24.6929 16.2497 24.6183 16.0869 24.5198 15.9386L24.1983 15.4543C24.1843 15.4368 24.1808 15.4131 24.1891 15.3923L24.3081 15.1056C24.3652 14.9629 24.4224 14.6642 24.4391 14.4718L24.4307 14.2985C24.4026 14.0114 24.2405 13.6817 24.0757 13.4239L23.9912 13.3056C23.7236 12.9609 23.3474 12.7336 22.9388 12.5805L22.706 12.4934C22.3923 12.3759 22.0667 12.3329 21.7279 12.2918L21.3444 12.2598C20.89 12.2379 20.2444 12.2652 19.7945 12.3329L18.1092 12.5863C18.1014 12.5874 18.0935 12.588 18.0857 12.588H18.0692C17.991 12.588 17.9276 12.5246 17.9276 12.4464C17.9276 12.4389 17.9282 12.4313 17.9293 12.4239L18.1222 11.3849L18.5408 9.72438C18.6303 9.391 18.6888 9.05007 18.7158 8.70594L18.7581 8.16582C18.7857 7.81281 18.746 7.45776 18.6411 7.11956L18.6144 7.03344C18.52 6.72911 18.3649 6.4471 18.1583 6.20446L18.1116 6.14953C17.819 5.80575 17.4249 5.56363 16.9859 5.458L16.7169 5.39325C16.4437 5.32751 16.1567 5.35192 15.8986 5.46281C15.6593 5.5656 15.4564 5.73778 15.316 5.95711L15.2994 5.98314C15.155 6.20878 15.0783 6.47106 15.0783 6.73895V7.10789C15.0783 7.45364 15.0109 7.79608 14.88 8.1161L14.1668 9.85982C13.9176 10.4692 13.6196 11.0574 13.2758 11.6189L12.5778 12.7588C12.4514 12.9652 12.3013 13.1562 12.1306 13.3279L12.0855 13.3732C11.6243 13.8371 11.3317 14.4421 11.2546 15.0918Z" fill="white" stroke="white" stroke-width="1.21546"/>\n</svg>'}},dislikeButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M24.2033 13.6632C24.2033 14.3062 23.68 14.8265 23.037 14.8228L21.8842 14.8161C21.2464 14.8125 20.7313 14.2944 20.7313 13.6565V7.2669C20.7313 6.62385 21.2546 6.10359 21.8976 6.1073L23.0504 6.11395C23.6882 6.11762 24.2033 6.63572 24.2033 7.27355V13.6632Z" stroke="white" stroke-width="1.21547"/>\n<path d="M18.7451 14.9082L18.6196 6.93531C18.6131 6.51965 18.3984 6.13499 18.0481 5.91118C17.8808 5.80428 17.5164 5.72628 17.5164 5.72628L16.8914 5.64295L16.0025 5.54572L14.0208 5.4086L12.5164 5.36328H11.0356L10.7178 5.37695C10.2283 5.398 9.74173 5.46403 9.26432 5.57421L8.89596 5.65921C8.68758 5.7073 8.4838 5.7735 8.28695 5.85706L8.25581 5.87027C7.95049 5.99987 7.66551 6.17296 7.40975 6.38416L7.28278 6.48901C7.12677 6.61783 6.989 6.76725 6.87323 6.93318L6.85466 6.95981C6.75716 7.09955 6.67809 7.25128 6.6194 7.41124L6.57172 7.54119C6.47196 7.81311 6.45245 8.10797 6.51553 8.39066L6.57011 8.63528C6.57127 8.64045 6.57329 8.64539 6.5761 8.64989C6.58951 8.67134 6.58343 8.69958 6.56238 8.71361L6.20864 8.94944V8.94944C6.15453 8.98551 6.10408 9.0275 6.05811 9.07348V9.07348C6.00973 9.12703 5.95532 9.19155 5.91922 9.25403L5.86366 9.33737C5.70735 9.60533 5.60662 9.98309 5.59145 10.2929L5.58794 10.3646C5.57927 10.5418 5.59182 10.7194 5.62532 10.8937L5.66922 11.1012C5.6748 11.1302 5.72484 11.2835 5.73866 11.3096L5.82792 11.4845C5.83532 11.4984 5.80994 11.5268 5.80994 11.5268L5.63444 11.734C5.50143 11.8889 5.3965 12.0693 5.32674 12.2612C5.27758 12.3964 5.24658 12.5341 5.22478 12.6846L5.21089 12.8235L5.20405 12.953C5.18333 13.1632 5.20192 13.3755 5.25887 13.5788C5.30686 13.7503 5.38145 13.9131 5.47991 14.0614L5.80147 14.5456C5.81547 14.5631 5.81898 14.5868 5.81066 14.6076L5.69163 14.8944C5.63456 15.037 5.57739 15.3357 5.56065 15.5282L5.5691 15.7014C5.5972 15.9885 5.75924 16.3183 5.92402 16.576L6.00853 16.6943C6.2762 17.039 6.65231 17.2664 7.06099 17.4194L7.2938 17.5066C7.60742 17.624 7.93309 17.6671 8.27189 17.7082L8.65531 17.7401C9.10973 17.762 9.75538 17.7347 10.2053 17.6671L11.8906 17.4137C11.8984 17.4125 11.9062 17.4119 11.9141 17.4119H11.9305C12.0088 17.4119 12.0722 17.4753 12.0722 17.5536C12.0722 17.5611 12.0716 17.5686 12.0704 17.576L11.8775 18.6151L11.459 20.2756C11.3695 20.6089 11.3109 20.9499 11.284 21.294L11.2417 21.8341C11.214 22.1871 11.2537 22.5422 11.3586 22.8804L11.3853 22.9665C11.4797 23.2708 11.6349 23.5528 11.8414 23.7955L11.8882 23.8504C12.1808 24.1942 12.5749 24.4363 13.0138 24.5419L13.2829 24.6067C13.556 24.6724 13.8431 24.648 14.1012 24.5371C14.3404 24.4343 14.5434 24.2622 14.6837 24.0428L14.7004 24.0168C14.8448 23.7912 14.9215 23.5289 14.9215 23.261V22.892C14.9215 22.5463 14.9888 22.2039 15.1197 21.8838L15.8329 20.1401C16.0821 19.5308 16.3801 18.9425 16.7239 18.381L17.4219 17.2412C17.5483 17.0347 17.6984 16.8437 17.8691 16.6721L17.9142 16.6267C18.3755 16.1629 18.668 15.5578 18.7451 14.9082Z" stroke="white" stroke-width="1.21547"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M24.2035 13.6629C24.2035 14.3059 23.6803 14.8262 23.0372 14.8225L21.8845 14.8158C21.2466 14.8122 20.7315 14.2941 20.7315 13.6562V7.26655C20.7315 6.62348 21.2548 6.10322 21.8978 6.10693L23.0506 6.11358C23.6884 6.11725 24.2035 6.63535 24.2035 7.27319V13.6629Z" fill="white" stroke="white" stroke-width="1.21547"/>\n<path d="M18.7454 14.9079L18.6199 6.93496C18.6133 6.51929 18.3987 6.13463 18.0484 5.91082C17.881 5.80392 17.5166 5.72592 17.5166 5.72592L16.8916 5.64258L16.0027 5.54536L14.021 5.40824L12.5166 5.36292H11.0358L10.718 5.37659C10.2285 5.39764 9.74192 5.46367 9.26451 5.57384L8.89614 5.65885C8.68776 5.70694 8.48398 5.77314 8.28713 5.8567L8.25599 5.86991C7.95066 5.99951 7.66569 6.1726 7.40992 6.3838L7.28295 6.48865C7.12694 6.61747 6.98917 6.7669 6.8734 6.93283L6.85483 6.95946C6.75733 7.0992 6.67826 7.25093 6.61957 7.41088L6.57189 7.54084C6.47212 7.81276 6.45262 8.10762 6.5157 8.39032L6.57028 8.63494C6.57143 8.64011 6.57346 8.64505 6.57627 8.64954C6.58968 8.671 6.5836 8.69923 6.56255 8.71327L6.2088 8.9491C6.1547 8.98517 6.10425 9.02716 6.05827 9.07314C6.0099 9.12669 5.95549 9.19121 5.91938 9.25369L5.86383 9.33703C5.70751 9.60499 5.60678 9.98276 5.59161 10.2926L5.58811 10.3643C5.57943 10.5415 5.59198 10.7191 5.62549 10.8933L5.66938 11.1009C5.67496 11.1299 5.72501 11.2831 5.73883 11.3092L5.82808 11.4841C5.83549 11.4981 5.8101 11.5264 5.8101 11.5264L5.63461 11.7337C5.50159 11.8886 5.39666 12.069 5.3269 12.2609C5.27775 12.396 5.24674 12.5338 5.22494 12.6842L5.21105 12.8231L5.20421 12.9527C5.18349 13.1629 5.20208 13.3751 5.25903 13.5785C5.30702 13.7499 5.38161 13.9128 5.48007 14.061L5.80163 14.5453C5.81564 14.5628 5.81915 14.5865 5.81082 14.6073L5.69179 14.894C5.63472 15.0367 5.57755 15.3354 5.56081 15.5279L5.56926 15.7011C5.59737 15.9882 5.7594 16.318 5.92419 16.5757L6.0087 16.694C6.27636 17.0387 6.65248 17.2661 7.06116 17.4191L7.29397 17.5063C7.6076 17.6237 7.93327 17.6668 8.27207 17.7079L8.65549 17.7398C9.10991 17.7617 9.75557 17.7344 10.2055 17.6668L11.8908 17.4134C11.8986 17.4122 11.9064 17.4116 11.9143 17.4116H11.9307C12.009 17.4116 12.0724 17.4751 12.0724 17.5533C12.0724 17.5608 12.0718 17.5683 12.0706 17.5757L11.8777 18.6148L11.4592 20.2753C11.3697 20.6087 11.3111 20.9496 11.2842 21.2937L11.2419 21.8339C11.2142 22.1869 11.2539 22.5419 11.3588 22.8801L11.3855 22.9662C11.4799 23.2706 11.6351 23.5526 11.8416 23.7952L11.8884 23.8502C12.181 24.1939 12.5751 24.4361 13.014 24.5417L13.2831 24.6064C13.5562 24.6722 13.8433 24.6478 14.1014 24.5369C14.3407 24.4341 14.5436 24.2619 14.6839 24.0426L14.7006 24.0166C14.845 23.7909 14.9217 23.5286 14.9217 23.2607V22.8918C14.9217 22.546 14.989 22.2036 15.1199 21.8836L15.8331 20.1399C16.0824 19.5305 16.3803 18.9422 16.7241 18.3808L17.4221 17.2409C17.5486 17.0344 17.6987 16.8434 17.8694 16.6718L17.9144 16.6264C18.3757 16.1626 18.6683 15.5575 18.7454 14.9079Z" fill="white" stroke="white" stroke-width="1.21547"/>\n</svg>'}},favoriteButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49976 7.25225V23.2366C7.49976 24.6882 9.33429 25.321 10.2292 24.1782L13.7974 19.6218C14.4088 18.8411 15.5907 18.8411 16.2021 19.6218L19.7703 24.1782C20.6652 25.321 22.4998 24.6882 22.4998 23.2366V7.25225C22.4998 5.98711 21.4742 4.96152 20.209 4.96152H9.79048C8.52535 4.96152 7.49976 5.98712 7.49976 7.25225Z" stroke="white" stroke-width="1.29808"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49976 7.04073V23.0251C7.49976 24.4767 9.33429 25.1095 10.2292 23.9667L13.7974 19.4103C14.4088 18.6296 15.5907 18.6296 16.2021 19.4103L19.7703 23.9667C20.6652 25.1095 22.4998 24.4766 22.4998 23.0251V7.04072C22.4998 5.77559 21.4742 4.75 20.209 4.75H9.79048C8.52535 4.75 7.49976 5.77559 7.49976 7.04073Z" fill="white" stroke="white" stroke-width="1.29808"/>\n</svg>'}},muteButton:{svgSrc:{baseState:'<svg width="30" height="31" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.40625 13.5734V18.7664C3.40625 19.7239 4.18245 20.5001 5.13993 20.5001H8.04633C8.6342 20.5001 9.17511 20.8213 9.45654 21.3374L11.903 25.8242C12.271 26.4992 12.9783 26.9192 13.7471 26.9192C14.9072 26.9192 15.8477 25.9788 15.8477 24.8187V7.52486C15.8477 6.36469 14.9072 5.42416 13.747 5.42412C12.9783 5.42409 12.2709 5.84393 11.9028 6.51875L9.45651 11.0026C9.17509 11.5184 8.63442 11.8394 8.04683 11.8394H5.14027C4.1826 11.8394 3.40625 12.6157 3.40625 13.5734Z" fill="white"/>\n<path d="M19.8477 13.0466L26.0976 19.2966M26.0976 13.0466L19.8477 19.2966" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>',activeState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.40625 12.5733V17.7663C3.40625 18.7238 4.18245 19.5 5.13993 19.5H8.04633C8.6342 19.5 9.17511 19.8212 9.45654 20.3373L11.903 24.8241C12.271 25.4991 12.9783 25.919 13.7471 25.9191C14.9072 25.9191 15.8477 24.9787 15.8477 23.8186V6.52474C15.8477 5.36457 14.9072 4.42404 13.747 4.424C12.9783 4.42397 12.2709 4.84381 11.9028 5.51863L9.45651 10.0025C9.17509 10.5183 8.63442 10.8392 8.04683 10.8392H5.14027C4.1826 10.8392 3.40625 11.6156 3.40625 12.5733Z" fill="white"/>\n<path d="M19.8477 11.4215C20.6323 12.4661 21.0972 13.7645 21.0972 15.1715C21.0972 16.5785 20.6323 17.8769 19.8477 18.9215M22.3472 6.78613C24.6487 8.84608 26.0972 11.8396 26.0972 15.1715C26.0972 18.5034 24.6487 21.4969 22.3472 23.5569" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>'}},shareButton:{svgSrc:{baseState:'<svg width="30" height="31" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 10.9038C20.8488 10.9038 21.9423 9.81036 21.9423 8.46151C21.9423 7.11266 20.8488 6.01921 19.5 6.01921C18.1512 6.01921 17.0577 7.11266 17.0577 8.46151C17.0577 9.81036 18.1512 10.9038 19.5 10.9038ZM19.5 12.2115C21.5711 12.2115 23.25 10.5326 23.25 8.46151C23.25 6.39045 21.5711 4.71151 19.5 4.71151C17.4289 4.71151 15.75 6.39045 15.75 8.46151C15.75 8.98692 15.8581 9.48709 16.0531 9.94101L12.288 12.4511C11.6202 11.8367 10.7288 11.4615 9.74976 11.4615C7.67869 11.4615 5.99976 13.1404 5.99976 15.2115C5.99976 17.2826 7.67869 18.9615 9.74976 18.9615C10.7325 18.9615 11.6269 18.5835 12.2956 17.9649L16.018 20.5665C15.8451 20.9977 15.75 21.4685 15.75 21.9615C15.75 24.0326 17.4289 25.7115 19.5 25.7115C21.5711 25.7115 23.25 24.0326 23.25 21.9615C23.25 19.8904 21.5711 18.2115 19.5 18.2115C18.3369 18.2115 17.2974 18.7411 16.6096 19.5722L13.0138 17.0591C13.3231 16.5138 13.4998 15.8833 13.4998 15.2115C13.4998 14.5368 13.3216 13.9037 13.0097 13.3567L16.667 10.9185C17.3545 11.7106 18.3688 12.2115 19.5 12.2115ZM12.1921 15.2115C12.1921 16.5604 11.0986 17.6538 9.74976 17.6538C8.40091 17.6538 7.30745 16.5604 7.30745 15.2115C7.30745 13.8627 8.40091 12.7692 9.74976 12.7692C11.0986 12.7692 12.1921 13.8627 12.1921 15.2115ZM21.9423 21.9615C21.9423 23.3104 20.8488 24.4038 19.5 24.4038C18.1512 24.4038 17.0577 23.3104 17.0577 21.9615C17.0577 20.6127 18.1512 19.5192 19.5 19.5192C20.8488 19.5192 21.9423 20.6127 21.9423 21.9615Z" fill="white"/>\n</svg>'}}};var Lt;!function(e){e.STYLE_CIRCLE="circle",e.STYLE_QUAD="quad",e.STYLE_RECTANGLE="rectangle",e.SWIPE_CUBE="cube",e.SWIPE_FLAT="flat",e.SWIPE_COVER="cover",e.CLOSE_BUTTON_LEFT="left",e.CLOSE_BUTTON_RIGHT="right"}(Lt||(Lt={}));const Rt={};var Bt,Dt,Nt,Ft;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(Bt||(Bt={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(Dt||(Dt={})),function(e){e.LTR="ltr",e.RTL="rtl"}(Nt||(Nt={})),function(e){e.StoryList="storyList",e.StoryReader="storyReader",e.GameReader="gameReader",e.StackStoryList="stackStoryList",e.IamReader="iamReader",e.Banners="banners"}(Ft||(Ft={}));class Ut extends P.EventEmitter{emit(e,t){return super.emit(e,t)}on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}}var Gt,Vt,zt=_(5714),Wt=_.n(zt);!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.TouchMoveHorizontal="touchMoveHorizontal",e.TouchMoveVertical="touchMoveVertical",e.LongTouchDetected="longTouchDetected"}(Gt||(Gt={}));class $t{constructor(e,t){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}}class Ht{constructor(e,t,r,i){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"dx",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dy",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class qt extends(j()){constructor(e){super(),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"$grabHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"startPoint",{enumerable:!0,configurable:!0,writable:!0,value:new $t(0,0)}),Object.defineProperty(this,"touchStartTimerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_isSwiping",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"touched",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_horizontalSwipeGesture",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_verticalSwipeGesture",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isLongTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_needUpdateStartPoint",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:{threshold:10,touchStartTimeout:-1}}),Object.defineProperty(this,"_verticalSwipeGestureDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_horizontalSwipeGestureDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),e&&(this.options=Wt()(this.options,e)),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),ye&&this.disable()}get isSwiping(){return this._isSwiping}get horizontalSwipeGesture(){return this._horizontalSwipeGesture}get verticalSwipeGesture(){return this._verticalSwipeGesture}continueVerticalSwipeGesture(){this._isSwiping&&!this._horizontalSwipeGesture&&(this._needUpdateStartPoint=!0)}forceEnable(){this.enabled=!0}enable(){ye||(this.enabled=!0)}disable(){this.enabled=!1}disableVerticalSwipeGesture(){this._verticalSwipeGestureDisabled=!0}enableVerticalSwipeGesture(){this._verticalSwipeGestureDisabled=!1}disableHorizontalSwipeGesture(){this._horizontalSwipeGestureDisabled=!0}enableHorizontalSwipeGesture(){this._horizontalSwipeGestureDisabled=!1}destroy(){this.$el&&this.$grabHandler&&(this.reset(),this.clearTouchStartTimeout(),ye?(this.$grabHandler.removeEventListener("mousedown",this.handleTouchStart),this.$el.removeEventListener("mousemove",this.handleTouchMove),window.removeEventListener("mouseup",this.handleTouchEnd)):(this.$grabHandler.removeEventListener("touchstart",this.handleTouchStart),this.$el.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)),this.$el=null,this.$grabHandler=null)}init(e,t){this.$el||(this.$el=e,this.$grabHandler=null!=t?t:this.$el,ye?(this.$grabHandler.addEventListener("mousedown",this.handleTouchStart,{passive:!0}),this.$el.addEventListener("mousemove",this.handleTouchMove,{passive:!0}),window.addEventListener("mouseup",this.handleTouchEnd)):(this.$grabHandler.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),this.$el.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),window.addEventListener("touchend",this.handleTouchEnd)))}resetGrabHandler(){this.$el&&this.updateGrabHandler(this.$el)}setGrabHandler(e){e&&this.updateGrabHandler(e)}updateGrabHandler(e){var t,r;ye?(null===(t=this.$grabHandler)||void 0===t||t.removeEventListener("mousedown",this.handleTouchStart),e.addEventListener("mousedown",this.handleTouchStart)):(null===(r=this.$grabHandler)||void 0===r||r.removeEventListener("touchstart",this.handleTouchStart),e.addEventListener("touchstart",this.handleTouchStart)),this.$grabHandler=e}handleTouchStart(e){this.enabled&&!this.touched&&(this.touched=!0,this.clearTouchStartTimeout(),this.startPoint=this.getPointByEvent(e),this.emit(Gt.TouchStart,new Ht(this.startPoint.x,this.startPoint.y,0,0)),this.startTouchStartTimer(this.startPoint))}handleTouchMove(e){if(!this.touched)return;const t=this.getPointByEvent(e);this.updateStartPoint(t);const r=this.getDeltaPoint(t),i=new Ht(t.x,t.y,r.x,r.y);this.isThresholdExceed(r)&&(this._isSwiping=!0),this._isSwiping&&(this.emit(Gt.TouchMove,i),this.determineSwipeGestureDirection(r),this.handleHorizontalSwipeGesture(i),this.handleVerticalSwipeGesture(i))}isThresholdExceed(e){return Math.abs(e.x)>this.options.threshold||Math.abs(e.y)>this.options.threshold}handleTouchEnd(e){if(!this.touched)return;this._isLongTouch&&e.preventDefault(),this.clearTouchStartTimeout();const t=this.getPointByEvent(e),r=this.getDeltaPoint(t);this.emit(Gt.TouchEnd,new Ht(t.x,t.y,r.x,r.y)),this.reset()}clearTouchStartTimeout(){this.touchStartTimerId&&(clearTimeout(this.touchStartTimerId),this.touchStartTimerId=null)}startTouchStartTimer(e){null!=this.options.touchStartTimeout&&-1!==this.options.touchStartTimeout&&(this.touchStartTimerId=setTimeout(()=>{this._isLongTouch=!0,this.emit(Gt.LongTouchDetected,e)},this.options.touchStartTimeout))}getPointByEvent(e){if("changedTouches"in e){const t=e.changedTouches[0];return new $t(t.pageX,t.pageY)}return new $t(e.pageX,e.pageY)}getDeltaPoint(e){const t=e.x-this.startPoint.x,r=e.y-this.startPoint.y;return new $t(t,r)}determineSwipeGestureDirection(e){Math.abs(e.x)>Math.abs(e.y)?this._verticalSwipeGesture||this._horizontalSwipeGestureDisabled||(this._horizontalSwipeGesture=!0):this._horizontalSwipeGesture||this._verticalSwipeGestureDisabled||(this._verticalSwipeGesture=!0)}handleVerticalSwipeGesture(e){this._verticalSwipeGesture&&!this._verticalSwipeGestureDisabled&&this.emit(Gt.TouchMoveVertical,e)}handleHorizontalSwipeGesture(e){this._horizontalSwipeGesture&&!this._horizontalSwipeGestureDisabled&&this.emit(Gt.TouchMoveHorizontal,e)}reset(){this._isSwiping=!1,this.touched=!1,this._isLongTouch=!1,this._horizontalSwipeGesture=!1,this._verticalSwipeGesture=!1}updateStartPoint(e){this._needUpdateStartPoint&&(this._needUpdateStartPoint=!1,this.startPoint=e)}}!function(e){e.Top="top",e.Bottom="bottom"}(Vt||(Vt={}));const Jt=Vt.Bottom;class Kt{constructor(e){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:Jt}),Object.defineProperty(this,"mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toastContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.initializeOptions(e),this.mountPoint=e.mountPoint}show(e){return this.content=e,this.destroy(),this.createAndShowToast(),!0}hide(){if(!this.toastContainer)return!1;clearTimeout(this.timeoutId),this.toastContainer.className+=" toast_fadeout";return this.addAnimationEndListeners(this.toastContainer,()=>{var e,t;null===(t=null===(e=this.toastContainer)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.toastContainer),this.toastContainer=null}),!0}destroy(){var e;this.toastContainer&&(clearTimeout(this.timeoutId),null===(e=this.toastContainer.parentNode)||void 0===e||e.removeChild(this.toastContainer),this.toastContainer=null)}initializeOptions(e){if(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.position){const t=e.position.toLowerCase();this.position="top"===t||"bottom"===t?t:Jt}}createAndShowToast(){const e=this.createToastContainer(),t=this.createToastElement(),r=this.createToastTextElement();t.appendChild(r),e.appendChild(t),this.mountPoint.appendChild(e),this.timeoutId=window.setTimeout(()=>this.hide(),this.duration),this.toastContainer=e}createToastContainer(){const e=document.createElement("div");return e.id="toast_container",e.className="toast_fadein",e.style.zIndex="1130",e}createToastElement(){const e=document.createElement("div");return e.id="toast",e}createToastTextElement(){const e=document.createElement("span");return e.innerHTML=this.content,e}addAnimationEndListeners(e,t){["animationend","webkitAnimationEnd","msAnimationEnd","oAnimationEnd"].forEach(r=>{e.addEventListener(r,t,{once:!0})})}}class Zt{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"debouncedTryEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:(0,C.debounce)(()=>{this.slider.notifyScrollEnd()},200)}),this.handleScroll=this.handleScroll.bind(this),this.init(),this.addEventListeners()}destroy(){this.slider.getElementRef().removeEventListener("scroll",this.handleScroll)}init(){const e=this.slider.getElementRef();e.style.overflowX=this.slider.isHorizontal()?"scroll":"hidden",e.style.overflowY=this.slider.isHorizontal()?"hidden":"scroll"}addEventListeners(){this.slider.getElementRef().addEventListener("scroll",this.handleScroll)}scrollTo(e){const t=this.slider.getElementRef(),r=this.slider.dir===Nt.LTR?1:-1;t.scrollLeft=r*e.x,t.scrollTop=e.y}scrollWithAnimation(e,t){const r=this.slider.getElementRef(),i=this.slider.dir===Nt.LTR?1:-1;r.scrollTo({left:i*e.x,top:e.y,behavior:"smooth"})}stopAnimation(){}handleScroll(){this.slider.notifyScrollStart();const e=this.slider.getElementRef();this.slider.updatePosition(Math.abs(e.scrollLeft),Math.abs(e.scrollTop)),this.slider.testAttraction(e.scrollLeft,e.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition()),this.debouncedTryEndScroll()}}class Qt{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"lastClientX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastClientY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pushed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isAnimating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"debouncedTryAnimationEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:(0,C.debounce)(()=>{this.isAnimating=!1,this.slider.notifyScrollEnd()},200)}),Object.defineProperty(this,"debouncedTryMouseWheelEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:(0,C.debounce)(()=>{this.slider.notifyScrollEnd()},200)}),this.handleScroll=this.handleScroll.bind(this),this.init(),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.addEventListeners()}init(){const e=this.slider.getElementRef();e.style.overflowX=this.slider.isHorizontal()?"scroll":"hidden",e.style.overflowY=this.slider.isHorizontal()?"hidden":"scroll"}addEventListeners(){const e=this.slider.getElementRef();e.addEventListener("scroll",this.handleScroll),e.addEventListener("mousedown",this.handleMouseDown,Q),e.addEventListener("touchstart",this.handleMouseDown,Q)}scrollTo(e){const t=this.slider.getElementRef(),r=this.slider.dir===Nt.LTR?1:-1;t.scrollLeft=r*e.x,t.scrollTop=e.y,this.slider.updatePosition(Math.abs(t.scrollLeft),Math.abs(t.scrollTop)),this.slider.testAttraction(t.scrollLeft,t.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition())}scrollWithAnimation(e,t){this.isAnimating=!0;const r=this.slider.getElementRef(),i=this.slider.dir===Nt.LTR?1:-1;r.scrollTo({left:i*e.x,top:e.y,behavior:"smooth"})}stopAnimation(){}destroy(){const e=this.slider.getElementRef();e.removeEventListener("mousedown",this.handleMouseDown,Q),e.removeEventListener("touchstart",this.handleMouseDown,Q),e.removeEventListener("mouseup",this.handleMouseUp,Q),e.removeEventListener("touchend",this.handleMouseUp,Q),e.removeEventListener("mousemove",this.handleMouseMove,Q),e.removeEventListener("touchmove",this.handleMouseMove,Q),e.removeEventListener("scroll",this.handleScroll)}handleMouseDown(e){this.pushed=!0,this.isDragging=!1;const{clientX:t,clientY:r}=this.extractPointerPosition(e);this.lastClientX=t,this.lastClientY=r,window.addEventListener("mouseup",this.handleMouseUp,Q),window.addEventListener("touchend",this.handleMouseUp,Q),window.addEventListener("mousemove",this.handleMouseMove,Q),window.addEventListener("touchmove",this.handleMouseMove,Q)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.slider.notifyScrollEnd(),window.removeEventListener("mouseup",this.handleMouseUp,Q),window.removeEventListener("touchend",this.handleMouseUp,Q),window.removeEventListener("mousemove",this.handleMouseMove,Q),window.removeEventListener("touchmove",this.handleMouseMove,Q))}handleMouseMove(e){if(!this.pushed)return;const{clientX:t,clientY:r}=this.extractPointerPosition(e),i=t-this.lastClientX,s=r-this.lastClientY;this.lastClientX=t,this.lastClientY=r;const a=this.slider.dir===Nt.LTR?-1:1,{x:o,y:n}=this.slider.preparePosition(this.slider.getCurrentPosition().x+a*i,this.slider.getCurrentPosition().y+a*s);!this.isDragging&&(Math.abs(i)>=1||Math.abs(s)>=1)&&(this.isDragging=!0),this.isDragging&&this.scrollTo({x:o,y:n})}extractPointerPosition(e){return e instanceof MouseEvent?{clientX:e.clientX,clientY:e.clientY}:{clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}}handleScroll(){this.isDragging?this.handleScrollByDraggable():this.isAnimating?this.handleScrollByAnimation():this.handleScrollByMouseWheel()}handleScrollByMouseWheel(){this.slider.notifyScrollStart();const e=this.slider.getElementRef();this.slider.updatePosition(Math.abs(e.scrollLeft),Math.abs(e.scrollTop)),this.slider.testAttraction(e.scrollLeft,e.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition()),this.debouncedTryMouseWheelEndScroll()}handleScrollByDraggable(){this.slider.notifyScrollStart()}handleScrollByAnimation(){if(!this.isAnimating)return;this.slider.notifyScrollStart();const e=this.slider.getElementRef();this.slider.updatePosition(Math.abs(e.scrollLeft),Math.abs(e.scrollTop)),this.slider.testAttraction(e.scrollLeft,e.scrollTop),this.slider.emit("scroll",this.slider.getCurrentPosition()),this.debouncedTryAnimationEndScroll()}}var Yt;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(Yt||(Yt={}));class Xt extends P.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"scrollStrategy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isScrolling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPosition",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:Yt.Horizontal}),Object.defineProperty(this,"gap",{enumerable:!0,configurable:!0,writable:!0,value:20}),Object.defineProperty(this,"_reachStart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_reachEnd",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_dir",{enumerable:!0,configurable:!0,writable:!0,value:Nt.LTR})}get isScrolling(){return this._isScrolling}get slides(){return this.slider.children[0]instanceof HTMLSlotElement?this.slider.children[0].assignedElements({flatten:!1}):Array.from(this.slider.children)}get elementRef(){return this.slider}get reachStart(){return this._reachStart}get reachEnd(){return this._reachEnd}get scrollWidth(){return this.slider.scrollWidth}get dir(){return this._dir}mount(e){this.slider=e,this.changeScrollStrategy()}destroy(){this.removeAllListeners(),this.scrollStrategy.destroy()}getLength(){var e,t;return null!==(t=null===(e=this.slider)||void 0===e?void 0:e.children.length)&&void 0!==t?t:0}changeDirection(e){this.direction=e,this.scrollTo(0,0),this.changeScrollStrategy()}setGap(e){this.gap=e}setDesktopMode(e){this.desktopMode=e,this.changeScrollStrategy()}getGap(){return this.gap}scrollTo(e,t=300){e=Math.trunc(e);const r=this.preparePosition(e,e);this.isTheSamePosition(r.x,r.y)||(t>0?this.scrollStrategy.scrollWithAnimation(r,t):this.scrollStrategy.scrollTo(r))}isHorizontal(){return this.direction===Yt.Horizontal}updatePosition(e,t){this.currentPosition={x:Math.trunc(e),y:Math.trunc(t)}}getElementRef(){return this.slider}getCurrentPosition(){return this.currentPosition}preparePosition(e,t){let r={x:e,y:t};return this.isHorizontal()?r.y=0:r.x=0,this.attractToBounds(r.x,r.y)}attractToBounds(e,t){return{x:this.attractToBoundsByX(e),y:this.attractToBoundsByY(t)}}attractToBoundsByX(e){return e<=0?0:e+this.slider.clientWidth>=this.slider.scrollWidth?this.slider.scrollWidth-this.slider.clientWidth:e}attractToBoundsByY(e){return e<=0?0:e+this.slider.clientHeight>=this.slider.scrollHeight?this.slider.scrollHeight-this.slider.clientHeight:e}testAttraction(e,t){const r=this._dir===Nt.LTR?1:-1,i=r*e+this.slider.clientWidth>=Math.max(this.slider.scrollWidth-1,0),s=r*t+this.slider.clientHeight>=Math.max(this.slider.scrollHeight-1,0);this._reachStart=r*e<=0&&r*t<=0,this._reachEnd=this.isHorizontal()?i:s,this.emit("reachStart",this._reachStart),this.emit("reachEnd",this._reachEnd)}setTextDirection(e){this._dir=e;const{x:t,y:r}=this.getCurrentPosition();this.testAttraction(t,r)}scrollBySlideIndex(e,t){this.isHorizontal()?this.scrollTo(this.slides[e].offsetLeft,t):this.scrollTo(this.slides[e].offsetTop,t)}scrollByDirection(e,t){const{x:r,y:i}=this.getCurrentPosition(),s=this.isHorizontal()?r:i,a=this.getSlidesPerView(),o=this.getStoryWidth(),n=this.getStoryHeight(),l=s+e*a*(this.isHorizontal()?o:n);this.scrollTo(l,t)}notifyScrollStart(){this.isScrolling||(this._isScrolling=!0,this.emit("scrollstart",this.currentPosition))}notifyScrollEnd(){this.isScrolling&&(this._isScrolling=!1,this.emit("scrollend",this.currentPosition))}async waitStoryListClientWidth(){const e=t=>{this.elementRef.clientWidth>0?t():requestAnimationFrame(()=>e(t))};return new Promise(t=>{requestAnimationFrame(()=>e(t))})}isTheSamePosition(e,t){return e===this.currentPosition.x&&t===this.currentPosition.y}getSlidesPerView(){if(this.isHorizontal()&&this.slider.clientWidth){const e=this.slider.children[0].clientWidth+this.gap;return Math.round(this.slider.clientWidth/e)}if(!this.isHorizontal()&&this.slider.clientHeight){const e=this.slider.children[0].clientHeight+this.gap;return Math.round(this.slider.clientHeight/e)}return 1}getStoryWidth(){var e;return(null===(e=this.slides[0])||void 0===e?void 0:e.clientWidth)+this.gap}getStoryHeight(){var e;return(null===(e=this.slides[0])||void 0===e?void 0:e.clientHeight)+this.gap}changeScrollStrategy(){this.scrollStrategy&&this.scrollStrategy.destroy(),this.scrollStrategy=this.desktopMode?new Qt(this):new Zt(this)}}class er{constructor(e){Object.defineProperty(this,"window",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get width(){const e=this.window.document.documentElement.clientWidth;return Math.abs(this.window.innerWidth-e)}hide(){this.hidden||(this.disableOverFlow(),this.disablePullToRefresh(),this.setBodyContainer(),this.setElementAttributes("body","paddingRight",e=>e+this.width),this.hidden=!0)}show(){this.hidden&&(this.resetElementAttributes("html","overflow"),this.resetElementAttributes("body","overflow"),this.resetElementAttributes("body","paddingRight"),this.resetBodyContainer(),this.enablePullToRefresh(),this.hidden=!1)}disablePullToRefresh(){if(this.style)return;this.style=this.window.document.createElement("style"),this.style.setAttribute("nonce",q()),this.style.textContent="\n @media screen and (pointer: coarse) {\n html, body {\n overscroll-behavior-y: none;\n touch-action: none;\n }\n }\n body {\n overscroll-behavior-y: none;\n }\n ",this.window.document.body.appendChild(this.style)}enablePullToRefresh(){var e;this.style&&(null===(e=this.style.parentElement)||void 0===e||e.removeChild(this.style),this.style=null)}disableOverFlow(){const e=this.window.document,t=e.documentElement.style.overflow,r=e.body.style.overflow;r&&(e.body.dataset.overflow=r),t&&(e.documentElement.dataset.overflow=t),e.body.style.overflow="hidden",e.documentElement.style.overflow="hidden"}setElementAttributes(e,t,r){const i=this.width;this.window.document.querySelectorAll(e).forEach(e=>{if(e!==this.window.document.body&&this.window.innerWidth>e.clientWidth+i)return;const s=e.style[t],a=this.window.getComputedStyle(e)[t],o=parseFloat(a||"0");e.dataset[t]=s,e.style[t]=`${r(o)}px`})}resetElementAttributes(e,t){this.window.document.querySelectorAll(e).forEach(e=>{const r=e.dataset[t];void 0===r?e.style.removeProperty(t):(delete e.dataset[t],e.style[t]=r)})}setBodyContainer(){const e=this.window.document,t=e.body.style.container;t&&(e.body.dataset.container=t),e.body.style.container="unset"}resetBodyContainer(){this.resetElementAttributes("body","container")}}var tr=_(5136);const rr=async e=>(await fetch(e)).blob(),ir=async e=>{const t=await rr(e);return function(e,t=!0){return new Promise(function(r){var i=new FileReader;i.onloadend=function(){if(t){var e=String(i.result).replace("data:","").replace(/^.+,/,"");r(e)}else r(String(i.result))},i.readAsDataURL(e)})}(new File([t],"image",{type:t.type,lastModified:(new Date).getTime()}),!1)};function sr(e,t,r,i){var s=e.indexOf(r,t);if(-1===s)return null;for(var a="",o=s+r.length;o<e.length&&-1===i.indexOf(e[o]);o++)a+=e[o];return{foundAtIndex:s,value:a}}function ar(e){return e.replace(/["']/g,"")}function or(e,t){const r=document.createElementNS("http://www.w3.org/2000/svg",e);for(let e in t)r.setAttributeNS(null,e.replace(/[A-Z]/g,function(e,t,r,i){return"-"+e.toLowerCase()}),t[e]);return r}var nr;function lr(e,t,r,i,s,a,o,n,l,c){var d=or("svg",{width:String(s),height:String(a),style:"background-color: #fff;"}),h=or("foreignObject",{x:"0",y:"0",width:"100%",height:"100%"});d.appendChild(h);try{h.style.fontSize=document.body.style.fontSize}catch(e){console.error(e)}!function(){const u=t.cloneNode(!0);if(null!=i&&"string"==typeof i&&i.length>0){const e=Array.prototype.slice.call(u.querySelectorAll(i));for(let t=0;t<e.length;t++){const r=e[t];r&&r.style&&r.style.setProperty&&r.style.setProperty("display","none")}}h.appendChild(u);var p=[];(function(e){for(var t=[],r=0;;){var i=sr(e,r,"src: url(",[" ",")","\t"]);if(null==i)break;r=i.foundAtIndex+i.value.length,t.push(ar(i.value))}return t})(r).forEach(function(e){p.push(new Promise(function(t,i){ir(e).then(function(i){r=r.replace(e,i),t()}).catch(function(e){t()})}))}),h.querySelectorAll("img").forEach(function(e){e.crossOrigin="Anonymous",p.push(new Promise(function(t,r){ir(e.src).then(function(r){e.onload=r=>e.decode().then(()=>t()),e.onerror=e=>{console.error(e),t()},e.decoding="sync",e.src=r}).catch(function(e){t()})}))}),h.querySelectorAll("video").forEach(function(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}),h.querySelectorAll(".narrative-element-video").forEach(function(e){e.classList.add("init")}),Promise.all(p).then(function(){const t=or("style",{});t.textContent=r,d.appendChild(t);const i=(new XMLSerializer).serializeToString(d),h=new Image;h.onload=t=>{h.decode().then(function(){setTimeout(function(){const e=document.createElement("canvas"),t=e.getContext("2d");if(t){e.style.width=s+"px",e.style.height=a+"px",e.width=2*s,e.height=2*a,t.scale(2,2),t.drawImage(h,0,0);const r=e.toDataURL(o,n);rr(r).then(function(t){l(t),e.remove()})}},e===nr.IOS?200:void 0)}).catch(e=>{console.log({image:h,encodingError:e},"onDecodeError"),c("error render svg image: "+e)})},h.onerror=e=>{c("error render svg image: "+e)},h.setAttribute("crossOrigin","Anonymous"),h.crossOrigin="Anonymous",h.decoding="sync",h.src="data:image/svg+xml;base64,"+btoa(encodeURIComponent(i).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}))})}()}function cr(e,t,r,i){return new Promise(function(s,a){null==i&&(i=""),function(e,t,r,i,s,a){lr(e,t,r,i,t.clientWidth,t.clientHeight,"image/jpeg",1,s,a)}(e,t,r,i,function(e){s(new File([e],"image.jpeg",{type:e.type,lastModified:(new Date).getTime()}))},function(){console.error("Image fail");const e=new Error;e.name="ImageFail",a(e)})})}!function(e){e[e.IOS=0]="IOS",e[e.ANDROID=1]="ANDROID",e[e.OTHER=2]="OTHER"}(nr||(nr={}));class dr{async getScreenShot({hideElementsSelector:e,slideContent:t}){const r=await cr(nr.IOS,t,function(e){let t="";return Array.prototype.slice.call(window.document.styleSheets).forEach(r=>{e(r)&&(t+=Array.prototype.slice.call(r.rules).map(e=>e.cssText).join(""))}),t}(function(){return!0}),e);return{file:r,url:URL.createObjectURL(r)}}getFilteredConfigDto(e){const t={};for(const[r,i]of Object.entries(null!=e?e:{}))null!==i&&(t[r]=i);return t}}var hr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ur=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},pr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},gr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let fr=(()=>{var e,t,r;let i,s,a,o,n,l,c=[],d=[],h=[],u=[],p=[];return e=class{get _isOpened(){return pr(this,t,"f")}set _isOpened(e){gr(this,t,e,"f")}get _params(){return pr(this,r,"f")}set _params(e){gr(this,r,e,"f")}constructor(e,i,s){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(hr(this,c),e)}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"nativeSharingId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"nativeSharingRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"sharingService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,hr(this,d,!1)),r.set(this,(hr(this,h),hr(this,u,{id:"",type:Ot.Link,link:""}))),Object.defineProperty(this,"currentStorySlide",{enumerable:!0,configurable:!0,writable:!0,value:(hr(this,p),null)}),this.sharingService=new dr}get isOpened(){return this._isOpened}get params(){return this._params}open(e){this.story.pauseUI(e.id),this._params={link:e.link,type:e.type,text:e.text,id:e.id},this._isOpened=!0,this.touchController.disable()}close(){this.story.resumeUI(this._params.id),this._isOpened=!1,this._params={id:"",type:Ot.Image,link:""},this.touchController.enable()}handleShareComplete(e,t){var r;null===(r=this.currentStorySlide)||void 0===r||r.setShareComplete(e,t),this.close()}async shareScreenShot({shareId:e,shareText:t,hideElementsSelector:r,storySlide:i}){let s=null;this.currentStorySlide=i;try{if(!this.story.$root)return;const i=await this.sharingService.getScreenShot({hideElementsSelector:r,slideContent:this.story.$root});s=i.url;const a={files:[i.file],text:t};if(ye)return void this.open({type:Ot.Image,id:e,link:s,text:t});await this.startNativeSharing(e,a)}catch(r){console.error(r),s&&this.open({type:Ot.Image,id:e,link:s,text:t})}}async shareText({shareId:e,config:t,storySlide:r}){var i;this.currentStorySlide=r,null==e&&(e="story-share");const s=this.sharingService.getFilteredConfigDto(t),a=s.url=null!==(i=s.url)&&void 0!==i?i:s.text,o={type:Ot.Link,id:e,link:a};try{if(ye)return void this.open(o);await this.startNativeSharing(e,s)}catch(e){this.open(o)}}async startNativeSharing(e,t){if(!this.storyManager.shareHandler)throw new Error;try{this.story.pauseUI(e),this.runNativeSharing({id:e}),await this.storyManager.shareHandler(t),this.completeNativeSharing({result:!0})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;throw e}finally{this.completeNativeSharing({result:!1})}}runNativeSharing({id:e}){this.nativeSharingId=e,this.nativeSharingRunning=!0}completeNativeSharing({result:e}){this.nativeSharingRunning&&(this.handleShareComplete(this.nativeSharingId,e),this.story.resumeUI(this.nativeSharingId),this.nativeSharingRunning=!1,this.nativeSharingId="")}},t=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;i=[N.observable],s=[N.observable],a=[N.computed],o=[N.computed],n=[N.action],l=[N.action],ur(e,null,i,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:t},d,h),ur(e,null,s,{kind:"accessor",name:"_params",static:!1,private:!1,access:{has:e=>"_params"in e,get:e=>e._params,set:(e,t)=>{e._params=t}},metadata:t},u,p),ur(e,null,a,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:t},null,c),ur(e,null,o,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:t},null,c),ur(e,null,n,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:t},null,c),ur(e,null,l,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:t},null,c),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var mr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},yr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},vr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},br=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};var wr;!function(e){e.Init="🔧",e.Start="🚀",e.Pause="⏸️",e.Resume="↩️",e.Stop="🛑",e.Destroy="🗑️",e.Restart="🔄"}(wr||(wr={}));let Sr=(()=>{var e,t,r;let i,s,a,o=[],n=[],l=[],c=[],d=[];return e=class{get _disabledNextClick(){return vr(this,t,"f")}set _disabledNextClick(e){br(this,t,e,"f")}get _cover(){return vr(this,r,"f")}set _cover(e){br(this,r,e,"f")}constructor(e,i,s,a,h){Object.defineProperty(this,"_story",{enumerable:!0,configurable:!0,writable:!0,value:(mr(this,o),e)}),Object.defineProperty(this,"_index",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"cacheManager",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,mr(this,n,!1)),r.set(this,(mr(this,l),mr(this,c,null))),Object.defineProperty(this,"preloaded",{enumerable:!0,configurable:!0,writable:!0,value:(mr(this,d),!1)}),Object.defineProperty(this,"isPreloading",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:N.observable.object({inited:!1,started:!1,paused:!1})}),Object.defineProperty(this,"handleTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:({dy:e})=>{this.story.touchController&&e<10&&this.story.touchController.verticalSwipeGesture&&this.slideApi.slideSwipeUpHandler()}})}get index(){return this._index}get story(){return this._story}get navigationDisabled(){return!1}get timeline(){return this.slide.timeline}get duration(){return this.slide.duration}get screenshotShare(){return this.slide.screenshotShare}get html(){return this.slide.html}get eventPayload(){return this.slide.eventPayload}get disabledNextClick(){return this._disabledNextClick}get cover(){return this._cover}mute(){this.slideApi.disableAudio()}unmute(){this.slideApi.enableAudio()}notifyTimerEnd(){this.slideApi.slideTimerEnd()}setTextInputResult(e,t){this.slideApi.setTextInputResult(e,t)}setShareComplete(e,t){this.slideApi.setShareComplete(e,t)}closeLegacyGoodsWidget(e){this.slideApi.setWidgetGoodsComplete(e)}async init(){if(this.state.inited)return;let e=this.story.needShowLoaderScreen,t=Date.now();const r=setTimeout(()=>{this.story.showLoaderScreen(),e=!0,t=Date.now()},500);let i=!1;try{const e=await this.slideApi.showSlide(this.html);if(i=e.result,!e.result)throw new Error(e.reason);this.commit({inited:!0}),this.debug(`${wr.Init} [Slide Lifecycle] inited: `)}catch(e){this.handleSlideError(e)}finally{clearTimeout(r),await this.cleanupLoaderIfNeeded(Date.now()-t,e),i&&(this._cover=this.getCoverByLayer())}}async start(){if(this.state.inited&&!this.state.started){try{await this.slideApi.slideStart({muted:this._story.muted}),this.story.touchController.on(Gt.TouchEnd,this.handleTouchEnd)}catch(e){this.handleSlideError(e)}this.commit({started:!0}),this.debug(`${wr.Start} [Slide Lifecycle] started: `)}}async recover(){await this.init(),await this.start()}async restart(){try{this.story.hideErrorScreen(),this.story.showLoaderScreen(),await this.slideApi.slideRestart({muted:this._story.muted}),this.commit({inited:!0,started:!0,paused:!1})}catch(e){this.handleSlideError(e)}finally{this.story.hideLoaderScreen()}this.debug(`${wr.Restart} [Slide Lifecycle] restarted: `)}async resumeByApp(){if(this.state.paused){try{await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}this.commit({paused:!1}),this.debug(`${wr.Resume} [Slide Lifecycle] resume by app: `)}}async pauseByApp(){if(!this.state.paused){try{await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}this.debug(`${wr.Pause} [Slide Lifecycle] pause by app: `),this.commit({paused:!0})}}async resumeByUser(){if(this.state.paused){try{await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}this.commit({paused:!1}),this.debug(`${wr.Resume} [Slide Lifecycle] resume by user: `)}}async pauseByUser(){if(!this.state.paused){try{await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}this.commit({paused:!0}),this.debug(`${wr.Pause} [Slide Lifecycle] pause by user: `)}}async stop(e){this.state.started&&(await this.stopAndCleanup(e),1===e.prepareForRestart?this.commit({started:!1,paused:!1}):this.commit({started:!1,inited:!1,paused:!1}),this.debug(`${wr.Stop} [Slide Lifecycle] stopped: `))}async stopAndCleanup(e){try{this.story.touchController.off(Gt.TouchEnd,this.handleTouchEnd),await this.slideApi.slideStop(e)}catch(e){this.handleSlideError(e)}}showLayerByIndex(e){this.slideApi.showLayer(e),this._cover=this.getCoverByLayer()}canGoNext(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"forward");return e}canGoPrev(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"backward");return e}async preload(e){if(!this.cacheManager||this.preloaded||this.isPreloading)return;this.isPreloading=!0;const t=this.slide.parseResources(),r=await this.cacheManager.preload(t.map(t=>({url:t,priority:e}))),i={};for(const e of r)i[e.url]=e;this.cacheManager.isDestroyed||this.slide.applyBlobUrls(t,i),this.preloaded=!0,this.isPreloading=!1}onClick({event:e,currentTarget:t,preventNavigation:r=!1}){if(e.target)try{e.preventDefault(),e.stopPropagation();const i=this.getNavigationDirection(e,t),{canClickNext:s}=this.slideApi.slideClickHandler(e.target,i>0?"forward":"backward");s&&!r&&this.navigate(i)}catch(e){console.error(e)}}async destroy(){try{this.cacheManager&&this.slide.restoreOriginalResourceUrls(),this.story.touchController.off(Gt.TouchEnd,this.handleTouchEnd),this.commit({inited:!1,started:!1,paused:!1}),this.debug(`${wr.Destroy} [Slide Lifecycle] destroyed: `),await this.slideApi.slideStop({prepareForRestart:2})}catch(e){console.error(e)}}getNavigationDirection(e,t){const r=this.getClickPosition(e,t),i="ltr"===this.slideApi.layoutDirection?1:-1;return r>=.3?i:-i}getClickPosition(e,t){const r=t.getBoundingClientRect(),i=r.width;if(i<=0)return 0;let s;if(e instanceof MouseEvent)s=e.pageX-r.left;else{if(!(e.touches&&e.touches.length>0))return 0;s=e.touches[0].pageX-r.left}return Math.max(0,Math.min(1,s/i))}navigate(e){e>0?this.story.nextSlideOrStory():this.story.prevSlideOrStory()}handleSlideError(e){console.warn(e),this.story.showErrorScreen(),this.story.touchController.off(Gt.TouchEnd,this.handleTouchEnd)}delay(e){return new Promise(t=>setTimeout(t,e))}async cleanupLoaderIfNeeded(e,t){t&&(await this.delay(Math.max(500-e,0)),this.story.hideLoaderScreen())}getCoverByLayer(){var e,t;const r=this.slideApi.activeLayer.nodeRef,i=null===(e=r.querySelector(".narrative-element-image img"))||void 0===e?void 0:e.src,s=null===(t=r.querySelector(".narrative-element-video video"))||void 0===t?void 0:t.getAttribute("poster-remote-src");return i||s||null}commit(e){Object.assign(this.state,e),this.state.inited||(this.state.started=!1,this.state.paused=!1),this.state.started||(this.state.paused=!1)}debug(e){D(e,{cardId:this.story.id,slideIndex:this.index})}},t=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;i=[N.observable],s=[N.observable],a=[N.action],yr(e,null,i,{kind:"accessor",name:"_disabledNextClick",static:!1,private:!1,access:{has:e=>"_disabledNextClick"in e,get:e=>e._disabledNextClick,set:(e,t)=>{e._disabledNextClick=t}},metadata:t},n,l),yr(e,null,s,{kind:"accessor",name:"_cover",static:!1,private:!1,access:{has:e=>"_cover"in e,get:e=>e._cover,set:(e,t)=>{e._cover=t}},metadata:t},c,d),yr(e,null,a,{kind:"method",name:"commit",static:!1,private:!1,access:{has:e=>"commit"in e,get:e=>e.commit},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class _r{get index(){return 0}get navigationDisabled(){return!1}get timeline(){return{foreground:"",background:""}}get duration(){return 0}get screenshotShare(){return!1}get html(){return""}get eventPayload(){return{}}get disabledNextClick(){return!1}mute(){}unmute(){}notifyTimerEnd(){}setTextInputResult(e,t){}setShareComplete(e,t){}async init(){}async start(){}async restart(){}async stop(){}async resumeByApp(){}async pauseByApp(){}async resumeByUser(){}async pauseByUser(){}showLayerByIndex(e){}onClick(e){}closeLegacyGoodsWidget(e){}async destroy(){}canGoNext(){return!1}canGoPrev(){return!1}}var Or=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},xr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0};let kr=(()=>{var e;let t,r,i,s=[];return e=class{constructor(){Object.defineProperty(this,"refs",{enumerable:!0,configurable:!0,writable:!0,value:(Or(this,s),N.observable.map())})}get isPaused(){return this.refs.size>0}pause(e){var t;const r=null!==(t=this.refs.get(e))&&void 0!==t?t:0;this.refs.set(e,r+1)}resume(e){const t=this.refs.get(e);void 0!==t&&(t<=1?this.refs.delete(e):this.refs.set(e,t-1))}getActiveSources(){return Array.from(this.refs.keys())}clear(){this.refs.clear()}},(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[N.computed],r=[N.action],i=[N.action],xr(e,null,t,{kind:"getter",name:"isPaused",static:!1,private:!1,access:{has:e=>"isPaused"in e,get:e=>e.isPaused},metadata:a},null,s),xr(e,null,r,{kind:"method",name:"pause",static:!1,private:!1,access:{has:e=>"pause"in e,get:e=>e.pause},metadata:a},null,s),xr(e,null,i,{kind:"method",name:"resume",static:!1,private:!1,access:{has:e=>"resume"in e,get:e=>e.resume},metadata:a},null,s),a&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),e})();var Cr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Pr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},jr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Er=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Ir=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,h,u,p,g,f,m,y,v,b=[],w=[],S=[],_=[],O=[],x=[],k=[];return e=class{get _userPaused(){return jr(this,t,"f")}set _userPaused(e){Er(this,t,e,"f")}get _systemPause(){return jr(this,r,"f")}set _systemPause(e){Er(this,r,e,"f")}get _uiPause(){return jr(this,i,"f")}set _uiPause(e){Er(this,i,e,"f")}constructor(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:(Cr(this,b),e)}),t.set(this,Cr(this,w,!1)),r.set(this,(Cr(this,S),Cr(this,_,new kr))),i.set(this,(Cr(this,O),Cr(this,x,new kr))),Cr(this,k),this.ctx=e}get isPaused(){return this._userPaused||this._systemPause.isPaused||this._uiPause.isPaused}get isAppPaused(){return this._systemPause.isPaused||this._uiPause.isPaused}get isSystemPaused(){return this._systemPause.isPaused}get isUIPaused(){return this._uiPause.isPaused}get isUserPaused(){return this._userPaused}pauseUser(){this.isAppPaused||(this._userPaused=!0)}resumeUser(){this.isAppPaused||(this._userPaused=!1)}pauseUI(e){this._uiPause.pause(e),this.ctx.notifyPauseStateChange()}resumeUI(e){this._uiPause.isPaused&&(this._uiPause.resume(e),this.ctx.notifyPauseStateChange())}pauseSystem(e){this._systemPause.pause(e),this.ctx.notifyPauseStateChange()}resumeSystem(e){this._systemPause.isPaused&&(this._systemPause.resume(e),this.ctx.notifyPauseStateChange())}resumeAll(){this.isPaused&&(this._uiPause.clear(),this._systemPause.clear(),this._userPaused=!1,this.ctx.notifyPauseStateChange())}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[N.observable],a=[N.observable],o=[N.observable],n=[N.computed],l=[N.computed],c=[N.computed],d=[N.computed],h=[N.computed],u=[N.action],p=[N.action],g=[N.action],f=[N.action],m=[N.action],y=[N.action],v=[N.action],Pr(e,null,s,{kind:"accessor",name:"_userPaused",static:!1,private:!1,access:{has:e=>"_userPaused"in e,get:e=>e._userPaused,set:(e,t)=>{e._userPaused=t}},metadata:t},w,S),Pr(e,null,a,{kind:"accessor",name:"_systemPause",static:!1,private:!1,access:{has:e=>"_systemPause"in e,get:e=>e._systemPause,set:(e,t)=>{e._systemPause=t}},metadata:t},_,O),Pr(e,null,o,{kind:"accessor",name:"_uiPause",static:!1,private:!1,access:{has:e=>"_uiPause"in e,get:e=>e._uiPause,set:(e,t)=>{e._uiPause=t}},metadata:t},x,k),Pr(e,null,n,{kind:"getter",name:"isPaused",static:!1,private:!1,access:{has:e=>"isPaused"in e,get:e=>e.isPaused},metadata:t},null,b),Pr(e,null,l,{kind:"getter",name:"isAppPaused",static:!1,private:!1,access:{has:e=>"isAppPaused"in e,get:e=>e.isAppPaused},metadata:t},null,b),Pr(e,null,c,{kind:"getter",name:"isSystemPaused",static:!1,private:!1,access:{has:e=>"isSystemPaused"in e,get:e=>e.isSystemPaused},metadata:t},null,b),Pr(e,null,d,{kind:"getter",name:"isUIPaused",static:!1,private:!1,access:{has:e=>"isUIPaused"in e,get:e=>e.isUIPaused},metadata:t},null,b),Pr(e,null,h,{kind:"getter",name:"isUserPaused",static:!1,private:!1,access:{has:e=>"isUserPaused"in e,get:e=>e.isUserPaused},metadata:t},null,b),Pr(e,null,u,{kind:"method",name:"pauseUser",static:!1,private:!1,access:{has:e=>"pauseUser"in e,get:e=>e.pauseUser},metadata:t},null,b),Pr(e,null,p,{kind:"method",name:"resumeUser",static:!1,private:!1,access:{has:e=>"resumeUser"in e,get:e=>e.resumeUser},metadata:t},null,b),Pr(e,null,g,{kind:"method",name:"pauseUI",static:!1,private:!1,access:{has:e=>"pauseUI"in e,get:e=>e.pauseUI},metadata:t},null,b),Pr(e,null,f,{kind:"method",name:"resumeUI",static:!1,private:!1,access:{has:e=>"resumeUI"in e,get:e=>e.resumeUI},metadata:t},null,b),Pr(e,null,m,{kind:"method",name:"pauseSystem",static:!1,private:!1,access:{has:e=>"pauseSystem"in e,get:e=>e.pauseSystem},metadata:t},null,b),Pr(e,null,y,{kind:"method",name:"resumeSystem",static:!1,private:!1,access:{has:e=>"resumeSystem"in e,get:e=>e.resumeSystem},metadata:t},null,b),Pr(e,null,v,{kind:"method",name:"resumeAll",static:!1,private:!1,access:{has:e=>"resumeAll"in e,get:e=>e.resumeAll},metadata:t},null,b),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Tr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ar=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Mr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Lr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Rr=(()=>{var e,t,r,i,s;let a,o,n,l,c,d,h,u,p,g,f=[],m=[],y=[],v=[],b=[],w=[],S=[],_=[],O=[];return e=class{get _hasShare(){return Mr(this,t,"f")}set _hasShare(e){Lr(this,t,e,"f")}get _hasFavorite(){return Mr(this,r,"f")}set _hasFavorite(e){Lr(this,r,e,"f")}get _hasLike(){return Mr(this,i,"f")}set _hasLike(e){Lr(this,i,e,"f")}get _height(){return Mr(this,s,"f")}set _height(e){Lr(this,s,e,"f")}constructor(e,a,o,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Tr(this,f),e)}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"sharePanel",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,Tr(this,m,!1)),r.set(this,(Tr(this,y),Tr(this,v,!1))),i.set(this,(Tr(this,b),Tr(this,w,!1))),s.set(this,(Tr(this,S),Tr(this,_,0))),Tr(this,O),this.storyManager=e,this.story=a,this.sharePanel=o,this.storyReaderStatisticV2Service=n}get model(){return this.story.model}get like(){return this.model.like}get favorite(){return this.model.favorite}get hasLike(){return this._hasLike&&!this.storyManager.config.anonymous}get hasShare(){return this._hasShare}get hasFavorite(){return this._hasFavorite&&!this.storyManager.config.anonymous}get hasAudio(){return Boolean(this.model.hasAudio)}get muted(){return this.story.muted}get needShown(){return this._hasLike||this._hasFavorite||this._hasShare||this.hasAudio}get height(){return this.needShown?this._height:0}async setLike(e){var t;if(this.like===e)return;const r=this.like;this.model.setLike(e);try{await this.storyManager.rootStore.storyStore.setStoryLike(this.story.id,e),this.model.setLike(e)}catch(e){this.model.setLike(r),console.error(e)}finally{const r=new ss(this.story,{value:1===e});this.storyManager.emit(r.name,r.toJSON()),this.storyReaderStatisticV2Service.sendLikeEvent({storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}}async setDislike(e){var t;if(this.like===e)return;const r=this.like;this.model.setLike(e);try{await this.storyManager.rootStore.storyStore.setStoryLike(this.story.id,e),this.model.setLike(e)}catch(e){this.model.setLike(r),console.error(e)}finally{const r=new rs(this.story,{value:-1===e});this.storyManager.emit(r.name,r.toJSON()),this.storyReaderStatisticV2Service.sendDislikeEvent({storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}}async setBookmark(e){var t;if(this.favorite===e)return;const r=this.favorite;try{this.model.setFavorite(e),await this.storyManager.rootStore.storyStore.setStoryBookmark(this.model,e)}catch(e){console.error(e),this.model.setFavorite(r)}finally{const r=new is(this.story,{value:e});this.storyManager.emit(r.name,r.toJSON()),this.storyReaderStatisticV2Service.sendFavoriteEvent({storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}}async share(){var e,t;const r=new as(this.story);if(this.storyManager.emit(r.name,r.toJSON()),this.story.activeSlide.screenshotShare)return this.sharePanel.shareScreenShot({shareId:"slide-screenshot-share",hideElementsSelector:"",storySlide:this.story.activeSlide}),void this.storyReaderStatisticV2Service.sendShareEvent({mode:1,storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(e=this.story.feed)||void 0===e?void 0:e.slug});await this.performShareText(),this.storyReaderStatisticV2Service.sendShareEvent({mode:0,storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.story.feed)||void 0===t?void 0:t.slug})}mute(){this.story.mute()}unmute(){this.story.unmute()}setOptions(e){var t;this._hasLike=Boolean(this.model.likeFunctional)&&Boolean(e.hasLike),this._hasShare=Boolean(this.model.shareFunctional)&&Boolean(null===(t=this.storyManager.rootStore.sessionStore.session)||void 0===t?void 0:t.share)&&Boolean(e.hasShare),this._hasFavorite=Boolean(this.model.favoriteFunctional)&&Boolean(e.hasFavorite)}setActionPanelHeight(e){this._height=50+e}async performShareText(){try{const e=await this.storyManager.rootStore.storyStore.fetchSharePathByStory(this.model);if(!e)return;this.model.setShareUrl(e);const t=new os(this.story,{url:e});this.storyManager.emit(t.name,t.toJSON());const r={title:this.story.title,text:"",url:e};this.sharePanel.shareText({shareId:"story-share",config:r,storySlide:this.story.activeSlide})}catch(e){console.error(e)}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;a=[N.observable],o=[N.observable],n=[N.observable],l=[N.observable],c=[N.computed],d=[N.computed],h=[N.action],u=[N.action],p=[N.action],g=[N.action],Ar(e,null,a,{kind:"accessor",name:"_hasShare",static:!1,private:!1,access:{has:e=>"_hasShare"in e,get:e=>e._hasShare,set:(e,t)=>{e._hasShare=t}},metadata:t},m,y),Ar(e,null,o,{kind:"accessor",name:"_hasFavorite",static:!1,private:!1,access:{has:e=>"_hasFavorite"in e,get:e=>e._hasFavorite,set:(e,t)=>{e._hasFavorite=t}},metadata:t},v,b),Ar(e,null,n,{kind:"accessor",name:"_hasLike",static:!1,private:!1,access:{has:e=>"_hasLike"in e,get:e=>e._hasLike,set:(e,t)=>{e._hasLike=t}},metadata:t},w,S),Ar(e,null,l,{kind:"accessor",name:"_height",static:!1,private:!1,access:{has:e=>"_height"in e,get:e=>e._height,set:(e,t)=>{e._height=t}},metadata:t},_,O),Ar(e,null,c,{kind:"getter",name:"needShown",static:!1,private:!1,access:{has:e=>"needShown"in e,get:e=>e.needShown},metadata:t},null,f),Ar(e,null,d,{kind:"getter",name:"height",static:!1,private:!1,access:{has:e=>"height"in e,get:e=>e.height},metadata:t},null,f),Ar(e,null,h,{kind:"method",name:"setLike",static:!1,private:!1,access:{has:e=>"setLike"in e,get:e=>e.setLike},metadata:t},null,f),Ar(e,null,u,{kind:"method",name:"setDislike",static:!1,private:!1,access:{has:e=>"setDislike"in e,get:e=>e.setDislike},metadata:t},null,f),Ar(e,null,p,{kind:"method",name:"setBookmark",static:!1,private:!1,access:{has:e=>"setBookmark"in e,get:e=>e.setBookmark},metadata:t},null,f),Ar(e,null,g,{kind:"method",name:"share",static:!1,private:!1,access:{has:e=>"share"in e,get:e=>e.share},metadata:t},null,f),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Br,Dr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Nr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Fr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Ur=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Close="closeGoodsWidget",e.Open="openGoodsWidget"}(Br||(Br={}));let Gr=(()=>{var e,t;let r,i=P.EventEmitter,s=[],a=[];return e=class extends i{get params(){return Fr(this,t,"f")}set params(e){Ur(this,t,e,"f")}constructor(e,r,i){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),t.set(this,Nr(this,s,{elementId:"",target:""})),Nr(this,a),this.storyManager=e,this.story=r,this.storyReaderStatisticV2Service=i}close(){this.story.touchController.enable(),this.story.resumeUI(this),this.story.activeSlide.closeLegacyGoodsWidget(this.params.elementId),this.emit(Br.Close)}open(e){var t;this.story.touchController.disable(),this.story.pauseUI(this),this.params=e,this.emit(Br.Open,e),this.storyManager.emit("widgetEvent",{name:"w-goods-open",data:{story_id:this.story.id,slide_index:this.story.activeSlideIndex,widget_id:e.elementId,skus:this.parseGoodsSkus(e.target)}}),this.storyReaderStatisticV2Service.sendEvent(new Ns({widget_id:null!==(t=e.elementId)&&void 0!==t?t:""}),!0)}onClick(e){var t;this.storyManager.emit("widgetEvent",{name:"w-goods-click",data:{story_id:this.story.id,slide_index:this.story.activeSlideIndex,widget_id:this.params.elementId,widget_value:e.sku}}),this.storyReaderStatisticV2Service.sendEvent(new Ds({widget_id:null!==(t=this.params.elementId)&&void 0!==t?t:"",widget_value:e.sku}),!0)}parseGoodsSkus(e){try{return JSON.parse(e)}catch(e){return[]}}},t=new WeakMap,(()=>{var t;const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=i[Symbol.metadata])&&void 0!==t?t:null):void 0;r=[N.observable],Dr(e,null,r,{kind:"accessor",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params,set:(e,t)=>{e.params=t}},metadata:o},s,a),o&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),e})();var Vr;!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(Vr||(Vr={}));class zr extends P.EventEmitter{constructor(){super(...arguments),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"currentProgress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progressBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timerPaused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"isCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"enabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"rafId",{enumerable:!0,configurable:!0,writable:!0,value:0})}get started(){return!this.isCompleted}get paused(){return this.timerPaused}setTimer(e){0!==e?(this.timerId=setTimeout(()=>this.complete({}),e),this.currentProgress=0,this.runTimerTicks(e)):this.forceEnd()}start(e){this.timerPaused||(this.stop(),this.progressBeforePause=0,this.timeout=e,this.enabled&&(this.isCompleted=!1,this.emit(Vr.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(Vr.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(Vr.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(Vr.Resume)}forceEnd(){this.complete({forceEnd:!0})}disable(){this.enabled=!1,this.stop()}enable(){this.enabled=!0,this.start(this.timeout)}complete({forceEnd:e=!1}){this.isCompleted=!0,this.progressBeforePause=0,this.clearTimer(),this.emit(Vr.Complete,{forceEnd:e})}clearTimer(){cancelAnimationFrame(this.rafId),null!==this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}updateProgress(e){const t=1-this.progressBeforePause;this.currentProgress=this.progressBeforePause+e*t;const r=100*this.currentProgress;this.emit(Vr.Progress,r)}runTimerTicks(e){let t=performance.now();const r=i=>{let s=(i-t)/e;s>1&&(s=1);let a=s;this.updateProgress(a),s<1&&(this.rafId=requestAnimationFrame(r))};this.rafId=requestAnimationFrame(r)}}var Wr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},$r=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Hr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},qr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Jr=(()=>{var e,t;let r,i,s,a,o=[],n=[],l=[];return e=class{get _hiddenTimeline(){return Hr(this,t,"f")}set _hiddenTimeline(e){qr(this,t,e,"f")}constructor(e){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:(Wr(this,o),e)}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new zr}),t.set(this,Wr(this,n,!1)),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:(Wr(this,l),({forceEnd:e})=>{e||this.story.activeSlide.notifyTimerEnd()})}),this.timer.on(Vr.Complete,this.handleTimerComplete)}get hiddenTimeline(){return 1===this.story.slides.length&&0===this.story.slides[0].duration||this.story.model.hideTimeline||this._hiddenTimeline}get paused(){return this.timer.paused}hide(){this._hiddenTimeline=!0}show(){this._hiddenTimeline=!1}destroy(){this.timer.off(Vr.Complete,this.handleTimerComplete)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.computed],s=[N.action],a=[N.action],$r(e,null,r,{kind:"accessor",name:"_hiddenTimeline",static:!1,private:!1,access:{has:e=>"_hiddenTimeline"in e,get:e=>e._hiddenTimeline,set:(e,t)=>{e._hiddenTimeline=t}},metadata:t},n,l),$r(e,null,i,{kind:"getter",name:"hiddenTimeline",static:!1,private:!1,access:{has:e=>"hiddenTimeline"in e,get:e=>e.hiddenTimeline},metadata:t},null,o),$r(e,null,s,{kind:"method",name:"hide",static:!1,private:!1,access:{has:e=>"hide"in e,get:e=>e.hide},metadata:t},null,o),$r(e,null,a,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Kr=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Zr=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Qr=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Yr=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Xr=(()=>{var e,t,r,i;let s,a,o,n=[],l=[],c=[],d=[],h=[],u=[];return e=class{get _isOpened(){return Qr(this,t,"f")}set _isOpened(e){Yr(this,t,e,"f")}get _id(){return Qr(this,r,"f")}set _id(e){Yr(this,r,e,"f")}get _config(){return Qr(this,i,"f")}set _config(e){Yr(this,i,e,"f")}constructor(e,s){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,Zr(this,n,!1)),r.set(this,(Zr(this,l),Zr(this,c,null))),i.set(this,(Zr(this,d),Zr(this,h,null))),Zr(this,u),this.story=e,this.storyReaderStatisticV2Service=s}get id(){return this._id}get config(){return this._config}get isOpened(){return this._isOpened}show(e,t){this._id=e,this._config=t,this._isOpened=!0,this.storyReaderStatisticV2Service.sendEvent(new Fs({widget_id:e,widget_label:String(t.configV2.main.question.text.value).trim()}),!0)}completeInput(e){this._id&&this._config&&this.storyReaderStatisticV2Service.sendEvent(new Us({widget_id:this._id,widget_label:String(this._config.configV2.main.question.text.value).trim(),widget_value:e}),!0)}close(){this._config=null,this._isOpened=!1}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[N.observable],a=[N.observable],o=[N.observable],Kr(e,null,s,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:t},n,l),Kr(e,null,a,{kind:"accessor",name:"_id",static:!1,private:!1,access:{has:e=>"_id"in e,get:e=>e._id,set:(e,t)=>{e._id=t}},metadata:t},c,d),Kr(e,null,o,{kind:"accessor",name:"_config",static:!1,private:!1,access:{has:e=>"_config"in e,get:e=>e._config,set:(e,t)=>{e._config=t}},metadata:t},h,u),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const ei=310/480,ti=428/805;var ri,ii,si=_(6166),ai=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},oi=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ni=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},li=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Started="started"}(ri||(ri={})),function(e){e.Prefetch="🔄",e.Init="🔧",e.Start="🟢",e.Stop="🛑",e.Attach="🔗",e.Detach="🗑️"}(ii||(ii={}));let ci=(()=>{var e,t,r,i,s,a;let o,n,l,c,d,h,u,p,g,f,m,y,v,b,w,S,_,O,x,k,C,P=E,j=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],F=[],U=[];return e=class extends P{get _activeSlideIndex(){return ni(this,t,"f")}set _activeSlideIndex(e){li(this,t,e,"f")}get _slides(){return ni(this,r,"f")}set _slides(e){li(this,r,e,"f")}get _needShowErrorScreen(){return ni(this,i,"f")}set _needShowErrorScreen(e){li(this,i,e,"f")}get _needShowLoaderScreen(){return ni(this,s,"f")}set _needShowLoaderScreen(e){li(this,s,e,"f")}get _$root(){return ni(this,a,"f")}set _$root(e){li(this,a,e,"f")}constructor(e,o,n,l,c,d,h){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(ai(this,j),e)}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"storySlideApiHandlersFactory",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"statisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"statisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:d}),Object.defineProperty(this,"cacheManager",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,ai(this,I,0)),r.set(this,(ai(this,T),ai(this,A,[]))),i.set(this,(ai(this,M),ai(this,L,!1))),s.set(this,(ai(this,R),ai(this,B,!1))),a.set(this,(ai(this,D),ai(this,F,null))),Object.defineProperty(this,"_activeSlideStartTime",{enumerable:!0,configurable:!0,writable:!0,value:(ai(this,U),0)}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pauseManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textInput",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sharePanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"actionPanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"goodsWidget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new si.Mutex}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:N.observable.object({attached:!1,inited:!1,started:!1,prefetched:!1})}),Object.defineProperty(this,"isLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleKeydown",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.handleSpaceKeydown(e),this.handleMKeydown(e)}}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{document.hidden?this.pauseSystem(this):this.resumeSystem(this)}}),this.pauseManager=new Ir(this),this.touchController=this.storyReader.touchController,this.slideApiHandlers=this.storySlideApiHandlersFactory.create(this),this.goodsWidget=new Gr(this.storyManager,this,this.statisticV2Service),this.textInput=new Xr(this,this.statisticV2Service),this.timeline=new Jr(this),this.sharePanel=new fr(this.storyManager,this,this.storyReader.touchController),this.actionPanel=new Rr(this.storyManager,this,this.sharePanel,this.statisticV2Service),this.isLoaded=this.story.canBeShown&&this.story.slides.length>0}get needShowErrorScreen(){return this._needShowErrorScreen||Boolean(this.error)}get needShowLoaderScreen(){return this.isLoaded?!this.slides.length||this._needShowLoaderScreen:!this.slides.length||!this.state.inited||this._needShowLoaderScreen}get id(){return this.story.id}get slides(){return this._slides}get $root(){return this._$root}get title(){return this.story.title}get statTitle(){return this.story.statTitle}get ugcPayload(){return this.story.ugcPayload}get displayStrategy(){return this.storyReader.displayStrategy}get context(){return this.story.context}get feed(){return this.storyReader.feed}get wasShown(){return this.story.wasShown}get model(){return this.story}get activeSlideIndex(){return this._activeSlideIndex}get activeSlide(){return this.getSlideByIndex(this._activeSlideIndex)}get activeSlideDuration(){return Date.now()-this._activeSlideStartTime}get slidesCount(){return this.story.slidesCount}get reachEnd(){return 0===this.slides.length||this.activeSlideIndex===this.slides.length-1}get reachStart(){return 0===this.activeSlideIndex}get disableClose(){return this.story.disableClose}get error(){return this.story.error}get pauseState(){return{isUserPaused:this.pauseManager.isUserPaused,isUIPaused:this.pauseManager.isUIPaused,isSystemPaused:this.pauseManager.isSystemPaused}}get muted(){return this.storyReader.muted}get isOpened(){return this.story.isOpened}get dir(){return this.storyReader.dir}get isSlideRendered(){return this.state.inited}get cover(){return this.activeSlide.cover}get isNextDisabled(){return this.storyReader.reachEnd&&this.reachEnd||this.activeSlide.disabledNextClick||this.activeSlide.navigationDisabled||this.pauseManager.isUIPaused}get isPrevDisabled(){return this.storyReader.reachStart&&this.reachStart||this.activeSlide.navigationDisabled||this.pauseManager.isUIPaused}nextSlide(){this.reachEnd||this.showSlide(this.activeSlideIndex+1)}prevSlide(){this.reachStart||this.showSlide(this.activeSlideIndex-1)}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}getSlideByIndex(e){var t;return null!==(t=this.slides[e])&&void 0!==t?t:new _r}async showSlide(e){var t;if(null===(t=this.toast)||void 0===t||t.destroy(),this.activeSlideIndex===e)return void await this.activeSlide.restart();const r=this.activeSlideIndex;await this.onSlideChange(e),this.emitSlideV1Stat(this.activeSlideIndex),this.emitSlideV2Stat(r,this.activeSlideDuration)}markAsOpened(){this.storyManager.rootStore.storyStore.markIsOpenedById(this.story.id)}markWasShown(){this.story.markWasShown()}setError(e){this.story.setError(e),e&&this.handleStoryError(e)}async reset(){this.textInput.close(),await this.slideApiHandlers.resetStory()}async recover(){const e=Boolean(this.error);this.hideErrorScreen(),this.showLoaderScreen();try{e?await this.storyReader.reloadStory(this):(await this.activeSlide.recover(),this._activeSlideStartTime=Date.now())}catch(e){console.error(e)}}nextSlideOrStory(){this.reachEnd?this.storyReader.nextStoryWithAnimation():this.nextSlide()}async prevSlideOrStory(){if(this.reachStart&&this.storyReader.reachStart){if(!this.state.started)return;await this.activeSlide.restart()}else this.reachStart?this.storyReader.prevStoryWithAnimation():this.prevSlide()}mute(){this.storyReader.mute(),this.activeSlide.mute()}unmute(){this.storyReader.unmute(),this.activeSlide.unmute()}showLayer(e){var t;this.statisticV2Service.sendSlideLayout({layoutIndex:e,storyId:this.id,activeSlideIndex:this.activeSlideIndex,feedSlug:null===(t=this.feed)||void 0===t?void 0:t.slug}),this.resumeUser(),this.activeSlide.showLayerByIndex(e)}pauseUser(){this.timeline.paused||(this.pauseManager.pauseUser(),this.pauseManager.isUserPaused&&this.activeSlide.pauseByUser())}resumeUser(){this.pauseManager.resumeUser(),this.pauseManager.isUserPaused||this.activeSlide.resumeByUser()}pauseUI(e){this.pauseManager.pauseUI(e)}resumeUI(e){this.pauseManager.resumeUI(e)}pauseSystem(e){this.pauseManager.pauseSystem(e)}resumeSystem(e){this.pauseManager.resumeSystem(e)}resumeAll(){this.pauseManager.resumeAll()}async updateNarrativeData(e){await this.storyManager.rootStore.storyStore.updateNarrativeData(this.id,e)}async detach(e){var t,r;if(!e.container&&this.state.attached){this._$root=null,null===(t=this.toast)||void 0===t||t.destroy(),this.slideApiHandlers.clearCardSession(),this.resumeAll(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),null===(r=this.slideApi)||void 0===r||r.destroy();for(const e of this._slides)await e.destroy();this.debug(`${ii.Detach} [Story Lifecycle] detached: `),this.commit({attached:!1,inited:!1,started:!1})}}async attach(e){e.container&&!this.state.attached&&(this._$root=e.container,await(0,N.when)(()=>this.story.canBeShown&&Boolean(this.story.slides.length)),this.slideApi=this.createSlideApi(e.container),this.createSlidesViewModels(this.story.slides,this.slideApi),this.debug(`${ii.Attach} [Story Lifecycle] attached: `),this.commit({attached:!0}))}async prefetch(e){e.canBeInited&&!this.state.prefetched&&(this===e.activeStory?await this.preload(1e3):await this.preload(0,2),this.debug(`${ii.Prefetch} [Story Lifecycle] prefetched: `),this.commit({prefetched:!0}))}async preload(e=1e3,t=this.slidesCount){const r=this.storyManager.config.cache;r&&(r.prefetch?await this.preloadSlides(0,t,e):await this.preloadActiveSlide(e))}async preloadSlides(e,t,r){t=null!=t?t:this._slides.length,r=null!=r?r:0,await Promise.all(this._slides.slice(e,t).map((e,i)=>e.preload(t-i+r)))}async preloadActiveSlide(e){this.preloadSlides(this._activeSlideIndex,this._activeSlideIndex+1,e)}async init(e){e.canBeInited&&this.state.attached&&!this.state.inited&&(await this.activeSlide.init(),this.debug(`${ii.Init} [Story Lifecycle] inited: `),this.commit({inited:!0}),this.isLoaded=!0)}async start(e){e.canBeStarted&&this.state.inited&&!this.state.started&&(this.emit(ri.Started),await this.activeSlide.start(),document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("keydown",this.handleKeydown),this._activeSlideStartTime=Date.now(),this.debug(`${ii.Start} [Story Lifecycle] started: `),this.commit({started:!0}))}async stop(e){var t;!e.canBeStarted&&this.state.started&&(null===(t=this.toast)||void 0===t||t.destroy(),this.slideApiHandlers.clearCardSession(),this.resumeAll(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),await this.activeSlide.stop({prepareForRestart:1}),this.debug(`${ii.Stop} [Story Lifecycle] stopped: `),this.commit({started:!1}))}canGoNext(){return this.activeSlide.canGoNext()}canGoPrev(){return this.activeSlide.canGoPrev()}showToast(e){var t;null===(t=this.toast)||void 0===t||t.destroy(),this.toast=new Kt(Object.assign(Object.assign({},e),{mountPoint:this.$root})),this.toast.show(e.content)}async destroy(){var e,t;document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),this.sharePanel.close(),this.textInput.close(),this.timeline.destroy(),this.goodsWidget.close(),this.slideApiHandlers.clearCardSession(),null===(e=this.slideApi)||void 0===e||e.destroy(),null===(t=this.toast)||void 0===t||t.destroy()}notifyPauseStateChange(){this.pauseManager.isUserPaused||(this.pauseManager.isAppPaused?this.activeSlide.pauseByApp():this.activeSlide.resumeByApp())}emitSlideV2Stat(e,t){var r;this.statisticV2Service.sendSlideEvent({durationMs:t,storyId:this.id,activeSlideIndex:e,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}emitSlideV1Stat(e){const t=new ns(this);this.storyManager.emit(t.name,t.toJSON()),this.statisticV1Service.sendOpenStoryEvent({storyId:this.id,slideIndex:e})}createSlideApi(e){const t=new tr.SlideApi(this.slideApiHandlers,{root:e,slideRatio:ei,isFullscreen:!1,nonce:q(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:this.actionPanel.height,useSdkCacheForMultislideMode:!1});return t.setSdkClientVariables(this.storyManager.config.options),t}async createSlidesViewModels(e,t){this._slides=e.map((e,r)=>new Sr(this,r,t,e,this.cacheManager))}handleSpaceKeydown(e){"Space"===e.code&&(this.pauseState.isUserPaused?this.resumeUser():this.pauseUser())}handleMKeydown(e){"KeyM"===e.code&&(this.muted?this.unmute():this.mute())}async onSlideChange(e){var t;try{const r=this.getSlideByIndex(this._activeSlideIndex),i=this.getSlideByIndex(e);this._activeSlideIndex=e,this.hideErrorScreen(),this.resumeAll(),(null===(t=this.storyManager.config.cache)||void 0===t?void 0:t.prefetch)||await this.preloadActiveSlide(1e3),this.slideApiHandlers.clearLayerSession(),await(null==r?void 0:r.stop({prepareForRestart:2})),await i.init(),await i.start(),this._activeSlideStartTime=Date.now()}catch(e){console.error(e)}}handleStoryError(e){const t=new cs({id:this.id,title:this.title,name:e.name,message:e.message});this.storyManager.emit(t.name,t.toJSON())}async update(e){try{await this.mutex.runExclusive(async()=>{await this.detach(e),await this.attach(e),await this.prefetch(e),await this.init(e),await this.stop(e),await this.start(e)})}catch(e){console.error(e)}}commit(e){Object.assign(this.state,e),this.state.attached||(this.state.inited=!1,this.state.started=!1,this.state.prefetched=!1),this.state.inited||(this.state.started=!1,this.state.prefetched=!1)}debug(e){}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=P[Symbol.metadata])&&void 0!==t?t:null):void 0;o=[N.observable],n=[N.observable],l=[N.observable],c=[N.observable],d=[N.observable],h=[N.computed],u=[N.computed],p=[N.computed],g=[N.computed],f=[N.computed],m=[(t=N.computed).struct.bind(t)],y=[N.computed],v=[N.computed],b=[N.action],w=[N.action],S=[N.action],_=[N.action],O=[N.action],x=[N.action],k=[N.action],C=[N.action],oi(e,null,o,{kind:"accessor",name:"_activeSlideIndex",static:!1,private:!1,access:{has:e=>"_activeSlideIndex"in e,get:e=>e._activeSlideIndex,set:(e,t)=>{e._activeSlideIndex=t}},metadata:r},I,T),oi(e,null,n,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:r},A,M),oi(e,null,l,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:r},L,R),oi(e,null,c,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:r},B,D),oi(e,null,d,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:r},F,U),oi(e,null,h,{kind:"getter",name:"needShowErrorScreen",static:!1,private:!1,access:{has:e=>"needShowErrorScreen"in e,get:e=>e.needShowErrorScreen},metadata:r},null,j),oi(e,null,u,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:r},null,j),oi(e,null,p,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:r},null,j),oi(e,null,g,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,j),oi(e,null,f,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,j),oi(e,null,m,{kind:"getter",name:"pauseState",static:!1,private:!1,access:{has:e=>"pauseState"in e,get:e=>e.pauseState},metadata:r},null,j),oi(e,null,y,{kind:"getter",name:"isNextDisabled",static:!1,private:!1,access:{has:e=>"isNextDisabled"in e,get:e=>e.isNextDisabled},metadata:r},null,j),oi(e,null,v,{kind:"getter",name:"isPrevDisabled",static:!1,private:!1,access:{has:e=>"isPrevDisabled"in e,get:e=>e.isPrevDisabled},metadata:r},null,j),oi(e,null,b,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,j),oi(e,null,w,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,j),oi(e,null,S,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,j),oi(e,null,_,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,j),oi(e,null,O,{kind:"method",name:"showSlide",static:!1,private:!1,access:{has:e=>"showSlide"in e,get:e=>e.showSlide},metadata:r},null,j),oi(e,null,x,{kind:"method",name:"markAsOpened",static:!1,private:!1,access:{has:e=>"markAsOpened"in e,get:e=>e.markAsOpened},metadata:r},null,j),oi(e,null,k,{kind:"method",name:"markWasShown",static:!1,private:!1,access:{has:e=>"markWasShown"in e,get:e=>e.markWasShown},metadata:r},null,j),oi(e,null,C,{kind:"method",name:"commit",static:!1,private:!1,access:{has:e=>"commit"in e,get:e=>e.commit},metadata:r},null,j),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class di{async openGame({gameInstanceId:e,gameOptions:t}){const r={};t&&(0,C.isObject)(t)&&null!=t.demoMode&&(r.demoMode=Boolean(t.demoMode));return(await ca.post(`game/${e}/launch`,r,{params:{expand:"config",fields:"splashScreen,splashLandscapeScreen,splashLottieScreen,screenOptions,config,resources,url,downloadUrl,instanceUserData,canTryReloadCount,loggerLevel,lottie,languageDirection"}})).data}}var hi;!function(e){e.Close="closeReader",e.OpenSharePanel="openSharePanel",e.StartGame="startGame",e.CloseGame="closeGame",e.EventGame="eventGame",e.RestartGame="restartGame",e.ErrorGame="errorGame"}(hi||(hi={}));const ui=new class{constructor(){Object.defineProperty(this,"_apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:"https://api.inappstory.ru"})}get apiUrl(){return this._apiUrl}parseAndDefine(e){const t=this.parseApiKey(e);return t&&(this._apiUrl=t),this._apiUrl}parseApiKey(e){if(!this.isValidApiKey(e))return null;try{const t=this.base64urlDecode(e),r=this.readHostLength(t);if(r>0){const e=this.readHostData(t,r),i=this.expandMask("{QQN{xuV?1Dv16j3",r),s=this.xorDecrypt(e,i,r),a=new URL(this.ensureHttps(s));return this.trimEndSlash(a.toString())}}catch(e){console.error(e)}return null}isValidApiKey(e){return e&&e.length>32}readHostLength(e){return e.charCodeAt(13)}readHostData(e,t){return e.slice(14,14+t).replace(/\0+$/,"")}xorDecrypt(e,t,r){let i="";for(let s=0;s<r;s++)i+=String.fromCharCode(e.charCodeAt(s)^t.charCodeAt(s));return i}ensureHttps(e){const t=e.trim();return t.startsWith("https://")?t:t.startsWith("http://")?"https://"+t.slice(7):"https://"+t}expandMask(e,t){let r=e,i=0;for(;r.length<t;)r+=e[i],i=(i+1)%e.length;return r}base64urlDecode(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=this.padRight(t);return window.atob(r)}padRight(e){const t=e.length%4;return 0===t?e:e+"=".repeat(4-t)}trimEndSlash(e){return e.replace(/\/$/,"")}};var pi;!function(e){e.TEXT="text",e.IMAGE="image"}(pi||(pi={}));class gi{constructor(e){var t;Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lang",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appPackageId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sdkVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiBaseUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userAgent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placeholders",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const r=this.storyManager.config,i=this.storyManager.rootStore.placeholderStore.placeholders,s=this.storyManager.rootStore.sessionStore.session;this.sessionId=s.id,this.userKey=s.userKey,this.apiKey=r.apiKey,this.sdkVersion="1.15.0",this.apiBaseUrl=ui.apiUrl,this.userAgent=e.userAgent,this.appPackageId=r.appPackageId,this.deviceId=be.deviceId,this.userId=null!==(t=r.userId)&&void 0!==t?t:"",this.lang=r.lang.toString(),this.placeholders=i.map(e=>this.mapPlaceholder(e))}mapPlaceholder(e){return{type:this.mapPlaceholderType(e.type),name:e.key,value:e.value}}mapPlaceholderType(e){switch(e){case xe.TEXT:return pi.TEXT;case xe.IMAGE:return pi.IMAGE}}toJSON(){return{sessionId:this.sessionId,lang:this.lang,apiKey:this.apiKey,userKey:this.userKey,appPackageId:this.appPackageId,deviceId:this.deviceId,userId:this.userId,sdkVersion:this.sdkVersion,apiBaseUrl:this.apiBaseUrl,userAgent:this.userAgent,placeholders:this.placeholders}}}class fi{constructor(e){Object.defineProperty(this,"rawData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"gameInstanceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.gameInstanceId=e.gameInstanceId,this.rawData=e}toJSON(){return this.rawData}}class mi{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.key=e.key,this.sha1=e.sha1}}class yi{constructor(e){Object.defineProperty(this,"fullScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"widescreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fullScreen=e.fullScreen,this.widescreen=e.widescreen,this.orientation=e.orientation}}class vi{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.sha1=e.sha1}}class bi{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"durationMinimalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.sha1=e.sha1,this.durationMinimalMs=e.durationMinimalMs}}class wi{constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sha1",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.size=e.size,this.sha1=e.sha1}}class Si{constructor(e,t,r,i){var s,a,o,n;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"gameDto",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"splashScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"splashLandscapeScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"splashLottieScreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"screenOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resources",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"downloadUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"instanceUserData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"canTryReloadCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"loggerLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lottie",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"languageDirection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.splashScreen=r.splashScreen?new wi(r.splashScreen):void 0,this.splashLandscapeScreen=r.splashLandscapeScreen?new vi(r.splashLandscapeScreen):void 0,this.splashLottieScreen=r.splashLottieScreen?new bi(r.splashLottieScreen):void 0,this.screenOptions=new yi(r.screenOptions),this.config=new fi(r.config),this.resources=null!==(a=null===(s=r.resources)||void 0===s?void 0:s.map(e=>new mi(e)))&&void 0!==a?a:[],this.url=r.url,this.downloadUrl=r.downloadUrl,this.instanceUserData=r.instanceUserData,this.clientConfig=new gi(t),this.canTryReloadCount=r.canTryReloadCount,this.loggerLevel=r.loggerLevel,this.lottie=r.lottie?{src:r.lottie.src}:void 0;const l=null!==(n=null===(o=r.languageDirection)||void 0===o?void 0:o.toLowerCase())&&void 0!==n?n:"auto";this.languageDirection="auto"===l?this.storyManager.config.dir:l}toInitDto(e){return Wt()(this.config.toJSON(),{clientConfig:Object.assign({fullScreen:this.isReaderInFullscreen(),screenOrientation:this.screenOptions.orientation,variables:this.storyManager.config.options,safeAreaInsets:e.safeAreaInsets,widescreen:e.isWidescreen,dir:this.languageDirection,nonce:q(),sdkFeatures:{gameShouldForegroundCallback:!0,writeToClipboard:!0}},this.clientConfig.toJSON())})}isReaderInFullscreen(){var e;const t=Boolean(null===(e=this.storyManager.config.hybridApp)||void 0===e?void 0:e.fullscreen);return Boolean(this.screenOptions.fullScreen)&&t}}class _i extends Error{constructor(e,t){super(e),Object.defineProperty(this,"canTryReload",{enumerable:!0,configurable:!0,writable:!0,value:t})}}class Oi extends Error{constructor(){super("[IAS]: game foreground timeout exceeded 60 seconds")}}class xi extends P.EventEmitter{constructor(e,t){super(),Object.defineProperty(this,"iframe",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"origin",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.messageListener=this.messageListener.bind(this),window.addEventListener("message",this.messageListener,!1)}open(e){return new Promise((t,r)=>{this.once("gameLoadFailed",(e,t)=>{r(new _i(e,t))}),this.once("gameLoaded",()=>t()),this.sendMessage("cb",{cb:"initGame",arguments:JSON.stringify([e])})})}waitForeground(e=6e4){return new Promise((t,r)=>{let i=null;const s=e=>{var r;a();const i=null!==(r=ve(e))&&void 0!==r?r:{};t("object"==typeof i?i:{})},a=()=>{i&&(clearTimeout(i),i=null),this.off("gameShouldForegroundCallback",s)};this.once("gameShouldForegroundCallback",s),i=setTimeout(()=>{a(),r(new Oi)},e)})}close(){window.removeEventListener("message",this.messageListener,!1),this.removeAllListeners()}sendMessage(e,t){var r;null===(r=this.iframe.contentWindow)||void 0===r||r.postMessage([e,t],this.origin)}pauseGameUI(){this.sendMessage("cb",{cb:"pauseUI",arguments:JSON.stringify([])})}resumeGameUI(){this.sendMessage("cb",{cb:"resumeUI",arguments:JSON.stringify([])})}shareComplete(e,t){this.sendMessage("shareComplete",{id:e,isSuccess:t})}closeGameReader(){this.sendMessage("closeGameReader")}sendGameCenterEventByApiRequest(e,t){this.sendMessage("cb",{cb:e,plainData:t})}notifyGameCanBeStarted(){this.sendMessage("gameShouldForeground")}messageListener(e){if(e.origin===this.origin)try{if(!Array.isArray(e.data))return void console.warn(`[IAS]: Invalid game MessageEvent data format ${e.data}`);const[t,...r]=e.data;this.emit(t,...r)}catch(e){console.error(e)}}}class ki{create(e,t){return new xi(e,t)}}class Ci{attach(e,t){e.on("sendApiRequest",async t=>{let r,i,s;try{const a=ve(t);r=a.id,i=a.data,s=a.cb,await ca.request({url:a.url,method:a.method,params:a.params,data:a.data,headers:a.headers}).catch(console.error),e.sendGameCenterEventByApiRequest(s,JSON.stringify({requestId:r,data:JSON.stringify(i.data),status:i.status,headers:i.headers}))}catch(t){if(t instanceof SyntaxError)return;if(!s)return;e.sendGameCenterEventByApiRequest(s,JSON.stringify({requestId:r,data:JSON.stringify(t),status:400,headers:[{}]}))}})}}class Pi{attach(e,t){e.on("writeToClipboard",e=>{var t;try{const{textValue:r}=null!==(t=ve(e))&&void 0!==t?t:{textValue:""};(new B).copy(r)}catch(e){console.error("[IAS]: ",e.message)}})}}class ji{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}attach(e,t){e.on("event",(e,t)=>{this.storyManager.emit("gameEvent",{name:e,payload:t}),this.storyManager.emit(hi.EventGame,{name:e,payload:t})})}}class Ei{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}attach(e,t){e.on("openUrl",e=>{var r;const{url:i}=null!==(r=ve(e))&&void 0!==r?r:{url:""},s={src:Ft.GameReader,data:{id:t.id,url:i,gameInstanceId:t.id}};this.storyManager.storyLinkClickHandler(s),this.storyManager.emit("clickOnButton",s)})}}class Ii{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"shareNotifier",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"handleShare",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{var r;const i=this.getFilteredConfigDto(t);let s=null!==(r=null==i?void 0:i.url)&&void 0!==r?r:"";try{const r=await this.getShareFiles(t);if(i.files=r.length>0?r:void 0,ye)return void this.openSharePanel({shareConfig:i,shareLink:s,shareId:e,shareText:i.text});await this.startNativeSharing(e,i)}catch(t){this.openSharePanel({shareConfig:i,shareLink:s,shareId:e,shareText:i.text})}}})}attach(e,t){e.on("share",this.handleShare)}async getShareFiles(e){const{files:t}=e;if(!Array.isArray(t)||0===t.length)return[];try{const e=t.map(e=>(async({file:e,name:t,type:r})=>{const i=await fetch(`data:${r};base64,${e}`),s=await i.blob();return new File([s],t,{type:r,lastModified:(new Date).getTime()})})(e));return await Promise.all(e)}catch(e){return console.warn("[IAS]: Error converting data URLs to files:",e),[]}}async startNativeSharing(e,t){try{await this.storyManager.shareHandler(t),this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!0})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;throw console.error(`[IAS]: Native sharing error: ${e.message}`),e}finally{this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!1})}}getFilteredConfigDto(e){const t={};for(const[r,i]of Object.entries(null!=e?e:{}))null!==i&&(t[r]=i);return t}openSharePanel({shareConfig:e,shareLink:t,shareId:r,shareText:i}){let s=Ot.Link;t||(s=Ot.Text),e.files&&e.files.length>0&&(s=Ot.Image,t=URL.createObjectURL(e.files[0])),this.shareNotifier.notifyOpenSharePanel({shareId:r,shareType:s,shareLink:t,shareText:i})}}class Ti{constructor(e,t,r){Object.defineProperty(this,"userKey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"gameInstanceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"instanceUserData",{enumerable:!0,configurable:!0,writable:!0,value:r})}set(e){window.localStorage.setItem(this.key,JSON.stringify(e))}get(){var e;let t={};const r=(0,C.isObject)(this.instanceUserData)?this.instanceUserData:{};try{const r=JSON.parse(null!==(e=window.localStorage.getItem(this.key))&&void 0!==e?e:"{}");(0,C.isObject)(r)&&(t=r)}catch(e){console.error(e)}return Wt()(t,r)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class Ai{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"handleSetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t,r)=>{try{const e=JSON.parse(r);if(new Ti(t.clientConfig.userKey,t.config.gameInstanceId,t.instanceUserData).set(e.data),this.storyManager.isStatisticsDisabled||!e.sendToServer)return;await ca.post(`game/${e.gameInstanceId}/instance-user-data`,{data:e.data})}catch(e){console.error(e)}}}),Object.defineProperty(this,"handleGetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:(e,t,r)=>{const{id:i,callback:s}=JSON.parse(r),a=new Ti(t.clientConfig.userKey,t.config.gameInstanceId,t.instanceUserData).get();e.sendMessage("cb",{cb:s,arguments:JSON.stringify([i,JSON.stringify(a)])})}})}attach(e,t){e.on("gameInstanceSetLocalData",r=>this.handleSetLocalData(e,t,r)),e.on("gameInstanceGetLocalData",r=>this.handleGetLocalData(e,t,r))}}class Mi{constructor(e){Object.defineProperty(this,"storyId",{enumerable:!0,configurable:!0,writable:!0,value:e})}set(e){sessionStorage.setItem(this.key,JSON.stringify(e))}get(){var e;const t=null!==(e=sessionStorage.getItem(this.key))&&void 0!==e?e:"{}";return window.__activeNarrativeId?JSON.parse(t):{}}get key(){return`narrative_${this.storyId}_data`}}class Li{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"session",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleSetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{try{const t=JSON.parse(e);if(!(0,C.isObject)(t))return;if(new Mi(t.storyId).set(t.data),this.storyManager.isStatisticsDisabled||!t.sendToServer)return;await ca.request({url:"story-data/"+t.storyId,method:"put",data:{data:t.data}})}catch(e){console.error(e)}}}),Object.defineProperty(this,"handleGetLocalData",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=JSON.parse(e);if(!(0,C.isObject)(t))return;const{id:r,storyId:i,callback:s}=t;let a=new Mi(i).get();this.session.sendMessage("cb",{cb:s,arguments:JSON.stringify([r,JSON.stringify(a)])})}})}attach(e,t){this.session=e,e.on("storySetLocalData",this.handleSetLocalData),e.on("storyGetLocalData",this.handleGetLocalData)}}class Ri{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{const t=this.storyManager.gameReader,r=this.storyManager.storyReader;if(await t.openGame(e.gameInstanceId),!t.isOpened)return;r.pauseUI(),t.once(hi.Close,()=>{r.resumeUI()})}catch(e){console.error(e)}}}class Bi{constructor(e,t,r,i,s){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s})}handle(e){var t;try{const r=e.linkTarget;this.storyReaderStatisticV2Service.sendLinkEvent({target:r,storyId:this.activeStory.id,activeSlideIndex:this.activeStory.activeSlideIndex,feedSlug:null===(t=this.storyReader.feed)||void 0===t?void 0:t.slug}),this.handleClickOnButton({url:r,elementId:e.elementId})}catch(t){t instanceof URIError?console.error(`[IAS]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}async handleClickOnButton(e){this.storyReaderStatisticV1Service.sendClickOnButtonEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),await this.storyReaderStatisticV1Service.sendData();const t={src:Ft.StoryReader,data:{id:this.activeStory.id,index:this.activeStory.activeSlideIndex,url:e.url,elementId:e.elementId}};this.storyManager.storyLinkClickHandler(t),this.storyManager.emit("clickOnButton",t)}}class Di{constructor(e,t,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i})}async handle(e){try{this.emitClickOnButtonEvent({src:Ft.StoryReader,data:{id:e.storyId,index:e.slideIndex,url:e.storyId.toString()}}),await this.storyReader.showStory(e.storyId)}catch(e){console.error(e)}}async emitClickOnButtonEvent(e){try{this.storyReaderStatisticV1Service.sendClickOnButtonEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),await this.storyReaderStatisticV1Service.sendData(),this.storyManager.storyLinkClickHandler(e),this.storyManager.emit("clickOnButton",e)}catch(e){console.error(e)}}}class Ni{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class Fi{constructor(e){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e})}toggleLoaderScreen(e){e?this.story.showLoaderScreen():this.story.hideLoaderScreen()}toggleErrorScreen(e){e?this.story.showErrorScreen():this.story.hideErrorScreen()}manageTimer(e,t){const r=this.story.timeline.timer;switch(e){case"start":this.startTimer(r,t);break;case"pause":r.pause();break;case"stop":case"before_start":r.stop()}}startTimer(e,t){e.paused?e.resume():e.started?(e.stop(),e.start(t)):e.start(t)}}class Ui{constructor(e,t){Object.defineProperty(this,"statisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"maxScrollPercent",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"layerIndex",{enumerable:!0,configurable:!0,writable:!0,value:0})}onVerticalScrollChange(e){this.switchSwipeGestureByScrollPercent(e.scrollPercent),this.updateMaxScrollPercent(e.scrollPercent),this.layerIndex=e.layerIndex}clear(){this.sendStatistic(),this.maxScrollPercent=0,this.layerIndex=0}switchSwipeGestureByScrollPercent(e){const t=this.story.touchController;e>0?t.disableVerticalSwipeGesture():(t.continueVerticalSwipeGesture(),t.enableVerticalSwipeGesture())}updateMaxScrollPercent(e){e>this.maxScrollPercent&&(this.maxScrollPercent=e)}sendStatistic(){this.statisticV2Service.sendEvent(new Gs({storyId:this.story.id,slideIndex:this.story.activeSlideIndex,scrollPercent:this.maxScrollPercent,layerIndex:this.layerIndex}),!0)}}class Gi{constructor(e,t,r,i,s){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"statisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"statisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"sessionNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Ni}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Ni}),Object.defineProperty(this,"widgetScrollViewController",{enumerable:!0,configurable:!0,writable:!0,value:null})}onVerticalScrollChange(e){e.isScrollableLayer&&(this.widgetScrollViewController||(this.widgetScrollViewController=new Ui(this.statisticV2Service,this.story)),this.widgetScrollViewController.onVerticalScrollChange(e))}onWidgetRequirePauseUI(){this.story.pauseUI(this)}onWidgetRequireResumeUI(){this.story.resumeUI(this)}productCartUpdate(e){return new Promise((t,r)=>{this.storyManager.emit("productCartUpdated",{offer:e.offer,onSuccess:t,onError:r})})}productCartClicked(){this.storyManager.emit("productCartClicked")}async productCartGetState(){return this.storyManager.products.getProductCartState()}onEvent(e,t){}onCardLoadingStateChange(e){}clearCardSession(){this.sessionNarrativeDataCache.clear(),this.clearLayerSession()}clearLayerSession(){var e;null===(e=this.widgetScrollViewController)||void 0===e||e.clear(),this.widgetScrollViewController=null}writeToClipboard(e){(new B).copy(e.textValue)}disableVerticalSwipeGesture(){this.storyReader.touchController.disableVerticalSwipeGesture()}enableVerticalSwipeGesture(){this.storyReader.touchController.enableVerticalSwipeGesture()}disableHorizontalSwipeGesture(){this.storyReader.touchController.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.storyReader.touchController.enableHorizontalSwipeGesture()}async getCardLocalData(){const e=this.storyManager.rootStore.sessionStore.userId;let t=this.narrativeDataCache.get(`narrative_${this.story.id}_data_${e}`);return t?JSON.parse(t):{}}setCardLocalData(e,t){const r=this.storyManager.rootStore.sessionStore.userId;let i=JSON.stringify(e);this.narrativeDataCache.set(`narrative_${this.story.id}_data_${r}`,i),this.story.context.updateNarrativeData(e),this.story.resumeUser(),t&&this.story.updateNarrativeData(i).catch(console.error)}getCardServerData(){var e;return null!==(e=this.story.context.widgetsData._narrative_saved_data)&&void 0!==e?e:null}showCardTextInput(e,t){this.story.textInput.show(e,t)}setCardSessionValue(e,t){this.sessionNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.sessionNarrativeDataCache.get(e)}getWidgetsSharedData(e){const t=this.story.context.widgetsData;switch(e){case"rangeSlider":return t._narrative_range_slider_data;case"poll":return t._narrative_poll_data;case"vote":return t._narrative_vote_data;case"reactions":return t._narrative_reactions_data}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await ca.request({url:e,method:t,params:null!=r?r:{},headers:null!=i?i:{},data:null!=s?s:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof L)return{status:null!==(o=e.networkStatus)&&void 0!==o?o:400,headers:null===(n=e.response)||void 0===n?void 0:n.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){null==e&&(e="story-share"),this.story.sharePanel.shareText({shareId:e,config:t,storySlide:this.story.activeSlide})}shareSlideScreenshot(e,t,r){null==e&&(e="slide-screenshot-share"),this.story.sharePanel.shareScreenShot({shareId:e,hideElementsSelector:null!=t?t:"",shareText:r,storySlide:this.story.activeSlide})}showLayer(e){this.clearLayerSession(),this.story.showLayer(e)}showCardSlide(e){this.story.showSlide(e)}cardShowNext(){this.storyReader.nextStoryWithAnimation()}showNextSlide(){this.story.nextSlide()}sendStatisticEvent(e,t,r,i){var s,a;this.storyManager.emit("widgetEvent",{name:e,data:Object.assign(Object.assign({},r),{feed:null===(s=this.storyReader.feed)||void 0===s?void 0:s.slug})}),this.statisticV2Service.sendWidgetEvent({type:e,widgetPayload:t,activeSlideIndex:this.story.activeSlideIndex,storyId:this.story.id,feedSlug:null===(a=this.story.feed)||void 0===a?void 0:a.slug},i)}async resetStory(){var e;let t={},r=await this.getCardLocalData();r=Object.assign({},null!==(e=this.getCardServerData())&&void 0!==e?e:{},r);for(let e in r)r.hasOwnProperty(e)&&/^_gm_[A-z0-9-_]+_attempts$/.test(e)&&(t[e]=r[e]);this.updateCardServerDataLocally(t),this.setCardLocalData(t,!0),this.showCardSlide(0),this.showLayer(0)}getCardFonts(){var e;const t=this.storyManager.rootStore.sessionStore.session;return null!==(e=null==t?void 0:t.fontsResources)&&void 0!==e?e:[]}async updateTimeline(e,t,r,i,s,a){if(this.story.activeSlideIndex!==e)return;const o=new Fi(this.story);"before_start"!==t&&(o.toggleLoaderScreen(s),o.toggleErrorScreen(a)),o.manageTimer(t,i)}updateCardServerDataLocally(e){this.story.context.updateNarrativeData(e)}showToast(e){this.story.showToast({content:e})}openUrl(e){var t;"swipeUpItems"===e.type?this.story.goodsWidget.open({elementId:null!==(t=e.elementId)&&void 0!==t?t:"",target:e.link.target}):new Bi(this.storyManager,this.storyReader,this.story,this.statisticV1Service,this.statisticV2Service).handle({elementId:e.elementId,linkTarget:e.link.target})}closeCard(e){this.storyReader.close(bs.CloseCustom)}openStory(e,t){this.story.id===e?this.story.showSlide(t):new Di(this.storyManager,this.storyReader,this.story,this.statisticV1Service).handle({storyId:e,slideIndex:t})}openGame(e){new Ri(this.storyManager,this.story).handle({gameInstanceId:e})}}class Vi{constructor(e,t,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:i})}create(e){return new Gi(this.storyManager,this.storyReader,e,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service)}}class zi{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get contentRatio(){return this.calculateWidth()/this.calculateHeight()}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this._vh*ei)}calculateHeight(){return Math.ceil(this.calculateWidth()/ei)}}class Wi{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get vw(){return this._vw}get vh(){return this._vh}get contentRatio(){return this.calculateWidth()/this.calculateHeight()}getWidth(){return"auto"}getHeight(){return"100%"}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this._vw)}calculateHeight(){return Math.ceil(this._vw/ti)}}class $i{constructor(e,t,r,i){Object.defineProperty(this,"windowViewport",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"desktopStoryViewport",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"actionPanelHeight",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"safeAreaFrameCalculator",{enumerable:!0,configurable:!0,writable:!0,value:i})}create(){const e=this.windowViewport.vw/this.windowViewport.vh;if(ye&&e>ei)return this.createDesktopStoryGeometry({vw:this.windowViewport.vw,vh:this.desktopStoryViewport.vh});{const e=this.safeAreaFrameCalculator.getViewportCorrectionPadding();return this.createMobileStoryGeometry({vw:this.windowViewport.vw,vh:this.windowViewport.vh-(e.top+e.bottom+this.actionPanelHeight)})}}createDesktopStoryGeometry(e){return new zi(e.vw,e.vh)}createMobileStoryGeometry(e){return new Wi(e.vw,e.vh)}}class Hi{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get shouldBeShownSafeAreaInsets(){return this.viewportRatio<ti}getViewportCorrectionPadding(){const e=this._vh-this._vw/ti,t=Math.max(Math.min(e-50,50),0);return{top:Math.max(e-t,0),bottom:t}}}class qi{constructor(e,t){Object.defineProperty(this,"showMultipleStoriesStrategy",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_feed",{enumerable:!0,configurable:!0,writable:!0,value:null})}get feed(){return this._feed}async show(e){var t,r;const i=this.storyManager.rootStore.onboardingFeedStore;this.throwIfAborted(e.signal);const s=await i.fetchOnboardingFeed({feedSlug:e.feedSlug,tags:null!==(t=e.customTags)&&void 0!==t?t:[],limit:null!==(r=e.limit)&&void 0!==r?r:void 0});this.throwIfAborted(e.signal),this._feed=s;const a=this.getFeedLoadEvent(s.slug,s.stories);return this.emitFeedLoad(a),s.stories.length?(await this.showMultipleStoriesStrategy.show({windowReferer:Dt.default,storyFeed:s,storyId:s.stories[0].id}),a):a}async handleNextStoryByIndex(e){this.showMultipleStoriesStrategy.handleNextStoryByIndex(e)}emitFeedLoad(e){this.storyManager.emit("feedLoad",e)}getFeedLoadEvent(e,t){const r={stories:t.map(e=>{const t={title:null,slidesCount:null};return e&&(t.title=e.statTitle,t.slidesCount=e.slidesCount),Object.assign({id:e.id},t)}),feed:null,filter:null};return r.feed=e,r}async reload(e){this.showMultipleStoriesStrategy.reload(e)}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}}class Ji{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stories",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"storyIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storyStore=this.storyManager.rootStore.storyStore}get feed(){return this.storyFeed}async show(e){const{storyId:t,windowReferer:r}=e;this.storyFeed=e.storyFeed,this.stories=this.getVisibleStoriesByStoryFeed(this.storyFeed),this.storyIndex=this.findStoryIndex(this.stories,t),this.storyReaderViewModel.open({windowReferer:r,id:t,stories:this.stories}),await this.storyStore.fetchStoriesSlides({stories:this.getStoriesByRange(this.storyIndex),feedSlug:this.storyFeed.slug})}async reload(e){const t=this.findStoryIndex(this.stories,e.storyId);await this.storyStore.fetchStoriesSlides({stories:this.getStoriesByRange(t),feedSlug:this.storyFeed.slug})}async handleNextStoryByIndex(e){await this.storyStore.fetchStoriesSlides({stories:this.getStoriesByRange(e),feedSlug:this.storyFeed.slug})}getVisibleStoriesByStoryFeed(e){var t;return null!==(t=e.stories.filter(e=>!e.hideInReader))&&void 0!==t?t:[]}findStoryIndex(e,t){return e.findIndex(e=>e.id===t)}getStoriesByRange(e){const t=e-2,r=e+2;return this.stories.slice(Math.max(t,0),r+1)}}class Ki{constructor(e){Object.defineProperty(this,"showStoryStrategy",{enumerable:!0,configurable:!0,writable:!0,value:e})}get feed(){return null}async show(e){await this.showStoryStrategy.show({storyId:e.storyId,fetchShareUrl:e.fetchShareUrl,signal:e.signal})}async reload(e){return this.showStoryStrategy.reload(e)}async handleNextStoryByIndex(e){}}class Zi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){try{this.throwIfAborted(e.signal);const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",once:!0});if(this.throwIfAborted(e.signal),r.error)throw r.error;if(r.isOpened)throw new Ae(e.storyId.toString());this.openStoryReader(r)}catch(e){throw this.storyReaderViewModel.close(),e}}openStoryReader(e){this.storyReaderViewModel.open({windowReferer:Dt.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}}class Qi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){this.throwIfAborted(e.signal);const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",fetchShareUrl:e.fetchShareUrl});this.throwIfAborted(e.signal),this.openStoryReader(r,e)}openStoryReader(e,t){this.storyReaderViewModel.open({windowReferer:Dt.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}}class Yi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}createShowStory(){return new Qi(this.storyManager,this.storyReaderViewModel)}createShowStoryOnce(){return new Zi(this.storyManager,this.storyReaderViewModel)}createShowStoryFromSharePage(){return new Ki(new Qi(this.storyManager,this.storyReaderViewModel))}createShowOnboardingStories(){return new qi(new Ji(this.storyManager,this.storyReaderViewModel),this.storyManager)}createShowMultipleStories(){return new Ji(this.storyManager,this.storyReaderViewModel)}}class Xi{constructor(e,t={}){var r,i,s,a;Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"title",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slidesCount",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"feedSlug",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"actionSource",{enumerable:!0,configurable:!0,writable:!0,value:Bt.list}),Object.defineProperty(this,"ugcPayload",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slideEventPayload",{enumerable:!0,configurable:!0,writable:!0,value:null});const o=null===(r=this.story.displayStrategy)||void 0===r?void 0:r.feed,n=null==o?void 0:o.type,l=null!==(i=null==o?void 0:o.slug)&&void 0!==i?i:null,c=o instanceof $e?o.filter:null;this.title=this.story.statTitle,this.slidesCount=this.story.slidesCount,this.ugcPayload=n===Re.UGC?this.story.ugcPayload:null,this.feedSlug=n===Re.DEFAULT?l:null,this.filter=c,this.actionSource=null!=n?this.getStorySourceByFeedType(n):Bt.direct,this.slideEventPayload=null!==(a=null===(s=e.activeSlide.eventPayload)||void 0===s?void 0:s.payload)&&void 0!==a?a:null}toJSON(){return Object.assign({id:this.story.id,index:this.story.activeSlideIndex,title:this.title,tags:this.tags,slidesCount:this.slidesCount,feed:this.feedSlug,filter:this.filter,source:this.actionSource,ugcPayload:this.ugcPayload,payload:this.slideEventPayload},this.payload)}getStorySourceByFeedType(e){switch(e){case Re.DEFAULT:case Re.UGC:return Bt.list;case Re.FAVORITE:return Bt.favorite;case Re.ONBOARDING:return Bt.onboarding;default:return Bt.list}}}class es extends Xi{get name(){return"closeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class ts extends Xi{get name(){return"closeStoryReader"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class rs extends Xi{get name(){return"dislikeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class is extends Xi{get name(){return"favoriteStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class ss extends Xi{get name(){return"likeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class as extends Xi{get name(){return"shareStory"}}class os extends Xi{get name(){return"shareStoryWithPath"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.url})}}class ns extends Xi{get name(){return"showSlide"}}class ls extends Xi{get name(){return"showStory"}toJSON(){const e=super.toJSON();return e.payload=null,e}}class cs{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get name(){return"showStoryFailed"}toJSON(){return{id:this.payload.id,title:this.payload.title,name:this.payload.name,message:this.payload.message}}}class ds{constructor(e,t,r,i,s){Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s})}emitTransitionEvents(e,t,r,i,s){this.emitOpenV1(r,i),r?(this.emitOpenV2(e,t,i),r&&this.emitCloseV2(e,t,r,s)):this.emitOpenReaderEvents(i)}emitOpenReaderEvents(e){var t;let r="list";this.storyReader.feed?this.storyReader.feed instanceof Ve?r="favorite":this.storyReader.feed instanceof ze&&(r="onboarding"):r="direct";const i={whence:r,storyId:e.id,activeSlideIndex:e.activeSlideIndex,feedSlug:null===(t=this.storyReader.feed)||void 0===t?void 0:t.slug};this.storyReaderStatisticV2Service.sendOpenEvent(i),e.wasShown||this.storyReaderStatisticV2Service.sendViewEvent(i)}emitOpenV2(e,t,r){var i;const s={whence:t>e?"next":"prev",storyId:r.id,activeSlideIndex:r.activeSlideIndex,feedSlug:null===(i=this.storyReader.feed)||void 0===i?void 0:i.slug};this.storyReaderStatisticV2Service.sendOpenEvent(s),r.wasShown||this.storyReaderStatisticV2Service.sendViewEvent(s)}emitOpenV1(e,t){this.storyReader.feed&&!t.wasShown&&this.storyFeedStatisticV1Service.sendCoverageEvent([t.model],this.storyReader.feed),e&&this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:e.id,slideIndex:e.activeSlideIndex});const r=new ls(t),i=new ns(t);this.storyManager.emit(r.name,r.toJSON()),this.storyManager.emit(i.name,i.toJSON())}emitCloseV2(e,t,r,i){var s;const a=t>e?bt.Next:bt.Prev;this.storyReaderStatisticV2Service.sendCloseEvent({cause:a,totalSlides:r.slidesCount,durationMs:i,storyId:r.id,activeSlideIndex:r.activeSlideIndex,feedSlug:null===(s=this.storyReader.feed)||void 0===s?void 0:s.slug})}}class hs{constructor(e,t,r=Date.now()){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blob",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lastAccessed",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"blobUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}updateLastAccessed(){this.lastAccessed=Date.now()}getOrCreateBlobUrl(){return this.blobUrl||(this.blobUrl=URL.createObjectURL(this.blob)),this.blobUrl}unlinkBlob(){this.blobUrl&&URL.revokeObjectURL(this.blobUrl)}destroy(){this.unlinkBlob()}}class us{constructor(e){Object.defineProperty(this,"driver",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"entries",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}async get(e){let t=this.entries.get(e);if(!t){const r=await this.driver.get(e);if(!r)return;t=new hs(r.url,r.blob,r.lastAccessed),this.entries.set(e,t)}return t}async loadAllEntries(){const e=await this.driver.getAll(),t=[];for(const r of e){const e=new hs(r.url,r.blob,r.lastAccessed);this.entries.set(r.url,e),t.push(e)}return t}async save(e){this.entries.set(e.url,e),await this.driver.set({url:e.url,blob:e.blob,lastAccessed:e.lastAccessed})}async updateAccessTime(e){this.entries.set(e.url,e),await this.driver.updateAccessTime(e.url,e.lastAccessed)}async delete(e){this.entries.delete(e),await this.driver.delete(e)}async getAll(){return Array.from(this.entries.values())}async clear(){for(const e of this.entries.values())e.destroy();this.entries.clear()}}class ps{constructor(e,t){Object.defineProperty(this,"dbName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storeName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dbName=e,this.storeName=t}async getDB(){return new Promise((e,t)=>{const r=indexedDB.open(this.dbName,1);r.onupgradeneeded=()=>{const e=r.result;if(!e.objectStoreNames.contains(this.storeName)){e.createObjectStore(this.storeName,{keyPath:"url"}).createIndex("lastAccessed","lastAccessed")}},r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}async get(e){const t=await this.getDB();return new Promise((r,i)=>{const s=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);s.onsuccess=()=>{const t=s.result;r(t?{url:e,lastAccessed:t.lastAccessed,blob:t.blob}:void 0)},s.onerror=()=>i(s.error)})}async set(e){const t=await this.getDB();return new Promise((r,i)=>{const s=t.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).put(e),s.oncomplete=()=>r(),s.onerror=()=>i(s.error)})}async updateAccessTime(e,t){const r=(await this.getDB()).transaction(this.storeName,"readwrite"),i=r.objectStore(this.storeName),s=await new Promise((t,r)=>{const s=i.get(e);s.onsuccess=()=>t(s.result),s.onerror=()=>r(s.error)});return s&&(s.lastAccessed=t,i.put(s)),new Promise((e,t)=>{r.oncomplete=()=>e(),r.onerror=()=>t(r.error)})}async delete(e){const t=await this.getDB();return new Promise((r,i)=>{const s=t.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).delete(e),s.oncomplete=()=>r(),s.onerror=()=>i(s.error)})}async getAll(){const e=await this.getDB();return new Promise((t,r)=>{const i=e.transaction(this.storeName,"readonly").objectStore(this.storeName).getAll();i.onsuccess=()=>t(i.result),i.onerror=()=>r(i.error)})}async clear(){const e=await this.getDB();return new Promise((t,r)=>{const i=e.transaction(this.storeName,"readwrite");i.objectStore(this.storeName).clear(),i.oncomplete=()=>t(),i.onerror=()=>r(i.error)})}}class gs{constructor(){Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}async get(e){return this.store.get(e)}async set(e){this.store.set(e.url,e)}async delete(e){this.store.delete(e)}async getAll(){return Array.from(this.store.values())}async clear(){this.store.clear()}async updateAccessTime(e,t){const r=await this.get(e);r&&(r.lastAccessed=t,this.set(r))}}class fs{constructor(e,t,r){var i,s;Object.defineProperty(this,"repository",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"loader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"urlLocks",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.options={maxSize:null!==(i=null==r?void 0:r.maxSize)&&void 0!==i?i:20,debug:Boolean(null==r?void 0:r.debug),ttl:null!==(s=null==r?void 0:r.ttl)&&void 0!==s?s:3600}}async init(){await this.repository.loadAllEntries(),await this.tryEvict()}async getAll(){return this.repository.getAll()}async get(e,t){const r=this.getMutexForUrl(e),i=await r.acquire();try{let r=await this.repository.get(e);return r||(r=await this.add(e,t)),r.updateLastAccessed(),r.getOrCreateBlobUrl(),this.options.debug&&console.log("[IAS]: Get from cache",r),await this.repository.updateAccessTime(r),r}finally{i()}}async tryEvict(){return[...await this.evictExpired(),...await this.evictOldest()]}async evictOldest(){const e=await this.repository.getAll();if(e.length<=this.options.maxSize)return[];const t=[],r=e.sort((e,t)=>e.lastAccessed-t.lastAccessed);for(;r.length>this.options.maxSize;){const e=r.shift();e&&(this.options.debug&&console.log("[IAS]: Remove oldest entry from cache",e),await this.removeEntry(e),t.push(e))}return t}async wait(){await Promise.all(Array.from(this.urlLocks.values()).map(e=>e.waitForUnlock()))}async evictExpired(){if(0===this.options.ttl)return[];const e=await this.repository.getAll(),t=Date.now(),r=[];for(const i of e)i.lastAccessed+1e3*this.options.ttl<t&&(this.options.debug&&console.log("[IAS]: Remove expired entry from cache",i),await this.removeEntry(i),r.push(i));return r}async add(e,t){const r=await this.loader.enqueue(e,t),i=new hs(e,r);return await this.repository.save(i),await this.tryEvict(),this.options.debug&&console.log("[IAS]: Add to cache",i),i}getMutexForUrl(e){let t=this.urlLocks.get(e);return t||(t=new si.Mutex,this.urlLocks.set(e,t)),t}cleanupLock(e){this.urlLocks.delete(e)}async removeEntry(e){e.destroy(),this.cleanupLock(e.url),await this.repository.delete(e.url)}}class ms{constructor(e){Object.defineProperty(this,"concurrency",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"semaphore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.semaphore=new si.Semaphore(e)}async enqueue(e,t){return await this.semaphore.runExclusive(async()=>{const t=await fetch(e,{cache:"no-store"});return await t.blob()},1,t)}wait(){return this.semaphore.waitForUnlock(this.concurrency)}clear(){this.semaphore.cancel()}async destroy(){this.clear(),await this.wait()}}class ys{get isDestroyed(){return this._isDestroyed}constructor(e){var t,r,i,s,a;Object.defineProperty(this,"lruCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"loader",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cacheRepository",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDestroyed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.options={maxSize:null!==(t=e.maxSize)&&void 0!==t?t:20,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5,debug:Boolean(e.debug),ttl:null!==(i=e.ttl)&&void 0!==i?i:3600,type:null!==(s=e.type)&&void 0!==s?s:"indexeddb",storeName:null!==(a=e.storeName)&&void 0!==a?a:"resources"};const o=this.createCacheDriver();this.cacheRepository=new us(o),this.loader=new ms(this.options.concurrency),this.lruCache=new fs(this.cacheRepository,this.loader,{maxSize:this.options.maxSize,debug:this.options.debug,ttl:this.options.ttl}),this.lruCache.init().catch(e=>console.error("[IAS]: LRU cache init error",e))}async preload(e){return(await Promise.allSettled(e.map(async e=>await this.lruCache.get(e.url,e.priority)))).filter(e=>"fulfilled"===e.status&&null!==e.value).map(e=>e.value)}async destroy(){try{this._isDestroyed=!0,await this.loader.destroy(),await this.lruCache.wait()}finally{await this.cacheRepository.clear(),this.options.debug&&console.log("[IAS]: Destroy LRU cache")}}createCacheDriver(){return"indexeddb"===this.options.type?new ps("ias-cache-v1",this.options.storeName):new gs}}var vs,bs,ws=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ss=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},_s=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Os=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Close="closeStoryReader"}(vs||(vs={})),function(e){e.CloseByBtn="closeReaderByCloseBtn",e.CloseByTimer="auto",e.CloseByEsc="closeReaderByEscBtn",e.CloseByLastSlideClick="lastSlideClick",e.CloseBySwipeDown="swipeDown",e.CloseCustom="customClose",e.AppClose="app-close"}(bs||(bs={}));let xs=(()=>{var e,t,r,i,s,a,o;let n,l,c,d,h,u,p,g,f,m,y,v,b,w,S,_,O,x,k,C,P,j,I,T,A,M,L,R,B,D,F=E,G=[],V=[],z=[],W=[],$=[],H=[],q=[],J=[],K=[],Z=[],Q=[],Y=[],X=[];return e=class extends F{get _muted(){return _s(this,t,"f")}set _muted(e){Os(this,t,e,"f")}get _closeGestureInAction(){return _s(this,r,"f")}set _closeGestureInAction(e){Os(this,r,e,"f")}get _stories(){return _s(this,i,"f")}set _stories(e){Os(this,i,e,"f")}get _activeStory(){return _s(this,s,"f")}set _activeStory(e){Os(this,s,e,"f")}get _activeStoryIndex(){return _s(this,a,"f")}set _activeStoryIndex(e){Os(this,a,e,"f")}get _targetTransitionIndex(){return _s(this,o,"f")}set _targetTransitionIndex(e){Os(this,o,e,"f")}constructor(e,n,l,c){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(ws(this,G),e)}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,ws(this,V,!0)),r.set(this,(ws(this,z),ws(this,W,!1))),i.set(this,(ws(this,$),ws(this,H,N.observable.array()))),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:(ws(this,q),new er(window))}),Object.defineProperty(this,"windowReferer",{enumerable:!0,configurable:!0,writable:!0,value:Dt.default}),Object.defineProperty(this,"_currentStoryDisplayStrategy",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"storyDisplayStrategyFactory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_touchController",{enumerable:!0,configurable:!0,writable:!0,value:new qt({touchStartTimeout:200})}),s.set(this,ws(this,J,null)),a.set(this,(ws(this,K),ws(this,Z,0))),o.set(this,(ws(this,Q),ws(this,Y,-1))),Object.defineProperty(this,"animatedNavigationController",{enumerable:!0,configurable:!0,writable:!0,value:(ws(this,X),null)}),Object.defineProperty(this,"_activeStoryStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"useModernLayout",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cacheManager",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"statisticsController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.handleWindowUnload=this.handleWindowUnload.bind(this),this.handleKeydown=this.handleKeydown.bind(this),window.addEventListener("beforeunload",this.handleWindowUnload),this.storyDisplayStrategyFactory=new Yi(e,this),this.statisticsController=new ds(this,this.storyManager,this.storyReaderStatisticV1Service,this.storyFeedStatisticV1Service,this.storyReaderStatisticV2Service)}get targetTransitionStory(){return this.stories[this._targetTransitionIndex]}get targetTransitionIndex(){return this._targetTransitionIndex}get touchController(){return this._touchController}get feed(){var e;return null===(e=this._currentStoryDisplayStrategy)||void 0===e?void 0:e.feed}get displayStrategy(){return this._currentStoryDisplayStrategy}get muted(){return this._muted}get closeGestureInAction(){return this._closeGestureInAction}get stories(){return this._stories}get activeStory(){return this._activeStory}get activeStoryDuration(){return Date.now()-this._activeStoryStartTime}get dir(){return this.storyManager.config.dir}get isOpened(){return Boolean(this.activeStory)}get activeStoryIndex(){return this._activeStoryIndex}get reachStart(){return 0===this._activeStoryIndex||this._stories[0]===this.targetTransitionStory}get reachEnd(){return this._activeStoryIndex===this.stories.length-1||this._stories[this._stories.length-1]===this.targetTransitionStory}open(e){var t,r;this.activeStory&&this.resetReaderToDefaultState(this.activeStory),this.storyManager.config.cache&&(this.cacheManager=new ys(this.storyManager.config.cache)),this.windowReferer=e.windowReferer,this.setStories(e.stories),this.setActiveStoryById(e.id),this.storyReaderStatisticV1Service.init({feedSlug:null===(r=null===(t=this._currentStoryDisplayStrategy)||void 0===t?void 0:t.feed)||void 0===r?void 0:r.slug}),this._touchController.init(document.body),this.hideScrollbar(e.windowReferer),document.addEventListener("keydown",this.handleKeydown)}close(e=bs.CloseByBtn,t=!1){var r;!t&&(null===(r=this.activeStory)||void 0===r?void 0:r.disableClose)||!this.activeStory||(this.emitCloseEvents(this.activeStory,e),this.resetReaderToDefaultState(this.activeStory,e))}emitCloseEvents(e,t){var r,i;this.emitStatisticV2StoryCloseEvent(e,t),this.emit(vs.Close,{id:e.id,type:null===(r=this.feed)||void 0===r?void 0:r.type,feed:null===(i=this.feed)||void 0===i?void 0:i.slug});const s=new ts(e,{action:t});this.storyManager.emit(s.name,s.toJSON())}emitStatisticV2StoryCloseEvent(e,t){var r;this.storyReaderStatisticV2Service.sendCloseReaderEvent({action:t,totalSlides:e.slidesCount,durationMs:this.activeStoryDuration,storyId:e.id,activeSlideIndex:e.activeSlideIndex,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}resetReaderToDefaultState(e,t){var r;const i=new es(e,{action:t});this.storyManager.emit(i.name,i.toJSON()),this.showScrollbar(this.windowReferer);const s=e.id,a=e.activeSlideIndex;this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:s,slideIndex:a}),e.markAsOpened(),this.storyReaderStatisticV1Service.destroy(),this.clearStoryViewModels(),this._touchController.destroy(),document.removeEventListener("keydown",this.handleKeydown),this._activeStory=null,null===(r=this.cacheManager)||void 0===r||r.destroy()}canBeClosed(){return!!this.activeStory&&!this.activeStory.disableClose}async showStory(e,t={}){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStory(),await this._currentStoryDisplayStrategy.show(Object.assign({storyId:e},t))}async showStoryOnce(e,t={}){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStoryOnce(),await this._currentStoryDisplayStrategy.show(Object.assign({storyId:e},t))}async showStoryFromSharePage(e,t={}){const r=this.storyDisplayStrategyFactory.createShowStoryFromSharePage();this._currentStoryDisplayStrategy=r,await r.show(Object.assign({storyId:e,fetchShareUrl:this.storyManager.isStatisticsDisabled},t))}async showOnboardingStories(e){if(this.storyManager.config.anonymous)return console.warn("[IAS]: You can't open onboarding in anonymous access mode"),{stories:[]};const t=this.storyDisplayStrategyFactory.createShowOnboardingStories();return this._currentStoryDisplayStrategy=t,t.show(e)}async showMultipleStories(e){var t;const r=this.storyDisplayStrategyFactory.createShowMultipleStories();this._currentStoryDisplayStrategy=r,await r.show({storyId:e.storyId,storyFeed:e.storyFeed,windowReferer:null!==(t=e.windowReferer)&&void 0!==t?t:Dt.default,filter:e.filter})}async reloadStory(e){var t;e.setError(null),null===(t=this._currentStoryDisplayStrategy)||void 0===t||t.reload({storyId:e.id})}nextStory(){this.reachEnd||this.setActiveStoryByIndex(this._activeStoryIndex+1)}prevStory(){this.reachStart||this.setActiveStoryByIndex(this._activeStoryIndex-1)}nextStoryWithAnimation(e){this.reachEnd?this.handleStoryReaderReachEnd(e):this.navigateStoryWithAnimation(this._activeStoryIndex+1,e)}prevStoryWithAnimation(e){this.reachStart||this.navigateStoryWithAnimation(this._activeStoryIndex-1,e)}toStoryWithAnimationByIndex(e){if(this.activeStoryIndex!==e)return this.navigateStoryWithAnimation(e,"")}navigateStoryWithAnimationByIndex(e,t){this.navigateStoryWithAnimation(e,t)}destroy(){var e;this.activeStory&&(this.emitCloseEvents(this.activeStory,bs.AppClose),this.resetReaderToDefaultState(this.activeStory)),this.removeAllListeners(),window.removeEventListener("beforeunload",this.handleWindowUnload),null===(e=this.cacheManager)||void 0===e||e.destroy()}closeGoodsWidget(){var e;null===(e=this.activeStory)||void 0===e||e.goodsWidget.close()}setAnimatedNavigationController(e){this.animatedNavigationController=e}mute(){this._muted=!0}unmute(){this._muted=!1}enableCloseGesture(){this._closeGestureInAction=!0}disableCloseGesture(){this._closeGestureInAction=!1}pauseUI(){var e;this.storyReaderStatisticV1Service.pause(),null===(e=this.activeStory)||void 0===e||e.pauseUI(this)}resumeUI(){var e;this.storyReaderStatisticV1Service.resume(),null===(e=this.activeStory)||void 0===e||e.resumeUI(this)}goNext(){this.navigate(1)}goPrev(){this.navigate(-1)}navigate(e){if(!this.activeStory||this.activeStory.pauseState.isUIPaused)return;e=this.storyManager.config.isLtr?e:-e,this.useModernLayout?this.handleModernNavigation(this.activeStory,e):this.handleLegacyNavigation(e)}handleModernNavigation(e,t){1===t?!e.isNextDisabled&&e.canGoNext()&&e.nextSlideOrStory():!e.isPrevDisabled&&e.canGoPrev()&&e.prevSlideOrStory()}handleLegacyNavigation(e){1!==e||this.reachEnd?-1!==e||this.reachStart||this.prevStoryWithAnimation():this.nextStoryWithAnimation()}setStories(e){const t=new Vi(this.storyManager,this,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service);for(const r of e)this._stories.push(new ci(this.storyManager,this,r,t,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service,this.cacheManager))}handleKeydown(e){this.handleEscKeydown(e),this.handleArrowKeydown(e)}handleEscKeydown(e){"Escape"===e.code&&this.close(bs.CloseByEsc)}handleArrowKeydown(e){"ArrowRight"===e.code&&this.goNext(),"ArrowLeft"===e.code&&this.goPrev()}clearStoryViewModels(){for(const e of this._stories)e.destroy();this._stories=N.observable.array()}hideScrollbar(e){e===Dt.default&&this.scrollbarHelper.hide()}showScrollbar(e){e===Dt.default&&this.scrollbarHelper.show()}handleWindowUnload(e){this.activeStory&&(this.emitStatisticV2StoryCloseEvent(this.activeStory,bs.AppClose),this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),this.storyReaderStatisticV1Service.sendData())}setActiveStoryById(e){const t=this.stories.findIndex(t=>t.id===e);if(-1===t)throw new Error(`[IAS]: No story found with ID ${e}`);return this.setActiveStoryByIndex(t)}setActiveStoryByIndex(e){const t=this._activeStoryIndex,r=this._activeStory,i=this.stories[e];if(i)return this.updateActiveStory(e,r,i),i.once(ri.Started,()=>{this.statisticsController.emitTransitionEvents(t,e,r,i,this.activeStoryDuration),this._activeStoryStartTime=Date.now()}),i.markAsOpened(),i}updateActiveStory(e,t,r){return this._activeStoryIndex=e,this._activeStory=r,r}handleStoryReaderReachEnd(e){var t;e!==bs.CloseByTimer?this.close(bs.CloseByLastSlideClick):(null===(t=this.animatedNavigationController)||void 0===t?void 0:t.options.closeOnLastSlideByTimer)&&this.close(bs.CloseByTimer)}async navigateStoryWithAnimation(e,t="lastSlideClick"){this.animatedNavigationController&&!this.animatedNavigationController.animating&&-1===this._targetTransitionIndex&&(e=this.limitIndex(e),this._targetTransitionIndex=e,this._currentStoryDisplayStrategy.handleNextStoryByIndex(e),await this.animatedNavigationController.transitionByIndex(e,this._activeStoryIndex),await this.handleTransitionEnd(e,t))}limitIndex(e){return Math.max(0,Math.min(this.stories.length-1,e))}async handleTransitionEnd(e,t){if(this.activeStory){const e=new es(this.activeStory,{action:t});this.storyManager.emit(e.name,e.toJSON())}await this.setActiveStoryByIndex(e),this._targetTransitionIndex=-1}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=F[Symbol.metadata])&&void 0!==t?t:null):void 0;n=[N.observable],l=[N.observable],c=[N.observable],d=[N.observable],h=[N.observable],u=[N.observable],p=[N.computed],g=[N.computed],f=[N.computed],m=[N.computed],y=[N.action],v=[N.action],b=[U],w=[U],S=[U],_=[U],O=[U],x=[N.action],k=[N.action],C=[N.action],P=[N.action],j=[N.action],I=[N.action],T=[N.action],A=[N.action],M=[N.action],L=[N.action],R=[N.action],B=[N.action],D=[N.action],Ss(e,null,n,{kind:"accessor",name:"_muted",static:!1,private:!1,access:{has:e=>"_muted"in e,get:e=>e._muted,set:(e,t)=>{e._muted=t}},metadata:r},V,z),Ss(e,null,l,{kind:"accessor",name:"_closeGestureInAction",static:!1,private:!1,access:{has:e=>"_closeGestureInAction"in e,get:e=>e._closeGestureInAction,set:(e,t)=>{e._closeGestureInAction=t}},metadata:r},W,$),Ss(e,null,c,{kind:"accessor",name:"_stories",static:!1,private:!1,access:{has:e=>"_stories"in e,get:e=>e._stories,set:(e,t)=>{e._stories=t}},metadata:r},H,q),Ss(e,null,d,{kind:"accessor",name:"_activeStory",static:!1,private:!1,access:{has:e=>"_activeStory"in e,get:e=>e._activeStory,set:(e,t)=>{e._activeStory=t}},metadata:r},J,K),Ss(e,null,h,{kind:"accessor",name:"_activeStoryIndex",static:!1,private:!1,access:{has:e=>"_activeStoryIndex"in e,get:e=>e._activeStoryIndex,set:(e,t)=>{e._activeStoryIndex=t}},metadata:r},Z,Q),Ss(e,null,u,{kind:"accessor",name:"_targetTransitionIndex",static:!1,private:!1,access:{has:e=>"_targetTransitionIndex"in e,get:e=>e._targetTransitionIndex,set:(e,t)=>{e._targetTransitionIndex=t}},metadata:r},Y,X),Ss(e,null,p,{kind:"getter",name:"targetTransitionStory",static:!1,private:!1,access:{has:e=>"targetTransitionStory"in e,get:e=>e.targetTransitionStory},metadata:r},null,G),Ss(e,null,g,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:r},null,G),Ss(e,null,f,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,G),Ss(e,null,m,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,G),Ss(e,null,y,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:r},null,G),Ss(e,null,v,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:r},null,G),Ss(e,null,b,{kind:"method",name:"showStory",static:!1,private:!1,access:{has:e=>"showStory"in e,get:e=>e.showStory},metadata:r},null,G),Ss(e,null,w,{kind:"method",name:"showStoryOnce",static:!1,private:!1,access:{has:e=>"showStoryOnce"in e,get:e=>e.showStoryOnce},metadata:r},null,G),Ss(e,null,S,{kind:"method",name:"showStoryFromSharePage",static:!1,private:!1,access:{has:e=>"showStoryFromSharePage"in e,get:e=>e.showStoryFromSharePage},metadata:r},null,G),Ss(e,null,_,{kind:"method",name:"showOnboardingStories",static:!1,private:!1,access:{has:e=>"showOnboardingStories"in e,get:e=>e.showOnboardingStories},metadata:r},null,G),Ss(e,null,O,{kind:"method",name:"showMultipleStories",static:!1,private:!1,access:{has:e=>"showMultipleStories"in e,get:e=>e.showMultipleStories},metadata:r},null,G),Ss(e,null,x,{kind:"method",name:"reloadStory",static:!1,private:!1,access:{has:e=>"reloadStory"in e,get:e=>e.reloadStory},metadata:r},null,G),Ss(e,null,k,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:r},null,G),Ss(e,null,C,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:r},null,G),Ss(e,null,P,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:r},null,G),Ss(e,null,j,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:r},null,G),Ss(e,null,I,{kind:"method",name:"toStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"toStoryWithAnimationByIndex"in e,get:e=>e.toStoryWithAnimationByIndex},metadata:r},null,G),Ss(e,null,T,{kind:"method",name:"navigateStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimationByIndex"in e,get:e=>e.navigateStoryWithAnimationByIndex},metadata:r},null,G),Ss(e,null,A,{kind:"method",name:"mute",static:!1,private:!1,access:{has:e=>"mute"in e,get:e=>e.mute},metadata:r},null,G),Ss(e,null,M,{kind:"method",name:"unmute",static:!1,private:!1,access:{has:e=>"unmute"in e,get:e=>e.unmute},metadata:r},null,G),Ss(e,null,L,{kind:"method",name:"enableCloseGesture",static:!1,private:!1,access:{has:e=>"enableCloseGesture"in e,get:e=>e.enableCloseGesture},metadata:r},null,G),Ss(e,null,R,{kind:"method",name:"disableCloseGesture",static:!1,private:!1,access:{has:e=>"disableCloseGesture"in e,get:e=>e.disableCloseGesture},metadata:r},null,G),Ss(e,null,B,{kind:"method",name:"navigateStoryWithAnimation",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimation"in e,get:e=>e.navigateStoryWithAnimation},metadata:r},null,G),Ss(e,null,D,{kind:"method",name:"handleTransitionEnd",static:!1,private:!1,access:{has:e=>"handleTransitionEnd"in e,get:e=>e.handleTransitionEnd},metadata:r},null,G),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class ks{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new Ke,t=new $s(this.storyManager,e);return new xs(this.storyManager,t,new Hs(this.storyManager,new Ze(this.storyManager)),new He(this.storyManager,e))}}class Cs extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{c:this.mapCloseStoryReaderActionToCause(this.payload.action),st:this.payload.totalSlides,d:this.payload.durationMs})}mapCloseStoryReaderActionToCause(e){switch(e){case bs.CloseByBtn:return bt.ButtonClose;case bs.CloseByTimer:return bt.AutoClose;case bs.CloseByEsc:return bt.ButtonClose;case bs.CloseByLastSlideClick:return bt.AutoClose;case bs.CloseBySwipeDown:return bt.SwipeClose;case bs.CloseCustom:return bt.CustomClose;case bs.AppClose:return bt.AppClose;default:bt.AppClose}}}class Ps extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"open"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{w:this.payload.whence})}}class js extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"dislike"}}class Es extends vt{constructor(e){super(e)}get type(){return"favorite"}}class Is extends vt{constructor(e){super(e)}get type(){return"like"}}class Ts extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"share"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{m:this.payload.mode})}}class As extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"layout-show"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{li:this.payload.layoutIndex})}}class Ms extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"link"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{t:this.payload.target})}}class Ls extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"slide"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{d:this.payload.durationMs})}}class Rs extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"view"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{w:this.payload.whence})}}class Bs extends vt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return this.payload.type}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),this.payload.widgetPayload)}}class Ds{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-goods-click"}toQueryParams(){return{wi:this.payload.widget_id,wv:this.payload.widget_value}}toJSON(){return this.payload}}class Ns{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-goods-open"}toQueryParams(){return{wi:this.payload.widget_id}}toJSON(){return this.payload}}class Fs{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-data-input-focus"}toQueryParams(){return{wi:this.payload.widget_id,wl:this.payload.widget_label}}}class Us{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-data-input-save"}toQueryParams(){return{wi:this.payload.widget_id,wl:this.payload.widget_label,wv:this.payload.widget_value}}toJSON(){return this.payload}}class Gs{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-scrollview-impression"}toQueryParams(){return{i:this.payload.storyId,si:this.payload.slideIndex,li:this.payload.layerIndex,v:this.payload.scrollPercent}}toJSON(){return this.payload}}class Vs{constructor(e){Object.defineProperty(this,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timerId",{enumerable:!0,configurable:!0,writable:!0,value:null})}start(){this.schedule(1e4)}stop(){null!=this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}async flush(){D(`[${$s.name}]: flush statistics by timer`);this.statisticsService.getEvents().length>0?this.schedule(1e4):this.schedule(3e4),await this.statisticsService.sendData()}schedule(e){D(`[${$s.name}]: schedule flush statistics on ${e}ms`),this.timerId=setTimeout(()=>this.flush(),e)}}class zs{constructor(){Object.defineProperty(this,"startTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"durationBeforePause",{enumerable:!0,configurable:!0,writable:!0,value:0})}calculate(){const e=Date.now(),t=e-this.startTime+this.durationBeforePause;return this.startTime=e,this.durationBeforePause=0,t}init(){this.durationBeforePause=0,this.startTime=Date.now()}pause(){this.durationBeforePause+=Date.now()-this.startTime}resume(){this.startTime=Date.now()}}class Ws{constructor(e,t,r,i,s){Object.defineProperty(this,"action",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"lastIndex",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"slideIndex",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideDuration",{enumerable:!0,configurable:!0,writable:!0,value:s})}toDTO(){return[this.action,this.lastIndex,this.storyId,this.slideIndex,this.slideDuration]}}class $s extends(j()){constructor(e,t){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV1Api",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lastIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sourceInfo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"flushSheduler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideDurationCalculator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lastClickOnButtonEvent",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.flushSheduler=new Vs(this),this.slideDurationCalculator=new zs}init(e){this.events=[],this.lastClickOnButtonEvent=null,this.sourceInfo=e,this.lastIndex=0,this.slideDurationCalculator.init(),this.flushSheduler.start()}getEvents(){return this.events.slice()}getLastIndex(){return this.lastIndex}async pause(){this.slideDurationCalculator.pause(),this.flushSheduler.stop(),await this.sendData()}resume(){this.slideDurationCalculator.resume(),this.flushSheduler.start()}sendOpenStoryEvent(e){if(this.wasClickOnButtonEvent(e))return void(this.lastClickOnButtonEvent=null);const t=this.slideDurationCalculator.calculate(),r=new Ws(1,this.lastIndex,e.storyId,e.slideIndex,t);this.addSlideEvent(r)}sendClickOnButtonEvent(e){const t=this.slideDurationCalculator.calculate(),r=new Ws(2,this.lastIndex,e.storyId,e.slideIndex,t);this.lastClickOnButtonEvent=r,this.addSlideEvent(r)}async sendData(){if(!this.sourceInfo)throw new Error("[IAS STAT V1]: You need pass source info!");const e=this.getEvents();if(!this.isEventsSendDisabled(e))try{this.cleanupData(),await this.statisticV1Api.sendStatisticEvent({data:e.map(e=>e.toDTO())})}catch(t){this.events.push(...e),console.error(t)}}async destroy(){this.flushSheduler.stop(),await this.sendData()}addSlideEvent(e){this.storyManager.isStatisticsDisabled||(this.events.push(e),this.lastIndex++)}cleanupData(){this.events=[]}wasClickOnButtonEvent(e){return this.lastClickOnButtonEvent&&this.lastClickOnButtonEvent.storyId===e.storyId&&this.lastClickOnButtonEvent.slideIndex===e.slideIndex}isEventsSendDisabled(e){var t;return 0===e.length||this.storyManager.isStatisticsDisabled||(null===(t=this.sourceInfo)||void 0===t?void 0:t.feedSlug)===We}}class Hs{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV2Api",{enumerable:!0,configurable:!0,writable:!0,value:t})}sendViewEvent(e){this.sendEvent(new Rs(e))}sendOpenEvent(e){this.sendEvent(new Ps(e))}sendCloseEvent(e){this.sendEvent(new St(e))}sendCloseReaderEvent(e){this.sendEvent(new Cs(e))}sendSlideLayout(e){this.sendEvent(new As(e))}sendLinkEvent(e){this.sendEvent(new Ms(e))}sendLikeEvent(e){this.sendEvent(new Is(e))}sendDislikeEvent(e){this.sendEvent(new js(e))}sendFavoriteEvent(e){this.sendEvent(new Es(e))}sendShareEvent(e){this.sendEvent(new Ts(e))}sendSlideEvent(e){this.sendEvent(new Ls(e))}sendWidgetEvent(e,t=!1){this.sendEvent(new Bs(e),t)}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class qs extends Error{constructor(e){super(`Invalid language tag: ${e}. The "lang" value must be comply with the RFC 5646 (also known as BCP 47). Examples of valid language tags include "en-US", "fr-FR", "es-ES", etc.`),this.name="IasInvalidLanguageTagError"}}const Js="en-US";class Ks{constructor(e=Js){Object.defineProperty(this,"languageCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"countryCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tag",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rawData",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.rawData=e;const t=this.normalizeAndEnsureCompatibility(e),r=this.validateTag(t);this.parseTag(r)}isValidTag(e){return/^[a-z]+-[a-zA-Z]+$/.test(e)}toRawData(){return this.rawData}toString(){return this.tag}normalizeAndEnsureCompatibility(e){const t=e.toLowerCase();return this.ensureBackwardCompatibility(t)}ensureBackwardCompatibility(e){var t;return null!==(t={ru:"ru-RU",en:"en-US"}[e])&&void 0!==t?t:e}validateTag(e){return this.isValidTag(e)?e:(console.error(new qs(e).message),this.getNavigatorTag())}getNavigatorTag(){const e=navigator.language.toLowerCase();return this.isValidTag(e)?e:(console.error(`Invalid navigator language tag: ${e}`),Js)}parseTag(e){const[t,r]=e.split("-");this.languageCode=t,this.countryCode=r.toUpperCase(),this.tag=`${this.languageCode}-${this.countryCode}`}}class Zs{constructor(e){var t,r;Object.defineProperty(this,"fullscreen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"safeAreaInsets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fullscreen=null!==(t=e.fullscreen)&&void 0!==t&&t,this.safeAreaInsets=null!==(r=e.safeAreaInsets)&&void 0!==r?r:null}}class Qs extends Error{constructor(){super("[IAS]: you must pass the <userId> value"),this.name="IasEmptyUserIdError"}}class Ys extends Error{constructor(e,t){super(`[IAS]: tags (joined by ',') "${e.join(",")}" is bigger then ${t} bytes`),this.name="IasTagsLengthError"}}class Xs extends Error{constructor(e,t){super(`[IAS]: userId "${e}" is bigger then ${t} bytes`),this.name="IasUserIdLengthError"}}var ea=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ta=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ra=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},ia=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let sa=(()=>{var e,t,r,i,s,a,o,n;let l,c,d,h,u,p,g,f,m=P.EventEmitter,y=[],v=[],b=[],w=[],S=[],_=[],O=[],x=[],k=[],j=[],E=[],I=[],T=[],A=[],M=[];return e=class extends m{get _apiKey(){return ra(this,t,"f")}set _apiKey(e){ia(this,t,e,"f")}get _tags(){return ra(this,r,"f")}set _tags(e){ia(this,r,e,"f")}get _lang(){return ra(this,i,"f")}set _lang(e){ia(this,i,e,"f")}get _dir(){return ra(this,s,"f")}set _dir(e){ia(this,s,e,"f")}get _anonymous(){return ra(this,a,"f")}set _anonymous(e){ia(this,a,e,"f")}get _options(){return ra(this,o,"f")}set _options(e){ia(this,o,e,"f")}get _userId(){return ra(this,n,"f")}set _userId(e){ia(this,n,e,"f")}constructor(e,l){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(ea(this,y),e)}),t.set(this,ea(this,v,"")),r.set(this,(ea(this,b),ea(this,w,[]))),i.set(this,(ea(this,S),ea(this,_,new Ks))),s.set(this,(ea(this,O),ea(this,x,Nt.LTR))),a.set(this,(ea(this,k),ea(this,j,!1))),o.set(this,(ea(this,E),ea(this,I,{}))),n.set(this,(ea(this,T),ea(this,A,""))),Object.defineProperty(this,"_disableDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:(ea(this,M),!1)}),Object.defineProperty(this,"_appPackageId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_textPlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_imagePlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isStatisticsDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userIdSign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isInited",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_hybridApp",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_fontsPrefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.update(l),this._isInited=!0}get userId(){return this._userId}get userIdSign(){return this._userIdSign}get isStatisticsDisabled(){return this._isStatisticsDisabled||"com.inappstory.webpreview"===this._appPackageId||this._anonymous}get appPackageId(){return this._appPackageId}get apiKey(){return this._apiKey}get tags(){return this._tags}get lang(){return this._lang}get disableDeviceId(){return this._disableDeviceId}get textPlaceholders(){return this._textPlaceholders}get imagePlaceholders(){return this._imagePlaceholders}get dir(){return this._dir}get isLtr(){return this._dir===Nt.LTR}get anonymous(){return this._anonymous}get fontPrefix(){return this._fontsPrefix}get hybridApp(){return this._hybridApp}get options(){return this._options}get cache(){return this._cache}disableStatistic(){this._isStatisticsDisabled=!0}enableStatistic(){this._isStatisticsDisabled=!1}async setApiKey(e){this._apiKey!==e&&(this.defineApiBaseUrlByKey(e),this._apiKey=e,this._isInited&&await this.reloadSdk())}async setUserId(e,t){if(this._disableDeviceId&&(null==e||""===e))throw new Qs;if(((0,C.isString)(e)||(0,C.isNumber)(e))&&this._userId!==e){if(this._anonymous)return this._userId="",this._userIdSign=void 0,void console.warn("[IAS]: user ID in anonymous access mode will be ignored");(new oa).checkUserIdLength(e.toString()).validate(),this._userId=e,this._userIdSign=t,this._isInited&&await this.reloadSdk()}}async setLang(e){e&&(0,C.isString)(e)&&this._lang.toRawData()!==e&&(this._lang=new Ks(e),this._isInited&&await this.reloadSdk())}setTextPlaceholders(e={}){if(!(0,C.isObject)(e))return;const t=this.mapTextPlaceholders(e);(0,C.isEqual)(this._textPlaceholders,t)||(this._textPlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._textPlaceholders))}setImagePlaceholders(e={}){if(!(0,C.isObject)(e))return;const t=this.mapImagePlaceholders(e);(0,C.isEqual)(this._imagePlaceholders,t)||(this._imagePlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._imagePlaceholders))}setTags(e){(0,C.isEqual)(this._tags,e)||((new oa).checkTagsLength(e).validate(),this._tags=$(e))}setDir(e){var t;this._dir=e?e.toString():null!==(t=getComputedStyle(document.documentElement).direction)&&void 0!==t?t:Nt.LTR}async setAnonymous(e){this._anonymous!==Boolean(e)&&(this._anonymous=Boolean(e),this._isInited&&await this.reloadSdk())}setOptions(e={}){JSON.stringify(e)!==JSON.stringify(this._options)&&(this._options=e)}setHybridApp(e){this._hybridApp=e?new Zs(e):null}update(e){var t,r,i,s,a,o,n;this._fontsPrefix=null!==(t=e.fontPrefix)&&void 0!==t?t:"",this._appPackageId=null!==(r=e.appPackageId)&&void 0!==r?r:"",this._disableDeviceId=Boolean(e.disableDeviceId),this.setOptions(e.options),this.setApiKey(e.apiKey).catch(console.error),this.setAnonymous(e.anonymous),this.setUserId(null!==(i=e.userId)&&void 0!==i?i:"",e.userIdSign).catch(console.error),this.setLang(e.lang).catch(console.error),this.setTextPlaceholders(null!==(s=e.placeholders)&&void 0!==s?s:{}),this.setImagePlaceholders(null!==(a=e.imagePlaceholders)&&void 0!==a?a:{}),this.setTags(null!==(o=e.tags)&&void 0!==o?o:[]),this.setDir(e.dir),this.setHybridApp(e.hybridApp),this._cache=e.cache?Object.assign(Object.assign({},e.cache),{prefetch:null===(n=e.cache.prefetch)||void 0===n||n}):null}mapTextPlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new Ee(r,i));return t}mapImagePlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new je(r,i));return t}defineApiBaseUrlByKey(e){const t=ui.parseAndDefine(e);ca.baseURL=`${t}/v2/`}async reloadSdk(){try{this.storyManager.emit("requestSDKReload"),this.storyManager.rootStore.sessionStore.close(),this.storyManager.closeAllReaders(),await this.storyManager.reloadAllStoryLists(),await this.storyManager.reloadAllStackedStoryLists()}catch(e){console.error(e)}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=m[Symbol.metadata])&&void 0!==t?t:null):void 0;l=[N.observable],c=[N.observable],d=[N.observable],h=[N.observable],u=[N.observable],p=[N.observable],g=[N.observable],f=[U],ta(e,null,l,{kind:"accessor",name:"_apiKey",static:!1,private:!1,access:{has:e=>"_apiKey"in e,get:e=>e._apiKey,set:(e,t)=>{e._apiKey=t}},metadata:r},v,b),ta(e,null,c,{kind:"accessor",name:"_tags",static:!1,private:!1,access:{has:e=>"_tags"in e,get:e=>e._tags,set:(e,t)=>{e._tags=t}},metadata:r},w,S),ta(e,null,d,{kind:"accessor",name:"_lang",static:!1,private:!1,access:{has:e=>"_lang"in e,get:e=>e._lang,set:(e,t)=>{e._lang=t}},metadata:r},_,O),ta(e,null,h,{kind:"accessor",name:"_dir",static:!1,private:!1,access:{has:e=>"_dir"in e,get:e=>e._dir,set:(e,t)=>{e._dir=t}},metadata:r},x,k),ta(e,null,u,{kind:"accessor",name:"_anonymous",static:!1,private:!1,access:{has:e=>"_anonymous"in e,get:e=>e._anonymous,set:(e,t)=>{e._anonymous=t}},metadata:r},j,E),ta(e,null,p,{kind:"accessor",name:"_options",static:!1,private:!1,access:{has:e=>"_options"in e,get:e=>e._options,set:(e,t)=>{e._options=t}},metadata:r},I,T),ta(e,null,g,{kind:"accessor",name:"_userId",static:!1,private:!1,access:{has:e=>"_userId"in e,get:e=>e._userId,set:(e,t)=>{e._userId=t}},metadata:r},A,M),ta(e,null,f,{kind:"method",name:"reloadSdk",static:!1,private:!1,access:{has:e=>"reloadSdk"in e,get:e=>e.reloadSdk},metadata:r},null,y),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class aa{get userId(){return""}get userIdSign(){return""}get isStatisticsDisabled(){return!1}get appPackageId(){return""}get apiKey(){return""}get tags(){return[]}get lang(){return new Ks}get disableDeviceId(){return!1}get textPlaceholders(){return[]}get imagePlaceholders(){return[]}get dir(){return Nt.LTR}get isLtr(){return!0}get anonymous(){return!1}get fontPrefix(){return""}get hybridApp(){return null}get options(){return{}}get cache(){return null}disableStatistic(){}enableStatistic(){}async setApiKey(e){}async setUserId(e,t){}async setLang(e){}setTextPlaceholders(e){}setImagePlaceholders(e){}setTags(e){}setDir(e){}update(e){}on(e,t){return this}off(e,t){return this}emit(e,...t){}}class oa{constructor(){Object.defineProperty(this,"errors",{enumerable:!0,configurable:!0,writable:!0,value:[]})}checkUserIdLength(e){return e.length>0&&this.getByteLength(e.toString())>255&&this.errors.push(new Xs(e,255)),this}checkTagsLength(e){return e.length>0&&this.getByteLength(e.join(","))>4e3&&this.errors.push(new Ys(e,4e3)),this}validate(){if(this.errors.length>0)throw this.errors.shift()}getByteLength(e){let t=e.length;for(let r=e.length-1;r>=0;r--){const i=e.charCodeAt(r);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&r--}return t}}class na{constructor(e){var t;Object.defineProperty(this,"_baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_baseHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"interceptors",{enumerable:!0,configurable:!0,writable:!0,value:{request:new we,response:new we}}),this._baseURL=null!==(t=null==e?void 0:e.baseURL)&&void 0!==t?t:""}get baseURL(){return this._baseURL}set baseURL(e){this._baseURL=e}set baseHeaders(e){this._baseHeaders=e}async request(e){try{const t=await this.interceptors.request.run(e),r=await this.dispatchRequest(t);return await this.interceptors.response.run(r)}catch(e){if(e instanceof L)throw e;throw L.createByFetchError(e)}}get(e,t={}){return this.request(Object.assign(Object.assign({},t),{method:"get",url:e}))}post(e,t,r={}){return this.request(Object.assign(Object.assign({},r),{method:"post",url:e,data:t}))}put(e,t,r={}){return this.request(Object.assign(Object.assign({},r),{method:"put",url:e,data:t}))}patch(e,t,r={}){return this.request(Object.assign(Object.assign({},r),{method:"patch",url:e,data:t}))}sendBeacon(e,t){return new Promise(r=>{if("sendBeacon"in navigator){const i=this.createBeaconParams(),s=`${T(this.baseURL)}/${A(e)}?${i.toString()}`,a=M(t);this.isEmptyFormData(a)||navigator.sendBeacon(s,a),r()}else this.post(e,t).then(()=>r(),()=>r())})}createBeaconParams(){const e=fl.rootStore.sessionStore.session,t=new URLSearchParams({access_token:fl.config.apiKey,session_id:(null==e?void 0:e.id)||"",x_user_agent:fl.userAgent}),r=fl.config;return null!=r.appPackageId&&t.append("x_app_package_id",r.appPackageId),t}isEmptyFormData(e){let t=!1;return null!=Array.from&&null!=e.keys&&(t=0===Array.from(e.keys()).length),t}async dispatchRequest(e){const t=Object.assign(Object.assign({},this._baseHeaders),e.headers),r=this.buildURL(e.url,e.params),i=e.method?e.method.toUpperCase():"GET";let s=null;e.data&&(s=JSON.stringify(this.buildBody(e.data)),t["Content-Type"]="application/json");const a=await fetch(r.toString(),{method:i,body:"GET"===i||"HEAD"===i?null:s,headers:t,credentials:"omit",signal:e.signal});let o={};if(204!==a.status)try{o=await a.json()}catch(e){o={}}const n={data:o,status:a.status,statusText:a.statusText,headersRaw:a.headers,headers:Object.fromEntries(a.headers.entries()),ok:a.ok};if(!a.ok)throw L.createByRequestError(n);return n}buildURL(e,t){const r=t?new URLSearchParams(this.buildQuery(t)).toString():"";return new URL(`${A(e)}${r?"?"+r:""}`,this._baseURL)}buildQuery(e,t){const r=[];for(const[i,s]of Object.entries(e)){if(null==s||""===s||Number.isNaN(s))continue;const e=t?`${t}[${i}]`:i;"object"!=typeof s||Array.isArray(s)?r.push([e,s]):r.push(...this.buildQuery(s,e))}return r}buildBody(e){const t={};for(const[r,i]of Object.entries(e))if(null!=i&&""!==i)if("object"!=typeof i||Array.isArray(i))t[r]=i;else{const e=this.buildBody(i);Object.keys(e).length&&(t[r]=e)}return t}}const la=new na;la.interceptors.request.use(e=>{var t;const r=fl.config,i=fl.rootStore.sessionStore.session,s=null==i?void 0:i.id;if(r instanceof aa)throw new _e;if(!r.apiKey)throw new Se(e.url);if(!Boolean(null===(t=e.meta)||void 0===t?void 0:t.public)&&!s)throw new Se(e.url);return e.headers=Object.assign(Object.assign({},e.headers),{Authorization:`Bearer ${r.apiKey}`,"Accept-Language":r.lang.toString(),"X-Request-Id":(0,I.v4)(),"X-User-Agent":fl.userAgent}),r.userId&&!r.anonymous&&(e.headers["X-User-Id"]=r.userId.toString()),s&&(e.headers["Auth-Session-Id"]=s),null!=r.appPackageId&&(e.headers["X-App-Package-Id"]=r.appPackageId),r.disableDeviceId||r.anonymous||(e.headers["X-Device-Id"]=be.deviceId),e});const ca=la;class da extends Error{constructor(e){super(`[IAM]: not found IAM for ID <${e}>`),this.name="IamNotFoundByIdError"}}class ha extends Error{constructor(e){super(`[IAM]: not found IAM limit for ID <${e}>`),this.name="IamNotFoundLimitError"}}var ua=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},pa=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0};const ga="campaign_name,id,events,appearance,type,frequency_limit,display_to,display_from,disable_close,need_placeholders,has_limit,slides",fa=ga.split(",").map(e=>`messages.${e}`).join(",");let ma=(()=>{var e;let t,r,i,s=[];return e=class{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(ua(this,s),e)})}async fetchAll({tags:e,options:t}){return(await ca.post("inappmessaging",{tags:e.join(","),options:t},{params:{fields:fa,expand:"messages.slides"}})).data.messages}async fetchContext({needFetchStyles:e,messageIds:t}){return(await ca.get("inappmessaging/message-context",{params:{fields:"widgetsData"+(e?",style":""),id:t.join()}})).data}async fetchById(e){const t=(await ca.get(`inappmessaging/message/${e}`,{params:{expand:"slides",fields:ga}})).data;if(!t)throw new da(e);return t}async emitMessageEvent(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log(`[IAM]: message <${t.type.toUpperCase()}> event`,{messageId:e,messageEvent:t,type:t.type});await ca.sendBeacon(`/inappmessaging/message/${e}/event/${t.type}`,t.toQueryParams())}catch(e){console.error(e)}}async fetchUserData(e){try{return(await ca.get(`/inappmessaging/message/${e}/data`)).data.data}catch(e){console.error(e)}}async updateUserData(e,t){try{if(this.storyManager.isStatisticsDisabled)return void console.log("[IAM]: update user data",{messageId:e,payload:t});await ca.request({url:`/inappmessaging/message/${e}/data`,method:"put",data:{data:t}})}catch(e){console.error(e)}}async checkMesageLimit(e){if(this.storyManager.isStatisticsDisabled)return{canOpen:!0};const t=(await ca.post("inappmessaging/message-limit",{id:[e]})).data.find(t=>t.messageId.toString()===e.toString());if(!t)throw new ha(e);return t}},(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[U],r=[U],i=[U],pa(e,null,t,{kind:"method",name:"fetchAll",static:!1,private:!1,access:{has:e=>"fetchAll"in e,get:e=>e.fetchAll},metadata:a},null,s),pa(e,null,r,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:a},null,s),pa(e,null,i,{kind:"method",name:"fetchById",static:!1,private:!1,access:{has:e=>"fetchById"in e,get:e=>e.fetchById},metadata:a},null,s),a&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),e})();class ya{constructor(e){var t;Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cardAppearance",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_zIndex",{enumerable:!0,configurable:!0,writable:!0,value:1e3}),this.background=this.mapBackgroundDtoToModel(e.background),this.cardAppearance=null!==(t=e.card_appearance)&&void 0!==t?t:{}}get zIndex(){return this._zIndex}mapBackgroundDtoToModel(e){if(!e||0===e.alpha)return"transparent";if("solid"in e)return this.applyAlphaToColor(e.solid,e.alpha);if("linear_gradient"in e){const{angle:t,color_step_list:r}=e.linear_gradient;return`linear-gradient(${t}deg, ${r.map(t=>`${this.applyAlphaToColor(t.color,e.alpha)} ${t.position}%`).join(", ")})`}return"transparent"}applyAlphaToColor(e,t){if(e.startsWith("#")){const r=e.slice(1),i=3===r.length;return`rgba(${parseInt(i?r[0]+r[0]:r.slice(0,2),16)}, ${parseInt(i?r[1]+r[1]:r.slice(2,4),16)}, ${parseInt(i?r[2]+r[2]:r.slice(4,6),16)}, ${t})`}return e}applyClientAppearance(e){const t=null==e?void 0:e.zIndex;this._zIndex=null!=t?parseInt(t.toString()):this._zIndex}}class va extends ya{constructor(e){var t,r,i,s,a,o,n,l,c,d,h;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"borderRadius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"backdrop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closeButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.borderRadius=null!==(t=e.corner_radius)&&void 0!==t?t:16,this.contentRatio=e.content_ratio||.64,this.backdrop={opacity:null!==(i=null===(r=e.backdrop)||void 0===r?void 0:r.alpha)&&void 0!==i?i:.3},this.closeButton={marginTop:null!==(a=null===(s=e.close_button)||void 0===s?void 0:s.top_margin)&&void 0!==a?a:8,width:null!==(n=null===(o=e.close_button)||void 0===o?void 0:o.width)&&void 0!==n?n:32,height:null!==(c=null===(l=e.close_button)||void 0===l?void 0:l.height)&&void 0!==c?c:4,backgroundColor:null!==(h=null===(d=e.close_button)||void 0===d?void 0:d.color)&&void 0!==h?h:"#00000080"}}}var ba,wa,Sa,_a,Oa,xa;!function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(ba||(ba={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(wa||(wa={}));class ka extends ya{constructor(e){var t,r,i,s,a,o,n;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"borderRadius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"animationType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"backdrop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"backgroundColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closeBtnPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"horizontalPadding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.borderRadius=null!==(t=e.corner_radius)&&void 0!==t?t:16,this.contentRatio=e.content_ratio||.64,this.animationType=null!==(r=e.animation_type)&&void 0!==r?r:ba.None,this.backdrop={opacity:null!==(s=null===(i=e.backdrop)||void 0===i?void 0:i.alpha)&&void 0!==s?s:.3},this.backgroundColor=null!==(a=e.background_color)&&void 0!==a?a:"#FFFFFFFF",this.closeBtnPosition=null!==(o=e.close_button_position)&&void 0!==o?o:wa.End,this.horizontalPadding=null!==(n=e.horizontal_padding)&&void 0!==n?n:16}}class Ca extends ya{constructor(e){var t,r;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:9/16}),Object.defineProperty(this,"animationType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closeBtnPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.animationType=null!==(t=e.animation_type)&&void 0!==t?t:ba.None,this.closeBtnPosition=null!==(r=e.close_button_position)&&void 0!==r?r:wa.End}}!function(e){e[e.None=0]="None",e[e.TransitionFromNearestVerticalEdge=1]="TransitionFromNearestVerticalEdge",e[e.AlphaAndZoom=2]="AlphaAndZoom"}(Sa||(Sa={})),function(e){e[e.Bottom=0]="Bottom",e[e.Top=1]="Top"}(_a||(_a={})),function(e){e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End"}(Oa||(Oa={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(xa||(xa={}));class Pa extends ya{constructor(e){var t,r,i,s,a,o,n,l;super(e),Object.defineProperty(this,"contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:320}),Object.defineProperty(this,"closeBtnPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"animationType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"borderRadius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"horizontalOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"horizontalPosition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.contentRatio=null!==(t=e.content_ratio)&&void 0!==t?t:6.4,this.closeBtnPosition=null!==(r=e.close_button_position)&&void 0!==r?r:xa.End,this.animationType=null!==(i=e.animation_type)&&void 0!==i?i:Sa.None,this.borderRadius=null!==(s=e.corner_radius)&&void 0!==s?s:16,this.verticalOffset=null!==(a=e.vertical_offset)&&void 0!==a?a:16,this.horizontalOffset=null!==(o=e.horizontal_offset)&&void 0!==o?o:16,this.verticalPosition=null!==(n=e.vertical_position)&&void 0!==n?n:_a.Bottom,this.horizontalPosition=null!==(l=e.horizontal_position)&&void 0!==l?l:Oa.Center}applyClientAppearance(e){var t;super.applyClientAppearance(e);const r=null===(t=null==e?void 0:e.toast)||void 0===t?void 0:t.width;this.maxWidth=null!=r?parseInt(r.toString()):this.maxWidth}}class ja{create(e,t){switch(e){case La.BottomSheet:return new va(t);case La.Modal:return new ka(t);case La.Fullscreen:return new Ca(t);case La.Toast:return new Pa(t)}}}var Ea=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ia=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ta=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Aa=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Ma=(()=>{var e,t;let r,i=[],s=[];return e=class{get _html(){return Ta(this,t,"f")}set _html(e){Aa(this,t,e,"f")}constructor(e){Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.set(this,Ia(this,i,"")),Object.defineProperty(this,"_payload",{enumerable:!0,configurable:!0,writable:!0,value:Ia(this,s)}),Object.defineProperty(this,"_rawHtml",{enumerable:!0,configurable:!0,writable:!0,value:""})}get html(){return this._html}get payload(){return this._payload}updateByDto(e){var t;this._rawHtml=this.getSlideHtml(e),this._html=this._rawHtml,this._payload=null===(t=e.event_payload)||void 0===t?void 0:t.payload}applyFontPrefix(e){this._rawHtml=Z(this._rawHtml,e),this._html=this._rawHtml}updatePlaceholders(e){let t=this._rawHtml;for(const r of e)t=J(t,`%${r.key}%`,r.value);this._html=t}getSlideHtml(e){var t;let r=e.html;return r=J(r,"{{nonce}}",null!==(t=q())&&void 0!==t?t:""),r}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],Ea(e,null,r,{kind:"accessor",name:"_html",static:!1,private:!1,access:{has:e=>"_html"in e,get:e=>e._html,set:(e,t)=>{e._html=t}},metadata:t},i,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var La,Ra,Ba,Da,Na,Fa,Ua;!function(e){e[e.BottomSheet=1]="BottomSheet",e[e.Modal=2]="Modal",e[e.Fullscreen=3]="Fullscreen",e[e.Toast=4]="Toast"}(La||(La={})),function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(Ra||(Ra={})),function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right"}(Ba||(Ba={})),function(e){e[e.None=0]="None",e[e.TransitionFromNearestVerticalEdge=1]="TransitionFromNearestVerticalEdge",e[e.AlphaAndZoom=2]="AlphaAndZoom"}(Da||(Da={})),function(e){e[e.Bottom=0]="Bottom",e[e.Top=1]="Top"}(Na||(Na={})),function(e){e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End"}(Fa||(Fa={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(Ua||(Ua={}));class Ga{constructor(e,t){Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=t.style,this.widgetsData=this.mapIamMessageContextDto(e,t)}mapIamMessageContextDto(e,t){var r;const i={},s=null!==(r=t.widgetsData)&&void 0!==r?r:{};for(const t in s)Array.isArray(s[t])||(i[t]=s[t][e]);return i}updateNarrativeData(e){this.widgetsData._narrative_saved_data=e}}var Va=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},za=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Wa=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},$a=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const Ha=(0,I.v4)();let qa=(()=>{var e,t,r,i,s,a,o,n,l,c,d;let h,u,p,g,f,m,y,v,b,w,S,_,O=[],x=[],k=[],C=[],P=[],j=[],E=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],F=[],U=[],G=[],V=[],z=[],W=[],$=[];return e=class{get _id(){return Wa(this,t,"f")}set _id(e){$a(this,t,e,"f")}get _events(){return Wa(this,r,"f")}set _events(e){$a(this,r,e,"f")}get _type(){return Wa(this,i,"f")}set _type(e){$a(this,i,e,"f")}get _slides(){return Wa(this,s,"f")}set _slides(e){$a(this,s,e,"f")}get _appearanceOptions(){return Wa(this,a,"f")}set _appearanceOptions(e){$a(this,a,e,"f")}get _needPlaceholders(){return Wa(this,o,"f")}set _needPlaceholders(e){$a(this,o,e,"f")}get _hasLimit(){return Wa(this,n,"f")}set _hasLimit(e){$a(this,n,e,"f")}get _disableClose(){return Wa(this,l,"f")}set _disableClose(e){$a(this,l,e,"f")}get _isOnceOpened(){return Wa(this,c,"f")}set _isOnceOpened(e){$a(this,c,e,"f")}get _context(){return Wa(this,d,"f")}set _context(e){$a(this,d,e,"f")}constructor(e){t.set(this,(Va(this,O),Va(this,x,void 0))),r.set(this,(Va(this,k),Va(this,C,{}))),i.set(this,(Va(this,P),Va(this,j,void 0))),s.set(this,(Va(this,E),Va(this,T,[]))),a.set(this,(Va(this,A),Va(this,M,(new ja).create(La.BottomSheet,{})))),o.set(this,(Va(this,L),Va(this,R,!1))),n.set(this,(Va(this,B),Va(this,D,!1))),l.set(this,(Va(this,F),Va(this,U,!1))),c.set(this,(Va(this,G),Va(this,V,!1))),d.set(this,(Va(this,z),Va(this,W,void 0))),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:(Va(this,$),null)}),Object.defineProperty(this,"_displayFrom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_displayTo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_campaignName",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_iterationId",{enumerable:!0,configurable:!0,writable:!0,value:Ha}),this._id=e,this._context=new Ga(this._id,{style:"",widgetsData:{}})}get id(){return this._id}get openTime(){return this._openTime}get iterationId(){return this._iterationId}get timeSinceLastShow(){return Date.now()-this._openTime}get needPlaceholders(){return this._needPlaceholders}get frequencyLimitTimeExceeded(){return null===this._frequencyLimit?this._isOnceOpened:0!==this._frequencyLimit&&Math.trunc(this.timeSinceLastShow/1e3)<=this._frequencyLimit}get withinDisplayTimeRange(){const e=Math.trunc(Date.now()/1e3);return(!this._displayFrom||e>=this._displayFrom)&&(!this._displayTo||e<=this._displayTo)}get isOnceOpened(){return this._isOnceOpened}get hasLimit(){return this._hasLimit}get events(){return this._events}get slides(){return this._slides}get context(){return this._context}get appearanceOptions(){return this._appearanceOptions}get type(){return this._type}get disableClose(){return this._disableClose}destroy(){}updateByDto(e){var t,r,i;this._events=this.mapMessageEventsByDto(null!==(t=e.events)&&void 0!==t?t:[]),this._type=e.type,this._disableClose=Boolean(e.disable_close),this._campaignName=e.campaign_name,this._frequencyLimit=e.frequency_limit,this._displayFrom=null!==(r=e.display_from)&&void 0!==r?r:null,this._displayTo=null!==(i=e.display_to)&&void 0!==i?i:null,this._hasLimit=Boolean(e.has_limit),this._appearanceOptions=(new ja).create(this._type,e.appearance),this._needPlaceholders=e.need_placeholders,this.updateMessageSlides(e.slides)}hasEvent(e){return Boolean(this._events[e])}getEventByName(e){return this._events[e]}setContext(e){this._context=e}toPublicDto(){return{id:this._id,campaignName:this._campaignName,type:this._type}}updateMessageSlides(e){const t=[];for(const r of e){const e=new Ma(this);e.updateByDto(r),t.push(e)}this._slides=t}mapMessageEventsByDto(e){const t={};for(const r of e)t[r.name]=r;return t}static createByDto(t){const r=new e(t.id);return r.updateByDto(t),r}trackOpen(){return this._isOnceOpened=!0,this._iterationId=(0,I.v4)(),this._openTime=Date.now(),this._iterationId}applyFontPrefix(e){for(const t of this._slides)t.applyFontPrefix(e)}updatePlaceholders(e){for(const t of this._slides)t.updatePlaceholders(e)}applyClientAppearance(e){this.appearanceOptions.applyClientAppearance(e)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;h=[N.observable],u=[N.observable],p=[N.observable],g=[N.observable],f=[N.observable],m=[N.observable],y=[N.observable],v=[N.observable],b=[N.observable],w=[N.observable],S=[N.action],_=[N.action],za(e,null,h,{kind:"accessor",name:"_id",static:!1,private:!1,access:{has:e=>"_id"in e,get:e=>e._id,set:(e,t)=>{e._id=t}},metadata:t},x,k),za(e,null,u,{kind:"accessor",name:"_events",static:!1,private:!1,access:{has:e=>"_events"in e,get:e=>e._events,set:(e,t)=>{e._events=t}},metadata:t},C,P),za(e,null,p,{kind:"accessor",name:"_type",static:!1,private:!1,access:{has:e=>"_type"in e,get:e=>e._type,set:(e,t)=>{e._type=t}},metadata:t},j,E),za(e,null,g,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},T,A),za(e,null,f,{kind:"accessor",name:"_appearanceOptions",static:!1,private:!1,access:{has:e=>"_appearanceOptions"in e,get:e=>e._appearanceOptions,set:(e,t)=>{e._appearanceOptions=t}},metadata:t},M,L),za(e,null,m,{kind:"accessor",name:"_needPlaceholders",static:!1,private:!1,access:{has:e=>"_needPlaceholders"in e,get:e=>e._needPlaceholders,set:(e,t)=>{e._needPlaceholders=t}},metadata:t},R,B),za(e,null,y,{kind:"accessor",name:"_hasLimit",static:!1,private:!1,access:{has:e=>"_hasLimit"in e,get:e=>e._hasLimit,set:(e,t)=>{e._hasLimit=t}},metadata:t},D,F),za(e,null,v,{kind:"accessor",name:"_disableClose",static:!1,private:!1,access:{has:e=>"_disableClose"in e,get:e=>e._disableClose,set:(e,t)=>{e._disableClose=t}},metadata:t},U,G),za(e,null,b,{kind:"accessor",name:"_isOnceOpened",static:!1,private:!1,access:{has:e=>"_isOnceOpened"in e,get:e=>e._isOnceOpened,set:(e,t)=>{e._isOnceOpened=t}},metadata:t},V,z),za(e,null,w,{kind:"accessor",name:"_context",static:!1,private:!1,access:{has:e=>"_context"in e,get:e=>e._context,set:(e,t)=>{e._context=t}},metadata:t},W,$),za(e,null,S,{kind:"method",name:"updateByDto",static:!1,private:!1,access:{has:e=>"updateByDto"in e,get:e=>e.updateByDto},metadata:t},null,O),za(e,null,_,{kind:"method",name:"applyClientAppearance",static:!1,private:!1,access:{has:e=>"applyClientAppearance"in e,get:e=>e.applyClientAppearance},metadata:t},null,O),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Ja{constructor(e,t,r){Object.defineProperty(this,"iterationId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"slideIndex",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideTotal",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,I.v4)()})}toQueryParams(){return{ei:this.eventId,ii:this.iterationId,si:this.slideIndex,st:this.slideTotal}}}class Ka extends Ja{constructor(e){super(e.iterationId,e.slideIndex,e.slidesTotal),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{d:this.payload.duration,sa:JSON.stringify(this.payload.slideAnalytics.map(({slideIndex:e,duration:t})=>({si:e,d:t})))})}}class Za extends Ja{constructor(e){super(e.iterationId,e.slideIndex,e.slidesTotal)}get type(){return"open"}}class Qa extends Ja{constructor(e){super(e.iterationId,e.slideIndex,e.slideTotal),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-scrollview-impression"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{d:this.payload.duration,li:this.payload.layerIndex,v:this.payload.scrollPercent})}}class Ya extends Ja{constructor(e){super(e.iterationId,e.slideIndex,e.slideTotal),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return this.payload.type}toQueryParams(){return Object.assign(Object.assign(Object.assign({},super.toQueryParams()),{d:this.payload.duration}),this.payload.widgetPayload)}}class Xa{constructor(e){Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendOpenEvent(e){const t=new Za(e);await this.iamApi.emitMessageEvent(e.messageId,t)}async sendCloseEvent(e){const t=new Ka(e);await this.iamApi.emitMessageEvent(e.messageId,t)}async sendScrollViewImpressionEvent(e){const t=new Qa(e);return this.iamApi.emitMessageEvent(e.messageId,t)}async sendWidgetEvent(e){const t=new Ya(e);return this.iamApi.emitMessageEvent(e.messageId,t)}}class eo extends Error{constructor(){super("[IAM]: you must close other opened readers"),this.name="IamOtherReaderIsOpenError"}}class to extends Error{constructor(){super("[IAM]: you need preload in app messages"),this.name="IamShowOnlyIfLoadedError"}}class ro extends Error{constructor(){super("[IAM]: show message frequency limit exceeded"),this.name="IamFrequencyLimitError"}}class io extends Error{constructor(){super("[IAM]: not in display time range"),this.name="IamCheckDisplayTimeRangeError"}}class so extends Error{constructor(e){super(`[IAM]: the limit for displaying IAM with ID ${e} has been reached`),this.name="IamMessageLimitExceededError"}}class ao{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"errors",{enumerable:!0,configurable:!0,writable:!0,value:[]})}checkOtherReadersAreClosed(){return(this.storyManager.storyReader.isOpened||this.storyManager.gameReader.isOpened)&&this.errors.push(new eo),this}checkShowOnlyIfLoaded(e){return!this.iamStore.isLoaded&&e&&this.errors.push(new to),this}checkFrequencyLimit(e){return e.frequencyLimitTimeExceeded&&this.errors.push(new ro),this}checkDisplayTimeRange(e){return e.withinDisplayTimeRange||this.errors.push(new io),this}validate(){if(this.errors.length>0)throw this.errors.shift()}}class oo{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:r})}async getMessageById(e,t){new ao(this.storyManager,this.iamStore).checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t.showOnlyIfLoaded).validate();const r=await this.iamStore.findById(e);return r.hasLimit&&await this.checkMesageLimit(e),r}async getMessageByEvent(e,t){new ao(this.storyManager,this.iamStore).checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t.showOnlyIfLoaded).validate(),await this.iamStore.preload({tags:t.tags});const r=this.iamStore.findAllByEvent(e),i=this.getMessagesSortedByEventPriority(e,r);return this.getFirstValidMessageByEvent(i)}async getFirstValidMessageByEvent(e){let t=new Error;for(const r of e)try{return await this.validateMessageByEvent(r)}catch(e){t=e}throw t}async validateMessageByEvent(e){return new ao(this.storyManager,this.iamStore).checkFrequencyLimit(e).checkDisplayTimeRange(e).validate(),e.hasLimit&&await this.checkMesageLimit(e.id),e}async checkMesageLimit(e){const{canOpen:t}=await this.iamApi.checkMesageLimit(e);if(!t)throw new so(e)}getMessagesSortedByEventPriority(e,t){return t.slice().sort((t,r)=>{const i=t.events[e].priority;return r.events[e].priority-i})}}class no{constructor(e,t,r,i){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:i}),this.desktopMode&&this.initViewportWidthForDesktopMode()}get contentRatio(){return this._contentRatio}getWidth(){return this._vw}getHeight(){return Math.ceil(this._vw/this._contentRatio)}initViewportWidthForDesktopMode(){this._vw>557&&(this._vw=557)}}class lo{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t})}get contentRatio(){return 9/16}getWidth(){return this._vw}getHeight(){return this._vh}}class co{constructor(e,t,r,i){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:i}),this.desktopMode&&this.initViewportWidthForDesktopMode()}get contentRatio(){return this._contentRatio}getWidth(){return this._vw}getHeight(){return Math.ceil(this._vw/this._contentRatio)}initViewportWidthForDesktopMode(){this._vw>557&&(this._vw=557)}}class ho{constructor(e){Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:e})}get contentRatio(){return this.params.contentRatio}getWidth(){const e=Math.max(this.params.vw-2*this.params.horizontalOffset,0);return this.params.desktopMode?Math.min(this.params.maxWidth,e):e}getHeight(){return Math.round(this.getWidth()/this.params.contentRatio)}}class uo{create(e,t){switch(e){case La.BottomSheet:return new no(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case La.Modal:return new co(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case La.Fullscreen:return new lo(t.vw,t.vh);case La.Toast:{const e=t.appearanceOptions;return new ho({vw:t.vw,vh:t.vh,desktopMode:t.desktopMode,contentRatio:t.appearanceOptions.contentRatio,horizontalOffset:e.horizontalOffset,maxWidth:e.maxWidth})}}}}class po{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{await this.storyManager.openGame(e.gameInstanceId),this.iamMessage.pauseAndLock(),this.storyManager.gameReader.once(hi.Close,()=>{this.iamMessage.resumeAndUnlock()})}catch(e){console.error(e)}}}class go{constructor(e,t){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}subscribe(){document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange)}unsubscribe(){document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange)}handleDocumentVisibilityChange(){const e=this.iamReader.activeMessage;if(document.hidden)this.iamStatisticsService.sendCloseEvent({messageId:e.id,iterationId:e.iterationId,slidesTotal:e.slides.length,slideIndex:e.activeSlideIndex,duration:e.timeSinceLastShow,slideAnalytics:e.slidesAnalytics});else{const{iterationId:t}=e.open();this.iamStatisticsService.sendOpenEvent({messageId:e.id,iterationId:t,slidesTotal:e.slides.length,slideIndex:e.activeSlideIndex})}}}class fo extends Error{constructor(e){super(`[IAS]: you must close IAM with ID ${e}`),this.name="IamMessageOpenError"}}class mo extends Error{constructor(e){super(`[IAS]: You can't open IAM ${e} in anonymous access mode`),this.name="IamMessageAnonymousOpen"}}class yo extends Error{constructor(e){super(`[IAS]: IAM with ID ${e} does not contain any content`),this.name="IamMessageEmptyContent"}}var vo,bo=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},wo=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},So=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},_o=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};!function(e){e.Loaded="loaded",e.Close="close",e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(vo||(vo={}));let Oo=(()=>{var e,t,r;let i,s,a,o,n,l=E,c=[],d=[],h=[],u=[],p=[];return e=class extends l{get _activeMessage(){return So(this,t,"f")}set _activeMessage(e){_o(this,t,e,"f")}get _closeRequested(){return So(this,r,"f")}set _closeRequested(e){_o(this,r,e,"f")}constructor(e,i,s,a){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(bo(this,c),e)}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"iamDisplayService",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:a}),t.set(this,bo(this,d,null)),r.set(this,(bo(this,h),bo(this,u,!1))),Object.defineProperty(this,"visibilityObserver",{enumerable:!0,configurable:!0,writable:!0,value:bo(this,p)}),Object.defineProperty(this,"_touchController",{enumerable:!0,configurable:!0,writable:!0,value:new qt}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new er(window)}),this.visibilityObserver=new go(this,this.iamStatisticsService)}get touchController(){return this._touchController}get activeMessage(){return this._activeMessage}get isLoaded(){return this.iamStore.isLoaded}get isLoading(){return this.iamStore.isLoading}get isOpened(){return Boolean(this._activeMessage)}get closeRequested(){return Boolean(this._closeRequested)}async preload(e){if(this.storyManager.config.anonymous)return console.warn("[IAS]: You can't preload IAM in anonymous access mode"),[];const t=await this.iamStore.preload(e);return this.emit(vo.Loaded,{messages:t}),t}async showMessageById(e,t={}){this.throwIfAborted(t.signal),this.throwIfAnonymousUser(e),this.throwIfMessageOpened(),this.throwIfAborted(t.signal);const r=await this.iamDisplayService.getMessageById(e,t);return this.throwIfAborted(t.signal),this.throwIfEmptyContent(r),await this.open(r,t.appearance),r}async showMessageByEvent(e,t={}){this.throwIfAborted(t.signal),this.throwIfAnonymousUser(e),this.throwIfMessageOpened(),this.throwIfAborted(t.signal);const r=await this.iamDisplayService.getMessageByEvent(e,t);return this.throwIfAborted(t.signal),this.throwIfEmptyContent(r),await this.open(r,t.appearance),r}async close(){var e;(null===(e=this._activeMessage)||void 0===e?void 0:e.disableClose)||(this.forceClose(),this._closeRequested&&await new Promise(e=>{this.once(vo.Close,e)}))}forceClose(){this._activeMessage&&(this._closeRequested=!0)}notifyCanBeClosed(){if(!this._activeMessage)return;const e=this._activeMessage;this._closeRequested=!1,this.clearActiveMessage(),this.visibilityObserver.unsubscribe(),this.touchController.destroy(),this.scrollbarHelper.show(),this.emitCloseEvent(e)}async open(e,t){e.updatePlaceholders(this.storyManager.rootStore.placeholderStore.placeholders),e.applyClientAppearance(t),this.touchController.init(document.body),this.setActiveMessage(e),this.visibilityObserver.subscribe(),e.type!==La.Toast&&this.scrollbarHelper.hide()}destroy(){}emitWidgetEvent(e){this.activeMessage&&(this.emit(vo.WidgetEvent,{payload:this.activeMessage.payload,message:this.activeMessage.toPublicDto(),name:e.type,data:e.widgetPayload}),this.storyManager.emit(Et.WidgetEvent,{name:e.type,data:e.widgetPayload}))}emitCloseEvent(e){this.emit(vo.Close,{payload:e.payload,message:e.toPublicDto()})}setActiveMessage(e){const t=new Mo(this,this.storyManager,e,this.iamStatisticsService),{iterationId:r}=t.open();this._activeMessage=t,this.iamStatisticsService.sendOpenEvent({messageId:t.id,iterationId:r,slidesTotal:t.slides.length,slideIndex:t.activeSlideIndex})}clearActiveMessage(){if(!this._activeMessage)return;const e=this._activeMessage;this._activeMessage=null,this.iamStatisticsService.sendCloseEvent({messageId:e.id,iterationId:e.iterationId,slidesTotal:e.slides.length,slideIndex:e.activeSlideIndex,duration:e.timeSinceLastShow,slideAnalytics:e.slidesAnalytics}),e.destroy()}throwIfMessageOpened(){if(this.activeMessage)throw new fo(this.activeMessage.id)}throwIfAnonymousUser(e){if(this.storyManager.config.anonymous)throw new mo(e)}throwIfEmptyContent(e){if(!e.slides.length)throw new yo(e.id)}throwIfAborted(e){if(null==e?void 0:e.aborted)throw new DOMException("Aborted","AbortError")}},t=new WeakMap,r=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=l[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[N.observable],s=[N.observable],a=[N.action],o=[N.action],n=[N.action],wo(e,null,i,{kind:"accessor",name:"_activeMessage",static:!1,private:!1,access:{has:e=>"_activeMessage"in e,get:e=>e._activeMessage,set:(e,t)=>{e._activeMessage=t}},metadata:r},d,h),wo(e,null,s,{kind:"accessor",name:"_closeRequested",static:!1,private:!1,access:{has:e=>"_closeRequested"in e,get:e=>e._closeRequested,set:(e,t)=>{e._closeRequested=t}},metadata:r},u,p),wo(e,null,a,{kind:"method",name:"showMessageById",static:!1,private:!1,access:{has:e=>"showMessageById"in e,get:e=>e.showMessageById},metadata:r},null,c),wo(e,null,o,{kind:"method",name:"showMessageByEvent",static:!1,private:!1,access:{has:e=>"showMessageByEvent"in e,get:e=>e.showMessageByEvent},metadata:r},null,c),wo(e,null,n,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:r},null,c),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:"IamReaderViewModel"}),e})();class xo{constructor(e,t,r){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:r})}handle(e){const t=e.linkTarget,r={src:Ft.IamReader,data:{type:this.iamMessage.type,id:this.iamMessage.id,index:this.iamMessage.activeSlideIndex,url:t,elementId:e.elementId,payload:this.iamMessage.payload}};this.storyManager.storyLinkClickHandler(r),this.storyManager.emit("clickOnButton",r),this.iamReader.emit(vo.ClickOnButton,r)}}class ko{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{await this.storyManager.showStory(e.storyId),this.message.pauseAndLock(),this.storyManager.storyReader.once(vs.Close,()=>{this.message.resumeAndUnlock()})}catch(e){console.error(e)}}}class Co{constructor(){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}})}set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class Po{constructor(e,t){Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"maxScrollPercent",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"layerIndex",{enumerable:!0,configurable:!0,writable:!0,value:0})}onVerticalScrollChange(e){this.switchSwipeGestureByScrollPercent(e.scrollPercent),this.updateMaxScrollPercent(e.scrollPercent),this.layerIndex=e.layerIndex}clear(){this.sendStatistic(),this.maxScrollPercent=0,this.layerIndex=0}switchSwipeGestureByScrollPercent(e){const t=this.iamMessage.touchController;e>0?t.disableVerticalSwipeGesture():(t.continueVerticalSwipeGesture(),t.enableVerticalSwipeGesture())}updateMaxScrollPercent(e){e>this.maxScrollPercent&&(this.maxScrollPercent=e)}sendStatistic(){this.iamStatisticsService.sendScrollViewImpressionEvent({iterationId:this.iamMessage.iterationId,messageId:this.iamMessage.id,slideIndex:this.iamMessage.activeSlideIndex,slideTotal:this.iamMessage.slides.length,duration:this.iamMessage.timeSinceLastShow,layerIndex:this.layerIndex,scrollPercent:this.maxScrollPercent})}}class jo{constructor(e,t,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"activeMessageNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Co}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Co}),Object.defineProperty(this,"widgetScrollViewController",{enumerable:!0,configurable:!0,writable:!0,value:null})}onVerticalScrollChange(e){e.isScrollableLayer&&this.isIamSupportScrollView(this.iamMessage.type)&&(this.widgetScrollViewController||(this.widgetScrollViewController=new Po(this.iamStatisticsService,this.iamMessage)),this.widgetScrollViewController.onVerticalScrollChange(e))}onWidgetRequirePauseUI(){this.iamMessage.pauseAndLock()}onWidgetRequireResumeUI(){this.iamMessage.resumeAndUnlock()}productCartUpdate(e){return Promise.reject({message:"Not implemented"})}productCartClicked(){}async productCartGetState(){return Promise.reject("Not implemented")}onEvent(e,t){try{switch(e){case"showSlide":this.iamMessage.onShowSlide(t.index);case"slideLeft":this.iamMessage.onSlideLeft(t.index)}}catch(e){console.error(e)}}onCardLoadingStateChange(e){switch(e){case 0:this.iamMessage.showLoaderScreen();break;case 1:this.iamMessage.hideErrorScreen(),this.iamMessage.hideLoaderScreen();break;case 2:this.iamMessage.showErrorScreen()}}clearCardSession(){this.activeMessageNarrativeDataCache.clear()}clearLayerSession(){var e;null===(e=this.widgetScrollViewController)||void 0===e||e.clear(),this.widgetScrollViewController=null}writeToClipboard(e){(new B).copy(e.textValue)}updateCardServerDataLocally(e){this.iamMessage.context.updateNarrativeData(e)}openUrl(e){"swipeUpItems"!==e.type&&new xo(this.iamReader,this.storyManager,this.iamMessage).handle({linkTarget:e.link.target,elementId:e.elementId})}closeCard(e){this.iamReader.forceClose()}openStory(e,t){new ko(this.storyManager,this.iamMessage).handle({storyId:e})}openGame(e){new po(this.storyManager,this.iamMessage).handle({gameInstanceId:e})}disableVerticalSwipeGesture(){this.iamReader.touchController.disableVerticalSwipeGesture()}enableVerticalSwipeGesture(){this.iamReader.touchController.enableVerticalSwipeGesture()}disableHorizontalSwipeGesture(){this.iamReader.touchController.disableHorizontalSwipeGesture()}enableHorizontalSwipeGesture(){this.iamReader.touchController.enableHorizontalSwipeGesture()}async getCardLocalData(){let e=this.narrativeDataCache.get(`iam_${this.iamMessage.id}_data_${this.storyManager.rootStore.sessionStore.userId}`);return e?JSON.parse(e):{}}setCardLocalData(e,t){let r=JSON.stringify(e);this.narrativeDataCache.set(`iam_${this.iamMessage.id}_data_${this.storyManager.rootStore.sessionStore.userId}`,r),this.iamMessage.context.updateNarrativeData(e),t&&this.iamMessage.updateUserData(r).catch(console.error)}getCardServerData(){var e;return null!==(e=this.iamMessage.context.widgetsData._narrative_saved_data)&&void 0!==e?e:null}showCardTextInput(e,t){}setCardSessionValue(e,t){this.activeMessageNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.activeMessageNarrativeDataCache.get(e)}getWidgetsSharedData(e){const t=this.iamMessage.context.widgetsData;switch(e){case"rangeSlider":return t._narrative_range_slider_data;case"poll":return t._narrative_poll_data;case"vote":return t._narrative_vote_data;case"reactions":return t._narrative_reactions_data}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await ca.request({url:e,method:t,params:null!=r?r:{},headers:null!=i?i:{},data:null!=s?s:{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof L)return{status:null!==(o=e.networkStatus)&&void 0!==o?o:400,headers:null===(n=e.response)||void 0===n?void 0:n.headers,data:null===(l=e.response)||void 0===l?void 0:l.data}}}share(e,t){}shareSlideScreenshot(e,t,r){}showLayer(e){this.clearLayerSession(),this.iamMessage.showLayerByIndex(e)}showCardSlide(e){}cardShowNext(){}showNextSlide(){}sendStatisticEvent(e,t,r,i){this.iamStatisticsService.sendWidgetEvent({iterationId:this.iamMessage.iterationId,messageId:this.iamMessage.id,slideIndex:this.iamMessage.activeSlideIndex,slideTotal:this.iamMessage.slides.length,duration:this.iamMessage.timeSinceLastShow,type:e,widgetPayload:t}),this.iamReader.emitWidgetEvent({type:e,widgetPayload:null!=r?r:{}})}async resetCard(e){}getCardFonts(){var e,t;return null!==(t=null===(e=this.storyManager.rootStore.sessionStore.session)||void 0===e?void 0:e.fontsResources)&&void 0!==t?t:[]}async updateTimeline(e,t,r,i,s,a){s?this.iamMessage.showLoaderScreen():this.iamMessage.hideLoaderScreen(),a?this.iamMessage.showErrorScreen():this.iamMessage.hideErrorScreen()}showToast(e){this.iamMessage.showToast({content:e})}isIamSupportScrollView(e){return[La.BottomSheet,La.Fullscreen].includes(e)}}var Eo=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Io=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},To=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Ao=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Mo=(()=>{var e,t,r,i,s,a;let o,n,l,c,d,h,u,p,g,f=P.EventEmitter,m=[],y=[],v=[],b=[],w=[],S=[],_=[],O=[],x=[],k=[],C=[];return e=class extends f{get _isOnceOpened(){return To(this,t,"f")}set _isOnceOpened(e){Ao(this,t,e,"f")}get _$root(){return To(this,r,"f")}set _$root(e){Ao(this,r,e,"f")}get _needShowErrorScreen(){return To(this,i,"f")}set _needShowErrorScreen(e){Ao(this,i,e,"f")}get _needShowLoaderScreen(){return To(this,s,"f")}set _needShowLoaderScreen(e){Ao(this,s,e,"f")}get _disabledNextClick(){return To(this,a,"f")}set _disabledNextClick(e){Ao(this,a,e,"f")}constructor(e,o,n,l){super(),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:(Eo(this,m),e)}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,Eo(this,y,!1)),r.set(this,(Eo(this,v),Eo(this,b,null))),i.set(this,(Eo(this,w),Eo(this,S,!1))),s.set(this,(Eo(this,_),Eo(this,O,!1))),a.set(this,(Eo(this,x),Eo(this,k,!1))),Object.defineProperty(this,"_activeSlideIndex",{enumerable:!0,configurable:!0,writable:!0,value:(Eo(this,C),0)}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"slidesMetrics",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this._$root=e,this.slideApi=this.createSlideApi()}}),Object.defineProperty(this,"handleTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:({dy:e})=>{this.touchController&&e<10&&this.touchController.verticalSwipeGesture&&this.slideApi.slideSwipeUpHandler()}}),this.touchController=e.touchController,this.slideApiHandlers=new jo(this.storyManager,this.iamReader,this,this.iamStatisticsService),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}get id(){return this.iamMessage.id}get $root(){return this._$root}get activeSlideIndex(){return this._activeSlideIndex}get slides(){return[]}get context(){return this.iamMessage.context}get appearanceOptions(){return this.iamMessage.appearanceOptions}get iterationId(){return this.iamMessage.iterationId}get type(){return this.iamMessage.type}get payload(){var e;const t=this.iamMessage.slides[this._activeSlideIndex];return null!==(e=null==t?void 0:t.payload)&&void 0!==e?e:null}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get timeSinceLastShow(){return this.iamMessage.timeSinceLastShow}get disableClose(){return this.iamMessage.disableClose}get slidesAnalytics(){return Array.from(this.slidesMetrics.values()).map(e=>{var t;return{slideIndex:e.slideIndex,duration:null!==(t=e.leftTime)&&void 0!==t?t:Date.now()-e.showTime}})}open(){this._isOnceOpened=!0;return{iterationId:this.iamMessage.trackOpen()}}async updateUserData(e){return this.storyManager.rootStore.iamStore.updateMessageUserData(this.id,e)}async init(e){var t,r,i,s;const a={safeAreaInsetTop:null!==(r=null===(t=null==e?void 0:e.safeArea)||void 0===t?void 0:t.top)&&void 0!==r?r:0,safeAreaInsetBottom:null!==(s=null===(i=null==e?void 0:e.safeArea)||void 0===i?void 0:i.bottom)&&void 0!==s?s:0};await this.slideApi.showSlides(this.iamMessage.slides.map(e=>e.html),this.appearanceOptions.cardAppearance,0,a)}async start(){document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.touchController.on(Gt.TouchEnd,this.handleTouchEnd)}async stop(){var e;this.slideApiHandlers.clearCardSession(),null===(e=this.slideApi)||void 0===e||e.slideStop({prepareForRestart:2}),document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.touchController.off(Gt.TouchEnd,this.handleTouchEnd)}onClick(e,t){if(!e.target||!this.slideApi)return;e.preventDefault(),e.stopPropagation();const r=this.getNavigationDirection(e,t),{canClickNext:i}=this.slideApi.slideClickHandler(e.target,r);this._disabledNextClick=!i}toPublicDto(){return this.iamMessage.toPublicDto()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}async destroy(){var e;return this.stop(),null===(e=this.slideApi)||void 0===e?void 0:e.destroy()}async resumeAndUnlock(){var e;try{this.locked=!1,await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppResume())}catch(e){this.handleSlideError(e)}}async pauseAndLock(){var e;try{this.locked=!0,await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppPause())}catch(e){this.handleSlideError(e)}}showLayerByIndex(e){var t;null===(t=this.slideApi)||void 0===t||t.showLayer(e)}showToast(e){this.toast=new Kt(Object.assign(Object.assign({},e),{mountPoint:this.$root})),this.toast.show(e.content)}onShowSlide(e){this._activeSlideIndex=e,this.slidesMetrics.set(e,{slideIndex:e,showTime:Date.now(),leftTime:null})}onSlideLeft(e){const t=this.slidesMetrics.get(e);if(!t)throw new Error(`[IAS]: Not found slide <${e}> time metrics`);this.slideApiHandlers.clearLayerSession(),t.leftTime=Date.now(),this.slidesMetrics.set(e,t)}async restart(){await this.init()}createSlideApi(){const e=this.type===La.Fullscreen;return new tr.SlideApi(this.slideApiHandlers,{root:this._$root,slideRatio:this.getContentRatio(),isFullscreen:e,nonce:q(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand,useSdkCacheForMultislideMode:!1})}getContentRatio(){return this.appearanceOptions.contentRatio}handleSlideError(e){console.warn(e),this.showErrorScreen(),this.touchController.off(Gt.TouchEnd,this.handleTouchEnd)}getNavigationDirection(e,t){const r=this.getClickPosition(e,t),i="ltr"===this.slideApi.layoutDirection?1:-1;return(r>=.3?i:-i)>0?"forward":"backward"}getClickPosition(e,t){const r=t.getBoundingClientRect(),i=r.width;if(i<=0)return 0;let s;if(e instanceof MouseEvent)s=e.pageX-r.left;else{if(!(e.touches&&e.touches.length>0))return 0;s=e.touches[0].pageX-r.left}return Math.max(0,Math.min(1,s/i))}handleDocumentVisibilityChange(){this.locked||("hidden"===document.visibilityState&&this.pauseByApp(),"visible"===document.visibilityState&&this.resumeByApp())}async resumeByApp(){var e;try{await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppResume())}catch(e){this.handleSlideError(e)}}async pauseByApp(){var e;try{await(null===(e=this.slideApi)||void 0===e?void 0:e.slideAppPause())}catch(e){this.handleSlideError(e)}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=f[Symbol.metadata])&&void 0!==t?t:null):void 0;o=[N.observable],n=[N.observable],l=[N.observable],c=[N.observable],d=[N.observable],h=[N.action],u=[N.action],p=[N.action],g=[N.action],Io(e,null,o,{kind:"accessor",name:"_isOnceOpened",static:!1,private:!1,access:{has:e=>"_isOnceOpened"in e,get:e=>e._isOnceOpened,set:(e,t)=>{e._isOnceOpened=t}},metadata:r},y,v),Io(e,null,n,{kind:"accessor",name:"_$root",static:!1,private:!1,access:{has:e=>"_$root"in e,get:e=>e._$root,set:(e,t)=>{e._$root=t}},metadata:r},b,w),Io(e,null,l,{kind:"accessor",name:"_needShowErrorScreen",static:!1,private:!1,access:{has:e=>"_needShowErrorScreen"in e,get:e=>e._needShowErrorScreen,set:(e,t)=>{e._needShowErrorScreen=t}},metadata:r},S,_),Io(e,null,c,{kind:"accessor",name:"_needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"_needShowLoaderScreen"in e,get:e=>e._needShowLoaderScreen,set:(e,t)=>{e._needShowLoaderScreen=t}},metadata:r},O,x),Io(e,null,d,{kind:"accessor",name:"_disabledNextClick",static:!1,private:!1,access:{has:e=>"_disabledNextClick"in e,get:e=>e._disabledNextClick,set:(e,t)=>{e._disabledNextClick=t}},metadata:r},k,C),Io(e,null,h,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,m),Io(e,null,u,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,m),Io(e,null,p,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,m),Io(e,null,g,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,m),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Lo extends Error{constructor(e){super(`Game with ID ${e} has already been open`),this.name="IasGameAlreadyOpenError"}}class Ro extends Error{constructor(e){super(`[IAS]: You can't open game ${e} in anonymous access mode `),this.name="IasGameAnonymousOpen"}}class Bo extends Error{constructor(){super("[IAS]: You must open the game first"),this.name="IasNoOpenedGameError"}}var Do=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},No=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Fo=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Uo=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Go=(()=>{var e,t,r,i,s,a,o,n;let l,c,d,h,u,p,g,f,m,y,v,b,w,S,_,O,x,k,C=E,P=[],j=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],F=[],U=[],G=[],V=[],z=[];return e=class extends C{get _isOpened(){return Fo(this,t,"f")}set _isOpened(e){Uo(this,t,e,"f")}get _isGameInited(){return Fo(this,r,"f")}set _isGameInited(e){Uo(this,r,e,"f")}get _isGameLoading(){return Fo(this,i,"f")}set _isGameLoading(e){Uo(this,i,e,"f")}get _game(){return Fo(this,s,"f")}set _game(e){Uo(this,s,e,"f")}get _gameError(){return Fo(this,a,"f")}set _gameError(e){Uo(this,a,e,"f")}get _closeBtnVisible(){return Fo(this,o,"f")}set _closeBtnVisible(e){Uo(this,o,e,"f")}get _gameShouldBeShown(){return Fo(this,n,"f")}set _gameShouldBeShown(e){Uo(this,n,e,"f")}constructor(e,l,c,d){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Do(this,P),e)}),Object.defineProperty(this,"gameCenterApi",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"gameSessionFactory",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:d}),t.set(this,Do(this,j,!1)),r.set(this,(Do(this,I),Do(this,T,!1))),i.set(this,(Do(this,A),Do(this,M,!1))),s.set(this,(Do(this,L),Do(this,R,null))),a.set(this,(Do(this,B),Do(this,D,null))),o.set(this,(Do(this,F),Do(this,U,!1))),n.set(this,(Do(this,G),Do(this,V,!1))),Object.defineProperty(this,"isOpenGameInProgress",{enumerable:!0,configurable:!0,writable:!0,value:(Do(this,z),!1)}),Object.defineProperty(this,"retryAttempts",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"gameSession",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"modules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"safeAreaInsets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleVisibilityChange",{enumerable:!0,configurable:!0,writable:!0,value:()=>{"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}}),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.modules=[new Ci,new Pi,new ji(this.storyManager),new Ei(this.storyManager),new Li(this.storyManager),new Ai(this.storyManager),new Ii(this.storyManager,this)],this.safeAreaInsets=this.getSafeAreaInsets()}get needApplySafeAreaInsets(){var e,t,r,i;const s=Boolean(null===(e=this.storyManager.config.hybridApp)||void 0===e?void 0:e.fullscreen);return!Boolean(null!==(r=null===(t=this.game)||void 0===t?void 0:t.screenOptions.fullScreen)&&void 0!==r?r:null===(i=this.storyManager.rootStore.sessionStore.session)||void 0===i?void 0:i.isGameReaderDefaultFullscreen)&&s}get closeBtnVisible(){return this._closeBtnVisible}get isGameLoading(){return this._isGameLoading}get isGameInited(){return this._isGameInited}get gameError(){return this._gameError}get game(){return this._game}get isOpened(){return this._isOpened}get gameShouldBeShown(){return this._gameShouldBeShown}get dir(){var e,t;return null!==(t=null===(e=this.game)||void 0===e?void 0:e.languageDirection)&&void 0!==t?t:this.storyManager.config.dir}async openGame(e,t={}){if(e=String(e),!this.isOpenGameInProgress&&!this.preventReopen(e))try{this.isOpenGameInProgress=!0,await this.ensureCanOpen(e),await this.launchGameById(e,t),this._isOpened=!0,this._gameShouldBeShown=!1,this.scrollbarHelper.hide()}catch(e){throw e}finally{this.isOpenGameInProgress=!1}}preventReopen(e){var t;return e===(null===(t=this.game)||void 0===t?void 0:t.id)&&(console.warn(`[IAS]: Prevented reopening of game with ID ${e}`),!0)}async ensureCanOpen(e){if(this.storyManager.config.anonymous)throw console.warn(`[IAS]: You can't open game ${e} in anonymous access mode`),new Ro(e);if(this.game)throw new Lo(this.game.id)}async launchGameById(e,t){this._gameError=null,this._isGameLoading=!0,await this.storyManager.rootStore.sessionStore.open();const r=await this.gameCenterApi.openGame({gameInstanceId:e,gameOptions:t});this._game=new Si(e,this.storyManager,r,t)}async initGame(e,t){if(!this._game)throw new Bo;if(!this._isGameInited)try{this.closeSession();const r=await this.createAndOpenSession({iframe:e,game:this._game,params:t});this.subscribeToGameSession(r),this.gameSession=r,this._isGameInited=!0,this._isGameLoading=!1,await this.waitForeground(r)}catch(e){this.handleGameLoadError(e)}}async createAndOpenSession({iframe:e,game:t,params:r}){const i=new URL(t.url).origin,s=this.gameSessionFactory.create(e,i);this.useGameModules(s,t);const a=t.toInitDto(Object.assign(Object.assign({},r),{safeAreaInsets:this.safeAreaInsets}));return await s.open(a),this.storyManager.emit(hi.StartGame,{id:t.id}),s}useGameModules(e,t){for(const r of this.modules)r.attach(e,t)}async closeGame(){var e;return!!this._isOpened&&(this._isGameInited?null===(e=this.gameSession)||void 0===e||e.closeGameReader():this.finishGame(),!0)}async reloadGame(){const e=this._game;if(this._game=null,!e)throw new Bo;await this.launchGameById(e.id,e.options)}handleGameLoadError(e){e instanceof _i&&e.canTryReload&&this.canRestartGame()?(this.storyManager.emit(hi.ErrorGame,e),this.restartGame(),this.retryAttempts++):e instanceof Error&&this.handleError(e)}subscribeToGameSession(e){e.on("gameComplete",(e,t,r,i,s)=>{this.finishGame({openStory:i,gameInstance:s})}),e.on("reloadGameReader",()=>{this.restartGame()})}pauseGameUI(){var e;null===(e=this.gameSession)||void 0===e||e.pauseGameUI()}resumeGameUI(){var e;null===(e=this.gameSession)||void 0===e||e.resumeGameUI()}notifyGameCanBeStarted(){var e;null===(e=this.gameSession)||void 0===e||e.notifyGameCanBeStarted()}notifyShareCompleted({shareId:e,isSuccess:t}){var r;null===(r=this.gameSession)||void 0===r||r.shareComplete(e,t)}notifyOpenSharePanel(e){this.emit(hi.OpenSharePanel,e)}async waitForeground(e){const t=await e.waitForeground();this._gameShouldBeShown=!0,this._closeBtnVisible=Boolean(t.showClose)}restartGame(){const e=this._game;this._game=null,this._isGameInited=!1,this._isGameLoading=!0,this._gameShouldBeShown=!1,this.storyManager.emit(hi.RestartGame),setTimeout((0,N.action)(()=>{this._game=e}))}canRestartGame(){return this._game&&this.retryAttempts<this._game.canTryReloadCount}handleError(e){this._gameError=e,console.error(e.message),this.storyManager.emit(hi.ErrorGame,e)}destroy(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.resetScrollbar(),this.closeSession(),this.resetFlags(),this.resetGameData()}finishGame(e={}){this.resetScrollbar(),this.closeSession(),this.resetFlags(),this.resetGameData(),this.resetCounters(),this.storyManager.emit(hi.CloseGame),this.navigateAfterGame(e)}resetScrollbar(){this.scrollbarHelper.show()}closeSession(){var e;null===(e=this.gameSession)||void 0===e||e.close()}resetFlags(){this._isGameInited=!1,this._isOpened=!1,this._isGameLoading=!1}resetGameData(){this._game=null,this.retryAttempts=0}resetCounters(){this.retryAttempts=0}navigateAfterGame(e){var t,r;(null===(t=e.gameInstance)||void 0===t?void 0:t.id)?this.openGame(e.gameInstance.id,{}):((null===(r=e.openStory)||void 0===r?void 0:r.id)&&this.storyManager.showStory(e.openStory.id),this.emit(hi.Close))}getSafeAreaInsets(){var e;const t=this.storyManager.config.hybridApp;return null!==(e=null==t?void 0:t.safeAreaInsets)&&void 0!==e?e:this.getFallbackSafeAreaInsets()}getFallbackSafeAreaInsets(){const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t))||0,r=t("--ias-sat"),i=t("--ias-sab");return{left:t("--ias-sal"),right:t("--ias-sar"),top:r,bottom:i}}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=C[Symbol.metadata])&&void 0!==t?t:null):void 0;l=[N.observable],c=[N.observable],d=[N.observable],h=[N.observable],u=[N.observable],p=[N.observable],g=[N.observable],f=[N.computed],m=[N.computed],y=[N.computed],v=[N.action],b=[N.action],w=[N.action],S=[N.action],_=[N.action],O=[N.action],x=[N.action],k=[N.action],No(e,null,l,{kind:"accessor",name:"_isOpened",static:!1,private:!1,access:{has:e=>"_isOpened"in e,get:e=>e._isOpened,set:(e,t)=>{e._isOpened=t}},metadata:r},j,I),No(e,null,c,{kind:"accessor",name:"_isGameInited",static:!1,private:!1,access:{has:e=>"_isGameInited"in e,get:e=>e._isGameInited,set:(e,t)=>{e._isGameInited=t}},metadata:r},T,A),No(e,null,d,{kind:"accessor",name:"_isGameLoading",static:!1,private:!1,access:{has:e=>"_isGameLoading"in e,get:e=>e._isGameLoading,set:(e,t)=>{e._isGameLoading=t}},metadata:r},M,L),No(e,null,h,{kind:"accessor",name:"_game",static:!1,private:!1,access:{has:e=>"_game"in e,get:e=>e._game,set:(e,t)=>{e._game=t}},metadata:r},R,B),No(e,null,u,{kind:"accessor",name:"_gameError",static:!1,private:!1,access:{has:e=>"_gameError"in e,get:e=>e._gameError,set:(e,t)=>{e._gameError=t}},metadata:r},D,F),No(e,null,p,{kind:"accessor",name:"_closeBtnVisible",static:!1,private:!1,access:{has:e=>"_closeBtnVisible"in e,get:e=>e._closeBtnVisible,set:(e,t)=>{e._closeBtnVisible=t}},metadata:r},U,G),No(e,null,g,{kind:"accessor",name:"_gameShouldBeShown",static:!1,private:!1,access:{has:e=>"_gameShouldBeShown"in e,get:e=>e._gameShouldBeShown,set:(e,t)=>{e._gameShouldBeShown=t}},metadata:r},V,z),No(e,null,f,{kind:"getter",name:"needApplySafeAreaInsets",static:!1,private:!1,access:{has:e=>"needApplySafeAreaInsets"in e,get:e=>e.needApplySafeAreaInsets},metadata:r},null,P),No(e,null,m,{kind:"getter",name:"closeBtnVisible",static:!1,private:!1,access:{has:e=>"closeBtnVisible"in e,get:e=>e.closeBtnVisible},metadata:r},null,P),No(e,null,y,{kind:"getter",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir},metadata:r},null,P),No(e,null,v,{kind:"method",name:"openGame",static:!1,private:!1,access:{has:e=>"openGame"in e,get:e=>e.openGame},metadata:r},null,P),No(e,null,b,{kind:"method",name:"initGame",static:!1,private:!1,access:{has:e=>"initGame"in e,get:e=>e.initGame},metadata:r},null,P),No(e,null,w,{kind:"method",name:"closeGame",static:!1,private:!1,access:{has:e=>"closeGame"in e,get:e=>e.closeGame},metadata:r},null,P),No(e,null,S,{kind:"method",name:"reloadGame",static:!1,private:!1,access:{has:e=>"reloadGame"in e,get:e=>e.reloadGame},metadata:r},null,P),No(e,null,_,{kind:"method",name:"waitForeground",static:!1,private:!1,access:{has:e=>"waitForeground"in e,get:e=>e.waitForeground},metadata:r},null,P),No(e,null,O,{kind:"method",name:"restartGame",static:!1,private:!1,access:{has:e=>"restartGame"in e,get:e=>e.restartGame},metadata:r},null,P),No(e,null,x,{kind:"method",name:"handleError",static:!1,private:!1,access:{has:e=>"handleError"in e,get:e=>e.handleError},metadata:r},null,P),No(e,null,k,{kind:"method",name:"finishGame",static:!1,private:!1,access:{has:e=>"finishGame"in e,get:e=>e.finishGame},metadata:r},null,P),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Vo{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){return new Go(this.storyManager,new di,new ki,new er(window))}}const zo=.64516129032;class Wo{constructor(e,t,r){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"padding",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t,this._vh=this.calcVH()}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return this.viewportRatio>zo&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>zo&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return Math.ceil(this._vh*zo)}calcHeightByVW(){return this._vh}isDiffAspectRatioEqualToEps(){return this.viewportRatio>zo&&this.viewportRatio-zo<=.1}isPortraitOrientation(){let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches}calcVH(){let e=this._vh;return e-=this.padding.top+this.padding.bottom,e}}class $o{constructor(e,t){Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return this.viewportRatio>zo&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>zo&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return this.viewportRatio>zo?this._vw:Math.ceil(this._vh*zo)}calcHeightByVW(){return Math.ceil(this._vw/zo)}isDiffAspectRatioEqualToEps(){return this.viewportRatio>zo&&this.viewportRatio-zo<=.1}isPortraitOrientation(){let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches}}class Ho{constructor(){}create(e){return ye&&e.vw>=e.vh?this.createDesktopGameGeometry(e):this.createMobileGameGeometry(e)}createDesktopGameGeometry(e){return new Wo(e.vw,e.vh,{top:50,bottom:50})}createMobileGameGeometry(e){return new $o(e.vw,e.vh)}}class qo{constructor(e,t){var r,i,s,a,o,n;Object.defineProperty(this,"storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"title",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"titleColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasAudio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hasSwipeUp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isOpened",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"deeplink",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"gameInstanceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideInReader",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"hideTimeline",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.id=e.id,this.title=e.title,this.titleColor=e.titleColor,this.hasAudio=null!==(r=e.hasAudio)&&void 0!==r&&r,this.hasSwipeUp=null!==(i=e.hasSwipeUp)&&void 0!==i&&i,this.isOpened=e.isOpened,this.deeplink=null!==(s=e.deeplink)&&void 0!==s?s:void 0,this.gameInstanceId=null!==(o=null===(a=e.gameInstance)||void 0===a?void 0:a.id)&&void 0!==o?o:void 0,this.hideInReader=null!==(n=e.hideInReader)&&void 0!==n&&n,this.hideTimeline=e.hideTimeline,this.isOpened=e.isOpened,this.story=e}get wasShown(){return this.story.wasShown}markWasShown(){this.story.markWasShown()}getCover(e){var t,r,i,s;return{imageSrc:null===(r=null===(t=this.story.image)||void 0===t?void 0:t.findOneByCoverQuality(e))||void 0===r?void 0:r.url,videoSrc:null!==(i=this.story.videoCoverSrc)&&void 0!==i?i:void 0,backgroundColor:this.story.backgroundColor,feedCoverSrc:null===(s=this.storyFeed)||void 0===s?void 0:s.coverSrc}}}var Jo=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ko=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Zo=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Qo=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Yo=(()=>{var e,t;let r,i=E,s=[],a=[];return e=class extends i{get topStory(){return Zo(this,t,"f")}set topStory(e){Qo(this,t,e,"f")}constructor(e={feed:"default"}){super(),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"firstStoryShown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyModels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"unreadedStoryModels",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeIndex",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"storyFeedImpressionService",{enumerable:!0,configurable:!0,writable:!0,value:new He(fl,new Ke)}),t.set(this,Ko(this,s,null)),Ko(this,a),this.options=e,this._id=(0,I.v4)(),this.handleShowStory=this.handleShowStory.bind(this),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.subscribeToStoryReader().catch(console.error),fl.addStoryFeed(this)}get stories(){return this.storyFeed?this.storyModels.map(e=>new qo(e,this.storyFeed)):[]}get length(){return this.storyModels.length}get activeIndex(){return this._activeIndex}get feedCoverSrc(){var e;return null===(e=this.storyFeed)||void 0===e?void 0:e.coverSrc}get top(){return this.topStory}async reload(){this.firstStoryShown=!1,this.storyModels=[],this.unreadedStoryModels=new Map,await this.loadStories()}destroy(){const e=fl.storyReader;null==e||e.off(vs.Close,this.handleCloseStoryReader),fl.off("showStory",this.handleShowStory),this.emit("destroy"),fl.removeStoryFeed(this)}async showStory(e){if(!e)return;const t=gl.instance,r=(0,C.isString)(e.deeplink)&&e.deeplink.trim().length>0,i=e.gameInstanceId;if(!e.hideInReader||r||i)return r&&null!=e.deeplink?(t.storyLinkClickHandler({src:Ft.StackStoryList,data:{id:e.id,isDeeplink:!0,url:e.deeplink}}),void this.markStoryAsOpened(e.id)):i?(t.openGame(i).catch(console.error),void this.markStoryAsOpened(e.id)):void(this.storyFeed&&(t.storyReader.showMultipleStories({storyId:e.id,storyFeed:this.storyFeed,windowReferer:Dt.stacked}),this.markStoryAsOpened(e.id)));console.error("[StackedStoryList]: Cannot open hidden story id "+e.id)}async loadStories(){try{this.emit("startLoad"),this.storyFeed=await fl.rootStore.storyFeedStore.fetchDefaultFeed({feedSlug:this.options.feed}),this.emit("endLoad"),this.storyFeed.stories&&this.handleStoriesChange(this.storyFeed.stories)}catch(e){console.error("[StackedStoryList]: error while story list loaded")}}update(){const e=this.unreadedStoryModels.values().next().value;if(!e)throw new Error("[StackedStoryList]: Empty stacked story list");this._activeIndex=this.storyModels.indexOf(e),this.topStory=new qo(e,this.storyFeed),this.onUpdateTopStory(this.topStory),this.emit("update",this.topStory)}handleCloseStoryReader(){this.top&&this.markStoryAsShownById(this.top.id)}markStoryAsOpened(e){fl.rootStore.storyStore.markIsOpenedById(e),this.markStoryAsShownById(e),this.unreadedStoryModels.delete(e),this.resetUnreadedStories(),this.update()}onUpdateTopStory(e){!this.firstStoryShown&&this.storyFeed&&(this.firstStoryShown=!0,this.markStoryAsShownById(e.id))}handleShowStory({id:e}){this.markStoryAsOpened(e)}async subscribeToStoryReader(){try{fl.on("showStory",this.handleShowStory),fl.storyReader.on(vs.Close,this.handleCloseStoryReader)}catch(e){console.error("[StackedStoryList]: error while story reader init")}}resetUnreadedStories(){0===this.unreadedStoryModels.size&&(this.unreadedStoryModels=new Map(this.storyModels.map(e=>[e.id,e])))}handleStoriesChange(e){this.storyModels=e.slice(),this.resetUnreadedStories(),this.update()}markStoryAsShownById(e){const t=fl.rootStore.storyStore.findStoryById(e);t&&this.storyFeed&&!t.wasShown&&(this.storyFeedImpressionService.sendCoverageEvent([t],this.storyFeed),t.markWasShown())}},t=new WeakMap,(()=>{var t;const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=i[Symbol.metadata])&&void 0!==t?t:null):void 0;r=[N.observable],Jo(e,null,r,{kind:"accessor",name:"topStory",static:!1,private:!1,access:{has:e=>"topStory"in e,get:e=>e.topStory,set:(e,t)=>{e.topStory=t}},metadata:o},s,a),o&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),e})();class Xo{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}createStoryReader(){return new ks(this.storyManager).create()}createGameReader(){return new Vo(this.storyManager).create()}createStoryList(){return new Sn(this.storyManager).create()}createInAppMessagingReader(){const e=this.storyManager.rootStore.iamStore,t=new ma(this.storyManager),r=new Xa(t);return new Oo(this.storyManager,e,new oo(this.storyManager,e,t),r)}}class en extends E{constructor(e,t){super(),Object.defineProperty(this,"storyListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t})}get id(){return this.story.id}get title(){return this.story.title}get titleColor(){return this.story.titleColor}get backgroundColor(){return this.story.backgroundColor}get background(){return this.story.background}get deeplink(){return this.story.deeplink}get hideInReader(){return this.story.hideInReader}get gameInstance(){return this.story.gameInstance}get image(){return this.story.image}get videoCoverSrc(){return this.story.videoCoverSrc}get videoCover(){return this.story.videoCover}get like(){return this.story.like}get favorite(){return this.story.favorite}get isOpened(){return this.story.isOpened}get wasShown(){return this.story.wasShown}getAspectRatio(e){return this.storyListViewModel.getAspectRatio(e)}getImageSrcByCoverQuality(e){var t,r;return null===(r=null===(t=this.story.image)||void 0===t?void 0:t.findOneByCoverQuality(e))||void 0===r?void 0:r.url}onClick(e){this.storyListViewModel.onStoryClick(this,e)}markWasShown(){this.story.markWasShown()}destroy(){}}class tn extends en{static create(e,t){var r;const i=new yt({id:-100,title:null!==(r=e.title.content)&&void 0!==r?r:"",title_color:e.title.color,is_opened:!1,background_color:e.backgroundColor,image:tn.getBgImage(e)});return new tn(t,i)}static getBgImage(e){let t=[];return e.image&&e.image.svgSrc&&e.image.svgSrc.baseState&&t.push({width:100,height:100,type:"h",url:`data:image/svg+xml,${W(e.image.svgSrc.baseState)}`}),t}}class rn{constructor(e,t,r){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e,t){var r;this.storyManager.rootStore.storyStore.markIsOpenedById(e.id);const i={src:Ft.StoryList,data:{id:e.id,index:t.index,isDeeplink:!0,url:null!==(r=e.deeplink)&&void 0!==r?r:""}};this.storyListViewModel.params.listType!==Re.UGC&&await this.storyFeedStatisticV1Service.sendDeeplinkClickEvent(e.id),this.storyManager.storyLinkClickHandler(i),this.storyManager.emit("clickOnButton",i)}}class sn{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e,t){var r;this.storyManager.rootStore.storyStore.markIsOpenedById(e.id);const i=null===(r=e.gameInstance)||void 0===r?void 0:r.id;this.storyManager.gameReader.openGame(i,{}).catch(console.error)}}class an{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e,t){const r=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(this.storyList.params.feedSlug),i={storyId:e.id,storyFeed:r,windowReferer:this.storyList.params.isFavorite?Dt.favorite:Dt.default};this.openStoryReader(i),this.emitClickOnStory({id:e.id,index:t.index,isDeeplink:!1,storyFeed:r,filter:this.storyList.params.filter})}async openStoryReader(e){try{await this.storyManager.storyReader.showMultipleStories({storyId:e.storyId,storyFeed:e.storyFeed,filter:this.storyList.params.filter,windowReferer:e.windowReferer})}catch(e){console.error(e)}}emitClickOnStory(e){const t=e.storyFeed,r=t.slug,i=e.filter,s=t.getStoryById(e.id),a={title:null,slidesCount:null,feed:null,filter:null,source:null};a.title=s.statTitle,a.slidesCount=s.slidesCount,t.type===Re.DEFAULT?a.feed=r:t.type===Re.UGC&&(a.filter=i),a.source=Bt.list,this.storyManager.emit("clickOnStory",Object.assign({id:e.id,index:e.index,isDeeplink:e.isDeeplink},a))}}class on{static createHandler(e,t,r,i){const{deeplink:s,hideInReader:a,gameInstance:o}=e,n=(0,C.isString)(s)&&s.trim().length>0,l=null==o?void 0:o.id;return this.isInvalidStoryClick(Boolean(a),n,l,e.id)?null:n?new rn(t,r,i):l?new sn(t,r):new an(t,r)}static isInvalidStoryClick(e,t,r,i){return!(!e||t||r)&&(console.error(`Cannot open hidden story id ${i}`),!0)}}class nn extends en{constructor(e,t){super(e,t)}}class ln extends en{constructor(e,t,r){super(t,r),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:e})}get favoriteStories(){return this.rootStore.storyFeedStore.getFavoriteFeed().stories.map(e=>new nn(this.storyListViewModel,e))}static create(e,t,r){const i=new yt({id:0,title:e.title.content,title_color:e.title.color,is_opened:!0,background_color:"white"});return new ln(r,t,i)}}class cn{constructor(e=0,t=0,r=0,i=0){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.x=e,this.y=t,this.width=r,this.height=i}overlaps(e){return this.x+this.width>=e.x&&this.x<=e.x+e.width&&this.y+this.height>=e.y&&this.y<=e.y+e.height}getIntersection(e){const t=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.x,e.x),i=Math.min(this.y+this.height,e.y+e.height),s=Math.max(this.y,e.y);return new cn(Math.min(t,r),Math.min(i,s),Math.max(0,t-r),Math.max(0,i-s))}getArea(){return this.width*this.height}getAreaFraction(e){return+(this.getArea()/e.getArea()*100).toFixed(2)}static clone(e){return new cn(e.x,e.y,e.width,e.height)}}class dn{constructor(){Object.defineProperty(this,"storyRects",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:new cn}),Object.defineProperty(this,"filterStoryRectIntersections",{enumerable:!0,configurable:!0,writable:!0,value:e=>e.filter(e=>-100!==e.id&&e.areaFraction>0)})}calculate(e){const t=this.getScrollViewportByCalculationParams(e),r=this.getStoryRectIntersectionsWithViewport(t);return this.filterStoryRectIntersections(r)}setViewport(e){this.viewport=e}setStoryRects(e){this.storyRects=e}getScrollViewportByCalculationParams(e){const t=cn.clone(this.viewport);return t.x+=e.minOffsetLeft,t.y+=e.minOffsetTop,t.width+=e.maxOffsetLeft-e.minOffsetLeft,t.height+=e.maxOffsetTop-e.minOffsetTop,t}getStoryRectIntersectionsWithViewport(e){const t=[];for(const r of this.storyRects)if(r.overlaps(e)){const i=r.getIntersection(e);t.push({id:r.id,areaFraction:i.getAreaFraction(r)})}else t.push({id:r.id,areaFraction:0});return t}}class hn extends cn{constructor(e,t=0,r=0,i=0,s=0){super(t,r,i,s),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e}static clone(e){return new hn(e.id,e.x,e.y,e.width,e.height)}}class un{constructor(e){Object.defineProperty(this,"feedCoverageAnalyticsCalculator",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"viewportPadding",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"minOffsetLeft",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maxOffsetLeft",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minOffsetTop",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maxOffsetTop",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"metrics",{enumerable:!0,configurable:!0,writable:!0,value:[]})}startScroll({x:e,y:t}){this.minOffsetLeft=e,this.minOffsetTop=t,this.maxOffsetLeft=e,this.maxOffsetTop=t}endScroll({x:e,y:t}){this.minOffsetLeft=Math.min(e,this.minOffsetLeft),this.maxOffsetLeft=Math.max(e,this.maxOffsetLeft),this.minOffsetTop=Math.min(t,this.minOffsetTop),this.maxOffsetTop=Math.max(t,this.maxOffsetTop);const r=this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:this.minOffsetLeft,maxOffsetLeft:this.maxOffsetLeft,minOffsetTop:this.minOffsetTop,maxOffsetTop:this.maxOffsetTop});this.metrics.forEach(e=>e.calculate(r))}calculate(e,t){const r=this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:e,maxOffsetLeft:e,minOffsetTop:t,maxOffsetTop:t});this.metrics.forEach(e=>e.calculate(r))}addMetric(e){this.metrics.push(e)}updateGeometry({stories:e,storyListRect:t,windowRect:r,viewportPadding:i}){this.viewportPadding=i,this.setViewport(t,r),this.setStoryRects(e,t)}destroy(){this.metrics=[]}setViewport(e,t){const r=this.getViewportByWindowAndStoryList(t,e);this.applyPaddingToViewport(r,e),this.feedCoverageAnalyticsCalculator.setViewport(r)}getViewportByWindowAndStoryList(e,t){let r=new cn;return t.overlaps(e)?(r=t.getIntersection(e),r):r}applyPaddingToViewport(e,t){t.width<768||(e.x+=this.viewportPadding.left,e.y+=this.viewportPadding.top,e.height-=this.viewportPadding.top+this.viewportPadding.bottom,e.width-=this.viewportPadding.left+this.viewportPadding.right)}setStoryRects(e,t){const r=[];e.forEach((i,s)=>{const a=Number(i.dataset.id),o=new hn(a,i.offsetLeft,i.offsetTop,i.clientWidth,i.clientHeight);r.push(o),o.x+=t.x,o.y+=t.y,this.applyPaddingAndNegativeMarginToStoryRect(o,s,e.length-1)}),this.feedCoverageAnalyticsCalculator.setStoryRects(r)}applyPaddingAndNegativeMarginToStoryRect(e,t,r){const i=this.viewportPadding;0===t&&(e.x+=i.left,e.width-=i.left),t===r&&(e.width-=i.right)}}class pn{create(){const e=new dn;return new un(e)}}class gn{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:t})}calculate(e){const t=e.map(({id:e,areaFraction:t})=>({storyId:e,visibleArea:Math.round(t)/100}));0!==t.length&&this.emitVisibleAreaUpdatedEvent(t)}emitVisibleAreaUpdatedEvent(e){const t=this.storyList.params.feedSlug,r=this.storyList.params.filter,i=this.storyList.params.listType,s={stories:e.map(({storyId:e,visibleArea:t})=>{const r={title:null,slidesCount:null,visibleArea:t},s=this.storyManager.rootStore.storyStore.findStoryById(e);return s&&(r.title=s.statTitle,r.slidesCount=s.slidesCount,i===Re.UGC&&(r.ugcPayload=(0,C.isObject)(s.ugcPayload)?s.ugcPayload:{})),Object.assign({id:e},r)}),feed:null,filter:null};i===Re.DEFAULT?s.feed=t:i===Re.UGC&&(s.filter=r),this.storyManager.emit("visibleAreaUpdated",s)}}class fn{constructor(e,t,r){Object.defineProperty(this,"storyList",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyFeedStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"getNewStoriesIds",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=[];for(const r of e){const e=this.storyList.stories.find(e=>e.id===r);e&&!e.wasShown&&t.push(e)}return t}})}calculate(e){const t=this.getNewStoriesIds(e.map(({id:e})=>e)),r=this.storyList.storyFeed;if(0===t.length||!r)return;const i=t.map(e=>r.getStoryById(e.id)).filter(e=>!!e);this.emitStatisticEvents(i,r)}emitStatisticEvents(e,t){this.storyFeedStatisticV1Service.sendCoverageEvent(e,t),this.storyFeedStatisticV2Service.sendViewEventByIds({storyIds:e.map(e=>e.id),feedSlug:t.slug}),this.markStoriesAsShown(e)}markStoriesAsShown(e){e.forEach(e=>e.markWasShown())}}var mn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},yn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},vn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},bn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let wn=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,h,u,p,g=E,f=[],m=[],y=[],v=[],b=[],w=[],S=[];return e=class extends g{get ugcCardOptions(){return vn(this,t,"f")}set ugcCardOptions(e){bn(this,t,e,"f")}get favoriteCardOptions(){return vn(this,r,"f")}set favoriteCardOptions(e){bn(this,r,e,"f")}get _params(){return vn(this,i,"f")}set _params(e){bn(this,i,e,"f")}constructor(s,a,o,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(mn(this,f),s)}),Object.defineProperty(this,"storiesService",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"storyFeedStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,mn(this,m,null)),r.set(this,(mn(this,y),mn(this,v,null))),i.set(this,(mn(this,b),mn(this,w,{listType:Re.DEFAULT,feedSlug:"",useUgcCard:!1,isFavorite:!1,hasFavorite:!1}))),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:(mn(this,S),!1)}),Object.defineProperty(this,"feedCoverageAnalytics",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_favoriteFeed",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._id="StoryListViewModel"+e.index++,this.storyManager.addStoryFeed(this),this.feedCoverageAnalytics=(new pn).create(),this.feedCoverageAnalytics.addMetric(new fn(this,this.storyFeedStatisticV1Service,this.storyFeedStatisticV2Service)),this.feedCoverageAnalytics.addMetric(new gn(this.storyManager,this))}get id(){return this._id}get session(){return this.storyManager.rootStore.sessionStore.session}get storyFeed(){return this._storyFeed}get favoriteFeed(){return this._favoriteFeed}get stories(){const e=this._params.feedSlug,t=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(e);if(!t)return[];const r=t.stories.map(e=>new en(this,e));return this.hasFavoriteCard&&this.favoriteCardOptions&&r.push(this.createFavoriteCard(this.favoriteCardOptions)),this.hasUgcCard&&this.ugcCardOptions&&r.unshift(this.createUgcStoryCard(this.ugcCardOptions)),r}get params(){return this._params}get hasFavoriteCard(){const e=this.storyManager.rootStore.storyFeedStore.getFavoriteFeed();return this._params.hasFavorite&&this._params.listType===Re.DEFAULT&&e.stories.length>0}get hasUgcCard(){return this._params.useUgcCard}get dir(){return this.storyManager.config.dir}setParams(e){this._params=e}onStoryClick(e,t=0){var r;null===(r=on.createHandler(e,this.storyManager,this,this.storyFeedStatisticV1Service))||void 0===r||r.handle(e,{index:t})}destroy(){this.removeAllListeners(),this.storyManager.removeStoryFeed(this),this.feedCoverageAnalytics.destroy()}async reload(){await this.loadStories({needFavorite:!0})}getAspectRatio(e){var t,r;switch(e){case Lt.STYLE_CIRCLE:case Lt.STYLE_QUAD:return 1;case Lt.STYLE_RECTANGLE:return null!==(r=null===(t=this.session)||void 0===t?void 0:t.previewAspectRatio)&&void 0!==r?r:.8;default:return 1}}async loadStories(e){var t,r,i;if(this.isLoading||this._params.feedSlug===Ge)return;const s=Boolean(this._params.hasFavorite)&&e.needFavorite,a={feed:this._params.feedSlug,filter:{},defaultListLength:0,favoriteListLength:0,success:!0,error:{name:"",networkStatus:200,networkMessage:""}};try{this.emit("startLoading"),this.isLoading=!0;const{storyFeed:e,favoriteFeed:i}=await this.storiesService.loadStories(Object.assign(Object.assign({},this._params),{needFavorite:s})),o=null!==(t=e.stories)&&void 0!==t?t:[],n=null!==(r=null==i?void 0:i.stories)&&void 0!==r?r:[];this._storyFeed=e,this._favoriteFeed=i,a.success=!0,a.error=null,a.defaultListLength=o.length,this._params.hasFavorite&&this._params.listType===Re.DEFAULT&&(a.favoriteListLength=n.length)}catch(e){console.error(e),a.success=!1,e instanceof L&&(a.error={name:e.name,networkMessage:e.networkMessage,networkStatus:e.networkStatus})}finally{this.isLoading=!1,a.filter=null!==(i=this._params.filter)&&void 0!==i?i:{},this.emit("endLoading",a)}}setUgcCardOptions(e){this.ugcCardOptions=e}setFavoriteCardOptions(e){this.favoriteCardOptions=e}createUgcStoryCard(e){return tn.create(e,this)}createFavoriteCard(e){return ln.create(e,this,this.storyManager.rootStore)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=g[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[N.observable],a=[N.observable],o=[N.observable],n=[N.computed],l=[N.computed],c=[N.computed],d=[N.computed],h=[N.computed],u=[N.action],p=[N.action],yn(e,null,s,{kind:"accessor",name:"ugcCardOptions",static:!1,private:!1,access:{has:e=>"ugcCardOptions"in e,get:e=>e.ugcCardOptions,set:(e,t)=>{e.ugcCardOptions=t}},metadata:r},m,y),yn(e,null,a,{kind:"accessor",name:"favoriteCardOptions",static:!1,private:!1,access:{has:e=>"favoriteCardOptions"in e,get:e=>e.favoriteCardOptions,set:(e,t)=>{e.favoriteCardOptions=t}},metadata:r},v,b),yn(e,null,o,{kind:"accessor",name:"_params",static:!1,private:!1,access:{has:e=>"_params"in e,get:e=>e._params,set:(e,t)=>{e._params=t}},metadata:r},w,S),yn(e,null,n,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:r},null,f),yn(e,null,l,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:r},null,f),yn(e,null,c,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:r},null,f),yn(e,null,d,{kind:"getter",name:"hasFavoriteCard",static:!1,private:!1,access:{has:e=>"hasFavoriteCard"in e,get:e=>e.hasFavoriteCard},metadata:r},null,f),yn(e,null,h,{kind:"getter",name:"hasUgcCard",static:!1,private:!1,access:{has:e=>"hasUgcCard"in e,get:e=>e.hasUgcCard},metadata:r},null,f),yn(e,null,u,{kind:"method",name:"setParams",static:!1,private:!1,access:{has:e=>"setParams"in e,get:e=>e.setParams},metadata:r},null,f),yn(e,null,p,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:r},null,f),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),Object.defineProperty(e,"index",{enumerable:!0,configurable:!0,writable:!0,value:0}),e})();class Sn{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new _n(this.storyManager);return new wn(this.storyManager,e,new He(this.storyManager,new Ke),new xn(this.storyManager,new Ze(this.storyManager)))}}class _n{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async loadStories({feedSlug:e,filter:t={},listType:r,testKey:i,needFavorite:s=!0}){const a=this.storyManager.config,o=r===Re.DEFAULT&&s,n=this.storyManager.rootStore.storyFeedStore,l=await this.fetchStoryFeed(n,e,t,i);let c=null;o&&(c=await this.fetchFavoriteFeed({storyFeedStore:n,anonymous:a.anonymous}));const d=this.getFeedLoadEventStoryDtos(l);return this.emitFeedLoadEvent(l,d,e,t),{storyFeed:l,favoriteFeed:c}}async fetchStoryFeed(e,t,r,i){return t===We?e.fetchUgcFeed({filter:r,testKey:i}):e.fetchDefaultFeed({feedSlug:t,testKey:i})}getFeedLoadEventStoryDtos(e){return e.stories.map(t=>{const r={title:null,slidesCount:null};return r.title=t.statTitle,r.slidesCount=t.slidesCount,e.type===Re.UGC&&(r.ugcPayload=(0,C.isObject)(t.ugcPayload)?t.ugcPayload:{}),Object.assign({id:t.id},r)})}async fetchFavoriteFeed({storyFeedStore:e,anonymous:t}){return t?(console.warn("[IAS]: The favorites feed is not available in anonymous access mode"),null):await e.fetchFavoriteFeed()}emitFeedLoadEvent(e,t,r,i){const s={stories:t,feed:null,filter:null};e.type===Re.DEFAULT?s.feed=r:e.type===Re.UGC&&(s.filter=i),this.storyManager.emit("feedLoad",s)}}class On{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"view"}toQueryParams(){return{i:this.payload.storyIds.join(","),f:this.payload.feedSlug,w:"list"}}}class xn{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticV2Api",{enumerable:!0,configurable:!0,writable:!0,value:t})}async sendViewEventByIds(e){const t=new On(e);await this.statisticV2Api.sendStatisticEvent(t)}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class kn extends Error{constructor(e){super(`[IAM]: not found IAM for event <${e}>`),this.name="IamNotFoundByEventError"}}var Cn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Pn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},jn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},En=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let In=(()=>{var e,t,r,i;let s,a,o,n,l,c=[],d=[],h=[],u=[],p=[],g=[],f=[];return e=class{get _messages(){return jn(this,t,"f")}set _messages(e){En(this,t,e,"f")}get _isLoaded(){return jn(this,r,"f")}set _isLoaded(e){En(this,r,e,"f")}get _isLoading(){return jn(this,i,"f")}set _isLoading(e){En(this,i,e,"f")}constructor(e,s){Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:(Cn(this,c),e)}),Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,Cn(this,d,N.observable.map())),r.set(this,(Cn(this,h),Cn(this,u,!1))),i.set(this,(Cn(this,p),Cn(this,g,!1))),Object.defineProperty(this,"iamCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Cn(this,f),"")})}get messages(){return Array.from(this._messages.values())}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}async preload(e){try{this._isLoaded=!1,this._isLoading=!0;const t=await this.fetchAll(e);return this._isLoaded=!0,t}catch(e){throw console.error(e),e}finally{this._isLoading=!1}}async findById(e){const t=this._messages.get(e.toString());return t||this.fetchById(e)}findAllByEvent(e){let t=Array.from(this._messages.values()).filter(t=>t.hasEvent(e));if(t.length>0)return t;throw new kn(e)}async updateMessageUserData(e,t){return this.iamApi.updateUserData(e,t)}async fetchById(e){await this.rootStore.sessionStore.open();const t=await this.fetchMessageContext({messageIds:[e]}),r=await this.iamApi.fetchById(e);return this.createMessageByDto(r,t)}async fetchAll(e){await this.rootStore.sessionStore.open();const t=this.rootStore.storyManagerConfigStore.config,r=e.tags?e.tags:t.tags,i=await this.iamApi.fetchAll({tags:$(r),options:t.options}),s=await this.fetchMessageContext({messageIds:i.map(e=>e.id)});return this.createMessagesByDtos(i,s)}async fetchMessageContext({messageIds:e}){await this.rootStore.sessionStore.open();const t=await this.iamApi.fetchContext({needFetchStyles:!this.iamCSS,messageIds:e});return!this.iamCSS&&t.style&&(this.iamCSS=Z(t.style,this.rootStore.storyManagerConfigStore.config.fontPrefix)),t.style=this.iamCSS,t}createMessagesByDtos(e,t){this._messages.clear();const r=[];for(const i of e){const e=this.createMessageByDto(i,t);r.push(e)}return r}createMessageByDto(e,t){const r=qa.createByDto(e),i=new Ga(e.id,t);return r.applyFontPrefix(this.rootStore.storyManagerConfigStore.config.fontPrefix),r.setContext(i),this._messages.has(r.id.toString())||this._messages.set(r.id.toString(),r),r}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[N.observable],a=[N.observable],o=[N.observable],n=[N.computed],l=[U,G],Pn(e,null,s,{kind:"accessor",name:"_messages",static:!1,private:!1,access:{has:e=>"_messages"in e,get:e=>e._messages,set:(e,t)=>{e._messages=t}},metadata:t},d,h),Pn(e,null,a,{kind:"accessor",name:"_isLoaded",static:!1,private:!1,access:{has:e=>"_isLoaded"in e,get:e=>e._isLoaded,set:(e,t)=>{e._isLoaded=t}},metadata:t},u,p),Pn(e,null,o,{kind:"accessor",name:"_isLoading",static:!1,private:!1,access:{has:e=>"_isLoading"in e,get:e=>e._isLoading,set:(e,t)=>{e._isLoading=t}},metadata:t},g,f),Pn(e,null,n,{kind:"getter",name:"messages",static:!1,private:!1,access:{has:e=>"messages"in e,get:e=>e.messages},metadata:t},null,c),Pn(e,null,l,{kind:"method",name:"preload",static:!1,private:!1,access:{has:e=>"preload"in e,get:e=>e.preload},metadata:t},null,c),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Tn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},An=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Mn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Ln=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Rn=(()=>{var e,t;let r,i,s,a,o=[],n=[],l=[];return e=class{get _session(){return Mn(this,t,"f")}set _session(e){Ln(this,t,e,"f")}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Tn(this,o),e)}),Object.defineProperty(this,"sessionApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:i}),t.set(this,Tn(this,n,null)),Tn(this,l),this.storyManager=e,this.sessionApi=r,this.rootStore=i}get session(){return this._session}get userId(){var e,t;return null!==(t=null===(e=this._session)||void 0===e?void 0:e.userKey)&&void 0!==t?t:Ie}async open(){if(this._session)return this._session;const e=this.storyManager.config,t=await this.sessionApi.open({userId:e.userId,userIdSign:e.userIdSign,anonymous:e.anonymous}),r=new Te(this.storyManager,this,t);return r.loadResources(),this.updatePlaceholders(r),this._session=r,r}close(){this._session=null}updatePlaceholders(e){this.rootStore.placeholderStore.addPlaceholders([...e.imagePlaceholders,...e.textPlaceholders])}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.computed],s=[N.computed],a=[U],An(e,null,r,{kind:"accessor",name:"_session",static:!1,private:!1,access:{has:e=>"_session"in e,get:e=>e._session,set:(e,t)=>{e._session=t}},metadata:t},n,l),An(e,null,i,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:t},null,o),An(e,null,s,{kind:"getter",name:"userId",static:!1,private:!1,access:{has:e=>"userId"in e,get:e=>e.userId},metadata:t},null,o),An(e,null,a,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Bn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Dn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Nn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Fn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const Un=N.observable.map();let Gn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storiesByUserId(){return Nn(this,t,"f")}set _storiesByUserId(e){Fn(this,t,e,"f")}get activeUserStories(){var e;const t=this.rootStore.sessionStore.userId;return t&&null!==(e=this._storiesByUserId.get(t))&&void 0!==e?e:Un}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Bn(this,s),e)}),Object.defineProperty(this,"storiesApi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:i}),t.set(this,Bn(this,a,N.observable.map())),Object.defineProperty(this,"storyCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Bn(this,o),"")}),(0,N.reaction)(()=>i.placeholderStore.placeholders,e=>{for(const t of this.activeUserStories.values())t.updatePlaceholders(e)})}addStoriesByDtos(e){const t=[];for(const r of e){const e=this.addStoryByDto(r);t.push(e)}return t}addStoryByDto(e){const t=this.getOrCreateStoriesMap();if(t.has(e.id))return t.get(e.id);const r=new yt(e);return r.applyFontPrefix(this.storyManager.config.fontPrefix),r.updatePlaceholders(this.rootStore.placeholderStore.placeholders),t.set(e.id,r),r}async setStoryLike(e,t){await this.storiesApi.setStoryLike(e,t)}async setStoryBookmark(e,t){await this.storiesApi.setStoryBookmark(e.id,t);const r=this.rootStore.storyFeedStore.getFavoriteFeed();t?r.unshiftStory(e):r.removeById(e.id)}async updateNarrativeData(e,t){await this.storiesApi.updateNarrativeData(e,t)}async fetchSharePathByStory(e){return null!=e.shareUrl?e.shareUrl:this.storiesApi.fetchStorySharePath(e.id)}markIsOpenedById(e){const t=this.storyManager.rootStore.storyStore.findStoryById(e);if(!t)return;const r=this.storyManager.rootStore.sessionStore.session;!t.isOpened&&(null==r?void 0:r.userKey)&&(t.markIsOpened(),this.storiesApi.markStoryAsOpened(r.userKey,t.id),this.rootStore.onboardingFeedStore.removeStoryFromOnboardingFeedsById(t.id))}async fetchStoryById({storyId:e,feedSlug:t,fetchShareUrl:r,once:i}){let s=this.findStoryById(e);if(null==s?void 0:s.slidesLoaded)return s;await this.rootStore.sessionStore.open(),await this.fetchStoryCSS(),s=await this.fetchStory({storyId:e,feedSlug:t,fetchShareUrl:r,once:i});const a=await this.fetchStoryContext({id:s.id,feedSlug:t});return s.setContext(a),s.setCanBeShown(!0),s}async fetchStoriesSlides(e){const t=this.filterStoriesWithoutSlides(e.stories);if(t.length)try{const r=(new Date).getTime();await this.fetchStoryCSS();const i=await this.fetchStoryContextByIds({storyIds:t.map(e=>e.id),feedSlug:e.feedSlug});await Promise.all(t.map((t,s)=>this.processSingleStory(r,t,i[s],e.feedSlug)))}catch(e){for(const r of t)r.setError(e)}}findStoryById(e){return"number"==typeof e?this.activeUserStories.get(e):Array.from(this.activeUserStories.values()).find(t=>t.stringId===e)}filterStoriesWithoutSlides(e){return e.filter(e=>!e.slidesLoaded)}async processSingleStory(e,t,r,i){var s;try{t.error&&t.setError(null),t.setContext(r);const a=await this.storiesApi.fetchStorySlides({id:t.id,feedSlug:i});t.setSlides(null!==(s=a.slides)&&void 0!==s?s:[]),t.applyFontPrefix(this.storyManager.config.fontPrefix),t.updatePlaceholders(this.rootStore.placeholderStore.placeholders),await(async(e,t=300)=>new Promise(r=>{const i=Math.max(0,t-((new Date).getTime()-e));i?setTimeout(r,i):r()}))(e),t.setCanBeShown(!0)}catch(e){t.setError(e)}}async fetchStory({storyId:e,feedSlug:t,fetchShareUrl:r,once:i}){var s;const a=await this.storiesApi.fetchStory({id:e,feedSlug:t,fetchShareUrl:r,once:i}),o=this.addStoryByDto(a);return o.setSlides(null!==(s=a.slides)&&void 0!==s?s:[]),o.applyFontPrefix(this.storyManager.config.fontPrefix),o.updatePlaceholders(this.rootStore.placeholderStore.placeholders),o}async fetchStoryCSS(){this.storyCSS||(this.storyCSS=await this.storiesApi.fetchStoryCSS(),this.storyCSS=Z(this.storyCSS,this.storyManager.config.fontPrefix))}async fetchStoryContext({id:e,feedSlug:t}){const r=await this.storiesApi.fetchStoryContext({ids:[e],feedSlug:t});return new ut(e,Object.assign(Object.assign({},r),{style:this.storyCSS}))}async fetchStoryContextByIds({storyIds:e,feedSlug:t}){const r=await this.storiesApi.fetchStoryContext({ids:e,feedSlug:t});return e.map(e=>new ut(e,Object.assign(Object.assign({},r),{style:this.storyCSS})))}getOrCreateStoriesMap(){const e=this.rootStore.sessionStore.userId;let t=N.observable.map();return this._storiesByUserId.has(e)?t=this._storiesByUserId.get(e):this._storiesByUserId.set(e,t),t}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.computed],Dn(e,null,r,{kind:"accessor",name:"_storiesByUserId",static:!1,private:!1,access:{has:e=>"_storiesByUserId"in e,get:e=>e._storiesByUserId,set:(e,t)=>{e._storiesByUserId=t}},metadata:t},a,o),Dn(e,null,i,{kind:"getter",name:"activeUserStories",static:!1,private:!1,access:{has:e=>"activeUserStories"in e,get:e=>e.activeUserStories},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Vn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},zn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Wn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},$n=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const Hn=N.observable.map();let qn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storyFeedsByUserId(){return Wn(this,t,"f")}set _storyFeedsByUserId(e){$n(this,t,e,"f")}constructor(e,r){Object.defineProperty(this,"storyFeedsApi",{enumerable:!0,configurable:!0,writable:!0,value:(Vn(this,s),e)}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,Vn(this,a,N.observable.map())),Vn(this,o),this.storyFeedsApi=e,this.rootStore=r}get activeUserFeeds(){var e;const t=this.rootStore.sessionStore.userId;return t&&null!==(e=this._storyFeedsByUserId.get(t))&&void 0!==e?e:Hn}getUgcFeed(){var e;return null!==(e=this.getFeedBySlug(We))&&void 0!==e?e:$e.createByStories([])}getFavoriteFeed(){var e;return null!==(e=this.getFeedBySlug(Ge))&&void 0!==e?e:Ve.createByStories([])}getFeedBySlug(e){return this.activeUserFeeds.get(e)}async fetchDefaultFeed({feedSlug:e,testKey:t}){const r=await this.rootStore.sessionStore.open(),i=this.rootStore.storyManagerConfigStore.config,s=await this.storyFeedsApi.fetchDefaultFeed({feedSlug:e,tags:i.tags,testKey:t,options:{pos:i.options.pos}}),a=this.rootStore.storyStore.addStoriesByDtos(s.stories),o=new Ue(s,a,{testKey:t});return this.addStoryFeed(r.userKey,o),o}async fetchFavoriteFeed(){const e=await this.rootStore.sessionStore.open(),t=this.rootStore.storyManagerConfigStore.config.tags,r=await this.storyFeedsApi.fetchFavoriteFeed({tags:t}),i=this.rootStore.storyStore.addStoriesByDtos(r),s=Ve.createByStories(i);return this.addStoryFeed(e.userKey,s),s}async fetchUgcFeed({filter:e,testKey:t}){const r=await this.rootStore.sessionStore.open(),i=this.rootStore.storyManagerConfigStore.config,s=await this.storyFeedsApi.fetchUgcFeed({filter:e,tags:i.tags,testKey:t,options:{pos:i.options.pos}}),a=this.rootStore.storyStore.addStoriesByDtos(s),o=$e.createByStories(a,{filter:e});return this.addStoryFeed(r.userKey,o),o}addStoryFeed(e,t){let r=N.observable.map();this._storyFeedsByUserId.has(e)?r=this._storyFeedsByUserId.get(e):this._storyFeedsByUserId.set(e,r),r.set(t.slug,t)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.computed],zn(e,null,r,{kind:"accessor",name:"_storyFeedsByUserId",static:!1,private:!1,access:{has:e=>"_storyFeedsByUserId"in e,get:e=>e._storyFeedsByUserId,set:(e,t)=>{e._storyFeedsByUserId=t}},metadata:t},a,o),zn(e,null,i,{kind:"getter",name:"activeUserFeeds",static:!1,private:!1,access:{has:e=>"activeUserFeeds"in e,get:e=>e.activeUserFeeds},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Jn=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Kn=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Zn=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Qn=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};const Yn=N.observable.map();let Xn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _onboardingFeedsByUserId(){return Zn(this,t,"f")}set _onboardingFeedsByUserId(e){Qn(this,t,e,"f")}constructor(e,r){Object.defineProperty(this,"storyFeedsApi",{enumerable:!0,configurable:!0,writable:!0,value:(Jn(this,s),e)}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,Jn(this,a,N.observable.map())),Object.defineProperty(this,"cacheDataInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:(Jn(this,o),!1)}),(0,N.reaction)(()=>{const e=this.rootStore.storyManagerConfigStore.config;return e?[e.lang,e.apiKey,e.options]:null},()=>{this.invalidateCacheData()})}get activeUserFeeds(){var e;const t=this.rootStore.sessionStore.userId;return t&&null!==(e=this._onboardingFeedsByUserId.get(t))&&void 0!==e?e:Yn}getFeedBySlug(e){return this.activeUserFeeds.get(null!=e?e:ze.getDefaultSlug())}removeStoryFromOnboardingFeedsById(e){for(const t of this.activeUserFeeds.values())t.removeById(e)}invalidateCacheData(){this.cacheDataInvalidated=!0}async fetchOnboardingFeed(e){let t=e.feedSlug||ze.getDefaultSlug();const r=this.getOnboardingParams(e);let i=this.activeUserFeeds.get(t);if(i&&!this.cacheDataInvalidated&&i.isEqualParams(r))return i;const s=await this.rootStore.sessionStore.open(),a=this.rootStore.storyManagerConfigStore.config,o=await this.storyFeedsApi.fetchOnboardingFeed(Object.assign(Object.assign({},r),{feedSlug:t,options:{pos:a.options.pos}})),n=this.rootStore.storyStore.addStoriesByDtos(o.stories);return i=new ze(o,n,r),this.addOnboardingFeed(s.userKey,i),this.commitCacheData(),i}addOnboardingFeed(e,t){let r=N.observable.map();this._onboardingFeedsByUserId.has(e)?r=this._onboardingFeedsByUserId.get(e):this._onboardingFeedsByUserId.set(e,r),r.set(t.slug,t)}getOnboardingParams(e){const t=e.tags.length>0?e.tags:this.rootStore.storyManagerConfigStore.config.tags;return{tags:$(t),limit:e.limit}}commitCacheData(){this.cacheDataInvalidated=!1}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.computed],Kn(e,null,r,{kind:"accessor",name:"_onboardingFeedsByUserId",static:!1,private:!1,access:{has:e=>"_onboardingFeedsByUserId"in e,get:e=>e._onboardingFeedsByUserId,set:(e,t)=>{e._onboardingFeedsByUserId=t}},metadata:t},a,o),Kn(e,null,i,{kind:"getter",name:"activeUserFeeds",static:!1,private:!1,access:{has:e=>"activeUserFeeds"in e,get:e=>e.activeUserFeeds},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class el{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"ugcEditorApi",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_config",{enumerable:!0,configurable:!0,writable:!0,value:null})}async getUgcEditorConfig(){if(this._config)return this._config;const e=await this.storyManager.rootStore.sessionStore.open(),t=await this.ugcEditorApi.fetchUgcEditorConfig(),r=this.storyManager.config,i="1.15.0";return this._config={sessionId:e.id,apiKey:r.apiKey,editor:null!=t?t:{},sdkVersion:i,appPackageId:r.appPackageId,deviceId:be.deviceId,userId:null!=r.userId?String(r.userId):void 0,lang:r.lang.toString()},this._config}}class tl{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcEditorConfig(){return(await ca.request({method:"GET",url:"ugc/editor-config"})).data}}var rl=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},il=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},sl=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},al=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let ol=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _placeholders(){return sl(this,t,"f")}set _placeholders(e){al(this,t,e,"f")}get placeholders(){return Array.from(this._placeholders.values())}addPlaceholders(e){for(const t of e){const e=this._placeholders.get(t.key);e&&e.priority>t.priority||this._placeholders.set(t.key,t)}}clear(){this._placeholders=N.observable.map()}constructor(){t.set(this,(rl(this,s),rl(this,a,N.observable.map()))),rl(this,o)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],i=[N.computed],il(e,null,r,{kind:"accessor",name:"_placeholders",static:!1,private:!1,access:{has:e=>"_placeholders"in e,get:e=>e._placeholders,set:(e,t)=>{e._placeholders=t}},metadata:t},a,o),il(e,null,i,{kind:"getter",name:"placeholders",static:!1,private:!1,access:{has:e=>"placeholders"in e,get:e=>e.placeholders},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var nl=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ll=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},cl=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},dl=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let hl=(()=>{var e,t;let r,i=[],s=[];return e=class{get _config(){return cl(this,t,"f")}set _config(e){dl(this,t,e,"f")}constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.set(this,ll(this,i,new aa)),ll(this,s),this.storyManager=e}get config(){return this._config}setConfig(e){this._config instanceof sa?this.updateConfig(e):this.initializeConfig(e)}clear(){this._config=new aa,this.storyManager.rootStore.sessionStore.close()}initializeConfig(e){this._config=new sa(this.storyManager,e)}updateConfig(e){this._config.update(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[N.observable],nl(e,null,r,{kind:"accessor",name:"_config",static:!1,private:!1,access:{has:e=>"_config"in e,get:e=>e._config,set:(e,t)=>{e._config=t}},metadata:t},i,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class ul{constructor(e){Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sessionStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyFeedStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onboardingFeedStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ugcEditorStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placeholderStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyManagerConfigStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=new qe(e),r=new Je(e);this.storyManagerConfigStore=new hl(e),this.placeholderStore=new ol,this.iamStore=new In(this,new ma(e)),this.sessionStore=new Rn(e,new Oe,this),this.storyStore=new Gn(e,t,this),this.storyFeedStore=new qn(r,this),this.onboardingFeedStore=new Xn(r,this),this.ugcEditorStore=new el(e,new tl(e))}}class pl{constructor(){Object.defineProperty(this,"_getProductCartState",{enumerable:!0,configurable:!0,writable:!0,value:async()=>({offers:[],price:"0",priceCurrency:""})})}set getProductCartState(e){"function"==typeof e&&(this._getProductCartState=e)}get getProductCartState(){return this._getProductCartState}}class gl extends Ut{constructor(){if(super(),Object.defineProperty(this,"_rootStore",{enumerable:!0,configurable:!0,writable:!0,value:new ul(this)}),Object.defineProperty(this,"_storyLinkClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:e=>{window.open(e.data.url,"_self")}}),Object.defineProperty(this,"_userAgent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyFeeds",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"globalProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"gameReader",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_shareHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"products",{enumerable:!0,configurable:!0,writable:!0,value:new pl}),gl.isSingletonInstanceExists())return gl.instance;gl.instance=this,this.setUserAgent(`InAppStoryReactSDK/${this.sdkVersionCode}`);const e=new Xo(this);return this.storyReader=e.createStoryReader(),this.gameReader=e.createGameReader(),this.inAppMessaging=e.createInAppMessagingReader(),gl.instance}get rootStore(){return this._rootStore}get httpClient(){return ca}get userAgent(){return this._userAgent}get deviceId(){return be.deviceId}get sdkVersionName(){return"1.15.0"}get sdkVersionCode(){return parseInt(11500)}get lang(){return this.rootStore.storyManagerConfigStore.config.lang}set storyLinkClickHandler(e){(0,C.isFunction)(e)&&(this._storyLinkClickHandler=t=>{try{e(t)}catch(e){console.error(e)}})}get storyLinkClickHandler(){return this._storyLinkClickHandler}get shareHandler(){var e;return null!==(e=this._shareHandler)&&void 0!==e?e:this.getNavigatorShareFunction()}set shareHandler(e){this._shareHandler=e}get isStatisticsDisabled(){return this.config.isStatisticsDisabled}get config(){return this.rootStore.storyManagerConfigStore.config}getNonce(){return q()}getConfig(){return this.config}static getInstance(){return gl.instance?gl.instance:null}addStoryFeed(e){this.storyFeeds.push(e)}removeStoryFeed(e){const t=this.storyFeeds.indexOf(e);-1!==t&&this.storyFeeds.splice(t,1)}createStoryFeed(){return new Xo(this).createStoryList()}setConfig(e){this.rootStore.storyManagerConfigStore.setConfig(e)}setUserAgent(e){parseInt(11500);this._userAgent=`${e} ${(e=>{let t="";for(let r=0;r<e.length;r++)t+=e.charCodeAt(r)<=255?e[r]:"?";return t})(navigator.userAgent)}`}async showOnboardingStories(e){var t,r;return this.storyReader.showOnboardingStories({feedSlug:null!==(t=null==e?void 0:e.feed)&&void 0!==t?t:void 0,customTags:null==e?void 0:e.customTags,limit:null!==(r=null==e?void 0:e.limit)&&void 0!==r?r:void 0,signal:null==e?void 0:e.signal})}async showStory(e,t={}){"string"==typeof e&&(e=+e||e),await this.storyReader.showStory(e,t)}async showStoryOnce(e,t={}){"string"==typeof e&&(e=+e||e),await this.storyReader.showStoryOnce(e,t)}async showSharePage(e,t={}){"string"==typeof e&&(e=+e||e),await this.storyReader.showStoryFromSharePage(e,t)}closeAllReaders(){this.storyReader.close(),this.gameReader.closeGame()}closeGoodsWidget(){this.storyReader.closeGoodsWidget()}async openGame(e,t={}){await this.gameReader.openGame(e,t)}async closeGame(){return this.gameReader.closeGame()}async closeStoryReader(){this.storyReader.close()}async getUgcEditorConfig(){return this.rootStore.ugcEditorStore.getUgcEditorConfig()}reloadAllStoryLists(){const e=this.storyFeeds.filter(e=>e instanceof wn).map(e=>e.reload());return Promise.all(e)}reloadAllStackedStoryLists(){const e=this.storyFeeds.filter(e=>e instanceof Yo).map(e=>e.reload());return Promise.all(e)}clearConfig(){this.storyReader.close(bs.AppClose,!0),this.gameReader.closeGame(),this.inAppMessaging.forceClose(),this.rootStore.storyManagerConfigStore.clear()}getNavigatorShareFunction(){var e,t;let r=null===(e=navigator.share)||void 0===e?void 0:e.bind(navigator);return!r&&(null===(t=window.parent)||void 0===t?void 0:t.navigator.share)&&(r=window.parent.navigator.share.bind(window.parent.navigator)),r}static isSingletonInstanceExists(){return!!gl.instance&&(console.warn("[IAS]: StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),!0)}static use(e,t){e.install({INTERNAL_API:ml,HOST:gl},t)}}const fl=new gl,ml=fl;var yl;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(yl||(yl={}));const vl={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};var bl;!function(e){e.UPDATE="update",e.EVENT_UPDATED_COMMON_OPTIONS="updatedCommonOptions",e.EVENT_UPDATED_STORIES_LIST_OPTIONS="updatedStoriesListOptions",e.EVENT_UPDATED_STORY_READER_OPTIONS="updatedStoryReaderOptions",e.EVENT_UPDATED_FAVORITE_READER_OPTIONS="updatedFavoriteReaderOptions",e.EVENT_UPDATED_GAME_READER_OPTIONS="updatedGameReaderOptions",e.EVENT_UPDATED_GOODS_WIDGET_OPTIONS="updatedGoodsWidgetOptions",e.EVENT_UPDATED_INAPPMESSAGING_WIDGET_OPTIONS="updatedInAppMessagingWidgetOptions"}(bl||(bl={}));Error;class wl extends P.EventEmitter{constructor(){super(),Object.defineProperty(this,"_commonOptions",{enumerable:!0,configurable:!0,writable:!0,value:_t}),Object.defineProperty(this,"_storiesListOptions",{enumerable:!0,configurable:!0,writable:!0,value:st}),Object.defineProperty(this,"_storyReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:Mt}),Object.defineProperty(this,"_storyFavoriteReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:vl}),Object.defineProperty(this,"_goodsWidgetOptions",{enumerable:!0,configurable:!0,writable:!0,value:jt}),Object.defineProperty(this,"_gameReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:Ct})}setCommonOptions(e,t=!0){return this._commonOptions=Wt()(this._commonOptions,e),this.emit(bl.UPDATE,this.commonOptions),this}get commonOptions(){return this._commonOptions}setStoriesListOptions(e,t=!0){return this._storiesListOptions=Wt()(this._storiesListOptions,e),t&&(this.emit(bl.UPDATE,this.storiesListOptions),this.emit(bl.EVENT_UPDATED_STORIES_LIST_OPTIONS,this.storiesListOptions)),this}get storiesListOptions(){return this._storiesListOptions}setStoryReaderOptions(e,t=!0){return null==e.layout&&null!=e.useExperimentalModernVariant&&(e.layout=e.useExperimentalModernVariant?At.Modern:At.Classic),this._storyReaderOptions=Wt()(this._storyReaderOptions,e,{arrayMerge:(e,t,r)=>t}),t&&this.emit(bl.UPDATE,{storyReaderOptions:this.storyReaderOptions,gameReaderOptions:this.gameReaderOptions,appearanceCommon:this.commonOptions}),this}get storyReaderOptions(){const e={closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton,loader:this.commonOptions.loader};return Object.assign(Object.assign({},e),this._storyReaderOptions)}setStoryFavoriteReaderOptions(e,t=!0){return this._storyFavoriteReaderOptions=Wt()(this._storyFavoriteReaderOptions,e),t&&this.emit(bl.UPDATE,this.storyFavoriteReaderOptions),this}get storyFavoriteReaderOptions(){const e={closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton};return Object.assign(Object.assign({},e),this._storyFavoriteReaderOptions)}setGoodsWidgetOptions(e,t=!0){return this._goodsWidgetOptions=Wt()(this._goodsWidgetOptions,e),t&&this.emit(bl.UPDATE,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}setGameReaderOptions(e,t=!0){return this._gameReaderOptions=Wt()(this._gameReaderOptions,e),t&&this.emit(bl.UPDATE,this.gameReaderOptions),this}get gameReaderOptions(){const e={closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton,loader:this.commonOptions.loader,forceDesktopMode:this.commonOptions.forceDesktopMode};return Object.assign(Object.assign({},e),this._gameReaderOptions)}}(0,N.configure)({enforceActions:"never"}),window.__IAS__={storyManager:fl},(0,N.configure)({enforceActions:"never"});var Sl=_(5272),_l=_(9155),Ol=_.n(_l);var xl=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const kl=e=>{var{listType:t,feedSlug:r,testKey:i,storyManager:s,options:a,filter:o,useUgcCard:n=!1,hasFavorite:l,isFavorite:c}=e,d=xl(e,["listType","feedSlug","testKey","storyManager","options","filter","useUgcCard","hasFavorite","isFavorite"]);const[h,u]=(0,_l.useState)(),{storyListOptions:p}=(e=>{const t=(0,_l.useRef)(new wl).current;return{storyListOptions:(0,_l.useMemo)(()=>(e&&t.setStoriesListOptions(e),t.storiesListOptions),[JSON.stringify(e)])}})(a),g=()=>{var e;null===(e=d.onLoadStart)||void 0===e||e.call(d)},f=e=>{var t;null===(t=d.onLoadEnd)||void 0===t||t.call(d,e)};return(0,_l.useEffect)(()=>{const e=s.createStoryFeed();return e.on("startLoading",g),e.on("endLoading",f),u(e),()=>{e.off("startLoading",g),e.off("endLoading",f),e.destroy()}},[s]),(0,_l.useEffect)(()=>{h&&(h.setParams({listType:t,testKey:i,feedSlug:r,filter:o,useUgcCard:n,isFavorite:c,hasFavorite:l}),c||h.loadStories({needFavorite:!0}))},[h,i,r,o]),{storyListViewModel:h,storyListOptions:p}};var Cl=_(405),Pl=_(9780),jl=_.n(Pl);class El{constructor(){Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}toString(){return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${this.fontSize}px/${this.lineHeight} ${this.fontFamily.join(", ")}`}clone(){const e=new El;return e.fontStyle=this.fontStyle,e.fontVariant=this.fontVariant,e.fontWeight=this.fontWeight,e.fontSize=this.fontSize,e.lineHeight=this.lineHeight,e.fontFamily=this.fontFamily.slice(),e}}class Il{constructor(e,t){Object.defineProperty(this,"obj",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cardTitleOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cardTitleFont",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cardTitleFont=this.getCardTitleParsedFont(t.font)}getCardTitleFont(){return this.cardTitleFont.clone()}getScaledFontSizeInWebView(){const e=this.measureScaledFontSizeInWebView(this.cardTitleFont.fontSize)/this.cardTitleFont.fontSize;return this.cardTitleFont.fontSize/e}getStoryTitleBlockHeight(){if(!this.isOutsideTitle())return 0;const e=this.cardTitleOptions.padding,t={top:0,bottom:0};try{if("number"==typeof e)t.top=e,t.bottom=e;else{const r=jl()(e);t.top=parseFloat(r.top),t.bottom=parseFloat(r.bottom)}}catch(e){console.error(e)}const r=this.cardTitleOptions.lineClamp,i=Math.round(this.cardTitleFont.fontSize*this.cardTitleFont.lineHeight*100)/100;return t.top+t.bottom+r*i}measureScaledFontSizeInWebView(e){const t=document.createElement("span");t.style.fontSize=e+"px",t.style.display="none",this.obj.append(t);const r=getComputedStyle(t).fontSize;return this.obj.removeChild(t),parseFloat(r)||e}isOutsideTitle(){return this.cardTitleOptions.display&&(this.cardTitleOptions.position===et.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===et.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new El;t.fontStyle="normal",t.fontVariant="normal",t.fontWeight="normal",t.fontSize=14,t.lineHeight=1.2,t.fontFamily=["system-ui",'"Segoe UI"',"Roboto","Helvetica","Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'];try{const r=(0,Cl.parseFont)(e);if(null!=r["font-style"]&&(t.fontStyle=r["font-style"]),null!=r["font-variant"]&&(t.fontVariant=r["font-variant"]),null!=r["font-weight"]&&(t.fontWeight=r["font-weight"]),null!=r["font-size"]){const e=parseFloat(r["font-size"]);String(`${e}px`)===r["font-size"]&&(t.fontSize=e)}if(null!=r["line-height"]){const e=parseFloat(r["line-height"]);String(`${e}px`)===r["line-height"]?t.lineHeight=Math.round(e/t.fontSize*100)/100:String(e)===r["line-height"]&&(t.lineHeight=parseFloat(r["line-height"]))}null!=r["font-family"]&&Array.isArray(r["font-family"])&&(t.fontFamily=r["font-family"])}catch(e){console.error(e)}return t}}var Tl=_(992),Al=_.n(Tl),Ml=_(2591),Ll=_.n(Ml),Rl=_(1740),Bl=_.n(Rl),Dl=_(8128),Nl=_.n(Dl),Fl=_(855),Ul=_.n(Fl),Gl=_(3051),Vl=_.n(Gl),zl=_(3656),Wl=_.n(zl),$l=_(5213),Hl={};Hl.styleTagTransform=Wl(),Hl.setAttributes=Ul(),Hl.insert=Nl().bind(null,"head"),Hl.domAPI=Bl(),Hl.insertStyleElement=Vl();Ll()($l.Ay,Hl);$l.Ay&&$l.Ay.locals&&$l.Ay.locals;var ql=_(4978),Jl={};Jl.styleTagTransform=Wl(),Jl.setAttributes=Ul(),Jl.insert=Nl().bind(null,"head"),Jl.domAPI=Bl(),Jl.insertStyleElement=Vl();Ll()(ql.Ay,Jl);ql.Ay&&ql.Ay.locals&&ql.Ay.locals;var Kl=_(4456),Zl={};Zl.styleTagTransform=Wl(),Zl.setAttributes=Ul(),Zl.insert=Nl().bind(null,"head"),Zl.domAPI=Bl(),Zl.insertStyleElement=Vl();Ll()(Kl.A,Zl);Kl.A&&Kl.A.locals&&Kl.A.locals;const Ql=({onClick:e,className:t})=>(0,Sl.jsx)("div",{className:Al()(Kl.K,t),onClick:e,children:(0,Sl.jsx)("svg",{viewBox:"0 0 24 24",children:(0,Sl.jsx)("path",{fill:"currentColor",d:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"})})});var Yl=_(6644),Xl={};Xl.styleTagTransform=Wl(),Xl.setAttributes=Ul(),Xl.insert=Nl().bind(null,"head"),Xl.domAPI=Bl(),Xl.insertStyleElement=Vl();Ll()(Yl.Ay,Xl);Yl.Ay&&Yl.Ay.locals&&Yl.Ay.locals;const ec=({geometry:e,children:t,style:r,isWidescreen:i,className:s})=>{const a=i?{width:"100%",height:"100%"}:{width:e.getWidth(),height:e.getHeight()};return(0,Sl.jsx)("div",{className:Al()(Yl.jW,s,{[Yl.B2]:!i}),style:Object.assign(Object.assign({},r),a),children:(0,Sl.jsx)("div",{className:Yl.Iu,children:t})})};var tc=_(3639),rc={};rc.styleTagTransform=Wl(),rc.setAttributes=Ul(),rc.insert=Nl().bind(null,"head"),rc.domAPI=Bl(),rc.insertStyleElement=Vl();Ll()(tc.A,rc);tc.A&&tc.A.locals&&tc.A.locals;const ic=oe(),sc=e=>{const[t,r]=(0,_l.useState)(!1),i=(0,_l.useCallback)(()=>{if(ye)return;const t=ic.type!==e.orientation;e.onOrientationChange({type:ic.type,isWrong:t}),r(t)},[e.orientation]);return(0,_l.useEffect)(()=>(i(),ic.addEventListener("change",i),()=>{ic.removeEventListener("change",i)}),[i]),t?(0,Sl.jsx)("div",{className:tc.g}):null};var ac=_(5839),oc={};oc.styleTagTransform=Wl(),oc.setAttributes=Ul(),oc.insert=Nl().bind(null,"head"),oc.domAPI=Bl(),oc.insertStyleElement=Vl();Ll()(ac.Ay,oc);ac.Ay&&ac.Ay.locals&&ac.Ay.locals;var nc=_(7231),lc={};lc.styleTagTransform=Wl(),lc.setAttributes=Ul(),lc.insert=Nl().bind(null,"head"),lc.domAPI=Bl(),lc.insertStyleElement=Vl();Ll()(nc.Ay,lc);nc.Ay&&nc.Ay.locals&&nc.Ay.locals;const cc=({shareText:e,shareLink:t,sharePanelOptions:r,onShareComplete:i})=>{var s,a,o,n,l,c,d,h,u,p,g;const[f,m]=(0,_l.useState)(!1),[y,v]=(0,_l.useState)(!1),b=()=>{v(!0),!f&&e||i()};return(0,Sl.jsxs)("div",{className:`${ac.z5} ${nc.ge}`,children:[(0,Sl.jsx)("div",{className:`${ac.cU} ${nc.cU}`,children:(0,Sl.jsx)("a",{className:nc.Oy,onClick:b,href:t,download:"image.jpeg",children:(0,Sl.jsx)("img",{src:t,className:nc.PH})})}),(0,Sl.jsx)("div",{className:ac.$9,style:{background:null===(s=r.divider)||void 0===s?void 0:s.background}}),(0,Sl.jsx)("div",{className:`${ac.cU} ${nc.cU}`,children:(0,Sl.jsx)("a",{className:nc.Rg,onClick:b,href:t,download:"image.jpeg",children:(0,Sl.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(n=null===(o=null===(a=r.downloadButton)||void 0===a?void 0:a.svgSrc)||void 0===o?void 0:o.baseState)&&void 0!==n?n:""}})})}),e?(0,Sl.jsxs)(Sl.Fragment,{children:[(0,Sl.jsx)("div",{className:ac.$9,style:{background:null===(l=r.divider)||void 0===l?void 0:l.background}}),(0,Sl.jsx)("div",{className:`${ac.cU} ${nc.cU}`,children:(0,Sl.jsxs)("button",{className:Al()(nc.HM,nc.l9),onClick:()=>{(new B).copy(null!=e?e:""),m(!0),y&&i()},children:[(0,Sl.jsxs)("div",{className:nc.UH,children:[(0,Sl.jsx)("span",{className:Al()(nc.Km,{[nc.OL]:!f}),dangerouslySetInnerHTML:{__html:null!==(h=null===(d=null===(c=r.copyButton)||void 0===c?void 0:c.svgSrc)||void 0===d?void 0:d.baseState)&&void 0!==h?h:""}}),(0,Sl.jsx)("span",{className:Al()(nc.Km,{[nc.xG]:f}),dangerouslySetInnerHTML:{__html:null!==(g=null===(p=null===(u=r.copyButton)||void 0===u?void 0:u.svgSrc)||void 0===p?void 0:p.doneState)&&void 0!==g?g:""}})]}),(0,Sl.jsx)("div",{className:nc.Wz,children:e})]})})]}):null]})};var dc=_(9749),hc={};hc.styleTagTransform=Wl(),hc.setAttributes=Ul(),hc.insert=Nl().bind(null,"head"),hc.domAPI=Bl(),hc.insertStyleElement=Vl();Ll()(dc.Ay,hc);dc.Ay&&dc.Ay.locals&&dc.Ay.locals;var uc=_(6827),pc={};pc.styleTagTransform=Wl(),pc.setAttributes=Ul(),pc.insert=Nl().bind(null,"head"),pc.domAPI=Bl(),pc.insertStyleElement=Vl();Ll()(uc.A,pc);uc.A&&uc.A.locals&&uc.A.locals;const gc=e=>{var t,r,i;return(0,Sl.jsxs)("a",{className:`${ac.Kw} ${uc.l}`,onClick:e.onClick,children:[(0,Sl.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(i=null===(r=null===(t=e.options.copyButton)||void 0===t?void 0:t.svgSrc)||void 0===r?void 0:r.baseState)&&void 0!==i?i:""}}),(0,Sl.jsx)("span",{className:ac.pX,style:e.options.text,children:e.label})]})},fc=e=>{var t;return(0,Sl.jsx)("div",{className:ac.$9,style:{background:null===(t=e.options.divider)||void 0===t?void 0:t.background}})},mc=(0,Sl.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",viewBox:"0 0 24 24",stroke:"white",fill:"black",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Sl.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Sl.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,Sl.jsx)("path",{d:"M4 8h16"}),(0,Sl.jsx)("path",{d:"M4 16h16"})]}),yc=e=>{var t;const[r,i]=(0,_l.useState)(!1),s=null===(t=e.sharePanelOptions.title)||void 0===t?void 0:t.favicon;return e.shareDomain&&(null==s?void 0:s.display)&&(0,Sl.jsx)("div",{className:ac.Zu,style:{background:s.background},children:r?mc:(0,Sl.jsx)("img",{src:`${ca.baseURL}/favicon?sz=64&domain_url=${e.shareDomain}`,onError:()=>i(!0),alt:"favicon"})})};var vc=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const bc=e=>{var t,r,i,s,a,o,n,{shareLink:l,shareText:c,sharePanelOptions:d,onShareComplete:h}=e,u=vc(e,["shareLink","shareText","sharePanelOptions","onShareComplete"]);const p=e=>{try{return new URL(e).host}catch(e){return console.error(e),null}},g=()=>{window.removeEventListener("focus",g),h()},f=e=>{var t,r,i,s;const a=l?null!==(t=(e=>{try{return new URL(e)}catch(e){return console.error(e),null}})(l))&&void 0!==t?t:"":null!==(r=window.location.origin)&&void 0!==r?r:window.parent.location.origin,o=null===(i=d.targetParams)||void 0===i?void 0:i[e];return null===(s=null==o?void 0:o.getUrl)||void 0===s?void 0:s.call(o,{url:a.toString(),text:l?p(l)?"":encodeURIComponent(l):null!=c?c:""})},m=d.text,y=null===(t=d.title)||void 0===t?void 0:t.favicon;return(0,Sl.jsxs)("div",{className:ac.z5,children:[(0,Sl.jsxs)("div",{className:`${ac.cU} ${ac.YX}`,children:[l&&p(l)&&Boolean(null==y?void 0:y.display)&&(0,Sl.jsx)(yc,{shareDomain:p(l),sharePanelOptions:d}),(0,Sl.jsxs)("span",{className:ac.DD,dir:u.dir,style:m,children:[u.type===Ot.Link&&l?null===(i=null===(r=d.title)||void 0===r?void 0:r.getValue)||void 0===i?void 0:i.call(r,{url:l,text:p(l)?"":encodeURIComponent(l)}):"",u.type===Ot.Text&&c?null===(a=null===(s=d.title)||void 0===s?void 0:s.getValue)||void 0===a?void 0:a.call(s,{url:l,text:c}):""]})]}),(0,Sl.jsx)(fc,{options:d}),(0,Sl.jsx)("div",{className:`${ac.cU} ${dc.X$}`,children:null===(o=d.targets)||void 0===o?void 0:o.map((e,t)=>{var r,i,s;const a=null===(r=d.targetParams)||void 0===r?void 0:r[e],o=null!==(s=null===(i=null==a?void 0:a.icon)||void 0===i?void 0:i.svgSrc.baseState)&&void 0!==s?s:"<svg></svg>";return(0,Sl.jsx)("div",{className:dc.KY,children:(0,Sl.jsxs)("a",{href:f(e),onClick:()=>((e,t,r)=>{window.addEventListener("focus",g),window.open(e,t,r)})(f(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${ac.Kw} ${dc.Kw}`,children:[(0,Sl.jsx)("div",{dangerouslySetInnerHTML:{__html:o}}),(0,Sl.jsx)("span",{className:ac.pX,style:m,children:null==a?void 0:a.label})]})},t)})}),(0,Sl.jsx)(fc,{options:d}),(0,Sl.jsx)("div",{className:ac.cU,children:(0,Sl.jsx)(gc,{options:d,label:null===(n=d.copyButton)||void 0===n?void 0:n.getLabel({url:l,text:c,type:u.type}),onClick:()=>{let e="";switch(u.type){case Ot.Text:e=null!=c?c:"";break;case Ot.Link:e=null!=l?l:""}(e=>{(new B).copy(e),h()})(e)}})})]})},wc=({shareType:e,shareLink:t,shareText:r,onShareCompelete:i,sharePanelOptions:s,className:a,dir:o})=>{const[n,l]=(0,_l.useState)(!1),[c,d]=(0,_l.useState)(!0),h=()=>{l(!0),d(!1)};return(0,Sl.jsxs)("div",{dir:o,className:Al()(ac.fP,a),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,Sl.jsx)("div",{className:Al()(ac.yg,{[ac.qG]:c,[ac.Xn]:!c}),onClick:()=>{l(!1),d(!1)}}),(0,Sl.jsxs)("div",{className:Al()(ac.jk,{[ac.ly]:c,[ac.md]:!c}),onAnimationEnd:()=>{c||i(n)},style:{"--height":"100%",background:s.background,borderTopLeftRadius:s.borderRadius+"px",borderTopRightRadius:s.borderRadius+"px"},children:[e===Ot.Image&&(0,Sl.jsx)(cc,{shareText:r,shareLink:t,onShareComplete:h,sharePanelOptions:s}),(e===Ot.Link||e===Ot.Text)&&(0,Sl.jsx)(bc,{shareLink:t,shareText:r,onShareComplete:h,sharePanelOptions:s,type:e,dir:o})]})]})};var Sc=_(9678),_c={};_c.styleTagTransform=Wl(),_c.setAttributes=Ul(),_c.insert=Nl().bind(null,"head"),_c.domAPI=Bl(),_c.insertStyleElement=Vl();Ll()(Sc.Ay,_c);Sc.Ay&&Sc.Ay.locals&&Sc.Ay.locals;const Oc=e=>{const t=(0,_l.useRef)(null),[r,i]=(0,_l.useState)(null);return(0,_l.useEffect)(()=>{const r=e.$dotLottie.create(t.current,e.config);return i(r),()=>{r.destroy()}},[e.config.sha1,e.$dotLottie]),(0,_l.useEffect)(()=>{r&&e.forceEnd&&r.stop()},[r,e.forceEnd]),(0,_l.useEffect)(()=>{if(!r)return;const e=(0,C.debounce)(()=>{r.resize()},300);return window.addEventListener("resize",e),()=>{window.addEventListener("resize",e)}},[r]),(0,_l.useEffect)(()=>{if(r)return r.on("play",e.onPlay),r.on("complete",e.onComplete),r.on("beforeLoad",e.onBeforeLoad),r.on("load",e.onLoad),r.on("minPlayingTimeExpired",e.onMinPlayingTimeExpired),r.on("loadError",e.onError),r.load(),()=>{r.off("play",e.onPlay),r.off("complete",e.onComplete),r.off("beforeLoad",e.onBeforeLoad),r.off("load",e.onLoad),r.off("minPlayingTimeExpired",e.onMinPlayingTimeExpired),r.off("loadError",e.onError)}},[r,e.onError,e.onPlay,e.onComplete,e.onLoad,e.onBeforeLoad,e.onMinPlayingTimeExpired]),(0,Sl.jsx)("canvas",{ref:t,style:{width:"100%",height:"100%"}})},xc=e=>{var t,r,i;const{storyManager:s}=vp(),[a,o]=(0,_l.useState)(!1),[n,l]=(0,_l.useState)(!1),[c,d]=(0,_l.useState)(!1),[h,u]=(0,_l.useState)(!1),[p,g]=(0,_l.useState)(!1),[f,m]=(0,_l.useState)(!1),y=n||h||e.isGameLoading||!e.gameShouldBeShown,v=s.globalProperties.$dotLottie,b=c||!v||e.isGameLoadingError?null:(null===(r=null===(t=e.game)||void 0===t?void 0:t.splashLottieScreen)||void 0===r?void 0:r.url)&&(null===(i=e.game)||void 0===i?void 0:i.splashLottieScreen),w=e.game&&!e.isGameLoadingError&&y&&!n&&!b,S=()=>{var t,r,i,s;return e.isDesktopGeometry&&(null===(r=null===(t=e.game)||void 0===t?void 0:t.splashLandscapeScreen)||void 0===r?void 0:r.url)?e.game.splashLandscapeScreen.url:null===(s=null===(i=e.game)||void 0===i?void 0:i.splashScreen)||void 0===s?void 0:s.url},_=e.isGameInited&&(!b||p);(0,_l.useEffect)(()=>{_&&e.onSplashCanBeHidden()},[_]);return(0,Sl.jsxs)("div",{className:Al()(Sc.O2,{[Sc.Hi]:e.game,[Sc.gt]:e.gameShouldBeShown,[Sc.IY]:w}),children:[(0,Sl.jsx)("div",{className:Sc.Vv,style:{backgroundColor:e.splashImageBackgroundColor},children:S()&&(0,Sl.jsx)("img",{src:S(),onLoad:()=>{m(!0)}})}),b&&v&&(0,Sl.jsx)("div",{className:Sc.np,children:(0,Sl.jsx)(Oc,{$dotLottie:v,forceEnd:e.gameShouldBeShown,config:b,onError:()=>{d(!0)},onPlay:()=>{l(!0),o(!1)},onComplete:()=>{l(!1),o(!0)},onLoad:()=>{u(!1)},onBeforeLoad:()=>{u(!0)},onMinPlayingTimeExpired:()=>{g(!0)}})})]})};var kc=_(8034),Cc={};Cc.styleTagTransform=Wl(),Cc.setAttributes=Ul(),Cc.insert=Nl().bind(null,"head"),Cc.domAPI=Bl(),Cc.insertStyleElement=Vl();Ll()(kc.A,Cc);kc.A&&kc.A.locals&&kc.A.locals;const Pc=e=>{var t,r;return(0,Sl.jsx)("button",{dir:e.dir,onClick:e.onCloseGame,className:kc.G,"data-position":e.closeButtonPosition,dangerouslySetInnerHTML:{__html:null!==(r=null===(t=e.closeButtonOptions)||void 0===t?void 0:t.svgSrc.baseState)&&void 0!==r?r:""}})};var jc=_(5299),Ec=_(9514);oe();const Ic=()=>{const e=window.innerWidth;return{vh:window.innerHeight,vw:e}},Tc=()=>{const[e,t]=(0,_l.useState)(()=>Ic()),r=(0,_l.useCallback)(()=>{t(Ic())},[]);return(0,_l.useEffect)(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[]),e},Ac=50,Mc=50;var Lc=_(763),Rc={};Rc.styleTagTransform=Wl(),Rc.setAttributes=Ul(),Rc.insert=Nl().bind(null,"head"),Rc.domAPI=Bl(),Rc.insertStyleElement=Vl();Ll()(Lc.A,Rc);Lc.A&&Lc.A.locals&&Lc.A.locals;const Bc=(0,jc.observer)(({gameReader:e})=>{var t,r,i,s,a,o,n,l,c;const{gameReaderOptions:d}=vp(),h=(0,_l.useRef)(null),{sharePanelOpeningParams:u,handleShareComplete:p,closeSharePanel:g}=(e=>{const[t,r]=(0,_l.useState)(null);return(0,_l.useEffect)(()=>(null==e||e.on("openSharePanel",r),()=>{null==e||e.off("openSharePanel",r)}),[e]),{sharePanelOpeningParams:t,handleShareComplete:i=>{t&&e&&(e.notifyShareCompleted({shareId:t.shareId,isSuccess:i}),r(null))},closeSharePanel:()=>{r(null)}}})(e),{gameGeometry:f,isDesktopGeometry:m}=(()=>{const{vw:e,vh:t}=Tc(),r=(new Ho).create({vw:e,vh:t});return{isDesktopGeometry:r instanceof Wo,gameGeometry:r}})(),y=e.game,v=m&&(null===(t=null==y?void 0:y.screenOptions.widescreen)||void 0===t||t);(e=>{const t=t=>{27===t.keyCode&&e()};(0,_l.useEffect)(()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[])})(()=>{b()});const b=()=>{e.closeGame(),g()},{gameError:w,isGameLoading:S,closeBtnVisible:_}=e,O=Al()(ql.X7,{[ql.vK]:m,[ql.QP]:v}),x=e.needApplySafeAreaInsets?{paddingTop:e.safeAreaInsets.top,paddingRight:e.safeAreaInsets.right,paddingBottom:e.safeAreaInsets.bottom,paddingLeft:e.safeAreaInsets.left}:void 0,k={background:null!==(i=null===(r=d.backdrop)||void 0===r?void 0:r.background)&&void 0!==i?i:"",opacity:null!==(a=null===(s=d.backdrop)||void 0===s?void 0:s.opacity)&&void 0!==a?a:0,filter:(null===(o=d.backdrop)||void 0===o?void 0:o.blur)?`blur(${d.backdrop.blur}px)`:"none"},C=null!==(l=null===(n=d.game)||void 0===n?void 0:n.backdropColor)&&void 0!==l?l:"";return(0,Ec.createPortal)((0,Sl.jsx)("div",{className:ql.Pe,style:{"--game-box-border-radius":`${parseFloat(String(d.borderRadius))}px`},children:(0,Sl.jsxs)("div",{className:O,style:x,children:[(0,Sl.jsx)("div",{className:ql.fN,style:k}),(0,Sl.jsxs)(ec,{className:ql.F2,isWidescreen:v,geometry:f,children:[(0,Sl.jsx)(xc,{onSplashCanBeHidden:()=>{e.notifyGameCanBeStarted()},isDesktopGeometry:m,isWidescreen:v,isGameInited:e.isGameInited,isGameLoading:S,isGameLoadingError:Boolean(e.gameError),gameShouldBeShown:e.gameShouldBeShown,game:null!==(c=e.game)&&void 0!==c?c:void 0,splashImageBackgroundColor:e.game?C:k.background}),w&&(0,Sl.jsx)(Ql,{className:ql.JF,onClick:()=>{e.reloadGame().catch(console.error)}}),(!e.gameShouldBeShown||_)&&(0,Sl.jsx)(Pc,{closeButtonPosition:d.closeButtonPosition,dir:e.dir,onCloseGame:b,closeButtonOptions:d.closeButton}),y&&(0,Sl.jsxs)(Sl.Fragment,{children:[(0,Sl.jsx)("iframe",{src:y.url,onLoad:t=>{h.current=t.target,e.initGame(h.current,{isWidescreen:v}).catch(console.error)},style:{opacity:e.gameShouldBeShown?1:0},frameBorder:"0",className:ql.be,sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),u&&(0,Sl.jsx)(wc,{dir:e.dir,shareText:u.shareText,shareType:u.shareType,shareLink:u.shareLink,onShareCompelete:p,sharePanelOptions:d.sharePanel})]})]}),y&&d.forceCheckOrientation&&(0,Sl.jsx)(sc,{orientation:ne.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.isGameInited&&(t?e.pauseGameUI():e.resumeGameUI())}})]})}),document.body)});var Dc=_(1239),Nc={};Nc.styleTagTransform=Wl(),Nc.setAttributes=Ul(),Nc.insert=Nl().bind(null,"head"),Nc.domAPI=Bl(),Nc.insertStyleElement=Vl();Ll()(Dc.Ay,Nc);Dc.Ay&&Dc.Ay.locals&&Dc.Ay.locals;class Fc{constructor(e,t,r){Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storiesViewer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"backdropRef",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"deltaValY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"windowHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"swipeUpGestureInAction",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startMove(){this.storyReaderViewModel.disableCloseGesture(),this.windowHeight=this.storiesViewer.clientHeight,this.storiesViewer.style.setProperty("transition","")}move(e){e>10||this.storyReaderViewModel.closeGestureInAction?(this.storyReaderViewModel.enableCloseGesture(),this.moveDownAndScaleReader(e)):(e<-10||this.swipeUpGestureInAction)&&this.moveUp(e)}endMove(){var e;null===(e=this.storyReaderViewModel.activeStory)||void 0===e||e.resumeSystem(this.storyReaderViewModel.touchController),this.deltaValY>=0&&this.handleSwipeDown(),this.storyReaderViewModel.disableCloseGesture()}moveDownAndScaleReader(e){this.deltaValY=e/this.windowHeight;let t=1-(1-.9)*this.deltaValY;t>=1&&(t=1);let r=100*this.deltaValY*.45;r<=0&&(r=0),this.storiesViewer.style.setProperty("transform",`scale(${t}) translateY(${r}%)`)}moveUp(e){this.swipeUpGestureInAction=!0,this.deltaValY=e/this.windowHeight}returnToDefaultState(){this.storiesViewer.style.setProperty("transition","all .3s"),this.storiesViewer.style.setProperty("transform","scale(1) translateY(0%)")}closeStoryReader(){this.storiesViewer.style.setProperty("transition","opacity .3s"),this.storiesViewer.style.setProperty("opacity","0"),this.backdropRef.style.setProperty("transition","opacity .3s"),this.backdropRef.style.setProperty("opacity","0"),setTimeout(()=>{this.storyReaderViewModel.close(bs.CloseBySwipeDown)},400)}handleSwipeDown(){this.deltaValY<=.15||!this.storyReaderViewModel.canBeClosed()?this.returnToDefaultState():this.closeStoryReader()}}var Uc=_(8790),Gc={};Gc.styleTagTransform=Wl(),Gc.setAttributes=Ul(),Gc.insert=Nl().bind(null,"head"),Gc.domAPI=Bl(),Gc.insertStyleElement=Vl();Ll()(Uc.Ay,Gc);Uc.Ay&&Uc.Ay.locals&&Uc.Ay.locals;const Vc=e=>{var t,r;const{storyReaderOptions:i}=vp();return(0,Sl.jsx)("div",{dir:e.dir,"data-position":i.closeButtonPosition,className:Al()(Uc.Kk,{[Uc.dG]:e.hidden},e.className),children:(0,Sl.jsx)("button",{className:Al()(Uc.Gp,{}),onClick:t=>{t.stopPropagation(),t.preventDefault(),e.onClose()},dangerouslySetInnerHTML:{__html:null!==(r=null===(t=i.closeButton)||void 0===t?void 0:t.svgSrc.baseState)&&void 0!==r?r:""}})})},zc=(0,jc.observer)(e=>{const t=(0,_l.useRef)(null),r=(0,_l.useRef)(null),{storyReaderOptions:i}=vp();(({storyReaderViewModel:e,storiesViewerRef:t,backdropRef:r})=>{const i=(0,_l.useRef)(null);(0,_l.useEffect)(()=>{i.current=new Fc(e,t.current,r.current)},[]);const s=()=>{var e;t.current.classList.add(Dc.Z2),null===(e=i.current)||void 0===e||e.startMove()},a=({dy:e})=>{var t;null===(t=i.current)||void 0===t||t.move(e)},o=()=>{var r;t.current.classList.remove(Dc.Z2),e.touchController.verticalSwipeGesture&&(null===(r=i.current)||void 0===r||r.endMove())};(0,_l.useEffect)(()=>{const t=e.touchController;return t.on(Gt.TouchStart,s),t.on(Gt.TouchMoveVertical,a),t.on(Gt.TouchEnd,o),()=>{t.off(Gt.TouchStart,s),t.off(Gt.TouchMoveVertical,a),t.off(Gt.TouchEnd,o)}},[e.touchController])})({storyReaderViewModel:e.storyReader,backdropRef:t,storiesViewerRef:r});const s=e.storyReader.activeStory;return(0,Sl.jsxs)(Sl.Fragment,{children:[(0,Sl.jsxs)("div",{ref:r,className:Al()("stories-viewer",Dc.vi),style:Object.assign(Object.assign({},{"--loaderBackgroundColor":null===(a=i.loader)||void 0===a?void 0:a.default.color,"--loaderBackgroundAccentColor":null===(o=i.loader)||void 0===o?void 0:o.default.accentColor,"--timelineBlockTopOffset":`${parseFloat(String(i.timelineBlockTopOffset))}px`}),(()=>{var e,t,r,s;return{backgroundColor:null!==(t=null===(e=i.commonBackdrop)||void 0===e?void 0:e.color)&&void 0!==t?t:void 0,backdropFilter:null!==(s=null===(r=i.commonBackdrop)||void 0===r?void 0:r.backdropFilter)&&void 0!==s?s:void 0}})()),children:[ye&&(0,Sl.jsx)("div",{className:Dc.GJ,style:(()=>{var t,r,s;const a=[],o=null===(t=e.storyReader.activeStory)||void 0===t?void 0:t.cover;return null!=i.slideBackdrop&&Array.isArray(i.slideBackdrop.linearGradientOverlay)&&a.push(`linear-gradient(${i.slideBackdrop.linearGradientOverlay.join(", ")})`),null!=o&&a.push(`url(${o})`),{backgroundImage:a.join(", "),opacity:(null===(r=i.slideBackdrop)||void 0===r?void 0:r.opacity)||0,filter:(null===(s=i.slideBackdrop)||void 0===s?void 0:s.blur)?`blur(${i.slideBackdrop.blur}px)`:"none"}})()}),e.children,e.isDesktopGeometry&&s&&!s.disableClose&&(0,Sl.jsx)(Vc,{dir:e.storyReader.dir,className:Dc.m9,hidden:Boolean(s.pauseState.isUIPaused),onClose:()=>{e.storyReader.close()}})]}),(0,Sl.jsx)("div",{ref:t,className:Al()(Dc.qc,{[Dc.Xr]:ye})})]});var a,o});var Wc=_(9037),$c={};$c.styleTagTransform=Wl(),$c.setAttributes=Ul(),$c.insert=Nl().bind(null,"head"),$c.domAPI=Bl(),$c.insertStyleElement=Vl();Ll()(Wc.Ay,$c);Wc.Ay&&Wc.Ay.locals&&Wc.Ay.locals;var Hc=_(6349),qc={};qc.styleTagTransform=Wl(),qc.setAttributes=Ul(),qc.insert=Nl().bind(null,"head"),qc.domAPI=Bl(),qc.insertStyleElement=Vl();Ll()(Hc.Ay,qc);Hc.Ay&&Hc.Ay.locals&&Hc.Ay.locals;var Jc=_(6028),Kc={};Kc.styleTagTransform=Wl(),Kc.setAttributes=Ul(),Kc.insert=Nl().bind(null,"head"),Kc.domAPI=Bl(),Kc.insertStyleElement=Vl();Ll()(Jc.Ay,Kc);Jc.Ay&&Jc.Ay.locals&&Jc.Ay.locals;const Zc=e=>{const t=0===e.value||1===e.value;return(0,Sl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(-1===e.value?0:-1)}})},Qc=e=>(0,Sl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.activeState:e.options.svgSrc.baseState},onClick:()=>e.onClick(!e.value)}),Yc=e=>{const t=0===e.value||-1===e.value;return(0,Sl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(1===e.value?0:1)}})},Xc=e=>(0,Sl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:e.onClick}),ed=e=>(0,Sl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.options.svgSrc.baseState},onClick:e.onClick});var td=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const rd=(0,jc.observer)(e=>{var{actionPanel:t,commonOptions:r,storyReaderOptions:i,nodeRef:s,hidden:a}=e,o=td(e,["actionPanel","commonOptions","storyReaderOptions","nodeRef","hidden"]);const n=t.hasLike&&Boolean(r.hasLike),l=t.hasShare&&Boolean(r.hasShare),c=t.hasFavorite&&Boolean(r.hasFavorite),d=t.hasAudio;return(0,Sl.jsx)("div",{ref:s,dir:o.dir,className:Al()(Jc.OI,{[Jc.NG]:a,[Jc.x3]:!o.isDesktopGeometry}),children:(0,Sl.jsxs)("div",{className:Jc.km,children:[n&&(0,Sl.jsx)(Yc,{className:Jc.lL,value:t.like,options:i.likeButton,onClick:e=>{t.setLike(e)}}),n&&(0,Sl.jsx)(Zc,{className:Jc.lL,value:t.like,options:i.dislikeButton,onClick:e=>{t.setDislike(e)}}),c&&(0,Sl.jsx)(Qc,{className:Jc.lL,value:t.favorite,options:i.favoriteButton,onClick:e=>{t.setBookmark(e)}}),(0,Sl.jsxs)("div",{className:Jc.i2,children:[d&&(0,Sl.jsx)(Xc,{className:Jc.lL,value:t.muted,options:i.muteButton,onClick:()=>{t.muted?t.unmute():t.mute()}}),l&&(0,Sl.jsx)(ed,{className:Jc.lL,options:i.shareButton,onClick:()=>{t.share()}})]})]})})});var id=_(2208),sd={};sd.styleTagTransform=Wl(),sd.setAttributes=Ul(),sd.insert=Nl().bind(null,"head"),sd.domAPI=Bl(),sd.insertStyleElement=Vl();Ll()(id.A,sd);id.A&&id.A.locals&&id.A.locals;var ad=_(114),od={};od.styleTagTransform=Wl(),od.setAttributes=Ul(),od.insert=Nl().bind(null,"head"),od.domAPI=Bl(),od.insertStyleElement=Vl();Ll()(ad.Ay,od);ad.Ay&&ad.Ay.locals&&ad.Ay.locals;const nd=(0,jc.observer)(e=>{const{ref:t}=(e=>{const t=(0,_l.useRef)(null);return(0,_l.useEffect)(()=>{const r=e.timeline.timer,i=e=>{var r;null===(r=t.current)||void 0===r||r.style.setProperty("--tick",e+"%")},s=()=>{var e;null===(e=t.current)||void 0===e||e.style.setProperty("--tick","0%")},a=()=>{var e;null===(e=t.current)||void 0===e||e.style.setProperty("--tick","0%")};return r.on(Vr.Start,s),r.on(Vr.Stop,a),r.on(Vr.Progress,i),()=>{r.off(Vr.Start,s),r.off(Vr.Progress,i),r.off(Vr.Stop,a)}},[e]),{ref:t}})(e.story),r=e.story.activeSlide.timeline;return(0,Sl.jsx)("div",{ref:t,dir:e.dir,className:Al()(ad.wg,{[ad.tG]:ye,[ad.dP]:e.hidden}),style:{"--story-timeline-tick-foreground":null==r?void 0:r.foreground,"--story-timeline-background":null==r?void 0:r.background},children:(0,Sl.jsx)("div",{className:`${ad.JS}`,children:new Array(e.story.slidesCount).fill(0).map((t,r)=>(0,Sl.jsxs)("div",{className:ad.wY,children:[(0,Sl.jsx)("div",{className:Al()(ad.cQ,{[ad.d]:r+1<=e.story.activeSlideIndex})}),(0,Sl.jsx)("div",{className:ad.Wr,style:{display:r+1===e.story.activeSlideIndex+1?"block":"none"}})]},r+1))})})});var ld=_(3910),cd={};cd.styleTagTransform=Wl(),cd.setAttributes=Ul(),cd.insert=Nl().bind(null,"head"),cd.domAPI=Bl(),cd.insertStyleElement=Vl();Ll()(ld.Ay,cd);ld.Ay&&ld.Ay.locals&&ld.Ay.locals;const dd=()=>(0,Sl.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Sl.jsxs)("g",{children:[(0,Sl.jsx)("path",{fill:"currentColor",d:"M224,435.8V76.1c0-6.7-5.4-12.1-12.2-12.1h-71.6c-6.8,0-12.2,5.4-12.2,12.1v359.7c0,6.7,5.4,12.2,12.2,12.2h71.6 C218.6,448,224,442.6,224,435.8z"}),(0,Sl.jsx)("path",{fill:"currentColor",d:"M371.8,64h-71.6c-6.7,0-12.2,5.4-12.2,12.1v359.7c0,6.7,5.4,12.2,12.2,12.2h71.6c6.7,0,12.2-5.4,12.2-12.2V76.1 C384,69.4,378.6,64,371.8,64z"})]})}),hd=()=>(0,Sl.jsx)("svg",{width:"16",height:"16",viewBox:"-40 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Sl.jsx)("path",{fill:"currentColor",d:"M405.2,232.9L126.8,67.2c-3.4-2-6.9-3.2-10.9-3.2c-10.9,0-19.8,9-19.8,20H96v344h0.1c0,11,8.9,20,19.8,20 c4.1,0,7.5-1.4,11.2-3.4l278.1-165.5c6.6-5.5,10.8-13.8,10.8-23.1C416,246.7,411.8,238.5,405.2,232.9z"})}),ud=(0,jc.observer)(e=>(0,Sl.jsxs)("div",{className:Al()(ld.bA),dir:e.dir,children:[ye&&(0,Sl.jsxs)("div",{className:Al()(ld.KH,ld.Pl,{[ld.BL]:e.hidden||e.story.timeline.hiddenTimeline}),children:[(0,Sl.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:Al()(ld.Xs,{[ld.Uv]:!e.story.pauseState.isUserPaused}),onClick:()=>{e.story.resumeUser()},children:(0,Sl.jsx)(hd,{})}),(0,Sl.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:Al()(ld.Xs,{[ld.Uv]:e.story.pauseState.isUserPaused}),onClick:()=>{e.story.pauseUser()},children:(0,Sl.jsx)(dd,{})})]}),!e.story.disableClose&&!e.isDesktopGeometry&&(0,Sl.jsx)("div",{className:Al()(ld.KH),children:(0,Sl.jsx)(Vc,{dir:e.story.dir,className:Al()(ld.K0),hidden:e.hidden,onClose:()=>{e.onClose()}})})]})),pd=(0,jc.observer)(e=>(0,Sl.jsxs)("div",{ref:e.nodeRef,className:Al()(id.h),children:[(0,Sl.jsx)(nd,{dir:e.story.dir,story:e.story,hidden:e.hidden||e.story.timeline.hiddenTimeline}),(0,Sl.jsx)(ud,{dir:e.story.dir,story:e.story,onClose:e.onClose,isDesktopGeometry:e.isDesktopGeometry,hidden:e.hidden})]}));var gd=_(2004),fd={};fd.styleTagTransform=Wl(),fd.setAttributes=Ul(),fd.insert=Nl().bind(null,"head"),fd.domAPI=Bl(),fd.insertStyleElement=Vl();Ll()(gd.Ay,fd);gd.Ay&&gd.Ay.locals&&gd.Ay.locals;const md=e=>(0,Sl.jsx)("div",{ref:e.nodeRef,className:Al()(gd.hH,{[gd.At]:e.hidden})});var yd=_(5479),vd={};vd.styleTagTransform=Wl(),vd.setAttributes=Ul(),vd.insert=Nl().bind(null,"head"),vd.domAPI=Bl(),vd.insertStyleElement=Vl();Ll()(yd.Ay,vd);yd.Ay&&yd.Ay.locals&&yd.Ay.locals;const bd=(0,jc.observer)(e=>{const t=e.needShowErrorScreen,r=e.needShowLoaderScreen;return r||t?(0,Sl.jsx)("div",{className:Al()(yd.wG),style:Object.assign({"--loader-background":e.background,"--loaderBackgroundColor":e.color},e.style),onClick:e=>{e.preventDefault()},children:t?(0,Sl.jsx)(Ql,{className:yd.MU,onClick:t=>{t.stopPropagation(),e.onReload()}}):r&&(0,Sl.jsx)("div",{className:yd.Xr})}):null});const wd=function(){let e;const t=document.createElement("div"),r={transition:"transitionend",OTransition:"otransitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&void 0!==t.style[e])return r[e]}();function Sd(e,t,r){return new Promise(i=>{let s=!1;const a=()=>{s=!0,clearTimeout(n),void 0!==wd&&e.removeEventListener(wd,o),e.style.setProperty("transition",`${t} 0ms`),i()},o=e=>{e.propertyName===t&&(s||a())};void 0!==wd&&e.addEventListener(wd,o,!1);const n=setTimeout(()=>{s||a()},r+20);e.style.setProperty("transition",`${t} ${r}ms`)})}var _d=_(2561),Od={};Od.styleTagTransform=Wl(),Od.setAttributes=Ul(),Od.insert=Nl().bind(null,"head"),Od.domAPI=Bl(),Od.insertStyleElement=Vl();Ll()(_d.Ay,Od);_d.Ay&&_d.Ay.locals&&_d.Ay.locals;const xd=e=>{const t=(0,_l.useRef)(null),r=(0,_l.useRef)(null),i=(0,_l.useRef)(0),s=(0,_l.useRef)(0);let a;const o=()=>{r.current&&(s.current=-1*function(e){const t=window.getComputedStyle(e),r=t.transform||t.webkitTransform||t.mozTransform;if("none"===r)return{x:0,y:0,z:0};const i=r.includes("3d")?"3d":"2d",s=r.match(/matrix.*\((.+)\)/)[1].split(", ");return"2d"===i?{x:isNaN(s[4])?0:s[4],y:isNaN(s[5])?0:s[5],z:0}:"3d"===i?{x:isNaN(s[12])?0:s[12],y:isNaN(s[13])?0:s[13],z:isNaN(s[14])?0:s[14]}:{x:0,y:0,z:0}}(r.current).x)},[n,l]=(0,_l.useState)(!1),[c,d]=(0,_l.useState)(!1),h=(0,_l.useRef)(!1),u=()=>{const t=_l.Children.count(e.children);return r.current&&t?r.current.scrollWidth/t:0};let p=!1;(0,_l.useEffect)(()=>{var e;return("ontouchstart"in window||window.navigator.msPointerEnabled||"ontouchstart"in document.documentElement)&&(p=!0),p||(r.current&&(a=null===(e=r.current.children[0])||void 0===e?void 0:e.offsetWidth),r.current&&(i.current=r.current.scrollWidth-r.current.clientWidth,o()),i.current===s.current?d(!1):d(!0),0===s.current?l(!1):l(!0)),()=>{}},[]);const g=(0,_l.useRef)(!1),f=(0,_l.useRef)(0);let m=0;const y=(0,_l.useRef)(!1),[v,b]=(0,_l.useState)(0),w=e=>{e<0&&(e=0),e>i.current&&(e=i.current),b(e)};(0,_l.useEffect)(()=>{v===i.current?d(!1):d(!0),l(0!==v)},[v]);const S=e=>{if(!h.current)if(g.current){const t=e instanceof MouseEvent?e.pageX:e.touches&&e.touches[0].pageX;if(t!==f.current){y.current=!0,m=t;const e=f.current-m,r=s.current+e;w(r)}}else y.current=!1},_=e=>{y.current&&e.preventDefault(),setTimeout(()=>{y.current=!1}),g.current=!1,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",S),document.removeEventListener("touchend",_)};return(0,Sl.jsxs)("div",{className:_d.tK,style:e.style,children:[(0,Sl.jsx)("div",{className:_d.gE,ref:t,onMouseDown:e=>{h.current||(e.preventDefault(),g.current=!0,f.current=e.pageX,r.current&&(i.current=r.current.scrollWidth-r.current.clientWidth),r.current&&o(),document.addEventListener("mousemove",S),document.addEventListener("mouseup",_))},onTouchStart:e=>{h.current||(e.preventDefault(),g.current=!0,f.current=e.touches&&e.touches[0].pageX,r.current&&(i.current=r.current.scrollWidth-r.current.clientWidth),r.current&&o(),document.addEventListener("touchmove",S),document.addEventListener("touchend",_))},onClickCapture:e=>{y.current&&(e.preventDefault(),e.stopPropagation())},children:(0,Sl.jsx)("div",{className:_d.GW,ref:r,style:{transform:`translateX(${-1*v}px)`},children:e.children})}),!p&&(0,Sl.jsxs)(Sl.Fragment,{children:[(0,Sl.jsx)("div",{className:Al()(_d.Nd,_d.gN,{[_d.Su]:n}),onClick:async()=>{if(h.current)return;o();const e=s.current-u();w(e),h.current=!0,r.current&&await Sd(r.current,"transform",300),h.current=!1},children:(0,Sl.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Sl.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),(0,Sl.jsx)("div",{className:Al()(_d.Nd,_d.PP,{[_d.Su]:c}),onClick:async()=>{if(h.current)return;o();const e=s.current+u();w(e),h.current=!0,r.current&&await Sd(r.current,"transform",300),h.current=!1},children:(0,Sl.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Sl.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})})]})]})},kd=({children:e,style:t,color:r,font:i,className:s})=>(0,Sl.jsx)("div",{className:s,style:Object.assign({color:r,font:i},t),children:e});var Cd=_(2621),Pd={};Pd.styleTagTransform=Wl(),Pd.setAttributes=Ul(),Pd.insert=Nl().bind(null,"head"),Pd.domAPI=Bl(),Pd.insertStyleElement=Vl();Ll()(Cd.Ay,Pd);Cd.Ay&&Cd.Ay.locals&&Cd.Ay.locals;const jd=({goods:e,onClick:t,options:r})=>{var i;const{imgSrc:s,title:a,subTitle:o,price:n,oldPrice:l}=e;return(0,Sl.jsxs)("div",{className:Al()(Cd.gS),style:{color:null!==(i=r.mainTextColor)&&void 0!==i?i:"black"},onClick:t,children:[(0,Sl.jsx)("div",{className:Al()(Cd.vP),style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor},children:s&&(0,Sl.jsx)("img",{src:s,alt:a,style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor}})}),(0,Sl.jsx)(kd,{font:r.subtitleFont,children:o}),(0,Sl.jsx)(kd,{font:r.titleFont,children:a}),(0,Sl.jsxs)("div",{className:Cd.Vt,children:[(0,Sl.jsx)(kd,{font:r.priceFont,children:n}),(0,Sl.jsx)(kd,{className:Cd.ld,font:r.oldPriceFont,color:r.oldPriceTextColor,children:l})]})]})},Ed=e=>{const t=e.goodsWidgetOptions,r=t.goodsWidgetRenderingType||t.goodsList.renderingType;let i=[];return r===Pt.DEFAULT?i=e.goodsList.map((r,i)=>(0,Sl.jsx)(jd,{options:t.goodsCard,goods:r,onClick:()=>e.onGoodsCardClick(r)},i)):r===Pt.CUSTOM_CARD&&(0,C.isFunction)(t.getCardHtml)&&(i=e.goodsList.map((r,i)=>{var s,a;return(0,Sl.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(a=null===(s=t.getCardHtml)||void 0===s?void 0:s.call(t,r,i))&&void 0!==a?a:""},onClick:()=>e.onGoodsCardClick(r)},i)})),(0,Sl.jsx)(xd,{style:{marginTop:"-15px"},children:i})};var Id=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Td=e=>{var{arrowColor:t}=e,r=Id(e,["arrowColor"]);return(0,Sl.jsx)("svg",Object.assign({},r,{width:"32",height:"12.5",viewBox:"0 0 64 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Sl.jsx)("path",{d:"M56.293 1.23375C58.054 -0.41125 60.846 -0.41125 62.607 1.23375C64.464 2.96775 64.464 5.85675 62.607 7.59075L35.157 23.2288C33.396 24.8738 30.604 24.8738 28.843 23.2288L1.393 7.59075C0.494002 6.75175 0 5.62775 0 4.41275C0 3.19775 0.494002 2.07375 1.393 1.23475C3.154 -0.410251 5.946 -0.410251 7.707 1.23475L32 13.9237L56.293 1.23375Z",fill:t})}))};var Ad=_(4354),Md={};Md.styleTagTransform=Wl(),Md.setAttributes=Ul(),Md.insert=Nl().bind(null,"head"),Md.domAPI=Bl(),Md.insertStyleElement=Vl();Ll()(Ad.A,Md);Ad.A&&Ad.A.locals&&Ad.A.locals;const Ld=({closeImage:e,arrowColor:t,onClick:r})=>(0,Sl.jsx)("div",{className:Ad.H,onClick:r,onTouchStart:r,children:e?(0,Sl.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}):(0,Sl.jsx)(Td,{arrowColor:t})});var Rd=_(9406),Bd={};Bd.styleTagTransform=Wl(),Bd.setAttributes=Ul(),Bd.insert=Nl().bind(null,"head"),Bd.domAPI=Bl(),Bd.insertStyleElement=Vl();Ll()(Rd.Ay,Bd);Rd.Ay&&Rd.Ay.locals&&Rd.Ay.locals;const Dd=({isLoading:e,backgroundColor:t="white",accentBackgroundColor:r="transparent"})=>e?(0,Sl.jsx)("div",{className:Rd.u1,style:{border:`solid 2px ${t}`,borderColor:`${r} ${t} ${t} ${t}`}}):null;var Nd=_(777),Fd={};Fd.styleTagTransform=Wl(),Fd.setAttributes=Ul(),Fd.insert=Nl().bind(null,"head"),Fd.domAPI=Bl(),Fd.insertStyleElement=Vl();Ll()(Nd.Ay,Fd);Nd.Ay&&Nd.Ay.locals&&Nd.Ay.locals;const Ud=e=>{let t=[];return t=e.goodsList.map((t,r)=>e.renderGoods({goods:t,index:r,onClick:t=>{e.onGoodsCardClick(t)}})),(0,Sl.jsx)(xd,{children:t})};var Gd;!function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"}(Gd||(Gd={}));const Vd=({open:e,url:t,goodsWidgetOptions:r,onClosed:i,onClose:s,onGoodsCardClick:a})=>{const o=(0,_l.useRef)(null),[n,l]=(0,_l.useState)([]),[c,d]=(0,_l.useState)(Gd.IN),h=r,{dimColor:u,substrateHeight:p,substrateColor:g,closeImage:f,closeBackgroundColor:m}=h.goodsList;(0,_l.useEffect)(()=>{d(e?Gd.IN:Gd.OUT)},[e]),(0,_l.useEffect)(()=>{t&&y()},[t]);const y=async()=>{const e=v(),t=await r.openGoodsWidgetHandler(e);l(t)},v=()=>{try{return JSON.parse(t).map(e=>({sku:e,title:"",subTitle:"",price:"",oldPrice:""}))}catch(e){return console.error(e),[]}};(0,_l.useEffect)(()=>{const e=o.current;if(c===Gd.OUT)return e.addEventListener("animationend",i),()=>{e.removeEventListener("animationend",i)}},[c]);const b=h.loader.custom?(0,Sl.jsx)("div",{dangerouslySetInnerHTML:{__html:h.loader.custom}}):(0,Sl.jsx)(Dd,{isLoading:Boolean(r.isLoading),backgroundColor:h.loader.default.color,accentBackgroundColor:h.loader.default.accentColor});return(0,Sl.jsxs)("div",{className:Al()(Nd.rq,{[Nd.NM]:c===Gd.IN,[Nd.bt]:c===Gd.OUT}),ref:o,children:[(0,Sl.jsx)("div",{className:Al()(Nd.fY),style:{backgroundColor:u},onClick:s}),(0,Sl.jsxs)("div",{className:Al()(Nd.rq),style:{height:p+"px",backgroundColor:null!=g?g:"white"},children:[b,r.renderItem?(0,Sl.jsx)(Ud,{goodsWidgetOptions:r,goodsList:n,renderGoods:r.renderItem,onGoodsCardClick:a}):(0,Sl.jsx)(Ed,{goodsList:n,onGoodsCardClick:a,goodsWidgetOptions:r}),(0,Sl.jsx)(Ld,{onClick:s,closeImage:f,arrowColor:m})]})]})};var zd=_(9111),Wd={};Wd.styleTagTransform=Wl(),Wd.setAttributes=Ul(),Wd.insert=Nl().bind(null,"head"),Wd.domAPI=Bl(),Wd.insertStyleElement=Vl();Ll()(zd.A,Wd);zd.A&&zd.A.locals&&zd.A.locals;const $d=(0,jc.observer)(e=>{const[t,r]=(0,_l.useState)(!1),[i,s]=(0,_l.useState)(!1),a=()=>{s(!0),r(!0)},o=()=>{r(!1)};(0,_l.useEffect)(()=>{const t=e.story.goodsWidget;return t.on(Br.Open,a),t.on(Br.Close,o),()=>{t.off(Br.Open,a),t.off(Br.Close,o)}},[e.story]);return i&&e.story.goodsWidget.params.elementId?(0,Sl.jsx)("div",{className:zd.L,children:(0,Sl.jsx)(Vd,{open:t,url:e.story.goodsWidget.params.target,goodsWidgetOptions:e.goodsWidgetOptions,onClose:()=>{r(!1)},onClosed:()=>{e.story.goodsWidget.close(),s(!1)},onGoodsCardClick:t=>{var r,i;e.story.goodsWidget.onClick(t),null===(i=(r=e.goodsWidgetOptions).itemClickHandler)||void 0===i||i.call(r,t)}})}):null});class Hd{static isEmailValid(e){return/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(e)}static isTelephoneValid(e,t){return e?e.replace(/\s/g,"").length===t.length&&t.length>0:/^\d+$/.test(t)}}const qd=e=>{switch(e){case"":default:return"text";case"tel":return"tel";case"email":return"email"}},Jd={247:"9999",376:"99 99 99",971:"99 999 9999",93:"99 999 9999",1268:"999 9999",1264:"999 9999",355:"999 999 999",374:"99 999 999",599:"999 9999",244:"999 999 999",672:"9 99 999",54:"999 999 9999",1684:"999 9999",43:"999 999 9999",61:"9 9999 9999",297:"999 9999",994:"99 999 99 99",387:"99 999 999",1246:"999 9999",880:"99 999 999",32:"999 999 999",226:"99 99 9999",359:"999 999 999",973:"9999 9999",257:"99 99 9999",229:"99 99 9999",1441:"999 9999",673:"999 9999",591:"9 999 9999",55:"99 99999 9999",1242:"999 9999",975:"99 999 999",267:"99 999 999",375:"99 999 99 99",501:"999 9999",243:"999 999 999",236:"99 99 9999",242:"99 999 9999",41:"99 999 9999",225:"99 999 999",682:"99 999",56:"9 9999 9999",237:"9999 9999",86:"999 9999 9999",57:"999 999 9999",506:"9999 9999",53:"9 999 9999",238:"999 99 99",357:"99 999 999",420:"999 999 999",49:"9999 999 9999",253:"99 99 99 99",45:"99 99 99 99",1767:"999 9999",1809:"999 9999",1829:"999 9999",1849:"999 9999",213:"99 999 9999",593:"99 999 9999",372:"9999 9999",20:"999 999 9999",291:"9 999 999",34:"999 999 999",251:"99 999 9999",358:"999 999 99 99",679:"99 99999",500:"99999",691:"999 9999",298:"999 999",262:"99999 9999",33:"999 999 999",508:"99 9999",590:"999 999 999",241:"9 99 99 99",1473:"999 9999",995:"999 999 999",594:"99999 9999",233:"999 999 999",350:"999 99999",299:"99 99 99",220:"999 99 99",224:"99 999 999",240:"99 999 9999",30:"999 999 9999",502:"9 999 9999",1671:"999 9999",245:"9 999999",592:"999 9999",852:"9999 9999",504:"9999 9999",385:"99 999 999",509:"99 99 9999",36:"999 999 999",628:"99 999 9999",62:"99 999 99",353:"999 999 999",972:"99 999 9999",91:"9999 999 999",246:"999 9999",964:"999 999 9999",98:"999 999 9999",354:"999 9999",39:"999 9999 999",1876:"999 9999",962:"9 9999 9999",81:"99 9999 9999",254:"999 999999",996:"999 999 999",855:"99 999 999",686:"99 999",269:"99 99999",1869:"999 9999",850:"999 999 9999",82:"99 999 9999",965:"9999 9999",1345:"999 9999",76:"99 999 99 99",77:"99 999 99 99",856:"99 99 999 999",961:"99 999 999",1758:"999 9999",423:"999 999 9999",94:"99 999 9999",231:"99 999 999",266:"9 999 9999",370:"999 99 999",352:"999 999 999",371:"99 999 999",218:"99 999 9999",212:"99 9999 999",377:"9999 9999",373:"9999 9999",382:"99 999 999",261:"99 99 99999",692:"999 9999",389:"99 999 999",223:"99 99 9999",95:"99 999 999",976:"99 99 9999",853:"9999 9999",1670:"999 9999",596:"999 99 99 99",222:"99 99 9999",1664:"999 9999",356:"9999 9999",230:"999 9999",960:"999 9999",265:"99 999 9999",52:"999 999 9999",60:"99 999 9999",258:"99 999 999",264:"99 999 9999",687:"99 9999",227:"99 99 9999",234:"999 999 9999",505:"9999 9999",31:"99 999 9999",47:"999 99 999",977:"99 999 999",674:"999 9999",683:"9999",64:"999 999 999",968:"99 999 999",507:"999 9999",51:"999 999 999",689:"99 99 99",675:"999 99 999",63:"999 999 9999",92:"999 999 9999",48:"999 999 999",970:"99 999 9999",351:"99 999 9999",680:"999 9999",595:"999 999 999",974:"9999 9999",40:"99 999 9999",381:"99 999 9999",7:"999 999 99 99",250:"999 999 999",966:"99 999 9999",677:"999 9999",248:"9 999 999",249:"99 999 9999",46:"99 999 9999",65:"9999 9999",290:"99 999",386:"99 999 999",421:"999 999 999",232:"99 999999",378:"9999 999999",221:"99 999 9999",252:"99 999 999",597:"999 9999",211:"99 999 9999",239:"99 99999",503:"99 99 9999",1721:"999 9999",963:"99 9999 999",268:"99 99 9999",1649:"999 9999",235:"99 99 99 99",228:"99 999 999",66:"99 999 9999",992:"99 999 9999",690:"9999",670:"999 9999",993:"9 999 9999",216:"99 999 999",676:"99999",90:"999 999 9999",1868:"999 9999",688:"99 9999",886:"999 999 999",255:"99 999 9999",380:"99 999 99 99",256:"999 999 999",44:"99 9999 9999",598:"9 999 99 99",998:"99 999 9999",396:"999 99999",1784:"999 9999",58:"999 999 9999",1284:"999 9999",1340:"999 9999",84:"99 9999 999",678:"99 99999",681:"99 9999",685:"99 9999",967:"999 999 999",27:"99 999 9999",260:"99 999 9999",263:"9 999999",1:"999 999 9999",383:"9999 9999"},Kd=e=>{const[t,r]=(0,_l.useState)({countryCode:"",phone:""}),[i,s]=(0,_l.useState)(""),[a,o]=(0,_l.useState)(!0),n=r=>{var i;const s=qd(null!==(i=null==e?void 0:e.configV2.main.input.type)&&void 0!==i?i:"");return"email"===s?Hd.isEmailValid(r):"tel"!==s||Hd.isTelephoneValid((()=>{var e;const r=t.countryCode.substring(1);return r&&null!==(e=Jd[r])&&void 0!==e?e:""})(),t.phone)};return{value:i,telephone:t,isValid:a,handleTelephoneChange:e=>{r(e),e.phone.length>0?s("+"+e.countryCode+e.phone):s("")},handleChange:e=>{s(e)},handleSubmit:e=>{const t=i.trim(),r=n(i);o(r),r&&e({value:t})},reset:()=>{o(!0),s(""),r({countryCode:"",phone:""})}}};var Zd=_(7656),Qd={};Qd.styleTagTransform=Wl(),Qd.setAttributes=Ul(),Qd.insert=Nl().bind(null,"head"),Qd.domAPI=Bl(),Qd.insertStyleElement=Vl();Ll()(Zd.Ay,Qd);Zd.Ay&&Zd.Ay.locals&&Zd.Ay.locals;const Yd=e=>{const t=(0,_l.useRef)(null);return(0,_l.useEffect)(()=>{t.current&&(H(t.current),t.current.focus())},[]),(0,Sl.jsx)("input",{type:"email",className:Al()(Zd.hF,Zd.Q$),placeholder:e.placeholder,value:e.value,ref:t,onChange:t=>e.onChange(t.target.value)})};class Xd{constructor(e,t={}){Object.defineProperty(this,"pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"patternChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placeholderChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lastValue",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lastSelectionStart",{enumerable:!0,configurable:!0,writable:!0,value:0});const{pattern:r="+7 (___) ___-__-__",patternChar:i="_",placeholderChar:s="_"}=t;this.inputElement=e,this.pattern=r,this.patternChar=i,this.placeholderChar=s,this.handleBeforeInput=this.handleBeforeInput.bind(this),this.handleInput=this.handleInput.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handlePaste=this.handlePaste.bind(this),this.setupEventListeners(),this.initializeMask()}setupEventListeners(){this.inputElement.addEventListener("beforeinput",this.handleBeforeInput),this.inputElement.addEventListener("input",this.handleInput),this.inputElement.addEventListener("keydown",this.handleKeyDown),this.inputElement.addEventListener("focus",this.handleFocus),this.inputElement.addEventListener("paste",this.handlePaste)}removeEventListeners(){this.inputElement.removeEventListener("beforeinput",this.handleBeforeInput),this.inputElement.removeEventListener("input",this.handleInput),this.inputElement.removeEventListener("keydown",this.handleKeyDown),this.inputElement.removeEventListener("focus",this.handleFocus),this.inputElement.removeEventListener("paste",this.handlePaste)}destroy(){this.removeEventListeners(),this.inputElement=null}initializeMask(){""===this.inputElement.value&&(this.inputElement.value=this.getEmptyMask(),this.lastValue=this.inputElement.value,this.lastSelectionStart=0)}handleFocus(){this.initializeMask();const e=this.findNextEditablePos(0);-1!==e&&0===this.inputElement.selectionStart&&this.setSelection(e)}isStaticMaskChar(e){if(e<0||e>=this.pattern.length)return!1;const t=this.pattern[e];return t!==this.patternChar&&!/\d/.test(t)}handleBeforeInput(e){e.data&&e.data.includes(" ")?e.preventDefault():"insertText"!==e.inputType||!e.data||/^\d+$/.test(e.data)?(this.lastValue=this.inputElement.value,this.lastSelectionStart=this.inputElement.selectionStart||0):e.preventDefault()}handlePaste(e){var t;e.preventDefault();const r=(null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain"))||"";this.processPastedText(r)}handleKeyDown(e){const{key:t}=e,r=this.inputElement.selectionStart||0,i=this.inputElement.selectionEnd||0,s=r!==i;if(" "!==t)if(/^\d$/.test(t)||["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","Tab"].includes(t)){if("Backspace"===t)s?this.processSelectionDelete(r,i):this.processBackspace(r),e.preventDefault();else if("Delete"===t)s?this.processSelectionDelete(r,i):this.processDelete(r),e.preventDefault();else if(/^\d$/.test(t)){const e=r;this.isStaticMaskChar(e)&&this.setSelection(e+1)}}else e.preventDefault();else e.preventDefault()}handleInput(e){"insertText"!==e.inputType&&"insertFromPaste"!==e.inputType||this.processTextInput(e.data||"")}processTextInput(e){const t=e.replace(/\D/g,"");if(!t)return;const r=this.lastValue.split("");let i=this.lastSelectionStart;for(let e=0;e<t.length;e++){const s=this.findNextEditablePos(i);if(-1===s)break;for(r[s]=t[e],i=s+1;i<this.pattern.length&&this.isStaticMaskChar(i);)i++}this.updateValue(r.join(""),i)}processPastedText(e){const t=e.replace(/\D/g,"");if(!t)return;const r=this.lastValue.split("");let i=this.lastSelectionStart;for(let e=0;e<t.length;e++){const s=this.findNextEditablePos(i);if(-1===s)break;for(r[s]=t[e],i=s+1;i<this.pattern.length&&this.isStaticMaskChar(i);)i++}this.updateValue(r.join(""),i)}processBackspace(e){let t=e-1;for(;t>=0&&this.isStaticMaskChar(t);)t--;if(t>=0&&this.isEditablePosition(t)){const e=this.lastValue.split("");e[t]=this.placeholderChar,this.updateValue(e.join(""),t)}}processDelete(e){const t=[...this.lastValue];let r=e,i=!1;for(;r<this.pattern.length;){if(this.isEditablePosition(r)){t[r]=this.placeholderChar,i=!0;break}r++}if(i){let e=r+1;for(;e<this.pattern.length&&this.isStaticMaskChar(e);)e++;this.updateValue(t.join(""),e)}}processSelectionDelete(e,t){const r=this.lastValue.split("");for(let i=e;i<t;i++)this.isEditablePosition(i)&&(r[i]=this.placeholderChar);this.updateValue(r.join(""),e)}updateValue(e,t){e!==this.inputElement.value&&(this.inputElement.value=e),this.setSelection(t),this.lastValue=e;const r=new Event("input",{bubbles:!0});this.inputElement.dispatchEvent(r)}setSelection(e){this.inputElement.setSelectionRange(e,e),this.lastSelectionStart=e}findNextEditablePos(e){for(let t=e;t<this.pattern.length;t++)if(this.isEditablePosition(t))return t;return-1}findPrevEditablePos(e){for(let t=e;t>=0;t--)if(this.isEditablePosition(t))return t;return-1}isEditablePosition(e){if(e<0||e>=this.pattern.length)return!1;const t=this.pattern[e];return t===this.patternChar||/\d/.test(t)}getEmptyMask(){return this.pattern.replace(new RegExp(this.patternChar,"g"),this.placeholderChar||"​")}getCleanPhoneNumber(){return this.lastValue.replace(/\D/g,"")}isValid(){const e=this.getCleanPhoneNumber(),t=this.pattern.split("").filter(e=>e===this.patternChar||/\d/.test(e)).length;return e.length>=t}isPartial(){return this.getCleanPhoneNumber().length>0&&!this.isValid()}setValue(e){if(null==e)return this.inputElement.value="",void this.initializeMask();const t=e.replace(/\D/g,""),r=this.getEmptyMask().split("");let i=0;for(let e=0;e<r.length&&i<t.length;e++)this.isEditablePosition(e)&&(r[e]=t[i],i++);this.updateValue(r.filter(e=>"​"!=e).join(""),this.findNextEditablePos(0))}}const eh=e=>{const{value:t="",pattern:r="+7 (___) ___-__-__",patternChar:i="9",placeholderChar:s="_",className:a="",onChange:o}=e,n=(0,_l.useRef)(null),l=(0,_l.useRef)(null);(0,_l.useEffect)(()=>(n.current&&(l.current=new Xd(n.current,{pattern:r,patternChar:i,placeholderChar:s}),l.current.setValue(t)),()=>{var e;null===(e=l.current)||void 0===e||e.destroy()}),[r,i,s]),(0,_l.useEffect)(()=>{l.current&&t!==l.current.getCleanPhoneNumber()&&l.current.setValue(t)},[t]);return(0,_l.useImperativeHandle)(e.inputRef,()=>({focus:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()},blur:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.blur()},setValue:e=>{var t;return null===(t=l.current)||void 0===t?void 0:t.setValue(e)},getCleanValue:()=>{var e;return(null===(e=l.current)||void 0===e?void 0:e.getCleanPhoneNumber())||""},getInputElement:()=>n.current})),(0,Sl.jsx)("input",{ref:n,type:"tel",placeholder:e.placeholder,className:a,onInput:()=>{var e;if(l.current){const t=(null===(e=n.current)||void 0===e?void 0:e.value)||"",r=l.current.getCleanPhoneNumber();o(t,r)}}})},th=e=>{const t=(0,_l.useRef)(null),r=e.value.countryCode?Jd[e.value.countryCode]:"";return(0,_l.useEffect)(()=>{var e;const r=null===(e=t.current)||void 0===e?void 0:e.getInputElement();var i;r&&(i=r,setTimeout(()=>{H(i),i.focus()}))},[]),(0,Sl.jsxs)("div",{className:Zd.rL,children:[(0,Sl.jsxs)("div",{className:Zd.rN,children:[(0,Sl.jsx)(eh,{value:e.value.countryCode,inputRef:t,pattern:"+999",placeholderChar:"",className:Zd.hF,onChange:(t,r)=>{e.onChange({countryCode:r,phone:e.value.phone})}}),(0,Sl.jsx)("div",{className:Zd.wU})]}),(null==r?void 0:r.length)?(0,Sl.jsx)(eh,{value:e.value.phone,pattern:r,placeholder:e.placeholder,className:Zd.hF,onChange:(t,r)=>{e.onChange({countryCode:e.value.countryCode,phone:r})}}):(0,Sl.jsx)("input",{type:"tel",className:Zd.hF,placeholder:e.placeholder,value:e.value.phone,onChange:t=>{const r=t.target;r&&(r.value=r.value.replace(/\D/g,""),e.onChange({countryCode:e.value.countryCode,phone:r.value}))}})]})},rh=e=>{const t=(0,_l.useRef)(null),r=(0,_l.useRef)(null);(0,_l.useEffect)(()=>{r.current.dataset.replicatedValue=e.value,H(t.current),t.current.focus(),t.current.setSelectionRange(e.value.length,e.value.length)},[]);return(0,Sl.jsx)("div",{className:Zd.kJ,ref:r,style:e.style,children:(0,Sl.jsx)("textarea",{className:Zd.hF,placeholder:e.placeholder,rows:1,ref:t,maxLength:e.maxLength,value:e.value,onChange:t=>e.onChange(t.target.value),onInput:e=>{r.current.dataset.replicatedValue=e.currentTarget.value}})})};var ih=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const sh=e=>{var{form:t,config:r}=e,i=ih(e,["form","config"]);const[s,a]=(0,_l.useState)(!0),{getMainStyle:o,getMainElementsStyle:n,getQuestionStyle:l,getInputWrapperStyle:c,getButtonStyle:d,getTextareaStyle:h}=(({config:e})=>{const t=t=>t*(e.size.viewportWidth/(e.size.viewportWidth/e.size.fontSize));return{getMainStyle:()=>{const r=e.configV2.main;return{width:`${e.size.absolute.width}px`,height:"auto",left:e.size.absolute.center.x-e.size.absolute.width/2-e.size.slideOffsetX+"px",top:e.size.absolute.center.y-e.size.absolute.height/2-e.size.slideOffsetY+"px",backgroundColor:`${r.background.color}`,border:`${r.border.visible&&`${t(r.border.width)}px solid ${r.border.color}`}`,borderRadius:`${t(r.border.radius)}px`}},getMainElementsStyle:()=>{const r=e.configV2.main;return{width:"100%",padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`}},getQuestionStyle:()=>{const r=e.configV2.main.question;return{padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`,color:`${r.text.color}`,fontSize:`${t(r.text.size)}px`,lineHeight:`${r.text.lineHeight}`,textAlign:`${r.text.align}`,fontFamily:`${r.text.type}`,fontWeight:`${r.text.weight}`,fontStyle:`${r.text.style}`}},getInputWrapperStyle:()=>{const r=e.configV2.main.input;let i=e.configV2.main.input.text.maxLines;return i=i>0?i:1,{padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`,backgroundColor:`${r.background.color}`,border:`${t(r.border.width)}px solid ${r.border.color}`,borderRadius:`${t(r.border.radius)}px`,lineHeight:`${r.text.lineHeight}`,maxHeight:r.text.lineHeight*i+"em",fontSize:`${t(r.text.size)}px`,overflowY:"scroll",scrollbarWidth:"none"}},getButtonStyle:()=>{const r=e.configV2.main.button;return{padding:`${t(r.padding.top)}px ${t(r.padding.right)}px ${t(r.padding.bottom)}px ${t(r.padding.left)}px`,backgroundColor:`${r.background.color}`,border:`${t(r.border.width)}px solid ${r.border.color}`,color:`${r.text.color}`,fontSize:`${t(r.text.size)}px`,lineHeight:`${r.text.lineHeight}`,textAlign:`${r.text.align}`,fontFamily:`${r.text.type}`,fontWeight:`${r.text.weight}`,fontStyle:`${r.text.style}`}},getTextareaStyle:()=>{const r=e.configV2.main.input;return{color:`${r.text.color}`,fontSize:`${t(r.text.size)}px`,lineHeight:`${r.text.lineHeight}`,textAlign:`${r.text.align}`,fontFamily:`${r.text.type}`,fontWeight:`${r.text.weight}`,fontStyle:`${r.text.style}`}}}})({config:r}),u=Math.max(r.configV2.main.input.text.limit,0),p=String(r.configV2.main.input.text.placeholder).trim(),g=String(r.configV2.main.button.text.value).trim(),f=String(r.configV2.main.question.text.value).trim(),m=qd(r.configV2.main.input.type),y=({value:e})=>{i.onComplete({result:!0,value:e}),a(!1)};return(0,Sl.jsxs)("div",{className:Zd.iE,children:[(0,Sl.jsx)("div",{className:Al()(Zd.tB,{[Zd.qG]:s,[Zd.Xn]:!s}),onAnimationEnd:()=>{s||i.onClose()},onClick:()=>{i.onComplete({result:!1,value:t.value}),a(!1)}}),(0,Sl.jsxs)("div",{className:Zd.iW,style:o(),children:[(0,Sl.jsxs)("div",{style:n(),children:[(0,Sl.jsx)("div",{className:Zd.b1,style:l(),children:f}),(0,Sl.jsxs)("div",{className:Al()(Zd.nl,{[Zd.fg]:!t.isValid}),style:c(),children:["text"===m&&(0,Sl.jsx)(rh,{value:t.value,onChange:t.handleChange,style:h(),placeholder:p,maxLength:u}),"email"===m&&(0,Sl.jsx)(Yd,{value:t.value,onChange:t.handleChange,placeholder:p}),"tel"===m&&(0,Sl.jsx)(th,{value:t.telephone,onChange:t.handleTelephoneChange,placeholder:p})]})]}),t.value.trim().length>0&&(0,Sl.jsx)("div",{className:Zd.HE,children:(0,Sl.jsx)("button",{className:Zd.x6,style:d(),onClick:()=>t.handleSubmit(y),children:g})})]})]})},ah=(0,jc.observer)(({storyGeometry:e,story:t,storyRef:r})=>{const[i,s]=(0,_l.useState)(null),a=Kd(i),o=t.textInput;(0,_l.useEffect)(()=>{o.config&&o.isOpened&&(t.pauseUI(o),t.touchController.disable(),(t=>{t.size.fontSize=parseFloat(e.getFontSize()),t.size.viewportWidth=e.calculateWidth();const i=r.current.getBoundingClientRect();t.size.slideOffsetX=i.x,t.size.slideOffsetY=i.y,t.size.slideHeight=i.height,s(t)})(o.config))},[o.isOpened]);return(0,_l.useLayoutEffect)(()=>()=>{a.reset()},[o.id]),i?(0,Sl.jsx)(sh,{form:a,config:i,onComplete:e=>{if(!o.id)return;const r=e.result?e.value:"";t.textInput.completeInput(r),t.activeSlide.setTextInputResult(o.id,r),t.resumeUI(o)},onClose:()=>{s(null),t.touchController.enable(),o.close()}}):null});class oh extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"preventNavigation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleClick",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.shadowRoot&&this.dispatchEvent(new CustomEvent("click",{detail:{event:e,currentTarget:this._mountPoint}}))}})}getMountPoint(){return this._mountPoint}setStyle(e){if(!this._mountPoint)return;this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement);const t=document.createElement("style");t.textContent=e,t.setAttribute("nonce",q()),this.styleElement=t,this._mountPoint.prepend(t)}connectedCallback(){const e=this.attachShadow({mode:"open"});this._mountPoint=document.createElement("div"),this._mountPoint.style.height="100%",this._mountPoint.style.width="100%",this._mountPoint.addEventListener("click",this.handleClick),e.appendChild(this._mountPoint)}disconnectedCallback(){var e;null===(e=this._mountPoint)||void 0===e||e.removeEventListener("click",this.handleClick)}}function nh(e){return"function"==typeof _l.forwardRef?_l.forwardRef(e):function(t){return e(t,t.ref)}}customElements.get("story-slides-container")||customElements.define("story-slides-container",oh);var lh=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const ch=(0,jc.observer)(nh((e,t)=>{var{className:r,story:i}=e,s=lh(e,["className","story"]);const a=(0,_l.useRef)(null);(0,_l.useImperativeHandle)(t,()=>({setStyle:e=>{var t;null===(t=a.current)||void 0===t||t.setStyle(e)},getMountPoint:()=>{var e,t;return null!==(t=null===(e=a.current)||void 0===e?void 0:e.getMountPoint())&&void 0!==t?t:null}}),[t,a]),(0,_l.useEffect)(()=>{if(!a.current)return;const e=a.current,t=e=>{s.onClick(e.detail)};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[s.onClick]);const o=s.isDesktopGeometry?"0px":`${i.actionPanel.height}px`;return(0,Sl.jsx)("story-slides-container",{ref:a,style:{bottom:o},class:r,dir:i.dir})}));var dh=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const hh=(0,jc.observer)(e=>{var{story:t,geometry:r,className:i}=e,s=dh(e,["story","geometry","className"]);const a=(0,_l.useRef)(null),o=(0,_l.useRef)(null),{storyReaderOptions:n,commonOptions:l,goodsWidgetOptions:c}=vp();var d;(({geometry:e,story:t})=>{const{storyReaderOptions:r,commonOptions:i}=vp(),s=e instanceof zi;(0,_l.useLayoutEffect)(()=>{const e=parseFloat(String(r.actionPanelBottomOffset));t.actionPanel.setOptions(i),t.actionPanel.setActionPanelHeight(e)},[t,i,r.actionPanelBottomOffset,s])})({geometry:r,story:t}),(({story:e,slideRef:t})=>{(0,_l.useLayoutEffect)(()=>{t.current&&t.current.setStyle(e.context.style)},[e.context.style,t])})({story:t,slideRef:o}),d={story:t,canBeInited:s.canBeInited,canBeStarted:s.canBeStarted,activeStory:s.activeStory,slideRef:o},(0,_l.useEffect)(()=>{d.slideRef.current&&d.story.update({container:d.slideRef.current.getMountPoint(),canBeInited:d.canBeInited,canBeStarted:d.canBeStarted,activeStory:d.activeStory})},[d.canBeInited,d.canBeStarted,d.slideRef,d.story]),(0,_l.useEffect)(()=>()=>{d.story.update({container:null,canBeInited:!1,canBeStarted:!1,activeStory:null})},[]);const h=r instanceof zi,u=t===s.activeStory,p=n.layout===At.Modern,g=h&&p&&!u||t.pauseState.isUIPaused,f=h&&(p&&!u||t.textInput.isOpened);return(0,Sl.jsxs)("div",{ref:a,className:Al()(Hc._7,i,{[Hc.Z8]:!h}),onMouseDown:()=>{t.sharePanel.completeNativeSharing({result:!1})},onTouchStart:()=>{t.sharePanel.completeNativeSharing({result:!1})},"data-testid":"story",children:[h&&p&&t.isSlideRendered&&(0,Sl.jsx)(md,{hidden:u}),t.isSlideRendered&&(0,Sl.jsx)(pd,{hidden:g,story:t,onClose:s.onClose,isDesktopGeometry:h}),(0,Sl.jsx)(ch,{className:Hc.rE,story:t,ref:o,isDesktopGeometry:h,onClick:({event:e,currentTarget:r})=>{u&&t.activeSlide.onClick({event:e,currentTarget:r,preventNavigation:p&&h})}}),t.actionPanel.needShown&&t.isSlideRendered&&(0,Sl.jsx)(rd,{dir:t.dir,isDesktopGeometry:h,hidden:f,actionPanel:t.actionPanel,commonOptions:l,storyReaderOptions:n}),s.activeStory===t&&(0,Sl.jsx)($d,{story:t,goodsWidgetOptions:c}),s.activeStory===t&&(0,Sl.jsx)(ah,{story:t,storyRef:a,storyGeometry:r}),t.sharePanel.isOpened&&(0,Sl.jsx)(wc,{dir:t.dir,shareText:t.sharePanel.params.text,shareType:t.sharePanel.params.type,shareLink:t.sharePanel.params.link,onShareCompelete:e=>t.sharePanel.handleShareComplete(t.sharePanel.params.id,e),sharePanelOptions:n.sharePanel}),(0,Sl.jsx)(bd,{needShowErrorScreen:t.needShowErrorScreen,needShowLoaderScreen:t.needShowLoaderScreen,onReload:()=>{t.recover()}})]})});var uh=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ph=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},gh=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},fh=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let mh=(()=>{var e,t,r;let i,s,a,o,n,l,c=P.EventEmitter,d=[],h=[],u=[],p=[],g=[];return e=class extends c{constructor(){super(...arguments),t.set(this,(uh(this,d),uh(this,h,!1))),r.set(this,(uh(this,u),uh(this,p,0))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:uh(this,g)}),Object.defineProperty(this,"handleViewportResize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{requestAnimationFrame(()=>{this.translateSlideTrack(this._currentIndex)})}}),Object.defineProperty(this,"getSlideTrackXOffset",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{const{width:r}=e.getBoundingClientRect(),i=e.children[t];if(!i)return;return r/2-i.offsetLeft-i.clientWidth/2}})}get _animating(){return gh(this,t,"f")}set _animating(e){fh(this,t,e,"f")}get _currentIndex(){return gh(this,r,"f")}set _currentIndex(e){fh(this,r,e,"f")}get currentIndex(){return this._currentIndex}get animating(){return this._animating}set currentIndex(e){this._currentIndex=e}init({$el:e}){this.$el=e,this.go(this._currentIndex,0),window.addEventListener("resize",this.handleViewportResize)}async go(e,t=300){this._animating||(this._animating=!0,this.startTransition(t),this.translateSlideTrack(e),t>0?await this.waitTransitionEnd(t):this.translateSlideTrack(this._currentIndex),this.endTransition(),this._animating=!1)}destroy(){window.removeEventListener("resize",this.handleViewportResize)}waitTransitionEnd(e){return new Promise(t=>{const r=i=>{Math.round(1e3*i.elapsedTime)===e&&"transform"===i.propertyName&&(this.$el.removeEventListener("transitionend",r),t())};this.$el.addEventListener("transitionend",r)})}startTransition(e){this.$el.style.transition=`transform ${e}ms ease-in-out`}endTransition(){this.$el.style.transition=""}translateSlideTrack(e){const t=this.getSlideTrackXOffset(this.$el,e);this.$el.style.transform=`translateX(${t}px)`}},t=new WeakMap,r=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=c[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[N.observable],s=[N.observable],a=[N.computed],o=[N.computed],n=[N.action],l=[N.action],ph(e,null,i,{kind:"accessor",name:"_animating",static:!1,private:!1,access:{has:e=>"_animating"in e,get:e=>e._animating,set:(e,t)=>{e._animating=t}},metadata:r},h,u),ph(e,null,s,{kind:"accessor",name:"_currentIndex",static:!1,private:!1,access:{has:e=>"_currentIndex"in e,get:e=>e._currentIndex,set:(e,t)=>{e._currentIndex=t}},metadata:r},p,g),ph(e,null,a,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,d),ph(e,null,o,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,d),ph(e,null,n,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:r},null,d),ph(e,null,l,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,d),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class yh{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t})}get animating(){return this.slider.animating}transitionByIndex(e,t){return this.slider.go(e)}}var vh=_(6778),bh={};bh.styleTagTransform=Wl(),bh.setAttributes=Ul(),bh.insert=Nl().bind(null,"head"),bh.domAPI=Bl(),bh.insertStyleElement=Vl();Ll()(vh.Ay,bh);vh.Ay&&vh.Ay.locals&&vh.Ay.locals;var wh=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Sh=e=>{var{disabled:t,navigationOptions:r,display:i}=e,s=wh(e,["disabled","navigationOptions","display"]);const a=s.dir===Nt.LTR,o=a?s.isNextDisabled:s.isPrevDisabled,n=a?s.isPrevDisabled:s.isNextDisabled,l=o||t,c=n||t;return(0,Sl.jsxs)("div",{ref:s.nodeRef,className:Al()(vh.cW,{[vh.d9]:!i}),children:[(0,Sl.jsx)("div",{className:Al()(vh.j,vh.Tr),children:(0,Sl.jsx)("button",{className:vh.qU,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onPrev()},disabled:c,dangerouslySetInnerHTML:{__html:r.prevButton.svgSrc.baseState}})}),(0,Sl.jsx)("div",{className:Al()(vh.j,vh.XX),children:(0,Sl.jsx)("button",{className:vh.qU,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onNext()},disabled:l,dangerouslySetInnerHTML:{__html:r.nextButton.svgSrc.baseState}})})]})},_h=(0,jc.observer)(e=>{const{storyReaderOptions:t}=vp(),{ref:r,slider:i}=(e=>{const[t]=(0,_l.useState)(()=>new mh),{storyReaderOptions:r}=vp(),i=(0,_l.useRef)(null);return t.currentIndex=e.activeStoryIndex,(0,_l.useEffect)(()=>(t.init({$el:i.current}),()=>{t.destroy()}),[e.stories,e.dir]),(0,_l.useEffect)(()=>{e.setAnimatedNavigationController(new yh(t,{closeOnLastSlideByTimer:Boolean(r.closeOnLastSlideByTimer)}))},[e,r.closeOnLastSlideByTimer]),{ref:i,slider:t}})(e.storyReader),s=e.storyReader.targetTransitionStory||e.storyReader.activeStory,a=parseFloat(String(t.borderRadius)),o=3*parseFloat(e.storyGeometry.getWidth()),n=s.pauseState.isUIPaused||i.animating,l=(t,r=2)=>{const i=-1===e.storyReader.targetTransitionIndex?e.storyReader.activeStoryIndex:e.storyReader.targetTransitionIndex,s=Math.max(i-r,0),a=Math.min(i+r,e.storyReader.stories.length-1);return t>=s&&t<=a},c=t=>e.storyReader.activeStoryIndex===t;return(0,Sl.jsx)("div",{className:Al()(Wc.fo),style:{"--slide-border-radius":`${a}px`,maxWidth:o},children:(0,Sl.jsx)("div",{className:Wc.$X,ref:r,dir:s.dir,children:e.storyReader.stories.map((r,i)=>{const a=r===s,o=r.isNextDisabled,d=r.isPrevDisabled;return(0,Sl.jsxs)("div",{style:{width:e.storyGeometry.getWidth()},className:Al()(Wc.uY,{[Wc.tB]:a}),onClick:()=>{n||e.storyReader.toStoryWithAnimationByIndex(i)},children:[(0,Sl.jsx)(hh,{index:i,story:r,slideClickDisabled:n,activeStory:s,geometry:e.storyGeometry,onClose:e.onCloseStory,canBeInited:l(i),canBeStarted:c(i)}),(e.storyReader.stories.length>1||r.slidesCount>1)&&s.isSlideRendered&&(0,Sl.jsx)(Sh,{dir:e.storyReader.dir,display:a&&s.isSlideRendered,disabled:n,isNextDisabled:o,isPrevDisabled:d,navigationOptions:t.navigation,onNext:()=>{e.storyReader.goNext()},onPrev:()=>{e.storyReader.goPrev()}})]},r.id)})})})});var Oh=_(4267),xh={};xh.styleTagTransform=Wl(),xh.setAttributes=Ul(),xh.insert=Nl().bind(null,"head"),xh.domAPI=Bl(),xh.insertStyleElement=Vl();Ll()(Oh.Ay,xh);Oh.Ay&&Oh.Ay.locals&&Oh.Ay.locals;const kh=({className:e,style:t})=>(0,Sl.jsx)("div",{className:Al()(Hc._7,e),style:t}),Ch=350,Ph="linear",jh=1.6,Eh=2*Math.tan(45*Math.PI/360),Ih=Ch/1e3;class Th{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e})}get perspective(){return 0}get depth(){return 0}get dirFactor(){return this.slider.dir===Nt.RTL?-1:1}destroy(){}}const Ah=.05;class Mh extends Th{constructor(){super(...arguments),Object.defineProperty(this,"shift",{enumerable:!0,configurable:!0,writable:!0,value:0})}init(){}transform(e){let t=this.slider.leftElement,r=this.slider.rightElement;const i=this.slider.frontElement;this.slider.isLtr||(t=this.slider.rightElement,r=this.slider.leftElement),null==t||t.style.setProperty("transform",`translate3d(${-100*(.1- -1*e/10)}%, 0, 0) scale(${Math.min(.9+-1*e/10,1)})`),null==r||r.style.setProperty("transform",`translate3d(${100*(1-e)}%, 0, 0)`),null==i||i.style.setProperty("transform",`translate3d(${e<=0?-100*e:-100*(0- -1*e/10)}%, 0, 0) scale(${e<=0?1:1+-1*e/10})`)}startMove(){this.shift=0}move(e){this.shift=this.dirFactor*e/this.slider.clientWidth,this.shift=this.applyBoundsConstraint(this.shift),this.transform(this.shift)}endMove(){if(!this.shift)return;const e=Math.round(this.shift);this.slider.emit("touchEnd",e)}getCSSStyle(e,t){return{visibility:Math.abs(e-t)<=1?"visible":"hidden",transition:"inherit",transform:`translate3d(${0===e?-10:-100*t+100*e}%, 0, 0) scale(${0===e?.9:1})`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=Ah&&this.slider.isEnd?Ah:e<=-.05&&this.slider.isBeginning?-.05:e:e}}const Lh=.05;class Rh extends Th{constructor(){super(...arguments),Object.defineProperty(this,"shift",{enumerable:!0,configurable:!0,writable:!0,value:0})}init(){}transform(e){const t=this.slider.leftElement,r=this.slider.rightElement,i=this.slider.frontElement;e=this.dirFactor*e,null==t||t.style.setProperty("transform",`translate3d(${-100*(1+e)}%, 0, 0)`),null==r||r.style.setProperty("transform",`translate3d(${100*(1-e)}%, 0, 0)`),null==i||i.style.setProperty("transform",`translate3d(${-100*e}%, 0, 0)`)}startMove(){this.shift=0}move(e){this.shift=this.dirFactor*e/this.slider.clientWidth,this.shift=this.applyBoundsConstraint(this.shift),this.transform(this.shift)}endMove(){if(!this.shift)return;const e=Math.round(this.shift);this.slider.emit("touchEnd",e)}getCSSStyle(e,t){return{visibility:Math.abs(e-t)<=1?"visible":"hidden",transition:"inherit",transform:`translate3d(${this.dirFactor*(-100*t+100*e)}%, 0, 0)`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=Lh&&this.slider.isEnd?Lh:e<=-.05&&this.slider.isBeginning?-.05:e:e}}class Bh extends Th{constructor(){super(...arguments),Object.defineProperty(this,"newAngle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"angleDelta",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"normalizedShift",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"movementStartAt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_currentAngle",{enumerable:!0,configurable:!0,writable:!0,value:0})}get perspective(){return this.slider.clientWidth*jh}get depth(){return this.slider.clientWidth/Eh}init(){this.transform(this.slider.currentIndex)}destroy(){this.slider.setTransform("")}async transform(e){this._currentAngle=this._currentAngle+45*e*this.dirFactor,this.slider.setTransform(`rotateY(${-this._currentAngle}deg)`)}startMove(){this.newAngle=0,this.angleDelta=0,this.normalizedShift=0,this.movementStartAt=Date.now()}move(e){this.normalizedShift=e/this.slider.clientWidth*jh,this.newAngle=this._currentAngle+45*this.normalizedShift,this.angleDelta=this.newAngle-this._currentAngle,this.newAngle=this.applyBoundsConstraint(this.angleDelta),this.slider.setTransform(`rotateY(${-this.newAngle}deg)`)}endMove(){if(!this.normalizedShift)return;let e=Math.round(this.dirFactor*this.angleDelta/45);e=this.limitByFastMovement(e),e=this.limitBySliderEdges(e),this.slider.emit("touchEnd",e)}limitByFastMovement(e){return this.isFastMovement(e)?this.normalizedShift*this.dirFactor<0?-1:1:e}isFastMovement(e){return Date.now()-this.movementStartAt<=500&&0===e}limitBySliderEdges(e){return e<0&&this.slider.isBeginning||e>0&&this.slider.isEnd?0:e}getCSSStyle(e,t){const r=this.dirFactor;return{visibility:Math.abs(e-t)<=1?"visible":"hidden",transition:"",transform:`rotateY(${45*e*r}deg) translateZ(${this.depth}px)`}}applyBoundsConstraint(e){if(!this.slider.isBeginning&&!this.slider.isEnd)return this.newAngle;const t=this.dirFactor;return e*t>=5&&this.slider.isEnd?this._currentAngle+5*t:e*t<=-5&&this.slider.isBeginning?this._currentAngle-5*t:this.newAngle}}class Dh{static create(e,t){switch(t){case Tt.FLAT:return new Rh(e);case Tt.COVER:return new Mh(e);case Tt.CUBE:return new Bh(e);default:return new Rh(e)}}}var Nh=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Fh=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Uh=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Gh=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};let Vh=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,h,u,p,g,f,m,y,v,b,w,S=P.EventEmitter,_=[],O=[],x=[],k=[],C=[],j=[],E=[];return e=class extends S{constructor(){super(...arguments),t.set(this,(Nh(this,_),Nh(this,O,!1))),r.set(this,(Nh(this,x),Nh(this,k,0))),i.set(this,(Nh(this,C),Nh(this,j,null))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:Nh(this,E)}),Object.defineProperty(this,"_dir",{enumerable:!0,configurable:!0,writable:!0,value:Nt.LTR})}get _animating(){return Uh(this,t,"f")}set _animating(e){Gh(this,t,e,"f")}get _currentIndex(){return Uh(this,r,"f")}set _currentIndex(e){Gh(this,r,e,"f")}get effect(){return Uh(this,i,"f")}set effect(e){Gh(this,i,e,"f")}get dir(){return this._dir}get isLtr(){return this._dir===Nt.LTR}get clientWidth(){return this.$el.clientWidth}get animating(){return this._animating}get leftElement(){const e=this.dir===Nt.RTL?1:-1;return this.$el.children.item(this._currentIndex+e)}get rightElement(){const e=this.dir===Nt.RTL?-1:1;return this.$el.children.item(this._currentIndex+e)}get frontElement(){return this.$el.children.item(this._currentIndex)}get isBeginning(){return this._currentIndex-1==0}get isEnd(){return this._currentIndex+1===this.$el.children.length-1}get perspective(){var e,t;return null!==(t=null===(e=this.effect)||void 0===e?void 0:e.perspective)&&void 0!==t?t:0}get depth(){var e,t;return null!==(t=null===(e=this.effect)||void 0===e?void 0:e.depth)&&void 0!==t?t:0}get currentIndex(){return this._currentIndex}set currentIndex(e){this._currentIndex=e}getCSSStyle(e,t){var r,i;return null!==(i=null===(r=this.effect)||void 0===r?void 0:r.getCSSStyle(e,t))&&void 0!==i?i:{}}init({$el:e,transformStyle:t}){this.$el=e,this.effect&&this.effect.destroy(),this.effect=Dh.create(this,t),this.effect.init(),this.setTransition("transform 0s"),this.updateSlidesStyle(0)}async transformWithAmimation(e){this.emit("transitionStart"),this._animating=!0,this.setTransition(`transform ${Ih}s ${Ph}`),this.effect.transform(e),await this.waitTransitionEnd(),this.updateSlidesStyle(e),this._animating=!1,this.emit("transitionEnd")}startMove(){this.effect.startMove()}move(e){this._animating=!0,this.emit("touchMove"),this.effect.move(e)}endMove(){this._animating=!1,this.effect.endMove()}setTransform(e){this.$el.style.setProperty("transform",e)}setDir(e){this._dir=e}updateSlidesStyle(e){const t=Array.from(this.$el.children);for(let r=0;r<t.length;r++){const i=t[r],s=this.effect.getCSSStyle(r,this.currentIndex+e);i.style.visibility=s.visibility,i.style.transform=s.transform,i.style.transition=s.transition}}setTransition(e){this.$el.style.setProperty("transition",e)}waitTransitionEnd(){return new Promise(e=>{const t=r=>{Math.round(100*r.elapsedTime)/100===Ih&&"transform"===r.propertyName&&(this.setTransition("transform 0s"),this.$el.removeEventListener("transitionend",t),e())};this.$el.addEventListener("transitionend",t)})}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=S[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[N.observable],a=[N.observable],o=[N.observable],n=[N.computed],l=[N.computed],c=[N.computed],d=[N.computed],h=[N.computed],u=[N.computed],p=[N.computed],g=[N.computed],f=[N.computed],m=[N.action],y=[N.action],v=[N.action],b=[N.action],w=[N.action],Fh(e,null,s,{kind:"accessor",name:"_animating",static:!1,private:!1,access:{has:e=>"_animating"in e,get:e=>e._animating,set:(e,t)=>{e._animating=t}},metadata:r},O,x),Fh(e,null,a,{kind:"accessor",name:"_currentIndex",static:!1,private:!1,access:{has:e=>"_currentIndex"in e,get:e=>e._currentIndex,set:(e,t)=>{e._currentIndex=t}},metadata:r},k,C),Fh(e,null,o,{kind:"accessor",name:"effect",static:!1,private:!1,access:{has:e=>"effect"in e,get:e=>e.effect,set:(e,t)=>{e.effect=t}},metadata:r},j,E),Fh(e,null,n,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,_),Fh(e,null,l,{kind:"getter",name:"leftElement",static:!1,private:!1,access:{has:e=>"leftElement"in e,get:e=>e.leftElement},metadata:r},null,_),Fh(e,null,c,{kind:"getter",name:"rightElement",static:!1,private:!1,access:{has:e=>"rightElement"in e,get:e=>e.rightElement},metadata:r},null,_),Fh(e,null,d,{kind:"getter",name:"frontElement",static:!1,private:!1,access:{has:e=>"frontElement"in e,get:e=>e.frontElement},metadata:r},null,_),Fh(e,null,h,{kind:"getter",name:"isBeginning",static:!1,private:!1,access:{has:e=>"isBeginning"in e,get:e=>e.isBeginning},metadata:r},null,_),Fh(e,null,u,{kind:"getter",name:"isEnd",static:!1,private:!1,access:{has:e=>"isEnd"in e,get:e=>e.isEnd},metadata:r},null,_),Fh(e,null,p,{kind:"getter",name:"perspective",static:!1,private:!1,access:{has:e=>"perspective"in e,get:e=>e.perspective},metadata:r},null,_),Fh(e,null,g,{kind:"getter",name:"depth",static:!1,private:!1,access:{has:e=>"depth"in e,get:e=>e.depth},metadata:r},null,_),Fh(e,null,f,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,_),Fh(e,null,m,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:r},null,_),Fh(e,null,y,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,_),Fh(e,null,v,{kind:"method",name:"transformWithAmimation",static:!1,private:!1,access:{has:e=>"transformWithAmimation"in e,get:e=>e.transformWithAmimation},metadata:r},null,_),Fh(e,null,b,{kind:"method",name:"move",static:!1,private:!1,access:{has:e=>"move"in e,get:e=>e.move},metadata:r},null,_),Fh(e,null,w,{kind:"method",name:"endMove",static:!1,private:!1,access:{has:e=>"endMove"in e,get:e=>e.endMove},metadata:r},null,_),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class zh{constructor(e,t){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t})}get animating(){return this.slider.animating}async transitionByIndex(e,t){const r=e-t;return this.slider.transformWithAmimation(r)}}const Wh=e=>{const t=(0,_l.useRef)(null),[r]=(0,_l.useState)(()=>new Vh),{storyReaderOptions:i}=vp();(({slider:e,touchController:t})=>{const r=()=>{e.startMove()},i=({dx:t})=>{e.move(-t)},s=()=>{t.horizontalSwipeGesture&&e.endMove()};(0,_l.useEffect)(()=>(t.on(Gt.TouchStart,r),t.on(Gt.TouchMoveHorizontal,i),t.on(Gt.TouchEnd,s),()=>{t.off(Gt.TouchStart,r),t.off(Gt.TouchMoveHorizontal,i),t.off(Gt.TouchEnd,s)}),[e,t])})({slider:r,touchController:e.touchController});const s=i.scrollStyle;r.currentIndex=e.activeStoryIndex+1;const a=e.touchController;(0,_l.useLayoutEffect)(()=>{const i=()=>{r.setDir(e.dir),r.init({$el:t.current,transformStyle:s})};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[r,e.stories,s,e.dir]),(0,_l.useLayoutEffect)(()=>{e.setAnimatedNavigationController(new zh(r,{closeOnLastSlideByTimer:Boolean(i.closeOnLastSlideByTimer)}))},[r,e,i.closeOnLastSlideByTimer]),(0,_l.useEffect)(()=>(r.on("transitionStart",n),r.on("transitionEnd",l),r.on("touchMove",o),r.on("touchEnd",c),()=>{r.off("transitionStart",n),r.off("transitionEnd",l),r.off("touchMove",o),r.off("touchEnd",c)}),[r,e]);const o=()=>{a.disable()},n=()=>{a.disable()},l=()=>{a.enable()},c=t=>{var i;if(null===(i=e.activeStory)||void 0===i||i.resumeSystem(a),0===t)r.transformWithAmimation(0);else{t=Math.sign(t)*Math.min(Math.abs(t),1),e.navigateStoryWithAnimationByIndex(e.activeStoryIndex+t)}};return{ref:t,api:r,perspective:r.perspective,depth:r.depth}};var $h=_(3476),Hh={};Hh.styleTagTransform=Wl(),Hh.setAttributes=Ul(),Hh.insert=Nl().bind(null,"head"),Hh.domAPI=Bl(),Hh.insertStyleElement=Vl();Ll()($h.Ay,Hh);$h.Ay&&$h.Ay.locals&&$h.Ay.locals;var qh=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Jh=e=>{var{width:t,disabledByUI:r,navigationOptions:i}=e,s=qh(e,["width","disabledByUI","navigationOptions"]);const a=s.dir===Nt.LTR,o=(a?s.reachEnd:s.reachStart)||r,n=(a?s.reachStart:s.reachEnd)||r;return(0,Sl.jsxs)("div",{className:Al()([$h.uT],{[$h.Lb]:ye}),children:[(0,Sl.jsx)("div",{className:$h.eS,style:{transform:`translateY(-50%) translateX(calc(${t/2}px + 100%))`},children:(0,Sl.jsx)("button",{className:$h.YE,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onNext()},disabled:o,dangerouslySetInnerHTML:{__html:i.nextButton.svgSrc.baseState}})}),(0,Sl.jsx)("div",{className:$h.SG,style:{transform:`translateY(-50%) translateX(calc(-${t/2}px - 200%))`},children:(0,Sl.jsx)("button",{className:$h.YE,onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onPrev()},disabled:n,dangerouslySetInnerHTML:{__html:i.prevButton.svgSrc.baseState}})})]})},Kh=(0,jc.observer)(e=>{const{storyReaderOptions:t}=vp(),r=Wh(e.storyReader),i=e.storyReader.targetTransitionStory||e.storyReader.activeStory,s=e.storyReader.stories,a=e.isDesktopGeometry||e.safeAreaFrameCalculator.shouldBeShownSafeAreaInsets?parseFloat(String(t.borderRadius)):0,o=i.pauseState.isUIPaused||r.api.animating,n=t.layout===At.Modern,l=(t,r=2)=>{const i=-1===e.storyReader.targetTransitionIndex?e.storyReader.activeStoryIndex:e.storyReader.targetTransitionIndex,s=Math.max(i-r,0),a=Math.min(i+r,e.storyReader.stories.length-1);return t>=s&&t<=a},c=t=>e.storyReader.activeStoryIndex===t;return(0,Sl.jsxs)(Sl.Fragment,{children:[(0,Sl.jsx)("div",{className:Al()(Oh.fo,{[Oh.GQ]:e.storyReader.closeGestureInAction,[Oh.yU]:e.isDesktopGeometry}),style:Object.assign({WebkitPerspective:`${r.perspective}px`,perspective:`${r.perspective}px`,width:e.storyGeometry.getWidth(),backgroundColor:!e.isDesktopGeometry&&e.safeAreaFrameCalculator.shouldBeShownSafeAreaInsets&&"#000","--slide-border-radius":`${a}px`},e.correctionPaddingStyle),children:(0,Sl.jsx)("div",{className:Oh.$X,style:{transform:`translateZ(-${r.depth}px)`},children:(0,Sl.jsxs)("div",{className:Al()(Oh.N1),ref:r.ref,children:[(0,Sl.jsx)("div",{className:Al()(Oh.uY),children:(0,Sl.jsx)(kh,{})}),s.map((t,r)=>(0,Sl.jsx)("div",{className:Al()(Oh.uY),children:(0,Sl.jsx)(hh,{slideClickDisabled:o,index:r,story:t,activeStory:i,geometry:e.storyGeometry,onClose:e.onCloseStory,canBeInited:l(r),canBeStarted:c(r)})},t.id)),(0,Sl.jsx)("div",{className:Al()(Oh.uY),children:(0,Sl.jsx)(kh,{})})]})})}),!n&&(0,Sl.jsx)(Jh,{dir:e.storyReader.dir,disabledByUI:i.pauseState.isUIPaused,disabled:o,reachEnd:e.storyReader.reachEnd,reachStart:e.storyReader.reachStart,navigationOptions:t.navigation,width:e.storyGeometry.calculateWidth(),onNext:()=>e.storyReader.goNext(),onPrev:()=>e.storyReader.goPrev()})]})}),Zh=(0,jc.observer)(({storyReader:e})=>{const{storyReaderOptions:t}=vp(),r=Tc();(({touchController:e,activeStory:t})=>{(0,_l.useEffect)(()=>(e.on(Gt.LongTouchDetected,r),e.on(Gt.TouchEnd,i),()=>{e.off(Gt.LongTouchDetected,r),e.off(Gt.TouchEnd,i)}),[e,t]);const r=()=>{null==t||t.pauseSystem(e)},i=()=>{e.isSwiping||null==t||t.resumeSystem(e)}})({touchController:e.touchController,activeStory:e.activeStory});const{safeAreaFrameCalculator:i,storyGeometry:s,isDesktopGeometry:a,correctionPaddingStyle:o}=((e,t)=>{const{storyReaderOptions:r}=vp();return(0,_l.useMemo)(()=>{var r;const i=new Hi(e.vw,e.vh),s=i.getViewportCorrectionPadding(),a=new $i(e,{vw:e.vw,vh:e.vh-(Ac+Mc)},null!==(r=null==t?void 0:t.actionPanel.height)&&void 0!==r?r:0,i).create(),o=a instanceof zi;return{safeAreaFrameCalculator:i,storyGeometry:a,isDesktopGeometry:o,correctionPaddingStyle:o?{}:{paddingTop:s.top+"px",paddingBottom:s.bottom+"px"}}},[r.actionPanelBottomOffset,e,t])})(r,e.activeStory),n=t.layout===At.Modern;return(0,_l.useEffect)(()=>{e.useModernLayout=n},[e,n]),(0,Ec.createPortal)((0,Sl.jsxs)(zc,{isDesktopGeometry:a,viewport:r,storyReader:e,children:[a&&n?(0,Sl.jsx)(_h,{storyGeometry:s,storyReader:e,onCloseStory:()=>{e.close()}}):(0,Sl.jsx)(Kh,{isDesktopGeometry:a,storyGeometry:s,safeAreaFrameCalculator:i,correctionPaddingStyle:o,storyReader:e,onCloseStory:()=>{e.close()}}),(0,Sl.jsx)(sc,{orientation:ne.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.activeStory&&(t?e.activeStory.pauseUI(e):e.activeStory.resumeUI(e))}})]}),document.body)});var Qh=_(7161),Yh=_(429),Xh=_(318);class eu{constructor(e){Object.defineProperty(this,"host",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_vw",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_vh",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.host.addController(this),this.calculateViewport=this.calculateViewport.bind(this)}get vw(){return this._vw}get vh(){return this._vh}hostConnected(){window.addEventListener("resize",this.calculateViewport)}hostDisconnected(){window.removeEventListener("resize",this.calculateViewport),this.host.removeController(this)}calculateViewport(){this._vw=window.innerWidth,this._vh=window.innerHeight,this.host.requestUpdate()}}var tu=_(2083);const ru={[La.BottomSheet]:tu.literal`iam-bottom-sheet`,[La.Fullscreen]:tu.literal`iam-fullscreen-modal`,[La.Modal]:tu.literal`iam-modal`,[La.Toast]:tu.literal`iam-toast`},iu=Qh.css`.bottom-sheet{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:999}.bottom-sheet__backdrop{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:-1;background-color:rgba(0,0,0,var(--backdrop-opacity,.5));opacity:0;transition:opacity 225ms cubic-bezier(.4,0,.2,1);pointer-events:none}.bottom-sheet__backdrop--visible{animation:fade-in .3s forwards}.bottom-sheet__backdrop--hidden{animation:fade-out .3s forwards}.bottom-sheet__box{position:absolute;left:0;right:0;bottom:0;will-change:transform;border-top-left-radius:var(--slide-border-top-left-radius,0);border-top-right-radius:var(--slide-border-top-right-radius,0);background-color:transparent;transition:opacity .3s ease,transform .3s ease;transform:translate3d(0,120%,0);pointer-events:all;overflow:hidden}.bottom-sheet__box-wrapper{position:absolute;inset:0;pointer-events:none}.bottom-sheet__box-wrapper.bottom-sheet__box-wrapper--desktop-mode{position:absolute;bottom:0;left:50%;transform:translate3d(-50%,0,0)}.bottom-sheet__box.bottom-sheet__box--open{opacity:1;transform:translate3d(0,0,0)}.bottom-sheet__backdrop.bottom-sheet__backdrop--open{opacity:1;pointer-events:all}.bottom-sheet__header .grab-handler-area{position:absolute;left:50%;transform:translate3d(-50%,0,0);padding:0 32px 16px;z-index:10000;cursor:grab;user-select:none}.bottom-sheet__header .grab-handler{margin-top:8px;width:32px;height:4px;background-color:#00000080;border-radius:var(--grab-handler-border-radius)}`;var su=_(5125);class au{constructor(e){Object.defineProperty(this,"host",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.host.addController(this),this.handleTouchMoveVertical=this.handleTouchMoveVertical.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}hostConnected(){}hostDisconnected(){var e,t,r;null===(e=this.touchController)||void 0===e||e.off(Gt.TouchMoveVertical,this.handleTouchMoveVertical),null===(t=this.touchController)||void 0===t||t.off(Gt.TouchEnd,this.handleTouchEnd),null===(r=this.touchController)||void 0===r||r.disable()}setTouchController(e){this.touchController=e,this.touchController.forceEnable(),this.touchController.on(Gt.TouchMoveVertical,this.handleTouchMoveVertical),this.touchController.on(Gt.TouchEnd,this.handleTouchEnd)}handleTouchMoveVertical({dy:e}){const t=this.getTranslateYByDeltaY(e);this.disableBoxTransition(),this.translateBoxOnY(t)}handleTouchEnd({dy:e}){if(!this.touchController.isSwiping)return;this.enableBoxTransition();this.getTranslateYByDeltaY(e)>20&&!this.host.disableClose?(this.touchController.disable(),this.translateBoxOnY(120),this.host.close()):this.resetToDefaultState()}resetToDefaultState(){this.host.bottomSheetBoxRef.style.transform=""}translateBoxOnY(e){this.host.bottomSheetBoxRef.style.transform=`translate3d(0, ${e}%, 0)`}disableBoxTransition(){this.host.bottomSheetBoxRef.style.transition="none"}enableBoxTransition(){this.host.bottomSheetBoxRef.style.transition="opacity 0.3s ease, transform 0.3s ease"}getTranslateYByDeltaY(e){let t=50*(e/this.host.bottomSheetBoxRef.clientHeight);return t<=0&&(t=0),t}}var ou=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},nu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},lu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},cu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},du=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n,l,c,d,h;let u,p,g,f,m,y,v,b,w,S,_,O,x,k,C=[V("iam-bottom-sheet")],P=[],j=Qh.LitElement,E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[],G=[],z=[],W=[],$=[],H=[],q=[],J=[],K=[],Z=[],Q=[],Y=[],X=[];p=class extends j{get open(){return cu(this,e,"f")}set open(t){du(this,e,t,"f")}get disableClose(){return cu(this,t,"f")}set disableClose(e){du(this,t,e,"f")}get geometry(){return cu(this,r,"f")}set geometry(e){du(this,r,e,"f")}get appearanceOptions(){return cu(this,i,"f")}set appearanceOptions(e){du(this,i,e,"f")}get touchController(){return cu(this,s,"f")}set touchController(e){du(this,s,e,"f")}get desktopMode(){return cu(this,a,"f")}set desktopMode(e){du(this,a,e,"f")}get isVisible(){return cu(this,o,"f")}set isVisible(e){du(this,o,e,"f")}get isClosed(){return cu(this,n,"f")}set isClosed(e){du(this,n,e,"f")}get backdropRef(){return cu(this,l,"f")}set backdropRef(e){du(this,l,e,"f")}get bottomSheetBoxRef(){return cu(this,c,"f")}set bottomSheetBoxRef(e){du(this,c,e,"f")}get bottomSheetRef(){return cu(this,d,"f")}set bottomSheetRef(e){du(this,d,e,"f")}get grabHandlerAreaRef(){return cu(this,h,"f")}set grabHandlerAreaRef(e){du(this,h,e,"f")}constructor(){super(),e.set(this,nu(this,E,!1)),t.set(this,(nu(this,I),nu(this,T,!1))),r.set(this,(nu(this,A),nu(this,M,void 0))),i.set(this,(nu(this,L),nu(this,R,void 0))),s.set(this,(nu(this,B),nu(this,D,void 0))),a.set(this,(nu(this,N),nu(this,F,void 0))),o.set(this,(nu(this,U),nu(this,G,!1))),n.set(this,(nu(this,z),nu(this,W,!0))),l.set(this,(nu(this,$),nu(this,H,null))),c.set(this,(nu(this,q),nu(this,J,null))),d.set(this,(nu(this,K),nu(this,Z,null))),h.set(this,(nu(this,Q),nu(this,Y,null))),Object.defineProperty(this,"bottomSheetSwipeController",{enumerable:!0,configurable:!0,writable:!0,value:(nu(this,X),new au(this))}),this.handleTransitionEnd=this.handleTransitionEnd.bind(this)}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,(({frames:e=3,timeout:t=100,checkStyle:r=()=>!0}={})=>new Promise(i=>{let s,a=0,o=!1;const n=()=>{a++,!o&&r()&&(o=!0),a>=e&&o?(clearTimeout(s),i()):requestAnimationFrame(n)};s=setTimeout(()=>i(),t),requestAnimationFrame(n)}))().then(()=>{this.isVisible=!0})):this.isClosed||this.close()}connectedCallback(){super.connectedCallback(),setTimeout(()=>{const e=this.grabHandlerAreaRef,t=e&&!this.disableClose;ye&&t&&this.touchController.setGrabHandler(e),ye&&!t||this.bottomSheetSwipeController.setTouchController(this.touchController)})}disconnectedCallback(){super.disconnectedCallback(),this.touchController.resetGrabHandler()}close(){this.disableClose||(this.backdropRef.addEventListener("transitionend",this.handleTransitionEnd),this.isVisible=!1)}handleTransitionEnd(){this.backdropRef.removeEventListener("transitionend",this.handleTransitionEnd),setTimeout(()=>{this.isClosed=!0,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))},50)}render(){var e;if(this.isClosed)return Qh.nothing;const t={background:this.appearanceOptions.background,height:this.geometry.getHeight()+"px",width:this.geometry.getWidth()+"px","--slide-border-top-left-radius":`${this.appearanceOptions.borderRadius}px`,"--slide-border-top-right-radius":`${this.appearanceOptions.borderRadius}px`,"--grab-handler-border-radius":this.appearanceOptions.closeButton.width/2+"px"},r={width:this.geometry.getWidth()+"px"},i={backgroundColor:this.appearanceOptions.closeButton.backgroundColor,width:`${this.appearanceOptions.closeButton.width}px`,height:`${this.appearanceOptions.closeButton.height}px`,marginTop:`${this.appearanceOptions.closeButton.marginTop}px`},s={zIndex:null!==(e=this.appearanceOptions.zIndex)&&void 0!==e?e:999};return Qh.html`<div id="bottom-sheet" class="bottom-sheet" style="${(0,Xh.styleMap)(s)}"><div id="bottom-sheet__backdrop" style="${(0,Xh.styleMap)({"--backdrop-opacity":this.appearanceOptions.backdrop.opacity})}" @click="${this.close}" class="bottom-sheet__backdrop ${(0,su.classMap)({"bottom-sheet__backdrop--open":this.isVisible})}"></div><div class="bottom-sheet__box-wrapper ${(0,su.classMap)({"bottom-sheet__box-wrapper--desktop-mode":this.desktopMode})}" style="${(0,Xh.styleMap)(r)}"><div style="${(0,Xh.styleMap)(t)}" id="bottom-sheet__box" class="bottom-sheet__box ${(0,su.classMap)({"bottom-sheet__box--open":this.isVisible})}"><div class="bottom-sheet__header">${this.disableClose?Qh.nothing:Qh.html`<div id="grab-handler-area" class="grab-handler-area"><div class="grab-handler" style="${(0,Xh.styleMap)(i)}"></div></div>`}</div><slot></slot></div></div></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,lu(p,"BottomSheet"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=j[Symbol.metadata])&&void 0!==e?e:null):void 0;g=[(0,Yh.property)({type:Boolean})],f=[(0,Yh.property)({type:Boolean})],m=[(0,Yh.property)({type:Object})],y=[(0,Yh.property)({type:Object})],v=[(0,Yh.property)({type:Object})],b=[(0,Yh.property)({type:Boolean})],w=[(0,Yh.state)()],S=[(0,Yh.state)()],_=[(0,Yh.query)("#bottom-sheet__backdrop")],O=[(0,Yh.query)("#bottom-sheet__box")],x=[(0,Yh.query)("#bottom-sheet")],k=[(0,Yh.query)("#grab-handler-area")],ou(p,null,g,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},E,I),ou(p,null,f,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},T,A),ou(p,null,m,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},M,L),ou(p,null,y,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},R,B),ou(p,null,v,{kind:"accessor",name:"touchController",static:!1,private:!1,access:{has:e=>"touchController"in e,get:e=>e.touchController,set:(e,t)=>{e.touchController=t}},metadata:t},D,N),ou(p,null,b,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},F,U),ou(p,null,w,{kind:"accessor",name:"isVisible",static:!1,private:!1,access:{has:e=>"isVisible"in e,get:e=>e.isVisible,set:(e,t)=>{e.isVisible=t}},metadata:t},G,z),ou(p,null,S,{kind:"accessor",name:"isClosed",static:!1,private:!1,access:{has:e=>"isClosed"in e,get:e=>e.isClosed,set:(e,t)=>{e.isClosed=t}},metadata:t},W,$),ou(p,null,_,{kind:"accessor",name:"backdropRef",static:!1,private:!1,access:{has:e=>"backdropRef"in e,get:e=>e.backdropRef,set:(e,t)=>{e.backdropRef=t}},metadata:t},H,q),ou(p,null,O,{kind:"accessor",name:"bottomSheetBoxRef",static:!1,private:!1,access:{has:e=>"bottomSheetBoxRef"in e,get:e=>e.bottomSheetBoxRef,set:(e,t)=>{e.bottomSheetBoxRef=t}},metadata:t},J,K),ou(p,null,x,{kind:"accessor",name:"bottomSheetRef",static:!1,private:!1,access:{has:e=>"bottomSheetRef"in e,get:e=>e.bottomSheetRef,set:(e,t)=>{e.bottomSheetRef=t}},metadata:t},Z,Q),ou(p,null,k,{kind:"accessor",name:"grabHandlerAreaRef",static:!1,private:!1,access:{has:e=>"grabHandlerAreaRef"in e,get:e=>e.grabHandlerAreaRef,set:(e,t)=>{e.grabHandlerAreaRef=t}},metadata:t},Y,X),ou(null,u={value:p},C,{kind:"class",name:p.name,metadata:t},null,P),p=u.value,t&&Object.defineProperty(p,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(p,"styles",{enumerable:!0,configurable:!0,writable:!0,value:iu}),nu(p,P)})();const hu=Qh.css`.modal{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:1000}.modal__backdrop{background-color:rgba(0,0,0,var(--backdrop-opacity,.3));position:fixed;z-index:-1;inset:0;left:0;bottom:0;right:0;pointer-events:none}.modal__backdrop.modal__backdrop--open{pointer-events:all}.modal__box{display:flex;align-items:center;justify-content:center;position:relative;outline:0;height:100%}.modal__box-content{position:relative;border-top-left-radius:var(--slide-border-top-left-radius,0);border-top-right-radius:var(--slide-border-top-right-radius,0);border-bottom-left-radius:var(--slide-border-bottom-left-radius,0);border-bottom-right-radius:var(--slide-border-bottom-right-radius,0);overflow:hidden}.modal__box-content.modal__box-content--fullscreen{position:relative;align-self:flex-end}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes fadeInWithZoom{from{opacity:0;transform:scale(.7)}to{transform:scale(1);opacity:1}}@keyframes fadeOutWithZoom{from{opacity:1;transform:scale(1)}to{transform:scale(.7);opacity:0}}@keyframes slideInUp{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInOut{from{transform:translateY(0)}to{transform:translateY(100%)}}.fadeIn{animation:fadeIn 255ms forwards}.fadeOut{animation:fadeOut 255ms forwards}.fadeInWithZoom{animation:fadeInWithZoom .3s forwards}.fadeOutWithZoom{animation:fadeOutWithZoom .3s forwards}.slideInUp{animation:slideInUp .3s forwards}.slideInOut{animation:slideInOut .3s forwards}`;var uu=_(6968);const pu=Qh.css`.close-btn{position:absolute;top:1rem;z-index:10000;padding:0;background-color:transparent;border:0;-webkit-appearance:none;cursor:pointer}.close-btn.close-btn--position_start{left:1rem}.close-btn.close-btn--position_end{right:1rem}.close-btn.close-btn--position_start.close-btn--dir_rtl{left:auto;right:1rem}.close-btn.close-btn--position_end.close-btn--dir_rtl{left:1rem;right:auto}.close-btn.close-btn--position_none{display:none}`;var gu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},fu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},mu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},yu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},vu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t;let r,i,s,a,o=[V("iam-modal-close-btn")],n=[],l=Qh.LitElement,c=[],d=[],h=[],u=[];i=class extends l{get closeBtnPosition(){return yu(this,e,"f")}set closeBtnPosition(t){vu(this,e,t,"f")}get dir(){return yu(this,t,"f")}set dir(e){vu(this,t,e,"f")}render(){var e;return Qh.html`<button class="close-btn ${(0,su.classMap)({"close-btn--position_start":this.closeBtnPosition===wa.Start,"close-btn--position_end":this.closeBtnPosition===wa.End,"close-btn--position_none":this.closeBtnPosition===wa.None,"close-btn--dir_ltr":this.dir===Nt.LTR,"close-btn--dir_rtl":this.dir===Nt.RTL})}">${(0,uu.unsafeHTML)(null===(e=_t.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>`}constructor(){super(...arguments),e.set(this,fu(this,c,void 0)),t.set(this,(fu(this,d),fu(this,h,void 0))),fu(this,u)}};e=new WeakMap,t=new WeakMap,mu(i,"Modal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=l[Symbol.metadata])&&void 0!==e?e:null):void 0;s=[(0,Yh.property)({type:Number})],a=[(0,Yh.property)({type:String})],gu(i,null,s,{kind:"accessor",name:"closeBtnPosition",static:!1,private:!1,access:{has:e=>"closeBtnPosition"in e,get:e=>e.closeBtnPosition,set:(e,t)=>{e.closeBtnPosition=t}},metadata:t},c,d),gu(i,null,a,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},h,u),gu(null,r={value:i},o,{kind:"class",name:i.name,metadata:t},null,n),i=r.value,t&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(i,"styles",{enumerable:!0,configurable:!0,writable:!0,value:pu}),fu(i,n)})();var bu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},wu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Su=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},_u=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Ou=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n,l;let c,d,h,u,p,g,f,m,y,v,b,w=[V("iam-modal")],S=[],_=Qh.LitElement,O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[];d=class extends _{get open(){return _u(this,e,"f")}set open(t){Ou(this,e,t,"f")}get disableClose(){return _u(this,t,"f")}set disableClose(e){Ou(this,t,e,"f")}get fullscreen(){return _u(this,r,"f")}set fullscreen(e){Ou(this,r,e,"f")}get geometry(){return _u(this,i,"f")}set geometry(e){Ou(this,i,e,"f")}get appearanceOptions(){return _u(this,s,"f")}set appearanceOptions(e){Ou(this,s,e,"f")}get dir(){return _u(this,a,"f")}set dir(e){Ou(this,a,e,"f")}get isVisible(){return _u(this,o,"f")}set isVisible(e){Ou(this,o,e,"f")}get isClosed(){return _u(this,n,"f")}set isClosed(e){Ou(this,n,e,"f")}get backdropRef(){return _u(this,l,"f")}set backdropRef(e){Ou(this,l,e,"f")}constructor(){super(),e.set(this,wu(this,O,!1)),t.set(this,(wu(this,x),wu(this,k,!1))),r.set(this,(wu(this,C),wu(this,P,!1))),i.set(this,(wu(this,j),wu(this,E,void 0))),s.set(this,(wu(this,I),wu(this,T,void 0))),a.set(this,(wu(this,A),wu(this,M,void 0))),o.set(this,(wu(this,L),wu(this,R,!1))),n.set(this,(wu(this,B),wu(this,D,!0))),l.set(this,(wu(this,N),wu(this,F,null))),wu(this,U)}close(){if(this.disableClose)return;const e=this.appearanceOptions.animationType===ba.None?0:350;setTimeout(()=>{this.isClosed=!0,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))},e),this.isVisible=!1}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,this.isVisible=!0):this.isClosed||this.close()}getEnterModalAnimationCSSClass(e){switch(e){case ba.SlideInUp:return"slideInUp";case ba.FadeIn:return"fadeInWithZoom";default:return""}}getOutModalAnimationCSSClass(e){switch(e){case ba.SlideInUp:return"slideInOut";case ba.FadeIn:return"fadeOutWithZoom";default:return""}}getBackdropAnimationCSSClass(e){return e?"fadeIn":"fadeOut"}render(){var e;const t=this.fullscreen?0:this.appearanceOptions.borderRadius,r={background:this.appearanceOptions.background,height:this.geometry.getHeight()+"px",width:this.geometry.getWidth()+"px","--slide-border-top-left-radius":`${t}px`,"--slide-border-top-right-radius":`${t}px`,"--slide-border-bottom-left-radius":`${t}px`,"--slide-border-bottom-right-radius":`${t}px`},i=this.appearanceOptions.animationType,s=this.isVisible?this.getEnterModalAnimationCSSClass(i):this.getOutModalAnimationCSSClass(i),a=this.getBackdropAnimationCSSClass(this.isVisible),o={zIndex:null!==(e=this.appearanceOptions.zIndex)&&void 0!==e?e:1e3};return Qh.html`<div class="modal" style="${(0,Xh.styleMap)(o)}"><div id="modal__backdrop" style="${(0,Xh.styleMap)({"--backdrop-opacity":this.appearanceOptions instanceof ka?this.appearanceOptions.backdrop.opacity:void 0})}" class="modal__backdrop ${(0,su.classMap)({[a]:i!==ba.None})}"></div><div @click="${this.close}" class="modal__box ${(0,su.classMap)({[s]:!0})}">${this.fullscreen?Qh.html`<div class="modal__header"><iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn></div>`:Qh.nothing}<div style="${(0,Xh.styleMap)(r)}" class="modal__box-content ${(0,su.classMap)({"modal__box-content--fullscreen":this.fullscreen})}">${this.fullscreen?Qh.nothing:Qh.html`<div class="modal__header">${this.disableClose?Qh.nothing:Qh.html`<iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn>`}</div>`}<slot></slot></div></div></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,Su(d,"Modal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=_[Symbol.metadata])&&void 0!==e?e:null):void 0;h=[(0,Yh.property)({type:Boolean})],u=[(0,Yh.property)({type:Boolean})],p=[(0,Yh.property)({type:Boolean})],g=[(0,Yh.property)({type:Object})],f=[(0,Yh.property)({type:Object})],m=[(0,Yh.property)({type:String})],y=[(0,Yh.state)()],v=[(0,Yh.state)()],b=[(0,Yh.query)("#modal__backdrop")],bu(d,null,h,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},O,x),bu(d,null,u,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},k,C),bu(d,null,p,{kind:"accessor",name:"fullscreen",static:!1,private:!1,access:{has:e=>"fullscreen"in e,get:e=>e.fullscreen,set:(e,t)=>{e.fullscreen=t}},metadata:t},P,j),bu(d,null,g,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},E,I),bu(d,null,f,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},T,A),bu(d,null,m,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},M,L),bu(d,null,y,{kind:"accessor",name:"isVisible",static:!1,private:!1,access:{has:e=>"isVisible"in e,get:e=>e.isVisible,set:(e,t)=>{e.isVisible=t}},metadata:t},R,B),bu(d,null,v,{kind:"accessor",name:"isClosed",static:!1,private:!1,access:{has:e=>"isClosed"in e,get:e=>e.isClosed,set:(e,t)=>{e.isClosed=t}},metadata:t},D,N),bu(d,null,b,{kind:"accessor",name:"backdropRef",static:!1,private:!1,access:{has:e=>"backdropRef"in e,get:e=>e.backdropRef,set:(e,t)=>{e.backdropRef=t}},metadata:t},F,U),bu(null,c={value:d},w,{kind:"class",name:d.name,metadata:t},null,S),d=c.value,t&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(d,"styles",{enumerable:!0,configurable:!0,writable:!0,value:hu}),wu(d,S)})();var xu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ku=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Cu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Pu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},ju=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r;let i,s,a,o,n,l=[V("iam-fullscreen-modal")],c=[],d=Qh.LitElement,h=[],u=[],p=[],g=[],f=[],m=[];s=class extends d{get open(){return Pu(this,e,"f")}set open(t){ju(this,e,t,"f")}get geometry(){return Pu(this,t,"f")}set geometry(e){ju(this,t,e,"f")}get appearanceOptions(){return Pu(this,r,"f")}set appearanceOptions(e){ju(this,r,e,"f")}render(){return Qh.html`<iam-modal ?open="${this.open}" .fullscreen="${!0}" .geometry="${this.geometry}" .appearanceOptions="${this.appearanceOptions}"><slot></slot></iam-modal>`}constructor(){super(...arguments),e.set(this,ku(this,h,!1)),t.set(this,(ku(this,u),ku(this,p,void 0))),r.set(this,(ku(this,g),ku(this,f,void 0))),ku(this,m)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,Cu(s,"FullscreenModal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=d[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[(0,Yh.property)({type:Boolean})],o=[(0,Yh.property)({type:Object})],n=[(0,Yh.property)({type:Object})],xu(s,null,a,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},h,u),xu(s,null,o,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},p,g),xu(s,null,n,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},f,m),xu(null,i={value:s},l,{kind:"class",name:s.name,metadata:t},null,c),s=i.value,t&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t}),ku(s,c)})()})();const Eu=Qh.css`.toast{position:fixed;z-index:10000;pointer-events:all;opacity:0}.toast.toast--open{opacity:1}.toast.toast--dir-rtl{direction:rtl}.toast.toast--dir-ltr{direction:ltr}.toast--vertical-top{top:var(--toast-vertical-offset);bottom:auto}.toast--vertical-bottom{bottom:var(--toast-vertical-offset);top:auto}.toast.toast--widescreen.toast--horizontal-start{left:var(--toast-horizontal-offset);right:auto;width:var(--toast-width)}.toast.toast--widescreen.toast--horizontal-center{left:50%;width:var(--toast-width);transform:translate3d(-50%,0,0)}.toast.toast--widescreen.toast--horizontal-end{right:var(--toast-horizontal-offset);left:auto;width:var(--toast-width)}.toast:not(.toast--widescreen){left:var(--toast-horizontal-offset);right:var(--toast-horizontal-offset)}.toast__box{position:relative;width:var(--toast-width,320px);height:var(--toast-height,50px);background:var(--toast-background,#fff);border-radius:var(--toast-border-radius,16px);overflow:hidden;display:flex;align-items:center;justify-content:center}.toast__content{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.toast--animation-slide-in-from-bottom{animation:toastSlideInFromBottom .3s forwards}.toast--animation-slide-in-from-top{animation:toastSlideInFromTop .3s forwards}.toast--animation-slide-out-to-bottom{animation:toastSlideOutToBottom .3s forwards}.toast--animation-slide-out-to-top{animation:toastSlideOutToTop .3s forwards}.toast--animation-fade-in-zoom{animation:toastFadeInZoom .3s forwards}.toast--animation-fade-out-zoom{animation:toastFadeOutZoom .3s forwards}.toast--animation-slide-in-from-bottom.toast--horizontal-center{animation:toastSlideInFromBottomCenter .3s forwards}.toast--animation-slide-in-from-top.toast--horizontal-center{animation:toastSlideInFromTopCenter .3s forwards}.toast--animation-slide-out-to-bottom.toast--horizontal-center{animation:toastSlideOutToBottomCenter .3s forwards}.toast--animation-slide-out-to-top.toast--horizontal-center{animation:toastSlideOutToTopCenter .3s forwards}.toast--animation-fade-in-zoom.toast--horizontal-center{animation:toastFadeInZoomCenter .3s forwards}.toast--animation-fade-out-zoom.toast--horizontal-center{animation:toastFadeOutZoomCenter .3s forwards}@keyframes toastSlideInFromBottom{from{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:translate3d(0,0,0)}}@keyframes toastSlideOutToBottom{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(0,100%,0)}}@keyframes toastSlideInFromTop{from{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:translate3d(0,0,0)}}@keyframes toastSlideOutToTop{from{opacity:1;transform:translate3d(0,0,0)}to{opacity:0;transform:translate3d(0,-100%,0)}}@keyframes toastFadeInZoom{from{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}@keyframes toastFadeOutZoom{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.7)}}@keyframes toastSlideInFromBottomCenter{from{opacity:0;transform:translate3d(-50%,100%,0)}to{opacity:1;transform:translate3d(-50%,0,0)}}@keyframes toastSlideOutToBottomCenter{from{opacity:1;transform:translate3d(-50%,0,0)}to{opacity:0;transform:translate3d(-50%,100%,0)}}@keyframes toastSlideInFromTopCenter{from{opacity:0;transform:translate3d(-50%,-100%,0)}to{opacity:1;transform:translate3d(-50%,0,0)}}@keyframes toastSlideOutToTopCenter{from{opacity:1;transform:translate3d(-50%,0,0)}to{opacity:0;transform:translate3d(-50%,-100%,0)}}@keyframes toastFadeInZoomCenter{from{opacity:0;transform:translate3d(-50%,0,0) scale(.7)}to{opacity:1;transform:translate3d(-50%,0,0) scale(1)}}@keyframes toastFadeOutZoomCenter{from{opacity:1;transform:translate3d(-50%,0,0) scale(1)}to{opacity:0;transform:translate3d(-50%,0,0) scale(.7)}}`,Iu=Qh.css`.close-btn{position:absolute;top:.2rem;z-index:10000;padding:0;background-color:transparent;border:0;-webkit-appearance:none;cursor:pointer}.close-btn.close-btn--position_start{left:.2rem}.close-btn.close-btn--position_end{right:.2rem}.close-btn.close-btn--position_start.close-btn--dir_rtl{left:auto;right:.2rem}.close-btn.close-btn--position_end.close-btn--dir_rtl{left:.2rem;right:auto}.close-btn.close-btn--position_none{display:none}`;var Tu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Au=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Mu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Lu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Ru=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t;let r,i,s,a,o=[V("iam-toast-close-btn")],n=[],l=Qh.LitElement,c=[],d=[],h=[],u=[];i=class extends l{get closeBtnPosition(){return Lu(this,e,"f")}set closeBtnPosition(t){Ru(this,e,t,"f")}get dir(){return Lu(this,t,"f")}set dir(e){Ru(this,t,e,"f")}render(){var e;return Qh.html`<button class="close-btn ${(0,su.classMap)({"close-btn--position_start":this.closeBtnPosition===xa.Start,"close-btn--position_end":this.closeBtnPosition===xa.End,"close-btn--position_none":this.closeBtnPosition===xa.None,"close-btn--dir_ltr":this.dir===Nt.LTR,"close-btn--dir_rtl":this.dir===Nt.RTL})}">${(0,uu.unsafeHTML)(null===(e=_t.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>`}constructor(){super(...arguments),e.set(this,Au(this,c,void 0)),t.set(this,(Au(this,d),Au(this,h,void 0))),Au(this,u)}};e=new WeakMap,t=new WeakMap,Mu(i,"ToastCloseButton"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=l[Symbol.metadata])&&void 0!==e?e:null):void 0;s=[(0,Yh.property)({type:Number})],a=[(0,Yh.property)({type:String})],Tu(i,null,s,{kind:"accessor",name:"closeBtnPosition",static:!1,private:!1,access:{has:e=>"closeBtnPosition"in e,get:e=>e.closeBtnPosition,set:(e,t)=>{e.closeBtnPosition=t}},metadata:t},c,d),Tu(i,null,a,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},h,u),Tu(null,r={value:i},o,{kind:"class",name:i.name,metadata:t},null,n),i=r.value,t&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(i,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Iu}),Au(i,n)})();var Bu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Du=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Nu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Fu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Uu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n,l;let c,d,h,u,p,g,f,m,y,v,b,w=[V("iam-toast")],S=[],_=Qh.LitElement,O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[],D=[],N=[],F=[],U=[];d=class extends _{get open(){return Fu(this,e,"f")}set open(t){Uu(this,e,t,"f")}get disableClose(){return Fu(this,t,"f")}set disableClose(e){Uu(this,t,e,"f")}get geometry(){return Fu(this,r,"f")}set geometry(e){Uu(this,r,e,"f")}get appearanceOptions(){return Fu(this,i,"f")}set appearanceOptions(e){Uu(this,i,e,"f")}get desktopMode(){return Fu(this,s,"f")}set desktopMode(e){Uu(this,s,e,"f")}get dir(){return Fu(this,a,"f")}set dir(e){Uu(this,a,e,"f")}get isVisible(){return Fu(this,o,"f")}set isVisible(e){Uu(this,o,e,"f")}get isClosed(){return Fu(this,n,"f")}set isClosed(e){Uu(this,n,e,"f")}get toastRef(){return Fu(this,l,"f")}set toastRef(e){Uu(this,l,e,"f")}constructor(){super(),e.set(this,Du(this,O,!1)),t.set(this,(Du(this,x),Du(this,k,!1))),r.set(this,(Du(this,C),Du(this,P,void 0))),i.set(this,(Du(this,j),Du(this,E,void 0))),s.set(this,(Du(this,I),Du(this,T,void 0))),a.set(this,(Du(this,A),Du(this,M,void 0))),o.set(this,(Du(this,L),Du(this,R,!1))),n.set(this,(Du(this,B),Du(this,D,!0))),l.set(this,(Du(this,N),Du(this,F,null))),Du(this,U)}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,this.isVisible=!0):this.isClosed||this.close()}close(){if(this.disableClose)return;const e=this.appearanceOptions.animationType===Sa.None?0:300;this.isVisible=!1,setTimeout(()=>{this.isClosed=!0,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))},e)}shouldShowCloseButton(){return!this.disableClose&&this.appearanceOptions.closeBtnPosition!==xa.None}getAnimationClass(){if(!this.isVisible)switch(this.appearanceOptions.animationType){case Sa.TransitionFromNearestVerticalEdge:return this.getSlideOutAnimationClass();case Sa.AlphaAndZoom:return"toast--animation-fade-out-zoom";default:return""}switch(this.appearanceOptions.animationType){case Sa.TransitionFromNearestVerticalEdge:return this.getSlideInAnimationClass();case Sa.AlphaAndZoom:return"toast--animation-fade-in-zoom";default:return""}}getSlideInAnimationClass(){return this.appearanceOptions.verticalPosition===_a.Top?"toast--animation-slide-in-from-top":"toast--animation-slide-in-from-bottom"}getSlideOutAnimationClass(){return this.appearanceOptions.verticalPosition===_a.Top?"toast--animation-slide-out-to-top":"toast--animation-slide-out-to-bottom"}getVerticalPositionVars(){return{"--toast-vertical-offset":`${this.appearanceOptions.verticalOffset}px`}}getEffectiveHorizontalPosition(){const e=this.dir===Nt.RTL,t=this.appearanceOptions.horizontalPosition;return e?t===Oa.Start?Oa.End:t===Oa.End?Oa.Start:t:t}getWidescreenHorizontalVars(){return{"--toast-width":`${this.geometry.getWidth()}px`,"--toast-horizontal-offset":`${this.appearanceOptions.horizontalOffset}px`}}getMobileHorizontalVars(){return{"--toast-horizontal-offset":`${this.appearanceOptions.horizontalOffset}px`}}getPositionVars(){const e=this.getVerticalPositionVars(),t=this.desktopMode?this.getWidescreenHorizontalVars():this.getMobileHorizontalVars();return Object.assign(Object.assign({},e),t)}render(){if(this.isClosed)return Qh.nothing;const e=this.getPositionVars(),t=this.getAnimationClass(),r=this.getEffectiveHorizontalPosition(),i=Object.assign({"--toast-width":`${this.geometry.getWidth()}px`,"--toast-height":`${this.geometry.getHeight()}px`,"--toast-background":this.appearanceOptions.background,"--toast-border-radius":`${this.appearanceOptions.borderRadius}px`},e);return Qh.html`<div id="toast" class="toast ${(0,su.classMap)({"toast--open":this.isVisible,"toast--widescreen":this.desktopMode,"toast--dir-ltr":this.dir===Nt.LTR,"toast--dir-rtl":this.dir===Nt.RTL,"toast--vertical-top":this.appearanceOptions.verticalPosition===_a.Top,"toast--vertical-bottom":this.appearanceOptions.verticalPosition!==_a.Top,"toast--horizontal-start":this.desktopMode&&r===Oa.Start,"toast--horizontal-center":this.desktopMode&&r===Oa.Center,"toast--horizontal-end":this.desktopMode&&r===Oa.End,[t]:!0})}" style="${(0,Xh.styleMap)(i)}"><div class="toast__box">${this.shouldShowCloseButton()?Qh.html`<iam-toast-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-toast-close-btn>`:Qh.nothing}<div class="toast__content"><slot></slot></div></div></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,Nu(d,"Toast"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=_[Symbol.metadata])&&void 0!==e?e:null):void 0;h=[(0,Yh.property)({type:Boolean})],u=[(0,Yh.property)({type:Boolean})],p=[(0,Yh.property)({type:Object})],g=[(0,Yh.property)({type:Object})],f=[(0,Yh.property)({type:Boolean})],m=[(0,Yh.property)({type:String})],y=[(0,Yh.state)()],v=[(0,Yh.state)()],b=[(0,Yh.query)("#toast")],Bu(d,null,h,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},O,x),Bu(d,null,u,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},k,C),Bu(d,null,p,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},P,j),Bu(d,null,g,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},E,I),Bu(d,null,f,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},T,A),Bu(d,null,m,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},M,L),Bu(d,null,y,{kind:"accessor",name:"isVisible",static:!1,private:!1,access:{has:e=>"isVisible"in e,get:e=>e.isVisible,set:(e,t)=>{e.isVisible=t}},metadata:t},R,B),Bu(d,null,v,{kind:"accessor",name:"isClosed",static:!1,private:!1,access:{has:e=>"isClosed"in e,get:e=>e.isClosed,set:(e,t)=>{e.isClosed=t}},metadata:t},D,N),Bu(d,null,b,{kind:"accessor",name:"toastRef",static:!1,private:!1,access:{has:e=>"toastRef"in e,get:e=>e.toastRef,set:(e,t)=>{e.toastRef=t}},metadata:t},F,U),Bu(null,c={value:d},w,{kind:"class",name:d.name,metadata:t},null,S),d=c.value,t&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(d,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Eu}),Du(d,S)})();var Gu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Vu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},zu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Wu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},$u=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s,a,o,n;let l,c,d,h,u,p,g,f,m,y,v=[V("message-view-factory")],b=[],w=Qh.LitElement,S=[],_=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],T=[],A=[],M=[],L=[],R=[],B=[];c=class extends w{get appearanceOptions(){return Wu(this,e,"f")}set appearanceOptions(t){$u(this,e,t,"f")}get type(){return Wu(this,t,"f")}set type(e){$u(this,t,e,"f")}get open(){return Wu(this,r,"f")}set open(e){$u(this,r,e,"f")}get disableClose(){return Wu(this,i,"f")}set disableClose(e){$u(this,i,e,"f")}get geometry(){return Wu(this,s,"f")}set geometry(e){$u(this,s,e,"f")}get touchController(){return Wu(this,a,"f")}set touchController(e){$u(this,a,e,"f")}get desktopMode(){return Wu(this,o,"f")}set desktopMode(e){$u(this,o,e,"f")}get dir(){return Wu(this,n,"f")}set dir(e){$u(this,n,e,"f")}render(){const e=ru[this.type];return e?tu.html`
2
2
  <${e}
3
3
  .open=${this.open}
4
4
  .disableClose=${this.disableClose}
@@ -9,4 +9,4 @@
9
9
  .dir=${this.dir}>
10
10
  <slot></slot>
11
11
  </${e}>
12
- `:null}constructor(){super(...arguments),e.set(this,Mu(this,_,void 0)),t.set(this,(Mu(this,O),Mu(this,k,void 0))),r.set(this,(Mu(this,x),Mu(this,C,!1))),i.set(this,(Mu(this,P),Mu(this,j,!1))),s.set(this,(Mu(this,E),Mu(this,I,void 0))),a.set(this,(Mu(this,T),Mu(this,A,void 0))),o.set(this,(Mu(this,M),Mu(this,L,void 0))),n.set(this,(Mu(this,R),Mu(this,B,void 0))),Mu(this,D)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,Lu(c,"MessageViewFactory"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=S[Symbol.metadata])&&void 0!==e?e:null):void 0;d=[(0,zh.property)({type:Object})],h=[(0,zh.property)({type:Number})],u=[(0,zh.property)({type:Boolean})],p=[(0,zh.property)({type:Boolean})],g=[(0,zh.property)({type:Object})],f=[(0,zh.property)({type:Object})],m=[(0,zh.property)({type:Boolean})],y=[(0,zh.property)({type:String})],Au(c,null,d,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},_,O),Au(c,null,h,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:t},k,x),Au(c,null,u,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},C,P),Au(c,null,p,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},j,E),Au(c,null,g,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},I,T),Au(c,null,f,{kind:"accessor",name:"touchController",static:!1,private:!1,access:{has:e=>"touchController"in e,get:e=>e.touchController,set:(e,t)=>{e.touchController=t}},metadata:t},A,M),Au(c,null,m,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},L,R),Au(c,null,y,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},B,D),Au(null,l={value:c},v,{kind:"class",name:c.name,metadata:t},null,w),c=l.value,t&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(c,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Vh.css``}),Mu(c,w)})();const Du=Vh.css`:host{--ias-sat:env(safe-area-inset-top);--ias-sar:env(safe-area-inset-right);--ias-sab:env(safe-area-inset-bottom);--ias-sal:env(safe-area-inset-left)}.slides-container{height:100%;width:100%;position:absolute;top:0;left:0;bottom:0;right:0}.slides-container .cards-slider{overflow:hidden}`;var Nu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Fu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Uu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Gu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Vu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r;let i,s,a,o,n,l=[b("message-slide")],c=[],d=Vh.LitElement,h=[],u=[],p=[],g=[],f=[],m=[];s=class extends d{get message(){return Gu(this,e,"f")}set message(t){Vu(this,e,t,"f")}get styleContext(){return Gu(this,t,"f")}set styleContext(e){Vu(this,t,e,"f")}get slidesContainer(){return Gu(this,r,"f")}set slidesContainer(e){Vu(this,r,e,"f")}constructor(){super(),e.set(this,Fu(this,h,void 0)),t.set(this,(Fu(this,u),Fu(this,p,void 0))),r.set(this,(Fu(this,g),Fu(this,f,null))),Fu(this,m)}firstUpdated(e){super.firstUpdated(e),setTimeout(()=>{this.initAndStartSlide()},50)}disconnectedCallback(){super.disconnectedCallback(),this.message.stop()}handleSlideClick(e){e.currentTarget&&(e.preventDefault(),e.stopPropagation(),this.message.onClick(e,e.currentTarget))}calculateSafeAreaInsets(){var e,t,r,i;if(!this.shadowRoot)return{top:0,bottom:0,left:0,right:0};const s=getComputedStyle(this.shadowRoot.host),a=e=>parseFloat(s.getPropertyValue(e)),o=null!==(e=a("--ias-sat"))&&void 0!==e?e:0,n=null!==(t=a("--ias-sab"))&&void 0!==t?t:0;return{left:null!==(r=a("--ias-sal"))&&void 0!==r?r:0,right:null!==(i=a("--ias-sar"))&&void 0!==i?i:0,top:o,bottom:n}}async initAndStartSlide(){const e=this.slidesContainer;if(!e)throw new Error("[IAM]: no slide content");this.message.attachRoot(e);const t=this.calculateSafeAreaInsets();await this.message.init({safeArea:t}),await this.message.start()}render(){var e;return Vh.html`<style nonce="${k()}">${null!==(e=this.styleContext)&&void 0!==e?e:""}</style><div class="slides-container" @click="${this.handleSlideClick}"></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,Uu(s,"MessageSlide"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=d[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[(0,zh.property)({type:Object})],o=[(0,zh.property)({type:String})],n=[(0,zh.query)(".slides-container")],Nu(s,null,a,{kind:"accessor",name:"message",static:!1,private:!1,access:{has:e=>"message"in e,get:e=>e.message,set:(e,t)=>{e.message=t}},metadata:t},h,u),Nu(s,null,o,{kind:"accessor",name:"styleContext",static:!1,private:!1,access:{has:e=>"styleContext"in e,get:e=>e.styleContext,set:(e,t)=>{e.styleContext=t}},metadata:t},p,g),Nu(s,null,n,{kind:"accessor",name:"slidesContainer",static:!1,private:!1,access:{has:e=>"slidesContainer"in e,get:e=>e.slidesContainer,set:(e,t)=>{e.slidesContainer=t}},metadata:t},f,m),Nu(null,i={value:s},l,{kind:"class",name:s.name,metadata:t},null,c),s=i.value,t&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(s,"styles",{enumerable:!0,configurable:!0,writable:!0,value:[Du]}),Fu(s,c)})();var zu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Wu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},$u=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Hu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},qu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e;let t,r,i,s=[b("iam-refresh-icon")],a=[],o=Vh.LitElement,n=[],l=[];r=class extends o{get className(){return Hu(this,e,"f")}set className(t){qu(this,e,t,"f")}_onClick(e){this.dispatchEvent(new CustomEvent("refresh",{detail:e,bubbles:!0,composed:!0}))}render(){return Vh.html`<div class="icon ${this.className}" @click="${this._onClick}"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"></path></svg></div>`}constructor(){super(...arguments),e.set(this,Wu(this,n,"")),Wu(this,l)}};e=new WeakMap,$u(r,"RefreshIcon"),(()=>{var e;const c="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=o[Symbol.metadata])&&void 0!==e?e:null):void 0;i=[(0,zh.property)({type:String})],zu(r,null,i,{kind:"accessor",name:"className",static:!1,private:!1,access:{has:e=>"className"in e,get:e=>e.className,set:(e,t)=>{e.className=t}},metadata:c},n,l),zu(null,t={value:r},s,{kind:"class",name:r.name,metadata:c},null,a),r=t.value,c&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})})(),Object.defineProperty(r,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Vh.css`:host{display:inline-block;cursor:pointer}.icon{width:24px;height:24px;color:inherit}svg{width:100%;height:100%}`}),Wu(r,a)})();var Ju=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ku=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Zu=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Qu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Yu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i;let s,a,o,n,l,c,d=[b("iam-loader")],h=[],u=Vh.LitElement,p=[],g=[],f=[],m=[],y=[],v=[],w=[],S=[];a=class extends u{get background(){return Qu(this,e,"f")}set background(t){Yu(this,e,t,"f")}get color(){return Qu(this,t,"f")}set color(e){Yu(this,t,e,"f")}get needShowErrorScreen(){return Qu(this,r,"f")}set needShowErrorScreen(e){Yu(this,r,e,"f")}get needShowLoaderScreen(){return Qu(this,i,"f")}set needShowLoaderScreen(e){Yu(this,i,e,"f")}_onReload(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("reload",{bubbles:!0,composed:!0}))}render(){const e=this.needShowErrorScreen,t=this.needShowLoaderScreen;return t||e?Vh.html`<div class="loader" style="--loader-background:${this.background||"black"}--loaderBackgroundColor:${this.color||"white"}" @click="${e=>{e.preventDefault(),e.stopPropagation()}}">${e?Vh.html`<iam-refresh-icon class="loader__refresh-btn" @refresh="${this._onReload}"></iam-refresh-icon>`:t?Vh.html`<div class="loader__spinner"></div>`:null}</div>`:null}constructor(){super(...arguments),e.set(this,Ku(this,p,null)),t.set(this,(Ku(this,g),Ku(this,f,null))),r.set(this,(Ku(this,m),Ku(this,y,!1))),i.set(this,(Ku(this,v),Ku(this,w,!1))),Ku(this,S)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,Zu(a,"Loader"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=u[Symbol.metadata])&&void 0!==e?e:null):void 0;o=[(0,zh.property)({type:String})],n=[(0,zh.property)({type:String})],l=[(0,zh.property)({type:Boolean})],c=[(0,zh.property)({type:Boolean})],Ju(a,null,o,{kind:"accessor",name:"background",static:!1,private:!1,access:{has:e=>"background"in e,get:e=>e.background,set:(e,t)=>{e.background=t}},metadata:t},p,g),Ju(a,null,n,{kind:"accessor",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:t},f,m),Ju(a,null,l,{kind:"accessor",name:"needShowErrorScreen",static:!1,private:!1,access:{has:e=>"needShowErrorScreen"in e,get:e=>e.needShowErrorScreen,set:(e,t)=>{e.needShowErrorScreen=t}},metadata:t},y,v),Ju(a,null,c,{kind:"accessor",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen,set:(e,t)=>{e.needShowLoaderScreen=t}},metadata:t},w,S),Ju(null,s={value:a},d,{kind:"class",name:a.name,metadata:t},null,h),a=s.value,t&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(a,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Vh.css`.loader{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background,#000);pointer-events:none}.loader__refresh-btn{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%,-50%,0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader__spinner{flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor,#fff);border-color:var(--loaderBackgroundAccentColor,transparent) var(--loaderBackgroundColor,#fff) var(--loaderBackgroundColor,#fff) var(--loaderBackgroundColor,#fff);animation:loading-spinner .6s infinite linear}@keyframes loading-spinner{from{transform:rotate(0)}to{transform:rotate(359deg)}}`}),Ku(a,h)})();var Xu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},ep=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},tp=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},rp=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},ip=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s;let a,o,n,l,c,d,h,u=[b("iam-reader"),m],p=[],g=Vh.LitElement,f=[],y=[],v=[],w=[],S=[],_=[],O=[],k=[],x=[],C=[];o=class extends g{get options(){return rp(this,e,"f")}set options(t){ip(this,e,t,"f")}get desktopMode(){return rp(this,t,"f")}set desktopMode(e){ip(this,t,e,"f")}get dir(){return rp(this,r,"f")}set dir(e){ip(this,r,e,"f")}get viewModel(){return rp(this,i,"f")}set viewModel(e){ip(this,i,e,"f")}get open(){return rp(this,s,"f")}set open(e){ip(this,s,e,"f")}constructor(){super(),e.set(this,ep(this,f,{})),t.set(this,(ep(this,y),ep(this,v,!1))),r.set(this,(ep(this,w),ep(this,S,xt.LTR))),i.set(this,(ep(this,_),ep(this,O,null))),s.set(this,(ep(this,k),ep(this,x,!0))),Object.defineProperty(this,"viewportController",{enumerable:!0,configurable:!0,writable:!0,value:(ep(this,C),new $h(this))}),this.handleKeydown=this.handleKeydown.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.handleKeydown)}firstUpdated(){setTimeout(()=>{this.viewportController.calculateViewport()},100)}handleKeydown(e){this.viewModel&&this.viewModel.activeMessage&&"Escape"===e.key&&this.viewModel.activeMessage.type!==Pa.Toast&&this.viewModel.forceClose()}handleClosed(){var e;this.open=!1,null===(e=this.viewModel)||void 0===e||e.notifyCanBeClosed()}updated(e){var t;super.updated(e),(null===(t=this.viewModel)||void 0===t?void 0:t.activeMessage)?this.open=!0:this.open=!1}createMessageGeometry(e,t){return(new io).create(e,{appearanceOptions:t,vw:this.viewportController.vw,vh:this.viewportController.vh,desktopMode:this.desktopMode})}async handleReloadMessage(){var e,t;try{await(null===(t=null===(e=this.viewModel)||void 0===e?void 0:e.activeMessage)||void 0===t?void 0:t.restart())}catch(e){console.error(e)}}render(){if(!this.viewModel)return null;const e=this.viewModel.activeMessage,t=this.viewModel.touchController;if(!(null==e?void 0:e.context))return null;const r=e.type,i=this.createMessageGeometry(r,e.appearanceOptions),s={zIndex:e.appearanceOptions.zIndex};return Vh.html`<div class="${(0,Kh.classMap)({"iam-container":!0,"iam-container--with-toast":r===Pa.Toast})}" style="${(0,Wh.styleMap)(s)}"><message-view-factory type="${r}" @closed="${this.handleClosed}" .disableClose="${e.disableClose}" .appearanceOptions="${e.appearanceOptions}" .geometry="${i}" .open="${this.open&&!this.viewModel.closeRequested}" .dir="${this.dir}" .desktopMode="${this.desktopMode}" .touchController="${t}"><message-slide .message="${e}" .styleContext="${e.context.style}"></message-slide><iam-loader .background="${"transparent"}" .needShowErrorScreen="${e.needShowErrorScreen}" .needShowLoaderScreen="${e.needShowLoaderScreen}" @reload="${this.handleReloadMessage}"></iam-loader></message-view-factory></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,tp(o,"InAppMessagingReader"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=g[Symbol.metadata])&&void 0!==e?e:null):void 0;n=[(0,zh.property)({type:Object})],l=[(0,zh.property)({type:Boolean})],c=[(0,zh.property)({type:String})],d=[(0,zh.property)({type:Object})],h=[(0,zh.state)()],Xu(o,null,n,{kind:"accessor",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:t},f,y),Xu(o,null,l,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},v,w),Xu(o,null,c,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},S,_),Xu(o,null,d,{kind:"accessor",name:"viewModel",static:!1,private:!1,access:{has:e=>"viewModel"in e,get:e=>e.viewModel,set:(e,t)=>{e.viewModel=t}},metadata:t},O,k),Xu(o,null,h,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},x,C),Xu(null,a={value:o},u,{kind:"class",name:o.name,metadata:t},null,p),o=a.value,t&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(o,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Vh.css`.iam-container{position:fixed;inset:0;z-index:1000}.iam-container.iam-container--with-toast{position:static}`}),ep(o,p)})();const sp=e=>{const{storyManager:t}=cp(),r=(0,pl.useRef)(null),i=t.config.dir;return(0,pl.useEffect)(()=>{const e=r.current;e.desktopMode=Y,e.dir=i,e.viewModel=t.inAppMessaging},[t,i]),(0,ul.jsx)("iam-reader",{ref:r})};var ap=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const op=gl().createContext({storyManager:ol,commonOptions:ct,storyReaderOptions:wt,gameReaderOptions:pt,goodsWidgetOptions:ft,inAppMessagingOptions:_t});let np=!1;const lp=(0,bc.observer)(e=>{var{storyManager:t,commonOptions:r,storyReaderOptions:i,goodsWidgetOptions:s,gameReaderOptions:a,inAppMessagingOptions:o}=e,n=ap(e,["storyManager","commonOptions","storyReaderOptions","goodsWidgetOptions","gameReaderOptions","inAppMessagingOptions"]);const l=t.storyReader,c=t.gameReader;(0,pl.useEffect)(()=>{if(np)throw new Error("[IAS]: There can only be one instance of <IASContainer /> per application");return np=!0,()=>{np=!1,t.clearConfig()}},[t]);const d=(0,pl.useMemo)(()=>({storyManager:t,commonOptions:r,gameReaderOptions:a,storyReaderOptions:i,goodsWidgetOptions:s,inAppMessagingOptions:o}),[t,r,a,i,s]);return(0,ul.jsxs)(op.Provider,{value:d,children:[c.isOpened&&(0,ul.jsx)(Pc,{gameReader:c}),l.isOpened&&(0,ul.jsx)(Gh,{storyReader:l}),(0,ul.jsx)(sp,{}),t.config instanceof Qs?n.children:null]})}),cp=()=>(0,pl.useContext)(op),dp=({dir:e,feed:t,slider:r,storyListOptions:i,viewportContainerRef:s})=>{const{storyManager:a}=cp(),o=a.storyReader;(0,pl.useEffect)(()=>{if(r&&i.autoScrollOnStoryClose&&o)return o.on(cs.Close,n),()=>{o.off(cs.Close,n)}},[r,i.direction,i.autoScrollOnStoryClose,o]);const n=a=>{if(!r||t!==a.feed||a.type!==me.DEFAULT)return;const o=((e,t)=>e.slides.find(e=>Number(e.dataset.id)===t))(r,a.id);if(!o)return;const n=(e=>{if(!s.current)return;const{x:t,y:r}=e.getCurrentPosition(),i=s.current.getBoundingClientRect();return new Xo(i.x+t,i.y+r,i.width,i.height)})(r);if(!n)return;const l=((t,r)=>new Xo(e===xt.LTR?t.offsetLeft:r.width-t.offsetLeft-t.clientWidth,t.offsetTop,t.clientWidth,t.clientHeight))(o,n);if(l.overlaps(n))return;const c="horizontal"===i.direction?l.x:o.offsetTop;r.scrollTo(c)}},hp=Yd((e,t)=>{const{storyManager:r}=cp(),i=e.sliderOptions.card,s=e.sliderOptions.favoriteCard,a=i.border,o=i.opened.border,n=e.sliderOptions.navigation,l=()=>{var e,t,r;return(null!==(e=o.radius)&&void 0!==e?e:a.radius)-parseFloat(null!==(t=o.width)&&void 0!==t?t:a.width)-parseFloat(null!==(r=o.gap)&&void 0!==r?r:a.gap)};return(0,ul.jsx)("div",{dir:e.dir,ref:t,className:e.className,style:Object.assign(Object.assign({},(()=>{var t,c,d,h,p,g,f,m,y,v,b,w,_,O,k,x,C,P,j,E,I;const T=e=>{let t="";return null!=e&&Array.isArray(e.linearGradient)&&(t=e.linearGradient.map(({direction:e,points:t})=>`linear-gradient(${[e,t].filter(Boolean).join(", ")})`).join(", ")),t},A={"--storiesBorderNotReadColor":a.color,"--storiesBorderReadColor":null!==(t=o.color)&&void 0!==t?t:a.color,"--storiesBorderNotReadGradientColor":null==a?void 0:a.gradient,"--storiesBorderReadGradientColor":null!==(c=null==o?void 0:o.gradient)&&void 0!==c?c:null==a?void 0:a.gradient,"--storiesListCardFavoriteGradientColor":null===(d=e.sliderOptions.favoriteCard.border)||void 0===d?void 0:d.gradient,"--storiesListCardUgcGradientColor":null===(h=e.sliderOptions.ugcCard.border)||void 0===h?void 0:h.gradient,"--storiesGap":i.gap+"px","--storiesHeight":i.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":a.width+"px","--storiesListBorderReadWidth":(null!==(p=o.width)&&void 0!==p?p:o.width)+"px","--storiesListBorderGapNotRead":a.gap+"px","--storiesListBorderGapRead":(null!==(g=o.gap)&&void 0!==g?g:o.gap)+"px","--storiesListBorderRadius":a.radius+"px","--storiesListBorderRadiusRead":(null!==(f=o.radius)&&void 0!==f?f:o.radius)+"px","--storiesListItemMaskColor":i.mask.color,"--storiesListItemOpenedMaskColor":null!==(m=i.opened.mask.color)&&void 0!==m?m:i.mask.color,"--storiesListItemMaskLinearGradient":T(i.mask),"--storiesListItemOpenedMaskLinearGradient":T(null!=(null===(v=null===(y=i.opened)||void 0===y?void 0:y.mask)||void 0===v?void 0:v.linearGradient)?i.opened.mask:i.mask),"--storiesListCardFavoriteTitle":u(s.title.padding.toString())?s.title.padding+"px":s.title.padding,"--storiesListCardFavoriteGap":u(s.gap.toString())?s.gap+"px":s.gap,"--storiesListCardUgcMaskColor":e.sliderOptions.ugcCard.mask.color,"--storiesListCardUgcMaskLinearGradient":T(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleFontFamily":`${r.config.fontPrefix}InternalPrimaryFont`,"--storiesListItemTitleFont":i.title.font,"--storiesListItemTitlePadding":u(i.title.padding.toString())?i.title.padding+"px":i.title.padding,"--storiesListControlsSize":u(n.controlsSize.toString())?n.controlsSize+"px":n.controlsSize,"--storiesListControlsBackgroundColor":n.controlsBackgroundColor,"--storiesListControlsColor":n.controlsColor,"--storiesListInnerBorderRadiusNotRead":a.radius-parseFloat(a.width)-parseFloat(a.gap)+"px","--storiesListInnerBorderRadiusRead":l()+"px","--storiesListCardDropShadow":i.dropShadow,"--storiesListCardOpenedDropShadow":null!==(b=i.opened.dropShadow)&&void 0!==b?b:i.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":(null===(w=i.svgMask)||void 0===w?void 0:w.cardMask)?`url("data:image/svg+xml,${S(null===(_=i.svgMask)||void 0===_?void 0:_.cardMask)}")`:null,"--storiesListCardOpenedMask":(null===(O=i.opened.svgMask)||void 0===O?void 0:O.cardMask)?`url("data:image/svg+xml,${S(null===(k=i.opened.svgMask)||void 0===k?void 0:k.cardMask)}")`:null,"--storiesListCardFavoriteMask":(null===(x=e.sliderOptions.ugcCard.svgMask)||void 0===x?void 0:x.cardMask)?`url("data:image/svg+xml,${S(null===(C=e.sliderOptions.ugcCard.svgMask)||void 0===C?void 0:C.cardMask)}")`:null};let M=null;return M=null===(P=i.svgMask)||void 0===P?void 0:P.overlayMask,null!=M&&Array.isArray(M)&&M.forEach((e,t)=>A[`--storiesListCardOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${S(e.mask)}")`:null),M=null===(j=i.opened.svgMask)||void 0===j?void 0:j.overlayMask,null!=M&&Array.isArray(M)&&M.forEach((e,t)=>A[`--storiesListCardOpenedOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${S(e.mask)}")`:null),M=null===(E=e.sliderOptions.favoriteCard.svgMask)||void 0===E?void 0:E.overlayMask,null!=M&&Array.isArray(M)&&M.forEach((e,t)=>A[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${S(e.mask)}")`:null),M=null===(I=e.sliderOptions.ugcCard.svgMask)||void 0===I?void 0:I.overlayMask,null!=M&&Array.isArray(M)&&M.forEach((e,t)=>A[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${S(e.mask)}")`:null),A})()),e.style),children:e.children})}),up=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),pp=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const r=(0,pl.useRef)(null);return(0,pl.useEffect)(()=>{(()=>{if(!e)return;const i=r.current,s=()=>{i.play().then(()=>{if(up){let e=1;const r=()=>{e>=2&&(i.removeEventListener("timeupdate",r),i.currentTime=0,t()),e++};i.addEventListener("timeupdate",r,!1)}else t()}).catch(e=>{console.error(e)}),i.removeEventListener("canplaythrough",s)};i.addEventListener("canplaythrough",s),i.load()})()},[]),(0,ul.jsx)("video",{ref:r,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},gp=({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:i})=>{const s=(e,t)=>null!=t&&Array.isArray(t)?t.map((t,r)=>a(t,e,r)):[],a=(e,t,r)=>({maskImage:`var(--${t}${r}Mask)`,WebkitMaskImage:`var(--${t}${r}Mask)`,background:e.background});return{getAllCardsOverlayMaskStyles:()=>{let a=[];var o;return e instanceof Yo&&(a=a.concat(s("storiesListCardFavoriteOverlay",null===(o=r.svgMask)||void 0===o?void 0:o.overlayMask))),a=e instanceof Ho?a.concat((()=>{var e;return s("storiesListCardUgcOverlay",null===(e=i.svgMask)||void 0===e?void 0:e.overlayMask)})()):e.isOpened?a.concat((()=>{var e;return s("storiesListCardOpenedOverlay",null===(e=t.opened.svgMask)||void 0===e?void 0:e.overlayMask)})()):a.concat((()=>{var e;return s("storiesListCardOverlay",null===(e=t.svgMask)||void 0===e?void 0:e.overlayMask)})()),a}}};var fp=j(6892),mp={};mp.styleTagTransform=Rl(),mp.setAttributes=Tl(),mp.insert=El().bind(null,"head"),mp.domAPI=Pl(),mp.insertStyleElement=Ml();xl()(fp.Ay,mp);const yp=fp.Ay&&fp.Ay.locals?fp.Ay.locals:void 0,vp=(0,bc.observer)(({dir:t,story:r,cardOptions:i,favoriteCardOptions:s,ugcCardOptions:a,wrapperStyle:o,children:n,onClick:l})=>{const c={dir:t,story:r,cardOptions:i,favoriteCardOptions:s,ugcCardOptions:a},[d,h]=(0,pl.useState)(!1),{getAllCardsOverlayMaskStyles:u}=gp(c),{getCardTitleAlignClass:p,getTitleStyle:g,getTitleWrapperStyle:f}=(({dir:e,story:t,cardOptions:r,favoriteCardOptions:i,ugcCardOptions:s})=>({getCardTitleAlignClass:()=>{const t=r.title.textAlign,i=t===Ne.START||t===Ne.LEFT,s=t===Ne.END||t===Ne.RIGHT,a=e===xt.LTR;return{[fp.s$]:i&&a||s&&!a,[fp.Yb]:t===Ne.CENTER,[fp.FU]:s&&a||i&&!a}},getTitleStyle:()=>{const e={};return t.titleColor&&r.title.position===Fe.CARD_INSIDE_BOTTOM&&Object.assign(e,{color:t.titleColor}),e.WebkitLineClamp=String(parseInt(r.title.lineClamp)),e},getTitleWrapperStyle:()=>{let e={};return t.titleColor&&t instanceof Yo&&(e=Object.assign(Object.assign({},e),{color:i.title.color})),t.titleColor&&t instanceof Ho&&(e=Object.assign(Object.assign({},e),{color:s.title.color})),e}}))(c),{getSlideClassList:m,getSlideStyleList:y}=(({story:t,cardOptions:r,favoriteCardOptions:i,ugcCardOptions:s})=>({getSlideClassList:()=>{var a,o;const n=t.background;let l="";void 0!==n&&(l=e[`_background-color-${n.color}`+(!0===n.gradient?"-gradient":"")]);const c=(()=>{let e;return e=t instanceof Yo?i:t instanceof Ho?s:t.isOpened&&r.opened||r,e})(),d=Boolean(c.dropShadow),h=Boolean(null===(a=c.svgMask)||void 0===a?void 0:a.cardMask),u=Boolean(null===(o=c.border)||void 0===o?void 0:o.gradient);return[l,{[fp.B6]:t.isOpened},{[fp.Pr]:r.variant===St.STYLE_RECTANGLE},{[fp.mW]:r.variant===St.STYLE_CIRCLE},{[fp.zc]:r.variant===St.STYLE_QUAD},{[fp.Xz]:t instanceof Yo},{[fp.m7]:t instanceof Ho},{[fp.jw]:d},{[fp.nU]:h},{[fp.sB]:u}]},getSlideStyleList:()=>{const e={opacity:null!==r.opacity?r.opacity:1,boxShadow:r.boxShadow||"unset",height:`${r.height}px`};return t.isOpened&&(e.boxShadow=r.opened.boxShadow||e.boxShadow,e.opacity=null!==r.opened.opacity?r.opened.opacity:e.opacity),e}}))(c),v=r.getImageSrcByCoverQuality(i.coverQuality),b=i.title.position===Fe.CARD_INSIDE_BOTTOM,w=i.title.position===Fe.CARD_OUTSIDE_TOP,S=i.title.position===Fe.CARD_OUTSIDE_BOTTOM;return(0,ul.jsxs)("div",{"data-id":r.id,className:Ol()("ias-stories-slide-wrapper",fp.uk,{[fp.fT]:w,[fp.zL]:S}),style:o,rel:"noreferrer",onClick:e=>{e.stopPropagation(),e.preventDefault(),l(r)},children:[i.title.display&&w&&(0,ul.jsx)("div",{className:Ol()(fp.p_,fp.i4),style:f(),children:(0,ul.jsx)("div",{className:Ol()(fp._d,fp.qE,p()),style:g(),children:r.title})}),(0,ul.jsxs)("div",{className:Ol()("ias-stories-slide",fp.Iu,m()),style:y(),children:[(0,ul.jsxs)("div",{className:fp.aI,children:[(0,ul.jsx)("div",{className:fp.aF,style:{backgroundColor:r.backgroundColor?r.backgroundColor:"transparent"},children:(0,ul.jsx)("div",{className:fp.eQ,children:(0,ul.jsxs)("div",{className:Ol()(fp.nj,fp.a1,{[fp.oe]:d,[fp.W7]:r instanceof Ho}),children:[v&&(0,ul.jsx)("img",{src:v,alt:r.title,loading:i.coverLazyLoading?"lazy":"eager"},v),r.videoCoverSrc&&(0,ul.jsx)(pp,{onVideoCoverLoaded:()=>h(!0),videoCoverSrc:r.videoCoverSrc}),n]})})}),(0,ul.jsx)("div",{className:fp.aA}),i.title.display&&b&&(0,ul.jsx)("div",{className:fp.p_,style:f(),children:(0,ul.jsx)("div",{className:Ol()(fp._d,fp.qE,p()),style:g(),children:r.title})})]}),u().map((e,t)=>(0,ul.jsx)("div",{style:e,className:fp.sr},t))]}),i.title.display&&S&&(0,ul.jsx)("div",{className:Ol()(fp.p_,fp.IW),style:f(),children:(0,ul.jsx)("div",{className:Ol()(fp._d,fp.qE,p()),style:g(),children:r.title})})]})});var bp=j(1980),wp={};wp.styleTagTransform=Rl(),wp.setAttributes=Tl(),wp.insert=El().bind(null,"head"),wp.domAPI=Pl(),wp.insertStyleElement=Ml();xl()(bp.Ay,wp);const Sp=bp.Ay&&bp.Ay.locals?bp.Ay.locals:void 0;var _p=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Op=e=>{var{sliderDirection:r,slider:i}=e,s=_p(e,["sliderDirection","slider"]);const[a,o]=(0,pl.useState)(!0),[n,l]=(0,pl.useState)(!0),c=s.navigationOptions.speed;(0,pl.useEffect)(()=>(i.on("reachStart",d),i.on("reachEnd",h),()=>{i.off("reachStart",d),i.off("reachEnd",h)}),[i]);const d=()=>{o(i.reachStart)},h=()=>{l(i.reachEnd)};return s.navigationView?s.navigationView({dir:s.dir,defaultStyles:t,reachStart:a,reachEnd:n,onPrev:()=>i.scrollByDirection(-1,c),onNext:()=>i.scrollByDirection(1,c),slider:{direction:r,viewport:i.elementRef.getBoundingClientRect()}}):s.navigationOptions.showControls?(0,ul.jsxs)("div",{className:Ol()("ias-stories-list-controls",bp.uT,t[r]),children:[(0,ul.jsx)("div",{onClick:()=>i.scrollByDirection(-1,c),className:Ol()("ias-control-start",bp.P0,{[bp.w0]:"rtl"===s.dir,[bp.w2]:a,"ias-control-start_dir_rtl":"rtl"===s.dir,"ias-control-start_reach-start":a}),children:(0,ul.jsx)("div",{className:Ol()("ias-control-icon",bp.ED)})}),(0,ul.jsx)("div",{onClick:()=>i.scrollByDirection(1,c),className:Ol()("ias-control-end",bp.yt,{[bp.Rh]:"rtl"===s.dir,[bp.SV]:n,"ias-control-end_dir_rtl":"rtl"===s.dir,"ias-control-end_reach-end":n}),children:(0,ul.jsx)("div",{className:Ol()("ias-control-icon",bp.ED)})})]}):null};var kp=j(7966),xp={};xp.styleTagTransform=Rl(),xp.setAttributes=Tl(),xp.insert=El().bind(null,"head"),xp.domAPI=Pl(),xp.insertStyleElement=Ml();xl()(kp.Ay,xp);kp.Ay&&kp.Ay.locals&&kp.Ay.locals;const Cp=({favoriteStories:e,cardOptions:t,favoriteCardOptions:r})=>{const i=e=>{var r;return{paddingTop:1/(null!==(r=t.aspectRatio)&&void 0!==r?r:e.getAspectRatio(t.variant))*100+"%"}},s=e=>{const t=e.getImageSrcByCoverQuality(r.coverQuality),i={};return t?i.backgroundImage=`url('${t}')`:i.backgroundColor=e.backgroundColor,i};return(0,ul.jsx)("div",{className:kp._m,children:e.slice(0,4).map((e,r)=>(0,ul.jsx)("div",{className:kp.Vl,children:(0,ul.jsx)("div",{style:i(e),className:Ol()(kp.lc,{[kp.nC]:t.variant===St.STYLE_CIRCLE}),children:(0,ul.jsx)("div",{className:kp.Nb,style:s(e)})})},r))})};var Pp=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const jp=(0,bc.observer)(Yd((e,t)=>{var{isFavorite:r=!1,storyListViewModel:i}=e,s=Pp(e,["isFavorite","storyListViewModel"]);const a=(0,pl.useRef)(null),o=(0,pl.useRef)(null);((e,t)=>{(0,pl.useImperativeHandle)(t,()=>({reload:e.reload.bind(e)}),[e])})(i,t);const n=((e,t)=>{const[r,i]=(0,pl.useState)(t);(0,pl.useLayoutEffect)(()=>{const r=e.current;s(r,t),i(t)},[JSON.stringify(t)]);const s=(e,t)=>{const r=new Sl(e,t.card.title);a(r,t)},a=(e,t)=>{const r=e.getCardTitleFont();r.fontSize=e.getScaledFontSizeInWebView(),t.card.title.font=r.toString()};return r})(a,s.storyListOptions),{sliderRef:l,slider:c,isScrolling:d}=(({dir:e,storyListOptions:t,storiesLength:r})=>{const i=(0,pl.useRef)(null),s=(0,pl.useRef)(null),[a,o]=(0,pl.useState)(!1),[n,l]=(0,pl.useState)(null),c=()=>{clearTimeout(i.current),o(!0)},d=()=>{i.current=setTimeout(()=>o(!1),100)},h=(0,pl.useCallback)(()=>{if(!n)return;const{x:e,y:t}=n.getCurrentPosition();n.testAttraction(e,t)},[n]);return(0,pl.useEffect)(()=>{if(!s.current)return;const e=new Vt;return e.mount(s.current),l(e),e.on("scrollstart",c),e.on("scrollend",d),()=>{e.destroy(),e.off("scrollstart",c),e.off("scrollend",d)}},[]),(0,pl.useEffect)(()=>{n&&(n.setGap(t.card.gap),n.setDesktopMode(Y),n.changeDirection(t.direction))},[n,t.card.gap,t.direction]),(0,pl.useEffect)(()=>{n&&(n.setTextDirection(e),n.scrollTo(0,0))},[n,e]),(0,pl.useEffect)(()=>{n&&(n.scrollTo(0,0),(async(e,t)=>{t>0&&await e.waitStoryListClientWidth();const{x:r,y:i}=e.getCurrentPosition();e.testAttraction(r,i)})(n,r))},[n,r]),(0,pl.useEffect)(()=>(window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}),[n,h]),{sliderRef:s,slider:n,isScrolling:a}})({dir:i.dir,storyListOptions:n,storiesLength:i.stories.length});(({slider:e,storyListViewModel:t,storyListOptions:r,isFavorite:i})=>{const s=(0,pl.useCallback)(Nt()(()=>{if(!e)return;const{x:r,y:i}=e.getCurrentPosition();t.feedCoverageAnalytics.calculate(r,i)},300),[e,t.feedCoverageAnalytics]),a=(0,pl.useCallback)(()=>{if(!e)return;const r=e.elementRef.getBoundingClientRect(),i=new Xo(r.left,r.top,r.width,r.height),a=Array.from(e.slides),n=new Xo(0,0,window.innerWidth,window.innerHeight),l=o();t.feedCoverageAnalytics.updateGeometry({stories:a,storyListRect:i,windowRect:n,viewportPadding:l}),s()},[e,t.feedCoverageAnalytics,s]);(0,pl.useEffect)(()=>{if(!e||i)return;const r=t.feedCoverageAnalytics.startScroll.bind(t.feedCoverageAnalytics),s=t.feedCoverageAnalytics.endScroll.bind(t.feedCoverageAnalytics);return e.addListener("scrollstart",r),e.addListener("scrollend",s),window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{e.removeListener("scrollstart",r),e.removeListener("scrollend",s),window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[e,i,a]),(0,pl.useEffect)(()=>{!i&&e&&e.waitStoryListClientWidth().then(()=>{a()})},[e,r.direction,r.card.aspectRatio,r.card.height,t.stories,i,a]);const o=()=>{const e=r.sidePadding,t={left:e,right:e,top:r.topPadding,bottom:r.bottomPadding};return"vertical"===r.direction&&(t.left=0,t.right=0),t}})({slider:c,storyListViewModel:i,storyListOptions:n,isFavorite:r}),dp({dir:i.dir,slider:c,storyListOptions:n,viewportContainerRef:o,feed:s.feedSlug});const{getRootStyle:h,getStoryWrapperStyle:u,viewportInnerClassList:p,viewportInnerStyle:g}=(({dir:e,storyList:t,options:r})=>{var i;return{getRootStyle:()=>({"--background-color":r.layout.backgroundColor,paddingLeft:r.sidePadding+"px",paddingRight:r.sidePadding+"px","--storiesListTopPadding":r.topPadding+"px","--storiesListBottomPadding":r.bottomPadding+"px","--storiesListSidePadding":r.sidePadding+"px",backgroundColor:r.layout.backgroundColor}),getStoryWrapperStyle:(t,i)=>{if("vertical"===r.direction)return{marginLeft:"0px",marginRight:"0px",paddingLeft:"0px",paddingRight:"0px"};const s=e===xt.LTR,a=t===i-1,o=0===t;return{marginLeft:s||a?"0px":`${r.card.gap}px`,marginRight:!s||a?"0px":`${r.card.gap}px`,paddingLeft:o&&s||a&&!s?`${r.sidePadding}px`:"0px",paddingRight:o&&!s||a&&s?`${r.sidePadding}px`:"0px"}},viewportInnerClassList:Y?Ol()(Bl.cT,Bl.L6,{[Bl.bj]:r.navigation.showControls,[Bl.fT]:r.card.title.position===Fe.CARD_OUTSIDE_TOP,[Bl.zL]:r.card.title.position===Fe.CARD_OUTSIDE_BOTTOM,[Bl.ch]:"vertical"===r.direction}):Ol()(Bl.cT,Object.assign(Object.assign({},(()=>{const t=r.layout.sliderAlign,i=t===Be.START||t===Be.LEFT,s=t===Be.END||t===Be.RIGHT,a=e===xt.LTR;return{[Bl.s$]:i&&a||s&&!a,[Bl.Yb]:t===Be.CENTER,[Bl.FU]:s&&a||i&&!a}})()),{[Bl.fT]:r.card.title.position===Fe.CARD_OUTSIDE_TOP,[Bl.zL]:r.card.title.position===Fe.CARD_OUTSIDE_BOTTOM,[Bl.ch]:"vertical"===r.direction})),viewportInnerStyle:{"--story-card-width":(null!==(i=r.card.aspectRatio)&&void 0!==i?i:t.getAspectRatio(r.card.variant))*r.card.height+"px",height:r.layout.height,gap:"vertical"===r.direction?`${r.card.gap}px`:0}}})({options:n,storyList:i,dir:i.dir}),f=n.card,m=n.favoriteCard,y=n.ugcCard;(0,pl.useLayoutEffect)(()=>{i.setFavoriteCardOptions(m),i.setUgcCardOptions(y)},[i,m,y]);return(0,ul.jsxs)(hp,{className:Ol()("ias-stories-list-wrapper",Bl.XI,{[Bl.L6]:Y,[Bl.bj]:n.navigation.showControls,"ias-mode-desktop":Y,"ias-with-list-controls":n.navigation.showControls}),dir:s.dir,style:h(),sliderOptions:n,ref:a,children:[(0,ul.jsx)("div",{className:Ol()("ias-stories-list",Bl.$X),children:(0,ul.jsx)("div",{ref:o,className:Ol()(Bl.RI,{[Bl.L6]:Y,"ias-mode-desktop":Y}),style:"horizontal"===n.direction?{marginLeft:-n.sidePadding+"px",marginRight:-n.sidePadding+"px"}:{},children:(0,ul.jsx)("div",{ref:l,className:p,style:g,children:i.stories.map((e,t)=>{var r;const a=e instanceof Yo,o=s.storyCardView&&!a;return a&&s.favoriteCardView?(0,ul.jsx)(gl().Fragment,{children:s.favoriteCardView(e)},e.id):(0,ul.jsx)(gl().Fragment,{children:o?null===(r=s.storyCardView)||void 0===r?void 0:r.call(s,e):(0,ul.jsx)(vp,{story:e,cardOptions:f,favoriteCardOptions:m,ugcCardOptions:y,dir:i.dir,wrapperStyle:u(t,i.stories.length),onClick:()=>((e,t)=>{var r,a,o;d||(null===(r=s.onStoryCardClick)||void 0===r||r.call(s,e),e instanceof Ho?null===(a=s.onUgcCardClick)||void 0===a||a.call(s):e instanceof Yo?null===(o=s.onFavoriteCardClick)||void 0===o||o.call(s):i.onStoryClick(e,t))})(e,t),children:a&&(0,ul.jsx)(Cp,{favoriteStories:e.favoriteStories,favoriteCardOptions:n.favoriteCard,cardOptions:f})},e.id)},e.id)})})})}),c&&(0,ul.jsx)(Op,{dir:s.dir,navigationOptions:n.navigation,navigationView:s.navigationView,sliderDirection:n.direction,storiesLength:i.stories.length,slider:c})]})})),Ep=(0,bc.observer)(Yd((e,t)=>{var r;const{storyManager:i}=cp(),s=e.feedSlug||"default",a=me.DEFAULT,{storyListViewModel:o,storyListOptions:n}=ml(Object.assign(Object.assign({},e),{storyManager:i,feedSlug:s,listType:a,hasFavorite:Boolean(e.hasFavorite),isFavorite:!1}));return o&&(null===(r=o.session)||void 0===r?void 0:r.id)?(0,ul.jsx)(jp,Object.assign({},e,{dir:o.dir,storyManager:i,feedSlug:e.feedSlug||"default",listType:me.DEFAULT,storyListViewModel:o,storyListOptions:n,onStoryCardClick:e.onStoryCardClick,onFavoriteCardClick:()=>{var t;i.emit("clickOnFavoriteCell",{feed:s}),null===(t=e.onFavoriteCardClick)||void 0===t||t.call(e)},ref:t})):null})),Ip=(0,bc.observer)(Yd((e,t)=>{var r;const{storyManager:i}=cp(),s=Pe,a=me.UGC,{storyListViewModel:o,storyListOptions:n}=ml(Object.assign(Object.assign({},e),{storyManager:i,feedSlug:s,listType:a,isFavorite:!1,hasFavorite:!1}));return o&&(null===(r=o.session)||void 0===r?void 0:r.id)?(0,ul.jsx)(jp,Object.assign({},e,{ref:t,dir:o.dir,storyListOptions:n,storyManager:i,listType:me.UGC,feedSlug:Pe,storyListViewModel:o,onStoryCardClick:e.onStoryCardClick})):null})),Tp=e=>{const{storyManager:t}=cp(),r=_e,i=me.FAVORITE,{storyListViewModel:s,storyListOptions:a}=ml(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!0,hasFavorite:!0}));return s?(0,ul.jsx)(jp,Object.assign({},e,{storyListOptions:a,storyManager:t,dir:s.dir,feedSlug:r,listType:i,storyListViewModel:s,isFavorite:!0})):null},Ap=(0,bc.observer)(e=>{var t;t=e.config,(0,pl.useEffect)(()=>{ol.setConfig(t)},[JSON.stringify(t)]),(({onClickOnStory:e,onClickOnButton:t,onShowStory:r,onCloseStory:i,onShowSlide:s,onLikeStory:a,onDislikeStory:o,onFavoriteStory:n,onShareStory:l,onShareStoryWithPath:c,onFeedImpression:d,onVisibleAreaUpdated:h,onWidgetEvent:u,onStartGame:p,onCloseGame:g,onEventGame:f,onCloseStoryReader:m,onProductCartUpdated:y,onProductCartClicked:v})=>{(0,pl.useEffect)(()=>{const b=[{event:"clickOnStory",handler:e},{event:"showStory",handler:r},{event:"closeStory",handler:i},{event:"showSlide",handler:s},{event:"likeStory",handler:a},{event:"dislikeStory",handler:o},{event:"favoriteStory",handler:n},{event:"shareStory",handler:l},{event:"shareStoryWithPath",handler:c},{event:"feedImpression",handler:d},{event:"visibleAreaUpdated",handler:h},{event:"widgetEvent",handler:u},{event:"startGame",handler:p},{event:"closeGame",handler:g},{event:"eventGame",handler:f},{event:"clickOnButton",handler:t},{event:"closeStoryReader",handler:m},{event:"productCartUpdated",handler:y},{event:"onProductCartClicked",handler:v}];return b.forEach(({event:e,handler:t})=>{t&&ol.on(e,t)}),()=>{b.forEach(({event:e,handler:t})=>{t&&ol.off(e,t)})}},[e,t,r,i,s,p,g,f,a,o,n,l,c,d,h,u,m,y,v])})(e);const{commonOptions:r,gameReaderOptions:i,storyReaderOptions:s,goodsWidgetOptions:a,inAppMessagingOptions:o}=(({commonOptions:e,gameReaderOptions:t,storyReaderOptions:r,goodsWidgetOptions:i})=>{const s=(0,pl.useRef)(new hl).current,a=(0,pl.useMemo)(()=>(e&&s.setCommonOptions(e),s.commonOptions),[JSON.stringify(e)]),o=(0,pl.useMemo)(()=>(t&&s.setGameReaderOptions(t),s.gameReaderOptions),[JSON.stringify(t)]),n=(0,pl.useMemo)(()=>(i&&s.setGoodsWidgetOptions(i),s.goodsWidgetOptions),[JSON.stringify(i),null==i?void 0:i.itemClickHandler,null==i?void 0:i.openGoodsWidgetHandler]);return{commonOptions:a,gameReaderOptions:o,storyReaderOptions:(0,pl.useMemo)(()=>(r&&s.setStoryReaderOptions(r),s.storyReaderOptions),[JSON.stringify(r)]),goodsWidgetOptions:n,inAppMessagingOptions:_t}})(e);return(0,ul.jsx)(lp,{storyManager:ol,commonOptions:r,storyReaderOptions:s,gameReaderOptions:i,goodsWidgetOptions:a,inAppMessagingOptions:o,children:e.children})})})(),E})());
12
+ `:null}constructor(){super(...arguments),e.set(this,Vu(this,S,void 0)),t.set(this,(Vu(this,_),Vu(this,O,void 0))),r.set(this,(Vu(this,x),Vu(this,k,!1))),i.set(this,(Vu(this,C),Vu(this,P,!1))),s.set(this,(Vu(this,j),Vu(this,E,void 0))),a.set(this,(Vu(this,I),Vu(this,T,void 0))),o.set(this,(Vu(this,A),Vu(this,M,void 0))),n.set(this,(Vu(this,L),Vu(this,R,void 0))),Vu(this,B)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,zu(c,"MessageViewFactory"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=w[Symbol.metadata])&&void 0!==e?e:null):void 0;d=[(0,Yh.property)({type:Object})],h=[(0,Yh.property)({type:Number})],u=[(0,Yh.property)({type:Boolean})],p=[(0,Yh.property)({type:Boolean})],g=[(0,Yh.property)({type:Object})],f=[(0,Yh.property)({type:Object})],m=[(0,Yh.property)({type:Boolean})],y=[(0,Yh.property)({type:String})],Gu(c,null,d,{kind:"accessor",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions,set:(e,t)=>{e.appearanceOptions=t}},metadata:t},S,_),Gu(c,null,h,{kind:"accessor",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:t},O,x),Gu(c,null,u,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},k,C),Gu(c,null,p,{kind:"accessor",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose,set:(e,t)=>{e.disableClose=t}},metadata:t},P,j),Gu(c,null,g,{kind:"accessor",name:"geometry",static:!1,private:!1,access:{has:e=>"geometry"in e,get:e=>e.geometry,set:(e,t)=>{e.geometry=t}},metadata:t},E,I),Gu(c,null,f,{kind:"accessor",name:"touchController",static:!1,private:!1,access:{has:e=>"touchController"in e,get:e=>e.touchController,set:(e,t)=>{e.touchController=t}},metadata:t},T,A),Gu(c,null,m,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},M,L),Gu(c,null,y,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},R,B),Gu(null,l={value:c},v,{kind:"class",name:c.name,metadata:t},null,b),c=l.value,t&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(c,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Qh.css``}),Vu(c,b)})();const Hu=Qh.css`:host{--ias-sat:env(safe-area-inset-top);--ias-sar:env(safe-area-inset-right);--ias-sab:env(safe-area-inset-bottom);--ias-sal:env(safe-area-inset-left)}.slides-container{height:100%;width:100%;position:absolute;top:0;left:0;bottom:0;right:0}.slides-container .cards-slider{overflow:hidden}`;var qu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Ju=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},Ku=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},Zu=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},Qu=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r;let i,s,a,o,n,l=[V("message-slide")],c=[],d=Qh.LitElement,h=[],u=[],p=[],g=[],f=[],m=[];s=class extends d{get message(){return Zu(this,e,"f")}set message(t){Qu(this,e,t,"f")}get styleContext(){return Zu(this,t,"f")}set styleContext(e){Qu(this,t,e,"f")}get slidesContainer(){return Zu(this,r,"f")}set slidesContainer(e){Qu(this,r,e,"f")}constructor(){super(),e.set(this,Ju(this,h,void 0)),t.set(this,(Ju(this,u),Ju(this,p,void 0))),r.set(this,(Ju(this,g),Ju(this,f,null))),Ju(this,m)}firstUpdated(e){super.firstUpdated(e),setTimeout(()=>{this.initAndStartSlide()},50)}disconnectedCallback(){super.disconnectedCallback(),this.message.stop()}handleSlideClick(e){e.currentTarget&&(e.preventDefault(),e.stopPropagation(),this.message.onClick(e,e.currentTarget))}calculateSafeAreaInsets(){var e,t,r,i;if(!this.shadowRoot)return{top:0,bottom:0,left:0,right:0};const s=getComputedStyle(this.shadowRoot.host),a=e=>parseFloat(s.getPropertyValue(e)),o=null!==(e=a("--ias-sat"))&&void 0!==e?e:0,n=null!==(t=a("--ias-sab"))&&void 0!==t?t:0;return{left:null!==(r=a("--ias-sal"))&&void 0!==r?r:0,right:null!==(i=a("--ias-sar"))&&void 0!==i?i:0,top:o,bottom:n}}async initAndStartSlide(){const e=this.slidesContainer;if(!e)throw new Error("[IAM]: no slide content");this.message.attachRoot(e);const t=this.calculateSafeAreaInsets();await this.message.init({safeArea:t}),await this.message.start()}render(){var e;return Qh.html`<style nonce="${q()}">${null!==(e=this.styleContext)&&void 0!==e?e:""}</style><div class="slides-container" @click="${this.handleSlideClick}"></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,Ku(s,"MessageSlide"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=d[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[(0,Yh.property)({type:Object})],o=[(0,Yh.property)({type:String})],n=[(0,Yh.query)(".slides-container")],qu(s,null,a,{kind:"accessor",name:"message",static:!1,private:!1,access:{has:e=>"message"in e,get:e=>e.message,set:(e,t)=>{e.message=t}},metadata:t},h,u),qu(s,null,o,{kind:"accessor",name:"styleContext",static:!1,private:!1,access:{has:e=>"styleContext"in e,get:e=>e.styleContext,set:(e,t)=>{e.styleContext=t}},metadata:t},p,g),qu(s,null,n,{kind:"accessor",name:"slidesContainer",static:!1,private:!1,access:{has:e=>"slidesContainer"in e,get:e=>e.slidesContainer,set:(e,t)=>{e.slidesContainer=t}},metadata:t},f,m),qu(null,i={value:s},l,{kind:"class",name:s.name,metadata:t},null,c),s=i.value,t&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(s,"styles",{enumerable:!0,configurable:!0,writable:!0,value:[Hu]}),Ju(s,c)})();var Yu=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},Xu=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ep=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},tp=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},rp=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e;let t,r,i,s=[V("iam-refresh-icon")],a=[],o=Qh.LitElement,n=[],l=[];r=class extends o{get className(){return tp(this,e,"f")}set className(t){rp(this,e,t,"f")}_onClick(e){this.dispatchEvent(new CustomEvent("refresh",{detail:e,bubbles:!0,composed:!0}))}render(){return Qh.html`<div class="icon ${this.className}" @click="${this._onClick}"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"></path></svg></div>`}constructor(){super(...arguments),e.set(this,Xu(this,n,"")),Xu(this,l)}};e=new WeakMap,ep(r,"RefreshIcon"),(()=>{var e;const c="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=o[Symbol.metadata])&&void 0!==e?e:null):void 0;i=[(0,Yh.property)({type:String})],Yu(r,null,i,{kind:"accessor",name:"className",static:!1,private:!1,access:{has:e=>"className"in e,get:e=>e.className,set:(e,t)=>{e.className=t}},metadata:c},n,l),Yu(null,t={value:r},s,{kind:"class",name:r.name,metadata:c},null,a),r=t.value,c&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})})(),Object.defineProperty(r,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Qh.css`:host{display:inline-block;cursor:pointer}.icon{width:24px;height:24px;color:inherit}svg{width:100%;height:100%}`}),Xu(r,a)})();var ip=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},sp=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},ap=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},op=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},np=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i;let s,a,o,n,l,c,d=[V("iam-loader")],h=[],u=Qh.LitElement,p=[],g=[],f=[],m=[],y=[],v=[],b=[],w=[];a=class extends u{get background(){return op(this,e,"f")}set background(t){np(this,e,t,"f")}get color(){return op(this,t,"f")}set color(e){np(this,t,e,"f")}get needShowErrorScreen(){return op(this,r,"f")}set needShowErrorScreen(e){np(this,r,e,"f")}get needShowLoaderScreen(){return op(this,i,"f")}set needShowLoaderScreen(e){np(this,i,e,"f")}_onReload(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("reload",{bubbles:!0,composed:!0}))}render(){const e=this.needShowErrorScreen,t=this.needShowLoaderScreen;return t||e?Qh.html`<div class="loader" style="--loader-background:${this.background||"black"}--loaderBackgroundColor:${this.color||"white"}" @click="${e=>{e.preventDefault(),e.stopPropagation()}}">${e?Qh.html`<iam-refresh-icon class="loader__refresh-btn" @refresh="${this._onReload}"></iam-refresh-icon>`:t?Qh.html`<div class="loader__spinner"></div>`:null}</div>`:null}constructor(){super(...arguments),e.set(this,sp(this,p,null)),t.set(this,(sp(this,g),sp(this,f,null))),r.set(this,(sp(this,m),sp(this,y,!1))),i.set(this,(sp(this,v),sp(this,b,!1))),sp(this,w)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,ap(a,"Loader"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=u[Symbol.metadata])&&void 0!==e?e:null):void 0;o=[(0,Yh.property)({type:String})],n=[(0,Yh.property)({type:String})],l=[(0,Yh.property)({type:Boolean})],c=[(0,Yh.property)({type:Boolean})],ip(a,null,o,{kind:"accessor",name:"background",static:!1,private:!1,access:{has:e=>"background"in e,get:e=>e.background,set:(e,t)=>{e.background=t}},metadata:t},p,g),ip(a,null,n,{kind:"accessor",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:t},f,m),ip(a,null,l,{kind:"accessor",name:"needShowErrorScreen",static:!1,private:!1,access:{has:e=>"needShowErrorScreen"in e,get:e=>e.needShowErrorScreen,set:(e,t)=>{e.needShowErrorScreen=t}},metadata:t},y,v),ip(a,null,c,{kind:"accessor",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen,set:(e,t)=>{e.needShowLoaderScreen=t}},metadata:t},b,w),ip(null,s={value:a},d,{kind:"class",name:a.name,metadata:t},null,h),a=s.value,t&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(a,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Qh.css`.loader{position:absolute;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center;background:var(--loader-background,#000);pointer-events:none}.loader__refresh-btn{color:#fff;cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%,-50%,0);pointer-events:auto;padding:20px;width:32px;height:32px;box-sizing:content-box}.loader__spinner{flex-shrink:0;display:inline-block;width:32px;height:32px;border-radius:50%;border:solid 2px var(--loaderBackgroundColor,#fff);border-color:var(--loaderBackgroundAccentColor,transparent) var(--loaderBackgroundColor,#fff) var(--loaderBackgroundColor,#fff) var(--loaderBackgroundColor,#fff);animation:loading-spinner .6s infinite linear}@keyframes loading-spinner{from{transform:rotate(0)}to{transform:rotate(359deg)}}`}),sp(a,h)})();var lp=function(e,t,r,i,s,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?i.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),u=!1,p=r.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(n=o(m.get))&&(h.get=n),(n=o(m.set))&&(h.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):h[c]=n)}d&&Object.defineProperty(d,i.name,h),u=!0},cp=function(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0},dp=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},hp=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},up=function(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r};(()=>{var e,t,r,i,s;let a,o,n,l,c,d,h,u=[V("iam-reader"),F],p=[],g=Qh.LitElement,f=[],m=[],y=[],v=[],b=[],w=[],S=[],_=[],O=[],x=[];o=class extends g{get options(){return hp(this,e,"f")}set options(t){up(this,e,t,"f")}get desktopMode(){return hp(this,t,"f")}set desktopMode(e){up(this,t,e,"f")}get dir(){return hp(this,r,"f")}set dir(e){up(this,r,e,"f")}get viewModel(){return hp(this,i,"f")}set viewModel(e){up(this,i,e,"f")}get open(){return hp(this,s,"f")}set open(e){up(this,s,e,"f")}constructor(){super(),e.set(this,cp(this,f,{})),t.set(this,(cp(this,m),cp(this,y,!1))),r.set(this,(cp(this,v),cp(this,b,Nt.LTR))),i.set(this,(cp(this,w),cp(this,S,null))),s.set(this,(cp(this,_),cp(this,O,!0))),Object.defineProperty(this,"viewportController",{enumerable:!0,configurable:!0,writable:!0,value:(cp(this,x),new eu(this))}),this.handleKeydown=this.handleKeydown.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.handleKeydown)}firstUpdated(){setTimeout(()=>{this.viewportController.calculateViewport()},100)}handleKeydown(e){this.viewModel&&this.viewModel.activeMessage&&"Escape"===e.key&&this.viewModel.activeMessage.type!==La.Toast&&this.viewModel.forceClose()}handleClosed(){var e;this.open=!1,null===(e=this.viewModel)||void 0===e||e.notifyCanBeClosed()}updated(e){var t;super.updated(e),(null===(t=this.viewModel)||void 0===t?void 0:t.activeMessage)?this.open=!0:this.open=!1}createMessageGeometry(e,t){return(new uo).create(e,{appearanceOptions:t,vw:this.viewportController.vw,vh:this.viewportController.vh,desktopMode:this.desktopMode})}async handleReloadMessage(){var e,t;try{await(null===(t=null===(e=this.viewModel)||void 0===e?void 0:e.activeMessage)||void 0===t?void 0:t.restart())}catch(e){console.error(e)}}render(){if(!this.viewModel)return null;const e=this.viewModel.activeMessage,t=this.viewModel.touchController;if(!(null==e?void 0:e.context))return null;const r=e.type,i=this.createMessageGeometry(r,e.appearanceOptions),s={zIndex:e.appearanceOptions.zIndex};return Qh.html`<div class="${(0,su.classMap)({"iam-container":!0,"iam-container--with-toast":r===La.Toast})}" style="${(0,Xh.styleMap)(s)}"><message-view-factory type="${r}" @closed="${this.handleClosed}" .disableClose="${e.disableClose}" .appearanceOptions="${e.appearanceOptions}" .geometry="${i}" .open="${this.open&&!this.viewModel.closeRequested}" .dir="${this.dir}" .desktopMode="${this.desktopMode}" .touchController="${t}"><message-slide .message="${e}" .styleContext="${e.context.style}"></message-slide><iam-loader .background="${"transparent"}" .needShowErrorScreen="${e.needShowErrorScreen}" .needShowLoaderScreen="${e.needShowLoaderScreen}" @reload="${this.handleReloadMessage}"></iam-loader></message-view-factory></div>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,dp(o,"InAppMessagingReader"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=g[Symbol.metadata])&&void 0!==e?e:null):void 0;n=[(0,Yh.property)({type:Object})],l=[(0,Yh.property)({type:Boolean})],c=[(0,Yh.property)({type:String})],d=[(0,Yh.property)({type:Object})],h=[(0,Yh.state)()],lp(o,null,n,{kind:"accessor",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:t},f,m),lp(o,null,l,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},y,v),lp(o,null,c,{kind:"accessor",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir,set:(e,t)=>{e.dir=t}},metadata:t},b,w),lp(o,null,d,{kind:"accessor",name:"viewModel",static:!1,private:!1,access:{has:e=>"viewModel"in e,get:e=>e.viewModel,set:(e,t)=>{e.viewModel=t}},metadata:t},S,_),lp(o,null,h,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},O,x),lp(null,a={value:o},u,{kind:"class",name:o.name,metadata:t},null,p),o=a.value,t&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(o,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Qh.css`.iam-container{position:fixed;inset:0;z-index:1000}.iam-container.iam-container--with-toast{position:static}`}),cp(o,p)})();const pp=e=>{const{storyManager:t}=vp(),r=(0,_l.useRef)(null),i=t.config.dir;return(0,_l.useEffect)(()=>{const e=r.current;e.desktopMode=ye,e.dir=i,e.viewModel=t.inAppMessaging},[t,i]),(0,Sl.jsx)("iam-reader",{ref:r})};var gp=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const fp=Ol().createContext({storyManager:fl,commonOptions:_t,storyReaderOptions:Mt,gameReaderOptions:Ct,goodsWidgetOptions:jt,inAppMessagingOptions:Rt});let mp=!1;const yp=(0,jc.observer)(e=>{var{storyManager:t,commonOptions:r,storyReaderOptions:i,goodsWidgetOptions:s,gameReaderOptions:a,inAppMessagingOptions:o}=e,n=gp(e,["storyManager","commonOptions","storyReaderOptions","goodsWidgetOptions","gameReaderOptions","inAppMessagingOptions"]);const l=t.storyReader,c=t.gameReader;(0,_l.useEffect)(()=>{if(mp)throw new Error("[IAS]: There can only be one instance of <IASContainer /> per application");return mp=!0,()=>{mp=!1,t.clearConfig()}},[t]);const d=(0,_l.useMemo)(()=>({storyManager:t,commonOptions:r,gameReaderOptions:a,storyReaderOptions:i,goodsWidgetOptions:s,inAppMessagingOptions:o}),[t,r,a,i,s]);return(0,Sl.jsxs)(fp.Provider,{value:d,children:[c.isOpened&&(0,Sl.jsx)(Bc,{gameReader:c}),l.isOpened&&(0,Sl.jsx)(Zh,{storyReader:l}),(0,Sl.jsx)(pp,{}),t.config instanceof sa?n.children:null]})}),vp=()=>(0,_l.useContext)(fp),bp=({dir:e,feed:t,slider:r,storyListOptions:i,viewportContainerRef:s})=>{const{storyManager:a}=vp(),o=a.storyReader;(0,_l.useEffect)(()=>{if(r&&i.autoScrollOnStoryClose&&o)return o.on(vs.Close,n),()=>{o.off(vs.Close,n)}},[r,i.direction,i.autoScrollOnStoryClose,o]);const n=a=>{if(!r||t!==a.feed||a.type!==Re.DEFAULT)return;const o=((e,t)=>e.slides.find(e=>Number(e.dataset.id)===t))(r,a.id);if(!o)return;const n=(e=>{if(!s.current)return;const{x:t,y:r}=e.getCurrentPosition(),i=s.current.getBoundingClientRect();return new cn(i.x+t,i.y+r,i.width,i.height)})(r);if(!n)return;const l=((t,r)=>new cn(e===Nt.LTR?t.offsetLeft:r.width-t.offsetLeft-t.clientWidth,t.offsetTop,t.clientWidth,t.clientHeight))(o,n);if(l.overlaps(n))return;const c="horizontal"===i.direction?l.x:o.offsetTop;r.scrollTo(c)}},wp=nh((e,t)=>{const{storyManager:r}=vp(),i=e.sliderOptions.card,s=e.sliderOptions.favoriteCard,a=i.border,o=i.opened.border,n=e.sliderOptions.navigation,l=()=>{var e,t,r;return(null!==(e=o.radius)&&void 0!==e?e:a.radius)-parseFloat(null!==(t=o.width)&&void 0!==t?t:a.width)-parseFloat(null!==(r=o.gap)&&void 0!==r?r:a.gap)};return(0,Sl.jsx)("div",{dir:e.dir,ref:t,className:e.className,style:Object.assign(Object.assign({},(()=>{var t,c,d,h,u,p,g,f,m,y,v,b,w,S,_,O,x,k,C,P,j;const E=e=>{let t="";return null!=e&&Array.isArray(e.linearGradient)&&(t=e.linearGradient.map(({direction:e,points:t})=>`linear-gradient(${[e,t].filter(Boolean).join(", ")})`).join(", ")),t},I={"--storiesBorderNotReadColor":a.color,"--storiesBorderReadColor":null!==(t=o.color)&&void 0!==t?t:a.color,"--storiesBorderNotReadGradientColor":null==a?void 0:a.gradient,"--storiesBorderReadGradientColor":null!==(c=null==o?void 0:o.gradient)&&void 0!==c?c:null==a?void 0:a.gradient,"--storiesListCardFavoriteGradientColor":null===(d=e.sliderOptions.favoriteCard.border)||void 0===d?void 0:d.gradient,"--storiesListCardUgcGradientColor":null===(h=e.sliderOptions.ugcCard.border)||void 0===h?void 0:h.gradient,"--storiesGap":i.gap+"px","--storiesHeight":i.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":a.width+"px","--storiesListBorderReadWidth":(null!==(u=o.width)&&void 0!==u?u:o.width)+"px","--storiesListBorderGapNotRead":a.gap+"px","--storiesListBorderGapRead":(null!==(p=o.gap)&&void 0!==p?p:o.gap)+"px","--storiesListBorderRadius":a.radius+"px","--storiesListBorderRadiusRead":(null!==(g=o.radius)&&void 0!==g?g:o.radius)+"px","--storiesListItemMaskColor":i.mask.color,"--storiesListItemOpenedMaskColor":null!==(f=i.opened.mask.color)&&void 0!==f?f:i.mask.color,"--storiesListItemMaskLinearGradient":E(i.mask),"--storiesListItemOpenedMaskLinearGradient":E(null!=(null===(y=null===(m=i.opened)||void 0===m?void 0:m.mask)||void 0===y?void 0:y.linearGradient)?i.opened.mask:i.mask),"--storiesListCardFavoriteTitle":R(s.title.padding.toString())?s.title.padding+"px":s.title.padding,"--storiesListCardFavoriteGap":R(s.gap.toString())?s.gap+"px":s.gap,"--storiesListCardUgcMaskColor":e.sliderOptions.ugcCard.mask.color,"--storiesListCardUgcMaskLinearGradient":E(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleFontFamily":`${r.config.fontPrefix}InternalPrimaryFont`,"--storiesListItemTitleFont":i.title.font,"--storiesListItemTitlePadding":R(i.title.padding.toString())?i.title.padding+"px":i.title.padding,"--storiesListControlsSize":R(n.controlsSize.toString())?n.controlsSize+"px":n.controlsSize,"--storiesListControlsBackgroundColor":n.controlsBackgroundColor,"--storiesListControlsColor":n.controlsColor,"--storiesListInnerBorderRadiusNotRead":a.radius-parseFloat(a.width)-parseFloat(a.gap)+"px","--storiesListInnerBorderRadiusRead":l()+"px","--storiesListCardDropShadow":i.dropShadow,"--storiesListCardOpenedDropShadow":null!==(v=i.opened.dropShadow)&&void 0!==v?v:i.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":(null===(b=i.svgMask)||void 0===b?void 0:b.cardMask)?`url("data:image/svg+xml,${W(null===(w=i.svgMask)||void 0===w?void 0:w.cardMask)}")`:null,"--storiesListCardOpenedMask":(null===(S=i.opened.svgMask)||void 0===S?void 0:S.cardMask)?`url("data:image/svg+xml,${W(null===(_=i.opened.svgMask)||void 0===_?void 0:_.cardMask)}")`:null,"--storiesListCardFavoriteMask":(null===(O=e.sliderOptions.ugcCard.svgMask)||void 0===O?void 0:O.cardMask)?`url("data:image/svg+xml,${W(null===(x=e.sliderOptions.ugcCard.svgMask)||void 0===x?void 0:x.cardMask)}")`:null};let T=null;return T=null===(k=i.svgMask)||void 0===k?void 0:k.overlayMask,null!=T&&Array.isArray(T)&&T.forEach((e,t)=>I[`--storiesListCardOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${W(e.mask)}")`:null),T=null===(C=i.opened.svgMask)||void 0===C?void 0:C.overlayMask,null!=T&&Array.isArray(T)&&T.forEach((e,t)=>I[`--storiesListCardOpenedOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${W(e.mask)}")`:null),T=null===(P=e.sliderOptions.favoriteCard.svgMask)||void 0===P?void 0:P.overlayMask,null!=T&&Array.isArray(T)&&T.forEach((e,t)=>I[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${W(e.mask)}")`:null),T=null===(j=e.sliderOptions.ugcCard.svgMask)||void 0===j?void 0:j.overlayMask,null!=T&&Array.isArray(T)&&T.forEach((e,t)=>I[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${W(e.mask)}")`:null),I})()),e.style),children:e.children})}),Sp=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),_p=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const r=(0,_l.useRef)(null);return(0,_l.useEffect)(()=>{(()=>{if(!e)return;const i=r.current,s=()=>{i.play().then(()=>{if(Sp){let e=1;const r=()=>{e>=2&&(i.removeEventListener("timeupdate",r),i.currentTime=0,t()),e++};i.addEventListener("timeupdate",r,!1)}else t()}).catch(e=>{console.error(e)}),i.removeEventListener("canplaythrough",s)};i.addEventListener("canplaythrough",s),i.load()})()},[]),(0,Sl.jsx)("video",{ref:r,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},Op=({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:i})=>{const s=(e,t)=>null!=t&&Array.isArray(t)?t.map((t,r)=>a(t,e,r)):[],a=(e,t,r)=>({maskImage:`var(--${t}${r}Mask)`,WebkitMaskImage:`var(--${t}${r}Mask)`,background:e.background});return{getAllCardsOverlayMaskStyles:()=>{let a=[];var o;return e instanceof ln&&(a=a.concat(s("storiesListCardFavoriteOverlay",null===(o=r.svgMask)||void 0===o?void 0:o.overlayMask))),a=e instanceof tn?a.concat((()=>{var e;return s("storiesListCardUgcOverlay",null===(e=i.svgMask)||void 0===e?void 0:e.overlayMask)})()):e.isOpened?a.concat((()=>{var e;return s("storiesListCardOpenedOverlay",null===(e=t.opened.svgMask)||void 0===e?void 0:e.overlayMask)})()):a.concat((()=>{var e;return s("storiesListCardOverlay",null===(e=t.svgMask)||void 0===e?void 0:e.overlayMask)})()),a}}};var xp=_(6892),kp={};kp.styleTagTransform=Wl(),kp.setAttributes=Ul(),kp.insert=Nl().bind(null,"head"),kp.domAPI=Bl(),kp.insertStyleElement=Vl();Ll()(xp.Ay,kp);const Cp=xp.Ay&&xp.Ay.locals?xp.Ay.locals:void 0,Pp=(0,jc.observer)(({dir:e,story:t,cardOptions:r,favoriteCardOptions:i,ugcCardOptions:s,wrapperStyle:a,children:o,onClick:n})=>{const l={dir:e,story:t,cardOptions:r,favoriteCardOptions:i,ugcCardOptions:s},[c,d]=(0,_l.useState)(!1),{getAllCardsOverlayMaskStyles:h}=Op(l),{getCardTitleAlignClass:u,getTitleStyle:p,getTitleWrapperStyle:g}=(({dir:e,story:t,cardOptions:r,favoriteCardOptions:i,ugcCardOptions:s})=>({getCardTitleAlignClass:()=>{const t=r.title.textAlign,i=t===Xe.START||t===Xe.LEFT,s=t===Xe.END||t===Xe.RIGHT,a=e===Nt.LTR;return{[xp.s$]:i&&a||s&&!a,[xp.Yb]:t===Xe.CENTER,[xp.FU]:s&&a||i&&!a}},getTitleStyle:()=>{const e={};return t.titleColor&&r.title.position===et.CARD_INSIDE_BOTTOM&&Object.assign(e,{color:t.titleColor}),e.WebkitLineClamp=String(parseInt(r.title.lineClamp)),e},getTitleWrapperStyle:()=>{let e={};return t.titleColor&&t instanceof ln&&(e=Object.assign(Object.assign({},e),{color:i.title.color})),t.titleColor&&t instanceof tn&&(e=Object.assign(Object.assign({},e),{color:s.title.color})),e}}))(l),{getSlideClassList:f,getSlideStyleList:m}=(({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:i})=>({getSlideClassList:()=>{var s,a;const o=e.background;let n="";void 0!==o&&(n=x[`_background-color-${o.color}`+(!0===o.gradient?"-gradient":"")]);const l=(()=>{let s;return s=e instanceof ln?r:e instanceof tn?i:e.isOpened&&t.opened||t,s})(),c=Boolean(l.dropShadow),d=Boolean(null===(s=l.svgMask)||void 0===s?void 0:s.cardMask),h=Boolean(null===(a=l.border)||void 0===a?void 0:a.gradient);return[n,{[xp.B6]:e.isOpened},{[xp.Pr]:t.variant===Lt.STYLE_RECTANGLE},{[xp.mW]:t.variant===Lt.STYLE_CIRCLE},{[xp.zc]:t.variant===Lt.STYLE_QUAD},{[xp.Xz]:e instanceof ln},{[xp.m7]:e instanceof tn},{[xp.jw]:c},{[xp.nU]:d},{[xp.sB]:h}]},getSlideStyleList:()=>{const r={opacity:null!==t.opacity?t.opacity:1,boxShadow:t.boxShadow||"unset",height:`${t.height}px`};return e.isOpened&&(r.boxShadow=t.opened.boxShadow||r.boxShadow,r.opacity=null!==t.opened.opacity?t.opened.opacity:r.opacity),r}}))(l),y=t.getImageSrcByCoverQuality(r.coverQuality),v=r.title.position===et.CARD_INSIDE_BOTTOM,b=r.title.position===et.CARD_OUTSIDE_TOP,w=r.title.position===et.CARD_OUTSIDE_BOTTOM;return(0,Sl.jsxs)("div",{"data-id":t.id,className:Al()("ias-stories-slide-wrapper",xp.uk,{[xp.fT]:b,[xp.zL]:w}),style:a,rel:"noreferrer",onClick:e=>{e.stopPropagation(),e.preventDefault(),n(t)},children:[r.title.display&&b&&(0,Sl.jsx)("div",{className:Al()(xp.p_,xp.i4),style:g(),children:(0,Sl.jsx)("div",{className:Al()(xp._d,xp.qE,u()),style:p(),children:t.title})}),(0,Sl.jsxs)("div",{className:Al()("ias-stories-slide",xp.Iu,f()),style:m(),children:[(0,Sl.jsxs)("div",{className:xp.aI,children:[(0,Sl.jsx)("div",{className:xp.aF,style:{backgroundColor:t.backgroundColor?t.backgroundColor:"transparent"},children:(0,Sl.jsx)("div",{className:xp.eQ,children:(0,Sl.jsxs)("div",{className:Al()(xp.nj,xp.a1,{[xp.oe]:c,[xp.W7]:t instanceof tn}),children:[y&&(0,Sl.jsx)("img",{src:y,alt:t.title,loading:r.coverLazyLoading?"lazy":"eager"},y),t.videoCoverSrc&&(0,Sl.jsx)(_p,{onVideoCoverLoaded:()=>d(!0),videoCoverSrc:t.videoCoverSrc}),o]})})}),(0,Sl.jsx)("div",{className:xp.aA}),r.title.display&&v&&(0,Sl.jsx)("div",{className:xp.p_,style:g(),children:(0,Sl.jsx)("div",{className:Al()(xp._d,xp.qE,u()),style:p(),children:t.title})})]}),h().map((e,t)=>(0,Sl.jsx)("div",{style:e,className:xp.sr},t))]}),r.title.display&&w&&(0,Sl.jsx)("div",{className:Al()(xp.p_,xp.IW),style:g(),children:(0,Sl.jsx)("div",{className:Al()(xp._d,xp.qE,u()),style:p(),children:t.title})})]})});var jp=_(1980),Ep={};Ep.styleTagTransform=Wl(),Ep.setAttributes=Ul(),Ep.insert=Nl().bind(null,"head"),Ep.domAPI=Bl(),Ep.insertStyleElement=Vl();Ll()(jp.Ay,Ep);const Ip=jp.Ay&&jp.Ay.locals?jp.Ay.locals:void 0;var Tp=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Ap=e=>{var{sliderDirection:t,slider:r}=e,i=Tp(e,["sliderDirection","slider"]);const[s,a]=(0,_l.useState)(!0),[o,n]=(0,_l.useState)(!0),l=i.navigationOptions.speed;(0,_l.useEffect)(()=>(r.on("reachStart",c),r.on("reachEnd",d),()=>{r.off("reachStart",c),r.off("reachEnd",d)}),[r]);const c=()=>{a(r.reachStart)},d=()=>{n(r.reachEnd)};return i.navigationView?i.navigationView({dir:i.dir,defaultStyles:k,reachStart:s,reachEnd:o,onPrev:()=>r.scrollByDirection(-1,l),onNext:()=>r.scrollByDirection(1,l),slider:{direction:t,viewport:r.elementRef.getBoundingClientRect()}}):i.navigationOptions.showControls?(0,Sl.jsxs)("div",{className:Al()("ias-stories-list-controls",jp.uT,k[t]),children:[(0,Sl.jsx)("div",{onClick:()=>r.scrollByDirection(-1,l),className:Al()("ias-control-start",jp.P0,{[jp.w0]:"rtl"===i.dir,[jp.w2]:s,"ias-control-start_dir_rtl":"rtl"===i.dir,"ias-control-start_reach-start":s}),children:(0,Sl.jsx)("div",{className:Al()("ias-control-icon",jp.ED)})}),(0,Sl.jsx)("div",{onClick:()=>r.scrollByDirection(1,l),className:Al()("ias-control-end",jp.yt,{[jp.Rh]:"rtl"===i.dir,[jp.SV]:o,"ias-control-end_dir_rtl":"rtl"===i.dir,"ias-control-end_reach-end":o}),children:(0,Sl.jsx)("div",{className:Al()("ias-control-icon",jp.ED)})})]}):null};var Mp=_(7966),Lp={};Lp.styleTagTransform=Wl(),Lp.setAttributes=Ul(),Lp.insert=Nl().bind(null,"head"),Lp.domAPI=Bl(),Lp.insertStyleElement=Vl();Ll()(Mp.Ay,Lp);Mp.Ay&&Mp.Ay.locals&&Mp.Ay.locals;const Rp=({favoriteStories:e,cardOptions:t,favoriteCardOptions:r})=>{const i=e=>{var r;return{paddingTop:1/(null!==(r=t.aspectRatio)&&void 0!==r?r:e.getAspectRatio(t.variant))*100+"%"}},s=e=>{const t=e.getImageSrcByCoverQuality(r.coverQuality),i={};return t?i.backgroundImage=`url('${t}')`:i.backgroundColor=e.backgroundColor,i};return(0,Sl.jsx)("div",{className:Mp._m,children:e.slice(0,4).map((e,r)=>(0,Sl.jsx)("div",{className:Mp.Vl,children:(0,Sl.jsx)("div",{style:i(e),className:Al()(Mp.lc,{[Mp.nC]:t.variant===Lt.STYLE_CIRCLE}),children:(0,Sl.jsx)("div",{className:Mp.Nb,style:s(e)})})},r))})};var Bp=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Dp=(0,jc.observer)(nh((e,t)=>{var{isFavorite:r=!1,storyListViewModel:i}=e,s=Bp(e,["isFavorite","storyListViewModel"]);const a=(0,_l.useRef)(null),o=(0,_l.useRef)(null);((e,t)=>{(0,_l.useImperativeHandle)(t,()=>({reload:e.reload.bind(e)}),[e])})(i,t);const n=((e,t)=>{const[r,i]=(0,_l.useState)(t);(0,_l.useLayoutEffect)(()=>{const r=e.current;s(r,t),i(t)},[JSON.stringify(t)]);const s=(e,t)=>{const r=new Il(e,t.card.title);a(r,t)},a=(e,t)=>{const r=e.getCardTitleFont();r.fontSize=e.getScaledFontSizeInWebView(),t.card.title.font=r.toString()};return r})(a,s.storyListOptions),{sliderRef:l,slider:c,isScrolling:d}=(({dir:e,storyListOptions:t,storiesLength:r})=>{const i=(0,_l.useRef)(null),s=(0,_l.useRef)(null),[a,o]=(0,_l.useState)(!1),[n,l]=(0,_l.useState)(null),c=()=>{clearTimeout(i.current),o(!0)},d=()=>{i.current=setTimeout(()=>o(!1),100)},h=(0,_l.useCallback)(()=>{if(!n)return;const{x:e,y:t}=n.getCurrentPosition();n.testAttraction(e,t)},[n]);return(0,_l.useEffect)(()=>{if(!s.current)return;const e=new Xt;return e.mount(s.current),l(e),e.on("scrollstart",c),e.on("scrollend",d),()=>{e.destroy(),e.off("scrollstart",c),e.off("scrollend",d)}},[]),(0,_l.useEffect)(()=>{n&&(n.setGap(t.card.gap),n.setDesktopMode(ye),n.changeDirection(t.direction))},[n,t.card.gap,t.direction]),(0,_l.useEffect)(()=>{n&&(n.setTextDirection(e),n.scrollTo(0,0))},[n,e]),(0,_l.useEffect)(()=>{n&&(n.scrollTo(0,0),(async(e,t)=>{t>0&&await e.waitStoryListClientWidth();const{x:r,y:i}=e.getCurrentPosition();e.testAttraction(r,i)})(n,r))},[n,r]),(0,_l.useEffect)(()=>(window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}),[n,h]),{sliderRef:s,slider:n,isScrolling:a}})({dir:i.dir,storyListOptions:n,storiesLength:i.stories.length});(({slider:e,storyListViewModel:t,storyListOptions:r,isFavorite:i})=>{const s=(0,_l.useCallback)((0,C.debounce)(()=>{if(!e)return;const{x:r,y:i}=e.getCurrentPosition();t.feedCoverageAnalytics.calculate(r,i)},300),[e,t.feedCoverageAnalytics]),a=(0,_l.useCallback)(()=>{if(!e)return;const r=e.elementRef.getBoundingClientRect(),i=new cn(r.left,r.top,r.width,r.height),a=Array.from(e.slides),n=new cn(0,0,window.innerWidth,window.innerHeight),l=o();t.feedCoverageAnalytics.updateGeometry({stories:a,storyListRect:i,windowRect:n,viewportPadding:l}),s()},[e,t.feedCoverageAnalytics,s]);(0,_l.useEffect)(()=>{if(!e||i)return;const r=t.feedCoverageAnalytics.startScroll.bind(t.feedCoverageAnalytics),s=t.feedCoverageAnalytics.endScroll.bind(t.feedCoverageAnalytics);return e.addListener("scrollstart",r),e.addListener("scrollend",s),window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{e.removeListener("scrollstart",r),e.removeListener("scrollend",s),window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[e,i,a]),(0,_l.useEffect)(()=>{!i&&e&&e.waitStoryListClientWidth().then(()=>{a()})},[e,r.direction,r.card.aspectRatio,r.card.height,t.stories,i,a]);const o=()=>{const e=r.sidePadding,t={left:e,right:e,top:r.topPadding,bottom:r.bottomPadding};return"vertical"===r.direction&&(t.left=0,t.right=0),t}})({slider:c,storyListViewModel:i,storyListOptions:n,isFavorite:r}),bp({dir:i.dir,slider:c,storyListOptions:n,viewportContainerRef:o,feed:s.feedSlug});const{getRootStyle:h,getStoryWrapperStyle:u,viewportInnerClassList:p,viewportInnerStyle:g}=(({dir:e,storyList:t,options:r})=>{var i;return{getRootStyle:()=>({"--background-color":r.layout.backgroundColor,paddingLeft:r.sidePadding+"px",paddingRight:r.sidePadding+"px","--storiesListTopPadding":r.topPadding+"px","--storiesListBottomPadding":r.bottomPadding+"px","--storiesListSidePadding":r.sidePadding+"px",backgroundColor:r.layout.backgroundColor}),getStoryWrapperStyle:(t,i)=>{if("vertical"===r.direction)return{marginLeft:"0px",marginRight:"0px",paddingLeft:"0px",paddingRight:"0px"};const s=e===Nt.LTR,a=t===i-1,o=0===t;return{marginLeft:s||a?"0px":`${r.card.gap}px`,marginRight:!s||a?"0px":`${r.card.gap}px`,paddingLeft:o&&s||a&&!s?`${r.sidePadding}px`:"0px",paddingRight:o&&!s||a&&s?`${r.sidePadding}px`:"0px"}},viewportInnerClassList:ye?Al()($l.cT,$l.L6,{[$l.bj]:r.navigation.showControls,[$l.fT]:r.card.title.position===et.CARD_OUTSIDE_TOP,[$l.zL]:r.card.title.position===et.CARD_OUTSIDE_BOTTOM,[$l.ch]:"vertical"===r.direction}):Al()($l.cT,Object.assign(Object.assign({},(()=>{const t=r.layout.sliderAlign,i=t===Qe.START||t===Qe.LEFT,s=t===Qe.END||t===Qe.RIGHT,a=e===Nt.LTR;return{[$l.s$]:i&&a||s&&!a,[$l.Yb]:t===Qe.CENTER,[$l.FU]:s&&a||i&&!a}})()),{[$l.fT]:r.card.title.position===et.CARD_OUTSIDE_TOP,[$l.zL]:r.card.title.position===et.CARD_OUTSIDE_BOTTOM,[$l.ch]:"vertical"===r.direction})),viewportInnerStyle:{"--story-card-width":(null!==(i=r.card.aspectRatio)&&void 0!==i?i:t.getAspectRatio(r.card.variant))*r.card.height+"px",height:r.layout.height,gap:"vertical"===r.direction?`${r.card.gap}px`:0}}})({options:n,storyList:i,dir:i.dir}),f=n.card,m=n.favoriteCard,y=n.ugcCard;(0,_l.useLayoutEffect)(()=>{i.setFavoriteCardOptions(m),i.setUgcCardOptions(y)},[i,m,y]);return(0,Sl.jsxs)(wp,{className:Al()("ias-stories-list-wrapper",$l.XI,{[$l.L6]:ye,[$l.bj]:n.navigation.showControls,"ias-mode-desktop":ye,"ias-with-list-controls":n.navigation.showControls}),dir:s.dir,style:h(),sliderOptions:n,ref:a,children:[(0,Sl.jsx)("div",{className:Al()("ias-stories-list",$l.$X),children:(0,Sl.jsx)("div",{ref:o,className:Al()($l.RI,{[$l.L6]:ye,"ias-mode-desktop":ye}),style:"horizontal"===n.direction?{marginLeft:-n.sidePadding+"px",marginRight:-n.sidePadding+"px"}:{},children:(0,Sl.jsx)("div",{ref:l,className:p,style:g,children:i.stories.map((e,t)=>{var r;const a=e instanceof ln,o=s.storyCardView&&!a;return a&&s.favoriteCardView?(0,Sl.jsx)(Ol().Fragment,{children:s.favoriteCardView(e)},e.id):(0,Sl.jsx)(Ol().Fragment,{children:o?null===(r=s.storyCardView)||void 0===r?void 0:r.call(s,e):(0,Sl.jsx)(Pp,{story:e,cardOptions:f,favoriteCardOptions:m,ugcCardOptions:y,dir:i.dir,wrapperStyle:u(t,i.stories.length),onClick:()=>((e,t)=>{var r,a,o;d||(null===(r=s.onStoryCardClick)||void 0===r||r.call(s,e),e instanceof tn?null===(a=s.onUgcCardClick)||void 0===a||a.call(s):e instanceof ln?null===(o=s.onFavoriteCardClick)||void 0===o||o.call(s):i.onStoryClick(e,t))})(e,t),children:a&&(0,Sl.jsx)(Rp,{favoriteStories:e.favoriteStories,favoriteCardOptions:n.favoriteCard,cardOptions:f})},e.id)},e.id)})})})}),c&&(0,Sl.jsx)(Ap,{dir:s.dir,navigationOptions:n.navigation,navigationView:s.navigationView,sliderDirection:n.direction,storiesLength:i.stories.length,slider:c})]})})),Np=(0,jc.observer)(nh((e,t)=>{var r;const{storyManager:i}=vp(),s=e.feedSlug||"default",a=Re.DEFAULT,{storyListViewModel:o,storyListOptions:n}=kl(Object.assign(Object.assign({},e),{storyManager:i,feedSlug:s,listType:a,hasFavorite:Boolean(e.hasFavorite),isFavorite:!1}));return o&&(null===(r=o.session)||void 0===r?void 0:r.id)?(0,Sl.jsx)(Dp,Object.assign({},e,{dir:o.dir,storyManager:i,feedSlug:e.feedSlug||"default",listType:Re.DEFAULT,storyListViewModel:o,storyListOptions:n,onStoryCardClick:e.onStoryCardClick,onFavoriteCardClick:()=>{var t;i.emit("clickOnFavoriteCell",{feed:s}),null===(t=e.onFavoriteCardClick)||void 0===t||t.call(e)},ref:t})):null})),Fp=(0,jc.observer)(nh((e,t)=>{var r;const{storyManager:i}=vp(),s=We,a=Re.UGC,{storyListViewModel:o,storyListOptions:n}=kl(Object.assign(Object.assign({},e),{storyManager:i,feedSlug:s,listType:a,isFavorite:!1,hasFavorite:!1}));return o&&(null===(r=o.session)||void 0===r?void 0:r.id)?(0,Sl.jsx)(Dp,Object.assign({},e,{ref:t,dir:o.dir,storyListOptions:n,storyManager:i,listType:Re.UGC,feedSlug:We,storyListViewModel:o,onStoryCardClick:e.onStoryCardClick})):null})),Up=e=>{const{storyManager:t}=vp(),r=Ge,i=Re.FAVORITE,{storyListViewModel:s,storyListOptions:a}=kl(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!0,hasFavorite:!0}));return s?(0,Sl.jsx)(Dp,Object.assign({},e,{storyListOptions:a,storyManager:t,dir:s.dir,feedSlug:r,listType:i,storyListViewModel:s,isFavorite:!0})):null},Gp=(0,jc.observer)(e=>{var t;t=e.config,(0,_l.useEffect)(()=>{fl.setConfig(t)},[JSON.stringify(t)]),(({onClickOnStory:e,onClickOnButton:t,onShowStory:r,onCloseStory:i,onShowSlide:s,onLikeStory:a,onDislikeStory:o,onFavoriteStory:n,onShareStory:l,onShareStoryWithPath:c,onFeedImpression:d,onVisibleAreaUpdated:h,onWidgetEvent:u,onStartGame:p,onCloseGame:g,onEventGame:f,onCloseStoryReader:m,onProductCartUpdated:y,onProductCartClicked:v})=>{(0,_l.useEffect)(()=>{const b=[{event:"clickOnStory",handler:e},{event:"showStory",handler:r},{event:"closeStory",handler:i},{event:"showSlide",handler:s},{event:"likeStory",handler:a},{event:"dislikeStory",handler:o},{event:"favoriteStory",handler:n},{event:"shareStory",handler:l},{event:"shareStoryWithPath",handler:c},{event:"feedImpression",handler:d},{event:"visibleAreaUpdated",handler:h},{event:"widgetEvent",handler:u},{event:"startGame",handler:p},{event:"closeGame",handler:g},{event:"eventGame",handler:f},{event:"clickOnButton",handler:t},{event:"closeStoryReader",handler:m},{event:"productCartUpdated",handler:y},{event:"onProductCartClicked",handler:v}];return b.forEach(({event:e,handler:t})=>{t&&fl.on(e,t)}),()=>{b.forEach(({event:e,handler:t})=>{t&&fl.off(e,t)})}},[e,t,r,i,s,p,g,f,a,o,n,l,c,d,h,u,m,y,v])})(e);const{commonOptions:r,gameReaderOptions:i,storyReaderOptions:s,goodsWidgetOptions:a,inAppMessagingOptions:o}=(({commonOptions:e,gameReaderOptions:t,storyReaderOptions:r,goodsWidgetOptions:i})=>{const s=(0,_l.useRef)(new wl).current,a=(0,_l.useMemo)(()=>(e&&s.setCommonOptions(e),s.commonOptions),[JSON.stringify(e)]),o=(0,_l.useMemo)(()=>(t&&s.setGameReaderOptions(t),s.gameReaderOptions),[JSON.stringify(t)]),n=(0,_l.useMemo)(()=>(i&&s.setGoodsWidgetOptions(i),s.goodsWidgetOptions),[JSON.stringify(i),null==i?void 0:i.itemClickHandler,null==i?void 0:i.openGoodsWidgetHandler]);return{commonOptions:a,gameReaderOptions:o,storyReaderOptions:(0,_l.useMemo)(()=>(r&&s.setStoryReaderOptions(r),s.storyReaderOptions),[JSON.stringify(r)]),goodsWidgetOptions:n,inAppMessagingOptions:Rt}})(e);return(0,Sl.jsx)(yp,{storyManager:fl,commonOptions:r,storyReaderOptions:s,gameReaderOptions:i,goodsWidgetOptions:a,inAppMessagingOptions:o,children:e.children})});return O})());