@inappstory/js-sdk 3.2.0-rc.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("effector"),require("uuid"),require("mobx"),require("@inappstory/slide-api"),require("async-mutex"),require("@inappstory/video-player"),require("react"),require("react-dom/client"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("react-input-mask"),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"),require("parse-css-sides"));else if("function"==typeof define&&define.amd)define(["effector","uuid","mobx","@inappstory/slide-api","async-mutex","@inappstory/video-player","react","react-dom/client","classnames","mobx-react-lite","react-dom","react-input-mask","lit","lit/decorators.js","lit/static-html.js","lit/directives/style-map.js","lit/directives/class-map.js","lit/directives/unsafe-html.js","parse-css-sides"],t);else{var i="object"==typeof exports?t(require("effector"),require("uuid"),require("mobx"),require("@inappstory/slide-api"),require("async-mutex"),require("@inappstory/video-player"),require("react"),require("react-dom/client"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("react-input-mask"),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"),require("parse-css-sides")):t(e.effector,e.uuid,e.mobx,e["@inappstory/slide-api"],e["async-mutex"],e["@inappstory/video-player"],e.react,e["react-dom/client"],e.classnames,e["mobx-react-lite"],e["react-dom"],e["react-input-mask"],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"],e["parse-css-sides"]);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(self,((e,t,i,r,n,s,a,o,l,d,c,u,h,p,f,g,v,m,b)=>(()=>{var y={3643:function(e){e.exports=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=90)}({17:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var r=i(18),n=function(){function e(){}return e.getFirstMatch=function(e,t){var i=t.match(e);return i&&i.length>0&&i[1]||""},e.getSecondMatch=function(e,t){var i=t.match(e);return i&&i.length>1&&i[2]||""},e.matchAndReturnConst=function(e,t,i){if(e.test(t))return i},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,i,r){void 0===r&&(r=!1);var n=e.getVersionPrecision(t),s=e.getVersionPrecision(i),a=Math.max(n,s),o=0,l=e.map([t,i],(function(t){var i=a-e.getVersionPrecision(t),r=t+new Array(i+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(o=a-Math.min(n,s)),a-=1;a>=o;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===o)return 0;a-=1}else if(l[0][a]<l[1][a])return-1}},e.map=function(e,t){var i,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i<e.length;i+=1)r.push(t(e[i]));return r},e.find=function(e,t){var i,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,r=e.length;i<r;i+=1){var n=e[i];if(t(n,i))return n}},e.assign=function(e){for(var t,i,r=e,n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(s));var o=function(){var e=s[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,i=s.length;t<i;t+=1)o();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=n,e.exports=t.default},18:function(e,t,i){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var r,n=(r=i(91))&&r.__esModule?r:{default:r},s=i(18);function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(){}var t,i,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new n.default(e,t)},e.parse=function(e){return new n.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(i=null)&&a(t.prototype,i),r&&a(t,r),e}();t.default=o,e.exports=t.default},91:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var r=l(i(92)),n=l(i(93)),s=l(i(94)),a=l(i(95)),o=l(i(17));function l(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=o.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=o.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=o.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=o.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return o.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,i={},r=0,n={},s=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(n[t]=a,s+=1):"object"==typeof a&&(i[t]=a,r+=1)})),r>0){var a=Object.keys(i),l=o.default.find(a,(function(e){return t.isOS(e)}));if(l){var d=this.satisfies(i[l]);if(void 0!==d)return d}var c=o.default.find(a,(function(e){return t.isPlatform(e)}));if(c){var u=this.satisfies(i[c]);if(void 0!==u)return u}}if(s>0){var h=Object.keys(n),p=o.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(n[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var i=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),n=o.default.getBrowserTypeByAlias(r);return t&&n&&(r=n.toLowerCase()),r===i},t.compareVersion=function(e){var t=[0],i=e,r=!1,n=this.getBrowserVersion();if("string"==typeof n)return">"===e[0]||"<"===e[0]?(i=e.substr(1),"="===e[1]?(r=!0,i=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?i=e.substr(1):"~"===e[0]&&(r=!0,i=e.substr(1)),t.indexOf(o.default.compareVersions(n,i,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var r,n=(r=i(17))&&r.__esModule?r:{default:r},s=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},i=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},i=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},i=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},i=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},i=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},i=n.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},i=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},i=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},i=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},i=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},i=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},i=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},i=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},i=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},i=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return i&&(t.version=i),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},i=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},i=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},i=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},i=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},i=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},i=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},i=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},i=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},i=n.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},i=n.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},i=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},i=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},i=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t={name:"Android Browser"},i=n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},i=n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},i=n.default.getFirstMatch(s,e);return i&&(t.version=i),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:n.default.getFirstMatch(t,e),version:n.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var r,n=(r=i(17))&&r.__esModule?r:{default:r},s=i(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),i=n.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:i}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:s.OS_MAP.iOS},i=n.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return i&&(t.version=i),t}},{test:[/macintosh/i],describe:function(e){var t=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),i=n.default.getMacOSVersionName(t),r={name:s.OS_MAP.MacOS,version:t};return i&&(r.versionName=i),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),i=e.test(/android/i);return t&&i},describe:function(e){var t=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),i=n.default.getAndroidVersionName(t),r={name:s.OS_MAP.Android,version:t};return i&&(r.versionName=i),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),i={name:s.OS_MAP.WebOS};return t&&t.length&&(i.version=t),i}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||n.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var r,n=(r=i(17))&&r.__esModule?r:{default:r},s=i(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=n.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",i={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(i.model=t),i}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),i=e.test(/like (ipod|iphone)/i);return t&&!i},describe:function(e){var t=n.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,i){"use strict";t.__esModule=!0,t.default=void 0;var r,n=(r=i(17))&&r.__esModule?r:{default:r},s=i(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},i=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},i=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:function(e){var t=e.test(/gecko/i),i=e.test(/like gecko/i);return t&&!i},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},i=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},i=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return i&&(t.version=i),t}}];t.default=a,e.exports=t.default}})},2432:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".favorite-story-list-modal--xWjHA{position:fixed;inset:0px;z-index:1090}.favorite-story-list-modal--xWjHA .container--GZBjv{width:100%;height:100%;background:var(--storiesFavoriteBackgroundColor, #333333);display:flex;flex-direction:column;position:relative;overflow-y:auto}.favorite-story-list-modal--xWjHA .header--TjHMD{display:flex;align-content:center;justify-content:center;align-items:center;flex-shrink:0;position:-webkit-sticky;position:sticky;top:0;z-index:100;background:var(--storiesFavoriteTitleBackgroundColor, #333333);box-shadow:0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12),0 1px 3px 0 rgba(0,0,0,.2);padding-top:var(--storiesFavoriteHeaderTopOffset, 0px);margin-bottom:25px}.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:1rem;margin-bottom:1rem;font-size:1.2em;color:var(--storiesFavoriteTitleColor, white);font-family:var(--storiesFavoriteTitleFontFamily);font-weight:normal;font-size:1.4rem;line-height:normal;font:var(--storiesFavoriteTitleFont, normal)}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:25px;margin-bottom:25px}}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD{margin-bottom:50px}}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:50%;transform:translateY(-50%);z-index:1140;pointer-events:all;cursor:pointer;outline:none;right:10px;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-:focus{outline:none}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm- svg{overflow:visible}.favorite-story-list-modal--xWjHA .footer--edEpn{width:100%;height:25px}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .footer--edEpn{height:50px}}.favorite-story-list-modal--xWjHA .bottom-offset--baiTh{position:-webkit-sticky;position:sticky;z-index:100;background:inherit;bottom:0;width:100%;height:var(--storiesFavoriteBottomOffset, 0px)}.favorite-story-list-modal--xWjHA .content--qCPkX{display:flex;justify-content:center;width:100%;padding-bottom:25px}.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{width:100%}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:640px}}@media(min-width: 768px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:768px}}@media(min-width: 1024px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1024px}}@media(min-width: 1280px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1280px}}",""]),n.locals={"favorite-story-list-modal":"favorite-story-list-modal--xWjHA",container:"container--GZBjv",header:"header--TjHMD",title:"title--Dk04x","header__close-btn":"header__close-btn--Jojm-",footer:"footer--edEpn","bottom-offset":"bottom-offset--baiTh",content:"content--qCPkX","favorite-story-list":"favorite-story-list--MISMx"};const s=n},5669:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".aspect-ratio-box--u2SLt{overflow:hidden;position:relative}.aspect-ratio-box--u2SLt.aspect-ratio-box--centered--ZWs8d{width:auto;height:100%;left:50%;transform:translateX(-50%)}.aspect-ratio-box-inside--U\\+o3F{position:absolute;top:0;left:0;width:100%;height:100%}",""]),n.locals={"aspect-ratio-box":"aspect-ratio-box--u2SLt","aspect-ratio-box--centered":"aspect-ratio-box--centered--ZWs8d","aspect-ratio-box-inside":"aspect-ratio-box-inside--U+o3F"};const s=n},9843:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".close-btn--KhMED{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:20px;z-index:1140;pointer-events:all;cursor:pointer;outline:none;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.close-btn--KhMED:focus{outline:none}.close-btn--KhMED svg{overflow:visible}.close-btn--KhMED[data-position=start],.close-btn--KhMED[data-position=left]{left:10px}.close-btn--KhMED[data-position=start][dir=rtl],.close-btn--KhMED[data-position=left][dir=rtl]{left:auto;right:10px}.close-btn--KhMED[data-position=end],.close-btn--KhMED[data-position=right]{right:10px}.close-btn--KhMED[data-position=end][dir=rtl],.close-btn--KhMED[data-position=right][dir=rtl]{left:10px;right:auto}",""]),n.locals={"close-btn":"close-btn--KhMED"};const s=n},7495:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'@keyframes spin--JuRkn{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.splash-container--4toz\\+{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;z-index:-1}.splash-container--4toz\\+ .splash-container__image--\\+1PkF{position:absolute;inset:0px;z-index:0}.splash-container--4toz\\+ .splash-container__image--\\+1PkF img{width:100%;height:100%;object-fit:cover}.splash-container--4toz\\+ .splash-container__lottie--f24Xy{position:absolute;inset:0px;z-index:1}.splash-container--4toz\\+ .splash-container__lottie--f24Xy canvas{width:100%;height:100%}.splash-container--4toz\\+.splash-container--isLoading--d8pYm: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--JuRkn .6s infinite linear;z-index:10}.splash-container--4toz\\+.splash-container--fadeIn--TD58C{opacity:1;transition:opacity ease-in .2s}.splash-container--4toz\\+.splash-container--fadeOut--GW15o{opacity:0;transition:opacity ease-out .3s}',""]),n.locals={"splash-container":"splash-container--4toz+","splash-container__image":"splash-container__image--+1PkF","splash-container__lottie":"splash-container__lottie--f24Xy","splash-container--isLoading":"splash-container--isLoading--d8pYm",spin:"spin--JuRkn","splash-container--fadeIn":"splash-container--fadeIn--TD58C","splash-container--fadeOut":"splash-container--fadeOut--GW15o"};const s=n},4289:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'.game-reader-container--qAxmf{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--vz8\\+v{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--vz8\\+v.game-reader--desktop-mode--hEnbE{padding:50px 0}.game-reader--vz8\\+v.game-reader--desktop-mode--hEnbE .game-reader__game-box--tDgOl{border-radius:var(--game-box-border-radius)}.game-reader--vz8\\+v.game-reader--widescreen--4rob-{padding:0 0}.game-reader--vz8\\+v.game-reader--widescreen--4rob- .game-reader__game-box--tDgOl{border-radius:0px}.game-reader--vz8\\+v .game-reader__refresh-btn--gKfAr{cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);z-index:2}.game-reader--vz8\\+v .game-reader__game-box--tDgOl.game-reader__game-box--widescreen--DD\\+rV{border-radius:0px}.game-reader--vz8\\+v .game-reader__iframe--e3dlS{width:100%;height:100%;transition:opacity ease-in .3s}.game-reader--vz8\\+v .game-reader__backdrop--g2Ozw{position:fixed;inset:0;z-index:-1}',""]),n.locals={"game-reader-container":"game-reader-container--qAxmf","game-reader":"game-reader--vz8+v","game-reader--desktop-mode":"game-reader--desktop-mode--hEnbE","game-reader__game-box":"game-reader__game-box--tDgOl","game-reader--widescreen":"game-reader--widescreen--4rob-","game-reader__refresh-btn":"game-reader__refresh-btn--gKfAr","game-reader__game-box--widescreen":"game-reader__game-box--widescreen--DD+rV","game-reader__iframe":"game-reader__iframe--e3dlS","game-reader__backdrop":"game-reader__backdrop--g2Ozw"};const s=n},7314:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.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)}",""]),n.locals={};const s=n},1938:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,"h3{margin:0}.stories-list-wrapper--\\+MxOM{background-color:var(--background-color, transparent);height:auto;padding:0;position:relative}.stories-list-wrapper--\\+MxOM.mode-desktop--Blm52.with-list-controls--CGYBY{position:relative}.stories-list--deukx{position:relative;overflow:visible}@media(min-width: 767.99px){.stories-list--deukx{overflow:hidden}}.stories-list__actions--p-QOR{position:absolute;right:0;top:0}.stories-list__viewport--m27BY{overflow:hidden;height:auto}.stories-list__viewport--m27BY:not(.mode-desktop--Blm52){display:flex}.stories-list__viewport-inner--oy\\+N4{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--oy\\+N4::-webkit-scrollbar{display:none}.stories-list__viewport-inner--oy\\+N4.mode-desktop--Blm52{scroll-behavior:unset;cursor:grab}.stories-list__viewport-inner--oy\\+N4.isVerticalDirection--P3UBw{flex-flow:row wrap}.stories-list__viewport-inner--oy\\+N4.align-center--9y43R{margin-left:auto;margin-right:auto}.stories-list__viewport-inner--oy\\+N4.align-left--Dm8Do{margin-right:auto}.stories-list__viewport-inner--oy\\+N4.align-right--bQ1a2{margin-left:auto}.stories-list__viewport-inner--oy\\+N4.isTitleCardOutsideTop--AeG\\+D{align-items:flex-end}.stories-list__viewport-inner--oy\\+N4.isTitleCardOutsideBottom--1P95a{align-items:flex-start}",""]),n.locals={"stories-list-wrapper":"stories-list-wrapper--+MxOM","mode-desktop":"mode-desktop--Blm52","with-list-controls":"with-list-controls--CGYBY","stories-list":"stories-list--deukx","stories-list__actions":"stories-list__actions--p-QOR","stories-list__viewport":"stories-list__viewport--m27BY","stories-list__viewport-inner":"stories-list__viewport-inner--oy+N4",isVerticalDirection:"isVerticalDirection--P3UBw","align-center":"align-center--9y43R","align-left":"align-left--Dm8Do","align-right":"align-right--bQ1a2",isTitleCardOutsideTop:"isTitleCardOutsideTop--AeG+D",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--1P95a"};const s=n},7533:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".favorite-images-wrapper--ypxcM{display:flex;flex-direction:row;flex-wrap:wrap;padding:var(--storiesListCardFavoriteTitle, --storiesListItemTitlePadding, 0px);gap:var(--storiesListCardFavoriteGap, 3px);box-sizing:border-box}.favorite-image-wrapper--iFI60{flex:0 1 calc(50% - var(--storiesListCardFavoriteGap, 3px));position:relative}.favorite-image--H\\+mP1{position:relative}.favorite-image-item--ylNcQ{position:absolute;inset:0px;border-radius:calc(var(--storiesListInnerBorderRadiusRead, 0)/4);background-position:50% 50%;background-size:cover}.circle_style--umugM .favorite-image-item--ylNcQ{border-radius:50%}",""]),n.locals={"favorite-images-wrapper":"favorite-images-wrapper--ypxcM","favorite-image-wrapper":"favorite-image-wrapper--iFI60","favorite-image":"favorite-image--H+mP1","favorite-image-item":"favorite-image-item--ylNcQ",circle_style:"circle_style--umugM"};const s=n},2811:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'.stories-slide-wrapper--\\+5j4I:not(:last-child){margin-right:var(--storiesGap, 20px)}.stories-slide-wrapper--\\+5j4I{display:flex;flex-direction:column;flex:0 0 auto;box-sizing:content-box;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--\\+5j4I:hover{text-decoration:none}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO{display:block;box-sizing:border-box;text-align:left;position:relative;overflow:visible;-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--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU{border-radius:var(--storiesListBorderRadius, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide-image--cxCFY,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide-image--cxCFY{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide-image__image--mNEIE video,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide-image__image--mNEIE video{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide__mask--p6utN,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide__mask--p6utN{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide__content--QrUVw,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide__content--QrUVw{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe{border-radius:var(--storiesListBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide-image--cxCFY,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide-image--cxCFY{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide-image__image--mNEIE video,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide-image__image--mNEIE video{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide__mask--p6utN,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide__mask--p6utN{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide__content--QrUVw,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide__content--QrUVw{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._is-read--xEVZe{border:var(--storiesListBorderReadWidth, 1px) solid var(--storiesBorderReadColor, #ededed)}.stories-slide-wrapper--\\+5j4I.isTitleCardOutsideTop--EmWjs{justify-content:flex-end}.stories-slide-wrapper--\\+5j4I.isTitleCardOutsideBottom--W1JSg{justify-content:flex-start}.stories-slide-wrapper--\\+5j4I .stories-slide__inner--doJqj{display:block;position:relative;width:100%;height:100%}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-black--M47zI{background:#000}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-white--0Coab{background:#fff}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-red--UU5V7{background:#ff1a36}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-yellow--0cCZc{background:#fff000}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-green--10A4n{background:#0be361}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-violet--bnIBG{background:#b300bc}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-blue--lpzRG{background:#0761db}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-grey--nbEfc{background:#a8a8a8}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-black-gradient--q\\+aHV{background:#fff;background:linear-gradient(0deg, #c1c1c1, #000)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-white-gradient--YqOjh{background:#fff;background:linear-gradient(180deg, #fff, #ffc800)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-red-gradient---eK73{background:#ff1a36;background:linear-gradient(180deg, #c90174, #eb5c57)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-yellow-gradient--xg23E{background:#fff000;background:linear-gradient(0deg, #fbda61, #f76b1c)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-green-gradient--LfrRF{background:#0be361;background:linear-gradient(0deg, #b4ed50, #429321)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-violet-gradient--EQOBs{background:#b300bc;background:linear-gradient(180deg, #c90174, #0164fd)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-blue-gradient--TJV7z{background:#0761db;background:linear-gradient(180deg, #3023ae, #53a0fe 48%, #b4ed50)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-grey-gradient--4zJ9u{background:#a8a8a8;background:linear-gradient(0deg, #e2e2e2, #959595)}.stories-slide-wrapper--\\+5j4I .stories-slide-image--cxCFY{position:relative;width:100%;height:100%}.stories-slide-wrapper--\\+5j4I .stories-slide-image__wrap--kAiGt{position:absolute;top:0;bottom:0;left:0;right:0}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE{position:relative;opacity:1;transition:opacity .3s ease-in-out;overflow:hidden}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE._mode_list--K7WdU{width:100%;height:100%}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE.ugc-card-cell--Hmi8u img{object-fit:contain}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE img{width:100%;height:100%;object-fit:cover}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE 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--\\+5j4I .stories-slide-image__image--mNEIE.video-loaded--380fQ img{display:none}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE.video-loaded--380fQ video{opacity:1}.stories-slide-wrapper--\\+5j4I .stories-slide__mask--p6utN{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--\\+5j4I .stories-slide--KQzLO._is-read--xEVZe .stories-slide__mask--p6utN{background-color:var(--storiesListItemOpenedMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemOpenedMaskLinearGradient, none)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._ugc-cell--yAsON .stories-slide__mask--p6utN{background-color:var(--storiesListCardUgcMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListCardUgcMaskLinearGradient, none)}.stories-slide-wrapper--\\+5j4I .stories-slide__content--QrUVw{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--\\+5j4I .stories-slide__content--QrUVw.__position_outside_top--5TlyN,.stories-slide-wrapper--\\+5j4I .stories-slide__content--QrUVw.__position_outside_bottom--pXuxb{position:relative;top:unset;right:unset;bottom:unset;left:unset;height:auto}.stories-slide-wrapper--\\+5j4I .clamp--X7TaH{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz.align-left--PkXxY{text-align:left}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz.align-center--9Flsz{text-align:center}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz.align-right--wSGXZ{text-align:right}.stories-slide--KQzLO._format-circle--yaqgh,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide-image__image--mNEIE,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide-image__image--mNEIE video,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide__mask--p6utN,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide-image--cxCFY{border-radius:50%}.stories-slide--KQzLO._favorite-cell--CbxlS .stories-slide__mask--p6utN{background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%)}.stories-slide--KQzLO._favorite-cell--CbxlS._format-circle--yaqgh .stories-slide-image__wrap--kAiGt{display:flex}.stories-slide--KQzLO._favorite-cell--CbxlS._format-circle--yaqgh .stories-slide-image__image--mNEIE{width:85%;height:85%;overflow:visible;margin:auto}.stories-slide--KQzLO._favorite-cell--CbxlS._format-circle--yaqgh .favorite-images-wrapper--zfyVz{margin:0;padding:0}.stories-slide--KQzLO._has-drop-shadow--GdCOv{filter:drop-shadow(var(--storiesListCardDropShadow, none))}.stories-slide--KQzLO._has-drop-shadow--GdCOv._is-read--xEVZe{filter:drop-shadow(var(--storiesListCardOpenedDropShadow, none))}.stories-slide--KQzLO._has-drop-shadow--GdCOv._favorite-cell--CbxlS{filter:drop-shadow(var(--storiesListCardFavoriteDropShadow, none))}.stories-slide--KQzLO._has-drop-shadow--GdCOv._ugc-cell--yAsON{filter:drop-shadow(var(--storiesListCardUgcDropShadow, none))}.stories-slide--KQzLO._has-card-svg-mask--0vIiG .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardMask);mask-image:var(--storiesListCardMask)}.stories-slide--KQzLO._has-card-svg-mask--0vIiG._is-read--xEVZe .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardOpenedMask);mask-image:var(--storiesListCardOpenedMask)}.stories-slide--KQzLO._has-card-svg-mask--0vIiG._favorite-cell--CbxlS .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardFavoriteMask);mask-image:var(--storiesListCardFavoriteMask)}.stories-slide--KQzLO._has-card-svg-mask--0vIiG._ugc-cell--yAsON .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardUgcMask);mask-image:var(--storiesListCardUgcMask)}.stories-slide--KQzLO .card-overlay-svg-mask--NPptq{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--KQzLO._has-border-gradient-color--JRjv-{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-: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--KQzLO._has-border-gradient-color--JRjv-._is-read--xEVZe{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-._is-read--xEVZe: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--KQzLO._has-border-gradient-color--JRjv-._favorite-cell--CbxlS{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-._favorite-cell--CbxlS: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--KQzLO._has-border-gradient-color--JRjv-._ugc-cell--yAsON{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-._ugc-cell--yAsON: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}}',""]),n.locals={"stories-slide-wrapper":"stories-slide-wrapper--+5j4I","stories-slide":"stories-slide--KQzLO","_format-quad":"_format-quad--InfBL","_format-rectangle":"_format-rectangle--koqBU","stories-slide-image":"stories-slide-image--cxCFY","stories-slide-image__image":"stories-slide-image__image--mNEIE","stories-slide__mask":"stories-slide__mask--p6utN","stories-slide__content":"stories-slide__content--QrUVw","_is-read":"_is-read--xEVZe",isTitleCardOutsideTop:"isTitleCardOutsideTop--EmWjs",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--W1JSg","stories-slide__inner":"stories-slide__inner--doJqj","_background-color-black":"_background-color-black--M47zI","_background-color-white":"_background-color-white--0Coab","_background-color-red":"_background-color-red--UU5V7","_background-color-yellow":"_background-color-yellow--0cCZc","_background-color-green":"_background-color-green--10A4n","_background-color-violet":"_background-color-violet--bnIBG","_background-color-blue":"_background-color-blue--lpzRG","_background-color-grey":"_background-color-grey--nbEfc","_background-color-black-gradient":"_background-color-black-gradient--q+aHV","_background-color-white-gradient":"_background-color-white-gradient--YqOjh","_background-color-red-gradient":"_background-color-red-gradient---eK73","_background-color-yellow-gradient":"_background-color-yellow-gradient--xg23E","_background-color-green-gradient":"_background-color-green-gradient--LfrRF","_background-color-violet-gradient":"_background-color-violet-gradient--EQOBs","_background-color-blue-gradient":"_background-color-blue-gradient--TJV7z","_background-color-grey-gradient":"_background-color-grey-gradient--4zJ9u","stories-slide-image__wrap":"stories-slide-image__wrap--kAiGt",_mode_list:"_mode_list--K7WdU","ugc-card-cell":"ugc-card-cell--Hmi8u","video-loaded":"video-loaded--380fQ","_ugc-cell":"_ugc-cell--yAsON",__position_outside_top:"__position_outside_top--5TlyN",__position_outside_bottom:"__position_outside_bottom--pXuxb",clamp:"clamp--X7TaH","stories-slide__title":"stories-slide__title--XeSlz","align-left":"align-left--PkXxY","align-center":"align-center--9Flsz","align-right":"align-right--wSGXZ","_format-circle":"_format-circle--yaqgh","_favorite-cell":"_favorite-cell--CbxlS","favorite-images-wrapper":"favorite-images-wrapper--zfyVz","_has-drop-shadow":"_has-drop-shadow--GdCOv","_has-card-svg-mask":"_has-card-svg-mask--0vIiG","card-overlay-svg-mask":"card-overlay-svg-mask--NPptq","_has-border-gradient-color":"_has-border-gradient-color--JRjv-"};const s=n},2731:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".stories-list-controls--sC1DN{pointer-events:none}.stories-list-controls--sC1DN .control-start--NWniL,.stories-list-controls--sC1DN .control-end--Ezk33{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--sC1DN .control-icon--D3DFc{width:7px;height:12px;background-color:var(--storiesListControlsColor, black)}.stories-list-controls--sC1DN.horizontal--g63LL .control-start--NWniL{left:0;transform:translateY(-50%)}.stories-list-controls--sC1DN.horizontal--g63LL .control-start--NWniL.control-start_dir_rtl--7Opm5{left:auto;right:0}.stories-list-controls--sC1DN.horizontal--g63LL .control-end--Ezk33{right:0;transform:translateY(-50%)}.stories-list-controls--sC1DN.horizontal--g63LL .control-end--Ezk33.control-end_dir_rtl--twvGk{left:0;right:auto}.stories-list-controls--sC1DN.vertical--1a8qJ .control-start--NWniL{top:var(--storiesListTopPadding, 0);left:50%;transform:translate3d(-50%, 0, 0) rotate(90deg)}.stories-list-controls--sC1DN.vertical--1a8qJ .control-end--Ezk33{top:auto;bottom:var(--storiesListBottomPadding, 0);right:50%;transform:translate3d(50%, 0, 0) rotate(90deg)}.stories-list-controls--sC1DN .control-start--NWniL{display:flex}.stories-list-controls--sC1DN .control-start--NWniL .control-icon--D3DFc{-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--sC1DN .control-start--NWniL.control-start_reach-start--sBg3n{display:none}.stories-list-controls--sC1DN .control-end--Ezk33{display:flex}.stories-list-controls--sC1DN .control-end--Ezk33 .control-icon--D3DFc{-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--sC1DN .control-end--Ezk33.control-end_reach-end--\\+gjXw{display:none}",""]),n.locals={"stories-list-controls":"stories-list-controls--sC1DN","control-start":"control-start--NWniL","control-end":"control-end--Ezk33","control-icon":"control-icon--D3DFc",horizontal:"horizontal--g63LL","control-start_dir_rtl":"control-start_dir_rtl--7Opm5","control-end_dir_rtl":"control-end_dir_rtl--twvGk",vertical:"vertical--1a8qJ","control-start_reach-start":"control-start_reach-start--sBg3n","control-end_reach-end":"control-end_reach-end--+gjXw"};const s=n},2130:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".stories-viewer--U\\+VEJ{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--U\\+VEJ:-webkit-full-screen,.stories-viewer--U\\+VEJ:-moz-full-screen,.stories-viewer--U\\+VEJ:-ms-fullscreen,.stories-viewer--U\\+VEJ :fullscreen{width:100% !important;height:100% !important}.stories-viewer-background--rxrSL{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-backdrop--GqsGY{position:fixed;top:0;right:0;bottom:0;left:0;z-index:11;background-color:rgba(255,255,255,.5)}.stories-viewer-backdrop--GqsGY._desktopMode--5f5bI{display:none}.slider3d--fgseF{position:fixed !important}.slider3d--fgseF.no-select--qQk5D{user-select:none}",""]),n.locals={"stories-viewer":"stories-viewer--U+VEJ","stories-viewer-background":"stories-viewer-background--rxrSL","stories-viewer-backdrop":"stories-viewer-backdrop--GqsGY",_desktopMode:"_desktopMode--5f5bI",slider3d:"slider3d--fgseF","no-select":"no-select--qQk5D"};const s=n},187:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".stories-button-panel--tzCuh{position:absolute;z-index:10001;bottom:0;left:0;width:100%;background-color:#000;border-bottom-left-radius:var(--slideBorderRadius, 0);border-bottom-right-radius:var(--slideBorderRadius, 0)}.stories-button-panel--tzCuh[dir=rtl] .stories-button-panel-actions--I0rFL .right-container--Ax9TH{margin-left:0;margin-right:auto}.stories-button-panel-actions--I0rFL{position:absolute;top:0;left:0;width:100%;height:50px;padding:0 4px;display:flex;flex-direction:row;color:#fff;align-items:center}.stories-button-panel-actions--I0rFL>span{display:flex}.stories-button-panel-actions--I0rFL .right-container--Ax9TH{margin-left:auto}.button-panel-action--rHoQs{cursor:pointer;pointer-events:all;display:flex;align-items:center;justify-content:center;height:50px;width:38px}.button-panel-action--rHoQs>*{pointer-events:none}",""]),n.locals={"stories-button-panel":"stories-button-panel--tzCuh","stories-button-panel-actions":"stories-button-panel-actions--I0rFL","right-container":"right-container--Ax9TH","button-panel-action":"button-panel-action--rHoQs"};const s=n},9108:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".goods-card--BAL7e{width:100px}.goods-card--BAL7e:first-of-type{margin-left:.5rem}.goods-card--BAL7e:not(:last-child){margin-right:.5rem}.prices--u3Ojw{display:flex}.prices--u3Ojw>div:not(:last-child){margin-right:.5rem}.typography--qlRjl{text-decoration:none}.typography--old-price--SnUxk{text-decoration:line-through}.figure--UwMfT{margin:0;margin-bottom:.5rem;width:100px;height:100px}.figure--UwMfT>img{width:inherit;height:inherit;max-width:100%;border-radius:var(--figure-border-radius, 0px);background-color:var(--figure-background-color, #ffffff)}",""]),n.locals={"goods-card":"goods-card--BAL7e",prices:"prices--u3Ojw",typography:"typography--qlRjl","typography--old-price":"typography--old-price--SnUxk",figure:"figure--UwMfT"};const s=n},6212:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".scrolling-carousel--lZnvG{position:relative}.scrolling-carousel__wrapper--Doobh{position:relative;overflow:hidden}.scrolling-carousel__item--A9ial{display:flex;flex-wrap:nowrap;cursor:pointer}.scrolling-carousel__arrow-button--HrmVa{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--HrmVa>svg{position:absolute;left:0;right:0;bottom:0;top:0;margin:auto;width:24px;height:24px;fill:#757575}.scrolling-carousel__arrow-button--HrmVa:hover svg{fill:#000}.scrolling-carousel__arrow-button--show--do24\\+{opacity:.9}.scrolling-carousel__arrow-button--show--do24\\+:hover{opacity:1}.scrolling-carousel__arrow-button--right--Werat{right:-18px}.scrolling-carousel__arrow-button--left--M-xt3{left:-18px}@media(pointer: coarse){.scrolling-carousel__arrow-button--HrmVa{display:none !important}}",""]),n.locals={"scrolling-carousel":"scrolling-carousel--lZnvG","scrolling-carousel__wrapper":"scrolling-carousel__wrapper--Doobh","scrolling-carousel__item":"scrolling-carousel__item--A9ial","scrolling-carousel__arrow-button":"scrolling-carousel__arrow-button--HrmVa","scrolling-carousel__arrow-button--show":"scrolling-carousel__arrow-button--show--do24+","scrolling-carousel__arrow-button--right":"scrolling-carousel__arrow-button--right--Werat","scrolling-carousel__arrow-button--left":"scrolling-carousel__arrow-button--left--M-xt3"};const s=n},8161:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".btn--dxsSR{margin:auto auto 10px;padding:10px;cursor:pointer}",""]),n.locals={btn:"btn--dxsSR"};const s=n},1277:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,"@keyframes spin--Mv6zz{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner--xVBKd{position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);width:2rem;height:2rem;border-radius:50%;animation:spin--Mv6zz .6s infinite linear;border:var(--border, 2px solid transparent);border-color:var(--border-color, black)}",""]),n.locals={spinner:"spinner--xVBKd",spin:"spin--Mv6zz"};const s=n},4940:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,"@keyframes fadeInFrames--bEyJg{from{opacity:0}to{opacity:1}}@keyframes fadeOutFrames--oBX-p{from{opacity:1}to{opacity:0}}.goods-container--tR-eJ{position:relative;margin-left:auto;margin-right:auto;display:flex;flex-direction:column;width:100%;height:100%;margin-top:0px}.goods-container--visible--dd40k{animation:300ms fadeInFrames--bEyJg}.goods-container--hidden--QAS9\\+{animation:300ms normal forwards fadeOutFrames--oBX-p}.goods-container__backdrop--CyeDo{flex:1}.goods-list--Wax8Q{position:relative;display:flex;flex-direction:column}",""]),n.locals={"goods-container":"goods-container--tR-eJ","goods-container--visible":"goods-container--visible--dd40k",fadeInFrames:"fadeInFrames--bEyJg","goods-container--hidden":"goods-container--hidden--QAS9+",fadeOutFrames:"fadeOutFrames--oBX-p","goods-container__backdrop":"goods-container__backdrop--CyeDo","goods-list":"goods-list--Wax8Q"};const s=n},2913:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".goods-widget-viewer--ryMdV{position:absolute;inset:0;z-index:3000;text-align:left}",""]),n.locals={"goods-widget-viewer":"goods-widget-viewer--ryMdV"};const s=n},2349:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".stories-viewer__close--zjUnU{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:calc(15px + var(--timelineBlockTopOffset, 5px));pointer-events:all;cursor:pointer;outline:none;transition:opacity .3s ease-in;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.stories-viewer__close--zjUnU:focus{outline:none}.stories-viewer__close--zjUnU svg{overflow:visible}.stories-viewer__close--zjUnU._paused-ui--wbADu{opacity:0}.stories-viewer__close--zjUnU[data-position=start],.stories-viewer__close--zjUnU[data-position=left]{left:10px}.stories-viewer__close--zjUnU[data-position=start][dir=rtl],.stories-viewer__close--zjUnU[data-position=left][dir=rtl]{left:auto;right:10px}.stories-viewer__close--zjUnU[data-position=end],.stories-viewer__close--zjUnU[data-position=right]{right:10px}.stories-viewer__close--zjUnU[data-position=end][dir=rtl],.stories-viewer__close--zjUnU[data-position=right][dir=rtl]{left:10px;right:auto}.story-header--iD7hE{position:relative;z-index:1140}",""]),n.locals={"stories-viewer__close":"stories-viewer__close--zjUnU","_paused-ui":"_paused-ui--wbADu","story-header":"story-header--iD7hE"};const s=n},9137:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".stories-pager--JtIm1{position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:1131;background-image:linear-gradient(180deg, rgba(0, 0, 0, 0.104) 0%, rgba(0, 0, 0, 0) 20%);pointer-events:none;transition:opacity .3s ease-in}.stories-pager--JtIm1._desktop-mode--MFqdz{border-top-left-radius:5px;border-top-right-radius:5px}.stories-pager--JtIm1._paused-ui--YKpOe{opacity:0}.stories-pager__ticks--IooJa{height:3px;display:flex;margin:8px 8px;margin-top:var(--timelineBlockTopOffset, 8px);opacity:1}.stories-pager__ticks--IooJa.hiddenTimeline--uwXIm{opacity:0}.stories-pager__tick--L96Px{background-color:var(--stories-pager-background, rgba(255, 255, 255, 0.6));width:100%;margin:0 2px;overflow:hidden;position:relative;border-radius:10px}.stories-pager__tick--L96Px:first-child{margin-left:0}.stories-pager__tick--L96Px:last-child{margin-right:0}.stories-pager__tick-progress--lwEYc{width:100%;height:3px}.stories-pager__tick-progress--lwEYc._active---U7hY{background-color:var(--stories-pager-tick-foreground, rgb(255, 255, 255))}.stories-pager__tick-progress-loader--DJvQ6{width:100%;height:3px;position:absolute;top:0;left:0;background:linear-gradient(to right, var(--stories-pager-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}.stories-pager--JtIm1[dir=rtl] .stories-pager__tick-progress-loader--DJvQ6{background:linear-gradient(to left, var(--stories-pager-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}",""]),n.locals={"stories-pager":"stories-pager--JtIm1","_desktop-mode":"_desktop-mode--MFqdz","_paused-ui":"_paused-ui--YKpOe","stories-pager__ticks":"stories-pager__ticks--IooJa",hiddenTimeline:"hiddenTimeline--uwXIm","stories-pager__tick":"stories-pager__tick--L96Px","stories-pager__tick-progress":"stories-pager__tick-progress--lwEYc",_active:"_active---U7hY","stories-pager__tick-progress-loader":"stories-pager__tick-progress-loader--DJvQ6"};const s=n},3278:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'.stories-slide--8v5Pf{top:0;left:0;right:0;bottom:0;position:absolute;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:var(--slideBorderRadius, 0)}.stories-slide--8v5Pf._dummy--Llble{background-color:#fff}.stories-slide--8v5Pf .load-mask--5XCq2{position:absolute;background-color:#000;z-index:2000;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center}.stories-slide--8v5Pf._with-bottom-panel--2p7Pi._desktop-mode--CJL90,.stories-slide--8v5Pf._with-bottom-panel--2p7Pi._desktop-mode--CJL90 .narrative-slide-background--hMuFX,.stories-slide--8v5Pf._with-bottom-panel--2p7Pi._desktop-mode--CJL90 .narrative-slide-elements--i0a24{border-bottom-right-radius:0;border-bottom-left-radius:0}.stories-slide--8v5Pf .stories-slide__refresh-btn--MEBPq{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}.loading-spinner-default--ltiyb{-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--T3-dY .6s infinite linear;animation:loading-spinner--T3-dY .6s infinite linear}@keyframes loading-spinner--T3-dY{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.stories-slide--8v5Pf{z-index:1120;visibility:hidden}.stories-slide--8v5Pf.active-slide--ncZf1{z-index:1130;visibility:visible}.stories-slide-offset--R5f2H{pointer-events:none;position:relative;height:100%}.stories-slide-box--Br9iz{position:relative;padding:154.838709677% 0 0 0}.stories-slide-content--CKfk0{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}',""]),n.locals={"stories-slide":"stories-slide--8v5Pf",_dummy:"_dummy--Llble","load-mask":"load-mask--5XCq2","_with-bottom-panel":"_with-bottom-panel--2p7Pi","_desktop-mode":"_desktop-mode--CJL90","narrative-slide-background":"narrative-slide-background--hMuFX","narrative-slide-elements":"narrative-slide-elements--i0a24","stories-slide__refresh-btn":"stories-slide__refresh-btn--MEBPq","loading-spinner-default":"loading-spinner-default--ltiyb","loading-spinner":"loading-spinner--T3-dY","active-slide":"active-slide--ncZf1","stories-slide-offset":"stories-slide-offset--R5f2H","stories-slide-box":"stories-slide-box--Br9iz","stories-slide-content":"stories-slide-content--CKfk0"};const s=n},2594:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".stories-item--s9hOL{visibility:visible;position:absolute;width:100%;height:auto;bottom:0;border-radius:inherit;backface-visibility:hidden}.slider3d__item--7j2AS{position:absolute;left:0;top:0;width:100%;backface-visibility:hidden;transform-style:preserve-3d}",""]),n.locals={"stories-item":"stories-item--s9hOL",slider3d__item:"slider3d__item--7j2AS"};const s=n},9669:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".story-reader-controls--8N5W7 .slider3d__btn_next--2GDPW,.story-reader-controls--8N5W7 .slider3d__btn_prev--P6gvY{display:none}.story-reader-controls--8N5W7._desktop_mode--mSlGA .slider3d__btn_next--2GDPW,.story-reader-controls--8N5W7._desktop_mode--mSlGA .slider3d__btn_prev--P6gvY{display:block;position:absolute;top:50%;transform:translateY(-50%);left:50%}.story-reader-controls--8N5W7 .btn-icon--NRFjq{-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}.story-reader-controls--8N5W7 .btn-icon--NRFjq:focus{outline:0}.story-reader-controls--8N5W7 .btn-icon--NRFjq:disabled{color:#464646;cursor:not-allowed}",""]),n.locals={"story-reader-controls":"story-reader-controls--8N5W7",slider3d__btn_next:"slider3d__btn_next--2GDPW",slider3d__btn_prev:"slider3d__btn_prev--P6gvY",_desktop_mode:"_desktop_mode--mSlGA","btn-icon":"btn-icon--NRFjq"};const s=n},3390:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".slider3d__wrapper--49G6v{left:50%;transform:translateX(-50%);overflow:hidden;box-sizing:border-box}.slider3d__wrapper--49G6v.slider3d__wrapper_swipe-up--r1InL.slider3d__wrapper_swipe-up--r1InL{background-color:rgba(0,0,0,0)}.slider3d__wrapper--49G6v .game-reader-wrapper--vHugs,.slider3d__wrapper--49G6v .share-panel-wrapper--zNSqw{overflow:hidden}.slider3d__wrapper--49G6v._desktop_mode--m7fGP{padding:50px 0}.slider3d__wrapper--49G6v._desktop_mode--m7fGP>.share-panel-wrapper--zNSqw{top:50px;bottom:50px;border-radius:5px}.slider3d__wrapper--49G6v._desktop_mode--m7fGP>.share-panel-wrapper--zNSqw.share-panel-wrapper--zNSqw{border-bottom-left-radius:0;border-bottom-right-radius:0}.slider3d__wrapper--49G6v *,.slider3d__wrapper--49G6v ::after,.slider3d__wrapper--49G6v ::before{box-sizing:border-box}.slider3d__wrapper--49G6v .stories-item--i1n9b,.slider3d__wrapper--49G6v .stories-slide--KXt9a,.slider3d__wrapper--49G6v .narrative-slide-background--LO2L6,.slider3d__wrapper--49G6v .narrative-slide-elements--bUq5g{border-radius:var(--slideBorderRadius, 0)}.slider3d--pT6gr{position:fixed !important}.slider3d--pT6gr.no-select--zMya8{user-select:none}.slider3d__wrapper--49G6v{z-index:1;position:relative;height:100%}.stories-face--tqFop{position:absolute !important;top:0;left:0;right:0;width:100%;width:calc(100% + .01px);height:100%}.slider3d__rotater--eYXIw{--tick: 0%;--tickOpacity: 0}.slider3d__inner--EFsin,.slider3d__rotater--eYXIw{position:relative;height:100%;transform-style:preserve-3d}",""]),n.locals={slider3d__wrapper:"slider3d__wrapper--49G6v","slider3d__wrapper_swipe-up":"slider3d__wrapper_swipe-up--r1InL","game-reader-wrapper":"game-reader-wrapper--vHugs","share-panel-wrapper":"share-panel-wrapper--zNSqw",_desktop_mode:"_desktop_mode--m7fGP","stories-item":"stories-item--i1n9b","stories-slide":"stories-slide--KXt9a","narrative-slide-background":"narrative-slide-background--LO2L6","narrative-slide-elements":"narrative-slide-elements--bUq5g",slider3d:"slider3d--pT6gr","no-select":"no-select--zMya8","stories-face":"stories-face--tqFop",slider3d__rotater:"slider3d__rotater--eYXIw",slider3d__inner:"slider3d__inner--EFsin"};const s=n},4169:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'.wrapper--A3xCJ{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:3000;border-radius:inherit}.wrapper--A3xCJ .backdrop--CPTm4{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--2Iqns{position:absolute;z-index:2;user-select:none;display:flex;flex-direction:column;text-rendering:geometricprecision;overflow:hidden}.main--2Iqns .question--mn519{width:100%;height:auto}.main--2Iqns .question--mn519:empty{display:none}.main--2Iqns .input-group--jE\\+PN{display:flex}.main--2Iqns .input-group--jE\\+PN .input--Z388z{width:100%}.main--2Iqns .input-group--jE\\+PN .input-group__prepend--KtZUG{display:flex;flex:.35}.main--2Iqns .input-group--jE\\+PN .input-group__separator--44goC{border-right:1px solid #fff;margin-right:.5rem}.main--2Iqns .input-group--jE\\+PN .input--Z388z{flex:1}.main--2Iqns .input-wrapper--yYgPA{overflow:hidden;box-sizing:content-box;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.main--2Iqns .input-wrapper--yYgPA .input--Z388z{background:none;-webkit-tap-highlight-color:rgba(0,0,0,0);text-rendering:inherit;outline:none;border:none}.main--2Iqns .input-wrapper--yYgPA .input--Z388z::placeholder{color:inherit}.main--2Iqns .input-wrapper--yYgPA .input--Z388z.input_centered--0yBvl{text-align:center}.main--2Iqns .input-wrapper--yYgPA.is-invalid--PDNfg{border-color:#dc3545 !important;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.textarea-grow-wrap----9bt{display:grid;max-width:100%;word-break:break-all}.textarea-grow-wrap----9bt::after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.textarea-grow-wrap----9bt>.input--Z388z{resize:none;overflow:hidden}.textarea-grow-wrap----9bt>.input--Z388z,.textarea-grow-wrap----9bt::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--u94hX{width:100%}.button-wrapper--u94hX .button--bQRP7{width:100%;cursor:pointer}.button-wrapper--u94hX .button--bQRP7:disabled,.button-wrapper--u94hX .button--bQRP7[disabled=true]{cursor:not-allowed;pointer-events:none;background-color:#272727 !important}@keyframes fadeIn--b16pe{from{opacity:0}to{opacity:1}}@keyframes fadeOut--DquTc{from{opacity:1}to{opacity:0}}.fadeIn--b16pe{animation:fadeIn--b16pe 300ms forwards}.fadeOut--DquTc{animation:fadeOut--DquTc 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}',""]),n.locals={wrapper:"wrapper--A3xCJ",backdrop:"backdrop--CPTm4",main:"main--2Iqns",question:"question--mn519","input-group":"input-group--jE+PN",input:"input--Z388z","input-group__prepend":"input-group__prepend--KtZUG","input-group__separator":"input-group__separator--44goC","input-wrapper":"input-wrapper--yYgPA",input_centered:"input_centered--0yBvl","is-invalid":"is-invalid--PDNfg","textarea-grow-wrap":"textarea-grow-wrap----9bt","button-wrapper":"button-wrapper--u94hX",button:"button--bQRP7",fadeIn:"fadeIn--b16pe",fadeOut:"fadeOut--DquTc"};const s=n},5757:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'.screen-orientation-lock--lAOKa{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=")}',""]),n.locals={"screen-orientation-lock":"screen-orientation-lock--lAOKa"};const s=n},1196:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".share-panel__body_screenshot--uZCkX{display:flex;flex-direction:column}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1{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--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM{margin-right:5px;position:relative;width:30px;height:30px;flex-shrink:0}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM .btn-copy__icon-state--aOFwh{position:absolute;inset:0px;opacity:0;transition:opacity 300ms ease-in-out}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM .btn-copy__icon-state--aOFwh.btn-copy__icon-state_default--n6LWH{opacity:1;visibility:visible}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM .btn-copy__icon-state--aOFwh.btn-copy__icon-state_done--r-uzJ{opacity:1;visibility:visible}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__text--IQD4A{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:5px}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1:active{transform:scale(0.96)}.share-panel__body_screenshot--uZCkX .share-panel-row--LzAa0{justify-content:center;height:auto;padding:16px}.share-panel__body_screenshot--uZCkX .share-panel-row--LzAa0:first-child{height:450px;box-sizing:border-box}.share-panel__body_screenshot--uZCkX .share-panel-row__image-link--RXIki{width:100%;height:100%;display:flex;justify-content:center}.share-panel__body_screenshot--uZCkX .share-panel-row__image--HyVwP{max-width:100%;height:100%;object-fit:cover;border-radius:20px}.share-panel__body_screenshot--uZCkX .share-item__download-button--ypCUc{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--uZCkX .share-item__download-button--ypCUc:active{transform:scale(0.96)}",""]),n.locals={"share-panel__body_screenshot":"share-panel__body_screenshot--uZCkX",btn:"btn--VzRxf","btn-copy":"btn-copy--dhlh1","btn-copy__icon":"btn-copy__icon--w7FbM","btn-copy__icon-state":"btn-copy__icon-state--aOFwh","btn-copy__icon-state_default":"btn-copy__icon-state_default--n6LWH","btn-copy__icon-state_done":"btn-copy__icon-state_done--r-uzJ","btn-copy__text":"btn-copy__text--IQD4A","share-panel-row":"share-panel-row--LzAa0","share-panel-row__image-link":"share-panel-row__image-link--RXIki","share-panel-row__image":"share-panel-row__image--HyVwP","share-item__download-button":"share-item__download-button--ypCUc"};const s=n},610:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".share-item--OHeZZ{color:#fff}a.share-item--OHeZZ{color:#fff;transition:none}a.share-item--OHeZZ:hover{color:#fff}.social-list--5d274{flex-wrap:wrap;height:auto;padding-bottom:1rem}.social-list--5d274 .social-list__item--PmqO7{margin-top:1rem}",""]),n.locals={"share-item":"share-item--OHeZZ","social-list":"social-list--5d274","social-list__item":"social-list__item--PmqO7"};const s=n},8778:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'.share-panel-wrapper--x2oi3{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:2}.share-panel-wrapper--x2oi3 .share-panel-backdrop--wh9uo{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5)}.share-panel--Qm-mD{position:absolute;top:auto;left:0;right:0;bottom:0;z-index:2;user-select:none}.share-panel-row--LPdKG{width:100%;height:150px;display:flex;flex-direction:row;align-items:center}.share-panel-row--LPdKG .share-item--ZalUh{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--LPdKG .share-item--ZalUh:first-child{margin-left:20px}.share-panel-row--LPdKG .share-item--ZalUh:last-child{margin-right:20px}.share-panel-row--LPdKG .share-item--ZalUh,.share-panel-row--LPdKG .share-item--ZalUh:visited,.share-panel-row--LPdKG .share-item--ZalUh:active,.share-panel-row--LPdKG .share-item--ZalUh:focus{text-decoration:none}.share-panel-row--LPdKG .share-item--ZalUh .share-item-title--RxVKy{margin-top:20px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:.2rem}.share-panel-row--LPdKG.title-row--Vfan2{height:120px;padding-top:30px;padding-bottom:30px;padding-left:20px;padding-right:20px}.share-panel-row--LPdKG.title-row--Vfan2 .share-url-favicon--cGryk{width:60px;height:60px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.share-panel-row--LPdKG.title-row--Vfan2 .share-url-favicon--cGryk img{width:30px;height:30px}.share-panel-row--LPdKG.title-row--Vfan2 .title--ZQZ6c{font-size:16px;line-height:1.4rem;margin-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.share-panel-separator--NXYXt{width:100%;height:1px}.share-panel--Qm-mD{will-change:transform;transition:transform 300ms}.share-panel__body--7Ljnv{width:100%;height:100%}@keyframes slideIn--CzJft{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slideOut--lNjIY{from{transform:translateY(0%)}to{transform:translateY(100%)}}@keyframes fadeIn--qopSX{from{opacity:0}to{opacity:1}}@keyframes fadeOut--bA6JG{from{opacity:1}to{opacity:0}}.fadeIn--qopSX{animation:fadeIn--qopSX 300ms forwards}.fadeOut--bA6JG{animation:fadeOut--bA6JG 300ms forwards}.slideIn--CzJft{animation:slideIn--CzJft 300ms forwards}.slideOut--lNjIY{animation:slideOut--lNjIY 300ms forwards}',""]),n.locals={"share-panel-wrapper":"share-panel-wrapper--x2oi3","share-panel-backdrop":"share-panel-backdrop--wh9uo","share-panel":"share-panel--Qm-mD","share-panel-row":"share-panel-row--LPdKG","share-item":"share-item--ZalUh","share-item-title":"share-item-title--RxVKy","title-row":"title-row--Vfan2","share-url-favicon":"share-url-favicon--cGryk",title:"title--ZQZ6c","share-panel-separator":"share-panel-separator--NXYXt","share-panel__body":"share-panel__body--7Ljnv",fadeIn:"fadeIn--qopSX",fadeOut:"fadeOut--bA6JG",slideIn:"slideIn--CzJft",slideOut:"slideOut--lNjIY"};const s=n},7081:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".icon--5RBkn{width:2rem;height:2rem}",""]),n.locals={icon:"icon--5RBkn"};const s=n},6323:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var r=i(935),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,".narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-link,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-answer,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-data-input,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-poll-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-answer,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-rate-input,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-range-slider-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-answer,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-copy,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-share,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-story-repeat,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-game,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-target],.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-type=closeStory],.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up-items,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-barcode{pointer-events:all;cursor:pointer}.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-link *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-answer *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-data-input *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-poll-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-answer *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-rate-input *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-range-slider-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-answer *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-copy *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-share *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-story-repeat *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-game *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-target] *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-type=closeStory] *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up-items *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-barcode *{pointer-events:none}.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-range-slider-input-container .rangeslider{pointer-events:all;cursor:pointer}",""]);const s=n},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,r){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(r)for(var s=0;s<this.length;s++){var a=this[s][0];null!=a&&(n[a]=!0)}for(var o=0;o<e.length;o++){var l=[].concat(e[o]);r&&n[l[0]]||(i&&(l[2]?l[2]="".concat(i," and ").concat(l[2]):l[2]=i),t.push(l))}},t}},2743:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function n(e,t,i){return e.concat(t).map((function(e){return r(e,i)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,t,i){var n={};return i.isMergeableObject(e)&&s(e).forEach((function(t){n[t]=r(e[t],i)})),s(t).forEach((function(s){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(a(e,s)&&i.isMergeableObject(t[s])?n[s]=function(e,t){if(!t.customMerge)return l;var i=t.customMerge(e);return"function"==typeof i?i:l}(s,i)(e[s],t[s],i):n[s]=r(t[s],i))})),n}function l(e,i,s){(s=s||{}).arrayMerge=s.arrayMerge||n,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=r;var a=Array.isArray(i);return a===Array.isArray(e)?a?s.arrayMerge(e,i,s):o(e,i,s):r(i,s)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return l(e,i,t)}),{})};var d=l;e.exports=d},46:e=>{"use strict";var t,i="object"==typeof Reflect?Reflect:null,r=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(i,r){function n(i){e.removeListener(t,s),r(i)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),i([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&g(e,"error",t,i)}(e,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(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?s.defaultMaxListeners:e._maxListeners}function d(e,t,i,r){var n,s,a,d;if(o(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]),void 0===a)a=s[t]=i,++e._eventsCount;else if("function"==typeof a?a=s[t]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),(n=l(e))>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){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,i){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},n=c.bind(r);return n.listener=i,r.wrapFn=n,n}function h(e,t,i){var r=e._events;if(void 0===r)return[];var n=r[t];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(n):f(n,n.length)}function p(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function f(e,t){for(var i=new Array(t),r=0;r<t;++r)i[r]=e[r];return i}function g(e,t,i,r){if("function"==typeof e.on)r.once?e.once(t,i):e.on(t,i);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 n(s){r.once&&e.removeEventListener(t,n),i(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.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},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(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},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var d=l.length,c=f(l,d);for(i=0;i<d;++i)r(c[i],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return o(t),this.on(e,u(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,u(this,e,t)),this},s.prototype.removeListener=function(e,t){var i,r,n,s,a;if(o(t),void 0===(r=this._events))return this;if(void 0===(i=r[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(n=-1,s=i.length-1;s>=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,n=s;break}if(n<0)return this;0===n?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,n),1===i.length&&(r[e]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var n,s=Object.keys(i);for(r=0;r<s.length;++r)"removeListener"!==(n=s[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3103:(e,t,i)=>{var r=i(4715)(i(8942),"DataView");e.exports=r},5098:(e,t,i)=>{var r=i(3305),n=i(9361),s=i(1112),a=i(5276),o=i(7452);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=s,l.prototype.has=a,l.prototype.set=o,e.exports=l},1386:(e,t,i)=>{var r=i(2393),n=i(2049),s=i(7144),a=i(5071),o=i(3964);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=s,l.prototype.has=a,l.prototype.set=o,e.exports=l},9770:(e,t,i)=>{var r=i(4715)(i(8942),"Map");e.exports=r},8250:(e,t,i)=>{var r=i(9753),n=i(5681),s=i(88),a=i(4732),o=i(9068);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=s,l.prototype.has=a,l.prototype.set=o,e.exports=l},9413:(e,t,i)=>{var r=i(4715)(i(8942),"Promise");e.exports=r},4512:(e,t,i)=>{var r=i(4715)(i(8942),"Set");e.exports=r},3212:(e,t,i)=>{var r=i(8250),n=i(1877),s=i(8006);function a(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new r;++t<i;)this.add(e[t])}a.prototype.add=a.prototype.push=n,a.prototype.has=s,e.exports=a},1340:(e,t,i)=>{var r=i(1386),n=i(4103),s=i(1779),a=i(4162),o=i(7462),l=i(6638);function d(e){var t=this.__data__=new r(e);this.size=t.size}d.prototype.clear=n,d.prototype.delete=s,d.prototype.get=a,d.prototype.has=o,d.prototype.set=l,e.exports=d},5650:(e,t,i)=>{var r=i(8942).Symbol;e.exports=r},1623:(e,t,i)=>{var r=i(8942).Uint8Array;e.exports=r},9270:(e,t,i)=>{var r=i(4715)(i(8942),"WeakMap");e.exports=r},9847:e=>{e.exports=function(e,t){for(var i=-1,r=null==e?0:e.length,n=0,s=[];++i<r;){var a=e[i];t(a,i,e)&&(s[n++]=a)}return s}},9756:(e,t,i)=>{var r=i(2478);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},3316:e=>{e.exports=function(e,t,i){for(var r=-1,n=null==e?0:e.length;++r<n;)if(i(t,e[r]))return!0;return!1}},358:(e,t,i)=>{var r=i(6137),n=i(3283),s=i(3142),a=i(5853),o=i(9632),l=i(8666),d=Object.prototype.hasOwnProperty;e.exports=function(e,t){var i=s(e),c=!i&&n(e),u=!i&&!c&&a(e),h=!i&&!c&&!u&&l(e),p=i||c||u||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!d.call(e,v)||p&&("length"==v||u&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||o(v,g))||f.push(v);return f}},1129:e=>{e.exports=function(e,t){for(var i=-1,r=t.length,n=e.length;++i<r;)e[n+i]=t[i];return e}},6465:e=>{e.exports=function(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(t(e[i],i,e))return!0;return!1}},7034:(e,t,i)=>{var r=i(6285);e.exports=function(e,t){for(var i=e.length;i--;)if(r(e[i][0],t))return i;return-1}},7250:e=>{e.exports=function(e,t,i,r){for(var n=e.length,s=i+(r?1:-1);r?s--:++s<n;)if(t(e[s],s,e))return s;return-1}},313:(e,t,i)=>{var r=i(1129),n=i(714);e.exports=function e(t,i,s,a,o){var l=-1,d=t.length;for(s||(s=n),o||(o=[]);++l<d;){var c=t[l];i>0&&s(c)?i>1?e(c,i-1,s,a,o):r(o,c):a||(o[o.length]=c)}return o}},8244:(e,t,i)=>{var r=i(1129),n=i(3142);e.exports=function(e,t,i){var s=t(e);return n(e)?s:r(s,i(e))}},7379:(e,t,i)=>{var r=i(5650),n=i(8870),s=i(9005),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?n(e):s(e)}},2478:(e,t,i)=>{var r=i(7250),n=i(9454),s=i(7706);e.exports=function(e,t,i){return t==t?s(e,t,i):r(e,n,i)}},6027:(e,t,i)=>{var r=i(7379),n=i(547);e.exports=function(e){return n(e)&&"[object Arguments]"==r(e)}},4687:(e,t,i)=>{var r=i(353),n=i(547);e.exports=function e(t,i,s,a,o){return t===i||(null==t||null==i||!n(t)&&!n(i)?t!=t&&i!=i:r(t,i,s,a,e,o))}},353:(e,t,i)=>{var r=i(1340),n=i(3934),s=i(8861),a=i(1182),o=i(8486),l=i(3142),d=i(5853),c=i(8666),u="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,i,g,v,m){var b=l(e),y=l(t),w=b?h:o(e),S=y?h:o(t),_=(w=w==u?p:w)==p,x=(S=S==u?p:S)==p,O=w==S;if(O&&d(e)){if(!d(t))return!1;b=!0,_=!1}if(O&&!_)return m||(m=new r),b||c(e)?n(e,t,i,g,v,m):s(e,t,w,i,g,v,m);if(!(1&i)){var k=_&&f.call(e,"__wrapped__"),C=x&&f.call(t,"__wrapped__");if(k||C){var M=k?e.value():e,P=C?t.value():t;return m||(m=new r),v(M,P,i,g,m)}}return!!O&&(m||(m=new r),a(e,t,i,g,v,m))}},9454:e=>{e.exports=function(e){return e!=e}},9624:(e,t,i)=>{var r=i(3655),n=i(4759),s=i(1580),a=i(4066),o=/^\[object .+?Constructor\]$/,l=Function.prototype,d=Object.prototype,c=l.toString,u=d.hasOwnProperty,h=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!s(e)||n(e))&&(r(e)?h:o).test(a(e))}},674:(e,t,i)=>{var r=i(7379),n=i(5387),s=i(547),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return s(e)&&n(e.length)&&!!a[r(e)]}},195:(e,t,i)=>{var r=i(4882),n=i(8121),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return n(e);var t=[];for(var i in Object(e))s.call(e,i)&&"constructor"!=i&&t.push(i);return t}},6137:e=>{e.exports=function(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}},6403:(e,t,i)=>{var r=i(2945),n=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(n,""):e}},9460:e=>{e.exports=function(e){return function(t){return e(t)}}},5630:(e,t,i)=>{var r=i(3212),n=i(9756),s=i(3316),a=i(5568),o=i(6208),l=i(9828);e.exports=function(e,t,i){var d=-1,c=n,u=e.length,h=!0,p=[],f=p;if(i)h=!1,c=s;else if(u>=200){var g=t?null:o(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++d<u;){var v=e[d],m=t?t(v):v;if(v=i||0!==v?v:0,h&&m==m){for(var b=f.length;b--;)if(f[b]===m)continue e;t&&f.push(m),p.push(v)}else c(f,m,i)||(f!==p&&f.push(m),p.push(v))}return p}},5568:e=>{e.exports=function(e,t){return e.has(t)}},4354:e=>{e.exports=function(e,t){var i=-1,r=e.length;for(t||(t=Array(r));++i<r;)t[i]=e[i];return t}},1950:(e,t,i)=>{var r=i(8942)["__core-js_shared__"];e.exports=r},6208:(e,t,i)=>{var r=i(4512),n=i(9071),s=i(9828),a=r&&1/s(new r([,-0]))[1]==1/0?function(e){return new r(e)}:n;e.exports=a},3934:(e,t,i)=>{var r=i(3212),n=i(6465),s=i(5568);e.exports=function(e,t,i,a,o,l){var d=1&i,c=e.length,u=t.length;if(c!=u&&!(d&&u>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&i?new r:void 0;for(l.set(e,t),l.set(t,e);++f<c;){var m=e[f],b=t[f];if(a)var y=d?a(b,m,f,t,e,l):a(m,b,f,e,t,l);if(void 0!==y){if(y)continue;g=!1;break}if(v){if(!n(t,(function(e,t){if(!s(v,t)&&(m===e||o(m,e,i,a,l)))return v.push(t)}))){g=!1;break}}else if(m!==b&&!o(m,b,i,a,l)){g=!1;break}}return l.delete(e),l.delete(t),g}},8861:(e,t,i)=>{var r=i(5650),n=i(1623),s=i(6285),a=i(3934),o=i(5894),l=i(9828),d=r?r.prototype:void 0,c=d?d.valueOf:void 0;e.exports=function(e,t,i,r,d,u,h){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!u(new n(e),new n(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return s(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=o;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,d,u,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},1182:(e,t,i)=>{var r=i(393),n=Object.prototype.hasOwnProperty;e.exports=function(e,t,i,s,a,o){var l=1&i,d=r(e),c=d.length;if(c!=r(t).length&&!l)return!1;for(var u=c;u--;){var h=d[u];if(!(l?h in t:n.call(t,h)))return!1}var p=o.get(e),f=o.get(t);if(p&&f)return p==t&&f==e;var g=!0;o.set(e,t),o.set(t,e);for(var v=l;++u<c;){var m=e[h=d[u]],b=t[h];if(s)var y=l?s(b,m,h,t,e,o):s(m,b,h,e,t,o);if(!(void 0===y?m===b||a(m,b,i,s,o):y)){g=!1;break}v||(v="constructor"==h)}if(g&&!v){var w=e.constructor,S=t.constructor;w==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof S&&S instanceof S||(g=!1)}return o.delete(e),o.delete(t),g}},4967:(e,t,i)=>{var r="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=r},393:(e,t,i)=>{var r=i(8244),n=i(7979),s=i(1211);e.exports=function(e){return r(e,s,n)}},4700:(e,t,i)=>{var r=i(9067);e.exports=function(e,t){var i=e.__data__;return r(t)?i["string"==typeof t?"string":"hash"]:i.map}},4715:(e,t,i)=>{var r=i(9624),n=i(155);e.exports=function(e,t){var i=n(e,t);return r(i)?i:void 0}},8870:(e,t,i)=>{var r=i(5650),n=Object.prototype,s=n.hasOwnProperty,a=n.toString,o=r?r.toStringTag:void 0;e.exports=function(e){var t=s.call(e,o),i=e[o];try{e[o]=void 0;var r=!0}catch(e){}var n=a.call(e);return r&&(t?e[o]=i:delete e[o]),n}},7979:(e,t,i)=>{var r=i(9847),n=i(9306),s=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return s.call(e,t)})))}:n;e.exports=o},8486:(e,t,i)=>{var r=i(3103),n=i(9770),s=i(9413),a=i(4512),o=i(9270),l=i(7379),d=i(4066),c="[object Map]",u="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=d(r),v=d(n),m=d(s),b=d(a),y=d(o),w=l;(r&&w(new r(new ArrayBuffer(1)))!=f||n&&w(new n)!=c||s&&w(s.resolve())!=u||a&&w(new a)!=h||o&&w(new o)!=p)&&(w=function(e){var t=l(e),i="[object Object]"==t?e.constructor:void 0,r=i?d(i):"";if(r)switch(r){case g:return f;case v:return c;case m:return u;case b:return h;case y:return p}return t}),e.exports=w},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},3305:(e,t,i)=>{var r=i(4497);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},9361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1112:(e,t,i)=>{var r=i(4497),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return n.call(t,e)?t[e]:void 0}},5276:(e,t,i)=>{var r=i(4497),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:n.call(t,e)}},7452:(e,t,i)=>{var r=i(4497);e.exports=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},714:(e,t,i)=>{var r=i(5650),n=i(3283),s=i(3142),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return s(e)||n(e)||!!(a&&e&&e[a])}},9632:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,i){var r=typeof e;return!!(i=null==i?9007199254740991:i)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<i}},9067:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},4759:(e,t,i)=>{var r,n=i(1950),s=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!s&&s in e}},4882:e=>{var t=Object.prototype;e.exports=function(e){var i=e&&e.constructor;return e===("function"==typeof i&&i.prototype||t)}},2393:e=>{e.exports=function(){this.__data__=[],this.size=0}},2049:(e,t,i)=>{var r=i(7034),n=Array.prototype.splice;e.exports=function(e){var t=this.__data__,i=r(t,e);return!(i<0)&&(i==t.length-1?t.pop():n.call(t,i,1),--this.size,!0)}},7144:(e,t,i)=>{var r=i(7034);e.exports=function(e){var t=this.__data__,i=r(t,e);return i<0?void 0:t[i][1]}},5071:(e,t,i)=>{var r=i(7034);e.exports=function(e){return r(this.__data__,e)>-1}},3964:(e,t,i)=>{var r=i(7034);e.exports=function(e,t){var i=this.__data__,n=r(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this}},9753:(e,t,i)=>{var r=i(5098),n=i(1386),s=i(9770);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(s||n),string:new r}}},5681:(e,t,i)=>{var r=i(4700);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},88:(e,t,i)=>{var r=i(4700);e.exports=function(e){return r(this,e).get(e)}},4732:(e,t,i)=>{var r=i(4700);e.exports=function(e){return r(this,e).has(e)}},9068:(e,t,i)=>{var r=i(4700);e.exports=function(e,t){var i=r(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this}},5894:e=>{e.exports=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,r){i[++t]=[r,e]})),i}},4497:(e,t,i)=>{var r=i(4715)(Object,"create");e.exports=r},8121:(e,t,i)=>{var r=i(3766)(Object.keys,Object);e.exports=r},2306:(e,t,i)=>{e=i.nmd(e);var r=i(4967),n=t&&!t.nodeType&&t,s=n&&e&&!e.nodeType&&e,a=s&&s.exports===n&&r.process,o=function(){try{var e=s&&s.require&&s.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},3766:e=>{e.exports=function(e,t){return function(i){return e(t(i))}}},8942:(e,t,i)=>{var r=i(4967),n="object"==typeof self&&self&&self.Object===Object&&self,s=r||n||Function("return this")();e.exports=s},1877:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},8006:e=>{e.exports=function(e){return this.__data__.has(e)}},9828:e=>{e.exports=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}},4103:(e,t,i)=>{var r=i(1386);e.exports=function(){this.__data__=new r,this.size=0}},1779:e=>{e.exports=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}},4162:e=>{e.exports=function(e){return this.__data__.get(e)}},7462:e=>{e.exports=function(e){return this.__data__.has(e)}},6638:(e,t,i)=>{var r=i(1386),n=i(9770),s=i(8250);e.exports=function(e,t){var i=this.__data__;if(i instanceof r){var a=i.__data__;if(!n||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new s(a)}return i.set(e,t),this.size=i.size,this}},7706:e=>{e.exports=function(e,t,i){for(var r=i-1,n=e.length;++r<n;)if(e[r]===t)return r;return-1}},4066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2945:e=>{var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},4871:(e,t,i)=>{var r=i(1129),n=i(313),s=i(4354),a=i(3142);e.exports=function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),i=arguments[0],o=e;o--;)t[o-1]=arguments[o];return r(a(i)?s(i):[i],n(t,1))}},2784:(e,t,i)=>{var r=i(1580),n=i(4495),s=i(6131),a=Math.max,o=Math.min;e.exports=function(e,t,i){var l,d,c,u,h,p,f=0,g=!1,v=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var i=l,r=d;return l=d=void 0,f=t,u=e.apply(r,i)}function y(e){var i=e-p;return void 0===p||i>=t||i<0||v&&e-f>=c}function w(){var e=n();if(y(e))return S(e);h=setTimeout(w,function(e){var i=t-(e-p);return v?o(i,c-(e-f)):i}(e))}function S(e){return h=void 0,m&&l?b(e):(l=d=void 0,u)}function _(){var e=n(),i=y(e);if(l=arguments,d=this,p=e,i){if(void 0===h)return function(e){return f=e,h=setTimeout(w,t),g?b(e):u}(p);if(v)return clearTimeout(h),h=setTimeout(w,t),b(p)}return void 0===h&&(h=setTimeout(w,t)),u}return t=s(t)||0,r(i)&&(g=!!i.leading,c=(v="maxWait"in i)?a(s(i.maxWait)||0,t):c,m="trailing"in i?!!i.trailing:m),_.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=p=d=h=void 0},_.flush=function(){return void 0===h?u:S(n())},_}},6285:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3981:e=>{e.exports=function(e){return e&&e.length?e[0]:void 0}},3283:(e,t,i)=>{var r=i(6027),n=i(547),s=Object.prototype,a=s.hasOwnProperty,o=s.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return n(e)&&a.call(e,"callee")&&!o.call(e,"callee")};e.exports=l},3142:e=>{var t=Array.isArray;e.exports=t},6529:(e,t,i)=>{var r=i(3655),n=i(5387);e.exports=function(e){return null!=e&&n(e.length)&&!r(e)}},5853:(e,t,i)=>{e=i.nmd(e);var r=i(8942),n=i(4772),s=t&&!t.nodeType&&t,a=s&&e&&!e.nodeType&&e,o=a&&a.exports===s?r.Buffer:void 0,l=(o?o.isBuffer:void 0)||n;e.exports=l},3514:(e,t,i)=>{var r=i(195),n=i(8486),s=i(3283),a=i(3142),o=i(6529),l=i(5853),d=i(4882),c=i(8666),u=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(o(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||s(e)))return!e.length;var t=n(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(d(e))return!r(e).length;for(var i in e)if(u.call(e,i))return!1;return!0}},6343:(e,t,i)=>{var r=i(4687);e.exports=function(e,t){return r(e,t)}},3655:(e,t,i)=>{var r=i(7379),n=i(1580);e.exports=function(e){if(!n(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},5387:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},986:(e,t,i)=>{var r=i(7379),n=i(547);e.exports=function(e){return"number"==typeof e||n(e)&&"[object Number]"==r(e)}},1580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8138:(e,t,i)=>{var r=i(7379),n=i(3142),s=i(547);e.exports=function(e){return"string"==typeof e||!n(e)&&s(e)&&"[object String]"==r(e)}},1187:(e,t,i)=>{var r=i(7379),n=i(547);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==r(e)}},8666:(e,t,i)=>{var r=i(674),n=i(9460),s=i(2306),a=s&&s.isTypedArray,o=a?n(a):r;e.exports=o},1211:(e,t,i)=>{var r=i(358),n=i(195),s=i(6529);e.exports=function(e){return s(e)?r(e):n(e)}},9071:e=>{e.exports=function(){}},4495:(e,t,i)=>{var r=i(8942);e.exports=function(){return r.Date.now()}},9306:e=>{e.exports=function(){return[]}},4772:e=>{e.exports=function(){return!1}},6131:(e,t,i)=>{var r=i(6403),n=i(1580),s=i(1187),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,d=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(s(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var i=o.test(e);return i||l.test(e)?d(e.slice(2),i?2:8):a.test(e)?NaN:+e}},2438:(e,t,i)=>{var r=i(5630);e.exports=function(e){return e&&e.length?r(e):[]}},3335:(e,t,i)=>{"use strict";var r=i(9155),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,i){var r,s={},d=null,c=null;for(r in void 0!==i&&(d=""+i),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:n,type:e,key:d,ref:c,props:s,_owner:o.current}}t.Fragment=s,t.jsx=d,t.jsxs=d},1085:(e,t,i)=>{"use strict";e.exports=i(3335)},2591:(e,t,i)=>{"use strict";var r,n=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},s=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),a=[];function o(e){for(var t=-1,i=0;i<a.length;i++)if(a[i].identifier===e){t=i;break}return t}function l(e,t){for(var i={},r=[],n=0;n<e.length;n++){var s=e[n],l=t.base?s[0]+t.base:s[0],d=i[l]||0,c="".concat(l," ").concat(d);i[l]=d+1;var u=o(c),h={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(a[u].references++,a[u].updater(h)):a.push({identifier:c,updater:v(h,t),references:1}),r.push(c)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var n=i.nc;n&&(r.nonce=n)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=s(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var c,u=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,i,r){var n=i?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,n);else{var s=document.createTextNode(n),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(s,a[t]):e.appendChild(s)}}function p(e,t,i){var r=i.css,n=i.media,s=i.sourceMap;if(n?e.setAttribute("media",n):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,g=0;function v(e,t){var i,r,n;if(t.singleton){var s=g++;i=f||(f=d(t)),r=h.bind(null,i,s,!1),n=h.bind(null,i,s,!0)}else i=d(t),r=p.bind(null,i,t),n=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(i)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else n()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=n());var i=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<i.length;r++){var n=o(i[r]);a[n].references--}for(var s=l(e,t),d=0;d<i.length;d++){var c=o(i[d]);0===a[c].references&&(a[c].updater(),a.splice(c,1))}i=s}}}},6704:(e,t,i)=>{"use strict";const r=document.querySelector("[nonce]");r&&(i.nc=r.nonce||r.getAttribute("nonce")),window.litNonce=i.nc},3296:(e,t,i)=>{"use strict";var r=i(9155);var n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,a=r.useEffect,o=r.useLayoutEffect,l=r.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!n(e,i)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var i=t(),r=s({inst:{value:i,getSnapshot:t}}),n=r[0].inst,c=r[1];return o((function(){n.value=i,n.getSnapshot=t,d(n)&&c({inst:n})}),[e,i,t]),a((function(){return d(n)&&c({inst:n}),e((function(){d(n)&&c({inst:n})}))}),[e]),l(i),i};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},1435:(e,t,i)=>{"use strict";var r=i(9155),n=i(8139);var s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=n.useSyncExternalStore,o=r.useRef,l=r.useEffect,d=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,i,r,n){var u=o(null);if(null===u.current){var h={hasValue:!1,value:null};u.current=h}else h=u.current;u=d((function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==n&&h.hasValue){var t=h.value;if(n(t,e))return o=t}return o=e}if(t=o,s(a,e))return t;var i=r(e);return void 0!==n&&n(t,i)?(a=e,t):(a=e,o=i)}var a,o,l=!1,d=void 0===i?null:i;return[function(){return e(t())},null===d?void 0:function(){return e(d())}]}),[t,i,r,n]);var p=a(e,u[0],u[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),c(p),p}},8139:(e,t,i)=>{"use strict";e.exports=i(3296)},7121:(e,t,i)=>{"use strict";e.exports=i(1435)},5136:e=>{"use strict";e.exports=r},3107:e=>{"use strict";e.exports=s},6166:e=>{"use strict";e.exports=n},992:e=>{"use strict";e.exports=l},2840:t=>{"use strict";t.exports=e},7161:e=>{"use strict";e.exports=h},429:e=>{"use strict";e.exports=p},5125:e=>{"use strict";e.exports=v},318:e=>{"use strict";e.exports=g},6968:e=>{"use strict";e.exports=m},2083:e=>{"use strict";e.exports=f},5314:e=>{"use strict";e.exports=i},5299:e=>{"use strict";e.exports=d},9780:e=>{"use strict";e.exports=b},9155:e=>{"use strict";e.exports=a},9514:e=>{"use strict";e.exports=c},2236:e=>{"use strict";e.exports=o},2265:e=>{"use strict";e.exports=u},7315:e=>{"use strict";e.exports=t}},w={};function S(e){var t=w[e];if(void 0!==t)return t.exports;var i=w[e]={id:e,loaded:!1,exports:{}};return y[e].call(i.exports,i,i.exports,S),i.loaded=!0,i.exports}S.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return S.d(t,{a:t}),t},S.d=(e,t)=>{for(var i in t)S.o(t,i)&&!S.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),S.nc=void 0;var _={};return(()=>{"use strict";S.r(_),S.d(_,{AppearanceCommonOptionsDefault:()=>r,AppearanceManager:()=>lc,CTASource:()=>x,CloseButtonPosition:()=>e,GameReaderOptionsDefault:()=>n,GoodsWidgetOptionsDefault:()=>a,GoodsWidgetRenderingType:()=>s,IamCheckDisplayTimeRangeError:()=>Bl,IamFrequencyLimitError:()=>Dl,IamMessageLimitExceededError:()=>Nl,IamMessageOpenError:()=>bl,IamNotFoundByEventError:()=>Vd,IamNotFoundByIdError:()=>Ul,IamNotFoundLimitError:()=>Gl,IamOtherReaderIsOpenError:()=>Tl,IamShowOnlyIfLoadedError:()=>Rl,IasNetworkError:()=>Oe,InAppMessagingOptionsDefault:()=>j,InAppStoryManager:()=>gv,PlaceholderType:()=>R,STORY_FEED_LIST:()=>I,STORY_LIST_TYPE:()=>A,STORY_READER_WINDOW_REFERER:()=>L,SharePageEvents:()=>o,SharePanelDefault:()=>k,StoriesEvents:()=>T,StoriesListCardCoverQuality:()=>h,StoriesListCardTitlePosition:()=>u,StoriesListCardTitleTextAlign:()=>c,StoriesListCardViewVariant:()=>d,StoriesListDirection:()=>p,StoriesListEvents:()=>f,StoriesListOptionsDefault:()=>g,StoriesListSliderAlign:()=>l,StoryActionSource:()=>E,StoryFavoriteReaderOptionsDefault:()=>v,StoryManagerConfigDefault:()=>w,StoryReaderOptionsDefault:()=>M,StoryReaderSwipeStyle:()=>C,WidgetStoriesOptions:()=>P});var e,t=S(46),i=S.n(t);!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(e||(e={}));const r={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:e.END,loader:{default:{color:"white",accentColor:"transparent"},custom:null},closeButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M30 15.2115C30 23.4958 23.2843 30.2115 15 30.2115C6.71573 30.2115 0 23.4958 0 15.2115C0 6.92728 6.71573 0.211548 15 0.211548C23.2843 0.211548 30 6.92728 30 15.2115Z" fill="white"/>\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="#C2C2C4"/>\n</svg>'}},forceDesktopMode:void 0},n={borderRadius:5,loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:r.forceDesktopMode,forceCheckOrientation:!0};var s;!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(s||(s={}));const a={goodsWidgetRenderingType:s.DEFAULT,goodsList:{renderingType:s.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 o,l,d,c,u,h,p,f;!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(o||(o={})),function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(l||(l={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(d||(d={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(c||(c={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(u||(u={})),function(e){e.Medium="medium",e.High="high"}(h||(h={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(p||(p={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(f||(f={}));const g={direction:p.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:c.START,position:u.CARD_INSIDE_BOTTOM,display:!0,lineClamp:4},gap:10,height:178,aspectRatio:null,coverQuality:h.High,variant:d.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:c.START,position:u.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:h.High,coverLazyLoading:!1,variant:d.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:0,backgroundColor:"transparent",sliderAlign:l.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:c.START,position:u.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:h.High,coverLazyLoading:!1,variant:d.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"}},v={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};class m 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.`)}}const b="en-US";class y{constructor(e=b){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),i=this.validateTag(t);this.parseTag(i)}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 m(e).message),this.getNavigatorTag())}getNavigatorTag(){const e=navigator.language.toLowerCase();return this.isValidTag(e)?e:(console.error(`Invalid navigator language tag: ${e}`),b)}parseTag(e){const[t,i]=e.split("-");this.languageCode=t,this.countryCode=i.toUpperCase(),this.tag=`${this.languageCode}-${this.countryCode}`}}const w={apiKey:"",disableStatistic:!1,disableDeviceId:!1,lang:new y};var x;!function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader"}(x||(x={}));const O={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}`},k={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:O,twitter:O,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 C;!function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(C||(C={}));const M={gameReaderOptions:{loader:{default:{color:"white",accentColor:"transparent"},custom:null}},scrollStyle:C.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:k,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="32" height="32" 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="32" height="32" 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 P;!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"}(P||(P={}));const j={};var E,L,A,I,T,R;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(E||(E={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(L||(L={})),function(e){e[e.default=0]="default",e[e.onboarding=1]="onboarding",e[e.favorite=2]="favorite",e[e.direct=3]="direct"}(A||(A={})),function(e){e.list="list",e.favorite="favorite"}(I||(I={})),function(e){e.CLICK_ON_STORY="clickOnStoryLink"}(T||(T={})),function(e){e.TEXT="text",e.IMAGE="image"}(R||(R={}));var D=S(2840),B=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const N=(0,D.createStore)(w),F=(0,D.createEvent)();N.on(F,((e,t)=>{var{disableStatistic:i,disableDeviceId:r}=t,n=B(t,["disableStatistic","disableDeviceId"]);return Object.assign(Object.assign({disableStatistic:null!=i?i:e.disableStatistic,disableDeviceId:null!=r?r:e.disableDeviceId},n),{lang:new y(n.lang)})}));const W=(0,D.createEvent)();N.on(W,((e,{tags:t})=>Object.assign(Object.assign({},e),{tags:t})));const V=(0,D.createEvent)();N.on(V,((e,t)=>Object.assign(Object.assign({},e),t)));const z=(0,D.createEvent)();N.on(z,((e,{placeholders:t})=>Object.assign(Object.assign({},e),{placeholders:t})));const U=(0,D.createEvent)();N.on(U,((e,{imagePlaceholders:t})=>Object.assign(Object.assign({},e),{imagePlaceholders:t})));const G=(0,D.createEvent)();N.on(G,((e,{lang:t})=>Object.assign(Object.assign({},e),{lang:new y(t)})));const $=(0,D.createStore)(""),H=(0,D.createEvent)(),q=(0,D.createEvent)();N.reset(q),(0,D.sample)({clock:H,target:$});var Q=S(3655),K=S.n(Q),Y=S(7315);class Z{static createFunctionWithTimeout(e,t){let i=!1;function r(){i||(i=!0,e())}return setTimeout(r,t||1e3),r}static convertModelToFormData(e,t,i){t instanceof Object&&Object.keys(t).forEach((r=>{const n=t[r];if(n instanceof Object&&!Array.isArray(n))return this.convertModelToFormData(e,n,r);i&&(r=`${i}[${r}]`),Array.isArray(n)?n.forEach((t=>{e.append(`${r}[]`,t)})):e.append(r,n)}))}}const J=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)},X=()=>null!==S.nc&&void 0!==S.nc?S.nc:"";var ee=S(5314);function te(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 ee.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}}}var ie=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};function re(e,t){let i=null;return function(...t){return ie(this,void 0,void 0,(function*(){return i||(i=(()=>ie(this,void 0,void 0,(function*(){try{return yield e.apply(this,t)}catch(e){throw e}finally{i=null}})))(),i)}))}}const ne=({frames:e=3,timeout:t=100,checkStyle:i=(()=>!0)}={})=>new Promise((r=>{let n,s=0,a=!1;const o=()=>{s++,!a&&i()&&(a=!0),s>=e&&a?(clearTimeout(n),r()):requestAnimationFrame(o)};n=setTimeout((()=>r()),t),requestAnimationFrame(o)}));Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34});var se=S(8138),ae=S.n(se);!function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();var oe=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};let le=null;function de(){return oe(this,void 0,void 0,(function*(){return null!=le?le:new Promise((e=>{!function(e,t){const i=new Image;i.onload=function(){var r=i.width>0&&i.height>0;t(e,r)},i.onerror=function(){t(e,!1)},i.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"}[e]}("lossy",((t,i)=>{le=i,e(i)}))}))}))}function ce(){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:ue.LANDSCAPE_PRIMARY,"-90":ue.LANDSCAPE_SECONDARY,0:ue.PORTRAIT_PRIMARY,180:ue.PORTRAIT_SECONDARY};function t(){}var i=new t,r=function(e){for(var t=["orientationchange","mozorientationchange","msorientationchange"],i=window.screen,r=0;r<t.length;r++)if(null===i["on"+t[r]])return{delegate:i,event:t[r]};if(void 0!==window.onorientationchange)return{delegate:window,event:"orientationchange"};return{delegate:me(e),event:"change"}}(i);return t.prototype.addEventListener=he("addEventListener",r.delegate,r.event),t.prototype.dispatchEvent=he("dispatchEvent",r.delegate,r.event),t.prototype.removeEventListener=he("removeEventListener",r.delegate,r.event),t.prototype.lock=function(){var e,t="lockOrientation() is not available on this device.",i=window.screen;e=void 0===i?function(){return!1}:"function"==typeof i.msLockOrientation?i.msLockOrientation.bind(i):"function"==typeof i.mozLockOrientation?i.mozLockOrientation.bind(i):function(){return!1};return function(i){const r=window.Promise;return e(i)?r.resolve(i):r.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(i,{onchange:{get:function(){return r.delegate["on"+r.event]||null},set:function(e){r.delegate["on"+r.event]=ge(e,i)}},type:{get:function(){var t=window.screen;return t.msOrientation||t.mozOrientation||e[window.orientation+""]||(be().matches?"landscape-primary":"portrait-primary")}},angle:{value:0}}),i}(),e}}var ue;function he(e,t,i){var r=this;return function(){var n=Array.prototype.slice.call(arguments);if("change"===(n[0].type?n[0].type:n[0])){n[0].type?n[0]=ve(i,n[0]):n[0]=i;var s,a,o=ge(n[1],r);return"addEventListener"===e&&function(e,t){var i=fe.indexOf(e);i>-1?pe[i]=t:(fe.push(e),pe.push(t))}(n[1],o),"removeEventListener"===e&&(s=n[1],(a=fe.indexOf(s))>-1&&(fe.splice(a,1),pe.splice(a,1))),n[1]=o,t[e].apply(t,n)}}}!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(ue||(ue={}));var pe=[],fe=[];function ge(e,t){var i=fe.indexOf(e);return i>-1?pe[i]:function(i){i.target!==t&&ye(i,"target",t),i.currentTarget!==t&&ye(i,"currentTarget",t),"change"!==i.type&&ye(i,"type","change"),e(i)}}function ve(e,t){var i;try{i=new Event(e,t)}catch(e){i={type:"change"}}return i}function me(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 i=this.listeners[e].indexOf(t);i>-1&&this.listeners[e].splice(i,1)}}});t.listeners={};var i=be();return i&&"boolean"==typeof i.matches&&i.addListener((function(){t.dispatchEvent(ve("change"))})),t}function be(){return"function"!=typeof window.matchMedia?{}:window.matchMedia("(orientation: landscape)")}function ye(e,t,i){Object.defineProperty(e,t,{value:i})}const we=e=>null==e;function Se(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function _e(e,t){return Object.assign(Object.assign({},e),t)}function xe(e){return e.replace(/^\//,"")}class Oe extends Error{constructor(e,t,i){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!=i?i:null,console.error({name,networkStatus:e,networkMessage:t,response:i})}static createByRequestError(e){return new Oe(null,JSON.stringify(e.data),e)}static createByFetchError(e){const t=window.navigator&&window.navigator.onLine;return new Oe(null,t?e.message:"net::ERR_INTERNET_DISCONNECTED")}}const ke={baseUrl:"https://cdn.inappstory.ru",apiUrl:"https://api.inappstory.ru",faviconApiUrl:"https://favicon.inappstory.ru"};function Ce(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,i){return void 0===t?e:t.length>=e.length?t:i?(e+t).slice(-e.length):(t+e).substring(0,e.length)}(new Array(t%4).fill("=").join(""),e,!1),window.atob(e)}(e),i=t.charCodeAt(13);if(i>0){let e=t.substr(14,i);e=e.replace(/\0+$/,"");const r="{QQN{xuV?1Dv16j3";let n=r,s=0;for(;n.length<i;)n+=r[s],s++,s===r.length&&(s=0);let a="";for(let t=0;t<i;t++)a+=String.fromCharCode(e.charCodeAt(t)^n.charCodeAt(t));return new URL(`https://${a}`).host}}catch(e){console.error(e)}return null}function Me(e){const t=Ce(e);if(null!=t){const e=t.split(".").slice(1);ke.baseUrl=`https://${["cdn",...e].join(".")}`,ke.faviconApiUrl=`https://${["favicon",...e].join(".")}`,ke.apiUrl=`https://${t}`}}var Pe=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const je=`InAppStoryWebSDK/${parseInt(30200)} ${(e=>{let t="";for(let i=0;i<e.length;i++){t+=e.charCodeAt(i)<=255?e[i]:"?"}return t})(navigator.userAgent)}`;const Ee=new class{constructor(){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)}}}})}set deviceInfoPromise(e){this._deviceInfoPromise=e}set baseHeaders(e){this._baseHeaders=e}get baseURL(){return`${ke.apiUrl}/v2/`}request(e){return Pe(this,void 0,void 0,(function*(){return new Promise(((t,i)=>{const r=()=>Pe(this,void 0,void 0,(function*(){try{if(Se(e.headers)&&null!=e.headers||(e.headers={}),e.headers=_e(this._baseHeaders,e.headers),this.requestInterceptors.length)for(const t of this.requestInterceptors)t(e);let r="";!we(e.params)&&Se(e.params)&&(r=new URLSearchParams(Object.entries(e.params)).toString());let n=new URL(`${xe(e.url)}${r?"?"+r:""}`,this.baseURL),s="get";we(e.method)||(s=e.method);let a={};!we(e.headers)&&Se(e.headers)&&(a=e.headers);let o=null;!we(e.data)&&Se(e.data)&&(o=JSON.stringify(e.data),a["Content-Type"]="application/json");try{if(Jd.getInstance().sdkConfigIsIncorrect)return void i(Oe.createByRequestError({data:{name:"SDK config is incorrect",message:Jd.getInstance().sdkConfigErrorsAsArray.join(". "),status:400},headersRaw:{},headers:{},status:400,statusText:"SDK config is incorrect",ok:!1}))}catch(e){console.error(e)}const l=yield fetch(n.toString(),{method:s,body:o,headers:a,credentials:"omit"}),d={data:yield l.json(),headersRaw:l.headers,headers:Object.fromEntries([...l.headers]),status:l.status,statusText:l.statusText,ok:l.ok};if(!l.ok)return void i(Oe.createByRequestError(d));t(d)}catch(e){i(Oe.createByFetchError(e))}}));this._deviceInfoPromise?this._deviceInfoPromise.finally(r):r()}))}))}post(e,t){return Pe(this,arguments,void 0,(function*(e,t,i={}){return this.request({method:"post",url:e,data:t,params:i})}))}get(e){return Pe(this,arguments,void 0,(function*(e,t={}){return this.request({method:"get",url:e,params:t})}))}};function Le(e,t,i){var r,n,s;if("sendBeacon"in navigator){const a=new URLSearchParams({access_token:N.getState().apiKey,session_id:null===(n=null===(r=Ie.getState())||void 0===r?void 0:r.session)||void 0===n?void 0:n.id,x_user_agent:je}),o=N.getState();null!=o.appPackageId&&a.append("x_app_package_id",o.appPackageId);const l=`${s=Ee.baseURL,s.replace(/\/$/,"")}/${xe(e)}?${a.toString()}`,d=new FormData;Object.keys(t).forEach((e=>{Z.convertModelToFormData(d,t[e],e)}));let c=!1;null!=Array.from&&null!=d.keys&&(c=0===Array.from(d.keys()).length),c||navigator.sendBeacon(l,d),i()}else Ee.post(e,t).then((()=>i()),(()=>i()))}Ee.interceptors.request.use((e=>{var t,i,r;const n=N.getState();return e.headers=_e(null!==(t=e.headers)&&void 0!==t?t:{},{Authorization:`Bearer ${n.apiKey}`,"Accept-Language":n.lang.toString(),"Auth-Session-Id":null===(r=null===(i=Ie.getState())||void 0===i?void 0:i.session)||void 0===r?void 0:r.id,"X-User-Id":n.userId?n.userId:"","X-Request-Id":(0,Y.v4)(),"X-User-Agent":je}),null!=n.appPackageId&&(e.headers["X-App-Package-Id"]=n.appPackageId),n.disableDeviceId||(e.headers["X-Device-Id"]=$.getState()),e}));const Ae=Ee,Ie=(0,D.createStore)({session:{id:"",expire_in:0},server_timestamp:0,content_base_url:"",user_key:"",share:!1,is_allow_profiling:!1,cache:[],placeholders:[],image_placeholders:[],editor:null,storyWidgetsResources:[],is_allow_ugc:!1}),Te=(0,D.createEffect)(),Re=(0,D.createEffect)(),De=(0,D.createEvent)(),Be=(0,D.createEvent)();Ie.on(Be,(e=>{const t=Object.assign({},e);return t.session.id="",t}));const Ne=Ie.map((e=>e.user_key||"default")),Fe=(0,D.createEffect)((e=>{Le("session/update",e,(()=>{}))})).prepend((e=>({data:[[5,0,...e]]})));Ie.map((e=>e.storyWidgetsResources));var We;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.UGC=1]="UGC"}(We||(We={}));const Ve=e=>({id:e,type:We.DEFAULT,title:null,title_color:null,background:{},background_color:null,image:null,display_to:null,display_from:null,favorite:null,like:null,deeplink:null,hide_in_reader:null,hide_timeline:!1,disable_close:null,like_functional:null,favorite_functional:null,share_functional:null,is_opened:null,tags:[],has_audio:null,video_cover:null,need_placeholders:null,has_swipe_up:null,game_instance:{id:null},share_url:null,slidesLoaded:!1,error:null,slides_count:0,slides:[]}),ze=(0,D.createStore)({}),Ue=(0,D.createStore)({default:[]}),Ge=Ue.map((e=>e[Ie.getState().user_key||"default"]||[]));var $e;!function(e){e.FEEDS="feeds",e.FAVORITE="favorite"}($e||($e={}));const He=(0,D.createStore)({default:{[$e.FEEDS]:{},[$e.FAVORITE]:[]}}),qe=He.map((e=>e[Ie.getState().user_key||"default"]||{})),Qe=(0,D.createStore)({}),Ke=(0,D.createStore)({}),Ye=(0,D.createStore)([]),Ze=(e,t)=>e.map((e=>t.find((t=>t.id===e)))).filter((e=>!!e));Qe.on([qe,Ge],((e,t)=>{const i=qe.getState(),r=Ge.getState();return((e,t)=>{const i={};for(const[r,n]of Object.entries(e))i[r]=Ze(n,t);return i})(i[$e.FEEDS],r)})),Ke.on([qe,Ge],((e,t)=>{const i=qe.getState(),r={};for(const e in i[$e.FEEDS])if("onboarding_"===e.substring(0,11)){const t=e.substring(11);if(r[t]=[],i[$e.FEEDS][e]&&Array.isArray(i[$e.FEEDS][e])){const n={};Ge.getState().filter((e=>!e.is_opened)).forEach((e=>{n[e.id]=e})),r[t]=i[$e.FEEDS][e].filter((e=>n[e])).map((e=>n[e]))}}return r})),Ye.on([qe,Ge],((e,t)=>{var i;const r=null!==(i=qe.getState()[$e.FAVORITE])&&void 0!==i?i:[],n={};return Ge.getState().forEach((e=>{n[e.id]=e})),r.map((e=>n[e]))}));const Je=(e,t="")=>e.is_opened,{storyItemFavoriteChanged:Xe,storyItemLikeChanged:et,storyItemIsOpenedChanged:tt}=(Ge.map((e=>{const t={};return t[We.DEFAULT]=e.filter((e=>!e.slidesLoaded&&e.type===We.DEFAULT)).map((e=>e.id)),t[We.UGC]=e.filter((e=>!e.slidesLoaded&&e.type===We.UGC)).map((e=>e.id)),t})),Object.prototype.hasOwnProperty,(0,D.createApi)(Ue,{storyItemFavoriteChanged:(e,{id:t,favorite:i})=>{const r=Ie.getState().user_key||"default",n=(e[r]||[]).slice(0),s=n.find((e=>e.id===t));return void 0!==s&&(s.favorite=i),Object.assign(Object.assign({},e),{[r]:n})},storyItemLikeChanged:(e,{id:t,like:i})=>{const r=Ie.getState().user_key||"default",n=(e[r]||[]).slice(0),s=n.find((e=>e.id===t));return void 0!==s&&(s.like=i),Object.assign(Object.assign({},e),{[r]:n})},storyItemIsOpenedChanged:(e,{id:t})=>{const i=Ie.getState().user_key||"default",r=(e[i]||[]).slice(0),n=r.find((e=>e.id===t));return void 0!==n&&(n.is_opened=!0),Object.assign(Object.assign({},e),{[i]:r})}}));class it extends t.EventEmitter{}var rt=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class nt{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)}wait(e){return rt(this,arguments,void 0,(function*(e,t=5e3){const i=this.viewModels.get(e);if(i)return i;if(this.viewModelWaiters.has(e))return this.viewModelWaiters.get(e).promise;let r,n;const s=new Promise(((e,t)=>{r=e,n=t})),a=setTimeout((()=>{this.viewModelWaiters.delete(e),n(new Error(`[IAS]: Timeout waiting for ViewModel with key "${e}". You must mount <IASContainer>.`))}),t);return this.viewModelWaiters.set(e,{resolve:r,reject:n,timerId:a,promise:s}),s}))}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 i=this.viewModelWaiters.get(e);i&&(clearTimeout(i.timerId),i.resolve(t),this.viewModelWaiters.delete(e))}rejectWaiters(e){const t=this.viewModelWaiters.get(e);t&&(clearTimeout(t.timerId),t.reject(new Error(`[IAS]: ViewModel with key "${e}" was deleted before resolving.`)),this.viewModelWaiters.delete(e))}}class st{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()}}var at=S(5136),ot=S(1580),lt=S.n(ot);let dt;dt=function(){};let ct=!0;function ut(e){dt(e),ct=e}function ht(){return dt(ct),ct}class pt{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){var t;e.dataForSending=ht()?{data:this.statisticsService.getData()}:null;const i=()=>this.storyManager.clickOnButtonAction({src:x.STORY_READER,payload:e});!(null===(t=this.storyManager.getConfig())||void 0===t?void 0:t.disableStatistic)&&e.dataForSending&&lt()(e.dataForSending)&&Array.isArray(e.dataForSending.data)&&e.dataForSending.data.length>0?(this.statisticsService.cleanupData(),Le("session/update",e.dataForSending,i)):i()}}var ft=S(3142),gt=S.n(ft);const vt=(0,D.createStore)({default:{},user:{}}),{sdkImagePlaceholdersChanged:mt,addDefaultImagePlaceholders:bt}=(0,D.createApi)(vt,{sdkImagePlaceholdersChanged:(e,t)=>({default:e.default,user:t}),addDefaultImagePlaceholders:(e,t)=>{let i={default:{},user:e.user};return gt()(t)&&t.forEach((e=>{lt()(e)&&void 0!==e.name&&void 0!==e.default_value&&(i.default[e.name]=e.default_value)})),i}}),yt=(0,D.createStore)({default:{},user:{}}),{sdkPlaceholdersChanged:wt,addDefaultPlaceholders:St}=(0,D.createApi)(yt,{sdkPlaceholdersChanged:(e,t)=>({default:e.default,user:t}),addDefaultPlaceholders:(e,t)=>{let i={default:{},user:e.user};return gt()(t)&&t.forEach((e=>{lt()(e)&&void 0!==e.name&&void 0!==e.default_value&&(i.default[e.name]=e.default_value)})),i}}),_t=Object.prototype.hasOwnProperty,xt=()=>{const e=yt.getState(),t=vt.getState(),i=[],r={};for(let t in e.default)_t.call(e.default,t)&&(r[t]={type:R.TEXT,name:t,value:e.default[t]});for(let t in e.user)_t.call(e.user,t)&&(r[t]={type:R.TEXT,name:t,value:e.user[t]});for(let e in r)_t.call(r,e)&&i.push(r[e]);const n={};for(let e in t.default)_t.call(t.default,e)&&(n[e]={type:R.IMAGE,name:e,value:t.default[e]});for(let e in t.user)_t.call(t.user,e)&&(n[e]={type:R.IMAGE,name:e,value:t.user[e]});for(let e in n)_t.call(n,e)&&i.push(n[e]);return i},Ot=(0,D.createStore)({style:"",widgetsData:{}}),kt=(0,D.combine)([Ne,Ot]).map((([e,t])=>{var i;return{style:t.style,widgetsData:null!==(i=t.widgetsData[e])&&void 0!==i?i:{}}})),Ct=(0,D.createEffect)(),Mt=(0,D.createEffect)(),Pt=(0,D.createEvent)(),jt=(e,t)=>{let i=[];switch(e){case A.default:i=t?Qe.getState()[t]:[];break;case A.favorite:i=Ye.getState();break;case A.onboarding:i=t?Ke.getState()[t]:[];break;case A.direct:i=Ge.getState()}return null!=i?i:[]},Et="{{__ugc__}}",Lt=e=>e===Et?We.UGC:We.DEFAULT,At=e=>({windowReferer:L.default,listType:A.direct,id:e.id,storyContext:kt.getState(),storyList:[e],hasShare:Ie.getState().share,placeholders:xt()}),It=e=>"{{__ugc__}}"===e?We.UGC:We.DEFAULT;class Tt{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}handle(e,t,i){var r,n;const s=i.listType,a=null!==(r=i.feedSlug)&&void 0!==r?r:"",o=i.filter,l=It(a),d={title:null,tags:[],slidesCount:null,feed:null,filter:null,source:null},c=Ge.getState().find((e=>e.id===t.id));if(c&&(d.title=c.stat_title,d.tags=c.tags,d.slidesCount=c.slides_count,c.type===We.UGC&&(d.ugcPayload=lt()(c.payload)?c.payload:{})),l===We.DEFAULT?d.feed=a:l===We.UGC&&(d.filter=o),s===A.direct?d.source=E.direct:s===A.default?d.source=E.list:s===A.onboarding?d.source=E.onboarding:s===A.favorite&&(d.source=E.favorite),null!=t.index&&-1===["clickOnStory","showStory"].indexOf(e)){t.payload=null;const e=null===(n=null==c?void 0:c.slides[t.index])||void 0===n?void 0:n.event_payload;(null==e?void 0:e.payload)&&(t.payload=e.payload)}this.storyManager.emit(e,Object.assign(Object.assign({},t),d))}}class Rt{constructor(){Object.defineProperty(this,"rawData",{enumerable:!0,configurable:!0,writable:!0,value:{}})}singleModelWrapper(){return""}attributes(){return[]}setAttributes(e){const t=this.attributes();let i=this;for(let r in e){let n=e[r];-1!==t.indexOf(r)&&(i[r]=n)}}static createInstance(e,t){const i=new e;let r=t;return""!==i.singleModelWrapper()&&void 0!==t[i.singleModelWrapper()]&&(r=t[i.singleModelWrapper()]),i.rawData=t,i.setAttributes(r),i}}var Dt=S(4871),Bt=S.n(Dt);function Nt(e,t,i){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>i))}class Ft extends Rt{attributes(){return["width","height","type","url"]}constructor(){super(),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:""})}set url(e){this._url=e}get url(){let e=window.isSecureContext;return void 0===e&&"https:"===window.location.protocol&&(e=!0),e?this._url:this._url.replace(/^https:\/\//,"http://")}}var Wt=S(3981),Vt=S.n(Wt);class zt{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 createFromArray(e){const t=new zt;for(let i in e)e.hasOwnProperty(i)&&t.images.push(Ft.createInstance(Ft,e[i]));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 i;let r=null;return this.images.forEach((t=>{t.width===e&&(r=t)})),null!==r?r:(r=null!==(i=Vt()(this.images))&&void 0!==i?i:null,t&&null!=r?r:null)}mapCoverQualityToImageType(e){switch(e){case h.Medium:return"m";case h.High:return"h"}}}class Ut extends Rt{constructor(){super(...arguments),Object.defineProperty(this,"_title",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"title_color",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"magazine_name",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"is_opened",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"background_color",{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,"slides_count",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"source",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"favorite",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"like",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"deeplink",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hide_in_reader",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"blank",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"disable_close",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"share_url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"like_functional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"favorite_functional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"share_functional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"need_placeholders",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"game_instance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hide_timeline",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"has_audio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"has_placeholder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"has_swipe_up",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_placeholders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"favorite_cell",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ugc_card_cell",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"slidesLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:null}),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,"_video_cover",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_videoCoverSrc",{enumerable:!0,configurable:!0,writable:!0,value:null})}attributes(){return Bt()(super.attributes(),["title","title_color","source","magazine_name","background","background_color","id","blank","image","display_to","display_from","favorite","like","deeplink","hide_in_reader","hide_timeline","disable_close","like_functional","favorite_functional","share_functional","is_opened","tags","has_audio","has_placeholder","video_cover","need_placeholders","has_swipe_up","share_url","game_instance","slides","slides_count","slidesLoaded","error","blank"])}set image(e){this._image=zt.createFromArray(e)}get image(){return this._image}imagePerSlide(e){var t,i;return this.parseHtmlSlidesForMainImage(),null!==(i=null===(t=this._parsedSlideImage)||void 0===t?void 0:t[e])&&void 0!==i?i:null}parseHtmlSlidesForMainImage(){!this._parsedSlideImage&&this.slides_count&&(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]}set video_cover(e){null!==e&&(this._video_cover=zt.createFromArray(e))}get video_cover(){return this._video_cover}get videoCoverSrc(){if(!1===this._videoCoverSrc)return null;if(null===this._videoCoverSrc){const e=this.video_cover;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}get title(){return this._title}set title(e){if(!0===this.need_placeholders||!0===this.rawData.need_placeholders)for(let t in Ut.placeholders)Ut.placeholders.hasOwnProperty(t)&&(e=Nt(e,`%${t}%`,Ut.placeholders[t]));this.rawData.title=e,this._title=e}get slides(){return this._slides}set slides(e){var t;for(const i of e)i.html=Nt(i.html,"{{nonce}}",null!==(t=X())&&void 0!==t?t:"");this._slides=e}get isOpened(){return this.is_opened}set isOpened(e){this.is_opened=e,this.rawData.is_opened=e}}Object.defineProperty(Ut,"placeholders",{enumerable:!0,configurable:!0,writable:!0,value:{}});const Gt=Ut,$t=S(4871);class Ht extends Rt{constructor(){super(...arguments),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"widgetsData",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attributes(){return $t(super.attributes(),["style","widgetsData"])}}const qt=new t.EventEmitter;qt.setMaxListeners(50);const Qt=(0,D.createStore)({uiPaused:!1,timerPaused:!1,locked:!1,closeGestureInAction:!1}),Kt=Qt.map((e=>e.uiPaused)),Yt=Qt.map((e=>e.timerPaused)),Zt=(0,D.createStore)(!1),Jt=(0,D.createStore)(!0),Xt=(0,D.createEvent)(),ei=(0,D.createEvent)(),ti=(0,D.createEvent)(),ii=(0,D.createEvent)(),ri=(0,D.createEvent)(),ni=(0,D.createEvent)(),si=(0,D.createEvent)(),ai=(0,D.createEvent)(),oi=(0,D.createEvent)(),li=(0,D.createEvent)(),di=(0,D.createEvent)(),ci=(0,D.createEvent)(),ui=e=>(0,D.sample)({source:Qt,clock:e,filter:e=>!e.locked}),hi=ui(ri),pi=ui(ni),fi=ui(si),gi=ui(ai);Qt.on(fi,(e=>Object.assign(Object.assign({},e),{uiPaused:!0,timerPaused:!0}))).on(gi,(e=>Object.assign(Object.assign({},e),{uiPaused:!1,timerPaused:!1}))).on(hi,(e=>e.timerPaused?e:Object.assign(Object.assign({},e),{timerPaused:!0}))).on(pi,(e=>e.timerPaused?Object.assign(Object.assign({},e),{timerPaused:!1}):e)).on(oi,(e=>Object.assign(Object.assign({},e),{uiPaused:!0,timerPaused:!0,locked:!0}))).on(li,(e=>Object.assign(Object.assign({},e),{uiPaused:!1,timerPaused:!1,locked:!1}))).on(di,(e=>Object.assign(Object.assign({},e),{timerPaused:!0,locked:!0}))).on(ci,(e=>Object.assign(Object.assign({},e),{timerPaused:!1,locked:!1}))),Zt.on(Xt,(e=>!0)).on(ei,(e=>!1)),Jt.on(ti,(()=>!0)).on(ii,(()=>!1));class vi{constructor(e){this.init(e)}init(e){const t="stories-slider-style";let i=document.getElementById(t),r="";null!==e&&(r=null!=e?e:""),null===i?(i=document.createElement("style"),i.type="text/css",i.id=t,i.attributes.setNamedItem(document.createAttribute("scoped")),i.setAttribute("nonce",X()),i.styleSheet?i.styleSheet.cssText=r:i.appendChild(document.createTextNode(r)),document.head.appendChild(i)):i.styleSheet?i.styleSheet.cssText=r:(i.textContent="",i.appendChild(document.createTextNode(r)))}}class mi{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 bi{constructor(){Object.defineProperty(this,"actions",{enumerable:!0,configurable:!0,writable:!0,value:[]})}push(e){this.actions.push(e)}exec(){for(const e of this.actions)e()}flush(){this.actions=[]}}var yi=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class wi{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)}flush(){return yi(this,void 0,void 0,(function*(){dt(`[${Mi.name}]: flush statistics by timer`);this.statisticsService.getData().length>0?this.schedule(1e4):this.schedule(3e4),yield this.statisticsService.sendData()}))}schedule(e){dt(`[${Mi.name}]: schedule flush statistics on ${e}ms`),this.timerId=setTimeout((()=>this.flush()),e)}}class Si{constructor(){Object.defineProperty(this,"slideStartedAt",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}calculate(){const e=Date.now(),t=e-this.slideStartedAt;return this.slideStartedAt=e,t}init(){this.slideStartedAt=Date.now()}}class _i{constructor(e){Object.defineProperty(this,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.handle=this.handle.bind(this),qt.on(ki.CloseStoryReader,this.handle)}handle(e){this.statisticsService.addSlideEvent({action:1,storyId:e.storyId,slideIndex:e.slideIndex})}destroy(){qt.off(ki.CloseStoryReader,this.handle)}}class xi{constructor(e){Object.defineProperty(this,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.handle=this.handle.bind(this),qt.on(ki.NextSlide,this.handle)}handle(e){this.statisticsService.addSlideEvent({action:1,storyId:e.fromStoryId,slideIndex:e.fromSlideIndex})}destroy(){qt.off(ki.NextSlide,this.handle)}}class Oi{constructor(e){Object.defineProperty(this,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.handle=this.handle.bind(this),qt.on(ki.TransitionFromSlide,this.handle)}handle(e){this.statisticsService.addSlideEvent({action:2,storyId:e.storyId,slideIndex:e.slideIndex})}destroy(){qt.off(ki.TransitionFromSlide,this.handle)}}var ki,Ci=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};!function(e){e.CloseStoryReader="statistics.closeStoryReader",e.NextSlide="statistics.nextSlide",e.TransitionFromSlide="statistics.transitionFromSlide"}(ki||(ki={}));class Mi extends(i()){constructor(e){super(),Object.defineProperty(this,"beaconService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"lastIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"data",{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,"events",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.flushSheduler=new wi(this),this.slideDurationCalculator=new Si}init(e){this.data=[],this.sourceInfo=e,this.lastIndex=0,this.slideDurationCalculator.init(),this.flushSheduler.start(),this.events=[new _i(this),new xi(this),new Oi(this)]}getData(){return this.data.slice()}getLastIndex(){return this.lastIndex}cleanupData(){this.data=[]}addSlideEvent(e){if(!ht())return;const t=this.slideDurationCalculator.calculate();this.data.push([e.action,this.lastIndex,e.storyId,e.slideIndex,t]),this.lastIndex++}sendData(){return Ci(this,void 0,void 0,(function*(){const e=this.getData();if(e.length)try{if(!this.sourceInfo)throw new Error(`[${Mi.name}]: You need pass source info!`);this.cleanupData(),yield this.beaconService.updateStatistics({updateDto:{data:e},listType:Lt(this.sourceInfo.feedSlug)})}catch(t){this.data.push(...e),console.error(t)}}))}destroy(){return Ci(this,void 0,void 0,(function*(){this.events.forEach((e=>e.destroy())),this.flushSheduler.stop(),yield this.sendData()}))}}var Pi=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class ji{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}updateStatistics(e){return Pi(this,arguments,void 0,(function*({listType:e,updateDto:t}){var i;if(0===t.data.length)return t;let r=!1,n="";if(e===We.UGC||(null===(i=this.storyManager.getConfig())||void 0===i?void 0:i.disableStatistic))r=!0;else try{Le("session/update",t,(()=>{})),r=!0}catch(e){n=e.toString()}if(r)return t;throw n}))}}var Ei=S(6166),Li=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Ai{constructor(e,t,i){Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"deferredActionsQueue",{enumerable:!0,configurable:!0,writable:!0,value:new bi}),Object.defineProperty(this,"activeStoryNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new mi}),Object.defineProperty(this,"initHookStorySlide",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"activeStorySlide",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new Ei.Mutex}),Object.defineProperty(this,"mutexRelease",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}})}setInitHookStorySlide(e){this.initHookStorySlide=e}lock(e){return Li(this,void 0,void 0,(function*(){if(this.activeStorySlide!==e){if(this.mutexRelease=yield this.mutex.acquire(),this.activeStorySlide&&this.activeStorySlide!==e)throw new Error(`[SlideApi]: The resource is locked by story with ID ${this.activeStorySlide.story.id} and slide index ${this.activeStorySlide.index}`);this.activeStorySlide=e}else console.warn(`[SlideApi]: Slide ${e.story.id}:${e.index} already owns the lock.`)}))}unlock(e){this.activeStorySlide===e?(this.mutexRelease(),this.activeStorySlide=null):console.warn("[SlideApi]: Attempted to unlock a slide that doesn't own the lock.")}exec(){this.activeStorySlide&&(this.deferredActionsQueue.exec(),this.deferredActionsQueue.flush())}getCardLocalData(){return Li(this,void 0,void 0,(function*(){if(!this.activeStory)return{};let e=this.narrativeDataCache.get(`narrative_${this.activeStory.id}_data_${Ne.getState()}`);return e?JSON.parse(e):{}}))}setCardLocalData(e,t){if(!this.activeStory)return;let i=JSON.stringify(e);this.narrativeDataCache.set(`narrative_${this.activeStory.id}_data_${Ne.getState()}`,i),t&&ht()&&Ae.request({url:"story-data/"+this.activeStory.id,method:"put",data:{data:i}}).catch(console.error)}getCardServerData(e){var t,i;return null!==(i=null===(t=this.storyReaderViewModel.widgetsData._narrative_saved_data)||void 0===t?void 0:t[e])&&void 0!==i?i:null}updateCardServerData(e,t){this.storyReaderViewModel.widgetsData._narrative_saved_data||(this.storyReaderViewModel.widgetsData._narrative_saved_data={}),this.storyReaderViewModel.widgetsData._narrative_saved_data[e]=t,Pt(this.storyReaderViewModel.widgetsData._narrative_saved_data)}getSlideDuration(e,t){var i,r,n;return null!==(n=null===(r=null===(i=this.storyReaderViewModel.widgetsData._narrative_slides_duration)||void 0===i?void 0:i[e])||void 0===r?void 0:r[t])&&void 0!==n?n:null}pauseUI(){si()}resumeUI(){ai()}showCardTextInput(e,t){qt.emit(Ra.ShowInputModal,{id:e,config:t})}setCardSessionValue(e,t){this.activeStoryNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.activeStoryNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){var i,r,n;const s=this.storyReaderViewModel.widgetsData;switch(t){case"rangeSlider":return null===(i=s._narrative_range_slider_data)||void 0===i?void 0:i[e];case"poll":return null===(r=s._narrative_poll_data)||void 0===r?void 0:r[e];case"vote":return null===(n=s._narrative_vote_data)||void 0===n?void 0:n[e]}return null}openUrl(e){this.activeStory&&(this.activeStory.markAsOpened(),qt.emit(ki.TransitionFromSlide,{storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),window.open(e,"_parent"))}sendApiRequest(e,t,i,r,n,s){return Li(this,void 0,void 0,(function*(){var s,a,o;try{const s=yield Ae.request({url:e,method:t,params:null!=i?i:{},headers:null!=r?r:{},data:null!=n?n:{}});return{status:s.status,headers:s.headers,data:s.data}}catch(e){if(e instanceof Oe)return{status:null!==(s=e.networkStatus)&&void 0!==s?s:400,headers:null===(a=e.response)||void 0===a?void 0:a.headers,data:null===(o=e.response)||void 0===o?void 0:o.data}}}))}share(e,t){null==e&&(e="story-share"),this.storyReaderViewModel.sharePanel.shareText({shareId:e,config:t,storySlide:this.activeStorySlide})}shareSlideScreenshot(e,t,i){null==e&&(e="slide-screenshot-share"),this.storyReaderViewModel.sharePanel.shareScreenShot({shareId:e,hideElementsSelector:null!=t?t:"",shareText:i,storySlide:this.activeStorySlide})}showLayer(e){var t;null===(t=this.initHookStorySlide)||void 0===t||t.showLayerByIndex(e)}showCardSlide(e){this.pushToDefferedActionsQueueOrExec((()=>{var t;null===(t=this.activeStory)||void 0===t||t.redirectToSlide({slideIndex:e})}))}cardShowNext(){qt.emit(`${_o.id}.showNextStory`)}showNextSlide(e){this.pushToDefferedActionsQueueOrExec((()=>{e?this.activeStory.timer.start(e):this.activeStory.nextSlide()}))}sendStatisticEvent(e,t,i){this.storyManager.emit("widgetEvent",{name:e,data:Object.assign(Object.assign({},i),{feed:this.storyReaderViewModel.feedSlug})})}destroy(){}setActiveStory(e){this.activeStoryNarrativeDataCache.clear(),this.activeStory=e,this.activeStorySlide&&this.unlock(this.activeStorySlide)}resetStory(e){return Li(this,void 0,void 0,(function*(){var t,i;let r={},n=yield this.getCardLocalData();n=Object.assign({},null!==(t=this.getCardServerData(e))&&void 0!==t?t:{},n);for(let e in n)n.hasOwnProperty(e)&&/^_gm_[A-z0-9-_]+_attempts$/.test(e)&&(r[e]=n[e]);null===(i=this.activeStorySlide)||void 0===i||i.refreshWidgetsData(),this.updateCardServerData(e,r),this.setCardLocalData(r,!0),this.showCardSlide(0),this.showLayer(0)}))}pushToDefferedActionsQueueOrExec(e){this.activeStorySlide?e():this.deferredActionsQueue.push(e)}getCardFonts(){const e=Ie.getState().cache;return null!=e&&Array.isArray(e)?Ie.getState().cache.filter((e=>"font-face"===e.type)):[]}updateTimeline(e,t,i,r,n,s){}showToast(e){var t;null===(t=this.activeStorySlide)||void 0===t||t.showToast({content:e})}}const Ii=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();function Ti(e){let t=null;if(Ii){let i=window.localStorage.getItem(e);null!==i&&ae()(i)&&i.trim().length>0&&(t=JSON.parse(i))}return t}function Ri(e,t){Ii&&window.localStorage.setItem(e,JSON.stringify(t))}var Di=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Bi=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Ni=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const Fi=new((()=>{var e;let t,i=[];return e=class{openSession(e){return Ni(this,void 0,void 0,(function*(){var t;return(yield Ae.post(e.url,null!==(t=e.data)&&void 0!==t?t:{},e.params)).data}))}constructor(){Di(this,i)}},(()=>{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[re],Bi(e,null,t,{kind:"method",name:"openSession",static:!1,private:!1,access:{has:e=>"openSession"in e,get:e=>e.openSession},metadata:r},null,i),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})());function Wi(e,t,i=!1,r,n){const s=["slides"];r&&s.push("share_url");const a={url:`${t===Et?"ugc/":""}story/${e}`,method:"GET",params:{expand:s.join(",")}};return a.params.once=Number(Boolean(n)),i||null!=a.params&&(a.params.fields=["id","slides"].join(",")),a}const Vi=(e,t,i,r)=>{var n;let s=null===(n=N.getState())||void 0===n?void 0:n.tags;const a={};s&&gt()(s)&&s.length>0&&(a.tags=s.join(",")),void 0!==e&&gt()(e)&&e.length>0&&(a.tags=e.join(","));return null==i||"number"!=typeof i&&!(e=>!isNaN(parseFloat(e))&&isFinite(e))(i)||(a.limit=i),null!=t&&(a.test=t),null!=r&&lt()(r)&&(a.f=JSON.stringify(r)),{params:a}};var zi=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};Ct.use((e=>zi(void 0,void 0,void 0,(function*(){return Ot.getState().style||(yield Mt()),$i.fetchStoryContext(e)})))),Mt.use((()=>zi(void 0,void 0,void 0,(function*(){return $i.fetchStoryStyles()})))),Ot.on(Pt,((e,t)=>{const i=Ne.getState(),r=Object.assign(Object.assign({},e),{widgetsData:Object.assign(Object.assign({},e.widgetsData),{[i]:Object.assign({},e.widgetsData[i])})});return r.widgetsData[i]._narrative_saved_data=null!=t?t:{},r}));Ot.on([Ct.doneData,Mt.doneData],((e,t)=>{var i;const r=Ne.getState(),n=Object.assign(Object.assign({},e),{widgetsData:Object.assign(Object.assign({},e.widgetsData),{[r]:Object.assign({},e.widgetsData[r])})});n.style=null!==(i=null==t?void 0:t.style)&&void 0!==i?i:e.style;let s=n.widgetsData[r];return n.widgetsData[r]=t.widgetsData?((e,t)=>{for(const[i,r]of Object.entries(t)){const t=Array.isArray(r)?{}:r;e[i]=Object.assign(Object.assign({},e[i]),t)}return e})(s,t.widgetsData):s,n}));class Ui extends Error{constructor(e){super(`Story with ID ${e} has already been shown to the user`),this.name=Ui.name}}var Gi=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const $i=new class{fetchUgcFeed(e){return Gi(this,arguments,void 0,(function*({filter:e,testKey:t}){var i;const r=function(e,t,i,r){const{params:n}=Vi(i,r,null,t);return{method:"GET",url:"ugc/feed",params:n}}(0,e,[],t);return(yield Ae.get(r.url,null!==(i=r.params)&&void 0!==i?i:{})).data}))}fetchFeed(e){return Gi(this,arguments,void 0,(function*({feedSlug:e,testKey:t}){var i;const r=function(e,t,i){const{params:r}=Vi(t,i);return{method:"GET",url:`feed/${e}`,params:r}}(e,[],t),n=yield Ae.get(r.url,null!==(i=r.params)&&void 0!==i?i:{});return n.data.feedSlug=e,n.data}))}fetchFavoriteList(){return Gi(this,void 0,void 0,(function*(){var e;const t=function(){const{params:e}=Vi();return{method:"GET",url:"story",params:Object.assign(Object.assign({},e),{favorite:1})}}();return(yield Ae.get(t.url,null!==(e=t.params)&&void 0!==e?e:{})).data}))}fetchOnboardingList(e){return Gi(this,arguments,void 0,(function*({onboardingList:e,onboardingTags:t,limit:i}){var r;const n=function(e="onboarding",t,i){const{params:r}=Vi(t,null,i);return{method:"GET",url:`feed/${e}/onboarding`,params:r}}(e,t,i),s=yield Ae.get(n.url,null!==(r=n.params)&&void 0!==r?r:{});return s.data.feedSlug=e,s.data}))}fetchStorySlides(e){return Gi(this,arguments,void 0,(function*({id:e,feedSlug:t}){var i;const r=Wi(e,t);return(yield Ae.get(r.url,null!==(i=r.params)&&void 0!==i?i:{})).data}))}fetchStory(e){return Gi(this,arguments,void 0,(function*({id:e,feedSlug:t,fetchShareUrl:i,once:r}){var n;const s=Wi(e,t,!0,i,r),a=yield Ae.get(s.url,null!==(n=s.params)&&void 0!==n?n:{});if(204===a.status&&r)throw new Ui(e.toString());return a.data}))}fetchStoryContext(e){return Gi(this,arguments,void 0,(function*({ids:e}){var t;const i=function(e){return{url:"story-context",method:"GET",params:{id:e.join(","),fields:"widgetsData"}}}(e);return(yield Ae.get(i.url,null!==(t=i.params)&&void 0!==t?t:{})).data}))}fetchStoryStyles(){return Gi(this,void 0,void 0,(function*(){var e;const t={url:"story-context",method:"GET",params:{fields:"style"}};return(yield Ae.get(t.url,null!==(e=t.params)&&void 0!==e?e:{})).data}))}},Hi=/[\r\n%#()<>?[\\\]^`{|}]/g;function qi(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(Hi,encodeURIComponent)}const Qi=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34});function Ki(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}function Yi(e){return e.map((e=>function(e){var t,i,r;if(!e.url)return null;let n={"font-family":null!==(t=e.family)&&void 0!==t?t:"normal",src:`url('${Ki(String(e.url))}')`,"font-style":null!==(i=e.style)&&void 0!==i?i:"normal","font-weight":null!==(r=e.weight)&&void 0!==r?r:"normal"};e.title&&(n.src+=`, local('${e.title}')`);return`@font-face {${s=n,Object.keys(s).reduce(((e,t)=>e+t.split(/(?=[A-Z])/).join("-").toLowerCase()+":"+s[t]+";"),"")}}\n`;var s}(e))).filter(Boolean).join("")}function Zi(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=Yi(e);if(null!=t){const e="stories-font-style";let i=document.getElementById(e);null===i?(i=document.createElement("style"),i.type="text/css",i.id=e,i.attributes.setNamedItem(document.createAttribute("scoped")),i.setAttribute("nonce",X()),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),document.body.appendChild(i)):i.styleSheet?i.styleSheet.cssText=t:(i.textContent="",i.appendChild(document.createTextNode(t)))}}(e)}function Ji(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}const Xi=!!(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}}),i=()=>{};window.addEventListener("test",i,t),window.removeEventListener("test",i)}catch(e){}return e})()&&{passive:!0};!function(){const e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;window.requestAnimationFrame=e}();const er=function(){let e,t=document.createElement("div"),i={transition:"transitionend",OTransition:"otransitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in i)if(i.hasOwnProperty(e)&&void 0!==t.style[e])return i[e]}();function tr(e,t,i){return new Promise((r=>{let n=!1;const s=()=>{n=!0,clearTimeout(o),void 0!==er&&e.removeEventListener(er,a),e.style.setProperty("transition",`${t} 0ms`),r()},a=e=>{e.propertyName===t&&(n||s())};void 0!==er&&e.addEventListener(er,a,!1);const o=setTimeout((()=>{n||s()}),i+20);e.style.setProperty("transition",`${t} ${i}ms`)}))}var ir=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const rr=(e,...t)=>ir(void 0,[e,...t],void 0,(function*(e,t=300){return new Promise((i=>{const r=Math.max(0,t-((new Date).getTime()-e));r?setTimeout(i,r):i()}))}));var nr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class sr{fetchStoryAndContextById(e){return nr(this,arguments,void 0,(function*({storyId:e,feed:t,fetchShareUrl:i,once:r}){try{const n=(new Date).getTime();return yield Te(),yield Ct({ids:[e],feedSlug:t}),yield kr({id:e,feedSlug:t,fetchShareUrl:i,once:r}),yield rr(n),this.getOrCreateDirectStoryById(e)}catch(t){if(r)throw t;const i=this.getOrCreateDirectStoryById(e);return i.error=t,i}}))}fetchStoriesSlidesAndContextByStoryId(e){return nr(this,arguments,void 0,(function*({storyId:e,listType:t,feed:i=""}){const r=this.getVisibleStoriesByListTypeAndFeed(t,i),n=r.findIndex((t=>t.id===e));return yield this.fetchStoriesSlidesAndContextByRange({stories:r,storyIndex:n,listType:t,feed:i}),this.getStoriesWithSlidesAndContext({listType:t,feed:i})}))}fetchStoriesSlidesAndContextByNextStoryIndex(e){return nr(this,arguments,void 0,(function*({nextStoryIndex:e,listType:t,feed:i}){const r=this.getVisibleStoriesByListTypeAndFeed(t,i);return yield this.fetchStoriesSlidesAndContextByRange({stories:r,storyIndex:e,listType:t,feed:i}),this.getStoriesWithSlidesAndContext({listType:t,feed:i})}))}getOrCreateDirectStoryById(e){var t;return null!==(t=jt(A.direct).find((t=>t.id===e||t.string_id===e.toString())))&&void 0!==t?t:Ve(e)}getStoriesWithSlidesAndContext({listType:e,feed:t}){return{storyList:jt(e,t).filter((e=>!e.hide_in_reader)),storyContext:kt.getState(),listType:e}}fetchStoriesSlidesAndContextByRange(e){return nr(this,void 0,void 0,(function*(){const t=this.getStoryIdsByStoriesRange(e.stories,e.storyIndex);if(!t.length)return null;yield this.fetchSlidesAndContext({feed:e.feed,storyIds:t})}))}getStoryIdsByStoriesRange(e,t){const i=t-2,r=t+2;return e.slice(Math.max(i,0),r+1).filter((e=>!e.slidesLoaded)).map((e=>e.id))}fetchSlidesAndContext(e){return nr(this,arguments,void 0,(function*({feed:e,storyIds:t}){const i=(new Date).getTime();try{yield Ct({ids:t,feedSlug:e}),yield Promise.allSettled(t.map((t=>Or({id:t,feedSlug:e})))),yield rr(i)}catch(e){}}))}getVisibleStoriesByListTypeAndFeed(e,t){return jt(e,t).filter((e=>!e.hide_in_reader))}}var ar=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const or=S(7315);Te.use((()=>ar(void 0,void 0,void 0,(function*(){const e=Ie.getState();if(e.session.id)return e;const t=yield function(){return ar(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([dr(),de()]);return{method:"POST",url:"session/open",params:{expand:"cache,storyWidgetsResources",fields:"session,server_timestamp,user_key,share,preview_aspect_ratio,placeholders,image_placeholders,is_allow_ugc"},data:lr(e,t)}}))}();return Fi.openSession(t)})))),Re.use((e=>ar(void 0,void 0,void 0,(function*(){Zi(e.filter((e=>"font-face"===e.type)))})))),(0,D.sample)({clock:De,target:Ie}),(0,D.sample)({clock:Ie,fn:e=>e.cache&&Array.isArray(e.cache)?e.cache:[],target:Re});const lr=(e,t)=>{"iOS"===e.os_name?window.isIos=!0:"Android"===e.os_name&&(window.Android=!0);const i=N.getState();return i&&i.userId&&(e.user_id=i.userId,e.user_sign=i.userIdSign),e.features="animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder,vod,closeStoryApi",t&&(e.features+=",webp"),e},dr=()=>ar(void 0,void 0,void 0,(function*(){return new Promise(((e,t)=>{let i=Ti("device_data"),r=null;if(null!==i&&(r=i.device_id),null!==i&&r&&ae()(r)&&36===r.trim().length)H(r),e(i);else{const t={platform:"web",device_id:or.v4()};Ri("device_data",t),H(t.device_id),e(t)}}))})),cr=(0,D.createEffect)();var ur=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};cr.use((()=>ur(void 0,void 0,void 0,(function*(){return(yield Ae.request(yield function(){return ur(this,void 0,void 0,(function*(){return{method:"GET",url:"ugc/editor-config",params:{}}}))}())).data})))),Ie.on(cr.doneData,((e,t)=>{const i=Object.assign({},e);return i.editor=t,i}));class hr{constructor(){Object.defineProperty(this,"__lastUpdated",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_receiveTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_serverTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"rawData",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"myDictionary",{enumerable:!0,configurable:!0,writable:!0,value:{}})}get receiveTime(){return this._receiveTime}singleModelWrapper(){return""}attributes(){return["__lastUpdated"]}static prepareFromResponse(){}setAttributes(e){const t=this.attributes();let i=this;for(let r in e){let n=e[r];-1!==t.indexOf(r)&&(i[r]=n)}}static createInstance(e,t){const i=new e;let r=t;return""!==i.singleModelWrapper()&&void 0!==t[i.singleModelWrapper()]&&(r=t[i.singleModelWrapper()]),i.rawData=t,i.setAttributes(r),i._receiveTime=(new Date).getTime(),void 0!==t.server_timestamp&&(i._serverTimestamp=t.server_timestamp),i}static _fetch(e,t,i,r="get"){return new Promise(((n,s)=>{let a={url:t,method:r};-1!==["post","put","path"].indexOf(r)?a.data=i:a.params=i;Ae.request(a).then((function(t){let i,r;i=t.data,i&&(i.__lastUpdated=Date.now()),r=hr.createInstance(e,i),n(r)})).catch(s)}))}static _fetchList(e,t,i){return new Promise(((r,n)=>{Ae.get(t,{params:i}).then((function(t){const i=t.data;let n=[];i.forEach((t=>{n.push(hr.createInstance(e,t))}));let s={models:n,totalCount:Number(t.headers["x-pagination-total-count"]),currentPage:Number(t.headers["x-pagination-current-page"])};r(s)})).catch(n)}))}static emitEvent({type:e,event:t,eventData:i}){return new Promise(((r,n)=>{Ae.post(`${e}/event/${t}`,i).then((function(e){const t=e.data;r(t)})).catch(n)}))}static update(e,t,i="post"){let r={url:e,method:i};return-1!==["post","put","path"].indexOf(i)?r.data=t:r.params=t,new Promise(((e,t)=>{Ae.request(r).then((function(t){let i;i=t.data,e(i)})).catch(t)}))}}class pr extends hr{attributes(){return["width","height","type","url"]}constructor(){super(),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:""})}set url(e){this._url=e}get url(){let e=window.isSecureContext;return void 0===e&&"https:"===window.location.protocol&&(e=!0),e?this._url:this._url.replace(/^https:\/\//,"http://")}}const fr=S(3981);class gr{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 createFromArray(e){const t=new gr;for(let i in e)e.hasOwnProperty(i)&&t.images.push(pr.createInstance(pr,e[i]));return t}findOneByType(e){let t=null;return this.images.forEach((i=>{i.type===e&&(t=i)})),t}findOneByWidth(e,t=!1){let i=null;return this.images.forEach((t=>{t.width===e&&(i=t)})),null!==i||t&&void 0!==(i=fr(this.images))?i:null}}class vr extends hr{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"feedSlug",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cover",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hasFavorite",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"stories",{enumerable:!0,configurable:!0,writable:!0,value:[]})}attributes(){return Bt()(super.attributes(),["id","cover","hasFavorite","stories"])}set cover(e){this._cover=gr.createFromArray(e)}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}}const mr=Object.prototype.hasOwnProperty,br=e=>{const t=yt.getState();for(let i in t.user)mr.call(t.user,i)&&(e=Nt(e,`%${i}%`,t.user[i]));for(let i in t.default)mr.call(t.default,i)&&(e=Nt(e,`%${i}%`,t.default[i]));const i=vt.getState();for(let t in i.user)mr.call(i.user,t)&&(e=Nt(e,`%${t}%`,i.user[t]));for(let t in i.default)mr.call(i.default,t)&&(e=Nt(e,`%${t}%`,i.default[t]));return e};var yr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const wr=(0,D.createEffect)((e=>yr(void 0,void 0,void 0,(function*(){return $i.fetchUgcFeed(e)})))),Sr=(0,D.createEffect)((e=>yr(void 0,void 0,void 0,(function*(){return $i.fetchFeed(e)})))),_r=(0,D.createEffect)((()=>yr(void 0,void 0,void 0,(function*(){return $i.fetchFavoriteList()})))),xr=(0,D.createEffect)((e=>yr(void 0,void 0,void 0,(function*(){return $i.fetchOnboardingList(e)})))),Or=(0,D.createEffect)((e=>yr(void 0,void 0,void 0,(function*(){return $i.fetchStorySlides(e)})))),kr=(0,D.createEffect)((e=>yr(void 0,void 0,void 0,(function*(){return $i.fetchStory(e)})))),Cr=(0,D.createEvent)(),Mr=(0,D.createEffect)((e=>yr(void 0,[e],void 0,(function*({defaultList:e,onboardingList:t,favoriteList:i,onboardingTags:r,testKey:n,limit:s}){var a;if(yield Te(),!1!==e&&lt()(e)&&ae()(e.feedSlug)){const t=e.feedSlug,i=null!==(a=e.filter)&&void 0!==a?a:{};t===Et?yield wr({filter:i,testKey:n}):yield Sr({feedSlug:t,testKey:n})}i&&(yield _r()),!1!==t&&ae()(t)&&(yield xr({onboardingList:t,onboardingTags:r,limit:s}))})))),Pr=(e,t)=>Array.isArray(e)?e.map((e=>Object.assign(Object.assign({},e),{title:e.need_placeholders?br(e.title):e.title,slidesLoaded:!1,is_opened:Je(e),type:t}))):[];(0,D.sample)({clock:Te.doneData,filter:Ie.map((e=>!e.session.id)),target:Ie}),(0,D.sample)({clock:Ie.map((e=>e.placeholders)),target:St}),(0,D.sample)({clock:Ie.map((e=>e.image_placeholders)),target:bt}),(0,D.sample)({source:Ue,clock:Ie,fn:(e,t)=>{const i={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r].map((e=>Object.assign(Object.assign({},e),{is_opened:Je(e,t.user_key),title:e.need_placeholders?br(e.title):e.title}))));return i},target:Ue});const{storiesListIdsChanged:jr}=(0,D.createApi)(He,{storiesListIdsChanged:(e,{storiesIdsUserEntity:t,feedSlug:i,storyList:r})=>{let n=Ie.getState().user_key||"default";const s=e[n]||{};return void 0===s[$e.FAVORITE]&&(s[$e.FAVORITE]=[]),void 0===s[$e.FEEDS]&&(s[$e.FEEDS]={}),t===$e.FEEDS&&i&&(s[$e.FEEDS][i]=r.map((e=>e.id))),t===$e.FAVORITE&&(s[$e.FAVORITE]=r.map((e=>e.id))),Object.assign(Object.assign({},e),{[n]:s})}}),{storiesListItemsAdded:Er}=(0,D.createApi)(Ue,{storiesListItemsAdded:(e,{storiesIdsUserEntity:t,feedSlug:i,storyList:r})=>{let n=Ie.getState().user_key||"default";const s=e[n]||[],a=s.map((e=>e.id));return Object.assign(Object.assign({},e),{[n]:[...s,...r.filter((e=>-1===a.indexOf(e.id))).map((e=>Object.assign(Object.assign({},e),{slides:[]})))]})}}),{storyFeedsAdded:Lr}=(0,D.createApi)(ze,{storyFeedsAdded:(e,t)=>Object.assign(Object.assign({},e),t)});(0,D.sample)({clock:Sr.doneData.map((e=>{let t={};return t[e.feedSlug]=hr.createInstance(vr,e),t})),target:[Lr]}),(0,D.sample)({clock:wr.doneData.map((e=>{let t={};return t[Et]=hr.createInstance(vr,e),t})),target:[Lr]}),(0,D.sample)({clock:Sr.doneData.map((e=>{const t=Pr(e.stories,We.DEFAULT);return{storiesIdsUserEntity:$e.FEEDS,feedSlug:e.feedSlug,storyList:t}})),target:[Er,jr]}),(0,D.sample)({clock:wr.doneData.map((e=>{const t=Pr(e,We.UGC);return{storiesIdsUserEntity:$e.FEEDS,feedSlug:Et,storyList:t}})),target:[Er,jr]}),(0,D.sample)({clock:xr.doneData.map((e=>{const t=Pr(e.stories,We.DEFAULT);return{storiesIdsUserEntity:$e.FEEDS,feedSlug:`onboarding_${e.feedSlug}`,storyList:t}})),target:[Er,jr]}),(0,D.sample)({clock:_r.doneData.map((e=>{const t=Pr(e,We.DEFAULT);return{storiesIdsUserEntity:$e.FAVORITE,feedSlug:null,storyList:t}})),target:[Er,jr]});const Ar=(e,t)=>Object.assign(Object.assign({},e),{slidesLoaded:!0,error:null,is_opened:Je(e),slides:t.slides.map((t=>Object.assign(Object.assign({},t),{html:e.need_placeholders?br(t.html):t.html})))}),Ir=(e,t)=>(e[t]||[]).slice(),Tr=(e,t)=>e.findIndex((e=>e.id===t)),Rr=(e,t)=>{const i=Ne.getState(),r=Ir(e,i),n=Tr(r,t.id);return-1===n?r.push(Ar(t,t)):r[n]=Ar(r[n],t),Object.assign(Object.assign({},e),{[i]:r})},Dr=(e,{params:{id:t},error:i})=>{const r=Ne.getState(),n=Ir(e,r),s=Tr(n,t);if(-1===s){const e=Ve(t);e.error=i,n.push(e)}else n[s]=Object.assign(Object.assign({},n[s]),{slidesLoaded:!1,error:i});return Object.assign(Object.assign({},e),{[r]:n})};Ue.on(Ct.fail,((e,{params:{ids:t},error:i})=>{const r=Ne.getState(),n=Ir(e,r);for(const e of t){const t=Tr(n,e);if(-1===t){const t=Ve(e);t.error=i,n.push(t)}else n[t]=Object.assign(Object.assign({},n[t]),{slidesLoaded:!1,error:i})}return Object.assign(Object.assign({},e),{[r]:n})})),Ue.on(Or.doneData,Rr),Ue.on(kr.doneData,Rr),Ue.on(Or.fail,Dr),Ue.on(kr.fail,Dr),Ue.on(Cr,((e,{id:t,story:i})=>{const r=Ne.getState(),n=Ir(e,r),s=Tr(n,t);return-1===s?e:(n[s]=Object.assign(Object.assign({},n[s]),i),Object.assign(Object.assign({},e),{[r]:n}))})),(0,D.sample)({source:Ue,clock:yt,fn:e=>{const t={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i].map((e=>Object.assign(Object.assign({},e),{slides:e.slides.map((t=>Object.assign(Object.assign({},t),{html:e.need_placeholders?br(t.html):t.html})))}))));return t},target:Ue});var Br=S(3514),Nr=S.n(Br),Fr=S(2438),Wr=S.n(Fr),Vr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class zr{static updateStoryLike(e,t){return Vr(this,void 0,void 0,(function*(){let i=!1;const r={like:void 0};let n="";try{const s=yield Ae.post(`story-like/${e}`,{value:t});void 0!==s.data.like?(i=!0,r.like=s.data.like,et({id:e,like:r.like})):n="response.data.like is undefined"}catch(e){n=e.toString()}if(i)return r;throw n}))}static getStorySharePath(e){return Vr(this,void 0,void 0,(function*(){let t=!1;const i={url:void 0};let r="";try{const n=yield Ae.get(`story-share/${e}`,{});void 0!==n.data.url?(t=!0,i.url=n.data.url):r="response.data.url is undefined"}catch(e){r=e.toString()}if(t)return i;throw r}))}static markAsOpened(e){if(!Nr()(Ie.getState().user_key)){const t=`u/${Ie.getState().user_key}/s_opened`;let i=Ti(t);gt()(i)||(i=[]),i.push(e),i=Wr()(i),Ri(t,i)}tt({id:e})}static setBookmark(e,t){return Vr(this,void 0,void 0,(function*(){let i=!1;const r={favorite:void 0};let n="";try{const s=yield Ae.post(`story-favorite/${e}`,{value:t});void 0!==s.data.favorite?(i=!0,r.favorite=Boolean(s.data.favorite),!1===r.favorite?jr({storiesIdsUserEntity:$e.FAVORITE,feedSlug:null,storyList:Ye.getState().filter((t=>t.id!==e))}):jr({storiesIdsUserEntity:$e.FAVORITE,feedSlug:null,storyList:[...Ye.getState(),...Ge.getState().filter((t=>t.id===e))]}),Xe({id:e,favorite:r.favorite})):n="response.data.favorite is undefined"}catch(e){n=e.toString()}if(i)return r;throw n}))}}class Ur{constructor(){Object.defineProperty(this,"prevStoryId",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"prevSlideIndex",{enumerable:!0,configurable:!0,writable:!0,value:-1})}update({currentSlideIndex:e,currentStoryId:t}){this.prevStoryId!==t&&qt.emit("publicEvents.showStory",{id:t,index:e}),-1!==this.prevStoryId&&qt.emit(ki.NextSlide,{fromStoryId:this.prevStoryId,fromSlideIndex:this.prevSlideIndex}),qt.emit("publicEvents.showSlide",{id:t,index:e}),this.prevStoryId=t,this.prevSlideIndex=e}reset(){this.prevStoryId=-1,this.prevSlideIndex=-1}}var Gr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class $r{constructor(e,t){Object.defineProperty(this,"showMultipleStoriesStrategy",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t})}show(e){return Gr(this,void 0,void 0,(function*(){let t="onboarding";e.feed&&(t=e.feed),yield Mr({defaultList:!1,favoriteList:!1,onboardingList:t,onboardingTags:e.customTags,limit:e.limit});const i=jt(A.onboarding,t),r=this.getFeedLoadEvent(t,i);return this.emitFeedLoad(r),i.length?(yield this.showMultipleStoriesStrategy.show({windowReferer:L.default,listType:A.onboarding,storyId:i[0].id,feed:t}),r):r}))}emitFeedLoad(e){this.storyManager.emit("feedLoad",e)}getFeedLoadEvent(e,t){const i={stories:t.map((e=>{const t={title:null,tags:[],slidesCount:null};return e&&(t.title=e.stat_title,t.tags=e.tags,t.slidesCount=e.slides_count),Object.assign({id:e.id},t)})),feed:null,filter:null};return i.feed=e,i}reload(e){return Gr(this,void 0,void 0,(function*(){this.showMultipleStoriesStrategy.reload(e)}))}}var Hr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class qr{constructor(e,t){Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderStoriesService",{enumerable:!0,configurable:!0,writable:!0,value:t})}show(e){return Hr(this,void 0,void 0,(function*(){const t=Lt(e.feed),i=((e,t,i)=>{const r=jt(e.listType,i);let n=Ie.getState().share;return t===We.UGC&&(n=!1),Object.assign(Object.assign({},e),{id:e.storyId,storyContext:kt.getState(),storyList:r,hasShare:n,placeholders:xt()})})(e,t,e.feed);this.storyReaderViewModel.open(i,{listType:e.listType,feedSlug:e.feed,filter:e.filter});const r=yield this.storyReaderStoriesService.fetchStoriesSlidesAndContextByStoryId({storyId:e.storyId,listType:e.listType,feed:e.feed});this.storyReaderViewModel.setStoriesAndContext(r)}))}reload(e){return Hr(this,void 0,void 0,(function*(){const t=yield this.storyReaderStoriesService.fetchStoriesSlidesAndContextByStoryId(e);this.storyReaderViewModel.setStoriesAndContext(t)}))}}var Qr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Kr{constructor(e){Object.defineProperty(this,"showStoryStrategy",{enumerable:!0,configurable:!0,writable:!0,value:e})}show(e){return Qr(this,void 0,void 0,(function*(){try{return yield this.showStoryStrategy.show({storyId:e.storyId,feed:"",fetchShareUrl:e.fetchShareUrl}),e.fetchShareUrl&&ut(!1),!0}catch(e){return!1}}))}reload(e){return Qr(this,void 0,void 0,(function*(){return this.showStoryStrategy.reload(e)}))}}var Yr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Zr{constructor(e,t){Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderStoriesService",{enumerable:!0,configurable:!0,writable:!0,value:t})}show(e){return Yr(this,void 0,void 0,(function*(){var t;try{let i=this.storyReaderStoriesService.getOrCreateDirectStoryById(e.storyId);if(i.is_opened)throw new Ui(e.storyId.toString());if(!i.slidesLoaded){if(i=null!==(t=yield this.storyReaderStoriesService.fetchStoryAndContextById({storyId:e.storyId,feed:"",once:!0,listType:A.direct}))&&void 0!==t?t:i,i.error)throw i.error;i.slidesLoaded=!1}const r=At(i);this.storyReaderViewModel.open(r,{listType:A.direct,feedSlug:"",once:!0}),i.slidesLoaded||(yield rr((new Date).getTime()),i.slidesLoaded=!0,this.storyReaderViewModel.setStoriesAndContext({listType:A.direct,storyList:[i],storyContext:kt.getState()}))}catch(e){throw this.storyReaderViewModel.close(),e}}))}reload(e){return Yr(this,void 0,void 0,(function*(){var t;const i=yield this.storyReaderStoriesService.fetchStoryAndContextById(Object.assign(Object.assign({},e),{feed:null!==(t=e.feed)&&void 0!==t?t:""}));this.storyReaderViewModel.setStoriesAndContext({listType:A.direct,storyList:[i],storyContext:kt.getState()})}))}}var Jr,Xr=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class en{constructor(e,t){Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyReaderStoriesService",{enumerable:!0,configurable:!0,writable:!0,value:t})}show(e){return Xr(this,void 0,void 0,(function*(){var t,i;let r=this.storyReaderStoriesService.getOrCreateDirectStoryById(e.storyId);if(!r.slidesLoaded){if(r=yield this.storyReaderStoriesService.fetchStoryAndContextById({storyId:e.storyId,feed:null!==(t=e.feed)&&void 0!==t?t:"",listType:A.direct,fetchShareUrl:e.fetchShareUrl}),r.error)throw r.error;r.slidesLoaded=!1}const n=At(r);this.storyReaderViewModel.open(n,{listType:A.direct,feedSlug:null!==(i=e.feed)&&void 0!==i?i:"",fetchShareUrl:e.fetchShareUrl}),r.slidesLoaded||(yield rr((new Date).getTime()),r.slidesLoaded=!0,this.storyReaderViewModel.setStoriesAndContext({listType:A.direct,storyList:[r],storyContext:kt.getState()}))}))}reload(e){return Xr(this,void 0,void 0,(function*(){var t;const i=yield this.storyReaderStoriesService.fetchStoryAndContextById(Object.assign(Object.assign({},e),{feed:null!==(t=e.feed)&&void 0!==t?t:""}));this.storyReaderViewModel.setStoriesAndContext({listType:A.direct,storyList:[i],storyContext:kt.getState()})}))}}class tn{constructor(e,t,i){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,"storyReaderStoriesService",{enumerable:!0,configurable:!0,writable:!0,value:i})}createShowStory(){return new en(this.storyReaderViewModel,this.storyReaderStoriesService)}createShowStoryOnce(){return new Zr(this.storyReaderViewModel,this.storyReaderStoriesService)}createShowStoryFromSharePage(){return new Kr(new en(this.storyReaderViewModel,this.storyReaderStoriesService))}createShowOnboardingStories(){return new $r(new qr(this.storyReaderViewModel,this.storyReaderStoriesService),this.storyManager)}createShowMultipleStories(){return new qr(this.storyReaderViewModel,this.storyReaderStoriesService)}}!function(e){e.HideLayer="hideLayer",e.ShowLayer="showLayer"}(Jr||(Jr={}));class rn extends(i()){constructor(e,t){super(),Object.defineProperty(this,"onShowLayer",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"onHideLayer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"layersContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"animationApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeLayer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"initialLayer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}init(e,t){this.layersContainer=e,this.animationApi=t,this.layers=Array.from(this.layersContainer.querySelectorAll(".narrative-slide.narrative-multi-slide")),this._activeLayer=this.layers.find((e=>!e.classList.value.includes("hidden"))),this.initialLayer=this._activeLayer}reset(){var e;this.hideAllLayers(),null===(e=this.initialLayer)||void 0===e||e.classList.remove("hidden")}get activeLayer(){return this._activeLayer}getLayers(){return this.layers}hideLayer(e){var t;e.classList.contains("hidden")||(this.animationApi.stop(e,!0),e.classList.add("hidden"),this.emit(Jr.HideLayer,{layer:e}),null===(t=this.onHideLayer)||void 0===t||t.onHideLayer(e))}showLayer(e){var t;null===(t=this.onShowLayer)||void 0===t||t.onShowLayer(e),e.classList.remove("hidden"),this.animationApi.start(e,!0),this._activeLayer=e,this.emit(Jr.ShowLayer,{layer:e})}hideAllLayers(){this.getLayers().forEach((e=>this.hideLayer(e)))}showLayerByIndex(e){const t=this.getLayers();t.forEach((e=>this.hideLayer(e)));const i=t[e];i&&this.showLayer(i)}hasValidMultiSlides(){let e=!0,t=this.layersContainer.querySelectorAll(".narrative-slide.narrative-multi-slide");const i=this.layersContainer.querySelectorAll(".narrative-slide.narrative-multi-slide:not(.hidden)");return t.length>0&&0===i.length&&(e=!1),e}}const nn=function(){const e={step:1,maxSteps:100};var t=Object.prototype.hasOwnProperty;return function(r,n){n||(n={});var s={};for(var a in e)t.call(n,a)?s[a]=n[a]:s[a]=e[a];var o=Object.prototype.toString.call(r);"[object Array]"!==o&&"[object NodeList]"!==o&&"[object HTMLCollection]"!==o&&(r=[r]);for(var l=0;l<r.length;l++)i(r[l],s)};function i(e,t){if(!r(e)||e.getAttribute("textFitted"))return!1;var i,n,s,a;if(!r(n=e.parentElement))return!1;if(i=function(e){var t=window.getComputedStyle(e,null);return e.getBoundingClientRect().height-parseInt(t.getPropertyValue("padding-top"),10)-parseInt(t.getPropertyValue("padding-bottom"),10)}(n),i<=0)console.warn(`Set a static height and width on the target element ${e.outerHTML} before using textFit!`,e);else{e.setAttribute("textFitted","1");var o=t.step,l=a=parseFloat(window.getComputedStyle(e).fontSize);if(!(l<(s=a-o*t.maxSteps)))for(;l>=s;){if(!(e.getBoundingClientRect().height>i))break;l-=o,e.style.fontSize=l+"px"}}}function r(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}}();var sn,an=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};!function(e){e.Playing="playing",e.Waiting="waiting",e.Error="error"}(sn||(sn={}));class on{constructor(e,t){Object.defineProperty(this,"videoContext",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"videoEl",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.parseDefaultMuted()}get $video(){return this.videoEl}get muted(){return this.videoEl.muted}get paused(){return this.videoEl.paused}start(){return an(this,void 0,void 0,(function*(){this.videoEl.pause(),this.videoEl.currentTime=0,yield this.play()}))}play(){return an(this,void 0,void 0,(function*(){try{const e=this.videoEl.play();e?yield e:yield new Promise((e=>{setTimeout(e,0)}))}catch(e){throw e}}))}pause(){this.videoEl.pause()}resume(){return an(this,void 0,void 0,(function*(){this.videoEl.paused&&(yield this.videoEl.play())}))}stop(){this.videoEl.pause(),this.videoEl.currentTime=0}mute(){"1"!==this.videoEl.getAttribute("data-default-muted")&&(this.videoEl.muted=!0)}unmute(){"1"!==this.videoEl.getAttribute("data-default-muted")&&(this.videoEl.muted=!1)}load(){return an(this,arguments,void 0,(function*(e=!0){return new Promise((t=>{const i=this.videoEl.oncanplaythrough?"canplaythrough":"canplay";this.videoEl.addEventListener(i,(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t()}))}))}),{once:!0}),e&&this.videoEl.load()}))}))}on(e,t){return this.videoEl.addEventListener(e,t),this}once(e,t){return this.videoEl.addEventListener(e,t,{once:!0}),this}off(e,t){return this.videoEl.removeEventListener(e,t),this}destroy(){return an(this,void 0,void 0,(function*(){return Promise.resolve()}))}parseDefaultMuted(){null===this.videoEl.getAttribute("data-default-muted")&&(this.videoEl.muted?this.videoEl.setAttribute("data-default-muted","1"):this.videoEl.setAttribute("data-default-muted","0"))}onPlaying(){}onWaiting(){}}var ln=S(3107);class dn{constructor(e){Object.defineProperty(this,"video",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timeupdate",{enumerable:!0,configurable:!0,writable:!0,value:Date.now()}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"playingCheckerTimerId",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.handleTimeUpdate=this.handleTimeUpdate.bind(this),this.video.$video.addEventListener("timeupdate",this.handleTimeUpdate)}destroy(){null!=this.playingCheckerTimerId&&window.clearTimeout(this.playingCheckerTimerId),this.video.$video.removeEventListener("timeupdate",this.handleTimeUpdate)}handleTimeUpdate(){this.timeupdate=Date.now(),null!=this.playingCheckerTimerId&&window.clearTimeout(this.playingCheckerTimerId),1!==this.state&&(this.state=1,this.triggerUpdate()),this.scheduleUpdate()}scheduleUpdate(){this.playingCheckerTimerId=window.setTimeout((()=>{Date.now()-this.timeupdate>=150&&(this.state=2,this.triggerUpdate())}),300)}triggerUpdate(){1===this.state?this.video.onPlaying():2===this.state&&this.video.onWaiting()}}var cn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class un extends on{constructor(e,t){super(e,t),Object.defineProperty(this,"videoContext",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"player",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_vodData",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isPlaying",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isDataWaiting",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"attached",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"videoStateAdapter",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.handlePlayerError=this.handlePlayerError.bind(this),this._vodData=un.parseData(t)}get vodData(){return this._vodData}static get isBrowserSupported(){return ln.Player.isBrowserSupported()}load(){const e=Object.create(null,{load:{get:()=>super.load}});return cn(this,void 0,void 0,(function*(){try{un.isBrowserSupported?(this.disableVideoPreload(),yield this.initPlayer()):(this.updateVideoSources(),yield e.load.call(this),console.error("[VOD]: Browser not supported!"))}catch(e){throw this.stop(),this.detachVideoElement().catch(console.error),e}}))}destroy(){return cn(this,void 0,void 0,(function*(){this.player.removeEventListener("error",this.handlePlayerError),this.stop(),yield this.detachVideoElement(),yield this.player.destroy()}))}static parseData(e){const t=e.getAttribute("data-vod");try{return t&&JSON.parse(t)}catch(e){return null}}stop(){const e=Object.create(null,{stop:{get:()=>super.stop}});return cn(this,void 0,void 0,(function*(){var t;this.isPlaying=!1,null===(t=this.videoStateAdapter)||void 0===t||t.destroy(),e.stop.call(this)}))}start(){const e=Object.create(null,{start:{get:()=>super.start}});return cn(this,void 0,void 0,(function*(){this.isPlaying||(this.isPlaying=!0,this.videoStateAdapter=new dn(this),yield e.start.call(this))}))}initPlayer(){return cn(this,void 0,void 0,(function*(){this.player=new ln.Player,this.player.addEventListener("error",this.handlePlayerError),yield this.attachVideoElement(),yield this.loadVideo()}))}disableVideoPreload(){this.videoEl.preload="none"}updateVideoSources(){this.videoEl.innerHTML="";for(const e of this.vodData.formats){const t=document.createElement("source");t.src=e.url,t.type=e.mimeType,t.width=e.width,t.height=e.height,this.videoEl.appendChild(t)}}handlePlayerError(e){const t=e.detail,i=`[VOD]: error code ${t.code}; object ${t}`;console.error(i),this.stop(),this.detachVideoElement().catch(console.error).finally((()=>{this.videoContext.emit(sn.Error,t)}))}attachVideoElement(){return cn(this,void 0,void 0,(function*(){this.attached||(yield this.player.attach(this.videoEl),this.attached=!0,dt("[VOD]: video element attached",this.videoEl))}))}loadVideo(){return cn(this,void 0,void 0,(function*(){const e=ln.Player.convertJsonToUri(this.vodData);yield this.player.load(e,0,"application/json"),dt(`[VOD]: video ${e} successful loaded`)}))}detachVideoElement(){return cn(this,void 0,void 0,(function*(){this.attached&&(yield this.player.detach(this.videoEl),this.attached=!1,dt("[VOD]: video element detached",this.videoEl))}))}onPlaying(){this.isDataWaiting&&(this.isDataWaiting=!1,this.videoContext.emit(sn.Playing))}onWaiting(){this.isDataWaiting=!0,this.videoContext.emit(sn.Waiting)}}var hn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class pn{constructor(e){Object.defineProperty(this,"videoManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"videos",{enumerable:!0,configurable:!0,writable:!0,value:[]})}load(e){return hn(this,void 0,void 0,(function*(){for(const t of Array.from(e.querySelectorAll("video"))){const e=this.createVideoByElement(t);this.videos.push(e),yield e.load()}}))}start(){return hn(this,void 0,void 0,(function*(){for(const e of this.videos)yield e.start()}))}pause(){for(const e of this.videos)e.pause()}resume(){return hn(this,void 0,void 0,(function*(){for(const e of this.videos)yield e.play()}))}stop(){for(const e of this.videos)e.stop()}static hasVideo(e){return Boolean(e.querySelector(".narrative-slide__with-video"))}mute(){for(const e of this.videos)e.mute()}unmute(){for(const e of this.videos)e.unmute()}destroy(){return hn(this,void 0,void 0,(function*(){for(const e of this.videos)yield e.destroy(),this.videos.splice(this.videos.indexOf(e),1);this.videos=[]}))}createVideoByElement(e){return un.parseData(e)?new un(this,e):new on(this,e)}emit(e,...t){return this.videoManager.emit(e,...t)}}var fn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class gn extends(i()){constructor(e){super(),Object.defineProperty(this,"layerManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"videoContexts",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"muted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_loaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.handleShowLayer=this.handleShowLayer.bind(this),this.handleHideLayer=this.handleHideLayer.bind(this),this.subscribeLayerManager()}get loaded(){return this._loaded}load(){return fn(this,void 0,void 0,(function*(){this._loaded=!1,this.videoContexts.clear();for(const e of this.layerManager.getLayers()){const t=new pn(this);this.videoContexts.set(e,t),yield t.load(e)}this._loaded=!0}))}start(){return fn(this,void 0,void 0,(function*(){const e=this.getActiveVideoContext();yield null==e?void 0:e.start()}))}mute(){this.muted=!0;const e=this.getActiveVideoContext();null==e||e.mute()}unmute(){this.muted=!1;const e=this.getActiveVideoContext();null==e||e.unmute()}resume(){return fn(this,void 0,void 0,(function*(){const e=this.getActiveVideoContext();null==e||e.resume()}))}pause(){const e=this.getActiveVideoContext();null==e||e.pause()}stop(){for(const e of this.videoContexts.values())e.stop()}destroy(){return fn(this,void 0,void 0,(function*(){this._loaded=!1;for(const e of this.videoContexts.values())yield e.destroy();this.videoContexts=new Map,this.unsubscribeLayerManager()}))}subscribeLayerManager(){this.layerManager.on(Jr.ShowLayer,this.handleShowLayer),this.layerManager.on(Jr.HideLayer,this.handleHideLayer)}unsubscribeLayerManager(){this.layerManager.off(Jr.ShowLayer,this.handleShowLayer),this.layerManager.off(Jr.HideLayer,this.handleHideLayer)}handleShowLayer({layer:e}){this.intheritMuted();const t=this.videoContexts.get(e);null==t||t.start().catch(console.error)}handleHideLayer({layer:e}){const t=this.videoContexts.get(e);null==t||t.stop()}getActiveVideoContext(){const e=this.layerManager.activeLayer;if(e)return this.videoContexts.get(e)}intheritMuted(){this.muted?this.mute():this.unmute()}}var vn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class mn extends(i()){constructor(e){super(),Object.defineProperty(this,"videoContainer",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"videoContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_loaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.videoContext=new pn(this)}get loaded(){return this._loaded}load(){return vn(this,void 0,void 0,(function*(){this._loaded=!1,yield this.videoContext.load(this.videoContainer),this._loaded=!0}))}start(){return vn(this,void 0,void 0,(function*(){yield this.videoContext.start()}))}pause(){this.videoContext.pause()}resume(){return vn(this,void 0,void 0,(function*(){yield this.videoContext.resume()}))}stop(){this.videoContext.stop()}mute(){this.videoContext.mute()}unmute(){this.videoContext.unmute()}destroy(){return vn(this,void 0,void 0,(function*(){return this._loaded=!1,this.videoContext.destroy()}))}}class bn{constructor(){}static create(e,t){if(!pn.hasVideo(e))return null;return e.querySelectorAll(".narrative-slide.narrative-multi-slide").length>0?new gn(t):new mn(e)}}var yn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class wn{constructor(){Object.defineProperty(this,"_widgets",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.refreshUserData=this.refreshUserData.bind(this)}get widgets(){return Array.from(this._widgets.values()).filter((e=>e.isInited))}init(e){return yn(this,void 0,void 0,(function*(){for(const t of this._widgets.values())yield t.init(e)}))}register(e){this._widgets.set(e.getType(),e)}registerMany(e){for(const t of e)this._widgets.set(t.getType(),t)}pause(){for(const e of this._widgets.values())e.pause()}resume(){for(const e of this._widgets.values())e.resume()}findWidgetByType(e){const t=this._widgets.get(e);if(null==t?void 0:t.firstElement)return t}stop(){for(const e of this._widgets.values())e.destroy()}handleWidgetClick(e,t){for(const i of this.widgets)if(i.click({target:e,navigationController:t}),t.defaultPrevented)break}destroy(){this.stop()}refreshUserData(){for(const e of this._widgets.values())e.refreshUserData()}}class Sn{constructor(){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"elements",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}get firstElement(){var e;return null===(e=this.elements)||void 0===e?void 0:e.item(0)}get isInited(){return Boolean(this.firstElement)}pause(){}resume(){}destroy(){}getActiveElement(){var e;return null===(e=this.elements)||void 0===e?void 0:e.item(0)}getActiveElements(){return this.elements}refreshUserData(){}getType(){if(!this.type)throw new Error("[StoryWidget]: widget must have a type");return this.type}setUserData(e,t){}}var _n=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class xn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="CopyWidget"}init(e){return _n(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-copy");try{this.slideApi.WidgetCopy.initWidget(this.elements)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetCopy.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetCopy.click(e.target),e.navigationController.preventDefault())}}var On=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class kn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="DataInputWidget"}init(e){return On(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-data-input");try{this.slideApi.WidgetDataInput.initWidget(this.elements)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetDataInput.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetDataInput.click(e.target),e.navigationController.preventDefault())}setUserData(e,t=""){this.slideApi.WidgetDataInput.setUserData(e,t)}}var Cn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Mn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="DateCountdownWidget"}init(e){return Cn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-date-countdown");const t=Array.from(e.querySelectorAll(".narrative-slide.narrative-multi-slide"));try{if(!this.elements.length)return;this.slideApi.WidgetDateCountdown.initWidget(this.elements,t)}catch(e){console.error(e)}}))}pause(){try{if(!this.elements)return;this.slideApi.WidgetDateCountdown.pause(this.elements)}catch(e){console.error(e)}}resume(){try{if(!this.elements)return;this.slideApi.WidgetDateCountdown.resume(this.elements)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetDateCountdown.refreshUserData(this.elements)}click(){}}var Pn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class jn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="PollWidget"}init(e){return Pn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-poll");try{if(!this.firstElement)return;this.slideApi.WidgetPoll.initWidget(this.firstElement)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetPoll.refreshUserData(this.elements)}select(e){this.slideApi.WidgetPoll.select(e)}setUserData(e,t=""){this.slideApi.WidgetPoll.setUserData(e,t)}click(e){e.target.classList.contains("narrative-element-poll-button")&&(this.select(e.target),e.navigationController.preventDefault())}}var En=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Ln extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="PollLayersWidget"}init(e){return En(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-poll-layers");const t=e.querySelectorAll(".narrative-slide.narrative-multi-slide");try{if(!this.firstElement)return;this.slideApi.WidgetPollLayers.initWidget(this.firstElement,Array.from(t))}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetPollLayers.refreshUserData(this.elements)}select(e){this.slideApi.WidgetPollLayers.select(e)}click(e){e.target.classList.contains("narrative-element-poll-button")&&(this.select(e.target),e.navigationController.preventDefault())}}var An=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class In extends Sn{constructor(e,t){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.type="QuestWidget"}init(e){return An(this,void 0,void 0,(function*(){var t;this.elements=e.querySelectorAll(".narrative-element-quest");const i=e.querySelectorAll(".narrative-slide"),r=null===(t=null==i?void 0:i.item(0))||void 0===t?void 0:t.getAttribute("data-quest-count");this.elements.length||null==r||(this.elements=i);try{if(!this.firstElement)return;yield this.slideApi.WidgetQuest.initWidget(this.firstElement)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetQuest.refreshUserData(this.elements)}select(e){this.slideApi.WidgetQuest.select(e)}click(e){e.target.classList.contains("narrative-element-test-answer")?this.handleTestAnswer(e):this.handleRouteClick(e)}handleTestAnswer(e){this.select(e.target),e.navigationController.preventDefault()}handleRouteClick(e){e.navigationController.navigationDisabled||(e.navigationController.preventDefault(),this.slideApi.WidgetQuest.handleRouteClick(this.firstElement,{direction:e.navigationController.direction>0?"forward":"backward",slideIndex:this.story.activeSlideIndex,slideCount:this.story.slidesCount,click:()=>{e.navigationController.navigate()}}))}}var Tn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Rn extends Sn{constructor(e,t){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.type="QuizWidget"}init(e){return Tn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-quiz");try{if(!this.firstElement)return;this.slideApi.WidgetQuiz.initWidget(this.firstElement)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetQuiz.refreshUserData(this.elements)}select(e){this.slideApi.WidgetQuiz.select(e)}slideQuizIsDone(e){return this.slideApi.WidgetQuiz.slideQuizIsDone(e)}click(e){e.target.classList.contains("narrative-element-quiz-next-button")?this.handleNextButton(e):e.target.classList.contains("narrative-element-quiz-answer")?this.handleAnswer(e):this.handleQuizIsDone(e)}handleQuizIsDone(e){this.slideQuizIsDone(this.firstElement)||e.navigationController.disableNextClick()}handleNextButton(e){this.story.nextSlide(),e.navigationController.preventDefault()}handleAnswer(e){this.select(e.target),e.navigationController.preventDefault()}}var Dn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Bn extends Sn{constructor(e,t){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.type="QuizGroupedWidget"}init(e){return Dn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-quiz-grouped");try{if(!this.firstElement)return;this.slideApi.WidgetQuizGrouped.initWidget(this.firstElement)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetQuizGrouped.refreshUserData(this.elements)}select(e){this.slideApi.WidgetQuizGrouped.select(e)}slideQuizIsDone(e){return this.slideApi.WidgetQuizGrouped.slideQuizIsDone(e)}click(e){e.target.classList.contains("narrative-element-quiz-next-button")?this.handleNextButton(e):e.target.classList.contains("narrative-element-quiz-answer")?this.handleAnswer(e):this.handleQuizIsDone(e)}handleNextButton(e){this.story.nextSlide(),e.navigationController.preventDefault()}handleQuizIsDone(e){this.slideQuizIsDone(this.firstElement)||e.navigationController.disableNextClick()}handleAnswer(e){this.select(e.target),e.navigationController.preventDefault()}}var Nn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Fn extends Sn{constructor(e,t){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.type="RangeSliderWidget",this.disableSwipeGesture=this.disableSwipeGesture.bind(this),this.enableSwipeGesture=this.enableSwipeGesture.bind(this)}init(e){return Nn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-range-slider"),this.slideContent=e;try{if(!this.firstElement)return;this.slideApi.WidgetRangeSlider.initWidget(this.firstElement),this.registerMouseAndTouchEvents()}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetRangeSlider.refreshUserData(this.elements)}click(e){e.target.classList.contains("rangeslider")?this.handleClickSlider(e):e.target.classList.contains("narrative-element-range-slider-next-button")?this.handleClickSliderNextButton(e):this.handleCaptureClick(e)}isClickCapturedBySlider(e){return this.slideApi.WidgetRangeSlider.isClickCapturedBySlider(e)}destroy(){this.unregisterMouseAndTouchEvents()}handleClickSlider(e){e.navigationController.preventDefault()}handleCaptureClick(e){this.isClickCapturedBySlider(this.firstElement)&&e.navigationController.preventDefault()}handleClickSliderNextButton(e){this.slideApi.WidgetRangeSlider.click(e.target),e.navigationController.preventDefault()}disableSwipeGesture(e){this.touchController.disable()}enableSwipeGesture(e){this.touchController.enable()}registerMouseAndTouchEvents(){this.slideContent.addEventListener("mouseup",this.enableSwipeGesture),this.slideContent.addEventListener("touchend",this.enableSwipeGesture),this.slideContent.addEventListener("mousedown",this.disableSwipeGesture),this.slideContent.addEventListener("touchstart",this.disableSwipeGesture)}unregisterMouseAndTouchEvents(){var e,t,i,r;null===(e=this.slideContent)||void 0===e||e.removeEventListener("mouseup",this.enableSwipeGesture),null===(t=this.slideContent)||void 0===t||t.removeEventListener("touchend",this.enableSwipeGesture),null===(i=this.slideContent)||void 0===i||i.removeEventListener("mousedown",this.disableSwipeGesture),null===(r=this.slideContent)||void 0===r||r.removeEventListener("touchstart",this.disableSwipeGesture)}}var Wn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Vn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="RateWidget"}init(e){return Wn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-rate");try{this.slideApi.WidgetRate.initWidget(this.elements)}catch(e){console.error(e)}}))}click(e){e.target.classList.contains("narrative-element-rate-input")&&(this.select(e.target),e.navigationController.preventDefault())}refreshUserData(){this.elements&&this.slideApi.WidgetRate.refreshUserData(this.elements)}select(e){this.slideApi.WidgetRate.select(e)}setUserData(e,t=""){this.slideApi.WidgetRate.setUserData(e,t)}}var zn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Un extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"slideContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.type="ShareWidget",this.handleShareComplete=this.handleShareComplete.bind(this)}init(e){return zn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-share"),this.slideContent=e;const t=e.querySelectorAll(".narrative-slide.narrative-multi-slide");try{this.registerEvents(),this.slideApi.WidgetShare.initWidget(this.elements,Array.from(t))}catch(e){console.error(e)}}))}complete(e,t){this.slideApi.WidgetShare.complete(e,t)}refreshUserData(){this.elements&&this.slideApi.WidgetShare.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetShare.click(e.target),e.navigationController.preventDefault())}destroy(){this.unregisterEvents()}registerEvents(){qt.on(`${Un.name}.shareComplete`,this.handleShareComplete)}unregisterEvents(){qt.off(`${Un.name}.shareComplete`,this.handleShareComplete)}handleShareComplete({shareId:e,result:t}){dt(`[Share Widget]: share complete, { shareId, result }: ${e}, ${t}}`),this.complete(e,t)}}var Gn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class $n extends Sn{constructor(e,t){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.type="TestWidget"}init(e){return Gn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-test");try{if(!this.firstElement)return;this.slideApi.WidgetTest.initWidget(this.firstElement)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetTest.refreshUserData(this.elements)}select(e){this.slideApi.WidgetTest.select(e)}slideTestIsDone(e){return this.slideApi.WidgetTest.slideTestIsDone(e)}slideTestWithTimer(e){return this.slideApi.WidgetTest.slideTestWithTimer(e)}click(e){e.target.classList.contains("narrative-element-test-next-button")?this.handleNextButton(e):e.target.classList.contains("narrative-element-test-answer")?this.handleAnswer(e):this.handleTestIsDone(e)}handleNextButton(e){this.story.nextSlide(),e.navigationController.preventDefault()}handleAnswer(e){this.select(e.target),e.navigationController.preventDefault()}handleTestIsDone(e){const t=this.slideTestIsDone(this.firstElement);!this.slideTestWithTimer(this.firstElement)||t?t||e.navigationController.disableNextClick():e.navigationController.preventDefault()}}var Hn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class qn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="VoteWidget"}init(e){return Hn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-vote");try{if(!this.firstElement)return;this.slideApi.WidgetVote.initWidget(this.firstElement);const e="narrative-element-quiz-next-button",t=this.firstElement.querySelector(`.${e}`);t&&t.classList.remove(e)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetVote.refreshUserData(this.elements)}select(e){this.slideApi.WidgetVote.select(e)}click(e){if(e.target.classList.contains("narrative-element-vote-next-button")){if(!this.slideApi.WidgetVote.click(e.target))return void e.navigationController.preventDefault()}e.target.classList.contains("narrative-element-vote-answer")&&(this.slideApi.WidgetVote.select(e.target),e.navigationController.preventDefault())}}var Qn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Kn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="BarcodeWidget"}init(e){return Qn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-barcode");try{this.slideApi.WidgetBarcode.initWidget(this.elements)}catch(e){console.error(e)}}))}refreshUserData(){this.elements&&this.slideApi.WidgetBarcode.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetBarcode.click(e.target),e.navigationController.preventDefault())}}var Yn=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Zn extends Sn{constructor(e){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),this.type="MultiSlideWidget"}init(e){return Yn(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-slide.narrative-multi-slide");try{if(!this.elements.length)return;this.slideApi.WidgetMultiSlide.init(Array.from(this.elements))}catch(e){console.error(e)}}))}click(){}destroy(){}}var Jn,Xn=S(2743),es=S.n(Xn);!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.TouchMoveHorizontal="touchMoveHorizontal",e.TouchMoveVertical="touchMoveVertical",e.LongTouchDetected="longTouchDetected"}(Jn||(Jn={}));class ts{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 is{constructor(e,t,i,r){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:i}),Object.defineProperty(this,"dy",{enumerable:!0,configurable:!0,writable:!0,value:r})}}class rs extends(i()){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 ts(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}}),e&&(this.options=es()(this.options,e)),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}get isSwiping(){return this._isSwiping}get horizontalSwipeGesture(){return this._horizontalSwipeGesture}get verticalSwipeGesture(){return this._verticalSwipeGesture}enable(){this.enabled=!0}disable(){this.enabled=!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){e.stopPropagation(),this.enabled&&!this.touched&&(this.touched=!0,this.clearTouchStartTimeout(),this.startPoint=this.getPointByEvent(e),this.emit(Jn.TouchStart,new is(this.startPoint.x,this.startPoint.y,0,0)),this.startTouchStartTimer(this.startPoint))}handleTouchMove(e){if(!this.touched)return;const t=this.getPointByEvent(e),i=this.getDeltaPoint(t),r=new is(t.x,t.y,i.x,i.y);this.isThresholdExceed(i)&&(this._isSwiping=!0),this._isSwiping&&(this.emit(Jn.TouchMove,r),this.determineSwipeGestureDirection(i),this.handleHorizontalSwipeGesture(r),this.handleVerticalSwipeGesture(r))}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(),e.stopPropagation(),this.clearTouchStartTimeout();const t=this.getPointByEvent(e),i=this.getDeltaPoint(t);this.emit(Jn.TouchEnd,new is(t.x,t.y,i.x,i.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(Jn.LongTouchDetected,e)}),this.options.touchStartTimeout))}getPointByEvent(e){if(e instanceof TouchEvent){const t=e.changedTouches[0];return new ts(t.pageX,t.pageY)}return new ts(e.pageX,e.pageY)}getDeltaPoint(e){const t=e.x-this.startPoint.x,i=e.y-this.startPoint.y;return new ts(t,i)}determineSwipeGestureDirection(e){Math.abs(e.x)>Math.abs(e.y)?this._verticalSwipeGesture||(this._horizontalSwipeGesture=!0):this._horizontalSwipeGesture||(this._verticalSwipeGesture=!0)}handleVerticalSwipeGesture(e){this._verticalSwipeGesture&&this.emit(Jn.TouchMoveVertical,e)}handleHorizontalSwipeGesture(e){this._horizontalSwipeGesture&&this.emit(Jn.TouchMoveHorizontal,e)}reset(){this._isSwiping=!1,this.touched=!1,this._isLongTouch=!1,this._horizontalSwipeGesture=!1,this._verticalSwipeGesture=!1}}class ns{constructor(e){let t;Object.defineProperty(this,"timeout_id",{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,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getMountPoint",{enumerable:!0,configurable:!0,writable:!0,value:()=>document.body}),this.timeout_id=null,this.duration=3e3,this.content="",this.position="bottom",e&&"object"==typeof e&&(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.content&&(this.content=e.content),e.getMountPoint&&(this.getMountPoint=e.getMountPoint),e.position&&(t=e.position.toLowerCase(),this.position="top"===t||"bottom"===t?t:"bottom"),this.show())}show(){var e;if(!this.content)return!1;this.timeout_id&&clearTimeout(this.timeout_id);const t=document.getElementById("toast_container");t&&(null===(e=t.parentNode)||void 0===e||e.removeChild(t));const i=document.createElement("div");i.setAttribute("id","toast_container"),i.setAttribute("class","toast_fadein");const r=document.createElement("div");r.setAttribute("id","toast"),i.appendChild(r);const n=document.createElement("span");return n.innerHTML=this.content,r.appendChild(n),this.getMountPoint().appendChild(i),this.timeout_id=window.setTimeout(this.hide,this.duration),!0}hide(){const e=document.getElementById("toast_container");if(!e)return!1;function t(){var e;const t=document.getElementById("toast_container");if(!t)return!1;null===(e=t.parentNode)||void 0===e||e.removeChild(t)}return this.timeout_id&&clearTimeout(this.timeout_id),e.className+=" toast_fadeout",e.addEventListener("webkitAnimationEnd",t),e.addEventListener("animationEnd",t),e.addEventListener("msAnimationEnd",t),e.addEventListener("oAnimationEnd",t),!0}}var ss=S(2784),as=S.n(ss);class os{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:as()((()=>{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(),i="ltr"===this.slider.dir?1:-1;t.scrollLeft=i*e.x,t.scrollTop=e.y}scrollWithAnimation(e,t){const i=this.slider.getElementRef(),r="ltr"===this.slider.dir?1:-1;i.scrollTo({left:r*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 ls{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:as()((()=>{this.isAnimating=!1,this.slider.notifyScrollEnd()}),200)}),Object.defineProperty(this,"debouncedTryMouseWheelEndScroll",{enumerable:!0,configurable:!0,writable:!0,value:as()((()=>{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,Xi),e.addEventListener("touchstart",this.handleMouseDown,Xi)}scrollTo(e){const t=this.slider.getElementRef(),i="ltr"===this.slider.dir?1:-1;t.scrollLeft=i*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 i=this.slider.getElementRef(),r="ltr"===this.slider.dir?1:-1;i.scrollTo({left:r*e.x,top:e.y,behavior:"smooth"})}stopAnimation(){}destroy(){const e=this.slider.getElementRef();e.removeEventListener("mousedown",this.handleMouseDown,Xi),e.removeEventListener("touchstart",this.handleMouseDown,Xi),e.removeEventListener("mouseup",this.handleMouseUp,Xi),e.removeEventListener("touchend",this.handleMouseUp,Xi),e.removeEventListener("mousemove",this.handleMouseMove,Xi),e.removeEventListener("touchmove",this.handleMouseMove,Xi),e.removeEventListener("scroll",this.handleScroll)}handleMouseDown(e){this.pushed=!0,this.isDragging=!1;const{clientX:t,clientY:i}=this.extractPointerPosition(e);this.lastClientX=t,this.lastClientY=i,window.addEventListener("mouseup",this.handleMouseUp,Xi),window.addEventListener("touchend",this.handleMouseUp,Xi),window.addEventListener("mousemove",this.handleMouseMove,Xi),window.addEventListener("touchmove",this.handleMouseMove,Xi)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.slider.notifyScrollEnd(),window.removeEventListener("mouseup",this.handleMouseUp,Xi),window.removeEventListener("touchend",this.handleMouseUp,Xi),window.removeEventListener("mousemove",this.handleMouseMove,Xi),window.removeEventListener("touchmove",this.handleMouseMove,Xi))}handleMouseMove(e){if(!this.pushed)return;const{clientX:t,clientY:i}=this.extractPointerPosition(e),r=t-this.lastClientX,n=i-this.lastClientY;this.lastClientX=t,this.lastClientY=i;const{x:s,y:a}=this.slider.preparePosition(this.slider.getCurrentPosition().x-r,this.slider.getCurrentPosition().y-n);!this.isDragging&&(Math.abs(r)>=1||Math.abs(n)>=1)&&(this.isDragging=!0),this.isDragging&&this.scrollTo({x:s,y:a})}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 ds;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(ds||(ds={}));class cs extends t.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:ds.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:"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 i=this.preparePosition(e,e);this.isTheSamePosition(i.x,i.y)||(t>0?this.scrollStrategy.scrollWithAnimation(i,t):this.scrollStrategy.scrollTo(i))}isHorizontal(){return this.direction===ds.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 i={x:e,y:t};return this.isHorizontal()?i.y=0:i.x=0,this.attractToBounds(i.x,i.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 i=e+this.slider.clientWidth>=Math.max(this.slider.scrollWidth-1,0),r=t+this.slider.clientHeight>=Math.max(this.slider.scrollHeight-1,0);this._reachStart=e<=0&&t<=0,this._reachEnd=this.isHorizontal()?i:r,this.emit("reachStart",this._reachStart),this.emit("reachEnd",this._reachEnd)}setTextDirection(e){this._dir=e}scrollBySlideIndex(e,t){this.isHorizontal()?this.scrollTo(this.slides[e].offsetLeft,t):this.scrollTo(this.slides[e].offsetTop,t)}scrollByDirection(e,t){const{x:i,y:r}=this.getCurrentPosition(),n=this.isHorizontal()?i:r,s=this.getSlidesPerView(),a=this.getStoryWidth(),o=this.getStoryHeight(),l=n+e*s*(this.isHorizontal()?a:o);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))}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 ls(this):new os(this)}}const us=45,hs=350,ps="linear",fs=1.6,gs=2*Math.tan(us*Math.PI/360),vs=hs/1e3;class ms{constructor(e){Object.defineProperty(this,"slider",{enumerable:!0,configurable:!0,writable:!0,value:e}),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 currentAngle(){return this._currentAngle}get perspective(){return 0}get depth(){return 0}startMove(){this.newAngle=0,this.angleDelta=0,this.normalizedShift=0,this.movementStartAt=Date.now()}move(e){this.normalizedShift=e/this.slider.clientWidth*fs,this.newAngle=this._currentAngle+this.normalizedShift*us,this.angleDelta=this.newAngle-this._currentAngle}endMove(){if(!this.normalizedShift)return;let e=Math.round(this.angleDelta/us);e=this.limitByFastMovement(e),e=this.limitBySliderEdges(e),this.slider.emit("touchEnd",e)}limitByFastMovement(e){return this.isFastMovement(e)?this.normalizedShift<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}}const bs=.05;class ys extends ms{init(){this._currentAngle=this.slider.currentIndex*us}transform(e){const t=this.slider.leftElement,i=this.slider.rightElement,r=this.slider.frontElement;null==t||t.style.setProperty("transform",`translateZ(0) translateX(${-100*(.1- -1*e/10)}%) scale(${Math.min(.9+-1*e/10,1)})`),null==i||i.style.setProperty("transform",`translateZ(0) translateX(${100*(1-e)}%)`),null==r||r.style.setProperty("transform",`translateZ(0) translateX(${e<=0?-100*e:-100*(0- -1*e/10)}%) scale(${e<=0?1:1+-1*e/10})`)}move(e){super.move(e),this.normalizedShift=this.applyBoundsConstraint(this.normalizedShift),this.transform(this.normalizedShift)}getCSSStyle(e,t){return{display:Math.abs(e-t)<=1?"block":"none",transition:"inherit",transform:`translateZ(0) translateX(${0===e?-10:-100*t+100*e}%) scale(${0===e?.9:1})`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=bs&&this.slider.isEnd?bs:e<=-.05&&this.slider.isBeginning?-.05:e:e}}const ws=.05;class Ss extends ms{init(){this._currentAngle=this.slider.currentIndex*us}transform(e){const t=this.slider.leftElement,i=this.slider.rightElement,r=this.slider.frontElement;null==t||t.style.setProperty("transform",`translateZ(0) translateX(${-100*(1+e)}%)`),null==i||i.style.setProperty("transform",`translateZ(0) translateX(${100*(1-e)}%)`),null==r||r.style.setProperty("transform",`translateZ(0) translateX(${-100*e}%)`)}move(e){super.move(e),this.normalizedShift=this.applyBoundsConstraint(this.normalizedShift),this.transform(this.normalizedShift)}getCSSStyle(e,t){return{display:Math.abs(e-t)<=1?"block":"none",transition:"inherit",transform:`translateZ(0) translateX(${-100*t+100*e}%)`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=ws&&this.slider.isEnd?ws:e<=-.05&&this.slider.isBeginning?-.05:e:e}}var _s=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class xs extends ms{get perspective(){return this.slider.clientWidth*fs}get depth(){return this.slider.clientWidth/gs}init(){this.transform(this.slider.currentIndex)}transform(e){return _s(this,void 0,void 0,(function*(){this._currentAngle=this._currentAngle+e*us,this.slider.setTransform(`rotateY(${-this._currentAngle}deg)`)}))}move(e){super.move(e),this.newAngle=this.applyBoundsConstraint(this.angleDelta),this.slider.setTransform(`rotateY(${-this.newAngle}deg)`)}getCSSStyle(e,t){return{display:Math.abs(e-t)<=1?"block":"none",transition:"",transform:"rotateY("+e*us+`deg) translateZ(${this.depth}px)`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=5&&this.slider.isEnd?this._currentAngle+5:e<=-5&&this.slider.isBeginning?this._currentAngle-5:this.newAngle:this.newAngle}}class Os{static create(e,t){switch(t){case C.FLAT:return new Ss(e);case C.COVER:return new ys(e);case C.CUBE:return new xs(e);default:return new Ss(e)}}}var ks=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Cs=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Ms=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},Ps=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},js=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let Es=(()=>{var e,i,r,n;let s,a,o,l,d,c,u,h,p,f,g,v,m,b,y,w,S,_=t.EventEmitter,x=[],O=[],k=[],C=[],M=[],P=[],j=[];return e=class extends _{constructor(){super(...arguments),i.set(this,(ks(this,x),ks(this,O,!1))),r.set(this,(ks(this,k),ks(this,C,0))),n.set(this,(ks(this,M),ks(this,P,null))),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:ks(this,j)})}get _animating(){return Ps(this,i,"f")}set _animating(e){js(this,i,e,"f")}get _currentIndex(){return Ps(this,r,"f")}set _currentIndex(e){js(this,r,e,"f")}get effect(){return Ps(this,n,"f")}set effect(e){js(this,n,e,"f")}get clientWidth(){return this.$el.clientWidth}get animating(){return this._animating}get leftElement(){return this.$el.children.item(this._currentIndex-1)}get rightElement(){return this.$el.children.item(this._currentIndex+1)}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 i,r;return null!==(r=null===(i=this.effect)||void 0===i?void 0:i.getCSSStyle(e,t))&&void 0!==r?r:{}}init({$el:e,transformStyle:t}){this.$el=e,this.effect=Os.create(this,t),this.effect.init(),this.setTransition("transform 0s"),this.updateSlidesStyle(0)}transformWithAmimation(e){return Ms(this,void 0,void 0,(function*(){this.emit("transitionStart"),this._animating=!0,this.setTransition(`transform ${vs}s ${ps}`),this.effect.transform(e),yield 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)}updateSlidesStyle(e){const t=Array.from(this.$el.children);for(let i=0;i<t.length;i++){const r=t[i],n=this.effect.getCSSStyle(i,this.currentIndex+e);r.style.display=n.display,r.style.transform=n.transform,r.style.transition=n.transition}}setTransition(e){this.$el.style.setProperty("transition",e)}waitTransitionEnd(){return new Promise((e=>{const t=i=>{Math.round(100*i.elapsedTime)/100===vs&&"transform"===i.propertyName&&(this.setTransition("transform 0s"),this.$el.removeEventListener("transitionend",t),e())};this.$el.addEventListener("transitionend",t)}))}},i=new WeakMap,r=new WeakMap,n=new WeakMap,(()=>{var t;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=_[Symbol.metadata])&&void 0!==t?t:null):void 0;s=[ee.observable],a=[ee.observable],o=[ee.observable],l=[ee.computed],d=[ee.computed],c=[ee.computed],u=[ee.computed],h=[ee.computed],p=[ee.computed],f=[ee.computed],g=[ee.computed],v=[ee.computed],m=[ee.action],b=[ee.action],y=[ee.action],w=[ee.action],S=[ee.action],Cs(e,null,s,{kind:"accessor",name:"_animating",static:!1,private:!1,access:{has:e=>"_animating"in e,get:e=>e._animating,set:(e,t)=>{e._animating=t}},metadata:i},O,k),Cs(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:i},C,M),Cs(e,null,o,{kind:"accessor",name:"effect",static:!1,private:!1,access:{has:e=>"effect"in e,get:e=>e.effect,set:(e,t)=>{e.effect=t}},metadata:i},P,j),Cs(e,null,l,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:i},null,x),Cs(e,null,d,{kind:"getter",name:"leftElement",static:!1,private:!1,access:{has:e=>"leftElement"in e,get:e=>e.leftElement},metadata:i},null,x),Cs(e,null,c,{kind:"getter",name:"rightElement",static:!1,private:!1,access:{has:e=>"rightElement"in e,get:e=>e.rightElement},metadata:i},null,x),Cs(e,null,u,{kind:"getter",name:"frontElement",static:!1,private:!1,access:{has:e=>"frontElement"in e,get:e=>e.frontElement},metadata:i},null,x),Cs(e,null,h,{kind:"getter",name:"isBeginning",static:!1,private:!1,access:{has:e=>"isBeginning"in e,get:e=>e.isBeginning},metadata:i},null,x),Cs(e,null,p,{kind:"getter",name:"isEnd",static:!1,private:!1,access:{has:e=>"isEnd"in e,get:e=>e.isEnd},metadata:i},null,x),Cs(e,null,f,{kind:"getter",name:"perspective",static:!1,private:!1,access:{has:e=>"perspective"in e,get:e=>e.perspective},metadata:i},null,x),Cs(e,null,g,{kind:"getter",name:"depth",static:!1,private:!1,access:{has:e=>"depth"in e,get:e=>e.depth},metadata:i},null,x),Cs(e,null,v,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:i},null,x),Cs(e,null,m,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:i},null,x),Cs(e,null,b,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:i},null,x),Cs(e,null,y,{kind:"method",name:"transformWithAmimation",static:!1,private:!1,access:{has:e=>"transformWithAmimation"in e,get:e=>e.transformWithAmimation},metadata:i},null,x),Cs(e,null,w,{kind:"method",name:"move",static:!1,private:!1,access:{has:e=>"move"in e,get:e=>e.move},metadata:i},null,x),Cs(e,null,S,{kind:"method",name:"endMove",static:!1,private:!1,access:{has:e=>"endMove"in e,get:e=>e.endMove},metadata:i},null,x),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();var Ls,As=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};!function(e){e.Open="open"}(Ls||(Ls={}));class Is extends Sn{constructor(e,i){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_swipeUpLinkTarget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_swipeUpElementId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"eventEmitter",{enumerable:!0,configurable:!0,writable:!0,value:new t.EventEmitter}),this.type="SwipeUpGoodsWidget",this.handleSwipeUpGesture=this.handleSwipeUpGesture.bind(this),this.handleClick=this.handleClick.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}get targetUrl(){var e;return decodeURIComponent(null!==(e=this._swipeUpLinkTarget)&&void 0!==e?e:"")}get elementId(){return this._swipeUpElementId}init(e){return As(this,void 0,void 0,(function*(){var t,i;this.slideContent=e,this.elements=e.querySelectorAll(".narrative-element-swipe-up-items"),this.firstElement&&(this._swipeUpLinkTarget=decodeURIComponent(null!==(t=this.firstElement.getAttribute("data-link-target"))&&void 0!==t?t:""),this._swipeUpElementId=null!==(i=this.firstElement.getAttribute("data-element-id"))&&void 0!==i?i:void 0,this.registerEvents())}))}click(e){}destroy(){this.unregisterEvents()}close(){var e;null===(e=this.touchController)||void 0===e||e.enable(),li(),this.setGoodsElementOpacity(1)}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}registerEvents(){var e;this.touchController.on(Jn.TouchEnd,this.handleTouchEnd),null===(e=this.firstElement)||void 0===e||e.addEventListener("click",this.handleClick)}unregisterEvents(){var e;this.touchController.off(Jn.TouchEnd,this.handleTouchEnd),null===(e=this.firstElement)||void 0===e||e.removeEventListener("click",this.handleClick)}handleClick(e){e.preventDefault(),e.stopPropagation(),this.open()}handleSwipeUpGesture(){this.open()}handleTouchEnd({dy:e}){this.touchController&&e<10&&this.touchController.verticalSwipeGesture&&this.handleSwipeUpGesture()}open(){var e;this._swipeUpLinkTarget&&this.slideContent&&this._swipeUpElementId&&(null===(e=this.touchController)||void 0===e||e.disable(),oi(),this.eventEmitter.emit(Ls.Open),this.setGoodsElementOpacity(0))}setGoodsElementOpacity(e){var t;const i=null===(t=this.slideContent)||void 0===t?void 0:t.querySelector(`[data-element-id="${this._swipeUpElementId}"]`);i&&i.style.setProperty("display",e>0?"block":"none")}}var Ts=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Rs extends Sn{constructor(e,t,i){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"linkClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_swipeUpLinkTarget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_swipeUpElementId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.type=Rs.name,this.handleSwipeUpGesture=this.handleSwipeUpGesture.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}get swipeUpLinkTarget(){return this._swipeUpLinkTarget}get swipeUpElementId(){return this._swipeUpElementId}init(e){return Ts(this,void 0,void 0,(function*(){var t,i,r;this.slideContent=e,this.elements=e.querySelectorAll(".narrative-element-swipe-up"),this.firstElement&&(this._swipeUpLinkTarget=decodeURIComponent(null!==(t=this.firstElement.getAttribute("data-link-target"))&&void 0!==t?t:""),this._swipeUpElementId=null!==(i=this.firstElement.getAttribute("data-element-id"))&&void 0!==i?i:void 0,null===(r=this.touchController)||void 0===r||r.on(Jn.TouchEnd,this.handleTouchEnd))}))}click(e){e.target.classList.contains("narrative-element-swipe-up")&&(e.navigationController.preventDefault(),this.linkClickHandler.onLinkClick({widget:this,target:e.target}))}destroy(){var e;null===(e=this.touchController)||void 0===e||e.off(Jn.TouchEnd,this.handleTouchEnd)}handleSwipeUpGesture(){if(!this._swipeUpLinkTarget||!this.slideContent||!this._swipeUpElementId)return;const e=this.slideContent.querySelector(`[data-element-id="${this._swipeUpElementId}"]`);e&&this.linkClickHandler.onLinkClick({widget:this,target:e})}handleTouchEnd({dy:e}){this.touchController&&e<10&&this.touchController.verticalSwipeGesture&&this.handleSwipeUpGesture()}}var Ds;!function(e){e[e.None=0]="None",e[e.DisableNext=1]="DisableNext",e[e.DisablePrev=2]="DisablePrev"}(Ds||(Ds={}));class Bs{constructor(e,t,i,r,n){Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"geometry",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"dir",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_mode",{enumerable:!0,configurable:!0,writable:!0,value:Ds.None}),Object.defineProperty(this,"_defaultPrevented",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_direction",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._direction=this.calcDirection()}get mode(){return this._mode}get direction(){return this._direction}get defaultPrevented(){return this._defaultPrevented||this.slide.navigationDisabled}get navigationDisabled(){return this.slide.navigationDisabled}preventDefault(){this._defaultPrevented=!0}disableNextClick(){this._mode=Ds.DisableNext}navigate(){this.direction<0?this.toPrev():this.mode!==Ds.DisableNext&&this.toNext()}toPrev(){"ltr"===this.dir?this.prevSlideOrStory():this.nextSlideOrStory()}toNext(){"ltr"===this.dir?this.nextSlideOrStory():this.prevSlideOrStory()}prevSlideOrStory(){this.slide.story.reachStart?qt.emit(`${_o.id}.showPrevStory`):this.slide.story.prevSlide()}nextSlideOrStory(){this.slide.story.reachEnd?qt.emit(`${_o.id}.showNextStory`):this.slide.story.nextSlide()}calcClickPosition(){var e;let t=0,i=0;return this.desktopMode?(t=this.geometry.calculateWidth(),i=this.event.nativeEvent.offsetX):(t=this.geometry.vw,i=this.event.nativeEvent.pageX||(null===(e=this.event.nativeEvent.touches)||void 0===e?void 0:e[0].pageX)),i/t}calcDirection(){return this.calcClickPosition()<=.3?-1:1}}var Ns;!function(e){e.Idle="idle",e.Init="init",e.StartLoading="startLoading",e.Loading="loading",e.Loaded="loaded",e.Starting="starting",e.Started="started",e.Paused="paused",e.Error="error",e.Destroyed="destroyed"}(Ns||(Ns={}));class Fs{constructor(e){Object.defineProperty(this,"animationApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"slideElement",{enumerable:!0,configurable:!0,writable:!0,value:null})}init(e){this.slideElement=e.querySelector(".narrative-slide")}start(){try{if(!this.slideElement)return;this.animationApi.start(this.slideElement,!0)}catch(e){console.error(e)}}stop(){try{if(!this.slideElement)return;this.animationApi.stop(this.slideElement,!0)}catch(e){console.error(e)}}resume(){this.slideElement&&this.animationApi.resume(this.slideElement)}pause(){this.slideElement&&this.animationApi.pause(this.slideElement)}}var Ws=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};var Vs=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},zs=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Us=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},Gs=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},$s=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let Hs=(()=>{var e,t,i;let r,n,s,a,o,l,d,c,u,h,p=[],f=[],g=[],v=[],m=[];return e=class{get _state(){return Gs(this,t,"f")}set _state(e){$s(this,t,e,"f")}get _muted(){return Gs(this,i,"f")}set _muted(e){$s(this,i,e,"f")}constructor(e,r,n,s,a){Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:(Vs(this,p),e)}),Object.defineProperty(this,"widgetManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"animationApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"layersManager",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"slideElement",{enumerable:!0,configurable:!0,writable:!0,value:a}),t.set(this,Vs(this,f,Ns.Idle)),Object.defineProperty(this,"videoManager",{enumerable:!0,configurable:!0,writable:!0,value:(Vs(this,g),null)}),Object.defineProperty(this,"narrativeAnimationContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i.set(this,Vs(this,v,!1)),Object.defineProperty(this,"_navigationDisabled",{enumerable:!0,configurable:!0,writable:!0,value:(Vs(this,m),!1)}),Object.defineProperty(this,"slideContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideContentInnerHTML",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mutex",{enumerable:!0,configurable:!0,writable:!0,value:new Ei.Mutex}),Object.defineProperty(this,"handleVideoPlaying",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.context.onSlideResume()}}),Object.defineProperty(this,"handleVideoWaiting",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.context.onSlidePause()}}),Object.defineProperty(this,"handleVideoError",{enumerable:!0,configurable:!0,writable:!0,value:()=>Us(this,void 0,void 0,(function*(){const e=yield this.mutex.acquire();try{if(this.state===Ns.Idle)return;this.context.onSlideVideoError(),this.setState(Ns.Error)}catch(e){console.error(e)}finally{e()}}))}),this.narrativeAnimationContext=new Fs(this.animationApi),this.fitNarrativeTextLines=this.fitNarrativeTextLines.bind(this)}get $el(){return this.slideContent}get widgets(){return this.widgetManager.widgets}get state(){return this._state}get muted(){return this._muted}get navigationDisabled(){return this._navigationDisabled}resume(){return Us(this,void 0,void 0,(function*(){var e;const t=yield this.mutex.acquire();try{if(this.state!==Ns.Paused)return;yield null===(e=this.videoManager)||void 0===e?void 0:e.resume(),this.narrativeAnimationContext.resume(),this.widgetManager.resume(),this.context.onSlideResume(),this.setState(Ns.Started),t()}catch(e){console.error(e)}finally{t()}}))}pause(){return Us(this,void 0,void 0,(function*(){var e;const t=yield this.mutex.acquire();try{if(this.state!==Ns.Started)return;null===(e=this.videoManager)||void 0===e||e.pause(),this.narrativeAnimationContext.pause(),this.widgetManager.pause(),this.context.onSlidePause(),this.setState(Ns.Paused),t()}finally{t()}}))}mute(){var e;this._muted=!0,null===(e=this.videoManager)||void 0===e||e.mute()}unmute(){var e;this._muted=!1,null===(e=this.videoManager)||void 0===e||e.unmute()}onClick({target:e,navigationController:t}){ka.is(e)?this.slideElement.click(e):(this.widgetManager.handleWidgetClick(e,t),t.defaultPrevented||t.navigate())}onClickLinkElement(e){this.slideElement.click(e)}reload(){return Us(this,void 0,void 0,(function*(){const e=yield this.mutex.acquire();this.setState(Ns.Idle),e()}))}init(e){return Us(this,void 0,void 0,(function*(){const t=yield this.mutex.acquire();try{if(this._state!==Ns.Idle)return;this.setState(Ns.Init),this.slideContent=e,this.slideContentInnerHTML=this.slideContent.innerHTML,this.parseNavigationDisable(),this.videoManager=this.createVideoManager(),this.narrativeAnimationContext.init(this.slideContent),this.context.onSlideInit(),yield this.initLayersAndWidgetManager(e),yield this.load()}finally{t()}}))}start(){return Us(this,void 0,void 0,(function*(){var e;const t=yield this.mutex.acquire();try{if(this.state===Ns.Idle||this.state===Ns.Started)return;this.setState(Ns.Starting),yield null===(e=this.videoManager)||void 0===e?void 0:e.start(),yield this.context.onSlideStarted(),this.narrativeAnimationContext.start(),this.setState(Ns.Started)}catch(e){console.error(e),this.setState(Ns.Error)}finally{t()}}))}stop(){return Us(this,void 0,void 0,(function*(){const e=yield this.mutex.acquire();try{if(this.state!==Ns.Started&&this.state!==Ns.Error)return;this.narrativeAnimationContext.stop(),this.widgetManager.stop(),yield this.destroyVideoManager(),this.resetSlideContentHTML(),this.context.onSlideStop(),this.setState(Ns.Idle)}catch(e){console.error(e),this.context.onSlideStop(),this.setState(Ns.Error)}finally{e()}}))}findWidgetByType(e){return this.widgetManager.findWidgetByType(e)}refreshWidgetsData(){this.widgetManager.refreshUserData()}showLayerByIndex(e){this.layersManager.showLayerByIndex(e)}initLayersAndWidgetManager(e){return Us(this,void 0,void 0,(function*(){this.layersManager.init(e,this.animationApi),yield this.widgetManager.init(this.slideContent),this.layersManager.init(e,this.animationApi)}))}resetSlideContentHTML(){this.slideContent.innerHTML=this.slideContentInnerHTML}setState(e){this._state=e,this.context.onSlideStateChanged(e)}load(){return Us(this,void 0,void 0,(function*(){var e;if(this.state!==Ns.Loaded)try{this.context.onSlideLoadStart(),this.setState(Ns.StartLoading),yield this.loadResources(),yield(e=this.slideContent,Ws(void 0,void 0,void 0,(function*(){let t=0;return new Promise((i=>{const r=()=>{t++,e.getBoundingClientRect().height>0||t>10?i():requestAnimationFrame(r)};r()}))}))),this.fitNarrativeTextLines(),this.setState(Ns.Loaded),this.context.onSlideLoadEnd()}catch(e){console.error(e),this.setState(Ns.Error)}}))}loadResources(){return Us(this,void 0,void 0,(function*(){return new Promise(((e,t)=>Us(this,void 0,void 0,(function*(){var i;let r=setTimeout((()=>{t("[IAM]: Media resources were not loaded")}),1e4);try{yield this.loadMediaResources(this.slideContent),yield this.loadFonts(),yield null===(i=this.videoManager)||void 0===i?void 0:i.load(),e()}catch(e){t(e)}finally{clearTimeout(r)}}))))}))}loadFonts(){return new Promise((e=>{"fonts"in document?document.fonts.ready&&document.fonts.ready.catch(e).finally(e):e()}))}loadMediaResources(e){return new Promise(((t,i)=>function(e,t,i){const r=function(e){return new Promise((function(t,i){if("img"===e.tagName.toLowerCase()&&e instanceof HTMLImageElement){const i=()=>{requestAnimationFrame((()=>requestAnimationFrame((()=>{t(e),e.removeEventListener("load",i)}))))};e.addEventListener("load",i),e.complete&&0!==e.naturalHeight&&requestAnimationFrame((function(){requestAnimationFrame((function(){t(e)}))}))}else t(e);e.addEventListener("error",(function(e){var t=e.target instanceof HTMLImageElement;if(e&&e.target&&t&&e.target.style){e.target.style.display="none";var r=e.target.closest(".narrative-element-image");r&&(r.style.display="none")}i(e)}))}))},n=e.querySelectorAll("img,video");let s,a=[];for(s=0;s<n.length;++s)a.push(r(n[s]));a.length,Promise.all(a).then((e=>{t()})).catch(i)}(e,t,i)))}fitNarrativeTextLines(){const e=Array.from(this.slideContent.querySelectorAll(".narrative-element-text-wrapper>.narrative-element-text-lines")).slice();nn(e,{})}parseNavigationDisable(){const e=this.slideContent.querySelector(".narrative-slide");if(!e)return!1;this._navigationDisabled="1"===e.dataset.disableNavigation}createVideoManager(){const e=bn.create(this.slideContent,this.layersManager);return e?(e.on(sn.Playing,this.handleVideoPlaying),e.on(sn.Waiting,this.handleVideoWaiting),e.on(sn.Error,this.handleVideoError),e):null}destroyVideoManager(){return Us(this,void 0,void 0,(function*(){this.videoManager&&(this.videoManager.off(sn.Playing,this.handleVideoPlaying),this.videoManager.off(sn.Waiting,this.handleVideoWaiting),this.videoManager.off(sn.Waiting,this.handleVideoError),yield this.videoManager.destroy())}))}},t=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[ee.observable],n=[ee.observable],s=[ee.computed],a=[ee.computed],o=[ee.action],l=[ee.action],d=[ee.action],c=[ee.action],u=[ee.action],h=[ee.action],zs(e,null,r,{kind:"accessor",name:"_state",static:!1,private:!1,access:{has:e=>"_state"in e,get:e=>e._state,set:(e,t)=>{e._state=t}},metadata:t},f,g),zs(e,null,n,{kind:"accessor",name:"_muted",static:!1,private:!1,access:{has:e=>"_muted"in e,get:e=>e._muted,set:(e,t)=>{e._muted=t}},metadata:t},v,m),zs(e,null,s,{kind:"getter",name:"state",static:!1,private:!1,access:{has:e=>"state"in e,get:e=>e.state},metadata:t},null,p),zs(e,null,a,{kind:"getter",name:"muted",static:!1,private:!1,access:{has:e=>"muted"in e,get:e=>e.muted},metadata:t},null,p),zs(e,null,o,{kind:"method",name:"resume",static:!1,private:!1,access:{has:e=>"resume"in e,get:e=>e.resume},metadata:t},null,p),zs(e,null,l,{kind:"method",name:"pause",static:!1,private:!1,access:{has:e=>"pause"in e,get:e=>e.pause},metadata:t},null,p),zs(e,null,d,{kind:"method",name:"mute",static:!1,private:!1,access:{has:e=>"mute"in e,get:e=>e.mute},metadata:t},null,p),zs(e,null,c,{kind:"method",name:"unmute",static:!1,private:!1,access:{has:e=>"unmute"in e,get:e=>e.unmute},metadata:t},null,p),zs(e,null,u,{kind:"method",name:"start",static:!1,private:!1,access:{has:e=>"start"in e,get:e=>e.start},metadata:t},null,p),zs(e,null,h,{kind:"method",name:"stop",static:!1,private:!1,access:{has:e=>"stop"in e,get:e=>e.stop},metadata:t},null,p),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class qs{constructor(e){Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:e})}handle(e){this.storyReader.close()}}class Qs{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})}handle(e){const t=e.linkTarget;this.emitWidgetLinkEvent(t,e),this.activeStory.markAsOpened(),qt.emit(ki.TransitionFromSlide,{storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex})}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}})}}class Ks extends t.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,...i]=e.data;try{if(!Array.isArray(e.data))throw new Error(`Invalid MessageEvent data format ${e.data}`);this.emit(t,...i)}catch(e){console.error(e)}}sendMessage(e,t){var i;null===(i=this.iframe.contentWindow)||void 0===i||i.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 Ys{constructor(e,t,i){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:i})}set(e){return window.localStorage.setItem(this.key,JSON.stringify(e)),e}get(){var e;let t={};const i=lt()(this.instanceUserData)?this.instanceUserData:{};try{const i=JSON.parse(null!==(e=window.localStorage.getItem(this.key))&&void 0!==e?e:"{}");lt()(i)&&(t=i)}catch(e){console.error(e)}return es()(t,i)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class Zs{constructor(e,t){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"gameReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){const{id:t,callback:i}=JSON.parse(e),r=this.gameReaderViewModel.gameLaunch;if(!r)return;const n=new Ys(r.clientConfig.userKey,r.config.gameInstanceId,r.instanceUserData).get();this.gameCenterMessageService.sendMessage("cb",{cb:i,arguments:JSON.stringify([t,JSON.stringify(n)])})}}class Js{constructor(e,t){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"gameReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){const{gameInstanceId:t,data:i}=JSON.parse(e),r=this.gameReaderViewModel.gameLaunch;if(!r)return;const n=new Ys(r.clientConfig.userKey,r.config.gameInstanceId,r.instanceUserData).set(i);Ae.post(`game/${t}/instance-user-data`,JSON.stringify(n)).catch(console.error)}}var Xs=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};var ea=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const ta=(0,D.createEffect)((e=>ea(void 0,[e],void 0,(function*({gameInstanceId:e,gameOptions:t}){yield Te();const i={};t&&lt()(t)&&null!=t.demoMode&&(i.demoMode=Boolean(t.demoMode));const r=yield Ae.post(`game/${e}/launch?expand=config`,i);if(!r.ok)throw new Error(JSON.stringify(r.data));return r.data.clientConfig=ia(),r.data})))),ia=()=>{var e;let t=Ie.getState();const i=N.getState();return{sessionId:t.session.id,userKey:t.user_key,apiKey:i.apiKey,sdkVersion:"3.0.0",apiBaseUrl:ke.apiUrl,userAgent:je,appPackageId:i.appPackageId,deviceId:$.getState(),userId:null!==(e=i.userId)&&void 0!==e?e:"",lang:i.lang.toString(),placeholders:sc.combinedPlaceholders}};class ra{constructor(e){Object.defineProperty(this,"window",{enumerable:!0,configurable:!0,writable:!0,value:e}),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)}setScrollbar(e=this.width){this.scrollbarHidden||(this.disableOverFlow(),this.setBodyContainer(),this.setElementAttributes("body","paddingRight",(t=>t+e)),this.scrollbarHidden=!0)}resetScrollbar(){this.scrollbarHidden&&(this.resetElementAttributes("html","overflow"),this.resetElementAttributes("body","overflow"),this.resetElementAttributes("body","paddingRight"),this.resetBodyContainer(),this.scrollbarHidden=!1)}resetElementAttributes(e,t){this.window.document.querySelectorAll(e).forEach((e=>{const i=e.dataset[t];void 0===i?e.style.removeProperty(t):(delete e.dataset[t],e.style[t]=i)}))}disableOverFlow(){const e=this.window.document,t=e.documentElement.style.overflow,i=e.body.style.overflow;i&&(e.body.dataset.overflow=i),t&&(e.documentElement.dataset.overflow=t),e.body.style.overflow="hidden",e.documentElement.style.overflow="hidden"}setElementAttributes(e,t,i){const r=this.width;this.window.document.querySelectorAll(e).forEach((e=>{if(e!==this.window.document.body&&this.window.innerWidth>e.clientWidth+r)return;const n=e.style[t],s=this.window.getComputedStyle(e)[t];e.dataset[t]=n,e.style[t]=`${i(Number.parseFloat(s))}px`}))}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 na,sa,aa=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},oa=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},la=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},da=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},ca=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};!function(e){e.OpenGame="openGame"}(na||(na={})),function(e){e.Close="close",e.OpenSharePanel="openSharePanel"}(sa||(sa={}));let ua=(()=>{var e,t,i,r,n,s,a,o,l;let d,c,u,h,p,f,g,v,m,b,y,w,S,_,O,k,C,M,P,j,E,L,A,I,T,R,D=it,B=[],N=[],F=[],W=[],V=[],z=[],U=[],G=[],$=[],H=[],q=[],Q=[],K=[],Y=[],Z=[],J=[],te=[];return e=class extends D{get _isOpened(){return da(this,t,"f")}set _isOpened(e){ca(this,t,e,"f")}get _isGameInited(){return da(this,i,"f")}set _isGameInited(e){ca(this,i,e,"f")}get _isGameLoading(){return da(this,r,"f")}set _isGameLoading(e){ca(this,r,e,"f")}get _gameInstanceId(){return da(this,n,"f")}set _gameInstanceId(e){ca(this,n,e,"f")}get _gameLaunch(){return da(this,s,"f")}set _gameLaunch(e){ca(this,s,e,"f")}get _gameLaunchError(){return da(this,a,"f")}set _gameLaunchError(e){ca(this,a,e,"f")}get _closeBtnVisible(){return da(this,o,"f")}set _closeBtnVisible(e){ca(this,o,e,"f")}get _gameShouldBeShown(){return da(this,l,"f")}set _gameShouldBeShown(e){ca(this,l,e,"f")}constructor(d){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(aa(this,B),d)}),t.set(this,aa(this,N,!1)),i.set(this,(aa(this,F),aa(this,W,!1))),r.set(this,(aa(this,V),aa(this,z,!1))),n.set(this,(aa(this,U),aa(this,G,null))),s.set(this,(aa(this,$),aa(this,H,null))),a.set(this,(aa(this,q),aa(this,Q,null))),o.set(this,(aa(this,K),aa(this,Y,!1))),l.set(this,(aa(this,Z),aa(this,J,!1))),Object.defineProperty(this,"initGameRetryAttempts",{enumerable:!0,configurable:!0,writable:!0,value:(aa(this,te),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,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"dir",{enumerable:!0,configurable:!0,writable:!0,value:"ltr"}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new ra(window)}),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.handleOpenGameCenterEvent=this.handleOpenGameCenterEvent.bind(this),document.addEventListener("visibilitychange",this.handleVisibilityChange),qt.on(na.OpenGame,this.handleOpenGameCenterEvent),qt.on(`${e.id}.openGame`,this.handleOpenGameCenterEvent),this.storyManager.setViewModel(e.id,this)}get closeBtnVisible(){return this._closeBtnVisible}get isGameLoading(){return this._isGameLoading}get isGameInited(){return this._isGameInited}get gameLaunchError(){return this._gameLaunchError}get gameLaunch(){return this._gameLaunch}get gameInstanceId(){return this._gameInstanceId}get isOpened(){return this._isOpened}get gameShouldBeShown(){return this._gameShouldBeShown}get isWidescreen(){var e,t;return this.desktopMode&&(null===(t=null===(e=this.gameLaunch)||void 0===e?void 0:e.screenOptions.widescreen)||void 0===t||t)}openGame(e,t){return la(this,void 0,void 0,(function*(){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,yield this.launchGameById(e),this.scrollbarHelper.setScrollbar()}))}closeGame(){return la(this,void 0,void 0,(function*(){var e;return!!this._isOpened&&(this._isGameInited?null===(e=this.gameCenterMessageService)||void 0===e||e.closeGameReader():this.handleGameComplete({}),!0)}))}reload(){this._gameLaunch=null,this.gameInstanceId?this.launchGameById(this.gameInstanceId):console.error("The game instance ID is undefined")}sendGameCenterEventByApiRequest(e,t){var i;null===(i=this.gameCenterMessageService)||void 0===i||i.sendGameCenterEventByApiRequest(e,t)}setSafeAreaInsets(e){this.safeAreaInsets=e}setDesktopMode(e){this.desktopMode=e}setGameCenterIframe(e){var t;if(!this._gameLaunch)throw new Error("GameCenter iframe setup error");if(this._isGameInited)return;null===(t=this.gameCenterMessageService)||void 0===t||t.destroy();const i=new URL(this._gameLaunch.url).origin;this.gameCenterMessageService=new Ks(e,i),this.initGameCenter(this.gameCenterMessageService,this._gameLaunch)}pauseGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.pauseGameUI()}resumeGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.resumeGameUI()}confirmSharingComplete({shareId:e,isSuccess:t}){var i;null===(i=this.gameCenterMessageService)||void 0===i||i.shareComplete(e,t)}notifyGameCanBeStarted(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.notifyGameCanBeStarted()}destroy(){var t;null===(t=this.gameCenterMessageService)||void 0===t||t.destroy(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),qt.off(na.OpenGame,this.handleOpenGameCenterEvent),this.storyManager.deleteViewModel(e.id)}launchGameById(e){return la(this,void 0,void 0,(function*(){try{this._gameLaunchError=null,this._isGameLoading=!0,this._gameLaunch=yield ta({gameInstanceId:e,gameOptions:this.openGameOptions})}catch(e){this._gameLaunchError=e}}))}initGameCenter(e,t){var i;this.handleGameCenterEvents(e);const r=this.getGameConfig(t);null===(i=this.gameCenterMessageService)||void 0===i||i.initGame(r)}getGameConfig(e){const t=e.screenOptions;return es()(e.config,{clientConfig:Object.assign({fullScreen:!1,screenOrientation:t.orientation,safeAreaInsets:this.safeAreaInsets,widescreen:this.isWidescreen,dir:this.dir,nonce:X(),sdkFeatures:{gameShouldForegroundCallback:!0}},e.clientConfig)})}handleGameCenterEvents(e){e.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 t={share:new ga(e,this,this.desktopMode),storySetLocalData:new ba,storyGetLocalData:new ma(e,this),gameInstanceGetLocalData:new Zs(e,this),gameInstanceSetLocalData:new Js(e,this)};for(const[i,r]of Object.entries(t))e.on(i,((...e)=>r.handle(...e)))}handleGameShouldBeShown(e){this._gameShouldBeShown=!0;const t=JSON.parse(e);lt()(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._gameLaunch=null}startGame(){this.storyManager.emit("startGame",{id:this.gameInstanceId})}handleVisibilityChange(){"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}handleGameComplete(e,t,i,r,n){var s;this.scrollbarHelper.resetScrollbar(),this.completeGame(),null===(s=this.gameCenterMessageService)||void 0===s||s.destroy(),this.emitGameCompleteEventByStoryManager(e),(null==n?void 0:n.id)&&this.openGame(n.id,{}),(null==r?void 0:r.id)&&this.storyManager.showStory(r.id),this.emit(sa.Close),li()}emitGameCompleteEventByStoryManager(e){Nr()(e)?this.storyManager.emit("closeGame",{id:this.gameInstanceId}):this.storyManager.emit("finishGame",{id:this.gameInstanceId,result:e})}handleSendApiRequest(e){return la(this,void 0,void 0,(function*(){let t,i,r;try{const n=JSON.parse(e);t=n.id,i=n.data,r=n.cb,yield Ae.request({url:n.url,method:n.method,params:n.params,data:n.data,headers:n.headers}).catch(console.error),this.sendGameCenterEventByApiRequest(r,JSON.stringify({requestId:t,data:JSON.stringify(i.data),status:i.status,headers:i.headers}))}catch(e){if(e instanceof SyntaxError)return;if(!r)return;this.sendGameCenterEventByApiRequest(r,JSON.stringify({requestId:t,data:JSON.stringify(e),status:400,headers:[{}]}))}}))}handleOpenUrl(e){const{url:t}=JSON.parse(e);this.storyManager.clickOnButtonAction({src:x.GAME_READER,payload:{url:t,gameInstanceId:this.gameInstanceId}})}handleGameEvent(e,t){this.storyManager.emit("gameEvent",{name:e,payload:t})}handleReloadGameReader(){const e=this._gameLaunch;this._gameLaunch=null,setTimeout((0,ee.action)((()=>{this._gameLaunch=e})))}handleGameLoadFailed(e,t){this.gameLaunch&&t&&this.initGameRetryAttempts<this.gameLaunch.canTryReloadCount?(this.initGameRetryAttempts++,this.handleReloadGameReader()):this._gameLaunchError=new Error(e)}handleOpenGameCenterEvent(e){return la(this,arguments,void 0,(function*({gameId:e}){yield this.openGame(e,{}),oi()}))}},t=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,(()=>{var t;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=D[Symbol.metadata])&&void 0!==t?t:null):void 0;d=[ee.observable],c=[ee.observable],u=[ee.observable],h=[ee.observable],p=[ee.observable],f=[ee.observable],g=[ee.observable],v=[ee.observable],m=[ee.computed],b=[ee.computed],y=[ee.computed],w=[ee.computed],S=[ee.computed],_=[ee.computed],O=[ee.computed],k=[ee.computed],C=[ee.computed],M=[ee.action],P=[ee.action],j=[ee.action],E=[ee.action],L=[ee.action],A=[ee.action],I=[ee.action],T=[ee.action],R=[ee.action],oa(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:i},N,F),oa(e,null,c,{kind:"accessor",name:"_isGameInited",static:!1,private:!1,access:{has:e=>"_isGameInited"in e,get:e=>e._isGameInited,set:(e,t)=>{e._isGameInited=t}},metadata:i},W,V),oa(e,null,u,{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:i},z,U),oa(e,null,h,{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:i},G,$),oa(e,null,p,{kind:"accessor",name:"_gameLaunch",static:!1,private:!1,access:{has:e=>"_gameLaunch"in e,get:e=>e._gameLaunch,set:(e,t)=>{e._gameLaunch=t}},metadata:i},H,q),oa(e,null,f,{kind:"accessor",name:"_gameLaunchError",static:!1,private:!1,access:{has:e=>"_gameLaunchError"in e,get:e=>e._gameLaunchError,set:(e,t)=>{e._gameLaunchError=t}},metadata:i},Q,K),oa(e,null,g,{kind:"accessor",name:"_closeBtnVisible",static:!1,private:!1,access:{has:e=>"_closeBtnVisible"in e,get:e=>e._closeBtnVisible,set:(e,t)=>{e._closeBtnVisible=t}},metadata:i},Y,Z),oa(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:i},J,te),oa(e,null,m,{kind:"getter",name:"closeBtnVisible",static:!1,private:!1,access:{has:e=>"closeBtnVisible"in e,get:e=>e.closeBtnVisible},metadata:i},null,B),oa(e,null,b,{kind:"getter",name:"isGameLoading",static:!1,private:!1,access:{has:e=>"isGameLoading"in e,get:e=>e.isGameLoading},metadata:i},null,B),oa(e,null,y,{kind:"getter",name:"isGameInited",static:!1,private:!1,access:{has:e=>"isGameInited"in e,get:e=>e.isGameInited},metadata:i},null,B),oa(e,null,w,{kind:"getter",name:"gameLaunchError",static:!1,private:!1,access:{has:e=>"gameLaunchError"in e,get:e=>e.gameLaunchError},metadata:i},null,B),oa(e,null,S,{kind:"getter",name:"gameLaunch",static:!1,private:!1,access:{has:e=>"gameLaunch"in e,get:e=>e.gameLaunch},metadata:i},null,B),oa(e,null,_,{kind:"getter",name:"gameInstanceId",static:!1,private:!1,access:{has:e=>"gameInstanceId"in e,get:e=>e.gameInstanceId},metadata:i},null,B),oa(e,null,O,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:i},null,B),oa(e,null,k,{kind:"getter",name:"gameShouldBeShown",static:!1,private:!1,access:{has:e=>"gameShouldBeShown"in e,get:e=>e.gameShouldBeShown},metadata:i},null,B),oa(e,null,C,{kind:"getter",name:"isWidescreen",static:!1,private:!1,access:{has:e=>"isWidescreen"in e,get:e=>e.isWidescreen},metadata:i},null,B),oa(e,null,M,{kind:"method",name:"openGame",static:!1,private:!1,access:{has:e=>"openGame"in e,get:e=>e.openGame},metadata:i},null,B),oa(e,null,P,{kind:"method",name:"closeGame",static:!1,private:!1,access:{has:e=>"closeGame"in e,get:e=>e.closeGame},metadata:i},null,B),oa(e,null,j,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:i},null,B),oa(e,null,E,{kind:"method",name:"setDesktopMode",static:!1,private:!1,access:{has:e=>"setDesktopMode"in e,get:e=>e.setDesktopMode},metadata:i},null,B),oa(e,null,L,{kind:"method",name:"handleGameShouldBeShown",static:!1,private:!1,access:{has:e=>"handleGameShouldBeShown"in e,get:e=>e.handleGameShouldBeShown},metadata:i},null,B),oa(e,null,A,{kind:"method",name:"handleGameLoaded",static:!1,private:!1,access:{has:e=>"handleGameLoaded"in e,get:e=>e.handleGameLoaded},metadata:i},null,B),oa(e,null,I,{kind:"method",name:"handleGameComplete",static:!1,private:!1,access:{has:e=>"handleGameComplete"in e,get:e=>e.handleGameComplete},metadata:i},null,B),oa(e,null,T,{kind:"method",name:"handleReloadGameReader",static:!1,private:!1,access:{has:e=>"handleReloadGameReader"in e,get:e=>e.handleReloadGameReader},metadata:i},null,B),oa(e,null,R,{kind:"method",name:"handleGameLoadFailed",static:!1,private:!1,access:{has:e=>"handleGameLoadFailed"in e,get:e=>e.handleGameLoadFailed},metadata:i},null,B),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:"GameReaderViewModel"}),e})();class ha{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){return new ua(this.storyManager)}}var pa,fa=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(pa||(pa={}));class ga{constructor(e,t,i){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"gameReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:i})}handle(e,t){return fa(this,void 0,void 0,(function*(){var i,r,n;let s=null!==(i=null==t?void 0:t.url)&&void 0!==i?i:t.text,a=[];t.files&&Array.isArray(t.files)&&t.files.length>0&&(a=yield Promise.all(t.files.map((e=>(e=>Xs(void 0,[e],void 0,(function*({file:e,name:t,type:i}){const r=yield fetch(`data:${i};base64,${e}`),n=yield r.blob();return new File([n],t,{type:i,lastModified:(new Date).getTime()})})))(e)))));const o={url:null!=s?s:void 0,files:a.length>0?a:void 0,text:null!==(r=t.text)&&void 0!==r?r:void 0,title:null!==(n=t.title)&&void 0!==n?n:void 0};if(!(o.files&&o.files.length>0||o.url))return void this.gameReaderViewModel.confirmSharingComplete({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(o).then((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!0}))).catch((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!1})))}catch(t){console.error(t),this.openSharePanel({shareConfig:o,sharePath:s,shareId:e})}else this.openSharePanel({shareConfig:o,sharePath:s,shareId:e})}))}openSharePanel({shareConfig:e,sharePath:t,shareId:i}){let r=pa.Social,n=t;e.files&&e.files.length>0&&(r=pa.SlideScreenshot,n=URL.createObjectURL(e.files[0])),this.gameReaderViewModel.emit(sa.OpenSharePanel,{shareId:i,shareType:r,shareLink:n})}}class va{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 ma{constructor(e,t){Object.defineProperty(this,"gameCenterMessageService",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"gameReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:t})}handle(e){const t=JSON.parse(e);if(!lt()(t))return;const{id:i,storyId:r,callback:n}=t;let s=new va(r).get();this.gameCenterMessageService.sendMessage("cb",{cb:n,arguments:JSON.stringify([i,JSON.stringify(s)])})}}class ba{constructor(){}handle(e){const t=JSON.parse(e);if(!lt()(t))return;const{storyId:i,data:r,sendToServer:n}=t;new va(i).set(r),n&&Ae.request({url:"story-data/"+i,method:"put",data:JSON.stringify(r)}).catch(console.error)}}class ya{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})}handle(e){this.emitWidgetLinkEvent(e.linkTarget,e),qt.emit(na.OpenGame,{gameId:e.linkTarget})}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}})}}class wa{constructor(e){Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:e})}handle(e){this.activeStory.activeSlide.showLayerByIndex(parseInt(e.linkTarget))}}class Sa{constructor(e){Object.defineProperty(this,"activeStory",{enumerable:!0,configurable:!0,writable:!0,value:e})}handle(e){this.activeStory.redirectToSlide({slideIndex:parseInt(e.linkTarget),layerIndex:0})}}var _a=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class xa{constructor(e,t,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:i})}handle(e){return _a(this,void 0,void 0,(function*(){const t=parseInt(e.linkTarget);this.emitWidgetLinkEvent(e.linkTarget,e);try{yield this.storyReader.showStory(t,"default")}catch(e){console.error(e)}}))}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,feed:this.storyReader.feedSlug}})}}class Oa{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})}handle(e){const t=decodeURIComponent(e.linkTarget);this.emitWidgetLinkEvent(t,e),this.activeStory.markAsOpened(),qt.emit(ki.TransitionFromSlide,{storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),qt.emit("publicEvents.clickOnButton",{id:this.activeStory.id,index:this.activeStory.activeSlideIndex,url:t,elementId:e.elementId})}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}})}}class ka{constructor(e){Object.defineProperty(this,"slideElementActionFactory",{enumerable:!0,configurable:!0,writable:!0,value:e})}static is(e){return["narrative-element-link","narrative-element-image"].some((t=>e.classList.contains(t)))}click(e){const{elementId:t,linkType:i,linkTarget:r}=this.parseTargetDataset(e);if(!i)return;this.slideElementActionFactory.create(i).handle({target:e,linkTarget:r,linkType:i,elementId:t})}parseTargetDataset(e){var t,i;const r=e.dataset;return{elementId:null!==(t=r.elementId)&&void 0!==t?t:"",linkType:r.linkType,linkTarget:null!==(i=r.linkTarget)&&void 0!==i?i:""}}}class Ca{handle(e){console.log(`There is no action handler for <${e.linkType}:${e.linkTarget}>`)}}class Ma{constructor(e,t,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:i})}create(e){switch(e){case"url":return new Oa(this.storyManager,this.activeStory);case"customAction":return new Qs(this.storyManager,this.activeStory);case"slide":return new Sa(this.activeStory);case"story":return new xa(this.storyManager,this.storyReader,this.activeStory);case"game":return new ya(this.storyManager,this.activeStory);case"layer":return new wa(this.activeStory);case"closeStory":return new qs(this.storyReader);default:return new Ca}}}const Pa=.53167701863,ja=.64516129032;class Ea{constructor(e,t,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,"padding",{enumerable:!0,configurable:!0,writable:!0,value:i}),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 vhWitoutPadding(){return this._vh-this.padding.top-this.padding.bottom}getOffset(e){const t=this._vw,i=this.vhWitoutPadding-e,r=this.calculateWidthWithActionPanel(e),n=this.calculateHeightWithActionPanel(e);return this.viewportRatio>ja?Math.ceil(n-i)/2*-1+"px auto":`0 ${Math.ceil(r-t)/2*-1}px`}getOffsetX(e){const t=this.calculateWidthWithActionPanel(e);return this.viewportRatio>ja?"0px":Math.ceil(t-this._vw)/2+"px"}getOffsetY(e){const t=this.vhWitoutPadding-e;return this.viewportRatio>ja?`${Math.ceil(this.calculateHeight()-t)}px`:"0px"}getWidth(){return this.viewportRatio>ja?`${this.calculateWidth()}px`:"auto"}getHeight(){return this.viewportRatio>ja?`${this.calculateHeight()}px`:"100%"}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this.vhWitoutPadding*ja)}calculateHeight(){return Math.ceil(this.calculateWidth()/ja)}calculateWidthWithActionPanel(e){const t=this.vhWitoutPadding-e;return Math.ceil(t*ja)}calculateHeightWithActionPanel(e){return Math.ceil(this.calculateWidthWithActionPanel(e)/ja)}}class La{constructor(e,t,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,"padding",{enumerable:!0,configurable:!0,writable:!0,value:i}),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 vhWitoutPadding(){return this._vh-this.padding.top-this.padding.bottom}getOffset(e){const t=this._vw,i=this.vhWitoutPadding-e,r=this.calculateWidthWithActionPanel(e),n=this.calculateHeight();return n>i?Math.ceil(n-i)/2*-1+"px auto":`0 ${Math.ceil(r-t)/2*-1}px`}getOffsetX(e){const t=this.calculateWidthWithActionPanel(e),i=this.vhWitoutPadding-e,r=this.calculateHeight(),n=this._vw;return r>i?"0px":Math.ceil(t-n)/2+"px"}getOffsetY(e){const t=this.vhWitoutPadding-e,i=this.calculateHeight();return i>t?Math.ceil(i-t)/2+"px":"0px"}getWidth(){return this.viewportRatio>ja?`${this.calculateWidth()}px`:"auto"}getHeight(){return this.viewportRatio>ja?`${this.calculateHeight()}px`:"100%"}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return this.viewportRatio>ja?this._vw:Math.ceil(this.vhWitoutPadding*ja)}calculateHeight(){return Math.ceil(this._vw/ja)}calculateWidthWithActionPanel(e){const t=this.vhWitoutPadding-e;return this.viewportRatio>ja?this._vw:Math.ceil(t*ja)}}class Aa{constructor(e){Object.defineProperty(this,"safeAreaFrameCalculator",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(e){const t=e.vw/e.vh;return e.desktopMode&&t>ja?this.createDesktopStoryGeometry(e):this.createMobileStoryGeometry(e)}createDesktopStoryGeometry(e){return new Ea(e.vw,e.vh,{top:50,bottom:50})}createMobileStoryGeometry(e){var t,i;const{paddingTop:r,paddingBottom:n}=this.safeAreaFrameCalculator.getViewportCorrectionPadding();return new La(e.vw,e.vh,{top:null!==(t=parseFloat(r))&&void 0!==t?t:0,bottom:null!==(i=parseFloat(n))&&void 0!==i?i:0})}}class Ia{constructor(e,t,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,"actionPanelHeight",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"viewportRatio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.viewportRatio=e/t}get shouldBeShownSafeAreaInsets(){return this.viewportRatio<Pa}getViewportCorrectionPadding(){const{paddingTop:e,paddingBottom:t}=this.calcFrameWidthByMobileAspectRatio();return{paddingTop:e+"px",paddingBottom:t+"px"}}calcFrameWidthByMobileAspectRatio(){const e=this._vh-this._vw/Pa,t=Math.max(Math.min(e-this.actionPanelHeight,this.actionPanelHeight),0);return{paddingTop:Math.max(e-t,0),paddingBottom:t}}}class Ta extends t.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,"cancelAnimationFcn",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),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})}get started(){return!this.isCompleted}setTimer(e){0!==e?(this.timerId=setTimeout((()=>this.complete({})),e),this.currentProgress=0,this.cancelAnimationFcn=function(e){let t,i;if("performance"in window==0||"now"in window.performance==0){let e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),i=Date.now()-e}else i=performance.now();return t=requestAnimationFrame((function r(n){let s;if(s=(n-i)/e.duration,s>1&&(s=1),e.forceEnd()&&(s=1),!e.paused()){let i=e.timing(s);e.draw(i),s<1&&(t=requestAnimationFrame(r))}})),()=>{cancelAnimationFrame(t)}}({duration:e,timing:e=>e,draw:e=>this.updateProgress(e),paused:()=>this.timerPaused,forceEnd:()=>!1})):this.forceEnd()}start(e){this.timerPaused||(this.stop(),this.progressBeforePause=0,this.timeout=e,this.enabled&&(this.isCompleted=!1,this.emit("start"),this.setTimer(e)))}stop(){this.isCompleted||(this.clearTimer(),this.emit("stop"),this.isCompleted=!0)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit("pause"))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit("resume")}cancelAnimation(){var e;null===(e=this.cancelAnimationFcn)||void 0===e||e.call(this)}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("progress",100),this.emit("complete",{forceEnd:e})}clearTimer(){this.cancelAnimation(),null!==this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}updateProgress(e){const t=1-this.progressBeforePause;this.currentProgress=this.progressBeforePause+e*t;const i=100*this.currentProgress;this.emit("progress",i)}}var Ra,Da,Ba=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};!function(e){e.ShowInputModal="showInputModal"}(Ra||(Ra={})),function(e){e.Start="start",e.ChangeState="changeState"}(Da||(Da={}));class Na extends it{constructor(e,t,i,r){super(),Object.defineProperty(this,"_story",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_index",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storySlideRendererFactory",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideDto",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:Date.now()}),Object.defineProperty(this,"slideRenderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slideRenderer=this.storySlideRendererFactory.create({story:e,slide:this})}get $el(){return this.slideRenderer.$el}get state(){return this.slideRenderer.state}get index(){return this._index}get story(){return this._story}get muted(){return this.slideRenderer.muted}get navigationDisabled(){return this.slideRenderer.navigationDisabled}get widgets(){return this.slideRenderer.widgets}get timeline(){return this.slideDto.timeline}get duration(){return this.slideDto.duration}get screenshotShare(){return this.slideDto.screenshot_share}get html(){return this.slideDto.html}get eventPayload(){return this.slideDto.event_payload}findWidgetByType(e){return this.slideRenderer.findWidgetByType(e)}refreshWidgetsData(){this.slideRenderer.refreshWidgetsData()}showLayerByIndex(e){this.slideRenderer.showLayerByIndex(e)}resume(){return Ba(this,void 0,void 0,(function*(){return this.slideRenderer.resume()}))}pause(){return this.slideRenderer.pause()}mute(){return this.slideRenderer.mute()}unmute(){return this.slideRenderer.unmute()}reload(){return Ba(this,void 0,void 0,(function*(){return this.slideRenderer.reload()}))}init(e){return Ba(this,void 0,void 0,(function*(){return this.slideRenderer.init(e)}))}start(){return Ba(this,void 0,void 0,(function*(){return this.slideRenderer.start()}))}stop(){return this.slideRenderer.stop()}setUserData(e,t){for(const i of this.widgets)i.setUserData(e,t)}onClick(e,t){this.slideRenderer.onClick({target:e,navigationController:t})}onLinkClick(e){this.slideRenderer.onClickLinkElement(e.target)}showToast(e){new ns(Object.assign({getMountPoint:()=>this.slideRenderer.$el},e))}destroy(){}}var Fa=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Wa extends Sn{constructor(e,t){super(),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.type="StoryRepeat"}init(e){return Fa(this,void 0,void 0,(function*(){this.elements=e.querySelectorAll(".narrative-element-story-repeat")}))}click(e){e.target===this.firstElement&&(this.story.reset().catch(console.error),e.navigationController.preventDefault())}}var Va=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class za{constructor(e,t,i){Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:i})}onSlideStarted(){return Va(this,void 0,void 0,(function*(){dt(`[SLIDE][start]:${this.story.id}:${this.slide.index}`),yield this.slideApiHandlers.lock(this.slide),this.slideApiHandlers.exec(),this.story.updateNavigationHistory(),this.startTimer(),this.slide.emit(Da.Start)}))}onSlideStateChanged(e){this.changeTimelineVisibilityByState(),this.slide.emit(Da.ChangeState,e)}onSlideLoadStart(){dt(`[SLIDE][start_load]:${this.story.id}:${this.slide.index}`)}onSlideLoadEnd(){dt(`[SLIDE][end_load]:${this.story.id}:${this.slide.index}`)}onSlideResume(){this.story.resume(),dt(`[SLIDE][resume]:${this.story.id}:${this.slide.index}`)}onSlidePause(){this.story.pause(),dt(`[SLIDE][pause]:${this.story.id}:${this.slide.index}`)}onSlideInit(){this.slideApiHandlers.setInitHookStorySlide(this.slide),dt(`[SLIDE][init]:${this.story.id}:${this.slide.index}`)}onSlideStop(){this.story.timer.stop(),this.slideApiHandlers.unlock(this.slide),dt(`[SLIDE][stop]:${this.story.id}:${this.slide.index}`)}onSlideVideoError(){this.story.timer.stop()}changeTimelineVisibilityByState(){this.slide.state===Ns.Error||this.slide.state===Ns.Loading?this.story.hideTimeline():this.story.showTimeline()}startTimer(){var e;this.story.timer.started||this.story.timer.start(null!==(e=this.slide.duration)&&void 0!==e?e:0)}}class Ua{constructor(e,t,i,r,n){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,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:n})}create({story:e,slide:t}){const i=new rn(e),r=new wn,n=new ka(new Ma(this.storyManager,this.storyReader,e)),s=new Hs(new za(t,e,this.slideApiHandlers),r,this.slideApi.Animation,i,n);return this.registerWidgets({widgetManager:r,story:e,slide:t,touchController:this.touchController}),s}registerWidgets({widgetManager:e,story:t,slide:i,touchController:r}){e.registerMany([new Kn(this.slideApi),new xn(this.slideApi),new kn(this.slideApi),new Mn(this.slideApi),new Zn(this.slideApi),new jn(this.slideApi),new Ln(this.slideApi),new In(this.slideApi,t),new Rn(this.slideApi,t),new Bn(this.slideApi,t),new Fn(this.slideApi,r),new Vn(this.slideApi),new Un(this.slideApi),new Is(this.slideApi,r),new Rs(this.slideApi,r,i),new qn(this.slideApi),new $n(this.slideApi,t),new Wa(this.slideApi,t)])}}var Ga=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},$a=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Ha=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},qa=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Qa=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let Ka=(()=>{var e,t,i,r,n,s,a,o;let l,d,c,u,h,p,f,g,v,m,b,y,w,S,_,x,O,k,C,M,P,j,E,L,A,I,T,R,D,B,N,F,W,V,z,U,G=it,$=[],H=[],q=[],Q=[],K=[],Y=[],Z=[],J=[],X=[],te=[],ie=[],re=[],ne=[],se=[],ae=[];return e=class extends G{get storiesItem(){return qa(this,t,"f")}set storiesItem(e){Qa(this,t,e,"f")}get _activeSlideIndex(){return qa(this,i,"f")}set _activeSlideIndex(e){Qa(this,i,e,"f")}get _displayedSlides(){return qa(this,r,"f")}set _displayedSlides(e){Qa(this,r,e,"f")}get _hiddenTimeline(){return qa(this,n,"f")}set _hiddenTimeline(e){Qa(this,n,e,"f")}get slides(){return qa(this,s,"f")}set slides(e){Qa(this,s,e,"f")}get _like(){return qa(this,a,"f")}set _like(e){Qa(this,a,e,"f")}get _favorite(){return qa(this,o,"f")}set _favorite(e){Qa(this,o,e,"f")}constructor(e,l,d,c,u,h){super(),Object.defineProperty(this,"storyReader",{enumerable:!0,configurable:!0,writable:!0,value:(Ga(this,$),e)}),Object.defineProperty(this,"sharePanel",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"navigationHistory",{enumerable:!0,configurable:!0,writable:!0,value:u}),Object.defineProperty(this,"storySlideRendererFactory",{enumerable:!0,configurable:!0,writable:!0,value:h}),t.set(this,Ga(this,H,void 0)),i.set(this,(Ga(this,q),Ga(this,Q,0))),r.set(this,(Ga(this,K),Ga(this,Y,[]))),n.set(this,(Ga(this,Z),Ga(this,J,!1))),s.set(this,(Ga(this,X),Ga(this,te,[]))),a.set(this,(Ga(this,ie),Ga(this,re,0))),o.set(this,(Ga(this,ne),Ga(this,se,!1))),Object.defineProperty(this,"_hasShare",{enumerable:!0,configurable:!0,writable:!0,value:(Ga(this,ae),!1)}),Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:new Ta}),this.updateStoriesItem(d),this.redirectToSlide=this.redirectToSlide.bind(this),this.nextSlide=this.nextSlide.bind(this),this._hasShare=Ie.getState().share}get id(){return this.storiesItem.id}get title(){return this.storiesItem.title}get slidesLoaded(){return this.storiesItem.slidesLoaded}get like(){return this._like}get favorite(){return this._favorite}get hasLike(){return Boolean(this.storiesItem.like_functional)}get hasShare(){return!!Boolean(this.storiesItem.share_functional)&&this._hasShare}get hasFavorite(){return Boolean(this.storiesItem.favorite_functional)}get hasAudio(){return Boolean(this.storiesItem.has_audio)}get displayedSlides(){return this._displayedSlides}get activeSlideIndex(){return this._activeSlideIndex}get activeSlide(){return this.slides[this._activeSlideIndex]}get slidesCount(){var e;return null!==(e=this.storiesItem.slides_count)&&void 0!==e?e:0}get hiddenTimeline(){return 1===this.storiesItem.slides.length&&0===this.storiesItem.slides[0].duration||this.storiesItem.hide_timeline||this._hiddenTimeline||!this.slidesLoaded}get displayedSlideImage(){return this.storiesItem.blank?null:this.storiesItem.imagePerSlide(this.activeSlideIndex)}get isBlank(){return this.storiesItem.blank}get reachEnd(){return this._activeSlideIndex===this.slidesCount-1}get reachStart(){return 0===this.activeSlideIndex}get disableClose(){return this.storiesItem.disable_close}get error(){return this.storiesItem.error}get timer(){return this._timer}nextSlide(){this.reachEnd||this.toSlide(this.activeSlideIndex+1)}prevSlide(){this.reachStart||this.toSlide(this.activeSlideIndex-1)}toSlide(e){this._activeSlideIndex=e,this._displayedSlides=this.getDisplayedSlides(),this.timer.stop()}updateStoriesItem(e){this.storiesItem=e,this.slides=this.createSlidesViewModelsByDto(e.slides),this._like=this.storiesItem.like,this._favorite=this.storiesItem.favorite,this._displayedSlides=this.getDisplayedSlides()}updateNavigationHistory(){this.navigationHistory.update({currentSlideIndex:this.activeSlideIndex,currentStoryId:this.id})}setLike(e){this.updateStoryLike(e),qt.emit("publicEvents.likeStory",{id:this.id,index:this.activeSlideIndex,value:1===e})}setDislike(e){this.updateStoryLike(e),qt.emit("publicEvents.dislikeStory",{id:this.id,index:this.activeSlideIndex,value:-1===e})}setBookmark(e){return Ha(this,void 0,void 0,(function*(){const t=this.storiesItem.favorite;this.storiesItem.favorite=e,this._favorite=e;try{const t=yield zr.setBookmark(this.id,e);if(null==t.favorite)return;this.storiesItem.favorite=t.favorite,this._favorite=t.favorite,qt.emit("publicEvents.favoriteStory",{id:this.id,index:this.activeSlideIndex,value:t.favorite})}catch(e){this.storiesItem.favorite=t,this._favorite=t,console.error(e)}}))}share(){return Ha(this,void 0,void 0,(function*(){var e;qt.emit("publicEvents.shareStory",{id:this.id,index:this.activeSlideIndex}),(null===(e=this.activeSlide)||void 0===e?void 0:e.screenshotShare)?this.sharePanel.shareScreenShot({shareId:"slide-screenshot-share",hideElementsSelector:"",storySlide:this.activeSlide}):ht()?yield this.performSessionShareAction():this.performWithoutSessionShareAction()}))}markAsOpened(){this.storiesItem.isOpened||(zr.markAsOpened(this.id),this.storiesItem.isOpened=!0)}hideTimeline(){this._hiddenTimeline=!0}showTimeline(){this._hiddenTimeline=!1}reset(){return this.slideApiHandlers.resetStory(this.id)}reload(){return Ha(this,void 0,void 0,(function*(){return this.storyReader.reloadStory(this)}))}redirectToSlide({slideIndex:e,layerIndex:t}){e!==this.activeSlideIndex&&this.toSlide(e)}destroy(){}onShowLayer(e){var t;this.timer.start(null!==(t=this.activeSlide.duration)&&void 0!==t?t:0)}pause(){this.timer.pause()}resume(){this.timer.resume()}enableTimer(){this.timer.enable()}disableTimer(){this.timer.disable()}getDisplayedSlides(){return this.slidesLoaded?this.slides.slice(this._activeSlideIndex,this._activeSlideIndex+2):[new Na(this,0,this.storySlideRendererFactory,{index:0,timeline:{foreground:"",background:""},duration:0,screenshot_share:!1,html:""})]}createSlidesViewModelsByDto(e){return this.slides.length===e.length?this.slides:e.map(((e,t)=>new Na(this,t,this.storySlideRendererFactory,e)))}updateStoryLike(e){return Ha(this,void 0,void 0,(function*(){try{const t=yield zr.updateStoryLike(this.id,e);null!=t.like&&(this.storiesItem.like=t.like,this._like=t.like)}catch(e){console.error(e)}}))}performSessionShareAction(){return Ha(this,void 0,void 0,(function*(){try{const{url:e}=yield zr.getStorySharePath(this.id);if(!e)return;this.storiesItem.share_url=e,this.emitShareStoryWithPathEvent(e);const t={title:this.storiesItem.title,text:"",url:e};this.sharePanel.shareText({shareId:"story-share",config:t,storySlide:this.activeSlide})}catch(e){console.error(e)}}))}performWithoutSessionShareAction(){const e=this.storiesItem.share_url;if(!e)return;this.emitShareStoryWithPathEvent(e);const t={title:this.storiesItem.title,text:"",url:e};this.sharePanel.shareText({shareId:"story-share",config:t,storySlide:this.activeSlide})}emitShareStoryWithPathEvent(e){qt.emit("publicEvents.shareStoryWithPath",{id:this.id,index:this.activeSlideIndex,url:e})}},t=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,(()=>{var t;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=G[Symbol.metadata])&&void 0!==t?t:null):void 0;l=[ee.observable],d=[ee.observable],c=[ee.observable],u=[ee.observable],h=[ee.observable],p=[ee.observable],f=[ee.observable],g=[ee.computed],v=[ee.computed],m=[ee.computed],b=[ee.computed],y=[ee.computed],w=[ee.computed],S=[ee.computed],_=[ee.computed],x=[ee.computed],O=[ee.computed],k=[ee.computed],C=[ee.computed],M=[ee.computed],P=[ee.computed],j=[ee.computed],E=[ee.computed],L=[ee.computed],A=[ee.computed],I=[ee.computed],T=[ee.computed],R=[ee.action],D=[ee.action],B=[ee.action],N=[ee.action],F=[ee.action],W=[ee.action],V=[ee.action],z=[ee.action],U=[ee.action],$a(e,null,l,{kind:"accessor",name:"storiesItem",static:!1,private:!1,access:{has:e=>"storiesItem"in e,get:e=>e.storiesItem,set:(e,t)=>{e.storiesItem=t}},metadata:i},H,q),$a(e,null,d,{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:i},Q,K),$a(e,null,c,{kind:"accessor",name:"_displayedSlides",static:!1,private:!1,access:{has:e=>"_displayedSlides"in e,get:e=>e._displayedSlides,set:(e,t)=>{e._displayedSlides=t}},metadata:i},Y,Z),$a(e,null,u,{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:i},J,X),$a(e,null,h,{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:i},te,ie),$a(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:i},re,ne),$a(e,null,f,{kind:"accessor",name:"_favorite",static:!1,private:!1,access:{has:e=>"_favorite"in e,get:e=>e._favorite,set:(e,t)=>{e._favorite=t}},metadata:i},se,ae),$a(e,null,g,{kind:"getter",name:"id",static:!1,private:!1,access:{has:e=>"id"in e,get:e=>e.id},metadata:i},null,$),$a(e,null,v,{kind:"getter",name:"title",static:!1,private:!1,access:{has:e=>"title"in e,get:e=>e.title},metadata:i},null,$),$a(e,null,m,{kind:"getter",name:"slidesLoaded",static:!1,private:!1,access:{has:e=>"slidesLoaded"in e,get:e=>e.slidesLoaded},metadata:i},null,$),$a(e,null,b,{kind:"getter",name:"like",static:!1,private:!1,access:{has:e=>"like"in e,get:e=>e.like},metadata:i},null,$),$a(e,null,y,{kind:"getter",name:"favorite",static:!1,private:!1,access:{has:e=>"favorite"in e,get:e=>e.favorite},metadata:i},null,$),$a(e,null,w,{kind:"getter",name:"hasLike",static:!1,private:!1,access:{has:e=>"hasLike"in e,get:e=>e.hasLike},metadata:i},null,$),$a(e,null,S,{kind:"getter",name:"hasShare",static:!1,private:!1,access:{has:e=>"hasShare"in e,get:e=>e.hasShare},metadata:i},null,$),$a(e,null,_,{kind:"getter",name:"hasFavorite",static:!1,private:!1,access:{has:e=>"hasFavorite"in e,get:e=>e.hasFavorite},metadata:i},null,$),$a(e,null,x,{kind:"getter",name:"hasAudio",static:!1,private:!1,access:{has:e=>"hasAudio"in e,get:e=>e.hasAudio},metadata:i},null,$),$a(e,null,O,{kind:"getter",name:"displayedSlides",static:!1,private:!1,access:{has:e=>"displayedSlides"in e,get:e=>e.displayedSlides},metadata:i},null,$),$a(e,null,k,{kind:"getter",name:"activeSlideIndex",static:!1,private:!1,access:{has:e=>"activeSlideIndex"in e,get:e=>e.activeSlideIndex},metadata:i},null,$),$a(e,null,C,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:i},null,$),$a(e,null,M,{kind:"getter",name:"slidesCount",static:!1,private:!1,access:{has:e=>"slidesCount"in e,get:e=>e.slidesCount},metadata:i},null,$),$a(e,null,P,{kind:"getter",name:"hiddenTimeline",static:!1,private:!1,access:{has:e=>"hiddenTimeline"in e,get:e=>e.hiddenTimeline},metadata:i},null,$),$a(e,null,j,{kind:"getter",name:"displayedSlideImage",static:!1,private:!1,access:{has:e=>"displayedSlideImage"in e,get:e=>e.displayedSlideImage},metadata:i},null,$),$a(e,null,E,{kind:"getter",name:"isBlank",static:!1,private:!1,access:{has:e=>"isBlank"in e,get:e=>e.isBlank},metadata:i},null,$),$a(e,null,L,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:i},null,$),$a(e,null,A,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:i},null,$),$a(e,null,I,{kind:"getter",name:"disableClose",static:!1,private:!1,access:{has:e=>"disableClose"in e,get:e=>e.disableClose},metadata:i},null,$),$a(e,null,T,{kind:"getter",name:"error",static:!1,private:!1,access:{has:e=>"error"in e,get:e=>e.error},metadata:i},null,$),$a(e,null,R,{kind:"method",name:"toSlide",static:!1,private:!1,access:{has:e=>"toSlide"in e,get:e=>e.toSlide},metadata:i},null,$),$a(e,null,D,{kind:"method",name:"updateStoriesItem",static:!1,private:!1,access:{has:e=>"updateStoriesItem"in e,get:e=>e.updateStoriesItem},metadata:i},null,$),$a(e,null,B,{kind:"method",name:"setLike",static:!1,private:!1,access:{has:e=>"setLike"in e,get:e=>e.setLike},metadata:i},null,$),$a(e,null,N,{kind:"method",name:"setDislike",static:!1,private:!1,access:{has:e=>"setDislike"in e,get:e=>e.setDislike},metadata:i},null,$),$a(e,null,F,{kind:"method",name:"setBookmark",static:!1,private:!1,access:{has:e=>"setBookmark"in e,get:e=>e.setBookmark},metadata:i},null,$),$a(e,null,W,{kind:"method",name:"share",static:!1,private:!1,access:{has:e=>"share"in e,get:e=>e.share},metadata:i},null,$),$a(e,null,V,{kind:"method",name:"markAsOpened",static:!1,private:!1,access:{has:e=>"markAsOpened"in e,get:e=>e.markAsOpened},metadata:i},null,$),$a(e,null,z,{kind:"method",name:"hideTimeline",static:!1,private:!1,access:{has:e=>"hideTimeline"in e,get:e=>e.hideTimeline},metadata:i},null,$),$a(e,null,U,{kind:"method",name:"showTimeline",static:!1,private:!1,access:{has:e=>"showTimeline"in e,get:e=>e.showTimeline},metadata:i},null,$),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();class Ya{constructor(e,t,i){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,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"publicEventsSubscriptions",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.handleClickOnButton=this.handleClickOnButton.bind(this),this.subscribeToEventBusEvents()}subscribeToEventBusEvents(){qt.on("publicEvents.clickOnButton",this.handleClickOnButton),this.subscribeToPublicEvents()}unsubscribeEventBusEvents(){qt.off("publicEvents.clickOnButton",this.handleClickOnButton),this.unsubscribeFromPublicEvents()}subscribeToPublicEvents(){const e=new Tt(this.storyManager),t=this.storyReaderViewModel.sourceInfo,i=["showSlide","showStory","closeStory","clickOnButton","likeStory","dislikeStory","favoriteStory","shareStory","shareStoryWithPath"];for(const r of i){const i=i=>e.handle(r,i,t);qt.on(`publicEvents.${r}`,i),this.publicEventsSubscriptions.push((()=>{qt.off(`publicEvents.${r}`,i)}))}}unsubscribeFromPublicEvents(){this.publicEventsSubscriptions.forEach((e=>e()))}handleClickOnButton(e){new pt(this.storyManager,this.statisticsService).handle(e)}destroy(){this.unsubscribeEventBusEvents()}}var Za=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const Ja=e=>Za(void 0,void 0,void 0,(function*(){return(yield fetch(e)).blob()})),Xa=e=>Za(void 0,void 0,void 0,(function*(){const t=yield Ja(e);return function(e,t=!0){return new Promise((function(i){var r=new FileReader;r.onloadend=function(){if(t){var e=String(r.result).replace("data:","").replace(/^.+,/,"");i(e)}else i(String(r.result))},r.readAsDataURL(e)}))}(new File([t],"image",{type:t.type,lastModified:(new Date).getTime()}),!1)}));function eo(e,t,i,r){var n=e.indexOf(i,t);if(-1===n)return null;for(var s="",a=n+i.length;a<e.length&&-1===r.indexOf(e[a]);a++)s+=e[a];return{foundAtIndex:n,value:s}}function to(e,t){const i=document.createElementNS("http://www.w3.org/2000/svg",e);for(let e in t)i.setAttributeNS(null,e.replace(/[A-Z]/g,(function(e,t,i,r){return"-"+e.toLowerCase()})),t[e]);return i}var io;function ro(e,t,i,r,n,s,a,o,l,d){var c=to("svg",{width:String(n),height:String(s),style:"background-color: #fff;"}),u=to("foreignObject",{x:"0",y:"0",width:"100%",height:"100%"});c.appendChild(u);try{u.style.fontSize=document.body.style.fontSize}catch(e){console.error(e)}!function(){const h=t.cloneNode(!0);if(null!=r&&"string"==typeof r&&r.length>0){const e=Array.prototype.slice.call(h.querySelectorAll(r));for(let t=0;t<e.length;t++){const i=e[t];i&&i.style&&i.style.setProperty&&i.style.setProperty("display","none")}}u.appendChild(h);var p=[];(function(e){for(var t=[],i=0;;){var r=eo(e,i,"src: url(",[" ",")","\t"]);if(null==r)break;i=r.foundAtIndex+r.value.length,t.push(r.value.replace(/["']/g,""))}return t})(i).forEach((function(e){p.push(new Promise((function(t,r){Xa(e).then((function(r){i=i.replace(e,r),t()})).catch((function(e){t()}))})))})),u.querySelectorAll("img").forEach((function(e){e.crossOrigin="Anonymous",p.push(new Promise((function(t,i){Xa(e.src).then((function(i){e.onload=i=>e.decode().then((()=>t())),e.onerror=e=>{console.error(e),t()},e.decoding="sync",e.src=i})).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=to("style",{});t.textContent=i,c.appendChild(t);const r=(new XMLSerializer).serializeToString(c),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=n+"px",e.style.height=s+"px",e.width=2*n,e.height=2*s,t.scale(2,2),t.drawImage(u,0,0);const i=e.toDataURL(a,o);Ja(i).then((function(t){l(t),e.remove()}))}}),e===io.IOS?200:void 0)})).catch((e=>{console.log({image:u,encodingError:e},"onDecodeError"),d("error render svg image: "+e)}))},u.onerror=e=>{d("error render svg image: "+e)},u.setAttribute("crossOrigin","Anonymous"),u.crossOrigin="Anonymous",u.decoding="sync",u.src="data:image/svg+xml;base64,"+btoa(encodeURIComponent(r).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})))}))}()}function no(e,t,i,r){return new Promise((function(n,s){null==r&&(r=""),function(e,t,i,r,n,s){ro(e,t,i,r,t.clientWidth,t.clientHeight,"image/jpeg",1,n,s)}(e,t,i,r,(function(e){n(new File([e],"image.jpeg",{type:e.type,lastModified:(new Date).getTime()}))}),(function(){console.error("Image fail");const e=new Error;e.name="ImageFail",s(e)}))}))}!function(e){e[e.IOS=0]="IOS",e[e.ANDROID=1]="ANDROID",e[e.OTHER=2]="OTHER"}(io||(io={}));var so,ao=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(so||(so={}));class oo{getScreenShot(e){return ao(this,arguments,void 0,(function*({hideElementsSelector:e,slideContent:t}){const i=yield no(io.IOS,t,function(e){let t="";return Array.prototype.slice.call(window.document.styleSheets).forEach((i=>{e(i)&&(t+=Array.prototype.slice.call(i.rules).map((e=>e.cssText)).join(""))})),t}((function(){return!0})),e);return{file:i,url:URL.createObjectURL(i)}}))}getNavigatorShareFunction(){var e,t;let i=null===(e=navigator.share)||void 0===e?void 0:e.bind(navigator);return!i&&(null===(t=window.parent)||void 0===t?void 0:t.navigator.share)&&(i=window.parent.navigator.share.bind(window.parent.navigator)),i}getFilteredConfigDto(e){const t={};for(const[i,r]of Object.entries(null!=e?e:{}))null!==r&&(t[i]=r);return t}}var lo=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},co=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},uo=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},ho=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},po=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let fo=(()=>{var e,t,i;let r,n,s,a,o,l,d=[],c=[],u=[],h=[],p=[];return e=class{get _isOpened(){return ho(this,t,"f")}set _isOpened(e){po(this,t,e,"f")}get _params(){return ho(this,i,"f")}set _params(e){po(this,i,e,"f")}constructor(e,r){Object.defineProperty(this,"storyReaderViewModel",{enumerable:!0,configurable:!0,writable:!0,value:(lo(this,d),e)}),Object.defineProperty(this,"sharingService",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"nativeSharingId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"nativeSharingRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t.set(this,lo(this,c,!1)),i.set(this,(lo(this,u),lo(this,h,{id:"",type:so.Social,link:""}))),Object.defineProperty(this,"currentStorySlide",{enumerable:!0,configurable:!0,writable:!0,value:(lo(this,p),null)}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isOpened(){return this._isOpened}get params(){return this._params}open(e){di(),this._params={link:e.link,type:e.type,text:e.text,id:e.id},this._isOpened=!0}close(){ci(),this._isOpened=!1,this._params={id:"",type:so.Social,link:""}}handleShareComplete(e,t){var i;const r=null===(i=this.currentStorySlide)||void 0===i?void 0:i.findWidgetByType("ShareWidget");null==r||r.handleShareComplete({shareId:e,result:t}),this.close()}shareScreenShot(e){return uo(this,arguments,void 0,(function*({shareId:e,shareText:t,hideElementsSelector:i,storySlide:r}){let n=null;this.currentStorySlide=r;try{const s=yield this.sharingService.getScreenShot({hideElementsSelector:i,slideContent:r.$el});n=s.url;const a={files:[s.file],text:t};if(this.desktopMode)return void this.open({type:so.SlideScreenshot,id:e,link:n,text:t});yield this.startNativeSharing(e,a)}catch(i){console.error(i),n&&this.open({type:so.SlideScreenshot,id:e,link:n,text:t})}}))}shareText(e){return uo(this,arguments,void 0,(function*({shareId:e,config:t,storySlide:i}){var r;this.currentStorySlide=i,null==e&&(e="story-share");const n=this.sharingService.getFilteredConfigDto(t),s=n.url=null!==(r=n.url)&&void 0!==r?r:n.text,a={type:so.Social,id:e,link:s};try{if(this.desktopMode)return void this.open(a);yield this.startNativeSharing(e,n)}catch(e){this.open(a)}}))}startNativeSharing(e,t){return uo(this,void 0,void 0,(function*(){const i=this.sharingService.getNavigatorShareFunction();if(!i)throw new Error;try{di(),this.runNativeSharing({id:e}),yield i(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.nativeSharingRunning=!1,this.nativeSharingId="",ci())}},t=new WeakMap,i=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[ee.observable],n=[ee.observable],s=[ee.computed],a=[ee.computed],o=[ee.action],l=[ee.action],co(e,null,r,{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},c,u),co(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:t},h,p),co(e,null,s,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:t},null,d),co(e,null,a,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:t},null,d),co(e,null,o,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:t},null,d),co(e,null,l,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:t},null,d),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var go,vo,mo=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},bo=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},yo=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},wo=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},So=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};!function(e){e.RedirectToStory="redirectToStory",e.CloseStory="closeStory",e.ShowMultipleStories="showMultipleStories",e.ReloadStory="reloadStory"}(go||(go={})),function(e){e.Close="closeStoryReader"}(vo||(vo={}));let _o=(()=>{var e,t,i,r,n,s,a,o,l;let d,c,u,h,p,f,g,v,m,b,y,w,S,_,x,O,k,C,M,P,j,E,I,T,R=it,D=[],B=[],N=[],F=[],W=[],V=[],z=[],U=[],G=[],$=[],H=[],q=[],Q=[],K=[],Y=[],Z=[],J=[];return e=class extends R{get _activeStory(){return wo(this,t,"f")}set _activeStory(e){So(this,t,e,"f")}get _currentIndex(){return wo(this,i,"f")}set _currentIndex(e){So(this,i,e,"f")}get _uiPaused(){return wo(this,r,"f")}set _uiPaused(e){So(this,r,e,"f")}get _muted(){return wo(this,n,"f")}set _muted(e){So(this,n,e,"f")}get _timerPaused(){return wo(this,s,"f")}set _timerPaused(e){So(this,s,e,"f")}get _closeGestureInAction(){return wo(this,a,"f")}set _closeGestureInAction(e){So(this,a,e,"f")}get _placeholders(){return wo(this,o,"f")}set _placeholders(e){So(this,o,e,"f")}get storyViewModels(){return wo(this,l,"f")}set storyViewModels(e){So(this,l,e,"f")}constructor(d,c,u){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(mo(this,D),d)}),Object.defineProperty(this,"storyReaderStoriesService",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"statisticsService",{enumerable:!0,configurable:!0,writable:!0,value:u}),t.set(this,mo(this,B,null)),i.set(this,(mo(this,N),mo(this,F,1))),r.set(this,(mo(this,W),mo(this,V,!1))),n.set(this,(mo(this,z),mo(this,U,!0))),s.set(this,(mo(this,G),mo(this,$,!1))),a.set(this,(mo(this,H),mo(this,q,!1))),Object.defineProperty(this,"_locked",{enumerable:!0,configurable:!0,writable:!0,value:(mo(this,Q),!1)}),Object.defineProperty(this,"narrativeContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.set(this,mo(this,K,[])),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:(mo(this,Y),new ra(window))}),Object.defineProperty(this,"_sourceInfo",{enumerable:!0,configurable:!0,writable:!0,value:{listType:A.default,feedSlug:""}}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"windowReferer",{enumerable:!0,configurable:!0,writable:!0,value:L.default}),Object.defineProperty(this,"storyReaderViewModelEventBusListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l.set(this,mo(this,Z,new Map)),Object.defineProperty(this,"currentStoryDisplayStrategy",{enumerable:!0,configurable:!0,writable:!0,value:(mo(this,J),null)}),Object.defineProperty(this,"navigationHistory",{enumerable:!0,configurable:!0,writable:!0,value:new Ur}),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 rs({touchStartTimeout:200})}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new mi}),Object.defineProperty(this,"_sharePanelViewModel",{enumerable:!0,configurable:!0,writable:!0,value:new fo(this,new oo)}),this.storyReaderViewModelEventBusListener=new Ya(d,this,u),this.handleWindowUnload=this.handleWindowUnload.bind(this),d.setViewModel(e.id,this),window.addEventListener("beforeunload",this.handleWindowUnload),this.storyDisplayStrategyFactory=new tn(d,this,c)}initSlideApi(){this.slideApiHandlers=new Ai(this.narrativeDataCache,this.storyManager,this),this.slideApi=(0,at.getSlideApi)(this.slideApiHandlers)}get sharePanel(){return this._sharePanelViewModel}get touchController(){return this._touchController}get feedSlug(){var e;return null!==(e=this.sourceInfo.feedSlug)&&void 0!==e?e:""}get widgetsData(){return lt()(this.narrativeContext.widgetsData)?this.narrativeContext.widgetsData:{}}get sourceInfo(){return this._sourceInfo}get muted(){return this._muted}get uiPaused(){return this._uiPaused}get timerPaused(){return this._timerPaused}get closeGestureInAction(){return this._closeGestureInAction}get stories(){return Array.from(this.storyViewModels.values())}get activeStory(){return this._activeStory}get isOpened(){return Boolean(this._activeStory)}get currentIndex(){return this._currentIndex}get placeholders(){return this._placeholders}get reachStart(){return 1===this.currentIndex}get reachEnd(){return this.currentIndex===this.storyViewModels.size-2}setStories({listType:e,stories:t}){let i=t.filter((e=>!e.hide_in_reader)).map((e=>Rt.createInstance(Gt,e)));i=[Rt.createInstance(Gt,{blank:!0,id:-1}),...i,Rt.createInstance(Gt,{blank:!0,id:-2})];for(const e of i)if(this.storyViewModels.has(e.id))this.storyViewModels.get(e.id).updateStoriesItem(e);else{const t=new Ua(this.storyManager,this,this.slideApi,this.slideApiHandlers,this._touchController);this.storyViewModels.set(e.id,new Ka(this,this._sharePanelViewModel,e,this.slideApiHandlers,this.navigationHistory,t))}}setNarrativeContext(e){this.narrativeContext=e instanceof Ht?e:Rt.createInstance(Ht,e.rawData),this.initStoryResources(this.narrativeContext)}setActiveStoryById(e){this._currentIndex=Array.from(this.storyViewModels.keys()).indexOf(e),this._activeStory=this.storyViewModels.get(e),this.setSlideApiActiveStory(this._activeStory)}setActiveStoryByIndex(e){this._currentIndex=e,this._activeStory=this.getDisplayedStoryByIndex(this._currentIndex),this.setSlideApiActiveStory(this._activeStory),this.handleActiveStoryError(this._activeStory)}getDisplayedStoryByIndex(e){return Array.from(this.storyViewModels.values())[e]}setSlideApiActiveStory(e){this.slideApiHandlers.setActiveStory(e)}open(e,t){this.initSlideApi(),this.storyViewModels.clear(),this.windowReferer=e.windowReferer,this.setScrollBar(e.windowReferer),this._sourceInfo=t,this.setStoriesAndContext({listType:e.listType,storyList:e.storyList,storyContext:e.storyContext}),this.setActiveStoryById(e.id),this._placeholders=e.placeholders,this.statisticsService.init(t),ut(!0),this._touchController.init(document.body)}close(e="closeReaderByCloseBtn"){var t;if(!this.activeStory||(null===(t=this.activeStory)||void 0===t?void 0:t.disableClose))return;this.resetScrollBar(this.windowReferer);const i=this.activeStory.id,r=this.activeStory.activeSlideIndex;this.emit(vo.Close),qt.emit(vo.Close,{id:i}),qt.emit(ki.CloseStoryReader,{storyId:i,slideIndex:r}),qt.emit("publicEvents.closeStory",{id:i,index:r,action:e}),li(),this.sharePanel.close(),this.navigationHistory.reset(),this.activeStory.markAsOpened(),this._sourceInfo={listType:A.default,feedSlug:""},this._activeStory=null,this.statisticsService.destroy(),this.storyViewModels.clear(),this._touchController.destroy()}setScrollBar(e){e===L.default&&this.scrollbarHelper.setScrollbar()}resetScrollBar(e){e===L.default&&this.scrollbarHelper.resetScrollbar()}initStoryResources(e){new vi(e.style)}handleActiveStoryError(e){e.error&&this.storyManager.emit("showStoryFailed",Object.assign({id:e.id,title:e.title},e.error))}handleWindowUnload(e){this.activeStory&&(qt.emit(ki.NextSlide,{fromStoryId:this.activeStory.id,fromSlideIndex:this.activeStory.activeSlideIndex}),this.statisticsService.sendData())}setStoriesAndContext(e){this.setStories({listType:e.listType,stories:e.storyList}),this.setNarrativeContext({rawData:e.storyContext})}canBeClosed(){return!(!this.activeStory||this.activeStory.isBlank)&&!this.activeStory.disableClose}showStory(e,t){return yo(this,void 0,void 0,(function*(){this.currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStory(),yield this.currentStoryDisplayStrategy.show({storyId:e,feed:t})}))}showStoryOnce(e){return yo(this,void 0,void 0,(function*(){this.currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStoryOnce(),yield this.currentStoryDisplayStrategy.show({storyId:e})}))}showStoryFromSharePage(e,t){return yo(this,void 0,void 0,(function*(){const i=this.storyDisplayStrategyFactory.createShowStoryFromSharePage();return this.currentStoryDisplayStrategy=i,i.show({storyId:e,fetchShareUrl:t})}))}showOnboardingStories(e){return yo(this,void 0,void 0,(function*(){var t;const i=this.storyDisplayStrategyFactory.createShowOnboardingStories();return this.currentStoryDisplayStrategy=i,i.show({feed:null!==(t=null==e?void 0:e.feed)&&void 0!==t?t:"",customTags:null==e?void 0:e.customTags,limit:null==e?void 0:e.limit})}))}showMultipleStories(e){return yo(this,void 0,void 0,(function*(){var t,i;const r=this.storyDisplayStrategyFactory.createShowMultipleStories();this.currentStoryDisplayStrategy=r,yield r.show({storyId:e.storyId,listType:null!==(t=e.listType)&&void 0!==t?t:A.default,windowReferer:null!==(i=e.windowReferer)&&void 0!==i?i:L.default,feed:e.feed,filter:e.filter})}))}fetchStoriesSlidesAndContextByNextStoryIndex(e){return yo(this,void 0,void 0,(function*(){const t=yield this.storyReaderStoriesService.fetchStoriesSlidesAndContextByNextStoryIndex({nextStoryIndex:e,listType:this.sourceInfo.listType,feed:this.sourceInfo.feedSlug});t.storyList.length&&this.setStoriesAndContext(t)}))}reloadStory(e){return yo(this,void 0,void 0,(function*(){var t,i;Cr({id:e.id,story:{error:null}});const r=Object.assign(Object.assign({},this.sourceInfo),{feed:null!==(t=this.sourceInfo.feedSlug)&&void 0!==t?t:""});let n=this.storyReaderStoriesService.getStoriesWithSlidesAndContext(r);this.setStoriesAndContext(n),null===(i=this.currentStoryDisplayStrategy)||void 0===i||i.reload({storyId:e.id,listType:this.sourceInfo.listType,feed:this.sourceInfo.feedSlug})}))}nextStory(){var e;this.reachEnd||(null===(e=this.activeStory)||void 0===e||e.markAsOpened(),this.setActiveStoryByIndex(this._currentIndex+1),this.fetchStoriesSlidesAndContextByNextStoryIndex(this._currentIndex-1))}prevStory(){var e;this.reachStart||(null===(e=this.activeStory)||void 0===e||e.markAsOpened(),this.setActiveStoryByIndex(this._currentIndex-1),this.fetchStoriesSlidesAndContextByNextStoryIndex(this._currentIndex-1))}destroy(){this.removeAllListeners(),window.removeEventListener("beforeunload",this.handleWindowUnload),this.storyReaderViewModelEventBusListener.destroy(),this.storyManager.deleteViewModel(e.id)}closeGoodsWidget(){qt.emit("goodsWidget.close")}enableStoryTimer(){this.storyViewModels.forEach((e=>e.enableTimer()))}disableStoryTimer(){this.storyViewModels.forEach((e=>e.disableTimer()))}},t=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,(()=>{var t;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=R[Symbol.metadata])&&void 0!==t?t:null):void 0;d=[ee.observable],c=[ee.observable],u=[ee.observable],h=[ee.observable],p=[ee.observable],f=[ee.observable],g=[ee.observable],v=[ee.observable],m=[ee.computed],b=[ee.computed],y=[ee.computed],w=[ee.computed],S=[ee.computed],_=[ee.computed],x=[ee.computed],O=[ee.computed],k=[ee.computed],C=[ee.computed],M=[ee.computed],P=[ee.action],j=[ee.action],E=[ee.action],I=[ee.action],T=[ee.action],bo(e,null,d,{kind:"accessor",name:"_activeStory",static:!1,private:!1,access:{has:e=>"_activeStory"in e,get:e=>e._activeStory,set:(e,t)=>{e._activeStory=t}},metadata:i},B,N),bo(e,null,c,{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:i},F,W),bo(e,null,u,{kind:"accessor",name:"_uiPaused",static:!1,private:!1,access:{has:e=>"_uiPaused"in e,get:e=>e._uiPaused,set:(e,t)=>{e._uiPaused=t}},metadata:i},V,z),bo(e,null,h,{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:i},U,G),bo(e,null,p,{kind:"accessor",name:"_timerPaused",static:!1,private:!1,access:{has:e=>"_timerPaused"in e,get:e=>e._timerPaused,set:(e,t)=>{e._timerPaused=t}},metadata:i},$,H),bo(e,null,f,{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:i},q,Q),bo(e,null,g,{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:i},K,Y),bo(e,null,v,{kind:"accessor",name:"storyViewModels",static:!1,private:!1,access:{has:e=>"storyViewModels"in e,get:e=>e.storyViewModels,set:(e,t)=>{e.storyViewModels=t}},metadata:i},Z,J),bo(e,null,m,{kind:"getter",name:"muted",static:!1,private:!1,access:{has:e=>"muted"in e,get:e=>e.muted},metadata:i},null,D),bo(e,null,b,{kind:"getter",name:"uiPaused",static:!1,private:!1,access:{has:e=>"uiPaused"in e,get:e=>e.uiPaused},metadata:i},null,D),bo(e,null,y,{kind:"getter",name:"timerPaused",static:!1,private:!1,access:{has:e=>"timerPaused"in e,get:e=>e.timerPaused},metadata:i},null,D),bo(e,null,w,{kind:"getter",name:"closeGestureInAction",static:!1,private:!1,access:{has:e=>"closeGestureInAction"in e,get:e=>e.closeGestureInAction},metadata:i},null,D),bo(e,null,S,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:i},null,D),bo(e,null,_,{kind:"getter",name:"activeStory",static:!1,private:!1,access:{has:e=>"activeStory"in e,get:e=>e.activeStory},metadata:i},null,D),bo(e,null,x,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:i},null,D),bo(e,null,O,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:i},null,D),bo(e,null,k,{kind:"getter",name:"placeholders",static:!1,private:!1,access:{has:e=>"placeholders"in e,get:e=>e.placeholders},metadata:i},null,D),bo(e,null,C,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:i},null,D),bo(e,null,M,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:i},null,D),bo(e,null,P,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:i},null,D),bo(e,null,j,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:i},null,D),bo(e,null,E,{kind:"method",name:"reloadStory",static:!1,private:!1,access:{has:e=>"reloadStory"in e,get:e=>e.reloadStory},metadata:i},null,D),bo(e,null,I,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:i},null,D),bo(e,null,T,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:i},null,D),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:"StoryReaderViewModel"}),e})();class xo{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new sr,t=new ji(this.storyManager),i=new Mi(t);return new _o(this.storyManager,e,i)}}var Oo=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class ko{constructor(e,t,i){Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"deferredActionsQueue",{enumerable:!0,configurable:!0,writable:!0,value:new bi}),Object.defineProperty(this,"activeMessageNarrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new mi}),Object.defineProperty(this,"activeMessageSlide",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"activeMessage",{enumerable:!0,configurable:!0,writable:!0,value:null})}lock(e){var t;if(this.activeMessageSlide&&this.activeMessageSlide!==e)throw new Error(`[SlideApi]: The resource is locked by message with ID ${null===(t=this.activeMessage)||void 0===t?void 0:t.id}`);this.activeMessageSlide=e}unlock(e){this.activeMessageSlide===e&&(this.activeMessageSlide=null)}exec(){this.activeMessageSlide&&(this.deferredActionsQueue.exec(),this.deferredActionsQueue.flush())}getCardLocalData(){return Oo(this,void 0,void 0,(function*(){if(!this.activeMessage)return{};let e=this.narrativeDataCache.get(`iam_${this.activeMessage.id}_data_${Ne.getState()}`);return e?JSON.parse(e):{}}))}setCardLocalData(e,t){if(!this.activeMessage)return;let i=JSON.stringify(e);this.narrativeDataCache.set(`iam_${this.activeMessage.id}_data_${Ne.getState()}`,i),t&&this.activeMessage.updateUserData(i).catch(console.error)}getCardServerData(e){var t,i;return null!==(i=null===(t=this.activeMessage.context.widgetsData._narrative_saved_data)||void 0===t?void 0:t[e])&&void 0!==i?i:null}updateCardServerData(e,t){this.activeMessage.context.widgetsData._narrative_saved_data=t}getSlideDuration(e,t){var i,r,n;return null!==(n=null===(r=null===(i=this.activeMessage.context.widgetsData._narrative_slides_duration)||void 0===i?void 0:i[e])||void 0===r?void 0:r[t])&&void 0!==n?n:null}pauseUI(){var e;null===(e=this.activeMessageSlide)||void 0===e||e.pause()}resumeUI(){var e;null===(e=this.activeMessageSlide)||void 0===e||e.resume()}showCardTextInput(e,t){}setCardSessionValue(e,t){this.activeMessageNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.activeMessageNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){var i,r,n;const s=this.activeMessage.context.widgetsData;switch(t){case"rangeSlider":return null===(i=s._narrative_range_slider_data)||void 0===i?void 0:i[e];case"poll":return null===(r=s._narrative_poll_data)||void 0===r?void 0:r[e];case"vote":return null===(n=s._narrative_vote_data)||void 0===n?void 0:n[e]}return null}openUrl(e){window.open(e,"_parent")}sendApiRequest(e,t,i,r,n,s){return Oo(this,void 0,void 0,(function*(){var s,a,o;try{const s=yield Ae.request({url:e,method:t,params:null!=i?i:{},headers:null!=r?r:{},data:null!=n?n:{}});return{status:s.status,headers:s.headers,data:s.data}}catch(e){if(e instanceof Oe)return{status:null!==(s=e.networkStatus)&&void 0!==s?s:400,headers:null===(a=e.response)||void 0===a?void 0:a.headers,data:null===(o=e.response)||void 0===o?void 0:o.data}}}))}share(e,t){}shareSlideScreenshot(e,t,i){}showLayer(e){var t;null===(t=this.activeMessageSlide)||void 0===t||t.showLayerByIndex(e)}showCardSlide(e){}cardShowNext(){}showNextSlide(e){}sendStatisticEvent(e,t,i){let r=null;switch(e){case"w-copy":r=new rl(i.widget_id,i.widget_value,i.widget_label);break;case"w-share":r=new ol(i.widget_id,i.widget_answer,i.widget_label,i.widget_value,i.widget_answer_label);break;case"w-rate-answer":r=new al(i.widget_id,i.widget_answer,i.widget_label,i.widget_value);break;case"w-range-slider-answer":r=new sl(i.widget_id,i.widget_answer,i.widget_label)}r&&(this.activeMessage.trackWidgetEvent(r),this.iamReader.emitWidgetEvent(r))}destroy(){}setActiveMessage(e){this.activeMessageNarrativeDataCache.clear(),this.activeMessage=e,this.activeMessageSlide&&this.unlock(this.activeMessageSlide)}resetCard(e){return Oo(this,void 0,void 0,(function*(){}))}pushToDefferedActionsQueueOrExec(e){this.activeMessageSlide?e():this.deferredActionsQueue.push(e)}getCardFonts(){const e=Ie.getState().cache;return null!=e&&Array.isArray(e)?Ie.getState().cache.filter((e=>"font-face"===e.type)):[]}updateTimeline(e,t,i,r,n,s){}showToast(e){var t;null===(t=this.activeMessageSlide)||void 0===t||t.showToast({content:e})}}class Co{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 Mo{constructor(e,t,i,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:i}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:r}),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 Po{constructor(e,t,i,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:i}),Object.defineProperty(this,"desktopMode",{enumerable:!0,configurable:!0,writable:!0,value:r}),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 jo{create(e,t){switch(e){case Wl.BottomSheet:return new Mo(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case Wl.Modal:return new Po(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case Wl.Fullscreen:return new Co(t.vw,t.vh)}}}class Eo{constructor(e,t,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:i})}get contentRatio(){return this._contentRatio}getOffset(){const e=this.calculateHeight();return-(Math.ceil(e-this._vh)/2)+"px 0px"}getOffsetX(){return"0px"}getOffsetY(){const e=this.calculateHeight();return`${Math.ceil(e-this._vh)/2}px`}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}class Lo{constructor(e,t,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:i})}get contentRatio(){return this._contentRatio}get vw(){return this._vw}get vh(){return this._vh}getOffset(){const e=this.calculateWidth();return`0px ${-(Math.ceil(e-this._vw)/2)}px`}getOffsetX(){const e=this.calculateWidth();return`${Math.ceil(e-this._vw)/2}px`}getOffsetY(){return"0px"}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this._vh*this._contentRatio)}calculateHeight(){return this._vh}}class Ao{}class Io extends Ao{constructor(e,t,i){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:i})}get contentRatio(){return this._contentRatio}getOffset(){const e=this.calculateHeight();return-(Math.ceil(e-this._vh)/2)+"px 0px"}getOffsetX(){return"0px"}getOffsetY(){const e=this.calculateHeight();return`${Math.ceil(e-this._vh)/2}px`}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}class To extends Ao{constructor(e,t,i){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:i})}get contentRatio(){return this._contentRatio}getOffset(){const e=this.calculateWidth();return`0px ${Math.ceil(this._vw-e)/2}px`}getOffsetX(){const e=this.calculateWidth();return`${Math.ceil(this._vw-e)/2}px`}getOffsetY(){return"0px"}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this.calculateHeight()*this._contentRatio)}calculateHeight(){return this._vh}}class Ro{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 Co}createWideOrSquareGeometry(e){return e.viewportRatio>e.contentRatio?new Eo(e.vw,e.vh,e.contentRatio):new Lo(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 To(e.vw,e.vh,e.contentRatio):new Io(e.vw,e.vh,e.contentRatio)}}class Do{constructor(e){Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_mode",{enumerable:!0,configurable:!0,writable:!0,value:Ds.None}),Object.defineProperty(this,"_defaultPrevented",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_direction",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._direction=this.calcDirection()}get mode(){return this._mode}get direction(){return this._direction}get defaultPrevented(){return this._defaultPrevented||this.slide.navigationDisabled}get navigationDisabled(){return!1}preventDefault(){this._defaultPrevented=!0}disableNextClick(){this._mode=Ds.DisableNext}navigate(){this.direction<0?this.toPrev():this.mode!==Ds.DisableNext&&this.toNext()}toPrev(){}toNext(){}calcClickPosition(){return.3}calcDirection(){return this.calcClickPosition()<=.3?-1:1}}var Bo=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},No=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Fo=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};let Wo=(()=>{var e;let t,i=it,r=[];return e=class extends i{constructor(e,t,i){super(),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:(Bo(this,r),e)}),Object.defineProperty(this,"iamMessageSlide",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"messageSlideRendererFactory",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideRenderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"locked",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.slideRenderer=this.messageSlideRendererFactory.create({slide:this,message:this.message}),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}get isLoading(){return this.slideRenderer.state===Ns.Loading}get html(){return this.iamMessageSlide.html}get navigationDisabled(){return this.slideRenderer.navigationDisabled}init(e){return Fo(this,void 0,void 0,(function*(){return this.slideRenderer.init(e)}))}start(){return Fo(this,void 0,void 0,(function*(){return document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.slideRenderer.start()}))}reload(){return Fo(this,void 0,void 0,(function*(){return this.slideRenderer.reload()}))}stop(){return document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.slideRenderer.stop()}pause(){return this.slideRenderer.pause()}resume(){return this.slideRenderer.resume()}pauseAndLock(){return this.locked=!0,this.pause()}resumeAndUnlock(){return this.locked=!1,this.resume()}mute(){this.slideRenderer.mute()}unmute(){this.slideRenderer.unmute()}onClick(e){const t=new Do(this);this.slideRenderer.onClick({target:e,navigationController:t})}onLinkClick(e){this.slideRenderer.onClickLinkElement(e.target)}showLayerByIndex(e){this.slideRenderer.showLayerByIndex(e)}destroy(){return this.slideRenderer.stop()}showToast(e){new ns(Object.assign({getMountPoint:()=>this.slideRenderer.$el},e))}handleDocumentVisibilityChange(){this.locked||("hidden"===document.visibilityState&&this.pause(),"visible"===document.visibilityState&&this.resume())}},(()=>{var n;const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(n=i[Symbol.metadata])&&void 0!==n?n:null):void 0;t=[ee.computed],No(e,null,t,{kind:"getter",name:"isLoading",static:!1,private:!1,access:{has:e=>"isLoading"in e,get:e=>e.isLoading},metadata:s},null,r),s&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),e})();var Vo=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class zo extends it{constructor(e,t,i){super(),Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._slides=this.iamMessage.slides.map((e=>new Wo(this,e,i)))}get id(){return this.iamMessage.id}get activeSlideIndex(){return this.iamMessage.activeSlideIndex}get openTime(){return this._openTime}get slides(){return this._slides}get context(){return this.iamMessage.context}get appearanceOptions(){return this.iamMessage.appearanceOptions}get type(){return this.iamMessage.type}trackOpen(){return Vo(this,void 0,void 0,(function*(){yield this.iamMessage.trackOpen()}))}trackClose(){return Vo(this,void 0,void 0,(function*(){yield this.iamMessage.trackClose()}))}trackWidgetEvent(e){return Vo(this,void 0,void 0,(function*(){yield this.iamMessage.trackWidgetEvent(e)}))}updateUserData(e){return Vo(this,void 0,void 0,(function*(){return this.iamMessage.updateUserData(e)}))}toPublicDto(){return this.iamMessage.toPublicDto()}destroy(){}}class Uo{constructor(e){Object.defineProperty(this,"iamReader",{enumerable:!0,configurable:!0,writable:!0,value:e})}handle(e){this.iamReader.close()}}class Go{create(e,t){switch(e){case Wl.BottomSheet:return this.createBottomSheetAppearanceOptions(t);case Wl.Modal:return this.createModalAppearanceOptions(t);case Wl.Fullscreen:return this.createFullscreenAppearanceOptions(t)}}createCommonAppearanceOptions(e){return{backgroundColor:e.background_color}}createBottomSheetAppearanceOptions(e){var t;const i=this.createCommonAppearanceOptions(e);return Object.assign(Object.assign({},i),{borderRadius:null!==(t=e.corner_radius)&&void 0!==t?t:16,contentRatio:e.content_ratio||.64})}createModalAppearanceOptions(e){var t;const i=this.createCommonAppearanceOptions(e);return Object.assign(Object.assign({},i),{borderRadius:null!==(t=e.corner_radius)&&void 0!==t?t:16,contentRatio:e.content_ratio||.64})}createFullscreenAppearanceOptions(e){const t=this.createCommonAppearanceOptions(e);return Object.assign({},t)}}var $o=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Ho=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},qo=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Qo=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let Ko=(()=>{var e,t;let i,r,n=[],s=[],a=[];return e=class{get _html(){return qo(this,t,"f")}set _html(e){Qo(this,t,e,"f")}constructor(e){Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:($o(this,n),e)}),t.set(this,$o(this,s,"")),$o(this,a),this.message=e}get html(){return this._html}updateByDto(e){this._html=this.getSlideHtml(e)}getSlideHtml(e){var t;let i=this.message.needPlaceholders?br(e):e;return i=Nt(i,"{{nonce}}",null!==(t=X())&&void 0!==t?t:""),i}},t=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;i=[ee.observable],r=[ee.computed],Ho(e,null,i,{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},s,a),Ho(e,null,r,{kind:"getter",name:"html",static:!1,private:!1,access:{has:e=>"html"in e,get:e=>e.html},metadata:t},null,n),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();var Yo=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Zo=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Jo=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},Xo=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},el=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let tl=(()=>{var e,t,i,r,n,s,a,o,l;let d,c,u,h,p,f,g,v,m,b,y,w,S,_,x,O,k,C,M=[],P=[],j=[],E=[],L=[],A=[],I=[],T=[],R=[],D=[],B=[],N=[],F=[],W=[],V=[],z=[],U=[];return e=class{get _id(){return Xo(this,t,"f")}set _id(e){el(this,t,e,"f")}get _events(){return Xo(this,i,"f")}set _events(e){el(this,i,e,"f")}get _type(){return Xo(this,r,"f")}set _type(e){el(this,r,e,"f")}get _slides(){return Xo(this,n,"f")}set _slides(e){el(this,n,e,"f")}get _appearanceOptions(){return Xo(this,s,"f")}set _appearanceOptions(e){el(this,s,e,"f")}get _needPlaceholders(){return Xo(this,a,"f")}set _needPlaceholders(e){el(this,a,e,"f")}get _hasLimit(){return Xo(this,o,"f")}set _hasLimit(e){el(this,o,e,"f")}get _isOnceOpened(){return Xo(this,l,"f")}set _isOnceOpened(e){el(this,l,e,"f")}constructor(e,d,c){Object.defineProperty(this,"iamStatisticsService",{enumerable:!0,configurable:!0,writable:!0,value:(Yo(this,M),d)}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:c}),t.set(this,Yo(this,P,void 0)),i.set(this,(Yo(this,j),Yo(this,E,[]))),r.set(this,(Yo(this,L),Yo(this,A,void 0))),n.set(this,(Yo(this,I),Yo(this,T,[]))),s.set(this,(Yo(this,R),Yo(this,D,{}))),a.set(this,(Yo(this,B),Yo(this,N,!1))),o.set(this,(Yo(this,F),Yo(this,W,!1))),l.set(this,(Yo(this,V),Yo(this,z,!1))),Object.defineProperty(this,"_frequencyLimit",{enumerable:!0,configurable:!0,writable:!0,value:(Yo(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:""}),this._id=e}get id(){return this._id}get needPlaceholders(){return this._needPlaceholders}get openTime(){return this.iamStatisticsService.openTime}get timeSinceLastShow(){return this.iamStatisticsService.timeSinceLastShow}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 activeSlideIndex(){return 0}get context(){return this.iamStore.messageContext}get appearanceOptions(){return this._appearanceOptions}get type(){return this._type}destroy(){}updateByDto(e){var t,i,r,n;this._events=null!==(i=null===(t=e.events)||void 0===t?void 0:t.map((e=>e)))&&void 0!==i?i:[],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!==(n=e.display_to)&&void 0!==n?n:null,this._hasLimit=Boolean(e.has_limit),this._appearanceOptions=(new Go).create(this._type,e.appearance),this._needPlaceholders=e.need_placeholders,this.updateMessageSlides(e.slides_html)}matchWithEvent(e){return this._events.some((t=>t.name===e))}toPublicDto(){return{id:this._id,campaignName:this._campaignName,type:this._type}}trackOpen(){return Jo(this,void 0,void 0,(function*(){this._isOnceOpened=!0,yield this.iamStatisticsService.trackOpen(this)}))}trackClose(){return Jo(this,void 0,void 0,(function*(){yield this.iamStatisticsService.trackClose(this)}))}trackWidgetEvent(e){return Jo(this,void 0,void 0,(function*(){yield this.iamStatisticsService.trackWidgetEvent(this,e)}))}updateUserData(e){return Jo(this,void 0,void 0,(function*(){return this.iamStore.updateMessageUserData(this.id,e)}))}updateMessageSlides(e){const t=[];for(const i of e){const e=new Ko(this);e.updateByDto(i),t.push(e)}this._slides=t}static createByDto(t,i,r){const n=new e(t.id,r,i);return n.updateByDto(t),n}},t=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;d=[ee.observable],c=[ee.observable],u=[ee.observable],h=[ee.observable],p=[ee.observable],f=[ee.observable],g=[ee.observable],v=[ee.observable],m=[ee.computed],b=[ee.computed],y=[ee.computed],w=[ee.computed],S=[ee.computed],_=[ee.computed],x=[ee.computed],O=[ee.computed],k=[ee.computed],C=[ee.action],Zo(e,null,d,{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},P,j),Zo(e,null,c,{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},E,L),Zo(e,null,u,{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},A,I),Zo(e,null,h,{kind:"accessor",name:"_slides",static:!1,private:!1,access:{has:e=>"_slides"in e,get:e=>e._slides,set:(e,t)=>{e._slides=t}},metadata:t},T,R),Zo(e,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},D,B),Zo(e,null,f,{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},N,F),Zo(e,null,g,{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},W,V),Zo(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},z,U),Zo(e,null,m,{kind:"getter",name:"id",static:!1,private:!1,access:{has:e=>"id"in e,get:e=>e.id},metadata:t},null,M),Zo(e,null,b,{kind:"getter",name:"needPlaceholders",static:!1,private:!1,access:{has:e=>"needPlaceholders"in e,get:e=>e.needPlaceholders},metadata:t},null,M),Zo(e,null,y,{kind:"getter",name:"isOnceOpened",static:!1,private:!1,access:{has:e=>"isOnceOpened"in e,get:e=>e.isOnceOpened},metadata:t},null,M),Zo(e,null,w,{kind:"getter",name:"hasLimit",static:!1,private:!1,access:{has:e=>"hasLimit"in e,get:e=>e.hasLimit},metadata:t},null,M),Zo(e,null,S,{kind:"getter",name:"events",static:!1,private:!1,access:{has:e=>"events"in e,get:e=>e.events},metadata:t},null,M),Zo(e,null,_,{kind:"getter",name:"slides",static:!1,private:!1,access:{has:e=>"slides"in e,get:e=>e.slides},metadata:t},null,M),Zo(e,null,x,{kind:"getter",name:"context",static:!1,private:!1,access:{has:e=>"context"in e,get:e=>e.context},metadata:t},null,M),Zo(e,null,O,{kind:"getter",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions},metadata:t},null,M),Zo(e,null,k,{kind:"getter",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type},metadata:t},null,M),Zo(e,null,C,{kind:"method",name:"updateByDto",static:!1,private:!1,access:{has:e=>"updateByDto"in e,get:e=>e.updateByDto},metadata:t},null,M),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class il{}class rl extends il{constructor(e,t,i){super(),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:i})}get type(){return"w-copy"}toQueryParams(){return{wi:this.widgetId,wv:this.value,wl:this.label}}toJSON(){return{widgetId:this.widgetId,value:this.value}}}class nl extends il{constructor(e,t,i){super(),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:i})}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 sl extends il{constructor(e,t,i){super(),Object.defineProperty(this,"widgetId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"answer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:i})}get type(){return"w-range-slider"}toQueryParams(){return{wi:this.widgetId,wa:this.answer,wl:this.label}}toJSON(){return{widgetId:this.widgetId,answer:this.answer,label:this.label}}}class al extends il{constructor(e,t,i,r){super(),Object.defineProperty(this,"widgetId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"answer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:r})}get type(){return"w-rate"}toQueryParams(){return{wi:this.widgetId,wa:this.answer,wl:this.label,wv:this.value}}toJSON(){return{widgetId:this.widgetId,value:this.value,answer:this.answer,label:this.label}}}class ol extends il{constructor(e,t,i,r,n){super(),Object.defineProperty(this,"widgetId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"answer",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"answerLabel",{enumerable:!0,configurable:!0,writable:!0,value:n})}get type(){return"w-share"}toQueryParams(){return{wi:this.widgetId,wa:this.answer,wl:this.label,wv:this.value,wal:this.answerLabel}}toJSON(){return{widgetId:this.widgetId,value:this.value,answer:this.answer,label:this.label,answerLabel:this.answerLabel}}}var ll=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class dl{constructor(e,t,i){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iamMessage",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"messageSlide",{enumerable:!0,configurable:!0,writable:!0,value:i})}handle(e){return ll(this,void 0,void 0,(function*(){var t;this.iamMessage.trackWidgetEvent(new nl(e.elementId,e.linkTarget,""));try{yield this.storyManager.openGame(e.linkTarget),this.messageSlide.pauseAndLock(),null===(t=this.storyManager.gameReaderViewModel)||void 0===t||t.once(sa.Close,(()=>{this.messageSlide.resumeAndUnlock()}))}catch(e){console.error(e)}}))}}class cl{constructor(e,t,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:i})}handle(e){const t=decodeURIComponent(e.linkTarget);this.emitWidgetEvent(t,e.elementId),this.emitClickOnButtonEvent(t,e.elementId)}emitWidgetEvent(e,t){const i=new nl(t,e,"");this.iamMessage.trackWidgetEvent(i),this.iamReader.emitWidgetEvent(i)}emitClickOnButtonEvent(e,t){const i=this.getClickOnButtonEventPayload(e,t);this.iamReader.emit(yl.ClickOnButton,i),this.storyManager.clickOnButtonAction({src:x.IAM_READER,payload:i})}getClickOnButtonEventPayload(e,t){return{id:this.iamMessage.id,index:this.iamMessage.activeSlideIndex,url:e,elementId:t}}}var ul=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class hl{constructor(e,t,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,"messageSlide",{enumerable:!0,configurable:!0,writable:!0,value:i})}handle(e){return ul(this,void 0,void 0,(function*(){const t=parseInt(e.linkTarget);try{yield this.storyManager.showStory(t),this.messageSlide.pauseAndLock(),this.storyManager.storyReaderViewModel.once(vo.Close,(()=>{this.iamReader.updateSlideApiRef(),this.messageSlide.resumeAndUnlock()}))}catch(e){console.error(e)}}))}}class pl{handle(e){console.log(`There is no action handler for <${e.linkType}:${e.linkTarget}>`)}}class fl{constructor(e,t,i,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,"message",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"messageSlide",{enumerable:!0,configurable:!0,writable:!0,value:r})}create(e){switch(e){case"url":return new cl(this.iamReader,this.storyManager,this.message);case"story":return new hl(this.iamReader,this.storyManager,this.messageSlide);case"game":return new dl(this.storyManager,this.message,this.messageSlide);case"closeIAM":return new Uo(this.iamReader)}return new pl}}var gl=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class vl{constructor(e,t,i){Object.defineProperty(this,"slide",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"story",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:i})}onSlideStarted(){return gl(this,void 0,void 0,(function*(){this.slideApiHandlers.lock(this.slide),this.slideApiHandlers.exec()}))}onSlideStop(){this.slideApiHandlers.unlock(this.slide)}onSlideStateChanged(e){}onSlideLoadStart(){}onSlideLoadEnd(){}onSlideResume(){}onSlidePause(){}onSlideInit(){}onSlideVideoError(){}}class ml{constructor(e,t,i,r,n){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,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"touchController",{enumerable:!0,configurable:!0,writable:!0,value:n})}create({slide:e,message:t}){const i=new rn,r=new wn,n=new ka(new fl(this.storyManager,this.iamReader,t,e)),s=new Hs(new vl(e,t,this.slideApiHandlers),r,this.slideApi.Animation,i,n);return this.registerWidgets({widgetManager:r,slideApi:this.slideApi,message:t,slide:e}),s}registerWidgets({widgetManager:e,slideApi:t,message:i,slide:r}){e.registerMany([new Kn(t),new xn(t),new kn(t),new Mn(t),new Zn(t),new jn(t),new Ln(t),new Fn(t,this.touchController),new Vn(t),new Un(t),new Is(t,this.touchController),new Rs(t,this.touchController,r),new qn(t)])}}class bl extends Error{constructor(e){super(`[IAM]: you must close IAM with ID ${e}`),this.name="IamMessageOpenError"}}var yl,wl=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Sl=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},_l=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},xl=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Ol=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};!function(e){e.Loaded="loaded",e.Close="close",e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(yl||(yl={}));let kl=(()=>{var e,t;let i,r,n,s,a=it,o=[],l=[],d=[];return e=class extends a{get _activeMessage(){return xl(this,t,"f")}set _activeMessage(e){Ol(this,t,e,"f")}constructor(i,r,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(wl(this,o),i)}),Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"iamDisplayService",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,wl(this,l,null)),Object.defineProperty(this,"visibilityObserver",{enumerable:!0,configurable:!0,writable:!0,value:wl(this,d)}),Object.defineProperty(this,"slideApiHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"slideApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_touchController",{enumerable:!0,configurable:!0,writable:!0,value:new rs}),Object.defineProperty(this,"narrativeDataCache",{enumerable:!0,configurable:!0,writable:!0,value:new mi}),Object.defineProperty(this,"scrollbarHelper",{enumerable:!0,configurable:!0,writable:!0,value:new ra(window)}),Object.defineProperty(this,"eventPublisher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storyManager.setViewModel(e.id,this),this.visibilityObserver=new st(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)}preload(){return _l(this,void 0,void 0,(function*(){yield this.storyManager.waitStoryManagerConfig();return yield this.iamStore.preload()}))}showMessageById(e,t){return _l(this,void 0,void 0,(function*(){yield this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const i=yield this.iamDisplayService.getMessageById(e,t);return this.open(i),i}))}showMessageByEvent(e,t){return _l(this,void 0,void 0,(function*(){yield this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const i=yield this.iamDisplayService.getMessageByEvent(e,t);return this.open(i),i}))}close(){return _l(this,void 0,void 0,(function*(){this._activeMessage&&(this.emitCloseEvent(this._activeMessage),this.clearActiveMessage(),this.visibilityObserver.unsubscribe(),this.touchController.destroy(),this.scrollbarHelper.resetScrollbar())}))}open(e){this.initSlideApi(),this.touchController.init(document.body),this.setActiveMessage(e),this.visibilityObserver.subscribe(),this.scrollbarHelper.setScrollbar()}destroy(){this.storyManager.deleteViewModel(e.id)}emitWidgetEvent(e){this.emit(yl.WidgetEvent,{message:this.activeMessage.toPublicDto(),name:e.type,data:e.toJSON()})}updateSlideApiRef(){(0,at.getSlideApi)(this.slideApiHandlers)}setEventPublisher(e){this.eventPublisher=e}emit(e,...t){return super.emit(e,...t),this.eventPublisher.emit(e,...t)}emitCloseEvent(e){this.emit(yl.Close,{message:e.toPublicDto()})}initSlideApi(){this.slideApiHandlers=new ko(this.narrativeDataCache,this.storyManager,this),this.slideApi=(0,at.getSlideApi)(this.slideApiHandlers)}setActiveMessage(e){const t=this.createIamMessageViewModel(e);this.slideApiHandlers.setActiveMessage(t),t.trackOpen(),this._activeMessage=t}clearActiveMessage(){this._activeMessage&&(this._activeMessage.trackClose(),this._activeMessage=null)}createIamMessageViewModel(e){const t=new ml(this.storyManager,this,this.slideApi,this.slideApiHandlers,this.touchController);return new zo(this,e,t)}checkMessageNotOpened(){if(this.activeMessage)throw new bl(this.activeMessage.id)}},t=new WeakMap,(()=>{var t;const c="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=a[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[ee.observable],r=[ee.action],n=[ee.action],s=[ee.action],Sl(e,null,i,{kind:"accessor",name:"_activeMessage",static:!1,private:!1,access:{has:e=>"_activeMessage"in e,get:e=>e._activeMessage,set:(e,t)=>{e._activeMessage=t}},metadata:c},l,d),Sl(e,null,r,{kind:"method",name:"showMessageById",static:!1,private:!1,access:{has:e=>"showMessageById"in e,get:e=>e.showMessageById},metadata:c},null,o),Sl(e,null,n,{kind:"method",name:"showMessageByEvent",static:!1,private:!1,access:{has:e=>"showMessageByEvent"in e,get:e=>e.showMessageByEvent},metadata:c},null,o),Sl(e,null,s,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:c},null,o),c&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})})(),Object.defineProperty(e,"id",{enumerable:!0,configurable:!0,writable:!0,value:"IamReaderViewModel"}),e})();var Cl=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Ml{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(i())}),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}preload(){return Cl(this,void 0,void 0,(function*(){const e=(yield this.iamReader.preload()).map((e=>e.toPublicDto()));return this.eventEmitter.emit(yl.Loaded,{messages:e}),e}))}showMessageById(e,t){return Cl(this,void 0,void 0,(function*(){return(yield this.iamReader.showMessageById(e,t)).toPublicDto()}))}showMessageByEvent(e,t){return Cl(this,void 0,void 0,(function*(){return(yield this.iamReader.showMessageByEvent(e,t)).toPublicDto()}))}close(){return Cl(this,void 0,void 0,(function*(){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 Pl{constructor(e,t,i){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:i}),Object.defineProperty(this,"eventId",{enumerable:!0,configurable:!0,writable:!0,value:(0,Y.v4)()})}toQueryParams(){return{ei:this.eventId,ii:this.iterationId,si:this.slideIndex,st:this.slideTotal}}}class jl extends Pl{constructor(e,t,i,r){super(e,t,i),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:r})}get type(){return"close"}toQueryParams(){return Object.assign(Object.assign({},super.toQueryParams()),{d:this.duration})}}class El extends Pl{constructor(e,t,i){super(e,t,i)}get type(){return"open"}toQueryParams(){return super.toQueryParams()}}class Ll extends Pl{constructor(e,t,i,r,n){super(e,t,i),Object.defineProperty(this,"duration",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"widgetEvent",{enumerable:!0,configurable:!0,writable:!0,value:n})}get type(){return this.widgetEvent.type}toQueryParams(){return Object.assign(Object.assign(Object.assign({},super.toQueryParams()),this.widgetEvent.toQueryParams()),{d:this.duration})}}var Al=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Il{constructor(e){Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"iterationId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_openTime",{enumerable:!0,configurable:!0,writable:!0,value:0})}get openTime(){return this._openTime}get timeSinceLastShow(){return Date.now()-this.openTime}trackOpen(e){return Al(this,void 0,void 0,(function*(){this.iterationId=this.generateId(),this._openTime=Date.now();const t=new El(this.iterationId,e.activeSlideIndex,e.slides.length);yield this.iamApi.emitMessageEvent(e.id,t)}))}trackClose(e){return Al(this,void 0,void 0,(function*(){const t=this.timeSinceLastShow,i=new jl(this.iterationId,e.activeSlideIndex,e.slides.length,t);yield this.iamApi.emitMessageEvent(e.id,i)}))}trackWidgetEvent(e,t){return Al(this,void 0,void 0,(function*(){const i=this.timeSinceLastShow,r=new Ll(this.iterationId,e.activeSlideIndex,e.slides.length,i,t);return this.iamApi.emitMessageEvent(e.id,r)}))}generateId(){return(0,Y.v4)()}}class Tl extends Error{constructor(){super("[IAM]: you must close other opened readers"),this.name="IamOtherReaderIsOpenError"}}class Rl extends Error{constructor(){super("[IAM]: you need preload in app messages"),this.name="IamShowOnlyIfLoadedError"}}class Dl extends Error{constructor(){super("[IAM]: show message frequency limit exceeded"),this.name="IamFrequencyLimitError"}}class Bl extends Error{constructor(){super("[IAM]: not in display time range"),this.name="IamCheckDisplayTimeRangeError"}}class Nl extends Error{constructor(e){super(`[IAM]: the limit for displaying IAM with ID ${e} has been reached`),this.name="IamMessageLimitExceededError"}}class Fl{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 Tl),this}checkShowOnlyIfLoaded(e){return!this.iamStore.isLoaded&&e&&this.errors.push(new Rl),this}checkFrequencyLimit(e){return e.frequencyLimitTimeExceeded&&this.errors.push(new Dl),this}checkDisplayTimeRange(e){return e.withinDisplayTimeRange||this.errors.push(new Bl),this}validate(){if(this.errors.length>0)throw this.errors.shift()}}var Wl,Vl=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class zl{constructor(e,t,i){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:i})}getMessageById(e,t){return Vl(this,void 0,void 0,(function*(){new Fl(this.storyManager,this.iamStore).checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t).validate();const i=yield this.iamStore.findById(e);return i.hasLimit&&(yield this.checkMesageLimit(e)),i}))}getMessageByEvent(e,t){return Vl(this,void 0,void 0,(function*(){const i=new Fl(this.storyManager,this.iamStore);i.checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t).validate(),yield this.iamStore.preload();const r=this.iamStore.findByEvent(e);return i.checkFrequencyLimit(r).checkDisplayTimeRange(r).validate(),r.hasLimit&&(yield this.checkMesageLimit(r.id)),r}))}checkMesageLimit(e){return Vl(this,void 0,void 0,(function*(){const{canOpen:t}=yield this.iamApi.checkMesageLimit(e);if(!t)throw new Nl(e)}))}}!function(e){e[e.BottomSheet=1]="BottomSheet",e[e.Modal=2]="Modal",e[e.Fullscreen=3]="Fullscreen"}(Wl||(Wl={}));class Ul extends Error{constructor(e){super(`[IAM]: not found IAM for ID <${e}>`),this.name="IamNotFoundByIdError"}}class Gl extends Error{constructor(e){super(`[IAM]: not found IAM limit for ID <${e}>`),this.name="IamNotFoundLimitError"}}var $l=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Hl=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},ql=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const Ql="campaign_name,id,events,appearance,slides_html,type,frequency_limit,display_to,display_from,need_placeholders,has_limit".split(",").map((e=>`messages.${e}`)).join(",");let Kl=(()=>{var e;let t,i,r,n,s=[];return e=class{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:($l(this,s),e)})}fetchAll(){return ql(this,void 0,void 0,(function*(){try{yield this.openSession();return(yield Ae.get("inappmessaging",{fields:Ql})).data.messages}catch(e){return[]}}))}fetchContext(){return ql(this,void 0,void 0,(function*(){yield this.openSession();return(yield Ae.get("inappmessaging/message-context",{fields:"style,widgetsData"})).data}))}fetchById(e){return ql(this,void 0,void 0,(function*(){yield this.openSession();const t=(yield Ae.get("inappmessaging",{id:e,fields:Ql})).data.messages.find((t=>t.id.toString()===e.toString()));if(!t)throw new Ul(e);return t}))}emitMessageEvent(e,t){return ql(this,void 0,void 0,(function*(){try{if(this.storyManager.isStatisticsDisabled)return void console.log(`[IAM]: message <${t.type.toUpperCase()}> event`,{messageId:e,messageEvent:t,type:t.type});yield Ae.post(`/inappmessaging/message/${e}/event/${t.type}`,t.toQueryParams())}catch(e){console.error(e)}}))}fetchUserData(e){return ql(this,void 0,void 0,(function*(){try{return(yield Ae.get(`/inappmessaging/message/${e}/data`)).data.data}catch(e){console.error(e)}}))}updateUserData(e,t){return ql(this,void 0,void 0,(function*(){try{if(this.storyManager.isStatisticsDisabled)return void console.log("[IAM]: update user data",{messageId:e,payload:t});yield Ae.request({url:`/inappmessaging/message/${e}/data`,method:"put",data:{data:t}})}catch(e){console.error(e)}}))}checkMesageLimit(e){return ql(this,void 0,void 0,(function*(){if(this.storyManager.isStatisticsDisabled)return{canOpen:!0};const t=(yield Ae.post("inappmessaging/message-limit",{id:[e]})).data.find((t=>t.messageId.toString()===e.toString()));if(!t)throw new Gl(e);return t}))}openSession(){return ql(this,void 0,void 0,(function*(){var e,t;(null===(t=null===(e=Ie.getState())||void 0===e?void 0:e.session)||void 0===t?void 0:t.id)||(yield Te())}))}},(()=>{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[re],i=[re],r=[re],n=[re],Hl(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),Hl(e,null,i,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:a},null,s),Hl(e,null,r,{kind:"method",name:"fetchById",static:!1,private:!1,access:{has:e=>"fetchById"in e,get:e=>e.fetchById},metadata:a},null,s),Hl(e,null,n,{kind:"method",name:"openSession",static:!1,private:!1,access:{has:e=>"openSession"in e,get:e=>e.openSession},metadata:a},null,s),a&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),e})();class Yl{constructor(e,t){var i,r,n,s,a,o;Object.defineProperty(this,"storyFeed",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyItem",{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});const l=Rt.createInstance(Gt,Object.assign(Object.assign({},e),{slides:[]}));this.id=l.id,this.title=l.title,this.titleColor=l.title_color,this.hasAudio=null!==(i=l.has_audio)&&void 0!==i&&i,this.hasSwipeUp=null!==(r=l.has_swipe_up)&&void 0!==r&&r,this.isOpened=l.is_opened,this.deeplink=null!==(n=l.deeplink)&&void 0!==n?n:void 0,this.gameInstanceId=null!==(a=null===(s=l.game_instance)||void 0===s?void 0:s.id)&&void 0!==a?a:void 0,this.hideInReader=null!==(o=l.hide_in_reader)&&void 0!==o&&o,this.hideTimeline=l.hide_timeline,this.isOpened=l.isOpened,this.storyItem=l}getCover(e){var t,i,r,n;return{imageSrc:null===(i=null===(t=this.storyItem.image)||void 0===t?void 0:t.findOneByCoverQuality(e))||void 0===i?void 0:i.url,videoSrc:null!==(r=this.storyItem.videoCoverSrc)&&void 0!==r?r:void 0,backgroundColor:this.storyItem.background_color,feedCoverSrc:null===(n=this.storyFeed)||void 0===n?void 0:n.coverSrc}}}var Zl=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Jl=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Xl=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},ed=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let td=(()=>{var e,t;let i,r,n=it,s=[],a=[],o=[];return e=class extends n{get topStory(){return Xl(this,t,"f")}set topStory(e){ed(this,t,e,"f")}constructor(e={feed:"default"}){super(),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:(Zl(this,s),e)}),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,"storiesSubscription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"feedsSubscription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"feed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,Zl(this,a,null)),Object.defineProperty(this,"_activeIndex",{enumerable:!0,configurable:!0,writable:!0,value:(Zl(this,o),-1)}),this.handleStoriesChange=this.handleStoriesChange.bind(this),this.handleFeedsChange=this.handleFeedsChange.bind(this),this.storiesSubscription=Qe.watch(this.handleStoriesChange),this.feedsSubscription=ze.watch(this.handleFeedsChange)}get stories(){return this.storyModels.map((e=>this.createStackFeedStoryByModel(e)))}get length(){return this.storyModels.length}get activeIndex(){return this._activeIndex}get feedCoverSrc(){var e;return null===(e=this.feed)||void 0===e?void 0:e.coverSrc}get top(){return this.topStory}reload(){this.storyModels=[],this.unreadedStoryModels=new Map}destroy(){this.storiesSubscription.unsubscribe(),this.feedsSubscription.unsubscribe(),this.emit("destroy")}markStoryAsOpened(e){this.unreadedStoryModels.delete(e),this.resetUnreadedStories(),this.update()}resetUnreadedStories(){0===this.unreadedStoryModels.size&&(this.unreadedStoryModels=new Map(this.storyModels.map((e=>[e.id,e]))))}handleStoriesChange(e){var t;const i=null!==(t=e[this.options.feed])&&void 0!==t?t:[];0!==i.length&&(this.storyModels=i.slice(),this.resetUnreadedStories(),this.update())}handleFeedsChange(e){this.feed=e[this.options.feed]}createStackFeedStoryByModel(e){return new Yl(e,this.feed)}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=this.createStackFeedStoryByModel(e),this.onUpdateTopStory(this.topStory),this.emit("update",this.topStory)}},t=new WeakMap,(()=>{var t;const l="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=n[Symbol.metadata])&&void 0!==t?t:null):void 0;i=[ee.observable],r=[ee.computed],Jl(e,null,i,{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:l},a,o),Jl(e,null,r,{kind:"getter",name:"top",static:!1,private:!1,access:{has:e=>"top"in e,get:e=>e.top},metadata:l},null,s),l&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:l})})(),e})();var id=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class rd extends td{constructor(e,t){super(t),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"feedCoverageAnalyticsCalculator",{enumerable:!0,configurable:!0,writable:!0,value:new kd}),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}),this._id=(0,Y.v4)(),this.handleShowStory=this.handleShowStory.bind(this),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.handleEventBusEvents=this.handleEventBusEvents.bind(this),this.subscribeToStoryReader(),this.subscribeToFeedCoverageAnalytics(),this.storyManager.setViewModel(this._id,this)}reload(){const e=Object.create(null,{reload:{get:()=>super.reload}});return id(this,void 0,void 0,(function*(){return this.firstStoryShown=!1,e.reload.call(this),this.loadStories()}))}destroy(){const e=this.storyManager.storyReaderViewModel;null==e||e.off("showStory",this.handleShowStory),null==e||e.off(vo.Close,this.handleCloseStoryReader),qt.off("openGame",this.handleShowStory),qt.off("clickOnStoryDeepLink",this.handleShowStory),this.feedCoverageAnalyticsCalculator.destroy(),super.destroy(),this.storyManager.deleteViewModel(this._id)}showStory(e){var t;const i=sc.instance,r=ae()(e.deeplink)&&e.deeplink.trim().length>0,n=e.gameInstanceId;if(!e.hideInReader||r||n){if(r&&null!==e.deeplink){const t={index:0,id:e.id,story:e,isDeeplink:!0,url:e.deeplink};return i.clickOnButtonAction({src:x.STACK_STORY_LIST,payload:t}),void this.markStoryAsOpened(e.id)}if(n)return i.openGame(n).catch(console.error),void this.markStoryAsOpened(e.id);null===(t=this.storyManager.storyReaderViewModel)||void 0===t||t.showMultipleStories({storyId:e.id,listType:A.default,windowReferer:L.stacked,feed:this.options.feed}),this.markStoryAsOpened(e.id)}else console.error("[StackedStoryList]: Cannot open hidden story id "+e.id)}handleCloseStoryReader(){this.top&&this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(this.top.id)}markStoryAsOpened(e){zr.markAsOpened(e),this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(e),super.markStoryAsOpened(e)}onUpdateTopStory(e){this.firstStoryShown||(this.firstStoryShown=!0,this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(e.id))}subscribeToStoryReader(){return id(this,void 0,void 0,(function*(){try{const e=this.storyManager.storyReaderViewModel;qt.on("openGame",this.handleEventBusEvents),qt.on("clickOnStoryDeepLink",this.handleEventBusEvents),null==e||e.on("showStory",this.handleShowStory),null==e||e.on(vo.Close,this.handleCloseStoryReader)}catch(e){console.error("[StackedStoryList]: error while story reader init")}}))}handleShowStory({id:e}){this.markStoryAsOpened(e)}handleEventBusEvents({id:e}){this.markStoryAsOpened(e)}loadStories(){return id(this,void 0,void 0,(function*(){try{this.emit("startLoad"),yield Mr({defaultList:{feedSlug:this.options.feed,filter:{}},onboardingList:!1,favoriteList:!1}),this.emit("endLoad")}catch(e){console.error("[StackedStoryList]: error while story list loaded")}}))}subscribeToFeedCoverageAnalytics(){const e=new Pd(this.storyManager,{listType:We.DEFAULT,feed:this.options.feed,filter:{}});this.feedCoverageAnalyticsCalculator.on("feedImpression",e.handle)}}class nd{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}createStoryReader(){return new xo(this.storyManager).create()}createGameReader(){return new ha(this.storyManager).create()}createStoryList(){return new yd(this.storyManager).create()}createInAppMessagingReader(){const e=this.storyManager.rootStore.iamStore;return new kl(this.storyManager,e,new zl(this.storyManager,e,new Kl(this.storyManager)))}}class sd extends it{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}),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,"magazineName",{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,"background",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"favorite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"like",{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,"hideInReader",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"gameInstance",{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,"isFavoriteCard",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isUgcCard",{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,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"videoCoverSrc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"videoCover",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=this.story.id,this.title=this.story.title,this.titleColor=this.story.title_color,this.magazineName=this.story.magazine_name,this.background=this.story.background,this.backgroundColor=this.story.background_color,this.favorite=this.story.favorite,this.like=this.story.like,this.deeplink=this.story.deeplink,this.hideInReader=this.story.hide_in_reader,this.gameInstance=this.story.game_instance,this.hasAudio=this.story.has_audio,this.isFavoriteCard=this.story.favorite_cell,this.isUgcCard=this.story.ugc_card_cell,this.isOpened=this.story.is_opened,this.image=this.story.image,this.videoCover=this.story._video_cover,this.videoCoverSrc=this.story.videoCoverSrc}getAspectRatio(e){var t,i;switch(e){case P.STYLE_CIRCLE:case P.STYLE_QUAD:return 1;case P.STYLE_RECTANGLE:return null!==(i=null===(t=this.storyListViewModel.session)||void 0===t?void 0:t.preview_aspect_ratio)&&void 0!==i?i:.8;default:return 1}}getImageSrcByCoverQuality(e){var t,i;return null===(i=null===(t=this.story.image)||void 0===t?void 0:t.findOneByCoverQuality(e))||void 0===i?void 0:i.url}onClick(e){this.storyListViewModel.onStoryClick(this,e)}destroy(){}}class ad extends sd{constructor(e,t){super(e,t)}getImageSrcByCoverQuality(e){var t,i;return null===(i=null===(t=this.story.image)||void 0===t?void 0:t.findOneByCoverQuality(e))||void 0===i?void 0:i.url}}class od{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){zr.markAsOpened(e.id),this.handleClickOnStoryCardDeepLink({id:e.id,index:t.index,isDeeplink:!0,url:e.deeplink},{listType:this.storyListViewModel.params.listType})}handleClickOnStoryCardDeepLink(e,{listType:t}){var i;const r={data:[[1,0,e.id,0,0]]},n=()=>{e.isDeeplink&&e.url&&this.storyManager.clickOnButtonAction({src:x.STORY_LIST,payload:e})};t===We.UGC||(null===(i=this.storyManager.getConfig())||void 0===i?void 0:i.disableStatistic)?n():Le("session/update",r,Z.createFunctionWithTimeout(n,1e3))}}class ld{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 i;zr.markAsOpened(e.id),qt.emit(na.OpenGame,{gameId:null===(i=e.gameInstance)||void 0===i?void 0:i.id})}}var dd=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class cd{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 i={index:t.index,isDeeplink:!1,id:e.id,listType:A.default,windowReferer:L.default};this.openStoryReader(i),this.emitClickOnStory({id:e.id,index:t.index,isDeeplink:!1},{feedSlug:this.storyListViewModel.params.feedSlug,filter:this.storyListViewModel.params.filter})}openStoryReader(e){return dd(this,void 0,void 0,(function*(){try{const t=this.storyListViewModel.params.feedSlug;e.listType=this.storyListViewModel.params.isFavorite?A.favorite:A.default,e.windowReferer=this.storyListViewModel.params.isFavorite?L.favorite:L.default,yield this.storyManager.storyReaderViewModel.showMultipleStories({storyId:e.id,feed:t,listType:e.listType,filter:this.storyListViewModel.params.filter})}catch(e){console.error(e)}}))}emitClickOnStory(e,t){const i=t.feedSlug,r=t.filter,n=It(i),s=Ge.getState().find((t=>t.id===e.id)),a={title:null,tags:[],slidesCount:null,feed:null,filter:null,source:null};s&&(a.title=s.stat_title,a.tags=s.tags,a.slidesCount=s.slides_count),n===We.DEFAULT?a.feed=i:n===We.UGC&&(a.filter=r),a.source=E.list,this.storyManager.emit("clickOnStory",Object.assign(Object.assign({},e),a))}}class ud{static createHandler(e,t,i){const{deeplink:r,hideInReader:n,gameInstance:s}=e,a=ae()(r)&&r.trim().length>0,o=null==s?void 0:s.id;return this.isInvalidStoryClick(Boolean(n),a,o,e.id)?null:a?new od(t,i):o?new ld(t,i):new cd(t,i)}static isInvalidStoryClick(e,t,i,r){return!(!e||t||i)&&(console.error(`Cannot open hidden story id ${r}`),!0)}}var hd=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},pd=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},fd=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},gd=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},vd=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let md=(()=>{var e,t,i,r,n,s;let a,o,l,d,c,u,h,p,f,g,v,m,b,y,w,S,_,x,O=it,k=[],C=[],M=[],P=[],j=[],E=[],L=[],A=[],I=[],T=[],R=[];return e=class extends O{get _defaultStories(){return gd(this,t,"f")}set _defaultStories(e){vd(this,t,e,"f")}get _favoriteStories(){return gd(this,i,"f")}set _favoriteStories(e){vd(this,i,e,"f")}get _session(){return gd(this,r,"f")}set _session(e){vd(this,r,e,"f")}get _modeDesktop(){return gd(this,n,"f")}set _modeDesktop(e){vd(this,n,e,"f")}get _params(){return gd(this,s,"f")}set _params(e){vd(this,s,e,"f")}set modeDesktop(e){this._modeDesktop!==e&&(this._modeDesktop=e)}get id(){return this._id}get modeDesktop(){return this._modeDesktop}get session(){return this._session}get defaultStories(){return this._defaultStories}get favoriteStories(){return this._favoriteStories}get params(){return this._params}constructor(a,o){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:(hd(this,k),a)}),Object.defineProperty(this,"storiesService",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t.set(this,hd(this,C,[])),i.set(this,(hd(this,M),hd(this,P,[]))),r.set(this,(hd(this,j),hd(this,E,null))),n.set(this,(hd(this,L),hd(this,A,!0))),Object.defineProperty(this,"subscriptions",{enumerable:!0,configurable:!0,writable:!0,value:(hd(this,I),[])}),s.set(this,hd(this,T,{listType:We.DEFAULT,feedSlug:"",useUgcCard:!1,isFavorite:!1,hasFavorite:!1})),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:(hd(this,R),!1)}),this._id="StoryListViewModel"+e.index++,this.setDefaultStories=this.setDefaultStories.bind(this),this.setFavoriteStories=this.setFavoriteStories.bind(this),this.storyManager.setViewModel(this._id,this)}get hasFavoriteCard(){return this._params.hasFavorite&&this._favoriteStories.length>0}get hasUgcCard(){return this._params.useUgcCard}get hasFavoriteStories(){return this._params.hasFavorite&&this._params.listType===We.DEFAULT}setParams(e){this.unsubscribeStoriesService(),this._params=e,this.subscribeToStoriesService()}onStoryClick(e,t=0){var i;null===(i=ud.createHandler(e,this.storyManager,this))||void 0===i||i.handle(e,{index:t})}destroy(){this.removeAllListeners(),this.unsubscribeStoriesService(),this.storyManager.deleteViewModel(this._id)}reload(){return fd(this,void 0,void 0,(function*(){yield this.loadStories({needFavorite:!1})}))}loadStories(e){return fd(this,void 0,void 0,(function*(){var t;if(this.isLoading)return;const i=Boolean(this._params.hasFavorite)&&e.needFavorite,r={feed:this._params.feedSlug,filter:{},defaultListLength:0,favoriteListLength:0,success:!0,error:{name:"",networkStatus:200,networkMessage:""}};try{this.emit("startLoading"),this.isLoading=!0;const{defaultStories:e,favoriteStories:t}=yield this.storiesService.loadStories(Object.assign(Object.assign({},this._params),{needFavorite:i}));r.success=!0,r.error=null,r.defaultListLength=e.length,this._params.hasFavorite&&this._params.listType===We.DEFAULT&&(r.favoriteListLength=t.length)}catch(e){console.error(e),r.success=!1,e instanceof Oe&&(r.error={name:e.name,networkMessage:e.networkMessage,networkStatus:e.networkStatus})}finally{this.isLoading=!1,r.filter=null!==(t=this._params.filter)&&void 0!==t?t:{},this.emit("endLoading",r)}}))}subscribeToStoriesService(){const e=this.storiesService.observeDefaultStories(this._params.feedSlug).watch(this.setDefaultStories);if(this.hasFavoriteStories){const e=this.storiesService.observeFavoriteStories().watch(this.setFavoriteStories);this.subscriptions.push(e)}const t=this.storiesService.observeSession().watch((0,ee.action)((e=>{this._session=e})));this.subscriptions.push(e,t)}unsubscribeStoriesService(){this.subscriptions.forEach((e=>e.unsubscribe())),this.subscriptions=[]}setDefaultStories(e){this._defaultStories=e.map((e=>new sd(this,e)))}setFavoriteStories(e){this._favoriteStories=e.map((e=>new ad(this,e)))}},t=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,(()=>{var t;const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(t=O[Symbol.metadata])&&void 0!==t?t:null):void 0;a=[ee.observable],o=[ee.observable],l=[ee.observable],d=[ee.observable],c=[ee.observable],u=[ee.action],h=[ee.computed],p=[ee.computed],f=[ee.computed],g=[ee.computed],v=[ee.computed],m=[ee.computed],b=[ee.computed],y=[ee.computed],w=[ee.action],S=[ee.action],_=[ee.action],x=[ee.action],pd(e,null,a,{kind:"accessor",name:"_defaultStories",static:!1,private:!1,access:{has:e=>"_defaultStories"in e,get:e=>e._defaultStories,set:(e,t)=>{e._defaultStories=t}},metadata:i},C,M),pd(e,null,o,{kind:"accessor",name:"_favoriteStories",static:!1,private:!1,access:{has:e=>"_favoriteStories"in e,get:e=>e._favoriteStories,set:(e,t)=>{e._favoriteStories=t}},metadata:i},P,j),pd(e,null,l,{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:i},E,L),pd(e,null,d,{kind:"accessor",name:"_modeDesktop",static:!1,private:!1,access:{has:e=>"_modeDesktop"in e,get:e=>e._modeDesktop,set:(e,t)=>{e._modeDesktop=t}},metadata:i},A,I),pd(e,null,c,{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:i},T,R),pd(e,null,u,{kind:"setter",name:"modeDesktop",static:!1,private:!1,access:{has:e=>"modeDesktop"in e,set:(e,t)=>{e.modeDesktop=t}},metadata:i},null,k),pd(e,null,h,{kind:"getter",name:"modeDesktop",static:!1,private:!1,access:{has:e=>"modeDesktop"in e,get:e=>e.modeDesktop},metadata:i},null,k),pd(e,null,p,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:i},null,k),pd(e,null,f,{kind:"getter",name:"defaultStories",static:!1,private:!1,access:{has:e=>"defaultStories"in e,get:e=>e.defaultStories},metadata:i},null,k),pd(e,null,g,{kind:"getter",name:"favoriteStories",static:!1,private:!1,access:{has:e=>"favoriteStories"in e,get:e=>e.favoriteStories},metadata:i},null,k),pd(e,null,v,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:i},null,k),pd(e,null,m,{kind:"getter",name:"hasFavoriteCard",static:!1,private:!1,access:{has:e=>"hasFavoriteCard"in e,get:e=>e.hasFavoriteCard},metadata:i},null,k),pd(e,null,b,{kind:"getter",name:"hasUgcCard",static:!1,private:!1,access:{has:e=>"hasUgcCard"in e,get:e=>e.hasUgcCard},metadata:i},null,k),pd(e,null,y,{kind:"getter",name:"hasFavoriteStories",static:!1,private:!1,access:{has:e=>"hasFavoriteStories"in e,get:e=>e.hasFavoriteStories},metadata:i},null,k),pd(e,null,w,{kind:"method",name:"setParams",static:!1,private:!1,access:{has:e=>"setParams"in e,get:e=>e.setParams},metadata:i},null,k),pd(e,null,S,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:i},null,k),pd(e,null,_,{kind:"method",name:"setDefaultStories",static:!1,private:!1,access:{has:e=>"setDefaultStories"in e,get:e=>e.setDefaultStories},metadata:i},null,k),pd(e,null,x,{kind:"method",name:"setFavoriteStories",static:!1,private:!1,access:{has:e=>"setFavoriteStories"in e,get:e=>e.setFavoriteStories},metadata:i},null,k),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),Object.defineProperty(e,"index",{enumerable:!0,configurable:!0,writable:!0,value:0}),e})();class bd extends sd{constructor(e,t){super(e,t),Object.defineProperty(this,"favoriteStories",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.favoriteStories=this.storyListViewModel.favoriteStories.slice()}}class yd{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}create(){const e=new Td(this.storyManager);return new md(this.storyManager,e)}}class wd{static create(e,t){const i=Rt.createInstance(Gt,{id:0,title:t.title.content,title_color:t.title.color,is_opened:!0,background_color:"white"});return i.favorite_cell=!0,new bd(e,i)}}class Sd{static create(e,t){let i=[];t.image&&t.image.svgSrc&&t.image.svgSrc.baseState&&i.push({width:100,height:100,type:"h",url:`data:image/svg+xml,${qi(t.image.svgSrc.baseState)}`});const r=Rt.createInstance(Gt,{id:-100,title:t.title.content,title_color:t.title.color,is_opened:!1,background_color:t.backgroundColor,image:i});return r.ugc_card_cell=!0,new sd(e,r)}}class _d{constructor(e=0,t=0,i=0,r=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=i,this.height=r}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),i=Math.max(this.x,e.x),r=Math.min(this.y+this.height,e.y+e.height),n=Math.max(this.y,e.y);return new _d(Math.min(t,i),Math.min(r,n),Math.max(0,t-i),Math.max(0,r-n))}getArea(){return this.width*this.height}getAreaFraction(e){return+(this.getArea()/e.getArea()*100).toFixed(2)}static clone(e){return new _d(e.x,e.y,e.width,e.height)}}class xd{constructor(e){Object.defineProperty(this,"feedCoverageAnalyticsCalculator",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storiesIds",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"getNewStoriesIds",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=[];for(const i of e)this.storiesIds.has(i)||t.push(i);return t}})}markStoryAsFullVisible(e){this.storiesIds.has(e)||(this.storiesIds.add(e),this.feedCoverageAnalyticsCalculator.emit("feedImpression",[e]))}calculate(e){const t=this.getNewStoriesIds(e.map((({id:e})=>e)));t.forEach((e=>this.storiesIds.add(e))),0!==t.length&&this.feedCoverageAnalyticsCalculator.emit("feedImpression",t)}}class Od{constructor(e){Object.defineProperty(this,"feedCoverageAnalyticsCalculator",{enumerable:!0,configurable:!0,writable:!0,value:e})}calculate(e){const t=e.map((({id:e,areaFraction:t})=>({storyId:e,visibleArea:Math.round(t)/100})));0!==t.length&&this.feedCoverageAnalyticsCalculator.emit("visibleAreaUpdated",t)}}class kd extends t.EventEmitter{constructor(){super(),Object.defineProperty(this,"storyRects",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:new _d}),Object.defineProperty(this,"feedImpressionMetric",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"visibleAreaMetric",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filterStoryRectIntersections",{enumerable:!0,configurable:!0,writable:!0,value:e=>e.filter((e=>-100!==e.id&&e.areaFraction>0))}),this.feedImpressionMetric=new xd(this),this.visibleAreaMetric=new Od(this)}calculate(e){const t=this.getScrollViewportByCalculationParams(e),i=this.getStoryRectIntersectionsWithViewport(t),r=this.filterStoryRectIntersections(i);this.calculateMetrics(r)}setViewport(e){this.viewport=e}setStoryRects(e){this.storyRects=e}markStoryAsFullVisible(e){this.feedImpressionMetric.markStoryAsFullVisible(e)}destroy(){this.removeAllListeners()}getScrollViewportByCalculationParams(e){const t=_d.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}calculateMetrics(e){this.feedImpressionMetric.calculate(e),this.visibleAreaMetric.calculate(e)}getStoryRectIntersectionsWithViewport(e){const t=[];for(const i of this.storyRects)if(i.overlaps(e)){const r=i.getIntersection(e);t.push({id:i.id,areaFraction:r.getAreaFraction(i)})}else t.push({id:i.id,areaFraction:0});return t}}class Cd extends _d{constructor(e,t=0,i=0,r=0,n=0){super(t,i,r,n),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e}static clone(e){return new Cd(e.id,e.x,e.y,e.width,e.height)}}class Md{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})}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),this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:this.minOffsetLeft,maxOffsetLeft:this.maxOffsetLeft,minOffsetTop:this.minOffsetTop,maxOffsetTop:this.maxOffsetTop})}calculate(e,t){this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:e,maxOffsetLeft:e,minOffsetTop:t,maxOffsetTop:t})}updateGeometry({stories:e,storyListRect:t,windowRect:i,viewportPadding:r}){this.viewportPadding=r,this.setViewport(t,i),this.setStoryRects(e,t)}destroy(){this.feedCoverageAnalyticsCalculator.destroy()}markStoryAsFullVisible(e){this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(e)}setViewport(e,t){const i=this.getViewportByWindowAndStoryList(t,e);this.applyPaddingToViewport(i,e),this.feedCoverageAnalyticsCalculator.setViewport(i)}getViewportByWindowAndStoryList(e,t){let i=new _d;return t.overlaps(e)?(i=t.getIntersection(e),i):i}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 i=[];e.forEach(((r,n)=>{const s=Number(r.dataset.id),a=new Cd(s,r.offsetLeft,r.offsetTop,r.clientWidth,r.clientHeight);i.push(a),a.x+=t.x,a.y+=t.y,this.applyPaddingAndNegativeMarginToStoryRect(a,n,e.length-1)})),this.feedCoverageAnalyticsCalculator.setStoryRects(i)}applyPaddingAndNegativeMarginToStoryRect(e,t,i){const r=this.viewportPadding;0===t&&(e.x+=r.left,e.width-=r.left),t===i&&(e.width-=r.right)}}class Pd{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.handle=this.handle.bind(this)}handle(e){const t=N.getState();this.params.listType!==We.DEFAULT||t.disableStatistic||Fe(e);const i=this.params.feed,r=this.params.filter,n=It(i),s={stories:e.map((e=>{const t={title:null,tags:[],slidesCount:null},i=Ge.getState().find((t=>t.id===e));return i&&(t.title=i.stat_title,t.tags=i.tags,t.slidesCount=i.slides_count,i.type===We.UGC&&(t.ugcPayload=lt()(i.payload)?i.payload:{})),Object.assign({id:e},t)})),feed:null,filter:null};n===We.DEFAULT?s.feed=i:n===We.UGC&&(s.filter=r),this.storyManager.emit("feedImpression",s)}}class jd{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:t}),this.handle=this.handle.bind(this)}handle(e){const t=this.params.feed,i=this.params.filter,r=It(t),n={stories:e.map((({storyId:e,visibleArea:t})=>{const i={title:null,tags:[],slidesCount:null,visibleArea:t},r=Ge.getState().find((t=>t.id===e));return r&&(i.title=r.stat_title,i.tags=r.tags,i.slidesCount=r.slides_count,r.type===We.UGC&&(i.ugcPayload=lt()(r.payload)?r.payload:{})),Object.assign({id:e},i)})),feed:null,filter:null};r===We.DEFAULT?n.feed=t:r===We.UGC&&(n.filter=i),this.storyManager.emit("visibleAreaUpdated",n)}}class Ed{constructor(e,t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:t})}create(){const e=new kd,t=new Pd(this.storyManager,this.params),i=new jd(this.storyManager,this.params);e.on("feedImpression",t.handle),e.on("visibleAreaUpdated",i.handle);return new Md(e)}}const Ld=(e,t)=>{let i=[];switch(e){case A.default:i=t?Qe.getState()[t]:[];break;case A.favorite:i=Ye.getState();break;case A.onboarding:i=t?Ke.getState()[t]:[]}return null!=i?i:[]};class Ad extends Rt{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"expire_in",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"closed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"share",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"user_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"server_timestamp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"is_allow_profiling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"preview_aspect_ratio",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"session",{enumerable:!0,configurable:!0,writable:!0,value:{id:""}})}singleModelWrapper(){return""}attributes(){return Bt()(super.attributes(),["server_timestamp","session","cache","share","user_key","placeholders","is_allow_profiling","preview_aspect_ratio"])}}var Id=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Td{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}loadStories(e){return Id(this,arguments,void 0,(function*({feedSlug:e,filter:t,listType:i,testKey:r,needFavorite:n=!0}){const s=i===We.DEFAULT&&n;yield Mr({defaultList:{feedSlug:e,filter:t},onboardingList:!1,favoriteList:s,testKey:r});const a=Ld(A.default,e),o=(e=>e===nc?We.UGC:We.DEFAULT)(e),l={stories:a.map((e=>{const t={title:null,tags:[],slidesCount:null};return e&&(t.title=e.stat_title,t.tags=e.tags,t.slidesCount=e.slides_count,e.type===We.UGC&&(t.ugcPayload=lt()(e.payload)?e.payload:{})),Object.assign({id:e.id},t)})),feed:null,filter:null};o===We.DEFAULT?l.feed=e:o===We.UGC&&(l.filter=t),this.storyManager.emit("feedLoad",l);return{defaultStories:Ld(A.default,e),favoriteStories:Ld(A.favorite,e)}}))}observeDefaultStories(e){return Qe.map((t=>{var i;return(null!==(i=t[e])&&void 0!==i?i:[]).map((e=>this.createStoryByData(Object.assign(Object.assign({},e),{slides_html:[]}))))}))}observeFavoriteStories(){return Ye.map((e=>e.map((e=>this.createStoryByData(Object.assign(Object.assign({},e),{slides_html:[]}))))))}observeSession(){return Ie.map((e=>Rt.createInstance(Ad,e)))}createStoryByData(e){return e instanceof Gt?e:Rt.createInstance(Gt,e)}}var Rd=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Dd{static getUgcEditorConfig(){return Rd(this,void 0,void 0,(function*(){var e;let t=Ie.getState();yield Te(),(null==t?void 0:t.editor)||(yield cr({}));const i=N.getState(),r=Ie.getState(),n="3.2.0-rc.0";return{sessionId:r.session.id,apiKey:i.apiKey,editor:null!==(e=r.editor)&&void 0!==e?e:{},sdkVersion:n,appPackageId:i.appPackageId,deviceId:$.getState(),userId:null!=i.userId?String(i.userId):void 0,lang:i.lang.toString()}}))}}var Bd=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Nd extends t.EventEmitter{constructor(e,t,i,r){super(),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,"storyId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"showSharePage",{enumerable:!0,configurable:!0,writable:!0,value:()=>Bd(this,void 0,void 0,(function*(){var e;this.handleStartLoad();const t=null===(e=this.storyManager.getConfig())||void 0===e?void 0:e.disableStatistic,i=yield this.storyReaderViewModel.showStoryFromSharePage(this.storyId,t);this.handleEndLoad(i)}))}),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.showSharePage(),this.storyReaderViewModel.once(vo.Close,this.handleCloseStoryReader)}closeStoryReader(){return Bd(this,void 0,void 0,(function*(){this.storyManager.closeStoryReader()}))}handleStartLoad(){setTimeout((()=>{var e;this.emit(o.START_LOADING),K()(null===(e=this.options)||void 0===e?void 0:e.handleStartLoad)&&this.options.handleStartLoad()}))}handleEndLoad(e){var t;this.emit(o.END_LOADING,{result:e}),K()(null===(t=this.options)||void 0===t?void 0:t.handleStopLoad)&&this.options.handleStopLoad(e)}handleCloseStoryReader(){var e,t,i;if(K()(null===(e=this.options)||void 0===e?void 0:e.handleStoryReaderClose)||this.listenerCount(o.CLOSE_STORY_READER)>0)try{K()(null===(t=this.options)||void 0===t?void 0:t.handleStoryReaderClose)&&(null===(i=this.options)||void 0===i||i.handleStoryReaderClose()),this.emit(o.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}}}var Fd=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class Wd{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),dt(`[PluginManager]: plugin ${e.name} registered`),e.install(this.storyManager,t),dt(`[PluginManager]: plugin ${e.name} installed`)}uninstall(e){e.uninstall(this.storyManager),this.plugins.delete(e.name),dt(`[PluginManager]: plugin ${e.name} uninstalled`)}get(e){return this.plugins.get(e)}}class Vd extends Error{constructor(e){super(`[IAM]: not found IAM for event <${e}>`),this.name="IamNotFoundByEventError"}}var zd=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Ud=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Gd=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},$d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Hd=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};let qd=(()=>{var e,t,i,r;let n,s,a,o,l,d,c,u=[],h=[],p=[],f=[],g=[],v=[],m=[];return e=class{get _messages(){return $d(this,t,"f")}set _messages(e){Hd(this,t,e,"f")}get _isLoaded(){return $d(this,i,"f")}set _isLoaded(e){Hd(this,i,e,"f")}get _isLoading(){return $d(this,r,"f")}set _isLoading(e){Hd(this,r,e,"f")}constructor(e,n){Object.defineProperty(this,"rootStore",{enumerable:!0,configurable:!0,writable:!0,value:(zd(this,u),e)}),Object.defineProperty(this,"iamApi",{enumerable:!0,configurable:!0,writable:!0,value:n}),t.set(this,zd(this,h,new Map)),i.set(this,(zd(this,p),zd(this,f,!1))),r.set(this,(zd(this,g),zd(this,v,!1))),Object.defineProperty(this,"_messageContext",{enumerable:!0,configurable:!0,writable:!0,value:zd(this,m)})}get messages(){return Array.from(this._messages.values())}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}get messageContext(){return this._messageContext}preload(){return Gd(this,void 0,void 0,(function*(){try{if(this._isLoaded)return this.messages;this._isLoading=!0;const e=yield this.fetchAll();return this._isLoaded=!0,e}catch(e){throw console.error(e),e}finally{this._isLoading=!1}}))}findById(e){return Gd(this,void 0,void 0,(function*(){const t=this._messages.get(e.toString());return t||this.fetchById(e)}))}findByEvent(e){let t=Array.from(this._messages.values()).find((t=>t.matchWithEvent(e)));if(t)return t;throw new Vd(e)}updateMessageUserData(e,t){return Gd(this,void 0,void 0,(function*(){return this.iamApi.updateUserData(e,t)}))}fetchById(e){return Gd(this,void 0,void 0,(function*(){yield this.fetchMessageContext();const t=yield this.iamApi.fetchById(e);return this.createMessageByDto(t)}))}fetchAll(){return Gd(this,void 0,void 0,(function*(){yield this.fetchMessageContext();const e=yield this.iamApi.fetchAll();return this.createMessagesByDtos(e)}))}fetchMessageContext(){return Gd(this,void 0,void 0,(function*(){this._messageContext||(this._messageContext=yield this.iamApi.fetchContext())}))}createMessagesByDtos(e){const t=[];for(const i of e){const e=this.createMessageByDto(i);t.push(e)}return t}createMessageByDto(e){const t=tl.createByDto(e,this,new Il(this.iamApi));return this._messages.has(t.id.toString())||this._messages.set(t.id.toString(),t),t}},t=new WeakMap,i=new WeakMap,r=new WeakMap,(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;n=[ee.observable],s=[ee.observable],a=[ee.observable],o=[ee.computed],l=[ee.computed],d=[ee.computed],c=[ee.computed],Ud(e,null,n,{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},h,p),Ud(e,null,s,{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},f,g),Ud(e,null,a,{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},v,m),Ud(e,null,o,{kind:"getter",name:"messages",static:!1,private:!1,access:{has:e=>"messages"in e,get:e=>e.messages},metadata:t},null,u),Ud(e,null,l,{kind:"getter",name:"isLoaded",static:!1,private:!1,access:{has:e=>"isLoaded"in e,get:e=>e.isLoaded},metadata:t},null,u),Ud(e,null,d,{kind:"getter",name:"isLoading",static:!1,private:!1,access:{has:e=>"isLoading"in e,get:e=>e.isLoading},metadata:t},null,u),Ud(e,null,c,{kind:"getter",name:"messageContext",static:!1,private:!1,access:{has:e=>"messageContext"in e,get:e=>e.messageContext},metadata:t},null,u),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();class Qd{constructor(e){Object.defineProperty(this,"iamStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.iamStore=new qd(this,new Kl(e))}}var Kd=S(986),Yd=S.n(Kd);function Zd(e){let t=e.length;for(let i=e.length-1;i>=0;i--){const r=e.charCodeAt(i);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&i--}return t}class Jd{constructor(){return Object.defineProperty(this,"_sdkConfigIsIncorrect",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userIdByteLimit",{enumerable:!0,configurable:!0,writable:!0,value:255}),Object.defineProperty(this,"_tagsByteLimit",{enumerable:!0,configurable:!0,writable:!0,value:4e3}),Object.defineProperty(this,"userMessage",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"tagsMessage",{enumerable:!0,configurable:!0,writable:!0,value:""}),Jd.instance||(Jd.instance=this),Jd.instance}static getInstance(){return Jd.instance?Jd.instance:new Jd}get sdkConfigIsIncorrect(){return this._sdkConfigIsIncorrect}get sdkConfigErrorsAsArray(){const e=[];return this.userMessage&&e.push(this.userMessage),this.tagsMessage&&e.push(this.tagsMessage),e}checkUserIdLength(e){this.userMessage="",null!=e&&Zd(String(e))>this._userIdByteLimit&&(console.error(`UserId is bigger then ${this._userIdByteLimit} bytes`),this._sdkConfigIsIncorrect=!0,this.userMessage=`UserId "${String(e)}" is bigger then ${this._userIdByteLimit} bytes`)}checkTagsLength(e){this.tagsMessage="",null!=e&&Array.isArray(e)&&Zd(e.join(","))>this._tagsByteLimit&&(console.error(`Tags (joined by ',') is bigger then ${this._tagsByteLimit} bytes`),this._sdkConfigIsIncorrect=!0,this.tagsMessage=`Tags (joined by ',') "${e.join(",")}" is bigger then ${this._tagsByteLimit} bytes`)}}var Xd=S(6343),ec=S.n(Xd),tc=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class ic{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_isStatisticsDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get config(){return this._config}get isStatisticsDisabled(){return this._isStatisticsDisabled}setConfig(e){this.config?this.updateConfig(e):this.initializeConfig(e)}setTags(e){this.config&&!ec()(this.config.tags,e)&&(Jd.getInstance().checkTagsLength(e),W({tags:e}),this.config.tags=e)}setUserId(e,t){return tc(this,void 0,void 0,(function*(){(ae()(e)||Yd()(e))&&this.config&&this.config.userId!==e&&(this.config.userId=e,Jd.getInstance().checkUserIdLength(e),V({userId:e,userIdSign:t}),Be(),yield this.storyManager.closeAllReaders(),yield this.storyManager.reloadAllStoryLists(),yield this.storyManager.reloadAllStackedStoryLists())}))}setLang(e){return tc(this,void 0,void 0,(function*(){ae()(e)&&this.config&&this.config.lang.toRawData()!==e&&(G({lang:e}),this.config.lang=new y(e),Be(),yield this.storyManager.closeAllReaders(),yield this.storyManager.reloadAllStoryLists(),yield this.storyManager.reloadAllStackedStoryLists())}))}setApiKey(e){this.config&&this.config.apiKey!==e&&(Me(e),F({apiKey:e}),Be(),this.config.apiKey=e)}setPlaceholders(e){lt()(e)&&this.config&&!ec()(this.config.placeholders,e)&&(z({placeholders:e}),wt(e),this.config.placeholders=e)}setImagePlaceholders(e){lt()(e)&&this.config&&!ec()(this.config.imagePlaceholders,e)&&(U({imagePlaceholders:e}),mt(e),this.config.imagePlaceholders=e)}clear(){this._config=null,q(),Be()}waitStoryManagerConfig(){return tc(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{let i;const r=()=>{if(this.storyManager.getConfig())return clearTimeout(i),void e();requestAnimationFrame(r)};i=setTimeout((()=>{t("[IAS]: Timeout waiting for InAppStoryManager config")}),5e3),r()}))}))}initializeConfig(e){this.validateConfig(e),Me(e.apiKey),this._isStatisticsDisabled="com.inappstory.webpreview"===e.appPackageId,e.disableStatistic=this._isStatisticsDisabled,F(e),e.placeholders&&wt(e.placeholders),e.imagePlaceholders&&mt(e.imagePlaceholders),Be(),this._config=N.getState()}validateConfig(e){if(e.disableDeviceId&&!e.userId)throw new Error("You must pass the `userId` value");Jd.getInstance().checkUserIdLength(e.userId),Jd.getInstance().checkTagsLength(e.tags)}updateConfig(e){e.lang&&this.setLang(e.lang),this.setApiKey(e.apiKey),e.userId&&this.setUserId(e.userId,e.userIdSign),e.tags&&this.setTags(e.tags),e.placeholders&&this.setPlaceholders(e.placeholders),e.imagePlaceholders&&this.setImagePlaceholders(e.imagePlaceholders)}}var rc=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const nc="{{__ugc__}}";class sc extends t.EventEmitter{constructor(){return super(),Object.defineProperty(this,"viewModelStore",{enumerable:!0,configurable:!0,writable:!0,value:new nt}),Object.defineProperty(this,"callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"pluginManager",{enumerable:!0,configurable:!0,writable:!0,value:new Wd(this)}),Object.defineProperty(this,"_rootStore",{enumerable:!0,configurable:!0,writable:!0,value:new Qd(this)}),Object.defineProperty(this,"storyManagerConfigController",{enumerable:!0,configurable:!0,writable:!0,value:new ic(this)}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:this.createInAppMessagingReader()}),Object.defineProperty(this,"clickOnButtonAction",{enumerable:!0,configurable:!0,writable:!0,value:({src:e,payload:t})=>{if(K()(this.callbacks.storyLinkClickHandler)||this.listenerCount(T.CLICK_ON_STORY)>0){const i={src:e,data:t};try{K()(this.callbacks.storyLinkClickHandler)&&this.callbacks.storyLinkClickHandler(i),this.emit(T.CLICK_ON_STORY,i)}catch(e){console.error(e)}}else window.open(t.url,"_self")}}),sc.isSingletonInstanceExists()||(sc.instance=this),sc.instance}static get combinedPlaceholders(){return xt()}get rootStore(){return this._rootStore}get sdkVersionName(){return"3.2.0-rc.0"}get sdkVersionCode(){return parseInt(30200)}get lang(){return N.getState().lang}set storyLinkClickHandler(e){K()(e)&&(this.callbacks.storyLinkClickHandler=e)}get storyReaderViewModel(){return this.viewModelStore.get(_o.id)}get gameReaderViewModel(){return this.viewModelStore.get(ua.id)}get isStatisticsDisabled(){return this.storyManagerConfigController.isStatisticsDisabled}static getInstance(){return sc.instance?sc.instance:null}setViewModel(e,t){this.viewModelStore.set(e,t)}deleteViewModel(e){this.viewModelStore.delete(e)}getViewModelByKey(e){return this.viewModelStore.get(e)}getConfig(){return this.storyManagerConfigController.config}setConfig(e){this.storyManagerConfigController.setConfig(e)}waitStoryManagerConfig(){return rc(this,void 0,void 0,(function*(){return this.storyManagerConfigController.waitStoryManagerConfig()}))}showOnboardingStories(e){return rc(this,void 0,void 0,(function*(){return(yield this.viewModelStore.wait(_o.id)).showOnboardingStories(e)}))}showStory(e){return rc(this,void 0,void 0,(function*(){"string"==typeof e&&(e=+e||e);const t=yield this.viewModelStore.wait(_o.id);yield t.showStory(e,"")}))}showStoryOnce(e){return rc(this,void 0,void 0,(function*(){"string"==typeof e&&(e=+e||e);const t=yield this.viewModelStore.wait(_o.id);yield t.showStoryOnce(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()}openGame(e){return rc(this,arguments,void 0,(function*(e,t={}){const i=yield this.viewModelStore.wait(ua.id);yield i.openGame(e,t)}))}closeGame(){return rc(this,void 0,void 0,(function*(){return this.gameReaderViewModel.closeGame()}))}closeStoryReader(){return rc(this,void 0,void 0,(function*(){this.storyReaderViewModel.close()}))}getUgcEditorConfig(){return rc(this,void 0,void 0,(function*(){return Dd.getUgcEditorConfig()}))}showSharePage(e,t){return rc(this,void 0,void 0,(function*(){return"string"==typeof e&&(e=+e||e),yield this.viewModelStore.wait(_o.id),new Nd(this,this.storyReaderViewModel,e,t)}))}reloadAllStoryLists(){const e=this.viewModelStore.getAllOfType((e=>e instanceof md));return Promise.all(e.map((e=>e.reload())))}reloadAllStackedStoryLists(){const e=this.viewModelStore.getAllOfType((e=>e instanceof rd));return Promise.all(e.map((e=>e.reload())))}static isSingletonInstanceExists(){return!!sc.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 nd(this).createStoryReader()}createGameReader(){return new nd(this).createGameReader()}createStoryList(){return new nd(this).createStoryList()}createInAppMessagingReader(){return new nd(this).createInAppMessagingReader()}clearConfig(){this.storyManagerConfigController.clear()}}const ac=new sc;new class{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:new Ml(this.storyManager.inAppMessaging)})}get sdkVersionName(){return this.storyManager.sdkVersionName}get sdkVersionCode(){return this.storyManager.sdkVersionCode}set storyLinkClickHandler(e){this.storyManager.storyLinkClickHandler=e}getConfig(){return this.storyManager.getConfig()}getNonce(){return X()}showOnboardingStories(e){return Fd(this,void 0,void 0,(function*(){return this.storyManager.showOnboardingStories(e)}))}showStory(e){return Fd(this,void 0,void 0,(function*(){return this.storyManager.showStory(e)}))}showStoryOnce(e){return Fd(this,void 0,void 0,(function*(){return this.storyManager.showStoryOnce(e)}))}closeAllReaders(){this.storyManager.closeAllReaders()}openGame(e){return Fd(this,arguments,void 0,(function*(e,t={}){return this.storyManager.openGame(e,t)}))}closeGame(){return Fd(this,void 0,void 0,(function*(){return this.storyManager.closeGame()}))}closeStoryReader(){return Fd(this,void 0,void 0,(function*(){return this.storyManager.closeStoryReader()}))}getUgcEditorConfig(){return this.storyManager.getUgcEditorConfig()}showSharePage(e,t){return this.storyManager.showSharePage(e,t)}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){ac.use(e,t)}}(ac);var oc;!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"}(oc||(oc={}));Error;class lc extends t.EventEmitter{constructor(){super(),Object.defineProperty(this,"_commonOptions",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_storiesListOptions",{enumerable:!0,configurable:!0,writable:!0,value:g}),Object.defineProperty(this,"_storyReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:M}),Object.defineProperty(this,"_storyFavoriteReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:v}),Object.defineProperty(this,"_goodsWidgetOptions",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_gameReaderOptions",{enumerable:!0,configurable:!0,writable:!0,value:n})}setCommonOptions(e,t=!0){return this._commonOptions=es()(this._commonOptions,e),this.emit(oc.UPDATE,this.commonOptions),this}get commonOptions(){return this._commonOptions}setStoriesListOptions(e,t=!0){return this._storiesListOptions=es()(this._storiesListOptions,e),t&&(this.emit(oc.UPDATE,this.storiesListOptions),this.emit(oc.EVENT_UPDATED_STORIES_LIST_OPTIONS,this.storiesListOptions)),this}get storiesListOptions(){return this._storiesListOptions}setStoryReaderOptions(e,t=!0){return this._storyReaderOptions=es()(this._storyReaderOptions,e,{arrayMerge:(e,t,i)=>t}),t&&this.emit(oc.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=es()(this._storyFavoriteReaderOptions,e),t&&this.emit(oc.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=es()(this._goodsWidgetOptions,e),t&&this.emit(oc.UPDATE,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}setGameReaderOptions(e,t=!0){return this._gameReaderOptions=es()(this._gameReaderOptions,e),t&&this.emit(oc.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)}}class dc{constructor(){Object.defineProperty(this,"_storyLists",{enumerable:!0,configurable:!0,writable:!0,value:[]})}get storyLists(){return this._storyLists}addStoryList(e){this._storyLists.push(e)}updateStoryListById(e,t){const i=this._storyLists.findIndex((t=>t.mountSelector===e));this._storyLists[i]=Object.assign(Object.assign({},this._storyLists[i]),t)}removeStoryListById(e){const t=this._storyLists.findIndex((t=>t.mountSelector===e));this._storyLists.splice(t,1)}}class cc extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`)}}const uc=e=>{if(null==e||"object"!=typeof e)throw new cc(null==e?"null":typeof e)};var hc=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class pc extends t.EventEmitter{constructor(e,t,i,r){super(),Object.defineProperty(this,"_mountSelector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyListManager",{enumerable:!0,configurable:!0,writable:!0,value:new dc}),Object.defineProperty(this,"_ugcCardClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),uc(t),this.storyListManager.addStoryList(this),this.app.setStoryList(this.storyListManager.storyLists).catch(console.error)}get mountSelector(){return this._mountSelector}get appearanceManager(){return this._appearanceManager}get type(){return We.DEFAULT}get identityFields(){return{feedSlug:this.feedSlug}}get feedSlug(){return this.params.feed}get testKey(){return this.params.testKey}get useUgcCard(){return this.params.useUgcCard}set ugcCardClickHandler(e){this._ugcCardClickHandler=e}get ugcCardClickHandler(){return this._ugcCardClickHandler}set api(e){this._api=e}reload(){return hc(this,void 0,void 0,(function*(){var e;return null===(e=this._api)||void 0===e?void 0:e.reload()}))}destroy(){this.storyListManager.removeStoryListById(this.mountSelector),this.app.setStoryList(this.storyListManager.storyLists)}}var fc=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class gc extends t.EventEmitter{constructor(e,t,i,r){super(),Object.defineProperty(this,"_mountSelector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"storyListManager",{enumerable:!0,configurable:!0,writable:!0,value:new dc}),Object.defineProperty(this,"_ugcCardClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),uc(t),this.storyListManager.addStoryList(this),this.app.setUGCStoryList(this.storyListManager.storyLists).catch(console.error)}get mountSelector(){return this._mountSelector}get appearanceManager(){return this._appearanceManager}get type(){return We.UGC}get identityFields(){return{feedSlug:this.feedSlug}}get feedSlug(){return nc}get testKey(){return this.params.testKey}get useUgcCard(){return this.params.useUgcCard}set api(e){this._api=e}set ugcCardClickHandler(e){this._ugcCardClickHandler=e}get ugcCardClickHandler(){return this._ugcCardClickHandler}reload(){return fc(this,void 0,void 0,(function*(){var e;return null===(e=this._api)||void 0===e?void 0:e.reload()}))}destroy(){this.storyListManager.removeStoryListById(this.mountSelector)}}var vc=S(1085),mc=S(2236),bc=S(9155),yc=S.n(bc);S(6704);window.__IAS__={storyManager:ac};var wc=S(992),Sc=S.n(wc),_c=S(2591),xc=S.n(_c),Oc=S(4289),kc={insert:"head",singleton:!1};xc()(Oc.A,kc);const Cc=Oc.A.locals||{};var Mc=S(7081),Pc={insert:"head",singleton:!1};xc()(Mc.A,Pc);const jc=Mc.A.locals||{},Ec=({onClick:e,className:t})=>(0,vc.jsx)("div",{className:Sc()(jc.icon,t),onClick:e,children:(0,vc.jsx)("svg",{viewBox:"0 0 24 24",children:(0,vc.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 Lc=S(5669),Ac={insert:"head",singleton:!1};xc()(Lc.A,Ac);const Ic=Lc.A.locals||{},Tc=310/480,Rc=({desktopMode:e,children:t,verticalPadding:i,style:r,isWidescreen:n,className:s})=>{const[a,o]=(0,bc.useState)({width:"0px",height:"0px"});(0,bc.useEffect)((()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)})),[]);const l=()=>{const e=window.innerWidth,t=g(),i=e/window.innerHeight,r=c({aspectRatio:i,vh:t,vw:e}),n=d({aspectRatio:i,vh:t,vw:e});o({width:r,height:n})},d=({aspectRatio:e,vh:t,vw:i})=>{const r=p(e)||f();return e>Tc&&!r?`${h({vh:t,vw:i})}px`:"100%"},c=({aspectRatio:e,vh:t,vw:i})=>e>Tc&&!p(e)?`${u({aspectRatio:e,vh:t,vw:i})}px`:"auto",u=({aspectRatio:t,vh:i,vw:r})=>t>Tc&&!e?r:Math.ceil(i*Tc),h=({vh:t,vw:i})=>e?t:Math.ceil(i/Tc),p=e=>e>Tc&&e-Tc<=.1,f=()=>{let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches},g=()=>{let t=window.innerHeight;return e?(t-=i,t):t},v=n?{width:"100%",height:"100%"}:a;return(0,vc.jsx)("div",{className:Sc()(Ic["aspect-ratio-box"],s,{[Ic["aspect-ratio-box--centered"]]:!n}),style:Object.assign(Object.assign({},r),v),children:(0,vc.jsx)("div",{className:Ic["aspect-ratio-box-inside"],children:t})})};var Dc=S(5757),Bc={insert:"head",singleton:!1};xc()(Dc.A,Bc);const Nc=Dc.A.locals||{},Fc=ce(),Wc=e=>{const[t,i]=(0,bc.useState)(!1),r=(0,bc.useCallback)((()=>{if(e.desktopMode)return;const t=Fc.type!==e.orientation;e.onOrientationChange({type:Fc.type,isWrong:t}),i(t)}),[e.desktopMode,e.orientation]);return(0,bc.useEffect)((()=>(r(),Fc.addEventListener("change",r),()=>{Fc.removeEventListener("change",r)})),[r]),t?(0,vc.jsx)("div",{className:Nc["screen-orientation-lock"]}):null};var Vc=S(8778),zc={insert:"head",singleton:!1};xc()(Vc.A,zc);const Uc=Vc.A.locals||{};var Gc=S(1196),$c={insert:"head",singleton:!1};xc()(Gc.A,$c);const Hc=Gc.A.locals||{};let qc;function Qc(){let e,t;/ipad|iphone/i.test(navigator.userAgent)?(e=document.createRange(),qc&&e.selectNodeContents(qc),t=window.getSelection(),t&&(t.removeAllRanges(),t.addRange(e)),qc&&qc.setSelectionRange(0,999999)):null==qc||qc.select()}const Kc=e=>{!function(e){qc=document.createElement("textarea"),qc.value=e,document.body.appendChild(qc)}(e),Qc(),document.execCommand("copy"),qc&&document.body.removeChild(qc)},Yc=({shareText:e,shareLink:t,sharePanelOptions:i,onShareComplete:r})=>{var n,s,a,o,l,d,c,u,h,p,f;const[g,v]=(0,bc.useState)(!1),[m,b]=(0,bc.useState)(!1),y=()=>{b(!0),!g&&e||r()};return(0,vc.jsxs)("div",{className:`${Uc["share-panel__body"]} ${Hc["share-panel__body_screenshot"]}`,children:[(0,vc.jsx)("div",{className:`${Uc["share-panel-row"]} ${Hc["share-panel-row"]}`,children:(0,vc.jsx)("a",{className:Hc["share-panel-row__image-link"],onClick:y,href:t,download:"image.jpeg",children:(0,vc.jsx)("img",{src:t,className:Hc["share-panel-row__image"]})})}),(0,vc.jsx)("div",{className:Uc["share-panel-separator"],style:{background:null===(n=i.divider)||void 0===n?void 0:n.background}}),(0,vc.jsx)("div",{className:`${Uc["share-panel-row"]} ${Hc["share-panel-row"]}`,children:(0,vc.jsx)("a",{className:Hc["share-item__download-button"],onClick:y,href:t,download:"image.jpeg",children:(0,vc.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(o=null===(a=null===(s=i.downloadButton)||void 0===s?void 0:s.svgSrc)||void 0===a?void 0:a.baseState)&&void 0!==o?o:""}})})}),e?(0,vc.jsxs)(vc.Fragment,{children:[(0,vc.jsx)("div",{className:Uc["share-panel-separator"],style:{background:null===(l=i.divider)||void 0===l?void 0:l.background}}),(0,vc.jsx)("div",{className:`${Uc["share-panel-row"]} ${Hc["share-panel-row"]}`,children:(0,vc.jsxs)("button",{className:Sc()(Hc.btn,Hc["btn-copy"]),onClick:()=>{Kc(null!=e?e:""),v(!0),m&&r()},children:[(0,vc.jsxs)("div",{className:Hc["btn-copy__icon"],children:[(0,vc.jsx)("span",{className:Sc()(Hc["btn-copy__icon-state"],{[Hc["btn-copy__icon-state_default"]]:!g}),dangerouslySetInnerHTML:{__html:null!==(u=null===(c=null===(d=i.copyButton)||void 0===d?void 0:d.svgSrc)||void 0===c?void 0:c.baseState)&&void 0!==u?u:""}}),(0,vc.jsx)("span",{className:Sc()(Hc["btn-copy__icon-state"],{[Hc["btn-copy__icon-state_done"]]:g}),dangerouslySetInnerHTML:{__html:null!==(f=null===(p=null===(h=i.copyButton)||void 0===h?void 0:h.svgSrc)||void 0===p?void 0:p.doneState)&&void 0!==f?f:""}})]}),(0,vc.jsx)("div",{className:Hc["btn-copy__text"],children:e})]})})]}):null]})};var Zc=S(610),Jc={insert:"head",singleton:!1};xc()(Zc.A,Jc);const Xc=Zc.A.locals||{};var eu=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const tu=e=>{var t,i,r,n,s,a,o,l,d,c,u,{shareLink:h,sharePanelOptions:p,onShareComplete:f}=e,g=eu(e,["shareLink","sharePanelOptions","onShareComplete"]);const v=()=>{try{return new URL(h).host}catch(e){return console.error(e),null}},m=()=>{window.removeEventListener("focus",m),f()},b=()=>v()?"":encodeURIComponent(h),y=e=>{var t,i;const r=(()=>{try{return new URL(h)}catch(e){return console.error(e),null}})();if(!r)return"#";const n=null===(t=p.targetParams)||void 0===t?void 0:t[e];return null===(i=null==n?void 0:n.getUrl)||void 0===i?void 0:i.call(n,{url:r.toString(),text:b()})},w=null===(t=p.title)||void 0===t?void 0:t.favicon,S=p.text;return(0,vc.jsxs)("div",{className:Uc["share-panel__body"],children:[(0,vc.jsxs)("div",{className:`${Uc["share-panel-row"]} ${Uc["title-row"]}`,children:[v()&&Boolean(null==w?void 0:w.display)&&(0,vc.jsx)("div",{className:Uc["share-url-favicon"],style:{background:null==w?void 0:w.background},children:(0,vc.jsx)("img",{src:`${null!==(i=g.faviconApiUrl)&&void 0!==i?i:"https://favicon.inappstory.ru"}?sz=64&domain_url=${v()}`})}),(0,vc.jsx)("span",{className:Uc.title,style:S,children:null===(n=null===(r=p.title)||void 0===r?void 0:r.getValue)||void 0===n?void 0:n.call(r,{url:h,text:b()})})]}),(0,vc.jsx)("div",{className:Uc["share-panel-separator"],style:{background:null===(s=p.divider)||void 0===s?void 0:s.background}}),(0,vc.jsx)("div",{className:`${Uc["share-panel-row"]} ${Xc["social-list"]}`,children:null===(a=p.targets)||void 0===a?void 0:a.map(((e,t)=>{var i,r,n;const s=null===(i=p.targetParams)||void 0===i?void 0:i[e],a=null!==(n=null===(r=null==s?void 0:s.icon)||void 0===r?void 0:r.svgSrc.baseState)&&void 0!==n?n:"<svg></svg>";return(0,vc.jsx)("div",{className:Xc["social-list__item"],children:(0,vc.jsxs)("a",{href:y(e),onClick:()=>((e,t,i)=>{window.addEventListener("focus",m),window.open(e,t,i)})(y(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${Uc["share-item"]} ${Xc["share-item"]}`,children:[(0,vc.jsx)("div",{dangerouslySetInnerHTML:{__html:a}}),(0,vc.jsx)("span",{className:Uc["share-item-title"],style:S,children:null==s?void 0:s.label})]})},t)}))}),(0,vc.jsx)("div",{className:Uc["share-panel-separator"],style:{background:null===(o=p.divider)||void 0===o?void 0:o.background}}),(0,vc.jsx)("div",{className:Uc["share-panel-row"],children:(0,vc.jsxs)("a",{className:`${Uc["share-item"]} ${Xc["share-item"]}`,onClick:()=>{Kc(h),f()},children:[(0,vc.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(c=null===(d=null===(l=p.copyButton)||void 0===l?void 0:l.svgSrc)||void 0===d?void 0:d.baseState)&&void 0!==c?c:""}}),(0,vc.jsx)("span",{className:Uc["share-item-title"],style:S,children:null===(u=p.copyButton)||void 0===u?void 0:u.label})]})})]})};var iu;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(iu||(iu={}));const ru=({shareType:e,shareLink:t,shareText:i,onShareCompelete:r,sharePanelOptions:n,className:s})=>{const{dir:a}=lg(),[o,l]=(0,bc.useState)(!1),[d,c]=(0,bc.useState)(!0),u=()=>{l(!0),c(!1)};return(0,vc.jsxs)("div",{dir:a,className:Sc()(Uc["share-panel-wrapper"],s),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,vc.jsx)("div",{className:Sc()(Uc["share-panel-backdrop"],{[Uc.fadeIn]:d,[Uc.fadeOut]:!d}),onClick:()=>{l(!1),c(!1)}}),(0,vc.jsxs)("div",{className:Sc()(Uc["share-panel"],{[Uc.slideIn]:d,[Uc.slideOut]:!d}),onAnimationEnd:()=>{d||r(o)},style:{"--height":"100%",background:n.background,borderTopLeftRadius:n.borderRadius+"px",borderTopRightRadius:n.borderRadius+"px"},children:[e===iu.SlideScreenshot&&(0,vc.jsx)(Yc,{shareText:i,shareLink:t,onShareComplete:u,sharePanelOptions:n}),e===iu.Social&&(0,vc.jsx)(tu,{shareLink:t,onShareComplete:u,sharePanelOptions:n}),(0,vc.jsx)("div",{className:Uc["share-panel-separator"]})]})]})};var nu=S(7495),su={insert:"head",singleton:!1};xc()(nu.A,su);const au=nu.A.locals||{},ou=e=>{const t=(0,bc.useRef)(null),[i,r]=(0,bc.useState)(null);return(0,bc.useEffect)((()=>{const i=e.plugin.createLottiePlayer(t.current,e.config);return r(i),()=>{i.destroy()}}),[e.config.sha1]),(0,bc.useEffect)((()=>{i&&e.forceEnd&&i.stop()}),[i,e.forceEnd]),(0,bc.useEffect)((()=>{if(i)return i.on("play",e.onPlay),i.on("complete",e.onComplete),i.on("beforeLoad",e.onBeforeLoad),i.on("load",e.onLoad),i.on("minPlayingTimeExpired",e.onMinPlayingTimeExpired),i.on("error",e.onError),()=>{i.off("play",e.onPlay),i.off("complete",e.onComplete),i.off("beforeLoad",e.onBeforeLoad),i.off("load",e.onLoad),i.off("minPlayingTimeExpired",e.onMinPlayingTimeExpired),i.off("error",e.onError)}}),[i,e.onError,e.onPlay,e.onComplete,e.onLoad,e.onBeforeLoad,e.onMinPlayingTimeExpired]),(0,vc.jsx)("canvas",{ref:t,style:{width:"100%",height:"100%"}})},lu=e=>{var t,i,r;const{storyManager:n}=lg(),[s,a]=(0,bc.useState)(!1),[o,l]=(0,bc.useState)(!1),[d,c]=(0,bc.useState)(!1),[u,h]=(0,bc.useState)(!1),[p,f]=(0,bc.useState)(!1),[g,v]=(0,bc.useState)(!1),m=o||u||e.isGameLoading||!e.gameShouldBeShown,b=(0,bc.useMemo)((()=>n.getPlugin("dot-lottie")),[n]),y=d||!b||e.isGameLoadingError?null:(null===(i=null===(t=e.game)||void 0===t?void 0:t.splashLottieScreen)||void 0===i?void 0:i.url)&&(null===(r=e.game)||void 0===r?void 0:r.splashLottieScreen),w=e.game&&!e.isGameLoadingError&&m&&!o&&!y,S=()=>{var t,i,r,n;return e.desktopMode&&(null===(i=null===(t=e.game)||void 0===t?void 0:t.splashLandscapeScreen)||void 0===i?void 0:i.url)?e.game.splashLandscapeScreen.url:null===(n=null===(r=e.game)||void 0===r?void 0:r.splashScreen)||void 0===n?void 0:n.url},_=e.isGameInited&&(!y||p);(0,bc.useEffect)((()=>{_&&e.onSplashCanBeHidden()}),[_]);return(0,vc.jsxs)("div",{className:Sc()(au["splash-container"],{[au["splash-container--fadeIn"]]:e.game,[au["splash-container--fadeOut"]]:e.gameShouldBeShown,[au["splash-container--isLoading"]]:w}),children:[(0,vc.jsx)("div",{className:au["splash-container__image"],style:{backgroundColor:e.splashImageBackgroundColor},children:S()&&(0,vc.jsx)("img",{src:S(),onLoad:()=>{v(!0)}})}),y&&b&&(0,vc.jsx)("div",{className:au["splash-container__lottie"],children:(0,vc.jsx)(ou,{plugin:b,forceEnd:e.gameShouldBeShown,config:y,onError:()=>{c(!0)},onPlay:()=>{l(!0),a(!1)},onComplete:()=>{l(!1),a(!0)},onLoad:()=>{h(!1)},onBeforeLoad:()=>{h(!0)},onMinPlayingTimeExpired:()=>{f(!0)}})})]})};var du=S(9843),cu={insert:"head",singleton:!1};xc()(du.A,cu);const uu=du.A.locals||{},hu=e=>{var t,i;return(0,vc.jsx)("button",{dir:e.dir,onClick:e.onCloseGame,className:uu["close-btn"],"data-position":e.closeButtonPosition,dangerouslySetInnerHTML:{__html:null!==(i=null===(t=e.closeButtonOptions)||void 0===t?void 0:t.svgSrc.baseState)&&void 0!==i?i:""}})};var pu=S(5299),fu=S(9514);const gu=(0,pu.observer)((({gameReaderViewModel:e})=>{var t,i,r,n,s,a,o,l;const{desktopMode:d,dir:c,gameReaderOptions:u,storyReaderOptions:h}=lg(),p=(0,bc.useRef)(null),{sharePanelOpeningParams:f,handleShareComplete:g,closeSharePanel:v}=(e=>{const[t,i]=(0,bc.useState)(null);return(0,bc.useEffect)((()=>(null==e||e.on("openSharePanel",i),()=>{null==e||e.off("openSharePanel",i)})),[e]),{sharePanelOpeningParams:t,handleShareComplete:r=>{t&&e&&(e.confirmSharingComplete({shareId:t.shareId,isSuccess:r}),i(null))},closeSharePanel:()=>{i(null)}}})(e);hg((()=>{m()}));const m=()=>{e.closeGame(),v()},{gameLaunch:b,gameLaunchError:y,isGameLoading:w,closeBtnVisible:S}=e,_=Sc()(Cc["game-reader"],{[Cc["game-reader--desktop-mode"]]:d,[Cc["game-reader--widescreen"]]:e.isWidescreen}),x={background:null!==(i=null===(t=u.backdrop)||void 0===t?void 0:t.background)&&void 0!==i?i:"",opacity:null!==(n=null===(r=u.backdrop)||void 0===r?void 0:r.opacity)&&void 0!==n?n:0,filter:(null===(s=u.backdrop)||void 0===s?void 0:s.blur)?`blur(${u.backdrop.blur}px)`:"none"},O=null!==(o=null===(a=u.game)||void 0===a?void 0:a.backdropColor)&&void 0!==o?o:"";return(0,fu.createPortal)((0,vc.jsx)("div",{className:Cc["game-reader-container"],style:{"--game-box-border-radius":`${parseFloat(String(u.borderRadius))}px`},children:(0,vc.jsxs)("div",{className:_,children:[(0,vc.jsx)("div",{className:Cc["game-reader__backdrop"],style:x}),(0,vc.jsxs)(Rc,{className:Cc["game-reader__game-box"],isWidescreen:e.isWidescreen,desktopMode:d,verticalPadding:100,children:[(0,vc.jsx)(lu,{onSplashCanBeHidden:()=>{e.notifyGameCanBeStarted()},desktopMode:d,isGameInited:e.isGameInited,isGameLoading:w,isGameLoadingError:Boolean(e.gameLaunchError),gameShouldBeShown:e.gameShouldBeShown,game:null!==(l=e.gameLaunch)&&void 0!==l?l:void 0,splashImageBackgroundColor:e.gameLaunch?O:x.background}),y&&(0,vc.jsx)(Ec,{className:Cc["game-reader__refresh-btn"],onClick:()=>{e.reload()}}),(!e.gameShouldBeShown||S)&&(0,vc.jsx)(hu,{closeButtonPosition:u.closeButtonPosition,dir:c,onCloseGame:m,closeButtonOptions:u.closeButton}),b&&(0,vc.jsxs)(vc.Fragment,{children:[(0,vc.jsx)("iframe",{src:b.url,onLoad:t=>{p.current=t.target,e.dir=c,e.setGameCenterIframe(p.current)},style:{opacity:e.gameShouldBeShown?1:0},frameBorder:"0",className:Cc["game-reader__iframe"],sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),f&&(0,vc.jsx)(ru,{shareType:f.shareType,shareLink:f.shareLink,onShareCompelete:g,sharePanelOptions:h.sharePanel})]})]}),b&&u.forceCheckOrientation&&(0,vc.jsx)(Wc,{orientation:ue.PORTRAIT_PRIMARY,desktopMode:d,onOrientationChange:({isWrong:t})=>{e.isGameInited&&(t?e.pauseGameUI():e.resumeGameUI())}})]})}),document.body)}));var vu=S(2130),mu={insert:"head",singleton:!1};xc()(vu.A,mu);const bu=vu.A.locals||{};class yu{constructor(e,t,i){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:i}),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})}get closeGestureInAction(){return Zt.getState()}startMove(){ei(),this.windowHeight=this.storiesViewer.clientHeight,this.storiesViewer.style.setProperty("transition","")}move(e){e>10||this.closeGestureInAction?(Xt(),this.moveDownAndScaleReader(e)):(e<-10||this.swipeUpGestureInAction)&&this.moveUp(e)}endMove(){ni(),this.deltaValY>=0&&this.handleSwipeDown(),ei()}moveDownAndScaleReader(e){this.deltaValY=e/this.windowHeight;let t=1-(1-.9)*this.deltaValY;t>=1&&(t=1);let i=100*this.deltaValY*.45;i<=0&&(i=0),this.storiesViewer.style.setProperty("transform",`scale(${t}) translateY(${i}%)`)}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("swipeDown")}),400)}handleSwipeDown(){this.deltaValY<=.15||!this.storyReaderViewModel.canBeClosed()?this.returnToDefaultState():this.closeStoryReader()}}ce();const wu=()=>{const e=window.innerWidth;return{vh:window.innerHeight,vw:e}},Su=e=>50+parseFloat(String(e)),_u=(e,t)=>{const i=e.hasLike&&Boolean(t.hasLike),r=e.hasShare&&Boolean(t.hasShare),n=e.hasFavorite&&Boolean(t.hasFavorite),s=e.hasAudio;return!e.isBlank&&(i||n||r||s)},xu=e=>{const{desktopMode:t,storyReaderOptions:i}=lg();return(0,bc.useMemo)((()=>{const r=Su(i.actionPanelBottomOffset),n=new Ia(e.vw,e.vh,r),s=new Aa(n).create({vw:e.vw,vh:e.vh,desktopMode:t}),a=s instanceof La,o=a?n.getViewportCorrectionPadding():{};return{actionPanelHeight:r,safeAreaFrameCalculator:n,storyGeometry:s,isMobileGeometry:a,correctionPaddingStyle:o}}),[i.actionPanelBottomOffset,e,t])},Ou=(0,pu.observer)((e=>{const t=(0,bc.useRef)(null),i=(0,bc.useRef)(null),{desktopMode:r,storyReaderOptions:n}=lg();(({storyReaderViewModel:e,storiesViewerRef:t,backdropRef:i})=>{const r=(0,bc.useRef)(null);(0,bc.useEffect)((()=>{r.current=new yu(e,t.current,i.current)}),[]);const n=()=>{var e;t.current.classList.add(bu["no-select"]),null===(e=r.current)||void 0===e||e.startMove()},s=({dy:e})=>{var t;null===(t=r.current)||void 0===t||t.move(e)},a=()=>{var i;t.current.classList.remove(bu["no-select"]),e.touchController.verticalSwipeGesture&&(null===(i=r.current)||void 0===i||i.endMove())};(0,bc.useEffect)((()=>{const t=e.touchController;return t.on(Jn.TouchStart,n),t.on(Jn.TouchMoveVertical,s),t.on(Jn.TouchEnd,a),()=>{t.off(Jn.TouchStart,n),t.off(Jn.TouchMoveVertical,s),t.off(Jn.TouchEnd,a)}}),[e.touchController])})({storyReaderViewModel:e.storyReaderViewModel,backdropRef:t,storiesViewerRef:i});const{safeAreaFrameCalculator:s,isMobileGeometry:a}=xu(e.viewport),o=!a||s.shouldBeShownSafeAreaInsets?parseFloat(String(n.borderRadius)):0;return(0,vc.jsxs)(vc.Fragment,{children:[(0,vc.jsxs)("div",{ref:i,className:Sc()("stories-viewer",bu["stories-viewer"],bu.slider3d),style:Object.assign(Object.assign({},{"--loaderBackgroundColor":null===(l=n.loader)||void 0===l?void 0:l.default.color,"--loaderBackgroundAccentColor":null===(d=n.loader)||void 0===d?void 0:d.default.accentColor,"--timelineBlockTopOffset":`${parseFloat(String(n.timelineBlockTopOffset))}px`,"--slideBorderRadius":`${o}px`}),(()=>{var e,t,i,r;return{backgroundColor:null!==(t=null===(e=n.commonBackdrop)||void 0===e?void 0:e.color)&&void 0!==t?t:void 0,backdropFilter:null!==(r=null===(i=n.commonBackdrop)||void 0===i?void 0:i.backdropFilter)&&void 0!==r?r:void 0}})()),children:[r&&(0,vc.jsx)("div",{className:bu["stories-viewer-background"],style:(()=>{var t,i,r;const s=null===(t=e.storyReaderViewModel.activeStory)||void 0===t?void 0:t.displayedSlideImage,a=[];return null!=n.slideBackdrop&&Array.isArray(n.slideBackdrop.linearGradientOverlay)&&a.push(`linear-gradient(${n.slideBackdrop.linearGradientOverlay.join(", ")})`),null!=s&&a.push(`url(${s})`),{backgroundImage:a.join(", "),opacity:(null===(i=n.slideBackdrop)||void 0===i?void 0:i.opacity)||0,filter:(null===(r=n.slideBackdrop)||void 0===r?void 0:r.blur)?`blur(${n.slideBackdrop.blur}px)`:"none"}})()}),e.children]}),(0,vc.jsx)("div",{ref:t,className:Sc()(bu["stories-viewer-backdrop"],{[bu._desktopMode]:r})})]});var l,d}));var ku=S(3390),Cu={insert:"head",singleton:!1};xc()(ku.A,Cu);const Mu=ku.A.locals||{};var Pu=S(2594),ju={insert:"head",singleton:!1};xc()(Pu.A,ju);const Eu=Pu.A.locals||{};var Lu=S(187),Au={insert:"head",singleton:!1};xc()(Lu.A,Au);const Iu=Lu.A.locals||{};function Tu(e,t){e.forEach(t)}function Ru(e,t,i){if(!e)throw Error(`${i?i+": ":""}${t}`)}function Du({node:e=[],from:t,source:i,parent:r=t||i,to:n,target:s,child:a=n||s,scope:o={},meta:l={},family:d={type:"regular"},regional:c}={}){const u=dh(r),h=dh(d.links),p=dh(d.owners),f=[];Tu(e,(e=>e&&rh(f,e)));const g={id:ah(),seq:f,next:dh(a),meta:l,scope:o,family:{type:d.type||"crosslink",links:h,owners:p}};return Tu(h,(e=>rh(zu(e),g))),Tu(p,(e=>rh(Uu(e),g))),Tu(u,(e=>rh(e.next,g))),c&&oh&&lh(Gu(oh),[g]),g}function Bu(e){const t=()=>e();return t.unsubscribe=()=>e(),t}function Nu(e,{scope:t,safe:i}={}){Ru(t||wh||i,"scopeBind: scope not found");const r=t||wh;return t=>{function i(){Sh(a)}let n,s=0;const a=wh;Sh(r);try{n=e(t)}catch(e){n=e,s=1}if(i(),s)throw n;return n instanceof Promise&&n.then(i,i),n}}function Fu({unit:e,fn:t,scope:i,batch:r}){const n=[mh.run({fn:e=>t(e)})];r&&n.unshift(mh.compute({priority:"sampler",batch:1})),Ku(e)&&n.unshift(mh.mov({store:e.stateRef,to:"stack"}));const s=Array.isArray(e)?e:[e];if(i){const e=[],t=i.additionalLinks;return s.forEach((i=>{const r=t[i.graphite.id]||[];t[i.graphite.id]=r;const s=Du({node:Wu(n,i),meta:{watchOp:i.kind}});r.push(s),e.push((()=>{const e=r.indexOf(s);-1!==e&&r.splice(e,1),kh(s)}))})),Bu((()=>{e.forEach((e=>e()))}))}{const e=Du({node:n,parent:s,family:{owners:s}});return Bu((()=>{kh(e)}))}}function Wu(e,t){return Ku(t)?[mh.mov({store:t.stateRef,to:"stack"}),...e]:e}"undefined"!=typeof Symbol&&Symbol.observable;const Vu=e=>e.graphite||e,zu=e=>e.family.owners,Uu=e=>e.family.links,Gu=e=>e.value,$u=e=>e.subscribers,Hu=(e,t)=>Vu(e).meta[t],qu=e=>(uh(e)||ch(e))&&"kind"in e,Qu=e=>t=>qu(t)&&t.kind===e,Ku=Qu("store"),Yu=Qu("event"),Zu=Qu("effect"),Ju=e=>qu(e)&&!!e.targetable,Xu=Qu("domain"),eh=Qu("scope");var th={__proto__:null,unit:qu,store:Ku,event:Yu,effect:Zu,targetable:Ju,domain:Xu,scope:eh,attached:e=>Zu(e)&&1==Hu(e,"attached")};const ih=(e,t)=>{const i=e.indexOf(t);-1!==i&&e.splice(i,1)},rh=(e,t)=>e.push(t),nh=()=>{let e=0;return()=>""+ ++e},sh=(nh(),nh()),ah=nh();nh();let oh=null;const lh=(e,t)=>{const i=Vu(e);Tu(t,(e=>{const t=Vu(e);"domain"!==i.family.type&&(t.family.type="crosslink"),rh(zu(t),i),rh(Uu(i),t)}))},dh=(e=[])=>(Array.isArray(e)?e:[e]).flat().map(Vu),ch=e=>"object"==typeof e&&null!==e,uh=e=>"function"==typeof e,hh=(e,t,i,r)=>{const n={id:sh(),type:e,data:t};return i&&(n.order={priority:i},r&&(n.order.barrierID=++ph)),n};let ph=0;const fh=({from:e="store",store:t,target:i,to:r=(i?"store":"stack"),batch:n,priority:s})=>hh("mov",{from:e,store:t,to:r,target:i},s,n),gh=({fn:e,batch:t,priority:i,safe:r=0,filter:n=0,pure:s=0})=>hh("compute",{fn:e,safe:r,filter:n,pure:s},i,t),vh=({fn:e})=>gh({fn:e,priority:"effect"}),mh={mov:fh,compute:gh,filter:({fn:e,pure:t})=>gh({fn:e,filter:1,pure:t}),run:vh};const bh=[];let yh=0;for(;yh<6;)rh(bh,{first:null,last:null,size:0}),yh+=1;new Set;let wh;const Sh=e=>{wh=e};const _h=(e,t)=>{ih(e.next,t),ih(zu(e),t),ih(Uu(e),t)},xh=(e,t,i)=>{let r;e.next.length=0,e.seq.length=0,e.scope=null;let n=Uu(e);for(;r=n.pop();)_h(r,e),(t||i&&"sample"!==e.meta.op||"crosslink"===r.family.type)&&xh(r,t,"on"!==r.meta.op&&i);for(n=zu(e);r=n.pop();)_h(r,e),i&&"crosslink"===r.family.type&&xh(r,t,"on"!==r.meta.op&&i)},Oh=e=>e.clear(),kh=(e,{deep:t}={})=>{let i=0;if(e.ownerSet&&e.ownerSet.delete(e),Ku(e))Oh($u(e));else if(Xu(e)){i=1;const t=e.history;Oh(t.events),Oh(t.effects),Oh(t.stores),Oh(t.domains)}xh(Vu(e),!!t,i)};Du({node:[vh({fn:({fn:e,value:t})=>e(t)})],meta:{op:"fx",fx:"sidechain"}});var Ch=S(7121),Mh=S(8139);function Ph(e,t){const i=th.unit(e);let r={};i?r={unit:e}:"@@unitShape"in e?"function"==typeof e["@@unitShape"]?r=e["@@unitShape"]():Lh("expect @@unitShape to be a function"):r=e;const n=Array.isArray(r),s=bc.useRef({stale:1,justSubscribed:0,scope:t}),[a,o,l,d,c]=bc.useMemo((()=>{s.current.stale=1;const e=Array.isArray(r)?[]:{},n=[],a=[],o=[],l=[];for(const s in r){if(!{}.hasOwnProperty.call(r,s))continue;const d=r[s];th.unit(d)||Lh(`expect useUnit ${i?"argument":`value in key "${s}"`} to be a unit`),th.event(d)||th.effect(d)?(e[s]=t?Nu(d,{scope:t}):d,o.push(s),l.push(d)):(e[s]=null,n.push(s),a.push(d))}return[e,n,a,o,l]}),[s,t,...Object.keys(r),...Object.values(r)]),u=bc.useRef({value:a,storeKeys:o,eventKeys:d,eventValues:c}),h=bc.useCallback((e=>{const i=s.current;return i.justSubscribed=1,Fu({unit:l,fn:()=>{i.stale||(i.stale=1,e())},scope:t,batch:1})}),[l,t,u,s]),p=bc.useCallback((()=>{const e=u.current,r=s.current;let h,p=0;const f=e.value,g=e.storeKeys,v=e.eventKeys,m=e.eventValues,b=t!==r.scope;if(r.stale||r.justSubscribed||b){p=!r.justSubscribed||b,h=n?[...a]:{...a},g.length===o.length&&v.length===d.length||(p=1);for(let e=0;e<o.length;e++){const i=Th(l[e],t),r=o[e];p||(p=g.includes(r)?f[r]!==i:1),h[r]=i}for(let e=0;e<d.length;e++){const t=c[e],i=d[e];p||(p=v.includes(i)?m[v.indexOf(i)]!==t:1)}}return p&&(e.value=h),e.storeKeys=o,e.eventKeys=d,e.eventValues=c,r.stale=0,r.justSubscribed=!p,r.scope=t,i?e.value.unit:e.value}),[h,l,c,t,u,s]);return Ah(h,p,p)}function jh(e){const t=bc.useContext(Rh);return e&&!t&&Lh("No scope found, consider adding <Provider> to app root"),t}function Eh(e,t){return Ph(e,jh(null==t?void 0:t.forceScope))}const Lh=e=>{throw Error(e)},{useSyncExternalStore:Ah}=("undefined"!=typeof window?bc.useLayoutEffect:bc.useEffect,Mh),{useSyncExternalStoreWithSelector:Ih}=Ch,Th=(e,t)=>t?t.getState(e):e.getState(),Rh=bc.createContext(null),{Provider:Dh}=Rh,Bh=(0,pu.observer)((({story:e,commonOptions:t,storyReaderOptions:i})=>{const{dir:r}=lg(),n=Eh(Jt),s=e.hasLike&&Boolean(t.hasLike),a=e.hasShare&&Boolean(t.hasShare),o=e.hasFavorite&&Boolean(t.hasFavorite),l=e.hasAudio,d=_u(e,t)?Su(i.actionPanelBottomOffset):0;return(0,vc.jsx)("div",{dir:r,className:Iu["stories-button-panel"],style:{height:`${d}px`,transform:`translateY(${d}px)`},children:_u(e,t)&&(0,vc.jsxs)("div",{className:Iu["stories-button-panel-actions"],children:[(()=>{if(!s)return null;const t=0===e.like||-1===e.like,r=0===e.like||1===e.like;return(0,vc.jsxs)("span",{children:[(0,vc.jsx)("span",{className:Sc()(Iu["button-panel-action"],{"like-up":t,"like-up-filled":1===e.like}),dangerouslySetInnerHTML:{__html:t?i.likeButton.svgSrc.baseState:i.likeButton.svgSrc.activeState},onClick:()=>{e.setLike(1===e.like?0:1)}}),(0,vc.jsx)("span",{className:Sc()(Iu["button-panel-action"],{"like-down":r,"like-down-filled":-1===e.like}),dangerouslySetInnerHTML:{__html:r?i.dislikeButton.svgSrc.baseState:i.dislikeButton.svgSrc.activeState},onClick:()=>{e.setDislike(-1===e.like?0:-1)}})]})})(),o&&(0,vc.jsx)("span",{children:(0,vc.jsx)("span",{className:Sc()(Iu["button-panel-action"],{bookmark:!e.favorite,"bookmark-filled":e.favorite}),dangerouslySetInnerHTML:{__html:e.favorite?i.favoriteButton.svgSrc.activeState:i.favoriteButton.svgSrc.baseState},onClick:()=>e.setBookmark(!e.favorite)})}),(0,vc.jsxs)("span",{className:Iu["right-container"],children:[l&&(0,vc.jsx)("span",{children:(0,vc.jsx)("span",{className:Sc()(Iu["button-panel-action"],{"muted-icon":n,"sound-icon":!n}),dangerouslySetInnerHTML:{__html:n?i.muteButton.svgSrc.baseState:i.muteButton.svgSrc.activeState},onClick:()=>{n?ii():ti()}})}),a&&(0,vc.jsx)("span",{className:Iu["button-panel-action"],dangerouslySetInnerHTML:{__html:i.shareButton.svgSrc.baseState},onClick:()=>{e.share()}})]})]})})}));var Nh=S(2349),Fh={insert:"head",singleton:!1};xc()(Nh.A,Fh);const Wh=Nh.A.locals||{},Vh=e=>{var t,i;const{dir:r}=lg(),n=Eh(Kt);return(0,vc.jsx)("div",{className:Wh["story-header"],children:!e.closeDisabled&&(0,vc.jsx)("button",{dir:r,"data-position":e.options.closeButtonPosition,className:Sc()(Wh["stories-viewer__close"],{[Wh["_paused-ui"]]:n}),onClick:t=>{t.stopPropagation(),t.preventDefault(),e.onClose()},dangerouslySetInnerHTML:{__html:null!==(i=null===(t=e.options.closeButton)||void 0===t?void 0:t.svgSrc.baseState)&&void 0!==i?i:""}})})};var zh=S(3278),Uh={insert:"head",singleton:!1};xc()(zh.A,Uh);const Gh=zh.A.locals||{};var $h=S(6323),Hh={insert:"head",singleton:!1};xc()($h.A,Hh);$h.A.locals;const qh=e=>{const t=e.slide,{slideContentRef:i}=(({slide:e,activeStory:t,currentStory:i,needSlideInitByFlipping:r,currentSlideIndex:n,activeSlideIndex:s,slidesLoaded:a})=>{const o=(0,bc.useRef)(null),[l,d]=Eh([Jt,Yt]),c=t.id===i.id,u=c||r,h=s===n,p=u&&a&&e.state===Ns.Idle&&h,f=!(e.state!==Ns.Started&&e.state!==Ns.Error||h&&u),g=c&&h&&e.state===Ns.Loaded;return(0,bc.useLayoutEffect)((()=>{p&&e.init(o.current)}),[e,p]),(0,bc.useLayoutEffect)((()=>{g&&e.start()}),[c,g]),(0,bc.useLayoutEffect)((()=>{f&&e.stop()}),[f]),(0,bc.useEffect)((()=>{d?e.pause():e.resume()}),[e,d,e.state]),(0,bc.useEffect)((()=>{l?e.mute():e.unmute()}),[e,l,e.state]),(0,bc.useLayoutEffect)((()=>()=>{e.stop()}),[e]),{slideContentRef:o}})(e),r=t.state===Ns.Loading||!e.slidesLoaded,n=t.state===Ns.Loading||!e.slidesLoaded;return{slideContentRef:i,needLoadingMask:r,isVisible:t.state===Ns.Loaded||t.state===Ns.Started||t.state===Ns.Paused,needLoadingAnimation:n}};var Qh=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const Kh=(0,pu.observer)((e=>{var{geometry:t}=e,i=Qh(e,["geometry"]);const{desktopMode:r,dir:n}=lg(),{slideContentRef:s,needLoadingAnimation:a,needLoadingMask:o}=qh(i),{slideStyle:l,slideContentStyle:d,needBottomPanel:c}=(({geometry:e,currentStory:t})=>{const{storyReaderOptions:i,commonOptions:r}=lg(),n=(0,bc.useMemo)((()=>_u(t,r)),[t,r]),s=n?Su(i.actionPanelBottomOffset):0;return{needBottomPanel:n,slideStyle:(0,bc.useMemo)((()=>({margin:e.getOffset(s),width:e.getWidth(),height:e.getHeight(),"--y-offset":e.getOffsetY(s),"--x-offset":e.getOffsetX(s)})),[s,e]),slideContentStyle:(0,bc.useMemo)((()=>({fontSize:e.getFontSize()})),[e])}})({geometry:t,currentStory:i.currentStory}),u=i.networkError||i.slide.state===Ns.Error;return(0,vc.jsxs)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),i.clickDisabled||(e=>{const s=e.target,a=new Bs(i.slide,e,t,n,r);i.slide.onClick(s,a)})(e)},className:Sc()(Gh["stories-slide"],{[Gh["active-slide"]]:i.currentSlideIndex===i.activeSlideIndex,[Gh["_with-bottom-panel"]]:c,[Gh["_desktop-mode"]]:t instanceof Ea}),children:[(0,vc.jsx)("div",{className:Gh["stories-slide-offset"],style:l,children:(0,vc.jsx)("div",{className:Gh["stories-slide-box"],"data-testid":"stories-slide-box",children:(0,vc.jsx)("div",{ref:s,dangerouslySetInnerHTML:{__html:i.slide.html},className:`${Gh["stories-slide-content"]} narrative-slide"`,style:d})})}),(o||u)&&(0,vc.jsx)("div",{className:Gh["load-mask"],onClick:e=>{e.preventDefault(),i.networkError&&e.stopPropagation()},children:u?(0,vc.jsx)(Ec,{className:Gh["stories-slide__refresh-btn"],onClick:e=>{e.stopPropagation(),i.networkError?i.onReloadStory():i.slide.reload()}}):a&&(0,vc.jsx)("div",{className:Gh["loading-spinner-default"]})})]})}));var Yh=S(9137),Zh={insert:"head",singleton:!1};xc()(Yh.A,Zh);const Jh=Yh.A.locals||{},Xh=(0,bc.forwardRef)(((e,t)=>{const{desktopMode:i,dir:r}=lg(),n=Eh(Kt);return(0,vc.jsx)("div",{ref:t,dir:r,className:Sc()(Jh["stories-pager"],{[Jh["_desktop-mode"]]:i,[Jh["_paused-ui"]]:n}),style:{"--stories-pager-tick-foreground":e.timeline.foreground,"--stories-pager-background":e.timeline.background},children:(0,vc.jsx)("div",{className:`${Jh["stories-pager__ticks"]} ${Sc()({[Jh.hiddenTimeline]:e.hiddenTimeline})}`,children:new Array(e.slidesLength).fill(0).map(((t,i)=>(0,vc.jsxs)("div",{className:Jh["stories-pager__tick"],children:[(0,vc.jsx)("div",{className:Sc()(Jh["stories-pager__tick-progress"],{[Jh._active]:i+1<=e.activeSlideIndex})}),(0,vc.jsx)("div",{className:Jh["stories-pager__tick-progress-loader"],style:{display:i+1===e.activeSlideIndex+1?"block":"none"}})]},i+1)))})})}));var ep=S(6212),tp={insert:"head",singleton:!1};xc()(ep.A,tp);const ip=ep.A.locals||{};var rp=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const np=e=>{const t=(0,bc.useRef)(null),i=(0,bc.useRef)(null),r=(0,bc.useRef)(0),n=(0,bc.useRef)(0);let s;const a=()=>{i.current&&(n.current=-1*function(e){const t=window.getComputedStyle(e),i=t.transform||t.webkitTransform||t.mozTransform;if("none"===i)return{x:0,y:0,z:0};const r=i.includes("3d")?"3d":"2d",n=i.match(/matrix.*\((.+)\)/)[1].split(", ");return"2d"===r?{x:isNaN(n[4])?0:n[4],y:isNaN(n[5])?0:n[5],z:0}:"3d"===r?{x:isNaN(n[12])?0:n[12],y:isNaN(n[13])?0:n[13],z:isNaN(n[14])?0:n[14]}:{x:0,y:0,z:0}}(i.current).x)},[o,l]=(0,bc.useState)(!1),[d,c]=(0,bc.useState)(!1),u=(0,bc.useRef)(!1),h=()=>{const t=bc.Children.count(e.children);return i.current&&t?i.current.scrollWidth/t:0};let p=!1;(0,bc.useEffect)((()=>{var e;return("ontouchstart"in window||window.navigator.msPointerEnabled||"ontouchstart"in document.documentElement)&&(p=!0),p||(i.current&&(s=null===(e=i.current.children[0])||void 0===e?void 0:e.offsetWidth),i.current&&(r.current=i.current.scrollWidth-i.current.clientWidth,a()),r.current===n.current?c(!1):c(!0),0===n.current?l(!1):l(!0)),()=>{}}),[]);const f=(0,bc.useRef)(!1),g=(0,bc.useRef)(0);let v=0;const m=(0,bc.useRef)(!1),[b,y]=(0,bc.useState)(0),w=e=>{e<0&&(e=0),e>r.current&&(e=r.current),y(e)};(0,bc.useEffect)((()=>{b===r.current?c(!1):c(!0),l(0!==b)}),[b]);const S=e=>{if(!u.current)if(f.current){const t=e instanceof MouseEvent?e.pageX:e.touches&&e.touches[0].pageX;if(t!==g.current){m.current=!0,v=t;const e=g.current-v,i=n.current+e;w(i)}}else m.current=!1},_=e=>{m.current&&e.preventDefault(),setTimeout((()=>{m.current=!1})),f.current=!1,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",S),document.removeEventListener("touchend",_)};return(0,vc.jsxs)("div",{className:ip["scrolling-carousel"],style:e.style,children:[(0,vc.jsx)("div",{className:ip["scrolling-carousel__wrapper"],ref:t,onMouseDown:e=>{u.current||(e.preventDefault(),f.current=!0,g.current=e.pageX,i.current&&(r.current=i.current.scrollWidth-i.current.clientWidth),i.current&&a(),document.addEventListener("mousemove",S),document.addEventListener("mouseup",_))},onTouchStart:e=>{u.current||(e.preventDefault(),f.current=!0,g.current=e.touches&&e.touches[0].pageX,i.current&&(r.current=i.current.scrollWidth-i.current.clientWidth),i.current&&a(),document.addEventListener("touchmove",S),document.addEventListener("touchend",_))},onClickCapture:e=>{m.current&&(e.preventDefault(),e.stopPropagation())},children:(0,vc.jsx)("div",{className:ip["scrolling-carousel__item"],ref:i,style:{transform:`translateX(${-1*b}px)`},children:e.children})}),!p&&(0,vc.jsxs)(vc.Fragment,{children:[(0,vc.jsx)("div",{className:Sc()(ip["scrolling-carousel__arrow-button"],ip["scrolling-carousel__arrow-button--left"],{[ip["scrolling-carousel__arrow-button--show"]]:o}),onClick:()=>rp(void 0,void 0,void 0,(function*(){if(u.current)return;a();const e=n.current-h();w(e),u.current=!0,i.current&&(yield tr(i.current,"transform",300)),u.current=!1})),children:(0,vc.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,vc.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),(0,vc.jsx)("div",{className:Sc()(ip["scrolling-carousel__arrow-button"],ip["scrolling-carousel__arrow-button--right"],{[ip["scrolling-carousel__arrow-button--show"]]:d}),onClick:()=>rp(void 0,void 0,void 0,(function*(){if(u.current)return;a();const e=n.current+h();w(e),u.current=!0,i.current&&(yield tr(i.current,"transform",300)),u.current=!1})),children:(0,vc.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,vc.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})})]})]})},sp=({children:e,style:t,color:i,font:r,className:n})=>(0,vc.jsx)("div",{className:n,style:Object.assign({color:i,font:r},t),children:e});var ap=S(9108),op={insert:"head",singleton:!1};xc()(ap.A,op);const lp=ap.A.locals||{},dp=({goods:e,onClick:t,options:i})=>{var r;const{imgSrc:n,title:s,subTitle:a,price:o,oldPrice:l}=e;return(0,vc.jsxs)("div",{className:Sc()(lp["goods-card"]),style:{color:null!==(r=i.mainTextColor)&&void 0!==r?r:"black"},onClick:t,children:[(0,vc.jsx)("div",{className:Sc()(lp.figure),style:{borderRadius:i.imageCornerRadius+"px",backgroundColor:i.imageBackgroundColor},children:n&&(0,vc.jsx)("img",{src:n,alt:s,style:{borderRadius:i.imageCornerRadius+"px",backgroundColor:i.imageBackgroundColor}})}),(0,vc.jsx)(sp,{font:i.subtitleFont,children:a}),(0,vc.jsx)(sp,{font:i.titleFont,children:s}),(0,vc.jsxs)("div",{className:lp.prices,children:[(0,vc.jsx)(sp,{font:i.priceFont,children:o}),(0,vc.jsx)(sp,{className:lp["typography--old-price"],font:i.oldPriceFont,color:i.oldPriceTextColor,children:l})]})]})},cp=e=>{const t=e.goodsWidgetOptions,i=t.goodsWidgetRenderingType||t.goodsList.renderingType;let r=[];return i===s.DEFAULT?r=e.goodsList.map(((i,r)=>(0,vc.jsx)(dp,{options:t.goodsCard,goods:i,onClick:()=>e.onGoodsCardClick(i)},r))):i===s.CUSTOM_CARD&&K()(t.getCardHtml)&&(r=e.goodsList.map(((i,r)=>{var n,s;return(0,vc.jsx)("div",{dangerouslySetInnerHTML:{__html:null!==(s=null===(n=t.getCardHtml)||void 0===n?void 0:n.call(t,i,r))&&void 0!==s?s:""},onClick:()=>e.onGoodsCardClick(i)},r)}))),(0,vc.jsx)(np,{style:{marginTop:"-15px"},children:r})};var up=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const hp=e=>{var{arrowColor:t}=e,i=up(e,["arrowColor"]);return(0,vc.jsx)("svg",Object.assign({},i,{width:"32",height:"12.5",viewBox:"0 0 64 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,vc.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 pp=S(8161),fp={insert:"head",singleton:!1};xc()(pp.A,fp);const gp=pp.A.locals||{},vp=({closeImage:e,arrowColor:t,onClick:i})=>(0,vc.jsx)("div",{className:gp.btn,onClick:i,onTouchStart:i,children:e?(0,vc.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}):(0,vc.jsx)(hp,{arrowColor:t})});var mp=S(1277),bp={insert:"head",singleton:!1};xc()(mp.A,bp);const yp=mp.A.locals||{},wp=({isLoading:e,backgroundColor:t="white",accentBackgroundColor:i="transparent"})=>e?(0,vc.jsx)("div",{className:yp.spinner,style:{border:`solid 2px ${t}`,borderColor:`${i} ${t} ${t} ${t}`}}):null;var Sp=S(4940),_p={insert:"head",singleton:!1};xc()(Sp.A,_p);const xp=Sp.A.locals||{};var Op,kp=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};!function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"}(Op||(Op={}));const Cp=({open:e,url:t,goodsWidgetOptions:i,onClosed:r,onClose:n,onGoodsCardClick:s})=>{const a=(0,bc.useRef)(null),[o,l]=(0,bc.useState)([]),[d,c]=(0,bc.useState)(Op.IN),u=i,{dimColor:h,substrateHeight:p,substrateColor:f,closeImage:g,closeBackgroundColor:v}=u.goodsList;(0,bc.useEffect)((()=>{c(e?Op.IN:Op.OUT)}),[e]),(0,bc.useEffect)((()=>{t&&m()}),[t]);const m=()=>kp(void 0,void 0,void 0,(function*(){const e=b(),t=yield i.openGoodsWidgetHandler(e);l(t)})),b=()=>{try{return JSON.parse(t).map((e=>({sku:e,title:"",subTitle:"",price:"",oldPrice:"",rawData:{}})))}catch(e){return console.error(e),[]}};(0,bc.useEffect)((()=>{const e=a.current;if(d===Op.OUT)return e.addEventListener("animationend",r),()=>{e.removeEventListener("animationend",r)}}),[d]);const y=u.loader.custom?(0,vc.jsx)("div",{dangerouslySetInnerHTML:{__html:u.loader.custom}}):(0,vc.jsx)(wp,{isLoading:!o,backgroundColor:u.loader.default.color,accentBackgroundColor:u.loader.default.accentColor});return(0,vc.jsxs)("div",{className:Sc()(xp["goods-container"],{[xp["goods-container--visible"]]:d===Op.IN,[xp["goods-container--hidden"]]:d===Op.OUT}),ref:a,children:[(0,vc.jsx)("div",{className:Sc()(xp["goods-container__backdrop"]),style:{backgroundColor:h},onClick:n}),(0,vc.jsxs)("div",{className:Sc()(xp["goods-container"]),style:{height:p+"px",backgroundColor:null!=f?f:"white"},children:[y,o&&(0,vc.jsx)(cp,{goodsList:o,onGoodsCardClick:s,goodsWidgetOptions:i}),(0,vc.jsx)(vp,{onClick:n,closeImage:g,arrowColor:v})]})]})};var Mp=S(2913),Pp={insert:"head",singleton:!1};xc()(Mp.A,Pp);const jp=Mp.A.locals||{},Ep=e=>{const[t,i]=(0,bc.useState)(!1),[r,n]=(0,bc.useState)(!1),{storyManager:s}=lg(),a=()=>{n(!0),i(!0)},o=()=>{i(!1)};(0,bc.useEffect)((()=>(e.widget.on(Ls.Open,a),()=>{e.widget.off(Ls.Open,a)})),[e.widget]),(0,bc.useEffect)((()=>(qt.addListener("goodsWidget.close",o),()=>{qt.removeListener("goodsWidget.close",o)})),[]),(0,bc.useEffect)((()=>{t&&s.emit("widgetEvent",{name:"w-goods-open",data:{story_id:e.story.id,slide_index:e.story.activeSlideIndex,widget_id:e.widget.elementId}})}),[t]);return r?(0,vc.jsx)("div",{className:jp["goods-widget-viewer"],children:(0,vc.jsx)(Cp,{open:t,url:e.widget.targetUrl,goodsWidgetOptions:e.goodsWidgetOptions,onClose:()=>{i(!1)},onClosed:()=>{e.widget.close(),n(!1)},onGoodsCardClick:t=>{var i,r;s.emit("widgetEvent",{name:"w-goods-click",data:{story_id:e.story.id,slide_index:e.story.activeSlideIndex,widget_id:e.widget.elementId,widget_value:t.sku}}),null===(r=(i=e.goodsWidgetOptions).itemClickHandler)||void 0===r||r.call(i,t)}})}):null},Lp={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 Ap{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 Ip=e=>{switch(e){case"":default:return"text";case"tel":return"tel";case"email":return"email"}},Tp=e=>{const[t,i]=(0,bc.useState)({countryCode:"",phone:""}),[r,n]=(0,bc.useState)(""),[s,a]=(0,bc.useState)(!0),o=i=>{var r;const n=Ip(null!==(r=null==e?void 0:e.configV2.main.input.type)&&void 0!==r?r:"");return"email"===n?Ap.isEmailValid(i):"tel"!==n||Ap.isTelephoneValid((()=>{var e;const i=t.countryCode.substring(1);return i&&null!==(e=Lp[i])&&void 0!==e?e:""})(),t.phone)};return{value:r,telephone:t,isValid:s,handleTelephoneChange:e=>{i(e),e.phone.length>0?n(e.countryCode+e.phone):n("")},handleChange:e=>{n(e)},handleSubmit:e=>{const t=r.trim(),i=o(r);a(i),i&&e({value:t})},reset:()=>{a(!0),n(""),i({countryCode:"",phone:""})}}};var Rp=S(4169),Dp={insert:"head",singleton:!1};xc()(Rp.A,Dp);const Bp=Rp.A.locals||{},Np=(0,bc.forwardRef)(((e,t)=>{const i=(0,bc.useRef)(null);return(0,bc.useEffect)((()=>{J(i.current),i.current.focus()}),[]),(0,vc.jsx)("input",{type:"email",className:Sc()(Bp.input,Bp.input_centered),placeholder:e.placeholder,value:e.value,ref:i,onChange:t=>e.onChange(t.target.value)})}));var Fp=S(2265),Wp=S.n(Fp);const Vp=(0,bc.forwardRef)(((e,t)=>{const i=t=>{const i=t.target;i&&(i.value=i.value.replace(/\D/g,""),e.onChange({countryCode:e.value.countryCode,phone:i.value}))},r=e.value.countryCode.substring(1),n=r?Lp[r]:"";return(0,vc.jsxs)("div",{className:Bp["input-group"],children:[(0,vc.jsxs)("div",{className:Bp["input-group__prepend"],children:[(0,vc.jsx)(Wp(),{type:"tel",mask:"+999",maskChar:null,className:Bp.input,onChange:t=>{e.onChange({countryCode:t.currentTarget.value,phone:e.value.phone})},value:e.value.countryCode,placeholder:"+",inputRef:e=>{e&&(e=>{setTimeout((()=>{J(e),e.focus()}))})(e)}}),(0,vc.jsx)("div",{className:Bp["input-group__separator"]})]}),n?(0,vc.jsx)(Wp(),{type:"tel",className:Bp.input,mask:n,maskChar:"-",alwaysShowMask:!0,placeholder:e.placeholder,inputRef:e=>{},value:e.value.phone,onChange:i}):(0,vc.jsx)("input",{type:"tel",className:Bp.input,placeholder:e.placeholder,ref:e=>{},value:e.value.phone,onChange:i})]})})),zp=(0,bc.forwardRef)(((e,t)=>{const i=(0,bc.useRef)(null),r=(0,bc.useRef)(null);(0,bc.useEffect)((()=>{r.current.dataset.replicatedValue=e.value,J(i.current),i.current.focus(),i.current.setSelectionRange(e.value.length,e.value.length)}),[]);return(0,vc.jsx)("div",{className:Bp["textarea-grow-wrap"],ref:r,style:e.style,children:(0,vc.jsx)("textarea",{className:Bp.input,placeholder:e.placeholder,rows:1,ref:i,maxLength:e.maxLength,value:e.value,onChange:t=>e.onChange(t.target.value),onInput:e=>{r.current.dataset.replicatedValue=e.currentTarget.value}})})}));var Up=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const Gp=e=>{var{form:t,config:i}=e,r=Up(e,["form","config"]);const[n,s]=(0,bc.useState)(!0),{getMainStyle:a,getMainElementsStyle:o,getQuestionStyle:l,getInputWrapperStyle:d,getButtonStyle:c,getTextareaStyle:u}=(({config:e})=>{const t=t=>t*(e.size.viewportWidth/(e.size.viewportWidth/e.size.fontSize));return{getMainStyle:()=>{const i=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:`${i.background.color}`,border:`${i.border.visible&&`${t(i.border.width)}px solid ${i.border.color}`}`,borderRadius:`${t(i.border.radius)}px`}},getMainElementsStyle:()=>{const i=e.configV2.main;return{width:"100%",padding:`${t(i.padding.top)}px ${t(i.padding.right)}px ${t(i.padding.bottom)}px ${t(i.padding.left)}px`}},getQuestionStyle:()=>{const i=e.configV2.main.question;return{padding:`${t(i.padding.top)}px ${t(i.padding.right)}px ${t(i.padding.bottom)}px ${t(i.padding.left)}px`,color:`${i.text.color}`,fontSize:`${t(i.text.size)}px`,lineHeight:`${i.text.lineHeight}`,textAlign:`${i.text.align}`,fontFamily:`${i.text.type}`,fontWeight:`${i.text.weight}`,fontStyle:`${i.text.style}`}},getInputWrapperStyle:()=>{const i=e.configV2.main.input;let r=e.configV2.main.input.text.maxLines;return r=r>0?r:1,{padding:`${t(i.padding.top)}px ${t(i.padding.right)}px ${t(i.padding.bottom)}px ${t(i.padding.left)}px`,backgroundColor:`${i.background.color}`,border:`${t(i.border.width)}px solid ${i.border.color}`,borderRadius:`${t(i.border.radius)}px`,lineHeight:`${i.text.lineHeight}`,maxHeight:i.text.lineHeight*r+"em",fontSize:`${t(i.text.size)}px`,overflowY:"scroll",scrollbarWidth:"none"}},getButtonStyle:()=>{const i=e.configV2.main.button;return{padding:`${t(i.padding.top)}px ${t(i.padding.right)}px ${t(i.padding.bottom)}px ${t(i.padding.left)}px`,backgroundColor:`${i.background.color}`,border:`${t(i.border.width)}px solid ${i.border.color}`,color:`${i.text.color}`,fontSize:`${t(i.text.size)}px`,lineHeight:`${i.text.lineHeight}`,textAlign:`${i.text.align}`,fontFamily:`${i.text.type}`,fontWeight:`${i.text.weight}`,fontStyle:`${i.text.style}`}},getTextareaStyle:()=>{const i=e.configV2.main.input;return{color:`${i.text.color}`,fontSize:`${t(i.text.size)}px`,lineHeight:`${i.text.lineHeight}`,textAlign:`${i.text.align}`,fontFamily:`${i.text.type}`,fontWeight:`${i.text.weight}`,fontStyle:`${i.text.style}`}}}})({config:i}),h=Math.max(i.configV2.main.input.text.limit,0),p=String(i.configV2.main.input.text.placeholder).trim(),f=String(i.configV2.main.button.text.value).trim(),g=String(i.configV2.main.question.text.value).trim(),v=Ip(i.configV2.main.input.type),m=({value:e})=>{r.onComplete({result:!0,value:e}),s(!1)};return(0,vc.jsxs)("div",{className:Bp.wrapper,children:[(0,vc.jsx)("div",{className:Sc()(Bp.backdrop,{[Bp.fadeIn]:n,[Bp.fadeOut]:!n}),onAnimationEnd:()=>{n||r.onClose()},onClick:()=>{r.onComplete({result:!1,value:t.value}),s(!1)}}),(0,vc.jsxs)("div",{className:Bp.main,style:a(),children:[(0,vc.jsxs)("div",{className:Bp["main-elements"],style:o(),children:[(0,vc.jsx)("div",{className:Bp.question,style:l(),children:g}),(0,vc.jsxs)("div",{className:Sc()(Bp["input-wrapper"],{[Bp["is-invalid"]]:!t.isValid}),style:d(),children:["text"===v&&(0,vc.jsx)(zp,{value:t.value,onChange:t.handleChange,style:u(),placeholder:p,maxLength:h}),"email"===v&&(0,vc.jsx)(Np,{value:t.value,onChange:t.handleChange,placeholder:p}),"tel"===v&&(0,vc.jsx)(Vp,{value:t.telephone,onChange:t.handleTelephoneChange,placeholder:p})]})]}),t.value.trim().length>0&&(0,vc.jsx)("div",{className:Bp["button-wrapper"],children:(0,vc.jsx)("button",{className:Bp.button,style:c(),onClick:()=>t.handleSubmit(m),children:f})})]})]})},$p=({storyGeometry:e,activeSlide:t,touchController:i,storyRef:r})=>{const[n,s]=(0,bc.useState)(null),[a,o]=(0,bc.useState)(null),l=Tp(a);(0,bc.useEffect)((()=>(qt.on(Ra.ShowInputModal,d),()=>{qt.off(Ra.ShowInputModal,d)})),[]);const d=({id:t,config:n})=>{oi(),i.disable(),s(t),(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,o(t)})(n)};return(0,bc.useLayoutEffect)((()=>()=>{l.reset()}),[n]),a?(0,vc.jsx)(Gp,{form:l,config:a,onComplete:e=>{if(!n)throw new Error;((e,i)=>{t.setUserData(e,i)})(n,e.result?e.value:""),li()},onClose:()=>{o(null),i.enable()}}):null};var Hp=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},qp=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const Qp=(0,pu.observer)((e=>{var t,{story:i,geometry:r,className:n}=e,s=qp(e,["story","geometry","className"]);const a=(0,bc.useRef)(null),o=(0,bc.useRef)(null);(({story:e,progressBarRef:t,nextFlippingStoryIndex:i,activeStory:r})=>{const n=e.timer,s=e===r,a=s&&-1===i;(0,bc.useEffect)((()=>{if(!s)return;const i=e=>{var i;null===(i=t.current)||void 0===i||i.style.setProperty("--tick",e+"%")},r=({forceEnd:t})=>{t||(e.reachEnd?qt.emit(`${_o.id}.showNextStory`,{action:"auto"}):e.nextSlide())},a=()=>{var e;null===(e=t.current)||void 0===e||e.style.setProperty("--tick","0%")},o=()=>{var e;null===(e=t.current)||void 0===e||e.style.setProperty("--tick","0%")};return n.on("start",a),n.on("stop",o),n.on("progress",i),n.on("complete",r),()=>{n.off("start",a),n.off("progress",i),n.off("complete",r),n.off("stop",o)}}),[n,e,s]),(0,bc.useEffect)((()=>{a||n.stop()}),[a])})({activeStory:s.activeStory,story:i,nextFlippingStoryIndex:s.nextFlippingStoryIndex,progressBarRef:o});const l=s.index===s.nextFlippingStoryIndex,d=(0,bc.useMemo)((()=>{var e;return null===(e=i.activeSlide)||void 0===e?void 0:e.findWidgetByType("SwipeUpGoodsWidget")}),[null===(t=i.activeSlide)||void 0===t?void 0:t.state]),c=()=>Hp(void 0,void 0,void 0,(function*(){try{yield i.reload()}catch(e){console.error(e)}}));return(0,vc.jsxs)("div",{ref:a,className:Sc()(Eu["stories-item"],Eu.slider3d__item,n),onMouseDown:s.onMouseDown,onTouchStart:s.onMouseDown,"data-testid":"story",style:s.style,children:[(0,vc.jsx)(Vh,{closeDisabled:i.disableClose,options:s.storyReaderOptions,onClose:s.onClose}),i.activeSlide&&(0,vc.jsx)(Xh,{ref:o,hiddenTimeline:i.hiddenTimeline,slidesLength:i.slidesCount,timeline:i.activeSlide.timeline,activeSlideIndex:i.activeSlideIndex}),i.displayedSlides.map((e=>(0,vc.jsx)(Kh,{clickDisabled:s.slideClickDisabled,onReloadStory:c,activeSlideIndex:i.activeSlideIndex,currentSlideIndex:e.index,needSlideInitByFlipping:l,networkError:Boolean(i.error),currentStory:i,activeStory:s.activeStory,geometry:r,slide:e,slidesLoaded:i.slidesLoaded},e.html))),(0,vc.jsx)(Bh,{story:i,commonOptions:s.commonOptions,storyReaderOptions:s.storyReaderOptions}),d&&s.activeStory===i&&(0,vc.jsx)(Ep,{widget:d,story:i,goodsWidgetOptions:s.goodsWidgetOptions}),s.activeStory===i&&i.activeSlide&&(0,vc.jsx)($p,{storyRef:a,storyGeometry:r,activeSlide:i.activeSlide,touchController:s.touchController})]})})),Kp=({className:e,style:t})=>(0,vc.jsx)("div",{className:Sc()(Eu["stories-item"],e),style:t,children:(0,vc.jsx)("div",{className:`${Gh["stories-slide"]} ${Gh._dummy}`})});var Yp=S(9669),Zp={insert:"head",singleton:!1};xc()(Yp.A,Zp);const Jp=Yp.A.locals||{};var Xp=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const ef=e=>{var{width:t,disabledByUI:i,navigationOptions:r}=e,n=Xp(e,["width","disabledByUI","navigationOptions"]);const{desktopMode:s,dir:a}=lg(),o="ltr"===a,l=(o?n.isNextStoryBlank:n.isPrevStoryBlank)||i,d=(o?n.isPrevStoryBlank:n.isNextStoryBlank)||i;return(0,vc.jsxs)("div",{className:Sc()([Jp["story-reader-controls"]],{[Jp._desktop_mode]:s}),children:[(0,vc.jsx)("div",{className:Jp.slider3d__btn_next,style:{transform:`translateY(-50%) translateX(calc(${t/2}px + 100%))`},children:(0,vc.jsx)("button",{className:Jp["btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),n.disabled||(o?n.onNext():n.onPrev())},disabled:l,dangerouslySetInnerHTML:{__html:r.nextButton.svgSrc.baseState}})}),(0,vc.jsx)("div",{className:Jp.slider3d__btn_prev,style:{transform:`translateY(-50%) translateX(calc(-${t/2}px - 200%))`},children:(0,vc.jsx)("button",{className:Jp["btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),n.disabled||(o?n.onPrev():n.onNext())},disabled:d,dangerouslySetInnerHTML:{__html:r.prevButton.svgSrc.baseState}})})]})},tf=e=>{const{storyReaderOptions:t}=lg(),i=(0,bc.useRef)(null),r=(0,bc.useRef)(new Es).current;(({slider:e,touchController:t})=>{const i=()=>{null==e||e.startMove()},r=({dx:t})=>{null==e||e.move(-t)},n=()=>{t.horizontalSwipeGesture&&(null==e||e.endMove())};(0,bc.useEffect)((()=>(t.on(Jn.TouchStart,i),t.on(Jn.TouchMoveHorizontal,r),t.on(Jn.TouchEnd,n),()=>{t.off(Jn.TouchStart,i),t.off(Jn.TouchMoveHorizontal,r),t.off(Jn.TouchEnd,n)})),[t])})({slider:r,touchController:e.touchController});const n=t.scrollStyle,s=e.stories;r.currentIndex=e.currentIndex;const a=e.touchController;(0,bc.useLayoutEffect)((()=>{const e=()=>{r.init({$el:i.current,transformStyle:n})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[s.length,n]),(0,bc.useEffect)((()=>(r.on("transitionStart",l),r.on("transitionEnd",d),r.on("touchMove",o),()=>{r.off("transitionStart",l),r.off("transitionEnd",d),r.off("touchMove",o)})),[]);const o=()=>{a.disable()},l=()=>{a.disable()},d=()=>{a.enable()};return{ref:i,api:r,perspective:r.perspective,depth:r.depth}};var rf=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const nf=(e,t)=>{const{storyReaderOptions:i}=lg(),[r,n]=(0,bc.useState)(-1);(0,bc.useEffect)((()=>(qt.on(`${_o.id}.showNextStory`,l),qt.on(`${_o.id}.showPrevStory`,d),()=>{qt.off(`${_o.id}.showNextStory`,l),qt.off(`${_o.id}.showPrevStory`,d)})),[]),(0,bc.useEffect)((()=>(t.on("touchEnd",s),()=>{t.off("touchEnd",s)})),[t]);const s=i=>rf(void 0,void 0,void 0,(function*(){ni(),0===i?yield t.transformWithAmimation(0):o(e.currentIndex+i,"swipe")})),a=t=>{qt.emit("publicEvents.closeStory",{id:e.activeStory.id,index:e.activeStory.activeSlideIndex,action:t})},o=(t,i="lastSlideClick")=>{n(t),e.setSlideApiActiveStory(e.getDisplayedStoryByIndex(t)),c(t,i)},l=t=>{const r=null==t?void 0:t.action;e.reachEnd?(t=>{"auto"!==t?(a("closeStoryByScrolling"),e.close("lastSlideClick")):i.closeOnLastSlideByTimer&&(a("closeStoryByScrolling"),e.close("auto"))})(r):o(e.currentIndex+1,r)},d=t=>{e.reachStart||o(e.currentIndex-1,null==t?void 0:t.action)},c=(i,r)=>rf(void 0,void 0,void 0,(function*(){if(-1===i)return;const s=e.currentIndex<i?1:-1;yield t.transformWithAmimation(s),((t,i)=>{a(i),1==(e.currentIndex<t?1:-1)?e.nextStory():e.prevStory(),n(-1)})(i,r)}));return{nextFlippingStoryIndex:r,nextStory:l,prevStory:d,navigateStory:o}},sf=(0,pu.observer)((e=>{const{storyReaderOptions:t,commonOptions:i,goodsWidgetOptions:r}=lg(),[n,s]=Eh([Kt,Zt]),a=tf(e.storyReaderViewModel),o=nf(e.storyReaderViewModel,a.api),{actionPanelHeight:l,safeAreaFrameCalculator:d,isMobileGeometry:c,storyGeometry:u,correctionPaddingStyle:h}=xu(e.viewport),p=e.storyReaderViewModel.activeStory,f=e.storyReaderViewModel.touchController;return(0,vc.jsxs)(vc.Fragment,{children:[(0,vc.jsxs)("div",{className:Sc()(Mu.slider3d__wrapper,{[Mu["slider3d__wrapper_swipe-up"]]:s,[Mu._desktop_mode]:!c}),style:Object.assign({WebkitPerspective:`${a.perspective}px`,perspective:`${a.perspective}px`,width:u.getWidth(),backgroundColor:c&&d.shouldBeShownSafeAreaInsets&&"#000"},h),children:[(0,vc.jsx)("div",{className:Mu.slider3d__inner,style:{transform:`translateZ(-${a.depth}px)`},children:(0,vc.jsx)("div",{className:Sc()(Mu["stories-face"],Mu.slider3d__rotater),ref:a.ref,children:e.storyReaderViewModel.stories.map(((s,d)=>s.isBlank?(0,vc.jsx)(Kp,{style:{bottom:0}},s.id):(0,vc.jsx)(Qp,{slideClickDisabled:n||a.api.animating,index:d,story:s,activeStory:p,nextFlippingStoryIndex:o.nextFlippingStoryIndex,geometry:u,style:{bottom:_u(s,i)?`${l}px`:0},commonOptions:i,storyReaderOptions:t,goodsWidgetOptions:r,onClose:e.onCloseStory,touchController:f,onMouseDown:()=>{e.storyReaderViewModel.sharePanel.completeNativeSharing({result:!1})}},s.id)))})}),e.sharePanel.isOpened&&(0,vc.jsx)(ru,{className:Mu["share-panel-wrapper"],shareText:e.sharePanel.params.text,shareType:e.sharePanel.params.type,shareLink:e.sharePanel.params.link,onShareCompelete:t=>e.sharePanel.handleShareComplete(e.sharePanel.params.id,t),sharePanelOptions:t.sharePanel})]}),(0,vc.jsx)(ef,{disabled:a.api.animating,disabledByUI:n||e.sharePanel.isOpened,isNextStoryBlank:e.storyReaderViewModel.reachEnd,isPrevStoryBlank:e.storyReaderViewModel.reachStart,navigationOptions:t.navigation,width:u.calculateWidth(),onNext:o.nextStory,onPrev:o.prevStory})]})})),af=(0,pu.observer)((({storyReaderViewModel:e,desktopMode:t})=>{const i=(()=>{const[e,t]=(0,bc.useState)((()=>wu())),i=(0,bc.useCallback)((()=>{t(wu())}),[]);return(0,bc.useEffect)((()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)})),[]),e})();(()=>{const e=()=>{"hidden"===document.visibilityState&&ri(),"visible"===document.visibilityState&&ni()};(0,bc.useEffect)((()=>(document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)})),[])})(),(({touchController:e,sharePanelIsOpened:t,desktopMode:i})=>{(0,bc.useEffect)((()=>{i||t?e.disable():e.enable()}),[e,i,t]),(0,bc.useEffect)((()=>(e.on(Jn.LongTouchDetected,r),e.on(Jn.TouchEnd,n),()=>{e.off(Jn.LongTouchDetected,r),e.off(Jn.TouchEnd,n)})),[e]);const r=()=>{ri()},n=()=>{e.isSwiping||ni()}})({touchController:e.touchController,sharePanelIsOpened:e.sharePanel.isOpened,desktopMode:t}),hg((()=>{e.close("closeReaderByEscBtn")}));return e.sharePanel.desktopMode=t,(0,fu.createPortal)((0,vc.jsxs)(Ou,{viewport:i,storyReaderViewModel:e,children:[(0,vc.jsx)(sf,{viewport:i,storyReaderViewModel:e,onCloseStory:()=>{e.close()},sharePanel:e.sharePanel}),(0,vc.jsx)(Wc,{orientation:ue.PORTRAIT_PRIMARY,desktopMode:t,onOrientationChange:({isWrong:e})=>{e?oi():li()}})]}),document.body)}));var of=S(7314),lf={insert:"head",singleton:!1};xc()(of.A,lf);of.A.locals;const df=({storyManager:e,desktopMode:t})=>{const[i,r]=(0,bc.useState)(null),n=(()=>{const e=(0,bc.useRef)();return e.current||(e.current=(()=>{const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t)),i=t("--ias-sat"),r=t("--ias-sab");return{left:t("--ias-sal"),right:t("--ias-sar"),top:i,bottom:r}})()),e.current})();return(0,bc.useEffect)((()=>{const t=e.createGameReader();return t.setSafeAreaInsets(n),r(t),()=>{t.destroy()}}),[e]),(0,bc.useEffect)((()=>{null==i||i.setDesktopMode(t)}),[i,t]),i};var cf=S(7161),uf=S(429);class hf{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 pf=S(2083);const ff={[Wl.BottomSheet]:pf.literal`iam-bottom-sheet`,[Wl.Fullscreen]:pf.literal`iam-fullscreen-modal`,[Wl.Modal]:pf.literal`iam-modal`},gf=cf.css`
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("uuid"),require("mobx"),require("@inappstory/slide-api"),require("async-mutex"),require("@inappstory/video-player"),require("react"),require("react-dom/client"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("react-input-mask"),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"),require("parse-css-sides"));else if("function"==typeof define&&define.amd)define(["uuid","mobx","@inappstory/slide-api","async-mutex","@inappstory/video-player","react","react-dom/client","classnames","mobx-react-lite","react-dom","react-input-mask","lit","lit/decorators.js","lit/static-html.js","lit/directives/style-map.js","lit/directives/class-map.js","lit/directives/unsafe-html.js","parse-css-sides"],t);else{var s="object"==typeof exports?t(require("uuid"),require("mobx"),require("@inappstory/slide-api"),require("async-mutex"),require("@inappstory/video-player"),require("react"),require("react-dom/client"),require("classnames"),require("mobx-react-lite"),require("react-dom"),require("react-input-mask"),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"),require("parse-css-sides")):t(e.uuid,e.mobx,e["@inappstory/slide-api"],e["async-mutex"],e["@inappstory/video-player"],e.react,e["react-dom/client"],e.classnames,e["mobx-react-lite"],e["react-dom"],e["react-input-mask"],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"],e["parse-css-sides"]);for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}}(self,((e,t,s,i,r,a,o,n,l,d,c,h,u,p,g,m,f,y)=>(()=>{var v={3643:function(e){e.exports=function(e){var t={};function s(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,s),r.l=!0,r.exports}return s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(i,r,function(t){return e[t]}.bind(null,r));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=90)}({17:function(e,t,s){"use strict";t.__esModule=!0,t.default=void 0;var i=s(18),r=function(){function e(){}return e.getFirstMatch=function(e,t){var s=t.match(e);return s&&s.length>0&&s[1]||""},e.getSecondMatch=function(e,t){var s=t.match(e);return s&&s.length>1&&s[2]||""},e.matchAndReturnConst=function(e,t,s){if(e.test(t))return s},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,s,i){void 0===i&&(i=!1);var r=e.getVersionPrecision(t),a=e.getVersionPrecision(s),o=Math.max(r,a),n=0,l=e.map([t,s],(function(t){var s=o-e.getVersionPrecision(t),i=t+new Array(s+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(n=o-Math.min(r,a)),o-=1;o>=n;){if(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===n)return 0;o-=1}else if(l[0][o]<l[1][o])return-1}},e.map=function(e,t){var s,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(s=0;s<e.length;s+=1)i.push(t(e[s]));return i},e.find=function(e,t){var s,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(s=0,i=e.length;s<i;s+=1){var r=e[s];if(t(r,s))return r}},e.assign=function(e){for(var t,s,i=e,r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var n=function(){var e=a[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){i[t]=e[t]}))};for(t=0,s=a.length;t<s;t+=1)n();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=r,e.exports=t.default},18:function(e,t,s){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,s){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=s(91))&&i.__esModule?i:{default:i},a=s(18);function o(e,t){for(var s=0;s<t.length;s++){var i=t[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var n=function(){function e(){}var t,s,i;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new r.default(e,t)},e.parse=function(e){return new r.default(e).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return a.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return a.ENGINE_MAP}},{key:"OS_MAP",get:function(){return a.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return a.PLATFORMS_MAP}}],(s=null)&&o(t.prototype,s),i&&o(t,i),e}();t.default=n,e.exports=t.default},91:function(e,t,s){"use strict";t.__esModule=!0,t.default=void 0;var i=l(s(92)),r=l(s(93)),a=l(s(94)),o=l(s(95)),n=l(s(17));function l(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=n.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=n.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=n.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=n.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return n.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,s={},i=0,r={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(r[t]=o,a+=1):"object"==typeof o&&(s[t]=o,i+=1)})),i>0){var o=Object.keys(s),l=n.default.find(o,(function(e){return t.isOS(e)}));if(l){var d=this.satisfies(s[l]);if(void 0!==d)return d}var c=n.default.find(o,(function(e){return t.isPlatform(e)}));if(c){var h=this.satisfies(s[c]);if(void 0!==h)return h}}if(a>0){var u=Object.keys(r),p=n.default.find(u,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(r[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var s=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),r=n.default.getBrowserTypeByAlias(i);return t&&r&&(i=r.toLowerCase()),i===s},t.compareVersion=function(e){var t=[0],s=e,i=!1,r=this.getBrowserVersion();if("string"==typeof r)return">"===e[0]||"<"===e[0]?(s=e.substr(1),"="===e[1]?(i=!0,s=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?s=e.substr(1):"~"===e[0]&&(i=!0,s=e.substr(1)),t.indexOf(n.default.compareVersions(r,s,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,s){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=s(17))&&i.__esModule?i:{default:i},a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},s=r.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},s=r.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},s=r.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},s=r.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},s=r.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},s=r.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},s=r.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},s=r.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},s=r.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},s=r.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},s=r.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},s=r.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},s=r.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},s=r.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},s=r.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return s&&(t.version=s),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},s=r.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},s=r.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},s=r.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},s=r.default.getFirstMatch(a,e)||r.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},s=r.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},s=r.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},s=r.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},s=r.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},s=r.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},s=r.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},s=r.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},s=r.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},s=r.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:function(e){var t=!e.test(/like android/i),s=e.test(/android/i);return t&&s},describe:function(e){var t={name:"Android Browser"},s=r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},s=r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},s=r.default.getFirstMatch(a,e);return s&&(t.version=s),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:r.default.getFirstMatch(t,e),version:r.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,s){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=s(17))&&i.__esModule?i:{default:i},a=s(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=r.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=r.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=r.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),s=r.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:s}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},s=r.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return s&&(t.version=s),t}},{test:[/macintosh/i],describe:function(e){var t=r.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),s=r.default.getMacOSVersionName(t),i={name:a.OS_MAP.MacOS,version:t};return s&&(i.versionName=s),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=r.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),s=e.test(/android/i);return t&&s},describe:function(e){var t=r.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),s=r.default.getAndroidVersionName(t),i={name:a.OS_MAP.Android,version:t};return s&&(i.versionName=s),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=r.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),s={name:a.OS_MAP.WebOS};return t&&t.length&&(s.version=t),s}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=r.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||r.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||r.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=r.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=r.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=r.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,s){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=s(17))&&i.__esModule?i:{default:i},a=s(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=r.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",s={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(s.model=t),s}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),s=e.test(/like (ipod|iphone)/i);return t&&!s},describe:function(e){var t=r.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,s){"use strict";t.__esModule=!0,t.default=void 0;var i,r=(i=s(17))&&i.__esModule?i:{default:i},a=s(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=r.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},s=r.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},s=r.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:function(e){var t=e.test(/gecko/i),s=e.test(/like gecko/i);return t&&!s},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},s=r.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},s=r.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}}];t.default=o,e.exports=t.default}})},2432:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".favorite-story-list-modal--xWjHA{position:fixed;inset:0px;z-index:1090}.favorite-story-list-modal--xWjHA .container--GZBjv{width:100%;height:100%;background:var(--storiesFavoriteBackgroundColor, #333333);display:flex;flex-direction:column;position:relative;overflow-y:auto}.favorite-story-list-modal--xWjHA .header--TjHMD{display:flex;align-content:center;justify-content:center;align-items:center;flex-shrink:0;position:-webkit-sticky;position:sticky;top:0;z-index:100;background:var(--storiesFavoriteTitleBackgroundColor, #333333);box-shadow:0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12),0 1px 3px 0 rgba(0,0,0,.2);padding-top:var(--storiesFavoriteHeaderTopOffset, 0px);margin-bottom:25px}.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:1rem;margin-bottom:1rem;font-size:1.2em;color:var(--storiesFavoriteTitleColor, white);font-family:var(--storiesFavoriteTitleFontFamily);font-weight:normal;font-size:1.4rem;line-height:normal;font:var(--storiesFavoriteTitleFont, normal)}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:25px;margin-bottom:25px}}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD{margin-bottom:50px}}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:50%;transform:translateY(-50%);z-index:1140;pointer-events:all;cursor:pointer;outline:none;right:10px;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-:focus{outline:none}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm- svg{overflow:visible}.favorite-story-list-modal--xWjHA .footer--edEpn{width:100%;height:25px}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .footer--edEpn{height:50px}}.favorite-story-list-modal--xWjHA .bottom-offset--baiTh{position:-webkit-sticky;position:sticky;z-index:100;background:inherit;bottom:0;width:100%;height:var(--storiesFavoriteBottomOffset, 0px)}.favorite-story-list-modal--xWjHA .content--qCPkX{display:flex;justify-content:center;width:100%;padding-bottom:25px}.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{width:100%}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:640px}}@media(min-width: 768px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:768px}}@media(min-width: 1024px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1024px}}@media(min-width: 1280px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1280px}}",""]),r.locals={"favorite-story-list-modal":"favorite-story-list-modal--xWjHA",container:"container--GZBjv",header:"header--TjHMD",title:"title--Dk04x","header__close-btn":"header__close-btn--Jojm-",footer:"footer--edEpn","bottom-offset":"bottom-offset--baiTh",content:"content--qCPkX","favorite-story-list":"favorite-story-list--MISMx"};const a=r},5669:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".aspect-ratio-box--u2SLt{overflow:hidden;position:relative}.aspect-ratio-box--u2SLt.aspect-ratio-box--centered--ZWs8d{width:auto;height:100%;left:50%;transform:translateX(-50%)}.aspect-ratio-box-inside--U\\+o3F{position:absolute;top:0;left:0;width:100%;height:100%}",""]),r.locals={"aspect-ratio-box":"aspect-ratio-box--u2SLt","aspect-ratio-box--centered":"aspect-ratio-box--centered--ZWs8d","aspect-ratio-box-inside":"aspect-ratio-box-inside--U+o3F"};const a=r},9843:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".close-btn--KhMED{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:20px;z-index:1140;pointer-events:all;cursor:pointer;outline:none;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.close-btn--KhMED:focus{outline:none}.close-btn--KhMED svg{overflow:visible}.close-btn--KhMED[data-position=start],.close-btn--KhMED[data-position=left]{left:10px}.close-btn--KhMED[data-position=start][dir=rtl],.close-btn--KhMED[data-position=left][dir=rtl]{left:auto;right:10px}.close-btn--KhMED[data-position=end],.close-btn--KhMED[data-position=right]{right:10px}.close-btn--KhMED[data-position=end][dir=rtl],.close-btn--KhMED[data-position=right][dir=rtl]{left:10px;right:auto}",""]),r.locals={"close-btn":"close-btn--KhMED"};const a=r},7495:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,'@keyframes spin--JuRkn{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.splash-container--4toz\\+{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;z-index:-1}.splash-container--4toz\\+ .splash-container__image--\\+1PkF{position:absolute;inset:0px;z-index:0}.splash-container--4toz\\+ .splash-container__image--\\+1PkF img{width:100%;height:100%;object-fit:cover}.splash-container--4toz\\+ .splash-container__lottie--f24Xy{position:absolute;inset:0px;z-index:1}.splash-container--4toz\\+ .splash-container__lottie--f24Xy canvas{width:100%;height:100%}.splash-container--4toz\\+.splash-container--isLoading--d8pYm: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--JuRkn .6s infinite linear;z-index:10}.splash-container--4toz\\+.splash-container--fadeIn--TD58C{opacity:1;transition:opacity ease-in .2s}.splash-container--4toz\\+.splash-container--fadeOut--GW15o{opacity:0;transition:opacity ease-out .3s}',""]),r.locals={"splash-container":"splash-container--4toz+","splash-container__image":"splash-container__image--+1PkF","splash-container__lottie":"splash-container__lottie--f24Xy","splash-container--isLoading":"splash-container--isLoading--d8pYm",spin:"spin--JuRkn","splash-container--fadeIn":"splash-container--fadeIn--TD58C","splash-container--fadeOut":"splash-container--fadeOut--GW15o"};const a=r},4289:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,'.game-reader-container--qAxmf{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--vz8\\+v{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--vz8\\+v.game-reader--desktop-mode--hEnbE{padding:50px 0}.game-reader--vz8\\+v.game-reader--desktop-mode--hEnbE .game-reader__game-box--tDgOl{border-radius:var(--game-box-border-radius)}.game-reader--vz8\\+v.game-reader--widescreen--4rob-{padding:0 0}.game-reader--vz8\\+v.game-reader--widescreen--4rob- .game-reader__game-box--tDgOl{border-radius:0px}.game-reader--vz8\\+v .game-reader__refresh-btn--gKfAr{cursor:pointer;position:absolute;left:50%;top:50%;transform:translate3d(-50%, -50%, 0);z-index:2}.game-reader--vz8\\+v .game-reader__game-box--tDgOl.game-reader__game-box--widescreen--DD\\+rV{border-radius:0px}.game-reader--vz8\\+v .game-reader__iframe--e3dlS{width:100%;height:100%;transition:opacity ease-in .3s}.game-reader--vz8\\+v .game-reader__backdrop--g2Ozw{position:fixed;inset:0;z-index:-1}',""]),r.locals={"game-reader-container":"game-reader-container--qAxmf","game-reader":"game-reader--vz8+v","game-reader--desktop-mode":"game-reader--desktop-mode--hEnbE","game-reader__game-box":"game-reader__game-box--tDgOl","game-reader--widescreen":"game-reader--widescreen--4rob-","game-reader__refresh-btn":"game-reader__refresh-btn--gKfAr","game-reader__game-box--widescreen":"game-reader__game-box--widescreen--DD+rV","game-reader__iframe":"game-reader__iframe--e3dlS","game-reader__backdrop":"game-reader__backdrop--g2Ozw"};const a=r},7314:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.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)}",""]),r.locals={};const a=r},1938:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,"h3{margin:0}.stories-list-wrapper--\\+MxOM{background-color:var(--background-color, transparent);height:auto;padding:0;position:relative}.stories-list-wrapper--\\+MxOM.mode-desktop--Blm52.with-list-controls--CGYBY{position:relative}.stories-list--deukx{position:relative;overflow:visible}@media(min-width: 767.99px){.stories-list--deukx{overflow:hidden}}.stories-list__actions--p-QOR{position:absolute;right:0;top:0}.stories-list__viewport--m27BY{overflow:hidden;height:auto}.stories-list__viewport--m27BY:not(.mode-desktop--Blm52){display:flex}.stories-list__viewport-inner--oy\\+N4{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--oy\\+N4::-webkit-scrollbar{display:none}.stories-list__viewport-inner--oy\\+N4.mode-desktop--Blm52{scroll-behavior:unset;cursor:grab}.stories-list__viewport-inner--oy\\+N4.isVerticalDirection--P3UBw{flex-flow:row wrap}.stories-list__viewport-inner--oy\\+N4.align-center--9y43R{margin-left:auto;margin-right:auto}.stories-list__viewport-inner--oy\\+N4.align-left--Dm8Do{margin-right:auto}.stories-list__viewport-inner--oy\\+N4.align-right--bQ1a2{margin-left:auto}.stories-list__viewport-inner--oy\\+N4.isTitleCardOutsideTop--AeG\\+D{align-items:flex-end}.stories-list__viewport-inner--oy\\+N4.isTitleCardOutsideBottom--1P95a{align-items:flex-start}",""]),r.locals={"stories-list-wrapper":"stories-list-wrapper--+MxOM","mode-desktop":"mode-desktop--Blm52","with-list-controls":"with-list-controls--CGYBY","stories-list":"stories-list--deukx","stories-list__actions":"stories-list__actions--p-QOR","stories-list__viewport":"stories-list__viewport--m27BY","stories-list__viewport-inner":"stories-list__viewport-inner--oy+N4",isVerticalDirection:"isVerticalDirection--P3UBw","align-center":"align-center--9y43R","align-left":"align-left--Dm8Do","align-right":"align-right--bQ1a2",isTitleCardOutsideTop:"isTitleCardOutsideTop--AeG+D",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--1P95a"};const a=r},7533:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".favorite-images-wrapper--ypxcM{display:flex;flex-direction:row;flex-wrap:wrap;padding:var(--storiesListCardFavoriteTitle, --storiesListItemTitlePadding, 0px);gap:var(--storiesListCardFavoriteGap, 3px);box-sizing:border-box}.favorite-image-wrapper--iFI60{flex:0 1 calc(50% - var(--storiesListCardFavoriteGap, 3px));position:relative}.favorite-image--H\\+mP1{position:relative}.favorite-image-item--ylNcQ{position:absolute;inset:0px;border-radius:calc(var(--storiesListInnerBorderRadiusRead, 0)/4);background-position:50% 50%;background-size:cover}.circle_style--umugM .favorite-image-item--ylNcQ{border-radius:50%}",""]),r.locals={"favorite-images-wrapper":"favorite-images-wrapper--ypxcM","favorite-image-wrapper":"favorite-image-wrapper--iFI60","favorite-image":"favorite-image--H+mP1","favorite-image-item":"favorite-image-item--ylNcQ",circle_style:"circle_style--umugM"};const a=r},2811:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,'.stories-slide-wrapper--\\+5j4I:not(:last-child){margin-right:var(--storiesGap, 20px)}.stories-slide-wrapper--\\+5j4I{display:flex;flex-direction:column;flex:0 0 auto;box-sizing:content-box;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--\\+5j4I:hover{text-decoration:none}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO{display:block;box-sizing:border-box;text-align:left;position:relative;overflow:visible;-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--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU{border-radius:var(--storiesListBorderRadius, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide-image--cxCFY,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide-image--cxCFY{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide-image__image--mNEIE video,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide-image__image--mNEIE video{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide__mask--p6utN,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide__mask--p6utN{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL .stories-slide__content--QrUVw,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU .stories-slide__content--QrUVw{border-radius:var(--storiesListInnerBorderRadiusNotRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe{border-radius:var(--storiesListBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide-image--cxCFY,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide-image--cxCFY{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide-image__image--mNEIE video,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide-image__image--mNEIE,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide-image__image--mNEIE video{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide__mask--p6utN,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide__mask--p6utN{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-quad--InfBL._is-read--xEVZe .stories-slide__content--QrUVw,.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._format-rectangle--koqBU._is-read--xEVZe .stories-slide__content--QrUVw{border-radius:var(--storiesListInnerBorderRadiusRead, 5px)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._is-read--xEVZe{border:var(--storiesListBorderReadWidth, 1px) solid var(--storiesBorderReadColor, #ededed)}.stories-slide-wrapper--\\+5j4I.isTitleCardOutsideTop--EmWjs{justify-content:flex-end}.stories-slide-wrapper--\\+5j4I.isTitleCardOutsideBottom--W1JSg{justify-content:flex-start}.stories-slide-wrapper--\\+5j4I .stories-slide__inner--doJqj{display:block;position:relative;width:100%;height:100%}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-black--M47zI{background:#000}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-white--0Coab{background:#fff}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-red--UU5V7{background:#ff1a36}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-yellow--0cCZc{background:#fff000}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-green--10A4n{background:#0be361}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-violet--bnIBG{background:#b300bc}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-blue--lpzRG{background:#0761db}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-grey--nbEfc{background:#a8a8a8}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-black-gradient--q\\+aHV{background:#fff;background:linear-gradient(0deg, #c1c1c1, #000)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-white-gradient--YqOjh{background:#fff;background:linear-gradient(180deg, #fff, #ffc800)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-red-gradient---eK73{background:#ff1a36;background:linear-gradient(180deg, #c90174, #eb5c57)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-yellow-gradient--xg23E{background:#fff000;background:linear-gradient(0deg, #fbda61, #f76b1c)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-green-gradient--LfrRF{background:#0be361;background:linear-gradient(0deg, #b4ed50, #429321)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-violet-gradient--EQOBs{background:#b300bc;background:linear-gradient(180deg, #c90174, #0164fd)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-blue-gradient--TJV7z{background:#0761db;background:linear-gradient(180deg, #3023ae, #53a0fe 48%, #b4ed50)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._background-color-grey-gradient--4zJ9u{background:#a8a8a8;background:linear-gradient(0deg, #e2e2e2, #959595)}.stories-slide-wrapper--\\+5j4I .stories-slide-image--cxCFY{position:relative;width:100%;height:100%}.stories-slide-wrapper--\\+5j4I .stories-slide-image__wrap--kAiGt{position:absolute;top:0;bottom:0;left:0;right:0}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE{position:relative;opacity:1;transition:opacity .3s ease-in-out;overflow:hidden}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE._mode_list--K7WdU{width:100%;height:100%}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE.ugc-card-cell--Hmi8u img{object-fit:contain}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE img{width:100%;height:100%;object-fit:cover}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE 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--\\+5j4I .stories-slide-image__image--mNEIE.video-loaded--380fQ img{display:none}.stories-slide-wrapper--\\+5j4I .stories-slide-image__image--mNEIE.video-loaded--380fQ video{opacity:1}.stories-slide-wrapper--\\+5j4I .stories-slide__mask--p6utN{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--\\+5j4I .stories-slide--KQzLO._is-read--xEVZe .stories-slide__mask--p6utN{background-color:var(--storiesListItemOpenedMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListItemOpenedMaskLinearGradient, none)}.stories-slide-wrapper--\\+5j4I .stories-slide--KQzLO._ugc-cell--yAsON .stories-slide__mask--p6utN{background-color:var(--storiesListCardUgcMaskColor, rgba(0, 0, 0, 0));background-image:var(--storiesListCardUgcMaskLinearGradient, none)}.stories-slide-wrapper--\\+5j4I .stories-slide__content--QrUVw{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--\\+5j4I .stories-slide__content--QrUVw.__position_outside_top--5TlyN,.stories-slide-wrapper--\\+5j4I .stories-slide__content--QrUVw.__position_outside_bottom--pXuxb{position:relative;top:unset;right:unset;bottom:unset;left:unset;height:auto}.stories-slide-wrapper--\\+5j4I .clamp--X7TaH{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:none;user-select:none}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz.align-left--PkXxY{text-align:left}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz.align-center--9Flsz{text-align:center}.stories-slide-wrapper--\\+5j4I .stories-slide__title--XeSlz.align-right--wSGXZ{text-align:right}.stories-slide--KQzLO._format-circle--yaqgh,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide-image__image--mNEIE,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide-image__image--mNEIE video,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide__mask--p6utN,.stories-slide--KQzLO._format-circle--yaqgh .stories-slide-image--cxCFY{border-radius:50%}.stories-slide--KQzLO._favorite-cell--CbxlS .stories-slide__mask--p6utN{background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%)}.stories-slide--KQzLO._favorite-cell--CbxlS._format-circle--yaqgh .stories-slide-image__wrap--kAiGt{display:flex}.stories-slide--KQzLO._favorite-cell--CbxlS._format-circle--yaqgh .stories-slide-image__image--mNEIE{width:85%;height:85%;overflow:visible;margin:auto}.stories-slide--KQzLO._favorite-cell--CbxlS._format-circle--yaqgh .favorite-images-wrapper--zfyVz{margin:0;padding:0}.stories-slide--KQzLO._has-drop-shadow--GdCOv{filter:drop-shadow(var(--storiesListCardDropShadow, none))}.stories-slide--KQzLO._has-drop-shadow--GdCOv._is-read--xEVZe{filter:drop-shadow(var(--storiesListCardOpenedDropShadow, none))}.stories-slide--KQzLO._has-drop-shadow--GdCOv._favorite-cell--CbxlS{filter:drop-shadow(var(--storiesListCardFavoriteDropShadow, none))}.stories-slide--KQzLO._has-drop-shadow--GdCOv._ugc-cell--yAsON{filter:drop-shadow(var(--storiesListCardUgcDropShadow, none))}.stories-slide--KQzLO._has-card-svg-mask--0vIiG .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardMask);mask-image:var(--storiesListCardMask)}.stories-slide--KQzLO._has-card-svg-mask--0vIiG._is-read--xEVZe .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardOpenedMask);mask-image:var(--storiesListCardOpenedMask)}.stories-slide--KQzLO._has-card-svg-mask--0vIiG._favorite-cell--CbxlS .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardFavoriteMask);mask-image:var(--storiesListCardFavoriteMask)}.stories-slide--KQzLO._has-card-svg-mask--0vIiG._ugc-cell--yAsON .stories-slide__inner--doJqj{-webkit-mask-image:var(--storiesListCardUgcMask);mask-image:var(--storiesListCardUgcMask)}.stories-slide--KQzLO .card-overlay-svg-mask--NPptq{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--KQzLO._has-border-gradient-color--JRjv-{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-: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--KQzLO._has-border-gradient-color--JRjv-._is-read--xEVZe{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-._is-read--xEVZe: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--KQzLO._has-border-gradient-color--JRjv-._favorite-cell--CbxlS{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-._favorite-cell--CbxlS: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--KQzLO._has-border-gradient-color--JRjv-._ugc-cell--yAsON{border-color:rgba(0,0,0,0)}.stories-slide--KQzLO._has-border-gradient-color--JRjv-._ugc-cell--yAsON: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}}',""]),r.locals={"stories-slide-wrapper":"stories-slide-wrapper--+5j4I","stories-slide":"stories-slide--KQzLO","_format-quad":"_format-quad--InfBL","_format-rectangle":"_format-rectangle--koqBU","stories-slide-image":"stories-slide-image--cxCFY","stories-slide-image__image":"stories-slide-image__image--mNEIE","stories-slide__mask":"stories-slide__mask--p6utN","stories-slide__content":"stories-slide__content--QrUVw","_is-read":"_is-read--xEVZe",isTitleCardOutsideTop:"isTitleCardOutsideTop--EmWjs",isTitleCardOutsideBottom:"isTitleCardOutsideBottom--W1JSg","stories-slide__inner":"stories-slide__inner--doJqj","_background-color-black":"_background-color-black--M47zI","_background-color-white":"_background-color-white--0Coab","_background-color-red":"_background-color-red--UU5V7","_background-color-yellow":"_background-color-yellow--0cCZc","_background-color-green":"_background-color-green--10A4n","_background-color-violet":"_background-color-violet--bnIBG","_background-color-blue":"_background-color-blue--lpzRG","_background-color-grey":"_background-color-grey--nbEfc","_background-color-black-gradient":"_background-color-black-gradient--q+aHV","_background-color-white-gradient":"_background-color-white-gradient--YqOjh","_background-color-red-gradient":"_background-color-red-gradient---eK73","_background-color-yellow-gradient":"_background-color-yellow-gradient--xg23E","_background-color-green-gradient":"_background-color-green-gradient--LfrRF","_background-color-violet-gradient":"_background-color-violet-gradient--EQOBs","_background-color-blue-gradient":"_background-color-blue-gradient--TJV7z","_background-color-grey-gradient":"_background-color-grey-gradient--4zJ9u","stories-slide-image__wrap":"stories-slide-image__wrap--kAiGt",_mode_list:"_mode_list--K7WdU","ugc-card-cell":"ugc-card-cell--Hmi8u","video-loaded":"video-loaded--380fQ","_ugc-cell":"_ugc-cell--yAsON",__position_outside_top:"__position_outside_top--5TlyN",__position_outside_bottom:"__position_outside_bottom--pXuxb",clamp:"clamp--X7TaH","stories-slide__title":"stories-slide__title--XeSlz","align-left":"align-left--PkXxY","align-center":"align-center--9Flsz","align-right":"align-right--wSGXZ","_format-circle":"_format-circle--yaqgh","_favorite-cell":"_favorite-cell--CbxlS","favorite-images-wrapper":"favorite-images-wrapper--zfyVz","_has-drop-shadow":"_has-drop-shadow--GdCOv","_has-card-svg-mask":"_has-card-svg-mask--0vIiG","card-overlay-svg-mask":"card-overlay-svg-mask--NPptq","_has-border-gradient-color":"_has-border-gradient-color--JRjv-"};const a=r},2731:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".stories-list-controls--sC1DN{pointer-events:none}.stories-list-controls--sC1DN .control-start--NWniL,.stories-list-controls--sC1DN .control-end--Ezk33{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--sC1DN .control-icon--D3DFc{width:7px;height:12px;background-color:var(--storiesListControlsColor, black)}.stories-list-controls--sC1DN.horizontal--g63LL .control-start--NWniL{left:0;transform:translateY(-50%)}.stories-list-controls--sC1DN.horizontal--g63LL .control-start--NWniL.control-start_dir_rtl--7Opm5{left:auto;right:0}.stories-list-controls--sC1DN.horizontal--g63LL .control-end--Ezk33{right:0;transform:translateY(-50%)}.stories-list-controls--sC1DN.horizontal--g63LL .control-end--Ezk33.control-end_dir_rtl--twvGk{left:0;right:auto}.stories-list-controls--sC1DN.vertical--1a8qJ .control-start--NWniL{top:var(--storiesListTopPadding, 0);left:50%;transform:translate3d(-50%, 0, 0) rotate(90deg)}.stories-list-controls--sC1DN.vertical--1a8qJ .control-end--Ezk33{top:auto;bottom:var(--storiesListBottomPadding, 0);right:50%;transform:translate3d(50%, 0, 0) rotate(90deg)}.stories-list-controls--sC1DN .control-start--NWniL{display:flex}.stories-list-controls--sC1DN .control-start--NWniL .control-icon--D3DFc{-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--sC1DN .control-start--NWniL.control-start_reach-start--sBg3n{display:none}.stories-list-controls--sC1DN .control-end--Ezk33{display:flex}.stories-list-controls--sC1DN .control-end--Ezk33 .control-icon--D3DFc{-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--sC1DN .control-end--Ezk33.control-end_reach-end--\\+gjXw{display:none}",""]),r.locals={"stories-list-controls":"stories-list-controls--sC1DN","control-start":"control-start--NWniL","control-end":"control-end--Ezk33","control-icon":"control-icon--D3DFc",horizontal:"horizontal--g63LL","control-start_dir_rtl":"control-start_dir_rtl--7Opm5","control-end_dir_rtl":"control-end_dir_rtl--twvGk",vertical:"vertical--1a8qJ","control-start_reach-start":"control-start_reach-start--sBg3n","control-end_reach-end":"control-end_reach-end--+gjXw"};const a=r},2130:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".stories-viewer--U\\+VEJ{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--U\\+VEJ:-webkit-full-screen,.stories-viewer--U\\+VEJ:-moz-full-screen,.stories-viewer--U\\+VEJ:-ms-fullscreen,.stories-viewer--U\\+VEJ :fullscreen{width:100% !important;height:100% !important}.stories-viewer-background--rxrSL{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-backdrop--GqsGY{position:fixed;top:0;right:0;bottom:0;left:0;z-index:11;background-color:rgba(255,255,255,.5)}.stories-viewer-backdrop--GqsGY._desktopMode--5f5bI{display:none}.slider3d--fgseF{position:fixed !important}.slider3d--fgseF.no-select--qQk5D{user-select:none}",""]),r.locals={"stories-viewer":"stories-viewer--U+VEJ","stories-viewer-background":"stories-viewer-background--rxrSL","stories-viewer-backdrop":"stories-viewer-backdrop--GqsGY",_desktopMode:"_desktopMode--5f5bI",slider3d:"slider3d--fgseF","no-select":"no-select--qQk5D"};const a=r},187:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".stories-button-panel--tzCuh{position:absolute;z-index:10001;bottom:0;left:0;width:100%;background-color:#000;border-bottom-left-radius:var(--slideBorderRadius, 0);border-bottom-right-radius:var(--slideBorderRadius, 0)}.stories-button-panel--tzCuh[dir=rtl] .stories-button-panel-actions--I0rFL .right-container--Ax9TH{margin-left:0;margin-right:auto}.stories-button-panel-actions--I0rFL{position:absolute;top:0;left:0;width:100%;height:50px;padding:0 4px;display:flex;flex-direction:row;color:#fff;align-items:center}.stories-button-panel-actions--I0rFL>span{display:flex}.stories-button-panel-actions--I0rFL .right-container--Ax9TH{margin-left:auto}.button-panel-action--rHoQs{cursor:pointer;pointer-events:all;display:flex;align-items:center;justify-content:center;height:50px;width:38px}.button-panel-action--rHoQs>*{pointer-events:none}",""]),r.locals={"stories-button-panel":"stories-button-panel--tzCuh","stories-button-panel-actions":"stories-button-panel-actions--I0rFL","right-container":"right-container--Ax9TH","button-panel-action":"button-panel-action--rHoQs"};const a=r},9108:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".goods-card--BAL7e{width:100px}.goods-card--BAL7e:first-of-type{margin-left:.5rem}.goods-card--BAL7e:not(:last-child){margin-right:.5rem}.prices--u3Ojw{display:flex}.prices--u3Ojw>div:not(:last-child){margin-right:.5rem}.typography--qlRjl{text-decoration:none}.typography--old-price--SnUxk{text-decoration:line-through}.figure--UwMfT{margin:0;margin-bottom:.5rem;width:100px;height:100px}.figure--UwMfT>img{width:inherit;height:inherit;max-width:100%;border-radius:var(--figure-border-radius, 0px);background-color:var(--figure-background-color, #ffffff)}",""]),r.locals={"goods-card":"goods-card--BAL7e",prices:"prices--u3Ojw",typography:"typography--qlRjl","typography--old-price":"typography--old-price--SnUxk",figure:"figure--UwMfT"};const a=r},6212:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".scrolling-carousel--lZnvG{position:relative}.scrolling-carousel__wrapper--Doobh{position:relative;overflow:hidden}.scrolling-carousel__item--A9ial{display:flex;flex-wrap:nowrap;cursor:pointer}.scrolling-carousel__arrow-button--HrmVa{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--HrmVa>svg{position:absolute;left:0;right:0;bottom:0;top:0;margin:auto;width:24px;height:24px;fill:#757575}.scrolling-carousel__arrow-button--HrmVa:hover svg{fill:#000}.scrolling-carousel__arrow-button--show--do24\\+{opacity:.9}.scrolling-carousel__arrow-button--show--do24\\+:hover{opacity:1}.scrolling-carousel__arrow-button--right--Werat{right:-18px}.scrolling-carousel__arrow-button--left--M-xt3{left:-18px}@media(pointer: coarse){.scrolling-carousel__arrow-button--HrmVa{display:none !important}}",""]),r.locals={"scrolling-carousel":"scrolling-carousel--lZnvG","scrolling-carousel__wrapper":"scrolling-carousel__wrapper--Doobh","scrolling-carousel__item":"scrolling-carousel__item--A9ial","scrolling-carousel__arrow-button":"scrolling-carousel__arrow-button--HrmVa","scrolling-carousel__arrow-button--show":"scrolling-carousel__arrow-button--show--do24+","scrolling-carousel__arrow-button--right":"scrolling-carousel__arrow-button--right--Werat","scrolling-carousel__arrow-button--left":"scrolling-carousel__arrow-button--left--M-xt3"};const a=r},8161:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".btn--dxsSR{margin:auto auto 10px;padding:10px;cursor:pointer}",""]),r.locals={btn:"btn--dxsSR"};const a=r},1277:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,"@keyframes spin--Mv6zz{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.spinner--xVBKd{position:absolute;top:calc(50% - 1rem);left:calc(50% - 1rem);width:2rem;height:2rem;border-radius:50%;animation:spin--Mv6zz .6s infinite linear;border:var(--border, 2px solid transparent);border-color:var(--border-color, black)}",""]),r.locals={spinner:"spinner--xVBKd",spin:"spin--Mv6zz"};const a=r},4940:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,"@keyframes fadeInFrames--bEyJg{from{opacity:0}to{opacity:1}}@keyframes fadeOutFrames--oBX-p{from{opacity:1}to{opacity:0}}.goods-container--tR-eJ{position:relative;margin-left:auto;margin-right:auto;display:flex;flex-direction:column;width:100%;height:100%;margin-top:0px}.goods-container--visible--dd40k{animation:300ms fadeInFrames--bEyJg}.goods-container--hidden--QAS9\\+{animation:300ms normal forwards fadeOutFrames--oBX-p}.goods-container__backdrop--CyeDo{flex:1}.goods-list--Wax8Q{position:relative;display:flex;flex-direction:column}",""]),r.locals={"goods-container":"goods-container--tR-eJ","goods-container--visible":"goods-container--visible--dd40k",fadeInFrames:"fadeInFrames--bEyJg","goods-container--hidden":"goods-container--hidden--QAS9+",fadeOutFrames:"fadeOutFrames--oBX-p","goods-container__backdrop":"goods-container__backdrop--CyeDo","goods-list":"goods-list--Wax8Q"};const a=r},2913:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".goods-widget-viewer--ryMdV{position:absolute;inset:0;z-index:3000;text-align:left}",""]),r.locals={"goods-widget-viewer":"goods-widget-viewer--ryMdV"};const a=r},2349:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".stories-viewer__close--zjUnU{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:calc(15px + var(--timelineBlockTopOffset, 5px));pointer-events:all;cursor:pointer;outline:none;transition:opacity .3s ease-in;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.stories-viewer__close--zjUnU:focus{outline:none}.stories-viewer__close--zjUnU svg{overflow:visible}.stories-viewer__close--zjUnU._paused-ui--wbADu{opacity:0}.stories-viewer__close--zjUnU[data-position=start],.stories-viewer__close--zjUnU[data-position=left]{left:10px}.stories-viewer__close--zjUnU[data-position=start][dir=rtl],.stories-viewer__close--zjUnU[data-position=left][dir=rtl]{left:auto;right:10px}.stories-viewer__close--zjUnU[data-position=end],.stories-viewer__close--zjUnU[data-position=right]{right:10px}.stories-viewer__close--zjUnU[data-position=end][dir=rtl],.stories-viewer__close--zjUnU[data-position=right][dir=rtl]{left:10px;right:auto}.story-header--iD7hE{position:relative;z-index:1140}",""]),r.locals={"stories-viewer__close":"stories-viewer__close--zjUnU","_paused-ui":"_paused-ui--wbADu","story-header":"story-header--iD7hE"};const a=r},9137:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".stories-pager--JtIm1{position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:1131;background-image:linear-gradient(180deg, rgba(0, 0, 0, 0.104) 0%, rgba(0, 0, 0, 0) 20%);pointer-events:none;transition:opacity .3s ease-in}.stories-pager--JtIm1._desktop-mode--MFqdz{border-top-left-radius:5px;border-top-right-radius:5px}.stories-pager--JtIm1._paused-ui--YKpOe{opacity:0}.stories-pager__ticks--IooJa{height:3px;display:flex;margin:8px 8px;margin-top:var(--timelineBlockTopOffset, 8px);opacity:1}.stories-pager__ticks--IooJa.hiddenTimeline--uwXIm{opacity:0}.stories-pager__tick--L96Px{background-color:var(--stories-pager-background, rgba(255, 255, 255, 0.6));width:100%;margin:0 2px;overflow:hidden;position:relative;border-radius:10px}.stories-pager__tick--L96Px:first-child{margin-left:0}.stories-pager__tick--L96Px:last-child{margin-right:0}.stories-pager__tick-progress--lwEYc{width:100%;height:3px}.stories-pager__tick-progress--lwEYc._active---U7hY{background-color:var(--stories-pager-tick-foreground, rgb(255, 255, 255))}.stories-pager__tick-progress-loader--DJvQ6{width:100%;height:3px;position:absolute;top:0;left:0;background:linear-gradient(to right, var(--stories-pager-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}.stories-pager--JtIm1[dir=rtl] .stories-pager__tick-progress-loader--DJvQ6{background:linear-gradient(to left, var(--stories-pager-tick-foreground, rgb(255, 255, 255)) var(--tick), transparent 0)}",""]),r.locals={"stories-pager":"stories-pager--JtIm1","_desktop-mode":"_desktop-mode--MFqdz","_paused-ui":"_paused-ui--YKpOe","stories-pager__ticks":"stories-pager__ticks--IooJa",hiddenTimeline:"hiddenTimeline--uwXIm","stories-pager__tick":"stories-pager__tick--L96Px","stories-pager__tick-progress":"stories-pager__tick-progress--lwEYc",_active:"_active---U7hY","stories-pager__tick-progress-loader":"stories-pager__tick-progress-loader--DJvQ6"};const a=r},3278:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,'.stories-slide--8v5Pf{top:0;left:0;right:0;bottom:0;position:absolute;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:var(--slideBorderRadius, 0)}.stories-slide--8v5Pf._dummy--Llble{background-color:#fff}.stories-slide--8v5Pf .load-mask--5XCq2{position:absolute;background-color:#000;z-index:2000;top:0;bottom:0;left:0;right:0;display:flex;justify-content:center;align-items:center}.stories-slide--8v5Pf._with-bottom-panel--2p7Pi._desktop-mode--CJL90,.stories-slide--8v5Pf._with-bottom-panel--2p7Pi._desktop-mode--CJL90 .narrative-slide-background--hMuFX,.stories-slide--8v5Pf._with-bottom-panel--2p7Pi._desktop-mode--CJL90 .narrative-slide-elements--i0a24{border-bottom-right-radius:0;border-bottom-left-radius:0}.stories-slide--8v5Pf .stories-slide__refresh-btn--MEBPq{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}.loading-spinner-default--ltiyb{-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--T3-dY .6s infinite linear;animation:loading-spinner--T3-dY .6s infinite linear}@keyframes loading-spinner--T3-dY{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.stories-slide--8v5Pf{z-index:1120;visibility:hidden}.stories-slide--8v5Pf.active-slide--ncZf1{z-index:1130;visibility:visible}.stories-slide-offset--R5f2H{pointer-events:none;position:relative;height:100%}.stories-slide-box--Br9iz{position:relative;padding:154.838709677% 0 0 0}.stories-slide-content--CKfk0{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}',""]),r.locals={"stories-slide":"stories-slide--8v5Pf",_dummy:"_dummy--Llble","load-mask":"load-mask--5XCq2","_with-bottom-panel":"_with-bottom-panel--2p7Pi","_desktop-mode":"_desktop-mode--CJL90","narrative-slide-background":"narrative-slide-background--hMuFX","narrative-slide-elements":"narrative-slide-elements--i0a24","stories-slide__refresh-btn":"stories-slide__refresh-btn--MEBPq","loading-spinner-default":"loading-spinner-default--ltiyb","loading-spinner":"loading-spinner--T3-dY","active-slide":"active-slide--ncZf1","stories-slide-offset":"stories-slide-offset--R5f2H","stories-slide-box":"stories-slide-box--Br9iz","stories-slide-content":"stories-slide-content--CKfk0"};const a=r},2594:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".stories-item--s9hOL{visibility:visible;position:absolute;width:100%;height:auto;bottom:0;border-radius:inherit;backface-visibility:hidden}.slider3d__item--7j2AS{position:absolute;left:0;top:0;width:100%;backface-visibility:hidden;transform-style:preserve-3d}",""]),r.locals={"stories-item":"stories-item--s9hOL",slider3d__item:"slider3d__item--7j2AS"};const a=r},9669:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".story-reader-controls--8N5W7 .slider3d__btn_next--2GDPW,.story-reader-controls--8N5W7 .slider3d__btn_prev--P6gvY{display:none}.story-reader-controls--8N5W7._desktop_mode--mSlGA .slider3d__btn_next--2GDPW,.story-reader-controls--8N5W7._desktop_mode--mSlGA .slider3d__btn_prev--P6gvY{display:block;position:absolute;top:50%;transform:translateY(-50%);left:50%}.story-reader-controls--8N5W7 .btn-icon--NRFjq{-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}.story-reader-controls--8N5W7 .btn-icon--NRFjq:focus{outline:0}.story-reader-controls--8N5W7 .btn-icon--NRFjq:disabled{color:#464646;cursor:not-allowed}",""]),r.locals={"story-reader-controls":"story-reader-controls--8N5W7",slider3d__btn_next:"slider3d__btn_next--2GDPW",slider3d__btn_prev:"slider3d__btn_prev--P6gvY",_desktop_mode:"_desktop_mode--mSlGA","btn-icon":"btn-icon--NRFjq"};const a=r},3390:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".slider3d__wrapper--49G6v{left:50%;transform:translateX(-50%);overflow:hidden;box-sizing:border-box}.slider3d__wrapper--49G6v.slider3d__wrapper_swipe-up--r1InL.slider3d__wrapper_swipe-up--r1InL{background-color:rgba(0,0,0,0)}.slider3d__wrapper--49G6v .game-reader-wrapper--vHugs,.slider3d__wrapper--49G6v .share-panel-wrapper--zNSqw{overflow:hidden}.slider3d__wrapper--49G6v._desktop_mode--m7fGP{padding:50px 0}.slider3d__wrapper--49G6v._desktop_mode--m7fGP>.share-panel-wrapper--zNSqw{top:50px;bottom:50px;border-radius:5px}.slider3d__wrapper--49G6v._desktop_mode--m7fGP>.share-panel-wrapper--zNSqw.share-panel-wrapper--zNSqw{border-bottom-left-radius:0;border-bottom-right-radius:0}.slider3d__wrapper--49G6v *,.slider3d__wrapper--49G6v ::after,.slider3d__wrapper--49G6v ::before{box-sizing:border-box}.slider3d__wrapper--49G6v .stories-item--i1n9b,.slider3d__wrapper--49G6v .stories-slide--KXt9a,.slider3d__wrapper--49G6v .narrative-slide-background--LO2L6,.slider3d__wrapper--49G6v .narrative-slide-elements--bUq5g{border-radius:var(--slideBorderRadius, 0)}.slider3d--pT6gr{position:fixed !important}.slider3d--pT6gr.no-select--zMya8{user-select:none}.slider3d__wrapper--49G6v{z-index:1;position:relative;height:100%}.stories-face--tqFop{position:absolute !important;top:0;left:0;right:0;width:100%;width:calc(100% + .01px);height:100%}.slider3d__rotater--eYXIw{--tick: 0%;--tickOpacity: 0}.slider3d__inner--EFsin,.slider3d__rotater--eYXIw{position:relative;height:100%;transform-style:preserve-3d}",""]),r.locals={slider3d__wrapper:"slider3d__wrapper--49G6v","slider3d__wrapper_swipe-up":"slider3d__wrapper_swipe-up--r1InL","game-reader-wrapper":"game-reader-wrapper--vHugs","share-panel-wrapper":"share-panel-wrapper--zNSqw",_desktop_mode:"_desktop_mode--m7fGP","stories-item":"stories-item--i1n9b","stories-slide":"stories-slide--KXt9a","narrative-slide-background":"narrative-slide-background--LO2L6","narrative-slide-elements":"narrative-slide-elements--bUq5g",slider3d:"slider3d--pT6gr","no-select":"no-select--zMya8","stories-face":"stories-face--tqFop",slider3d__rotater:"slider3d__rotater--eYXIw",slider3d__inner:"slider3d__inner--EFsin"};const a=r},4169:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,'.wrapper--A3xCJ{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:3000;border-radius:inherit}.wrapper--A3xCJ .backdrop--CPTm4{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--2Iqns{position:absolute;z-index:2;user-select:none;display:flex;flex-direction:column;text-rendering:geometricprecision;overflow:hidden}.main--2Iqns .question--mn519{width:100%;height:auto}.main--2Iqns .question--mn519:empty{display:none}.main--2Iqns .input-group--jE\\+PN{display:flex}.main--2Iqns .input-group--jE\\+PN .input--Z388z{width:100%}.main--2Iqns .input-group--jE\\+PN .input-group__prepend--KtZUG{display:flex;flex:.35}.main--2Iqns .input-group--jE\\+PN .input-group__separator--44goC{border-right:1px solid #fff;margin-right:.5rem}.main--2Iqns .input-group--jE\\+PN .input--Z388z{flex:1}.main--2Iqns .input-wrapper--yYgPA{overflow:hidden;box-sizing:content-box;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.main--2Iqns .input-wrapper--yYgPA .input--Z388z{background:none;-webkit-tap-highlight-color:rgba(0,0,0,0);text-rendering:inherit;outline:none;border:none}.main--2Iqns .input-wrapper--yYgPA .input--Z388z::placeholder{color:inherit}.main--2Iqns .input-wrapper--yYgPA .input--Z388z.input_centered--0yBvl{text-align:center}.main--2Iqns .input-wrapper--yYgPA.is-invalid--PDNfg{border-color:#dc3545 !important;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.textarea-grow-wrap----9bt{display:grid;max-width:100%;word-break:break-all}.textarea-grow-wrap----9bt::after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.textarea-grow-wrap----9bt>.input--Z388z{resize:none;overflow:hidden}.textarea-grow-wrap----9bt>.input--Z388z,.textarea-grow-wrap----9bt::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--u94hX{width:100%}.button-wrapper--u94hX .button--bQRP7{width:100%;cursor:pointer}.button-wrapper--u94hX .button--bQRP7:disabled,.button-wrapper--u94hX .button--bQRP7[disabled=true]{cursor:not-allowed;pointer-events:none;background-color:#272727 !important}@keyframes fadeIn--b16pe{from{opacity:0}to{opacity:1}}@keyframes fadeOut--DquTc{from{opacity:1}to{opacity:0}}.fadeIn--b16pe{animation:fadeIn--b16pe 300ms forwards}.fadeOut--DquTc{animation:fadeOut--DquTc 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}',""]),r.locals={wrapper:"wrapper--A3xCJ",backdrop:"backdrop--CPTm4",main:"main--2Iqns",question:"question--mn519","input-group":"input-group--jE+PN",input:"input--Z388z","input-group__prepend":"input-group__prepend--KtZUG","input-group__separator":"input-group__separator--44goC","input-wrapper":"input-wrapper--yYgPA",input_centered:"input_centered--0yBvl","is-invalid":"is-invalid--PDNfg","textarea-grow-wrap":"textarea-grow-wrap----9bt","button-wrapper":"button-wrapper--u94hX",button:"button--bQRP7",fadeIn:"fadeIn--b16pe",fadeOut:"fadeOut--DquTc"};const a=r},5757:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,'.screen-orientation-lock--lAOKa{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=")}',""]),r.locals={"screen-orientation-lock":"screen-orientation-lock--lAOKa"};const a=r},1196:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".share-panel__body_screenshot--uZCkX{display:flex;flex-direction:column}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1{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--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM{margin-right:5px;position:relative;width:30px;height:30px;flex-shrink:0}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM .btn-copy__icon-state--aOFwh{position:absolute;inset:0px;opacity:0;transition:opacity 300ms ease-in-out}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM .btn-copy__icon-state--aOFwh.btn-copy__icon-state_default--n6LWH{opacity:1;visibility:visible}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__icon--w7FbM .btn-copy__icon-state--aOFwh.btn-copy__icon-state_done--r-uzJ{opacity:1;visibility:visible}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1 .btn-copy__text--IQD4A{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:5px}.share-panel__body_screenshot--uZCkX .btn--VzRxf.btn-copy--dhlh1:active{transform:scale(0.96)}.share-panel__body_screenshot--uZCkX .share-panel-row--LzAa0{justify-content:center;height:auto;padding:16px}.share-panel__body_screenshot--uZCkX .share-panel-row--LzAa0:first-child{height:450px;box-sizing:border-box}.share-panel__body_screenshot--uZCkX .share-panel-row__image-link--RXIki{width:100%;height:100%;display:flex;justify-content:center}.share-panel__body_screenshot--uZCkX .share-panel-row__image--HyVwP{max-width:100%;height:100%;object-fit:cover;border-radius:20px}.share-panel__body_screenshot--uZCkX .share-item__download-button--ypCUc{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--uZCkX .share-item__download-button--ypCUc:active{transform:scale(0.96)}",""]),r.locals={"share-panel__body_screenshot":"share-panel__body_screenshot--uZCkX",btn:"btn--VzRxf","btn-copy":"btn-copy--dhlh1","btn-copy__icon":"btn-copy__icon--w7FbM","btn-copy__icon-state":"btn-copy__icon-state--aOFwh","btn-copy__icon-state_default":"btn-copy__icon-state_default--n6LWH","btn-copy__icon-state_done":"btn-copy__icon-state_done--r-uzJ","btn-copy__text":"btn-copy__text--IQD4A","share-panel-row":"share-panel-row--LzAa0","share-panel-row__image-link":"share-panel-row__image-link--RXIki","share-panel-row__image":"share-panel-row__image--HyVwP","share-item__download-button":"share-item__download-button--ypCUc"};const a=r},610:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".share-item--OHeZZ{color:#fff}a.share-item--OHeZZ{color:#fff;transition:none}a.share-item--OHeZZ:hover{color:#fff}.social-list--5d274{flex-wrap:wrap;height:auto;padding-bottom:1rem}.social-list--5d274 .social-list__item--PmqO7{margin-top:1rem}",""]),r.locals={"share-item":"share-item--OHeZZ","social-list":"social-list--5d274","social-list__item":"social-list__item--PmqO7"};const a=r},8778:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,'.share-panel-wrapper--x2oi3{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:2}.share-panel-wrapper--x2oi3 .share-panel-backdrop--wh9uo{display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.5)}.share-panel--Qm-mD{position:absolute;top:auto;left:0;right:0;bottom:0;z-index:2;user-select:none}.share-panel-row--LPdKG{width:100%;height:150px;display:flex;flex-direction:row;align-items:center}.share-panel-row--LPdKG .share-item--ZalUh{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--LPdKG .share-item--ZalUh:first-child{margin-left:20px}.share-panel-row--LPdKG .share-item--ZalUh:last-child{margin-right:20px}.share-panel-row--LPdKG .share-item--ZalUh,.share-panel-row--LPdKG .share-item--ZalUh:visited,.share-panel-row--LPdKG .share-item--ZalUh:active,.share-panel-row--LPdKG .share-item--ZalUh:focus{text-decoration:none}.share-panel-row--LPdKG .share-item--ZalUh .share-item-title--RxVKy{margin-top:20px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:.2rem}.share-panel-row--LPdKG.title-row--Vfan2{height:120px;padding-top:30px;padding-bottom:30px;padding-left:20px;padding-right:20px}.share-panel-row--LPdKG.title-row--Vfan2 .share-url-favicon--cGryk{width:60px;height:60px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.share-panel-row--LPdKG.title-row--Vfan2 .share-url-favicon--cGryk img{width:30px;height:30px}.share-panel-row--LPdKG.title-row--Vfan2 .title--ZQZ6c{font-size:16px;line-height:1.4rem;margin-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.share-panel-separator--NXYXt{width:100%;height:1px}.share-panel--Qm-mD{will-change:transform;transition:transform 300ms}.share-panel__body--7Ljnv{width:100%;height:100%}@keyframes slideIn--CzJft{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slideOut--lNjIY{from{transform:translateY(0%)}to{transform:translateY(100%)}}@keyframes fadeIn--qopSX{from{opacity:0}to{opacity:1}}@keyframes fadeOut--bA6JG{from{opacity:1}to{opacity:0}}.fadeIn--qopSX{animation:fadeIn--qopSX 300ms forwards}.fadeOut--bA6JG{animation:fadeOut--bA6JG 300ms forwards}.slideIn--CzJft{animation:slideIn--CzJft 300ms forwards}.slideOut--lNjIY{animation:slideOut--lNjIY 300ms forwards}',""]),r.locals={"share-panel-wrapper":"share-panel-wrapper--x2oi3","share-panel-backdrop":"share-panel-backdrop--wh9uo","share-panel":"share-panel--Qm-mD","share-panel-row":"share-panel-row--LPdKG","share-item":"share-item--ZalUh","share-item-title":"share-item-title--RxVKy","title-row":"title-row--Vfan2","share-url-favicon":"share-url-favicon--cGryk",title:"title--ZQZ6c","share-panel-separator":"share-panel-separator--NXYXt","share-panel__body":"share-panel__body--7Ljnv",fadeIn:"fadeIn--qopSX",fadeOut:"fadeOut--bA6JG",slideIn:"slideIn--CzJft",slideOut:"slideOut--lNjIY"};const a=r},7081:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".icon--5RBkn{width:2rem;height:2rem}",""]),r.locals={icon:"icon--5RBkn"};const a=r},6323:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var i=s(935),r=s.n(i)()((function(e){return e[1]}));r.push([e.id,".narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-link,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-answer,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-data-input,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-poll-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-answer,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-rate-input,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-range-slider-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-answer,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-copy,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-share,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-story-repeat,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-game,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-target],.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-type=closeStory],.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up-items,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-next-button,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-barcode{pointer-events:all;cursor:pointer}.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-link *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-answer *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-data-input *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-poll-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-answer *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-rate-input *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-range-slider-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-answer *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-quiz-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-test-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-copy *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-share *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-story-repeat *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-game *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-target] *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-image[data-link-type=closeStory] *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-swipe-up-items *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-vote-next-button *,.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-barcode *{pointer-events:none}.narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-range-slider-input-container .rangeslider{pointer-events:all;cursor:pointer}",""]);const a=r},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s=e(t);return t[2]?"@media ".concat(t[2]," {").concat(s,"}"):s})).join("")},t.i=function(e,s,i){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(i)for(var a=0;a<this.length;a++){var o=this[a][0];null!=o&&(r[o]=!0)}for(var n=0;n<e.length;n++){var l=[].concat(e[n]);i&&r[l[0]]||(s&&(l[2]?l[2]="".concat(s," and ").concat(l[2]):l[2]=s),t.push(l))}},t}},2743:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function r(e,t,s){return e.concat(t).map((function(e){return i(e,s)}))}function a(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function n(e,t,s){var r={};return s.isMergeableObject(e)&&a(e).forEach((function(t){r[t]=i(e[t],s)})),a(t).forEach((function(a){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,a)||(o(e,a)&&s.isMergeableObject(t[a])?r[a]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(a,s)(e[a],t[a],s):r[a]=i(t[a],s))})),r}function l(e,s,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||t,a.cloneUnlessOtherwiseSpecified=i;var o=Array.isArray(s);return o===Array.isArray(e)?o?a.arrayMerge(e,s,a):n(e,s,a):i(s,a)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,s){return l(e,s,t)}),{})};var d=l;e.exports=d},46:e=>{"use strict";var t,s="object"==typeof Reflect?Reflect:null,i=s&&"function"==typeof s.apply?s.apply:function(e,t,s){return Function.prototype.apply.call(e,t,s)};t=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=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(s,i){function r(s){e.removeListener(t,a),i(s)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",r),s([].slice.call(arguments))}m(e,t,a,{once:!0}),"error"!==t&&function(e,t,s){"function"==typeof e.on&&m(e,"error",t,s)}(e,r,{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 d(e,t,s,i){var r,a,o,d;if(n(s),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,s.listener?s.listener:s),a=e._events),o=a[t]),void 0===o)o=a[t]=s,++e._eventsCount;else if("function"==typeof o?o=a[t]=i?[s,o]:[o,s]:i?o.unshift(s):o.push(s),(r=l(e))>0&&o.length>r&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){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,s){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:s},r=c.bind(i);return r.listener=s,i.wrapFn=r,r}function u(e,t,s){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?s?[r.listener||r]:[r]:s?function(e){for(var t=new Array(e.length),s=0;s<t.length;++s)t[s]=e[s].listener||e[s];return t}(r):g(r,r.length)}function p(e){var t=this._events;if(void 0!==t){var s=t[e];if("function"==typeof s)return 1;if(void 0!==s)return s.length}return 0}function g(e,t){for(var s=new Array(t),i=0;i<t;++i)s[i]=e[i];return s}function m(e,t,s,i){if("function"==typeof e.on)i.once?e.once(t,s):e.on(t,s);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 r(a){i.once&&e.removeEventListener(t,r),s(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(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||r(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=[],s=1;s<arguments.length;s++)t.push(arguments[s]);var r="error"===e,a=this._events;if(void 0!==a)r=r&&void 0===a.error;else if(!r)return!1;if(r){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 d=l.length,c=g(l,d);for(s=0;s<d;++s)i(c[s],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(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 s,i,r,a,o;if(n(t),void 0===(i=this._events))return this;if(void 0===(s=i[e]))return this;if(s===t||s.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,s.listener||t));else if("function"!=typeof s){for(r=-1,a=s.length-1;a>=0;a--)if(s[a]===t||s[a].listener===t){o=s[a].listener,r=a;break}if(r<0)return this;0===r?s.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(s,r),1===s.length&&(i[e]=s[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,s,i;if(void 0===(s=this._events))return this;if(void 0===s.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==s[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete s[e]),this;if(0===arguments.length){var r,a=Object.keys(s);for(i=0;i<a.length;++i)"removeListener"!==(r=a[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=s[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):[]}},3103:(e,t,s)=>{var i=s(4715)(s(8942),"DataView");e.exports=i},5098:(e,t,s)=>{var i=s(3305),r=s(9361),a=s(1112),o=s(5276),n=s(7452);function l(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=r,l.prototype.get=a,l.prototype.has=o,l.prototype.set=n,e.exports=l},1386:(e,t,s)=>{var i=s(2393),r=s(2049),a=s(7144),o=s(5071),n=s(3964);function l(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=r,l.prototype.get=a,l.prototype.has=o,l.prototype.set=n,e.exports=l},9770:(e,t,s)=>{var i=s(4715)(s(8942),"Map");e.exports=i},8250:(e,t,s)=>{var i=s(9753),r=s(5681),a=s(88),o=s(2351),n=s(9068);function l(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=r,l.prototype.get=a,l.prototype.has=o,l.prototype.set=n,e.exports=l},9413:(e,t,s)=>{var i=s(4715)(s(8942),"Promise");e.exports=i},4512:(e,t,s)=>{var i=s(4715)(s(8942),"Set");e.exports=i},3212:(e,t,s)=>{var i=s(8250),r=s(1877),a=s(8006);function o(e){var t=-1,s=null==e?0:e.length;for(this.__data__=new i;++t<s;)this.add(e[t])}o.prototype.add=o.prototype.push=r,o.prototype.has=a,e.exports=o},1340:(e,t,s)=>{var i=s(1386),r=s(4103),a=s(1779),o=s(4162),n=s(7462),l=s(6638);function d(e){var t=this.__data__=new i(e);this.size=t.size}d.prototype.clear=r,d.prototype.delete=a,d.prototype.get=o,d.prototype.has=n,d.prototype.set=l,e.exports=d},5650:(e,t,s)=>{var i=s(8942).Symbol;e.exports=i},1623:(e,t,s)=>{var i=s(8942).Uint8Array;e.exports=i},9270:(e,t,s)=>{var i=s(4715)(s(8942),"WeakMap");e.exports=i},9847:e=>{e.exports=function(e,t){for(var s=-1,i=null==e?0:e.length,r=0,a=[];++s<i;){var o=e[s];t(o,s,e)&&(a[r++]=o)}return a}},9756:(e,t,s)=>{var i=s(2478);e.exports=function(e,t){return!!(null==e?0:e.length)&&i(e,t,0)>-1}},3316:e=>{e.exports=function(e,t,s){for(var i=-1,r=null==e?0:e.length;++i<r;)if(s(t,e[i]))return!0;return!1}},358:(e,t,s)=>{var i=s(6137),r=s(3283),a=s(3142),o=s(5853),n=s(9632),l=s(8666),d=Object.prototype.hasOwnProperty;e.exports=function(e,t){var s=a(e),c=!s&&r(e),h=!s&&!c&&o(e),u=!s&&!c&&!h&&l(e),p=s||c||h||u,g=p?i(e.length,String):[],m=g.length;for(var f in e)!t&&!d.call(e,f)||p&&("length"==f||h&&("offset"==f||"parent"==f)||u&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||n(f,m))||g.push(f);return g}},1129:e=>{e.exports=function(e,t){for(var s=-1,i=t.length,r=e.length;++s<i;)e[r+s]=t[s];return e}},6465:e=>{e.exports=function(e,t){for(var s=-1,i=null==e?0:e.length;++s<i;)if(t(e[s],s,e))return!0;return!1}},7034:(e,t,s)=>{var i=s(6285);e.exports=function(e,t){for(var s=e.length;s--;)if(i(e[s][0],t))return s;return-1}},7250:e=>{e.exports=function(e,t,s,i){for(var r=e.length,a=s+(i?1:-1);i?a--:++a<r;)if(t(e[a],a,e))return a;return-1}},8244:(e,t,s)=>{var i=s(1129),r=s(3142);e.exports=function(e,t,s){var a=t(e);return r(e)?a:i(a,s(e))}},7379:(e,t,s)=>{var i=s(5650),r=s(8870),a=s(9005),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?r(e):a(e)}},2478:(e,t,s)=>{var i=s(7250),r=s(9454),a=s(7706);e.exports=function(e,t,s){return t==t?a(e,t,s):i(e,r,s)}},6027:(e,t,s)=>{var i=s(7379),r=s(547);e.exports=function(e){return r(e)&&"[object Arguments]"==i(e)}},4687:(e,t,s)=>{var i=s(353),r=s(547);e.exports=function e(t,s,a,o,n){return t===s||(null==t||null==s||!r(t)&&!r(s)?t!=t&&s!=s:i(t,s,a,o,e,n))}},353:(e,t,s)=>{var i=s(1340),r=s(3934),a=s(8861),o=s(1182),n=s(8486),l=s(3142),d=s(5853),c=s(8666),h="[object Arguments]",u="[object Array]",p="[object Object]",g=Object.prototype.hasOwnProperty;e.exports=function(e,t,s,m,f,y){var v=l(e),w=l(t),_=v?u:n(e),S=w?u:n(t),b=(_=_==h?p:_)==p,x=(S=S==h?p:S)==p,C=_==S;if(C&&d(e)){if(!d(t))return!1;v=!0,b=!1}if(C&&!b)return y||(y=new i),v||c(e)?r(e,t,s,m,f,y):a(e,t,_,s,m,f,y);if(!(1&s)){var k=b&&g.call(e,"__wrapped__"),M=x&&g.call(t,"__wrapped__");if(k||M){var L=k?e.value():e,O=M?t.value():t;return y||(y=new i),f(L,O,s,m,y)}}return!!C&&(y||(y=new i),o(e,t,s,m,f,y))}},9454:e=>{e.exports=function(e){return e!=e}},9624:(e,t,s)=>{var i=s(3655),r=s(4759),a=s(1580),o=s(4066),n=/^\[object .+?Constructor\]$/,l=Function.prototype,d=Object.prototype,c=l.toString,h=d.hasOwnProperty,u=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||r(e))&&(i(e)?u:n).test(o(e))}},674:(e,t,s)=>{var i=s(7379),r=s(5387),a=s(547),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&r(e.length)&&!!o[i(e)]}},195:(e,t,s)=>{var i=s(4882),r=s(8121),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return r(e);var t=[];for(var s in Object(e))a.call(e,s)&&"constructor"!=s&&t.push(s);return t}},6137:e=>{e.exports=function(e,t){for(var s=-1,i=Array(e);++s<e;)i[s]=t(s);return i}},6403:(e,t,s)=>{var i=s(2945),r=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(r,""):e}},9460:e=>{e.exports=function(e){return function(t){return e(t)}}},5630:(e,t,s)=>{var i=s(3212),r=s(9756),a=s(3316),o=s(5568),n=s(6208),l=s(9828);e.exports=function(e,t,s){var d=-1,c=r,h=e.length,u=!0,p=[],g=p;if(s)u=!1,c=a;else if(h>=200){var m=t?null:n(e);if(m)return l(m);u=!1,c=o,g=new i}else g=t?[]:p;e:for(;++d<h;){var f=e[d],y=t?t(f):f;if(f=s||0!==f?f:0,u&&y==y){for(var v=g.length;v--;)if(g[v]===y)continue e;t&&g.push(y),p.push(f)}else c(g,y,s)||(g!==p&&g.push(y),p.push(f))}return p}},5568:e=>{e.exports=function(e,t){return e.has(t)}},1950:(e,t,s)=>{var i=s(8942)["__core-js_shared__"];e.exports=i},6208:(e,t,s)=>{var i=s(4512),r=s(9071),a=s(9828),o=i&&1/a(new i([,-0]))[1]==1/0?function(e){return new i(e)}:r;e.exports=o},3934:(e,t,s)=>{var i=s(3212),r=s(6465),a=s(5568);e.exports=function(e,t,s,o,n,l){var d=1&s,c=e.length,h=t.length;if(c!=h&&!(d&&h>c))return!1;var u=l.get(e),p=l.get(t);if(u&&p)return u==t&&p==e;var g=-1,m=!0,f=2&s?new i:void 0;for(l.set(e,t),l.set(t,e);++g<c;){var y=e[g],v=t[g];if(o)var w=d?o(v,y,g,t,e,l):o(y,v,g,e,t,l);if(void 0!==w){if(w)continue;m=!1;break}if(f){if(!r(t,(function(e,t){if(!a(f,t)&&(y===e||n(y,e,s,o,l)))return f.push(t)}))){m=!1;break}}else if(y!==v&&!n(y,v,s,o,l)){m=!1;break}}return l.delete(e),l.delete(t),m}},8861:(e,t,s)=>{var i=s(5650),r=s(1623),a=s(6285),o=s(3934),n=s(5894),l=s(9828),d=i?i.prototype:void 0,c=d?d.valueOf:void 0;e.exports=function(e,t,s,i,d,h,u){switch(s){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!h(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=n;case"[object Set]":var g=1&i;if(p||(p=l),e.size!=t.size&&!g)return!1;var m=u.get(e);if(m)return m==t;i|=2,u.set(e,t);var f=o(p(e),p(t),i,d,h,u);return u.delete(e),f;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},1182:(e,t,s)=>{var i=s(393),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,s,a,o,n){var l=1&s,d=i(e),c=d.length;if(c!=i(t).length&&!l)return!1;for(var h=c;h--;){var u=d[h];if(!(l?u in t:r.call(t,u)))return!1}var p=n.get(e),g=n.get(t);if(p&&g)return p==t&&g==e;var m=!0;n.set(e,t),n.set(t,e);for(var f=l;++h<c;){var y=e[u=d[h]],v=t[u];if(a)var w=l?a(v,y,u,t,e,n):a(y,v,u,e,t,n);if(!(void 0===w?y===v||o(y,v,s,a,n):w)){m=!1;break}f||(f="constructor"==u)}if(m&&!f){var _=e.constructor,S=t.constructor;_==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof S&&S instanceof S||(m=!1)}return n.delete(e),n.delete(t),m}},4967:(e,t,s)=>{var i="object"==typeof s.g&&s.g&&s.g.Object===Object&&s.g;e.exports=i},393:(e,t,s)=>{var i=s(8244),r=s(7979),a=s(1211);e.exports=function(e){return i(e,a,r)}},4700:(e,t,s)=>{var i=s(9067);e.exports=function(e,t){var s=e.__data__;return i(t)?s["string"==typeof t?"string":"hash"]:s.map}},4715:(e,t,s)=>{var i=s(9624),r=s(155);e.exports=function(e,t){var s=r(e,t);return i(s)?s:void 0}},8870:(e,t,s)=>{var i=s(5650),r=Object.prototype,a=r.hasOwnProperty,o=r.toString,n=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,n),s=e[n];try{e[n]=void 0;var i=!0}catch(e){}var r=o.call(e);return i&&(t?e[n]=s:delete e[n]),r}},7979:(e,t,s)=>{var i=s(9847),r=s(9306),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,n=o?function(e){return null==e?[]:(e=Object(e),i(o(e),(function(t){return a.call(e,t)})))}:r;e.exports=n},8486:(e,t,s)=>{var i=s(3103),r=s(9770),a=s(9413),o=s(4512),n=s(9270),l=s(7379),d=s(4066),c="[object Map]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",g="[object DataView]",m=d(i),f=d(r),y=d(a),v=d(o),w=d(n),_=l;(i&&_(new i(new ArrayBuffer(1)))!=g||r&&_(new r)!=c||a&&_(a.resolve())!=h||o&&_(new o)!=u||n&&_(new n)!=p)&&(_=function(e){var t=l(e),s="[object Object]"==t?e.constructor:void 0,i=s?d(s):"";if(i)switch(i){case m:return g;case f:return c;case y:return h;case v:return u;case w:return p}return t}),e.exports=_},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},3305:(e,t,s)=>{var i=s(4497);e.exports=function(){this.__data__=i?i(null):{},this.size=0}},9361:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},1112:(e,t,s)=>{var i=s(4497),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(i){var s=t[e];return"__lodash_hash_undefined__"===s?void 0:s}return r.call(t,e)?t[e]:void 0}},5276:(e,t,s)=>{var i=s(4497),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return i?void 0!==t[e]:r.call(t,e)}},7452:(e,t,s)=>{var i=s(4497);e.exports=function(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=i&&void 0===t?"__lodash_hash_undefined__":t,this}},9632:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,s){var i=typeof e;return!!(s=null==s?9007199254740991:s)&&("number"==i||"symbol"!=i&&t.test(e))&&e>-1&&e%1==0&&e<s}},9067:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},4759:(e,t,s)=>{var i,r=s(1950),a=(i=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";e.exports=function(e){return!!a&&a in e}},4882:e=>{var t=Object.prototype;e.exports=function(e){var s=e&&e.constructor;return e===("function"==typeof s&&s.prototype||t)}},2393:e=>{e.exports=function(){this.__data__=[],this.size=0}},2049:(e,t,s)=>{var i=s(7034),r=Array.prototype.splice;e.exports=function(e){var t=this.__data__,s=i(t,e);return!(s<0)&&(s==t.length-1?t.pop():r.call(t,s,1),--this.size,!0)}},7144:(e,t,s)=>{var i=s(7034);e.exports=function(e){var t=this.__data__,s=i(t,e);return s<0?void 0:t[s][1]}},5071:(e,t,s)=>{var i=s(7034);e.exports=function(e){return i(this.__data__,e)>-1}},3964:(e,t,s)=>{var i=s(7034);e.exports=function(e,t){var s=this.__data__,r=i(s,e);return r<0?(++this.size,s.push([e,t])):s[r][1]=t,this}},9753:(e,t,s)=>{var i=s(5098),r=s(1386),a=s(9770);e.exports=function(){this.size=0,this.__data__={hash:new i,map:new(a||r),string:new i}}},5681:(e,t,s)=>{var i=s(4700);e.exports=function(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}},88:(e,t,s)=>{var i=s(4700);e.exports=function(e){return i(this,e).get(e)}},2351:(e,t,s)=>{var i=s(4700);e.exports=function(e){return i(this,e).has(e)}},9068:(e,t,s)=>{var i=s(4700);e.exports=function(e,t){var s=i(this,e),r=s.size;return s.set(e,t),this.size+=s.size==r?0:1,this}},5894:e=>{e.exports=function(e){var t=-1,s=Array(e.size);return e.forEach((function(e,i){s[++t]=[i,e]})),s}},4497:(e,t,s)=>{var i=s(4715)(Object,"create");e.exports=i},8121:(e,t,s)=>{var i=s(3766)(Object.keys,Object);e.exports=i},2306:(e,t,s)=>{e=s.nmd(e);var i=s(4967),r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,o=a&&a.exports===r&&i.process,n=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=n},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},3766:e=>{e.exports=function(e,t){return function(s){return e(t(s))}}},8942:(e,t,s)=>{var i=s(4967),r="object"==typeof self&&self&&self.Object===Object&&self,a=i||r||Function("return this")();e.exports=a},1877:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},8006:e=>{e.exports=function(e){return this.__data__.has(e)}},9828:e=>{e.exports=function(e){var t=-1,s=Array(e.size);return e.forEach((function(e){s[++t]=e})),s}},4103:(e,t,s)=>{var i=s(1386);e.exports=function(){this.__data__=new i,this.size=0}},1779:e=>{e.exports=function(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}},4162:e=>{e.exports=function(e){return this.__data__.get(e)}},7462:e=>{e.exports=function(e){return this.__data__.has(e)}},6638:(e,t,s)=>{var i=s(1386),r=s(9770),a=s(8250);e.exports=function(e,t){var s=this.__data__;if(s instanceof i){var o=s.__data__;if(!r||o.length<199)return o.push([e,t]),this.size=++s.size,this;s=this.__data__=new a(o)}return s.set(e,t),this.size=s.size,this}},7706:e=>{e.exports=function(e,t,s){for(var i=s-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}},4066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2945:e=>{var t=/\s/;e.exports=function(e){for(var s=e.length;s--&&t.test(e.charAt(s)););return s}},2784:(e,t,s)=>{var i=s(1580),r=s(4495),a=s(6131),o=Math.max,n=Math.min;e.exports=function(e,t,s){var l,d,c,h,u,p,g=0,m=!1,f=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var s=l,i=d;return l=d=void 0,g=t,h=e.apply(i,s)}function w(e){var s=e-p;return void 0===p||s>=t||s<0||f&&e-g>=c}function _(){var e=r();if(w(e))return S(e);u=setTimeout(_,function(e){var s=t-(e-p);return f?n(s,c-(e-g)):s}(e))}function S(e){return u=void 0,y&&l?v(e):(l=d=void 0,h)}function b(){var e=r(),s=w(e);if(l=arguments,d=this,p=e,s){if(void 0===u)return function(e){return g=e,u=setTimeout(_,t),m?v(e):h}(p);if(f)return clearTimeout(u),u=setTimeout(_,t),v(p)}return void 0===u&&(u=setTimeout(_,t)),h}return t=a(t)||0,i(s)&&(m=!!s.leading,c=(f="maxWait"in s)?o(a(s.maxWait)||0,t):c,y="trailing"in s?!!s.trailing:y),b.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=p=d=u=void 0},b.flush=function(){return void 0===u?h:S(r())},b}},6285:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3981:e=>{e.exports=function(e){return e&&e.length?e[0]:void 0}},3283:(e,t,s)=>{var i=s(6027),r=s(547),a=Object.prototype,o=a.hasOwnProperty,n=a.propertyIsEnumerable,l=i(function(){return arguments}())?i:function(e){return r(e)&&o.call(e,"callee")&&!n.call(e,"callee")};e.exports=l},3142:e=>{var t=Array.isArray;e.exports=t},6529:(e,t,s)=>{var i=s(3655),r=s(5387);e.exports=function(e){return null!=e&&r(e.length)&&!i(e)}},5853:(e,t,s)=>{e=s.nmd(e);var i=s(8942),r=s(4772),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,n=o&&o.exports===a?i.Buffer:void 0,l=(n?n.isBuffer:void 0)||r;e.exports=l},3514:(e,t,s)=>{var i=s(195),r=s(8486),a=s(3283),o=s(3142),n=s(6529),l=s(5853),d=s(4882),c=s(8666),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(n(e)&&(o(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||a(e)))return!e.length;var t=r(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(d(e))return!i(e).length;for(var s in e)if(h.call(e,s))return!1;return!0}},6343:(e,t,s)=>{var i=s(4687);e.exports=function(e,t){return i(e,t)}},3655:(e,t,s)=>{var i=s(7379),r=s(1580);e.exports=function(e){if(!r(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},5387:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3668:e=>{e.exports=function(e){return null==e}},986:(e,t,s)=>{var i=s(7379),r=s(547);e.exports=function(e){return"number"==typeof e||r(e)&&"[object Number]"==i(e)}},1580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8138:(e,t,s)=>{var i=s(7379),r=s(3142),a=s(547);e.exports=function(e){return"string"==typeof e||!r(e)&&a(e)&&"[object String]"==i(e)}},1187:(e,t,s)=>{var i=s(7379),r=s(547);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==i(e)}},8666:(e,t,s)=>{var i=s(674),r=s(9460),a=s(2306),o=a&&a.isTypedArray,n=o?r(o):i;e.exports=n},1211:(e,t,s)=>{var i=s(358),r=s(195),a=s(6529);e.exports=function(e){return a(e)?i(e):r(e)}},9071:e=>{e.exports=function(){}},4495:(e,t,s)=>{var i=s(8942);e.exports=function(){return i.Date.now()}},9306:e=>{e.exports=function(){return[]}},4772:e=>{e.exports=function(){return!1}},6131:(e,t,s)=>{var i=s(6403),r=s(1580),a=s(1187),o=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,d=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var s=n.test(e);return s||l.test(e)?d(e.slice(2),s?2:8):o.test(e)?NaN:+e}},2438:(e,t,s)=>{var i=s(5630);e.exports=function(e){return e&&e.length?i(e):[]}},3335:(e,t,s)=>{"use strict";var i=s(9155),r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,n=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,s){var i,a={},d=null,c=null;for(i in void 0!==s&&(d=""+s),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,i)&&!l.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===a[i]&&(a[i]=t[i]);return{$$typeof:r,type:e,key:d,ref:c,props:a,_owner:n.current}}t.Fragment=a,t.jsx=d,t.jsxs=d},1085:(e,t,s)=>{"use strict";e.exports=s(3335)},2591:(e,t,s)=>{"use strict";var i,r=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 s=document.querySelector(t);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(e){s=null}e[t]=s}return e[t]}}(),o=[];function n(e){for(var t=-1,s=0;s<o.length;s++)if(o[s].identifier===e){t=s;break}return t}function l(e,t){for(var s={},i=[],r=0;r<e.length;r++){var a=e[r],l=t.base?a[0]+t.base:a[0],d=s[l]||0,c="".concat(l," ").concat(d);s[l]=d+1;var h=n(c),u={css:a[1],media:a[2],sourceMap:a[3]};-1!==h?(o[h].references++,o[h].updater(u)):o.push({identifier:c,updater:f(u,t),references:1}),i.push(c)}return i}function d(e){var t=document.createElement("style"),i=e.attributes||{};if(void 0===i.nonce){var r=s.nc;r&&(i.nonce=r)}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 c,h=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function u(e,t,s,i){var r=s?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=h(t,r);else{var a=document.createTextNode(r),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function p(e,t,s){var i=s.css,r=s.media,a=s.sourceMap;if(r?e.setAttribute("media",r):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,m=0;function f(e,t){var s,i,r;if(t.singleton){var a=m++;s=g||(g=d(t)),i=u.bind(null,s,a,!1),r=u.bind(null,s,a,!0)}else s=d(t),i=p.bind(null,s,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(s)};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 r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var s=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<s.length;i++){var r=n(s[i]);o[r].references--}for(var a=l(e,t),d=0;d<s.length;d++){var c=n(s[d]);0===o[c].references&&(o[c].updater(),o.splice(c,1))}s=a}}}},6704:(e,t,s)=>{"use strict";const i=document.querySelector("[nonce]");i&&(s.nc=i.nonce||i.getAttribute("nonce")),window.litNonce=s.nc},5136:e=>{"use strict";e.exports=s},3107:e=>{"use strict";e.exports=r},6166:e=>{"use strict";e.exports=i},992:e=>{"use strict";e.exports=n},7161:e=>{"use strict";e.exports=h},429:e=>{"use strict";e.exports=u},5125:e=>{"use strict";e.exports=m},318:e=>{"use strict";e.exports=g},6968:e=>{"use strict";e.exports=f},2083:e=>{"use strict";e.exports=p},5314:e=>{"use strict";e.exports=t},5299:e=>{"use strict";e.exports=l},9780:e=>{"use strict";e.exports=y},9155:e=>{"use strict";e.exports=a},9514:e=>{"use strict";e.exports=d},2236:e=>{"use strict";e.exports=o},2265:e=>{"use strict";e.exports=c},7315:t=>{"use strict";t.exports=e}},w={};function _(e){var t=w[e];if(void 0!==t)return t.exports;var s=w[e]={id:e,loaded:!1,exports:{}};return v[e].call(s.exports,s,s.exports,_),s.loaded=!0,s.exports}_.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return _.d(t,{a:t}),t},_.d=(e,t)=>{for(var s in t)_.o(t,s)&&!_.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},_.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),_.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},_.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),_.nc=void 0;var S={};return(()=>{"use strict";_.r(S),_.d(S,{AppearanceCommonOptionsDefault:()=>i,AppearanceManager:()=>ln,CTASource:()=>y,CloseButtonPosition:()=>e,GameReaderOptionsDefault:()=>r,GoodsWidgetOptionsDefault:()=>o,GoodsWidgetRenderingType:()=>a,IamCheckDisplayTimeRangeError:()=>ns,IamFrequencyLimitError:()=>os,IamMessageLimitExceededError:()=>ls,IamMessageOpenError:()=>qa,IamNotFoundByEventError:()=>Ao,IamNotFoundByIdError:()=>Ot,IamNotFoundLimitError:()=>It,IamOtherReaderIsOpenError:()=>rs,IamShowOnlyIfLoadedError:()=>as,IasNetworkError:()=>z,InAppMessagingOptionsDefault:()=>k,InAppStoryManager:()=>Oh,PlaceholderType:()=>E,STORY_FEED_LIST:()=>I,STORY_LIST_TYPE:()=>O,STORY_READER_WINDOW_REFERER:()=>L,SharePageEvents:()=>n,SharePanelDefault:()=>w,StoriesEvents:()=>A,StoriesListCardCoverQuality:()=>u,StoriesListCardTitlePosition:()=>h,StoriesListCardTitleTextAlign:()=>c,StoriesListCardViewVariant:()=>d,StoriesListDirection:()=>p,StoriesListEvents:()=>g,StoriesListOptionsDefault:()=>m,StoriesListSliderAlign:()=>l,StoryActionSource:()=>M,StoryFavoriteReaderOptionsDefault:()=>f,StoryReaderOptionsDefault:()=>x,StoryReaderSwipeStyle:()=>b,WidgetStoriesOptions:()=>C});var e,t=_(46),s=_.n(t);!function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(e||(e={}));const i={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:e.END,loader:{default:{color:"white",accentColor:"transparent"},custom:null},closeButton:{svgSrc:{baseState:'<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M30 15.2115C30 23.4958 23.2843 30.2115 15 30.2115C6.71573 30.2115 0 23.4958 0 15.2115C0 6.92728 6.71573 0.211548 15 0.211548C23.2843 0.211548 30 6.92728 30 15.2115Z" fill="white"/>\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="#C2C2C4"/>\n</svg>'}},forceDesktopMode:void 0},r={borderRadius:5,loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:i.forceDesktopMode,forceCheckOrientation:!0};var a;!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(a||(a={}));const o={goodsWidgetRenderingType:a.DEFAULT,goodsList:{renderingType:a.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 n,l,d,c,h,u,p,g;!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(n||(n={})),function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end"}(l||(l={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(d||(d={})),function(e){e.LEFT="left",e.RIGHT="right",e.START="start",e.END="end",e.CENTER="center"}(c||(c={})),function(e){e.CARD_INSIDE_BOTTOM="cardInsideBottom",e.CARD_OUTSIDE_TOP="cardOutsideTop",e.CARD_OUTSIDE_BOTTOM="cardOutsideBottom"}(h||(h={})),function(e){e.Medium="medium",e.High="high"}(u||(u={})),function(e){e.COLUMN="vertical",e.ROW="horizontal"}(p||(p={})),function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(g||(g={}));const m={direction:p.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:c.START,position:h.CARD_INSIDE_BOTTOM,display:!0,lineClamp:4},gap:10,height:178,aspectRatio:null,coverQuality:u.High,variant:d.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:c.START,position:h.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:u.High,coverLazyLoading:!1,variant:d.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:0,backgroundColor:"transparent",sliderAlign:l.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:c.START,position:h.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:u.High,coverLazyLoading:!1,variant:d.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"}},f={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};var y;!function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader",e.STACK_STORY_LIST="stackStoryList",e.IAM_READER="iamReader"}(y||(y={}));const v={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}`},w={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:v,twitter:v,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 b;!function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(b||(b={}));const x={gameReaderOptions:{loader:{default:{color:"white",accentColor:"transparent"},custom:null}},scrollStyle:b.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:w,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="32" height="32" 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="32" height="32" 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 C;!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"}(C||(C={}));const k={};var M,L,O,I,A,E;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(M||(M={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite",e[e.stacked=2]="stacked"}(L||(L={})),function(e){e[e.default=0]="default",e[e.onboarding=1]="onboarding",e[e.favorite=2]="favorite",e[e.direct=3]="direct"}(O||(O={})),function(e){e.list="list",e.favorite="favorite"}(I||(I={})),function(e){e.CLICK_ON_STORY="clickOnStoryLink"}(A||(A={})),function(e){e.TEXT="text",e.IMAGE="image"}(E||(E={}));var T=_(3655),R=_.n(T);class P extends t.EventEmitter{}class B extends Error{constructor(e){super(`[IAS]: Timeout waiting for ViewModel with ID "${e}". You must mount <IASContainer>.`),this.name="IasViewModelTimeoutError"}}class D extends Error{constructor(e){super(`[IAS]: ViewModel with ID "${e}" was deleted before resolving.`),this.name="IasViewModelRejectError"}}class j{viewModels=new Map;viewModelWaiters=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 s=this.viewModels.get(e);if(s)return s;if(this.viewModelWaiters.has(e))return this.viewModelWaiters.get(e).promise;let i,r;const a=new Promise(((e,t)=>{i=e,r=t})),o=setTimeout((()=>{this.viewModelWaiters.delete(e),r(new B(e))}),t);return this.viewModelWaiters.set(e,{resolve:i,reject:r,timerId:o,promise:a}),a}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 s=this.viewModelWaiters.get(e);s&&(clearTimeout(s.timerId),s.resolve(t),this.viewModelWaiters.delete(e))}rejectWaiters(e){const t=this.viewModelWaiters.get(e);t&&(clearTimeout(t.timerId),t.reject(new D(e)),this.viewModelWaiters.delete(e))}}var F=_(7315);function N(e){return e.replace(/^\//,"")}function U(e,t,s){t instanceof Object&&Object.keys(t).forEach((i=>{const r=t[i];if(r instanceof Object&&!Array.isArray(r))return U(e,r,i);s&&(i=`${s}[${i}]`),Array.isArray(r)?r.forEach((t=>{e.append(`${i}[]`,t)})):e.append(i,r)}))}class z extends Error{name;networkStatus;networkMessage;response;constructor(e,t,s){super(),this.name="IasNetworkError",this.networkStatus=e,this.networkMessage=t,this.response=s??null,console.error({name:this.name,networkStatus:e,networkMessage:t,response:s})}static createByRequestError(e){return new z(null,JSON.stringify(e.data),e)}static createByFetchError(e){const t=window.navigator&&window.navigator.onLine;return new z(null,t?e.message:"net::ERR_INTERNET_DISCONNECTED")}}const V={baseUrl:"https://cdn.inappstory.ru",apiUrl:"https://api.inappstory.ru",faviconApiUrl:"https://favicon.inappstory.ru"};function W(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,s){return void 0===t?e:t.length>=e.length?t:s?(e+t).slice(-e.length):(t+e).substring(0,e.length)}(new Array(t%4).fill("=").join(""),e,!1),window.atob(e)}(e),s=t.charCodeAt(13);if(s>0){let e=t.substr(14,s);e=e.replace(/\0+$/,"");const i="{QQN{xuV?1Dv16j3";let r=i,a=0;for(;r.length<s;)r+=i[a],a++,a===i.length&&(a=0);let o="";for(let t=0;t<s;t++)o+=String.fromCharCode(e.charCodeAt(t)^r.charCodeAt(t));return new URL(`https://${o}`).host}}catch(e){console.error(e)}return null}function G(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}let $;$=function(){};const H=/[\r\n%#()<>?[\\\]^`{|}]/g;function q(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(H,encodeURIComponent)}const Q=e=>{const t=document.createElement("input");t.setAttribute("type","text"),t.style.position="absolute",t.style.opacity="0.1001",t.style.height="0",t.style.fontSize="16px",t.readOnly=!0,document.body.prepend(t),t.focus();return setTimeout((()=>{e.focus(),t.remove()}),300)},K=()=>_.nc??"",Y=!!(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}}),s=()=>{};window.addEventListener("test",s,t),window.removeEventListener("test",s)}catch(e){}return e})()&&{passive:!0};var Z=_(8138),J=_.n(Z);const X=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();function ee(e){let t=null;if(X){let s=window.localStorage.getItem(e);null!==s&&J()(s)&&s.trim().length>0&&(t=JSON.parse(s))}return t}function te(e,t){X&&window.localStorage.setItem(e,JSON.stringify(t))}function se(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}function ie(e){return e.map((e=>function(e){if(!e.url)return null;let t={"font-family":e.family??"normal",src:`url('${se(String(e.url))}')`,"font-style":e.style??"normal","font-weight":e.weight??"normal"};e.title&&(t.src+=`, local('${e.title}')`);return`@font-face {${s=t,Object.keys(s).reduce(((e,t)=>e+t.split(/(?=[A-Z])/).join("-").toLowerCase()+":"+s[t]+";"),"")}}\n`;var s}(e))).filter(Boolean).join("")}function re(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=ie(e);if(null!=t){const e="stories-font-style";let s=document.getElementById(e);null===s?(s=document.createElement("style"),s.type="text/css",s.id=e,s.attributes.setNamedItem(document.createAttribute("scoped")),s.setAttribute("nonce",K()),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t)),document.body.appendChild(s)):s.styleSheet?s.styleSheet.cssText=t:(s.textContent="",s.appendChild(document.createTextNode(t)))}}(e)}let ae=null;async function oe(){return null!=ae?ae:new Promise((e=>{!function(e,t){const s=new Image;s.onload=function(){var i=s.width>0&&s.height>0;t(e,i)},s.onerror=function(){t(e,!1)},s.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"}[e]}("lossy",((t,s)=>{ae=s,e(s)}))}))}function ne(){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:le.LANDSCAPE_PRIMARY,"-90":le.LANDSCAPE_SECONDARY,0:le.PORTRAIT_PRIMARY,180:le.PORTRAIT_SECONDARY};function t(){}var s=new t,i=function(e){for(var t=["orientationchange","mozorientationchange","msorientationchange"],s=window.screen,i=0;i<t.length;i++)if(null===s["on"+t[i]])return{delegate:s,event:t[i]};if(void 0!==window.onorientationchange)return{delegate:window,event:"orientationchange"};return{delegate:ge(e),event:"change"}}(s);return t.prototype.addEventListener=de("addEventListener",i.delegate,i.event),t.prototype.dispatchEvent=de("dispatchEvent",i.delegate,i.event),t.prototype.removeEventListener=de("removeEventListener",i.delegate,i.event),t.prototype.lock=function(){var e,t="lockOrientation() is not available on this device.",s=window.screen;e=void 0===s?function(){return!1}:"function"==typeof s.msLockOrientation?s.msLockOrientation.bind(s):"function"==typeof s.mozLockOrientation?s.mozLockOrientation.bind(s):function(){return!1};return function(s){const i=window.Promise;return e(s)?i.resolve(s):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(s,{onchange:{get:function(){return i.delegate["on"+i.event]||null},set:function(e){i.delegate["on"+i.event]=ue(e,s)}},type:{get:function(){var t=window.screen;return t.msOrientation||t.mozOrientation||e[window.orientation+""]||(me().matches?"landscape-primary":"portrait-primary")}},angle:{value:0}}),s}(),e}}var le;function de(e,t,s){var i=this;return function(){var r=Array.prototype.slice.call(arguments);if("change"===(r[0].type?r[0].type:r[0])){r[0].type?r[0]=pe(s,r[0]):r[0]=s;var a,o,n=ue(r[1],i);return"addEventListener"===e&&function(e,t){var s=he.indexOf(e);s>-1?ce[s]=t:(he.push(e),ce.push(t))}(r[1],n),"removeEventListener"===e&&(a=r[1],(o=he.indexOf(a))>-1&&(he.splice(o,1),ce.splice(o,1))),r[1]=n,t[e].apply(t,r)}}}!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(le||(le={}));var ce=[],he=[];function ue(e,t){var s=he.indexOf(e);return s>-1?ce[s]:function(s){s.target!==t&&fe(s,"target",t),s.currentTarget!==t&&fe(s,"currentTarget",t),"change"!==s.type&&fe(s,"type","change"),e(s)}}function pe(e,t){var s;try{s=new Event(e,t)}catch(e){s={type:"change"}}return s}function ge(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 s=this.listeners[e].indexOf(t);s>-1&&this.listeners[e].splice(s,1)}}});t.listeners={};var s=me();return s&&"boolean"==typeof s.matches&&s.addListener((function(){t.dispatchEvent(pe("change"))})),t}function me(){return"function"!=typeof window.matchMedia?{}:window.matchMedia("(orientation: landscape)")}function fe(e,t,s){Object.defineProperty(e,t,{value:s})}function ye(e,t,s){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>s))}var ve=_(5314);function we(e){return class extends e{_mobxReaction=null;constructor(...e){super(...e)}update(e){this._mobxReaction?this._mobxReaction.track((()=>{super.update(e)})):super.update(e)}connectedCallback(){super.connectedCallback(),this._mobxReaction||(this._mobxReaction=new ve.Reaction(`${this.constructor.name||this.nodeName}.update()`,(()=>this.requestUpdate()))),this.hasUpdated&&this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._mobxReaction?.dispose(),this._mobxReaction=null}}}function _e(e,t){let s=null;return async function(...t){return s||(s=(async()=>{try{return await e.apply(this,t)}catch(e){throw e}finally{s=null}})(),s)}}class Se{storyManager;constructor(e){this.storyManager=e}async open(){const[e,t]=await Promise.all([this.getDeviceData(),oe()]),s=this.completeDeviceData(e,t),i=await Lt.post("session/open",s??{},{expand:"cache,storyWidgetsResources",fields:"session,server_timestamp,user_key,share,preview_aspect_ratio,placeholders,image_placeholders,is_allow_ugc"});return i.data.deviceId=e.device_id,i.data}async sendStatisticData(e){return new Promise((t=>{Mt("session/update",e,t)}))}completeDeviceData(e,t){"iOS"===e.os_name?window.isIos=!0:"Android"===e.os_name&&(window.Android=!0);const s=this.storyManager.getConfig();return s&&s.userId&&(e.user_id=s.userId,e.user_sign=s.userIdSign),e.features="animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder,vod,closeStoryApi",t&&(e.features+=",webp"),e}async getDeviceData(){return new Promise(((e,t)=>{let s=ee("device_data"),i=null;if(null!==s&&(i=s.device_id),null!==s&&i&&J()(i)&&36===i.trim().length)e(s);else{const t={platform:"web",device_id:(0,F.v4)()};te("device_data",t),e(t)}}))}}var be;!function(e){e.TEXT="text",e.IMAGE="image"}(be||(be={}));class xe{type;key;value;priority;constructor(e,t,s,i){this.type=e,this.key=t,this.value=s,this.priority=i}}class Ce extends xe{constructor(e,t){super(be.IMAGE,e,t,0)}}class ke extends xe{constructor(e,t){super(be.TEXT,e,t,2)}}class Me extends xe{constructor(e,t){super(be.IMAGE,e,t,1)}}class Le extends xe{constructor(e,t){super(be.TEXT,e,t,3)}}const Oe="default";class Ie{sessionStore;_textPlaceholders=[];_imagePlaceholders=[];id;expireIn=null;share;userKey;previewAspectRatio=1;resources=[];deviceId;get textPlaceholders(){return this._textPlaceholders}get imagePlaceholders(){return this._imagePlaceholders}get fontsResources(){return this.resources.filter((e=>"font-face"===e.type))}constructor(e,t){this.sessionStore=e,this.id=t.session.id,this.expireIn=t.session.expire_in,this.userKey=t.user_key||Oe,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.deviceId=t.deviceId}loadResources(){re(this.fontsResources)}getResources(e){return e.cache&&Array.isArray(e.cache)?e.cache:[]}mapTextPlaceholders(e){return e.map((e=>new ke(e.name,e.default_value)))}mapImagePlaceholders(e){return e.map((e=>new Ce(e.name,e.default_value)))}}class Ae extends Error{constructor(e){super(`Story with ID ${e} has already been shown to the user`),this.name="IasStoryAlreadyShownError"}}class Ee extends Error{constructor(e){super(`Like undefined on story with ID ${e}`),this.name="IasLikeUndefinedError"}}class Te extends Error{constructor(e){super(`Share url undefined on story with ID ${e}`),this.name="IasShareUrlUndefinedError"}}var Re,Pe=_(3142),Be=_.n(Pe),De=_(2438),je=_.n(De),Fe=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Ne=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.UGC=1]="UGC",e[e.FAVORITE=2]="FAVORITE",e[e.ONBOARDING=3]="ONBOARDING"}(Re||(Re={}));let Ue=(()=>{let e,t,s,i,r,a=[],o=[],n=[];return class{static{const l="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],s=[ve.action],i=[ve.action],r=[ve.action],Ne(this,null,e,{kind:"accessor",name:"storyIds",static:!1,private:!1,access:{has:e=>"storyIds"in e,get:e=>e.storyIds,set:(e,t)=>{e.storyIds=t}},metadata:l},o,n),Ne(this,null,t,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:l},null,a),Ne(this,null,s,{kind:"method",name:"removeById",static:!1,private:!1,access:{has:e=>"removeById"in e,get:e=>e.removeById},metadata:l},null,a),Ne(this,null,i,{kind:"method",name:"pushStoryId",static:!1,private:!1,access:{has:e=>"pushStoryId"in e,get:e=>e.pushStoryId},metadata:l},null,a),Ne(this,null,r,{kind:"method",name:"unshiftStoryId",static:!1,private:!1,access:{has:e=>"unshiftStoryId"in e,get:e=>e.unshiftStoryId},metadata:l},null,a),l&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:l})}rootStore=Fe(this,a);params;id;slug;hasFavorite;_cover;_type=Re.DEFAULT;#e=Fe(this,o,ve.observable.array());get storyIds(){return this.#e}set storyIds(e){this.#e=e}constructor(e,t,s){Fe(this,n),this.rootStore=t,this.params=s,this.id=e.id,this.slug=e.feedSlug,this.storyIds=e.stories.map((e=>e.id)),this.hasFavorite=Boolean(e.hasFavorite),this._cover=Xe.createByRawData(e.cover??{}),t.storyStore.addStoriesByDtos(e.stories)}get stories(){const e=this.rootStore.storyStore.activeUserStories;return this.storyIds.map((t=>e.get(t))).filter((e=>!!e))}get type(){return this._type}get cover(){return this._cover}get coverSrc(){const e=this._cover?.findOneByType("h");return e?.url}removeById(e){const t=this.storyIds.indexOf(e);-1!==t&&(0,ve.remove)(this.storyIds,t.toString())}pushStoryId(e){-1===this.storyIds.indexOf(e)&&this.storyIds.push(e)}unshiftStoryId(e){-1===this.storyIds.indexOf(e)&&this.storyIds.unshift(e)}getStoryById(e){return this.rootStore.storyStore.activeUserStories.get(e)}sortByStoryIds(e){this.storyIds.sort(((t,s)=>e.indexOf(t)-e.indexOf(s)))}}})();const ze="{{__favorite__}}";class Ve extends Ue{constructor(e,t){super(e,t),this._type=Re.FAVORITE}static createByStoryDtos(e,t){return new Ue({feedSlug:ze,stories:e},t)}}var We=_(6343),Ge=_.n(We);class $e extends Ue{tags=[];limit;constructor(e,t,s){super(e,t),this._type=Re.ONBOARDING,this.tags=s.tags,this.limit=s.limit,this.filterOpenedStories()}static getDefaultSlug(){return"onboarding"}isEqualParams(e){return Ge()(this.tags,e.tags)&&this.limit===e.limit}filterOpenedStories(){this.storyIds=this.stories.filter((e=>!e.isOpened)).map((e=>e.id))}}const He="{{__ugc__}}";class qe extends Ue{constructor(e,t){super(e,t),this._type=Re.UGC}static createByStoryDtos(e,t){return new Ue({feedSlug:He,stories:e},t)}}class Qe{storyManager;constructor(e){this.storyManager=e}async fetchStorySlides({id:e,feedSlug:t}){const{url:s,params:i}=this.getStoryRequestConfig(e,t);return(await Lt.get(s,i??{})).data}async fetchStory({id:e,feedSlug:t,fetchShareUrl:s,once:i}){const{url:r,params:a}=this.getStoryRequestConfig(e,t,!0,s,i),o=await Lt.get(r,a??{});if(204===o.status&&i)throw new Ae(e.toString());return o.data}async fetchStoryContext({ids:e}){const{url:t,params:s}=this.getStoryContextRequestConfig(e);return(await Lt.get(t,s??{})).data}async fetchStoryCSS(){const{url:e,params:t}=this.getStoryCSSRequestConfig();return(await Lt.get(e,t??{})).data.style??""}async setStoryLike(e,t){const s=await Lt.post(`story-like/${e}`,{value:t});if(null==s.data.like)throw new Ee(e);return s.data.like}async setStoryBookmark(e,t){return(await Lt.post(`story-favorite/${e}`,{value:t})).data.favorite}async markStoryAsOpened(e){const t=this.storyManager.rootStore.sessionStore.session;if(!t?.userKey)return;const s=`u/${t.userKey}/s_opened`;let i=ee(s);Be()(i)||(i=[]),i.push(e),i=je()(i),te(s,i)}async fetchStorySharePath(e){const t=await Lt.get(`story-share/${e}`,{});if(!t.data.url)throw new Te(e);return t.data.url}async updateNarrativeData(e,t){return Lt.request({url:"story-data/"+e,method:"put",data:{data:t}})}getStoryRequestConfig(e,t,s=!1,i,r){const a=["slides"];i&&a.push("share_url");const o={url:`${t===He?"ugc/":""}story/${e}`,method:"GET",params:{expand:a.join(",")}};return o.params.once=Number(Boolean(r)),s||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 Ke{storyManager;constructor(e){this.storyManager=e}async fetchUgcFeed({filter:e,tags:t,testKey:s}){const i={tags:t.join(","),test:s,f:e&&JSON.stringify(e)};return(await Lt.get("ugc/feed",i??{})).data}async fetchDefaultFeed({feedSlug:e,tags:t,testKey:s}){const i=`feed/${e}`,r={tags:t.join(","),test:s},a=await Lt.get(i,r??{});return a.data.feedSlug=e,a.data}async fetchFavoriteFeed({tags:e}){const t={tags:e.join(","),favorite:1};return(await Lt.get("story",t??{})).data}async fetchOnboardingFeed(e){const t=`feed/${e.feedSlug}/onboarding`,s={tags:e.tags.join(","),limit:e.limit},i=await Lt.get(t,s??{});return i.data.feedSlug=e.feedSlug,i.data}}var Ye=_(3981),Ze=_.n(Ye);class Je{width;height;type;url="";constructor(e){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 Xe{images=[];color="";gradient=!1;static createByRawData(e){const t=new Xe;for(let s in e)e.hasOwnProperty(s)&&t.images.push(new Je(e[s]));return t}findOneByType(e){return this.images.find((t=>t.type===e))??null}findOneByCoverQuality(e){return this.findOneByType(this.mapCoverQualityToImageType(e))}findOneByWidth(e,t=!1){let s=null;return this.images.forEach((t=>{t.width===e&&(s=t)})),null!==s?s:(s=Ze()(this.images)??null,t&&null!=s?s:null)}mapCoverQualityToImageType(e){switch(e){case u.Medium:return"m";case u.High:return"h"}}}var et=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},tt=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let st=(()=>{let e,t,s=[],i=[],r=[];return class a{static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],tt(this,null,e,{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:a},i,r),tt(this,null,t,{kind:"getter",name:"html",static:!1,private:!1,access:{has:e=>"html"in e,get:e=>e.html},metadata:a},null,s),a&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})}#t=(et(this,s),et(this,i,""));get _html(){return this.#t}set _html(e){this.#t=e}index=et(this,r);timeline;duration;screenshotShare;eventPayload;get html(){return this._html}constructor(e){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 a({index:0,timeline:{foreground:"",background:""},duration:0,screenshot_share:!1,html:""})}replaceSlideNonce(e){return ye(e,"{{nonce}}",K()??"")}updatePlaceholders(e){let t=this._html;for(const s of e)t=ye(t,`%${s.key}%`,s.value);this._html=t}}})();var it=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},rt=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let at=(()=>{let e,t,s,i,r,a,o,n,l,d,c,h,u,p,g,m,f,y=[],v=[],w=[],_=[],S=[],b=[],x=[],C=[],k=[],M=[],L=[],O=[],I=[],A=[],E=[],T=[],R=[];return class P{static{const P="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.observable],r=[ve.observable],a=[ve.observable],o=[ve.observable],n=[ve.observable],l=[ve.computed],d=[ve.computed],c=[ve.computed],h=[ve.computed],u=[ve.computed],p=[ve.computed],g=[ve.computed],m=[ve.computed],f=[ve.computed],rt(this,null,e,{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:P},v,w),rt(this,null,t,{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:P},_,S),rt(this,null,s,{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:P},b,x),rt(this,null,i,{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:P},C,k),rt(this,null,r,{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:P},M,L),rt(this,null,a,{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:P},O,I),rt(this,null,o,{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:P},A,E),rt(this,null,n,{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:P},T,R),rt(this,null,l,{kind:"getter",name:"like",static:!1,private:!1,access:{has:e=>"like"in e,get:e=>e.like},metadata:P},null,y),rt(this,null,d,{kind:"getter",name:"favorite",static:!1,private:!1,access:{has:e=>"favorite"in e,get:e=>e.favorite},metadata:P},null,y),rt(this,null,c,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:P},null,y),rt(this,null,h,{kind:"getter",name:"shareUrl",static:!1,private:!1,access:{has:e=>"shareUrl"in e,get:e=>e.shareUrl},metadata:P},null,y),rt(this,null,u,{kind:"getter",name:"title",static:!1,private:!1,access:{has:e=>"title"in e,get:e=>e.title},metadata:P},null,y),rt(this,null,p,{kind:"getter",name:"slidesLoaded",static:!1,private:!1,access:{has:e=>"slidesLoaded"in e,get:e=>e.slidesLoaded},metadata:P},null,y),rt(this,null,g,{kind:"getter",name:"error",static:!1,private:!1,access:{has:e=>"error"in e,get:e=>e.error},metadata:P},null,y),rt(this,null,m,{kind:"getter",name:"slides",static:!1,private:!1,access:{has:e=>"slides"in e,get:e=>e.slides},metadata:P},null,y),rt(this,null,f,{kind:"getter",name:"context",static:!1,private:!1,access:{has:e=>"context"in e,get:e=>e.context},metadata:P},null,y),P&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:P})}rootStore=it(this,y);storiesApi;id;stringId;statTitle="";titleColor="";background={color:"",gradient:!1};backgroundColor;slidesCount;source="";deeplink=null;hideInReader=null;disableClose=!1;likeFunctional;favoriteFunctional;shareFunctional;needPlaceholders=null;gameInstance;hideTimeline;tags=[];hasAudio;hasPlaceholder;hasSwipeUp;ugcPayload={};_title="";_image;_parsedSlideImage=null;_videoCoverSrc=null;_videoCover;#s=it(this,v,!1);get _slidesLoaded(){return this.#s}set _slidesLoaded(e){this.#s=e}#i=(it(this,w),it(this,_,null));get _error(){return this.#i}set _error(e){this.#i=e}#r=(it(this,S),it(this,b,null));get _context(){return this.#r}set _context(e){this.#r=e}#a=(it(this,x),it(this,C,0));get _like(){return this.#a}set _like(e){this.#a=e}#o=(it(this,k),it(this,M,!1));get _favorite(){return this.#o}set _favorite(e){this.#o=e}#n=(it(this,L),it(this,O,null));get _shareUrl(){return this.#n}set _shareUrl(e){this.#n=e}#l=(it(this,I),it(this,A,[]));get _slides(){return this.#l}set _slides(e){this.#l=e}#d=(it(this,E),it(this,T,!1));get _isOpened(){return this.#d}set _isOpened(e){this.#d=e}constructor(e,t,s){it(this,R),this.rootStore=t,this.storiesApi=s,this.id=e.id,this._title=e.title??"",this._isOpened=e.is_opened??!1,this.statTitle=e.stat_title??"",this.titleColor=e.title_color??"",this.background=e.background??{},this.backgroundColor=e.background_color??"",this.slidesCount=e.slides_count??0,this.disableClose=e.disable_close??!1,this.hideInReader=e.hide_in_reader??!1,this.likeFunctional=e.like_functional??!1,this.favoriteFunctional=e.favorite_functional??!1,this.shareFunctional=e.share_functional??!1,this.needPlaceholders=e.need_placeholders??!1,this.gameInstance=e.game_instance,this.hasAudio=e.has_audio??!1,this.hasSwipeUp=e.has_swipe_up??!1,this.stringId=e.string_id??"",this.tags=e.tags??[],this._like=e.like??0,this._favorite=e.favorite??!1,this.deeplink=e.deeplink??"",this.hideTimeline=e.hide_timeline??!1,this.ugcPayload=e.payload??{},this._image=Xe.createByRawData(e.image),this._videoCover=Xe.createByRawData(e.video_cover);const i=e.slides??[];this.setSlides(i),this.updateTitlePlaceholders(this.rootStore.placeholderStore.placeholders)}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 error(){return this._error}get slides(){return this._slides}get context(){return this._context}get image(){return this._image}static createEmpty(e,t){return new P({id:Date.now(),slides_count:1},e,t)}getImagesPerSlide(e){return this.parseHtmlSlidesForMainImage(),this._parsedSlideImage?.[e]??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 t?.[1]}parseSlideNarrativeVideoPosterSrc(e){const t=e.match(/<[^<]*narrative-element-video.*<video[^<]*poster\-remote\-src="([^"]*)"[^<]*>/i);return 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.updateSlidesPlaceholders(this.rootStore.placeholderStore.placeholders),this._slidesLoaded=!0)}setError(e){this._error=e}setContext(e){this._context=e}async setLike(e){if(this._like===e)return;const t=this._like;this._like=e;try{await this.storiesApi.setStoryLike(this.id,e)}catch(e){this._like=t,console.error(e)}}async setFavorite(e){if(this._favorite===e)return;const t=this._favorite;try{this._favorite=e,await this.storiesApi.setStoryBookmark(this.id,e);const t=this.rootStore.storyFeedStore.getFavoriteFeed();e?t.unshiftStoryId(this.id):t.removeById(this.id)}catch(e){throw console.error(e),this._favorite=t,e}}markIsOpened(){this.isOpened||(this.storiesApi.markStoryAsOpened(this.id),this._isOpened=!0,this.rootStore.onboardingFeedStore.removeOpenedStoryById(this.id))}async fetchStorySharePath(){if(null!==this._shareUrl)return this._shareUrl;const e=await this.storiesApi.fetchStorySharePath(this.id);return this._shareUrl=e,e}async updateNarrativeData(e){return this.storiesApi.updateNarrativeData(this.id,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 s of e)t=ye(t,`%${s.key}%`,s.value);this._title=t}mapSlidesByDto(e){return e.map((e=>new st(e)))}}})();class ot{widgetsData;constructor(e,t){this.widgetsData=this.mapStoryContextDto(e,t)}mapStoryContextDto(e,t){const s={},i=t.widgetsData??{};for(const t in i)Array.isArray(i[t])||(s[t]=i[t][e]);return s}updateNarrativeSavedData(e){this.widgetsData._narrative_saved_data=e}}var nt=_(1580),lt=_.n(nt);class dt{storyManager;constructor(e){this.storyManager=e}async launchGame({gameInstanceId:e,gameOptions:t}){const s=await this.storyManager.rootStore.sessionStore.open(),i={};t&&lt()(t)&&null!=t.demoMode&&(i.demoMode=Boolean(t.demoMode));const r=await Lt.post(`game/${e}/launch?expand=config`,i);if(!r.ok)throw new Error(JSON.stringify(r.data));return r.data.clientConfig=this.getClientConfig(s),r.data}getClientConfig(e){const t=this.storyManager.getConfig(),s=this.storyManager.rootStore.placeholderStore.placeholders;return{sessionId:e.id,userKey:e.userKey,apiKey:t.apiKey,sdkVersion:"3.3.0",apiBaseUrl:V.apiUrl,userAgent:xt,appPackageId:t.appPackageId,deviceId:e.deviceId,userId:t.userId??"",lang:t.lang.toString(),placeholders:s.map((e=>({type:e.type,name:e.key,value:e.value})))}}}class ct 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 ht="en-US";class ut{languageCode;countryCode;tag;rawData="";constructor(e=ht){this.rawData=e;const t=this.normalizeAndEnsureCompatibility(e),s=this.validateTag(t);this.parseTag(s)}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){return{ru:"ru-RU",en:"en-US"}[e]??e}validateTag(e){return this.isValidTag(e)?e:(console.error(new ct(e).message),this.getNavigatorTag())}getNavigatorTag(){const e=navigator.language.toLowerCase();return this.isValidTag(e)?e:(console.error(`Invalid navigator language tag: ${e}`),ht)}parseTag(e){const[t,s]=e.split("-");this.languageCode=t,this.countryCode=s.toUpperCase(),this.tag=`${this.languageCode}-${this.countryCode}`}}var pt=_(986),gt=_.n(pt);class mt extends Error{constructor(){super("You must pass the <userId> value"),this.name="IasEmptyUserIdError"}}var ft=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},yt=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let vt=(()=>{let e,t,s,i,r,a=[],o=[],n=[],l=[],d=[],c=[],h=[],u=[],p=[];return class{static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.observable],r=[_e],yt(this,null,e,{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:g},o,n),yt(this,null,t,{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:g},l,d),yt(this,null,s,{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:g},c,h),yt(this,null,i,{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:g},u,p),yt(this,null,r,{kind:"method",name:"reloadSdk",static:!1,private:!1,access:{has:e=>"reloadSdk"in e,get:e=>e.reloadSdk},metadata:g},null,a),g&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})}storyManager=ft(this,a);#c=ft(this,o,"");get _apiKey(){return this.#c}set _apiKey(e){this.#c=e}#h=(ft(this,n),ft(this,l,[]));get _tags(){return this.#h}set _tags(e){this.#h=e}#u=(ft(this,d),ft(this,c,new ut));get _lang(){return this.#u}set _lang(e){this.#u=e}_disableDeviceId=(ft(this,h),!1);_appPackageId="";_textPlaceholders=[];_imagePlaceholders=[];_isStatisticsDisabled=!1;#p=ft(this,u,"");get _userId(){return this.#p}set _userId(e){this.#p=e}_userIdSign=ft(this,p);_isInited=!1;constructor(e,t){this.storyManager=e,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}disableStatistic(){this._isStatisticsDisabled=!0}enableStatistic(){this._isStatisticsDisabled=!1}setApiKey(e){this._apiKey!==e&&(!function(e){const t=W(e);if(null!=t){const e=t.split(".").slice(1);V.baseUrl=`https://${["cdn",...e].join(".")}`,V.faviconApiUrl=`https://${["favicon",...e].join(".")}`,V.apiUrl=`https://${t}`}}(e),this._apiKey=e,this.storyManager.rootStore.sessionStore.close())}async setUserId(e,t){if((J()(e)||gt()(e))&&this._userId!==e){if(this._disableDeviceId&&!this._userId)throw new mt;_t.getInstance().checkUserIdLength(e),this._userId=e,this._userIdSign=t,this._isInited&&await this.reloadSdk()}}async setLang(e){J()(e)&&this._lang.toRawData()!==e&&(this._lang=new ut(e),this._isInited&&await this.reloadSdk())}setTextPlaceholders(e={}){if(!lt()(e))return;const t=this.mapTextPlaceholders(e);Ge()(this._textPlaceholders,t)||(this._textPlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._textPlaceholders))}setImagePlaceholders(e={}){if(!lt()(e))return;const t=this.mapImagePlaceholders(e);Ge()(this._imagePlaceholders,t)||(this._imagePlaceholders=t,this.storyManager.rootStore.placeholderStore.addPlaceholders(this._imagePlaceholders))}setTags(e){Ge()(this._tags,e)||(_t.getInstance().checkTagsLength(e),this._tags=e)}updateByDto(e){this._appPackageId=e.appPackageId??"",this._disableDeviceId=Boolean(e.disableDeviceId),this.setApiKey(e.apiKey),this.setUserId(e.userId??"",e.userIdSign),this.setLang(e.lang??""),this.setTextPlaceholders(e.placeholders??{}),this.setImagePlaceholders(e.imagePlaceholders??{}),this.setTags(e.tags??[])}mapTextPlaceholders(e){const t=[];for(const[s,i]of Object.entries(e))t.push(new Le(s,i));return t}mapImagePlaceholders(e){const t=[];for(const[s,i]of Object.entries(e))t.push(new Me(s,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)}}}})();function wt(e){let t=e.length;for(let s=e.length-1;s>=0;s--){const i=e.charCodeAt(s);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&s--}return t}class _t{static instance;constructor(){return _t.instance||(_t.instance=this),_t.instance}static getInstance(){return _t.instance?_t.instance:new _t}_sdkConfigIsIncorrect=!1;get sdkConfigIsIncorrect(){return this._sdkConfigIsIncorrect}_userIdByteLimit=255;_tagsByteLimit=4e3;userMessage="";tagsMessage="";get sdkConfigErrorsAsArray(){const e=[];return this.userMessage&&e.push(this.userMessage),this.tagsMessage&&e.push(this.tagsMessage),e}checkUserIdLength(e){this.userMessage="",null!=e&&wt(String(e))>this._userIdByteLimit&&(console.error(`UserId is bigger then ${this._userIdByteLimit} bytes`),this._sdkConfigIsIncorrect=!0,this.userMessage=`UserId "${String(e)}" is bigger then ${this._userIdByteLimit} bytes`)}checkTagsLength(e){this.tagsMessage="",null!=e&&Array.isArray(e)&&wt(e.join(","))>this._tagsByteLimit&&(console.error(`Tags (joined by ',') is bigger then ${this._tagsByteLimit} bytes`),this._sdkConfigIsIncorrect=!0,this.tagsMessage=`Tags (joined by ',') "${e.join(",")}" is bigger then ${this._tagsByteLimit} bytes`)}}var St=_(3668),bt=_.n(St);const xt=`InAppStoryWebSDK/${parseInt(30300)} ${(e=>{let t="";for(let s=0;s<e.length;s++){t+=e.charCodeAt(s)<=255?e[s]:"?"}return t})(navigator.userAgent)}`;function Ct(e,t){return{...e,...t}}const kt=new class{_deviceInfoPromise=null;set deviceInfoPromise(e){this._deviceInfoPromise=e}_baseHeaders={};set baseHeaders(e){this._baseHeaders=e}get baseURL(){return`${V.apiUrl}/v2/`}requestInterceptors=[];interceptors={request:{use:e=>{this.requestInterceptors.push(e)}}};async request(e){return new Promise(((t,s)=>{const i=async()=>{try{if(lt()(e.headers)&&null!=e.headers||(e.headers={}),e.headers=Ct(this._baseHeaders,e.headers),this.requestInterceptors.length)for(const t of this.requestInterceptors)t(e);let i="";!bt()(e.params)&&lt()(e.params)&&(i=new URLSearchParams(Object.entries(e.params).filter((([e,t])=>null!=t&&""!=t))).toString());let r=new URL(`${N(e.url)}${i?"?"+i:""}`,this.baseURL),a="get";bt()(e.method)||(a=e.method);let o={};!bt()(e.headers)&&lt()(e.headers)&&(o=e.headers);let n=null;!bt()(e.data)&&lt()(e.data)&&(n=JSON.stringify(e.data),o["Content-Type"]="application/json");try{if(_t.getInstance().sdkConfigIsIncorrect)return void s(z.createByRequestError({data:{name:"SDK config is incorrect",message:_t.getInstance().sdkConfigErrorsAsArray.join(". "),status:400},headersRaw:{},headers:{},status:400,statusText:"SDK config is incorrect",ok:!1}))}catch(e){console.error(e)}const l=await fetch(r.toString(),{method:a,body:n,headers:o,credentials:"omit"});let d={};204!==l.status&&(d=await l.json());const c={data:d,headersRaw:l.headers,headers:Object.fromEntries([...l.headers]),status:l.status,statusText:l.statusText,ok:l.ok};if(!l.ok)return void s(z.createByRequestError(c));t(c)}catch(e){s(z.createByFetchError(e))}};this._deviceInfoPromise?this._deviceInfoPromise.finally(i):i()}))}async post(e,t,s={}){return this.request({method:"post",url:e,data:t,params:s})}async get(e,t={}){return this.request({method:"get",url:e,params:t})}};function Mt(e,t,s){if("sendBeacon"in navigator){const r=on.rootStore.sessionStore.session,a=new URLSearchParams({access_token:on.getConfig().apiKey,session_id:r?.id||"",x_user_agent:xt}),o=on.getConfig();null!=o.appPackageId&&a.append("x_app_package_id",o.appPackageId);const n=`${i=kt.baseURL,i.replace(/\/$/,"")}/${N(e)}?${a.toString()}`,l=new FormData;Object.keys(t).forEach((e=>{U(l,t[e],e)}));let d=!1;null!=Array.from&&null!=l.keys&&(d=0===Array.from(l.keys()).length),d||navigator.sendBeacon(n,l),s()}else kt.post(e,t).then((()=>s()),(()=>s()));var i}kt.interceptors.request.use((e=>{const t=on.getConfig(),s=on.rootStore.sessionStore.session;return e.headers=Ct(e.headers??{},{Authorization:`Bearer ${t.apiKey}`,"Accept-Language":t.lang.toString(),"Auth-Session-Id":s?.id,"X-User-Id":t.userId||"","X-Request-Id":(0,F.v4)(),"X-User-Agent":xt}),null!=t.appPackageId&&(e.headers["X-App-Package-Id"]=t.appPackageId),t.disableDeviceId||(e.headers["X-Device-Id"]=s?.deviceId),e}));const Lt=kt;class Ot extends Error{constructor(e){super(`[IAM]: not found IAM for ID <${e}>`),this.name="IamNotFoundByIdError"}}class It extends Error{constructor(e){super(`[IAM]: not found IAM limit for ID <${e}>`),this.name="IamNotFoundLimitError"}}var At=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Et=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};const Tt="campaign_name,id,events,appearance,slides_html,type,frequency_limit,display_to,display_from,need_placeholders,has_limit".split(",").map((e=>`messages.${e}`)).join(",");let Rt=(()=>{let e,t,s,i=[];return class{static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[_e],t=[_e],s=[_e],Et(this,null,e,{kind:"method",name:"fetchAll",static:!1,private:!1,access:{has:e=>"fetchAll"in e,get:e=>e.fetchAll},metadata:r},null,i),Et(this,null,t,{kind:"method",name:"fetchContext",static:!1,private:!1,access:{has:e=>"fetchContext"in e,get:e=>e.fetchContext},metadata:r},null,i),Et(this,null,s,{kind:"method",name:"fetchById",static:!1,private:!1,access:{has:e=>"fetchById"in e,get:e=>e.fetchById},metadata:r},null,i),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})}storyManager=At(this,i);constructor(e){this.storyManager=e}async fetchAll({tags:e}){try{return(await Lt.get("inappmessaging",{fields:Tt,tag:e.join(",")})).data.messages}catch(e){return[]}}async fetchContext(){return(await Lt.get("inappmessaging/message-context",{fields:"style,widgetsData"})).data}async fetchById(e){const t=(await Lt.get("inappmessaging",{id:e,fields:Tt})).data.messages.find((t=>t.id.toString()===e.toString()));if(!t)throw new Ot(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 Lt.post(`/inappmessaging/message/${e}/event/${t.type}`,t.toQueryParams())}catch(e){console.error(e)}}async fetchUserData(e){try{return(await Lt.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 Lt.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 Lt.post("inappmessaging/message-limit",{id:[e]})).data.find((t=>t.messageId.toString()===e.toString()));if(!t)throw new It(e);return t}}})();class Pt{backgroundColor=""}class Bt extends Pt{contentRatio;borderRadius;backdrop;closeButton;constructor(e){super(),this.backgroundColor=e.background_color??"#FFFFFFFF",this.borderRadius=e.corner_radius??16,this.contentRatio=e.content_ratio||.64,this.backdrop={opacity:e.backdrop_alpha??.3},this.closeButton={marginTop:e.close_button?.top_margin??8,width:e.close_button?.width??32,height:e.close_button?.height??4,backgroundColor:e.close_button?.color??"#00000080"}}}var Dt,jt;!function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(Dt||(Dt={})),function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right"}(jt||(jt={}));class Ft extends Pt{contentRatio;borderRadius;animationType;backdrop;backgroundColor;closeBtnPosition;horizontalPadding;constructor(e){super(),this.borderRadius=e.corner_radius??16,this.contentRatio=e.content_ratio||.64,this.animationType=e.animation_type??Dt.None,this.backdrop={opacity:e.backdrop_alpha??.3},this.backgroundColor=e.background_color??"#FFFFFFFF",this.closeBtnPosition=e.close_button_position??jt.Right,this.horizontalPadding=e.horizontal_padding??16}}class Nt extends Pt{animationType;closeBtnPosition;constructor(e){super(),this.animationType=e.animation_type??Dt.None,this.backgroundColor=e.background_color??"#FFFFFFFF",this.closeBtnPosition=e.close_button_position??jt.Right}}class Ut{create(e,t){switch(e){case hs.BottomSheet:return new Bt(t);case hs.Modal:return new Ft(t);case hs.Fullscreen:return new Nt(t)}}}var zt=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Vt=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let Wt=(()=>{let e,t,s=[],i=[],r=[];return class{static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],Vt(this,null,e,{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:a},i,r),Vt(this,null,t,{kind:"getter",name:"html",static:!1,private:!1,access:{has:e=>"html"in e,get:e=>e.html},metadata:a},null,s),a&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})}message=zt(this,s);#t=zt(this,i,"");get _html(){return this.#t}set _html(e){this.#t=e}constructor(e){zt(this,r),this.message=e}get html(){return this._html}updateByDto(e){this._html=this.getSlideHtml(e)}getSlideHtml(e){let t=e;return t=ye(t,"{{nonce}}",K()??""),t}updatePlaceholders(e){let t=this._html;for(const s of e)t=ye(t,`%${s.key}%`,s.value);this._html=t}}})();var Gt=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},$t=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let Ht=(()=>{let e,t,s,i,r,a,o,n,l,d,c,h,u,p,g,m,f,y,v=[],w=[],_=[],S=[],b=[],x=[],C=[],k=[],M=[],L=[],O=[],I=[],A=[],E=[],T=[],R=[],P=[];return class B{static{const B="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.observable],r=[ve.observable],a=[ve.observable],o=[ve.observable],n=[ve.observable],l=[ve.computed],d=[ve.computed],c=[ve.computed],h=[ve.computed],u=[ve.computed],p=[ve.computed],g=[ve.computed],m=[ve.computed],f=[ve.computed],y=[ve.action],$t(this,null,e,{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:B},w,_),$t(this,null,t,{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:B},S,b),$t(this,null,s,{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:B},x,C),$t(this,null,i,{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:B},k,M),$t(this,null,r,{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:B},L,O),$t(this,null,a,{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:B},I,A),$t(this,null,o,{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:B},E,T),$t(this,null,n,{kind:"accessor",name:"_isOnceOpened",static:!1,private:!1,access:{has:e=>"_isOnceOpened"in e,get:e=>e._isOnceOpened,set:(e,t)=>{e._isOnceOpened=t}},metadata:B},R,P),$t(this,null,l,{kind:"getter",name:"id",static:!1,private:!1,access:{has:e=>"id"in e,get:e=>e.id},metadata:B},null,v),$t(this,null,d,{kind:"getter",name:"needPlaceholders",static:!1,private:!1,access:{has:e=>"needPlaceholders"in e,get:e=>e.needPlaceholders},metadata:B},null,v),$t(this,null,c,{kind:"getter",name:"isOnceOpened",static:!1,private:!1,access:{has:e=>"isOnceOpened"in e,get:e=>e.isOnceOpened},metadata:B},null,v),$t(this,null,h,{kind:"getter",name:"hasLimit",static:!1,private:!1,access:{has:e=>"hasLimit"in e,get:e=>e.hasLimit},metadata:B},null,v),$t(this,null,u,{kind:"getter",name:"events",static:!1,private:!1,access:{has:e=>"events"in e,get:e=>e.events},metadata:B},null,v),$t(this,null,p,{kind:"getter",name:"slides",static:!1,private:!1,access:{has:e=>"slides"in e,get:e=>e.slides},metadata:B},null,v),$t(this,null,g,{kind:"getter",name:"context",static:!1,private:!1,access:{has:e=>"context"in e,get:e=>e.context},metadata:B},null,v),$t(this,null,m,{kind:"getter",name:"appearanceOptions",static:!1,private:!1,access:{has:e=>"appearanceOptions"in e,get:e=>e.appearanceOptions},metadata:B},null,v),$t(this,null,f,{kind:"getter",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type},metadata:B},null,v),$t(this,null,y,{kind:"method",name:"updateByDto",static:!1,private:!1,access:{has:e=>"updateByDto"in e,get:e=>e.updateByDto},metadata:B},null,v),B&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:B})}iamStatisticsService=Gt(this,v);iamStore;#g=Gt(this,w,void 0);get _id(){return this.#g}set _id(e){this.#g=e}#m=(Gt(this,_),Gt(this,S,{}));get _events(){return this.#m}set _events(e){this.#m=e}#f=(Gt(this,b),Gt(this,x,void 0));get _type(){return this.#f}set _type(e){this.#f=e}#l=(Gt(this,C),Gt(this,k,[]));get _slides(){return this.#l}set _slides(e){this.#l=e}#y=(Gt(this,M),Gt(this,L,new Pt));get _appearanceOptions(){return this.#y}set _appearanceOptions(e){this.#y=e}#v=(Gt(this,O),Gt(this,I,!1));get _needPlaceholders(){return this.#v}set _needPlaceholders(e){this.#v=e}#w=(Gt(this,A),Gt(this,E,!1));get _hasLimit(){return this.#w}set _hasLimit(e){this.#w=e}#_=(Gt(this,T),Gt(this,R,!1));get _isOnceOpened(){return this.#_}set _isOnceOpened(e){this.#_=e}_frequencyLimit=(Gt(this,P),null);_displayFrom=null;_displayTo=null;_campaignName="";constructor(e,t,s){this.iamStatisticsService=t,this.iamStore=s,this._id=e}get id(){return this._id}get needPlaceholders(){return this._needPlaceholders}get openTime(){return this.iamStatisticsService.openTime}get timeSinceLastShow(){return this.iamStatisticsService.timeSinceLastShow}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 activeSlideIndex(){return 0}get context(){return this.iamStore.messageContext}get appearanceOptions(){return this._appearanceOptions}get type(){return this._type}destroy(){}updateByDto(e){this._events=this.mapMessageEventsByDto(e.events??[]),this._type=e.type,this._campaignName=e.campaign_name,this._frequencyLimit=e.frequency_limit,this._displayFrom=e.display_from??null,this._displayTo=e.display_to??null,this._hasLimit=Boolean(e.has_limit),this._appearanceOptions=(new Ut).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]}toPublicDto(){return{id:this._id,campaignName:this._campaignName,type:this._type}}async trackOpen(){this._isOnceOpened=!0,await this.iamStatisticsService.trackOpen(this)}async trackClose(){await this.iamStatisticsService.trackClose(this)}async trackWidgetEvent(e){await this.iamStatisticsService.trackWidgetEvent(this,e)}async updateUserData(e){return this.iamStore.updateMessageUserData(this.id,e)}updateMessageSlides(e){const t=[];for(const s of e){const e=new Wt(this);e.updateByDto(s),t.push(e)}this._slides=t}mapMessageEventsByDto(e){const t={};for(const s of e)t[s.name]=s;return t}static createByDto(e,t,s){const i=new B(e.id,s,t);return i.updateByDto(e),i}updatePlaceholders(e){for(const t of this._slides)t.updatePlaceholders(e)}}})();class qt{}class Qt extends qt{widgetId;value;label;constructor(e,t,s){super(),this.widgetId=e,this.value=t,this.label=s}get type(){return"w-copy"}toQueryParams(){return{wi:this.widgetId,wv:this.value,wl:this.label}}toJSON(){return{widgetId:this.widgetId,value:this.value}}}class Kt extends qt{widgetId;value;label;constructor(e,t,s){super(),this.widgetId=e,this.value=t,this.label=s}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 Yt extends qt{widgetId;answer;label;constructor(e,t,s){super(),this.widgetId=e,this.answer=t,this.label=s}get type(){return"w-range-slider"}toQueryParams(){return{wi:this.widgetId,wa:this.answer,wl:this.label}}toJSON(){return{widgetId:this.widgetId,answer:this.answer,label:this.label}}}class Zt extends qt{widgetId;answer;label;value;constructor(e,t,s,i){super(),this.widgetId=e,this.answer=t,this.label=s,this.value=i}get type(){return"w-rate"}toQueryParams(){return{wi:this.widgetId,wa:this.answer,wl:this.label,wv:this.value}}toJSON(){return{widgetId:this.widgetId,value:this.value,answer:this.answer,label:this.label}}}class Jt extends qt{widgetId;answer;label;value;answerLabel;constructor(e,t,s,i,r){super(),this.widgetId=e,this.answer=t,this.label=s,this.value=i,this.answerLabel=r}get type(){return"w-share"}toQueryParams(){return{wi:this.widgetId,wa:this.answer,wl:this.label,wv:this.value,wal:this.answerLabel}}toJSON(){return{widgetId:this.widgetId,value:this.value,answer:this.answer,label:this.label,answerLabel:this.answerLabel}}}class Xt{iterationId;slideIndex;slideTotal;eventId=(0,F.v4)();constructor(e,t,s){this.iterationId=e,this.slideIndex=t,this.slideTotal=s}toQueryParams(){return{ei:this.eventId,ii:this.iterationId,si:this.slideIndex,st:this.slideTotal}}}class es extends Xt{duration;constructor(e,t,s,i){super(e,t,s),this.duration=i}get type(){return"close"}toQueryParams(){return{...super.toQueryParams(),d:this.duration}}}class ts extends Xt{constructor(e,t,s){super(e,t,s)}get type(){return"open"}toQueryParams(){return super.toQueryParams()}}class ss extends Xt{duration;widgetEvent;constructor(e,t,s,i,r){super(e,t,s),this.duration=i,this.widgetEvent=r}get type(){return this.widgetEvent.type}toQueryParams(){return{...super.toQueryParams(),...this.widgetEvent.toQueryParams(),d:this.duration}}}class is{iamApi;iterationId=null;_openTime=0;constructor(e){this.iamApi=e}get openTime(){return this._openTime}get timeSinceLastShow(){return Date.now()-this.openTime}async trackOpen(e){this.iterationId=this.generateId(),this._openTime=Date.now();const t=new ts(this.iterationId,e.activeSlideIndex,e.slides.length);await this.iamApi.emitMessageEvent(e.id,t)}async trackClose(e){const t=this.timeSinceLastShow,s=new es(this.iterationId,e.activeSlideIndex,e.slides.length,t);await this.iamApi.emitMessageEvent(e.id,s)}async trackWidgetEvent(e,t){const s=this.timeSinceLastShow,i=new ss(this.iterationId,e.activeSlideIndex,e.slides.length,s,t);return this.iamApi.emitMessageEvent(e.id,i)}generateId(){return(0,F.v4)()}}class rs extends Error{constructor(){super("[IAM]: you must close other opened readers"),this.name="IamOtherReaderIsOpenError"}}class as extends Error{constructor(){super("[IAM]: you need preload in app messages"),this.name="IamShowOnlyIfLoadedError"}}class os extends Error{constructor(){super("[IAM]: show message frequency limit exceeded"),this.name="IamFrequencyLimitError"}}class ns extends Error{constructor(){super("[IAM]: not in display time range"),this.name="IamCheckDisplayTimeRangeError"}}class ls extends Error{constructor(e){super(`[IAM]: the limit for displaying IAM with ID ${e} has been reached`),this.name="IamMessageLimitExceededError"}}class ds{storyManager;iamStore;errors=[];constructor(e,t){this.storyManager=e,this.iamStore=t}checkOtherReadersAreClosed(){return(this.storyManager.storyReaderViewModel?.isOpened||this.storyManager.gameReaderViewModel?.isOpened)&&this.errors.push(new rs),this}checkShowOnlyIfLoaded(e){return!this.iamStore.isLoaded&&e&&this.errors.push(new as),this}checkFrequencyLimit(e){return e.frequencyLimitTimeExceeded&&this.errors.push(new os),this}checkDisplayTimeRange(e){return e.withinDisplayTimeRange||this.errors.push(new ns),this}validate(){if(this.errors.length>0)throw this.errors.shift()}}class cs{storyManager;iamStore;iamApi;constructor(e,t,s){this.storyManager=e,this.iamStore=t,this.iamApi=s}async getMessageById(e,t){new ds(this.storyManager,this.iamStore).checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t).validate();const s=await this.iamStore.findById(e);return s.hasLimit&&await this.checkMesageLimit(e),s}async getMessageByEvent(e,t){new ds(this.storyManager,this.iamStore).checkOtherReadersAreClosed().checkShowOnlyIfLoaded(t).validate(),await this.iamStore.preload();const s=this.iamStore.findAllByEvent(e),i=this.getMessagesSortedByEventPriority(e,s);return this.getFirstValidMessageByEvent(i)}async getFirstValidMessageByEvent(e){let t=new Error;for(const s of e)try{return await this.validateMessageByEvent(s)}catch(e){t=e}throw t}async validateMessageByEvent(e){return new ds(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 ls(e)}getMessagesSortedByEventPriority(e,t){return t.slice().sort(((t,s)=>{const i=t.events[e].priority;return s.events[e].priority-i}))}}var hs,us,ps;!function(e){e[e.BottomSheet=1]="BottomSheet",e[e.Modal=2]="Modal",e[e.Fullscreen=3]="Fullscreen"}(hs||(hs={})),function(e){e[e.None=0]="None",e[e.SlideInUp=1]="SlideInUp",e[e.FadeIn=2]="FadeIn"}(us||(us={})),function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right"}(ps||(ps={}));class gs{iamReader;constructor(e){this.iamReader=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()}}var ms=_(5136);const fs=new t.EventEmitter;fs.setMaxListeners(50);class ys{story;payload;title=null;tags=[];slidesCount=null;feedSlug=null;filter=null;actionSource=M.list;ugcPayload=null;slideEventPayload=null;constructor(e,t={}){this.story=e,this.payload=t;const s=this.story.sourceInfo,i=s.listType,r=s.feedSlug??null,a=s.filter??null;this.title=this.story.statTitle,this.tags=this.story.tags,this.slidesCount=this.story.slidesCount,this.ugcPayload=i===Re.UGC?this.story.ugcPayload:null,this.feedSlug=i===Re.DEFAULT?r:null,this.filter=i===Re.UGC?a:null,this.actionSource=null!=i?this.getStorySourceByFeedType(i):M.direct,this.slideEventPayload=e.activeSlide?.eventPayload?.payload??null}toJSON(){return{id:this.story.id,index:this.story.activeSlideIndex,title:this.title,tags:this.tags,slidesCount:this.slidesCount,feed:this.feedSlug,filter:this.filter,source:this.actionSource,ugcPayload:this.ugcPayload,payload:this.slideEventPayload,...this.payload}}getStorySourceByFeedType(e){switch(e){case Re.DEFAULT:case Re.UGC:return M.list;case Re.FAVORITE:return M.favorite;case Re.ONBOARDING:return M.onboarding;default:return M.list}}}class vs extends ys{get name(){return"closeStory"}toJSON(){return{...super.toJSON(),action:this.payload.action}}}class ws extends ys{get name(){return"dislikeStory"}toJSON(){return{...super.toJSON(),value:this.payload.value}}}class _s extends ys{get name(){return"favoriteStory"}toJSON(){return{...super.toJSON(),value:this.payload.value}}}class Ss extends ys{get name(){return"likeStory"}toJSON(){return{...super.toJSON(),value:this.payload.value}}}class bs extends ys{get name(){return"shareStory"}}class xs extends ys{get name(){return"shareStoryWithPath"}toJSON(){return{...super.toJSON(),value:this.payload.url}}}class Cs extends ys{get name(){return"showSlide"}}class ks extends ys{get name(){return"showStory"}toJSON(){const e=super.toJSON();return e.payload=null,e}}class Ms{cache={};set(e,t){this.cache[e]=t}clear(){this.cache={}}get(e){return this.cache[e]}}class Ls{actions=[];push(e){this.actions.push(e)}exec(){for(const e of this.actions)e()}flush(){this.actions=[]}}class Os{statisticsService;constructor(e){this.statisticsService=e}timerId=null;start(){this.schedule(1e4)}stop(){null!=this.timerId&&(clearTimeout(this.timerId),this.timerId=null)}async flush(){$(`[${Ps.name}]: flush statistics by timer`);this.statisticsService.getData().length>0?this.schedule(1e4):this.schedule(3e4),await this.statisticsService.sendData()}schedule(e){$(`[${Ps.name}]: schedule flush statistics on ${e}ms`),this.timerId=setTimeout((()=>this.flush()),e)}}class Is{slideStartedAt;calculate(){const e=Date.now(),t=e-this.slideStartedAt;return this.slideStartedAt=e,t}init(){this.slideStartedAt=Date.now()}}class As{statisticsService;constructor(e){this.statisticsService=e,this.handle=this.handle.bind(this),fs.on(Rs.CloseStoryReader,this.handle)}handle(e){this.statisticsService.addSlideEvent({action:1,storyId:e.storyId,slideIndex:e.slideIndex})}destroy(){fs.off(Rs.CloseStoryReader,this.handle)}}class Es{statisticsService;constructor(e){this.statisticsService=e,this.handle=this.handle.bind(this),fs.on(Rs.NextSlide,this.handle)}handle(e){this.statisticsService.addSlideEvent({action:1,storyId:e.fromStoryId,slideIndex:e.fromSlideIndex})}destroy(){fs.off(Rs.NextSlide,this.handle)}}class Ts{statisticsService;constructor(e){this.statisticsService=e,this.handle=this.handle.bind(this),fs.on(Rs.TransitionFromSlide,this.handle)}handle(e){this.statisticsService.addSlideEvent({action:2,storyId:e.storyId,slideIndex:e.slideIndex})}destroy(){fs.off(Rs.TransitionFromSlide,this.handle)}}var Rs;!function(e){e.CloseStoryReader="statistics.closeStoryReader",e.NextSlide="statistics.nextSlide",e.TransitionFromSlide="statistics.transitionFromSlide"}(Rs||(Rs={}));class Ps extends(s()){storyManager;beaconService;lastIndex=0;data=[];sourceInfo=null;flushSheduler;slideDurationCalculator;events=[];constructor(e,t){super(),this.storyManager=e,this.beaconService=t,this.flushSheduler=new Os(this),this.slideDurationCalculator=new Is}init(e){this.data=[],this.sourceInfo=e,this.lastIndex=0,this.slideDurationCalculator.init(),this.flushSheduler.start(),this.events=[new As(this),new Es(this),new Ts(this)]}getData(){return this.data.slice()}getLastIndex(){return this.lastIndex}cleanupData(){this.data=[]}addSlideEvent(e){if(this.storyManager.getConfig().isStatisticsDisabled)return;const t=this.slideDurationCalculator.calculate();this.data.push([e.action,this.lastIndex,e.storyId,e.slideIndex,t]),this.lastIndex++}async sendData(){const e=this.getData();if(e.length)try{if(!this.sourceInfo)throw new Error(`[${Ps.name}]: You need pass source info!`);this.cleanupData(),await this.beaconService.updateStatistics({updateDto:{data:e},listType:this.sourceInfo.feedSlug===He?Re.UGC:Re.DEFAULT})}catch(t){this.data.push(...e),console.error(t)}}async destroy(){this.events.forEach((e=>e.destroy())),this.flushSheduler.stop(),await this.sendData()}}class Bs{storyManager;constructor(e){this.storyManager=e}async updateStatistics({listType:e,updateDto:t}){if(0===t.data.length)return t;let s=!1,i="";if(e===Re.UGC||this.storyManager.getConfig().isStatisticsDisabled)s=!0;else try{Mt("session/update",t,(()=>{})),s=!0}catch(e){i=e.toString()}if(s)return t;throw i}}var Ds=_(6166);class js{narrativeDataCache;storyManager;storyReader;deferredActionsQueue=new Ls;activeStoryNarrativeDataCache=new Ms;initHookStorySlide=null;activeStorySlide=null;activeStory=null;mutex=new Ds.Mutex;mutexRelease=()=>{};constructor(e,t,s){this.narrativeDataCache=e,this.storyManager=t,this.storyReader=s}setInitHookStorySlide(e){this.initHookStorySlide=e}async lock(e){if(this.activeStorySlide!==e){if(this.mutexRelease=await this.mutex.acquire(),this.activeStorySlide&&this.activeStorySlide!==e)throw new Error(`[SlideApi]: The resource is locked by story with ID ${this.activeStorySlide.story.id} and slide index ${this.activeStorySlide.index}`);this.activeStorySlide=e}else console.warn(`[SlideApi]: Slide ${e.story.id}:${e.index} already owns the lock.`)}unlock(e){this.activeStorySlide===e?(this.mutexRelease(),this.activeStorySlide=null):console.warn("[SlideApi]: Attempted to unlock a slide that doesn't own the lock.")}exec(){this.activeStorySlide&&(this.deferredActionsQueue.exec(),this.deferredActionsQueue.flush())}async getCardLocalData(){const e=this.storyManager.rootStore.sessionStore.userId;if(!this.activeStory)return{};let t=this.narrativeDataCache.get(`narrative_${this.activeStory.id}_data_${e}`);return t?JSON.parse(t):{}}setCardLocalData(e,t){const s=this.storyManager.rootStore.sessionStore.userId;if(!this.activeStory)return;let i=JSON.stringify(e);this.narrativeDataCache.set(`narrative_${this.activeStory.id}_data_${s}`,i),t&&this.activeStory.updateNarrativeData(i).catch(console.error)}getCardServerData(e){return this.storyManager.rootStore.storyStore.findStoryById(e).context.widgetsData._narrative_saved_data??null}updateCardServerData(e,t){this.storyManager.rootStore.storyStore.findStoryById(e).context.updateNarrativeSavedData(t)}getSlideDuration(e,t){const s=this.storyManager.rootStore.storyStore.findStoryById(e).context.widgetsData;return s._narrative_slides_duration?.[t]??null}pauseUI(){this.storyReader.pauseUI()}resumeUI(){this.storyReader.resumeUI()}showCardTextInput(e,t){fs.emit(Hr.ShowInputModal,{id:e,config:t})}setCardSessionValue(e,t){this.activeStoryNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.activeStoryNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const s=this.storyManager.rootStore.storyStore.findStoryById(e);if(!s)return null;const i=s.context.widgetsData;switch(t){case"rangeSlider":return i._narrative_range_slider_data;case"poll":return i._narrative_poll_data;case"vote":return i._narrative_vote_data}return null}openUrl(e){this.activeStory&&(this.activeStory.markAsOpened(),fs.emit(Rs.TransitionFromSlide,{storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),window.open(e,"_parent"))}async sendApiRequest(e,t,s,i,r,a){try{const a=await Lt.request({url:e,method:t,params:s??{},headers:i??{},data:r??{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof z)return{status:e.networkStatus??400,headers:e.response?.headers,data:e.response?.data}}}share(e,t){null==e&&(e="story-share"),this.storyReader.sharePanel.shareText({shareId:e,config:t,storySlide:this.activeStorySlide})}shareSlideScreenshot(e,t,s){null==e&&(e="slide-screenshot-share"),this.storyReader.sharePanel.shareScreenShot({shareId:e,hideElementsSelector:t??"",shareText:s,storySlide:this.activeStorySlide})}showLayer(e){this.initHookStorySlide?.showLayerByIndex(e)}showCardSlide(e){this.pushToDefferedActionsQueueOrExec((()=>{this.activeStory?.redirectToSlide({slideIndex:e})}))}cardShowNext(){this.storyReader.nextStoryWithAnimation()}showNextSlide(e){this.pushToDefferedActionsQueueOrExec((()=>{e?this.activeStory.timer.start(e):this.activeStory.nextSlide()}))}sendStatisticEvent(e,t,s){this.storyManager.emit("widgetEvent",{name:e,data:{...s,feed:this.storyReader.feedSlug}})}destroy(){}setActiveStory(e){this.activeStoryNarrativeDataCache.clear(),this.activeStory=e,this.activeStorySlide&&this.unlock(this.activeStorySlide)}async resetStory(e){let t={},s=await this.getCardLocalData();s=Object.assign({},this.getCardServerData(e)??{},s);for(let e in s)s.hasOwnProperty(e)&&/^_gm_[A-z0-9-_]+_attempts$/.test(e)&&(t[e]=s[e]);this.activeStorySlide?.refreshWidgetsData(),this.updateCardServerData(e,t),this.setCardLocalData(t,!0),this.showCardSlide(0),this.showLayer(0)}pushToDefferedActionsQueueOrExec(e){this.activeStorySlide?e():this.deferredActionsQueue.push(e)}getCardFonts(){return this.storyManager.rootStore.sessionStore.session.fontsResources}updateTimeline(e,t,s,i,r,a){}showToast(e){this.activeStorySlide?.showToast({content:e})}}class Fs{storyManager;storyReaderViewModel;prevStoryId=-1;prevSlideIndex=-1;constructor(e,t){this.storyManager=e,this.storyReaderViewModel=t}update(e){this.prevStoryId!==e.id&&(fs.emit("publicEvents.showStory",{id:e.id}),this.storyManager.emitEvent(new ks(e))),-1!==this.prevStoryId&&fs.emit(Rs.NextSlide,{fromStoryId:this.prevStoryId,fromSlideIndex:this.prevSlideIndex}),this.storyManager.emitEvent(new Cs(e)),this.prevStoryId=e.id,this.prevSlideIndex=e.activeSlideIndex}reset(){this.prevStoryId=-1,this.prevSlideIndex=-1}}var Ns=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Us=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let zs=(()=>{let e,t=[];return class{static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[_e],Us(this,null,e,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:s},null,t),s&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})}showMultipleStoriesStrategy=Ns(this,t);storyManager;constructor(e,t){this.showMultipleStoriesStrategy=e,this.storyManager=t}async show(e){const t=this.storyManager.rootStore.onboardingFeedStore;await t.fetchOnboardingFeed({feedSlug:e.feed,tags:e.customTags??[],limit:e.limit??void 0});const s=t.getFeedBySlug(e.feed),i=this.getFeedLoadEvent(s.slug,s.stories);return this.emitFeedLoad(i),s.stories.length?(await this.showMultipleStoriesStrategy.show({windowReferer:L.default,listType:Re.ONBOARDING,storyId:s.stories[0].id,feed:s.slug}),i):i}emitFeedLoad(e){this.storyManager.emit("feedLoad",e)}getFeedLoadEvent(e,t){const s={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),{id:e.id,...t}})),feed:null,filter:null};return s.feed=e,s}async reload(e){this.showMultipleStoriesStrategy.reload(e)}}})();class Vs{storyManager;storyReaderViewModel;constructor(e,t){this.storyManager=e,this.storyReaderViewModel=t}async show(e){const t=this.storyManager.rootStore.storyStore,s=this.getStoryFeedByTypeAndSlug(e.listType,e.feed);this.storyReaderViewModel.open({windowReferer:e.windowReferer,id:e.storyId,stories:s.stories.slice()??[]},{listType:e.listType,feedSlug:e.feed,filter:e.filter});const i=(new Date).getTime();await t.fetchStoriesSlidesAndContextByStoryId({storyId:e.storyId,storyFeed:s}),await(async(e,t=300)=>new Promise((s=>{const i=Math.max(0,t-((new Date).getTime()-e));i?setTimeout(s,i):s()})))(i)}async reload(e){const t=this.storyManager.rootStore.storyStore,s=this.getStoryFeedByTypeAndSlug(e.listType,e.feed);await t.fetchStoriesSlidesAndContextByStoryId({storyId:e.storyId,storyFeed:s})}getStoryFeedByTypeAndSlug(e,t){const s=this.storyManager.rootStore.storyFeedStore,i=this.storyManager.rootStore.onboardingFeedStore;return e===Re.ONBOARDING?i.getFeedBySlug(t):s.getFeedBySlug(t)}}class Ws{showStoryStrategy;constructor(e){this.showStoryStrategy=e}async show(e){await this.showStoryStrategy.show({storyId:e.storyId,feed:"",fetchShareUrl:e.fetchShareUrl})}async reload(e){return this.showStoryStrategy.reload(e)}}var Gs=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},$s=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let Hs=(()=>{let e,t=[];return class{static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[_e],$s(this,null,e,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:s},null,t),s&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})}storyManager=Gs(this,t);storyReaderViewModel;constructor(e,t){this.storyManager=e,this.storyReaderViewModel=t}async show(e){try{const t=this.storyManager.rootStore.storyStore,s=await t.fetchStoryAndContextById({storyId:e.storyId,feedSlug:"",once:!0});if(s.error)throw s.error;if(s.isOpened)throw new Ae(e.storyId.toString());this.openStoryReader(s)}catch(e){throw this.storyReaderViewModel.close(),e}}openStoryReader(e){this.storyReaderViewModel.open({windowReferer:L.default,id:e.id,stories:[e]},{feedSlug:"",once:!0})}async reload(e){}}})();var qs=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Qs=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let Ks=(()=>{let e,t=[];return class{static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[_e],Qs(this,null,e,{kind:"method",name:"show",static:!1,private:!1,access:{has:e=>"show"in e,get:e=>e.show},metadata:s},null,t),s&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})}storyManager=qs(this,t);storyReaderViewModel;constructor(e,t){this.storyManager=e,this.storyReaderViewModel=t}async show(e){const t=this.storyManager.rootStore.storyStore,s=await t.fetchStoryAndContextById({storyId:e.storyId,feedSlug:"",fetchShareUrl:e.fetchShareUrl});this.openStoryReader(s,e)}openStoryReader(e,t){this.storyReaderViewModel.open({windowReferer:L.default,id:e.id,stories:[e]},{feedSlug:"",fetchShareUrl:t.fetchShareUrl})}async reload(e){}}})();class Ys{storyManager;storyReaderViewModel;constructor(e,t){this.storyManager=e,this.storyReaderViewModel=t}createShowStory(){return new Ks(this.storyManager,this.storyReaderViewModel)}createShowStoryOnce(){return new Hs(this.storyManager,this.storyReaderViewModel)}createShowStoryFromSharePage(){return new Ws(new Ks(this.storyManager,this.storyReaderViewModel))}createShowOnboardingStories(){return new zs(new Vs(this.storyManager,this.storyReaderViewModel),this.storyManager)}createShowMultipleStories(){return new Vs(this.storyManager,this.storyReaderViewModel)}}var Zs;!function(e){e.HideLayer="hideLayer",e.ShowLayer="showLayer"}(Zs||(Zs={}));class Js extends(s()){onShowLayer;onHideLayer;layersContainer;animationApi;_activeLayer;initialLayer=null;layers=[];constructor(e,t){super(),this.onShowLayer=e,this.onHideLayer=t}init(e,t){this.layersContainer=e,this.animationApi=t,this.layers=Array.from(this.layersContainer.querySelectorAll(".narrative-slide.narrative-multi-slide")),this._activeLayer=this.layers.find((e=>!e.classList.value.includes("hidden"))),this.initialLayer=this._activeLayer}reset(){this.hideAllLayers(),this.initialLayer?.classList.remove("hidden")}get activeLayer(){return this._activeLayer}getLayers(){return this.layers}hideLayer(e){e.classList.contains("hidden")||(this.animationApi.stop(e,!0),e.classList.add("hidden"),this.emit(Zs.HideLayer,{layer:e}),this.onHideLayer?.onHideLayer(e))}showLayer(e){this.onShowLayer?.onShowLayer(e),e.classList.remove("hidden"),this.animationApi.start(e,!0),this._activeLayer=e,this.emit(Zs.ShowLayer,{layer:e})}hideAllLayers(){this.getLayers().forEach((e=>this.hideLayer(e)))}showLayerByIndex(e){const t=this.getLayers();t.forEach((e=>this.hideLayer(e)));const s=t[e];s&&this.showLayer(s)}hasValidMultiSlides(){let e=!0,t=this.layersContainer.querySelectorAll(".narrative-slide.narrative-multi-slide");const s=this.layersContainer.querySelectorAll(".narrative-slide.narrative-multi-slide:not(.hidden)");return t.length>0&&0===s.length&&(e=!1),e}}const Xs=function(){const e={step:1,maxSteps:100};var t=Object.prototype.hasOwnProperty;return function(i,r){r||(r={});var a={};for(var o in e)t.call(r,o)?a[o]=r[o]:a[o]=e[o];var n=Object.prototype.toString.call(i);"[object Array]"!==n&&"[object NodeList]"!==n&&"[object HTMLCollection]"!==n&&(i=[i]);for(var l=0;l<i.length;l++)s(i[l],a)};function s(e,t){if(!i(e)||e.getAttribute("textFitted"))return!1;var s,r,a,o;if(!i(r=e.parentElement))return!1;if(s=function(e){var t=window.getComputedStyle(e,null);return e.getBoundingClientRect().height-parseInt(t.getPropertyValue("padding-top"),10)-parseInt(t.getPropertyValue("padding-bottom"),10)}(r),s<=0)console.warn(`Set a static height and width on the target element ${e.outerHTML} before using textFit!`,e);else{e.setAttribute("textFitted","1");var n=t.step,l=o=parseFloat(window.getComputedStyle(e).fontSize);if(!(l<(a=o-n*t.maxSteps)))for(;l>=a;){if(!(e.getBoundingClientRect().height>s))break;l-=n,e.style.fontSize=l+"px"}}}function i(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}}();var ei;!function(e){e.Playing="playing",e.Waiting="waiting",e.Error="error"}(ei||(ei={}));class ti{videoContext;videoEl;constructor(e,t){this.videoContext=e,this.videoEl=t,this.parseDefaultMuted()}get $video(){return this.videoEl}get muted(){return this.videoEl.muted}get paused(){return this.videoEl.paused}async start(){this.videoEl.pause(),this.videoEl.currentTime=0,await this.play()}async play(){try{const e=this.videoEl.play();e?await e:await new Promise((e=>{setTimeout(e,0)}))}catch(e){throw e}}pause(){this.videoEl.pause()}async resume(){this.videoEl.paused&&await this.videoEl.play()}stop(){this.videoEl.pause(),this.videoEl.currentTime=0}mute(){"1"!==this.videoEl.getAttribute("data-default-muted")&&(this.videoEl.muted=!0)}unmute(){"1"!==this.videoEl.getAttribute("data-default-muted")&&(this.videoEl.muted=!1)}async load(e=!0){return new Promise((t=>{const s=this.videoEl.oncanplaythrough?"canplaythrough":"canplay";this.videoEl.addEventListener(s,(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t()}))}))}),{once:!0}),e&&this.videoEl.load()}))}on(e,t){return this.videoEl.addEventListener(e,t),this}once(e,t){return this.videoEl.addEventListener(e,t,{once:!0}),this}off(e,t){return this.videoEl.removeEventListener(e,t),this}async destroy(){return Promise.resolve()}parseDefaultMuted(){null===this.videoEl.getAttribute("data-default-muted")&&(this.videoEl.muted?this.videoEl.setAttribute("data-default-muted","1"):this.videoEl.setAttribute("data-default-muted","0"))}onPlaying(){}onWaiting(){}}var si=_(3107);class ii{video;timeupdate=Date.now();state=0;playingCheckerTimerId=null;constructor(e){this.video=e,this.handleTimeUpdate=this.handleTimeUpdate.bind(this),this.video.$video.addEventListener("timeupdate",this.handleTimeUpdate)}destroy(){null!=this.playingCheckerTimerId&&window.clearTimeout(this.playingCheckerTimerId),this.video.$video.removeEventListener("timeupdate",this.handleTimeUpdate)}handleTimeUpdate(){this.timeupdate=Date.now(),null!=this.playingCheckerTimerId&&window.clearTimeout(this.playingCheckerTimerId),1!==this.state&&(this.state=1,this.triggerUpdate()),this.scheduleUpdate()}scheduleUpdate(){this.playingCheckerTimerId=window.setTimeout((()=>{Date.now()-this.timeupdate>=150&&(this.state=2,this.triggerUpdate())}),300)}triggerUpdate(){1===this.state?this.video.onPlaying():2===this.state&&this.video.onWaiting()}}class ri extends ti{videoContext;player;_vodData=null;isPlaying=!1;isDataWaiting=!1;attached=!1;videoStateAdapter=null;constructor(e,t){super(e,t),this.videoContext=e,this.handlePlayerError=this.handlePlayerError.bind(this),this._vodData=ri.parseData(t)}get vodData(){return this._vodData}static get isBrowserSupported(){return si.Player.isBrowserSupported()}async load(){try{ri.isBrowserSupported?(this.disableVideoPreload(),await this.initPlayer()):(this.updateVideoSources(),await super.load(),console.error("[VOD]: Browser not supported!"))}catch(e){throw this.stop(),this.detachVideoElement().catch(console.error),e}}async destroy(){this.player.removeEventListener("error",this.handlePlayerError),this.stop(),await this.detachVideoElement(),await this.player.destroy()}static parseData(e){const t=e.getAttribute("data-vod");try{return t&&JSON.parse(t)}catch{return null}}async stop(){this.isPlaying=!1,this.videoStateAdapter?.destroy(),super.stop()}async start(){this.isPlaying||(this.isPlaying=!0,this.videoStateAdapter=new ii(this),await super.start())}async initPlayer(){this.player=new si.Player,this.player.addEventListener("error",this.handlePlayerError),await this.attachVideoElement(),await this.loadVideo()}disableVideoPreload(){this.videoEl.preload="none"}updateVideoSources(){this.videoEl.innerHTML="";for(const e of this.vodData.formats){const t=document.createElement("source");t.src=e.url,t.type=e.mimeType,t.width=e.width,t.height=e.height,this.videoEl.appendChild(t)}}handlePlayerError(e){const t=e.detail,s=`[VOD]: error code ${t.code}; object ${t}`;console.error(s),this.stop(),this.detachVideoElement().catch(console.error).finally((()=>{this.videoContext.emit(ei.Error,t)}))}async attachVideoElement(){this.attached||(await this.player.attach(this.videoEl),this.attached=!0,$("[VOD]: video element attached",this.videoEl))}async loadVideo(){const e=si.Player.convertJsonToUri(this.vodData);await this.player.load(e,0,"application/json"),$(`[VOD]: video ${e} successful loaded`)}async detachVideoElement(){this.attached&&(await this.player.detach(this.videoEl),this.attached=!1,$("[VOD]: video element detached",this.videoEl))}onPlaying(){this.isDataWaiting&&(this.isDataWaiting=!1,this.videoContext.emit(ei.Playing))}onWaiting(){this.isDataWaiting=!0,this.videoContext.emit(ei.Waiting)}}class ai{videoManager;videos=[];constructor(e){this.videoManager=e}async load(e){for(const t of Array.from(e.querySelectorAll("video"))){const e=this.createVideoByElement(t);this.videos.push(e),await e.load()}}async start(){for(const e of this.videos)await e.start()}pause(){for(const e of this.videos)e.pause()}async resume(){for(const e of this.videos)await e.play()}stop(){for(const e of this.videos)e.stop()}static hasVideo(e){return Boolean(e.querySelector(".narrative-slide__with-video"))}mute(){for(const e of this.videos)e.mute()}unmute(){for(const e of this.videos)e.unmute()}async destroy(){for(const e of this.videos)await e.destroy(),this.videos.splice(this.videos.indexOf(e),1);this.videos=[]}createVideoByElement(e){return ri.parseData(e)?new ri(this,e):new ti(this,e)}emit(e,...t){return this.videoManager.emit(e,...t)}}class oi extends(s()){layerManager;videoContexts=new Map;muted=!1;_loaded=!1;constructor(e){super(),this.layerManager=e,this.handleShowLayer=this.handleShowLayer.bind(this),this.handleHideLayer=this.handleHideLayer.bind(this),this.subscribeLayerManager()}get loaded(){return this._loaded}async load(){this._loaded=!1,this.videoContexts.clear();for(const e of this.layerManager.getLayers()){const t=new ai(this);this.videoContexts.set(e,t),await t.load(e)}this._loaded=!0}async start(){const e=this.getActiveVideoContext();await(e?.start())}mute(){this.muted=!0;const e=this.getActiveVideoContext();e?.mute()}unmute(){this.muted=!1;const e=this.getActiveVideoContext();e?.unmute()}async resume(){const e=this.getActiveVideoContext();e?.resume()}pause(){const e=this.getActiveVideoContext();e?.pause()}stop(){for(const e of this.videoContexts.values())e.stop()}async destroy(){this._loaded=!1;for(const e of this.videoContexts.values())await e.destroy();this.videoContexts=new Map,this.unsubscribeLayerManager()}subscribeLayerManager(){this.layerManager.on(Zs.ShowLayer,this.handleShowLayer),this.layerManager.on(Zs.HideLayer,this.handleHideLayer)}unsubscribeLayerManager(){this.layerManager.off(Zs.ShowLayer,this.handleShowLayer),this.layerManager.off(Zs.HideLayer,this.handleHideLayer)}handleShowLayer({layer:e}){this.intheritMuted();const t=this.videoContexts.get(e);t?.start().catch(console.error)}handleHideLayer({layer:e}){const t=this.videoContexts.get(e);t?.stop()}getActiveVideoContext(){const e=this.layerManager.activeLayer;if(e)return this.videoContexts.get(e)}intheritMuted(){this.muted?this.mute():this.unmute()}}class ni extends(s()){videoContainer;videoContext;_loaded=!1;constructor(e){super(),this.videoContainer=e,this.videoContext=new ai(this)}get loaded(){return this._loaded}async load(){this._loaded=!1,await this.videoContext.load(this.videoContainer),this._loaded=!0}async start(){await this.videoContext.start()}pause(){this.videoContext.pause()}async resume(){await this.videoContext.resume()}stop(){this.videoContext.stop()}mute(){this.videoContext.mute()}unmute(){this.videoContext.unmute()}async destroy(){return this._loaded=!1,this.videoContext.destroy()}}class li{constructor(){}static create(e,t){if(!ai.hasVideo(e))return null;return e.querySelectorAll(".narrative-slide.narrative-multi-slide").length>0?new oi(t):new ni(e)}}class di{_widgets=new Map;constructor(){this.refreshUserData=this.refreshUserData.bind(this)}get widgets(){return Array.from(this._widgets.values()).filter((e=>e.isInited))}async init(e){for(const t of this._widgets.values())await t.init(e)}register(e){this._widgets.set(e.getType(),e)}registerMany(e){for(const t of e)this._widgets.set(t.getType(),t)}pause(){for(const e of this._widgets.values())e.pause()}resume(){for(const e of this._widgets.values())e.resume()}findWidgetByType(e){const t=this._widgets.get(e);if(t?.firstElement)return t}stop(){for(const e of this._widgets.values())e.destroy()}handleWidgetClick(e,t){for(const s of this.widgets)if(s.click({target:e,navigationController:t}),t.defaultPrevented)break}destroy(){this.stop()}refreshUserData(){for(const e of this._widgets.values())e.refreshUserData()}}class ci{type;elements;get firstElement(){return this.elements?.item(0)}get isInited(){return Boolean(this.firstElement)}pause(){}resume(){}destroy(){}getActiveElement(){return this.elements?.item(0)}getActiveElements(){return this.elements}refreshUserData(){}getType(){if(!this.type)throw new Error("[StoryWidget]: widget must have a type");return this.type}setUserData(e,t){}}class hi extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="CopyWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-copy");try{this.slideApi.WidgetCopy.initWidget(this.elements)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetCopy.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetCopy.click(e.target),e.navigationController.preventDefault())}}class ui extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="DataInputWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-data-input");try{this.slideApi.WidgetDataInput.initWidget(this.elements)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetDataInput.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetDataInput.click(e.target),e.navigationController.preventDefault())}setUserData(e,t=""){this.slideApi.WidgetDataInput.setUserData(e,t)}}class pi extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="DateCountdownWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-date-countdown");const t=Array.from(e.querySelectorAll(".narrative-slide.narrative-multi-slide"));try{if(!this.elements.length)return;this.slideApi.WidgetDateCountdown.initWidget(this.elements,t)}catch(e){console.error(e)}}pause(){try{if(!this.elements)return;this.slideApi.WidgetDateCountdown.pause(this.elements)}catch(e){console.error(e)}}resume(){try{if(!this.elements)return;this.slideApi.WidgetDateCountdown.resume(this.elements)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetDateCountdown.refreshUserData(this.elements)}click(){}}class gi extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="PollWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-poll");try{if(!this.firstElement)return;this.slideApi.WidgetPoll.initWidget(this.firstElement)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetPoll.refreshUserData(this.elements)}select(e){this.slideApi.WidgetPoll.select(e)}setUserData(e,t=""){this.slideApi.WidgetPoll.setUserData(e,t)}click(e){e.target.classList.contains("narrative-element-poll-button")&&(this.select(e.target),e.navigationController.preventDefault())}}class mi extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="PollLayersWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-poll-layers");const t=e.querySelectorAll(".narrative-slide.narrative-multi-slide");try{if(!this.firstElement)return;this.slideApi.WidgetPollLayers.initWidget(this.firstElement,Array.from(t))}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetPollLayers.refreshUserData(this.elements)}select(e){this.slideApi.WidgetPollLayers.select(e)}click(e){e.target.classList.contains("narrative-element-poll-button")&&(this.select(e.target),e.navigationController.preventDefault())}}class fi extends ci{slideApi;story;constructor(e,t){super(),this.slideApi=e,this.story=t,this.type="QuestWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-quest");try{if(!this.firstElement)return;await this.slideApi.WidgetQuest.initWidget(this.firstElement)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetQuest.refreshUserData(this.elements)}select(e){this.slideApi.WidgetQuest.select(e)}click(e){e.target.classList.contains("narrative-element-test-answer")?this.handleTestAnswer(e):this.handleRouteClick(e)}handleTestAnswer(e){this.select(e.target),e.navigationController.preventDefault()}handleRouteClick(e){e.navigationController.navigationDisabled||(e.navigationController.preventDefault(),this.slideApi.WidgetQuest.handleRouteClick(this.firstElement,{direction:e.navigationController.direction>0?"forward":"backward",slideIndex:this.story.activeSlideIndex,slideCount:this.story.slidesCount,click:()=>{e.navigationController.navigate()}}))}}class yi extends ci{slideApi;story;constructor(e,t){super(),this.slideApi=e,this.story=t,this.type="QuizWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-quiz");try{if(!this.firstElement)return;this.slideApi.WidgetQuiz.initWidget(this.firstElement)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetQuiz.refreshUserData(this.elements)}select(e){this.slideApi.WidgetQuiz.select(e)}slideQuizIsDone(e){return this.slideApi.WidgetQuiz.slideQuizIsDone(e)}click(e){e.target.classList.contains("narrative-element-quiz-next-button")?this.handleNextButton(e):e.target.classList.contains("narrative-element-quiz-answer")?this.handleAnswer(e):this.handleQuizIsDone(e)}handleQuizIsDone(e){this.slideQuizIsDone(this.firstElement)||e.navigationController.disableNextClick()}handleNextButton(e){this.story.nextSlide(),e.navigationController.preventDefault()}handleAnswer(e){this.select(e.target),e.navigationController.preventDefault()}}class vi extends ci{slideApi;story;constructor(e,t){super(),this.slideApi=e,this.story=t,this.type="QuizGroupedWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-quiz-grouped");try{if(!this.firstElement)return;this.slideApi.WidgetQuizGrouped.initWidget(this.firstElement)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetQuizGrouped.refreshUserData(this.elements)}select(e){this.slideApi.WidgetQuizGrouped.select(e)}slideQuizIsDone(e){return this.slideApi.WidgetQuizGrouped.slideQuizIsDone(e)}click(e){e.target.classList.contains("narrative-element-quiz-next-button")?this.handleNextButton(e):e.target.classList.contains("narrative-element-quiz-answer")?this.handleAnswer(e):this.handleQuizIsDone(e)}handleNextButton(e){this.story.nextSlide(),e.navigationController.preventDefault()}handleQuizIsDone(e){this.slideQuizIsDone(this.firstElement)||e.navigationController.disableNextClick()}handleAnswer(e){this.select(e.target),e.navigationController.preventDefault()}}class wi extends ci{slideApi;touchController;slideContent;constructor(e,t){super(),this.slideApi=e,this.touchController=t,this.type="RangeSliderWidget",this.disableSwipeGesture=this.disableSwipeGesture.bind(this),this.enableSwipeGesture=this.enableSwipeGesture.bind(this)}async init(e){this.elements=e.querySelectorAll(".narrative-element-range-slider"),this.slideContent=e;try{if(!this.firstElement)return;this.slideApi.WidgetRangeSlider.initWidget(this.firstElement),this.registerMouseAndTouchEvents()}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetRangeSlider.refreshUserData(this.elements)}click(e){e.target.classList.contains("rangeslider")?this.handleClickSlider(e):e.target.classList.contains("narrative-element-range-slider-next-button")?this.handleClickSliderNextButton(e):this.handleCaptureClick(e)}isClickCapturedBySlider(e){return this.slideApi.WidgetRangeSlider.isClickCapturedBySlider(e)}destroy(){this.unregisterMouseAndTouchEvents()}handleClickSlider(e){e.navigationController.preventDefault()}handleCaptureClick(e){this.isClickCapturedBySlider(this.firstElement)&&e.navigationController.preventDefault()}handleClickSliderNextButton(e){this.slideApi.WidgetRangeSlider.click(e.target),e.navigationController.preventDefault()}disableSwipeGesture(e){this.touchController.disable()}enableSwipeGesture(e){this.touchController.enable()}registerMouseAndTouchEvents(){this.slideContent.addEventListener("mouseup",this.enableSwipeGesture),this.slideContent.addEventListener("touchend",this.enableSwipeGesture),this.slideContent.addEventListener("mousedown",this.disableSwipeGesture),this.slideContent.addEventListener("touchstart",this.disableSwipeGesture)}unregisterMouseAndTouchEvents(){this.slideContent?.removeEventListener("mouseup",this.enableSwipeGesture),this.slideContent?.removeEventListener("touchend",this.enableSwipeGesture),this.slideContent?.removeEventListener("mousedown",this.disableSwipeGesture),this.slideContent?.removeEventListener("touchstart",this.disableSwipeGesture)}}class _i extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="RateWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-rate");try{this.slideApi.WidgetRate.initWidget(this.elements)}catch(e){console.error(e)}}click(e){e.target.classList.contains("narrative-element-rate-input")&&(this.select(e.target),e.navigationController.preventDefault())}refreshUserData(){this.elements&&this.slideApi.WidgetRate.refreshUserData(this.elements)}select(e){this.slideApi.WidgetRate.select(e)}setUserData(e,t=""){this.slideApi.WidgetRate.setUserData(e,t)}}class Si extends ci{slideApi;slideContent;constructor(e){super(),this.slideApi=e,this.type="ShareWidget",this.handleShareComplete=this.handleShareComplete.bind(this)}async init(e){this.elements=e.querySelectorAll(".narrative-element-share"),this.slideContent=e;const t=e.querySelectorAll(".narrative-slide.narrative-multi-slide");try{this.registerEvents(),this.slideApi.WidgetShare.initWidget(this.elements,Array.from(t))}catch(e){console.error(e)}}complete(e,t){this.slideApi.WidgetShare.complete(e,t)}refreshUserData(){this.elements&&this.slideApi.WidgetShare.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetShare.click(e.target),e.navigationController.preventDefault())}destroy(){this.unregisterEvents()}registerEvents(){fs.on(`${Si.name}.shareComplete`,this.handleShareComplete)}unregisterEvents(){fs.off(`${Si.name}.shareComplete`,this.handleShareComplete)}handleShareComplete({shareId:e,result:t}){$(`[Share Widget]: share complete, { shareId, result }: ${e}, ${t}}`),this.complete(e,t)}}class bi extends ci{slideApi;story;constructor(e,t){super(),this.slideApi=e,this.story=t,this.type="TestWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-test");try{if(!this.firstElement)return;this.slideApi.WidgetTest.initWidget(this.firstElement)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetTest.refreshUserData(this.elements)}select(e){this.slideApi.WidgetTest.select(e)}slideTestIsDone(e){return this.slideApi.WidgetTest.slideTestIsDone(e)}slideTestWithTimer(e){return this.slideApi.WidgetTest.slideTestWithTimer(e)}click(e){e.target.classList.contains("narrative-element-test-next-button")?this.handleNextButton(e):e.target.classList.contains("narrative-element-test-answer")?this.handleAnswer(e):this.handleTestIsDone(e)}handleNextButton(e){this.story.nextSlide(),e.navigationController.preventDefault()}handleAnswer(e){this.select(e.target),e.navigationController.preventDefault()}handleTestIsDone(e){const t=this.slideTestIsDone(this.firstElement);!this.slideTestWithTimer(this.firstElement)||t?t||e.navigationController.disableNextClick():e.navigationController.preventDefault()}}class xi extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="VoteWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-vote");try{if(!this.firstElement)return;this.slideApi.WidgetVote.initWidget(this.firstElement);const e="narrative-element-quiz-next-button",t=this.firstElement.querySelector(`.${e}`);t&&t.classList.remove(e)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetVote.refreshUserData(this.elements)}select(e){this.slideApi.WidgetVote.select(e)}click(e){if(e.target.classList.contains("narrative-element-vote-next-button")){if(!this.slideApi.WidgetVote.click(e.target))return void e.navigationController.preventDefault()}e.target.classList.contains("narrative-element-vote-answer")&&(this.slideApi.WidgetVote.select(e.target),e.navigationController.preventDefault())}}class Ci extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="BarcodeWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-element-barcode");try{this.slideApi.WidgetBarcode.initWidget(this.elements)}catch(e){console.error(e)}}refreshUserData(){this.elements&&this.slideApi.WidgetBarcode.refreshUserData(this.elements)}click(e){e.target===this.firstElement&&(this.slideApi.WidgetBarcode.click(e.target),e.navigationController.preventDefault())}}class ki extends ci{slideApi;constructor(e){super(),this.slideApi=e,this.type="MultiSlideWidget"}async init(e){this.elements=e.querySelectorAll(".narrative-slide.narrative-multi-slide");try{if(!this.elements.length)return;this.slideApi.WidgetMultiSlide.init(Array.from(this.elements))}catch(e){console.error(e)}}click(){}destroy(){}}var Mi,Li=_(2743),Oi=_.n(Li);!function(e){e.TouchStart="touchStart",e.TouchMove="touchMove",e.TouchEnd="touchEnd",e.TouchMoveHorizontal="touchMoveHorizontal",e.TouchMoveVertical="touchMoveVertical",e.LongTouchDetected="longTouchDetected"}(Mi||(Mi={}));class Ii{x;y;constructor(e,t){this.x=e,this.y=t}}class Ai{x;y;dx;dy;constructor(e,t,s,i){this.x=e,this.y=t,this.dx=s,this.dy=i}}class Ei extends(s()){$el=null;startPoint=new Ii(0,0);touchStartTimerId=null;enabled=!0;_isSwiping=!1;touched=!1;_horizontalSwipeGesture=!1;_verticalSwipeGesture=!1;_isLongTouch=!1;options={threshold:10,touchStartTimeout:-1};constructor(e){super(),e&&(this.options=Oi()(this.options,e)),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}get isSwiping(){return this._isSwiping}get horizontalSwipeGesture(){return this._horizontalSwipeGesture}get verticalSwipeGesture(){return this._verticalSwipeGesture}enable(){this.enabled=!0}disable(){this.enabled=!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){e.stopPropagation(),this.enabled&&!this.touched&&(this.touched=!0,this.clearTouchStartTimeout(),this.startPoint=this.getPointByEvent(e),this.emit(Mi.TouchStart,new Ai(this.startPoint.x,this.startPoint.y,0,0)),this.startTouchStartTimer(this.startPoint))}handleTouchMove(e){if(!this.touched)return;const t=this.getPointByEvent(e),s=this.getDeltaPoint(t),i=new Ai(t.x,t.y,s.x,s.y);this.isThresholdExceed(s)&&(this._isSwiping=!0),this._isSwiping&&(this.emit(Mi.TouchMove,i),this.determineSwipeGestureDirection(s),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(),e.stopPropagation(),this.clearTouchStartTimeout();const t=this.getPointByEvent(e),s=this.getDeltaPoint(t);this.emit(Mi.TouchEnd,new Ai(t.x,t.y,s.x,s.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(Mi.LongTouchDetected,e)}),this.options.touchStartTimeout))}getPointByEvent(e){if(e instanceof TouchEvent){const t=e.changedTouches[0];return new Ii(t.pageX,t.pageY)}return new Ii(e.pageX,e.pageY)}getDeltaPoint(e){const t=e.x-this.startPoint.x,s=e.y-this.startPoint.y;return new Ii(t,s)}determineSwipeGestureDirection(e){Math.abs(e.x)>Math.abs(e.y)?this._verticalSwipeGesture||(this._horizontalSwipeGesture=!0):this._horizontalSwipeGesture||(this._verticalSwipeGesture=!0)}handleVerticalSwipeGesture(e){this._verticalSwipeGesture&&this.emit(Mi.TouchMoveVertical,e)}handleHorizontalSwipeGesture(e){this._horizontalSwipeGesture&&this.emit(Mi.TouchMoveHorizontal,e)}reset(){this._isSwiping=!1,this.touched=!1,this._isLongTouch=!1,this._horizontalSwipeGesture=!1,this._verticalSwipeGesture=!1}}class Ti{timeout_id;duration;content;position;getMountPoint=()=>document.body;constructor(e){let t;this.timeout_id=null,this.duration=3e3,this.content="",this.position="bottom",e&&"object"==typeof e&&(e.duration&&(this.duration="string"==typeof e.duration?parseFloat(e.duration):e.duration),e.content&&(this.content=e.content),e.getMountPoint&&(this.getMountPoint=e.getMountPoint),e.position&&(t=e.position.toLowerCase(),this.position="top"===t||"bottom"===t?t:"bottom"),this.show())}show(){if(!this.content)return!1;this.timeout_id&&clearTimeout(this.timeout_id);const e=document.getElementById("toast_container");e&&e.parentNode?.removeChild(e);const t=document.createElement("div");t.setAttribute("id","toast_container"),t.setAttribute("class","toast_fadein");const s=document.createElement("div");s.setAttribute("id","toast"),t.appendChild(s);const i=document.createElement("span");return i.innerHTML=this.content,s.appendChild(i),this.getMountPoint().appendChild(t),this.timeout_id=window.setTimeout(this.hide,this.duration),!0}hide(){const e=document.getElementById("toast_container");if(!e)return!1;function t(){const e=document.getElementById("toast_container");if(!e)return!1;e.parentNode?.removeChild(e)}return this.timeout_id&&clearTimeout(this.timeout_id),e.className+=" toast_fadeout",e.addEventListener("webkitAnimationEnd",t),e.addEventListener("animationEnd",t),e.addEventListener("msAnimationEnd",t),e.addEventListener("oAnimationEnd",t),!0}}var Ri=_(2784),Pi=_.n(Ri);class Bi{slider;constructor(e){this.slider=e,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(),s="ltr"===this.slider.dir?1:-1;t.scrollLeft=s*e.x,t.scrollTop=e.y}scrollWithAnimation(e,t){const s=this.slider.getElementRef(),i="ltr"===this.slider.dir?1:-1;s.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()}debouncedTryEndScroll=Pi()((()=>{this.slider.notifyScrollEnd()}),200)}class Di{slider;lastClientX=0;lastClientY=0;pushed=!1;isDragging=!1;isAnimating=!1;constructor(e){this.slider=e,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,Y),e.addEventListener("touchstart",this.handleMouseDown,Y)}scrollTo(e){const t=this.slider.getElementRef(),s="ltr"===this.slider.dir?1:-1;t.scrollLeft=s*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 s=this.slider.getElementRef(),i="ltr"===this.slider.dir?1:-1;s.scrollTo({left:i*e.x,top:e.y,behavior:"smooth"})}stopAnimation(){}destroy(){const e=this.slider.getElementRef();e.removeEventListener("mousedown",this.handleMouseDown,Y),e.removeEventListener("touchstart",this.handleMouseDown,Y),e.removeEventListener("mouseup",this.handleMouseUp,Y),e.removeEventListener("touchend",this.handleMouseUp,Y),e.removeEventListener("mousemove",this.handleMouseMove,Y),e.removeEventListener("touchmove",this.handleMouseMove,Y),e.removeEventListener("scroll",this.handleScroll)}handleMouseDown(e){this.pushed=!0,this.isDragging=!1;const{clientX:t,clientY:s}=this.extractPointerPosition(e);this.lastClientX=t,this.lastClientY=s,window.addEventListener("mouseup",this.handleMouseUp,Y),window.addEventListener("touchend",this.handleMouseUp,Y),window.addEventListener("mousemove",this.handleMouseMove,Y),window.addEventListener("touchmove",this.handleMouseMove,Y)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.slider.notifyScrollEnd(),window.removeEventListener("mouseup",this.handleMouseUp,Y),window.removeEventListener("touchend",this.handleMouseUp,Y),window.removeEventListener("mousemove",this.handleMouseMove,Y),window.removeEventListener("touchmove",this.handleMouseMove,Y))}handleMouseMove(e){if(!this.pushed)return;const{clientX:t,clientY:s}=this.extractPointerPosition(e),i=t-this.lastClientX,r=s-this.lastClientY;this.lastClientX=t,this.lastClientY=s;const{x:a,y:o}=this.slider.preparePosition(this.slider.getCurrentPosition().x-i,this.slider.getCurrentPosition().y-r);!this.isDragging&&(Math.abs(i)>=1||Math.abs(r)>=1)&&(this.isDragging=!0),this.isDragging&&this.scrollTo({x:a,y:o})}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()}debouncedTryAnimationEndScroll=Pi()((()=>{this.isAnimating=!1,this.slider.notifyScrollEnd()}),200);debouncedTryMouseWheelEndScroll=Pi()((()=>{this.slider.notifyScrollEnd()}),200)}var ji;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(ji||(ji={}));class Fi extends t.EventEmitter{scrollStrategy;_isScrolling=!1;slider;currentPosition={x:0,y:0};direction=ji.Horizontal;gap=20;_reachStart=!0;_reachEnd=!0;desktopMode=!0;_dir="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(){return this.slider?.children.length??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 s=this.preparePosition(e,e);this.isTheSamePosition(s.x,s.y)||(t>0?this.scrollStrategy.scrollWithAnimation(s,t):this.scrollStrategy.scrollTo(s))}isHorizontal(){return this.direction===ji.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 s={x:e,y:t};return this.isHorizontal()?s.y=0:s.x=0,this.attractToBounds(s.x,s.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 s=e+this.slider.clientWidth>=Math.max(this.slider.scrollWidth-1,0),i=t+this.slider.clientHeight>=Math.max(this.slider.scrollHeight-1,0);this._reachStart=e<=0&&t<=0,this._reachEnd=this.isHorizontal()?s:i,this.emit("reachStart",this._reachStart),this.emit("reachEnd",this._reachEnd)}setTextDirection(e){this._dir=e}scrollBySlideIndex(e,t){this.isHorizontal()?this.scrollTo(this.slides[e].offsetLeft,t):this.scrollTo(this.slides[e].offsetTop,t)}scrollByDirection(e,t){const{x:s,y:i}=this.getCurrentPosition(),r=this.isHorizontal()?s:i,a=this.getSlidesPerView(),o=this.getStoryWidth(),n=this.getStoryHeight(),l=r+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(){return this.slides[0]?.clientWidth+this.gap}getStoryHeight(){return this.slides[0]?.clientHeight+this.gap}changeScrollStrategy(){this.scrollStrategy&&this.scrollStrategy.destroy(),this.scrollStrategy=this.desktopMode?new Di(this):new Bi(this)}}const Ni=45,Ui=350,zi="linear",Vi=1.6,Wi=2*Math.tan(Ni*Math.PI/360),Gi=Ui/1e3;class $i{slider;newAngle=0;angleDelta=0;normalizedShift=0;movementStartAt=0;_currentAngle=0;constructor(e){this.slider=e}get currentAngle(){return this._currentAngle}get perspective(){return 0}get depth(){return 0}startMove(){this.newAngle=0,this.angleDelta=0,this.normalizedShift=0,this.movementStartAt=Date.now()}move(e){this.normalizedShift=e/this.slider.clientWidth*Vi,this.newAngle=this._currentAngle+this.normalizedShift*Ni,this.angleDelta=this.newAngle-this._currentAngle}endMove(){if(!this.normalizedShift)return;let e=Math.round(this.angleDelta/Ni);e=this.limitByFastMovement(e),e=this.limitBySliderEdges(e),this.slider.emit("touchEnd",e)}limitByFastMovement(e){return this.isFastMovement(e)?this.normalizedShift<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}}const Hi=.05;class qi extends $i{init(){this._currentAngle=this.slider.currentIndex*Ni}transform(e){const t=this.slider.leftElement,s=this.slider.rightElement,i=this.slider.frontElement;t?.style.setProperty("transform",`translateZ(0) translateX(${-100*(.1- -1*e/10)}%) scale(${Math.min(.9+-1*e/10,1)})`),s?.style.setProperty("transform",`translateZ(0) translateX(${100*(1-e)}%)`),i?.style.setProperty("transform",`translateZ(0) translateX(${e<=0?-100*e:-100*(0- -1*e/10)}%) scale(${e<=0?1:1+-1*e/10})`)}move(e){super.move(e),this.normalizedShift=this.applyBoundsConstraint(this.normalizedShift),this.transform(this.normalizedShift)}getCSSStyle(e,t){return{display:Math.abs(e-t)<=1?"block":"none",transition:"inherit",transform:`translateZ(0) translateX(${0===e?-10:-100*t+100*e}%) scale(${0===e?.9:1})`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=Hi&&this.slider.isEnd?Hi:e<=-.05&&this.slider.isBeginning?-.05:e:e}}const Qi=.05;class Ki extends $i{init(){this._currentAngle=this.slider.currentIndex*Ni}transform(e){const t=this.slider.leftElement,s=this.slider.rightElement,i=this.slider.frontElement;t?.style.setProperty("transform",`translateZ(0) translateX(${-100*(1+e)}%)`),s?.style.setProperty("transform",`translateZ(0) translateX(${100*(1-e)}%)`),i?.style.setProperty("transform",`translateZ(0) translateX(${-100*e}%)`)}move(e){super.move(e),this.normalizedShift=this.applyBoundsConstraint(this.normalizedShift),this.transform(this.normalizedShift)}getCSSStyle(e,t){return{display:Math.abs(e-t)<=1?"block":"none",transition:"inherit",transform:`translateZ(0) translateX(${-100*t+100*e}%)`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=Qi&&this.slider.isEnd?Qi:e<=-.05&&this.slider.isBeginning?-.05:e:e}}class Yi extends $i{get perspective(){return this.slider.clientWidth*Vi}get depth(){return this.slider.clientWidth/Wi}init(){this.transform(this.slider.currentIndex)}async transform(e){this._currentAngle=this._currentAngle+e*Ni,this.slider.setTransform(`rotateY(${-this._currentAngle}deg)`)}move(e){super.move(e),this.newAngle=this.applyBoundsConstraint(this.angleDelta),this.slider.setTransform(`rotateY(${-this.newAngle}deg)`)}getCSSStyle(e,t){return{display:Math.abs(e-t)<=1?"block":"none",transition:"",transform:"rotateY("+e*Ni+`deg) translateZ(${this.depth}px)`}}applyBoundsConstraint(e){return this.slider.isBeginning||this.slider.isEnd?e>=5&&this.slider.isEnd?this._currentAngle+5:e<=-5&&this.slider.isBeginning?this._currentAngle-5:this.newAngle:this.newAngle}}class Zi{static create(e,t){switch(t){case b.FLAT:return new Ki(e);case b.COVER:return new qi(e);case b.CUBE:return new Yi(e);default:return new Ki(e)}}}var Ji=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Xi=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let er=(()=>{let e,s,i,r,a,o,n,l,d,c,h,u,p,g,m,f,y,v=t.EventEmitter,w=[],_=[],S=[],b=[],x=[],C=[],k=[];return class extends v{static{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(v[Symbol.metadata]??null):void 0;e=[ve.observable],s=[ve.observable],i=[ve.observable],r=[ve.computed],a=[ve.computed],o=[ve.computed],n=[ve.computed],l=[ve.computed],d=[ve.computed],c=[ve.computed],h=[ve.computed],u=[ve.computed],p=[ve.action],g=[ve.action],m=[ve.action],f=[ve.action],y=[ve.action],Xi(this,null,e,{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:t},_,S),Xi(this,null,s,{kind:"accessor",name:"_currentIndex",static:!1,private:!1,access:{has:e=>"_currentIndex"in e,get:e=>e._currentIndex,set:(e,t)=>{e._currentIndex=t}},metadata:t},b,x),Xi(this,null,i,{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:t},C,k),Xi(this,null,r,{kind:"getter",name:"animating",static:!1,private:!1,access:{has:e=>"animating"in e,get:e=>e.animating},metadata:t},null,w),Xi(this,null,a,{kind:"getter",name:"leftElement",static:!1,private:!1,access:{has:e=>"leftElement"in e,get:e=>e.leftElement},metadata:t},null,w),Xi(this,null,o,{kind:"getter",name:"rightElement",static:!1,private:!1,access:{has:e=>"rightElement"in e,get:e=>e.rightElement},metadata:t},null,w),Xi(this,null,n,{kind:"getter",name:"frontElement",static:!1,private:!1,access:{has:e=>"frontElement"in e,get:e=>e.frontElement},metadata:t},null,w),Xi(this,null,l,{kind:"getter",name:"isBeginning",static:!1,private:!1,access:{has:e=>"isBeginning"in e,get:e=>e.isBeginning},metadata:t},null,w),Xi(this,null,d,{kind:"getter",name:"isEnd",static:!1,private:!1,access:{has:e=>"isEnd"in e,get:e=>e.isEnd},metadata:t},null,w),Xi(this,null,c,{kind:"getter",name:"perspective",static:!1,private:!1,access:{has:e=>"perspective"in e,get:e=>e.perspective},metadata:t},null,w),Xi(this,null,h,{kind:"getter",name:"depth",static:!1,private:!1,access:{has:e=>"depth"in e,get:e=>e.depth},metadata:t},null,w),Xi(this,null,u,{kind:"getter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,get:e=>e.currentIndex},metadata:t},null,w),Xi(this,null,p,{kind:"setter",name:"currentIndex",static:!1,private:!1,access:{has:e=>"currentIndex"in e,set:(e,t)=>{e.currentIndex=t}},metadata:t},null,w),Xi(this,null,g,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:t},null,w),Xi(this,null,m,{kind:"method",name:"transformWithAmimation",static:!1,private:!1,access:{has:e=>"transformWithAmimation"in e,get:e=>e.transformWithAmimation},metadata:t},null,w),Xi(this,null,f,{kind:"method",name:"move",static:!1,private:!1,access:{has:e=>"move"in e,get:e=>e.move},metadata:t},null,w),Xi(this,null,y,{kind:"method",name:"endMove",static:!1,private:!1,access:{has:e=>"endMove"in e,get:e=>e.endMove},metadata:t},null,w),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}#S=(Ji(this,w),Ji(this,_,!1));get _animating(){return this.#S}set _animating(e){this.#S=e}#b=(Ji(this,S),Ji(this,b,0));get _currentIndex(){return this.#b}set _currentIndex(e){this.#b=e}#x=(Ji(this,x),Ji(this,C,null));get effect(){return this.#x}set effect(e){this.#x=e}$el=Ji(this,k);get clientWidth(){return this.$el.clientWidth}get animating(){return this._animating}get leftElement(){return this.$el.children.item(this._currentIndex-1)}get rightElement(){return this.$el.children.item(this._currentIndex+1)}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(){return this.effect?.perspective??0}get depth(){return this.effect?.depth??0}get currentIndex(){return this._currentIndex}set currentIndex(e){this._currentIndex=e}getCSSStyle(e,t){return this.effect?.getCSSStyle(e,t)??{}}init({$el:e,transformStyle:t}){this.$el=e,this.effect=Zi.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 ${Gi}s ${zi}`),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)}updateSlidesStyle(e){const t=Array.from(this.$el.children);for(let s=0;s<t.length;s++){const i=t[s],r=this.effect.getCSSStyle(s,this.currentIndex+e);i.style.display=r.display,i.style.transform=r.transform,i.style.transition=r.transition}}setTransition(e){this.$el.style.setProperty("transition",e)}waitTransitionEnd(){return new Promise((e=>{const t=s=>{Math.round(100*s.elapsedTime)/100===Gi&&"transform"===s.propertyName&&(this.setTransition("transform 0s"),this.$el.removeEventListener("transitionend",t),e())};this.$el.addEventListener("transitionend",t)}))}}})();var tr;!function(e){e.Open="open"}(tr||(tr={}));class sr extends ci{slideApi;touchController;swipeUpGoodsWidgetHandlers;_swipeUpLinkTarget;_swipeUpElementId;slideContent;eventEmitter=new t.EventEmitter;constructor(e,t,s){super(),this.slideApi=e,this.touchController=t,this.swipeUpGoodsWidgetHandlers=s,this.type="SwipeUpGoodsWidget",this.handleSwipeUpGesture=this.handleSwipeUpGesture.bind(this),this.handleClick=this.handleClick.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}get targetUrl(){return decodeURIComponent(this._swipeUpLinkTarget??"")}get elementId(){return this._swipeUpElementId}async init(e){this.slideContent=e,this.elements=e.querySelectorAll(".narrative-element-swipe-up-items"),this.firstElement&&(this._swipeUpLinkTarget=decodeURIComponent(this.firstElement.getAttribute("data-link-target")??""),this._swipeUpElementId=this.firstElement.getAttribute("data-element-id")??void 0,this.registerEvents())}click(e){}destroy(){this.unregisterEvents()}close(){this.touchController?.enable(),this.swipeUpGoodsWidgetHandlers.onClose(),this.setGoodsElementOpacity(1)}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}registerEvents(){this.touchController.on(Mi.TouchEnd,this.handleTouchEnd),this.firstElement?.addEventListener("click",this.handleClick)}unregisterEvents(){this.touchController.off(Mi.TouchEnd,this.handleTouchEnd),this.firstElement?.removeEventListener("click",this.handleClick)}handleClick(e){e.preventDefault(),e.stopPropagation(),this.open()}handleSwipeUpGesture(){this.open()}handleTouchEnd({dy:e}){this.touchController&&e<10&&this.touchController.verticalSwipeGesture&&this.handleSwipeUpGesture()}open(){this._swipeUpLinkTarget&&this.slideContent&&this._swipeUpElementId&&(this.touchController?.disable(),this.swipeUpGoodsWidgetHandlers.onOpen(),this.eventEmitter.emit(tr.Open),this.setGoodsElementOpacity(0))}setGoodsElementOpacity(e){const t=this.slideContent?.querySelector(`[data-element-id="${this._swipeUpElementId}"]`);t&&t.style.setProperty("display",e>0?"block":"none")}}class ir extends ci{slideApi;touchController;linkClickHandler;_swipeUpLinkTarget;_swipeUpElementId;slideContent;constructor(e,t,s){super(),this.slideApi=e,this.touchController=t,this.linkClickHandler=s,this.type=ir.name,this.handleSwipeUpGesture=this.handleSwipeUpGesture.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}get swipeUpLinkTarget(){return this._swipeUpLinkTarget}get swipeUpElementId(){return this._swipeUpElementId}async init(e){this.slideContent=e,this.elements=e.querySelectorAll(".narrative-element-swipe-up"),this.firstElement&&(this._swipeUpLinkTarget=decodeURIComponent(this.firstElement.getAttribute("data-link-target")??""),this._swipeUpElementId=this.firstElement.getAttribute("data-element-id")??void 0,this.touchController?.on(Mi.TouchEnd,this.handleTouchEnd))}click(e){e.target.classList.contains("narrative-element-swipe-up")&&(e.navigationController.preventDefault(),this.linkClickHandler.onLinkClick({widget:this,target:e.target}))}destroy(){this.touchController?.off(Mi.TouchEnd,this.handleTouchEnd)}handleSwipeUpGesture(){if(!this._swipeUpLinkTarget||!this.slideContent||!this._swipeUpElementId)return;const e=this.slideContent.querySelector(`[data-element-id="${this._swipeUpElementId}"]`);e&&this.linkClickHandler.onLinkClick({widget:this,target:e})}handleTouchEnd({dy:e}){this.touchController&&e<10&&this.touchController.verticalSwipeGesture&&this.handleSwipeUpGesture()}}var rr;!function(e){e[e.None=0]="None",e[e.DisableNext=1]="DisableNext",e[e.DisablePrev=2]="DisablePrev"}(rr||(rr={}));class ar{slide;event;geometry;dir;desktopMode;_mode=rr.None;_defaultPrevented=!1;_direction=0;constructor(e,t,s,i,r){this.slide=e,this.event=t,this.geometry=s,this.dir=i,this.desktopMode=r,this._direction=this.calcDirection()}get mode(){return this._mode}get direction(){return this._direction}get defaultPrevented(){return this._defaultPrevented||this.slide.navigationDisabled}get navigationDisabled(){return this.slide.navigationDisabled}preventDefault(){this._defaultPrevented=!0}disableNextClick(){this._mode=rr.DisableNext}navigate(){this.direction<0?this.toPrev():this.mode!==rr.DisableNext&&this.toNext()}toPrev(){"ltr"===this.dir?this.prevSlideOrStory():this.nextSlideOrStory()}toNext(){"ltr"===this.dir?this.nextSlideOrStory():this.prevSlideOrStory()}prevSlideOrStory(){this.slide.story.reachStart?this.slide.story.prevStory():this.slide.story.prevSlide()}nextSlideOrStory(){this.slide.story.reachEnd?this.slide.story.nextStory():this.slide.story.nextSlide()}calcClickPosition(){let e=0,t=0;return this.desktopMode?(e=this.geometry.calculateWidth(),t=this.event.nativeEvent.offsetX):(e=this.geometry.vw,t=this.event.nativeEvent.pageX||this.event.nativeEvent.touches?.[0].pageX),t/e}calcDirection(){return this.calcClickPosition()<=.3?-1:1}}var or;!function(e){e.Idle="idle",e.Init="init",e.StartLoading="startLoading",e.Loading="loading",e.Loaded="loaded",e.Starting="starting",e.Started="started",e.Paused="paused",e.Error="error",e.Destroyed="destroyed"}(or||(or={}));class nr{animationApi;slideElement=null;constructor(e){this.animationApi=e}init(e){this.slideElement=e.querySelector(".narrative-slide")}start(){try{if(!this.slideElement)return;this.animationApi.start(this.slideElement,!0)}catch(e){console.error(e)}}stop(){try{if(!this.slideElement)return;this.animationApi.stop(this.slideElement,!0)}catch(e){console.error(e)}}resume(){this.slideElement&&this.animationApi.resume(this.slideElement)}pause(){this.slideElement&&this.animationApi.pause(this.slideElement)}}var lr=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},dr=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let cr=(()=>{let e,t,s,i,r,a,o,n,l,d,c,h=[],u=[],p=[],g=[],m=[];return class{static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.computed],i=[ve.computed],r=[ve.action],a=[ve.action],o=[ve.action],n=[ve.action],l=[ve.action],d=[ve.action],c=[ve.action],dr(this,null,e,{kind:"accessor",name:"_state",static:!1,private:!1,access:{has:e=>"_state"in e,get:e=>e._state,set:(e,t)=>{e._state=t}},metadata:f},u,p),dr(this,null,t,{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:f},g,m),dr(this,null,s,{kind:"getter",name:"state",static:!1,private:!1,access:{has:e=>"state"in e,get:e=>e.state},metadata:f},null,h),dr(this,null,i,{kind:"getter",name:"muted",static:!1,private:!1,access:{has:e=>"muted"in e,get:e=>e.muted},metadata:f},null,h),dr(this,null,r,{kind:"method",name:"resume",static:!1,private:!1,access:{has:e=>"resume"in e,get:e=>e.resume},metadata:f},null,h),dr(this,null,a,{kind:"method",name:"pause",static:!1,private:!1,access:{has:e=>"pause"in e,get:e=>e.pause},metadata:f},null,h),dr(this,null,o,{kind:"method",name:"mute",static:!1,private:!1,access:{has:e=>"mute"in e,get:e=>e.mute},metadata:f},null,h),dr(this,null,n,{kind:"method",name:"unmute",static:!1,private:!1,access:{has:e=>"unmute"in e,get:e=>e.unmute},metadata:f},null,h),dr(this,null,l,{kind:"method",name:"start",static:!1,private:!1,access:{has:e=>"start"in e,get:e=>e.start},metadata:f},null,h),dr(this,null,d,{kind:"method",name:"stop",static:!1,private:!1,access:{has:e=>"stop"in e,get:e=>e.stop},metadata:f},null,h),dr(this,null,c,{kind:"method",name:"setState",static:!1,private:!1,access:{has:e=>"setState"in e,get:e=>e.setState},metadata:f},null,h),f&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f})}context=lr(this,h);widgetManager;animationApi;layersManager;slideElement;#C=lr(this,u,or.Idle);get _state(){return this.#C}set _state(e){this.#C=e}videoManager=(lr(this,p),null);narrativeAnimationContext;#k=lr(this,g,!1);get _muted(){return this.#k}set _muted(e){this.#k=e}_navigationDisabled=(lr(this,m),!1);slideContent;slideContentInnerHTML;mutex=new Ds.Mutex;constructor(e,t,s,i,r){this.context=e,this.widgetManager=t,this.animationApi=s,this.layersManager=i,this.slideElement=r,this.narrativeAnimationContext=new nr(this.animationApi),this.fitNarrativeTextLines=this.fitNarrativeTextLines.bind(this)}get $el(){return this.slideContent}get widgets(){return this.widgetManager.widgets}get state(){return this._state}get muted(){return this._muted}get navigationDisabled(){return this._navigationDisabled}async resume(){const e=await this.mutex.acquire();try{if(this.state!==or.Paused)return;await(this.videoManager?.resume()),this.narrativeAnimationContext.resume(),this.widgetManager.resume(),this.context.onSlideResume(),this.setState(or.Started),e()}catch(e){console.error(e)}finally{e()}}async pause(){const e=await this.mutex.acquire();try{if(this.state!==or.Started)return;this.videoManager?.pause(),this.narrativeAnimationContext.pause(),this.widgetManager.pause(),this.context.onSlidePause(),this.setState(or.Paused),e()}finally{e()}}mute(){this._muted=!0,this.videoManager?.mute()}unmute(){this._muted=!1,this.videoManager?.unmute()}onClick({target:e,navigationController:t}){Dr.is(e)?this.slideElement.click(e):(this.widgetManager.handleWidgetClick(e,t),t.defaultPrevented||t.navigate())}onClickLinkElement(e){this.slideElement.click(e)}async reload(){const e=await this.mutex.acquire();this.setState(or.Idle),e()}async init(e){const t=await this.mutex.acquire();try{if(this._state!==or.Idle)return;this.setState(or.Init),this.slideContent=e,this.slideContentInnerHTML=this.slideContent.innerHTML,this.parseNavigationDisable(),this.videoManager=this.createVideoManager(),this.narrativeAnimationContext.init(this.slideContent),this.context.onSlideInit(),await this.initLayersAndWidgetManager(e),await(async e=>{let t=0;return new Promise((s=>{const i=()=>{t++,e.getBoundingClientRect().height>0||t>10?s():requestAnimationFrame(i)};i()}))})(this.slideContent),this.fitNarrativeTextLines(),await this.load()}finally{t()}}async start(){const e=await this.mutex.acquire();try{if(this.state===or.Idle||this.state===or.Started)return;this.setState(or.Starting),await(this.videoManager?.start()),await this.context.onSlideStarted(),this.narrativeAnimationContext.start(),this.setState(or.Started)}catch(e){console.error(e),this.setState(or.Error)}finally{e()}}async stop(){const e=await this.mutex.acquire();try{if(this.state!==or.Started&&this.state!==or.Error)return;this.narrativeAnimationContext.stop(),this.widgetManager.stop(),await this.destroyVideoManager(),this.resetSlideContentHTML(),this.context.onSlideStop(),this.setState(or.Idle)}catch(e){console.error(e),this.context.onSlideStop(),this.setState(or.Error)}finally{e()}}findWidgetByType(e){return this.widgetManager.findWidgetByType(e)}refreshWidgetsData(){this.widgetManager.refreshUserData()}showLayerByIndex(e){this.layersManager.showLayerByIndex(e)}async initLayersAndWidgetManager(e){this.layersManager.init(e,this.animationApi),await this.widgetManager.init(this.slideContent),this.layersManager.init(e,this.animationApi)}resetSlideContentHTML(){this.slideContent.innerHTML=this.slideContentInnerHTML}setState(e){this._state=e,this.context.onSlideStateChanged(e)}async load(){if(this.state!==or.Loaded)try{this.context.onSlideLoadStart(),this.setState(or.StartLoading),await this.loadResources(),this.setState(or.Loaded),this.context.onSlideLoadEnd()}catch(e){console.error(e),this.setState(or.Error)}}async loadResources(){return new Promise((async(e,t)=>{let s=setTimeout((()=>{t("[IAM]: Media resources were not loaded")}),1e4);try{await this.loadMediaResources(this.slideContent),await this.loadFonts(),await(this.videoManager?.load()),e()}catch(e){t(e)}finally{clearTimeout(s)}}))}loadFonts(){return new Promise((e=>{"fonts"in document?document.fonts.ready&&document.fonts.ready.catch(e).finally(e):e()}))}loadMediaResources(e){return new Promise(((t,s)=>function(e,t,s){const i=function(e){return new Promise((function(t,s){if("img"===e.tagName.toLowerCase()&&e instanceof HTMLImageElement){const s=()=>{requestAnimationFrame((()=>requestAnimationFrame((()=>{t(e),e.removeEventListener("load",s)}))))};e.addEventListener("load",s),e.complete&&0!==e.naturalHeight&&requestAnimationFrame((function(){requestAnimationFrame((function(){t(e)}))}))}else t(e);e.addEventListener("error",(function(e){var t=e.target instanceof HTMLImageElement;if(e&&e.target&&t&&e.target.style){e.target.style.display="none";var i=e.target.closest(".narrative-element-image");i&&(i.style.display="none")}s(e)}))}))},r=e.querySelectorAll("img,video");let a,o=[];for(a=0;a<r.length;++a)o.push(i(r[a]));o.length,Promise.all(o).then((e=>{t()})).catch(s)}(e,t,s)))}fitNarrativeTextLines(){const e=Array.from(this.slideContent.querySelectorAll(".narrative-element-text-wrapper>.narrative-element-text-lines")).slice();Xs(e,{})}parseNavigationDisable(){const e=this.slideContent.querySelector(".narrative-slide");if(!e)return!1;this._navigationDisabled="1"===e.dataset.disableNavigation}createVideoManager(){const e=li.create(this.slideContent,this.layersManager);return e?(e.on(ei.Playing,this.handleVideoPlaying),e.on(ei.Waiting,this.handleVideoWaiting),e.on(ei.Error,this.handleVideoError),e):null}async destroyVideoManager(){this.videoManager&&(this.videoManager.off(ei.Playing,this.handleVideoPlaying),this.videoManager.off(ei.Waiting,this.handleVideoWaiting),this.videoManager.off(ei.Waiting,this.handleVideoError),await this.videoManager.destroy())}handleVideoPlaying=()=>{this.context.onSlideResume()};handleVideoWaiting=()=>{this.context.onSlidePause()};handleVideoError=async()=>{const e=await this.mutex.acquire();try{if(this.state===or.Idle)return;this.context.onSlideVideoError(),this.setState(or.Error)}catch(e){console.error(e)}finally{e()}}}})();class hr{storyReader;constructor(e){this.storyReader=e}handle(e){this.storyReader.close()}}class ur{storyManager;activeStory;constructor(e,t){this.storyManager=e,this.activeStory=t}handle(e){const t=e.linkTarget;this.emitWidgetLinkEvent(t,e),this.activeStory.markAsOpened(),fs.emit(Rs.TransitionFromSlide,{storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex})}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}})}}class pr extends t.EventEmitter{iframe;origin;constructor(e,t){super(),this.iframe=e,this.origin=t,this.messageListener=this.messageListener.bind(this),window.addEventListener("message",this.messageListener,!1)}messageListener(e){if(e.origin!==this.origin)return;const[t,...s]=e.data;try{if(!Array.isArray(e.data))throw new Error(`Invalid MessageEvent data format ${e.data}`);this.emit(t,...s)}catch(e){console.error(e)}}sendMessage(e,t){this.iframe.contentWindow?.postMessage([e,t],this.origin)}pauseGameUI(){this?.sendMessage("cb",{cb:"pauseUI",arguments:JSON.stringify([])})}resumeGameUI(){this?.sendMessage("cb",{cb:"resumeUI",arguments:JSON.stringify([])})}shareComplete(e,t){this.sendMessage("shareComplete",{id:e,isSuccess:t})}closeGameReader(){this.sendMessage("closeGameReader")}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 gr{userKey;gameInstanceId;instanceUserData;constructor(e,t,s){this.userKey=e,this.gameInstanceId=t,this.instanceUserData=s}set(e){return window.localStorage.setItem(this.key,JSON.stringify(e)),e}get(){let e={};const t=lt()(this.instanceUserData)?this.instanceUserData:{};try{const t=JSON.parse(window.localStorage.getItem(this.key)??"{}");lt()(t)&&(e=t)}catch(e){console.error(e)}return Oi()(e,t)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class mr{gameCenterMessageService;gameReaderViewModel;constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const{id:t,callback:s}=JSON.parse(e),i=this.gameReaderViewModel.gameLaunch;if(!i)return;const r=new gr(i.clientConfig.userKey,i.config.gameInstanceId,i.instanceUserData).get();this.gameCenterMessageService.sendMessage("cb",{cb:s,arguments:JSON.stringify([t,JSON.stringify(r)])})}}class fr{gameCenterMessageService;gameReaderViewModel;constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const{gameInstanceId:t,data:s}=JSON.parse(e),i=this.gameReaderViewModel.gameLaunch;if(!i)return;const r=new gr(i.clientConfig.userKey,i.config.gameInstanceId,i.instanceUserData).set(s);Lt.post(`game/${t}/instance-user-data`,JSON.stringify(r)).catch(console.error)}}var yr=_(3514),vr=_.n(yr);class wr{window;scrollbarHidden=!1;constructor(e){this.window=e}get width(){const e=this.window.document.documentElement.clientWidth;return Math.abs(this.window.innerWidth-e)}setScrollbar(e=this.width){this.scrollbarHidden||(this.disableOverFlow(),this.setBodyContainer(),this.setElementAttributes("body","paddingRight",(t=>t+e)),this.scrollbarHidden=!0)}resetScrollbar(){this.scrollbarHidden&&(this.resetElementAttributes("html","overflow"),this.resetElementAttributes("body","overflow"),this.resetElementAttributes("body","paddingRight"),this.resetBodyContainer(),this.scrollbarHidden=!1)}resetElementAttributes(e,t){this.window.document.querySelectorAll(e).forEach((e=>{const s=e.dataset[t];void 0===s?e.style.removeProperty(t):(delete e.dataset[t],e.style[t]=s)}))}disableOverFlow(){const e=this.window.document,t=e.documentElement.style.overflow,s=e.body.style.overflow;s&&(e.body.dataset.overflow=s),t&&(e.documentElement.dataset.overflow=t),e.body.style.overflow="hidden",e.documentElement.style.overflow="hidden"}setElementAttributes(e,t,s){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 r=e.style[t],a=this.window.getComputedStyle(e)[t];e.dataset[t]=r,e.style[t]=`${s(Number.parseFloat(a))}px`}))}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 _r,Sr,br=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},xr=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};!function(e){e.OpenGame="openGame"}(_r||(_r={})),function(e){e.Close="close",e.OpenSharePanel="openSharePanel"}(Sr||(Sr={}));let Cr=(()=>{let e,t,s,i,r,a,o,n,l,d,c,h,u,p,g,m,f,v,w,_,S,b,x,C,k,M,L=P,O=[],I=[],A=[],E=[],T=[],R=[],B=[],D=[],j=[],F=[],N=[],U=[],z=[],V=[],W=[],G=[],$=[];return class P extends L{static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(L[Symbol.metadata]??null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.observable],r=[ve.observable],a=[ve.observable],o=[ve.observable],n=[ve.observable],l=[ve.computed],d=[ve.computed],c=[ve.computed],h=[ve.computed],u=[ve.computed],p=[ve.computed],g=[ve.computed],m=[ve.computed],f=[ve.computed],v=[ve.action],w=[ve.action],_=[ve.action],S=[ve.action],b=[ve.action],x=[ve.action],C=[ve.action],k=[ve.action],M=[ve.action],xr(this,null,e,{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:y},I,A),xr(this,null,t,{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:y},E,T),xr(this,null,s,{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:y},R,B),xr(this,null,i,{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:y},D,j),xr(this,null,r,{kind:"accessor",name:"_gameLaunch",static:!1,private:!1,access:{has:e=>"_gameLaunch"in e,get:e=>e._gameLaunch,set:(e,t)=>{e._gameLaunch=t}},metadata:y},F,N),xr(this,null,a,{kind:"accessor",name:"_gameLaunchError",static:!1,private:!1,access:{has:e=>"_gameLaunchError"in e,get:e=>e._gameLaunchError,set:(e,t)=>{e._gameLaunchError=t}},metadata:y},U,z),xr(this,null,o,{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:y},V,W),xr(this,null,n,{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:y},G,$),xr(this,null,l,{kind:"getter",name:"closeBtnVisible",static:!1,private:!1,access:{has:e=>"closeBtnVisible"in e,get:e=>e.closeBtnVisible},metadata:y},null,O),xr(this,null,d,{kind:"getter",name:"isGameLoading",static:!1,private:!1,access:{has:e=>"isGameLoading"in e,get:e=>e.isGameLoading},metadata:y},null,O),xr(this,null,c,{kind:"getter",name:"isGameInited",static:!1,private:!1,access:{has:e=>"isGameInited"in e,get:e=>e.isGameInited},metadata:y},null,O),xr(this,null,h,{kind:"getter",name:"gameLaunchError",static:!1,private:!1,access:{has:e=>"gameLaunchError"in e,get:e=>e.gameLaunchError},metadata:y},null,O),xr(this,null,u,{kind:"getter",name:"gameLaunch",static:!1,private:!1,access:{has:e=>"gameLaunch"in e,get:e=>e.gameLaunch},metadata:y},null,O),xr(this,null,p,{kind:"getter",name:"gameInstanceId",static:!1,private:!1,access:{has:e=>"gameInstanceId"in e,get:e=>e.gameInstanceId},metadata:y},null,O),xr(this,null,g,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:y},null,O),xr(this,null,m,{kind:"getter",name:"gameShouldBeShown",static:!1,private:!1,access:{has:e=>"gameShouldBeShown"in e,get:e=>e.gameShouldBeShown},metadata:y},null,O),xr(this,null,f,{kind:"getter",name:"isWidescreen",static:!1,private:!1,access:{has:e=>"isWidescreen"in e,get:e=>e.isWidescreen},metadata:y},null,O),xr(this,null,v,{kind:"method",name:"openGame",static:!1,private:!1,access:{has:e=>"openGame"in e,get:e=>e.openGame},metadata:y},null,O),xr(this,null,w,{kind:"method",name:"closeGame",static:!1,private:!1,access:{has:e=>"closeGame"in e,get:e=>e.closeGame},metadata:y},null,O),xr(this,null,_,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:y},null,O),xr(this,null,S,{kind:"method",name:"setDesktopMode",static:!1,private:!1,access:{has:e=>"setDesktopMode"in e,get:e=>e.setDesktopMode},metadata:y},null,O),xr(this,null,b,{kind:"method",name:"handleGameShouldBeShown",static:!1,private:!1,access:{has:e=>"handleGameShouldBeShown"in e,get:e=>e.handleGameShouldBeShown},metadata:y},null,O),xr(this,null,x,{kind:"method",name:"handleGameLoaded",static:!1,private:!1,access:{has:e=>"handleGameLoaded"in e,get:e=>e.handleGameLoaded},metadata:y},null,O),xr(this,null,C,{kind:"method",name:"handleGameComplete",static:!1,private:!1,access:{has:e=>"handleGameComplete"in e,get:e=>e.handleGameComplete},metadata:y},null,O),xr(this,null,k,{kind:"method",name:"handleReloadGameReader",static:!1,private:!1,access:{has:e=>"handleReloadGameReader"in e,get:e=>e.handleReloadGameReader},metadata:y},null,O),xr(this,null,M,{kind:"method",name:"handleGameLoadFailed",static:!1,private:!1,access:{has:e=>"handleGameLoadFailed"in e,get:e=>e.handleGameLoadFailed},metadata:y},null,O),y&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})}storyManager=br(this,O);gameCenterApi;#d=br(this,I,!1);get _isOpened(){return this.#d}set _isOpened(e){this.#d=e}#M=(br(this,A),br(this,E,!1));get _isGameInited(){return this.#M}set _isGameInited(e){this.#M=e}#L=(br(this,T),br(this,R,!1));get _isGameLoading(){return this.#L}set _isGameLoading(e){this.#L=e}#O=(br(this,B),br(this,D,null));get _gameInstanceId(){return this.#O}set _gameInstanceId(e){this.#O=e}#I=(br(this,j),br(this,F,null));get _gameLaunch(){return this.#I}set _gameLaunch(e){this.#I=e}#A=(br(this,N),br(this,U,null));get _gameLaunchError(){return this.#A}set _gameLaunchError(e){this.#A=e}#E=(br(this,z),br(this,V,!1));get _closeBtnVisible(){return this.#E}set _closeBtnVisible(e){this.#E=e}#T=(br(this,W),br(this,G,!1));get _gameShouldBeShown(){return this.#T}set _gameShouldBeShown(e){this.#T=e}initGameRetryAttempts=(br(this,$),0);gameCenterMessageService=null;safeAreaInsets={top:0,bottom:0,left:0,right:0};openGameOptions={};desktopMode=!0;dir="ltr";scrollbarHelper=new wr(window);constructor(e,t){super(),this.storyManager=e,this.gameCenterApi=t,this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.handleOpenGameCenterEvent=this.handleOpenGameCenterEvent.bind(this),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.storyManager.setViewModel(P.id,this)}static id="GameReaderViewModel";get closeBtnVisible(){return this._closeBtnVisible}get isGameLoading(){return this._isGameLoading}get isGameInited(){return this._isGameInited}get gameLaunchError(){return this._gameLaunchError}get gameLaunch(){return this._gameLaunch}get gameInstanceId(){return this._gameInstanceId}get isOpened(){return this._isOpened}get gameShouldBeShown(){return this._gameShouldBeShown}get isWidescreen(){return this.desktopMode&&(this.gameLaunch?.screenOptions.widescreen??!0)}async openGame(e,t={}){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.setScrollbar()}async closeGame(){return!!this._isOpened&&(this._isGameInited?this.gameCenterMessageService?.closeGameReader():this.handleGameComplete({}),!0)}reload(){this._gameLaunch=null,this.gameInstanceId?this.launchGameById(this.gameInstanceId):console.error("The game instance ID is undefined")}sendGameCenterEventByApiRequest(e,t){this.gameCenterMessageService?.sendGameCenterEventByApiRequest(e,t)}setSafeAreaInsets(e){this.safeAreaInsets=e}setDesktopMode(e){this.desktopMode=e}setGameCenterIframe(e){if(!this._gameLaunch)throw new Error("GameCenter iframe setup error");if(this._isGameInited)return;this.gameCenterMessageService?.destroy();const t=new URL(this._gameLaunch.url).origin;this.gameCenterMessageService=new pr(e,t),this.initGameCenter(this.gameCenterMessageService,this._gameLaunch)}pauseGameUI(){this.gameCenterMessageService?.pauseGameUI()}resumeGameUI(){this.gameCenterMessageService?.resumeGameUI()}confirmSharingComplete({shareId:e,isSuccess:t}){this.gameCenterMessageService?.shareComplete(e,t)}notifyGameCanBeStarted(){this.gameCenterMessageService?.notifyGameCanBeStarted()}destroy(){this.gameCenterMessageService?.destroy(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.storyManager.deleteViewModel(P.id)}async launchGameById(e){try{this._gameLaunchError=null,this._isGameLoading=!0,this._gameLaunch=await this.gameCenterApi.launchGame({gameInstanceId:e,gameOptions:this.openGameOptions})}catch(e){this._gameLaunchError=e}}initGameCenter(e,t){this.handleGameCenterEvents(e);const s=this.getGameConfig(t);this.gameCenterMessageService?.initGame(s)}getGameConfig(e){const t=e.screenOptions;return Oi()(e.config,{clientConfig:{fullScreen:!1,screenOrientation:t.orientation,safeAreaInsets:this.safeAreaInsets,widescreen:this.isWidescreen,dir:this.dir,nonce:K(),sdkFeatures:{gameShouldForegroundCallback:!0},...e.clientConfig}})}handleGameCenterEvents(e){e.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 t={share:new Lr(e,this,this.desktopMode),storySetLocalData:new Ar,storyGetLocalData:new Ir(e,this),gameInstanceGetLocalData:new mr(e,this),gameInstanceSetLocalData:new fr(e,this)};for(const[s,i]of Object.entries(t))e.on(s,((...e)=>i.handle(...e)))}handleGameShouldBeShown(e){this._gameShouldBeShown=!0;const t=JSON.parse(e);lt()(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._gameLaunch=null}startGame(){this.storyManager.emit("startGame",{id:this.gameInstanceId})}handleVisibilityChange(){"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}handleGameComplete(e,t,s,i,r){this.scrollbarHelper.resetScrollbar(),this.completeGame(),this.gameCenterMessageService?.destroy(),this.emitGameCompleteEventByStoryManager(e),r?.id&&this.openGame(r.id,{}),i?.id&&this.storyManager.showStory(i.id),this.emit(Sr.Close)}emitGameCompleteEventByStoryManager(e){vr()(e)?this.storyManager.emit("closeGame",{id:this.gameInstanceId}):this.storyManager.emit("finishGame",{id:this.gameInstanceId,result:e})}async handleSendApiRequest(e){let t,s,i;try{const r=JSON.parse(e);t=r.id,s=r.data,i=r.cb,await Lt.request({url:r.url,method:r.method,params:r.params,data:r.data,headers:r.headers}).catch(console.error),this.sendGameCenterEventByApiRequest(i,JSON.stringify({requestId:t,data:JSON.stringify(s.data),status:s.status,headers:s.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);this.storyManager.clickOnButtonAction({src:y.GAME_READER,payload:{url:t,gameInstanceId:this.gameInstanceId}})}handleGameEvent(e,t){this.storyManager.emit("gameEvent",{name:e,payload:t})}handleReloadGameReader(){const e=this._gameLaunch;this._gameLaunch=null,this._isGameInited=!1,this._isGameLoading=!0,this._gameShouldBeShown=!1,setTimeout((0,ve.action)((()=>{this._gameLaunch=e})))}handleGameLoadFailed(e,t){this.gameLaunch&&t&&this.initGameRetryAttempts<this.gameLaunch.canTryReloadCount?(this.initGameRetryAttempts++,this.handleReloadGameReader()):this._gameLaunchError=new Error(e)}async handleOpenGameCenterEvent({gameId:e}){await this.openGame(e,{})}}})();class kr{storyManager;constructor(e){this.storyManager=e}create(){return new Cr(this.storyManager,new dt(this.storyManager))}}var Mr;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(Mr||(Mr={}));class Lr{gameCenterMessageService;gameReaderViewModel;desktopMode;constructor(e,t,s){this.gameCenterMessageService=e,this.gameReaderViewModel=t,this.desktopMode=s}async handle(e,t){let s=t?.url??t.text,i=[];t.files&&Array.isArray(t.files)&&t.files.length>0&&(i=await Promise.all(t.files.map((e=>(async({file:e,name:t,type:s})=>{const i=await fetch(`data:${s};base64,${e}`),r=await i.blob();return new File([r],t,{type:s,lastModified:(new Date).getTime()})})(e)))));const r={url:s??void 0,files:i.length>0?i:void 0,text:t.text??void 0,title:t.title??void 0};if(!(r.files&&r.files.length>0||r.url))return void this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!1});let a=navigator.share;if(!navigator.share&&window.parent&&window.parent.navigator.share&&(a=window.parent.navigator.share),!this.desktopMode&&a)try{if(!a)return;a(r).then((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!0}))).catch((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!1})))}catch(t){console.error(t),this.openSharePanel({shareConfig:r,sharePath:s,shareId:e})}else this.openSharePanel({shareConfig:r,sharePath:s,shareId:e})}openSharePanel({shareConfig:e,sharePath:t,shareId:s}){let i=Mr.Social,r=t;e.files&&e.files.length>0&&(i=Mr.SlideScreenshot,r=URL.createObjectURL(e.files[0])),this.gameReaderViewModel.emit(Sr.OpenSharePanel,{shareId:s,shareType:i,shareLink:r})}}class Or{storyId;constructor(e){this.storyId=e}set(e){sessionStorage.setItem(this.key,JSON.stringify(e))}get(){const e=sessionStorage.getItem(this.key)??"{}";return window.__activeNarrativeId?JSON.parse(e):{}}get key(){return`narrative_${this.storyId}_data`}}class Ir{gameCenterMessageService;gameReaderViewModel;constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const t=JSON.parse(e);if(!lt()(t))return;const{id:s,storyId:i,callback:r}=t;let a=new Or(i).get();this.gameCenterMessageService.sendMessage("cb",{cb:r,arguments:JSON.stringify([s,JSON.stringify(a)])})}}class Ar{constructor(){}handle(e){const t=JSON.parse(e);if(!lt()(t))return;const{storyId:s,data:i,sendToServer:r}=t;new Or(s).set(i),r&&Lt.request({url:"story-data/"+s,method:"put",data:JSON.stringify(i)}).catch(console.error)}}class Er{storyManager;activeStory;constructor(e,t){this.storyManager=e,this.activeStory=t}async handle(e){try{this.emitWidgetLinkEvent(e.linkTarget,e);const t=this.storyManager.gameReaderViewModel,s=this.storyManager.storyReaderViewModel;await t.openGame(e.linkTarget),s.pauseUI(),t.once(Sr.Close,(()=>{s.resumeUI()}))}catch(e){console.error(e)}}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}})}}class Tr{activeStory;constructor(e){this.activeStory=e}handle(e){this.activeStory.activeSlide.showLayerByIndex(parseInt(e.linkTarget))}}class Rr{activeStory;constructor(e){this.activeStory=e}handle(e){this.activeStory.redirectToSlide({slideIndex:parseInt(e.linkTarget),layerIndex:0})}}class Pr{storyManager;storyReader;activeStory;constructor(e,t,s){this.storyManager=e,this.storyReader=t,this.activeStory=s}async handle(e){const t=parseInt(e.linkTarget);this.emitWidgetLinkEvent(e.linkTarget,e);try{await this.storyReader.showStory(t,"default")}catch(e){console.error(e)}}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,feed:this.storyReader.feedSlug}})}}class Br{storyManager;storyReader;activeStory;constructor(e,t,s){this.storyManager=e,this.storyReader=t,this.activeStory=s}handle(e){try{const t=decodeURIComponent(e.linkTarget);this.emitWidgetLinkEvent(t,e),this.activeStory.markAsOpened(),fs.emit(Rs.TransitionFromSlide,{storyId:this.activeStory.id,slideIndex:this.activeStory.activeSlideIndex}),this.handleClickOnButton({id:this.activeStory.id,index:this.activeStory.activeSlideIndex,url:t,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}})}handleClickOnButton(e){const t=this.storyManager.getConfig().isStatisticsDisabled;e.dataForSending=t?null:{data:this.storyReader.getStatisticsData()};const s=()=>this.storyManager.clickOnButtonAction({src:y.STORY_READER,payload:e});!t&&e.dataForSending&&lt()(e.dataForSending)&&Array.isArray(e.dataForSending.data)&&e.dataForSending.data.length>0?(this.storyReader.cleanupStatisticsData(),Mt("session/update",e.dataForSending,s)):s()}}class Dr{slideElementActionFactory;constructor(e){this.slideElementActionFactory=e}static is(e){return["narrative-element-link","narrative-element-image"].some((t=>e.classList.contains(t)))}click(e){const{elementId:t,linkType:s,linkTarget:i}=this.parseTargetDataset(e);if(!s)return;this.slideElementActionFactory.create(s).handle({target:e,linkTarget:i,linkType:s,elementId:t})}parseTargetDataset(e){const t=e.dataset;return{elementId:t.elementId??"",linkType:t.linkType,linkTarget:t.linkTarget??""}}}class jr{handle(e){console.log(`There is no action handler for <${e.linkType}:${e.linkTarget}>`)}}class Fr{storyManager;storyReader;activeStory;constructor(e,t,s){this.storyManager=e,this.storyReader=t,this.activeStory=s}create(e){switch(e){case"url":return new Br(this.storyManager,this.storyReader,this.activeStory);case"customAction":return new ur(this.storyManager,this.activeStory);case"slide":return new Rr(this.activeStory);case"story":return new Pr(this.storyManager,this.storyReader,this.activeStory);case"game":return new Er(this.storyManager,this.activeStory);case"layer":return new Tr(this.activeStory);case"closeStory":return new hr(this.storyReader);default:return new jr}}}const Nr=.53167701863,Ur=.64516129032;class zr{_vw;_vh;padding;viewportRatio;constructor(e,t,s){this._vw=e,this._vh=t,this.padding=s,this.viewportRatio=e/t}get vw(){return this._vw}get vh(){return this._vh}get vhWitoutPadding(){return this._vh-this.padding.top-this.padding.bottom}getOffset(e){const t=this._vw,s=this.vhWitoutPadding-e,i=this.calculateWidthWithActionPanel(e),r=this.calculateHeightWithActionPanel(e);return this.viewportRatio>Ur?Math.ceil(r-s)/2*-1+"px auto":`0 ${Math.ceil(i-t)/2*-1}px`}getOffsetX(e){const t=this.calculateWidthWithActionPanel(e);return this.viewportRatio>Ur?"0px":Math.ceil(t-this._vw)/2+"px"}getOffsetY(e){const t=this.vhWitoutPadding-e;return this.viewportRatio>Ur?`${Math.ceil(this.calculateHeight()-t)}px`:"0px"}getWidth(){return this.viewportRatio>Ur?`${this.calculateWidth()}px`:"auto"}getHeight(){return this.viewportRatio>Ur?`${this.calculateHeight()}px`:"100%"}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this.vhWitoutPadding*Ur)}calculateHeight(){return Math.ceil(this.calculateWidth()/Ur)}calculateWidthWithActionPanel(e){const t=this.vhWitoutPadding-e;return Math.ceil(t*Ur)}calculateHeightWithActionPanel(e){return Math.ceil(this.calculateWidthWithActionPanel(e)/Ur)}}class Vr{_vw;_vh;padding;viewportRatio;constructor(e,t,s){this._vw=e,this._vh=t,this.padding=s,this.viewportRatio=e/t}get vw(){return this._vw}get vh(){return this._vh}get vhWitoutPadding(){return this._vh-this.padding.top-this.padding.bottom}getOffset(e){const t=this._vw,s=this.vhWitoutPadding-e,i=this.calculateWidthWithActionPanel(e),r=this.calculateHeight();return r>s?Math.ceil(r-s)/2*-1+"px auto":`0 ${Math.ceil(i-t)/2*-1}px`}getOffsetX(e){const t=this.calculateWidthWithActionPanel(e),s=this.vhWitoutPadding-e,i=this.calculateHeight(),r=this._vw;return i>s?"0px":Math.ceil(t-r)/2+"px"}getOffsetY(e){const t=this.vhWitoutPadding-e,s=this.calculateHeight();return s>t?Math.ceil(s-t)/2+"px":"0px"}getWidth(){return this.viewportRatio>Ur?`${this.calculateWidth()}px`:"auto"}getHeight(){return this.viewportRatio>Ur?`${this.calculateHeight()}px`:"100%"}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return this.viewportRatio>Ur?this._vw:Math.ceil(this.vhWitoutPadding*Ur)}calculateHeight(){return Math.ceil(this._vw/Ur)}calculateWidthWithActionPanel(e){const t=this.vhWitoutPadding-e;return this.viewportRatio>Ur?this._vw:Math.ceil(t*Ur)}}class Wr{safeAreaFrameCalculator;constructor(e){this.safeAreaFrameCalculator=e}create(e){const t=e.vw/e.vh;return e.desktopMode&&t>Ur?this.createDesktopStoryGeometry(e):this.createMobileStoryGeometry(e)}createDesktopStoryGeometry(e){return new zr(e.vw,e.vh,{top:50,bottom:50})}createMobileStoryGeometry(e){const{paddingTop:t,paddingBottom:s}=this.safeAreaFrameCalculator.getViewportCorrectionPadding();return new Vr(e.vw,e.vh,{top:parseFloat(t)??0,bottom:parseFloat(s)??0})}}class Gr{_vw;_vh;actionPanelHeight;viewportRatio;constructor(e,t,s){this._vw=e,this._vh=t,this.actionPanelHeight=s,this.viewportRatio=e/t}get shouldBeShownSafeAreaInsets(){return this.viewportRatio<Nr}getViewportCorrectionPadding(){const{paddingTop:e,paddingBottom:t}=this.calcFrameWidthByMobileAspectRatio();return{paddingTop:e+"px",paddingBottom:t+"px"}}calcFrameWidthByMobileAspectRatio(){const e=this._vh-this._vw/Nr,t=Math.max(Math.min(e-this.actionPanelHeight,this.actionPanelHeight),0);return{paddingTop:Math.max(e-t,0),paddingBottom:t}}}class $r extends t.EventEmitter{timerId=null;currentProgress=0;progressBeforePause=0;timerPaused=!1;timeout=0;isCompleted=!0;enabled=!0;rafId=0;get started(){return!this.isCompleted}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("start"),this.setTimer(e)))}stop(){this.isCompleted||(this.clearTimer(),this.emit("stop"),this.isCompleted=!0)}pause(){this.isCompleted||(this.timerPaused=!0,this.clearTimer(),this.progressBeforePause=this.currentProgress,this.emit("pause"))}resume(){if(!this.timerPaused)return;this.timerPaused=!1;const e=1-this.progressBeforePause,t=this.timeout*e;this.setTimer(t),this.emit("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("progress",100),this.emit("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 s=100*this.currentProgress;this.emit("progress",s)}runTimerTicks(e){let t=performance.now();const s=i=>{let r=(i-t)/e;r>1&&(r=1);let a=r;this.updateProgress(a),r<1&&(this.rafId=requestAnimationFrame(s))};this.rafId=requestAnimationFrame(s)}}var Hr,qr;!function(e){e.ShowInputModal="showInputModal"}(Hr||(Hr={})),function(e){e.Start="start",e.ChangeState="changeState"}(qr||(qr={}));class Qr extends P{_story;_index;storySlideRendererFactory;slide;id=Date.now();slideRenderer;constructor(e,t,s,i){super(),this._story=e,this._index=t,this.storySlideRendererFactory=s,this.slide=i,this.slideRenderer=this.storySlideRendererFactory.create({story:e,slide:this})}get $el(){return this.slideRenderer.$el}get state(){return this.slideRenderer.state}get index(){return this._index}get story(){return this._story}get muted(){return this.slideRenderer.muted}get navigationDisabled(){return this.slideRenderer.navigationDisabled}get widgets(){return this.slideRenderer.widgets}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}findWidgetByType(e){return this.slideRenderer.findWidgetByType(e)}refreshWidgetsData(){this.slideRenderer.refreshWidgetsData()}showLayerByIndex(e){this.slideRenderer.showLayerByIndex(e)}async resume(){return this.slideRenderer.resume()}pause(){return this.slideRenderer.pause()}mute(){return this.slideRenderer.mute()}unmute(){return this.slideRenderer.unmute()}async reload(){return this.slideRenderer.reload()}async init(e){return this.slideRenderer.init(e)}async start(){return this.slideRenderer.start()}stop(){return this.slideRenderer.stop()}setUserData(e,t){for(const s of this.widgets)s.setUserData(e,t)}onClick(e,t){this.slideRenderer.onClick({target:e,navigationController:t})}onLinkClick(e){this.slideRenderer.onClickLinkElement(e.target)}showToast(e){new Ti({getMountPoint:()=>this.slideRenderer.$el,...e})}destroy(){return this.stop()}}class Kr extends ci{slideApi;story;constructor(e,t){super(),this.slideApi=e,this.story=t,this.type="StoryRepeat"}async init(e){this.elements=e.querySelectorAll(".narrative-element-story-repeat")}click(e){e.target===this.firstElement&&(this.story.reset().catch(console.error),e.navigationController.preventDefault())}}class Yr{slide;story;slideApiHandlers;constructor(e,t,s){this.slide=e,this.story=t,this.slideApiHandlers=s}async onSlideStarted(){$(`[SLIDE][start]:${this.story.id}:${this.slide.index}`),await this.slideApiHandlers.lock(this.slide),this.slideApiHandlers.exec(),this.story.updateNavigationHistory(),this.startTimer(),this.slide.emit(qr.Start)}onSlideStateChanged(e){this.changeTimelineVisibilityByState(),this.slide.emit(qr.ChangeState,e)}onSlideLoadStart(){$(`[SLIDE][start_load]:${this.story.id}:${this.slide.index}`)}onSlideLoadEnd(){$(`[SLIDE][end_load]:${this.story.id}:${this.slide.index}`)}onSlideResume(){this.story.resume(),$(`[SLIDE][resume]:${this.story.id}:${this.slide.index}`)}onSlidePause(){this.story.pause(),$(`[SLIDE][pause]:${this.story.id}:${this.slide.index}`)}onSlideInit(){this.slideApiHandlers.setInitHookStorySlide(this.slide),$(`[SLIDE][init]:${this.story.id}:${this.slide.index}`)}onSlideStop(){this.story.timer.stop(),this.slideApiHandlers.unlock(this.slide),$(`[SLIDE][stop]:${this.story.id}:${this.slide.index}`)}onSlideVideoError(){this.story.timer.stop()}changeTimelineVisibilityByState(){this.slide.state===or.Error||this.slide.state===or.Loading?this.story.hideTimeline():this.story.showTimeline()}startTimer(){this.story.timer.started||this.story.timer.start(this.slide.duration??0)}}class Zr{storyManager;storyReader;slideApi;slideApiHandlers;touchController;constructor(e,t,s,i,r){this.storyManager=e,this.storyReader=t,this.slideApi=s,this.slideApiHandlers=i,this.touchController=r}create({story:e,slide:t}){const s=new Js(e),i=new di,r=new Dr(new Fr(this.storyManager,this.storyReader,e)),a=new cr(new Yr(t,e,this.slideApiHandlers),i,this.slideApi.Animation,s,r);return this.registerWidgets({widgetManager:i,story:e,slide:t,touchController:this.touchController}),a}registerWidgets({widgetManager:e,story:t,slide:s,touchController:i}){e.registerMany([new Ci(this.slideApi),new hi(this.slideApi),new ui(this.slideApi),new pi(this.slideApi),new ki(this.slideApi),new gi(this.slideApi),new mi(this.slideApi),new fi(this.slideApi,t),new yi(this.slideApi,t),new vi(this.slideApi,t),new wi(this.slideApi,i),new _i(this.slideApi),new Si(this.slideApi),new sr(this.slideApi,i,{onClose:()=>this.storyReader.resumeUI(),onOpen:()=>this.storyReader.pauseUI()}),new ir(this.slideApi,i,s),new xi(this.slideApi),new bi(this.slideApi,t),new Kr(this.slideApi,t)])}}var Jr=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Xr=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let ea=(()=>{let e,t,s,i,r,a,o,n,l,d,c,h,u,p,g,m,f,y,v=P,w=[],_=[],S=[],b=[],x=[],C=[],k=[],M=[],L=[];return class extends v{static{const O="function"==typeof Symbol&&Symbol.metadata?Object.create(v[Symbol.metadata]??null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.observable],r=[ve.computed],a=[ve.computed],o=[ve.computed],n=[ve.computed],l=[ve.computed],d=[ve.computed],c=[ve.action],h=[ve.action],u=[ve.action],p=[ve.action],g=[ve.action],m=[ve.action],f=[ve.action],y=[ve.action],Xr(this,null,e,{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:O},_,S),Xr(this,null,t,{kind:"accessor",name:"_displayedSlides",static:!1,private:!1,access:{has:e=>"_displayedSlides"in e,get:e=>e._displayedSlides,set:(e,t)=>{e._displayedSlides=t}},metadata:O},b,x),Xr(this,null,s,{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:O},C,k),Xr(this,null,i,{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:O},M,L),Xr(this,null,r,{kind:"getter",name:"displayedSlides",static:!1,private:!1,access:{has:e=>"displayedSlides"in e,get:e=>e.displayedSlides},metadata:O},null,w),Xr(this,null,a,{kind:"getter",name:"activeSlideIndex",static:!1,private:!1,access:{has:e=>"activeSlideIndex"in e,get:e=>e.activeSlideIndex},metadata:O},null,w),Xr(this,null,o,{kind:"getter",name:"activeSlide",static:!1,private:!1,access:{has:e=>"activeSlide"in e,get:e=>e.activeSlide},metadata:O},null,w),Xr(this,null,n,{kind:"getter",name:"hiddenTimeline",static:!1,private:!1,access:{has:e=>"hiddenTimeline"in e,get:e=>e.hiddenTimeline},metadata:O},null,w),Xr(this,null,l,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:O},null,w),Xr(this,null,d,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:O},null,w),Xr(this,null,c,{kind:"method",name:"toSlide",static:!1,private:!1,access:{has:e=>"toSlide"in e,get:e=>e.toSlide},metadata:O},null,w),Xr(this,null,h,{kind:"method",name:"setLike",static:!1,private:!1,access:{has:e=>"setLike"in e,get:e=>e.setLike},metadata:O},null,w),Xr(this,null,u,{kind:"method",name:"setDislike",static:!1,private:!1,access:{has:e=>"setDislike"in e,get:e=>e.setDislike},metadata:O},null,w),Xr(this,null,p,{kind:"method",name:"setBookmark",static:!1,private:!1,access:{has:e=>"setBookmark"in e,get:e=>e.setBookmark},metadata:O},null,w),Xr(this,null,g,{kind:"method",name:"share",static:!1,private:!1,access:{has:e=>"share"in e,get:e=>e.share},metadata:O},null,w),Xr(this,null,m,{kind:"method",name:"markAsOpened",static:!1,private:!1,access:{has:e=>"markAsOpened"in e,get:e=>e.markAsOpened},metadata:O},null,w),Xr(this,null,f,{kind:"method",name:"hideTimeline",static:!1,private:!1,access:{has:e=>"hideTimeline"in e,get:e=>e.hideTimeline},metadata:O},null,w),Xr(this,null,y,{kind:"method",name:"showTimeline",static:!1,private:!1,access:{has:e=>"showTimeline"in e,get:e=>e.showTimeline},metadata:O},null,w),O&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:O})}storyManager=Jr(this,w);storyReader;sharePanel;story;slideApiHandlers;navigationHistory;storySlideRendererFactory;#R=Jr(this,_,0);get _activeSlideIndex(){return this.#R}set _activeSlideIndex(e){this.#R=e}#P=(Jr(this,S),Jr(this,b,[]));get _displayedSlides(){return this.#P}set _displayedSlides(e){this.#P=e}#B=(Jr(this,x),Jr(this,C,!1));get _hiddenTimeline(){return this.#B}set _hiddenTimeline(e){this.#B=e}#D=(Jr(this,k),Jr(this,M,[]));get slides(){return this.#D}set slides(e){this.#D=e}_hasShare=(Jr(this,L),!1);_timer=new $r;storySlidesReactionDisposer;constructor(e,t,s,i,r,a,o){super(),this.storyManager=e,this.storyReader=t,this.sharePanel=s,this.story=i,this.slideApiHandlers=r,this.navigationHistory=a,this.storySlideRendererFactory=o,this.redirectToSlide=this.redirectToSlide.bind(this),this.nextSlide=this.nextSlide.bind(this),this._hasShare=Boolean(this.storyManager.rootStore.sessionStore.session?.share),this.createSlidesViewModels(this.story.slides),this.storySlidesReactionDisposer=(0,ve.reaction)((()=>this.story.slides),(e=>this.createSlidesViewModels(e)))}get id(){return this.story.id}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 sourceInfo(){return this.storyReader.sourceInfo}get slidesLoaded(){return this.story.slidesLoaded}get like(){return this.story.like}get favorite(){return this.story.favorite}get hasLike(){return Boolean(this.story.likeFunctional)}get hasShare(){return!!Boolean(this.story.shareFunctional)&&this._hasShare}get hasFavorite(){return Boolean(this.story.favoriteFunctional)}get hasAudio(){return Boolean(this.story.hasAudio)}get context(){return this.story.context}get displayedSlides(){return this._displayedSlides}get activeSlideIndex(){return this._activeSlideIndex}get activeSlide(){return this.slides[this._activeSlideIndex]}get slidesCount(){return this.story.slidesCount}get hiddenTimeline(){return 1===this.story.slides.length&&0===this.story.slides[0].duration||this.story.hideTimeline||this._hiddenTimeline||!this.slidesLoaded}get displayedSlideImage(){return this.isBlank?null:this.story.getImagesPerSlide(this.activeSlideIndex)}get isBlank(){return this.story.id<0}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 timer(){return this._timer}nextSlide(){this.reachEnd||this.toSlide(this.activeSlideIndex+1)}prevSlide(){this.reachStart||this.toSlide(this.activeSlideIndex-1)}toSlide(e){this._activeSlideIndex=e,this._displayedSlides=this.getDisplayedSlides(),this.timer.stop()}updateNavigationHistory(){this.navigationHistory.update(this)}async setLike(e){await this.story.setLike(e),this.storyManager.emitEvent(new Ss(this,{value:1===e}))}async setDislike(e){await this.story.setLike(e),this.storyManager.emitEvent(new ws(this,{value:-1===e}))}async setBookmark(e){try{await this.story.setFavorite(e),this.storyManager.emitEvent(new _s(this,{value:e}))}catch(e){console.error(e)}}async share(){this.activeSlide&&(this.storyManager.emitEvent(new bs(this)),this.activeSlide.screenshotShare?this.sharePanel.shareScreenShot({shareId:"slide-screenshot-share",hideElementsSelector:"",storySlide:this.activeSlide}):await this.performShareText())}markAsOpened(){this.story.markIsOpened()}hideTimeline(){this._hiddenTimeline=!0}showTimeline(){this._hiddenTimeline=!1}setError(e){this.story.setError(e)}reset(){return this.slideApiHandlers.resetStory(this.id)}async reload(){return this.storyReader.reloadStory(this)}redirectToSlide({slideIndex:e,layerIndex:t}){e!==this.activeSlideIndex&&this.toSlide(e)}destroy(){this.storySlidesReactionDisposer(),this.activeSlide?.destroy()}onShowLayer(e){this.timer.start(this.activeSlide.duration??0)}pause(){this.timer.pause()}resume(){this.timer.resume()}enableTimer(){this.timer.enable()}disableTimer(){this.timer.disable()}completeNativeSharing(){this.sharePanel.completeNativeSharing({result:!1})}nextStory(e){this.storyReader.nextStoryWithAnimation(e)}prevStory(e){this.storyReader.prevStoryWithAnimation(e)}async updateNarrativeData(e){return this.story.updateNarrativeData(e)}getDisplayedSlides(){return this.slides.length===this.slidesCount?this.slides.slice(this._activeSlideIndex,this._activeSlideIndex+2):[new Qr(this,0,this.storySlideRendererFactory,st.createEmpty())]}createSlidesViewModels(e){this.slides.length!==this.slidesCount&&(this.slides=e.map(((e,t)=>new Qr(this,t,this.storySlideRendererFactory,e))),this._displayedSlides=this.getDisplayedSlides())}async performShareText(){try{const e=await this.story.fetchStorySharePath();if(!e)return;this.storyManager.emitEvent(new xs(this,{url:e}));const t={title:this.story.title,text:"",url:e};this.sharePanel.shareText({shareId:"story-share",config:t,storySlide:this.activeSlide})}catch(e){console.error(e)}}}})();const ta=async e=>(await fetch(e)).blob(),sa=async e=>{const t=await ta(e);return function(e,t=!0){return new Promise((function(s){var i=new FileReader;i.onloadend=function(){if(t){var e=String(i.result).replace("data:","").replace(/^.+,/,"");s(e)}else s(String(i.result))},i.readAsDataURL(e)}))}(new File([t],"image",{type:t.type,lastModified:(new Date).getTime()}),!1)};function ia(e,t,s,i){var r=e.indexOf(s,t);if(-1===r)return null;for(var a="",o=r+s.length;o<e.length&&-1===i.indexOf(e[o]);o++)a+=e[o];return{foundAtIndex:r,value:a}}function ra(e,t){const s=document.createElementNS("http://www.w3.org/2000/svg",e);for(let e in t)s.setAttributeNS(null,e.replace(/[A-Z]/g,(function(e,t,s,i){return"-"+e.toLowerCase()})),t[e]);return s}var aa,oa;function na(e,t,s,i,r,a,o,n,l,d){var c=ra("svg",{width:String(r),height:String(a),style:"background-color: #fff;"}),h=ra("foreignObject",{x:"0",y:"0",width:"100%",height:"100%"});c.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 s=e[t];s&&s.style&&s.style.setProperty&&s.style.setProperty("display","none")}}h.appendChild(u);var p=[];(function(e){for(var t=[],s=0;;){var i=ia(e,s,"src: url(",[" ",")","\t"]);if(null==i)break;s=i.foundAtIndex+i.value.length,t.push(i.value.replace(/["']/g,""))}return t})(s).forEach((function(e){p.push(new Promise((function(t,i){sa(e).then((function(i){s=s.replace(e,i),t()})).catch((function(e){t()}))})))})),h.querySelectorAll("img").forEach((function(e){e.crossOrigin="Anonymous",p.push(new Promise((function(t,s){sa(e.src).then((function(s){e.onload=s=>e.decode().then((()=>t())),e.onerror=e=>{console.error(e),t()},e.decoding="sync",e.src=s})).catch((function(e){t()}))})))})),h.querySelectorAll("video").forEach((function(e){e.parentNode?.removeChild(e)})),h.querySelectorAll(".narrative-element-video").forEach((function(e){e.classList.add("init")})),Promise.all(p).then((function(){const t=ra("style",{});t.textContent=s,c.appendChild(t);const i=(new XMLSerializer).serializeToString(c),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=r+"px",e.style.height=a+"px",e.width=2*r,e.height=2*a,t.scale(2,2),t.drawImage(h,0,0);const s=e.toDataURL(o,n);ta(s).then((function(t){l(t),e.remove()}))}}),e===aa.IOS?200:void 0)})).catch((e=>{console.log({image:h,encodingError:e},"onDecodeError"),d("error render svg image: "+e)}))},h.onerror=e=>{d("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 la(e,t,s,i){return new Promise((function(r,a){null==i&&(i=""),function(e,t,s,i,r,a){na(e,t,s,i,t.clientWidth,t.clientHeight,"image/jpeg",1,r,a)}(e,t,s,i,(function(e){r(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"}(aa||(aa={})),function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(oa||(oa={}));class da{async getScreenShot({hideElementsSelector:e,slideContent:t}){const s=await la(aa.IOS,t,function(e){let t="";return Array.prototype.slice.call(window.document.styleSheets).forEach((s=>{e(s)&&(t+=Array.prototype.slice.call(s.rules).map((e=>e.cssText)).join(""))})),t}((function(){return!0})),e);return{file:s,url:URL.createObjectURL(s)}}getNavigatorShareFunction(){let e=navigator.share?.bind(navigator);return!e&&window.parent?.navigator.share&&(e=window.parent.navigator.share.bind(window.parent.navigator)),e}getFilteredConfigDto(e){const t={};for(const[s,i]of Object.entries(e??{}))null!==i&&(t[s]=i);return t}}var ca=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},ha=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let ua=(()=>{let e,t,s,i,r,a,o=[],n=[],l=[],d=[],c=[];return class{static{const h="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.computed],i=[ve.computed],r=[ve.action],a=[ve.action],ha(this,null,e,{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:h},n,l),ha(this,null,t,{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:h},d,c),ha(this,null,s,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:h},null,o),ha(this,null,i,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:h},null,o),ha(this,null,r,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:h},null,o),ha(this,null,a,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:h},null,o),h&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:h})}storyReader=ca(this,o);sharingService;nativeSharingId="";nativeSharingRunning=!1;#d=ca(this,n,!1);get _isOpened(){return this.#d}set _isOpened(e){this.#d=e}#j=(ca(this,l),ca(this,d,{id:"",type:oa.Social,link:""}));get _params(){return this.#j}set _params(e){this.#j=e}currentStorySlide=(ca(this,c),null);desktopMode=!1;constructor(e,t){this.storyReader=e,this.sharingService=t}get isOpened(){return this._isOpened}get params(){return this._params}open(e){this.storyReader.pauseTimer(),this._params={link:e.link,type:e.type,text:e.text,id:e.id},this._isOpened=!0}close(){this.storyReader.resumeTimer(),this._isOpened=!1,this._params={id:"",type:oa.Social,link:""}}handleShareComplete(e,t){const s=this.currentStorySlide?.findWidgetByType("ShareWidget");s?.handleShareComplete({shareId:e,result:t}),this.close()}async shareScreenShot({shareId:e,shareText:t,hideElementsSelector:s,storySlide:i}){let r=null;this.currentStorySlide=i;try{const a=await this.sharingService.getScreenShot({hideElementsSelector:s,slideContent:i.$el});r=a.url;const o={files:[a.file],text:t};if(this.desktopMode)return void this.open({type:oa.SlideScreenshot,id:e,link:r,text:t});await this.startNativeSharing(e,o)}catch(s){console.error(s),r&&this.open({type:oa.SlideScreenshot,id:e,link:r,text:t})}}async shareText({shareId:e,config:t,storySlide:s}){this.currentStorySlide=s,null==e&&(e="story-share");const i=this.sharingService.getFilteredConfigDto(t),r=i.url=i.url??i.text,a={type:oa.Social,id:e,link:r};try{if(this.desktopMode)return void this.open(a);await this.startNativeSharing(e,i)}catch(e){this.open(a)}}async startNativeSharing(e,t){const s=this.sharingService.getNavigatorShareFunction();if(!s)throw new Error;try{this.storyReader.pauseTimer(),this.runNativeSharing({id:e}),await s(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.nativeSharingRunning=!1,this.nativeSharingId="",this.storyReader.resumeTimer())}}})();var pa=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},ga=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let ma=(()=>{let e,t,s,i,r,a,o,n,l,d=[],c=[],h=[],u=[],p=[],g=[],m=[];return class{static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.computed],r=[ve.computed],a=[ve.action],o=[ve.action],n=[ve.action],l=[ve.action],ga(this,null,e,{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:f},c,h),ga(this,null,t,{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:f},u,p),ga(this,null,s,{kind:"accessor",name:"_nextFlippingStoryIndex",static:!1,private:!1,access:{has:e=>"_nextFlippingStoryIndex"in e,get:e=>e._nextFlippingStoryIndex,set:(e,t)=>{e._nextFlippingStoryIndex=t}},metadata:f},g,m),ga(this,null,i,{kind:"getter",name:"reachStart",static:!1,private:!1,access:{has:e=>"reachStart"in e,get:e=>e.reachStart},metadata:f},null,d),ga(this,null,r,{kind:"getter",name:"reachEnd",static:!1,private:!1,access:{has:e=>"reachEnd"in e,get:e=>e.reachEnd},metadata:f},null,d),ga(this,null,a,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:f},null,d),ga(this,null,o,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:f},null,d),ga(this,null,n,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:f},null,d),ga(this,null,l,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:f},null,d),f&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f})}storyManager=pa(this,d);storyReaderViewModel;slideApiHandlers;#F=pa(this,c,null);get _activeStory(){return this.#F}set _activeStory(e){this.#F=e}#b=(pa(this,h),pa(this,u,1));get _currentIndex(){return this.#b}set _currentIndex(e){this.#b=e}#N=(pa(this,p),pa(this,g,-1));get _nextFlippingStoryIndex(){return this.#N}set _nextFlippingStoryIndex(e){this.#N=e}animatedTransitionAdapter=(pa(this,m),null);constructor(e,t,s){this.storyManager=e,this.storyReaderViewModel=t,this.slideApiHandlers=s}get reachStart(){return 1===this._currentIndex}get reachEnd(){return this._currentIndex===this.storyReaderViewModel.stories.length-2}get nextFlippingStoryIndex(){return this._nextFlippingStoryIndex}get activeStory(){return this._activeStory}get currentIndex(){return this._currentIndex}setAnimatedTransitionAdapter(e){this.animatedTransitionAdapter=e}nextStory(){this.reachEnd||(this.activeStory?.markAsOpened(),this.setActiveStoryByIndex(this._currentIndex+1),this.fetchStoriesSlidesAndContextByNextStoryIndex(this._currentIndex-1))}prevStory(){this.reachStart||(this.activeStory?.markAsOpened(),this.setActiveStoryByIndex(this._currentIndex-1),this.fetchStoriesSlidesAndContextByNextStoryIndex(this._currentIndex-1))}nextStoryWithAnimation(e){this.storyReaderViewModel.reachEnd?this.handleStoryReaderReachEnd(e):this.navigateStoryWithAnimation(this.storyReaderViewModel.currentIndex+1,e)}prevStoryWithAnimation(e){this.reachStart||this.navigateStoryWithAnimation(this.currentIndex-1,e)}destroy(){this._activeStory=null}setActiveStoryById(e){const t=this.storyReaderViewModel.stories;this._currentIndex=t.findIndex((t=>t.id===e)),this._activeStory=t[this._currentIndex],this.slideApiHandlers.setActiveStory(this._activeStory)}resetActiveStory(){this._activeStory=null}navigateStoryWithAnimation(e,t="lastSlideClick"){this._nextFlippingStoryIndex=e;const s=this.storyReaderViewModel.stories[e];this.slideApiHandlers.setActiveStory(s),this.handleNextFlippingStoryIndexChange(e,t)}handleStoryReaderReachEnd(e){"auto"!==e?this.storyReaderViewModel.close("lastSlideClick"):this.animatedTransitionAdapter?.options.closeOnLastSlideByTimer&&this.storyReaderViewModel.close("auto")}async handleNextFlippingStoryIndexChange(e,t){if(-1===e)return;const s=this.currentIndex<e?1:-1;await(this.animatedTransitionAdapter?.transitionByDirection(s)),this.handleStoryFlippingTransitionEnd(e,t)}handleStoryFlippingTransitionEnd(e,t){this.storyReaderViewModel.emitCloseStoryEvent(t);1===(this.currentIndex<e?1:-1)?this.nextStory():this.prevStory(),this._nextFlippingStoryIndex=-1}setActiveStoryByIndex(e){this._currentIndex=e,this._activeStory=this.storyReaderViewModel.stories[this._currentIndex],this.slideApiHandlers.setActiveStory(this._activeStory),this.handleActiveStoryError(this._activeStory)}handleActiveStoryError(e){e.error&&this.storyManager.emit("showStoryFailed",{id:e.id,title:e.title,...e.error})}async fetchStoriesSlidesAndContextByNextStoryIndex(e){const t=this.getStoryFeedByTypeAndSlug(this.storyReaderViewModel.sourceInfo.listType,this.storyReaderViewModel.sourceInfo.feedSlug);await this.storyManager.rootStore.storyStore.fetchStoriesSlidesAndContextByNextStoryIndex({nextStoryIndex:e,storyFeed:t})}getStoryFeedByTypeAndSlug(e,t){const s=this.storyManager.rootStore.storyFeedStore,i=this.storyManager.rootStore.onboardingFeedStore;return e===Re.ONBOARDING?i.getFeedBySlug(t):s.getFeedBySlug(t)}}})();var fa,ya,va=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},wa=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};!function(e){e.RedirectToStory="redirectToStory",e.CloseStory="closeStory",e.ShowMultipleStories="showMultipleStories",e.ReloadStory="reloadStory"}(fa||(fa={})),function(e){e.Close="closeStoryReader"}(ya||(ya={}));let _a=(()=>{let e,t,s,i,r,a,o,n,l,d,c,h,u,p,g,m=P,f=[],y=[],v=[],w=[],_=[],S=[],b=[],x=[],C=[],k=[],M=[];return class O extends m{static{const L="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.observable],r=[ve.observable],a=[ve.computed],o=[ve.computed],n=[ve.action],l=[ve.action],d=[ve.action],c=[ve.action],h=[ve.action],u=[ve.action],p=[ve.action],g=[ve.action],wa(this,null,e,{kind:"accessor",name:"_uiPaused",static:!1,private:!1,access:{has:e=>"_uiPaused"in e,get:e=>e._uiPaused,set:(e,t)=>{e._uiPaused=t}},metadata:L},y,v),wa(this,null,t,{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:L},w,_),wa(this,null,s,{kind:"accessor",name:"_timerPaused",static:!1,private:!1,access:{has:e=>"_timerPaused"in e,get:e=>e._timerPaused,set:(e,t)=>{e._timerPaused=t}},metadata:L},S,b),wa(this,null,i,{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:L},x,C),wa(this,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:L},k,M),wa(this,null,a,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:L},null,f),wa(this,null,o,{kind:"getter",name:"isOpened",static:!1,private:!1,access:{has:e=>"isOpened"in e,get:e=>e.isOpened},metadata:L},null,f),wa(this,null,n,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:L},null,f),wa(this,null,l,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:L},null,f),wa(this,null,d,{kind:"method",name:"reloadStory",static:!1,private:!1,access:{has:e=>"reloadStory"in e,get:e=>e.reloadStory},metadata:L},null,f),wa(this,null,c,{kind:"method",name:"nextStory",static:!1,private:!1,access:{has:e=>"nextStory"in e,get:e=>e.nextStory},metadata:L},null,f),wa(this,null,h,{kind:"method",name:"prevStory",static:!1,private:!1,access:{has:e=>"prevStory"in e,get:e=>e.prevStory},metadata:L},null,f),wa(this,null,u,{kind:"method",name:"nextStoryWithAnimation",static:!1,private:!1,access:{has:e=>"nextStoryWithAnimation"in e,get:e=>e.nextStoryWithAnimation},metadata:L},null,f),wa(this,null,p,{kind:"method",name:"prevStoryWithAnimation",static:!1,private:!1,access:{has:e=>"prevStoryWithAnimation"in e,get:e=>e.prevStoryWithAnimation},metadata:L},null,f),wa(this,null,g,{kind:"method",name:"navigateStoryWithAnimationByIndex",static:!1,private:!1,access:{has:e=>"navigateStoryWithAnimationByIndex"in e,get:e=>e.navigateStoryWithAnimationByIndex},metadata:L},null,f),L&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:L})}storyManager=va(this,f);statisticsService;storiesApi;#U=va(this,y,!1);get _uiPaused(){return this.#U}set _uiPaused(e){this.#U=e}#k=(va(this,v),va(this,w,!0));get _muted(){return this.#k}set _muted(e){this.#k=e}#z=(va(this,_),va(this,S,!1));get _timerPaused(){return this.#z}set _timerPaused(e){this.#z=e}#V=(va(this,b),va(this,x,!1));get _closeGestureInAction(){return this.#V}set _closeGestureInAction(e){this.#V=e}#W=(va(this,C),va(this,k,ve.observable.map()));get _stories(){return this.#W}set _stories(e){this.#W=e}_uiLocked=(va(this,M),!1);scrollbarHelper=new wr(window);_sourceInfo={listType:Re.DEFAULT,feedSlug:""};slideApi;slideApiHandlers=null;windowReferer=L.default;currentStoryDisplayStrategy=null;navigationHistory;storyDisplayStrategyFactory;_touchController=new Ei({touchStartTimeout:200});narrativeDataCache=new Ms;_sharePanelViewModel=new ua(this,new da);navigationController;static id="StoryReaderViewModel";constructor(e,t,s){super(),this.storyManager=e,this.statisticsService=t,this.storiesApi=s,this.navigationHistory=new Fs(this.storyManager,this),this.handleWindowUnload=this.handleWindowUnload.bind(this),this.handleEscKeydown=this.handleEscKeydown.bind(this),e.setViewModel(O.id,this),window.addEventListener("beforeunload",this.handleWindowUnload),this.storyDisplayStrategyFactory=new Ys(e,this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this);const i=this.initSlideApi();this.navigationController=new ma(this.storyManager,this,i)}get nextFlippingStoryIndex(){return this.navigationController.nextFlippingStoryIndex}get sharePanel(){return this._sharePanelViewModel}get touchController(){return this._touchController}get feedSlug(){return this.sourceInfo.feedSlug??""}get sourceInfo(){return this._sourceInfo}get muted(){return this._muted}get uiPaused(){return this._uiPaused}get timerPaused(){return this._timerPaused}get closeGestureInAction(){return this._closeGestureInAction}get stories(){return Array.from(this._stories.values())}get activeStory(){return this.navigationController.activeStory}get isOpened(){return Boolean(this.navigationController.activeStory)}get currentIndex(){return this.navigationController.currentIndex}get reachStart(){return this.navigationController.reachStart}get reachEnd(){return this.navigationController.reachEnd}getStatisticsData(){return this.statisticsService.getData()}cleanupStatisticsData(){return this.statisticsService.cleanupData()}open(e,t){this.resetReaderToDefaultState(),this.updateSlideApiRef(),this.windowReferer=e.windowReferer,this.setScrollBar(e.windowReferer),this._sourceInfo=t,this.setStories(e.stories),this.navigationController.setActiveStoryById(e.id),this.statisticsService.init(t),this.storyManager.getConfig().enableStatistic(),this._touchController.init(document.body),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("keydown",this.handleEscKeydown)}close(e="closeReaderByCloseBtn"){this.activeStory&&!this.activeStory?.disableClose&&(this.resetScrollBar(this.windowReferer),this.emit(ya.Close),this.sourceInfo.listType===Re.DEFAULT&&fs.emit(ya.Close,{id:this.activeStory.id}),this.emitCloseStoryEvent(e),this.resetReaderToDefaultState(),this._sourceInfo={listType:Re.DEFAULT,feedSlug:""},this.navigationController.destroy())}emitCloseStoryEvent(e){this.activeStory&&this.storyManager.emitEvent(new vs(this.activeStory,{action:e}))}canBeClosed(){return!(!this.activeStory||this.activeStory.isBlank)&&!this.activeStory.disableClose}async showStory(e,t){this.currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStory(),await this.currentStoryDisplayStrategy.show({storyId:e,feed:t})}async showStoryOnce(e){this.currentStoryDisplayStrategy=this.storyDisplayStrategyFactory.createShowStoryOnce(),await this.currentStoryDisplayStrategy.show({storyId:e})}async showStoryFromSharePage(e,t){try{const s=this.storyDisplayStrategyFactory.createShowStoryFromSharePage();return this.currentStoryDisplayStrategy=s,await s.show({storyId:e,fetchShareUrl:t}),t&&this.storyManager.getConfig().disableStatistic(),!0}catch(e){return!1}}async showOnboardingStories(e){const t=this.storyDisplayStrategyFactory.createShowOnboardingStories();return this.currentStoryDisplayStrategy=t,t.show({feed:e?.feed??"",customTags:e?.customTags,limit:e?.limit})}async showMultipleStories(e){const t=this.storyDisplayStrategyFactory.createShowMultipleStories();this.currentStoryDisplayStrategy=t,await t.show({storyId:e.storyId,listType:e.listType??Re.DEFAULT,windowReferer:e.windowReferer??L.default,feed:e.feed,filter:e.filter})}async reloadStory(e){e.setError(null),this.currentStoryDisplayStrategy?.reload({storyId:e.id,listType:this.sourceInfo.listType,feed:this.sourceInfo.feedSlug})}nextStory(){return this.navigationController.nextStory()}prevStory(){return this.navigationController.prevStory()}nextStoryWithAnimation(e){return this.navigationController.nextStoryWithAnimation(e)}prevStoryWithAnimation(e){return this.navigationController.prevStoryWithAnimation(e)}navigateStoryWithAnimationByIndex(e,t){this.navigationController.navigateStoryWithAnimation(e,t)}destroy(){this.removeAllListeners(),window.removeEventListener("beforeunload",this.handleWindowUnload),this.storyManager.deleteViewModel(O.id)}closeGoodsWidget(){fs.emit("goodsWidget.close")}enableStoryTimer(){this._stories.forEach((e=>e.enableTimer()))}disableStoryTimer(){this._stories.forEach((e=>e.disableTimer()))}setAnimatedTransitionAdapter(e){this.navigationController.setAnimatedTransitionAdapter(e)}updateSlideApiRef(){(0,ms.getSlideApi)(this.slideApiHandlers)}resumeTimer(){this._uiLocked=!1,this._timerPaused=!1}pauseTimer(){this._uiLocked=!0,this._timerPaused=!0}pauseUI(){this._uiPaused=!0,this.pauseTimer()}resumeUI(){this._uiPaused=!1,this.resumeTimer()}mute(){this._muted=!0}unmute(){this._muted=!1}enableCloseGesture(){this._closeGestureInAction=!0}disableCloseGesture(){this._closeGestureInAction=!1}setStories(e){let t=e.filter((e=>!e.hideInReader));const s=new at({id:-1},this.storyManager.rootStore,this.storiesApi),i=new at({id:-2},this.storyManager.rootStore,this.storiesApi);t=[s,...t,i];const r=new Zr(this.storyManager,this,this.slideApi,this.slideApiHandlers,this._touchController);for(const e of t)this._stories.set(e.id,new ea(this.storyManager,this,this._sharePanelViewModel,e,this.slideApiHandlers,this.navigationHistory,r))}initSlideApi(){return this.slideApiHandlers=new js(this.narrativeDataCache,this.storyManager,this),this.slideApi=(0,ms.getSlideApi)(this.slideApiHandlers),this.slideApiHandlers}handleVisibilityChange(){"hidden"===document.visibilityState&&this.pauseTimerByVisibility(),"visible"===document.visibilityState&&this.resumeTimerByVisibility()}resumeTimerByVisibility(){this._uiLocked||(this._timerPaused=!1)}pauseTimerByVisibility(){this._uiLocked||(this._timerPaused=!0)}handleEscKeydown(e){27===e.keyCode&&this.close("closeReaderByEscBtn")}resetReaderToDefaultState(){if(this.isOpened){if(this.activeStory){const e=this.activeStory.id,t=this.activeStory.activeSlideIndex;fs.emit(Rs.CloseStoryReader,{storyId:e,slideIndex:t}),this.activeStory.markAsOpened()}this.resumeUI(),this.sharePanel.close(),this.navigationHistory.reset(),this.statisticsService.destroy(),this.clearStoryViewModels(),this._touchController.destroy(),document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("keydown",this.handleEscKeydown),this.navigationController.resetActiveStory()}}clearStoryViewModels(){for(const e of this._stories.values())e.destroy();this._stories=ve.observable.map()}setScrollBar(e){e===L.default&&this.scrollbarHelper.setScrollbar()}resetScrollBar(e){e===L.default&&this.scrollbarHelper.resetScrollbar()}handleWindowUnload(e){this.activeStory&&(fs.emit(Rs.NextSlide,{fromStoryId:this.activeStory.id,fromSlideIndex:this.activeStory.activeSlideIndex}),this.statisticsService.sendData())}}})();class Sa{storyManager;constructor(e){this.storyManager=e}create(){const e=new Bs(this.storyManager),t=new Ps(this.storyManager,e);return new _a(this.storyManager,t,new Qe(this.storyManager))}}class ba{animatedSlider;options;constructor(e,t){this.animatedSlider=e,this.options=t}transitionByDirection(e){return this.animatedSlider.transformWithAmimation(e)}}class xa{narrativeDataCache;storyManager;iamReader;deferredActionsQueue=new Ls;activeMessageNarrativeDataCache=new Ms;activeMessageSlide=null;activeMessage=null;constructor(e,t,s){this.narrativeDataCache=e,this.storyManager=t,this.iamReader=s}lock(e){if(this.activeMessageSlide&&this.activeMessageSlide!==e)throw new Error(`[SlideApi]: The resource is locked by message with ID ${this.activeMessage?.id}`);this.activeMessageSlide=e}unlock(e){this.activeMessageSlide===e&&(this.activeMessageSlide=null)}exec(){this.activeMessageSlide&&(this.deferredActionsQueue.exec(),this.deferredActionsQueue.flush())}async getCardLocalData(){if(!this.activeMessage)return{};let e=this.narrativeDataCache.get(`iam_${this.activeMessage.id}_data_${this.storyManager.rootStore.sessionStore.userId}`);return e?JSON.parse(e):{}}setCardLocalData(e,t){if(!this.activeMessage)return;let s=JSON.stringify(e);this.narrativeDataCache.set(`iam_${this.activeMessage.id}_data_${this.storyManager.rootStore.sessionStore.userId}`,s),t&&this.activeMessage.updateUserData(s).catch(console.error)}getCardServerData(e){return this.activeMessage.context.widgetsData._narrative_saved_data?.[e]??null}updateCardServerData(e,t){this.activeMessage.context.widgetsData._narrative_saved_data=t}getSlideDuration(e,t){return this.activeMessage.context.widgetsData._narrative_slides_duration?.[e]?.[t]??null}pauseUI(){this.activeMessageSlide?.pause()}resumeUI(){this.activeMessageSlide?.resume()}showCardTextInput(e,t){}setCardSessionValue(e,t){this.activeMessageNarrativeDataCache.set(e,t)}getCardSessionValue(e){return this.activeMessageNarrativeDataCache.get(e)}getWidgetsSharedData(e,t){const s=this.activeMessage.context.widgetsData;switch(t){case"rangeSlider":return s._narrative_range_slider_data?.[e];case"poll":return s._narrative_poll_data?.[e];case"vote":return s._narrative_vote_data?.[e]}return null}openUrl(e){window.open(e,"_parent")}async sendApiRequest(e,t,s,i,r,a){try{const a=await Lt.request({url:e,method:t,params:s??{},headers:i??{},data:r??{}});return{status:a.status,headers:a.headers,data:a.data}}catch(e){if(e instanceof z)return{status:e.networkStatus??400,headers:e.response?.headers,data:e.response?.data}}}share(e,t){}shareSlideScreenshot(e,t,s){}showLayer(e){this.activeMessageSlide?.showLayerByIndex(e)}showCardSlide(e){}cardShowNext(){}showNextSlide(e){}sendStatisticEvent(e,t,s){let i=null;switch(e){case"w-copy":i=new Qt(s.widget_id,s.widget_value,s.widget_label);break;case"w-share":i=new Jt(s.widget_id,s.widget_answer,s.widget_label,s.widget_value,s.widget_answer_label);break;case"w-rate-answer":i=new Zt(s.widget_id,s.widget_answer,s.widget_label,s.widget_value);break;case"w-range-slider-answer":i=new Yt(s.widget_id,s.widget_answer,s.widget_label)}i&&(this.activeMessage.trackWidgetEvent(i),this.iamReader.emitWidgetEvent(i))}destroy(){}setActiveMessage(e){this.activeMessageNarrativeDataCache.clear(),this.activeMessage=e,this.activeMessageSlide&&this.unlock(this.activeMessageSlide)}async resetCard(e){}pushToDefferedActionsQueueOrExec(e){this.activeMessageSlide?e():this.deferredActionsQueue.push(e)}getCardFonts(){return this.storyManager.rootStore.sessionStore.session?.fontsResources??[]}updateTimeline(e,t,s,i,r,a){}showToast(e){this.activeMessageSlide?.showToast({content:e})}}class Ca{_vw;_vh;constructor(e,t){this._vw=e,this._vh=t}get contentRatio(){return 9/16}getWidth(){return this._vw}getHeight(){return this._vh}}class ka{_vw;_vh;_contentRatio;desktopMode;constructor(e,t,s,i){this._vw=e,this._vh=t,this._contentRatio=s,this.desktopMode=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 Ma{_vw;_vh;_contentRatio;desktopMode;constructor(e,t,s,i){this._vw=e,this._vh=t,this._contentRatio=s,this.desktopMode=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 La{create(e,t){switch(e){case hs.BottomSheet:return new ka(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case hs.Modal:return new Ma(t.vw,t.vh,t.appearanceOptions.contentRatio,t.desktopMode);case hs.Fullscreen:return new Ca(t.vw,t.vh)}}}class Oa{_vw;_vh;_contentRatio;constructor(e,t,s){this._vw=e,this._vh=t,this._contentRatio=s}get contentRatio(){return this._contentRatio}getOffset(){const e=this.calculateHeight();return-(Math.ceil(e-this._vh)/2)+"px 0px"}getOffsetX(){return"0px"}getOffsetY(){const e=this.calculateHeight();return`${Math.ceil(e-this._vh)/2}px`}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}class Ia{_vw;_vh;_contentRatio;constructor(e,t,s){this._vw=e,this._vh=t,this._contentRatio=s}get contentRatio(){return this._contentRatio}get vw(){return this._vw}get vh(){return this._vh}getOffset(){const e=this.calculateWidth();return`0px ${-(Math.ceil(e-this._vw)/2)}px`}getOffsetX(){const e=this.calculateWidth();return`${Math.ceil(e-this._vw)/2}px`}getOffsetY(){return"0px"}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this._vh*this._contentRatio)}calculateHeight(){return this._vh}}class Aa{}class Ea extends Aa{_vw;_vh;_contentRatio;constructor(e,t,s){super(),this._vw=e,this._vh=t,this._contentRatio=s}get contentRatio(){return this._contentRatio}getOffset(){const e=this.calculateHeight();return-(Math.ceil(e-this._vh)/2)+"px 0px"}getOffsetX(){return"0px"}getOffsetY(){const e=this.calculateHeight();return`${Math.ceil(e-this._vh)/2}px`}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return this._vw}calculateHeight(){return Math.ceil(this._vw/this._contentRatio)}}class Ta extends Aa{_vw;_vh;_contentRatio;constructor(e,t,s){super(),this._vw=e,this._vh=t,this._contentRatio=s}get contentRatio(){return this._contentRatio}getOffset(){const e=this.calculateWidth();return`0px ${Math.ceil(this._vw-e)/2}px`}getOffsetX(){const e=this.calculateWidth();return`${Math.ceil(this._vw-e)/2}px`}getOffsetY(){return"0px"}getWidth(){return`${this.calculateWidth()}px`}getHeight(){return`${this.calculateHeight()}px`}getFontSize(){return this.calculateWidth()/20+"px"}calculateWidth(){return Math.ceil(this.calculateHeight()*this._contentRatio)}calculateHeight(){return this._vh}}class Ra{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 Ca}createWideOrSquareGeometry(e){return e.viewportRatio>e.contentRatio?new Oa(e.vw,e.vh,e.contentRatio):new Ia(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 Ta(e.vw,e.vh,e.contentRatio):new Ea(e.vw,e.vh,e.contentRatio)}}class Pa{slide;_mode=rr.None;_defaultPrevented=!1;_direction=0;constructor(e){this.slide=e,this._direction=this.calcDirection()}get mode(){return this._mode}get direction(){return this._direction}get defaultPrevented(){return this._defaultPrevented||this.slide.navigationDisabled}get navigationDisabled(){return!1}preventDefault(){this._defaultPrevented=!0}disableNextClick(){this._mode=rr.DisableNext}navigate(){this.direction<0?this.toPrev():this.mode!==rr.DisableNext&&this.toNext()}toPrev(){}toNext(){}calcClickPosition(){return.3}calcDirection(){return this.calcClickPosition()<=.3?-1:1}}var Ba=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Da=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let ja=(()=>{let e,t=P,s=[];return class extends t{static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;e=[ve.computed],Da(this,null,e,{kind:"getter",name:"isLoading",static:!1,private:!1,access:{has:e=>"isLoading"in e,get:e=>e.isLoading},metadata:i},null,s),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}message=Ba(this,s);iamMessageSlide;messageSlideRendererFactory;slideRenderer;locked=!1;constructor(e,t,s){super(),this.message=e,this.iamMessageSlide=t,this.messageSlideRendererFactory=s,this.slideRenderer=this.messageSlideRendererFactory.create({slide:this,message:this.message}),this.handleDocumentVisibilityChange=this.handleDocumentVisibilityChange.bind(this)}get isLoading(){return this.slideRenderer.state===or.Loading}get html(){return this.iamMessageSlide.html}get navigationDisabled(){return this.slideRenderer.navigationDisabled}async init(e){return this.slideRenderer.init(e)}async start(){return document.addEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.slideRenderer.start()}async reload(){return this.slideRenderer.reload()}stop(){return document.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.slideRenderer.stop()}pause(){return this.slideRenderer.pause()}resume(){return this.slideRenderer.resume()}pauseAndLock(){return this.locked=!0,this.pause()}resumeAndUnlock(){return this.locked=!1,this.resume()}mute(){this.slideRenderer.mute()}unmute(){this.slideRenderer.unmute()}onClick(e){const t=new Pa(this);this.slideRenderer.onClick({target:e,navigationController:t})}onLinkClick(e){this.slideRenderer.onClickLinkElement(e.target)}showLayerByIndex(e){this.slideRenderer.showLayerByIndex(e)}destroy(){return this.slideRenderer.stop()}showToast(e){new Ti({getMountPoint:()=>this.slideRenderer.$el,...e})}handleDocumentVisibilityChange(){this.locked||("hidden"===document.visibilityState&&this.pause(),"visible"===document.visibilityState&&this.resume())}}})();class Fa extends P{iamReader;iamMessage;_slides=[];_openTime=0;constructor(e,t,s){super(),this.iamReader=e,this.iamMessage=t,this._slides=this.iamMessage.slides.map((e=>new ja(this,e,s)))}get id(){return this.iamMessage.id}get activeSlideIndex(){return this.iamMessage.activeSlideIndex}get openTime(){return this._openTime}get slides(){return this._slides}get context(){return this.iamMessage.context}get appearanceOptions(){return this.iamMessage.appearanceOptions}get type(){return this.iamMessage.type}async trackOpen(){await this.iamMessage.trackOpen()}async trackClose(){await this.iamMessage.trackClose()}async trackWidgetEvent(e){await this.iamMessage.trackWidgetEvent(e)}async updateUserData(e){return this.iamMessage.updateUserData(e)}toPublicDto(){return this.iamMessage.toPublicDto()}destroy(){}}class Na{iamReader;constructor(e){this.iamReader=e}handle(e){this.iamReader.close()}}class Ua{storyManager;iamMessage;messageSlide;constructor(e,t,s){this.storyManager=e,this.iamMessage=t,this.messageSlide=s}async handle(e){this.iamMessage.trackWidgetEvent(new Kt(e.elementId,e.linkTarget,""));try{await this.storyManager.openGame(e.linkTarget),this.messageSlide.pauseAndLock(),this.storyManager.gameReaderViewModel?.once(Sr.Close,(()=>{this.messageSlide.resumeAndUnlock()}))}catch(e){console.error(e)}}}class za{iamReader;storyManager;iamMessage;constructor(e,t,s){this.iamReader=e,this.storyManager=t,this.iamMessage=s}handle(e){const t=decodeURIComponent(e.linkTarget);this.emitWidgetEvent(t,e.elementId),this.emitClickOnButtonEvent(t,e.elementId)}emitWidgetEvent(e,t){const s=new Kt(t,e,"");this.iamMessage.trackWidgetEvent(s),this.iamReader.emitWidgetEvent(s)}emitClickOnButtonEvent(e,t){const s=this.getClickOnButtonEventPayload(e,t);this.iamReader.emit(Qa.ClickOnButton,s),this.storyManager.clickOnButtonAction({src:y.IAM_READER,payload:s})}getClickOnButtonEventPayload(e,t){return{id:this.iamMessage.id,index:this.iamMessage.activeSlideIndex,url:e,elementId:t}}}class Va{iamReader;storyManager;messageSlide;constructor(e,t,s){this.iamReader=e,this.storyManager=t,this.messageSlide=s}async handle(e){const t=parseInt(e.linkTarget);try{await this.storyManager.showStory(t),this.messageSlide.pauseAndLock(),this.storyManager.storyReaderViewModel.once(ya.Close,(()=>{this.iamReader.updateSlideApiRef(),this.messageSlide.resumeAndUnlock()}))}catch(e){console.error(e)}}}class Wa{handle(e){console.log(`There is no action handler for <${e.linkType}:${e.linkTarget}>`)}}class Ga{storyManager;iamReader;message;messageSlide;constructor(e,t,s,i){this.storyManager=e,this.iamReader=t,this.message=s,this.messageSlide=i}create(e){switch(e){case"url":return new za(this.iamReader,this.storyManager,this.message);case"story":return new Va(this.iamReader,this.storyManager,this.messageSlide);case"game":return new Ua(this.storyManager,this.message,this.messageSlide);case"closeIAM":return new Na(this.iamReader)}return new Wa}}class $a{slide;story;slideApiHandlers;constructor(e,t,s){this.slide=e,this.story=t,this.slideApiHandlers=s}async onSlideStarted(){this.slideApiHandlers.lock(this.slide),this.slideApiHandlers.exec()}onSlideStop(){this.slideApiHandlers.unlock(this.slide)}onSlideStateChanged(e){}onSlideLoadStart(){}onSlideLoadEnd(){}onSlideResume(){}onSlidePause(){}onSlideInit(){}onSlideVideoError(){}}class Ha{storyManager;iamReader;slideApi;slideApiHandlers;touchController;constructor(e,t,s,i,r){this.storyManager=e,this.iamReader=t,this.slideApi=s,this.slideApiHandlers=i,this.touchController=r}create({slide:e,message:t}){const s=new Js,i=new di,r=new Dr(new Ga(this.storyManager,this.iamReader,t,e)),a=new cr(new $a(e,t,this.slideApiHandlers),i,this.slideApi.Animation,s,r);return this.registerWidgets({widgetManager:i,slideApi:this.slideApi,message:t,slide:e}),a}registerWidgets({widgetManager:e,slideApi:t,message:s,slide:i}){e.registerMany([new Ci(t),new hi(t),new ui(t),new pi(t),new ki(t),new gi(t),new mi(t),new wi(t,this.touchController),new _i(t),new Si(t),new ir(t,this.touchController,i),new xi(t)])}}class qa extends Error{constructor(e){super(`[IAM]: you must close IAM with ID ${e}`),this.name="IamMessageOpenError"}}var Qa,Ka=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Ya=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};!function(e){e.Loaded="loaded",e.Close="close",e.WidgetEvent="widgetEvent",e.ClickOnButton="clickOnButton"}(Qa||(Qa={}));let Za=(()=>{let e,t,s,i,r=P,a=[],o=[],n=[];return class l extends r{static{const l="function"==typeof Symbol&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;e=[ve.observable],t=[ve.action],s=[ve.action],i=[ve.action],Ya(this,null,e,{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:l},o,n),Ya(this,null,t,{kind:"method",name:"showMessageById",static:!1,private:!1,access:{has:e=>"showMessageById"in e,get:e=>e.showMessageById},metadata:l},null,a),Ya(this,null,s,{kind:"method",name:"showMessageByEvent",static:!1,private:!1,access:{has:e=>"showMessageByEvent"in e,get:e=>e.showMessageByEvent},metadata:l},null,a),Ya(this,null,i,{kind:"method",name:"close",static:!1,private:!1,access:{has:e=>"close"in e,get:e=>e.close},metadata:l},null,a),l&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:l})}storyManager=Ka(this,a);iamStore;iamDisplayService;#G=Ka(this,o,null);get _activeMessage(){return this.#G}set _activeMessage(e){this.#G=e}visibilityObserver=Ka(this,n);slideApiHandlers;slideApi;_touchController=new Ei;narrativeDataCache=new Ms;scrollbarHelper=new wr(window);eventPublisher;constructor(e,t,s){super(),this.storyManager=e,this.iamStore=t,this.iamDisplayService=s,this.storyManager.setViewModel(l.id,this),this.visibilityObserver=new gs(this),this.handleStoryReaderClose=this.handleStoryReaderClose.bind(this),this.initSlideApi()}static id="IamReaderViewModel";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(){await this.storyManager.waitStoryManagerConfig();return await this.iamStore.preload()}async showMessageById(e,t){await this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const s=await this.iamDisplayService.getMessageById(e,t);return await this.open(s),s}async showMessageByEvent(e,t){await this.storyManager.waitStoryManagerConfig(),this.checkMessageNotOpened();const s=await this.iamDisplayService.getMessageByEvent(e,t);return await this.open(s),s}async close(){if(!this._activeMessage)return;this.emitCloseEvent(this._activeMessage),this.clearActiveMessage(),this.visibilityObserver.unsubscribe(),this.touchController.destroy(),this.scrollbarHelper.resetScrollbar();const e=await this.storyManager.waitViewModel(_a.id);e?.off(ya.Close,this.handleStoryReaderClose)}async open(e){this.updateSlideApiRef(),e.updatePlaceholders(this.storyManager.rootStore.placeholderStore.placeholders),this.touchController.init(document.body),this.setActiveMessage(e),this.visibilityObserver.subscribe(),this.scrollbarHelper.setScrollbar();const t=await this.storyManager.waitViewModel(_a.id);t?.on(ya.Close,this.handleStoryReaderClose)}destroy(){this.storyManager.deleteViewModel(l.id)}emitWidgetEvent(e){this.emit(Qa.WidgetEvent,{message:this.activeMessage.toPublicDto(),name:e.type,data:e.toJSON()})}updateSlideApiRef(){(0,ms.getSlideApi)(this.slideApiHandlers)}setEventPublisher(e){this.eventPublisher=e}emit(e,...t){return super.emit(e,...t),this.eventPublisher.emit(e,...t)}emitCloseEvent(e){this.emit(Qa.Close,{message:e.toPublicDto()})}initSlideApi(){this.slideApiHandlers=new xa(this.narrativeDataCache,this.storyManager,this),this.slideApi=(0,ms.getSlideApi)(this.slideApiHandlers)}setActiveMessage(e){const t=this.createIamMessageViewModel(e);this.slideApiHandlers.setActiveMessage(t),t.trackOpen(),this._activeMessage=t}clearActiveMessage(){this._activeMessage&&(this._activeMessage.trackClose(),this._activeMessage=null)}createIamMessageViewModel(e){const t=new Ha(this.storyManager,this,this.slideApi,this.slideApiHandlers,this.touchController);return new Fa(this,e,t)}checkMessageNotOpened(){if(this.activeMessage)throw new qa(this.activeMessage.id)}handleStoryReaderClose(){this.updateSlideApiRef()}}})();class Ja{iamReader;eventEmitter=new(s());constructor(e){this.iamReader=e,this.iamReader.setEventPublisher(this.eventEmitter)}get activeMessage(){return this.iamReader.activeMessage?.toPublicDto()}get isLoaded(){return this.iamReader.isLoaded}get isLoading(){return this.iamReader.isLoading}get isOpened(){return this.iamReader.isOpened}async preload(){const e=(await this.iamReader.preload()).map((e=>e.toPublicDto()));return this.eventEmitter.emit(Qa.Loaded,{messages:e}),e}async showMessageById(e,t){return(await this.iamReader.showMessageById(e,t)).toPublicDto()}async showMessageByEvent(e,t){return(await this.iamReader.showMessageByEvent(e,t)).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 Xa{storyFeed;story;id;title;titleColor;hasAudio;hasSwipeUp;isOpened;deeplink;gameInstanceId;hideInReader=!1;hideTimeline=!1;constructor(e,t){this.storyFeed=t,this.id=e.id,this.title=e.title,this.titleColor=e.titleColor,this.hasAudio=e.hasAudio??!1,this.hasSwipeUp=e.hasSwipeUp??!1,this.isOpened=e.isOpened,this.deeplink=e.deeplink??void 0,this.gameInstanceId=e.gameInstance?.id??void 0,this.hideInReader=e.hideInReader??!1,this.hideTimeline=e.hideTimeline,this.isOpened=e.isOpened,this.story=e}getCover(e){return{imageSrc:this.story.image?.findOneByCoverQuality(e)?.url,videoSrc:this.story.videoCoverSrc??void 0,backgroundColor:this.story.backgroundColor,feedCoverSrc:this.storyFeed?.coverSrc}}}var eo=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},to=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let so=(()=>{let e,t,s=P,i=[],r=[],a=[];return class extends s{static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;e=[ve.observable],t=[ve.computed],to(this,null,e,{kind:"accessor",name:"topStory",static:!1,private:!1,access:{has:e=>"topStory"in e,get:e=>e.topStory,set:(e,t)=>{e.topStory=t}},metadata:o},r,a),to(this,null,t,{kind:"getter",name:"top",static:!1,private:!1,access:{has:e=>"top"in e,get:e=>e.top},metadata:o},null,i),o&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})}storyManager=eo(this,i);options;storyModels=[];unreadedStoryModels=new Map;storiesReactionDisposer;feed;#$=eo(this,r,null);get topStory(){return this.#$}set topStory(e){this.#$=e}_activeIndex=(eo(this,a),-1);constructor(e,t={feed:"default"}){super(),this.storyManager=e,this.options=t,this.storiesReactionDisposer=(0,ve.reaction)((()=>this.storyManager.rootStore.storyFeedStore.getFeedBySlug(this.options.feed)?.stories),(e=>{e&&this.handleStoriesChange(e)})),this.feed=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(this.options.feed)??void 0}get stories(){return this.storyModels.map((e=>this.createStackFeedStoryByModel(e)))}get length(){return this.storyModels.length}get activeIndex(){return this._activeIndex}get feedCoverSrc(){return this.feed?.coverSrc}get top(){return this.topStory}reload(){this.storyModels=[],this.unreadedStoryModels=new Map}destroy(){this.storiesReactionDisposer(),this.emit("destroy")}markStoryAsOpened(e){this.unreadedStoryModels.delete(e),this.resetUnreadedStories(),this.update()}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()}createStackFeedStoryByModel(e){return new Xa(e,this.feed)}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=this.createStackFeedStoryByModel(e),this.onUpdateTopStory(this.topStory),this.emit("update",this.topStory)}}})();class io extends so{feedCoverageAnalyticsCalculator=new So;firstStoryShown=!1;_id;constructor(e,t){super(e,t),this._id=(0,F.v4)(),this.handleShowStory=this.handleShowStory.bind(this),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.handleEventBusEvents=this.handleEventBusEvents.bind(this),this.subscribeToStoryReader(),this.subscribeToFeedCoverageAnalytics(),this.storyManager.setViewModel(this._id,this)}async reload(){return this.firstStoryShown=!1,super.reload(),this.loadStories()}destroy(){const e=this.storyManager.storyReaderViewModel;e?.off("showStory",this.handleShowStory),e?.off(ya.Close,this.handleCloseStoryReader),fs.off("openGame",this.handleShowStory),fs.off("clickOnStoryDeepLink",this.handleShowStory),this.feedCoverageAnalyticsCalculator.destroy(),super.destroy(),this.storyManager.deleteViewModel(this._id)}showStory(e){const t=an.instance,s=J()(e.deeplink)&&e.deeplink.trim().length>0,i=e.gameInstanceId;if(!e.hideInReader||s||i){if(s&&null!==e.deeplink){const s={index:0,id:e.id,story:e,isDeeplink:!0,url:e.deeplink};return t.clickOnButtonAction({src:y.STACK_STORY_LIST,payload:s}),void this.markStoryAsOpened(e.id)}if(i)return t.openGame(i).catch(console.error),void this.markStoryAsOpened(e.id);this.storyManager.storyReaderViewModel?.showMultipleStories({storyId:e.id,listType:Re.DEFAULT,windowReferer:L.stacked,feed:this.options.feed}),this.markStoryAsOpened(e.id)}else console.error("[StackedStoryList]: Cannot open hidden story id "+e.id)}handleCloseStoryReader(){this.top&&this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(this.top.id)}markStoryAsOpened(e){this.storyManager.rootStore.storyStore.findStoryById(e).markIsOpened(),this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(e),super.markStoryAsOpened(e)}onUpdateTopStory(e){this.firstStoryShown||(this.firstStoryShown=!0,this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(e.id))}async subscribeToStoryReader(){try{const e=this.storyManager.storyReaderViewModel;fs.on("openGame",this.handleEventBusEvents),fs.on("clickOnStoryDeepLink",this.handleEventBusEvents),e?.on("showStory",this.handleShowStory),e?.on(ya.Close,this.handleCloseStoryReader)}catch(e){console.error("[StackedStoryList]: error while story reader init")}}handleShowStory({id:e}){this.markStoryAsOpened(e)}handleEventBusEvents({id:e}){this.markStoryAsOpened(e)}async loadStories(){try{this.emit("startLoad"),await this.storyManager.rootStore.storyFeedStore.fetchDefaultFeed({feedSlug:this.options.feed}),this.emit("endLoad")}catch(e){console.error("[StackedStoryList]: error while story list loaded")}}subscribeToFeedCoverageAnalytics(){const e=new Co(this.storyManager,{listType:Re.DEFAULT,feed:this.options.feed,filter:{}});this.feedCoverageAnalyticsCalculator.on("feedImpression",e.handle)}}class ro{storyManager;constructor(e){this.storyManager=e}createStoryReader(){return new Sa(this.storyManager).create()}createGameReader(){return new kr(this.storyManager).create()}createStoryList(){return new yo(this.storyManager).create()}createInAppMessagingReader(){const e=this.storyManager.rootStore.iamStore;return new Za(this.storyManager,e,new cs(this.storyManager,e,new Rt(this.storyManager)))}}class ao extends P{storyListViewModel;story;id;title;titleColor;backgroundColor;background;deeplink;hideInReader;gameInstance;hasAudio;image;videoCoverSrc;videoCover;constructor(e,t){super(),this.storyListViewModel=e,this.story=t,this.id=this.story.id,this.title=this.story.title,this.titleColor=this.story.titleColor,this.background=this.story.background,this.backgroundColor=this.story.backgroundColor,this.deeplink=this.story.deeplink,this.hideInReader=this.story.hideInReader,this.gameInstance=this.story.gameInstance,this.hasAudio=this.story.hasAudio,this.image=this.story.image,this.videoCover=this.story.videoCover,this.videoCoverSrc=this.story.videoCoverSrc}get like(){return this.story.like}get favorite(){return this.story.favorite}get isOpened(){return this.story.isOpened}getAspectRatio(e){switch(e){case C.STYLE_CIRCLE:case C.STYLE_QUAD:return 1;case C.STYLE_RECTANGLE:return this.storyListViewModel.session?.previewAspectRatio??.8;default:return 1}}getImageSrcByCoverQuality(e){return this.story.image?.findOneByCoverQuality(e)?.url}onClick(e){this.storyListViewModel.onStoryClick(this,e)}destroy(){}}class oo extends ao{static create(e,t,s,i){const r=new at({id:-100,title:e.title.content??"",title_color:e.title.color,is_opened:!1,background_color:e.backgroundColor,image:oo.getBgImage(e)},s,i);return new oo(t,r)}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,${q(e.image.svgSrc.baseState)}`}),t}}class no{storyManager;storyListViewModel;constructor(e,t){this.storyManager=e,this.storyListViewModel=t,this.createFunctionWithTimeout=this.createFunctionWithTimeout.bind(this)}handle(e,t){this.storyManager.rootStore.storyStore.findStoryById(e.id).markIsOpened(),this.handleClickOnStoryCardDeepLink({id:e.id,index:t.index,isDeeplink:!0,url:e.deeplink},{listType:this.storyListViewModel.params.listType})}handleClickOnStoryCardDeepLink(e,{listType:t}){const s={data:[[1,0,e.id,0,0]]},i=()=>{e.isDeeplink&&e.url&&this.storyManager.clickOnButtonAction({src:y.STORY_LIST,payload:e})};t===Re.UGC||this.storyManager.getConfig().isStatisticsDisabled?i():Mt("session/update",s,this.createFunctionWithTimeout(i,1e3))}createFunctionWithTimeout(e,t){let s=!1;function i(){s||(s=!0,e())}return setTimeout(i,t||1e3),i}}class lo{storyManager;storyListViewModel;constructor(e,t){this.storyManager=e,this.storyListViewModel=t}handle(e,t){this.storyManager.rootStore.storyStore.findStoryById(e.id).markIsOpened();const s=e.gameInstance?.id;this.storyManager.gameReaderViewModel.openGame(s,{})}}class co{storyManager;storyListViewModel;constructor(e,t){this.storyManager=e,this.storyListViewModel=t}handle(e,t){const s={index:t.index,isDeeplink:!1,id:e.id,listType:this.storyListViewModel.params.isFavorite?Re.FAVORITE:Re.DEFAULT,windowReferer:this.storyListViewModel.params.isFavorite?L.favorite:L.default};this.openStoryReader(s),this.emitClickOnStory({id:e.id,index:t.index,isDeeplink:!1},{feedSlug:this.storyListViewModel.params.feedSlug,filter:this.storyListViewModel.params.filter})}async openStoryReader(e){try{const t=this.storyListViewModel.params.feedSlug;await this.storyManager.storyReaderViewModel.showMultipleStories({storyId:e.id,feed:t,listType:e.listType,filter:this.storyListViewModel.params.filter})}catch(e){console.error(e)}}emitClickOnStory(e,t){const s=t.feedSlug,i=t.filter,r=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(s),a=r.getStoryById(e.id),o={title:null,tags:[],slidesCount:null,feed:null,filter:null,source:null};o.title=a.statTitle,o.tags=a.tags,o.slidesCount=a.slidesCount,r.type===Re.DEFAULT?o.feed=s:r.type===Re.UGC&&(o.filter=i),o.source=M.list,this.storyManager.emit("clickOnStory",{...e,...o})}}class ho{static createHandler(e,t,s){const{deeplink:i,hideInReader:r,gameInstance:a}=e,o=J()(i)&&i.trim().length>0,n=a?.id;return this.isInvalidStoryClick(Boolean(r),o,n,e.id)?null:o?new no(t,s):n?new lo(t,s):new co(t,s)}static isInvalidStoryClick(e,t,s,i){return!(!e||t||s)&&(console.error(`Cannot open hidden story id ${i}`),!0)}}var uo=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},po=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let go=(()=>{let e,t,s,i,r,a,o,n,l,d,c,h,u,p=P,g=[],m=[],f=[],y=[],v=[],w=[],_=[],S=[],b=[];return class x extends p{static{const x="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.observable],r=[ve.action],a=[ve.computed],o=[ve.computed],n=[ve.computed],l=[ve.computed],d=[ve.computed],c=[ve.computed],h=[ve.action],u=[ve.action],po(this,null,e,{kind:"accessor",name:"_modeDesktop",static:!1,private:!1,access:{has:e=>"_modeDesktop"in e,get:e=>e._modeDesktop,set:(e,t)=>{e._modeDesktop=t}},metadata:x},m,f),po(this,null,t,{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:x},y,v),po(this,null,s,{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:x},w,_),po(this,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:x},S,b),po(this,null,r,{kind:"setter",name:"modeDesktop",static:!1,private:!1,access:{has:e=>"modeDesktop"in e,set:(e,t)=>{e.modeDesktop=t}},metadata:x},null,g),po(this,null,a,{kind:"getter",name:"modeDesktop",static:!1,private:!1,access:{has:e=>"modeDesktop"in e,get:e=>e.modeDesktop},metadata:x},null,g),po(this,null,o,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:x},null,g),po(this,null,n,{kind:"getter",name:"stories",static:!1,private:!1,access:{has:e=>"stories"in e,get:e=>e.stories},metadata:x},null,g),po(this,null,l,{kind:"getter",name:"params",static:!1,private:!1,access:{has:e=>"params"in e,get:e=>e.params},metadata:x},null,g),po(this,null,d,{kind:"getter",name:"hasFavoriteCard",static:!1,private:!1,access:{has:e=>"hasFavoriteCard"in e,get:e=>e.hasFavoriteCard},metadata:x},null,g),po(this,null,c,{kind:"getter",name:"hasUgcCard",static:!1,private:!1,access:{has:e=>"hasUgcCard"in e,get:e=>e.hasUgcCard},metadata:x},null,g),po(this,null,h,{kind:"method",name:"setParams",static:!1,private:!1,access:{has:e=>"setParams"in e,get:e=>e.setParams},metadata:x},null,g),po(this,null,u,{kind:"method",name:"reload",static:!1,private:!1,access:{has:e=>"reload"in e,get:e=>e.reload},metadata:x},null,g),x&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:x})}storyManager=uo(this,g);storiesService;_id;#H=uo(this,m,!0);get _modeDesktop(){return this.#H}set _modeDesktop(e){this.#H=e}#q=(uo(this,f),uo(this,y,null));get ugcCardOptions(){return this.#q}set ugcCardOptions(e){this.#q=e}#Q=(uo(this,v),uo(this,w,null));get favoriteCardOptions(){return this.#Q}set favoriteCardOptions(e){this.#Q=e}#j=(uo(this,_),uo(this,S,{listType:Re.DEFAULT,feedSlug:"",useUgcCard:!1,isFavorite:!1,hasFavorite:!1}));get _params(){return this.#j}set _params(e){this.#j=e}isLoading=(uo(this,b),!1);static index=0;set modeDesktop(e){this._modeDesktop!==e&&(this._modeDesktop=e)}get id(){return this._id}get modeDesktop(){return this._modeDesktop}get session(){return this.storyManager.rootStore.sessionStore.session}get stories(){const e=this._params.feedSlug,t=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(e);if(!t)return[];const s=t.stories.map((e=>new ao(this,e)));return this.hasFavoriteCard&&this.favoriteCardOptions&&s.push(this.createFavoriteCard(this.favoriteCardOptions)),this.hasUgcCard&&this.ugcCardOptions&&s.unshift(this.createUgcStoryCard(this.ugcCardOptions)),s}get params(){return this._params}constructor(e,t){super(),this.storyManager=e,this.storiesService=t,this._id="StoryListViewModel"+x.index++,this.storyManager.setViewModel(this._id,this)}get hasFavoriteCard(){const e=this.storyManager.rootStore.storyFeedStore.getFavoriteFeed();return this._params.hasFavorite&&this._params.listType===Re.DEFAULT&&e.stories.length>0}get hasUgcCard(){return this._params.useUgcCard}setParams(e){this._params=e}onStoryClick(e,t=0){ho.createHandler(e,this.storyManager,this)?.handle(e,{index:t})}destroy(){this.removeAllListeners(),this.storyManager.deleteViewModel(this._id)}async reload(){await this.loadStories({needFavorite:!0})}async loadStories(e){if(this.isLoading||this._params.feedSlug===ze)return;const t=Boolean(this._params.hasFavorite)&&e.needFavorite,s={feed:this._params.feedSlug,filter:{},defaultListLength:0,favoriteListLength:0,success:!0,error:{name:"",networkStatus:200,networkMessage:""}};try{this.emit("startLoading"),this.isLoading=!0;const{defaultStories:e,favoriteStories:i}=await this.storiesService.loadStories({...this._params,needFavorite:t});s.success=!0,s.error=null,s.defaultListLength=e.length,this._params.hasFavorite&&this._params.listType===Re.DEFAULT&&(s.favoriteListLength=i.length)}catch(e){console.error(e),s.success=!1,e instanceof z&&(s.error={name:e.name,networkMessage:e.networkMessage,networkStatus:e.networkStatus})}finally{this.isLoading=!1,s.filter=this._params.filter??{},this.emit("endLoading",s)}}setUgcCardOptions(e){this.ugcCardOptions=e}setFavoriteCardOptions(e){this.favoriteCardOptions=e}createUgcStoryCard(e){return oo.create(e,this,this.storyManager.rootStore,new Qe(this.storyManager))}createFavoriteCard(e){return fo.create(e,this,this.storyManager.rootStore,new Qe(this.storyManager))}}})();class mo extends ao{constructor(e,t){super(e,t)}}class fo extends ao{rootStore;constructor(e,t,s){super(t,s),this.rootStore=e}get favoriteStories(){return this.rootStore.storyFeedStore.getFavoriteFeed().stories.map((e=>new mo(this.storyListViewModel,e)))}static create(e,t,s,i){const r=new at({id:0,title:e.title.content,title_color:e.title.color,is_opened:!0,background_color:"white"},s,i);return new fo(s,t,r)}}class yo{storyManager;constructor(e){this.storyManager=e}create(){const e=new Lo(this.storyManager);return new go(this.storyManager,e)}}class vo{x;y;width;height;constructor(e=0,t=0,s=0,i=0){this.x=e,this.y=t,this.width=s,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),s=Math.max(this.x,e.x),i=Math.min(this.y+this.height,e.y+e.height),r=Math.max(this.y,e.y);return new vo(Math.min(t,s),Math.min(i,r),Math.max(0,t-s),Math.max(0,i-r))}getArea(){return this.width*this.height}getAreaFraction(e){return+(this.getArea()/e.getArea()*100).toFixed(2)}static clone(e){return new vo(e.x,e.y,e.width,e.height)}}class wo{feedCoverageAnalyticsCalculator;constructor(e){this.feedCoverageAnalyticsCalculator=e}storiesIds=new Set;markStoryAsFullVisible(e){this.storiesIds.has(e)||(this.storiesIds.add(e),this.feedCoverageAnalyticsCalculator.emit("feedImpression",[e]))}calculate(e){const t=this.getNewStoriesIds(e.map((({id:e})=>e)));t.forEach((e=>this.storiesIds.add(e))),0!==t.length&&this.feedCoverageAnalyticsCalculator.emit("feedImpression",t)}getNewStoriesIds=e=>{const t=[];for(const s of e)this.storiesIds.has(s)||t.push(s);return t}}class _o{feedCoverageAnalyticsCalculator;constructor(e){this.feedCoverageAnalyticsCalculator=e}calculate(e){const t=e.map((({id:e,areaFraction:t})=>({storyId:e,visibleArea:Math.round(t)/100})));0!==t.length&&this.feedCoverageAnalyticsCalculator.emit("visibleAreaUpdated",t)}}class So extends t.EventEmitter{storyRects=[];viewport=new vo;feedImpressionMetric;visibleAreaMetric;constructor(){super(),this.feedImpressionMetric=new wo(this),this.visibleAreaMetric=new _o(this)}calculate(e){const t=this.getScrollViewportByCalculationParams(e),s=this.getStoryRectIntersectionsWithViewport(t),i=this.filterStoryRectIntersections(s);this.calculateMetrics(i)}setViewport(e){this.viewport=e}setStoryRects(e){this.storyRects=e}markStoryAsFullVisible(e){this.feedImpressionMetric.markStoryAsFullVisible(e)}destroy(){this.removeAllListeners()}getScrollViewportByCalculationParams(e){const t=vo.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}calculateMetrics(e){this.feedImpressionMetric.calculate(e),this.visibleAreaMetric.calculate(e)}getStoryRectIntersectionsWithViewport(e){const t=[];for(const s of this.storyRects)if(s.overlaps(e)){const i=s.getIntersection(e);t.push({id:s.id,areaFraction:i.getAreaFraction(s)})}else t.push({id:s.id,areaFraction:0});return t}filterStoryRectIntersections=e=>e.filter((e=>-100!==e.id&&e.areaFraction>0))}class bo extends vo{id;constructor(e,t=0,s=0,i=0,r=0){super(t,s,i,r),this.id=e}static clone(e){return new bo(e.id,e.x,e.y,e.width,e.height)}}class xo{feedCoverageAnalyticsCalculator;viewportPadding={left:0,right:0,top:0,bottom:0};minOffsetLeft=0;maxOffsetLeft=0;minOffsetTop=0;maxOffsetTop=0;constructor(e){this.feedCoverageAnalyticsCalculator=e}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),this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:this.minOffsetLeft,maxOffsetLeft:this.maxOffsetLeft,minOffsetTop:this.minOffsetTop,maxOffsetTop:this.maxOffsetTop})}calculate(e,t){this.feedCoverageAnalyticsCalculator.calculate({minOffsetLeft:e,maxOffsetLeft:e,minOffsetTop:t,maxOffsetTop:t})}updateGeometry({stories:e,storyListRect:t,windowRect:s,viewportPadding:i}){this.viewportPadding=i,this.setViewport(t,s),this.setStoryRects(e,t)}destroy(){this.feedCoverageAnalyticsCalculator.destroy()}markStoryAsFullVisible(e){this.feedCoverageAnalyticsCalculator.markStoryAsFullVisible(e)}setViewport(e,t){const s=this.getViewportByWindowAndStoryList(t,e);this.applyPaddingToViewport(s,e),this.feedCoverageAnalyticsCalculator.setViewport(s)}getViewportByWindowAndStoryList(e,t){let s=new vo;return t.overlaps(e)?(s=t.getIntersection(e),s):s}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 s=[];e.forEach(((i,r)=>{const a=Number(i.dataset.id),o=new bo(a,i.offsetLeft,i.offsetTop,i.clientWidth,i.clientHeight);s.push(o),o.x+=t.x,o.y+=t.y,this.applyPaddingAndNegativeMarginToStoryRect(o,r,e.length-1)})),this.feedCoverageAnalyticsCalculator.setStoryRects(s)}applyPaddingAndNegativeMarginToStoryRect(e,t,s){const i=this.viewportPadding;0===t&&(e.x+=i.left,e.width-=i.left),t===s&&(e.width-=i.right)}}class Co{storyManager;params;constructor(e,t){this.storyManager=e,this.params=t,this.handle=this.handle.bind(this)}handle(e){const t=this.storyManager.getConfig();this.params.listType!==Re.DEFAULT||t.isStatisticsDisabled||this.sendStat(e);const s=this.params.feed,i=this.params.filter,r={stories:e.map((e=>{const t={title:null,tags:[],slidesCount:null},i=this.storyManager.rootStore.storyFeedStore.getFeedBySlug(s),r=i.getStoryById(e);return r&&(t.title=r.statTitle,t.tags=r.tags,t.slidesCount=r.slidesCount,i.type===Re.UGC&&(t.ugcPayload=lt()(r.ugcPayload)?r.ugcPayload:{})),{id:e,...t}})),feed:null,filter:null};this.params.listType===Re.DEFAULT?r.feed=s:this.params.listType===Re.UGC&&(r.filter=i),this.storyManager.emit("feedImpression",r)}sendStat(e){const t=[[5,0,...e]];this.storyManager.rootStore.sessionStore.sendStatisticData({data:t})}}class ko{storyManager;params;constructor(e,t){this.storyManager=e,this.params=t,this.handle=this.handle.bind(this)}handle(e){const t=this.params.feed,s=this.params.filter,i=this.params.listType,r={stories:e.map((({storyId:e,visibleArea:t})=>{const s={title:null,tags:[],slidesCount:null,visibleArea:t},r=this.storyManager.rootStore.storyStore.findStoryById(e);return r&&(s.title=r.statTitle,s.tags=r.tags,s.slidesCount=r.slidesCount,i===Re.UGC&&(s.ugcPayload=lt()(r.ugcPayload)?r.ugcPayload:{})),{id:e,...s}})),feed:null,filter:null};i===Re.DEFAULT?r.feed=t:i===Re.UGC&&(r.filter=s),this.storyManager.emit("visibleAreaUpdated",r)}}class Mo{storyManager;params;constructor(e,t){this.storyManager=e,this.params=t}create(){const e=new So,t=new Co(this.storyManager,this.params),s=new ko(this.storyManager,this.params);e.on("feedImpression",t.handle),e.on("visibleAreaUpdated",s.handle);return new xo(e)}}class Lo{storyManager;constructor(e){this.storyManager=e}async loadStories({feedSlug:e,filter:t={},listType:s,testKey:i,needFavorite:r=!0}){const a=s===Re.DEFAULT&&r,o=this.storyManager.rootStore.storyFeedStore;await this.fetchFeed(o,e,t,i),a&&await o.fetchFavoriteFeed();const n=o.getFeedBySlug(e),l=this.getFeedLoadEventStoryDtos(n);return this.emitFeedLoadEvent(n,l,e,t),this.getStoriesResult(o,e)}async fetchFeed(e,t,s,i){t===He?await e.fetchUgcFeed({filter:s,testKey:i}):await e.fetchDefaultFeed({feedSlug:t,testKey:i})}getFeedLoadEventStoryDtos(e){return e.stories.map((t=>{const s={title:null,tags:[],slidesCount:null};return s.title=t.statTitle,s.tags=t.tags,s.slidesCount=t.slidesCount,e.type===Re.UGC&&(s.ugcPayload=lt()(t.ugcPayload)?t.ugcPayload:{}),{id:t.id,...s}}))}emitFeedLoadEvent(e,t,s,i){const r={stories:t,feed:null,filter:null};e.type===Re.DEFAULT?r.feed=s:e.type===Re.UGC&&(r.filter=i),this.storyManager.emit("feedLoad",r)}getStoriesResult(e,t){return{defaultStories:e.getFeedBySlug(t)?.stories??[],favoriteStories:e.getFavoriteFeed()?.stories??[]}}}class Oo extends t.EventEmitter{storyManager;storyReaderViewModel;storyId;options;constructor(e,t,s,i){super(),this.storyManager=e,this.storyReaderViewModel=t,this.storyId=s,this.options=i,this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.showSharePage(),this.storyReaderViewModel.once(ya.Close,this.handleCloseStoryReader)}async closeStoryReader(){this.storyManager.closeStoryReader()}showSharePage=async()=>{this.handleStartLoad();const e=this.storyManager.getConfig().isStatisticsDisabled,t=await this.storyReaderViewModel.showStoryFromSharePage(this.storyId,e);this.handleEndLoad(t)};handleStartLoad(){setTimeout((()=>{this.emit(n.START_LOADING),R()(this.options?.handleStartLoad)&&this.options.handleStartLoad()}))}handleEndLoad(e){this.emit(n.END_LOADING,{result:e}),R()(this.options?.handleStopLoad)&&this.options.handleStopLoad(e)}handleCloseStoryReader(){if(R()(this.options?.handleStoryReaderClose)||this.listenerCount(n.CLOSE_STORY_READER)>0)try{R()(this.options?.handleStoryReaderClose)&&this.options?.handleStoryReaderClose(),this.emit(n.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}}}class Io{storyManager;plugins=new Map;constructor(e){this.storyManager=e}install(e,t){this.plugins.set(e.name,e),$(`[PluginManager]: plugin ${e.name} registered`),e.install(this.storyManager,t),$(`[PluginManager]: plugin ${e.name} installed`)}uninstall(e){e.uninstall(this.storyManager),this.plugins.delete(e.name),$(`[PluginManager]: plugin ${e.name} uninstalled`)}get(e){return this.plugins.get(e)}}class Ao extends Error{constructor(e){super(`[IAM]: not found IAM for event <${e}>`),this.name="IamNotFoundByEventError"}}var Eo=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},To=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let Ro=(()=>{let e,t,s,i,r,a,o,n=[],l=[],d=[],c=[],h=[],u=[],p=[];return class{static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.observable],s=[ve.observable],i=[ve.computed],r=[ve.computed],a=[ve.computed],o=[ve.computed],To(this,null,e,{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:g},l,d),To(this,null,t,{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:g},c,h),To(this,null,s,{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:g},u,p),To(this,null,i,{kind:"getter",name:"messages",static:!1,private:!1,access:{has:e=>"messages"in e,get:e=>e.messages},metadata:g},null,n),To(this,null,r,{kind:"getter",name:"isLoaded",static:!1,private:!1,access:{has:e=>"isLoaded"in e,get:e=>e.isLoaded},metadata:g},null,n),To(this,null,a,{kind:"getter",name:"isLoading",static:!1,private:!1,access:{has:e=>"isLoading"in e,get:e=>e.isLoading},metadata:g},null,n),To(this,null,o,{kind:"getter",name:"messageContext",static:!1,private:!1,access:{has:e=>"messageContext"in e,get:e=>e.messageContext},metadata:g},null,n),g&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})}rootStore=Eo(this,n);iamApi;#K=Eo(this,l,new Map);get _messages(){return this.#K}set _messages(e){this.#K=e}#Y=(Eo(this,d),Eo(this,c,!1));get _isLoaded(){return this.#Y}set _isLoaded(e){this.#Y=e}#Z=(Eo(this,h),Eo(this,u,!1));get _isLoading(){return this.#Z}set _isLoading(e){this.#Z=e}_messageContext=Eo(this,p);constructor(e,t){this.rootStore=e,this.iamApi=t}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(){try{if(this._isLoaded)return this.messages;this._isLoading=!0;const e=await this.fetchAll();return this._isLoaded=!0,e}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 Ao(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(){await this.rootStore.sessionStore.open(),await this.fetchMessageContext();const e=this.rootStore.storyManagerConfigStore.config.tags,t=await this.iamApi.fetchAll({tags:e});return this.createMessagesByDtos(t)}async fetchMessageContext(){await this.rootStore.sessionStore.open(),this._messageContext||(this._messageContext=await this.iamApi.fetchContext())}createMessagesByDtos(e){const t=[];for(const s of e){const e=this.createMessageByDto(s);t.push(e)}return t}createMessageByDto(e){const t=Ht.createByDto(e,this,new is(this.iamApi));return this._messages.has(t.id.toString())||this._messages.set(t.id.toString(),t),t}}})();var Po=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Bo=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let Do=(()=>{let e,t,s,i,r=[],a=[],o=[];return class{static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],s=[ve.computed],i=[_e],Bo(this,null,e,{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:n},a,o),Bo(this,null,t,{kind:"getter",name:"session",static:!1,private:!1,access:{has:e=>"session"in e,get:e=>e.session},metadata:n},null,r),Bo(this,null,s,{kind:"getter",name:"userId",static:!1,private:!1,access:{has:e=>"userId"in e,get:e=>e.userId},metadata:n},null,r),Bo(this,null,i,{kind:"method",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open},metadata:n},null,r),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}sessionApi=Po(this,r);rootStore;#J=Po(this,a,null);get _session(){return this.#J}set _session(e){this.#J=e}constructor(e,t){Po(this,o),this.sessionApi=e,this.rootStore=t}get session(){return this._session}get userId(){return this._session?.userKey??Oe}async open(){if(this._session)return this._session;const e=await this.sessionApi.open(),t=new Ie(this,e);return t.loadResources(),this.updatePlaceholders(t),this._session=t,t}close(){this._session=null}async sendStatisticData(e){return this.sessionApi.sendStatisticData(e)}updatePlaceholders(e){this.rootStore.placeholderStore.addPlaceholders([...e.imagePlaceholders,...e.textPlaceholders])}}})();var jo=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Fo=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};const No=ve.observable.map();let Uo=(()=>{let e,t,s=[],i=[],r=[];return class{static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],Fo(this,null,e,{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:a},i,r),Fo(this,null,t,{kind:"getter",name:"activeUserStories",static:!1,private:!1,access:{has:e=>"activeUserStories"in e,get:e=>e.activeUserStories},metadata:a},null,s),a&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})}storyManager=jo(this,s);storiesApi;rootStore;#X=jo(this,i,ve.observable.map());get _storiesByUserId(){return this.#X}set _storiesByUserId(e){this.#X=e}storyCSSLoaded=(jo(this,r),!1);get activeUserStories(){const e=this.rootStore.sessionStore.userId;return e?this._storiesByUserId.get(e)??No:No}constructor(e,t,s){this.storyManager=e,this.storiesApi=t,this.rootStore=s,(0,ve.reaction)((()=>s.placeholderStore.placeholders),(e=>{for(const t of this.activeUserStories.values())t.updatePlaceholders(e)}))}addStoriesByDtos(e){const t=this.getOrCreateStoriesMap();for(const s of e)t.has(s.id)||t.set(s.id,new at(s,this.rootStore,this.storiesApi))}addStory(e){const t=this.getOrCreateStoriesMap();if(t.has(e.id))return t.get(e.id);const s=new at(e,this.rootStore,this.storiesApi);return t.set(e.id,s),s}async fetchStoryAndContextById({storyId:e,feedSlug:t,fetchShareUrl:s,once:i}){let r=this.findStoryById(e);if(r?.slidesLoaded)return r;await this.rootStore.sessionStore.open(),await this.fetchStoryCSS(),r=await this.fetchStory({storyId:e,feedSlug:t,fetchShareUrl:s,once:i});const a=await this.fetchStoryContext({id:r.id,feedSlug:t});return r.setContext(a),r}findStoryById(e){return"number"==typeof e?this.activeUserStories.get(e):Array.from(this.activeUserStories.values()).find((t=>t.stringId===e))}createEmptyStory(){return at.createEmpty(this.storyManager.rootStore,new Qe(this.storyManager))}async fetchStoriesSlidesAndContextByStoryId({storyId:e,storyFeed:t}){const s=this.getVisibleStoriesByStoryFeed(t),i=s.findIndex((t=>t.id===e));await this.fetchStoriesSlidesAndContextByRange({stories:s,storyIndex:i,feedSlug:t.slug})}async fetchStoriesSlidesAndContextByNextStoryIndex({nextStoryIndex:e,storyFeed:t}){const s=this.getVisibleStoriesByStoryFeed(t);await this.fetchStoriesSlidesAndContextByRange({stories:s,storyIndex:e,feedSlug:t.slug})}async fetchStoriesSlidesAndContextByRange(e){const t=this.getStoriesByRange(e.stories,e.storyIndex);if(!t.length)return null;await this.fetchSlidesAndContext({feedSlug:e.feedSlug,stories:t})}getStoriesByRange(e,t){const s=t-2,i=t+2;return e.slice(Math.max(s,0),i+1).filter((e=>!e.slidesLoaded))}async fetchSlidesAndContext({feedSlug:e,stories:t}){try{await this.fetchStoryCSS();const s=await this.fetchStoryContextByIds({ids:t.map((e=>e.id)),feedSlug:e});for(let i=0;i<t.length;i++){const r=t[i],a=s[i];r.error&&r.setError(null),await this.processSingleStory(r,a,e)}}catch(e){for(const s of t)s.setError(e)}}async processSingleStory(e,t,s){try{e.error&&e.setError(null),e.setContext(t);const i=await this.storiesApi.fetchStorySlides({id:e.id,feedSlug:s});e.setSlides(i.slides)}catch(t){e.setError(t)}}getVisibleStoriesByStoryFeed(e){return e.stories.filter((e=>!e.hideInReader))??[]}async fetchStory({storyId:e,feedSlug:t,fetchShareUrl:s,once:i}){const r=await this.storiesApi.fetchStory({id:e,feedSlug:t,fetchShareUrl:s,once:i}),a=this.addStory(r);return a.setSlides(r.slides),a}async fetchStoryCSS(){if(this.storyCSSLoaded)return;const e=await this.storiesApi.fetchStoryCSS();this.storyCSSLoaded=!0,(e=>{const t="stories-slider-style";let s=document.getElementById(t),i="";null!==e&&(i=e??""),null===s?(s=document.createElement("style"),s.type="text/css",s.id=t,s.attributes.setNamedItem(document.createAttribute("scoped")),s.setAttribute("nonce",K()),s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),document.head.appendChild(s)):s.styleSheet?s.styleSheet.cssText=i:(s.textContent="",s.appendChild(document.createTextNode(i)))})(e)}async fetchStoryContext({id:e,feedSlug:t}){const s=await this.storiesApi.fetchStoryContext({ids:[e],feedSlug:t});return new ot(e,s)}async fetchStoryContextByIds({ids:e,feedSlug:t}){const s=await this.storiesApi.fetchStoryContext({ids:e,feedSlug:t});return e.map((e=>new ot(e,s)))}getOrCreateStoriesMap(){const e=this.rootStore.sessionStore.userId;let t=ve.observable.map();return this._storiesByUserId.has(e)?t=this._storiesByUserId.get(e):this._storiesByUserId.set(e,t),t}}})();var zo=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Vo=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};const Wo=ve.observable.map();let Go=(()=>{let e,t,s=[],i=[],r=[];return class{static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],Vo(this,null,e,{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:a},i,r),Vo(this,null,t,{kind:"getter",name:"activeUserFeeds",static:!1,private:!1,access:{has:e=>"activeUserFeeds"in e,get:e=>e.activeUserFeeds},metadata:a},null,s),a&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})}storyFeedsApi=zo(this,s);rootStore;#ee=zo(this,i,ve.observable.map());get _storyFeedsByUserId(){return this.#ee}set _storyFeedsByUserId(e){this.#ee=e}constructor(e,t){zo(this,r),this.storyFeedsApi=e,this.rootStore=t}get activeUserFeeds(){const e=this.rootStore.sessionStore.userId;return e?this._storyFeedsByUserId.get(e)??Wo:Wo}getUgcFeed(){return this.getFeedBySlug(He)??qe.createByStoryDtos([],this.rootStore)}getFavoriteFeed(){return this.getFeedBySlug(ze)??Ve.createByStoryDtos([],this.rootStore)}getFeedBySlug(e){return this.activeUserFeeds.get(e)}async fetchDefaultFeed({feedSlug:e,testKey:t}){const s=await this.rootStore.sessionStore.open(),i=this.rootStore.storyManagerConfigStore.config.tags,r=await this.storyFeedsApi.fetchDefaultFeed({feedSlug:e,tags:i,testKey:t}),a=new Ue(r,this.rootStore,{testKey:t});this.addStoryFeed(s.userKey,a)}async fetchFavoriteFeed(){const e=await this.rootStore.sessionStore.open(),t=this.rootStore.storyManagerConfigStore.config.tags,s=await this.storyFeedsApi.fetchFavoriteFeed({tags:t}),i=Ve.createByStoryDtos(s,this.rootStore);this.addStoryFeed(e.userKey,i)}async fetchUgcFeed({filter:e,testKey:t}){const s=await this.rootStore.sessionStore.open(),i=this.rootStore.storyManagerConfigStore.config.tags,r=await this.storyFeedsApi.fetchUgcFeed({filter:e,tags:i,testKey:t}),a=qe.createByStoryDtos(r,this.rootStore);this.addStoryFeed(s.userKey,a)}addStoryFeed(e,t){let s=ve.observable.map();this._storyFeedsByUserId.has(e)?s=this._storyFeedsByUserId.get(e):this._storyFeedsByUserId.set(e,s),s.set(t.slug,t)}}})();var $o=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Ho=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};const qo=ve.observable.map();let Qo=(()=>{let e,t,s=[],i=[],r=[];return class{static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],Ho(this,null,e,{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:a},i,r),Ho(this,null,t,{kind:"getter",name:"activeUserFeeds",static:!1,private:!1,access:{has:e=>"activeUserFeeds"in e,get:e=>e.activeUserFeeds},metadata:a},null,s),a&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})}storyFeedsApi=$o(this,s);rootStore;#te=$o(this,i,ve.observable.map());get _onboardingFeedsByUserId(){return this.#te}set _onboardingFeedsByUserId(e){this.#te=e}constructor(e,t){$o(this,r),this.storyFeedsApi=e,this.rootStore=t,(0,ve.reaction)((()=>{const e=this.rootStore.storyManagerConfigStore.config;return e?[e.lang,e.apiKey]:null}),(()=>{this.activeUserFeeds.clear()}))}get activeUserFeeds(){const e=this.rootStore.sessionStore.userId;return e?this._onboardingFeedsByUserId.get(e)??qo:qo}getFeedBySlug(e){return this.activeUserFeeds.get(e??$e.getDefaultSlug())}removeOpenedStoryById(e){for(const t of this.activeUserFeeds.values())t.removeById(e)}async fetchOnboardingFeed(e){let t=e.feedSlug||$e.getDefaultSlug();const s=this.getOnboardingParams(e);if(this.isOnboardingFeedExistAndHasEqualParams(t,s))return;await this.rootStore.sessionStore.open();const i=await this.storyFeedsApi.fetchOnboardingFeed({...s,feedSlug:t});i.feedSlug=t;const r=new $e(i,this.rootStore,s);this.addOnboardingFeed(r)}addOnboardingFeed(e){const t=this.rootStore.sessionStore.session.userKey;let s=ve.observable.map();this._onboardingFeedsByUserId.has(t)?s=this._onboardingFeedsByUserId.get(t):this._onboardingFeedsByUserId.set(t,s),s.set(e.slug,e)}isOnboardingFeedExistAndHasEqualParams(e,t){const s=this.activeUserFeeds.get(e);return!!s&&s.isEqualParams(t)}getOnboardingParams(e){return{tags:e.tags.length>0?e.tags:this.rootStore.storyManagerConfigStore.config.tags,limit:e.limit}}}})();class Ko{storyManager;ugcEditorApi;_config=null;constructor(e,t){this.storyManager=e,this.ugcEditorApi=t}async getUgcEditorConfig(){if(this._config)return this._config;const e=await this.storyManager.rootStore.sessionStore.open(),t=await this.ugcEditorApi.fetchUgcEditorConfig(),s=this.storyManager.getConfig();return this._config={sessionId:e.id,apiKey:s.apiKey,editor:t??{},sdkVersion:"3.3.0",appPackageId:s.appPackageId,deviceId:e.deviceId,userId:null!=s.userId?String(s.userId):void 0,lang:s.lang.toString()},this._config}}class Yo{storyManager;constructor(e){this.storyManager=e}async fetchUgcEditorConfig(){return(await Lt.request({method:"GET",url:"ugc/editor-config",params:{}})).data}}var Zo=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0},Jo=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0};let Xo=(()=>{let e,t,s=[],i=[],r=[];return class{static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],t=[ve.computed],Jo(this,null,e,{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:a},i,r),Jo(this,null,t,{kind:"getter",name:"placeholders",static:!1,private:!1,access:{has:e=>"placeholders"in e,get:e=>e.placeholders},metadata:a},null,s),a&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})}#se=(Zo(this,s),Zo(this,i,ve.observable.map()));get _placeholders(){return this.#se}set _placeholders(e){this.#se=e}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=ve.observable.map()}constructor(){Zo(this,r)}}})();var en=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},tn=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};let sn=(()=>{let e,t=[],s=[];return class{static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[ve.observable],en(this,null,e,{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:i},t,s),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}storyManager;#ie=tn(this,t,null);get _config(){return this.#ie}set _config(e){this.#ie=e}constructor(e){tn(this,s),this.storyManager=e}get config(){return this._config}setConfig(e){this._config?this.updateConfig(e):this.initializeConfig(e)}clear(){this._config=null,this.storyManager.rootStore.sessionStore.close()}async waitStoryManagerConfig(){return new Promise(((e,t)=>{let s;const i=()=>{if(this._config)return clearTimeout(s),void e();requestAnimationFrame(i)};s=setTimeout((()=>{t("[IAS]: Timeout waiting for InAppStoryManager config")}),5e3),i()}))}initializeConfig(e){this._config=new vt(this.storyManager,e)}updateConfig(e){this._config.updateByDto(e)}}})();class rn{iamStore;sessionStore;storyStore;storyFeedStore;onboardingFeedStore;ugcEditorStore;placeholderStore;storyManagerConfigStore;constructor(e){const t=new Qe(e),s=new Ke(e);this.storyManagerConfigStore=new sn(e),this.placeholderStore=new Xo,this.iamStore=new Ro(this,new Rt(e)),this.sessionStore=new Do(new Se(e),this),this.storyStore=new Uo(e,t,this),this.storyFeedStore=new Go(s,this),this.onboardingFeedStore=new Qo(s,this),this.ugcEditorStore=new Ko(e,new Yo(e))}}class an extends t.EventEmitter{static instance;viewModelStore=new j;callbacks={};pluginManager=new Io(this);_rootStore=new rn(this);constructor(){return super(),an.isSingletonInstanceExists()||(an.instance=this),an.instance}get rootStore(){return this._rootStore}get sdkVersionName(){return"3.3.0"}get sdkVersionCode(){return parseInt(30300)}get lang(){return this.rootStore.storyManagerConfigStore.config.lang}set storyLinkClickHandler(e){R()(e)&&(this.callbacks.storyLinkClickHandler=e)}get storyReaderViewModel(){return this.viewModelStore.get(_a.id)}get gameReaderViewModel(){return this.viewModelStore.get(Cr.id)}get isStatisticsDisabled(){return this.getConfig().isStatisticsDisabled}inAppMessaging=this.createInAppMessagingReader();static getInstance(){return an.instance?an.instance:null}setViewModel(e,t){this.viewModelStore.set(e,t)}deleteViewModel(e){this.viewModelStore.delete(e)}getViewModelByKey(e){return this.viewModelStore.get(e)}getConfig(){return this.rootStore.storyManagerConfigStore.config}setConfig(e){this.rootStore.storyManagerConfigStore.setConfig(e)}async waitViewModel(e){return this.viewModelStore.wait(e)}async waitStoryManagerConfig(){return this.rootStore.storyManagerConfigStore.waitStoryManagerConfig()}async showOnboardingStories(e){return(await this.viewModelStore.wait(_a.id)).showOnboardingStories(e)}async showStory(e){"string"==typeof e&&(e=+e||e);const t=await this.viewModelStore.wait(_a.id);await t.showStory(e,"")}async showStoryOnce(e){"string"==typeof e&&(e=+e||e);const t=await this.viewModelStore.wait(_a.id);await t.showStoryOnce(e)}closeAllReaders(){this.storyReaderViewModel?.close(),this.gameReaderViewModel?.closeGame()}closeGoodsWidget(){this.storyReaderViewModel?.closeGoodsWidget()}async openGame(e,t={}){const s=await this.viewModelStore.wait(Cr.id);await s.openGame(e,t)}async closeGame(){return this.gameReaderViewModel.closeGame()}async closeStoryReader(){this.storyReaderViewModel.close()}async getUgcEditorConfig(){return this.rootStore.ugcEditorStore.getUgcEditorConfig()}async showSharePage(e,t){return"string"==typeof e&&(e=+e||e),await this.viewModelStore.wait(_a.id),new Oo(this,this.storyReaderViewModel,e,t)}clickOnButtonAction=({src:e,payload:t})=>{if(R()(this.callbacks.storyLinkClickHandler)||this.listenerCount(A.CLICK_ON_STORY)>0){const s={src:e,data:t};try{R()(this.callbacks.storyLinkClickHandler)&&this.callbacks.storyLinkClickHandler(s),this.emit(A.CLICK_ON_STORY,s)}catch(e){console.error(e)}}else window.open(t.url,"_self")};reloadAllStoryLists(){const e=this.viewModelStore.getAllOfType((e=>e instanceof go));return Promise.all(e.map((e=>e.reload())))}reloadAllStackedStoryLists(){const e=this.viewModelStore.getAllOfType((e=>e instanceof io));return Promise.all(e.map((e=>e.reload())))}static isSingletonInstanceExists(){return!!an.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 ro(this).createStoryReader()}createGameReader(){return new ro(this).createGameReader()}createStoryList(){return new ro(this).createStoryList()}createInAppMessagingReader(){return new ro(this).createInAppMessagingReader()}clearConfig(){this.rootStore.storyManagerConfigStore.clear()}emitEvent(e){this.emit(e.name,e.toJSON())}}const on=new an;new class{storyManager;inAppMessaging;constructor(e){this.storyManager=e,this.inAppMessaging=new Ja(e.inAppMessaging)}get sdkVersionName(){return this.storyManager.sdkVersionName}get sdkVersionCode(){return this.storyManager.sdkVersionCode}set storyLinkClickHandler(e){this.storyManager.storyLinkClickHandler=e}getConfig(){return this.storyManager.getConfig()}getNonce(){return K()}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 closeStoryReader(){return this.storyManager.closeStoryReader()}getUgcEditorConfig(){return this.storyManager.getUgcEditorConfig()}showSharePage(e,t){return this.storyManager.showSharePage(e,t)}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){on.use(e,t)}}(on);var nn;!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"}(nn||(nn={}));Error;class ln extends t.EventEmitter{constructor(){super()}_commonOptions=i;setCommonOptions(e,t=!0){return this._commonOptions=Oi()(this._commonOptions,e),this.emit(nn.UPDATE,this.commonOptions),this}get commonOptions(){return this._commonOptions}_storiesListOptions=m;setStoriesListOptions(e,t=!0){return this._storiesListOptions=Oi()(this._storiesListOptions,e),t&&(this.emit(nn.UPDATE,this.storiesListOptions),this.emit(nn.EVENT_UPDATED_STORIES_LIST_OPTIONS,this.storiesListOptions)),this}get storiesListOptions(){return this._storiesListOptions}_storyReaderOptions=x;setStoryReaderOptions(e,t=!0){return this._storyReaderOptions=Oi()(this._storyReaderOptions,e,{arrayMerge:(e,t,s)=>t}),t&&this.emit(nn.UPDATE,{storyReaderOptions:this.storyReaderOptions,gameReaderOptions:this.gameReaderOptions,appearanceCommon:this.commonOptions}),this}get storyReaderOptions(){return{...{closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton,loader:this.commonOptions.loader},...this._storyReaderOptions}}_storyFavoriteReaderOptions=f;setStoryFavoriteReaderOptions(e,t=!0){return this._storyFavoriteReaderOptions=Oi()(this._storyFavoriteReaderOptions,e),t&&this.emit(nn.UPDATE,this.storyFavoriteReaderOptions),this}get storyFavoriteReaderOptions(){return{...{closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton},...this._storyFavoriteReaderOptions}}_goodsWidgetOptions=o;setGoodsWidgetOptions(e,t=!0){return this._goodsWidgetOptions=Oi()(this._goodsWidgetOptions,e),t&&this.emit(nn.UPDATE,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}_gameReaderOptions=r;setGameReaderOptions(e,t=!0){return this._gameReaderOptions=Oi()(this._gameReaderOptions,e),t&&this.emit(nn.UPDATE,this.gameReaderOptions),this}get gameReaderOptions(){return{...{closeButtonPosition:this.commonOptions.closeButtonPosition,closeButton:this.commonOptions.closeButton,loader:this.commonOptions.loader,forceDesktopMode:this.commonOptions.forceDesktopMode},...this._gameReaderOptions}}}class dn{constructor(){}_storyLists=[];get storyLists(){return this._storyLists}addStoryList(e){this._storyLists.push(e)}updateStoryListById(e,t){const s=this._storyLists.findIndex((t=>t.mountSelector===e));this._storyLists[s]={...this._storyLists[s],...t}}removeStoryListById(e){const t=this._storyLists.findIndex((t=>t.mountSelector===e));this._storyLists.splice(t,1)}}class cn extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`),this.name="IasAppearanceManagerTypeofError"}}const hn=e=>{if(null==e||"object"!=typeof e)throw new cn(null==e?"null":typeof e)};class un extends t.EventEmitter{_mountSelector;_appearanceManager;params;app;storyListManager=new dn;_ugcCardClickHandler=()=>{};_api;constructor(e,t,s,i){super(),this._mountSelector=e,this._appearanceManager=t,this.params=s,this.app=i,hn(t),this.storyListManager.addStoryList(this),this.app.setStoryList(this.storyListManager.storyLists).catch(console.error)}get mountSelector(){return this._mountSelector}get appearanceManager(){return this._appearanceManager}get type(){return Re.DEFAULT}get identityFields(){return{feedSlug:this.feedSlug}}get feedSlug(){return this.params.feed}get testKey(){return this.params.testKey}get useUgcCard(){return this.params.useUgcCard}set ugcCardClickHandler(e){this._ugcCardClickHandler=e}get ugcCardClickHandler(){return this._ugcCardClickHandler}set api(e){this._api=e}async reload(){return this._api?.reload()}destroy(){this.storyListManager.removeStoryListById(this.mountSelector),this.app.setStoryList(this.storyListManager.storyLists)}}class pn extends t.EventEmitter{_mountSelector;_appearanceManager;params;app;storyListManager=new dn;_ugcCardClickHandler=()=>{};_api;constructor(e,t,s,i){super(),this._mountSelector=e,this._appearanceManager=t,this.params=s,this.app=i,hn(t),this.storyListManager.addStoryList(this),this.app.setUGCStoryList(this.storyListManager.storyLists).catch(console.error)}get mountSelector(){return this._mountSelector}get appearanceManager(){return this._appearanceManager}get type(){return Re.UGC}get identityFields(){return{feedSlug:this.feedSlug}}get feedSlug(){return He}get testKey(){return this.params.testKey}get useUgcCard(){return this.params.useUgcCard}set api(e){this._api=e}set ugcCardClickHandler(e){this._ugcCardClickHandler=e}get ugcCardClickHandler(){return this._ugcCardClickHandler}async reload(){return this._api?.reload()}destroy(){this.storyListManager.removeStoryListById(this.mountSelector)}}var gn=_(1085),mn=_(2236),fn=_(9155),yn=_.n(fn);_(6704);window.__IAS__={storyManager:on};var vn=_(992),wn=_.n(vn),_n=_(2591),Sn=_.n(_n),bn=_(4289),xn={insert:"head",singleton:!1};Sn()(bn.A,xn);const Cn=bn.A.locals||{};var kn=_(7081),Mn={insert:"head",singleton:!1};Sn()(kn.A,Mn);const Ln=kn.A.locals||{},On=({onClick:e,className:t})=>(0,gn.jsx)("div",{className:wn()(Ln.icon,t),onClick:e,children:(0,gn.jsx)("svg",{viewBox:"0 0 24 24",children:(0,gn.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 In=_(5669),An={insert:"head",singleton:!1};Sn()(In.A,An);const En=In.A.locals||{},Tn=310/480,Rn=({desktopMode:e,children:t,verticalPadding:s,style:i,isWidescreen:r,className:a})=>{const[o,n]=(0,fn.useState)({width:"0px",height:"0px"});(0,fn.useEffect)((()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)})),[]);const l=()=>{const e=window.innerWidth,t=m(),s=e/window.innerHeight,i=c({aspectRatio:s,vh:t,vw:e}),r=d({aspectRatio:s,vh:t,vw:e});n({width:i,height:r})},d=({aspectRatio:e,vh:t,vw:s})=>{const i=p(e)||g();return e>Tn&&!i?`${u({vh:t,vw:s})}px`:"100%"},c=({aspectRatio:e,vh:t,vw:s})=>e>Tn&&!p(e)?`${h({aspectRatio:e,vh:t,vw:s})}px`:"auto",h=({aspectRatio:t,vh:s,vw:i})=>t>Tn&&!e?i:Math.ceil(s*Tn),u=({vh:t,vw:s})=>e?t:Math.ceil(s/Tn),p=e=>e>Tn&&e-Tn<=.1,g=()=>{let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches},m=()=>{let t=window.innerHeight;return e?(t-=s,t):t},f=r?{width:"100%",height:"100%"}:o;return(0,gn.jsx)("div",{className:wn()(En["aspect-ratio-box"],a,{[En["aspect-ratio-box--centered"]]:!r}),style:{...i,...f},children:(0,gn.jsx)("div",{className:En["aspect-ratio-box-inside"],children:t})})};var Pn=_(5757),Bn={insert:"head",singleton:!1};Sn()(Pn.A,Bn);const Dn=Pn.A.locals||{},jn=ne(),Fn=e=>{const[t,s]=(0,fn.useState)(!1),i=(0,fn.useCallback)((()=>{if(e.desktopMode)return;const t=jn.type!==e.orientation;e.onOrientationChange({type:jn.type,isWrong:t}),s(t)}),[e.desktopMode,e.orientation]);return(0,fn.useEffect)((()=>(i(),jn.addEventListener("change",i),()=>{jn.removeEventListener("change",i)})),[i]),t?(0,gn.jsx)("div",{className:Dn["screen-orientation-lock"]}):null};var Nn=_(8778),Un={insert:"head",singleton:!1};Sn()(Nn.A,Un);const zn=Nn.A.locals||{};var Vn=_(1196),Wn={insert:"head",singleton:!1};Sn()(Vn.A,Wn);const Gn=Vn.A.locals||{};let $n;function Hn(){let e,t;/ipad|iphone/i.test(navigator.userAgent)?(e=document.createRange(),$n&&e.selectNodeContents($n),t=window.getSelection(),t&&(t.removeAllRanges(),t.addRange(e)),$n&&$n.setSelectionRange(0,999999)):$n?.select()}const qn=e=>{!function(e){$n=document.createElement("textarea"),$n.value=e,document.body.appendChild($n)}(e),Hn(),document.execCommand("copy"),$n&&document.body.removeChild($n)},Qn=({shareText:e,shareLink:t,sharePanelOptions:s,onShareComplete:i})=>{const[r,a]=(0,fn.useState)(!1),[o,n]=(0,fn.useState)(!1),l=()=>{n(!0),!r&&e||i()};return(0,gn.jsxs)("div",{className:`${zn["share-panel__body"]} ${Gn["share-panel__body_screenshot"]}`,children:[(0,gn.jsx)("div",{className:`${zn["share-panel-row"]} ${Gn["share-panel-row"]}`,children:(0,gn.jsx)("a",{className:Gn["share-panel-row__image-link"],onClick:l,href:t,download:"image.jpeg",children:(0,gn.jsx)("img",{src:t,className:Gn["share-panel-row__image"]})})}),(0,gn.jsx)("div",{className:zn["share-panel-separator"],style:{background:s.divider?.background}}),(0,gn.jsx)("div",{className:`${zn["share-panel-row"]} ${Gn["share-panel-row"]}`,children:(0,gn.jsx)("a",{className:Gn["share-item__download-button"],onClick:l,href:t,download:"image.jpeg",children:(0,gn.jsx)("div",{dangerouslySetInnerHTML:{__html:s.downloadButton?.svgSrc?.baseState??""}})})}),e?(0,gn.jsxs)(gn.Fragment,{children:[(0,gn.jsx)("div",{className:zn["share-panel-separator"],style:{background:s.divider?.background}}),(0,gn.jsx)("div",{className:`${zn["share-panel-row"]} ${Gn["share-panel-row"]}`,children:(0,gn.jsxs)("button",{className:wn()(Gn.btn,Gn["btn-copy"]),onClick:()=>{qn(e??""),a(!0),o&&i()},children:[(0,gn.jsxs)("div",{className:Gn["btn-copy__icon"],children:[(0,gn.jsx)("span",{className:wn()(Gn["btn-copy__icon-state"],{[Gn["btn-copy__icon-state_default"]]:!r}),dangerouslySetInnerHTML:{__html:s.copyButton?.svgSrc?.baseState??""}}),(0,gn.jsx)("span",{className:wn()(Gn["btn-copy__icon-state"],{[Gn["btn-copy__icon-state_done"]]:r}),dangerouslySetInnerHTML:{__html:s.copyButton?.svgSrc?.doneState??""}})]}),(0,gn.jsx)("div",{className:Gn["btn-copy__text"],children:e})]})})]}):null]})};var Kn=_(610),Yn={insert:"head",singleton:!1};Sn()(Kn.A,Yn);const Zn=Kn.A.locals||{},Jn=({shareLink:e,sharePanelOptions:t,onShareComplete:s,...i})=>{const r=()=>{try{return new URL(e).host}catch(e){return console.error(e),null}},a=()=>{window.removeEventListener("focus",a),s()},o=()=>r()?"":encodeURIComponent(e),n=s=>{const i=(()=>{try{return new URL(e)}catch(e){return console.error(e),null}})();if(!i)return"#";const r=t.targetParams?.[s];return r?.getUrl?.({url:i.toString(),text:o()})},l=t.title?.favicon,d=t.text;return(0,gn.jsxs)("div",{className:zn["share-panel__body"],children:[(0,gn.jsxs)("div",{className:`${zn["share-panel-row"]} ${zn["title-row"]}`,children:[r()&&Boolean(l?.display)&&(0,gn.jsx)("div",{className:zn["share-url-favicon"],style:{background:l?.background},children:(0,gn.jsx)("img",{src:`${i.faviconApiUrl??"https://favicon.inappstory.ru"}?sz=64&domain_url=${r()}`})}),(0,gn.jsx)("span",{className:zn.title,style:d,children:t.title?.getValue?.({url:e,text:o()})})]}),(0,gn.jsx)("div",{className:zn["share-panel-separator"],style:{background:t.divider?.background}}),(0,gn.jsx)("div",{className:`${zn["share-panel-row"]} ${Zn["social-list"]}`,children:t.targets?.map(((e,s)=>{const i=t.targetParams?.[e],r=i?.icon?.svgSrc.baseState??"<svg></svg>";return(0,gn.jsx)("div",{className:Zn["social-list__item"],children:(0,gn.jsxs)("a",{href:n(e),onClick:()=>((e,t,s)=>{window.addEventListener("focus",a),window.open(e,t,s)})(n(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${zn["share-item"]} ${Zn["share-item"]}`,children:[(0,gn.jsx)("div",{dangerouslySetInnerHTML:{__html:r}}),(0,gn.jsx)("span",{className:zn["share-item-title"],style:d,children:i?.label})]})},s)}))}),(0,gn.jsx)("div",{className:zn["share-panel-separator"],style:{background:t.divider?.background}}),(0,gn.jsx)("div",{className:zn["share-panel-row"],children:(0,gn.jsxs)("a",{className:`${zn["share-item"]} ${Zn["share-item"]}`,onClick:()=>{qn(e),s()},children:[(0,gn.jsx)("div",{dangerouslySetInnerHTML:{__html:t.copyButton?.svgSrc?.baseState??""}}),(0,gn.jsx)("span",{className:zn["share-item-title"],style:d,children:t.copyButton?.label})]})})]})};var Xn;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(Xn||(Xn={}));const el=({shareType:e,shareLink:t,shareText:s,onShareCompelete:i,sharePanelOptions:r,className:a})=>{const{dir:o}=Ac(),[n,l]=(0,fn.useState)(!1),[d,c]=(0,fn.useState)(!0),h=()=>{l(!0),c(!1)};return(0,gn.jsxs)("div",{dir:o,className:wn()(zn["share-panel-wrapper"],a),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,gn.jsx)("div",{className:wn()(zn["share-panel-backdrop"],{[zn.fadeIn]:d,[zn.fadeOut]:!d}),onClick:()=>{l(!1),c(!1)}}),(0,gn.jsxs)("div",{className:wn()(zn["share-panel"],{[zn.slideIn]:d,[zn.slideOut]:!d}),onAnimationEnd:()=>{d||i(n)},style:{"--height":"100%",background:r.background,borderTopLeftRadius:r.borderRadius+"px",borderTopRightRadius:r.borderRadius+"px"},children:[e===Xn.SlideScreenshot&&(0,gn.jsx)(Qn,{shareText:s,shareLink:t,onShareComplete:h,sharePanelOptions:r}),e===Xn.Social&&(0,gn.jsx)(Jn,{shareLink:t,onShareComplete:h,sharePanelOptions:r}),(0,gn.jsx)("div",{className:zn["share-panel-separator"]})]})]})};var tl=_(7495),sl={insert:"head",singleton:!1};Sn()(tl.A,sl);const il=tl.A.locals||{},rl=e=>{const t=(0,fn.useRef)(null),[s,i]=(0,fn.useState)(null);return(0,fn.useEffect)((()=>{const s=e.plugin.createLottiePlayer(t.current,e.config);return i(s),()=>{s.destroy()}}),[e.config.sha1]),(0,fn.useEffect)((()=>{s&&e.forceEnd&&s.stop()}),[s,e.forceEnd]),(0,fn.useEffect)((()=>{if(s)return s.on("play",e.onPlay),s.on("complete",e.onComplete),s.on("beforeLoad",e.onBeforeLoad),s.on("load",e.onLoad),s.on("minPlayingTimeExpired",e.onMinPlayingTimeExpired),s.on("error",e.onError),()=>{s.off("play",e.onPlay),s.off("complete",e.onComplete),s.off("beforeLoad",e.onBeforeLoad),s.off("load",e.onLoad),s.off("minPlayingTimeExpired",e.onMinPlayingTimeExpired),s.off("error",e.onError)}}),[s,e.onError,e.onPlay,e.onComplete,e.onLoad,e.onBeforeLoad,e.onMinPlayingTimeExpired]),(0,gn.jsx)("canvas",{ref:t,style:{width:"100%",height:"100%"}})},al=e=>{const{storyManager:t}=Ac(),[s,i]=(0,fn.useState)(!1),[r,a]=(0,fn.useState)(!1),[o,n]=(0,fn.useState)(!1),[l,d]=(0,fn.useState)(!1),[c,h]=(0,fn.useState)(!1),[u,p]=(0,fn.useState)(!1),g=r||l||e.isGameLoading||!e.gameShouldBeShown,m=(0,fn.useMemo)((()=>t.getPlugin("dot-lottie")),[t]),f=o||!m||e.isGameLoadingError?null:e.game?.splashLottieScreen?.url&&e.game?.splashLottieScreen,y=e.game&&!e.isGameLoadingError&&g&&!r&&!f,v=()=>e.desktopMode&&e.game?.splashLandscapeScreen?.url?e.game.splashLandscapeScreen.url:e.game?.splashScreen?.url,w=e.isGameInited&&(!f||c);(0,fn.useEffect)((()=>{w&&e.onSplashCanBeHidden()}),[w]);return(0,gn.jsxs)("div",{className:wn()(il["splash-container"],{[il["splash-container--fadeIn"]]:e.game,[il["splash-container--fadeOut"]]:e.gameShouldBeShown,[il["splash-container--isLoading"]]:y}),children:[(0,gn.jsx)("div",{className:il["splash-container__image"],style:{backgroundColor:e.splashImageBackgroundColor},children:v()&&(0,gn.jsx)("img",{src:v(),onLoad:()=>{p(!0)}})}),f&&m&&(0,gn.jsx)("div",{className:il["splash-container__lottie"],children:(0,gn.jsx)(rl,{plugin:m,forceEnd:e.gameShouldBeShown,config:f,onError:()=>{n(!0)},onPlay:()=>{a(!0),i(!1)},onComplete:()=>{a(!1),i(!0)},onLoad:()=>{d(!1)},onBeforeLoad:()=>{d(!0)},onMinPlayingTimeExpired:()=>{h(!0)}})})]})};var ol=_(9843),nl={insert:"head",singleton:!1};Sn()(ol.A,nl);const ll=ol.A.locals||{},dl=e=>(0,gn.jsx)("button",{dir:e.dir,onClick:e.onCloseGame,className:ll["close-btn"],"data-position":e.closeButtonPosition,dangerouslySetInnerHTML:{__html:e.closeButtonOptions?.svgSrc.baseState??""}});var cl=_(5299),hl=_(9514);const ul=(0,cl.observer)((({gameReader:e})=>{const{desktopMode:t,dir:s,gameReaderOptions:i,storyReaderOptions:r}=Ac(),a=(0,fn.useRef)(null),{sharePanelOpeningParams:o,handleShareComplete:n,closeSharePanel:l}=(e=>{const[t,s]=(0,fn.useState)(null);return(0,fn.useEffect)((()=>(e?.on("openSharePanel",s),()=>{e?.off("openSharePanel",s)})),[e]),{sharePanelOpeningParams:t,handleShareComplete:i=>{t&&e&&(e.confirmSharingComplete({shareId:t.shareId,isSuccess:i}),s(null))},closeSharePanel:()=>{s(null)}}})(e);Pc((()=>{d()}));const d=()=>{e.closeGame(),l()},{gameLaunch:c,gameLaunchError:h,isGameLoading:u,closeBtnVisible:p}=e,g=wn()(Cn["game-reader"],{[Cn["game-reader--desktop-mode"]]:t,[Cn["game-reader--widescreen"]]:e.isWidescreen}),m={background:i.backdrop?.background??"",opacity:i.backdrop?.opacity??0,filter:i.backdrop?.blur?`blur(${i.backdrop.blur}px)`:"none"},f=i.game?.backdropColor??"";return(0,hl.createPortal)((0,gn.jsx)("div",{className:Cn["game-reader-container"],style:{"--game-box-border-radius":`${parseFloat(String(i.borderRadius))}px`},children:(0,gn.jsxs)("div",{className:g,children:[(0,gn.jsx)("div",{className:Cn["game-reader__backdrop"],style:m}),(0,gn.jsxs)(Rn,{className:Cn["game-reader__game-box"],isWidescreen:e.isWidescreen,desktopMode:t,verticalPadding:100,children:[(0,gn.jsx)(al,{onSplashCanBeHidden:()=>{e.notifyGameCanBeStarted()},desktopMode:t,isGameInited:e.isGameInited,isGameLoading:u,isGameLoadingError:Boolean(e.gameLaunchError),gameShouldBeShown:e.gameShouldBeShown,game:e.gameLaunch??void 0,splashImageBackgroundColor:e.gameLaunch?f:m.background}),h&&(0,gn.jsx)(On,{className:Cn["game-reader__refresh-btn"],onClick:()=>{e.reload()}}),(!e.gameShouldBeShown||p)&&(0,gn.jsx)(dl,{closeButtonPosition:i.closeButtonPosition,dir:s,onCloseGame:d,closeButtonOptions:i.closeButton}),c&&(0,gn.jsxs)(gn.Fragment,{children:[(0,gn.jsx)("iframe",{src:c.url,onLoad:t=>{a.current=t.target,e.dir=s,e.setGameCenterIframe(a.current)},style:{opacity:e.gameShouldBeShown?1:0},frameBorder:"0",className:Cn["game-reader__iframe"],sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),o&&(0,gn.jsx)(el,{shareType:o.shareType,shareLink:o.shareLink,onShareCompelete:n,sharePanelOptions:r.sharePanel})]})]}),c&&i.forceCheckOrientation&&(0,gn.jsx)(Fn,{orientation:le.PORTRAIT_PRIMARY,desktopMode:t,onOrientationChange:({isWrong:t})=>{e.isGameInited&&(t?e.pauseGameUI():e.resumeGameUI())}})]})}),document.body)}));var pl=_(2130),gl={insert:"head",singleton:!1};Sn()(pl.A,gl);const ml=pl.A.locals||{};class fl{storyReaderViewModel;storiesViewer;backdropRef;deltaValY=0;windowHeight=0;swipeUpGestureInAction=!1;constructor(e,t,s){this.storyReaderViewModel=e,this.storiesViewer=t,this.backdropRef=s}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(){this.storyReaderViewModel.resumeTimer(),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 s=100*this.deltaValY*.45;s<=0&&(s=0),this.storiesViewer.style.setProperty("transform",`scale(${t}) translateY(${s}%)`)}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("swipeDown")}),400)}handleSwipeDown(){this.deltaValY<=.15||!this.storyReaderViewModel.canBeClosed()?this.returnToDefaultState():this.closeStoryReader()}}ne();const yl=()=>{const e=window.innerWidth;return{vh:window.innerHeight,vw:e}},vl=e=>50+parseFloat(String(e)),wl=(e,t)=>{const s=e.hasLike&&Boolean(t.hasLike),i=e.hasShare&&Boolean(t.hasShare),r=e.hasFavorite&&Boolean(t.hasFavorite),a=e.hasAudio;return!e.isBlank&&(s||r||i||a)},_l=e=>{const{desktopMode:t,storyReaderOptions:s}=Ac();return(0,fn.useMemo)((()=>{const i=vl(s.actionPanelBottomOffset),r=new Gr(e.vw,e.vh,i),a=new Wr(r).create({vw:e.vw,vh:e.vh,desktopMode:t}),o=a instanceof Vr,n=o?r.getViewportCorrectionPadding():{};return{actionPanelHeight:i,safeAreaFrameCalculator:r,storyGeometry:a,isMobileGeometry:o,correctionPaddingStyle:n}}),[s.actionPanelBottomOffset,e,t])},Sl=(0,cl.observer)((e=>{const t=(0,fn.useRef)(null),s=(0,fn.useRef)(null),{desktopMode:i,storyReaderOptions:r}=Ac();(({storyReaderViewModel:e,storiesViewerRef:t,backdropRef:s})=>{const i=(0,fn.useRef)(null);(0,fn.useEffect)((()=>{i.current=new fl(e,t.current,s.current)}),[]);const r=()=>{t.current.classList.add(ml["no-select"]),i.current?.startMove()},a=({dy:e})=>{i.current?.move(e)},o=()=>{t.current.classList.remove(ml["no-select"]),e.touchController.verticalSwipeGesture&&i.current?.endMove()};(0,fn.useEffect)((()=>{const t=e.touchController;return t.on(Mi.TouchStart,r),t.on(Mi.TouchMoveVertical,a),t.on(Mi.TouchEnd,o),()=>{t.off(Mi.TouchStart,r),t.off(Mi.TouchMoveVertical,a),t.off(Mi.TouchEnd,o)}}),[e.touchController])})({storyReaderViewModel:e.storyReader,backdropRef:t,storiesViewerRef:s});const{safeAreaFrameCalculator:a,isMobileGeometry:o}=_l(e.viewport),n=!o||a.shouldBeShownSafeAreaInsets?parseFloat(String(r.borderRadius)):0;return(0,gn.jsxs)(gn.Fragment,{children:[(0,gn.jsxs)("div",{ref:s,className:wn()("stories-viewer",ml["stories-viewer"],ml.slider3d),style:{"--loaderBackgroundColor":r.loader?.default.color,"--loaderBackgroundAccentColor":r.loader?.default.accentColor,"--timelineBlockTopOffset":`${parseFloat(String(r.timelineBlockTopOffset))}px`,"--slideBorderRadius":`${n}px`,backgroundColor:r.commonBackdrop?.color??void 0,backdropFilter:r.commonBackdrop?.backdropFilter??void 0},children:[i&&(0,gn.jsx)("div",{className:ml["stories-viewer-background"],style:(()=>{const t=[],s=e.storyReader.activeStory?.displayedSlideImage;return null!=r.slideBackdrop&&Array.isArray(r.slideBackdrop.linearGradientOverlay)&&t.push(`linear-gradient(${r.slideBackdrop.linearGradientOverlay.join(", ")})`),null!=s&&t.push(`url(${s})`),{backgroundImage:t.join(", "),opacity:r.slideBackdrop?.opacity||0,filter:r.slideBackdrop?.blur?`blur(${r.slideBackdrop.blur}px)`:"none"}})()}),e.children]}),(0,gn.jsx)("div",{ref:t,className:wn()(ml["stories-viewer-backdrop"],{[ml._desktopMode]:i})})]})}));var bl=_(3390),xl={insert:"head",singleton:!1};Sn()(bl.A,xl);const Cl=bl.A.locals||{};var kl=_(2594),Ml={insert:"head",singleton:!1};Sn()(kl.A,Ml);const Ll=kl.A.locals||{};var Ol=_(187),Il={insert:"head",singleton:!1};Sn()(Ol.A,Il);const Al=Ol.A.locals||{},El=(0,cl.observer)((({story:e,commonOptions:t,storyReaderOptions:s,muted:i,onClickMuteAction:r})=>{const{dir:a}=Ac(),o=e.hasLike&&Boolean(t.hasLike),n=e.hasShare&&Boolean(t.hasShare),l=e.hasFavorite&&Boolean(t.hasFavorite),d=e.hasAudio,c=wl(e,t)?vl(s.actionPanelBottomOffset):0;return(0,gn.jsx)("div",{dir:a,className:Al["stories-button-panel"],style:{height:`${c}px`,transform:`translateY(${c}px)`},children:wl(e,t)&&(0,gn.jsxs)("div",{className:Al["stories-button-panel-actions"],children:[(()=>{if(!o)return null;const t=0===e.like||-1===e.like,i=0===e.like||1===e.like;return(0,gn.jsxs)("span",{children:[(0,gn.jsx)("span",{className:wn()(Al["button-panel-action"],{"like-up":t,"like-up-filled":1===e.like}),dangerouslySetInnerHTML:{__html:t?s.likeButton.svgSrc.baseState:s.likeButton.svgSrc.activeState},onClick:()=>{e.setLike(1===e.like?0:1)}}),(0,gn.jsx)("span",{className:wn()(Al["button-panel-action"],{"like-down":i,"like-down-filled":-1===e.like}),dangerouslySetInnerHTML:{__html:i?s.dislikeButton.svgSrc.baseState:s.dislikeButton.svgSrc.activeState},onClick:()=>{e.setDislike(-1===e.like?0:-1)}})]})})(),l&&(0,gn.jsx)("span",{children:(0,gn.jsx)("span",{className:wn()(Al["button-panel-action"],{bookmark:!e.favorite,"bookmark-filled":e.favorite}),dangerouslySetInnerHTML:{__html:e.favorite?s.favoriteButton.svgSrc.activeState:s.favoriteButton.svgSrc.baseState},onClick:()=>e.setBookmark(!e.favorite)})}),(0,gn.jsxs)("span",{className:Al["right-container"],children:[d&&(0,gn.jsx)("span",{children:(0,gn.jsx)("span",{className:wn()(Al["button-panel-action"],{"muted-icon":i,"sound-icon":!i}),dangerouslySetInnerHTML:{__html:i?s.muteButton.svgSrc.baseState:s.muteButton.svgSrc.activeState},onClick:r})}),n&&(0,gn.jsx)("span",{className:Al["button-panel-action"],dangerouslySetInnerHTML:{__html:s.shareButton.svgSrc.baseState},onClick:()=>{e.share()}})]})]})})}));var Tl=_(2349),Rl={insert:"head",singleton:!1};Sn()(Tl.A,Rl);const Pl=Tl.A.locals||{},Bl=e=>{const{dir:t}=Ac();return(0,gn.jsx)("div",{className:Pl["story-header"],children:!e.closeDisabled&&(0,gn.jsx)("button",{dir:t,"data-position":e.options.closeButtonPosition,className:wn()(Pl["stories-viewer__close"],{[Pl["_paused-ui"]]:e.uiPaused}),onClick:t=>{t.stopPropagation(),t.preventDefault(),e.onClose()},dangerouslySetInnerHTML:{__html:e.options.closeButton?.svgSrc.baseState??""}})})};var Dl=_(3278),jl={insert:"head",singleton:!1};Sn()(Dl.A,jl);const Fl=Dl.A.locals||{};var Nl=_(6323),Ul={insert:"head",singleton:!1};Sn()(Nl.A,Ul);Nl.A.locals;const zl=e=>{const t=e.slide,{slideContentRef:s}=(({slide:e,activeStory:t,currentStory:s,needSlideInitByFlipping:i,currentSlideIndex:r,activeSlideIndex:a,slidesLoaded:o,muted:n,timerPaused:l})=>{const d=(0,fn.useRef)(null),c=t.id===s.id,h=c||i,u=a===r,p=h&&o&&e.state===or.Idle&&u,g=!(e.state!==or.Started&&e.state!==or.Error||u&&h),m=c&&u&&e.state===or.Loaded;return(0,fn.useLayoutEffect)((()=>{p&&e.init(d.current)}),[e,p]),(0,fn.useLayoutEffect)((()=>{m&&e.start()}),[c,m]),(0,fn.useLayoutEffect)((()=>{g&&e.stop()}),[g]),(0,fn.useEffect)((()=>{l?e.pause():e.resume()}),[e,l,e.state]),(0,fn.useEffect)((()=>{n?e.mute():e.unmute()}),[e,n,e.state]),(0,fn.useLayoutEffect)((()=>()=>{e.stop()}),[e]),{slideContentRef:d}})(e),i=t.state===or.Loading||!e.slidesLoaded,r=t.state===or.Loading||!e.slidesLoaded;return{slideContentRef:s,needLoadingMask:i,isVisible:t.state===or.Loaded||t.state===or.Started||t.state===or.Paused,needLoadingAnimation:r}},Vl=(0,cl.observer)((({geometry:e,...t})=>{const{desktopMode:s,dir:i}=Ac(),{slideContentRef:r,needLoadingAnimation:a,needLoadingMask:o}=zl(t),{slideStyle:n,slideContentStyle:l,needBottomPanel:d}=(({geometry:e,currentStory:t})=>{const{storyReaderOptions:s,commonOptions:i}=Ac(),r=(0,fn.useMemo)((()=>wl(t,i)),[t,i]),a=r?vl(s.actionPanelBottomOffset):0;return{needBottomPanel:r,slideStyle:(0,fn.useMemo)((()=>({margin:e.getOffset(a),width:e.getWidth(),height:e.getHeight(),"--y-offset":e.getOffsetY(a),"--x-offset":e.getOffsetX(a)})),[a,e]),slideContentStyle:(0,fn.useMemo)((()=>({fontSize:e.getFontSize()})),[e])}})({geometry:e,currentStory:t.currentStory}),c=t.networkError||t.slide.state===or.Error;return(0,gn.jsxs)("div",{onClick:r=>{r.preventDefault(),r.stopPropagation(),t.clickDisabled||(r=>{const a=r.target,o=new ar(t.slide,r,e,i,s);t.slide.onClick(a,o)})(r)},className:wn()(Fl["stories-slide"],{[Fl["active-slide"]]:t.currentSlideIndex===t.activeSlideIndex,[Fl["_with-bottom-panel"]]:d,[Fl["_desktop-mode"]]:e instanceof zr}),children:[(0,gn.jsx)("div",{className:Fl["stories-slide-offset"],style:n,children:(0,gn.jsx)("div",{className:Fl["stories-slide-box"],"data-testid":"stories-slide-box",children:(0,gn.jsx)("div",{ref:r,dangerouslySetInnerHTML:{__html:t.slide.html},className:`${Fl["stories-slide-content"]} narrative-slide"`,style:l})})}),(o||c)&&(0,gn.jsx)("div",{className:Fl["load-mask"],onClick:e=>{e.preventDefault()},children:c?(0,gn.jsx)(On,{className:Fl["stories-slide__refresh-btn"],onClick:e=>{e.stopPropagation(),t.networkError?t.onReloadStory():t.slide.reload()}}):a&&(0,gn.jsx)("div",{className:Fl["loading-spinner-default"]})})]})}));var Wl=_(9137),Gl={insert:"head",singleton:!1};Sn()(Wl.A,Gl);const $l=Wl.A.locals||{},Hl=(0,fn.forwardRef)(((e,t)=>{const{desktopMode:s,dir:i}=Ac();return(0,gn.jsx)("div",{ref:t,dir:i,className:wn()($l["stories-pager"],{[$l["_desktop-mode"]]:s,[$l["_paused-ui"]]:e.uiPaused}),style:{"--stories-pager-tick-foreground":e.timeline.foreground,"--stories-pager-background":e.timeline.background},children:(0,gn.jsx)("div",{className:`${$l["stories-pager__ticks"]} ${wn()({[$l.hiddenTimeline]:e.hiddenTimeline})}`,children:new Array(e.slidesLength).fill(0).map(((t,s)=>(0,gn.jsxs)("div",{className:$l["stories-pager__tick"],children:[(0,gn.jsx)("div",{className:wn()($l["stories-pager__tick-progress"],{[$l._active]:s+1<=e.activeSlideIndex})}),(0,gn.jsx)("div",{className:$l["stories-pager__tick-progress-loader"],style:{display:s+1===e.activeSlideIndex+1?"block":"none"}})]},s+1)))})})}));const ql=function(){let e;const t=document.createElement("div"),s={transition:"transitionend",OTransition:"otransitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&void 0!==t.style[e])return s[e]}();function Ql(e,t,s){return new Promise((i=>{let r=!1;const a=()=>{r=!0,clearTimeout(n),void 0!==ql&&e.removeEventListener(ql,o),e.style.setProperty("transition",`${t} 0ms`),i()},o=e=>{e.propertyName===t&&(r||a())};void 0!==ql&&e.addEventListener(ql,o,!1);const n=setTimeout((()=>{r||a()}),s+20);e.style.setProperty("transition",`${t} ${s}ms`)}))}var Kl=_(6212),Yl={insert:"head",singleton:!1};Sn()(Kl.A,Yl);const Zl=Kl.A.locals||{},Jl=e=>{const t=(0,fn.useRef)(null),s=(0,fn.useRef)(null),i=(0,fn.useRef)(0),r=(0,fn.useRef)(0);let a;const o=()=>{s.current&&(r.current=-1*function(e){const t=window.getComputedStyle(e),s=t.transform||t.webkitTransform||t.mozTransform;if("none"===s)return{x:0,y:0,z:0};const i=s.includes("3d")?"3d":"2d",r=s.match(/matrix.*\((.+)\)/)[1].split(", ");return"2d"===i?{x:isNaN(r[4])?0:r[4],y:isNaN(r[5])?0:r[5],z:0}:"3d"===i?{x:isNaN(r[12])?0:r[12],y:isNaN(r[13])?0:r[13],z:isNaN(r[14])?0:r[14]}:{x:0,y:0,z:0}}(s.current).x)},[n,l]=(0,fn.useState)(!1),[d,c]=(0,fn.useState)(!1),h=(0,fn.useRef)(!1),u=()=>{const t=fn.Children.count(e.children);return s.current&&t?s.current.scrollWidth/t:0};let p=!1;(0,fn.useEffect)((()=>(("ontouchstart"in window||window.navigator.msPointerEnabled||"ontouchstart"in document.documentElement)&&(p=!0),p||(s.current&&(a=s.current.children[0]?.offsetWidth),s.current&&(i.current=s.current.scrollWidth-s.current.clientWidth,o()),i.current===r.current?c(!1):c(!0),0===r.current?l(!1):l(!0)),()=>{})),[]);const g=(0,fn.useRef)(!1),m=(0,fn.useRef)(0);let f=0;const y=(0,fn.useRef)(!1),[v,w]=(0,fn.useState)(0),_=e=>{e<0&&(e=0),e>i.current&&(e=i.current),w(e)};(0,fn.useEffect)((()=>{v===i.current?c(!1):c(!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!==m.current){y.current=!0,f=t;const e=m.current-f,s=r.current+e;_(s)}}else y.current=!1},b=e=>{y.current&&e.preventDefault(),setTimeout((()=>{y.current=!1})),g.current=!1,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",b),document.removeEventListener("touchmove",S),document.removeEventListener("touchend",b)};return(0,gn.jsxs)("div",{className:Zl["scrolling-carousel"],style:e.style,children:[(0,gn.jsx)("div",{className:Zl["scrolling-carousel__wrapper"],ref:t,onMouseDown:e=>{h.current||(e.preventDefault(),g.current=!0,m.current=e.pageX,s.current&&(i.current=s.current.scrollWidth-s.current.clientWidth),s.current&&o(),document.addEventListener("mousemove",S),document.addEventListener("mouseup",b))},onTouchStart:e=>{h.current||(e.preventDefault(),g.current=!0,m.current=e.touches&&e.touches[0].pageX,s.current&&(i.current=s.current.scrollWidth-s.current.clientWidth),s.current&&o(),document.addEventListener("touchmove",S),document.addEventListener("touchend",b))},onClickCapture:e=>{y.current&&(e.preventDefault(),e.stopPropagation())},children:(0,gn.jsx)("div",{className:Zl["scrolling-carousel__item"],ref:s,style:{transform:`translateX(${-1*v}px)`},children:e.children})}),!p&&(0,gn.jsxs)(gn.Fragment,{children:[(0,gn.jsx)("div",{className:wn()(Zl["scrolling-carousel__arrow-button"],Zl["scrolling-carousel__arrow-button--left"],{[Zl["scrolling-carousel__arrow-button--show"]]:n}),onClick:async()=>{if(h.current)return;o();const e=r.current-u();_(e),h.current=!0,s.current&&await Ql(s.current,"transform",300),h.current=!1},children:(0,gn.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,gn.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),(0,gn.jsx)("div",{className:wn()(Zl["scrolling-carousel__arrow-button"],Zl["scrolling-carousel__arrow-button--right"],{[Zl["scrolling-carousel__arrow-button--show"]]:d}),onClick:async()=>{if(h.current)return;o();const e=r.current+u();_(e),h.current=!0,s.current&&await Ql(s.current,"transform",300),h.current=!1},children:(0,gn.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,gn.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})})]})]})},Xl=({children:e,style:t,color:s,font:i,className:r})=>(0,gn.jsx)("div",{className:r,style:{color:s,font:i,...t},children:e});var ed=_(9108),td={insert:"head",singleton:!1};Sn()(ed.A,td);const sd=ed.A.locals||{},id=({goods:e,onClick:t,options:s})=>{const{imgSrc:i,title:r,subTitle:a,price:o,oldPrice:n}=e;return(0,gn.jsxs)("div",{className:wn()(sd["goods-card"]),style:{color:s.mainTextColor??"black"},onClick:t,children:[(0,gn.jsx)("div",{className:wn()(sd.figure),style:{borderRadius:s.imageCornerRadius+"px",backgroundColor:s.imageBackgroundColor},children:i&&(0,gn.jsx)("img",{src:i,alt:r,style:{borderRadius:s.imageCornerRadius+"px",backgroundColor:s.imageBackgroundColor}})}),(0,gn.jsx)(Xl,{font:s.subtitleFont,children:a}),(0,gn.jsx)(Xl,{font:s.titleFont,children:r}),(0,gn.jsxs)("div",{className:sd.prices,children:[(0,gn.jsx)(Xl,{font:s.priceFont,children:o}),(0,gn.jsx)(Xl,{className:sd["typography--old-price"],font:s.oldPriceFont,color:s.oldPriceTextColor,children:n})]})]})},rd=e=>{const t=e.goodsWidgetOptions,s=t.goodsWidgetRenderingType||t.goodsList.renderingType;let i=[];return s===a.DEFAULT?i=e.goodsList.map(((s,i)=>(0,gn.jsx)(id,{options:t.goodsCard,goods:s,onClick:()=>e.onGoodsCardClick(s)},i))):s===a.CUSTOM_CARD&&R()(t.getCardHtml)&&(i=e.goodsList.map(((s,i)=>(0,gn.jsx)("div",{dangerouslySetInnerHTML:{__html:t.getCardHtml?.(s,i)??""},onClick:()=>e.onGoodsCardClick(s)},i)))),(0,gn.jsx)(Jl,{style:{marginTop:"-15px"},children:i})},ad=({arrowColor:e,...t})=>(0,gn.jsx)("svg",{...t,width:"32",height:"12.5",viewBox:"0 0 64 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,gn.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:e})});var od=_(8161),nd={insert:"head",singleton:!1};Sn()(od.A,nd);const ld=od.A.locals||{},dd=({closeImage:e,arrowColor:t,onClick:s})=>(0,gn.jsx)("div",{className:ld.btn,onClick:s,onTouchStart:s,children:e?(0,gn.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}):(0,gn.jsx)(ad,{arrowColor:t})});var cd=_(1277),hd={insert:"head",singleton:!1};Sn()(cd.A,hd);const ud=cd.A.locals||{},pd=({isLoading:e,backgroundColor:t="white",accentBackgroundColor:s="transparent"})=>e?(0,gn.jsx)("div",{className:ud.spinner,style:{border:`solid 2px ${t}`,borderColor:`${s} ${t} ${t} ${t}`}}):null;var gd=_(4940),md={insert:"head",singleton:!1};Sn()(gd.A,md);const fd=gd.A.locals||{};var yd;!function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"}(yd||(yd={}));const vd=({open:e,url:t,goodsWidgetOptions:s,onClosed:i,onClose:r,onGoodsCardClick:a})=>{const o=(0,fn.useRef)(null),[n,l]=(0,fn.useState)([]),[d,c]=(0,fn.useState)(yd.IN),h=s,{dimColor:u,substrateHeight:p,substrateColor:g,closeImage:m,closeBackgroundColor:f}=h.goodsList;(0,fn.useEffect)((()=>{c(e?yd.IN:yd.OUT)}),[e]),(0,fn.useEffect)((()=>{t&&y()}),[t]);const y=async()=>{const e=v(),t=await s.openGoodsWidgetHandler(e);l(t)},v=()=>{try{return JSON.parse(t).map((e=>({sku:e,title:"",subTitle:"",price:"",oldPrice:"",rawData:{}})))}catch(e){return console.error(e),[]}};(0,fn.useEffect)((()=>{const e=o.current;if(d===yd.OUT)return e.addEventListener("animationend",i),()=>{e.removeEventListener("animationend",i)}}),[d]);const w=h.loader.custom?(0,gn.jsx)("div",{dangerouslySetInnerHTML:{__html:h.loader.custom}}):(0,gn.jsx)(pd,{isLoading:!n,backgroundColor:h.loader.default.color,accentBackgroundColor:h.loader.default.accentColor});return(0,gn.jsxs)("div",{className:wn()(fd["goods-container"],{[fd["goods-container--visible"]]:d===yd.IN,[fd["goods-container--hidden"]]:d===yd.OUT}),ref:o,children:[(0,gn.jsx)("div",{className:wn()(fd["goods-container__backdrop"]),style:{backgroundColor:u},onClick:r}),(0,gn.jsxs)("div",{className:wn()(fd["goods-container"]),style:{height:p+"px",backgroundColor:g??"white"},children:[w,n&&(0,gn.jsx)(rd,{goodsList:n,onGoodsCardClick:a,goodsWidgetOptions:s}),(0,gn.jsx)(dd,{onClick:r,closeImage:m,arrowColor:f})]})]})};var wd=_(2913),_d={insert:"head",singleton:!1};Sn()(wd.A,_d);const Sd=wd.A.locals||{},bd=e=>{const[t,s]=(0,fn.useState)(!1),[i,r]=(0,fn.useState)(!1),{storyManager:a}=Ac(),o=()=>{r(!0),s(!0)},n=()=>{s(!1)};(0,fn.useEffect)((()=>(e.widget.on(tr.Open,o),()=>{e.widget.off(tr.Open,o)})),[e.widget]),(0,fn.useEffect)((()=>(fs.addListener("goodsWidget.close",n),()=>{fs.removeListener("goodsWidget.close",n)})),[]),(0,fn.useEffect)((()=>{t&&a.emit("widgetEvent",{name:"w-goods-open",data:{story_id:e.story.id,slide_index:e.story.activeSlideIndex,widget_id:e.widget.elementId}})}),[t]);return i?(0,gn.jsx)("div",{className:Sd["goods-widget-viewer"],children:(0,gn.jsx)(vd,{open:t,url:e.widget.targetUrl,goodsWidgetOptions:e.goodsWidgetOptions,onClose:()=>{s(!1)},onClosed:()=>{e.widget.close(),r(!1)},onGoodsCardClick:t=>{a.emit("widgetEvent",{name:"w-goods-click",data:{story_id:e.story.id,slide_index:e.story.activeSlideIndex,widget_id:e.widget.elementId,widget_value:t.sku}}),e.goodsWidgetOptions.itemClickHandler?.(t)}})}):null},xd={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 Cd{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 kd=e=>{switch(e){case"":default:return"text";case"tel":return"tel";case"email":return"email"}},Md=e=>{const[t,s]=(0,fn.useState)({countryCode:"",phone:""}),[i,r]=(0,fn.useState)(""),[a,o]=(0,fn.useState)(!0),n=s=>{const i=kd(e?.configV2.main.input.type??"");return"email"===i?Cd.isEmailValid(s):"tel"!==i||Cd.isTelephoneValid((()=>{const e=t.countryCode.substring(1);return e?xd[e]??"":""})(),t.phone)};return{value:i,telephone:t,isValid:a,handleTelephoneChange:e=>{s(e),e.phone.length>0?r(e.countryCode+e.phone):r("")},handleChange:e=>{r(e)},handleSubmit:e=>{const t=i.trim(),s=n(i);o(s),s&&e({value:t})},reset:()=>{o(!0),r(""),s({countryCode:"",phone:""})}}};var Ld=_(4169),Od={insert:"head",singleton:!1};Sn()(Ld.A,Od);const Id=Ld.A.locals||{},Ad=(0,fn.forwardRef)(((e,t)=>{const s=(0,fn.useRef)(null);return(0,fn.useEffect)((()=>{Q(s.current),s.current.focus()}),[]),(0,gn.jsx)("input",{type:"email",className:wn()(Id.input,Id.input_centered),placeholder:e.placeholder,value:e.value,ref:s,onChange:t=>e.onChange(t.target.value)})}));var Ed=_(2265),Td=_.n(Ed);const Rd=(0,fn.forwardRef)(((e,t)=>{const s=t=>{const s=t.target;s&&(s.value=s.value.replace(/\D/g,""),e.onChange({countryCode:e.value.countryCode,phone:s.value}))},i=e.value.countryCode.substring(1),r=i?xd[i]:"";return(0,gn.jsxs)("div",{className:Id["input-group"],children:[(0,gn.jsxs)("div",{className:Id["input-group__prepend"],children:[(0,gn.jsx)(Td(),{type:"tel",mask:"+999",maskChar:null,className:Id.input,onChange:t=>{e.onChange({countryCode:t.currentTarget.value,phone:e.value.phone})},value:e.value.countryCode,placeholder:"+",inputRef:e=>{e&&(e=>{setTimeout((()=>{Q(e),e.focus()}))})(e)}}),(0,gn.jsx)("div",{className:Id["input-group__separator"]})]}),r?(0,gn.jsx)(Td(),{type:"tel",className:Id.input,mask:r,maskChar:"-",alwaysShowMask:!0,placeholder:e.placeholder,inputRef:e=>{},value:e.value.phone,onChange:s}):(0,gn.jsx)("input",{type:"tel",className:Id.input,placeholder:e.placeholder,ref:e=>{},value:e.value.phone,onChange:s})]})})),Pd=(0,fn.forwardRef)(((e,t)=>{const s=(0,fn.useRef)(null),i=(0,fn.useRef)(null);(0,fn.useEffect)((()=>{i.current.dataset.replicatedValue=e.value,Q(s.current),s.current.focus(),s.current.setSelectionRange(e.value.length,e.value.length)}),[]);return(0,gn.jsx)("div",{className:Id["textarea-grow-wrap"],ref:i,style:e.style,children:(0,gn.jsx)("textarea",{className:Id.input,placeholder:e.placeholder,rows:1,ref:s,maxLength:e.maxLength,value:e.value,onChange:t=>e.onChange(t.target.value),onInput:e=>{i.current.dataset.replicatedValue=e.currentTarget.value}})})})),Bd=({form:e,config:t,...s})=>{const[i,r]=(0,fn.useState)(!0),{getMainStyle:a,getMainElementsStyle:o,getQuestionStyle:n,getInputWrapperStyle:l,getButtonStyle:d,getTextareaStyle:c}=(({config:e})=>{const t=t=>t*(e.size.viewportWidth/(e.size.viewportWidth/e.size.fontSize));return{getMainStyle:()=>{const s=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:`${s.background.color}`,border:`${s.border.visible&&`${t(s.border.width)}px solid ${s.border.color}`}`,borderRadius:`${t(s.border.radius)}px`}},getMainElementsStyle:()=>{const s=e.configV2.main;return{width:"100%",padding:`${t(s.padding.top)}px ${t(s.padding.right)}px ${t(s.padding.bottom)}px ${t(s.padding.left)}px`}},getQuestionStyle:()=>{const s=e.configV2.main.question;return{padding:`${t(s.padding.top)}px ${t(s.padding.right)}px ${t(s.padding.bottom)}px ${t(s.padding.left)}px`,color:`${s.text.color}`,fontSize:`${t(s.text.size)}px`,lineHeight:`${s.text.lineHeight}`,textAlign:`${s.text.align}`,fontFamily:`${s.text.type}`,fontWeight:`${s.text.weight}`,fontStyle:`${s.text.style}`}},getInputWrapperStyle:()=>{const s=e.configV2.main.input;let i=e.configV2.main.input.text.maxLines;return i=i>0?i:1,{padding:`${t(s.padding.top)}px ${t(s.padding.right)}px ${t(s.padding.bottom)}px ${t(s.padding.left)}px`,backgroundColor:`${s.background.color}`,border:`${t(s.border.width)}px solid ${s.border.color}`,borderRadius:`${t(s.border.radius)}px`,lineHeight:`${s.text.lineHeight}`,maxHeight:s.text.lineHeight*i+"em",fontSize:`${t(s.text.size)}px`,overflowY:"scroll",scrollbarWidth:"none"}},getButtonStyle:()=>{const s=e.configV2.main.button;return{padding:`${t(s.padding.top)}px ${t(s.padding.right)}px ${t(s.padding.bottom)}px ${t(s.padding.left)}px`,backgroundColor:`${s.background.color}`,border:`${t(s.border.width)}px solid ${s.border.color}`,color:`${s.text.color}`,fontSize:`${t(s.text.size)}px`,lineHeight:`${s.text.lineHeight}`,textAlign:`${s.text.align}`,fontFamily:`${s.text.type}`,fontWeight:`${s.text.weight}`,fontStyle:`${s.text.style}`}},getTextareaStyle:()=>{const s=e.configV2.main.input;return{color:`${s.text.color}`,fontSize:`${t(s.text.size)}px`,lineHeight:`${s.text.lineHeight}`,textAlign:`${s.text.align}`,fontFamily:`${s.text.type}`,fontWeight:`${s.text.weight}`,fontStyle:`${s.text.style}`}}}})({config:t}),h=Math.max(t.configV2.main.input.text.limit,0),u=String(t.configV2.main.input.text.placeholder).trim(),p=String(t.configV2.main.button.text.value).trim(),g=String(t.configV2.main.question.text.value).trim(),m=kd(t.configV2.main.input.type),f=({value:e})=>{s.onComplete({result:!0,value:e}),r(!1)};return(0,gn.jsxs)("div",{className:Id.wrapper,children:[(0,gn.jsx)("div",{className:wn()(Id.backdrop,{[Id.fadeIn]:i,[Id.fadeOut]:!i}),onAnimationEnd:()=>{i||s.onClose()},onClick:()=>{s.onComplete({result:!1,value:e.value}),r(!1)}}),(0,gn.jsxs)("div",{className:Id.main,style:a(),children:[(0,gn.jsxs)("div",{className:Id["main-elements"],style:o(),children:[(0,gn.jsx)("div",{className:Id.question,style:n(),children:g}),(0,gn.jsxs)("div",{className:wn()(Id["input-wrapper"],{[Id["is-invalid"]]:!e.isValid}),style:l(),children:["text"===m&&(0,gn.jsx)(Pd,{value:e.value,onChange:e.handleChange,style:c(),placeholder:u,maxLength:h}),"email"===m&&(0,gn.jsx)(Ad,{value:e.value,onChange:e.handleChange,placeholder:u}),"tel"===m&&(0,gn.jsx)(Rd,{value:e.telephone,onChange:e.handleTelephoneChange,placeholder:u})]})]}),e.value.trim().length>0&&(0,gn.jsx)("div",{className:Id["button-wrapper"],children:(0,gn.jsx)("button",{className:Id.button,style:d(),onClick:()=>e.handleSubmit(f),children:p})})]})]})},Dd=({storyGeometry:e,activeSlide:t,storyRef:s,storyReader:i})=>{const[r,a]=(0,fn.useState)(null),[o,n]=(0,fn.useState)(null),l=Md(o);(0,fn.useEffect)((()=>(fs.on(Hr.ShowInputModal,d),()=>{fs.off(Hr.ShowInputModal,d)})),[]);const d=({id:t,config:r})=>{i.pauseUI(),i.touchController.disable(),a(t),(t=>{t.size.fontSize=parseFloat(e.getFontSize()),t.size.viewportWidth=e.calculateWidth();const i=s.current.getBoundingClientRect();t.size.slideOffsetX=i.x,t.size.slideOffsetY=i.y,t.size.slideHeight=i.height,n(t)})(r)};return(0,fn.useLayoutEffect)((()=>()=>{l.reset()}),[r]),o?(0,gn.jsx)(Bd,{form:l,config:o,onComplete:e=>{if(!r)throw new Error;((e,s)=>{t.setUserData(e,s)})(r,e.result?e.value:""),i.resumeUI()},onClose:()=>{n(null),i.touchController.enable()}}):null},jd=(0,cl.observer)((({story:e,geometry:t,storyReader:s,className:i,...r})=>{const a=(0,fn.useRef)(null),o=(0,fn.useRef)(null);(({story:e,progressBarRef:t,nextFlippingStoryIndex:s,activeStory:i})=>{const r=e.timer,a=e===i,o=a&&-1===s;(0,fn.useEffect)((()=>{if(!a)return;const s=e=>{t.current?.style.setProperty("--tick",e+"%")},i=({forceEnd:t})=>{t||(e.reachEnd?e.nextStory("auto"):e.nextSlide())},o=()=>{t.current?.style.setProperty("--tick","0%")},n=()=>{t.current?.style.setProperty("--tick","0%")};return r.on("start",o),r.on("stop",n),r.on("progress",s),r.on("complete",i),()=>{r.off("start",o),r.off("progress",s),r.off("complete",i),r.off("stop",n)}}),[r,e,a]),(0,fn.useEffect)((()=>{o||r.stop()}),[o])})({activeStory:r.activeStory,story:e,nextFlippingStoryIndex:r.nextFlippingStoryIndex,progressBarRef:o});const n=r.index===r.nextFlippingStoryIndex,l=(0,fn.useMemo)((()=>e.activeSlide?.findWidgetByType("SwipeUpGoodsWidget")),[e.activeSlide?.state]),d=async()=>{try{await e.reload()}catch(e){console.error(e)}};return(0,gn.jsxs)("div",{ref:a,className:wn()(Ll["stories-item"],Ll.slider3d__item,i),onMouseDown:()=>{e.completeNativeSharing()},onTouchStart:()=>{e.completeNativeSharing()},"data-testid":"story",style:r.style,children:[(0,gn.jsx)(Bl,{closeDisabled:e.disableClose,options:r.storyReaderOptions,onClose:r.onClose,uiPaused:s.uiPaused}),e.activeSlide&&(0,gn.jsx)(Hl,{ref:o,hiddenTimeline:e.hiddenTimeline,slidesLength:e.slidesCount,timeline:e.activeSlide.timeline,activeSlideIndex:e.activeSlideIndex,uiPaused:s.uiPaused}),e.displayedSlides.map((i=>(0,gn.jsx)(Vl,{clickDisabled:r.slideClickDisabled,onReloadStory:d,activeSlideIndex:e.activeSlideIndex,currentSlideIndex:i.index,needSlideInitByFlipping:n,networkError:Boolean(e.error),currentStory:e,activeStory:r.activeStory,geometry:t,slide:i,slidesLoaded:e.slidesLoaded,timerPaused:s.timerPaused,muted:s.muted},i.html))),(0,gn.jsx)(El,{story:e,commonOptions:r.commonOptions,storyReaderOptions:r.storyReaderOptions,muted:s.muted,onClickMuteAction:()=>{s.muted?s.unmute():s.mute()}}),l&&r.activeStory===e&&(0,gn.jsx)(bd,{widget:l,story:e,goodsWidgetOptions:r.goodsWidgetOptions}),r.activeStory===e&&e.activeSlide&&(0,gn.jsx)(Dd,{storyRef:a,storyGeometry:t,activeSlide:e.activeSlide,storyReader:s})]})})),Fd=({className:e,style:t})=>(0,gn.jsx)("div",{className:wn()(Ll["stories-item"],e),style:t,children:(0,gn.jsx)("div",{className:`${Fl["stories-slide"]} ${Fl._dummy}`})});var Nd=_(9669),Ud={insert:"head",singleton:!1};Sn()(Nd.A,Ud);const zd=Nd.A.locals||{},Vd=({width:e,disabledByUI:t,navigationOptions:s,...i})=>{const{desktopMode:r,dir:a}=Ac(),o="ltr"===a,n=(o?i.isNextStoryBlank:i.isPrevStoryBlank)||t,l=(o?i.isPrevStoryBlank:i.isNextStoryBlank)||t;return(0,gn.jsxs)("div",{className:wn()([zd["story-reader-controls"]],{[zd._desktop_mode]:r}),children:[(0,gn.jsx)("div",{className:zd.slider3d__btn_next,style:{transform:`translateY(-50%) translateX(calc(${e/2}px + 100%))`},children:(0,gn.jsx)("button",{className:zd["btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),i.disabled||(o?i.onNext():i.onPrev())},disabled:n,dangerouslySetInnerHTML:{__html:s.nextButton.svgSrc.baseState}})}),(0,gn.jsx)("div",{className:zd.slider3d__btn_prev,style:{transform:`translateY(-50%) translateX(calc(-${e/2}px - 200%))`},children:(0,gn.jsx)("button",{className:zd["btn-icon"],onClick:e=>{e.stopPropagation(),e.preventDefault(),i.disabled||(o?i.onPrev():i.onNext())},disabled:l,dangerouslySetInnerHTML:{__html:s.prevButton.svgSrc.baseState}})})]})},Wd=e=>{const{storyReaderOptions:t}=Ac(),s=(0,fn.useRef)(null),i=(0,fn.useRef)(new er).current;(({slider:e,touchController:t})=>{const s=()=>{e?.startMove()},i=({dx:t})=>{e?.move(-t)},r=()=>{t.horizontalSwipeGesture&&e?.endMove()};(0,fn.useEffect)((()=>(t.on(Mi.TouchStart,s),t.on(Mi.TouchMoveHorizontal,i),t.on(Mi.TouchEnd,r),()=>{t.off(Mi.TouchStart,s),t.off(Mi.TouchMoveHorizontal,i),t.off(Mi.TouchEnd,r)})),[t])})({slider:i,touchController:e.touchController});const r=t.scrollStyle,a=e.stories;i.currentIndex=e.currentIndex;const o=e.touchController;(0,fn.useLayoutEffect)((()=>{const e=()=>{i.init({$el:s.current,transformStyle:r})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[a.length,r]),(0,fn.useLayoutEffect)((()=>{e.setAnimatedTransitionAdapter(new ba(i,{closeOnLastSlideByTimer:Boolean(t.closeOnLastSlideByTimer)}))}),[e,t.closeOnLastSlideByTimer]),(0,fn.useEffect)((()=>(i.on("transitionStart",l),i.on("transitionEnd",d),i.on("touchMove",n),i.on("touchEnd",c),()=>{i.off("transitionStart",l),i.off("transitionEnd",d),i.off("touchMove",n),i.off("touchEnd",c)})),[e]);const n=()=>{o.disable()},l=()=>{o.disable()},d=()=>{o.enable()},c=t=>{e.resumeTimer(),0===t?i.transformWithAmimation(0):e.navigateStoryWithAnimationByIndex(e.currentIndex+t,"swipe")};return{ref:s,api:i,perspective:i.perspective,depth:i.depth}},Gd=(0,cl.observer)((e=>{const{storyReaderOptions:t,commonOptions:s,goodsWidgetOptions:i}=Ac(),r=Wd(e.storyReader),{actionPanelHeight:a,safeAreaFrameCalculator:o,isMobileGeometry:n,storyGeometry:l,correctionPaddingStyle:d}=_l(e.viewport),c=e.storyReader.activeStory;return(0,gn.jsxs)(gn.Fragment,{children:[(0,gn.jsxs)("div",{className:wn()(Cl.slider3d__wrapper,{[Cl["slider3d__wrapper_swipe-up"]]:e.storyReader.closeGestureInAction,[Cl._desktop_mode]:!n}),style:{WebkitPerspective:`${r.perspective}px`,perspective:`${r.perspective}px`,width:l.getWidth(),backgroundColor:n&&o.shouldBeShownSafeAreaInsets&&"#000",...d},children:[(0,gn.jsx)("div",{className:Cl.slider3d__inner,style:{transform:`translateZ(-${r.depth}px)`},children:(0,gn.jsx)("div",{className:wn()(Cl["stories-face"],Cl.slider3d__rotater),ref:r.ref,children:e.storyReader.stories.map(((o,n)=>o.isBlank?(0,gn.jsx)(Fd,{style:{bottom:0}},o.id):(0,gn.jsx)(jd,{slideClickDisabled:e.storyReader.uiPaused||r.api.animating,index:n,story:o,activeStory:c,nextFlippingStoryIndex:e.storyReader.nextFlippingStoryIndex,geometry:l,style:{bottom:wl(o,s)?`${a}px`:0},commonOptions:s,storyReaderOptions:t,goodsWidgetOptions:i,onClose:e.onCloseStory,storyReader:e.storyReader},o.id)))})}),e.sharePanel.isOpened&&(0,gn.jsx)(el,{className:Cl["share-panel-wrapper"],shareText:e.sharePanel.params.text,shareType:e.sharePanel.params.type,shareLink:e.sharePanel.params.link,onShareCompelete:t=>e.sharePanel.handleShareComplete(e.sharePanel.params.id,t),sharePanelOptions:t.sharePanel})]}),(0,gn.jsx)(Vd,{disabled:r.api.animating,disabledByUI:e.storyReader.uiPaused||e.sharePanel.isOpened,isNextStoryBlank:e.storyReader.reachEnd,isPrevStoryBlank:e.storyReader.reachStart,navigationOptions:t.navigation,width:l.calculateWidth(),onNext:()=>e.storyReader.nextStoryWithAnimation(),onPrev:()=>e.storyReader.prevStoryWithAnimation()})]})})),$d=(0,cl.observer)((({storyReader:e,desktopMode:t})=>{const s=(()=>{const[e,t]=(0,fn.useState)((()=>yl())),s=(0,fn.useCallback)((()=>{t(yl())}),[]);return(0,fn.useEffect)((()=>(window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)})),[]),e})();(({touchController:e,sharePanelIsOpened:t,desktopMode:s,storyReader:i})=>{(0,fn.useEffect)((()=>{s||t?e.disable():e.enable()}),[e,s,t]),(0,fn.useEffect)((()=>(e.on(Mi.LongTouchDetected,r),e.on(Mi.TouchEnd,a),()=>{e.off(Mi.LongTouchDetected,r),e.off(Mi.TouchEnd,a)})),[e]);const r=()=>{i.pauseTimer()},a=()=>{e.isSwiping||i.resumeTimer()}})({touchController:e.touchController,sharePanelIsOpened:e.sharePanel.isOpened,desktopMode:t,storyReader:e});return e.sharePanel.desktopMode=t,(0,hl.createPortal)((0,gn.jsxs)(Sl,{viewport:s,storyReader:e,children:[(0,gn.jsx)(Gd,{viewport:s,storyReader:e,onCloseStory:()=>{e.close()},sharePanel:e.sharePanel}),(0,gn.jsx)(Fn,{orientation:le.PORTRAIT_PRIMARY,desktopMode:t,onOrientationChange:({isWrong:t})=>{t?e.pauseUI():e.resumeUI()}})]}),document.body)}));var Hd=_(7314),qd={insert:"head",singleton:!1};Sn()(Hd.A,qd);Hd.A.locals;const Qd=({storyManager:e,desktopMode:t})=>{const[s,i]=(0,fn.useState)(null),r=(()=>{const e=(0,fn.useRef)();return e.current||(e.current=(()=>{const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t)),s=t("--ias-sat"),i=t("--ias-sab");return{left:t("--ias-sal"),right:t("--ias-sar"),top:s,bottom:i}})()),e.current})();return(0,fn.useEffect)((()=>{const t=e.createGameReader();return t.setSafeAreaInsets(r),i(t),()=>{t.destroy()}}),[e]),(0,fn.useEffect)((()=>{s?.setDesktopMode(t)}),[s,t]),s};var Kd=_(7161),Yd=_(429);class Zd{host;_vw=0;_vh=0;constructor(e){this.host=e,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 Jd=_(2083);const Xd={[hs.BottomSheet]:Jd.literal`iam-bottom-sheet`,[hs.Fullscreen]:Jd.literal`iam-fullscreen-modal`,[hs.Modal]:Jd.literal`iam-modal`},ec=Kd.css`
2
2
  .bottom-sheet {
3
3
  position: fixed;
4
4
  inset: 0;
@@ -9,7 +9,7 @@
9
9
  position: fixed;
10
10
  inset: 0;
11
11
  z-index: -1;
12
- background-color: rgba(0, 0, 0, 0.5);
12
+ background-color: rgba(0, 0, 0, var(--backdrop-opacity, 0.5));
13
13
  opacity: 0;
14
14
  transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1);
15
15
  pointer-events: none;
@@ -87,27 +87,28 @@
87
87
  left: 50%;
88
88
  transform: translate3d(-50%, 0, 0);
89
89
  }
90
- `;var vf=S(318),mf=S(5125),bf=S(6968);class yf{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(Jn.TouchMoveVertical,this.handleTouchMoveVertical),null===(t=this.touchController)||void 0===t||t.off(Jn.TouchEnd,this.handleTouchEnd)}setTouchController(e){this.touchController=e,this.touchController.enable(),this.touchController.on(Jn.TouchMoveVertical,this.handleTouchMoveVertical),this.touchController.on(Jn.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 wf=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Sf=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},_f=function(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})},xf=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Of=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};(()=>{var e,t,i,n,s,a,o,l,d,c;let u,h,p,f,g,v,m,b,y,w,S,_,x=[(0,uf.customElement)("iam-bottom-sheet")],O=[],k=cf.LitElement,C=[],M=[],P=[],j=[],E=[],L=[],A=[],I=[],T=[],R=[],D=[],B=[],N=[],F=[],W=[],V=[],z=[],U=[],G=[],$=[];h=class extends k{get open(){return xf(this,e,"f")}set open(t){Of(this,e,t,"f")}get geometry(){return xf(this,t,"f")}set geometry(e){Of(this,t,e,"f")}get appearanceOptions(){return xf(this,i,"f")}set appearanceOptions(e){Of(this,i,e,"f")}get touchController(){return xf(this,n,"f")}set touchController(e){Of(this,n,e,"f")}get desktopMode(){return xf(this,s,"f")}set desktopMode(e){Of(this,s,e,"f")}get isVisible(){return xf(this,a,"f")}set isVisible(e){Of(this,a,e,"f")}get isClosed(){return xf(this,o,"f")}set isClosed(e){Of(this,o,e,"f")}get backdropRef(){return xf(this,l,"f")}set backdropRef(e){Of(this,l,e,"f")}get bottomSheetBoxRef(){return xf(this,d,"f")}set bottomSheetBoxRef(e){Of(this,d,e,"f")}get bottomSheetRef(){return xf(this,c,"f")}set bottomSheetRef(e){Of(this,c,e,"f")}constructor(){super(),e.set(this,Sf(this,C,!1)),t.set(this,(Sf(this,M),Sf(this,P,void 0))),i.set(this,(Sf(this,j),Sf(this,E,void 0))),n.set(this,(Sf(this,L),Sf(this,A,void 0))),s.set(this,(Sf(this,I),Sf(this,T,void 0))),a.set(this,(Sf(this,R),Sf(this,D,!1))),o.set(this,(Sf(this,B),Sf(this,N,!0))),l.set(this,(Sf(this,F),Sf(this,W,null))),d.set(this,(Sf(this,V),Sf(this,z,null))),c.set(this,(Sf(this,U),Sf(this,G,null))),Object.defineProperty(this,"bottomSheetSwipeController",{enumerable:!0,configurable:!0,writable:!0,value:(Sf(this,$),new yf(this))}),this.handleTransitionEnd=this.handleTransitionEnd.bind(this)}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,ne().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(){var e;if(this.isClosed)return cf.nothing;const t={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`},i={width:this.geometry.getWidth()+"px"};return cf.html`
90
+ `;var tc=_(318),sc=_(5125),ic=_(6968);class rc{host;touchController=null;constructor(e){this.host=e,this.host.addController(this),this.handleTouchMoveVertical=this.handleTouchMoveVertical.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}hostConnected(){}hostDisconnected(){this.touchController?.off(Mi.TouchMoveVertical,this.handleTouchMoveVertical),this.touchController?.off(Mi.TouchEnd,this.handleTouchEnd)}setTouchController(e){this.touchController=e,this.touchController.enable(),this.touchController.on(Mi.TouchMoveVertical,this.handleTouchMoveVertical),this.touchController.on(Mi.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 ac=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},oc=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s,r,a,o,n,l,d,c,h,u,p=[(0,Yd.customElement)("iam-bottom-sheet")],g=[],m=Kd.LitElement,f=[],y=[],v=[],w=[],_=[],S=[],b=[],x=[],C=[],k=[],M=[],L=[],O=[],I=[],A=[],E=[],T=[],R=[],P=[],B=[];(class extends m{static{t=this}static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;s=[(0,Yd.property)({type:Boolean})],r=[(0,Yd.property)({type:Object})],a=[(0,Yd.property)({type:Object})],o=[(0,Yd.property)({type:Object})],n=[(0,Yd.property)({type:Boolean})],l=[(0,Yd.state)()],d=[(0,Yd.state)()],c=[(0,Yd.query)("#bottom-sheet__backdrop")],h=[(0,Yd.query)("#bottom-sheet__box")],u=[(0,Yd.query)("#bottom-sheet")],ac(this,null,s,{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:i},f,y),ac(this,null,r,{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:i},v,w),ac(this,null,a,{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:i},_,S),ac(this,null,o,{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:i},b,x),ac(this,null,n,{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:i},C,k),ac(this,null,l,{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:i},M,L),ac(this,null,d,{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:i},O,I),ac(this,null,c,{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:i},A,E),ac(this,null,h,{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:i},T,R),ac(this,null,u,{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:i},P,B),ac(null,e={value:t},p,{kind:"class",name:t.name,metadata:i},null,g),t=e.value,i&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}#re=oc(this,f,!1);get open(){return this.#re}set open(e){this.#re=e}#ae=(oc(this,y),oc(this,v,void 0));get geometry(){return this.#ae}set geometry(e){this.#ae=e}#oe=(oc(this,w),oc(this,_,void 0));get appearanceOptions(){return this.#oe}set appearanceOptions(e){this.#oe=e}#ne=(oc(this,S),oc(this,b,void 0));get touchController(){return this.#ne}set touchController(e){this.#ne=e}#le=(oc(this,x),oc(this,C,void 0));get desktopMode(){return this.#le}set desktopMode(e){this.#le=e}#de=(oc(this,k),oc(this,M,!1));get isVisible(){return this.#de}set isVisible(e){this.#de=e}#ce=(oc(this,L),oc(this,O,!0));get isClosed(){return this.#ce}set isClosed(e){this.#ce=e}#he=(oc(this,I),oc(this,A,null));get backdropRef(){return this.#he}set backdropRef(e){this.#he=e}#ue=(oc(this,E),oc(this,T,null));get bottomSheetBoxRef(){return this.#ue}set bottomSheetBoxRef(e){this.#ue=e}#pe=(oc(this,R),oc(this,P,null));get bottomSheetRef(){return this.#pe}set bottomSheetRef(e){this.#pe=e}bottomSheetSwipeController=(oc(this,B),new rc(this));static styles=ec;constructor(){super(),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:s=(()=>!0)}={})=>new Promise((i=>{let r,a=0,o=!1;const n=()=>{a++,!o&&s()&&(o=!0),a>=e&&o?(clearTimeout(r),i()):requestAnimationFrame(n)};r=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 Kd.nothing;const e={backgroundColor:this.appearanceOptions.backgroundColor,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"},s={backgroundColor:this.appearanceOptions.closeButton.backgroundColor,width:`${this.appearanceOptions.closeButton.width}px`,height:`${this.appearanceOptions.closeButton.height}px`,marginTop:`${this.appearanceOptions.closeButton.marginTop}px`};return Kd.html`
91
91
  <div id="bottom-sheet" class="bottom-sheet">
92
92
  <div
93
93
  id="bottom-sheet__backdrop"
94
+ style=${(0,tc.styleMap)({"--backdrop-opacity":this.appearanceOptions.backdrop.opacity})}
94
95
  @click=${this.close}
95
- class="bottom-sheet__backdrop ${(0,mf.classMap)({"bottom-sheet__backdrop--open":this.isVisible})}"
96
+ class="bottom-sheet__backdrop ${(0,sc.classMap)({"bottom-sheet__backdrop--open":this.isVisible})}"
96
97
  ></div>
97
- <div class="bottom-sheet__box-wrapper ${(0,mf.classMap)({"bottom-sheet__box-wrapper--desktop-mode":this.desktopMode})}" style=${(0,vf.styleMap)(i)}>
98
+ <div class="bottom-sheet__box-wrapper ${(0,sc.classMap)({"bottom-sheet__box-wrapper--desktop-mode":this.desktopMode})}" style=${(0,tc.styleMap)(t)}>
98
99
  <div
99
- style=${(0,vf.styleMap)(t)}
100
+ style=${(0,tc.styleMap)(e)}
100
101
  id="bottom-sheet__box"
101
- class="bottom-sheet__box ${(0,mf.classMap)({"bottom-sheet__box--open":this.isVisible})}"
102
+ class="bottom-sheet__box ${(0,sc.classMap)({"bottom-sheet__box--open":this.isVisible})}"
102
103
  >
103
104
  <div class="bottom-sheet__header">
104
- ${this.desktopMode?cf.html`<button class="close-btn" @click=${this.close}>${(0,bf.unsafeHTML)(null===(e=r.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>`:cf.html`<div class="close-strip-btn"></div>`}
105
+ ${this.desktopMode?Kd.html`<button class="close-btn" @click=${this.close}>${(0,ic.unsafeHTML)(i.closeButton?.svgSrc.baseState)}</button>`:Kd.html`<div class="close-strip-btn" style=${(0,tc.styleMap)(s)}></div>`}
105
106
  </div>
106
107
  <slot></slot>
107
108
  </div>
108
109
  </div>
109
110
  </div>
110
- `}};e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,_f(h,"BottomSheet"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=k[Symbol.metadata])&&void 0!==e?e:null):void 0;p=[(0,uf.property)({type:Boolean})],f=[(0,uf.property)({type:Object})],g=[(0,uf.property)({type:Object})],v=[(0,uf.property)({type:Object})],m=[(0,uf.property)({type:Boolean})],b=[(0,uf.state)()],y=[(0,uf.state)()],w=[(0,uf.query)("#bottom-sheet__backdrop")],S=[(0,uf.query)("#bottom-sheet__box")],_=[(0,uf.query)("#bottom-sheet")],wf(h,null,p,{kind:"accessor",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:t},C,M),wf(h,null,f,{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),wf(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,L),wf(h,null,v,{kind:"accessor",name:"touchController",static:!1,private:!1,access:{has:e=>"touchController"in e,get:e=>e.touchController,set:(e,t)=>{e.touchController=t}},metadata:t},A,I),wf(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},T,R),wf(h,null,b,{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},D,B),wf(h,null,y,{kind:"accessor",name:"isClosed",static:!1,private:!1,access:{has:e=>"isClosed"in e,get:e=>e.isClosed,set:(e,t)=>{e.isClosed=t}},metadata:t},N,F),wf(h,null,w,{kind:"accessor",name:"backdropRef",static:!1,private:!1,access:{has:e=>"backdropRef"in e,get:e=>e.backdropRef,set:(e,t)=>{e.backdropRef=t}},metadata:t},W,V),wf(h,null,S,{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},z,U),wf(h,null,_,{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},G,$),wf(null,u={value:h},x,{kind:"class",name:h.name,metadata:t},null,O),h=u.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:gf}),Sf(h,O)})();const kf=cf.css`
111
+ `}static{oc(t,g)}})})();const nc=Kd.css`
111
112
  .modal {
112
113
  position: fixed;
113
114
  inset: 0;
@@ -115,25 +116,21 @@
115
116
  }
116
117
 
117
118
  .modal__backdrop {
118
- background-color: rgba(0, 0, 0, 0.5);
119
- transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1);
120
- opacity: 0;
119
+ background-color: rgba(0, 0, 0, var(--backdrop-opacity, 0.3));
121
120
  position: fixed;
122
121
  z-index: -1;
123
122
  inset: 0;
124
123
  pointer-events: none;
125
124
  }
126
125
 
126
+ /* .modal__backdrop.modal__backdrop--animated {
127
+ transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1);
128
+ } */
129
+
127
130
  .modal__backdrop.modal__backdrop--open {
128
- opacity: 1;
129
131
  pointer-events: all;
130
132
  }
131
133
 
132
- .modal__box.modal__box--open {
133
- opacity: 1;
134
- transform: scale(1);
135
- }
136
-
137
134
  .modal__box {
138
135
  display: flex;
139
136
  align-items: center;
@@ -141,14 +138,10 @@
141
138
  position: relative;
142
139
  outline: 0px;
143
140
  height: 100%;
144
- transform: scale(0.9);
145
- transition: opacity 0.3s ease, transform 0.3s ease;
146
- opacity: 0;
147
141
  }
148
142
 
149
143
  .modal__box-content {
150
144
  position: relative;
151
- background-color: #fff;
152
145
  border-top-left-radius: var(--slide-border-top-left-radius, 0);
153
146
  border-top-right-radius: var(--slide-border-top-right-radius, 0);
154
147
  border-bottom-left-radius: var(--slide-border-bottom-left-radius, 0);
@@ -160,12 +153,98 @@
160
153
  align-self: flex-end;
161
154
  }
162
155
 
163
- .modal__header {}
156
+ @keyframes fadeIn {
157
+ from {
158
+ opacity: 0;
159
+ }
160
+
161
+ to {
162
+ opacity: 1;
163
+ }
164
+ }
165
+
166
+ @keyframes fadeOut {
167
+ from {
168
+ opacity: 1;
169
+ }
170
+
171
+ to {
172
+ opacity: 0;
173
+ }
174
+ }
175
+
176
+
177
+ @keyframes fadeInWithZoom {
178
+ from {
179
+ opacity: 0;
180
+ transform: scale(0.7);
181
+ }
182
+
183
+ to {
184
+ transform: scale(1);
185
+ opacity: 1;
186
+ }
187
+ }
188
+
189
+ @keyframes fadeOutWithZoom {
190
+ from {
191
+ opacity: 1;
192
+ transform: scale(1);
193
+ }
194
+
195
+ to {
196
+ transform: scale(0.7);
197
+ opacity: 0;
198
+ }
199
+ }
200
+
201
+ @keyframes slideInUp {
202
+ from {
203
+ transform: translateY(100%);
204
+ }
205
+
206
+ to {
207
+ transform: translateY(0%);
208
+ }
209
+ }
210
+
211
+ @keyframes slideInOut {
212
+ from {
213
+ transform: translateY(0%);
214
+ }
215
+
216
+ to {
217
+ transform: translateY(100%);
218
+ }
219
+ }
220
+
221
+ .fadeIn {
222
+ animation: fadeIn 255ms forwards;
223
+ }
224
+
225
+ .fadeOut {
226
+ animation: fadeOut 255ms forwards;
227
+ }
228
+
229
+ .fadeInWithZoom {
230
+ animation: fadeInWithZoom 300ms forwards;
231
+ }
232
+
233
+ .fadeOutWithZoom {
234
+ animation: fadeOutWithZoom 300ms forwards;
235
+ }
236
+
237
+ .slideInUp {
238
+ animation: slideInUp 300ms forwards;
239
+ }
164
240
 
165
- .modal__header .close-btn {
241
+ .slideInOut {
242
+ animation: slideInOut 300ms forwards;
243
+ }
244
+ `,lc=Kd.css`
245
+ .close-btn {
166
246
  position: absolute;
167
247
  top: 1rem;
168
- right: 1rem;
169
248
  z-index: 10000;
170
249
  padding: 0;
171
250
  background-color: transparent;
@@ -177,30 +256,44 @@
177
256
  outline: none;
178
257
  }
179
258
  }
180
- `;var Cf=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Mf=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Pf=function(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})},jf=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Ef=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};(()=>{var e,t,i,n,s,a,o;let l,d,c,u,h,p,f,g,v,m=[(0,uf.customElement)("iam-modal")],b=[],y=cf.LitElement,w=[],S=[],_=[],x=[],O=[],k=[],C=[],M=[],P=[],j=[],E=[],L=[],A=[],I=[];d=class extends y{get open(){return jf(this,e,"f")}set open(t){Ef(this,e,t,"f")}get fullscreen(){return jf(this,t,"f")}set fullscreen(e){Ef(this,t,e,"f")}get geometry(){return jf(this,i,"f")}set geometry(e){Ef(this,i,e,"f")}get appearanceOptions(){return jf(this,n,"f")}set appearanceOptions(e){Ef(this,n,e,"f")}get isVisible(){return jf(this,s,"f")}set isVisible(e){Ef(this,s,e,"f")}get isClosed(){return jf(this,a,"f")}set isClosed(e){Ef(this,a,e,"f")}get backdropRef(){return jf(this,o,"f")}set backdropRef(e){Ef(this,o,e,"f")}constructor(){super(),e.set(this,Mf(this,w,!1)),t.set(this,(Mf(this,S),Mf(this,_,!1))),i.set(this,(Mf(this,x),Mf(this,O,void 0))),n.set(this,(Mf(this,k),Mf(this,C,void 0))),s.set(this,(Mf(this,M),Mf(this,P,!1))),a.set(this,(Mf(this,j),Mf(this,E,!0))),o.set(this,(Mf(this,L),Mf(this,A,null))),Mf(this,I),this.handleTransitionEnd=this.handleTransitionEnd.bind(this)}close(){var e;null===(e=this.backdropRef)||void 0===e||e.addEventListener("transitionend",this.handleTransitionEnd),this.isVisible=!1}updated(e){super.updated(e);e.has("open")&&this.handleOpenChanged()}handleOpenChanged(){this.open?(this.isClosed=!1,ne().then((()=>{this.isVisible=!0}))):this.isClosed||this.close()}handleTransitionEnd(){var e;null===(e=this.backdropRef)||void 0===e||e.removeEventListener("transitionend",this.handleTransitionEnd),setTimeout((()=>{this.isClosed=!0,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))}),50)}render(){var e,t;if(this.isClosed)return cf.nothing;const i=this.fullscreen?0:this.appearanceOptions.borderRadius,n={height:this.geometry.getHeight()+"px",width:this.geometry.getWidth()+"px","--slide-border-top-left-radius":`${i}px`,"--slide-border-top-right-radius":`${i}px`,"--slide-border-bottom-left-radius":`${i}px`,"--slide-border-bottom-right-radius":`${i}px`};return cf.html`
259
+
260
+ .close-btn.close-btn--position_left {
261
+ left: 1rem;
262
+ }
263
+
264
+ .close-btn.close-btn--position_right {
265
+ right: 1rem;
266
+ }
267
+
268
+ .close-btn.close-btn--position_none {
269
+ display: none;
270
+ }
271
+ `;var dc=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},cc=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s,r=[(0,Yd.customElement)("iam-modal-close-btn")],a=[],o=Kd.LitElement,n=[],l=[];(class extends o{static{t=this}static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;s=[(0,Yd.property)({type:Number})],dc(this,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:i},n,l),dc(null,e={value:t},r,{kind:"class",name:t.name,metadata:i},null,a),t=e.value,i&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}#ge=cc(this,n,void 0);get closeBtnPosition(){return this.#ge}set closeBtnPosition(e){this.#ge=e}static styles=lc;render(){return Kd.html`
272
+ <button class="close-btn ${(0,sc.classMap)({"close-btn--position_left":this.closeBtnPosition===jt.Left,"close-btn--position_right":this.closeBtnPosition===jt.Right,"close-btn--position_none":this.closeBtnPosition===jt.None})}">${(0,ic.unsafeHTML)(i.closeButton?.svgSrc.baseState)}</button>`}constructor(){super(...arguments),cc(this,l)}static{cc(t,a)}})})();var hc=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},uc=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s,i,r,a,o,n,l,d=[(0,Yd.customElement)("iam-modal")],c=[],h=Kd.LitElement,u=[],p=[],g=[],m=[],f=[],y=[],v=[],w=[],_=[],S=[],b=[],x=[],C=[],k=[];(class extends h{static{t=this}static{const M="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;s=[(0,Yd.property)({type:Boolean})],i=[(0,Yd.property)({type:Boolean})],r=[(0,Yd.property)({type:Object})],a=[(0,Yd.property)({type:Object})],o=[(0,Yd.state)()],n=[(0,Yd.state)()],l=[(0,Yd.query)("#modal__backdrop")],hc(this,null,s,{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:M},u,p),hc(this,null,i,{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:M},g,m),hc(this,null,r,{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:M},f,y),hc(this,null,a,{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:M},v,w),hc(this,null,o,{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:M},_,S),hc(this,null,n,{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:M},b,x),hc(this,null,l,{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:M},C,k),hc(null,e={value:t},d,{kind:"class",name:t.name,metadata:M},null,c),t=e.value,M&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:M})}#re=uc(this,u,!1);get open(){return this.#re}set open(e){this.#re=e}#me=(uc(this,p),uc(this,g,!1));get fullscreen(){return this.#me}set fullscreen(e){this.#me=e}#ae=(uc(this,m),uc(this,f,void 0));get geometry(){return this.#ae}set geometry(e){this.#ae=e}#oe=(uc(this,y),uc(this,v,void 0));get appearanceOptions(){return this.#oe}set appearanceOptions(e){this.#oe=e}#de=(uc(this,w),uc(this,_,!1));get isVisible(){return this.#de}set isVisible(e){this.#de=e}#ce=(uc(this,S),uc(this,b,!0));get isClosed(){return this.#ce}set isClosed(e){this.#ce=e}#he=(uc(this,x),uc(this,C,null));get backdropRef(){return this.#he}set backdropRef(e){this.#he=e}static styles=nc;constructor(){super(),uc(this,k)}close(){const e=this.appearanceOptions.animationType===Dt.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 Dt.SlideInUp:return"slideInUp";case Dt.FadeIn:return"fadeInWithZoom";default:return""}}getOutModalAnimationCSSClass(e){switch(e){case Dt.SlideInUp:return"slideInOut";case Dt.FadeIn:return"fadeOutWithZoom";default:return""}}getBackdropAnimationCSSClass(e){return e?"fadeIn":"fadeOut"}render(){const e=this.fullscreen?0:this.appearanceOptions.borderRadius,t={backgroundColor:this.appearanceOptions.backgroundColor,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`},s=this.appearanceOptions.animationType,i=this.isVisible?this.getEnterModalAnimationCSSClass(s):this.getOutModalAnimationCSSClass(s),r=this.getBackdropAnimationCSSClass(this.isVisible);return Kd.html`
181
273
  <div class="modal">
182
274
  <div
183
275
  id="modal__backdrop"
184
- class="modal__backdrop ${(0,mf.classMap)({"modal__backdrop--open":this.isVisible})}"
276
+ style=${(0,tc.styleMap)({"--backdrop-opacity":this.appearanceOptions instanceof Ft?this.appearanceOptions.backdrop.opacity:void 0})}
277
+ class="modal__backdrop ${(0,sc.classMap)({[r]:s!==Dt.None})}"
185
278
  ></div>
186
- <div @click=${this.close} class="modal__box ${(0,mf.classMap)({"modal__box--open":this.isVisible})}"
279
+ <div @click=${this.close} class="modal__box ${(0,sc.classMap)({[i]:!0})}"
187
280
  >
188
- ${this.fullscreen?cf.html`<div class="modal__header">
189
- <button class="close-btn" @click=${this.close}>${(0,bf.unsafeHTML)(null===(e=r.closeButton)||void 0===e?void 0:e.svgSrc.baseState)}</button>
190
- </div>`:cf.nothing}
191
- <div style=${(0,vf.styleMap)(n)} class="modal__box-content ${(0,mf.classMap)({"modal__box-content--fullscreen":this.fullscreen})}">
192
- ${this.fullscreen?cf.nothing:cf.html`<div class="modal__header">
193
- <button class="close-btn" @click=${this.close}>${(0,bf.unsafeHTML)(null===(t=r.closeButton)||void 0===t?void 0:t.svgSrc.baseState)}</button>
281
+ ${this.fullscreen?Kd.html`<div class="modal__header">
282
+ <iam-modal-close-btn @click=${this.close} closeBtnPosition=${this.appearanceOptions.closeBtnPosition}></iam-modal-close-btn>
283
+ </div>`:Kd.nothing}
284
+ <div style=${(0,tc.styleMap)(t)} class="modal__box-content ${(0,sc.classMap)({"modal__box-content--fullscreen":this.fullscreen})}">
285
+ ${this.fullscreen?Kd.nothing:Kd.html`<div class="modal__header">
286
+ <iam-modal-close-btn @click=${this.close} closeBtnPosition=${this.appearanceOptions.closeBtnPosition}></iam-modal-close-btn>
194
287
  </div>`}
195
288
  <slot></slot>
196
289
  </div>
197
290
  </div>
198
291
  </div>
199
- `}};e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,a=new WeakMap,o=new WeakMap,Pf(d,"Modal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=y[Symbol.metadata])&&void 0!==e?e:null):void 0;c=[(0,uf.property)({type:Boolean})],u=[(0,uf.property)({type:Boolean})],h=[(0,uf.property)({type:Object})],p=[(0,uf.property)({type:Object})],f=[(0,uf.state)()],g=[(0,uf.state)()],v=[(0,uf.query)("#modal__backdrop")],Cf(d,null,c,{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},w,S),Cf(d,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},_,x),Cf(d,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},O,k),Cf(d,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},C,M),Cf(d,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},P,j),Cf(d,null,g,{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},E,L),Cf(d,null,v,{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},A,I),Cf(null,l={value:d},m,{kind:"class",name:d.name,metadata:t},null,b),d=l.value,t&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(d,"styles",{enumerable:!0,configurable:!0,writable:!0,value:kf}),Mf(d,b)})();var Lf=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Af=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},If=function(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})},Tf=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Rf=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};(()=>{var e,t,i;let r,n,s,a,o,l=[(0,uf.customElement)("iam-fullscreen-modal")],d=[],c=cf.LitElement,u=[],h=[],p=[],f=[],g=[],v=[];n=class extends c{get open(){return Tf(this,e,"f")}set open(t){Rf(this,e,t,"f")}get geometry(){return Tf(this,t,"f")}set geometry(e){Rf(this,t,e,"f")}get appearanceOptions(){return Tf(this,i,"f")}set appearanceOptions(e){Rf(this,i,e,"f")}render(){return cf.html`
292
+ `}static{uc(t,c)}})})();var pc=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},gc=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s,i,r,a=[(0,Yd.customElement)("iam-fullscreen-modal")],o=[],n=Kd.LitElement,l=[],d=[],c=[],h=[],u=[],p=[];(class extends n{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;s=[(0,Yd.property)({type:Boolean})],i=[(0,Yd.property)({type:Object})],r=[(0,Yd.property)({type:Object})],pc(this,null,s,{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:g},l,d),pc(this,null,i,{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:g},c,h),pc(this,null,r,{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:g},u,p),pc(null,e={value:t},a,{kind:"class",name:t.name,metadata:g},null,o),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),gc(t,o)}#re=gc(this,l,!1);get open(){return this.#re}set open(e){this.#re=e}#ae=(gc(this,d),gc(this,c,void 0));get geometry(){return this.#ae}set geometry(e){this.#ae=e}#oe=(gc(this,h),gc(this,u,void 0));get appearanceOptions(){return this.#oe}set appearanceOptions(e){this.#oe=e}render(){return Kd.html`
200
293
  <iam-modal ?open=${this.open} .fullscreen=${!0} .geometry=${this.geometry} .appearanceOptions=${this.appearanceOptions}>
201
294
  <slot></slot>
202
295
  </iam-modal>
203
- `}constructor(){super(...arguments),e.set(this,Af(this,u,!1)),t.set(this,(Af(this,h),Af(this,p,void 0))),i.set(this,(Af(this,f),Af(this,g,void 0))),Af(this,v)}};e=new WeakMap,t=new WeakMap,i=new WeakMap,If(n,"FullscreenModal"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=c[Symbol.metadata])&&void 0!==e?e:null):void 0;s=[(0,uf.property)({type:Boolean})],a=[(0,uf.property)({type:Object})],o=[(0,uf.property)({type:Object})],Lf(n,null,s,{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),Lf(n,null,a,{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,f),Lf(n,null,o,{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},g,v),Lf(null,r={value:n},l,{kind:"class",name:n.name,metadata:t},null,d),n=r.value,t&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t}),Af(n,d)})()})();var Df=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Bf=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Nf=function(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})},Ff=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Wf=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};(()=>{var e,t,i,r,n,s;let a,o,l,d,c,u,h,p,f=[(0,uf.customElement)("message-view-factory")],g=[],v=cf.LitElement,m=[],b=[],y=[],w=[],S=[],_=[],x=[],O=[],k=[],C=[],M=[],P=[];o=class extends v{get appearanceOptions(){return Ff(this,e,"f")}set appearanceOptions(t){Wf(this,e,t,"f")}get type(){return Ff(this,t,"f")}set type(e){Wf(this,t,e,"f")}get open(){return Ff(this,i,"f")}set open(e){Wf(this,i,e,"f")}get geometry(){return Ff(this,r,"f")}set geometry(e){Wf(this,r,e,"f")}get touchController(){return Ff(this,n,"f")}set touchController(e){Wf(this,n,e,"f")}get desktopMode(){return Ff(this,s,"f")}set desktopMode(e){Wf(this,s,e,"f")}render(){const e=ff[this.type];return e?pf.html`
296
+ `}constructor(){super(...arguments),gc(this,p)}})})();var mc=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},fc=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s,i,r,a,o,n,l=[(0,Yd.customElement)("message-view-factory")],d=[],c=Kd.LitElement,h=[],u=[],p=[],g=[],m=[],f=[],y=[],v=[],w=[],_=[],S=[],b=[];(class extends c{static{t=this}static{const x="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;s=[(0,Yd.property)({type:Object})],i=[(0,Yd.property)({type:Number})],r=[(0,Yd.property)({type:Boolean})],a=[(0,Yd.property)({type:Object})],o=[(0,Yd.property)({type:Object})],n=[(0,Yd.property)({type:Boolean})],mc(this,null,s,{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:x},h,u),mc(this,null,i,{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:x},p,g),mc(this,null,r,{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:x},m,f),mc(this,null,a,{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:x},y,v),mc(this,null,o,{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:x},w,_),mc(this,null,n,{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:x},S,b),mc(null,e={value:t},l,{kind:"class",name:t.name,metadata:x},null,d),t=e.value,x&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:x})}#oe=fc(this,h,void 0);get appearanceOptions(){return this.#oe}set appearanceOptions(e){this.#oe=e}#fe=(fc(this,u),fc(this,p,void 0));get type(){return this.#fe}set type(e){this.#fe=e}#re=(fc(this,g),fc(this,m,!1));get open(){return this.#re}set open(e){this.#re=e}#ae=(fc(this,f),fc(this,y,void 0));get geometry(){return this.#ae}set geometry(e){this.#ae=e}#ne=(fc(this,v),fc(this,w,void 0));get touchController(){return this.#ne}set touchController(e){this.#ne=e}#le=(fc(this,_),fc(this,S,void 0));get desktopMode(){return this.#le}set desktopMode(e){this.#le=e}render(){const e=Xd[this.type];return e?Jd.html`
204
297
  <${e}
205
298
  .open=${this.open}
206
299
  .geometry=${this.geometry}
@@ -209,7 +302,7 @@
209
302
  .desktopMode=${this.desktopMode}>
210
303
  <slot></slot>
211
304
  </${e}>
212
- `:null}constructor(){super(...arguments),e.set(this,Bf(this,m,void 0)),t.set(this,(Bf(this,b),Bf(this,y,void 0))),i.set(this,(Bf(this,w),Bf(this,S,!1))),r.set(this,(Bf(this,_),Bf(this,x,void 0))),n.set(this,(Bf(this,O),Bf(this,k,void 0))),s.set(this,(Bf(this,C),Bf(this,M,void 0))),Bf(this,P)}};e=new WeakMap,t=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,Nf(o,"MessageViewFactory"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=v[Symbol.metadata])&&void 0!==e?e:null):void 0;l=[(0,uf.property)({type:Object})],d=[(0,uf.property)({type:Number})],c=[(0,uf.property)({type:Boolean})],u=[(0,uf.property)({type:Object})],h=[(0,uf.property)({type:Object})],p=[(0,uf.property)({type:Boolean})],Df(o,null,l,{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,b),Df(o,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},y,w),Df(o,null,c,{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,_),Df(o,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},x,O),Df(o,null,h,{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},k,C),Df(o,null,p,{kind:"accessor",name:"desktopMode",static:!1,private:!1,access:{has:e=>"desktopMode"in e,get:e=>e.desktopMode,set:(e,t)=>{e.desktopMode=t}},metadata:t},M,P),Df(null,a={value:o},f,{kind:"class",name:o.name,metadata:t},null,g),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:cf.css``}),Bf(o,g)})();const Vf=cf.css`
305
+ `:null}static styles=Kd.css``;constructor(){super(...arguments),fc(this,b)}static{fc(t,d)}})})();const yc=Kd.css`
213
306
  .narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-link {
214
307
  pointer-events: all;
215
308
  cursor: pointer;
@@ -374,7 +467,7 @@
374
467
  .narrative-slide.narrative-slide .narrative-slide-elements .narrative-element-barcode * {
375
468
  pointer-events: none;
376
469
  }
377
- `,zf=cf.css`
470
+ `,vc=Kd.css`
378
471
  * {
379
472
  user-select: none;
380
473
  -moz-user-select: none;
@@ -430,20 +523,20 @@
430
523
  left: 0;
431
524
  }
432
525
 
433
- `;var Uf=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Gf=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},$f=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},Hf=function(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})},qf=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},Qf=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};(()=>{var e,t,i,r;let n,s,a,o,l,d,c=[(0,uf.customElement)("message-slide")],u=[],h=cf.LitElement,p=[],f=[],g=[],v=[],m=[],b=[],y=[],w=[];s=class extends h{get slide(){return qf(this,e,"f")}set slide(t){Qf(this,e,t,"f")}get styleContext(){return qf(this,t,"f")}set styleContext(e){Qf(this,t,e,"f")}get geometry(){return qf(this,i,"f")}set geometry(e){Qf(this,i,e,"f")}get slideContent(){return qf(this,r,"f")}set slideContent(e){Qf(this,r,e,"f")}constructor(){super(),e.set(this,Gf(this,p,void 0)),t.set(this,(Gf(this,f),Gf(this,g,void 0))),i.set(this,(Gf(this,v),Gf(this,m,void 0))),r.set(this,(Gf(this,b),Gf(this,y,null))),Object.defineProperty(this,"fontFamilies",{enumerable:!0,configurable:!0,writable:!0,value:(Gf(this,w),"")})}get slideStyle(){return{margin:this.geometry.getOffset(),width:this.geometry.getWidth(),height:this.geometry.getHeight(),"--y-offset":this.geometry.getOffsetY(),"--x-offset":this.geometry.getOffsetX()}}aconnectedCallback(){super.connectedCallback()}firstUpdated(e){super.firstUpdated(e),this.initAndStartSlide()}disconnectedCallback(){super.disconnectedCallback(),this.slide.stop()}handleSlideClick(e){e.preventDefault(),e.stopPropagation();const t=e.target;this.slide.onClick(t)}initAndStartSlide(){return $f(this,void 0,void 0,(function*(){const e=this.slideContent;if(!e)throw new Error("[IAM]: no slide content");yield this.slide.init(e),yield this.slide.start()}))}render(){var e;const t=this.geometry instanceof Ao,i=1/this.geometry.contentRatio*100;return cf.html`
434
- <style nonce=${X()}>
435
- ${null!==(e=this.styleContext)&&void 0!==e?e:""}
526
+ `;var wc=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},_c=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s,i,r,a,o=[(0,Yd.customElement)("message-slide")],n=[],l=Kd.LitElement,d=[],c=[],h=[],u=[],p=[],g=[],m=[],f=[];(class extends l{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;s=[(0,Yd.property)({type:Object})],i=[(0,Yd.property)({type:String})],r=[(0,Yd.property)({type:Object})],a=[(0,Yd.query)("#narrative-slide-box")],wc(this,null,s,{kind:"accessor",name:"slide",static:!1,private:!1,access:{has:e=>"slide"in e,get:e=>e.slide,set:(e,t)=>{e.slide=t}},metadata:y},d,c),wc(this,null,i,{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:y},h,u),wc(this,null,r,{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:y},p,g),wc(this,null,a,{kind:"accessor",name:"slideContent",static:!1,private:!1,access:{has:e=>"slideContent"in e,get:e=>e.slideContent,set:(e,t)=>{e.slideContent=t}},metadata:y},m,f),wc(null,e={value:t},o,{kind:"class",name:t.name,metadata:y},null,n),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})}#ye=_c(this,d,void 0);get slide(){return this.#ye}set slide(e){this.#ye=e}#ve=(_c(this,c),_c(this,h,void 0));get styleContext(){return this.#ve}set styleContext(e){this.#ve=e}#ae=(_c(this,u),_c(this,p,void 0));get geometry(){return this.#ae}set geometry(e){this.#ae=e}#we=(_c(this,g),_c(this,m,null));get slideContent(){return this.#we}set slideContent(e){this.#we=e}fontFamilies=(_c(this,f),"");constructor(){super()}get slideStyle(){return{margin:this.geometry.getOffset(),width:this.geometry.getWidth(),height:this.geometry.getHeight(),"--y-offset":this.geometry.getOffsetY(),"--x-offset":this.geometry.getOffsetX()}}aconnectedCallback(){super.connectedCallback()}firstUpdated(e){super.firstUpdated(e),this.initAndStartSlide()}disconnectedCallback(){super.disconnectedCallback(),this.slide.stop()}handleSlideClick(e){e.preventDefault(),e.stopPropagation();const t=e.target;this.slide.onClick(t)}async initAndStartSlide(){const e=this.slideContent;if(!e)throw new Error("[IAM]: no slide content");await this.slide.init(e),await this.slide.start()}static styles=[yc,vc];render(){const e=this.geometry instanceof Aa,t=1/this.geometry.contentRatio*100;return Kd.html`
527
+ <style nonce=${K()}>
528
+ ${this.styleContext??""}
436
529
  </style>
437
530
  <div class="stories-viewer narrative-slide-wrapper" @click=${this.handleSlideClick}>
438
531
  <div
439
- class=${(0,mf.classMap)({"narrative-slide-offset":!0,"narrative-slide-offset-fullscreen":t})}
440
- style=${(0,vf.styleMap)(this.slideStyle)}>
441
- <div id="narrative-slide-box" class="narrative-slide-box" style=${(0,vf.styleMap)({fontSize:this.geometry.getFontSize(),padding:`${i}% 0 0 0`})}>
442
- ${(0,bf.unsafeHTML)(this.slide.html)}
532
+ class=${(0,sc.classMap)({"narrative-slide-offset":!0,"narrative-slide-offset-fullscreen":e})}
533
+ style=${(0,tc.styleMap)(this.slideStyle)}>
534
+ <div id="narrative-slide-box" class="narrative-slide-box" style=${(0,tc.styleMap)({fontSize:this.geometry.getFontSize(),padding:`${t}% 0 0 0`})}>
535
+ ${(0,ic.unsafeHTML)(this.slide.html)}
443
536
  </div>
444
537
  </div>
445
538
  </div>
446
- `}};e=new WeakMap,t=new WeakMap,i=new WeakMap,r=new WeakMap,Hf(s,"MessageSlide"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=h[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[(0,uf.property)({type:Object})],o=[(0,uf.property)({type:String})],l=[(0,uf.property)({type:Object})],d=[(0,uf.query)("#narrative-slide-box")],Uf(s,null,a,{kind:"accessor",name:"slide",static:!1,private:!1,access:{has:e=>"slide"in e,get:e=>e.slide,set:(e,t)=>{e.slide=t}},metadata:t},p,f),Uf(s,null,o,{kind:"accessor",name:"styleContext",static:!1,private:!1,access:{has:e=>"styleContext"in e,get:e=>e.styleContext,set:(e,t)=>{e.styleContext=t}},metadata:t},g,v),Uf(s,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},m,b),Uf(s,null,d,{kind:"accessor",name:"slideContent",static:!1,private:!1,access:{has:e=>"slideContent"in e,get:e=>e.slideContent,set:(e,t)=>{e.slideContent=t}},metadata:t},y,w),Uf(null,n={value:s},c,{kind:"class",name:s.name,metadata:t},null,u),s=n.value,t&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(s,"styles",{enumerable:!0,configurable:!0,writable:!0,value:[Vf,zf]}),Gf(s,u)})();const Kf=cf.css`
539
+ `}static{_c(t,n)}})})();const Sc=Kd.css`
447
540
  @keyframes spin {
448
541
  from {
449
542
  -webkit-transform: rotate(0deg);
@@ -465,25 +558,25 @@
465
558
  border-radius: 50%;
466
559
  animation: spin 0.6s infinite linear;
467
560
  }
468
- `;var Yf=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},Zf=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},Jf=function(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})};(()=>{let e,t,i=[(0,uf.customElement)("iam-spinner")],r=[],n=cf.LitElement;t=class extends n{render(){const e="white";return cf.html`
561
+ `;var bc=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},xc=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s=[(0,Yd.customElement)("iam-spinner")],i=[],r=Kd.LitElement;(class extends r{static{t=this}static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;bc(null,e={value:t},s,{kind:"class",name:t.name,metadata:a},null,i),t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})}static styles=Sc;render(){const e="white";return Kd.html`
469
562
  <div
470
563
  class="spinner"
471
- style=${(0,vf.styleMap)({border:`solid 2px ${e}`,borderColor:`transparent ${e} ${e} ${e}`})}></div>
472
- `}};Jf(t,"Spinner"),(()=>{var s;const a="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(s=n[Symbol.metadata])&&void 0!==s?s:null):void 0;Yf(null,e={value:t},i,{kind:"class",name:t.name,metadata:a},null,r),t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a})})(),Object.defineProperty(t,"styles",{enumerable:!0,configurable:!0,writable:!0,value:Kf}),Zf(t,r)})();var Xf=function(e,t,i,r,n,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=r.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),h=!1,p=i.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[p])("accessor"===l?{get:u.get,set:u.set}:u[d],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(u.get=o),(o=a(v.set))&&(u.set=o),(o=a(v.init))&&n.unshift(o)}else(o=a(v))&&("field"===l?n.unshift(o):u[d]=o)}c&&Object.defineProperty(c,r.name,u),h=!0},eg=function(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0},tg=function(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})},ig=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},rg=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i};(()=>{var e,t,i,r;let n,s,a,o,l,d,c=[(0,uf.customElement)("iam-reader"),te],u=[],h=cf.LitElement,p=[],f=[],g=[],v=[],m=[],b=[],y=[],w=[];s=class extends h{get options(){return ig(this,e,"f")}set options(t){rg(this,e,t,"f")}get desktopMode(){return ig(this,t,"f")}set desktopMode(e){rg(this,t,e,"f")}get viewModel(){return ig(this,i,"f")}set viewModel(e){rg(this,i,e,"f")}get open(){return ig(this,r,"f")}set open(e){rg(this,r,e,"f")}constructor(){super(),e.set(this,eg(this,p,{})),t.set(this,(eg(this,f),eg(this,g,!1))),i.set(this,(eg(this,v),eg(this,m,null))),r.set(this,(eg(this,b),eg(this,y,!0))),Object.defineProperty(this,"viewportController",{enumerable:!0,configurable:!0,writable:!0,value:(eg(this,w),new hf(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 i=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=i)}getMessageTypeByEnviroment(e){return this.desktopMode&&e===Wl.Fullscreen?(console.warn("[IAM]: desktop only supports modal window"),Wl.Modal):e}createSlideGeometry(e){return(new Ro).create(e)}createMessageGeometry(e,t){return(new jo).create(e,{appearanceOptions:t,vw:this.viewportController.vw,vh:this.viewportController.vh,desktopMode:this.desktopMode})}render(){var e,t;const i=null===(e=this.viewModel)||void 0===e?void 0:e.activeMessage,r=null===(t=this.viewModel)||void 0===t?void 0:t.touchController;if(!i)return null;const n=i.type,s=this.createMessageGeometry(n,i.appearanceOptions),a=this.createSlideGeometry(s);return cf.html`
473
- <message-view-factory
474
- type=${n}
475
- @closed=${this.handleClosed}
476
- .appearanceOptions=${i.appearanceOptions}
477
- .geometry=${s}
478
- .open=${this.open}
479
- .desktopMode=${this.desktopMode}
480
- .touchController=${r}>
481
- <message-slide .slide=${i.slides[0]} .styleContext=${i.context.style} .geometry=${a}></message-slide>
482
- </message-view-factory>
483
- `}};e=new WeakMap,t=new WeakMap,i=new WeakMap,r=new WeakMap,tg(s,"InAppMessagingReader"),(()=>{var e;const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(e=h[Symbol.metadata])&&void 0!==e?e:null):void 0;a=[(0,uf.property)({type:Object})],o=[(0,uf.property)({type:Boolean})],l=[(0,uf.property)({type:Object})],d=[(0,uf.state)()],Xf(s,null,a,{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},p,f),Xf(s,null,o,{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},g,v),Xf(s,null,l,{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},m,b),Xf(s,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},y,w),Xf(null,n={value:s},c,{kind:"class",name:s.name,metadata:t},null,u),s=n.value,t&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),Object.defineProperty(s,"styles",{enumerable:!0,configurable:!0,writable:!0,value:cf.css`
564
+ style=${(0,tc.styleMap)({border:`solid 2px ${e}`,borderColor:`transparent ${e} ${e} ${e}`})}></div>
565
+ `}static{xc(t,i)}})})();var Cc=function(e,t,s,i,r,a){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var n,l=i.kind,d="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),u=!1,p=s.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(e||null))};var f=(0,s[p])("accessor"===l?{get:h.get,set:h.set}:h[d],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(n=o(f.get))&&(h.get=n),(n=o(f.set))&&(h.set=n),(n=o(f.init))&&r.unshift(n)}else(n=o(f))&&("field"===l?r.unshift(n):h[d]=n)}c&&Object.defineProperty(c,i.name,h),u=!0},kc=function(e,t,s){for(var i=arguments.length>2,r=0;r<t.length;r++)s=i?t[r].call(e,s):t[r].call(e);return i?s:void 0};(()=>{let e,t,s,i,r,a,o=[(0,Yd.customElement)("iam-reader"),we],n=[],l=Kd.LitElement,d=[],c=[],h=[],u=[],p=[],g=[],m=[],f=[];(class extends l{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;s=[(0,Yd.property)({type:Object})],i=[(0,Yd.property)({type:Boolean})],r=[(0,Yd.property)({type:Object})],a=[(0,Yd.state)()],Cc(this,null,s,{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:y},d,c),Cc(this,null,i,{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:y},h,u),Cc(this,null,r,{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:y},p,g),Cc(this,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:y},m,f),Cc(null,e={value:t},o,{kind:"class",name:t.name,metadata:y},null,n),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})}#_e=kc(this,d,{});get options(){return this.#_e}set options(e){this.#_e=e}#le=(kc(this,c),kc(this,h,!1));get desktopMode(){return this.#le}set desktopMode(e){this.#le=e}#Se=(kc(this,u),kc(this,p,null));get viewModel(){return this.#Se}set viewModel(e){this.#Se=e}#re=(kc(this,g),kc(this,m,!0));get open(){return this.#re}set open(e){this.#re=e}viewportController=(kc(this,f),new Zd(this));static styles=Kd.css`
484
566
  .iam-container {
485
567
  position: fixed;
486
568
  inset: 0;
487
569
  z-index: 1000;
488
570
  }
489
- `}),eg(s,u)})();const ng=e=>{const{storyManager:t,desktopMode:i}=lg(),r=(0,bc.useRef)(null);return(0,bc.useEffect)((()=>{const e=r.current;e.desktopMode=i,e.viewModel=t.inAppMessaging}),[t,i]),(0,vc.jsx)("iam-reader",{ref:r})},sg=yc().createContext({dir:"ltr",storyManager:ac,desktopMode:!1,commonOptions:r,storyReaderOptions:M,gameReaderOptions:n,goodsWidgetOptions:a,inAppMessagingOptions:j});let ag=!1;const og=(0,pu.observer)((e=>{pg(e.config),fg(e);const{commonOptions:t,gameReaderOptions:i,storyReaderOptions:r,goodsWidgetOptions:n,inAppMessagingOptions:s}=gg(e),a=ug(),o=(({storyManager:e})=>{const[t,i]=(0,bc.useState)(null);return(0,bc.useEffect)((()=>{const t=e.createStoryReader();return i(t),()=>{t.destroy()}}),[e]),t})({storyManager:ac}),l=df({storyManager:ac,desktopMode:a});(0,bc.useEffect)((()=>{if(ag)throw new Error("There can only be one instance of <IASContainer /> per application");return ag=!0,()=>{ag=!1,ac.clearConfig()}}),[]);const d=(0,bc.useMemo)((()=>getComputedStyle(document.documentElement).direction),[]),c=(0,bc.useMemo)((()=>({storyManager:ac,desktopMode:a,dir:d,commonOptions:t,gameReaderOptions:i,storyReaderOptions:r,goodsWidgetOptions:n,inAppMessagingOptions:s})),[ac,a,d,t,i,r,n]);return(0,vc.jsxs)(sg.Provider,{value:c,children:[(null==l?void 0:l.isOpened)&&(0,vc.jsx)(gu,{gameReaderViewModel:l}),(null==o?void 0:o.isOpened)&&(0,vc.jsx)(af,{storyReaderViewModel:o,desktopMode:a}),(0,vc.jsx)(ng,{}),e.children]})})),lg=()=>(0,bc.useContext)(sg);var dg=S(3643);const cg=S.n(dg)().getParser(window.navigator.userAgent).parse(),ug=()=>{const[e,t]=(0,bc.useState)(!1);(0,bc.useLayoutEffect)((()=>(i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)})),[]);const i=()=>{"mobile"===cg.parsedResult.platform.type?t(!1):t(!0)};return e},hg=e=>{const t=t=>{t.keyCode===Qi.esc&&e()};(0,bc.useEffect)((()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)})),[])},pg=e=>{(0,bc.useEffect)((()=>{ac.setConfig(e)}),[JSON.stringify(e)])},fg=({onClickOnStory:e,onShowStory:t,onCloseStory:i,onShowSlide:r,onClickOnButton:n,onLikeStory:s,onDislikeStory:a,onFavoriteStory:o,onShareStory:l,onShareStoryWithPath:d,onFeedImpression:c,onVisibleAreaUpdated:u,onWidgetEvent:h})=>{(0,bc.useEffect)((()=>(e&&ac.on("clickOnStory",e),t&&ac.on("showStory",t),i&&ac.on("closeStory",i),r&&ac.on("showSlide",r),n&&ac.on("clickOnButton",n),s&&ac.on("likeStory",s),a&&ac.on("dislikeStory",a),o&&ac.on("favoriteStory",o),l&&ac.on("shareStory",l),d&&ac.on("shareStoryWithPath",d),c&&ac.on("feedImpression",c),u&&ac.on("visibleAreaUpdated",u),h&&ac.on("widgetEvent",h),()=>{e&&ac.off("clickOnStory",e),t&&ac.off("showStory",t),i&&ac.off("closeStory",i),r&&ac.off("showSlide",r),n&&ac.off("clickOnButton",n),s&&ac.off("likeStory",s),a&&ac.off("dislikeStory",a),o&&ac.off("favoriteStory",o),l&&ac.off("shareStory",l),d&&ac.off("shareStoryWithPath",d),c&&ac.off("feedImpression",c),u&&ac.off("visibleAreaUpdated",u),h&&ac.off("widgetEvent",h)})),[e,t,i,r,n,s,a,o,l,d,c,u,h])},gg=({commonOptions:e,gameReaderOptions:t,storyReaderOptions:i,goodsWidgetOptions:r})=>{const n=(0,bc.useRef)(new lc).current,s=(0,bc.useMemo)((()=>(e&&n.setCommonOptions(e),n.commonOptions)),[JSON.stringify(e)]),a=(0,bc.useMemo)((()=>(t&&n.setGameReaderOptions(t),n.gameReaderOptions)),[JSON.stringify(t)]),o=(0,bc.useMemo)((()=>(r&&n.setGoodsWidgetOptions(r),n.goodsWidgetOptions)),[JSON.stringify(r),null==r?void 0:r.itemClickHandler,null==r?void 0:r.openGoodsWidgetHandler]);return{commonOptions:s,gameReaderOptions:a,storyReaderOptions:(0,bc.useMemo)((()=>(i&&n.setStoryReaderOptions(i),n.storyReaderOptions)),[JSON.stringify(i)]),goodsWidgetOptions:o,inAppMessagingOptions:j}};var vg=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const mg=e=>{var{listType:t,feedSlug:i,testKey:r,storyManager:n,options:s,filter:a,useUgcCard:o=!1,hasFavorite:l,isFavorite:d}=e,c=vg(e,["listType","feedSlug","testKey","storyManager","options","filter","useUgcCard","hasFavorite","isFavorite"]);const[u,h]=(0,bc.useState)(),{desktopMode:p}=lg(),{storyListOptions:f}=(e=>{const t=(0,bc.useRef)(new lc).current;return{storyListOptions:(0,bc.useMemo)((()=>(e&&t.setStoriesListOptions(e),t.storiesListOptions)),[JSON.stringify(e)])}})(s),g=()=>{var e;null===(e=c.onLoadStart)||void 0===e||e.call(c)},v=e=>{var t;null===(t=c.onLoadEnd)||void 0===t||t.call(c,e)};return(0,bc.useEffect)((()=>{const e=n.createStoryList();return e.on("startLoading",g),e.on("endLoading",v),h(e),()=>{e.destroy()}}),[n]),(0,bc.useEffect)((()=>{null==u||u.setParams({listType:t,testKey:r,feedSlug:i,filter:a,useUgcCard:o,isFavorite:d,hasFavorite:l}),d||null==u||u.loadStories({needFavorite:!0})}),[u,r,i,a]),(0,bc.useEffect)((()=>{u&&(u.modeDesktop=p)}),[p,u]),{storyListViewModel:u,storyListOptions:f}};function bg(e){return!/^(-?\d|--)/.test(e)}function yg(e){const t=[];let i="",r="",n=7;for(let s,a=0;s=e.charAt(a);a++)if(/[a-zA-Z\d\xa0-\uffff_-]/.test(s)&&7===n)i+=s;else if("\\"===s&&7===n)n=6;else if(" "===s&&7===n){if(""!==i){if(!bg(i))return null;t.push(i),i=""}}else if(6===n)/[0-9a-f]/i.test(s)?(r+=s,n=8):(i+=s,n=7);else{if(8!==n)return null;/[0-9a-f]/i.test(s)&&r.length<6?r+=s:(i+=String.fromCodePoint(parseInt(r,16)),i+=s,r="",n=7)}if(""!==i){if(!bg(i))return null;t.push(i)}return t.join(" ")}function wg(e,t){let i=t,r="";const n={"font-family":[]};for(let t,s=0;t=e.charAt(s);s+=1)if(4!==i||'"'!==t&&"'"!==t)if(3===i&&","===t)i=4,r="";else if(4===i&&","===t){const e=yg(r);e&&n["font-family"].push(e),r=""}else if(5===i&&" "===t)/^(?:\+|-)?(?:[0-9]*\.)?[0-9]+(?:deg|grad|rad|turn)$/.test(r)?(n["font-style"]+=" "+r,r=""):s-=1,i=1;else if(1!==i||" "!==t&&"/"!==t)2===i&&" "===t?(/^(?:\+|-)?([0-9]*\.)?[0-9]+(?:em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)?$/.test(r)&&(n["line-height"]=r),i=4,r=""):r+=t;else{if(/^(?:(?:xx|x)-large|(?:xx|s)-small|small|large|medium)$/.test(r)||/^(?:larg|small)er$/.test(r)||/^(?:\+|-)?(?:[0-9]*\.)?[0-9]+(?:em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)$/.test(r))i="/"===t?2:4,n["font-size"]=r;else if(/^italic$/.test(r))n["font-style"]=r;else if(/^oblique$/.test(r))n["font-style"]=r,i=5;else if(/^small-caps$/.test(r))n["font-variant"]=r;else if(/^(?:bold(?:er)?|lighter|normal)$/.test(r))n["font-weight"]=r;else if(/^[+-]?(?:[0-9]*\.)?[0-9]+(?:e[+-]?(?:0|[1-9][0-9]*))?$/.test(r)){const e=parseFloat(r);e>=1&&e<=1e3&&(n["font-weight"]=r)}else/^(?:(?:ultra|extra|semi)-)?(?:condensed|expanded)$/.test(r)&&(n["font-stretch"]=r);r=""}else{let a=s+1;do{if(a=e.indexOf(t,a)+1,!a)return null}while("\\"===e.charAt(a-2));n["font-family"].push(e.slice(s+1,a-1).replace(/\\('|")/g,"$1")),s=a-1,i=3,r=""}if(3===i&&!/^\s*$/.test(r))return null;if(4===i){const e=yg(r);e&&n["font-family"].push(e)}return n}var Sg=S(9780),_g=S.n(Sg);class xg{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 xg;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 Og{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 i=_g()(e);t.top=parseFloat(i.top),t.bottom=parseFloat(i.bottom)}}catch(e){console.error(e)}const i=this.cardTitleOptions.lineClamp,r=Math.round(this.cardTitleFont.fontSize*this.cardTitleFont.lineHeight*100)/100;return t.top+t.bottom+i*r}measureScaledFontSizeInWebView(e){const t=document.createElement("span");t.style.fontSize=e+"px",t.style.display="none",this.obj.append(t);const i=getComputedStyle(t).fontSize;return this.obj.removeChild(t),parseFloat(i)||e}isOutsideTitle(){return this.cardTitleOptions.display&&(this.cardTitleOptions.position===u.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===u.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new xg;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 i=function(e){const t=wg(e,1);return null!==t&&t["font-size"]&&t["font-family"].length?t:null}(e);if(null!=i["font-style"]&&(t.fontStyle=i["font-style"]),null!=i["font-variant"]&&(t.fontVariant=i["font-variant"]),null!=i["font-weight"]&&(t.fontWeight=i["font-weight"]),null!=i["font-size"]){const e=parseFloat(i["font-size"]);String(`${e}px`)===i["font-size"]&&(t.fontSize=e)}if(null!=i["line-height"]){const e=parseFloat(i["line-height"]);String(`${e}px`)===i["line-height"]?t.lineHeight=Math.round(e/t.fontSize*100)/100:String(e)===i["line-height"]&&(t.lineHeight=parseFloat(i["line-height"]))}null!=i["font-family"]&&Array.isArray(i["font-family"])&&(t.fontFamily=i["font-family"])}catch(e){console.error(e)}return t}}class kg{constructor(e){Object.defineProperty(this,"storiesListOptions",{enumerable:!0,configurable:!0,writable:!0,value:e})}getStoriesListStyleOptions(e){var t,i,r,n,s,a;const o={storiesHeight:null!==(i=null===(t=this.storiesListOptions.card)||void 0===t?void 0:t.height)&&void 0!==i?i:70,storiesLayoutHeight:null!==(n=null===(r=this.storiesListOptions.layout)||void 0===r?void 0:r.height)&&void 0!==n?n:0,storiesListTopPadding:null!==(s=this.storiesListOptions.topPadding)&&void 0!==s?s:0,storiesListBottomPadding:null!==(a=this.storiesListOptions.bottomPadding)&&void 0!==a?a:0};let l=parseFloat(o.storiesHeight),d=l;if(parseFloat(o.storiesLayoutHeight))return l=parseFloat(o.storiesLayoutHeight),{storiesListHeight:l,storiesListInnerHeight:d};return l+=parseFloat(o.storiesListTopPadding)+parseFloat(o.storiesListBottomPadding)+e,d+=e,{storiesListHeight:l,storiesListInnerHeight:d}}}var Cg=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};const Mg=(e,t)=>{const{dir:i,desktopMode:r}=lg(),n=(0,bc.useRef)(),s=(0,bc.useRef)(null),[a,o]=(0,bc.useState)(!1),[l,d]=(0,bc.useState)(null),c=()=>{clearTimeout(n.current),o(!0)},u=()=>{n.current=setTimeout((()=>o(!1)),100)},h=(0,bc.useCallback)((()=>{if(!l)return;const{x:e,y:t}=l.getCurrentPosition();l.testAttraction(e,t)}),[l]),p=(e,t)=>Cg(void 0,void 0,void 0,(function*(){t>0&&(yield(e=>Cg(void 0,void 0,void 0,(function*(){const t=i=>{e.elementRef.clientWidth>0?i():requestAnimationFrame((()=>t(i)))};return new Promise((e=>{requestAnimationFrame((()=>t(e)))}))})))(e));const{x:i,y:r}=e.getCurrentPosition();e.testAttraction(i,r)}));return(0,bc.useEffect)((()=>{if(!s.current)return;const e=new cs;return e.mount(s.current),d(e),e.on("scrollstart",c),e.on("scrollend",u),()=>{e.destroy(),e.off("scrollstart",c),e.off("scrollend",u)}}),[]),(0,bc.useEffect)((()=>{l&&(l.setGap(e.card.gap),l.setDesktopMode(r),l.changeDirection(e.direction))}),[l,e.card.gap,r,e.direction]),(0,bc.useEffect)((()=>{l&&(l.setTextDirection(i),l.scrollTo(0,0))}),[l,i]),(0,bc.useEffect)((()=>{l&&(l.scrollTo(0,0),p(l,t))}),[l,t]),(0,bc.useEffect)((()=>(window.addEventListener("resize",h),()=>{window.addEventListener("resize",h)})),[l,h]),{sliderRef:s,slider:l,isScrolling:a}};var Pg=S(1938),jg={insert:"head",singleton:!1};xc()(Pg.A,jg);const Eg=Pg.A.locals||{},Lg=({slider:e,storyListViewModel:t,storyListOptions:i,isFavorite:r,listType:n,feed:s,filter:a,storyManager:o})=>{const l=(({storyManager:e,listType:t,feed:i,filter:r})=>{const[n,s]=(0,bc.useState)();return(0,bc.useEffect)((()=>{const n=new Ed(e,{listType:t,feed:i,filter:r}).create();return s(n),()=>{n.destroy()}}),[i,JSON.stringify(r)]),n})({listType:n,feed:s,filter:a,storyManager:o}),d=(0,bc.useCallback)(as()((()=>{if(!e||!l)return;const{x:t,y:i}=e.getCurrentPosition();l.calculate(t,i)}),300),[e,l]),c=(0,bc.useCallback)((()=>{if(!e||!l)return;const t=e.elementRef.getBoundingClientRect(),i=new _d(t.left,t.top,t.width,t.height),r=Array.from(e.slides),n=new _d(0,0,window.innerWidth,window.innerHeight),s=u();l.updateGeometry({stories:r,storyListRect:i,windowRect:n,viewportPadding:s}),d()}),[e,l,d]);(0,bc.useEffect)((()=>{if(!e||r||!l)return;const t=l.startScroll.bind(l),i=l.endScroll.bind(l);return e.addListener("scrollstart",t),e.addListener("scrollend",i),window.addEventListener("scroll",c),window.addEventListener("resize",c),()=>{e.removeListener("scrollstart",t),e.removeListener("scrollend",i),window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}}),[e,r,c]),(0,bc.useEffect)((()=>{r||c()}),[i.direction,i.card.aspectRatio,i.card.height,t.defaultStories.length,r,c]),(0,bc.useEffect)((()=>{if(!l)return;const e=({id:e})=>l.markStoryAsFullVisible(e);return qt.on("publicEvents.showStory",e),()=>{qt.off("publicEvents.showStory",e)}}),[l,t]);const u=()=>{const e=i.sidePadding,t={left:e,right:e,top:i.topPadding,bottom:i.bottomPadding};return"vertical"===i.direction&&(t.left=0,t.right=0),t}},Ag=(e,t,i)=>{const{dir:r}=lg();(0,bc.useEffect)((()=>{if(e&&t.autoScrollOnStoryClose)return qt.on(vo.Close,n),()=>{qt.off(vo.Close,n)}}),[e,t.direction,t.autoScrollOnStoryClose]);const n=({id:n})=>{if(!e)return;const s=((e,t)=>e.slides.find((e=>Number(e.dataset.id)===t)))(e,n);if(!s)return;const a=(e=>{const{x:t,y:r}=e.getCurrentPosition(),n=i.current.getBoundingClientRect();return new _d(n.x+t,n.y+r,n.width,n.height)})(e),o=((e,t)=>new _d("ltr"===r?e.offsetLeft:t.width-e.offsetLeft-e.clientWidth,e.offsetTop,e.clientWidth,e.clientHeight))(s,a);if(o.overlaps(a))return;const l="horizontal"===t.direction?o.x:s.offsetTop;e.scrollTo(l)}},Ig=(0,bc.forwardRef)(((e,t)=>{const i=e.sliderOptions.card,r=e.sliderOptions.favoriteCard,n=i.border,s=i.opened.border,a=e.sliderOptions.navigation,o=()=>{var e,t,i;return(null!==(e=s.radius)&&void 0!==e?e:n.radius)-parseFloat(null!==(t=s.width)&&void 0!==t?t:n.width)-parseFloat(null!==(i=s.gap)&&void 0!==i?i:n.gap)};return(0,vc.jsx)("div",{dir:e.dir,ref:t,className:e.className,style:Object.assign(Object.assign({},(()=>{var t,l,d,c,u,h,p,f,g,v,m,b,y,w,S,_,x,O,k,C,M;const P=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},j={"--storiesBorderNotReadColor":n.color,"--storiesBorderReadColor":null!==(t=s.color)&&void 0!==t?t:n.color,"--storiesBorderNotReadGradientColor":null==n?void 0:n.gradient,"--storiesBorderReadGradientColor":null!==(l=null==s?void 0:s.gradient)&&void 0!==l?l:null==n?void 0:n.gradient,"--storiesListCardFavoriteGradientColor":null===(d=e.sliderOptions.favoriteCard.border)||void 0===d?void 0:d.gradient,"--storiesListCardUgcGradientColor":null===(c=e.sliderOptions.ugcCard.border)||void 0===c?void 0:c.gradient,"--storiesGap":i.gap+"px","--storiesHeight":i.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":n.width+"px","--storiesListBorderReadWidth":(null!==(u=s.width)&&void 0!==u?u:s.width)+"px","--storiesListBorderGapNotRead":n.gap+"px","--storiesListBorderGapRead":(null!==(h=s.gap)&&void 0!==h?h:s.gap)+"px","--storiesListBorderRadius":n.radius+"px","--storiesListBorderRadiusRead":(null!==(p=s.radius)&&void 0!==p?p:s.radius)+"px","--storiesListItemMaskColor":i.mask.color,"--storiesListItemOpenedMaskColor":null!==(f=i.opened.mask.color)&&void 0!==f?f:i.mask.color,"--storiesListItemMaskLinearGradient":P(i.mask),"--storiesListItemOpenedMaskLinearGradient":P(null!=(null===(v=null===(g=i.opened)||void 0===g?void 0:g.mask)||void 0===v?void 0:v.linearGradient)?i.opened.mask:i.mask),"--storiesListCardFavoriteTitle":Ji(r.title.padding.toString())?r.title.padding+"px":r.title.padding,"--storiesListCardFavoriteGap":Ji(r.gap.toString())?r.gap+"px":r.gap,"--storiesListCardUgcMaskColor":e.sliderOptions.ugcCard.mask.color,"--storiesListCardUgcMaskLinearGradient":P(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleFontFamily":"InternalPrimaryFont","--storiesListItemTitleFont":i.title.font,"--storiesListItemTitlePadding":Ji(i.title.padding.toString())?i.title.padding+"px":i.title.padding,"--storiesListControlsSize":Ji(a.controlsSize.toString())?a.controlsSize+"px":a.controlsSize,"--storiesListControlsBackgroundColor":a.controlsBackgroundColor,"--storiesListControlsColor":a.controlsColor,"--storiesListInnerBorderRadiusNotRead":n.radius-parseFloat(n.width)-parseFloat(n.gap)+"px","--storiesListInnerBorderRadiusRead":o()+"px","--storiesListCardDropShadow":i.dropShadow,"--storiesListCardOpenedDropShadow":null!==(m=i.opened.dropShadow)&&void 0!==m?m:i.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":(null===(b=i.svgMask)||void 0===b?void 0:b.cardMask)?`url("data:image/svg+xml,${qi(null===(y=i.svgMask)||void 0===y?void 0:y.cardMask)}")`:null,"--storiesListCardOpenedMask":(null===(w=i.opened.svgMask)||void 0===w?void 0:w.cardMask)?`url("data:image/svg+xml,${qi(null===(S=i.opened.svgMask)||void 0===S?void 0:S.cardMask)}")`:null,"--storiesListCardFavoriteMask":(null===(_=e.sliderOptions.ugcCard.svgMask)||void 0===_?void 0:_.cardMask)?`url("data:image/svg+xml,${qi(null===(x=e.sliderOptions.ugcCard.svgMask)||void 0===x?void 0:x.cardMask)}")`:null};let E=null;return E=null===(O=i.svgMask)||void 0===O?void 0:O.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>j[`--storiesListCardOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${qi(e.mask)}")`:null)),E=null===(k=i.opened.svgMask)||void 0===k?void 0:k.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>j[`--storiesListCardOpenedOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${qi(e.mask)}")`:null)),E=null===(C=e.sliderOptions.favoriteCard.svgMask)||void 0===C?void 0:C.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>j[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${qi(e.mask)}")`:null)),E=null===(M=e.sliderOptions.ugcCard.svgMask)||void 0===M?void 0:M.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>j[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${qi(e.mask)}")`:null)),j})()),e.style),children:e.children})})),Tg=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),Rg=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const i=(0,bc.useRef)(null);return(0,bc.useEffect)((()=>{(()=>{if(!e)return;const r=i.current,n=()=>{r.play().then((()=>{if(Tg){let e=1;const i=()=>{e>=2&&(r.removeEventListener("timeupdate",i),r.currentTime=0,t()),e++};r.addEventListener("timeupdate",i,!1)}else t()})).catch((e=>{console.error(e)})),r.removeEventListener("canplaythrough",n)};r.addEventListener("canplaythrough",n),r.load()})()}),[]),(0,vc.jsx)("video",{ref:i,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},Dg=({story:e,cardOptions:t,favoriteCardOptions:i,ugcCardOptions:r})=>{const n=(e,t)=>null!=t&&Array.isArray(t)?t.map(((t,i)=>s(t,e,i))):[],s=(e,t,i)=>({maskImage:`var(--${t}${i}Mask)`,WebKitMaskImage:`var(--${t}${i}Mask)`,background:e.background});return{getAllCardsOverlayMaskStyles:()=>{let s=[];var a;return e.isFavoriteCard&&(s=s.concat(n("storiesListCardFavoriteOverlay",null===(a=i.svgMask)||void 0===a?void 0:a.overlayMask))),s=e.isUgcCard?s.concat((()=>{var e;return n("storiesListCardUgcOverlay",null===(e=r.svgMask)||void 0===e?void 0:e.overlayMask)})()):e.isOpened?s.concat((()=>{var e;return n("storiesListCardOpenedOverlay",null===(e=t.opened.svgMask)||void 0===e?void 0:e.overlayMask)})()):s.concat((()=>{var e;return n("storiesListCardOverlay",null===(e=t.svgMask)||void 0===e?void 0:e.overlayMask)})()),s}}};var Bg=S(2811),Ng={insert:"head",singleton:!1};xc()(Bg.A,Ng);const Fg=Bg.A.locals||{},Wg=(0,pu.observer)((({story:e,cardOptions:t,favoriteCardOptions:i,ugcCardOptions:r,wrapperStyle:n,children:s,onClick:a})=>{const o={story:e,cardOptions:t,favoriteCardOptions:i,ugcCardOptions:r},[l,d]=(0,bc.useState)(!1),{getAllCardsOverlayMaskStyles:h}=Dg(o),{getCardTitleAlignClass:p,getTitleStyle:f,getTitleWrapperStyle:g}=(({story:e,cardOptions:t,favoriteCardOptions:i,ugcCardOptions:r})=>{const{dir:n}=lg();return{getCardTitleAlignClass:()=>{const e=t.title.textAlign,i=e===c.START||e===c.LEFT,r=e===c.END||e===c.RIGHT,s="ltr"===n;return{[Fg["align-left"]]:i&&s||r&&!s,[Fg["align-center"]]:e===c.CENTER,[Fg["align-right"]]:r&&s||i&&!s}},getTitleStyle:()=>{const i={};return e.titleColor&&t.title.position===u.CARD_INSIDE_BOTTOM&&Object.assign(i,{color:e.titleColor}),i.WebkitLineClamp=String(parseInt(t.title.lineClamp)),i},getTitleWrapperStyle:()=>{let t={};return e.titleColor&&e.isFavoriteCard&&(t=Object.assign(Object.assign({},t),{color:i.title.color})),e.titleColor&&e.isUgcCard&&(t=Object.assign(Object.assign({},t),{color:r.title.color})),t}}})(o),{getSlideClassList:v,getSlideStyleList:m,getSlideWrapperStyle:b}=(({story:e,cardOptions:t,favoriteCardOptions:i,ugcCardOptions:r})=>{var n;const s=null!==(n=t.aspectRatio)&&void 0!==n?n:e.getAspectRatio(t.variant);return{getSlideClassList:()=>{var n,s;const a=e.background;let o="";void 0!==a&&(o=Fg[`_background-color-${a.color}`+(!0===a.gradient?"-gradient":"")]);const l=(()=>{let n;return n=e.isFavoriteCard?i:e.isUgcCard?r:e.isOpened&&t.opened||t,n})(),d=Boolean(l.dropShadow),c=Boolean(null===(n=l.svgMask)||void 0===n?void 0:n.cardMask),u=Boolean(null===(s=l.border)||void 0===s?void 0:s.gradient);return[o,{[Fg["_is-read"]]:e.isOpened},{[Fg["_format-rectangle"]]:t.variant===P.STYLE_RECTANGLE},{[Fg["_format-circle"]]:t.variant===P.STYLE_CIRCLE},{[Fg["_format-quad"]]:t.variant===P.STYLE_QUAD},{[Fg["_favorite-cell"]]:e.isFavoriteCard},{[Fg["_ugc-cell"]]:e.isUgcCard},{[Fg["_has-drop-shadow"]]:d},{[Fg["_has-card-svg-mask"]]:c},{[Fg["_has-border-gradient-color"]]:u}]},getSlideStyleList:()=>{const i={width:s*t.height+"px",opacity:null!==t.opacity?t.opacity:1,boxShadow:t.boxShadow||"unset",height:`${t.height}px`};return e.isOpened&&(i.boxShadow=t.opened.boxShadow||i.boxShadow,i.opacity=null!==t.opened.opacity?t.opened.opacity:i.opacity),i},getSlideWrapperStyle:()=>{const e={};return e.width=s*t.height+"px",e}}})(o),y=e.getImageSrcByCoverQuality(t.coverQuality),w=t.title.position===u.CARD_INSIDE_BOTTOM,S=t.title.position===u.CARD_OUTSIDE_TOP,_=t.title.position===u.CARD_OUTSIDE_BOTTOM;return(0,vc.jsxs)("div",{"data-id":e.id,className:Sc()("ias-stories-slide-wrapper",Fg["stories-slide-wrapper"],{[Fg.isTitleCardOutsideTop]:S,[Fg.isTitleCardOutsideBottom]:_}),style:Object.assign(Object.assign({},b()),n),rel:"noreferrer",onClick:t=>{t.stopPropagation(),t.preventDefault(),a(e)},children:[t.title.display&&S&&(0,vc.jsx)("div",{className:Sc()(Fg["stories-slide__content"],Fg.__position_outside_top),style:g(),children:(0,vc.jsx)("div",{className:Sc()(Fg["stories-slide__title"],Fg.clamp,p()),style:f(),children:e.title})}),(0,vc.jsxs)("div",{className:Sc()("ias-stories-slide",Fg["stories-slide"],v()),style:m(),children:[(0,vc.jsxs)("div",{className:Fg["stories-slide__inner"],children:[(0,vc.jsx)("div",{className:Fg["stories-slide-image"],style:{backgroundColor:e.backgroundColor?e.backgroundColor:"transparent"},children:(0,vc.jsx)("div",{className:Fg["stories-slide-image__wrap"],children:(0,vc.jsxs)("div",{className:Sc()(Fg["stories-slide-image__image"],Fg._mode_list,{[Fg["video-loaded"]]:l,[Fg["ugc-card-cell"]]:e.isUgcCard}),children:[y&&(0,vc.jsx)("img",{src:y,alt:e.title,loading:t.coverLazyLoading?"lazy":"eager"},y),e.videoCoverSrc&&(0,vc.jsx)(Rg,{onVideoCoverLoaded:()=>d(!0),videoCoverSrc:e.videoCoverSrc}),s]})})}),(0,vc.jsx)("div",{className:Fg["stories-slide__mask"]}),t.title.display&&w&&(0,vc.jsx)("div",{className:Fg["stories-slide__content"],style:g(),children:(0,vc.jsx)("div",{className:Sc()(Fg["stories-slide__title"],Fg.clamp,p()),style:f(),children:e.title})})]}),h().map(((e,t)=>(0,vc.jsx)("div",{style:e,className:Fg["card-overlay-svg-mask"]},t)))]}),t.title.display&&_&&(0,vc.jsx)("div",{className:Sc()(Fg["stories-slide__content"],Fg.__position_outside_bottom),style:g(),children:(0,vc.jsx)("div",{className:Sc()(Fg["stories-slide__title"],Fg.clamp,p()),style:f(),children:e.title})})]})}));var Vg=S(2731),zg={insert:"head",singleton:!1};xc()(Vg.A,zg);const Ug=Vg.A.locals||{};var Gg=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const $g=e=>{var{sliderDirection:t,slider:i}=e,r=Gg(e,["sliderDirection","slider"]);const[n,s]=(0,bc.useState)(!0),[a,o]=(0,bc.useState)(!0),l=r.navigationOptions.speed;(0,bc.useEffect)((()=>(i.on("reachStart",d),i.on("reachEnd",c),()=>{i.off("reachStart",d),i.off("reachEnd",c)})),[i]);const d=()=>{s(i.reachStart)},c=()=>{o(i.reachEnd)};return r.navigationView?r.navigationView({dir:r.dir,defaultStyles:Ug,reachStart:n,reachEnd:a,onPrev:()=>i.scrollByDirection(-1,l),onNext:()=>i.scrollByDirection(1,l),slider:{direction:t,viewport:i.elementRef.getBoundingClientRect()}}):r.navigationOptions.showControls?(0,vc.jsxs)("div",{className:Sc()("ias-stories-list-controls",Ug["stories-list-controls"],Ug[t]),children:[(0,vc.jsx)("div",{onClick:()=>i.scrollByDirection(-1,l),className:Sc()("ias-control-start",Ug["control-start"],{[Ug["control-start_dir_rtl"]]:"rtl"===r.dir,[Ug["control-start_reach-start"]]:n,"ias-control-start_dir_rtl":"rtl"===r.dir,"ias-control-start_reach-start":n}),children:(0,vc.jsx)("div",{className:Sc()("ias-control-icon",Ug["control-icon"])})}),(0,vc.jsx)("div",{onClick:()=>i.scrollByDirection(1,l),className:Sc()("ias-control-end",Ug["control-end"],{[Ug["control-end_dir_rtl"]]:"rtl"===r.dir,[Ug["control-end_reach-end"]]:a,"ias-control-end_dir_rtl":"rtl"===r.dir,"ias-control-end_reach-end":a}),children:(0,vc.jsx)("div",{className:Sc()("ias-control-icon",Ug["control-icon"])})})]}):null};var Hg=S(7533),qg={insert:"head",singleton:!1};xc()(Hg.A,qg);const Qg=Hg.A.locals||{},Kg=({favoriteStories:e,cardOptions:t,favoriteCardOptions:i})=>{const r=e=>{var i;return{paddingTop:1/(null!==(i=t.aspectRatio)&&void 0!==i?i:e.getAspectRatio(t.variant))*100+"%"}},n=e=>{const t=e.getImageSrcByCoverQuality(i.coverQuality),r={};return t?r.backgroundImage=`url('${t}')`:r.backgroundColor=e.backgroundColor,r};return(0,vc.jsx)("div",{className:Qg["favorite-images-wrapper"],children:e.slice(0,4).map(((e,i)=>(0,vc.jsx)("div",{className:Qg["favorite-image-wrapper"],children:(0,vc.jsx)("div",{style:r(e),className:Sc()(Qg["favorite-image"],{[Qg.circle_style]:t.variant===P.STYLE_CIRCLE}),children:(0,vc.jsx)("div",{className:Qg["favorite-image-item"],style:n(e)})})},i)))})};var Yg=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};const Zg=(0,pu.observer)((0,bc.forwardRef)(((e,t)=>{var{isFavorite:i=!1,storyListViewModel:r}=e,n=Yg(e,["isFavorite","storyListViewModel"]);const s=(0,bc.useRef)(null),a=(0,bc.useRef)(null);((e,t)=>{(0,bc.useImperativeHandle)(e,(()=>({reload:t.reload.bind(t)})),[t])})(t,r);const o=((e,t)=>{const[i,r]=(0,bc.useState)(t);(0,bc.useLayoutEffect)((()=>{const i=e.current;n(i,t),r(t)}),[JSON.stringify(t)]);const n=(e,t)=>{const i=new Og(e,t.card.title);s(i,t),a(i,t)},s=(e,t)=>{const i=e.getCardTitleFont();i.fontSize=e.getScaledFontSizeInWebView(),t.card.title.font=i.toString()},a=(e,t)=>{const i=new kg(t),{storiesListHeight:r,storiesListInnerHeight:n}=i.getStoriesListStyleOptions(e.getStoryTitleBlockHeight()),s=t.layout.height;t.layout.height=Yd()(s)?`${r}px`:s};return i})(s,n.storyListOptions),d=(({isFavorite:e,storyListViewModel:t,storyListOptions:i})=>{let r=[];return e?r=t.favoriteStories.slice():(r=t.defaultStories.slice(),t.hasFavoriteCard&&r.push(wd.create(t,i.favoriteCard)),t.hasUgcCard&&r.unshift(Sd.create(t,i.ugcCard))),r})({isFavorite:i,storyListViewModel:r,storyListOptions:o}),{sliderRef:c,slider:h,isScrolling:p}=Mg(o,d.length);Lg({slider:h,storyListViewModel:r,storyListOptions:o,isFavorite:i,listType:n.listType,feed:n.feedSlug,filter:n.filter,storyManager:n.storyManager}),Ag(h,o,a);const{getRootStyle:f,getStoryWrapperStyle:g,viewportInnerClassList:v,viewportInnerStyle:m}=(e=>{const{dir:t,desktopMode:i}=lg();return{getRootStyle:()=>({"--background-color":e.layout.backgroundColor,paddingLeft:e.sidePadding+"px",paddingRight:e.sidePadding+"px","--storiesListTopPadding":e.topPadding+"px","--storiesListBottomPadding":e.bottomPadding+"px","--storiesListSidePadding":e.sidePadding+"px",backgroundColor:e.layout.backgroundColor}),getStoryWrapperStyle:(t,i)=>{const r={marginRight:"0",paddingLeft:"0",paddingRight:"0"};return"vertical"===e.direction||(t!==i-1?r.marginRight=e.card.gap+"px":r.paddingRight=e.sidePadding+"px",0===t&&(r.paddingLeft=e.sidePadding+"px")),r},viewportInnerClassList:i?Sc()(Eg["stories-list__viewport-inner"],Eg["mode-desktop"],{[Eg["with-list-controls"]]:e.navigation.showControls,[Eg.isTitleCardOutsideTop]:e.card.title.position===u.CARD_OUTSIDE_TOP,[Eg.isTitleCardOutsideBottom]:e.card.title.position===u.CARD_OUTSIDE_BOTTOM,[Eg.isVerticalDirection]:"vertical"===e.direction}):Sc()(Eg["stories-list__viewport-inner"],Object.assign(Object.assign({},(()=>{const i=e.layout.sliderAlign,r=i===l.START||i===l.LEFT,n=i===l.END||i===l.RIGHT,s="ltr"===t;return{[Eg["align-left"]]:r&&s||n&&!s,[Eg["align-center"]]:i===l.CENTER,[Eg["align-right"]]:n&&s||r&&!s}})()),{[Eg.isTitleCardOutsideTop]:e.card.title.position===u.CARD_OUTSIDE_TOP,[Eg.isTitleCardOutsideBottom]:e.card.title.position===u.CARD_OUTSIDE_BOTTOM,[Eg.isVerticalDirection]:"vertical"===e.direction})),viewportInnerStyle:{height:e.layout.height,gap:"vertical"===e.direction?`${e.card.gap}px`:0}}})(o),b=o.card,y=o.favoriteCard,w=o.ugcCard;return(0,vc.jsxs)(Ig,{className:Sc()("ias-stories-list-wrapper",Eg["stories-list-wrapper"],{[Eg["mode-desktop"]]:r.modeDesktop,[Eg["with-list-controls"]]:o.navigation.showControls,"ias-mode-desktop":r.modeDesktop,"ias-with-list-controls":o.navigation.showControls}),dir:n.dir,style:f(),sliderOptions:o,ref:s,children:[(0,vc.jsx)("div",{className:Sc()("ias-stories-list",Eg["stories-list"]),children:(0,vc.jsx)("div",{ref:a,className:Sc()(Eg["stories-list__viewport"],{[Eg["mode-desktop"]]:r.modeDesktop,"ias-mode-desktop":r.modeDesktop}),style:"horizontal"===o.direction?{marginLeft:-o.sidePadding+"px",marginRight:-o.sidePadding+"px"}:{},children:(0,vc.jsx)("div",{ref:c,className:v,style:m,children:d.map(((e,t)=>{var i;const s=e instanceof bd,a=n.storyCardView&&!s;return s&&n.favoriteCardView?(0,vc.jsx)(yc().Fragment,{children:n.favoriteCardView(e)},e.id):(0,vc.jsx)(yc().Fragment,{children:a?null===(i=n.storyCardView)||void 0===i?void 0:i.call(n,e):(0,vc.jsx)(Wg,{story:e,cardOptions:b,favoriteCardOptions:y,ugcCardOptions:w,wrapperStyle:g(t,d.length),onClick:()=>((e,t)=>{var i,s,a;p||(null===(i=n.onStoryCardClick)||void 0===i||i.call(n,e),e.isUgcCard?null===(s=n.onUgcCardClick)||void 0===s||s.call(n):e.isFavoriteCard?null===(a=n.onFavoriteCardClick)||void 0===a||a.call(n):r.onStoryClick(e,t))})(e,t),children:s&&(0,vc.jsx)(Kg,{favoriteStories:r.favoriteStories,favoriteCardOptions:o.favoriteCard,cardOptions:b})},e.id)},e.id)}))})})}),h&&(0,vc.jsx)($g,{dir:n.dir,navigationOptions:o.navigation,navigationView:n.navigationView,sliderDirection:o.direction,storiesLength:d.length,slider:h})]})}))),Jg=(0,pu.observer)((0,bc.forwardRef)(((e,t)=>{var i,r,n;const{storyManager:s,dir:a}=lg(),o=null!==(i=e.feedSlug)&&void 0!==i?i:"default",l=We.DEFAULT,{storyListViewModel:d,storyListOptions:c}=mg(Object.assign(Object.assign({},e),{storyManager:s,feedSlug:o,listType:l,hasFavorite:Boolean(e.hasFavorite),isFavorite:!1}));return d&&(null===(r=d.session)||void 0===r?void 0:r.session.id)?(0,vc.jsx)(Zg,Object.assign({},e,{dir:a,storyManager:s,feedSlug:null!==(n=e.feedSlug)&&void 0!==n?n:"default",listType:We.DEFAULT,storyListViewModel:d,storyListOptions:c,onStoryCardClick:e.onStoryCardClick,onFavoriteCardClick:()=>{var t;s.emit("clickOnFavoriteCell",{feed:o}),null===(t=e.onFavoriteCardClick)||void 0===t||t.call(e)},ref:t})):null}))),Xg=(0,pu.observer)((0,bc.forwardRef)(((e,t)=>{var i;const{storyManager:r,dir:n}=lg(),s=nc,a=We.UGC,{storyListViewModel:o,storyListOptions:l}=mg(Object.assign(Object.assign({},e),{storyManager:r,feedSlug:s,listType:a,isFavorite:!1,hasFavorite:!1}));return o&&(null===(i=o.session)||void 0===i?void 0:i.session.id)?(0,vc.jsx)(Zg,Object.assign({},e,{ref:t,dir:n,storyListOptions:l,storyManager:r,listType:We.UGC,feedSlug:nc,storyListViewModel:o,onStoryCardClick:e.onStoryCardClick})):null}))),ev=e=>{const{storyManager:t,dir:i}=lg(),r="default",n=We.DEFAULT,{storyListViewModel:s,storyListOptions:a}=mg(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:n,isFavorite:!0,hasFavorite:!0}));return s?(0,vc.jsx)(Zg,Object.assign({},e,{storyListOptions:a,storyManager:t,dir:i,feedSlug:r,listType:n,storyListViewModel:s,isFavorite:!0})):null};var tv=S(2432),iv={insert:"head",singleton:!1};xc()(tv.A,iv);const rv=tv.A.locals||{},nv=({open:e,options:t,storyListOptions:i,onClose:r})=>{var n,s;const{dir:a}=lg();(0,bc.useLayoutEffect)((()=>{if(!e)return;const t=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=t}}),[e]);return e?(0,vc.jsx)("div",{className:rv["favorite-story-list-modal"],style:(()=>{var e,i,r,n;return{"--storiesFavoriteTitleColor":t.title.color,"--storiesFavoriteTitleFontFamily":"InternalPrimaryFont","--storiesFavoriteTitleFont":t.title.font,"--storiesFavoriteTitleBackgroundColor":t.title.backgroundColor,"--storiesFavoriteHeaderTopOffset":parseFloat(null!==(i=null===(e=t.headerTopOffset)||void 0===e?void 0:e.toString())&&void 0!==i?i:"0")+"px","--storiesFavoriteBottomOffset":parseFloat(null!==(n=null===(r=t.bottomOffset)||void 0===r?void 0:r.toString())&&void 0!==n?n:"0")+"px","--storiesFavoriteBackgroundColor":t.backgroundColor}})(),children:(0,vc.jsxs)("div",{className:rv.container,children:[(0,vc.jsxs)("div",{className:rv.header,children:[(0,vc.jsx)("p",{className:rv.title,children:t.title.content}),(0,vc.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),r()},className:rv["header__close-btn"],style:(()=>{const e="start"===t.closeButtonPosition||"left"===t.closeButtonPosition,i="ltr"===a;return{[e&&i||!e&&!i?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:null!==(s=null===(n=t.closeButton)||void 0===n?void 0:n.svgSrc.baseState)&&void 0!==s?s:""}})]}),(0,vc.jsx)("div",{className:rv.content,children:(0,vc.jsx)("div",{className:rv["favorite-story-list"],children:(0,vc.jsx)(ev,{options:Object.assign(Object.assign(Object.assign({},i),{sidePadding:0}),{direction:p.COLUMN,layout:{height:"auto"}})})})}),(0,vc.jsx)("div",{className:rv.footer}),(0,vc.jsx)("div",{className:rv["bottom-offset"]})]})}):null},sv=({storyList:e,onStoryCardClick:t,onFavoriteCardClick:i})=>{const[r,n]=(0,bc.useState)(e.appearanceManager.storiesListOptions),s=(0,bc.useRef)(null);return(0,bc.useEffect)((()=>{e.api=s.current}),[]),(0,bc.useEffect)((()=>(e.appearanceManager.on(oc.EVENT_UPDATED_STORIES_LIST_OPTIONS,n),()=>{e.appearanceManager.off(oc.EVENT_UPDATED_STORIES_LIST_OPTIONS,n)})),[e.appearanceManager]),(0,fu.createPortal)((0,vc.jsx)(Jg,{ref:s,options:r,hasFavorite:e.appearanceManager.commonOptions.hasFavorite,testKey:e.testKey,useUgcCard:e.useUgcCard,feedSlug:e.feedSlug,onLoadStart:()=>{e.emit(f.START_LOADER)},onLoadEnd:t=>{e.emit(f.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()},onFavoriteCardClick:i,onStoryCardClick:t},e.mountSelector),document.querySelector(e.mountSelector))},av=({ugcStoryList:e,onStoryCardClick:t})=>{const[i,r]=(0,bc.useState)(e.appearanceManager.storiesListOptions),n=(0,bc.useRef)(null);return(0,bc.useEffect)((()=>{e.api=n.current}),[]),(0,bc.useEffect)((()=>(e.appearanceManager.on(oc.EVENT_UPDATED_STORIES_LIST_OPTIONS,r),()=>{e.appearanceManager.off(oc.EVENT_UPDATED_STORIES_LIST_OPTIONS,r)})),[e.appearanceManager]),(0,fu.createPortal)((0,vc.jsx)(Xg,{ref:n,options:i,testKey:e.testKey,useUgcCard:e.useUgcCard,onStoryCardClick:t,onLoadStart:()=>{e.emit(f.START_LOADER)},onLoadEnd:t=>{e.emit(f.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()}}),document.querySelector(e.mountSelector))},ov=e=>{const[t,i]=(0,bc.useState)(!1);return(0,vc.jsxs)(og,{config:e.storyManagerConfigDto,storyReaderOptions:e.appearanceManager.storyReaderOptions,commonOptions:e.appearanceManager.commonOptions,gameReaderOptions:e.appearanceManager.gameReaderOptions,goodsWidgetOptions:e.appearanceManager.goodsWidgetOptions,children:[e.storyLists.map((t=>(0,vc.jsx)(sv,{onFavoriteCardClick:()=>{i(!0)},onStoryCardClick:()=>{e.onAppearanceManagerChange(t.appearanceManager)},storyList:t},t.mountSelector))),e.ugcStoryLists.map((t=>(0,vc.jsx)(av,{ugcStoryList:t,onStoryCardClick:()=>{e.onAppearanceManagerChange(t.appearanceManager)}},t.mountSelector))),(0,vc.jsx)(nv,{open:t,onClose:()=>i(!1),options:e.appearanceManager.storyFavoriteReaderOptions,storyListOptions:e.appearanceManager.storiesListOptions})]})};var lv=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class dv{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storyLists",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"ugcStoryLists",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:new lc}),this.createAppRoot(),this.handleAppearanceManagerUpdate=this.handleAppearanceManagerUpdate.bind(this),this.setAppearanceManager=this.setAppearanceManager.bind(this)}setStoryList(e){return lv(this,void 0,void 0,(function*(){yield this.storyManager.waitStoryManagerConfig(),this.storyLists=e.slice(),this.render()}))}setUGCStoryList(e){return lv(this,void 0,void 0,(function*(){yield this.storyManager.waitStoryManagerConfig(),this.ugcStoryLists=e.slice(),this.render()}))}setStoryManagerConfig(e){this.storyManagerConfigDto=Object.assign(Object.assign({},this.storyManagerConfigDto),e),this.render()}setAppearanceManager(e){this.unscubscribeToAppearanceManagerEvents(),this.appearanceManager=e,this.subscribeToAppearanceManagerEvents(),this.render()}render(){this.root.render((0,vc.jsx)(ov,{storyManagerConfigDto:this.storyManagerConfigDto,appearanceManager:this.appearanceManager,ugcStoryLists:this.ugcStoryLists,storyLists:this.storyLists,onAppearanceManagerChange:this.setAppearanceManager}))}createAppRoot(){const e=document.createElement("div");e.id="ias-app",document.body.append(e),this.root=(0,mc.createRoot)(e)}subscribeToAppearanceManagerEvents(){this.appearanceManager.on(oc.UPDATE,this.handleAppearanceManagerUpdate)}unscubscribeToAppearanceManagerEvents(){this.appearanceManager.off(oc.UPDATE,this.handleAppearanceManagerUpdate)}handleAppearanceManagerUpdate(){this.render()}}var cv=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class uv extends t.EventEmitter{constructor(e,t,i,r,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"sharePage",{enumerable:!0,configurable:!0,writable:!0,value:null}),uc(t),this.showSharePage(e,t,n)}showSharePage(e,t,i){return cv(this,void 0,void 0,(function*(){this.app.setAppearanceManager(t),this.sharePage=yield this.storyManager.showSharePage(e,i)}))}closeStoryReader(){return cv(this,void 0,void 0,(function*(){var e;null===(e=this.sharePage)||void 0===e||e.closeStoryReader()}))}}var hv=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class pv extends(i()){constructor(e,t,i,r){super(),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"stackedStoryListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),uc(e),this.handleUpdate=this.handleUpdate.bind(this),this.stackedStoryListViewModel=new rd(this.storyManager,{feed:t.feed}),this.stackedStoryListViewModel.on("update",this.handleUpdate),this.loadStories().catch(console.error)}get stories(){return this.stackedStoryListViewModel.stories}get length(){return this.stackedStoryListViewModel.length}get activeIndex(){return this.stackedStoryListViewModel.activeIndex}get feedCoverSrc(){return this.stackedStoryListViewModel.feedCoverSrc}get top(){return this.stackedStoryListViewModel.top}reload(){return hv(this,void 0,void 0,(function*(){return this.stackedStoryListViewModel.reload()}))}destroy(){this.stackedStoryListViewModel.destroy(),this.stackedStoryListViewModel.removeAllListeners()}showStory(e){this.app.setAppearanceManager(this.appearanceManager),this.stackedStoryListViewModel.showStory(e)}on(e,t){return"update"===e?super.on(e,t):(this.stackedStoryListViewModel.on(e,t),this)}once(e,t){return this.stackedStoryListViewModel.once(e,t),this}off(e,t){return this.stackedStoryListViewModel.off(e,t),this}handleUpdate(e){this.emit("update",{id:e.id,title:e.title,titleColor:e.titleColor,hasAudio:e.hasAudio,hasSwipeUp:e.hasSwipeUp,isOpened:e.isOpened,deeplink:e.deeplink,gameInstanceId:e.gameInstanceId,hideInReader:e.hideInReader,hide_timeline:e.hideTimeline,cover:e.getCover(this.appearanceManager.storiesListOptions.card.coverQuality)})}loadStories(){return hv(this,void 0,void 0,(function*(){yield this.storyManager.waitStoryManagerConfig(),this.stackedStoryListViewModel.loadStories()}))}}var fv=function(e,t,i,r){return new(i||(i=Promise))((function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))};class gv{constructor(e){return Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new dv(ac)}),Object.defineProperty(this,"StoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends pc{constructor(e,t,i){super(e,t,i,gv.instance.app)}}}),Object.defineProperty(this,"UGCStoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends gc{constructor(e,t,i){super(e,t,i,gv.instance.app)}}}),Object.defineProperty(this,"SharePage",{enumerable:!0,configurable:!0,writable:!0,value:class extends uv{constructor(e,t,i){super(e,t,ac,gv.instance.app,i)}}}),Object.defineProperty(this,"StackedStoryList",{enumerable:!0,configurable:!0,writable:!0,value:class extends pv{constructor(e,t){super(e,t,ac,gv.instance.app)}}}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:new Ml(ac.inAppMessaging)}),gv.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),gv.instance):(gv.instance=this,this.app.setStoryManagerConfig(e),gv.instance)}get sdkVersionName(){return ac.sdkVersionName}get sdkVersionCode(){return ac.sdkVersionCode}set storyLinkClickHandler(e){ac.storyLinkClickHandler=e}static getInstance(){return gv.instance?gv.instance:null}static use(e,t){ac.use(e,t)}getConfig(){return ac.getConfig()}showOnboardingStories(e,t){return fv(this,void 0,void 0,(function*(){return uc(e),this.app.setAppearanceManager(e),ac.showOnboardingStories(t)}))}showStory(e,t){return fv(this,void 0,void 0,(function*(){uc(t),this.app.setAppearanceManager(t),yield ac.showStory(e)}))}showStoryOnce(e,t){return fv(this,void 0,void 0,(function*(){return uc(t),this.app.setAppearanceManager(t),ac.showStoryOnce(e)}))}closeAllReaders(){ac.closeAllReaders()}openGame(e,t){return fv(this,arguments,void 0,(function*(e,t,i={}){return uc(t),this.app.setAppearanceManager(t),ac.openGame(e,i)}))}closeGame(){return fv(this,void 0,void 0,(function*(){return ac.closeGame()}))}closeStoryReader(){return fv(this,void 0,void 0,(function*(){return ac.closeStoryReader()}))}getUgcEditorConfig(){return ac.getUgcEditorConfig()}closeGoodsWidget(){ac.closeGoodsWidget()}setLang(e){this.storyManagerConfigDto.lang=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}getNonce(){return X()}setUserId(e,t){return fv(this,void 0,void 0,(function*(){this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}))}setTags(e){this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){this.storyManagerConfigDto.imagePlaceholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}on(e,t){return ac.on(e,t),this}once(e,t){return ac.once(e,t),this}off(e,t){return ac.off(e,t),this}destroy(){null!=gv.instance&&(gv.instance=null,this.closeAllReaders())}}})(),_})()));
571
+ `;constructor(){super(),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){super.updated(e);const t=document.documentElement.style.overflow;this.viewModel?.activeMessage?(this.open=!0,document.documentElement.style.overflow="hidden"):(this.open=!1,document.documentElement.style.overflow=t)}getMessageTypeByEnviroment(e){return this.desktopMode&&e===hs.Fullscreen?(console.warn("[IAM]: desktop only supports modal window"),hs.Modal):e}createSlideGeometry(e){return(new Ra).create(e)}createMessageGeometry(e,t){return(new La).create(e,{appearanceOptions:t,vw:this.viewportController.vw,vh:this.viewportController.vh,desktopMode:this.desktopMode})}render(){const e=this.viewModel?.activeMessage,t=this.viewModel?.touchController;if(!e)return null;const s=e.type,i=this.createMessageGeometry(s,e.appearanceOptions),r=this.createSlideGeometry(i);return Kd.html`
572
+ <message-view-factory
573
+ type=${s}
574
+ @closed=${this.handleClosed}
575
+ .appearanceOptions=${e.appearanceOptions}
576
+ .geometry=${i}
577
+ .open=${this.open}
578
+ .desktopMode=${this.desktopMode}
579
+ .touchController=${t}>
580
+ <message-slide .slide=${e.slides[0]} .styleContext=${e.context.style} .geometry=${r}></message-slide>
581
+ </message-view-factory>
582
+ `}static{kc(t,n)}})})();const Mc=e=>{const{storyManager:t,desktopMode:s}=Ac(),i=(0,fn.useRef)(null);return(0,fn.useEffect)((()=>{const e=i.current;e.desktopMode=s,e.viewModel=t.inAppMessaging}),[t,s]),(0,gn.jsx)("iam-reader",{ref:i})},Lc=yn().createContext({dir:"ltr",storyManager:on,desktopMode:!1,commonOptions:i,storyReaderOptions:x,gameReaderOptions:r,goodsWidgetOptions:o,inAppMessagingOptions:k});let Oc=!1;const Ic=(0,cl.observer)((e=>{Bc(e.config),Dc(e);const{commonOptions:t,gameReaderOptions:s,storyReaderOptions:i,goodsWidgetOptions:r,inAppMessagingOptions:a}=jc(e),o=Rc(),n=(({storyManager:e})=>{const[t,s]=(0,fn.useState)(null);return(0,fn.useEffect)((()=>{const t=e.createStoryReader();return s(t),()=>{t.destroy()}}),[e]),t})({storyManager:on}),l=Qd({storyManager:on,desktopMode:o});(0,fn.useEffect)((()=>{if(Oc)throw new Error("There can only be one instance of <IASContainer /> per application");return Oc=!0,()=>{Oc=!1,on.clearConfig()}}),[]);const d=(0,fn.useMemo)((()=>getComputedStyle(document.documentElement).direction),[]),c=(0,fn.useMemo)((()=>({storyManager:on,desktopMode:o,dir:d,commonOptions:t,gameReaderOptions:s,storyReaderOptions:i,goodsWidgetOptions:r,inAppMessagingOptions:a})),[on,o,d,t,s,i,r]);return(0,gn.jsxs)(Lc.Provider,{value:c,children:[l?.isOpened&&(0,gn.jsx)(ul,{gameReader:l}),n?.isOpened&&(0,gn.jsx)($d,{storyReader:n,desktopMode:o}),(0,gn.jsx)(Mc,{}),e.children]})})),Ac=()=>(0,fn.useContext)(Lc);var Ec=_(3643);const Tc=_.n(Ec)().getParser(window.navigator.userAgent).parse(),Rc=()=>{const[e,t]=(0,fn.useState)(!1);(0,fn.useLayoutEffect)((()=>(s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)})),[]);const s=()=>{"mobile"===Tc.parsedResult.platform.type?t(!1):t(!0)};return e},Pc=e=>{const t=t=>{27===t.keyCode&&e()};(0,fn.useEffect)((()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)})),[])},Bc=e=>{(0,fn.useEffect)((()=>{on.setConfig(e)}),[JSON.stringify(e)])},Dc=({onClickOnStory:e,onShowStory:t,onCloseStory:s,onShowSlide:i,onClickOnButton:r,onLikeStory:a,onDislikeStory:o,onFavoriteStory:n,onShareStory:l,onShareStoryWithPath:d,onFeedImpression:c,onVisibleAreaUpdated:h,onWidgetEvent:u})=>{(0,fn.useEffect)((()=>(e&&on.on("clickOnStory",e),t&&on.on("showStory",t),s&&on.on("closeStory",s),i&&on.on("showSlide",i),r&&on.on("clickOnButton",r),a&&on.on("likeStory",a),o&&on.on("dislikeStory",o),n&&on.on("favoriteStory",n),l&&on.on("shareStory",l),d&&on.on("shareStoryWithPath",d),c&&on.on("feedImpression",c),h&&on.on("visibleAreaUpdated",h),u&&on.on("widgetEvent",u),()=>{e&&on.off("clickOnStory",e),t&&on.off("showStory",t),s&&on.off("closeStory",s),i&&on.off("showSlide",i),r&&on.off("clickOnButton",r),a&&on.off("likeStory",a),o&&on.off("dislikeStory",o),n&&on.off("favoriteStory",n),l&&on.off("shareStory",l),d&&on.off("shareStoryWithPath",d),c&&on.off("feedImpression",c),h&&on.off("visibleAreaUpdated",h),u&&on.off("widgetEvent",u)})),[e,t,s,i,r,a,o,n,l,d,c,h,u])},jc=({commonOptions:e,gameReaderOptions:t,storyReaderOptions:s,goodsWidgetOptions:i})=>{const r=(0,fn.useRef)(new ln).current,a=(0,fn.useMemo)((()=>(e&&r.setCommonOptions(e),r.commonOptions)),[JSON.stringify(e)]),o=(0,fn.useMemo)((()=>(t&&r.setGameReaderOptions(t),r.gameReaderOptions)),[JSON.stringify(t)]),n=(0,fn.useMemo)((()=>(i&&r.setGoodsWidgetOptions(i),r.goodsWidgetOptions)),[JSON.stringify(i),i?.itemClickHandler,i?.openGoodsWidgetHandler]);return{commonOptions:a,gameReaderOptions:o,storyReaderOptions:(0,fn.useMemo)((()=>(s&&r.setStoryReaderOptions(s),r.storyReaderOptions)),[JSON.stringify(s)]),goodsWidgetOptions:n,inAppMessagingOptions:k}},Fc=({listType:e,feedSlug:t,testKey:s,storyManager:i,options:r,filter:a,useUgcCard:o=!1,hasFavorite:n,isFavorite:l,...d})=>{const[c,h]=(0,fn.useState)(),{desktopMode:u}=Ac(),{storyListOptions:p}=(e=>{const t=(0,fn.useRef)(new ln).current;return{storyListOptions:(0,fn.useMemo)((()=>(e&&t.setStoriesListOptions(e),t.storiesListOptions)),[JSON.stringify(e)])}})(r),g=()=>{d.onLoadStart?.()},m=e=>{d.onLoadEnd?.(e)};return(0,fn.useEffect)((()=>{const e=i.createStoryList();return e.on("startLoading",g),e.on("endLoading",m),h(e),()=>{e.destroy()}}),[i]),(0,fn.useEffect)((()=>{c&&(c.setParams({listType:e,testKey:s,feedSlug:t,filter:a,useUgcCard:o,isFavorite:l,hasFavorite:n}),l||c.loadStories({needFavorite:!0}))}),[c,s,t,a]),(0,fn.useEffect)((()=>{c&&(c.modeDesktop=u)}),[u,c]),{storyListViewModel:c,storyListOptions:p}};function Nc(e){return!/^(-?\d|--)/.test(e)}function Uc(e){const t=[];let s="",i="",r=7;for(let a,o=0;a=e.charAt(o);o++)if(/[a-zA-Z\d\xa0-\uffff_-]/.test(a)&&7===r)s+=a;else if("\\"===a&&7===r)r=6;else if(" "===a&&7===r){if(""!==s){if(!Nc(s))return null;t.push(s),s=""}}else if(6===r)/[0-9a-f]/i.test(a)?(i+=a,r=8):(s+=a,r=7);else{if(8!==r)return null;/[0-9a-f]/i.test(a)&&i.length<6?i+=a:(s+=String.fromCodePoint(parseInt(i,16)),s+=a,i="",r=7)}if(""!==s){if(!Nc(s))return null;t.push(s)}return t.join(" ")}function zc(e,t){let s=t,i="";const r={"font-family":[]};for(let t,a=0;t=e.charAt(a);a+=1)if(4!==s||'"'!==t&&"'"!==t)if(3===s&&","===t)s=4,i="";else if(4===s&&","===t){const e=Uc(i);e&&r["font-family"].push(e),i=""}else if(5===s&&" "===t)/^(?:\+|-)?(?:[0-9]*\.)?[0-9]+(?:deg|grad|rad|turn)$/.test(i)?(r["font-style"]+=" "+i,i=""):a-=1,s=1;else if(1!==s||" "!==t&&"/"!==t)2===s&&" "===t?(/^(?:\+|-)?([0-9]*\.)?[0-9]+(?:em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)?$/.test(i)&&(r["line-height"]=i),s=4,i=""):i+=t;else{if(/^(?:(?:xx|x)-large|(?:xx|s)-small|small|large|medium)$/.test(i)||/^(?:larg|small)er$/.test(i)||/^(?:\+|-)?(?:[0-9]*\.)?[0-9]+(?:em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)$/.test(i))s="/"===t?2:4,r["font-size"]=i;else if(/^italic$/.test(i))r["font-style"]=i;else if(/^oblique$/.test(i))r["font-style"]=i,s=5;else if(/^small-caps$/.test(i))r["font-variant"]=i;else if(/^(?:bold(?:er)?|lighter|normal)$/.test(i))r["font-weight"]=i;else if(/^[+-]?(?:[0-9]*\.)?[0-9]+(?:e[+-]?(?:0|[1-9][0-9]*))?$/.test(i)){const e=parseFloat(i);e>=1&&e<=1e3&&(r["font-weight"]=i)}else/^(?:(?:ultra|extra|semi)-)?(?:condensed|expanded)$/.test(i)&&(r["font-stretch"]=i);i=""}else{let o=a+1;do{if(o=e.indexOf(t,o)+1,!o)return null}while("\\"===e.charAt(o-2));r["font-family"].push(e.slice(a+1,o-1).replace(/\\('|")/g,"$1")),a=o-1,s=3,i=""}if(3===s&&!/^\s*$/.test(i))return null;if(4===s){const e=Uc(i);e&&r["font-family"].push(e)}return r}var Vc=_(9780),Wc=_.n(Vc);class Gc{fontStyle;fontVariant;fontWeight;fontSize;lineHeight;fontFamily;toString(){return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${this.fontSize}px/${this.lineHeight} ${this.fontFamily.join(", ")}`}clone(){const e=new Gc;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 $c{obj;cardTitleOptions;cardTitleFont;constructor(e,t){this.obj=e,this.cardTitleOptions=t,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 s=Wc()(e);t.top=parseFloat(s.top),t.bottom=parseFloat(s.bottom)}}catch(e){console.error(e)}const s=this.cardTitleOptions.lineClamp,i=Math.round(this.cardTitleFont.fontSize*this.cardTitleFont.lineHeight*100)/100;return t.top+t.bottom+s*i}measureScaledFontSizeInWebView(e){const t=document.createElement("span");t.style.fontSize=e+"px",t.style.display="none",this.obj.append(t);const s=getComputedStyle(t).fontSize;return this.obj.removeChild(t),parseFloat(s)||e}isOutsideTitle(){return this.cardTitleOptions.display&&(this.cardTitleOptions.position===h.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===h.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new Gc;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 s=function(e){const t=zc(e,1);return null!==t&&t["font-size"]&&t["font-family"].length?t:null}(e);if(null!=s["font-style"]&&(t.fontStyle=s["font-style"]),null!=s["font-variant"]&&(t.fontVariant=s["font-variant"]),null!=s["font-weight"]&&(t.fontWeight=s["font-weight"]),null!=s["font-size"]){const e=parseFloat(s["font-size"]);String(`${e}px`)===s["font-size"]&&(t.fontSize=e)}if(null!=s["line-height"]){const e=parseFloat(s["line-height"]);String(`${e}px`)===s["line-height"]?t.lineHeight=Math.round(e/t.fontSize*100)/100:String(e)===s["line-height"]&&(t.lineHeight=parseFloat(s["line-height"]))}null!=s["font-family"]&&Array.isArray(s["font-family"])&&(t.fontFamily=s["font-family"])}catch(e){console.error(e)}return t}}class Hc{storiesListOptions;constructor(e){this.storiesListOptions=e}getStoriesListStyleOptions(e){const t={storiesHeight:this.storiesListOptions.card?.height??70,storiesLayoutHeight:this.storiesListOptions.layout?.height??0,storiesListTopPadding:this.storiesListOptions.topPadding??0,storiesListBottomPadding:this.storiesListOptions.bottomPadding??0};let s=parseFloat(t.storiesHeight),i=s;if(parseFloat(t.storiesLayoutHeight))return s=parseFloat(t.storiesLayoutHeight),{storiesListHeight:s,storiesListInnerHeight:i};return s+=parseFloat(t.storiesListTopPadding)+parseFloat(t.storiesListBottomPadding)+e,i+=e,{storiesListHeight:s,storiesListInnerHeight:i}}}var qc=_(1938),Qc={insert:"head",singleton:!1};Sn()(qc.A,Qc);const Kc=qc.A.locals||{},Yc=({slider:e,storyListViewModel:t,storyListOptions:s,isFavorite:i,listType:r,feed:a,filter:o,storyManager:n})=>{const l=(({storyManager:e,listType:t,feed:s,filter:i})=>{const[r,a]=(0,fn.useState)();return(0,fn.useEffect)((()=>{const r=new Mo(e,{listType:t,feed:s,filter:i}).create();return a(r),()=>{r.destroy()}}),[s,JSON.stringify(i)]),r})({listType:r,feed:a,filter:o,storyManager:n}),d=(0,fn.useCallback)(Pi()((()=>{if(!e||!l)return;const{x:t,y:s}=e.getCurrentPosition();l.calculate(t,s)}),300),[e,l]),c=(0,fn.useCallback)((()=>{if(!e||!l)return;const t=e.elementRef.getBoundingClientRect(),s=new vo(t.left,t.top,t.width,t.height),i=Array.from(e.slides),r=new vo(0,0,window.innerWidth,window.innerHeight),a=h();l.updateGeometry({stories:i,storyListRect:s,windowRect:r,viewportPadding:a}),d()}),[e,l,d]);(0,fn.useEffect)((()=>{if(!e||i||!l)return;const t=l.startScroll.bind(l),s=l.endScroll.bind(l);return e.addListener("scrollstart",t),e.addListener("scrollend",s),window.addEventListener("scroll",c),window.addEventListener("resize",c),()=>{e.removeListener("scrollstart",t),e.removeListener("scrollend",s),window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}}),[e,i,c]),(0,fn.useEffect)((()=>{!i&&e&&e.waitStoryListClientWidth().then((()=>{c()}))}),[e,s.direction,s.card.aspectRatio,s.card.height,t.stories,i,c]),(0,fn.useEffect)((()=>{if(!l)return;const e=({id:e})=>l.markStoryAsFullVisible(e);return fs.on("publicEvents.showStory",e),()=>{fs.off("publicEvents.showStory",e)}}),[l,t]);const h=()=>{const e=s.sidePadding,t={left:e,right:e,top:s.topPadding,bottom:s.bottomPadding};return"vertical"===s.direction&&(t.left=0,t.right=0),t}},Zc=(e,t,s)=>{const{dir:i}=Ac();(0,fn.useEffect)((()=>{if(e&&t.autoScrollOnStoryClose)return fs.on(ya.Close,r),()=>{fs.off(ya.Close,r)}}),[e,t.direction,t.autoScrollOnStoryClose]);const r=({id:r})=>{if(!e)return;const a=((e,t)=>e.slides.find((e=>Number(e.dataset.id)===t)))(e,r);if(!a)return;const o=(e=>{const{x:t,y:i}=e.getCurrentPosition(),r=s.current.getBoundingClientRect();return new vo(r.x+t,r.y+i,r.width,r.height)})(e),n=((e,t)=>new vo("ltr"===i?e.offsetLeft:t.width-e.offsetLeft-e.clientWidth,e.offsetTop,e.clientWidth,e.clientHeight))(a,o);if(n.overlaps(o))return;const l="horizontal"===t.direction?n.x:a.offsetTop;e.scrollTo(l)}},Jc=(0,fn.forwardRef)(((e,t)=>{const s=e.sliderOptions.card,i=e.sliderOptions.favoriteCard,r=s.border,a=s.opened.border,o=e.sliderOptions.navigation;return(0,gn.jsx)("div",{dir:e.dir,ref:t,className:e.className,style:{...(()=>{const t=e=>{let t="";return null!=e&&Array.isArray(e.linearGradient)&&(t=e.linearGradient.map((({direction:e,points:t})=>`linear-gradient(${[e,t].filter(Boolean).join(", ")})`)).join(", ")),t},n={"--storiesBorderNotReadColor":r.color,"--storiesBorderReadColor":a.color??r.color,"--storiesBorderNotReadGradientColor":r?.gradient,"--storiesBorderReadGradientColor":a?.gradient??r?.gradient,"--storiesListCardFavoriteGradientColor":e.sliderOptions.favoriteCard.border?.gradient,"--storiesListCardUgcGradientColor":e.sliderOptions.ugcCard.border?.gradient,"--storiesGap":s.gap+"px","--storiesHeight":s.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":r.width+"px","--storiesListBorderReadWidth":(a.width??a.width)+"px","--storiesListBorderGapNotRead":r.gap+"px","--storiesListBorderGapRead":(a.gap??a.gap)+"px","--storiesListBorderRadius":r.radius+"px","--storiesListBorderRadiusRead":(a.radius??a.radius)+"px","--storiesListItemMaskColor":s.mask.color,"--storiesListItemOpenedMaskColor":s.opened.mask.color??s.mask.color,"--storiesListItemMaskLinearGradient":t(s.mask),"--storiesListItemOpenedMaskLinearGradient":t(null!=s.opened?.mask?.linearGradient?s.opened.mask:s.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":t(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleFontFamily":"InternalPrimaryFont","--storiesListItemTitleFont":s.title.font,"--storiesListItemTitlePadding":G(s.title.padding.toString())?s.title.padding+"px":s.title.padding,"--storiesListControlsSize":G(o.controlsSize.toString())?o.controlsSize+"px":o.controlsSize,"--storiesListControlsBackgroundColor":o.controlsBackgroundColor,"--storiesListControlsColor":o.controlsColor,"--storiesListInnerBorderRadiusNotRead":r.radius-parseFloat(r.width)-parseFloat(r.gap)+"px","--storiesListInnerBorderRadiusRead":(a.radius??r.radius)-parseFloat(a.width??r.width)-parseFloat(a.gap??r.gap)+"px","--storiesListCardDropShadow":s.dropShadow,"--storiesListCardOpenedDropShadow":s.opened.dropShadow??s.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":s.svgMask?.cardMask?`url("data:image/svg+xml,${q(s.svgMask?.cardMask)}")`:null,"--storiesListCardOpenedMask":s.opened.svgMask?.cardMask?`url("data:image/svg+xml,${q(s.opened.svgMask?.cardMask)}")`:null,"--storiesListCardFavoriteMask":e.sliderOptions.ugcCard.svgMask?.cardMask?`url("data:image/svg+xml,${q(e.sliderOptions.ugcCard.svgMask?.cardMask)}")`:null};let l=null;return l=s.svgMask?.overlayMask,null!=l&&Array.isArray(l)&&l.forEach(((e,t)=>n[`--storiesListCardOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${q(e.mask)}")`:null)),l=s.opened.svgMask?.overlayMask,null!=l&&Array.isArray(l)&&l.forEach(((e,t)=>n[`--storiesListCardOpenedOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${q(e.mask)}")`:null)),l=e.sliderOptions.favoriteCard.svgMask?.overlayMask,null!=l&&Array.isArray(l)&&l.forEach(((e,t)=>n[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${q(e.mask)}")`:null)),l=e.sliderOptions.ugcCard.svgMask?.overlayMask,null!=l&&Array.isArray(l)&&l.forEach(((e,t)=>n[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${q(e.mask)}")`:null)),n})(),...e.style},children:e.children})})),Xc=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),eh=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const s=(0,fn.useRef)(null);return(0,fn.useEffect)((()=>{(()=>{if(!e)return;const i=s.current,r=()=>{i.play().then((()=>{if(Xc){let e=1;const s=()=>{e>=2&&(i.removeEventListener("timeupdate",s),i.currentTime=0,t()),e++};i.addEventListener("timeupdate",s,!1)}else t()})).catch((e=>{console.error(e)})),i.removeEventListener("canplaythrough",r)};i.addEventListener("canplaythrough",r),i.load()})()}),[]),(0,gn.jsx)("video",{ref:s,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},th=({story:e,cardOptions:t,favoriteCardOptions:s,ugcCardOptions:i})=>{const r=(e,t)=>null!=t&&Array.isArray(t)?t.map(((t,s)=>a(t,e,s))):[],a=(e,t,s)=>({maskImage:`var(--${t}${s}Mask)`,WebKitMaskImage:`var(--${t}${s}Mask)`,background:e.background});return{getAllCardsOverlayMaskStyles:()=>{let a=[];return e instanceof fo&&(a=a.concat(r("storiesListCardFavoriteOverlay",s.svgMask?.overlayMask))),a=e instanceof oo?a.concat(r("storiesListCardUgcOverlay",i.svgMask?.overlayMask)):e.isOpened?a.concat(r("storiesListCardOpenedOverlay",t.opened.svgMask?.overlayMask)):a.concat(r("storiesListCardOverlay",t.svgMask?.overlayMask)),a}}};var sh=_(2811),ih={insert:"head",singleton:!1};Sn()(sh.A,ih);const rh=sh.A.locals||{},ah=(0,cl.observer)((({story:e,cardOptions:t,favoriteCardOptions:s,ugcCardOptions:i,wrapperStyle:r,children:a,onClick:o})=>{const n={story:e,cardOptions:t,favoriteCardOptions:s,ugcCardOptions:i},[l,d]=(0,fn.useState)(!1),{getAllCardsOverlayMaskStyles:u}=th(n),{getCardTitleAlignClass:p,getTitleStyle:g,getTitleWrapperStyle:m}=(({story:e,cardOptions:t,favoriteCardOptions:s,ugcCardOptions:i})=>{const{dir:r}=Ac();return{getCardTitleAlignClass:()=>{const e=t.title.textAlign,s=e===c.START||e===c.LEFT,i=e===c.END||e===c.RIGHT,a="ltr"===r;return{[rh["align-left"]]:s&&a||i&&!a,[rh["align-center"]]:e===c.CENTER,[rh["align-right"]]:i&&a||s&&!a}},getTitleStyle:()=>{const s={};return e.titleColor&&t.title.position===h.CARD_INSIDE_BOTTOM&&Object.assign(s,{color:e.titleColor}),s.WebkitLineClamp=String(parseInt(t.title.lineClamp)),s},getTitleWrapperStyle:()=>{let t={};return e.titleColor&&e instanceof fo&&(t={...t,color:s.title.color}),e.titleColor&&e instanceof oo&&(t={...t,color:i.title.color}),t}}})(n),{getSlideClassList:f,getSlideStyleList:y,getSlideWrapperStyle:v}=(({story:e,cardOptions:t,favoriteCardOptions:s,ugcCardOptions:i})=>{const r=t.aspectRatio??e.getAspectRatio(t.variant);return{getSlideClassList:()=>{const r=e.background;let a="";void 0!==r&&(a=rh[`_background-color-${r.color}`+(!0===r.gradient?"-gradient":"")]);const o=(()=>{let r;return r=e instanceof fo?s:e instanceof oo?i:e.isOpened&&t.opened||t,r})(),n=Boolean(o.dropShadow),l=Boolean(o.svgMask?.cardMask),d=Boolean(o.border?.gradient);return[a,{[rh["_is-read"]]:e.isOpened},{[rh["_format-rectangle"]]:t.variant===C.STYLE_RECTANGLE},{[rh["_format-circle"]]:t.variant===C.STYLE_CIRCLE},{[rh["_format-quad"]]:t.variant===C.STYLE_QUAD},{[rh["_favorite-cell"]]:e instanceof fo},{[rh["_ugc-cell"]]:e instanceof oo},{[rh["_has-drop-shadow"]]:n},{[rh["_has-card-svg-mask"]]:l},{[rh["_has-border-gradient-color"]]:d}]},getSlideStyleList:()=>{const s={width:r*t.height+"px",opacity:null!==t.opacity?t.opacity:1,boxShadow:t.boxShadow||"unset",height:`${t.height}px`};return e.isOpened&&(s.boxShadow=t.opened.boxShadow||s.boxShadow,s.opacity=null!==t.opened.opacity?t.opened.opacity:s.opacity),s},getSlideWrapperStyle:()=>{const e={};return e.width=r*t.height+"px",e}}})(n),w=e.getImageSrcByCoverQuality(t.coverQuality),_=t.title.position===h.CARD_INSIDE_BOTTOM,S=t.title.position===h.CARD_OUTSIDE_TOP,b=t.title.position===h.CARD_OUTSIDE_BOTTOM;return(0,gn.jsxs)("div",{"data-id":e.id,className:wn()("ias-stories-slide-wrapper",rh["stories-slide-wrapper"],{[rh.isTitleCardOutsideTop]:S,[rh.isTitleCardOutsideBottom]:b}),style:{...v(),...r},rel:"noreferrer",onClick:t=>{t.stopPropagation(),t.preventDefault(),o(e)},children:[t.title.display&&S&&(0,gn.jsx)("div",{className:wn()(rh["stories-slide__content"],rh.__position_outside_top),style:m(),children:(0,gn.jsx)("div",{className:wn()(rh["stories-slide__title"],rh.clamp,p()),style:g(),children:e.title})}),(0,gn.jsxs)("div",{className:wn()("ias-stories-slide",rh["stories-slide"],f()),style:y(),children:[(0,gn.jsxs)("div",{className:rh["stories-slide__inner"],children:[(0,gn.jsx)("div",{className:rh["stories-slide-image"],style:{backgroundColor:e.backgroundColor?e.backgroundColor:"transparent"},children:(0,gn.jsx)("div",{className:rh["stories-slide-image__wrap"],children:(0,gn.jsxs)("div",{className:wn()(rh["stories-slide-image__image"],rh._mode_list,{[rh["video-loaded"]]:l,[rh["ugc-card-cell"]]:e instanceof oo}),children:[w&&(0,gn.jsx)("img",{src:w,alt:e.title,loading:t.coverLazyLoading?"lazy":"eager"},w),e.videoCoverSrc&&(0,gn.jsx)(eh,{onVideoCoverLoaded:()=>d(!0),videoCoverSrc:e.videoCoverSrc}),a]})})}),(0,gn.jsx)("div",{className:rh["stories-slide__mask"]}),t.title.display&&_&&(0,gn.jsx)("div",{className:rh["stories-slide__content"],style:m(),children:(0,gn.jsx)("div",{className:wn()(rh["stories-slide__title"],rh.clamp,p()),style:g(),children:e.title})})]}),u().map(((e,t)=>(0,gn.jsx)("div",{style:e,className:rh["card-overlay-svg-mask"]},t)))]}),t.title.display&&b&&(0,gn.jsx)("div",{className:wn()(rh["stories-slide__content"],rh.__position_outside_bottom),style:m(),children:(0,gn.jsx)("div",{className:wn()(rh["stories-slide__title"],rh.clamp,p()),style:g(),children:e.title})})]})}));var oh=_(2731),nh={insert:"head",singleton:!1};Sn()(oh.A,nh);const lh=oh.A.locals||{},dh=({sliderDirection:e,slider:t,...s})=>{const[i,r]=(0,fn.useState)(!0),[a,o]=(0,fn.useState)(!0),n=s.navigationOptions.speed;(0,fn.useEffect)((()=>(t.on("reachStart",l),t.on("reachEnd",d),()=>{t.off("reachStart",l),t.off("reachEnd",d)})),[t]);const l=()=>{r(t.reachStart)},d=()=>{o(t.reachEnd)};return s.navigationView?s.navigationView({dir:s.dir,defaultStyles:lh,reachStart:i,reachEnd:a,onPrev:()=>t.scrollByDirection(-1,n),onNext:()=>t.scrollByDirection(1,n),slider:{direction:e,viewport:t.elementRef.getBoundingClientRect()}}):s.navigationOptions.showControls?(0,gn.jsxs)("div",{className:wn()("ias-stories-list-controls",lh["stories-list-controls"],lh[e]),children:[(0,gn.jsx)("div",{onClick:()=>t.scrollByDirection(-1,n),className:wn()("ias-control-start",lh["control-start"],{[lh["control-start_dir_rtl"]]:"rtl"===s.dir,[lh["control-start_reach-start"]]:i,"ias-control-start_dir_rtl":"rtl"===s.dir,"ias-control-start_reach-start":i}),children:(0,gn.jsx)("div",{className:wn()("ias-control-icon",lh["control-icon"])})}),(0,gn.jsx)("div",{onClick:()=>t.scrollByDirection(1,n),className:wn()("ias-control-end",lh["control-end"],{[lh["control-end_dir_rtl"]]:"rtl"===s.dir,[lh["control-end_reach-end"]]:a,"ias-control-end_dir_rtl":"rtl"===s.dir,"ias-control-end_reach-end":a}),children:(0,gn.jsx)("div",{className:wn()("ias-control-icon",lh["control-icon"])})})]}):null};var ch=_(7533),hh={insert:"head",singleton:!1};Sn()(ch.A,hh);const uh=ch.A.locals||{},ph=({favoriteStories:e,cardOptions:t,favoriteCardOptions:s})=>{const i=e=>({paddingTop:1/(t.aspectRatio??e.getAspectRatio(t.variant))*100+"%"}),r=e=>{const t=e.getImageSrcByCoverQuality(s.coverQuality),i={};return t?i.backgroundImage=`url('${t}')`:i.backgroundColor=e.backgroundColor,i};return(0,gn.jsx)("div",{className:uh["favorite-images-wrapper"],children:e.slice(0,4).map(((e,s)=>(0,gn.jsx)("div",{className:uh["favorite-image-wrapper"],children:(0,gn.jsx)("div",{style:i(e),className:wn()(uh["favorite-image"],{[uh.circle_style]:t.variant===C.STYLE_CIRCLE}),children:(0,gn.jsx)("div",{className:uh["favorite-image-item"],style:r(e)})})},s)))})},gh=(0,cl.observer)((0,fn.forwardRef)((({isFavorite:e=!1,storyListViewModel:t,...s},i)=>{const r=(0,fn.useRef)(null),a=(0,fn.useRef)(null);((e,t)=>{(0,fn.useImperativeHandle)(e,(()=>({reload:t.reload.bind(t)})),[t])})(i,t);const o=((e,t)=>{const[s,i]=(0,fn.useState)(t);(0,fn.useLayoutEffect)((()=>{const s=e.current;r(s,t),i(t)}),[JSON.stringify(t)]);const r=(e,t)=>{const s=new $c(e,t.card.title);a(s,t),o(s,t)},a=(e,t)=>{const s=e.getCardTitleFont();s.fontSize=e.getScaledFontSizeInWebView(),t.card.title.font=s.toString()},o=(e,t)=>{const s=new Hc(t),{storiesListHeight:i,storiesListInnerHeight:r}=s.getStoriesListStyleOptions(e.getStoryTitleBlockHeight()),a=t.layout.height;t.layout.height=gt()(a)?`${i}px`:a};return s})(r,s.storyListOptions),{sliderRef:n,slider:d,isScrolling:c}=((e,t)=>{const{dir:s,desktopMode:i}=Ac(),r=(0,fn.useRef)(),a=(0,fn.useRef)(null),[o,n]=(0,fn.useState)(!1),[l,d]=(0,fn.useState)(null),c=()=>{clearTimeout(r.current),n(!0)},h=()=>{r.current=setTimeout((()=>n(!1)),100)},u=(0,fn.useCallback)((()=>{if(!l)return;const{x:e,y:t}=l.getCurrentPosition();l.testAttraction(e,t)}),[l]);return(0,fn.useEffect)((()=>{if(!a.current)return;const e=new Fi;return e.mount(a.current),d(e),e.on("scrollstart",c),e.on("scrollend",h),()=>{e.destroy(),e.off("scrollstart",c),e.off("scrollend",h)}}),[]),(0,fn.useEffect)((()=>{l&&(l.setGap(e.card.gap),l.setDesktopMode(i),l.changeDirection(e.direction))}),[l,e.card.gap,i,e.direction]),(0,fn.useEffect)((()=>{l&&(l.setTextDirection(s),l.scrollTo(0,0))}),[l,s]),(0,fn.useEffect)((()=>{l&&(l.scrollTo(0,0),(async(e,t)=>{t>0&&await e.waitStoryListClientWidth();const{x:s,y:i}=e.getCurrentPosition();e.testAttraction(s,i)})(l,t))}),[l,t]),(0,fn.useEffect)((()=>(window.addEventListener("resize",u),()=>{window.addEventListener("resize",u)})),[l,u]),{sliderRef:a,slider:l,isScrolling:o}})(o,t.stories.length);Yc({slider:d,storyListViewModel:t,storyListOptions:o,isFavorite:e,listType:s.listType,feed:s.feedSlug,filter:s.filter,storyManager:s.storyManager}),Zc(d,o,a);const{getRootStyle:u,getStoryWrapperStyle:p,viewportInnerClassList:g,viewportInnerStyle:m}=(e=>{const{dir:t,desktopMode:s}=Ac();return{getRootStyle:()=>({"--background-color":e.layout.backgroundColor,paddingLeft:e.sidePadding+"px",paddingRight:e.sidePadding+"px","--storiesListTopPadding":e.topPadding+"px","--storiesListBottomPadding":e.bottomPadding+"px","--storiesListSidePadding":e.sidePadding+"px",backgroundColor:e.layout.backgroundColor}),getStoryWrapperStyle:(t,s)=>{const i={marginRight:"0",paddingLeft:"0",paddingRight:"0"};return"vertical"===e.direction||(t!==s-1?i.marginRight=e.card.gap+"px":i.paddingRight=e.sidePadding+"px",0===t&&(i.paddingLeft=e.sidePadding+"px")),i},viewportInnerClassList:s?wn()(Kc["stories-list__viewport-inner"],Kc["mode-desktop"],{[Kc["with-list-controls"]]:e.navigation.showControls,[Kc.isTitleCardOutsideTop]:e.card.title.position===h.CARD_OUTSIDE_TOP,[Kc.isTitleCardOutsideBottom]:e.card.title.position===h.CARD_OUTSIDE_BOTTOM,[Kc.isVerticalDirection]:"vertical"===e.direction}):wn()(Kc["stories-list__viewport-inner"],{...(()=>{const s=e.layout.sliderAlign,i=s===l.START||s===l.LEFT,r=s===l.END||s===l.RIGHT,a="ltr"===t;return{[Kc["align-left"]]:i&&a||r&&!a,[Kc["align-center"]]:s===l.CENTER,[Kc["align-right"]]:r&&a||i&&!a}})(),[Kc.isTitleCardOutsideTop]:e.card.title.position===h.CARD_OUTSIDE_TOP,[Kc.isTitleCardOutsideBottom]:e.card.title.position===h.CARD_OUTSIDE_BOTTOM,[Kc.isVerticalDirection]:"vertical"===e.direction}),viewportInnerStyle:{height:e.layout.height,gap:"vertical"===e.direction?`${e.card.gap}px`:0}}})(o),f=o.card,y=o.favoriteCard,v=o.ugcCard;(0,fn.useLayoutEffect)((()=>{t.setFavoriteCardOptions(y),t.setUgcCardOptions(v)}),[t,y,v]);return(0,gn.jsxs)(Jc,{className:wn()("ias-stories-list-wrapper",Kc["stories-list-wrapper"],{[Kc["mode-desktop"]]:t.modeDesktop,[Kc["with-list-controls"]]:o.navigation.showControls,"ias-mode-desktop":t.modeDesktop,"ias-with-list-controls":o.navigation.showControls}),dir:s.dir,style:u(),sliderOptions:o,ref:r,children:[(0,gn.jsx)("div",{className:wn()("ias-stories-list",Kc["stories-list"]),children:(0,gn.jsx)("div",{ref:a,className:wn()(Kc["stories-list__viewport"],{[Kc["mode-desktop"]]:t.modeDesktop,"ias-mode-desktop":t.modeDesktop}),style:"horizontal"===o.direction?{marginLeft:-o.sidePadding+"px",marginRight:-o.sidePadding+"px"}:{},children:(0,gn.jsx)("div",{ref:n,className:g,style:m,children:t.stories.map(((e,i)=>{const r=e instanceof fo,a=s.storyCardView&&!r;return r&&s.favoriteCardView?(0,gn.jsx)(yn().Fragment,{children:s.favoriteCardView(e)},e.id):(0,gn.jsx)(yn().Fragment,{children:a?s.storyCardView?.(e):(0,gn.jsx)(ah,{story:e,cardOptions:f,favoriteCardOptions:y,ugcCardOptions:v,wrapperStyle:p(i,t.stories.length),onClick:()=>((e,i)=>{c||(s.onStoryCardClick?.(e),e instanceof oo?s.onUgcCardClick?.():e instanceof fo?s.onFavoriteCardClick?.():t.onStoryClick(e,i))})(e,i),children:r&&(0,gn.jsx)(ph,{favoriteStories:e.favoriteStories,favoriteCardOptions:o.favoriteCard,cardOptions:f})},e.id)},e.id)}))})})}),d&&(0,gn.jsx)(dh,{dir:s.dir,navigationOptions:o.navigation,navigationView:s.navigationView,sliderDirection:o.direction,storiesLength:t.stories.length,slider:d})]})}))),mh=(0,cl.observer)((0,fn.forwardRef)(((e,t)=>{const{storyManager:s,dir:i}=Ac(),r=e.feedSlug??"default",a=Re.DEFAULT,{storyListViewModel:o,storyListOptions:n}=Fc({...e,storyManager:s,feedSlug:r,listType:a,hasFavorite:Boolean(e.hasFavorite),isFavorite:!1});return o&&o.session?.id?(0,gn.jsx)(gh,{...e,dir:i,storyManager:s,feedSlug:e.feedSlug??"default",listType:Re.DEFAULT,storyListViewModel:o,storyListOptions:n,onStoryCardClick:e.onStoryCardClick,onFavoriteCardClick:()=>{s.emit("clickOnFavoriteCell",{feed:r}),e.onFavoriteCardClick?.()},ref:t}):null}))),fh=(0,cl.observer)((0,fn.forwardRef)(((e,t)=>{const{storyManager:s,dir:i}=Ac(),r=He,a=Re.UGC,{storyListViewModel:o,storyListOptions:n}=Fc({...e,storyManager:s,feedSlug:r,listType:a,isFavorite:!1,hasFavorite:!1});return o&&o.session?.id?(0,gn.jsx)(gh,{...e,ref:t,dir:i,storyListOptions:n,storyManager:s,listType:Re.UGC,feedSlug:He,storyListViewModel:o,onStoryCardClick:e.onStoryCardClick}):null}))),yh=e=>{const{storyManager:t,dir:s}=Ac(),i=ze,r=Re.FAVORITE,{storyListViewModel:a,storyListOptions:o}=Fc({...e,storyManager:t,feedSlug:i,listType:r,isFavorite:!0,hasFavorite:!0});return a?(0,gn.jsx)(gh,{...e,storyListOptions:o,storyManager:t,dir:s,feedSlug:i,listType:r,storyListViewModel:a,isFavorite:!0}):null};var vh=_(2432),wh={insert:"head",singleton:!1};Sn()(vh.A,wh);const _h=vh.A.locals||{},Sh=({open:e,options:t,storyListOptions:s,onClose:i})=>{const{dir:r}=Ac();(0,fn.useLayoutEffect)((()=>{if(!e)return;const t=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=t}}),[e]);return e?(0,gn.jsx)("div",{className:_h["favorite-story-list-modal"],style:{"--storiesFavoriteTitleColor":t.title.color,"--storiesFavoriteTitleFontFamily":"InternalPrimaryFont","--storiesFavoriteTitleFont":t.title.font,"--storiesFavoriteTitleBackgroundColor":t.title.backgroundColor,"--storiesFavoriteHeaderTopOffset":parseFloat(t.headerTopOffset?.toString()??"0")+"px","--storiesFavoriteBottomOffset":parseFloat(t.bottomOffset?.toString()??"0")+"px","--storiesFavoriteBackgroundColor":t.backgroundColor},children:(0,gn.jsxs)("div",{className:_h.container,children:[(0,gn.jsxs)("div",{className:_h.header,children:[(0,gn.jsx)("p",{className:_h.title,children:t.title.content}),(0,gn.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},className:_h["header__close-btn"],style:(()=>{const e="start"===t.closeButtonPosition||"left"===t.closeButtonPosition,s="ltr"===r;return{[e&&s||!e&&!s?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:t.closeButton?.svgSrc.baseState??""}})]}),(0,gn.jsx)("div",{className:_h.content,children:(0,gn.jsx)("div",{className:_h["favorite-story-list"],children:(0,gn.jsx)(yh,{options:{...s,sidePadding:0,direction:p.COLUMN,layout:{height:"auto"}}})})}),(0,gn.jsx)("div",{className:_h.footer}),(0,gn.jsx)("div",{className:_h["bottom-offset"]})]})}):null},bh=({storyList:e,onStoryCardClick:t,onFavoriteCardClick:s})=>{const[i,r]=(0,fn.useState)(e.appearanceManager.storiesListOptions),a=(0,fn.useRef)(null);return(0,fn.useEffect)((()=>{e.api=a.current}),[]),(0,fn.useEffect)((()=>(e.appearanceManager.on(nn.EVENT_UPDATED_STORIES_LIST_OPTIONS,r),()=>{e.appearanceManager.off(nn.EVENT_UPDATED_STORIES_LIST_OPTIONS,r)})),[e.appearanceManager]),(0,hl.createPortal)((0,gn.jsx)(mh,{ref:a,options:i,hasFavorite:e.appearanceManager.commonOptions.hasFavorite,testKey:e.testKey,useUgcCard:e.useUgcCard,feedSlug:e.feedSlug,onLoadStart:()=>{e.emit(g.START_LOADER)},onLoadEnd:t=>{e.emit(g.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()},onFavoriteCardClick:s,onStoryCardClick:t},e.mountSelector),document.querySelector(e.mountSelector))},xh=({ugcStoryList:e,onStoryCardClick:t})=>{const[s,i]=(0,fn.useState)(e.appearanceManager.storiesListOptions),r=(0,fn.useRef)(null);return(0,fn.useEffect)((()=>{e.api=r.current}),[]),(0,fn.useEffect)((()=>(e.appearanceManager.on(nn.EVENT_UPDATED_STORIES_LIST_OPTIONS,i),()=>{e.appearanceManager.off(nn.EVENT_UPDATED_STORIES_LIST_OPTIONS,i)})),[e.appearanceManager]),(0,hl.createPortal)((0,gn.jsx)(fh,{ref:r,options:s,testKey:e.testKey,useUgcCard:e.useUgcCard,onStoryCardClick:t,onLoadStart:()=>{e.emit(g.START_LOADER)},onLoadEnd:t=>{e.emit(g.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()}}),document.querySelector(e.mountSelector))},Ch=e=>{const[t,s]=(0,fn.useState)(!1);return(0,gn.jsxs)(Ic,{config:e.storyManagerConfigDto,storyReaderOptions:e.appearanceManager.storyReaderOptions,commonOptions:e.appearanceManager.commonOptions,gameReaderOptions:e.appearanceManager.gameReaderOptions,goodsWidgetOptions:e.appearanceManager.goodsWidgetOptions,children:[e.storyLists.map((t=>(0,gn.jsx)(bh,{onFavoriteCardClick:()=>{s(!0)},onStoryCardClick:()=>{e.onAppearanceManagerChange(t.appearanceManager)},storyList:t},t.mountSelector))),e.ugcStoryLists.map((t=>(0,gn.jsx)(xh,{ugcStoryList:t,onStoryCardClick:()=>{e.onAppearanceManagerChange(t.appearanceManager)}},t.mountSelector))),(0,gn.jsx)(Sh,{open:t,onClose:()=>s(!1),options:e.appearanceManager.storyFavoriteReaderOptions,storyListOptions:e.appearanceManager.storiesListOptions})]})};class kh{storyManager;root;storyManagerConfigDto;storyLists=[];ugcStoryLists=[];appearanceManager=new ln;constructor(e){this.storyManager=e,this.createAppRoot(),this.handleAppearanceManagerUpdate=this.handleAppearanceManagerUpdate.bind(this),this.setAppearanceManager=this.setAppearanceManager.bind(this)}async setStoryList(e){await this.storyManager.waitStoryManagerConfig(),this.storyLists=e.slice(),this.render()}async setUGCStoryList(e){await this.storyManager.waitStoryManagerConfig(),this.ugcStoryLists=e.slice(),this.render()}setStoryManagerConfig(e){this.storyManagerConfigDto={...this.storyManagerConfigDto,...e},this.render()}setAppearanceManager(e){this.unscubscribeToAppearanceManagerEvents(),this.appearanceManager=e,this.subscribeToAppearanceManagerEvents(),this.render()}render(){this.root.render((0,gn.jsx)(Ch,{storyManagerConfigDto:this.storyManagerConfigDto,appearanceManager:this.appearanceManager,ugcStoryLists:this.ugcStoryLists,storyLists:this.storyLists,onAppearanceManagerChange:this.setAppearanceManager}))}createAppRoot(){const e=document.createElement("div");e.id="ias-app",document.body.append(e),this.root=(0,mn.createRoot)(e)}subscribeToAppearanceManagerEvents(){this.appearanceManager.on(nn.UPDATE,this.handleAppearanceManagerUpdate)}unscubscribeToAppearanceManagerEvents(){this.appearanceManager.off(nn.UPDATE,this.handleAppearanceManagerUpdate)}handleAppearanceManagerUpdate(){this.render()}}class Mh extends t.EventEmitter{storyManager;app;sharePage=null;constructor(e,t,s,i,r){super(),this.storyManager=s,this.app=i,hn(t),this.showSharePage(e,t,r)}async showSharePage(e,t,s){this.app.setAppearanceManager(t),this.sharePage=await this.storyManager.showSharePage(e,s)}async closeStoryReader(){this.sharePage?.closeStoryReader()}}class Lh extends(s()){appearanceManager;options;storyManager;app;stackedStoryListViewModel;constructor(e,t,s,i){super(),this.appearanceManager=e,this.options=t,this.storyManager=s,this.app=i,hn(e),this.handleUpdate=this.handleUpdate.bind(this),this.stackedStoryListViewModel=new io(this.storyManager,{feed:t.feed}),this.stackedStoryListViewModel.on("update",this.handleUpdate),this.loadStories().catch(console.error)}get stories(){return this.stackedStoryListViewModel.stories}get length(){return this.stackedStoryListViewModel.length}get activeIndex(){return this.stackedStoryListViewModel.activeIndex}get feedCoverSrc(){return this.stackedStoryListViewModel.feedCoverSrc}get top(){return this.stackedStoryListViewModel.top}async reload(){return this.stackedStoryListViewModel.reload()}destroy(){this.stackedStoryListViewModel.destroy(),this.stackedStoryListViewModel.removeAllListeners()}showStory(e){this.app.setAppearanceManager(this.appearanceManager),this.stackedStoryListViewModel.showStory(e)}on(e,t){return"update"===e?super.on(e,t):(this.stackedStoryListViewModel.on(e,t),this)}once(e,t){return this.stackedStoryListViewModel.once(e,t),this}off(e,t){return this.stackedStoryListViewModel.off(e,t),this}handleUpdate(e){this.emit("update",{id:e.id,title:e.title,titleColor:e.titleColor,hasAudio:e.hasAudio,hasSwipeUp:e.hasSwipeUp,isOpened:e.isOpened,deeplink:e.deeplink,gameInstanceId:e.gameInstanceId,hideInReader:e.hideInReader,hide_timeline:e.hideTimeline,cover:e.getCover(this.appearanceManager.storiesListOptions.card.coverQuality)})}async loadStories(){await this.storyManager.waitStoryManagerConfig(),this.stackedStoryListViewModel.loadStories()}}class Oh{storyManagerConfigDto;static instance;app=new kh(on);constructor(e){return this.storyManagerConfigDto=e,Oh.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),Oh.instance):(Oh.instance=this,this.app.setStoryManagerConfig(e),Oh.instance)}get sdkVersionName(){return on.sdkVersionName}get sdkVersionCode(){return on.sdkVersionCode}set storyLinkClickHandler(e){on.storyLinkClickHandler=e}static getInstance(){return Oh.instance?Oh.instance:null}static use(e,t){on.use(e,t)}getConfig(){return on.getConfig()}async showOnboardingStories(e,t){return hn(e),this.app.setAppearanceManager(e),on.showOnboardingStories(t)}async showStory(e,t){hn(t),this.app.setAppearanceManager(t),await on.showStory(e)}async showStoryOnce(e,t){return hn(t),this.app.setAppearanceManager(t),on.showStoryOnce(e)}closeAllReaders(){on.closeAllReaders()}async openGame(e,t,s={}){return hn(t),this.app.setAppearanceManager(t),on.openGame(e,s)}async closeGame(){return on.closeGame()}async closeStoryReader(){return on.closeStoryReader()}getUgcEditorConfig(){return on.getUgcEditorConfig()}closeGoodsWidget(){on.closeGoodsWidget()}setLang(e){this.storyManagerConfigDto.lang=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}getNonce(){return K()}async setUserId(e,t){this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async userLogoug(){return this.setUserId("")}setTags(e){this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){this.storyManagerConfigDto.imagePlaceholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}on(e,t){return on.on(e,t),this}once(e,t){return on.once(e,t),this}off(e,t){return on.off(e,t),this}destroy(){null!=Oh.instance&&(Oh.instance=null,this.closeAllReaders())}StoriesList=class extends un{constructor(e,t,s){super(e,t,s,Oh.instance.app)}};UGCStoriesList=class extends pn{constructor(e,t,s){super(e,t,s,Oh.instance.app)}};SharePage=class extends Mh{constructor(e,t,s){super(e,t,on,Oh.instance.app,s)}};StackedStoryList=class extends Lh{constructor(e,t){super(e,t,on,Oh.instance.app)}};inAppMessaging=new Ja(on.inAppMessaging)}})(),S})()));