@inappstory/react-sdk 1.7.3 → 1.8.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.mjs +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/types/appearance-manager/appearanceCommon.d.ts +69 -3
- package/dist/types/appearance-manager/gameReader.d.ts +83 -4
- package/dist/types/appearance-manager/goodsWidget.d.ts +84 -1
- package/dist/types/appearance-manager/sharePanel.d.ts +133 -7
- package/dist/types/appearance-manager/storiesList.d.ts +303 -5
- package/dist/types/appearance-manager/storyReader.d.ts +260 -0
- package/dist/types/ias-container/IasContainer.d.ts +24 -0
- package/dist/types/ias-container/appearanceOptionsProps.d.ts +20 -1
- package/dist/types/ias-container/storyManagerEventsProps.d.ts +78 -0
- package/dist/types/in-app-messaging/iamErrors.d.ts +49 -45
- package/dist/types/in-app-messaging/inAppMessaging.d.ts +166 -0
- package/dist/types/story-list/FavoriteStoryList.d.ts +51 -1
- package/dist/types/story-list/StoryList.d.ts +169 -0
- package/dist/types/story-list/UGCStoryList.d.ts +61 -0
- package/dist/types/story-list/navigationViewModel.d.ts +43 -0
- package/dist/types/story-list/storyCardViewModel.d.ts +87 -3
- package/dist/types/story-list/storyListApi.d.ts +3 -2
- package/dist/types/story-list/storyListLoadStatus.ts +47 -10
- package/dist/types/storyManager.d.ts +179 -0
- package/package.json +6 -2
- package/plugins/banners/index.esm.mjs +1 -0
- package/plugins/banners/package.json +24 -0
- package/plugins/banners/types/banner.d.ts +197 -0
- package/plugins/banners/types/bannerPlace.d.ts +186 -0
- package/plugins/banners/types/bannerPlaceAppearance.d.ts +32 -0
- package/plugins/banners/types/iasBannerPlace.d.ts +77 -0
- package/plugins/banners/types/iasBannerPreview.d.ts +58 -0
- package/plugins/banners/types/iasBannersProvider.d.ts +52 -0
- package/plugins/banners/types/index.d.ts +29 -0
- package/plugins/dotLottie/iasDotLottiePlugin.umd.js +1 -1
- package/plugins/videoOnDemand/iasVideoOnDemandPlugin.umd.js +1 -1
- package/dist/types/appearance-manager/storyReader.ts +0 -125
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("lodash/isObject.js"),require("lodash/isNil.js"),require("mobx"),require("lodash/isString.js"),require("bowser"),require("lodash/isEqual.js"),require("lodash/head.js"),require("@inappstory/slide-api"),require("async-mutex"),require("deepmerge"),require("lodash/debounce.js"),require("lodash/isEmpty.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/static-html.js"),require("lit/directives/style-map.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","lodash/isObject.js","lodash/isNil.js","mobx","lodash/isString.js","bowser","lodash/isEqual.js","lodash/head.js","@inappstory/slide-api","async-mutex","deepmerge","lodash/debounce.js","lodash/isEmpty.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/static-html.js","lit/directives/style-map.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("lodash/isObject.js"),require("lodash/isNil.js"),require("mobx"),require("lodash/isString.js"),require("bowser"),require("lodash/isEqual.js"),require("lodash/head.js"),require("@inappstory/slide-api"),require("async-mutex"),require("deepmerge"),require("lodash/debounce.js"),require("lodash/isEmpty.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/static-html.js"),require("lit/directives/style-map.js"),require("lit/directives/class-map.js"),require("lit/directives/unsafe-html.js")):t(e["lodash/isFunction.js"],e.uuid,e["lodash/isObject.js"],e["lodash/isNil.js"],e.mobx,e["lodash/isString.js"],e.bowser,e["lodash/isEqual.js"],e["lodash/head.js"],e["@inappstory/slide-api"],e["async-mutex"],e.deepmerge,e["lodash/debounce.js"],e["lodash/isEmpty.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/static-html.js"],e["lit/directives/style-map.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,u,h,p,g,f,m,y,v,b,w,S,_,O,x,k,C,P)=>(()=>{var j={6644:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".aspect-ratio-box--XcAlO{overflow:hidden;position:relative}.aspect-ratio-box--XcAlO.aspect-ratio-box--centered--iE948{width:auto;height:100%;left:50%;transform:translateX(-50%)}.aspect-ratio-box-inside--j-DAC{position:absolute;top:0;left:0;width:100%;height:100%}",""]),s.locals={"aspect-ratio-box":"aspect-ratio-box--XcAlO","aspect-ratio-box--centered":"aspect-ratio-box--centered--iE948","aspect-ratio-box-inside":"aspect-ratio-box-inside--j-DAC"};const a=s},8034:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".close-btn--vv7G4{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;width:40px;height:40px;display:flex;justify-content:center;align-items:center}.close-btn--vv7G4:focus{outline:none}.close-btn--vv7G4 svg{overflow:visible;width:40px;height:40px}.close-btn--vv7G4[data-position=start],.close-btn--vv7G4[data-position=left]{left:10px}.close-btn--vv7G4[data-position=start][dir=rtl],.close-btn--vv7G4[data-position=left][dir=rtl]{left:auto;right:10px}.close-btn--vv7G4[data-position=end],.close-btn--vv7G4[data-position=right]{right:10px}.close-btn--vv7G4[data-position=end][dir=rtl],.close-btn--vv7G4[data-position=right][dir=rtl]{left:10px;right:auto}",""]),s.locals={"close-btn":"close-btn--vv7G4"};const a=s},9678:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'@keyframes spin--Vkzob{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.splash-container--o7jGP{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;z-index:-1}.splash-container--o7jGP .splash-container__image--oC55V{position:absolute;inset:0px;z-index:0}.splash-container--o7jGP .splash-container__image--oC55V img{width:100%;height:100%;object-fit:cover}.splash-container--o7jGP .splash-container__lottie--krFru{position:absolute;inset:0px;z-index:1}.splash-container--o7jGP .splash-container__lottie--krFru canvas{width:100%;height:100%}.splash-container--o7jGP.splash-container--isLoading--O-XQM: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--Vkzob .6s infinite linear;z-index:10}.splash-container--o7jGP.splash-container--fadeIn--7OcPY{opacity:1;transition:opacity ease-in .2s}.splash-container--o7jGP.splash-container--fadeOut--MC7Yo{opacity:0;transition:opacity ease-out .3s}',""]),s.locals={"splash-container":"splash-container--o7jGP","splash-container__image":"splash-container__image--oC55V","splash-container__lottie":"splash-container__lottie--krFru","splash-container--isLoading":"splash-container--isLoading--O-XQM",spin:"spin--Vkzob","splash-container--fadeIn":"splash-container--fadeIn--7OcPY","splash-container--fadeOut":"splash-container--fadeOut--MC7Yo"};const a=s},4978:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.game-reader-container--nTAGw{background-color:rgba(0,0,0,0);position:fixed;left:0px;top:0px;padding:0px;border:0px;z-index:2147483645;width:100%;height:100%;overflow:hidden;color-scheme:auto}.game-reader--1ZgeS{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;background:rgba(0,0,0,0);z-index:1;user-select:none;pointer-events:all;color:#fff}.game-reader--1ZgeS.game-reader--desktop-mode--zMQsZ{padding:50px 0}.game-reader--1ZgeS.game-reader--desktop-mode--zMQsZ .game-reader__game-box--x-oIW{border-radius:var(--game-box-border-radius)}.game-reader--1ZgeS.game-reader--widescreen--GwmsH{padding:0 0}.game-reader--1ZgeS.game-reader--widescreen--GwmsH .game-reader__game-box--x-oIW{border-radius:0px}.game-reader--1ZgeS .game-reader__refresh-btn--1pHw3{cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);z-index:2}.game-reader--1ZgeS .game-reader__game-box--x-oIW.game-reader__game-box--widescreen--OCOoy{border-radius:0px}.game-reader--1ZgeS .game-reader__iframe--dVpcW{width:100%;height:100%;transition:opacity ease-in .3s}.game-reader--1ZgeS .game-reader__backdrop--ojYHb{position:fixed;inset:0;z-index:-1}',""]),s.locals={"game-reader-container":"game-reader-container--nTAGw","game-reader":"game-reader--1ZgeS","game-reader--desktop-mode":"game-reader--desktop-mode--zMQsZ","game-reader__game-box":"game-reader__game-box--x-oIW","game-reader--widescreen":"game-reader--widescreen--GwmsH","game-reader__refresh-btn":"game-reader__refresh-btn--1pHw3","game-reader__game-box--widescreen":"game-reader__game-box--widescreen--OCOoy","game-reader__iframe":"game-reader__iframe--dVpcW","game-reader__backdrop":"game-reader__backdrop--ojYHb"};const a=s},763:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.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)}",""]),s.locals={};const a=s},5213:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,"h3{margin:0}.stories-list-wrapper--rTQwL{background-color:var(--background-color, transparent);height:auto;padding:0;position:relative}.stories-list-wrapper--rTQwL.mode-desktop--o0ka0.with-list-controls--k8u1L{position:relative}.stories-list--cPITI{position:relative;overflow:visible}@media(min-width: 767.99px){.stories-list--cPITI{overflow:hidden}}.stories-list__actions--SI0\\+0{position:absolute;right:0;top:0}.stories-list__viewport--KbCw2{overflow:hidden;height:auto}.stories-list__viewport--KbCw2:not(.mode-desktop--o0ka0){display:flex}.stories-list__viewport-inner--LCUH4{display:flex;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-top:var(--storiesListTopPadding, 0);padding-bottom:var(--storiesListBottomPadding, 0);box-sizing:content-box}.stories-list__viewport-inner--LCUH4::-webkit-scrollbar{display:none}.stories-list__viewport-inner--LCUH4.mode-desktop--o0ka0{scroll-behavior:unset;cursor:grab}.stories-list__viewport-inner--LCUH4.isVerticalDirection--jIuyZ{display:grid;grid-template-columns:repeat(auto-fill, var(--story-card-width, 174px));justify-content:center;width:100%}.stories-list__viewport-inner--LCUH4.align-center--zgJPi{margin-left:auto;margin-right:auto}.stories-list__viewport-inner--LCUH4.align-left--mSkW6{margin-right:auto}.stories-list__viewport-inner--LCUH4.align-right--R8\\+zN{margin-left:auto}.stories-list__viewport-inner--LCUH4.isTitleCardOutsideTop--M9GF-{align-items:flex-end}.stories-list__viewport-inner--LCUH4.isTitleCardOutsideBottom--rx9jV{align-items:flex-start}",""]),s.locals={"stories-list-wrapper":"stories-list-wrapper--rTQwL","mode-desktop":"mode-desktop--o0ka0","with-list-controls":"with-list-controls--k8u1L","stories-list":"stories-list--cPITI","stories-list__actions":"stories-list__actions--SI0+0","stories-list__viewport":"stories-list__viewport--KbCw2","stories-list__viewport-inner":"stories-list__viewport-inner--LCUH4",isVerticalDirection:"isVerticalDirection--jIuyZ","align-center":"align-center--zgJPi","align-left":"align-left--mSkW6","align-right":"align-right--R8+zN",isTitleCardOutsideTop:"isTitleCardOutsideTop--M9GF-",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--rx9jV"};const a=s},7966:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".favorite-images-wrapper--Xrkk6{display:flex;flex-direction:row;flex-wrap:wrap;padding:var(--storiesListCardFavoriteTitle, --storiesListItemTitlePadding, 0px);gap:var(--storiesListCardFavoriteGap, 3px);box-sizing:border-box}.favorite-image-wrapper--iWxvX{flex:0 1 calc(50% - var(--storiesListCardFavoriteGap, 3px));position:relative}.favorite-image--zPW-D{position:relative}.favorite-image-item--t9M\\+t{position:absolute;inset:0px;border-radius:calc(var(--storiesListInnerBorderRadiusRead, 0)/4);background-position:50% 50%;background-size:cover}.circle_style--3lFSw .favorite-image-item--t9M\\+t{border-radius:50%}",""]),s.locals={"favorite-images-wrapper":"favorite-images-wrapper--Xrkk6","favorite-image-wrapper":"favorite-image-wrapper--iWxvX","favorite-image":"favorite-image--zPW-D","favorite-image-item":"favorite-image-item--t9M+t",circle_style:"circle_style--3lFSw"};const a=s},6892:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.stories-slide-wrapper--aVM\\+1:not(:last-child){margin-right:var(--storiesGap, 20px)}.stories-slide-wrapper--aVM\\+1{display:flex;flex-direction:column;flex:0 0 auto;box-sizing:content-box;width:var(--story-card-width);cursor:pointer;-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--aVM\\+1:hover{text-decoration:none}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze{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--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x{border-radius:var(--storiesListBorderRadius, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide-image--E2w7f,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide-image--E2w7f{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide-image__image--viK-T video,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide-image__image--viK-T video{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide__mask--Ra85s,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide__mask--Ra85s{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide__content--GZM3d,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide__content--GZM3d{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j{border-radius:var(--storiesListBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide-image--E2w7f,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide-image--E2w7f{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide-image__image--viK-T video,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide-image__image--viK-T video{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide__mask--Ra85s,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide__mask--Ra85s{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide__content--GZM3d,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide__content--GZM3d{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._is-read--O-P1j{border:var(--storiesListBorderReadWidth, 1px) solid var(--storiesBorderReadColor, #ededed)}.stories-slide-wrapper--aVM\\+1.isTitleCardOutsideTop--rgyxL{justify-content:flex-end}.stories-slide-wrapper--aVM\\+1.isTitleCardOutsideBottom--9w6eu{justify-content:flex-start}.stories-slide-wrapper--aVM\\+1 .stories-slide__inner--jP7d2{display:block;position:relative;width:100%;height:100%}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-black--LzoGN{background:#000}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-white--cCu4O{background:#fff}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-red--oS-Gd{background:#ff1a36}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-yellow--hVzqv{background:#fff000}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-green--hQFmN{background:#0be361}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-violet--D\\+STO{background:#b300bc}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-blue--GkTxq{background:#0761db}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-grey--qU8eo{background:#a8a8a8}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-black-gradient--I75n4{background:#fff;background:linear-gradient(0deg, #c1c1c1, #000)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-white-gradient--yfwk7{background:#fff;background:linear-gradient(180deg, #fff, #ffc800)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-red-gradient--i3Awy{background:#ff1a36;background:linear-gradient(180deg, #c90174, #eb5c57)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-yellow-gradient--c89UQ{background:#fff000;background:linear-gradient(0deg, #fbda61, #f76b1c)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-green-gradient--3TGxB{background:#0be361;background:linear-gradient(0deg, #b4ed50, #429321)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-violet-gradient--JAdS3{background:#b300bc;background:linear-gradient(180deg, #c90174, #0164fd)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-blue-gradient--qKJCa{background:#0761db;background:linear-gradient(180deg, #3023ae, #53a0fe 48%, #b4ed50)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-grey-gradient--4\\+MvA{background:#a8a8a8;background:linear-gradient(0deg, #e2e2e2, #959595)}.stories-slide-wrapper--aVM\\+1 .stories-slide-image--E2w7f{position:relative;width:100%;height:100%}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__wrap--jAg55{position:absolute;top:0;bottom:0;left:0;right:0}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T{position:relative;opacity:1;transition:opacity .3s ease-in-out;overflow:hidden}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T._mode_list--dkBpg{width:100%;height:100%}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T.ugc-card-cell--Ybjtv img{object-fit:contain}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T img{width:100%;height:100%;object-fit:cover}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T 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--aVM\\+1 .stories-slide-image__image--viK-T.video-loaded--CLBMu img{display:none}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T.video-loaded--CLBMu video{opacity:1}.stories-slide-wrapper--aVM\\+1 .stories-slide__mask--Ra85s{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--aVM\\+1 .stories-slide--ZUGze._is-read--O-P1j .stories-slide__mask--Ra85s{background-color:var(--storiesListItemOpenedMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemOpenedMaskLinearGradient, none)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._ugc-cell--f8S1f .stories-slide__mask--Ra85s{background-color:var(--storiesListCardUgcMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListCardUgcMaskLinearGradient, none)}.stories-slide-wrapper--aVM\\+1 .stories-slide__content--GZM3d{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--aVM\\+1 .stories-slide__content--GZM3d.__position_outside_top--en7U6,.stories-slide-wrapper--aVM\\+1 .stories-slide__content--GZM3d.__position_outside_bottom--X5wOp{position:relative;top:unset;right:unset;bottom:unset;left:unset;height:auto}.stories-slide-wrapper--aVM\\+1 .clamp--1Awvg{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn.align-left--835Gu{text-align:left}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn.align-center--5jKkF{text-align:center}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn.align-right--Pfrzc{text-align:right}.stories-slide--ZUGze._format-circle--prePc,.stories-slide--ZUGze._format-circle--prePc .stories-slide-image__image--viK-T,.stories-slide--ZUGze._format-circle--prePc .stories-slide-image__image--viK-T video,.stories-slide--ZUGze._format-circle--prePc .stories-slide__mask--Ra85s,.stories-slide--ZUGze._format-circle--prePc .stories-slide-image--E2w7f{border-radius:50%}.stories-slide--ZUGze._favorite-cell--1l8Xk .stories-slide__mask--Ra85s{background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%)}.stories-slide--ZUGze._favorite-cell--1l8Xk._format-circle--prePc .stories-slide-image__wrap--jAg55{display:flex}.stories-slide--ZUGze._favorite-cell--1l8Xk._format-circle--prePc .stories-slide-image__image--viK-T{width:85%;height:85%;overflow:visible;margin:auto}.stories-slide--ZUGze._favorite-cell--1l8Xk._format-circle--prePc .favorite-images-wrapper--\\+i2pB{margin:0;padding:0}.stories-slide--ZUGze._has-drop-shadow--2LySa{filter:drop-shadow(var(--storiesListCardDropShadow, none))}.stories-slide--ZUGze._has-drop-shadow--2LySa._is-read--O-P1j{filter:drop-shadow(var(--storiesListCardOpenedDropShadow, none))}.stories-slide--ZUGze._has-drop-shadow--2LySa._favorite-cell--1l8Xk{filter:drop-shadow(var(--storiesListCardFavoriteDropShadow, none))}.stories-slide--ZUGze._has-drop-shadow--2LySa._ugc-cell--f8S1f{filter:drop-shadow(var(--storiesListCardUgcDropShadow, none))}.stories-slide--ZUGze._has-card-svg-mask--17djB .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardMask);mask-image:var(--storiesListCardMask)}.stories-slide--ZUGze._has-card-svg-mask--17djB._is-read--O-P1j .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardOpenedMask);mask-image:var(--storiesListCardOpenedMask)}.stories-slide--ZUGze._has-card-svg-mask--17djB._favorite-cell--1l8Xk .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardFavoriteMask);mask-image:var(--storiesListCardFavoriteMask)}.stories-slide--ZUGze._has-card-svg-mask--17djB._ugc-cell--f8S1f .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardUgcMask);mask-image:var(--storiesListCardUgcMask)}.stories-slide--ZUGze .card-overlay-svg-mask--PoiQW{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--ZUGze._has-border-gradient-color--xkN4Z{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z: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--ZUGze._has-border-gradient-color--xkN4Z._is-read--O-P1j{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z._is-read--O-P1j: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--ZUGze._has-border-gradient-color--xkN4Z._favorite-cell--1l8Xk{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z._favorite-cell--1l8Xk: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--ZUGze._has-border-gradient-color--xkN4Z._ugc-cell--f8S1f{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z._ugc-cell--f8S1f: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}}',""]),s.locals={"stories-slide-wrapper":"stories-slide-wrapper--aVM+1","stories-slide":"stories-slide--ZUGze","_format-quad":"_format-quad--jf7N7","_format-rectangle":"_format-rectangle--Kqy8x","stories-slide-image":"stories-slide-image--E2w7f","stories-slide-image__image":"stories-slide-image__image--viK-T","stories-slide__mask":"stories-slide__mask--Ra85s","stories-slide__content":"stories-slide__content--GZM3d","_is-read":"_is-read--O-P1j",isTitleCardOutsideTop:"isTitleCardOutsideTop--rgyxL",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--9w6eu","stories-slide__inner":"stories-slide__inner--jP7d2","_background-color-black":"_background-color-black--LzoGN","_background-color-white":"_background-color-white--cCu4O","_background-color-red":"_background-color-red--oS-Gd","_background-color-yellow":"_background-color-yellow--hVzqv","_background-color-green":"_background-color-green--hQFmN","_background-color-violet":"_background-color-violet--D+STO","_background-color-blue":"_background-color-blue--GkTxq","_background-color-grey":"_background-color-grey--qU8eo","_background-color-black-gradient":"_background-color-black-gradient--I75n4","_background-color-white-gradient":"_background-color-white-gradient--yfwk7","_background-color-red-gradient":"_background-color-red-gradient--i3Awy","_background-color-yellow-gradient":"_background-color-yellow-gradient--c89UQ","_background-color-green-gradient":"_background-color-green-gradient--3TGxB","_background-color-violet-gradient":"_background-color-violet-gradient--JAdS3","_background-color-blue-gradient":"_background-color-blue-gradient--qKJCa","_background-color-grey-gradient":"_background-color-grey-gradient--4+MvA","stories-slide-image__wrap":"stories-slide-image__wrap--jAg55",_mode_list:"_mode_list--dkBpg","ugc-card-cell":"ugc-card-cell--Ybjtv","video-loaded":"video-loaded--CLBMu","_ugc-cell":"_ugc-cell--f8S1f",__position_outside_top:"__position_outside_top--en7U6",__position_outside_bottom:"__position_outside_bottom--X5wOp",clamp:"clamp--1Awvg","stories-slide__title":"stories-slide__title--PDoTn","align-left":"align-left--835Gu","align-center":"align-center--5jKkF","align-right":"align-right--Pfrzc","_format-circle":"_format-circle--prePc","_favorite-cell":"_favorite-cell--1l8Xk","favorite-images-wrapper":"favorite-images-wrapper--+i2pB","_has-drop-shadow":"_has-drop-shadow--2LySa","_has-card-svg-mask":"_has-card-svg-mask--17djB","card-overlay-svg-mask":"card-overlay-svg-mask--PoiQW","_has-border-gradient-color":"_has-border-gradient-color--xkN4Z"};const a=s},1980:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-controls--PIqE6{pointer-events:none}.stories-list-controls--PIqE6 .control-start--0L66N,.stories-list-controls--PIqE6 .control-end--rFrlW{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--PIqE6 .control-icon--9JIpq{width:7px;height:12px;background-color:var(--storiesListControlsColor, black)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-start--0L66N{left:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-start--0L66N.control-start_dir_rtl--HAuqS{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-end--rFrlW{right:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-end--rFrlW.control-end_dir_rtl--qq6Cs{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--PIqE6.vertical--fd6vu .control-start--0L66N{top:var(--storiesListTopPadding, 0);left:50%;transform:translate3d(-50%, 0, 0) rotate(90deg)}.stories-list-controls--PIqE6.vertical--fd6vu .control-end--rFrlW{top:auto;bottom:var(--storiesListBottomPadding, 0);right:50%;transform:translate3d(50%, 0, 0) rotate(90deg)}.stories-list-controls--PIqE6 .control-start--0L66N{display:flex}.stories-list-controls--PIqE6 .control-start--0L66N .control-icon--9JIpq{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 11L1 6L6 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 11L1 6L6 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")}.stories-list-controls--PIqE6 .control-start--0L66N.control-start_reach-start--\\+WUMI{display:none}.stories-list-controls--PIqE6 .control-end--rFrlW{display:flex}.stories-list-controls--PIqE6 .control-end--rFrlW .control-icon--9JIpq{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 11L6 6L1 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 11L6 6L1 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")}.stories-list-controls--PIqE6 .control-end--rFrlW.control-end_reach-end--xjGeY{display:none}",""]),s.locals={"stories-list-controls":"stories-list-controls--PIqE6","control-start":"control-start--0L66N","control-end":"control-end--rFrlW","control-icon":"control-icon--9JIpq",horizontal:"horizontal---4ee9","control-start_dir_rtl":"control-start_dir_rtl--HAuqS","control-end_dir_rtl":"control-end_dir_rtl--qq6Cs",vertical:"vertical--fd6vu","control-start_reach-start":"control-start_reach-start--+WUMI","control-end_reach-end":"control-end_reach-end--xjGeY"};const a=s},3476:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-controls--k32qT .stories-list-controls__btn_next--B9L9K,.stories-list-controls--k32qT .stories-list-controls__btn_prev--nnqoJ{display:none}.stories-list-controls--k32qT.stories-list-controls_desktop--pnSQF .stories-list-controls__btn_next--B9L9K,.stories-list-controls--k32qT.stories-list-controls_desktop--pnSQF .stories-list-controls__btn_prev--nnqoJ{display:block;position:absolute;top:50%;transform:translateY(-50%);left:50%}.stories-list-controls--k32qT .stories-list-controls__btn-icon--W0gAK{-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);border:none;color:#fff;cursor:pointer}.stories-list-controls--k32qT .stories-list-controls__btn-icon--W0gAK:focus{outline:0}.stories-list-controls--k32qT .stories-list-controls__btn-icon--W0gAK:disabled{color:#464646;cursor:not-allowed}",""]),s.locals={"stories-list-controls":"stories-list-controls--k32qT","stories-list-controls__btn_next":"stories-list-controls__btn_next--B9L9K","stories-list-controls__btn_prev":"stories-list-controls__btn_prev--nnqoJ","stories-list-controls_desktop":"stories-list-controls_desktop--pnSQF","stories-list-controls__btn-icon":"stories-list-controls__btn-icon--W0gAK"};const a=s},4267:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-container--HUkCt{left:50%;transform:translateX(-50%);overflow:hidden;box-sizing:border-box;z-index:1;position:relative;height:100%}.stories-list-container--HUkCt.stories-list-container_swipe-up--T3YBM.stories-list-container_swipe-up--T3YBM{background-color:rgba(0,0,0,0)}.stories-list-container--HUkCt.stories-list-container_desktop--2vId\\+{padding:50px 0}.stories-list-container--HUkCt *,.stories-list-container--HUkCt ::after,.stories-list-container--HUkCt ::before{box-sizing:border-box}.stories-list-container--HUkCt .stories-list--Hajgi{position:relative;height:100%;transform-style:preserve-3d}.stories-list-container--HUkCt .stories-list--Hajgi .stories-list__effect-viewer--26-zb{position:relative;top:0;left:0;right:0;width:100%;width:calc(100% + .01px);height:100%;transform-style:preserve-3d}.stories-list-container--HUkCt .stories-list--Hajgi .stories-list__item--LyxO0{position:absolute;width:100%;height:auto;bottom:0;border-radius:var(--slide-border-radius, 0);left:0;top:0;backface-visibility:hidden}",""]),s.locals={"stories-list-container":"stories-list-container--HUkCt","stories-list-container_swipe-up":"stories-list-container_swipe-up--T3YBM","stories-list-container_desktop":"stories-list-container_desktop--2vId+","stories-list":"stories-list--Hajgi","stories-list__effect-viewer":"stories-list__effect-viewer--26-zb","stories-list__item":"stories-list__item--LyxO0"};const a=s},6778:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-list-controls--Z6bj-{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:100000;transition:opacity 300ms}.story-list-controls--Z6bj-.story-list-controls_hidden--Ku7Se{opacity:0}.story-list-controls--Z6bj-.story-list-controls_hidden--Ku7Se .story-list-controls__item--rzR7a{pointer-events:none}.story-list-controls--Z6bj-:hover .story-list-controls__btn--l\\+xeN{color:#fff}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a{position:absolute;top:0;bottom:0;display:flex;flex-direction:column;justify-content:center;pointer-events:all}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a.story-list-controls__item_next--jUE9p{right:-42px}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a.story-list-controls__item_prev--jCli3{left:-42px}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN{-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;border:none;color:#fff;cursor:pointer}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN:focus{outline:0}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN :active{opacity:.3}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN:disabled{color:#464646;cursor:not-allowed}",""]),s.locals={"story-list-controls":"story-list-controls--Z6bj-","story-list-controls_hidden":"story-list-controls_hidden--Ku7Se","story-list-controls__item":"story-list-controls__item--rzR7a","story-list-controls__btn":"story-list-controls__btn--l+xeN","story-list-controls__item_next":"story-list-controls__item_next--jUE9p","story-list-controls__item_prev":"story-list-controls__item_prev--jCli3"};const a=s},9037:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-container--fP9aN{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--fP9aN .stories-list--xleip{display:flex;width:100%;height:inherit;position:relative}.stories-list-container--fP9aN .stories-list--xleip .stories-list__item--OkuTV{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--fP9aN .stories-list--xleip .stories-list__item--OkuTV.stories-list__item_active--hZPq-{transform:scale(1);cursor:inherit}",""]),s.locals={"stories-list-container":"stories-list-container--fP9aN","stories-list":"stories-list--xleip","stories-list__item":"stories-list__item--OkuTV","stories-list__item_active":"stories-list__item_active--hZPq-"};const a=s},1239:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-viewer--4fkyX{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--4fkyX:-webkit-full-screen,.stories-viewer--4fkyX:-moz-full-screen,.stories-viewer--4fkyX:-ms-fullscreen,.stories-viewer--4fkyX :fullscreen{width:100% !important;height:100% !important}.stories-viewer--4fkyX.no-select--DtR2G{user-select:none}.stories-viewer--4fkyX .stories-viewer-background--VIoup{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--4fkyX .stories-viewer-backdrop---yMm9{position:fixed;top:0;right:0;bottom:0;left:0;z-index:11;background-color:rgba(255,255,255,.5)}.stories-viewer--4fkyX .stories-viewer-backdrop---yMm9._desktopMode--wpoLG{display:none}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ{width:40px;height:40px;position:absolute;top:15px;color:#c2c2c4;z-index:100001}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=start],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=left]{left:15px}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=start][dir=rtl],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=left][dir=rtl]{left:auto;right:15px}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=end],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=right]{right:15px}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=end][dir=rtl],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=right][dir=rtl]{left:15px;right:auto}",""]),s.locals={"stories-viewer":"stories-viewer--4fkyX","no-select":"no-select--DtR2G","stories-viewer-background":"stories-viewer-background--VIoup","stories-viewer-backdrop":"stories-viewer-backdrop---yMm9",_desktopMode:"_desktopMode--wpoLG","stories-viewer__close-btn":"stories-viewer__close-btn--yKzUQ"};const a=s},6028:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-action-panel--iVHfj{position:absolute;z-index:10001;bottom:0;left:0;right:0;padding:0 8px 8px 8px;height:50px;pointer-events:none}.story-action-panel--iVHfj.story-action-panel_hidden--CNOTD .story-action-panel-actions--jnWO2{opacity:0}.story-action-panel--iVHfj.story-action-panel_hidden--CNOTD .story-action-panel-actions--jnWO2 .story-action-panel-actions__item--z7hWw{pointer-events:none}.story-action-panel--iVHfj.story-action-panel_mobile--BsoA4{background-color:#000}.story-action-panel--iVHfj[dir=rtl] .story-action-panel-actions--jnWO2 .story-action-panel-actions__right-container--42xWx{margin-left:0;margin-right:auto}.story-action-panel--iVHfj[dir=rtl] .story-action-panel-actions--jnWO2 .story-action-panel-actions__item--z7hWw{transform:scaleX(-1)}.story-action-panel-actions--jnWO2{width:100%;height:100%;display:flex;flex-direction:row;color:#fff;align-items:center;transition:opacity 300ms}.story-action-panel-actions--jnWO2>span{display:flex}.story-action-panel-actions--jnWO2 .story-action-panel-actions__right-container--42xWx{margin-left:auto;display:flex}.story-action-panel-actions__item--z7hWw{cursor:pointer;pointer-events:all;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--z7hWw>*{pointer-events:none}.story-action-panel-actions__item--z7hWw:not(:last-child){margin-right:5px}.story-action-panel-actions__item--z7hWw:hover{filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.9))}",""]),s.locals={"story-action-panel":"story-action-panel--iVHfj","story-action-panel_hidden":"story-action-panel_hidden--CNOTD","story-action-panel-actions":"story-action-panel-actions--jnWO2","story-action-panel-actions__item":"story-action-panel-actions__item--z7hWw","story-action-panel_mobile":"story-action-panel_mobile--BsoA4","story-action-panel-actions__right-container":"story-action-panel-actions__right-container--42xWx"};const a=s},2004:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-backdrop--GJj2y{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--GJj2y.story-backdrop_hidden--5wQBM{opacity:0;pointer-events:none}",""]),s.locals={"story-backdrop":"story-backdrop--GJj2y","story-backdrop_hidden":"story-backdrop_hidden--5wQBM"};const a=s},3910:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-controls--o\\+caP{display:flex;margin-top:8px}.story-controls--o\\+caP[dir=rtl] .story-controls__item--j-0y2:first-child{margin-right:auto;margin-left:0px}.story-controls--o\\+caP .story-controls__item--j-0y2{transition:opacity 300ms;color:#fff;width:32px;height:32px}.story-controls--o\\+caP .story-controls__item--j-0y2:first-child{margin-left:auto}.story-controls--o\\+caP .story-controls__item--j-0y2.story-controls__item_hidden--WolYE{opacity:0;pointer-events:none}.story-controls--o\\+caP .story-controls__item--j-0y2.story-controls__item_hidden--WolYE .story-controls__btn--lH4Zf{pointer-events:none}.story-controls--o\\+caP .story-controls__item--j-0y2 .story-controls__btn_close--qhu7Q{color:#fff}.story-controls--o\\+caP .story-controls__btn-group--LPXr\\+{position:relative}.story-controls--o\\+caP .story-controls__btn-group--LPXr\\+ .story-controls__btn--lH4Zf{position:absolute;left:0;right:0;bottom:0;top:0}.story-controls--o\\+caP .story-controls__btn--lH4Zf{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--o\\+caP .story-controls__btn--lH4Zf svg{overflow:visible}.story-controls--o\\+caP .story-controls__btn--lH4Zf:focus{outline:none}.story-controls--o\\+caP .story-controls__btn--lH4Zf.story-controls__btn_hidden--Ha9Wb{visibility:hidden;pointer-events:none}.story-controls--o\\+caP .story-controls__btn--lH4Zf:active{opacity:.5}",""]),s.locals={"story-controls":"story-controls--o+caP","story-controls__item":"story-controls__item--j-0y2","story-controls__item_hidden":"story-controls__item_hidden--WolYE","story-controls__btn":"story-controls__btn--lH4Zf","story-controls__btn_close":"story-controls__btn_close--qhu7Q","story-controls__btn-group":"story-controls__btn-group--LPXr+","story-controls__btn_hidden":"story-controls__btn_hidden--Ha9Wb"};const a=s},114:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-timeline--yRzu8{pointer-events:none;transition:opacity 300ms}.story-timeline--yRzu8.story-timeline_hidden--kN6xa{opacity:0}.story-timeline--yRzu8.story-timeline_desktop--kp5kU{border-top-left-radius:5px;border-top-right-radius:5px}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD{height:3px;display:flex}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick--MsXyM{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--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick--MsXyM:first-child{margin-left:0}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick--MsXyM:last-child{margin-right:0}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick-progress--Egbx3{width:100%;height:3px}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick-progress--Egbx3.story-timeline-ticks__tick-progress_active--gTb73{background-color:var(--story-timeline-tick-foreground, rgb(255, 255, 255))}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick-progress-loader--FFxdT{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--yRzu8[dir=rtl] .story-timeline-ticks__tick-progress-loader--FFxdT{background:linear-gradient(to left, var(--story-timeline-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}",""]),s.locals={"story-timeline":"story-timeline--yRzu8","story-timeline_hidden":"story-timeline_hidden--kN6xa","story-timeline_desktop":"story-timeline_desktop--kp5kU","story-timeline-ticks":"story-timeline-ticks--9dhcD","story-timeline-ticks__tick":"story-timeline-ticks__tick--MsXyM","story-timeline-ticks__tick-progress":"story-timeline-ticks__tick-progress--Egbx3","story-timeline-ticks__tick-progress_active":"story-timeline-ticks__tick-progress_active--gTb73","story-timeline-ticks__tick-progress-loader":"story-timeline-ticks__tick-progress-loader--FFxdT"};const a=s},2208:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-header--oupRd{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%)}",""]),s.locals={"story-header":"story-header--oupRd"};const a=s},4620:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-loader--YGyku{position:absolute;background-color:#000;z-index:10001;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center}.story-loader--YGyku .story-loader__refresh-btn--Khehd{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}.story-loader--YGyku .story-loader__spinner--8t3Vh{-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--czxRp .6s infinite linear;animation:loading-spinner--czxRp .6s infinite linear}@keyframes loading-spinner--czxRp{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]),s.locals={"story-loader":"story-loader--YGyku","story-loader__refresh-btn":"story-loader__refresh-btn--Khehd","story-loader__spinner":"story-loader__spinner--8t3Vh","loading-spinner":"loading-spinner--czxRp"};const a=s},2621:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".goods-card--5040g{width:100px}.goods-card--5040g:first-of-type{margin-left:.5rem}.goods-card--5040g:not(:last-child){margin-right:.5rem}.prices---l4yj{display:flex}.prices---l4yj>div:not(:last-child){margin-right:.5rem}.typography--jLFAP{text-decoration:none}.typography--old-price--6\\+BcT{text-decoration:line-through}.figure--jlOA4{margin:0;margin-bottom:.5rem;width:100px;height:100px}.figure--jlOA4>img{width:inherit;height:inherit;max-width:100%;border-radius:var(--figure-border-radius, 0px);background-color:var(--figure-background-color, #ffffff)}",""]),s.locals={"goods-card":"goods-card--5040g",prices:"prices---l4yj",typography:"typography--jLFAP","typography--old-price":"typography--old-price--6+BcT",figure:"figure--jlOA4"};const a=s},2561:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".scrolling-carousel--nu2WS{position:relative}.scrolling-carousel__wrapper--SGlfg{position:relative;overflow:hidden}.scrolling-carousel__item--M-Msq{display:flex;flex-wrap:nowrap;cursor:pointer}.scrolling-carousel__arrow-button--a3YI7{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--a3YI7>svg{position:absolute;left:0;right:0;bottom:0;top:0;margin:auto;width:24px;height:24px;fill:#757575}.scrolling-carousel__arrow-button--a3YI7:hover svg{fill:#000}.scrolling-carousel__arrow-button--show--Nu83N{opacity:.9}.scrolling-carousel__arrow-button--show--Nu83N:hover{opacity:1}.scrolling-carousel__arrow-button--right---xKPn{right:-18px}.scrolling-carousel__arrow-button--left--453US{left:-18px}@media(pointer: coarse){.scrolling-carousel__arrow-button--a3YI7{display:none !important}}",""]),s.locals={"scrolling-carousel":"scrolling-carousel--nu2WS","scrolling-carousel__wrapper":"scrolling-carousel__wrapper--SGlfg","scrolling-carousel__item":"scrolling-carousel__item--M-Msq","scrolling-carousel__arrow-button":"scrolling-carousel__arrow-button--a3YI7","scrolling-carousel__arrow-button--show":"scrolling-carousel__arrow-button--show--Nu83N","scrolling-carousel__arrow-button--right":"scrolling-carousel__arrow-button--right---xKPn","scrolling-carousel__arrow-button--left":"scrolling-carousel__arrow-button--left--453US"};const a=s},4354:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".btn---B67E{margin:auto auto 10px;padding:10px;cursor:pointer}",""]),s.locals={btn:"btn---B67E"};const a=s},9406:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,"@keyframes spin--YtdKR{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner--48-vq{position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);width:2rem;height:2rem;border-radius:50%;animation:spin--YtdKR .6s infinite linear;border:var(--border, 2px solid transparent);border-color:var(--border-color, black)}",""]),s.locals={spinner:"spinner--48-vq",spin:"spin--YtdKR"};const a=s},777:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,"@keyframes fadeInFrames--0uqdv{from{opacity:0}to{opacity:1}}@keyframes fadeOutFrames--3PQLg{from{opacity:1}to{opacity:0}}.goods-container--MT\\+5Y{position:relative;margin-left:auto;margin-right:auto;display:flex;flex-direction:column;width:100%;height:100%;margin-top:0px}.goods-container--visible--y9Nx3{animation:300ms fadeInFrames--0uqdv}.goods-container--hidden--If8dQ{animation:300ms normal forwards fadeOutFrames--3PQLg}.goods-container__backdrop--SXjmA{flex:1}.goods-list--ZcxDv{position:relative;display:flex;flex-direction:column}",""]),s.locals={"goods-container":"goods-container--MT+5Y","goods-container--visible":"goods-container--visible--y9Nx3",fadeInFrames:"fadeInFrames--0uqdv","goods-container--hidden":"goods-container--hidden--If8dQ",fadeOutFrames:"fadeOutFrames--3PQLg","goods-container__backdrop":"goods-container__backdrop--SXjmA","goods-list":"goods-list--ZcxDv"};const a=s},9111:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".goods-widget-viewer--2A4k5{position:absolute;inset:0;z-index:30000;text-align:left}",""]),s.locals={"goods-widget-viewer":"goods-widget-viewer--2A4k5"};const a=s},7656:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.wrapper--hW4mo{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--hW4mo .backdrop--VWvJ3{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--kVKoX{position:absolute;z-index:2;user-select:none;display:flex;flex-direction:column;text-rendering:geometricprecision;overflow:hidden}.main--kVKoX .question--IvWQJ{width:100%;height:auto}.main--kVKoX .question--IvWQJ:empty{display:none}.main--kVKoX .input-group--V1Lqf{display:flex}.main--kVKoX .input-group--V1Lqf .input--dzYD8{width:100%}.main--kVKoX .input-group--V1Lqf .input-group__prepend--E2xPb{display:flex;flex:.35}.main--kVKoX .input-group--V1Lqf .input-group__separator--dAJF6{border-right:1px solid #fff;margin-right:.5rem}.main--kVKoX .input-group--V1Lqf .input--dzYD8{flex:1}.main--kVKoX .input-wrapper--r5RhN{overflow:hidden;box-sizing:content-box;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.main--kVKoX .input-wrapper--r5RhN .input--dzYD8{background:none;-webkit-tap-highlight-color:rgba(0,0,0,0);text-rendering:inherit;outline:none;border:none}.main--kVKoX .input-wrapper--r5RhN .input--dzYD8::placeholder{color:inherit}.main--kVKoX .input-wrapper--r5RhN .input--dzYD8.input_centered--kyst8{text-align:center}.main--kVKoX .input-wrapper--r5RhN.is-invalid--2-kEN{border-color:#dc3545 !important;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.textarea-grow-wrap--oBqzJ{display:grid;max-width:100%;word-break:break-all}.textarea-grow-wrap--oBqzJ::after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.textarea-grow-wrap--oBqzJ>.input--dzYD8{resize:none;overflow:hidden}.textarea-grow-wrap--oBqzJ>.input--dzYD8,.textarea-grow-wrap--oBqzJ::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--HAPuq{width:100%}.button-wrapper--HAPuq .button--1IhPK{width:100%;cursor:pointer}.button-wrapper--HAPuq .button--1IhPK:disabled,.button-wrapper--HAPuq .button--1IhPK[disabled=true]{cursor:not-allowed;pointer-events:none;background-color:#272727 !important}@keyframes fadeIn--g0ZtR{from{opacity:0}to{opacity:1}}@keyframes fadeOut--rWg9E{from{opacity:1}to{opacity:0}}.fadeIn--g0ZtR{animation:fadeIn--g0ZtR 300ms forwards}.fadeOut--rWg9E{animation:fadeOut--rWg9E 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}',""]),s.locals={wrapper:"wrapper--hW4mo",backdrop:"backdrop--VWvJ3",main:"main--kVKoX",question:"question--IvWQJ","input-group":"input-group--V1Lqf",input:"input--dzYD8","input-group__prepend":"input-group__prepend--E2xPb","input-group__separator":"input-group__separator--dAJF6","input-wrapper":"input-wrapper--r5RhN",input_centered:"input_centered--kyst8","is-invalid":"is-invalid--2-kEN","textarea-grow-wrap":"textarea-grow-wrap--oBqzJ","button-wrapper":"button-wrapper--HAPuq",button:"button--1IhPK",fadeIn:"fadeIn--g0ZtR",fadeOut:"fadeOut--rWg9E"};const a=s},6349:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story--ieMN1{height:100%;width:100%;overflow:hidden;position:relative;border-radius:var(--slide-border-radius, 0)}.story--ieMN1.story_mobile--ugLFZ{border-radius:0}.story--ieMN1.story_mobile--ugLFZ .story-slides--Ekd4b{border-radius:var(--slide-border-radius, 0)}.story--ieMN1 .story-slides--Ekd4b{position:absolute;overflow:hidden;top:0;left:0;bottom:0;right:0}",""]),s.locals={story:"story--ieMN1",story_mobile:"story_mobile--ugLFZ","story-slides":"story-slides--Ekd4b"};const a=s},8790:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".close-btn-wrapper--erNQ2{transition:opacity 300ms;width:100%;height:100%;color:#c2c2c4}.close-btn-wrapper--erNQ2.close-btn-wrapper_hidden--E1VC0{opacity:0}.close-btn-wrapper--erNQ2.close-btn-wrapper_hidden--E1VC0 .close-btn--Wu8Wn{pointer-events:none}.close-btn--Wu8Wn{border:0;padding:0;background:rgba(0,0,0,0);pointer-events:all;cursor:pointer;outline:none;color:inherit;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.close-btn--Wu8Wn:focus{outline:none}.close-btn--Wu8Wn svg{overflow:visible;width:100%;height:100%}.close-btn--Wu8Wn:active{opacity:.5}",""]),s.locals={"close-btn-wrapper":"close-btn-wrapper--erNQ2","close-btn-wrapper_hidden":"close-btn-wrapper_hidden--E1VC0","close-btn":"close-btn--Wu8Wn"};const a=s},3639:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.screen-orientation-lock--4vxfS{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("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTc2MiIgaGVpZ2h0PSI4MjkiIHZpZXdCb3g9IjAgMCAxNzYyIDgyOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxyZWN0IHdpZHRoPSIxNzYyIiBoZWlnaHQ9IjgyOSIgZmlsbD0iIzIxMjEyMSIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02NjYgNTQ5QzY2MS41ODIgNTQ5IDY1OCA1NDUuNDE4IDY1OCA1NDFMNjU4IDM0OUM2NTggMzQ0LjU4MiA2NjEuNTgyIDM0MSA2NjYgMzQxTDk5NCAzNDFDOTk4LjQxOCAzNDEgMTAwMiAzNDQuNTgyIDEwMDIgMzQ5TDEwMDIgNTQxQzEwMDIgNTQ1LjQxOCA5OTguNDE4IDU0OSA5OTQgNTQ5TDY2NiA1NDlaTTY2OCA1NDFMOTYyIDU0MUw5NjIgMzQ5TDY2OCAzNDlMNjY4IDU0MVoiIGZpbGw9IiMzRjNGM0YiLz4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAwIDIxNEM5MDAgMjA5LjU4MiA5MDMuNTgyIDIwNiA5MDggMjA2SDExMDBDMTEwNC40MiAyMDYgMTEwOCAyMDkuNTgyIDExMDggMjE0VjU0MkMxMTA4IDU0Ni40MTggMTEwNC40MiA1NTAgMTEwMCA1NTBIOTA4QzkwMy41ODIgNTUwIDkwMCA1NDYuNDE4IDkwMCA1NDJWMjE0Wk05MDggMjE2VjUxMEgxMTAwVjIxNkg5MDhaIiBmaWxsPSJ3aGl0ZSIvPg0KPHBhdGggZD0iTTgwMy41IDIxNkM3NTggMjIwLjUgNzEzLjUgMjU3IDcxNyAzMTcuNUM3MjEgMjc4IDc1OCAyMzcuNSA4MDMuNSAyNDIuNVYyNjRMODQ1LjUgMjI5TDgwMy41IDE5NS41VjIxNloiIGZpbGw9IndoaXRlIi8+DQo8L3N2Zz4=")}',""]),s.locals={"screen-orientation-lock":"screen-orientation-lock--4vxfS"};const a=s},7231:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".share-panel__body_screenshot--\\+-VL3{display:flex;flex-direction:column}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI{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--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw{margin-right:5px;position:relative;width:30px;height:30px;flex-shrink:0}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw .btn-copy__icon-state--z3FDw{position:absolute;inset:0px;opacity:0;transition:opacity 300ms ease-in-out}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw .btn-copy__icon-state--z3FDw.btn-copy__icon-state_default--4floY{opacity:1;visibility:visible}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw .btn-copy__icon-state--z3FDw.btn-copy__icon-state_done--5-sAA{opacity:1;visibility:visible}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__text--XSGAj{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:5px}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI:active{transform:scale(0.96)}.share-panel__body_screenshot--\\+-VL3 .share-panel-row--7dNdh{justify-content:center;height:auto;padding:16px}.share-panel__body_screenshot--\\+-VL3 .share-panel-row--7dNdh:first-child{height:450px;box-sizing:border-box}.share-panel__body_screenshot--\\+-VL3 .share-panel-row__image-link--Islxp{width:100%;height:100%;display:flex;justify-content:center}.share-panel__body_screenshot--\\+-VL3 .share-panel-row__image--fk\\+wi{max-width:100%;height:100%;object-fit:cover;border-radius:20px}.share-panel__body_screenshot--\\+-VL3 .share-item__download-button--gMuRx{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--\\+-VL3 .share-item__download-button--gMuRx:active{transform:scale(0.96)}",""]),s.locals={"share-panel__body_screenshot":"share-panel__body_screenshot--+-VL3",btn:"btn--W446A","btn-copy":"btn-copy--fjKgI","btn-copy__icon":"btn-copy__icon--m0BAw","btn-copy__icon-state":"btn-copy__icon-state--z3FDw","btn-copy__icon-state_default":"btn-copy__icon-state_default--4floY","btn-copy__icon-state_done":"btn-copy__icon-state_done--5-sAA","btn-copy__text":"btn-copy__text--XSGAj","share-panel-row":"share-panel-row--7dNdh","share-panel-row__image-link":"share-panel-row__image-link--Islxp","share-panel-row__image":"share-panel-row__image--fk+wi","share-item__download-button":"share-item__download-button--gMuRx"};const a=s},9749:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".share-item--8FmHt{color:#fff}a.share-item--8FmHt{color:#fff;transition:none}a.share-item--8FmHt:hover{color:#fff}.social-list--5g9js{flex-wrap:wrap;height:auto;padding-bottom:1rem}.social-list--5g9js .social-list__item--UG-g9{margin-top:1rem}",""]),s.locals={"share-item":"share-item--8FmHt","social-list":"social-list--5g9js","social-list__item":"social-list__item--UG-g9"};const a=s},5839:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.share-panel-wrapper--dn9M6{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--dn9M6 .share-panel-backdrop--MgwuI{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5)}.share-panel--yVlOc{position:absolute;top:auto;left:0;right:0;bottom:0;z-index:2;user-select:none}.share-panel-row--deDQ6{width:100%;height:150px;display:flex;flex-direction:row;align-items:center}.share-panel-row--deDQ6 .share-item--dKU92{cursor:pointer;flex:0 0 auto;width:69px;height:90px;margin:0 10px;display:flex;flex-direction:column;align-items:center;text-align:center}.share-panel-row--deDQ6 .share-item--dKU92:first-child{margin-left:20px}.share-panel-row--deDQ6 .share-item--dKU92:last-child{margin-right:20px}.share-panel-row--deDQ6 .share-item--dKU92,.share-panel-row--deDQ6 .share-item--dKU92:visited,.share-panel-row--deDQ6 .share-item--dKU92:active,.share-panel-row--deDQ6 .share-item--dKU92:focus{text-decoration:none}.share-panel-row--deDQ6 .share-item--dKU92 .share-item-title--DzDoA{margin-top:20px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:.2rem}.share-panel-row--deDQ6.title-row--\\+CIE7{height:120px;padding-top:30px;padding-bottom:30px;padding-left:20px;padding-right:20px}.share-panel-row--deDQ6.title-row--\\+CIE7 .share-url-favicon--lcC7\\+{width:60px;height:60px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.share-panel-row--deDQ6.title-row--\\+CIE7 .share-url-favicon--lcC7\\+ img{width:30px;height:30px}.share-panel-row--deDQ6.title-row--\\+CIE7 .title--vZjLV{font-size:16px;line-height:1.4rem;margin-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.share-panel-row--deDQ6.title-row--\\+CIE7 .title--vZjLV[dir=rtl]{margin-left:0px;margin-right:15px}.share-panel-separator--iqGC0{width:100%;height:1px}.share-panel--yVlOc{will-change:transform;transition:transform 300ms}.share-panel__body--Jik8H{width:100%;height:100%}@keyframes slideIn--EfZ6a{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slideOut--1goeU{from{transform:translateY(0%)}to{transform:translateY(100%)}}@keyframes fadeIn--ebk1h{from{opacity:0}to{opacity:1}}@keyframes fadeOut--5l1DQ{from{opacity:1}to{opacity:0}}.fadeIn--ebk1h{animation:fadeIn--ebk1h 300ms forwards}.fadeOut--5l1DQ{animation:fadeOut--5l1DQ 300ms forwards}.slideIn--EfZ6a{animation:slideIn--EfZ6a 300ms forwards}.slideOut--1goeU{animation:slideOut--1goeU 300ms forwards}',""]),s.locals={"share-panel-wrapper":"share-panel-wrapper--dn9M6","share-panel-backdrop":"share-panel-backdrop--MgwuI","share-panel":"share-panel--yVlOc","share-panel-row":"share-panel-row--deDQ6","share-item":"share-item--dKU92","share-item-title":"share-item-title--DzDoA","title-row":"title-row--+CIE7","share-url-favicon":"share-url-favicon--lcC7+",title:"title--vZjLV","share-panel-separator":"share-panel-separator--iqGC0","share-panel__body":"share-panel__body--Jik8H",fadeIn:"fadeIn--ebk1h",fadeOut:"fadeOut--5l1DQ",slideIn:"slideIn--EfZ6a",slideOut:"slideOut--1goeU"};const a=s},4456:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".icon--6cPm7{width:2rem;height:2rem}",""]),s.locals={icon:"icon--6cPm7"};const a=s},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,i){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(i)for(var a=0;a<this.length;a++){var o=this[a][0];null!=o&&(s[o]=!0)}for(var n=0;n<e.length;n++){var l=[].concat(e[n]);i&&s[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},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 u(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 h(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,u(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return n(t),this.prependListener(e,u(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 h(this,e,!0)},a.prototype.rawListeners=function(e){return h(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,t,r)=>{"use strict";var i,s=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},a=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),o=[];function n(e){for(var t=-1,r=0;r<o.length;r++)if(o[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},i=[],s=0;s<e.length;s++){var a=e[s],l=t.base?a[0]+t.base:a[0],c=r[l]||0,d="".concat(l," ").concat(c);r[l]=c+1;var u=n(d),h={css:a[1],media:a[2],sourceMap:a[3]};-1!==u?(o[u].references++,o[u].updater(h)):o.push({identifier:d,updater:m(h,t),references:1}),i.push(d)}return i}function c(e){var t=document.createElement("style"),i=e.attributes||{};if(void 0===i.nonce){var s=r.nc;s&&(i.nonce=s)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var o=a(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,r,i){var s=r?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=u(t,s);else{var a=document.createTextNode(s),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function p(e,t,r){var i=r.css,s=r.media,a=r.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var g=null,f=0;function m(e,t){var r,i,s;if(t.singleton){var a=f++;r=g||(g=c(t)),i=h.bind(null,r,a,!1),s=h.bind(null,r,a,!0)}else r=c(t),i=p.bind(null,r,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<r.length;i++){var s=n(r[i]);o[s].references--}for(var a=l(e,t),c=0;c<r.length;c++){var d=n(r[c]);0===o[d].references&&(o[d].updater(),o.splice(d,1))}r=a}}}},5016:(e,t,r)=>{"use strict";const i=document.querySelector("[nonce]");i&&(r.nc=i.nonce||i.getAttribute("nonce")),window.litNonce=r.nc},5136:e=>{"use strict";e.exports=c},6166:e=>{"use strict";e.exports=d},122:e=>{"use strict";e.exports=o},992:e=>{"use strict";e.exports=b},405:e=>{"use strict";e.exports=y},5714:e=>{"use strict";e.exports=u},7161:e=>{"use strict";e.exports=_},429:e=>{"use strict";e.exports=O},5125:e=>{"use strict";e.exports=C},318:e=>{"use strict";e.exports=k},6968:e=>{"use strict";e.exports=P},2083:e=>{"use strict";e.exports=x},7326:e=>{"use strict";e.exports=h},4977:e=>{"use strict";e.exports=l},56:e=>{"use strict";e.exports=p},6099:e=>{"use strict";e.exports=n},2883:t=>{"use strict";t.exports=e},8386:e=>{"use strict";e.exports=i},7144:e=>{"use strict";e.exports=g},9498:e=>{"use strict";e.exports=r},5824:e=>{"use strict";e.exports=a},5314:e=>{"use strict";e.exports=s},5299:e=>{"use strict";e.exports=w},9780:e=>{"use strict";e.exports=v},9155:e=>{"use strict";e.exports=m},9514:e=>{"use strict";e.exports=S},5272:e=>{"use strict";e.exports=f},7315:e=>{"use strict";e.exports=t}},E={};function M(e){var t=E[e];if(void 0!==t)return t.exports;var r=E[e]={id:e,exports:{}};return j[e](r,r.exports,M),r.exports}M.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return M.d(t,{a:t}),t},M.d=(e,t)=>{for(var r in t)M.o(t,r)&&!M.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},M.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),M.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},M.nc=void 0;var I={};return(()=>{"use strict";M.r(I),M.d(I,{AppearanceManager:()=>_l,AppearanceManagerEvents:()=>Sl,CloseButtonPosition:()=>Dt,FavoriteStoryList:()=>zp,GoodsWidgetRenderingType:()=>Ut,IASContainer:()=>mp,IamCheckDisplayTimeRangeError:()=>oo,IamFrequencyLimitError:()=>ao,IamMessageLimitExceededError:()=>no,IamMessageOpenError:()=>Io,IamNotFoundByEventError:()=>jn,IamNotFoundByIdError:()=>ue,IamNotFoundLimitError:()=>he,IamOtherReaderIsOpenError:()=>io,IamShowOnlyIfLoadedError:()=>so,IasNetworkError:()=>h,StackFeedStory:()=>Zo,StackedStoryListViewModel:()=>Xo,StoriesListCardCoverQuality:()=>dt,StoriesListCardTitlePosition:()=>ct,StoriesListCardTitleTextAlign:()=>lt,StoriesListCardViewVariant:()=>nt,StoriesListDirection:()=>ut,StoryFeedType:()=>Ge,StoryList:()=>Gp,StoryManager:()=>Cn,StoryReaderSwipeStyle:()=>Ht,UGCFeedSlug:()=>Xe,UGCStoryList:()=>Wp,storyManager:()=>vl,useIASContainer:()=>yp});M(5016);var e=M(46),t=M.n(e),r=M(2883),i=M.n(r);class s extends e.EventEmitter{}class a extends Error{constructor(e){super(`[IAS]: Timeout waiting for ViewModel with ID "${e}". You must mount <IASContainer>.`),this.name="IasViewModelTimeoutError"}}class o extends Error{constructor(e){super(`[IAS]: ViewModel with ID "${e}" was deleted before resolving.`),this.name="IasViewModelRejectError"}}class n{constructor(){Object.defineProperty(this,"viewModels",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"viewModelWaiters",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}set(e,t){this.viewModels.set(e,t),this.resolveWaiters(e,t)}get(e){return this.viewModels.get(e)}async wait(e,t=5e3){const r=this.viewModels.get(e);if(r)return r;if(this.viewModelWaiters.has(e))return this.viewModelWaiters.get(e).promise;let i,s;const o=new Promise(((e,t)=>{i=e,s=t})),n=setTimeout((()=>{this.viewModelWaiters.delete(e),s(new a(e))}),t);return this.viewModelWaiters.set(e,{resolve:i,reject:s,timerId:n,promise:o}),o}getAll(){return Array.from(this.viewModels.values())}getAllOfType(e){return Array.from(this.viewModels.values()).filter(e)}has(e){return this.viewModels.has(e)}delete(e){this.viewModels.has(e)&&(this.rejectWaiters(e),this.viewModels.delete(e))}resolveWaiters(e,t){const r=this.viewModelWaiters.get(e);r&&(clearTimeout(r.timerId),r.resolve(t),this.viewModelWaiters.delete(e))}rejectWaiters(e){const t=this.viewModelWaiters.get(e);t&&(clearTimeout(t.timerId),t.reject(new o(e)),this.viewModelWaiters.delete(e))}}var l=M(7315);function c(e){return e.replace(/^\//,"")}function d(e){return e.replace(/\/$/,"")}function u(e,t,r){t instanceof Object&&Object.keys(t).forEach((i=>{const s=t[i];if(s instanceof Object&&!Array.isArray(s))return u(e,s,i);r&&(i=`${r}[${i}]`),Array.isArray(s)?s.forEach((t=>{e.append(`${i}[]`,t)})):e.append(i,s)}))}class h extends Error{constructor(e,t,r){super(),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,console.error({name:this.name,networkStatus:e,networkMessage:t,response:r})}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?e.message:"net::ERR_INTERNET_DISCONNECTED")}}var p=M(9498),g=M.n(p),f=M(8386),m=M.n(f);function y(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}let v;function b(){let e,t;/ipad|iphone/i.test(navigator.userAgent)?(e=document.createRange(),v&&e.selectNodeContents(v),t=window.getSelection(),t&&(t.removeAllRanges(),t.addRange(e)),v&&v.setSelectionRange(0,999999)):null==v||v.select()}const w=e=>{!function(e){v=document.createElement("textarea"),v.value=e,document.body.appendChild(v)}(e),b(),document.execCommand("copy"),v&&document.body.removeChild(v)};let S;S=function(){};var _=M(5314);function O(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 _.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 x(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 k(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}}}const C=/[\r\n%#()<>?[\\\]^`{|}]/g;function P(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(C,encodeURIComponent)}const j=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}))},E=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)},T=()=>null!==M.nc&&void 0!==M.nc?M.nc:"",L=!!(()=>{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 A=M(5824),R=M.n(A);const B=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();function D(e){let t=null;if(B){let r=window.localStorage.getItem(e);null!==r&&R()(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}function N(e,t){B&&window.localStorage.setItem(e,JSON.stringify(t))}function V(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}function F(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('${V(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 U(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=F(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",T()),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 G=null;async function W(){return null!=G?G: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)=>{G=r,e(r)}))}))}function z(){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:$.LANDSCAPE_PRIMARY,"-90":$.LANDSCAPE_SECONDARY,0:$.PORTRAIT_PRIMARY,180:$.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:Y(e),event:"change"}}(r);return t.prototype.addEventListener=H("addEventListener",i.delegate,i.event),t.prototype.dispatchEvent=H("dispatchEvent",i.delegate,i.event),t.prototype.removeEventListener=H("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]=K(e,r)}},type:{get:function(){var t=window.screen;return t.msOrientation||t.mozOrientation||e[window.orientation+""]||(J().matches?"landscape-primary":"portrait-primary")}},angle:{value:0}}),r}(),e}}var $;function H(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=K(s[1],i);return"addEventListener"===e&&function(e,t){var r=Z.indexOf(e);r>-1?q[r]=t:(Z.push(e),q.push(t))}(s[1],n),"removeEventListener"===e&&(a=s[1],(o=Z.indexOf(a))>-1&&(Z.splice(o,1),q.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"}($||($={}));var q=[],Z=[];function K(e,t){var r=Z.indexOf(e);return r>-1?q[r]:function(r){r.target!==t&&X(r,"target",t),r.currentTarget!==t&&X(r,"currentTarget",t),"change"!==r.type&&X(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 Y(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=J();return r&&"boolean"==typeof r.matches&&r.addListener((function(){t.dispatchEvent(Q("change"))})),t}function J(){return"function"!=typeof window.matchMedia?{}:window.matchMedia("(orientation: landscape)")}function X(e,t,r){Object.defineProperty(e,t,{value:r})}function ee(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}var te=M(122);const re="mobile"!==M.n(te)().getParser(window.navigator.userAgent).parse().getPlatformType();const ie=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=D("device_data");if(this.isValidDeviceData(e))return e;const t={platform:"web",device_id:(0,l.v4)()};return N("device_data",t),t}isValidDeviceData(e){return Boolean(e&&"string"==typeof e.device_id&&36===e.device_id.trim().length)}};function se(e,t){return Object.assign(Object.assign({},e),t)}class ae{constructor(e){var t;Object.defineProperty(this,"_baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_deviceInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_baseHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"requestInterceptors",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"interceptors",{enumerable:!0,configurable:!0,writable:!0,value:{request:{use:e=>{this.requestInterceptors.push(e)}}}}),this._baseURL=null!==(t=null==e?void 0:e.baseURL)&&void 0!==t?t:""}set deviceInfoPromise(e){this._deviceInfoPromise=e}set baseHeaders(e){this._baseHeaders=e}get baseURL(){return this._baseURL}set baseURL(e){this._baseURL=e}async request(e){return new Promise(((t,r)=>{const i=async()=>{try{if(g()(e.headers)&&null!=e.headers||(e.headers={}),e.headers=se(this._baseHeaders,e.headers),this.requestInterceptors.length)for(const t of this.requestInterceptors)t(e);let i="";!m()(e.params)&&g()(e.params)&&(i=new URLSearchParams(Object.entries(e.params).filter((([e,t])=>null!=t&&""!==t))).toString());let s=new URL(`${c(e.url)}${i?"?"+i:""}`,this._baseURL),a="GET";m()(e.method)||(a=e.method.toUpperCase());let o={};!m()(e.headers)&&g()(e.headers)&&(o=e.headers);let n=null;!m()(e.data)&&g()(e.data)&&(n=JSON.stringify(e.data),o["Content-Type"]="application/json");const l=await fetch(s.toString(),{method:a,body:"GET"===a||"HEAD"===a?null:n,headers:o,credentials:"omit"});let d={};204!==l.status&&(d=await l.json());const u={data:d,headersRaw:l.headers,headers:Object.fromEntries([...l.headers]),status:l.status,statusText:l.statusText,ok:l.ok};if(!l.ok)return void r(h.createByRequestError(u));t(u)}catch(e){r(h.createByFetchError(e))}};this._deviceInfoPromise?this._deviceInfoPromise.finally(i):i()}))}async post(e,t,r={}){return this.request({method:"post",url:e,data:t,params:r})}async get(e,t={}){return this.request({method:"get",url:e,params:t})}}const oe=new ae;function ne(e,t){return new Promise((r=>{if("sendBeacon"in navigator){const i=yl.rootStore.sessionStore.session,s=new URLSearchParams({access_token:yl.config.apiKey,session_id:(null==i?void 0:i.id)||"",x_user_agent:yl.userAgent}),a=yl.config;null!=a.appPackageId&&s.append("x_app_package_id",a.appPackageId);const o=`${d(oe.baseURL)}/${c(e)}?${s.toString()}`,n=new FormData;Object.keys(t).forEach((e=>{u(n,t[e],e)}));let l=!1;null!=Array.from&&null!=n.keys&&(l=0===Array.from(n.keys()).length),l||navigator.sendBeacon(o,n),r()}else oe.post(e,t).then((()=>r()),(()=>r()))}))}oe.interceptors.request.use((e=>{var t;const r=yl.config,i=yl.rootStore.sessionStore.session,s=null==i?void 0:i.id;return e.headers=se(null!==(t=e.headers)&&void 0!==t?t:{},{Authorization:`Bearer ${r.apiKey}`,"Accept-Language":r.lang.toString(),"X-Request-Id":(0,l.v4)(),"X-User-Agent":yl.userAgent}),r.userId&&(e.headers["X-User-Id"]=r.userId),s&&(e.headers["Auth-Session-Id"]=s),null!=r.appPackageId&&(e.headers["X-App-Package-Id"]=r.appPackageId),r.disableDeviceId||(e.headers["X-Device-Id"]=ie.deviceId),e}));const le=oe,ce={baseUrl:"https://cdn.inappstory.ru",apiUrl:"https://api.inappstory.ru",faviconApiUrl:"https://favicon.inappstory.ru"};function de(e){if(e.length>32)try{const t=function(e){const t=(e=e.replace(new RegExp("-","g"),"+").replace(new RegExp("_","g"),"/")).length;return e=function(e,t,r){return void 0===t?e:t.length>=e.length?t:r?(e+t).slice(-e.length):(t+e).substring(0,e.length)}(new Array(t%4).fill("=").join(""),e,!1),window.atob(e)}(e),r=t.charCodeAt(13);if(r>0){let e=t.substr(14,r);e=e.replace(/\0+$/,"");const i="{QQN{xuV?1Dv16j3";let s=i,a=0;for(;s.length<r;)s+=i[a],a++,a===i.length&&(a=0);let o="";for(let t=0;t<r;t++)o+=String.fromCharCode(e.charCodeAt(t)^s.charCodeAt(t));return new URL(`https://${o}`).host}}catch(e){console.error(e)}return null}class ue extends Error{constructor(e){super(`[IAM]: not found IAM for ID <${e}>`),this.name="IamNotFoundByIdError"}}class he extends Error{constructor(e){super(`[IAM]: not found IAM limit for ID <${e}>`),this.name="IamNotFoundLimitError"}}var pe=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},ge=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0};const fe="campaign_name,id,events,appearance,slides_html,type,frequency_limit,display_to,display_from,need_placeholders,has_limit",me=fe.split(",").map((e=>`messages.${e}`)).join(",");let ye=(()=>{var e;let t,r,i,s=[];return e=class{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(pe(this,s),e)})}async fetchAll({tags:e}){return(await le.get("inappmessaging",{fields:me,tag:e.join(",")})).data.messages}async fetchContext(){return(await le.get("inappmessaging/message-context",{fields:"style,widgetsData"})).data}async fetchById(e){const t=(await le.get(`inappmessaging/message/${e}`,{expand:"slides_html",fields:fe})).data;if(!t)throw new ue(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 le.post(`/inappmessaging/message/${e}/event/${t.type}`,{},t.toQueryParams())}catch(e){console.error(e)}}async fetchUserData(e){try{return(await le.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 le.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 le.post("inappmessaging/message-limit",{id:[e]})).data.find((t=>t.messageId.toString()===e.toString()));if(!t)throw new he(e);return t}},(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[x],r=[x],i=[x],ge(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),ge(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),ge(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 ve{constructor(e){Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.background=this.mapBackgroundDtoToModel(e.background)}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}}class be extends ve{constructor(e){var t,r,i,s,a,o,n,l,c,d,u;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!==(u=null===(d=e.close_button)||void 0===d?void 0:d.color)&&void 0!==u?u:"#00000080"}}}var we,Se;!function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(we||(we={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(Se||(Se={}));class _e extends ve{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:we.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:Se.End,this.horizontalPadding=null!==(n=e.horizontal_padding)&&void 0!==n?n:16}}class Oe extends ve{constructor(e){var t,r;super(e),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:we.None,this.closeBtnPosition=null!==(r=e.close_button_position)&&void 0!==r?r:Se.End}}class xe{create(e,t){switch(e){case uo.BottomSheet:return new be(t);case uo.Modal:return new _e(t);case uo.Fullscreen:return new Oe(t)}}}var ke=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},Ce=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Pe=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)},je=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 Ee=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _html(){return Pe(this,t,"f")}set _html(e){je(this,t,e,"f")}constructor(e){Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:(ke(this,s),e)}),t.set(this,ke(this,a,"")),ke(this,o),this.message=e}get html(){return this._html}updateByDto(e){this._html=this.getSlideHtml(e)}getSlideHtml(e){var t;let r=e;return r=ee(r,"{{nonce}}",null!==(t=T())&&void 0!==t?t:""),r}updatePlaceholders(e){let t=this._html;for(const r of e)t=ee(t,`%${r.key}%`,r.value);this._html=t}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],i=[_.computed],Ce(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),Ce(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 Me{async open(e){const t=await this.getOpenSessionPayload(e);return(await le.post("session/open",t,{expand:"cache",fields:"session,server_timestamp,user_key,share,preview_aspect_ratio,placeholders,image_placeholders,is_allow_ugc,is_allow_statistic_v2"})).data}async getOpenSessionPayload(e){const t=await W(),r={platform:ie.platform,device_id:ie.deviceId,features:["animation","data","deeplink","placeholder","resetTimers","gameReader","sendApi","swipeUpItems","imgPlaceholder","vod","closeStoryApi","slideTimerEndApi"].join(",")};return e.userId&&(r.user_id=e.userId,r.user_sign=e.userIdSign),t&&(r.features+=",webp"),r}}var Ie;!function(e){e.TEXT="text",e.IMAGE="image"}(Ie||(Ie={}));class Te{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 Le extends Te{constructor(e,t){super(Ie.IMAGE,e,t,0)}}class Ae extends Te{constructor(e,t){super(Ie.TEXT,e,t,2)}}class Re extends Te{constructor(e,t){super(Ie.IMAGE,e,t,1)}}class Be extends Te{constructor(e,t){super(Ie.TEXT,e,t,3)}}const De="default";class Ne{get textPlaceholders(){return this._textPlaceholders}get imagePlaceholders(){return this._imagePlaceholders}get fontsResources(){return this.resources.filter((e=>"font-face"===e.type))}constructor(e,t){Object.defineProperty(this,"sessionStore",{enumerable:!0,configurable:!0,writable:!0,value:e}),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}),this.id=t.session.id,this.expireIn=t.session.expire_in,this.userKey=t.user_key||De,this.previewAspectRatio=t.preview_aspect_ratio,this.share=t.share,this.resources=this.getResources(t),this._textPlaceholders=this.mapTextPlaceholders(t.placeholders),this._imagePlaceholders=this.mapImagePlaceholders(t.image_placeholders),this.isAllowStatisticV2=Boolean(t.is_allow_statistic_v2)}loadResources(){U(this.fontsResources)}getResources(e){return e.cache&&Array.isArray(e.cache)?e.cache:[]}mapTextPlaceholders(e){return e.map((e=>new Ae(e.name,e.default_value)))}mapImagePlaceholders(e){return e.map((e=>new Le(e.name,e.default_value)))}}class Ve extends Error{constructor(e){super(`Story with ID ${e} has already been shown to the user`),this.name="IasStoryAlreadyShownError"}}class Fe extends Error{constructor(e){super(`Like undefined on story with ID ${e}`),this.name="IasLikeUndefinedError"}}class Ue extends Error{constructor(e){super(`Share url undefined on story with ID ${e}`),this.name="IasShareUrlUndefinedError"}}var Ge,We=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},ze=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},$e=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)},He=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"}(Ge||(Ge={}));let qe=(()=>{var e,t;let r,i,s,a=[],o=[],n=[];return e=class{get _stories(){return $e(this,t,"f")}set _stories(e){He(this,t,e,"f")}constructor(e,r,i){var s;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:We(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:Ge.DEFAULT}),t.set(this,We(this,o,_.observable.array())),We(this,n),this.id=e.id,this.slug=e.feedSlug,this.hasFavorite=Boolean(e.hasFavorite),this._cover=yt.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,_.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=[_.observable],i=[_.action],s=[_.action],ze(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),ze(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),ze(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 Ze="{{__favorite__}}";class Ke extends qe{constructor(e,t){super(e,t),this._type=Ge.FAVORITE}static createByStories(e){return new Ke({feedSlug:Ze},e)}}var Qe=M(6099),Ye=M.n(Qe);class Je extends qe{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=Ge.ONBOARDING,this.tags=r.tags,this.limit=r.limit,this.filterOpenedStories()}static getDefaultSlug(){return"onboarding"}isEqualParams(e){return Ye()(this.tags,e.tags)&&this.limit===e.limit}filterOpenedStories(){this._stories=this._stories.filter((e=>!e.isOpened))}}const Xe="{{__ugc__}}";class et extends qe{constructor(e,t,r={}){super(e,t),Object.defineProperty(this,"_filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._type=Ge.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 et({feedSlug:Xe},e,t)}}var tt=M(1580),rt=M.n(tt);class it{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===Ge.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===Ge.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,tags:e.tags,slidesCount:e.slidesCount};return t.type===Ge.UGC&&(r.ugcPayload=rt()(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 st{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 le.get(r,null!=i?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 le.get(s,null!=a?a:{});if(204===o.status&&i)throw new Ve(e.toString());return o.data}async fetchStoryContext({ids:e}){const{url:t,params:r}=this.getStoryContextRequestConfig(e);return(await le.get(t,null!=r?r:{})).data}async fetchStoryCSS(){var e;const{url:t,params:r}=this.getStoryCSSRequestConfig();return null!==(e=(await le.get(t,null!=r?r:{})).data.style)&&void 0!==e?e:""}async setStoryLike(e,t){if(this.storyManager.isStatisticsDisabled)return t;const r=await le.post(`story-like/${e}`,{value:t});if(null==r.data.like)throw new Fe(e);return r.data.like}async setStoryBookmark(e,t){if(this.storyManager.isStatisticsDisabled)return t;return(await le.post(`story-favorite/${e}`,{value:t})).data.favorite}markStoryAsOpened(e,t){const r=`u/${e}/s_opened`;let i=D(r);Array.isArray(i)||(i=[]);const s=new Set(i);s.add(t),i=Array.from(s),N(r,i)}async fetchStorySharePath(e){const t=await le.get(`story-share/${e}`,{});if(!t.data.url)throw new Ue(e);return t.data.url}async updateNarrativeData(e,t){if(!this.storyManager.isStatisticsDisabled)return le.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===Xe?"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 at{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcFeed({filter:e,tags:t,testKey:r}){const i={tags:t.join(","),test:r,f:e&&JSON.stringify(e)};return(await le.get("ugc/feed",null!=i?i:{})).data}async fetchDefaultFeed({feedSlug:e,tags:t,testKey:r}){const i=`feed/${e}`,s={tags:t.join(","),test:r},a=await le.get(i,null!=s?s:{});return a.data.feedSlug=e,a.data}async fetchFavoriteFeed({tags:e}){const t={tags:e.join(","),favorite:1};return(await le.get("story",null!=t?t:{})).data}async fetchOnboardingFeed(e){const t=`feed/${e.feedSlug}/onboarding`,r={tags:e.tags.join(","),limit:e.limit},i=await le.get(t,null!=r?r:{});return i.data.feedSlug=e.feedSlug,i.data}}var ot,nt,lt,ct,dt,ut,ht;!function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(ot||(ot={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(nt||(nt={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(lt||(lt={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(ct||(ct={})),function(e){e.Medium="medium",e.High="high"}(dt||(dt={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(ut||(ut={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(ht||(ht={}));const pt={direction:ut.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:lt.START,position:ct.CARD_INSIDE_BOTTOM,display:!0,lineClamp:4},gap:10,height:178,aspectRatio:null,coverQuality:dt.High,variant:nt.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:lt.START,position:ct.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:dt.High,coverLazyLoading:!1,variant:nt.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:ot.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:lt.START,position:ct.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:dt.High,coverLazyLoading:!1,variant:nt.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 gt=M(4977),ft=M.n(gt);class mt{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 yt{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 yt;for(let r in e)e.hasOwnProperty(r)&&t.images.push(new mt(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=ft()(this.images))&&void 0!==r?r:null,t&&null!=i?i:null)}mapCoverQualityToImageType(e){switch(e){case dt.Medium:return"m";case dt.High:return"h"}}}var vt=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},bt=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},wt=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)},St=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 _t=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _html(){return wt(this,t,"f")}set _html(e){St(this,t,e,"f")}get html(){return this._html}constructor(e){t.set(this,(vt(this,s),vt(this,a,""))),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:vt(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}),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._html=this.replaceSlideNonce(e.html)}static createEmpty(){return new e({index:0,timeline:{foreground:"",background:""},duration:0,screenshot_share:!1,html:""})}replaceSlideNonce(e){var t;return ee(e,"{{nonce}}",null!==(t=T())&&void 0!==t?t:"")}updatePlaceholders(e){let t=this._html;for(const r of e)t=ee(t,`%${r.key}%`,r.value);this._html=t}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],i=[_.computed],bt(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),bt(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 Ot{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 xt=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},kt=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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)},Pt=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 jt=(()=>{var e,t,r,i,s,a,o,n,l,c;let d,u,h,p,g,f,m,y,v,b,w,S=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],M=[],I=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],V=[],F=[];return e=class{get _slidesLoaded(){return Ct(this,t,"f")}set _slidesLoaded(e){Pt(this,t,e,"f")}get _error(){return Ct(this,r,"f")}set _error(e){Pt(this,r,e,"f")}get _context(){return Ct(this,i,"f")}set _context(e){Pt(this,i,e,"f")}get _like(){return Ct(this,s,"f")}set _like(e){Pt(this,s,e,"f")}get _favorite(){return Ct(this,a,"f")}set _favorite(e){Pt(this,a,e,"f")}get _shareUrl(){return Ct(this,o,"f")}set _shareUrl(e){Pt(this,o,e,"f")}get _slides(){return Ct(this,n,"f")}set _slides(e){Pt(this,n,e,"f")}get _isOpened(){return Ct(this,l,"f")}set _isOpened(e){Pt(this,l,e,"f")}get _canBeShown(){return Ct(this,c,"f")}set _canBeShown(e){Pt(this,c,e,"f")}constructor(e){var d,u,h,p,g,f,m,y,v,b,w,_,U,G,W,z,$,H,q,Z,K,Q,Y,J;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:xt(this,S)}),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,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),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,"_title",{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,xt(this,O,!1)),r.set(this,(xt(this,x),xt(this,k,null))),i.set(this,(xt(this,C),xt(this,P,void 0))),s.set(this,(xt(this,j),xt(this,E,0))),a.set(this,(xt(this,M),xt(this,I,!1))),o.set(this,(xt(this,T),xt(this,L,null))),n.set(this,(xt(this,A),xt(this,R,[]))),l.set(this,(xt(this,B),xt(this,D,!1))),c.set(this,(xt(this,N),xt(this,V,!1))),xt(this,F),this.id=e.id,this._context=new Ot(this.id,{style:"",widgetsData:{}}),this._title=null!==(d=e.title)&&void 0!==d?d:"",this._isOpened=null!==(u=e.is_opened)&&void 0!==u&&u,this.statTitle=null!==(h=e.stat_title)&&void 0!==h?h:"",this.titleColor=null!==(p=e.title_color)&&void 0!==p?p:"",this.background=null!==(g=e.background)&&void 0!==g?g:{},this.backgroundColor=null!==(f=e.background_color)&&void 0!==f?f:"",this.slidesCount=null!==(m=e.slides_count)&&void 0!==m?m:0,this.disableClose=null!==(y=e.disable_close)&&void 0!==y&&y,this.hideInReader=null!==(v=e.hide_in_reader)&&void 0!==v&&v,this.likeFunctional=null!==(b=e.like_functional)&&void 0!==b&&b,this.favoriteFunctional=null!==(w=e.favorite_functional)&&void 0!==w&&w,this.shareFunctional=null!==(_=e.share_functional)&&void 0!==_&&_,this.needPlaceholders=null!==(U=e.need_placeholders)&&void 0!==U&&U,this.gameInstance=e.game_instance,this.hasAudio=null!==(G=e.has_audio)&&void 0!==G&&G,this.hasSwipeUp=null!==(W=e.has_swipe_up)&&void 0!==W&&W,this.stringId=null!==(z=e.string_id)&&void 0!==z?z:"",this.tags=null!==($=e.tags)&&void 0!==$?$:[],this._like=null!==(H=e.like)&&void 0!==H?H:0,this._favorite=null!==(q=e.favorite)&&void 0!==q&&q,this.deeplink=null!==(Z=e.deeplink)&&void 0!==Z?Z:"",this.hideTimeline=null!==(K=e.hide_timeline)&&void 0!==K&&K,this.ugcPayload=null!==(Q=e.payload)&&void 0!==Q?Q:{},this._shareUrl=null!==(Y=e.share_url)&&void 0!==Y?Y:null,this._image=yt.createByRawData(e.image),this._videoCover=yt.createByRawData(e.video_cover);const X=null!==(J=e.slides)&&void 0!==J?J:[];this.setSlides(X)}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}getImagesPerSlide(e){var t,r;return this.parseHtmlSlidesForMainImage(),null!==(r=null===(t=this._parsedSlideImage)||void 0===t?void 0:t[e])&&void 0!==r?r:null}parseHtmlSlidesForMainImage(){!this._parsedSlideImage&&this.slidesLoaded&&(this._parsedSlideImage=this._slides.map((e=>this.parseSlideNarrativeImageSrc(e.html)||this.parseSlideNarrativeVideoPosterSrc(e.html)||null)))}parseSlideNarrativeImageSrc(e){const t=e.match(/<[^<]*narrative-element-image.*<img[^<]*src="([^"]*)"[^<]*>/i);return null==t?void 0:t[1]}parseSlideNarrativeVideoPosterSrc(e){const t=e.match(/<[^<]*narrative-element-video.*<video[^<]*poster\-remote\-src="([^"]*)"[^<]*>/i);return null==t?void 0:t[1]}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}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._title;for(const r of e)t=ee(t,`%${r.key}%`,r.value);this._title=t}mapSlidesByDto(e){return e.map((e=>new _t(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,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;d=[_.observable],u=[_.observable],h=[_.observable],p=[_.observable],g=[_.observable],f=[_.observable],m=[_.observable],y=[_.observable],v=[_.observable],b=[_.action],w=[_.action],kt(e,null,d,{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},O,x),kt(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},k,C),kt(e,null,h,{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},P,j),kt(e,null,p,{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},E,M),kt(e,null,g,{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},I,T),kt(e,null,f,{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,A),kt(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},R,B),kt(e,null,y,{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,N),kt(e,null,v,{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,F),kt(e,null,b,{kind:"method",name:"setSlides",static:!1,private:!1,access:{has:e=>"setSlides"in e,get:e=>e.setSlides},metadata:t},null,S),kt(e,null,w,{kind:"method",name:"setCanBeShown",static:!1,private:!1,access:{has:e=>"setCanBeShown"in e,get:e=>e.setCanBeShown},metadata:t},null,S),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Et{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(){S(`[${Tt.name}]: flush statistics by timer`);this.statisticsService.getEvents().length>0?this.schedule(1e4):this.schedule(3e4),await this.statisticsService.sendData()}schedule(e){S(`[${Tt.name}]: schedule flush statistics on ${e}ms`),this.timerId=setTimeout((()=>this.flush()),e)}}class Mt{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 It{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 Tt extends(t()){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 Et(this),this.slideDurationCalculator=new Mt}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 It(1,this.lastIndex,e.storyId,e.slideIndex,t);this.addSlideEvent(r)}sendClickOnButtonEvent(e){const t=this.slideDurationCalculator.calculate(),r=new It(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)===Xe}}class Lt{async sendStatisticEvent(e){await ne("session/update",{data:e.data})}}class At{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;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=`${d(ce.apiUrl)}/${c(e)}?${t.toString()}`;navigator.sendBeacon(r)}async sendFallbackFetch(e,t){const r=new ae({baseURL:ce.apiUrl});await r.get(e,t)}}class Rt{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,Dt;!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 Nt extends Rt{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"}(Dt||(Dt={}));const Vt={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:Dt.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},Ft={borderRadius:5,loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:Vt.forceDesktopMode,forceCheckOrientation:!0};var Ut;!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(Ut||(Ut={}));const Gt={goodsWidgetRenderingType:Ut.DEFAULT,goodsList:{renderingType:Ut.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 Wt;!function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader"}(Wt||(Wt={}));const zt={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}`},$t={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:zt,twitter:zt,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",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})=>e},background:"#202125",borderRadius:20,divider:{background:"#36373b"},text:{color:"white",font:"inherit"}};var Ht,qt;!function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(Ht||(Ht={})),function(e){e.Classic="classic",e.Modern="modern"}(qt||(qt={}));const Zt={scrollStyle:Ht.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,useExperimentalModernVariant:!1,layout:qt.Classic,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:$t,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 Kt;!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"}(Kt||(Kt={}));const Qt={};var Yt,Jt,Xt,er,tr,rr;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(Yt||(Yt={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(Jt||(Jt={})),function(e){e[e.default=0]="default",e[e.onboarding=1]="onboarding",e[e.favorite=2]="favorite",e[e.direct=3]="direct"}(Xt||(Xt={})),function(e){e.list="list",e.favorite="favorite"}(er||(er={})),function(e){e.CLICK_ON_STORY="clickOnStoryLink"}(tr||(tr={})),function(e){e.LTR="ltr",e.RTL="rtl"}(rr||(rr={}));var ir=M(5136);const sr=async e=>(await fetch(e)).blob(),ar=async e=>{const t=await sr(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 or(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 nr(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 lr,cr;function dr(e,t,r,i,s,a,o,n,l,c){var d=nr("svg",{width:String(s),height:String(a),style:"background-color: #fff;"}),u=nr("foreignObject",{x:"0",y:"0",width:"100%",height:"100%"});d.appendChild(u);try{u.style.fontSize=document.body.style.fontSize}catch(e){console.error(e)}!function(){const h=t.cloneNode(!0);if(null!=i&&"string"==typeof i&&i.length>0){const e=Array.prototype.slice.call(h.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")}}u.appendChild(h);var p=[];(function(e){for(var t=[],r=0;;){var i=or(e,r,"src: url(",[" ",")","\t"]);if(null==i)break;r=i.foundAtIndex+i.value.length,t.push(i.value.replace(/["']/g,""))}return t})(r).forEach((function(e){p.push(new Promise((function(t,i){ar(e).then((function(i){r=r.replace(e,i),t()})).catch((function(e){t()}))})))})),u.querySelectorAll("img").forEach((function(e){e.crossOrigin="Anonymous",p.push(new Promise((function(t,r){ar(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()}))})))})),u.querySelectorAll("video").forEach((function(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})),u.querySelectorAll(".narrative-element-video").forEach((function(e){e.classList.add("init")})),Promise.all(p).then((function(){const t=nr("style",{});t.textContent=r,d.appendChild(t);const i=(new XMLSerializer).serializeToString(d),u=new Image;u.onload=t=>{u.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(u,0,0);const r=e.toDataURL(o,n);sr(r).then((function(t){l(t),e.remove()}))}}),e===lr.IOS?200:void 0)})).catch((e=>{console.log({image:u,encodingError:e},"onDecodeError"),c("error render svg image: "+e)}))},u.onerror=e=>{c("error render svg image: "+e)},u.setAttribute("crossOrigin","Anonymous"),u.crossOrigin="Anonymous",u.decoding="sync",u.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 ur(e,t,r,i){return new Promise((function(s,a){null==i&&(i=""),function(e,t,r,i,s,a){dr(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"}(lr||(lr={})),function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(cr||(cr={}));class hr{async getScreenShot({hideElementsSelector:e,slideContent:t}){const r=await ur(lr.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)}}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}getFilteredConfigDto(e){const t={};for(const[r,i]of Object.entries(null!=e?e:{}))null!==i&&(t[r]=i);return t}}var 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},gr=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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)},mr=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 yr=(()=>{var e,t,r;let i,s,a,o,n,l,c=[],d=[],u=[],h=[],p=[];return e=class{get _isOpened(){return fr(this,t,"f")}set _isOpened(e){mr(this,t,e,"f")}get _params(){return fr(this,r,"f")}set _params(e){mr(this,r,e,"f")}constructor(e,i){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:(pr(this,c),e)}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:i}),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,pr(this,d,!1)),r.set(this,(pr(this,u),pr(this,h,{id:"",type:cr.Social,link:""}))),Object.defineProperty(this,"currentStorySlide",{enumerable:!0,configurable:!0,writable:!0,value:(pr(this,p),null)}),this.sharingService=new hr}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:cr.Social,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(re)return void this.open({type:cr.SlideScreenshot,id:e,link:s,text:t});await this.startNativeSharing(e,a)}catch(r){console.error(r),s&&this.open({type:cr.SlideScreenshot,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:cr.Social,id:e,link:a};try{if(re)return void this.open(o);await this.startNativeSharing(e,s)}catch(e){this.open(o)}}async startNativeSharing(e,t){const r=this.sharingService.getNavigatorShareFunction();if(!r)throw new Error;try{this.story.pauseUI(e),this.runNativeSharing({id:e}),await r(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=[_.observable],s=[_.observable],a=[_.computed],o=[_.computed],n=[_.action],l=[_.action],gr(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,u),gr(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},h,p),gr(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),gr(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),gr(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),gr(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 vr,br,wr=M(6166),Sr=M(5714),_r=M.n(Sr);!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.TouchMoveHorizontal="touchMoveHorizontal",e.TouchMoveVertical="touchMoveVertical",e.LongTouchDetected="longTouchDetected"}(vr||(vr={}));class Or{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 xr{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 kr extends(t()){constructor(e){super(),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"startPoint",{enumerable:!0,configurable:!0,writable:!0,value:new Or(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=_r()(this.options,e)),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),re&&this.disable()}get isSwiping(){return this._isSwiping}get horizontalSwipeGesture(){return this._horizontalSwipeGesture}get verticalSwipeGesture(){return this._verticalSwipeGesture}enable(){re||(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.reset(),this.clearTouchStartTimeout(),this.$el.removeEventListener("touchstart",this.handleTouchStart),this.$el.removeEventListener("touchmove",this.handleTouchMove),this.$el.removeEventListener("touchend",this.handleTouchEnd),this.$el=null)}init(e){this.$el||(this.$el=e,this.$el.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),this.$el.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),this.$el.addEventListener("touchend",this.handleTouchEnd))}handleTouchStart(e){this.enabled&&!this.touched&&(this.touched=!0,this.clearTouchStartTimeout(),this.startPoint=this.getPointByEvent(e),this.emit(vr.TouchStart,new xr(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 xr(t.x,t.y,r.x,r.y);this.isThresholdExceed(r)&&(this._isSwiping=!0),this._isSwiping&&(this.emit(vr.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(vr.TouchEnd,new xr(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(vr.LongTouchDetected,e)}),this.options.touchStartTimeout))}getPointByEvent(e){if(e instanceof TouchEvent){const t=e.changedTouches[0];return new Or(t.pageX,t.pageY)}return new Or(e.pageX,e.pageY)}getDeltaPoint(e){const t=e.x-this.startPoint.x,r=e.y-this.startPoint.y;return new Or(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(vr.TouchMoveVertical,e)}handleHorizontalSwipeGesture(e){this._horizontalSwipeGesture&&!this._horizontalSwipeGestureDisabled&&this.emit(vr.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"}(br||(br={}));const Cr=br.Bottom;class Pr{constructor(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:Cr}),Object.defineProperty(this,"getMountPoint",{enumerable:!0,configurable:!0,writable:!0,value:()=>document.body}),this.initializeOptions(e)}show(e){return this.content=e,this.destroy(),this.createAndShowToast(),!0}hide(){const e=document.getElementById("toast_container");if(!e)return!1;clearTimeout(this.timeoutId),e.className+=" toast_fadeout";return this.addAnimationEndListeners(e,(()=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})),!0}destroy(){var e;this.timeoutId&&clearTimeout(this.timeoutId);const t=document.getElementById("toast_container");null===(e=null==t?void 0:t.parentNode)||void 0===e||e.removeChild(t)}initializeOptions(e){if(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.getMountPoint&&(this.getMountPoint=e.getMountPoint),e.position){const t=e.position.toLowerCase();this.position="top"===t||"bottom"===t?t:Cr}}createAndShowToast(){const e=this.createToastContainer(),t=this.createToastElement(),r=this.createToastTextElement();t.appendChild(r),e.appendChild(t),this.getMountPoint().appendChild(e),this.timeoutId=window.setTimeout((()=>this.hide()),this.duration)}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 jr=M(7326),Er=M.n(jr);class Mr{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:Er()((()=>{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===rr.LTR?1:-1;t.scrollLeft=r*e.x,t.scrollTop=e.y}scrollWithAnimation(e,t){const r=this.slider.getElementRef(),i=this.slider.dir===rr.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 Ir{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:Er()((()=>{this.isAnimating=!1,this.slider.notifyScrollEnd()}),200)}),Object.defineProperty(this,"debouncedTryMouseWheelEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:Er()((()=>{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,L),e.addEventListener("touchstart",this.handleMouseDown,L)}scrollTo(e){const t=this.slider.getElementRef(),r=this.slider.dir===rr.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===rr.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,L),e.removeEventListener("touchstart",this.handleMouseDown,L),e.removeEventListener("mouseup",this.handleMouseUp,L),e.removeEventListener("touchend",this.handleMouseUp,L),e.removeEventListener("mousemove",this.handleMouseMove,L),e.removeEventListener("touchmove",this.handleMouseMove,L),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,L),window.addEventListener("touchend",this.handleMouseUp,L),window.addEventListener("mousemove",this.handleMouseMove,L),window.addEventListener("touchmove",this.handleMouseMove,L)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.slider.notifyScrollEnd(),window.removeEventListener("mouseup",this.handleMouseUp,L),window.removeEventListener("touchend",this.handleMouseUp,L),window.removeEventListener("mousemove",this.handleMouseMove,L),window.removeEventListener("touchmove",this.handleMouseMove,L))}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===rr.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 Tr;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(Tr||(Tr={}));class Lr extends e.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:Tr.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:rr.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===Tr.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===rr.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 Ir(this):new Mr(this)}}class Ar{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,"scrollbarHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get width(){const e=this.window.document.documentElement.clientWidth;return Math.abs(this.window.innerWidth-e)}enable(){this.scrollbarHidden||(this.disableOverFlow(),this.disablePullToRefresh(),this.setBodyContainer(),this.setElementAttributes("body","paddingRight",(e=>e+this.width)),this.scrollbarHidden=!0)}disable(){this.scrollbarHidden&&(this.resetElementAttributes("html","overflow"),this.resetElementAttributes("body","overflow"),this.resetElementAttributes("body","paddingRight"),this.resetBodyContainer(),this.enablePullToRefresh(),this.scrollbarHidden=!1)}disablePullToRefresh(){if(this.style)return;this.style=this.window.document.createElement("style"),this.style.setAttribute("nonce",T()),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 Rr=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Br=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},Dr=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)},Nr=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;let r,i=[],s=[];return e=class{get _disabledNextClick(){return Dr(this,t,"f")}set _disabledNextClick(e){Nr(this,t,e,"f")}constructor(e,r,a,o){Object.defineProperty(this,"_story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_index",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:o}),t.set(this,Br(this,i,!1)),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:(Br(this,s),new wr.Mutex)}),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 state(){return this.slideApi.state}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}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(){const e=await this.mutex.acquire();let t=!1,r=0;const i=setTimeout((()=>{this.story.showLoaderScreen(),t=!0,r=Date.now()}),500);try{S(`[SLIDE][INIT]:${this.story.id}:${this.slide.index}`);const{result:e,reason:t}=await this.slideApi.showSlide(this.html);if(!e)throw new Error(t)}catch(e){this.handleSlideError(e)}finally{clearTimeout(i),await this.cleanupLoaderIfNeeded(Date.now()-r,t),e()}}async start(){const e=await this.mutex.acquire();try{S(`[SLIDE][START]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideStart({muted:this._story.muted}),this.story.touchController.on(vr.TouchEnd,this.handleTouchEnd)}catch(e){this.handleSlideError(e)}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.story.hideErrorScreen(),this.story.showLoaderScreen(),await this.slideApi.slideRestart({muted:this._story.muted})}catch(e){this.handleSlideError(e)}finally{this.story.hideLoaderScreen(),e()}}async resumeByApp(){const e=await this.mutex.acquire();try{S(`[SLIDE][RESUME-BY-APP]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByApp(){const e=await this.mutex.acquire();try{S(`[SLIDE][PAUSE-BY-APP]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{S(`[SLIDE][RESUME-BY-USER]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{S(`[SLIDE][PAUSE-BY-USER]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(e){const t=await this.mutex.acquire();try{S(`[SLIDE][STOP]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideStop(e),this.story.touchController.off(vr.TouchEnd,this.handleTouchEnd)}catch(e){this.handleSlideError(e)}finally{t()}}showLayerByIndex(e){this.slideApi.showLayer(e)}canGoNext(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"forward");return e}canGoPrev(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"backward");return e}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(){await this.slideApi.destroy()}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.error(e),this.story.showErrorScreen(),this.story.touchController.off(vr.TouchEnd,this.handleTouchEnd)}delay(e){return new Promise((t=>setTimeout(t,e)))}async cleanupLoaderIfNeeded(e,t){t&&await this.delay(Math.max(2e3-e,0)),this.story.hideLoaderScreen()}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],Rr(e,null,r,{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},i,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Fr{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},Gr=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0};let Wr=(()=>{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),_.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=[_.computed],r=[_.action],i=[_.action],Gr(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),Gr(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),Gr(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 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},$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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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 Zr=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,u,h,p,g,f,m,y,v,b=[],w=[],S=[],O=[],x=[],k=[],C=[];return e=class{get _userPaused(){return Hr(this,t,"f")}set _userPaused(e){qr(this,t,e,"f")}get _systemPause(){return Hr(this,r,"f")}set _systemPause(e){qr(this,r,e,"f")}get _uiPause(){return Hr(this,i,"f")}set _uiPause(e){qr(this,i,e,"f")}constructor(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:(zr(this,b),e)}),t.set(this,zr(this,w,!1)),r.set(this,(zr(this,S),zr(this,O,new Wr))),i.set(this,(zr(this,x),zr(this,k,new Wr))),zr(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._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=[_.observable],a=[_.observable],o=[_.observable],n=[_.computed],l=[_.computed],c=[_.computed],d=[_.computed],u=[_.computed],h=[_.action],p=[_.action],g=[_.action],f=[_.action],m=[_.action],y=[_.action],v=[_.action],$r(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),$r(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,x),$r(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},k,C),$r(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),$r(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),$r(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),$r(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),$r(e,null,u,{kind:"getter",name:"isUserPaused",static:!1,private:!1,access:{has:e=>"isUserPaused"in e,get:e=>e.isUserPaused},metadata:t},null,b),$r(e,null,h,{kind:"method",name:"pauseUser",static:!1,private:!1,access:{has:e=>"pauseUser"in e,get:e=>e.pauseUser},metadata:t},null,b),$r(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),$r(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),$r(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),$r(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),$r(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),$r(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 Kr=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,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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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)},Jr=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,s;let a,o,n,l,c,d,u,h,p,g,f=[],m=[],y=[],v=[],b=[],w=[],S=[],O=[],x=[];return e=class{get _hasShare(){return Yr(this,t,"f")}set _hasShare(e){Jr(this,t,e,"f")}get _hasFavorite(){return Yr(this,r,"f")}set _hasFavorite(e){Jr(this,r,e,"f")}get _hasLike(){return Yr(this,i,"f")}set _hasLike(e){Jr(this,i,e,"f")}get _height(){return Yr(this,s,"f")}set _height(e){Jr(this,s,e,"f")}constructor(e,a,o,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Kr(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,Kr(this,m,!1)),r.set(this,(Kr(this,y),Kr(this,v,!1))),i.set(this,(Kr(this,b),Kr(this,w,!1))),s.set(this,(Kr(this,S),Kr(this,O,0))),Kr(this,x),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}get hasShare(){return this._hasShare}get hasFavorite(){return this._hasFavorite}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{this.storyManager.emitEvent(new Ss(this.story,{value:1===e})),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{this.storyManager.emitEvent(new bs(this.story,{value:-1===e})),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{this.storyManager.emitEvent(new ws(this.story,{value:e})),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;if(this.storyManager.emitEvent(new _s(this.story)),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),this.storyManager.emitEvent(new Os(this.story,{url:e}));const t={title:this.story.title,text:"",url:e};this.sharePanel.shareText({shareId:"story-share",config:t,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=[_.observable],o=[_.observable],n=[_.observable],l=[_.observable],c=[_.computed],d=[_.computed],u=[_.action],h=[_.action],p=[_.action],g=[_.action],Qr(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),Qr(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),Qr(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),Qr(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,x),Qr(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),Qr(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),Qr(e,null,u,{kind:"method",name:"setLike",static:!1,private:!1,access:{has:e=>"setLike"in e,get:e=>e.setLike},metadata:t},null,f),Qr(e,null,h,{kind:"method",name:"setDislike",static:!1,private:!1,access:{has:e=>"setDislike"in e,get:e=>e.setDislike},metadata:t},null,f),Qr(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),Qr(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 ei,ti=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},ri=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},ii=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)},si=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"}(ei||(ei={}));let ai=(()=>{var t,r;let i,s=e.EventEmitter,a=[],o=[];return t=class extends s{get params(){return ii(this,r,"f")}set params(e){si(this,r,e,"f")}constructor(e,t,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:t}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),r.set(this,ri(this,a,{elementId:"",target:""})),ri(this,o),this.storyManager=e,this.story=t,this.storyReaderStatisticV2Service=i}close(){this.story.touchController.enable(),this.story.resumeUI(this),this.story.activeSlide.closeLegacyGoodsWidget(this.params.elementId),this.emit(ei.Close)}open(e){var t;this.story.touchController.disable(),this.story.pauseUI(this),this.params=e,this.emit(ei.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 ja({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 Pa({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[]}}},r=new WeakMap,(()=>{var e;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=s[Symbol.metadata])&&void 0!==e?e:null):void 0;i=[_.observable],ti(t,null,i,{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},a,o),r&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),t})();class oi{constructor(e,t){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lastSlide",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"activeSlide",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isInitialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_activeSlideStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0})}get activeSlideDuration(){return Date.now()-this._activeSlideStartTime}async init(){var e;this.isInitialized||(this.isInitialized=!0,await(null===(e=this.activeSlide)||void 0===e?void 0:e.init()))}async start(){var e;this.isActive||(this.isActive=!0,await(null===(e=this.activeSlide)||void 0===e?void 0:e.start()),this._activeSlideStartTime=Date.now())}async restart(){this.isActive&&this.activeSlide&&await this.activeSlide.restart()}async stop(){this.isActive&&(this.isActive=!1,this.slideApiHandlers.clearNarrativeSessionDataCache(),this.story.resumeAll(),await this.story.activeSlide.stop({prepareForRestart:1}))}async onSlideChange(e){var t;this.lastSlide=this.activeSlide,this.activeSlide=e,this.isInitialized&&await e.init(),this.isActive&&(this.story.resumeAll(),await(null===(t=this.lastSlide)||void 0===t?void 0:t.stop({prepareForRestart:2})),await e.start(),this._activeSlideStartTime=Date.now())}async destroy(){var e,t;this.slideApiHandlers.clearNarrativeSessionDataCache(),this.isInitialized=!1,this.isActive=!1,await(null===(e=this.activeSlide)||void 0===e?void 0:e.stop({prepareForRestart:2})),await(null===(t=this.activeSlide)||void 0===t?void 0:t.destroy())}}var ni;!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(ni||(ni={}));class li extends e.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(ni.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(ni.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(ni.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(ni.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(ni.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(ni.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 ci=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},di=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},ui=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)},hi=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 pi=(()=>{var e,t;let r,i,s,a,o=[],n=[],l=[];return e=class{get _hiddenTimeline(){return ui(this,t,"f")}set _hiddenTimeline(e){hi(this,t,e,"f")}constructor(e){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:(ci(this,o),e)}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new li}),t.set(this,ci(this,n,!1)),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:(ci(this,l),({forceEnd:e})=>{e||this.story.activeSlide.notifyTimerEnd()})}),this.timer.on(ni.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(ni.Complete,this.handleTimerComplete)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],i=[_.computed],s=[_.action],a=[_.action],di(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),di(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),di(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),di(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 gi=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},fi=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},mi=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)},yi=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 vi=(()=>{var e,t,r,i;let s,a,o,n=[],l=[],c=[],d=[],u=[],h=[];return e=class{get _isOpened(){return mi(this,t,"f")}set _isOpened(e){yi(this,t,e,"f")}get _id(){return mi(this,r,"f")}set _id(e){yi(this,r,e,"f")}get _config(){return mi(this,i,"f")}set _config(e){yi(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,fi(this,n,!1)),r.set(this,(fi(this,l),fi(this,c,null))),i.set(this,(fi(this,d),fi(this,u,null))),fi(this,h),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 ua({widget_id:e,widget_label:String(t.configV2.main.question.text.value).trim()}),!0)}completeInput(e){this._id&&this._config&&this.storyReaderStatisticV2Service.sendEvent(new ha({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=[_.observable],a=[_.observable],o=[_.observable],gi(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),gi(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),gi(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},u,h),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();const bi=310/480,wi=428/805;var Si,_i=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},xi=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)},ki=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.ShowToast="showToast"}(Si||(Si={}));let Ci=(()=>{var e,t,r,i,a,o;let n,l,c,d,u,h,p,g,f,m,y,v,b,w,S,O,x,k,C,P,j,E=s,M=[],I=[],L=[],A=[],R=[],B=[],D=[],N=[],V=[],F=[],U=[];return e=class extends E{get _activeSlideIndex(){return xi(this,t,"f")}set _activeSlideIndex(e){ki(this,t,e,"f")}get _slides(){return xi(this,r,"f")}set _slides(e){ki(this,r,e,"f")}get _needShowErrorScreen(){return xi(this,i,"f")}set _needShowErrorScreen(e){ki(this,i,e,"f")}get _needShowLoaderScreen(){return xi(this,a,"f")}set _needShowLoaderScreen(e){ki(this,a,e,"f")}get _$root(){return xi(this,o,"f")}set _$root(e){ki(this,o,e,"f")}constructor(e,s,n,l,c,d){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(_i(this,M),e)}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:s}),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,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:d}),t.set(this,_i(this,I,0)),r.set(this,(_i(this,L),_i(this,A,[]))),i.set(this,(_i(this,R),_i(this,B,!1))),a.set(this,(_i(this,D),_i(this,N,!1))),o.set(this,(_i(this,V),_i(this,F,null))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(_i(this,U),null)}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storySlidesReactionDisposer",{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,"lifecycleManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"initOnce",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{this._$root=e}}),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 Zr(this),this.touchController=this.storyReader.touchController,this.slideApiHandlers=this.storySlideApiHandlersFactory.create(this),this.goodsWidget=new ai(this.storyManager,this,this.storyReaderStatisticV2Service),this.textInput=new vi(this,this.storyReaderStatisticV2Service),this.timeline=new pi(this),this.lifecycleManager=new oi(this,this.slideApiHandlers),this.sharePanel=new yr(this,this.storyReader.touchController),this.actionPanel=new Xr(this.storyManager,this,this.sharePanel,this.storyReaderStatisticV2Service),this.storySlidesReactionDisposer=this.observeStorySlides()}get needShowErrorScreen(){return this._needShowErrorScreen||this.error}get needShowLoaderScreen(){return!this.story.canBeShown||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 tags(){return this.story.tags}get displayStrategy(){return this.storyReader.displayStrategy}get canBeShown(){return this.story.canBeShown&&this.slides.length>0}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(){var e;return null!==(e=this.slides[this._activeSlideIndex])&&void 0!==e?e:new Fr}get slidesCount(){return this.story.slidesCount}get displayedSlideImage(){return this.story.getImagesPerSlide(this._activeSlideIndex)}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 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}async showSlide(e){if(this.activeSlideIndex===e)return;const t=this.activeSlideIndex;this._activeSlideIndex=e,await this.lifecycleManager.onSlideChange(this.activeSlide),this.emitSlideV1Stat(this.activeSlideIndex),this.emitSlideV2Stat(t,this.lifecycleManager.activeSlideDuration)}markAsOpened(){this.storyManager.rootStore.storyStore.markIsOpenedById(this.story.id)}markWasShown(){this.story.markWasShown()}setError(e){this.story.setError(e)}async reset(){this.textInput.close(),await this.slideApiHandlers.resetStory(this.id)}async reload(){return this.storyReader.reloadStory(this)}nextSlideOrStory(){this.reachEnd?this.storyReader.nextStoryWithAnimation():this.nextSlide()}async prevSlideOrStory(){this.reachStart&&this.storyReader.reachStart?await this.lifecycleManager.restart():this.reachStart?this.storyReader.prevStoryWithAnimation():this.prevSlide()}mute(){this.storyReader.mute(),this.activeSlide.mute()}unmute(){this.storyReader.unmute(),this.activeSlide.unmute()}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)}showToast(e){this.emit(Si.ShowToast,e)}detachRoot(){this._$root=null}async init(){return this.initOnce||this.story.canBeShown||(this.showLoaderScreen(),this.initOnce=!0),this.lifecycleManager.init()}async start(){return document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("keydown",this.handleKeydown),this.lifecycleManager.start()}async stop(){return document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),this.lifecycleManager.stop()}canGoNext(){return this.activeSlide.canGoNext()}canGoPrev(){return this.activeSlide.canGoPrev()}async destroy(){var e;this._$root=null,document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),this.storySlidesReactionDisposer(),this.sharePanel.close(),this.textInput.close(),this.timeline.destroy(),this.goodsWidget.close(),await this.lifecycleManager.destroy(),null===(e=this.slideApi)||void 0===e||e.destroy()}notifyPauseStateChange(){this.pauseManager.isUserPaused||(this.pauseManager.isAppPaused?this.activeSlide.pauseByApp():this.activeSlide.resumeByApp())}emitSlideV2Stat(e,t){var r;this.storyReaderStatisticV2Service.sendSlideEvent({durationMs:t,storyId:this.id,activeSlideIndex:e,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}emitSlideV1Stat(e){this.storyManager.emitEvent(new xs(this)),this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:this.id,slideIndex:e})}observeStorySlides(){return(0,_.reaction)((()=>({storySlides:this.story.slides,canBeShown:this.story.canBeShown&&Boolean(this._$root)})),(({storySlides:e,canBeShown:t})=>this._$root&&t&&e.length?(this.slideApi=this.createSlideApi(this._$root),this.createSlidesViewModels(e,this.slideApi)):[]),{fireImmediately:!0})}createSlideApi(e){return new ir.SlideApi(this.slideApiHandlers,{root:e,slideRatio:bi,isFullscreen:!1,nonce:T(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:this.actionPanel.height})}async createSlidesViewModels(e,t){this._slides=e.map(((e,r)=>new Vr(this,r,t,e))),await this.lifecycleManager.onSlideChange(this.activeSlide)}handleSpaceKeydown(e){"Space"===e.code&&(this.pauseState.isUserPaused?this.resumeUser():this.pauseUser())}handleMKeydown(e){"KeyM"===e.code&&(this.muted?this.unmute():this.mute())}},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=E[Symbol.metadata])&&void 0!==t?t:null):void 0;n=[_.observable],l=[_.observable],c=[_.observable],d=[_.observable],u=[_.observable],h=[_.computed],p=[_.computed],g=[_.computed],f=[_.computed],m=[_.computed],y=[_.computed],v=[(t=_.computed).struct.bind(t)],b=[_.computed],w=[_.computed],S=[_.action],O=[_.action],x=[_.action],k=[_.action],C=[_.action],P=[_.action],j=[_.action],Oi(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},I,L),Oi(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},A,R),Oi(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),Oi(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,V),Oi(e,null,u,{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,M),Oi(e,null,p,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:r},null,M),Oi(e,null,g,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:r},null,M),Oi(e,null,f,{kind:"getter",name:"displayedSlideImage",static:!1,private:!1,access:{has:e=>"displayedSlideImage"in e,get:e=>e.displayedSlideImage},metadata:r},null,M),Oi(e,null,m,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,M),Oi(e,null,y,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,M),Oi(e,null,v,{kind:"getter",name:"pauseState",static:!1,private:!1,access:{has:e=>"pauseState"in e,get:e=>e.pauseState},metadata:r},null,M),Oi(e,null,b,{kind:"getter",name:"isNextDisabled",static:!1,private:!1,access:{has:e=>"isNextDisabled"in e,get:e=>e.isNextDisabled},metadata:r},null,M),Oi(e,null,w,{kind:"getter",name:"isPrevDisabled",static:!1,private:!1,access:{has:e=>"isPrevDisabled"in e,get:e=>e.isPrevDisabled},metadata:r},null,M),Oi(e,null,S,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,M),Oi(e,null,O,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,M),Oi(e,null,x,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,M),Oi(e,null,k,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,M),Oi(e,null,C,{kind:"method",name:"showSlide",static:!1,private:!1,access:{has:e=>"showSlide"in e,get:e=>e.showSlide},metadata:r},null,M),Oi(e,null,P,{kind:"method",name:"markAsOpened",static:!1,private:!1,access:{has:e=>"markAsOpened"in e,get:e=>e.markAsOpened},metadata:r},null,M),Oi(e,null,j,{kind:"method",name:"markWasShown",static:!1,private:!1,access:{has:e=>"markWasShown"in e,get:e=>e.markWasShown},metadata:r},null,M),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();var Pi,ji=M(56),Ei=M.n(ji);class Mi{async openGame({gameInstanceId:e,gameOptions:t}){const r={fields:"splashScreen,splashLandscapeScreen,splashLottieScreen,screenOptions,config,resources,url,downloadUrl,instanceUserData,canTryReloadCount,loggerLevel,lottie"};t&&g()(t)&&null!=t.demoMode&&(r.demoMode=Boolean(t.demoMode));return(await le.post(`game/${e}/launch?expand=config`,r)).data}}!function(e){e.TEXT="text",e.IMAGE="image"}(Pi||(Pi={}));class Ii{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.7.3",this.apiBaseUrl=ce.apiUrl,this.userAgent=e.userAgent,this.appPackageId=r.appPackageId,this.deviceId=ie.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 Ie.TEXT:return Pi.TEXT;case Ie.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 Ti{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 Li{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 Ai{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 Ri{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 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}),this.url=e.url,this.size=e.size,this.sha1=e.sha1}}class Ni{constructor(e,t){var r,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}),this.splashScreen=t.splashScreen?new Di(t.splashScreen):void 0,this.splashLandscapeScreen=t.splashLandscapeScreen?new Ri(t.splashLandscapeScreen):void 0,this.splashLottieScreen=t.splashLottieScreen?new Bi(t.splashLottieScreen):void 0,this.screenOptions=new Ai(t.screenOptions),this.config=new Ti(t.config),this.resources=null!==(i=null===(r=t.resources)||void 0===r?void 0:r.map((e=>new Li(e))))&&void 0!==i?i:[],this.url=t.url,this.downloadUrl=t.downloadUrl,this.instanceUserData=t.instanceUserData,this.clientConfig=new Ii(e),this.canTryReloadCount=t.canTryReloadCount,this.loggerLevel=t.loggerLevel,this.lottie=t.lottie?{src:t.lottie.src}:void 0}toInitDto(e){return _r()(this.config.toJSON(),{clientConfig:Object.assign({fullScreen:!1,screenOrientation:this.screenOptions.orientation,safeAreaInsets:e.safeAreaInsets,widescreen:e.isWidescreen,dir:e.dir,nonce:T(),sdkFeatures:{gameShouldForegroundCallback:!0}},this.clientConfig.toJSON())})}}class Vi extends e.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)}messageListener(e){if(e.origin!==this.origin)return;const[t,...r]=e.data;try{if(!Array.isArray(e.data))throw new Error(`Invalid MessageEvent data format ${e.data}`);this.emit(t,...r)}catch(e){console.error(e)}}sendMessage(e,t){var r;null===(r=this.iframe.contentWindow)||void 0===r||r.postMessage([e,t],this.origin)}pauseGameUI(){null==this||this.sendMessage("cb",{cb:"pauseUI",arguments:JSON.stringify([])})}resumeGameUI(){null==this||this.sendMessage("cb",{cb:"resumeUI",arguments:JSON.stringify([])})}shareComplete(e,t){this.sendMessage("shareComplete",{id:e,isSuccess:t})}closeGameReader(){this.sendMessage("closeGameReader")}initGame(e){this.sendMessage("cb",{cb:"initGame",arguments:JSON.stringify([e])})}sendGameCenterEventByApiRequest(e,t){this.sendMessage("cb",{cb:e,plainData:t})}notifyGameCanBeStarted(){this.sendMessage("gameShouldForeground")}destroy(){window.removeEventListener("message",this.messageListener,!1),this.removeAllListeners()}}class Fi{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=g()(this.instanceUserData)?this.instanceUserData:{};try{const r=JSON.parse(null!==(e=window.localStorage.getItem(this.key))&&void 0!==e?e:"{}");g()(r)&&(t=r)}catch(e){console.error(e)}return _r()(t,r)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class Ui{constructor(e,t){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"game",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){const{id:t,callback:r}=JSON.parse(e),i=new Fi(this.game.clientConfig.userKey,this.game.config.gameInstanceId,this.game.instanceUserData).get();this.gameCenterMessageService.sendMessage("cb",{cb:r,arguments:JSON.stringify([t,JSON.stringify(i)])})}}class Gi{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"game",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{const t=JSON.parse(e);if(new Fi(this.game.clientConfig.userKey,this.game.config.gameInstanceId,this.game.instanceUserData).set(t.data),this.storyManager.isStatisticsDisabled||!t.sendToServer)return;await le.post(`game/${t.gameInstanceId}/instance-user-data`,{data:t.data})}catch(e){console.error(e)}}}var Wi;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(Wi||(Wi={}));class zi{constructor(e,t,r){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"shareNotifier",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e,t){var r,i,s;let a=null!==(r=null==t?void 0:t.url)&&void 0!==r?r:t.text,o=[];t.files&&Array.isArray(t.files)&&t.files.length>0&&(o=await Promise.all(t.files.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)))));const n={url:null!=a?a:void 0,files:o.length>0?o:void 0,text:null!==(i=t.text)&&void 0!==i?i:void 0,title:null!==(s=t.title)&&void 0!==s?s:void 0};if(!(n.files&&n.files.length>0||n.url))return void this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!1});let l=navigator.share;if(!navigator.share&&window.parent&&window.parent.navigator.share&&(l=window.parent.navigator.share),!this.desktopMode&&l)try{if(!l)return;l(n).then((()=>this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!0}))).catch((()=>this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!1})))}catch(t){console.error(t),this.openSharePanel({shareConfig:n,sharePath:a,shareId:e})}else this.openSharePanel({shareConfig:n,sharePath:a,shareId:e})}openSharePanel({shareConfig:e,sharePath:t,shareId:r}){let i=Wi.Social,s=t;e.files&&e.files.length>0&&(i=Wi.SlideScreenshot,s=URL.createObjectURL(e.files[0])),this.shareNotifier.notifyOpenSharePanel({shareId:r,shareType:i,shareLink:s})}}class $i{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 Hi{constructor(e){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e})}handle(e){const t=JSON.parse(e);if(!g()(t))return;const{id:r,storyId:i,callback:s}=t;let a=new $i(i).get();this.gameCenterMessageService.sendMessage("cb",{cb:s,arguments:JSON.stringify([r,JSON.stringify(a)])})}}class qi{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async handle(e){try{const t=JSON.parse(e);if(!g()(t))return;if(new $i(t.storyId).set(t.data),this.storyManager.isStatisticsDisabled||!t.sendToServer)return;await le.request({url:"story-data/"+t.storyId,method:"put",data:{data:t.data}})}catch(e){console.error(e)}}}var Zi,Ki=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},Qi=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Yi=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)},Ji=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="close",e.OpenSharePanel="openSharePanel"}(Zi||(Zi={}));let Xi=(()=>{var e,t,r,i,a,o,n,l,c;let d,u,h,p,f,m,y,v,b,w,S,O,x,k,C,P,j,E=s,M=[],I=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],V=[],F=[],U=[],G=[],W=[],z=[],$=[],H=[];return e=class extends E{get _isOpened(){return Yi(this,t,"f")}set _isOpened(e){Ji(this,t,e,"f")}get _isGameInited(){return Yi(this,r,"f")}set _isGameInited(e){Ji(this,r,e,"f")}get _isGameLoading(){return Yi(this,i,"f")}set _isGameLoading(e){Ji(this,i,e,"f")}get _gameInstanceId(){return Yi(this,a,"f")}set _gameInstanceId(e){Ji(this,a,e,"f")}get _game(){return Yi(this,o,"f")}set _game(e){Ji(this,o,e,"f")}get _gameError(){return Yi(this,n,"f")}set _gameError(e){Ji(this,n,e,"f")}get _closeBtnVisible(){return Yi(this,l,"f")}set _closeBtnVisible(e){Ji(this,l,e,"f")}get _gameShouldBeShown(){return Yi(this,c,"f")}set _gameShouldBeShown(e){Ji(this,c,e,"f")}constructor(s,d){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Ki(this,M),s)}),Object.defineProperty(this,"gameCenterApi",{enumerable:!0,configurable:!0,writable:!0,value:d}),t.set(this,Ki(this,I,!1)),r.set(this,(Ki(this,T),Ki(this,L,!1))),i.set(this,(Ki(this,A),Ki(this,R,!1))),a.set(this,(Ki(this,B),Ki(this,D,null))),o.set(this,(Ki(this,N),Ki(this,V,null))),n.set(this,(Ki(this,F),Ki(this,U,null))),l.set(this,(Ki(this,G),Ki(this,W,!1))),c.set(this,(Ki(this,z),Ki(this,$,!1))),Object.defineProperty(this,"initGameRetryAttempts",{enumerable:!0,configurable:!0,writable:!0,value:(Ki(this,H),0)}),Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"safeAreaInsets",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,bottom:0,left:0,right:0}}),Object.defineProperty(this,"openGameOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new Ar(window)}),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.storyManager.setViewModel(e.id,this)}notifyShareCompleted({shareId:e,isSuccess:t}){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.shareComplete(e,t)}notifyOpenSharePanel({shareId:e,shareType:t,shareLink:r}){this.emit(Zi.OpenSharePanel,{shareId:e,shareType:t,shareLink:r})}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 gameInstanceId(){return this._gameInstanceId}get isOpened(){return this._isOpened}get gameShouldBeShown(){return this._gameShouldBeShown}get dir(){return this.storyManager.config.dir}async openGame(e,t={}){if((e=e.toString())!==this._gameInstanceId){if(this.isOpened)throw new Error(`Close the launched game with ID "${this.gameInstanceId}"`);this._gameInstanceId=e,this._isOpened=!0,this.openGameOptions=t,this._gameShouldBeShown=!1,await this.launchGameById(e),this.scrollbarHelper.enable()}else console.warn(`[IAS]: Prevented reopening of game with ID ${e}`)}async closeGame(){var e;return!!this._isOpened&&(this._isGameInited?null===(e=this.gameCenterMessageService)||void 0===e||e.closeGameReader():this.handleGameComplete({}),!0)}reload(){this._game=null,this.gameInstanceId?this.launchGameById(this.gameInstanceId):console.error("The game instance ID is undefined")}sendGameCenterEventByApiRequest(e,t){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.sendGameCenterEventByApiRequest(e,t)}setSafeAreaInsets(e){this.safeAreaInsets=e}setGameCenterIframe(e,{isWidescreen:t}){var r;if(!this._game)throw new Error("GameCenter iframe setup error");if(this._isGameInited)return;null===(r=this.gameCenterMessageService)||void 0===r||r.destroy();const i=new URL(this._game.url).origin;this.gameCenterMessageService=new Vi(e,i),this.initGameCenter({isWidescreen:t,gameCenterMessageService:this.gameCenterMessageService,game:this._game})}pauseGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.pauseGameUI()}resumeGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.resumeGameUI()}notifyGameCanBeStarted(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.notifyGameCanBeStarted()}destroy(){var t;this.scrollbarHelper.disable(),null===(t=this.gameCenterMessageService)||void 0===t||t.destroy(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.storyManager.deleteViewModel(e.id),this.completeGame()}async launchGameById(e){try{this._gameError=null,this._isGameLoading=!0,await this.storyManager.rootStore.sessionStore.open();const t=await this.gameCenterApi.openGame({gameInstanceId:e,gameOptions:this.openGameOptions});this._game=new Ni(this.storyManager,t)}catch(e){this._gameError=e}}initGameCenter({isWidescreen:e,gameCenterMessageService:t,game:r}){this.handleGameCenterEvents(r,t);const i=r.toInitDto({safeAreaInsets:this.safeAreaInsets,dir:this.dir,isWidescreen:e});t.initGame(i)}handleGameCenterEvents(e,t){t.on("gameLoaded",this.handleGameLoaded.bind(this)).on("gameComplete",this.handleGameComplete.bind(this)).on("sendApiRequest",this.handleSendApiRequest.bind(this)).on("openUrl",this.handleOpenUrl.bind(this)).on("event",this.handleGameEvent.bind(this)).on("reloadGameReader",this.handleReloadGameReader.bind(this)).on("gameLoadFailed",this.handleGameLoadFailed.bind(this)).on("gameShouldForegroundCallback",this.handleGameShouldBeShown.bind(this));const r={share:new zi(t,this,re),storySetLocalData:new qi(this.storyManager),storyGetLocalData:new Hi(t),gameInstanceGetLocalData:new Ui(t,e),gameInstanceSetLocalData:new Gi(this.storyManager,e)};for(const[e,i]of Object.entries(r))t.on(e,((...e)=>i.handle(...e)))}handleGameShouldBeShown(e){this._gameShouldBeShown=!0;const t=JSON.parse(e);g()(t)&&(this._closeBtnVisible=Boolean(t.showClose))}handleGameLoaded(){try{this.initGame(),this.startGame()}catch(e){console.error(e)}}initGame(){this._isGameInited=!0,this._isGameLoading=!1}completeGame(){this._isGameInited=!1,this._isOpened=!1,this._game=null,this._gameInstanceId=null}startGame(){this.storyManager.emit("startGame",{id:this.gameInstanceId})}handleVisibilityChange(){"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}handleGameComplete(e,t,r,i,s){this.resetGameState(e),this.processGameResult(s,i)}resetGameState(e){var t;this.scrollbarHelper.disable(),null===(t=this.gameCenterMessageService)||void 0===t||t.destroy(),this.emitGameCompleteEventByStoryManager(e),this.completeGame()}processGameResult(e,t){(null==e?void 0:e.id)?this.openGame(e.id,{}):((null==t?void 0:t.id)&&this.storyManager.showStory(t.id),this.emit(Zi.Close))}emitGameCompleteEventByStoryManager(e){Ei()(e)?this.storyManager.emit("closeGame",{id:this.gameInstanceId}):this.storyManager.emit("finishGame",{id:this.gameInstanceId,result:e})}async handleSendApiRequest(e){let t,r,i;try{const s=JSON.parse(e);t=s.id,r=s.data,i=s.cb,await le.request({url:s.url,method:s.method,params:s.params,data:s.data,headers:s.headers}).catch(console.error),this.sendGameCenterEventByApiRequest(i,JSON.stringify({requestId:t,data:JSON.stringify(r.data),status:r.status,headers:r.headers}))}catch(e){if(e instanceof SyntaxError)return;if(!i)return;this.sendGameCenterEventByApiRequest(i,JSON.stringify({requestId:t,data:JSON.stringify(e),status:400,headers:[{}]}))}}handleOpenUrl(e){const{url:t}=JSON.parse(e),r={src:Wt.GAME_READER,data:{url:t,gameInstanceId:this.gameInstanceId}};this.storyManager.emit("clickOnButton",r),this.storyManager.storyLinkClickHandler?this.storyManager.storyLinkClickHandler(r):window.open(t,"_self")}handleGameEvent(e,t){this.storyManager.emit("gameEvent",{name:e,payload:t}),this.storyManager.emit("eventGame",{name:e,payload:t})}handleReloadGameReader(){const e=this._game;this._game=null,this._isGameInited=!1,this._isGameLoading=!0,this._gameShouldBeShown=!1,setTimeout((0,_.action)((()=>{this._game=e})))}handleGameLoadFailed(e,t){this._game&&t&&this.initGameRetryAttempts<this._game.canTryReloadCount?(this.initGameRetryAttempts++,this.handleReloadGameReader()):this._gameError=new Error(e)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,c=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=E[Symbol.metadata])&&void 0!==t?t:null):void 0;d=[_.observable],u=[_.observable],h=[_.observable],p=[_.observable],f=[_.observable],m=[_.observable],y=[_.observable],v=[_.observable],b=[_.computed],w=[_.action],S=[_.action],O=[_.action],x=[_.action],k=[_.action],C=[_.action],P=[_.action],j=[_.action],Qi(e,null,d,{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),Qi(e,null,u,{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},L,A),Qi(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},R,B),Qi(e,null,p,{kind:"accessor",name:"_gameInstanceId",static:!1,private:!1,access:{has:e=>"_gameInstanceId"in e,get:e=>e._gameInstanceId,set:(e,t)=>{e._gameInstanceId=t}},metadata:r},D,N),Qi(e,null,f,{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},V,F),Qi(e,null,m,{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},U,G),Qi(e,null,y,{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},W,z),Qi(e,null,v,{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},$,H),Qi(e,null,b,{kind:"getter",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir},metadata:r},null,M),Qi(e,null,w,{kind:"method",name:"openGame",static:!1,private:!1,access:{has:e=>"openGame"in e,get:e=>e.openGame},metadata:r},null,M),Qi(e,null,S,{kind:"method",name:"closeGame",static:!1,private:!1,access:{has:e=>"closeGame"in e,get:e=>e.closeGame},metadata:r},null,M),Qi(e,null,O,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:r},null,M),Qi(e,null,x,{kind:"method",name:"handleGameShouldBeShown",static:!1,private:!1,access:{has:e=>"handleGameShouldBeShown"in e,get:e=>e.handleGameShouldBeShown},metadata:r},null,M),Qi(e,null,k,{kind:"method",name:"handleGameLoaded",static:!1,private:!1,access:{has:e=>"handleGameLoaded"in e,get:e=>e.handleGameLoaded},metadata:r},null,M),Qi(e,null,C,{kind:"method",name:"handleGameComplete",static:!1,private:!1,access:{has:e=>"handleGameComplete"in e,get:e=>e.handleGameComplete},metadata:r},null,M),Qi(e,null,P,{kind:"method",name:"handleReloadGameReader",static:!1,private:!1,access:{has:e=>"handleReloadGameReader"in e,get:e=>e.handleReloadGameReader},metadata:r},null,M),Qi(e,null,j,{kind:"method",name:"handleGameLoadFailed",static:!1,private:!1,access:{has:e=>"handleGameLoadFailed"in e,get:e=>e.handleGameLoadFailed},metadata:r},null,M),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:"GameReaderViewModel"}),e})();class es{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){return new Xi(this.storyManager,new Mi)}}const ts=.64516129032;class rs{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>ts&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>ts&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return Math.ceil(this._vh*ts)}calcHeightByVW(){return this._vh}isDiffAspectRatioEqualToEps(){return this.viewportRatio>ts&&this.viewportRatio-ts<=.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 is{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>ts&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>ts&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return this.viewportRatio>ts?this._vw:Math.ceil(this._vh*ts)}calcHeightByVW(){return Math.ceil(this._vw/ts)}isDiffAspectRatioEqualToEps(){return this.viewportRatio>ts&&this.viewportRatio-ts<=.1}isPortraitOrientation(){let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches}}class ss{constructor(){}create(e){return re&&e.vw>=e.vh?this.createDesktopGameGeometry(e):this.createMobileGameGeometry(e)}createDesktopGameGeometry(e){return new rs(e.vw,e.vh,{top:50,bottom:50})}createMobileGameGeometry(e){return new is(e.vw,e.vh)}}class as{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.gameReaderViewModel,r=this.storyManager.storyReaderViewModel;await t.openGame(e.gameInstanceId),r.pauseUI(),t.once(Zi.Close,(()=>{r.resumeUI()}))}catch(e){console.error(e)}}}class os{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.emitWidgetLinkEvent(r,e),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({id:this.activeStory.id,index:this.activeStory.activeSlideIndex,url:r,elementId:e.elementId,dataForSending:null,label:""})}catch(t){t instanceof URIError?console.error(`[IAS]: the URL <${e.linkTarget}> has an invalid format`):console.error(t)}}emitWidgetLinkEvent(e,t){this.storyManager.emit("widgetEvent",{name:"w-link",data:{story_id:this.activeStory.id,slide_index:this.activeStory.activeSlideIndex,widget_id:t.elementId,widget_label:"",widget_value:e}})}async handleClickOnButton(e){this.storyReaderStatisticV1Service.sendClickOnButtonEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),await this.storyReaderStatisticV1Service.sendData();const t={src:Wt.STORY_READER,data:e};if(this.storyManager.emit("clickOnButton",t),this.storyManager.storyLinkClickHandler||this.storyManager.listenerCount(tr.CLICK_ON_STORY)>0)try{this.storyManager.storyLinkClickHandler&&this.storyManager.storyLinkClickHandler(t),this.storyManager.emit(tr.CLICK_ON_STORY,t)}catch(e){console.error(e)}else window.open(e.url,"_self")}}class ns{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{await this.emitClickOnButtonEvent({id:0,index:0,url:"",elementId:"",dataForSending:null,label:""}),await this.storyReader.showStory(e.storyId)}catch(e){console.error(e)}}async emitClickOnButtonEvent(e){this.storyReaderStatisticV1Service.sendClickOnButtonEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),await this.storyReaderStatisticV1Service.sendData();const t={src:Wt.STORY_READER,data:e};this.storyManager.emit("clickOnButton",t)}}class ls{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 cs{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 ds{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,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"sessionNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new ls}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new ls})}clearNarrativeSessionDataCache(){this.sessionNarrativeDataCache.clear()}writeToClipboard(e){w(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}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await le.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){var t;this.storyReaderStatisticV2Service.sendSlideLayout({layoutIndex:e,storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.storyReader.feed)||void 0===t?void 0:t.slug}),this.story.resumeUser(),this.story.activeSlide.showLayerByIndex(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})});let o=(new Ca).create(e,t);o&&this.storyReaderStatisticV2Service.sendEvent(new ca({storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(a=this.storyReader.feed)||void 0===a?void 0:a.slug},o),i)}destroy(){}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(){return this.storyManager.rootStore.sessionStore.session.fontsResources}updateTimeline(e,t,r,i,s,a){if(this.story.activeSlideIndex!==e)return;S("[SLIDE-API]: update timeline",`<${[...arguments].join(", ")}>`);const o=new cs(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 os(this.storyManager,this.storyReader,this.story,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service).handle({elementId:e.elementId,linkTarget:e.link.target})}closeCard(e){this.storyReader.close(qs.CloseCustom)}openStory(e,t){this.story.id===e?this.story.showSlide(t):new ns(this.storyManager,this.storyReader,this.story,this.storyReaderStatisticV1Service).handle({storyId:e,slideIndex:t})}openGame(e){new as(this.storyManager,this.story).handle({gameInstanceId:e})}}class us{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 ds(this.storyManager,this.storyReader,e,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service)}}class hs{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*bi)}calculateHeight(){return Math.ceil(this.calculateWidth()/bi)}}class ps{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/wi)}}class gs{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(re&&e>bi)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 hs(e.vw,e.vh)}createMobileStoryGeometry(e){return new ps(e.vw,e.vh)}}class fs{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<wi}getViewportCorrectionPadding(){const e=this._vh-this._vw/wi,t=Math.max(Math.min(e-50,50),0);return{top:Math.max(e-t,0),bottom:t}}}class ms{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:Yt.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 et?o.filter:null;this.title=this.story.statTitle,this.tags=this.story.tags,this.slidesCount=this.story.slidesCount,this.ugcPayload=n===Ge.UGC?this.story.ugcPayload:null,this.feedSlug=n===Ge.DEFAULT?l:null,this.filter=c,this.actionSource=null!=n?this.getStorySourceByFeedType(n):Yt.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 Ge.DEFAULT:case Ge.UGC:return Yt.list;case Ge.FAVORITE:return Yt.favorite;case Ge.ONBOARDING:return Yt.onboarding;default:return Yt.list}}}class ys extends ms{get name(){return"closeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class vs extends ms{get name(){return"closeStoryReader"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class bs extends ms{get name(){return"dislikeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class ws extends ms{get name(){return"favoriteStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class Ss extends ms{get name(){return"likeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class _s extends ms{get name(){return"shareStory"}}class Os extends ms{get name(){return"shareStoryWithPath"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.url})}}class xs extends ms{get name(){return"showSlide"}}class ks extends ms{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}}}var Ps=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Es=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)},Ms=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 Is=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,u,h,p,g,f,m=[],y=[],v=[],b=[],w=[],S=[],O=[];return e=class{get _activeStory(){return Es(this,t,"f")}set _activeStory(e){Ms(this,t,e,"f")}get _currentIndex(){return Es(this,r,"f")}set _currentIndex(e){Ms(this,r,e,"f")}get _targetTransitionIndex(){return Es(this,i,"f")}set _targetTransitionIndex(e){Ms(this,i,e,"f")}constructor(e,s,a){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Ps(this,m),e)}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"statistics",{enumerable:!0,configurable:!0,writable:!0,value:a}),t.set(this,Ps(this,y,null)),r.set(this,(Ps(this,v),Ps(this,b,0))),i.set(this,(Ps(this,w),Ps(this,S,-1))),Object.defineProperty(this,"animatedNavigationController",{enumerable:!0,configurable:!0,writable:!0,value:(Ps(this,O),null)}),Object.defineProperty(this,"currentStoryDisplayStrategy",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_activeStoryStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0})}get reachStart(){return 0===this._currentIndex}get reachEnd(){return this._currentIndex===this.storyReader.stories.length-1}get targetTransitionStory(){return this.storyReader.stories[this._targetTransitionIndex]}get targetTransitionIndex(){return this._targetTransitionIndex}get activeStory(){return this._activeStory}get currentIndex(){return this._currentIndex}get activeStoryDuration(){return Date.now()-this._activeStoryStartTime}setAnimatedNavigationController(e){this.animatedNavigationController=e}setCurrentStoryDisplayStrategy(e){this.currentStoryDisplayStrategy=e}nextStory(){this.reachEnd||this.setActiveStoryByIndex(this._currentIndex+1)}prevStory(){this.reachStart||this.setActiveStoryByIndex(this._currentIndex-1)}nextStoryWithAnimation(e){this.storyReader.reachEnd?this.handleStoryReaderReachEnd(e):this.navigateStoryWithAnimation(this._currentIndex+1,e)}prevStoryWithAnimation(e){this.reachStart||this.navigateStoryWithAnimation(this.currentIndex-1,e)}destroy(){this._activeStory=null}setActiveStoryById(e){const t=this.storyReader.stories.findIndex((t=>t.id===e));if(-1===t)throw new Error(`[IAS]: No story found with ID ${e}`);return this.initStoriesWithinRange(t),this.setActiveStoryByIndex(t)}async navigateStoryWithAnimation(e,t="lastSlideClick"){this.animatedNavigationController&&!this.animatedNavigationController.animating&&-1===this._targetTransitionIndex&&(e=this.limitIndex(e),this._targetTransitionIndex=e,this.currentStoryDisplayStrategy.handleNextStoryByIndex(e),this.initStoriesWithinRange(e),await this.animatedNavigationController.transitionByIndex(e,this.currentIndex),await this.handleTransitionEnd(e,t))}handleStoryReaderReachEnd(e){var t;e!==qs.CloseByTimer?this.storyReader.close(qs.CloseByLastSlideClick):(null===(t=this.animatedNavigationController)||void 0===t?void 0:t.options.closeOnLastSlideByTimer)&&this.storyReader.close(qs.CloseByTimer)}async handleTransitionEnd(e,t){this.activeStory&&this.storyManager.emitEvent(new ys(this.activeStory,{action:t})),await this.setActiveStoryByIndex(e),this._targetTransitionIndex=-1}async setActiveStoryByIndex(e){const t=this._currentIndex,r=this._activeStory,i=this.storyReader.stories[e];if(i)return await this.updateActiveStory(e,r,i),this.statistics.emitTransitionEvents(t,e,r,i,this.activeStoryDuration),this.handleActiveStoryError(this._activeStory),i.markAsOpened(),i}async updateActiveStory(e,t,r){return this._currentIndex=e,this.runNextStory(t,r),this._activeStoryStartTime=Date.now(),this._activeStory=r,r}async runNextStory(e,t){await(null==e?void 0:e.stop()),await t.init(),await t.start()}async initStoriesWithinRange(e){let t=this.storyReader.stories;const r=Math.max(e-1,0),i=Math.min(e+1,t.length-1);return t=t.slice(r,i+1),Promise.all(t.map((e=>e.init())))}handleActiveStoryError(e){(null==e?void 0:e.error)&&this.storyManager.emitEvent(new Cs({id:e.id,title:e.title,name:e.error.name,message:e.error.message}))}limitIndex(e){return Math.max(0,Math.min(this.storyReader.stories.length-1,e))}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[_.observable],a=[_.observable],o=[_.observable],n=[_.computed],l=[_.computed],c=[_.computed],d=[_.action],u=[_.action],h=[_.action],p=[_.action],g=[_.action],f=[_.action],js(e,null,s,{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:t},y,v),js(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:t},b,w),js(e,null,o,{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:t},S,O),js(e,null,n,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:t},null,m),js(e,null,l,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:t},null,m),js(e,null,c,{kind:"getter",name:"targetTransitionStory",static:!1,private:!1,access:{has:e=>"targetTransitionStory"in e,get:e=>e.targetTransitionStory},metadata:t},null,m),js(e,null,d,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:t},null,m),js(e,null,u,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:t},null,m),js(e,null,h,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:t},null,m),js(e,null,p,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:t},null,m),js(e,null,g,{kind:"method",name:"navigateStoryWithAnimation",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimation"in e,get:e=>e.navigateStoryWithAnimation},metadata:t},null,m),js(e,null,f,{kind:"method",name:"handleTransitionEnd",static:!1,private:!1,access:{has:e=>"handleTransitionEnd"in e,get:e=>e.handleTransitionEnd},metadata:t},null,m),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Ts=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},Ls=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0};let As=(()=>{var e;let t,r=[];return e=class{constructor(e,t){Object.defineProperty(this,"showMultipleStoriesStrategy",{enumerable:!0,configurable:!0,writable:!0,value:(Ts(this,r),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,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._feed=s;const a=this.getFeedLoadEvent(s.slug,s.stories);return this.emitFeedLoad(a),s.stories.length?(await this.showMultipleStoriesStrategy.show({windowReferer:Jt.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,tags:[],slidesCount:null};return e&&(t.title=e.statTitle,t.tags=e.tags,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)}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[x],Ls(e,null,t,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:i},null,r),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();class Rs{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 Bs{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})}async reload(e){return this.showStoryStrategy.reload(e)}async handleNextStoryByIndex(e){}}var Ds=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},Ns=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0};let Vs=(()=>{var e;let t,r=[];return e=class{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Ds(this,r),e)}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){try{const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",once:!0});if(r.error)throw r.error;if(r.isOpened)throw new Ve(e.storyId.toString());this.openStoryReader(r)}catch(e){throw this.storyReaderViewModel.close(),e}}openStoryReader(e){this.storyReaderViewModel.open({windowReferer:Jt.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[x],Ns(e,null,t,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:i},null,r),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();var Fs=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0};let Gs=(()=>{var e;let t,r=[];return e=class{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Fs(this,r),e)}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",fetchShareUrl:e.fetchShareUrl});this.openStoryReader(r,e)}openStoryReader(e,t){this.storyReaderViewModel.open({windowReferer:Jt.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[x],Us(e,null,t,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:i},null,r),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();class Ws{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 Gs(this.storyManager,this.storyReaderViewModel)}createShowStoryOnce(){return new Vs(this.storyManager,this.storyReaderViewModel)}createShowStoryFromSharePage(){return new Bs(new Gs(this.storyManager,this.storyReaderViewModel))}createShowOnboardingStories(){return new As(new Rs(this.storyManager,this.storyReaderViewModel),this.storyManager)}createShowMultipleStories(){return new Rs(this.storyManager,this.storyReaderViewModel)}}class zs{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 Ke?r="favorite":this.storyReader.feed instanceof Je&&(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}),this.storyManager.emitEvent(new ks(t)),this.storyManager.emitEvent(new xs(t))}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})}}var $s,Hs,qs,Zs=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},Ks=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Qs=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)},Ys=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.RedirectToStory="redirectToStory",e.CloseStory="closeStory",e.ShowMultipleStories="showMultipleStories",e.ReloadStory="reloadStory"}($s||($s={})),function(e){e.Close="closeStoryReader"}(Hs||(Hs={})),function(e){e.CloseByBtn="closeReaderByCloseBtn",e.CloseByTimer="auto",e.CloseByEsc="closeReaderByEscBtn",e.CloseByLastSlideClick="lastSlideClick",e.CloseBySwipeDown="swipeDown",e.CloseCustom="customClose",e.AppClose="app-close"}(qs||(qs={}));let Js=(()=>{var e,t,r,i;let a,o,n,l,c,d,u,h,p,g,f,m,y,v,b,w,S,O,x,k=s,C=[],P=[],j=[],E=[],M=[],I=[],T=[];return e=class extends k{get _muted(){return Qs(this,t,"f")}set _muted(e){Ys(this,t,e,"f")}get _closeGestureInAction(){return Qs(this,r,"f")}set _closeGestureInAction(e){Ys(this,r,e,"f")}get _stories(){return Qs(this,i,"f")}set _stories(e){Ys(this,i,e,"f")}constructor(s,a,o,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Zs(this,C),s)}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,Zs(this,P,!0)),r.set(this,(Zs(this,j),Zs(this,E,!1))),i.set(this,(Zs(this,M),Zs(this,I,_.observable.array()))),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:(Zs(this,T),new Ar(window))}),Object.defineProperty(this,"windowReferer",{enumerable:!0,configurable:!0,writable:!0,value:Jt.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 kr({touchStartTimeout:200})}),Object.defineProperty(this,"navigationController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"useModernLayout",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.handleWindowUnload=this.handleWindowUnload.bind(this),this.handleKeydown=this.handleKeydown.bind(this),s.setViewModel(e.id,this),window.addEventListener("beforeunload",this.handleWindowUnload),this.storyDisplayStrategyFactory=new Ws(s,this),this.navigationController=new Is(this.storyManager,this,new zs(this,this.storyManager,this.storyReaderStatisticV1Service,this.storyFeedStatisticV1Service,this.storyReaderStatisticV2Service))}get targetTransitionIndex(){return this.navigationController.targetTransitionIndex}get targetTransitionStory(){return this.navigationController.targetTransitionStory}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.navigationController.activeStory}get dir(){return this.storyManager.config.dir}get isOpened(){return Boolean(this.navigationController.activeStory)}get activeStoryIndex(){return this.navigationController.currentIndex}get reachStart(){return this.navigationController.reachStart||this._stories[0]===this.targetTransitionStory}get reachEnd(){return this.navigationController.reachEnd||this._stories[this._stories.length-1]===this.targetTransitionStory}open(e){var t,r;this.activeStory&&this.resetReaderToDefaultState(this.activeStory),this.windowReferer=e.windowReferer,this.setStories(e.stories);this.navigationController.setActiveStoryById(e.id);this.navigationController.setCurrentStoryDisplayStrategy(this._currentStoryDisplayStrategy),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.setScrollBar(e.windowReferer),document.addEventListener("keydown",this.handleKeydown)}close(e=qs.CloseByBtn){var t;this.activeStory&&!(null===(t=this.activeStory)||void 0===t?void 0:t.disableClose)&&(this.emitCloseEvents(this.activeStory,e),this.resetReaderToDefaultState(this.activeStory,e))}emitCloseEvents(e,t){var r,i;this.emitStatisticV2StoryCloseEvent(e,t),this.emit(Hs.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}),this.storyManager.emitEvent(new vs(e,{action:t}))}emitStatisticV2StoryCloseEvent(e,t){var r;this.storyReaderStatisticV2Service.sendCloseReaderEvent({action:t,totalSlides:e.slidesCount,durationMs:this.navigationController.activeStoryDuration,storyId:e.id,activeSlideIndex:e.activeSlideIndex,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}resetReaderToDefaultState(e,t){this.storyManager.emitEvent(new ys(e,{action:t})),this.resetScrollBar(this.windowReferer);const r=e.id,i=e.activeSlideIndex;this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:r,slideIndex:i}),e.markAsOpened(),this.storyReaderStatisticV1Service.destroy(),this.clearStoryViewModels(),this._touchController.destroy(),document.removeEventListener("keydown",this.handleKeydown),this.navigationController.destroy()}canBeClosed(){return!!this.activeStory&&!this.activeStory.disableClose}async showStory(e){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStory(),await this._currentStoryDisplayStrategy.show({storyId:e})}async showStoryOnce(e){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStoryOnce(),await this._currentStoryDisplayStrategy.show({storyId:e})}async showStoryFromSharePage(e){const t=this.storyDisplayStrategyFactory.createShowStoryFromSharePage();this._currentStoryDisplayStrategy=t,await t.show({storyId:e,fetchShareUrl:this.storyManager.isStatisticsDisabled})}async showOnboardingStories(e){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:Jt.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(){return this.navigationController.nextStory()}prevStory(){return this.navigationController.prevStory()}nextStoryWithAnimation(e){return this.navigationController.nextStoryWithAnimation(e)}prevStoryWithAnimation(e){return this.navigationController.prevStoryWithAnimation(e)}toStoryWithAnimationByIndex(e){if(this.activeStoryIndex!==e)return this.navigationController.navigateStoryWithAnimation(e,"")}navigateStoryWithAnimationByIndex(e,t){this.navigationController.navigateStoryWithAnimation(e,t)}destroy(){this.activeStory&&(this.emitCloseEvents(this.activeStory,qs.AppClose),this.resetReaderToDefaultState(this.activeStory)),this.removeAllListeners(),window.removeEventListener("beforeunload",this.handleWindowUnload),this.storyManager.deleteViewModel(e.id)}closeGoodsWidget(){var e;null===(e=this.activeStory)||void 0===e||e.goodsWidget.close()}setAnimatedNavigationController(e){this.navigationController.setAnimatedNavigationController(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 us(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))}handleKeydown(e){this.handleEscKeydown(e),this.handleArrowKeydown(e)}handleEscKeydown(e){"Escape"===e.code&&this.close(qs.CloseByEsc)}handleArrowKeydown(e){"ArrowRight"===e.code&&this.goNext(),"ArrowLeft"===e.code&&this.goPrev()}clearStoryViewModels(){for(const e of this._stories)e.destroy();this._stories=_.observable.array()}setScrollBar(e){e===Jt.default&&this.scrollbarHelper.enable()}resetScrollBar(e){e===Jt.default&&this.scrollbarHelper.disable()}handleWindowUnload(e){this.activeStory&&(this.emitStatisticV2StoryCloseEvent(this.activeStory,qs.AppClose),this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),this.storyReaderStatisticV1Service.sendData())}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=k[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[_.observable],o=[_.observable],n=[_.observable],l=[_.computed],c=[_.computed],d=[_.computed],u=[_.action],h=[_.action],p=[_.action],g=[_.action],f=[_.action],m=[_.action],y=[_.action],v=[_.action],b=[_.action],w=[_.action],S=[_.action],O=[_.action],x=[_.action],Ks(e,null,a,{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},P,j),Ks(e,null,o,{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},E,M),Ks(e,null,n,{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},I,T),Ks(e,null,l,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:r},null,C),Ks(e,null,c,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,C),Ks(e,null,d,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,C),Ks(e,null,u,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:r},null,C),Ks(e,null,h,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:r},null,C),Ks(e,null,p,{kind:"method",name:"reloadStory",static:!1,private:!1,access:{has:e=>"reloadStory"in e,get:e=>e.reloadStory},metadata:r},null,C),Ks(e,null,g,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:r},null,C),Ks(e,null,f,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:r},null,C),Ks(e,null,m,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:r},null,C),Ks(e,null,y,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:r},null,C),Ks(e,null,v,{kind:"method",name:"toStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"toStoryWithAnimationByIndex"in e,get:e=>e.toStoryWithAnimationByIndex},metadata:r},null,C),Ks(e,null,b,{kind:"method",name:"navigateStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimationByIndex"in e,get:e=>e.navigateStoryWithAnimationByIndex},metadata:r},null,C),Ks(e,null,w,{kind:"method",name:"mute",static:!1,private:!1,access:{has:e=>"mute"in e,get:e=>e.mute},metadata:r},null,C),Ks(e,null,S,{kind:"method",name:"unmute",static:!1,private:!1,access:{has:e=>"unmute"in e,get:e=>e.unmute},metadata:r},null,C),Ks(e,null,O,{kind:"method",name:"enableCloseGesture",static:!1,private:!1,access:{has:e=>"enableCloseGesture"in e,get:e=>e.enableCloseGesture},metadata:r},null,C),Ks(e,null,x,{kind:"method",name:"disableCloseGesture",static:!1,private:!1,access:{has:e=>"disableCloseGesture"in e,get:e=>e.disableCloseGesture},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:"StoryReaderViewModel"}),e})();class Xs{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new Lt,t=new Tt(this.storyManager,e);return new Js(this.storyManager,t,new Ma(this.storyManager,new At(this.storyManager)),new it(this.storyManager,e))}}class ea extends Rt{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 qs.CloseByBtn:return Bt.ButtonClose;case qs.CloseByTimer:return Bt.AutoClose;case qs.CloseByEsc:return Bt.ButtonClose;case qs.CloseByLastSlideClick:return Bt.AutoClose;case qs.CloseBySwipeDown:return Bt.SwipeClose;case qs.CloseCustom:return Bt.CustomClose;case qs.AppClose:return Bt.AppClose;default:Bt.AppClose}}}class ta extends Rt{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 ra extends Rt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"dislike"}}class ia extends Rt{constructor(e){super(e)}get type(){return"favorite"}}class sa extends Rt{constructor(e){super(e)}get type(){return"like"}}class aa extends Rt{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 oa extends Rt{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 na extends Rt{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 la extends Rt{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 ca extends Rt{constructor(e,t){super(e),Object.defineProperty(this,"widgetEvent",{enumerable:!0,configurable:!0,writable:!0,value:t})}get type(){return this.widgetEvent.type}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),this.widgetEvent.toQueryParams())}}class da extends Rt{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 ua{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}}toJSON(){return this.payload}}class ha{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 pa{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-copy"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class ga{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-poll-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class fa{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-poll-clarification"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class ma{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-poll-layers-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class ya{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-products-click"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class va{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-products-open"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class ba{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-quiz-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class wa{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-quiz-grouped-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class Sa{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-range-slider-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class _a{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-rate-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class Oa{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-share"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class xa{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-test-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class ka{constructor(e){Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"w-vote-answer"}toQueryParams(){return this.payload}toJSON(){return this.payload}}class Ca{create(e,t){switch(e){case"w-copy":return new pa(t);case"w-share":return new Oa(t);case"w-rate-answer":return new _a(t);case"w-range-slider-answer":return new Sa(t);case"w-poll-answer":return new ga(t);case"w-poll-clarification":return new fa(t);case"w-poll-layers-answer":return new ma(t);case"w-products-click":return new ya(t);case"w-products-open":return new va(t);case"w-test-answer":return new xa(t);case"w-vote-answer":return new ka(t);case"w-quiz-answer":return new ba(t);case"w-quiz-grouped-answer":return new wa(t)}return null}}class Pa{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 ja{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 Ea{constructor(e,t,r){Object.defineProperty(this,"widgetId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:r})}get type(){return"w-link"}toQueryParams(){return{wi:this.widgetId,wv:this.value,wl:this.label}}toJSON(){return{widgetId:this.widgetId,value:this.value}}}class Ma{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 da(e))}sendOpenEvent(e){this.sendEvent(new ta(e))}sendCloseEvent(e){this.sendEvent(new Nt(e))}sendCloseReaderEvent(e){this.sendEvent(new ea(e))}sendSlideLayout(e){this.sendEvent(new oa(e))}sendLinkEvent(e){this.sendEvent(new na(e))}sendLikeEvent(e){this.sendEvent(new sa(e))}sendDislikeEvent(e){this.sendEvent(new ra(e))}sendFavoriteEvent(e){this.sendEvent(new ia(e))}sendShareEvent(e){this.sendEvent(new aa(e))}sendSlideEvent(e){this.sendEvent(new la(e))}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class Ia 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 Ta="en-US";class La{constructor(e=Ta){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 Ia(e).message),this.getNavigatorTag())}getNavigatorTag(){const e=navigator.language.toLowerCase();return this.isValidTag(e)?e:(console.error(`Invalid navigator language tag: ${e}`),Ta)}parseTag(e){const[t,r]=e.split("-");this.languageCode=t,this.countryCode=r.toUpperCase(),this.tag=`${this.languageCode}-${this.countryCode}`}}var Aa=M(7144),Ra=M.n(Aa);class Ba extends Error{constructor(){super("[IAS]: you must pass the <userId> value"),this.name="IasEmptyUserIdError"}}class Da extends Error{constructor(e,t){super(`[IAS]: tags (joined by ',') "${e.join(",")}" is bigger then ${t} bytes`),this.name="IasTagsLengthError"}}class Na extends Error{constructor(e,t){super(`[IAS]: userId "${e}" is bigger then ${t} bytes`),this.name="IasUserIdLengthError"}}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},Fa=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Ua=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)},Ga=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 Wa=(()=>{var e,t,r,i,s,a;let o,n,l,c,d,u,h=[],p=[],f=[],m=[],y=[],v=[],b=[],w=[],S=[],O=[],k=[];return e=class{get _apiKey(){return Ua(this,t,"f")}set _apiKey(e){Ga(this,t,e,"f")}get _tags(){return Ua(this,r,"f")}set _tags(e){Ga(this,r,e,"f")}get _lang(){return Ua(this,i,"f")}set _lang(e){Ga(this,i,e,"f")}get _dir(){return Ua(this,s,"f")}set _dir(e){Ga(this,s,e,"f")}get _userId(){return Ua(this,a,"f")}set _userId(e){Ga(this,a,e,"f")}constructor(e,o){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Va(this,h),e)}),t.set(this,Va(this,p,"")),r.set(this,(Va(this,f),Va(this,m,[]))),i.set(this,(Va(this,y),Va(this,v,new La))),s.set(this,(Va(this,b),Va(this,w,rr.LTR))),Object.defineProperty(this,"_disableDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:(Va(this,S),!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}),a.set(this,Va(this,O,"")),Object.defineProperty(this,"_userIdSign",{enumerable:!0,configurable:!0,writable:!0,value:Va(this,k)}),Object.defineProperty(this,"_isInited",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.updateByDto(o),this._isInited=!0}get userId(){return this._userId}get userIdSign(){return this._userIdSign}get isStatisticsDisabled(){return this._isStatisticsDisabled||"com.inappstory.webpreview"===this._appPackageId}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===rr.LTR}disableStatistic(){this._isStatisticsDisabled=!0}enableStatistic(){this._isStatisticsDisabled=!1}async setApiKey(e){this._apiKey!==e&&(!function(e){const t=de(e);if(t){const e=t.split(".").slice(1);ce.baseUrl=`https://${["cdn",...e].join(".")}`,ce.faviconApiUrl=`https://${["favicon",...e].join(".")}`,ce.apiUrl=`https://${t}`}le.baseURL=`${ce.apiUrl}/v2/`}(e),this._apiKey=e,this._isInited&&await this.reloadSdk())}async setUserId(e,t){if(this._disableDeviceId&&(null==e||""===e))throw new Ba;(R()(e)||Ra()(e))&&this._userId!==e&&((new $a).checkUserIdLength(e.toString()).validate(),this._userId=e,this._userIdSign=t,this._isInited&&await this.reloadSdk())}async setLang(e){e&&R()(e)&&this._lang.toRawData()!==e&&(this._lang=new La(e),this._isInited&&await this.reloadSdk())}setTextPlaceholders(e={}){if(!g()(e))return;const t=this.mapTextPlaceholders(e);Ye()(this._textPlaceholders,t)||(this._textPlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._textPlaceholders))}setImagePlaceholders(e={}){if(!g()(e))return;const t=this.mapImagePlaceholders(e);Ye()(this._imagePlaceholders,t)||(this._imagePlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._imagePlaceholders))}setTags(e){Ye()(this._tags,e)||((new $a).checkTagsLength(e).validate(),this._tags=j(e))}setDir(e){var t;this._dir=e?e.toString():null!==(t=getComputedStyle(document.documentElement).direction)&&void 0!==t?t:rr.LTR}updateByDto(e){var t,r,i,s,a;this._appPackageId=null!==(t=e.appPackageId)&&void 0!==t?t:"",this._disableDeviceId=Boolean(e.disableDeviceId),this.setApiKey(e.apiKey),this.setUserId(null!==(r=e.userId)&&void 0!==r?r:"",e.userIdSign),this.setLang(e.lang),this.setTextPlaceholders(null!==(i=e.placeholders)&&void 0!==i?i:{}),this.setImagePlaceholders(null!==(s=e.imagePlaceholders)&&void 0!==s?s:{}),this.setTags(null!==(a=e.tags)&&void 0!==a?a:[]),this.setDir(e.dir)}mapTextPlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new Be(r,i));return t}mapImagePlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new Re(r,i));return t}async reloadSdk(){try{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,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;o=[_.observable],n=[_.observable],l=[_.observable],c=[_.observable],d=[_.observable],u=[x],Fa(e,null,o,{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:t},p,f),Fa(e,null,n,{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:t},m,y),Fa(e,null,l,{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:t},v,b),Fa(e,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},w,S),Fa(e,null,d,{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:t},O,k),Fa(e,null,u,{kind:"method",name:"reloadSdk",static:!1,private:!1,access:{has:e=>"reloadSdk"in e,get:e=>e.reloadSdk},metadata:t},null,h),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class za{get userId(){return""}get userIdSign(){return""}get isStatisticsDisabled(){return!1}get appPackageId(){return""}get apiKey(){return""}get tags(){return[]}get lang(){return new La}get disableDeviceId(){return!1}get textPlaceholders(){return[]}get imagePlaceholders(){return[]}get dir(){return rr.LTR}get isLtr(){return!0}disableStatistic(){}enableStatistic(){}async setApiKey(e){}async setUserId(e,t){}async setLang(e){}setTextPlaceholders(e){}setImagePlaceholders(e){}setTags(e){}setDir(e){}updateByDto(e){}}class $a{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 Na(e,255)),this}checkTagsLength(e){return e.length>0&&this.getByteLength(e.join(","))>4e3&&this.errors.push(new Da(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 Ha{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 qa=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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)},Qa=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 Ya=(()=>{var e,t,r,i,s,a,o,n,c,d;let u,h,p,g,f,m,y,v,b,w,S=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],M=[],I=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],V=[],F=[];return e=class{get _id(){return Ka(this,t,"f")}set _id(e){Qa(this,t,e,"f")}get _events(){return Ka(this,r,"f")}set _events(e){Qa(this,r,e,"f")}get _type(){return Ka(this,i,"f")}set _type(e){Qa(this,i,e,"f")}get _slides(){return Ka(this,s,"f")}set _slides(e){Qa(this,s,e,"f")}get _appearanceOptions(){return Ka(this,a,"f")}set _appearanceOptions(e){Qa(this,a,e,"f")}get _needPlaceholders(){return Ka(this,o,"f")}set _needPlaceholders(e){Qa(this,o,e,"f")}get _hasLimit(){return Ka(this,n,"f")}set _hasLimit(e){Qa(this,n,e,"f")}get _isOnceOpened(){return Ka(this,c,"f")}set _isOnceOpened(e){Qa(this,c,e,"f")}get _context(){return Ka(this,d,"f")}set _context(e){Qa(this,d,e,"f")}constructor(e){t.set(this,(qa(this,S),qa(this,O,void 0))),r.set(this,(qa(this,x),qa(this,k,{}))),i.set(this,(qa(this,C),qa(this,P,void 0))),s.set(this,(qa(this,j),qa(this,E,[]))),a.set(this,(qa(this,M),qa(this,I,new ve({})))),o.set(this,(qa(this,T),qa(this,L,!1))),n.set(this,(qa(this,A),qa(this,R,!1))),c.set(this,(qa(this,B),qa(this,D,!1))),d.set(this,(qa(this,N),qa(this,V,void 0))),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:(qa(this,F),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:null}),this._id=e,this._context=new Ha(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(){return(!this._displayFrom||Date.now()>=this._displayFrom)&&(!this._displayTo||Date.now()<=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}destroy(){}updateByDto(e){var t,r,i;this._events=this.mapMessageEventsByDto(null!==(t=e.events)&&void 0!==t?t:[]),this._type=e.type,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 xe).create(this._type,e.appearance),this._needPlaceholders=e.need_placeholders,this.updateMessageSlides(e.slides_html)}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 Ee(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(){this._isOnceOpened=!0,this._iterationId=(0,l.v4)(),this._openTime=Date.now()}updatePlaceholders(e){for(const t of this._slides)t.updatePlaceholders(e)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,c=new WeakMap,d=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;u=[_.observable],h=[_.observable],p=[_.observable],g=[_.observable],f=[_.observable],m=[_.observable],y=[_.observable],v=[_.observable],b=[_.observable],w=[_.action],Za(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},O,x),Za(e,null,h,{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},k,C),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},P,j),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},E,M),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},I,T),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},L,A),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},R,B),Za(e,null,v,{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},D,N),Za(e,null,b,{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},V,F),Za(e,null,w,{kind:"method",name:"updateByDto",static:!1,private:!1,access:{has:e=>"updateByDto"in e,get:e=>e.updateByDto},metadata:t},null,S),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,l.v4)()})}toQueryParams(){return{ei:this.eventId,ii:this.iterationId,si:this.slideIndex,st:this.slideTotal}}}class Xa extends Ja{constructor(e,t,r,i){super(e,t,r),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:i})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{d:this.duration})}}class eo extends Ja{constructor(e,t,r){super(e,t,r)}get type(){return"open"}toQueryParams(){return super.toQueryParams()}}class to extends Ja{constructor(e,t,r,i,s){super(e,t,r),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"widgetEvent",{enumerable:!0,configurable:!0,writable:!0,value:s})}get type(){return this.widgetEvent.type}toQueryParams(){return Object.assign(Object.assign(Object.assign({},super.toQueryParams()),this.widgetEvent.toQueryParams()),{d:this.duration})}}class ro{constructor(e){Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async trackOpen(e,t){e.trackOpen();const r=new eo(e.iterationId,t.activeSlideIndex,e.slides.length);await this.iamApi.emitMessageEvent(e.id,r)}async trackClose(e,t){const r=e.timeSinceLastShow,i=new Xa(e.iterationId,t.activeSlideIndex,e.slides.length,r);await this.iamApi.emitMessageEvent(e.id,i)}async trackWidgetEvent(e,t,r){const i=e.timeSinceLastShow,s=new to(e.iterationId,r.activeSlideIndex,e.slides.length,i,t);return this.iamApi.emitMessageEvent(e.id,s)}}class io extends Error{constructor(){super("[IAM]: you must close other opened readers"),this.name="IamOtherReaderIsOpenError"}}class so extends Error{constructor(){super("[IAM]: you need preload in app messages"),this.name="IamShowOnlyIfLoadedError"}}class ao extends Error{constructor(){super("[IAM]: show message frequency limit exceeded"),this.name="IamFrequencyLimitError"}}class oo extends Error{constructor(){super("[IAM]: not in display time range"),this.name="IamCheckDisplayTimeRangeError"}}class no extends Error{constructor(e){super(`[IAM]: the limit for displaying IAM with ID ${e} has been reached`),this.name="IamMessageLimitExceededError"}}class lo{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(){var e,t;return((null===(e=this.storyManager.storyReaderViewModel)||void 0===e?void 0:e.isOpened)||(null===(t=this.storyManager.gameReaderViewModel)||void 0===t?void 0:t.isOpened))&&this.errors.push(new io),this}checkShowOnlyIfLoaded(e){return!this.iamStore.isLoaded&&e&&this.errors.push(new so),this}checkFrequencyLimit(e){return e.frequencyLimitTimeExceeded&&this.errors.push(new ao),this}checkDisplayTimeRange(e){return e.withinDisplayTimeRange||this.errors.push(new oo),this}validate(){if(this.errors.length>0)throw this.errors.shift()}}class co{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 lo(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 lo(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 lo(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 no(e)}getMessagesSortedByEventPriority(e,t){return t.slice().sort(((t,r)=>{const i=t.events[e].priority;return r.events[e].priority-i}))}}var uo,ho,po;!function(e){e[e.BottomSheet=1]="BottomSheet",e[e.Modal=2]="Modal",e[e.Fullscreen=3]="Fullscreen"}(uo||(uo={})),function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(ho||(ho={})),function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right"}(po||(po={}));class go{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 fo{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 mo{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 yo{create(e,t){switch(e){case uo.BottomSheet:return new fo(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case uo.Modal:return new mo(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case uo.Fullscreen:return new go(t.vw,t.vh)}}}class vo{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,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r})}get contentRatio(){return this._contentRatio}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}class bo{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,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r})}get contentRatio(){return this._contentRatio}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return Math.ceil(this._vh*this._contentRatio)}calculateHeight(){return this._vh}}class wo{}class So extends wo{constructor(e,t,r){super(),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})}get contentRatio(){return this._contentRatio}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}class _o extends wo{constructor(e,t,r){super(),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})}get contentRatio(){return this._contentRatio}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return Math.ceil(this.calculateHeight()*this._contentRatio)}calculateHeight(){return this._vh}}class Oo{constructor(){}create(e){const t=this.getViewportParams(e);return this.isFullscreen(e,t)?this.createFullscreenSlideGeometry(t):this.createWideOrSquareGeometry(t)}isFullscreen(e,t){return e instanceof go}createWideOrSquareGeometry(e){return e.viewportRatio>e.contentRatio?new vo(e.vw,e.vh,e.contentRatio):new bo(e.vw,e.vh,e.contentRatio)}getViewportParams(e){return{vw:e.getWidth(),vh:e.getHeight(),viewportRatio:e.getWidth()/e.getHeight(),contentRatio:e.contentRatio}}createFullscreenSlideGeometry(e){return e.viewportRatio>e.contentRatio?new _o(e.vw,e.vh,e.contentRatio):new So(e.vw,e.vh,e.contentRatio)}}var xo=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},ko=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Co=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)},Po=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 jo=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _disabledNextClick(){return Co(this,t,"f")}set _disabledNextClick(e){Po(this,t,e,"f")}constructor(e,r,i){Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:(xo(this,s),e)}),Object.defineProperty(this,"iamMessageSlide",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),t.set(this,xo(this,a,!1)),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:(xo(this,o),new wr.Mutex)}),Object.defineProperty(this,"handleTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:({dy:e})=>{this.message.touchController&&e<10&&this.message.touchController.verticalSwipeGesture&&this.slideApi.slideSwipeUpHandler()}}),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}get isLoading(){return 0==this.slideApi.state}get html(){return this.iamMessageSlide.html}get state(){return this.slideApi.state}get navigationDisabled(){return this._disabledNextClick}async reload(){return this.slideApi.slideRestart({muted:!1})}mute(){this.slideApi.disableAudio()}unmute(){this.slideApi.enableAudio()}notifyTimerEnd(){this.slideApi.slideTimerEnd()}pauseAndLock(){return this.locked=!0,this.pauseByApp()}resumeAndUnlock(){return this.locked=!1,this.resumeByApp()}async showLayerByIndex(e){this.slideApi.showLayer(e)}setUserData(e,t){this.slideApi.setTextInputResult(e,t)}setShareComplete(e,t){this.slideApi.setShareComplete(e,t)}notifySwipeUp(e){this.slideApi.slideSwipeUpHandler()}showToast(e){this.toast=new Pr(Object.assign({getMountPoint:()=>this.message.$root},e)),this.toast.show(e.content)}handleDocumentVisibilityChange(){this.locked||("hidden"===document.visibilityState&&this.pauseByApp(),"visible"===document.visibilityState&&this.resumeByApp())}async init(){const e=await this.mutex.acquire();let t=!1;const r=setTimeout((()=>{this.message.showLoaderScreen(),t=!0}),500);try{const{result:e,reason:t}=await this.slideApi.showSlide(this.html);if(!e)throw new Error(t)}catch(e){this.handleSlideError(e)}finally{clearTimeout(r),this.cleanupLoaderIfNeeded(t),e()}}async start(){const e=await this.mutex.acquire();try{await this.slideApi.slideStart({muted:!0}),this.message.touchController.on(vr.TouchEnd,this.handleTouchEnd),document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange)}catch(e){this.handleSlideError(e)}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.message.hideErrorScreen(),this.message.showLoaderScreen(),await this.slideApi.slideRestart({muted:!0})}catch(e){this.handleSlideError(e)}finally{this.message.hideLoaderScreen(),e()}}async resumeByApp(){const e=await this.mutex.acquire();try{await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByApp(){const e=await this.mutex.acquire();try{await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(){var e;const t=await this.mutex.acquire();try{await this.slideApi.slideStop({prepareForRestart:1}),this.message.touchController.off(vr.TouchEnd,this.handleTouchEnd),document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange),null===(e=this.toast)||void 0===e||e.destroy()}catch(e){this.handleSlideError(e)}finally{t()}}onClick(e,t){if(!e.target)return;e.preventDefault(),e.stopPropagation();const r=this.getNavigationDirection(e,t),{canClickNext:i}=this.slideApi.slideClickHandler(e.target,r);this._disabledNextClick=!i}destroy(){}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))}handleSlideError(e){console.error(e),this.message.showErrorScreen(),this.message.touchController.off(vr.TouchEnd,this.handleTouchEnd)}delay(e){return new Promise((t=>setTimeout(t,e)))}async cleanupLoaderIfNeeded(e){e&&(await this.delay(500),this.message.hideLoaderScreen())}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],i=[_.computed],ko(e,null,r,{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},a,o),ko(e,null,i,{kind:"getter",name:"isLoading",static:!1,private:!1,access:{has:e=>"isLoading"in e,get:e=>e.isLoading},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Eo{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){var t,r;try{await this.storyManager.openGame(e.gameInstanceId),null===(t=this.iamMessage.activeSlide)||void 0===t||t.pauseAndLock(),null===(r=this.storyManager.gameReaderViewModel)||void 0===r||r.once(Zi.Close,(()=>{var e;null===(e=this.iamMessage.activeSlide)||void 0===e||e.resumeAndUnlock()}))}catch(e){console.error(e)}}}class Mo{constructor(e){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}subscribe(){document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange)}unsubscribe(){document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange)}handleDocumentVisibilityChange(){const e=this.iamReader.activeMessage;document.hidden?e.trackClose():e.trackOpen()}}class Io extends Error{constructor(e){super(`[IAM]: you must close IAM with ID ${e}`),this.name="IamMessageOpenError"}}var To,Lo=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},Ao=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Ro=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)},Bo=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"}(To||(To={}));let Do=(()=>{var e,t;let r,i,a,o,n=s,l=[],c=[],d=[];return e=class extends n{get _activeMessage(){return Ro(this,t,"f")}set _activeMessage(e){Bo(this,t,e,"f")}constructor(r,i,s,a){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Lo(this,l),r)}),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,Lo(this,c,null)),Object.defineProperty(this,"visibilityObserver",{enumerable:!0,configurable:!0,writable:!0,value:Lo(this,d)}),Object.defineProperty(this,"_touchController",{enumerable:!0,configurable:!0,writable:!0,value:new kr}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new Ar(window)}),Object.defineProperty(this,"eventPublisher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storyManager.setViewModel(e.id,this),this.visibilityObserver=new Mo(this)}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)}async preload(e){await this.storyManager.waitStoryManagerConfig();return await this.iamStore.preload(e)}async showMessageById(e,t){await this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const r=await this.iamDisplayService.getMessageById(e,t);return await this.open(r),r}async showMessageByEvent(e,t){await this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const r=await this.iamDisplayService.getMessageByEvent(e,t);return await this.open(r),r}async close(){this._activeMessage&&(this.emitCloseEvent(this._activeMessage),this.clearActiveMessage(),this.visibilityObserver.unsubscribe(),this.touchController.destroy(),this.scrollbarHelper.enable())}async open(e){e.updatePlaceholders(this.storyManager.rootStore.placeholderStore.placeholders),this.touchController.init(document.body),this.setActiveMessage(e),this.visibilityObserver.subscribe(),this.scrollbarHelper.disable()}destroy(){this.storyManager.deleteViewModel(e.id)}emitWidgetEvent(e){this.emit(To.WidgetEvent,{message:this.activeMessage.toPublicDto(),name:e.type,data:e.toJSON()})}setEventPublisher(e){this.eventPublisher=e}emit(e,...t){return super.emit(e,...t),this.eventPublisher.emit(e,...t)}emitCloseEvent(e){this.emit(To.Close,{message:e.toPublicDto()})}setActiveMessage(e){const t=this.createIamMessageViewModel(e);t.trackOpen(),this._activeMessage=t}clearActiveMessage(){this._activeMessage&&(this._activeMessage.trackClose(),this._activeMessage=null)}createIamMessageViewModel(e){return new qo(this,this.storyManager,e,this.iamStatisticsService)}checkMessageNotOpened(){if(this.activeMessage)throw new Io(this.activeMessage.id)}},t=new WeakMap,(()=>{var t;const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=n[Symbol.metadata])&&void 0!==t?t:null):void 0;r=[_.observable],i=[_.action],a=[_.action],o=[_.action],Ao(e,null,r,{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:s},c,d),Ao(e,null,i,{kind:"method",name:"showMessageById",static:!1,private:!1,access:{has:e=>"showMessageById"in e,get:e=>e.showMessageById},metadata:s},null,l),Ao(e,null,a,{kind:"method",name:"showMessageByEvent",static:!1,private:!1,access:{has:e=>"showMessageByEvent"in e,get:e=>e.showMessageByEvent},metadata:s},null,l),Ao(e,null,o,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:s},null,l),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:"IamReaderViewModel"}),e})();class No{constructor(e){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventEmitter",{enumerable:!0,configurable:!0,writable:!0,value:new(t())}),this.iamReader.setEventPublisher(this.eventEmitter)}get activeMessage(){var e;return null===(e=this.iamReader.activeMessage)||void 0===e?void 0:e.toPublicDto()}get isLoaded(){return this.iamReader.isLoaded}get isLoading(){return this.iamReader.isLoading}get isOpened(){return this.iamReader.isOpened}async preload(e){const t=(await this.iamReader.preload({tags:null==e?void 0:e.tags})).map((e=>e.toPublicDto()));return this.eventEmitter.emit(To.Loaded,{messages:t}),t}async showMessageById(e,t){return(await this.iamReader.showMessageById(e,{showOnlyIfLoaded:null==t?void 0:t.showOnlyIfLoaded})).toPublicDto()}async showMessageByEvent(e,t){return(await this.iamReader.showMessageByEvent(e,{showOnlyIfLoaded:null==t?void 0:t.showOnlyIfLoaded,tags:null==t?void 0:t.tags})).toPublicDto()}async close(){return this.iamReader.close()}on(e,t){return this.eventEmitter.on(e,t),this}once(e,t){return this.eventEmitter.once(e,t),this}off(e,t){return this.eventEmitter.off(e,t),this}}class Vo{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;this.emitWidgetEvent(t,e.elementId),this.emitClickOnButtonEvent(t,e.elementId)}emitWidgetEvent(e,t){const r=new Ea(null!=t?t:"",e,"");this.iamMessage.trackWidgetEvent(r),this.iamReader.emitWidgetEvent(r)}emitClickOnButtonEvent(e,t){const r=this.getClickOnButtonEventPayload(e,t);this.iamReader.emit(To.ClickOnButton,r);const i={src:Wt.IAM_READER,data:r};this.storyManager.emit("clickOnButton",i),this.storyManager.storyLinkClickHandler?this.storyManager.storyLinkClickHandler(i):window.open(r.url,"_self")}getClickOnButtonEventPayload(e,t){return{id:this.iamMessage.id,index:this.iamMessage.activeSlideIndex,url:e,elementId:t}}}class Fo{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){var t;try{await this.storyManager.showStory(e.storyId),null===(t=this.message.activeSlide)||void 0===t||t.pauseAndLock(),this.storyManager.storyReaderViewModel.once(Hs.Close,(()=>{var e;null===(e=this.message.activeSlide)||void 0===e||e.resumeAndUnlock()}))}catch(e){console.error(e)}}}class Uo{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 Go{constructor(e,t,r){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,"activeMessageNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Uo}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new Uo})}clearActiveNarrativeDataCache(){this.activeMessageNarrativeDataCache.clear()}writeToClipboard(e){w(e.textValue)}updateCardServerDataLocally(e){this.iamMessage.context.updateNarrativeData(e)}openUrl(e){"swipeUpItems"!==e.type&&new Vo(this.iamReader,this.storyManager,this.iamMessage).handle({linkTarget:e.link.target,elementId:e.elementId})}closeCard(e){this.iamReader.close()}openStory(e,t){new Fo(this.storyManager,this.iamMessage).handle({storyId:e})}openGame(e){new Eo(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}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await le.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){var t;null===(t=this.iamMessage.activeSlide)||void 0===t||t.showLayerByIndex(e)}showCardSlide(e){}cardShowNext(){}showNextSlide(){}sendStatisticEvent(e,t,r,i){let s=(new Ca).create(e,t);s&&(this.iamMessage.trackWidgetEvent(s),this.iamReader.emitWidgetEvent(s))}destroy(){}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:[]}updateTimeline(e,t,r,i,s,a){s?this.iamMessage.showLoaderScreen():this.iamMessage.hideLoaderScreen(),a?this.iamMessage.showErrorScreen():this.iamMessage.hideErrorScreen()}showToast(e){var t;null===(t=this.iamMessage.activeSlide)||void 0===t||t.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},zo=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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)},Ho=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 qo=(()=>{var e,t,r,i,a;let o,n,l,c,d,u,h,p,g=s,f=[],m=[],y=[],v=[],b=[],w=[],S=[],O=[],x=[];return e=class extends g{get _isOnceOpened(){return $o(this,t,"f")}set _isOnceOpened(e){Ho(this,t,e,"f")}get _$root(){return $o(this,r,"f")}set _$root(e){Ho(this,r,e,"f")}get _needShowErrorScreen(){return $o(this,i,"f")}set _needShowErrorScreen(e){Ho(this,i,e,"f")}get _needShowLoaderScreen(){return $o(this,a,"f")}set _needShowLoaderScreen(e){Ho(this,a,e,"f")}constructor(e,s,o,n){super(),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:(Wo(this,f),e)}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,Wo(this,m,!1)),r.set(this,(Wo(this,y),Wo(this,v,null))),i.set(this,(Wo(this,b),Wo(this,w,!1))),a.set(this,(Wo(this,S),Wo(this,O,!1))),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:Wo(this,x)}),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.createSlidesViewModels()}}),this.touchController=e.touchController,this.slideApiHandlers=new Go(this.storyManager,this.iamReader,this)}get id(){return this.iamMessage.id}get $root(){return this._$root}get activeSlideIndex(){return 0}get activeSlide(){return this._slides[this.activeSlideIndex]}get slides(){return this._slides}get context(){return this.iamMessage.context}get appearanceOptions(){return this.iamMessage.appearanceOptions}get type(){return this.iamMessage.type}get needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}async trackOpen(){this._isOnceOpened=!0,await this.iamStatisticsService.trackOpen(this.iamMessage,{activeSlideIndex:this.activeSlideIndex})}async trackClose(){await this.iamStatisticsService.trackClose(this.iamMessage,{activeSlideIndex:this.activeSlideIndex})}async trackWidgetEvent(e){await this.iamStatisticsService.trackWidgetEvent(this.iamMessage,e,{activeSlideIndex:this.activeSlideIndex})}async updateUserData(e){return this.storyManager.rootStore.iamStore.updateMessageUserData(this.id,e)}async init(){var e;await(null===(e=this.activeSlide)||void 0===e?void 0:e.init())}async start(){var e;await(null===(e=this.activeSlide)||void 0===e?void 0:e.start())}async stop(){var e;this.slideApiHandlers.clearActiveNarrativeDataCache(),await(null===(e=this.activeSlide)||void 0===e?void 0:e.stop())}toPublicDto(){return this.iamMessage.toPublicDto()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}destroy(){var e;null===(e=this.slideApi)||void 0===e||e.destroy()}createSlidesViewModels(){if(this._slides.length>0)return;const e=this.type===uo.Fullscreen,t=new ir.SlideApi(this.slideApiHandlers,{root:this._$root,slideRatio:this.getContentRatio(),isFullscreen:e,nonce:T(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand});this._slides=this.iamMessage.slides.map((e=>new jo(this,e,t))),this.slideApi=t}getContentRatio(){return this.appearanceOptions instanceof be||this.appearanceOptions instanceof _e?this.appearanceOptions.contentRatio:9/16}},t=new WeakMap,r=new WeakMap,i=new WeakMap,a=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;o=[_.observable],n=[_.observable],l=[_.observable],c=[_.observable],d=[_.action],u=[_.action],h=[_.action],p=[_.action],zo(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},m,y),zo(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},v,b),zo(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},w,S),zo(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),zo(e,null,d,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,f),zo(e,null,u,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,f),zo(e,null,h,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,f),zo(e,null,p,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,f),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class Zo{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 Ko=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Qo=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},Yo=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)},Jo=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 Xo=(()=>{var e,t;let r,i=s,a=[],o=[];return e=class extends i{get topStory(){return Yo(this,t,"f")}set topStory(e){Jo(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 it(yl,new Lt)}),t.set(this,Qo(this,a,null)),Qo(this,o),this.options=e,this._id=(0,l.v4)(),this.handleShowStory=this.handleShowStory.bind(this),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.subscribeToStoryReader().catch(console.error),yl.setViewModel(this._id,this)}get stories(){return this.storyFeed?this.storyModels.map((e=>new Zo(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=yl.storyReaderViewModel;null==e||e.off(Hs.Close,this.handleCloseStoryReader),yl.off("showStory",this.handleShowStory),this.emit("destroy"),yl.deleteViewModel(this._id)}async showStory(e){if(!e)return;const t=ml.instance,r=R()(e.deeplink)&&e.deeplink.trim().length>0,i=e.gameInstanceId;if(e.hideInReader&&!r&&!i)return void console.error("[StackedStoryList]: Cannot open hidden story id "+e.id);if(r&&null!==e.deeplink){const r={index:0,id:e.id,story:e,isDeeplink:!0,url:e.deeplink},i={src:Wt.STACK_STORY_LIST,data:r};return t.emit("clickOnButton",i),t.storyLinkClickHandler?t.storyLinkClickHandler(i):window.open(e.deeplink,"_self"),void this.markStoryAsOpened(e.id)}if(i)return t.openGame(i).catch(console.error),void this.markStoryAsOpened(e.id);const s=await t.waitViewModel(Js.id);s&&this.storyFeed&&(s.showMultipleStories({storyId:e.id,storyFeed:this.storyFeed,windowReferer:Jt.stacked}),this.markStoryAsOpened(e.id))}async loadStories(){try{this.emit("startLoad"),this.storyFeed=await yl.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 Zo(e,this.storyFeed),this.onUpdateTopStory(this.topStory),this.emit("update",this.topStory)}handleCloseStoryReader(){this.top&&this.markStoryAsShownById(this.top.id)}markStoryAsOpened(e){yl.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{const e=await yl.waitViewModel(Js.id);yl.on("showStory",this.handleShowStory),e.on(Hs.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=yl.rootStore.storyStore.findStoryById(e);t&&this.storyFeed&&!t.wasShown&&(this.storyFeedImpressionService.sendCoverageEvent([t],this.storyFeed),t.markWasShown())}},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=[_.observable],Ko(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:s},a,o),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();class en{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}createStoryReader(){return new Xs(this.storyManager).create()}createGameReader(){return new es(this.storyManager).create()}createStoryList(){return new _n(this.storyManager).create()}createInAppMessagingReader(){const e=this.storyManager.rootStore.iamStore,t=new ye(this.storyManager),r=new ro(t);return new Do(this.storyManager,e,new co(this.storyManager,e,t),r)}}class tn extends s{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 rn extends tn{static create(e,t){var r;const i=new jt({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:rn.getBgImage(e)});return new rn(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,${P(e.image.svgSrc.baseState)}`}),t}}class sn{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){this.storyManager.rootStore.storyStore.markIsOpenedById(e.id);const r={src:Wt.STORY_LIST,data:{id:e.id,index:t.index,isDeeplink:!0,url:e.deeplink}};if(this.storyListViewModel.params.listType!==Ge.UGC&&await this.storyFeedStatisticV1Service.sendDeeplinkClickEvent(e.id),this.storyManager.emit("clickOnButton",r),this.storyManager.storyLinkClickHandler||this.storyManager.listenerCount(tr.CLICK_ON_STORY)>0)try{this.storyManager.storyLinkClickHandler&&this.storyManager.storyLinkClickHandler(r),this.storyManager.emit(tr.CLICK_ON_STORY,r)}catch(e){console.error(e)}else window.open(e.deeplink,"_self")}}class an{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyListViewModel",{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.gameReaderViewModel.openGame(i,{})}}class on{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e,t){const r=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(this.storyListViewModel.params.feedSlug),i={storyId:e.id,storyFeed:r,windowReferer:this.storyListViewModel.params.isFavorite?Jt.favorite:Jt.default};this.openStoryReader(i),this.emitClickOnStory({id:e.id,index:t.index,isDeeplink:!1,storyFeed:r,filter:this.storyListViewModel.params.filter})}async openStoryReader(e){try{await this.storyManager.storyReaderViewModel.showMultipleStories({storyId:e.storyId,storyFeed:e.storyFeed,filter:this.storyListViewModel.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,tags:[],slidesCount:null,feed:null,filter:null,source:null};a.title=s.statTitle,a.tags=s.tags,a.slidesCount=s.slidesCount,t.type===Ge.DEFAULT?a.feed=r:t.type===Ge.UGC&&(a.filter=i),a.source=Yt.list,this.storyManager.emit("clickOnStory",Object.assign({id:e.id,index:e.index,isDeeplink:e.isDeeplink},a))}}class nn{static createHandler(e,t,r,i){const{deeplink:s,hideInReader:a,gameInstance:o}=e,n=R()(s)&&s.trim().length>0,l=null==o?void 0:o.id;return this.isInvalidStoryClick(Boolean(a),n,l,e.id)?null:n?new sn(t,r,i):l?new an(t,r):new on(t,r)}static isInvalidStoryClick(e,t,r,i){return!(!e||t||r)&&(console.error(`Cannot open hidden story id ${i}`),!0)}}class ln extends tn{constructor(e,t){super(e,t)}}class cn extends tn{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 ln(this.storyListViewModel,e)))}static create(e,t,r){const i=new jt({id:0,title:e.title.content,title_color:e.title.color,is_opened:!0,background_color:"white"});return new cn(r,t,i)}}class dn{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 dn(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 dn(e.x,e.y,e.width,e.height)}}class un{constructor(){Object.defineProperty(this,"storyRects",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:new dn}),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=dn.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 dn{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 pn{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 dn;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 gn{create(){const e=new un;return new pn(e)}}class fn{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,tags:[],slidesCount:null,visibleArea:t},s=this.storyManager.rootStore.storyStore.findStoryById(e);return s&&(r.title=s.statTitle,r.tags=s.tags,r.slidesCount=s.slidesCount,i===Ge.UGC&&(r.ugcPayload=rt()(s.ugcPayload)?s.ugcPayload:{})),Object.assign({id:e},r)})),feed:null,filter:null};i===Ge.DEFAULT?s.feed=t:i===Ge.UGC&&(s.filter=r),this.storyManager.emit("visibleAreaUpdated",s)}}class mn{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 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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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 a,o,n,l,c,d,u,p,g,f,m=s,y=[],v=[],b=[],w=[],S=[],O=[],x=[];return e=class extends m{get ugcCardOptions(){return bn(this,t,"f")}set ugcCardOptions(e){wn(this,t,e,"f")}get favoriteCardOptions(){return bn(this,r,"f")}set favoriteCardOptions(e){wn(this,r,e,"f")}get _params(){return bn(this,i,"f")}set _params(e){wn(this,i,e,"f")}constructor(s,a,o,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(yn(this,y),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,yn(this,v,null)),r.set(this,(yn(this,b),yn(this,w,null))),i.set(this,(yn(this,S),yn(this,O,{listType:Ge.DEFAULT,feedSlug:"",useUgcCard:!1,isFavorite:!1,hasFavorite:!1}))),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:(yn(this,x),!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.setViewModel(this._id,this),this.feedCoverageAnalytics=(new gn).create(),this.feedCoverageAnalytics.addMetric(new mn(this,this.storyFeedStatisticV1Service,this.storyFeedStatisticV2Service)),this.feedCoverageAnalytics.addMetric(new fn(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 tn(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===Ge.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=nn.createHandler(e,this.storyManager,this,this.storyFeedStatisticV1Service))||void 0===r||r.handle(e,{index:t})}destroy(){this.removeAllListeners(),this.storyManager.deleteViewModel(this._id),this.feedCoverageAnalytics.destroy()}async reload(){await this.loadStories({needFavorite:!0})}getAspectRatio(e){var t,r;switch(e){case Kt.STYLE_CIRCLE:case Kt.STYLE_QUAD:return 1;case Kt.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===Ze)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===Ge.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 rn.create(e,this)}createFavoriteCard(e){return cn.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=m[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[_.observable],o=[_.observable],n=[_.observable],l=[_.computed],c=[_.computed],d=[_.computed],u=[_.computed],p=[_.computed],g=[_.action],f=[_.action],vn(e,null,a,{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},v,b),vn(e,null,o,{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},w,S),vn(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,x),vn(e,null,l,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:r},null,y),vn(e,null,c,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:r},null,y),vn(e,null,d,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:r},null,y),vn(e,null,u,{kind:"getter",name:"hasFavoriteCard",static:!1,private:!1,access:{has:e=>"hasFavoriteCard"in e,get:e=>e.hasFavoriteCard},metadata:r},null,y),vn(e,null,p,{kind:"getter",name:"hasUgcCard",static:!1,private:!1,access:{has:e=>"hasUgcCard"in e,get:e=>e.hasUgcCard},metadata:r},null,y),vn(e,null,g,{kind:"method",name:"setParams",static:!1,private:!1,access:{has:e=>"setParams"in e,get:e=>e.setParams},metadata:r},null,y),vn(e,null,f,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:r},null,y),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 _n{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new On(this.storyManager);return new Sn(this.storyManager,e,new it(this.storyManager,new Lt),new kn(this.storyManager,new At(this.storyManager)))}}class On{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=r===Ge.DEFAULT&&s,o=this.storyManager.rootStore.storyFeedStore,n=await this.fetchStoryFeed(o,e,t,i);let l=null;a&&(l=await o.fetchFavoriteFeed());const c=this.getFeedLoadEventStoryDtos(n);return this.emitFeedLoadEvent(n,c,e,t),{storyFeed:n,favoriteFeed:l}}async fetchStoryFeed(e,t,r,i){return t===Xe?e.fetchUgcFeed({filter:r,testKey:i}):e.fetchDefaultFeed({feedSlug:t,testKey:i})}getFeedLoadEventStoryDtos(e){return e.stories.map((t=>{const r={title:null,tags:[],slidesCount:null};return r.title=t.statTitle,r.tags=t.tags,r.slidesCount=t.slidesCount,e.type===Ge.UGC&&(r.ugcPayload=g()(t.ugcPayload)?t.ugcPayload:{}),Object.assign({id:t.id},r)}))}emitFeedLoadEvent(e,t,r,i){const s={stories:t,feed:null,filter:null};e.type===Ge.DEFAULT?s.feed=r:e.type===Ge.UGC&&(s.filter=i),this.storyManager.emit("feedLoad",s)}}class xn{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 kn{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 xn(e);await this.statisticV2Api.sendStatisticEvent(t)}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class Cn{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.inAppMessaging=new No(e.inAppMessaging)}get sdkVersionName(){return this.storyManager.sdkVersionName}get sdkVersionCode(){return this.storyManager.sdkVersionCode}set storyLinkClickHandler(e){this.storyManager.storyLinkClickHandler=e}setUserAgent(e){yl.setUserAgent(e)}getConfig(){return this.storyManager.config}getNonce(){return T()}async showOnboardingStories(e){return this.storyManager.showOnboardingStories(e)}async showStory(e){return this.storyManager.showStory(e)}async showStoryOnce(e){return this.storyManager.showStoryOnce(e)}closeAllReaders(){this.storyManager.closeAllReaders()}async openGame(e,t={}){return this.storyManager.openGame(e,t)}async closeGame(){return this.storyManager.closeGame()}async waitStoryManagerConfig(){return this.storyManager.waitStoryManagerConfig()}async closeStoryReader(){return this.storyManager.closeStoryReader()}getUgcEditorConfig(){return this.storyManager.getUgcEditorConfig()}showSharePage(e){return this.storyManager.showSharePage(e)}closeGoodsWidget(){this.storyManager.closeGoodsWidget()}on(e,t){return this.storyManager.on(e,t),this}once(e,t){return this.storyManager.once(e,t),this}off(e,t){return this.storyManager.off(e,t),this}static use(e,t){yl.use(e,t)}}class Pn{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}install(e,t){this.plugins.set(e.name,e),S(`[PluginManager]: plugin ${e.name} registered`),e.install(this.storyManager,t),S(`[PluginManager]: plugin ${e.name} installed`)}uninstall(e){e.uninstall(this.storyManager),this.plugins.delete(e.name),S(`[PluginManager]: plugin ${e.name} uninstalled`)}get(e){return this.plugins.get(e)}}class jn extends Error{constructor(e){super(`[IAM]: not found IAM for event <${e}>`),this.name="IamNotFoundByEventError"}}var En=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},Mn=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},In=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)},Tn=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 Ln=(()=>{var e,t,r,i;let s,a,o,n,l,c=[],d=[],u=[],h=[],p=[],g=[],f=[];return e=class{get _messages(){return In(this,t,"f")}set _messages(e){Tn(this,t,e,"f")}get _isLoaded(){return In(this,r,"f")}set _isLoaded(e){Tn(this,r,e,"f")}get _isLoading(){return In(this,i,"f")}set _isLoading(e){Tn(this,i,e,"f")}constructor(e,s){Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:(En(this,c),e)}),Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,En(this,d,_.observable.map())),r.set(this,(En(this,u),En(this,h,!1))),i.set(this,(En(this,p),En(this,g,!1))),Object.defineProperty(this,"_messageContext",{enumerable:!0,configurable:!0,writable:!0,value:(En(this,f),null)})}get messages(){return Array.from(this._messages.values())}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}get messageContext(){return this._messageContext}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 jn(e)}async updateMessageUserData(e,t){return this.iamApi.updateUserData(e,t)}async fetchById(e){await this.rootStore.sessionStore.open(),await this.fetchMessageContext();const t=await this.iamApi.fetchById(e);return this.createMessageByDto(t)}async fetchAll(e){await this.rootStore.sessionStore.open(),await this.fetchMessageContext();const t=e.tags?e.tags:this.rootStore.storyManagerConfigStore.config.tags,r=await this.iamApi.fetchAll({tags:j(t)});return this.createMessagesByDtos(r)}async fetchMessageContext(){await this.rootStore.sessionStore.open(),this._messageContext||(this._messageContext=await this.iamApi.fetchContext())}createMessagesByDtos(e){this._messages.clear();const t=[];for(const r of e){const e=this.createMessageByDto(r);t.push(e)}return t}createMessageByDto(e){if(!this.messageContext)throw new Error("[IAS]: IAM context not found");const t=Ya.createByDto(e),r=new Ha(e.id,this.messageContext);return t.setContext(r),this._messages.has(t.id.toString())||this._messages.set(t.id.toString(),t),t}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[_.observable],a=[_.observable],o=[_.observable],n=[_.computed],l=[x,k],Mn(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,u),Mn(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},h,p),Mn(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),Mn(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),Mn(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 An=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},Rn=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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)},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 Nn=(()=>{var e,t;let r,i,s,a,o=[],n=[],l=[];return e=class{get _session(){return Bn(this,t,"f")}set _session(e){Dn(this,t,e,"f")}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(An(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,An(this,n,null)),An(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:De}async open(){if(this._session)return this._session;const e=this.storyManager.config,t=await this.sessionApi.open({userId:e.userId,userIdSign:e.userIdSign}),r=new Ne(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=[_.observable],i=[_.computed],s=[_.computed],a=[x],Rn(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),Rn(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),Rn(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),Rn(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 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},Fn=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Un=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)},Gn=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 Wn=_.observable.map();let zn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storiesByUserId(){return Un(this,t,"f")}set _storiesByUserId(e){Gn(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:Wn}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Vn(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,Vn(this,a,_.observable.map())),Object.defineProperty(this,"storyCSS",{enumerable:!0,configurable:!0,writable:!0,value:(Vn(this,o),"")}),(0,_.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 jt(e);return 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.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.updatePlaceholders(this.rootStore.placeholderStore.placeholders),o}async fetchStoryCSS(){this.storyCSS||(this.storyCSS=await this.storiesApi.fetchStoryCSS())}async fetchStoryContext({id:e,feedSlug:t}){const r=await this.storiesApi.fetchStoryContext({ids:[e],feedSlug:t});return new Ot(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 Ot(e,Object.assign(Object.assign({},r),{style:this.storyCSS}))))}getOrCreateStoriesMap(){const e=this.rootStore.sessionStore.userId;let t=_.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=[_.observable],i=[_.computed],Fn(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),Fn(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 $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},Hn=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},qn=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};const Kn=_.observable.map();let Qn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storyFeedsByUserId(){return qn(this,t,"f")}set _storyFeedsByUserId(e){Zn(this,t,e,"f")}constructor(e,r){Object.defineProperty(this,"storyFeedsApi",{enumerable:!0,configurable:!0,writable:!0,value:($n(this,s),e)}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,$n(this,a,_.observable.map())),$n(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:Kn}getUgcFeed(){var e;return null!==(e=this.getFeedBySlug(Xe))&&void 0!==e?e:et.createByStories([])}getFavoriteFeed(){var e;return null!==(e=this.getFeedBySlug(Ze))&&void 0!==e?e:Ke.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.tags,s=await this.storyFeedsApi.fetchDefaultFeed({feedSlug:e,tags:i,testKey:t}),a=this.rootStore.storyStore.addStoriesByDtos(s.stories),o=new qe(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=Ke.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.tags,s=await this.storyFeedsApi.fetchUgcFeed({filter:e,tags:i,testKey:t}),a=this.rootStore.storyStore.addStoriesByDtos(s),o=et.createByStories(a,{filter:e});return this.addStoryFeed(r.userKey,o),o}addStoryFeed(e,t){let r=_.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=[_.observable],i=[_.computed],Hn(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),Hn(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 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},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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Xn=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)},el=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 tl=_.observable.map();let rl=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _onboardingFeedsByUserId(){return Xn(this,t,"f")}set _onboardingFeedsByUserId(e){el(this,t,e,"f")}constructor(e,r){Object.defineProperty(this,"storyFeedsApi",{enumerable:!0,configurable:!0,writable:!0,value:(Yn(this,s),e)}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,Yn(this,a,_.observable.map())),Object.defineProperty(this,"cacheDataInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:(Yn(this,o),!1)}),(0,_.reaction)((()=>{const e=this.rootStore.storyManagerConfigStore.config;return e?[e.lang,e.apiKey]: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:tl}getFeedBySlug(e){return this.activeUserFeeds.get(null!=e?e:Je.getDefaultSlug())}removeStoryFromOnboardingFeedsById(e){for(const t of this.activeUserFeeds.values())t.removeById(e)}invalidateCacheData(){this.cacheDataInvalidated=!0}async fetchOnboardingFeed(e){let t=e.feedSlug||Je.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=await this.storyFeedsApi.fetchOnboardingFeed(Object.assign(Object.assign({},r),{feedSlug:t})),o=this.rootStore.storyStore.addStoriesByDtos(a.stories);return i=new Je(a,o,r),this.addOnboardingFeed(s.userKey,i),this.commitCacheData(),i}addOnboardingFeed(e,t){let r=_.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:j(t),limit:e.limit}}commitCacheData(){this.cacheDataInvalidated=!1}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],i=[_.computed],Jn(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),Jn(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 il{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.7.3";return this._config={sessionId:e.id,apiKey:r.apiKey,editor:null!=t?t:{},sdkVersion:i,appPackageId:r.appPackageId,deviceId:ie.deviceId,userId:null!=r.userId?String(r.userId):void 0,lang:r.lang.toString()},this._config}}class sl{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcEditorConfig(){return(await le.request({method:"GET",url:"ugc/editor-config",params:{}})).data}}var al=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},ol=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},nl=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)},ll=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 cl=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _placeholders(){return nl(this,t,"f")}set _placeholders(e){ll(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=_.observable.map()}constructor(){t.set(this,(al(this,s),al(this,a,_.observable.map()))),al(this,o)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],i=[_.computed],ol(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),ol(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 dl=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},ul=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},hl=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)},pl=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 gl=(()=>{var e,t;let r,i=[],s=[];return e=class{get _config(){return hl(this,t,"f")}set _config(e){pl(this,t,e,"f")}constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.set(this,ul(this,i,new za)),ul(this,s),this.storyManager=e}get config(){return this._config}setConfig(e){this._config instanceof Wa?this.updateConfig(e):this.initializeConfig(e)}clear(){this._config=new za,this.storyManager.rootStore.sessionStore.close()}async waitStoryManagerConfig(){return new Promise(((e,t)=>{let r;const i=()=>{if(this._config instanceof Wa)return clearTimeout(r),void e();requestAnimationFrame(i)};r=setTimeout((()=>{t("[IAS]: Timeout waiting for InAppStoryManager config")}),5e3),i()}))}initializeConfig(e){this._config=new Wa(this.storyManager,e)}updateConfig(e){this._config.updateByDto(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[_.observable],dl(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 fl{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 st(e),r=new at(e);this.storyManagerConfigStore=new gl(e),this.placeholderStore=new cl,this.iamStore=new Ln(this,new ye(e)),this.sessionStore=new Nn(e,new Me,this),this.storyStore=new zn(e,t,this),this.storyFeedStore=new Qn(r,this),this.onboardingFeedStore=new rl(r,this),this.ugcEditorStore=new il(e,new sl(e))}}class ml extends e.EventEmitter{constructor(){return super(),Object.defineProperty(this,"viewModelStore",{enumerable:!0,configurable:!0,writable:!0,value:new n}),Object.defineProperty(this,"pluginManager",{enumerable:!0,configurable:!0,writable:!0,value:new Pn(this)}),Object.defineProperty(this,"_rootStore",{enumerable:!0,configurable:!0,writable:!0,value:new fl(this)}),Object.defineProperty(this,"globalProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_storyLinkClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_userAgent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:this.createInAppMessagingReader()}),ml.isSingletonInstanceExists()||(ml.instance=this,this.setUserAgent(`InAppStoryReactSDK/${this.sdkVersionCode}`)),ml.instance}get rootStore(){return this._rootStore}get userAgent(){return this._userAgent}get sdkVersionName(){return"1.7.3"}get sdkVersionCode(){return parseInt(10703)}get lang(){return this.rootStore.storyManagerConfigStore.config.lang}set storyLinkClickHandler(e){i()(e)&&(this._storyLinkClickHandler=e)}get storyLinkClickHandler(){return this._storyLinkClickHandler}get storyReaderViewModel(){return this.viewModelStore.get(Js.id)}get gameReaderViewModel(){return this.viewModelStore.get(Xi.id)}get isStatisticsDisabled(){return this.config.isStatisticsDisabled}get config(){return this.rootStore.storyManagerConfigStore.config}static getInstance(){return ml.instance?ml.instance:null}setViewModel(e,t){this.viewModelStore.set(e,t)}deleteViewModel(e){this.viewModelStore.delete(e)}getViewModelByKey(e){return this.viewModelStore.get(e)}setConfig(e){this.rootStore.storyManagerConfigStore.setConfig(e)}setUserAgent(e){parseInt(10703);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 waitViewModel(e){return this.viewModelStore.wait(e)}async waitStoryManagerConfig(){return this.rootStore.storyManagerConfigStore.waitStoryManagerConfig()}async showOnboardingStories(e){var t,r;return await this.viewModelStore.wait(Js.id),this.storyReaderViewModel.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})}async showStory(e){"string"==typeof e&&(e=+e||e),await this.viewModelStore.wait(Js.id),await this.storyReaderViewModel.showStory(e)}async showStoryOnce(e){"string"==typeof e&&(e=+e||e),await this.viewModelStore.wait(Js.id),await this.storyReaderViewModel.showStoryOnce(e)}async showSharePage(e){"string"==typeof e&&(e=+e||e),await this.viewModelStore.wait(Js.id),await this.storyReaderViewModel.showStoryFromSharePage(e)}closeAllReaders(){var e,t;null===(e=this.storyReaderViewModel)||void 0===e||e.close(),null===(t=this.gameReaderViewModel)||void 0===t||t.closeGame()}closeGoodsWidget(){var e;null===(e=this.storyReaderViewModel)||void 0===e||e.closeGoodsWidget()}async openGame(e,t={}){await this.viewModelStore.wait(Xi.id),await this.gameReaderViewModel.openGame(e,t)}async closeGame(){return this.gameReaderViewModel.closeGame()}async closeStoryReader(){this.storyReaderViewModel.close()}async getUgcEditorConfig(){return this.rootStore.ugcEditorStore.getUgcEditorConfig()}reloadAllStoryLists(){const e=this.viewModelStore.getAllOfType((e=>e instanceof Sn));return Promise.all(e.map((e=>e.reload())))}reloadAllStackedStoryLists(){const e=this.viewModelStore.getAllOfType((e=>e instanceof Xo));return Promise.all(e.map((e=>e.reload())))}static isSingletonInstanceExists(){return!!ml.instance&&(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),!0)}use(e,t){this.pluginManager.install(e,t)}getPlugin(e){return this.pluginManager.get(e)}createStoryReader(){return new en(this).createStoryReader()}createGameReader(){return new en(this).createGameReader()}createStoryList(){return new en(this).createStoryList()}createInAppMessagingReader(){return new en(this).createInAppMessagingReader()}clearConfig(){this.rootStore.storyManagerConfigStore.clear()}emitEvent(e){this.emit(e.name,e.toJSON())}}const yl=new ml,vl=new Cn(yl);var bl;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(bl||(bl={}));const wl={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};var Sl;!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"}(Sl||(Sl={}));Error;class _l extends e.EventEmitter{constructor(){super(),Object.defineProperty(this,"_commonOptions",{enumerable:!0,configurable:!0,writable:!0,value:Vt}),Object.defineProperty(this,"_storiesListOptions",{enumerable:!0,configurable:!0,writable:!0,value:pt}),Object.defineProperty(this,"_storyReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:Zt}),Object.defineProperty(this,"_storyFavoriteReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:wl}),Object.defineProperty(this,"_goodsWidgetOptions",{enumerable:!0,configurable:!0,writable:!0,value:Gt}),Object.defineProperty(this,"_gameReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:Ft})}setCommonOptions(e,t=!0){return this._commonOptions=_r()(this._commonOptions,e),this.emit(Sl.UPDATE,this.commonOptions),this}get commonOptions(){return this._commonOptions}setStoriesListOptions(e,t=!0){return this._storiesListOptions=_r()(this._storiesListOptions,e),t&&(this.emit(Sl.UPDATE,this.storiesListOptions),this.emit(Sl.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?qt.Modern:qt.Classic),this._storyReaderOptions=_r()(this._storyReaderOptions,e,{arrayMerge:(e,t,r)=>t}),t&&this.emit(Sl.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=_r()(this._storyFavoriteReaderOptions,e),t&&this.emit(Sl.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=_r()(this._goodsWidgetOptions,e),t&&this.emit(Sl.UPDATE,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}setGameReaderOptions(e,t=!0){return this._gameReaderOptions=_r()(this._gameReaderOptions,e),t&&this.emit(Sl.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,_.configure)({enforceActions:"never"}),window.__IAS__={storyManager:yl},(0,_.configure)({enforceActions:"never"});var Ol=M(5272),xl=M(9155),kl=M.n(xl);var Cl=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 Pl=e=>{var{listType:t,feedSlug:r,testKey:i,storyManager:s,options:a,filter:o,useUgcCard:n=!1,hasFavorite:l,isFavorite:c}=e,d=Cl(e,["listType","feedSlug","testKey","storyManager","options","filter","useUgcCard","hasFavorite","isFavorite"]);const[u,h]=(0,xl.useState)(),{storyListOptions:p}=(e=>{const t=(0,xl.useRef)(new _l).current;return{storyListOptions:(0,xl.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,xl.useEffect)((()=>{const e=s.createStoryList();return e.on("startLoading",g),e.on("endLoading",f),h(e),()=>{e.off("startLoading",g),e.off("endLoading",f),e.destroy()}}),[s]),(0,xl.useEffect)((()=>{u&&(u.setParams({listType:t,testKey:i,feedSlug:r,filter:o,useUgcCard:n,isFavorite:c,hasFavorite:l}),c||u.loadStories({needFavorite:!0}))}),[u,i,r,o]),{storyListViewModel:u,storyListOptions:p}};var jl=M(405),El=M(9780),Ml=M.n(El);class Il{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 Il;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 Tl{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=Ml()(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===ct.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===ct.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new Il;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,jl.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 Ll=M(992),Al=M.n(Ll),Rl=M(2591),Bl=M.n(Rl),Dl=M(5213),Nl={insert:"head",singleton:!1};Bl()(Dl.A,Nl);const Vl=Dl.A.locals||{};var Fl=M(4978),Ul={insert:"head",singleton:!1};Bl()(Fl.A,Ul);const Gl=Fl.A.locals||{};var Wl=M(4456),zl={insert:"head",singleton:!1};Bl()(Wl.A,zl);const $l=Wl.A.locals||{},Hl=({onClick:e,className:t})=>(0,Ol.jsx)("div",{className:Al()($l.icon,t),onClick:e,children:(0,Ol.jsx)("svg",{viewBox:"0 0 24 24",children:(0,Ol.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 ql=M(6644),Zl={insert:"head",singleton:!1};Bl()(ql.A,Zl);const Kl=ql.A.locals||{},Ql=({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,Ol.jsx)("div",{className:Al()(Kl["aspect-ratio-box"],s,{[Kl["aspect-ratio-box--centered"]]:!i}),style:Object.assign(Object.assign({},r),a),children:(0,Ol.jsx)("div",{className:Kl["aspect-ratio-box-inside"],children:t})})};var Yl=M(3639),Jl={insert:"head",singleton:!1};Bl()(Yl.A,Jl);const Xl=Yl.A.locals||{},ec=z(),tc=e=>{const[t,r]=(0,xl.useState)(!1),i=(0,xl.useCallback)((()=>{if(re)return;const t=ec.type!==e.orientation;e.onOrientationChange({type:ec.type,isWrong:t}),r(t)}),[e.orientation]);return(0,xl.useEffect)((()=>(i(),ec.addEventListener("change",i),()=>{ec.removeEventListener("change",i)})),[i]),t?(0,Ol.jsx)("div",{className:Xl["screen-orientation-lock"]}):null};var rc=M(5839),ic={insert:"head",singleton:!1};Bl()(rc.A,ic);const sc=rc.A.locals||{};var ac=M(7231),oc={insert:"head",singleton:!1};Bl()(ac.A,oc);const nc=ac.A.locals||{},lc=({shareText:e,shareLink:t,sharePanelOptions:r,onShareComplete:i})=>{var s,a,o,n,l,c,d,u,h,p,g;const[f,m]=(0,xl.useState)(!1),[y,v]=(0,xl.useState)(!1),b=()=>{v(!0),!f&&e||i()};return(0,Ol.jsxs)("div",{className:`${sc["share-panel__body"]} ${nc["share-panel__body_screenshot"]}`,children:[(0,Ol.jsx)("div",{className:`${sc["share-panel-row"]} ${nc["share-panel-row"]}`,children:(0,Ol.jsx)("a",{className:nc["share-panel-row__image-link"],onClick:b,href:t,download:"image.jpeg",children:(0,Ol.jsx)("img",{src:t,className:nc["share-panel-row__image"]})})}),(0,Ol.jsx)("div",{className:sc["share-panel-separator"],style:{background:null===(s=r.divider)||void 0===s?void 0:s.background}}),(0,Ol.jsx)("div",{className:`${sc["share-panel-row"]} ${nc["share-panel-row"]}`,children:(0,Ol.jsx)("a",{className:nc["share-item__download-button"],onClick:b,href:t,download:"image.jpeg",children:(0,Ol.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,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)("div",{className:sc["share-panel-separator"],style:{background:null===(l=r.divider)||void 0===l?void 0:l.background}}),(0,Ol.jsx)("div",{className:`${sc["share-panel-row"]} ${nc["share-panel-row"]}`,children:(0,Ol.jsxs)("button",{className:Al()(nc.btn,nc["btn-copy"]),onClick:()=>{w(null!=e?e:""),m(!0),y&&i()},children:[(0,Ol.jsxs)("div",{className:nc["btn-copy__icon"],children:[(0,Ol.jsx)("span",{className:Al()(nc["btn-copy__icon-state"],{[nc["btn-copy__icon-state_default"]]:!f}),dangerouslySetInnerHTML:{__html:null!==(u=null===(d=null===(c=r.copyButton)||void 0===c?void 0:c.svgSrc)||void 0===d?void 0:d.baseState)&&void 0!==u?u:""}}),(0,Ol.jsx)("span",{className:Al()(nc["btn-copy__icon-state"],{[nc["btn-copy__icon-state_done"]]:f}),dangerouslySetInnerHTML:{__html:null!==(g=null===(p=null===(h=r.copyButton)||void 0===h?void 0:h.svgSrc)||void 0===p?void 0:p.doneState)&&void 0!==g?g:""}})]}),(0,Ol.jsx)("div",{className:nc["btn-copy__text"],children:e})]})})]}):null]})};var cc=M(9749),dc={insert:"head",singleton:!1};Bl()(cc.A,dc);const uc=cc.A.locals||{};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 pc=e=>{var t,r,i,s,a,o,n,l,c,d,u,{shareLink:h,sharePanelOptions:p,onShareComplete:g}=e,f=hc(e,["shareLink","sharePanelOptions","onShareComplete"]);const m=()=>{try{return new URL(h).host}catch(e){return console.error(e),null}},y=()=>{window.removeEventListener("focus",y),g()},v=()=>m()?"":encodeURIComponent(h),b=e=>{var t,r;const i=(()=>{try{return new URL(h)}catch(e){return console.error(e),null}})();if(!i)return"#";const s=null===(t=p.targetParams)||void 0===t?void 0:t[e];return null===(r=null==s?void 0:s.getUrl)||void 0===r?void 0:r.call(s,{url:i.toString(),text:v()})},S=null===(t=p.title)||void 0===t?void 0:t.favicon,_=p.text;return(0,Ol.jsxs)("div",{className:sc["share-panel__body"],children:[(0,Ol.jsxs)("div",{className:`${sc["share-panel-row"]} ${sc["title-row"]}`,children:[m()&&Boolean(null==S?void 0:S.display)&&(0,Ol.jsx)("div",{className:sc["share-url-favicon"],style:{background:null==S?void 0:S.background},children:(0,Ol.jsx)("img",{src:`${null!==(r=f.faviconApiUrl)&&void 0!==r?r:"https://favicon.inappstory.ru"}?sz=64&domain_url=${m()}`})}),(0,Ol.jsx)("span",{className:sc.title,dir:f.dir,style:_,children:null===(s=null===(i=p.title)||void 0===i?void 0:i.getValue)||void 0===s?void 0:s.call(i,{url:h,text:v()})})]}),(0,Ol.jsx)("div",{className:sc["share-panel-separator"],style:{background:null===(a=p.divider)||void 0===a?void 0:a.background}}),(0,Ol.jsx)("div",{className:`${sc["share-panel-row"]} ${uc["social-list"]}`,children:null===(o=p.targets)||void 0===o?void 0:o.map(((e,t)=>{var r,i,s;const a=null===(r=p.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,Ol.jsx)("div",{className:uc["social-list__item"],children:(0,Ol.jsxs)("a",{href:b(e),onClick:()=>((e,t,r)=>{window.addEventListener("focus",y),window.open(e,t,r)})(b(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${sc["share-item"]} ${uc["share-item"]}`,children:[(0,Ol.jsx)("div",{dangerouslySetInnerHTML:{__html:o}}),(0,Ol.jsx)("span",{className:sc["share-item-title"],style:_,children:null==a?void 0:a.label})]})},t)}))}),(0,Ol.jsx)("div",{className:sc["share-panel-separator"],style:{background:null===(n=p.divider)||void 0===n?void 0:n.background}}),(0,Ol.jsx)("div",{className:sc["share-panel-row"],children:(0,Ol.jsxs)("a",{className:`${sc["share-item"]} ${uc["share-item"]}`,onClick:()=>{w(h),g()},children:[(0,Ol.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(d=null===(c=null===(l=p.copyButton)||void 0===l?void 0:l.svgSrc)||void 0===c?void 0:c.baseState)&&void 0!==d?d:""}}),(0,Ol.jsx)("span",{className:sc["share-item-title"],style:_,children:null===(u=p.copyButton)||void 0===u?void 0:u.label})]})})]})};var gc;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(gc||(gc={}));const fc=({shareType:e,shareLink:t,shareText:r,onShareCompelete:i,sharePanelOptions:s,className:a,dir:o})=>{const[n,l]=(0,xl.useState)(!1),[c,d]=(0,xl.useState)(!0),u=()=>{l(!0),d(!1)};return(0,Ol.jsxs)("div",{dir:o,className:Al()(sc["share-panel-wrapper"],a),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,Ol.jsx)("div",{className:Al()(sc["share-panel-backdrop"],{[sc.fadeIn]:c,[sc.fadeOut]:!c}),onClick:()=>{l(!1),d(!1)}}),(0,Ol.jsxs)("div",{className:Al()(sc["share-panel"],{[sc.slideIn]:c,[sc.slideOut]:!c}),onAnimationEnd:()=>{c||i(n)},style:{"--height":"100%",background:s.background,borderTopLeftRadius:s.borderRadius+"px",borderTopRightRadius:s.borderRadius+"px"},children:[e===gc.SlideScreenshot&&(0,Ol.jsx)(lc,{shareText:r,shareLink:t,onShareComplete:u,sharePanelOptions:s}),e===gc.Social&&(0,Ol.jsx)(pc,{shareLink:t,onShareComplete:u,sharePanelOptions:s,dir:o}),(0,Ol.jsx)("div",{className:sc["share-panel-separator"]})]})]})};var mc=M(9678),yc={insert:"head",singleton:!1};Bl()(mc.A,yc);const vc=mc.A.locals||{},bc=e=>{const t=(0,xl.useRef)(null),[r,i]=(0,xl.useState)(null);return(0,xl.useEffect)((()=>{const r=e.$dotLottie.create(t.current,e.config);return i(r),()=>{r.destroy()}}),[e.config.sha1,e.$dotLottie]),(0,xl.useEffect)((()=>{r&&e.forceEnd&&r.stop()}),[r,e.forceEnd]),(0,xl.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,Ol.jsx)("canvas",{ref:t,style:{width:"100%",height:"100%"}})},wc=e=>{var t,r,i;const{storyManager:s}=yp(),[a,o]=(0,xl.useState)(!1),[n,l]=(0,xl.useState)(!1),[c,d]=(0,xl.useState)(!1),[u,h]=(0,xl.useState)(!1),[p,g]=(0,xl.useState)(!1),[f,m]=(0,xl.useState)(!1),y=n||u||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,xl.useEffect)((()=>{_&&e.onSplashCanBeHidden()}),[_]);return(0,Ol.jsxs)("div",{className:Al()(vc["splash-container"],{[vc["splash-container--fadeIn"]]:e.game,[vc["splash-container--fadeOut"]]:e.gameShouldBeShown,[vc["splash-container--isLoading"]]:w}),children:[(0,Ol.jsx)("div",{className:vc["splash-container__image"],style:{backgroundColor:e.splashImageBackgroundColor},children:S()&&(0,Ol.jsx)("img",{src:S(),onLoad:()=>{m(!0)}})}),b&&v&&(0,Ol.jsx)("div",{className:vc["splash-container__lottie"],children:(0,Ol.jsx)(bc,{$dotLottie:v,forceEnd:e.gameShouldBeShown,config:b,onError:()=>{d(!0)},onPlay:()=>{l(!0),o(!1)},onComplete:()=>{l(!1),o(!0)},onLoad:()=>{h(!1)},onBeforeLoad:()=>{h(!0)},onMinPlayingTimeExpired:()=>{g(!0)}})})]})};var Sc=M(8034),_c={insert:"head",singleton:!1};Bl()(Sc.A,_c);const Oc=Sc.A.locals||{},xc=e=>{var t,r;return(0,Ol.jsx)("button",{dir:e.dir,onClick:e.onCloseGame,className:Oc["close-btn"],"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 kc=M(5299),Cc=M(9514);z();const Pc=()=>{const e=window.innerWidth;return{vh:window.innerHeight,vw:e}},jc=()=>{const[e,t]=(0,xl.useState)((()=>Pc())),r=(0,xl.useCallback)((()=>{t(Pc())}),[]);return(0,xl.useEffect)((()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)})),[]),e},Ec=50,Mc=50;var Ic=M(763),Tc={insert:"head",singleton:!1};Bl()(Ic.A,Tc);Ic.A.locals;const Lc=({storyManager:e})=>{const[t,r]=(0,xl.useState)(null),i=(()=>{const e=(0,xl.useRef)({top:0,bottom:0,left:0,right:0});return e.current||(e.current=(()=>{const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t)),r=t("--ias-sat"),i=t("--ias-sab");return{left:t("--ias-sal"),right:t("--ias-sar"),top:r,bottom:i}})()),e.current})();return(0,xl.useEffect)((()=>{const t=e.createGameReader();return t.setSafeAreaInsets(i),r(t),()=>{t.destroy()}}),[e]),t},Ac=(0,kc.observer)((({gameReader:e})=>{var t,r,i,s,a,o,n,l,c,d;const{gameReaderOptions:u,storyReaderOptions:h}=yp(),p=(0,xl.useRef)(null),{sharePanelOpeningParams:g,handleShareComplete:f,closeSharePanel:m}=(e=>{const[t,r]=(0,xl.useState)(null);return(0,xl.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:y,isDesktopGeometry:v}=(()=>{const{vw:e,vh:t}=jc(),r=(new ss).create({vw:e,vh:t});return{isDesktopGeometry:r instanceof rs,gameGeometry:r}})(),b=v&&(null===(r=null===(t=e.game)||void 0===t?void 0:t.screenOptions.widescreen)||void 0===r||r);vp((()=>{w()}));const w=()=>{e.closeGame(),m()},{game:S,gameError:_,isGameLoading:O,closeBtnVisible:x}=e,k=Al()(Gl["game-reader"],{[Gl["game-reader--desktop-mode"]]:v,[Gl["game-reader--widescreen"]]:b}),C={background:null!==(s=null===(i=u.backdrop)||void 0===i?void 0:i.background)&&void 0!==s?s:"",opacity:null!==(o=null===(a=u.backdrop)||void 0===a?void 0:a.opacity)&&void 0!==o?o:0,filter:(null===(n=u.backdrop)||void 0===n?void 0:n.blur)?`blur(${u.backdrop.blur}px)`:"none"},P=null!==(c=null===(l=u.game)||void 0===l?void 0:l.backdropColor)&&void 0!==c?c:"";return(0,Cc.createPortal)((0,Ol.jsx)("div",{className:Gl["game-reader-container"],style:{"--game-box-border-radius":`${parseFloat(String(u.borderRadius))}px`},children:(0,Ol.jsxs)("div",{className:k,children:[(0,Ol.jsx)("div",{className:Gl["game-reader__backdrop"],style:C}),(0,Ol.jsxs)(Ql,{className:Gl["game-reader__game-box"],isWidescreen:b,geometry:y,children:[(0,Ol.jsx)(wc,{onSplashCanBeHidden:()=>{e.notifyGameCanBeStarted()},isDesktopGeometry:v,isGameInited:e.isGameInited,isGameLoading:O,isGameLoadingError:Boolean(e.gameError),gameShouldBeShown:e.gameShouldBeShown,game:null!==(d=e.game)&&void 0!==d?d:void 0,splashImageBackgroundColor:e.game?P:C.background}),_&&(0,Ol.jsx)(Hl,{className:Gl["game-reader__refresh-btn"],onClick:()=>{e.reload()}}),(!e.gameShouldBeShown||x)&&(0,Ol.jsx)(xc,{closeButtonPosition:u.closeButtonPosition,dir:e.dir,onCloseGame:w,closeButtonOptions:u.closeButton}),S&&(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)("iframe",{src:S.url,onLoad:t=>{p.current=t.target,e.setGameCenterIframe(p.current,{isWidescreen:b})},style:{opacity:e.gameShouldBeShown?1:0},frameBorder:"0",className:Gl["game-reader__iframe"],sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),g&&(0,Ol.jsx)(fc,{dir:e.dir,shareType:g.shareType,shareLink:g.shareLink,onShareCompelete:f,sharePanelOptions:h.sharePanel})]})]}),S&&u.forceCheckOrientation&&(0,Ol.jsx)(tc,{orientation:$.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.isGameInited&&(t?e.pauseGameUI():e.resumeGameUI())}})]})}),document.body)}));var Rc=M(1239),Bc={insert:"head",singleton:!1};Bl()(Rc.A,Bc);const Dc=Rc.A.locals||{};class Nc{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(qs.CloseBySwipeDown)}),400)}handleSwipeDown(){this.deltaValY<=.15||!this.storyReaderViewModel.canBeClosed()?this.returnToDefaultState():this.closeStoryReader()}}var Vc=M(8790),Fc={insert:"head",singleton:!1};Bl()(Vc.A,Fc);const Uc=Vc.A.locals||{},Gc=e=>{var t,r;const{storyReaderOptions:i}=yp();return(0,Ol.jsx)("div",{dir:e.dir,"data-position":i.closeButtonPosition,className:Al()(Uc["close-btn-wrapper"],{[Uc["close-btn-wrapper_hidden"]]:e.hidden},e.className),children:(0,Ol.jsx)("button",{className:Al()(Uc["close-btn"],{[Uc["close-btn_hidden"]]:e.hidden}),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:""}})})},Wc=(0,kc.observer)((e=>{const t=(0,xl.useRef)(null),r=(0,xl.useRef)(null),{storyReaderOptions:i}=yp();(({storyReaderViewModel:e,storiesViewerRef:t,backdropRef:r})=>{const i=(0,xl.useRef)(null);(0,xl.useEffect)((()=>{i.current=new Nc(e,t.current,r.current)}),[]);const s=()=>{var e;t.current.classList.add(Dc["no-select"]),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["no-select"]),e.touchController.verticalSwipeGesture&&(null===(r=i.current)||void 0===r||r.endMove())};(0,xl.useEffect)((()=>{const t=e.touchController;return t.on(vr.TouchStart,s),t.on(vr.TouchMoveVertical,a),t.on(vr.TouchEnd,o),()=>{t.off(vr.TouchStart,s),t.off(vr.TouchMoveVertical,a),t.off(vr.TouchEnd,o)}}),[e.touchController])})({storyReaderViewModel:e.storyReader,backdropRef:t,storiesViewerRef:r});return(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsxs)("div",{ref:r,className:Al()("stories-viewer",Dc["stories-viewer"]),style:Object.assign(Object.assign({},{"--loaderBackgroundColor":null===(s=i.loader)||void 0===s?void 0:s.default.color,"--loaderBackgroundAccentColor":null===(a=i.loader)||void 0===a?void 0:a.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:[re&&(0,Ol.jsx)("div",{className:Dc["stories-viewer-background"],style:(()=>{var t,r,s;const a=[],o=null===(t=e.storyReader.activeStory)||void 0===t?void 0:t.displayedSlideImage;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&&e.storyReader.activeStory&&(0,Ol.jsx)(Gc,{dir:e.storyReader.dir,className:Dc["stories-viewer__close-btn"],hidden:Boolean(e.storyReader.activeStory.pauseState.isUIPaused),onClose:()=>{e.storyReader.close()}})]}),(0,Ol.jsx)("div",{ref:t,className:Al()(Dc["stories-viewer-backdrop"],{[Dc._desktopMode]:re})})]});var s,a}));var zc=M(9037),$c={insert:"head",singleton:!1};Bl()(zc.A,$c);const Hc=zc.A.locals||{};var qc=M(6349),Zc={insert:"head",singleton:!1};Bl()(qc.A,Zc);const Kc=qc.A.locals||{};var Qc=M(6028),Yc={insert:"head",singleton:!1};Bl()(Qc.A,Yc);const Jc=Qc.A.locals||{},Xc=e=>{const t=0===e.value||1===e.value;return(0,Ol.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(-1===e.value?0:-1)}})},ed=e=>(0,Ol.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.activeState:e.options.svgSrc.baseState},onClick:()=>e.onClick(!e.value)}),td=e=>{const t=0===e.value||-1===e.value;return(0,Ol.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(1===e.value?0:1)}})},rd=e=>(0,Ol.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:e.onClick}),id=e=>(0,Ol.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.options.svgSrc.baseState},onClick:e.onClick});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 ad=(0,kc.observer)((e=>{var{actionPanel:t,commonOptions:r,storyReaderOptions:i,nodeRef:s,hidden:a}=e,o=sd(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,Ol.jsx)("div",{ref:s,dir:o.dir,className:Al()(Jc["story-action-panel"],{[Jc["story-action-panel_hidden"]]:a,[Jc["story-action-panel_mobile"]]:!o.isDesktopGeometry}),children:(0,Ol.jsxs)("div",{className:Jc["story-action-panel-actions"],children:[n&&(0,Ol.jsx)(td,{className:Jc["story-action-panel-actions__item"],value:t.like,options:i.likeButton,onClick:e=>{t.setLike(e)}}),n&&(0,Ol.jsx)(Xc,{className:Jc["story-action-panel-actions__item"],value:t.like,options:i.dislikeButton,onClick:e=>{t.setDislike(e)}}),c&&(0,Ol.jsx)(ed,{className:Jc["story-action-panel-actions__item"],value:t.favorite,options:i.favoriteButton,onClick:e=>{t.setBookmark(e)}}),(0,Ol.jsxs)("div",{className:Jc["story-action-panel-actions__right-container"],children:[d&&(0,Ol.jsx)(rd,{className:Jc["story-action-panel-actions__item"],value:t.muted,options:i.muteButton,onClick:()=>{t.muted?t.unmute():t.mute()}}),l&&(0,Ol.jsx)(id,{className:Jc["story-action-panel-actions__item"],options:i.shareButton,onClick:()=>{t.share()}})]})]})})}));var od=M(2208),nd={insert:"head",singleton:!1};Bl()(od.A,nd);const ld=od.A.locals||{};var cd=M(114),dd={insert:"head",singleton:!1};Bl()(cd.A,dd);const ud=cd.A.locals||{},hd=(0,kc.observer)((e=>{const{ref:t}=(e=>{const t=(0,xl.useRef)(null);return(0,xl.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(ni.Start,s),r.on(ni.Stop,a),r.on(ni.Progress,i),()=>{r.off(ni.Start,s),r.off(ni.Progress,i),r.off(ni.Stop,a)}}),[e]),{ref:t}})(e.story),r=e.story.activeSlide.timeline;return(0,Ol.jsx)("div",{ref:t,dir:e.dir,className:Al()(ud["story-timeline"],{[ud["story-timeline_desktop"]]:re,[ud["story-timeline_hidden"]]:e.hidden}),style:{"--story-timeline-tick-foreground":null==r?void 0:r.foreground,"--story-timeline-background":null==r?void 0:r.background},children:(0,Ol.jsx)("div",{className:`${ud["story-timeline-ticks"]}`,children:new Array(e.story.slidesCount).fill(0).map(((t,r)=>(0,Ol.jsxs)("div",{className:ud["story-timeline-ticks__tick"],children:[(0,Ol.jsx)("div",{className:Al()(ud["story-timeline-ticks__tick-progress"],{[ud["story-timeline-ticks__tick-progress_active"]]:r+1<=e.story.activeSlideIndex})}),(0,Ol.jsx)("div",{className:ud["story-timeline-ticks__tick-progress-loader"],style:{display:r+1===e.story.activeSlideIndex+1?"block":"none"}})]},r+1)))})})}));var pd=M(3910),gd={insert:"head",singleton:!1};Bl()(pd.A,gd);const fd=pd.A.locals||{},md=()=>(0,Ol.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ol.jsxs)("g",{children:[(0,Ol.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,Ol.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"})]})}),yd=()=>(0,Ol.jsx)("svg",{width:"16",height:"16",viewBox:"-40 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ol.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"})}),vd=(0,kc.observer)((e=>(0,Ol.jsxs)("div",{className:Al()(fd["story-controls"]),dir:e.dir,children:[re&&(0,Ol.jsxs)("div",{className:Al()(fd["story-controls__item"],fd["story-controls__btn-group"],{[fd["story-controls__item_hidden"]]:e.hidden||e.story.timeline.hiddenTimeline}),children:[(0,Ol.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:Al()(fd["story-controls__btn"],fd["story-controls__btn_play"],{[fd["story-controls__btn_hidden"]]:!e.story.pauseState.isUserPaused}),onClick:()=>{e.story.resumeUser()},children:(0,Ol.jsx)(yd,{})}),(0,Ol.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:Al()(fd["story-controls__btn"],fd["story-controls__btn_pause"],{[fd["story-controls__btn_hidden"]]:e.story.pauseState.isUserPaused}),onClick:()=>{e.story.pauseUser()},children:(0,Ol.jsx)(md,{})})]}),!e.story.disableClose&&!e.isDesktopGeometry&&(0,Ol.jsx)("div",{className:Al()(fd["story-controls__item"]),children:(0,Ol.jsx)(Gc,{dir:e.story.dir,className:Al()(fd["story-controls__btn_close"]),hidden:e.hidden,onClose:()=>{e.onClose()}})})]}))),bd=(0,kc.observer)((e=>(0,Ol.jsxs)("div",{ref:e.nodeRef,className:Al()(ld["story-header"]),children:[(0,Ol.jsx)(hd,{dir:e.story.dir,story:e.story,hidden:e.hidden||e.story.timeline.hiddenTimeline}),(0,Ol.jsx)(vd,{dir:e.story.dir,story:e.story,onClose:e.onClose,isDesktopGeometry:e.isDesktopGeometry,hidden:e.hidden})]})));var wd=M(2004),Sd={insert:"head",singleton:!1};Bl()(wd.A,Sd);const _d=wd.A.locals||{},Od=e=>(0,Ol.jsx)("div",{ref:e.nodeRef,className:Al()(_d["story-backdrop"],{[_d["story-backdrop_hidden"]]:e.hidden})});const xd=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 kd(e,t,r){return new Promise((i=>{let s=!1;const a=()=>{s=!0,clearTimeout(n),void 0!==xd&&e.removeEventListener(xd,o),e.style.setProperty("transition",`${t} 0ms`),i()},o=e=>{e.propertyName===t&&(s||a())};void 0!==xd&&e.addEventListener(xd,o,!1);const n=setTimeout((()=>{s||a()}),r+20);e.style.setProperty("transition",`${t} ${r}ms`)}))}var Cd=M(2561),Pd={insert:"head",singleton:!1};Bl()(Cd.A,Pd);const jd=Cd.A.locals||{},Ed=e=>{const t=(0,xl.useRef)(null),r=(0,xl.useRef)(null),i=(0,xl.useRef)(0),s=(0,xl.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,xl.useState)(!1),[c,d]=(0,xl.useState)(!1),u=(0,xl.useRef)(!1),h=()=>{const t=xl.Children.count(e.children);return r.current&&t?r.current.scrollWidth/t:0};let p=!1;(0,xl.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,xl.useRef)(!1),f=(0,xl.useRef)(0);let m=0;const y=(0,xl.useRef)(!1),[v,b]=(0,xl.useState)(0),w=e=>{e<0&&(e=0),e>i.current&&(e=i.current),b(e)};(0,xl.useEffect)((()=>{v===i.current?d(!1):d(!0),l(0!==v)}),[v]);const S=e=>{if(!u.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,Ol.jsxs)("div",{className:jd["scrolling-carousel"],style:e.style,children:[(0,Ol.jsx)("div",{className:jd["scrolling-carousel__wrapper"],ref:t,onMouseDown:e=>{u.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=>{u.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,Ol.jsx)("div",{className:jd["scrolling-carousel__item"],ref:r,style:{transform:`translateX(${-1*v}px)`},children:e.children})}),!p&&(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)("div",{className:Al()(jd["scrolling-carousel__arrow-button"],jd["scrolling-carousel__arrow-button--left"],{[jd["scrolling-carousel__arrow-button--show"]]:n}),onClick:async()=>{if(u.current)return;o();const e=s.current-h();w(e),u.current=!0,r.current&&await kd(r.current,"transform",300),u.current=!1},children:(0,Ol.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ol.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),(0,Ol.jsx)("div",{className:Al()(jd["scrolling-carousel__arrow-button"],jd["scrolling-carousel__arrow-button--right"],{[jd["scrolling-carousel__arrow-button--show"]]:c}),onClick:async()=>{if(u.current)return;o();const e=s.current+h();w(e),u.current=!0,r.current&&await kd(r.current,"transform",300),u.current=!1},children:(0,Ol.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ol.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,Ol.jsx)("div",{className:s,style:Object.assign({color:r,font:i},t),children:e});var Id=M(2621),Td={insert:"head",singleton:!1};Bl()(Id.A,Td);const Ld=Id.A.locals||{},Ad=({goods:e,onClick:t,options:r})=>{var i;const{imgSrc:s,title:a,subTitle:o,price:n,oldPrice:l}=e;return(0,Ol.jsxs)("div",{className:Al()(Ld["goods-card"]),style:{color:null!==(i=r.mainTextColor)&&void 0!==i?i:"black"},onClick:t,children:[(0,Ol.jsx)("div",{className:Al()(Ld.figure),style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor},children:s&&(0,Ol.jsx)("img",{src:s,alt:a,style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor}})}),(0,Ol.jsx)(Md,{font:r.subtitleFont,children:o}),(0,Ol.jsx)(Md,{font:r.titleFont,children:a}),(0,Ol.jsxs)("div",{className:Ld.prices,children:[(0,Ol.jsx)(Md,{font:r.priceFont,children:n}),(0,Ol.jsx)(Md,{className:Ld["typography--old-price"],font:r.oldPriceFont,color:r.oldPriceTextColor,children:l})]})]})},Rd=e=>{const t=e.goodsWidgetOptions,r=t.goodsWidgetRenderingType||t.goodsList.renderingType;let s=[];return r===Ut.DEFAULT?s=e.goodsList.map(((r,i)=>(0,Ol.jsx)(Ad,{options:t.goodsCard,goods:r,onClick:()=>e.onGoodsCardClick(r)},i))):r===Ut.CUSTOM_CARD&&i()(t.getCardHtml)&&(s=e.goodsList.map(((r,i)=>{var s,a;return(0,Ol.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,Ol.jsx)(Ed,{style:{marginTop:"-15px"},children:s})};var Bd=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 Dd=e=>{var{arrowColor:t}=e,r=Bd(e,["arrowColor"]);return(0,Ol.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,Ol.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 Nd=M(4354),Vd={insert:"head",singleton:!1};Bl()(Nd.A,Vd);const Fd=Nd.A.locals||{},Ud=({closeImage:e,arrowColor:t,onClick:r})=>(0,Ol.jsx)("div",{className:Fd.btn,onClick:r,onTouchStart:r,children:e?(0,Ol.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}):(0,Ol.jsx)(Dd,{arrowColor:t})});var Gd=M(9406),Wd={insert:"head",singleton:!1};Bl()(Gd.A,Wd);const zd=Gd.A.locals||{},$d=({isLoading:e,backgroundColor:t="white",accentBackgroundColor:r="transparent"})=>e?(0,Ol.jsx)("div",{className:zd.spinner,style:{border:`solid 2px ${t}`,borderColor:`${r} ${t} ${t} ${t}`}}):null;var Hd=M(777),qd={insert:"head",singleton:!1};Bl()(Hd.A,qd);const Zd=Hd.A.locals||{},Kd=e=>{let t=[];return t=e.goodsList.map(((t,r)=>e.renderGoods({goods:t,index:r,onClick:t=>{e.onGoodsCardClick(t)}}))),(0,Ol.jsx)(Ed,{children:t})};var Qd;!function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"}(Qd||(Qd={}));const Yd=({open:e,url:t,goodsWidgetOptions:r,onClosed:i,onClose:s,onGoodsCardClick:a})=>{const o=(0,xl.useRef)(null),[n,l]=(0,xl.useState)([]),[c,d]=(0,xl.useState)(Qd.IN),u=r,{dimColor:h,substrateHeight:p,substrateColor:g,closeImage:f,closeBackgroundColor:m}=u.goodsList;(0,xl.useEffect)((()=>{d(e?Qd.IN:Qd.OUT)}),[e]),(0,xl.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,xl.useEffect)((()=>{const e=o.current;if(c===Qd.OUT)return e.addEventListener("animationend",i),()=>{e.removeEventListener("animationend",i)}}),[c]);const b=u.loader.custom?(0,Ol.jsx)("div",{dangerouslySetInnerHTML:{__html:u.loader.custom}}):(0,Ol.jsx)($d,{isLoading:Boolean(r.isLoading),backgroundColor:u.loader.default.color,accentBackgroundColor:u.loader.default.accentColor});return(0,Ol.jsxs)("div",{className:Al()(Zd["goods-container"],{[Zd["goods-container--visible"]]:c===Qd.IN,[Zd["goods-container--hidden"]]:c===Qd.OUT}),ref:o,children:[(0,Ol.jsx)("div",{className:Al()(Zd["goods-container__backdrop"]),style:{backgroundColor:h},onClick:s}),(0,Ol.jsxs)("div",{className:Al()(Zd["goods-container"]),style:{height:p+"px",backgroundColor:null!=g?g:"white"},children:[b,r.renderItem?(0,Ol.jsx)(Kd,{goodsWidgetOptions:r,goodsList:n,renderGoods:r.renderItem,onGoodsCardClick:a}):(0,Ol.jsx)(Rd,{goodsList:n,onGoodsCardClick:a,goodsWidgetOptions:r}),(0,Ol.jsx)(Ud,{onClick:s,closeImage:f,arrowColor:m})]})]})};var Jd=M(9111),Xd={insert:"head",singleton:!1};Bl()(Jd.A,Xd);const eu=Jd.A.locals||{},tu=(0,kc.observer)((e=>{const[t,r]=(0,xl.useState)(!1),[i,s]=(0,xl.useState)(!1),a=()=>{s(!0),r(!0)},o=()=>{r(!1)};(0,xl.useEffect)((()=>{const t=e.story.goodsWidget;return t.on(ei.Open,a),t.on(ei.Close,o),()=>{t.off(ei.Open,a),t.off(ei.Close,o)}}),[e.story]);return i&&e.story.goodsWidget.params.elementId?(0,Ol.jsx)("div",{className:eu["goods-widget-viewer"],children:(0,Ol.jsx)(Yd,{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})),ru={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"};class iu{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 su=e=>{switch(e){case"":default:return"text";case"tel":return"tel";case"email":return"email"}},au=e=>{const[t,r]=(0,xl.useState)({countryCode:"",phone:""}),[i,s]=(0,xl.useState)(""),[a,o]=(0,xl.useState)(!0),n=r=>{var i;const s=su(null!==(i=null==e?void 0:e.configV2.main.input.type)&&void 0!==i?i:"");return"email"===s?iu.isEmailValid(r):"tel"!==s||iu.isTelephoneValid((()=>{var e;const r=t.countryCode.substring(1);return r&&null!==(e=ru[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 ou=M(7656),nu={insert:"head",singleton:!1};Bl()(ou.A,nu);const lu=ou.A.locals||{},cu=e=>{const t=(0,xl.useRef)(null);return(0,xl.useEffect)((()=>{t.current&&(E(t.current),t.current.focus())}),[]),(0,Ol.jsx)("input",{type:"email",className:Al()(lu.input,lu.input_centered),placeholder:e.placeholder,value:e.value,ref:t,onChange:t=>e.onChange(t.target.value)})};class du{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 uu=e=>{const{value:t="",pattern:r="+7 (___) ___-__-__",patternChar:i="9",placeholderChar:s="_",className:a="",onChange:o}=e,n=(0,xl.useRef)(null),l=(0,xl.useRef)(null);(0,xl.useEffect)((()=>(n.current&&(l.current=new du(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,xl.useEffect)((()=>{l.current&&t!==l.current.getCleanPhoneNumber()&&l.current.setValue(t)}),[t]);return(0,xl.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,Ol.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)}}})},hu=e=>{const t=(0,xl.useRef)(null),r=e.value.countryCode?ru[e.value.countryCode]:"";return(0,xl.useEffect)((()=>{var e;const r=null===(e=t.current)||void 0===e?void 0:e.getInputElement();var i;r&&(i=r,setTimeout((()=>{E(i),i.focus()})))}),[]),(0,Ol.jsxs)("div",{className:lu["input-group"],children:[(0,Ol.jsxs)("div",{className:lu["input-group__prepend"],children:[(0,Ol.jsx)(uu,{value:e.value.countryCode,inputRef:t,pattern:"+999",placeholderChar:"",className:lu.input,onChange:(t,r)=>{e.onChange({countryCode:r,phone:e.value.phone})}}),(0,Ol.jsx)("div",{className:lu["input-group__separator"]})]}),(null==r?void 0:r.length)?(0,Ol.jsx)(uu,{value:e.value.phone,pattern:r,placeholder:e.placeholder,className:lu.input,onChange:(t,r)=>{e.onChange({countryCode:e.value.countryCode,phone:r})}}):(0,Ol.jsx)("input",{type:"tel",className:lu.input,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}))}})]})},pu=e=>{const t=(0,xl.useRef)(null),r=(0,xl.useRef)(null);(0,xl.useEffect)((()=>{r.current.dataset.replicatedValue=e.value,E(t.current),t.current.focus(),t.current.setSelectionRange(e.value.length,e.value.length)}),[]);return(0,Ol.jsx)("div",{className:lu["textarea-grow-wrap"],ref:r,style:e.style,children:(0,Ol.jsx)("textarea",{className:lu.input,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 gu=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 fu=e=>{var{form:t,config:r}=e,i=gu(e,["form","config"]);const[s,a]=(0,xl.useState)(!0),{getMainStyle:o,getMainElementsStyle:n,getQuestionStyle:l,getInputWrapperStyle:c,getButtonStyle:d,getTextareaStyle:u}=(({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}),h=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=su(r.configV2.main.input.type),y=({value:e})=>{i.onComplete({result:!0,value:e}),a(!1)};return(0,Ol.jsxs)("div",{className:lu.wrapper,children:[(0,Ol.jsx)("div",{className:Al()(lu.backdrop,{[lu.fadeIn]:s,[lu.fadeOut]:!s}),onAnimationEnd:()=>{s||i.onClose()},onClick:()=>{i.onComplete({result:!1,value:t.value}),a(!1)}}),(0,Ol.jsxs)("div",{className:lu.main,style:o(),children:[(0,Ol.jsxs)("div",{className:lu["main-elements"],style:n(),children:[(0,Ol.jsx)("div",{className:lu.question,style:l(),children:f}),(0,Ol.jsxs)("div",{className:Al()(lu["input-wrapper"],{[lu["is-invalid"]]:!t.isValid}),style:c(),children:["text"===m&&(0,Ol.jsx)(pu,{value:t.value,onChange:t.handleChange,style:u(),placeholder:p,maxLength:h}),"email"===m&&(0,Ol.jsx)(cu,{value:t.value,onChange:t.handleChange,placeholder:p}),"tel"===m&&(0,Ol.jsx)(hu,{value:t.telephone,onChange:t.handleTelephoneChange,placeholder:p})]})]}),t.value.trim().length>0&&(0,Ol.jsx)("div",{className:lu["button-wrapper"],children:(0,Ol.jsx)("button",{className:lu.button,style:d(),onClick:()=>t.handleSubmit(y),children:g})})]})]})},mu=(0,kc.observer)((({storyGeometry:e,story:t,storyRef:r})=>{const[i,s]=(0,xl.useState)(null),a=au(i),o=t.textInput;(0,xl.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,xl.useLayoutEffect)((()=>()=>{a.reset()}),[o.id]),i?(0,Ol.jsx)(fu,{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})),yu=e=>{const t=(0,xl.useRef)(null),r=e=>{const r=t.current;r&&r.show(e.content)};return(0,xl.useEffect)((()=>{if(!e.nodeRef.current)return;t.current||(t.current=new Pr({getMountPoint:()=>e.nodeRef.current}));const i=t.current;return e.story.on(Si.ShowToast,r),()=>{i.destroy(),t.current=null,e.story.off(Si.ShowToast,r)}}),[e.story,e.story.activeSlideIndex]),null};var vu=M(4620),bu={insert:"head",singleton:!1};Bl()(vu.A,bu);const wu=vu.A.locals||{},Su=(0,kc.observer)((e=>{const t=Boolean(e.story.error),r=e.story.activeSlide,i=e.story.needShowErrorScreen,s=e.story.needShowLoaderScreen;return s||i?(0,Ol.jsx)("div",{className:wu["story-loader"],onClick:e=>{e.preventDefault()},children:i?(0,Ol.jsx)(Hl,{className:wu["story-loader__refresh-btn"],onClick:i=>{i.stopPropagation(),(async()=>{try{t?await e.story.reload():null==r||r.restart()}catch(e){console.error(e)}})()}}):s&&(0,Ol.jsx)("div",{className:wu["story-loader__spinner"]})}):null}));class _u extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"story",{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=>{var t;if(!this.shadowRoot)return;"true"===this.getAttribute("is-active-story")&&(null===(t=this.story)||void 0===t||t.activeSlide.onClick({event:e,currentTarget:this.mountPoint,preventNavigation:"true"===this.getAttribute("prevent-navigation")}))}})}setStory(e){this.story=e}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",T()),this.styleElement=t,this.mountPoint.prepend(t)}init(){requestAnimationFrame((()=>{this.mountPoint&&this.story&&(this.story.attachRoot(this.mountPoint),this.mountPoint.addEventListener("click",this.handleClick))}))}destroy(){var e,t;null===(e=this.story)||void 0===e||e.detachRoot(),null===(t=this.mountPoint)||void 0===t||t.removeEventListener("click",this.handleClick)}connectedCallback(){const e=this.attachShadow({mode:"open"});this.mountPoint=document.createElement("div"),this.mountPoint.style.height="100%",this.mountPoint.style.width="100%",e.appendChild(this.mountPoint)}disconnectedCallback(){}}customElements.get("story-slides-container")||customElements.define("story-slides-container",_u);var Ou=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 xu=(0,kc.observer)((e=>{var{className:t,story:r,preventNavigation:i,isActiveStory:s}=e,a=Ou(e,["className","story","preventNavigation","isActiveStory"]);const o=(0,xl.useRef)(null);(0,xl.useLayoutEffect)((()=>{o.current&&o.current.setStyle(r.context.style)}),[r.context.style]),(0,xl.useEffect)((()=>{if(!o.current)return;const e=o.current;return o.current.setStory(r),e.init(),()=>{e.destroy()}}),[r]);const n=a.isDesktopGeometry?"0px":`${r.actionPanel.height}px`;return(0,Ol.jsx)("story-slides-container",{ref:o,style:{bottom:n},class:t,dir:r.dir,"prevent-navigation":i.toString(),"is-active-story":s.toString()})}));var ku=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 Cu=(0,kc.observer)((e=>{var{story:t,geometry:r,className:i}=e,s=ku(e,["story","geometry","className"]);const{storyReaderOptions:a,commonOptions:o,goodsWidgetOptions:n}=yp(),l=(0,xl.useRef)(null),c=t===s.activeStory,d=r instanceof hs,u=a.layout===qt.Modern,h=d&&u&&!c||t.pauseState.isUIPaused,p=d&&(u&&!c||t.textInput.isOpened);return(0,xl.useLayoutEffect)((()=>{const e=parseFloat(String(a.actionPanelBottomOffset));t.actionPanel.setOptions(o),t.actionPanel.setActionPanelHeight(e)}),[t,o,a.actionPanelBottomOffset,d]),(0,Ol.jsxs)("div",{ref:l,className:Al()(Kc.story,i,{[Kc.story_mobile]:!d}),onMouseDown:()=>{t.sharePanel.completeNativeSharing({result:!1})},onTouchStart:()=>{t.sharePanel.completeNativeSharing({result:!1})},"data-testid":"story",children:[d&&u&&(0,Ol.jsx)(Od,{hidden:c}),t.canBeShown&&(0,Ol.jsx)(bd,{hidden:h,story:t,onClose:s.onClose,isDesktopGeometry:d}),(0,Ol.jsx)(xu,{className:Kc["story-slides"],story:t,preventNavigation:u&&d,isActiveStory:c,isDesktopGeometry:d}),t.actionPanel.needShown&&(0,Ol.jsx)(ad,{dir:t.dir,isDesktopGeometry:d,hidden:p,actionPanel:t.actionPanel,commonOptions:o,storyReaderOptions:a}),s.activeStory===t&&(0,Ol.jsx)(tu,{story:t,goodsWidgetOptions:n}),s.activeStory===t&&(0,Ol.jsx)(mu,{story:t,storyRef:l,storyGeometry:r}),t.sharePanel.isOpened&&(0,Ol.jsx)(fc,{dir:t.dir,className:Kc["share-panel-wrapper"],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:a.sharePanel}),s.activeStory===t&&(0,Ol.jsx)(yu,{story:t,nodeRef:l}),(0,Ol.jsx)(Su,{story:t,onClose:s.onClose,isDesktopGeometry:d})]})}));var Pu=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},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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},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)},Mu=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 Iu=(()=>{var t,r,i;let s,a,o,n,l,c,d=e.EventEmitter,u=[],h=[],p=[],g=[],f=[];return t=class extends d{constructor(){super(...arguments),r.set(this,(Pu(this,u),Pu(this,h,!1))),i.set(this,(Pu(this,p),Pu(this,g,0))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:Pu(this,f)}),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 Eu(this,r,"f")}set _animating(e){Mu(this,r,e,"f")}get _currentIndex(){return Eu(this,i,"f")}set _currentIndex(e){Mu(this,i,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)`}},r=new WeakMap,i=new WeakMap,(()=>{var e;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=d[Symbol.metadata])&&void 0!==e?e:null):void 0;s=[_.observable],a=[_.observable],o=[_.computed],n=[_.computed],l=[_.action],c=[_.action],ju(t,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},h,p),ju(t,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,f),ju(t,null,o,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,u),ju(t,null,n,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,u),ju(t,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,u),ju(t,null,c,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,u),r&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),t})();class Tu{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 Lu=M(6778),Au={insert:"head",singleton:!1};Bl()(Lu.A,Au);const Ru=Lu.A.locals||{};var Bu=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 Du=e=>{var{disabled:t,navigationOptions:r,display:i}=e,s=Bu(e,["disabled","navigationOptions","display"]);const a=s.dir===rr.LTR,o=a?s.isNextDisabled:s.isPrevDisabled,n=a?s.isPrevDisabled:s.isNextDisabled,l=o||t,c=n||t;return(0,Ol.jsxs)("div",{ref:s.nodeRef,className:Al()(Ru["story-list-controls"],{[Ru["story-list-controls_hidden"]]:!i}),children:[(0,Ol.jsx)("div",{className:Al()(Ru["story-list-controls__item"],Ru["story-list-controls__item_prev"]),children:(0,Ol.jsx)("button",{className:Ru["story-list-controls__btn"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onPrev()},disabled:c,dangerouslySetInnerHTML:{__html:r.prevButton.svgSrc.baseState}})}),(0,Ol.jsx)("div",{className:Al()(Ru["story-list-controls__item"],Ru["story-list-controls__item_next"]),children:(0,Ol.jsx)("button",{className:Ru["story-list-controls__btn"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onNext()},disabled:l,dangerouslySetInnerHTML:{__html:r.nextButton.svgSrc.baseState}})})]})},Nu=(0,kc.observer)((e=>{const{storyReaderOptions:t}=yp(),{ref:r,slider:i}=(e=>{const[t]=(0,xl.useState)((()=>new Iu)),{storyReaderOptions:r}=yp(),i=(0,xl.useRef)(null);return t.currentIndex=e.activeStoryIndex,(0,xl.useEffect)((()=>(t.init({$el:i.current}),()=>{t.destroy()})),[e.stories,e.dir]),(0,xl.useEffect)((()=>{e.setAnimatedNavigationController(new Tu(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;return(0,Ol.jsx)("div",{className:Al()(Hc["stories-list-container"]),style:{"--slide-border-radius":`${a}px`,maxWidth:o},children:(0,Ol.jsx)("div",{className:Hc["stories-list"],ref:r,dir:s.dir,children:e.storyReader.stories.map(((r,i)=>{const a=r===s,o=r.isNextDisabled,l=r.isPrevDisabled;return(0,Ol.jsxs)("div",{style:{width:e.storyGeometry.getWidth()},className:Al()(Hc["stories-list__item"],{[Hc["stories-list__item_active"]]:a}),onClick:()=>{n||e.storyReader.toStoryWithAnimationByIndex(i)},children:[(0,Ol.jsx)(Cu,{index:i,story:r,slideClickDisabled:n,activeStory:s,geometry:e.storyGeometry,onClose:e.onCloseStory}),(e.storyReader.stories.length>1||r.slidesCount>1)&&(0,Ol.jsx)(Du,{dir:e.storyReader.dir,display:a&&s.canBeShown,disabled:n,isNextDisabled:o,isPrevDisabled:l,navigationOptions:t.navigation,onNext:()=>{e.storyReader.goNext()},onPrev:()=>{e.storyReader.goPrev()}})]},r.id)}))})})}));var Vu=M(4267),Fu={insert:"head",singleton:!1};Bl()(Vu.A,Fu);const Uu=Vu.A.locals||{},Gu=({className:e,style:t})=>(0,Ol.jsx)("div",{className:Al()(Kc.story,Kc["story-blank"],e),style:t}),Wu=350,zu="linear",$u=1.6,Hu=2*Math.tan(45*Math.PI/360),qu=Wu/1e3;class Zu{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===rr.RTL?-1:1}destroy(){}}const Ku=.05;class Qu extends Zu{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>=Ku&&this.slider.isEnd?Ku:e<=-.05&&this.slider.isBeginning?-.05:e:e}}const Yu=.05;class Ju extends Zu{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>=Yu&&this.slider.isEnd?Yu:e<=-.05&&this.slider.isBeginning?-.05:e:e}}class Xu extends Zu{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*$u}get depth(){return this.slider.clientWidth/Hu}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*$u,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 eh{static create(e,t){switch(t){case Ht.FLAT:return new Ju(e);case Ht.COVER:return new Qu(e);case Ht.CUBE:return new Xu(e);default:return new Ju(e)}}}var th=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},rh=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},ih=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)},sh=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 ah=(()=>{var t,r,i,s;let a,o,n,l,c,d,u,h,p,g,f,m,y,v,b,w,S,O=e.EventEmitter,x=[],k=[],C=[],P=[],j=[],E=[],M=[];return t=class extends O{constructor(){super(...arguments),r.set(this,(th(this,x),th(this,k,!1))),i.set(this,(th(this,C),th(this,P,0))),s.set(this,(th(this,j),th(this,E,null))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:th(this,M)}),Object.defineProperty(this,"_dir",{enumerable:!0,configurable:!0,writable:!0,value:rr.LTR})}get _animating(){return ih(this,r,"f")}set _animating(e){sh(this,r,e,"f")}get _currentIndex(){return ih(this,i,"f")}set _currentIndex(e){sh(this,i,e,"f")}get effect(){return ih(this,s,"f")}set effect(e){sh(this,s,e,"f")}get dir(){return this._dir}get isLtr(){return this._dir===rr.LTR}get clientWidth(){return this.$el.clientWidth}get animating(){return this._animating}get leftElement(){const e=this.dir===rr.RTL?1:-1;return this.$el.children.item(this._currentIndex+e)}get rightElement(){const e=this.dir===rr.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=eh.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 ${qu}s ${zu}`),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===qu&&"transform"===r.propertyName&&(this.setTransition("transform 0s"),this.$el.removeEventListener("transitionend",t),e())};this.$el.addEventListener("transitionend",t)}))}},r=new WeakMap,i=new WeakMap,s=new WeakMap,(()=>{var e;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=O[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[_.observable],o=[_.observable],n=[_.observable],l=[_.computed],c=[_.computed],d=[_.computed],u=[_.computed],h=[_.computed],p=[_.computed],g=[_.computed],f=[_.computed],m=[_.computed],y=[_.action],v=[_.action],b=[_.action],w=[_.action],S=[_.action],rh(t,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},k,C),rh(t,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),rh(t,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,M),rh(t,null,l,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,x),rh(t,null,c,{kind:"getter",name:"leftElement",static:!1,private:!1,access:{has:e=>"leftElement"in e,get:e=>e.leftElement},metadata:r},null,x),rh(t,null,d,{kind:"getter",name:"rightElement",static:!1,private:!1,access:{has:e=>"rightElement"in e,get:e=>e.rightElement},metadata:r},null,x),rh(t,null,u,{kind:"getter",name:"frontElement",static:!1,private:!1,access:{has:e=>"frontElement"in e,get:e=>e.frontElement},metadata:r},null,x),rh(t,null,h,{kind:"getter",name:"isBeginning",static:!1,private:!1,access:{has:e=>"isBeginning"in e,get:e=>e.isBeginning},metadata:r},null,x),rh(t,null,p,{kind:"getter",name:"isEnd",static:!1,private:!1,access:{has:e=>"isEnd"in e,get:e=>e.isEnd},metadata:r},null,x),rh(t,null,g,{kind:"getter",name:"perspective",static:!1,private:!1,access:{has:e=>"perspective"in e,get:e=>e.perspective},metadata:r},null,x),rh(t,null,f,{kind:"getter",name:"depth",static:!1,private:!1,access:{has:e=>"depth"in e,get:e=>e.depth},metadata:r},null,x),rh(t,null,m,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,x),rh(t,null,y,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:r},null,x),rh(t,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,x),rh(t,null,b,{kind:"method",name:"transformWithAmimation",static:!1,private:!1,access:{has:e=>"transformWithAmimation"in e,get:e=>e.transformWithAmimation},metadata:r},null,x),rh(t,null,w,{kind:"method",name:"move",static:!1,private:!1,access:{has:e=>"move"in e,get:e=>e.move},metadata:r},null,x),rh(t,null,S,{kind:"method",name:"endMove",static:!1,private:!1,access:{has:e=>"endMove"in e,get:e=>e.endMove},metadata:r},null,x),r&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),t})();class oh{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 nh=e=>{const t=(0,xl.useRef)(null),[r]=(0,xl.useState)((()=>new ah)),{storyReaderOptions:i}=yp();(({slider:e,touchController:t})=>{const r=()=>{e.startMove()},i=({dx:t})=>{e.move(-t)},s=()=>{t.horizontalSwipeGesture&&e.endMove()};(0,xl.useEffect)((()=>(t.on(vr.TouchStart,r),t.on(vr.TouchMoveHorizontal,i),t.on(vr.TouchEnd,s),()=>{t.off(vr.TouchStart,r),t.off(vr.TouchMoveHorizontal,i),t.off(vr.TouchEnd,s)})),[e,t])})({slider:r,touchController:e.touchController});const s=i.scrollStyle;r.currentIndex=e.activeStoryIndex+1;const a=e.touchController;(0,xl.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,xl.useLayoutEffect)((()=>{e.setAnimatedNavigationController(new oh(r,{closeOnLastSlideByTimer:Boolean(i.closeOnLastSlideByTimer)}))}),[r,e,i.closeOnLastSlideByTimer]),(0,xl.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 lh=M(3476),ch={insert:"head",singleton:!1};Bl()(lh.A,ch);const dh=lh.A.locals||{};var uh=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=e=>{var{width:t,disabledByUI:r,navigationOptions:i}=e,s=uh(e,["width","disabledByUI","navigationOptions"]);const a=s.dir===rr.LTR,o=(a?s.reachEnd:s.reachStart)||r,n=(a?s.reachStart:s.reachEnd)||r;return(0,Ol.jsxs)("div",{className:Al()([dh["stories-list-controls"]],{[dh["stories-list-controls_desktop"]]:re}),children:[(0,Ol.jsx)("div",{className:dh["stories-list-controls__btn_next"],style:{transform:`translateY(-50%) translateX(calc(${t/2}px + 100%))`},children:(0,Ol.jsx)("button",{className:dh["stories-list-controls__btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onNext()},disabled:o,dangerouslySetInnerHTML:{__html:i.nextButton.svgSrc.baseState}})}),(0,Ol.jsx)("div",{className:dh["stories-list-controls__btn_prev"],style:{transform:`translateY(-50%) translateX(calc(-${t/2}px - 200%))`},children:(0,Ol.jsx)("button",{className:dh["stories-list-controls__btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onPrev()},disabled:n,dangerouslySetInnerHTML:{__html:i.prevButton.svgSrc.baseState}})})]})},ph=(0,kc.observer)((e=>{const{storyReaderOptions:t}=yp(),r=nh(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===qt.Modern;return(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)("div",{className:Al()(Uu["stories-list-container"],{[Uu["stories-list-container_swipe-up"]]:e.storyReader.closeGestureInAction,[Uu["stories-list-container_desktop"]]: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,Ol.jsx)("div",{className:Uu["stories-list"],style:{transform:`translateZ(-${r.depth}px)`},children:(0,Ol.jsxs)("div",{className:Al()(Uu["stories-list__effect-viewer"]),ref:r.ref,children:[(0,Ol.jsx)("div",{className:Al()(Uu["stories-list__item"]),children:(0,Ol.jsx)(Gu,{})}),s.map(((t,r)=>(0,Ol.jsx)("div",{className:Al()(Uu["stories-list__item"]),children:(0,Ol.jsx)(Cu,{slideClickDisabled:o,index:r,story:t,activeStory:i,geometry:e.storyGeometry,onClose:e.onCloseStory})},t.id))),(0,Ol.jsx)("div",{className:Al()(Uu["stories-list__item"]),children:(0,Ol.jsx)(Gu,{})})]})})}),!n&&(0,Ol.jsx)(hh,{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,kc.observer)((({storyReader:e})=>{const{storyReaderOptions:t}=yp(),r=jc();(({touchController:e,activeStory:t})=>{(0,xl.useEffect)((()=>(e.on(vr.LongTouchDetected,r),e.on(vr.TouchEnd,i),()=>{e.off(vr.LongTouchDetected,r),e.off(vr.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}=yp();return(0,xl.useMemo)((()=>{var r;const i=new fs(e.vw,e.vh),s=i.getViewportCorrectionPadding(),a=new gs(e,{vw:e.vw,vh:e.vh-(Ec+Mc)},null!==(r=null==t?void 0:t.actionPanel.height)&&void 0!==r?r:0,i).create(),o=a instanceof hs;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===qt.Modern;return(0,xl.useEffect)((()=>{e.useModernLayout=n}),[e,n]),(0,Cc.createPortal)((0,Ol.jsxs)(Wc,{isDesktopGeometry:a,viewport:r,storyReader:e,children:[a&&n?(0,Ol.jsx)(Nu,{storyGeometry:s,storyReader:e,onCloseStory:()=>{e.close()}}):(0,Ol.jsx)(ph,{isDesktopGeometry:a,storyGeometry:s,safeAreaFrameCalculator:i,correctionPaddingStyle:o,storyReader:e,onCloseStory:()=>{e.close()}}),(0,Ol.jsx)(tc,{orientation:$.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.activeStory&&(t?e.activeStory.pauseUI(e):e.activeStory.resumeUI(e))}})]}),document.body)}));var fh=M(7161),mh=M(429);class yh{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 vh=M(2083);const bh={[uo.BottomSheet]:vh.literal`iam-bottom-sheet`,[uo.Fullscreen]:vh.literal`iam-fullscreen-modal`,[uo.Modal]:vh.literal`iam-modal`},wh=fh.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}.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 .close-strip-btn{margin-top:8px;width:32px;height:4px;background-color:#00000080;border-radius:var(--slide-border-top-left-radius);position:absolute;z-index:10000;left:50%;transform:translate3d(-50%,0,0)}`;var Sh=M(318),_h=M(5125);class Oh{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;null===(e=this.touchController)||void 0===e||e.off(vr.TouchMoveVertical,this.handleTouchMoveVertical),null===(t=this.touchController)||void 0===t||t.off(vr.TouchEnd,this.handleTouchEnd)}setTouchController(e){this.touchController=e,this.touchController.enable(),this.touchController.on(vr.TouchMoveVertical,this.handleTouchMoveVertical),this.touchController.on(vr.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.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 xh=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},kh=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},Ch=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})},Ph=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)},jh=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;let d,u,h,p,g,f,m,y,v,b,w,S,_=[(0,mh.customElement)("iam-bottom-sheet")],O=[],x=fh.LitElement,k=[],C=[],P=[],j=[],E=[],M=[],I=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],V=[],F=[],U=[],G=[],W=[],z=[];u=class extends x{get open(){return Ph(this,e,"f")}set open(t){jh(this,e,t,"f")}get geometry(){return Ph(this,t,"f")}set geometry(e){jh(this,t,e,"f")}get appearanceOptions(){return Ph(this,r,"f")}set appearanceOptions(e){jh(this,r,e,"f")}get touchController(){return Ph(this,i,"f")}set touchController(e){jh(this,i,e,"f")}get desktopMode(){return Ph(this,s,"f")}set desktopMode(e){jh(this,s,e,"f")}get isVisible(){return Ph(this,a,"f")}set isVisible(e){jh(this,a,e,"f")}get isClosed(){return Ph(this,o,"f")}set isClosed(e){jh(this,o,e,"f")}get backdropRef(){return Ph(this,n,"f")}set backdropRef(e){jh(this,n,e,"f")}get bottomSheetBoxRef(){return Ph(this,l,"f")}set bottomSheetBoxRef(e){jh(this,l,e,"f")}get bottomSheetRef(){return Ph(this,c,"f")}set bottomSheetRef(e){jh(this,c,e,"f")}constructor(){super(),e.set(this,kh(this,k,!1)),t.set(this,(kh(this,C),kh(this,P,void 0))),r.set(this,(kh(this,j),kh(this,E,void 0))),i.set(this,(kh(this,M),kh(this,I,void 0))),s.set(this,(kh(this,T),kh(this,L,void 0))),a.set(this,(kh(this,A),kh(this,R,!1))),o.set(this,(kh(this,B),kh(this,D,!0))),n.set(this,(kh(this,N),kh(this,V,null))),l.set(this,(kh(this,F),kh(this,U,null))),c.set(this,(kh(this,G),kh(this,W,null))),Object.defineProperty(this,"bottomSheetSwipeController",{enumerable:!0,configurable:!0,writable:!0,value:(kh(this,z),new Oh(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(),this.bottomSheetSwipeController.setTouchController(this.touchController)}disconnectedCallback(){super.disconnectedCallback()}close(){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(){if(this.isClosed)return fh.nothing;const e={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`},t={width:this.geometry.getWidth()+"px"},r={backgroundColor:this.appearanceOptions.closeButton.backgroundColor,width:`${this.appearanceOptions.closeButton.width}px`,height:`${this.appearanceOptions.closeButton.height}px`,marginTop:`${this.appearanceOptions.closeButton.marginTop}px`};return fh.html`<div id="bottom-sheet" class="bottom-sheet"><div id="bottom-sheet__backdrop" style="${(0,Sh.styleMap)({"--backdrop-opacity":this.appearanceOptions.backdrop.opacity})}" @click="${this.close}" class="bottom-sheet__backdrop ${(0,_h.classMap)({"bottom-sheet__backdrop--open":this.isVisible})}"></div><div class="bottom-sheet__box-wrapper ${(0,_h.classMap)({"bottom-sheet__box-wrapper--desktop-mode":this.desktopMode})}" style="${(0,Sh.styleMap)(t)}"><div style="${(0,Sh.styleMap)(e)}" id="bottom-sheet__box" class="bottom-sheet__box ${(0,_h.classMap)({"bottom-sheet__box--open":this.isVisible})}"><div class="bottom-sheet__header"><div class="close-strip-btn" style="${(0,Sh.styleMap)(r)}"></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,Ch(u,"BottomSheet"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=x[Symbol.metadata])&&void 0!==e?e:null):void 0;h=[(0,mh.property)({type:Boolean})],p=[(0,mh.property)({type:Object})],g=[(0,mh.property)({type:Object})],f=[(0,mh.property)({type:Object})],m=[(0,mh.property)({type:Boolean})],y=[(0,mh.state)()],v=[(0,mh.state)()],b=[(0,mh.query)("#bottom-sheet__backdrop")],w=[(0,mh.query)("#bottom-sheet__box")],S=[(0,mh.query)("#bottom-sheet")],xh(u,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,C),xh(u,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),xh(u,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,M),xh(u,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},I,T),xh(u,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,A),xh(u,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),xh(u,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),xh(u,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},V,F),xh(u,null,w,{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},U,G),xh(u,null,S,{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},W,z),xh(null,d={value:u},_,{kind:"class",name:u.name,metadata:t},null,O),u=d.value,t&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(u,"styles",{enumerable:!0,configurable:!0,writable:!0,value:wh}),kh(u,O)})();const Eh=fh.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)}.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 Mh=M(6968);const Ih=fh.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 Th=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Lh=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},Ah=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})},Rh=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)},Bh=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=[(0,mh.customElement)("iam-modal-close-btn")],n=[],l=fh.LitElement,c=[],d=[],u=[],h=[];i=class extends l{get closeBtnPosition(){return Rh(this,e,"f")}set closeBtnPosition(t){Bh(this,e,t,"f")}get dir(){return Rh(this,t,"f")}set dir(e){Bh(this,t,e,"f")}render(){var e;return fh.html`<button class="close-btn ${(0,_h.classMap)({"close-btn--position_start":this.closeBtnPosition===Se.Start,"close-btn--position_end":this.closeBtnPosition===Se.End,"close-btn--position_none":this.closeBtnPosition===Se.None,"close-btn--dir_ltr":this.dir===rr.LTR,"close-btn--dir_rtl":this.dir===rr.RTL})}">${(0,Mh.unsafeHTML)(null===(e=Vt.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>`}constructor(){super(...arguments),e.set(this,Lh(this,c,void 0)),t.set(this,(Lh(this,d),Lh(this,u,void 0))),Lh(this,h)}};e=new WeakMap,t=new WeakMap,Ah(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,mh.property)({type:Number})],a=[(0,mh.property)({type:String})],Th(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),Th(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},u,h),Th(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:Ih}),Lh(i,n)})();var Dh=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},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},Vh=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})},Fh=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)},Uh=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,u,h,p,g,f,m,y,v=[(0,mh.customElement)("iam-modal")],b=[],w=fh.LitElement,S=[],_=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],M=[],I=[],T=[],L=[],A=[],R=[],B=[];c=class extends w{get open(){return Fh(this,e,"f")}set open(t){Uh(this,e,t,"f")}get fullscreen(){return Fh(this,t,"f")}set fullscreen(e){Uh(this,t,e,"f")}get geometry(){return Fh(this,r,"f")}set geometry(e){Uh(this,r,e,"f")}get appearanceOptions(){return Fh(this,i,"f")}set appearanceOptions(e){Uh(this,i,e,"f")}get dir(){return Fh(this,s,"f")}set dir(e){Uh(this,s,e,"f")}get isVisible(){return Fh(this,a,"f")}set isVisible(e){Uh(this,a,e,"f")}get isClosed(){return Fh(this,o,"f")}set isClosed(e){Uh(this,o,e,"f")}get backdropRef(){return Fh(this,n,"f")}set backdropRef(e){Uh(this,n,e,"f")}constructor(){super(),e.set(this,Nh(this,S,!1)),t.set(this,(Nh(this,_),Nh(this,O,!1))),r.set(this,(Nh(this,x),Nh(this,k,void 0))),i.set(this,(Nh(this,C),Nh(this,P,void 0))),s.set(this,(Nh(this,j),Nh(this,E,void 0))),a.set(this,(Nh(this,M),Nh(this,I,!1))),o.set(this,(Nh(this,T),Nh(this,L,!0))),n.set(this,(Nh(this,A),Nh(this,R,null))),Nh(this,B)}close(){const e=this.appearanceOptions.animationType===we.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 we.SlideInUp:return"slideInUp";case we.FadeIn:return"fadeInWithZoom";default:return""}}getOutModalAnimationCSSClass(e){switch(e){case we.SlideInUp:return"slideInOut";case we.FadeIn:return"fadeOutWithZoom";default:return""}}getBackdropAnimationCSSClass(e){return e?"fadeIn":"fadeOut"}render(){const e=this.fullscreen?0:this.appearanceOptions.borderRadius,t={background:this.appearanceOptions.background,height:this.geometry.getHeight()+"px",width:this.geometry.getWidth()+"px","--slide-border-top-left-radius":`${e}px`,"--slide-border-top-right-radius":`${e}px`,"--slide-border-bottom-left-radius":`${e}px`,"--slide-border-bottom-right-radius":`${e}px`},r=this.appearanceOptions.animationType,i=this.isVisible?this.getEnterModalAnimationCSSClass(r):this.getOutModalAnimationCSSClass(r),s=this.getBackdropAnimationCSSClass(this.isVisible);return fh.html`<div class="modal"><div id="modal__backdrop" style="${(0,Sh.styleMap)({"--backdrop-opacity":this.appearanceOptions instanceof _e?this.appearanceOptions.backdrop.opacity:void 0})}" class="modal__backdrop ${(0,_h.classMap)({[s]:r!==we.None})}"></div><div @click="${this.close}" class="modal__box ${(0,_h.classMap)({[i]:!0})}">${this.fullscreen?fh.html`<div class="modal__header"><iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn></div>`:fh.nothing}<div style="${(0,Sh.styleMap)(t)}" class="modal__box-content ${(0,_h.classMap)({"modal__box-content--fullscreen":this.fullscreen})}">${this.fullscreen?fh.nothing:fh.html`<div class="modal__header"><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,Vh(c,"Modal"),(()=>{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,mh.property)({type:Boolean})],u=[(0,mh.property)({type:Boolean})],h=[(0,mh.property)({type:Object})],p=[(0,mh.property)({type:Object})],g=[(0,mh.property)({type:String})],f=[(0,mh.state)()],m=[(0,mh.state)()],y=[(0,mh.query)("#modal__backdrop")],Dh(c,null,d,{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},S,_),Dh(c,null,u,{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},O,x),Dh(c,null,h,{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},k,C),Dh(c,null,p,{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},P,j),Dh(c,null,g,{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},E,M),Dh(c,null,f,{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},I,T),Dh(c,null,m,{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},L,A),Dh(c,null,y,{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},R,B),Dh(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:Eh}),Nh(c,b)})();var Gh=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Wh=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},zh=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})},$h=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)},Hh=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=[(0,mh.customElement)("iam-fullscreen-modal")],c=[],d=fh.LitElement,u=[],h=[],p=[],g=[],f=[],m=[];s=class extends d{get open(){return $h(this,e,"f")}set open(t){Hh(this,e,t,"f")}get geometry(){return $h(this,t,"f")}set geometry(e){Hh(this,t,e,"f")}get appearanceOptions(){return $h(this,r,"f")}set appearanceOptions(e){Hh(this,r,e,"f")}render(){return fh.html`<iam-modal ?open="${this.open}" .fullscreen="${!0}" .geometry="${this.geometry}" .appearanceOptions="${this.appearanceOptions}"><slot></slot></iam-modal>`}constructor(){super(...arguments),e.set(this,Wh(this,u,!1)),t.set(this,(Wh(this,h),Wh(this,p,void 0))),r.set(this,(Wh(this,g),Wh(this,f,void 0))),Wh(this,m)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,zh(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,mh.property)({type:Boolean})],o=[(0,mh.property)({type:Object})],n=[(0,mh.property)({type:Object})],Gh(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},u,h),Gh(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),Gh(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),Gh(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}),Wh(s,c)})()})();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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},Zh=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},Kh=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})},Qh=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)},Yh=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;let n,l,c,d,u,h,p,g,f,m=[(0,mh.customElement)("message-view-factory")],y=[],v=fh.LitElement,b=[],w=[],S=[],_=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],M=[],I=[],T=[];l=class extends v{get appearanceOptions(){return Qh(this,e,"f")}set appearanceOptions(t){Yh(this,e,t,"f")}get type(){return Qh(this,t,"f")}set type(e){Yh(this,t,e,"f")}get open(){return Qh(this,r,"f")}set open(e){Yh(this,r,e,"f")}get geometry(){return Qh(this,i,"f")}set geometry(e){Yh(this,i,e,"f")}get touchController(){return Qh(this,s,"f")}set touchController(e){Yh(this,s,e,"f")}get desktopMode(){return Qh(this,a,"f")}set desktopMode(e){Yh(this,a,e,"f")}get dir(){return Qh(this,o,"f")}set dir(e){Yh(this,o,e,"f")}render(){const e=bh[this.type];return e?vh.html`
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lodash/isFunction.js"),require("uuid"),require("lodash/isObject.js"),require("lodash/isNil.js"),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/isEmpty.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/static-html.js"),require("lit/directives/style-map.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","lodash/isObject.js","lodash/isNil.js","mobx","lodash/isString.js","bowser","lodash/isEqual.js","lodash/head.js","deepmerge","lodash/debounce.js","@inappstory/slide-api","async-mutex","lodash/isEmpty.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/static-html.js","lit/directives/style-map.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("lodash/isObject.js"),require("lodash/isNil.js"),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/isEmpty.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/static-html.js"),require("lit/directives/style-map.js"),require("lit/directives/class-map.js"),require("lit/directives/unsafe-html.js")):t(e["lodash/isFunction.js"],e.uuid,e["lodash/isObject.js"],e["lodash/isNil.js"],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/isEmpty.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/static-html.js"],e["lit/directives/style-map.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,x,k,C,P)=>(()=>{var j={6644:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".aspect-ratio-box--XcAlO{overflow:hidden;position:relative}.aspect-ratio-box--XcAlO.aspect-ratio-box--centered--iE948{width:auto;height:100%;left:50%;transform:translateX(-50%)}.aspect-ratio-box-inside--j-DAC{position:absolute;top:0;left:0;width:100%;height:100%}",""]),s.locals={"aspect-ratio-box":"aspect-ratio-box--XcAlO","aspect-ratio-box--centered":"aspect-ratio-box--centered--iE948","aspect-ratio-box-inside":"aspect-ratio-box-inside--j-DAC"};const a=s},8034:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".close-btn--vv7G4{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;width:40px;height:40px;display:flex;justify-content:center;align-items:center}.close-btn--vv7G4:focus{outline:none}.close-btn--vv7G4 svg{overflow:visible;width:40px;height:40px}.close-btn--vv7G4[data-position=start],.close-btn--vv7G4[data-position=left]{left:10px}.close-btn--vv7G4[data-position=start][dir=rtl],.close-btn--vv7G4[data-position=left][dir=rtl]{left:auto;right:10px}.close-btn--vv7G4[data-position=end],.close-btn--vv7G4[data-position=right]{right:10px}.close-btn--vv7G4[data-position=end][dir=rtl],.close-btn--vv7G4[data-position=right][dir=rtl]{left:10px;right:auto}",""]),s.locals={"close-btn":"close-btn--vv7G4"};const a=s},9678:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'@keyframes spin--Vkzob{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.splash-container--o7jGP{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;z-index:-1}.splash-container--o7jGP .splash-container__image--oC55V{position:absolute;inset:0px;z-index:0}.splash-container--o7jGP .splash-container__image--oC55V img{width:100%;height:100%;object-fit:cover}.splash-container--o7jGP .splash-container__lottie--krFru{position:absolute;inset:0px;z-index:1}.splash-container--o7jGP .splash-container__lottie--krFru canvas{width:100%;height:100%}.splash-container--o7jGP.splash-container--isLoading--O-XQM: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--Vkzob .6s infinite linear;z-index:10}.splash-container--o7jGP.splash-container--fadeIn--7OcPY{opacity:1;transition:opacity ease-in .2s}.splash-container--o7jGP.splash-container--fadeOut--MC7Yo{opacity:0;transition:opacity ease-out .3s}',""]),s.locals={"splash-container":"splash-container--o7jGP","splash-container__image":"splash-container__image--oC55V","splash-container__lottie":"splash-container__lottie--krFru","splash-container--isLoading":"splash-container--isLoading--O-XQM",spin:"spin--Vkzob","splash-container--fadeIn":"splash-container--fadeIn--7OcPY","splash-container--fadeOut":"splash-container--fadeOut--MC7Yo"};const a=s},4978:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.game-reader-container--nTAGw{background-color:rgba(0,0,0,0);position:fixed;left:0px;top:0px;padding:0px;border:0px;z-index:2147483645;width:100%;height:100%;overflow:hidden;color-scheme:auto}.game-reader--1ZgeS{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;background:rgba(0,0,0,0);z-index:1;user-select:none;pointer-events:all;color:#fff}.game-reader--1ZgeS.game-reader--desktop-mode--zMQsZ{padding:50px 0}.game-reader--1ZgeS.game-reader--desktop-mode--zMQsZ .game-reader__game-box--x-oIW{border-radius:var(--game-box-border-radius)}.game-reader--1ZgeS.game-reader--widescreen--GwmsH{padding:0 0}.game-reader--1ZgeS.game-reader--widescreen--GwmsH .game-reader__game-box--x-oIW{border-radius:0px}.game-reader--1ZgeS .game-reader__refresh-btn--1pHw3{cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);z-index:2}.game-reader--1ZgeS .game-reader__game-box--x-oIW.game-reader__game-box--widescreen--OCOoy{border-radius:0px}.game-reader--1ZgeS .game-reader__iframe--dVpcW{width:100%;height:100%;transition:opacity ease-in .3s}.game-reader--1ZgeS .game-reader__backdrop--ojYHb{position:fixed;inset:0;z-index:-1}',""]),s.locals={"game-reader-container":"game-reader-container--nTAGw","game-reader":"game-reader--1ZgeS","game-reader--desktop-mode":"game-reader--desktop-mode--zMQsZ","game-reader__game-box":"game-reader__game-box--x-oIW","game-reader--widescreen":"game-reader--widescreen--GwmsH","game-reader__refresh-btn":"game-reader__refresh-btn--1pHw3","game-reader__game-box--widescreen":"game-reader__game-box--widescreen--OCOoy","game-reader__iframe":"game-reader__iframe--dVpcW","game-reader__backdrop":"game-reader__backdrop--ojYHb"};const a=s},763:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.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)}",""]),s.locals={};const a=s},5213:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,"h3{margin:0}.stories-list-wrapper--rTQwL{background-color:var(--background-color, transparent);height:auto;padding:0;position:relative}.stories-list-wrapper--rTQwL.mode-desktop--o0ka0.with-list-controls--k8u1L{position:relative}.stories-list--cPITI{position:relative;overflow:visible}@media(min-width: 767.99px){.stories-list--cPITI{overflow:hidden}}.stories-list__actions--SI0\\+0{position:absolute;right:0;top:0}.stories-list__viewport--KbCw2{overflow:hidden;height:auto}.stories-list__viewport--KbCw2:not(.mode-desktop--o0ka0){display:flex}.stories-list__viewport-inner--LCUH4{display:flex;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-top:var(--storiesListTopPadding, 0);padding-bottom:var(--storiesListBottomPadding, 0);box-sizing:content-box}.stories-list__viewport-inner--LCUH4::-webkit-scrollbar{display:none}.stories-list__viewport-inner--LCUH4.mode-desktop--o0ka0{scroll-behavior:unset;cursor:grab}.stories-list__viewport-inner--LCUH4.isVerticalDirection--jIuyZ{display:grid;grid-template-columns:repeat(auto-fill, var(--story-card-width, 174px));justify-content:center;width:100%}.stories-list__viewport-inner--LCUH4.align-center--zgJPi{margin-left:auto;margin-right:auto}.stories-list__viewport-inner--LCUH4.align-left--mSkW6{margin-right:auto}.stories-list__viewport-inner--LCUH4.align-right--R8\\+zN{margin-left:auto}.stories-list__viewport-inner--LCUH4.isTitleCardOutsideTop--M9GF-{align-items:flex-end}.stories-list__viewport-inner--LCUH4.isTitleCardOutsideBottom--rx9jV{align-items:flex-start}",""]),s.locals={"stories-list-wrapper":"stories-list-wrapper--rTQwL","mode-desktop":"mode-desktop--o0ka0","with-list-controls":"with-list-controls--k8u1L","stories-list":"stories-list--cPITI","stories-list__actions":"stories-list__actions--SI0+0","stories-list__viewport":"stories-list__viewport--KbCw2","stories-list__viewport-inner":"stories-list__viewport-inner--LCUH4",isVerticalDirection:"isVerticalDirection--jIuyZ","align-center":"align-center--zgJPi","align-left":"align-left--mSkW6","align-right":"align-right--R8+zN",isTitleCardOutsideTop:"isTitleCardOutsideTop--M9GF-",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--rx9jV"};const a=s},7966:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".favorite-images-wrapper--Xrkk6{display:flex;flex-direction:row;flex-wrap:wrap;padding:var(--storiesListCardFavoriteTitle, --storiesListItemTitlePadding, 0px);gap:var(--storiesListCardFavoriteGap, 3px);box-sizing:border-box}.favorite-image-wrapper--iWxvX{flex:0 1 calc(50% - var(--storiesListCardFavoriteGap, 3px));position:relative}.favorite-image--zPW-D{position:relative}.favorite-image-item--t9M\\+t{position:absolute;inset:0px;border-radius:calc(var(--storiesListInnerBorderRadiusRead, 0)/4);background-position:50% 50%;background-size:cover}.circle_style--3lFSw .favorite-image-item--t9M\\+t{border-radius:50%}",""]),s.locals={"favorite-images-wrapper":"favorite-images-wrapper--Xrkk6","favorite-image-wrapper":"favorite-image-wrapper--iWxvX","favorite-image":"favorite-image--zPW-D","favorite-image-item":"favorite-image-item--t9M+t",circle_style:"circle_style--3lFSw"};const a=s},6892:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.stories-slide-wrapper--aVM\\+1:not(:last-child){margin-right:var(--storiesGap, 20px)}.stories-slide-wrapper--aVM\\+1{display:flex;flex-direction:column;flex:0 0 auto;box-sizing:content-box;width:var(--story-card-width);cursor:pointer;-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--aVM\\+1:hover{text-decoration:none}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze{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--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x{border-radius:var(--storiesListBorderRadius, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide-image--E2w7f,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide-image--E2w7f{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide-image__image--viK-T video,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide-image__image--viK-T video{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide__mask--Ra85s,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide__mask--Ra85s{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7 .stories-slide__content--GZM3d,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x .stories-slide__content--GZM3d{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j{border-radius:var(--storiesListBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide-image--E2w7f,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide-image--E2w7f{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide-image__image--viK-T video,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide-image__image--viK-T,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide-image__image--viK-T video{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide__mask--Ra85s,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide__mask--Ra85s{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-quad--jf7N7._is-read--O-P1j .stories-slide__content--GZM3d,.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._format-rectangle--Kqy8x._is-read--O-P1j .stories-slide__content--GZM3d{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._is-read--O-P1j{border:var(--storiesListBorderReadWidth, 1px) solid var(--storiesBorderReadColor, #ededed)}.stories-slide-wrapper--aVM\\+1.isTitleCardOutsideTop--rgyxL{justify-content:flex-end}.stories-slide-wrapper--aVM\\+1.isTitleCardOutsideBottom--9w6eu{justify-content:flex-start}.stories-slide-wrapper--aVM\\+1 .stories-slide__inner--jP7d2{display:block;position:relative;width:100%;height:100%}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-black--LzoGN{background:#000}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-white--cCu4O{background:#fff}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-red--oS-Gd{background:#ff1a36}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-yellow--hVzqv{background:#fff000}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-green--hQFmN{background:#0be361}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-violet--D\\+STO{background:#b300bc}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-blue--GkTxq{background:#0761db}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-grey--qU8eo{background:#a8a8a8}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-black-gradient--I75n4{background:#fff;background:linear-gradient(0deg, #c1c1c1, #000)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-white-gradient--yfwk7{background:#fff;background:linear-gradient(180deg, #fff, #ffc800)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-red-gradient--i3Awy{background:#ff1a36;background:linear-gradient(180deg, #c90174, #eb5c57)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-yellow-gradient--c89UQ{background:#fff000;background:linear-gradient(0deg, #fbda61, #f76b1c)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-green-gradient--3TGxB{background:#0be361;background:linear-gradient(0deg, #b4ed50, #429321)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-violet-gradient--JAdS3{background:#b300bc;background:linear-gradient(180deg, #c90174, #0164fd)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-blue-gradient--qKJCa{background:#0761db;background:linear-gradient(180deg, #3023ae, #53a0fe 48%, #b4ed50)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._background-color-grey-gradient--4\\+MvA{background:#a8a8a8;background:linear-gradient(0deg, #e2e2e2, #959595)}.stories-slide-wrapper--aVM\\+1 .stories-slide-image--E2w7f{position:relative;width:100%;height:100%}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__wrap--jAg55{position:absolute;top:0;bottom:0;left:0;right:0}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T{position:relative;opacity:1;transition:opacity .3s ease-in-out;overflow:hidden}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T._mode_list--dkBpg{width:100%;height:100%}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T.ugc-card-cell--Ybjtv img{object-fit:contain}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T img{width:100%;height:100%;object-fit:cover}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T 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--aVM\\+1 .stories-slide-image__image--viK-T.video-loaded--CLBMu img{display:none}.stories-slide-wrapper--aVM\\+1 .stories-slide-image__image--viK-T.video-loaded--CLBMu video{opacity:1}.stories-slide-wrapper--aVM\\+1 .stories-slide__mask--Ra85s{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--aVM\\+1 .stories-slide--ZUGze._is-read--O-P1j .stories-slide__mask--Ra85s{background-color:var(--storiesListItemOpenedMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemOpenedMaskLinearGradient, none)}.stories-slide-wrapper--aVM\\+1 .stories-slide--ZUGze._ugc-cell--f8S1f .stories-slide__mask--Ra85s{background-color:var(--storiesListCardUgcMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListCardUgcMaskLinearGradient, none)}.stories-slide-wrapper--aVM\\+1 .stories-slide__content--GZM3d{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--aVM\\+1 .stories-slide__content--GZM3d.__position_outside_top--en7U6,.stories-slide-wrapper--aVM\\+1 .stories-slide__content--GZM3d.__position_outside_bottom--X5wOp{position:relative;top:unset;right:unset;bottom:unset;left:unset;height:auto}.stories-slide-wrapper--aVM\\+1 .clamp--1Awvg{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn.align-left--835Gu{text-align:left}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn.align-center--5jKkF{text-align:center}.stories-slide-wrapper--aVM\\+1 .stories-slide__title--PDoTn.align-right--Pfrzc{text-align:right}.stories-slide--ZUGze._format-circle--prePc,.stories-slide--ZUGze._format-circle--prePc .stories-slide-image__image--viK-T,.stories-slide--ZUGze._format-circle--prePc .stories-slide-image__image--viK-T video,.stories-slide--ZUGze._format-circle--prePc .stories-slide__mask--Ra85s,.stories-slide--ZUGze._format-circle--prePc .stories-slide-image--E2w7f{border-radius:50%}.stories-slide--ZUGze._favorite-cell--1l8Xk .stories-slide__mask--Ra85s{background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%)}.stories-slide--ZUGze._favorite-cell--1l8Xk._format-circle--prePc .stories-slide-image__wrap--jAg55{display:flex}.stories-slide--ZUGze._favorite-cell--1l8Xk._format-circle--prePc .stories-slide-image__image--viK-T{width:85%;height:85%;overflow:visible;margin:auto}.stories-slide--ZUGze._favorite-cell--1l8Xk._format-circle--prePc .favorite-images-wrapper--\\+i2pB{margin:0;padding:0}.stories-slide--ZUGze._has-drop-shadow--2LySa{filter:drop-shadow(var(--storiesListCardDropShadow, none))}.stories-slide--ZUGze._has-drop-shadow--2LySa._is-read--O-P1j{filter:drop-shadow(var(--storiesListCardOpenedDropShadow, none))}.stories-slide--ZUGze._has-drop-shadow--2LySa._favorite-cell--1l8Xk{filter:drop-shadow(var(--storiesListCardFavoriteDropShadow, none))}.stories-slide--ZUGze._has-drop-shadow--2LySa._ugc-cell--f8S1f{filter:drop-shadow(var(--storiesListCardUgcDropShadow, none))}.stories-slide--ZUGze._has-card-svg-mask--17djB .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardMask);mask-image:var(--storiesListCardMask)}.stories-slide--ZUGze._has-card-svg-mask--17djB._is-read--O-P1j .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardOpenedMask);mask-image:var(--storiesListCardOpenedMask)}.stories-slide--ZUGze._has-card-svg-mask--17djB._favorite-cell--1l8Xk .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardFavoriteMask);mask-image:var(--storiesListCardFavoriteMask)}.stories-slide--ZUGze._has-card-svg-mask--17djB._ugc-cell--f8S1f .stories-slide__inner--jP7d2{-webkit-mask-image:var(--storiesListCardUgcMask);mask-image:var(--storiesListCardUgcMask)}.stories-slide--ZUGze .card-overlay-svg-mask--PoiQW{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--ZUGze._has-border-gradient-color--xkN4Z{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z: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--ZUGze._has-border-gradient-color--xkN4Z._is-read--O-P1j{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z._is-read--O-P1j: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--ZUGze._has-border-gradient-color--xkN4Z._favorite-cell--1l8Xk{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z._favorite-cell--1l8Xk: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--ZUGze._has-border-gradient-color--xkN4Z._ugc-cell--f8S1f{border-color:rgba(0,0,0,0)}.stories-slide--ZUGze._has-border-gradient-color--xkN4Z._ugc-cell--f8S1f: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}}',""]),s.locals={"stories-slide-wrapper":"stories-slide-wrapper--aVM+1","stories-slide":"stories-slide--ZUGze","_format-quad":"_format-quad--jf7N7","_format-rectangle":"_format-rectangle--Kqy8x","stories-slide-image":"stories-slide-image--E2w7f","stories-slide-image__image":"stories-slide-image__image--viK-T","stories-slide__mask":"stories-slide__mask--Ra85s","stories-slide__content":"stories-slide__content--GZM3d","_is-read":"_is-read--O-P1j",isTitleCardOutsideTop:"isTitleCardOutsideTop--rgyxL",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--9w6eu","stories-slide__inner":"stories-slide__inner--jP7d2","_background-color-black":"_background-color-black--LzoGN","_background-color-white":"_background-color-white--cCu4O","_background-color-red":"_background-color-red--oS-Gd","_background-color-yellow":"_background-color-yellow--hVzqv","_background-color-green":"_background-color-green--hQFmN","_background-color-violet":"_background-color-violet--D+STO","_background-color-blue":"_background-color-blue--GkTxq","_background-color-grey":"_background-color-grey--qU8eo","_background-color-black-gradient":"_background-color-black-gradient--I75n4","_background-color-white-gradient":"_background-color-white-gradient--yfwk7","_background-color-red-gradient":"_background-color-red-gradient--i3Awy","_background-color-yellow-gradient":"_background-color-yellow-gradient--c89UQ","_background-color-green-gradient":"_background-color-green-gradient--3TGxB","_background-color-violet-gradient":"_background-color-violet-gradient--JAdS3","_background-color-blue-gradient":"_background-color-blue-gradient--qKJCa","_background-color-grey-gradient":"_background-color-grey-gradient--4+MvA","stories-slide-image__wrap":"stories-slide-image__wrap--jAg55",_mode_list:"_mode_list--dkBpg","ugc-card-cell":"ugc-card-cell--Ybjtv","video-loaded":"video-loaded--CLBMu","_ugc-cell":"_ugc-cell--f8S1f",__position_outside_top:"__position_outside_top--en7U6",__position_outside_bottom:"__position_outside_bottom--X5wOp",clamp:"clamp--1Awvg","stories-slide__title":"stories-slide__title--PDoTn","align-left":"align-left--835Gu","align-center":"align-center--5jKkF","align-right":"align-right--Pfrzc","_format-circle":"_format-circle--prePc","_favorite-cell":"_favorite-cell--1l8Xk","favorite-images-wrapper":"favorite-images-wrapper--+i2pB","_has-drop-shadow":"_has-drop-shadow--2LySa","_has-card-svg-mask":"_has-card-svg-mask--17djB","card-overlay-svg-mask":"card-overlay-svg-mask--PoiQW","_has-border-gradient-color":"_has-border-gradient-color--xkN4Z"};const a=s},1980:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-controls--PIqE6{pointer-events:none}.stories-list-controls--PIqE6 .control-start--0L66N,.stories-list-controls--PIqE6 .control-end--rFrlW{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--PIqE6 .control-icon--9JIpq{width:7px;height:12px;background-color:var(--storiesListControlsColor, black)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-start--0L66N{left:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-start--0L66N.control-start_dir_rtl--HAuqS{left:auto;right:0;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-end--rFrlW{right:0;transform:translate3d(0, -50%, 0)}.stories-list-controls--PIqE6.horizontal---4ee9 .control-end--rFrlW.control-end_dir_rtl--qq6Cs{left:0;right:auto;transform:translate3d(0, -50%, 0) rotate(180deg)}.stories-list-controls--PIqE6.vertical--fd6vu .control-start--0L66N{top:var(--storiesListTopPadding, 0);left:50%;transform:translate3d(-50%, 0, 0) rotate(90deg)}.stories-list-controls--PIqE6.vertical--fd6vu .control-end--rFrlW{top:auto;bottom:var(--storiesListBottomPadding, 0);right:50%;transform:translate3d(50%, 0, 0) rotate(90deg)}.stories-list-controls--PIqE6 .control-start--0L66N{display:flex}.stories-list-controls--PIqE6 .control-start--0L66N .control-icon--9JIpq{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 11L1 6L6 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 11L1 6L6 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")}.stories-list-controls--PIqE6 .control-start--0L66N.control-start_reach-start--\\+WUMI{display:none}.stories-list-controls--PIqE6 .control-end--rFrlW{display:flex}.stories-list-controls--PIqE6 .control-end--rFrlW .control-icon--9JIpq{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 11L6 6L1 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 11L6 6L1 1' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")}.stories-list-controls--PIqE6 .control-end--rFrlW.control-end_reach-end--xjGeY{display:none}",""]),s.locals={"stories-list-controls":"stories-list-controls--PIqE6","control-start":"control-start--0L66N","control-end":"control-end--rFrlW","control-icon":"control-icon--9JIpq",horizontal:"horizontal---4ee9","control-start_dir_rtl":"control-start_dir_rtl--HAuqS","control-end_dir_rtl":"control-end_dir_rtl--qq6Cs",vertical:"vertical--fd6vu","control-start_reach-start":"control-start_reach-start--+WUMI","control-end_reach-end":"control-end_reach-end--xjGeY"};const a=s},3476:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-controls--k32qT .stories-list-controls__btn_next--B9L9K,.stories-list-controls--k32qT .stories-list-controls__btn_prev--nnqoJ{display:none}.stories-list-controls--k32qT.stories-list-controls_desktop--pnSQF .stories-list-controls__btn_next--B9L9K,.stories-list-controls--k32qT.stories-list-controls_desktop--pnSQF .stories-list-controls__btn_prev--nnqoJ{display:block;position:absolute;top:50%;transform:translateY(-50%);left:50%}.stories-list-controls--k32qT .stories-list-controls__btn-icon--W0gAK{-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);border:none;color:#fff;cursor:pointer}.stories-list-controls--k32qT .stories-list-controls__btn-icon--W0gAK:focus{outline:0}.stories-list-controls--k32qT .stories-list-controls__btn-icon--W0gAK:disabled{color:#464646;cursor:not-allowed}",""]),s.locals={"stories-list-controls":"stories-list-controls--k32qT","stories-list-controls__btn_next":"stories-list-controls__btn_next--B9L9K","stories-list-controls__btn_prev":"stories-list-controls__btn_prev--nnqoJ","stories-list-controls_desktop":"stories-list-controls_desktop--pnSQF","stories-list-controls__btn-icon":"stories-list-controls__btn-icon--W0gAK"};const a=s},4267:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-container--HUkCt{left:50%;transform:translateX(-50%);overflow:hidden;box-sizing:border-box;z-index:1;position:relative;height:100%}.stories-list-container--HUkCt.stories-list-container_swipe-up--T3YBM.stories-list-container_swipe-up--T3YBM{background-color:rgba(0,0,0,0)}.stories-list-container--HUkCt.stories-list-container_desktop--2vId\\+{padding:50px 0}.stories-list-container--HUkCt *,.stories-list-container--HUkCt ::after,.stories-list-container--HUkCt ::before{box-sizing:border-box}.stories-list-container--HUkCt .stories-list--Hajgi{position:relative;height:100%;transform-style:preserve-3d}.stories-list-container--HUkCt .stories-list--Hajgi .stories-list__effect-viewer--26-zb{position:relative;top:0;left:0;right:0;width:100%;width:calc(100% + .01px);height:100%;transform-style:preserve-3d}.stories-list-container--HUkCt .stories-list--Hajgi .stories-list__item--LyxO0{position:absolute;width:100%;height:auto;bottom:0;border-radius:var(--slide-border-radius, 0);left:0;top:0;backface-visibility:hidden}",""]),s.locals={"stories-list-container":"stories-list-container--HUkCt","stories-list-container_swipe-up":"stories-list-container_swipe-up--T3YBM","stories-list-container_desktop":"stories-list-container_desktop--2vId+","stories-list":"stories-list--Hajgi","stories-list__effect-viewer":"stories-list__effect-viewer--26-zb","stories-list__item":"stories-list__item--LyxO0"};const a=s},6778:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-list-controls--Z6bj-{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:100000;transition:opacity 300ms}.story-list-controls--Z6bj-.story-list-controls_hidden--Ku7Se{opacity:0}.story-list-controls--Z6bj-.story-list-controls_hidden--Ku7Se .story-list-controls__item--rzR7a{pointer-events:none}.story-list-controls--Z6bj-:hover .story-list-controls__btn--l\\+xeN{color:#fff}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a{position:absolute;top:0;bottom:0;display:flex;flex-direction:column;justify-content:center;pointer-events:all}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a.story-list-controls__item_next--jUE9p{right:-42px}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a.story-list-controls__item_prev--jCli3{left:-42px}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN{-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;border:none;color:#fff;cursor:pointer}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN:focus{outline:0}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN :active{opacity:.3}.story-list-controls--Z6bj- .story-list-controls__item--rzR7a .story-list-controls__btn--l\\+xeN:disabled{color:#464646;cursor:not-allowed}",""]),s.locals={"story-list-controls":"story-list-controls--Z6bj-","story-list-controls_hidden":"story-list-controls_hidden--Ku7Se","story-list-controls__item":"story-list-controls__item--rzR7a","story-list-controls__btn":"story-list-controls__btn--l+xeN","story-list-controls__item_next":"story-list-controls__item_next--jUE9p","story-list-controls__item_prev":"story-list-controls__item_prev--jCli3"};const a=s},9037:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-list-container--fP9aN{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--fP9aN .stories-list--xleip{display:flex;width:100%;height:inherit;position:relative}.stories-list-container--fP9aN .stories-list--xleip .stories-list__item--OkuTV{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--fP9aN .stories-list--xleip .stories-list__item--OkuTV.stories-list__item_active--hZPq-{transform:scale(1);cursor:inherit}",""]),s.locals={"stories-list-container":"stories-list-container--fP9aN","stories-list":"stories-list--xleip","stories-list__item":"stories-list__item--OkuTV","stories-list__item_active":"stories-list__item_active--hZPq-"};const a=s},1239:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".stories-viewer--4fkyX{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--4fkyX:-webkit-full-screen,.stories-viewer--4fkyX:-moz-full-screen,.stories-viewer--4fkyX:-ms-fullscreen,.stories-viewer--4fkyX :fullscreen{width:100% !important;height:100% !important}.stories-viewer--4fkyX.no-select--DtR2G{user-select:none}.stories-viewer--4fkyX .stories-viewer-background--VIoup{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--4fkyX .stories-viewer-backdrop---yMm9{position:fixed;top:0;right:0;bottom:0;left:0;z-index:11;background-color:rgba(255,255,255,.5)}.stories-viewer--4fkyX .stories-viewer-backdrop---yMm9._desktopMode--wpoLG{display:none}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ{width:40px;height:40px;position:absolute;top:15px;color:#c2c2c4;z-index:100001}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=start],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=left]{left:15px}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=start][dir=rtl],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=left][dir=rtl]{left:auto;right:15px}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=end],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=right]{right:15px}.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=end][dir=rtl],.stories-viewer--4fkyX .stories-viewer__close-btn--yKzUQ[data-position=right][dir=rtl]{left:15px;right:auto}",""]),s.locals={"stories-viewer":"stories-viewer--4fkyX","no-select":"no-select--DtR2G","stories-viewer-background":"stories-viewer-background--VIoup","stories-viewer-backdrop":"stories-viewer-backdrop---yMm9",_desktopMode:"_desktopMode--wpoLG","stories-viewer__close-btn":"stories-viewer__close-btn--yKzUQ"};const a=s},6028:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-action-panel--iVHfj{position:absolute;z-index:10001;bottom:0;left:0;right:0;padding:0 8px 8px 8px;height:50px;pointer-events:none}.story-action-panel--iVHfj.story-action-panel_hidden--CNOTD .story-action-panel-actions--jnWO2{opacity:0}.story-action-panel--iVHfj.story-action-panel_hidden--CNOTD .story-action-panel-actions--jnWO2 .story-action-panel-actions__item--z7hWw{pointer-events:none}.story-action-panel--iVHfj.story-action-panel_mobile--BsoA4{background-color:#000}.story-action-panel--iVHfj[dir=rtl] .story-action-panel-actions--jnWO2 .story-action-panel-actions__right-container--42xWx{margin-left:0;margin-right:auto}.story-action-panel--iVHfj[dir=rtl] .story-action-panel-actions--jnWO2 .story-action-panel-actions__item--z7hWw{transform:scaleX(-1)}.story-action-panel-actions--jnWO2{width:100%;height:100%;display:flex;flex-direction:row;color:#fff;align-items:center;transition:opacity 300ms}.story-action-panel-actions--jnWO2>span{display:flex}.story-action-panel-actions--jnWO2 .story-action-panel-actions__right-container--42xWx{margin-left:auto;display:flex}.story-action-panel-actions__item--z7hWw{cursor:pointer;pointer-events:all;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--z7hWw>*{pointer-events:none}.story-action-panel-actions__item--z7hWw:not(:last-child){margin-right:5px}.story-action-panel-actions__item--z7hWw:hover{filter:drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.9))}",""]),s.locals={"story-action-panel":"story-action-panel--iVHfj","story-action-panel_hidden":"story-action-panel_hidden--CNOTD","story-action-panel-actions":"story-action-panel-actions--jnWO2","story-action-panel-actions__item":"story-action-panel-actions__item--z7hWw","story-action-panel_mobile":"story-action-panel_mobile--BsoA4","story-action-panel-actions__right-container":"story-action-panel-actions__right-container--42xWx"};const a=s},2004:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-backdrop--GJj2y{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--GJj2y.story-backdrop_hidden--5wQBM{opacity:0;pointer-events:none}",""]),s.locals={"story-backdrop":"story-backdrop--GJj2y","story-backdrop_hidden":"story-backdrop_hidden--5wQBM"};const a=s},3910:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-controls--o\\+caP{display:flex;margin-top:8px}.story-controls--o\\+caP[dir=rtl] .story-controls__item--j-0y2:first-child{margin-right:auto;margin-left:0px}.story-controls--o\\+caP .story-controls__item--j-0y2{transition:opacity 300ms;color:#fff;width:32px;height:32px}.story-controls--o\\+caP .story-controls__item--j-0y2:first-child{margin-left:auto}.story-controls--o\\+caP .story-controls__item--j-0y2.story-controls__item_hidden--WolYE{opacity:0;pointer-events:none}.story-controls--o\\+caP .story-controls__item--j-0y2.story-controls__item_hidden--WolYE .story-controls__btn--lH4Zf{pointer-events:none}.story-controls--o\\+caP .story-controls__item--j-0y2 .story-controls__btn_close--qhu7Q{color:#fff}.story-controls--o\\+caP .story-controls__btn-group--LPXr\\+{position:relative}.story-controls--o\\+caP .story-controls__btn-group--LPXr\\+ .story-controls__btn--lH4Zf{position:absolute;left:0;right:0;bottom:0;top:0}.story-controls--o\\+caP .story-controls__btn--lH4Zf{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--o\\+caP .story-controls__btn--lH4Zf svg{overflow:visible}.story-controls--o\\+caP .story-controls__btn--lH4Zf:focus{outline:none}.story-controls--o\\+caP .story-controls__btn--lH4Zf.story-controls__btn_hidden--Ha9Wb{visibility:hidden;pointer-events:none}.story-controls--o\\+caP .story-controls__btn--lH4Zf:active{opacity:.5}",""]),s.locals={"story-controls":"story-controls--o+caP","story-controls__item":"story-controls__item--j-0y2","story-controls__item_hidden":"story-controls__item_hidden--WolYE","story-controls__btn":"story-controls__btn--lH4Zf","story-controls__btn_close":"story-controls__btn_close--qhu7Q","story-controls__btn-group":"story-controls__btn-group--LPXr+","story-controls__btn_hidden":"story-controls__btn_hidden--Ha9Wb"};const a=s},114:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-timeline--yRzu8{pointer-events:none;transition:opacity 300ms}.story-timeline--yRzu8.story-timeline_hidden--kN6xa{opacity:0}.story-timeline--yRzu8.story-timeline_desktop--kp5kU{border-top-left-radius:5px;border-top-right-radius:5px}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD{height:3px;display:flex}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick--MsXyM{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--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick--MsXyM:first-child{margin-left:0}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick--MsXyM:last-child{margin-right:0}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick-progress--Egbx3{width:100%;height:3px}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick-progress--Egbx3.story-timeline-ticks__tick-progress_active--gTb73{background-color:var(--story-timeline-tick-foreground, rgb(255, 255, 255))}.story-timeline--yRzu8 .story-timeline-ticks--9dhcD .story-timeline-ticks__tick-progress-loader--FFxdT{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--yRzu8[dir=rtl] .story-timeline-ticks__tick-progress-loader--FFxdT{background:linear-gradient(to left, var(--story-timeline-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}",""]),s.locals={"story-timeline":"story-timeline--yRzu8","story-timeline_hidden":"story-timeline_hidden--kN6xa","story-timeline_desktop":"story-timeline_desktop--kp5kU","story-timeline-ticks":"story-timeline-ticks--9dhcD","story-timeline-ticks__tick":"story-timeline-ticks__tick--MsXyM","story-timeline-ticks__tick-progress":"story-timeline-ticks__tick-progress--Egbx3","story-timeline-ticks__tick-progress_active":"story-timeline-ticks__tick-progress_active--gTb73","story-timeline-ticks__tick-progress-loader":"story-timeline-ticks__tick-progress-loader--FFxdT"};const a=s},2208:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story-header--oupRd{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%)}",""]),s.locals={"story-header":"story-header--oupRd"};const a=s},2621:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".goods-card--5040g{width:100px}.goods-card--5040g:first-of-type{margin-left:.5rem}.goods-card--5040g:not(:last-child){margin-right:.5rem}.prices---l4yj{display:flex}.prices---l4yj>div:not(:last-child){margin-right:.5rem}.typography--jLFAP{text-decoration:none}.typography--old-price--6\\+BcT{text-decoration:line-through}.figure--jlOA4{margin:0;margin-bottom:.5rem;width:100px;height:100px}.figure--jlOA4>img{width:inherit;height:inherit;max-width:100%;border-radius:var(--figure-border-radius, 0px);background-color:var(--figure-background-color, #ffffff)}",""]),s.locals={"goods-card":"goods-card--5040g",prices:"prices---l4yj",typography:"typography--jLFAP","typography--old-price":"typography--old-price--6+BcT",figure:"figure--jlOA4"};const a=s},2561:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".scrolling-carousel--nu2WS{position:relative}.scrolling-carousel__wrapper--SGlfg{position:relative;overflow:hidden}.scrolling-carousel__item--M-Msq{display:flex;flex-wrap:nowrap;cursor:pointer}.scrolling-carousel__arrow-button--a3YI7{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--a3YI7>svg{position:absolute;left:0;right:0;bottom:0;top:0;margin:auto;width:24px;height:24px;fill:#757575}.scrolling-carousel__arrow-button--a3YI7:hover svg{fill:#000}.scrolling-carousel__arrow-button--show--Nu83N{opacity:.9}.scrolling-carousel__arrow-button--show--Nu83N:hover{opacity:1}.scrolling-carousel__arrow-button--right---xKPn{right:-18px}.scrolling-carousel__arrow-button--left--453US{left:-18px}@media(pointer: coarse){.scrolling-carousel__arrow-button--a3YI7{display:none !important}}",""]),s.locals={"scrolling-carousel":"scrolling-carousel--nu2WS","scrolling-carousel__wrapper":"scrolling-carousel__wrapper--SGlfg","scrolling-carousel__item":"scrolling-carousel__item--M-Msq","scrolling-carousel__arrow-button":"scrolling-carousel__arrow-button--a3YI7","scrolling-carousel__arrow-button--show":"scrolling-carousel__arrow-button--show--Nu83N","scrolling-carousel__arrow-button--right":"scrolling-carousel__arrow-button--right---xKPn","scrolling-carousel__arrow-button--left":"scrolling-carousel__arrow-button--left--453US"};const a=s},4354:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".btn---B67E{margin:auto auto 10px;padding:10px;cursor:pointer}",""]),s.locals={btn:"btn---B67E"};const a=s},9406:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,"@keyframes spin--YtdKR{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner--48-vq{position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);width:2rem;height:2rem;border-radius:50%;animation:spin--YtdKR .6s infinite linear;border:var(--border, 2px solid transparent);border-color:var(--border-color, black)}",""]),s.locals={spinner:"spinner--48-vq",spin:"spin--YtdKR"};const a=s},777:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,"@keyframes fadeInFrames--0uqdv{from{opacity:0}to{opacity:1}}@keyframes fadeOutFrames--3PQLg{from{opacity:1}to{opacity:0}}.goods-container--MT\\+5Y{position:relative;margin-left:auto;margin-right:auto;display:flex;flex-direction:column;width:100%;height:100%;margin-top:0px}.goods-container--visible--y9Nx3{animation:300ms fadeInFrames--0uqdv}.goods-container--hidden--If8dQ{animation:300ms normal forwards fadeOutFrames--3PQLg}.goods-container__backdrop--SXjmA{flex:1}.goods-list--ZcxDv{position:relative;display:flex;flex-direction:column}",""]),s.locals={"goods-container":"goods-container--MT+5Y","goods-container--visible":"goods-container--visible--y9Nx3",fadeInFrames:"fadeInFrames--0uqdv","goods-container--hidden":"goods-container--hidden--If8dQ",fadeOutFrames:"fadeOutFrames--3PQLg","goods-container__backdrop":"goods-container__backdrop--SXjmA","goods-list":"goods-list--ZcxDv"};const a=s},9111:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".goods-widget-viewer--2A4k5{position:absolute;inset:0;z-index:30000;text-align:left}",""]),s.locals={"goods-widget-viewer":"goods-widget-viewer--2A4k5"};const a=s},7656:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.wrapper--hW4mo{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--hW4mo .backdrop--VWvJ3{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--kVKoX{position:absolute;z-index:2;user-select:none;display:flex;flex-direction:column;text-rendering:geometricprecision;overflow:hidden}.main--kVKoX .question--IvWQJ{width:100%;height:auto}.main--kVKoX .question--IvWQJ:empty{display:none}.main--kVKoX .input-group--V1Lqf{display:flex}.main--kVKoX .input-group--V1Lqf .input--dzYD8{width:100%}.main--kVKoX .input-group--V1Lqf .input-group__prepend--E2xPb{display:flex;flex:.35}.main--kVKoX .input-group--V1Lqf .input-group__separator--dAJF6{border-right:1px solid #fff;margin-right:.5rem}.main--kVKoX .input-group--V1Lqf .input--dzYD8{flex:1}.main--kVKoX .input-wrapper--r5RhN{overflow:hidden;box-sizing:content-box;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.main--kVKoX .input-wrapper--r5RhN .input--dzYD8{background:none;-webkit-tap-highlight-color:rgba(0,0,0,0);text-rendering:inherit;outline:none;border:none}.main--kVKoX .input-wrapper--r5RhN .input--dzYD8::placeholder{color:inherit}.main--kVKoX .input-wrapper--r5RhN .input--dzYD8.input_centered--kyst8{text-align:center}.main--kVKoX .input-wrapper--r5RhN.is-invalid--2-kEN{border-color:#dc3545 !important;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.textarea-grow-wrap--oBqzJ{display:grid;max-width:100%;word-break:break-all}.textarea-grow-wrap--oBqzJ::after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.textarea-grow-wrap--oBqzJ>.input--dzYD8{resize:none;overflow:hidden}.textarea-grow-wrap--oBqzJ>.input--dzYD8,.textarea-grow-wrap--oBqzJ::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--HAPuq{width:100%}.button-wrapper--HAPuq .button--1IhPK{width:100%;cursor:pointer}.button-wrapper--HAPuq .button--1IhPK:disabled,.button-wrapper--HAPuq .button--1IhPK[disabled=true]{cursor:not-allowed;pointer-events:none;background-color:#272727 !important}@keyframes fadeIn--g0ZtR{from{opacity:0}to{opacity:1}}@keyframes fadeOut--rWg9E{from{opacity:1}to{opacity:0}}.fadeIn--g0ZtR{animation:fadeIn--g0ZtR 300ms forwards}.fadeOut--rWg9E{animation:fadeOut--rWg9E 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}',""]),s.locals={wrapper:"wrapper--hW4mo",backdrop:"backdrop--VWvJ3",main:"main--kVKoX",question:"question--IvWQJ","input-group":"input-group--V1Lqf",input:"input--dzYD8","input-group__prepend":"input-group__prepend--E2xPb","input-group__separator":"input-group__separator--dAJF6","input-wrapper":"input-wrapper--r5RhN",input_centered:"input_centered--kyst8","is-invalid":"is-invalid--2-kEN","textarea-grow-wrap":"textarea-grow-wrap--oBqzJ","button-wrapper":"button-wrapper--HAPuq",button:"button--1IhPK",fadeIn:"fadeIn--g0ZtR",fadeOut:"fadeOut--rWg9E"};const a=s},6349:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".story--ieMN1{height:100%;width:100%;overflow:hidden;position:relative;border-radius:var(--slide-border-radius, 0)}.story--ieMN1.story_mobile--ugLFZ{border-radius:0}.story--ieMN1.story_mobile--ugLFZ .story-slides--Ekd4b{border-radius:var(--slide-border-radius, 0)}.story--ieMN1 .story-slides--Ekd4b{position:absolute;overflow:hidden;top:0;left:0;bottom:0;right:0}",""]),s.locals={story:"story--ieMN1",story_mobile:"story_mobile--ugLFZ","story-slides":"story-slides--Ekd4b"};const a=s},8790:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".close-btn-wrapper--erNQ2{transition:opacity 300ms;width:100%;height:100%;color:#c2c2c4}.close-btn-wrapper--erNQ2.close-btn-wrapper_hidden--E1VC0{opacity:0}.close-btn-wrapper--erNQ2.close-btn-wrapper_hidden--E1VC0 .close-btn--Wu8Wn{pointer-events:none}.close-btn--Wu8Wn{border:0;padding:0;background:rgba(0,0,0,0);pointer-events:all;cursor:pointer;outline:none;color:inherit;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.close-btn--Wu8Wn:focus{outline:none}.close-btn--Wu8Wn svg{overflow:visible;width:100%;height:100%}.close-btn--Wu8Wn:active{opacity:.5}",""]),s.locals={"close-btn-wrapper":"close-btn-wrapper--erNQ2","close-btn-wrapper_hidden":"close-btn-wrapper_hidden--E1VC0","close-btn":"close-btn--Wu8Wn"};const a=s},5479:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".loader--O0iuj{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--O0iuj .loader__refresh-btn--RtExV{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--O0iuj .loader__spinner--cKqH0{-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--7I4aU .6s infinite linear;animation:loading-spinner--7I4aU .6s infinite linear}@keyframes loading-spinner--7I4aU{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}",""]),s.locals={loader:"loader--O0iuj","loader__refresh-btn":"loader__refresh-btn--RtExV",loader__spinner:"loader__spinner--cKqH0","loading-spinner":"loading-spinner--7I4aU"};const a=s},3639:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.screen-orientation-lock--4vxfS{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("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTc2MiIgaGVpZ2h0PSI4MjkiIHZpZXdCb3g9IjAgMCAxNzYyIDgyOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxyZWN0IHdpZHRoPSIxNzYyIiBoZWlnaHQ9IjgyOSIgZmlsbD0iIzIxMjEyMSIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02NjYgNTQ5QzY2MS41ODIgNTQ5IDY1OCA1NDUuNDE4IDY1OCA1NDFMNjU4IDM0OUM2NTggMzQ0LjU4MiA2NjEuNTgyIDM0MSA2NjYgMzQxTDk5NCAzNDFDOTk4LjQxOCAzNDEgMTAwMiAzNDQuNTgyIDEwMDIgMzQ5TDEwMDIgNTQxQzEwMDIgNTQ1LjQxOCA5OTguNDE4IDU0OSA5OTQgNTQ5TDY2NiA1NDlaTTY2OCA1NDFMOTYyIDU0MUw5NjIgMzQ5TDY2OCAzNDlMNjY4IDU0MVoiIGZpbGw9IiMzRjNGM0YiLz4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAwIDIxNEM5MDAgMjA5LjU4MiA5MDMuNTgyIDIwNiA5MDggMjA2SDExMDBDMTEwNC40MiAyMDYgMTEwOCAyMDkuNTgyIDExMDggMjE0VjU0MkMxMTA4IDU0Ni40MTggMTEwNC40MiA1NTAgMTEwMCA1NTBIOTA4QzkwMy41ODIgNTUwIDkwMCA1NDYuNDE4IDkwMCA1NDJWMjE0Wk05MDggMjE2VjUxMEgxMTAwVjIxNkg5MDhaIiBmaWxsPSJ3aGl0ZSIvPg0KPHBhdGggZD0iTTgwMy41IDIxNkM3NTggMjIwLjUgNzEzLjUgMjU3IDcxNyAzMTcuNUM3MjEgMjc4IDc1OCAyMzcuNSA4MDMuNSAyNDIuNVYyNjRMODQ1LjUgMjI5TDgwMy41IDE5NS41VjIxNloiIGZpbGw9IndoaXRlIi8+DQo8L3N2Zz4=")}',""]),s.locals={"screen-orientation-lock":"screen-orientation-lock--4vxfS"};const a=s},7231:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".share-panel__body_screenshot--\\+-VL3{display:flex;flex-direction:column}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI{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--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw{margin-right:5px;position:relative;width:30px;height:30px;flex-shrink:0}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw .btn-copy__icon-state--z3FDw{position:absolute;inset:0px;opacity:0;transition:opacity 300ms ease-in-out}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw .btn-copy__icon-state--z3FDw.btn-copy__icon-state_default--4floY{opacity:1;visibility:visible}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__icon--m0BAw .btn-copy__icon-state--z3FDw.btn-copy__icon-state_done--5-sAA{opacity:1;visibility:visible}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI .btn-copy__text--XSGAj{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:5px}.share-panel__body_screenshot--\\+-VL3 .btn--W446A.btn-copy--fjKgI:active{transform:scale(0.96)}.share-panel__body_screenshot--\\+-VL3 .share-panel-row--7dNdh{justify-content:center;height:auto;padding:16px}.share-panel__body_screenshot--\\+-VL3 .share-panel-row--7dNdh:first-child{height:450px;box-sizing:border-box}.share-panel__body_screenshot--\\+-VL3 .share-panel-row__image-link--Islxp{width:100%;height:100%;display:flex;justify-content:center}.share-panel__body_screenshot--\\+-VL3 .share-panel-row__image--fk\\+wi{max-width:100%;height:100%;object-fit:cover;border-radius:20px}.share-panel__body_screenshot--\\+-VL3 .share-item__download-button--gMuRx{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--\\+-VL3 .share-item__download-button--gMuRx:active{transform:scale(0.96)}",""]),s.locals={"share-panel__body_screenshot":"share-panel__body_screenshot--+-VL3",btn:"btn--W446A","btn-copy":"btn-copy--fjKgI","btn-copy__icon":"btn-copy__icon--m0BAw","btn-copy__icon-state":"btn-copy__icon-state--z3FDw","btn-copy__icon-state_default":"btn-copy__icon-state_default--4floY","btn-copy__icon-state_done":"btn-copy__icon-state_done--5-sAA","btn-copy__text":"btn-copy__text--XSGAj","share-panel-row":"share-panel-row--7dNdh","share-panel-row__image-link":"share-panel-row__image-link--Islxp","share-panel-row__image":"share-panel-row__image--fk+wi","share-item__download-button":"share-item__download-button--gMuRx"};const a=s},9749:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".share-item--8FmHt{color:#fff}a.share-item--8FmHt{color:#fff;transition:none}a.share-item--8FmHt:hover{color:#fff}.social-list--5g9js{flex-wrap:wrap;height:auto;padding-bottom:1rem}.social-list--5g9js .social-list__item--UG-g9{margin-top:1rem}",""]),s.locals={"share-item":"share-item--8FmHt","social-list":"social-list--5g9js","social-list__item":"social-list__item--UG-g9"};const a=s},5839:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,'.share-panel-wrapper--dn9M6{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--dn9M6 .share-panel-backdrop--MgwuI{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5)}.share-panel--yVlOc{position:absolute;top:auto;left:0;right:0;bottom:0;z-index:2;user-select:none}.share-panel-row--deDQ6{width:100%;height:150px;display:flex;flex-direction:row;align-items:center}.share-panel-row--deDQ6 .share-item--dKU92{cursor:pointer;flex:0 0 auto;width:69px;height:90px;margin:0 10px;display:flex;flex-direction:column;align-items:center;text-align:center}.share-panel-row--deDQ6 .share-item--dKU92:first-child{margin-left:20px}.share-panel-row--deDQ6 .share-item--dKU92:last-child{margin-right:20px}.share-panel-row--deDQ6 .share-item--dKU92,.share-panel-row--deDQ6 .share-item--dKU92:visited,.share-panel-row--deDQ6 .share-item--dKU92:active,.share-panel-row--deDQ6 .share-item--dKU92:focus{text-decoration:none}.share-panel-row--deDQ6 .share-item--dKU92 .share-item-title--DzDoA{margin-top:20px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:.2rem}.share-panel-row--deDQ6.title-row--\\+CIE7{height:120px;padding-top:30px;padding-bottom:30px;padding-left:20px;padding-right:20px}.share-panel-row--deDQ6.title-row--\\+CIE7 .share-url-favicon--lcC7\\+{width:60px;height:60px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.share-panel-row--deDQ6.title-row--\\+CIE7 .share-url-favicon--lcC7\\+ img{width:30px;height:30px}.share-panel-row--deDQ6.title-row--\\+CIE7 .title--vZjLV{font-size:16px;line-height:1.4rem;margin-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.share-panel-row--deDQ6.title-row--\\+CIE7 .title--vZjLV[dir=rtl]{margin-left:0px;margin-right:15px}.share-panel-separator--iqGC0{width:100%;height:1px}.share-panel--yVlOc{will-change:transform;transition:transform 300ms}.share-panel__body--Jik8H{width:100%;height:100%}@keyframes slideIn--EfZ6a{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slideOut--1goeU{from{transform:translateY(0%)}to{transform:translateY(100%)}}@keyframes fadeIn--ebk1h{from{opacity:0}to{opacity:1}}@keyframes fadeOut--5l1DQ{from{opacity:1}to{opacity:0}}.fadeIn--ebk1h{animation:fadeIn--ebk1h 300ms forwards}.fadeOut--5l1DQ{animation:fadeOut--5l1DQ 300ms forwards}.slideIn--EfZ6a{animation:slideIn--EfZ6a 300ms forwards}.slideOut--1goeU{animation:slideOut--1goeU 300ms forwards}',""]),s.locals={"share-panel-wrapper":"share-panel-wrapper--dn9M6","share-panel-backdrop":"share-panel-backdrop--MgwuI","share-panel":"share-panel--yVlOc","share-panel-row":"share-panel-row--deDQ6","share-item":"share-item--dKU92","share-item-title":"share-item-title--DzDoA","title-row":"title-row--+CIE7","share-url-favicon":"share-url-favicon--lcC7+",title:"title--vZjLV","share-panel-separator":"share-panel-separator--iqGC0","share-panel__body":"share-panel__body--Jik8H",fadeIn:"fadeIn--ebk1h",fadeOut:"fadeOut--5l1DQ",slideIn:"slideIn--EfZ6a",slideOut:"slideOut--1goeU"};const a=s},4456:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(935),s=r.n(i)()((function(e){return e[1]}));s.push([e.id,".icon--6cPm7{width:2rem;height:2rem}",""]),s.locals={icon:"icon--6cPm7"};const a=s},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,i){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(i)for(var a=0;a<this.length;a++){var o=this[a][0];null!=o&&(s[o]=!0)}for(var n=0;n<e.length;n++){var l=[].concat(e[n]);i&&s[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},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,t,r)=>{"use strict";var i,s=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},a=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),o=[];function n(e){for(var t=-1,r=0;r<o.length;r++)if(o[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},i=[],s=0;s<e.length;s++){var a=e[s],l=t.base?a[0]+t.base:a[0],c=r[l]||0,d="".concat(l," ").concat(c);r[l]=c+1;var h=n(d),u={css:a[1],media:a[2],sourceMap:a[3]};-1!==h?(o[h].references++,o[h].updater(u)):o.push({identifier:d,updater:m(u,t),references:1}),i.push(d)}return i}function c(e){var t=document.createElement("style"),i=e.attributes||{};if(void 0===i.nonce){var s=r.nc;s&&(i.nonce=s)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var o=a(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var d,h=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function u(e,t,r,i){var s=r?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=h(t,s);else{var a=document.createTextNode(s),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function p(e,t,r){var i=r.css,s=r.media,a=r.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var g=null,f=0;function m(e,t){var r,i,s;if(t.singleton){var a=f++;r=g||(g=c(t)),i=u.bind(null,r,a,!1),s=u.bind(null,r,a,!0)}else r=c(t),i=p.bind(null,r,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<r.length;i++){var s=n(r[i]);o[s].references--}for(var a=l(e,t),c=0;c<r.length;c++){var d=n(r[c]);0===o[d].references&&(o[d].updater(),o.splice(d,1))}r=a}}}},5016:(e,t,r)=>{"use strict";const i=document.querySelector("[nonce]");i&&(r.nc=i.nonce||i.getAttribute("nonce")),window.litNonce=r.nc},5136:e=>{"use strict";e.exports=h},6166:e=>{"use strict";e.exports=u},122:e=>{"use strict";e.exports=o},992:e=>{"use strict";e.exports=b},405:e=>{"use strict";e.exports=y},5714:e=>{"use strict";e.exports=c},7161:e=>{"use strict";e.exports=_},429:e=>{"use strict";e.exports=O},5125:e=>{"use strict";e.exports=C},318:e=>{"use strict";e.exports=k},6968:e=>{"use strict";e.exports=P},2083:e=>{"use strict";e.exports=x},7326:e=>{"use strict";e.exports=d},4977:e=>{"use strict";e.exports=l},56:e=>{"use strict";e.exports=p},6099:e=>{"use strict";e.exports=n},2883:t=>{"use strict";t.exports=e},8386:e=>{"use strict";e.exports=i},7144:e=>{"use strict";e.exports=g},9498:e=>{"use strict";e.exports=r},5824:e=>{"use strict";e.exports=a},5314:e=>{"use strict";e.exports=s},5299:e=>{"use strict";e.exports=w},9780:e=>{"use strict";e.exports=v},9155:e=>{"use strict";e.exports=m},9514:e=>{"use strict";e.exports=S},5272:e=>{"use strict";e.exports=f},7315:e=>{"use strict";e.exports=t}},E={};function I(e){var t=E[e];if(void 0!==t)return t.exports;var r=E[e]={id:e,exports:{}};return j[e](r,r.exports,I),r.exports}I.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return I.d(t,{a:t}),t},I.d=(e,t)=>{for(var r in t)I.o(t,r)&&!I.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},I.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),I.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},I.nc=void 0;var M={};return(()=>{"use strict";I.r(M),I.d(M,{AppearanceManager:()=>ol,AppearanceManagerEvents:()=>al,CloseButtonPosition:()=>It,FavoriteStoryList:()=>Pp,GoodsWidgetRenderingType:()=>At,IASContainer:()=>Ju,IamCheckDisplayTimeRangeError:()=>za,IamFrequencyLimitError:()=>Wa,IamMessageLimitExceededError:()=>$a,IamMessageOpenError:()=>fo,IamNotFoundByEventError:()=>hn,IamNotFoundByIdError:()=>le,IamNotFoundLimitError:()=>ce,IamOtherReaderIsOpenError:()=>Va,IamShowOnlyIfLoadedError:()=>Ga,IasNetworkError:()=>c,StackFeedStory:()=>To,StackedStoryListViewModel:()=>Do,StoriesListCardCoverQuality:()=>ct,StoriesListCardTitlePosition:()=>lt,StoriesListCardTitleTextAlign:()=>nt,StoriesListCardViewVariant:()=>ot,StoriesListDirection:()=>dt,StoryFeedType:()=>Fe,StoryList:()=>kp,StoryManager:()=>dn,StoryReaderSwipeStyle:()=>Ft,UGCFeedSlug:()=>Qe,UGCStoryList:()=>Cp,__IAS_INTERNAL_API__:()=>tl,storyManager:()=>rl,useIASContainer:()=>ep});I(5016);var e=I(46),t=I.n(e),r=I(2883),i=I.n(r);class s extends e.EventEmitter{}var a=I(7315);function o(e){return e.replace(/^\//,"")}function n(e){return e.replace(/\/$/,"")}function l(e,t,r){t instanceof Object&&Object.keys(t).forEach((i=>{const s=t[i];if(s instanceof Object&&!Array.isArray(s))return l(e,s,i);r&&(i=`${r}[${i}]`),Array.isArray(s)?s.forEach((t=>{e.append(`${i}[]`,t)})):e.append(i,s)}))}class c extends Error{constructor(e,t,r){super(),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,console.error({name:this.name,networkStatus:e,networkMessage:t,response:r})}static createByRequestError(e){return new c(null,JSON.stringify(e.data),e)}static createByFetchError(e){const t=window.navigator&&window.navigator.onLine;return new c(null,t?e.message:"net::ERR_INTERNET_DISCONNECTED")}}var d=I(9498),h=I.n(d),u=I(8386),p=I.n(u);function g(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}let f;function m(){let e,t;/ipad|iphone/i.test(navigator.userAgent)?(e=document.createRange(),f&&e.selectNodeContents(f),t=window.getSelection(),t&&(t.removeAllRanges(),t.addRange(e)),f&&f.setSelectionRange(0,999999)):null==f||f.select()}const y=e=>{!function(e){f=document.createElement("textarea"),f.value=e,document.body.appendChild(f)}(e),m(),document.execCommand("copy"),f&&document.body.removeChild(f)};let v;v=function(){};var b=I(5314);function w(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 b.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 S(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 _(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}}}const O=/[\r\n%#()<>?[\\\]^`{|}]/g;function x(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(O,encodeURIComponent)}const k=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}))},C=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)},P=()=>null!==I.nc&&void 0!==I.nc?I.nc:"",j=!!(()=>{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 E=I(5824),T=I.n(E);const L=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();function A(e){let t=null;if(L){let r=window.localStorage.getItem(e);null!==r&&T()(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}function R(e,t){L&&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",P()),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 V(){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:G.LANDSCAPE_PRIMARY,"-90":G.LANDSCAPE_SECONDARY,0:G.PORTRAIT_PRIMARY,180:G.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:Z(e),event:"change"}}(r);return t.prototype.addEventListener=W("addEventListener",i.delegate,i.event),t.prototype.dispatchEvent=W("dispatchEvent",i.delegate,i.event),t.prototype.removeEventListener=W("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 G;function W(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?z[r]=t:($.push(e),z.push(t))}(s[1],n),"removeEventListener"===e&&(a=s[1],(o=$.indexOf(a))>-1&&($.splice(o,1),z.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"}(G||(G={}));var z=[],$=[];function H(e,t){var r=$.indexOf(e);return r>-1?z[r]:function(r){r.target!==t&&Q(r,"target",t),r.currentTarget!==t&&Q(r,"currentTarget",t),"change"!==r.type&&Q(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 Z(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 Q(e,t,r){Object.defineProperty(e,t,{value:r})}function Y(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}var X=I(122);const J="mobile"!==I.n(X)().getParser(window.navigator.userAgent).parse().getPlatformType();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=A("device_data");if(this.isValidDeviceData(e))return e;const t={platform:"web",device_id:(0,a.v4)()};return R("device_data",t),t}isValidDeviceData(e){return Boolean(e&&"string"==typeof e.device_id&&36===e.device_id.trim().length)}};function te(e,t){return Object.assign(Object.assign({},e),t)}class re{constructor(e){var t;Object.defineProperty(this,"_baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_deviceInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_baseHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"requestInterceptors",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"interceptors",{enumerable:!0,configurable:!0,writable:!0,value:{request:{use:e=>{this.requestInterceptors.push(e)}}}}),this._baseURL=null!==(t=null==e?void 0:e.baseURL)&&void 0!==t?t:""}set deviceInfoPromise(e){this._deviceInfoPromise=e}set baseHeaders(e){this._baseHeaders=e}get baseURL(){return this._baseURL}set baseURL(e){this._baseURL=e}async request(e){return new Promise(((t,r)=>{const i=async()=>{try{if(h()(e.headers)&&null!=e.headers||(e.headers={}),e.headers=te(this._baseHeaders,e.headers),this.requestInterceptors.length)for(const t of this.requestInterceptors)t(e);let i="";!p()(e.params)&&h()(e.params)&&(i=new URLSearchParams(Object.entries(e.params).filter((([e,t])=>null!=t&&""!==t))).toString());let s=new URL(`${o(e.url)}${i?"?"+i:""}`,this._baseURL),a="GET";p()(e.method)||(a=e.method.toUpperCase());let n={};!p()(e.headers)&&h()(e.headers)&&(n=e.headers);let l=null;!p()(e.data)&&h()(e.data)&&(l=JSON.stringify(e.data),n["Content-Type"]="application/json");const d=await fetch(s.toString(),{method:a,body:"GET"===a||"HEAD"===a?null:l,headers:n,credentials:"omit"});let u={};204!==d.status&&(u=await d.json());const g={data:u,headersRaw:d.headers,headers:Object.fromEntries([...d.headers]),status:d.status,statusText:d.statusText,ok:d.ok};if(!d.ok)return void r(c.createByRequestError(g));t(g)}catch(e){r(c.createByFetchError(e))}};this._deviceInfoPromise?this._deviceInfoPromise.finally(i):i()}))}async post(e,t,r={}){return this.request({method:"post",url:e,data:t,params:r})}async get(e,t={}){return this.request({method:"get",url:e,params:t})}}const ie=new re;function se(e,t){return new Promise((r=>{if("sendBeacon"in navigator){const i=el.rootStore.sessionStore.session,s=new URLSearchParams({access_token:el.config.apiKey,session_id:(null==i?void 0:i.id)||"",x_user_agent:el.userAgent}),a=el.config;null!=a.appPackageId&&s.append("x_app_package_id",a.appPackageId);const c=`${n(ie.baseURL)}/${o(e)}?${s.toString()}`,d=new FormData;Object.keys(t).forEach((e=>{l(d,t[e],e)}));let h=!1;null!=Array.from&&null!=d.keys&&(h=0===Array.from(d.keys()).length),h||navigator.sendBeacon(c,d),r()}else ie.post(e,t).then((()=>r()),(()=>r()))}))}ie.interceptors.request.use((e=>{var t;const r=el.config,i=el.rootStore.sessionStore.session,s=null==i?void 0:i.id;return e.headers=te(null!==(t=e.headers)&&void 0!==t?t:{},{Authorization:`Bearer ${r.apiKey}`,"Accept-Language":r.lang.toString(),"X-Request-Id":(0,a.v4)(),"X-User-Agent":el.userAgent}),r.userId&&(e.headers["X-User-Id"]=r.userId),s&&(e.headers["Auth-Session-Id"]=s),null!=r.appPackageId&&(e.headers["X-App-Package-Id"]=r.appPackageId),r.disableDeviceId||(e.headers["X-Device-Id"]=ee.deviceId),e}));const ae=ie,oe={baseUrl:"https://cdn.inappstory.ru",apiUrl:"https://api.inappstory.ru",faviconApiUrl:"https://favicon.inappstory.ru"};function ne(e){if(e.length>32)try{const t=function(e){const t=(e=e.replace(new RegExp("-","g"),"+").replace(new RegExp("_","g"),"/")).length;return e=function(e,t,r){return void 0===t?e:t.length>=e.length?t:r?(e+t).slice(-e.length):(t+e).substring(0,e.length)}(new Array(t%4).fill("=").join(""),e,!1),window.atob(e)}(e),r=t.charCodeAt(13);if(r>0){let e=t.substr(14,r);e=e.replace(/\0+$/,"");const i="{QQN{xuV?1Dv16j3";let s=i,a=0;for(;s.length<r;)s+=i[a],a++,a===i.length&&(a=0);let o="";for(let t=0;t<r;t++)o+=String.fromCharCode(e.charCodeAt(t)^s.charCodeAt(t));return new URL(`https://${o}`).host}}catch(e){console.error(e)}return null}class le extends Error{constructor(e){super(`[IAM]: not found IAM for ID <${e}>`),this.name="IamNotFoundByIdError"}}class ce extends Error{constructor(e){super(`[IAM]: not found IAM limit for ID <${e}>`),this.name="IamNotFoundLimitError"}}var de=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},he=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 ue="campaign_name,id,events,appearance,slides_html,type,frequency_limit,display_to,display_from,need_placeholders,has_limit",pe=ue.split(",").map((e=>`messages.${e}`)).join(",");let ge=(()=>{var e;let t,r,i,s=[];return e=class{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(de(this,s),e)})}async fetchAll({tags:e}){return(await ae.get("inappmessaging",{fields:pe,tag:e.join(",")})).data.messages}async fetchContext(){return(await ae.get("inappmessaging/message-context",{fields:"style,widgetsData"})).data}async fetchById(e){const t=(await ae.get(`inappmessaging/message/${e}`,{expand:"slides_html",fields:ue})).data;if(!t)throw new le(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 ae.post(`/inappmessaging/message/${e}/event/${t.type}`,{},t.toQueryParams())}catch(e){console.error(e)}}async fetchUserData(e){try{return(await ae.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 ae.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 ae.post("inappmessaging/message-limit",{id:[e]})).data.find((t=>t.messageId.toString()===e.toString()));if(!t)throw new ce(e);return t}},(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[S],r=[S],i=[S],he(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),he(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),he(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 fe{constructor(e){Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.background=this.mapBackgroundDtoToModel(e.background)}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}}class me extends fe{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 ye,ve;!function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(ye||(ye={})),function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(ve||(ve={}));class be extends fe{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:ye.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:ve.End,this.horizontalPadding=null!==(n=e.horizontal_padding)&&void 0!==n?n:16}}class we extends fe{constructor(e){var t,r;super(e),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:ye.None,this.closeBtnPosition=null!==(r=e.close_button_position)&&void 0!==r?r:ve.End}}class Se{create(e,t){switch(e){case Za.BottomSheet:return new me(t);case Za.Modal:return new be(t);case Za.Fullscreen:return new we(t)}}}var _e=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},Oe=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},xe=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)},ke=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 Ce=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _html(){return xe(this,t,"f")}set _html(e){ke(this,t,e,"f")}constructor(e){Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:(_e(this,s),e)}),t.set(this,_e(this,a,"")),_e(this,o),this.message=e}get html(){return this._html}updateByDto(e){this._html=this.getSlideHtml(e)}getSlideHtml(e){var t;let r=e;return r=Y(r,"{{nonce}}",null!==(t=P())&&void 0!==t?t:""),r}updatePlaceholders(e){let t=this._html;for(const r of e)t=Y(t,`%${r.key}%`,r.value);this._html=t}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],i=[b.computed],Oe(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),Oe(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 Pe{async open(e){const t=await this.getOpenSessionPayload(e);return(await ae.post("session/open",t,{expand:"cache",fields:"session,server_timestamp,user_key,share,preview_aspect_ratio,placeholders,image_placeholders,is_allow_ugc,is_allow_statistic_v2"})).data}async getOpenSessionPayload(e){const t=await U(),r={platform:ee.platform,device_id:ee.deviceId,features:["animation","data","deeplink","placeholder","resetTimers","gameReader","sendApi","swipeUpItems","imgPlaceholder","vod","closeStoryApi","slideTimerEndApi"].join(",")};return e.userId&&(r.user_id=e.userId,r.user_sign=e.userIdSign),t&&(r.features+=",webp"),r}}var je;!function(e){e.TEXT="text",e.IMAGE="image"}(je||(je={}));class Ee{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 Ie extends Ee{constructor(e,t){super(je.IMAGE,e,t,0)}}class Me extends Ee{constructor(e,t){super(je.TEXT,e,t,2)}}class Te extends Ee{constructor(e,t){super(je.IMAGE,e,t,1)}}class Le extends Ee{constructor(e,t){super(je.TEXT,e,t,3)}}const Ae="default";class Re{get textPlaceholders(){return this._textPlaceholders}get imagePlaceholders(){return this._imagePlaceholders}get fontsResources(){return this.resources.filter((e=>"font-face"===e.type))}constructor(e,t){Object.defineProperty(this,"sessionStore",{enumerable:!0,configurable:!0,writable:!0,value:e}),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}),this.id=t.session.id,this.expireIn=t.session.expire_in,this.userKey=t.user_key||Ae,this.previewAspectRatio=t.preview_aspect_ratio,this.share=t.share,this.resources=this.getResources(t),this._textPlaceholders=this.mapTextPlaceholders(t.placeholders),this._imagePlaceholders=this.mapImagePlaceholders(t.image_placeholders),this.isAllowStatisticV2=Boolean(t.is_allow_statistic_v2)}loadResources(){N(this.fontsResources)}getResources(e){return e.cache&&Array.isArray(e.cache)?e.cache:[]}mapTextPlaceholders(e){return e.map((e=>new Me(e.name,e.default_value)))}mapImagePlaceholders(e){return e.map((e=>new Ie(e.name,e.default_value)))}}class Be extends Error{constructor(e){super(`Story with ID ${e} has already been shown to the user`),this.name="IasStoryAlreadyShownError"}}class De extends Error{constructor(e){super(`Like undefined on story with ID ${e}`),this.name="IasLikeUndefinedError"}}class Ne extends Error{constructor(e){super(`Share url undefined on story with ID ${e}`),this.name="IasShareUrlUndefinedError"}}var Fe,Ue=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},Ge=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"}(Fe||(Fe={}));let ze=(()=>{var e,t;let r,i,s,a=[],o=[],n=[];return e=class{get _stories(){return Ge(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:Ue(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:Fe.DEFAULT}),t.set(this,Ue(this,o,b.observable.array())),Ue(this,n),this.id=e.id,this.slug=e.feedSlug,this.hasFavorite=Boolean(e.hasFavorite),this._cover=mt.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,b.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=[b.observable],i=[b.action],s=[b.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 He extends ze{constructor(e,t){super(e,t),this._type=Fe.FAVORITE}static createByStories(e){return new He({feedSlug:$e},e)}}var qe=I(6099),Ze=I.n(qe);class Ke extends ze{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=Fe.ONBOARDING,this.tags=r.tags,this.limit=r.limit,this.filterOpenedStories()}static getDefaultSlug(){return"onboarding"}isEqualParams(e){return Ze()(this.tags,e.tags)&&this.limit===e.limit}filterOpenedStories(){this._stories=this._stories.filter((e=>!e.isOpened))}}const Qe="{{__ugc__}}";class Ye extends ze{constructor(e,t,r={}){super(e,t),Object.defineProperty(this,"_filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._type=Fe.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 Ye({feedSlug:Qe},e,t)}}var Xe=I(1580),Je=I.n(Xe);class et{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===Fe.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===Fe.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,tags:e.tags,slidesCount:e.slidesCount};return t.type===Fe.UGC&&(r.ugcPayload=Je()(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 tt{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 ae.get(r,null!=i?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 ae.get(s,null!=a?a:{});if(204===o.status&&i)throw new Be(e.toString());return o.data}async fetchStoryContext({ids:e}){const{url:t,params:r}=this.getStoryContextRequestConfig(e);return(await ae.get(t,null!=r?r:{})).data}async fetchStoryCSS(){var e;const{url:t,params:r}=this.getStoryCSSRequestConfig();return null!==(e=(await ae.get(t,null!=r?r:{})).data.style)&&void 0!==e?e:""}async setStoryLike(e,t){if(this.storyManager.isStatisticsDisabled)return t;const r=await ae.post(`story-like/${e}`,{value:t});if(null==r.data.like)throw new De(e);return r.data.like}async setStoryBookmark(e,t){if(this.storyManager.isStatisticsDisabled)return t;return(await ae.post(`story-favorite/${e}`,{value:t})).data.favorite}markStoryAsOpened(e,t){const r=`u/${e}/s_opened`;let i=A(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 ae.get(`story-share/${e}`,{});if(!t.data.url)throw new Ne(e);return t.data.url}async updateNarrativeData(e,t){if(!this.storyManager.isStatisticsDisabled)return ae.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===Qe?"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 rt{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcFeed({filter:e,tags:t,testKey:r}){const i={tags:t.join(","),test:r,f:e&&JSON.stringify(e)};return(await ae.get("ugc/feed",null!=i?i:{})).data}async fetchDefaultFeed({feedSlug:e,tags:t,testKey:r}){const i=`feed/${e}`,s={tags:t.join(","),test:r},a=await ae.get(i,null!=s?s:{});return a.data.feedSlug=e,a.data}async fetchFavoriteFeed({tags:e}){const t={tags:e.join(","),favorite:1};return(await ae.get("story",null!=t?t:{})).data}async fetchOnboardingFeed(e){const t=`feed/${e.feedSlug}/onboarding`,r={tags:e.tags.join(","),limit:e.limit},i=await ae.get(t,null!=r?r:{});return i.data.feedSlug=e.feedSlug,i.data}}class it{async sendStatisticEvent(e){await se("session/update",{data:e.data})}}class st{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;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=`${n(oe.apiUrl)}/${o(e)}?${t.toString()}`;navigator.sendBeacon(r)}async sendFallbackFetch(e,t){const r=new re({baseURL:oe.apiUrl});await r.get(e,t)}}var at,ot,nt,lt,ct,dt,ht;!function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(at||(at={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(ot||(ot={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(nt||(nt={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(lt||(lt={})),function(e){e.Medium="medium",e.High="high"}(ct||(ct={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(dt||(dt={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(ht||(ht={}));const ut={direction:dt.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:nt.START,position:lt.CARD_INSIDE_BOTTOM,display:!0,lineClamp:4},gap:10,height:178,aspectRatio:null,coverQuality:ct.High,variant:ot.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:nt.START,position:lt.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:ct.High,coverLazyLoading:!1,variant:ot.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:at.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:nt.START,position:lt.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:ct.High,coverLazyLoading:!1,variant:ot.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 pt=I(4977),gt=I.n(pt);class ft{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 mt{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 mt;for(let r in e)e.hasOwnProperty(r)&&t.images.push(new ft(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=gt()(this.images))&&void 0!==r?r:null,t&&null!=i?i:null)}mapCoverQualityToImageType(e){switch(e){case ct.Medium:return"m";case ct.High:return"h"}}}var yt=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},vt=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},bt=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)},wt=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;let r,i,s=[],a=[],o=[];return e=class{get _html(){return bt(this,t,"f")}set _html(e){wt(this,t,e,"f")}get html(){return this._html}constructor(e){t.set(this,(yt(this,s),yt(this,a,""))),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:yt(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}),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._html=this.replaceSlideNonce(e.html)}static createEmpty(){return new e({index:0,timeline:{foreground:"",background:""},duration:0,screenshot_share:!1,html:""})}replaceSlideNonce(e){var t;return Y(e,"{{nonce}}",null!==(t=P())&&void 0!==t?t:"")}updatePlaceholders(e){let t=this._html;for(const r of e)t=Y(t,`%${r.key}%`,r.value);this._html=t}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],i=[b.computed],vt(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),vt(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 _t{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 Ot=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},xt=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},kt=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)},Ct=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 Pt=(()=>{var e,t,r,i,s,a,o,n,l,c;let d,h,u,p,g,f,m,y,v,w,S,_=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],M=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],F=[],U=[];return e=class{get _slidesLoaded(){return kt(this,t,"f")}set _slidesLoaded(e){Ct(this,t,e,"f")}get _error(){return kt(this,r,"f")}set _error(e){Ct(this,r,e,"f")}get _context(){return kt(this,i,"f")}set _context(e){Ct(this,i,e,"f")}get _like(){return kt(this,s,"f")}set _like(e){Ct(this,s,e,"f")}get _favorite(){return kt(this,a,"f")}set _favorite(e){Ct(this,a,e,"f")}get _shareUrl(){return kt(this,o,"f")}set _shareUrl(e){Ct(this,o,e,"f")}get _slides(){return kt(this,n,"f")}set _slides(e){Ct(this,n,e,"f")}get _isOpened(){return kt(this,l,"f")}set _isOpened(e){Ct(this,l,e,"f")}get _canBeShown(){return kt(this,c,"f")}set _canBeShown(e){Ct(this,c,e,"f")}constructor(e){var d,h,u,p,g,f,m,y,v,b,w,S,V,G,W,z,$,H,q,Z,K,Q,Y,X;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Ot(this,_)}),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,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),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,"_title",{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,Ot(this,O,!1)),r.set(this,(Ot(this,x),Ot(this,k,null))),i.set(this,(Ot(this,C),Ot(this,P,void 0))),s.set(this,(Ot(this,j),Ot(this,E,0))),a.set(this,(Ot(this,I),Ot(this,M,!1))),o.set(this,(Ot(this,T),Ot(this,L,null))),n.set(this,(Ot(this,A),Ot(this,R,[]))),l.set(this,(Ot(this,B),Ot(this,D,!1))),c.set(this,(Ot(this,N),Ot(this,F,!1))),Ot(this,U),this.id=e.id,this._context=new _t(this.id,{style:"",widgetsData:{}}),this._title=null!==(d=e.title)&&void 0!==d?d:"",this._isOpened=null!==(h=e.is_opened)&&void 0!==h&&h,this.statTitle=null!==(u=e.stat_title)&&void 0!==u?u:"",this.titleColor=null!==(p=e.title_color)&&void 0!==p?p:"",this.background=null!==(g=e.background)&&void 0!==g?g:{},this.backgroundColor=null!==(f=e.background_color)&&void 0!==f?f:"",this.slidesCount=null!==(m=e.slides_count)&&void 0!==m?m:0,this.disableClose=null!==(y=e.disable_close)&&void 0!==y&&y,this.hideInReader=null!==(v=e.hide_in_reader)&&void 0!==v&&v,this.likeFunctional=null!==(b=e.like_functional)&&void 0!==b&&b,this.favoriteFunctional=null!==(w=e.favorite_functional)&&void 0!==w&&w,this.shareFunctional=null!==(S=e.share_functional)&&void 0!==S&&S,this.needPlaceholders=null!==(V=e.need_placeholders)&&void 0!==V&&V,this.gameInstance=e.game_instance,this.hasAudio=null!==(G=e.has_audio)&&void 0!==G&&G,this.hasSwipeUp=null!==(W=e.has_swipe_up)&&void 0!==W&&W,this.stringId=null!==(z=e.string_id)&&void 0!==z?z:"",this.tags=null!==($=e.tags)&&void 0!==$?$:[],this._like=null!==(H=e.like)&&void 0!==H?H:0,this._favorite=null!==(q=e.favorite)&&void 0!==q&&q,this.deeplink=null!==(Z=e.deeplink)&&void 0!==Z?Z:"",this.hideTimeline=null!==(K=e.hide_timeline)&&void 0!==K&&K,this.ugcPayload=null!==(Q=e.payload)&&void 0!==Q?Q:{},this._shareUrl=null!==(Y=e.share_url)&&void 0!==Y?Y:null,this._image=mt.createByRawData(e.image),this._videoCover=mt.createByRawData(e.video_cover);const J=null!==(X=e.slides)&&void 0!==X?X:[];this.setSlides(J)}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}getImagesPerSlide(e){var t,r;return this.parseHtmlSlidesForMainImage(),null!==(r=null===(t=this._parsedSlideImage)||void 0===t?void 0:t[e])&&void 0!==r?r:null}parseHtmlSlidesForMainImage(){!this._parsedSlideImage&&this.slidesLoaded&&(this._parsedSlideImage=this._slides.map((e=>this.parseSlideNarrativeImageSrc(e.html)||this.parseSlideNarrativeVideoPosterSrc(e.html)||null)))}parseSlideNarrativeImageSrc(e){const t=e.match(/<[^<]*narrative-element-image.*<img[^<]*src="([^"]*)"[^<]*>/i);return null==t?void 0:t[1]}parseSlideNarrativeVideoPosterSrc(e){const t=e.match(/<[^<]*narrative-element-video.*<video[^<]*poster\-remote\-src="([^"]*)"[^<]*>/i);return null==t?void 0:t[1]}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}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._title;for(const r of e)t=Y(t,`%${r.key}%`,r.value);this._title=t}mapSlidesByDto(e){return e.map((e=>new St(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,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;d=[b.observable],h=[b.observable],u=[b.observable],p=[b.observable],g=[b.observable],f=[b.observable],m=[b.observable],y=[b.observable],v=[b.observable],w=[b.action],S=[b.action],xt(e,null,d,{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},O,x),xt(e,null,h,{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},k,C),xt(e,null,u,{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},P,j),xt(e,null,p,{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},E,I),xt(e,null,g,{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},M,T),xt(e,null,f,{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,A),xt(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},R,B),xt(e,null,y,{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,N),xt(e,null,v,{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},F,U),xt(e,null,w,{kind:"method",name:"setSlides",static:!1,private:!1,access:{has:e=>"setSlides"in e,get:e=>e.setSlides},metadata:t},null,_),xt(e,null,S,{kind:"method",name:"setCanBeShown",static:!1,private:!1,access:{has:e=>"setCanBeShown"in e,get:e=>e.setCanBeShown},metadata:t},null,_),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class jt{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 Et,It;!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"}(Et||(Et={}));class Mt extends jt{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"}(It||(It={}));const Tt={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:It.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},Lt={borderRadius:5,loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:Tt.forceDesktopMode,forceCheckOrientation:!0};var At;!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(At||(At={}));const Rt={goodsWidgetRenderingType:At.DEFAULT,goodsList:{renderingType:At.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 Bt;!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"}(Bt||(Bt={}));const Dt={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}`},Nt={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:Dt,twitter:Dt,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",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})=>e},background:"#202125",borderRadius:20,divider:{background:"#36373b"},text:{color:"white",font:"inherit"}};var Ft,Ut;!function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(Ft||(Ft={})),function(e){e.Classic="classic",e.Modern="modern"}(Ut||(Ut={}));const Vt={scrollStyle:Ft.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,useExperimentalModernVariant:!1,layout:Ut.Classic,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:Nt,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 Gt;!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"}(Gt||(Gt={}));const Wt={};var zt,$t,Ht,qt,Zt,Kt;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(zt||(zt={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}($t||($t={})),function(e){e[e.default=0]="default",e[e.onboarding=1]="onboarding",e[e.favorite=2]="favorite",e[e.direct=3]="direct"}(Ht||(Ht={})),function(e){e.list="list",e.favorite="favorite"}(qt||(qt={})),function(e){e.CLICK_ON_STORY="clickOnStoryLink"}(Zt||(Zt={})),function(e){e.LTR="ltr",e.RTL="rtl"}(Kt||(Kt={}));var Qt,Yt,Xt=I(5714),Jt=I.n(Xt);!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.TouchMoveHorizontal="touchMoveHorizontal",e.TouchMoveVertical="touchMoveVertical",e.LongTouchDetected="longTouchDetected"}(Qt||(Qt={}));class er{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 tr{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 rr extends(t()){constructor(e){super(),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"startPoint",{enumerable:!0,configurable:!0,writable:!0,value:new er(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=Jt()(this.options,e)),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),J&&this.disable()}get isSwiping(){return this._isSwiping}get horizontalSwipeGesture(){return this._horizontalSwipeGesture}get verticalSwipeGesture(){return this._verticalSwipeGesture}enable(){J||(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.reset(),this.clearTouchStartTimeout(),this.$el.removeEventListener("touchstart",this.handleTouchStart),this.$el.removeEventListener("touchmove",this.handleTouchMove),this.$el.removeEventListener("touchend",this.handleTouchEnd),this.$el=null)}init(e){this.$el||(this.$el=e,this.$el.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),this.$el.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),this.$el.addEventListener("touchend",this.handleTouchEnd))}handleTouchStart(e){this.enabled&&!this.touched&&(this.touched=!0,this.clearTouchStartTimeout(),this.startPoint=this.getPointByEvent(e),this.emit(Qt.TouchStart,new tr(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 tr(t.x,t.y,r.x,r.y);this.isThresholdExceed(r)&&(this._isSwiping=!0),this._isSwiping&&(this.emit(Qt.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(Qt.TouchEnd,new tr(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(Qt.LongTouchDetected,e)}),this.options.touchStartTimeout))}getPointByEvent(e){if(e instanceof TouchEvent){const t=e.changedTouches[0];return new er(t.pageX,t.pageY)}return new er(e.pageX,e.pageY)}getDeltaPoint(e){const t=e.x-this.startPoint.x,r=e.y-this.startPoint.y;return new er(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(Qt.TouchMoveVertical,e)}handleHorizontalSwipeGesture(e){this._horizontalSwipeGesture&&!this._horizontalSwipeGestureDisabled&&this.emit(Qt.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"}(Yt||(Yt={}));const ir=Yt.Bottom;class sr{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:ir}),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:ir}}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 ar=I(7326),or=I.n(ar);class nr{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:or()((()=>{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===Kt.LTR?1:-1;t.scrollLeft=r*e.x,t.scrollTop=e.y}scrollWithAnimation(e,t){const r=this.slider.getElementRef(),i=this.slider.dir===Kt.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 lr{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:or()((()=>{this.isAnimating=!1,this.slider.notifyScrollEnd()}),200)}),Object.defineProperty(this,"debouncedTryMouseWheelEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:or()((()=>{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,j),e.addEventListener("touchstart",this.handleMouseDown,j)}scrollTo(e){const t=this.slider.getElementRef(),r=this.slider.dir===Kt.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===Kt.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,j),e.removeEventListener("touchstart",this.handleMouseDown,j),e.removeEventListener("mouseup",this.handleMouseUp,j),e.removeEventListener("touchend",this.handleMouseUp,j),e.removeEventListener("mousemove",this.handleMouseMove,j),e.removeEventListener("touchmove",this.handleMouseMove,j),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,j),window.addEventListener("touchend",this.handleMouseUp,j),window.addEventListener("mousemove",this.handleMouseMove,j),window.addEventListener("touchmove",this.handleMouseMove,j)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.slider.notifyScrollEnd(),window.removeEventListener("mouseup",this.handleMouseUp,j),window.removeEventListener("touchend",this.handleMouseUp,j),window.removeEventListener("mousemove",this.handleMouseMove,j),window.removeEventListener("touchmove",this.handleMouseMove,j))}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===Kt.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 cr;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(cr||(cr={}));class dr extends e.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:cr.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:Kt.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===cr.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===Kt.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 lr(this):new nr(this)}}class hr{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,"scrollbarHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get width(){const e=this.window.document.documentElement.clientWidth;return Math.abs(this.window.innerWidth-e)}enable(){this.scrollbarHidden||(this.disableOverFlow(),this.disablePullToRefresh(),this.setBodyContainer(),this.setElementAttributes("body","paddingRight",(e=>e+this.width)),this.scrollbarHidden=!0)}disable(){this.scrollbarHidden&&(this.resetElementAttributes("html","overflow"),this.resetElementAttributes("body","overflow"),this.resetElementAttributes("body","paddingRight"),this.resetBodyContainer(),this.enablePullToRefresh(),this.scrollbarHidden=!1)}disablePullToRefresh(){if(this.style)return;this.style=this.window.document.createElement("style"),this.style.setAttribute("nonce",P()),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 ur=I(5136);const pr=async e=>(await fetch(e)).blob(),gr=async e=>{const t=await pr(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 fr(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 mr(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 yr,vr;function br(e,t,r,i,s,a,o,n,l,c){var d=mr("svg",{width:String(s),height:String(a),style:"background-color: #fff;"}),h=mr("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=fr(e,r,"src: url(",[" ",")","\t"]);if(null==i)break;r=i.foundAtIndex+i.value.length,t.push(i.value.replace(/["']/g,""))}return t})(r).forEach((function(e){p.push(new Promise((function(t,i){gr(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){gr(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=mr("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);pr(r).then((function(t){l(t),e.remove()}))}}),e===yr.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 wr(e,t,r,i){return new Promise((function(s,a){null==i&&(i=""),function(e,t,r,i,s,a){br(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"}(yr||(yr={})),function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(vr||(vr={}));class Sr{async getScreenShot({hideElementsSelector:e,slideContent:t}){const r=await wr(yr.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)}}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}getFilteredConfigDto(e){const t={};for(const[r,i]of Object.entries(null!=e?e:{}))null!==i&&(t[r]=i);return t}}var _r=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},xr=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)},kr=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 Cr=(()=>{var e,t,r;let i,s,a,o,n,l,c=[],d=[],h=[],u=[],p=[];return e=class{get _isOpened(){return xr(this,t,"f")}set _isOpened(e){kr(this,t,e,"f")}get _params(){return xr(this,r,"f")}set _params(e){kr(this,r,e,"f")}constructor(e,i){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:(_r(this,c),e)}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:i}),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,_r(this,d,!1)),r.set(this,(_r(this,h),_r(this,u,{id:"",type:vr.Social,link:""}))),Object.defineProperty(this,"currentStorySlide",{enumerable:!0,configurable:!0,writable:!0,value:(_r(this,p),null)}),this.sharingService=new Sr}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:vr.Social,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(J)return void this.open({type:vr.SlideScreenshot,id:e,link:s,text:t});await this.startNativeSharing(e,a)}catch(r){console.error(r),s&&this.open({type:vr.SlideScreenshot,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:vr.Social,id:e,link:a};try{if(J)return void this.open(o);await this.startNativeSharing(e,s)}catch(e){this.open(o)}}async startNativeSharing(e,t){const r=this.sharingService.getNavigatorShareFunction();if(!r)throw new Error;try{this.story.pauseUI(e),this.runNativeSharing({id:e}),await r(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=[b.observable],s=[b.observable],a=[b.computed],o=[b.computed],n=[b.action],l=[b.action],Or(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),Or(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),Or(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),Or(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),Or(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),Or(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 Pr=I(6166),jr=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},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},Ir=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)},Mr=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 Tr=(()=>{var e,t;let r,i=[],s=[];return e=class{get _disabledNextClick(){return Ir(this,t,"f")}set _disabledNextClick(e){Mr(this,t,e,"f")}constructor(e,r,a,o){Object.defineProperty(this,"_story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_index",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:o}),t.set(this,Er(this,i,!1)),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:(Er(this,s),new Pr.Mutex)}),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 state(){return this.slideApi.state}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}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(){const e=await this.mutex.acquire();let t=!1,r=0;const i=setTimeout((()=>{this.story.showLoaderScreen(),t=!0,r=Date.now()}),500);try{v(`[SLIDE][INIT]:${this.story.id}:${this.slide.index}`);const{result:e,reason:t}=await this.slideApi.showSlide(this.html);if(!e)throw new Error(t)}catch(e){this.handleSlideError(e)}finally{clearTimeout(i),await this.cleanupLoaderIfNeeded(Date.now()-r,t),e()}}async start(){const e=await this.mutex.acquire();try{v(`[SLIDE][START]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideStart({muted:this._story.muted}),this.story.touchController.on(Qt.TouchEnd,this.handleTouchEnd)}catch(e){this.handleSlideError(e)}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.story.hideErrorScreen(),this.story.showLoaderScreen(),await this.slideApi.slideRestart({muted:this._story.muted})}catch(e){this.handleSlideError(e)}finally{this.story.hideLoaderScreen(),e()}}async resumeByApp(){const e=await this.mutex.acquire();try{v(`[SLIDE][RESUME-BY-APP]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByApp(){const e=await this.mutex.acquire();try{v(`[SLIDE][PAUSE-BY-APP]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{v(`[SLIDE][RESUME-BY-USER]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{v(`[SLIDE][PAUSE-BY-USER]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(e){const t=await this.mutex.acquire();try{v(`[SLIDE][STOP]:${this.story.id}:${this.slide.index}`),await this.slideApi.slideStop(e),this.story.touchController.off(Qt.TouchEnd,this.handleTouchEnd)}catch(e){this.handleSlideError(e)}finally{t()}}showLayerByIndex(e){this.slideApi.showLayer(e)}canGoNext(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"forward");return e}canGoPrev(){const{canClickNext:e}=this.slideApi.slideClickHandler(null,"backward");return e}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(){await this.slideApi.destroy()}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.error(e),this.story.showErrorScreen(),this.story.touchController.off(Qt.TouchEnd,this.handleTouchEnd)}delay(e){return new Promise((t=>setTimeout(t,e)))}async cleanupLoaderIfNeeded(e,t){t&&await this.delay(Math.max(2e3-e,0)),this.story.hideLoaderScreen()}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],jr(e,null,r,{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},i,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Lr{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 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},Rr=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 Br=(()=>{var e;let t,r,i,s=[];return e=class{constructor(){Object.defineProperty(this,"refs",{enumerable:!0,configurable:!0,writable:!0,value:(Ar(this,s),b.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=[b.computed],r=[b.action],i=[b.action],Rr(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),Rr(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),Rr(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 Dr=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},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,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};let Vr=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,h,u,p,g,f,m,y,v,w=[],S=[],_=[],O=[],x=[],k=[],C=[];return e=class{get _userPaused(){return Fr(this,t,"f")}set _userPaused(e){Ur(this,t,e,"f")}get _systemPause(){return Fr(this,r,"f")}set _systemPause(e){Ur(this,r,e,"f")}get _uiPause(){return Fr(this,i,"f")}set _uiPause(e){Ur(this,i,e,"f")}constructor(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:(Dr(this,w),e)}),t.set(this,Dr(this,S,!1)),r.set(this,(Dr(this,_),Dr(this,O,new Br))),i.set(this,(Dr(this,x),Dr(this,k,new Br))),Dr(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._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=[b.observable],a=[b.observable],o=[b.observable],n=[b.computed],l=[b.computed],c=[b.computed],d=[b.computed],h=[b.computed],u=[b.action],p=[b.action],g=[b.action],f=[b.action],m=[b.action],y=[b.action],v=[b.action],Nr(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,_),Nr(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,x),Nr(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},k,C),Nr(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),Nr(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),Nr(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),Nr(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),Nr(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),Nr(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),Nr(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),Nr(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),Nr(e,null,f,{kind:"method",name:"resumeUI",static:!1,private:!1,access:{has:e=>"resumeUI"in e,get:e=>e.resumeUI},metadata:t},null,w),Nr(e,null,m,{kind:"method",name:"pauseSystem",static:!1,private:!1,access:{has:e=>"pauseSystem"in e,get:e=>e.pauseSystem},metadata:t},null,w),Nr(e,null,y,{kind:"method",name:"resumeSystem",static:!1,private:!1,access:{has:e=>"resumeSystem"in e,get:e=>e.resumeSystem},metadata:t},null,w),Nr(e,null,v,{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 Gr=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},Wr=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)},$r=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 Hr=(()=>{var e,t,r,i,s;let a,o,n,l,c,d,h,u,p,g,f=[],m=[],y=[],v=[],w=[],S=[],_=[],O=[],x=[];return e=class{get _hasShare(){return zr(this,t,"f")}set _hasShare(e){$r(this,t,e,"f")}get _hasFavorite(){return zr(this,r,"f")}set _hasFavorite(e){$r(this,r,e,"f")}get _hasLike(){return zr(this,i,"f")}set _hasLike(e){$r(this,i,e,"f")}get _height(){return zr(this,s,"f")}set _height(e){$r(this,s,e,"f")}constructor(e,a,o,n){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Gr(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,Gr(this,m,!1)),r.set(this,(Gr(this,y),Gr(this,v,!1))),i.set(this,(Gr(this,w),Gr(this,S,!1))),s.set(this,(Gr(this,_),Gr(this,O,0))),Gr(this,x),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}get hasShare(){return this._hasShare}get hasFavorite(){return this._hasFavorite}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{this.storyManager.emitEvent(new gs(this.story,{value:1===e})),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{this.storyManager.emitEvent(new us(this.story,{value:-1===e})),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{this.storyManager.emitEvent(new ps(this.story,{value:e})),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;if(this.storyManager.emitEvent(new fs(this.story)),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),this.storyManager.emitEvent(new ms(this.story,{url:e}));const t={title:this.story.title,text:"",url:e};this.sharePanel.shareText({shareId:"story-share",config:t,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=[b.observable],o=[b.observable],n=[b.observable],l=[b.observable],c=[b.computed],d=[b.computed],h=[b.action],u=[b.action],p=[b.action],g=[b.action],Wr(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),Wr(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,w),Wr(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,_),Wr(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,x),Wr(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),Wr(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),Wr(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),Wr(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),Wr(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),Wr(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 qr,Zr=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},Kr=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};!function(e){e.Close="closeGoodsWidget",e.Open="openGoodsWidget"}(qr||(qr={}));let Xr=(()=>{var t,r;let i,s=e.EventEmitter,a=[],o=[];return t=class extends s{get params(){return Qr(this,r,"f")}set params(e){Yr(this,r,e,"f")}constructor(e,t,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:t}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:i}),r.set(this,Kr(this,a,{elementId:"",target:""})),Kr(this,o),this.storyManager=e,this.story=t,this.storyReaderStatisticV2Service=i}close(){this.story.touchController.enable(),this.story.resumeUI(this),this.story.activeSlide.closeLegacyGoodsWidget(this.params.elementId),this.emit(qr.Close)}open(e){var t;this.story.touchController.disable(),this.story.pauseUI(this),this.params=e,this.emit(qr.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 aa({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 sa({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[]}}},r=new WeakMap,(()=>{var e;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=s[Symbol.metadata])&&void 0!==e?e:null):void 0;i=[b.observable],Zr(t,null,i,{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},a,o),r&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),t})();class Jr{constructor(e,t){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lastSlide",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"activeSlide",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isInitialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_activeSlideStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0})}get activeSlideDuration(){return Date.now()-this._activeSlideStartTime}async init(){var e;this.isInitialized||(this.isInitialized=!0,await(null===(e=this.activeSlide)||void 0===e?void 0:e.init()))}async start(){var e;this.isActive||(this.isActive=!0,await(null===(e=this.activeSlide)||void 0===e?void 0:e.start()),this._activeSlideStartTime=Date.now())}async restart(){this.isActive&&this.activeSlide&&await this.activeSlide.restart()}async stop(){this.isActive&&(this.isActive=!1,this.slideApiHandlers.clearNarrativeSessionDataCache(),this.story.resumeAll(),await this.story.activeSlide.stop({prepareForRestart:1}))}async onSlideChange(e){var t;this.lastSlide=this.activeSlide,this.activeSlide=e,this.isInitialized&&await e.init(),this.isActive&&(this.story.resumeAll(),await(null===(t=this.lastSlide)||void 0===t?void 0:t.stop({prepareForRestart:2})),await e.start(),this._activeSlideStartTime=Date.now())}async destroy(){var e,t;this.slideApiHandlers.clearNarrativeSessionDataCache(),this.isInitialized=!1,this.isActive=!1,await(null===(e=this.activeSlide)||void 0===e?void 0:e.stop({prepareForRestart:2})),await(null===(t=this.activeSlide)||void 0===t?void 0:t.destroy())}}var ei;!function(e){e.Start="start",e.Stop="stop",e.Pause="pause",e.Resume="resume",e.Progress="progress",e.Complete="complete"}(ei||(ei={}));class ti extends e.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(ei.Start),this.setTimer(e)))}restart(){this.stop(),this.start(this.timeout)}stop(){this.isCompleted||(this.clearTimer(),this.emit(ei.Stop),this.isCompleted=!0,this.timerPaused=!1)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit(ei.Pause))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit(ei.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(ei.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(ei.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 ri=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},ii=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},si=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)},ai=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 oi=(()=>{var e,t;let r,i,s,a,o=[],n=[],l=[];return e=class{get _hiddenTimeline(){return si(this,t,"f")}set _hiddenTimeline(e){ai(this,t,e,"f")}constructor(e){Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:(ri(this,o),e)}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:new ti}),t.set(this,ri(this,n,!1)),Object.defineProperty(this,"handleTimerComplete",{enumerable:!0,configurable:!0,writable:!0,value:(ri(this,l),({forceEnd:e})=>{e||this.story.activeSlide.notifyTimerEnd()})}),this.timer.on(ei.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(ei.Complete,this.handleTimerComplete)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],i=[b.computed],s=[b.action],a=[b.action],ii(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),ii(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),ii(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),ii(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 ni=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},li=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},ci=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)},di=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 hi=(()=>{var e,t,r,i;let s,a,o,n=[],l=[],c=[],d=[],h=[],u=[];return e=class{get _isOpened(){return ci(this,t,"f")}set _isOpened(e){di(this,t,e,"f")}get _id(){return ci(this,r,"f")}set _id(e){di(this,r,e,"f")}get _config(){return ci(this,i,"f")}set _config(e){di(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,li(this,n,!1)),r.set(this,(li(this,l),li(this,c,null))),i.set(this,(li(this,d),li(this,h,null))),li(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 oa({widget_id:e,widget_label:String(t.configV2.main.question.text.value).trim()}),!0)}completeInput(e){this._id&&this._config&&this.storyReaderStatisticV2Service.sendEvent(new na({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=[b.observable],a=[b.observable],o=[b.observable],ni(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),ni(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),ni(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 ui=310/480,pi=428/805;var gi,fi=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},mi=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},yi=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)},vi=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.ShowToast="showToast"}(gi||(gi={}));let bi=(()=>{var e,t,r,i,a,o;let n,l,c,d,h,u,p,g,f,m,y,v,w,S,_,O,x,k,C,j,E,I=s,M=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],F=[],U=[],V=[];return e=class extends I{get _activeSlideIndex(){return yi(this,t,"f")}set _activeSlideIndex(e){vi(this,t,e,"f")}get _slides(){return yi(this,r,"f")}set _slides(e){vi(this,r,e,"f")}get _needShowErrorScreen(){return yi(this,i,"f")}set _needShowErrorScreen(e){vi(this,i,e,"f")}get _needShowLoaderScreen(){return yi(this,a,"f")}set _needShowLoaderScreen(e){vi(this,a,e,"f")}get _$root(){return yi(this,o,"f")}set _$root(e){vi(this,o,e,"f")}constructor(e,s,n,l,c,d){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(fi(this,M),e)}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:s}),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,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:d}),t.set(this,fi(this,T,0)),r.set(this,(fi(this,L),fi(this,A,[]))),i.set(this,(fi(this,R),fi(this,B,!1))),a.set(this,(fi(this,D),fi(this,N,!1))),o.set(this,(fi(this,F),fi(this,U,null))),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:(fi(this,V),null)}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storySlidesReactionDisposer",{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,"lifecycleManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"initOnce",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"attachRoot",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{this._$root=e}}),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 Vr(this),this.touchController=this.storyReader.touchController,this.slideApiHandlers=this.storySlideApiHandlersFactory.create(this),this.goodsWidget=new Xr(this.storyManager,this,this.storyReaderStatisticV2Service),this.textInput=new hi(this,this.storyReaderStatisticV2Service),this.timeline=new oi(this),this.lifecycleManager=new Jr(this,this.slideApiHandlers),this.sharePanel=new Cr(this,this.storyReader.touchController),this.actionPanel=new Hr(this.storyManager,this,this.sharePanel,this.storyReaderStatisticV2Service),this.storySlidesReactionDisposer=this.observeStorySlides()}get needShowErrorScreen(){return this._needShowErrorScreen||Boolean(this.error)}get needShowLoaderScreen(){return!this.story.canBeShown||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 tags(){return this.story.tags}get displayStrategy(){return this.storyReader.displayStrategy}get canBeShown(){return this.story.canBeShown&&this.slides.length>0}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(){var e;return null!==(e=this.slides[this._activeSlideIndex])&&void 0!==e?e:new Lr}get slidesCount(){return this.story.slidesCount}get displayedSlideImage(){return this.story.getImagesPerSlide(this._activeSlideIndex)}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 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}async showSlide(e){var t;if(this.activeSlideIndex===e)return;null===(t=this.toast)||void 0===t||t.destroy();const r=this.activeSlideIndex;this._activeSlideIndex=e,await this.lifecycleManager.onSlideChange(this.activeSlide),this.emitSlideV1Stat(this.activeSlideIndex),this.emitSlideV2Stat(r,this.lifecycleManager.activeSlideDuration)}markAsOpened(){this.storyManager.rootStore.storyStore.markIsOpenedById(this.story.id)}markWasShown(){this.story.markWasShown()}setError(e){this.story.setError(e)}async reset(){this.textInput.close(),await this.slideApiHandlers.resetStory(this.id)}async reload(){return this.storyReader.reloadStory(this)}nextSlideOrStory(){this.reachEnd?this.storyReader.nextStoryWithAnimation():this.nextSlide()}async prevSlideOrStory(){this.reachStart&&this.storyReader.reachStart?await this.lifecycleManager.restart():this.reachStart?this.storyReader.prevStoryWithAnimation():this.prevSlide()}mute(){this.storyReader.mute(),this.activeSlide.mute()}unmute(){this.storyReader.unmute(),this.activeSlide.unmute()}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)}detachRoot(){this._$root=null}async init(){return this.initOnce||this.story.canBeShown||(this.showLoaderScreen(),this.initOnce=!0),this.lifecycleManager.init()}async start(){return document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("keydown",this.handleKeydown),this.lifecycleManager.start()}async stop(){var e;return document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),null===(e=this.toast)||void 0===e||e.destroy(),this.lifecycleManager.stop()}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 sr(Object.assign(Object.assign({},e),{mountPoint:this.$root})),this.toast.show(e.content)}async destroy(){var e,t;this._$root=null,document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("keydown",this.handleKeydown),this.storySlidesReactionDisposer(),this.sharePanel.close(),this.textInput.close(),this.timeline.destroy(),this.goodsWidget.close(),await this.lifecycleManager.destroy(),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.storyReaderStatisticV2Service.sendSlideEvent({durationMs:t,storyId:this.id,activeSlideIndex:e,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}emitSlideV1Stat(e){this.storyManager.emitEvent(new ys(this)),this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:this.id,slideIndex:e})}observeStorySlides(){return(0,b.reaction)((()=>({storySlides:this.story.slides,canBeShown:this.story.canBeShown&&Boolean(this._$root)})),(({storySlides:e,canBeShown:t})=>this._$root&&t&&e.length?(this.slideApi=this.createSlideApi(this._$root),this.createSlidesViewModels(e,this.slideApi)):[]),{fireImmediately:!0})}createSlideApi(e){return new ur.SlideApi(this.slideApiHandlers,{root:e,slideRatio:ui,isFullscreen:!1,nonce:P(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand,overlappingActionBarHeight:this.actionPanel.height})}async createSlidesViewModels(e,t){this._slides=e.map(((e,r)=>new Tr(this,r,t,e))),await this.lifecycleManager.onSlideChange(this.activeSlide)}handleSpaceKeydown(e){"Space"===e.code&&(this.pauseState.isUserPaused?this.resumeUser():this.pauseUser())}handleMKeydown(e){"KeyM"===e.code&&(this.muted?this.unmute():this.mute())}},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=I[Symbol.metadata])&&void 0!==t?t:null):void 0;n=[b.observable],l=[b.observable],c=[b.observable],d=[b.observable],h=[b.observable],u=[b.computed],p=[b.computed],g=[b.computed],f=[b.computed],m=[b.computed],y=[b.computed],v=[(t=b.computed).struct.bind(t)],w=[b.computed],S=[b.computed],_=[b.action],O=[b.action],x=[b.action],k=[b.action],C=[b.action],j=[b.action],E=[b.action],mi(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},T,L),mi(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},A,R),mi(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),mi(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),mi(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,V),mi(e,null,u,{kind:"getter",name:"needShowErrorScreen",static:!1,private:!1,access:{has:e=>"needShowErrorScreen"in e,get:e=>e.needShowErrorScreen},metadata:r},null,M),mi(e,null,p,{kind:"getter",name:"needShowLoaderScreen",static:!1,private:!1,access:{has:e=>"needShowLoaderScreen"in e,get:e=>e.needShowLoaderScreen},metadata:r},null,M),mi(e,null,g,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:r},null,M),mi(e,null,f,{kind:"getter",name:"displayedSlideImage",static:!1,private:!1,access:{has:e=>"displayedSlideImage"in e,get:e=>e.displayedSlideImage},metadata:r},null,M),mi(e,null,m,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,M),mi(e,null,y,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,M),mi(e,null,v,{kind:"getter",name:"pauseState",static:!1,private:!1,access:{has:e=>"pauseState"in e,get:e=>e.pauseState},metadata:r},null,M),mi(e,null,w,{kind:"getter",name:"isNextDisabled",static:!1,private:!1,access:{has:e=>"isNextDisabled"in e,get:e=>e.isNextDisabled},metadata:r},null,M),mi(e,null,S,{kind:"getter",name:"isPrevDisabled",static:!1,private:!1,access:{has:e=>"isPrevDisabled"in e,get:e=>e.isPrevDisabled},metadata:r},null,M),mi(e,null,_,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,M),mi(e,null,O,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,M),mi(e,null,x,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,M),mi(e,null,k,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,M),mi(e,null,C,{kind:"method",name:"showSlide",static:!1,private:!1,access:{has:e=>"showSlide"in e,get:e=>e.showSlide},metadata:r},null,M),mi(e,null,j,{kind:"method",name:"markAsOpened",static:!1,private:!1,access:{has:e=>"markAsOpened"in e,get:e=>e.markAsOpened},metadata:r},null,M),mi(e,null,E,{kind:"method",name:"markWasShown",static:!1,private:!1,access:{has:e=>"markWasShown"in e,get:e=>e.markWasShown},metadata:r},null,M),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();var wi,Si=I(56),_i=I.n(Si);class Oi{async openGame({gameInstanceId:e,gameOptions:t}){const r={fields:"splashScreen,splashLandscapeScreen,splashLottieScreen,screenOptions,config,resources,url,downloadUrl,instanceUserData,canTryReloadCount,loggerLevel,lottie"};t&&h()(t)&&null!=t.demoMode&&(r.demoMode=Boolean(t.demoMode));return(await ae.post(`game/${e}/launch?expand=config`,r)).data}}!function(e){e.TEXT="text",e.IMAGE="image"}(wi||(wi={}));class xi{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.8.0-rc.1",this.apiBaseUrl=oe.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 je.TEXT:return wi.TEXT;case je.IMAGE:return wi.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 ki{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 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,"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 Pi{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 ji{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 Ei{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 Ii{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 Mi{constructor(e,t){var r,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}),this.splashScreen=t.splashScreen?new Ii(t.splashScreen):void 0,this.splashLandscapeScreen=t.splashLandscapeScreen?new ji(t.splashLandscapeScreen):void 0,this.splashLottieScreen=t.splashLottieScreen?new Ei(t.splashLottieScreen):void 0,this.screenOptions=new Pi(t.screenOptions),this.config=new ki(t.config),this.resources=null!==(i=null===(r=t.resources)||void 0===r?void 0:r.map((e=>new Ci(e))))&&void 0!==i?i:[],this.url=t.url,this.downloadUrl=t.downloadUrl,this.instanceUserData=t.instanceUserData,this.clientConfig=new xi(e),this.canTryReloadCount=t.canTryReloadCount,this.loggerLevel=t.loggerLevel,this.lottie=t.lottie?{src:t.lottie.src}:void 0}toInitDto(e){return Jt()(this.config.toJSON(),{clientConfig:Object.assign({fullScreen:!1,screenOrientation:this.screenOptions.orientation,safeAreaInsets:e.safeAreaInsets,widescreen:e.isWidescreen,dir:e.dir,nonce:P(),sdkFeatures:{gameShouldForegroundCallback:!0}},this.clientConfig.toJSON())})}}class Ti extends e.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)}messageListener(e){if(e.origin!==this.origin)return;const[t,...r]=e.data;try{if(!Array.isArray(e.data))throw new Error(`Invalid MessageEvent data format ${e.data}`);this.emit(t,...r)}catch(e){console.error(e)}}sendMessage(e,t){var r;null===(r=this.iframe.contentWindow)||void 0===r||r.postMessage([e,t],this.origin)}pauseGameUI(){null==this||this.sendMessage("cb",{cb:"pauseUI",arguments:JSON.stringify([])})}resumeGameUI(){null==this||this.sendMessage("cb",{cb:"resumeUI",arguments:JSON.stringify([])})}shareComplete(e,t){this.sendMessage("shareComplete",{id:e,isSuccess:t})}closeGameReader(){this.sendMessage("closeGameReader")}initGame(e){this.sendMessage("cb",{cb:"initGame",arguments:JSON.stringify([e])})}sendGameCenterEventByApiRequest(e,t){this.sendMessage("cb",{cb:e,plainData:t})}notifyGameCanBeStarted(){this.sendMessage("gameShouldForeground")}destroy(){window.removeEventListener("message",this.messageListener,!1),this.removeAllListeners()}}class Li{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=h()(this.instanceUserData)?this.instanceUserData:{};try{const r=JSON.parse(null!==(e=window.localStorage.getItem(this.key))&&void 0!==e?e:"{}");h()(r)&&(t=r)}catch(e){console.error(e)}return Jt()(t,r)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class Ai{constructor(e,t){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"game",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){const{id:t,callback:r}=JSON.parse(e),i=new Li(this.game.clientConfig.userKey,this.game.config.gameInstanceId,this.game.instanceUserData).get();this.gameCenterMessageService.sendMessage("cb",{cb:r,arguments:JSON.stringify([t,JSON.stringify(i)])})}}class Ri{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"game",{enumerable:!0,configurable:!0,writable:!0,value:t})}async handle(e){try{const t=JSON.parse(e);if(new Li(this.game.clientConfig.userKey,this.game.config.gameInstanceId,this.game.instanceUserData).set(t.data),this.storyManager.isStatisticsDisabled||!t.sendToServer)return;await ae.post(`game/${t.gameInstanceId}/instance-user-data`,{data:t.data})}catch(e){console.error(e)}}}var Bi;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(Bi||(Bi={}));class Di{constructor(e,t,r){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"shareNotifier",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:r})}async handle(e,t){var r,i,s;let a=null!==(r=null==t?void 0:t.url)&&void 0!==r?r:t.text,o=[];t.files&&Array.isArray(t.files)&&t.files.length>0&&(o=await Promise.all(t.files.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)))));const n={url:null!=a?a:void 0,files:o.length>0?o:void 0,text:null!==(i=t.text)&&void 0!==i?i:void 0,title:null!==(s=t.title)&&void 0!==s?s:void 0};if(!(n.files&&n.files.length>0||n.url))return void this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!1});let l=navigator.share;if(!navigator.share&&window.parent&&window.parent.navigator.share&&(l=window.parent.navigator.share),!this.desktopMode&&l)try{if(!l)return;l(n).then((()=>this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!0}))).catch((()=>this.shareNotifier.notifyShareCompleted({shareId:e,isSuccess:!1})))}catch(t){console.error(t),this.openSharePanel({shareConfig:n,sharePath:a,shareId:e})}else this.openSharePanel({shareConfig:n,sharePath:a,shareId:e})}openSharePanel({shareConfig:e,sharePath:t,shareId:r}){let i=Bi.Social,s=t;e.files&&e.files.length>0&&(i=Bi.SlideScreenshot,s=URL.createObjectURL(e.files[0])),this.shareNotifier.notifyOpenSharePanel({shareId:r,shareType:i,shareLink:s})}}class Ni{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 Fi{constructor(e){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e})}handle(e){const t=JSON.parse(e);if(!h()(t))return;const{id:r,storyId:i,callback:s}=t;let a=new Ni(i).get();this.gameCenterMessageService.sendMessage("cb",{cb:s,arguments:JSON.stringify([r,JSON.stringify(a)])})}}class Ui{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async handle(e){try{const t=JSON.parse(e);if(!h()(t))return;if(new Ni(t.storyId).set(t.data),this.storyManager.isStatisticsDisabled||!t.sendToServer)return;await ae.request({url:"story-data/"+t.storyId,method:"put",data:{data:t.data}})}catch(e){console.error(e)}}}var Vi,Gi=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},Wi=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},zi=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)},$i=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="close",e.OpenSharePanel="openSharePanel"}(Vi||(Vi={}));let Hi=(()=>{var e,t,r,i,a,o,n,l,c;let d,u,p,g,f,m,y,v,w,S,_,O,x,k,C,P,j,E=s,I=[],M=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],F=[],U=[],V=[],G=[],W=[],z=[],$=[],H=[];return e=class extends E{get _isOpened(){return zi(this,t,"f")}set _isOpened(e){$i(this,t,e,"f")}get _isGameInited(){return zi(this,r,"f")}set _isGameInited(e){$i(this,r,e,"f")}get _isGameLoading(){return zi(this,i,"f")}set _isGameLoading(e){$i(this,i,e,"f")}get _gameInstanceId(){return zi(this,a,"f")}set _gameInstanceId(e){$i(this,a,e,"f")}get _game(){return zi(this,o,"f")}set _game(e){$i(this,o,e,"f")}get _gameError(){return zi(this,n,"f")}set _gameError(e){$i(this,n,e,"f")}get _closeBtnVisible(){return zi(this,l,"f")}set _closeBtnVisible(e){$i(this,l,e,"f")}get _gameShouldBeShown(){return zi(this,c,"f")}set _gameShouldBeShown(e){$i(this,c,e,"f")}constructor(e,s){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Gi(this,I),e)}),Object.defineProperty(this,"gameCenterApi",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,Gi(this,M,!1)),r.set(this,(Gi(this,T),Gi(this,L,!1))),i.set(this,(Gi(this,A),Gi(this,R,!1))),a.set(this,(Gi(this,B),Gi(this,D,null))),o.set(this,(Gi(this,N),Gi(this,F,null))),n.set(this,(Gi(this,U),Gi(this,V,null))),l.set(this,(Gi(this,G),Gi(this,W,!1))),c.set(this,(Gi(this,z),Gi(this,$,!1))),Object.defineProperty(this,"initGameRetryAttempts",{enumerable:!0,configurable:!0,writable:!0,value:(Gi(this,H),0)}),Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"safeAreaInsets",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,bottom:0,left:0,right:0}}),Object.defineProperty(this,"openGameOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new hr(window)}),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),document.addEventListener("visibilitychange",this.handleVisibilityChange)}notifyShareCompleted({shareId:e,isSuccess:t}){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.shareComplete(e,t)}notifyOpenSharePanel({shareId:e,shareType:t,shareLink:r}){this.emit(Vi.OpenSharePanel,{shareId:e,shareType:t,shareLink:r})}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 gameInstanceId(){return this._gameInstanceId}get isOpened(){return this._isOpened}get gameShouldBeShown(){return this._gameShouldBeShown}get dir(){return this.storyManager.config.dir}async openGame(e,t={}){if((e=e.toString())!==this._gameInstanceId){if(this.isOpened)throw new Error(`Close the launched game with ID "${this.gameInstanceId}"`);this._gameInstanceId=e,this._isOpened=!0,this.openGameOptions=t,this._gameShouldBeShown=!1,await this.launchGameById(e),this.scrollbarHelper.enable()}else console.warn(`[IAS]: Prevented reopening of game with ID ${e}`)}async closeGame(){var e;return!!this._isOpened&&(this._isGameInited?null===(e=this.gameCenterMessageService)||void 0===e||e.closeGameReader():this.handleGameComplete({}),!0)}reload(){this._game=null,this.gameInstanceId?this.launchGameById(this.gameInstanceId):console.error("The game instance ID is undefined")}sendGameCenterEventByApiRequest(e,t){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.sendGameCenterEventByApiRequest(e,t)}setSafeAreaInsets(e){this.safeAreaInsets=e}setGameCenterIframe(e,{isWidescreen:t}){var r;if(!this._game)throw new Error("GameCenter iframe setup error");if(this._isGameInited)return;null===(r=this.gameCenterMessageService)||void 0===r||r.destroy();const i=new URL(this._game.url).origin;this.gameCenterMessageService=new Ti(e,i),this.initGameCenter({isWidescreen:t,gameCenterMessageService:this.gameCenterMessageService,game:this._game})}pauseGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.pauseGameUI()}resumeGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.resumeGameUI()}notifyGameCanBeStarted(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.notifyGameCanBeStarted()}destroy(){var e;this.scrollbarHelper.disable(),null===(e=this.gameCenterMessageService)||void 0===e||e.destroy(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.completeGame()}async launchGameById(e){try{this._gameError=null,this._isGameLoading=!0,await this.storyManager.rootStore.sessionStore.open();const t=await this.gameCenterApi.openGame({gameInstanceId:e,gameOptions:this.openGameOptions});this._game=new Mi(this.storyManager,t)}catch(e){this._gameError=e}}initGameCenter({isWidescreen:e,gameCenterMessageService:t,game:r}){this.handleGameCenterEvents(r,t);const i=r.toInitDto({safeAreaInsets:this.safeAreaInsets,dir:this.dir,isWidescreen:e});t.initGame(i)}handleGameCenterEvents(e,t){t.on("gameLoaded",this.handleGameLoaded.bind(this)).on("gameComplete",this.handleGameComplete.bind(this)).on("sendApiRequest",this.handleSendApiRequest.bind(this)).on("openUrl",this.handleOpenUrl.bind(this)).on("event",this.handleGameEvent.bind(this)).on("reloadGameReader",this.handleReloadGameReader.bind(this)).on("gameLoadFailed",this.handleGameLoadFailed.bind(this)).on("gameShouldForegroundCallback",this.handleGameShouldBeShown.bind(this));const r={share:new Di(t,this,J),storySetLocalData:new Ui(this.storyManager),storyGetLocalData:new Fi(t),gameInstanceGetLocalData:new Ai(t,e),gameInstanceSetLocalData:new Ri(this.storyManager,e)};for(const[e,i]of Object.entries(r))t.on(e,((...e)=>i.handle(...e)))}handleGameShouldBeShown(e){this._gameShouldBeShown=!0;const t=JSON.parse(e);h()(t)&&(this._closeBtnVisible=Boolean(t.showClose))}handleGameLoaded(){try{this.initGame(),this.startGame()}catch(e){console.error(e)}}initGame(){this._isGameInited=!0,this._isGameLoading=!1}completeGame(){this._isGameInited=!1,this._isOpened=!1,this._game=null,this._gameInstanceId=null}startGame(){this.storyManager.emit("startGame",{id:this.gameInstanceId})}handleVisibilityChange(){"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}handleGameComplete(e,t,r,i,s){this.resetGameState(e),this.processGameResult(s,i)}resetGameState(e){var t;const r=this.gameInstanceId;if(!r)throw new Error("[IAS]: No game instance ID on game complete");this.scrollbarHelper.disable(),null===(t=this.gameCenterMessageService)||void 0===t||t.destroy(),this.completeGame(),this.emitGameCompleteEventByStoryManager(r,e)}processGameResult(e,t){(null==e?void 0:e.id)?this.openGame(e.id,{}):((null==t?void 0:t.id)&&this.storyManager.showStory(t.id),this.emit(Vi.Close))}emitGameCompleteEventByStoryManager(e,t){_i()(t)?this.storyManager.emit("closeGame",{id:e}):this.storyManager.emit("finishGame",{id:e,result:t})}async handleSendApiRequest(e){let t,r,i;try{const s=JSON.parse(e);t=s.id,r=s.data,i=s.cb,await ae.request({url:s.url,method:s.method,params:s.params,data:s.data,headers:s.headers}).catch(console.error),this.sendGameCenterEventByApiRequest(i,JSON.stringify({requestId:t,data:JSON.stringify(r.data),status:r.status,headers:r.headers}))}catch(e){if(e instanceof SyntaxError)return;if(!i)return;this.sendGameCenterEventByApiRequest(i,JSON.stringify({requestId:t,data:JSON.stringify(e),status:400,headers:[{}]}))}}handleOpenUrl(e){const{url:t}=JSON.parse(e),r={src:Bt.GAME_READER,data:{url:t,gameInstanceId:this.gameInstanceId}};this.storyManager.emit("clickOnButton",r),this.storyManager.storyLinkClickHandler?this.storyManager.storyLinkClickHandler(r):window.open(t,"_self")}handleGameEvent(e,t){this.storyManager.emit("gameEvent",{name:e,payload:t}),this.storyManager.emit("eventGame",{name:e,payload:t})}handleReloadGameReader(){const e=this._game;this._game=null,this._isGameInited=!1,this._isGameLoading=!0,this._gameShouldBeShown=!1,setTimeout((0,b.action)((()=>{this._game=e})))}handleGameLoadFailed(e,t){this._game&&t&&this.initGameRetryAttempts<this._game.canTryReloadCount?(this.initGameRetryAttempts++,this.handleReloadGameReader()):this._gameError=new Error(e)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,l=new WeakMap,c=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=E[Symbol.metadata])&&void 0!==t?t:null):void 0;d=[b.observable],u=[b.observable],p=[b.observable],g=[b.observable],f=[b.observable],m=[b.observable],y=[b.observable],v=[b.observable],w=[b.computed],S=[b.action],_=[b.action],O=[b.action],x=[b.action],k=[b.action],C=[b.action],P=[b.action],j=[b.action],Wi(e,null,d,{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},M,T),Wi(e,null,u,{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},L,A),Wi(e,null,p,{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},R,B),Wi(e,null,g,{kind:"accessor",name:"_gameInstanceId",static:!1,private:!1,access:{has:e=>"_gameInstanceId"in e,get:e=>e._gameInstanceId,set:(e,t)=>{e._gameInstanceId=t}},metadata:r},D,N),Wi(e,null,f,{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},F,U),Wi(e,null,m,{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},V,G),Wi(e,null,y,{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},W,z),Wi(e,null,v,{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},$,H),Wi(e,null,w,{kind:"getter",name:"dir",static:!1,private:!1,access:{has:e=>"dir"in e,get:e=>e.dir},metadata:r},null,I),Wi(e,null,S,{kind:"method",name:"openGame",static:!1,private:!1,access:{has:e=>"openGame"in e,get:e=>e.openGame},metadata:r},null,I),Wi(e,null,_,{kind:"method",name:"closeGame",static:!1,private:!1,access:{has:e=>"closeGame"in e,get:e=>e.closeGame},metadata:r},null,I),Wi(e,null,O,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:r},null,I),Wi(e,null,x,{kind:"method",name:"handleGameShouldBeShown",static:!1,private:!1,access:{has:e=>"handleGameShouldBeShown"in e,get:e=>e.handleGameShouldBeShown},metadata:r},null,I),Wi(e,null,k,{kind:"method",name:"handleGameLoaded",static:!1,private:!1,access:{has:e=>"handleGameLoaded"in e,get:e=>e.handleGameLoaded},metadata:r},null,I),Wi(e,null,C,{kind:"method",name:"handleGameComplete",static:!1,private:!1,access:{has:e=>"handleGameComplete"in e,get:e=>e.handleGameComplete},metadata:r},null,I),Wi(e,null,P,{kind:"method",name:"handleReloadGameReader",static:!1,private:!1,access:{has:e=>"handleReloadGameReader"in e,get:e=>e.handleReloadGameReader},metadata:r},null,I),Wi(e,null,j,{kind:"method",name:"handleGameLoadFailed",static:!1,private:!1,access:{has:e=>"handleGameLoadFailed"in e,get:e=>e.handleGameLoadFailed},metadata:r},null,I),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:"GameReaderViewModel"}),e})();class qi{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){return new Hi(this.storyManager,new Oi)}}const Zi=.64516129032;class Ki{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>Zi&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>Zi&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return Math.ceil(this._vh*Zi)}calcHeightByVW(){return this._vh}isDiffAspectRatioEqualToEps(){return this.viewportRatio>Zi&&this.viewportRatio-Zi<=.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 Qi{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>Zi&&!this.isDiffAspectRatioEqualToEps()?`${this.calcWidthByVH()}px`:"auto"}getHeight(){const e=this.isDiffAspectRatioEqualToEps()||this.isPortraitOrientation();return this.viewportRatio>Zi&&!e?`${this.calcHeightByVW()}px`:"100%"}calcWidthByVH(){return this.viewportRatio>Zi?this._vw:Math.ceil(this._vh*Zi)}calcHeightByVW(){return Math.ceil(this._vw/Zi)}isDiffAspectRatioEqualToEps(){return this.viewportRatio>Zi&&this.viewportRatio-Zi<=.1}isPortraitOrientation(){let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches}}class Yi{constructor(){}create(e){return J&&e.vw>=e.vh?this.createDesktopGameGeometry(e):this.createMobileGameGeometry(e)}createDesktopGameGeometry(e){return new Ki(e.vw,e.vh,{top:50,bottom:50})}createMobileGameGeometry(e){return new Qi(e.vw,e.vh)}}class Xi{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;await t.openGame(e.gameInstanceId),r.pauseUI(),t.once(Vi.Close,(()=>{r.resumeUI()}))}catch(e){console.error(e)}}}class Ji{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({id:this.activeStory.id,index:this.activeStory.activeSlideIndex,url:r,elementId:e.elementId,dataForSending:null,label:""})}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:Bt.STORY_READER,data:e};if(this.storyManager.emit("clickOnButton",t),this.storyManager.storyLinkClickHandler||this.storyManager.listenerCount(Zt.CLICK_ON_STORY)>0)try{this.storyManager.storyLinkClickHandler&&this.storyManager.storyLinkClickHandler(t),this.storyManager.emit(Zt.CLICK_ON_STORY,t)}catch(e){console.error(e)}else window.open(e.url,"_self")}}class es{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{await this.emitClickOnButtonEvent({id:0,index:0,url:"",elementId:"",dataForSending:null,label:""}),await this.storyReader.showStory(e.storyId)}catch(e){console.error(e)}}async emitClickOnButtonEvent(e){this.storyReaderStatisticV1Service.sendClickOnButtonEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),await this.storyReaderStatisticV1Service.sendData();const t={src:Bt.STORY_READER,data:e};this.storyManager.emit("clickOnButton",t)}}class ts{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 rs{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 is{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 ts}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new ts})}clearNarrativeSessionDataCache(){this.sessionNarrativeDataCache.clear()}writeToClipboard(e){y(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}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await ae.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 c)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){var t;this.statisticV2Service.sendSlideLayout({layoutIndex:e,storyId:this.story.id,activeSlideIndex:this.story.activeSlideIndex,feedSlug:null===(t=this.storyReader.feed)||void 0===t?void 0:t.slug}),this.story.resumeUser(),this.story.activeSlide.showLayerByIndex(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(){return this.storyManager.rootStore.sessionStore.session.fontsResources}updateTimeline(e,t,r,i,s,a){if(this.story.activeSlideIndex!==e)return;v("[SLIDE-API]: update timeline",`<${[...arguments].join(", ")}>`);const o=new rs(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 Ji(this.storyManager,this.storyReader,this.story,this.statisticV1Service,this.statisticV2Service).handle({elementId:e.elementId,linkTarget:e.link.target})}closeCard(e){this.storyReader.close(Us.CloseCustom)}openStory(e,t){this.story.id===e?this.story.showSlide(t):new es(this.storyManager,this.storyReader,this.story,this.statisticV1Service).handle({storyId:e,slideIndex:t})}openGame(e){new Xi(this.storyManager,this.story).handle({gameInstanceId:e})}}class ss{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 is(this.storyManager,this.storyReader,e,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service)}}class as{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*ui)}calculateHeight(){return Math.ceil(this.calculateWidth()/ui)}}class os{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/pi)}}class ns{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(J&&e>ui)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 as(e.vw,e.vh)}createMobileStoryGeometry(e){return new os(e.vw,e.vh)}}class ls{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<pi}getViewportCorrectionPadding(){const e=this._vh-this._vw/pi,t=Math.max(Math.min(e-50,50),0);return{top:Math.max(e-t,0),bottom:t}}}class cs{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:zt.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 Ye?o.filter:null;this.title=this.story.statTitle,this.tags=this.story.tags,this.slidesCount=this.story.slidesCount,this.ugcPayload=n===Fe.UGC?this.story.ugcPayload:null,this.feedSlug=n===Fe.DEFAULT?l:null,this.filter=c,this.actionSource=null!=n?this.getStorySourceByFeedType(n):zt.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 Fe.DEFAULT:case Fe.UGC:return zt.list;case Fe.FAVORITE:return zt.favorite;case Fe.ONBOARDING:return zt.onboarding;default:return zt.list}}}class ds extends cs{get name(){return"closeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class hs extends cs{get name(){return"closeStoryReader"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{action:this.payload.action})}}class us extends cs{get name(){return"dislikeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class ps extends cs{get name(){return"favoriteStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class gs extends cs{get name(){return"likeStory"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.value})}}class fs extends cs{get name(){return"shareStory"}}class ms extends cs{get name(){return"shareStoryWithPath"}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{value:this.payload.url})}}class ys extends cs{get name(){return"showSlide"}}class vs extends cs{get name(){return"showStory"}toJSON(){const e=super.toJSON();return e.payload=null,e}}class bs{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}}}var 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};let xs=(()=>{var e,t,r,i;let s,a,o,n,l,c,d,h,u,p,g,f,m=[],y=[],v=[],w=[],S=[],_=[],O=[];return e=class{get _activeStory(){return _s(this,t,"f")}set _activeStory(e){Os(this,t,e,"f")}get _currentIndex(){return _s(this,r,"f")}set _currentIndex(e){Os(this,r,e,"f")}get _targetTransitionIndex(){return _s(this,i,"f")}set _targetTransitionIndex(e){Os(this,i,e,"f")}constructor(e,s,a){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(ws(this,m),e)}),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"statistics",{enumerable:!0,configurable:!0,writable:!0,value:a}),t.set(this,ws(this,y,null)),r.set(this,(ws(this,v),ws(this,w,0))),i.set(this,(ws(this,S),ws(this,_,-1))),Object.defineProperty(this,"animatedNavigationController",{enumerable:!0,configurable:!0,writable:!0,value:(ws(this,O),null)}),Object.defineProperty(this,"currentStoryDisplayStrategy",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_activeStoryStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0})}get reachStart(){return 0===this._currentIndex}get reachEnd(){return this._currentIndex===this.storyReader.stories.length-1}get targetTransitionStory(){return this.storyReader.stories[this._targetTransitionIndex]}get targetTransitionIndex(){return this._targetTransitionIndex}get activeStory(){return this._activeStory}get currentIndex(){return this._currentIndex}get activeStoryDuration(){return Date.now()-this._activeStoryStartTime}setAnimatedNavigationController(e){this.animatedNavigationController=e}setCurrentStoryDisplayStrategy(e){this.currentStoryDisplayStrategy=e}nextStory(){this.reachEnd||this.setActiveStoryByIndex(this._currentIndex+1)}prevStory(){this.reachStart||this.setActiveStoryByIndex(this._currentIndex-1)}nextStoryWithAnimation(e){this.storyReader.reachEnd?this.handleStoryReaderReachEnd(e):this.navigateStoryWithAnimation(this._currentIndex+1,e)}prevStoryWithAnimation(e){this.reachStart||this.navigateStoryWithAnimation(this.currentIndex-1,e)}destroy(){this._activeStory=null}setActiveStoryById(e){const t=this.storyReader.stories.findIndex((t=>t.id===e));if(-1===t)throw new Error(`[IAS]: No story found with ID ${e}`);return this.initStoriesWithinRange(t),this.setActiveStoryByIndex(t)}async navigateStoryWithAnimation(e,t="lastSlideClick"){this.animatedNavigationController&&!this.animatedNavigationController.animating&&-1===this._targetTransitionIndex&&(e=this.limitIndex(e),this._targetTransitionIndex=e,this.currentStoryDisplayStrategy.handleNextStoryByIndex(e),this.initStoriesWithinRange(e),await this.animatedNavigationController.transitionByIndex(e,this.currentIndex),await this.handleTransitionEnd(e,t))}handleStoryReaderReachEnd(e){var t;e!==Us.CloseByTimer?this.storyReader.close(Us.CloseByLastSlideClick):(null===(t=this.animatedNavigationController)||void 0===t?void 0:t.options.closeOnLastSlideByTimer)&&this.storyReader.close(Us.CloseByTimer)}async handleTransitionEnd(e,t){this.activeStory&&this.storyManager.emitEvent(new ds(this.activeStory,{action:t})),await this.setActiveStoryByIndex(e),this._targetTransitionIndex=-1}async setActiveStoryByIndex(e){const t=this._currentIndex,r=this._activeStory,i=this.storyReader.stories[e];if(i)return await this.updateActiveStory(e,r,i),this.statistics.emitTransitionEvents(t,e,r,i,this.activeStoryDuration),this.handleActiveStoryError(this._activeStory),i.markAsOpened(),i}async updateActiveStory(e,t,r){return this._currentIndex=e,this.runNextStory(t,r),this._activeStoryStartTime=Date.now(),this._activeStory=r,r}async runNextStory(e,t){await(null==e?void 0:e.stop()),await t.init(),await t.start()}async initStoriesWithinRange(e){let t=this.storyReader.stories;const r=Math.max(e-1,0),i=Math.min(e+1,t.length-1);return t=t.slice(r,i+1),Promise.all(t.map((e=>e.init())))}handleActiveStoryError(e){(null==e?void 0:e.error)&&this.storyManager.emitEvent(new bs({id:e.id,title:e.title,name:e.error.name,message:e.error.message}))}limitIndex(e){return Math.max(0,Math.min(this.storyReader.stories.length-1,e))}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[b.observable],a=[b.observable],o=[b.observable],n=[b.computed],l=[b.computed],c=[b.computed],d=[b.action],h=[b.action],u=[b.action],p=[b.action],g=[b.action],f=[b.action],Ss(e,null,s,{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:t},y,v),Ss(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:t},w,S),Ss(e,null,o,{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:t},_,O),Ss(e,null,n,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:t},null,m),Ss(e,null,l,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:t},null,m),Ss(e,null,c,{kind:"getter",name:"targetTransitionStory",static:!1,private:!1,access:{has:e=>"targetTransitionStory"in e,get:e=>e.targetTransitionStory},metadata:t},null,m),Ss(e,null,d,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:t},null,m),Ss(e,null,h,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:t},null,m),Ss(e,null,u,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:t},null,m),Ss(e,null,p,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:t},null,m),Ss(e,null,g,{kind:"method",name:"navigateStoryWithAnimation",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimation"in e,get:e=>e.navigateStoryWithAnimation},metadata:t},null,m),Ss(e,null,f,{kind:"method",name:"handleTransitionEnd",static:!1,private:!1,access:{has:e=>"handleTransitionEnd"in e,get:e=>e.handleTransitionEnd},metadata:t},null,m),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var ks=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},Cs=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 Ps=(()=>{var e;let t,r=[];return e=class{constructor(e,t){Object.defineProperty(this,"showMultipleStoriesStrategy",{enumerable:!0,configurable:!0,writable:!0,value:(ks(this,r),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,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._feed=s;const a=this.getFeedLoadEvent(s.slug,s.stories);return this.emitFeedLoad(a),s.stories.length?(await this.showMultipleStoriesStrategy.show({windowReferer:$t.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,tags:[],slidesCount:null};return e&&(t.title=e.statTitle,t.tags=e.tags,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)}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[S],Cs(e,null,t,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:i},null,r),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();class js{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 Es{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})}async reload(e){return this.showStoryStrategy.reload(e)}async handleNextStoryByIndex(e){}}var Is=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},Ms=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 Ts=(()=>{var e;let t,r=[];return e=class{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Is(this,r),e)}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){try{const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",once:!0});if(r.error)throw r.error;if(r.isOpened)throw new Be(e.storyId.toString());this.openStoryReader(r)}catch(e){throw this.storyReaderViewModel.close(),e}}openStoryReader(e){this.storyReaderViewModel.open({windowReferer:$t.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[S],Ms(e,null,t,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:i},null,r),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();var Ls=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},As=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 Rs=(()=>{var e;let t,r=[];return e=class{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Ls(this,r),e)}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}get feed(){return null}async show(e){const t=this.storyManager.rootStore.storyStore,r=await t.fetchStoryById({storyId:e.storyId,feedSlug:"",fetchShareUrl:e.fetchShareUrl});this.openStoryReader(r,e)}openStoryReader(e,t){this.storyReaderViewModel.open({windowReferer:$t.default,id:e.id,stories:[e]})}async handleNextStoryByIndex(e){}async reload(e){}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[S],As(e,null,t,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:i},null,r),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();class Bs{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 Rs(this.storyManager,this.storyReaderViewModel)}createShowStoryOnce(){return new Ts(this.storyManager,this.storyReaderViewModel)}createShowStoryFromSharePage(){return new Es(new Rs(this.storyManager,this.storyReaderViewModel))}createShowOnboardingStories(){return new Ps(new js(this.storyManager,this.storyReaderViewModel),this.storyManager)}createShowMultipleStories(){return new js(this.storyManager,this.storyReaderViewModel)}}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 He?r="favorite":this.storyReader.feed instanceof Ke&&(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}),this.storyManager.emitEvent(new vs(t)),this.storyManager.emitEvent(new ys(t))}emitCloseV2(e,t,r,i){var s;const a=t>e?Et.Next:Et.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})}}var Ns,Fs,Us,Vs=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},Gs=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},Ws=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};!function(e){e.RedirectToStory="redirectToStory",e.CloseStory="closeStory",e.ShowMultipleStories="showMultipleStories",e.ReloadStory="reloadStory"}(Ns||(Ns={})),function(e){e.Close="closeStoryReader"}(Fs||(Fs={})),function(e){e.CloseByBtn="closeReaderByCloseBtn",e.CloseByTimer="auto",e.CloseByEsc="closeReaderByEscBtn",e.CloseByLastSlideClick="lastSlideClick",e.CloseBySwipeDown="swipeDown",e.CloseCustom="customClose",e.AppClose="app-close"}(Us||(Us={}));let $s=(()=>{var e,t,r,i;let a,o,n,l,c,d,h,u,p,g,f,m,y,v,w,S,_,O,x,k=s,C=[],P=[],j=[],E=[],I=[],M=[],T=[];return e=class extends k{get _muted(){return Ws(this,t,"f")}set _muted(e){zs(this,t,e,"f")}get _closeGestureInAction(){return Ws(this,r,"f")}set _closeGestureInAction(e){zs(this,r,e,"f")}get _stories(){return Ws(this,i,"f")}set _stories(e){zs(this,i,e,"f")}constructor(e,s,a,o){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(Vs(this,C),e)}),Object.defineProperty(this,"storyReaderStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"storyReaderStatisticV2Service",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"storyFeedStatisticV1Service",{enumerable:!0,configurable:!0,writable:!0,value:o}),t.set(this,Vs(this,P,!0)),r.set(this,(Vs(this,j),Vs(this,E,!1))),i.set(this,(Vs(this,I),Vs(this,M,b.observable.array()))),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:(Vs(this,T),new hr(window))}),Object.defineProperty(this,"windowReferer",{enumerable:!0,configurable:!0,writable:!0,value:$t.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 rr({touchStartTimeout:200})}),Object.defineProperty(this,"navigationController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"useModernLayout",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.handleWindowUnload=this.handleWindowUnload.bind(this),this.handleKeydown=this.handleKeydown.bind(this),window.addEventListener("beforeunload",this.handleWindowUnload),this.storyDisplayStrategyFactory=new Bs(e,this),this.navigationController=new xs(this.storyManager,this,new Ds(this,this.storyManager,this.storyReaderStatisticV1Service,this.storyFeedStatisticV1Service,this.storyReaderStatisticV2Service))}get targetTransitionIndex(){return this.navigationController.targetTransitionIndex}get targetTransitionStory(){return this.navigationController.targetTransitionStory}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.navigationController.activeStory}get dir(){return this.storyManager.config.dir}get isOpened(){return Boolean(this.navigationController.activeStory)}get activeStoryIndex(){return this.navigationController.currentIndex}get reachStart(){return this.navigationController.reachStart||this._stories[0]===this.targetTransitionStory}get reachEnd(){return this.navigationController.reachEnd||this._stories[this._stories.length-1]===this.targetTransitionStory}open(e){var t,r;this.activeStory&&this.resetReaderToDefaultState(this.activeStory),this.windowReferer=e.windowReferer,this.setStories(e.stories);this.navigationController.setActiveStoryById(e.id);this.navigationController.setCurrentStoryDisplayStrategy(this._currentStoryDisplayStrategy),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.setScrollBar(e.windowReferer),document.addEventListener("keydown",this.handleKeydown)}close(e=Us.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(Fs.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}),this.storyManager.emitEvent(new hs(e,{action:t}))}emitStatisticV2StoryCloseEvent(e,t){var r;this.storyReaderStatisticV2Service.sendCloseReaderEvent({action:t,totalSlides:e.slidesCount,durationMs:this.navigationController.activeStoryDuration,storyId:e.id,activeSlideIndex:e.activeSlideIndex,feedSlug:null===(r=this.feed)||void 0===r?void 0:r.slug})}resetReaderToDefaultState(e,t){this.storyManager.emitEvent(new ds(e,{action:t})),this.resetScrollBar(this.windowReferer);const r=e.id,i=e.activeSlideIndex;this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:r,slideIndex:i}),e.markAsOpened(),this.storyReaderStatisticV1Service.destroy(),this.clearStoryViewModels(),this._touchController.destroy(),document.removeEventListener("keydown",this.handleKeydown),this.navigationController.destroy()}canBeClosed(){return!!this.activeStory&&!this.activeStory.disableClose}async showStory(e){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStory(),await this._currentStoryDisplayStrategy.show({storyId:e})}async showStoryOnce(e){this._currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStoryOnce(),await this._currentStoryDisplayStrategy.show({storyId:e})}async showStoryFromSharePage(e){const t=this.storyDisplayStrategyFactory.createShowStoryFromSharePage();this._currentStoryDisplayStrategy=t,await t.show({storyId:e,fetchShareUrl:this.storyManager.isStatisticsDisabled})}async showOnboardingStories(e){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:$t.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(){return this.navigationController.nextStory()}prevStory(){return this.navigationController.prevStory()}nextStoryWithAnimation(e){return this.navigationController.nextStoryWithAnimation(e)}prevStoryWithAnimation(e){return this.navigationController.prevStoryWithAnimation(e)}toStoryWithAnimationByIndex(e){if(this.activeStoryIndex!==e)return this.navigationController.navigateStoryWithAnimation(e,"")}navigateStoryWithAnimationByIndex(e,t){this.navigationController.navigateStoryWithAnimation(e,t)}destroy(){this.activeStory&&(this.emitCloseEvents(this.activeStory,Us.AppClose),this.resetReaderToDefaultState(this.activeStory)),this.removeAllListeners(),window.removeEventListener("beforeunload",this.handleWindowUnload)}closeGoodsWidget(){var e;null===(e=this.activeStory)||void 0===e||e.goodsWidget.close()}setAnimatedNavigationController(e){this.navigationController.setAnimatedNavigationController(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 ss(this.storyManager,this,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service);for(const r of e)this._stories.push(new bi(this.storyManager,this,r,t,this.storyReaderStatisticV1Service,this.storyReaderStatisticV2Service))}handleKeydown(e){this.handleEscKeydown(e),this.handleArrowKeydown(e)}handleEscKeydown(e){"Escape"===e.code&&this.close(Us.CloseByEsc)}handleArrowKeydown(e){"ArrowRight"===e.code&&this.goNext(),"ArrowLeft"===e.code&&this.goPrev()}clearStoryViewModels(){for(const e of this._stories)e.destroy();this._stories=b.observable.array()}setScrollBar(e){e===$t.default&&this.scrollbarHelper.enable()}resetScrollBar(e){e===$t.default&&this.scrollbarHelper.disable()}handleWindowUnload(e){this.activeStory&&(this.emitStatisticV2StoryCloseEvent(this.activeStory,Us.AppClose),this.storyReaderStatisticV1Service.sendOpenStoryEvent({storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),this.storyReaderStatisticV1Service.sendData())}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{var t;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=k[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[b.observable],o=[b.observable],n=[b.observable],l=[b.computed],c=[b.computed],d=[b.computed],h=[b.action],u=[b.action],p=[b.action],g=[b.action],f=[b.action],m=[b.action],y=[b.action],v=[b.action],w=[b.action],S=[b.action],_=[b.action],O=[b.action],x=[b.action],Gs(e,null,a,{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},P,j),Gs(e,null,o,{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},E,I),Gs(e,null,n,{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},M,T),Gs(e,null,l,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:r},null,C),Gs(e,null,c,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:r},null,C),Gs(e,null,d,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:r},null,C),Gs(e,null,h,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:r},null,C),Gs(e,null,u,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:r},null,C),Gs(e,null,p,{kind:"method",name:"reloadStory",static:!1,private:!1,access:{has:e=>"reloadStory"in e,get:e=>e.reloadStory},metadata:r},null,C),Gs(e,null,g,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:r},null,C),Gs(e,null,f,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:r},null,C),Gs(e,null,m,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:r},null,C),Gs(e,null,y,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:r},null,C),Gs(e,null,v,{kind:"method",name:"toStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"toStoryWithAnimationByIndex"in e,get:e=>e.toStoryWithAnimationByIndex},metadata:r},null,C),Gs(e,null,w,{kind:"method",name:"navigateStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimationByIndex"in e,get:e=>e.navigateStoryWithAnimationByIndex},metadata:r},null,C),Gs(e,null,S,{kind:"method",name:"mute",static:!1,private:!1,access:{has:e=>"mute"in e,get:e=>e.mute},metadata:r},null,C),Gs(e,null,_,{kind:"method",name:"unmute",static:!1,private:!1,access:{has:e=>"unmute"in e,get:e=>e.unmute},metadata:r},null,C),Gs(e,null,O,{kind:"method",name:"enableCloseGesture",static:!1,private:!1,access:{has:e=>"enableCloseGesture"in e,get:e=>e.enableCloseGesture},metadata:r},null,C),Gs(e,null,x,{kind:"method",name:"disableCloseGesture",static:!1,private:!1,access:{has:e=>"disableCloseGesture"in e,get:e=>e.disableCloseGesture},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:"StoryReaderViewModel"}),e})();class Hs{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new it,t=new ha(this.storyManager,e);return new $s(this.storyManager,t,new ua(this.storyManager,new st(this.storyManager)),new et(this.storyManager,e))}}class qs extends jt{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 Us.CloseByBtn:return Et.ButtonClose;case Us.CloseByTimer:return Et.AutoClose;case Us.CloseByEsc:return Et.ButtonClose;case Us.CloseByLastSlideClick:return Et.AutoClose;case Us.CloseBySwipeDown:return Et.SwipeClose;case Us.CloseCustom:return Et.CustomClose;case Us.AppClose:return Et.AppClose;default:Et.AppClose}}}class Zs extends jt{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 Ks extends jt{constructor(e){super(e),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:e})}get type(){return"dislike"}}class Qs extends jt{constructor(e){super(e)}get type(){return"favorite"}}class Ys extends jt{constructor(e){super(e)}get type(){return"like"}}class Xs extends jt{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 Js extends jt{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 ea extends jt{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 ta extends jt{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 ra extends jt{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 ia extends jt{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 sa{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 aa{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 oa{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 na{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 la{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(){v(`[${ha.name}]: flush statistics by timer`);this.statisticsService.getEvents().length>0?this.schedule(1e4):this.schedule(3e4),await this.statisticsService.sendData()}schedule(e){v(`[${ha.name}]: schedule flush statistics on ${e}ms`),this.timerId=setTimeout((()=>this.flush()),e)}}class ca{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 da{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 ha extends(t()){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 la(this),this.slideDurationCalculator=new ca}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 da(1,this.lastIndex,e.storyId,e.slideIndex,t);this.addSlideEvent(r)}sendClickOnButtonEvent(e){const t=this.slideDurationCalculator.calculate(),r=new da(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)===Qe}}class ua{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 ra(e))}sendOpenEvent(e){this.sendEvent(new Zs(e))}sendCloseEvent(e){this.sendEvent(new Mt(e))}sendCloseReaderEvent(e){this.sendEvent(new qs(e))}sendSlideLayout(e){this.sendEvent(new Js(e))}sendLinkEvent(e){this.sendEvent(new ea(e))}sendLikeEvent(e){this.sendEvent(new Ys(e))}sendDislikeEvent(e){this.sendEvent(new Ks(e))}sendFavoriteEvent(e){this.sendEvent(new Qs(e))}sendShareEvent(e){this.sendEvent(new Xs(e))}sendSlideEvent(e){this.sendEvent(new ta(e))}sendWidgetEvent(e,t=!1){this.sendEvent(new ia(e),t)}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class pa 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 ga="en-US";class fa{constructor(e=ga){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 pa(e).message),this.getNavigatorTag())}getNavigatorTag(){const e=navigator.language.toLowerCase();return this.isValidTag(e)?e:(console.error(`Invalid navigator language tag: ${e}`),ga)}parseTag(e){const[t,r]=e.split("-");this.languageCode=t,this.countryCode=r.toUpperCase(),this.tag=`${this.languageCode}-${this.countryCode}`}}var ma=I(7144),ya=I.n(ma);class va extends Error{constructor(){super("[IAS]: you must pass the <userId> value"),this.name="IasEmptyUserIdError"}}class ba extends Error{constructor(e,t){super(`[IAS]: tags (joined by ',') "${e.join(",")}" is bigger then ${t} bytes`),this.name="IasTagsLengthError"}}class wa extends Error{constructor(e,t){super(`[IAS]: userId "${e}" is bigger then ${t} bytes`),this.name="IasUserIdLengthError"}}var Sa,_a=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},xa=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)},ka=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.RequestSDKReload="requestSDKReload"}(Sa||(Sa={}));let Ca=(()=>{var t,r,i,s,a,o;let n,l,c,d,u,p,g=e.EventEmitter,f=[],m=[],y=[],v=[],w=[],_=[],O=[],x=[],C=[],P=[],j=[];return t=class extends g{get _apiKey(){return xa(this,r,"f")}set _apiKey(e){ka(this,r,e,"f")}get _tags(){return xa(this,i,"f")}set _tags(e){ka(this,i,e,"f")}get _lang(){return xa(this,s,"f")}set _lang(e){ka(this,s,e,"f")}get _dir(){return xa(this,a,"f")}set _dir(e){ka(this,a,e,"f")}get _userId(){return xa(this,o,"f")}set _userId(e){ka(this,o,e,"f")}constructor(e,t){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(_a(this,f),e)}),r.set(this,_a(this,m,"")),i.set(this,(_a(this,y),_a(this,v,[]))),s.set(this,(_a(this,w),_a(this,_,new fa))),a.set(this,(_a(this,O),_a(this,x,Kt.LTR))),Object.defineProperty(this,"_disableDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:(_a(this,C),!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}),o.set(this,_a(this,P,"")),Object.defineProperty(this,"_userIdSign",{enumerable:!0,configurable:!0,writable:!0,value:_a(this,j)}),Object.defineProperty(this,"_isInited",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.updateByDto(t),this._isInited=!0}get userId(){return this._userId}get userIdSign(){return this._userIdSign}get isStatisticsDisabled(){return this._isStatisticsDisabled||"com.inappstory.webpreview"===this._appPackageId}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===Kt.LTR}disableStatistic(){this._isStatisticsDisabled=!0}enableStatistic(){this._isStatisticsDisabled=!1}async setApiKey(e){this._apiKey!==e&&(!function(e){const t=ne(e);if(t){const e=t.split(".").slice(1);oe.baseUrl=`https://${["cdn",...e].join(".")}`,oe.faviconApiUrl=`https://${["favicon",...e].join(".")}`,oe.apiUrl=`https://${t}`}ae.baseURL=`${oe.apiUrl}/v2/`}(e),this._apiKey=e,this._isInited&&await this.reloadSdk())}async setUserId(e,t){if(this._disableDeviceId&&(null==e||""===e))throw new va;(T()(e)||ya()(e))&&this._userId!==e&&((new ja).checkUserIdLength(e.toString()).validate(),this._userId=e,this._userIdSign=t,this._isInited&&await this.reloadSdk())}async setLang(e){e&&T()(e)&&this._lang.toRawData()!==e&&(this._lang=new fa(e),this._isInited&&await this.reloadSdk())}setTextPlaceholders(e={}){if(!h()(e))return;const t=this.mapTextPlaceholders(e);Ze()(this._textPlaceholders,t)||(this._textPlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._textPlaceholders))}setImagePlaceholders(e={}){if(!h()(e))return;const t=this.mapImagePlaceholders(e);Ze()(this._imagePlaceholders,t)||(this._imagePlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._imagePlaceholders))}setTags(e){Ze()(this._tags,e)||((new ja).checkTagsLength(e).validate(),this._tags=k(e))}setDir(e){var t;this._dir=e?e.toString():null!==(t=getComputedStyle(document.documentElement).direction)&&void 0!==t?t:Kt.LTR}updateByDto(e){var t,r,i,s,a;this._appPackageId=null!==(t=e.appPackageId)&&void 0!==t?t:"",this._disableDeviceId=Boolean(e.disableDeviceId),this.setApiKey(e.apiKey),this.setUserId(null!==(r=e.userId)&&void 0!==r?r:"",e.userIdSign),this.setLang(e.lang),this.setTextPlaceholders(null!==(i=e.placeholders)&&void 0!==i?i:{}),this.setImagePlaceholders(null!==(s=e.imagePlaceholders)&&void 0!==s?s:{}),this.setTags(null!==(a=e.tags)&&void 0!==a?a:[]),this.setDir(e.dir)}mapTextPlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new Le(r,i));return t}mapImagePlaceholders(e){const t=[];for(const[r,i]of Object.entries(e))t.push(new Te(r,i));return t}async reloadSdk(){try{this.emit(Sa.RequestSDKReload),this.storyManager.rootStore.sessionStore.close(),this.storyManager.closeAllReaders(),await this.storyManager.reloadAllStoryLists(),await this.storyManager.reloadAllStackedStoryLists()}catch(e){console.error(e)}}},r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,(()=>{var e;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=g[Symbol.metadata])&&void 0!==e?e:null):void 0;n=[b.observable],l=[b.observable],c=[b.observable],d=[b.observable],u=[b.observable],p=[S],Oa(t,null,n,{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},m,y),Oa(t,null,l,{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},v,w),Oa(t,null,c,{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),Oa(t,null,d,{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,C),Oa(t,null,u,{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},P,j),Oa(t,null,p,{kind:"method",name:"reloadSdk",static:!1,private:!1,access:{has:e=>"reloadSdk"in e,get:e=>e.reloadSdk},metadata:r},null,f),r&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),t})();class Pa{get userId(){return""}get userIdSign(){return""}get isStatisticsDisabled(){return!1}get appPackageId(){return""}get apiKey(){return""}get tags(){return[]}get lang(){return new fa}get disableDeviceId(){return!1}get textPlaceholders(){return[]}get imagePlaceholders(){return[]}get dir(){return Kt.LTR}get isLtr(){return!0}disableStatistic(){}enableStatistic(){}async setApiKey(e){}async setUserId(e,t){}async setLang(e){}setTextPlaceholders(e){}setImagePlaceholders(e){}setTags(e){}setDir(e){}updateByDto(e){}on(e,t){return this}off(e,t){return this}emit(e,...t){}}class ja{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 wa(e,255)),this}checkTagsLength(e){return e.length>0&&this.getByteLength(e.join(","))>4e3&&this.errors.push(new ba(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,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 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},Ma=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},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)},La=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 Aa=(0,a.v4)();let Ra=(()=>{var e,t,r,i,s,o,n,l,c,d;let h,u,p,g,f,m,y,v,w,S,_=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],M=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],F=[],U=[];return e=class{get _id(){return Ta(this,t,"f")}set _id(e){La(this,t,e,"f")}get _events(){return Ta(this,r,"f")}set _events(e){La(this,r,e,"f")}get _type(){return Ta(this,i,"f")}set _type(e){La(this,i,e,"f")}get _slides(){return Ta(this,s,"f")}set _slides(e){La(this,s,e,"f")}get _appearanceOptions(){return Ta(this,o,"f")}set _appearanceOptions(e){La(this,o,e,"f")}get _needPlaceholders(){return Ta(this,n,"f")}set _needPlaceholders(e){La(this,n,e,"f")}get _hasLimit(){return Ta(this,l,"f")}set _hasLimit(e){La(this,l,e,"f")}get _isOnceOpened(){return Ta(this,c,"f")}set _isOnceOpened(e){La(this,c,e,"f")}get _context(){return Ta(this,d,"f")}set _context(e){La(this,d,e,"f")}constructor(e){t.set(this,(Ia(this,_),Ia(this,O,void 0))),r.set(this,(Ia(this,x),Ia(this,k,{}))),i.set(this,(Ia(this,C),Ia(this,P,void 0))),s.set(this,(Ia(this,j),Ia(this,E,[]))),o.set(this,(Ia(this,I),Ia(this,M,new fe({})))),n.set(this,(Ia(this,T),Ia(this,L,!1))),l.set(this,(Ia(this,A),Ia(this,R,!1))),c.set(this,(Ia(this,B),Ia(this,D,!1))),d.set(this,(Ia(this,N),Ia(this,F,void 0))),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:(Ia(this,U),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:Aa}),this._id=e,this._context=new Ea(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(){return(!this._displayFrom||Date.now()>=this._displayFrom)&&(!this._displayTo||Date.now()<=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}destroy(){}updateByDto(e){var t,r,i;this._events=this.mapMessageEventsByDto(null!==(t=e.events)&&void 0!==t?t:[]),this._type=e.type,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 Se).create(this._type,e.appearance),this._needPlaceholders=e.need_placeholders,this.updateMessageSlides(e.slides_html)}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 Ce(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,a.v4)(),this._openTime=Date.now(),this._iterationId}updatePlaceholders(e){for(const t of this._slides)t.updatePlaceholders(e)}},t=new WeakMap,r=new WeakMap,i=new WeakMap,s=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=[b.observable],u=[b.observable],p=[b.observable],g=[b.observable],f=[b.observable],m=[b.observable],y=[b.observable],v=[b.observable],w=[b.observable],S=[b.action],Ma(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},O,x),Ma(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},k,C),Ma(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},P,j),Ma(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},E,I),Ma(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,T),Ma(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},L,A),Ma(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},R,B),Ma(e,null,v,{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},D,N),Ma(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},F,U),Ma(e,null,S,{kind:"method",name:"updateByDto",static:!1,private:!1,access:{has:e=>"updateByDto"in e,get:e=>e.updateByDto},metadata:t},null,_),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Ba{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,a.v4)()})}toQueryParams(){return{ei:this.eventId,ii:this.iterationId,si:this.slideIndex,st:this.slideTotal}}}class Da extends Ba{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})}}class Na extends Ba{constructor(e){super(e.iterationId,e.slideIndex,e.slidesTotal)}get type(){return"open"}}class Fa extends Ba{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 Ua{constructor(e){Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:e})}async sendOpenEvent(e){const t=new Na(e);await this.iamApi.emitMessageEvent(e.messageId,t)}async sendCloseEvent(e){const t=new Da(e);await this.iamApi.emitMessageEvent(e.messageId,t)}async sendWidgetEvent(e){const t=new Fa(e);return this.iamApi.emitMessageEvent(e.messageId,t)}}class Va extends Error{constructor(){super("[IAM]: you must close other opened readers"),this.name="IamOtherReaderIsOpenError"}}class Ga extends Error{constructor(){super("[IAM]: you need preload in app messages"),this.name="IamShowOnlyIfLoadedError"}}class Wa extends Error{constructor(){super("[IAM]: show message frequency limit exceeded"),this.name="IamFrequencyLimitError"}}class za extends Error{constructor(){super("[IAM]: not in display time range"),this.name="IamCheckDisplayTimeRangeError"}}class $a extends Error{constructor(e){super(`[IAM]: the limit for displaying IAM with ID ${e} has been reached`),this.name="IamMessageLimitExceededError"}}class Ha{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 Va),this}checkShowOnlyIfLoaded(e){return!this.iamStore.isLoaded&&e&&this.errors.push(new Ga),this}checkFrequencyLimit(e){return e.frequencyLimitTimeExceeded&&this.errors.push(new Wa),this}checkDisplayTimeRange(e){return e.withinDisplayTimeRange||this.errors.push(new za),this}validate(){if(this.errors.length>0)throw this.errors.shift()}}class qa{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 Ha(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 Ha(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 Ha(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 $a(e)}getMessagesSortedByEventPriority(e,t){return t.slice().sort(((t,r)=>{const i=t.events[e].priority;return r.events[e].priority-i}))}}var Za,Ka,Qa;!function(e){e[e.BottomSheet=1]="BottomSheet",e[e.Modal=2]="Modal",e[e.Fullscreen=3]="Fullscreen"}(Za||(Za={})),function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(Ka||(Ka={})),function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right"}(Qa||(Qa={}));class Ya{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 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 Ja{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{create(e,t){switch(e){case Za.BottomSheet:return new Xa(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case Za.Modal:return new Ja(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case Za.Fullscreen:return new Ya(t.vw,t.vh)}}}class to{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,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r})}get contentRatio(){return this._contentRatio}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}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,"_contentRatio",{enumerable:!0,configurable:!0,writable:!0,value:r})}get contentRatio(){return this._contentRatio}get vw(){return this._vw}get vh(){return this._vh}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return Math.ceil(this._vh*this._contentRatio)}calculateHeight(){return this._vh}}class io{}class so extends io{constructor(e,t,r){super(),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})}get contentRatio(){return this._contentRatio}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}class ao extends io{constructor(e,t,r){super(),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})}get contentRatio(){return this._contentRatio}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}calculateWidth(){return Math.ceil(this.calculateHeight()*this._contentRatio)}calculateHeight(){return this._vh}}class oo{constructor(){}create(e){const t=this.getViewportParams(e);return this.isFullscreen(e,t)?this.createFullscreenSlideGeometry(t):this.createWideOrSquareGeometry(t)}isFullscreen(e,t){return e instanceof Ya}createWideOrSquareGeometry(e){return e.viewportRatio>e.contentRatio?new to(e.vw,e.vh,e.contentRatio):new ro(e.vw,e.vh,e.contentRatio)}getViewportParams(e){return{vw:e.getWidth(),vh:e.getHeight(),viewportRatio:e.getWidth()/e.getHeight(),contentRatio:e.contentRatio}}createFullscreenSlideGeometry(e){return e.viewportRatio>e.contentRatio?new ao(e.vw,e.vh,e.contentRatio):new so(e.vw,e.vh,e.contentRatio)}}var no=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},lo=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},co=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)},ho=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 uo=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _disabledNextClick(){return co(this,t,"f")}set _disabledNextClick(e){ho(this,t,e,"f")}constructor(e,r,i){Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:(no(this,s),e)}),Object.defineProperty(this,"iamMessageSlide",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toast",{enumerable:!0,configurable:!0,writable:!0,value:null}),t.set(this,no(this,a,!1)),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:(no(this,o),new Pr.Mutex)}),Object.defineProperty(this,"handleTouchEnd",{enumerable:!0,configurable:!0,writable:!0,value:({dy:e})=>{this.message.touchController&&e<10&&this.message.touchController.verticalSwipeGesture&&this.slideApi.slideSwipeUpHandler()}}),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}get isLoading(){return 0==this.slideApi.state}get html(){return this.iamMessageSlide.html}get state(){return this.slideApi.state}get navigationDisabled(){return this._disabledNextClick}async reload(){return this.slideApi.slideRestart({muted:!1})}mute(){this.slideApi.disableAudio()}unmute(){this.slideApi.enableAudio()}notifyTimerEnd(){this.slideApi.slideTimerEnd()}pauseAndLock(){return this.locked=!0,this.pauseByApp()}resumeAndUnlock(){return this.locked=!1,this.resumeByApp()}async showLayerByIndex(e){this.slideApi.showLayer(e)}setUserData(e,t){this.slideApi.setTextInputResult(e,t)}setShareComplete(e,t){this.slideApi.setShareComplete(e,t)}notifySwipeUp(e){this.slideApi.slideSwipeUpHandler()}showToast(e){this.toast=new sr(Object.assign(Object.assign({},e),{mountPoint:this.message.$root})),this.toast.show(e.content)}handleDocumentVisibilityChange(){this.locked||("hidden"===document.visibilityState&&this.pauseByApp(),"visible"===document.visibilityState&&this.resumeByApp())}async init(){const e=await this.mutex.acquire();let t=!1;const r=setTimeout((()=>{this.message.showLoaderScreen(),t=!0}),500);try{const{result:e,reason:t}=await this.slideApi.showSlide(this.html);if(!e)throw new Error(t)}catch(e){this.handleSlideError(e)}finally{clearTimeout(r),this.cleanupLoaderIfNeeded(t),e()}}async start(){const e=await this.mutex.acquire();try{await this.slideApi.slideStart({muted:!0}),this.message.touchController.on(Qt.TouchEnd,this.handleTouchEnd),document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange)}catch(e){this.handleSlideError(e)}finally{e()}}async restart(){const e=await this.mutex.acquire();try{this.message.hideErrorScreen(),this.message.showLoaderScreen(),await this.slideApi.slideRestart({muted:!0})}catch(e){this.handleSlideError(e)}finally{this.message.hideLoaderScreen(),e()}}async resumeByApp(){const e=await this.mutex.acquire();try{await this.slideApi.slideAppResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByApp(){const e=await this.mutex.acquire();try{await this.slideApi.slideAppPause()}catch(e){this.handleSlideError(e)}finally{e()}}async resumeByUser(){const e=await this.mutex.acquire();try{await this.slideApi.slideUserResume()}catch(e){this.handleSlideError(e)}finally{e()}}async pauseByUser(){const e=await this.mutex.acquire();try{await this.slideApi.slideUserPause()}catch(e){this.handleSlideError(e)}finally{e()}}async stop(){var e;const t=await this.mutex.acquire();try{await this.slideApi.slideStop({prepareForRestart:1}),this.message.touchController.off(Qt.TouchEnd,this.handleTouchEnd),document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange),null===(e=this.toast)||void 0===e||e.destroy()}catch(e){this.handleSlideError(e)}finally{t()}}onClick(e,t){if(!e.target)return;e.preventDefault(),e.stopPropagation();const r=this.getNavigationDirection(e,t),{canClickNext:i}=this.slideApi.slideClickHandler(e.target,r);this._disabledNextClick=!i}destroy(){}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))}handleSlideError(e){console.error(e),this.message.showErrorScreen(),this.message.touchController.off(Qt.TouchEnd,this.handleTouchEnd)}delay(e){return new Promise((t=>setTimeout(t,e)))}async cleanupLoaderIfNeeded(e){e&&(await this.delay(500),this.message.hideLoaderScreen())}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],i=[b.computed],lo(e,null,r,{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},a,o),lo(e,null,i,{kind:"getter",name:"isLoading",static:!1,private:!1,access:{has:e=>"isLoading"in e,get:e=>e.isLoading},metadata:t},null,s),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();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){var t;try{await this.storyManager.openGame(e.gameInstanceId),null===(t=this.iamMessage.activeSlide)||void 0===t||t.pauseAndLock(),this.storyManager.gameReader.once(Vi.Close,(()=>{var e;null===(e=this.iamMessage.activeSlide)||void 0===e||e.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});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(`[IAM]: you must close IAM with ID ${e}`),this.name="IamMessageOpenError"}}var mo,yo=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},vo=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},bo=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)},wo=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"}(mo||(mo={}));let So=(()=>{var e,t;let r,i,a,o,n=s,l=[],c=[],d=[];return e=class extends n{get _activeMessage(){return bo(this,t,"f")}set _activeMessage(e){wo(this,t,e,"f")}constructor(e,r,i,s){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(yo(this,l),e)}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"iamDisplayService",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,yo(this,c,null)),Object.defineProperty(this,"visibilityObserver",{enumerable:!0,configurable:!0,writable:!0,value:yo(this,d)}),Object.defineProperty(this,"_touchController",{enumerable:!0,configurable:!0,writable:!0,value:new rr}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new hr(window)}),Object.defineProperty(this,"eventPublisher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),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)}async preload(e){await this.storyManager.waitStoryManagerConfig();return await this.iamStore.preload(e)}async showMessageById(e,t){await this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const r=await this.iamDisplayService.getMessageById(e,t);return await this.open(r),r}async showMessageByEvent(e,t){await this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const r=await this.iamDisplayService.getMessageByEvent(e,t);return await this.open(r),r}async close(){this._activeMessage&&(this.emitCloseEvent(this._activeMessage),this.clearActiveMessage(),this.visibilityObserver.unsubscribe(),this.touchController.destroy(),this.scrollbarHelper.enable())}async open(e){e.updatePlaceholders(this.storyManager.rootStore.placeholderStore.placeholders),this.touchController.init(document.body),this.setActiveMessage(e),this.visibilityObserver.subscribe(),this.scrollbarHelper.disable()}destroy(){}emitWidgetEvent(e){this.activeMessage&&this.emit(mo.WidgetEvent,{message:this.activeMessage.toPublicDto(),name:e.type,data:e.widgetPayload})}setEventPublisher(e){this.eventPublisher=e}emit(e,...t){return super.emit(e,...t),this.eventPublisher.emit(e,...t)}emitCloseEvent(e){this.emit(mo.Close,{message:e.toPublicDto()})}setActiveMessage(e){const t=this.createIamMessageViewModel(e),{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})}createIamMessageViewModel(e){return new Mo(this,this.storyManager,e,this.iamStatisticsService)}checkMessageNotOpened(){if(this.activeMessage)throw new fo(this.activeMessage.id)}},t=new WeakMap,(()=>{var t;const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=n[Symbol.metadata])&&void 0!==t?t:null):void 0;r=[b.observable],i=[b.action],a=[b.action],o=[b.action],vo(e,null,r,{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:s},c,d),vo(e,null,i,{kind:"method",name:"showMessageById",static:!1,private:!1,access:{has:e=>"showMessageById"in e,get:e=>e.showMessageById},metadata:s},null,l),vo(e,null,a,{kind:"method",name:"showMessageByEvent",static:!1,private:!1,access:{has:e=>"showMessageByEvent"in e,get:e=>e.showMessageByEvent},metadata:s},null,l),vo(e,null,o,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:s},null,l),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:"IamReaderViewModel"}),e})();class _o{constructor(e){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventEmitter",{enumerable:!0,configurable:!0,writable:!0,value:new(t())}),this.iamReader.setEventPublisher(this.eventEmitter)}get activeMessage(){var e;return null===(e=this.iamReader.activeMessage)||void 0===e?void 0:e.toPublicDto()}get isLoaded(){return this.iamReader.isLoaded}get isLoading(){return this.iamReader.isLoading}get isOpened(){return this.iamReader.isOpened}async preload(e){const t=(await this.iamReader.preload({tags:null==e?void 0:e.tags})).map((e=>e.toPublicDto()));return this.eventEmitter.emit(mo.Loaded,{messages:t}),t}async showMessageById(e,t){return(await this.iamReader.showMessageById(e,{showOnlyIfLoaded:null==t?void 0:t.showOnlyIfLoaded})).toPublicDto()}async showMessageByEvent(e,t){return(await this.iamReader.showMessageByEvent(e,{showOnlyIfLoaded:null==t?void 0:t.showOnlyIfLoaded,tags:null==t?void 0:t.tags})).toPublicDto()}async close(){return this.iamReader.close()}on(e,t){return this.eventEmitter.on(e,t),this}once(e,t){return this.eventEmitter.once(e,t),this}off(e,t){return this.eventEmitter.off(e,t),this}}class Oo{constructor(e,t,r,i){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}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:i})}handle(e){const t=e.linkTarget;this.emitWidgetEvent(t,e.elementId),this.emitClickOnButtonEvent(t,e.elementId)}emitWidgetEvent(e,t){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:"w-link",widgetPayload:{wi:null!=t?t:"",wv:e,wl:""}}),this.iamReader.emitWidgetEvent({type:"w-link",widgetPayload:{wi:null!=t?t:"",wv:e,wl:""}})}emitClickOnButtonEvent(e,t){const r=this.getClickOnButtonEventPayload(e,t);this.iamReader.emit(mo.ClickOnButton,r);const i={src:Bt.IAM_READER,data:r};this.storyManager.emit("clickOnButton",i),this.storyManager.storyLinkClickHandler?this.storyManager.storyLinkClickHandler(i):window.open(r.url,"_self")}getClickOnButtonEventPayload(e,t){return{id:this.iamMessage.id,index:this.iamMessage.activeSlideIndex,url:e,elementId:t}}}class xo{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){var t;try{await this.storyManager.showStory(e.storyId),null===(t=this.message.activeSlide)||void 0===t||t.pauseAndLock(),this.storyManager.storyReader.once(Fs.Close,(()=>{var e;null===(e=this.message.activeSlide)||void 0===e||e.resumeAndUnlock()}))}catch(e){console.error(e)}}}class ko{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 Co{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 ko}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new ko})}clearActiveNarrativeDataCache(){this.activeMessageNarrativeDataCache.clear()}writeToClipboard(e){y(e.textValue)}updateCardServerDataLocally(e){this.iamMessage.context.updateNarrativeData(e)}openUrl(e){"swipeUpItems"!==e.type&&new Oo(this.iamReader,this.storyManager,this.iamMessage,this.iamStatisticsService).handle({linkTarget:e.link.target,elementId:e.elementId})}closeCard(e){this.iamReader.close()}openStory(e,t){new xo(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(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}return null}async sendApiRequest(e,t,r,i,s,a){var o,n,l;try{const a=await ae.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 c)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){var t;null===(t=this.iamMessage.activeSlide)||void 0===t||t.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:t})}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:[]}updateTimeline(e,t,r,i,s,a){s?this.iamMessage.showLoaderScreen():this.iamMessage.hideLoaderScreen(),a?this.iamMessage.showErrorScreen():this.iamMessage.hideErrorScreen()}showToast(e){var t;null===(t=this.iamMessage.activeSlide)||void 0===t||t.showToast({content:e})}}var Po=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},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},Eo=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)},Io=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,a;let o,n,l,c,d,h,u,p,g=s,f=[],m=[],y=[],v=[],w=[],S=[],_=[],O=[],x=[];return e=class extends g{get _isOnceOpened(){return Eo(this,t,"f")}set _isOnceOpened(e){Io(this,t,e,"f")}get _$root(){return Eo(this,r,"f")}set _$root(e){Io(this,r,e,"f")}get _needShowErrorScreen(){return Eo(this,i,"f")}set _needShowErrorScreen(e){Io(this,i,e,"f")}get _needShowLoaderScreen(){return Eo(this,a,"f")}set _needShowLoaderScreen(e){Io(this,a,e,"f")}constructor(e,s,o,n){super(),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:(Po(this,f),e)}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,Po(this,m,!1)),r.set(this,(Po(this,y),Po(this,v,null))),i.set(this,(Po(this,w),Po(this,S,!1))),a.set(this,(Po(this,_),Po(this,O,!1))),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:Po(this,x)}),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.createSlidesViewModels()}}),this.touchController=e.touchController,this.slideApiHandlers=new Co(this.storyManager,this.iamReader,this,this.iamStatisticsService)}get id(){return this.iamMessage.id}get $root(){return this._$root}get activeSlideIndex(){return 0}get activeSlide(){return this._slides[this.activeSlideIndex]}get slides(){return this._slides}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 needShowErrorScreen(){return this._needShowErrorScreen}get needShowLoaderScreen(){return this._needShowLoaderScreen}get timeSinceLastShow(){return this.iamMessage.timeSinceLastShow}open(){this._isOnceOpened=!0;return{iterationId:this.iamMessage.trackOpen()}}async updateUserData(e){return this.storyManager.rootStore.iamStore.updateMessageUserData(this.id,e)}async init(){var e;await(null===(e=this.activeSlide)||void 0===e?void 0:e.init())}async start(){var e;await(null===(e=this.activeSlide)||void 0===e?void 0:e.start())}async stop(){var e;this.slideApiHandlers.clearActiveNarrativeDataCache(),await(null===(e=this.activeSlide)||void 0===e?void 0:e.stop())}toPublicDto(){return this.iamMessage.toPublicDto()}showErrorScreen(){this._needShowErrorScreen=!0}showLoaderScreen(){this._needShowLoaderScreen=!0}hideLoaderScreen(){this._needShowLoaderScreen=!1}hideErrorScreen(){this._needShowErrorScreen=!1}destroy(){var e;null===(e=this.slideApi)||void 0===e||e.destroy()}createSlidesViewModels(){if(this._slides.length>0)return;const e=this.type===Za.Fullscreen,t=new ur.SlideApi(this.slideApiHandlers,{root:this._$root,slideRatio:this.getContentRatio(),isFullscreen:e,nonce:P(),viewport:window,userResizeHandler:void 0,VODPlayer:this.storyManager.globalProperties.$videoOnDemand});this._slides=this.iamMessage.slides.map((e=>new uo(this,e,t))),this.slideApi=t}getContentRatio(){return this.appearanceOptions instanceof me||this.appearanceOptions instanceof be?this.appearanceOptions.contentRatio:9/16}},t=new WeakMap,r=new WeakMap,i=new WeakMap,a=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;o=[b.observable],n=[b.observable],l=[b.observable],c=[b.observable],d=[b.action],h=[b.action],u=[b.action],p=[b.action],jo(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},m,y),jo(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},v,w),jo(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,_),jo(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),jo(e,null,d,{kind:"method",name:"showErrorScreen",static:!1,private:!1,access:{has:e=>"showErrorScreen"in e,get:e=>e.showErrorScreen},metadata:r},null,f),jo(e,null,h,{kind:"method",name:"showLoaderScreen",static:!1,private:!1,access:{has:e=>"showLoaderScreen"in e,get:e=>e.showLoaderScreen},metadata:r},null,f),jo(e,null,u,{kind:"method",name:"hideLoaderScreen",static:!1,private:!1,access:{has:e=>"hideLoaderScreen"in e,get:e=>e.hideLoaderScreen},metadata:r},null,f),jo(e,null,p,{kind:"method",name:"hideErrorScreen",static:!1,private:!1,access:{has:e=>"hideErrorScreen"in e,get:e=>e.hideErrorScreen},metadata:r},null,f),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();class To{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 Lo=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},Ao=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},Ro=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)},Bo=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 Do=(()=>{var e,t;let r,i=s,o=[],n=[];return e=class extends i{get topStory(){return Ro(this,t,"f")}set topStory(e){Bo(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 et(el,new it)}),t.set(this,Ao(this,o,null)),Ao(this,n),this.options=e,this._id=(0,a.v4)(),this.handleShowStory=this.handleShowStory.bind(this),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.subscribeToStoryReader().catch(console.error),el.addStoryFeed(this)}get stories(){return this.storyFeed?this.storyModels.map((e=>new To(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=el.storyReader;null==e||e.off(Fs.Close,this.handleCloseStoryReader),el.off("showStory",this.handleShowStory),this.emit("destroy"),el.removeStoryFeed(this)}async showStory(e){if(!e)return;const t=Jn.instance,r=T()(e.deeplink)&&e.deeplink.trim().length>0,i=e.gameInstanceId;if(!e.hideInReader||r||i){if(r&&null!==e.deeplink){const r={index:0,id:e.id,story:e,isDeeplink:!0,url:e.deeplink},i={src:Bt.STACK_STORY_LIST,data:r};return t.emit("clickOnButton",i),t.storyLinkClickHandler?t.storyLinkClickHandler(i):window.open(e.deeplink,"_self"),void this.markStoryAsOpened(e.id)}if(i)return t.openGame(i).catch(console.error),void this.markStoryAsOpened(e.id);this.storyFeed&&(t.storyReader.showMultipleStories({storyId:e.id,storyFeed:this.storyFeed,windowReferer:$t.stacked}),this.markStoryAsOpened(e.id))}else console.error("[StackedStoryList]: Cannot open hidden story id "+e.id)}async loadStories(){try{this.emit("startLoad"),this.storyFeed=await el.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 To(e,this.storyFeed),this.onUpdateTopStory(this.topStory),this.emit("update",this.topStory)}handleCloseStoryReader(){this.top&&this.markStoryAsShownById(this.top.id)}markStoryAsOpened(e){el.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{el.on("showStory",this.handleShowStory),el.storyReader.on(Fs.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=el.rootStore.storyStore.findStoryById(e);t&&this.storyFeed&&!t.wasShown&&(this.storyFeedImpressionService.sendCoverageEvent([t],this.storyFeed),t.markWasShown())}},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=[b.observable],Lo(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:s},o,n),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();class No{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}createStoryReader(){return new Hs(this.storyManager).create()}createGameReader(){return new qi(this.storyManager).create()}createStoryList(){return new on(this.storyManager).create()}createInAppMessagingReader(){const e=this.storyManager.rootStore.iamStore,t=new ge(this.storyManager),r=new Ua(t);return new So(this.storyManager,e,new qa(this.storyManager,e,t),r)}}class Fo extends s{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 Uo extends Fo{static create(e,t){var r;const i=new Pt({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:Uo.getBgImage(e)});return new Uo(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,${x(e.image.svgSrc.baseState)}`}),t}}class Vo{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){this.storyManager.rootStore.storyStore.markIsOpenedById(e.id);const r={src:Bt.STORY_LIST,data:{id:e.id,index:t.index,isDeeplink:!0,url:e.deeplink}};if(this.storyListViewModel.params.listType!==Fe.UGC&&await this.storyFeedStatisticV1Service.sendDeeplinkClickEvent(e.id),this.storyManager.emit("clickOnButton",r),this.storyManager.storyLinkClickHandler||this.storyManager.listenerCount(Zt.CLICK_ON_STORY)>0)try{this.storyManager.storyLinkClickHandler&&this.storyManager.storyLinkClickHandler(r),this.storyManager.emit(Zt.CLICK_ON_STORY,r)}catch(e){console.error(e)}else window.open(e.deeplink,"_self")}}class Go{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,{})}}class Wo{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?$t.favorite:$t.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,tags:[],slidesCount:null,feed:null,filter:null,source:null};a.title=s.statTitle,a.tags=s.tags,a.slidesCount=s.slidesCount,t.type===Fe.DEFAULT?a.feed=r:t.type===Fe.UGC&&(a.filter=i),a.source=zt.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=T()(s)&&s.trim().length>0,l=null==o?void 0:o.id;return this.isInvalidStoryClick(Boolean(a),n,l,e.id)?null:n?new Vo(t,r,i):l?new Go(t,r):new Wo(t,r)}static isInvalidStoryClick(e,t,r,i){return!(!e||t||r)&&(console.error(`Cannot open hidden story id ${i}`),!0)}}class $o extends Fo{constructor(e,t){super(e,t)}}class Ho extends Fo{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 $o(this.storyListViewModel,e)))}static create(e,t,r){const i=new Pt({id:0,title:e.title.content,title_color:e.title.color,is_opened:!0,background_color:"white"});return new Ho(r,t,i)}}class qo{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 qo(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 qo(e.x,e.y,e.width,e.height)}}class Zo{constructor(){Object.defineProperty(this,"storyRects",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:new qo}),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=qo.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 Ko extends qo{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 Ko(e.id,e.x,e.y,e.width,e.height)}}class Qo{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 qo;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 Ko(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 Yo{create(){const e=new Zo;return new Qo(e)}}class Xo{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,tags:[],slidesCount:null,visibleArea:t},s=this.storyManager.rootStore.storyStore.findStoryById(e);return s&&(r.title=s.statTitle,r.tags=s.tags,r.slidesCount=s.slidesCount,i===Fe.UGC&&(r.ugcPayload=Je()(s.ugcPayload)?s.ugcPayload:{})),Object.assign({id:e},r)})),feed:null,filter:null};i===Fe.DEFAULT?s.feed=t:i===Fe.UGC&&(s.filter=r),this.storyManager.emit("visibleAreaUpdated",s)}}class Jo{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 en=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},tn=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)},sn=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 an=(()=>{var e,t,r,i;let a,o,n,l,d,h,u,p,g,f,m=s,y=[],v=[],w=[],S=[],_=[],O=[],x=[];return e=class extends m{get ugcCardOptions(){return rn(this,t,"f")}set ugcCardOptions(e){sn(this,t,e,"f")}get favoriteCardOptions(){return rn(this,r,"f")}set favoriteCardOptions(e){sn(this,r,e,"f")}get _params(){return rn(this,i,"f")}set _params(e){sn(this,i,e,"f")}constructor(s,a,o,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(en(this,y),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,en(this,v,null)),r.set(this,(en(this,w),en(this,S,null))),i.set(this,(en(this,_),en(this,O,{listType:Fe.DEFAULT,feedSlug:"",useUgcCard:!1,isFavorite:!1,hasFavorite:!1}))),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:(en(this,x),!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 Yo).create(),this.feedCoverageAnalytics.addMetric(new Jo(this,this.storyFeedStatisticV1Service,this.storyFeedStatisticV2Service)),this.feedCoverageAnalytics.addMetric(new Xo(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 Fo(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===Fe.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 Gt.STYLE_CIRCLE:case Gt.STYLE_QUAD:return 1;case Gt.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===Fe.DEFAULT&&(a.favoriteListLength=n.length)}catch(e){console.error(e),a.success=!1,e instanceof c&&(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 Uo.create(e,this)}createFavoriteCard(e){return Ho.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=m[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[b.observable],o=[b.observable],n=[b.observable],l=[b.computed],d=[b.computed],h=[b.computed],u=[b.computed],p=[b.computed],g=[b.action],f=[b.action],tn(e,null,a,{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},v,w),tn(e,null,o,{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,_),tn(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,x),tn(e,null,l,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:r},null,y),tn(e,null,d,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:r},null,y),tn(e,null,h,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:r},null,y),tn(e,null,u,{kind:"getter",name:"hasFavoriteCard",static:!1,private:!1,access:{has:e=>"hasFavoriteCard"in e,get:e=>e.hasFavoriteCard},metadata:r},null,y),tn(e,null,p,{kind:"getter",name:"hasUgcCard",static:!1,private:!1,access:{has:e=>"hasUgcCard"in e,get:e=>e.hasUgcCard},metadata:r},null,y),tn(e,null,g,{kind:"method",name:"setParams",static:!1,private:!1,access:{has:e=>"setParams"in e,get:e=>e.setParams},metadata:r},null,y),tn(e,null,f,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:r},null,y),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 on{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new nn(this.storyManager);return new an(this.storyManager,e,new et(this.storyManager,new it),new cn(this.storyManager,new st(this.storyManager)))}}class nn{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=r===Fe.DEFAULT&&s,o=this.storyManager.rootStore.storyFeedStore,n=await this.fetchStoryFeed(o,e,t,i);let l=null;a&&(l=await o.fetchFavoriteFeed());const c=this.getFeedLoadEventStoryDtos(n);return this.emitFeedLoadEvent(n,c,e,t),{storyFeed:n,favoriteFeed:l}}async fetchStoryFeed(e,t,r,i){return t===Qe?e.fetchUgcFeed({filter:r,testKey:i}):e.fetchDefaultFeed({feedSlug:t,testKey:i})}getFeedLoadEventStoryDtos(e){return e.stories.map((t=>{const r={title:null,tags:[],slidesCount:null};return r.title=t.statTitle,r.tags=t.tags,r.slidesCount=t.slidesCount,e.type===Fe.UGC&&(r.ugcPayload=h()(t.ugcPayload)?t.ugcPayload:{}),Object.assign({id:t.id},r)}))}emitFeedLoadEvent(e,t,r,i){const s={stories:t,feed:null,filter:null};e.type===Fe.DEFAULT?s.feed=r:e.type===Fe.UGC&&(s.filter=i),this.storyManager.emit("feedLoad",s)}}class ln{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 cn{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 ln(e);await this.statisticV2Api.sendStatisticEvent(t)}async sendEvent(e,t=!1){await this.statisticV2Api.sendStatisticEvent(e,t)}}class dn{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__IAS_INTERNAL_API__",{enumerable:!0,configurable:!0,writable:!0,value:tl}),this.inAppMessaging=new _o(e.inAppMessaging)}get sdkVersionName(){return this.storyManager.sdkVersionName}get sdkVersionCode(){return this.storyManager.sdkVersionCode}set storyLinkClickHandler(e){this.storyManager.storyLinkClickHandler=e}setUserAgent(e){el.setUserAgent(e)}getConfig(){return this.storyManager.config}getNonce(){return P()}async showOnboardingStories(e){return this.storyManager.showOnboardingStories(e)}async showStory(e){return this.storyManager.showStory(e)}async showStoryOnce(e){return this.storyManager.showStoryOnce(e)}closeAllReaders(){this.storyManager.closeAllReaders()}async openGame(e,t={}){return this.storyManager.openGame(e,t)}async closeGame(){return this.storyManager.closeGame()}async waitStoryManagerConfig(){return this.storyManager.waitStoryManagerConfig()}async closeStoryReader(){return this.storyManager.closeStoryReader()}getUgcEditorConfig(){return this.storyManager.getUgcEditorConfig()}showSharePage(e){return this.storyManager.showSharePage(e)}closeGoodsWidget(){this.storyManager.closeGoodsWidget()}on(e,t){return this.storyManager.on(e,t),this}once(e,t){return this.storyManager.once(e,t),this}off(e,t){return this.storyManager.off(e,t),this}static use(e,t){e.install({INTERNAL_API:tl,HOST:dn},t)}}class hn extends Error{constructor(e){super(`[IAM]: not found IAM for event <${e}>`),this.name="IamNotFoundByEventError"}}var un=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},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)},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};let mn=(()=>{var e,t,r,i;let s,a,o,n,l,c=[],d=[],h=[],u=[],p=[],g=[],f=[];return e=class{get _messages(){return gn(this,t,"f")}set _messages(e){fn(this,t,e,"f")}get _isLoaded(){return gn(this,r,"f")}set _isLoaded(e){fn(this,r,e,"f")}get _isLoading(){return gn(this,i,"f")}set _isLoading(e){fn(this,i,e,"f")}constructor(e,s){Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:(un(this,c),e)}),Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:s}),t.set(this,un(this,d,b.observable.map())),r.set(this,(un(this,h),un(this,u,!1))),i.set(this,(un(this,p),un(this,g,!1))),Object.defineProperty(this,"_messageContext",{enumerable:!0,configurable:!0,writable:!0,value:(un(this,f),null)})}get messages(){return Array.from(this._messages.values())}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}get messageContext(){return this._messageContext}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 hn(e)}async updateMessageUserData(e,t){return this.iamApi.updateUserData(e,t)}async fetchById(e){await this.rootStore.sessionStore.open(),await this.fetchMessageContext();const t=await this.iamApi.fetchById(e);return this.createMessageByDto(t)}async fetchAll(e){await this.rootStore.sessionStore.open(),await this.fetchMessageContext();const t=e.tags?e.tags:this.rootStore.storyManagerConfigStore.config.tags,r=await this.iamApi.fetchAll({tags:k(t)});return this.createMessagesByDtos(r)}async fetchMessageContext(){await this.rootStore.sessionStore.open(),this._messageContext||(this._messageContext=await this.iamApi.fetchContext())}createMessagesByDtos(e){this._messages.clear();const t=[];for(const r of e){const e=this.createMessageByDto(r);t.push(e)}return t}createMessageByDto(e){if(!this.messageContext)throw new Error("[IAS]: IAM context not found");const t=Ra.createByDto(e),r=new Ea(e.id,this.messageContext);return t.setContext(r),this._messages.has(t.id.toString())||this._messages.set(t.id.toString(),t),t}},t=new WeakMap,r=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;s=[b.observable],a=[b.observable],o=[b.observable],n=[b.computed],l=[S,_],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 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;let r,i,s,a,o=[],n=[],l=[];return e=class{get _session(){return bn(this,t,"f")}set _session(e){wn(this,t,e,"f")}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(yn(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,yn(this,n,null)),yn(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:Ae}async open(){if(this._session)return this._session;const e=await this.storyManager.waitStoryManagerConfig(),t=await this.sessionApi.open({userId:e.userId,userIdSign:e.userIdSign}),r=new Re(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=[b.observable],i=[b.computed],s=[b.computed],a=[S],vn(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),vn(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),vn(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),vn(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 _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},xn=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)},kn=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 Cn=b.observable.map();let Pn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storiesByUserId(){return xn(this,t,"f")}set _storiesByUserId(e){kn(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:Cn}constructor(e,r,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(_n(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,_n(this,a,b.observable.map())),Object.defineProperty(this,"storyCSS",{enumerable:!0,configurable:!0,writable:!0,value:(_n(this,o),"")}),(0,b.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 Pt(e);return 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.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.updatePlaceholders(this.rootStore.placeholderStore.placeholders),o}async fetchStoryCSS(){this.storyCSS||(this.storyCSS=await this.storiesApi.fetchStoryCSS())}async fetchStoryContext({id:e,feedSlug:t}){const r=await this.storiesApi.fetchStoryContext({ids:[e],feedSlug:t});return new _t(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 _t(e,Object.assign(Object.assign({},r),{style:this.storyCSS}))))}getOrCreateStoriesMap(){const e=this.rootStore.sessionStore.userId;let t=b.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=[b.observable],i=[b.computed],On(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),On(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 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},En=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},In=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)},Mn=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=b.observable.map();let Ln=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _storyFeedsByUserId(){return In(this,t,"f")}set _storyFeedsByUserId(e){Mn(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,b.observable.map())),jn(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:Tn}getUgcFeed(){var e;return null!==(e=this.getFeedBySlug(Qe))&&void 0!==e?e:Ye.createByStories([])}getFavoriteFeed(){var e;return null!==(e=this.getFeedBySlug($e))&&void 0!==e?e:He.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.tags,s=await this.storyFeedsApi.fetchDefaultFeed({feedSlug:e,tags:i,testKey:t}),a=this.rootStore.storyStore.addStoriesByDtos(s.stories),o=new ze(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=He.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.tags,s=await this.storyFeedsApi.fetchUgcFeed({filter:e,tags:i,testKey:t}),a=this.rootStore.storyStore.addStoriesByDtos(s),o=Ye.createByStories(a,{filter:e});return this.addStoryFeed(r.userKey,o),o}addStoryFeed(e,t){let r=b.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=[b.observable],i=[b.computed],En(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),En(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 An=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},Rn=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)},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};const Nn=b.observable.map();let Fn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _onboardingFeedsByUserId(){return Bn(this,t,"f")}set _onboardingFeedsByUserId(e){Dn(this,t,e,"f")}constructor(e,r){Object.defineProperty(this,"storyFeedsApi",{enumerable:!0,configurable:!0,writable:!0,value:(An(this,s),e)}),Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),t.set(this,An(this,a,b.observable.map())),Object.defineProperty(this,"cacheDataInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:(An(this,o),!1)}),(0,b.reaction)((()=>{const e=this.rootStore.storyManagerConfigStore.config;return e?[e.lang,e.apiKey]: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:Nn}getFeedBySlug(e){return this.activeUserFeeds.get(null!=e?e:Ke.getDefaultSlug())}removeStoryFromOnboardingFeedsById(e){for(const t of this.activeUserFeeds.values())t.removeById(e)}invalidateCacheData(){this.cacheDataInvalidated=!0}async fetchOnboardingFeed(e){let t=e.feedSlug||Ke.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=await this.storyFeedsApi.fetchOnboardingFeed(Object.assign(Object.assign({},r),{feedSlug:t})),o=this.rootStore.storyStore.addStoriesByDtos(a.stories);return i=new Ke(a,o,r),this.addOnboardingFeed(s.userKey,i),this.commitCacheData(),i}addOnboardingFeed(e,t){let r=b.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:k(t),limit:e.limit}}commitCacheData(){this.cacheDataInvalidated=!1}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],i=[b.computed],Rn(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),Rn(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 Un{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.8.0-rc.1";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 Vn{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}async fetchUgcEditorConfig(){return(await ae.request({method:"GET",url:"ugc/editor-config",params:{}})).data}}var Gn=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},Wn=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)},$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};let Hn=(()=>{var e,t;let r,i,s=[],a=[],o=[];return e=class{get _placeholders(){return zn(this,t,"f")}set _placeholders(e){$n(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=b.observable.map()}constructor(){t.set(this,(Gn(this,s),Gn(this,a,b.observable.map()))),Gn(this,o)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],i=[b.computed],Wn(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),Wn(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 qn=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){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){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};let Yn=(()=>{var e,t;let r,i=[],s=[];return e=class{get _config(){return Kn(this,t,"f")}set _config(e){Qn(this,t,e,"f")}constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),t.set(this,Zn(this,i,new Pa)),Zn(this,s),this.storyManager=e}get config(){return this._config}setConfig(e){this._config instanceof Ca?this.updateConfig(e):this.initializeConfig(e)}clear(){this._config=new Pa,this.storyManager.rootStore.sessionStore.close()}async waitStoryManagerConfig(e=5e3){if(this._config instanceof Ca)return this._config;try{return await(0,b.when)((()=>this._config instanceof Ca),{timeout:e}),this._config}catch(e){throw new Error("[IAS]: Timeout waiting for InAppStoryManager config")}}initializeConfig(e){this._config=new Ca(this.storyManager,e)}updateConfig(e){this._config.updateByDto(e)}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[b.observable],qn(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 Xn{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 tt(e),r=new rt(e);this.storyManagerConfigStore=new Yn(e),this.placeholderStore=new Hn,this.iamStore=new mn(this,new ge(e)),this.sessionStore=new Sn(e,new Pe,this),this.storyStore=new Pn(e,t,this),this.storyFeedStore=new Ln(r,this),this.onboardingFeedStore=new Fn(r,this),this.ugcEditorStore=new Un(e,new Vn(e))}}class Jn extends e.EventEmitter{constructor(){if(super(),Object.defineProperty(this,"_rootStore",{enumerable:!0,configurable:!0,writable:!0,value:new Xn(this)}),Object.defineProperty(this,"_storyLinkClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),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}),Jn.isSingletonInstanceExists())return Jn.instance;Jn.instance=this,this.setUserAgent(`InAppStoryReactSDK/${this.sdkVersionCode}`);const e=new No(this);return this.storyReader=e.createStoryReader(),this.gameReader=e.createGameReader(),this.inAppMessaging=e.createInAppMessagingReader(),Jn.instance}get rootStore(){return this._rootStore}get httpClient(){return ae}get userAgent(){return this._userAgent}get sdkVersionName(){return"1.8.0-rc.1"}get sdkVersionCode(){return parseInt(10800)}get lang(){return this.rootStore.storyManagerConfigStore.config.lang}set storyLinkClickHandler(e){i()(e)&&(this._storyLinkClickHandler=e)}get storyLinkClickHandler(){return this._storyLinkClickHandler}get isStatisticsDisabled(){return this.config.isStatisticsDisabled}get config(){return this.rootStore.storyManagerConfigStore.config}static getInstance(){return Jn.instance?Jn.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 No(this).createStoryList()}setConfig(e){this.rootStore.storyManagerConfigStore.setConfig(e)}setUserAgent(e){parseInt(10800);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 waitStoryManagerConfig(){return this.rootStore.storyManagerConfigStore.waitStoryManagerConfig()}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})}async showStory(e){"string"==typeof e&&(e=+e||e),await this.storyReader.showStory(e)}async showStoryOnce(e){"string"==typeof e&&(e=+e||e),await this.storyReader.showStoryOnce(e)}async showSharePage(e){"string"==typeof e&&(e=+e||e),await this.storyReader.showStoryFromSharePage(e)}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 an)).map((e=>e.reload()));return Promise.all(e)}reloadAllStackedStoryLists(){const e=this.storyFeeds.filter((e=>e instanceof Do)).map((e=>e.reload()));return Promise.all(e)}clearConfig(){this.storyReader.close(Us.AppClose,!0),this.gameReader.closeGame(),this.inAppMessaging.close(),this.rootStore.storyManagerConfigStore.clear()}emitEvent(e){this.emit(e.name,e.toJSON())}static isSingletonInstanceExists(){return!!Jn.instance&&(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),!0)}}const el=new Jn,tl=el,rl=new dn(el);var il;!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(il||(il={}));const sl={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};var al;!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"}(al||(al={}));Error;class ol extends e.EventEmitter{constructor(){super(),Object.defineProperty(this,"_commonOptions",{enumerable:!0,configurable:!0,writable:!0,value:Tt}),Object.defineProperty(this,"_storiesListOptions",{enumerable:!0,configurable:!0,writable:!0,value:ut}),Object.defineProperty(this,"_storyReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:Vt}),Object.defineProperty(this,"_storyFavoriteReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:sl}),Object.defineProperty(this,"_goodsWidgetOptions",{enumerable:!0,configurable:!0,writable:!0,value:Rt}),Object.defineProperty(this,"_gameReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:Lt})}setCommonOptions(e,t=!0){return this._commonOptions=Jt()(this._commonOptions,e),this.emit(al.UPDATE,this.commonOptions),this}get commonOptions(){return this._commonOptions}setStoriesListOptions(e,t=!0){return this._storiesListOptions=Jt()(this._storiesListOptions,e),t&&(this.emit(al.UPDATE,this.storiesListOptions),this.emit(al.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?Ut.Modern:Ut.Classic),this._storyReaderOptions=Jt()(this._storyReaderOptions,e,{arrayMerge:(e,t,r)=>t}),t&&this.emit(al.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=Jt()(this._storyFavoriteReaderOptions,e),t&&this.emit(al.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=Jt()(this._goodsWidgetOptions,e),t&&this.emit(al.UPDATE,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}setGameReaderOptions(e,t=!0){return this._gameReaderOptions=Jt()(this._gameReaderOptions,e),t&&this.emit(al.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,b.configure)({enforceActions:"never"}),window.__IAS__={storyManager:el},(0,b.configure)({enforceActions:"never"});var nl=I(5272),ll=I(9155),cl=I.n(ll);var dl=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 hl=e=>{var{listType:t,feedSlug:r,testKey:i,storyManager:s,options:a,filter:o,useUgcCard:n=!1,hasFavorite:l,isFavorite:c}=e,d=dl(e,["listType","feedSlug","testKey","storyManager","options","filter","useUgcCard","hasFavorite","isFavorite"]);const[h,u]=(0,ll.useState)(),{storyListOptions:p}=(e=>{const t=(0,ll.useRef)(new ol).current;return{storyListOptions:(0,ll.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,ll.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,ll.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 ul=I(405),pl=I(9780),gl=I.n(pl);class fl{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 fl;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 ml{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=gl()(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===lt.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===lt.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new fl;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,ul.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 yl=I(992),vl=I.n(yl),bl=I(2591),wl=I.n(bl),Sl=I(5213),_l={insert:"head",singleton:!1};wl()(Sl.A,_l);const Ol=Sl.A.locals||{};var xl=I(4978),kl={insert:"head",singleton:!1};wl()(xl.A,kl);const Cl=xl.A.locals||{};var Pl=I(4456),jl={insert:"head",singleton:!1};wl()(Pl.A,jl);const El=Pl.A.locals||{},Il=({onClick:e,className:t})=>(0,nl.jsx)("div",{className:vl()(El.icon,t),onClick:e,children:(0,nl.jsx)("svg",{viewBox:"0 0 24 24",children:(0,nl.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 Ml=I(6644),Tl={insert:"head",singleton:!1};wl()(Ml.A,Tl);const Ll=Ml.A.locals||{},Al=({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,nl.jsx)("div",{className:vl()(Ll["aspect-ratio-box"],s,{[Ll["aspect-ratio-box--centered"]]:!i}),style:Object.assign(Object.assign({},r),a),children:(0,nl.jsx)("div",{className:Ll["aspect-ratio-box-inside"],children:t})})};var Rl=I(3639),Bl={insert:"head",singleton:!1};wl()(Rl.A,Bl);const Dl=Rl.A.locals||{},Nl=V(),Fl=e=>{const[t,r]=(0,ll.useState)(!1),i=(0,ll.useCallback)((()=>{if(J)return;const t=Nl.type!==e.orientation;e.onOrientationChange({type:Nl.type,isWrong:t}),r(t)}),[e.orientation]);return(0,ll.useEffect)((()=>(i(),Nl.addEventListener("change",i),()=>{Nl.removeEventListener("change",i)})),[i]),t?(0,nl.jsx)("div",{className:Dl["screen-orientation-lock"]}):null};var Ul=I(5839),Vl={insert:"head",singleton:!1};wl()(Ul.A,Vl);const Gl=Ul.A.locals||{};var Wl=I(7231),zl={insert:"head",singleton:!1};wl()(Wl.A,zl);const $l=Wl.A.locals||{},Hl=({shareText:e,shareLink:t,sharePanelOptions:r,onShareComplete:i})=>{var s,a,o,n,l,c,d,h,u,p,g;const[f,m]=(0,ll.useState)(!1),[v,b]=(0,ll.useState)(!1),w=()=>{b(!0),!f&&e||i()};return(0,nl.jsxs)("div",{className:`${Gl["share-panel__body"]} ${$l["share-panel__body_screenshot"]}`,children:[(0,nl.jsx)("div",{className:`${Gl["share-panel-row"]} ${$l["share-panel-row"]}`,children:(0,nl.jsx)("a",{className:$l["share-panel-row__image-link"],onClick:w,href:t,download:"image.jpeg",children:(0,nl.jsx)("img",{src:t,className:$l["share-panel-row__image"]})})}),(0,nl.jsx)("div",{className:Gl["share-panel-separator"],style:{background:null===(s=r.divider)||void 0===s?void 0:s.background}}),(0,nl.jsx)("div",{className:`${Gl["share-panel-row"]} ${$l["share-panel-row"]}`,children:(0,nl.jsx)("a",{className:$l["share-item__download-button"],onClick:w,href:t,download:"image.jpeg",children:(0,nl.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,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)("div",{className:Gl["share-panel-separator"],style:{background:null===(l=r.divider)||void 0===l?void 0:l.background}}),(0,nl.jsx)("div",{className:`${Gl["share-panel-row"]} ${$l["share-panel-row"]}`,children:(0,nl.jsxs)("button",{className:vl()($l.btn,$l["btn-copy"]),onClick:()=>{y(null!=e?e:""),m(!0),v&&i()},children:[(0,nl.jsxs)("div",{className:$l["btn-copy__icon"],children:[(0,nl.jsx)("span",{className:vl()($l["btn-copy__icon-state"],{[$l["btn-copy__icon-state_default"]]:!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,nl.jsx)("span",{className:vl()($l["btn-copy__icon-state"],{[$l["btn-copy__icon-state_done"]]: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,nl.jsx)("div",{className:$l["btn-copy__text"],children:e})]})})]}):null]})};var ql=I(9749),Zl={insert:"head",singleton:!1};wl()(ql.A,Zl);const Kl=ql.A.locals||{};var Ql=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 Yl=e=>{var t,r,i,s,a,o,n,l,c,d,h,{shareLink:u,sharePanelOptions:p,onShareComplete:g}=e,f=Ql(e,["shareLink","sharePanelOptions","onShareComplete"]);const m=()=>{try{return new URL(u).host}catch(e){return console.error(e),null}},v=()=>{window.removeEventListener("focus",v),g()},b=()=>m()?"":encodeURIComponent(u),w=e=>{var t,r;const i=(()=>{try{return new URL(u)}catch(e){return console.error(e),null}})();if(!i)return"#";const s=null===(t=p.targetParams)||void 0===t?void 0:t[e];return null===(r=null==s?void 0:s.getUrl)||void 0===r?void 0:r.call(s,{url:i.toString(),text:b()})},S=null===(t=p.title)||void 0===t?void 0:t.favicon,_=p.text;return(0,nl.jsxs)("div",{className:Gl["share-panel__body"],children:[(0,nl.jsxs)("div",{className:`${Gl["share-panel-row"]} ${Gl["title-row"]}`,children:[m()&&Boolean(null==S?void 0:S.display)&&(0,nl.jsx)("div",{className:Gl["share-url-favicon"],style:{background:null==S?void 0:S.background},children:(0,nl.jsx)("img",{src:`${null!==(r=f.faviconApiUrl)&&void 0!==r?r:"https://favicon.inappstory.ru"}?sz=64&domain_url=${m()}`})}),(0,nl.jsx)("span",{className:Gl.title,dir:f.dir,style:_,children:null===(s=null===(i=p.title)||void 0===i?void 0:i.getValue)||void 0===s?void 0:s.call(i,{url:u,text:b()})})]}),(0,nl.jsx)("div",{className:Gl["share-panel-separator"],style:{background:null===(a=p.divider)||void 0===a?void 0:a.background}}),(0,nl.jsx)("div",{className:`${Gl["share-panel-row"]} ${Kl["social-list"]}`,children:null===(o=p.targets)||void 0===o?void 0:o.map(((e,t)=>{var r,i,s;const a=null===(r=p.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,nl.jsx)("div",{className:Kl["social-list__item"],children:(0,nl.jsxs)("a",{href:w(e),onClick:()=>((e,t,r)=>{window.addEventListener("focus",v),window.open(e,t,r)})(w(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${Gl["share-item"]} ${Kl["share-item"]}`,children:[(0,nl.jsx)("div",{dangerouslySetInnerHTML:{__html:o}}),(0,nl.jsx)("span",{className:Gl["share-item-title"],style:_,children:null==a?void 0:a.label})]})},t)}))}),(0,nl.jsx)("div",{className:Gl["share-panel-separator"],style:{background:null===(n=p.divider)||void 0===n?void 0:n.background}}),(0,nl.jsx)("div",{className:Gl["share-panel-row"],children:(0,nl.jsxs)("a",{className:`${Gl["share-item"]} ${Kl["share-item"]}`,onClick:()=>{y(u),g()},children:[(0,nl.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(d=null===(c=null===(l=p.copyButton)||void 0===l?void 0:l.svgSrc)||void 0===c?void 0:c.baseState)&&void 0!==d?d:""}}),(0,nl.jsx)("span",{className:Gl["share-item-title"],style:_,children:null===(h=p.copyButton)||void 0===h?void 0:h.label})]})})]})};var Xl;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(Xl||(Xl={}));const Jl=({shareType:e,shareLink:t,shareText:r,onShareCompelete:i,sharePanelOptions:s,className:a,dir:o})=>{const[n,l]=(0,ll.useState)(!1),[c,d]=(0,ll.useState)(!0),h=()=>{l(!0),d(!1)};return(0,nl.jsxs)("div",{dir:o,className:vl()(Gl["share-panel-wrapper"],a),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,nl.jsx)("div",{className:vl()(Gl["share-panel-backdrop"],{[Gl.fadeIn]:c,[Gl.fadeOut]:!c}),onClick:()=>{l(!1),d(!1)}}),(0,nl.jsxs)("div",{className:vl()(Gl["share-panel"],{[Gl.slideIn]:c,[Gl.slideOut]:!c}),onAnimationEnd:()=>{c||i(n)},style:{"--height":"100%",background:s.background,borderTopLeftRadius:s.borderRadius+"px",borderTopRightRadius:s.borderRadius+"px"},children:[e===Xl.SlideScreenshot&&(0,nl.jsx)(Hl,{shareText:r,shareLink:t,onShareComplete:h,sharePanelOptions:s}),e===Xl.Social&&(0,nl.jsx)(Yl,{shareLink:t,onShareComplete:h,sharePanelOptions:s,dir:o}),(0,nl.jsx)("div",{className:Gl["share-panel-separator"]})]})]})};var ec=I(9678),tc={insert:"head",singleton:!1};wl()(ec.A,tc);const rc=ec.A.locals||{},ic=e=>{const t=(0,ll.useRef)(null),[r,i]=(0,ll.useState)(null);return(0,ll.useEffect)((()=>{const r=e.$dotLottie.create(t.current,e.config);return i(r),()=>{r.destroy()}}),[e.config.sha1,e.$dotLottie]),(0,ll.useEffect)((()=>{r&&e.forceEnd&&r.stop()}),[r,e.forceEnd]),(0,ll.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,nl.jsx)("canvas",{ref:t,style:{width:"100%",height:"100%"}})},sc=e=>{var t,r,i;const{storyManager:s}=ep(),[a,o]=(0,ll.useState)(!1),[n,l]=(0,ll.useState)(!1),[c,d]=(0,ll.useState)(!1),[h,u]=(0,ll.useState)(!1),[p,g]=(0,ll.useState)(!1),[f,m]=(0,ll.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,ll.useEffect)((()=>{_&&e.onSplashCanBeHidden()}),[_]);return(0,nl.jsxs)("div",{className:vl()(rc["splash-container"],{[rc["splash-container--fadeIn"]]:e.game,[rc["splash-container--fadeOut"]]:e.gameShouldBeShown,[rc["splash-container--isLoading"]]:w}),children:[(0,nl.jsx)("div",{className:rc["splash-container__image"],style:{backgroundColor:e.splashImageBackgroundColor},children:S()&&(0,nl.jsx)("img",{src:S(),onLoad:()=>{m(!0)}})}),b&&v&&(0,nl.jsx)("div",{className:rc["splash-container__lottie"],children:(0,nl.jsx)(ic,{$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 ac=I(8034),oc={insert:"head",singleton:!1};wl()(ac.A,oc);const nc=ac.A.locals||{},lc=e=>{var t,r;return(0,nl.jsx)("button",{dir:e.dir,onClick:e.onCloseGame,className:nc["close-btn"],"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 cc=I(5299),dc=I(9514);V();const hc=()=>{const e=window.innerWidth;return{vh:window.innerHeight,vw:e}},uc=()=>{const[e,t]=(0,ll.useState)((()=>hc())),r=(0,ll.useCallback)((()=>{t(hc())}),[]);return(0,ll.useEffect)((()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)})),[]),e},pc=50,gc=50;var fc=I(763),mc={insert:"head",singleton:!1};wl()(fc.A,mc);fc.A.locals;const yc=({storyManager:e})=>{const t=(()=>{const e=(0,ll.useRef)({top:0,bottom:0,left:0,right:0});return e.current||(e.current=(()=>{const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t)),r=t("--ias-sat"),i=t("--ias-sab");return{left:t("--ias-sal"),right:t("--ias-sar"),top:r,bottom:i}})()),e.current})();return(0,ll.useEffect)((()=>{e.gameReader.setSafeAreaInsets(t)}),[e]),e.gameReader},vc=(0,cc.observer)((({gameReader:e})=>{var t,r,i,s,a,o,n,l,c,d;const{gameReaderOptions:h,storyReaderOptions:u}=ep(),p=(0,ll.useRef)(null),{sharePanelOpeningParams:g,handleShareComplete:f,closeSharePanel:m}=(e=>{const[t,r]=(0,ll.useState)(null);return(0,ll.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:y,isDesktopGeometry:v}=(()=>{const{vw:e,vh:t}=uc(),r=(new Yi).create({vw:e,vh:t});return{isDesktopGeometry:r instanceof Ki,gameGeometry:r}})(),b=v&&(null===(r=null===(t=e.game)||void 0===t?void 0:t.screenOptions.widescreen)||void 0===r||r);tp((()=>{w()}));const w=()=>{e.closeGame(),m()},{game:S,gameError:_,isGameLoading:O,closeBtnVisible:x}=e,k=vl()(Cl["game-reader"],{[Cl["game-reader--desktop-mode"]]:v,[Cl["game-reader--widescreen"]]:b}),C={background:null!==(s=null===(i=h.backdrop)||void 0===i?void 0:i.background)&&void 0!==s?s:"",opacity:null!==(o=null===(a=h.backdrop)||void 0===a?void 0:a.opacity)&&void 0!==o?o:0,filter:(null===(n=h.backdrop)||void 0===n?void 0:n.blur)?`blur(${h.backdrop.blur}px)`:"none"},P=null!==(c=null===(l=h.game)||void 0===l?void 0:l.backdropColor)&&void 0!==c?c:"";return(0,dc.createPortal)((0,nl.jsx)("div",{className:Cl["game-reader-container"],style:{"--game-box-border-radius":`${parseFloat(String(h.borderRadius))}px`},children:(0,nl.jsxs)("div",{className:k,children:[(0,nl.jsx)("div",{className:Cl["game-reader__backdrop"],style:C}),(0,nl.jsxs)(Al,{className:Cl["game-reader__game-box"],isWidescreen:b,geometry:y,children:[(0,nl.jsx)(sc,{onSplashCanBeHidden:()=>{e.notifyGameCanBeStarted()},isDesktopGeometry:v,isGameInited:e.isGameInited,isGameLoading:O,isGameLoadingError:Boolean(e.gameError),gameShouldBeShown:e.gameShouldBeShown,game:null!==(d=e.game)&&void 0!==d?d:void 0,splashImageBackgroundColor:e.game?P:C.background}),_&&(0,nl.jsx)(Il,{className:Cl["game-reader__refresh-btn"],onClick:()=>{e.reload()}}),(!e.gameShouldBeShown||x)&&(0,nl.jsx)(lc,{closeButtonPosition:h.closeButtonPosition,dir:e.dir,onCloseGame:w,closeButtonOptions:h.closeButton}),S&&(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)("iframe",{src:S.url,onLoad:t=>{p.current=t.target,e.setGameCenterIframe(p.current,{isWidescreen:b})},style:{opacity:e.gameShouldBeShown?1:0},frameBorder:"0",className:Cl["game-reader__iframe"],sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),g&&(0,nl.jsx)(Jl,{dir:e.dir,shareType:g.shareType,shareLink:g.shareLink,onShareCompelete:f,sharePanelOptions:u.sharePanel})]})]}),S&&h.forceCheckOrientation&&(0,nl.jsx)(Fl,{orientation:G.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.isGameInited&&(t?e.pauseGameUI():e.resumeGameUI())}})]})}),document.body)}));var bc=I(1239),wc={insert:"head",singleton:!1};wl()(bc.A,wc);const Sc=bc.A.locals||{};class _c{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(Us.CloseBySwipeDown)}),400)}handleSwipeDown(){this.deltaValY<=.15||!this.storyReaderViewModel.canBeClosed()?this.returnToDefaultState():this.closeStoryReader()}}var Oc=I(8790),xc={insert:"head",singleton:!1};wl()(Oc.A,xc);const kc=Oc.A.locals||{},Cc=e=>{var t,r;const{storyReaderOptions:i}=ep();return(0,nl.jsx)("div",{dir:e.dir,"data-position":i.closeButtonPosition,className:vl()(kc["close-btn-wrapper"],{[kc["close-btn-wrapper_hidden"]]:e.hidden},e.className),children:(0,nl.jsx)("button",{className:vl()(kc["close-btn"],{[kc["close-btn_hidden"]]:e.hidden}),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:""}})})},Pc=(0,cc.observer)((e=>{const t=(0,ll.useRef)(null),r=(0,ll.useRef)(null),{storyReaderOptions:i}=ep();(({storyReaderViewModel:e,storiesViewerRef:t,backdropRef:r})=>{const i=(0,ll.useRef)(null);(0,ll.useEffect)((()=>{i.current=new _c(e,t.current,r.current)}),[]);const s=()=>{var e;t.current.classList.add(Sc["no-select"]),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(Sc["no-select"]),e.touchController.verticalSwipeGesture&&(null===(r=i.current)||void 0===r||r.endMove())};(0,ll.useEffect)((()=>{const t=e.touchController;return t.on(Qt.TouchStart,s),t.on(Qt.TouchMoveVertical,a),t.on(Qt.TouchEnd,o),()=>{t.off(Qt.TouchStart,s),t.off(Qt.TouchMoveVertical,a),t.off(Qt.TouchEnd,o)}}),[e.touchController])})({storyReaderViewModel:e.storyReader,backdropRef:t,storiesViewerRef:r});return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsxs)("div",{ref:r,className:vl()("stories-viewer",Sc["stories-viewer"]),style:Object.assign(Object.assign({},{"--loaderBackgroundColor":null===(s=i.loader)||void 0===s?void 0:s.default.color,"--loaderBackgroundAccentColor":null===(a=i.loader)||void 0===a?void 0:a.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:[J&&(0,nl.jsx)("div",{className:Sc["stories-viewer-background"],style:(()=>{var t,r,s;const a=[],o=null===(t=e.storyReader.activeStory)||void 0===t?void 0:t.displayedSlideImage;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&&e.storyReader.activeStory&&(0,nl.jsx)(Cc,{dir:e.storyReader.dir,className:Sc["stories-viewer__close-btn"],hidden:Boolean(e.storyReader.activeStory.pauseState.isUIPaused),onClose:()=>{e.storyReader.close()}})]}),(0,nl.jsx)("div",{ref:t,className:vl()(Sc["stories-viewer-backdrop"],{[Sc._desktopMode]:J})})]});var s,a}));var jc=I(9037),Ec={insert:"head",singleton:!1};wl()(jc.A,Ec);const Ic=jc.A.locals||{};var Mc=I(6349),Tc={insert:"head",singleton:!1};wl()(Mc.A,Tc);const Lc=Mc.A.locals||{};var Ac=I(6028),Rc={insert:"head",singleton:!1};wl()(Ac.A,Rc);const Bc=Ac.A.locals||{},Dc=e=>{const t=0===e.value||1===e.value;return(0,nl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(-1===e.value?0:-1)}})},Nc=e=>(0,nl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.activeState:e.options.svgSrc.baseState},onClick:()=>e.onClick(!e.value)}),Fc=e=>{const t=0===e.value||-1===e.value;return(0,nl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:t?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:()=>{e.onClick(1===e.value?0:1)}})},Uc=e=>(0,nl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.value?e.options.svgSrc.baseState:e.options.svgSrc.activeState},onClick:e.onClick}),Vc=e=>(0,nl.jsx)("span",{className:e.className,dangerouslySetInnerHTML:{__html:e.options.svgSrc.baseState},onClick:e.onClick});var Gc=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 Wc=(0,cc.observer)((e=>{var{actionPanel:t,commonOptions:r,storyReaderOptions:i,nodeRef:s,hidden:a}=e,o=Gc(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,nl.jsx)("div",{ref:s,dir:o.dir,className:vl()(Bc["story-action-panel"],{[Bc["story-action-panel_hidden"]]:a,[Bc["story-action-panel_mobile"]]:!o.isDesktopGeometry}),children:(0,nl.jsxs)("div",{className:Bc["story-action-panel-actions"],children:[n&&(0,nl.jsx)(Fc,{className:Bc["story-action-panel-actions__item"],value:t.like,options:i.likeButton,onClick:e=>{t.setLike(e)}}),n&&(0,nl.jsx)(Dc,{className:Bc["story-action-panel-actions__item"],value:t.like,options:i.dislikeButton,onClick:e=>{t.setDislike(e)}}),c&&(0,nl.jsx)(Nc,{className:Bc["story-action-panel-actions__item"],value:t.favorite,options:i.favoriteButton,onClick:e=>{t.setBookmark(e)}}),(0,nl.jsxs)("div",{className:Bc["story-action-panel-actions__right-container"],children:[d&&(0,nl.jsx)(Uc,{className:Bc["story-action-panel-actions__item"],value:t.muted,options:i.muteButton,onClick:()=>{t.muted?t.unmute():t.mute()}}),l&&(0,nl.jsx)(Vc,{className:Bc["story-action-panel-actions__item"],options:i.shareButton,onClick:()=>{t.share()}})]})]})})}));var zc=I(2208),$c={insert:"head",singleton:!1};wl()(zc.A,$c);const Hc=zc.A.locals||{};var qc=I(114),Zc={insert:"head",singleton:!1};wl()(qc.A,Zc);const Kc=qc.A.locals||{},Qc=(0,cc.observer)((e=>{const{ref:t}=(e=>{const t=(0,ll.useRef)(null);return(0,ll.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(ei.Start,s),r.on(ei.Stop,a),r.on(ei.Progress,i),()=>{r.off(ei.Start,s),r.off(ei.Progress,i),r.off(ei.Stop,a)}}),[e]),{ref:t}})(e.story),r=e.story.activeSlide.timeline;return(0,nl.jsx)("div",{ref:t,dir:e.dir,className:vl()(Kc["story-timeline"],{[Kc["story-timeline_desktop"]]:J,[Kc["story-timeline_hidden"]]:e.hidden}),style:{"--story-timeline-tick-foreground":null==r?void 0:r.foreground,"--story-timeline-background":null==r?void 0:r.background},children:(0,nl.jsx)("div",{className:`${Kc["story-timeline-ticks"]}`,children:new Array(e.story.slidesCount).fill(0).map(((t,r)=>(0,nl.jsxs)("div",{className:Kc["story-timeline-ticks__tick"],children:[(0,nl.jsx)("div",{className:vl()(Kc["story-timeline-ticks__tick-progress"],{[Kc["story-timeline-ticks__tick-progress_active"]]:r+1<=e.story.activeSlideIndex})}),(0,nl.jsx)("div",{className:Kc["story-timeline-ticks__tick-progress-loader"],style:{display:r+1===e.story.activeSlideIndex+1?"block":"none"}})]},r+1)))})})}));var Yc=I(3910),Xc={insert:"head",singleton:!1};wl()(Yc.A,Xc);const Jc=Yc.A.locals||{},ed=()=>(0,nl.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.jsxs)("g",{children:[(0,nl.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,nl.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"})]})}),td=()=>(0,nl.jsx)("svg",{width:"16",height:"16",viewBox:"-40 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,nl.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"})}),rd=(0,cc.observer)((e=>(0,nl.jsxs)("div",{className:vl()(Jc["story-controls"]),dir:e.dir,children:[J&&(0,nl.jsxs)("div",{className:vl()(Jc["story-controls__item"],Jc["story-controls__btn-group"],{[Jc["story-controls__item_hidden"]]:e.hidden||e.story.timeline.hiddenTimeline}),children:[(0,nl.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:vl()(Jc["story-controls__btn"],Jc["story-controls__btn_play"],{[Jc["story-controls__btn_hidden"]]:!e.story.pauseState.isUserPaused}),onClick:()=>{e.story.resumeUser()},children:(0,nl.jsx)(td,{})}),(0,nl.jsx)("button",{disabled:e.story.pauseState.isUIPaused||e.story.pauseState.isSystemPaused,className:vl()(Jc["story-controls__btn"],Jc["story-controls__btn_pause"],{[Jc["story-controls__btn_hidden"]]:e.story.pauseState.isUserPaused}),onClick:()=>{e.story.pauseUser()},children:(0,nl.jsx)(ed,{})})]}),!e.story.disableClose&&!e.isDesktopGeometry&&(0,nl.jsx)("div",{className:vl()(Jc["story-controls__item"]),children:(0,nl.jsx)(Cc,{dir:e.story.dir,className:vl()(Jc["story-controls__btn_close"]),hidden:e.hidden,onClose:()=>{e.onClose()}})})]}))),id=(0,cc.observer)((e=>(0,nl.jsxs)("div",{ref:e.nodeRef,className:vl()(Hc["story-header"]),children:[(0,nl.jsx)(Qc,{dir:e.story.dir,story:e.story,hidden:e.hidden||e.story.timeline.hiddenTimeline}),(0,nl.jsx)(rd,{dir:e.story.dir,story:e.story,onClose:e.onClose,isDesktopGeometry:e.isDesktopGeometry,hidden:e.hidden})]})));var sd=I(2004),ad={insert:"head",singleton:!1};wl()(sd.A,ad);const od=sd.A.locals||{},nd=e=>(0,nl.jsx)("div",{ref:e.nodeRef,className:vl()(od["story-backdrop"],{[od["story-backdrop_hidden"]]:e.hidden})});var ld=I(5479),cd={insert:"head",singleton:!1};wl()(ld.A,cd);const dd=ld.A.locals||{},hd=(0,cc.observer)((e=>{const t=e.needShowErrorScreen,r=e.needShowLoaderScreen;return r||t?(0,nl.jsx)("div",{className:vl()(dd.loader),style:{"--loader-background":e.background,"--loaderBackgroundColor":e.color},onClick:e=>{e.preventDefault()},children:t?(0,nl.jsx)(Il,{className:dd["loader__refresh-btn"],onClick:t=>{t.stopPropagation(),e.onReload()}}):r&&(0,nl.jsx)("div",{className:dd.loader__spinner})}):null}));const ud=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 pd(e,t,r){return new Promise((i=>{let s=!1;const a=()=>{s=!0,clearTimeout(n),void 0!==ud&&e.removeEventListener(ud,o),e.style.setProperty("transition",`${t} 0ms`),i()},o=e=>{e.propertyName===t&&(s||a())};void 0!==ud&&e.addEventListener(ud,o,!1);const n=setTimeout((()=>{s||a()}),r+20);e.style.setProperty("transition",`${t} ${r}ms`)}))}var gd=I(2561),fd={insert:"head",singleton:!1};wl()(gd.A,fd);const md=gd.A.locals||{},yd=e=>{const t=(0,ll.useRef)(null),r=(0,ll.useRef)(null),i=(0,ll.useRef)(0),s=(0,ll.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,ll.useState)(!1),[c,d]=(0,ll.useState)(!1),h=(0,ll.useRef)(!1),u=()=>{const t=ll.Children.count(e.children);return r.current&&t?r.current.scrollWidth/t:0};let p=!1;(0,ll.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,ll.useRef)(!1),f=(0,ll.useRef)(0);let m=0;const y=(0,ll.useRef)(!1),[v,b]=(0,ll.useState)(0),w=e=>{e<0&&(e=0),e>i.current&&(e=i.current),b(e)};(0,ll.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,nl.jsxs)("div",{className:md["scrolling-carousel"],style:e.style,children:[(0,nl.jsx)("div",{className:md["scrolling-carousel__wrapper"],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,nl.jsx)("div",{className:md["scrolling-carousel__item"],ref:r,style:{transform:`translateX(${-1*v}px)`},children:e.children})}),!p&&(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)("div",{className:vl()(md["scrolling-carousel__arrow-button"],md["scrolling-carousel__arrow-button--left"],{[md["scrolling-carousel__arrow-button--show"]]:n}),onClick:async()=>{if(h.current)return;o();const e=s.current-u();w(e),h.current=!0,r.current&&await pd(r.current,"transform",300),h.current=!1},children:(0,nl.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,nl.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),(0,nl.jsx)("div",{className:vl()(md["scrolling-carousel__arrow-button"],md["scrolling-carousel__arrow-button--right"],{[md["scrolling-carousel__arrow-button--show"]]:c}),onClick:async()=>{if(h.current)return;o();const e=s.current+u();w(e),h.current=!0,r.current&&await pd(r.current,"transform",300),h.current=!1},children:(0,nl.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,nl.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})})]})]})},vd=({children:e,style:t,color:r,font:i,className:s})=>(0,nl.jsx)("div",{className:s,style:Object.assign({color:r,font:i},t),children:e});var bd=I(2621),wd={insert:"head",singleton:!1};wl()(bd.A,wd);const Sd=bd.A.locals||{},_d=({goods:e,onClick:t,options:r})=>{var i;const{imgSrc:s,title:a,subTitle:o,price:n,oldPrice:l}=e;return(0,nl.jsxs)("div",{className:vl()(Sd["goods-card"]),style:{color:null!==(i=r.mainTextColor)&&void 0!==i?i:"black"},onClick:t,children:[(0,nl.jsx)("div",{className:vl()(Sd.figure),style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor},children:s&&(0,nl.jsx)("img",{src:s,alt:a,style:{borderRadius:r.imageCornerRadius+"px",backgroundColor:r.imageBackgroundColor}})}),(0,nl.jsx)(vd,{font:r.subtitleFont,children:o}),(0,nl.jsx)(vd,{font:r.titleFont,children:a}),(0,nl.jsxs)("div",{className:Sd.prices,children:[(0,nl.jsx)(vd,{font:r.priceFont,children:n}),(0,nl.jsx)(vd,{className:Sd["typography--old-price"],font:r.oldPriceFont,color:r.oldPriceTextColor,children:l})]})]})},Od=e=>{const t=e.goodsWidgetOptions,r=t.goodsWidgetRenderingType||t.goodsList.renderingType;let s=[];return r===At.DEFAULT?s=e.goodsList.map(((r,i)=>(0,nl.jsx)(_d,{options:t.goodsCard,goods:r,onClick:()=>e.onGoodsCardClick(r)},i))):r===At.CUSTOM_CARD&&i()(t.getCardHtml)&&(s=e.goodsList.map(((r,i)=>{var s,a;return(0,nl.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,nl.jsx)(yd,{style:{marginTop:"-15px"},children:s})};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 kd=e=>{var{arrowColor:t}=e,r=xd(e,["arrowColor"]);return(0,nl.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,nl.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 Cd=I(4354),Pd={insert:"head",singleton:!1};wl()(Cd.A,Pd);const jd=Cd.A.locals||{},Ed=({closeImage:e,arrowColor:t,onClick:r})=>(0,nl.jsx)("div",{className:jd.btn,onClick:r,onTouchStart:r,children:e?(0,nl.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}):(0,nl.jsx)(kd,{arrowColor:t})});var Id=I(9406),Md={insert:"head",singleton:!1};wl()(Id.A,Md);const Td=Id.A.locals||{},Ld=({isLoading:e,backgroundColor:t="white",accentBackgroundColor:r="transparent"})=>e?(0,nl.jsx)("div",{className:Td.spinner,style:{border:`solid 2px ${t}`,borderColor:`${r} ${t} ${t} ${t}`}}):null;var Ad=I(777),Rd={insert:"head",singleton:!1};wl()(Ad.A,Rd);const Bd=Ad.A.locals||{},Dd=e=>{let t=[];return t=e.goodsList.map(((t,r)=>e.renderGoods({goods:t,index:r,onClick:t=>{e.onGoodsCardClick(t)}}))),(0,nl.jsx)(yd,{children:t})};var Nd;!function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"}(Nd||(Nd={}));const Fd=({open:e,url:t,goodsWidgetOptions:r,onClosed:i,onClose:s,onGoodsCardClick:a})=>{const o=(0,ll.useRef)(null),[n,l]=(0,ll.useState)([]),[c,d]=(0,ll.useState)(Nd.IN),h=r,{dimColor:u,substrateHeight:p,substrateColor:g,closeImage:f,closeBackgroundColor:m}=h.goodsList;(0,ll.useEffect)((()=>{d(e?Nd.IN:Nd.OUT)}),[e]),(0,ll.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,ll.useEffect)((()=>{const e=o.current;if(c===Nd.OUT)return e.addEventListener("animationend",i),()=>{e.removeEventListener("animationend",i)}}),[c]);const b=h.loader.custom?(0,nl.jsx)("div",{dangerouslySetInnerHTML:{__html:h.loader.custom}}):(0,nl.jsx)(Ld,{isLoading:Boolean(r.isLoading),backgroundColor:h.loader.default.color,accentBackgroundColor:h.loader.default.accentColor});return(0,nl.jsxs)("div",{className:vl()(Bd["goods-container"],{[Bd["goods-container--visible"]]:c===Nd.IN,[Bd["goods-container--hidden"]]:c===Nd.OUT}),ref:o,children:[(0,nl.jsx)("div",{className:vl()(Bd["goods-container__backdrop"]),style:{backgroundColor:u},onClick:s}),(0,nl.jsxs)("div",{className:vl()(Bd["goods-container"]),style:{height:p+"px",backgroundColor:null!=g?g:"white"},children:[b,r.renderItem?(0,nl.jsx)(Dd,{goodsWidgetOptions:r,goodsList:n,renderGoods:r.renderItem,onGoodsCardClick:a}):(0,nl.jsx)(Od,{goodsList:n,onGoodsCardClick:a,goodsWidgetOptions:r}),(0,nl.jsx)(Ed,{onClick:s,closeImage:f,arrowColor:m})]})]})};var Ud=I(9111),Vd={insert:"head",singleton:!1};wl()(Ud.A,Vd);const Gd=Ud.A.locals||{},Wd=(0,cc.observer)((e=>{const[t,r]=(0,ll.useState)(!1),[i,s]=(0,ll.useState)(!1),a=()=>{s(!0),r(!0)},o=()=>{r(!1)};(0,ll.useEffect)((()=>{const t=e.story.goodsWidget;return t.on(qr.Open,a),t.on(qr.Close,o),()=>{t.off(qr.Open,a),t.off(qr.Close,o)}}),[e.story]);return i&&e.story.goodsWidget.params.elementId?(0,nl.jsx)("div",{className:Gd["goods-widget-viewer"],children:(0,nl.jsx)(Fd,{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})),zd={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"};class $d{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 Hd=e=>{switch(e){case"":default:return"text";case"tel":return"tel";case"email":return"email"}},qd=e=>{const[t,r]=(0,ll.useState)({countryCode:"",phone:""}),[i,s]=(0,ll.useState)(""),[a,o]=(0,ll.useState)(!0),n=r=>{var i;const s=Hd(null!==(i=null==e?void 0:e.configV2.main.input.type)&&void 0!==i?i:"");return"email"===s?$d.isEmailValid(r):"tel"!==s||$d.isTelephoneValid((()=>{var e;const r=t.countryCode.substring(1);return r&&null!==(e=zd[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=I(7656),Kd={insert:"head",singleton:!1};wl()(Zd.A,Kd);const Qd=Zd.A.locals||{},Yd=e=>{const t=(0,ll.useRef)(null);return(0,ll.useEffect)((()=>{t.current&&(C(t.current),t.current.focus())}),[]),(0,nl.jsx)("input",{type:"email",className:vl()(Qd.input,Qd.input_centered),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 Jd=e=>{const{value:t="",pattern:r="+7 (___) ___-__-__",patternChar:i="9",placeholderChar:s="_",className:a="",onChange:o}=e,n=(0,ll.useRef)(null),l=(0,ll.useRef)(null);(0,ll.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,ll.useEffect)((()=>{l.current&&t!==l.current.getCleanPhoneNumber()&&l.current.setValue(t)}),[t]);return(0,ll.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,nl.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)}}})},eh=e=>{const t=(0,ll.useRef)(null),r=e.value.countryCode?zd[e.value.countryCode]:"";return(0,ll.useEffect)((()=>{var e;const r=null===(e=t.current)||void 0===e?void 0:e.getInputElement();var i;r&&(i=r,setTimeout((()=>{C(i),i.focus()})))}),[]),(0,nl.jsxs)("div",{className:Qd["input-group"],children:[(0,nl.jsxs)("div",{className:Qd["input-group__prepend"],children:[(0,nl.jsx)(Jd,{value:e.value.countryCode,inputRef:t,pattern:"+999",placeholderChar:"",className:Qd.input,onChange:(t,r)=>{e.onChange({countryCode:r,phone:e.value.phone})}}),(0,nl.jsx)("div",{className:Qd["input-group__separator"]})]}),(null==r?void 0:r.length)?(0,nl.jsx)(Jd,{value:e.value.phone,pattern:r,placeholder:e.placeholder,className:Qd.input,onChange:(t,r)=>{e.onChange({countryCode:e.value.countryCode,phone:r})}}):(0,nl.jsx)("input",{type:"tel",className:Qd.input,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}))}})]})},th=e=>{const t=(0,ll.useRef)(null),r=(0,ll.useRef)(null);(0,ll.useEffect)((()=>{r.current.dataset.replicatedValue=e.value,C(t.current),t.current.focus(),t.current.setSelectionRange(e.value.length,e.value.length)}),[]);return(0,nl.jsx)("div",{className:Qd["textarea-grow-wrap"],ref:r,style:e.style,children:(0,nl.jsx)("textarea",{className:Qd.input,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 rh=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 ih=e=>{var{form:t,config:r}=e,i=rh(e,["form","config"]);const[s,a]=(0,ll.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=Hd(r.configV2.main.input.type),y=({value:e})=>{i.onComplete({result:!0,value:e}),a(!1)};return(0,nl.jsxs)("div",{className:Qd.wrapper,children:[(0,nl.jsx)("div",{className:vl()(Qd.backdrop,{[Qd.fadeIn]:s,[Qd.fadeOut]:!s}),onAnimationEnd:()=>{s||i.onClose()},onClick:()=>{i.onComplete({result:!1,value:t.value}),a(!1)}}),(0,nl.jsxs)("div",{className:Qd.main,style:o(),children:[(0,nl.jsxs)("div",{className:Qd["main-elements"],style:n(),children:[(0,nl.jsx)("div",{className:Qd.question,style:l(),children:f}),(0,nl.jsxs)("div",{className:vl()(Qd["input-wrapper"],{[Qd["is-invalid"]]:!t.isValid}),style:c(),children:["text"===m&&(0,nl.jsx)(th,{value:t.value,onChange:t.handleChange,style:h(),placeholder:p,maxLength:u}),"email"===m&&(0,nl.jsx)(Yd,{value:t.value,onChange:t.handleChange,placeholder:p}),"tel"===m&&(0,nl.jsx)(eh,{value:t.telephone,onChange:t.handleTelephoneChange,placeholder:p})]})]}),t.value.trim().length>0&&(0,nl.jsx)("div",{className:Qd["button-wrapper"],children:(0,nl.jsx)("button",{className:Qd.button,style:d(),onClick:()=>t.handleSubmit(y),children:g})})]})]})},sh=(0,cc.observer)((({storyGeometry:e,story:t,storyRef:r})=>{const[i,s]=(0,ll.useState)(null),a=qd(i),o=t.textInput;(0,ll.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,ll.useLayoutEffect)((()=>()=>{a.reset()}),[o.id]),i?(0,nl.jsx)(ih,{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 ah extends HTMLElement{constructor(){super(...arguments),Object.defineProperty(this,"styleElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"story",{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=>{var t;if(!this.shadowRoot)return;"true"===this.getAttribute("is-active-story")&&(null===(t=this.story)||void 0===t||t.activeSlide.onClick({event:e,currentTarget:this.mountPoint,preventNavigation:"true"===this.getAttribute("prevent-navigation")}))}})}setStory(e){this.story=e}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",P()),this.styleElement=t,this.mountPoint.prepend(t)}init(){requestAnimationFrame((()=>{this.mountPoint&&this.story&&(this.story.attachRoot(this.mountPoint),this.mountPoint.addEventListener("click",this.handleClick))}))}destroy(){var e,t;null===(e=this.story)||void 0===e||e.detachRoot(),null===(t=this.mountPoint)||void 0===t||t.removeEventListener("click",this.handleClick)}connectedCallback(){const e=this.attachShadow({mode:"open"});this.mountPoint=document.createElement("div"),this.mountPoint.style.height="100%",this.mountPoint.style.width="100%",e.appendChild(this.mountPoint)}disconnectedCallback(){}}customElements.get("story-slides-container")||customElements.define("story-slides-container",ah);var oh=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 nh=(0,cc.observer)((e=>{var{className:t,story:r,preventNavigation:i,isActiveStory:s}=e,a=oh(e,["className","story","preventNavigation","isActiveStory"]);const o=(0,ll.useRef)(null);(0,ll.useLayoutEffect)((()=>{o.current&&o.current.setStyle(r.context.style)}),[r.context.style]),(0,ll.useEffect)((()=>{if(!o.current)return;const e=o.current;return o.current.setStory(r),e.init(),()=>{e.destroy()}}),[r]);const n=a.isDesktopGeometry?"0px":`${r.actionPanel.height}px`;return(0,nl.jsx)("story-slides-container",{ref:o,style:{bottom:n},class:t,dir:r.dir,"prevent-navigation":i.toString(),"is-active-story":s.toString()})}));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,cc.observer)((e=>{var{story:t,geometry:r,className:i}=e,s=lh(e,["story","geometry","className"]);const{storyReaderOptions:a,commonOptions:o,goodsWidgetOptions:n}=ep(),l=(0,ll.useRef)(null),c=t===s.activeStory,d=r instanceof as,h=a.layout===Ut.Modern,u=d&&h&&!c||t.pauseState.isUIPaused,p=d&&(h&&!c||t.textInput.isOpened);(0,ll.useLayoutEffect)((()=>{const e=parseFloat(String(a.actionPanelBottomOffset));t.actionPanel.setOptions(o),t.actionPanel.setActionPanelHeight(e)}),[t,o,a.actionPanelBottomOffset,d]);return(0,nl.jsxs)("div",{ref:l,className:vl()(Lc.story,i,{[Lc.story_mobile]:!d}),onMouseDown:()=>{t.sharePanel.completeNativeSharing({result:!1})},onTouchStart:()=>{t.sharePanel.completeNativeSharing({result:!1})},"data-testid":"story",children:[d&&h&&(0,nl.jsx)(nd,{hidden:c}),t.canBeShown&&(0,nl.jsx)(id,{hidden:u,story:t,onClose:s.onClose,isDesktopGeometry:d}),(0,nl.jsx)(nh,{className:Lc["story-slides"],story:t,preventNavigation:h&&d,isActiveStory:c,isDesktopGeometry:d}),t.actionPanel.needShown&&(0,nl.jsx)(Wc,{dir:t.dir,isDesktopGeometry:d,hidden:p,actionPanel:t.actionPanel,commonOptions:o,storyReaderOptions:a}),s.activeStory===t&&(0,nl.jsx)(Wd,{story:t,goodsWidgetOptions:n}),s.activeStory===t&&(0,nl.jsx)(sh,{story:t,storyRef:l,storyGeometry:r}),t.sharePanel.isOpened&&(0,nl.jsx)(Jl,{dir:t.dir,className:Lc["share-panel-wrapper"],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:a.sharePanel}),(0,nl.jsx)(hd,{needShowErrorScreen:t.needShowErrorScreen,needShowLoaderScreen:t.needShowLoaderScreen,onReload:async()=>{const e=Boolean(t.error);try{e?await t.reload():t.activeSlide.restart()}catch(e){console.error(e)}}})]})}));var dh=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},hh=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)},ph=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 gh=(()=>{var t,r,i;let s,a,o,n,l,c,d=e.EventEmitter,h=[],u=[],p=[],g=[],f=[];return t=class extends d{constructor(){super(...arguments),r.set(this,(dh(this,h),dh(this,u,!1))),i.set(this,(dh(this,p),dh(this,g,0))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:dh(this,f)}),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 uh(this,r,"f")}set _animating(e){ph(this,r,e,"f")}get _currentIndex(){return uh(this,i,"f")}set _currentIndex(e){ph(this,i,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)`}},r=new WeakMap,i=new WeakMap,(()=>{var e;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=d[Symbol.metadata])&&void 0!==e?e:null):void 0;s=[b.observable],a=[b.observable],o=[b.computed],n=[b.computed],l=[b.action],c=[b.action],hh(t,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},u,p),hh(t,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,f),hh(t,null,o,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,h),hh(t,null,n,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,h),hh(t,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),hh(t,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(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),t})();class fh{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 mh=I(6778),yh={insert:"head",singleton:!1};wl()(mh.A,yh);const vh=mh.A.locals||{};var bh=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 wh=e=>{var{disabled:t,navigationOptions:r,display:i}=e,s=bh(e,["disabled","navigationOptions","display"]);const a=s.dir===Kt.LTR,o=a?s.isNextDisabled:s.isPrevDisabled,n=a?s.isPrevDisabled:s.isNextDisabled,l=o||t,c=n||t;return(0,nl.jsxs)("div",{ref:s.nodeRef,className:vl()(vh["story-list-controls"],{[vh["story-list-controls_hidden"]]:!i}),children:[(0,nl.jsx)("div",{className:vl()(vh["story-list-controls__item"],vh["story-list-controls__item_prev"]),children:(0,nl.jsx)("button",{className:vh["story-list-controls__btn"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onPrev()},disabled:c,dangerouslySetInnerHTML:{__html:r.prevButton.svgSrc.baseState}})}),(0,nl.jsx)("div",{className:vl()(vh["story-list-controls__item"],vh["story-list-controls__item_next"]),children:(0,nl.jsx)("button",{className:vh["story-list-controls__btn"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),t||s.onNext()},disabled:l,dangerouslySetInnerHTML:{__html:r.nextButton.svgSrc.baseState}})})]})},Sh=(0,cc.observer)((e=>{const{storyReaderOptions:t}=ep(),{ref:r,slider:i}=(e=>{const[t]=(0,ll.useState)((()=>new gh)),{storyReaderOptions:r}=ep(),i=(0,ll.useRef)(null);return t.currentIndex=e.activeStoryIndex,(0,ll.useEffect)((()=>(t.init({$el:i.current}),()=>{t.destroy()})),[e.stories,e.dir]),(0,ll.useEffect)((()=>{e.setAnimatedNavigationController(new fh(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;return(0,nl.jsx)("div",{className:vl()(Ic["stories-list-container"]),style:{"--slide-border-radius":`${a}px`,maxWidth:o},children:(0,nl.jsx)("div",{className:Ic["stories-list"],ref:r,dir:s.dir,children:e.storyReader.stories.map(((r,i)=>{const a=r===s,o=r.isNextDisabled,l=r.isPrevDisabled;return(0,nl.jsxs)("div",{style:{width:e.storyGeometry.getWidth()},className:vl()(Ic["stories-list__item"],{[Ic["stories-list__item_active"]]:a}),onClick:()=>{n||e.storyReader.toStoryWithAnimationByIndex(i)},children:[(0,nl.jsx)(ch,{index:i,story:r,slideClickDisabled:n,activeStory:s,geometry:e.storyGeometry,onClose:e.onCloseStory}),(e.storyReader.stories.length>1||r.slidesCount>1)&&(0,nl.jsx)(wh,{dir:e.storyReader.dir,display:a&&s.canBeShown,disabled:n,isNextDisabled:o,isPrevDisabled:l,navigationOptions:t.navigation,onNext:()=>{e.storyReader.goNext()},onPrev:()=>{e.storyReader.goPrev()}})]},r.id)}))})})}));var _h=I(4267),Oh={insert:"head",singleton:!1};wl()(_h.A,Oh);const xh=_h.A.locals||{},kh=({className:e,style:t})=>(0,nl.jsx)("div",{className:vl()(Lc.story,Lc["story-blank"],e),style:t}),Ch=350,Ph="linear",jh=1.6,Eh=2*Math.tan(45*Math.PI/360),Ih=Ch/1e3;class Mh{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===Kt.RTL?-1:1}destroy(){}}const Th=.05;class Lh extends Mh{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>=Th&&this.slider.isEnd?Th:e<=-.05&&this.slider.isBeginning?-.05:e:e}}const Ah=.05;class Rh extends Mh{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>=Ah&&this.slider.isEnd?Ah:e<=-.05&&this.slider.isBeginning?-.05:e:e}}class Bh extends Mh{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 Ft.FLAT:return new Rh(e);case Ft.COVER:return new Lh(e);case Ft.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)},Vh=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 Gh=(()=>{var t,r,i,s;let a,o,n,l,c,d,h,u,p,g,f,m,y,v,w,S,_,O=e.EventEmitter,x=[],k=[],C=[],P=[],j=[],E=[],I=[];return t=class extends O{constructor(){super(...arguments),r.set(this,(Nh(this,x),Nh(this,k,!1))),i.set(this,(Nh(this,C),Nh(this,P,0))),s.set(this,(Nh(this,j),Nh(this,E,null))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:Nh(this,I)}),Object.defineProperty(this,"_dir",{enumerable:!0,configurable:!0,writable:!0,value:Kt.LTR})}get _animating(){return Uh(this,r,"f")}set _animating(e){Vh(this,r,e,"f")}get _currentIndex(){return Uh(this,i,"f")}set _currentIndex(e){Vh(this,i,e,"f")}get effect(){return Uh(this,s,"f")}set effect(e){Vh(this,s,e,"f")}get dir(){return this._dir}get isLtr(){return this._dir===Kt.LTR}get clientWidth(){return this.$el.clientWidth}get animating(){return this._animating}get leftElement(){const e=this.dir===Kt.RTL?1:-1;return this.$el.children.item(this._currentIndex+e)}get rightElement(){const e=this.dir===Kt.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)}))}},r=new WeakMap,i=new WeakMap,s=new WeakMap,(()=>{var e;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=O[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[b.observable],o=[b.observable],n=[b.observable],l=[b.computed],c=[b.computed],d=[b.computed],h=[b.computed],u=[b.computed],p=[b.computed],g=[b.computed],f=[b.computed],m=[b.computed],y=[b.action],v=[b.action],w=[b.action],S=[b.action],_=[b.action],Fh(t,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},k,C),Fh(t,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),Fh(t,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),Fh(t,null,l,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:r},null,x),Fh(t,null,c,{kind:"getter",name:"leftElement",static:!1,private:!1,access:{has:e=>"leftElement"in e,get:e=>e.leftElement},metadata:r},null,x),Fh(t,null,d,{kind:"getter",name:"rightElement",static:!1,private:!1,access:{has:e=>"rightElement"in e,get:e=>e.rightElement},metadata:r},null,x),Fh(t,null,h,{kind:"getter",name:"frontElement",static:!1,private:!1,access:{has:e=>"frontElement"in e,get:e=>e.frontElement},metadata:r},null,x),Fh(t,null,u,{kind:"getter",name:"isBeginning",static:!1,private:!1,access:{has:e=>"isBeginning"in e,get:e=>e.isBeginning},metadata:r},null,x),Fh(t,null,p,{kind:"getter",name:"isEnd",static:!1,private:!1,access:{has:e=>"isEnd"in e,get:e=>e.isEnd},metadata:r},null,x),Fh(t,null,g,{kind:"getter",name:"perspective",static:!1,private:!1,access:{has:e=>"perspective"in e,get:e=>e.perspective},metadata:r},null,x),Fh(t,null,f,{kind:"getter",name:"depth",static:!1,private:!1,access:{has:e=>"depth"in e,get:e=>e.depth},metadata:r},null,x),Fh(t,null,m,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:r},null,x),Fh(t,null,y,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:r},null,x),Fh(t,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,x),Fh(t,null,w,{kind:"method",name:"transformWithAmimation",static:!1,private:!1,access:{has:e=>"transformWithAmimation"in e,get:e=>e.transformWithAmimation},metadata:r},null,x),Fh(t,null,S,{kind:"method",name:"move",static:!1,private:!1,access:{has:e=>"move"in e,get:e=>e.move},metadata:r},null,x),Fh(t,null,_,{kind:"method",name:"endMove",static:!1,private:!1,access:{has:e=>"endMove"in e,get:e=>e.endMove},metadata:r},null,x),r&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),t})();class Wh{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 zh=e=>{const t=(0,ll.useRef)(null),[r]=(0,ll.useState)((()=>new Gh)),{storyReaderOptions:i}=ep();(({slider:e,touchController:t})=>{const r=()=>{e.startMove()},i=({dx:t})=>{e.move(-t)},s=()=>{t.horizontalSwipeGesture&&e.endMove()};(0,ll.useEffect)((()=>(t.on(Qt.TouchStart,r),t.on(Qt.TouchMoveHorizontal,i),t.on(Qt.TouchEnd,s),()=>{t.off(Qt.TouchStart,r),t.off(Qt.TouchMoveHorizontal,i),t.off(Qt.TouchEnd,s)})),[e,t])})({slider:r,touchController:e.touchController});const s=i.scrollStyle;r.currentIndex=e.activeStoryIndex+1;const a=e.touchController;(0,ll.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,ll.useLayoutEffect)((()=>{e.setAnimatedNavigationController(new Wh(r,{closeOnLastSlideByTimer:Boolean(i.closeOnLastSlideByTimer)}))}),[r,e,i.closeOnLastSlideByTimer]),(0,ll.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=I(3476),Hh={insert:"head",singleton:!1};wl()($h.A,Hh);const qh=$h.A.locals||{};var Zh=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 Kh=e=>{var{width:t,disabledByUI:r,navigationOptions:i}=e,s=Zh(e,["width","disabledByUI","navigationOptions"]);const a=s.dir===Kt.LTR,o=(a?s.reachEnd:s.reachStart)||r,n=(a?s.reachStart:s.reachEnd)||r;return(0,nl.jsxs)("div",{className:vl()([qh["stories-list-controls"]],{[qh["stories-list-controls_desktop"]]:J}),children:[(0,nl.jsx)("div",{className:qh["stories-list-controls__btn_next"],style:{transform:`translateY(-50%) translateX(calc(${t/2}px + 100%))`},children:(0,nl.jsx)("button",{className:qh["stories-list-controls__btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onNext()},disabled:o,dangerouslySetInnerHTML:{__html:i.nextButton.svgSrc.baseState}})}),(0,nl.jsx)("div",{className:qh["stories-list-controls__btn_prev"],style:{transform:`translateY(-50%) translateX(calc(-${t/2}px - 200%))`},children:(0,nl.jsx)("button",{className:qh["stories-list-controls__btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.blur(),s.disabled||s.onPrev()},disabled:n,dangerouslySetInnerHTML:{__html:i.prevButton.svgSrc.baseState}})})]})},Qh=(0,cc.observer)((e=>{const{storyReaderOptions:t}=ep(),r=zh(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===Ut.Modern;return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)("div",{className:vl()(xh["stories-list-container"],{[xh["stories-list-container_swipe-up"]]:e.storyReader.closeGestureInAction,[xh["stories-list-container_desktop"]]: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,nl.jsx)("div",{className:xh["stories-list"],style:{transform:`translateZ(-${r.depth}px)`},children:(0,nl.jsxs)("div",{className:vl()(xh["stories-list__effect-viewer"]),ref:r.ref,children:[(0,nl.jsx)("div",{className:vl()(xh["stories-list__item"]),children:(0,nl.jsx)(kh,{})}),s.map(((t,r)=>(0,nl.jsx)("div",{className:vl()(xh["stories-list__item"]),children:(0,nl.jsx)(ch,{slideClickDisabled:o,index:r,story:t,activeStory:i,geometry:e.storyGeometry,onClose:e.onCloseStory})},t.id))),(0,nl.jsx)("div",{className:vl()(xh["stories-list__item"]),children:(0,nl.jsx)(kh,{})})]})})}),!n&&(0,nl.jsx)(Kh,{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()})]})})),Yh=(0,cc.observer)((({storyReader:e})=>{const{storyReaderOptions:t}=ep(),r=uc();(({touchController:e,activeStory:t})=>{(0,ll.useEffect)((()=>(e.on(Qt.LongTouchDetected,r),e.on(Qt.TouchEnd,i),()=>{e.off(Qt.LongTouchDetected,r),e.off(Qt.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}=ep();return(0,ll.useMemo)((()=>{var r;const i=new ls(e.vw,e.vh),s=i.getViewportCorrectionPadding(),a=new ns(e,{vw:e.vw,vh:e.vh-(pc+gc)},null!==(r=null==t?void 0:t.actionPanel.height)&&void 0!==r?r:0,i).create(),o=a instanceof as;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===Ut.Modern;return(0,ll.useEffect)((()=>{e.useModernLayout=n}),[e,n]),(0,dc.createPortal)((0,nl.jsxs)(Pc,{isDesktopGeometry:a,viewport:r,storyReader:e,children:[a&&n?(0,nl.jsx)(Sh,{storyGeometry:s,storyReader:e,onCloseStory:()=>{e.close()}}):(0,nl.jsx)(Qh,{isDesktopGeometry:a,storyGeometry:s,safeAreaFrameCalculator:i,correctionPaddingStyle:o,storyReader:e,onCloseStory:()=>{e.close()}}),(0,nl.jsx)(Fl,{orientation:G.PORTRAIT_PRIMARY,onOrientationChange:({isWrong:t})=>{e.activeStory&&(t?e.activeStory.pauseUI(e):e.activeStory.resumeUI(e))}})]}),document.body)}));var Xh=I(7161),Jh=I(429);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=I(2083);const ru={[Za.BottomSheet]:tu.literal`iam-bottom-sheet`,[Za.Fullscreen]:tu.literal`iam-fullscreen-modal`,[Za.Modal]:tu.literal`iam-modal`},iu=Xh.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}.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 .close-strip-btn{margin-top:8px;width:32px;height:4px;background-color:#00000080;border-radius:var(--slide-border-top-left-radius);position:absolute;z-index:10000;left:50%;transform:translate3d(-50%,0,0)}`;var su=I(318),au=I(5125);class ou{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;null===(e=this.touchController)||void 0===e||e.off(Qt.TouchMoveVertical,this.handleTouchMoveVertical),null===(t=this.touchController)||void 0===t||t.off(Qt.TouchEnd,this.handleTouchEnd)}setTouchController(e){this.touchController=e,this.touchController.enable(),this.touchController.on(Qt.TouchMoveVertical,this.handleTouchMoveVertical),this.touchController.on(Qt.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.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 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},lu=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})},du=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)},hu=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;let d,h,u,p,g,f,m,y,v,b,w,S,_=[(0,Jh.customElement)("iam-bottom-sheet")],O=[],x=Xh.LitElement,k=[],C=[],P=[],j=[],E=[],I=[],M=[],T=[],L=[],A=[],R=[],B=[],D=[],N=[],F=[],U=[],V=[],G=[],W=[],z=[];h=class extends x{get open(){return du(this,e,"f")}set open(t){hu(this,e,t,"f")}get geometry(){return du(this,t,"f")}set geometry(e){hu(this,t,e,"f")}get appearanceOptions(){return du(this,r,"f")}set appearanceOptions(e){hu(this,r,e,"f")}get touchController(){return du(this,i,"f")}set touchController(e){hu(this,i,e,"f")}get desktopMode(){return du(this,s,"f")}set desktopMode(e){hu(this,s,e,"f")}get isVisible(){return du(this,a,"f")}set isVisible(e){hu(this,a,e,"f")}get isClosed(){return du(this,o,"f")}set isClosed(e){hu(this,o,e,"f")}get backdropRef(){return du(this,n,"f")}set backdropRef(e){hu(this,n,e,"f")}get bottomSheetBoxRef(){return du(this,l,"f")}set bottomSheetBoxRef(e){hu(this,l,e,"f")}get bottomSheetRef(){return du(this,c,"f")}set bottomSheetRef(e){hu(this,c,e,"f")}constructor(){super(),e.set(this,lu(this,k,!1)),t.set(this,(lu(this,C),lu(this,P,void 0))),r.set(this,(lu(this,j),lu(this,E,void 0))),i.set(this,(lu(this,I),lu(this,M,void 0))),s.set(this,(lu(this,T),lu(this,L,void 0))),a.set(this,(lu(this,A),lu(this,R,!1))),o.set(this,(lu(this,B),lu(this,D,!0))),n.set(this,(lu(this,N),lu(this,F,null))),l.set(this,(lu(this,U),lu(this,V,null))),c.set(this,(lu(this,G),lu(this,W,null))),Object.defineProperty(this,"bottomSheetSwipeController",{enumerable:!0,configurable:!0,writable:!0,value:(lu(this,z),new ou(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(),this.bottomSheetSwipeController.setTouchController(this.touchController)}disconnectedCallback(){super.disconnectedCallback()}close(){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(){if(this.isClosed)return Xh.nothing;const e={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`},t={width:this.geometry.getWidth()+"px"},r={backgroundColor:this.appearanceOptions.closeButton.backgroundColor,width:`${this.appearanceOptions.closeButton.width}px`,height:`${this.appearanceOptions.closeButton.height}px`,marginTop:`${this.appearanceOptions.closeButton.marginTop}px`};return Xh.html`<div id="bottom-sheet" class="bottom-sheet"><div id="bottom-sheet__backdrop" style="${(0,su.styleMap)({"--backdrop-opacity":this.appearanceOptions.backdrop.opacity})}" @click="${this.close}" class="bottom-sheet__backdrop ${(0,au.classMap)({"bottom-sheet__backdrop--open":this.isVisible})}"></div><div class="bottom-sheet__box-wrapper ${(0,au.classMap)({"bottom-sheet__box-wrapper--desktop-mode":this.desktopMode})}" style="${(0,su.styleMap)(t)}"><div style="${(0,su.styleMap)(e)}" id="bottom-sheet__box" class="bottom-sheet__box ${(0,au.classMap)({"bottom-sheet__box--open":this.isVisible})}"><div class="bottom-sheet__header"><div class="close-strip-btn" style="${(0,su.styleMap)(r)}"></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,cu(h,"BottomSheet"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=x[Symbol.metadata])&&void 0!==e?e:null):void 0;u=[(0,Jh.property)({type:Boolean})],p=[(0,Jh.property)({type:Object})],g=[(0,Jh.property)({type:Object})],f=[(0,Jh.property)({type:Object})],m=[(0,Jh.property)({type:Boolean})],y=[(0,Jh.state)()],v=[(0,Jh.state)()],b=[(0,Jh.query)("#bottom-sheet__backdrop")],w=[(0,Jh.query)("#bottom-sheet__box")],S=[(0,Jh.query)("#bottom-sheet")],nu(h,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),nu(h,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),nu(h,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),nu(h,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},M,T),nu(h,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,A),nu(h,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),nu(h,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),nu(h,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),nu(h,null,w,{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},V,G),nu(h,null,S,{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},W,z),nu(null,d={value:h},_,{kind:"class",name:h.name,metadata:t},null,O),h=d.value,t&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(h,"styles",{enumerable:!0,configurable:!0,writable:!0,value:iu}),lu(h,O)})();const uu=Xh.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)}.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 pu=I(6968);const gu=Xh.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 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;let r,i,s,a,o=[(0,Jh.customElement)("iam-modal-close-btn")],n=[],l=Xh.LitElement,c=[],d=[],h=[],u=[];i=class extends l{get closeBtnPosition(){return vu(this,e,"f")}set closeBtnPosition(t){bu(this,e,t,"f")}get dir(){return vu(this,t,"f")}set dir(e){bu(this,t,e,"f")}render(){var e;return Xh.html`<button class="close-btn ${(0,au.classMap)({"close-btn--position_start":this.closeBtnPosition===ve.Start,"close-btn--position_end":this.closeBtnPosition===ve.End,"close-btn--position_none":this.closeBtnPosition===ve.None,"close-btn--dir_ltr":this.dir===Kt.LTR,"close-btn--dir_rtl":this.dir===Kt.RTL})}">${(0,pu.unsafeHTML)(null===(e=Tt.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>`}constructor(){super(...arguments),e.set(this,mu(this,c,void 0)),t.set(this,(mu(this,d),mu(this,h,void 0))),mu(this,u)}};e=new WeakMap,t=new WeakMap,yu(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,Jh.property)({type:Number})],a=[(0,Jh.property)({type:String})],fu(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),fu(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),fu(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:gu}),mu(i,n)})();var wu=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},Su=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})},Ou=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)},xu=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=[(0,Jh.customElement)("iam-modal")],b=[],w=Xh.LitElement,S=[],_=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],M=[],T=[],L=[],A=[],R=[],B=[];c=class extends w{get open(){return Ou(this,e,"f")}set open(t){xu(this,e,t,"f")}get fullscreen(){return Ou(this,t,"f")}set fullscreen(e){xu(this,t,e,"f")}get geometry(){return Ou(this,r,"f")}set geometry(e){xu(this,r,e,"f")}get appearanceOptions(){return Ou(this,i,"f")}set appearanceOptions(e){xu(this,i,e,"f")}get dir(){return Ou(this,s,"f")}set dir(e){xu(this,s,e,"f")}get isVisible(){return Ou(this,a,"f")}set isVisible(e){xu(this,a,e,"f")}get isClosed(){return Ou(this,o,"f")}set isClosed(e){xu(this,o,e,"f")}get backdropRef(){return Ou(this,n,"f")}set backdropRef(e){xu(this,n,e,"f")}constructor(){super(),e.set(this,Su(this,S,!1)),t.set(this,(Su(this,_),Su(this,O,!1))),r.set(this,(Su(this,x),Su(this,k,void 0))),i.set(this,(Su(this,C),Su(this,P,void 0))),s.set(this,(Su(this,j),Su(this,E,void 0))),a.set(this,(Su(this,I),Su(this,M,!1))),o.set(this,(Su(this,T),Su(this,L,!0))),n.set(this,(Su(this,A),Su(this,R,null))),Su(this,B)}close(){const e=this.appearanceOptions.animationType===ye.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 ye.SlideInUp:return"slideInUp";case ye.FadeIn:return"fadeInWithZoom";default:return""}}getOutModalAnimationCSSClass(e){switch(e){case ye.SlideInUp:return"slideInOut";case ye.FadeIn:return"fadeOutWithZoom";default:return""}}getBackdropAnimationCSSClass(e){return e?"fadeIn":"fadeOut"}render(){const e=this.fullscreen?0:this.appearanceOptions.borderRadius,t={background:this.appearanceOptions.background,height:this.geometry.getHeight()+"px",width:this.geometry.getWidth()+"px","--slide-border-top-left-radius":`${e}px`,"--slide-border-top-right-radius":`${e}px`,"--slide-border-bottom-left-radius":`${e}px`,"--slide-border-bottom-right-radius":`${e}px`},r=this.appearanceOptions.animationType,i=this.isVisible?this.getEnterModalAnimationCSSClass(r):this.getOutModalAnimationCSSClass(r),s=this.getBackdropAnimationCSSClass(this.isVisible);return Xh.html`<div class="modal"><div id="modal__backdrop" style="${(0,su.styleMap)({"--backdrop-opacity":this.appearanceOptions instanceof be?this.appearanceOptions.backdrop.opacity:void 0})}" class="modal__backdrop ${(0,au.classMap)({[s]:r!==ye.None})}"></div><div @click="${this.close}" class="modal__box ${(0,au.classMap)({[i]:!0})}">${this.fullscreen?Xh.html`<div class="modal__header"><iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn></div>`:Xh.nothing}<div style="${(0,su.styleMap)(t)}" class="modal__box-content ${(0,au.classMap)({"modal__box-content--fullscreen":this.fullscreen})}">${this.fullscreen?Xh.nothing:Xh.html`<div class="modal__header"><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,_u(c,"Modal"),(()=>{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,Jh.property)({type:Boolean})],h=[(0,Jh.property)({type:Boolean})],u=[(0,Jh.property)({type:Object})],p=[(0,Jh.property)({type:Object})],g=[(0,Jh.property)({type:String})],f=[(0,Jh.state)()],m=[(0,Jh.state)()],y=[(0,Jh.query)("#modal__backdrop")],wu(c,null,d,{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},S,_),wu(c,null,h,{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},O,x),wu(c,null,u,{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},k,C),wu(c,null,p,{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},P,j),wu(c,null,g,{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},E,I),wu(c,null,f,{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},M,T),wu(c,null,m,{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},L,A),wu(c,null,y,{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},R,B),wu(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:uu}),Su(c,b)})();var ku=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},Cu=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},Pu=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})},ju=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)},Eu=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=[(0,Jh.customElement)("iam-fullscreen-modal")],c=[],d=Xh.LitElement,h=[],u=[],p=[],g=[],f=[],m=[];s=class extends d{get open(){return ju(this,e,"f")}set open(t){Eu(this,e,t,"f")}get geometry(){return ju(this,t,"f")}set geometry(e){Eu(this,t,e,"f")}get appearanceOptions(){return ju(this,r,"f")}set appearanceOptions(e){Eu(this,r,e,"f")}render(){return Xh.html`<iam-modal ?open="${this.open}" .fullscreen="${!0}" .geometry="${this.geometry}" .appearanceOptions="${this.appearanceOptions}"><slot></slot></iam-modal>`}constructor(){super(...arguments),e.set(this,Cu(this,h,!1)),t.set(this,(Cu(this,u),Cu(this,p,void 0))),r.set(this,(Cu(this,g),Cu(this,f,void 0))),Cu(this,m)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,Pu(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,Jh.property)({type:Boolean})],o=[(0,Jh.property)({type:Object})],n=[(0,Jh.property)({type:Object})],ku(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),ku(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),ku(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),ku(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}),Cu(s,c)})()})();var Iu=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},Tu=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)},Au=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;let n,l,c,d,h,u,p,g,f,m=[(0,Jh.customElement)("message-view-factory")],y=[],v=Xh.LitElement,b=[],w=[],S=[],_=[],O=[],x=[],k=[],C=[],P=[],j=[],E=[],I=[],M=[],T=[];l=class extends v{get appearanceOptions(){return Lu(this,e,"f")}set appearanceOptions(t){Au(this,e,t,"f")}get type(){return Lu(this,t,"f")}set type(e){Au(this,t,e,"f")}get open(){return Lu(this,r,"f")}set open(e){Au(this,r,e,"f")}get geometry(){return Lu(this,i,"f")}set geometry(e){Au(this,i,e,"f")}get touchController(){return Lu(this,s,"f")}set touchController(e){Au(this,s,e,"f")}get desktopMode(){return Lu(this,a,"f")}set desktopMode(e){Au(this,a,e,"f")}get dir(){return Lu(this,o,"f")}set dir(e){Au(this,o,e,"f")}render(){const e=ru[this.type];return e?tu.html`
|
|
2
2
|
<${e}
|
|
3
3
|
.open=${this.open}
|
|
4
4
|
.geometry=${this.geometry}
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
.dir=${this.dir}>
|
|
9
9
|
<slot></slot>
|
|
10
10
|
</${e}>
|
|
11
|
-
`:null}constructor(){super(...arguments),e.set(this,Zh(this,b,void 0)),t.set(this,(Zh(this,w),Zh(this,S,void 0))),r.set(this,(Zh(this,_),Zh(this,O,!1))),i.set(this,(Zh(this,x),Zh(this,k,void 0))),s.set(this,(Zh(this,C),Zh(this,P,void 0))),a.set(this,(Zh(this,j),Zh(this,E,void 0))),o.set(this,(Zh(this,M),Zh(this,I,void 0))),Zh(this,T)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,Kh(l,"MessageViewFactory"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=v[Symbol.metadata])&&void 0!==e?e:null):void 0;c=[(0,mh.property)({type:Object})],d=[(0,mh.property)({type:Number})],u=[(0,mh.property)({type:Boolean})],h=[(0,mh.property)({type:Object})],p=[(0,mh.property)({type:Object})],g=[(0,mh.property)({type:Boolean})],f=[(0,mh.property)({type:String})],qh(l,null,c,{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,w),qh(l,null,d,{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},S,_),qh(l,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},O,x),qh(l,null,h,{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},k,C),qh(l,null,p,{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},P,j),qh(l,null,g,{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},E,M),qh(l,null,f,{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},I,T),qh(null,n={value:l},m,{kind:"class",name:l.name,metadata:t},null,y),l=n.value,t&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(l,"styles",{enumerable:!0,configurable:!0,writable:!0,value:fh.css``}),Zh(l,y)})();const Jh=fh.css`.slides-container{height:100%;width:100%;position:absolute;top:0;left:0;bottom:0;right:0}`;var Xh=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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;let s,a,o,n,l,c,d=[(0,mh.customElement)("message-slide")],u=[],h=fh.LitElement,p=[],g=[],f=[],m=[],y=[],v=[],b=[],w=[];a=class extends h{get message(){return rp(this,e,"f")}set message(t){ip(this,e,t,"f")}get styleContext(){return rp(this,t,"f")}set styleContext(e){ip(this,t,e,"f")}get geometry(){return rp(this,r,"f")}set geometry(e){ip(this,r,e,"f")}get slidesContainer(){return rp(this,i,"f")}set slidesContainer(e){ip(this,i,e,"f")}constructor(){super(),e.set(this,ep(this,p,void 0)),t.set(this,(ep(this,g),ep(this,f,void 0))),r.set(this,(ep(this,m),ep(this,y,void 0))),i.set(this,(ep(this,v),ep(this,b,null))),ep(this,w)}aconnectedCallback(){super.connectedCallback()}firstUpdated(e){super.firstUpdated(e),setTimeout((()=>{this.initAndStartSlide()}),50)}disconnectedCallback(){super.disconnectedCallback(),this.message.stop()}handleSlideClick(e){var t;e.currentTarget&&(e.preventDefault(),e.stopPropagation(),null===(t=this.message.activeSlide)||void 0===t||t.onClick(e,e.currentTarget))}async initAndStartSlide(){const e=this.slidesContainer;if(!e)throw new Error("[IAM]: no slide content");this.message.attachRoot(e),await this.message.init(),await this.message.start()}render(){var e;return fh.html`<style nonce="${T()}">${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,i=new WeakMap,tp(a,"MessageSlide"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=h[Symbol.metadata])&&void 0!==e?e:null):void 0;o=[(0,mh.property)({type:Object})],n=[(0,mh.property)({type:String})],l=[(0,mh.property)({type:Object})],c=[(0,mh.query)(".slides-container")],Xh(a,null,o,{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},p,g),Xh(a,null,n,{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},f,m),Xh(a,null,l,{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},y,v),Xh(a,null,c,{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},b,w),Xh(null,s={value:a},d,{kind:"class",name:a.name,metadata:t},null,u),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:[Jh]}),ep(a,u)})();const sp=fh.css`@keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner{position:absolute;top:calc(50% - 2rem / 2);left:calc(50% - 2rem / 2);width:2rem;height:2rem;border-radius:50%;animation:spin .6s infinite linear}`;var ap=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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!0},op=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},np=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})};(()=>{let e,t,r=[(0,mh.customElement)("iam-spinner")],i=[],s=fh.LitElement;t=class extends s{render(){const e="white";return fh.html`<div class="spinner" style="${(0,Sh.styleMap)({border:`solid 2px ${e}`,borderColor:`transparent ${e} ${e} ${e}`})}"></div>`}};np(t,"Spinner"),(()=>{var a;const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(a=s[Symbol.metadata])&&void 0!==a?a:null):void 0;ap(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,i),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),Object.defineProperty(t,"styles",{enumerable:!0,configurable:!0,writable:!0,value:sp}),op(t,i)})();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,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),h=!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(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var m=(0,r[p])("accessor"===l?{get:u.get,set:u.set}:u[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))&&(u.get=n),(n=o(m.set))&&(u.set=n),(n=o(m.init))&&s.unshift(n)}else(n=o(m))&&("field"===l?s.unshift(n):u[c]=n)}d&&Object.defineProperty(d,i.name,u),h=!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})},up=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)},hp=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,u,h=[(0,mh.customElement)("iam-reader"),O],p=[],g=fh.LitElement,f=[],m=[],y=[],v=[],b=[],w=[],S=[],_=[],x=[],k=[];o=class extends g{get options(){return up(this,e,"f")}set options(t){hp(this,e,t,"f")}get desktopMode(){return up(this,t,"f")}set desktopMode(e){hp(this,t,e,"f")}get dir(){return up(this,r,"f")}set dir(e){hp(this,r,e,"f")}get viewModel(){return up(this,i,"f")}set viewModel(e){hp(this,i,e,"f")}get open(){return up(this,s,"f")}set open(e){hp(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,rr.LTR))),i.set(this,(cp(this,w),cp(this,S,null))),s.set(this,(cp(this,_),cp(this,x,!0))),Object.defineProperty(this,"viewportController",{enumerable:!0,configurable:!0,writable:!0,value:(cp(this,k),new yh(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){"Escape"===e.key&&(this.open=!1)}handleClosed(){this.open=!1,this.viewModel.close()}updated(e){var t;super.updated(e);const r=document.documentElement.style.overflow;(null===(t=this.viewModel)||void 0===t?void 0:t.activeMessage)?(this.open=!0,document.documentElement.style.overflow="hidden"):(this.open=!1,document.documentElement.style.overflow=r)}getMessageTypeByEnviroment(e){return this.desktopMode&&e===uo.Fullscreen?(console.warn("[IAM]: desktop only supports modal window"),uo.Modal):e}createSlideGeometry(e){return(new Oo).create(e)}createMessageGeometry(e,t){return(new yo).create(e,{appearanceOptions:t,vw:this.viewportController.vw,vh:this.viewportController.vh,desktopMode:this.desktopMode})}render(){var e,t;const r=null===(e=this.viewModel)||void 0===e?void 0:e.activeMessage,i=null===(t=this.viewModel)||void 0===t?void 0:t.touchController;if(!(null==r?void 0:r.context))return null;const s=r.type,a=this.createMessageGeometry(s,r.appearanceOptions),o=this.createSlideGeometry(a);return fh.html`<message-view-factory type="${s}" @closed="${this.handleClosed}" .appearanceOptions="${r.appearanceOptions}" .geometry="${a}" .open="${this.open}" .dir="${this.dir}" .desktopMode="${this.desktopMode}" .touchController="${i}"><message-slide .message="${r}" .styleContext="${r.context.style}" .geometry="${o}"></message-slide></message-view-factory>`}};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,mh.property)({type:Object})],l=[(0,mh.property)({type:Boolean})],c=[(0,mh.property)({type:String})],d=[(0,mh.property)({type:Object})],u=[(0,mh.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,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},x,k),lp(null,a={value:o},h,{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:fh.css`.iam-container{position:fixed;inset:0;z-index:1000}`}),cp(o,p)})();const pp=e=>{const{storyManager:t}=yp(),r=(0,xl.useRef)(null),i=t.config.dir;return(0,xl.useEffect)((()=>{const e=r.current;e.desktopMode=re,e.dir=i,e.viewModel=t.inAppMessaging}),[t,i]),(0,Ol.jsx)("iam-reader",{ref:r})},gp=kl().createContext({storyManager:yl,commonOptions:Vt,storyReaderOptions:Zt,gameReaderOptions:Ft,goodsWidgetOptions:Gt,inAppMessagingOptions:Qt});let fp=!1;const mp=(0,kc.observer)((e=>{bp(e.config),wp(e);const{commonOptions:t,gameReaderOptions:r,storyReaderOptions:i,goodsWidgetOptions:s,inAppMessagingOptions:a}=Sp(e),o=(({storyManager:e})=>{const[t,r]=(0,xl.useState)(null);return(0,xl.useEffect)((()=>{const t=e.createStoryReader();return r(t),()=>{t.destroy()}}),[e]),t})({storyManager:yl}),n=Lc({storyManager:yl});(0,xl.useEffect)((()=>{if(fp)throw new Error("There can only be one instance of <IASContainer /> per application");return fp=!0,()=>{fp=!1,yl.clearConfig()}}),[]);const l=(0,xl.useMemo)((()=>({storyManager:yl,commonOptions:t,gameReaderOptions:r,storyReaderOptions:i,goodsWidgetOptions:s,inAppMessagingOptions:a})),[yl,t,r,i,s]);return(0,Ol.jsxs)(gp.Provider,{value:l,children:[(null==n?void 0:n.isOpened)&&(0,Ol.jsx)(Ac,{gameReader:n}),(null==o?void 0:o.isOpened)&&(0,Ol.jsx)(gh,{storyReader:o}),(0,Ol.jsx)(pp,{}),e.children]})})),yp=()=>(0,xl.useContext)(gp),vp=e=>{const t=t=>{27===t.keyCode&&e()};(0,xl.useEffect)((()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)})),[])},bp=e=>{(0,xl.useEffect)((()=>{yl.setConfig(e)}),[JSON.stringify(e)])},wp=({onClickOnStory:e,onShowStory:t,onCloseStory:r,onShowSlide:i,onClickOnButton:s,onLikeStory:a,onDislikeStory:o,onFavoriteStory:n,onShareStory:l,onShareStoryWithPath:c,onFeedImpression:d,onVisibleAreaUpdated:u,onWidgetEvent:h})=>{(0,xl.useEffect)((()=>{const p=[{event:"clickOnStory",handler:e},{event:"showStory",handler:t},{event:"closeStory",handler:r},{event:"showSlide",handler:i},{event:"clickOnButton",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:u},{event:"widgetEvent",handler:h}];return p.forEach((({event:e,handler:t})=>{t&&yl.on(e,t)})),()=>{p.forEach((({event:e,handler:t})=>{t&&yl.off(e,t)}))}}),[e,t,r,i,s,a,o,n,l,c,d,u,h])},Sp=({commonOptions:e,gameReaderOptions:t,storyReaderOptions:r,goodsWidgetOptions:i})=>{const s=(0,xl.useRef)(new _l).current,a=(0,xl.useMemo)((()=>(e&&s.setCommonOptions(e),s.commonOptions)),[JSON.stringify(e)]),o=(0,xl.useMemo)((()=>(t&&s.setGameReaderOptions(t),s.gameReaderOptions)),[JSON.stringify(t)]),n=(0,xl.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,xl.useMemo)((()=>(r&&s.setStoryReaderOptions(r),s.storyReaderOptions)),[JSON.stringify(r)]),goodsWidgetOptions:n,inAppMessagingOptions:Qt}},_p=({dir:e,feed:t,slider:r,storyListOptions:i,viewportContainerRef:s})=>{const{storyManager:a}=yp(),o=a.storyReaderViewModel;(0,xl.useEffect)((()=>{if(r&&i.autoScrollOnStoryClose&&o)return o.on(Hs.Close,n),()=>{o.off(Hs.Close,n)}}),[r,i.direction,i.autoScrollOnStoryClose,o]);const n=a=>{if(!r||t!==a.feed||a.type!==Ge.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 dn(i.x+t,i.y+r,i.width,i.height)})(r);if(!n)return;const l=((t,r)=>new dn(e===rr.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)}},Op=(0,xl.forwardRef)(((e,t)=>{const r=e.sliderOptions.card,i=e.sliderOptions.favoriteCard,s=r.border,a=r.opened.border,o=e.sliderOptions.navigation,n=()=>{var e,t,r;return(null!==(e=a.radius)&&void 0!==e?e:s.radius)-parseFloat(null!==(t=a.width)&&void 0!==t?t:s.width)-parseFloat(null!==(r=a.gap)&&void 0!==r?r:s.gap)};return(0,Ol.jsx)("div",{dir:e.dir,ref:t,className:e.className,style:Object.assign(Object.assign({},(()=>{var t,l,c,d,u,h,p,g,f,m,v,b,w,S,_,O,x,k,C,j,E;const M=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":s.color,"--storiesBorderReadColor":null!==(t=a.color)&&void 0!==t?t:s.color,"--storiesBorderNotReadGradientColor":null==s?void 0:s.gradient,"--storiesBorderReadGradientColor":null!==(l=null==a?void 0:a.gradient)&&void 0!==l?l:null==s?void 0:s.gradient,"--storiesListCardFavoriteGradientColor":null===(c=e.sliderOptions.favoriteCard.border)||void 0===c?void 0:c.gradient,"--storiesListCardUgcGradientColor":null===(d=e.sliderOptions.ugcCard.border)||void 0===d?void 0:d.gradient,"--storiesGap":r.gap+"px","--storiesHeight":r.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":s.width+"px","--storiesListBorderReadWidth":(null!==(u=a.width)&&void 0!==u?u:a.width)+"px","--storiesListBorderGapNotRead":s.gap+"px","--storiesListBorderGapRead":(null!==(h=a.gap)&&void 0!==h?h:a.gap)+"px","--storiesListBorderRadius":s.radius+"px","--storiesListBorderRadiusRead":(null!==(p=a.radius)&&void 0!==p?p:a.radius)+"px","--storiesListItemMaskColor":r.mask.color,"--storiesListItemOpenedMaskColor":null!==(g=r.opened.mask.color)&&void 0!==g?g:r.mask.color,"--storiesListItemMaskLinearGradient":M(r.mask),"--storiesListItemOpenedMaskLinearGradient":M(null!=(null===(m=null===(f=r.opened)||void 0===f?void 0:f.mask)||void 0===m?void 0:m.linearGradient)?r.opened.mask:r.mask),"--storiesListCardFavoriteTitle":y(i.title.padding.toString())?i.title.padding+"px":i.title.padding,"--storiesListCardFavoriteGap":y(i.gap.toString())?i.gap+"px":i.gap,"--storiesListCardUgcMaskColor":e.sliderOptions.ugcCard.mask.color,"--storiesListCardUgcMaskLinearGradient":M(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleFontFamily":"InternalPrimaryFont","--storiesListItemTitleFont":r.title.font,"--storiesListItemTitlePadding":y(r.title.padding.toString())?r.title.padding+"px":r.title.padding,"--storiesListControlsSize":y(o.controlsSize.toString())?o.controlsSize+"px":o.controlsSize,"--storiesListControlsBackgroundColor":o.controlsBackgroundColor,"--storiesListControlsColor":o.controlsColor,"--storiesListInnerBorderRadiusNotRead":s.radius-parseFloat(s.width)-parseFloat(s.gap)+"px","--storiesListInnerBorderRadiusRead":n()+"px","--storiesListCardDropShadow":r.dropShadow,"--storiesListCardOpenedDropShadow":null!==(v=r.opened.dropShadow)&&void 0!==v?v:r.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":(null===(b=r.svgMask)||void 0===b?void 0:b.cardMask)?`url("data:image/svg+xml,${P(null===(w=r.svgMask)||void 0===w?void 0:w.cardMask)}")`:null,"--storiesListCardOpenedMask":(null===(S=r.opened.svgMask)||void 0===S?void 0:S.cardMask)?`url("data:image/svg+xml,${P(null===(_=r.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,${P(null===(x=e.sliderOptions.ugcCard.svgMask)||void 0===x?void 0:x.cardMask)}")`:null};let T=null;return T=null===(k=r.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,${P(e.mask)}")`:null)),T=null===(C=r.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,${P(e.mask)}")`:null)),T=null===(j=e.sliderOptions.favoriteCard.svgMask)||void 0===j?void 0:j.overlayMask,null!=T&&Array.isArray(T)&&T.forEach(((e,t)=>I[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${P(e.mask)}")`:null)),T=null===(E=e.sliderOptions.ugcCard.svgMask)||void 0===E?void 0:E.overlayMask,null!=T&&Array.isArray(T)&&T.forEach(((e,t)=>I[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${P(e.mask)}")`:null)),I})()),e.style),children:e.children})})),xp=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),kp=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const r=(0,xl.useRef)(null);return(0,xl.useEffect)((()=>{(()=>{if(!e)return;const i=r.current,s=()=>{i.play().then((()=>{if(xp){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,Ol.jsx)("video",{ref:r,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},Cp=({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 cn&&(a=a.concat(s("storiesListCardFavoriteOverlay",null===(o=r.svgMask)||void 0===o?void 0:o.overlayMask))),a=e instanceof rn?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 Pp=M(6892),jp={insert:"head",singleton:!1};Bl()(Pp.A,jp);const Ep=Pp.A.locals||{},Mp=(0,kc.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,xl.useState)(!1),{getAllCardsOverlayMaskStyles:u}=Cp(l),{getCardTitleAlignClass:h,getTitleStyle:p,getTitleWrapperStyle:g}=(({dir:e,story:t,cardOptions:r,favoriteCardOptions:i,ugcCardOptions:s})=>({getCardTitleAlignClass:()=>{const t=r.title.textAlign,i=t===lt.START||t===lt.LEFT,s=t===lt.END||t===lt.RIGHT,a=e===rr.LTR;return{[Ep["align-left"]]:i&&a||s&&!a,[Ep["align-center"]]:t===lt.CENTER,[Ep["align-right"]]:s&&a||i&&!a}},getTitleStyle:()=>{const e={};return t.titleColor&&r.title.position===ct.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 cn&&(e=Object.assign(Object.assign({},e),{color:i.title.color})),t.titleColor&&t instanceof rn&&(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=Ep[`_background-color-${o.color}`+(!0===o.gradient?"-gradient":"")]);const l=(()=>{let s;return s=e instanceof cn?r:e instanceof rn?i:e.isOpened&&t.opened||t,s})(),c=Boolean(l.dropShadow),d=Boolean(null===(s=l.svgMask)||void 0===s?void 0:s.cardMask),u=Boolean(null===(a=l.border)||void 0===a?void 0:a.gradient);return[n,{[Ep["_is-read"]]:e.isOpened},{[Ep["_format-rectangle"]]:t.variant===Kt.STYLE_RECTANGLE},{[Ep["_format-circle"]]:t.variant===Kt.STYLE_CIRCLE},{[Ep["_format-quad"]]:t.variant===Kt.STYLE_QUAD},{[Ep["_favorite-cell"]]:e instanceof cn},{[Ep["_ugc-cell"]]:e instanceof rn},{[Ep["_has-drop-shadow"]]:c},{[Ep["_has-card-svg-mask"]]:d},{[Ep["_has-border-gradient-color"]]:u}]},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===ct.CARD_INSIDE_BOTTOM,b=r.title.position===ct.CARD_OUTSIDE_TOP,w=r.title.position===ct.CARD_OUTSIDE_BOTTOM;return(0,Ol.jsxs)("div",{"data-id":t.id,className:Al()("ias-stories-slide-wrapper",Ep["stories-slide-wrapper"],{[Ep.isTitleCardOutsideTop]:b,[Ep.isTitleCardOutsideBottom]:w}),style:a,rel:"noreferrer",onClick:e=>{e.stopPropagation(),e.preventDefault(),n(t)},children:[r.title.display&&b&&(0,Ol.jsx)("div",{className:Al()(Ep["stories-slide__content"],Ep.__position_outside_top),style:g(),children:(0,Ol.jsx)("div",{className:Al()(Ep["stories-slide__title"],Ep.clamp,h()),style:p(),children:t.title})}),(0,Ol.jsxs)("div",{className:Al()("ias-stories-slide",Ep["stories-slide"],f()),style:m(),children:[(0,Ol.jsxs)("div",{className:Ep["stories-slide__inner"],children:[(0,Ol.jsx)("div",{className:Ep["stories-slide-image"],style:{backgroundColor:t.backgroundColor?t.backgroundColor:"transparent"},children:(0,Ol.jsx)("div",{className:Ep["stories-slide-image__wrap"],children:(0,Ol.jsxs)("div",{className:Al()(Ep["stories-slide-image__image"],Ep._mode_list,{[Ep["video-loaded"]]:c,[Ep["ugc-card-cell"]]:t instanceof rn}),children:[y&&(0,Ol.jsx)("img",{src:y,alt:t.title,loading:r.coverLazyLoading?"lazy":"eager"},y),t.videoCoverSrc&&(0,Ol.jsx)(kp,{onVideoCoverLoaded:()=>d(!0),videoCoverSrc:t.videoCoverSrc}),o]})})}),(0,Ol.jsx)("div",{className:Ep["stories-slide__mask"]}),r.title.display&&v&&(0,Ol.jsx)("div",{className:Ep["stories-slide__content"],style:g(),children:(0,Ol.jsx)("div",{className:Al()(Ep["stories-slide__title"],Ep.clamp,h()),style:p(),children:t.title})})]}),u().map(((e,t)=>(0,Ol.jsx)("div",{style:e,className:Ep["card-overlay-svg-mask"]},t)))]}),r.title.display&&w&&(0,Ol.jsx)("div",{className:Al()(Ep["stories-slide__content"],Ep.__position_outside_bottom),style:g(),children:(0,Ol.jsx)("div",{className:Al()(Ep["stories-slide__title"],Ep.clamp,h()),style:p(),children:t.title})})]})}));var Ip=M(1980),Tp={insert:"head",singleton:!1};Bl()(Ip.A,Tp);const Lp=Ip.A.locals||{};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 Rp=e=>{var{sliderDirection:t,slider:r}=e,i=Ap(e,["sliderDirection","slider"]);const[s,a]=(0,xl.useState)(!0),[o,n]=(0,xl.useState)(!0),l=i.navigationOptions.speed;(0,xl.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:Lp,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,Ol.jsxs)("div",{className:Al()("ias-stories-list-controls",Lp["stories-list-controls"],Lp[t]),children:[(0,Ol.jsx)("div",{onClick:()=>r.scrollByDirection(-1,l),className:Al()("ias-control-start",Lp["control-start"],{[Lp["control-start_dir_rtl"]]:"rtl"===i.dir,[Lp["control-start_reach-start"]]:s,"ias-control-start_dir_rtl":"rtl"===i.dir,"ias-control-start_reach-start":s}),children:(0,Ol.jsx)("div",{className:Al()("ias-control-icon",Lp["control-icon"])})}),(0,Ol.jsx)("div",{onClick:()=>r.scrollByDirection(1,l),className:Al()("ias-control-end",Lp["control-end"],{[Lp["control-end_dir_rtl"]]:"rtl"===i.dir,[Lp["control-end_reach-end"]]:o,"ias-control-end_dir_rtl":"rtl"===i.dir,"ias-control-end_reach-end":o}),children:(0,Ol.jsx)("div",{className:Al()("ias-control-icon",Lp["control-icon"])})})]}):null};var Bp=M(7966),Dp={insert:"head",singleton:!1};Bl()(Bp.A,Dp);const Np=Bp.A.locals||{},Vp=({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,Ol.jsx)("div",{className:Np["favorite-images-wrapper"],children:e.slice(0,4).map(((e,r)=>(0,Ol.jsx)("div",{className:Np["favorite-image-wrapper"],children:(0,Ol.jsx)("div",{style:i(e),className:Al()(Np["favorite-image"],{[Np.circle_style]:t.variant===Kt.STYLE_CIRCLE}),children:(0,Ol.jsx)("div",{className:Np["favorite-image-item"],style:s(e)})})},r)))})};var Fp=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 Up=(0,kc.observer)((0,xl.forwardRef)(((e,t)=>{var{isFavorite:r=!1,storyListViewModel:i}=e,s=Fp(e,["isFavorite","storyListViewModel"]);const a=(0,xl.useRef)(null),o=(0,xl.useRef)(null);((e,t)=>{(0,xl.useImperativeHandle)(e,(()=>({reload:t.reload.bind(t)})),[t])})(t,i);const n=((e,t)=>{const[r,i]=(0,xl.useState)(t);(0,xl.useLayoutEffect)((()=>{const r=e.current;s(r,t),i(t)}),[JSON.stringify(t)]);const s=(e,t)=>{const r=new Tl(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,xl.useRef)(null),s=(0,xl.useRef)(null),[a,o]=(0,xl.useState)(!1),[n,l]=(0,xl.useState)(null),c=()=>{clearTimeout(i.current),o(!0)},d=()=>{i.current=setTimeout((()=>o(!1)),100)},u=(0,xl.useCallback)((()=>{if(!n)return;const{x:e,y:t}=n.getCurrentPosition();n.testAttraction(e,t)}),[n]);return(0,xl.useEffect)((()=>{if(!s.current)return;const e=new Lr;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,xl.useEffect)((()=>{n&&(n.setGap(t.card.gap),n.setDesktopMode(re),n.changeDirection(t.direction))}),[n,t.card.gap,t.direction]),(0,xl.useEffect)((()=>{n&&(n.setTextDirection(e),n.scrollTo(0,0))}),[n,e]),(0,xl.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,xl.useEffect)((()=>(window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)})),[n,u]),{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,xl.useCallback)(Er()((()=>{if(!e)return;const{x:r,y:i}=e.getCurrentPosition();t.feedCoverageAnalytics.calculate(r,i)}),300),[e,t.feedCoverageAnalytics]),a=(0,xl.useCallback)((()=>{if(!e)return;const r=e.elementRef.getBoundingClientRect(),i=new dn(r.left,r.top,r.width,r.height),a=Array.from(e.slides),n=new dn(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,xl.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,xl.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}),_p({dir:i.dir,slider:c,storyListOptions:n,viewportContainerRef:o,feed:s.feedSlug});const{getRootStyle:u,getStoryWrapperStyle:h,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===rr.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:re?Al()(Vl["stories-list__viewport-inner"],Vl["mode-desktop"],{[Vl["with-list-controls"]]:r.navigation.showControls,[Vl.isTitleCardOutsideTop]:r.card.title.position===ct.CARD_OUTSIDE_TOP,[Vl.isTitleCardOutsideBottom]:r.card.title.position===ct.CARD_OUTSIDE_BOTTOM,[Vl.isVerticalDirection]:"vertical"===r.direction}):Al()(Vl["stories-list__viewport-inner"],Object.assign(Object.assign({},(()=>{const t=r.layout.sliderAlign,i=t===ot.START||t===ot.LEFT,s=t===ot.END||t===ot.RIGHT,a=e===rr.LTR;return{[Vl["align-left"]]:i&&a||s&&!a,[Vl["align-center"]]:t===ot.CENTER,[Vl["align-right"]]:s&&a||i&&!a}})()),{[Vl.isTitleCardOutsideTop]:r.card.title.position===ct.CARD_OUTSIDE_TOP,[Vl.isTitleCardOutsideBottom]:r.card.title.position===ct.CARD_OUTSIDE_BOTTOM,[Vl.isVerticalDirection]:"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,xl.useLayoutEffect)((()=>{i.setFavoriteCardOptions(m),i.setUgcCardOptions(y)}),[i,m,y]);return(0,Ol.jsxs)(Op,{className:Al()("ias-stories-list-wrapper",Vl["stories-list-wrapper"],{[Vl["mode-desktop"]]:re,[Vl["with-list-controls"]]:n.navigation.showControls,"ias-mode-desktop":re,"ias-with-list-controls":n.navigation.showControls}),dir:s.dir,style:u(),sliderOptions:n,ref:a,children:[(0,Ol.jsx)("div",{className:Al()("ias-stories-list",Vl["stories-list"]),children:(0,Ol.jsx)("div",{ref:o,className:Al()(Vl["stories-list__viewport"],{[Vl["mode-desktop"]]:re,"ias-mode-desktop":re}),style:"horizontal"===n.direction?{marginLeft:-n.sidePadding+"px",marginRight:-n.sidePadding+"px"}:{},children:(0,Ol.jsx)("div",{ref:l,className:p,style:g,children:i.stories.map(((e,t)=>{var r;const a=e instanceof cn,o=s.storyCardView&&!a;return a&&s.favoriteCardView?(0,Ol.jsx)(kl().Fragment,{children:s.favoriteCardView(e)},e.id):(0,Ol.jsx)(kl().Fragment,{children:o?null===(r=s.storyCardView)||void 0===r?void 0:r.call(s,e):(0,Ol.jsx)(Mp,{story:e,cardOptions:f,favoriteCardOptions:m,ugcCardOptions:y,dir:i.dir,wrapperStyle:h(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 rn?null===(a=s.onUgcCardClick)||void 0===a||a.call(s):e instanceof cn?null===(o=s.onFavoriteCardClick)||void 0===o||o.call(s):i.onStoryClick(e,t))})(e,t),children:a&&(0,Ol.jsx)(Vp,{favoriteStories:e.favoriteStories,favoriteCardOptions:n.favoriteCard,cardOptions:f})},e.id)},e.id)}))})})}),c&&(0,Ol.jsx)(Rp,{dir:s.dir,navigationOptions:n.navigation,navigationView:s.navigationView,sliderDirection:n.direction,storiesLength:i.stories.length,slider:c})]})}))),Gp=(0,kc.observer)((0,xl.forwardRef)(((e,t)=>{var r,i,s;const{storyManager:a}=yp(),o=null!==(r=e.feedSlug)&&void 0!==r?r:"default",n=Ge.DEFAULT,{storyListViewModel:l,storyListOptions:c}=Pl(Object.assign(Object.assign({},e),{storyManager:a,feedSlug:o,listType:n,hasFavorite:Boolean(e.hasFavorite),isFavorite:!1}));return l&&(null===(i=l.session)||void 0===i?void 0:i.id)?(0,Ol.jsx)(Up,Object.assign({},e,{dir:l.dir,storyManager:a,feedSlug:null!==(s=e.feedSlug)&&void 0!==s?s:"default",listType:Ge.DEFAULT,storyListViewModel:l,storyListOptions:c,onStoryCardClick:e.onStoryCardClick,onFavoriteCardClick:()=>{var t;a.emit("clickOnFavoriteCell",{feed:o}),null===(t=e.onFavoriteCardClick)||void 0===t||t.call(e)},ref:t})):null}))),Wp=(0,kc.observer)((0,xl.forwardRef)(((e,t)=>{var r;const{storyManager:i}=yp(),s=Xe,a=Ge.UGC,{storyListViewModel:o,storyListOptions:n}=Pl(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,Ol.jsx)(Up,Object.assign({},e,{ref:t,dir:o.dir,storyListOptions:n,storyManager:i,listType:Ge.UGC,feedSlug:Xe,storyListViewModel:o,onStoryCardClick:e.onStoryCardClick})):null}))),zp=e=>{const{storyManager:t}=yp(),r=Ze,i=Ge.FAVORITE,{storyListViewModel:s,storyListOptions:a}=Pl(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!0,hasFavorite:!0}));return s?(0,Ol.jsx)(Up,Object.assign({},e,{storyListOptions:a,storyManager:t,dir:s.dir,feedSlug:r,listType:i,storyListViewModel:s,isFavorite:!0})):null}})(),I})()));
|
|
11
|
+
`:null}constructor(){super(...arguments),e.set(this,Mu(this,b,void 0)),t.set(this,(Mu(this,w),Mu(this,S,void 0))),r.set(this,(Mu(this,_),Mu(this,O,!1))),i.set(this,(Mu(this,x),Mu(this,k,void 0))),s.set(this,(Mu(this,C),Mu(this,P,void 0))),a.set(this,(Mu(this,j),Mu(this,E,void 0))),o.set(this,(Mu(this,I),Mu(this,M,void 0))),Mu(this,T)}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,Tu(l,"MessageViewFactory"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=v[Symbol.metadata])&&void 0!==e?e:null):void 0;c=[(0,Jh.property)({type:Object})],d=[(0,Jh.property)({type:Number})],h=[(0,Jh.property)({type:Boolean})],u=[(0,Jh.property)({type:Object})],p=[(0,Jh.property)({type:Object})],g=[(0,Jh.property)({type:Boolean})],f=[(0,Jh.property)({type:String})],Iu(l,null,c,{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,w),Iu(l,null,d,{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},S,_),Iu(l,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),Iu(l,null,u,{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},k,C),Iu(l,null,p,{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},P,j),Iu(l,null,g,{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},E,I),Iu(l,null,f,{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,T),Iu(null,n={value:l},m,{kind:"class",name:l.name,metadata:t},null,y),l=n.value,t&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(l,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Xh.css``}),Mu(l,y)})();const Ru=Xh.css`.slides-container{height:100%;width:100%;position:absolute;top:0;left:0;bottom:0;right:0}`;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;let s,a,o,n,l,c,d=[(0,Jh.customElement)("message-slide")],h=[],u=Xh.LitElement,p=[],g=[],f=[],m=[],y=[],v=[],b=[],w=[];a=class extends u{get message(){return Fu(this,e,"f")}set message(t){Uu(this,e,t,"f")}get styleContext(){return Fu(this,t,"f")}set styleContext(e){Uu(this,t,e,"f")}get geometry(){return Fu(this,r,"f")}set geometry(e){Uu(this,r,e,"f")}get slidesContainer(){return Fu(this,i,"f")}set slidesContainer(e){Uu(this,i,e,"f")}constructor(){super(),e.set(this,Du(this,p,void 0)),t.set(this,(Du(this,g),Du(this,f,void 0))),r.set(this,(Du(this,m),Du(this,y,void 0))),i.set(this,(Du(this,v),Du(this,b,null))),Du(this,w)}aconnectedCallback(){super.connectedCallback()}firstUpdated(e){super.firstUpdated(e),setTimeout((()=>{this.initAndStartSlide()}),50)}disconnectedCallback(){super.disconnectedCallback(),this.message.stop()}handleSlideClick(e){var t;e.currentTarget&&(e.preventDefault(),e.stopPropagation(),null===(t=this.message.activeSlide)||void 0===t||t.onClick(e,e.currentTarget))}async initAndStartSlide(){const e=this.slidesContainer;if(!e)throw new Error("[IAM]: no slide content");this.message.attachRoot(e),await this.message.init(),await this.message.start()}render(){var e;return Xh.html`<style nonce="${P()}">${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,i=new WeakMap,Nu(a,"MessageSlide"),(()=>{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,Jh.property)({type:Object})],n=[(0,Jh.property)({type:String})],l=[(0,Jh.property)({type:Object})],c=[(0,Jh.query)(".slides-container")],Bu(a,null,o,{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},p,g),Bu(a,null,n,{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},f,m),Bu(a,null,l,{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},y,v),Bu(a,null,c,{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},b,w),Bu(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:[Ru]}),Du(a,h)})();const Vu=Xh.css`@keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner{position:absolute;top:calc(50% - 2rem / 2);left:calc(50% - 2rem / 2);width:2rem;height:2rem;border-radius:50%;animation:spin .6s infinite linear}`;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},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},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})};(()=>{let e,t,r=[(0,Jh.customElement)("iam-spinner")],i=[],s=Xh.LitElement;t=class extends s{render(){const e="white";return Xh.html`<div class="spinner" style="${(0,su.styleMap)({border:`solid 2px ${e}`,borderColor:`transparent ${e} ${e} ${e}`})}"></div>`}};zu(t,"Spinner"),(()=>{var a;const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(a=s[Symbol.metadata])&&void 0!==a?a:null):void 0;Gu(null,e={value:t},r,{kind:"class",name:t.name,metadata:o},null,i),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),Object.defineProperty(t,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Vu}),Wu(t,i)})();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},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},qu=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)},Ku=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=[(0,Jh.customElement)("iam-reader"),w],p=[],g=Xh.LitElement,f=[],m=[],y=[],v=[],b=[],S=[],_=[],O=[],x=[],k=[];o=class extends g{get options(){return Zu(this,e,"f")}set options(t){Ku(this,e,t,"f")}get desktopMode(){return Zu(this,t,"f")}set desktopMode(e){Ku(this,t,e,"f")}get dir(){return Zu(this,r,"f")}set dir(e){Ku(this,r,e,"f")}get viewModel(){return Zu(this,i,"f")}set viewModel(e){Ku(this,i,e,"f")}get open(){return Zu(this,s,"f")}set open(e){Ku(this,s,e,"f")}constructor(){super(),e.set(this,Hu(this,f,{})),t.set(this,(Hu(this,m),Hu(this,y,!1))),r.set(this,(Hu(this,v),Hu(this,b,Kt.LTR))),i.set(this,(Hu(this,S),Hu(this,_,null))),s.set(this,(Hu(this,O),Hu(this,x,!0))),Object.defineProperty(this,"viewportController",{enumerable:!0,configurable:!0,writable:!0,value:(Hu(this,k),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){"Escape"===e.key&&(this.open=!1)}handleClosed(){this.open=!1,this.viewModel.close()}updated(e){var t;super.updated(e);const r=document.documentElement.style.overflow;(null===(t=this.viewModel)||void 0===t?void 0:t.activeMessage)?(this.open=!0,document.documentElement.style.overflow="hidden"):(this.open=!1,document.documentElement.style.overflow=r)}getMessageTypeByEnviroment(e){return this.desktopMode&&e===Za.Fullscreen?(console.warn("[IAM]: desktop only supports modal window"),Za.Modal):e}createSlideGeometry(e){return(new oo).create(e)}createMessageGeometry(e,t){return(new eo).create(e,{appearanceOptions:t,vw:this.viewportController.vw,vh:this.viewportController.vh,desktopMode:this.desktopMode})}render(){var e,t;const r=null===(e=this.viewModel)||void 0===e?void 0:e.activeMessage,i=null===(t=this.viewModel)||void 0===t?void 0:t.touchController;if(!(null==r?void 0:r.context))return null;const s=r.type,a=this.createMessageGeometry(s,r.appearanceOptions),o=this.createSlideGeometry(a);return Xh.html`<message-view-factory type="${s}" @closed="${this.handleClosed}" .appearanceOptions="${r.appearanceOptions}" .geometry="${a}" .open="${this.open}" .dir="${this.dir}" .desktopMode="${this.desktopMode}" .touchController="${i}"><message-slide .message="${r}" .styleContext="${r.context.style}" .geometry="${o}"></message-slide></message-view-factory>`}};e=new WeakMap,t=new WeakMap,r=new WeakMap,i=new WeakMap,s=new WeakMap,qu(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,Jh.property)({type:Object})],l=[(0,Jh.property)({type:Boolean})],c=[(0,Jh.property)({type:String})],d=[(0,Jh.property)({type:Object})],h=[(0,Jh.state)()],$u(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),$u(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),$u(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,S),$u(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),$u(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,k),$u(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:Xh.css`.iam-container{position:fixed;inset:0;z-index:1000}`}),Hu(o,p)})();const Qu=e=>{const{storyManager:t}=ep(),r=(0,ll.useRef)(null),i=t.config.dir;return(0,ll.useEffect)((()=>{const e=r.current;e.desktopMode=J,e.dir=i,e.viewModel=t.inAppMessaging}),[t,i]),(0,nl.jsx)("iam-reader",{ref:r})},Yu=cl().createContext({storyManager:el,commonOptions:Tt,storyReaderOptions:Vt,gameReaderOptions:Lt,goodsWidgetOptions:Rt,inAppMessagingOptions:Wt});let Xu=!1;const Ju=(0,cc.observer)((e=>{rp(e.config),ip(e);const{commonOptions:t,gameReaderOptions:r,storyReaderOptions:i,goodsWidgetOptions:s,inAppMessagingOptions:a}=sp(e),o=el.storyReader,n=yc({storyManager:el});(0,ll.useEffect)((()=>{if(Xu)throw new Error("There can only be one instance of <IASContainer /> per application");return Xu=!0,()=>{Xu=!1,el.clearConfig()}}),[]);const l=(0,ll.useMemo)((()=>({storyManager:el,commonOptions:t,gameReaderOptions:r,storyReaderOptions:i,goodsWidgetOptions:s,inAppMessagingOptions:a})),[el,t,r,i,s]);return(0,nl.jsxs)(Yu.Provider,{value:l,children:[n.isOpened&&(0,nl.jsx)(vc,{gameReader:n}),o.isOpened&&(0,nl.jsx)(Yh,{storyReader:o}),(0,nl.jsx)(Qu,{}),e.children]})})),ep=()=>(0,ll.useContext)(Yu),tp=e=>{const t=t=>{27===t.keyCode&&e()};(0,ll.useEffect)((()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)})),[])},rp=e=>{(0,ll.useEffect)((()=>{el.setConfig(e)}),[JSON.stringify(e)])},ip=({onClickOnStory:e,onShowStory:t,onCloseStory:r,onShowSlide:i,onClickOnButton:s,onLikeStory:a,onDislikeStory:o,onFavoriteStory:n,onShareStory:l,onShareStoryWithPath:c,onFeedImpression:d,onVisibleAreaUpdated:h,onWidgetEvent:u})=>{(0,ll.useEffect)((()=>{const p=[{event:"clickOnStory",handler:e},{event:"showStory",handler:t},{event:"closeStory",handler:r},{event:"showSlide",handler:i},{event:"clickOnButton",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}];return p.forEach((({event:e,handler:t})=>{t&&el.on(e,t)})),()=>{p.forEach((({event:e,handler:t})=>{t&&el.off(e,t)}))}}),[e,t,r,i,s,a,o,n,l,c,d,h,u])},sp=({commonOptions:e,gameReaderOptions:t,storyReaderOptions:r,goodsWidgetOptions:i})=>{const s=(0,ll.useRef)(new ol).current,a=(0,ll.useMemo)((()=>(e&&s.setCommonOptions(e),s.commonOptions)),[JSON.stringify(e)]),o=(0,ll.useMemo)((()=>(t&&s.setGameReaderOptions(t),s.gameReaderOptions)),[JSON.stringify(t)]),n=(0,ll.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,ll.useMemo)((()=>(r&&s.setStoryReaderOptions(r),s.storyReaderOptions)),[JSON.stringify(r)]),goodsWidgetOptions:n,inAppMessagingOptions:Wt}},ap=({dir:e,feed:t,slider:r,storyListOptions:i,viewportContainerRef:s})=>{const{storyManager:a}=ep(),o=a.storyReader;(0,ll.useEffect)((()=>{if(r&&i.autoScrollOnStoryClose&&o)return o.on(Fs.Close,n),()=>{o.off(Fs.Close,n)}}),[r,i.direction,i.autoScrollOnStoryClose,o]);const n=a=>{if(!r||t!==a.feed||a.type!==Fe.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 qo(i.x+t,i.y+r,i.width,i.height)})(r);if(!n)return;const l=((t,r)=>new qo(e===Kt.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)}},op=(0,ll.forwardRef)(((e,t)=>{const r=e.sliderOptions.card,i=e.sliderOptions.favoriteCard,s=r.border,a=r.opened.border,o=e.sliderOptions.navigation,n=()=>{var e,t,r;return(null!==(e=a.radius)&&void 0!==e?e:s.radius)-parseFloat(null!==(t=a.width)&&void 0!==t?t:s.width)-parseFloat(null!==(r=a.gap)&&void 0!==r?r:s.gap)};return(0,nl.jsx)("div",{dir:e.dir,ref:t,className:e.className,style:Object.assign(Object.assign({},(()=>{var t,l,c,d,h,u,p,f,m,y,v,b,w,S,_,O,k,C,P,j,E;const I=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},M={"--storiesBorderNotReadColor":s.color,"--storiesBorderReadColor":null!==(t=a.color)&&void 0!==t?t:s.color,"--storiesBorderNotReadGradientColor":null==s?void 0:s.gradient,"--storiesBorderReadGradientColor":null!==(l=null==a?void 0:a.gradient)&&void 0!==l?l:null==s?void 0:s.gradient,"--storiesListCardFavoriteGradientColor":null===(c=e.sliderOptions.favoriteCard.border)||void 0===c?void 0:c.gradient,"--storiesListCardUgcGradientColor":null===(d=e.sliderOptions.ugcCard.border)||void 0===d?void 0:d.gradient,"--storiesGap":r.gap+"px","--storiesHeight":r.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":s.width+"px","--storiesListBorderReadWidth":(null!==(h=a.width)&&void 0!==h?h:a.width)+"px","--storiesListBorderGapNotRead":s.gap+"px","--storiesListBorderGapRead":(null!==(u=a.gap)&&void 0!==u?u:a.gap)+"px","--storiesListBorderRadius":s.radius+"px","--storiesListBorderRadiusRead":(null!==(p=a.radius)&&void 0!==p?p:a.radius)+"px","--storiesListItemMaskColor":r.mask.color,"--storiesListItemOpenedMaskColor":null!==(f=r.opened.mask.color)&&void 0!==f?f:r.mask.color,"--storiesListItemMaskLinearGradient":I(r.mask),"--storiesListItemOpenedMaskLinearGradient":I(null!=(null===(y=null===(m=r.opened)||void 0===m?void 0:m.mask)||void 0===y?void 0:y.linearGradient)?r.opened.mask:r.mask),"--storiesListCardFavoriteTitle":g(i.title.padding.toString())?i.title.padding+"px":i.title.padding,"--storiesListCardFavoriteGap":g(i.gap.toString())?i.gap+"px":i.gap,"--storiesListCardUgcMaskColor":e.sliderOptions.ugcCard.mask.color,"--storiesListCardUgcMaskLinearGradient":I(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleFontFamily":"InternalPrimaryFont","--storiesListItemTitleFont":r.title.font,"--storiesListItemTitlePadding":g(r.title.padding.toString())?r.title.padding+"px":r.title.padding,"--storiesListControlsSize":g(o.controlsSize.toString())?o.controlsSize+"px":o.controlsSize,"--storiesListControlsBackgroundColor":o.controlsBackgroundColor,"--storiesListControlsColor":o.controlsColor,"--storiesListInnerBorderRadiusNotRead":s.radius-parseFloat(s.width)-parseFloat(s.gap)+"px","--storiesListInnerBorderRadiusRead":n()+"px","--storiesListCardDropShadow":r.dropShadow,"--storiesListCardOpenedDropShadow":null!==(v=r.opened.dropShadow)&&void 0!==v?v:r.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":(null===(b=r.svgMask)||void 0===b?void 0:b.cardMask)?`url("data:image/svg+xml,${x(null===(w=r.svgMask)||void 0===w?void 0:w.cardMask)}")`:null,"--storiesListCardOpenedMask":(null===(S=r.opened.svgMask)||void 0===S?void 0:S.cardMask)?`url("data:image/svg+xml,${x(null===(_=r.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,${x(null===(k=e.sliderOptions.ugcCard.svgMask)||void 0===k?void 0:k.cardMask)}")`:null};let T=null;return T=null===(C=r.svgMask)||void 0===C?void 0:C.overlayMask,null!=T&&Array.isArray(T)&&T.forEach(((e,t)=>M[`--storiesListCardOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${x(e.mask)}")`:null)),T=null===(P=r.opened.svgMask)||void 0===P?void 0:P.overlayMask,null!=T&&Array.isArray(T)&&T.forEach(((e,t)=>M[`--storiesListCardOpenedOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${x(e.mask)}")`:null)),T=null===(j=e.sliderOptions.favoriteCard.svgMask)||void 0===j?void 0:j.overlayMask,null!=T&&Array.isArray(T)&&T.forEach(((e,t)=>M[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${x(e.mask)}")`:null)),T=null===(E=e.sliderOptions.ugcCard.svgMask)||void 0===E?void 0:E.overlayMask,null!=T&&Array.isArray(T)&&T.forEach(((e,t)=>M[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${x(e.mask)}")`:null)),M})()),e.style),children:e.children})})),np=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),lp=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const r=(0,ll.useRef)(null);return(0,ll.useEffect)((()=>{(()=>{if(!e)return;const i=r.current,s=()=>{i.play().then((()=>{if(np){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,nl.jsx)("video",{ref:r,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},cp=({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 Ho&&(a=a.concat(s("storiesListCardFavoriteOverlay",null===(o=r.svgMask)||void 0===o?void 0:o.overlayMask))),a=e instanceof Uo?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 dp=I(6892),hp={insert:"head",singleton:!1};wl()(dp.A,hp);const up=dp.A.locals||{},pp=(0,cc.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,ll.useState)(!1),{getAllCardsOverlayMaskStyles:h}=cp(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===nt.START||t===nt.LEFT,s=t===nt.END||t===nt.RIGHT,a=e===Kt.LTR;return{[up["align-left"]]:i&&a||s&&!a,[up["align-center"]]:t===nt.CENTER,[up["align-right"]]:s&&a||i&&!a}},getTitleStyle:()=>{const e={};return t.titleColor&&r.title.position===lt.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 Ho&&(e=Object.assign(Object.assign({},e),{color:i.title.color})),t.titleColor&&t instanceof Uo&&(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=up[`_background-color-${o.color}`+(!0===o.gradient?"-gradient":"")]);const l=(()=>{let s;return s=e instanceof Ho?r:e instanceof Uo?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,{[up["_is-read"]]:e.isOpened},{[up["_format-rectangle"]]:t.variant===Gt.STYLE_RECTANGLE},{[up["_format-circle"]]:t.variant===Gt.STYLE_CIRCLE},{[up["_format-quad"]]:t.variant===Gt.STYLE_QUAD},{[up["_favorite-cell"]]:e instanceof Ho},{[up["_ugc-cell"]]:e instanceof Uo},{[up["_has-drop-shadow"]]:c},{[up["_has-card-svg-mask"]]:d},{[up["_has-border-gradient-color"]]: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===lt.CARD_INSIDE_BOTTOM,b=r.title.position===lt.CARD_OUTSIDE_TOP,w=r.title.position===lt.CARD_OUTSIDE_BOTTOM;return(0,nl.jsxs)("div",{"data-id":t.id,className:vl()("ias-stories-slide-wrapper",up["stories-slide-wrapper"],{[up.isTitleCardOutsideTop]:b,[up.isTitleCardOutsideBottom]:w}),style:a,rel:"noreferrer",onClick:e=>{e.stopPropagation(),e.preventDefault(),n(t)},children:[r.title.display&&b&&(0,nl.jsx)("div",{className:vl()(up["stories-slide__content"],up.__position_outside_top),style:g(),children:(0,nl.jsx)("div",{className:vl()(up["stories-slide__title"],up.clamp,u()),style:p(),children:t.title})}),(0,nl.jsxs)("div",{className:vl()("ias-stories-slide",up["stories-slide"],f()),style:m(),children:[(0,nl.jsxs)("div",{className:up["stories-slide__inner"],children:[(0,nl.jsx)("div",{className:up["stories-slide-image"],style:{backgroundColor:t.backgroundColor?t.backgroundColor:"transparent"},children:(0,nl.jsx)("div",{className:up["stories-slide-image__wrap"],children:(0,nl.jsxs)("div",{className:vl()(up["stories-slide-image__image"],up._mode_list,{[up["video-loaded"]]:c,[up["ugc-card-cell"]]:t instanceof Uo}),children:[y&&(0,nl.jsx)("img",{src:y,alt:t.title,loading:r.coverLazyLoading?"lazy":"eager"},y),t.videoCoverSrc&&(0,nl.jsx)(lp,{onVideoCoverLoaded:()=>d(!0),videoCoverSrc:t.videoCoverSrc}),o]})})}),(0,nl.jsx)("div",{className:up["stories-slide__mask"]}),r.title.display&&v&&(0,nl.jsx)("div",{className:up["stories-slide__content"],style:g(),children:(0,nl.jsx)("div",{className:vl()(up["stories-slide__title"],up.clamp,u()),style:p(),children:t.title})})]}),h().map(((e,t)=>(0,nl.jsx)("div",{style:e,className:up["card-overlay-svg-mask"]},t)))]}),r.title.display&&w&&(0,nl.jsx)("div",{className:vl()(up["stories-slide__content"],up.__position_outside_bottom),style:g(),children:(0,nl.jsx)("div",{className:vl()(up["stories-slide__title"],up.clamp,u()),style:p(),children:t.title})})]})}));var gp=I(1980),fp={insert:"head",singleton:!1};wl()(gp.A,fp);const mp=gp.A.locals||{};var yp=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 vp=e=>{var{sliderDirection:t,slider:r}=e,i=yp(e,["sliderDirection","slider"]);const[s,a]=(0,ll.useState)(!0),[o,n]=(0,ll.useState)(!0),l=i.navigationOptions.speed;(0,ll.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:mp,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,nl.jsxs)("div",{className:vl()("ias-stories-list-controls",mp["stories-list-controls"],mp[t]),children:[(0,nl.jsx)("div",{onClick:()=>r.scrollByDirection(-1,l),className:vl()("ias-control-start",mp["control-start"],{[mp["control-start_dir_rtl"]]:"rtl"===i.dir,[mp["control-start_reach-start"]]:s,"ias-control-start_dir_rtl":"rtl"===i.dir,"ias-control-start_reach-start":s}),children:(0,nl.jsx)("div",{className:vl()("ias-control-icon",mp["control-icon"])})}),(0,nl.jsx)("div",{onClick:()=>r.scrollByDirection(1,l),className:vl()("ias-control-end",mp["control-end"],{[mp["control-end_dir_rtl"]]:"rtl"===i.dir,[mp["control-end_reach-end"]]:o,"ias-control-end_dir_rtl":"rtl"===i.dir,"ias-control-end_reach-end":o}),children:(0,nl.jsx)("div",{className:vl()("ias-control-icon",mp["control-icon"])})})]}):null};var bp=I(7966),wp={insert:"head",singleton:!1};wl()(bp.A,wp);const Sp=bp.A.locals||{},_p=({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,nl.jsx)("div",{className:Sp["favorite-images-wrapper"],children:e.slice(0,4).map(((e,r)=>(0,nl.jsx)("div",{className:Sp["favorite-image-wrapper"],children:(0,nl.jsx)("div",{style:i(e),className:vl()(Sp["favorite-image"],{[Sp.circle_style]:t.variant===Gt.STYLE_CIRCLE}),children:(0,nl.jsx)("div",{className:Sp["favorite-image-item"],style:s(e)})})},r)))})};var Op=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 xp=(0,cc.observer)((0,ll.forwardRef)(((e,t)=>{var{isFavorite:r=!1,storyListViewModel:i}=e,s=Op(e,["isFavorite","storyListViewModel"]);const a=(0,ll.useRef)(null),o=(0,ll.useRef)(null);((e,t)=>{(0,ll.useImperativeHandle)(e,(()=>({reload:t.reload.bind(t)})),[t])})(t,i);const n=((e,t)=>{const[r,i]=(0,ll.useState)(t);(0,ll.useLayoutEffect)((()=>{const r=e.current;s(r,t),i(t)}),[JSON.stringify(t)]);const s=(e,t)=>{const r=new ml(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,ll.useRef)(null),s=(0,ll.useRef)(null),[a,o]=(0,ll.useState)(!1),[n,l]=(0,ll.useState)(null),c=()=>{clearTimeout(i.current),o(!0)},d=()=>{i.current=setTimeout((()=>o(!1)),100)},h=(0,ll.useCallback)((()=>{if(!n)return;const{x:e,y:t}=n.getCurrentPosition();n.testAttraction(e,t)}),[n]);return(0,ll.useEffect)((()=>{if(!s.current)return;const e=new dr;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,ll.useEffect)((()=>{n&&(n.setGap(t.card.gap),n.setDesktopMode(J),n.changeDirection(t.direction))}),[n,t.card.gap,t.direction]),(0,ll.useEffect)((()=>{n&&(n.setTextDirection(e),n.scrollTo(0,0))}),[n,e]),(0,ll.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,ll.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,ll.useCallback)(or()((()=>{if(!e)return;const{x:r,y:i}=e.getCurrentPosition();t.feedCoverageAnalytics.calculate(r,i)}),300),[e,t.feedCoverageAnalytics]),a=(0,ll.useCallback)((()=>{if(!e)return;const r=e.elementRef.getBoundingClientRect(),i=new qo(r.left,r.top,r.width,r.height),a=Array.from(e.slides),n=new qo(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,ll.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,ll.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}),ap({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===Kt.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:J?vl()(Ol["stories-list__viewport-inner"],Ol["mode-desktop"],{[Ol["with-list-controls"]]:r.navigation.showControls,[Ol.isTitleCardOutsideTop]:r.card.title.position===lt.CARD_OUTSIDE_TOP,[Ol.isTitleCardOutsideBottom]:r.card.title.position===lt.CARD_OUTSIDE_BOTTOM,[Ol.isVerticalDirection]:"vertical"===r.direction}):vl()(Ol["stories-list__viewport-inner"],Object.assign(Object.assign({},(()=>{const t=r.layout.sliderAlign,i=t===at.START||t===at.LEFT,s=t===at.END||t===at.RIGHT,a=e===Kt.LTR;return{[Ol["align-left"]]:i&&a||s&&!a,[Ol["align-center"]]:t===at.CENTER,[Ol["align-right"]]:s&&a||i&&!a}})()),{[Ol.isTitleCardOutsideTop]:r.card.title.position===lt.CARD_OUTSIDE_TOP,[Ol.isTitleCardOutsideBottom]:r.card.title.position===lt.CARD_OUTSIDE_BOTTOM,[Ol.isVerticalDirection]:"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,ll.useLayoutEffect)((()=>{i.setFavoriteCardOptions(m),i.setUgcCardOptions(y)}),[i,m,y]);return(0,nl.jsxs)(op,{className:vl()("ias-stories-list-wrapper",Ol["stories-list-wrapper"],{[Ol["mode-desktop"]]:J,[Ol["with-list-controls"]]:n.navigation.showControls,"ias-mode-desktop":J,"ias-with-list-controls":n.navigation.showControls}),dir:s.dir,style:h(),sliderOptions:n,ref:a,children:[(0,nl.jsx)("div",{className:vl()("ias-stories-list",Ol["stories-list"]),children:(0,nl.jsx)("div",{ref:o,className:vl()(Ol["stories-list__viewport"],{[Ol["mode-desktop"]]:J,"ias-mode-desktop":J}),style:"horizontal"===n.direction?{marginLeft:-n.sidePadding+"px",marginRight:-n.sidePadding+"px"}:{},children:(0,nl.jsx)("div",{ref:l,className:p,style:g,children:i.stories.map(((e,t)=>{var r;const a=e instanceof Ho,o=s.storyCardView&&!a;return a&&s.favoriteCardView?(0,nl.jsx)(cl().Fragment,{children:s.favoriteCardView(e)},e.id):(0,nl.jsx)(cl().Fragment,{children:o?null===(r=s.storyCardView)||void 0===r?void 0:r.call(s,e):(0,nl.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 Uo?null===(a=s.onUgcCardClick)||void 0===a||a.call(s):e instanceof Ho?null===(o=s.onFavoriteCardClick)||void 0===o||o.call(s):i.onStoryClick(e,t))})(e,t),children:a&&(0,nl.jsx)(_p,{favoriteStories:e.favoriteStories,favoriteCardOptions:n.favoriteCard,cardOptions:f})},e.id)},e.id)}))})})}),c&&(0,nl.jsx)(vp,{dir:s.dir,navigationOptions:n.navigation,navigationView:s.navigationView,sliderDirection:n.direction,storiesLength:i.stories.length,slider:c})]})}))),kp=(0,cc.observer)((0,ll.forwardRef)(((e,t)=>{var r,i,s;const{storyManager:a}=ep(),o=null!==(r=e.feedSlug)&&void 0!==r?r:"default",n=Fe.DEFAULT,{storyListViewModel:l,storyListOptions:c}=hl(Object.assign(Object.assign({},e),{storyManager:a,feedSlug:o,listType:n,hasFavorite:Boolean(e.hasFavorite),isFavorite:!1}));return l&&(null===(i=l.session)||void 0===i?void 0:i.id)?(0,nl.jsx)(xp,Object.assign({},e,{dir:l.dir,storyManager:a,feedSlug:null!==(s=e.feedSlug)&&void 0!==s?s:"default",listType:Fe.DEFAULT,storyListViewModel:l,storyListOptions:c,onStoryCardClick:e.onStoryCardClick,onFavoriteCardClick:()=>{var t;a.emit("clickOnFavoriteCell",{feed:o}),null===(t=e.onFavoriteCardClick)||void 0===t||t.call(e)},ref:t})):null}))),Cp=(0,cc.observer)((0,ll.forwardRef)(((e,t)=>{var r;const{storyManager:i}=ep(),s=Qe,a=Fe.UGC,{storyListViewModel:o,storyListOptions:n}=hl(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,nl.jsx)(xp,Object.assign({},e,{ref:t,dir:o.dir,storyListOptions:n,storyManager:i,listType:Fe.UGC,feedSlug:Qe,storyListViewModel:o,onStoryCardClick:e.onStoryCardClick})):null}))),Pp=e=>{const{storyManager:t}=ep(),r=$e,i=Fe.FAVORITE,{storyListViewModel:s,storyListOptions:a}=hl(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!0,hasFavorite:!0}));return s?(0,nl.jsx)(xp,Object.assign({},e,{storyListOptions:a,storyManager:t,dir:s.dir,feedSlug:r,listType:i,storyListViewModel:s,isFavorite:!0})):null}})(),M})()));
|