@inappstory/react-sdk 0.2.2 → 0.2.4

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19,4 +19,4 @@ object-assign
19
19
  *
20
20
  * This source code is licensed under the MIT license found in the
21
21
  * LICENSE file in the root directory of this source tree.
22
- */r(1513);var i=r(9155),s=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;s=o("react.element"),t.Fragment=o("react.fragment")}var n=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,r){var i,o={},d=null,c=null;for(i in void 0!==r&&(d=""+r),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,i)&&!l.hasOwnProperty(i)&&(o[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===o[i]&&(o[i]=t[i]);return{$$typeof:s,type:e,key:d,ref:c,props:o,_owner:n.current}}t.jsx=d,t.jsxs=d},1085:(e,t,r)=>{"use strict";e.exports=r(3335)},2591:(e,t,r)=>{"use strict";var i,s=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),n=[];function a(e){for(var t=-1,r=0;r<n.length;r++)if(n[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},i=[],s=0;s<e.length;s++){var o=e[s],l=t.base?o[0]+t.base:o[0],d=r[l]||0,c="".concat(l," ").concat(d);r[l]=d+1;var u=a(c),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(n[u].references++,n[u].updater(h)):n.push({identifier:c,updater:v(h,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 s=r.nc;s&&(i.nonce=s)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var n=o(e.insert||"head");if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(t)}return t}var c,u=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,r,i){var s=r?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=u(t,s);else{var o=document.createTextNode(s),n=e.childNodes;n[t]&&e.removeChild(n[t]),n.length?e.insertBefore(o,n[t]):e.appendChild(o)}}function p(e,t,r){var i=r.css,s=r.media,o=r.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var f=null,g=0;function v(e,t){var r,i,s;if(t.singleton){var o=g++;r=f||(f=d(t)),i=h.bind(null,r,o,!1),s=h.bind(null,r,o,!0)}else r=d(t),i=p.bind(null,r,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<r.length;i++){var s=a(r[i]);n[s].references--}for(var o=l(e,t),d=0;d<r.length;d++){var c=a(r[d]);0===n[c].references&&(n[c].updater(),n.splice(c,1))}r=o}}}},4862:function(e,t){"use strict";var r;void 0===(r=function(){return function(e,t,r){let i,s;function o(){return r.userAgent.match(/ipad|iphone/i)}function n(e){i=t.createElement("textArea"),i.value=e,t.body.appendChild(i)}function a(){var r,s;o()?((r=t.createRange()).selectNodeContents(i),(s=e.getSelection())&&(s.removeAllRanges(),s.addRange(r)),i.setSelectionRange(0,999999)):i.select()}function l(){t.execCommand("copy"),t.body.removeChild(i)}return s=function(e){n(e),a(),l()},{copy:s}}(window,document,navigator)}.apply(t,[]))||(e.exports=r)},5304:(e,t,r)=>{"use strict";r.d(t,{eJ:()=>n,gP:()=>s});var i=r(2535);function s(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}function o(e){return e.map((e=>function(e){var t,r,o;if(!e.url)return null;let n={"font-family":null!==(t=e.family)&&void 0!==t?t:"normal",src:`url('${s(String(e.url))}')`,"font-style":null!==(r=e.style)&&void 0!==r?r:"normal","font-weight":null!==(o=e.weight)&&void 0!==o?o:"normal"};e.title&&(n.src+=`, local('${e.title}')`);return`@font-face {${(0,i.ky)(n)}}\n`}(e))).filter(Boolean).join("")}function n(e){"fonts"in document?e.forEach((e=>{const t=new FontFace(e.family,`url(${e.url})`,{style:e.style,weight:e.weight,display:"block"});document.fonts.add&&document.fonts.add(t),t.load()})):function(e){const t=o(e);if(null!=t){const e="stories-font-style";let r=document.getElementById(e);null===r?(r=document.createElement("style"),r.type="text/css",r.id=e,r.attributes.setNamedItem(document.createAttribute("scoped")),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t)),document.body.appendChild(r)):r.styleSheet?r.styleSheet.cssText=t:(r.textContent="",r.appendChild(document.createTextNode(t)))}}(e)}},5474:(e,t,r)=>{"use strict";r.d(t,{C:()=>i,F:()=>o});const i={baseUrl:"https://sdk.inappstory.ru",apiUrl:"https://api.inappstory.ru",faviconApiUrl:"https://favicon.inappstory.ru"};function s(e){if(e.length>32)try{const t=function(e){const t=(e=e.replace(new RegExp("-","g"),"+").replace(new RegExp("_","g"),"/")).length;return e=function(e,t,r){return void 0===t?e:t.length>=e.length?t:r?(e+t).slice(-e.length):(t+e).substring(0,e.length)}(new Array(t%4).fill("=").join(""),e,!1),window.atob(e)}(e),r=t.charCodeAt(13);if(r>0){let e=t.substr(14,r);e=e.replace(/\0+$/,"");const i="{QQN{xuV?1Dv16j3";let s=i,o=0;for(;s.length<r;)s+=i[o],o++,o===i.length&&(o=0);let n="";for(let t=0;t<r;t++)n+=String.fromCharCode(e.charCodeAt(t)^s.charCodeAt(t));return new URL(`https://${n}`).host}}catch(e){console.error(e)}return null}function o(e){const t=s(e);if(null!=t){const e=t.split(".").slice(1);i.baseUrl=`https://${["sdk",...e].join(".")}`,i.faviconApiUrl=`https://${["favicon",...e].join(".")}`,i.apiUrl=`https://${t}`}}},3580:(e,t,r)=>{"use strict";r.d(t,{Ue:()=>u,Tl:()=>s,YB:()=>h,JG:()=>o,qR:()=>d,rN:()=>c,Fn:()=>l,ib:()=>n,by:()=>a});var i=r(2840);const s=(0,i.createStore)({apiKey:"",disableStatistic:!1}),o=(0,i.createEvent)();s.on(o,((e,t)=>t));const n=(0,i.createEvent)();s.on(n,((e,{tags:t})=>Object.assign(Object.assign({},e),{tags:t})));const a=(0,i.createEvent)();s.on(a,((e,{userId:t})=>Object.assign(Object.assign({},e),{userId:t})));const l=(0,i.createEvent)();s.on(l,((e,{placeholders:t})=>Object.assign(Object.assign({},e),{placeholders:t})));const d=(0,i.createEvent)();s.on(d,((e,{imagePlaceholders:t})=>Object.assign(Object.assign({},e),{imagePlaceholders:t})));const c=(0,i.createEvent)();s.on(c,((e,{lang:t})=>Object.assign(Object.assign({},e),{lang:t})));const u=(0,i.createStore)(""),h=(0,i.createEvent)();(0,i.forward)({from:h,to:u})},4269:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var events__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(46),events__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__),_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9156),_ias_rpc__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8169),_md5__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(1650),_src_stories_widget_helpers_media__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(5304),_src_storyManager_api_domains__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5474),_src_storyManager_models_storyManagerConfig__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3580),__awaiter=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},Events,BlobType;(0,_ias_rpc__WEBPACK_IMPORTED_MODULE_4__.A)(window),function(e){e.START_LOADER="startLoader",e.END_LOADER="endLoader"}(Events||(Events={})),BlobType||(BlobType={});class Widget extends events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter{get loaderContainer(){if(!this._loaderContainer){const e=document.createElement("div");this.obj&&(this.obj.style.position="relative"),e.style.position="absolute",e.style.left=e.style.top=e.style.right=e.style.bottom="0px",e.style.pointerEvents="none",this.obj&&this.obj.prepend(e),this._loaderContainer=e}return this._loaderContainer}setCallbacks(e){this.callbacks=e}constructor(e,t){super(),this._options=t,this.callbacks={},this._loaderContainer=null,this.objId=e;let r=null;r="body"===e?document.body:document.querySelector(e),r&&(this.obj=r)}set options(e){this._options=Object.assign(Object.assign({},this._options),e)}get options(){return this._options}init(e){return __awaiter(this,void 0,void 0,(function*(){const t={},r={},i={},s=()=>{};return new Promise(((o,n)=>{this.__init(e,t,{},r,i,s,null,null,o,n)}))}))}__init(e,t,r,i,s,o,n,a,l,d){var c,u;return __awaiter(this,void 0,void 0,(function*(){t=t||{},i=i||{};const h=this.objId,p=this;let f=null;if(f="body"===h?document.body:document.querySelector(h),!f){let c=a||0;return c>10?void d("IAS.Widget: object: `"+h+"` not found."):void requestAnimationFrame((()=>{p.__init(e,t,r,i,s,o,n,c+1,l,d)}))}this.widgetId=n||++Widget.count,s=s||{},i=i||{},(e=e||{}).preview&&(t.preview=1,delete e.preview);e.base_domain||IAS_OLD._protocol;var g,v,m="auto"===e.width?0|(f.clientWidth||f.offsetWidth||s.minWidth):parseInt(e.width||0,10);const _=m?Math.max(s.minWidth||200,Math.min(s.maxWidth||1e4,m))+"px":"100%";this.objSavedStyles=f.style.cssText,s.fullScreen||(f.style.width=_,f.style.overflow="hidden",e.height?(t.height=e.height,f.style.height=e.height+"px"):f.style.height=(s.startHeight||200)+"px",e.overflowTouch&&(f.style.overflow="auto",f.style["-webkit-overflow-scrolling"]="touch")),"100%"===_&&(t.startWidth=0|(f.clientWidth||f.offsetWidth)),t.url||(t.url=e.pageUrl||location.href.replace(/#.*$/,"")),t.url=t.url||"",t.referrer=t.referrer||document.referrer||"",t.title=t.title||document.title||"",t.userId=t.userId||"",t.origin=window.location.protocol+"//"+window.location.hostname;const{nonce:y}=_src_storyManager_models_storyManagerConfig__WEBPACK_IMPORTED_MODULE_3__.Tl.getState(),w={html:this.getWidgetDocument(r,y),css:null!==(c=t.extraCss)&&void 0!==c?c:null,js:null!==(u=t.extraJs)&&void 0!==u?u:null,nonce:y};let b=this.getGeneratedPageURL(w);i.onStartLoading&&i.onStartLoading(),i.showLoader=function(e){IAS_OLD.Util.Loader(e)},i.publish=function(){var e=Array.prototype.slice.call(arguments);e.push(p.widgetId),IAS_OLD.Observer.publish.apply(IAS_OLD.Observer,e)},i.onInit=function(){e.onReady&&e.onReady()},i.hideLoader=function(){},i.resize=function(e,t){if(f){f.style.height=e+"px";var r=document.getElementById("iaswidget"+p.widgetId);r&&(r.style.height=e+"px")}},i.resizeWidget=function(t,r){const i=parseInt(t),s=parseInt(r);var o=document.getElementById("iaswidget"+p.widgetId);isFinite(i)&&f&&(f.style.width=i+"px",o&&(o.style.width=i+"px")),isFinite(s)&&f&&(f.style.height=s+"px",o&&(o.style.height=s+"px")),e.onResizeWidget&&e.onResizeWidget()},g=IAS_OLD.Widget.RPC[p.widgetId]=new window.iasRPC.Server(i,(function(e){return!e||(e=e.toLowerCase(),!0)}),{safe:!0});const S={src:"",id:"iaswidget"+p.widgetId,allowTransparency:e.allowTransparency||!1,style:{backgroundColor:e.backgroundColor||"transparent"}};s.fullScreen?(S.style.position="fixed",S.style.left=0,S.style.top=0,S.style.padding=0,S.style.border=0,S.style.zIndex=1002,S.style.width="100%",S.style.height="100%"):(S.width=-1!=_.indexOf("%")?_:parseInt(_)||_,S.height=s.startHeight||"100%",S.style.width="1px",S.style.minWidth="100%",S.style["*width"]="100%"),s.scrolling?S.scrolling="yes":(S.scrolling="no",S.style.overflow="hidden"),s.hidden&&(S.style.display="none"),S.style.colorScheme="auto",(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.uM)()?S.srcdoc=b.srcdoc:S.src=b.src,v=IAS_OLD.Widget.RPC[p.widgetId].append(f,S),this.emit("ready"),this.on("widgetLoaded",(()=>{requestAnimationFrame((()=>{o&&o(f,v||(null==f?void 0:f.firstChild),g),l(!0)}))}))}))}_destroyClientWidget(){}destroy(){try{this._destroyClientWidget(),requestAnimationFrame((()=>{try{const e=IAS_OLD.Widget.RPC[this.widgetId];e&&e.destroy(),this.obj&&(this.obj.innerHTML="",this.obj.style.cssText=this.objSavedStyles)}catch(e){console.error(e)}}))}catch(e){console.error(e)}}showBoxUrl(e,t){return(e=(e||IAS_OLD._protocol+"//sdk-narrator.kiozk.ru").replace(/\/?\s*$/,""))+"/"+(t=t.replace(/^\s*\/?/,""))}startLoader(){let e=(0,_src_stories_widget_helpers_media__WEBPACK_IMPORTED_MODULE_5__.gP)(`${_src_storyManager_api_domains__WEBPACK_IMPORTED_MODULE_2__.C.baseUrl}/v0.2.2/dist/loader.gif`);this.loaderContainer.style.background=`url("${e}") center center no-repeat transparent`}stopLoader(){this.loaderContainer.style.display="none"}getGeneratedPageURL({html:e,css:t,js:r,nonce:i}){let s="",o="";null!==t&&(s=`<link rel="stylesheet" type="text/css" href="${(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.jp)(t,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.Vd.CSS)}" />`),null!==r&&(o=`<script nonce="${i}">${(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.jp)(r,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.Vd.JS)}<\/script>`);const n=`\n <html>\n <head>\n <base href="${document.baseURI}"></base>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <script nonce="${i}">__webpack_nonce__ = "${i}";<\/script>\n ${s}\n ${o}\n </head>\n <body>\n ${e||""}\n </body>\n </html>\n `;null!==t&&(s=`<style nonce="${i}">${t}</style>`),null!==r&&(o=`<script nonce="${i}">${r}<\/script>`);let a=`\n <html>\n <head>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <script nonce="${i}">__webpack_nonce__ = "${i}";<\/script>\n ${s}\n ${o}\n </head>\n <body>\n ${e||""}\n </body>\n </html>\n `;return{src:(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.jp)(n,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.Vd.HTML),srcdoc:a}}getWidgetDocument(e,t){return""}}Widget.count=0,Widget.RPC={};const __WEBPACK_DEFAULT_EXPORT__=Widget;class IAS_OLD{}if(IAS_OLD.version="v1",IAS_OLD.MD5=_md5__WEBPACK_IMPORTED_MODULE_6__.F,IAS_OLD.extend=_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.X$,IAS_OLD._protocol="https:",IAS_OLD._base_domain="",IAS_OLD.Widget=Widget,IAS_OLD.xdConnectionCallbacks?setTimeout((function(){for(var e;e=IAS_OLD.xdConnectionCallbacks.pop();)e()}),0):(IAS_OLD.extend(IAS_OLD,{version:1,_apiKey:null,_session:null,_domain:{main:IAS_OLD._protocol+"//sdk-narrator.kiozk.ru/",api:IAS_OLD._protocol+"//api-narrator.kiozk.ru/"},_path:{login:"authorize",proxy:"fxdm_oauth_proxy.html"},_rootId:"ias_api_transport",_nameTransportPath:"",xdReady:!1}),IAS_OLD.init=function(e){if(IAS_OLD._apiKey=null,!e.apiKey)throw Error("IAS_OLD.init() called without an apiKey");return IAS_OLD._apiKey=e.apiKey,IAS_OLD.userId=e.userId,!0}),IAS_OLD.XDM||(IAS_OLD.XDM={remote:null,init:function(){if(this.remote)return!1;var e=IAS_OLD._domain.api+IAS_OLD._path.proxy;this.remote=new window.iasRPC.Server({onInit:function(){IAS_OLD.xdReady=!0,IAS_OLD.Observer.publish("xdm.init")}}),this.remote.append(document.getElementById(IAS_OLD._rootId),{src:e})},xdHandler:function(code){try{eval("IAS_OLD."+code)}catch(e){}}}),IAS_OLD.Observer||(IAS_OLD.Observer={_subscribers:function(){return this._subscribersMap||(this._subscribersMap={}),this._subscribersMap},publish:function(){var e,t,r=Array.prototype.slice.call(arguments),i=r.shift(),s=this._subscribers()[i];if(s)for(e=0,t=s.length;e<t;e++)null!=s[e]&&s[e].apply(this,r)},subscribe:function(e,t){var r=this._subscribers();if("function"!=typeof t)return!1;r[e]?r[e].push(t):r[e]=[t]},unsubscribe:function(e,t){var r,i,s=this._subscribers()[e];if(!s)return!1;if("function"==typeof t)for(r=0,i=s.length;r<i;r++)s[r]==t&&(s[r]=null);else delete this._subscribers()[e]}}),IAS_OLD.Util||(IAS_OLD.Util={getStyle:function(e,t){var r,i=document.defaultView||window;if(i.getComputedStyle){t=t.replace(/([A-Z])/g,"-$1").toLowerCase();var s=i.getComputedStyle(e,null);s&&(r=s.getPropertyValue(t))}else if(e.currentStyle){var o=t.replace(/\-(\w)/g,(function(e,t){return t.toUpperCase()}));r=e.currentStyle[t]||e.currentStyle[o]}return r},getXY:function(e,t){if(e&&void 0!==e){var r=0,i=0;if(void 0!==e.getBoundingClientRect){var s=e.getBoundingClientRect();r=s.left,i=s.top,t=!0}else if(e.offsetParent)do{r+=e.offsetLeft,i+=e.offsetTop,t&&(r-=e.scrollLeft,i-=e.scrollTop)}while(e=e.offsetParent);return t&&(i+=window.pageYOffset||window.scrollNode&&window.scrollNode.scrollTop||document.documentElement.scrollTop,r+=window.pageXOffset||window.scrollNode&&window.scrollNode.scrollLeft||document.documentElement.scrollLeft),[r,i]}},Loader:function e(t){e.loader||((e.loader=document.createElement("DIV")).innerHTML='<style type="text/css"> @-webkit-keyframes IAS_OLDWidgetsLoaderKeyframes {0%{opacity: 0.2;}30%{opacity: 1;}100%{opacity: 0.2;}} @keyframes IAS_OLDWidgetsLoaderKeyframes {0%{opacity: 0.2;}30%{opacity: 1;}100%{opacity: 0.2;}} .IAS_OLDWidgetsLoader div {width: 7px;height: 7px;-webkit-border-radius: 50%;-khtml-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;background: #fff;top: 21px;position: absolute;z-index: 2;-o-transition: opacity 350ms linear; transition: opacity 350ms linear;opacity: 0.2;-webkit-animation-duration: 750ms;-o-animation-duration: 750ms;animation-duration: 750ms;-webkit-animation-name: IAS_OLDWidgetsLoaderKeyframes;-o-animation-name: IAS_OLDWidgetsLoaderKeyframes;animation-name: IAS_OLDWidgetsLoaderKeyframes;-webkit-animation-iteration-count: infinite;-o-animation-iteration-count: infinite;animation-iteration-count: infinite;-webkit-transform: translateZ(0);transform: translateZ(0);}</style><div class="IAS_OLDWidgetsLoader" style="position: fixed;left: 50%;top: 50%;margin: -25px -50px;z-index: 1002;height: 50px;width: 100px;"><div style="left: 36px;-webkit-animation-delay: 0ms;-o-animation-delay: 0ms;animation-delay: 0ms;"></div><div style="left: 47px;-webkit-animation-delay: 180ms;-o-animation-delay: 180ms;animation-delay: 180ms;"></div><div style="left: 58px;-webkit-animation-delay: 360ms;-o-animation-delay: 360ms;animation-delay: 360ms;"></div><span style="display: block;background-color: #000;-webkit-border-radius: 4px;-khtml-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;-webkit-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.35);-moz-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.35);box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.35);position: absolute;left: 0;top: 0;bottom: 0; right: 0;z-index: 1;opacity: 0.7;"></span></div>',document.body.insertBefore(e.loader,document.body.firstChild)),e.loader.style.display=t?"block":"none"},addEvent:function(e,t,r){(r=r||window.document).addEventListener?r.addEventListener(e,t,!1):r.attachEvent&&r.attachEvent("on"+e,t)},removeEvent:function(e,t,r){(r=r||window.document).removeEventListener?r.removeEventListener(e,t,!1):r.detachEvent&&r.detachEvent("on"+e,t)},ss:function(e,t){IAS_OLD.extend(e.style,t,!0)},getScroll:function(){if(void 0!==window.pageYOffset)return[pageXOffset,pageYOffset];var e=document,t=e.documentElement,r=e.body;return[t.scrollLeft||r.scrollLeft||0,t.scrollTop||r.scrollTop||0]}}),window.IAS_OLDReady&&window.IAS_OLDReady._e)for(let e=0;e<window.IAS_OLDReady._e.length;e++)setTimeout(window.IAS_OLDReady._e[e],0);window.iasAsyncInitCallbacks&&window.iasAsyncInitCallbacks.length&&setTimeout((function(){for(var e;e=window.iasAsyncInitCallbacks.pop();)try{e()}catch(e){try{console.error(e)}catch(e){}}}),0)},9156:(e,t,r)=>{"use strict";function i(e,t,r){for(const i in t)t.hasOwnProperty(i)&&(r||void 0===e[i])&&(e[i]=t[i]);return e}var s;function o(e,t){const r=new Blob([e],{type:t});return URL.createObjectURL(r)}r.d(t,{Vd:()=>s,X$:()=>i,jp:()=>o,uM:()=>l}),function(e){e.CSS="text/css",e.JS="text/javascript",e.HTML="text/html"}(s||(s={}));let n=!1,a=!1;const l=()=>{if(!a){const e=document.createElement("iframe");n="srcdoc"in e,a=!0}return n}},2535:(e,t,r)=>{"use strict";function i(e){return Object.keys(e).reduce(((t,r)=>t+r.split(/(?=[A-Z])/).join("-").toLowerCase()+":"+e[r]+";"),"")}r.d(t,{ky:()=>i})},8169:(e,t,r)=>{"use strict";function i(e){if(!e.iasRPC){var t={},r=[],i={};e.iasRPC={_id:0,Server:function(r,i,s){this.methods=r||{},this.filter=i,this.options=s||{},this.id=e.iasRPC._id++,this.key=function(){for(var e="",t=0;t<5;t++)e+=Math.ceil(15*Math.random()).toString(16);return e}(),this.frameName="fXD"+this.key,this.server=!0;var o=this;this.methods["%init%"]=this.methods.__fxdm_i=function(){e.iasRPC.run(o.id),o.methods.onInit&&o.methods.onInit()},t[this.key]=[l,this]},Client:function(r,i){if(this.methods=r||{},this.options=i||{},this.id=e.iasRPC._id++,this.client=!0,e.iasRPC.run(this.id),0!==window.name.indexOf("fXD"))throw Error("Wrong window.name property.");this.key=window.name.substr(3),this.caller=window.parent,t[this.key]=[l,this],e.iasRPC.on("helper",(function(){e.iasRPC.onClientStart(this)}),this),n((function(e){e.send(this,e.json.stringify(["%init%"]));var t=this.methods;setTimeout((function(){t.onInit&&t.onInit()}),0)}),this)},onMessage:function(e){var r=e.data;if(!r)return!1;if("string"!=typeof r&&!(r instanceof String))return!1;var i=r.substr(0,5);if(t[i]){var s=t[i][1];!s||s.filter&&!s.filter(e.origin)||t[i][0](r.substr(6),s)}},setJSON:function(e){i.json=e},getJSON:function(e){if(!e)return i.json;n((function(t){e(t.json)}))},setEnv:function(e){for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);a()},_q:{},on:function(e,t,r){this._q[e]||(this._q[e]=[]),-1==this._q[e]?t.apply(r):this._q[e].push([t,r])},run:function(e){for(var t=(this._q[e]||[]).length,r=0;r<t;r++)this._q[e][r][0].apply(this._q[e][r][1]);this._q[e]=-1},waitFor:s},e.iasRPC.Server.prototype.start=function(t,r){if(t.contentWindow)this.caller=t.contentWindow,this.frame=t,e.iasRPC.on("helper",(function(){e.iasRPC.onServerStart(this)}),this);else{var i=this;(r=r||0)<50&&setTimeout((function(){i.start.apply(i,[t,r+1])}),100)}},e.iasRPC.Server.prototype.destroy=function(){delete t[this.key]},e.iasRPC.Server.prototype.append=function(e,t,r){var i=document.createElement("div");i.innerHTML='<iframe name="'+this.frameName+'" '+(r||"")+"></iframe>";var s=i.firstChild,o=this;return setTimeout((function(){s.frameBorder="0",t&&d(s,t),e.insertBefore(s,e.firstChild),o.start(s)}),0),s},e.iasRPC.Client.prototype.callMethod=e.iasRPC.Server.prototype.callMethod=function(){for(var t=Array.prototype.slice.call(arguments),r=t.shift(),i=0,a=t.length;i<a;i++)if("function"==typeof t[i]){this.funcsCount=(this.funcsCount||0)+1;var l=t[i],d="_func"+this.funcsCount;this.methods[d]=function(){l.apply(this,arguments),delete this.methods[d]},t[i]={_func:this.funcsCount}}else this.options.safe&&(t[i]=o(t[i],!0));s(this,"caller",(function(){e.iasRPC.on(this.id,(function(){n((function(e){e.send(this,e.json.stringify([r,t]))}),this)}),this)}),this)},i.json={parse:e.JSON.parse,stringify:e.JSON.stringify},e.postMessage&&(i.protocol="p",i.send=function(e,t){var r=e.frame?e.frame.contentWindow:e.caller;if(r)try{r.postMessage(e.key+":"+t,"*")}catch(i){window.postMessage.call(r,e.key+":"+t,"*")}},e.addEventListener?e.addEventListener("message",e.iasRPC.onMessage,!1):e.attachEvent("onmessage",e.iasRPC.onMessage),a())}function s(e,t,r,i,o){e[t]?r.apply(i):(o=o||0)<1e3&&setTimeout((function(){s(e,t,r,i,o+1)}),0)}function o(e,t){var r;switch(typeof e){case"string":r=t?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):e.replace(/&#039;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&");break;case"object":if(null===e)r=e;else if("[object Array]"===Object.prototype.toString.apply(e)){r=[];for(var i=0,s=e.length;i<s;i++)r[i]=o(e[i],t)}else for(var n in r={},e)Object.hasOwnProperty.call(e,n)&&(r[n]=o(e[n],t));break;default:r=e}return r}function n(e,t){i.loaded?e.apply(t,[i]):r.push([t,e])}function a(){i.loaded=!0;for(var e=0,t=r.length;e<t;e++)r[e][1].apply(r[e][0],[i])}function l(e,t){n((function(r){var i=r.json.parse(e);if(i[0]){i[1]||(i[1]=[]);for(var s=0,n=i[1].length;s<n;s++)if(i[1][s]&&i[1][s]._func){var a=i[1][s]._func;i[1][s]=function(){var e=Array.prototype.slice.call(arguments);e.unshift("_func"+a),t.callMethod.apply(t,e)}}else t.options.safe&&(i[1][s]=o(i[1][s],!1));setTimeout((function(){if(!t.methods[i[0]])throw Error("iasRPC: Method "+i[0]+" is undefined");t.methods[i[0]].apply(t,i[1])}),0)}}))}function d(e,t){for(var r in t)e[r]&&"object"==typeof e[r]?d(e[r],t[r]):e[r]=t[r]}}r.d(t,{A:()=>i})},1650:(e,t,r)=>{"use strict";function i(e){var t,r=function(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r},i=function(e,t,i,s,o,n){return r(function(e,t){return e<<t|e>>>32-t}(r(r(t,e),r(s,n)),o),i)},s=function(e,t,r,s,o,n,a){return i(t&r|~t&s,e,t,o,n,a)},o=function(e,t,r,s,o,n,a){return i(t&s|r&~s,e,t,o,n,a)},n=function(e,t,r,s,o,n,a){return i(t^r^s,e,t,o,n,a)},a=function(e,t,r,s,o,n,a){return i(r^(t|~s),e,t,o,n,a)};return function(e){for(var t,r="0123456789abcdef",i="",s=0,o=e.length;s<o;s++)t=e.charCodeAt(s),i+=r.charAt(t>>>4&15)+r.charAt(15&t);return i}(function(e){for(var t="",r=0,i=32*e.length;r<i;r+=8)t+=String.fromCharCode(e[r>>5]>>>r%32&255);return t}(function(e,t){var i,l,d,c,u=1732584193,h=-271733879,p=-1732584194,f=271733878;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var g=0,v=e.length;g<v;g+=16)i=u,l=h,d=p,c=f,u=s(u,h,p,f,e[g+0],7,-680876936),f=s(f,u,h,p,e[g+1],12,-389564586),p=s(p,f,u,h,e[g+2],17,606105819),h=s(h,p,f,u,e[g+3],22,-1044525330),u=s(u,h,p,f,e[g+4],7,-176418897),f=s(f,u,h,p,e[g+5],12,1200080426),p=s(p,f,u,h,e[g+6],17,-1473231341),h=s(h,p,f,u,e[g+7],22,-45705983),u=s(u,h,p,f,e[g+8],7,1770035416),f=s(f,u,h,p,e[g+9],12,-1958414417),p=s(p,f,u,h,e[g+10],17,-42063),h=s(h,p,f,u,e[g+11],22,-1990404162),u=s(u,h,p,f,e[g+12],7,1804603682),f=s(f,u,h,p,e[g+13],12,-40341101),p=s(p,f,u,h,e[g+14],17,-1502002290),h=s(h,p,f,u,e[g+15],22,1236535329),u=o(u,h,p,f,e[g+1],5,-165796510),f=o(f,u,h,p,e[g+6],9,-1069501632),p=o(p,f,u,h,e[g+11],14,643717713),h=o(h,p,f,u,e[g+0],20,-373897302),u=o(u,h,p,f,e[g+5],5,-701558691),f=o(f,u,h,p,e[g+10],9,38016083),p=o(p,f,u,h,e[g+15],14,-660478335),h=o(h,p,f,u,e[g+4],20,-405537848),u=o(u,h,p,f,e[g+9],5,568446438),f=o(f,u,h,p,e[g+14],9,-1019803690),p=o(p,f,u,h,e[g+3],14,-187363961),h=o(h,p,f,u,e[g+8],20,1163531501),u=o(u,h,p,f,e[g+13],5,-1444681467),f=o(f,u,h,p,e[g+2],9,-51403784),p=o(p,f,u,h,e[g+7],14,1735328473),h=o(h,p,f,u,e[g+12],20,-1926607734),u=n(u,h,p,f,e[g+5],4,-378558),f=n(f,u,h,p,e[g+8],11,-2022574463),p=n(p,f,u,h,e[g+11],16,1839030562),h=n(h,p,f,u,e[g+14],23,-35309556),u=n(u,h,p,f,e[g+1],4,-1530992060),f=n(f,u,h,p,e[g+4],11,1272893353),p=n(p,f,u,h,e[g+7],16,-155497632),h=n(h,p,f,u,e[g+10],23,-1094730640),u=n(u,h,p,f,e[g+13],4,681279174),f=n(f,u,h,p,e[g+0],11,-358537222),p=n(p,f,u,h,e[g+3],16,-722521979),h=n(h,p,f,u,e[g+6],23,76029189),u=n(u,h,p,f,e[g+9],4,-640364487),f=n(f,u,h,p,e[g+12],11,-421815835),p=n(p,f,u,h,e[g+15],16,530742520),h=n(h,p,f,u,e[g+2],23,-995338651),u=a(u,h,p,f,e[g+0],6,-198630844),f=a(f,u,h,p,e[g+7],10,1126891415),p=a(p,f,u,h,e[g+14],15,-1416354905),h=a(h,p,f,u,e[g+5],21,-57434055),u=a(u,h,p,f,e[g+12],6,1700485571),f=a(f,u,h,p,e[g+3],10,-1894986606),p=a(p,f,u,h,e[g+10],15,-1051523),h=a(h,p,f,u,e[g+1],21,-2054922799),u=a(u,h,p,f,e[g+8],6,1873313359),f=a(f,u,h,p,e[g+15],10,-30611744),p=a(p,f,u,h,e[g+6],15,-1560198380),h=a(h,p,f,u,e[g+13],21,1309151649),u=a(u,h,p,f,e[g+4],6,-145523070),f=a(f,u,h,p,e[g+11],10,-1120210379),p=a(p,f,u,h,e[g+2],15,718787259),h=a(h,p,f,u,e[g+9],21,-343485551),u=r(u,i),h=r(h,l),p=r(p,d),f=r(f,c);return[u,h,p,f]}(function(e){var t,r,i=Array(e.length>>2);for(t=0,r=i.length;t<r;t++)i[t]=0;for(t=0,r=8*e.length;t<r;t+=8)i[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return i}(t=function(e){for(var t,r,i="",s=-1,o=e.length;++s<o;)t=e.charCodeAt(s),r=s+1<o?e.charCodeAt(s+1):0,55296<=t&&t<=56319&&56320<=r&&r<=57343&&(t=65536+((1023&t)<<10)+(1023&r),s++),t<=127?i+=String.fromCharCode(t):t<=2047?i+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?i+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(i+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return i}(e)),8*t.length)))}r.d(t,{F:()=>i})},8384:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__8384__},992:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__992__},2840:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__2840__},9780:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__9780__},9155:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__9155__},7315:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__7315__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";var e,t,r,i;__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AppearanceManager:()=>O,FavoriteStoryList:()=>Io,IASContainer:()=>Mo,StoryCardViewModel:()=>cr,StoryList:()=>xo,StoryListViewModel:()=>fr,StoryManager:()=>ai,UGCStoryList:()=>Eo}),function(e){e.LEFT="left",e.RIGHT="right"}(e||(e={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(t||(t={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(r||(r={})),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"}(i||(i={}));e.RIGHT,t.FLAT,r.CIRCLE,r.CIRCLE;var s;!function(e){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"}(s||(s={}));var o,n=__webpack_require__(46);!function(e){e.LEFT="left",e.RIGHT="right"}(o||(o={}));const a={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:o.RIGHT,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};var l,d,c,u,h,p;!function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right"}(l||(l={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(d||(d={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(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.START_LOADER="startLoad",e.END_LOADER="endLoad"}(p||(p={}));const f={direction:"horizontal",card:{title:{font:'14px/1.2 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',color:"#ffffff",padding:15,textAlign:c.LEFT,position:u.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:h.High,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},coverLazyLoading:!1},favoriteCard:{title:{content:"Избранное",font:"normal",color:"#000",padding:15,textAlign:c.LEFT,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.LEFT},navigation:{speed:300,showControls:!1,controlsSize:48,controlsBackgroundColor:"white",controlsColor:"black"},ugcCard:{title:{content:null,font:'14px/1.2 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',color:"#000",padding:15,textAlign:c.LEFT,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"}};var g,v;!function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(g||(g={})),function(e){e.vk="vk",e.ok="ok",e.facebook="facebook",e.twitter="twitter",e.linkedin="linkedin",e.telegram="telegram"}(v||(v={}));const m={gameReaderOptions:{loader:{default:{color:"white",accentColor:"transparent"},custom:null}},scrollStyle:g.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:{targets:[...Object.values(v)],copyButton:{svgSrc:{baseState:'<svg width="31.5px" height="35px" 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>'}},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>'}}},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:"",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>'}}},_={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};var y,w=__webpack_require__(2743),b=__webpack_require__.n(w);!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(y||(y={}));const S={goodsWidgetRenderingType:y.DEFAULT,goodsList:{renderingType:y.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"}}},C={loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:a.forceDesktopMode,forceCheckOrientation:!0};class O extends n.EventEmitter{constructor(){super(),this._commonOptions=a,this._storiesListOptions=f,this._storyReaderOptions=m,this._storyFavoriteReaderOptions=_,this._goodsWidgetOptions=S,this._gameReaderOptions=C,this._mqls=new Map,this._composeOptionsOverrideByMediaQuery=this._composeOptionsOverrideByMediaQuery.bind(this)}setCommonOptions(e,t=!0){return this._commonOptions=b()(this._commonOptions,e),this.emit(s.EVENT_UPDATED_COMMON_OPTIONS,this.commonOptions),this}get commonOptions(){return this._commonOptions}setStoriesListOptions(e,t=!0){return this._storiesListOptions=b()(this._storiesListOptions,e),t&&this.emit(s.EVENT_UPDATED_STORIES_LIST_OPTIONS,this.storiesListOptions),this}get storiesListOptions(){return this._storiesListOptions}setStoryReaderOptions(e,t=!0){return this._storyReaderOptions=b()(this._storyReaderOptions,e,{arrayMerge:(e,t,r)=>t}),t&&this.emit(s.EVENT_UPDATED_STORY_READER_OPTIONS,{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=b()(this._storyFavoriteReaderOptions,e),t&&this.emit(s.EVENT_UPDATED_FAVORITE_READER_OPTIONS,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=b()(this._goodsWidgetOptions,e),t&&this.emit(s.EVENT_UPDATED_GOODS_WIDGET_OPTIONS,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}setGameReaderOptions(e,t=!0){return this._gameReaderOptions=b()(this._gameReaderOptions,e),t&&this.emit(s.EVENT_UPDATED_GAME_READER_OPTIONS,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)}setOptionsOverrideByMediaQuery(e){return this.removeMediaQueryEventListeners(),this.initMediaQueries(e),this}initMediaQueries(e){for(const t of e){const e=this._composeMqlCondition(t);if(null!==e&&null!=window.matchMedia){const r=window.matchMedia(e);this._mqls.set(r,t),r.addEventListener("change",this._composeOptionsOverrideByMediaQuery)}}this._composeOptionsOverrideByMediaQuery()}_composeMqlCondition(e){let t=null;if(null!=e.viewportMinSize){if("number"==typeof e.viewportMinSize)t=`(min-width: ${e.viewportMinSize}px)`;else if("string"==typeof e.viewportMinSize)switch(e.viewportMinSize){case"sm":t="(min-width: 576px)";break;case"md":t="(min-width: 768px)";break;case"lg":t="(min-width: 992px)";break;case"xl":t="(min-width: 1200px)";break;default:t=null}null!=e.mediaQuery&&"string"==typeof e.mediaQuery&&e.mediaQuery.length>0&&(t=e.mediaQuery)}return t}_composeOptionsOverrideByMediaQuery(e){const t=new Set;for(const[e,r]of this._mqls)e.matches&&(null!=r.commonOptions&&(this.setCommonOptions(r.commonOptions,!1),t.add("commonOptions")),null!=r.storiesListOptions&&(this.setStoriesListOptions(r.storiesListOptions,!0),t.add("storiesListOptions")),null!=r.storyReaderOptions&&(this.setStoryReaderOptions(r.storyReaderOptions,!1),t.add("storyReaderOptions")),null!=r.storyFavoriteReaderOptions&&(this.setStoryFavoriteReaderOptions(r.storyFavoriteReaderOptions,!1),t.add("storyFavoriteReaderOptions")),null!=r.goodsWidgetOptions&&(this.setGoodsWidgetOptions(r.goodsWidgetOptions,!1),t.add("goodsWidgetOptions")),null!=r.gameReaderOptions&&(this.setGameReaderOptions(r.gameReaderOptions,!1),t.add("gameReaderOptions")));t.forEach((e=>{switch(e){case"commonOptions":this.setCommonOptions({});break;case"storiesListOptions":this.setStoriesListOptions({});break;case"storyReaderOptions":this.setStoryReaderOptions({});break;case"storyFavoriteReaderOptions":this.setStoryFavoriteReaderOptions({});break;case"goodsWidgetOptions":this.setGoodsWidgetOptions({});break;case"gameReaderOptions":this.setGameReaderOptions({})}}))}removeMediaQueryEventListeners(){for(const e of this._mqls.keys())e.removeEventListener("change",this._composeOptionsOverrideByMediaQuery);this._mqls.clear()}destroy(){this.removeMediaQueryEventListeners()}}var k,L,M,A,x,E;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(k||(k={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite"}(L||(L={})),function(e){e[e.default=0]="default",e[e.onboarding=1]="onboarding",e[e.favorite=2]="favorite",e[e.direct=3]="direct"}(M||(M={})),function(e){e.list="list",e.favorite="favorite"}(A||(A={})),function(e){e.CLICK_ON_STORY="clickOnStoryLink"}(x||(x={})),function(e){e.TEXT="text",e.IMAGE="image"}(E||(E={}));var I=__webpack_require__(3580),R=__webpack_require__(2840),T=__webpack_require__(3142),P=__webpack_require__.n(T),D=__webpack_require__(1580),j=__webpack_require__.n(D);const F=(0,R.createStore)({default:{},user:{}}),{sdkPlaceholdersChanged:N,addDefaultPlaceholders:U}=(0,R.createApi)(F,{sdkPlaceholdersChanged:(e,t)=>({default:e.default,user:t}),addDefaultPlaceholders:(e,t)=>{let r={default:{},user:e.user};return P()(t)&&t.forEach((e=>{j()(e)&&void 0!==e.name&&void 0!==e.default_value&&(r.default[e.name]=e.default_value)})),r}});var B=__webpack_require__(3655),G=__webpack_require__.n(B),V=__webpack_require__(8138),z=__webpack_require__.n(V),W=__webpack_require__(986),q=__webpack_require__.n(W),$=__webpack_require__(4269);class Z{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._disableOverFlow(),this._setElementAttributes("body","paddingRight",(t=>t+e))}_disableOverFlow(){const e=this.window.document.body.style.overflow;e&&(this.window.document.body.dataset.overflow=e),this.window.document.body.style.overflow="hidden"}_setElementAttributes(e,t,r){const i=this.width;this.window.document.querySelectorAll(e).forEach((e=>{if(e!==this.window.document.body&&this.window.innerWidth>e.clientWidth+i)return;const s=e.style[t],o=this.window.getComputedStyle(e)[t];e.dataset[t]=s,e.style[t]=`${r(Number.parseFloat(o))}px`}))}resetScrollbar(){this._resetElementAttributes("body","overflow"),this._resetElementAttributes("body","paddingRight")}_resetElementAttributes(e,t){this.window.document.querySelectorAll(e).forEach((e=>{const r=e.dataset[t];void 0===r?e.style.removeProperty(t):(delete e.dataset[t],e.style[t]=r)}))}}var H=__webpack_require__(5474),K=__webpack_require__(1650),Q=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class Y extends $.A{constructor(e,t){super(e,t),this.iframe=null,this._silentClose=!1}set silentClose(e){this._silentClose=e}init(e){return Q(this,void 0,void 0,(function*(){var t={},r={};t.allowTransparency=!0,t.overflowTouch=!1,t.zIndex=2147483644,t.backgroundColor="transparent";var i={startHeight:70,minWidth:150,storiesHeight:70},s=(document.querySelector("body"),document.querySelector("html"),t.zIndex||2147483645);const o=new Z(window),n=this,a={event:function(e,t){n.emit(e,t)},setFixedHtmlPosition:function(){},open:function(e){e.windowReferer===L.default?o.setScrollbar():(e.windowReferer,L.favorite),n.emit("openStoryReader",e),n.iframe&&(n.iframe.style.setProperty("display","block"),n.iframe.style.setProperty("z-index",s))},close:function(e){var t;e.windowReferer===L.default?o.resetScrollbar():(e.windowReferer,L.favorite),!1===n._silentClose&&n.emit("closeStoryReader",e),n.iframe&&n.iframe.style.setProperty("display","none"),null===(t=n.browserHistory)||void 0===t||t.destroy()}};return new Promise(((s,o)=>{this._init(t,r,e,a,i,((e,t,r)=>{e,t,r}),null,null,s,o)}))}))}getWidgetDocument(e,t){var r,i;return`\n <script type="text/javascript" src="${`${H.C.baseUrl}/v2.11.3/dist/js/storyReader.js`}"><\/script>\n ${(Array.isArray(null===(r=this.options)||void 0===r?void 0:r.storyWidgetsResources)?null===(i=this.options)||void 0===i?void 0:i.storyWidgetsResources:[]).map((e=>"js"===e.type?`<script type="text/javascript" src="${e.src}" data-hid="${(0,K.F)(e.src)}"><\/script>`:"")).join("")}\n\n <div id="app"><div id="_app"></div></div>\n <script type="text/javascript" nonce="${t}">\n window.storyReader.init(${JSON.stringify(e)});\n <\/script>\n`}_init(e,t,r,i,s,o,n,a,l,d){const c=Object.create(null,{__init:{get:()=>super.__init}});return Q(this,void 0,void 0,(function*(){return s.fullScreen=!0,s.scrolling=!1,s.hidden=!0,o=(e,t,r)=>{this.rpc=r,this.iframe=t},c.__init.call(this,e,t,r,i,s,o,n,a,l,d)}))}rpcCb(e,t){var r;null===(r=this.rpc)||void 0===r||r.callMethod(e,t)}sessionInit(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onSessionInit",e)}openReader(e,t){var r;this.options=Object.assign(Object.assign({},this.options),{sourceInfo:t}),null===(r=this.rpc)||void 0===r||r.callMethod("onOpenReader",e)}closeReader(){var e;null===(e=this.rpc)||void 0===e||e.callMethod("onCloseReader")}closeGoodsWidget(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onCloseGoodsWidget",e)}syncStoreHandle(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onSyncStore",e)}setStories(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setStories",e)}setStoriesAndContext(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onSetStoriesAndContext",e)}setFonts(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setFonts",e)}_destroyClientWidget(){this.rpc.callMethod("destroyWidget")}setOptions(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setOptions",e)}pauseAndBlockViewerUI(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("pauseAndBlockViewerUI",e)}resumeAndEnableViewerUI(){var e;null===(e=this.rpc)||void 0===e||e.callMethod("resumeAndEnableViewerUI")}setStoryWidgetsResources(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setStoryWidgetsResources",e)}}var X=__webpack_require__(7315);class J{static createFunctionWithTimeout(e,t){let r=!1;function i(){r||(r=!0,e())}return setTimeout(i,t||1e3),i}static convertModelToFormData(e,t,r){t instanceof Object&&Object.keys(t).forEach((i=>{const s=t[i];if(s instanceof Object&&!Array.isArray(s))return this.convertModelToFormData(e,s,i);r&&(i=`${r}[${i}]`),Array.isArray(s)?s.forEach((t=>{e.append(`${i}[]`,t)})):e.append(i,s)}))}}const ee=e=>null==e;function te(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function re(e,t){return Object.assign(Object.assign({},e),t)}function ie(e){return e.replace(/^\//,"")}function se(e){let t=e.length;for(let r=e.length-1;r>=0;r--){const i=e.charCodeAt(r);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&r--}return t}class oe{constructor(){return this._sdkConfigIsIncorrect=!1,this._userIdByteLimit=255,this._tagsByteLimit=4e3,this.userMessage="",this.tagsMessage="",oe.instance||(oe.instance=this),oe.instance}static getInstance(){return oe.instance?oe.instance:new oe}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&&se(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)&&se(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 ne=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const ae=`InAppStoryWebSDK/${parseInt(202)} ${navigator.userAgent}`;const le=new class{constructor(){this._deviceInfoPromise=null,this._baseHeaders={},this.requestInterceptors=[],this.interceptors={request:{use:e=>{this.requestInterceptors.push(e)}}}}set deviceInfoPromise(e){this._deviceInfoPromise=e}set baseHeaders(e){this._baseHeaders=e}get baseURL(){return`${H.C.apiUrl}/v2/`}request(e){return ne(this,void 0,void 0,(function*(){return new Promise(((t,r)=>{const i=()=>ne(this,void 0,void 0,(function*(){try{if(te(e.headers)&&null!=e.headers||(e.headers={}),e.headers=re(this._baseHeaders,e.headers),this.requestInterceptors.length)for(const t of this.requestInterceptors)t(e);let r="";!ee(e.params)&&te(e.params)&&(r=new URLSearchParams(Object.entries(e.params)).toString());let i=new URL(`${ie(e.url)}${r?"?"+r:""}`,this.baseURL),s="get";ee(e.method)||(s=e.method);let o={};!ee(e.headers)&&te(e.headers)&&(o=e.headers);let n=null;!ee(e.data)&&te(e.data)&&(n=JSON.stringify(e.data),o["Content-Type"]="application/json");try{if(oe.getInstance().sdkConfigIsIncorrect)return void t({data:{name:"SDK config is incorrect",message:oe.getInstance().sdkConfigErrorsAsArray.join(". "),status:400},headersRaw:{},headers:{},status:400,statusText:"SDK config is incorrect",ok:!1})}catch(e){console.error(e)}const a=yield fetch(i.toString(),{method:s,body:n,headers:o,credentials:"omit"}),l=yield a.json();t({data:l,headersRaw:a.headers,headers:Object.fromEntries([...a.headers]),status:a.status,statusText:a.statusText,ok:a.ok})}catch(e){r(e)}}));this._deviceInfoPromise?this._deviceInfoPromise.finally(i):i()}))}))}post(e,t){return ne(this,void 0,void 0,(function*(){return this.request({method:"post",url:e,data:t})}))}get(e,t){return ne(this,void 0,void 0,(function*(){return this.request({method:"get",url:e,params:t})}))}};function de(e,t,r){var i,s,o;if("sendBeacon"in navigator){const n=new URLSearchParams({access_token:I.Tl.getState().apiKey,session_id:null===(s=null===(i=ue.getState())||void 0===i?void 0:i.session)||void 0===s?void 0:s.id,x_user_agent:ae}),a=I.Tl.getState();null!=a.appPackageId&&n.append("x_app_package_id",a.appPackageId);const l=`${o=le.baseURL,o.replace(/\/$/,"")}/${ie(e)}?${n.toString()}`,d=new FormData;Object.keys(t).forEach((e=>{J.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),r()}else le.post(e,t).then((()=>r()),(()=>r()))}le.interceptors.request.use((e=>{var t,r,i;const s=I.Tl.getState();return e.headers=re(null!==(t=e.headers)&&void 0!==t?t:{},{Authorization:`Bearer ${s.apiKey}`,"Accept-Language":s.lang||"en","Auth-Session-Id":null===(i=null===(r=ue.getState())||void 0===r?void 0:r.session)||void 0===i?void 0:i.id,"X-Device-Id":I.Ue.getState(),"X-User-Id":s.userId?s.userId:"","X-Request-Id":(0,X.v4)(),"X-User-Agent":ae}),null!=s.appPackageId&&(e.headers["X-App-Package-Id"]=s.appPackageId),e}));const ce=le,ue=(0,R.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}),he=(0,R.createEffect)();ue.on(he.doneData,((e,t)=>t));const pe=(0,R.createEvent)(),fe=(0,R.createEvent)();ue.on(fe,(e=>{const t=Object.assign({},e);return t.session.id="",t}));const ge=(0,R.createEffect)((e=>{de("session/update",e,(()=>{}))})).prepend((e=>({data:[[5,0,...e]]}))),ve=ue.map((e=>e.storyWidgetsResources));const me=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();var _e=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};let ye=null;function we(){return _e(this,void 0,void 0,(function*(){return null!=ye?ye:new Promise((e=>{!function(e,t){const r=new Image;r.onload=function(){var i=r.width>0&&r.height>0;t(e,i)},r.onerror=function(){t(e,!1)},r.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"}[e]}("lossy",((t,r)=>{ye=r,e(r)}))}))}))}var be=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const Se=__webpack_require__(7315);function Ce(){return be(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([ke(),we()]);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:Oe(e,t)}}))}he.use((()=>be(void 0,void 0,void 0,(function*(){return(yield ce.request(yield Ce())).data})))),(0,R.forward)({from:pe,to:ue});const Oe=(e,t)=>{"iOS"===e.os_name?window.isIos=!0:"Android"===e.os_name&&(window.Android=!0);const r=I.Tl.getState();return r&&r.userId&&(e.user_id=r.userId),e.features="animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder",t&&(e.features+=",webp"),e},ke=()=>be(void 0,void 0,void 0,(function*(){return new Promise(((e,t)=>{let r=function(e){let t=null;if(me){let r=window.localStorage.getItem(e);null!==r&&z()(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}("device_data"),i=null;if(null!==r&&(i=r.device_id),null!==r&&i&&z()(i)&&36===i.trim().length)(0,I.YB)(i),e(r);else{const t={platform:"web",device_id:Se.v4()};!function(e,t){me&&window.localStorage.setItem(e,JSON.stringify(t))}("device_data",t),(0,I.YB)(t.device_id),e(t)}}))}));var Le;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.UGC=1]="UGC"}(Le||(Le={}));const Me=e=>({id:e,type:Le.DEFAULT,title:null,title_color:null,background:null,background_color:null,image:null,display_to:null,display_from:null,slides_html:[],slides_screenshot_share:[],slides_duration:[],favorite:null,like:null,slides_count:0,deeplink:null,hide_in_reader:null,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,slides_payload:[],game_instance:{id:null},share_url:null,slidesLoaded:!1}),Ae=(0,R.createStore)({default:[]}),xe=Ae.map((e=>e[ue.getState().user_key||"default"]||[]));var Ee;!function(e){e.FEEDS="feeds",e.FAVORITE="favorite"}(Ee||(Ee={}));const Ie=(0,R.createStore)({default:{[Ee.FEEDS]:{},[Ee.FAVORITE]:[]}}),Re=Ie.map((e=>e[ue.getState().user_key||"default"]||{})),Te=(0,R.createStore)({}),Pe=(0,R.createStore)({}),De=(0,R.createStore)([]),je=(e,t)=>e.map((e=>t.find((t=>t.id===e)))).filter((e=>!!e));Te.on([Re,xe],((e,t)=>{const r=Re.getState(),i=xe.getState();return((e,t)=>{const r={};for(const[i,s]of Object.entries(e))r[i]=je(s,t);return r})(r[Ee.FEEDS],i)})),Pe.on([Re,xe],((e,t)=>{const r=Re.getState(),i={},s=xe.getState();for(const e in r[Ee.FEEDS])if("onboarding_"===e.substring(0,11)){const t=e.substring(11);i[t]=[],r[Ee.FEEDS][e]&&Array.isArray(r[Ee.FEEDS][e])&&(i[t]=s.filter((t=>-1!==r[Ee.FEEDS][e].indexOf(t.id)&&!t.is_opened)))}return i})),De.on([Re,xe],((e,t)=>{const r=Re.getState();return xe.getState().filter((e=>{var t;return-1!==(null===(t=r[Ee.FAVORITE])||void 0===t?void 0:t.indexOf(e.id))}))}));const Fe=(0,R.createEffect)(),Ne=(e,t="")=>(e.is_opened,e.is_opened),Ue=xe.map((e=>{const t={};return t[Le.DEFAULT]=e.filter((e=>!e.slidesLoaded&&e.type===Le.DEFAULT)).map((e=>e.id)),t[Le.UGC]=e.filter((e=>!e.slidesLoaded&&e.type===Le.UGC)).map((e=>e.id)),t})),{storyItemFavoriteChanged:Be,storyItemLikeChanged:Ge,storyItemIsOpenedChanged:Ve}=(Object.prototype.hasOwnProperty,(0,R.createApi)(Ae,{storyItemFavoriteChanged:(e,{id:t,favorite:r})=>{const i=ue.getState().user_key||"default",s=(e[i]||[]).slice(0),o=s.find((e=>e.id===t));return void 0!==o&&(o.favorite=r),Object.assign(Object.assign({},e),{[i]:s})},storyItemLikeChanged:(e,{id:t,like:r})=>{const i=ue.getState().user_key||"default",s=(e[i]||[]).slice(0),o=s.find((e=>e.id===t));return void 0!==o&&(o.like=r),Object.assign(Object.assign({},e),{[i]:s})},storyItemIsOpenedChanged:(e,{id:t})=>{const r=ue.getState().user_key||"default",i=(e[r]||[]).slice(0),s=i.find((e=>e.id===t));return void 0!==s&&(s.is_opened=!0),Object.assign(Object.assign({},e),{[r]:i})}}));var ze=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};function We(e,t,r=!1,i,s){const o=["slides_html","slides_duration","slides_screenshot_share","slides_payload"];s&&o.push("share_url");const n={url:`${t===Xr?"ugc/":""}story/${e}`,method:"GET",params:{expand:o.join(",")}};return r||null!=n.params&&(n.params.fields=["id","slides_html","slides_duration","slides_screenshot_share","slides_payload"].join(",")),null!==i&&null!=n.params&&(n.params.session_id=i),n}Fe.use((({listType:e})=>ze(void 0,void 0,void 0,(function*(){return ce.get("story",qe())}))));const qe=(e,t,r,i,s)=>{var o;let n=null===(o=I.Tl.getState())||void 0===o?void 0:o.tags;const a={};n&&P()(n)&&n.length>0&&(a.tags=n.join(",")),void 0!==t&&P()(t)&&t.length>0&&(a.tags=t.join(","));return null==i||"number"!=typeof i&&!(e=>!isNaN(parseFloat(e))&&isFinite(e))(i)||(a.limit=i),e&&(a.session_id=e),null!=r&&(a.test=r),null!=s&&j()(s)&&(a.f=s),{params:a}},$e=(0,R.createEffect)();var Ze=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};$e.use((()=>Ze(void 0,void 0,void 0,(function*(){return(yield ce.request(yield function(){return Ze(this,void 0,void 0,(function*(){return{method:"GET",url:"ugc/editor-config",params:{}}}))}())).data})))),ue.on($e.doneData,((e,t)=>{const r=Object.assign({},e);return r.editor=t,r}));const He=(e,t)=>{const r={};return r[Le.DEFAULT]=[],r[Le.UGC]=[],r[e]=t,{storyTypeIds:r,style:"",widgetsData:{}}},Ke=(e,t)=>{let r;return r=null==t?He(Le.DEFAULT,[]):t,{ids:r.storyTypeIds[e],style:r.style,widgetsData:r.widgetsData}},Qe=(0,R.createStore)({style:"",storyTypeIds:{[Le.DEFAULT]:[],[Le.UGC]:[]},widgetsData:{}}),Ye=(0,R.createEffect)(),Xe=(0,R.createEvent)();var Je=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};function et(e,t){const r={url:"story-context",method:"GET",params:{id:e.join(","),fields:["style","widgetsData"].join(",")}};return null!=t&&null!=r.params&&(r.params.session_id=t),r}function tt(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}Ye.use((({ids:e})=>Je(void 0,void 0,void 0,(function*(){return ce.request(et(e))})))),(0,R.forward)({from:Ye.done.filterMap((({params:e,result:t})=>{const r=t.data,i=Jr(e.feedSlug);if(r&&j()(r)){const t=He(i,e.ids);return t.style=r.style,t.widgetsData=r.widgetsData,t}})),to:Qe}),(0,R.forward)({from:Xe,to:Qe});var rt=__webpack_require__(3514),it=__webpack_require__.n(rt);const st=(0,R.createStore)({default:{},user:{}}),{sdkImagePlaceholdersChanged:ot,addDefaultImagePlaceholders:nt}=(0,R.createApi)(st,{sdkImagePlaceholdersChanged:(e,t)=>({default:e.default,user:t}),addDefaultImagePlaceholders:(e,t)=>{let r={default:{},user:e.user};return P()(t)&&t.forEach((e=>{j()(e)&&void 0!==e.name&&void 0!==e.default_value&&(r.default[e.name]=e.default_value)})),r}});var at=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const lt=(0,R.createEffect)((({defaultList:e,onboardingList:t,favoriteList:r,onboardingTags:i,testKey:s,limit:o})=>at(void 0,void 0,void 0,(function*(){var n,a,l;const d=[],c=null===(a=null===(n=ue.getState())||void 0===n?void 0:n.session)||void 0===a?void 0:a.id;let u=null;if(it()(c)&&(d.push(dt(yield Ce(),"session")),u="@{session.session.id}"),!1!==e&&j()(e)&&z()(e.feedSlug)){const t=e.feedSlug,r=null!==(l=e.filter)&&void 0!==l?l:{};t===Xr?d.push(dt(function(e,t,r,i,s){const{params:o}=qe(r,i,s,null,t);return{method:"GET",url:"ugc/feed",params:o}}(0,r,u,[],s),`storyList_${t}`)):d.push(dt(function(e,t,r,i){const{params:s}=qe(t,r,i);return{method:"GET",url:`feed/${e}`,params:s}}(t,u,[],s),`storyList_${t}`))}r&&d.push(dt(function(e){const{params:t}=qe(e);return{method:"GET",url:"story",params:Object.assign(Object.assign({},t),{favorite:1})}}(u),"storyFavoriteList")),!1!==t&&z()(t)&&d.push(dt(function(e="onboarding",t,r,i){const{params:s}=qe(t,r,null,i);return{method:"GET",url:`feed/${e}/onboarding`,params:s}}(t,u,i,o),`storyOnboardingList_${t}`));let h=null;try{const e=yield ce.post("composite",{compositeRequest:d});if(e.status>=200&&e.status<=299)if(e.data&&e.data.compositeResponse&&Array.isArray(e.data.compositeResponse)){if(e.data.success)return e.data.compositeResponse;for(const t of e.data.compositeResponse){const e=t.status;if(q()(e)&&!(e>=200&&e<=299)){h={name:"networkError",networkStatus:e,networkMessage:String(t.body)};break}}}else h=e.data&&j()(e.data)&&null!=e.data.name&&null!=e.data.message&&null!=e.data.status?{name:e.data.name,networkStatus:e.data.status,networkMessage:e.data.message}:{name:"networkError",networkStatus:null,networkMessage:"Invalid data in API response, data from response as json: "+JSON.stringify(e.data)};else h=e.data&&j()(e.data)&&null!=e.data.name&&null!=e.data.message&&null!=e.data.status?{name:e.data.name,networkStatus:e.data.status,networkMessage:e.data.message}:{name:"networkError",networkStatus:e.status,networkMessage:"Invalid data in API response, data from response as json: "+JSON.stringify(e.data)}}catch(e){try{const t=e;if(t.response&&t.response.status)h={name:"networkError",networkStatus:t.response.status,networkMessage:t.response.statusText};else{let t="";window.navigator&&null!=window.navigator.onLine&&(t=" net::ERR_INTERNET_DISCONNECTED"),h={name:"error",networkStatus:null,networkMessage:e.toString()+t},console.error(e)}}catch(e){h={name:"error",networkStatus:null,networkMessage:e.toString()}}}if(null!==h)throw h;return[]})))),dt=(e,t)=>({path:e.url,qs:e.params,body:e.data,ref:t,method:e.method}),ct=e=>{const t=F.getState();for(let r in t.user)ht.call(t.user,r)&&(e=tt(e,`%${r}%`,t.user[r]));for(let r in t.default)ht.call(t.default,r)&&(e=tt(e,`%${r}%`,t.default[r]));const r=st.getState();for(let t in r.user)ht.call(r.user,t)&&(e=tt(e,`%${t}%`,r.user[t]));for(let t in r.default)ht.call(r.default,t)&&(e=tt(e,`%${t}%`,r.default[t]));return e},ut=(e,t)=>Array.isArray(e)?e.map((e=>Object.assign(Object.assign({},e),{title:e.need_placeholders?ct(e.title):e.title,slidesLoaded:!1,is_opened:Ne(e),type:t}))):[];(0,R.forward)({from:lt.doneData.filterMap((e=>{var t;return null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body})),to:ue}),(0,R.forward)({from:lt.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.placeholders})),to:U}),(0,R.forward)({from:lt.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.image_placeholders})),to:nt}),(0,R.forward)({from:he.doneData.filterMap((e=>e.placeholders)),to:U}),(0,R.forward)({from:he.doneData.filterMap((e=>e.image_placeholders)),to:nt});const ht=Object.prototype.hasOwnProperty;(0,R.sample)({source:Ae,clock:ue,fn:(e,t)=>{const r={};for(const i in e)ht.call(e,i)&&(r[i]=e[i].map((e=>Object.assign(Object.assign({},e),{is_opened:Ne(e,t.user_key),title:e.need_placeholders?ct(e.title):e.title}))));return r},target:Ae});const{storiesListIdsChanged:pt}=(0,R.createApi)(Ie,{storiesListIdsChanged:(e,{storiesIdsUserEntity:t,feedSlug:r,storyList:i})=>{let s=ue.getState().user_key||"default";const o=e[s]||{};return void 0===o[Ee.FAVORITE]&&(o[Ee.FAVORITE]=[]),void 0===o[Ee.FEEDS]&&(o[Ee.FEEDS]={}),t===Ee.FEEDS&&r&&(o[Ee.FEEDS][r]=i.map((e=>e.id))),t===Ee.FAVORITE&&(o[Ee.FAVORITE]=i.map((e=>e.id))),Object.assign(Object.assign({},e),{[s]:o})}}),{storiesListItemsAdded:ft}=(0,R.createApi)(Ae,{storiesListItemsAdded:(e,{storiesIdsUserEntity:t,feedSlug:r,storyList:i})=>{let s=ue.getState().user_key||"default";const o=e[s]||[],n=o.map((e=>e.id));return Object.assign(Object.assign({},e),{[s]:[...o,...i.filter((e=>-1===n.indexOf(e.id)))]})}});(0,R.forward)({from:lt.doneData.filterMap((e=>{var t;let r=null;for(const i of e)if(i.ref&&z()(i.ref)){const e=i.ref.match(/^storyList_(.+)/);if(e&&Array.isArray(e)&&e[1]){let s=null===(t=i.body)||void 0===t?void 0:t.stories;const o=Jr(e[1]);o===Le.UGC&&(s=i.body);const n=ut(s,o);r={storiesIdsUserEntity:Ee.FEEDS,feedSlug:e[1],storyList:n}}}if(r)return r})),to:[ft,pt]}),(0,R.forward)({from:lt.doneData.filterMap((e=>{var t;let r=null;for(const i of e)if(i.ref&&z()(i.ref)){const e=i.ref.match(/^storyOnboardingList_(.+)/);if(e&&Array.isArray(e)&&e[1]){const s=ut(null===(t=i.body)||void 0===t?void 0:t.stories,Le.DEFAULT);r={storiesIdsUserEntity:Ee.FEEDS,feedSlug:`onboarding_${e[1]}`,storyList:s}}}if(r)return r})),to:[ft,pt]}),(0,R.forward)({from:lt.doneData.filterMap((e=>{const t=e.find((e=>"storyFavoriteList"===e.ref));if(void 0===t)return;const r=ut(t.body,Le.DEFAULT);return{storiesIdsUserEntity:Ee.FAVORITE,feedSlug:null,storyList:r}})),to:[ft,pt]});const gt=(0,R.createEffect)();gt.use((e=>at(void 0,void 0,void 0,(function*(){const t=e.ids.map((t=>dt(We(t,e.feedSlug),`storySlides_${t}`))),r=yield ce.post("composite",{compositeRequest:t});return r.data&&r.data.success&&r.data.compositeResponse&&Array.isArray(r.data.compositeResponse)?r.data.compositeResponse:[]}))));const vt=e=>e&&j()(e)&&"id"in e,mt=(0,R.createEffect)();mt.use((({ids:e,id:t,feedSlug:r})=>at(void 0,void 0,void 0,(function*(){const i=[dt(We(t,r),"storySlides"),dt(et(e),"storyContext")],s=yield ce.post("composite",{compositeRequest:i});return s.data&&s.data.success&&s.data.compositeResponse&&Array.isArray(s.data.compositeResponse)?s.data.compositeResponse:[]})))),Ae.on([gt.done,mt.done],((e,{params:t,result:r})=>{const i=r;if(Array.isArray(i)){const r=Jr(t.feedSlug),s=ue.getState().user_key||"default",o=(e[s]||[]).slice(0).map((e=>{var t,s,o,n,a,l,d,c,u,h,p,f,g,v,m;for(let _=0;_<i.length;_++)if(vt(null===(t=i[_])||void 0===t?void 0:t.body)&&(null===(o=null===(s=i[_])||void 0===s?void 0:s.body)||void 0===o?void 0:o.id)===e.id&&r===e.type)return Object.assign({},e,{slides_html:e.need_placeholders?Array.from(null!==(l=null===(a=null===(n=i[_])||void 0===n?void 0:n.body)||void 0===a?void 0:a.slides_html)&&void 0!==l?l:[]).map((e=>ct(e))):Array.from(null!==(u=null===(c=null===(d=i[_])||void 0===d?void 0:d.body)||void 0===c?void 0:c.slides_html)&&void 0!==u?u:[]),slides_duration:null===(p=null===(h=i[_])||void 0===h?void 0:h.body)||void 0===p?void 0:p.slides_duration,slides_screenshot_share:null===(g=null===(f=i[_])||void 0===f?void 0:f.body)||void 0===g?void 0:g.slides_screenshot_share,slides_payload:null===(m=null===(v=i[_])||void 0===v?void 0:v.body)||void 0===m?void 0:m.slides_payload,slidesLoaded:!0,is_opened:Ne(e)});return e}));return Object.assign(Object.assign({},e),{[s]:o})}return e})),(0,R.forward)({from:mt.done.filterMap((({params:e,result:t})=>{var r;const i=null===(r=t.find((e=>"storyContext"===e.ref)))||void 0===r?void 0:r.body,s=Jr(e.feedSlug);if(i&&j()(i)){const t=He(s,e.ids);return t.widgetsData=i.widgetsData,t.style=i.style,t}})),to:Qe});const _t=(0,R.createEffect)((({id:e,feedSlug:t,fetchShareUrl:r})=>at(void 0,void 0,void 0,(function*(){var i,s;const o=[],n=null===(s=null===(i=ue.getState())||void 0===i?void 0:i.session)||void 0===s?void 0:s.id;let a=null;it()(n)&&(o.push(dt(yield Ce(),"session")),a="@{session.session.id}"),o.push(dt(We(e,t,!0,a,r),"story")),o.push(dt(et([e],a),"storyContext"));const l=yield ce.post("composite",{compositeRequest:o});if(l.data&&l.data.success&&l.data.compositeResponse&&Array.isArray(l.data.compositeResponse))return l.data.compositeResponse;if(l.data&&!l.data.success)throw Error("composite request error:"+JSON.stringify(l.data.compositeResponse));return[]}))));(0,R.forward)({from:_t.doneData.filterMap((e=>{var t;const r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body;if(r&&j()(r)&&r)return r})),to:ue}),(0,R.forward)({from:_t.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.placeholders})),to:U}),(0,R.forward)({from:_t.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.image_placeholders})),to:nt}),(0,R.forward)({from:_t.done.filterMap((({params:e,result:t})=>{var r;const i=null===(r=t.find((e=>"storyContext"===e.ref)))||void 0===r?void 0:r.body;if(i&&j()(i)){const t=Jr(e.feedSlug),r=He(t,[e.id]);return r.widgetsData=i.widgetsData,r.style=i.style,r}})),to:Qe}),Ae.on(_t.done.filterMap((({params:e,result:t})=>{var r;const i=null===(r=t.find((e=>"story"===e.ref)))||void 0===r?void 0:r.body;if(i&&j()(i))return i.type=Jr(e.feedSlug),i})),((e,t)=>{if(!vt(t))return;const r=ue.getState().user_key||"default",i=(e[r]||[]).slice(0).filter((e=>e.id!==(null==t?void 0:t.id))).slice(0);return t=Object.assign(t,{slides_html:t.need_placeholders?Array.from(t.slides_html).map((e=>ct(e))):Array.from(t.slides_html),slides_duration:t.slides_duration,slidesLoaded:!0,is_opened:Ne(t)}),i.push(t),Object.assign(Object.assign({},e),{[r]:i})})),(0,R.sample)({source:Ae,clock:F,fn:(e,t)=>{const r={};for(const t in e)ht.call(e,t)&&(r[t]=e[t].map((e=>{var t;return Object.assign(Object.assign({},e),{slides_html:e.need_placeholders&&Array.isArray(e.slides_html)?e.slides_html.map((e=>ct(e))):null!==(t=e.slides_html)&&void 0!==t?t:[]})})));return r},target:Ae});const yt=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();var wt,bt,St=__webpack_require__(2438),Ct=__webpack_require__.n(St);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(wt||(wt={})),function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader"}(bt||(bt={}));class Ot extends n.EventEmitter{destroy(){}}let kt;kt=function(){};class Lt{constructor(){this.__lastUpdated=null,this._receiveTime=0,this._serverTimestamp=0,this.rawData={},this.myDictionary={}}get receiveTime(){return this._receiveTime}singleModelWrapper(){return""}attributes(){return["__lastUpdated"]}static prepareFromResponse(){}setAttributes(e){const t=this.attributes();let r=this;for(let i in e){let s=e[i];-1!==t.indexOf(i)&&(r[i]=s)}}static createInstance(e,t){const r=new e;let i=t;return""!==r.singleModelWrapper()&&void 0!==t[r.singleModelWrapper()]&&(i=t[r.singleModelWrapper()]),r.rawData=t,r.setAttributes(i),r._receiveTime=(new Date).getTime(),void 0!==t.server_timestamp&&(r._serverTimestamp=t.server_timestamp),r}static _fetch(e,t,r,i="get"){return new Promise(((e,t)=>{e({})}))}static _fetchList(e,t,r){return Promise.resolve({})}static emitEvent({type:e,event:t,eventData:r}){return Promise.resolve()}static update(e,t,r="post"){return Promise.resolve()}}class Mt extends Lt{attributes(){return["width","height","type","url"]}constructor(){super(),this._url=""}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 At=__webpack_require__(3981);class xt{constructor(){this.images=[],this.color="",this.gradient=!1}static createFromArray(e){const t=new xt;for(let r in e)e.hasOwnProperty(r)&&t.images.push(Mt.createInstance(Mt,e[r]));return t}findOneByType(e){var t;return null!==(t=this.images.find((t=>t.type===e)))&&void 0!==t?t:null}findOneByCoverQuality(e){return this.findOneByType(this.mapCoverQualityToImageType(e))}findOneByWidth(e,t=!1){let r=null;return this.images.forEach((t=>{t.width===e&&(r=t)})),null!==r||t&&void 0!==(r=At(this.images))?r:null}mapCoverQualityToImageType(e){switch(e){case h.Medium:return"m";case h.High:return"h"}}}var Et=__webpack_require__(4871),It=__webpack_require__.n(Et);class Rt extends Lt{constructor(){super(...arguments),this._title="",this.title_color="",this.magazine_name="",this.is_opened=!1,this._slides_html=[],this.slides_duration=[],this.slides_screenshot_share=[],this.source="",this.favorite=!1,this.like=0,this.slides_count=null,this.deeplink=null,this.hide_in_reader=null,this.blank=!1,this.disable_close=!1,this.need_placeholders=null,this._placeholders={},this.favorite_cell=!1,this.ugc_card_cell=!1,this.slidesLoaded=!1,this._imageSrc=null,this._parsedIssueArticleIds=null,this._parsedArticleIds=null,this._parsedSlideImage=null,this._video_cover=null,this._videoCoverSrc=null}static fetch(e,t){return this.placeholders=t,this._fetch(Rt,`story/${e}`,{expand:"slides_html,slides_duration"})}static fetchList(e,t,r){this.placeholders=e;const i={tags:t};return void 0!==r&&(i.favorite=Number(r)),this._fetchList(Rt,"story",i)}static fetchWithSlides(e,t){return this.placeholders=t,Promise.all(e.map((e=>this.fetch(e,t))))}static fetchOnboardingList(e,t){return this.placeholders=e,this._fetchList(Rt,"story-onboarding",{tags:t})}static fetchOnboardingListWithSlides(e,t){return this.placeholders=t,Promise.all(e.map((e=>this.fetch(e,t))))}attributes(){return It()(super.attributes(),["title","title_color","source","magazine_name","background","background_color","id","image","display_to","display_from","slides_html","slides_duration","slides_screenshot_share","favorite","like","slides_count","deeplink","hide_in_reader","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","slidesLoaded"])}set image(e){this._image=xt.createFromArray(e)}get image(){return this._image}get issueArticleIds(){return this.parseHtmlSlidesForLinks(),null!==this._parsedIssueArticleIds?this._parsedIssueArticleIds:[]}get articleIds(){return this.parseHtmlSlidesForLinks(),null!==this._parsedArticleIds?this._parsedArticleIds:[]}imagePerSlide(e){return this.parseHtmlSlidesForMainImage(),null!==this._parsedSlideImage&&void 0!==this._parsedSlideImage[e]?this._parsedSlideImage[e]:null}parseHtmlSlidesForLinks(){null===this._parsedArticleIds&&null===this._parsedIssueArticleIds&&this.slides_html.forEach((e=>{const t=e.match(/<[^<]*narrative-element-link.*data-link-type="([a-z-]*)".*data-link-target="(\d+)"[^<]*>/i);if(null!==t){const e=t[1],r=parseInt(t[2]);"article"===e?(null===this._parsedArticleIds&&(this._parsedArticleIds=[]),-1===this._parsedArticleIds.indexOf(r)&&this._parsedArticleIds.push(r)):"issue-article"===e&&(null===this._parsedIssueArticleIds&&(this._parsedIssueArticleIds=[]),-1===this._parsedIssueArticleIds.indexOf(r)&&this._parsedIssueArticleIds.push(r))}}))}parseHtmlSlidesForMainImage(){null===this._parsedSlideImage&&this.slides_html.forEach(((e,t)=>{const r=e.match(/<[^<]*narrative-element-image.*<img[^<]*src="([^"]*)"[^<]*>/i);null!==r&&(null===this._parsedSlideImage&&(this._parsedSlideImage=[]),this._parsedSlideImage[t]=r[1])}))}set video_cover(e){null!==e&&(this._video_cover=xt.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 Rt.placeholders)Rt.placeholders.hasOwnProperty(t)&&(e=tt(e,`%${t}%`,Rt.placeholders[t]));this.rawData.title=e,this._title=e}get slides_html(){return this._slides_html}set slides_html(e){if(!0===this.need_placeholders||!0===this.rawData.need_placeholders)for(let t in Rt.placeholders)if(Rt.placeholders.hasOwnProperty(t))for(let r=0;r<e.length;r++)e[r]=tt(e[r],`%${t}%`,Rt.placeholders[t]);const t=null!==__webpack_require__.nc&&void 0!==__webpack_require__.nc?__webpack_require__.nc:"";for(let r=0;r<e.length;r++)e[r]=tt(e[r],"{{nonce}}",null!=t?t:"");this._slides_html=e}get isOpened(){return this.is_opened}set isOpened(e){this.is_opened=e,this.rawData.is_opened=e}}Rt.placeholders={};const Tt=Rt;class Pt{static create(e){const t=Lt.createInstance(Tt,{id:0,title:e.favoriteCard.title.content,title_color:e.favoriteCard.title.color,is_opened:!0,background_color:"white"});return t.favorite_cell=!0,t}}const Dt=/[\r\n%#()<>?[\\\]^`{|}]/g;function jt(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(Dt,encodeURIComponent)}class Ft{static create(e){let t=[];e.ugcCard.image&&e.ugcCard.image.svgSrc&&e.ugcCard.image.svgSrc.baseState&&t.push({width:100,height:100,type:"h",url:`data:image/svg+xml,${jt(e.ugcCard.image.svgSrc.baseState)}`});const r=Lt.createInstance(Tt,{id:-100,title:e.ugcCard.title.content,title_color:e.ugcCard.title.color,is_opened:!1,background_color:e.ugcCard.backgroundColor,image:t});return r.ugc_card_cell=!0,r}}class Nt{constructor(e=0,t=0,r=0,i=0){this.x=e,this.y=t,this.width=r,this.height=i}overlaps(e){return this.x+this.width>=e.x&&this.x<=e.x+e.width&&this.y+this.height>=e.y&&this.y<=e.y+e.height}getIntersection(e){const t=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.x,e.x),i=Math.min(this.y+this.height,e.y+e.height),s=Math.max(this.y,e.y);return new Nt(Math.min(t,r),Math.min(i,s),Math.max(0,t-r),Math.max(0,i-s))}getArea(){return this.width*this.height}getAreaFraction(e){return+(this.getArea()/e.getArea()*100).toFixed(2)}static clone(e){return new Nt(e.x,e.y,e.width,e.height)}}class Ut extends n.EventEmitter{calculate(e){const t=e.map((({id:e,areaFraction:t})=>({storyId:e,visibleArea:Math.round(t)/100})));0!==t.length&&this.emit("visibleAreaUpdated",t)}}class Bt extends n.EventEmitter{constructor(){super(...arguments),this.storiesIds=new Set,this.getNewStoriesIds=e=>{const t=[];for(const r of e)this.storiesIds.has(r)||t.push(r);return t}}markStoryAsFullVisible(e){this.storiesIds.has(e)||(this.storiesIds.add(e),this.emit("flushThumbViews",[e]))}calculate(e){const t=this.getNewStoriesIds(e.map((({id:e})=>e)));t.forEach((e=>this.storiesIds.add(e))),0!==t.length&&this.emit("flushThumbViews",t)}}class Gt extends n.EventEmitter{constructor(){super(),this.storyRects=[],this.viewport=new Nt,this.feedImpressionMetric=new Bt,this.visibleAreaMetric=new Ut,this.filterStoryRectIntersections=e=>e.filter((e=>-100!==e.id&&0!==e.id&&e.areaFraction>0)),this.feedImpressionMetric.on("flushThumbViews",(e=>this.emit("flushThumbViews",e))),this.visibleAreaMetric.on("visibleAreaUpdated",(e=>this.emit("visibleAreaUpdated",e)))}calculate(e){const t=this.getScrollViewportByCalculationParams(e),r=this.getStoryRectIntersectionsWithViewport(t),i=this.filterStoryRectIntersections(r);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=Nt.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 r of this.storyRects)if(r.overlaps(e)){const i=r.getIntersection(e);t.push({id:r.id,areaFraction:i.getAreaFraction(r)})}else t.push({id:r.id,areaFraction:0});return t}}class Vt extends Nt{constructor(e,t=0,r=0,i=0,s=0){super(t,r,i,s),this.id=e}static clone(e){return new Vt(e.id,e.x,e.y,e.width,e.height)}}class zt{constructor(e,t){this.storyManager=e,this.params=t,this.handleFlushThumbViews=this.handleFlushThumbViews.bind(this),this.handleVisibleAreaUpdated=this.handleVisibleAreaUpdated.bind(this)}create(){const e=new Gt;return e.on("flushThumbViews",this.handleFlushThumbViews),e.on("visibleAreaUpdated",this.handleVisibleAreaUpdated),e}handleFlushThumbViews(e){const t=I.Tl.getState();this.params.listType!==Le.DEFAULT||t.disableStatistic||ge(e);const r=this.params.identityFields.feedSlug,i=this.params.identityFields.filter,s=Jr(r),o={stories:e.map((e=>{const t={title:null,tags:[],slidesCount:null},r=xe.getState().find((t=>t.id===e));return r&&(t.title=r.stat_title,t.tags=r.tags,t.slidesCount=r.slides_count,r.type===Le.UGC&&(t.ugcPayload=j()(r.payload)?r.payload:{})),Object.assign({id:e},t)})),feed:null,filter:null};s===Le.DEFAULT?o.feed=r:s===Le.UGC&&(o.filter=i),this.storyManager.emit("feedImpression",o)}handleVisibleAreaUpdated(e){const t=this.params.identityFields.feedSlug,r=this.params.identityFields.filter,i=Jr(t),s={stories:e.map((({storyId:e,visibleArea:t})=>{const r={title:null,tags:[],slidesCount:null,visibleArea:t},i=xe.getState().find((t=>t.id===e));return i&&(r.title=i.stat_title,r.tags=i.tags,r.slidesCount=i.slides_count,i.type===Le.UGC&&(r.ugcPayload=j()(i.payload)?i.payload:{})),Object.assign({id:e},r)})),feed:null,filter:null};i===Le.DEFAULT?s.feed=t:i===Le.UGC&&(s.filter=r),this.storyManager.emit("visibleAreaUpdated",s)}}const Wt=(e,t)=>{let r=[];switch(e){case M.default:r=t?Te.getState()[t]:[];break;case M.favorite:r=De.getState();break;case M.onboarding:r=t?Pe.getState()[t]:[]}return null!=r?r:[]};var qt=__webpack_require__(2535);const $t=__webpack_require__(4871);var Zt;!function(e){e.FONT="font-face"}(Zt||(Zt={}));class Ht extends Lt{attributes(){return $t(super.attributes(),["weight","style","type","url","title","family","format"])}constructor(){super(),this._url=""}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://")}get isFont(){return this.type===Zt.FONT}get fontFaceAsCss(){var e,t,r;if(!this.isFont)return null;let i={"font-family":null!==(e=this.family)&&void 0!==e?e:"normal",src:`url('${this.url}')`,"font-style":null!==(t=this.style)&&void 0!==t?t:"normal","font-weight":null!==(r=this.weight)&&void 0!==r?r:"normal"};return this.title&&(i.src+=`, local('${this.title}')`),`@font-face {${(0,qt.ky)(i)}}\n`}}__webpack_require__(3981);class Kt{constructor(){this.resources=[]}static createFromArray(e){const t=new Kt;for(let r in e)e.hasOwnProperty(r)&&t.resources.push(Ht.createInstance(Ht,e[r]));return t}get fontsCss(){let e="";return this.resources.forEach((t=>{if(t.isFont){let r=t.fontFaceAsCss;null!==r&&(e+=r)}})),e||null}}class Qt extends Lt{constructor(){super(),this.id=null,this.expire_in=null,this.closed=!1,this.is_allow_profiling=!1,this.preview_aspect_ratio=1,this._placeholders={}}singleModelWrapper(){return""}attributes(){return It()(super.attributes(),["server_timestamp","session","cache","share","user_key","placeholders","is_allow_profiling","preview_aspect_ratio"])}static fetch(e){return this._fetch(Qt,"session/open?expand=cache",e,"post")}static updateSession(e){return this.update("session/update",e)}set session(e){this.id=e.id,this.expire_in=e.expire_in,void 0!==e.closed&&(this.closed=e.closed)}set cache(e){this._projectResourceCache=Kt.createFromArray(e)}get cache(){return this._projectResourceCache}set placeholders(e){P()(e)&&e.forEach((e=>{j()(e)&&void 0!==e.name&&void 0!==e.default_value&&(this._placeholders[e.name]=e.default_value)}))}get placeholders(){return this._placeholders}}var Yt=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class Xt{constructor(e){this.storyManager=e}loadStories({listType:e,identityFields:t,testKey:r,needFavorite:i=!0}){return Yt(this,void 0,void 0,(function*(){const s=e===Le.DEFAULT&&i;yield lt({defaultList:t,onboardingList:!1,favoriteList:s,testKey:r});const o=Wt(M.default,t.feedSlug),n=t.feedSlug===Xr?Le.UGC:Le.DEFAULT;const a={stories:o.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===Le.UGC&&(t.ugcPayload=j()(e.payload)?e.payload:{})),Object.assign({id:e.id},t)})),feed:null,filter:null};n===Le.DEFAULT?a.feed=t.feedSlug:n===Le.UGC&&(a.filter=t.filter),this.storyManager.emit("feedLoad",a);return{defaultStories:Wt(M.default,t.feedSlug),favoriteStories:Wt(M.favorite,t.feedSlug)}}))}observeDefaultStories(e){return Te.map((t=>{var r;return(null!==(r=t[e])&&void 0!==r?r:[]).map((e=>this.createStoryByData(Object.assign(Object.assign({},e),{slides_html:[]}))))}))}observeFavoriteStories(){return De.map((e=>e.map((e=>this.createStoryByData(Object.assign(Object.assign({},e),{slides_html:[]}))))))}observeSession(){return ue.map((e=>Lt.createInstance(Qt,e)))}createStoryByData(e){return e instanceof Tt?e:Lt.createInstance(Tt,e)}}const Jt=(e,t,r,i)=>!(!e||t||r)&&(console.error(`Cannot open hidden story id ${i}`),!0),er=(e,t,r)=>{var i;e.isDeeplink?tr(e,t,r):(null===(i=t.gameInstance)||void 0===i?void 0:i.id)?rr(e,t,r):ir(e,t,r)},tr=(e,t,r)=>{e.isDeeplink=!0,r.eventPublisher.emit("clickOnStoryDeepLink",e)},rr=(e,t,r)=>{var i;r.eventPublisher.emit("clickOnStoryGame",{id:t.id,gameInstanceId:null===(i=t.gameInstance)||void 0===i?void 0:i.id})},ir=(e,t,r)=>{const i={index:e.index,isDeeplink:!1,id:e.id,listType:M.default,windowReferer:L.default};t.isFavoriteCard?r.eventPublisher.emit("clickOnFavoriteCellInternal",i):t.isUgcCard?r.eventPublisher.emit("clickOnUgcCardCellInternal",i):r.eventPublisher.emit("clickOnStoryInternal",i),r.eventPublisher.emit("clickOnStory",e)};var sr,or,nr,ar,lr,dr;!function(e){e.LEFT="left",e.RIGHT="right"}(sr||(sr={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(or||(or={})),function(e){e.LEFT="left",e.RIGHT="right"}(nr||(nr={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(ar||(ar={})),function(e){e.vk="vk",e.ok="ok",e.facebook="facebook",e.twitter="twitter",e.linkedin="linkedin",e.telegram="telegram"}(lr||(lr={})),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"}(dr||(dr={}));class cr extends Ot{constructor(e,t){super(),this.storyListViewModel=e,this.story=t,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}get options(){return this.storyListViewModel.options.card}get isTitleCardInner(){return this.options.title.position===u.CARD_INSIDE_BOTTOM}get isTitleCardOutsideTop(){return this.options.title.position===u.CARD_OUTSIDE_TOP}get isTitleCardOutsideBottom(){return this.options.title.position===u.CARD_OUTSIDE_BOTTOM}get aspectRatio(){var e,t;const{aspectRatio:r,variant:i}=this.options;if(r)return r;switch(i){case dr.STYLE_CIRCLE:case dr.STYLE_QUAD:return 1;case dr.STYLE_RECTANGLE:return null!==(t=null===(e=this.storyListViewModel.session)||void 0===e?void 0:e.preview_aspect_ratio)&&void 0!==t?t:.8;default:return 1}}getImageSrc(){var e,t;return null===(t=null===(e=this.story.image)||void 0===e?void 0:e.findOneByCoverQuality(this.options.coverQuality))||void 0===t?void 0:t.url}onClick(e){this.storyListViewModel.onStoryClick(this,e)}}class ur extends cr{constructor(e,t){super(e,t)}getImageSrc(){var e,t;return null===(t=null===(e=this.story.image)||void 0===e?void 0:e.findOneByCoverQuality(this.storyListViewModel.options.favoriteCard.coverQuality))||void 0===t?void 0:t.url}}class hr extends cr{constructor(e,t,r){super(e,t),this.favoriteStories=r}}var pr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class fr extends Ot{set modeDesktop(e){this._modeDesktop!==e&&(this._modeDesktop=e,this.emit("update"))}get modeDesktop(){return this._modeDesktop}get session(){return this._session}get defaultStories(){return this._defaultStories.slice()}get favoriteStories(){return this._favoriteStories.slice()}get ugcCard(){return this._ugcCard}get favoriteCard(){return this._favoriteCard}constructor(e,t,r){super(),this.appearanceManager=e,this.storiesService=t,this.params=r,this._defaultStories=[],this._favoriteStories=[],this._session=null,this._modeDesktop=!0,this.storyReader=null,this.subscriptions=[],this.setDefaultStories=this.setDefaultStories.bind(this),this.setFavoriteStories=this.setFavoriteStories.bind(this),this.hanldeShowStory=this.hanldeShowStory.bind(this),this.handleCloseStory=this.handleCloseStory.bind(this),this.subscribeToStoriesService(),this.emit("create")}get options(){return this.appearanceManager.storiesListOptions}get hasFavoriteCard(){return Boolean(this.appearanceManager.commonOptions.hasFavorite)&&this._favoriteStories.length>0}get hasUgcCard(){return this.params.useUgcCard}get hasFavoriteStories(){return this.appearanceManager.commonOptions.hasFavorite&&this.params.listType===Le.DEFAULT}onStoryClick(e,t=0){((e,t)=>{const{deeplink:r,hideInReader:i,gameInstance:s}=e,o=z()(r)&&r.trim().length>0,n=null==s?void 0:s.id;if(Jt(Boolean(i),o,n,e.id))return;const a={id:e.id,index:t.index,isDeeplink:o,url:o?r:void 0};er(a,e,t)})(e,{eventPublisher:this,index:t})}destroy(){var e,t;this.emit("destroy"),this.subscriptions.forEach((e=>e.unsubscribe())),this.removeAllListeners(),null===(e=this.storyReader)||void 0===e||e.off("showStory",this.hanldeShowStory),null===(t=this.storyReader)||void 0===t||t.off("closeStoryReader",this.handleCloseStory),this.subscriptions=[]}setStoryReader(e){this.storyReader=e,this.storyReader.on("showStory",this.hanldeShowStory),this.storyReader.on("closeStoryReader",this.handleCloseStory)}reload(){return pr(this,void 0,void 0,(function*(){return this.loadStories({needFavorite:!1})}))}loadStories(e){var t;return pr(this,void 0,void 0,(function*(){const r=Boolean(this.appearanceManager.commonOptions.hasFavorite)&&e.needFavorite,i={feed:this.params.identityFields.feedSlug,filter:{},defaultListLength:0,favoriteListLength:0,success:!0,error:{name:"",networkStatus:200,networkMessage:""}};try{this.emit("startLoading");const{defaultStories:e,favoriteStories:t}=yield this.storiesService.loadStories(Object.assign(Object.assign({},this.params),{needFavorite:r}));i.success=!0,i.error=null,i.defaultListLength=e.length,this.appearanceManager.commonOptions.hasFavorite&&this.params.listType===Le.DEFAULT&&(i.favoriteListLength=t.length)}catch(e){console.error(e),i.success=!1,i.error={name:e.name,networkMessage:e.networkMessage,networkStatus:e.networkStatus}}finally{i.filter=null!==(t=this.params.identityFields.filter)&&void 0!==t?t:{},this.emit("endLoading",i)}}))}hanldeShowStory(e){this.emit("openStory",e.id)}handleCloseStory(e){this.emit("closeStory",e.id)}subscribeToStoriesService(){const e=this.storiesService.observeDefaultStories(this.params.identityFields.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((e=>{this._session=e,this.emit("update")}));this.subscriptions.push(e,t)}setUgcAndFavoriteStoryCards(){if(this._ugcCard=void 0,this._favoriteCard=void 0,this.hasUgcCard){const e=Ft.create(this.options);this._ugcCard=new cr(this,e)}if(this.hasFavoriteCard){const e=Pt.create(this.options);this._favoriteCard=new hr(this,e,this.favoriteStories)}}setDefaultStories(e){this._defaultStories=e.map((e=>new cr(this,e))),this.setUgcAndFavoriteStoryCards(),this.emit("update")}setFavoriteStories(e){this._favoriteStories=e.map((e=>new ur(this,e))),this.setUgcAndFavoriteStoryCards(),this.emit("update")}}class gr{constructor(e,t,r){this.appearanceManager=e,this.storiesService=t,this.params=r}create(){return new fr(this.appearanceManager,this.storiesService,this.params)}}var vr,mr=__webpack_require__(5304);class _r extends n.EventEmitter{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,...r]=e.data;try{if(!Array.isArray(e.data))throw new Error(`Invalid MessageEvent data format ${e.data}`);this.emit(t,...r)}catch(e){console.error(e)}}sendMessage(e,t){var r;null===(r=this.iframe.contentWindow)||void 0===r||r.postMessage([e,t],this.origin)}destroy(){window.removeEventListener("message",this.messageListener,!1),this.removeAllListeners()}}!function(e){e.StartGame="startGame",e.GameComplete="gameComplete",e.GameInstanceEvent="gameInstanceEvent",e.OpenUrl="openUrl",e.SendApiRequest="sendApiRequest",e.StorySetLocalData="storySetLocalData",e.GameInstanceSetLocalData="gameInstanceSetLocalData",e.OpenSharePanel="openSharePanel"}(vr||(vr={}));var yr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const wr=(0,R.createEffect)((({gameInstanceId:e,gameOptions:t})=>yr(void 0,void 0,void 0,(function*(){var r,i;(null===(i=null===(r=ue.getState())||void 0===r?void 0:r.session)||void 0===i?void 0:i.id)||(yield he({}));const s={};t&&j()(t)&&null!=t.demoMode&&(s.demoMode=Boolean(t.demoMode));const o=yield ce.post(`game/${e}/launch?expand=config`,s);if(!o.ok)throw new Error(JSON.stringify(o.data));return o.data.clientConfig=br(),o.data})))),br=()=>{let e=ue.getState();const t=I.Tl.getState();return{sessionId:e.session.id,userKey:e.user_key,apiKey:t.apiKey,sdkVersion:"0.2.2",apiBaseUrl:H.C.apiUrl,userAgent:ae,appPackageId:t.appPackageId,deviceId:I.Ue.getState(),userId:t.userId?t.userId:"",lang:t.lang,placeholders:ai.combinedPlaceholders}},Sr=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 Cr;function Or(){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:Cr.LANDSCAPE_PRIMARY,"-90":Cr.LANDSCAPE_SECONDARY,0:Cr.PORTRAIT_PRIMARY,180:Cr.PORTRAIT_SECONDARY};function t(){}const r=new t,i=function(e){const t=["orientationchange","mozorientationchange","msorientationchange"],r=window.screen;for(let e=0;e<t.length;e++)if(null===r["on"+t[e]])return{delegate:r,event:t[e]};if(void 0!==window.onorientationchange)return{delegate:window,event:"orientationchange"};return{delegate:Er(e),event:"change"}}(r);return t.prototype.addEventListener=kr("addEventListener",i.delegate,i.event),t.prototype.dispatchEvent=kr("dispatchEvent",i.delegate,i.event),t.prototype.removeEventListener=kr("removeEventListener",i.delegate,i.event),t.prototype.lock=function(){var e,t="lockOrientation() is not available on this device.",r=window.screen;e=void 0===r?function(){return!1}:"function"==typeof r.msLockOrientation?r.msLockOrientation.bind(r):"function"==typeof r.mozLockOrientation?r.mozLockOrientation.bind(r):function(){return!1};return function(r){const i=window.Promise;return e(r)?i.resolve(r):i.reject(new Error(t))}}(),t.prototype.unlock=function(){var e=window.screen;return e&&e.orientation&&e.orientation.unlock.bind(e.orientation)||e.msUnlockOrientation&&e.msUnlockOrientation.bind(e)||e.mozUnlockOrientation&&e.mozUnlockOrientation.bind(e)||function(){}}(),Object.defineProperties(r,{onchange:{get:function(){return i.delegate["on"+i.event]||null},set:function(e){i.delegate["on"+i.event]=Ar(e,r)}},type:{get:function(){var t=window.screen;return t.msOrientation||t.mozOrientation||e[window.orientation+""]||(Ir().matches?"landscape-primary":"portrait-primary")}},angle:{value:0}}),r}(),e}}function kr(e,t,r){var i=this;return function(){var s=Array.prototype.slice.call(arguments);if("change"===(s[0].type?s[0].type:s[0])){s[0].type?s[0]=xr(r,s[0]):s[0]=r;var o,n,a=Ar(s[1],i);return"addEventListener"===e&&function(e,t){var r=Mr.indexOf(e);r>-1?Lr[r]=t:(Mr.push(e),Lr.push(t))}(s[1],a),"removeEventListener"===e&&(o=s[1],(n=Mr.indexOf(o))>-1&&(Mr.splice(n,1),Lr.splice(n,1))),s[1]=a,t[e].apply(t,s)}}}!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(Cr||(Cr={}));var Lr=[],Mr=[];function Ar(e,t){var r=Mr.indexOf(e);return r>-1?Lr[r]:function(r){r.target!==t&&Rr(r,"target",t),r.currentTarget!==t&&Rr(r,"currentTarget",t),"change"!==r.type&&Rr(r,"type","change"),e(r)}}function xr(e,t){var r;try{r=new Event(e,t)}catch(e){r={type:"change"}}return r}function Er(e){var t=Object.create({addEventListener:function(e,t){this.listeners[e]||(this.listeners[e]=[]),-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)},dispatchEvent:function(t){this.listeners[t.type]&&(this.listeners[t.type].forEach((function(e){e(t)})),"function"==typeof e.onchange&&e.onchange(t))},removeEventListener:function(e,t){if(this.listeners[e]){var r=this.listeners[e].indexOf(t);r>-1&&this.listeners[e].splice(r,1)}}});t.listeners={};var r=Ir();return r&&"boolean"==typeof r.matches&&r.addListener((function(){t.dispatchEvent(xr("change"))})),t}function Ir(){return"function"!=typeof window.matchMedia?{}:window.matchMedia("(orientation: landscape)")}function Rr(e,t,r){Object.defineProperty(e,t,{value:r})}var Tr;!function(e){e[e.IOS=0]="IOS",e[e.ANDROID=1]="ANDROID",e[e.OTHER=2]="OTHER"}(Tr||(Tr={}));class Pr{constructor(e,t,r){this.userKey=e,this.gameInstanceId=t,this.instanceUserData=r}set(e){const t=b()(this.get(),e);return window.localStorage.setItem(this.key,JSON.stringify(t)),t}get(){var e;let t={};const r=j()(this.instanceUserData)?this.instanceUserData:{};try{const r=JSON.parse(null!==(e=window.localStorage.getItem(this.key))&&void 0!==e?e:"{}");j()(r)&&(t=r)}catch(e){console.error(e)}return b()(t,r)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class Dr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const{id:t,callback:r}=JSON.parse(e),i=this.gameReaderViewModel.gameLaunch;if(!i)return;const s=new Pr(i.clientConfig.userKey,i.config.gameInstanceId,i.instanceUserData).get();this.gameCenterMessageService.sendMessage("cb",{cb:r,arguments:JSON.stringify([t,JSON.stringify(s)])})}}class jr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const{gameInstanceId:t,data:r}=JSON.parse(e),i=this.gameReaderViewModel.gameLaunch;if(!i)return;const s=new Pr(i.clientConfig.userKey,i.config.gameInstanceId,i.instanceUserData).set(r);this.gameReaderViewModel.emit(vr.GameInstanceSetLocalData,{data:JSON.stringify(s)})}}var Fr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};var Nr,Ur=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(Nr||(Nr={}));class Br{constructor(e,t,r){this.gameCenterMessageService=e,this.gameReaderViewModel=t,this.desktopMode=r}handle(e,t){var r,i,s;return Ur(this,void 0,void 0,(function*(){let o=null!==(r=null==t?void 0:t.url)&&void 0!==r?r:t.text,n=[];t.files&&Array.isArray(t.files)&&t.files.length>0&&(n=yield Promise.all(t.files.map((e=>(({file:e,name:t,type:r})=>Fr(void 0,void 0,void 0,(function*(){const i=yield fetch(`data:${r};base64,${e}`),s=yield i.blob();return new File([s],t,{type:r,lastModified:(new Date).getTime()})})))(e)))));const a={url:null!=o?o:void 0,files:n.length>0?n:void 0,text:null!==(i=t.text)&&void 0!==i?i:void 0,title:null!==(s=t.title)&&void 0!==s?s:void 0};if(!(a.files&&a.files.length>0||a.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(a).then((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!0}))).catch((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!1})))}catch(t){console.error(t),this.openSharePanel({shareConfig:a,sharePath:o,shareId:e})}else this.openSharePanel({shareConfig:a,sharePath:o,shareId:e})}))}openSharePanel({shareConfig:e,sharePath:t,shareId:r}){let i=Nr.Social,s=t;e.files&&e.files.length>0&&(i=Nr.SlideScreenshot,s=URL.createObjectURL(e.files[0])),this.gameReaderViewModel.emit(vr.OpenSharePanel,{shareId:r,shareType:i,shareLink:s})}}class Gr{constructor(e){this.storyId=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 Vr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const t=JSON.parse(e);if(!j()(t))return;const{id:r,storyId:i,callback:s}=t;let o=new Gr(i).get();this.gameCenterMessageService.sendMessage("cb",{cb:s,arguments:JSON.stringify([r,JSON.stringify(o)])})}}class zr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const t=JSON.parse(e);if(!j()(t))return;const{storyId:r,data:i,sendToServer:s}=t;new Gr(r).set(i),s&&this.gameReaderViewModel.emit(vr.StorySetLocalData,{storyId:r,data:JSON.stringify(i)})}}var Wr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class qr extends n.EventEmitter{constructor(e){super(),this.appearanceManager=e,this._isOpened=!1,this._isGameInited=!1,this._isGameLoading=!1,this._gameLaunch=null,this._gameLaunchError=null,this._closeBtnVisible=!1,this.initGameRetryAttempts=0,this.gameCenterMessageService=null,this.safeAreaInsets={top:0,bottom:0,left:0,right:0},this.openGameOptions={},this.desktopMode=!0,this._options=e.gameReaderOptions,this.setAppearanceManager(e),this.handleUpdateGameReaderOptions=this.handleUpdateGameReaderOptions.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.handleKeydown=this.handleKeydown.bind(this),window.addEventListener("keydown",this.handleKeydown)}destroy(){var e;this.appearanceManager.off(s.EVENT_UPDATED_GAME_READER_OPTIONS,this.handleUpdateGameReaderOptions),window.removeEventListener("keydown",this.handleKeydown),null===(e=this.gameCenterMessageService)||void 0===e||e.destroy(),document.removeEventListener("visibilitychange",this.handleVisibilityChange)}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 options(){return this._options}get sharePanelOptions(){return this.appearanceManager.storyReaderOptions.sharePanel}get backdrop(){var e;const t=this._options.backdrop;return{background:null==t?void 0:t.background,opacity:null!==(e=null==t?void 0:t.opacity)&&void 0!==e?e:0,filter:(null==t?void 0:t.blur)?`blur(${t.blur}px)`:"none"}}openGame(e){return Wr(this,void 0,void 0,(function*(){this._gameInstanceId=e,this._isOpened=!0,yield this.launchGameById(e)}))}closeGame(){var e;return Wr(this,void 0,void 0,(function*(){return this._isGameInited?null===(e=this.gameCenterMessageService)||void 0===e||e.sendMessage("cb",{cb:"closeGameReader"}):this.handleGameComplete(),!0}))}setOpenGameOptions(e){this.openGameOptions=e,this.gameInstanceId&&this.reload()}reload(){this._gameLaunch=null,this.gameInstanceId?this.launchGameById(this.gameInstanceId):console.error("The game instance ID is undefined")}sendGameCenterEventByApiRequest(e,t){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.sendMessage("cb",{cb:e,plainData:t})}setSafeAreaInsets(e){this.safeAreaInsets=e}setDesktopMode(e){this.desktopMode=e}setAppearanceManager(e){this.appearanceManager.off(s.EVENT_UPDATED_GAME_READER_OPTIONS,this.handleUpdateGameReaderOptions),this._options=e.gameReaderOptions,this.appearanceManager=e,this.handleAppearanceManagerEvents(),this.emit("update")}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 r=new URL(this._gameLaunch.url).origin;this.gameCenterMessageService=new _r(e,r),this.initGameCenter(this.gameCenterMessageService,this._gameLaunch)}pauseGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.sendMessage("cb",{cb:"pauseUI",arguments:JSON.stringify([])})}resumeGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.sendMessage("cb",{cb:"resumeUI",arguments:JSON.stringify([])})}confirmSharingComplete({shareId:e,isSuccess:t}){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.sendMessage("shareComplete",{id:e,isSuccess:t})}launchGameById(e){return Wr(this,void 0,void 0,(function*(){try{this._gameLaunchError=null,this._isGameLoading=!0,this.emit("update"),this._gameLaunch=yield wr({gameInstanceId:e,gameOptions:this.openGameOptions})}catch(e){this._gameLaunchError=e}finally{this.emit("update")}}))}initGameCenter(e,t){this.handleGameCenterEvents(e);const r=this.getGameConfig(t);e.sendMessage("cb",{cb:"initGame",arguments:JSON.stringify([r])})}getGameConfig(e){const t=e.screenOptions;let r;const i=document.querySelector("[nonce]");null!=i&&(r=i.nonce||i.getAttribute("nonce"));return b()(e.config,{clientConfig:Object.assign({fullScreen:!1,screenOrientation:t.orientation,safeAreaInsets:this.safeAreaInsets,nonce:r},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));const t={share:new Br(e,this,this.desktopMode),storySetLocalData:new zr(e,this),storyGetLocalData:new Vr(e,this),gameInstanceGetLocalData:new Dr(e,this),gameInstanceSetLocalData:new jr(e,this)};for(const[r,i]of Object.entries(t))e.on(r,((...e)=>i.handle(...e)))}handleGameLoaded(e){this._isGameInited=!0,this._isGameLoading=!1,this.emit(vr.StartGame),document.addEventListener("visibilitychange",this.handleVisibilityChange);const t=JSON.parse(e);j()(t)&&(this._closeBtnVisible=Boolean(t.showClose),this.emit("update"))}handleAppearanceManagerEvents(){this.appearanceManager.on(s.EVENT_UPDATED_GAME_READER_OPTIONS,this.handleUpdateGameReaderOptions)}handleUpdateGameReaderOptions(e){this._options=e,this.emit("update")}handleVisibilityChange(){"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}handleGameComplete(e){var t;this._isGameInited=!1,this._isOpened=!1,this._gameLaunch=null,null===(t=this.gameCenterMessageService)||void 0===t||t.destroy(),this.emit(vr.GameComplete,e),this.emit("update")}handleSendApiRequest(e){this.emit(vr.SendApiRequest,e)}handleOpenUrl(e){const{url:t}=JSON.parse(e);this.emit(vr.OpenUrl,{url:t})}handleGameEvent(e,t){this.emit(vr.GameInstanceEvent,{name:e,payload:t})}handleReloadGameReader(){const e=this._gameLaunch;this._gameLaunch=null,this.emit("update"),setTimeout((()=>{this._gameLaunch=e,this.emit("update")}))}handleGameLoadFailed(e,t){this.gameLaunch&&t&&this.initGameRetryAttempts<this.gameLaunch.canTryReloadCount?(this.initGameRetryAttempts++,this.handleReloadGameReader()):this._gameLaunchError=new Error(e)}handleKeydown(e){e.keyCode===Sr.esc&&this.closeGame()}}class $r extends Lt{static sentData(e,t,r){return new Promise((i=>{r("apiRequest",{url:"story-data/"+e,method:"put",params:null,data:t,headers:null}).then((e=>{i({data:e.data,status:200,headers:[{}]})})).catch((e=>{i({data:e,status:400,headers:[{}]})}))}))}static sendApiRequest({url:e,method:t,params:r,headers:i,data:s,profilingKey:o},n){return new Promise((o=>{n("apiRequest",{url:e,method:t,params:r,data:s,headers:i}).then((e=>{o({data:e.data,status:200,headers:[{}]})})).catch((e=>{o({data:e,status:400,headers:[{}]})}))}))}static sendApiRequestPromise(e,t,r){const{id:i,url:s,method:o,params:n,headers:a,data:l,cb:d}=JSON.parse(e);return r("apiRequest",{url:s,method:o,params:n,data:l,headers:a}).then((e=>{let r=JSON.stringify({requestId:i,data:JSON.stringify(e.data),status:e.status,headers:e.headers});t(d,r)}),(e=>{let r=JSON.stringify({requestId:i,data:JSON.stringify(e),status:400,headers:[{}]});t(d,r)}))}}var Zr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class Hr extends Lt{static save(e,t,r){return Zr(this,void 0,void 0,(function*(){try{return{data:(yield r("apiRequest",{url:`game/${e}/instance-user-data`,method:"post",params:null,data:t,headers:null})).data,status:200,headers:[{}]}}catch(e){return{data:e,status:400,headers:[{}]}}}))}}class Kr extends n.EventEmitter{destroy(){}}var Qr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},Yr=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Xr="{{__ugc__}}",Jr=e=>e===Xr?Le.UGC:Le.DEFAULT;(0,R.sample)({source:ue,clock:ue,filter:e=>{var t;return Boolean(null===(t=null==e?void 0:e.session)||void 0===t?void 0:t.id)},target:(0,R.createEffect)((e=>{const t=e.cache.filter((e=>"font-face"===e.type));(0,mr.eJ)(t)}))});class ei extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`)}}const ti=e=>{if(null==e||"object"!=typeof e)throw new ei(null==e?"null":typeof e)};const ri=Object.prototype.hasOwnProperty,ii=(e,t)=>{let r=[];switch(e){case M.default:r=t?Te.getState()[t]:[];break;case M.favorite:r=De.getState();break;case M.onboarding:r=t?Pe.getState()[t]:[]}return null!=r?r:[]},si=()=>ue.getState().cache.filter((e=>"font-face"===e.type)),oi=()=>{const e=F.getState(),t=st.getState(),r=[],i={};for(let t in e.default)ri.call(e.default,t)&&(i[t]={type:E.TEXT,name:t,value:e.default[t]});for(let t in e.user)ri.call(e.user,t)&&(i[t]={type:E.TEXT,name:t,value:e.user[t]});for(let e in i)ri.call(i,e)&&r.push(i[e]);const s={};for(let e in t.default)ri.call(t.default,e)&&(s[e]={type:E.IMAGE,name:e,value:t.default[e]});for(let e in t.user)ri.call(t.user,e)&&(s[e]={type:E.IMAGE,name:e,value:t.user[e]});for(let e in s)ri.call(s,e)&&r.push(s[e]);return r},ni=(e,t,r,i)=>Qr(void 0,void 0,void 0,(function*(){var r,s,o,n;const a=yield _t({id:e,feedSlug:"",fetchShareUrl:i}),l=(new Date).getTime(),d=null===(s=null===(r=a.find((e=>"story"===e.ref)))||void 0===r?void 0:r.body)||void 0===s?void 0:s.id,c=xe.getState().find((e=>e.id===d))||Me(d);c.slidesLoaded=!1;const u={windowReferer:L.default,listType:M.default,id:d,storyContext:Qe.getState(),storyList:[c],hasShare:ue.getState().share,placeholders:oi()};t.closeReader(),t.openReader(u,{listType:M.direct,feed:null});z()(e)&&P()(a)&&(e=null===(n=null===(o=a.find((e=>"story"===e.ref)))||void 0===o?void 0:o.body)||void 0===n?void 0:n.id,yield Ye({ids:[e],feedSlug:""}));const h=xe.getState().find((t=>t.id===e));if(void 0!==h){t.setFonts(si());const e=()=>{h.slidesLoaded=!0,t.setStoriesAndContext({listType:M.direct,storyList:[h],storyContext:Ke(Jr(""),Qe.getState())})},r=Math.max(0,300-((new Date).getTime()-l));return r?setTimeout(e,r):e(),!0}return t.closeReader(),!1}));class ai extends n.EventEmitter{constructor(e,t){if(super(),this.storyListViewModels=[],this.storyReaders=new Map,this._callbacks={},this.clickOnButtonAction=({src:e,payload:t})=>{if(G()(this._callbacks.storyLinkClickHandler)||this.listenerCount(x.CLICK_ON_STORY)>0){const r={src:e,srcRef:"default",data:t};try{G()(this._callbacks.storyLinkClickHandler)&&this._callbacks.storyLinkClickHandler(r),this.emit(x.CLICK_ON_STORY,r)}catch(e){console.error(e)}}else window.open(t.url,"_self")},this.SharePage=class extends n.EventEmitter{constructor(e,t,r,i="default"){return super(),this.options={},ti(t),r&&(this.options=r),ai.instance._showSharePage(e,t,this.options,this).then((({storyReaderInstance:e,appearanceManager:t,result:r})=>{this.storyReaderWidget=e,this.appearanceManager=t})),this}closeStoryReader(){return Qr(this,void 0,void 0,(function*(){this.storyReaderWidget&&(ai.instance.closeGoodsWidget(),this.storyReaderWidget.closeReader())}))}},this._showSharePage=(e,t,r,i)=>Qr(this,void 0,void 0,(function*(){setTimeout((()=>{i.emit(wt.START_LOADING),G()(r.handleStartLoad)&&r.handleStartLoad()}));const s=yield this.initStoryReader(t,si(),{closeOnLastSlideByTimer:!1,recycleStoriesList:!1,_disableSession:this._config.disableStatistic}),o=this._config.disableStatistic;let n=!1;try{s.on("closeStoryReader",(e=>{if(G()(r.handleStoryReaderClose)||i.listenerCount(wt.CLOSE_STORY_READER)>0)try{G()(r.handleStoryReaderClose)&&r.handleStoryReaderClose(),i.emit(wt.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location!=window.parent.location?window.parent.location:window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}})),n=yield ni(e,s,0,o)}catch(e){}return i.emit(wt.END_LOADING,{result:n}),G()(r.handleStopLoad)&&r.handleStopLoad(n),{storyReaderInstance:s,appearanceManager:t,result:n}})),this.onBeforeStoryReaderOpen=null,this.onBeforeFavoriteReaderOpen=null,this.onStoryReaderClosed=null,this.onFavoriteReaderClosed=null,ai.instance)console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead");else{if(!e.nonce){const t=document.querySelector("[nonce]");null!=t&&(e.nonce=t.nonce||t.getAttribute("nonce"))}(0,H.F)(e.apiKey),oe.getInstance().checkUserIdLength(e.userId),oe.getInstance().checkTagsLength(e.tags),(0,I.JG)(e),e.placeholders&&N(e.placeholders),e.imagePlaceholders&&ot(e.imagePlaceholders),t&&j()(t)&&(this._callbacks=t),fe(),ai.instance=this}return e.disableStatistic="com.inappstory.webpreview"===e.appPackageId,this._config=e,ai.instance}destroy(){null!=ai.instance&&(ai.instance=null,this.storyListViewModels.forEach((e=>e.destroy())),this.storyReaders.forEach((e=>Qr(this,void 0,void 0,(function*(){return(yield e).destroy()})))),this.storyListViewModels=[],this.storyReaders=new Map)}set storyLinkClickHandler(e){G()(e)&&(this._callbacks.storyLinkClickHandler=e)}set openGoodsWidgetHandler(e){G()(e)&&(this._callbacks.openGoodsWidgetHandler=e)}get openGoodsWidgetHandler(){return this._callbacks.openGoodsWidgetHandler}static getInstance(){return ai.instance?ai.instance:null}createStoryReaderViewModel(){return new Kr}createGameReaderViewModel(){return this.gameReaderViewModel||(this.gameReaderViewModel=new qr(new O),this.handleGameReaderViewModelEvents(this.gameReaderViewModel)),this.gameReaderViewModel}createStoryListViewModel(e){var{appearanceManager:t,identityFields:r,listType:i,isFavorite:s}=e,o=Yr(e,["appearanceManager","identityFields","listType","isFavorite"]);ti(t);const n=new Xt(this),a=new gr(t,n,Object.assign(Object.assign({},o),{identityFields:r,listType:i})).create();return this.handleStoryListViewModelEvents(a,{appearanceManager:t,listType:i,identityFields:r,isFavorite:s}),this.storyListViewModels.push(a),a}handleStoryListViewModelEvents(e,t){e.on("clickOnStoryInternal",(r=>Qr(this,void 0,void 0,(function*(){yield this.initStoryReaderByStoryListViewModel(e,t.appearanceManager),r.listType=t.isFavorite?M.favorite:M.default,r.windowReferer=t.isFavorite?L.favorite:L.default,this.handleClickOnStoryInternal(r,t.identityFields,t.appearanceManager)})))).on("clickOnStoryDeepLink",(e=>{this.handleSetStoryOpened(e.id),this.handleClickOnStoryDeepLink(e,{listType:t.listType})})).on("clickOnStoryGame",(({id:e,gameInstanceId:r})=>{this.handleSetStoryOpened(e),this.openGame(r,t.appearanceManager)})).on("clickOnStory",(e=>this.handleClickOnStory(e,t.identityFields))).on("destroy",(()=>{this.storyListViewModels.splice(this.storyListViewModels.indexOf(e),1)}))}initStoryReaderByStoryListViewModel(e,t){return Qr(this,void 0,void 0,(function*(){const r=yield this.initStoryReader(t,si());e.setStoryReader(r)}))}handleClickOnStoryDeepLink(e,{listType:t}){const r={data:[[1,0,e.id,0,0]]},i=()=>{e.isDeeplink&&e.url&&this.clickOnButtonAction({src:bt.STORY_LIST,payload:e})};t===Le.UGC||this._config.disableStatistic?i():de("session/update",r,J.createFunctionWithTimeout(i,1e3))}handleClickOnStory(e,t){if(0===e.id)this.emit("clickOnFavoriteCell",{feed:t.feedSlug});else{const r=t.feedSlug,i=t.filter,s=Jr(r),o={title:null,tags:[],slidesCount:null,feed:null,filter:null,source:null},n=xe.getState().find((t=>t.id===e.id));n&&(o.title=n.stat_title,o.tags=n.tags,o.slidesCount=n.slides_count),s===Le.DEFAULT?o.feed=r:s===Le.UGC&&(o.filter=i),o.source=k.list,this.emit("clickOnStory",Object.assign(Object.assign({},e),o))}}setTags(e){P()(e)&&(oe.getInstance().checkTagsLength(e),(0,I.ib)({tags:e}))}setUserId(e){return Qr(this,void 0,void 0,(function*(){(z()(e)||q()(e))&&(oe.getInstance().checkUserIdLength(e),(0,I.by)({userId:e}),fe(),yield this.closeAllReaders(),yield this.reloadAllStoryListInstances())}))}closeAllReaders(){var e;return Qr(this,void 0,void 0,(function*(){this.storyReaders.forEach((e=>Qr(this,void 0,void 0,(function*(){return(yield e).closeReader()})))),null===(e=this.gameReaderViewModel)||void 0===e||e.closeGame()}))}reloadAllStoryListInstances(){return Promise.all(this.storyListViewModels.map((e=>e.reload())))}setLang(e){z()(e)&&(0,I.rN)({lang:e})}setPlaceholders(e){j()(e)&&((0,I.Fn)({placeholders:e}),N(e))}setImagePlaceholders(e){j()(e)&&((0,I.qR)({imagePlaceholders:e}),ot(e))}handleClickOnStoryInternal(e,t,r){return Qr(this,void 0,void 0,(function*(){G()(this.onBeforeStoryReaderOpen)&&(yield this.onBeforeStoryReaderOpen());const i=(new Date).getTime(),s=ii(e.listType,t.feedSlug),o=Jr(t.feedSlug);let n=ue.getState().share;o===Le.UGC&&(n=!1);const a=Object.assign(Object.assign({},e),{storyContext:Ke(o,Qe.getState()||He(o,s.map((e=>e.id)))),storyList:s,hasShare:n,placeholders:oi()}),l=yield this.storyReaders.get(r);l.openReader(a,{listType:e.listType,identityFields:t});const d=Ke(o,Qe.getState());let c=null!==d&&""!==d.style;o===Le.DEFAULT&&d&&Ue.getState()[o].length>0&&d.ids!==Ue.getState()[o]&&(c=!1);const u=xe.getState().find((t=>t.id===e.id&&t.type===o));if(c||!u||u.slidesLoaded)c?u&&u.slidesLoaded||(yield gt({ids:[e.id],feedSlug:t.feedSlug})):Ue.getState()[o].length&&(yield Ye({ids:Ue.getState()[o],feedSlug:t.feedSlug}));else{let r=[];o===Le.DEFAULT&&(r=Ue.getState()[o]),yield mt({ids:r,id:e.id,feedSlug:t.feedSlug})}const h=Ue.getState()[o];h.length>0&&(yield gt({ids:h,feedSlug:t.feedSlug}));const p=()=>{l.setStoriesAndContext({listType:e.listType,storyList:ii(e.listType,t.feedSlug),storyContext:Ke(o,Qe.getState()||He(o,h))})},f=Math.max(0,300-((new Date).getTime()-i));f?setTimeout(p,f):p()}))}handleRedirectToStoryInternal(e,t){var r,i;return Qr(this,void 0,void 0,(function*(){const s=(new Date).getTime(),o="default",n=yield this.storyReaders.get(t),a=e.id,l=Me(a),d={windowReferer:L.default,listType:M.default,id:l.id,storyContext:Qe.getState(),storyList:[l],hasShare:ue.getState().share,placeholders:oi()};n.silentClose=!0,n.closeReader(),n.openReader(d,{listType:M.direct,feed:o}),setTimeout((()=>n.silentClose=!1),300);const c=yield _t({id:a,feedSlug:o});if(z()(a)&&P()(c)){const e=null===(i=null===(r=c.find((e=>"story"===e.ref)))||void 0===r?void 0:r.body)||void 0===i?void 0:i.id;yield Ye({ids:[e],feedSlug:o})}const u=xe.getState().find((e=>e.id===a));if(void 0!==u){const t=()=>{n.setStoriesAndContext({listType:e.listType,storyList:[u],storyContext:Ke(Jr(o),Qe.getState())})},r=Math.max(0,300-((new Date).getTime()-s));r?setTimeout(t,r):t()}return!0}))}handleSetStoryOpened(e){if(!it()(ue.getState().user_key)){const t=`u/${ue.getState().user_key}/s_opened`;let r=function(e){let t=null;if(yt){let r=window.localStorage.getItem(e);null!==r&&z()(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}(t);P()(r)||(r=[]),r.push(e),r=Ct()(r),function(e,t){yt&&window.localStorage.setItem(e,JSON.stringify(t))}(t,r)}Ve({id:e})}handleApiRequest(e){var t,r,i,s,o,n,a,l,d;return Qr(this,void 0,void 0,(function*(){let c=!1,u="",h={url:null!==(r=null===(t=e.data)||void 0===t?void 0:t.url)&&void 0!==r?r:"",method:null!==(s=null===(i=e.data)||void 0===i?void 0:i.method)&&void 0!==s?s:"get"};-1!==["post","put","path"].indexOf(null===(o=e.data)||void 0===o?void 0:o.method)?h.data=null!==(a=null===(n=e.data)||void 0===n?void 0:n.data)&&void 0!==a?a:void 0:h.params=null!==(d=null===(l=e.data)||void 0===l?void 0:l.params)&&void 0!==d?d:void 0;const p={requestId:e.id};try{const e=yield ce.request(h);p.data=e.data,p.status=e.status,p.headers=e.headers,c=!0}catch(e){p.data=e,p.status=400,p.headers=[{}],u=e.toString()}return{name:e.cb,payload:{requestId:e.id,success:c,data:p,err:u}}}))}initStoryReader(e,t,r={}){return Qr(this,void 0,void 0,(function*(){if(this.storyReaders.has(e))return this.storyReaders.get(e);const i=this._initStoryReader(e,t,r);return this.storyReaders.set(e,i),i}))}_initStoryReader(e,t,r={}){return Qr(this,void 0,void 0,(function*(){const i=ve.getState(),o=new Y("body",{storyWidgetsResources:i}),n=()=>{let e=I.Tl.getState().lang||"en";const t=new RegExp(/^[a-zA-Z]+(-[a-zA-Z]+)?$/),r=e.match(t);if(null!==r&&null==r[1]){const r=navigator.language.match(t);null!==r&&null!=r[1]&&(e+=r[1])}return e},a=({storyReaderOptions:e,gameReaderOptions:t,appearanceCommon:r,overrideStoryReaderOptions:i,faviconApiUrl:s})=>{const o=e;return o.gameReaderOptions=t,Object.assign(Object.assign(Object.assign(Object.assign({},o),{appearanceCommon:r}),i),{faviconApiUrl:s,language:n()})},l=e.storyReaderOptions,d=e.gameReaderOptions;yield o.init(a({storyReaderOptions:l,gameReaderOptions:d,appearanceCommon:e.commonOptions,overrideStoryReaderOptions:r,faviconApiUrl:H.C.faviconApiUrl})),o.setFonts(t),ve.getState().length>i.length&&(null==o||o.setStoryWidgetsResources(ve.getState())),ve.watch((e=>{null==o||o.setStoryWidgetsResources(e)})),o.setCallbacks({}),o.on("setStoryOpened",(e=>{this.handleSetStoryOpened(e.data.id),o.rpcCb(e.cb,{requestId:e.id,success:!0,data:e.data,err:""})})),o.on("updateStoryFavorite",(e=>Qr(this,void 0,void 0,(function*(){let t=!1;const r={favorite:void 0};let i="";try{const s=yield ce.post(`story-favorite/${e.data.id}`,{value:e.data.favorite});void 0!==s.data.favorite?(t=!0,r.favorite=Boolean(s.data.favorite),Be({id:e.data.id,favorite:r.favorite}),!1===r.favorite?pt({storiesIdsUserEntity:Ee.FAVORITE,storyList:De.getState().filter((t=>t.id!==e.data.id))}):pt({storiesIdsUserEntity:Ee.FAVORITE,storyList:[...De.getState(),...xe.getState().filter((t=>t.id===e.data.id))]})):i="response.data.favorite is undefined"}catch(e){i=e.toString()}o.rpcCb(e.cb,{requestId:e.id,success:t,data:r,err:i})})))),o.on("updateStoryLike",(e=>Qr(this,void 0,void 0,(function*(){let t=!1;const r={like:void 0};let i="";try{const s=yield ce.post(`story-like/${e.data.id}`,{value:e.data.like});void 0!==s.data.like?(t=!0,r.like=s.data.like,Ge({id:e.data.id,like:r.like})):i="response.data.like is undefined"}catch(e){i=e.toString()}o.rpcCb(e.cb,{requestId:e.id,success:t,data:r,err:i})})))),o.on("getStorySharePath",(e=>Qr(this,void 0,void 0,(function*(){let t=!1;const r={url:void 0};let i="";try{const s=yield ce.get(`story-share/${e.data.id}`,{});void 0!==s.data.url?(t=!0,r.url=s.data.url):i="response.data.url is undefined"}catch(e){i=e.toString()}o.rpcCb(e.cb,{requestId:e.id,success:t,data:r,err:i})})))),o.on("apiRequest",(e=>Qr(this,void 0,void 0,(function*(){const t=yield this.handleApiRequest(e);o.rpcCb(t.name,t.payload)})))),o.on("updateStoriesStat",(e=>Qr(this,void 0,void 0,(function*(){var t,r,i,s;const n=null!==(s=null===(i=null===(r=null===(t=o.options)||void 0===t?void 0:t.sourceInfo)||void 0===r?void 0:r.identityFields)||void 0===i?void 0:i.feedSlug)&&void 0!==s?s:"";let a=!1,l="";if(Jr(n)===Le.UGC||this._config.disableStatistic)a=!0;else try{de("session/update",e.data,(()=>{})),a=!0}catch(e){l=e.toString()}o.rpcCb(e.cb,{requestId:e.id,success:a,data:{},err:l})})))),o.on("clickOnButton",(e=>{const t=()=>this.clickOnButtonAction({src:bt.STORY_READER,payload:e});!this._config.disableStatistic&&e.dataForSending&&j()(e.dataForSending)&&Array.isArray(e.dataForSending.data)&&e.dataForSending.data.length>0?de("session/update",e.dataForSending,t):t()})),o.on("clickOnSwipeUpGoods",(e=>{})),o.on("closeStoryReader",(e=>{ai.instance.closeGoodsWidget()}));["showSlide","showStory","closeStory","clickOnButton","likeStory","dislikeStory","favoriteStory","shareStory","shareStoryWithPath"].forEach((e=>o.on(e,(t=>{var r,i,s,n,a;const l=null===(r=o.options.sourceInfo)||void 0===r?void 0:r.listType,d=null===(s=null===(i=o.options.sourceInfo)||void 0===i?void 0:i.identityFields)||void 0===s?void 0:s.feedSlug,c=null===(a=null===(n=o.options.sourceInfo)||void 0===n?void 0:n.identityFields)||void 0===a?void 0:a.filter,u=Jr(d),h={title:null,tags:[],slidesCount:null,feed:null,filter:null,source:null},p=xe.getState().find((e=>e.id===t.id));if(p&&(h.title=p.stat_title,h.tags=p.tags,h.slidesCount=p.slides_count,p.type===Le.UGC&&(h.ugcPayload=j()(p.payload)?p.payload:{})),u===Le.DEFAULT?h.feed=d:u===Le.UGC&&(h.filter=c),l===M.direct?h.source=k.direct:l===M.default?h.source=k.list:l===M.onboarding?h.source=k.onboarding:l===M.favorite&&(h.source=k.favorite),null!=t.index&&-1===["clickOnStory","showStory"].indexOf(e)&&(t.payload=null,p&&p.slides_payload&&Array.isArray(p.slides_payload))){const e=p.slides_payload.find((e=>e.slide_index===t.index));null!=e&&e.payload&&(t.payload=e.payload)}"clickOnButton"===e&&delete t.dataForSending,this.emit(e,Object.assign(Object.assign({},t),h))})))),o.on("redirectToStory",(t=>{this.handleRedirectToStoryInternal(t,e)})),o.on("openGameCenter",(({gameId:t})=>Qr(this,void 0,void 0,(function*(){var r;yield this.openGame(t,e),o.pauseAndBlockViewerUI({isInBackground:!0}),null===(r=this.gameReaderViewModel)||void 0===r||r.on("gameComplete",(()=>o.resumeAndEnableViewerUI()))})))),o.on("closeStoryReader",(e=>{G()(this.onStoryReaderClosed)&&this.onStoryReaderClosed()}));const c=({storyReaderOptions:e,gameReaderOptions:t,appearanceCommon:i})=>{o.setOptions(a({storyReaderOptions:e,gameReaderOptions:t,appearanceCommon:i,overrideStoryReaderOptions:r,faviconApiUrl:H.C.faviconApiUrl}))};return e.on(s.EVENT_UPDATED_STORY_READER_OPTIONS,c),e.on(s.EVENT_UPDATED_COMMON_OPTIONS,c),o.on("debugLog",(e=>{console.log("debugLog",e)})),o}))}showOnboardingStories(e,t){return Qr(this,void 0,void 0,(function*(){const r=si();let i="onboarding";t&&t.feed&&z()(t.feed)&&(i=t.feed),yield lt({defaultList:!1,onboardingList:i,favoriteList:!1,onboardingTags:t?t.customTags:void 0,limit:t?t.limit:void 0}),yield this.initStoryReader(e,r);const s=ii(M.onboarding,i);if(s.length>0){const t={windowReferer:L.default,listType:M.onboarding,id:s[0].id};return yield this.handleClickOnStoryInternal(t,{feedSlug:i},e),!0}return!1}))}showStory(e,t,r="default"){return Qr(this,void 0,void 0,(function*(){ti(t);const r=si(),i=yield this.initStoryReader(t,r);return yield ni(e,i)}))}openGame(e,t,r={}){return Qr(this,void 0,void 0,(function*(){try{if(!this.gameReaderViewModel)throw new Error("You must create <GameReader> component instance");if(this.gameReaderViewModel.isOpened)throw new Error(`Close the launched game with ID "${this.gameReaderViewModel.gameInstanceId}"`);this.gameReaderViewModel.setAppearanceManager(t),this.gameReaderViewModel.setOpenGameOptions(r),yield this.gameReaderViewModel.openGame(e)}catch(e){console.error(e)}}))}closeGame(){return Qr(this,void 0,void 0,(function*(){return!!this.gameReaderViewModel&&this.gameReaderViewModel.closeGame()}))}handleGameReaderViewModelEvents(e){this.handleApiResponse=this.handleApiResponse.bind(this),e.on(vr.StartGame,(()=>this.emit("startGame",{id:e.gameInstanceId}))).on(vr.GameInstanceEvent,(e=>this.emit("gameEvent",e))).on(vr.GameComplete,(t=>{it()(t)?this.emit("closeGame",{id:e.gameInstanceId}):this.emit("finishGame",{id:e.gameInstanceId,result:t})})).on(vr.OpenUrl,(({url:t})=>{this.clickOnButtonAction({src:bt.GAME_READER,payload:{url:t,gameInstanceId:e.gameInstanceId}})})).on(vr.SendApiRequest,(t=>Qr(this,void 0,void 0,(function*(){$r.sendApiRequestPromise(t,((t,r)=>e.sendGameCenterEventByApiRequest(t,r)),this.handleApiResponse)})))).on(vr.StorySetLocalData,(({storyId:e,data:t})=>Qr(this,void 0,void 0,(function*(){$r.sentData(e,t,this.handleApiResponse)})))).on(vr.GameInstanceSetLocalData,(({data:t})=>Qr(this,void 0,void 0,(function*(){Hr.save(e.gameInstanceId,t,this.handleApiResponse)}))))}handleApiResponse(e,t){return Qr(this,void 0,void 0,(function*(){const e=yield this.handleApiRequest(t);if(e.payload.success)return e.payload.data;throw e.payload.err}))}closeStoryReader(){return Qr(this,void 0,void 0,(function*(){this.storyReaders.forEach((e=>Qr(this,void 0,void 0,(function*(){return(yield e).closeReader()})))),this.closeGoodsWidget()}))}closeGoodsWidget(){}getUgcEditorConfig(){var e,t,r;return Qr(this,void 0,void 0,(function*(){let i=ue.getState();(null===(e=null==i?void 0:i.session)||void 0===e?void 0:e.id)||(yield he({})),(null==i?void 0:i.editor)||(yield $e({}));const s=I.Tl.getState(),o=ue.getState(),n="0.2.2";return{sessionId:o.session.id,apiKey:s.apiKey,editor:null!==(t=o.editor)&&void 0!==t?t:{},sdkVersion:n,appPackageId:s.appPackageId,deviceId:I.Ue.getState(),userId:null!=s.userId?String(s.userId):void 0,lang:null!==(r=s.lang)&&void 0!==r?r:"en"}}))}getNonce(){return this._config.nonce}get sdkVersionName(){return"0.2.2"}get sdkVersionCode(){return parseInt(202)}static get combinedPlaceholders(){return oi()}}var li=__webpack_require__(2784),di=__webpack_require__.n(li);const ci={addEventListeners(e,t,r){for(var i=0,s=t.length;i<s;i++)e.addEventListener(t[i],r,{passive:!1})},removeEventListeners(e,t,r){for(var i=0,s=t.length;i<s;i++)e.removeEventListener(t[i],r,{passive:!1})},emitEvent:function(e,t,r){if(e.componentInstance)e.componentInstance.$emit(t,r);else{let i;"function"==typeof window.CustomEvent?i=new window.CustomEvent(t,{detail:r}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,r)),e.elm.dispatchEvent(i)}},addOnceEventListener:function(e,t,r,i){var s=o=>{r(o),e.removeEventListener(t,s,i)};e.addEventListener(t,s,i)}},ui=ci,hi=ci.addOnceEventListener,pi=["mousedown","touchstart"],fi=["mousemove","touchmove"],gi=["mouseup","touchend"],vi=["scroll"];var mi;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(mi||(mi={}));class _i extends n.EventEmitter{get slides(){return Array.from(this.slider.children)}get elementRef(){return this.slider}get reachBeginning(){return this._reachBeginning}get reachEnd(){return this._reachEnd}get scrollWidth(){return this.slider.scrollWidth}constructor(){super(),this.isScrolling=!1,this.isDragging=!1,this.currentPosition={x:0,y:0},this.direction=mi.Horizontal,this.gap=20,this.rafId=0,this.lastClientX=0,this.lastClientY=0,this.pushed=!1,this.startClientX=0,this.startClientY=0,this._reachBeginning=!0,this._reachEnd=!1,this.desktopMode=!0,this.handleNativeScrollEnd=di()((function(){this.emit("scrollend",this.currentPosition),this.isScrolling=!1}),300,{leading:!1}),this.handleNativeScroll=this.handleNativeScroll.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}mount(e){this.slider=e,ui.addEventListeners(this.slider,pi,this.handleMouseDown),ui.addEventListeners(this.slider,vi,this.handleNativeScroll)}destroy(){this.removeAllListeners(),ui.removeEventListeners(this.slider,pi,this.handleMouseDown),ui.removeEventListeners(window,gi,this.handleMouseUp),ui.removeEventListeners(window,fi,this.handleMouseMove),ui.removeEventListeners(this.slider,vi,this.handleNativeScroll)}getLength(){var e,t;return null!==(t=null===(e=this.slider)||void 0===e?void 0:e.children.length)&&void 0!==t?t:0}getTranslate(){return this.direction===mi.Horizontal?this.currentPosition.x:this.currentPosition.y}getCurrentPosition(){return this.currentPosition}changeDirection(e){this.direction=e}setGap(e){this.gap=e}setDesktopMode(e){this.desktopMode=e}getGap(){return this.gap}scrollTo(e,t=300){const r=this.preparePosition(e,e);cancelAnimationFrame(this.rafId),t>0?this.scrollWithAnimation(r.x,r.y,t):(this.scrollToImmediately(r.x,r.y),this.emit("scrollend",this.currentPosition))}getSlidesPerView(){if(this.direction===mi.Horizontal&&this.slider.clientWidth){const e=this.slider.children[0].clientWidth+this.gap;return Math.round(this.slider.clientWidth/e)}if(this.direction===mi.Vertical&&this.slider.clientHeight){const e=this.slider.children[0].clientHeight+this.gap;return Math.round(this.slider.clientHeight/e)}return 1}handleMouseDown(e){if(!this.desktopMode)return;const t=e instanceof window.MouseEvent;this.pushed=!0,this.lastClientX=t?e.clientX:e.touches[0].clientX,this.lastClientY=t?e.clientY:e.touches[0].clientY,this.startClientX=this.lastClientX,this.startClientY=this.lastClientY,ui.addEventListeners(window,gi,this.handleMouseUp),ui.addEventListeners(window,fi,this.handleMouseMove)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.emit("scrollend",this.currentPosition),ui.removeEventListeners(window,gi,this.handleMouseUp),ui.removeEventListeners(window,fi,this.handleMouseMove))}handleMouseMove(e){if(e.preventDefault(),!this.pushed)return;const t=e instanceof window.MouseEvent;let r,i;r=-this.lastClientX+(this.lastClientX=t?e.clientX:e.touches[0].clientX),i=-this.lastClientY+(this.lastClientY=t?e.clientY:e.touches[0].clientY);const s=Math.abs(this.startClientX-this.lastClientX),o=Math.abs(this.startClientY-this.lastClientY);!this.isDragging&&(s>=1||o>=1)&&(this.emit("scrollstart",this.currentPosition),this.isDragging=!0);const{x:n,y:a}=this.preparePosition(this.currentPosition.x-r,this.currentPosition.y-i);this.scrollToImmediately(n,a)}handleNativeScroll(e){this.isDragging||(this.isScrolling||(this.emit("scrollstart",this.currentPosition),this.isScrolling=!0),this.scrollToImmediately(this.slider.scrollLeft,this.slider.scrollTop),this.handleNativeScrollEnd())}scrollToImmediately(e,t){this.currentPosition.x=e,this.currentPosition.y=t,this.slider.scrollLeft=e,this.slider.scrollTop=t,this.testAttraction(),this.emit("scroll",this.currentPosition)}scrollWithAnimation(e=0,t=0,r=0){const i=performance.now(),s=e=>e*e,o=this.getTranslate(),n=e-this.currentPosition.x,a=t-this.currentPosition.y;if(Math.abs(n)<=1&&Math.abs(a)<=1)return;const l=()=>{this.rafId=requestAnimationFrame((d=>{const c=(d-i)/r;if(c>=1)return this.scrollToImmediately(e,t),void this.emit("scrollend",this.currentPosition);const u=s(c)*n+o,h=s(c)*a+o;this.scrollToImmediately(u,h),l()}))};l()}preparePosition(e,t){let r={x:e,y:t};return this.direction===mi.Horizontal?r.y=0:r.x=0,r=this.attractToBounds(r.x,r.y),r}attractToBounds(e,t){const r={x:e,y:t};return r.x=this.attractToBoundsByX(e),r.y=this.attractToBoundsByY(t),r}attractToBoundsByX(e){let t=e;return t<=0&&(t=0),t+this.slider.clientWidth>=this.slider.scrollWidth&&(t=this.slider.scrollWidth-this.slider.clientWidth),t}attractToBoundsByY(e){let t=e;return t<=0&&(t=0),t+this.slider.clientHeight>=this.slider.scrollHeight&&(t=this.slider.scrollHeight-this.slider.clientHeight),t}testAttraction(){this._reachBeginning=!1,this._reachEnd=!1,this.direction===mi.Horizontal?(0===this.currentPosition.x&&(this._reachBeginning=!0),this.currentPosition.x+this.slider.clientWidth>=this.slider.scrollWidth&&(this._reachEnd=!0)):(0===this.currentPosition.y&&(this._reachBeginning=!0),this.currentPosition.y+this.slider.clientHeight>=this.slider.scrollHeight&&(this._reachEnd=!0))}}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 yi(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}var wi;!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(wi||(wi={}));var bi=__webpack_require__(1085),Si=__webpack_require__(9155),Ci=__webpack_require__.n(Si),Oi=__webpack_require__(8384),ki=__webpack_require__.n(Oi);var Li=function(e,t,r){var i=e.key+"-"+t.name;!1===r&&void 0===e.registered[i]&&(e.registered[i]=t.styles)};var Mi={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Ai(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var xi=/[A-Z]|^ms/g,Ei=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ii=function(e){return 45===e.charCodeAt(1)},Ri=function(e){return null!=e&&"boolean"!=typeof e},Ti=Ai((function(e){return Ii(e)?e:e.replace(xi,"-$&").toLowerCase()})),Pi=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ei,(function(e,t,r){return ji={name:t,styles:r,next:ji},t}))}return 1===Mi[e]||Ii(e)||"number"!=typeof t||0===t?t:t+"px"};function Di(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return ji={name:r.name,styles:r.styles,next:ji},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)ji={name:i.name,styles:i.styles,next:ji},i=i.next;return r.styles+";"}return function(e,t,r){var i="";if(Array.isArray(r))for(var s=0;s<r.length;s++)i+=Di(e,t,r[s])+";";else for(var o in r){var n=r[o];if("object"!=typeof n)null!=t&&void 0!==t[n]?i+=o+"{"+t[n]+"}":Ri(n)&&(i+=Ti(o)+":"+Pi(o,n)+";");else if(!Array.isArray(n)||"string"!=typeof n[0]||null!=t&&void 0!==t[n[0]]){var a=Di(e,t,n);switch(o){case"animation":case"animationName":i+=Ti(o)+":"+a+";";break;default:i+=o+"{"+a+"}"}}else for(var l=0;l<n.length;l++)Ri(n[l])&&(i+=Ti(o)+":"+Pi(o,n[l])+";")}return i}(e,t,r);case"function":if(void 0!==e){var s=ji,o=r(e);return ji=s,Di(e,t,o)}}if(null==t)return r;var n=t[r];return void 0!==n?n:r}var ji,Fi=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var Ni=!!Si.useInsertionEffect&&Si.useInsertionEffect,Ui=Ni||function(e){return e()},Bi=(Ni||Si.useLayoutEffect,{}.hasOwnProperty),Gi=Si.createContext("undefined"!=typeof HTMLElement?ki()({key:"css"}):null);Gi.Provider;var Vi=function(e){return(0,Si.forwardRef)((function(t,r){var i=(0,Si.useContext)(Gi);return e(t,i,r)}))};var zi=Si.createContext({});var Wi="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",qi=function(e,t){var r={};for(var i in t)Bi.call(t,i)&&(r[i]=t[i]);return r[Wi]=e,r},$i=function(e){var t=e.cache,r=e.serialized,i=e.isStringTag;return Li(t,r,i),Ui((function(){return function(e,t,r){Li(e,t,r);var i=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var s=t;do{e.insert(t===s?"."+i:"",s,e.sheet,!0),s=s.next}while(void 0!==s)}}(t,r,i)})),null};var Zi=Vi((function(e,t,r){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var s=e[Wi],o=[i],n="";"string"==typeof e.className?n=function(e,t,r){var i="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):i+=r+" "})),i}(t.registered,o,e.className):null!=e.className&&(n=e.className+" ");var a=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=!0,s="";ji=void 0;var o=e[0];null==o||void 0===o.raw?(i=!1,s+=Di(r,t,o)):s+=o[0];for(var n=1;n<e.length;n++)s+=Di(r,t,e[n]),i&&(s+=o[n]);Fi.lastIndex=0;for(var a,l="";null!==(a=Fi.exec(s));)l+="-"+a[1];return{name:function(e){for(var t,r=0,i=0,s=e.length;s>=4;++i,s-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(s){case 3:r^=(255&e.charCodeAt(i+2))<<16;case 2:r^=(255&e.charCodeAt(i+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(i)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(s)+l,styles:s,next:ji}}(o,void 0,Si.useContext(zi));n+=t.key+"-"+a.name;var l={};for(var d in e)Bi.call(e,d)&&"css"!==d&&d!==Wi&&(l[d]=e[d]);return l.ref=r,l.className=n,Si.createElement(Si.Fragment,null,Si.createElement($i,{cache:t,serialized:a,isStringTag:"string"==typeof s}),Si.createElement(s,l))})),Hi=(__webpack_require__(5985),bi.Fragment);function Ki(e,t,r){return Bi.call(t,"css")?bi.jsx(Zi,qi(e,t),r):bi.jsx(e,t,r)}function Qi(e,t,r){return Bi.call(t,"css")?bi.jsxs(Zi,qi(e,t),r):bi.jsxs(e,t,r)}var Yi=__webpack_require__(3643);const Xi=__webpack_require__.n(Yi)().getParser(window.navigator.userAgent).parse(),Ji=()=>{const[e,t]=(0,Si.useState)(!1);(0,Si.useLayoutEffect)((()=>(r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)})),[]);const r=()=>{"mobile"===Xi.parsedResult.platform.type?t(!1):t(!0)};return e};var es=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const ts=e=>{var{listType:t,feedSlug:r,testKey:i,storyManager:s,appearanceManager:o,filter:n,useUgcCard:a=!1,isFavorite:l}=e,d=es(e,["listType","feedSlug","testKey","storyManager","appearanceManager","filter","useUgcCard","isFavorite"]);const[,c]=(0,Si.useState)(0),[u,h]=(0,Si.useState)(),p=Ji(),f=()=>{requestAnimationFrame((()=>c((e=>++e))))},g=()=>{var e;null===(e=d.onLoadStart)||void 0===e||e.call(d)},v=e=>{var t;null===(t=d.onLoadEnd)||void 0===t||t.call(d,e)};return(0,Si.useEffect)((()=>{var e;const c=s.createStoryListViewModel({listType:t,testKey:i,identityFields:{feedSlug:r,filter:n},appearanceManager:o,useUgcCard:a,isFavorite:l});return c.on("update",f),l||(null===(e=d.viewModelExporter)||void 0===e||e.call(d,c),c.on("startLoading",g),c.on("endLoading",v),c.loadStories({needFavorite:!0})),h(c),()=>{c.destroy()}}),[s,i,r,n,o]),(0,Si.useEffect)((()=>{if(u)return d.onFavoriteCardClick&&u.on("clickOnFavoriteCellInternal",d.onFavoriteCardClick),d.ugcCardClickHandler&&u.on("clickOnUgcCardCellInternal",d.ugcCardClickHandler),()=>{d.onFavoriteCardClick&&u.off("clickOnFavoriteCellInternal",d.onFavoriteCardClick),d.ugcCardClickHandler&&u.off("clickOnUgcCardCellInternal",d.ugcCardClickHandler)}}),[u,d.ugcCardClickHandler,d.onFavoriteCardClick]),(0,Si.useEffect)((()=>{u&&(u.modeDesktop=p)}),[p,u]),u};function rs(e){return!/^(-?\d|--)/.test(e)}function is(e){const t=[];let r="",i="",s=7;for(let o,n=0;o=e.charAt(n);n++)if(/[a-zA-Z\d\xa0-\uffff_-]/.test(o)&&7===s)r+=o;else if("\\"===o&&7===s)s=6;else if(" "===o&&7===s){if(""!==r){if(!rs(r))return null;t.push(r),r=""}}else if(6===s)/[0-9a-f]/i.test(o)?(i+=o,s=8):(r+=o,s=7);else{if(8!==s)return null;/[0-9a-f]/i.test(o)&&i.length<6?i+=o:(r+=String.fromCodePoint(parseInt(i,16)),r+=o,i="",s=7)}if(""!==r){if(!rs(r))return null;t.push(r)}return t.join(" ")}function ss(e,t){let r=t,i="";const s={"font-family":[]};for(let t,o=0;t=e.charAt(o);o+=1)if(4!==r||'"'!==t&&"'"!==t)if(3===r&&","===t)r=4,i="";else if(4===r&&","===t){const e=is(i);e&&s["font-family"].push(e),i=""}else if(5===r&&" "===t)/^(?:\+|-)?(?:[0-9]*\.)?[0-9]+(?:deg|grad|rad|turn)$/.test(i)?(s["font-style"]+=" "+i,i=""):o-=1,r=1;else if(1!==r||" "!==t&&"/"!==t)2===r&&" "===t?(/^(?:\+|-)?([0-9]*\.)?[0-9]+(?:em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)?$/.test(i)&&(s["line-height"]=i),r=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))r="/"===t?2:4,s["font-size"]=i;else if(/^italic$/.test(i))s["font-style"]=i;else if(/^oblique$/.test(i))s["font-style"]=i,r=5;else if(/^small-caps$/.test(i))s["font-variant"]=i;else if(/^(?:bold(?:er)?|lighter|normal)$/.test(i))s["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&&(s["font-weight"]=i)}else/^(?:(?:ultra|extra|semi)-)?(?:condensed|expanded)$/.test(i)&&(s["font-stretch"]=i);i=""}else{let n=o+1;do{if(n=e.indexOf(t,n)+1,!n)return null}while("\\"===e.charAt(n-2));s["font-family"].push(e.slice(o+1,n-1).replace(/\\('|")/g,"$1")),o=n-1,r=3,i=""}if(3===r&&!/^\s*$/.test(i))return null;if(4===r){const e=is(i);e&&s["font-family"].push(e)}return s}var os=__webpack_require__(9780),ns=__webpack_require__.n(os);class as{toString(){return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${this.fontSize}px/${this.lineHeight} ${this.fontFamily.join(", ")}`}clone(){const e=new as;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 ls{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;let t={top:0,bottom:0};try{if("number"==typeof e)t.top=e,t.bottom=e;else{const r=ns()(e);t.top=parseFloat(r.top),t.bottom=parseFloat(r.bottom)}}catch(e){console.error(e)}const r=this.cardTitleOptions.lineClamp,i=Math.round(this.cardTitleFont.fontSize*this.cardTitleFont.lineHeight*100)/100;return t.top+t.bottom+r*i}measureScaledFontSizeInWebView(e){const t=document.createElement("span");t.style.fontSize=e+"px",t.style.display="none",this.obj.append(t);const r=getComputedStyle(t).fontSize;return this.obj.removeChild(t),parseFloat(r)||e}isOutsideTitle(){return this.cardTitleOptions.display&&(this.cardTitleOptions.position===u.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===u.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new as;t.fontStyle="normal",t.fontVariant="normal",t.fontWeight="normal",t.fontSize=14,t.lineHeight=1.2,t.fontFamily=["system-ui",'"Segoe UI"',"Roboto","Helvetica","Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'];try{const r=function(e){const t=ss(e,1);return null!==t&&t["font-size"]&&t["font-family"].length?t:null}(e);if(null!=r["font-style"]&&(t.fontStyle=r["font-style"]),null!=r["font-variant"]&&(t.fontVariant=r["font-variant"]),null!=r["font-weight"]&&(t.fontWeight=r["font-weight"]),null!=r["font-size"]){const e=parseFloat(r["font-size"]);String(`${e}px`)===r["font-size"]&&(t.fontSize=e)}if(null!=r["line-height"]){const e=parseFloat(r["line-height"]);String(`${e}px`)===r["line-height"]?t.lineHeight=Math.round(e/t.fontSize*100)/100:String(e)===r["line-height"]&&(t.lineHeight=parseFloat(r["line-height"]))}null!=r["font-family"]&&Array.isArray(r["font-family"])&&(t.fontFamily=r["font-family"])}catch(e){console.error(e)}return t}}class ds{constructor(e){this.storiesListOptions=e}getStoriesListStyleOptions(e){var t,r,i,s,o,n;let a={storiesHeight:null!==(r=null===(t=this.storiesListOptions.card)||void 0===t?void 0:t.height)&&void 0!==r?r:70,storiesLayoutHeight:null!==(s=null===(i=this.storiesListOptions.layout)||void 0===i?void 0:i.height)&&void 0!==s?s:0,storiesListTopPadding:null!==(o=this.storiesListOptions.topPadding)&&void 0!==o?o:0,storiesListBottomPadding:null!==(n=this.storiesListOptions.bottomPadding)&&void 0!==n?n:0},l=parseFloat(a.storiesHeight),d=l;if(parseFloat(a.storiesLayoutHeight))return l=parseFloat(a.storiesLayoutHeight),{storiesListHeight:l,storiesListInnerHeight:d};return l+=parseFloat(a.storiesListTopPadding)+parseFloat(a.storiesListBottomPadding)+e,d+=e,{storiesListHeight:l,storiesListInnerHeight:d}}}const cs=(e,t,r)=>{const i=(e,t)=>{const r=e.getCardTitleFont();r.fontSize=e.getScaledFontSizeInWebView(),t.card.title.font=r.toString()},o=(e,t)=>{const r=new ds(t),{storiesListHeight:i,storiesListInnerHeight:s}=r.getStoriesListStyleOptions(e.getStoryTitleBlockHeight()),o=t.layout.height;t.layout.height=q()(o)?`${i}px`:o},n=t=>{((e,t)=>{const r=new ls(e,t.card.title);i(r,t),o(r,t)})(e.current,t),r.emit("update")};(0,Si.useLayoutEffect)((()=>(n(t.storiesListOptions),t.on(s.EVENT_UPDATED_STORIES_LIST_OPTIONS,n),()=>{t.off(s.EVENT_UPDATED_STORIES_LIST_OPTIONS,n)})),[t,r])},us=e=>{const[t,r]=(0,Si.useState)(!1),[i,s]=(0,Si.useState)(null),{ref:o}=(e=>{const t=(0,Si.useRef)(null);return(0,Si.useEffect)((()=>{if(!t.current)return;const r=new _i;return r.mount(t.current),e(r),()=>{r.destroy()}}),[]),{ref:t}})((e=>{s(e),e.addListener("scrollstart",(()=>r(!0))),e.addListener("scrollend",(()=>setTimeout((()=>r(!1)),100)))}));return(0,Si.useEffect)((()=>{i&&(i.setGap(e.options.card.gap),i.setDesktopMode(e.modeDesktop),i.changeDirection(e.options.direction))}),[i,e.options.card.gap,e.modeDesktop,e.options.direction]),{sliderRef:o,slider:i,isScrolling:t}};var hs=__webpack_require__(992),ps=__webpack_require__.n(hs),fs=__webpack_require__(2591),gs=__webpack_require__.n(fs),vs=__webpack_require__(5213),ms={insert:"head",singleton:!1};gs()(vs.A,ms);const _s=vs.A.locals||{},ys=({slider:e,storyListViewModel:t,isFavorite:r,listType:i,identityFields:s,storyManager:o})=>{const n=(({storyManager:e,listType:t,identityFields:r})=>{const[i,s]=(0,Si.useState)();return(0,Si.useEffect)((()=>{const i=new zt(e,{listType:t,identityFields:r}).create();return s(i),()=>{i.destroy()}}),[r.feedSlug,r.filter]),i})({listType:i,identityFields:s,storyManager:o});(0,Si.useEffect)((()=>{if(!e||r||!n)return;let t=0,i=0,s=0,o=0;const l=({x:e,y:r})=>{t=e,s=r,i=0,o=0},d=({x:e,y:r})=>{t=Math.min(e,t),i=Math.max(e,i),s=Math.min(r,s),o=Math.max(r,o),n.calculate({minOffsetLeft:t,maxOffsetLeft:i,minOffsetTop:s,maxOffsetTop:o})};e.addListener("scrollstart",l),e.addListener("scrollend",d);const c=di()(a,600,{leading:!1});return window.addEventListener("scroll",c),window.addEventListener("resize",c),()=>{null==e||e.removeListener("scrollstart",l),null==e||e.removeListener("scrollend",d),window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}}),[e,r]),(0,Si.useEffect)((()=>{r||a()}),[t.options.direction,t.options.card.aspectRatio,t.options.card.height,t.session,r,n]);const a=()=>{if(!e||!n)return;const t=e.elementRef.getBoundingClientRect(),{x:r,y:i}=e.getCurrentPosition();l(t),n.calculate({minOffsetLeft:r,maxOffsetLeft:r,minOffsetTop:i,maxOffsetTop:i})};(0,Si.useEffect)((()=>{if(!n)return;const e=e=>n.markStoryAsFullVisible(e);return t.on("openStory",e),()=>{t.off("openStory",e)}}),[t]);const l=e=>{const{left:t,top:r,width:i,height:s}=e,o=new Nt(t,r,i,s);d(o),u(o)},d=e=>{const t=new Nt(0,0,window.innerWidth,window.innerHeight),r=c(t,e);h(r,e),n.setViewport(r)},c=(e,t)=>{let r=new Nt;return t.overlaps(e)?(r=t.getIntersection(e),r):r},u=t=>{if(!e)return;const r=e.slides,i=[];r.forEach(((e,s)=>{const o=Number(e.dataset.id),n=new Vt(o,e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight);i.push(n),n.x+=t.x,n.y+=t.y,f(n,s,r.length-1)})),n.setStoryRects(i)},h=(e,t)=>{if(t.width<768)return;const r=p();e.x+=r.left,e.y+=r.top,e.height-=r.top+r.bottom,e.width-=r.left+r.right},p=()=>{const e=t.options.sidePadding,r={left:e,right:e,top:t.options.topPadding,bottom:t.options.bottomPadding};return"vertical"===t.options.direction&&(r.left=0,r.right=0),r},f=(e,t,r)=>{const i=p();e.x+=i.left,0===t&&(e.x+=i.left,e.width-=i.left),t===r&&(e.width-=i.right)}},ws=(e,t,r)=>{(0,Si.useEffect)((()=>{if(e)return t.on("closeStory",i),()=>{t.off("closeStory",i)}}),[e]);const i=i=>{if(!e)return;const s=e.slides.find((e=>Number(e.dataset.id)===i));if(!s||((e,t)=>{const i=new Nt(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight),{x:s,y:o}=e.getCurrentPosition(),n=r.current.getBoundingClientRect(),a=new Nt(n.x+s,n.y+o,n.width,n.height);return i.overlaps(a)})(e,s))return;const o="horizontal"===t.options.direction?s.offsetLeft:s.offsetTop;e.scrollTo(o)}},bs=(0,Si.forwardRef)(((e,t)=>{const r=e.sliderOptions.card,i=e.sliderOptions.favoriteCard,s=r.border,o=r.opened.border,n=e.sliderOptions.navigation,a=()=>{var e,t,r;return(null!==(e=o.radius)&&void 0!==e?e:s.radius)-parseFloat(null!==(t=o.width)&&void 0!==t?t:s.width)/2-parseFloat(null!==(r=o.gap)&&void 0!==r?r:s.gap)};return Ki("div",{ref:t,className:e.className,style:Object.assign(Object.assign({},(()=>{var t,l,d,c,u,h,p,f,g,v,m,_,y,w,b,S,C,O,k,L,M;const A=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};let x={"--storiesBorderNotReadColor":s.color,"--storiesBorderReadColor":null!==(t=o.color)&&void 0!==t?t:s.color,"--storiesBorderNotReadGradientColor":null==s?void 0:s.gradient,"--storiesBorderReadGradientColor":null!==(l=null==o?void 0:o.gradient)&&void 0!==l?l:null==s?void 0:s.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":r.gap+"px","--storiesHeight":r.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":s.width+"px","--storiesListBorderReadWidth":(null!==(u=o.width)&&void 0!==u?u:o.width)+"px","--storiesListBorderGapNotRead":s.gap+"px","--storiesListBorderGapRead":(null!==(h=o.gap)&&void 0!==h?h:o.gap)+"px","--storiesListBorderRadius":s.radius+"px","--storiesListBorderRadiusRead":(null!==(p=o.radius)&&void 0!==p?p:o.radius)+"px","--storiesListItemMaskColor":r.mask.color,"--storiesListItemOpenedMaskColor":null!==(f=r.opened.mask.color)&&void 0!==f?f:r.mask.color,"--storiesListItemMaskLinearGradient":A(r.mask),"--storiesListItemOpenedMaskLinearGradient":A(null!=(null===(v=null===(g=r.opened)||void 0===g?void 0:g.mask)||void 0===v?void 0:v.linearGradient)?r.opened.mask:r.mask),"--storiesListCardFavoriteTitle":yi(i.title.padding.toString())?i.title.padding+"px":i.title.padding,"--storiesListCardFavoriteGap":yi(i.gap.toString())?i.gap+"px":i.gap,"--storiesListCardUgcMaskColor":e.sliderOptions.ugcCard.mask.color,"--storiesListCardUgcMaskLinearGradient":A(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleColor":r.title.color,"--storiesListItemTitleFontFamily":"InternalPrimaryFont","--storiesListItemTitleFont":r.title.font,"--storiesListItemTitlePadding":yi(r.title.padding.toString())?r.title.padding+"px":r.title.padding,"--storiesListControlsSize":yi(n.controlsSize.toString())?n.controlsSize+"px":n.controlsSize,"--storiesListControlsBackgroundColor":n.controlsBackgroundColor,"--storiesListControlsColor":n.controlsColor,"--storiesListInnerBorderRadiusNotRead":s.radius-parseFloat(s.width)/2-parseFloat(s.gap)+"px","--storiesListInnerBorderRadiusRead":a()+"px","--storiesListCardDropShadow":r.dropShadow,"--storiesListCardOpenedDropShadow":null!==(m=r.opened.dropShadow)&&void 0!==m?m:r.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":(null===(_=r.svgMask)||void 0===_?void 0:_.cardMask)?`url("data:image/svg+xml,${jt(null===(y=r.svgMask)||void 0===y?void 0:y.cardMask)}")`:null,"--storiesListCardOpenedMask":(null===(w=r.opened.svgMask)||void 0===w?void 0:w.cardMask)?`url("data:image/svg+xml,${jt(null===(b=r.opened.svgMask)||void 0===b?void 0:b.cardMask)}")`:null,"--storiesListCardFavoriteMask":(null===(S=e.sliderOptions.ugcCard.svgMask)||void 0===S?void 0:S.cardMask)?`url("data:image/svg+xml,${jt(null===(C=e.sliderOptions.ugcCard.svgMask)||void 0===C?void 0:C.cardMask)}")`:null},E=null;return E=null===(O=r.svgMask)||void 0===O?void 0:O.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>x[`--storiesListCardOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${jt(e.mask)}")`:null)),E=null===(k=r.opened.svgMask)||void 0===k?void 0:k.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>x[`--storiesListCardOpenedOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${jt(e.mask)}")`:null)),E=null===(L=e.sliderOptions.favoriteCard.svgMask)||void 0===L?void 0:L.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>x[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${jt(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)=>x[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${jt(e.mask)}")`:null)),x})()),e.style),children:e.children})})),Ss=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),Cs=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const r=(0,Si.useRef)(null);return(0,Si.useEffect)((()=>{(()=>{if(!e)return;const i=r.current,s=()=>{i.play().then((()=>{if(Ss){let e=1;const r=()=>{e>=2&&(i.removeEventListener("timeupdate",r),i.currentTime=0,t()),e++};i.addEventListener("timeupdate",r,!1)}else t()})).catch((e=>{console.error(e)})),i.removeEventListener("canplaythrough",s)};i.addEventListener("canplaythrough",s),i.load()})()}),[]),Ki("video",{ref:r,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},Os=({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:i})=>{const s=(e,t)=>null!=t&&Array.isArray(t)?t.map(((t,r)=>o(t,e,r))):[],o=(e,t,r)=>({maskImage:`var(--${t}${r}Mask)`,WebKitMaskImage:`var(--${t}${r}Mask)`,background:e.background});return{getAllCardsOverlayMaskStyles:()=>{let o=[];var n;return e.isFavoriteCard&&(o=o.concat(s("storiesListCardFavoriteOverlay",null===(n=r.svgMask)||void 0===n?void 0:n.overlayMask))),o=e.isUgcCard?o.concat((()=>{var e;return s("storiesListCardUgcOverlay",null===(e=i.svgMask)||void 0===e?void 0:e.overlayMask)})()):e.isOpened?o.concat((()=>{var e;return s("storiesListCardOpenedOverlay",null===(e=t.opened.svgMask)||void 0===e?void 0:e.overlayMask)})()):o.concat((()=>{var e;return s("storiesListCardOverlay",null===(e=t.svgMask)||void 0===e?void 0:e.overlayMask)})()),o}}};var ks=__webpack_require__(6892),Ls={insert:"head",singleton:!1};gs()(ks.A,Ls);const Ms=ks.A.locals||{},As=({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:s,isScrolling:o,wrapperStyle:n,children:a,onClick:l})=>{const d={story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:s},[u,h]=(0,Si.useState)(!1),{getAllCardsOverlayMaskStyles:p}=Os(d),{getCardTitleAlignClass:f,getTitleStyle:g,getTitleWrapperStyle:v}=(({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:i})=>({getCardTitleAlignClass:()=>({[Ms["align-left"]]:t.title.textAlign===c.LEFT,[Ms["align-center"]]:t.title.textAlign===c.CENTER,[Ms["align-right"]]:t.title.textAlign===c.RIGHT}),getTitleStyle:()=>{let r={};return e.titleColor&&e.isTitleCardInner&&Object.assign(r,{color:e.titleColor}),r.WebkitLineClamp=String(parseInt(t.title.lineClamp)),r},getTitleWrapperStyle:()=>{let t={};return e.titleColor&&e.isFavoriteCard&&(t=Object.assign(Object.assign({},t),{color:r.title.color})),e.titleColor&&e.isUgcCard&&(t=Object.assign(Object.assign({},t),{color:i.title.color})),t}}))(d),{getSlideClassList:m,getSlideStyleList:_,getSlideWrapperStyle:y}=(({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:s})=>{const o=e.aspectRatio;return{getSlideClassList:()=>{var o,n;const a=e.background;let l="";void 0!==a&&(l=Ms[`_background-color-${a.color}`+(!0===a.gradient?"-gradient":"")]);const d=(()=>{let i;return i=e.isFavoriteCard?r:e.isUgcCard?s:e.isOpened&&t.opened||t,i})(),c=Boolean(d.dropShadow),u=Boolean(null===(o=d.svgMask)||void 0===o?void 0:o.cardMask),h=Boolean(null===(n=d.border)||void 0===n?void 0:n.gradient);return[l,{[Ms["_is-read"]]:e.isOpened},{[Ms["_format-rectangle"]]:t.variant===i.STYLE_RECTANGLE},{[Ms["_format-circle"]]:t.variant===i.STYLE_CIRCLE},{[Ms["_format-quad"]]:t.variant===i.STYLE_QUAD},{[Ms["_favorite-cell"]]:e.isFavoriteCard},{[Ms["_ugc-cell"]]:e.isUgcCard},{[Ms["_has-drop-shadow"]]:c},{[Ms["_has-card-svg-mask"]]:u},{[Ms["_has-border-gradient-color"]]:h}]},getSlideStyleList:()=>{const r={width:o*t.height+"px",opacity:null!==t.opacity?t.opacity:1,boxShadow:t.boxShadow||"unset",height:`${t.height}px`};return e.isOpened&&(r.boxShadow=t.opened.boxShadow||r.boxShadow,r.opacity=null!==t.opened.opacity?t.opened.opacity:r.opacity),r},getSlideWrapperStyle:()=>{let e={};return e.width=o*t.height+"px",e}}})(d),w=e.getImageSrc();return Qi("a",{"data-id":e.id,className:ps()(Ms["stories-slide-wrapper"],{[Ms.isTitleCardOutsideTop]:e.isTitleCardOutsideTop,[Ms.isTitleCardOutsideBottom]:e.isTitleCardOutsideBottom}),style:Object.assign(Object.assign({},y()),n),rel:"noreferrer",onClick:t=>{o||(t.stopPropagation(),t.preventDefault(),l(e))},children:[t.title.display&&e.isTitleCardOutsideTop&&Ki("div",{className:ps()(Ms["stories-slide__content"],Ms[" __position_outside_top"]),style:v(),children:Ki("div",{className:ps()(Ms["stories-slide__title clamp"],f()),style:g(),children:e.title})}),Qi("div",{className:ps()(Ms["stories-slide"],m()),style:_(),children:[Qi("div",{className:Ms["stories-slide__inner"],children:[Ki("div",{className:Ms["stories-slide-image"],style:{backgroundColor:e.backgroundColor?e.backgroundColor:"transparent"},children:Ki("div",{className:Ms["stories-slide-image__wrap"],children:Qi("div",{className:ps()(Ms["stories-slide-image__image"],Ms._mode_list,{[Ms["video-loaded"]]:u,[Ms["ugc-card-cell"]]:e.isUgcCard}),children:[w&&Ki("img",{src:w,alt:e.title,loading:t.coverLazyLoading?"lazy":"eager"}),e.videoCoverSrc&&Ki(Cs,{onVideoCoverLoaded:()=>h(!0),videoCoverSrc:e.videoCoverSrc}),a]})})}),Ki("div",{className:Ms["stories-slide__mask"]}),t.title.display&&e.isTitleCardInner&&Ki("div",{className:Ms["stories-slide__content"],style:v(),children:Ki("div",{className:ps()(Ms["stories-slide__title clamp"],f()),style:g(),children:e.title})})]}),p().map(((e,t)=>Ki("div",{style:e,className:Ms["card-overlay-svg-mask"]},t)))]}),t.title.display&&e.isTitleCardOutsideBottom&&Ki("div",{className:ps()(Ms["stories-slide__content"],Ms.__position_outside_bottom),style:v(),children:Ki("div",{className:ps()(Ms["stories-slide__title clamp"],f()),style:g(),children:e.title})})]})};var xs=__webpack_require__(1980),Es={insert:"head",singleton:!1};gs()(xs.A,Es);const Is=xs.A.locals||{};var Rs=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Ts=e=>{var{sliderDirection:t,slider:r}=e,i=Rs(e,["sliderDirection","slider"]);const[s,o]=(0,Si.useState)(!0),[n,a]=(0,Si.useState)(!1);(0,Si.useEffect)((()=>(r.addListener("scroll",l),()=>{r.removeListener("scroll",l)})),[r]);const l=()=>{o(r.reachBeginning),a(r.reachEnd)},d=e=>{const s=r.getSlidesPerView(),o=r.getTranslate(),n=(()=>{var e;return(null===(e=r.slides[0])||void 0===e?void 0:e.clientWidth)+r.getGap()})(),a=(()=>{var e;return(null===(e=r.slides[0])||void 0===e?void 0:e.clientHeight)+r.getGap()})(),l=o+e*s*(t===mi.Horizontal?n:a);r.scrollTo(l,i.navigationOptions.speed)};return i.navigationView?i.navigationView({defaultStyles:Is,reachStart:s,reachEnd:n,onPrev:()=>d(-1),onNext:()=>d(1),slider:{currentPosition:r.getTranslate(),direction:t,viewport:r.elementRef.getBoundingClientRect()}}):i.navigationOptions.showControls?Qi("div",{className:ps()(Is["stories-list-controls"],Is[t]),children:[Ki("div",{onClick:()=>d(-1),className:ps()(Is["control-start"],{active:s}),children:Ki("div",{className:Is["control-icon"]})}),Ki("div",{onClick:()=>d(1),className:ps()(Is["control-end"],{active:n}),children:Ki("div",{className:Is["control-icon"]})})]}):null};var Ps=__webpack_require__(7966),Ds={insert:"head",singleton:!1};gs()(Ps.A,Ds);const js=Ps.A.locals||{},Fs=({favoriteStories:e,cardOptions:t})=>{const r=e=>({paddingTop:1/e.aspectRatio*100+"%"}),s=e=>{const t=e.getImageSrc(),r={};return t?r.backgroundImage=`url('${t}')`:r.backgroundColor=e.backgroundColor,r};return Ki("div",{className:js["favorite-images-wrapper"],children:e.slice(0,4).map(((e,o)=>Ki("div",{className:js["favorite-image-wrapper"],children:Ki("div",{style:r(e),className:ps()(js["favorite-image"],{[js.circle_style]:t.variant===i.STYLE_CIRCLE}),children:Ki("div",{className:js["favorite-image-item"],style:s(e)})})},o)))})};var Ns=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Us=e=>{var{viewModelExporter:t,onLoadStart:r,onLoadEnd:i,isFavorite:s=!1,storyListViewModel:o}=e,n=Ns(e,["viewModelExporter","onLoadStart","onLoadEnd","isFavorite","storyListViewModel"]);const a=(0,Si.useRef)(null),d=(0,Si.useRef)(null);cs(a,n.appearanceManager,o);const{sliderRef:c,slider:h,isScrolling:p}=us(o);ys({slider:h,storyListViewModel:o,isFavorite:s,listType:n.listType,identityFields:{feedSlug:n.feedSlug,filter:n.filter},storyManager:n.storyManager}),((e,t,r)=>{(0,Si.useEffect)((()=>{e&&t.modeDesktop&&i(e,r.current)}),[e,t.modeDesktop]);const i=(e,r)=>{if(t.options.layout.sliderAlign!==l.CENTER)return;let i=e.scrollWidth;if(i>0&&i<r.clientWidth){let t=r.clientWidth-i/2;e.scrollTo(t)}}})(h,o,d),ws(h,o,d);const{getRootStyle:f,getStoryWrapperStyle:g,viewportInnerClassList:v,viewportInnerStyle:m}={getRootStyle:()=>({"--background-color":_.options.layout.backgroundColor,paddingLeft:_.options.sidePadding+"px",paddingRight:_.options.sidePadding+"px","--storiesListTopPadding":_.options.topPadding+"px","--storiesListBottomPadding":_.options.bottomPadding+"px","--storiesListSidePadding":_.options.sidePadding+"px",backgroundColor:_.options.layout.backgroundColor}),getStoryWrapperStyle:(e,t)=>{let r={marginRight:"0",paddingLeft:"0",paddingRight:"0"};return"vertical"===_.options.direction||(e!==t-1?r.marginRight=_.options.card.gap+"px":r.paddingRight=_.options.sidePadding+"px",0===e&&(r.paddingLeft=_.options.sidePadding+"px")),r},viewportInnerClassList:(_=o).modeDesktop?ps()(_s["stories-list__viewport-inner"],_s["mode-desktop"],{[_s["with-list-controls"]]:_.options.navigation.showControls,[_s.isTitleCardOutsideTop]:_.options.card.title.position===u.CARD_OUTSIDE_TOP,[_s.isTitleCardOutsideBottom]:_.options.card.title.position===u.CARD_OUTSIDE_BOTTOM,[_s.isVerticalDirection]:"vertical"===_.options.direction}):ps()(_s["stories-list__viewport-inner"],Object.assign(Object.assign({},{[_s["align-left"]]:_.options.layout.sliderAlign===l.LEFT,[_s["align-center"]]:_.options.layout.sliderAlign===l.CENTER,[_s["align-right"]]:_.options.layout.sliderAlign===l.RIGHT}),{[_s.isTitleCardOutsideTop]:_.options.card.title.position===u.CARD_OUTSIDE_TOP,[_s.isTitleCardOutsideBottom]:_.options.card.title.position===u.CARD_OUTSIDE_BOTTOM,[_s.isVerticalDirection]:"vertical"===_.options.direction})),viewportInnerStyle:{height:_.options.layout.height,gap:"vertical"===_.options.direction?`${_.options.card.gap}px`:0}};var _;const y=o.options.card,w=o.options.favoriteCard,b=o.options.ugcCard;let S=[];return s?S=o.favoriteStories:(S=o.defaultStories,o.favoriteCard&&S.push(o.favoriteCard),o.ugcCard&&S.unshift(o.ugcCard)),Qi(bs,{className:ps()(_s["stories-list-wrapper"],{[_s["mode-desktop"]]:o.modeDesktop,[_s["with-list-controls"]]:o.options.navigation.showControls}),style:f(),sliderOptions:o.options,ref:a,children:[Ki("div",{className:_s["stories-list"],children:Ki("div",{ref:d,className:ps()(_s["stories-list__viewport"],{[_s["mode-desktop"]]:o.modeDesktop}),style:"horizontal"===o.options.direction?{marginLeft:-o.options.sidePadding+"px",marginRight:-o.options.sidePadding+"px"}:{},children:Ki("div",{ref:c,className:v,style:m,children:S.map(((e,t)=>{var r;const i=e.isFavoriteCard&&o.favoriteCard,s=n.storyCardView&&!i;return i&&n.favoriteCardView?Ki(Ci().Fragment,{children:n.favoriteCardView(o.favoriteCard)},t):Ki(Ci().Fragment,{children:s?null===(r=n.storyCardView)||void 0===r?void 0:r.call(n,e):Ki(As,{story:e,cardOptions:y,favoriteCardOptions:w,ugcCardOptions:b,wrapperStyle:g(t,S.length),isScrolling:p,onClick:e=>o.onStoryClick(e,t),children:i&&Ki(Fs,{favoriteStories:o.favoriteCard.favoriteStories,cardOptions:y})},t)},t)}))})})}),h&&Ki(Ts,{navigationOptions:o.options.navigation,navigationView:n.navigationView,sliderDirection:o.options.direction,slider:h})]})};var Bs=__webpack_require__(763),Gs={insert:"head",singleton:!1};gs()(Bs.A,Gs);Bs.A.locals;const Vs=({storyManager:e})=>{const[,t]=(0,Si.useState)(0),[r,i]=(0,Si.useState)(null),s=(()=>{const e=(0,Si.useRef)();return e.current||(e.current=(()=>{const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t)),r=t("--sat"),i=t("--sab");return{left:t("--sal"),right:t("--sar"),top:r,bottom:i}})()),e.current})(),o=Ji(),n=()=>requestAnimationFrame((()=>t((e=>++e))));return(0,Si.useEffect)((()=>{const t=e.createGameReaderViewModel();return t.setSafeAreaInsets(s),t.on("update",n),i(t),()=>{t.destroy()}}),[e]),(0,Si.useEffect)((()=>{null==r||r.setDesktopMode(o)}),[r,o]),{desktopMode:o,gameReaderViewModel:r}};var zs=__webpack_require__(4978),Ws={insert:"head",singleton:!1};gs()(zs.A,Ws);const qs=zs.A.locals||{};var $s=__webpack_require__(1422),Zs={insert:"head",singleton:!1};gs()($s.A,Zs);const Hs=$s.A.locals||{},Ks=({onClick:e,className:t})=>Ki("div",{className:ps()(Hs.icon,t),onClick:e,children:Ki("svg",{viewBox:"0 0 24 24",children:Ki("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"})})});function Qs(){var e,t,r,i,s,o;let n=null;try{n=(null===(e=window.parent)||void 0===e?void 0:e.innerHeight)||(null===window||void 0===window?void 0:window.innerHeight)||(null===(i=null===(r=null===(t=window.parent)||void 0===t?void 0:t.document)||void 0===r?void 0:r.documentElement)||void 0===i?void 0:i.clientHeight)}catch(e){console.error(e)}return n||(null===(o=null===(s=null===window||void 0===window?void 0:window.document)||void 0===s?void 0:s.documentElement)||void 0===o?void 0:o.clientHeight)}var Ys=__webpack_require__(6644),Xs={insert:"head",singleton:!1};gs()(Ys.A,Xs);const Js=Ys.A.locals||{},eo=310/480,to=({desktopMode:e,children:t,verticalPadding:r,style:i,className:s})=>{const[o,n]=(0,Si.useState)({width:"0px",height:"0px"});(0,Si.useEffect)((()=>(a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)})),[]);const a=()=>{const e=function(){var e,t,r,i,s,o,n,a,l,d,c;let u=null;try{u=(null===(e=window.parent)||void 0===e?void 0:e.innerWidth)||window.innerWidth||(null===(i=null===(r=null===(t=window.parent)||void 0===t?void 0:t.document)||void 0===r?void 0:r.documentElement)||void 0===i?void 0:i.clientWidth)||(null===(n=null===(o=null===(s=window.parent)||void 0===s?void 0:s.document)||void 0===o?void 0:o.body)||void 0===n?void 0:n.clientWidth)}catch(e){console.error(e)}return u||(null===(l=null===(a=window.document)||void 0===a?void 0:a.documentElement)||void 0===l?void 0:l.clientWidth)||(null===(c=null===(d=window.document)||void 0===d?void 0:d.body)||void 0===c?void 0:c.clientWidth)}(),t=f(),r=e/Qs(),i=d({aspectRatio:r,vh:t,vw:e}),s=l({aspectRatio:r,vh:t,vw:e});n({width:i,height:s})},l=({aspectRatio:e,vh:t,vw:r})=>{const i=h(e)||p();return e>eo&&!i?`${u({vh:t,vw:r})}px`:"100%"},d=({aspectRatio:e,vh:t,vw:r})=>e>eo&&!h(e)?`${c({aspectRatio:e,vh:t,vw:r})}px`:"auto",c=({aspectRatio:t,vh:r,vw:i})=>t>eo&&!e?i:Math.ceil(r*eo),u=({vh:t,vw:r})=>e?t:Math.ceil(r/eo),h=e=>e>eo&&e-eo<=.1,p=()=>{let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches},f=()=>{let t=Qs();return e?(t-=r,t):t};return Ki("div",{className:ps()(Js["aspect-ratio-box"],s),style:Object.assign(Object.assign({},i),o),children:Ki("div",{className:Js["aspect-ratio-box-inside"],children:t})})};var ro=__webpack_require__(9590),io={insert:"head",singleton:!1};gs()(ro.A,io);const so=ro.A.locals||{},oo=Or(),no=e=>{const[t,r]=(0,Si.useState)(!1),i=(0,Si.useCallback)((()=>{if(e.desktopMode)return;const t=oo.type!==e.orientation;e.onOrientationChange({type:oo.type,isWrong:t}),r(t)}),[e.desktopMode,e.orientation]);return(0,Si.useEffect)((()=>(i(),oo.addEventListener("change",i),()=>{oo.removeEventListener("change",i)})),[i]),t?Ki("div",{className:so["screen-orientation-lock"]}):null};var ao=__webpack_require__(3510),lo={insert:"head",singleton:!1};gs()(ao.A,lo);const co=ao.A.locals||{};var uo=__webpack_require__(984),ho={insert:"head",singleton:!1};gs()(uo.A,ho);const po=uo.A.locals||{},fo=({shareLink:e,sharePanelOptions:t,onDownloadClick:r})=>{var i,s;return Qi("div",{className:`${co["share-panel__body"]} ${po["share-panel__body_screenshot"]}`,children:[Ki("div",{className:`${co["share-panel-row"]} ${po["share-panel-row"]}`,children:Ki("a",{className:po["share-panel-row__image-link"],onClick:r,href:e,download:"image.jpeg",children:Ki("img",{src:e,className:po["share-panel-row__image"]})})}),Ki("div",{className:co["share-panel-separator"]}),Ki("div",{className:`${co["share-panel-row"]} ${po["share-panel-row"]}`,children:Ki("a",{className:po["share-item__download-button"],onClick:r,href:e,download:"image.jpeg",children:Ki("div",{dangerouslySetInnerHTML:{__html:null!==(s=null===(i=t.downloadButton)||void 0===i?void 0:i.svgSrc.baseState)&&void 0!==s?s:""}})})})]})};var go=__webpack_require__(334),vo={insert:"head",singleton:!1};gs()(go.A,vo);const mo=go.A.locals||{},_o={[v.vk]:{title:"VK",icon:({width:e,height:t})=>Qi("svg",{width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[Ki("circle",{cx:"24",cy:"24",r:"21.3",fill:"#fff"}),Ki("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"})]}),getUrl:e=>`https://vk.com/share.php?url=${e.url}&title=${e.text}`},[v.facebook]:{title:"Facebook",icon:({width:e,height:t})=>Qi("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"126.4 2.3 589 589",children:[Ki("circle",{cx:"420.9",cy:"296.8",r:"294.5",fill:"#3c5a9a"}),Ki("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"})]}),getUrl:e=>`https://www.facebook.com/sharer.php?u=${e.url}&t=${e.text}`},[v.twitter]:{title:"X",icon:({width:e,height:t})=>Ki("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 195 195",width:e,height:t,children:Qi("g",{transform:"matrix(.20227 0 0 .20302 -71 -26.7)",children:[Ki("circle",{cx:"834.3",cy:"610.6",r:"481.3",stroke:"#fff",strokeMiterlimit:"10"}),Ki("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"})]})}),getUrl:e=>`https://twitter.com/share?url=${e.url}&text=${e.text}`},[v.linkedin]:{title:"LinkedIn",icon:({width:e,height:t})=>Ki("svg",{enableBackground:"new 0 0 550 550",width:e,height:t,id:"Layer_1",version:"1.1",viewBox:"0 0 550 550",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Ki("g",{children:Qi("g",{children:[Ki("circle",{cx:"275",cy:"275",fill:"#04689B",r:"256"}),Ki("path",{d:"M219.2,366.5h-38.8V242.2h38.8V366.5z M198.8,226.6h-0.3c-14.1,0-23.2-9.5-23.2-21.6\r\n c0-12.3,9.4-21.6,23.7-21.6c14.3,0,23.1,9.3,23.4,21.5C222.5,217.1,213.4,226.6,198.8,226.6z M374.6,366.5h-44v-64.3\r\n c0-16.8-6.9-28.3-22-28.3c-11.6,0-18,7.7-21,15.2c-1.1,2.7-0.9,6.4-0.9,10.2v67.3H243c0,0,0.6-113.9,0-124.3h43.6v19.5\r\n c2.6-8.5,16.5-20.7,38.8-20.7c27.6,0,49.3,17.9,49.3,56.4V366.5z",fill:"#FFFFFF"})]})})}),getUrl:e=>`https://www.linkedin.com/sharing/share-offsite/?url=${e.url}&title=${e.text}`},[v.telegram]:{title:"Telegram",icon:({width:e,height:t})=>Qi("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 240 240",width:e,height:t,children:[Ki("defs",{children:Qi("linearGradient",{id:"a",x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",children:[Ki("stop",{offset:"0",stopColor:"#1d93d2"}),Ki("stop",{offset:"1",stopColor:"#38b0e3"})]})}),Ki("circle",{cx:"120",cy:"120",r:"120",fill:"url(#a)"}),Ki("path",{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"}),Ki("path",{d:"m100.1 138.9-2.7 29s-1.2 9 7.7 0 17.4-15.7 17.4-15.7",fill:"#a9c6d8"}),Ki("path",{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"})]}),getUrl:e=>`https://t.me/share/url?url=${e.url}&text=${e.text}`},[v.ok]:{title:"OK",icon:({width:e,height:t})=>Qi("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 388.4 387.1",xmlSpace:"preserve",width:e,height:t,children:[Ki("path",{style:{mixBlendMode:"normal"},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"}),Ki("path",{style:{mixBlendMode:"normal"},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"}),Qi("g",{style:{mixBlendMode:"normal"},fill:"#fff",children:[Ki("path",{d:"M217.4 253.5c28-5.7 44.7-19 45.6-19.7a19 19 0 0 0-23.8-29.6c-.2.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 .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.9zM191.7 218z"}),Ki("path",{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"},transform:"translate(-1.8 .2)"})]})]}),getUrl:e=>`https://connect.ok.ru/offer?url=${e.url}&title=${e.text}`}};var yo=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const wo=__webpack_require__(4862),bo=e=>{var t,r,i,{shareLink:s,sharePanelOptions:o,onShareComplete:n}=e,a=yo(e,["shareLink","sharePanelOptions","onShareComplete"]);const l=()=>{try{return new URL(s).host}catch(e){return console.error(e),null}},d=e=>{const t=(()=>{try{return new URL(s)}catch(e){return console.error(e),null}})();return t?_o[e].getUrl({url:t.toString(),text:l()?"":encodeURIComponent(s)}):"#"};return Qi("div",{className:co["share-panel__body"],children:[Qi("div",{className:`${co["share-panel-row"]} ${co["title-row"]}`,children:[l()&&Ki("div",{className:co["share-url-favicon"],children:Ki("img",{src:`${null!==(t=a.faviconApiUrl)&&void 0!==t?t:"https://favicon.inappstory.ru"}?sz=64&domain_url=${l()}`})}),Ki("span",{className:co.title,children:s})]}),o.targets.length>0&&Qi(Hi,{children:[Ki("div",{className:co["share-panel-separator"]}),Ki("div",{className:`${co["share-panel-row"]} ${mo["social-list"]}`,children:o.targets.map(((e,t)=>{const r=_o[e],i=r.icon;return Ki("div",{className:mo["social-list__item"],children:Qi("a",{href:d(e),onClick:t=>((e,t,r)=>{hi(window,"focus",n),window.open(e,t,r)})(d(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${co["share-item"]} ${mo["share-item"]}`,children:[Ki(i,{width:"50px",height:"50px"}),Ki("span",{className:co["share-item-title"],children:r.title})]})},t)}))})]}),Ki("div",{className:co["share-panel-separator"]}),Ki("div",{className:co["share-panel-row"],children:Qi("a",{className:`${co["share-item"]} ${mo["share-item"]}`,onClick:()=>{wo.copy(s),n()},children:[Ki("div",{dangerouslySetInnerHTML:{__html:null!==(i=null===(r=null==o?void 0:o.copyButton)||void 0===r?void 0:r.svgSrc.baseState)&&void 0!==i?i:""}}),Ki("span",{className:co["share-item-title"],children:"Copy link"})]})})]})};var So;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(So||(So={}));const Co=({shareType:e,shareLink:t,onShareCompelete:r,sharePanelOptions:i})=>{const[s,o]=(0,Si.useState)(!1),[n,a]=(0,Si.useState)(!0),[l,d]=(0,Si.useState)(!1),c=()=>{o(!0),d(!0)};return(0,Si.useEffect)((()=>{requestAnimationFrame((()=>a(!1)))}),[]),Qi("div",{className:ps()(co["share-panel-wrapper"]),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[Ki("div",{className:ps()(co["share-panel-backdrop"],{[co["fade-enter"]]:n,[co["fade-leave-to"]]:l}),onClick:()=>{o(!1),d(!0)}}),Qi("div",{className:ps()(co["share-panel"],{[co["swipe-up-enter"]]:n,[co["swipe-up-leave-to"]]:l}),onTransitionEnd:()=>{d(!1),l&&r(s)},style:{"--height":"100%"},children:[e===So.SlideScreenshot&&Ki(fo,{shareLink:t,onDownloadClick:c,sharePanelOptions:i}),e===So.Social&&Ki(bo,{shareLink:t,onShareComplete:c,sharePanelOptions:i}),Ki("div",{className:co["share-panel-separator"]})]})]})},Oo=({storyManager:e})=>{var t,r,i,s;const n=(0,Si.useRef)(null),{desktopMode:a,gameReaderViewModel:l}=Vs({storyManager:e}),{sharePanelOpeningParams:d,handleShareComplete:c,closeSharePanel:u}=(e=>{const[t,r]=(0,Si.useState)(null);return(0,Si.useEffect)((()=>(null==e||e.on("openSharePanel",r),()=>{null==e||e.off("openSharePanel",r)})),[e]),{sharePanelOpeningParams:t,handleShareComplete:i=>{t&&e&&(e.confirmSharingComplete({shareId:t.shareId,isSuccess:i}),r(null))},closeSharePanel:()=>{r(null)}}})(l);if(!l||!l.isOpened)return null;const{backdrop:h,options:p,gameLaunch:f,gameLaunchError:g,isGameLoading:v,closeBtnVisible:m,sharePanelOptions:_}=l,y=ps()(qs["game-reader"],{[qs["desktop-mode"]]:a,[qs.loading]:!l.gameLaunchError&&l.isGameLoading}),w={background:h.background,opacity:h.opacity,filter:h.filter},b={backgroundColor:null===(t=p.game)||void 0===t?void 0:t.backdropColor,backgroundImage:(null===(r=null==f?void 0:f.splashScreen)||void 0===r?void 0:r.url)?`url(${f.splashScreen.url})`:void 0};return Ki("div",{className:qs["game-reader-container"],children:Qi("div",{className:y,children:[Ki("div",{className:qs["game-reader__backdrop"],style:w}),Qi(to,{className:qs["game-box"],desktopMode:a,verticalPadding:100,style:b,children:[g&&Ki(Ks,{className:qs.refresh,onClick:()=>{null==l||l.reload()}}),(v||m)&&Ki("button",{onClick:()=>{null==l||l.closeGame(),u()},className:qs["game-reader__close"],style:p.closeButtonPosition===o.LEFT?{left:"10px"}:{right:"10px"},dangerouslySetInnerHTML:{__html:null!==(s=null===(i=p.closeButton)||void 0===i?void 0:i.svgSrc.baseState)&&void 0!==s?s:""}}),f&&Qi(Hi,{children:[Ki("iframe",{src:f.url,onLoad:e=>{if(!l)throw new Error("GameReaderViewModel not yet initialized");n.current=e.target,l.setGameCenterIframe(n.current)},style:{opacity:v?0:1},frameBorder:"0",className:qs["game-iframe"],sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),d&&Ki(Co,{shareType:d.shareType,shareLink:d.shareLink,onShareCompelete:c,sharePanelOptions:_})]})]}),f&&p.forceCheckOrientation&&Ki(no,{orientation:Cr.PORTRAIT_PRIMARY,desktopMode:a,onOrientationChange:({isWrong:e})=>{(null==l?void 0:l.isGameInited)&&(e?l.pauseGameUI():l.resumeGameUI())}})]})})},ko=({storyManager:e})=>{(({storyManager:e})=>{const[,t]=(0,Si.useState)(0),[r,i]=(0,Si.useState)(null),s=()=>requestAnimationFrame((()=>t((e=>++e))));(0,Si.useEffect)((()=>{const t=e.createStoryReaderViewModel();return t.on("update",s),i(t),()=>{t.destroy()}}),[e])})({storyManager:e});return null},Lo=Ci().createContext({}),Mo=e=>Qi(Lo.Provider,{value:{storyManager:e.storyManager},children:[Ki(Oo,{storyManager:e.storyManager}),Ki(ko,{storyManager:e.storyManager}),e.children]}),Ao=()=>{const{storyManager:e}=(0,Si.useContext)(Lo);if(!e)throw new Error("You should use <IASContainer> component");return{storyManager:e}},xo=e=>{var t,r;const{storyManager:i}=Ao(),s=null!==(t=e.feedSlug)&&void 0!==t?t:"default",o=Le.DEFAULT,n=ts(Object.assign(Object.assign({},e),{storyManager:i,feedSlug:s,listType:o,isFavorite:!1}));return n?Ki(Us,Object.assign({},e,{storyManager:i,feedSlug:null!==(r=e.feedSlug)&&void 0!==r?r:"default",listType:Le.DEFAULT,storyListViewModel:n})):null},Eo=e=>{const{storyManager:t}=Ao(),r=Xr,i=Le.UGC,s=ts(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!1}));return s?Ki(Us,Object.assign({},e,{storyManager:t,listType:Le.UGC,feedSlug:Xr,storyListViewModel:s})):null},Io=e=>{const{storyManager:t}=Ao(),r="default",i=Le.DEFAULT,s=ts(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!0}));return s?Ki(Us,Object.assign({},e,{storyManager:t,feedSlug:r,listType:i,storyListViewModel:s,isFavorite:!0})):null}})(),__webpack_exports__})()));
22
+ */r(1513);var i=r(9155),s=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;s=o("react.element"),t.Fragment=o("react.fragment")}var n=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,r){var i,o={},d=null,c=null;for(i in void 0!==r&&(d=""+r),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,i)&&!l.hasOwnProperty(i)&&(o[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===o[i]&&(o[i]=t[i]);return{$$typeof:s,type:e,key:d,ref:c,props:o,_owner:n.current}}t.jsx=d,t.jsxs=d},1085:(e,t,r)=>{"use strict";e.exports=r(3335)},2591:(e,t,r)=>{"use strict";var i,s=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),n=[];function a(e){for(var t=-1,r=0;r<n.length;r++)if(n[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},i=[],s=0;s<e.length;s++){var o=e[s],l=t.base?o[0]+t.base:o[0],d=r[l]||0,c="".concat(l," ").concat(d);r[l]=d+1;var u=a(c),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(n[u].references++,n[u].updater(h)):n.push({identifier:c,updater:v(h,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 s=r.nc;s&&(i.nonce=s)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var n=o(e.insert||"head");if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(t)}return t}var c,u=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function h(e,t,r,i){var s=r?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=u(t,s);else{var o=document.createTextNode(s),n=e.childNodes;n[t]&&e.removeChild(n[t]),n.length?e.insertBefore(o,n[t]):e.appendChild(o)}}function p(e,t,r){var i=r.css,s=r.media,o=r.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var f=null,g=0;function v(e,t){var r,i,s;if(t.singleton){var o=g++;r=f||(f=d(t)),i=h.bind(null,r,o,!1),s=h.bind(null,r,o,!0)}else r=d(t),i=p.bind(null,r,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<r.length;i++){var s=a(r[i]);n[s].references--}for(var o=l(e,t),d=0;d<r.length;d++){var c=a(r[d]);0===n[c].references&&(n[c].updater(),n.splice(c,1))}r=o}}}},4862:function(e,t){"use strict";var r;void 0===(r=function(){return function(e,t,r){let i,s;function o(){return r.userAgent.match(/ipad|iphone/i)}function n(e){i=t.createElement("textArea"),i.value=e,t.body.appendChild(i)}function a(){var r,s;o()?((r=t.createRange()).selectNodeContents(i),(s=e.getSelection())&&(s.removeAllRanges(),s.addRange(r)),i.setSelectionRange(0,999999)):i.select()}function l(){t.execCommand("copy"),t.body.removeChild(i)}return s=function(e){n(e),a(),l()},{copy:s}}(window,document,navigator)}.apply(t,[]))||(e.exports=r)},5304:(e,t,r)=>{"use strict";r.d(t,{eJ:()=>n,gP:()=>s});var i=r(2535);function s(e){let t=window.isSecureContext;return void 0===t&&"https:"===window.location.protocol&&(t=!0),t?e:e.replace(/^https:\/\//,"http://")}function o(e){return e.map((e=>function(e){var t,r,o;if(!e.url)return null;let n={"font-family":null!==(t=e.family)&&void 0!==t?t:"normal",src:`url('${s(String(e.url))}')`,"font-style":null!==(r=e.style)&&void 0!==r?r:"normal","font-weight":null!==(o=e.weight)&&void 0!==o?o:"normal"};e.title&&(n.src+=`, local('${e.title}')`);return`@font-face {${(0,i.ky)(n)}}\n`}(e))).filter(Boolean).join("")}function n(e){"fonts"in document?e.forEach((e=>{const t=new FontFace(e.family,`url(${e.url})`,{style:e.style,weight:e.weight,display:"block"});document.fonts.add&&document.fonts.add(t),t.load()})):function(e){const t=o(e);if(null!=t){const e="stories-font-style";let r=document.getElementById(e);null===r?(r=document.createElement("style"),r.type="text/css",r.id=e,r.attributes.setNamedItem(document.createAttribute("scoped")),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t)),document.body.appendChild(r)):r.styleSheet?r.styleSheet.cssText=t:(r.textContent="",r.appendChild(document.createTextNode(t)))}}(e)}},5474:(e,t,r)=>{"use strict";r.d(t,{C:()=>i,F:()=>o});const i={baseUrl:"https://sdk.inappstory.ru",apiUrl:"https://api.inappstory.ru",faviconApiUrl:"https://favicon.inappstory.ru"};function s(e){if(e.length>32)try{const t=function(e){const t=(e=e.replace(new RegExp("-","g"),"+").replace(new RegExp("_","g"),"/")).length;return e=function(e,t,r){return void 0===t?e:t.length>=e.length?t:r?(e+t).slice(-e.length):(t+e).substring(0,e.length)}(new Array(t%4).fill("=").join(""),e,!1),window.atob(e)}(e),r=t.charCodeAt(13);if(r>0){let e=t.substr(14,r);e=e.replace(/\0+$/,"");const i="{QQN{xuV?1Dv16j3";let s=i,o=0;for(;s.length<r;)s+=i[o],o++,o===i.length&&(o=0);let n="";for(let t=0;t<r;t++)n+=String.fromCharCode(e.charCodeAt(t)^s.charCodeAt(t));return new URL(`https://${n}`).host}}catch(e){console.error(e)}return null}function o(e){const t=s(e);if(null!=t){const e=t.split(".").slice(1);i.baseUrl=`https://${["sdk",...e].join(".")}`,i.faviconApiUrl=`https://${["favicon",...e].join(".")}`,i.apiUrl=`https://${t}`}}},2965:(e,t,r)=>{"use strict";r.d(t,{Ue:()=>g,Tl:()=>l,YB:()=>v,JG:()=>d,qR:()=>p,rN:()=>f,Fn:()=>h,ib:()=>c,by:()=>u});var i=r(2840);class s 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 o="en-US";class n{constructor(e=o){const t=this.normalizeAndEnsureCompatibility(e),r=this.validateTag(t);this.parseTag(r)}isValidTag(e){return/^[a-z]+-[a-zA-Z]+$/.test(e)}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 s(e).message),this.getNavigatorTag())}getNavigatorTag(){const e=navigator.language.toLowerCase();return this.isValidTag(e)?e:(console.error(`Invalid navigator language tag: ${e}`),o)}parseTag(e){const[t,r]=e.split("-");this.languageCode=t,this.countryCode=r.toUpperCase(),this.tag=`${this.languageCode}-${this.countryCode}`}}const a={apiKey:"",disableStatistic:!1,disableDeviceId:!1,lang:new n},l=(0,i.createStore)(a),d=(0,i.createEvent)();l.on(d,((e,t)=>Object.assign(Object.assign({},t),{lang:new n(t.lang)})));const c=(0,i.createEvent)();l.on(c,((e,{tags:t})=>Object.assign(Object.assign({},e),{tags:t})));const u=(0,i.createEvent)();l.on(u,((e,{userId:t})=>Object.assign(Object.assign({},e),{userId:t})));const h=(0,i.createEvent)();l.on(h,((e,{placeholders:t})=>Object.assign(Object.assign({},e),{placeholders:t})));const p=(0,i.createEvent)();l.on(p,((e,{imagePlaceholders:t})=>Object.assign(Object.assign({},e),{imagePlaceholders:t})));const f=(0,i.createEvent)();l.on(f,((e,{lang:t})=>Object.assign(Object.assign({},e),{lang:new n(t)})));const g=(0,i.createStore)(""),v=(0,i.createEvent)();(0,i.forward)({from:v,to:g})},4269:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var events__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(46),events__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__),_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9156),_ias_rpc__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8169),_md5__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(1650),_src_stories_widget_helpers_media__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(5304),_src_storyManager_api_domains__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5474),_src_storyManager_models_storyManagerConfig__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(2965),__awaiter=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},Events,BlobType;(0,_ias_rpc__WEBPACK_IMPORTED_MODULE_4__.A)(window),function(e){e.START_LOADER="startLoader",e.END_LOADER="endLoader"}(Events||(Events={})),BlobType||(BlobType={});class Widget extends events__WEBPACK_IMPORTED_MODULE_0__.EventEmitter{get loaderContainer(){if(!this._loaderContainer){const e=document.createElement("div");this.obj&&(this.obj.style.position="relative"),e.style.position="absolute",e.style.left=e.style.top=e.style.right=e.style.bottom="0px",e.style.pointerEvents="none",this.obj&&this.obj.prepend(e),this._loaderContainer=e}return this._loaderContainer}setCallbacks(e){this.callbacks=e}constructor(e,t){super(),this._options=t,this.callbacks={},this._loaderContainer=null,this.objId=e;let r=null;r="body"===e?document.body:document.querySelector(e),r&&(this.obj=r)}set options(e){this._options=Object.assign(Object.assign({},this._options),e)}get options(){return this._options}init(e){return __awaiter(this,void 0,void 0,(function*(){const t={},r={},i={},s=()=>{};return new Promise(((o,n)=>{this.__init(e,t,{},r,i,s,null,null,o,n)}))}))}__init(e,t,r,i,s,o,n,a,l,d){var c,u;return __awaiter(this,void 0,void 0,(function*(){t=t||{},i=i||{};const h=this.objId,p=this;let f=null;if(f="body"===h?document.body:document.querySelector(h),!f){let c=a||0;return c>10?void d("IAS.Widget: object: `"+h+"` not found."):void requestAnimationFrame((()=>{p.__init(e,t,r,i,s,o,n,c+1,l,d)}))}this.widgetId=n||++Widget.count,s=s||{},i=i||{},(e=e||{}).preview&&(t.preview=1,delete e.preview);e.base_domain||IAS_OLD._protocol;var g,v,m="auto"===e.width?0|(f.clientWidth||f.offsetWidth||s.minWidth):parseInt(e.width||0,10);const _=m?Math.max(s.minWidth||200,Math.min(s.maxWidth||1e4,m))+"px":"100%";this.objSavedStyles=f.style.cssText,s.fullScreen||(f.style.width=_,f.style.overflow="hidden",e.height?(t.height=e.height,f.style.height=e.height+"px"):f.style.height=(s.startHeight||200)+"px",e.overflowTouch&&(f.style.overflow="auto",f.style["-webkit-overflow-scrolling"]="touch")),"100%"===_&&(t.startWidth=0|(f.clientWidth||f.offsetWidth)),t.url||(t.url=e.pageUrl||location.href.replace(/#.*$/,"")),t.url=t.url||"",t.referrer=t.referrer||document.referrer||"",t.title=t.title||document.title||"",t.userId=t.userId||"",t.origin=window.location.protocol+"//"+window.location.hostname;const{nonce:y}=_src_storyManager_models_storyManagerConfig__WEBPACK_IMPORTED_MODULE_3__.Tl.getState(),w={html:this.getWidgetDocument(r,y),css:null!==(c=t.extraCss)&&void 0!==c?c:null,js:null!==(u=t.extraJs)&&void 0!==u?u:null,nonce:y};let b=this.getGeneratedPageURL(w);i.onStartLoading&&i.onStartLoading(),i.showLoader=function(e){IAS_OLD.Util.Loader(e)},i.publish=function(){var e=Array.prototype.slice.call(arguments);e.push(p.widgetId),IAS_OLD.Observer.publish.apply(IAS_OLD.Observer,e)},i.onInit=function(){e.onReady&&e.onReady()},i.hideLoader=function(){},i.resize=function(e,t){if(f){f.style.height=e+"px";var r=document.getElementById("iaswidget"+p.widgetId);r&&(r.style.height=e+"px")}},i.resizeWidget=function(t,r){const i=parseInt(t),s=parseInt(r);var o=document.getElementById("iaswidget"+p.widgetId);isFinite(i)&&f&&(f.style.width=i+"px",o&&(o.style.width=i+"px")),isFinite(s)&&f&&(f.style.height=s+"px",o&&(o.style.height=s+"px")),e.onResizeWidget&&e.onResizeWidget()},g=IAS_OLD.Widget.RPC[p.widgetId]=new window.iasRPC.Server(i,(function(e){return!e||(e=e.toLowerCase(),!0)}),{safe:!0});const S={src:"",id:"iaswidget"+p.widgetId,allowTransparency:e.allowTransparency||!1,style:{backgroundColor:e.backgroundColor||"transparent"}};s.fullScreen?(S.style.position="fixed",S.style.left=0,S.style.top=0,S.style.padding=0,S.style.border=0,S.style.zIndex=1002,S.style.width="100%",S.style.height="100%"):(S.width=-1!=_.indexOf("%")?_:parseInt(_)||_,S.height=s.startHeight||"100%",S.style.width="1px",S.style.minWidth="100%",S.style["*width"]="100%"),s.scrolling?S.scrolling="yes":(S.scrolling="no",S.style.overflow="hidden"),s.hidden&&(S.style.display="none"),S.style.colorScheme="auto",(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.uM)()?S.srcdoc=b.srcdoc:S.src=b.src,v=IAS_OLD.Widget.RPC[p.widgetId].append(f,S),this.emit("ready"),this.on("widgetLoaded",(()=>{requestAnimationFrame((()=>{o&&o(f,v||(null==f?void 0:f.firstChild),g),l(!0)}))}))}))}_destroyClientWidget(){}destroy(){try{this._destroyClientWidget(),requestAnimationFrame((()=>{try{const e=IAS_OLD.Widget.RPC[this.widgetId];e&&e.destroy(),this.obj&&(this.obj.innerHTML="",this.obj.style.cssText=this.objSavedStyles)}catch(e){console.error(e)}}))}catch(e){console.error(e)}}showBoxUrl(e,t){return(e=(e||IAS_OLD._protocol+"//sdk-narrator.kiozk.ru").replace(/\/?\s*$/,""))+"/"+(t=t.replace(/^\s*\/?/,""))}startLoader(){let e=(0,_src_stories_widget_helpers_media__WEBPACK_IMPORTED_MODULE_5__.gP)(`${_src_storyManager_api_domains__WEBPACK_IMPORTED_MODULE_2__.C.baseUrl}/v0.2.3/dist/loader.gif`);this.loaderContainer.style.background=`url("${e}") center center no-repeat transparent`}stopLoader(){this.loaderContainer.style.display="none"}getGeneratedPageURL({html:e,css:t,js:r,nonce:i}){let s="",o="";null!==t&&(s=`<link rel="stylesheet" type="text/css" href="${(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.jp)(t,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.Vd.CSS)}" />`),null!==r&&(o=`<script nonce="${i}">${(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.jp)(r,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.Vd.JS)}<\/script>`);const n=`\n <html>\n <head>\n <base href="${document.baseURI}"></base>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <script nonce="${i}">__webpack_nonce__ = "${i}";<\/script>\n ${s}\n ${o}\n </head>\n <body>\n ${e||""}\n </body>\n </html>\n `;null!==t&&(s=`<style nonce="${i}">${t}</style>`),null!==r&&(o=`<script nonce="${i}">${r}<\/script>`);let a=`\n <html>\n <head>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <script nonce="${i}">__webpack_nonce__ = "${i}";<\/script>\n ${s}\n ${o}\n </head>\n <body>\n ${e||""}\n </body>\n </html>\n `;return{src:(0,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.jp)(n,_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.Vd.HTML),srcdoc:a}}getWidgetDocument(e,t){return""}}Widget.count=0,Widget.RPC={};const __WEBPACK_DEFAULT_EXPORT__=Widget;class IAS_OLD{}if(IAS_OLD.version="v1",IAS_OLD.MD5=_md5__WEBPACK_IMPORTED_MODULE_6__.F,IAS_OLD.extend=_src_storyManager_widget_utils__WEBPACK_IMPORTED_MODULE_1__.X$,IAS_OLD._protocol="https:",IAS_OLD._base_domain="",IAS_OLD.Widget=Widget,IAS_OLD.xdConnectionCallbacks?setTimeout((function(){for(var e;e=IAS_OLD.xdConnectionCallbacks.pop();)e()}),0):(IAS_OLD.extend(IAS_OLD,{version:1,_apiKey:null,_session:null,_domain:{main:IAS_OLD._protocol+"//sdk-narrator.kiozk.ru/",api:IAS_OLD._protocol+"//api-narrator.kiozk.ru/"},_path:{login:"authorize",proxy:"fxdm_oauth_proxy.html"},_rootId:"ias_api_transport",_nameTransportPath:"",xdReady:!1}),IAS_OLD.init=function(e){if(IAS_OLD._apiKey=null,!e.apiKey)throw Error("IAS_OLD.init() called without an apiKey");return IAS_OLD._apiKey=e.apiKey,IAS_OLD.userId=e.userId,!0}),IAS_OLD.XDM||(IAS_OLD.XDM={remote:null,init:function(){if(this.remote)return!1;var e=IAS_OLD._domain.api+IAS_OLD._path.proxy;this.remote=new window.iasRPC.Server({onInit:function(){IAS_OLD.xdReady=!0,IAS_OLD.Observer.publish("xdm.init")}}),this.remote.append(document.getElementById(IAS_OLD._rootId),{src:e})},xdHandler:function(code){try{eval("IAS_OLD."+code)}catch(e){}}}),IAS_OLD.Observer||(IAS_OLD.Observer={_subscribers:function(){return this._subscribersMap||(this._subscribersMap={}),this._subscribersMap},publish:function(){var e,t,r=Array.prototype.slice.call(arguments),i=r.shift(),s=this._subscribers()[i];if(s)for(e=0,t=s.length;e<t;e++)null!=s[e]&&s[e].apply(this,r)},subscribe:function(e,t){var r=this._subscribers();if("function"!=typeof t)return!1;r[e]?r[e].push(t):r[e]=[t]},unsubscribe:function(e,t){var r,i,s=this._subscribers()[e];if(!s)return!1;if("function"==typeof t)for(r=0,i=s.length;r<i;r++)s[r]==t&&(s[r]=null);else delete this._subscribers()[e]}}),IAS_OLD.Util||(IAS_OLD.Util={getStyle:function(e,t){var r,i=document.defaultView||window;if(i.getComputedStyle){t=t.replace(/([A-Z])/g,"-$1").toLowerCase();var s=i.getComputedStyle(e,null);s&&(r=s.getPropertyValue(t))}else if(e.currentStyle){var o=t.replace(/\-(\w)/g,(function(e,t){return t.toUpperCase()}));r=e.currentStyle[t]||e.currentStyle[o]}return r},getXY:function(e,t){if(e&&void 0!==e){var r=0,i=0;if(void 0!==e.getBoundingClientRect){var s=e.getBoundingClientRect();r=s.left,i=s.top,t=!0}else if(e.offsetParent)do{r+=e.offsetLeft,i+=e.offsetTop,t&&(r-=e.scrollLeft,i-=e.scrollTop)}while(e=e.offsetParent);return t&&(i+=window.pageYOffset||window.scrollNode&&window.scrollNode.scrollTop||document.documentElement.scrollTop,r+=window.pageXOffset||window.scrollNode&&window.scrollNode.scrollLeft||document.documentElement.scrollLeft),[r,i]}},Loader:function e(t){e.loader||((e.loader=document.createElement("DIV")).innerHTML='<style type="text/css"> @-webkit-keyframes IAS_OLDWidgetsLoaderKeyframes {0%{opacity: 0.2;}30%{opacity: 1;}100%{opacity: 0.2;}} @keyframes IAS_OLDWidgetsLoaderKeyframes {0%{opacity: 0.2;}30%{opacity: 1;}100%{opacity: 0.2;}} .IAS_OLDWidgetsLoader div {width: 7px;height: 7px;-webkit-border-radius: 50%;-khtml-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;background: #fff;top: 21px;position: absolute;z-index: 2;-o-transition: opacity 350ms linear; transition: opacity 350ms linear;opacity: 0.2;-webkit-animation-duration: 750ms;-o-animation-duration: 750ms;animation-duration: 750ms;-webkit-animation-name: IAS_OLDWidgetsLoaderKeyframes;-o-animation-name: IAS_OLDWidgetsLoaderKeyframes;animation-name: IAS_OLDWidgetsLoaderKeyframes;-webkit-animation-iteration-count: infinite;-o-animation-iteration-count: infinite;animation-iteration-count: infinite;-webkit-transform: translateZ(0);transform: translateZ(0);}</style><div class="IAS_OLDWidgetsLoader" style="position: fixed;left: 50%;top: 50%;margin: -25px -50px;z-index: 1002;height: 50px;width: 100px;"><div style="left: 36px;-webkit-animation-delay: 0ms;-o-animation-delay: 0ms;animation-delay: 0ms;"></div><div style="left: 47px;-webkit-animation-delay: 180ms;-o-animation-delay: 180ms;animation-delay: 180ms;"></div><div style="left: 58px;-webkit-animation-delay: 360ms;-o-animation-delay: 360ms;animation-delay: 360ms;"></div><span style="display: block;background-color: #000;-webkit-border-radius: 4px;-khtml-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;-webkit-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.35);-moz-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.35);box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.35);position: absolute;left: 0;top: 0;bottom: 0; right: 0;z-index: 1;opacity: 0.7;"></span></div>',document.body.insertBefore(e.loader,document.body.firstChild)),e.loader.style.display=t?"block":"none"},addEvent:function(e,t,r){(r=r||window.document).addEventListener?r.addEventListener(e,t,!1):r.attachEvent&&r.attachEvent("on"+e,t)},removeEvent:function(e,t,r){(r=r||window.document).removeEventListener?r.removeEventListener(e,t,!1):r.detachEvent&&r.detachEvent("on"+e,t)},ss:function(e,t){IAS_OLD.extend(e.style,t,!0)},getScroll:function(){if(void 0!==window.pageYOffset)return[pageXOffset,pageYOffset];var e=document,t=e.documentElement,r=e.body;return[t.scrollLeft||r.scrollLeft||0,t.scrollTop||r.scrollTop||0]}}),window.IAS_OLDReady&&window.IAS_OLDReady._e)for(let e=0;e<window.IAS_OLDReady._e.length;e++)setTimeout(window.IAS_OLDReady._e[e],0);window.iasAsyncInitCallbacks&&window.iasAsyncInitCallbacks.length&&setTimeout((function(){for(var e;e=window.iasAsyncInitCallbacks.pop();)try{e()}catch(e){try{console.error(e)}catch(e){}}}),0)},9156:(e,t,r)=>{"use strict";function i(e,t,r){for(const i in t)t.hasOwnProperty(i)&&(r||void 0===e[i])&&(e[i]=t[i]);return e}var s;function o(e,t){const r=new Blob([e],{type:t});return URL.createObjectURL(r)}r.d(t,{Vd:()=>s,X$:()=>i,jp:()=>o,uM:()=>l}),function(e){e.CSS="text/css",e.JS="text/javascript",e.HTML="text/html"}(s||(s={}));let n=!1,a=!1;const l=()=>{if(!a){const e=document.createElement("iframe");n="srcdoc"in e,a=!0}return n}},2535:(e,t,r)=>{"use strict";function i(e){return Object.keys(e).reduce(((t,r)=>t+r.split(/(?=[A-Z])/).join("-").toLowerCase()+":"+e[r]+";"),"")}r.d(t,{ky:()=>i})},8169:(e,t,r)=>{"use strict";function i(e){if(!e.iasRPC){var t={},r=[],i={};e.iasRPC={_id:0,Server:function(r,i,s){this.methods=r||{},this.filter=i,this.options=s||{},this.id=e.iasRPC._id++,this.key=function(){for(var e="",t=0;t<5;t++)e+=Math.ceil(15*Math.random()).toString(16);return e}(),this.frameName="fXD"+this.key,this.server=!0;var o=this;this.methods["%init%"]=this.methods.__fxdm_i=function(){e.iasRPC.run(o.id),o.methods.onInit&&o.methods.onInit()},t[this.key]=[l,this]},Client:function(r,i){if(this.methods=r||{},this.options=i||{},this.id=e.iasRPC._id++,this.client=!0,e.iasRPC.run(this.id),0!==window.name.indexOf("fXD"))throw Error("Wrong window.name property.");this.key=window.name.substr(3),this.caller=window.parent,t[this.key]=[l,this],e.iasRPC.on("helper",(function(){e.iasRPC.onClientStart(this)}),this),n((function(e){e.send(this,e.json.stringify(["%init%"]));var t=this.methods;setTimeout((function(){t.onInit&&t.onInit()}),0)}),this)},onMessage:function(e){var r=e.data;if(!r)return!1;if("string"!=typeof r&&!(r instanceof String))return!1;var i=r.substr(0,5);if(t[i]){var s=t[i][1];!s||s.filter&&!s.filter(e.origin)||t[i][0](r.substr(6),s)}},setJSON:function(e){i.json=e},getJSON:function(e){if(!e)return i.json;n((function(t){e(t.json)}))},setEnv:function(e){for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);a()},_q:{},on:function(e,t,r){this._q[e]||(this._q[e]=[]),-1==this._q[e]?t.apply(r):this._q[e].push([t,r])},run:function(e){for(var t=(this._q[e]||[]).length,r=0;r<t;r++)this._q[e][r][0].apply(this._q[e][r][1]);this._q[e]=-1},waitFor:s},e.iasRPC.Server.prototype.start=function(t,r){if(t.contentWindow)this.caller=t.contentWindow,this.frame=t,e.iasRPC.on("helper",(function(){e.iasRPC.onServerStart(this)}),this);else{var i=this;(r=r||0)<50&&setTimeout((function(){i.start.apply(i,[t,r+1])}),100)}},e.iasRPC.Server.prototype.destroy=function(){delete t[this.key]},e.iasRPC.Server.prototype.append=function(e,t,r){var i=document.createElement("div");i.innerHTML='<iframe name="'+this.frameName+'" '+(r||"")+"></iframe>";var s=i.firstChild,o=this;return setTimeout((function(){s.frameBorder="0",t&&d(s,t),e.insertBefore(s,e.firstChild),o.start(s)}),0),s},e.iasRPC.Client.prototype.callMethod=e.iasRPC.Server.prototype.callMethod=function(){for(var t=Array.prototype.slice.call(arguments),r=t.shift(),i=0,a=t.length;i<a;i++)if("function"==typeof t[i]){this.funcsCount=(this.funcsCount||0)+1;var l=t[i],d="_func"+this.funcsCount;this.methods[d]=function(){l.apply(this,arguments),delete this.methods[d]},t[i]={_func:this.funcsCount}}else this.options.safe&&(t[i]=o(t[i],!0));s(this,"caller",(function(){e.iasRPC.on(this.id,(function(){n((function(e){e.send(this,e.json.stringify([r,t]))}),this)}),this)}),this)},i.json={parse:e.JSON.parse,stringify:e.JSON.stringify},e.postMessage&&(i.protocol="p",i.send=function(e,t){var r=e.frame?e.frame.contentWindow:e.caller;if(r)try{r.postMessage(e.key+":"+t,"*")}catch(i){window.postMessage.call(r,e.key+":"+t,"*")}},e.addEventListener?e.addEventListener("message",e.iasRPC.onMessage,!1):e.attachEvent("onmessage",e.iasRPC.onMessage),a())}function s(e,t,r,i,o){e[t]?r.apply(i):(o=o||0)<1e3&&setTimeout((function(){s(e,t,r,i,o+1)}),0)}function o(e,t){var r;switch(typeof e){case"string":r=t?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):e.replace(/&#039;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&");break;case"object":if(null===e)r=e;else if("[object Array]"===Object.prototype.toString.apply(e)){r=[];for(var i=0,s=e.length;i<s;i++)r[i]=o(e[i],t)}else for(var n in r={},e)Object.hasOwnProperty.call(e,n)&&(r[n]=o(e[n],t));break;default:r=e}return r}function n(e,t){i.loaded?e.apply(t,[i]):r.push([t,e])}function a(){i.loaded=!0;for(var e=0,t=r.length;e<t;e++)r[e][1].apply(r[e][0],[i])}function l(e,t){n((function(r){var i=r.json.parse(e);if(i[0]){i[1]||(i[1]=[]);for(var s=0,n=i[1].length;s<n;s++)if(i[1][s]&&i[1][s]._func){var a=i[1][s]._func;i[1][s]=function(){var e=Array.prototype.slice.call(arguments);e.unshift("_func"+a),t.callMethod.apply(t,e)}}else t.options.safe&&(i[1][s]=o(i[1][s],!1));setTimeout((function(){if(!t.methods[i[0]])throw Error("iasRPC: Method "+i[0]+" is undefined");t.methods[i[0]].apply(t,i[1])}),0)}}))}function d(e,t){for(var r in t)e[r]&&"object"==typeof e[r]?d(e[r],t[r]):e[r]=t[r]}}r.d(t,{A:()=>i})},1650:(e,t,r)=>{"use strict";function i(e){var t,r=function(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r},i=function(e,t,i,s,o,n){return r(function(e,t){return e<<t|e>>>32-t}(r(r(t,e),r(s,n)),o),i)},s=function(e,t,r,s,o,n,a){return i(t&r|~t&s,e,t,o,n,a)},o=function(e,t,r,s,o,n,a){return i(t&s|r&~s,e,t,o,n,a)},n=function(e,t,r,s,o,n,a){return i(t^r^s,e,t,o,n,a)},a=function(e,t,r,s,o,n,a){return i(r^(t|~s),e,t,o,n,a)};return function(e){for(var t,r="0123456789abcdef",i="",s=0,o=e.length;s<o;s++)t=e.charCodeAt(s),i+=r.charAt(t>>>4&15)+r.charAt(15&t);return i}(function(e){for(var t="",r=0,i=32*e.length;r<i;r+=8)t+=String.fromCharCode(e[r>>5]>>>r%32&255);return t}(function(e,t){var i,l,d,c,u=1732584193,h=-271733879,p=-1732584194,f=271733878;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var g=0,v=e.length;g<v;g+=16)i=u,l=h,d=p,c=f,u=s(u,h,p,f,e[g+0],7,-680876936),f=s(f,u,h,p,e[g+1],12,-389564586),p=s(p,f,u,h,e[g+2],17,606105819),h=s(h,p,f,u,e[g+3],22,-1044525330),u=s(u,h,p,f,e[g+4],7,-176418897),f=s(f,u,h,p,e[g+5],12,1200080426),p=s(p,f,u,h,e[g+6],17,-1473231341),h=s(h,p,f,u,e[g+7],22,-45705983),u=s(u,h,p,f,e[g+8],7,1770035416),f=s(f,u,h,p,e[g+9],12,-1958414417),p=s(p,f,u,h,e[g+10],17,-42063),h=s(h,p,f,u,e[g+11],22,-1990404162),u=s(u,h,p,f,e[g+12],7,1804603682),f=s(f,u,h,p,e[g+13],12,-40341101),p=s(p,f,u,h,e[g+14],17,-1502002290),h=s(h,p,f,u,e[g+15],22,1236535329),u=o(u,h,p,f,e[g+1],5,-165796510),f=o(f,u,h,p,e[g+6],9,-1069501632),p=o(p,f,u,h,e[g+11],14,643717713),h=o(h,p,f,u,e[g+0],20,-373897302),u=o(u,h,p,f,e[g+5],5,-701558691),f=o(f,u,h,p,e[g+10],9,38016083),p=o(p,f,u,h,e[g+15],14,-660478335),h=o(h,p,f,u,e[g+4],20,-405537848),u=o(u,h,p,f,e[g+9],5,568446438),f=o(f,u,h,p,e[g+14],9,-1019803690),p=o(p,f,u,h,e[g+3],14,-187363961),h=o(h,p,f,u,e[g+8],20,1163531501),u=o(u,h,p,f,e[g+13],5,-1444681467),f=o(f,u,h,p,e[g+2],9,-51403784),p=o(p,f,u,h,e[g+7],14,1735328473),h=o(h,p,f,u,e[g+12],20,-1926607734),u=n(u,h,p,f,e[g+5],4,-378558),f=n(f,u,h,p,e[g+8],11,-2022574463),p=n(p,f,u,h,e[g+11],16,1839030562),h=n(h,p,f,u,e[g+14],23,-35309556),u=n(u,h,p,f,e[g+1],4,-1530992060),f=n(f,u,h,p,e[g+4],11,1272893353),p=n(p,f,u,h,e[g+7],16,-155497632),h=n(h,p,f,u,e[g+10],23,-1094730640),u=n(u,h,p,f,e[g+13],4,681279174),f=n(f,u,h,p,e[g+0],11,-358537222),p=n(p,f,u,h,e[g+3],16,-722521979),h=n(h,p,f,u,e[g+6],23,76029189),u=n(u,h,p,f,e[g+9],4,-640364487),f=n(f,u,h,p,e[g+12],11,-421815835),p=n(p,f,u,h,e[g+15],16,530742520),h=n(h,p,f,u,e[g+2],23,-995338651),u=a(u,h,p,f,e[g+0],6,-198630844),f=a(f,u,h,p,e[g+7],10,1126891415),p=a(p,f,u,h,e[g+14],15,-1416354905),h=a(h,p,f,u,e[g+5],21,-57434055),u=a(u,h,p,f,e[g+12],6,1700485571),f=a(f,u,h,p,e[g+3],10,-1894986606),p=a(p,f,u,h,e[g+10],15,-1051523),h=a(h,p,f,u,e[g+1],21,-2054922799),u=a(u,h,p,f,e[g+8],6,1873313359),f=a(f,u,h,p,e[g+15],10,-30611744),p=a(p,f,u,h,e[g+6],15,-1560198380),h=a(h,p,f,u,e[g+13],21,1309151649),u=a(u,h,p,f,e[g+4],6,-145523070),f=a(f,u,h,p,e[g+11],10,-1120210379),p=a(p,f,u,h,e[g+2],15,718787259),h=a(h,p,f,u,e[g+9],21,-343485551),u=r(u,i),h=r(h,l),p=r(p,d),f=r(f,c);return[u,h,p,f]}(function(e){var t,r,i=Array(e.length>>2);for(t=0,r=i.length;t<r;t++)i[t]=0;for(t=0,r=8*e.length;t<r;t+=8)i[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return i}(t=function(e){for(var t,r,i="",s=-1,o=e.length;++s<o;)t=e.charCodeAt(s),r=s+1<o?e.charCodeAt(s+1):0,55296<=t&&t<=56319&&56320<=r&&r<=57343&&(t=65536+((1023&t)<<10)+(1023&r),s++),t<=127?i+=String.fromCharCode(t):t<=2047?i+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?i+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(i+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return i}(e)),8*t.length)))}r.d(t,{F:()=>i})},8384:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__8384__},992:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__992__},2840:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__2840__},9780:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__9780__},9155:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__9155__},7315:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__7315__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";var e,t,r,i;__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AppearanceManager:()=>O,FavoriteStoryList:()=>Uo,IASContainer:()=>Do,StoryCardViewModel:()=>_r,StoryList:()=>Fo,StoryListViewModel:()=>Sr,StoryManager:()=>gi,UGCStoryList:()=>No}),function(e){e.LEFT="left",e.RIGHT="right"}(e||(e={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(t||(t={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(r||(r={})),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"}(i||(i={}));e.RIGHT,t.FLAT,r.CIRCLE,r.CIRCLE;var s;!function(e){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"}(s||(s={}));var o,n=__webpack_require__(46);!function(e){e.LEFT="left",e.RIGHT="right"}(o||(o={}));const a={hasFavorite:!1,hasLike:!1,hasShare:!1,closeButtonPosition:o.RIGHT,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};var l,d,c,u,h,p;!function(e){e.CENTER="center",e.LEFT="left",e.RIGHT="right"}(l||(l={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(d||(d={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(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.START_LOADER="startLoad",e.END_LOADER="endLoad"}(p||(p={}));const f={direction:"horizontal",card:{title:{font:'14px/1.2 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',color:"#ffffff",padding:15,textAlign:c.LEFT,position:u.CARD_INSIDE_BOTTOM,display:!0,lineClamp:3},gap:10,height:70,aspectRatio:null,coverQuality:h.High,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},coverLazyLoading:!1},favoriteCard:{title:{content:"Избранное",font:"normal",color:"#000",padding:15,textAlign:c.LEFT,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.LEFT},navigation:{speed:300,showControls:!1,controlsSize:48,controlsBackgroundColor:"white",controlsColor:"black"},ugcCard:{title:{content:null,font:'14px/1.2 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',color:"#000",padding:15,textAlign:c.LEFT,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"}};var g,v;!function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(g||(g={})),function(e){e.vk="vk",e.ok="ok",e.facebook="facebook",e.twitter="twitter",e.linkedin="linkedin",e.telegram="telegram"}(v||(v={}));const m={gameReaderOptions:{loader:{default:{color:"white",accentColor:"transparent"},custom:null}},scrollStyle:g.FLAT,timelineBlockTopOffset:8,actionPanelBottomOffset:0,borderRadius:12,loader:{default:{color:"white",accentColor:"transparent"},custom:null},recycleStoriesList:!1,closeOnLastSlideByTimer:!0,sharePanel:{targets:[...Object.values(v)],copyButton:{svgSrc:{baseState:'<svg width="31.5px" height="35px" 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>'}},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>'}}},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:"",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>'}},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>'}}},_={title:{content:"Favorite",font:"1.4rem/1.2 InternalPrimaryFont",color:"white",backgroundColor:"#333333"},headerTopOffset:0,bottomOffset:0,backgroundColor:"#333333"};var y,w=__webpack_require__(2743),b=__webpack_require__.n(w);!function(e){e.DEFAULT="default",e.CUSTOM_CARD="customCard"}(y||(y={}));const S={goodsWidgetRenderingType:y.DEFAULT,goodsList:{renderingType:y.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"}}},C={loader:{default:{color:"white",accentColor:"transparent"},custom:null},backdropColor:"#1a1a1a",backdrop:{opacity:1,background:"#1a1a1a"},game:{backdropColor:"rgb(51, 51, 51)"},forceDesktopMode:a.forceDesktopMode,forceCheckOrientation:!0};class O extends n.EventEmitter{constructor(){super(),this._commonOptions=a,this._storiesListOptions=f,this._storyReaderOptions=m,this._storyFavoriteReaderOptions=_,this._goodsWidgetOptions=S,this._gameReaderOptions=C,this._mqls=new Map,this._composeOptionsOverrideByMediaQuery=this._composeOptionsOverrideByMediaQuery.bind(this)}setCommonOptions(e,t=!0){return this._commonOptions=b()(this._commonOptions,e),this.emit(s.EVENT_UPDATED_COMMON_OPTIONS,this.commonOptions),this}get commonOptions(){return this._commonOptions}setStoriesListOptions(e,t=!0){return this._storiesListOptions=b()(this._storiesListOptions,e),t&&this.emit(s.EVENT_UPDATED_STORIES_LIST_OPTIONS,this.storiesListOptions),this}get storiesListOptions(){return this._storiesListOptions}setStoryReaderOptions(e,t=!0){return this._storyReaderOptions=b()(this._storyReaderOptions,e,{arrayMerge:(e,t,r)=>t}),t&&this.emit(s.EVENT_UPDATED_STORY_READER_OPTIONS,{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=b()(this._storyFavoriteReaderOptions,e),t&&this.emit(s.EVENT_UPDATED_FAVORITE_READER_OPTIONS,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=b()(this._goodsWidgetOptions,e),t&&this.emit(s.EVENT_UPDATED_GOODS_WIDGET_OPTIONS,this.goodsWidgetOptions),this}get goodsWidgetOptions(){return this._goodsWidgetOptions}setGameReaderOptions(e,t=!0){return this._gameReaderOptions=b()(this._gameReaderOptions,e),t&&this.emit(s.EVENT_UPDATED_GAME_READER_OPTIONS,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)}setOptionsOverrideByMediaQuery(e){return this.removeMediaQueryEventListeners(),this.initMediaQueries(e),this}initMediaQueries(e){for(const t of e){const e=this._composeMqlCondition(t);if(null!==e&&null!=window.matchMedia){const r=window.matchMedia(e);this._mqls.set(r,t),r.addEventListener("change",this._composeOptionsOverrideByMediaQuery)}}this._composeOptionsOverrideByMediaQuery()}_composeMqlCondition(e){let t=null;if(null!=e.viewportMinSize){if("number"==typeof e.viewportMinSize)t=`(min-width: ${e.viewportMinSize}px)`;else if("string"==typeof e.viewportMinSize)switch(e.viewportMinSize){case"sm":t="(min-width: 576px)";break;case"md":t="(min-width: 768px)";break;case"lg":t="(min-width: 992px)";break;case"xl":t="(min-width: 1200px)";break;default:t=null}null!=e.mediaQuery&&"string"==typeof e.mediaQuery&&e.mediaQuery.length>0&&(t=e.mediaQuery)}return t}_composeOptionsOverrideByMediaQuery(e){const t=new Set;for(const[e,r]of this._mqls)e.matches&&(null!=r.commonOptions&&(this.setCommonOptions(r.commonOptions,!1),t.add("commonOptions")),null!=r.storiesListOptions&&(this.setStoriesListOptions(r.storiesListOptions,!0),t.add("storiesListOptions")),null!=r.storyReaderOptions&&(this.setStoryReaderOptions(r.storyReaderOptions,!1),t.add("storyReaderOptions")),null!=r.storyFavoriteReaderOptions&&(this.setStoryFavoriteReaderOptions(r.storyFavoriteReaderOptions,!1),t.add("storyFavoriteReaderOptions")),null!=r.goodsWidgetOptions&&(this.setGoodsWidgetOptions(r.goodsWidgetOptions,!1),t.add("goodsWidgetOptions")),null!=r.gameReaderOptions&&(this.setGameReaderOptions(r.gameReaderOptions,!1),t.add("gameReaderOptions")));t.forEach((e=>{switch(e){case"commonOptions":this.setCommonOptions({});break;case"storiesListOptions":this.setStoriesListOptions({});break;case"storyReaderOptions":this.setStoryReaderOptions({});break;case"storyFavoriteReaderOptions":this.setStoryFavoriteReaderOptions({});break;case"goodsWidgetOptions":this.setGoodsWidgetOptions({});break;case"gameReaderOptions":this.setGameReaderOptions({})}}))}removeMediaQueryEventListeners(){for(const e of this._mqls.keys())e.removeEventListener("change",this._composeOptionsOverrideByMediaQuery);this._mqls.clear()}destroy(){this.removeMediaQueryEventListeners()}}var k,L,M,A,x,E;!function(e){e.direct="direct",e.onboarding="onboarding",e.list="list",e.favorite="favorite"}(k||(k={})),function(e){e[e.default=0]="default",e[e.favorite=1]="favorite"}(L||(L={})),function(e){e[e.default=0]="default",e[e.onboarding=1]="onboarding",e[e.favorite=2]="favorite",e[e.direct=3]="direct"}(M||(M={})),function(e){e.list="list",e.favorite="favorite"}(A||(A={})),function(e){e.CLICK_ON_STORY="clickOnStoryLink"}(x||(x={})),function(e){e.TEXT="text",e.IMAGE="image"}(E||(E={}));var I=__webpack_require__(2965),R=__webpack_require__(2840),T=__webpack_require__(3142),P=__webpack_require__.n(T),D=__webpack_require__(1580),j=__webpack_require__.n(D);const F=(0,R.createStore)({default:{},user:{}}),{sdkPlaceholdersChanged:N,addDefaultPlaceholders:U}=(0,R.createApi)(F,{sdkPlaceholdersChanged:(e,t)=>({default:e.default,user:t}),addDefaultPlaceholders:(e,t)=>{let r={default:{},user:e.user};return P()(t)&&t.forEach((e=>{j()(e)&&void 0!==e.name&&void 0!==e.default_value&&(r.default[e.name]=e.default_value)})),r}});var B=__webpack_require__(3655),G=__webpack_require__.n(B),V=__webpack_require__(8138),z=__webpack_require__.n(V),W=__webpack_require__(986),q=__webpack_require__.n(W),$=__webpack_require__(4269);class Z{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._disableOverFlow(),this._setElementAttributes("body","paddingRight",(t=>t+e))}_disableOverFlow(){const e=this.window.document.body.style.overflow;e&&(this.window.document.body.dataset.overflow=e),this.window.document.body.style.overflow="hidden"}_setElementAttributes(e,t,r){const i=this.width;this.window.document.querySelectorAll(e).forEach((e=>{if(e!==this.window.document.body&&this.window.innerWidth>e.clientWidth+i)return;const s=e.style[t],o=this.window.getComputedStyle(e)[t];e.dataset[t]=s,e.style[t]=`${r(Number.parseFloat(o))}px`}))}resetScrollbar(){this._resetElementAttributes("body","overflow"),this._resetElementAttributes("body","paddingRight")}_resetElementAttributes(e,t){this.window.document.querySelectorAll(e).forEach((e=>{const r=e.dataset[t];void 0===r?e.style.removeProperty(t):(delete e.dataset[t],e.style[t]=r)}))}}var H=__webpack_require__(5474),K=__webpack_require__(1650),Q=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class Y extends $.A{constructor(e,t){super(e,t),this.iframe=null,this.appearanceManager=new O,this.overrideStoryReaderOptions={},this._silentClose=!1,this.handleUpdateStoryReaderOptions=this.handleUpdateStoryReaderOptions.bind(this)}set silentClose(e){this._silentClose=e}init(){return Q(this,void 0,void 0,(function*(){var e={},t={};e.allowTransparency=!0,e.overflowTouch=!1,e.zIndex=2147483644,e.backgroundColor="transparent";var r={startHeight:70,minWidth:150,storiesHeight:70},i=(document.querySelector("body"),document.querySelector("html"),e.zIndex||2147483645);const s=new Z(window),o=this,n={event:function(e,t){o.emit(e,t)},setFixedHtmlPosition:function(){},open:function(e){e.windowReferer===L.default?s.setScrollbar():(e.windowReferer,L.favorite),o.emit("openStoryReader",e),o.iframe&&(o.iframe.style.setProperty("display","block"),o.iframe.style.setProperty("z-index",i))},close:function(e){var t;e.windowReferer===L.default?s.resetScrollbar():(e.windowReferer,L.favorite),!1===o._silentClose&&o.emit("closeStoryReader",e),o.iframe&&o.iframe.style.setProperty("display","none"),null===(t=o.browserHistory)||void 0===t||t.destroy()}};return new Promise(((i,s)=>{this._init(e,t,{},n,r,((e,t,r)=>{e,t,r}),null,null,i,s)}))}))}getAppearanceManager(){return this.appearanceManager}getWidgetDocument(e,t){var r,i;return`\n <script type="text/javascript" src="${`${H.C.baseUrl}/v2.12.2/dist/js/storyReader.js`}"><\/script>\n ${(Array.isArray(null===(r=this.options)||void 0===r?void 0:r.storyWidgetsResources)?null===(i=this.options)||void 0===i?void 0:i.storyWidgetsResources:[]).map((e=>"js"===e.type?`<script type="text/javascript" src="${e.src}" data-hid="${(0,K.F)(e.src)}"><\/script>`:"")).join("")}\n\n <div id="app"><div id="_app"></div></div>\n <script type="text/javascript" nonce="${t}">\n window.storyReader.init(${JSON.stringify(e)});\n <\/script>\n`}_init(e,t,r,i,s,o,n,a,l,d){const c=Object.create(null,{__init:{get:()=>super.__init}});return Q(this,void 0,void 0,(function*(){return s.fullScreen=!0,s.scrolling=!1,s.hidden=!0,o=(e,t,r)=>{this.rpc=r,this.iframe=t},c.__init.call(this,e,t,r,i,s,o,n,a,l,d)}))}rpcCb(e,t){var r;null===(r=this.rpc)||void 0===r||r.callMethod(e,t)}sessionInit(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onSessionInit",e)}openReader(e,t,r,i={}){var s;this.options=Object.assign(Object.assign({},this.options),{sourceInfo:r}),this.setAppearanceManager(t,Object.assign(Object.assign({},i),{hasShare:e.hasShare})),null===(s=this.rpc)||void 0===s||s.callMethod("onOpenReader",e)}closeReader(){var e;null===(e=this.rpc)||void 0===e||e.callMethod("onCloseReader")}closeGoodsWidget(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onCloseGoodsWidget",e)}syncStoreHandle(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onSyncStore",e)}setStories(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setStories",e)}setStoriesAndContext(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("onSetStoriesAndContext",e)}setAppearanceManager(e,t={}){this.overrideStoryReaderOptions=t,this.unregisterAppearanceManagerEvents(),this.appearanceManager=e,this.registerAppearanceManagerEvents(),this.setOptions(this.composeReaderWidgetOptions({storyReaderOptions:e.storyReaderOptions,gameReaderOptions:e.gameReaderOptions,appearanceCommon:e.commonOptions,overrideStoryReaderOptions:t,faviconApiUrl:H.C.faviconApiUrl}))}unregisterAppearanceManagerEvents(){this.appearanceManager.off(s.EVENT_UPDATED_STORY_READER_OPTIONS,this.handleUpdateStoryReaderOptions),this.appearanceManager.off(s.EVENT_UPDATED_COMMON_OPTIONS,this.handleUpdateStoryReaderOptions)}registerAppearanceManagerEvents(){this.appearanceManager.on(s.EVENT_UPDATED_STORY_READER_OPTIONS,this.handleUpdateStoryReaderOptions),this.appearanceManager.on(s.EVENT_UPDATED_COMMON_OPTIONS,this.handleUpdateStoryReaderOptions)}composeReaderWidgetOptions({storyReaderOptions:e,gameReaderOptions:t,appearanceCommon:r,overrideStoryReaderOptions:i,faviconApiUrl:s}){const o=e;o.gameReaderOptions=t;return Object.assign(Object.assign(Object.assign(Object.assign({},o),{appearanceCommon:Object.assign(Object.assign({},r),{hasShare:Boolean(i.hasShare)&&r.hasShare})}),i),{faviconApiUrl:s,language:I.Tl.getState().lang.toString()})}handleUpdateStoryReaderOptions({storyReaderOptions:e,gameReaderOptions:t,appearanceCommon:r}){this.setOptions(this.composeReaderWidgetOptions({storyReaderOptions:e,gameReaderOptions:t,appearanceCommon:r,overrideStoryReaderOptions:this.overrideStoryReaderOptions,faviconApiUrl:H.C.faviconApiUrl}))}setFonts(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setFonts",e)}_destroyClientWidget(){this.rpc.callMethod("destroyWidget")}setOptions(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setOptions",e)}pauseAndBlockViewerUI(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("pauseAndBlockViewerUI",e)}resumeAndEnableViewerUI(){var e;null===(e=this.rpc)||void 0===e||e.callMethod("resumeAndEnableViewerUI")}setStoryWidgetsResources(e){var t;null===(t=this.rpc)||void 0===t||t.callMethod("setStoryWidgetsResources",e)}}var X=__webpack_require__(7315);class J{static createFunctionWithTimeout(e,t){let r=!1;function i(){r||(r=!0,e())}return setTimeout(i,t||1e3),i}static convertModelToFormData(e,t,r){t instanceof Object&&Object.keys(t).forEach((i=>{const s=t[i];if(s instanceof Object&&!Array.isArray(s))return this.convertModelToFormData(e,s,i);r&&(i=`${r}[${i}]`),Array.isArray(s)?s.forEach((t=>{e.append(`${i}[]`,t)})):e.append(i,s)}))}}const ee=e=>null==e;function te(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function re(e,t){return Object.assign(Object.assign({},e),t)}function ie(e){return e.replace(/^\//,"")}function se(e){let t=e.length;for(let r=e.length-1;r>=0;r--){const i=e.charCodeAt(r);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&r--}return t}class oe{constructor(){return this._sdkConfigIsIncorrect=!1,this._userIdByteLimit=255,this._tagsByteLimit=4e3,this.userMessage="",this.tagsMessage="",oe.instance||(oe.instance=this),oe.instance}static getInstance(){return oe.instance?oe.instance:new oe}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&&se(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)&&se(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 ne=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const ae=`InAppStoryWebSDK/${parseInt(203)} ${navigator.userAgent}`;const le=new class{constructor(){this._deviceInfoPromise=null,this._baseHeaders={},this.requestInterceptors=[],this.interceptors={request:{use:e=>{this.requestInterceptors.push(e)}}}}set deviceInfoPromise(e){this._deviceInfoPromise=e}set baseHeaders(e){this._baseHeaders=e}get baseURL(){return`${H.C.apiUrl}/v2/`}request(e){return ne(this,void 0,void 0,(function*(){return new Promise(((t,r)=>{const i=()=>ne(this,void 0,void 0,(function*(){try{if(te(e.headers)&&null!=e.headers||(e.headers={}),e.headers=re(this._baseHeaders,e.headers),this.requestInterceptors.length)for(const t of this.requestInterceptors)t(e);let r="";!ee(e.params)&&te(e.params)&&(r=new URLSearchParams(Object.entries(e.params)).toString());let i=new URL(`${ie(e.url)}${r?"?"+r:""}`,this.baseURL),s="get";ee(e.method)||(s=e.method);let o={};!ee(e.headers)&&te(e.headers)&&(o=e.headers);let n=null;!ee(e.data)&&te(e.data)&&(n=JSON.stringify(e.data),o["Content-Type"]="application/json");try{if(oe.getInstance().sdkConfigIsIncorrect)return void t({data:{name:"SDK config is incorrect",message:oe.getInstance().sdkConfigErrorsAsArray.join(". "),status:400},headersRaw:{},headers:{},status:400,statusText:"SDK config is incorrect",ok:!1})}catch(e){console.error(e)}const a=yield fetch(i.toString(),{method:s,body:n,headers:o,credentials:"omit"}),l=yield a.json();t({data:l,headersRaw:a.headers,headers:Object.fromEntries([...a.headers]),status:a.status,statusText:a.statusText,ok:a.ok})}catch(e){r(e)}}));this._deviceInfoPromise?this._deviceInfoPromise.finally(i):i()}))}))}post(e,t){return ne(this,void 0,void 0,(function*(){return this.request({method:"post",url:e,data:t})}))}get(e,t){return ne(this,void 0,void 0,(function*(){return this.request({method:"get",url:e,params:t})}))}};function de(e,t,r){var i,s,o;if("sendBeacon"in navigator){const n=new URLSearchParams({access_token:I.Tl.getState().apiKey,session_id:null===(s=null===(i=ue.getState())||void 0===i?void 0:i.session)||void 0===s?void 0:s.id,x_user_agent:ae}),a=I.Tl.getState();null!=a.appPackageId&&n.append("x_app_package_id",a.appPackageId);const l=`${o=le.baseURL,o.replace(/\/$/,"")}/${ie(e)}?${n.toString()}`,d=new FormData;Object.keys(t).forEach((e=>{J.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),r()}else le.post(e,t).then((()=>r()),(()=>r()))}le.interceptors.request.use((e=>{var t,r,i;const s=I.Tl.getState();return e.headers=re(null!==(t=e.headers)&&void 0!==t?t:{},{Authorization:`Bearer ${s.apiKey}`,"Accept-Language":s.lang||"en","Auth-Session-Id":null===(i=null===(r=ue.getState())||void 0===r?void 0:r.session)||void 0===i?void 0:i.id,"X-Device-Id":I.Ue.getState(),"X-User-Id":s.userId?s.userId:"","X-Request-Id":(0,X.v4)(),"X-User-Agent":ae}),null!=s.appPackageId&&(e.headers["X-App-Package-Id"]=s.appPackageId),e}));const ce=le,ue=(0,R.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}),he=(0,R.createEffect)();ue.on(he.doneData,((e,t)=>t));const pe=(0,R.createEvent)(),fe=(0,R.createEvent)();ue.on(fe,(e=>{const t=Object.assign({},e);return t.session.id="",t}));const ge=(0,R.createEffect)((e=>{de("session/update",e,(()=>{}))})).prepend((e=>({data:[[5,0,...e]]}))),ve=ue.map((e=>e.storyWidgetsResources));const me=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();var _e=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};let ye=null;function we(){return _e(this,void 0,void 0,(function*(){return null!=ye?ye:new Promise((e=>{!function(e,t){const r=new Image;r.onload=function(){var i=r.width>0&&r.height>0;t(e,i)},r.onerror=function(){t(e,!1)},r.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"}[e]}("lossy",((t,r)=>{ye=r,e(r)}))}))}))}var be=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const Se=__webpack_require__(7315);function Ce(){return be(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([ke(),we()]);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:Oe(e,t)}}))}he.use((()=>be(void 0,void 0,void 0,(function*(){return(yield ce.request(yield Ce())).data})))),(0,R.forward)({from:pe,to:ue});const Oe=(e,t)=>{"iOS"===e.os_name?window.isIos=!0:"Android"===e.os_name&&(window.Android=!0);const r=I.Tl.getState();return r&&r.userId&&(e.user_id=r.userId),e.features="animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder",t&&(e.features+=",webp"),e},ke=()=>be(void 0,void 0,void 0,(function*(){return new Promise(((e,t)=>{let r=function(e){let t=null;if(me){let r=window.localStorage.getItem(e);null!==r&&z()(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}("device_data"),i=null;if(null!==r&&(i=r.device_id),null!==r&&i&&z()(i)&&36===i.trim().length)(0,I.YB)(i),e(r);else{const t={platform:"web",device_id:Se.v4()};!function(e,t){me&&window.localStorage.setItem(e,JSON.stringify(t))}("device_data",t),(0,I.YB)(t.device_id),e(t)}}))}));var Le;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.UGC=1]="UGC"}(Le||(Le={}));const Me=e=>({id:e,type:Le.DEFAULT,title:null,title_color:null,background:null,background_color:null,image:null,display_to:null,display_from:null,slides_html:[],slides_screenshot_share:[],slides_duration:[],favorite:null,like:null,slides_count:0,deeplink:null,hide_in_reader:null,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,slides_payload:[],game_instance:{id:null},share_url:null,slidesLoaded:!1}),Ae=(0,R.createStore)({}),xe=(0,R.createStore)({default:[]}),Ee=xe.map((e=>e[ue.getState().user_key||"default"]||[]));var Ie;!function(e){e.FEEDS="feeds",e.FAVORITE="favorite"}(Ie||(Ie={}));const Re=(0,R.createStore)({default:{[Ie.FEEDS]:{},[Ie.FAVORITE]:[]}}),Te=Re.map((e=>e[ue.getState().user_key||"default"]||{})),Pe=(0,R.createStore)({}),De=(0,R.createStore)({}),je=(0,R.createStore)([]),Fe=(e,t)=>e.map((e=>t.find((t=>t.id===e)))).filter((e=>!!e));Pe.on([Te,Ee],((e,t)=>{const r=Te.getState(),i=Ee.getState();return((e,t)=>{const r={};for(const[i,s]of Object.entries(e))r[i]=Fe(s,t);return r})(r[Ie.FEEDS],i)})),De.on([Te,Ee],((e,t)=>{const r=Te.getState(),i={},s=Ee.getState();for(const e in r[Ie.FEEDS])if("onboarding_"===e.substring(0,11)){const t=e.substring(11);i[t]=[],r[Ie.FEEDS][e]&&Array.isArray(r[Ie.FEEDS][e])&&(i[t]=s.filter((t=>-1!==r[Ie.FEEDS][e].indexOf(t.id)&&!t.is_opened)))}return i})),je.on([Te,Ee],((e,t)=>{var r;const i=null!==(r=Te.getState()[Ie.FAVORITE])&&void 0!==r?r:[],s={};return Ee.getState().forEach((e=>{s[e.id]=e})),i.map((e=>s[e]))}));const Ne=(0,R.createEffect)(),Ue=(e,t="")=>(e.is_opened,e.is_opened),Be=Ee.map((e=>{const t={};return t[Le.DEFAULT]=e.filter((e=>!e.slidesLoaded&&e.type===Le.DEFAULT)).map((e=>e.id)),t[Le.UGC]=e.filter((e=>!e.slidesLoaded&&e.type===Le.UGC)).map((e=>e.id)),t})),{storyItemFavoriteChanged:Ge,storyItemLikeChanged:Ve,storyItemIsOpenedChanged:ze}=(Object.prototype.hasOwnProperty,(0,R.createApi)(xe,{storyItemFavoriteChanged:(e,{id:t,favorite:r})=>{const i=ue.getState().user_key||"default",s=(e[i]||[]).slice(0),o=s.find((e=>e.id===t));return void 0!==o&&(o.favorite=r),Object.assign(Object.assign({},e),{[i]:s})},storyItemLikeChanged:(e,{id:t,like:r})=>{const i=ue.getState().user_key||"default",s=(e[i]||[]).slice(0),o=s.find((e=>e.id===t));return void 0!==o&&(o.like=r),Object.assign(Object.assign({},e),{[i]:s})},storyItemIsOpenedChanged:(e,{id:t})=>{const r=ue.getState().user_key||"default",i=(e[r]||[]).slice(0),s=i.find((e=>e.id===t));return void 0!==s&&(s.is_opened=!0),Object.assign(Object.assign({},e),{[r]:i})}}));var We=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};function qe(e,t,r=!1,i,s){const o=["slides_html","slides_duration","slides_screenshot_share","slides_payload"];s&&o.push("share_url");const n={url:`${t===ni?"ugc/":""}story/${e}`,method:"GET",params:{expand:o.join(",")}};return r||null!=n.params&&(n.params.fields=["id","slides_html","slides_duration","slides_screenshot_share","slides_payload"].join(",")),null!==i&&null!=n.params&&(n.params.session_id=i),n}Ne.use((({listType:e})=>We(void 0,void 0,void 0,(function*(){return ce.get("story",$e())}))));const $e=(e,t,r,i,s)=>{var o;let n=null===(o=I.Tl.getState())||void 0===o?void 0:o.tags;const a={};n&&P()(n)&&n.length>0&&(a.tags=n.join(",")),void 0!==t&&P()(t)&&t.length>0&&(a.tags=t.join(","));return null==i||"number"!=typeof i&&!(e=>!isNaN(parseFloat(e))&&isFinite(e))(i)||(a.limit=i),e&&(a.session_id=e),null!=r&&(a.test=r),null!=s&&j()(s)&&(a.f=s),{params:a}},Ze=(0,R.createEffect)();var He=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Ze.use((()=>He(void 0,void 0,void 0,(function*(){return(yield ce.request(yield function(){return He(this,void 0,void 0,(function*(){return{method:"GET",url:"ugc/editor-config",params:{}}}))}())).data})))),ue.on(Ze.doneData,((e,t)=>{const r=Object.assign({},e);return r.editor=t,r}));const Ke=(e,t)=>{const r={};return r[Le.DEFAULT]=[],r[Le.UGC]=[],r[e]=t,{storyTypeIds:r,style:"",widgetsData:{}}},Qe=(e,t)=>{let r;return r=null==t?Ke(Le.DEFAULT,[]):t,{ids:r.storyTypeIds[e],style:r.style,widgetsData:r.widgetsData}},Ye=(0,R.createStore)({style:"",storyTypeIds:{[Le.DEFAULT]:[],[Le.UGC]:[]},widgetsData:{}}),Xe=(0,R.createEffect)(),Je=(0,R.createEvent)();var et=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};function tt(e,t){const r={url:"story-context",method:"GET",params:{id:e.join(","),fields:["style","widgetsData"].join(",")}};return null!=t&&null!=r.params&&(r.params.session_id=t),r}function rt(e,t,r){return String(e).replace(new RegExp(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"g"),(()=>r))}Xe.use((({ids:e})=>et(void 0,void 0,void 0,(function*(){return ce.request(tt(e))})))),(0,R.forward)({from:Xe.done.filterMap((({params:e,result:t})=>{const r=t.data,i=ai(e.feedSlug);if(r&&j()(r)){const t=Ke(i,e.ids);return t.style=r.style,t.widgetsData=r.widgetsData,t}})),to:Ye}),(0,R.forward)({from:Je,to:Ye});var it=__webpack_require__(3514),st=__webpack_require__.n(it);const ot=(0,R.createStore)({default:{},user:{}}),{sdkImagePlaceholdersChanged:nt,addDefaultImagePlaceholders:at}=(0,R.createApi)(ot,{sdkImagePlaceholdersChanged:(e,t)=>({default:e.default,user:t}),addDefaultImagePlaceholders:(e,t)=>{let r={default:{},user:e.user};return P()(t)&&t.forEach((e=>{j()(e)&&void 0!==e.name&&void 0!==e.default_value&&(r.default[e.name]=e.default_value)})),r}});let lt;lt=function(){};class dt{constructor(){this.__lastUpdated=null,this._receiveTime=0,this._serverTimestamp=0,this.rawData={},this.myDictionary={}}get receiveTime(){return this._receiveTime}singleModelWrapper(){return""}attributes(){return["__lastUpdated"]}static prepareFromResponse(){}setAttributes(e){const t=this.attributes();let r=this;for(let i in e){let s=e[i];-1!==t.indexOf(i)&&(r[i]=s)}}static createInstance(e,t){const r=new e;let i=t;return""!==r.singleModelWrapper()&&void 0!==t[r.singleModelWrapper()]&&(i=t[r.singleModelWrapper()]),r.rawData=t,r.setAttributes(i),r._receiveTime=(new Date).getTime(),void 0!==t.server_timestamp&&(r._serverTimestamp=t.server_timestamp),r}static _fetch(e,t,r,i="get"){return new Promise(((s,o)=>{let n={url:t,method:i};-1!==["post","put","path"].indexOf(i)?n.data=r:n.params=r;ce.request(n).then((function(t){let r,i;r=t.data,r&&(r.__lastUpdated=Date.now()),i=dt.createInstance(e,r),s(i)})).catch(o)}))}static _fetchList(e,t,r){return new Promise(((i,s)=>{ce.get(t,{params:r}).then((function(t){const r=t.data;let s=[];r.forEach((t=>{s.push(dt.createInstance(e,t))}));let o={models:s,totalCount:Number(t.headers["x-pagination-total-count"]),currentPage:Number(t.headers["x-pagination-current-page"])};i(o)})).catch(s)}))}static emitEvent({type:e,event:t,eventData:r}){return new Promise(((i,s)=>{ce.post(`${e}/event/${t}`,r).then((function(e){const t=e.data;i(t)})).catch(s)}))}static update(e,t,r="post"){let i={url:e,method:r};return-1!==["post","put","path"].indexOf(r)?i.data=t:i.params=t,new Promise(((e,t)=>{ce.request(i).then((function(t){let r;r=t.data,e(r)})).catch(t)}))}}class ct extends dt{attributes(){return["width","height","type","url"]}constructor(){super(),this._url=""}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 ut=__webpack_require__(3981);class ht{constructor(){this.images=[],this.color="",this.gradient=!1}static createFromArray(e){const t=new ht;for(let r in e)e.hasOwnProperty(r)&&t.images.push(ct.createInstance(ct,e[r]));return t}findOneByType(e){let t=null;return this.images.forEach((r=>{r.type===e&&(t=r)})),t}findOneByWidth(e,t=!1){let r=null;return this.images.forEach((t=>{t.width===e&&(r=t)})),null!==r||t&&void 0!==(r=ut(this.images))?r:null}}const pt=__webpack_require__(4871);class ft extends dt{constructor(){super(...arguments),this._cover=null}attributes(){return pt(super.attributes(),["id","cover","hasFavorite"])}set cover(e){this._cover=ht.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}}var gt=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const vt=(0,R.createEffect)((({defaultList:e,onboardingList:t,favoriteList:r,onboardingTags:i,testKey:s,limit:o})=>gt(void 0,void 0,void 0,(function*(){var n,a,l;const d=[],c=null===(a=null===(n=ue.getState())||void 0===n?void 0:n.session)||void 0===a?void 0:a.id;let u=null;if(st()(c)&&(d.push(mt(yield Ce(),"session")),u="@{session.session.id}"),!1!==e&&j()(e)&&z()(e.feedSlug)){const t=e.feedSlug,r=null!==(l=e.filter)&&void 0!==l?l:{};t===ni?d.push(mt(function(e,t,r,i,s){const{params:o}=$e(r,i,s,null,t);return{method:"GET",url:"ugc/feed",params:o}}(0,r,u,[],s),`storyList_${t}`)):d.push(mt(function(e,t,r,i){const{params:s}=$e(t,r,i);return{method:"GET",url:`feed/${e}`,params:s}}(t,u,[],s),`storyList_${t}`))}r&&d.push(mt(function(e){const{params:t}=$e(e);return{method:"GET",url:"story",params:Object.assign(Object.assign({},t),{favorite:1})}}(u),"storyFavoriteList")),!1!==t&&z()(t)&&d.push(mt(function(e="onboarding",t,r,i){const{params:s}=$e(t,r,null,i);return{method:"GET",url:`feed/${e}/onboarding`,params:s}}(t,u,i,o),`storyOnboardingList_${t}`));let h=null;try{const e=yield ce.post("composite",{compositeRequest:d});if(e.status>=200&&e.status<=299)if(e.data&&e.data.compositeResponse&&Array.isArray(e.data.compositeResponse)){if(e.data.success)return e.data.compositeResponse;for(const t of e.data.compositeResponse){const e=t.status;if(q()(e)&&!(e>=200&&e<=299)){h={name:"networkError",networkStatus:e,networkMessage:String(t.body)};break}}}else h=e.data&&j()(e.data)&&null!=e.data.name&&null!=e.data.message&&null!=e.data.status?{name:e.data.name,networkStatus:e.data.status,networkMessage:e.data.message}:{name:"networkError",networkStatus:null,networkMessage:"Invalid data in API response, data from response as json: "+JSON.stringify(e.data)};else h=e.data&&j()(e.data)&&null!=e.data.name&&null!=e.data.message&&null!=e.data.status?{name:e.data.name,networkStatus:e.data.status,networkMessage:e.data.message}:{name:"networkError",networkStatus:e.status,networkMessage:"Invalid data in API response, data from response as json: "+JSON.stringify(e.data)}}catch(e){try{const t=e;if(t.response&&t.response.status)h={name:"networkError",networkStatus:t.response.status,networkMessage:t.response.statusText};else{let t="";window.navigator&&null!=window.navigator.onLine&&(t=" net::ERR_INTERNET_DISCONNECTED"),h={name:"error",networkStatus:null,networkMessage:e.toString()+t},console.error(e)}}catch(e){h={name:"error",networkStatus:null,networkMessage:e.toString()}}}if(null!==h)throw h;return[]})))),mt=(e,t)=>({path:e.url,qs:e.params,body:e.data,ref:t,method:e.method}),_t=e=>{const t=F.getState();for(let r in t.user)wt.call(t.user,r)&&(e=rt(e,`%${r}%`,t.user[r]));for(let r in t.default)wt.call(t.default,r)&&(e=rt(e,`%${r}%`,t.default[r]));const r=ot.getState();for(let t in r.user)wt.call(r.user,t)&&(e=rt(e,`%${t}%`,r.user[t]));for(let t in r.default)wt.call(r.default,t)&&(e=rt(e,`%${t}%`,r.default[t]));return e},yt=(e,t)=>Array.isArray(e)?e.map((e=>Object.assign(Object.assign({},e),{title:e.need_placeholders?_t(e.title):e.title,slidesLoaded:!1,is_opened:Ue(e),type:t}))):[];(0,R.forward)({from:vt.doneData.filterMap((e=>{var t;return null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body})),to:ue}),(0,R.forward)({from:vt.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.placeholders})),to:U}),(0,R.forward)({from:vt.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.image_placeholders})),to:at}),(0,R.forward)({from:he.doneData.filterMap((e=>e.placeholders)),to:U}),(0,R.forward)({from:he.doneData.filterMap((e=>e.image_placeholders)),to:at});const wt=Object.prototype.hasOwnProperty;(0,R.sample)({source:xe,clock:ue,fn:(e,t)=>{const r={};for(const i in e)wt.call(e,i)&&(r[i]=e[i].map((e=>Object.assign(Object.assign({},e),{is_opened:Ue(e,t.user_key),title:e.need_placeholders?_t(e.title):e.title}))));return r},target:xe});const{storiesListIdsChanged:bt}=(0,R.createApi)(Re,{storiesListIdsChanged:(e,{storiesIdsUserEntity:t,feedSlug:r,storyList:i})=>{let s=ue.getState().user_key||"default";const o=e[s]||{};return void 0===o[Ie.FAVORITE]&&(o[Ie.FAVORITE]=[]),void 0===o[Ie.FEEDS]&&(o[Ie.FEEDS]={}),t===Ie.FEEDS&&r&&(o[Ie.FEEDS][r]=i.map((e=>e.id))),t===Ie.FAVORITE&&(o[Ie.FAVORITE]=i.map((e=>e.id))),Object.assign(Object.assign({},e),{[s]:o})}}),{storiesListItemsAdded:St}=(0,R.createApi)(xe,{storiesListItemsAdded:(e,{storiesIdsUserEntity:t,feedSlug:r,storyList:i})=>{let s=ue.getState().user_key||"default";const o=e[s]||[],n=o.map((e=>e.id));return Object.assign(Object.assign({},e),{[s]:[...o,...i.filter((e=>-1===n.indexOf(e.id)))]})}});(0,R.forward)({from:vt.doneData.filterMap((e=>{var t;let r=null;for(const i of e)if(i.ref&&z()(i.ref)){const e=i.ref.match(/^storyList_(.+)/);if(e&&Array.isArray(e)&&e[1]){let s=null===(t=i.body)||void 0===t?void 0:t.stories;const o=ai(e[1]);o===Le.UGC&&(s=i.body);const n=yt(s,o);r={storiesIdsUserEntity:Ie.FEEDS,feedSlug:e[1],storyList:n}}}if(r)return r})),to:[St,bt]}),(0,R.forward)({from:vt.doneData.filterMap((e=>{var t;let r=null;for(const i of e)if(i.ref&&z()(i.ref)){const e=i.ref.match(/^storyOnboardingList_(.+)/);if(e&&Array.isArray(e)&&e[1]){const s=yt(null===(t=i.body)||void 0===t?void 0:t.stories,Le.DEFAULT);r={storiesIdsUserEntity:Ie.FEEDS,feedSlug:`onboarding_${e[1]}`,storyList:s}}}if(r)return r})),to:[St,bt]}),(0,R.forward)({from:vt.doneData.filterMap((e=>{const t=e.find((e=>"storyFavoriteList"===e.ref));if(void 0===t)return;const r=yt(t.body,Le.DEFAULT);return{storiesIdsUserEntity:Ie.FAVORITE,feedSlug:null,storyList:r}})),to:[St,bt]});const Ct=(0,R.createEffect)();Ct.use((e=>gt(void 0,void 0,void 0,(function*(){const t=e.ids.map((t=>mt(qe(t,e.feedSlug),`storySlides_${t}`))),r=yield ce.post("composite",{compositeRequest:t});return r.data&&r.data.success&&r.data.compositeResponse&&Array.isArray(r.data.compositeResponse)?r.data.compositeResponse:[]}))));const Ot=e=>e&&j()(e)&&"id"in e,kt=(0,R.createEffect)();kt.use((({ids:e,id:t,feedSlug:r})=>gt(void 0,void 0,void 0,(function*(){const i=[mt(qe(t,r),"storySlides"),mt(tt(e),"storyContext")],s=yield ce.post("composite",{compositeRequest:i});return s.data&&s.data.success&&s.data.compositeResponse&&Array.isArray(s.data.compositeResponse)?s.data.compositeResponse:[]})))),xe.on([Ct.done,kt.done],((e,{params:t,result:r})=>{const i=r;if(Array.isArray(i)){const r=ai(t.feedSlug),s=ue.getState().user_key||"default",o=(e[s]||[]).slice(0).map((e=>{var t,s,o,n,a,l,d,c,u,h,p,f,g,v,m;for(let _=0;_<i.length;_++)if(Ot(null===(t=i[_])||void 0===t?void 0:t.body)&&(null===(o=null===(s=i[_])||void 0===s?void 0:s.body)||void 0===o?void 0:o.id)===e.id&&r===e.type)return Object.assign({},e,{slides_html:e.need_placeholders?Array.from(null!==(l=null===(a=null===(n=i[_])||void 0===n?void 0:n.body)||void 0===a?void 0:a.slides_html)&&void 0!==l?l:[]).map((e=>_t(e))):Array.from(null!==(u=null===(c=null===(d=i[_])||void 0===d?void 0:d.body)||void 0===c?void 0:c.slides_html)&&void 0!==u?u:[]),slides_duration:null===(p=null===(h=i[_])||void 0===h?void 0:h.body)||void 0===p?void 0:p.slides_duration,slides_screenshot_share:null===(g=null===(f=i[_])||void 0===f?void 0:f.body)||void 0===g?void 0:g.slides_screenshot_share,slides_payload:null===(m=null===(v=i[_])||void 0===v?void 0:v.body)||void 0===m?void 0:m.slides_payload,slidesLoaded:!0,is_opened:Ue(e)});return e}));return Object.assign(Object.assign({},e),{[s]:o})}return e})),(0,R.forward)({from:kt.done.filterMap((({params:e,result:t})=>{var r;const i=null===(r=t.find((e=>"storyContext"===e.ref)))||void 0===r?void 0:r.body,s=ai(e.feedSlug);if(i&&j()(i)){const t=Ke(s,e.ids);return t.widgetsData=i.widgetsData,t.style=i.style,t}})),to:Ye});const Lt=(0,R.createEffect)((({id:e,feedSlug:t,fetchShareUrl:r})=>gt(void 0,void 0,void 0,(function*(){var i,s;const o=[],n=null===(s=null===(i=ue.getState())||void 0===i?void 0:i.session)||void 0===s?void 0:s.id;let a=null;st()(n)&&(o.push(mt(yield Ce(),"session")),a="@{session.session.id}"),o.push(mt(qe(e,t,!0,a,r),"story")),o.push(mt(tt([e],a),"storyContext"));const l=yield ce.post("composite",{compositeRequest:o});if(l.data&&l.data.success&&l.data.compositeResponse&&Array.isArray(l.data.compositeResponse))return l.data.compositeResponse;if(l.data&&!l.data.success)throw Error("composite request error:"+JSON.stringify(l.data.compositeResponse));return[]}))));(0,R.forward)({from:Lt.doneData.filterMap((e=>{var t;const r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body;if(r&&j()(r)&&r)return r})),to:ue}),(0,R.forward)({from:Lt.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.placeholders})),to:U}),(0,R.forward)({from:Lt.doneData.filterMap((e=>{var t,r;return null===(r=null===(t=e.find((e=>"session"===e.ref)))||void 0===t?void 0:t.body)||void 0===r?void 0:r.image_placeholders})),to:at}),(0,R.forward)({from:Lt.done.filterMap((({params:e,result:t})=>{var r;const i=null===(r=t.find((e=>"storyContext"===e.ref)))||void 0===r?void 0:r.body;if(i&&j()(i)){const t=ai(e.feedSlug),r=Ke(t,[e.id]);return r.widgetsData=i.widgetsData,r.style=i.style,r}})),to:Ye}),xe.on(Lt.done.filterMap((({params:e,result:t})=>{var r;const i=null===(r=t.find((e=>"story"===e.ref)))||void 0===r?void 0:r.body;if(i&&j()(i))return i.type=ai(e.feedSlug),i})),((e,t)=>{if(!Ot(t))return;const r=ue.getState().user_key||"default",i=(e[r]||[]).slice(0).filter((e=>e.id!==(null==t?void 0:t.id))).slice(0);return t=Object.assign(t,{slides_html:t.need_placeholders?Array.from(t.slides_html).map((e=>_t(e))):Array.from(t.slides_html),slides_duration:t.slides_duration,slidesLoaded:!0,is_opened:Ue(t)}),i.push(t),Object.assign(Object.assign({},e),{[r]:i})})),(0,R.sample)({source:xe,clock:F,fn:(e,t)=>{const r={};for(const t in e)wt.call(e,t)&&(r[t]=e[t].map((e=>{var t;return Object.assign(Object.assign({},e),{slides_html:e.need_placeholders&&Array.isArray(e.slides_html)?e.slides_html.map((e=>_t(e))):null!==(t=e.slides_html)&&void 0!==t?t:[]})})));return r},target:xe});const{storyFeedsAdded:Mt}=(0,R.createApi)(Ae,{storyFeedsAdded:(e,t)=>t});(0,R.forward)({from:vt.doneData.filterMap((e=>{let t={};for(const r of e)if(r.ref&&z()(r.ref)){const e=r.ref.match(/^storyList_(.+)/);if(e&&Array.isArray(e)&&e[1]){const i=r.body;t[e[1]]=dt.createInstance(ft,i)}}return t})),to:[Mt]});const At=function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}();var xt,Et,It=__webpack_require__(2438),Rt=__webpack_require__.n(It);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(xt||(xt={})),function(e){e.STORY_LIST="storyList",e.STORY_READER="storyReader",e.GAME_READER="gameReader"}(Et||(Et={}));class Tt extends n.EventEmitter{destroy(){}}class Pt{constructor(){this.__lastUpdated=null,this._receiveTime=0,this._serverTimestamp=0,this.rawData={},this.myDictionary={}}get receiveTime(){return this._receiveTime}singleModelWrapper(){return""}attributes(){return["__lastUpdated"]}static prepareFromResponse(){}setAttributes(e){const t=this.attributes();let r=this;for(let i in e){let s=e[i];-1!==t.indexOf(i)&&(r[i]=s)}}static createInstance(e,t){const r=new e;let i=t;return""!==r.singleModelWrapper()&&void 0!==t[r.singleModelWrapper()]&&(i=t[r.singleModelWrapper()]),r.rawData=t,r.setAttributes(i),r._receiveTime=(new Date).getTime(),void 0!==t.server_timestamp&&(r._serverTimestamp=t.server_timestamp),r}static _fetch(e,t,r,i="get"){return new Promise(((e,t)=>{e({})}))}static _fetchList(e,t,r){return Promise.resolve({})}static emitEvent({type:e,event:t,eventData:r}){return Promise.resolve()}static update(e,t,r="post"){return Promise.resolve()}}class Dt extends Pt{attributes(){return["width","height","type","url"]}constructor(){super(),this._url=""}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 jt=__webpack_require__(3981);class Ft{constructor(){this.images=[],this.color="",this.gradient=!1}static createFromArray(e){const t=new Ft;for(let r in e)e.hasOwnProperty(r)&&t.images.push(Dt.createInstance(Dt,e[r]));return t}findOneByType(e){var t;return null!==(t=this.images.find((t=>t.type===e)))&&void 0!==t?t:null}findOneByCoverQuality(e){return this.findOneByType(this.mapCoverQualityToImageType(e))}findOneByWidth(e,t=!1){let r=null;return this.images.forEach((t=>{t.width===e&&(r=t)})),null!==r||t&&void 0!==(r=jt(this.images))?r:null}mapCoverQualityToImageType(e){switch(e){case h.Medium:return"m";case h.High:return"h"}}}var Nt=__webpack_require__(4871),Ut=__webpack_require__.n(Nt);class Bt extends Pt{constructor(){super(...arguments),this._title="",this.title_color="",this.magazine_name="",this.is_opened=!1,this._slides_html=[],this.slides_duration=[],this.slides_screenshot_share=[],this.source="",this.favorite=!1,this.like=0,this.slides_count=null,this.deeplink=null,this.hide_in_reader=null,this.blank=!1,this.disable_close=!1,this.need_placeholders=null,this._placeholders={},this.favorite_cell=!1,this.ugc_card_cell=!1,this.slidesLoaded=!1,this._imageSrc=null,this._parsedIssueArticleIds=null,this._parsedArticleIds=null,this._parsedSlideImage=null,this._video_cover=null,this._videoCoverSrc=null}static fetch(e,t){return this.placeholders=t,this._fetch(Bt,`story/${e}`,{expand:"slides_html,slides_duration"})}static fetchList(e,t,r){this.placeholders=e;const i={tags:t};return void 0!==r&&(i.favorite=Number(r)),this._fetchList(Bt,"story",i)}static fetchWithSlides(e,t){return this.placeholders=t,Promise.all(e.map((e=>this.fetch(e,t))))}static fetchOnboardingList(e,t){return this.placeholders=e,this._fetchList(Bt,"story-onboarding",{tags:t})}static fetchOnboardingListWithSlides(e,t){return this.placeholders=t,Promise.all(e.map((e=>this.fetch(e,t))))}attributes(){return Ut()(super.attributes(),["title","title_color","source","magazine_name","background","background_color","id","image","display_to","display_from","slides_html","slides_duration","slides_screenshot_share","favorite","like","slides_count","deeplink","hide_in_reader","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","slidesLoaded"])}set image(e){this._image=Ft.createFromArray(e)}get image(){return this._image}get issueArticleIds(){return this.parseHtmlSlidesForLinks(),null!==this._parsedIssueArticleIds?this._parsedIssueArticleIds:[]}get articleIds(){return this.parseHtmlSlidesForLinks(),null!==this._parsedArticleIds?this._parsedArticleIds:[]}imagePerSlide(e){return this.parseHtmlSlidesForMainImage(),null!==this._parsedSlideImage&&void 0!==this._parsedSlideImage[e]?this._parsedSlideImage[e]:null}parseHtmlSlidesForLinks(){null===this._parsedArticleIds&&null===this._parsedIssueArticleIds&&this.slides_html.forEach((e=>{const t=e.match(/<[^<]*narrative-element-link.*data-link-type="([a-z-]*)".*data-link-target="(\d+)"[^<]*>/i);if(null!==t){const e=t[1],r=parseInt(t[2]);"article"===e?(null===this._parsedArticleIds&&(this._parsedArticleIds=[]),-1===this._parsedArticleIds.indexOf(r)&&this._parsedArticleIds.push(r)):"issue-article"===e&&(null===this._parsedIssueArticleIds&&(this._parsedIssueArticleIds=[]),-1===this._parsedIssueArticleIds.indexOf(r)&&this._parsedIssueArticleIds.push(r))}}))}parseHtmlSlidesForMainImage(){null===this._parsedSlideImage&&this.slides_html.forEach(((e,t)=>{const r=e.match(/<[^<]*narrative-element-image.*<img[^<]*src="([^"]*)"[^<]*>/i);null!==r&&(null===this._parsedSlideImage&&(this._parsedSlideImage=[]),this._parsedSlideImage[t]=r[1])}))}set video_cover(e){null!==e&&(this._video_cover=Ft.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 Bt.placeholders)Bt.placeholders.hasOwnProperty(t)&&(e=rt(e,`%${t}%`,Bt.placeholders[t]));this.rawData.title=e,this._title=e}get slides_html(){return this._slides_html}set slides_html(e){if(!0===this.need_placeholders||!0===this.rawData.need_placeholders)for(let t in Bt.placeholders)if(Bt.placeholders.hasOwnProperty(t))for(let r=0;r<e.length;r++)e[r]=rt(e[r],`%${t}%`,Bt.placeholders[t]);const t=null!==__webpack_require__.nc&&void 0!==__webpack_require__.nc?__webpack_require__.nc:"";for(let r=0;r<e.length;r++)e[r]=rt(e[r],"{{nonce}}",null!=t?t:"");this._slides_html=e}get isOpened(){return this.is_opened}set isOpened(e){this.is_opened=e,this.rawData.is_opened=e}}Bt.placeholders={};const Gt=Bt;class Vt{static create(e){const t=Pt.createInstance(Gt,{id:0,title:e.favoriteCard.title.content,title_color:e.favoriteCard.title.color,is_opened:!0,background_color:"white"});return t.favorite_cell=!0,t}}const zt=/[\r\n%#()<>?[\\\]^`{|}]/g;function Wt(e,t="double"){return(e=(e=(e="double"===t?e.replace(/"/g,"'"):e.replace(/'/g,'"')).replace(/>\s{1,}</g,"><")).replace(/\s{2,}/g," ")).replace(zt,encodeURIComponent)}class qt{static create(e){let t=[];e.ugcCard.image&&e.ugcCard.image.svgSrc&&e.ugcCard.image.svgSrc.baseState&&t.push({width:100,height:100,type:"h",url:`data:image/svg+xml,${Wt(e.ugcCard.image.svgSrc.baseState)}`});const r=Pt.createInstance(Gt,{id:-100,title:e.ugcCard.title.content,title_color:e.ugcCard.title.color,is_opened:!1,background_color:e.ugcCard.backgroundColor,image:t});return r.ugc_card_cell=!0,r}}class $t{constructor(e=0,t=0,r=0,i=0){this.x=e,this.y=t,this.width=r,this.height=i}overlaps(e){return this.x+this.width>=e.x&&this.x<=e.x+e.width&&this.y+this.height>=e.y&&this.y<=e.y+e.height}getIntersection(e){const t=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.x,e.x),i=Math.min(this.y+this.height,e.y+e.height),s=Math.max(this.y,e.y);return new $t(Math.min(t,r),Math.min(i,s),Math.max(0,t-r),Math.max(0,i-s))}getArea(){return this.width*this.height}getAreaFraction(e){return+(this.getArea()/e.getArea()*100).toFixed(2)}static clone(e){return new $t(e.x,e.y,e.width,e.height)}}class Zt extends n.EventEmitter{calculate(e){const t=e.map((({id:e,areaFraction:t})=>({storyId:e,visibleArea:Math.round(t)/100})));0!==t.length&&this.emit("visibleAreaUpdated",t)}}class Ht extends n.EventEmitter{constructor(){super(...arguments),this.storiesIds=new Set,this.getNewStoriesIds=e=>{const t=[];for(const r of e)this.storiesIds.has(r)||t.push(r);return t}}markStoryAsFullVisible(e){this.storiesIds.has(e)||(this.storiesIds.add(e),this.emit("flushThumbViews",[e]))}calculate(e){const t=this.getNewStoriesIds(e.map((({id:e})=>e)));t.forEach((e=>this.storiesIds.add(e))),0!==t.length&&this.emit("flushThumbViews",t)}}class Kt extends n.EventEmitter{constructor(){super(),this.storyRects=[],this.viewport=new $t,this.feedImpressionMetric=new Ht,this.visibleAreaMetric=new Zt,this.filterStoryRectIntersections=e=>e.filter((e=>-100!==e.id&&0!==e.id&&e.areaFraction>0)),this.feedImpressionMetric.on("flushThumbViews",(e=>this.emit("flushThumbViews",e))),this.visibleAreaMetric.on("visibleAreaUpdated",(e=>this.emit("visibleAreaUpdated",e)))}calculate(e){const t=this.getScrollViewportByCalculationParams(e),r=this.getStoryRectIntersectionsWithViewport(t),i=this.filterStoryRectIntersections(r);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=$t.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 r of this.storyRects)if(r.overlaps(e)){const i=r.getIntersection(e);t.push({id:r.id,areaFraction:i.getAreaFraction(r)})}else t.push({id:r.id,areaFraction:0});return t}}class Qt extends $t{constructor(e,t=0,r=0,i=0,s=0){super(t,r,i,s),this.id=e}static clone(e){return new Qt(e.id,e.x,e.y,e.width,e.height)}}class Yt{constructor(e,t){this.storyManager=e,this.params=t,this.handleFlushThumbViews=this.handleFlushThumbViews.bind(this),this.handleVisibleAreaUpdated=this.handleVisibleAreaUpdated.bind(this)}create(){const e=new Kt;return e.on("flushThumbViews",this.handleFlushThumbViews),e.on("visibleAreaUpdated",this.handleVisibleAreaUpdated),e}handleFlushThumbViews(e){const t=I.Tl.getState();this.params.listType!==Le.DEFAULT||t.disableStatistic||ge(e);const r=this.params.identityFields.feedSlug,i=this.params.identityFields.filter,s=ai(r),o={stories:e.map((e=>{const t={title:null,tags:[],slidesCount:null},r=Ee.getState().find((t=>t.id===e));return r&&(t.title=r.stat_title,t.tags=r.tags,t.slidesCount=r.slides_count,r.type===Le.UGC&&(t.ugcPayload=j()(r.payload)?r.payload:{})),Object.assign({id:e},t)})),feed:null,filter:null};s===Le.DEFAULT?o.feed=r:s===Le.UGC&&(o.filter=i),this.storyManager.emit("feedImpression",o)}handleVisibleAreaUpdated(e){const t=this.params.identityFields.feedSlug,r=this.params.identityFields.filter,i=ai(t),s={stories:e.map((({storyId:e,visibleArea:t})=>{const r={title:null,tags:[],slidesCount:null,visibleArea:t},i=Ee.getState().find((t=>t.id===e));return i&&(r.title=i.stat_title,r.tags=i.tags,r.slidesCount=i.slides_count,i.type===Le.UGC&&(r.ugcPayload=j()(i.payload)?i.payload:{})),Object.assign({id:e},r)})),feed:null,filter:null};i===Le.DEFAULT?s.feed=t:i===Le.UGC&&(s.filter=r),this.storyManager.emit("visibleAreaUpdated",s)}}const Xt=(e,t)=>{let r=[];switch(e){case M.default:r=t?Pe.getState()[t]:[];break;case M.favorite:r=je.getState();break;case M.onboarding:r=t?De.getState()[t]:[]}return null!=r?r:[]};var Jt=__webpack_require__(2535);const er=__webpack_require__(4871);var tr;!function(e){e.FONT="font-face"}(tr||(tr={}));class rr extends Pt{attributes(){return er(super.attributes(),["weight","style","type","url","title","family","format"])}constructor(){super(),this._url=""}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://")}get isFont(){return this.type===tr.FONT}get fontFaceAsCss(){var e,t,r;if(!this.isFont)return null;let i={"font-family":null!==(e=this.family)&&void 0!==e?e:"normal",src:`url('${this.url}')`,"font-style":null!==(t=this.style)&&void 0!==t?t:"normal","font-weight":null!==(r=this.weight)&&void 0!==r?r:"normal"};return this.title&&(i.src+=`, local('${this.title}')`),`@font-face {${(0,Jt.ky)(i)}}\n`}}__webpack_require__(3981);class ir{constructor(){this.resources=[]}static createFromArray(e){const t=new ir;for(let r in e)e.hasOwnProperty(r)&&t.resources.push(rr.createInstance(rr,e[r]));return t}get fontsCss(){let e="";return this.resources.forEach((t=>{if(t.isFont){let r=t.fontFaceAsCss;null!==r&&(e+=r)}})),e||null}}class sr extends Pt{constructor(){super(),this.id=null,this.expire_in=null,this.closed=!1,this.is_allow_profiling=!1,this.preview_aspect_ratio=1,this._placeholders={}}singleModelWrapper(){return""}attributes(){return Ut()(super.attributes(),["server_timestamp","session","cache","share","user_key","placeholders","is_allow_profiling","preview_aspect_ratio"])}static fetch(e){return this._fetch(sr,"session/open?expand=cache",e,"post")}static updateSession(e){return this.update("session/update",e)}set session(e){this.id=e.id,this.expire_in=e.expire_in,void 0!==e.closed&&(this.closed=e.closed)}set cache(e){this._projectResourceCache=ir.createFromArray(e)}get cache(){return this._projectResourceCache}set placeholders(e){P()(e)&&e.forEach((e=>{j()(e)&&void 0!==e.name&&void 0!==e.default_value&&(this._placeholders[e.name]=e.default_value)}))}get placeholders(){return this._placeholders}}var or=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class nr{constructor(e){this.storyManager=e}loadStories({listType:e,identityFields:t,testKey:r,needFavorite:i=!0}){return or(this,void 0,void 0,(function*(){const s=e===Le.DEFAULT&&i;yield vt({defaultList:t,onboardingList:!1,favoriteList:s,testKey:r});const o=Xt(M.default,t.feedSlug),n=t.feedSlug===ni?Le.UGC:Le.DEFAULT;const a={stories:o.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===Le.UGC&&(t.ugcPayload=j()(e.payload)?e.payload:{})),Object.assign({id:e.id},t)})),feed:null,filter:null};n===Le.DEFAULT?a.feed=t.feedSlug:n===Le.UGC&&(a.filter=t.filter),this.storyManager.emit("feedLoad",a);return{defaultStories:Xt(M.default,t.feedSlug),favoriteStories:Xt(M.favorite,t.feedSlug)}}))}observeDefaultStories(e){return Pe.map((t=>{var r;return(null!==(r=t[e])&&void 0!==r?r:[]).map((e=>this.createStoryByData(Object.assign(Object.assign({},e),{slides_html:[]}))))}))}observeFavoriteStories(){return je.map((e=>e.map((e=>this.createStoryByData(Object.assign(Object.assign({},e),{slides_html:[]}))))))}observeSession(){return ue.map((e=>Pt.createInstance(sr,e)))}createStoryByData(e){return e instanceof Gt?e:Pt.createInstance(Gt,e)}}const ar=(e,t,r,i)=>!(!e||t||r)&&(console.error(`Cannot open hidden story id ${i}`),!0),lr=(e,t,r)=>{var i;e.isDeeplink?dr(e,t,r):(null===(i=t.gameInstance)||void 0===i?void 0:i.id)?cr(e,t,r):ur(e,t,r)},dr=(e,t,r)=>{e.isDeeplink=!0,r.eventPublisher.emit("clickOnStoryDeepLink",e)},cr=(e,t,r)=>{var i;r.eventPublisher.emit("clickOnStoryGame",{id:t.id,gameInstanceId:null===(i=t.gameInstance)||void 0===i?void 0:i.id})},ur=(e,t,r)=>{const i={index:e.index,isDeeplink:!1,id:e.id,listType:M.default,windowReferer:L.default};t.isFavoriteCard?r.eventPublisher.emit("clickOnFavoriteCellInternal",i):t.isUgcCard?r.eventPublisher.emit("clickOnUgcCardCellInternal",i):r.eventPublisher.emit("clickOnStoryInternal",i),r.eventPublisher.emit("clickOnStory",e)};var hr,pr,fr,gr,vr,mr;!function(e){e.LEFT="left",e.RIGHT="right"}(hr||(hr={})),function(e){e.FLAT="flat",e.COVER="cover",e.CUBE="cube"}(pr||(pr={})),function(e){e.LEFT="left",e.RIGHT="right"}(fr||(fr={})),function(e){e.CIRCLE="circle",e.QUAD="quad",e.RECTANGLE="rectangle"}(gr||(gr={})),function(e){e.vk="vk",e.ok="ok",e.facebook="facebook",e.twitter="twitter",e.linkedin="linkedin",e.telegram="telegram"}(vr||(vr={})),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"}(mr||(mr={}));class _r extends Tt{constructor(e,t){super(),this.storyListViewModel=e,this.story=t,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}get options(){return this.storyListViewModel.options.card}get isTitleCardInner(){return this.options.title.position===u.CARD_INSIDE_BOTTOM}get isTitleCardOutsideTop(){return this.options.title.position===u.CARD_OUTSIDE_TOP}get isTitleCardOutsideBottom(){return this.options.title.position===u.CARD_OUTSIDE_BOTTOM}get aspectRatio(){var e,t;const{aspectRatio:r,variant:i}=this.options;if(r)return r;switch(i){case mr.STYLE_CIRCLE:case mr.STYLE_QUAD:return 1;case mr.STYLE_RECTANGLE:return null!==(t=null===(e=this.storyListViewModel.session)||void 0===e?void 0:e.preview_aspect_ratio)&&void 0!==t?t:.8;default:return 1}}getImageSrc(){var e,t;return null===(t=null===(e=this.story.image)||void 0===e?void 0:e.findOneByCoverQuality(this.options.coverQuality))||void 0===t?void 0:t.url}onClick(e){this.storyListViewModel.onStoryClick(this,e)}}class yr extends _r{constructor(e,t){super(e,t)}getImageSrc(){var e,t;return null===(t=null===(e=this.story.image)||void 0===e?void 0:e.findOneByCoverQuality(this.storyListViewModel.options.favoriteCard.coverQuality))||void 0===t?void 0:t.url}}class wr extends _r{constructor(e,t,r){super(e,t),this.favoriteStories=r}}var br=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class Sr extends Tt{set modeDesktop(e){this._modeDesktop!==e&&(this._modeDesktop=e,this.emit("update"))}get modeDesktop(){return this._modeDesktop}get session(){return this._session}get defaultStories(){return this._defaultStories.slice()}get favoriteStories(){return this._favoriteStories.slice()}get ugcCard(){return this._ugcCard}get favoriteCard(){return this._favoriteCard}constructor(e,t,r){super(),this.appearanceManager=e,this.storiesService=t,this.params=r,this._defaultStories=[],this._favoriteStories=[],this._session=null,this._modeDesktop=!0,this.storyReader=null,this.subscriptions=[],this.setDefaultStories=this.setDefaultStories.bind(this),this.setFavoriteStories=this.setFavoriteStories.bind(this),this.hanldeShowStory=this.hanldeShowStory.bind(this),this.handleCloseStory=this.handleCloseStory.bind(this),this.subscribeToStoriesService(),this.emit("create")}get options(){return this.appearanceManager.storiesListOptions}get hasFavoriteCard(){return Boolean(this.appearanceManager.commonOptions.hasFavorite)&&this._favoriteStories.length>0}get hasUgcCard(){return this.params.useUgcCard}get hasFavoriteStories(){return this.appearanceManager.commonOptions.hasFavorite&&this.params.listType===Le.DEFAULT}onStoryClick(e,t=0){((e,t)=>{const{deeplink:r,hideInReader:i,gameInstance:s}=e,o=z()(r)&&r.trim().length>0,n=null==s?void 0:s.id;if(ar(Boolean(i),o,n,e.id))return;const a={id:e.id,index:t.index,isDeeplink:o,url:o?r:void 0};lr(a,e,t)})(e,{eventPublisher:this,index:t})}destroy(){var e,t;this.emit("destroy"),this.subscriptions.forEach((e=>e.unsubscribe())),this.removeAllListeners(),null===(e=this.storyReader)||void 0===e||e.off("showStory",this.hanldeShowStory),null===(t=this.storyReader)||void 0===t||t.off("closeStoryReader",this.handleCloseStory),this.subscriptions=[]}setStoryReader(e){this.storyReader=e,this.storyReader.on("showStory",this.hanldeShowStory),this.storyReader.on("closeStoryReader",this.handleCloseStory)}reload(){return br(this,void 0,void 0,(function*(){return this.loadStories({needFavorite:!1})}))}loadStories(e){var t;return br(this,void 0,void 0,(function*(){const r=Boolean(this.appearanceManager.commonOptions.hasFavorite)&&e.needFavorite,i={feed:this.params.identityFields.feedSlug,filter:{},defaultListLength:0,favoriteListLength:0,success:!0,error:{name:"",networkStatus:200,networkMessage:""}};try{this.emit("startLoading");const{defaultStories:e,favoriteStories:t}=yield this.storiesService.loadStories(Object.assign(Object.assign({},this.params),{needFavorite:r}));i.success=!0,i.error=null,i.defaultListLength=e.length,this.appearanceManager.commonOptions.hasFavorite&&this.params.listType===Le.DEFAULT&&(i.favoriteListLength=t.length)}catch(e){console.error(e),i.success=!1,i.error={name:e.name,networkMessage:e.networkMessage,networkStatus:e.networkStatus}}finally{i.filter=null!==(t=this.params.identityFields.filter)&&void 0!==t?t:{},this.emit("endLoading",i)}}))}hanldeShowStory(e){this.emit("openStory",e.id)}handleCloseStory(e){this.emit("closeStory",e.id)}subscribeToStoriesService(){const e=this.storiesService.observeDefaultStories(this.params.identityFields.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((e=>{this._session=e,this.emit("update")}));this.subscriptions.push(e,t)}setUgcAndFavoriteStoryCards(){if(this._ugcCard=void 0,this._favoriteCard=void 0,this.hasUgcCard){const e=qt.create(this.options);this._ugcCard=new _r(this,e)}if(this.hasFavoriteCard){const e=Vt.create(this.options);this._favoriteCard=new wr(this,e,this.favoriteStories)}}setDefaultStories(e){this._defaultStories=e.map((e=>new _r(this,e))),this.setUgcAndFavoriteStoryCards(),this.emit("update")}setFavoriteStories(e){this._favoriteStories=e.map((e=>new yr(this,e))),this.setUgcAndFavoriteStoryCards(),this.emit("update")}}class Cr{constructor(e,t,r){this.appearanceManager=e,this.storiesService=t,this.params=r}create(){return new Sr(this.appearanceManager,this.storiesService,this.params)}}var Or,kr=__webpack_require__(5304);class Lr extends n.EventEmitter{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,...r]=e.data;try{if(!Array.isArray(e.data))throw new Error(`Invalid MessageEvent data format ${e.data}`);this.emit(t,...r)}catch(e){console.error(e)}}sendMessage(e,t){var r;null===(r=this.iframe.contentWindow)||void 0===r||r.postMessage([e,t],this.origin)}destroy(){window.removeEventListener("message",this.messageListener,!1),this.removeAllListeners()}}!function(e){e.StartGame="startGame",e.GameComplete="gameComplete",e.GameInstanceEvent="gameInstanceEvent",e.OpenUrl="openUrl",e.SendApiRequest="sendApiRequest",e.StorySetLocalData="storySetLocalData",e.GameInstanceSetLocalData="gameInstanceSetLocalData",e.OpenSharePanel="openSharePanel"}(Or||(Or={}));var Mr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};const Ar=(0,R.createEffect)((({gameInstanceId:e,gameOptions:t})=>Mr(void 0,void 0,void 0,(function*(){var r,i;(null===(i=null===(r=ue.getState())||void 0===r?void 0:r.session)||void 0===i?void 0:i.id)||(yield he({}));const s={};t&&j()(t)&&null!=t.demoMode&&(s.demoMode=Boolean(t.demoMode));const o=yield ce.post(`game/${e}/launch?expand=config`,s);if(!o.ok)throw new Error(JSON.stringify(o.data));return o.data.clientConfig=xr(),o.data})))),xr=()=>{let e=ue.getState();const t=I.Tl.getState();return{sessionId:e.session.id,userKey:e.user_key,apiKey:t.apiKey,sdkVersion:"0.2.3",apiBaseUrl:H.C.apiUrl,userAgent:ae,appPackageId:t.appPackageId,deviceId:I.Ue.getState(),userId:t.userId?t.userId:"",lang:t.lang.toString(),placeholders:gi.combinedPlaceholders}},Er=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 Ir;function Rr(){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:Ir.LANDSCAPE_PRIMARY,"-90":Ir.LANDSCAPE_SECONDARY,0:Ir.PORTRAIT_PRIMARY,180:Ir.PORTRAIT_SECONDARY};function t(){}const r=new t,i=function(e){const t=["orientationchange","mozorientationchange","msorientationchange"],r=window.screen;for(let e=0;e<t.length;e++)if(null===r["on"+t[e]])return{delegate:r,event:t[e]};if(void 0!==window.onorientationchange)return{delegate:window,event:"orientationchange"};return{delegate:Nr(e),event:"change"}}(r);return t.prototype.addEventListener=Tr("addEventListener",i.delegate,i.event),t.prototype.dispatchEvent=Tr("dispatchEvent",i.delegate,i.event),t.prototype.removeEventListener=Tr("removeEventListener",i.delegate,i.event),t.prototype.lock=function(){var e,t="lockOrientation() is not available on this device.",r=window.screen;e=void 0===r?function(){return!1}:"function"==typeof r.msLockOrientation?r.msLockOrientation.bind(r):"function"==typeof r.mozLockOrientation?r.mozLockOrientation.bind(r):function(){return!1};return function(r){const i=window.Promise;return e(r)?i.resolve(r):i.reject(new Error(t))}}(),t.prototype.unlock=function(){var e=window.screen;return e&&e.orientation&&e.orientation.unlock.bind(e.orientation)||e.msUnlockOrientation&&e.msUnlockOrientation.bind(e)||e.mozUnlockOrientation&&e.mozUnlockOrientation.bind(e)||function(){}}(),Object.defineProperties(r,{onchange:{get:function(){return i.delegate["on"+i.event]||null},set:function(e){i.delegate["on"+i.event]=jr(e,r)}},type:{get:function(){var t=window.screen;return t.msOrientation||t.mozOrientation||e[window.orientation+""]||(Ur().matches?"landscape-primary":"portrait-primary")}},angle:{value:0}}),r}(),e}}function Tr(e,t,r){var i=this;return function(){var s=Array.prototype.slice.call(arguments);if("change"===(s[0].type?s[0].type:s[0])){s[0].type?s[0]=Fr(r,s[0]):s[0]=r;var o,n,a=jr(s[1],i);return"addEventListener"===e&&function(e,t){var r=Dr.indexOf(e);r>-1?Pr[r]=t:(Dr.push(e),Pr.push(t))}(s[1],a),"removeEventListener"===e&&(o=s[1],(n=Dr.indexOf(o))>-1&&(Dr.splice(n,1),Pr.splice(n,1))),s[1]=a,t[e].apply(t,s)}}}!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(Ir||(Ir={}));var Pr=[],Dr=[];function jr(e,t){var r=Dr.indexOf(e);return r>-1?Pr[r]:function(r){r.target!==t&&Br(r,"target",t),r.currentTarget!==t&&Br(r,"currentTarget",t),"change"!==r.type&&Br(r,"type","change"),e(r)}}function Fr(e,t){var r;try{r=new Event(e,t)}catch(e){r={type:"change"}}return r}function Nr(e){var t=Object.create({addEventListener:function(e,t){this.listeners[e]||(this.listeners[e]=[]),-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)},dispatchEvent:function(t){this.listeners[t.type]&&(this.listeners[t.type].forEach((function(e){e(t)})),"function"==typeof e.onchange&&e.onchange(t))},removeEventListener:function(e,t){if(this.listeners[e]){var r=this.listeners[e].indexOf(t);r>-1&&this.listeners[e].splice(r,1)}}});t.listeners={};var r=Ur();return r&&"boolean"==typeof r.matches&&r.addListener((function(){t.dispatchEvent(Fr("change"))})),t}function Ur(){return"function"!=typeof window.matchMedia?{}:window.matchMedia("(orientation: landscape)")}function Br(e,t,r){Object.defineProperty(e,t,{value:r})}var Gr;!function(e){e[e.IOS=0]="IOS",e[e.ANDROID=1]="ANDROID",e[e.OTHER=2]="OTHER"}(Gr||(Gr={}));class Vr{constructor(e,t,r){this.userKey=e,this.gameInstanceId=t,this.instanceUserData=r}set(e){const t=b()(this.get(),e);return window.localStorage.setItem(this.key,JSON.stringify(t)),t}get(){var e;let t={};const r=j()(this.instanceUserData)?this.instanceUserData:{};try{const r=JSON.parse(null!==(e=window.localStorage.getItem(this.key))&&void 0!==e?e:"{}");j()(r)&&(t=r)}catch(e){console.error(e)}return b()(t,r)}get key(){return`game_instance_data_${this.userKey}_${this.gameInstanceId}`}}class zr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const{id:t,callback:r}=JSON.parse(e),i=this.gameReaderViewModel.gameLaunch;if(!i)return;const s=new Vr(i.clientConfig.userKey,i.config.gameInstanceId,i.instanceUserData).get();this.gameCenterMessageService.sendMessage("cb",{cb:r,arguments:JSON.stringify([t,JSON.stringify(s)])})}}class Wr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const{gameInstanceId:t,data:r}=JSON.parse(e),i=this.gameReaderViewModel.gameLaunch;if(!i)return;const s=new Vr(i.clientConfig.userKey,i.config.gameInstanceId,i.instanceUserData).set(r);this.gameReaderViewModel.emit(Or.GameInstanceSetLocalData,{data:JSON.stringify(s)})}}var qr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};var $r,Zr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}($r||($r={}));class Hr{constructor(e,t,r){this.gameCenterMessageService=e,this.gameReaderViewModel=t,this.desktopMode=r}handle(e,t){var r,i,s;return Zr(this,void 0,void 0,(function*(){let o=null!==(r=null==t?void 0:t.url)&&void 0!==r?r:t.text,n=[];t.files&&Array.isArray(t.files)&&t.files.length>0&&(n=yield Promise.all(t.files.map((e=>(({file:e,name:t,type:r})=>qr(void 0,void 0,void 0,(function*(){const i=yield fetch(`data:${r};base64,${e}`),s=yield i.blob();return new File([s],t,{type:r,lastModified:(new Date).getTime()})})))(e)))));const a={url:null!=o?o:void 0,files:n.length>0?n:void 0,text:null!==(i=t.text)&&void 0!==i?i:void 0,title:null!==(s=t.title)&&void 0!==s?s:void 0};if(!(a.files&&a.files.length>0||a.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(a).then((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!0}))).catch((()=>this.gameReaderViewModel.confirmSharingComplete({shareId:e,isSuccess:!1})))}catch(t){console.error(t),this.openSharePanel({shareConfig:a,sharePath:o,shareId:e})}else this.openSharePanel({shareConfig:a,sharePath:o,shareId:e})}))}openSharePanel({shareConfig:e,sharePath:t,shareId:r}){let i=$r.Social,s=t;e.files&&e.files.length>0&&(i=$r.SlideScreenshot,s=URL.createObjectURL(e.files[0])),this.gameReaderViewModel.emit(Or.OpenSharePanel,{shareId:r,shareType:i,shareLink:s})}}class Kr{constructor(e){this.storyId=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 Qr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const t=JSON.parse(e);if(!j()(t))return;const{id:r,storyId:i,callback:s}=t;let o=new Kr(i).get();this.gameCenterMessageService.sendMessage("cb",{cb:s,arguments:JSON.stringify([r,JSON.stringify(o)])})}}class Yr{constructor(e,t){this.gameCenterMessageService=e,this.gameReaderViewModel=t}handle(e){const t=JSON.parse(e);if(!j()(t))return;const{storyId:r,data:i,sendToServer:s}=t;new Kr(r).set(i),s&&this.gameReaderViewModel.emit(Or.StorySetLocalData,{storyId:r,data:JSON.stringify(i)})}}var Xr=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class Jr extends n.EventEmitter{constructor(e){super(),this.appearanceManager=e,this._isOpened=!1,this._isGameInited=!1,this._isGameLoading=!1,this._gameLaunch=null,this._gameLaunchError=null,this._closeBtnVisible=!1,this.initGameRetryAttempts=0,this.gameCenterMessageService=null,this.safeAreaInsets={top:0,bottom:0,left:0,right:0},this.openGameOptions={},this.desktopMode=!0,this._options=e.gameReaderOptions,this.setAppearanceManager(e),this.handleUpdateGameReaderOptions=this.handleUpdateGameReaderOptions.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.handleKeydown=this.handleKeydown.bind(this),window.addEventListener("keydown",this.handleKeydown)}destroy(){var e;this.appearanceManager.off(s.EVENT_UPDATED_GAME_READER_OPTIONS,this.handleUpdateGameReaderOptions),window.removeEventListener("keydown",this.handleKeydown),null===(e=this.gameCenterMessageService)||void 0===e||e.destroy(),document.removeEventListener("visibilitychange",this.handleVisibilityChange)}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 options(){return this._options}get sharePanelOptions(){return this.appearanceManager.storyReaderOptions.sharePanel}get backdrop(){var e;const t=this._options.backdrop;return{background:null==t?void 0:t.background,opacity:null!==(e=null==t?void 0:t.opacity)&&void 0!==e?e:0,filter:(null==t?void 0:t.blur)?`blur(${t.blur}px)`:"none"}}openGame(e){return Xr(this,void 0,void 0,(function*(){this._gameInstanceId=e,this._isOpened=!0,yield this.launchGameById(e)}))}closeGame(){var e;return Xr(this,void 0,void 0,(function*(){return this._isGameInited?null===(e=this.gameCenterMessageService)||void 0===e||e.sendMessage("cb",{cb:"closeGameReader"}):this.handleGameComplete(),!0}))}setOpenGameOptions(e){this.openGameOptions=e,this.gameInstanceId&&this.reload()}reload(){this._gameLaunch=null,this.gameInstanceId?this.launchGameById(this.gameInstanceId):console.error("The game instance ID is undefined")}sendGameCenterEventByApiRequest(e,t){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.sendMessage("cb",{cb:e,plainData:t})}setSafeAreaInsets(e){this.safeAreaInsets=e}setDesktopMode(e){this.desktopMode=e}setAppearanceManager(e){this.appearanceManager.off(s.EVENT_UPDATED_GAME_READER_OPTIONS,this.handleUpdateGameReaderOptions),this._options=e.gameReaderOptions,this.appearanceManager=e,this.handleAppearanceManagerEvents(),this.emit("update")}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 r=new URL(this._gameLaunch.url).origin;this.gameCenterMessageService=new Lr(e,r),this.initGameCenter(this.gameCenterMessageService,this._gameLaunch)}pauseGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.sendMessage("cb",{cb:"pauseUI",arguments:JSON.stringify([])})}resumeGameUI(){var e;null===(e=this.gameCenterMessageService)||void 0===e||e.sendMessage("cb",{cb:"resumeUI",arguments:JSON.stringify([])})}confirmSharingComplete({shareId:e,isSuccess:t}){var r;null===(r=this.gameCenterMessageService)||void 0===r||r.sendMessage("shareComplete",{id:e,isSuccess:t})}launchGameById(e){return Xr(this,void 0,void 0,(function*(){try{this._gameLaunchError=null,this._isGameLoading=!0,this.emit("update"),this._gameLaunch=yield Ar({gameInstanceId:e,gameOptions:this.openGameOptions})}catch(e){this._gameLaunchError=e}finally{this.emit("update")}}))}initGameCenter(e,t){this.handleGameCenterEvents(e);const r=this.getGameConfig(t);e.sendMessage("cb",{cb:"initGame",arguments:JSON.stringify([r])})}getGameConfig(e){const t=e.screenOptions;let r;const i=document.querySelector("[nonce]");null!=i&&(r=i.nonce||i.getAttribute("nonce"));return b()(e.config,{clientConfig:Object.assign({fullScreen:!1,screenOrientation:t.orientation,safeAreaInsets:this.safeAreaInsets,nonce:r},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));const t={share:new Hr(e,this,this.desktopMode),storySetLocalData:new Yr(e,this),storyGetLocalData:new Qr(e,this),gameInstanceGetLocalData:new zr(e,this),gameInstanceSetLocalData:new Wr(e,this)};for(const[r,i]of Object.entries(t))e.on(r,((...e)=>i.handle(...e)))}handleGameLoaded(e){this._isGameInited=!0,this._isGameLoading=!1,this.emit(Or.StartGame),document.addEventListener("visibilitychange",this.handleVisibilityChange);const t=JSON.parse(e);j()(t)&&(this._closeBtnVisible=Boolean(t.showClose),this.emit("update"))}handleAppearanceManagerEvents(){this.appearanceManager.on(s.EVENT_UPDATED_GAME_READER_OPTIONS,this.handleUpdateGameReaderOptions)}handleUpdateGameReaderOptions(e){this._options=e,this.emit("update")}handleVisibilityChange(){"hidden"===document.visibilityState?this.pauseGameUI():"visible"===document.visibilityState&&this.resumeGameUI()}handleGameComplete(e){var t;this._isGameInited=!1,this._isOpened=!1,this._gameLaunch=null,null===(t=this.gameCenterMessageService)||void 0===t||t.destroy(),this.emit(Or.GameComplete,e),this.emit("update")}handleSendApiRequest(e){this.emit(Or.SendApiRequest,e)}handleOpenUrl(e){const{url:t}=JSON.parse(e);this.emit(Or.OpenUrl,{url:t})}handleGameEvent(e,t){this.emit(Or.GameInstanceEvent,{name:e,payload:t})}handleReloadGameReader(){const e=this._gameLaunch;this._gameLaunch=null,this.emit("update"),setTimeout((()=>{this._gameLaunch=e,this.emit("update")}))}handleGameLoadFailed(e,t){this.gameLaunch&&t&&this.initGameRetryAttempts<this.gameLaunch.canTryReloadCount?(this.initGameRetryAttempts++,this.handleReloadGameReader()):this._gameLaunchError=new Error(e)}handleKeydown(e){e.keyCode===Er.esc&&this.closeGame()}}class ei extends Pt{static sentData(e,t,r){return new Promise((i=>{r("apiRequest",{url:"story-data/"+e,method:"put",params:null,data:t,headers:null}).then((e=>{i({data:e.data,status:200,headers:[{}]})})).catch((e=>{i({data:e,status:400,headers:[{}]})}))}))}static sendApiRequest({url:e,method:t,params:r,headers:i,data:s,profilingKey:o},n){return new Promise((o=>{n("apiRequest",{url:e,method:t,params:r,data:s,headers:i}).then((e=>{o({data:e.data,status:200,headers:[{}]})})).catch((e=>{o({data:e,status:400,headers:[{}]})}))}))}static sendApiRequestPromise(e,t,r){const{id:i,url:s,method:o,params:n,headers:a,data:l,cb:d}=JSON.parse(e);return r("apiRequest",{url:s,method:o,params:n,data:l,headers:a}).then((e=>{let r=JSON.stringify({requestId:i,data:JSON.stringify(e.data),status:e.status,headers:e.headers});t(d,r)}),(e=>{let r=JSON.stringify({requestId:i,data:JSON.stringify(e),status:400,headers:[{}]});t(d,r)}))}}var ti=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};class ri extends Pt{static save(e,t,r){return ti(this,void 0,void 0,(function*(){try{return{data:(yield r("apiRequest",{url:`game/${e}/instance-user-data`,method:"post",params:null,data:t,headers:null})).data,status:200,headers:[{}]}}catch(e){return{data:e,status:400,headers:[{}]}}}))}}class ii extends n.EventEmitter{destroy(){}}var si=function(e,t,r,i){return new(r||(r=Promise))((function(s,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},oi=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const ni="{{__ugc__}}",ai=e=>e===ni?Le.UGC:Le.DEFAULT;(0,R.sample)({source:ue,clock:ue,filter:e=>{var t;return Boolean(null===(t=null==e?void 0:e.session)||void 0===t?void 0:t.id)},target:(0,R.createEffect)((e=>{const t=e.cache.filter((e=>"font-face"===e.type));(0,kr.eJ)(t)}))});class li extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`)}}const di=e=>{if(null==e||"object"!=typeof e)throw new li(null==e?"null":typeof e)};const ci=Object.prototype.hasOwnProperty,ui=(e,t)=>{let r=[];switch(e){case M.default:r=t?Pe.getState()[t]:[];break;case M.favorite:r=je.getState();break;case M.onboarding:r=t?De.getState()[t]:[]}return null!=r?r:[]},hi=()=>ue.getState().cache.filter((e=>"font-face"===e.type)),pi=()=>{const e=F.getState(),t=ot.getState(),r=[],i={};for(let t in e.default)ci.call(e.default,t)&&(i[t]={type:E.TEXT,name:t,value:e.default[t]});for(let t in e.user)ci.call(e.user,t)&&(i[t]={type:E.TEXT,name:t,value:e.user[t]});for(let e in i)ci.call(i,e)&&r.push(i[e]);const s={};for(let e in t.default)ci.call(t.default,e)&&(s[e]={type:E.IMAGE,name:e,value:t.default[e]});for(let e in t.user)ci.call(t.user,e)&&(s[e]={type:E.IMAGE,name:e,value:t.user[e]});for(let e in s)ci.call(s,e)&&r.push(s[e]);return r},fi=(e,t,r,i,s,o)=>si(void 0,void 0,void 0,(function*(){var s,n,a,l;const d=yield Lt({id:e,feedSlug:"",fetchShareUrl:i}),c=(new Date).getTime(),u=null===(n=null===(s=d.find((e=>"story"===e.ref)))||void 0===s?void 0:s.body)||void 0===n?void 0:n.id,h=Ee.getState().find((e=>e.id===u))||Me(u);h.slidesLoaded=!1;const p={windowReferer:L.default,listType:M.default,id:u,storyContext:Ye.getState(),storyList:[h],hasShare:ue.getState().share,placeholders:pi()};r.closeReader(),r.openReader(p,t,{listType:M.direct,feed:null},o);z()(e)&&P()(d)&&(e=null===(l=null===(a=d.find((e=>"story"===e.ref)))||void 0===a?void 0:a.body)||void 0===l?void 0:l.id,yield Xe({ids:[e],feedSlug:""}));const f=Ee.getState().find((t=>t.id===e));if(void 0!==f){r.setFonts(hi());const e=()=>{f.slidesLoaded=!0,r.setStoriesAndContext({listType:M.direct,storyList:[f],storyContext:Qe(ai(""),Ye.getState())})},t=Math.max(0,300-((new Date).getTime()-c));return t?setTimeout(e,t):e(),!0}return r.closeReader(),!1}));class gi extends n.EventEmitter{constructor(e,t){if(super(),this.storyListViewModels=[],this.storyReader=null,this._callbacks={},this.clickOnButtonAction=({src:e,payload:t})=>{if(G()(this._callbacks.storyLinkClickHandler)||this.listenerCount(x.CLICK_ON_STORY)>0){const r={src:e,srcRef:"default",data:t};try{G()(this._callbacks.storyLinkClickHandler)&&this._callbacks.storyLinkClickHandler(r),this.emit(x.CLICK_ON_STORY,r)}catch(e){console.error(e)}}else window.open(t.url,"_self")},this.SharePage=class extends n.EventEmitter{constructor(e,t,r,i="default"){return super(),this.options={},di(t),r&&(this.options=r),gi.instance._showSharePage(e,t,this.options,this).then((({storyReaderInstance:e,appearanceManager:t,result:r})=>{this.storyReaderWidget=e,this.appearanceManager=t})),this}closeStoryReader(){return si(this,void 0,void 0,(function*(){this.storyReaderWidget&&(gi.instance.closeGoodsWidget(),this.storyReaderWidget.closeReader())}))}},this._showSharePage=(e,t,r,i)=>si(this,void 0,void 0,(function*(){setTimeout((()=>{i.emit(xt.START_LOADING),G()(r.handleStartLoad)&&r.handleStartLoad()}));const s=yield this.initStoryReader(hi());this._config.disableStatistic;let o=!1;try{s.on("closeStoryReader",(e=>{if(G()(r.handleStoryReaderClose)||i.listenerCount(xt.CLOSE_STORY_READER)>0)try{G()(r.handleStoryReaderClose)&&r.handleStoryReaderClose(),i.emit(xt.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location!=window.parent.location?window.parent.location:window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}})),o=yield fi(e,t,s,void 0,0,{closeOnLastSlideByTimer:!1,recycleStoriesList:!1,_disableSession:this._config.disableStatistic})}catch(e){}return i.emit(xt.END_LOADING,{result:o}),G()(r.handleStopLoad)&&r.handleStopLoad(o),{storyReaderInstance:s,appearanceManager:t,result:o}})),this.onBeforeStoryReaderOpen=null,this.onBeforeFavoriteReaderOpen=null,this.onStoryReaderClosed=null,this.onFavoriteReaderClosed=null,gi.instance)console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead");else{if(!e.nonce){const t=document.querySelector("[nonce]");null!=t&&(e.nonce=t.nonce||t.getAttribute("nonce"))}(0,H.F)(e.apiKey),oe.getInstance().checkUserIdLength(e.userId),oe.getInstance().checkTagsLength(e.tags),(0,I.JG)(e),e.placeholders&&N(e.placeholders),e.imagePlaceholders&&nt(e.imagePlaceholders),t&&j()(t)&&(this._callbacks=t),fe(),gi.instance=this}return e.disableStatistic="com.inappstory.webpreview"===e.appPackageId,this._config=e,gi.instance}destroy(){null!=gi.instance&&(gi.instance=null,this.storyListViewModels.forEach((e=>e.destroy())),this.storyReader=null,this.storyListViewModels=[])}set storyLinkClickHandler(e){G()(e)&&(this._callbacks.storyLinkClickHandler=e)}set openGoodsWidgetHandler(e){G()(e)&&(this._callbacks.openGoodsWidgetHandler=e)}get openGoodsWidgetHandler(){return this._callbacks.openGoodsWidgetHandler}static getInstance(){return gi.instance?gi.instance:null}createStoryReaderViewModel(){return new ii}createGameReaderViewModel(){return this.gameReaderViewModel||(this.gameReaderViewModel=new Jr(new O),this.handleGameReaderViewModelEvents(this.gameReaderViewModel)),this.gameReaderViewModel}createStoryListViewModel(e){var{appearanceManager:t,identityFields:r,listType:i,isFavorite:s}=e,o=oi(e,["appearanceManager","identityFields","listType","isFavorite"]);di(t);const n=new nr(this),a=new Cr(t,n,Object.assign(Object.assign({},o),{identityFields:r,listType:i})).create();return this.handleStoryListViewModelEvents(a,{appearanceManager:t,listType:i,identityFields:r,isFavorite:s}),this.storyListViewModels.push(a),a}handleStoryListViewModelEvents(e,t){e.on("clickOnStoryInternal",(r=>si(this,void 0,void 0,(function*(){yield this.initStoryReaderByStoryListViewModel(e,t.appearanceManager),r.listType=t.isFavorite?M.favorite:M.default,r.windowReferer=t.isFavorite?L.favorite:L.default,this.handleClickOnStoryInternal(this.storyReader,r,t.identityFields,t.appearanceManager)})))).on("clickOnStoryDeepLink",(e=>{this.handleSetStoryOpened(e.id),this.handleClickOnStoryDeepLink(e,{listType:t.listType})})).on("clickOnStoryGame",(({id:e,gameInstanceId:r})=>{this.handleSetStoryOpened(e),this.openGame(r,t.appearanceManager)})).on("clickOnStory",(e=>this.handleClickOnStory(e,t.identityFields))).on("destroy",(()=>{this.storyListViewModels.splice(this.storyListViewModels.indexOf(e),1)}))}initStoryReaderByStoryListViewModel(e,t){return si(this,void 0,void 0,(function*(){const t=yield this.initStoryReader(hi());e.setStoryReader(t)}))}handleClickOnStoryDeepLink(e,{listType:t}){const r={data:[[1,0,e.id,0,0]]},i=()=>{e.isDeeplink&&e.url&&this.clickOnButtonAction({src:Et.STORY_LIST,payload:e})};t===Le.UGC||this._config.disableStatistic?i():de("session/update",r,J.createFunctionWithTimeout(i,1e3))}handleClickOnStory(e,t){if(0===e.id)this.emit("clickOnFavoriteCell",{feed:t.feedSlug});else{const r=t.feedSlug,i=t.filter,s=ai(r),o={title:null,tags:[],slidesCount:null,feed:null,filter:null,source:null},n=Ee.getState().find((t=>t.id===e.id));n&&(o.title=n.stat_title,o.tags=n.tags,o.slidesCount=n.slides_count),s===Le.DEFAULT?o.feed=r:s===Le.UGC&&(o.filter=i),o.source=k.list,this.emit("clickOnStory",Object.assign(Object.assign({},e),o))}}setTags(e){P()(e)&&(oe.getInstance().checkTagsLength(e),(0,I.ib)({tags:e}))}setUserId(e){return si(this,void 0,void 0,(function*(){(z()(e)||q()(e))&&(oe.getInstance().checkUserIdLength(e),(0,I.by)({userId:e}),fe(),yield this.closeAllReaders(),yield this.reloadAllStoryListInstances())}))}closeAllReaders(){var e,t;return si(this,void 0,void 0,(function*(){null===(e=this.storyReader)||void 0===e||e.closeReader(),null===(t=this.gameReaderViewModel)||void 0===t||t.closeGame()}))}reloadAllStoryListInstances(){return Promise.all(this.storyListViewModels.map((e=>e.reload())))}setLang(e){return si(this,void 0,void 0,(function*(){z()(e)&&((0,I.rN)({lang:e}),fe(),yield this.closeAllReaders(),yield this.reloadAllStoryListInstances())}))}setPlaceholders(e){j()(e)&&((0,I.Fn)({placeholders:e}),N(e))}setImagePlaceholders(e){j()(e)&&((0,I.qR)({imagePlaceholders:e}),nt(e))}handleClickOnStoryInternal(e,t,r,i){return si(this,void 0,void 0,(function*(){G()(this.onBeforeStoryReaderOpen)&&(yield this.onBeforeStoryReaderOpen());const s=(new Date).getTime(),o=ui(t.listType,r.feedSlug),n=ai(r.feedSlug);let a=ue.getState().share;n===Le.UGC&&(a=!1);const l=Object.assign(Object.assign({},t),{storyContext:Qe(n,Ye.getState()||Ke(n,o.map((e=>e.id)))),storyList:o,hasShare:a,placeholders:pi()});e.openReader(l,i,{listType:t.listType,identityFields:r});const d=Qe(n,Ye.getState());let c=null!==d&&""!==d.style;n===Le.DEFAULT&&d&&Be.getState()[n].length>0&&d.ids!==Be.getState()[n]&&(c=!1);const u=Ee.getState().find((e=>e.id===t.id&&e.type===n));if(c||!u||u.slidesLoaded)c?u&&u.slidesLoaded||(yield Ct({ids:[t.id],feedSlug:r.feedSlug})):Be.getState()[n].length&&(yield Xe({ids:Be.getState()[n],feedSlug:r.feedSlug}));else{let e=[];n===Le.DEFAULT&&(e=Be.getState()[n]),yield kt({ids:e,id:t.id,feedSlug:r.feedSlug})}const h=Be.getState()[n];h.length>0&&(yield Ct({ids:h,feedSlug:r.feedSlug}));const p=()=>{e.setStoriesAndContext({listType:t.listType,storyList:ui(t.listType,r.feedSlug),storyContext:Qe(n,Ye.getState()||Ke(n,h))})},f=Math.max(0,300-((new Date).getTime()-s));f?setTimeout(p,f):p()}))}handleRedirectToStoryInternal(e,t){var r,i;return si(this,void 0,void 0,(function*(){const s=(new Date).getTime(),o="default",n=t.id,a=Me(n),l={windowReferer:L.default,listType:M.default,id:a.id,storyContext:Ye.getState(),storyList:[a],hasShare:ue.getState().share,placeholders:pi()};e.silentClose=!0,e.closeReader(),e.openReader(l,e.getAppearanceManager(),{listType:M.direct,feed:o}),setTimeout((()=>e.silentClose=!1),300);const d=yield Lt({id:n,feedSlug:o});if(z()(n)&&P()(d)){const e=null===(i=null===(r=d.find((e=>"story"===e.ref)))||void 0===r?void 0:r.body)||void 0===i?void 0:i.id;yield Xe({ids:[e],feedSlug:o})}const c=Ee.getState().find((e=>e.id===n));if(void 0!==c){const r=()=>{e.setStoriesAndContext({listType:t.listType,storyList:[c],storyContext:Qe(ai(o),Ye.getState())})},i=Math.max(0,300-((new Date).getTime()-s));i?setTimeout(r,i):r()}return!0}))}handleSetStoryOpened(e){if(!st()(ue.getState().user_key)){const t=`u/${ue.getState().user_key}/s_opened`;let r=function(e){let t=null;if(At){let r=window.localStorage.getItem(e);null!==r&&z()(r)&&r.trim().length>0&&(t=JSON.parse(r))}return t}(t);P()(r)||(r=[]),r.push(e),r=Rt()(r),function(e,t){At&&window.localStorage.setItem(e,JSON.stringify(t))}(t,r)}ze({id:e})}handleApiRequest(e){var t,r,i,s,o,n,a,l,d;return si(this,void 0,void 0,(function*(){let c=!1,u="",h={url:null!==(r=null===(t=e.data)||void 0===t?void 0:t.url)&&void 0!==r?r:"",method:null!==(s=null===(i=e.data)||void 0===i?void 0:i.method)&&void 0!==s?s:"get"};-1!==["post","put","path"].indexOf(null===(o=e.data)||void 0===o?void 0:o.method)?h.data=null!==(a=null===(n=e.data)||void 0===n?void 0:n.data)&&void 0!==a?a:void 0:h.params=null!==(d=null===(l=e.data)||void 0===l?void 0:l.params)&&void 0!==d?d:void 0;const p={requestId:e.id};try{const e=yield ce.request(h);p.data=e.data,p.status=e.status,p.headers=e.headers,c=!0}catch(e){p.data=e,p.status=400,p.headers=[{}],u=e.toString()}return{name:e.cb,payload:{requestId:e.id,success:c,data:p,err:u}}}))}initStoryReader(e){return si(this,void 0,void 0,(function*(){return this.storyReaderPromise||(this.storyReaderPromise=this._initStoryReader(e)),this.storyReaderPromise}))}_initStoryReader(e){return si(this,void 0,void 0,(function*(){if(this.storyReader)return this.storyReader;const t=ve.getState();let r=new Y("body",{storyWidgetsResources:t});yield r.init(),r.setFonts(e),ve.getState().length>t.length&&(null==r||r.setStoryWidgetsResources(ve.getState())),ve.watch((e=>{null==r||r.setStoryWidgetsResources(e)})),r.setCallbacks({}),r.on("setStoryOpened",(e=>{this.handleSetStoryOpened(e.data.id),r.rpcCb(e.cb,{requestId:e.id,success:!0,data:e.data,err:""})})),r.on("updateStoryFavorite",(e=>si(this,void 0,void 0,(function*(){let t=!1;const i={favorite:void 0};let s="";try{const r=yield ce.post(`story-favorite/${e.data.id}`,{value:e.data.favorite});void 0!==r.data.favorite?(t=!0,i.favorite=Boolean(r.data.favorite),Ge({id:e.data.id,favorite:i.favorite}),!1===i.favorite?bt({storiesIdsUserEntity:Ie.FAVORITE,storyList:je.getState().filter((t=>t.id!==e.data.id))}):bt({storiesIdsUserEntity:Ie.FAVORITE,storyList:[...Ee.getState().filter((t=>t.id===e.data.id)),...je.getState()]})):s="response.data.favorite is undefined"}catch(e){s=e.toString()}r.rpcCb(e.cb,{requestId:e.id,success:t,data:i,err:s})})))),r.on("updateStoryLike",(e=>si(this,void 0,void 0,(function*(){let t=!1;const i={like:void 0};let s="";try{const r=yield ce.post(`story-like/${e.data.id}`,{value:e.data.like});void 0!==r.data.like?(t=!0,i.like=r.data.like,Ve({id:e.data.id,like:i.like})):s="response.data.like is undefined"}catch(e){s=e.toString()}r.rpcCb(e.cb,{requestId:e.id,success:t,data:i,err:s})})))),r.on("getStorySharePath",(e=>si(this,void 0,void 0,(function*(){let t=!1;const i={url:void 0};let s="";try{const r=yield ce.get(`story-share/${e.data.id}`,{});void 0!==r.data.url?(t=!0,i.url=r.data.url):s="response.data.url is undefined"}catch(e){s=e.toString()}r.rpcCb(e.cb,{requestId:e.id,success:t,data:i,err:s})})))),r.on("apiRequest",(e=>si(this,void 0,void 0,(function*(){const t=yield this.handleApiRequest(e);r.rpcCb(t.name,t.payload)})))),r.on("updateStoriesStat",(e=>si(this,void 0,void 0,(function*(){var t,i,s,o;const n=null!==(o=null===(s=null===(i=null===(t=r.options)||void 0===t?void 0:t.sourceInfo)||void 0===i?void 0:i.identityFields)||void 0===s?void 0:s.feedSlug)&&void 0!==o?o:"";let a=!1,l="";if(ai(n)===Le.UGC||this._config.disableStatistic)a=!0;else try{de("session/update",e.data,(()=>{})),a=!0}catch(e){l=e.toString()}r.rpcCb(e.cb,{requestId:e.id,success:a,data:{},err:l})})))),r.on("clickOnButton",(e=>{r.emit("widgetEvent",{name:"w-link",devPayload:{story_id:e.id,slide_index:e.index,widget_id:e.elementId,widget_label:e.label,widget_value:e.url}});const t=()=>this.clickOnButtonAction({src:Et.STORY_READER,payload:e});!this._config.disableStatistic&&e.dataForSending&&j()(e.dataForSending)&&Array.isArray(e.dataForSending.data)&&e.dataForSending.data.length>0?de("session/update",e.dataForSending,t):t()})),r.on("clickOnSwipeUpGoods",(e=>{})),r.on("closeStoryReader",(e=>{gi.instance.closeGoodsWidget()}));return["showSlide","showStory","closeStory","clickOnButton","likeStory","dislikeStory","favoriteStory","shareStory","shareStoryWithPath"].forEach((e=>r.on(e,(t=>{var i,s,o,n,a;const l=null===(i=r.options.sourceInfo)||void 0===i?void 0:i.listType,d=null===(o=null===(s=r.options.sourceInfo)||void 0===s?void 0:s.identityFields)||void 0===o?void 0:o.feedSlug,c=null===(a=null===(n=r.options.sourceInfo)||void 0===n?void 0:n.identityFields)||void 0===a?void 0:a.filter,u=ai(d),h={title:null,tags:[],slidesCount:null,feed:null,filter:null,source:null},p=Ee.getState().find((e=>e.id===t.id));if(p&&(h.title=p.stat_title,h.tags=p.tags,h.slidesCount=p.slides_count,p.type===Le.UGC&&(h.ugcPayload=j()(p.payload)?p.payload:{})),u===Le.DEFAULT?h.feed=d:u===Le.UGC&&(h.filter=c),l===M.direct?h.source=k.direct:l===M.default?h.source=k.list:l===M.onboarding?h.source=k.onboarding:l===M.favorite&&(h.source=k.favorite),null!=t.index&&-1===["clickOnStory","showStory"].indexOf(e)&&(t.payload=null,p&&p.slides_payload&&Array.isArray(p.slides_payload))){const e=p.slides_payload.find((e=>e.slide_index===t.index));null!=e&&e.payload&&(t.payload=e.payload)}"clickOnButton"===e&&delete t.dataForSending,this.emit(e,Object.assign(Object.assign({},t),h))})))),r.on("redirectToStory",(e=>r&&this.handleRedirectToStoryInternal(r,e))),r.on("widgetEvent",(e=>{var t,i,s;const o=null===(s=null===(i=null===(t=null==r?void 0:r.options)||void 0===t?void 0:t.sourceInfo)||void 0===i?void 0:i.identityFields)||void 0===s?void 0:s.feedSlug,n=Ae.getState()[o];this.emit("widgetEvent",{name:e.name,data:Object.assign(Object.assign({},e.devPayload),{feed_id:n.id})})})),r.on("openGameCenter",(({gameId:e})=>si(this,void 0,void 0,(function*(){var t;yield this.openGame(e,r.getAppearanceManager()),r.pauseAndBlockViewerUI({isInBackground:!0}),null===(t=this.gameReaderViewModel)||void 0===t||t.on("gameComplete",(()=>r.resumeAndEnableViewerUI()))})))),r.on("closeStoryReader",(e=>{G()(this.onStoryReaderClosed)&&this.onStoryReaderClosed()})),r.on("debugLog",(e=>{console.log("debugLog",e)})),this.storyReader=r,r}))}showOnboardingStories(e,t){return si(this,void 0,void 0,(function*(){const r=hi();let i="onboarding";t&&t.feed&&z()(t.feed)&&(i=t.feed),yield vt({defaultList:!1,onboardingList:i,favoriteList:!1,onboardingTags:t?t.customTags:void 0,limit:t?t.limit:void 0});const s=yield this.initStoryReader(r),o=ui(M.onboarding,i);if(o.length>0){const t={windowReferer:L.default,listType:M.onboarding,id:o[0].id};return yield this.handleClickOnStoryInternal(s,t,{feedSlug:i},e),!0}return!1}))}showStory(e,t,r="default"){return si(this,void 0,void 0,(function*(){di(t);const r=hi(),i=yield this.initStoryReader(r);return yield fi(e,t,i)}))}openGame(e,t,r={}){return si(this,void 0,void 0,(function*(){try{if(!this.gameReaderViewModel)throw new Error("You must create <GameReader> component instance");if(this.gameReaderViewModel.isOpened)throw new Error(`Close the launched game with ID "${this.gameReaderViewModel.gameInstanceId}"`);this.gameReaderViewModel.setAppearanceManager(t),this.gameReaderViewModel.setOpenGameOptions(r),yield this.gameReaderViewModel.openGame(e)}catch(e){console.error(e)}}))}closeGame(){return si(this,void 0,void 0,(function*(){return!!this.gameReaderViewModel&&this.gameReaderViewModel.closeGame()}))}handleGameReaderViewModelEvents(e){this.handleApiResponse=this.handleApiResponse.bind(this),e.on(Or.StartGame,(()=>this.emit("startGame",{id:e.gameInstanceId}))).on(Or.GameInstanceEvent,(e=>this.emit("gameEvent",e))).on(Or.GameComplete,(t=>{st()(t)?this.emit("closeGame",{id:e.gameInstanceId}):this.emit("finishGame",{id:e.gameInstanceId,result:t})})).on(Or.OpenUrl,(({url:t})=>{this.clickOnButtonAction({src:Et.GAME_READER,payload:{url:t,gameInstanceId:e.gameInstanceId}})})).on(Or.SendApiRequest,(t=>si(this,void 0,void 0,(function*(){ei.sendApiRequestPromise(t,((t,r)=>e.sendGameCenterEventByApiRequest(t,r)),this.handleApiResponse)})))).on(Or.StorySetLocalData,(({storyId:e,data:t})=>si(this,void 0,void 0,(function*(){ei.sentData(e,t,this.handleApiResponse)})))).on(Or.GameInstanceSetLocalData,(({data:t})=>si(this,void 0,void 0,(function*(){ri.save(e.gameInstanceId,t,this.handleApiResponse)}))))}handleApiResponse(e,t){return si(this,void 0,void 0,(function*(){const e=yield this.handleApiRequest(t);if(e.payload.success)return e.payload.data;throw e.payload.err}))}closeStoryReader(){var e;return si(this,void 0,void 0,(function*(){this.closeGoodsWidget(),null===(e=this.storyReader)||void 0===e||e.closeReader()}))}closeGoodsWidget(){}getUgcEditorConfig(){var e,t;return si(this,void 0,void 0,(function*(){let r=ue.getState();(null===(e=null==r?void 0:r.session)||void 0===e?void 0:e.id)||(yield he({})),(null==r?void 0:r.editor)||(yield Ze({}));const i=I.Tl.getState(),s=ue.getState(),o="0.2.3";return{sessionId:s.session.id,apiKey:i.apiKey,editor:null!==(t=s.editor)&&void 0!==t?t:{},sdkVersion:o,appPackageId:i.appPackageId,deviceId:I.Ue.getState(),userId:null!=i.userId?String(i.userId):void 0,lang:i.lang.toString()}}))}getNonce(){return this._config.nonce}get sdkVersionName(){return"0.2.3"}get sdkVersionCode(){return parseInt(203)}static get combinedPlaceholders(){return pi()}}var vi=__webpack_require__(2784),mi=__webpack_require__.n(vi);const _i={addEventListeners(e,t,r){for(var i=0,s=t.length;i<s;i++)e.addEventListener(t[i],r,{passive:!1})},removeEventListeners(e,t,r){for(var i=0,s=t.length;i<s;i++)e.removeEventListener(t[i],r,{passive:!1})},emitEvent:function(e,t,r){if(e.componentInstance)e.componentInstance.$emit(t,r);else{let i;"function"==typeof window.CustomEvent?i=new window.CustomEvent(t,{detail:r}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,r)),e.elm.dispatchEvent(i)}},addOnceEventListener:function(e,t,r,i){var s=o=>{r(o),e.removeEventListener(t,s,i)};e.addEventListener(t,s,i)}},yi=_i,wi=_i.addOnceEventListener,bi=["mousedown","touchstart"],Si=["mousemove","touchmove"],Ci=["mouseup","touchend"],Oi=["scroll"];var ki;!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(ki||(ki={}));class Li extends n.EventEmitter{get slides(){return Array.from(this.slider.children)}get elementRef(){return this.slider}get reachBeginning(){return this._reachBeginning}get reachEnd(){return this._reachEnd}get scrollWidth(){return this.slider.scrollWidth}constructor(){super(),this.isScrolling=!1,this.isDragging=!1,this.currentPosition={x:0,y:0},this.direction=ki.Horizontal,this.gap=20,this.rafId=0,this.lastClientX=0,this.lastClientY=0,this.pushed=!1,this.startClientX=0,this.startClientY=0,this._reachBeginning=!0,this._reachEnd=!1,this.desktopMode=!0,this.handleNativeScrollEnd=mi()((function(){this.emit("scrollend",this.currentPosition),this.isScrolling=!1}),300,{leading:!1}),this.handleNativeScroll=this.handleNativeScroll.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}mount(e){this.slider=e,yi.addEventListeners(this.slider,bi,this.handleMouseDown),yi.addEventListeners(this.slider,Oi,this.handleNativeScroll)}destroy(){this.removeAllListeners(),yi.removeEventListeners(this.slider,bi,this.handleMouseDown),yi.removeEventListeners(window,Ci,this.handleMouseUp),yi.removeEventListeners(window,Si,this.handleMouseMove),yi.removeEventListeners(this.slider,Oi,this.handleNativeScroll)}getLength(){var e,t;return null!==(t=null===(e=this.slider)||void 0===e?void 0:e.children.length)&&void 0!==t?t:0}getTranslate(){return this.direction===ki.Horizontal?this.currentPosition.x:this.currentPosition.y}getCurrentPosition(){return this.currentPosition}changeDirection(e){this.direction=e}setGap(e){this.gap=e}setDesktopMode(e){this.desktopMode=e}getGap(){return this.gap}scrollTo(e,t=300){const r=this.preparePosition(e,e);cancelAnimationFrame(this.rafId),t>0?this.scrollWithAnimation(r.x,r.y,t):(this.scrollToImmediately(r.x,r.y),this.emit("scrollend",this.currentPosition))}getSlidesPerView(){if(this.direction===ki.Horizontal&&this.slider.clientWidth){const e=this.slider.children[0].clientWidth+this.gap;return Math.round(this.slider.clientWidth/e)}if(this.direction===ki.Vertical&&this.slider.clientHeight){const e=this.slider.children[0].clientHeight+this.gap;return Math.round(this.slider.clientHeight/e)}return 1}handleMouseDown(e){if(!this.desktopMode)return;const t=e instanceof window.MouseEvent;this.pushed=!0,this.lastClientX=t?e.clientX:e.touches[0].clientX,this.lastClientY=t?e.clientY:e.touches[0].clientY,this.startClientX=this.lastClientX,this.startClientY=this.lastClientY,yi.addEventListeners(window,Ci,this.handleMouseUp),yi.addEventListeners(window,Si,this.handleMouseMove)}handleMouseUp(){this.pushed&&(this.pushed=!1,this.isDragging=!1,this.emit("scrollend",this.currentPosition),yi.removeEventListeners(window,Ci,this.handleMouseUp),yi.removeEventListeners(window,Si,this.handleMouseMove))}handleMouseMove(e){if(e.preventDefault(),!this.pushed)return;const t=e instanceof window.MouseEvent;let r,i;r=-this.lastClientX+(this.lastClientX=t?e.clientX:e.touches[0].clientX),i=-this.lastClientY+(this.lastClientY=t?e.clientY:e.touches[0].clientY);const s=Math.abs(this.startClientX-this.lastClientX),o=Math.abs(this.startClientY-this.lastClientY);!this.isDragging&&(s>=1||o>=1)&&(this.emit("scrollstart",this.currentPosition),this.isDragging=!0);const{x:n,y:a}=this.preparePosition(this.currentPosition.x-r,this.currentPosition.y-i);this.scrollToImmediately(n,a)}handleNativeScroll(e){this.isDragging||(this.isScrolling||(this.emit("scrollstart",this.currentPosition),this.isScrolling=!0),this.scrollToImmediately(this.slider.scrollLeft,this.slider.scrollTop),this.handleNativeScrollEnd())}scrollToImmediately(e,t){this.currentPosition.x=e,this.currentPosition.y=t,this.slider.scrollLeft=e,this.slider.scrollTop=t,this.testAttraction(),this.emit("scroll",this.currentPosition)}scrollWithAnimation(e=0,t=0,r=0){const i=performance.now(),s=e=>e*e,o=this.getTranslate(),n=e-this.currentPosition.x,a=t-this.currentPosition.y;if(Math.abs(n)<=1&&Math.abs(a)<=1)return;const l=()=>{this.rafId=requestAnimationFrame((d=>{const c=(d-i)/r;if(c>=1)return this.scrollToImmediately(e,t),void this.emit("scrollend",this.currentPosition);const u=s(c)*n+o,h=s(c)*a+o;this.scrollToImmediately(u,h),l()}))};l()}preparePosition(e,t){let r={x:e,y:t};return this.direction===ki.Horizontal?r.y=0:r.x=0,r=this.attractToBounds(r.x,r.y),r}attractToBounds(e,t){const r={x:e,y:t};return r.x=this.attractToBoundsByX(e),r.y=this.attractToBoundsByY(t),r}attractToBoundsByX(e){let t=e;return t<=0&&(t=0),t+this.slider.clientWidth>=this.slider.scrollWidth&&(t=this.slider.scrollWidth-this.slider.clientWidth),t}attractToBoundsByY(e){let t=e;return t<=0&&(t=0),t+this.slider.clientHeight>=this.slider.scrollHeight&&(t=this.slider.scrollHeight-this.slider.clientHeight),t}testAttraction(){this._reachBeginning=!1,this._reachEnd=!1,this.direction===ki.Horizontal?(0===this.currentPosition.x&&(this._reachBeginning=!0),this.currentPosition.x+this.slider.clientWidth>=this.slider.scrollWidth&&(this._reachEnd=!0)):(0===this.currentPosition.y&&(this._reachBeginning=!0),this.currentPosition.y+this.slider.clientHeight>=this.slider.scrollHeight&&(this._reachEnd=!0))}}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 Mi(e){return"string"==typeof e&&(!isNaN(Number(e))&&!isNaN(parseFloat(e)))}var Ai;!function(e){e.LANDSCAPE_PRIMARY="landscape-primary",e.LANDSCAPE_SECONDARY="landscape-secondary",e.PORTRAIT_PRIMARY="portrait-primary",e.PORTRAIT_SECONDARY="portrait-secondary"}(Ai||(Ai={}));var xi=__webpack_require__(1085),Ei=__webpack_require__(9155),Ii=__webpack_require__.n(Ei),Ri=__webpack_require__(8384),Ti=__webpack_require__.n(Ri);var Pi=function(e,t,r){var i=e.key+"-"+t.name;!1===r&&void 0===e.registered[i]&&(e.registered[i]=t.styles)};var Di={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function ji(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var Fi=/[A-Z]|^ms/g,Ni=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ui=function(e){return 45===e.charCodeAt(1)},Bi=function(e){return null!=e&&"boolean"!=typeof e},Gi=ji((function(e){return Ui(e)?e:e.replace(Fi,"-$&").toLowerCase()})),Vi=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ni,(function(e,t,r){return Wi={name:t,styles:r,next:Wi},t}))}return 1===Di[e]||Ui(e)||"number"!=typeof t||0===t?t:t+"px"};function zi(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return Wi={name:r.name,styles:r.styles,next:Wi},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)Wi={name:i.name,styles:i.styles,next:Wi},i=i.next;return r.styles+";"}return function(e,t,r){var i="";if(Array.isArray(r))for(var s=0;s<r.length;s++)i+=zi(e,t,r[s])+";";else for(var o in r){var n=r[o];if("object"!=typeof n)null!=t&&void 0!==t[n]?i+=o+"{"+t[n]+"}":Bi(n)&&(i+=Gi(o)+":"+Vi(o,n)+";");else if(!Array.isArray(n)||"string"!=typeof n[0]||null!=t&&void 0!==t[n[0]]){var a=zi(e,t,n);switch(o){case"animation":case"animationName":i+=Gi(o)+":"+a+";";break;default:i+=o+"{"+a+"}"}}else for(var l=0;l<n.length;l++)Bi(n[l])&&(i+=Gi(o)+":"+Vi(o,n[l])+";")}return i}(e,t,r);case"function":if(void 0!==e){var s=Wi,o=r(e);return Wi=s,zi(e,t,o)}}if(null==t)return r;var n=t[r];return void 0!==n?n:r}var Wi,qi=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var $i=!!Ei.useInsertionEffect&&Ei.useInsertionEffect,Zi=$i||function(e){return e()},Hi=($i||Ei.useLayoutEffect,{}.hasOwnProperty),Ki=Ei.createContext("undefined"!=typeof HTMLElement?Ti()({key:"css"}):null);Ki.Provider;var Qi=function(e){return(0,Ei.forwardRef)((function(t,r){var i=(0,Ei.useContext)(Ki);return e(t,i,r)}))};var Yi=Ei.createContext({});var Xi="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ji=function(e,t){var r={};for(var i in t)Hi.call(t,i)&&(r[i]=t[i]);return r[Xi]=e,r},es=function(e){var t=e.cache,r=e.serialized,i=e.isStringTag;return Pi(t,r,i),Zi((function(){return function(e,t,r){Pi(e,t,r);var i=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var s=t;do{e.insert(t===s?"."+i:"",s,e.sheet,!0),s=s.next}while(void 0!==s)}}(t,r,i)})),null};var ts=Qi((function(e,t,r){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var s=e[Xi],o=[i],n="";"string"==typeof e.className?n=function(e,t,r){var i="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):i+=r+" "})),i}(t.registered,o,e.className):null!=e.className&&(n=e.className+" ");var a=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=!0,s="";Wi=void 0;var o=e[0];null==o||void 0===o.raw?(i=!1,s+=zi(r,t,o)):s+=o[0];for(var n=1;n<e.length;n++)s+=zi(r,t,e[n]),i&&(s+=o[n]);qi.lastIndex=0;for(var a,l="";null!==(a=qi.exec(s));)l+="-"+a[1];return{name:function(e){for(var t,r=0,i=0,s=e.length;s>=4;++i,s-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(s){case 3:r^=(255&e.charCodeAt(i+2))<<16;case 2:r^=(255&e.charCodeAt(i+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(i)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(s)+l,styles:s,next:Wi}}(o,void 0,Ei.useContext(Yi));n+=t.key+"-"+a.name;var l={};for(var d in e)Hi.call(e,d)&&"css"!==d&&d!==Xi&&(l[d]=e[d]);return l.ref=r,l.className=n,Ei.createElement(Ei.Fragment,null,Ei.createElement(es,{cache:t,serialized:a,isStringTag:"string"==typeof s}),Ei.createElement(s,l))})),rs=(__webpack_require__(5985),xi.Fragment);function is(e,t,r){return Hi.call(t,"css")?xi.jsx(ts,Ji(e,t),r):xi.jsx(e,t,r)}function ss(e,t,r){return Hi.call(t,"css")?xi.jsxs(ts,Ji(e,t),r):xi.jsxs(e,t,r)}var os=__webpack_require__(3643);const ns=__webpack_require__.n(os)().getParser(window.navigator.userAgent).parse(),as=()=>{const[e,t]=(0,Ei.useState)(!1);(0,Ei.useLayoutEffect)((()=>(r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)})),[]);const r=()=>{"mobile"===ns.parsedResult.platform.type?t(!1):t(!0)};return e};var ls=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const ds=e=>{var{listType:t,feedSlug:r,testKey:i,storyManager:s,appearanceManager:o,filter:n,useUgcCard:a=!1,isFavorite:l}=e,d=ls(e,["listType","feedSlug","testKey","storyManager","appearanceManager","filter","useUgcCard","isFavorite"]);const[,c]=(0,Ei.useState)(0),[u,h]=(0,Ei.useState)(),p=as(),f=()=>{requestAnimationFrame((()=>c((e=>++e))))},g=()=>{var e;null===(e=d.onLoadStart)||void 0===e||e.call(d)},v=e=>{var t;null===(t=d.onLoadEnd)||void 0===t||t.call(d,e)};return(0,Ei.useEffect)((()=>{var e;const c=s.createStoryListViewModel({listType:t,testKey:i,identityFields:{feedSlug:r,filter:n},appearanceManager:o,useUgcCard:a,isFavorite:l});return c.on("update",f),l||(null===(e=d.viewModelExporter)||void 0===e||e.call(d,c),c.on("startLoading",g),c.on("endLoading",v),c.loadStories({needFavorite:!0})),h(c),()=>{c.destroy()}}),[s,i,r,n,o]),(0,Ei.useEffect)((()=>{if(u)return d.onFavoriteCardClick&&u.on("clickOnFavoriteCellInternal",d.onFavoriteCardClick),d.ugcCardClickHandler&&u.on("clickOnUgcCardCellInternal",d.ugcCardClickHandler),()=>{d.onFavoriteCardClick&&u.off("clickOnFavoriteCellInternal",d.onFavoriteCardClick),d.ugcCardClickHandler&&u.off("clickOnUgcCardCellInternal",d.ugcCardClickHandler)}}),[u,d.ugcCardClickHandler,d.onFavoriteCardClick]),(0,Ei.useEffect)((()=>{u&&(u.modeDesktop=p)}),[p,u]),u};function cs(e){return!/^(-?\d|--)/.test(e)}function us(e){const t=[];let r="",i="",s=7;for(let o,n=0;o=e.charAt(n);n++)if(/[a-zA-Z\d\xa0-\uffff_-]/.test(o)&&7===s)r+=o;else if("\\"===o&&7===s)s=6;else if(" "===o&&7===s){if(""!==r){if(!cs(r))return null;t.push(r),r=""}}else if(6===s)/[0-9a-f]/i.test(o)?(i+=o,s=8):(r+=o,s=7);else{if(8!==s)return null;/[0-9a-f]/i.test(o)&&i.length<6?i+=o:(r+=String.fromCodePoint(parseInt(i,16)),r+=o,i="",s=7)}if(""!==r){if(!cs(r))return null;t.push(r)}return t.join(" ")}function hs(e,t){let r=t,i="";const s={"font-family":[]};for(let t,o=0;t=e.charAt(o);o+=1)if(4!==r||'"'!==t&&"'"!==t)if(3===r&&","===t)r=4,i="";else if(4===r&&","===t){const e=us(i);e&&s["font-family"].push(e),i=""}else if(5===r&&" "===t)/^(?:\+|-)?(?:[0-9]*\.)?[0-9]+(?:deg|grad|rad|turn)$/.test(i)?(s["font-style"]+=" "+i,i=""):o-=1,r=1;else if(1!==r||" "!==t&&"/"!==t)2===r&&" "===t?(/^(?:\+|-)?([0-9]*\.)?[0-9]+(?:em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)?$/.test(i)&&(s["line-height"]=i),r=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))r="/"===t?2:4,s["font-size"]=i;else if(/^italic$/.test(i))s["font-style"]=i;else if(/^oblique$/.test(i))s["font-style"]=i,r=5;else if(/^small-caps$/.test(i))s["font-variant"]=i;else if(/^(?:bold(?:er)?|lighter|normal)$/.test(i))s["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&&(s["font-weight"]=i)}else/^(?:(?:ultra|extra|semi)-)?(?:condensed|expanded)$/.test(i)&&(s["font-stretch"]=i);i=""}else{let n=o+1;do{if(n=e.indexOf(t,n)+1,!n)return null}while("\\"===e.charAt(n-2));s["font-family"].push(e.slice(o+1,n-1).replace(/\\('|")/g,"$1")),o=n-1,r=3,i=""}if(3===r&&!/^\s*$/.test(i))return null;if(4===r){const e=us(i);e&&s["font-family"].push(e)}return s}var ps=__webpack_require__(9780),fs=__webpack_require__.n(ps);class gs{toString(){return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${this.fontSize}px/${this.lineHeight} ${this.fontFamily.join(", ")}`}clone(){const e=new gs;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 vs{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;let t={top:0,bottom:0};try{if("number"==typeof e)t.top=e,t.bottom=e;else{const r=fs()(e);t.top=parseFloat(r.top),t.bottom=parseFloat(r.bottom)}}catch(e){console.error(e)}const r=this.cardTitleOptions.lineClamp,i=Math.round(this.cardTitleFont.fontSize*this.cardTitleFont.lineHeight*100)/100;return t.top+t.bottom+r*i}measureScaledFontSizeInWebView(e){const t=document.createElement("span");t.style.fontSize=e+"px",t.style.display="none",this.obj.append(t);const r=getComputedStyle(t).fontSize;return this.obj.removeChild(t),parseFloat(r)||e}isOutsideTitle(){return this.cardTitleOptions.display&&(this.cardTitleOptions.position===u.CARD_OUTSIDE_TOP||this.cardTitleOptions.position===u.CARD_OUTSIDE_BOTTOM)}getCardTitleParsedFont(e){const t=new gs;t.fontStyle="normal",t.fontVariant="normal",t.fontWeight="normal",t.fontSize=14,t.lineHeight=1.2,t.fontFamily=["system-ui",'"Segoe UI"',"Roboto","Helvetica","Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'];try{const r=function(e){const t=hs(e,1);return null!==t&&t["font-size"]&&t["font-family"].length?t:null}(e);if(null!=r["font-style"]&&(t.fontStyle=r["font-style"]),null!=r["font-variant"]&&(t.fontVariant=r["font-variant"]),null!=r["font-weight"]&&(t.fontWeight=r["font-weight"]),null!=r["font-size"]){const e=parseFloat(r["font-size"]);String(`${e}px`)===r["font-size"]&&(t.fontSize=e)}if(null!=r["line-height"]){const e=parseFloat(r["line-height"]);String(`${e}px`)===r["line-height"]?t.lineHeight=Math.round(e/t.fontSize*100)/100:String(e)===r["line-height"]&&(t.lineHeight=parseFloat(r["line-height"]))}null!=r["font-family"]&&Array.isArray(r["font-family"])&&(t.fontFamily=r["font-family"])}catch(e){console.error(e)}return t}}class ms{constructor(e){this.storiesListOptions=e}getStoriesListStyleOptions(e){var t,r,i,s,o,n;let a={storiesHeight:null!==(r=null===(t=this.storiesListOptions.card)||void 0===t?void 0:t.height)&&void 0!==r?r:70,storiesLayoutHeight:null!==(s=null===(i=this.storiesListOptions.layout)||void 0===i?void 0:i.height)&&void 0!==s?s:0,storiesListTopPadding:null!==(o=this.storiesListOptions.topPadding)&&void 0!==o?o:0,storiesListBottomPadding:null!==(n=this.storiesListOptions.bottomPadding)&&void 0!==n?n:0},l=parseFloat(a.storiesHeight),d=l;if(parseFloat(a.storiesLayoutHeight))return l=parseFloat(a.storiesLayoutHeight),{storiesListHeight:l,storiesListInnerHeight:d};return l+=parseFloat(a.storiesListTopPadding)+parseFloat(a.storiesListBottomPadding)+e,d+=e,{storiesListHeight:l,storiesListInnerHeight:d}}}const _s=(e,t,r)=>{const i=(e,t)=>{const r=e.getCardTitleFont();r.fontSize=e.getScaledFontSizeInWebView(),t.card.title.font=r.toString()},o=(e,t)=>{const r=new ms(t),{storiesListHeight:i,storiesListInnerHeight:s}=r.getStoriesListStyleOptions(e.getStoryTitleBlockHeight()),o=t.layout.height;t.layout.height=q()(o)?`${i}px`:o},n=t=>{((e,t)=>{const r=new vs(e,t.card.title);i(r,t),o(r,t)})(e.current,t),r.emit("update")};(0,Ei.useLayoutEffect)((()=>(n(t.storiesListOptions),t.on(s.EVENT_UPDATED_STORIES_LIST_OPTIONS,n),()=>{t.off(s.EVENT_UPDATED_STORIES_LIST_OPTIONS,n)})),[t,r])},ys=e=>{const[t,r]=(0,Ei.useState)(!1),[i,s]=(0,Ei.useState)(null),{ref:o}=(e=>{const t=(0,Ei.useRef)(null);return(0,Ei.useEffect)((()=>{if(!t.current)return;const r=new Li;return r.mount(t.current),e(r),()=>{r.destroy()}}),[]),{ref:t}})((e=>{s(e),e.addListener("scrollstart",(()=>r(!0))),e.addListener("scrollend",(()=>setTimeout((()=>r(!1)),100)))}));return(0,Ei.useEffect)((()=>{i&&(i.setGap(e.options.card.gap),i.setDesktopMode(e.modeDesktop),i.changeDirection(e.options.direction))}),[i,e.options.card.gap,e.modeDesktop,e.options.direction]),{sliderRef:o,slider:i,isScrolling:t}};var ws=__webpack_require__(992),bs=__webpack_require__.n(ws),Ss=__webpack_require__(2591),Cs=__webpack_require__.n(Ss),Os=__webpack_require__(5213),ks={insert:"head",singleton:!1};Cs()(Os.A,ks);const Ls=Os.A.locals||{},Ms=({slider:e,storyListViewModel:t,isFavorite:r,listType:i,identityFields:s,storyManager:o})=>{const n=(({storyManager:e,listType:t,identityFields:r})=>{const[i,s]=(0,Ei.useState)();return(0,Ei.useEffect)((()=>{const i=new Yt(e,{listType:t,identityFields:r}).create();return s(i),()=>{i.destroy()}}),[r.feedSlug,r.filter]),i})({listType:i,identityFields:s,storyManager:o});(0,Ei.useEffect)((()=>{if(!e||r||!n)return;let t=0,i=0,s=0,o=0;const l=({x:e,y:r})=>{t=e,s=r,i=0,o=0},d=({x:e,y:r})=>{t=Math.min(e,t),i=Math.max(e,i),s=Math.min(r,s),o=Math.max(r,o),n.calculate({minOffsetLeft:t,maxOffsetLeft:i,minOffsetTop:s,maxOffsetTop:o})};e.addListener("scrollstart",l),e.addListener("scrollend",d);const c=mi()(a,600,{leading:!1});return window.addEventListener("scroll",c),window.addEventListener("resize",c),()=>{null==e||e.removeListener("scrollstart",l),null==e||e.removeListener("scrollend",d),window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}}),[e,r]),(0,Ei.useEffect)((()=>{r||a()}),[t.options.direction,t.options.card.aspectRatio,t.options.card.height,t.session,r,n]);const a=()=>{if(!e||!n)return;const t=e.elementRef.getBoundingClientRect(),{x:r,y:i}=e.getCurrentPosition();l(t),n.calculate({minOffsetLeft:r,maxOffsetLeft:r,minOffsetTop:i,maxOffsetTop:i})};(0,Ei.useEffect)((()=>{if(!n)return;const e=e=>n.markStoryAsFullVisible(e);return t.on("openStory",e),()=>{t.off("openStory",e)}}),[t]);const l=e=>{const{left:t,top:r,width:i,height:s}=e,o=new $t(t,r,i,s);d(o),u(o)},d=e=>{const t=new $t(0,0,window.innerWidth,window.innerHeight),r=c(t,e);h(r,e),n.setViewport(r)},c=(e,t)=>{let r=new $t;return t.overlaps(e)?(r=t.getIntersection(e),r):r},u=t=>{if(!e)return;const r=e.slides,i=[];r.forEach(((e,s)=>{const o=Number(e.dataset.id),n=new Qt(o,e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight);i.push(n),n.x+=t.x,n.y+=t.y,f(n,s,r.length-1)})),n.setStoryRects(i)},h=(e,t)=>{if(t.width<768)return;const r=p();e.x+=r.left,e.y+=r.top,e.height-=r.top+r.bottom,e.width-=r.left+r.right},p=()=>{const e=t.options.sidePadding,r={left:e,right:e,top:t.options.topPadding,bottom:t.options.bottomPadding};return"vertical"===t.options.direction&&(r.left=0,r.right=0),r},f=(e,t,r)=>{const i=p();e.x+=i.left,0===t&&(e.x+=i.left,e.width-=i.left),t===r&&(e.width-=i.right)}},As=(e,t,r)=>{(0,Ei.useEffect)((()=>{if(e)return t.on("closeStory",i),()=>{t.off("closeStory",i)}}),[e]);const i=i=>{if(!e)return;const s=e.slides.find((e=>Number(e.dataset.id)===i));if(!s||((e,t)=>{const i=new $t(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight),{x:s,y:o}=e.getCurrentPosition(),n=r.current.getBoundingClientRect(),a=new $t(n.x+s,n.y+o,n.width,n.height);return i.overlaps(a)})(e,s))return;const o="horizontal"===t.options.direction?s.offsetLeft:s.offsetTop;e.scrollTo(o)}},xs=(0,Ei.forwardRef)(((e,t)=>{const r=e.sliderOptions.card,i=e.sliderOptions.favoriteCard,s=r.border,o=r.opened.border,n=e.sliderOptions.navigation,a=()=>{var e,t,r;return(null!==(e=o.radius)&&void 0!==e?e:s.radius)-parseFloat(null!==(t=o.width)&&void 0!==t?t:s.width)/2-parseFloat(null!==(r=o.gap)&&void 0!==r?r:s.gap)};return is("div",{ref:t,className:e.className,style:Object.assign(Object.assign({},(()=>{var t,l,d,c,u,h,p,f,g,v,m,_,y,w,b,S,C,O,k,L,M;const A=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};let x={"--storiesBorderNotReadColor":s.color,"--storiesBorderReadColor":null!==(t=o.color)&&void 0!==t?t:s.color,"--storiesBorderNotReadGradientColor":null==s?void 0:s.gradient,"--storiesBorderReadGradientColor":null!==(l=null==o?void 0:o.gradient)&&void 0!==l?l:null==s?void 0:s.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":r.gap+"px","--storiesHeight":r.height+"px","--storiesListSidePadding":e.sliderOptions.sidePadding+"px","--storiesListBorderNotReadWidth":s.width+"px","--storiesListBorderReadWidth":(null!==(u=o.width)&&void 0!==u?u:o.width)+"px","--storiesListBorderGapNotRead":s.gap+"px","--storiesListBorderGapRead":(null!==(h=o.gap)&&void 0!==h?h:o.gap)+"px","--storiesListBorderRadius":s.radius+"px","--storiesListBorderRadiusRead":(null!==(p=o.radius)&&void 0!==p?p:o.radius)+"px","--storiesListItemMaskColor":r.mask.color,"--storiesListItemOpenedMaskColor":null!==(f=r.opened.mask.color)&&void 0!==f?f:r.mask.color,"--storiesListItemMaskLinearGradient":A(r.mask),"--storiesListItemOpenedMaskLinearGradient":A(null!=(null===(v=null===(g=r.opened)||void 0===g?void 0:g.mask)||void 0===v?void 0:v.linearGradient)?r.opened.mask:r.mask),"--storiesListCardFavoriteTitle":Mi(i.title.padding.toString())?i.title.padding+"px":i.title.padding,"--storiesListCardFavoriteGap":Mi(i.gap.toString())?i.gap+"px":i.gap,"--storiesListCardUgcMaskColor":e.sliderOptions.ugcCard.mask.color,"--storiesListCardUgcMaskLinearGradient":A(e.sliderOptions.ugcCard.mask),"--storiesListItemTitleColor":r.title.color,"--storiesListItemTitleFontFamily":"InternalPrimaryFont","--storiesListItemTitleFont":r.title.font,"--storiesListItemTitlePadding":Mi(r.title.padding.toString())?r.title.padding+"px":r.title.padding,"--storiesListControlsSize":Mi(n.controlsSize.toString())?n.controlsSize+"px":n.controlsSize,"--storiesListControlsBackgroundColor":n.controlsBackgroundColor,"--storiesListControlsColor":n.controlsColor,"--storiesListInnerBorderRadiusNotRead":s.radius-parseFloat(s.width)/2-parseFloat(s.gap)+"px","--storiesListInnerBorderRadiusRead":a()+"px","--storiesListCardDropShadow":r.dropShadow,"--storiesListCardOpenedDropShadow":null!==(m=r.opened.dropShadow)&&void 0!==m?m:r.dropShadow,"--storiesListCardFavoriteDropShadow":e.sliderOptions.favoriteCard.dropShadow,"--storiesListCardUgcDropShadow":e.sliderOptions.ugcCard.dropShadow,"--storiesListCardMask":(null===(_=r.svgMask)||void 0===_?void 0:_.cardMask)?`url("data:image/svg+xml,${Wt(null===(y=r.svgMask)||void 0===y?void 0:y.cardMask)}")`:null,"--storiesListCardOpenedMask":(null===(w=r.opened.svgMask)||void 0===w?void 0:w.cardMask)?`url("data:image/svg+xml,${Wt(null===(b=r.opened.svgMask)||void 0===b?void 0:b.cardMask)}")`:null,"--storiesListCardFavoriteMask":(null===(S=e.sliderOptions.ugcCard.svgMask)||void 0===S?void 0:S.cardMask)?`url("data:image/svg+xml,${Wt(null===(C=e.sliderOptions.ugcCard.svgMask)||void 0===C?void 0:C.cardMask)}")`:null},E=null;return E=null===(O=r.svgMask)||void 0===O?void 0:O.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>x[`--storiesListCardOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${Wt(e.mask)}")`:null)),E=null===(k=r.opened.svgMask)||void 0===k?void 0:k.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>x[`--storiesListCardOpenedOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${Wt(e.mask)}")`:null)),E=null===(L=e.sliderOptions.favoriteCard.svgMask)||void 0===L?void 0:L.overlayMask,null!=E&&Array.isArray(E)&&E.forEach(((e,t)=>x[`--storiesListCardFavoriteOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${Wt(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)=>x[`--storiesListCardUgcOverlay${t}Mask`]=e.mask?`url("data:image/svg+xml,${Wt(e.mask)}")`:null)),x})()),e.style),children:e.children})})),Es=navigator.vendor&&navigator.vendor.indexOf("Apple")>-1&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS"),Is=({videoCoverSrc:e,onVideoCoverLoaded:t})=>{const r=(0,Ei.useRef)(null);return(0,Ei.useEffect)((()=>{(()=>{if(!e)return;const i=r.current,s=()=>{i.play().then((()=>{if(Es){let e=1;const r=()=>{e>=2&&(i.removeEventListener("timeupdate",r),i.currentTime=0,t()),e++};i.addEventListener("timeupdate",r,!1)}else t()})).catch((e=>{console.error(e)})),i.removeEventListener("canplaythrough",s)};i.addEventListener("canplaythrough",s),i.load()})()}),[]),is("video",{ref:r,src:e,loop:!0,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"auto"})},Rs=({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:i})=>{const s=(e,t)=>null!=t&&Array.isArray(t)?t.map(((t,r)=>o(t,e,r))):[],o=(e,t,r)=>({maskImage:`var(--${t}${r}Mask)`,WebKitMaskImage:`var(--${t}${r}Mask)`,background:e.background});return{getAllCardsOverlayMaskStyles:()=>{let o=[];var n;return e.isFavoriteCard&&(o=o.concat(s("storiesListCardFavoriteOverlay",null===(n=r.svgMask)||void 0===n?void 0:n.overlayMask))),o=e.isUgcCard?o.concat((()=>{var e;return s("storiesListCardUgcOverlay",null===(e=i.svgMask)||void 0===e?void 0:e.overlayMask)})()):e.isOpened?o.concat((()=>{var e;return s("storiesListCardOpenedOverlay",null===(e=t.opened.svgMask)||void 0===e?void 0:e.overlayMask)})()):o.concat((()=>{var e;return s("storiesListCardOverlay",null===(e=t.svgMask)||void 0===e?void 0:e.overlayMask)})()),o}}};var Ts=__webpack_require__(6892),Ps={insert:"head",singleton:!1};Cs()(Ts.A,Ps);const Ds=Ts.A.locals||{},js=({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:s,isScrolling:o,wrapperStyle:n,children:a,onClick:l})=>{const d={story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:s},[u,h]=(0,Ei.useState)(!1),{getAllCardsOverlayMaskStyles:p}=Rs(d),{getCardTitleAlignClass:f,getTitleStyle:g,getTitleWrapperStyle:v}=(({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:i})=>({getCardTitleAlignClass:()=>({[Ds["align-left"]]:t.title.textAlign===c.LEFT,[Ds["align-center"]]:t.title.textAlign===c.CENTER,[Ds["align-right"]]:t.title.textAlign===c.RIGHT}),getTitleStyle:()=>{let r={};return e.titleColor&&e.isTitleCardInner&&Object.assign(r,{color:e.titleColor}),r.WebkitLineClamp=String(parseInt(t.title.lineClamp)),r},getTitleWrapperStyle:()=>{let t={};return e.titleColor&&e.isFavoriteCard&&(t=Object.assign(Object.assign({},t),{color:r.title.color})),e.titleColor&&e.isUgcCard&&(t=Object.assign(Object.assign({},t),{color:i.title.color})),t}}))(d),{getSlideClassList:m,getSlideStyleList:_,getSlideWrapperStyle:y}=(({story:e,cardOptions:t,favoriteCardOptions:r,ugcCardOptions:s})=>{const o=e.aspectRatio;return{getSlideClassList:()=>{var o,n;const a=e.background;let l="";void 0!==a&&(l=Ds[`_background-color-${a.color}`+(!0===a.gradient?"-gradient":"")]);const d=(()=>{let i;return i=e.isFavoriteCard?r:e.isUgcCard?s:e.isOpened&&t.opened||t,i})(),c=Boolean(d.dropShadow),u=Boolean(null===(o=d.svgMask)||void 0===o?void 0:o.cardMask),h=Boolean(null===(n=d.border)||void 0===n?void 0:n.gradient);return[l,{[Ds["_is-read"]]:e.isOpened},{[Ds["_format-rectangle"]]:t.variant===i.STYLE_RECTANGLE},{[Ds["_format-circle"]]:t.variant===i.STYLE_CIRCLE},{[Ds["_format-quad"]]:t.variant===i.STYLE_QUAD},{[Ds["_favorite-cell"]]:e.isFavoriteCard},{[Ds["_ugc-cell"]]:e.isUgcCard},{[Ds["_has-drop-shadow"]]:c},{[Ds["_has-card-svg-mask"]]:u},{[Ds["_has-border-gradient-color"]]:h}]},getSlideStyleList:()=>{const r={width:o*t.height+"px",opacity:null!==t.opacity?t.opacity:1,boxShadow:t.boxShadow||"unset",height:`${t.height}px`};return e.isOpened&&(r.boxShadow=t.opened.boxShadow||r.boxShadow,r.opacity=null!==t.opened.opacity?t.opened.opacity:r.opacity),r},getSlideWrapperStyle:()=>{let e={};return e.width=o*t.height+"px",e}}})(d),w=e.getImageSrc();return ss("a",{"data-id":e.id,className:bs()(Ds["stories-slide-wrapper"],{[Ds.isTitleCardOutsideTop]:e.isTitleCardOutsideTop,[Ds.isTitleCardOutsideBottom]:e.isTitleCardOutsideBottom}),style:Object.assign(Object.assign({},y()),n),rel:"noreferrer",onClick:t=>{o||(t.stopPropagation(),t.preventDefault(),l(e))},children:[t.title.display&&e.isTitleCardOutsideTop&&is("div",{className:bs()(Ds["stories-slide__content"],Ds[" __position_outside_top"]),style:v(),children:is("div",{className:bs()(Ds["stories-slide__title clamp"],f()),style:g(),children:e.title})}),ss("div",{className:bs()(Ds["stories-slide"],m()),style:_(),children:[ss("div",{className:Ds["stories-slide__inner"],children:[is("div",{className:Ds["stories-slide-image"],style:{backgroundColor:e.backgroundColor?e.backgroundColor:"transparent"},children:is("div",{className:Ds["stories-slide-image__wrap"],children:ss("div",{className:bs()(Ds["stories-slide-image__image"],Ds._mode_list,{[Ds["video-loaded"]]:u,[Ds["ugc-card-cell"]]:e.isUgcCard}),children:[w&&is("img",{src:w,alt:e.title,loading:t.coverLazyLoading?"lazy":"eager"}),e.videoCoverSrc&&is(Is,{onVideoCoverLoaded:()=>h(!0),videoCoverSrc:e.videoCoverSrc}),a]})})}),is("div",{className:Ds["stories-slide__mask"]}),t.title.display&&e.isTitleCardInner&&is("div",{className:Ds["stories-slide__content"],style:v(),children:is("div",{className:bs()(Ds["stories-slide__title clamp"],f()),style:g(),children:e.title})})]}),p().map(((e,t)=>is("div",{style:e,className:Ds["card-overlay-svg-mask"]},t)))]}),t.title.display&&e.isTitleCardOutsideBottom&&is("div",{className:bs()(Ds["stories-slide__content"],Ds.__position_outside_bottom),style:v(),children:is("div",{className:bs()(Ds["stories-slide__title clamp"],f()),style:g(),children:e.title})})]})};var Fs=__webpack_require__(1980),Ns={insert:"head",singleton:!1};Cs()(Fs.A,Ns);const Us=Fs.A.locals||{};var Bs=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Gs=e=>{var{sliderDirection:t,slider:r}=e,i=Bs(e,["sliderDirection","slider"]);const[s,o]=(0,Ei.useState)(!0),[n,a]=(0,Ei.useState)(!1);(0,Ei.useEffect)((()=>(r.addListener("scroll",l),()=>{r.removeListener("scroll",l)})),[r]);const l=()=>{o(r.reachBeginning),a(r.reachEnd)},d=e=>{const s=r.getSlidesPerView(),o=r.getTranslate(),n=(()=>{var e;return(null===(e=r.slides[0])||void 0===e?void 0:e.clientWidth)+r.getGap()})(),a=(()=>{var e;return(null===(e=r.slides[0])||void 0===e?void 0:e.clientHeight)+r.getGap()})(),l=o+e*s*(t===ki.Horizontal?n:a);r.scrollTo(l,i.navigationOptions.speed)};return i.navigationView?i.navigationView({defaultStyles:Us,reachStart:s,reachEnd:n,onPrev:()=>d(-1),onNext:()=>d(1),slider:{currentPosition:r.getTranslate(),direction:t,viewport:r.elementRef.getBoundingClientRect()}}):i.navigationOptions.showControls?ss("div",{className:bs()(Us["stories-list-controls"],Us[t]),children:[is("div",{onClick:()=>d(-1),className:bs()(Us["control-start"],{active:s}),children:is("div",{className:Us["control-icon"]})}),is("div",{onClick:()=>d(1),className:bs()(Us["control-end"],{active:n}),children:is("div",{className:Us["control-icon"]})})]}):null};var Vs=__webpack_require__(7966),zs={insert:"head",singleton:!1};Cs()(Vs.A,zs);const Ws=Vs.A.locals||{},qs=({favoriteStories:e,cardOptions:t})=>{const r=e=>({paddingTop:1/e.aspectRatio*100+"%"}),s=e=>{const t=e.getImageSrc(),r={};return t?r.backgroundImage=`url('${t}')`:r.backgroundColor=e.backgroundColor,r};return is("div",{className:Ws["favorite-images-wrapper"],children:e.slice(0,4).map(((e,o)=>is("div",{className:Ws["favorite-image-wrapper"],children:is("div",{style:r(e),className:bs()(Ws["favorite-image"],{[Ws.circle_style]:t.variant===i.STYLE_CIRCLE}),children:is("div",{className:Ws["favorite-image-item"],style:s(e)})})},o)))})};var $s=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Zs=e=>{var{viewModelExporter:t,onLoadStart:r,onLoadEnd:i,isFavorite:s=!1,storyListViewModel:o}=e,n=$s(e,["viewModelExporter","onLoadStart","onLoadEnd","isFavorite","storyListViewModel"]);const a=(0,Ei.useRef)(null),d=(0,Ei.useRef)(null);_s(a,n.appearanceManager,o);const{sliderRef:c,slider:h,isScrolling:p}=ys(o);Ms({slider:h,storyListViewModel:o,isFavorite:s,listType:n.listType,identityFields:{feedSlug:n.feedSlug,filter:n.filter},storyManager:n.storyManager}),((e,t,r)=>{(0,Ei.useEffect)((()=>{e&&t.modeDesktop&&i(e,r.current)}),[e,t.modeDesktop]);const i=(e,r)=>{if(t.options.layout.sliderAlign!==l.CENTER)return;let i=e.scrollWidth;if(i>0&&i<r.clientWidth){let t=r.clientWidth-i/2;e.scrollTo(t)}}})(h,o,d),As(h,o,d);const{getRootStyle:f,getStoryWrapperStyle:g,viewportInnerClassList:v,viewportInnerStyle:m}={getRootStyle:()=>({"--background-color":_.options.layout.backgroundColor,paddingLeft:_.options.sidePadding+"px",paddingRight:_.options.sidePadding+"px","--storiesListTopPadding":_.options.topPadding+"px","--storiesListBottomPadding":_.options.bottomPadding+"px","--storiesListSidePadding":_.options.sidePadding+"px",backgroundColor:_.options.layout.backgroundColor}),getStoryWrapperStyle:(e,t)=>{let r={marginRight:"0",paddingLeft:"0",paddingRight:"0"};return"vertical"===_.options.direction||(e!==t-1?r.marginRight=_.options.card.gap+"px":r.paddingRight=_.options.sidePadding+"px",0===e&&(r.paddingLeft=_.options.sidePadding+"px")),r},viewportInnerClassList:(_=o).modeDesktop?bs()(Ls["stories-list__viewport-inner"],Ls["mode-desktop"],{[Ls["with-list-controls"]]:_.options.navigation.showControls,[Ls.isTitleCardOutsideTop]:_.options.card.title.position===u.CARD_OUTSIDE_TOP,[Ls.isTitleCardOutsideBottom]:_.options.card.title.position===u.CARD_OUTSIDE_BOTTOM,[Ls.isVerticalDirection]:"vertical"===_.options.direction}):bs()(Ls["stories-list__viewport-inner"],Object.assign(Object.assign({},{[Ls["align-left"]]:_.options.layout.sliderAlign===l.LEFT,[Ls["align-center"]]:_.options.layout.sliderAlign===l.CENTER,[Ls["align-right"]]:_.options.layout.sliderAlign===l.RIGHT}),{[Ls.isTitleCardOutsideTop]:_.options.card.title.position===u.CARD_OUTSIDE_TOP,[Ls.isTitleCardOutsideBottom]:_.options.card.title.position===u.CARD_OUTSIDE_BOTTOM,[Ls.isVerticalDirection]:"vertical"===_.options.direction})),viewportInnerStyle:{height:_.options.layout.height,gap:"vertical"===_.options.direction?`${_.options.card.gap}px`:0}};var _;const y=o.options.card,w=o.options.favoriteCard,b=o.options.ugcCard;let S=[];return s?S=o.favoriteStories:(S=o.defaultStories,o.favoriteCard&&S.push(o.favoriteCard),o.ugcCard&&S.unshift(o.ugcCard)),ss(xs,{className:bs()(Ls["stories-list-wrapper"],{[Ls["mode-desktop"]]:o.modeDesktop,[Ls["with-list-controls"]]:o.options.navigation.showControls}),style:f(),sliderOptions:o.options,ref:a,children:[is("div",{className:Ls["stories-list"],children:is("div",{ref:d,className:bs()(Ls["stories-list__viewport"],{[Ls["mode-desktop"]]:o.modeDesktop}),style:"horizontal"===o.options.direction?{marginLeft:-o.options.sidePadding+"px",marginRight:-o.options.sidePadding+"px"}:{},children:is("div",{ref:c,className:v,style:m,children:S.map(((e,t)=>{var r;const i=e.isFavoriteCard&&o.favoriteCard,s=n.storyCardView&&!i;return i&&n.favoriteCardView?is(Ii().Fragment,{children:n.favoriteCardView(o.favoriteCard)},t):is(Ii().Fragment,{children:s?null===(r=n.storyCardView)||void 0===r?void 0:r.call(n,e):is(js,{story:e,cardOptions:y,favoriteCardOptions:w,ugcCardOptions:b,wrapperStyle:g(t,S.length),isScrolling:p,onClick:e=>o.onStoryClick(e,t),children:i&&is(qs,{favoriteStories:o.favoriteCard.favoriteStories,cardOptions:y})},t)},t)}))})})}),h&&is(Gs,{navigationOptions:o.options.navigation,navigationView:n.navigationView,sliderDirection:o.options.direction,slider:h})]})};var Hs=__webpack_require__(763),Ks={insert:"head",singleton:!1};Cs()(Hs.A,Ks);Hs.A.locals;const Qs=({storyManager:e})=>{const[,t]=(0,Ei.useState)(0),[r,i]=(0,Ei.useState)(null),s=(()=>{const e=(0,Ei.useRef)();return e.current||(e.current=(()=>{const e=getComputedStyle(document.documentElement),t=t=>parseFloat(e.getPropertyValue(t)),r=t("--sat"),i=t("--sab");return{left:t("--sal"),right:t("--sar"),top:r,bottom:i}})()),e.current})(),o=as(),n=()=>requestAnimationFrame((()=>t((e=>++e))));return(0,Ei.useEffect)((()=>{const t=e.createGameReaderViewModel();return t.setSafeAreaInsets(s),t.on("update",n),i(t),()=>{t.destroy()}}),[e]),(0,Ei.useEffect)((()=>{null==r||r.setDesktopMode(o)}),[r,o]),{desktopMode:o,gameReaderViewModel:r}};var Ys=__webpack_require__(4978),Xs={insert:"head",singleton:!1};Cs()(Ys.A,Xs);const Js=Ys.A.locals||{};var eo=__webpack_require__(1422),to={insert:"head",singleton:!1};Cs()(eo.A,to);const ro=eo.A.locals||{},io=({onClick:e,className:t})=>is("div",{className:bs()(ro.icon,t),onClick:e,children:is("svg",{viewBox:"0 0 24 24",children:is("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"})})});function so(){var e,t,r,i,s,o;let n=null;try{n=(null===(e=window.parent)||void 0===e?void 0:e.innerHeight)||(null===window||void 0===window?void 0:window.innerHeight)||(null===(i=null===(r=null===(t=window.parent)||void 0===t?void 0:t.document)||void 0===r?void 0:r.documentElement)||void 0===i?void 0:i.clientHeight)}catch(e){console.error(e)}return n||(null===(o=null===(s=null===window||void 0===window?void 0:window.document)||void 0===s?void 0:s.documentElement)||void 0===o?void 0:o.clientHeight)}var oo=__webpack_require__(6644),no={insert:"head",singleton:!1};Cs()(oo.A,no);const ao=oo.A.locals||{},lo=310/480,co=({desktopMode:e,children:t,verticalPadding:r,style:i,className:s})=>{const[o,n]=(0,Ei.useState)({width:"0px",height:"0px"});(0,Ei.useEffect)((()=>(a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)})),[]);const a=()=>{const e=function(){var e,t,r,i,s,o,n,a,l,d,c;let u=null;try{u=(null===(e=window.parent)||void 0===e?void 0:e.innerWidth)||window.innerWidth||(null===(i=null===(r=null===(t=window.parent)||void 0===t?void 0:t.document)||void 0===r?void 0:r.documentElement)||void 0===i?void 0:i.clientWidth)||(null===(n=null===(o=null===(s=window.parent)||void 0===s?void 0:s.document)||void 0===o?void 0:o.body)||void 0===n?void 0:n.clientWidth)}catch(e){console.error(e)}return u||(null===(l=null===(a=window.document)||void 0===a?void 0:a.documentElement)||void 0===l?void 0:l.clientWidth)||(null===(c=null===(d=window.document)||void 0===d?void 0:d.body)||void 0===c?void 0:c.clientWidth)}(),t=f(),r=e/so(),i=d({aspectRatio:r,vh:t,vw:e}),s=l({aspectRatio:r,vh:t,vw:e});n({width:i,height:s})},l=({aspectRatio:e,vh:t,vw:r})=>{const i=h(e)||p();return e>lo&&!i?`${u({vh:t,vw:r})}px`:"100%"},d=({aspectRatio:e,vh:t,vw:r})=>e>lo&&!h(e)?`${c({aspectRatio:e,vh:t,vw:r})}px`:"auto",c=({aspectRatio:t,vh:r,vw:i})=>t>lo&&!e?i:Math.ceil(r*lo),u=({vh:t,vw:r})=>e?t:Math.ceil(r/lo),h=e=>e>lo&&e-lo<=.1,p=()=>{let e;return"matchMedia"in window&&void 0!==(e=window.matchMedia("(orientation: portrait)"))&&e.matches},f=()=>{let t=so();return e?(t-=r,t):t};return is("div",{className:bs()(ao["aspect-ratio-box"],s),style:Object.assign(Object.assign({},i),o),children:is("div",{className:ao["aspect-ratio-box-inside"],children:t})})};var uo=__webpack_require__(9590),ho={insert:"head",singleton:!1};Cs()(uo.A,ho);const po=uo.A.locals||{},fo=Rr(),go=e=>{const[t,r]=(0,Ei.useState)(!1),i=(0,Ei.useCallback)((()=>{if(e.desktopMode)return;const t=fo.type!==e.orientation;e.onOrientationChange({type:fo.type,isWrong:t}),r(t)}),[e.desktopMode,e.orientation]);return(0,Ei.useEffect)((()=>(i(),fo.addEventListener("change",i),()=>{fo.removeEventListener("change",i)})),[i]),t?is("div",{className:po["screen-orientation-lock"]}):null};var vo=__webpack_require__(3510),mo={insert:"head",singleton:!1};Cs()(vo.A,mo);const _o=vo.A.locals||{};var yo=__webpack_require__(984),wo={insert:"head",singleton:!1};Cs()(yo.A,wo);const bo=yo.A.locals||{},So=({shareLink:e,sharePanelOptions:t,onDownloadClick:r})=>{var i,s;return ss("div",{className:`${_o["share-panel__body"]} ${bo["share-panel__body_screenshot"]}`,children:[is("div",{className:`${_o["share-panel-row"]} ${bo["share-panel-row"]}`,children:is("a",{className:bo["share-panel-row__image-link"],onClick:r,href:e,download:"image.jpeg",children:is("img",{src:e,className:bo["share-panel-row__image"]})})}),is("div",{className:_o["share-panel-separator"]}),is("div",{className:`${_o["share-panel-row"]} ${bo["share-panel-row"]}`,children:is("a",{className:bo["share-item__download-button"],onClick:r,href:e,download:"image.jpeg",children:is("div",{dangerouslySetInnerHTML:{__html:null!==(s=null===(i=t.downloadButton)||void 0===i?void 0:i.svgSrc.baseState)&&void 0!==s?s:""}})})})]})};var Co=__webpack_require__(334),Oo={insert:"head",singleton:!1};Cs()(Co.A,Oo);const ko=Co.A.locals||{},Lo={[v.vk]:{title:"VK",icon:({width:e,height:t})=>ss("svg",{width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[is("circle",{cx:"24",cy:"24",r:"21.3",fill:"#fff"}),is("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"})]}),getUrl:e=>`https://vk.com/share.php?url=${e.url}&title=${e.text}`},[v.facebook]:{title:"Facebook",icon:({width:e,height:t})=>ss("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"126.4 2.3 589 589",children:[is("circle",{cx:"420.9",cy:"296.8",r:"294.5",fill:"#3c5a9a"}),is("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"})]}),getUrl:e=>`https://www.facebook.com/sharer.php?u=${e.url}&t=${e.text}`},[v.twitter]:{title:"X",icon:({width:e,height:t})=>is("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 195 195",width:e,height:t,children:ss("g",{transform:"matrix(.20227 0 0 .20302 -71 -26.7)",children:[is("circle",{cx:"834.3",cy:"610.6",r:"481.3",stroke:"#fff",strokeMiterlimit:"10"}),is("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"})]})}),getUrl:e=>`https://twitter.com/share?url=${e.url}&text=${e.text}`},[v.linkedin]:{title:"LinkedIn",icon:({width:e,height:t})=>is("svg",{enableBackground:"new 0 0 550 550",width:e,height:t,id:"Layer_1",version:"1.1",viewBox:"0 0 550 550",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:is("g",{children:ss("g",{children:[is("circle",{cx:"275",cy:"275",fill:"#04689B",r:"256"}),is("path",{d:"M219.2,366.5h-38.8V242.2h38.8V366.5z M198.8,226.6h-0.3c-14.1,0-23.2-9.5-23.2-21.6\r\n c0-12.3,9.4-21.6,23.7-21.6c14.3,0,23.1,9.3,23.4,21.5C222.5,217.1,213.4,226.6,198.8,226.6z M374.6,366.5h-44v-64.3\r\n c0-16.8-6.9-28.3-22-28.3c-11.6,0-18,7.7-21,15.2c-1.1,2.7-0.9,6.4-0.9,10.2v67.3H243c0,0,0.6-113.9,0-124.3h43.6v19.5\r\n c2.6-8.5,16.5-20.7,38.8-20.7c27.6,0,49.3,17.9,49.3,56.4V366.5z",fill:"#FFFFFF"})]})})}),getUrl:e=>`https://www.linkedin.com/sharing/share-offsite/?url=${e.url}&title=${e.text}`},[v.telegram]:{title:"Telegram",icon:({width:e,height:t})=>ss("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 240 240",width:e,height:t,children:[is("defs",{children:ss("linearGradient",{id:"a",x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",children:[is("stop",{offset:"0",stopColor:"#1d93d2"}),is("stop",{offset:"1",stopColor:"#38b0e3"})]})}),is("circle",{cx:"120",cy:"120",r:"120",fill:"url(#a)"}),is("path",{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"}),is("path",{d:"m100.1 138.9-2.7 29s-1.2 9 7.7 0 17.4-15.7 17.4-15.7",fill:"#a9c6d8"}),is("path",{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"})]}),getUrl:e=>`https://t.me/share/url?url=${e.url}&text=${e.text}`},[v.ok]:{title:"OK",icon:({width:e,height:t})=>ss("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 388.4 387.1",xmlSpace:"preserve",width:e,height:t,children:[is("path",{style:{mixBlendMode:"normal"},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"}),is("path",{style:{mixBlendMode:"normal"},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"}),ss("g",{style:{mixBlendMode:"normal"},fill:"#fff",children:[is("path",{d:"M217.4 253.5c28-5.7 44.7-19 45.6-19.7a19 19 0 0 0-23.8-29.6c-.2.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 .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.9zM191.7 218z"}),is("path",{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"},transform:"translate(-1.8 .2)"})]})]}),getUrl:e=>`https://connect.ok.ru/offer?url=${e.url}&title=${e.text}`}};var Mo=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r};const Ao=__webpack_require__(4862),xo=e=>{var t,r,i,{shareLink:s,sharePanelOptions:o,onShareComplete:n}=e,a=Mo(e,["shareLink","sharePanelOptions","onShareComplete"]);const l=()=>{try{return new URL(s).host}catch(e){return console.error(e),null}},d=e=>{const t=(()=>{try{return new URL(s)}catch(e){return console.error(e),null}})();return t?Lo[e].getUrl({url:t.toString(),text:l()?"":encodeURIComponent(s)}):"#"};return ss("div",{className:_o["share-panel__body"],children:[ss("div",{className:`${_o["share-panel-row"]} ${_o["title-row"]}`,children:[l()&&is("div",{className:_o["share-url-favicon"],children:is("img",{src:`${null!==(t=a.faviconApiUrl)&&void 0!==t?t:"https://favicon.inappstory.ru"}?sz=64&domain_url=${l()}`})}),is("span",{className:_o.title,children:s})]}),o.targets.length>0&&ss(rs,{children:[is("div",{className:_o["share-panel-separator"]}),is("div",{className:`${_o["share-panel-row"]} ${ko["social-list"]}`,children:o.targets.map(((e,t)=>{const r=Lo[e],i=r.icon;return is("div",{className:ko["social-list__item"],children:ss("a",{href:d(e),onClick:t=>((e,t,r)=>{wi(window,"focus",n),window.open(e,t,r)})(d(e),"newwindow","width=650,height=570"),target:"_blank",rel:"noopener noreferrer",className:`${_o["share-item"]} ${ko["share-item"]}`,children:[is(i,{width:"50px",height:"50px"}),is("span",{className:_o["share-item-title"],children:r.title})]})},t)}))})]}),is("div",{className:_o["share-panel-separator"]}),is("div",{className:_o["share-panel-row"],children:ss("a",{className:`${_o["share-item"]} ${ko["share-item"]}`,onClick:()=>{Ao.copy(s),n()},children:[is("div",{dangerouslySetInnerHTML:{__html:null!==(i=null===(r=null==o?void 0:o.copyButton)||void 0===r?void 0:r.svgSrc.baseState)&&void 0!==i?i:""}}),is("span",{className:_o["share-item-title"],children:"Copy link"})]})})]})};var Eo;!function(e){e.Social="social",e.SlideScreenshot="slide-screenshot"}(Eo||(Eo={}));const Io=({shareType:e,shareLink:t,onShareCompelete:r,sharePanelOptions:i})=>{const[s,o]=(0,Ei.useState)(!1),[n,a]=(0,Ei.useState)(!0),[l,d]=(0,Ei.useState)(!1),c=()=>{o(!0),d(!0)};return(0,Ei.useEffect)((()=>{requestAnimationFrame((()=>a(!1)))}),[]),ss("div",{className:bs()(_o["share-panel-wrapper"]),onClick:e=>{e.stopPropagation()},onTouchStart:e=>{e.stopPropagation(),e.preventDefault()},children:[is("div",{className:bs()(_o["share-panel-backdrop"],{[_o["fade-enter"]]:n,[_o["fade-leave-to"]]:l}),onClick:()=>{o(!1),d(!0)}}),ss("div",{className:bs()(_o["share-panel"],{[_o["swipe-up-enter"]]:n,[_o["swipe-up-leave-to"]]:l}),onTransitionEnd:()=>{d(!1),l&&r(s)},style:{"--height":"100%"},children:[e===Eo.SlideScreenshot&&is(So,{shareLink:t,onDownloadClick:c,sharePanelOptions:i}),e===Eo.Social&&is(xo,{shareLink:t,onShareComplete:c,sharePanelOptions:i}),is("div",{className:_o["share-panel-separator"]})]})]})},Ro=({storyManager:e})=>{var t,r,i,s;const n=(0,Ei.useRef)(null),{desktopMode:a,gameReaderViewModel:l}=Qs({storyManager:e}),{sharePanelOpeningParams:d,handleShareComplete:c,closeSharePanel:u}=(e=>{const[t,r]=(0,Ei.useState)(null);return(0,Ei.useEffect)((()=>(null==e||e.on("openSharePanel",r),()=>{null==e||e.off("openSharePanel",r)})),[e]),{sharePanelOpeningParams:t,handleShareComplete:i=>{t&&e&&(e.confirmSharingComplete({shareId:t.shareId,isSuccess:i}),r(null))},closeSharePanel:()=>{r(null)}}})(l);if(!l||!l.isOpened)return null;const{backdrop:h,options:p,gameLaunch:f,gameLaunchError:g,isGameLoading:v,closeBtnVisible:m,sharePanelOptions:_}=l,y=bs()(Js["game-reader"],{[Js["desktop-mode"]]:a,[Js.loading]:!l.gameLaunchError&&l.isGameLoading}),w={background:h.background,opacity:h.opacity,filter:h.filter},b={backgroundColor:null===(t=p.game)||void 0===t?void 0:t.backdropColor,backgroundImage:(null===(r=null==f?void 0:f.splashScreen)||void 0===r?void 0:r.url)?`url(${f.splashScreen.url})`:void 0};return is("div",{className:Js["game-reader-container"],children:ss("div",{className:y,children:[is("div",{className:Js["game-reader__backdrop"],style:w}),ss(co,{className:Js["game-box"],desktopMode:a,verticalPadding:100,style:b,children:[g&&is(io,{className:Js.refresh,onClick:()=>{null==l||l.reload()}}),(v||m)&&is("button",{onClick:()=>{null==l||l.closeGame(),u()},className:Js["game-reader__close"],style:p.closeButtonPosition===o.LEFT?{left:"10px"}:{right:"10px"},dangerouslySetInnerHTML:{__html:null!==(s=null===(i=p.closeButton)||void 0===i?void 0:i.svgSrc.baseState)&&void 0!==s?s:""}}),f&&ss(rs,{children:[is("iframe",{src:f.url,onLoad:e=>{if(!l)throw new Error("GameReaderViewModel not yet initialized");n.current=e.target,l.setGameCenterIframe(n.current)},style:{opacity:v?0:1},frameBorder:"0",className:Js["game-iframe"],sandbox:"allow-same-origin allow-top-navigation allow-forms allow-scripts allow-downloads allow-top-navigation-to-custom-protocols",allow:"fullscreen"}),d&&is(Io,{shareType:d.shareType,shareLink:d.shareLink,onShareCompelete:c,sharePanelOptions:_})]})]}),f&&p.forceCheckOrientation&&is(go,{orientation:Ir.PORTRAIT_PRIMARY,desktopMode:a,onOrientationChange:({isWrong:e})=>{(null==l?void 0:l.isGameInited)&&(e?l.pauseGameUI():l.resumeGameUI())}})]})})},To=({storyManager:e})=>{(({storyManager:e})=>{const[,t]=(0,Ei.useState)(0),[r,i]=(0,Ei.useState)(null),s=()=>requestAnimationFrame((()=>t((e=>++e))));(0,Ei.useEffect)((()=>{const t=e.createStoryReaderViewModel();return t.on("update",s),i(t),()=>{t.destroy()}}),[e])})({storyManager:e});return null},Po=Ii().createContext({}),Do=e=>ss(Po.Provider,{value:{storyManager:e.storyManager},children:[is(Ro,{storyManager:e.storyManager}),is(To,{storyManager:e.storyManager}),e.children]}),jo=()=>{const{storyManager:e}=(0,Ei.useContext)(Po);if(!e)throw new Error("You should use <IASContainer> component");return{storyManager:e}},Fo=e=>{var t,r;const{storyManager:i}=jo(),s=null!==(t=e.feedSlug)&&void 0!==t?t:"default",o=Le.DEFAULT,n=ds(Object.assign(Object.assign({},e),{storyManager:i,feedSlug:s,listType:o,isFavorite:!1}));return n?is(Zs,Object.assign({},e,{storyManager:i,feedSlug:null!==(r=e.feedSlug)&&void 0!==r?r:"default",listType:Le.DEFAULT,storyListViewModel:n})):null},No=e=>{const{storyManager:t}=jo(),r=ni,i=Le.UGC,s=ds(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!1}));return s?is(Zs,Object.assign({},e,{storyManager:t,listType:Le.UGC,feedSlug:ni,storyListViewModel:s})):null},Uo=e=>{const{storyManager:t}=jo(),r="default",i=Le.DEFAULT,s=ds(Object.assign(Object.assign({},e),{storyManager:t,feedSlug:r,listType:i,isFavorite:!0}));return s?is(Zs,Object.assign({},e,{storyManager:t,feedSlug:r,listType:i,storyListViewModel:s,isFavorite:!0})):null}})(),__webpack_exports__})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/react-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "React SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",