@divkitframework/divkit 29.2.0 → 29.3.0-canary-bb695da4bafbcfd075df8cecef0920b71ac5a7d0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>fo,createVariable:()=>Ir,render:()=>Co}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function i(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class n{constructor(t){i(this,"_listeners","WeakMap"in r?new WeakMap:void 0),i(this,"_observer",void 0),i(this,"options",void 0),this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return null!==(t=this._observer)&&void 0!==t?t:this._observer=new ResizeObserver((t=>{for(const r of t){var e;n.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function o(){}function a(t){return t()}function s(t){t.forEach(a)}function l(t,...e){if(null==t){for(const t of e)t(void 0);return o}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t,e,r){return t.set(r),e}let u;function d(t){u=t}function p(){if(!u)throw new Error("Function called outside component initialization");return u}function v(t){p().$$.on_destroy.push(t)}function g(t,e){return p().$$.context.set(t,e),e}function f(t){return p().$$.context.get(t)}n.entries="WeakMap"in r?new WeakMap:void 0,new Map;const h=[],m=[];let y=[];const b=[],_=Promise.resolve();let w=!1;function $(){return w||(w=!0,_.then(C)),_}function x(t){y.push(t)}const k=new Set;let E=0;function C(){if(0!==E)return;const t=u;do{try{for(;E<h.length;){const t=h[E];E++,d(t),A(t.$$)}}catch(t){throw h.length=0,E=0,t}for(d(null),h.length=0,E=0;m.length;)m.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(h.length);for(;b.length;)b.pop()();w=!1,k.clear(),d(t)}function A(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const F=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),V=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function D(t){return V.test(t)||"!doctype"===t.toLowerCase()}const j=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function S(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,i=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),i&&(null==r.style?r.style=W(i):r.style=W(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),i=e.slice(0,t).trim(),n=e.slice(t+1).trim();i&&(r[i]=n)}for(const t in e){const i=e[t];i?r[t]=i:delete r[t]}return r}(r.style,i)))}let i="";return Object.keys(r).forEach((t=>{if(j.test(t))return;const e=r[t];!0===e?i+=" "+t:F.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const P=/[&"]/g,O=/[&<]/g;function I(t,e=!1){const r=String(t),i=e?P:O;i.lastIndex=0;let n="",o=0;for(;i.test(r);){const t=i.lastIndex-1,e=r[t];n+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return n+r.substring(o)}function M(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function T(t){const e={};for(const r in t)e[r]=M(t[r]);return e}function z(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let i="";for(let r=0;r<t.length;r+=1)i+=e(t[r],r);return i}const N={$$render:()=>""};function B(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${e}>.`);return t}let R,J;function U(t){function e(e,r,i,n,o){const a=u;d({$$:{on_destroy:R,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,i,n);return d(a),s}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{R=[];const n={title:"",head:"",css:new Set},o=e(n,t,{},r,i);return s(R),{html:o,css:{code:Array.from(n.css).map((t=>t.code)).join("\n"),map:null},head:n.title+n.head}},$$render:e}}function L(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${I(e,!0)}"`}`}function W(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${M(t[e])};`)).join(" ")}function H(t){const e=W(t);return e?` style="${e}"`:""}function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?q(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Z(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(t,e,r,i){var n;const o=null===(n=r[t])||void 0===n?void 0:n.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!i||!r[t])return e;if("toAttribute"===i)switch(o){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(J=class extends HTMLElement{constructor(t,e,r){super(),Z(this,"$$ctor",void 0),Z(this,"$$s",void 0),Z(this,"$$c",void 0),Z(this,"$$cn",!1),Z(this,"$$d",{}),Z(this,"$$r",!1),Z(this,"$$p_d",{}),Z(this,"$$l",{}),Z(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=function(t){return document.createElement(t)}("slot"),"default"!==t&&function(t,e,r){null==r?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}(e,"name",t)},m:function(t,r){!function(t,e,r){t.insertBefore(e,r||null)}(t,e,r)},d:function(t){t&&function(t){t.parentNode&&t.parentNode.removeChild(t)}(e)}}}}const e={},r=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const n of this.$$s)n in r&&(e[n]=[t(n)]);for(const o of this.attributes){const a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=Y(a,o.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:G(G({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const i=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=Y(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}}attributeChangedCallback(t,e,r){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Y(t,r,this.$$p_d,"toProp"),null===(i=this.$$c)||void 0===i||i.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});const X=[];function Q(t,e=o){let r;const i=new Set;function n(e){if(o=e,((n=t)!=n?o==o:n!==o||n&&"object"==typeof n||"function"==typeof n)&&(t=e,r)){const e=!X.length;for(const e of i)e[1](),X.push(e,t);if(e){for(let t=0;t<X.length;t+=2)X[t][0](X[t+1]);X.length=0}}var n,o}function a(e){n(e(t))}return{set:n,update:a,subscribe:function(s,l=o){const c=[s,l];return i.add(c),1===i.size&&(r=e(n,a)||o),s(t),()=>{i.delete(c),0===i.size&&r&&(r(),r=null)}}}}function K(t,e,r){const i=!Array.isArray(t),n=i?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return c=(t,r)=>{let c=!1;const u=[];let d=0,p=o;const v=()=>{if(d)return;p();const n=e(i?u[0]:u,t,r);a?t(n):p="function"==typeof n?n:o},g=n.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&v()}),(()=>{d|=1<<e}))));return c=!0,v(),function(){s(g),p(),c=!1}},{subscribe:Q(r,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",rt="divkit-c016b",it="divkit-ee112",nt="divkit-aa145",ot="divkit-f0cba",at=Symbol("root");function st(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const lt={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_multiline:"divkit-ee8e3",text_truncate_none:"divkit-c6ea1",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002","text_has-focus-color":"divkit-cb341"},ct={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function ut(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function dt(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function vt(t,e){for(;t.length<e;)t="0"+t;return t}function gt(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const i=ft(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>vt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function ft(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,i,n,o]=e,a=2===i.length?i:i+i,s=2===n.length?n:n+n,l=2===o.length?o:o+o,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,i,n]=e,o=2===r.length?r:r+r,a=2===i.length?i:i+i,s=2===n.length?n:n+n;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function ht(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:gt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=gt(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>gt(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:wt(t.bg.scale),pos:$t(t.bg),image:'url("'+ht(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(mt);if(!r.length)return;const i=t.bg.radius;let n;i&&"object"==typeof i&&"type"in i&&void 0!==i.value&&("fixed"===i.type?n=pt(i.value):"relative"===i.type&&(n=bt[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+r.map((t=>gt(t))).join(",")+")"}}({bg:t}):void 0)).filter(mt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const bt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function _t(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return pt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function wt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function $t(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function xt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function Et(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function Ct(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function At(t,e){e&&t.push(e)}function Ft(t,e,r){const i=[];At(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&At(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const Vt=Symbol("state");function Dt(t){const e=t.top||0,r=t.right||0,i=t.bottom||0,n=t.left||0;return 0===e&&0===r&&0===i&&0===n?"":dt(e)+" "+dt(r)+" "+dt(i)+" "+dt(n)}function jt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function St(t){return jt(t)&&t>=0}function Pt(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!St(r[t]))return e;return Dt(t)}function Ot(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const It=Object.prototype.hasOwnProperty;function Mt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++){const n=r[i];if(!It.call(e,n)||!Mt(t[n],e[n]))return!1}return!0}function Tt(t,e){return Mt(t,e)?e:t}function zt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Nt(t,e){const r=Number(t);return isNaN(r)?e:r}function Bt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Bt(t))})):e.push(t),e}function Rt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!St(t[r[i]]))return e;return t}function Jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>dt((t||e)/r*10))).join(" ")}function Ut(t){return 0!==t.is_enabled&&!1!==t.is_enabled}function Lt(){}const Wt=Symbol("action"),Ht=U(((t,e,r,i)=>{let{id:n=""}=e,{actions:o}=e,{doubleTapActions:a}=e,{longTapActions:s}=e,{cls:l=""}=e,{style:c=null}=e,{attrs:u}=e,{use:d=Lt}=e,{customAction:p=null}=e,{isNativeActionAnimation:h=!0}=e,{hasInnerFocusable:m=!1}=e;const y=f(at),b=f(Wt);let _;g(Wt,{hasAction:()=>Boolean(b.hasAction()||(null==o?void 0:o.length))});let w,$="",x=!1;if(v((()=>{n&&!m&&y.unregisterFocusable(n)})),void 0===e.id&&r.id&&void 0!==n&&r.id(n),void 0===e.actions&&r.actions&&void 0!==o&&r.actions(o),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==a&&r.doubleTapActions(a),void 0===e.longTapActions&&r.longTapActions&&void 0!==s&&r.longTapActions(s),void 0===e.cls&&r.cls&&void 0!==l&&r.cls(l),void 0===e.style&&r.style&&void 0!==c&&r.style(c),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==d&&r.use(d),void 0===e.customAction&&r.customAction&&void 0!==p&&r.customAction(p),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==h&&r.isNativeActionAnimation(h),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==m&&r.hasInnerFocusable(m),Array.isArray(o)&&(null==o?void 0:o.length))for(let t=0;t<o.length;++t){const e=o[t].url;if(e){$=e,w=o[t].target||void 0;break}}return Array.isArray(o)&&(null==o?void 0:o.length)&&b.hasAction()&&($="",y.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:o}}))),x=Boolean(p),$&&!kt(xt($),y.getBuiltinProtocols())?($="",x=!0):!$&&Array.isArray(o)&&(null==o?void 0:o.length)&&(x=!0,o.some((t=>t.url||t.typed))||y.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:o}}))),$?`<a${S([{href:M($)},{target:M(w)},{style:M(c)},{class:I(l,!0)+" "+I(h?tt:et,!0)+" "+I(null!=s&&s.length?ot:"",!0)},T(u)],{})}${L("this",_,0)}>${i.default?i.default({}):""}</a>`:` <span${S([{class:I(l,!0)+I(x?` ${h?tt:et} ${rt}`:"",!0)+" "+I(null!=s&&s.length?ot:"",!0)},{style:M(c)},{role:M(x?"button":null)},{tabindex:M(x?0:null)},T(u)],{})}${L("this",_,0)}>${i.default?i.default({}):""}</span>`})),qt=Ht,Gt="divkit-b921d";function Zt(t){return jt(t)&&t>0}function Yt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Zt(t.radius))return`blur(${pt(t.radius/2)})`}else e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Xt=U(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=f(at);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),n=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const i=yt([t]);"solid"===t.type&&(e["background-color"]=i.color),"gradient"===t.type&&(e["background-image"]=i.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=i.size,e["object-position"]=i.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Yt(t.filters,s.logError)))}return r})),`<span${L("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${H({"border-radius":a})}>${z(n,(t=>t.image_url?`<img${L("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${L("class",Gt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Gt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Qt=Xt,Kt={left:"start",center:"center",right:"end"},te={top:"start",center:"center",bottom:"end",baseline:"baseline"},ee=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,F,V,D,j,S,P,O,I,M,T,z,N,R,J,U,W,H,q,G,Z,Y,X,Q,tt,et,rt,it=o,nt=o,ot=o,lt=o,vt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,At=o,jt=o,It=o,Lt=o,Wt=o,Ht=o,Gt=o,{json:Zt={}}=e,{origJson:Yt}=e,{templateContext:Xt}=e,{cls:ee=""}=e,{style:re}=e,{layoutParams:ie={}}=e,{customDescription:ne=!1}=e,{customPaddings:oe=!1}=e,{customActions:ae=""}=e,{additionalPaddings:se=null}=e,{heightByAspect:le=!1}=e,{parentOf:ce}=e,{parentOfSimpleMode:ue}=e,{replaceItems:de}=e,{hasInnerFocusable:pe=!1}=e;const ve=f(at),ge=f(Vt);let fe,he;I=l(ve.isPointerFocus,(t=>O=t));let me,ye,be,_e,we,$e,xe,ke,Ee,Ce,Ae,Fe,Ve,De,je,Se,Pe,Oe,Ie,Me,Te=null,ze=[],Ne={},Be={},Re=!1,Je=1,Ue="transparent",Le=0,We={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},He="",qe=null,Ge="",Ze={},Ye=0,Xe=0,Qe=0,Ke=!1,tr=!1,er={},rr=0,ir=0,nr=0,or=!1,ar=!1,sr=1,lr=[],cr=!1,ur=!1,dr=[],pr=[],vr=[],gr=[],fr=[],hr=[],mr="",yr=!1,br="visible",_r=0,wr=0,$r=!1,xr=null;function kr(t,e){if(!Array.isArray(ce)||!de)return;if(ue&&1!==(Array.isArray(e)&&e.length||0))return;const r=ce.findIndex((e=>(null==e?void 0:e.id)===t)),i=ce.slice();i.splice(r,1,...e||[]),ce=i,de(i)}function Er(){if(Te&&fe){const t=ve.getExtensionContext();Te.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,fe,t)})),Te=null}}function Cr(){Zt.focus&&(O||($r=!0),ve.execAnyActions(gr))}function Ar(){Zt.focus&&($r=!1,ve.execAnyActions(fr))}v((()=>{var t;ze.forEach((t=>{ve.unregisterParentOf(t)})),ze=[],null===(t=Zt.tooltips)||void 0===t||t.forEach((t=>{ve.unregisterTooltip(t)})),Er()})),void 0===e.json&&r.json&&void 0!==Zt&&r.json(Zt),void 0===e.origJson&&r.origJson&&void 0!==Yt&&r.origJson(Yt),void 0===e.templateContext&&r.templateContext&&void 0!==Xt&&r.templateContext(Xt),void 0===e.cls&&r.cls&&void 0!==ee&&r.cls(ee),void 0===e.style&&r.style&&void 0!==re&&r.style(re),void 0===e.layoutParams&&r.layoutParams&&void 0!==ie&&r.layoutParams(ie),void 0===e.customDescription&&r.customDescription&&void 0!==ne&&r.customDescription(ne),void 0===e.customPaddings&&r.customPaddings&&void 0!==oe&&r.customPaddings(oe),void 0===e.customActions&&r.customActions&&void 0!==ae&&r.customActions(ae),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==se&&r.additionalPaddings(se),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==le&&r.heightByAspect(le),void 0===e.parentOf&&r.parentOf&&void 0!==ce&&r.parentOf(ce),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==ue&&r.parentOfSimpleMode(ue),void 0===e.replaceItems&&r.replaceItems&&void 0!==de&&r.replaceItems(de),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==pe&&r.hasInnerFocusable(pe),Zt&&ie&&(qe=null,Ge="",sr=1,yr=!1,br="visible",_r=0,wr=0,Oe=void 0,Ie=void 0,lr=ie.fakeElement?[]:Zt.transition_triggers||["state_change","visibility_change"],cr=Boolean(-1!==lr.indexOf("state_change")&&Zt.id),ur=Boolean(-1!==lr.indexOf("visibility_change")&&Zt.id)),n=ve.getDerivedFromVars(Zt.focus),lt(),lt=l(n,(t=>N=t)),a=ve.getDerivedFromVars(Zt.border),Gt(),Gt=l(a,(t=>rt=t)),s=ve.getDerivedFromVars(Zt.paddings),Ht(),Ht=l(s,(t=>et=t)),c=ve.getDerivedFromVars(Zt.margins),Lt(),Lt=l(c,(t=>Q=t)),u=ve.getDerivedFromVars(Zt.width),jt(),jt=l(u,(t=>Y=t)),d=ve.getDerivedFromVars(Zt.alignment_horizontal),Wt(),Wt=l(d,(t=>tt=t)),p=ve.getDerivedFromVars(Zt.height),At(),At=l(p,(t=>Z=t)),g=ve.getDerivedFromVars(Zt.alignment_vertical),It(),It=l(g,(t=>X=t)),h=ve.getDerivedFromVars(Zt.alpha),$t(),$t=l(h,(t=>G=t)),m=ve.getDerivedFromVars(Zt.accessibility),wt(),wt=l(m,(t=>q=t)),y=ve.getDerivedFromVars(Zt.background),_t(),_t=l(y,(t=>H=t)),b=ve.getDerivedFromVars(Zt.action),ht(),ht=l(b,(t=>U=t)),_=ve.getDerivedFromVars(Zt.actions),bt(),bt=l(_,(t=>W=t)),w=ve.getDerivedFromVars(Zt.doubletap_actions),ft(),ft=l(w,(t=>J=t)),x=ve.getDerivedFromVars(Zt.longtap_actions),vt(),vt=l(x,(t=>R=t)),k=ve.getDerivedFromVars(Zt.action_animation),ot(),ot=l(k,(t=>z=t)),E=ve.getDerivedFromVars(Zt.visibility),nt(),nt=l(E,(t=>T=t)),C=ve.getDerivedFromVars(Zt.transform),it(),it=l(C,(t=>M=t)),ze.forEach((t=>{ve.unregisterParentOf(t)})),ze=[],ce&&ce.forEach((t=>{(null==t?void 0:t.id)&&(ze.push(t.id),ve.registerParentOf(t.id,{replaceWith:kr,isSingleMode:Boolean(ue)}))}));{const t=$r&&(null==N?void 0:N.border)?N.border:rt;let e={},r={},i=!1,n="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,i,n,o,a;return dt((null===(e=t.offset)||void 0===e||null===(r=e.x)||void 0===r?void 0:r.value)||0)+" "+dt((null===(i=t.offset)||void 0===i||null===(n=i.y)||void 0===n?void 0:n.value)||0)+" "+dt(null!==(o=t.blur)&&void 0!==o?o:2)+" "+gt(t.color||"#000000",null!==(a=t.alpha)&&void 0!==a?a:.19)}(r):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(i=!0,Je=Ot(t.stroke.width,Je),Ue=gt(t.stroke.color,1,Ue),r.border=`${dt(Je)} solid ${Ue}`),t.corners_radius?(We=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!St(r[t]))return e;return t}(t.corners_radius,We),r["border-radius"]=e["border-radius"]=Jt(We)):t.corner_radius&&(Le=Ot(t.corner_radius,Le),We={"top-left":Le,"top-right":Le,"bottom-right":Le,"bottom-left":Le},r["border-radius"]=e["border-radius"]=dt(Le)),i&&Je&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},We);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Je/2})),n=Jt(t)}}Ne=Tt(e,Ne),Be=Tt(r,Be),Re=i,He=n}qe=Rt(et&&!oe?et:void 0,qe),A=Dt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((i=>{const n=t[i];n&&(r[i]=n);const o=e[i];o&&(r[i]=(r[i]||0)+o)})),r}(qe,se)),Ge=Pt(Q,Ge);{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Ye=Ot(null==Y?void 0:Y.value,Ye),e=dt(Ye);else if("wrap_content"===c||("match_parent"===c||!c)&&ie.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&ie.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===ie.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&St(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&St(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"!==c&&c||ve.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===ie.parentContainerOrientation&&ie.parentContainerWrap&&(l=!0,ve.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===ie.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===ie.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,ie.parentContainerWrap&&(s=!0));if("parent"===t)n["halign-self"]="stretch";else{const t=tt;n["halign-self"]="left"===t||"center"===t||"right"===t?Kt[t]:ie.parentHAlign||"start"}t&&(n.width=t),me=e,ye=r,be=i,Xe=o,Qe=a,Ze=Tt(n,Ze),Ke=s,tr=l}{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(le);else if("fixed"===c)rr=Ot(null==Z?void 0:Z.value,rr),e=dt(rr);else if("match_parent"!==c||ie.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&ie.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===ie.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&St(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&St(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"===c&&ve.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===ie.parentContainerOrientation&&ie.parentContainerWrap&&(l=!0,ve.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===ie.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===ie.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,ie.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===ie.parentContainerOrientation?n["valign-self"]=te[t]:n["valign-self"]=ie.parentVAlign||"start"}t&&(n.height=t),_e=e,we=r,$e=i,ir=o,nr=a,er=Tt(n,er),or=s,ar=l}var Fr,Vr,Dr;if(F=!!ie.overlapParent||void 0,V=ie.overlapParent&&(!Y||"match_parent"===Y.type)&&!ie.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!ie.parentVerticalWrapContent,D=ie.gridArea?`${ie.gridArea.y+1}/${ie.gridArea.x+1}/span ${ie.gridArea.rowSpan}/span ${ie.gridArea.colSpan}`:void 0,Vr=sr,sr=!St(Fr=G)||void 0===Fr||Fr>1?Vr:Number(Fr),xe=1===sr?void 0:sr,he=void 0,q&&!ne&&q.description&&(he={},he["aria-label"]=q.description),ke=$r&&(null==N?void 0:N.background)?N.background:H,Ee={},Ce=!1,Array.isArray(ke)&&(Ce=ke.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(He),!Ce)){const t=yt(ke);Ee["background-color"]=t.color,Ee["background-image"]=t.image,Ee["background-size"]=t.size,Ee["background-position"]=t.position,Ee["background-repeat"]="no-repeat"}Ae=void 0,cr&&Zt.transition_in&&ve.isRunning("stateChange")&&(Ae=!0),Ve=void 0,cr&&Zt.transition_change&&ve.isRunning("stateChange")&&ge.hasTransitionChange(Zt.id)&&(Ve=!0);{let t=W||U&&[U]||[],e=J||[],r=R||[],i=(null==N?void 0:N.on_focus)||[],n=(null==N?void 0:N.on_blur)||[];ie.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],ve.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ve.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ve.logError(st(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],ve.logError(st(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],ve.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&ae&&(t=[],e=[],r=[],ve.logError(st(new Error(`Cannot use action on component "${ae}"`)))),dr=t.filter(Ut),pr=e.filter(Ut),vr=r.filter(Ut),gr=i.filter(Ut),fr=n.filter(Ut)}z&&(hr=Bt(z),mr=hr.map((function(t){const e=Nt(t.start_value,1),r=Nt(t.end_value,1),i=Ot(t.start_delay,0),n=Ot(t.duration,300),o=zt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return De=e,je=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return Se=e,Pe=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return ve.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=br,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(T,br);t!==e&&(!yr||"visible"!==br&&"visible"!==e?br=e:async function(t){br=t;const e="visible"===t?"in":"out",r="in"===e?Zt.transition_in:Zt.transition_out;ur&&r&&(await $(),"in"===e&&(Fe=!0),ge.runVisibilityTransition(Object.assign(Object.assign({},Zt),{visibility:"visible"}),Xt,r,fe,e).then((()=>{"in"===e&&(Fe=!1)})).catch((t=>{throw"in"===e&&(Fe=!1),t})))}(e)),yr||(yr=!0)}if(Zt&&fe&&!Mt(Zt.extensions,Me)){let t=Me=Zt.extensions;$().then((()=>{if(t===Me&&fe&&(Er(),Array.isArray(Zt.extensions))){const t=ve.getExtensionContext();Te=Zt.extensions.map((e=>{var r;const i=ve.getExtension(e.id,e.params);return i&&(null===(r=i.mountView)||void 0===r||r.call(i,fe,t)),i})).filter(mt)}}))}if(Zt&&Yt&&Xt&&xr&&xr.update({json:Zt,origJson:Yt,templateContext:Xt}),j=Object.assign(Object.assign(Object.assign({},Ze),er),{"parent-overlap":F,"parent-overlap-absolute":V,"scroll-snap":ie.scrollSnap,"hide-on-transition-in":Ae||Fe||Ve,visibility:br,"has-action-animation":Boolean(mr),"parent-flex":ie.parentContainerOrientation||void 0,"parent-grid":Boolean(ie.gridArea)||void 0,"has-custom-focus":Boolean($r&&Zt.focus)}),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};_r=Nt(t.value,_r);const e="pivot-fixed"===t.type?dt(_r):`${_r}%`,r=M.pivot_y||{type:"pivot-percentage",value:50};wr=Nt(r.value,wr),Oe=`${e} ${"pivot-fixed"===r.type?dt(wr):`${wr}%`}`,Ie=`rotate(${M.rotation}deg)`}return S=Ke||or?"100%":Xe||ir?0:void 0,P=Object.assign(Object.assign(Object.assign(Object.assign({},re),Ee),Ne),{width:me,"min-width":ye,"max-width":be,height:_e,"min-height":we,"max-height":$e||(null==re?void 0:re["max-height"]),"grid-area":D,padding:A,margin:Ge,opacity:xe,transition:mr,"transform-origin":Oe,transform:Ie,"flex-grow":Xe||ir||void 0,"flex-shrink":Qe||nr?1:void 0,"flex-basis":S,"--divkit-animation-opacity-start":De,"--divkit-animation-opacity-end":je,"--divkit-animation-scale-start":Se,"--divkit-animation-scale-end":Pe}),I(),it(),nt(),ot(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),At(),jt(),It(),Lt(),Wt(),Ht(),Gt(),tr||ar?"":`${B(qt,"Actionable").$$render(t,{id:Zt.id,use:function(t){var e;fe=t,cr&&Zt.transition_in&&ge.registerChildWithTransitionIn(Zt,Xt,Zt.transition_in,t).then((()=>{Ae=!1})).catch((t=>{throw Ae=!1,t})),cr&&Zt.transition_out&&ge.registerChildWithTransitionOut(Zt,Xt,Zt.transition_out,t),cr&&Zt.transition_change&&ge.registerChildWithTransitionChange(Zt,Xt,Zt.transition_change,t).then((()=>{Ve=!1})).catch((t=>{throw Ve=!1,t}));const r=ie.fakeElement?[]:Zt.visibility_actions||Zt.visibility_action&&[Zt.visibility_action],i=ie.fakeElement?[]:Zt.disappear_actions;let n;(Array.isArray(r)&&r.length||Array.isArray(i)&&i.length)&&(n=function(t,{visibilityActions:e,disappearActions:r,rootCtx:i}){const n=[];e&&e.forEach((t=>{n.push({type:"visibility",index:n.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{n.push({type:"disappear",index:n.length,action:t,visible:!1,count:0,finished:!1})}));const o=n.map(((t,e)=>{const r="visibility"===t.type;return i.getDerivedFromVars({index:e,visibility_percentage:t.action.visibility_percentage,visibility_duration:r?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit,is_enabled:t.action.is_enabled})}));let a;const s=()=>{a&&a.disconnect(),n.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},l=K(o,(t=>t)).subscribe((e=>{const r=e.filter(Ct),o={};r.forEach((t=>{o[t.index]=t})),s();const l=[...new Set(r.map((t=>{const e="visibility"===n[t.index].type;return Et(e,t.visibility_percentage,e?50:0)/100})))];l.length&&(a=new IntersectionObserver((t=>{t.forEach((t=>{r.forEach((e=>{const r=n[e.index],o="visibility"===r.type,a=Et(o,e.visibility_percentage,o?50:0);let s;s=0===a?t.intersectionRatio>=1e-12:t.intersectionRatio>=a/100;const l=o?!r.visible&&s:r.visible&&!s,c=o?!s:s;l?r.finished||(r.timer=setTimeout((()=>{++r.count;const t=0===e.log_limit?1/0:e.log_limit||1;++r.count>=t&&(r.finished=!0);const n=i.getJsonWithVars(r.action),a=n.url,s=n.typed;if(a){const t=xt(a);t&&!kt(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(n):n.log_id&&i.execCustomAction(n))}else s&&i.execAction(n);i.logStat(o?"visible":"disappear",n)}),e.visibility_duration||800)):c&&r.timer&&clearTimeout(r.timer),r.visible=s}))}))}),{threshold:l}),a.observe(t))}));return{destroy(){s(),l()}}}(t,{visibilityActions:r,disappearActions:i,rootCtx:ve}));const o=Zt.id;return o&&ge.registerChild(o),null===(e=Zt.tooltips)||void 0===e||e.forEach((e=>{ve.registerTooltip(t,e)})),{destroy(){o&&ge.unregisterChild(o),n&&n.destroy(),xr&&xr.destroy()}}},cls:ee+" "+Ft("outer",ct,j),style:ut(P),actions:dr,doubleTapActions:pr,longTapActions:vr,attrs:he,hasInnerFocusable:pe,isNativeActionAnimation:!hr.length||(Dr=hr,Dr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ce?`${B(Qt,"OuterBackground").$$render(t,{background:ke,radius:He},{},{})}`:""}${i.default?i.default({focusHandler:Cr,blurHandler:Ar,hasCustomFocus:$r}):""}${Re?`<span${L("class",ct.outer__border,0)}${L("style",ut(Be),0)}></span>`:""}`})}`})),re=ee,ie={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function ne(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function oe(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function ae(t,e){return oe(t)||e}const se=U(((t,e,r,i)=>{let n,o,a,s,l,c;var u,d;let{json:p}=e,{text:v}=e,{rootFontSize:g}=e,{textStyles:h={}}=e,{singleline:m=!1}=e,{actions:y}=e;const b=f(at);let _,w="none",$=12,x=1.25,k="",E="",C="",A=null;void 0===e.json&&r.json&&void 0!==p&&r.json(p),void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==h&&r.textStyles(h),void 0===e.singleline&&r.singleline&&void 0!==m&&r.singleline(m),void 0===e.actions&&r.actions&&void 0!==y&&r.actions(y),p&&(w="none",$=12,x=1.25,k="",_=void 0,E="",C="",A=null);{let t="none";(h.underline||h.strike)&&("single"===h.underline&&"single"===h.strike?t="both":"single"===h.underline?t="underline":"single"===h.strike&&(t="strike")),w=t}return $=ne(h.font_size,$),Zt(h.line_height)&&(x=Number(h.line_height)/$),St(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=ae(h.font_weight,_),E="string"==typeof h.font_family&&h.font_family?b.typefaceProvider(h.font_family,{fontWeight:_||400}):"",C=gt(h.text_color,1,C),n=h.top_offset?dt(h.top_offset):"",o=h.background?yt([h.background]):null,A=(null===(u=h.border)||void 0===u?void 0:u.stroke)&&h.border.stroke.color&&"transparent"!==gt(h.border.stroke.color)&&Zt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=ne(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var r,i,n,o,a,s;return"drop-shadow("+gt(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(n=i.x)||void 0===n?void 0:n.value)||0)/e)+" "+dt(10*((null===(o=t.offset)||void 0===o||null===(a=o.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(h.text_shadow,$):void 0,l={singleline:m,decoration:w},c={"font-size":dt(10*$/g),"line-height":x,"letter-spacing":k,"font-weight":_,"font-family":E,filter:s,color:C,background:(null==o?void 0:o.color)||void 0,"box-shadow":A?`inset 0 0 0 ${dt(A.width)} ${A.color}`:void 0,"border-radius":a?dt(a):void 0},`${n?`<span${L("class",ie["text-range__top-offset"],0)}${H({"margin-top":n})}></span>`:""}${B(qt,"Actionable").$$render(t,{cls:Ft("text-range",ie,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),le=se;function ce(t,e){return"left"===t||"center"===t||"right"===t?t:e}function ue(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function de(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function pe(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const ve=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,S,P,O,I,M,T,N,R,J,U,W,H,q,G=o,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,it=o,nt=o,ot=o,st=o,ct=o,pt=o,vt=o,{json:ft={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:bt}=e;const _t=f(at);let wt="",$t=12,xt=1.25,kt=!1,Et="",Ct="",At=!1,Vt="left",Dt="top",jt="",St="",Pt="",Ot=!1,It=[],Mt=[];var Tt;v((()=>{Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)}))})),void 0===e.json&&r.json&&void 0!==ft&&r.json(ft),void 0===e.templateContext&&r.templateContext&&void 0!==ht&&r.templateContext(ht),void 0===e.origJson&&r.origJson&&void 0!==mt&&r.origJson(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==bt&&r.layoutParams(bt),ft&&($t=12,xt=1.25,kt=!1,Et="",Ct="",At=!1,Vt="left",Dt="top",jt="",Pt="",Ot=!1),n=_t.getDerivedFromVars(ft.text),vt(),vt=l(n,(t=>q=t)),a=_t.getDerivedFromVars(ft.ranges),Z(),Z=l(a,(t=>j=t)),s=_t.getDerivedFromVars(ft.images),G(),G=l(s,(t=>D=t)),c=_t.getDerivedFromVars({font_size:ft.font_size,letter_spacing:ft.letter_spacing,font_weight:ft.font_weight,font_family:ft.font_family,text_color:ft.text_color,underline:ft.underline,strike:ft.strike,line_height:ft.line_height,text_shadow:ft.text_shadow}),Y(),Y=l(c,(t=>S=t)),u=_t.getDerivedFromVars(ft.font_size),pt(),pt=l(u,(t=>H=t)),d=_t.getDerivedFromVars(ft.line_height),ct(),ct=l(d,(t=>W=t)),p=_t.getDerivedFromVars(ft.max_lines),it(),it=l(p,(t=>N=t)),g=_t.getDerivedFromVars(ft.text_alignment_horizontal),ot(),ot=l(g,(t=>J=t)),h=_t.getDerivedFromVars(ft.text_alignment_vertical),nt(),nt=l(h,(t=>R=t)),m=_t.getDerivedFromVars(ft.text_color),et(),et=l(m,(t=>T=t)),y=_t.getDerivedFromVars(ft.focused_text_color),tt(),tt=l(y,(t=>M=t)),b=_t.getDerivedFromVars(ft.truncate),K(),K=l(b,(t=>I=t)),_=_t.getDerivedFromVars(ft.text_gradient),Q(),Q=l(_,(t=>O=t)),w=_t.getDerivedFromVars(ft.selectable),X(),X=l(w,(t=>P=t)),$=_t.getDerivedFromVars(ft.auto_ellipsize),st(),st=l($,(t=>U=t)),Tt=q,wt=String(null!=Tt?Tt:""),$t=ne(H,$t);{const t=W;Zt(t)?(xt=Number(t)/$t,kt=!0):kt=!1}x=1===N;{let t="",e="",r=!1;if(N&&N>1){let i=Number(N);t=i*xt+"em",e=i,r=!0}else U&&1!==N&&(r=!0);Et=t,Ct=e,At=r}Vt=ce(J,Vt),Dt=ue(R,Dt),k=!j||wt&&1===j.length&&j[0]&&0===j[0].start&&"number"==typeof j[0].end&&j[0].end>=wt.length,E=Boolean(T)!==Boolean(j&&j[0]&&j[0].text_color);{let t="";N&&k&&E&&(t=gt(T||j&&j[0]&&j[0].text_color,1,jt)),jt=t}St=gt(M,1,St),C="none"===I?"none":"";{let t="";if(O){const e=yt([O]);e.image&&(t=e.image)}Pt=t}return Ot=de(P,Ot),function(t,e,r){let i=[];if(Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)})),Mt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(It=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e,r;let o="image"===t.type?null:t.range,a=t.index;if(a>s){let o=Object.assign(Object.assign({},S),...l);i.push({text:n.substring(s,a),textStyles:o,actions:"rangeEnd"===t.type&&(null===(r=null===(e=t.range)||void 0===e?void 0:e.actions)||void 0===r?void 0:r.filter(Ut))||void 0})}if("rangeStart"===t.type&&o)l.push(o);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},S),...l),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":dt(10*(Number(e.font_size)||12)/$t)};let a="";const s=t.image.tint_color,c=pe(t.image.tint_mode,"source_in");if(s){const e=gt(t.image.tint_color);a=_t.addSvgFilter(e,c),Mt.push([e,c])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=a})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},S)}),It=i}(wt,j,D),A={singleline:x,multiline:At,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(St)},F={gradient:Boolean(Pt)},V={"font-size":dt($t),"line-height":xt,"max-height":Et,"-webkit-line-clamp":Ct,color:jt,"background-image":Pt,"--divkit-text-focus-color":St},G(),Z(),Y(),X(),Q(),K(),tt(),et(),it(),nt(),ot(),st(),ct(),pt(),vt(),`${B(re,"Outer").$$render(t,{cls:Ft("text",lt,A)+" "+(Ot?"":rt),json:ft,origJson:mt,templateContext:ht,layoutParams:bt},{},{default:()=>`<span${L("class",Ft("text__inner",lt,F),0)}${L("style",ut(V),0)}>${It.length?`${z(It,(e=>"text"in e?e.text?`${B(le,"TextRangeView").$$render(t,{json:ft,text:e.text,rootFontSize:$t,textStyles:e.textStyles,singleline:x,actions:e.actions},{},{})}`:"":e.image?`<span${L("style",ut(e.image.wrapperStyle),0)}><img${L("class",lt.text__image,0)}${L("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${L("style",ut({width:e.image.width,height:e.image.height,"margin-top":kt?`-${e.image.height}`:void 0,"margin-bottom":kt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${B(le,"TextRangeView").$$render(t,{json:ft,text:wt,rootFontSize:$t,textStyles:S,singleline:x},{},{})}`}</span>`})}`})),ge=ve,fe={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_overflow_visible:"divkit-f315a",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function he(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function me(t,e,r){const i=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),n=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(r?t.top=e.style.height+n:t.left=e.style.width+i),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+n:t.right=e.style.width+i)}function ye(t,e,r){let i;const n=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==r?void 0:r.margins.left)||0)+((null==r?void 0:r.margins.right)||0),s=((null==r?void 0:r.margins.top)||0)+((null==r?void 0:r.margins.bottom)||0);return i="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+n:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],i.map(dt).join(" ")}function be(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function _e(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function we(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let i;if("rounded_rectangle"===t.shape.type)i={width:Ot(null===(o=(n=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Ot(null===(a=n.item_height)||void 0===a?void 0:a.value,10),radius:Ot(null===(s=n.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Ot(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var n,o,a,s;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?gt(o.color):"",s=null!=o&&o.width?Number(null!==(i=o.width)&&void 0!==i?i:1):"";n.width=t.width,n.height=t.height,n.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return n.background=gt(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}let $e;function xe(){if("undefined"==typeof document&&($e=!0),void 0!==$e)return $e;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),$e=1===t.scrollHeight,document.body.removeChild(t),$e}const ke="divkit-a7719",Ee="divkit-f6e9a";function Ce(t,e,r,i,n,o){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;o?t.push({top:r.bottom+l,left:n.left+a,width:Math.max(0,n.right-n.left-a-s),height:i.top-r.bottom-l-c,style:e.style}):t.push({top:n.top+l,left:r.right+a,width:i.left-r.right-a-s,height:Math.max(0,n.bottom-n.top-l-c),style:e.style})}function Ae(t,e,r,i,n,o){const a={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if(null==e?void 0:e.show_at_start){let s,l;"space-around"===n||"space-evenly"===n?(s=o.left-e.style.width,l=o.top-e.style.height):(s=r[0].left-e.style.width-e.margins.left-e.margins.right,l=r[0].top-e.style.height-e.margins.top-e.margins.bottom),Ce(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,i)}if(null==e?void 0:e.show_between)for(let n=0;n<r.length-1;++n)Ce(t,e,r[n],r[n+1],a,i);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===n||"space-evenly"===n?(l=o.bottom+e.style.height,c=o.right+e.style.width):(l=s.bottom+e.style.height+e.margins.top+e.margins.bottom,c=s.right+e.style.width+e.margins.left+e.margins.right),Ce(t,e,s,{top:l,right:0,bottom:0,left:c},a,i)}}const Fe=U(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e;const u=function(t,e){let r,i=0,n=!1;return function(){const e=Date.now();return!i||Math.abs(e-i)>10?(i=e,r=t.apply(this,arguments)):(n||(n=!0,setTimeout((()=>{n=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!n)return;const t=n.getBoundingClientRect(),e=window.getComputedStyle(n),r={top:t.top+parseFloat(e.paddingTop),right:t.right-parseFloat(e.paddingRight),bottom:t.bottom-parseFloat(e.paddingBottom),left:t.left+parseFloat(e.paddingLeft)};p=[];let i=[...n.children].filter((t=>t!==d&&!t.classList.contains(ct.outer__border))),u=[];for(;i.length;){const t=[],e=i.shift();t.push(e);let r=e.getBoundingClientRect(),n=r.right,a=r.bottom;for(;i.length;){let e=i[0],r=e.getBoundingClientRect();if("vertical"===o){if(r.top<a)break}else if(r.left<n)break;n=Math.max(n,r.right),a=Math.max(a,r.bottom),t.push(e),i.shift()}u.push(t)}const v=[];u.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&Ae(p,a,e,"vertical"===o,"vertical"===o?c:l,r);const i={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};v.push(i)})),s&&Ae(p,s,v,"horizontal"===o,"vertical"===o?l:c,r),p.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let d,p=[],g=!1,f=null,h=null;return v((()=>{g=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),void 0===e.contentHAlign&&r.contentHAlign&&void 0!==l&&r.contentHAlign(l),void 0===e.contentVAlign&&r.contentVAlign&&void 0!==c&&r.contentVAlign(c),n=null,(g&&n||f||h)&&(f&&(f.disconnect(),f=null),h&&(h.disconnect(),h=null),g&&n&&("undefined"!=typeof MutationObserver&&(f=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(Ee))&&!(null==r?void 0:r.contains(ke))}))&&u()})),f.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(u),h.observe(n)))),g&&n&&u(),` <div${L("class",ke,0)}${L("this",d,0)}>${z(p,(t=>`<div${L("class","divkit-c770e",0)}${H({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${L("class",Ee,0)}${H({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div> </div>`))}</div>`})),Ve={left:"start",center:"center",right:"end","space-between":"start","space-around":"start","space-evenly":"start"},De={top:"start",center:"center",bottom:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},je=["rounded_rectangle","circle"],Se=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,S,P,O,I,M=o,T=o,N=o,R=o,J=o,U=o,L=o,W=o,H=o,q=o,G=o;var Z,Y,X,Q,tt,et;let{json:rt={}}=e,{templateContext:it}=e,{origJson:nt}=e,{layoutParams:ot}=e;const st=f(at);let lt,ct,ut="vertical",dt="top",pt="left",vt=null,gt=null,ft={};void 0===e.json&&r.json&&void 0!==rt&&r.json(rt),void 0===e.templateContext&&r.templateContext&&void 0!==it&&r.templateContext(it),void 0===e.origJson&&r.origJson&&void 0!==nt&&r.origJson(nt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ot&&r.layoutParams(ot),rt&&(ut="vertical",dt="top",pt="left",ct=void 0),n=rt.items,a=st.getDerivedFromVars(rt.orientation),G(),G=l(a,(t=>I=t)),s=st.getDerivedFromVars(rt.layout_mode),q(),q=l(s,(t=>O=t)),c=st.getDerivedFromVars(rt.content_alignment_vertical),W(),W=l(c,(t=>S=t)),u=st.getDerivedFromVars(rt.content_alignment_horizontal),L(),L=l(u,(t=>j=t)),d=st.getDerivedFromVars(rt.separator),U(),U=l(d,(t=>D=t)),p=st.getDerivedFromVars(rt.line_separator),J(),J=l(p,(t=>V=t)),v=st.getDerivedFromVars(rt.aspect),R(),R=l(v,(t=>F=t)),g=st.getDerivedFromVars(rt.width),T(),T=l(g,(t=>C=t)),h=st.getDerivedFromVars(rt.height),N(),N=l(h,(t=>A=t)),m=st.getDerivedFromVars(rt.clip_to_bounds),M(),M=l(m,(t=>E=t)),y=(n||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];y.forEach((e=>{t.push(st.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),lt=K(t,(t=>[...t])),H(),H=l(lt,(t=>P=t))}if(ut=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(I,ut),b="wrap"===O,_="horizontal"!==ut&&!b&&P.some(be),w="vertical"!==ut&&!b&&P.some(_e),dt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(S,dt),pt=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(j,pt),(null==D?void 0:D.style)&&"overlap"!==ut&&xe()){const t=we(D.style,je,(null==vt?void 0:vt.style)||null);vt=t?{show_at_start:Boolean(null!==(Z=D.show_at_start)&&void 0!==Z&&Z),show_at_end:Boolean(null!==(Y=D.show_at_end)&&void 0!==Y&&Y),show_between:Boolean(null===(X=D.show_between)||void 0===X||X),style:t,margins:he(D.margins)}:null}else vt=null;if((null==V?void 0:V.style)&&"overlap"!==ut&&xe()){const t=we(V.style,je,(null==gt?void 0:gt.style)||null);gt=t?{show_at_start:Boolean(null!==(Q=V.show_at_start)&&void 0!==Q&&Q),show_at_end:Boolean(null!==(tt=V.show_at_end)&&void 0!==tt&&tt),show_between:Boolean(null===(et=V.show_between)||void 0===et||et),style:t,margins:he(V.margins)}:null}else gt=null;$=vt||gt?function(t,e,r){const i={};return me(i,e,"vertical"===t),me(i,r,"horizontal"===t),i}(ut,vt,gt):null;{const t=null==F?void 0:F.ratio;ct=t&&Zt(t)?t:void 0}{let t={};(null==ot?void 0:ot.fakeElement)&&(t.fakeElement=!0),"overlap"===ut&&(t.overlapParent=!0),"horizontal"!==ut&&(t.parentHAlign=b?"start":Ve[pt]),"vertical"!==ut&&(t.parentVAlign=b?"start":De[dt]),ct||w||A&&"wrap_content"!==A.type&&("match_parent"!==A.type||!(null==ot?void 0:ot.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!_&&("wrap_content"===(null==C?void 0:C.type)||"match_parent"===(null==C?void 0:C.type)&&(null==ot?void 0:ot.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===ut&&(t.parentContainerOrientation="horizontal"),"vertical"===ut&&(t.parentContainerOrientation="vertical"),b&&(t.parentContainerWrap=!0),ft=Tt(t,ft)}return x={orientation:ut,valign:dt,halign:pt,wrap:b,overflow:!1===E||0===E?"visible":void 0},k={gap:vt||gt?ye(ut,vt,gt):void 0,"aspect-ratio":ct},M(),T(),N(),R(),J(),U(),L(),W(),H(),q(),G(),`${B(re,"Outer").$$render(t,{cls:Ft("container",fe,x),style:k,json:rt,origJson:nt,templateContext:it,layoutParams:ot,additionalPaddings:$,heightByAspect:Boolean(ct),parentOf:n,replaceItems:function(t){rt=Object.assign(Object.assign({},rt),{items:t.filter(mt)})}},{},{default:()=>`${z(y,(e=>`${B(li,"Unknown").$$render(t,{layoutParams:ft,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} ${vt||gt?`${B(Fe,"ContainerSeparators").$$render(t,{separator:vt,lineSeparator:gt,orientation:ut,contentHAlign:pt,contentVAlign:dt},{},{})}`:""}`})}`})),Pe=Se,Oe={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Ie(t,e){return"vertical"===t||"horizontal"===t?t:e}const Me=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v=o,{json:g={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const b=f(at);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.templateContext&&r.templateContext&&void 0!==h&&r.templateContext(h),void 0===e.origJson&&r.origJson&&void 0!==m&&r.origJson(m),void 0===e.layoutParams&&r.layoutParams&&void 0!==y&&r.layoutParams(y),g&&(_="horizontal",w="rgba(0,0,0,0.08)"),n=b.getDerivedFromVars(g.delimiter_style),v(),v=l(n,(t=>p=t)),_=Ie(null==p?void 0:p.orientation,_),a=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=gt(null==p?void 0:p.color,1,w),s="horizontal"===_?"100%":dt(1),c="horizontal"===_?dt(1):"100%",u={background:w,width:s,height:c},d={orientation:_},v(),`${B(re,"Outer").$$render(t,{cls:Ft("separator",Oe,d),json:g,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>a?`<span${L("class",Oe.separator__inner,0)}${L("style",ut(u),0)}></span>`:""})}`})),Te={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function ze(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Ne="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Be=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,S,P,O,I,M,T,z,N,R,J=o,U=o,W=o,q=o,G=o,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,rt=o,it=o,{json:nt={}}=e,{templateContext:ot}=e,{origJson:lt}=e,{layoutParams:ct}=e;const dt=f(at);let pt,vt,ft,ht=0,mt=!1,yt="rgba(0,0,0,0.08)",bt=!1,_t="",xt="none",kt="50% 50%",Et="0",Ct="source_in",At="",Vt="",Dt=0,jt=0,St=0,Pt="",It="";v((()=>{dt.removeSvgFilter(ft,Ct)})),void 0===e.json&&r.json&&void 0!==nt&&r.json(nt),void 0===e.templateContext&&r.templateContext&&void 0!==ot&&r.templateContext(ot),void 0===e.origJson&&r.origJson&&void 0!==lt&&r.origJson(lt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ct&&r.layoutParams(ct),nt&&(xt="none",kt="50% 50%",Ct="source_in"),n=dt.getDerivedFromVars(nt.image_url),rt(),rt=l(n,(t=>N=t)),a=dt.getDerivedFromVars(nt.gif_url),it(),it=l(a,(t=>R=t)),s=dt.getDerivedFromVars(nt.width),et(),et=l(s,(t=>z=t)),c=dt.getDerivedFromVars(nt.height),tt(),tt=l(c,(t=>T=t)),u=dt.getDerivedFromVars(nt.preview),K(),K=l(u,(t=>M=t)),d=dt.getDerivedFromVars(nt.placeholder_color),Q(),Q=l(d,(t=>I=t)),p=dt.getDerivedFromVars(nt.scale),X(),X=l(p,(t=>O=t)),g=dt.getDerivedFromVars({content_alignment_horizontal:nt.content_alignment_horizontal,content_alignment_vertical:nt.content_alignment_vertical}),Y(),Y=l(g,(t=>P=t)),h=dt.getDerivedFromVars(nt.accessibility),Z(),Z=l(h,(t=>S=t)),m=dt.getDerivedFromVars(nt.aspect),G(),G=l(m,(t=>j=t)),y=dt.getDerivedFromVars(nt.tint_color),q(),q=l(y,(t=>D=t)),b=dt.getDerivedFromVars(nt.tint_mode),W(),W=l(b,(t=>V=t)),_=dt.getDerivedFromVars(nt.appearance_animation),U(),U=l(_,(t=>F=t)),w=dt.getDerivedFromVars(nt.filters),J(),J=l(w,(t=>A=t));{let t="gif"===nt.type?R:N;mt="empty://"===t,mt&&(t=Ne),vt=t}ht=0,vt?bt=!1:(bt=!0,dt.logError(st(new Error(`Missing "${"gif"===nt.type?"gif_url":"image_url"}" for "${nt.type}"`)))),$="wrap_content"===(null==z?void 0:z.type),x="wrap_content"===(null==T?void 0:T.type),_t=M?`url("${ze(M)}")`:"",yt=gt(I,1,yt),xt=wt(O)||xt,kt=function(t,e){const r=t.content_alignment_horizontal,i=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||i&&"top"!==i&&"center"!==i&&"bottom"!==i?e:$t(t)}(P,kt),k=(null==S?void 0:S.description)||"";{const t=null==j?void 0:j.ratio;Et=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}{const t=D?gt(D):void 0,e=pe(V,Ct);t===ft&&e===Ct||(dt.removeSvgFilter(ft,Ct),At=t?dt.addSvgFilter(t,e):"",ft=t,Ct=e)}if(F&&"fade"===F.type){const t=F;Vt=zt(t.interpolator,"ease_in_out").replace(/_/g,"-"),St=Ot(t.duration,300),jt=Ot(t.start_delay,0),Dt=Ot(t.alpha,0)}{let t="",e="";Array.isArray(A)&&A.length&&(t=Yt(A,dt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Pt=t,It=e}return E={aspect:"0"!==Et,"is-width-content":$,"is-height-content":x,loaded:!1,"before-appearance":Boolean(Vt)&&!0},C={"background-image":_t,"background-color":_t?void 0:yt,"background-size":xt,"clip-path":It||void 0,"object-fit":xt,"object-position":kt,filter:["",Pt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Vt||void 0,"--divkit-appearance-fade-start":Vt?Dt:void 0,"--divkit-appearance-delay":Vt?`${jt}ms`:void 0,"--divkit-appearance-duration":Vt?`${St}ms`:void 0},J(),U(),W(),q(),G(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),it(),bt?"":`${B(re,"Outer").$$render(t,{cls:Ft("image",Te,E),json:nt,origJson:lt,templateContext:ot,layoutParams:ct,customDescription:!0},{},{default:()=>E.aspect?`<span${L("class",Te["image__aspect-wrapper"],0)}${H({"padding-bottom":`${Et}%`})}><img${L("class",Te.image__image,0)}${L("src",vt,0)} loading="lazy" decoding="async"${L("style",ut(C),0)}${L("alt",k,0)}${L("aria-hidden",k?null:"true",0)}${L("this",pt,0)}></span>`:`<img${L("class",Te.image__image,0)}${L("src",vt,0)} loading="lazy" decoding="async"${L("style",ut(C),0)}${L("alt",k,0)}${L("aria-hidden",k?null:"true",0)}${L("this",pt,0)}>`})}`})),Re={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function Je(t){return t>0&&t<1}function Ue(t){return String(Math.ceil(1e3*t)/1e3)}function Le(t,e,r){if(t.some(Je)){const e=Math.max(...t.filter(Je).map((t=>1/t)));t=t.map((t=>t*e))}let i=0,n=0;const o=[];if(t.every(Boolean)){n=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*n;r>i&&(i=r)}}for(let e=0;e<r;++e)i?o[e]=`minmax(${dt(i*t[e]/n)},${Ue(t[e])}fr)`:t[e]?o[e]=`${Ue(t[e])}fr`:o[e]="auto";return o.join(" ")}const We=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,g,h,m,y,b=o,_=o,w=o,$=o,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const A=f(at);let F,V,D=1,j=[],S=[],P=[],O=[],I=0,M=!1,T="top",N="left";void 0===e.json&&r.json&&void 0!==x&&r.json(x),void 0===e.templateContext&&r.templateContext&&void 0!==k&&r.templateContext(k),void 0===e.origJson&&r.origJson&&void 0!==E&&r.origJson(E),void 0===e.layoutParams&&r.layoutParams&&void 0!==C&&r.layoutParams(C),x&&(D=1,T="top",N="left"),n=Array.isArray(x.items)&&x.items||[],a=A.getDerivedFromVars(x.column_count),$(),$=l(a,(t=>y=t)),s=A.getDerivedFromVars(x.content_alignment_vertical),_(),_=l(s,(t=>h=t)),c=A.getDerivedFromVars(x.content_alignment_horizontal),b(),b=l(c,(t=>g=t)),D=ne(y,D),u=n.map((t=>{let e=t,r=k;return({templateContext:r,json:e}=A.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];u.forEach((e=>{t.push(A.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),F=K(t,(t=>[...t])),w(),w=l(F,(t=>m=t))}{const t={};let e=0,r=0;j=[],S=[],P=[],O=[],M=!1,V=u.map(((i,n)=>{var o,a,s,l;const c=m[n],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,g="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let i=e;i<e+u;++i)for(let e=r;e<r+d;++e)t[i+"_"+e]?M=!0:(t[i+"_"+e]=!0,(!j[i]||j[i]<v)&&(j[i]=v),(!S[e]||S[e]<g)&&(S[e]=g),(!P[i]||P[i]<f)&&(P[i]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:p,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(M=!0),M&&A.logError(st(new Error('Mismatching "grid" rows/columns'))),I=r}return T=ue(h,T),N=ce(g,N),d={valign:T,halign:N},p={"grid-template-columns":Le(j,P,D),"grid-template-rows":Le(S,O,I)},v=M,b(),_(),w(),$(),v?"":`${B(re,"Outer").$$render(t,{cls:Ft("grid",Re,d),json:x,origJson:E,templateContext:k,style:p,layoutParams:C,parentOf:x.items,replaceItems:function(t){x=Object.assign(Object.assign({},x),{items:t.filter(mt)})}},{},{default:()=>`${z(V,(e=>`${B(li,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),He=We,qe={gallery__scroller:"divkit-a4e39",gallery_scrollbar_none:"divkit-f49e7",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon-path":"divkit-b4173"},Ge="divkit-bf36b",Ze="divkit-a67bf",Ye="divkit-e2a31",Xe="divkit-c684b";function Qe(t){const e=[];let r=t[0],i=1;for(let n=1;n<=t.length;n++)t[n]!==r?(e.push(i>1?`repeat(${i}, ${r})`:r),r=t[n],i=1):i++;return e.join(" ")}function Ke(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const tr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,S,P,O,M,T,N,R,J=o,U=o,W=o,H=o,q=o,G=o,Z=o,Y=o,X=o,Q=o,tt=o,{json:et={}}=e,{templateContext:rt}=e,{origJson:it}=e,{layoutParams:ot}=e;const st=f(at);let lt,ct,pt=[],vt=!1,gt=!1,ft=null,ht=!1;const yt=st.getCustomization("galleryLeftClass"),bt=st.getCustomization("galleryRightClass");let _t,wt,$t,xt,kt,Et=1,Ct="horizontal",At="start",Vt=8,Dt="",jt=[],St={},It=!1,Mt={},zt=0;N=l(st.isDesktop,(t=>T=t));const Nt=Ke((function(){if(!lt)return;const t=lt.scrollLeft,e=lt.scrollWidth,r=lt.offsetWidth;vt=t>2,gt=t+r<e-2}),50);function Bt(){let t=[],e=pt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const i=pt[e].children[r];i&&t.push(i)}return t}function Rt(t,e,r="smooth"){const i="horizontal"===Ct,n=i?"offsetLeft":"offsetTop",o=i?"left":"top",a=t[e];a&&lt.scroll({[o]:Math.max(0,a[n]+.01-Vt/2),behavior:r})}function Jt(t){const e=Bt(),r=lt.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===Ct?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==i)return i;const n=e.map((t=>function(t,e){return"horizontal"===Ct?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=n.findIndex(Boolean);return-1!==o?"prev"===t&&2===n.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}v((()=>{ht=!1,_t&&!(null==ot?void 0:ot.fakeElement)&&(st.unregisterInstance(_t),_t=void 0)})),void 0===e.json&&r.json&&void 0!==et&&r.json(et),void 0===e.templateContext&&r.templateContext&&void 0!==rt&&r.templateContext(rt),void 0===e.origJson&&r.origJson&&void 0!==it&&r.origJson(it),void 0===e.layoutParams&&r.layoutParams&&void 0!==ot&&r.layoutParams(ot),et&&(Et=1,Ct="horizontal",At="start",Vt=8,Dt=""),n=Array.isArray(et.items)&&et.items||[],a=st.getDerivedFromVars(et.column_count),Q(),Q=l(a,(t=>M=t)),s=st.getDerivedFromVars(et.orientation),X(),X=l(s,(t=>O=t)),c=st.getDerivedFromVars(et.cross_content_alignment),Y(),Y=l(c,(t=>P=t)),u=st.getDerivedFromVars(et.item_spacing),Z(),Z=l(u,(t=>S=t)),d=st.getDerivedFromVars(et.cross_spacing),G(),G=l(d,(t=>j=t)),p=st.getDerivedFromVars(et.paddings),q(),q=l(p,(t=>D=t)),g=st.getDerivedFromVars(et.scroll_mode),W(),W=l(g,(t=>F=t)),h=st.getDerivedFromVars(et.restrict_parent_scroll),tt(),tt=l(h,(t=>R=t)),m=st.getDerivedFromVars(et.scrollbar),U(),U=l(m,(t=>A=t)),y=st.getDerivedFromVars(et.default_item),J(),J=l(y,(t=>C=t)),b=n.map((t=>{let e=t,r=rt;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),_=T&&ht,_?"undefined"!=typeof ResizeObserver&&(ft=new ResizeObserver((()=>{Nt()})),ft.observe(ct)):ft&&(ft.disconnect(),ft=null),Et=ne(M,Et),w=function(t,e){let r=0,i=[];for(let n=0;n<t.length;++n)i[r]||(i[r]=[]),i[r].push(t[n]),++r>=e&&(r=0);return i}(b,Et),Ct=Ie(O,Ct),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(P,At),Vt=Ot(S,Vt),wt=dt(Vt),xt=Ot(j,Vt),$t=dt(xt),Dt=Pt(D,Dt),$="horizontal"===Ct?"grid-template-columns":"grid-template-rows";{let t=[];b.forEach((e=>{const r="horizontal"===Ct?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),kt=K(t,(t=>t)),H(),H=l(kt,(t=>V=t))}jt=[],Et>1?jt.push("auto"):V.forEach((t=>{!t&&"horizontal"===Ct||"match_parent"===(null==t?void 0:t.type)?jt.push("100%"):jt.push("max-content")}));{const t={};let e={};It=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ct?e.parentVAlign=At:e.parentHAlign=At,"paging"===F&&(It=!0,e.scrollSnap="start",t["horizontal"===Ct?"scroll-padding-left":"scroll-padding-top"]=dt(Vt/2)),1===Et&&(e.parentLayoutOrientation=Ct),St=Tt(t,St),Mt=Tt(e,Mt)}return x={padding:Dt,"grid-gap":$t},k={"grid-gap":wt,[$]:Qe(jt)},E={orientation:Ct,"scroll-snap":It,scrollbar:"auto"===A?"auto":"none"},zt=Ot(C,zt),et&&Nt(),et&&(_t&&(st.unregisterInstance(_t),_t=void 0),et.id&&!(null==ot?void 0:ot.fakeElement)&&(_t=et.id,st.registerInstance(et.id,{setCurrentItem(t){const e=Bt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Rt(e,t)},setPreviousItem(t){const e=Jt("prev"),r=Bt();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Rt(r,i)},setNextItem(t){const e="horizontal"===Ct?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Bt();if(e&&"ring"===t)return void Rt(r,0);const i=Jt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Rt(r,n)}}))),J(),U(),W(),H(),q(),G(),Z(),Y(),X(),Q(),N(),tt(),` ${B(re,"Outer").$$render(t,{cls:Ft("gallery",qe,E),json:et,origJson:it,templateContext:rt,layoutParams:ot,customPaddings:!0,customActions:"gallery",parentOf:n,replaceItems:function(t){et=Object.assign(Object.assign({},et),{items:t.filter(mt)})}},{},{default:()=>`<div class="${I(qe.gallery__scroller,!0)+" "+I(R?nt:"",!0)}"${L("style",ut(St),0)}${L("this",lt,0)}><div${L("class",qe["gallery__items-grid"],0)}${L("style",ut(x),0)}${L("this",ct,0)}>${z(w,((e,r)=>`<div${L("class",qe.gallery__items,0)}${L("style",ut(k),0)}${L("this",pt[r],0)}>${z(e,(e=>`${B(li,"Unknown").$$render(t,{layoutParams:Mt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} </div>`))}</div></div> ${"horizontal"===Ct?`${vt&&_?` <div${L("class",yt||`${qe.gallery__arrow} ${Ge} ${Ye}`,0)}>${yt?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",qe["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${gt&&_?` <div${L("class",bt||`${qe.gallery__arrow} ${Ge} ${Xe}`,0)}>${bt?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",qe["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`})),er=tr,rr={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},ir=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,F,V,D,j,S,P,O,M,T=o,N=o,R=o,J=o,U=o,W=o,q=o,G=o,Z=o;var Y,X;let{json:K={}}=e,{templateContext:tt}=e,{origJson:et}=e,{layoutParams:rt}=e;const it=f(at),ot=it.genId("tabs");let lt,ct=!1,vt=Q([]);C=l(vt,(t=>E=t));let ft,ht,mt,yt,bt,_t,wt,$t={},xt=12,kt="",Et="",Ct="",At="",Vt="",jt="",It="",Mt="",zt="",Nt="",Bt=0,Lt="",Wt="",Ht=null,Gt=!1,Yt=!1,Xt=[],Qt=[],Kt=null;async function te(t,e=!1){if(_t=_,_=t,Gt||(Gt=!0,ht.style.height=dt(ht.clientHeight),mt.style.transform=`translate3d(${100*-(null!=_t?_t:_)}%,0,0)`),Yt=!0,async function(t){await $(),mt.style.transform=`translate3d(${t}%,0,0)`}(100*-_),function(t=!1){const e=t?Math.max(0,_-1):Math.min(_,null!=_t?_t:_),r=t?Math.min(n.length-1,_+1):Math.max(_,null!=_t?_t:_);Xt=Xt.map(((t,i)=>t||i>=e&&i<=r)),Qt=Qt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await $();const t=document.getElementById(`${ot}-panel-${_}`);t&&(ht.style.height=dt(t.offsetHeight))}(),Kt&&clearTimeout(Kt),Kt=window.setTimeout((()=>{Qt=n.map(((t,e)=>e===_))}),400),wt=-_*ht.clientWidth,e){await $();const t=ft.querySelector(`.${rr.tabs__item_selected}`);t&&t.focus()}}if(v((()=>{lt&&(it.unregisterInstance(lt),lt=void 0)})),void 0===e.json&&r.json&&void 0!==K&&r.json(K),void 0===e.templateContext&&r.templateContext&&void 0!==tt&&r.templateContext(tt),void 0===e.origJson&&r.origJson&&void 0!==et&&r.origJson(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),K&&(xt=12,kt="",At="",yt=void 0,Vt="",bt=void 0,jt="",It="",Mt="",zt="",Nt="",Bt=0,Lt="",Wt="",Ht=null),n=K.items||[],a=n.map((t=>t.div)),s=it.getDerivedFromVars(K.width),G(),G=l(s,(t=>O=t)),c=it.getDerivedFromVars(K.height),q(),q=l(c,(t=>P=t)),u=it.getJsonWithVars(K.selected_tab),d=it.getDerivedFromVars(K.tab_title_style),W(),W=l(d,(t=>S=t)),p=it.getDerivedFromVars(K.has_separator),U(),U=l(p,(t=>j=t)),g=it.getDerivedFromVars(K.separator_color),J(),J=l(g,(t=>D=t)),h=it.getDerivedFromVars(K.separator_paddings),R(),R=l(h,(t=>V=t)),m=it.getDerivedFromVars(K.switch_tabs_by_content_swipe_enabled),N(),N=l(m,(t=>F=t)),y=it.getDerivedFromVars(K.restrict_parent_scroll),Z(),Z=l(y,(t=>M=t)),b=it.getDerivedFromVars(K.title_paddings),T(),T=l(b,(t=>A=t)),_=u&&Number(u)||0,Array.isArray(n)&&n.length){let t=[];n.forEach(((e,r)=>{const i=it.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});i.title&&"string"==typeof i.title?t.push(i):it.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),vt.set(t)}else vt.set([]);(null==E?void 0:E.length)?ct=!1:(ct=!0,it.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={};(null==rt?void 0:rt.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==O?void 0:O.type)&&(t.parentHorizontalWrapContent=!0),P&&"wrap_content"!==P.type||(t.parentVerticalWrapContent=!0),$t=Tt(t,$t)}if(!ct&&(_<0||_>=n.length)&&(it.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:K.selected_tab,length:n.length}})),_=_<0?0:n.length-1),ct||E.some((t=>_===t.index))||(it.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:K.selected_tab}})),_=(null===(Y=E[0])||void 0===Y?void 0:Y.index)||0),w=S||{},xt=ne(w.font_size,xt),w.font_size||w.paddings){const t=w.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/xt*10,right:(Number(t.right)||0)/xt*10,bottom:(Number(t.bottom)||0)/xt*10,left:(Number(t.left)||0)/xt*10};kt=Pt(e,kt)}{const t=w.line_height;void 0!==t&&Zt(t)&&(Et=dt(t/xt*10))}{const t=w.letter_spacing;void 0!==t&&St(t)&&(Ct=dt(t/xt*10))}if(w.corner_radius||w.corners_radius||w.font_size){const t=null!==(X=w.corner_radius)&&void 0!==X?X:1e3;w.corners_radius?At=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!St(n[t]))return i;return Jt(t,e,r)}(w.corners_radius,t,xt,At):St(t)&&(At=dt(t/xt*10))}return yt=ae(w.active_font_weight||w.font_weight,yt),Vt=w.font_family&&"string"==typeof w.font_family?it.typefaceProvider(w.font_family,{fontWeight:yt||400}):"",bt=ae(w.inactive_font_weight||w.font_weight,bt),jt=w.font_family&&"string"==typeof w.font_family?it.typefaceProvider(w.font_family,{fontWeight:bt||400}):"",It=gt(w.active_text_color,1,It),Mt=gt(w.inactive_text_color,1,Mt),zt=gt(w.active_background_color,1,zt),Nt=gt(w.inactive_background_color,1,Nt),Bt=Ot(w.item_spacing,Bt),j&&(D&&(Lt=gt(D,1,Lt)),V&&(Wt=Pt(V,Wt))),x={background:Lt,margin:Wt},k=void 0===F||Boolean(F),Ht=Rt(A||void 0,Ht),ct||(Xt=n.map(((t,e)=>e===_)),Qt=n.map(((t,e)=>e===_))),K&&(lt&&(it.unregisterInstance(lt),lt=void 0),!K.id||ct||(null==rt?void 0:rt.fakeElement)||(lt=K.id,it.registerInstance(K.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');te(t)},setPreviousItem(t){let e=_-1;e<0&&(e="ring"===t?n.length-1:_),te(e)},setNextItem(t){let e=_+1;e>n.length-1&&(e="ring"===t?0:_),te(e)}}))),C(),T(),N(),R(),J(),U(),W(),q(),G(),Z(),ct?"":`${B(re,"Outer").$$render(t,{cls:Ft("tabs",rr,{}),json:K,origJson:et,templateContext:tt,layoutParams:rt,customActions:"tabs",parentOf:a,parentOfSimpleMode:!0,replaceItems:function(t){K.items&&(K=Object.assign(Object.assign({},K),{items:K.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))}))}},{},{default:()=>` <div class="${I(rr.tabs__list,!0)+" "+I(M?nt:"",!0)}" role="tablist"${H({"--divkit-tabs-title-padding":Ht?Dt(Ht):"","--divkit-tabs-font-size":dt(xt),"--divkit-tabs-paddings":kt,"--divkit-tabs-line-height":Et,"--divkit-tabs-letter-spacing":Ct,"--divkit-tabs-active-font-weight":yt||"","--divkit-tabs-inactive-font-weight":bt||"","--divkit-tabs-active-font-family":Vt||"","--divkit-tabs-inactive-font-family":jt||"","--divkit-tabs-active-text-color":It,"--divkit-tabs-inactive-text-color":Mt,"--divkit-tabs-active-background-color":zt,"--divkit-tabs-inactive-background-color":Nt,"--divkit-tabs-border-radius":At,"--divkit-tabs-items-spacing":Bt?pt(Bt):""})}${L("this",ft,0)}>${z(E,(e=>{let r=e.index,i=r===_;return` ${B(qt,"Actionable").$$render(t,{cls:Ft("tabs__item",rr,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=rt&&rt.fakeElement?[]:[e.title_click_action].filter(Ut),attrs:{id:`${ot}-tab-${r}`,"aria-controls":`${ot}-panel-${r}`,role:"tab",tabindex:!i||null!=rt&&rt.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"true":"false"},customAction:null!=rt&&rt.fakeElement?null:t=>function(t,e){return _===e||(te(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${j?`<div${L("class",rr.tabs__separator,0)}${L("style",ut(x),0)}></div>`:""} <div class="${I(rr.tabs__panels,!0)+" "+I(M?nt:"",!0)}"${L("this",ht,0)}><div${L("class",Ft("tabs__swiper",rr,{inited:Gt,animated:Yt}),0)}${L("this",mt,0)}>${z(E,(e=>{let r=e.index;return` <div${L("class",Ft("tabs__panel",rr,{visible:Qt[r]}),0)} role="tabpanel" id="${I(ot,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(ot,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${Xt[r]?`${B(li,"Unknown").$$render(t,{div:n[r].div,templateContext:tt,layoutParams:$t},{},{})}`:""} </div>`}))}</div></div>`})}`})),nr=ir,or="divkit-eb860",ar="divkit-e08c6";function sr(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}function lr(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function cr(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...cr(t))})):e.push(t),e}sr([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),sr([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const ur={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},dr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w=o,$=o,x=o,k=o,E=o;var C,A,F,V;let{ownerNode:D}=e,{data:j}=e,{internalId:S}=e,{templateContext:P}=e;const O=f(at);y=l(O.isDesktop,(t=>m=t)),Date.now();return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==D&&r.ownerNode(D),void 0===e.data&&r.data&&void 0!==j&&r.data(j),void 0===e.internalId&&r.internalId&&void 0!==S&&r.internalId(S),void 0===e.templateContext&&r.templateContext&&void 0!==P&&r.templateContext(P),n=O.getDerivedFromVars(j.position),x(),x=l(n,(t=>h=t)),a=O.getDerivedFromVars(null===(A=null===(C=j.offset)||void 0===C?void 0:C.x)||void 0===A?void 0:A.value),$(),$=l(a,(t=>g=t)),s=O.getDerivedFromVars(null===(V=null===(F=j.offset)||void 0===F?void 0:F.y)||void 0===V?void 0:V.value),w(),w=l(s,(t=>p=t)),c=O.getDerivedFromVars(j.animation_in),k(),k=l(c,(t=>b=t)),u=O.getDerivedFromVars(j.animation_out),E(),E=l(u,(t=>_=t)),d={visible:!1},w(),$(),x(),y(),k(),E(),` <div class="${I(Ft("tooltip",ur,d),!0)+" "+I(m?it:"",!0)}"${H({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${B(li,"Unknown").$$render(t,{div:j.div,templateContext:P},{},{})}</div>`}));function pr(t){return"change_bounds"===t.type?t:"set"===t.type?pr(t.items[0]):null}const vr=U(((t,e,r,i)=>{let n,o,a,s,l,c,{json:u={}}=e,{templateContext:d}=e,{origJson:p}=e,{layoutParams:h}=e;const m=f(at),y=f(Vt);let b,_,w,x=!1,k=new Map,E=new Set,C=null,A=[],F=[],V=[],D=[],j=null,S=!1;function P(t,e,r){let{json:i,templateContext:n,transitions:o,node:a}=e;i=m.getJsonWithVars(i),o=m.getJsonWithVars(o);const s=cr(o),l=a.getBoundingClientRect();return{json:Object.assign(Object.assign({},i),{margins:void 0,alpha:(c=s,c.some((t=>"fade"===t.type))?void 0:i.alpha)}),templateContext:n,elementBbox:l,rootBbox:t,transitions:s,alpha:i.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:r,resolvePromise:e.resolvePromise,node:e.node};var c}async function O(t){if(w===t)return;m.setRunning("stateChange",!0);const e=new Set(E);A.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),A=[];let r=[];if(b){const t=b.getBoundingClientRect();r=V.map((e=>P(t,e,"out")))}D.forEach((t=>{k.set(t.id,t.node.getBoundingClientRect())})),F=[],V=[],D=[];const i=l.find((e=>e.state_id===t))||null;if(i?(w=t,null==s||s.setValue(w),j=i):m.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!b)return;const n=b.getBoundingClientRect();let o=F.filter((t=>{var r;return!(!t.json.id||e.has(t.json.id))||(null===(r=t.resolvePromise)||void 0===r||r.call(t),!1)})).map((t=>P(n,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||E.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const a=r.concat(o),c=a.reduce(((t,e)=>Math.max(t,lr(e.transitions))),0),u=D.filter((t=>k.has(t.id))).map((t=>({json:Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}}),templateContext:t.templateContext,rootBbox:n,beforeBbox:k.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:m.getJsonWithVars(pr(t.transitions)),resolvePromise:t.resolvePromise})));A=[...a.map((t=>Object.assign(Object.assign({},t),{maxDuration:c}))),...u],k.clear(),m.setRunning("stateChange",!1)}return g(Vt,{registerInstance(t,e){C||(C=new Map),C.has(t)?m.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):C.set(t,e)},unregisterInstance(t){null==C||C.delete(t)},runVisibilityTransition(t,e,r,i,n){if(!b)return Promise.resolve();const o=P(b.getBoundingClientRect(),{json:t,templateContext:e,transitions:r,node:i},n),a=lr(o.transitions),s=Object.assign(Object.assign({},o),{maxDuration:a});return A=[...A.filter((t=>t.node!==o.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return F.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return V.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,i){const n=t.id;if(!n)return Promise.resolve();const o={id:n,json:t,templateContext:e,transitions:r,node:i};return D.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&k.has(t),registerChild(t){E.add(t)},unregisterChild(t){E.delete(t)}}),v((()=>{_&&y.unregisterInstance(_)})),void 0===e.json&&r.json&&void 0!==u&&r.json(u),void 0===e.templateContext&&r.templateContext&&void 0!==d&&r.templateContext(d),void 0===e.origJson&&r.origJson&&void 0!==p&&r.origJson(p),void 0===e.layoutParams&&r.layoutParams&&void 0!==h&&r.layoutParams(h),n=u.div_id||u.id,o=m.getJsonWithVars(u.default_state_id),a=u.state_id_variable,s=a?m.getVariable(a,"string"):null,u&&(S=!1),n?x=!1:(x=!0,m.logError(st(new Error('Missing "id" prop for div "state"')))),u&&(E=new Set),l=u.states||[],c=l.map((t=>t.div)),(null==l?void 0:l.length)?x=!1:(x=!0,m.logError(st(new Error('Empty "states" prop for div "state"')))),u&&(_&&(y.unregisterInstance(_),_=void 0),n&&!(null==h?void 0:h.fakeElement)&&(_=n,y.registerInstance(n,{setState:O,getChild:function(t){if(C&&C.has(t))return C.get(t);m.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!S&&function(t){if(!S&&(S=!0,t.length)){const e=(null==s?void 0:s.getValue())||o;e?(w=e,j=t.find((t=>t.state_id===w))||null,j||m.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:w}}))):(j=t[0],w=j.state_id),s&&(s.setValue(w),s.subscribe((t=>{O(t)})))}}(l),x?"":`${B(re,"Outer").$$render(t,{cls:"divkit-b8efc",json:u,origJson:p,templateContext:d,layoutParams:h,parentOf:c,parentOfSimpleMode:!0,replaceItems:function(t){const e=u.states;if(!e)return;const r=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})));u=Object.assign(Object.assign({},u),{states:r}),w&&(j=r.find((t=>t.state_id===w))||null)}},{},{default:()=>{var e;return`${null!==(e=j)&&void 0!==e&&e.div?`${B(li,"Unknown").$$render(t,{div:j.div,templateContext:d},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",b,0)}>${z(A,(e=>"direction"in e?`<div${L("class",or,0)}${H({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",ar,0)}>${B(li,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`:`<div${L("class",or,0)}><div${L("class",ar,0)}>${B(li,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`))}</div>`}})} ${null!=h&&h.tooltips?`${z(null==h?void 0:h.tooltips,(e=>`${B(dr,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,templateContext:d},{},{})}`))}`:""}`})),gr=vr,fr={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f",pager__arrow:"divkit-d78c2","pager__arrow-icon-path":"divkit-a94d9"},hr=U(((t,e,r,i)=>{let n,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j=o,S=o,P=o,O=o,M=o,T=o;var N,R,J,U,W,H;let{json:q={}}=e,{templateContext:G}=e,{origJson:Z}=e,{layoutParams:Y}=e;const X=f(at),Q=X.genId("pager"),K=X.getCustomization("pagerLeftClass"),tt=X.getCustomization("pagerRightClass");E=l(X.isDesktop,(t=>k=t)),Ke((function(){if(!it)return;const t=function(){const t=Array.from(rt.children),e=rt.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===vt?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:ot}();t!==ot&&(ot=t)}),50);let et,rt,it=!1,ot=0,lt=0,ct=!1,vt="horizontal",gt="",ft="",ht="";function yt(t,e="smooth"){const r="horizontal"===vt,i=rt.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";rt.scroll({[o]:i[n],behavior:e}),ot=t}v((()=>{it=!1,et&&(X.unregisterInstance(et),et=void 0)})),void 0===e.json&&r.json&&void 0!==q&&r.json(q),void 0===e.templateContext&&r.templateContext&&void 0!==G&&r.templateContext(G),void 0===e.origJson&&r.origJson&&void 0!==Z&&r.origJson(Z),void 0===e.layoutParams&&r.layoutParams&&void 0!==Y&&r.layoutParams(Y),q&&(ft=""),n=X.getDerivedFromVars(q.layout_mode),S(),S=l(n,(t=>C=t)),a=X.getDerivedFromVars(q.orientation),M(),M=l(a,(t=>V=t)),s=X.getDerivedFromVars(q.item_spacing),O(),O=l(s,(t=>F=t)),u=X.getDerivedFromVars(q.paddings),P(),P=l(u,(t=>A=t)),d=X.getDerivedFromVars(q.restrict_parent_scroll),T(),T=l(d,(t=>D=t)),p=(Array.isArray(q.items)&&q.items||[]).map((t=>{let e=t,r=G;return({templateContext:r,json:e}=X.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),C?"percentage"!==C.type&&"fixed"!==C.type?(ct=!0,X.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ct=!1:(ct=!0,X.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),vt=Ie(V,vt);{const t=null==F?void 0:F.value;t&&St(t)&&(gt=dt(t||0))}if(ft=Pt(A,ft),g="horizontal"===vt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==C?void 0:C.type)){const t=pt("horizontal"===vt?((null===(N=q.paddings)||void 0===N?void 0:N.left)||0)+((null===(R=q.paddings)||void 0===R?void 0:R.right)||0):((null===(J=q.paddings)||void 0===J?void 0:J.top)||0)+((null===(U=q.paddings)||void 0===U?void 0:U.bottom)||0)),e=null===(W=C.neighbour_page_width)||void 0===W?void 0:W.value;ht=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${gt})`:"100%"}else if("percentage"===(null==C?void 0:C.type)){const t=null===(H=C.page_width)||void 0===H?void 0:H.value;ht=`${Number(t)}%`}return h={"grid-gap":gt,padding:ft,[g]:ht},m={orientation:vt},y=ct,b=k&&it&&!y,_=ot>0,w=ot+1<p.length,$=X.getStore("pagers"),j(),j=l($,(t=>x=t)),function(t,e){const r=q.id;if(r){const i=new Map(x);c($,x=i.set(r,{instId:Q,size:t,currentItem:e,scrollToPagerItem:yt}),x)}}(p.length,ot),function(t){var e;if(t===lt)return;lt=t;const r=X.getJsonWithVars(null===(e=p[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&X.execAnyActions(r)}(ot),q&&(et&&(X.unregisterInstance(et),et=void 0),q.id&&!(null==Y?void 0:Y.fakeElement)&&(et=q.id,X.registerInstance(q.id,{setCurrentItem(t){if(t<0||t>p.length-1)throw new Error('Item is out of range in "set-current-item" action');yt(t)},setPreviousItem:function(t){let e=ot-1;e<0&&(e="ring"===t?p.length-1:ot),yt(e)},setNextItem:function(t){let e=ot+1;e>p.length-1&&(e="ring"===t?0:ot),yt(e)}}))),j(),E(),S(),P(),O(),M(),T(),y?"":`${B(re,"Outer").$$render(t,{cls:Ft("pager",fr,m),json:q,origJson:Z,templateContext:G,layoutParams:Y,customPaddings:!0,parentOf:q.items,replaceItems:function(t){q=Object.assign(Object.assign({},q),{items:t.filter(mt)})}},{},{default:()=>`<div class="${I(fr.pager__items,!0)+" "+I(D?nt:"",!0)}"${L("style",ut(h),0)}${L("this",rt,0)}>${z(p,(e=>`<div${L("class",fr.pager__item,0)}>${B(li,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=Y&&Y.fakeElement?{fakeElement:!0}:void 0},{},{})} </div>`))}</div> ${_&&b?` <div${L("class",K||`${fr.pager__arrow} ${Ge} ${Ye}`,0)}>${K?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",fr["pager__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${w&&b?` <div${L("class",tt||`${fr.pager__arrow} ${Ge} ${Xe}`,0)}>${tt?"":`<svg${L("class",Ze,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",fr["pager__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`})}`})),mr=hr,yr={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},br=["rounded_rectangle","circle"],_r=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,A=o,F=o,V=o,D=o,j=o,S=o,P=o,O=o,M=o;var T,N;let{json:R={}}=e,{templateContext:J}=e,{origJson:U}=e,{layoutParams:W}=e;const q=f(at);let G,Z,Y,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},K="default",et=15,rt=10,it=5;if(void 0===e.json&&r.json&&void 0!==R&&r.json(R),void 0===e.templateContext&&r.templateContext&&void 0!==J&&r.templateContext(J),void 0===e.origJson&&r.origJson&&void 0!==U&&r.origJson(U),void 0===e.layoutParams&&r.layoutParams&&void 0!==W&&r.layoutParams(W),R&&(K="default",et=15,rt=10,it=5,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"}),n=q.getDerivedFromVars(R.shape),S(),S=l(n,(t=>x=t)),a=q.getDerivedFromVars(R.active_item_color),D(),D=l(a,(t=>_=t)),s=q.getDerivedFromVars(R.inactive_item_color),j(),j=l(s,(t=>w=t)),c=q.getDerivedFromVars(R.active_item_size),P(),P=l(c,(t=>k=t)),u=q.getDerivedFromVars(R.active_shape),M(),M=l(u,(t=>C=t)),d=q.getDerivedFromVars(R.inactive_shape),O(),O=l(d,(t=>E=t)),p=q.getDerivedFromVars(R.space_between_centers),F(),F=l(p,(t=>y=t)),v=q.getDerivedFromVars(R.items_placement),V(),V=l(v,(t=>b=t)),C&&(X=we({type:"shape_drawable",shape:C},br,X)),E&&(Q=we({type:"shape_drawable",shape:E},br,Q)),!C&&!E&&x){const t=ne(k,1.3);Q=we({type:"shape_drawable",shape:x,color:Q.background},br,Q),Q.background=gt(w,1,Q.background),X=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:X.background}),X.background=gt(_,1,X.background)}if(!b||"default"!==b.type&&"stretch"!==b.type)K="default",y&&(et=Ot(y.value,et));else if(K=b.type,"default"===K)et=Ot(null===(T=b.space_between_centers)||void 0===T?void 0:T.value,et);else if("stretch"===K){const t=b;rt=ne(t.max_visible_items,rt),it=Ot(null===(N=t.item_spacing)||void 0===N?void 0:N.value,it)}return g=q.getStore("pagers"),A(),A=l(g,(t=>m=t)),async function(t){if(R.pager_id&&t.has(R.pager_id)&&(Y=t.get(R.pager_id),await $(),Z)){const t=Z.children[Y.currentItem];if(t){const e=t.offsetLeft;G.scroll({left:e-G.clientWidth/2,behavior:"smooth"})}}}(m),h={placement:K},A(),F(),V(),D(),j(),S(),P(),O(),M(),`${B(re,"Outer").$$render(t,{cls:Ft("indicator",yr,h),json:R,origJson:U,templateContext:J,layoutParams:W},{},{default:()=>`<div${L("class",yr.indicator__scroller,0)}${L("this",G,0)}><div${L("class",yr.indicator__items,0)} role="tablist"${H({margin:"default"===K?`0 ${dt(Math.max(0,X.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Q.width),"--divkit-indicator-inactive-height":dt(Q.height),"--divkit-indicator-inactive-border-radius":dt(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":dt(X.width),"--divkit-indicator-active-height":dt(X.height),"--divkit-indicator-active-border-radius":dt(X.borderRadius),"--divkit-indicator-active-background":X.background||"","--divkit-indicator-active-box-shadow":X.boxShadow||"","--divkit-indicator-active-scale":X.width/Q.width,"--divkit-indicator-default-margin":"default"===K?`0 ${dt((et-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===K?dt(it):"","--divkit-indicator-stretch-max-count":"stretch"===K?rt:"","--divkit-indicator-stretch-max-spacer":"stretch"===K?dt((rt-1)*it):""})}${L("this",Z,0)}>${Y?`${z(Array(Y.size),((t,e)=>{let r=e===Y.currentItem;return` <div class="${I(Ft("indicator__item",yr,{active:r}),!0)+" "+I(tt,!0)}" role="tab" id="${I(Y.instId,!0)+"-tab-"+I(e,!0)}" aria-controls="${I(Y.instId,!0)+"-panel-"+I(e,!0)}"${L("aria-selected",r?"true":"false",0)}${L("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),wr=_r,$r={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function xr(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&gt(t.text_color)||"#000",n=oe(t.font_weight);if(Zt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:dt(t.font_size),fontWeight:n,textColor:i};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function kr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Er="function"==typeof BigInt;function Cr(t){return Er?BigInt(t):Number(t)}const Ar=Cr("9223372036854775807"),Fr=Cr("-9223372036854775808");function Vr(t){const e=Cr(t);if(e>Ar||e<Fr)throw new Error("Integer overflow.");return e}const Dr=Vr(0);function jr(t){let e=t;return e<0&&(e=-e),e}function Sr(t){let e=0;return t>0?e=1:t<0&&(e=-1),Vr(e)}class Pr{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=Q(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const Or={string:class extends Pr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Pr{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends Pr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>Ar||t<Fr)throw new Error("Incorrect variable value");return Vr(t)}fromString(t){const e=Vr(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Pr{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}},color:class extends Pr{convertValue(t){if("string"!=typeof t||!ft(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Pr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}},dict:class extends Pr{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}},array:class extends Pr{convertValue(t){if(!Array.isArray(t))throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Array variable does not support setter from string")}getType(){return"array"}}};function Ir(t,e,r){if(!(e in Or))throw new Error("Unsupported variable type");return new Or[e](t,r)}const Mr={width:10,height:10,borderRadius:5,background:"#000"},Tr=["rounded_rectangle","circle"],zr=["rounded_rectangle"];function Nr(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const Br=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,S,P,O,M,T,N,R,J,U,W,q,G,Z,Y,X=o,Q=o,K=o,tt=o,et=o,rt=o,it=o,nt=o,ot=o,lt=o,ct=o,ut=o,vt=o,gt=o;var ft,ht,mt,yt;let{json:bt={}}=e,{templateContext:_t}=e,{origJson:wt}=e,{layoutParams:$t}=e;const xt=f(at),kt=f(Wt);let Et,Ct,At,Vt,Dt,jt=0,Pt=100,Ot=Mr,It=Ot,Mt=Mr,Tt=Mr,zt=null,Bt=null,Rt=Dt,Jt="",Ut="",Lt=!1,Ht=kr(G||0,jt,Pt),qt=kr(q||0,jt,Pt),Gt=!1;function Zt(){if(!Ct)return;const t=Pt-jt,e=(null==zt?void 0:zt.width)||0,r=(null==Bt?void 0:Bt.width)||0;Math.max(e,r)*t>=(null==Ct?void 0:Ct.clientWidth)?Gt||(xt.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}Ke(Zt,50),v((()=>{Et&&(xt.unregisterFocusable(Et),Et=void 0)})),void 0===e.json&&r.json&&void 0!==bt&&r.json(bt),void 0===e.templateContext&&r.templateContext&&void 0!==_t&&r.templateContext(_t),void 0===e.origJson&&r.origJson&&void 0!==wt&&r.origJson(wt),void 0===e.layoutParams&&r.layoutParams&&void 0!==$t&&r.layoutParams($t),bt&&(Ot=Mr,It=Ot,Mt=Mr,Tt=Mr,zt=null,Bt=null,Dt=void 0,Rt=void 0,Jt="",Ut=""),n=bt.thumb_value_variable,a=bt.thumb_secondary_value_variable,s=n&&xt.getVariable(n,"integer")||Ir("temp","integer",0),ut(),ut=l(s,(t=>G=t)),c=a&&xt.getVariable(a,"integer")||Ir("temp","integer",0),ct(),ct=l(c,(t=>q=t)),u=xt.getDerivedFromVars(bt.min_value),gt(),gt=l(u,(t=>Y=t)),d=xt.getDerivedFromVars(bt.max_value),vt(),vt=l(d,(t=>Z=t)),p=xt.getDerivedFromVars(bt.thumb_style),lt(),lt=l(p,(t=>W=t)),g=xt.getDerivedFromVars(bt.thumb_secondary_style),ot(),ot=l(g,(t=>U=t)),h=xt.getDerivedFromVars(bt.track_inactive_style),nt(),nt=l(h,(t=>J=t)),m=xt.getDerivedFromVars(bt.track_active_style),it(),it=l(m,(t=>R=t)),y=xt.getDerivedFromVars(bt.tick_mark_active_style),rt(),rt=l(y,(t=>N=t)),b=xt.getDerivedFromVars(bt.tick_mark_inactive_style),et(),et=l(b,(t=>T=t)),_=xt.getDerivedFromVars(bt.thumb_text_style),tt(),tt=l(_,(t=>M=t)),w=xt.getDerivedFromVars(bt.thumb_secondary_text_style),K(),K=l(w,(t=>O=t)),$=xt.getDerivedFromVars(bt.accessibility),Q(),Q=l($,(t=>P=t)),x=xt.getDerivedFromVars(bt.secondary_value_accessibility),X(),X=l(x,(t=>S=t)),jt=Nt(Y,jt),Pt=Nt(Z,Pt),Zt();{const t=kr(G||0,jt,Pt);t!==Ht&&(Ht=t)}{const t=kr(q||0,jt,Pt);t!==qt&&(qt=t)}Ot=we(W,Tr,Ot),It=we(U,Tr,Ot),Mt=we(J,zr,Mt),Tt=we(R,zr,Tt);{let t=we(N,Tr,Mr);t!==Mr&&(zt=t)}zt?(At=a?Nr(Math.min(Ht,qt),Math.max(Ht,qt)+1,jt,Pt,!0):Nr(jt,Ht,jt,Pt,!0),Zt()):At=[];{let t=we(T,Tr,Mr);t!==Mr&&(Bt=t)}Bt?(Vt=a?Nr(Math.min(Ht,qt),Math.max(Ht,qt)+1,jt,Pt,!1):Nr(Ht+1,Pt+1,jt,Pt,!0),Zt()):Vt=[],Dt=xr(M,Dt),Rt=xr(O,Dt),(null==P?void 0:P.description)?Jt=P.description:xt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==S?void 0:S.description)?Ut=S.description:a&&xt.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Ot===Mr?(xt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===Mr?(xt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===Mr&&(xt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Lt&&(Lt=t)}return k=dt(Math.max(...[Ot.width,It.width,0].filter(St))),E=dt(Math.max(...[Ot.height,It.height,0].filter(St))),C=(Ht-jt)/(Pt-jt),A=a?(qt-jt)/(Pt-jt):void 0,F=void 0!==A?Math.abs(A-C):C,V=void 0!==A?Math.min(A,C):0,D={"--divkit-slider-thumb-width":dt(Ot.width),"--divkit-slider-thumb-height":dt(Ot.height),"--divkit-slider-thumb-secondary-width":dt(It.width),"--divkit-slider-thumb-secondary-height":dt(It.height),"--divkit-slider-text-offset-x":(null===(ft=null==Dt?void 0:Dt.offset)||void 0===ft?void 0:ft.x)?pt(Dt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ht=null==Dt?void 0:Dt.offset)||void 0===ht?void 0:ht.y)?pt(Dt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(mt=null==Rt?void 0:Rt.offset)||void 0===mt?void 0:mt.x)?pt(Rt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(yt=null==Rt?void 0:Rt.offset)||void 0===yt?void 0:yt.y)?pt(Rt.offset.y):void 0,"--divkit-slider-tick-active-width":zt?dt(zt.width):void 0,"--divkit-slider-tick-active-height":zt?dt(zt.height):void 0,"--divkit-slider-tick-active-border-radius":zt?dt(zt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==zt?void 0:zt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==zt?void 0:zt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?dt(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?dt(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?dt(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":k,"--divkit-slider-max-thumb-height":E,"--divkit-slider-track-part":C,"--divkit-slider-track-secondary-part":A},j={},X(),Q(),K(),tt(),et(),rt(),it(),nt(),ot(),lt(),ct(),ut(),vt(),gt()," "+(Lt?"":`${B(re,"Outer").$$render(t,{cls:Ft("slider",$r,j),style:D,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,json:bt,origJson:wt,templateContext:_t,layoutParams:$t},{},{default:({focusHandler:t,blurHandler:e})=>{var r,i,n,o,s,l;return`<div${L("class",$r["slider__tracks-wrapper"],0)}><div${L("class",$r["slider__tracks-inner"],0)}${L("this",Ct,0)}><div${L("class",$r.slider__track,0)}${H({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${L("class",$r["slider__active-track"],0)}${H({left:(100*V).toFixed(2)+"%",width:(100*F).toFixed(2)+"%",height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> ${z(At,(t=>`<div class="${I($r.slider__tick,!0)+" "+I($r.slider__tick_active,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} ${z(Vt,(t=>`<div class="${I($r.slider__tick,!0)+" "+I($r.slider__tick_inactive,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} <div${L("class",$r.slider__thumb,0)}${H({"border-radius":dt(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Dt?`<div${L("class",$r["slider__thumb-text"],0)}><div${L("class",$r["slider__thumb-text-inner"],0)}${H({"font-size":(null===(r=Dt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(i=Dt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(n=Dt)||void 0===n?void 0:n.textColor)||"#000"})}>${I(Ht)}</div></div>`:""}</div> ${a?`<div class="${I($r.slider__thumb,!0)+" "+I($r.slider__thumb_secondary,!0)}"${H({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Rt?`<div class="${I($r["slider__thumb-text"],!0)+" "+I($r["slider__thumb-text_secondary"],!0)}"><div${L("class",$r["slider__thumb-text-inner"],0)}${H({"font-size":(null===(o=Rt)||void 0===o?void 0:o.fontSize)||"1em","font-weight":(null===(s=Rt)||void 0===s?void 0:s.fontWeight)||"",color:(null===(l=Rt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(qt)}</div></div>`:""}</div>`:""} <input type="range"${L("class",$r.slider__input,0)}${L("min",jt,0)}${L("max",Pt,0)} step="1"${L("value",Ht,0)}${L("aria-label",Jt,0)}${L("this",undefined,0)}> ${a?`<input type="range"${L("class",`${$r.slider__input} ${$r.slider__input_secondary}`,0)}${L("min",jt,0)}${L("max",Pt,0)} step="1"${L("value",qt,0)}${L("aria-label",Ut,0)}>`:""}</div></div>`}})}`)})),Rr={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_right":"divkit-e8038",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_top":"divkit-bdccd","input_alignment-vertical_bottom":"divkit-fc670","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function Jr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Jr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,i=e.length-1;const n=e.length-t.length;for(;r<i&&r<t.length&&t[r]===e[r];)++r;for(;i-n>=r&&t[i-n]===e[i];)--i;return++i,{start:r,added:i-r,removed:i-r-n}}function Ur(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Lr{constructor(t){this.char=t}}class Wr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class Hr{constructor(t){Ur(this,"filters",new Map),Ur(this,"destructedValue",[]),Ur(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof Lr)t+=r.char;else if(r instanceof Wr)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof Wr&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(st(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new Wr(null,this.filters.get(e.key),e.placeholder):new Lr(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=Jr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const i=this.buildBodySubstring(r,t),n=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=n?this.calculateMaxShift(n,o):void 0;this.replaceChars(i,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(n,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,i=e;for(;i<this.destructedValue.length;)this.destructedValue[i]instanceof Wr&&++r,++i;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let i=0;for(;i<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+i);)++i;return Math.max(0,i-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof Wr&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof Wr&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let i;i=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=i}calculateInsertableSubstring(t,e){let r="",i=e;const n=()=>{for(var t;i<this.destructedValue.length&&!(this.destructedValue[i]instanceof Wr);)++i;return null===(t=this.destructedValue[i])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=n();null!=e&&e.test(t)&&(r+=t,++i)})),r}collectValueRange(t,e){let r="",i=t;for(;i<=e;){const t=this.destructedValue[i];t instanceof Wr&&null!==t.char&&(r+=t.char),++i}return r}replaceChars(t,e,r){let i=this.calculateInsertableSubstring(t,e);void 0!==r&&(i=i.substring(0,r));let n=e,o=0;for(;n<this.destructedValue.length&&o<i.length;){const t=this.destructedValue[n],e=i[o];t instanceof Wr&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof Wr);)++e;return e}}class qr extends Hr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function Gr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Zr extends Hr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),Gr(this,"currencyFormatter",new Intl.NumberFormat),Gr(this,"decimalSeparator","."),Gr(this,"localeDigits",{}),Gr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(st(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),i=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:i,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=Jr(this.value,t),i=this.value.lastIndexOf(this.decimalSeparator),n=t.lastIndexOf(this.decimalSeparator),o=i!==n||-1===i&&-1===n,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,i=0;for(;i<t.length;){if(t[i]===this.decimalSeparator&&!this.inDiff(e,i)){r=i;break}i++}let n=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(n=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(i=r;i<t.length;)this.isDigit(t[i])&&!this.inDiff(e,i)&&a--,i++;else{let r=!1;for(let i=0;i<t.length;i++){const n=t[i];n===this.decimalSeparator?r=!0:!this.inDiff(e,i)&&r&&this.isDigit(n)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==n,l=[];i=t.length-1;let c=!1;for(;i>=0;){const u=t[i],d=l.length<=o;this.isDigit(u)?this.inDiff(e,i)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&i===n?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==i&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=i),i--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function Yr(t){const e=t.textContent;let r=0;return"string"==typeof e&&(r+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++r),r}function Xr(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const r=document.createRange(),i=t.parentNode,n=Array.from(i.childNodes).indexOf(t)+1;r.setStart(i,n),r.setEnd(i,n),e.addRange(r)}}catch(t){}else for(let r=0,i=t.childNodes.length;r<i;++r){const i=t.childNodes[r],n=Yr(i);if(e<=n)return void Xr(i,e);e-=n}else try{const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStart(t,e),i.setEnd(t,e),r.addRange(i)}}catch(t){}}const Qr="undefined"!=typeof document&&"inputMode"in document.createElement("input"),Kr={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"},ti=U(((t,e,r,i)=>{let n,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,A,F,V,D,j,S,P,O,M,T,z,N,R,J,U,W,H,q,G,Z,Y,X,Q,K,tt,et,rt,it,nt,ot=o,lt=o,ct=o,vt=o,ft=o,ht=o,mt=o,yt=o,bt=o,_t=o,wt=o,$t=o,xt=o,kt=o,Et=o,Ct=o,At=o,Vt=o,St=o;var Pt;let{json:It={}}=e,{templateContext:Mt}=e,{origJson:Tt}=e,{layoutParams:zt}=e;const Nt=f(at);let Bt,Jt,Ut,Lt,Wt,Ht=null,qt="",Gt="",Yt=!1,Xt="",Qt=12,Kt="",te="",ee="#000",ie="",oe="left",se="center",le="multi_line_text",de="text",pe="",ve=null,ge="",fe="",he="";function me(t){Jt instanceof HTMLInputElement?Jt.selectionStart=Jt.selectionEnd=t:Xr(Jt,t)}async function ye(){if(!Jt||!Ht)return;Ht.overrideRawValue(N),u.set(Ht.rawValue),c(s,z=qt=Gt=Ht.value,z);const t=Ht.cursorPosition;await $(),document.activeElement===Jt&&me(t)}var be;v((()=>{Bt&&(Nt.unregisterFocusable(Bt),Bt=void 0)})),void 0===e.json&&r.json&&void 0!==It&&r.json(It),void 0===e.templateContext&&r.templateContext&&void 0!==Mt&&r.templateContext(Mt),void 0===e.origJson&&r.origJson&&void 0!==Tt&&r.origJson(Tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==zt&&r.layoutParams(zt),It&&(Xt="",Qt=12,Ut=void 0,Kt="",Lt=void 0,ee="#000",ie="",oe="left",se="center",le="multi_line_text",de="text",Wt=void 0),n=It.text_variable,a=null===(Pt=It.mask)||void 0===Pt?void 0:Pt.raw_text_variable,s=n&&Nt.getVariable(n,"string")||Ir("temp","string",""),ot(),ot=l(s,(t=>z=t)),u=a&&Nt.getVariable(a,"string")||Ir("temp","string",""),lt(),lt=l(u,(t=>N=t)),d=Nt.getDerivedFromVars(It.hint_text),Vt(),Vt=l(d,(t=>it=t)),p=Nt.getDerivedFromVars(It.hint_color),At(),At=l(p,(t=>rt=t)),g=Nt.getDerivedFromVars(It.font_size),Ct(),Ct=l(g,(t=>et=t)),h=Nt.getDerivedFromVars(It.font_weight),Et(),Et=l(h,(t=>tt=t)),m=Nt.getDerivedFromVars(It.font_family),kt(),kt=l(m,(t=>K=t)),y=Nt.getDerivedFromVars(It.line_height),xt(),xt=l(y,(t=>Q=t)),b=Nt.getDerivedFromVars(It.letter_spacing),$t(),$t=l(b,(t=>X=t)),_=Nt.getDerivedFromVars(It.text_color),wt(),wt=l(_,(t=>Y=t)),w=Nt.getDerivedFromVars(It.highlight_color),_t(),_t=l(w,(t=>Z=t)),x=Nt.getDerivedFromVars(It.text_alignment_horizontal),bt(),bt=l(x,(t=>G=t)),k=Nt.getDerivedFromVars(It.text_alignment_vertical),yt(),yt=l(k,(t=>q=t)),E=Nt.getDerivedFromVars(It.keyboard_type),mt(),mt=l(E,(t=>H=t)),C=Nt.getDerivedFromVars(It.mask),ht(),ht=l(C,(t=>W=t)),A=Nt.getDerivedFromVars(It.max_visible_lines),ft(),ft=l(A,(t=>U=t)),F=Nt.getDerivedFromVars(It.paddings),vt(),vt=l(F,(t=>J=t)),V=Nt.getDerivedFromVars(It.accessibility),ct(),ct=l(V,(t=>R=t)),D=Nt.getDerivedFromVars(It.select_all_on_focus),St(),St=l(D,(t=>nt=t)),n?Yt=!1:(Yt=!0,Nt.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(be=W)?void 0:be.type)?Ht=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const i={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(i),r):new qr(i,e)}return r||null}(be,Nt.logError,Ht):"currency"===(null==be?void 0:be.type)&&(Ht=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new Zr(t.locale,e)}(be,Nt.logError,Ht)),Ht&&ye(),Ht||qt===z||(qt=Gt=z),Ht&&Ht.rawValue!==N&&ye(),j=it,Xt=gt(rt,1,Xt),Qt=ne(et,Qt),Ut=ae(tt,Ut),Kt=K&&"string"==typeof K?Nt.typefaceProvider(K,{fontWeight:Ut||400}):"";{const t=Q;Zt(t)&&(Lt=t/Qt)}return jt(X)&&(te=dt(X)),ee=gt(Y,1,ee),ie=gt(Z,1,ie),oe=ce(G,oe),se=ue(q,se),H&&H in Kr&&(de=Kr[H],le=H),"currency"===(null==W?void 0:W.type)&&(de=Qr?"text":"tel",Wt="decimal"),S="multi_line_text"===le,pe=Zt(U)?`calc(${U*(Lt||1.25)*(Qt/10)+"em"} + ${pt(Ot(null==J?void 0:J.top,0)+Ot(null==J?void 0:J.bottom,0))})`:"",ve=Rt(J||void 0,ve),ge=ve?Dt({top:(Number(ve.top)||0)/Qt*10,right:(Number(ve.right)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10,left:(Number(ve.left)||0)/Qt*10}):"",fe=ve?Dt({top:(Number(ve.top)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10}):"",(null==R?void 0:R.description)?he=R.description:Nt.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),P={"highlight-color":Boolean(ie),multiline:S,"alignment-horizontal":oe,"alignment-vertical":se},O={"--divkit-input-hint-color":Xt,"--divkit-input-highlight-color":ie,"--divkit-input-line-height":Lt,"font-weight":Ut,"font-family":Kt,"letter-spacing":te,color:ee,"max-height":pe},M={"font-size":dt(Qt),padding:ge},T={"font-size":dt(Qt),padding:fe},Jt&&It&&(Bt&&(Nt.unregisterFocusable(Bt),Bt=void 0),It.id&&!(null==zt?void 0:zt.fakeElement)&&(Bt=It.id,Nt.registerFocusable(It.id,{focus(){Jt&&Jt.focus()}}))),ot(),lt(),ct(),vt(),ft(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Et(),Ct(),At(),Vt(),St(),Yt?"":`${B(re,"Outer").$$render(t,{cls:Ft("input",Rr,P),style:O,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,json:It,origJson:Tt,templateContext:Mt,layoutParams:zt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return S?`<span${L("class",Rr["input__scroll-wrapper"],0)}>${!Gt&&j?`<div${L("class",Rr.input__placeholder,0)} aria-hidden="true"${L("style",ut(M),0)}>${I(j)}</div>`:""} <span aria-hidden="true"${L("style",ut(T),0)}>​</span> <span${L("class",Ft("input__input",Rr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${L("aria-label",he,0)}${L("style",ut(M),0)}${L("this",Jt,0)}>${i=Gt,void 0===i?"":i}</span></span>`:`<input${L("type",de,0)}${L("inputmode",Wt,0)}${L("class",Ft("input__input",Rr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",he,0)}${L("style",ut(M),0)}${L("placeholder",j,0)}${L("value",qt,0)}${L("this",Jt,0)}>`;var i}})}`})),ei={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},ri=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,S,P,O,M,T,N=o,R=o,J=o,U=o,W=o,H=o,q=o,G=o,Z=o,Y=o,X=o,{json:Q={}}=e,{templateContext:K}=e,{origJson:tt}=e,{layoutParams:et}=e;const rt=f(at);let it,nt,ot,lt=!1,ct="",pt=null,vt="",ft="rgba(0,0,0,.45)",ht=12,mt="",yt="",bt="#000",_t="";v((()=>{it&&(rt.unregisterFocusable(it),it=void 0)})),void 0===e.json&&r.json&&void 0!==Q&&r.json(Q),void 0===e.templateContext&&r.templateContext&&void 0!==K&&r.templateContext(K),void 0===e.origJson&&r.origJson&&void 0!==tt&&r.origJson(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),Q&&(pt=null,ft="rgba(0,0,0,.45)",ht=12,nt=void 0,mt="",ot=void 0,yt="",bt="#000",_t=""),n=Q.value_variable,a=Q.options,s=Array.isArray(a)&&a.filter((t=>"string"==typeof t.value))||[],c=n&&rt.getVariable(n,"string")||Ir("temp","string",""),Y(),Y=l(c,(t=>M=t)),u=rt.getDerivedFromVars(Q.paddings),Z(),Z=l(u,(t=>O=t)),d=rt.getDerivedFromVars(Q.hint_text),X(),X=l(d,(t=>T=t)),p=rt.getDerivedFromVars(Q.hint_color),G(),G=l(p,(t=>P=t)),g=rt.getDerivedFromVars(Q.font_size),q(),q=l(g,(t=>S=t)),h=rt.getDerivedFromVars(Q.font_weight),H(),H=l(h,(t=>j=t)),m=rt.getDerivedFromVars(Q.font_family),W(),W=l(m,(t=>D=t)),y=rt.getDerivedFromVars(Q.line_height),U(),U=l(y,(t=>V=t)),b=rt.getDerivedFromVars(Q.letter_spacing),J(),J=l(b,(t=>F=t)),_=rt.getDerivedFromVars(Q.text_color),R(),R=l(_,(t=>A=t)),w=rt.getDerivedFromVars(Q.accessibility),N(),N=l(w,(t=>C=t)),Array.isArray(s)&&s.length||rt.logError(st(new Error('Empty selection "items" in "select"'))),n?lt=!1:(lt=!0,rt.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=s.find((t=>t.value===M));t?ct="string"==typeof t.text?t.text:t.value:(ct="",M&&rt.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}ht=ne(S,ht),pt=Rt(O||void 0,pt),vt=pt?Dt({top:(Number(pt.top)||0)/ht*10,right:(Number(pt.right)||0)/ht*10,bottom:(Number(pt.bottom)||0)/ht*10,left:(Number(pt.left)||0)/ht*10}):"",ft=gt(P,1,ft),nt=ae(j,nt),mt=D&&"string"==typeof D?rt.typefaceProvider(D,{fontWeight:nt||400}):"";{const t=V;Zt(t)&&(ot=t/ht)}return jt(F)&&(yt=dt(F/ht*10)),bt=gt(A,1,bt),(null==C?void 0:C.description)?_t=C.description:rt.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),$={hint:!ct},x={"--divkit-input-hint-color":ft,"font-weight":nt,"font-family":mt,color:bt},k={padding:vt,"font-size":dt(ht),"line-height":ot,"letter-spacing":yt},E={"font-size":dt(ht),"line-height":ot,"letter-spacing":yt},N(),R(),J(),U(),W(),H(),q(),G(),Z(),Y(),X(),lt?"":`${B(re,"Outer").$$render(t,{cls:Ft("select",ei,$),style:x,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,json:Q,origJson:tt,templateContext:K,layoutParams:et},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",ei["select__select-text"],0)}${L("style",ut(k),0)} aria-hidden="true"> ${I(ct||T||"​")}</span> <select${L("class",Ft("select__select",ei,{"has-custom-focus":t}),0)}${L("aria-label",_t,0)}${L("style",ut(E),0)}${L("this",undefined,0)}>${z(s,(t=>`<option${L("class",ei.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),ii={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},ni=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C=o,A=o,F=o,V=o,D=o,j=o,S=o,{json:P={}}=e,{templateContext:O}=e,{origJson:I}=e,{layoutParams:M}=e;const T=f(at);let N,R,J,U,W=!1,q=!1,G=[],Z=!1,Y=!1,X=!1,Q="fit",K="0";function tt(){const t=null==R?void 0:R.play();t&&t.catch((t=>{T.logError(st(new Error("Video playing error"),{level:"error",additional:{originalText:String(t)}}))}))}var et,rt;v((()=>{N&&(T.unregisterInstance(N),N=void 0),U&&(U(),U=void 0)})),void 0===e.json&&r.json&&void 0!==P&&r.json(P),void 0===e.templateContext&&r.templateContext&&void 0!==O&&r.templateContext(O),void 0===e.origJson&&r.origJson&&void 0!==I&&r.origJson(I),void 0===e.layoutParams&&r.layoutParams&&void 0!==M&&r.layoutParams(M),P&&(Z=!1,Y=!1,X=!1,J=void 0,Q="fit"),n=P.elapsed_time_variable,a=n&&T.getVariable(n,"integer")||Ir("temp","integer",0),a&&(U&&U(),U=a.subscribe((function(t){q?q=!1:R&&(R.currentTime=Number(t)/1e3)}))),s=T.getDerivedFromVars(P.video_sources),S(),S=l(s,(t=>E=t)),c=T.getDerivedFromVars(P.repeatable),j(),j=l(c,(t=>k=t)),u=T.getDerivedFromVars(P.autostart),C(),C=l(u,(t=>b=t)),d=T.getDerivedFromVars(P.muted),D(),D=l(d,(t=>x=t)),p=T.getDerivedFromVars(P.preview),V(),V=l(p,(t=>$=t)),g=T.getDerivedFromVars(P.scale),F(),F=l(g,(t=>w=t)),h=T.getDerivedFromVars(P.aspect),A(),A=l(h,(t=>_=t)),et=E,rt=G,G=Array.isArray(et)&&et.length?et.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):rt,G.length?W=!1:(W=!0,T.logError(st(new Error('Missing "video_sources" in "video"')))),Z=de(k,Z),Y=de(b,Y),X=de(x,X),J="string"==typeof $?ze($):J,Q=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(w)||Q;{const t=null==_?void 0:_.ratio;K=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}return P&&(N&&(T.unregisterInstance(N),N=void 0),!P.id||W||(null==M?void 0:M.fakeElement)||(N=P.id,T.registerInstance(P.id,{pause:function(){null==R||R.pause()},start:tt}))),P&&b&&R&&tt(),m={aspect:"0"!==K},y={"object-fit":Q},C(),A(),F(),V(),D(),j(),S(),W?"":`${B(re,"Outer").$$render(t,{cls:Ft("video",ii,m),customActions:"video",json:P,origJson:I,templateContext:O,layoutParams:M},{},{default:()=>m.aspect?`<div${L("class",ii["video__aspect-wrapper"],0)}${H({"padding-bottom":`${K}%`})}><video${L("class",ii.video__video,0)}${L("style",ut(y),0)} playsinline ${Z?"loop":""} ${Y?"autoplay":""} ${X?"muted":""}${L("poster",J,0)}${L("this",R,0)}>${z(G,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",ii.video__video,0)}${L("style",ut(y),0)} playsinline ${Z?"loop":""} ${Y?"autoplay":""} ${X?"muted":""}${L("poster",J,0)}${L("this",R,0)}>${z(G,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),oi=ni,ai=U(((t,e,r,i)=>{let n,o,a;var s;let{json:l={}}=e,{templateContext:c}=e,{origJson:u}=e,{layoutParams:d}=e;const p=f(at);let v=null,g="",h={},m=!1;if(void 0===e.json&&r.json&&void 0!==l&&r.json(l),void 0===e.templateContext&&r.templateContext&&void 0!==c&&r.templateContext(c),void 0===e.origJson&&r.origJson&&void 0!==u&&r.origJson(u),void 0===e.layoutParams&&r.layoutParams&&void 0!==d&&r.layoutParams(d),"string"==typeof l.custom_type&&l.custom_type&&(null===(s=p.customComponents)||void 0===s?void 0:s.has(l.custom_type))){if(v=p.customComponents.get(l.custom_type),"function"==typeof v.template){const t=p.getExtensionContext(),e=new Map;for(const[r,i]of t.variables)e.set(r,i.getValue());g=v.template({props:l.custom_props,variables:e})}else g=v.template&&"string"==typeof v.template?v.template:"";h={shadowrootmode:v.shadowRootMode||"open"}}else v=null,g=";",p.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return n=l.items,void 0===n||Array.isArray(n)?m=!1:(m=!0,p.logError(st(new Error('Incorrect "items" prop for div "custom"')))),o=(!m&&n||[]).map((t=>{let e=t,r=c;return({templateContext:r,json:e}=p.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),a={fakeElement:null==d?void 0:d.fakeElement},v?`${B(re,"Outer").$$render(t,{json:l,origJson:u,templateContext:c,layoutParams:d},{},{default:()=>{return(e=v.element)?`<${v.element}${S([T(l.custom_props||{})],{})}${L("this",undefined,0)}>${D(e)?"":`${g?`<template${S([T(h)],{})}> ${g}</template>`:""} ${!m&&n?`${z(o,(e=>`${B(li,"Unknown").$$render(t,{layoutParams:a,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`:""}`}${D(e)?"":`</${e}>`}`:"";var e}})}`:""})),si={};si.text=ge,si.container=Pe,si.separator=Me,si.image=Be,si.gif=Be,si.grid=He,si.gallery=er,si.tabs=nr,si.state=gr,si.pager=mr,si.indicator=wr,si.slider=Br,si.input=ti,si.select=ri,si.video=oi,si.custom=ai;const li=U(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=f(at);let c,u,d;if(void 0===e.div&&r.div&&void 0!==n&&r.div(n),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=n,u=o,d=c&&si[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&si[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(st(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${B(d||N,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||n},{},{})}`:""})),ci=U(((t,e,r,i)=>{let{svgFiltersMap:n}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==n&&r.svgFiltersMap(n),Object.keys(n).length?`<svg${L("class","divkit-dc22b",0)} aria-hidden="true"><defs>${z([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return` <filter${L("id",n[t],0)}><feFlood${L("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${L("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${L("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function ui(t,e,r,i){const n=r[t.type];if(!n)return i(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const i=Object.keys(r).filter((t=>"__proto__"!==t)),n=i.filter((t=>"$"!==t.charAt(0))),o=i.filter((t=>"$"===t.charAt(0)));return n.forEach((i=>{const n=r[i];"object"==typeof n&&null!==n?(e[i]=Array.isArray(n)?[]:{},t(e[i],n)):e[i]=n})),o.forEach((t=>{const i=r[t],n=a[i];if(void 0!==n){const r=t.substring(1);e[r]=n}})),e}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function di(){}function pi(t){return{subscribe:e=>(e(t),di)}}function vi(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function gi(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function fi(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function hi(t){try{return Vr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function mi(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function yi(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,yi.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function bi(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}pi(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(yi,Error),yi.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(i){var s=this.location.end,l=bi("",o.line.toString().length," "),c=i[n.line-1],u=(n.line===s.line?s.column:c.length+1)-n.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+bi("",n.column-1," ")+bi("",u,"^")}else e+="\n at "+a}return e},yi.buildMessage=function(t,e){var r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,i=t.map(a);if(i.sort(),i.length>0){for(e=1,r=1;e<i.length;e++)i[e-1]!==i[e]&&(i[r]=i[e],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."};const _i=new Map,wi=new Map;function $i(t,e,r){const i={args:e,cb:r},n=_i.get(t)||[];_i.has(t)||_i.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");wi.set(o,i)}function xi(t,e){let r=t.args.length,i=t.args.length;const n=t.args[t.args.length-1];if("object"==typeof n&&n.isVararg&&(--r,i=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>i)return{type:"many",expected:i,found:e.length};for(let r=0;r<e.length;++r){let i=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof i&&(i={type:i}),i.type!==e[r].type)return{type:"mismatch",expected:i.type,found:e[r].type}}return{type:"match"}}function ki(t,e){var r;switch(null===(r=e[t.type])||void 0===r||r.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{ki(t,e)}));break;case"BinaryExpression":case"LogicalExpression":ki(t.left,e),ki(t.right,e);break;case"UnaryExpression":ki(t.argument,e);break;case"ConditionalExpression":ki(t.test,e),ki(t.consequent,e),ki(t.alternate,e);break;case"TryExpression":ki(t.test,e),ki(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{ki(t,e)}))}}function Ei(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Ci(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Ai(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return Ci(t.value);if("color"===t.type)return Ii(Oi(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";if("array"===t.type)return"<array>";throw new Error(`Unexpected type ${t.type}`)}function Fi(t){let e=Ai(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Vi(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Di(t,e){if(Er)return Vr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function ji(t,e){if(e<Fr||e>Ar)throw new Error("Integer overflow.");!Er&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Si(t){const e=[];return ki(t,{Variable(t){e.push(t.id.name)}}),e}function Pi(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Oi(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Ii(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return vt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Mi(t){return Ii(Oi(t))}const Ti=Number.MAX_VALUE,zi=Number.MIN_VALUE,Ni="string",Bi="integer",Ri="number",Ji="boolean",Ui="color",Li="url",Wi="datetime",Hi="dict",qi="array";function Gi(t,e){return{type:Ni,value:Ai(e)}}function Zi(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ri,value:r}}function Yi(t,e,r,i){const n=t.variables.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=Mi(o)),{type:i,value:o}}function Xi(t,e,r){return Yi(t,e,r,r.type)}function Qi(t,e,r){return Yi(t,e,r,"color")}function Ki(t,e,r){return Yi(t,e,r,"url")}const tn=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:Bi,value:Vr(i)}},en=tn("getUTCFullYear"),rn=tn("getUTCMonth"),nn=tn("getUTCDate"),on=tn("getUTCDay"),an=tn("getUTCHours"),sn=tn("getUTCMinutes"),ln=tn("getUTCSeconds"),cn=tn("getUTCMilliseconds");function un(t,e,r,i){if(!i.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let n="";const o=e.type===Ni?e.value:Ai(e);for(;n.length+o.length<r.value;)n+=i.value;return n.length>0&&n.length+o.length>r.value&&(n=n.substring(0,Number(r.value)-Number(o.length))),n}function dn(t,e,r,i){const n=un(t,e,r,i);return{type:Ni,value:n+Ai(e)}}function pn(t,e,r,i){const n=un(t,e,r,i);return{type:Ni,value:Ai(e)+n}}function vn(t){return(e,r)=>{const i=Oi(r.value);return{type:Ri,value:i[t]/255}}}function gn(t){return(e,r,i)=>{const n=Oi(r.value);return n[t]=255*i.value,{type:Ui,value:Ii(n)}}}const fn=vn("a"),hn=vn("r"),mn=vn("g"),yn=vn("b"),bn=gn("a"),_n=gn("r"),wn=gn("g"),$n=gn("b");function xn(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=Vr(e.value)/Vr(r);return ji(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=Vr(n)%Vr(i)),{type:Bi,value:n}}const kn=36e5;function En(t,e){return(r,i,...n)=>{let o=function(t,e){let r=t;for(let t=0;t<e.length;++t){if(!r)throw new Error(`Missing property "${e[t]}" in the dict.`);const i=r[e[t]];if(void 0===i)throw new Error(`Missing property "${e[t]}" in the dict.`);r=i}return r}(i.value,n.map((t=>t.value))),a=typeof o;if(a!==t)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");ji(r,o),o=Vr(o)}return"string"===t&&"color"===e&&(o=Mi(o)),{type:e,value:o}}}function Cn(t,e){return(r,i,n,...o)=>{try{return t(r,n,...o)}catch(t){let r=i.value;return"color"===e&&(r=Mi(r)),{type:e,value:r}}}}const An=En("string","string"),Fn=En("number","number"),Vn=En("number","integer"),Dn=En("boolean","boolean"),jn=En("string","color"),Sn=En("string","url"),Pn=Cn(An,"string"),On=Cn(Fn,"number"),In=Cn(Vn,"integer"),Mn=Cn(Dn,"boolean"),Tn=Cn(jn,"color"),zn=Cn(Sn,"url");function Nn(t,e){return(r,i,n)=>{if(n.value<0||n.value>=i.value.length)throw new Error(`Requested index (${n.value}) out of bounds array size (${i.value.length}).`);let o=i.value[Number(n.value)],a=typeof o;if("array"===t&&!Array.isArray(o)||"array"!==t&&a!==t||"object"===a&&null===o)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");ji(r,o),o=Vr(o)}return"string"===t&&"color"===e&&(o=Mi(o)),{type:e,value:o}}}function Bn(t,e){return(r,i,n,o)=>{try{return t(r,i,n)}catch(t){let r=o.value;return"color"===e&&(r=Mi(r)),{type:e,value:r}}}}const Rn=Nn("string","string"),Jn=Nn("number","number"),Un=Nn("number","integer"),Ln=Nn("boolean","boolean"),Wn=Nn("string","color"),Hn=Nn("string","url"),qn=Nn("array","array"),Gn=Nn("object","dict"),Zn=Bn(Rn,"string"),Yn=Bn(Jn,"number"),Xn=Bn(Un,"integer"),Qn=Bn(Ln,"boolean"),Kn=Bn(Wn,"color"),to=Bn(Hn,"url");function eo(t){return t.map(Fi).join(", ")}$i("toString",[Bi],Gi),$i("toString",[Ri],Gi),$i("toString",[Ji],Gi),$i("toString",[Ui],Gi),$i("toString",[Li],Gi),$i("toNumber",[Bi],Zi),$i("toNumber",[Ni],Zi),$i("toInteger",[Ri],(function(t,e){if(e.value>Ar||e.value<Fr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Bi,value:Vr(r)}})),$i("toInteger",[Ni],(function(t,e){let r;try{r=Vr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>Ar||r<Fr)throw new Error("Unable to convert value to Integer.");return{type:Bi,value:r}})),$i("toInteger",[Ji],(function(t,e){return{type:Bi,value:Vr(e.value?1:0)}})),$i("toBoolean",[Bi],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Ji,value:r}})),$i("toBoolean",[Ni],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Ji,value:"true"===e.value?1:0}})),$i("toColor",[Ni],(function(t,e){return{type:Ui,value:Mi(e.value)}})),$i("toUrl",[Ni],(function(t,e){return{type:Li,value:e.value}})),$i("encodeUri",[Ni],(function(t,e){try{return{type:Ni,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),$i("decodeUri",[Ni],(function(t,e){try{return{type:Ni,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),$i("getIntegerValue",[Ni,Bi],Xi),$i("getNumberValue",[Ni,Ri],Xi),$i("getBooleanValue",[Ni,Ji],Xi),$i("getStringValue",[Ni,Ni],Xi),$i("getColorValue",[Ni,Ui],Qi),$i("getColorValue",[Ni,Ni],Qi),$i("getUrlValue",[Ni,Li],Ki),$i("getUrlValue",[Ni,Ni],Ki),$i("parseUnixTime",[Bi],(function(t,e){return{type:Wi,value:new Date(1e3*Number(e.value))}})),$i("nowLocal",[],(function(){return{type:Wi,value:new Date}})),$i("addMillis",[Wi,Bi],(function(t,e,r){return{type:Wi,value:new Date(e.value.getTime()+Number(r.value))}})),$i("setYear",[Wi,Bi],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:Wi,value:i}})),$i("setMonth",[Wi,Bi],(function(t,e,r){const i=Number(r.value);if(i<1||i>12)throw new Error(`Expecting month in [1..12], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMonth(i-1),{type:Wi,value:n}})),$i("setDay",[Wi,Bi],(function(t,e,r){const i=new Date(e.value),n=Number(r.value);if(n<=0&&-1!==n||n>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(i))throw new Error(`Unable to set day ${n} for date ${Ai(e)}.`);return i.setUTCDate(-1===n?0:n),{type:Wi,value:i}})),$i("setHours",[Wi,Bi],(function(t,e,r){const i=Number(r.value);if(i<0||i>23)throw new Error(`Expecting hours in [0..23], instead got ${i}.`);const n=new Date(e.value);return n.setUTCHours(i),{type:Wi,value:n}})),$i("setMinutes",[Wi,Bi],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting minutes in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMinutes(i),{type:Wi,value:n}})),$i("setSeconds",[Wi,Bi],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting seconds in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCSeconds(i),{type:Wi,value:n}})),$i("setMillis",[Wi,Bi],(function(t,e,r){const i=Number(r.value);if(i<0||i>999)throw new Error(`Expecting millis in [0..999], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMilliseconds(i),{type:Wi,value:n}})),$i("getYear",[Wi],en),$i("getMonth",[Wi],rn),$i("getDay",[Wi],nn),$i("getDayOfWeek",[Wi],on),$i("getHours",[Wi],an),$i("getMinutes",[Wi],sn),$i("getSeconds",[Wi],ln),$i("getMillis",[Wi],cn),$i("getIntervalSeconds",[Bi],(function(t,e){return xn(t,e,1e3,60)})),$i("getIntervalTotalSeconds",[Bi],(function(t,e){return xn(t,e,1e3)})),$i("getIntervalMinutes",[Bi],(function(t,e){return xn(t,e,6e4,60)})),$i("getIntervalTotalMinutes",[Bi],(function(t,e){return xn(t,e,6e4)})),$i("getIntervalHours",[Bi],(function(t,e){return xn(t,e,kn,24)})),$i("getIntervalTotalHours",[Bi],(function(t,e){return xn(t,e,kn)})),$i("getIntervalTotalDays",[Bi],(function(t,e){return xn(t,e,864e5)})),$i("getIntervalTotalWeeks",[Bi],(function(t,e){return xn(t,e,6048e5)})),$i("len",[Ni],(function(t,e){return{type:Bi,value:Vr(e.value.length)}})),$i("contains",[Ni,Ni],(function(t,e,r){return{type:Ji,value:e.value.includes(r.value)?1:0}})),$i("substring",[Ni,Bi,Bi],(function(t,e,r,i){if(i.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||i.value<0||i.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Ni,value:e.value.substring(Number(r.value),Number(i.value))}})),$i("replaceAll",[Ni,Ni,Ni],(function(t,e,r,i){let n;return n=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),i.value):e.value,{type:Ni,value:n}})),$i("index",[Ni,Ni],(function(t,e,r){return{type:Bi,value:Vr(e.value.indexOf(r.value))}})),$i("lastIndex",[Ni,Ni],(function(t,e,r){return{type:Bi,value:Vr(e.value.lastIndexOf(r.value))}})),$i("trim",[Ni],(function(t,e){return{type:Ni,value:e.value.trim()}})),$i("trimLeft",[Ni],(function(t,e){return{type:Ni,value:e.value.replace(/^\s+/,"")}})),$i("trimRight",[Ni],(function(t,e){return{type:Ni,value:e.value.replace(/\s+$/,"")}})),$i("toUpperCase",[Ni],(function(t,e){return{type:Ni,value:e.value.toUpperCase()}})),$i("toLowerCase",[Ni],(function(t,e){return{type:Ni,value:e.value.toLowerCase()}})),$i("padStart",[Ni,Bi,Ni],dn),$i("padStart",[Bi,Bi,Ni],dn),$i("padEnd",[Ni,Bi,Ni],pn),$i("padEnd",[Bi,Bi,Ni],pn),$i("testRegex",[Ni,Ni],(function(t,e,r){let i;try{i=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Ji,value:i.test(e.value)?1:0}})),$i("div",[Bi,Bi],(function(t,e,r){if(r.value===Dr)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return i=Di(0,i),ji(t,i),{type:Bi,value:i}})),$i("div",[Ri,Ri],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value/r.value;return{type:Ri,value:i}})),$i("mod",[Bi,Bi],(function(t,e,r){if(r.value===Dr)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return i=Di(0,i),ji(t,i),{type:Bi,value:i}})),$i("mod",[Ri,Ri],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value%r.value;return{type:Ri,value:i}})),$i("mul",[{type:Bi,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Dr;for(let i=1;i<e.length;++i)r*=e[i].value,r=Di(0,r),ji(t,r);return{type:Bi,value:r}})),$i("mul",[{type:Ri,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:Ri,value:r}})),$i("sub",[{type:Bi,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Dr;for(let i=1;i<e.length;++i)r-=e[i].value,r=Di(0,r),ji(t,r);return{type:Bi,value:r}})),$i("sub",[{type:Ri,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:Ri,value:r}})),$i("sum",[{type:Bi,isVararg:!0}],(function(t,...e){let r=Dr;for(let i=0;i<e.length;++i)r+=e[i].value,r=Di(0,r),ji(t,r);return{type:Bi,value:r}})),$i("sum",[{type:Ri,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Ri,value:r}})),$i("abs",[Bi],(function(t,e){const r=jr(e.value);return ji(t,r),{type:e.type,value:r}})),$i("abs",[Ri],(function(t,e){const r=Math.abs(e.value);return{type:Ri,value:r}})),$i("max",[{type:Bi,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:Bi,value:r}})),$i("max",[{type:Ri,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Ri,value:Math.max(...e.map((t=>t.value)))}})),$i("min",[{type:Bi,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:Bi,value:r}})),$i("min",[{type:Ri,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Ri,value:Math.min(...e.map((t=>t.value)))}})),$i("maxNumber",[],(function(){return{type:Ri,value:Ti}})),$i("minNumber",[],(function(){return{type:Ri,value:zi}})),$i("maxInteger",[],(function(t){return ji(t,Ar),{type:Bi,value:Ar}})),$i("minInteger",[],(function(t){return ji(t,Fr),{type:Bi,value:Fr}})),$i("round",[Ri],(function(t,e){const r=Math.sign(e.value);return{type:Ri,value:r*Math.round(Math.abs(e.value))}})),$i("floor",[Ri],(function(t,e){return{type:Ri,value:Math.floor(e.value)}})),$i("ceil",[Ri],(function(t,e){return{type:Ri,value:Math.ceil(e.value)}})),$i("signum",[Bi],(function(t,e){return{type:Bi,value:Sr(e.value)}})),$i("signum",[Ri],(function(t,e){return{type:Ri,value:Math.sign(e.value)}})),$i("copySign",[Bi,Bi],(function(t,e,r){let i;if(r.value===Dr)i=e.value;else if(e.value===Dr)i=Vr(0);else{const t=Sr(r.value);i=jr(e.value)*t}return ji(t,i),{type:Bi,value:i}})),$i("copySign",[Ri,Ri],(function(t,e,r){let i=Math.sign(r.value);0===i&&(i=Object.is(i,0)?1:-1);const n=Math.abs(e.value)*i;return{type:Ri,value:n}})),$i("getColorAlpha",[Ni],fn),$i("getColorAlpha",[Ui],fn),$i("getColorRed",[Ni],hn),$i("getColorRed",[Ui],hn),$i("getColorGreen",[Ni],mn),$i("getColorGreen",[Ui],mn),$i("getColorBlue",[Ni],yn),$i("getColorBlue",[Ui],yn),$i("setColorAlpha",[Ni,Ri],bn),$i("setColorAlpha",[Ui,Ri],bn),$i("setColorRed",[Ni,Ri],_n),$i("setColorRed",[Ui,Ri],_n),$i("setColorGreen",[Ni,Ri],wn),$i("setColorGreen",[Ui,Ri],wn),$i("setColorBlue",[Ni,Ri],$n),$i("setColorBlue",[Ui,Ri],$n),$i("rgb",[Ri,Ri,Ri],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Ui,value:Ii(n)}})),$i("argb",[Ri,Ri,Ri,Ri],(function(t,e,r,i,n){const o={a:255*e.value,r:255*r.value,g:255*i.value,b:255*n.value};return{type:Ui,value:Ii(o)}})),$i("getDictString",[Hi,{type:Ni,isVararg:!0}],An),$i("getStringFromDict",[Hi,{type:Ni,isVararg:!0}],An),$i("getDictNumber",[Hi,{type:Ni,isVararg:!0}],Fn),$i("getNumberFromDict",[Hi,{type:Ni,isVararg:!0}],Fn),$i("getDictInteger",[Hi,{type:Ni,isVararg:!0}],Vn),$i("getIntegerFromDict",[Hi,{type:Ni,isVararg:!0}],Vn),$i("getDictBoolean",[Hi,{type:Ni,isVararg:!0}],Dn),$i("getBooleanFromDict",[Hi,{type:Ni,isVararg:!0}],Dn),$i("getDictColor",[Hi,{type:Ni,isVararg:!0}],jn),$i("getColorFromDict",[Hi,{type:Ni,isVararg:!0}],jn),$i("getDictUrl",[Hi,{type:Ni,isVararg:!0}],Sn),$i("getUrlFromDict",[Hi,{type:Ni,isVararg:!0}],Sn),$i("getDictOptString",[Ni,Hi,{type:Ni,isVararg:!0}],Pn),$i("getOptStringFromDict",[Ni,Hi,{type:Ni,isVararg:!0}],Pn),$i("getDictOptNumber",[Ri,Hi,{type:Ni,isVararg:!0}],On),$i("getOptNumberFromDict",[Ri,Hi,{type:Ni,isVararg:!0}],On),$i("getDictOptInteger",[Bi,Hi,{type:Ni,isVararg:!0}],In),$i("getOptIntegerFromDict",[Bi,Hi,{type:Ni,isVararg:!0}],In),$i("getDictOptBoolean",[Ji,Hi,{type:Ni,isVararg:!0}],Mn),$i("getOptBooleanFromDict",[Ji,Hi,{type:Ni,isVararg:!0}],Mn),$i("getDictOptColor",[Ui,Hi,{type:Ni,isVararg:!0}],Tn),$i("getOptColorFromDict",[Ui,Hi,{type:Ni,isVararg:!0}],Tn),$i("getDictOptColor",[Ni,Hi,{type:Ni,isVararg:!0}],Tn),$i("getOptColorFromDict",[Ni,Hi,{type:Ni,isVararg:!0}],Tn),$i("getDictOptUrl",[Ni,Hi,{type:Ni,isVararg:!0}],zn),$i("getOptUrlFromDict",[Ni,Hi,{type:Ni,isVararg:!0}],zn),$i("getDictOptUrl",[Li,Hi,{type:Ni,isVararg:!0}],zn),$i("getOptUrlFromDict",[Li,Hi,{type:Ni,isVararg:!0}],zn),$i("getArrayString",[qi,Bi],Rn),$i("getStringFromArray",[qi,Bi],Rn),$i("getArrayNumber",[qi,Bi],Jn),$i("getNumberFromArray",[qi,Bi],Jn),$i("getArrayInteger",[qi,Bi],Un),$i("getIntegerFromArray",[qi,Bi],Un),$i("getArrayBoolean",[qi,Bi],Ln),$i("getBooleanFromArray",[qi,Bi],Ln),$i("getArrayColor",[qi,Bi],Wn),$i("getColorFromArray",[qi,Bi],Wn),$i("getArrayUrl",[qi,Bi],Hn),$i("getUrlFromArray",[qi,Bi],Hn),$i("getArrayFromArray",[qi,Bi],qn),$i("getDictFromArray",[qi,Bi],Gn),$i("getArrayOptString",[qi,Bi,Ni],Zn),$i("getOptStringFromArray",[qi,Bi,Ni],Zn),$i("getArrayOptNumber",[qi,Bi,Ri],Yn),$i("getOptNumberFromArray",[qi,Bi,Ri],Yn),$i("getArrayOptInteger",[qi,Bi,Bi],Xn),$i("getOptIntegerFromArray",[qi,Bi,Bi],Xn),$i("getArrayOptBoolean",[qi,Bi,Ji],Qn),$i("getOptBooleanFromArray",[qi,Bi,Ji],Qn),$i("getArrayOptColor",[qi,Bi,Ui],Kn),$i("getOptColorFromArray",[qi,Bi,Ui],Kn),$i("getArrayOptColor",[qi,Bi,Ni],Kn),$i("getOptColorFromArray",[qi,Bi,Ni],Kn),$i("getArrayOptUrl",[qi,Bi,Li],to),$i("getOptUrlFromArray",[qi,Bi,Li],to),$i("getArrayOptUrl",[qi,Bi,Ni],to),$i("getOptUrlFromArray",[qi,Bi,Ni],to),$i("getOptArrayFromArray",[qi,Bi],(function(t,e,r){try{return qn(t,e,r)}catch(t){return{type:qi,value:[]}}})),$i("getOptDictFromArray",[qi,Bi],(function(t,e,r){try{return Gn(t,e,r)}catch(t){return{type:Hi,value:{}}}})),$i("len",[qi],(function(t,e){return{type:Bi,value:Vr(e.value.length)}}));const ro={StringLiteral:function(t,e){return{type:Ni,value:e.value}},NumberLiteral:function(t,e){return{type:Ri,value:e.value}},IntegerLiteral:function(t,e){return ji(t,e.value),{type:Bi,value:e.value}},BooleanLiteral:function(t,e){return{type:Ji,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Ei(io(t,e.argument));switch(e.operator){case"!":if(r.type===Ji)return{type:Ji,value:r.value?0:1};Pi(`${e.operator}${Fi(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===Bi){const e=r.value*Vr(i);return ji(t,e),{type:Bi,value:e}}if(r.type===Ri)return{type:Ri,value:r.value*i};Pi(`${e.operator}${Fi(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Ei(io(t,e.test));if(r.type===Ji)return r.value?io(t,e.consequent):io(t,e.alternate);Pi(`${Fi(r)} ? ${Fi(io(t,e.consequent))} : ${Fi(io(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return io(t,e.test)}catch(r){return io(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return io(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=Ai(io(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:Ni,value:r}},LogicalExpression:function(t,e){const r=Ei(io(t,e.left));if(r.type!==Ji&&Pi(`${Fi(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ji,value:0};const i=Ei(io(t,e.right));return i.type!==Ji&&Pi(`${Fi(r)} ${e.operator} ${Fi(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Vi(i.type)}.`),{type:Ji,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=io(t,e.left),n=io(t,e.right);if(i.type!==n.type&&Pi(`${Fi(i)} ${e.operator} ${Fi(n)}`,`Operator '${r}' cannot be applied to different types: ${Vi(i.type)} and ${Vi(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===Wi&&r.type===Wi?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Ji,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ri&&e.type!==Bi&&e.type!==Wi&&Pi(`${Fi(e)} ${t} ${Fi(r)}`,`Operator '${t}' cannot be applied to ${Vi(e.type)} type.`);const n=e.type===Wi?e.value.getTime():e.value,o=r.type===Wi?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Ji,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==Ni&&r.type!==Ri&&r.type!==Bi&&Pi(`${Fi(r)} ${e} ${Fi(i)}`,`Operator '${e}' cannot be applied to ${Vi(r.type)} type.`),r.type===Ni)return"-"===e&&Pi(`${Fi(r)} - ${Fi(i)}`,`Operator '${e}' cannot be applied to ${Vi(r.type)} type.`),{type:Ni,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===Bi)try{n=Di(0,n),ji(t,n)}catch(t){Pi(`${Fi(r)} ${e} ${Fi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r,i){let n;if(r.type!==Bi&&r.type!==Ri&&Pi(`${Fi(r)} ${e} ${Fi(i)}`,`Operator '${e}' cannot be applied to ${Vi(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&Pi(`${Fi(r)} ${e} ${Fi(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===Bi)try{n=Di(0,n),ji(t,n)}catch(t){Pi(`${Fi(r)} ${e} ${Fi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let i;const n=e.arguments.map((e=>io(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(wi.has(o))i=wi.get(o);else{const t=function(t,e){const r=_i.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=xi(r[t],e);if("match"===n.type)return r[t];i||(i=n)}if(!i)throw new Error("Missing function");return i}(r,n);if("expected"in t||"type"in t&&"missing"===t.type){const e=n.map((t=>Vi(t.type))).join(", "),i=`${r}(${eo(n)})`;"few"===t.type&&0===n.length?Pi(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Pi(i,`Function '${r}' has no matching override for given argument types: ${e}.`):Pi(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){Pi(`${r}(${eo(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.variables.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function io(t,e){if(e.type in ro)return ro[e.type](t,e);throw new Error("Unsupported expression")}class no{constructor(t){this.ast=t}apply(t,e){try{const r=function(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1},i=io(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:i,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,this.ast);r.warnings.forEach(e);const i=r.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const n=i.value;if(n instanceof Date)return Ci(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=ft(String(n));if(t)return Ii(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return n>2147483647||n<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(n);if("array"===i.type||"dict"===i.type)try{return JSON.stringify(n)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return n}catch(t){return void e(st(new Error("Expression execution error")))}}}function oo(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=function(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:De,JsonStringContents:function(){var t,e,r;for(t=me,e=[],r=je();r!==i;)e.push(r),r=je();return ye=t,Pt(e)}},a=De,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",A="!",F="(",V=")",D=",",j="'",S=".",P="e",O="E",I="true",M="false",T=/^[^}]/,z=/^[^'}]/,N=/^[0-9]/,B=/^[a-zA-Z_0-9.]/,R=/^[a-zA-Z_]/,J=/^[ \t\r\n]/,U=ke("@{",!1),L=ke("}",!1),W=ke("@{}",!1),H=ke("\\",!1),q={type:"any"},G=Ee(["}"],!0,!1),Z=ke("?",!1),Y=ke(":",!1),X=ke("!:",!1),Q=ke("||",!1),K=ke("&&",!1),tt=ke("==",!1),et=ke("!=",!1),rt=ke(">=",!1),it=ke(">",!1),nt=ke("<=",!1),ot=ke("<",!1),at=ke("+",!1),st=ke("-",!1),lt=ke("/",!1),ct=ke("*",!1),ut=ke("%",!1),dt=ke("!",!1),pt=ke("(",!1),vt=ke(")",!1),gt=ke(",",!1),ft=Ce("string"),ht=ke("'",!1),mt=Ee(["'","}"],!0,!1),yt=Ce("integer"),bt=Ee([["0","9"]],!1,!1),_t=Ce("number"),wt=ke(".",!1),$t=ke("e",!1),xt=ke("E",!1),kt=Ce("boolean"),Et=ke("true",!1),Ct=ke("false",!1),At=Ee([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ft=Ce("identifier"),Vt=Ee([["a","z"],["A","Z"],"_"],!1,!1),Dt=Ce("whitespace"),jt=Ee([" ","\t","\r","\n"],!1,!1),St=function(t){return t},Pt=function(t){return fi(t)},Ot=function(t){return t},It=function(){return""},Mt=function(){return xe()},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(){throw new Error("Error tokenizing '"+t+"'.")},Nt=function(t){return t},Bt=function(t){return mi(t)},Rt=function(){throw new Error("Error tokenizing '"+t+"'.")},Jt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Ut=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Lt=function(t,e){return gi(t,e)},Wt=function(t,e){return gi(t,e)},Ht=function(t,e){return vi(t,e)},qt=function(t,e){return vi(t,e)},Gt=function(t,e){return vi(t,e)},Zt=function(t,e){return vi(t,e)},Yt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Xt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Qt=function(t){return{type:"Variable",id:t}},Kt=function(t,e){return[t,...e]},te=function(t){return t},ee=function(t){return t},re=function(t){return fi(t)},ie=function(t){return t},ne=function(){return""},oe=function(){return xe()},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(t){return t},ce=function(t){return mi(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:hi(xe())}},pe=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ve=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ge=function(){return{type:"BooleanLiteral",value:!0}},fe=function(){return{type:"BooleanLiteral",value:!1}},he=function(){return{type:"Identifier",name:xe()}},me=0,ye=0,be=[{line:1,column:1}],_e=0,we=[],$e=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function xe(){return t.substring(ye,me)}function ke(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ee(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ce(t){return{type:"other",description:t}}function Ae(e){var r,i=be[e];if(i)return i;for(r=e-1;!be[r];)r--;for(i={line:(i=be[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return be[e]=i,i}function Fe(t,e,r){var i=Ae(t),o=Ae(e),a={source:n,start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:o.line,column:o.column}};return r&&n&&"function"==typeof n.offset&&(a.start=n.offset(a.start),a.end=n.offset(a.end)),a}function Ve(t){me<_e||(me>_e&&(_e=me,we=[]),we.push(t))}function De(){var t,e;return t=me,We(),(e=Se())!==i?(We(),ye=t,t=St(e)):(me=t,t=i),t}function je(){var e,r,n,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=i,0===$e&&Ve(U)),r!==i?(n=We(),(o=Se())!==i?(We(),125===t.charCodeAt(me)?(a=l,me++):(a=i,0===$e&&Ve(L)),a!==i?(ye=e,e=Ot(o)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i),e===i&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=i,0===$e&&Ve(W)),r!==i&&(ye=e,r=It()),(e=r)===i&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(n=u,me++):(n=i,0===$e&&Ve(H)),n===i&&(t.substr(me,2)===s?(n=s,me+=2):(n=i,0===$e&&Ve(U))),$e--,n===i?r=void 0:(me=r,r=i),r!==i?(t.length>me?(n=t.charAt(me),me++):(n=i,0===$e&&Ve(q)),n!==i?(ye=e,e=Mt()):(me=e,e=i)):(me=e,e=i),e===i))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=i,0===$e&&Ve(U)),r!==i){if(n=[],T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(G)),o!==i)for(;o!==i;)n.push(o),T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(G));else n=i;n!==i?(125===t.charCodeAt(me)?(o=l,me++):(o=i,0===$e&&Ve(L)),o!==i?(ye=e,e=Tt()):(me=e,e=i)):(me=e,e=i)}else me=e,e=i;e===i&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=i,0===$e&&Ve(U)),r!==i&&(ye=e,r=zt()),(e=r)===i&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=i,0===$e&&Ve(H)),r!==i?(t.substr(me,2)===s?(n=s,me+=2):(n=i,0===$e&&Ve(U)),n!==i?(ye=e,e=Nt(n)):(me=e,e=i)):(me=e,e=i),e===i&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=i,0===$e&&Ve(H)),r!==i?(t.length>me?(n=t.charAt(me),me++):(n=i,0===$e&&Ve(q)),n!==i?(ye=e,e=Bt(n)):(me=e,e=i)):(me=e,e=i),e===i&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=i,0===$e&&Ve(H)),r!==i&&(ye=e,r=Rt()),e=r))))}return e}function Se(){var e,r,n,o,a,s;return e=me,(r=Pe())!==i?(We(),63===t.charCodeAt(me)?(n=d,me++):(n=i,0===$e&&Ve(Z)),n!==i?(We(),(o=Se())!==i?(We(),58===t.charCodeAt(me)?(a=p,me++):(a=i,0===$e&&Ve(Y)),a!==i?(We(),(s=Se())!==i?(ye=e,e=Jt(r,o,s)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i),e===i&&(e=Pe()),e}function Pe(){var e,r,n,o;return e=me,(r=Oe())!==i?(We(),t.substr(me,2)===v?(n=v,me+=2):(n=i,0===$e&&Ve(X)),n!==i?(We(),(o=Se())!==i?(ye=e,e=Ut(r,o)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i),e===i&&(e=Oe()),e}function Oe(){var e,r,n,o,a,s,l,c;if(e=me,(r=Ie())!==i){for(n=[],o=me,a=We(),t.substr(me,2)===g?(s=g,me+=2):(s=i,0===$e&&Ve(Q)),s!==i?(l=We(),(c=Ie())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);o!==i;)n.push(o),o=me,a=We(),t.substr(me,2)===g?(s=g,me+=2):(s=i,0===$e&&Ve(Q)),s!==i?(l=We(),(c=Ie())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);ye=e,e=Lt(r,n)}else me=e,e=i;return e}function Ie(){var e,r,n,o,a,s,l,c;if(e=me,(r=Me())!==i){for(n=[],o=me,a=We(),t.substr(me,2)===f?(s=f,me+=2):(s=i,0===$e&&Ve(K)),s!==i?(l=We(),(c=Me())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);o!==i;)n.push(o),o=me,a=We(),t.substr(me,2)===f?(s=f,me+=2):(s=i,0===$e&&Ve(K)),s!==i?(l=We(),(c=Me())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);ye=e,e=Wt(r,n)}else me=e,e=i;return e}function Me(){var e,r,n,o,a,s,l,c;if(e=me,(r=Te())!==i){for(n=[],o=me,a=We(),t.substr(me,2)===h?(s=h,me+=2):(s=i,0===$e&&Ve(tt)),s===i&&(t.substr(me,2)===m?(s=m,me+=2):(s=i,0===$e&&Ve(et))),s!==i?(l=We(),(c=Te())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);o!==i;)n.push(o),o=me,a=We(),t.substr(me,2)===h?(s=h,me+=2):(s=i,0===$e&&Ve(tt)),s===i&&(t.substr(me,2)===m?(s=m,me+=2):(s=i,0===$e&&Ve(et))),s!==i?(l=We(),(c=Te())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);ye=e,e=Ht(r,n)}else me=e,e=i;return e}function Te(){var e,r,n,o,a,s,l,c;if(e=me,(r=ze())!==i){for(n=[],o=me,a=We(),t.substr(me,2)===y?(s=y,me+=2):(s=i,0===$e&&Ve(rt)),s===i&&(62===t.charCodeAt(me)?(s=b,me++):(s=i,0===$e&&Ve(it)),s===i&&(t.substr(me,2)===_?(s=_,me+=2):(s=i,0===$e&&Ve(nt)),s===i&&(60===t.charCodeAt(me)?(s=w,me++):(s=i,0===$e&&Ve(ot))))),s!==i?(l=We(),(c=ze())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);o!==i;)n.push(o),o=me,a=We(),t.substr(me,2)===y?(s=y,me+=2):(s=i,0===$e&&Ve(rt)),s===i&&(62===t.charCodeAt(me)?(s=b,me++):(s=i,0===$e&&Ve(it)),s===i&&(t.substr(me,2)===_?(s=_,me+=2):(s=i,0===$e&&Ve(nt)),s===i&&(60===t.charCodeAt(me)?(s=w,me++):(s=i,0===$e&&Ve(ot))))),s!==i?(l=We(),(c=ze())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);ye=e,e=qt(r,n)}else me=e,e=i;return e}function ze(){var e,r,n,o,a,s,l,c;if(e=me,(r=Ne())!==i){for(n=[],o=me,a=We(),43===t.charCodeAt(me)?(s=$,me++):(s=i,0===$e&&Ve(at)),s===i&&(45===t.charCodeAt(me)?(s=x,me++):(s=i,0===$e&&Ve(st))),s!==i?(l=We(),(c=Ne())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);o!==i;)n.push(o),o=me,a=We(),43===t.charCodeAt(me)?(s=$,me++):(s=i,0===$e&&Ve(at)),s===i&&(45===t.charCodeAt(me)?(s=x,me++):(s=i,0===$e&&Ve(st))),s!==i?(l=We(),(c=Ne())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);ye=e,e=Gt(r,n)}else me=e,e=i;return e}function Ne(){var e,r,n,o,a,s,l,c;if(e=me,(r=Be())!==i){for(n=[],o=me,a=We(),47===t.charCodeAt(me)?(s=k,me++):(s=i,0===$e&&Ve(lt)),s===i&&(42===t.charCodeAt(me)?(s=E,me++):(s=i,0===$e&&Ve(ct)),s===i&&(37===t.charCodeAt(me)?(s=C,me++):(s=i,0===$e&&Ve(ut)))),s!==i?(l=We(),(c=Be())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);o!==i;)n.push(o),o=me,a=We(),47===t.charCodeAt(me)?(s=k,me++):(s=i,0===$e&&Ve(lt)),s===i&&(42===t.charCodeAt(me)?(s=E,me++):(s=i,0===$e&&Ve(ct)),s===i&&(37===t.charCodeAt(me)?(s=C,me++):(s=i,0===$e&&Ve(ut)))),s!==i?(l=We(),(c=Be())!==i?o=a=[a,s,l,c]:(me=o,o=i)):(me=o,o=i);ye=e,e=Zt(r,n)}else me=e,e=i;return e}function Be(){var e,r,n;return(e=Ue())===i&&(e=Je())===i&&(e=me,33===t.charCodeAt(me)?(r=A,me++):(r=i,0===$e&&Ve(dt)),r===i&&(43===t.charCodeAt(me)?(r=$,me++):(r=i,0===$e&&Ve(at)),r===i&&(45===t.charCodeAt(me)?(r=x,me++):(r=i,0===$e&&Ve(st)))),r!==i?(We(),(n=Be())!==i?(ye=e,e=Yt(r,n)):(me=e,e=i)):(me=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=me,(r=Le())!==i?(We(),40===t.charCodeAt(me)?(n=F,me++):(n=i,0===$e&&Ve(pt)),n!==i?(We(),o=function(){var e,r,n,o,a,s;if(e=me,(r=Se())!==i){for(n=[],o=me,We(),44===t.charCodeAt(me)?(a=D,me++):(a=i,0===$e&&Ve(gt)),a!==i?(We(),(s=Se())!==i?o=s:(me=o,o=i)):(me=o,o=i);o!==i;)n.push(o),o=me,We(),44===t.charCodeAt(me)?(a=D,me++):(a=i,0===$e&&Ve(gt)),a!==i?(We(),(s=Se())!==i?o=s:(me=o,o=i)):(me=o,o=i);ye=e,e=Kt(r,n)}else me=e,e=i;return e===i&&(e=We()),e}(),o!==i?(We(),41===t.charCodeAt(me)?(a=V,me++):(a=i,0===$e&&Ve(vt)),a!==i?(ye=e,e=Xt(r,o)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i),e===i&&(e=me,(r=Le())!==i&&(ye=e,r=Qt(r)),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return $e++,e=me,39===t.charCodeAt(me)?(r=j,me++):(r=i,0===$e&&Ve(ht)),r!==i?(n=function(){var t,e,r;for(t=me,e=[],r=Re();r!==i;)e.push(r),r=Re();return ye=t,re(e)}(),39===t.charCodeAt(me)?(o=j,me++):(o=i,0===$e&&Ve(ht)),o!==i?(ye=e,e=ee(n)):(me=e,e=i)):(me=e,e=i),$e--,e===i&&(r=i,0===$e&&Ve(ft)),e}(),e===i&&(e=Ue())===i&&(e=Je())===i&&(e=function(){var e,r;return $e++,e=me,t.substr(me,4)===I?(r=I,me+=4):(r=i,0===$e&&Ve(Et)),r!==i&&(ye=e,r=ge()),(e=r)===i&&(e=me,t.substr(me,5)===M?(r=M,me+=5):(r=i,0===$e&&Ve(Ct)),r!==i&&(ye=e,r=fe()),e=r),$e--,e===i&&(r=i,0===$e&&Ve(kt)),e}(),e===i&&(e=me,40===t.charCodeAt(me)?(r=F,me++):(r=i,0===$e&&Ve(pt)),r!==i?(We(),(n=Se())!==i?(We(),41===t.charCodeAt(me)?(o=V,me++):(o=i,0===$e&&Ve(vt)),o!==i?(ye=e,e=te(n)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i))),e}())),e}())),e}function Re(){var e,r,n,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=i,0===$e&&Ve(U)),r!==i?(n=We(),(o=Se())!==i?(We(),125===t.charCodeAt(me)?(a=l,me++):(a=i,0===$e&&Ve(L)),a!==i?(ye=e,e=ie(o)):(me=e,e=i)):(me=e,e=i)):(me=e,e=i),e===i&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=i,0===$e&&Ve(W)),r!==i&&(ye=e,r=ne()),(e=r)===i&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(n=u,me++):(n=i,0===$e&&Ve(H)),n===i&&(39===t.charCodeAt(me)?(n=j,me++):(n=i,0===$e&&Ve(ht)),n===i&&(t.substr(me,2)===s?(n=s,me+=2):(n=i,0===$e&&Ve(U)))),$e--,n===i?r=void 0:(me=r,r=i),r!==i?(t.length>me?(n=t.charAt(me),me++):(n=i,0===$e&&Ve(q)),n!==i?(ye=e,e=oe()):(me=e,e=i)):(me=e,e=i),e===i))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=i,0===$e&&Ve(U)),r!==i){if(n=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(mt)),o!==i)for(;o!==i;)n.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(mt));else n=i;n!==i?(125===t.charCodeAt(me)?(o=l,me++):(o=i,0===$e&&Ve(L)),o!==i?(ye=e,e=ae()):(me=e,e=i)):(me=e,e=i)}else me=e,e=i;e===i&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=i,0===$e&&Ve(U)),r!==i&&(ye=e,r=se()),(e=r)===i&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=i,0===$e&&Ve(H)),r!==i?(t.substr(me,2)===s?(n=s,me+=2):(n=i,0===$e&&Ve(U)),n!==i?(ye=e,e=le(n)):(me=e,e=i)):(me=e,e=i),e===i&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=i,0===$e&&Ve(H)),r!==i?(t.length>me?(n=t.charAt(me),me++):(n=i,0===$e&&Ve(q)),n!==i?(ye=e,e=ce(n)):(me=e,e=i)):(me=e,e=i),e===i&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=i,0===$e&&Ve(H)),r!==i&&(ye=e,r=ue()),e=r))))}return e}function Je(){var e,r,n,o;if($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=i,0===$e&&Ve(st)),r===i&&(r=null),n=[],N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(bt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(bt));else n=i;return n!==i?(ye=e,e=de()):(me=e,e=i),$e--,e===i&&(r=i,0===$e&&Ve(yt)),e}function Ue(){var e,r,n,o,a,s,l,c,u,d;for($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=i,0===$e&&Ve(st)),r===i&&(r=null),n=[],N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(bt));o!==i;)n.push(o),N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(bt));if(46===t.charCodeAt(me)?(o=S,me++):(o=i,0===$e&&Ve(wt)),o!==i){if(a=[],N.test(t.charAt(me))?(s=t.charAt(me),me++):(s=i,0===$e&&Ve(bt)),s!==i)for(;s!==i;)a.push(s),N.test(t.charAt(me))?(s=t.charAt(me),me++):(s=i,0===$e&&Ve(bt));else a=i;if(a!==i){if(s=me,101===t.charCodeAt(me)?(l=P,me++):(l=i,0===$e&&Ve($t)),l===i&&(69===t.charCodeAt(me)?(l=O,me++):(l=i,0===$e&&Ve(xt))),l!==i){if(43===t.charCodeAt(me)?(c=$,me++):(c=i,0===$e&&Ve(at)),c===i&&(45===t.charCodeAt(me)?(c=x,me++):(c=i,0===$e&&Ve(st))),c===i&&(c=null),u=[],N.test(t.charAt(me))?(d=t.charAt(me),me++):(d=i,0===$e&&Ve(bt)),d!==i)for(;d!==i;)u.push(d),N.test(t.charAt(me))?(d=t.charAt(me),me++):(d=i,0===$e&&Ve(bt));else u=i;u!==i?s=l=[l,c,u]:(me=s,s=i)}else me=s,s=i;s===i&&(s=null),ye=e,e=pe()}else me=e,e=i}else me=e,e=i;if(e===i){if(e=me,45===t.charCodeAt(me)?(r=x,me++):(r=i,0===$e&&Ve(st)),r===i&&(r=null),n=[],N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(bt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(bt));else n=i;if(n!==i)if(101===t.charCodeAt(me)?(o=P,me++):(o=i,0===$e&&Ve($t)),o===i&&(69===t.charCodeAt(me)?(o=O,me++):(o=i,0===$e&&Ve(xt))),o!==i){if(43===t.charCodeAt(me)?(a=$,me++):(a=i,0===$e&&Ve(at)),a===i&&(45===t.charCodeAt(me)?(a=x,me++):(a=i,0===$e&&Ve(st))),a===i&&(a=null),s=[],N.test(t.charAt(me))?(l=t.charAt(me),me++):(l=i,0===$e&&Ve(bt)),l!==i)for(;l!==i;)s.push(l),N.test(t.charAt(me))?(l=t.charAt(me),me++):(l=i,0===$e&&Ve(bt));else s=i;s!==i?(ye=e,e=ve()):(me=e,e=i)}else me=e,e=i;else me=e,e=i}return $e--,e===i&&(r=i,0===$e&&Ve(_t)),e}function Le(){var e,r,n,o,a;if($e++,e=me,r=me,$e++,n=function(){var e,r,n,o;return e=me,t.substr(me,4)===I?(r=I,me+=4):(r=i,0===$e&&Ve(Et)),r===i&&(t.substr(me,5)===M?(r=M,me+=5):(r=i,0===$e&&Ve(Ct))),r!==i?(n=me,$e++,B.test(t.charAt(me))?(o=t.charAt(me),me++):(o=i,0===$e&&Ve(At)),$e--,o===i?n=void 0:(me=n,n=i),n!==i?e=r=[r,n]:(me=e,e=i)):(me=e,e=i),e}(),$e--,n===i?r=void 0:(me=r,r=i),r!==i)if(R.test(t.charAt(me))?(n=t.charAt(me),me++):(n=i,0===$e&&Ve(Vt)),n!==i){for(o=[],B.test(t.charAt(me))?(a=t.charAt(me),me++):(a=i,0===$e&&Ve(At));a!==i;)o.push(a),B.test(t.charAt(me))?(a=t.charAt(me),me++):(a=i,0===$e&&Ve(At));ye=e,e=he()}else me=e,e=i;else me=e,e=i;return $e--,e===i&&(r=i,0===$e&&Ve(Ft)),e}function We(){var e,r;for($e++,e=[],J.test(t.charAt(me))?(r=t.charAt(me),me++):(r=i,0===$e&&Ve(jt));r!==i;)e.push(r),J.test(t.charAt(me))?(r=t.charAt(me),me++):(r=i,0===$e&&Ve(jt));return $e--,r=i,0===$e&&Ve(Dt),e}if((r=a())!==i&&me===t.length)return r;throw r!==i&&me<t.length&&Ve({type:"end"}),function(t,e,r){return new yi(yi.buildMessage(t,e),t,e,r)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Fe(_e,_e+1):Fe(_e,_e))}(t,{startRule:"JsonStringContents"}),i=Si(r);return e.vars.push(...i),new no(r)}catch(e){return void r(st(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>oo(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=oo(t[n],e,r);return i}}var i;return t}function ao(t,e,r){if(t){if(t instanceof no)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>ao(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=ao(t[n],e,r);return i}}return t}function so(t,e){const r={vars:[],hasExpression:!1},i=oo(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>ao(i,t,e)}}const lo={pagers:function(){return Q(new Map)}},co=new Map,uo=new Map;function po(t){const e=co.get(t)||Q("");return co.has(t)||co.set(t,e),e}function vo(t){const e=uo.get(t)||new Map;return uo.has(t)||uo.set(t,e),e}class go{setVariable(t){const e=t.getName(),r=vo(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),po(this).set(e)}getVariable(t){return vo(this).get(t)}list(){return vo(this).values()}}function fo(){return new go}function ho(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const mo=new Set(["start","stop","pause","resume","cancel","reset"]);class yo{constructor(t){ho(this,"timers",new Map),ho(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(st(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(st(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&mo.has(e)))return void this.logError(st(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const i=this.timers.get(t);this[r](i)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const i=t.tickStarted=performance.now(),n=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-i-n)%r,e()}),n)};e()}}start(t){if("running"===t.state)return void this.logError(st(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(st(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(st(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(st(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(st(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(st(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(st(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(st(new Error("The timer is already running"))):this.logError(st(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}function bo(t,e,r,i){const{variable_name:n}=r;if(!n)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:n}}));const o=t.get(n);if(!o)return void e(st(new Error("Cannot find variable"),{additional:{name:n}}));const a=o.getType();"array"===a?i(o):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:n,type:a}}))}let _o=Q(!0),wo=0;function $o(){_o.set(!1)}function xo(){_o.set(!0)}const ko=U(((t,e,r,i)=>{let n,o,a,s;var c,u,d,p;let{id:f}=e,{json:h={}}=e,{platform:m="auto"}=e,{theme:y="system"}=e,{globalVariablesController:b=new go}=e,{mix:_=""}=e,{customization:w={}}=e,{builtinProtocols:x=["http","https","tel","mailto","intent"]}=e,{extensions:k=new Map}=e,{onError:E}=e,{onStat:C}=e,{onCustomAction:A}=e,{onComponent:F}=e,{typefaceProvider:V=(t=>"")}=e,{fetchInit:D={}}=e,{tooltipRoot:j}=e,{customComponents:S}=e,P=Q("desktop"===m);if(s=l(P,(t=>a=t)),"auto"===m&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");P.set(!t.matches),t.addListener((()=>{P.set(!t.matches)}))}let O="light",M=null;function T(t){y=t}function z(){return new Map}function N(){return new Map}function R(t){h=t}const J=new Set(x);let U=!1,L=!1;f||(L=!0,nt(st(new Error('"id" prop is required'))));const W={stateChange:!1},H=po(b),q=vo(b),G=new Map,Z=new Map,Y=new Map;let X=null,tt=0,et=[];function rt(t){const e=so(t,nt);return e.hasExpression?e.applyVars(Z):t}function nt(t){E?E({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function ot(t,e){C&&C({type:t,action:e})}let lt=0;function ct(t){return`${f}-${lt++}`}let ut={},dt={};function pt(t){vt(rt(t))}function vt(t){const e=t.url?String(t.url):"",r=t.typed;if(Ut(t))if(e)try{const r=e.replace(/div-action:\/\//,""),i=/([^?]+)\?(.+)/.exec(r);if(!i)return;const o=new URLSearchParams(i[2]);switch(i[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=Et,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const i=r[t],n=r[t+1];let o=e.getChild(i);if(!o)return;o.setState(n),e=o}}(o.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=wt(t);r&&r.setCurrentItem(Number(e))}(o.get("id"),o.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=wt(t);r&&r.setPreviousItem(e)}(o.get("id"),o.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=wt(t);r&&r.setNextItem(e)}(o.get("id"),o.get("overflow"));break;case"set_variable":const i=o.get("name"),a=o.get("value");if(i&&null!==a){const t=Z.get(i);if(t){const e=t.getType();"dict"===e||"array"===e?nt(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:i}})):t.set(a)}else nt(st(new Error("Cannot find variable"),{additional:{name:i}}))}else nt(st(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const s=o.get("action"),l=o.get("id");X?X.execTimerAction(l,s):nt(st(new Error("Incorrect timer action"),{additional:{id:l,action:s}}));break;case"video":!function(t,e){if(t){const r=wt(t);r?"start"===e?r.start():"pause"===e?r.pause():nt(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):nt(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else nt(st(new Error("Missing id in video action"),{additional:{action:e}}))}(o.get("id"),o.get("action"));break;case"download":!function(t,e){if(t){let r;r="function"==typeof D?D(t):D,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,o,a;if(r){if(r.templates)for(const t in r.templates)n.hasOwnProperty(t)||(n[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>{const e=yt.get(t.id);if(!e)return!0;const r=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===r)}));if(i)return nt(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:i.id}})),void gt(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_fail_actions)}r.patch.changes.forEach((t=>{const e=yt.get(t.id);e&&e.replaceWith(t.id,t.items)})),gt(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_success_actions)}}else nt(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;nt(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),gt(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else nt(st(new Error("Missing url in download action"),{additional:{url:t}}))}(o.get("url"),t);break;case"show_tooltip":!function(t,e){var r;if(!t)return void nt(st(new Error("Missing id in show_tooltip action")));const i=_t.get(t);if(!i)return void nt(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&et.some((e=>e.desc.id===t)))return;const n={internalId:++tt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};et=[...et,n];const o=null!==(r=i.tooltip.duration)&&void 0!==r?r:5e3;o&&(n.timeoutId=window.setTimeout((()=>{n.timeoutId=0,et=et.filter((t=>t.internalId!==n.internalId))}),o))}(o.get("id"),o.get("multiple"));break;case"hide_tooltip":!function(t){t?et=et.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):nt(st(new Error("Missing id in hide_tooltip action")))}(o.get("id"));break;default:nt(st(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){nt(st(t,{additional:{url:e}}))}else if(r)switch(r.type){case"set_variable":{const{variable_name:t,value:e}=r;if(t&&e){const r=Z.get(t);r?r.getType()===e.type?r.setValue(e.value):nt(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):nt(st(new Error("Cannot find variable"),{additional:{name:t}}))}else nt(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:i,index:n,value:o}=r;!o||"number"!=typeof n&&void 0!==n?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:i}})):bo(t,e,r,(t=>{const a=t.getValue();if("number"==typeof n&&(n<0||n>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:i,index:n,length:a.length}}));else{const e=a.slice();"number"==typeof n?e.splice(n,0,o.value):e.push(o.value),t.setValue(e)}}))}(Z,nt,r);break;case"array_remove_value":!function(t,e,r){const{variable_name:i,index:n}=r;"number"==typeof n?bo(t,e,r,(t=>{const o=t.getValue();if("number"==typeof n&&(n<0||n>=o.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:i,index:n,length:o.length}}));else{const e=o.slice();e.splice(n,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:i}}))}(Z,nt,r);break;case"copy_to_clipboard":!function(t,e){!e.content||"text"!==e.content.type&&"url"!==e.content.type||"string"!=typeof e.content.value?t(st(new Error("Incorrect action"),{additional:{action:e}})):"undefined"!=typeof navigator&&"clipboard"in navigator&&navigator.clipboard&&"writeText"in navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e.content.value).catch((e=>{t(st(new Error("Failed to copy to the clipboard"),{additional:{originalError:String(e)}}))})):t(st(new Error("Clipboard is unavailable"),{additional:{action:e}}))}(nt,r);break;case"focus_element":{const t=r.element_id&&bt.get(r.element_id);t?t.focus():nt(st(new Error("Incorrect focus_element action"),{additional:{elementId:r.element_id}}));break}default:nt(st(new Error("Unknown type of action"),{additional:{type:r.type}}))}}async function gt(t,e){if(!t||!Array.isArray(t))return;const r=t.filter(Ut);for(let t=0;t<r.length;++t){let i=r[t];const n=i.url,o=i.typed;if(n){const t=xt(n);if(t)if(kt(t,J)){if(e)if("_blank"===i.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=n)}else location.href=n}else"div-action"===t?(vt(i),await $()):i.log_id&&(ft(i),await $())}else o&&vt(i)}r.forEach((t=>{t.log_id&&ot("click",t)}))}function ft(t){null==A||A(t)}const ht=new Map,yt=new Map,bt=new Map,_t=new Map;function wt(t){if(ht.has(t))return ht.get(t);nt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const $t=new Map;g(at,{logError:nt,logStat:ot,hasTemplate:function(t){return t in n},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in n;){if(({json:t,templateContext:e}=ui(t,e,n,nt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:ct,genClass:function(t){return`divkit-${ct()}`},execAction:vt,execAnyActions:gt,execCustomAction:ft,isRunning:function(t){return W[t]},setRunning:function(t,e){W[t]=e},registerInstance:function(t,e){ht.has(t)?nt(st(new Error("Duplicate instance id"),{additional:{id:t}})):ht.set(t,e)},unregisterInstance:function(t){ht.delete(t)},registerParentOf:function(t,e){yt.set(t,e)},unregisterParentOf:function(t){yt.delete(t)},registerTooltip:function(t,e){_t.has(e.id)&&nt(st(new Error("Duplicate tooltip id"),{additional:{id:e.id}})),_t.set(e.id,{onwerNode:t,tooltip:e})},unregisterTooltip:function(t){_t.delete(t.id),et.some((e=>e.desc.id===t.id))&&(et=et.filter((e=>e.desc.id!==t.id)))},onTooltipClose:function(t){et=et.filter((e=>e.internalId!==t))},tooltipRoot:j,registerFocusable:function(t,e){bt.set(t,e)},unregisterFocusable:function(t){bt.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(dt[r]=dt[r]||0,++dt[r],ut[r])return ut[r];const i=`${ct()}-svg-filter`;return ut=Object.assign(Object.assign({},ut),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;dt[r]&&0==--dt[r]&&(ut=Object.keys(ut).reduce(((t,e)=>(dt[e]&&(t[e]=ut[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return pi(t);const e=so(t,nt);return e.vars.length?K(e.vars.map((t=>Z.get(t)||function(t){const e=Y.get(t)||Q(void 0);return Y.has(t)||Y.set(t,e),e}(t))).filter(mt),(()=>e.applyVars(Z))):e.hasExpression?pi(e.applyVars(Z)):pi(t)},getJsonWithVars:rt,getStore:function(t){return $t.has(t)||function(t){$t.has(t)||$t.set(t,lo[t]())}(t),$t.get(t)},getVariable:function(t,e){const r=Z.get(t);if(r){const i=r.getType();if(i!==e)return void nt(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==w?void 0:w[t]},getBuiltinProtocols:function(){return J},getExtension:function(t,e){const r=k.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:Z,logError:nt}},typefaceProvider:V,isDesktop:P,isPointerFocus:_o,customComponents:S,componentDevtool:void 0}),g(Wt,{hasAction:()=>!1});const Et={setState(t){throw new Error("Not implemented")},getChild(t){if(Ct&&Ct.has(t))return Ct.get(t);nt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Ct=null;function At(t){if(t.type in Or){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&nt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Ir(t.name,t.type,t.value);G.set(t.name,e),Z.set(t.name,e)}catch(e){nt(st(e,{additional:{name:t.name}}))}}}g(Vt,{registerInstance(t,e){Ct||(Ct=new Map),Ct.has(t)?nt(st(new Error("Duplicate state with id"),{additional:{id:t}})):Ct.set(t,e)},unregisterInstance(t){null==Ct||Ct.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,i)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const Ft=null===(c=null==h?void 0:h.card)||void 0===c?void 0:c.variables;Array.isArray(Ft)&&Ft.forEach((t=>{if(t&&t.name){if(G.has(t.name))return void nt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));At(t)}}));const Dt=h.palette;Dt&&Dt[O].forEach((t=>{if(G.has(t.name))nt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Ir(t.name,"color",t.color);G.set(t.name,e),Z.set(t.name,e)}catch(e){nt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of q)Z.has(t)||Z.set(t,e);H.subscribe((t=>{if(t&&!Z.has(t)){const e=q.get(t);Z.set(t,e);const r=Y.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const jt=null===(d=null==h?void 0:h.card)||void 0===d?void 0:d.timers;if(jt&&"undefined"!=typeof document){const t=X=new yo({logError:nt,applyVars:rt,hasVariableWithType:function(t,e){const r=Z.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=Z.get(t);r?r.setValue(e):nt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:gt});jt.forEach((e=>t.createTimer(e)))}let St;v((()=>{wo--,wo||(window.removeEventListener("keydown",$o),window.removeEventListener("pointerdown",xo)),X&&X.destroy(),et.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&r.id&&void 0!==f&&r.id(f),void 0===e.json&&r.json&&void 0!==h&&r.json(h),void 0===e.platform&&r.platform&&void 0!==m&&r.platform(m),void 0===e.theme&&r.theme&&void 0!==y&&r.theme(y),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==b&&r.globalVariablesController(b),void 0===e.mix&&r.mix&&void 0!==_&&r.mix(_),void 0===e.customization&&r.customization&&void 0!==w&&r.customization(w),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==x&&r.builtinProtocols(x),void 0===e.extensions&&r.extensions&&void 0!==k&&r.extensions(k),void 0===e.onError&&r.onError&&void 0!==E&&r.onError(E),void 0===e.onStat&&r.onStat&&void 0!==C&&r.onStat(C),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==A&&r.onCustomAction(A),void 0===e.onComponent&&r.onComponent&&void 0!==F&&r.onComponent(F),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==V&&r.typefaceProvider(V),void 0===e.fetchInit&&r.fetchInit&&void 0!==D&&r.fetchInit(D),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==j&&r.tooltipRoot(j),void 0===e.customComponents&&r.customComponents&&void 0!==S&&r.customComponents(S),void 0===e.setTheme&&r.setTheme&&void 0!==T&&r.setTheme(T),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==z&&r.getDebugVariables(z),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==N&&r.getDebugAllVariables(N),void 0===e.setData&&r.setData&&void 0!==R&&r.setData(R),void 0===e.execAction&&r.execAction&&void 0!==pt&&r.execAction(pt),"light"===y||"dark"===y?O=y:"system"===y?"undefined"!=typeof matchMedia?(M||(M=matchMedia("(prefers-color-scheme: dark)"),M.addListener((function(){"system"===y&&M&&(O=M.matches?"dark":"light")}))),O=M.matches?"dark":"light"):O="light":nt(st(new Error("Unsupported theme"))),O&&Dt&&Dt[O].forEach((t=>{const e=Z.get(t.name);e&&e.setValue(t.color)}));{U=!1;const t=function(t){if(!t)return st(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return st(new Error("Missing card"));if(!e.states||!e.states.length)return st(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in si)return st(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return st(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return st(new Error("Missing state_id"),{additional:{index:t}})}return null}(h);t&&(U=!0,nt(t))}return n=h.templates||{},(null===(u=null==h?void 0:h.card)||void 0===u?void 0:u.variables)&&Array.isArray(h.card.variables)&&h.card.variables!==Ft&&h.card.variables.forEach((t=>{t&&t.name&&!G.has(t.name)&&At(t)})),o=null===(p=null==h?void 0:h.card)||void 0===p?void 0:p.states,!o||U||L||(St={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:o.map((t=>({state_id:t.state_id.toString(),div:t.div})))}),s(),U||L||!St?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${it}`:"",!0)+I(_?` ${_}`:"",!0)}">${B(ci,"RootSvgFilters").$$render(t,{svgFiltersMap:ut},{},{})} ${B(li,"Unknown").$$render(t,{div:St,templateContext:{},layoutParams:{tooltips:et}},{},{})}</div>`})),Eo=ko;function Co(t){return Eo.render(t).html}var Ao=exports;for(var Fo in e)Ao[Fo]=e[Fo];e.__esModule&&Object.defineProperty(Ao,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>Di,createVariable:()=>Hn,render:()=>Li}),new Set;const n="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function r(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class o{constructor(t){r(this,"_listeners","WeakMap"in n?new WeakMap:void 0),r(this,"_observer",void 0),r(this,"options",void 0),this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return null!==(t=this._observer)&&void 0!==t?t:this._observer=new ResizeObserver((t=>{for(const n of t){var e;o.entries.set(n.target,n),null===(e=this._listeners.get(n.target))||void 0===e||e(n)}}))}}function i(){}function a(t){return t()}function s(t){t.forEach(a)}function l(t,...e){if(null==t){for(const t of e)t(void 0);return i}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function c(t,e,n){return t.set(n),e}let u;function d(t){u=t}function p(){if(!u)throw new Error("Function called outside component initialization");return u}function v(t){p().$$.on_destroy.push(t)}function g(t,e){return p().$$.context.set(t,e),e}function f(t){return p().$$.context.get(t)}o.entries="WeakMap"in n?new WeakMap:void 0,new Map;const h=[],m=[];let y=[];const b=[],_=Promise.resolve();let w=!1;function $(){return w||(w=!0,_.then(C)),_}function x(t){y.push(t)}const k=new Set;let E=0;function C(){if(0!==E)return;const t=u;do{try{for(;E<h.length;){const t=h[E];E++,d(t),j(t.$$)}}catch(t){throw h.length=0,E=0,t}for(d(null),h.length=0,E=0;m.length;)m.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(h.length);for(;b.length;)b.pop()();w=!1,k.clear(),d(t)}function j(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const A=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),F=/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;function V(t){return F.test(t)||"!doctype"===t.toLowerCase()}const D=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function S(t,e){const n=Object.assign({},...t);if(e){const t=e.classes,r=e.styles;t&&(null==n.class?n.class=t:n.class+=" "+t),r&&(null==n.style?n.style=H(r):n.style=H(function(t,e){const n={};for(const e of t.split(";")){const t=e.indexOf(":"),r=e.slice(0,t).trim(),o=e.slice(t+1).trim();r&&(n[r]=o)}for(const t in e){const r=e[t];r?n[t]=r:delete n[t]}return n}(n.style,r)))}let r="";return Object.keys(n).forEach((t=>{if(D.test(t))return;const e=n[t];!0===e?r+=" "+t:A.has(t.toLowerCase())?e&&(r+=" "+t):null!=e&&(r+=` ${t}="${e}"`)})),r}const O=/[&"]/g,P=/[&<]/g;function I(t,e=!1){const n=String(t),r=e?O:P;r.lastIndex=0;let o="",i=0;for(;r.test(n);){const t=r.lastIndex-1,e=n[t];o+=n.substring(i,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),i=t+1}return o+n.substring(i)}function M(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function T(t){const e={};for(const n in t)e[n]=M(t[n]);return e}function z(t,e){var n;t=void 0!==(null==(n=t)?void 0:n.length)?n:Array.from(n);let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const N={$$render:()=>""};function R(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${e}>.`);return t}let B,U;function L(t){function e(e,n,r,o,i){const a=u;d({$$:{on_destroy:B,context:new Map(i||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,n,r,o);return d(a),s}return{render:(t={},{$$slots:n={},context:r=new Map}={})=>{B=[];const o={title:"",head:"",css:new Set},i=e(o,t,{},n,r);return s(B),{html:i,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function W(t,e,n){return null==e||n&&!e?"":` ${t}${n&&!0===e?"":`="${I(e,!0)}"`}`}function H(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${M(t[e])};`)).join(" ")}function q(t){const e=H(t);return e?` style="${e}"`:""}function J(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?J(Object(n),!0).forEach((function(e){Z(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Z(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y(t,e,n,r){var o;const i=null===(o=n[t])||void 0===o?void 0:o.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!r||!n[t])return e;if("toAttribute"===r)switch(i){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(U=class extends HTMLElement{constructor(t,e,n){super(),Z(this,"$$ctor",void 0),Z(this,"$$s",void 0),Z(this,"$$c",void 0),Z(this,"$$cn",!1),Z(this,"$$d",{}),Z(this,"$$r",!1),Z(this,"$$p_d",{}),Z(this,"$$l",{}),Z(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=function(t){return document.createElement(t)}("slot"),"default"!==t&&function(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}(e,"name",t)},m:function(t,n){!function(t,e,n){t.insertBefore(e,n||null)}(t,e,n)},d:function(t){t&&function(t){t.parentNode&&t.parentNode.removeChild(t)}(e)}}}}const e={},n=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const o of this.$$s)o in n&&(e[o]=[t(o)]);for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=Y(a,i.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:G(G({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const r=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=Y(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}}attributeChangedCallback(t,e,n){var r;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Y(t,n,this.$$p_d,"toProp"),null===(r=this.$$c)||void 0===r||r.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});const X=[];function Q(t,e=i){let n;const r=new Set;function o(e){if(i=e,((o=t)!=o?i==i:o!==i||o&&"object"==typeof o||"function"==typeof o)&&(t=e,n)){const e=!X.length;for(const e of r)e[1](),X.push(e,t);if(e){for(let t=0;t<X.length;t+=2)X[t][0](X[t+1]);X.length=0}}var o,i}function a(e){o(e(t))}return{set:o,update:a,subscribe:function(s,l=i){const c=[s,l];return r.add(c),1===r.size&&(n=e(o,a)||i),s(t),()=>{r.delete(c),0===r.size&&n&&(n(),n=null)}}}}function K(t,e,n){const r=!Array.isArray(t),o=r?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return c=(t,n)=>{let c=!1;const u=[];let d=0,p=i;const v=()=>{if(d)return;p();const o=e(r?u[0]:u,t,n);a?t(o):p="function"==typeof o?o:i},g=o.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&v()}),(()=>{d|=1<<e}))));return c=!0,v(),function(){s(g),p(),c=!1}},{subscribe:Q(n,c).subscribe};var c}const tt="divkit-bd259",et="divkit-d9099",nt="divkit-c016b",rt="divkit-ee112",ot="divkit-aa145",it="divkit-f0cba",at=Symbol("root");function st(t,e={}){const n=t;return n.level=e.level||"error",e.additional&&(n.additional=e.additional),n}const lt={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_multiline:"divkit-ee8e3",text_truncate_none:"divkit-c6ea1",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002","text_has-focus-color":"divkit-cb341"},ct={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function ut(t){if(!t)return;let e="";for(const n in t)if(t.hasOwnProperty(n)){if(!t[n]&&0!==t[n])continue;e&&(e+=";"),e+=n+":"+String(t[n])}return e||void 0}function dt(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function pt(t){let e=dt(t);return"0"===e&&(e+="em"),e}function vt(t,e){for(;t.length<e;)t="0"+t;return t}function gt(t,e=1,n="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return n;const r=ft(t);return r?(r.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>vt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(r)):n}function ft(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,n,r,o,i]=e,a=2===r.length?r:r+r,s=2===o.length?o:o+o,l=2===i.length?i:i+i,c=2===n.length?n:n+n;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,n,r,o]=e,i=2===n.length?n:n+n,a=2===r.length?r:r+r,s=2===o.length?o:o+o;return{a:255,r:parseInt(i,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function ht(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const mt=Boolean;function yt(t){if(1===t.length&&"solid"===t[0].type)return{color:gt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=gt(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const n=t.bg.colors.filter(mt);return n.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+n.map((t=>gt(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const n=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(n)return{size:wt(t.bg.scale),pos:$t(t.bg),image:'url("'+ht(n)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const n=t.bg.colors.filter(mt);if(!n.length)return;const r=t.bg.radius;let o;r&&"object"==typeof r&&"type"in r&&void 0!==r.value&&("fixed"===r.type?o=pt(r.value):"relative"===r.type&&(o=bt[r.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${o||"farthest-corner"} at ${_t(t.bg.center_x)} ${_t(t.bg.center_y)},`+n.map((t=>gt(t))).join(",")+")"}}({bg:t}):void 0)).filter(mt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const bt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function _t(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return pt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function wt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function $t(t){let e,n;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",n="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+n}function xt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function kt(t,e){return e.has(t)}function Et(t,e,n){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:n}function Ct(t){return 0!==t.is_enabled&&!1!==t.is_enabled&&void 0!==t.index}function jt(t,e){e&&t.push(e)}function At(t,e,n){const r=[];jt(r,e[t]);for(const o in n)if(n.hasOwnProperty(o)){const i=n[o];i&&jt(r,e[`${t}_${o}`+("string"==typeof i?`_${i}`:"")])}return r.join(" ")}const Ft=Symbol("state");function Vt(t){const e=t.top||0,n=t.right||0,r=t.bottom||0,o=t.left||0;return 0===e&&0===n&&0===r&&0===o?"":dt(e)+" "+dt(n)+" "+dt(r)+" "+dt(o)}function Dt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function St(t){return Dt(t)&&t>=0}function Ot(t,e){if(!t)return e;const n=[t.top,t.right,t.bottom,t.left];for(let t=0;t<n.length;++t)if(n[t]&&!St(n[t]))return e;return Vt(t)}function Pt(t,e){const n=Number(t);return isNaN(n)||n<0?e:n}const It=Object.prototype.hasOwnProperty;function Mt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++){const o=n[r];if(!It.call(e,o)||!Mt(t[o],e[o]))return!1}return!0}function Tt(t,e){return Mt(t,e)?e:t}function zt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Nt(t,e){const n=Number(t);return isNaN(n)?e:n}function Rt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Rt(t))})):e.push(t),e}function Bt(t,e){if(!t||"object"!=typeof t)return e;const n=["top","right","bottom","left"];for(let r=0;r<n.length;++r)if(t[n[r]]&&!St(t[n[r]]))return e;return t}function Ut(t,e=0,n=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>dt((t||e)/n*10))).join(" ")}function Lt(t){return 0!==t.is_enabled&&!1!==t.is_enabled}let Wt;function Ht(){}const qt=Symbol("action"),Jt=L(((t,e,n,r)=>{let{componentContext:o}=e,{id:i=""}=e,{actions:a}=e,{doubleTapActions:s}=e,{longTapActions:l}=e,{cls:c=""}=e,{style:u=null}=e,{attrs:d}=e,{use:p=Ht}=e,{customAction:h=null}=e,{isNativeActionAnimation:m=!0}=e,{hasInnerFocusable:y=!1}=e;const b=f(at),_=f(qt);let w;g(qt,{hasAction:()=>Boolean(_.hasAction()||(null==a?void 0:a.length))});let $,x="",k=!1;if(v((()=>{i&&!y&&b.unregisterFocusable(i)})),void 0===e.componentContext&&n.componentContext&&void 0!==o&&n.componentContext(o),void 0===e.id&&n.id&&void 0!==i&&n.id(i),void 0===e.actions&&n.actions&&void 0!==a&&n.actions(a),void 0===e.doubleTapActions&&n.doubleTapActions&&void 0!==s&&n.doubleTapActions(s),void 0===e.longTapActions&&n.longTapActions&&void 0!==l&&n.longTapActions(l),void 0===e.cls&&n.cls&&void 0!==c&&n.cls(c),void 0===e.style&&n.style&&void 0!==u&&n.style(u),void 0===e.attrs&&n.attrs&&void 0!==d&&n.attrs(d),void 0===e.use&&n.use&&void 0!==p&&n.use(p),void 0===e.customAction&&n.customAction&&void 0!==h&&n.customAction(h),void 0===e.isNativeActionAnimation&&n.isNativeActionAnimation&&void 0!==m&&n.isNativeActionAnimation(m),void 0===e.hasInnerFocusable&&n.hasInnerFocusable&&void 0!==y&&n.hasInnerFocusable(y),Array.isArray(a)&&(null==a?void 0:a.length))for(let t=0;t<a.length;++t){const e=a[t].url;if(e){x=e,$=a[t].target||void 0;break}}return Array.isArray(a)&&(null==a?void 0:a.length)&&_.hasAction()&&(x="",o.logError(st(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:a}}))),k=Boolean(h),x&&!kt(xt(x),b.getBuiltinProtocols())?(x="",k=!0):!x&&Array.isArray(a)&&(null==a?void 0:a.length)&&(k=!0,a.some((t=>t.url||t.typed))||o.logError(st(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:a}}))),x?`<a${S([{href:M(x)},{target:M($)},{style:M(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?it:"",!0)},T(d)],{})}${W("this",w,0)}>${r.default?r.default({}):""}</a>`:` <span${S([{class:I(c,!0)+I(k?` ${m?tt:et} ${nt}`:"",!0)+" "+I(null!=l&&l.length?it:"",!0)},{style:M(u)},{role:M(k?"button":null)},{tabindex:M(k?0:null)},T(d)],{})}${W("this",w,0)}>${r.default?r.default({}):""}</span>`})),Gt=Jt,Zt="divkit-b921d";function Yt(t){return Dt(t)&&t>0}function Xt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Yt(t.radius))return`blur(${pt(t.radius/2)})`}else e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Qt=L(((t,e,n,r)=>{let o,{componentContext:i}=e,{background:a=[]}=e,{radius:s=""}=e;return f(at),void 0===e.componentContext&&n.componentContext&&void 0!==i&&n.componentContext(i),void 0===e.background&&n.background&&void 0!==a&&n.background(a),void 0===e.radius&&n.radius&&void 0!==s&&n.radius(s),o=a.map((t=>{const e={},n={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const r=yt([t]);"solid"===t.type&&(e["background-color"]=r.color),"gradient"===t.type&&(e["background-image"]=r.image),"image"===t.type&&(e.opacity=Number(t.alpha),n.image_url=t.image_url,e["object-fit"]=r.size,e["object-position"]=r.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Xt(t.filters,i.logError)))}return n})),`<span${W("class","divkit-bf253"+(s?" divkit-dcad7":""),0)}${q({"border-radius":s})}>${z(o,(t=>t.image_url?`<img${W("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${W("class",Zt,0)}${W("style",ut(t.style),0)}>`:`<span${W("class",Zt,0)}${W("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Qt,te={left:"start",center:"center",right:"end"},ee={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,z,N,B,U,L,H,q,J,G,Z,Y,X,Q,tt,et,nt,rt=i,ot=i,it=i,lt=i,vt=i,ft=i,ht=i,bt=i,_t=i,wt=i,$t=i,jt=i,Dt=i,It=i,Ht=i,qt=i,Jt=i,Zt=i,{componentContext:Yt}=e,{cls:Xt=""}=e,{style:Qt}=e,{layoutParams:ne={}}=e,{customDescription:re=!1}=e,{customPaddings:oe=!1}=e,{customActions:ie=""}=e,{additionalPaddings:ae=null}=e,{heightByAspect:se=!1}=e,{parentOf:le}=e,{parentOfSimpleMode:ce}=e,{replaceItems:ue}=e,{hasInnerFocusable:de=!1}=e;const pe=f(at),ve=f(Ft);let ge,fe;I=l(pe.isPointerFocus,(t=>P=t));let he,me,ye,be,_e,we,$e,xe,ke,Ee,Ce,je,Ae,Fe,Ve,De,Se,Oe,Pe,Ie,Me=null,Te=[],ze={},Ne={},Re=!1,Be=1,Ue="transparent",Le=0,We={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},He="",qe=null,Je="",Ge={},Ze=0,Ye=0,Xe=0,Qe=!1,Ke=!1,tn={},en=0,nn=0,rn=0,on=!1,an=!1,sn=1,ln=[],cn=!1,un=!1,dn=[],pn=[],vn=[],gn=[],fn=[],hn=[],mn="",yn=!1,bn="visible",_n=0,wn=0,$n=!1,xn=null;function kn(t,e){if(!Array.isArray(le)||!ue)return;if(ce&&1!==(Array.isArray(e)&&e.length||0))return;const n=le.findIndex((e=>(null==e?void 0:e.id)===t)),r=le.slice();r.splice(n,1,...e||[]),le=r,ue(r)}function En(){if(Me&&ge){const t=pe.getExtensionContext();Me.forEach((e=>{var n;null===(n=e.unmountView)||void 0===n||n.call(e,ge,t)})),Me=null}}function Cn(){Yt.json.focus&&(P||($n=!0),Yt.execAnyActions(gn))}function jn(){Yt.json.focus&&($n=!1,Yt.execAnyActions(fn))}v((()=>{var t;Te.forEach((t=>{pe.unregisterParentOf(t)})),Te=[],null===(t=Yt.json.tooltips)||void 0===t||t.forEach((t=>{pe.unregisterTooltip(t)})),En()})),void 0===e.componentContext&&n.componentContext&&void 0!==Yt&&n.componentContext(Yt),void 0===e.cls&&n.cls&&void 0!==Xt&&n.cls(Xt),void 0===e.style&&n.style&&void 0!==Qt&&n.style(Qt),void 0===e.layoutParams&&n.layoutParams&&void 0!==ne&&n.layoutParams(ne),void 0===e.customDescription&&n.customDescription&&void 0!==re&&n.customDescription(re),void 0===e.customPaddings&&n.customPaddings&&void 0!==oe&&n.customPaddings(oe),void 0===e.customActions&&n.customActions&&void 0!==ie&&n.customActions(ie),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==ae&&n.additionalPaddings(ae),void 0===e.heightByAspect&&n.heightByAspect&&void 0!==se&&n.heightByAspect(se),void 0===e.parentOf&&n.parentOf&&void 0!==le&&n.parentOf(le),void 0===e.parentOfSimpleMode&&n.parentOfSimpleMode&&void 0!==ce&&n.parentOfSimpleMode(ce),void 0===e.replaceItems&&n.replaceItems&&void 0!==ue&&n.replaceItems(ue),void 0===e.hasInnerFocusable&&n.hasInnerFocusable&&void 0!==de&&n.hasInnerFocusable(de),Yt.json&&ne&&(qe=null,Je="",sn=1,yn=!1,bn="visible",_n=0,wn=0,Oe=void 0,Pe=void 0,ln=Yt.fakeElement?[]:Yt.json.transition_triggers||["state_change","visibility_change"],cn=Boolean(-1!==ln.indexOf("state_change")&&Yt.json.id),un=Boolean(-1!==ln.indexOf("visibility_change")&&Yt.json.id)),o=Yt.getDerivedFromVars(Yt.json.focus),lt(),lt=l(o,(t=>N=t)),a=Yt.getDerivedFromVars(Yt.json.border),Zt(),Zt=l(a,(t=>nt=t)),s=Yt.getDerivedFromVars(Yt.json.paddings),Jt(),Jt=l(s,(t=>et=t)),c=Yt.getDerivedFromVars(Yt.json.margins),Ht(),Ht=l(c,(t=>Q=t)),u=Yt.getDerivedFromVars(Yt.json.width),Dt(),Dt=l(u,(t=>Y=t)),d=Yt.getDerivedFromVars(Yt.json.alignment_horizontal),qt(),qt=l(d,(t=>tt=t)),p=Yt.getDerivedFromVars(Yt.json.height),jt(),jt=l(p,(t=>Z=t)),g=Yt.getDerivedFromVars(Yt.json.alignment_vertical),It(),It=l(g,(t=>X=t)),h=Yt.getDerivedFromVars(Yt.json.alpha),$t(),$t=l(h,(t=>G=t)),m=Yt.getDerivedFromVars(Yt.json.accessibility),wt(),wt=l(m,(t=>J=t)),y=Yt.getDerivedFromVars(Yt.json.background),_t(),_t=l(y,(t=>q=t)),b=Yt.getDerivedFromVars(Yt.json.action),ht(),ht=l(b,(t=>L=t)),_=Yt.getDerivedFromVars(Yt.json.actions),bt(),bt=l(_,(t=>H=t)),w=Yt.getDerivedFromVars(Yt.json.doubletap_actions),ft(),ft=l(w,(t=>U=t)),x=Yt.getDerivedFromVars(Yt.json.longtap_actions),vt(),vt=l(x,(t=>B=t)),k=Yt.getDerivedFromVars(Yt.json.action_animation),it(),it=l(k,(t=>z=t)),E=Yt.getDerivedFromVars(Yt.json.visibility),ot(),ot=l(E,(t=>T=t)),C=Yt.getDerivedFromVars(Yt.json.transform),rt(),rt=l(C,(t=>M=t)),Te.forEach((t=>{pe.unregisterParentOf(t)})),Te=[],le&&le.forEach((t=>{(null==t?void 0:t.id)&&(Te.push(t.id),pe.registerParentOf(t.id,{replaceWith:kn,isSingleMode:Boolean(ce)}))}));{const t=$n&&(null==N?void 0:N.border)?N.border:nt;let e={},n={},r=!1,o="";if(t){if(t.has_shadow){const n=t.shadow;e["box-shadow"]=n?function(t){var e,n,r,o,i,a;return dt((null===(e=t.offset)||void 0===e||null===(n=e.x)||void 0===n?void 0:n.value)||0)+" "+dt((null===(r=t.offset)||void 0===r||null===(o=r.y)||void 0===o?void 0:o.value)||0)+" "+dt(null!==(i=t.blur)&&void 0!==i?i:2)+" "+gt(t.color||"#000000",null!==(a=t.alpha)&&void 0!==a?a:.19)}(n):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(r=!0,Be=Pt(t.stroke.width,Be),Ue=gt(t.stroke.color,1,Ue),n.border=`${dt(Be)} solid ${Ue}`),t.corners_radius?(We=function(t,e){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!St(n[t]))return e;return t}(t.corners_radius,We),n["border-radius"]=e["border-radius"]=Ut(We)):t.corner_radius&&(Le=Pt(t.corner_radius,Le),We={"top-left":Le,"top-right":Le,"bottom-right":Le,"bottom-left":Le},n["border-radius"]=e["border-radius"]=dt(Le)),r&&Be&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},We);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Be/2})),o=Ut(t)}}ze=Tt(e,ze),Ne=Tt(n,Ne),Re=r,He=o}qe=Bt(et&&!oe?et:void 0,qe),j=Vt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const n={};return["top","right","bottom","left"].forEach((r=>{const o=t[r];o&&(n[r]=o);const i=e[r];i&&(n[r]=(n[r]||0)+i)})),n}(qe,ae)),Je=Ot(Q,Je);{let t,e,n,r,o={},i=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Ze=Pt(null==Y?void 0:Y.value,Ze),e=dt(Ze);else if("wrap_content"===c||("match_parent"===c||!c)&&ne.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&ne.parentHorizontalWrapContent)&&(o["width-constrained"]=!0,"horizontal"===ne.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&St(t.min_size.value)&&(n=dt(t.min_size.value)),t.max_size&&St(t.max_size.value)&&(r=dt(t.max_size.value))}"match_parent"!==c&&c||Yt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===ne.parentContainerOrientation&&ne.parentContainerWrap&&(l=!0,Yt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===ne.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===ne.parentContainerOrientation&&(i=Y&&"weight"in Y&&Y.weight||1,ne.parentContainerWrap&&(s=!0));if("parent"===t)o["halign-self"]="stretch";else{const t=tt;o["halign-self"]="left"===t||"center"===t||"right"===t?te[t]:ne.parentHAlign||"start"}t&&(o.width=t),he=e,me=n,ye=r,Ye=i,Xe=a,Ge=Tt(o,Ge),Qe=s,Ke=l}{let t,e,n,r,o={},i=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(se);else if("fixed"===c)en=Pt(null==Z?void 0:Z.value,en),e=dt(en);else if("match_parent"!==c||ne.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&ne.parentVerticalWrapContent)&&(o["height-constrained"]=!0,"vertical"===ne.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&St(t.min_size.value)&&(n=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&St(t.max_size.value)&&(r=dt(t.max_size.value))}"match_parent"===c&&Yt.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===ne.parentContainerOrientation&&ne.parentContainerWrap&&(l=!0,Yt.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===ne.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===ne.parentContainerOrientation&&(i=(null==Z?void 0:Z.weight)||1,ne.parentContainerWrap&&(s=!0));if("parent"===t)o["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===ne.parentContainerOrientation?o["valign-self"]=ee[t]:o["valign-self"]=ne.parentVAlign||"start"}t&&(o.height=t),be=e,_e=n,we=r,nn=i,rn=a,tn=Tt(o,tn),on=s,an=l}var An,Fn,Vn;if(A=!!ne.overlapParent||void 0,F=ne.overlapParent&&(!Y||"match_parent"===Y.type)&&!ne.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!ne.parentVerticalWrapContent,V=ne.gridArea?`${ne.gridArea.y+1}/${ne.gridArea.x+1}/span ${ne.gridArea.rowSpan}/span ${ne.gridArea.colSpan}`:void 0,Fn=sn,sn=!St(An=G)||void 0===An||An>1?Fn:Number(An),$e=1===sn?void 0:sn,fe=void 0,J&&!re&&J.description&&(fe={},fe["aria-label"]=J.description),xe=$n&&(null==N?void 0:N.background)?N.background:q,ke={},Ee=!1,Array.isArray(xe)&&(Ee=xe.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(He),!Ee)){const t=yt(xe);ke["background-color"]=t.color,ke["background-image"]=t.image,ke["background-size"]=t.size,ke["background-position"]=t.position,ke["background-repeat"]="no-repeat"}Ce=void 0,cn&&Yt.json.transition_in&&pe.isRunning("stateChange")&&(Ce=!0),Ae=void 0,cn&&Yt.json.transition_change&&pe.isRunning("stateChange")&&ve.hasTransitionChange(Yt.json.id)&&(Ae=!0);{let t=H||L&&[L]||[],e=U||[],n=B||[],r=(null==N?void 0:N.on_focus)||[],o=(null==N?void 0:N.on_blur)||[];Yt.fakeElement?(t=[],e=[],n=[],r=[],o=[]):(Array.isArray(t)||(t=[],Yt.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Yt.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(n)||(n=[],Yt.logError(st(new Error("LongTapActions should be array")))),Array.isArray(r)||(r=[],Yt.logError(st(new Error("FocusActions should be array")))),Array.isArray(o)||(o=[],Yt.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||n.length)&&ie&&(t=[],e=[],n=[],Yt.logError(st(new Error(`Cannot use action on component "${ie}"`)))),dn=t.filter(Lt),pn=e.filter(Lt),vn=n.filter(Lt),gn=r.filter(Lt),fn=o.filter(Lt)}z&&(hn=Rt(z),mn=hn.map((function(t){const e=Nt(t.start_value,1),n=Nt(t.end_value,1),r=Pt(t.start_delay,0),o="undefined"!=typeof matchMedia&&(Wt||(Wt=window.matchMedia("(prefers-reduced-motion)")),Wt.matches)?0:Pt(t.duration,300),i=zt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Fe=e,Ve=n,`opacity ${o}ms ${i} ${r}ms`;case"scale":return De=e,Se=n,`transform ${o}ms ${i} ${r}ms`;case"native":case"no_animation":return"";default:return Yt.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=bn,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(T,bn);t!==e&&(!yn||"visible"!==bn&&"visible"!==e?bn=e:async function(t){bn=t;const e="visible"===t?"in":"out",n="in"===e?Yt.json.transition_in:Yt.json.transition_out;un&&n&&(await $(),"in"===e&&(je=!0),ve.runVisibilityTransition(Object.assign(Object.assign({},Yt.json),{visibility:"visible"}),Yt,n,ge,e).then((()=>{"in"===e&&(je=!1)})).catch((t=>{throw"in"===e&&(je=!1),t})))}(e)),yn||(yn=!0)}if(Yt.json&&ge&&!Mt(Yt.json.extensions,Ie)){let t=Ie=Yt.json.extensions;$().then((()=>{if(t===Ie&&ge&&(En(),Array.isArray(Yt.json.extensions))){const t=pe.getExtensionContext();Me=Yt.json.extensions.map((e=>{var n;const r=e.id;if(!r)return;const o=pe.getExtension(r,e.params);return o&&(null===(n=o.mountView)||void 0===n||n.call(o,ge,t)),o})).filter(mt)}}))}if(Yt&&xn&&xn.update(Yt),D=Object.assign(Object.assign(Object.assign({},Ge),tn),{"parent-overlap":A,"parent-overlap-absolute":F,"scroll-snap":ne.scrollSnap,"hide-on-transition-in":Ce||je||Ae,visibility:bn,"has-action-animation":Boolean(mn),"parent-flex":ne.parentContainerOrientation||void 0,"parent-grid":Boolean(ne.gridArea)||void 0,"has-custom-focus":Boolean($n&&Yt.json.focus)}),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};_n=Nt(t.value,_n);const e="pivot-fixed"===t.type?dt(_n):`${_n}%`,n=M.pivot_y||{type:"pivot-percentage",value:50};wn=Nt(n.value,wn),Oe=`${e} ${"pivot-fixed"===n.type?dt(wn):`${wn}%`}`,Pe=`rotate(${M.rotation}deg)`}return S=Qe||on?"100%":Ye||nn?0:void 0,O=Object.assign(Object.assign(Object.assign(Object.assign({},Qt),ke),ze),{width:he,"min-width":me,"max-width":ye,height:be,"min-height":_e,"max-height":we||(null==Qt?void 0:Qt["max-height"]),"grid-area":V,padding:j,margin:Je,opacity:$e,transition:mn,"transform-origin":Oe,transform:Pe,"flex-grow":Ye||nn||void 0,"flex-shrink":Xe||rn?1:void 0,"flex-basis":S,"--divkit-animation-opacity-start":Fe,"--divkit-animation-opacity-end":Ve,"--divkit-animation-scale-start":De,"--divkit-animation-scale-end":Se}),I(),rt(),ot(),it(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),jt(),Dt(),It(),Ht(),qt(),Jt(),Zt(),Ke||an?"":`${R(Gt,"Actionable").$$render(t,{componentContext:Yt,id:Yt.json.id,use:function(t){var e;ge=t,cn&&Yt.json.transition_in&&ve.registerChildWithTransitionIn(Yt.json,Yt,Yt.json.transition_in,t).then((()=>{Ce=!1})).catch((t=>{throw Ce=!1,t})),cn&&Yt.json.transition_out&&ve.registerChildWithTransitionOut(Yt.json,Yt,Yt.json.transition_out,t),cn&&Yt.json.transition_change&&ve.registerChildWithTransitionChange(Yt.json,Yt,Yt.json.transition_change,t).then((()=>{Ae=!1})).catch((t=>{throw Ae=!1,t}));const n=Yt.fakeElement?[]:Yt.json.visibility_actions||Yt.json.visibility_action&&[Yt.json.visibility_action],r=Yt.fakeElement?[]:Yt.json.disappear_actions;let o;(Array.isArray(n)&&n.length||Array.isArray(r)&&r.length)&&(o=function(t,{visibilityActions:e,disappearActions:n,rootCtx:r,componentContext:o}){const i=[];e&&e.forEach((t=>{i.push({type:"visibility",index:i.length,action:t,visible:!1,count:0,finished:!1})})),n&&n.forEach((t=>{i.push({type:"disappear",index:i.length,action:t,visible:!1,count:0,finished:!1})}));const a=i.map(((t,e)=>{const n="visibility"===t.type;return o.getDerivedFromVars({index:e,visibility_percentage:t.action.visibility_percentage,visibility_duration:n?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit,is_enabled:t.action.is_enabled})}));let s;const l=()=>{s&&s.disconnect(),i.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t)).subscribe((e=>{const n=e.filter(Ct),a={};n.forEach((t=>{a[t.index]=t})),l();const c=[...new Set(n.map((t=>{const e="visibility"===i[t.index].type;return Et(e,t.visibility_percentage,e?50:0)/100})))];c.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=i[e.index],a="visibility"===n.type,s=Et(a,e.visibility_percentage,a?50:0);let l;l=0===s?t.intersectionRatio>=1e-12:t.intersectionRatio>=s/100;const c=a?!n.visible&&l:n.visible&&!l,u=a?!l:l;c?n.finished||(n.timer=setTimeout((()=>{++n.count;const t=0===e.log_limit?1/0:e.log_limit||1;++n.count>=t&&(n.finished=!0);const i=o.getJsonWithVars(n.action),s=i.url,l=i.typed;if(s){const t=xt(s);t&&!kt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(i):i.log_id&&r.execCustomAction(i))}else l&&r.execAction(i);r.logStat(a?"visible":"disappear",i)}),e.visibility_duration||800)):u&&n.timer&&clearTimeout(n.timer),n.visible=l}))}))}),{threshold:c}),s.observe(t))}));return{destroy(){l(),c()}}}(t,{visibilityActions:n,disappearActions:r,rootCtx:pe,componentContext:Yt}));const i=Yt.json.id;return i&&ve.registerChild(i),null===(e=Yt.json.tooltips)||void 0===e||e.forEach((e=>{pe.registerTooltip(t,e)})),{destroy(){i&&ve.unregisterChild(i),o&&o.destroy(),xn&&xn.destroy()}}},cls:Xt+" "+At("outer",ct,D),style:ut(O),actions:dn,doubleTapActions:pn,longTapActions:vn,attrs:fe,hasInnerFocusable:de,isNativeActionAnimation:!hn.length||(Vn=hn,Vn.some((t=>"native"===t.name)))},{},{default:()=>` ${Ee?`${R(Kt,"OuterBackground").$$render(t,{componentContext:Yt,background:xe,radius:He},{},{})}`:""}${r.default?r.default({focusHandler:Cn,blurHandler:jn,hasCustomFocus:$n}):""}${Re?`<span${W("class",ct.outer__border,0)}${W("style",ut(Ne),0)}></span>`:""}`})}`})),re=ne,oe={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function ie(t,e){const n=Number(t);return isNaN(n)||n<=0?e:n}function ae(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function se(t,e){return ae(t)||e}const le=L(((t,e,n,r)=>{let o,i,a,s,l,c;var u,d;let{componentContext:p}=e,{text:v}=e,{rootFontSize:g}=e,{textStyles:h={}}=e,{singleline:m=!1}=e,{actions:y}=e;const b=f(at);let _,w="none",$=12,x=1.25,k="",E="",C="",j=null;void 0===e.componentContext&&n.componentContext&&void 0!==p&&n.componentContext(p),void 0===e.text&&n.text&&void 0!==v&&n.text(v),void 0===e.rootFontSize&&n.rootFontSize&&void 0!==g&&n.rootFontSize(g),void 0===e.textStyles&&n.textStyles&&void 0!==h&&n.textStyles(h),void 0===e.singleline&&n.singleline&&void 0!==m&&n.singleline(m),void 0===e.actions&&n.actions&&void 0!==y&&n.actions(y),p.json&&(w="none",$=12,x=1.25,k="",_=void 0,E="",C="",j=null);{let t="none";(h.underline||h.strike)&&("single"===h.underline&&"single"===h.strike?t="both":"single"===h.underline?t="underline":"single"===h.strike&&(t="strike")),w=t}return $=ie(h.font_size,$),Yt(h.line_height)&&(x=Number(h.line_height)/$),St(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=se(h.font_weight,_),E="string"==typeof h.font_family&&h.font_family?b.typefaceProvider(h.font_family,{fontWeight:_||400}):"",C=gt(h.text_color,1,C),o=h.top_offset?dt(h.top_offset):"",i=h.background?yt([h.background]):null,j=(null===(u=h.border)||void 0===u?void 0:u.stroke)&&h.border.stroke.color&&"transparent"!==gt(h.border.stroke.color)&&Yt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=ie(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var n,r,o,i,a,s;return"drop-shadow("+gt(t.color||"#000000",null!==(n=t.alpha)&&void 0!==n?n:.19)+" "+dt(10*((null===(r=t.offset)||void 0===r||null===(o=r.x)||void 0===o?void 0:o.value)||0)/e)+" "+dt(10*((null===(i=t.offset)||void 0===i||null===(a=i.y)||void 0===a?void 0:a.value)||0)/e)+" "+dt(10*(null!==(s=t.blur)&&void 0!==s?s:2)/e)+")"}(h.text_shadow,$):void 0,l={singleline:m,decoration:w},c={"font-size":dt(10*$/g),"line-height":x,"letter-spacing":k,"font-weight":_,"font-family":E,filter:s,color:C,background:(null==i?void 0:i.color)||void 0,"box-shadow":j?`inset 0 0 0 ${dt(j.width)} ${j.color}`:void 0,"border-radius":a?dt(a):void 0},`${o?`<span${W("class",oe["text-range__top-offset"],0)}${q({"margin-top":o})}></span>`:""}${R(Gt,"Actionable").$$render(t,{componentContext:p,cls:At("text-range",oe,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ce=le;function ue(t,e){return"left"===t||"center"===t||"right"===t?t:e}function de(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function pe(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ve(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const ge=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,N,B,U,L,H,q,J,G=i,Z=i,Y=i,X=i,Q=i,K=i,tt=i,et=i,rt=i,ot=i,it=i,st=i,ct=i,pt=i,vt=i,{componentContext:ft}=e,{layoutParams:ht}=e;const mt=f(at);let bt="",_t=12,wt=1.25,$t=!1,xt="",kt="",Et=!1,Ct="left",jt="top",Ft="",Vt="",Dt="",St=!1,Ot=[],Pt=[];var It;v((()=>{Pt.forEach((([t,e])=>{mt.removeSvgFilter(t,e)}))})),void 0===e.componentContext&&n.componentContext&&void 0!==ft&&n.componentContext(ft),void 0===e.layoutParams&&n.layoutParams&&void 0!==ht&&n.layoutParams(ht),ft.json&&(_t=12,wt=1.25,$t=!1,xt="",kt="",Et=!1,Ct="left",jt="top",Ft="",Dt="",St=!1),o=ft.getDerivedFromVars(ft.json.text),vt(),vt=l(o,(t=>J=t)),a=ft.getDerivedFromVars(ft.json.ranges),Z(),Z=l(a,(t=>D=t)),s=ft.getDerivedFromVars(ft.json.images),G(),G=l(s,(t=>V=t)),c=ft.getDerivedFromVars({font_size:ft.json.font_size,letter_spacing:ft.json.letter_spacing,font_weight:ft.json.font_weight,font_family:ft.json.font_family,text_color:ft.json.text_color,underline:ft.json.underline,strike:ft.json.strike,line_height:ft.json.line_height,text_shadow:ft.json.text_shadow}),Y(),Y=l(c,(t=>S=t)),u=ft.getDerivedFromVars(ft.json.font_size),pt(),pt=l(u,(t=>q=t)),d=ft.getDerivedFromVars(ft.json.line_height),ct(),ct=l(d,(t=>H=t)),p=ft.getDerivedFromVars(ft.json.max_lines),rt(),rt=l(p,(t=>N=t)),g=ft.getDerivedFromVars(ft.json.text_alignment_horizontal),it(),it=l(g,(t=>U=t)),h=ft.getDerivedFromVars(ft.json.text_alignment_vertical),ot(),ot=l(h,(t=>B=t)),m=ft.getDerivedFromVars(ft.json.text_color),et(),et=l(m,(t=>T=t)),y=ft.getDerivedFromVars(ft.json.focused_text_color),tt(),tt=l(y,(t=>M=t)),b=ft.getDerivedFromVars(ft.json.truncate),K(),K=l(b,(t=>I=t)),_=ft.getDerivedFromVars(ft.json.text_gradient),Q(),Q=l(_,(t=>P=t)),w=ft.getDerivedFromVars(ft.json.selectable),X(),X=l(w,(t=>O=t)),$=ft.getDerivedFromVars(ft.json.auto_ellipsize),st(),st=l($,(t=>L=t)),It=J,bt=String(null!=It?It:""),_t=ie(q,_t);{const t=H;Yt(t)?(wt=Number(t)/_t,$t=!0):$t=!1}x=1===N;{let t="",e="",n=!1;if(N&&N>1){let r=Number(N);t=r*wt+"em",e=r,n=!0}else L&&1!==N&&(n=!0);xt=t,kt=e,Et=n}Ct=ue(U,Ct),jt=de(B,jt),k=!D||bt&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=bt.length,E=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";N&&k&&E&&(t=gt(T||D&&D[0]&&D[0].text_color,1,Ft)),Ft=t}Vt=gt(M,1,Vt),C="none"===I?"none":"";{let t="";if(P){const e=yt([P]);e.image&&(t=e.image)}Dt=t}return St=pe(O,St),function(t,e,n){let r=[];if(Pt.forEach((([t,e])=>{mt.removeSvgFilter(t,e)})),Pt=[],!(Array.isArray(e)&&e.length||Array.isArray(n)&&n.length&&t))return void(Ot=[]);const o=t;let i=e||[{start:0,end:o.length}],a=n||[],s=0,l=[],c=[];i.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=o.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e,n;let i="image"===t.type?null:t.range,a=t.index;if(a>s){let i=Object.assign(Object.assign({},S),...l);r.push({text:o.substring(s,a),textStyles:i,actions:"rangeEnd"===t.type&&(null===(n=null===(e=t.range)||void 0===e?void 0:e.actions)||void 0===n?void 0:n.filter(Lt))||void 0})}if("rangeStart"===t.type&&i)l.push(i);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},S),...l),n=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),o=dt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const i={"font-size":dt(10*(Number(e.font_size)||12)/_t)};let a="";const s=t.image.tint_color,c=ve(t.image.tint_mode,"source_in");if(s){const e=gt(t.image.tint_color);a=mt.addSvgFilter(e,c),Pt.push([e,c])}r.push({image:{url:t.image.url,width:n,height:o,wrapperStyle:i,svgFilterId:a}})}s=a})),s<o.length&&r.push({text:o.substring(s),textStyles:Object.assign({},S)}),Ot=r}(bt,D,V),j={singleline:x,multiline:Et,halign:Ct,valign:jt,truncate:C,"has-focus-color":Boolean(Vt)},A={gradient:Boolean(Dt)},F={"font-size":dt(_t),"line-height":wt,"max-height":xt,"-webkit-line-clamp":kt,color:Ft,"background-image":Dt,"--divkit-text-focus-color":Vt},G(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),ot(),it(),st(),ct(),pt(),vt(),`${R(re,"Outer").$$render(t,{cls:At("text",lt,j)+" "+(St?"":nt),componentContext:ft,layoutParams:ht},{},{default:()=>`<span${W("class",At("text__inner",lt,A),0)}${W("style",ut(F),0)}>${Ot.length?`${z(Ot,(e=>"text"in e?e.text?`${R(ce,"TextRangeView").$$render(t,{componentContext:ft,text:e.text,rootFontSize:_t,textStyles:e.textStyles,singleline:x,actions:e.actions},{},{})}`:"":e.image?`<span${W("style",ut(e.image.wrapperStyle),0)}><img${W("class",lt.text__image,0)}${W("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${W("style",ut({width:e.image.width,height:e.image.height,"margin-top":$t?`-${e.image.height}`:void 0,"margin-bottom":$t?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${R(ce,"TextRangeView").$$render(t,{componentContext:ft,text:bt,rootFontSize:_t,textStyles:S,singleline:x},{},{})}`}</span>`})}`})),fe=ge,he={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_overflow_visible:"divkit-f315a",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function me(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function ye(t,e,n){const r=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(n?t.top=e.style.height+o:t.left=e.style.width+r),null!=e&&e.show_at_end&&(n?t.bottom=e.style.height+o:t.right=e.style.width+r)}function be(t,e,n){let r;const o=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),i=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==n?void 0:n.margins.left)||0)+((null==n?void 0:n.margins.right)||0),s=((null==n?void 0:n.margins.top)||0)+((null==n?void 0:n.margins.bottom)||0);return r="horizontal"===t?[null!=n&&n.show_between?n.style.height+s:0,null!=e&&e.show_between?e.style.width+o:0]:[null!=e&&e.show_between?e.style.height+i:0,null!=n&&n.show_between?n.style.width+a:0],r.map(dt).join(" ")}function _e(t){var e;const n=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===n||"fixed"===n}function we(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function $e(t,e,n){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return n;let r;if("rounded_rectangle"===t.shape.type)r={width:Pt(null===(i=(o=t.shape).item_width)||void 0===i?void 0:i.value,10),height:Pt(null===(a=o.item_height)||void 0===a?void 0:a.value,10),radius:Pt(null===(s=o.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return n;r=function(t){var e;const n=2*Pt(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:n,height:n,radius:n}}(t.shape)}var o,i,a,s;return function(t,e,n){var r;const o={},i=e.stroke||(null==n?void 0:n.stroke),a=null!=i&&i.color?gt(i.color):"",s=null!=i&&i.width?Number(null!==(r=i.width)&&void 0!==r?r:1):"";o.width=t.width,o.height=t.height,o.borderRadius=t.radius;const l=e.background_color||(null==n?void 0:n.color);return o.background=gt(l),a&&s&&(o.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),o}(r,t.shape,{color:t.color,stroke:t.stroke})}let xe;function ke(){if("undefined"==typeof document&&(xe=!0),void 0!==xe)return xe;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),xe=1===t.scrollHeight,document.body.removeChild(t),xe}const Ee="divkit-a7719",Ce="divkit-f6e9a";function je(t,e,n,r,o,i){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;i?t.push({top:n.bottom+l,left:o.left+a,width:Math.max(0,o.right-o.left-a-s),height:r.top-n.bottom-l-c,style:e.style}):t.push({top:o.top+l,left:n.right+a,width:r.left-n.right-a-s,height:Math.max(0,o.bottom-o.top-l-c),style:e.style})}function Ae(t,e,n,r,o,i){const a={top:Math.min(...n.map((t=>t.top))),right:Math.max(...n.map((t=>t.right))),bottom:Math.max(...n.map((t=>t.bottom))),left:Math.min(...n.map((t=>t.left)))};if(null==e?void 0:e.show_at_start){let s,l;"space-around"===o||"space-evenly"===o?(s=i.left-e.style.width,l=i.top-e.style.height):(s=n[0].left-e.style.width-e.margins.left-e.margins.right,l=n[0].top-e.style.height-e.margins.top-e.margins.bottom),je(t,e,{top:0,right:s,bottom:l,left:0},n[0],a,r)}if(null==e?void 0:e.show_between)for(let o=0;o<n.length-1;++o)je(t,e,n[o],n[o+1],a,r);if(null==e?void 0:e.show_at_end){const s=n[n.length-1];let l,c;"space-around"===o||"space-evenly"===o?(l=i.bottom+e.style.height,c=i.right+e.style.width):(l=s.bottom+e.style.height+e.margins.top+e.margins.bottom,c=s.right+e.style.width+e.margins.left+e.margins.right),je(t,e,s,{top:l,right:0,bottom:0,left:c},a,r)}}const Fe=L(((t,e,n,r)=>{let o,{orientation:i}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e;const u=function(t,e){let n,r=0,o=!1;return function(){const e=Date.now();return!r||Math.abs(e-r)>10?(r=e,n=t.apply(this,arguments)):(o||(o=!0,setTimeout((()=>{o=!1,n=t.apply(this,arguments)}),10)),n)}}((function(){if(!o)return;const t=o.getBoundingClientRect(),e=window.getComputedStyle(o),n={top:t.top+parseFloat(e.paddingTop),right:t.right-parseFloat(e.paddingRight),bottom:t.bottom-parseFloat(e.paddingBottom),left:t.left+parseFloat(e.paddingLeft)};p=[];let r=[...o.children].filter((t=>t!==d&&!t.classList.contains(ct.outer__border))),u=[];for(;r.length;){const t=[],e=r.shift();t.push(e);let n=e.getBoundingClientRect(),o=n.right,a=n.bottom;for(;r.length;){let e=r[0],n=e.getBoundingClientRect();if("vertical"===i){if(n.top<a)break}else if(n.left<o)break;o=Math.max(o,n.right),a=Math.max(a,n.bottom),t.push(e),r.shift()}u.push(t)}const v=[];u.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),n=getComputedStyle(t);return{top:e.top-parseFloat(n.marginTop),right:e.right+parseFloat(n.marginRight),bottom:e.bottom+parseFloat(n.marginBottom),left:e.left-parseFloat(n.marginLeft)}}(t)));a&&Ae(p,a,e,"vertical"===i,"vertical"===i?c:l,n);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};v.push(r)})),s&&Ae(p,s,v,"horizontal"===i,"vertical"===i?l:c,n),p.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let d,p=[],g=!1,f=null,h=null;return v((()=>{g=!1})),void 0===e.orientation&&n.orientation&&void 0!==i&&n.orientation(i),void 0===e.separator&&n.separator&&void 0!==a&&n.separator(a),void 0===e.lineSeparator&&n.lineSeparator&&void 0!==s&&n.lineSeparator(s),void 0===e.contentHAlign&&n.contentHAlign&&void 0!==l&&n.contentHAlign(l),void 0===e.contentVAlign&&n.contentVAlign&&void 0!==c&&n.contentVAlign(c),o=null,(g&&o||f||h)&&(f&&(f.disconnect(),f=null),h&&(h.disconnect(),h=null),g&&o&&("undefined"!=typeof MutationObserver&&(f=new MutationObserver((function(t){t.some((t=>{var e;const n=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==n?void 0:n.contains(Ce))&&!(null==n?void 0:n.contains(Ee))}))&&u()})),f.observe(o,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(u),h.observe(o)))),g&&o&&u(),` <div${W("class",Ee,0)}${W("this",d,0)}>${z(p,(t=>`<div${W("class","divkit-c770e",0)}${q({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${W("class",Ce,0)}${q({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div> </div>`))}</div>`})),Ve={left:"start",center:"center",right:"end","space-between":"start","space-around":"start","space-evenly":"start"},De={top:"start",center:"center",bottom:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Se=["rounded_rectangle","circle"],Oe=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T=i,N=i,B=i,U=i,L=i,W=i,H=i,q=i,J=i,G=i,Z=i,Y=i;var X,Q,tt,et,nt,rt,ot;let{componentContext:it}=e,{layoutParams:st}=e;const lt=f(at);let ct,ut,dt="vertical",pt="top",vt="left",gt=null,ft=null,ht={},yt=[];void 0===e.componentContext&&n.componentContext&&void 0!==it&&n.componentContext(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==st&&n.layoutParams(st),it.json&&(dt="vertical",pt="top",vt="left",ut=void 0),o=it.json.items,a=it.getDerivedFromVars(null===(X=it.json.item_builder)||void 0===X?void 0:X.data,void 0,!0),Y(),Y=l(a,(t=>M=t)),s=it.getDerivedFromVars(it.json.orientation),Z(),Z=l(s,(t=>I=t)),c=it.getDerivedFromVars(it.json.layout_mode),G(),G=l(c,(t=>P=t)),u=it.getDerivedFromVars(it.json.content_alignment_vertical),q(),q=l(u,(t=>S=t)),d=it.getDerivedFromVars(it.json.content_alignment_horizontal),H(),H=l(d,(t=>D=t)),p=it.getDerivedFromVars(it.json.separator),W(),W=l(p,(t=>V=t)),v=it.getDerivedFromVars(it.json.line_separator),L(),L=l(v,(t=>F=t)),g=it.getDerivedFromVars(it.json.aspect),U(),U=l(g,(t=>A=t)),h=it.getDerivedFromVars(it.json.width),N(),N=l(h,(t=>C=t)),m=it.getDerivedFromVars(it.json.height),B(),B=l(m,(t=>j=t)),y=it.getDerivedFromVars(it.json.clip_to_bounds),T(),T=l(y,(t=>E=t));{let t=[];if(it.json.item_builder&&Array.isArray(M)&&Array.isArray(it.json.item_builder.prototypes)){const e=it.json.item_builder;t=[],M.forEach((n=>{if(null===n||"object"!=typeof n)return;const r=lt.preparePrototypeVariables(e.data_element_name||"it",n);let o;for(let t=0;t<e.prototypes.length;++t){const n=e.prototypes[t];if(n.div){if(void 0===n.selector){o=n.div;break}if(it.getJsonWithVars(n.selector,r)){o=n.div;break}}}o&&t.push({div:o,vars:r})}))}else t=(o||[]).map((t=>({div:t})));yt=t.map(((t,e)=>it.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];yt.forEach((e=>{t.push(it.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),ct=K(t,(t=>[...t])),J(),J=l(ct,(t=>O=t))}if(dt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(I,dt),b="wrap"===P,_="horizontal"!==dt&&!b&&O.some(_e),w="vertical"!==dt&&!b&&O.some(we),pt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(S,pt),vt=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(D,vt),(null==V?void 0:V.style)&&"overlap"!==dt&&ke()){const t=$e(V.style,Se,(null==gt?void 0:gt.style)||null);gt=t?{show_at_start:Boolean(null!==(Q=V.show_at_start)&&void 0!==Q&&Q),show_at_end:Boolean(null!==(tt=V.show_at_end)&&void 0!==tt&&tt),show_between:Boolean(null===(et=V.show_between)||void 0===et||et),style:t,margins:me(V.margins)}:null}else gt=null;if((null==F?void 0:F.style)&&"overlap"!==dt&&ke()){const t=$e(F.style,Se,(null==ft?void 0:ft.style)||null);ft=t?{show_at_start:Boolean(null!==(nt=F.show_at_start)&&void 0!==nt&&nt),show_at_end:Boolean(null!==(rt=F.show_at_end)&&void 0!==rt&&rt),show_between:Boolean(null===(ot=F.show_between)||void 0===ot||ot),style:t,margins:me(F.margins)}:null}else ft=null;$=gt||ft?function(t,e,n){const r={};return ye(r,e,"vertical"===t),ye(r,n,"horizontal"===t),r}(dt,gt,ft):null;{const t=null==A?void 0:A.ratio;ut=t&&Yt(t)?t:void 0}{let t={};"overlap"===dt&&(t.overlapParent=!0),"horizontal"!==dt&&(t.parentHAlign=b?"start":Ve[vt]),"vertical"!==dt&&(t.parentVAlign=b?"start":De[pt]),ut||w||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==st?void 0:st.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!_&&("wrap_content"===(null==C?void 0:C.type)||"match_parent"===(null==C?void 0:C.type)&&(null==st?void 0:st.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===dt&&(t.parentContainerOrientation="horizontal"),"vertical"===dt&&(t.parentContainerOrientation="vertical"),b&&(t.parentContainerWrap=!0),ht=Tt(t,ht)}return x={orientation:dt,valign:pt,halign:vt,wrap:b,overflow:!1===E||0===E?"visible":void 0},k={gap:gt||ft?be(dt,gt,ft):void 0,"aspect-ratio":ut},T(),N(),B(),U(),L(),W(),H(),q(),J(),G(),Z(),Y(),`${R(re,"Outer").$$render(t,{cls:At("container",he,x),componentContext:it,layoutParams:st,style:k,additionalPaddings:$,heightByAspect:Boolean(ut),parentOf:yt.map((t=>t.json)),replaceItems:function(t){it=Object.assign(Object.assign({},it),{json:Object.assign(Object.assign({},it.json),{items:t.filter(mt)})})}},{},{default:()=>`${z(yt,(e=>`${R(xr,"Unknown").$$render(t,{componentContext:e,layoutParams:ht},{},{})}`))} ${gt||ft?`${R(Fe,"ContainerSeparators").$$render(t,{separator:gt,lineSeparator:ft,orientation:dt,contentHAlign:vt,contentVAlign:pt},{},{})}`:""}`})}`})),Pe=Oe,Ie={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Me(t,e){return"vertical"===t||"horizontal"===t?t:e}const Te=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,v=i,{componentContext:g}=e,{layoutParams:f}=e,h="horizontal",m="rgba(0,0,0,0.08)";return void 0===e.componentContext&&n.componentContext&&void 0!==g&&n.componentContext(g),void 0===e.layoutParams&&n.layoutParams&&void 0!==f&&n.layoutParams(f),g.json&&(h="horizontal",m="rgba(0,0,0,0.08)"),o=g.getDerivedFromVars(g.json.delimiter_style),v(),v=l(o,(t=>p=t)),h=Me(null==p?void 0:p.orientation,h),a=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),m=gt(null==p?void 0:p.color,1,m),s="horizontal"===h?"100%":dt(1),c="horizontal"===h?dt(1):"100%",u={background:m,width:s,height:c},d={orientation:h},v(),`${R(re,"Outer").$$render(t,{cls:At("separator",Ie,d),componentContext:g,layoutParams:f},{},{default:()=>a?`<span${W("class",Ie.separator__inner,0)}${W("style",ut(u),0)}></span>`:""})}`})),ze={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function Ne(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Re="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Be=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,I,M,T,z,N,B,U=i,L=i,H=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,K=i,tt=i,et=i,nt=i,rt=i,{componentContext:ot}=e,{layoutParams:it}=e;const lt=f(at);let ct,dt,pt,vt=0,ft=!1,ht="rgba(0,0,0,0.08)",mt=!1,yt="",bt="none",_t="50% 50%",xt="0",kt="source_in",Et="",Ct="",jt=0,Ft=0,Vt=0,Dt="",St="";v((()=>{lt.removeSvgFilter(pt,kt)})),void 0===e.componentContext&&n.componentContext&&void 0!==ot&&n.componentContext(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==it&&n.layoutParams(it),ot.json&&(bt="none",_t="50% 50%",kt="source_in"),o=ot.getDerivedFromVars(ot.json.image_url),nt(),nt=l(o,(t=>N=t)),a=ot.getDerivedFromVars(ot.json.gif_url),rt(),rt=l(a,(t=>B=t)),s=ot.getDerivedFromVars(ot.json.width),et(),et=l(s,(t=>z=t)),c=ot.getDerivedFromVars(ot.json.height),tt(),tt=l(c,(t=>T=t)),u=ot.getDerivedFromVars(ot.json.preview),K(),K=l(u,(t=>M=t)),d=ot.getDerivedFromVars(ot.json.placeholder_color),Q(),Q=l(d,(t=>I=t)),p=ot.getDerivedFromVars(ot.json.scale),X(),X=l(p,(t=>P=t)),g=ot.getDerivedFromVars({content_alignment_horizontal:ot.json.content_alignment_horizontal,content_alignment_vertical:ot.json.content_alignment_vertical}),Y(),Y=l(g,(t=>O=t)),h=ot.getDerivedFromVars(ot.json.accessibility),Z(),Z=l(h,(t=>S=t)),m=ot.getDerivedFromVars(ot.json.aspect),G(),G=l(m,(t=>D=t)),y=ot.getDerivedFromVars(ot.json.tint_color),J(),J=l(y,(t=>V=t)),b=ot.getDerivedFromVars(ot.json.tint_mode),H(),H=l(b,(t=>F=t)),_=ot.getDerivedFromVars(ot.json.appearance_animation),L(),L=l(_,(t=>A=t)),w=ot.getDerivedFromVars(ot.json.filters),U(),U=l(w,(t=>j=t));{let t="gif"===ot.json.type?B:N;ft="empty://"===t,ft&&(t=Re),dt=t}vt=0,dt?mt=!1:(mt=!0,ot.logError(st(new Error(`Missing "${"gif"===ot.json.type?"gif_url":"image_url"}" for "${ot.json.type}"`)))),$="wrap_content"===(null==z?void 0:z.type),x="wrap_content"===(null==T?void 0:T.type),yt=M?`url("${Ne(M)}")`:"",ht=gt(I,1,ht),bt=wt(P)||bt,_t=function(t,e){const n=t.content_alignment_horizontal,r=t.content_alignment_vertical;return n&&"left"!==n&&"center"!==n&&"right"!==n||r&&"top"!==r&&"center"!==r&&"bottom"!==r?e:$t(t)}(O,_t),k=(null==S?void 0:S.description)||"";{const t=null==D?void 0:D.ratio;xt=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}{const t=V?gt(V):void 0,e=ve(F,kt);t===pt&&e===kt||(lt.removeSvgFilter(pt,kt),Et=t?lt.addSvgFilter(t,e):"",pt=t,kt=e)}if(A&&"fade"===A.type){const t=A;Ct=zt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Vt=Pt(t.duration,300),Ft=Pt(t.start_delay,0),jt=Pt(t.alpha,0)}{let t="",e="";Array.isArray(j)&&j.length&&(t=Xt(j,ot.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Dt=t,St=e}return E={aspect:"0"!==xt,"is-width-content":$,"is-height-content":x,loaded:!1,"before-appearance":Boolean(Ct)&&!0},C={"background-image":yt,"background-color":yt?void 0:ht,"background-size":bt,"clip-path":St||void 0,"object-fit":bt,"object-position":_t,filter:["",Dt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Ct||void 0,"--divkit-appearance-fade-start":Ct?jt:void 0,"--divkit-appearance-delay":Ct?`${Ft}ms`:void 0,"--divkit-appearance-duration":Ct?`${Vt}ms`:void 0},U(),L(),H(),J(),G(),Z(),Y(),X(),Q(),K(),tt(),et(),nt(),rt(),mt?"":`${R(re,"Outer").$$render(t,{cls:At("image",ze,E),componentContext:ot,layoutParams:it,customDescription:!0},{},{default:()=>E.aspect?`<span${W("class",ze["image__aspect-wrapper"],0)}${q({"padding-bottom":`${xt}%`})}><img${W("class",ze.image__image,0)}${W("src",dt,0)} loading="lazy" decoding="async"${W("style",ut(C),0)}${W("alt",k,0)}${W("aria-hidden",k?null:"true",0)}${W("this",ct,0)}></span>`:`<img${W("class",ze.image__image,0)}${W("src",dt,0)} loading="lazy" decoding="async"${W("style",ut(C),0)}${W("alt",k,0)}${W("aria-hidden",k?null:"true",0)}${W("this",ct,0)}>`})}`})),Ue={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function Le(t){return t>0&&t<1}function We(t){return String(Math.ceil(1e3*t)/1e3)}function He(t,e,n){if(t.some(Le)){const e=Math.max(...t.filter(Le).map((t=>1/t)));t=t.map((t=>t*e))}let r=0,o=0;const i=[];if(t.every(Boolean)){o=t.reduce(((t,e)=>t+e),0);for(let i=0;i<n;++i){if(!e[i])continue;const n=e[i]/t[i]*o;n>r&&(r=n)}}for(let e=0;e<n;++e)r?i[e]=`minmax(${dt(r*t[e]/o)},${We(t[e])}fr)`:t[e]?i[e]=`${We(t[e])}fr`:i[e]="auto";return i.join(" ")}const qe=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,v,g,f,h,m,y,b,_=i,w=i,$=i,x=i,{componentContext:k}=e,{layoutParams:E}=e,C=1,j=[],A=[],F=[],V=[],D=0,S=!1,O="top",P="left";void 0===e.componentContext&&n.componentContext&&void 0!==k&&n.componentContext(k),void 0===e.layoutParams&&n.layoutParams&&void 0!==E&&n.layoutParams(E),k.json&&(C=1,O="top",P="left"),o=Array.isArray(k.json.items)&&k.json.items||[],a=k.getDerivedFromVars(k.json.column_count),x(),x=l(a,(t=>m=t)),s=k.getDerivedFromVars(k.json.content_alignment_vertical),w(),w=l(s,(t=>f=t)),c=k.getDerivedFromVars(k.json.content_alignment_horizontal),_(),_=l(c,(t=>g=t)),C=ie(m,C),u=o.map(((t,e)=>k.produceChildContext(t,{path:e})));{let t=[];u.forEach((e=>{t.push(k.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),y=K(t,(t=>[...t])),$(),$=l(y,(t=>h=t))}{const t={};let e=0,n=0;j=[],A=[],F=[],V=[],S=!1,b=u.map(((r,o)=>{var i,a,s,l;const c=h[o],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,p={x:e,y:n,colSpan:u,rowSpan:d},v="match_parent"===(null===(i=c.width)||void 0===i?void 0:i.type)?Number(c.width.weight||1)/u:0,g="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,m=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let r=e;r<e+u;++r)for(let e=n;e<n+d;++e)t[r+"_"+e]?S=!0:(t[r+"_"+e]=!0,(!j[r]||j[r]<v)&&(j[r]=v),(!A[e]||A[e]<g)&&(A[e]=g),(!F[r]||F[r]<f)&&(F[r]=f),(!V[e]||V[e]<m)&&(V[e]=m));do{++e,e>=C&&(e=0,++n)}while(t[e+"_"+n]);return{componentContext:r,layoutParams:{gridArea:p}}})),0!==e&&(S=!0),S&&k.logError(st(new Error('Mismatching "grid" rows/columns'))),D=n}return O=de(f,O),P=ue(g,P),d={valign:O,halign:P},p={"grid-template-columns":He(j,F,C),"grid-template-rows":He(A,V,D)},v=S,_(),w(),$(),x(),v?"":`${R(re,"Outer").$$render(t,{cls:At("grid",Ue,d),componentContext:k,style:p,layoutParams:E,parentOf:u.map((t=>t.json)),replaceItems:function(t){k=Object.assign(Object.assign({},k),{json:Object.assign(Object.assign({},k.json),{items:t.filter(mt)})})}},{},{default:()=>`${z(b,(e=>`${R(xr,"Unknown").$$render(t,{componentContext:e.componentContext,layoutParams:e.layoutParams},{},{})}`))}`})}`})),Je=qe,Ge={gallery__scroller:"divkit-a4e39",gallery_scrollbar_none:"divkit-f49e7",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon-path":"divkit-b4173"},Ze="divkit-bf36b",Ye="divkit-a67bf",Xe="divkit-e2a31",Qe="divkit-c684b";function Ke(t){const e=[];let n=t[0],r=1;for(let o=1;o<=t.length;o++)t[o]!==n?(e.push(r>1?`repeat(${r}, ${n})`:n),n=t[o],r=1):r++;return e.join(" ")}function tn(t,e){let n;return function(...r){null!==n&&clearTimeout(n),n=setTimeout((()=>{t.apply(this,r),n=null}),e)}}const en=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,N,B,U=i,L=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,Q=i,tt=i,{componentContext:et}=e,{layoutParams:nt}=e;const rt=f(at);let it,st,lt=[],ct=!1,pt=!1,vt=null,gt=!1;const ft=rt.getCustomization("galleryLeftClass"),ht=rt.getCustomization("galleryRightClass");let yt,bt,_t,wt,$t,xt=1,kt="horizontal",Et="start",Ct=8,jt="",Ft=[],Vt={},Dt=!1,St={},It=0;N=l(rt.isDesktop,(t=>T=t));const Mt=tn((function(){if(!it)return;const t=it.scrollLeft,e=it.scrollWidth,n=it.offsetWidth;ct=t>2,pt=t+n<e-2}),50);function zt(){let t=[],e=lt[0].children.length;for(let n=0;n<e;++n)for(let e=0;e<xt;++e){const r=lt[e].children[n];r&&t.push(r)}return t}function Nt(t,e,n="smooth"){const r="horizontal"===kt,o=r?"offsetLeft":"offsetTop",i=r?"left":"top",a=t[e];a&&it.scroll({[i]:Math.max(0,a[o]+.01-Ct/2),behavior:n})}function Rt(t){const e=zt(),n=it.getBoundingClientRect(),r=e.findIndex((t=>function(t,e){return"horizontal"===kt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(n,t.getBoundingClientRect())));if(-1!==r)return r;const o=e.map((t=>function(t,e){return"horizontal"===kt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(n,t.getBoundingClientRect()))),i=o.findIndex(Boolean);return-1!==i?"prev"===t&&2===o.filter(Boolean).length?i+1:i:"prev"===t?1:e.length-2}v((()=>{gt=!1,yt&&!et.fakeElement&&(rt.unregisterInstance(yt),yt=void 0)})),void 0===e.componentContext&&n.componentContext&&void 0!==et&&n.componentContext(et),void 0===e.layoutParams&&n.layoutParams&&void 0!==nt&&n.layoutParams(nt),et.json&&(xt=1,kt="horizontal",Et="start",Ct=8,jt=""),o=Array.isArray(et.json.items)&&et.json.items||[],a=et.getDerivedFromVars(et.json.column_count),Q(),Q=l(a,(t=>M=t)),s=et.getDerivedFromVars(et.json.orientation),X(),X=l(s,(t=>P=t)),c=et.getDerivedFromVars(et.json.cross_content_alignment),Y(),Y=l(c,(t=>O=t)),u=et.getDerivedFromVars(et.json.item_spacing),Z(),Z=l(u,(t=>S=t)),d=et.getDerivedFromVars(et.json.cross_spacing),G(),G=l(d,(t=>D=t)),p=et.getDerivedFromVars(et.json.paddings),J(),J=l(p,(t=>V=t)),g=et.getDerivedFromVars(et.json.scroll_mode),H(),H=l(g,(t=>A=t)),h=et.getDerivedFromVars(et.json.restrict_parent_scroll),tt(),tt=l(h,(t=>B=t)),m=et.getDerivedFromVars(et.json.scrollbar),L(),L=l(m,(t=>j=t)),y=et.getDerivedFromVars(et.json.default_item),U(),U=l(y,(t=>C=t)),b=o.map(((t,e)=>et.produceChildContext(t,{path:e}))),_=T&&gt,_?"undefined"!=typeof ResizeObserver&&(vt=new ResizeObserver((()=>{Mt()})),vt.observe(st)):vt&&(vt.disconnect(),vt=null),xt=ie(M,xt),w=function(t,e){let n=0,r=[];for(let o=0;o<t.length;++o)r[n]||(r[n]=[]),r[n].push(t[o]),++n>=e&&(n=0);return r}(b,xt),kt=Me(P,kt),Et=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(O,Et),Ct=Pt(S,Ct),bt=dt(Ct),wt=Pt(D,Ct),_t=dt(wt),jt=Ot(V,jt),$="horizontal"===kt?"grid-template-columns":"grid-template-rows";{let t=[];b.forEach((e=>{const n="horizontal"===kt?"width":"height";t.push(et.getDerivedFromVars(e.json[n]))})),$t=K(t,(t=>t)),q(),q=l($t,(t=>F=t))}Ft=[],xt>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===kt||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")}));{const t={};let e={};Dt=!1,"horizontal"===kt?e.parentVAlign=Et:e.parentHAlign=Et,"paging"===A&&(Dt=!0,e.scrollSnap="start",t["horizontal"===kt?"scroll-padding-left":"scroll-padding-top"]=dt(Ct/2)),1===xt&&(e.parentLayoutOrientation=kt),Vt=Tt(t,Vt),St=Tt(e,St)}return x={padding:jt,"grid-gap":_t},k={"grid-gap":bt,[$]:Ke(Ft)},E={orientation:kt,"scroll-snap":Dt,scrollbar:"auto"===j?"auto":"none"},It=Pt(C,It),et.json&&Mt(),et.json&&(yt&&(rt.unregisterInstance(yt),yt=void 0),et.json.id&&!et.fakeElement&&(yt=et.json.id,rt.registerInstance(yt,{setCurrentItem(t){const e=zt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Nt(e,t)},setPreviousItem(t){const e=Rt("prev"),n=zt();let r=e-1;r<0&&(r="ring"===t?n.length-1:e),Nt(n,r)},setNextItem(t){const e="horizontal"===kt?it.scrollLeft+it.offsetWidth===it.scrollWidth:it.scrollTop+it.offsetHeight===it.scrollHeight,n=zt();if(e&&"ring"===t)return void Nt(n,0);const r=Rt("next");let o=r+1;o>n.length-1&&(o="ring"===t?0:r),Nt(n,o)}}))),U(),L(),H(),q(),J(),G(),Z(),Y(),X(),Q(),N(),tt(),` ${R(re,"Outer").$$render(t,{cls:At("gallery",Ge,E),componentContext:et,layoutParams:nt,customPaddings:!0,customActions:"gallery",parentOf:o,replaceItems:function(t){et=Object.assign(Object.assign({},et),{json:Object.assign(Object.assign({},et.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ge.gallery__scroller,!0)+" "+I(B?ot:"",!0)}"${W("style",ut(Vt),0)}${W("this",it,0)}><div${W("class",Ge["gallery__items-grid"],0)}${W("style",ut(x),0)}${W("this",st,0)}>${z(w,((e,n)=>`<div${W("class",Ge.gallery__items,0)}${W("style",ut(k),0)}${W("this",lt[n],0)}>${z(e,(e=>`${R(xr,"Unknown").$$render(t,{componentContext:e,layoutParams:St},{},{})}`))} </div>`))}</div></div> ${"horizontal"===kt?`${ct&&_?` <div${W("class",ft||`${Ge.gallery__arrow} ${Ze} ${Xe}`,0)}>${ft?"":`<svg${W("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Ge["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${pt&&_?` <div${W("class",ht||`${Ge.gallery__arrow} ${Ze} ${Qe}`,0)}>${ht?"":`<svg${W("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",Ge["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`})),nn=en,rn={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},on=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,M,T=i,N=i,B=i,U=i,L=i,H=i,J=i,G=i,Z=i;var Y,X;let{componentContext:K}=e,{layoutParams:tt}=e;const et=f(at),nt=et.genId("tabs");let rt,it=!1,lt=Q([]);C=l(lt,(t=>E=t));let ct,vt,ft,ht,mt,yt,bt,_t={},wt=12,$t="",xt="",kt="",Et="",Ct="",jt="",Ft="",Dt="",It="",Mt="",zt=0,Nt="",Rt="",Wt=null,Ht=!1,qt=!1,Jt=[],Zt=[],Xt=null;async function Qt(t,e=!1){if(yt=_,_=t,Ht||(Ht=!0,vt.style.height=dt(vt.clientHeight),ft.style.transform=`translate3d(${100*-(null!=yt?yt:_)}%,0,0)`),qt=!0,async function(t){await $(),ft.style.transform=`translate3d(${t}%,0,0)`}(100*-_),function(t=!1){const e=t?Math.max(0,_-1):Math.min(_,null!=yt?yt:_),n=t?Math.min(o.length-1,_+1):Math.max(_,null!=yt?yt:_);Jt=Jt.map(((t,r)=>{var i;return t||(r>=e&&r<=n&&(null===(i=o[r])||void 0===i?void 0:i.div)?K.produceChildContext(o[r].div,{path:r}):void 0)})),Zt=Zt.map(((t,r)=>r>=e&&r<=n))}(),async function(){await $();const t=document.getElementById(`${nt}-panel-${_}`);t&&(vt.style.height=dt(t.offsetHeight))}(),Xt&&clearTimeout(Xt),Xt=window.setTimeout((()=>{Zt=o.map(((t,e)=>e===_))}),400),bt=-_*vt.clientWidth,e){await $();const t=ct.querySelector(`.${rn.tabs__item_selected}`);t&&t.focus()}}if(v((()=>{rt&&(et.unregisterInstance(rt),rt=void 0)})),void 0===e.componentContext&&n.componentContext&&void 0!==K&&n.componentContext(K),void 0===e.layoutParams&&n.layoutParams&&void 0!==tt&&n.layoutParams(tt),K.json&&(wt=12,$t="",Et="",ht=void 0,Ct="",mt=void 0,jt="",Ft="",Dt="",It="",Mt="",zt=0,Nt="",Rt="",Wt=null),o=K.json.items||[],a=o.map((t=>t.div)),s=K.getDerivedFromVars(K.json.width),G(),G=l(s,(t=>P=t)),c=K.getDerivedFromVars(K.json.height),J(),J=l(c,(t=>O=t)),u=K.getJsonWithVars(K.json.selected_tab),d=K.getDerivedFromVars(K.json.tab_title_style),H(),H=l(d,(t=>S=t)),p=K.getDerivedFromVars(K.json.has_separator),L(),L=l(p,(t=>D=t)),g=K.getDerivedFromVars(K.json.separator_color),U(),U=l(g,(t=>V=t)),h=K.getDerivedFromVars(K.json.separator_paddings),B(),B=l(h,(t=>F=t)),m=K.getDerivedFromVars(K.json.switch_tabs_by_content_swipe_enabled),N(),N=l(m,(t=>A=t)),y=K.getDerivedFromVars(K.json.restrict_parent_scroll),Z(),Z=l(y,(t=>M=t)),b=K.getDerivedFromVars(K.json.title_paddings),T(),T=l(b,(t=>j=t)),_=u&&Number(u)||0,Array.isArray(o)&&o.length){let t=[];o.forEach(((e,n)=>{const r=K.getJsonWithVars({index:n,title:e.title,title_click_action:e.title_click_action});r.title&&"string"==typeof r.title?t.push(r):K.logError(st(new Error("Incorrect title for the tab"),{additional:{index:n}}))})),lt.set(t)}else lt.set([]);(null==E?void 0:E.length)?it=!1:(it=!0,K.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={};"wrap_content"===(null==P?void 0:P.type)&&(t.parentHorizontalWrapContent=!0),O&&"wrap_content"!==O.type||(t.parentVerticalWrapContent=!0),_t=Tt(t,_t)}if(!it&&(_<0||_>=o.length)&&(K.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:K.json.selected_tab,length:o.length}})),_=_<0?0:o.length-1),it||E.some((t=>_===t.index))||(K.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:K.json.selected_tab}})),_=(null===(Y=E[0])||void 0===Y?void 0:Y.index)||0),w=S||{},wt=ie(w.font_size,wt),w.font_size||w.paddings){const t=w.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/wt*10,right:(Number(t.right)||0)/wt*10,bottom:(Number(t.bottom)||0)/wt*10,left:(Number(t.left)||0)/wt*10};$t=Ot(e,$t)}{const t=w.line_height;void 0!==t&&Yt(t)&&(xt=dt(t/wt*10))}{const t=w.letter_spacing;void 0!==t&&St(t)&&(kt=dt(t/wt*10))}if(w.corner_radius||w.corners_radius||w.font_size){const t=null!==(X=w.corner_radius)&&void 0!==X?X:1e3;w.corners_radius?Et=function(t,e,n,r){const o=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<o.length;++t)if(o[t]&&!St(o[t]))return r;return Ut(t,e,n)}(w.corners_radius,t,wt,Et):St(t)&&(Et=dt(t/wt*10))}return ht=se(w.active_font_weight||w.font_weight,ht),Ct=w.font_family&&"string"==typeof w.font_family?et.typefaceProvider(w.font_family,{fontWeight:ht||400}):"",mt=se(w.inactive_font_weight||w.font_weight,mt),jt=w.font_family&&"string"==typeof w.font_family?et.typefaceProvider(w.font_family,{fontWeight:mt||400}):"",Ft=gt(w.active_text_color,1,Ft),Dt=gt(w.inactive_text_color,1,Dt),It=gt(w.active_background_color,1,It),Mt=gt(w.inactive_background_color,1,Mt),zt=Pt(w.item_spacing,zt),D&&(V&&(Nt=gt(V,1,Nt)),F&&(Rt=Ot(F,Rt))),x={background:Nt,margin:Rt},k=void 0===A||Boolean(A),Wt=Bt(j||void 0,Wt),function(t){it||(Jt=t.map(((t,e)=>{if(e===_&&(null==t?void 0:t.div))return K.produceChildContext(t.div,{path:e})})),Zt=t.map(((t,e)=>e===_)))}(o),K.json&&(rt&&(et.unregisterInstance(rt),rt=void 0),!K.json.id||it||K.fakeElement||(rt=K.json.id,et.registerInstance(rt,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Qt(t)},setPreviousItem(t){let e=_-1;e<0&&(e="ring"===t?o.length-1:_),Qt(e)},setNextItem(t){let e=_+1;e>o.length-1&&(e="ring"===t?0:_),Qt(e)}}))),C(),T(),N(),B(),U(),L(),H(),J(),G(),Z(),it?"":`${R(re,"Outer").$$render(t,{cls:At("tabs",rn,{}),componentContext:K,layoutParams:tt,customActions:"tabs",parentOf:a,parentOfSimpleMode:!0,replaceItems:function(t){K.json.items&&(K=Object.assign(Object.assign({},K),{json:Object.assign(Object.assign({},K.json),{items:K.json.items.map(((e,n)=>Object.assign(Object.assign({},e),{div:t[n]})))})}))}},{},{default:()=>` <div class="${I(rn.tabs__list,!0)+" "+I(M?ot:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":Wt?Vt(Wt):"","--divkit-tabs-font-size":dt(wt),"--divkit-tabs-paddings":$t,"--divkit-tabs-line-height":xt,"--divkit-tabs-letter-spacing":kt,"--divkit-tabs-active-font-weight":ht||"","--divkit-tabs-inactive-font-weight":mt||"","--divkit-tabs-active-font-family":Ct||"","--divkit-tabs-inactive-font-family":jt||"","--divkit-tabs-active-text-color":Ft,"--divkit-tabs-inactive-text-color":Dt,"--divkit-tabs-active-background-color":It,"--divkit-tabs-inactive-background-color":Mt,"--divkit-tabs-border-radius":Et,"--divkit-tabs-items-spacing":zt?pt(zt):""})}${W("this",ct,0)}>${z(E,(e=>{let n=e.index,r=n===_;return` ${R(Gt,"Actionable").$$render(t,{componentContext:K,cls:At("tabs__item",rn,{selected:r,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!K.fakeElement?[e.title_click_action].filter(Lt):[],attrs:{id:`${nt}-tab-${n}`,"aria-controls":`${nt}-panel-${n}`,role:"tab",tabindex:r&&!K.fakeElement?e.title_click_action?void 0:"0":"-1","aria-selected":r?"true":"false"},customAction:K.fakeElement?null:t=>function(t,e){return _===e||(Qt(e),!1)}(0,n)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${D?`<div${W("class",rn.tabs__separator,0)}${W("style",ut(x),0)}></div>`:""} <div class="${I(rn.tabs__panels,!0)+" "+I(M?ot:"",!0)}"${W("this",vt,0)}><div${W("class",At("tabs__swiper",rn,{inited:Ht,animated:qt}),0)}${W("this",ft,0)}>${z(E,(e=>{let n=e.index,r=Jt[n];return` <div${W("class",At("tabs__panel",rn,{visible:Zt[n]}),0)} role="tabpanel" id="${I(nt,!0)+"-panel-"+I(n,!0)}" aria-labelledby="${I(nt,!0)+"-tab-"+I(n,!0)}" style="${"left: "+I(100*n,!0)+"%"}">${r?`${R(xr,"Unknown").$$render(t,{componentContext:r,layoutParams:_t},{},{})}`:""} </div>`}))}</div></div>`})}`})),an=on,sn="divkit-eb860",ln="divkit-e08c6";function cn(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const n=e*t.length,r=Math.floor(n),o=n-r;return t[r]*o+t[r+1]*(1-o)}}function un(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function dn(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...dn(t))})):e.push(t),e}cn([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),cn([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const pn={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},vn=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$=i,x=i,k=i,E=i,C=i;var j,A,F,V;let{ownerNode:D}=e,{data:S}=e,{internalId:O}=e,{parentComponentContext:P}=e;b=l(f(at).isDesktop,(t=>y=t)),Date.now();return v((()=>{})),void 0===e.ownerNode&&n.ownerNode&&void 0!==D&&n.ownerNode(D),void 0===e.data&&n.data&&void 0!==S&&n.data(S),void 0===e.internalId&&n.internalId&&void 0!==O&&n.internalId(O),void 0===e.parentComponentContext&&n.parentComponentContext&&void 0!==P&&n.parentComponentContext(P),o=P.produceChildContext(S.div),a=P.getDerivedFromVars(S.position),k(),k=l(a,(t=>m=t)),s=P.getDerivedFromVars(null===(A=null===(j=S.offset)||void 0===j?void 0:j.x)||void 0===A?void 0:A.value),x(),x=l(s,(t=>h=t)),c=P.getDerivedFromVars(null===(V=null===(F=S.offset)||void 0===F?void 0:F.y)||void 0===V?void 0:V.value),$(),$=l(c,(t=>g=t)),u=P.getDerivedFromVars(S.animation_in),E(),E=l(u,(t=>_=t)),d=P.getDerivedFromVars(S.animation_out),C(),C=l(d,(t=>w=t)),p={visible:!1},$(),x(),k(),b(),E(),C(),` <div class="${I(At("tooltip",pn,p),!0)+" "+I(y?rt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${W("this",undefined,0)}>${R(xr,"Unknown").$$render(t,{componentContext:o},{},{})}</div>`}));function gn(t){return"change_bounds"===t.type?t:"set"===t.type?gn(t.items[0]):null}const fn=L(((t,e,n,r)=>{let o,i,a,s,l,c,{componentContext:u}=e,{layoutParams:d}=e;const p=f(at),h=f(Ft);let m,y,b,_,w=!1,x=new Map,k=new Set,E=null,C=[],j=[],A=[],F=[],V=!1;function D(t){_=(null==t?void 0:t.div)?u.produceChildContext(t.div,{path:t.state_id||"<unknown>"}):void 0}function S(t,e,n){let{json:r,parentComponentContext:o,transitions:i,node:a}=e;r=u.getJsonWithVars(r),i=u.getJsonWithVars(i);const s=dn(i),l=a.getBoundingClientRect(),c=Object.assign(Object.assign({},r),{margins:void 0,alpha:(d=s,d.some((t=>"fade"===t.type))?void 0:r.alpha)});var d;return{json:c,componentContextCopy:o.produceChildContext(c,{fake:!0}),elementBbox:l,rootBbox:t,transitions:s,alpha:r.alpha,width:l.width,height:l.height,offsetTop:l.top-t.top,offsetLeft:l.left-t.left,direction:n,resolvePromise:e.resolvePromise,node:e.node}}async function O(t){if(b===t)return;p.setRunning("stateChange",!0);const e=new Set(k);C.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),C=[];let n=[];if(m){const t=m.getBoundingClientRect();n=A.map((e=>S(t,e,"out")))}F.forEach((t=>{x.set(t.id,t.node.getBoundingClientRect())})),j=[],A=[],F=[];const r=l.find((e=>e.state_id===t))||null;if(r?(b=t,null==s||s.setValue(b),D(r)):u.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!m)return;const o=m.getBoundingClientRect();let i=j.filter((t=>{var n;return!(!t.json.id||e.has(t.json.id))||(null===(n=t.resolvePromise)||void 0===n||n.call(t),!1)})).map((t=>S(o,t,"in")));n=n.filter((t=>{var e;return!(!t.json.id||k.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const a=n.concat(i),c=a.reduce(((t,e)=>Math.max(t,un(e.transitions))),0),d=F.filter((t=>x.has(t.id))).map((t=>{const e=Object.assign(Object.assign({},t.json),{margins:void 0,width:{type:"match_parent"},height:{type:"match_parent"}});return{json:e,componentContextCopy:t.parentComponentContext.produceChildContext(e,{fake:!0}),rootBbox:o,beforeBbox:x.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:u.getJsonWithVars(gn(t.transitions)),resolvePromise:t.resolvePromise}}));C=[...a.map((t=>Object.assign(Object.assign({},t),{maxDuration:c}))),...d],x.clear(),p.setRunning("stateChange",!1)}return g(Ft,{registerInstance(t,e){E||(E=new Map),E.has(t)?u.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):E.set(t,e)},unregisterInstance(t){null==E||E.delete(t)},runVisibilityTransition(t,e,n,r,o){if(!m)return Promise.resolve();const i=S(m.getBoundingClientRect(),{json:t,parentComponentContext:e,transitions:n,node:r},o),a=un(i.transitions),s=Object.assign(Object.assign({},i),{maxDuration:a});return C=[...C.filter((t=>t.node!==i.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,n,r){const o={json:t,parentComponentContext:e,transitions:n,node:r};return j.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionOut(t,e,n,r){const o={json:t,parentComponentContext:e,transitions:n,node:r};return A.push(o),new Promise((t=>{o.resolvePromise=t}))},registerChildWithTransitionChange(t,e,n,r){const o=t.id;if(!o)return Promise.resolve();const i={id:o,json:t,parentComponentContext:e,transitions:n,node:r};return F.push(i),new Promise((t=>{i.resolvePromise=t}))},hasTransitionChange:t=>!!t&&x.has(t),registerChild(t){k.add(t)},unregisterChild(t){k.delete(t)}}),v((()=>{y&&h.unregisterInstance(y)})),void 0===e.componentContext&&n.componentContext&&void 0!==u&&n.componentContext(u),void 0===e.layoutParams&&n.layoutParams&&void 0!==d&&n.layoutParams(d),o=u.json.div_id||u.json.id,i=u.getJsonWithVars(u.json.default_state_id),a=u.json.state_id_variable,s=a?u.getVariable(a,"string"):null,u.json&&(V=!1),o?w=!1:(w=!0,u.logError(st(new Error('Missing "id" prop for div "state"')))),u.json&&(k=new Set),l=u.json.states||[],c=l.map((t=>t.div)),(null==l?void 0:l.length)?w=!1:(w=!0,u.logError(st(new Error('Empty "states" prop for div "state"')))),u.json&&(y&&(h.unregisterInstance(y),y=void 0),o&&!(null==u?void 0:u.fakeElement)&&(y=o,h.registerInstance(o,{setState:O,getChild:function(t){if(E&&E.has(t))return E.get(t);u.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}))),!V&&function(t){if(!V&&(V=!0,t.length)){const e=(null==s?void 0:s.getValue())||i;if(e){b=e;const n=t.find((t=>t.state_id===b))||null;D(n),n||u.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:b}}))}else{const e=t[0];b=e.state_id,D(e)}s&&(s.setValue(b),s.subscribe((t=>{O(t)})))}}(l),w?"":`${R(re,"Outer").$$render(t,{cls:"divkit-b8efc",componentContext:u,layoutParams:d,parentOf:c,parentOfSimpleMode:!0,replaceItems:function(t){const e=u.json.states;if(!e)return;const n=e.map(((e,n)=>Object.assign(Object.assign({},e),{div:t[n]})));u.json=Object.assign(Object.assign({},u.json),{states:n}),b&&D(n.find((t=>t.state_id===b))||null)}},{},{default:()=>`${_?`${R(xr,"Unknown").$$render(t,{componentContext:_},{},{})}`:""} <div${W("class","divkit-adaae",0)} aria-hidden="true"${W("this",m,0)}>${z(C,(e=>"direction"in e?`<div${W("class",sn,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${W("class",ln,0)}>${R(xr,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${W("class",sn,0)}><div${W("class",ln,0)}>${R(xr,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})} ${null!=u&&u.tooltips?`${z(u.tooltips,(e=>`${R(vn,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:u},{},{})}`))}`:""}`})),hn=fn,mn={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f",pager__arrow:"divkit-d78c2","pager__arrow-icon-path":"divkit-a94d9"},yn=L(((t,e,n,r)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D=i,S=i,O=i,P=i,M=i,T=i;var N,B,U,L,H,q;let{componentContext:J}=e,{layoutParams:G}=e;const Z=f(at),Y=Z.genId("pager"),X=Z.getCustomization("pagerLeftClass"),Q=Z.getCustomization("pagerRightClass");E=l(Z.isDesktop,(t=>k=t)),tn((function(){if(!et)return;const t=function(){const t=Array.from(tt.children),e=tt.getBoundingClientRect(),n=t.findIndex((t=>{return n=e,r=t.getBoundingClientRect(),"horizontal"===lt?r.left>=n.left&&r.right<=n.right:r.top>=n.top&&r.bottom<=n.bottom;var n,r}));return-1!==n?n:nt}();t!==nt&&(nt=t)}),50);let K,tt,et=!1,nt=0,rt=0,it=!1,lt="horizontal",ct="",vt="",gt="";function ft(t,e="smooth"){const n="horizontal"===lt,r=tt.children[t],o=n?"offsetLeft":"offsetTop",i=n?"left":"top";tt.scroll({[i]:r[o],behavior:e}),nt=t}v((()=>{et=!1,K&&(Z.unregisterInstance(K),K=void 0)})),void 0===e.componentContext&&n.componentContext&&void 0!==J&&n.componentContext(J),void 0===e.layoutParams&&n.layoutParams&&void 0!==G&&n.layoutParams(G),J.json&&(vt=""),o=J.getDerivedFromVars(J.json.layout_mode),S(),S=l(o,(t=>C=t)),a=J.getDerivedFromVars(J.json.orientation),M(),M=l(a,(t=>F=t)),s=J.getDerivedFromVars(J.json.item_spacing),P(),P=l(s,(t=>A=t)),u=J.getDerivedFromVars(J.json.paddings),O(),O=l(u,(t=>j=t)),d=J.getDerivedFromVars(J.json.restrict_parent_scroll),T(),T=l(d,(t=>V=t)),p=(Array.isArray(J.json.items)&&J.json.items||[]).map(((t,e)=>J.produceChildContext(t,{path:e}))),C?"percentage"!==C.type&&"fixed"!==C.type?(it=!0,J.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!0,J.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),lt=Me(F,lt);{const t=null==A?void 0:A.value;t&&St(t)&&(ct=dt(t||0))}if(vt=Ot(j,vt),g="horizontal"===lt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==C?void 0:C.type)){const t=pt("horizontal"===lt?((null===(N=J.json.paddings)||void 0===N?void 0:N.left)||0)+((null===(B=J.json.paddings)||void 0===B?void 0:B.right)||0):((null===(U=J.json.paddings)||void 0===U?void 0:U.top)||0)+((null===(L=J.json.paddings)||void 0===L?void 0:L.bottom)||0)),e=null===(H=C.neighbour_page_width)||void 0===H?void 0:H.value;gt=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${ct})`:"100%"}else if("percentage"===(null==C?void 0:C.type)){const t=null===(q=C.page_width)||void 0===q?void 0:q.value;gt=`${Number(t)}%`}return h={"grid-gap":ct,padding:vt,[g]:gt},m={orientation:lt},y=it,b=k&&et&&!y,_=nt>0,w=nt+1<p.length,$=Z.getStore("pagers"),D(),D=l($,(t=>x=t)),function(t,e){const n=J.json.id;if(n){const r=new Map(x);c($,x=r.set(n,{instId:Y,size:t,currentItem:e,scrollToPagerItem:ft}),x)}}(p.length,nt),function(t){var e;if(t===rt)return;rt=t;const n=J.getJsonWithVars(null===(e=p[t].json)||void 0===e?void 0:e.selected_actions);(null==n?void 0:n.length)&&J.execAnyActions(n)}(nt),J.json&&(K&&(Z.unregisterInstance(K),K=void 0),J.json.id&&!J.fakeElement&&(K=J.json.id,Z.registerInstance(K,{setCurrentItem(t){if(t<0||t>p.length-1)throw new Error('Item is out of range in "set-current-item" action');ft(t)},setPreviousItem:function(t){let e=nt-1;e<0&&(e="ring"===t?p.length-1:nt),ft(e)},setNextItem:function(t){let e=nt+1;e>p.length-1&&(e="ring"===t?0:nt),ft(e)}}))),D(),E(),S(),O(),P(),M(),T(),y?"":`${R(re,"Outer").$$render(t,{cls:At("pager",mn,m),componentContext:J,layoutParams:G,customPaddings:!0,parentOf:p.map((t=>t.json)),replaceItems:function(t){J=Object.assign(Object.assign({},J),{json:Object.assign(Object.assign({},J.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(mn.pager__items,!0)+" "+I(V?ot:"",!0)}"${W("style",ut(h),0)}${W("this",tt,0)}>${z(p,(e=>`<div${W("class",mn.pager__item,0)}>${R(xr,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${_&&b?` <div${W("class",X||`${mn.pager__arrow} ${Ze} ${Xe}`,0)}>${X?"":`<svg${W("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",mn["pager__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${w&&b?` <div${W("class",Q||`${mn.pager__arrow} ${Ze} ${Qe}`,0)}>${Q?"":`<svg${W("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${W("class",mn["pager__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`})}`})),bn=yn,_n={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},wn=["rounded_rectangle","circle"],$n=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,j=i,A=i,F=i,V=i,D=i,S=i,O=i,P=i,M=i;var T,N;let{componentContext:B}=e,{layoutParams:U}=e;const L=f(at);let H,J,G,Z={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Y={width:10,height:10,borderRadius:5,background:"#33919cb5"},X="default",Q=15,K=10,et=5;if(void 0===e.componentContext&&n.componentContext&&void 0!==B&&n.componentContext(B),void 0===e.layoutParams&&n.layoutParams&&void 0!==U&&n.layoutParams(U),B.json&&(X="default",Q=15,K=10,et=5,Z={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Y={width:10,height:10,borderRadius:5,background:"#33919cb5"}),o=B.getDerivedFromVars(B.json.shape),S(),S=l(o,(t=>x=t)),a=B.getDerivedFromVars(B.json.active_item_color),V(),V=l(a,(t=>_=t)),s=B.getDerivedFromVars(B.json.inactive_item_color),D(),D=l(s,(t=>w=t)),c=B.getDerivedFromVars(B.json.active_item_size),O(),O=l(c,(t=>k=t)),u=B.getDerivedFromVars(B.json.active_shape),M(),M=l(u,(t=>C=t)),d=B.getDerivedFromVars(B.json.inactive_shape),P(),P=l(d,(t=>E=t)),p=B.getDerivedFromVars(B.json.space_between_centers),A(),A=l(p,(t=>y=t)),v=B.getDerivedFromVars(B.json.items_placement),F(),F=l(v,(t=>b=t)),C&&(Z=$e({type:"shape_drawable",shape:C},wn,Z)),E&&(Y=$e({type:"shape_drawable",shape:E},wn,Y)),!C&&!E&&x){const t=ie(k,1.3);Y=$e({type:"shape_drawable",shape:x,color:Y.background},wn,Y),Y.background=gt(w,1,Y.background),Z=Object.assign(Object.assign({},Y),{width:Y.width*t,height:Y.height*t,borderRadius:Y.borderRadius*t,background:Z.background}),Z.background=gt(_,1,Z.background)}if(!b||"default"!==b.type&&"stretch"!==b.type)X="default",y&&(Q=Pt(y.value,Q));else if(X=b.type,"default"===X)Q=Pt(null===(T=b.space_between_centers)||void 0===T?void 0:T.value,Q);else if("stretch"===X){const t=b;K=ie(t.max_visible_items,K),et=Pt(null===(N=t.item_spacing)||void 0===N?void 0:N.value,et)}return g=L.getStore("pagers"),j(),j=l(g,(t=>m=t)),async function(t){if(B.json.pager_id&&t.has(B.json.pager_id)&&(G=t.get(B.json.pager_id),await $(),J)){const t=J.children[G.currentItem];if(t){const e=t.offsetLeft;H.scroll({left:e-H.clientWidth/2,behavior:"smooth"})}}}(m),h={placement:X},j(),A(),F(),V(),D(),S(),O(),P(),M(),`${R(re,"Outer").$$render(t,{cls:At("indicator",_n,h),componentContext:B,layoutParams:U},{},{default:()=>`<div${W("class",_n.indicator__scroller,0)}${W("this",H,0)}><div${W("class",_n.indicator__items,0)} role="tablist"${q({margin:"default"===X?`0 ${dt(Math.max(0,Z.width-Y.width)/2)}`:"","--divkit-indicator-inactive-width":dt(Y.width),"--divkit-indicator-inactive-height":dt(Y.height),"--divkit-indicator-inactive-border-radius":dt(Y.borderRadius),"--divkit-indicator-inactive-background":Y.background||"","--divkit-indicator-inactive-box-shadow":Y.boxShadow||"","--divkit-indicator-active-width":dt(Z.width),"--divkit-indicator-active-height":dt(Z.height),"--divkit-indicator-active-border-radius":dt(Z.borderRadius),"--divkit-indicator-active-background":Z.background||"","--divkit-indicator-active-box-shadow":Z.boxShadow||"","--divkit-indicator-active-scale":Z.width/Y.width,"--divkit-indicator-default-margin":"default"===X?`0 ${dt((Q-Y.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===X?dt(et):"","--divkit-indicator-stretch-max-count":"stretch"===X?K:"","--divkit-indicator-stretch-max-spacer":"stretch"===X?dt((K-1)*et):""})}${W("this",J,0)}>${G?`${z(Array(G.size),((t,e)=>{let n=e===G.currentItem;return` <div class="${I(At("indicator__item",_n,{active:n}),!0)+" "+I(tt,!0)}" role="tab" id="${I(G.instId,!0)+"-tab-"+I(e,!0)}" aria-controls="${I(G.instId,!0)+"-panel-"+I(e,!0)}"${W("aria-selected",n?"true":"false",0)}${W("tabindex",n?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),xn=$n,kn={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function En(t,e){if(!t||!t.font_size)return e;const n=t.offset,r=t.text_color&&gt(t.text_color)||"#000",o=ae(t.font_weight);if(Yt(t.font_size)&&"transparent"!==r){var i,a;const e={fontSize:dt(t.font_size),fontWeight:o,textColor:r};return"number"==typeof(null==n||null===(i=n.x)||void 0===i?void 0:i.value)&&"number"==typeof(null==n||null===(a=n.y)||void 0===a?void 0:a.value)&&(e.offset={x:n.x.value,y:n.y.value}),e}}function Cn(t,e,n){return Math.max(e,Math.min(n,Number(t)))}const jn="function"==typeof BigInt;function An(t){return jn?BigInt(t):Number(t)}const Fn=An("9223372036854775807"),Vn=An("-9223372036854775808");function Dn(t){const e=An(t);if(e>Fn||e<Vn)throw new Error("Integer overflow.");return e}const Sn=Dn(0);function On(t){let e=t;return e<0&&(e=-e),e}function Pn(t){let e=0;return t>0?e=1:t<0&&(e=-1),Dn(e)}class In{constructor(t,e){const n=this.convertValue(e);this.name=t,this.value=n}getName(){return this.name}subscribe(t){return this.store||(this.store=Q(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}class Mn extends In{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Tn extends In{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>Fn||t<Vn)throw new Error("Incorrect variable value");return Dn(t)}fromString(t){const e=Dn(t);return this.convertValue(e)}getType(){return"integer"}}class zn extends In{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}}class Nn extends In{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}}class Rn extends In{convertValue(t){if("string"!=typeof t||!ft(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}}class Bn extends In{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Un extends In{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}}class Ln extends In{convertValue(t){if(!Array.isArray(t))throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Array variable does not support setter from string")}getType(){return"array"}}const Wn={string:Mn,number:zn,integer:Tn,boolean:Nn,color:Rn,url:Bn,dict:Un,array:Ln};function Hn(t,e,n){if(!(e in Wn))throw new Error("Unsupported variable type");return new Wn[e](t,n)}function qn(){}function Jn(t){return t(this.value),qn}function Gn(){throw new Error("Cannot change the value of this type of variable")}const Zn={string:class extends Mn{},number:class extends zn{},integer:class extends Tn{},boolean:class extends Nn{},color:class extends Rn{},url:class extends Bn{},dict:class extends Un{},array:class extends Ln{}};for(const t in Zn){const e=Zn[t];e.prototype.subscribe=Jn,e.prototype.set=Gn,e.prototype.setValue=Gn}const Yn={width:10,height:10,borderRadius:5,background:"#000"},Xn=["rounded_rectangle","circle"],Qn=["rounded_rectangle"];function Kn(t,e,n,r,o){let i=[];if(o)for(let o=t;o<e;++o)i.push((o-n)/(r-n));else{for(let e=n;e<t;++e)i.push((e-n)/(r-n));for(let t=e;t<r+1;++t)i.push((t-n)/(r-n))}return i}const tr=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,N,B,U,L,H,J,G,Z,Y,X=i,Q=i,K=i,tt=i,et=i,nt=i,rt=i,ot=i,it=i,lt=i,ct=i,ut=i,vt=i,gt=i;var ft,ht,mt,yt;let{componentContext:bt}=e,{layoutParams:_t}=e;const wt=f(at),$t=f(qt);let xt,kt,Et,Ct,jt,Ft=0,Vt=100,Dt=Yn,Ot=Dt,Pt=Yn,It=Yn,Mt=null,Tt=null,zt=jt,Rt="",Bt="",Ut=!1,Lt=Cn(G||0,Ft,Vt),Wt=Cn(J||0,Ft,Vt),Ht=!1;function Jt(){if(!kt)return;const t=Vt-Ft,e=(null==Mt?void 0:Mt.width)||0,n=(null==Tt?void 0:Tt.width)||0;Math.max(e,n)*t>=(null==kt?void 0:kt.clientWidth)?Ht||(bt.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Ht=!0):Ht=!1}tn(Jt,50),v((()=>{xt&&(wt.unregisterFocusable(xt),xt=void 0)})),void 0===e.componentContext&&n.componentContext&&void 0!==bt&&n.componentContext(bt),void 0===e.layoutParams&&n.layoutParams&&void 0!==_t&&n.layoutParams(_t),bt.json&&(Dt=Yn,Ot=Dt,Pt=Yn,It=Yn,Mt=null,Tt=null,jt=void 0,zt=void 0,Rt="",Bt=""),o=bt.json.thumb_value_variable,a=bt.json.thumb_secondary_value_variable,s=o&&bt.getVariable(o,"integer")||Hn("temp","integer",0),ut(),ut=l(s,(t=>G=t)),c=a&&bt.getVariable(a,"integer")||Hn("temp","integer",0),ct(),ct=l(c,(t=>J=t)),u=bt.getDerivedFromVars(bt.json.min_value),gt(),gt=l(u,(t=>Y=t)),d=bt.getDerivedFromVars(bt.json.max_value),vt(),vt=l(d,(t=>Z=t)),p=bt.getDerivedFromVars(bt.json.thumb_style),lt(),lt=l(p,(t=>H=t)),g=bt.getDerivedFromVars(bt.json.thumb_secondary_style),it(),it=l(g,(t=>L=t)),h=bt.getDerivedFromVars(bt.json.track_inactive_style),ot(),ot=l(h,(t=>U=t)),m=bt.getDerivedFromVars(bt.json.track_active_style),rt(),rt=l(m,(t=>B=t)),y=bt.getDerivedFromVars(bt.json.tick_mark_active_style),nt(),nt=l(y,(t=>N=t)),b=bt.getDerivedFromVars(bt.json.tick_mark_inactive_style),et(),et=l(b,(t=>T=t)),_=bt.getDerivedFromVars(bt.json.thumb_text_style),tt(),tt=l(_,(t=>M=t)),w=bt.getDerivedFromVars(bt.json.thumb_secondary_text_style),K(),K=l(w,(t=>P=t)),$=bt.getDerivedFromVars(bt.json.accessibility),Q(),Q=l($,(t=>O=t)),x=bt.getDerivedFromVars(bt.json.secondary_value_accessibility),X(),X=l(x,(t=>S=t)),Ft=Nt(Y,Ft),Vt=Nt(Z,Vt),Jt();{const t=Cn(G||0,Ft,Vt);t!==Lt&&(Lt=t)}{const t=Cn(J||0,Ft,Vt);t!==Wt&&(Wt=t)}Dt=$e(H,Xn,Dt),Ot=$e(L,Xn,Dt),Pt=$e(U,Qn,Pt),It=$e(B,Qn,It);{let t=$e(N,Xn,Yn);t!==Yn&&(Mt=t)}Mt?(Et=a?Kn(Math.min(Lt,Wt),Math.max(Lt,Wt)+1,Ft,Vt,!0):Kn(Ft,Lt,Ft,Vt,!0),Jt()):Et=[];{let t=$e(T,Xn,Yn);t!==Yn&&(Tt=t)}Tt?(Ct=a?Kn(Math.min(Lt,Wt),Math.max(Lt,Wt)+1,Ft,Vt,!1):Kn(Lt+1,Vt+1,Ft,Vt,!0),Jt()):Ct=[],jt=En(M,jt),zt=En(P,jt),(null==O?void 0:O.description)?Rt=O.description:bt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==S?void 0:S.description)?Bt=S.description:a&&bt.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;$t.hasAction()?(bt.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Dt===Yn?(bt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):It===Yn?(bt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Pt===Yn&&(bt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Ut&&(Ut=t)}return k=dt(Math.max(...[Dt.width,Ot.width,0].filter(St))),E=dt(Math.max(...[Dt.height,Ot.height,0].filter(St))),C=(Lt-Ft)/(Vt-Ft),j=a?(Wt-Ft)/(Vt-Ft):void 0,A=void 0!==j?Math.abs(j-C):C,F=void 0!==j?Math.min(j,C):0,V={"--divkit-slider-thumb-width":dt(Dt.width),"--divkit-slider-thumb-height":dt(Dt.height),"--divkit-slider-thumb-secondary-width":dt(Ot.width),"--divkit-slider-thumb-secondary-height":dt(Ot.height),"--divkit-slider-text-offset-x":(null===(ft=null==jt?void 0:jt.offset)||void 0===ft?void 0:ft.x)?pt(jt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ht=null==jt?void 0:jt.offset)||void 0===ht?void 0:ht.y)?pt(jt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(mt=null==zt?void 0:zt.offset)||void 0===mt?void 0:mt.x)?pt(zt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(yt=null==zt?void 0:zt.offset)||void 0===yt?void 0:yt.y)?pt(zt.offset.y):void 0,"--divkit-slider-tick-active-width":Mt?dt(Mt.width):void 0,"--divkit-slider-tick-active-height":Mt?dt(Mt.height):void 0,"--divkit-slider-tick-active-border-radius":Mt?dt(Mt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Mt?void 0:Mt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Mt?void 0:Mt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Tt?dt(Tt.width):void 0,"--divkit-slider-tick-inactive-height":Tt?dt(Tt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Tt?dt(Tt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Tt?void 0:Tt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Tt?void 0:Tt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":k,"--divkit-slider-max-thumb-height":E,"--divkit-slider-track-part":C,"--divkit-slider-track-secondary-part":j},D={},bt.json,X(),Q(),K(),tt(),et(),nt(),rt(),ot(),it(),lt(),ct(),ut(),vt(),gt()," "+(Ut?"":`${R(re,"Outer").$$render(t,{cls:At("slider",kn,D),style:V,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:bt,layoutParams:_t},{},{default:({focusHandler:t,blurHandler:e})=>{var n,r,o,i,s,l;return`<div${W("class",kn["slider__tracks-wrapper"],0)}><div${W("class",kn["slider__tracks-inner"],0)}${W("this",kt,0)}><div${W("class",kn.slider__track,0)}${q({height:dt(Pt.height),"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}></div> <div${W("class",kn["slider__active-track"],0)}${q({left:(100*F).toFixed(2)+"%",width:(100*A).toFixed(2)+"%",height:dt(It.height),"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}></div> ${z(Et,(t=>`<div class="${I(kn.slider__tick,!0)+" "+I(kn.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${z(Ct,(t=>`<div class="${I(kn.slider__tick,!0)+" "+I(kn.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${W("class",kn.slider__thumb,0)}${q({"border-radius":dt(Dt.borderRadius),background:Dt.background,"box-shadow":Dt.boxShadow||""})}>${jt?`<div${W("class",kn["slider__thumb-text"],0)}><div${W("class",kn["slider__thumb-text-inner"],0)}${q({"font-size":(null===(n=jt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(r=jt)||void 0===r?void 0:r.fontWeight)||"",color:(null===(o=jt)||void 0===o?void 0:o.textColor)||"#000"})}>${I(Lt)}</div></div>`:""}</div> ${a?`<div class="${I(kn.slider__thumb,!0)+" "+I(kn.slider__thumb_secondary,!0)}"${q({"border-radius":dt(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${zt?`<div class="${I(kn["slider__thumb-text"],!0)+" "+I(kn["slider__thumb-text_secondary"],!0)}"><div${W("class",kn["slider__thumb-text-inner"],0)}${q({"font-size":(null===(i=zt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(s=zt)||void 0===s?void 0:s.fontWeight)||"",color:(null===(l=zt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Wt)}</div></div>`:""}</div>`:""} <input type="range"${W("class",kn.slider__input,0)}${W("min",Ft,0)}${W("max",Vt,0)} step="1"${W("value",Lt,0)}${W("aria-label",Rt,0)}${W("this",undefined,0)}> ${a?`<input type="range"${W("class",`${kn.slider__input} ${kn.slider__input_secondary}`,0)}${W("min",Ft,0)}${W("max",Vt,0)} step="1"${W("value",Wt,0)}${W("aria-label",Bt,0)}>`:""}</div></div>`}})}`)})),er={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_right":"divkit-e8038",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_top":"divkit-bdccd","input_alignment-vertical_bottom":"divkit-fc670","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function nr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const n=nr(e,t);return{start:n.start,added:n.removed,removed:n.added}}let n=0,r=e.length-1;const o=e.length-t.length;for(;n<r&&n<t.length&&t[n]===e[n];)++n;for(;r-o>=n&&t[r-o]===e[r];)--r;return++r,{start:n,added:r-n,removed:r-n-o}}function rr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class or{constructor(t){this.char=t}}class ir{constructor(t,e,n){this.char=t,this.filter=e,this.placeholder=n}}class ar{constructor(t){rr(this,"filters",new Map),rr(this,"destructedValue",[]),rr(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const n=this.destructedValue[e];if(n instanceof or)t+=n.char;else if(n instanceof ir)if(n.char)t+=n.char;else{if(!this.maskData.alwaysVisible)break;t+=n.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof ir&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const n=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(st(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new ir(null,this.filters.get(e.key),e.placeholder):new or(t)})),null!==n&&this.overrideRawValue(n)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const n=nr(this.value,t);void 0!==e&&(n.start=Math.max(0,e-n.added));const r=this.buildBodySubstring(n,t),o=this.buildTailSubstring(n);this.cleanup(n);const i=this.firstEmptyHolderIndex(),a=o?this.calculateMaxShift(o,i):void 0;this.replaceChars(r,i,a);const s=this.firstEmptyHolderIndex();this.replaceChars(o,s),this.calculateCursorPosition(n,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let n=0,r=e;for(;r<this.destructedValue.length;)this.destructedValue[r]instanceof ir&&++n,++r;return Math.max(0,n-t.length)}const n=this.calculateInsertableSubstring(t,e);let r=0;for(;r<this.destructedValue.length&&n===this.calculateInsertableSubstring(t,e+r);)++r;return Math.max(0,r-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof ir&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let n=t;for(;n<e&&n<this.destructedValue.length;){const t=this.destructedValue[n];t instanceof ir&&(t.char=null),++n}}calculateCursorPosition(t,e){const n=this.firstEmptyHolderIndex();let r;r=t.start<n?Math.min(this.firstHolderAfter(e),this.value.length):n,this.cursorPos=r}calculateInsertableSubstring(t,e){let n="",r=e;const o=()=>{for(var t;r<this.destructedValue.length&&!(this.destructedValue[r]instanceof ir);)++r;return null===(t=this.destructedValue[r])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=o();null!=e&&e.test(t)&&(n+=t,++r)})),n}collectValueRange(t,e){let n="",r=t;for(;r<=e;){const t=this.destructedValue[r];t instanceof ir&&null!==t.char&&(n+=t.char),++r}return n}replaceChars(t,e,n){let r=this.calculateInsertableSubstring(t,e);void 0!==n&&(r=r.substring(0,n));let o=e,i=0;for(;o<this.destructedValue.length&&i<r.length;){const t=this.destructedValue[o],e=r[i];t instanceof ir&&(t.char=e,++i),++o}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof ir);)++e;return e}}class sr extends ar{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function lr(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class cr extends ar{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),lr(this,"currencyFormatter",new Intl.NumberFormat),lr(this,"decimalSeparator","."),lr(this,"localeDigits",{}),lr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const n=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(n)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,n)=>(t[n]=this.currencyFormatter.format(n)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(st(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),n=this.formatPattern(e),r=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:n,decoding:r,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const n=nr(this.value,t),r=this.value.lastIndexOf(this.decimalSeparator),o=t.lastIndexOf(this.decimalSeparator),i=r!==o||-1===r&&-1===o,a=this.validFormat(t,n);this.cleanup(n);const s=this.parseFormat(a)||0;i&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>n.start&&!this.isDigit(this.value[n.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const n of t)e+=this.isDigit(n)?"#":n;return e}validFormat(t,e){if(!t)return"";let n=-1,r=0;for(;r<t.length;){if(t[r]===this.decimalSeparator&&!this.inDiff(e,r)){n=r;break}r++}let o=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(o=e.start);const i=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=i;if(-1!==n)for(r=n;r<t.length;)this.isDigit(t[r])&&!this.inDiff(e,r)&&a--,r++;else{let n=!1;for(let r=0;r<t.length;r++){const o=t[r];o===this.decimalSeparator?n=!0:!this.inDiff(e,r)&&n&&this.isDigit(o)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==o,l=[];r=t.length-1;let c=!1;for(;r>=0;){const u=t[r],d=l.length<=i;this.isDigit(u)?this.inDiff(e,r)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===n&&r===o?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||n!==r&&-1!==n||(l.push(this.decimalSeparator),c=!0,n=r),r--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function ur(t){const e=t.textContent;let n=0;return"string"==typeof e&&(n+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++n),n}function dr(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const n=document.createRange(),r=t.parentNode,o=Array.from(r.childNodes).indexOf(t)+1;n.setStart(r,o),n.setEnd(r,o),e.addRange(n)}}catch(t){}else for(let n=0,r=t.childNodes.length;n<r;++n){const r=t.childNodes[n],o=ur(r);if(e<=o)return void dr(r,e);e-=o}else try{const n=window.getSelection();if(n){n.removeAllRanges();const r=document.createRange();r.setStart(t,e),r.setEnd(t,e),n.addRange(r)}}catch(t){}}const pr="undefined"!=typeof document&&"inputMode"in document.createElement("input"),vr={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"},gr=L(((t,e,n,r)=>{let o,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,S,O,P,M,T,z,N,B,U,L,H,q,J,G,Z,Y,X,Q,K,tt,et,nt,rt,ot,it=i,lt=i,ct=i,vt=i,ft=i,ht=i,mt=i,yt=i,bt=i,_t=i,wt=i,$t=i,xt=i,kt=i,Et=i,Ct=i,jt=i,Ft=i,St=i;var Ot;let{componentContext:It}=e,{layoutParams:Mt}=e;const Tt=f(at);let zt,Nt,Rt,Ut,Lt,Wt=null,Ht="",qt="",Jt=!1,Gt="",Zt=12,Xt="",Qt="",Kt="#000",te="",ee="left",ne="center",oe="multi_line_text",ae="text",le="",ce=null,pe="",ve="",ge="";function fe(t){Nt instanceof HTMLInputElement?Nt.selectionStart=Nt.selectionEnd=t:dr(Nt,t)}async function he(){if(!Nt||!Wt)return;Wt.overrideRawValue(N),u.set(Wt.rawValue),c(s,z=Ht=qt=Wt.value,z);const t=Wt.cursorPosition;await $(),document.activeElement===Nt&&fe(t)}var me;v((()=>{zt&&(Tt.unregisterFocusable(zt),zt=void 0)})),void 0===e.componentContext&&n.componentContext&&void 0!==It&&n.componentContext(It),void 0===e.layoutParams&&n.layoutParams&&void 0!==Mt&&n.layoutParams(Mt),It.json&&(Gt="",Zt=12,Rt=void 0,Xt="",Ut=void 0,Kt="#000",te="",ee="left",ne="center",oe="multi_line_text",ae="text",Lt=void 0),o=It.json.text_variable,a=null===(Ot=It.json.mask)||void 0===Ot?void 0:Ot.raw_text_variable,s=o&&It.getVariable(o,"string")||Hn("temp","string",""),it(),it=l(s,(t=>z=t)),u=a&&It.getVariable(a,"string")||Hn("temp","string",""),lt(),lt=l(u,(t=>N=t)),d=It.getDerivedFromVars(It.json.hint_text),Ft(),Ft=l(d,(t=>rt=t)),p=It.getDerivedFromVars(It.json.hint_color),jt(),jt=l(p,(t=>nt=t)),g=It.getDerivedFromVars(It.json.font_size),Ct(),Ct=l(g,(t=>et=t)),h=It.getDerivedFromVars(It.json.font_weight),Et(),Et=l(h,(t=>tt=t)),m=It.getDerivedFromVars(It.json.font_family),kt(),kt=l(m,(t=>K=t)),y=It.getDerivedFromVars(It.json.line_height),xt(),xt=l(y,(t=>Q=t)),b=It.getDerivedFromVars(It.json.letter_spacing),$t(),$t=l(b,(t=>X=t)),_=It.getDerivedFromVars(It.json.text_color),wt(),wt=l(_,(t=>Y=t)),w=It.getDerivedFromVars(It.json.highlight_color),_t(),_t=l(w,(t=>Z=t)),x=It.getDerivedFromVars(It.json.text_alignment_horizontal),bt(),bt=l(x,(t=>G=t)),k=It.getDerivedFromVars(It.json.text_alignment_vertical),yt(),yt=l(k,(t=>J=t)),E=It.getDerivedFromVars(It.json.keyboard_type),mt(),mt=l(E,(t=>q=t)),C=It.getDerivedFromVars(It.json.mask),ht(),ht=l(C,(t=>H=t)),j=It.getDerivedFromVars(It.json.max_visible_lines),ft(),ft=l(j,(t=>L=t)),A=It.getDerivedFromVars(It.json.paddings),vt(),vt=l(A,(t=>U=t)),F=It.getDerivedFromVars(It.json.accessibility),ct(),ct=l(F,(t=>B=t)),V=It.getDerivedFromVars(It.json.select_all_on_focus),St(),St=l(V,(t=>ot=t)),o?Jt=!1:(Jt=!0,It.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(me=H)?void 0:me.type)?Wt=function(t,e,n){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const r={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return n?(n.updateMaskData(r),n):new sr(r,e)}return n||null}(me,It.logError,Wt):"currency"===(null==me?void 0:me.type)&&(Wt=function(t,e,n){return n?(n.updateCurrencyParams(t.locale),n):new cr(t.locale,e)}(me,It.logError,Wt)),Wt&&he(),Wt||Ht===z||(Ht=qt=z),Wt&&Wt.rawValue!==N&&he(),D=rt,Gt=gt(nt,1,Gt),Zt=ie(et,Zt),Rt=se(tt,Rt),Xt=K&&"string"==typeof K?Tt.typefaceProvider(K,{fontWeight:Rt||400}):"";{const t=Q;Yt(t)&&(Ut=t/Zt)}return Dt(X)&&(Qt=dt(X)),Kt=gt(Y,1,Kt),te=gt(Z,1,te),ee=ue(G,ee),ne=de(J,ne),q&&q in vr&&(ae=vr[q],oe=q),"currency"===(null==H?void 0:H.type)&&(ae=pr?"text":"tel",Lt="decimal"),S="multi_line_text"===oe,le=Yt(L)?`calc(${L*(Ut||1.25)*(Zt/10)+"em"} + ${pt(Pt(null==U?void 0:U.top,0)+Pt(null==U?void 0:U.bottom,0))})`:"",ce=Bt(U||void 0,ce),pe=ce?Vt({top:(Number(ce.top)||0)/Zt*10,right:(Number(ce.right)||0)/Zt*10,bottom:(Number(ce.bottom)||0)/Zt*10,left:(Number(ce.left)||0)/Zt*10}):"",ve=ce?Vt({top:(Number(ce.top)||0)/Zt*10,bottom:(Number(ce.bottom)||0)/Zt*10}):"",(null==B?void 0:B.description)?ge=B.description:It.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),O={"highlight-color":Boolean(te),multiline:S,"alignment-horizontal":ee,"alignment-vertical":ne},P={"--divkit-input-hint-color":Gt,"--divkit-input-highlight-color":te,"--divkit-input-line-height":Ut,"font-weight":Rt,"font-family":Xt,"letter-spacing":Qt,color:Kt,"max-height":le},M={"font-size":dt(Zt),padding:pe},T={"font-size":dt(Zt),padding:ve},Nt&&It.json&&(zt&&(Tt.unregisterFocusable(zt),zt=void 0),It.json.id&&!It.fakeElement&&(zt=It.json.id,Tt.registerFocusable(zt,{focus(){Nt&&Nt.focus()}}))),it(),lt(),ct(),vt(),ft(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Et(),Ct(),jt(),Ft(),St(),Jt?"":`${R(re,"Outer").$$render(t,{cls:At("input",er,O),style:P,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:It,layoutParams:Mt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:n})=>{return S?`<span${W("class",er["input__scroll-wrapper"],0)}>${!qt&&D?`<div${W("class",er.input__placeholder,0)} aria-hidden="true"${W("style",ut(M),0)}>${I(D)}</div>`:""} <span aria-hidden="true"${W("style",ut(T),0)}>​</span> <span${W("class",At("input__input",er,{"has-custom-focus":n,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${W("aria-label",ge,0)}${W("style",ut(M),0)}${W("this",Nt,0)}>${r=qt,void 0===r?"":r}</span></span>`:`<input${W("type",ae,0)}${W("inputmode",Lt,0)}${W("class",At("input__input",er,{"has-custom-focus":n,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${W("aria-label",ge,0)}${W("style",ut(M),0)}${W("placeholder",D,0)}${W("value",Ht,0)}${W("this",Nt,0)}>`;var r}})}`})),fr={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},hr=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,S,O,P,M,T,N=i,B=i,U=i,L=i,H=i,q=i,J=i,G=i,Z=i,Y=i,X=i,{componentContext:Q}=e,{layoutParams:K}=e;const tt=f(at);let et,nt,rt,ot=!1,it="",lt=null,ct="",pt="rgba(0,0,0,.45)",vt=12,ft="",ht="",mt="#000",yt="";v((()=>{et&&(tt.unregisterFocusable(et),et=void 0)})),void 0===e.componentContext&&n.componentContext&&void 0!==Q&&n.componentContext(Q),void 0===e.layoutParams&&n.layoutParams&&void 0!==K&&n.layoutParams(K),Q.json&&(lt=null,pt="rgba(0,0,0,.45)",vt=12,nt=void 0,ft="",rt=void 0,ht="",mt="#000",yt=""),o=Q.json.value_variable,a=Q.json.options,s=Array.isArray(a)&&a.filter((t=>"string"==typeof t.value))||[],c=o&&Q.getVariable(o,"string")||Hn("temp","string",""),Y(),Y=l(c,(t=>M=t)),u=Q.getDerivedFromVars(Q.json.paddings),Z(),Z=l(u,(t=>P=t)),d=Q.getDerivedFromVars(Q.json.hint_text),X(),X=l(d,(t=>T=t)),p=Q.getDerivedFromVars(Q.json.hint_color),G(),G=l(p,(t=>O=t)),g=Q.getDerivedFromVars(Q.json.font_size),J(),J=l(g,(t=>S=t)),h=Q.getDerivedFromVars(Q.json.font_weight),q(),q=l(h,(t=>D=t)),m=Q.getDerivedFromVars(Q.json.font_family),H(),H=l(m,(t=>V=t)),y=Q.getDerivedFromVars(Q.json.line_height),L(),L=l(y,(t=>F=t)),b=Q.getDerivedFromVars(Q.json.letter_spacing),U(),U=l(b,(t=>A=t)),_=Q.getDerivedFromVars(Q.json.text_color),B(),B=l(_,(t=>j=t)),w=Q.getDerivedFromVars(Q.json.accessibility),N(),N=l(w,(t=>C=t)),Array.isArray(s)&&s.length||Q.logError(st(new Error('Empty selection "items" in "select"'))),o?ot=!1:(ot=!0,Q.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=s.find((t=>t.value===M));t?it=("string"==typeof t.text?t.text:t.value)||"":(it="",M&&Q.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}vt=ie(S,vt),lt=Bt(P||void 0,lt),ct=lt?Vt({top:(Number(lt.top)||0)/vt*10,right:(Number(lt.right)||0)/vt*10,bottom:(Number(lt.bottom)||0)/vt*10,left:(Number(lt.left)||0)/vt*10}):"",pt=gt(O,1,pt),nt=se(D,nt),ft=V&&"string"==typeof V?tt.typefaceProvider(V,{fontWeight:nt||400}):"";{const t=F;Yt(t)&&(rt=t/vt)}return Dt(A)&&(ht=dt(A/vt*10)),mt=gt(j,1,mt),(null==C?void 0:C.description)?yt=C.description:Q.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),$={hint:!it},x={"--divkit-input-hint-color":pt,"font-weight":nt,"font-family":ft,color:mt},k={padding:ct,"font-size":dt(vt),"line-height":rt,"letter-spacing":ht},E={"font-size":dt(vt),"line-height":rt,"letter-spacing":ht},Q.json,N(),B(),U(),L(),H(),q(),J(),G(),Z(),Y(),X(),ot?"":`${R(re,"Outer").$$render(t,{cls:At("select",fr,$),style:x,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:Q,layoutParams:K},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:n})=>`<span${W("class",fr["select__select-text"],0)}${W("style",ut(k),0)} aria-hidden="true"> ${I(it||T||"​")}</span> <select${W("class",At("select__select",fr,{"has-custom-focus":t}),0)}${W("aria-label",yt,0)}${W("style",ut(E),0)}${W("this",undefined,0)}>${z(s,(t=>`<option${W("class",fr.select__option,0)}${W("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),mr={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},yr=L(((t,e,n,r)=>{let o,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C=i,j=i,A=i,F=i,V=i,D=i,S=i,{componentContext:O}=e,{layoutParams:P}=e;const I=f(at);let M,T,N,B,U=!1,L=!1,H=[],J=!1,G=!1,Z=!1,Y="fit",X="0";function Q(){const t=null==T?void 0:T.play();t&&t.catch((t=>{O.logError(st(new Error("Video playing error"),{level:"error",additional:{originalText:String(t)}}))}))}var K,tt;v((()=>{M&&(I.unregisterInstance(M),M=void 0),B&&(B(),B=void 0)})),void 0===e.componentContext&&n.componentContext&&void 0!==O&&n.componentContext(O),void 0===e.layoutParams&&n.layoutParams&&void 0!==P&&n.layoutParams(P),O.json&&(J=!1,G=!1,Z=!1,N=void 0,Y="fit"),o=O.json.elapsed_time_variable,a=o&&O.getVariable(o,"integer")||Hn("temp","integer",0),a&&(B&&B(),B=a.subscribe((function(t){L?L=!1:T&&(T.currentTime=Number(t)/1e3)}))),s=O.getDerivedFromVars(O.json.video_sources),S(),S=l(s,(t=>E=t)),c=O.getDerivedFromVars(O.json.repeatable),D(),D=l(c,(t=>k=t)),u=O.getDerivedFromVars(O.json.autostart),C(),C=l(u,(t=>b=t)),d=O.getDerivedFromVars(O.json.muted),V(),V=l(d,(t=>x=t)),p=O.getDerivedFromVars(O.json.preview),F(),F=l(p,(t=>$=t)),g=O.getDerivedFromVars(O.json.scale),A(),A=l(g,(t=>w=t)),h=O.getDerivedFromVars(O.json.aspect),j(),j=l(h,(t=>_=t)),K=E,tt=H,H=Array.isArray(K)&&K.length?K.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):tt,H.length?U=!1:(U=!0,O.logError(st(new Error('Missing "video_sources" in "video"')))),J=pe(k,J),G=pe(b,G),Z=pe(x,Z),N="string"==typeof $?Ne($):N,Y=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(w)||Y;{const t=null==_?void 0:_.ratio;X=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return O.json&&(M&&(I.unregisterInstance(M),M=void 0),!O.json.id||U||O.fakeElement||(M=O.json.id,I.registerInstance(M,{pause:function(){null==T||T.pause()},start:Q}))),O.json&&b&&T&&Q(),m={aspect:"0"!==X},y={"object-fit":Y},C(),j(),A(),F(),V(),D(),S(),U?"":`${R(re,"Outer").$$render(t,{cls:At("video",mr,m),customActions:"video",componentContext:O,layoutParams:P},{},{default:()=>m.aspect?`<div${W("class",mr["video__aspect-wrapper"],0)}${q({"padding-bottom":`${X}%`})}><video${W("class",mr.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",N,0)}${W("this",T,0)}>${z(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video></div>`:`<video${W("class",mr.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",N,0)}${W("this",T,0)}>${z(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video>`})}`})),br=yr,_r=L(((t,e,n,r)=>{let o,i;var a;let{componentContext:s}=e,{layoutParams:l}=e;const c=f(at);let u=null,d="",p={},v=!1;if(void 0===e.componentContext&&n.componentContext&&void 0!==s&&n.componentContext(s),void 0===e.layoutParams&&n.layoutParams&&void 0!==l&&n.layoutParams(l),"string"==typeof s.json.custom_type&&s.json.custom_type&&(null===(a=c.customComponents)||void 0===a?void 0:a.has(s.json.custom_type))){if(u=c.customComponents.get(s.json.custom_type),"function"==typeof u.template){const t=c.getExtensionContext(),e=new Map;for(const[n,r]of t.variables)e.set(n,r.getValue());d=u.template({props:s.json.custom_props,variables:e})}else d=u.template&&"string"==typeof u.template?u.template:"";p={shadowrootmode:u.shadowRootMode||"open"}}else u=null,d=";",s.logError(st(new Error('Unknown or incorrect "custom_type" prop for div "custom"')));return o=s.json.items,void 0===o||Array.isArray(o)?v=!1:(v=!0,s.logError(st(new Error('Incorrect "items" prop for div "custom"')))),i=(!v&&o||[]).map(((t,e)=>s.produceChildContext(t,{path:e}))),u?`${R(re,"Outer").$$render(t,{componentContext:s,layoutParams:l},{},{default:()=>{return(e=u.element)?`<${u.element}${S([T(s.json.custom_props||{})],{})}${W("this",undefined,0)}>${V(e)?"":`${d?`<template${S([T(p)],{})}> ${d}</template>`:""} ${!v&&o?`${z(i,(e=>`${R(xr,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),wr=_r,$r={};$r.text=fe,$r.container=Pe,$r.separator=Te,$r.image=Be,$r.gif=Be,$r.grid=Je,$r.gallery=nn,$r.tabs=an,$r.state=hn,$r.pager=bn,$r.indicator=xn,$r.slider=tr,$r.input=gr,$r.select=hr,$r.video=br,$r.custom=wr;const xr=L(((t,e,n,r)=>{let{componentContext:o}=e,{layoutParams:i}=e;const a=f(at);let s;void 0===e.componentContext&&n.componentContext&&void 0!==o&&n.componentContext(o),void 0===e.layoutParams&&n.layoutParams&&void 0!==i&&n.layoutParams(i);{const t=o.json;if(s=(null==t?void 0:t.type)&&$r[t.type]||void 0,!s){let e;e=(null==t?void 0:t.type)&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",o.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${R(s||N,"svelte:component").$$render(t,{componentContext:o,layoutParams:i},{},{})}`:""})),kr=L(((t,e,n,r)=>{let{svgFiltersMap:o}=e;return void 0===e.svgFiltersMap&&n.svgFiltersMap&&void 0!==o&&n.svgFiltersMap(o),Object.keys(o).length?`<svg${W("class","divkit-dc22b",0)} aria-hidden="true"><defs>${z([...Object.keys(o)],(t=>{let[e,n]=t.split(":");return` <filter${W("id",o[t],0)}><feFlood${W("flood-color",e,0)}></feFlood>${"source_in"===n||"source_atop"===n?`<feComposite in2="SourceGraphic"${W("operator",n.split("_")[1],0)}></feComposite>`:"multiply"===n?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${W("mode",n,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Er(t,e,n,r){const o=n[t.type];if(!o)return r(st(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let i;const a={};for(i in e)e.hasOwnProperty(i)&&(a[i]=e[i]);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(a[i]=t[i]);const s=function t(e,n){const r=Object.keys(n).filter((t=>"__proto__"!==t)),o=r.filter((t=>"$"!==t.charAt(0))),i=r.filter((t=>"$"===t.charAt(0)));return o.forEach((r=>{const o=n[r];"object"==typeof o&&null!==o?(e[r]=Array.isArray(o)?[]:{},t(e[r],o)):e[r]=o})),i.forEach((t=>{const r=n[t],o=a[r];if(void 0!==o){const n=t.substring(1);e[n]=o}})),e}({},o);for(i in t)"type"!==i&&"__proto__"!==i&&t.hasOwnProperty(i)&&(s[i]=t[i]);return{json:s,templateContext:a}}function Cr(){}function jr(t){return{subscribe:e=>(e(t),Cr)}}function Ar(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Fr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Vr(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function Dr(t){try{return Dn(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function Sr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Or(t,e,n,r){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,Or.prototype),o.expected=e,o.found=n,o.location=r,o.name="SyntaxError",o}function Pr(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,t+(n+=n.repeat(e)).slice(0,e))}jr(void 0),function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(Or,Error),Or.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n,r=null;for(n=0;n<t.length;n++)if(t[n].source===this.location.source){r=t[n].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+i.line+":"+i.column;if(r){var s=this.location.end,l=Pr("",i.line.toString().length," "),c=r[o.line-1],u=(o.line===s.line?s.column:c.length+1)-o.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+i.line+" | "+c+"\n"+l+" | "+Pr("",o.column-1," ")+Pr("",u,"^")}else e+="\n at "+a}return e},Or.buildMessage=function(t,e){var n={literal:function(t){return'"'+o(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?i(t[0])+"-"+i(t[1]):i(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function r(t){return t.charCodeAt(0).toString(16).toUpperCase()}function o(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+r(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+r(t)}))}function i(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+r(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+r(t)}))}function a(t){return n[t.type](t)}return"Expected "+function(t){var e,n,r=t.map(a);if(r.sort(),r.length>0){for(e=1,n=1;e<r.length;e++)r[e-1]!==r[e]&&(r[n]=r[e],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."};const Ir=new Map,Mr=new Map;function Tr(t,e,n){const r={args:e,cb:n},o=Ir.get(t)||[];Ir.has(t)||Ir.set(t,o),o.push(r);const i=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Mr.set(i,r)}function zr(t,e){let n=t.args.length,r=t.args.length;const o=t.args[t.args.length-1];if("object"==typeof o&&o.isVararg&&(--n,r=1/0),e.length<n)return{type:"few",expected:n,found:e.length};if(e.length>r)return{type:"many",expected:r,found:e.length};for(let n=0;n<e.length;++n){let r=n>=t.args.length?t.args[t.args.length-1]:t.args[n];if("object"!=typeof r&&(r={type:r}),r.type!==e[n].type)return{type:"mismatch",expected:r.type,found:e[n].type}}return{type:"match"}}function Nr(t,e){var n;switch(null===(n=e[t.type])||void 0===n||n.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{Nr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Nr(t.left,e),Nr(t.right,e);break;case"UnaryExpression":Nr(t.argument,e);break;case"ConditionalExpression":Nr(t.test,e),Nr(t.consequent,e),Nr(t.alternate,e);break;case"TryExpression":Nr(t.test,e),Nr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Nr(t,e)}))}}function Rr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Br(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Ur(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return Br(t.value);if("color"===t.type)return Yr(Zr(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";if("array"===t.type)return"<array>";throw new Error(`Unexpected type ${t.type}`)}function Lr(t){let e=Ur(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Wr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Hr(t,e){if(jn)return Dn(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function qr(t,e){if(e<Vn||e>Fn)throw new Error("Integer overflow.");!jn&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Jr(t){const e=[];return Nr(t,{Variable(t){e.push(t.id.name)}}),e}function Gr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Zr(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Yr(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return vt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Xr(t){return Yr(Zr(t))}const Qr=Number.MAX_VALUE,Kr=Number.MIN_VALUE,to="string",eo="integer",no="number",ro="boolean",oo="color",io="url",ao="datetime",so="dict",lo="array";function co(t,e){return{type:to,value:Ur(e)}}function uo(t,e){const n=Number(e.value);if(isNaN(n)||!Number.isFinite(n))throw new Error("Unable to convert value to Number.");return{type:no,value:n}}function po(t,e,n,r){const o=t.variables.get(e.value);let i;return i=o&&o.getType()===r?o.getValue():n.value,"color"===r&&(i=Xr(i)),{type:r,value:i}}function vo(t,e,n){return po(t,e,n,n.type)}function go(t,e,n){return po(t,e,n,"color")}function fo(t,e,n){return po(t,e,n,"url")}const ho=t=>(e,n)=>{let r=new Date(n.value.getTime())[t]();return"getUTCMonth"===t?++r:"getUTCDay"===t&&0===r&&(r=7),{type:eo,value:Dn(r)}},mo=ho("getUTCFullYear"),yo=ho("getUTCMonth"),bo=ho("getUTCDate"),_o=ho("getUTCDay"),wo=ho("getUTCHours"),$o=ho("getUTCMinutes"),xo=ho("getUTCSeconds"),ko=ho("getUTCMilliseconds");function Eo(t,e,n,r){if(!r.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let o="";const i=e.type===to?e.value:Ur(e);for(;o.length+i.length<n.value;)o+=r.value;return o.length>0&&o.length+i.length>n.value&&(o=o.substring(0,Number(n.value)-Number(i.length))),o}function Co(t,e,n,r){const o=Eo(t,e,n,r);return{type:to,value:o+Ur(e)}}function jo(t,e,n,r){const o=Eo(t,e,n,r);return{type:to,value:Ur(e)+o}}function Ao(t){return(e,n)=>{const r=Zr(n.value);return{type:no,value:r[t]/255}}}function Fo(t){return(e,n,r)=>{const o=Zr(n.value);return o[t]=255*r.value,{type:oo,value:Yr(o)}}}const Vo=Ao("a"),Do=Ao("r"),So=Ao("g"),Oo=Ao("b"),Po=Fo("a"),Io=Fo("r"),Mo=Fo("g"),To=Fo("b");function zo(t,e,n,r){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let o=Dn(e.value)/Dn(n);return qr(t,o),"number"==typeof o&&(o=Math.floor(o)),r&&(o=Dn(o)%Dn(r)),{type:eo,value:o}}const No=36e5;function Ro(t,e){return(n,r,...o)=>{let i=function(t,e){let n=t;for(let t=0;t<e.length;++t){if(!n)throw new Error(`Missing property "${e[t]}" in the dict.`);const r=n[e[t]];if(void 0===r)throw new Error(`Missing property "${e[t]}" in the dict.`);n=r}return n}(r.value,o.map((t=>t.value))),a=typeof i;if("array"===t&&!Array.isArray(i)||"array"!==t&&a!==t||"object"===a&&null===i)throw"object"===a&&(a=Array.isArray(i)?"array":null===i?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(i!==Math.round(i))throw new Error("Cannot convert value to integer.");qr(n,i),i=Dn(i)}return"string"===t&&"color"===e&&(i=Xr(i)),{type:e,value:i}}}function Bo(t,e){return(n,r,o,...i)=>{try{return t(n,o,...i)}catch(t){let n=r.value;return"color"===e&&(n=Xr(n)),{type:e,value:n}}}}const Uo=Ro("string","string"),Lo=Ro("number","number"),Wo=Ro("number","integer"),Ho=Ro("boolean","boolean"),qo=Ro("string","color"),Jo=Ro("string","url"),Go=Ro("array","array"),Zo=Ro("object","dict"),Yo=Bo(Uo,"string"),Xo=Bo(Lo,"number"),Qo=Bo(Wo,"integer"),Ko=Bo(Ho,"boolean"),ti=Bo(qo,"color"),ei=Bo(Jo,"url");function ni(t,e){return(n,r,o)=>{if(o.value<0||o.value>=r.value.length)throw new Error(`Requested index (${o.value}) out of bounds array size (${r.value.length}).`);let i=r.value[Number(o.value)],a=typeof i;if("array"===t&&!Array.isArray(i)||"array"!==t&&a!==t||"object"===a&&null===i)throw"object"===a&&(a=Array.isArray(i)?"array":null===i?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(i!==Math.round(i))throw new Error("Cannot convert value to integer.");qr(n,i),i=Dn(i)}return"string"===t&&"color"===e&&(i=Xr(i)),{type:e,value:i}}}function ri(t,e){return(n,r,o,i)=>{try{return t(n,r,o)}catch(t){let n=i.value;return"color"===e&&(n=Xr(n)),{type:e,value:n}}}}const oi=ni("string","string"),ii=ni("number","number"),ai=ni("number","integer"),si=ni("boolean","boolean"),li=ni("string","color"),ci=ni("string","url"),ui=ni("array","array"),di=ni("object","dict"),pi=ri(oi,"string"),vi=ri(ii,"number"),gi=ri(ai,"integer"),fi=ri(si,"boolean"),hi=ri(li,"color"),mi=ri(ci,"url");function yi(t){return t.map(Lr).join(", ")}Tr("toString",[eo],co),Tr("toString",[no],co),Tr("toString",[ro],co),Tr("toString",[oo],co),Tr("toString",[io],co),Tr("toNumber",[eo],uo),Tr("toNumber",[to],uo),Tr("toInteger",[no],(function(t,e){if(e.value>Fn||e.value<Vn)throw new Error("Unable to convert value to Integer.");const n=e.value-e.value%1;return{type:eo,value:Dn(n)}})),Tr("toInteger",[to],(function(t,e){let n;try{n=Dn(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof n&&(isNaN(n)||n%1!=0)||n>Fn||n<Vn)throw new Error("Unable to convert value to Integer.");return{type:eo,value:n}})),Tr("toInteger",[ro],(function(t,e){return{type:eo,value:Dn(e.value?1:0)}})),Tr("toBoolean",[eo],(function(t,e){const n=Number(e.value);if(1!==n&&0!==n)throw new Error("Unable to convert value to Boolean.");return{type:ro,value:n}})),Tr("toBoolean",[to],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:ro,value:"true"===e.value?1:0}})),Tr("toColor",[to],(function(t,e){return{type:oo,value:Xr(e.value)}})),Tr("toUrl",[to],(function(t,e){return{type:io,value:e.value}})),Tr("encodeUri",[to],(function(t,e){try{return{type:to,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Tr("decodeUri",[to],(function(t,e){try{return{type:to,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Tr("getIntegerValue",[to,eo],vo),Tr("getNumberValue",[to,no],vo),Tr("getBooleanValue",[to,ro],vo),Tr("getStringValue",[to,to],vo),Tr("getColorValue",[to,oo],go),Tr("getColorValue",[to,to],go),Tr("getUrlValue",[to,io],fo),Tr("getUrlValue",[to,to],fo),Tr("parseUnixTime",[eo],(function(t,e){return{type:ao,value:new Date(1e3*Number(e.value))}})),Tr("nowLocal",[],(function(){return{type:ao,value:new Date}})),Tr("addMillis",[ao,eo],(function(t,e,n){return{type:ao,value:new Date(e.value.getTime()+Number(n.value))}})),Tr("setYear",[ao,eo],(function(t,e,n){const r=new Date(e.value);return r.setUTCFullYear(Number(n.value)),{type:ao,value:r}})),Tr("setMonth",[ao,eo],(function(t,e,n){const r=Number(n.value);if(r<1||r>12)throw new Error(`Expecting month in [1..12], instead got ${r}.`);const o=new Date(e.value);return o.setUTCMonth(r-1),{type:ao,value:o}})),Tr("setDay",[ao,eo],(function(t,e,n){const r=new Date(e.value),o=Number(n.value);if(o<=0&&-1!==o||o>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(r))throw new Error(`Unable to set day ${o} for date ${Ur(e)}.`);return r.setUTCDate(-1===o?0:o),{type:ao,value:r}})),Tr("setHours",[ao,eo],(function(t,e,n){const r=Number(n.value);if(r<0||r>23)throw new Error(`Expecting hours in [0..23], instead got ${r}.`);const o=new Date(e.value);return o.setUTCHours(r),{type:ao,value:o}})),Tr("setMinutes",[ao,eo],(function(t,e,n){const r=Number(n.value);if(r<0||r>59)throw new Error(`Expecting minutes in [0..59], instead got ${r}.`);const o=new Date(e.value);return o.setUTCMinutes(r),{type:ao,value:o}})),Tr("setSeconds",[ao,eo],(function(t,e,n){const r=Number(n.value);if(r<0||r>59)throw new Error(`Expecting seconds in [0..59], instead got ${r}.`);const o=new Date(e.value);return o.setUTCSeconds(r),{type:ao,value:o}})),Tr("setMillis",[ao,eo],(function(t,e,n){const r=Number(n.value);if(r<0||r>999)throw new Error(`Expecting millis in [0..999], instead got ${r}.`);const o=new Date(e.value);return o.setUTCMilliseconds(r),{type:ao,value:o}})),Tr("getYear",[ao],mo),Tr("getMonth",[ao],yo),Tr("getDay",[ao],bo),Tr("getDayOfWeek",[ao],_o),Tr("getHours",[ao],wo),Tr("getMinutes",[ao],$o),Tr("getSeconds",[ao],xo),Tr("getMillis",[ao],ko),Tr("getIntervalSeconds",[eo],(function(t,e){return zo(t,e,1e3,60)})),Tr("getIntervalTotalSeconds",[eo],(function(t,e){return zo(t,e,1e3)})),Tr("getIntervalMinutes",[eo],(function(t,e){return zo(t,e,6e4,60)})),Tr("getIntervalTotalMinutes",[eo],(function(t,e){return zo(t,e,6e4)})),Tr("getIntervalHours",[eo],(function(t,e){return zo(t,e,No,24)})),Tr("getIntervalTotalHours",[eo],(function(t,e){return zo(t,e,No)})),Tr("getIntervalTotalDays",[eo],(function(t,e){return zo(t,e,864e5)})),Tr("getIntervalTotalWeeks",[eo],(function(t,e){return zo(t,e,6048e5)})),Tr("len",[to],(function(t,e){return{type:eo,value:Dn(e.value.length)}})),Tr("contains",[to,to],(function(t,e,n){return{type:ro,value:e.value.includes(n.value)?1:0}})),Tr("substring",[to,eo,eo],(function(t,e,n,r){if(r.value<n.value)throw new Error("Indexes should be in ascending order.");if(n.value<0||n.value>e.value.length||r.value<0||r.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:to,value:e.value.substring(Number(n.value),Number(r.value))}})),Tr("replaceAll",[to,to,to],(function(t,e,n,r){let o;return o=n.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(n.value),"g"),r.value):e.value,{type:to,value:o}})),Tr("index",[to,to],(function(t,e,n){return{type:eo,value:Dn(e.value.indexOf(n.value))}})),Tr("lastIndex",[to,to],(function(t,e,n){return{type:eo,value:Dn(e.value.lastIndexOf(n.value))}})),Tr("trim",[to],(function(t,e){return{type:to,value:e.value.trim()}})),Tr("trimLeft",[to],(function(t,e){return{type:to,value:e.value.replace(/^\s+/,"")}})),Tr("trimRight",[to],(function(t,e){return{type:to,value:e.value.replace(/\s+$/,"")}})),Tr("toUpperCase",[to],(function(t,e){return{type:to,value:e.value.toUpperCase()}})),Tr("toLowerCase",[to],(function(t,e){return{type:to,value:e.value.toLowerCase()}})),Tr("padStart",[to,eo,to],Co),Tr("padStart",[eo,eo,to],Co),Tr("padEnd",[to,eo,to],jo),Tr("padEnd",[eo,eo,to],jo),Tr("testRegex",[to,to],(function(t,e,n){let r;try{r=new RegExp(n.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:ro,value:r.test(e.value)?1:0}})),Tr("div",[eo,eo],(function(t,e,n){if(n.value===Sn)throw new Error("Division by zero is not supported.");let r=e.value/n.value;return r=Hr(0,r),qr(t,r),{type:eo,value:r}})),Tr("div",[no,no],(function(t,e,n){if(0===n.value)throw new Error("Division by zero is not supported.");const r=e.value/n.value;return{type:no,value:r}})),Tr("mod",[eo,eo],(function(t,e,n){if(n.value===Sn)throw new Error("Division by zero is not supported.");let r=e.value%n.value;return r=Hr(0,r),qr(t,r),{type:eo,value:r}})),Tr("mod",[no,no],(function(t,e,n){if(0===n.value)throw new Error("Division by zero is not supported.");const r=e.value%n.value;return{type:no,value:r}})),Tr("mul",[{type:eo,isVararg:!0}],(function(t,...e){let n=e.length?e[0].value:Sn;for(let r=1;r<e.length;++r)n*=e[r].value,n=Hr(0,n),qr(t,n);return{type:eo,value:n}})),Tr("mul",[{type:no,isVararg:!0}],(function(t,...e){let n=e.length?e[0].value:0;for(let t=1;t<e.length;++t)n*=e[t].value;return{type:no,value:n}})),Tr("sub",[{type:eo,isVararg:!0}],(function(t,...e){let n=e.length?e[0].value:Sn;for(let r=1;r<e.length;++r)n-=e[r].value,n=Hr(0,n),qr(t,n);return{type:eo,value:n}})),Tr("sub",[{type:no,isVararg:!0}],(function(t,...e){let n=e.length?e[0].value:0;for(let t=1;t<e.length;++t)n-=e[t].value;return{type:no,value:n}})),Tr("sum",[{type:eo,isVararg:!0}],(function(t,...e){let n=Sn;for(let r=0;r<e.length;++r)n+=e[r].value,n=Hr(0,n),qr(t,n);return{type:eo,value:n}})),Tr("sum",[{type:no,isVararg:!0}],(function(t,...e){let n=0;for(let t=0;t<e.length;++t)n+=e[t].value;return{type:no,value:n}})),Tr("abs",[eo],(function(t,e){const n=On(e.value);return qr(t,n),{type:e.type,value:n}})),Tr("abs",[no],(function(t,e){const n=Math.abs(e.value);return{type:no,value:n}})),Tr("max",[{type:eo,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let n=e[0].value;for(let t=1;t<e.length;++t)e[t].value>n&&(n=e[t].value);return{type:eo,value:n}})),Tr("max",[{type:no,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:no,value:Math.max(...e.map((t=>t.value)))}})),Tr("min",[{type:eo,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let n=e[0].value;for(let t=1;t<e.length;++t)e[t].value<n&&(n=e[t].value);return{type:eo,value:n}})),Tr("min",[{type:no,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:no,value:Math.min(...e.map((t=>t.value)))}})),Tr("maxNumber",[],(function(){return{type:no,value:Qr}})),Tr("minNumber",[],(function(){return{type:no,value:Kr}})),Tr("maxInteger",[],(function(t){return qr(t,Fn),{type:eo,value:Fn}})),Tr("minInteger",[],(function(t){return qr(t,Vn),{type:eo,value:Vn}})),Tr("round",[no],(function(t,e){const n=Math.sign(e.value);return{type:no,value:n*Math.round(Math.abs(e.value))}})),Tr("floor",[no],(function(t,e){return{type:no,value:Math.floor(e.value)}})),Tr("ceil",[no],(function(t,e){return{type:no,value:Math.ceil(e.value)}})),Tr("signum",[eo],(function(t,e){return{type:eo,value:Pn(e.value)}})),Tr("signum",[no],(function(t,e){return{type:no,value:Math.sign(e.value)}})),Tr("copySign",[eo,eo],(function(t,e,n){let r;if(n.value===Sn)r=e.value;else if(e.value===Sn)r=Dn(0);else{const t=Pn(n.value);r=On(e.value)*t}return qr(t,r),{type:eo,value:r}})),Tr("copySign",[no,no],(function(t,e,n){let r=Math.sign(n.value);0===r&&(r=Object.is(r,0)?1:-1);const o=Math.abs(e.value)*r;return{type:no,value:o}})),Tr("getColorAlpha",[to],Vo),Tr("getColorAlpha",[oo],Vo),Tr("getColorRed",[to],Do),Tr("getColorRed",[oo],Do),Tr("getColorGreen",[to],So),Tr("getColorGreen",[oo],So),Tr("getColorBlue",[to],Oo),Tr("getColorBlue",[oo],Oo),Tr("setColorAlpha",[to,no],Po),Tr("setColorAlpha",[oo,no],Po),Tr("setColorRed",[to,no],Io),Tr("setColorRed",[oo,no],Io),Tr("setColorGreen",[to,no],Mo),Tr("setColorGreen",[oo,no],Mo),Tr("setColorBlue",[to,no],To),Tr("setColorBlue",[oo,no],To),Tr("rgb",[no,no,no],(function(t,e,n,r){const o={a:255,r:255*e.value,g:255*n.value,b:255*r.value};return{type:oo,value:Yr(o)}})),Tr("argb",[no,no,no,no],(function(t,e,n,r,o){const i={a:255*e.value,r:255*n.value,g:255*r.value,b:255*o.value};return{type:oo,value:Yr(i)}})),Tr("getDictString",[so,{type:to,isVararg:!0}],Uo),Tr("getStringFromDict",[so,{type:to,isVararg:!0}],Uo),Tr("getDictNumber",[so,{type:to,isVararg:!0}],Lo),Tr("getNumberFromDict",[so,{type:to,isVararg:!0}],Lo),Tr("getDictInteger",[so,{type:to,isVararg:!0}],Wo),Tr("getIntegerFromDict",[so,{type:to,isVararg:!0}],Wo),Tr("getDictBoolean",[so,{type:to,isVararg:!0}],Ho),Tr("getBooleanFromDict",[so,{type:to,isVararg:!0}],Ho),Tr("getDictColor",[so,{type:to,isVararg:!0}],qo),Tr("getColorFromDict",[so,{type:to,isVararg:!0}],qo),Tr("getDictUrl",[so,{type:to,isVararg:!0}],Jo),Tr("getUrlFromDict",[so,{type:to,isVararg:!0}],Jo),Tr("getDictOptString",[to,so,{type:to,isVararg:!0}],Yo),Tr("getOptStringFromDict",[to,so,{type:to,isVararg:!0}],Yo),Tr("getDictOptNumber",[no,so,{type:to,isVararg:!0}],Xo),Tr("getOptNumberFromDict",[no,so,{type:to,isVararg:!0}],Xo),Tr("getDictOptInteger",[eo,so,{type:to,isVararg:!0}],Qo),Tr("getOptIntegerFromDict",[eo,so,{type:to,isVararg:!0}],Qo),Tr("getDictOptBoolean",[ro,so,{type:to,isVararg:!0}],Ko),Tr("getOptBooleanFromDict",[ro,so,{type:to,isVararg:!0}],Ko),Tr("getDictOptColor",[oo,so,{type:to,isVararg:!0}],ti),Tr("getOptColorFromDict",[oo,so,{type:to,isVararg:!0}],ti),Tr("getDictOptColor",[to,so,{type:to,isVararg:!0}],ti),Tr("getOptColorFromDict",[to,so,{type:to,isVararg:!0}],ti),Tr("getDictOptUrl",[to,so,{type:to,isVararg:!0}],ei),Tr("getOptUrlFromDict",[to,so,{type:to,isVararg:!0}],ei),Tr("getDictOptUrl",[io,so,{type:to,isVararg:!0}],ei),Tr("getOptUrlFromDict",[io,so,{type:to,isVararg:!0}],ei),Tr("getDictFromDict",[so,{type:to,isVararg:!0}],Zo),Tr("getArrayFromDict",[so,{type:to,isVararg:!0}],Go),Tr("getArrayString",[lo,eo],oi),Tr("getStringFromArray",[lo,eo],oi),Tr("getArrayNumber",[lo,eo],ii),Tr("getNumberFromArray",[lo,eo],ii),Tr("getArrayInteger",[lo,eo],ai),Tr("getIntegerFromArray",[lo,eo],ai),Tr("getArrayBoolean",[lo,eo],si),Tr("getBooleanFromArray",[lo,eo],si),Tr("getArrayColor",[lo,eo],li),Tr("getColorFromArray",[lo,eo],li),Tr("getArrayUrl",[lo,eo],ci),Tr("getUrlFromArray",[lo,eo],ci),Tr("getArrayFromArray",[lo,eo],ui),Tr("getDictFromArray",[lo,eo],di),Tr("getArrayOptString",[lo,eo,to],pi),Tr("getOptStringFromArray",[lo,eo,to],pi),Tr("getArrayOptNumber",[lo,eo,no],vi),Tr("getOptNumberFromArray",[lo,eo,no],vi),Tr("getArrayOptInteger",[lo,eo,eo],gi),Tr("getOptIntegerFromArray",[lo,eo,eo],gi),Tr("getArrayOptBoolean",[lo,eo,ro],fi),Tr("getOptBooleanFromArray",[lo,eo,ro],fi),Tr("getArrayOptColor",[lo,eo,oo],hi),Tr("getOptColorFromArray",[lo,eo,oo],hi),Tr("getArrayOptColor",[lo,eo,to],hi),Tr("getOptColorFromArray",[lo,eo,to],hi),Tr("getArrayOptUrl",[lo,eo,io],mi),Tr("getOptUrlFromArray",[lo,eo,io],mi),Tr("getArrayOptUrl",[lo,eo,to],mi),Tr("getOptUrlFromArray",[lo,eo,to],mi),Tr("getOptArrayFromArray",[lo,eo],(function(t,e,n){try{return ui(t,e,n)}catch(t){return{type:lo,value:[]}}})),Tr("getOptDictFromArray",[lo,eo],(function(t,e,n){try{return di(t,e,n)}catch(t){return{type:so,value:{}}}})),Tr("len",[lo],(function(t,e){return{type:eo,value:Dn(e.value.length)}}));const bi={StringLiteral:function(t,e){return{type:to,value:e.value}},NumberLiteral:function(t,e){return{type:no,value:e.value}},IntegerLiteral:function(t,e){return qr(t,e.value),{type:eo,value:e.value}},BooleanLiteral:function(t,e){return{type:ro,value:e.value?1:0}},UnaryExpression:function(t,e){const n=Rr(_i(t,e.argument));switch(e.operator){case"!":if(n.type===ro)return{type:ro,value:n.value?0:1};Gr(`${e.operator}${Lr(n)}`,"A Boolean is expected after a unary not.");case"+":case"-":const r="+"===e.operator?1:-1;if(n.type===eo){const e=n.value*Dn(r);return qr(t,e),{type:eo,value:e}}if(n.type===no)return{type:no,value:n.value*r};Gr(`${e.operator}${Lr(n)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const n=Rr(_i(t,e.test));if(n.type===ro)return n.value?_i(t,e.consequent):_i(t,e.alternate);Gr(`${Lr(n)} ? ${Lr(_i(t,e.consequent))} : ${Lr(_i(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return _i(t,e.test)}catch(n){return _i(t,e.alternate)}},TemplateLiteral:function(t,e){let n="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return _i(t,e.expressions[0]);for(let r=0;r<e.expressions.length;++r)n+=e.quasis[r].value,n+=Ur(_i(t,e.expressions[r]));return n+=e.quasis[e.quasis.length-1].value,{type:to,value:n}},LogicalExpression:function(t,e){const n=Rr(_i(t,e.left));if(n.type!==ro&&Gr(`${Lr(n)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&n.value)return n;if("&&"===e.operator&&!n.value)return{type:ro,value:0};const r=Rr(_i(t,e.right));return r.type!==ro&&Gr(`${Lr(n)} ${e.operator} ${Lr(r)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Wr(r.type)}.`),{type:ro,value:r.value}},BinaryExpression:function(t,e){const n=e.operator,r=_i(t,e.left),o=_i(t,e.right);if(r.type!==o.type&&Gr(`${Lr(r)} ${e.operator} ${Lr(o)}`,`Operator '${n}' cannot be applied to different types: ${Wr(r.type)} and ${Wr(o.type)}.`),"=="===n||"!="===n)return function(t,e,n){let r;return r=e.type===ao&&n.type===ao?e.value.getTime()===n.value.getTime():e.value===n.value,"!="===t&&(r=!r),{type:ro,value:r?1:0}}(n,r,o);if(">"===n||">="===n||"<"===n||"<="===n)return function(t,e,n){let r;e.type!==no&&e.type!==eo&&e.type!==ao&&Gr(`${Lr(e)} ${t} ${Lr(n)}`,`Operator '${t}' cannot be applied to ${Wr(e.type)} type.`);const o=e.type===ao?e.value.getTime():e.value,i=n.type===ao?n.value.getTime():n.value;return r=">"===t?o>i:">="===t?o>=i:"<"===t?o<i:o<=i,{type:ro,value:r?1:0}}(n,r,o);if("+"===n||"-"===n)return function(t,e,n,r){if(n.type!==to&&n.type!==no&&n.type!==eo&&Gr(`${Lr(n)} ${e} ${Lr(r)}`,`Operator '${e}' cannot be applied to ${Wr(n.type)} type.`),n.type===to)return"-"===e&&Gr(`${Lr(n)} - ${Lr(r)}`,`Operator '${e}' cannot be applied to ${Wr(n.type)} type.`),{type:to,value:n.value+r.value};let o="+"===e?n.value+r.value:n.value-r.value;if(n.type===eo)try{o=Hr(0,o),qr(t,o)}catch(t){Gr(`${Lr(n)} ${e} ${Lr(r)}`,t.message)}return{type:n.type,value:o}}(t,n,r,o);if("/"===n||"*"===n||"%"===n)return function(t,e,n,r){let o;if(n.type!==eo&&n.type!==no&&Gr(`${Lr(n)} ${e} ${Lr(r)}`,`Operator '${e}' cannot be applied to ${Wr(n.type)} type.`),"*"===e)o=n.value*r.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(r.value)&&Gr(`${Lr(n)} ${e} ${Lr(r)}`,"Division by zero is not supported."),o="/"===e?n.value/r.value:n.value%r.value}if(n.type===eo)try{o=Hr(0,o),qr(t,o)}catch(t){Gr(`${Lr(n)} ${e} ${Lr(r)}`,t.message)}return{type:n.type,value:o}}(t,n,r,o);throw new Error(`Unsupported operation ${n}`)},CallExpression:function(t,e){const n=e.callee.name;let r;const o=e.arguments.map((e=>_i(t,e))),i=n+":"+o.map((t=>t.type)).join("#");if(Mr.has(i))r=Mr.get(i);else{const t=function(t,e){const n=Ir.get(t);if(!n)return{type:"missing"};let r=null;for(let t=0;t<n.length;++t){const o=zr(n[t],e);if("match"===o.type)return n[t];r||(r=o)}if(!r)throw new Error("Missing function");return r}(n,o);if("expected"in t||"type"in t&&"missing"===t.type){const e=o.map((t=>Wr(t.type))).join(", "),r=`${n}(${yi(o)})`;"few"===t.type&&0===o.length?Gr(r,`Non empty argument list is required for function '${n}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Gr(r,`Function '${n}' has no matching override for given argument types: ${e}.`):Gr(r,`Unknown function name: ${n}.`)}r=t}if(!r)throw new Error("Function not found");try{return r.cb(t,...o)}catch(t){Gr(`${n}(${yi(o)})`,t.message)}},Variable:function(t,e){const n=e.id.name,r=t.variables.get(n);if(r)return function(t){return{type:t.getType(),value:t.getValue()}}(r);throw new Error(`Variable '${n}' is missing.`)}};function _i(t,e){if(e.type in bi)return bi[e.type](t,e);throw new Error("Unsupported expression")}class wi{constructor(t){this.ast=t}apply(t,e,n=!1){try{const r=function(t,e){try{const n={variables:t,warnings:[],safeIntegerOverflow:!1},r=_i(n,e);return n.safeIntegerOverflow&&n.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:r,warnings:n.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,this.ast);r.warnings.forEach(e);const o=r.result;if("error"===o.type)return void e(st(new Error("Expression execution error"),{additional:{message:o.value}}));const i=o.value;if(i instanceof Date)return Br(i);if("boolean"===o.type)return Boolean(i);if("color"===o.type){const t=ft(String(i));if(t)return Yr(t);e(st(new Error("Expression execution error")))}if("integer"===o.type)return i>2147483647||i<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(i);if(!n&&("array"===o.type||"dict"===o.type))try{return JSON.stringify(i)}catch(t){return e(st(new Error(`Failed to stringify ${o.type}`))),`<${o.type}>`}return i}catch(t){return void e(st(new Error("Expression execution error")))}}}function $i(t,e,n){if(t)if("string"==typeof t){if((r=t).indexOf("@{")>-1||r.indexOf("\\")>-1){e.hasExpression=!0;try{const n=function(t,e){var n,r={},o=(e=void 0!==e?e:{}).grammarSource,i={start:Ve,JsonStringContents:function(){var t,e,n;for(t=me,e=[],n=De();n!==r;)e.push(n),n=De();return ye=t,Ot(e)}},a=Ve,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",j="!",A="(",F=")",V=",",D="'",S=".",O="e",P="E",I="true",M="false",T=/^[^}]/,z=/^[^'}]/,N=/^[0-9]/,R=/^[a-zA-Z_0-9.]/,B=/^[a-zA-Z_]/,U=/^[ \t\r\n]/,L=ke("@{",!1),W=ke("}",!1),H=ke("@{}",!1),q=ke("\\",!1),J={type:"any"},G=Ee(["}"],!0,!1),Z=ke("?",!1),Y=ke(":",!1),X=ke("!:",!1),Q=ke("||",!1),K=ke("&&",!1),tt=ke("==",!1),et=ke("!=",!1),nt=ke(">=",!1),rt=ke(">",!1),ot=ke("<=",!1),it=ke("<",!1),at=ke("+",!1),st=ke("-",!1),lt=ke("/",!1),ct=ke("*",!1),ut=ke("%",!1),dt=ke("!",!1),pt=ke("(",!1),vt=ke(")",!1),gt=ke(",",!1),ft=Ce("string"),ht=ke("'",!1),mt=Ee(["'","}"],!0,!1),yt=Ce("integer"),bt=Ee([["0","9"]],!1,!1),_t=Ce("number"),wt=ke(".",!1),$t=ke("e",!1),xt=ke("E",!1),kt=Ce("boolean"),Et=ke("true",!1),Ct=ke("false",!1),jt=Ee([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),At=Ce("identifier"),Ft=Ee([["a","z"],["A","Z"],"_"],!1,!1),Vt=Ce("whitespace"),Dt=Ee([" ","\t","\r","\n"],!1,!1),St=function(t){return t},Ot=function(t){return Vr(t)},Pt=function(t){return t},It=function(){return""},Mt=function(){return xe()},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(){throw new Error("Error tokenizing '"+t+"'.")},Nt=function(t){return t},Rt=function(t){return Sr(t)},Bt=function(){throw new Error("Error tokenizing '"+t+"'.")},Ut=function(t,e,n){return{type:"ConditionalExpression",test:t,consequent:e,alternate:n}},Lt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Wt=function(t,e){return Fr(t,e)},Ht=function(t,e){return Fr(t,e)},qt=function(t,e){return Ar(t,e)},Jt=function(t,e){return Ar(t,e)},Gt=function(t,e){return Ar(t,e)},Zt=function(t,e){return Ar(t,e)},Yt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Xt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Qt=function(t){return{type:"Variable",id:t}},Kt=function(t,e){return[t,...e]},te=function(t){return t},ee=function(t){return t},ne=function(t){return Vr(t)},re=function(t){return t},oe=function(){return""},ie=function(){return xe()},ae=function(){throw new Error("Error tokenizing '"+t+"'.")},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(t){return t},ce=function(t){return Sr(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:Dr(xe())}},pe=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ve=function(){return{type:"NumberLiteral",value:parseFloat(xe())}},ge=function(){return{type:"BooleanLiteral",value:!0}},fe=function(){return{type:"BooleanLiteral",value:!1}},he=function(){return{type:"Identifier",name:xe()}},me=0,ye=0,be=[{line:1,column:1}],_e=0,we=[],$e=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=i[e.startRule]}function xe(){return t.substring(ye,me)}function ke(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ee(t,e,n){return{type:"class",parts:t,inverted:e,ignoreCase:n}}function Ce(t){return{type:"other",description:t}}function je(e){var n,r=be[e];if(r)return r;for(n=e-1;!be[n];)n--;for(r={line:(r=be[n]).line,column:r.column};n<e;)10===t.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return be[e]=r,r}function Ae(t,e,n){var r=je(t),i=je(e),a={source:o,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:i.line,column:i.column}};return n&&o&&"function"==typeof o.offset&&(a.start=o.offset(a.start),a.end=o.offset(a.end)),a}function Fe(t){me<_e||(me>_e&&(_e=me,we=[]),we.push(t))}function Ve(){var t,e;return t=me,He(),(e=Se())!==r?(He(),ye=t,t=St(e)):(me=t,t=r),t}function De(){var e,n,o,i,a;if(e=me,t.substr(me,2)===s?(n=s,me+=2):(n=r,0===$e&&Fe(L)),n!==r?(o=He(),(i=Se())!==r?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=r,0===$e&&Fe(W)),a!==r?(ye=e,e=Pt(i)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r),e===r&&(e=me,t.substr(me,3)===c?(n=c,me+=3):(n=r,0===$e&&Fe(H)),n!==r&&(ye=e,n=It()),(e=n)===r&&(e=me,n=me,$e++,92===t.charCodeAt(me)?(o=u,me++):(o=r,0===$e&&Fe(q)),o===r&&(t.substr(me,2)===s?(o=s,me+=2):(o=r,0===$e&&Fe(L))),$e--,o===r?n=void 0:(me=n,n=r),n!==r?(t.length>me?(o=t.charAt(me),me++):(o=r,0===$e&&Fe(J)),o!==r?(ye=e,e=Mt()):(me=e,e=r)):(me=e,e=r),e===r))){if(e=me,t.substr(me,2)===s?(n=s,me+=2):(n=r,0===$e&&Fe(L)),n!==r){if(o=[],T.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(G)),i!==r)for(;i!==r;)o.push(i),T.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(G));else o=r;o!==r?(125===t.charCodeAt(me)?(i=l,me++):(i=r,0===$e&&Fe(W)),i!==r?(ye=e,e=Tt()):(me=e,e=r)):(me=e,e=r)}else me=e,e=r;e===r&&(e=me,t.substr(me,2)===s?(n=s,me+=2):(n=r,0===$e&&Fe(L)),n!==r&&(ye=e,n=zt()),(e=n)===r&&(e=me,92===t.charCodeAt(me)?(n=u,me++):(n=r,0===$e&&Fe(q)),n!==r?(t.substr(me,2)===s?(o=s,me+=2):(o=r,0===$e&&Fe(L)),o!==r?(ye=e,e=Nt(o)):(me=e,e=r)):(me=e,e=r),e===r&&(e=me,92===t.charCodeAt(me)?(n=u,me++):(n=r,0===$e&&Fe(q)),n!==r?(t.length>me?(o=t.charAt(me),me++):(o=r,0===$e&&Fe(J)),o!==r?(ye=e,e=Rt(o)):(me=e,e=r)):(me=e,e=r),e===r&&(e=me,92===t.charCodeAt(me)?(n=u,me++):(n=r,0===$e&&Fe(q)),n!==r&&(ye=e,n=Bt()),e=n))))}return e}function Se(){var e,n,o,i,a,s;return e=me,(n=Oe())!==r?(He(),63===t.charCodeAt(me)?(o=d,me++):(o=r,0===$e&&Fe(Z)),o!==r?(He(),(i=Se())!==r?(He(),58===t.charCodeAt(me)?(a=p,me++):(a=r,0===$e&&Fe(Y)),a!==r?(He(),(s=Se())!==r?(ye=e,e=Ut(n,i,s)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r),e===r&&(e=Oe()),e}function Oe(){var e,n,o,i;return e=me,(n=Pe())!==r?(He(),t.substr(me,2)===v?(o=v,me+=2):(o=r,0===$e&&Fe(X)),o!==r?(He(),(i=Se())!==r?(ye=e,e=Lt(n,i)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r),e===r&&(e=Pe()),e}function Pe(){var e,n,o,i,a,s,l,c;if(e=me,(n=Ie())!==r){for(o=[],i=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=r,0===$e&&Fe(Q)),s!==r?(l=He(),(c=Ie())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);i!==r;)o.push(i),i=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=r,0===$e&&Fe(Q)),s!==r?(l=He(),(c=Ie())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);ye=e,e=Wt(n,o)}else me=e,e=r;return e}function Ie(){var e,n,o,i,a,s,l,c;if(e=me,(n=Me())!==r){for(o=[],i=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=r,0===$e&&Fe(K)),s!==r?(l=He(),(c=Me())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);i!==r;)o.push(i),i=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=r,0===$e&&Fe(K)),s!==r?(l=He(),(c=Me())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);ye=e,e=Ht(n,o)}else me=e,e=r;return e}function Me(){var e,n,o,i,a,s,l,c;if(e=me,(n=Te())!==r){for(o=[],i=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=r,0===$e&&Fe(tt)),s===r&&(t.substr(me,2)===m?(s=m,me+=2):(s=r,0===$e&&Fe(et))),s!==r?(l=He(),(c=Te())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);i!==r;)o.push(i),i=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=r,0===$e&&Fe(tt)),s===r&&(t.substr(me,2)===m?(s=m,me+=2):(s=r,0===$e&&Fe(et))),s!==r?(l=He(),(c=Te())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);ye=e,e=qt(n,o)}else me=e,e=r;return e}function Te(){var e,n,o,i,a,s,l,c;if(e=me,(n=ze())!==r){for(o=[],i=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=r,0===$e&&Fe(nt)),s===r&&(62===t.charCodeAt(me)?(s=b,me++):(s=r,0===$e&&Fe(rt)),s===r&&(t.substr(me,2)===_?(s=_,me+=2):(s=r,0===$e&&Fe(ot)),s===r&&(60===t.charCodeAt(me)?(s=w,me++):(s=r,0===$e&&Fe(it))))),s!==r?(l=He(),(c=ze())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);i!==r;)o.push(i),i=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=r,0===$e&&Fe(nt)),s===r&&(62===t.charCodeAt(me)?(s=b,me++):(s=r,0===$e&&Fe(rt)),s===r&&(t.substr(me,2)===_?(s=_,me+=2):(s=r,0===$e&&Fe(ot)),s===r&&(60===t.charCodeAt(me)?(s=w,me++):(s=r,0===$e&&Fe(it))))),s!==r?(l=He(),(c=ze())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);ye=e,e=Jt(n,o)}else me=e,e=r;return e}function ze(){var e,n,o,i,a,s,l,c;if(e=me,(n=Ne())!==r){for(o=[],i=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=r,0===$e&&Fe(at)),s===r&&(45===t.charCodeAt(me)?(s=x,me++):(s=r,0===$e&&Fe(st))),s!==r?(l=He(),(c=Ne())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);i!==r;)o.push(i),i=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=r,0===$e&&Fe(at)),s===r&&(45===t.charCodeAt(me)?(s=x,me++):(s=r,0===$e&&Fe(st))),s!==r?(l=He(),(c=Ne())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);ye=e,e=Gt(n,o)}else me=e,e=r;return e}function Ne(){var e,n,o,i,a,s,l,c;if(e=me,(n=Re())!==r){for(o=[],i=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=r,0===$e&&Fe(lt)),s===r&&(42===t.charCodeAt(me)?(s=E,me++):(s=r,0===$e&&Fe(ct)),s===r&&(37===t.charCodeAt(me)?(s=C,me++):(s=r,0===$e&&Fe(ut)))),s!==r?(l=He(),(c=Re())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);i!==r;)o.push(i),i=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=r,0===$e&&Fe(lt)),s===r&&(42===t.charCodeAt(me)?(s=E,me++):(s=r,0===$e&&Fe(ct)),s===r&&(37===t.charCodeAt(me)?(s=C,me++):(s=r,0===$e&&Fe(ut)))),s!==r?(l=He(),(c=Re())!==r?i=a=[a,s,l,c]:(me=i,i=r)):(me=i,i=r);ye=e,e=Zt(n,o)}else me=e,e=r;return e}function Re(){var e,n,o;return(e=Le())===r&&(e=Ue())===r&&(e=me,33===t.charCodeAt(me)?(n=j,me++):(n=r,0===$e&&Fe(dt)),n===r&&(43===t.charCodeAt(me)?(n=$,me++):(n=r,0===$e&&Fe(at)),n===r&&(45===t.charCodeAt(me)?(n=x,me++):(n=r,0===$e&&Fe(st)))),n!==r?(He(),(o=Re())!==r?(ye=e,e=Yt(n,o)):(me=e,e=r)):(me=e,e=r),e===r&&(e=function(){var e,n,o,i,a;return e=me,(n=We())!==r?(He(),40===t.charCodeAt(me)?(o=A,me++):(o=r,0===$e&&Fe(pt)),o!==r?(He(),i=function(){var e,n,o,i,a,s;if(e=me,(n=Se())!==r){for(o=[],i=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=r,0===$e&&Fe(gt)),a!==r?(He(),(s=Se())!==r?i=s:(me=i,i=r)):(me=i,i=r);i!==r;)o.push(i),i=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=r,0===$e&&Fe(gt)),a!==r?(He(),(s=Se())!==r?i=s:(me=i,i=r)):(me=i,i=r);ye=e,e=Kt(n,o)}else me=e,e=r;return e===r&&(e=He()),e}(),i!==r?(He(),41===t.charCodeAt(me)?(a=F,me++):(a=r,0===$e&&Fe(vt)),a!==r?(ye=e,e=Xt(n,i)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r),e===r&&(e=me,(n=We())!==r&&(ye=e,n=Qt(n)),(e=n)===r&&(e=function(){var e,n,o,i;return e=function(){var e,n,o,i;return $e++,e=me,39===t.charCodeAt(me)?(n=D,me++):(n=r,0===$e&&Fe(ht)),n!==r?(o=function(){var t,e,n;for(t=me,e=[],n=Be();n!==r;)e.push(n),n=Be();return ye=t,ne(e)}(),39===t.charCodeAt(me)?(i=D,me++):(i=r,0===$e&&Fe(ht)),i!==r?(ye=e,e=ee(o)):(me=e,e=r)):(me=e,e=r),$e--,e===r&&(n=r,0===$e&&Fe(ft)),e}(),e===r&&(e=Le())===r&&(e=Ue())===r&&(e=function(){var e,n;return $e++,e=me,t.substr(me,4)===I?(n=I,me+=4):(n=r,0===$e&&Fe(Et)),n!==r&&(ye=e,n=ge()),(e=n)===r&&(e=me,t.substr(me,5)===M?(n=M,me+=5):(n=r,0===$e&&Fe(Ct)),n!==r&&(ye=e,n=fe()),e=n),$e--,e===r&&(n=r,0===$e&&Fe(kt)),e}(),e===r&&(e=me,40===t.charCodeAt(me)?(n=A,me++):(n=r,0===$e&&Fe(pt)),n!==r?(He(),(o=Se())!==r?(He(),41===t.charCodeAt(me)?(i=F,me++):(i=r,0===$e&&Fe(vt)),i!==r?(ye=e,e=te(o)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r))),e}())),e}())),e}function Be(){var e,n,o,i,a;if(e=me,t.substr(me,2)===s?(n=s,me+=2):(n=r,0===$e&&Fe(L)),n!==r?(o=He(),(i=Se())!==r?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=r,0===$e&&Fe(W)),a!==r?(ye=e,e=re(i)):(me=e,e=r)):(me=e,e=r)):(me=e,e=r),e===r&&(e=me,t.substr(me,3)===c?(n=c,me+=3):(n=r,0===$e&&Fe(H)),n!==r&&(ye=e,n=oe()),(e=n)===r&&(e=me,n=me,$e++,92===t.charCodeAt(me)?(o=u,me++):(o=r,0===$e&&Fe(q)),o===r&&(39===t.charCodeAt(me)?(o=D,me++):(o=r,0===$e&&Fe(ht)),o===r&&(t.substr(me,2)===s?(o=s,me+=2):(o=r,0===$e&&Fe(L)))),$e--,o===r?n=void 0:(me=n,n=r),n!==r?(t.length>me?(o=t.charAt(me),me++):(o=r,0===$e&&Fe(J)),o!==r?(ye=e,e=ie()):(me=e,e=r)):(me=e,e=r),e===r))){if(e=me,t.substr(me,2)===s?(n=s,me+=2):(n=r,0===$e&&Fe(L)),n!==r){if(o=[],z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(mt)),i!==r)for(;i!==r;)o.push(i),z.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(mt));else o=r;o!==r?(125===t.charCodeAt(me)?(i=l,me++):(i=r,0===$e&&Fe(W)),i!==r?(ye=e,e=ae()):(me=e,e=r)):(me=e,e=r)}else me=e,e=r;e===r&&(e=me,t.substr(me,2)===s?(n=s,me+=2):(n=r,0===$e&&Fe(L)),n!==r&&(ye=e,n=se()),(e=n)===r&&(e=me,92===t.charCodeAt(me)?(n=u,me++):(n=r,0===$e&&Fe(q)),n!==r?(t.substr(me,2)===s?(o=s,me+=2):(o=r,0===$e&&Fe(L)),o!==r?(ye=e,e=le(o)):(me=e,e=r)):(me=e,e=r),e===r&&(e=me,92===t.charCodeAt(me)?(n=u,me++):(n=r,0===$e&&Fe(q)),n!==r?(t.length>me?(o=t.charAt(me),me++):(o=r,0===$e&&Fe(J)),o!==r?(ye=e,e=ce(o)):(me=e,e=r)):(me=e,e=r),e===r&&(e=me,92===t.charCodeAt(me)?(n=u,me++):(n=r,0===$e&&Fe(q)),n!==r&&(ye=e,n=ue()),e=n))))}return e}function Ue(){var e,n,o,i;if($e++,e=me,45===t.charCodeAt(me)?(n=x,me++):(n=r,0===$e&&Fe(st)),n===r&&(n=null),o=[],N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(bt)),i!==r)for(;i!==r;)o.push(i),N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(bt));else o=r;return o!==r?(ye=e,e=de()):(me=e,e=r),$e--,e===r&&(n=r,0===$e&&Fe(yt)),e}function Le(){var e,n,o,i,a,s,l,c,u,d;for($e++,e=me,45===t.charCodeAt(me)?(n=x,me++):(n=r,0===$e&&Fe(st)),n===r&&(n=null),o=[],N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(bt));i!==r;)o.push(i),N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(bt));if(46===t.charCodeAt(me)?(i=S,me++):(i=r,0===$e&&Fe(wt)),i!==r){if(a=[],N.test(t.charAt(me))?(s=t.charAt(me),me++):(s=r,0===$e&&Fe(bt)),s!==r)for(;s!==r;)a.push(s),N.test(t.charAt(me))?(s=t.charAt(me),me++):(s=r,0===$e&&Fe(bt));else a=r;if(a!==r){if(s=me,101===t.charCodeAt(me)?(l=O,me++):(l=r,0===$e&&Fe($t)),l===r&&(69===t.charCodeAt(me)?(l=P,me++):(l=r,0===$e&&Fe(xt))),l!==r){if(43===t.charCodeAt(me)?(c=$,me++):(c=r,0===$e&&Fe(at)),c===r&&(45===t.charCodeAt(me)?(c=x,me++):(c=r,0===$e&&Fe(st))),c===r&&(c=null),u=[],N.test(t.charAt(me))?(d=t.charAt(me),me++):(d=r,0===$e&&Fe(bt)),d!==r)for(;d!==r;)u.push(d),N.test(t.charAt(me))?(d=t.charAt(me),me++):(d=r,0===$e&&Fe(bt));else u=r;u!==r?s=l=[l,c,u]:(me=s,s=r)}else me=s,s=r;s===r&&(s=null),ye=e,e=pe()}else me=e,e=r}else me=e,e=r;if(e===r){if(e=me,45===t.charCodeAt(me)?(n=x,me++):(n=r,0===$e&&Fe(st)),n===r&&(n=null),o=[],N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(bt)),i!==r)for(;i!==r;)o.push(i),N.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(bt));else o=r;if(o!==r)if(101===t.charCodeAt(me)?(i=O,me++):(i=r,0===$e&&Fe($t)),i===r&&(69===t.charCodeAt(me)?(i=P,me++):(i=r,0===$e&&Fe(xt))),i!==r){if(43===t.charCodeAt(me)?(a=$,me++):(a=r,0===$e&&Fe(at)),a===r&&(45===t.charCodeAt(me)?(a=x,me++):(a=r,0===$e&&Fe(st))),a===r&&(a=null),s=[],N.test(t.charAt(me))?(l=t.charAt(me),me++):(l=r,0===$e&&Fe(bt)),l!==r)for(;l!==r;)s.push(l),N.test(t.charAt(me))?(l=t.charAt(me),me++):(l=r,0===$e&&Fe(bt));else s=r;s!==r?(ye=e,e=ve()):(me=e,e=r)}else me=e,e=r;else me=e,e=r}return $e--,e===r&&(n=r,0===$e&&Fe(_t)),e}function We(){var e,n,o,i,a;if($e++,e=me,n=me,$e++,o=function(){var e,n,o,i;return e=me,t.substr(me,4)===I?(n=I,me+=4):(n=r,0===$e&&Fe(Et)),n===r&&(t.substr(me,5)===M?(n=M,me+=5):(n=r,0===$e&&Fe(Ct))),n!==r?(o=me,$e++,R.test(t.charAt(me))?(i=t.charAt(me),me++):(i=r,0===$e&&Fe(jt)),$e--,i===r?o=void 0:(me=o,o=r),o!==r?e=n=[n,o]:(me=e,e=r)):(me=e,e=r),e}(),$e--,o===r?n=void 0:(me=n,n=r),n!==r)if(B.test(t.charAt(me))?(o=t.charAt(me),me++):(o=r,0===$e&&Fe(Ft)),o!==r){for(i=[],R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=r,0===$e&&Fe(jt));a!==r;)i.push(a),R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=r,0===$e&&Fe(jt));ye=e,e=he()}else me=e,e=r;else me=e,e=r;return $e--,e===r&&(n=r,0===$e&&Fe(At)),e}function He(){var e,n;for($e++,e=[],U.test(t.charAt(me))?(n=t.charAt(me),me++):(n=r,0===$e&&Fe(Dt));n!==r;)e.push(n),U.test(t.charAt(me))?(n=t.charAt(me),me++):(n=r,0===$e&&Fe(Dt));return $e--,n=r,0===$e&&Fe(Vt),e}if((n=a())!==r&&me===t.length)return n;throw n!==r&&me<t.length&&Fe({type:"end"}),function(t,e,n){return new Or(Or.buildMessage(t,e),t,e,n)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Ae(_e,_e+1):Ae(_e,_e))}(t,{startRule:"JsonStringContents"}),r=Jr(n);return e.vars.push(...r),new wi(n)}catch(e){return void n(st(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>$i(t,e,n)));if("object"==typeof t){const r={};for(const o in t)r[o]=$i(t[o],e,n);return r}}var r;return t}function xi(t,e,n,r=!1){if(t){if(t instanceof wi)return t.apply(e,n,r);if(Array.isArray(t))return t.map((t=>xi(t,e,n)));if("object"==typeof t){const r={};for(const o in t)r[o]=xi(t[o],e,n);return r}}return t}function ki(t,e){const n={vars:[],hasExpression:!1},r=$i(t,n,e);return{vars:[...new Set(n.vars)],hasExpression:n.hasExpression,applyVars:(t,n)=>xi(r,t,e,n)}}const Ei={pagers:function(){return Q(new Map)}},Ci=new Map,ji=new Map;function Ai(t){const e=Ci.get(t)||Q("");return Ci.has(t)||Ci.set(t,e),e}function Fi(t){const e=ji.get(t)||new Map;return ji.has(t)||ji.set(t,e),e}class Vi{setVariable(t){const e=t.getName(),n=Fi(this);if(n.has(e))throw new Error("Variable with the same name already exist");n.set(e,t),Ai(this).set(e)}getVariable(t){return Fi(this).get(t)}list(){return Fi(this).values()}}function Di(){return new Vi}function Si(t,e,n){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Oi=new Set(["start","stop","pause","resume","cancel","reset"]);class Pi{constructor(t){Si(this,"timers",new Map),Si(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(st(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(st(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Oi.has(e)))return void this.logError(st(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const n=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:n});const r=this.timers.get(t);this[n](r)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),n=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&n>t.duration||(this.updateVariable(t,n),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const n=t.tick;if(n){const e=()=>{const r=t.tickStarted=performance.now(),o=Math.max(0,n-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-r-o)%n,e()}),o)};e()}}start(t){if("running"===t.state)return void this.logError(st(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(st(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(st(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(st(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(st(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(st(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(st(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const n=t.definition.value_variable;n&&t.durationPassed&&this.setVariableValue(n,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(st(new Error("The timer is already running"))):this.logError(st(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const n=t.definition.value_variable;n&&this.setVariableValue(n,Math.round(e))}callActions(t,e){const n=t.definition["end"===e?"end_actions":"tick_actions"];if(n){const t=this.applyVars(n);this.execAnyActions(t,{processUrls:!1})}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}function Ii(t,e,n,r){const{variable_name:o}=n;if(!o)return void e(st(new Error(`Incorrect ${n.type} action`),{additional:{name:o}}));const i=t.get(o);if(!i)return void e(st(new Error("Cannot find variable"),{additional:{name:o}}));const a=i.getType();"array"===a?r(i):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:o,type:a}}))}let Mi=Q(!0),Ti=0;function zi(){Mi.set(!1)}function Ni(){Mi.set(!0)}function Ri(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Bi=L(((t,e,n,r)=>{let o,i,a,s;var c,u,d,p;let{id:f}=e,{json:h={}}=e,{platform:m="auto"}=e,{theme:y="system"}=e,{globalVariablesController:b=new Vi}=e,{mix:_=""}=e,{customization:w={}}=e,{builtinProtocols:x=["http","https","tel","mailto","intent"]}=e,{extensions:k=new Map}=e,{onError:E}=e,{onStat:C}=e,{onCustomAction:j}=e,{onComponent:A}=e,{typefaceProvider:F=(t=>"")}=e,{fetchInit:V={}}=e,{tooltipRoot:D}=e,{customComponents:S}=e,O=Q("desktop"===m);if(s=l(O,(t=>a=t)),"auto"===m&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");O.set(!t.matches),t.addListener((()=>{O.set(!t.matches)}))}let P="light",M=null;function T(t){y=t}function z(){return new Map}function N(){return new Map}function B(t){h=t}const U=new Set(x);let L=!1,W=!1;f||(W=!0,ot(st(new Error('"id" prop is required'))));const H={stateChange:!1},q=Ai(b),J=Fi(b),G=new Map,Z=new Map,Y=new Map;let X=null,tt=0,et=[];function nt(t,e,n=!1){const r=ki(t,ot);if(!r.hasExpression)return t;const o=Ri(Z,e);return r.applyVars(o,n)}function ot(t){E?E({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function it(t,e){C&&C({type:t,action:e})}function lt(t,e){if(!t)return{json:t,templateContext:e};const n=new Set([t.type]);for(;t.type&&t.type in o;){if(({json:t,templateContext:e}=Er(t,e,o,ot)),n.has(t.type))return{json:t,templateContext:e};n.add(t.type)}return{json:t,templateContext:e}}let ct=0;function ut(t){return`${f}-${ct++}`}let dt={},pt={};function vt(t){gt(nt(t))}function gt(t,e){const n=t.url?String(t.url):"",r=t.typed;if(!Lt(t))return;const i=(null==e?void 0:e.logError)||ot;if(n)try{const r=n.replace(/div-action:\/\//,""),a=/([^?]+)\?(.+)/.exec(r);if(!a)return;const s=new URLSearchParams(a[2]);switch(a[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=Ct,n=t.split("/");if(n=["root",...n],n.length<2||n.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<n.length;t+=2){const r=n[t],o=n[t+1];let i=e.getChild(r);if(!i)return;i.setState(o),e=i}}(s.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const n=$t(t);n&&n.setCurrentItem(Number(e))}(s.get("id"),s.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const n=$t(t);n&&n.setPreviousItem(e)}(s.get("id"),s.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const n=$t(t);n&&n.setNextItem(e)}(s.get("id"),s.get("overflow"));break;case"set_variable":const a=s.get("name"),l=s.get("value");if(a&&null!==l){const t=Z.get(a);if(t){const e=t.getType();"dict"===e||"array"===e?i(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:a}})):t.set(l)}else i(st(new Error("Cannot find variable"),{additional:{name:a}}))}else i(st(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const c=s.get("action"),u=s.get("id");X?X.execTimerAction(u,c):i(st(new Error("Incorrect timer action"),{additional:{id:u,action:c}}));break;case"video":!function(t,e,n){const r=(null==n?void 0:n.logError)||ot;if(t){const n=$t(t);n?"start"===e?n.start():"pause"===e?n.pause():r(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):r(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else r(st(new Error("Missing id in video action"),{additional:{action:e}}))}(s.get("id"),s.get("action"),e);break;case"download":!function(t,e,n){const r=(null==n?void 0:n.logError)||ot;if(t){let n;n="function"==typeof V?V(t):V,fetch(t,n).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((n=>{var i,a,s;if(n){if(n.templates)for(const t in n.templates)o.hasOwnProperty(t)||(o[t]=n.templates[t]);if(Array.isArray(null===(i=n.patch)||void 0===i?void 0:i.changes)){if("transactional"===n.patch.mode){const o=n.patch.changes.find((t=>{const e=bt.get(t.id);if(!e)return!0;const n=Array.isArray(t.items)?t.items.length:0;return!(!e.isSingleMode||1===n)}));if(o)return r(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:o.id}})),void ft(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}n.patch.changes.forEach((t=>{const e=bt.get(t.id);e&&e.replaceWith(t.id,t.items)})),ft(null===(s=e.download_callbacks)||void 0===s?void 0:s.on_success_actions)}}else r(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((n=>{var o;r(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:n}})),ft(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_fail_actions)}))}else r(st(new Error("Missing url in download action"),{additional:{url:t}}))}(s.get("url"),t,e);break;case"show_tooltip":!function(t,e,n){var r;const o=(null==n?void 0:n.logError)||ot;if(!t)return void o(st(new Error("Missing id in show_tooltip action")));const i=wt.get(t);if(!i)return void o(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&et.some((e=>e.desc.id===t)))return;const a={internalId:++tt,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};et=[...et,a];const s=null!==(r=i.tooltip.duration)&&void 0!==r?r:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,et=et.filter((t=>t.internalId!==a.internalId))}),s))}(s.get("id"),s.get("multiple"),e);break;case"hide_tooltip":!function(t,e){const n=(null==e?void 0:e.logError)||ot;t?et=et.filter((e=>{const n=e.desc.id!==t;return!n&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),n})):n(st(new Error("Missing id in hide_tooltip action")))}(s.get("id"),e);break;default:i(st(new Error("Unknown type of action"),{additional:{url:n}}))}}catch(t){i(st(t,{additional:{url:n}}))}else if(r)switch(r.type){case"set_variable":{const{variable_name:t,value:e}=r;if(t&&e){const n=Z.get(t);n?n.getType()===e.type?n.setValue(e.value):i(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):i(st(new Error("Cannot find variable"),{additional:{name:t}}))}else i(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,n){const{variable_name:r,index:o,value:i}=n;!i||"number"!=typeof o&&void 0!==o?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:r}})):Ii(t,e,n,(t=>{const a=t.getValue();if("number"==typeof o&&(o<0||o>a.length))e(st(new Error(`Index out of bound for mutation ${n.type}`),{additional:{name:r,index:o,length:a.length}}));else{const e=a.slice();"number"==typeof o?e.splice(o,0,i.value):e.push(i.value),t.setValue(e)}}))}(Z,i,r);break;case"array_remove_value":!function(t,e,n){const{variable_name:r,index:o}=n;"number"==typeof o?Ii(t,e,n,(t=>{const i=t.getValue();if("number"==typeof o&&(o<0||o>=i.length))e(st(new Error(`Index out of bound for mutation ${n.type}`),{additional:{name:r,index:o,length:i.length}}));else{const e=i.slice();e.splice(o,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:r}}))}(Z,i,r);break;case"copy_to_clipboard":!function(t,e){!e.content||"text"!==e.content.type&&"url"!==e.content.type||"string"!=typeof e.content.value?t(st(new Error("Incorrect action"),{additional:{action:e}})):"undefined"!=typeof navigator&&"clipboard"in navigator&&navigator.clipboard&&"writeText"in navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e.content.value).catch((e=>{t(st(new Error("Failed to copy to the clipboard"),{additional:{originalError:String(e)}}))})):t(st(new Error("Clipboard is unavailable"),{additional:{action:e}}))}(i,r);break;case"focus_element":{const t=r.element_id&&_t.get(r.element_id);t?t.focus():i(st(new Error("Incorrect focus_element action"),{additional:{elementId:r.element_id}}));break}default:i(st(new Error("Unknown type of action"),{additional:{type:r.type}}))}}async function ft(t,e={}){if(!t||!Array.isArray(t))return;const n=t.filter(Lt);for(let t=0;t<n.length;++t){let r=n[t];const o=r.url,i=r.typed;if(o){const t=xt(o);if(t)if(kt(t,U)){if(e.processUrls)if("_blank"===r.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=o)}else location.href=o}else"div-action"===t?(gt(r,e.componentContext),await $()):r.log_id&&(ht(r),await $())}else i&&gt(r,e.componentContext)}n.forEach((t=>{t.log_id&&it("click",t)}))}function ht(t){null==j||j(t)}const yt=new Map,bt=new Map,_t=new Map,wt=new Map;function $t(t){if(yt.has(t))return yt.get(t);ot(st(new Error("Missing instance with id"),{additional:{id:t}}))}const Et=new Map;g(at,{logStat:it,hasTemplate:function(t){return t in o},processTemplate:lt,genId:ut,genClass:function(t){return`divkit-${ut()}`},execAction:gt,execCustomAction:ht,isRunning:function(t){return H[t]},setRunning:function(t,e){H[t]=e},registerInstance:function(t,e){yt.has(t)?ot(st(new Error("Duplicate instance id"),{additional:{id:t}})):yt.set(t,e)},unregisterInstance:function(t){yt.delete(t)},registerParentOf:function(t,e){bt.set(t,e)},unregisterParentOf:function(t){bt.delete(t)},registerTooltip:function(t,e){const n=e.id;n&&(wt.has(n)&&ot(st(new Error("Duplicate tooltip id"),{additional:{id:n}})),wt.set(n,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(wt.delete(e),et.some((t=>t.desc.id===e))&&(et=et.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){et=et.filter((e=>e.internalId!==t))},tooltipRoot:D,registerFocusable:function(t,e){_t.set(t,e)},unregisterFocusable:function(t){_t.delete(t)},addSvgFilter:function(t,e){const n=`${t}:${e}`;if(pt[n]=pt[n]||0,++pt[n],dt[n])return dt[n];const r=`${ut()}-svg-filter`;return dt=Object.assign(Object.assign({},dt),{[n]:r}),r},removeSvgFilter:function(t,e){if(!t)return;const n=`${t}:${e}`;pt[n]&&0==--pt[n]&&(dt=Object.keys(dt).reduce(((t,e)=>(pt[e]&&(t[e]=dt[e]),t)),{}))},preparePrototypeVariables:function(t,e){const n=new Map,r=function(t,e,n){if(!(e in Zn))throw new Error("Unsupported variable type");return new Zn[e](t,n)}(t,"dict",e);return n.set(t,r),n},getStore:function(t){return Et.has(t)||function(t){Et.has(t)||Et.set(t,Ei[t]())}(t),Et.get(t)},getCustomization:function(t){return null==w?void 0:w[t]},getBuiltinProtocols:function(){return U},getExtension:function(t,e){const n=k.get(t);if(n)return new n(e||{})},getExtensionContext:function(){return{variables:Z,logError:ot}},typefaceProvider:F,isDesktop:O,isPointerFocus:Mi,customComponents:S,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const Ct={setState(t){throw new Error("Not implemented")},getChild(t){if(jt&&jt.has(t))return jt.get(t);ot(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let jt=null;function At(t){if(t.type in Wn){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&ot(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Hn(t.name,t.type,t.value);G.set(t.name,e),Z.set(t.name,e)}catch(e){ot(st(e,{additional:{name:t.name}}))}}}g(Ft,{registerInstance(t,e){jt||(jt=new Map),jt.has(t)?ot(st(new Error("Duplicate state with id"),{additional:{id:t}})):jt.set(t,e)},unregisterInstance(t){null==jt||jt.delete(t)},runVisibilityTransition:(t,e,n,r,o)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,n,r)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,n,r)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,n,r)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const Vt=null===(c=null==h?void 0:h.card)||void 0===c?void 0:c.variables;Array.isArray(Vt)&&Vt.forEach((t=>{if(t&&t.name){if(G.has(t.name))return void ot(st(new Error("Duplicate variable"),{additional:{name:t.name}}));At(t)}}));const Dt=h.palette;Dt&&Dt[P].forEach((t=>{if(G.has(t.name))ot(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Hn(t.name,"color",t.color);G.set(t.name,e),Z.set(t.name,e)}catch(e){ot(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)Z.has(t)||Z.set(t,e);q.subscribe((t=>{if(t&&!Z.has(t)){const e=J.get(t);Z.set(t,e);const n=Y.get(t);if(n){let t=0;e.subscribe((()=>{n.set(++t)}))}}}));const St=null===(d=null==h?void 0:h.card)||void 0===d?void 0:d.timers;if(St&&"undefined"!=typeof document){const t=X=new Pi({logError:ot,applyVars:nt,hasVariableWithType:function(t,e){const n=Z.get(t);return(null==n?void 0:n.getType())===e},setVariableValue:function(t,e){const n=Z.get(t);n?n.setValue(e):ot(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:ft});St.forEach((e=>t.createTimer(e)))}const Ot=function t(e){const n={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=n.path.join("/"),ot(t)},execAnyActions:(t,e={})=>ft(t,{componentContext:n,processUrls:e.processUrls}),getDerivedFromVars:(t,e,r=!1)=>function(t,e,n=!1){if(!t)return jr(t);const r=Ri(Z,e),o=ki(t,ot);return o.vars.length?K(o.vars.map((t=>r.get(t)||function(t){const e=Y.get(t)||Q(void 0);return Y.has(t)||Y.set(t,e),e}(t))).filter(mt),(()=>o.applyVars(r,n))):o.hasExpression?jr(o.applyVars(r)):jr(t)}(t,Ri(n.variables,e),r),getJsonWithVars:(t,e,r=!1)=>nt(t,Ri(n.variables,e),r),produceChildContext(e,r={}){const o=t(n);let i=e,a=n.templateContext;const{templateContext:s,json:l}=lt(i,a);return o.json=l,o.templateContext=s,o.origJson=e,void 0!==r.path&&o.path.push(String(r.path)),e.type&&!r.isRootState&&o.path.push(e.type),o.variables=Ri(n.variables,r.variables),r.tooltips&&(o.tooltips=r.tooltips),r.fake&&(o.fakeElement=!0),r.isRootState&&(o.isRootState=!0),o},getVariable(t,e){const r=(n.variables||Z).get(t);if(r){const o=r.getType();if(o!==e)return void n.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:o}}))}return r}};return e?(n.path=e.path.slice(),e.fakeElement&&(n.fakeElement=!0)):(n.json={type:"root"},n.isRootState=!0),n}();let Pt;v((()=>{Ti--,Ti||(window.removeEventListener("keydown",zi),window.removeEventListener("pointerdown",Ni)),X&&X.destroy(),et.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&n.id&&void 0!==f&&n.id(f),void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.platform&&n.platform&&void 0!==m&&n.platform(m),void 0===e.theme&&n.theme&&void 0!==y&&n.theme(y),void 0===e.globalVariablesController&&n.globalVariablesController&&void 0!==b&&n.globalVariablesController(b),void 0===e.mix&&n.mix&&void 0!==_&&n.mix(_),void 0===e.customization&&n.customization&&void 0!==w&&n.customization(w),void 0===e.builtinProtocols&&n.builtinProtocols&&void 0!==x&&n.builtinProtocols(x),void 0===e.extensions&&n.extensions&&void 0!==k&&n.extensions(k),void 0===e.onError&&n.onError&&void 0!==E&&n.onError(E),void 0===e.onStat&&n.onStat&&void 0!==C&&n.onStat(C),void 0===e.onCustomAction&&n.onCustomAction&&void 0!==j&&n.onCustomAction(j),void 0===e.onComponent&&n.onComponent&&void 0!==A&&n.onComponent(A),void 0===e.typefaceProvider&&n.typefaceProvider&&void 0!==F&&n.typefaceProvider(F),void 0===e.fetchInit&&n.fetchInit&&void 0!==V&&n.fetchInit(V),void 0===e.tooltipRoot&&n.tooltipRoot&&void 0!==D&&n.tooltipRoot(D),void 0===e.customComponents&&n.customComponents&&void 0!==S&&n.customComponents(S),void 0===e.setTheme&&n.setTheme&&void 0!==T&&n.setTheme(T),void 0===e.getDebugVariables&&n.getDebugVariables&&void 0!==z&&n.getDebugVariables(z),void 0===e.getDebugAllVariables&&n.getDebugAllVariables&&void 0!==N&&n.getDebugAllVariables(N),void 0===e.setData&&n.setData&&void 0!==B&&n.setData(B),void 0===e.execAction&&n.execAction&&void 0!==vt&&n.execAction(vt),"light"===y||"dark"===y?P=y:"system"===y?"undefined"!=typeof matchMedia?(M||(M=matchMedia("(prefers-color-scheme: dark)"),M.addListener((function(){"system"===y&&M&&(P=M.matches?"dark":"light")}))),P=M.matches?"dark":"light"):P="light":ot(st(new Error("Unsupported theme"))),P&&Dt&&Dt[P].forEach((t=>{const e=Z.get(t.name);e&&e.setValue(t.color)}));{L=!1;const t=function(t){if(!t)return st(new Error("Missing object"));const e=t.card,n=t.templates||{};if(!e)return st(new Error("Missing card"));if(!e.states||!e.states.length)return st(new Error("Missing states"));for(const t in n)if(n.hasOwnProperty(t)&&t in $r)return st(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return st(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return st(new Error("Missing state_id"),{additional:{index:t}})}return null}(h);t&&(L=!0,ot(t))}if(o=h.templates||{},(null===(u=null==h?void 0:h.card)||void 0===u?void 0:u.variables)&&Array.isArray(h.card.variables)&&h.card.variables!==Vt&&h.card.variables.forEach((t=>{t&&t.name&&!G.has(t.name)&&At(t)})),i=null===(p=null==h?void 0:h.card)||void 0===p?void 0:p.states,i&&!L&&!W){const t={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:i.map((t=>({state_id:t.state_id.toString(),div:t.div})))};Pt=Ot.produceChildContext(t,{tooltips:et,isRootState:!0})}return s(),L||W||!Pt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${rt}`:"",!0)+I(_?` ${_}`:"",!0)}">${R(kr,"RootSvgFilters").$$render(t,{svgFiltersMap:dt},{},{})} ${R(xr,"Unknown").$$render(t,{componentContext:Pt},{},{})}</div>`})),Ui=Bi;function Li(t){return Ui.render(t).html}var Wi=exports;for(var Hi in e)Wi[Hi]=e[Hi];e.__esModule&&Object.defineProperty(Wi,"__esModule",{value:!0})})();
2
2
  //# sourceMappingURL=server.js.map