@divkitframework/divkit 29.3.0 → 29.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.css +1 -1
- package/dist/client.css.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/typings/common.d.ts +2 -0
package/dist/esm/server.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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)},e={};t.d(e,{M:()=>fo,Os:()=>Ir,sY:()=>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 P(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 S=/[&"]/g,O=/[&<]/g;function I(t,e=!1){const r=String(t),i=e?S: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?"&":'"'===e?""":"<"),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,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),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 Pt(t){return jt(t)&&t>=0}function St(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]&&!Pt(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]]&&!Pt(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}let Lt;function Wt(){}const Ht=Symbol("action"),qt=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=Wt}=e,{customAction:p=null}=e,{isNativeActionAnimation:h=!0}=e,{hasInnerFocusable:m=!1}=e;const y=f(at),b=f(Ht);let _;g(Ht,{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${P([{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${P([{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>`})),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,P,S,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,Wt=o,Ht=o,Gt=o,Zt=o,{json:Yt={}}=e,{origJson:Xt}=e,{templateContext:ee}=e,{cls:re=""}=e,{style:ie}=e,{layoutParams:ne={}}=e,{customDescription:oe=!1}=e,{customPaddings:ae=!1}=e,{customActions:se=""}=e,{additionalPaddings:le=null}=e,{heightByAspect:ce=!1}=e,{parentOf:ue}=e,{parentOfSimpleMode:de}=e,{replaceItems:pe}=e,{hasInnerFocusable:ve=!1}=e;const ge=f(at),fe=f(Vt);let he,me;I=l(ge.isPointerFocus,(t=>O=t));let ye,be,_e,we,$e,xe,ke,Ee,Ce,Ae,Fe,Ve,De,je,Pe,Se,Oe,Ie,Me,Te,ze=null,Ne=[],Be={},Re={},Je=!1,Ue=1,Le="transparent",We=0,He={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},qe="",Ge=null,Ze="",Ye={},Xe=0,Qe=0,Ke=0,tr=!1,er=!1,rr={},ir=0,nr=0,or=0,ar=!1,sr=!1,lr=1,cr=[],ur=!1,dr=!1,pr=[],vr=[],gr=[],fr=[],hr=[],mr=[],yr="",br=!1,_r="visible",wr=0,$r=0,xr=!1,kr=null;function Er(t,e){if(!Array.isArray(ue)||!pe)return;if(de&&1!==(Array.isArray(e)&&e.length||0))return;const r=ue.findIndex((e=>(null==e?void 0:e.id)===t)),i=ue.slice();i.splice(r,1,...e||[]),ue=i,pe(i)}function Cr(){if(ze&&he){const t=ge.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,he,t)})),ze=null}}function Ar(){Yt.focus&&(O||(xr=!0),ge.execAnyActions(fr))}function Fr(){Yt.focus&&(xr=!1,ge.execAnyActions(hr))}v((()=>{var t;Ne.forEach((t=>{ge.unregisterParentOf(t)})),Ne=[],null===(t=Yt.tooltips)||void 0===t||t.forEach((t=>{ge.unregisterTooltip(t)})),Cr()})),void 0===e.json&&r.json&&void 0!==Yt&&r.json(Yt),void 0===e.origJson&&r.origJson&&void 0!==Xt&&r.origJson(Xt),void 0===e.templateContext&&r.templateContext&&void 0!==ee&&r.templateContext(ee),void 0===e.cls&&r.cls&&void 0!==re&&r.cls(re),void 0===e.style&&r.style&&void 0!==ie&&r.style(ie),void 0===e.layoutParams&&r.layoutParams&&void 0!==ne&&r.layoutParams(ne),void 0===e.customDescription&&r.customDescription&&void 0!==oe&&r.customDescription(oe),void 0===e.customPaddings&&r.customPaddings&&void 0!==ae&&r.customPaddings(ae),void 0===e.customActions&&r.customActions&&void 0!==se&&r.customActions(se),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==le&&r.additionalPaddings(le),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ce&&r.heightByAspect(ce),void 0===e.parentOf&&r.parentOf&&void 0!==ue&&r.parentOf(ue),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==de&&r.parentOfSimpleMode(de),void 0===e.replaceItems&&r.replaceItems&&void 0!==pe&&r.replaceItems(pe),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ve&&r.hasInnerFocusable(ve),Yt&&ne&&(Ge=null,Ze="",lr=1,br=!1,_r="visible",wr=0,$r=0,Ie=void 0,Me=void 0,cr=ne.fakeElement?[]:Yt.transition_triggers||["state_change","visibility_change"],ur=Boolean(-1!==cr.indexOf("state_change")&&Yt.id),dr=Boolean(-1!==cr.indexOf("visibility_change")&&Yt.id)),n=ge.getDerivedFromVars(Yt.focus),lt(),lt=l(n,(t=>N=t)),a=ge.getDerivedFromVars(Yt.border),Zt(),Zt=l(a,(t=>rt=t)),s=ge.getDerivedFromVars(Yt.paddings),Gt(),Gt=l(s,(t=>et=t)),c=ge.getDerivedFromVars(Yt.margins),Wt(),Wt=l(c,(t=>Q=t)),u=ge.getDerivedFromVars(Yt.width),jt(),jt=l(u,(t=>Y=t)),d=ge.getDerivedFromVars(Yt.alignment_horizontal),Ht(),Ht=l(d,(t=>tt=t)),p=ge.getDerivedFromVars(Yt.height),At(),At=l(p,(t=>Z=t)),g=ge.getDerivedFromVars(Yt.alignment_vertical),It(),It=l(g,(t=>X=t)),h=ge.getDerivedFromVars(Yt.alpha),$t(),$t=l(h,(t=>G=t)),m=ge.getDerivedFromVars(Yt.accessibility),wt(),wt=l(m,(t=>q=t)),y=ge.getDerivedFromVars(Yt.background),_t(),_t=l(y,(t=>H=t)),b=ge.getDerivedFromVars(Yt.action),ht(),ht=l(b,(t=>U=t)),_=ge.getDerivedFromVars(Yt.actions),bt(),bt=l(_,(t=>W=t)),w=ge.getDerivedFromVars(Yt.doubletap_actions),ft(),ft=l(w,(t=>J=t)),x=ge.getDerivedFromVars(Yt.longtap_actions),vt(),vt=l(x,(t=>R=t)),k=ge.getDerivedFromVars(Yt.action_animation),ot(),ot=l(k,(t=>z=t)),E=ge.getDerivedFromVars(Yt.visibility),nt(),nt=l(E,(t=>T=t)),C=ge.getDerivedFromVars(Yt.transform),it(),it=l(C,(t=>M=t)),Ne.forEach((t=>{ge.unregisterParentOf(t)})),Ne=[],ue&&ue.forEach((t=>{(null==t?void 0:t.id)&&(Ne.push(t.id),ge.registerParentOf(t.id,{replaceWith:Er,isSingleMode:Boolean(de)}))}));{const t=xr&&(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,Ue=Ot(t.stroke.width,Ue),Le=gt(t.stroke.color,1,Le),r.border=`${dt(Ue)} solid ${Le}`),t.corners_radius?(He=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]&&!Pt(r[t]))return e;return t}(t.corners_radius,He),r["border-radius"]=e["border-radius"]=Jt(He)):t.corner_radius&&(We=Ot(t.corner_radius,We),He={"top-left":We,"top-right":We,"bottom-right":We,"bottom-left":We},r["border-radius"]=e["border-radius"]=dt(We)),i&&Ue&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},He);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Ue/2})),n=Jt(t)}}Be=Tt(e,Be),Re=Tt(r,Re),Je=i,qe=n}Ge=Rt(et&&!ae?et:void 0,Ge),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}(Ge,le)),Ze=St(Q,Ze);{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)Xe=Ot(null==Y?void 0:Y.value,Xe),e=dt(Xe);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)&&(n["width-constrained"]=!0,"horizontal"===ne.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&Pt(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Pt(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"!==c&&c||ge.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,ge.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&&(o=Y&&"weight"in Y&&Y.weight||1,ne.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]:ne.parentHAlign||"start"}t&&(n.width=t),ye=e,be=r,_e=i,Qe=o,Ke=a,Ye=Tt(n,Ye),tr=s,er=l}{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ce);else if("fixed"===c)ir=Ot(null==Z?void 0:Z.value,ir),e=dt(ir);else if("match_parent"!==c||ne.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&ne.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===ne.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&Pt(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&Pt(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"===c&&ge.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,ge.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&&(o=(null==Z?void 0:Z.weight)||1,ne.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===ne.parentContainerOrientation?n["valign-self"]=te[t]:n["valign-self"]=ne.parentVAlign||"start"}t&&(n.height=t),we=e,$e=r,xe=i,nr=o,or=a,rr=Tt(n,rr),ar=s,sr=l}var Vr,Dr,jr;if(F=!!ne.overlapParent||void 0,V=ne.overlapParent&&(!Y||"match_parent"===Y.type)&&!ne.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!ne.parentVerticalWrapContent,D=ne.gridArea?`${ne.gridArea.y+1}/${ne.gridArea.x+1}/span ${ne.gridArea.rowSpan}/span ${ne.gridArea.colSpan}`:void 0,Dr=lr,lr=!Pt(Vr=G)||void 0===Vr||Vr>1?Dr:Number(Vr),ke=1===lr?void 0:lr,me=void 0,q&&!oe&&q.description&&(me={},me["aria-label"]=q.description),Ee=xr&&(null==N?void 0:N.background)?N.background:H,Ce={},Ae=!1,Array.isArray(Ee)&&(Ae=Ee.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(qe),!Ae)){const t=yt(Ee);Ce["background-color"]=t.color,Ce["background-image"]=t.image,Ce["background-size"]=t.size,Ce["background-position"]=t.position,Ce["background-repeat"]="no-repeat"}Fe=void 0,ur&&Yt.transition_in&&ge.isRunning("stateChange")&&(Fe=!0),De=void 0,ur&&Yt.transition_change&&ge.isRunning("stateChange")&&fe.hasTransitionChange(Yt.id)&&(De=!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)||[];ne.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],ge.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ge.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ge.logError(st(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],ge.logError(st(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],ge.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&se&&(t=[],e=[],r=[],ge.logError(st(new Error(`Cannot use action on component "${se}"`)))),pr=t.filter(Ut),vr=e.filter(Ut),gr=r.filter(Ut),fr=i.filter(Ut),hr=n.filter(Ut)}z&&(mr=Bt(z),yr=mr.map((function(t){const e=Nt(t.start_value,1),r=Nt(t.end_value,1),i=Ot(t.start_delay,0),n="undefined"!=typeof matchMedia&&(Lt||(Lt=window.matchMedia("(prefers-reduced-motion)")),Lt.matches)?0:Ot(t.duration,300),o=zt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return je=e,Pe=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return Se=e,Oe=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return ge.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=_r,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(T,_r);t!==e&&(!br||"visible"!==_r&&"visible"!==e?_r=e:async function(t){_r=t;const e="visible"===t?"in":"out",r="in"===e?Yt.transition_in:Yt.transition_out;dr&&r&&(await $(),"in"===e&&(Ve=!0),fe.runVisibilityTransition(Object.assign(Object.assign({},Yt),{visibility:"visible"}),ee,r,he,e).then((()=>{"in"===e&&(Ve=!1)})).catch((t=>{throw"in"===e&&(Ve=!1),t})))}(e)),br||(br=!0)}if(Yt&&he&&!Mt(Yt.extensions,Te)){let t=Te=Yt.extensions;$().then((()=>{if(t===Te&&he&&(Cr(),Array.isArray(Yt.extensions))){const t=ge.getExtensionContext();ze=Yt.extensions.map((e=>{var r;const i=ge.getExtension(e.id,e.params);return i&&(null===(r=i.mountView)||void 0===r||r.call(i,he,t)),i})).filter(mt)}}))}if(Yt&&Xt&&ee&&kr&&kr.update({json:Yt,origJson:Xt,templateContext:ee}),j=Object.assign(Object.assign(Object.assign({},Ye),rr),{"parent-overlap":F,"parent-overlap-absolute":V,"scroll-snap":ne.scrollSnap,"hide-on-transition-in":Fe||Ve||De,visibility:_r,"has-action-animation":Boolean(yr),"parent-flex":ne.parentContainerOrientation||void 0,"parent-grid":Boolean(ne.gridArea)||void 0,"has-custom-focus":Boolean(xr&&Yt.focus)}),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};wr=Nt(t.value,wr);const e="pivot-fixed"===t.type?dt(wr):`${wr}%`,r=M.pivot_y||{type:"pivot-percentage",value:50};$r=Nt(r.value,$r),Ie=`${e} ${"pivot-fixed"===r.type?dt($r):`${$r}%`}`,Me=`rotate(${M.rotation}deg)`}return P=tr||ar?"100%":Qe||nr?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},ie),Ce),Be),{width:ye,"min-width":be,"max-width":_e,height:we,"min-height":$e,"max-height":xe||(null==ie?void 0:ie["max-height"]),"grid-area":D,padding:A,margin:Ze,opacity:ke,transition:yr,"transform-origin":Ie,transform:Me,"flex-grow":Qe||nr||void 0,"flex-shrink":Ke||or?1:void 0,"flex-basis":P,"--divkit-animation-opacity-start":je,"--divkit-animation-opacity-end":Pe,"--divkit-animation-scale-start":Se,"--divkit-animation-scale-end":Oe}),I(),it(),nt(),ot(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),At(),jt(),It(),Wt(),Ht(),Gt(),Zt(),er||sr?"":`${B(qt,"Actionable").$$render(t,{id:Yt.id,use:function(t){var e;he=t,ur&&Yt.transition_in&&fe.registerChildWithTransitionIn(Yt,ee,Yt.transition_in,t).then((()=>{Fe=!1})).catch((t=>{throw Fe=!1,t})),ur&&Yt.transition_out&&fe.registerChildWithTransitionOut(Yt,ee,Yt.transition_out,t),ur&&Yt.transition_change&&fe.registerChildWithTransitionChange(Yt,ee,Yt.transition_change,t).then((()=>{De=!1})).catch((t=>{throw De=!1,t}));const r=ne.fakeElement?[]:Yt.visibility_actions||Yt.visibility_action&&[Yt.visibility_action],i=ne.fakeElement?[]:Yt.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:ge}));const o=Yt.id;return o&&fe.registerChild(o),null===(e=Yt.tooltips)||void 0===e||e.forEach((e=>{ge.registerTooltip(t,e)})),{destroy(){o&&fe.unregisterChild(o),n&&n.destroy(),kr&&kr.destroy()}}},cls:re+" "+Ft("outer",ct,j),style:ut(S),actions:pr,doubleTapActions:vr,longTapActions:gr,attrs:me,hasInnerFocusable:ve,isNativeActionAnimation:!mr.length||(jr=mr,jr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${B(Qt,"OuterBackground").$$render(t,{background:Ee,radius:qe},{},{})}`:""}${i.default?i.default({focusHandler:Ar,blurHandler:Fr,hasCustomFocus:xr}):""}${Je?`<span${L("class",ct.outer__border,0)}${L("style",ut(Re),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)/$),Pt(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,P,S,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="",Pt="",St="",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="",St="",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=>P=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=>S=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}Pt=gt(M,1,Pt),C="none"===I?"none":"";{let t="";if(O){const e=yt([O]);e.image&&(t=e.image)}St=t}return Ot=de(S,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({},P),...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({},P),...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({},P)}),It=i}(wt,j,D),A={singleline:x,multiline:At,halign:Vt,valign:Dt,truncate:C,"has-focus-color":Boolean(Pt)},F={gradient:Boolean(St)},V={"font-size":dt($t),"line-height":xt,"max-height":Et,"-webkit-line-clamp":Ct,color:jt,"background-image":St,"--divkit-text-focus-color":Pt},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:P,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"],Pe=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,P,S,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=>P=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=>S=t))}if(ut=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(I,ut),b="wrap"===O,_="horizontal"!==ut&&!b&&S.some(be),w="vertical"!==ut&&!b&&S.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}(P,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},{},{})}`:""}`})}`})),Se=Pe,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,P,S,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,Pt=0,St="",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=>S=t)),h=dt.getDerivedFromVars(nt.accessibility),Z(),Z=l(h,(t=>P=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)}(S,kt),k=(null==P?void 0:P.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,"-"),Pt=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%)"),St=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:["",St].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?`${Pt}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=[],P=[],S=[],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=[],P=[],S=[],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),(!P[e]||P[e]<g)&&(P[e]=g),(!S[i]||S[i]<f)&&(S[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,S,D),"grid-template-rows":Le(P,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,P,S,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=[],Pt={},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&<.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=>S=t)),u=st.getDerivedFromVars(et.item_spacing),Z(),Z=l(u,(t=>P=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}(S,At),Vt=Ot(P,Vt),wt=dt(Vt),xt=Ot(j,Vt),$t=dt(xt),Dt=St(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),Pt=Tt(t,Pt),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(Pt),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,P,S,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=>S=t)),u=it.getJsonWithVars(K.selected_tab),d=it.getDerivedFromVars(K.tab_title_style),W(),W=l(d,(t=>P=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),S&&"wrap_content"!==S.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=P||{},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=St(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&&Pt(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]&&!Pt(n[t]))return i;return Jt(t,e,r)}(w.corners_radius,t,xt,At):Pt(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=St(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:P}=e,{templateContext:S}=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!==P&&r.internalId(P),void 0===e.templateContext&&r.templateContext&&void 0!==S&&r.templateContext(S),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:S},{},{})}</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,P=!1;function S(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=>S(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=>S(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=S(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&&(P=!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}}))}}))),!P&&function(t){if(!P&&(P=!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,P=o,S=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),P(),P=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),S(),S=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&&Pt(t)&&(gt=dt(t||0))}if(ft=St(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(),P(),S(),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,P=o,S=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),P(),P=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),S(),S=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(),P(),S(),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&>(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 Pr(t){let e=0;return t>0?e=1:t<0&&(e=-1),Vr(e)}class Sr{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 Sr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Sr{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 Sr{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 Sr{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 Sr{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 Sr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}},dict:class extends Sr{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 Sr{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,P,S,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(Ht);let Et,Ct,At,Vt,Dt,jt=0,St=100,Ot=Mr,It=Ot,Mt=Mr,Tt=Mr,zt=null,Bt=null,Rt=Dt,Jt="",Ut="",Lt=!1,Wt=kr(G||0,jt,St),qt=kr(q||0,jt,St),Gt=!1;function Zt(){if(!Ct)return;const t=St-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=>S=t)),x=xt.getDerivedFromVars(bt.secondary_value_accessibility),X(),X=l(x,(t=>P=t)),jt=Nt(Y,jt),St=Nt(Z,St),Zt();{const t=kr(G||0,jt,St);t!==Wt&&(Wt=t)}{const t=kr(q||0,jt,St);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(Wt,qt),Math.max(Wt,qt)+1,jt,St,!0):Nr(jt,Wt,jt,St,!0),Zt()):At=[];{let t=we(T,Tr,Mr);t!==Mr&&(Bt=t)}Bt?(Vt=a?Nr(Math.min(Wt,qt),Math.max(Wt,qt)+1,jt,St,!1):Nr(Wt+1,St+1,jt,St,!0),Zt()):Vt=[],Dt=xr(M,Dt),Rt=xr(O,Dt),(null==S?void 0:S.description)?Jt=S.description:xt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==P?void 0:P.description)?Ut=P.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(Pt))),E=dt(Math.max(...[Ot.height,It.height,0].filter(Pt))),C=(Wt-jt)/(St-jt),A=a?(qt-jt)/(St-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(Wt)}</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",St,0)} step="1"${L("value",Wt,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",St,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,P,S,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,Pt=o;var St;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===(St=It.mask)||void 0===St?void 0:St.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),Pt(),Pt=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"),P="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"})),S={"highlight-color":Boolean(ie),multiline:P,"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(),Pt(),Yt?"":`${B(re,"Outer").$$render(t,{cls:Ft("input",Rr,S),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 P?`<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,P,S,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=>S=t)),g=rt.getDerivedFromVars(Q.font_size),q(),q=l(g,(t=>P=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(P,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(S,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,P=o,{json:S={}}=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!==S&&r.json(S),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),S&&(Z=!1,Y=!1,X=!1,J=void 0,Q="fit"),n=S.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(S.video_sources),P(),P=l(s,(t=>E=t)),c=T.getDerivedFromVars(S.repeatable),j(),j=l(c,(t=>k=t)),u=T.getDerivedFromVars(S.autostart),C(),C=l(u,(t=>b=t)),d=T.getDerivedFromVars(S.muted),D(),D=l(d,(t=>x=t)),p=T.getDerivedFromVars(S.preview),V(),V=l(p,(t=>$=t)),g=T.getDerivedFromVars(S.scale),F(),F=l(g,(t=>w=t)),h=T.getDerivedFromVars(S.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 S&&(N&&(T.unregisterInstance(N),N=void 0),!S.id||W||(null==M?void 0:M.fakeElement)||(N=S.id,T.registerInstance(S.id,{pause:function(){null==R||R.pause()},start:tt}))),S&&b&&R&&tt(),m={aspect:"0"!==K},y={"object-fit":Q},C(),A(),F(),V(),D(),j(),P(),W?"":`${B(re,"Outer").$$render(t,{cls:Ft("video",ii,m),customActions:"video",json:S,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}${P([T(l.custom_props||{})],{})}${L("this",undefined,0)}>${D(e)?"":`${g?`<template${P([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=Se,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 Pi(t){const e=[];return ki(t,{Variable(t){e.push(t.id.name)}}),e}function Si(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"),Pn=En("string","url"),Sn=Cn(An,"string"),On=Cn(Fn,"number"),In=Cn(Vn,"integer"),Mn=Cn(Dn,"boolean"),Tn=Cn(jn,"color"),zn=Cn(Pn,"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:Pr(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=Pr(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}],Pn),$i("getUrlFromDict",[Hi,{type:Ni,isVararg:!0}],Pn),$i("getDictOptString",[Ni,Hi,{type:Ni,isVararg:!0}],Sn),$i("getOptStringFromDict",[Ni,Hi,{type:Ni,isVararg:!0}],Sn),$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};Si(`${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};Si(`${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);Si(`${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&&Si(`${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&&Si(`${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&&Si(`${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&&Si(`${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&&Si(`${Fi(r)} ${e} ${Fi(i)}`,`Operator '${e}' cannot be applied to ${Vi(r.type)} type.`),r.type===Ni)return"-"===e&&Si(`${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){Si(`${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&&Si(`${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)&&Si(`${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){Si(`${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?Si(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Si(i,`Function '${r}' has no matching override for given argument types: ${e}.`):Si(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){Si(`${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,St(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="'",P=".",S="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),Pt=function(t){return t},St=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=Pe())!==i?(We(),ye=t,t=Pt(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=Pe())!==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 Pe(){var e,r,n,o,a,s;return e=me,(r=Se())!==i?(We(),63===t.charCodeAt(me)?(n=d,me++):(n=i,0===$e&&Ve(Z)),n!==i?(We(),(o=Pe())!==i?(We(),58===t.charCodeAt(me)?(a=p,me++):(a=i,0===$e&&Ve(Y)),a!==i?(We(),(s=Pe())!==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=Se()),e}function Se(){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=Pe())!==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=Pe())!==i){for(n=[],o=me,We(),44===t.charCodeAt(me)?(a=D,me++):(a=i,0===$e&&Ve(gt)),a!==i?(We(),(s=Pe())!==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=Pe())!==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=Pe())!==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=Pe())!==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=P,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=S,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=S,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=Pi(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:P}=e,S=Q("desktop"===m);if(s=l(S,(t=>a=t)),"auto"===m&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");S.set(!t.matches),t.addListener((()=>{S.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:S,isPointerFocus:_o,customComponents:P,componentDevtool:void 0}),g(Ht,{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 Pt;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!==P&&r.customComponents(P),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||(Pt={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||!Pt?"":`<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:Pt,templateContext:{},layoutParams:{tooltips:et}},{},{})}</div>`})),Eo=ko;function Co(t){return Eo.render(t).html}var Ao=e.M,Fo=e.Os,Vo=e.sY;export{Ao as createGlobalVariablesController,Fo as createVariable,Vo as render};
|
|
1
|
+
var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{M:()=>Do,Os:()=>Wr,sY:()=>Lo}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function n(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 i{constructor(t){n(this,"_listeners","WeakMap"in r?new WeakMap:void 0),n(this,"_observer",void 0),n(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;i.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)}i.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),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 O(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=H(n):r.style=H(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(D.test(t))return;const e=r[t];!0===e?n+=" "+t:A.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const S=/[&"]/g,P=/[&<]/g;function I(t,e=!1){const r=String(t),n=e?S:P;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+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 N(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let n="";for(let r=0;r<t.length;r+=1)n+=e(t[r],r);return n}const z={$$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,r,n,i,o){const a=u;d({$$:{on_destroy:B,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,i);return d(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{B=[];const i={title:"",head:"",css:new Set},o=e(i,t,{},r,n);return s(B),{html:o,css:{code:Array.from(i.css).map((t=>t.code)).join("\n"),map:null},head:i.title+i.head}},$$render:e}}function W(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!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 r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(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 n=r.call(t,"string");if("object"!=typeof n)return n;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,n){var i;const o=null===(i=r[t])||void 0===i?void 0:i.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!n||!r[t])return e;if("toAttribute"===n)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&&(U=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 i of this.$$s)i in r&&(e[i]=[t(i)]);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 n=()=>{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(n),n();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 n;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Y(t,r,this.$$p_d,"toProp"),null===(n=this.$$c)||void 0===n||n.$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 n=new Set;function i(e){if(o=e,((i=t)!=i?o==o:i!==o||i&&"object"==typeof i||"function"==typeof i)&&(t=e,r)){const e=!X.length;for(const e of n)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 i,o}function a(e){i(e(t))}return{set:i,update:a,subscribe:function(s,l=o){const c=[s,l];return n.add(c),1===n.size&&(r=e(i,a)||o),s(t),()=>{n.delete(c),0===n.size&&r&&(r(),r=null)}}}}function K(t,e,r){const n=!Array.isArray(t),i=n?[t]:t;if(!i.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 i=e(n?u[0]:u,t,r);a?t(i):p="function"==typeof i?i:o},g=i.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",nt="divkit-ee112",it="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_start:"divkit-e70de",text_halign_center:"divkit-e1659",text_halign_end:"divkit-e48b4",text_valign_start:"divkit-b7b70",text_valign_center:"divkit-ef58e",text_valign_end:"divkit-d4206",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 n=ft(t);return n?(n.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)})`}(n)):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,n,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,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,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;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,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),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 n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=pt(n.value):"relative"===n.type&&(i=bt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"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 jt(t,e){e&&t.push(e)}function At(t,e,r){const n=[];jt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&jt(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const Ft=Symbol("state");function Vt(t,e){var r,n;const i=t.top||0,o=(null!==(r="ltr"===e?t.end:t.start)&&void 0!==r?r:t.right)||0,a=t.bottom||0,s=(null!==(n="ltr"===e?t.start:t.end)&&void 0!==n?n:t.left)||0;return 0===i&&0===o&&0===a&&0===s?"":dt(i)+" "+dt(o)+" "+dt(a)+" "+dt(s)}function Dt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function Ot(t){return Dt(t)&&t>=0}function St(t,e,r){var n,i;if(!t)return r;const o=[t.top,null!==(n="ltr"===e?t.end:t.start)&&void 0!==n?n:t.right,t.bottom,null!==(i="ltr"===e?t.start:t.end)&&void 0!==i?i:t.left];for(let t=0;t<o.length;++t)if(o[t]&&!Ot(o[t]))return r;return Vt(t,e)}function Pt(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),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(!It.call(e,i)||!Mt(t[i],e[i]))return!1}return!0}function Tt(t,e){return Mt(t,e)?e:t}function Nt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function zt(t,e){const r=Number(t);return isNaN(r)?e:r}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 r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!Ot(t[r[n]]))return e;return t}function Ut(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 Lt(t){return 0!==t.is_enabled&&!1!==t.is_enabled}let Wt;function Ht(){}const qt=Symbol("action"),Jt=L(((t,e,r,n)=>{let{componentContext:i}=e,{id:o=""}=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((()=>{o&&!y&&b.unregisterFocusable(o)})),void 0===e.componentContext&&r.componentContext&&void 0!==i&&r.componentContext(i),void 0===e.id&&r.id&&void 0!==o&&r.id(o),void 0===e.actions&&r.actions&&void 0!==a&&r.actions(a),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==s&&r.doubleTapActions(s),void 0===e.longTapActions&&r.longTapActions&&void 0!==l&&r.longTapActions(l),void 0===e.cls&&r.cls&&void 0!==c&&r.cls(c),void 0===e.style&&r.style&&void 0!==u&&r.style(u),void 0===e.attrs&&r.attrs&&void 0!==d&&r.attrs(d),void 0===e.use&&r.use&&void 0!==p&&r.use(p),void 0===e.customAction&&r.customAction&&void 0!==h&&r.customAction(h),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==m&&r.isNativeActionAnimation(m),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==y&&r.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="",i.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))||i.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${O([{href:M(x)},{target:M($)},{style:M(u)},{class:I(c,!0)+" "+I(m?tt:et,!0)+" "+I(null!=l&&l.length?ot:"",!0)},T(d)],{})}${W("this",w,0)}>${n.default?n.default({}):""}</a>`:` <span${O([{class:I(c,!0)+I(k?` ${m?tt:et} ${rt}`:"",!0)+" "+I(null!=l&&l.length?ot:"",!0)},{style:M(u)},{role:M(k?"button":null)},{tabindex:M(k?0:null)},T(d)],{})}${W("this",w,0)}>${n.default?n.default({}):""}</span>`})),Gt="divkit-b921d";function Zt(t){return Dt(t)&&t>0}function Yt(t,e){return t.map((t=>{if(t)if("blur"===t.type){if(Zt(t.radius))return`blur(${pt(t.radius/2)})`}else{if("rtl_mirror"===t.type)return;e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:t.type}}))}else e(st(new Error("Incorrect filter"),{level:"warn"}))})).filter(Boolean).join(" ")}const Xt=L(((t,e,r,n)=>{let i,{direction:o}=e,{componentContext:a}=e,{background:s=[]}=e,{radius:l=""}=e;return f(at),void 0===e.direction&&r.direction&&void 0!==o&&r.direction(o),void 0===e.componentContext&&r.componentContext&&void 0!==a&&r.componentContext(a),void 0===e.background&&r.background&&void 0!==s&&r.background(s),void 0===e.radius&&r.radius&&void 0!==l&&r.radius(l),i=s.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 n=yt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Yt(t.filters,a.logError),"rtl"===o&&t.filters.some((t=>"rtl_mirror"===t.type))&&(e.transform="scale(-1,1)")))}return r})),`<span${W("class","divkit-bf253"+(l?" divkit-dcad7":""),0)}${q({"border-radius":l})}>${N(i,(t=>t.image_url?`<img${W("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${W("class",Gt,0)}${W("style",ut(t.style),0)}>`:`<span${W("class",Gt,0)}${W("style",ut(t.style),0)}></span>`))}</span>`})),Qt=Xt,Kt={left:"start",center:"center",right:"end",start:"start",end:"end"},te={left:"end",center:"center",right:"start",start:"start",end:"end"},ee={top:"start",center:"center",bottom:"end",baseline:"baseline"},re=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,O,S,P,I,M,T,N,z,B,U,L,H,q,J,G,Z,Y,X,Q,tt,et,rt,nt,it,ot=o,lt=o,vt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,jt=o,Dt=o,It=o,Ht=o,qt=o,Gt=o,Zt=o,Yt=o,Xt=o,{componentContext:re}=e,{cls:ne=""}=e,{style:ie}=e,{layoutParams:oe={}}=e,{customDescription:ae=!1}=e,{customPaddings:se=!1}=e,{customActions:le=""}=e,{additionalPaddings:ce=null}=e,{heightByAspect:ue=!1}=e,{parentOf:de}=e,{parentOfSimpleMode:pe}=e,{replaceItems:ve}=e,{hasInnerFocusable:ge=!1}=e;const fe=f(at),he=f(Ft);let me,ye;I=l(fe.isPointerFocus,(t=>P=t)),et=l(fe.direction,(t=>tt=t));let be,_e,we,$e,xe,ke,Ee,Ce,je,Ae,Fe,Ve,De,Oe,Se,Pe,Ie,Me,Te,Ne,ze=null,Re=[],Be={},Ue={},Le=!1,We=1,He="transparent",qe=0,Je={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ge="",Ze=null,Ye="",Xe={},Qe=0,Ke=0,tr=0,er=!1,rr=!1,nr={},ir=0,or=0,ar=0,sr=!1,lr=!1,cr=1,ur=[],dr=!1,pr=!1,vr=[],gr=[],fr=[],hr=[],mr=[],yr=[],br="",_r=!1,wr="visible",$r=0,xr=0,kr=!1,Er=null;function Cr(t,e){if(!Array.isArray(de)||!ve)return;if(pe&&1!==(Array.isArray(e)&&e.length||0))return;const r=de.findIndex((e=>(null==e?void 0:e.id)===t)),n=de.slice();n.splice(r,1,...e||[]),de=n,ve(n)}function jr(){if(ze&&me){const t=fe.getExtensionContext();ze.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,me,t)})),ze=null}}function Ar(){re.json.focus&&(P||(kr=!0),re.execAnyActions(hr))}function Fr(){re.json.focus&&(kr=!1,re.execAnyActions(mr))}v((()=>{var t;Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],null===(t=re.json.tooltips)||void 0===t||t.forEach((t=>{fe.unregisterTooltip(t)})),jr()})),void 0===e.componentContext&&r.componentContext&&void 0!==re&&r.componentContext(re),void 0===e.cls&&r.cls&&void 0!==ne&&r.cls(ne),void 0===e.style&&r.style&&void 0!==ie&&r.style(ie),void 0===e.layoutParams&&r.layoutParams&&void 0!==oe&&r.layoutParams(oe),void 0===e.customDescription&&r.customDescription&&void 0!==ae&&r.customDescription(ae),void 0===e.customPaddings&&r.customPaddings&&void 0!==se&&r.customPaddings(se),void 0===e.customActions&&r.customActions&&void 0!==le&&r.customActions(le),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ce&&r.additionalPaddings(ce),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ue&&r.heightByAspect(ue),void 0===e.parentOf&&r.parentOf&&void 0!==de&&r.parentOf(de),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==pe&&r.parentOfSimpleMode(pe),void 0===e.replaceItems&&r.replaceItems&&void 0!==ve&&r.replaceItems(ve),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ge&&r.hasInnerFocusable(ge),re.json&&oe&&(Ze=null,Ye="",cr=1,_r=!1,wr="visible",$r=0,xr=0,Me=void 0,Te=void 0,ur=re.fakeElement?[]:re.json.transition_triggers||["state_change","visibility_change"],dr=Boolean(-1!==ur.indexOf("state_change")&&re.json.id),pr=Boolean(-1!==ur.indexOf("visibility_change")&&re.json.id)),i=re.getDerivedFromVars(re.json.focus),ft(),ft=l(i,(t=>z=t)),a=re.getDerivedFromVars(re.json.border),Xt(),Xt=l(a,(t=>it=t)),s=re.getDerivedFromVars(re.json.paddings),Yt(),Yt=l(s,(t=>nt=t)),c=re.getDerivedFromVars(re.json.margins),Gt(),Gt=l(c,(t=>Q=t)),u=re.getDerivedFromVars(re.json.width),Ht(),Ht=l(u,(t=>Y=t)),d=re.getDerivedFromVars(re.json.alignment_horizontal),Zt(),Zt=l(d,(t=>rt=t)),p=re.getDerivedFromVars(re.json.height),It(),It=l(p,(t=>Z=t)),g=re.getDerivedFromVars(re.json.alignment_vertical),qt(),qt=l(g,(t=>X=t)),h=re.getDerivedFromVars(re.json.alpha),Dt(),Dt=l(h,(t=>G=t)),m=re.getDerivedFromVars(re.json.accessibility),jt(),jt=l(m,(t=>J=t)),y=re.getDerivedFromVars(re.json.background),$t(),$t=l(y,(t=>q=t)),b=re.getDerivedFromVars(re.json.action),_t(),_t=l(b,(t=>L=t)),_=re.getDerivedFromVars(re.json.actions),wt(),wt=l(_,(t=>H=t)),w=re.getDerivedFromVars(re.json.doubletap_actions),bt(),bt=l(w,(t=>U=t)),x=re.getDerivedFromVars(re.json.longtap_actions),ht(),ht=l(x,(t=>B=t)),k=re.getDerivedFromVars(re.json.action_animation),vt(),vt=l(k,(t=>N=t)),E=re.getDerivedFromVars(re.json.visibility),lt(),lt=l(E,(t=>T=t)),C=re.getDerivedFromVars(re.json.transform),ot(),ot=l(C,(t=>M=t)),Re.forEach((t=>{fe.unregisterParentOf(t)})),Re=[],de&&de.forEach((t=>{(null==t?void 0:t.id)&&(Re.push(t.id),fe.registerParentOf(t.id,{replaceWith:Cr,isSingleMode:Boolean(pe)}))}));{const t=kr&&(null==z?void 0:z.border)?z.border:it;let e={},r={},n=!1,i="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?function(t){var e,r,n,i,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===(n=t.offset)||void 0===n||null===(i=n.y)||void 0===i?void 0:i.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&&(n=!0,We=Pt(t.stroke.width,We),He=gt(t.stroke.color,1,He),r.border=`${dt(We)} solid ${He}`),t.corners_radius?(Je=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]&&!Ot(r[t]))return e;return t}(t.corners_radius,Je),r["border-radius"]=e["border-radius"]=Ut(Je)):t.corner_radius&&(qe=Pt(t.corner_radius,qe),Je={"top-left":qe,"top-right":qe,"bottom-right":qe,"bottom-left":qe},r["border-radius"]=e["border-radius"]=dt(qe)),n&&We&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Je);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+We/2})),i=Ut(t)}}Be=Tt(e,Be),Ue=Tt(r,Ue),Le=n,Ge=i}Ze=Bt(nt&&!se?nt:void 0,Ze),j=Vt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left","start","end"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(Ze,ce),tt),Ye=St(Q,tt,Ye);{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Qe=Pt(null==Y?void 0:Y.value,Qe),e=dt(Qe);else if("wrap_content"===c||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"!==c&&c||re.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,re.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)i["halign-self"]="stretch";else{const t=rt;i["halign-self"]="left"===t||"center"===t||"right"===t||"start"===t||"end"===t?("ltr"===tt?Kt:te)[t]:oe.parentHAlign||"start"}t&&(i.width=t),be=e,_e=r,we=n,Ke=o,tr=a,Xe=Tt(i,Xe),er=s,rr=l}{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ue);else if("fixed"===c)ir=Pt(null==Z?void 0:Z.value,ir),e=dt(ir);else if("match_parent"!==c||oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(i["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&Ot(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&Ot(t.max_size.value)&&(n=dt(t.max_size.value))}"match_parent"===c&&re.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,re.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===oe.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?i["valign-self"]=ee[t]:i["valign-self"]=oe.parentVAlign||"start"}t&&(i.height=t),$e=e,xe=r,ke=n,or=o,ar=a,nr=Tt(i,nr),sr=s,lr=l}var Vr,Dr,Or;if(A=!!oe.overlapParent||void 0,F=oe.overlapParent&&(!Y||"match_parent"===Y.type)&&!oe.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!oe.parentVerticalWrapContent,V=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,Dr=cr,cr=!Ot(Vr=G)||void 0===Vr||Vr>1?Dr:Number(Vr),Ee=1===cr?void 0:cr,ye=void 0,J&&!ae&&J.description&&(ye={},ye["aria-label"]=J.description),Ce=kr&&(null==z?void 0:z.background)?z.background:q,je={},Ae=!1,Array.isArray(Ce)&&(Ae=Ce.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ge),!Ae)){const t=yt(Ce);je["background-color"]=t.color,je["background-image"]=t.image,je["background-size"]=t.size,je["background-position"]=t.position,je["background-repeat"]="no-repeat"}Fe=void 0,dr&&re.json.transition_in&&fe.isRunning("stateChange")&&(Fe=!0),De=void 0,dr&&re.json.transition_change&&fe.isRunning("stateChange")&&he.hasTransitionChange(re.json.id)&&(De=!0);{let t=H||L&&[L]||[],e=U||[],r=B||[],n=(null==z?void 0:z.on_focus)||[],i=(null==z?void 0:z.on_blur)||[];re.fakeElement?(t=[],e=[],r=[],n=[],i=[]):(Array.isArray(t)||(t=[],re.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],re.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],re.logError(st(new Error("LongTapActions should be array")))),Array.isArray(n)||(n=[],re.logError(st(new Error("FocusActions should be array")))),Array.isArray(i)||(i=[],re.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&le&&(t=[],e=[],r=[],re.logError(st(new Error(`Cannot use action on component "${le}"`)))),vr=t.filter(Lt),gr=e.filter(Lt),fr=r.filter(Lt),hr=n.filter(Lt),mr=i.filter(Lt)}N&&(yr=Rt(N),br=yr.map((function(t){const e=zt(t.start_value,1),r=zt(t.end_value,1),n=Pt(t.start_delay,0),i="undefined"!=typeof matchMedia&&(Wt||(Wt=window.matchMedia("(prefers-reduced-motion)")),Wt.matches)?0:Pt(t.duration,300),o=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Oe=e,Se=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return Pe=e,Ie=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return re.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=wr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(T,wr);t!==e&&(!_r||"visible"!==wr&&"visible"!==e?wr=e:async function(t){wr=t;const e="visible"===t?"in":"out",r="in"===e?re.json.transition_in:re.json.transition_out;pr&&r&&(await $(),"in"===e&&(Ve=!0),he.runVisibilityTransition(Object.assign(Object.assign({},re.json),{visibility:"visible"}),re,r,me,e).then((()=>{"in"===e&&(Ve=!1)})).catch((t=>{throw"in"===e&&(Ve=!1),t})))}(e)),_r||(_r=!0)}if(re.json&&me&&!Mt(re.json.extensions,Ne)){let t=Ne=re.json.extensions;$().then((()=>{if(t===Ne&&me&&(jr(),Array.isArray(re.json.extensions))){const t=fe.getExtensionContext();ze=re.json.extensions.map((e=>{var r;const n=e.id;if(!n)return;const i=fe.getExtension(n,e.params);return i&&(null===(r=i.mountView)||void 0===r||r.call(i,me,t)),i})).filter(mt)}}))}if(re&&Er&&Er.update(re),D=Object.assign(Object.assign(Object.assign({},Xe),nr),{"parent-overlap":A,"parent-overlap-absolute":F,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":Fe||Ve||De,visibility:wr,"has-action-animation":Boolean(br),"parent-flex":oe.parentContainerOrientation||void 0,"parent-grid":Boolean(oe.gridArea)||void 0,"has-custom-focus":Boolean(kr&&re.json.focus)}),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};$r=zt(t.value,$r);const e="pivot-fixed"===t.type?dt($r):`${$r}%`,r=M.pivot_y||{type:"pivot-percentage",value:50};xr=zt(r.value,xr),Me=`${e} ${"pivot-fixed"===r.type?dt(xr):`${xr}%`}`,Te=`rotate(${M.rotation}deg)`}return O=er||sr?"100%":Ke||or?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},ie),je),Be),{width:be,"min-width":_e,"max-width":we,height:$e,"min-height":xe,"max-height":ke||(null==ie?void 0:ie["max-height"]),"grid-area":V,padding:j,margin:Ye,opacity:Ee,transition:br,"transform-origin":Me,transform:Te,"flex-grow":Ke||or||void 0,"flex-shrink":tr||ar?1:void 0,"flex-basis":O,"--divkit-animation-opacity-start":Oe,"--divkit-animation-opacity-end":Se,"--divkit-animation-scale-start":Pe,"--divkit-animation-scale-end":Ie}),I(),ot(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),jt(),Dt(),It(),Ht(),qt(),Gt(),et(),Zt(),Yt(),Xt(),rr||lr?"":`${R(Jt,"Actionable").$$render(t,{componentContext:re,id:re.json.id,use:function(t){var e;me=t,dr&&re.json.transition_in&&he.registerChildWithTransitionIn(re.json,re,re.json.transition_in,t).then((()=>{Fe=!1})).catch((t=>{throw Fe=!1,t})),dr&&re.json.transition_out&&he.registerChildWithTransitionOut(re.json,re,re.json.transition_out,t),dr&&re.json.transition_change&&he.registerChildWithTransitionChange(re.json,re,re.json.transition_change,t).then((()=>{De=!1})).catch((t=>{throw De=!1,t}));const r=re.fakeElement?[]:re.json.visibility_actions||re.json.visibility_action&&[re.json.visibility_action],n=re.fakeElement?[]:re.json.disappear_actions;let i;(Array.isArray(r)&&r.length||Array.isArray(n)&&n.length)&&(i=function(t,{visibilityActions:e,disappearActions:r,rootCtx:n,componentContext:i}){const o=[];e&&e.forEach((t=>{o.push({type:"visibility",index:o.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{o.push({type:"disappear",index:o.length,action:t,visible:!1,count:0,finished:!1})}));const a=o.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 s;const l=()=>{s&&s.disconnect(),o.forEach((t=>{t.timer&&clearTimeout(t.timer)}))},c=K(a,(t=>t)).subscribe((e=>{const r=e.filter(Ct),a={};r.forEach((t=>{a[t.index]=t})),l();const c=[...new Set(r.map((t=>{const e="visibility"===o[t.index].type;return Et(e,t.visibility_percentage,e?50:0)/100})))];c.length&&(s=new IntersectionObserver((t=>{t.forEach((t=>{r.forEach((e=>{const r=o[e.index],a="visibility"===r.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?!r.visible&&l:r.visible&&!l,u=a?!l:l;c?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 o=i.getJsonWithVars(r.action),s=o.url,l=o.typed;if(s){const t=xt(s);t&&!kt(t,n.getBuiltinProtocols())&&("div-action"===t?n.execAction(o):o.log_id&&n.execCustomAction(o))}else l&&n.execAction(o);n.logStat(a?"visible":"disappear",o)}),e.visibility_duration||800)):u&&r.timer&&clearTimeout(r.timer),r.visible=l}))}))}),{threshold:c}),s.observe(t))}));return{destroy(){l(),c()}}}(t,{visibilityActions:r,disappearActions:n,rootCtx:fe,componentContext:re}));const o=re.json.id;return o&&he.registerChild(o),null===(e=re.json.tooltips)||void 0===e||e.forEach((e=>{fe.registerTooltip(t,e)})),{destroy(){o&&he.unregisterChild(o),i&&i.destroy(),Er&&Er.destroy()}}},cls:ne+" "+At("outer",ct,D),style:ut(S),actions:vr,doubleTapActions:gr,longTapActions:fr,attrs:ye,hasInnerFocusable:ge,isNativeActionAnimation:!yr.length||(Or=yr,Or.some((t=>"native"===t.name)))},{},{default:()=>` ${Ae?`${R(Qt,"OuterBackground").$$render(t,{componentContext:re,direction:tt,background:Ce,radius:Ge},{},{})}`:""}${n.default?n.default({focusHandler:Ar,blurHandler:Fr,hasCustomFocus:kr}):""}${Le?`<span${W("class",ct.outer__border,0)}${W("style",ut(Ue),0)}></span>`:""}`})}`})),ne=re,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 oe(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}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,r,n)=>{let i,o,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&&r.componentContext&&void 0!==p&&r.componentContext(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.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 $=oe(h.font_size,$),Zt(h.line_height)&&(x=Number(h.line_height)/$),Ot(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),i=h.top_offset?dt(h.top_offset):"",o=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)&&Zt(h.border.stroke.width)?{color:h.border.stroke.color,width:h.border.stroke.width}:null,a=oe(null===(d=h.border)||void 0===d?void 0:d.corner_radius,0),s=h.text_shadow?function(t,e){var r,n,i,o,a,s;return"drop-shadow("+gt(t.color||"#000000",null!==(r=t.alpha)&&void 0!==r?r:.19)+" "+dt(10*((null===(n=t.offset)||void 0===n||null===(i=n.x)||void 0===i?void 0:i.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":j?`inset 0 0 0 ${dt(j.width)} ${j.color}`:void 0,"border-radius":a?dt(a):void 0},`${i?`<span${W("class",ie["text-range__top-offset"],0)}${q({"margin-top":i})}></span>`:""}${R(Jt,"Actionable").$$render(t,{componentContext:p,cls:At("text-range",ie,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ce=le;function ue(t,e,r){return"left"===t||"center"===t||"right"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}function de(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?"top"===t?"start":"bottom"===t?"end":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,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,O,S,P,I,M,T,z,B,U,L,H,q,J,G,Z,Y=o,X=o,Q=o,K=o,tt=o,et=o,nt=o,it=o,ot=o,st=o,ct=o,pt=o,vt=o,ft=o,ht=o,{componentContext:mt}=e,{layoutParams:bt}=e;const _t=f(at);L=l(_t.direction,(t=>U=t));let wt="",$t=12,xt=1.25,kt=!1,Et="",Ct="",jt=!1,Ft="start",Vt="start",Dt="",Ot="",St="",Pt=!1,It=[],Mt=[];var Tt;v((()=>{Mt.forEach((([t,e])=>{_t.removeSvgFilter(t,e)}))})),void 0===e.componentContext&&r.componentContext&&void 0!==mt&&r.componentContext(mt),void 0===e.layoutParams&&r.layoutParams&&void 0!==bt&&r.layoutParams(bt),mt.json&&($t=12,xt=1.25,kt=!1,Et="",Ct="",jt=!1,Ft="start",Vt="start",Dt="",St="",Pt=!1),i=mt.getDerivedFromVars(mt.json.text),ht(),ht=l(i,(t=>Z=t)),a=mt.getDerivedFromVars(mt.json.ranges),X(),X=l(a,(t=>D=t)),s=mt.getDerivedFromVars(mt.json.images),Y(),Y=l(s,(t=>V=t)),c=mt.getDerivedFromVars({font_size:mt.json.font_size,letter_spacing:mt.json.letter_spacing,font_weight:mt.json.font_weight,font_family:mt.json.font_family,text_color:mt.json.text_color,underline:mt.json.underline,strike:mt.json.strike,line_height:mt.json.line_height,text_shadow:mt.json.text_shadow}),Q(),Q=l(c,(t=>O=t)),u=mt.getDerivedFromVars(mt.json.font_size),ft(),ft=l(u,(t=>G=t)),d=mt.getDerivedFromVars(mt.json.line_height),vt(),vt=l(d,(t=>J=t)),p=mt.getDerivedFromVars(mt.json.max_lines),ot(),ot=l(p,(t=>z=t)),g=mt.getDerivedFromVars(mt.json.text_alignment_horizontal),ct(),ct=l(g,(t=>H=t)),h=mt.getDerivedFromVars(mt.json.text_alignment_vertical),st(),st=l(h,(t=>B=t)),m=mt.getDerivedFromVars(mt.json.text_color),it(),it=l(m,(t=>T=t)),y=mt.getDerivedFromVars(mt.json.focused_text_color),nt(),nt=l(y,(t=>M=t)),b=mt.getDerivedFromVars(mt.json.truncate),et(),et=l(b,(t=>I=t)),_=mt.getDerivedFromVars(mt.json.text_gradient),tt(),tt=l(_,(t=>P=t)),w=mt.getDerivedFromVars(mt.json.selectable),K(),K=l(w,(t=>S=t)),$=mt.getDerivedFromVars(mt.json.auto_ellipsize),pt(),pt=l($,(t=>q=t)),Tt=Z,wt=String(null!=Tt?Tt:""),$t=oe(G,$t);{const t=J;Zt(t)?(xt=Number(t)/$t,kt=!0):kt=!1}x=1===z;{let t="",e="",r=!1;if(z&&z>1){let n=Number(z);t=n*xt+"em",e=n,r=!0}else q&&1!==z&&(r=!0);Et=t,Ct=e,jt=r}Ft=ue(H,U,Ft),Vt=de(B,Vt),k=!D||wt&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=wt.length,E=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";z&&k&&E&&(t=gt(T||D&&D[0]&&D[0].text_color,1,Dt)),Dt=t}Ot=gt(M,1,Ot),C="none"===I?"none":"";{let t="";if(P){const e=yt([P]);e.image&&(t=e.image)}St=t}return Pt=pe(S,Pt),function(t,e,r){let n=[];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 i=t;let o=e||[{start:0,end:i.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<=i.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({},O),...l);n.push({text:i.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(Lt))||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({},O),...l),r=dt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=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=ve(t.image.tint_mode,"source_in");if(s){const e=gt(t.image.tint_color);a=_t.addSvgFilter(e,c),Mt.push([e,c])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=a})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},O)}),It=n}(wt,D,V),j={singleline:x,multiline:jt,halign:Ft,valign:Vt,truncate:C,"has-focus-color":Boolean(Ot)},A={gradient:Boolean(St)},F={"font-size":dt($t),"line-height":xt,"max-height":Et,"-webkit-line-clamp":Ct,color:Dt,"background-image":St,"--divkit-text-focus-color":Ot},Y(),X(),Q(),K(),tt(),et(),nt(),it(),ot(),st(),L(),ct(),pt(),vt(),ft(),ht(),`${R(ne,"Outer").$$render(t,{cls:At("text",lt,j)+" "+(Pt?"":rt),componentContext:mt,layoutParams:bt},{},{default:()=>`<span${W("class",At("text__inner",lt,A),0)}${W("style",ut(F),0)}>${It.length?`${N(It,(e=>"text"in e?e.text?`${R(ce,"TextRangeView").$$render(t,{componentContext:mt,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":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>`:""))}`:`${R(ce,"TextRangeView").$$render(t,{componentContext:mt,text:wt,rootFontSize:$t,textStyles:O,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_start:"divkit-a31f0",container_valign_center:"divkit-aae61",container_valign_end:"divkit-eac00","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_start:"divkit-efaf5",container_halign_center:"divkit-bac9d",container_halign_end:"divkit-ca36b","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,r){const n=((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);null!=e&&e.show_at_start&&(r?t.top=e.style.height+i:t.left=e.style.width+n),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+i:t.right=e.style.width+n)}function be(t,e,r){let n;const i=((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 n="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+i:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],n.map(dt).join(" ")}function _e(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function we(t){var e;return"match_parent"!==(null===(e=t.height)||void 0===e?void 0:e.type)}function $e(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)n={width:Pt(null===(o=(i=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Pt(null===(a=i.item_height)||void 0===a?void 0:a.value,10),radius:Pt(null===(s=i.corner_radius)||void 0===s?void 0:s.value,5)};else{if("circle"!==t.shape.type)return r;n=function(t){var e;const r=2*Pt(null===(e=t.radius)||void 0===e?void 0:e.value,10);return{width:r,height:r,radius:r}}(t.shape)}var i,o,a,s;return function(t,e,r){var n;const i={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?gt(o.color):"",s=null!=o&&o.width?Number(null!==(n=o.width)&&void 0!==n?n:1):"";i.width=t.width,i.height=t.height,i.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return i.background=gt(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),i}(n,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,r,n,i,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:i.left+a,width:Math.max(0,i.right-i.left-a-s),height:n.top-r.bottom-l-c,style:e.style}):t.push({top:i.top+l,left:r.right+a,width:n.left-r.right-a-s,height:Math.max(0,i.bottom-i.top-l-c),style:e.style})}function Ae(t,e,r,n,i,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"===i||"space-evenly"===i?(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),je(t,e,{top:0,right:s,bottom:l,left:0},r[0],a,n)}if(null==e?void 0:e.show_between)for(let i=0;i<r.length-1;++i)je(t,e,r[i],r[i+1],a,n);if(null==e?void 0:e.show_at_end){const s=r[r.length-1];let l,c;"space-around"===i||"space-evenly"===i?(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),je(t,e,s,{top:l,right:0,bottom:0,left:c},a,n)}}const Fe=L(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e,{contentHAlign:l}=e,{contentVAlign:c}=e,{direction:u}=e;const d=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect(),e=window.getComputedStyle(i),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)};g=[];let n=[...i.children].filter((t=>t!==p&&!t.classList.contains(ct.outer__border))),d=[];for(;n.length;){const t=[],e=n.shift();t.push(e);let r=e.getBoundingClientRect(),i=r.left,a=r.right,s=r.bottom;for(;n.length;){let e=n[0],r=e.getBoundingClientRect();if("vertical"===o){if(r.top<s)break}else if("ltr"===u?r.left<a:r.right>i)break;a=Math.max(a,r.right),i=Math.min(i,r.left),s=Math.max(s,r.bottom),t.push(e),n.shift()}d.push(t)}const v=[];d.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)));"rtl"===u&&"horizontal"===o&&e.reverse(),a&&Ae(g,a,e,"vertical"===o,"vertical"===o?c:l,r);const n={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(n)})),"rtl"===u&&"vertical"===o&&v.reverse(),s&&Ae(g,s,v,"horizontal"===o,"vertical"===o?l:c,r),g.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let p,g=[],f=!1,h=null,m=null;return v((()=>{f=!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),void 0===e.direction&&r.direction&&void 0!==u&&r.direction(u),i=null,(f&&i||h||m)&&(h&&(h.disconnect(),h=null),m&&(m.disconnect(),m=null),f&&i&&("undefined"!=typeof MutationObserver&&(h=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(Ce))&&!(null==r?void 0:r.contains(Ee))}))&&d()})),h.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(m=new ResizeObserver(d),m.observe(i)))),f&&i&&d(),` <div${W("class",Ee,0)}${W("this",p,0)}>${N(g,(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={start:"start",center:"center",end:"end","space-between":"start","space-around":"start","space-evenly":"start"},De={start:"start",center:"center",end:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},Oe=["rounded_rectangle","circle"],Se=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,O,S,P,I,M,T,z,B=o,U=o,L=o,W=o,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o;var tt,et,rt,nt,it,ot,st;let{componentContext:lt}=e,{layoutParams:ct}=e;const ut=f(at);let dt;O=l(ut.direction,(t=>D=t));let pt,vt="vertical",gt="start",ft="start",ht=null,yt=null,bt={},_t=[];void 0===e.componentContext&&r.componentContext&&void 0!==lt&&r.componentContext(lt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ct&&r.layoutParams(ct),lt.json&&(vt="vertical",gt="start",ft="start",pt=void 0),i=lt.json.items,a=lt.getDerivedFromVars(null===(tt=lt.json.item_builder)||void 0===tt?void 0:tt.data,void 0,!0),Q(),Q=l(a,(t=>z=t)),s=lt.getDerivedFromVars(lt.json.orientation),X(),X=l(s,(t=>T=t)),c=lt.getDerivedFromVars(lt.json.layout_mode),Y(),Y=l(c,(t=>M=t)),u=lt.getDerivedFromVars(lt.json.content_alignment_vertical),G(),G=l(u,(t=>P=t)),d=lt.getDerivedFromVars(lt.json.content_alignment_horizontal),J(),J=l(d,(t=>S=t)),p=lt.getDerivedFromVars(lt.json.separator),q(),q=l(p,(t=>V=t)),v=lt.getDerivedFromVars(lt.json.line_separator),H(),H=l(v,(t=>F=t)),g=lt.getDerivedFromVars(lt.json.aspect),W(),W=l(g,(t=>A=t)),h=lt.getDerivedFromVars(lt.json.width),U(),U=l(h,(t=>C=t)),m=lt.getDerivedFromVars(lt.json.height),L(),L=l(m,(t=>j=t)),y=lt.getDerivedFromVars(lt.json.clip_to_bounds),B(),B=l(y,(t=>E=t));{let t=[];if(lt.json.item_builder&&Array.isArray(z)&&Array.isArray(lt.json.item_builder.prototypes)){const e=lt.json.item_builder;t=[],z.forEach((r=>{if(null===r||"object"!=typeof r)return;const n=ut.preparePrototypeVariables(e.data_element_name||"it",r);let i;for(let t=0;t<e.prototypes.length;++t){const r=e.prototypes[t];if(r.div){if(void 0===r.selector){i=r.div;break}if(lt.getJsonWithVars(r.selector,n)){i=r.div;break}}}i&&t.push({div:i,vars:n})}))}else t=(i||[]).map((t=>({div:t})));_t=t.map(((t,e)=>lt.produceChildContext(t.div,{path:e,variables:t.vars})))}{let t=[];_t.forEach((e=>{t.push(lt.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),dt=K(t,(t=>[...t])),Z(),Z=l(dt,(t=>I=t))}if(vt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(T,vt),b="wrap"===M,_="horizontal"!==vt&&!b&&I.some(_e),w="vertical"!==vt&&!b&&I.some(we),gt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?"top"===t?"start":"bottom"===t?"end":t:e}(P,gt),ft=function(t,e,r){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t||"start"===t||"end"===t?"left"===t?"ltr"===e?"start":"end":"right"===t?"ltr"===e?"end":"start":t:r}(S,D,ft),(null==V?void 0:V.style)&&"overlap"!==vt&&ke()){const t=$e(V.style,Oe,(null==ht?void 0:ht.style)||null);ht=t?{show_at_start:Boolean(null!==(et=V.show_at_start)&&void 0!==et&&et),show_at_end:Boolean(null!==(rt=V.show_at_end)&&void 0!==rt&&rt),show_between:Boolean(null===(nt=V.show_between)||void 0===nt||nt),style:t,margins:me(V.margins)}:null}else ht=null;if((null==F?void 0:F.style)&&"overlap"!==vt&&ke()){const t=$e(F.style,Oe,(null==yt?void 0:yt.style)||null);yt=t?{show_at_start:Boolean(null!==(it=F.show_at_start)&&void 0!==it&&it),show_at_end:Boolean(null!==(ot=F.show_at_end)&&void 0!==ot&&ot),show_between:Boolean(null===(st=F.show_between)||void 0===st||st),style:t,margins:me(F.margins)}:null}else yt=null;$=ht||yt?function(t,e,r){const n={};return ye(n,e,"vertical"===t),ye(n,r,"horizontal"===t),n}(vt,ht,yt):null;{const t=null==A?void 0:A.ratio;pt=t&&Zt(t)?t:void 0}{let t={};"overlap"===vt&&(t.overlapParent=!0),"horizontal"!==vt&&(t.parentHAlign=b?"start":Ve[ft]),"vertical"!==vt&&(t.parentVAlign=b?"start":De[gt]),pt||w||j&&"wrap_content"!==j.type&&("match_parent"!==j.type||!(null==ct?void 0:ct.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!_&&("wrap_content"===(null==C?void 0:C.type)||"match_parent"===(null==C?void 0:C.type)&&(null==ct?void 0:ct.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===vt&&(t.parentContainerOrientation="horizontal"),"vertical"===vt&&(t.parentContainerOrientation="vertical"),b&&(t.parentContainerWrap=!0),bt=Tt(t,bt)}return x={orientation:vt,valign:gt,halign:ft,wrap:b,overflow:!1===E||0===E?"visible":void 0},k={gap:ht||yt?be(vt,ht,yt):void 0,"aspect-ratio":pt},B(),U(),L(),W(),H(),q(),O(),J(),G(),Z(),Y(),X(),Q(),`${R(ne,"Outer").$$render(t,{cls:At("container",he,x),componentContext:lt,layoutParams:ct,style:k,additionalPaddings:$,heightByAspect:Boolean(pt),parentOf:_t.map((t=>t.json)),replaceItems:function(t){lt=Object.assign(Object.assign({},lt),{json:Object.assign(Object.assign({},lt.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(_t,(e=>`${R(xn,"Unknown").$$render(t,{componentContext:e,layoutParams:bt},{},{})}`))} ${ht||yt?`${R(Fe,"ContainerSeparators").$$render(t,{direction:D,separator:ht,lineSeparator:yt,orientation:vt,contentHAlign:ft,contentVAlign:gt},{},{})}`:""}`})}`})),Pe=Se,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,r,n)=>{let i,a,s,c,u,d,p,v=o,{componentContext:g}=e,{layoutParams:f}=e,h="horizontal",m="rgba(0,0,0,0.08)";return void 0===e.componentContext&&r.componentContext&&void 0!==g&&r.componentContext(g),void 0===e.layoutParams&&r.layoutParams&&void 0!==f&&r.layoutParams(f),g.json&&(h="horizontal",m="rgba(0,0,0,0.08)"),i=g.getDerivedFromVars(g.json.delimiter_style),v(),v=l(i,(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(ne,"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>`:""})}`})),Ne={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image_is-rtl-mirror":"divkit-ae78c","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 Re="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Be=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,O,S,P,I,M,T,N,z,B,U,L,H=o,J=o,G=o,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,rt=o,nt=o,it=o,ot=o,{componentContext:lt}=e,{layoutParams:ct}=e;const dt=f(at);let pt;F=l(dt.direction,(t=>A=t));let 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",jt="",Ft="",Vt=0,Dt=0,Ot=0,St="",It="",Mt=!1;v((()=>{dt.removeSvgFilter(ft,Ct)})),void 0===e.componentContext&&r.componentContext&&void 0!==lt&&r.componentContext(lt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ct&&r.layoutParams(ct),lt.json&&(xt="none",kt="50% 50%",Ct="source_in"),i=lt.getDerivedFromVars(lt.json.image_url),it(),it=l(i,(t=>U=t)),a=lt.getDerivedFromVars(lt.json.gif_url),ot(),ot=l(a,(t=>L=t)),s=lt.getDerivedFromVars(lt.json.width),nt(),nt=l(s,(t=>B=t)),c=lt.getDerivedFromVars(lt.json.height),rt(),rt=l(c,(t=>z=t)),u=lt.getDerivedFromVars(lt.json.preview),et(),et=l(u,(t=>N=t)),d=lt.getDerivedFromVars(lt.json.placeholder_color),tt(),tt=l(d,(t=>T=t)),p=lt.getDerivedFromVars(lt.json.scale),K(),K=l(p,(t=>M=t)),g=lt.getDerivedFromVars({content_alignment_horizontal:lt.json.content_alignment_horizontal,content_alignment_vertical:lt.json.content_alignment_vertical}),Q(),Q=l(g,(t=>I=t)),h=lt.getDerivedFromVars(lt.json.accessibility),X(),X=l(h,(t=>P=t)),m=lt.getDerivedFromVars(lt.json.aspect),Y(),Y=l(m,(t=>S=t)),y=lt.getDerivedFromVars(lt.json.tint_color),Z(),Z=l(y,(t=>O=t)),b=lt.getDerivedFromVars(lt.json.tint_mode),G(),G=l(b,(t=>D=t)),_=lt.getDerivedFromVars(lt.json.appearance_animation),J(),J=l(_,(t=>V=t)),w=lt.getDerivedFromVars(lt.json.filters),H(),H=l(w,(t=>j=t));{let t="gif"===lt.json.type?L:U;mt="empty://"===t,mt&&(t=Re),vt=t}ht=0,vt?bt=!1:(bt=!0,lt.logError(st(new Error(`Missing "${"gif"===lt.json.type?"gif_url":"image_url"}" for "${lt.json.type}"`)))),$="wrap_content"===(null==B?void 0:B.type),x="wrap_content"===(null==z?void 0:z.type),_t=N?`url("${ze(N)}")`:"",yt=gt(T,1,yt),xt=wt(M)||xt,kt=function(t,e,r){let n=t.content_alignment_horizontal;const i=t.content_alignment_vertical;return"start"===n?n="ltr"===e?"left":"right":"end"===n&&(n="ltr"===e?"right":"left"),n&&"left"!==n&&"center"!==n&&"right"!==n||i&&"top"!==i&&"center"!==i&&"bottom"!==i?r:$t({content_alignment_horizontal:n,content_alignment_vertical:i})}(I,A,kt),k=(null==P?void 0:P.description)||"";{const t=null==S?void 0:S.ratio;Et=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}{const t=O?gt(O):void 0,e=ve(D,Ct);t===ft&&e===Ct||(dt.removeSvgFilter(ft,Ct),jt=t?dt.addSvgFilter(t,e):"",ft=t,Ct=e)}if(V&&"fade"===V.type){const t=V;Ft=Nt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Ot=Pt(t.duration,300),Dt=Pt(t.start_delay,0),Vt=Pt(t.alpha,0)}{let t="",e="";Array.isArray(j)&&j.length&&(t=Yt(j,lt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),St=t,It=e,Mt="rtl"===A&&Array.isArray(j)&&j.some((t=>"rtl_mirror"===t.type))}return E={aspect:"0"!==Et,"is-width-content":$,"is-height-content":x,loaded:!1,"before-appearance":Boolean(Ft)&&!0,"is-rtl-mirror":Mt},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:["",St].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Ft||void 0,"--divkit-appearance-fade-start":Ft?Vt:void 0,"--divkit-appearance-delay":Ft?`${Dt}ms`:void 0,"--divkit-appearance-duration":Ft?`${Ot}ms`:void 0},H(),F(),J(),G(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),nt(),it(),ot(),bt?"":`${R(ne,"Outer").$$render(t,{cls:At("image",Ne,E),componentContext:lt,layoutParams:ct,customDescription:!0},{},{default:()=>E.aspect?`<span${W("class",Ne["image__aspect-wrapper"],0)}${q({"padding-bottom":`${Et}%`})}><img${W("class",Ne.image__image,0)}${W("src",vt,0)} loading="lazy" decoding="async"${W("style",ut(C),0)}${W("alt",k,0)}${W("aria-hidden",k?null:"true",0)}${W("this",pt,0)}></span>`:`<img${W("class",Ne.image__image,0)}${W("src",vt,0)} loading="lazy" decoding="async"${W("style",ut(C),0)}${W("alt",k,0)}${W("aria-hidden",k?null:"true",0)}${W("this",pt,0)}>`})}`})),Ue={grid:"divkit-d9080",grid_halign_start:"divkit-fc24d",grid_halign_center:"divkit-a14a6",grid_halign_end:"divkit-cfd04",grid_valign_start:"divkit-c3106",grid_valign_center:"divkit-d4310",grid_valign_end:"divkit-fa9cf"};function Le(t){return t>0&&t<1}function We(t){return String(Math.ceil(1e3*t)/1e3)}function He(t,e,r){if(t.some(Le)){const e=Math.max(...t.filter(Le).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${dt(n*t[e]/i)},${We(t[e])}fr)`:t[e]?o[e]=`${We(t[e])}fr`:o[e]="auto";return o.join(" ")}const qe=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w=o,$=o,x=o,k=o,{componentContext:E}=e,{layoutParams:C}=e;h=l(f(at).direction,(t=>g=t));let j,A,F=1,V=[],D=[],O=[],S=[],P=0,I=!1,M="start",T="start";void 0===e.componentContext&&r.componentContext&&void 0!==E&&r.componentContext(E),void 0===e.layoutParams&&r.layoutParams&&void 0!==C&&r.layoutParams(C),E.json&&(F=1,M="start",T="start"),i=Array.isArray(E.json.items)&&E.json.items||[],a=E.getDerivedFromVars(E.json.column_count),k(),k=l(a,(t=>_=t)),s=E.getDerivedFromVars(E.json.content_alignment_vertical),$(),$=l(s,(t=>y=t)),c=E.getDerivedFromVars(E.json.content_alignment_horizontal),w(),w=l(c,(t=>m=t)),F=oe(_,F),u=i.map(((t,e)=>E.produceChildContext(t,{path:e})));{let t=[];u.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),j=K(t,(t=>[...t])),x(),x=l(j,(t=>b=t))}{const t={};let e=0,r=0;V=[],D=[],O=[],S=[],I=!1,A=u.map(((n,i)=>{var o,a,s,l;const c=b[i],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 n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?I=!0:(t[n+"_"+e]=!0,(!V[n]||V[n]<v)&&(V[n]=v),(!D[e]||D[e]<g)&&(D[e]=g),(!O[n]||O[n]<f)&&(O[n]=f),(!S[e]||S[e]<h)&&(S[e]=h));do{++e,e>=F&&(e=0,++r)}while(t[e+"_"+r]);return{componentContext:n,layoutParams:{gridArea:p}}})),0!==e&&(I=!0),I&&E.logError(st(new Error('Mismatching "grid" rows/columns'))),P=r}return M=de(y,M),T=ue(m,g,T),d={valign:M,halign:T},p={"grid-template-columns":He(V,O,F),"grid-template-rows":He(D,S,P)},v=I,h(),w(),$(),x(),k(),v?"":`${R(ne,"Outer").$$render(t,{cls:At("grid",Ue,d),componentContext:E,style:p,layoutParams:C,parentOf:u.map((t=>t.json)),replaceItems:function(t){E=Object.assign(Object.assign({},E),{json:Object.assign(Object.assign({},E.json),{items:t.filter(mt)})})}},{},{default:()=>`${N(A,(e=>`${R(xn,"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 r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function tr(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const er=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,O,S,P,M,T,z,B,U,L,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o,tt=o,et=o,rt=o,{componentContext:nt}=e,{layoutParams:ot}=e;const st=f(at);let lt;j=l(st.direction,(t=>C=t));let 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",jt="start",Ft=8,Vt="",Dt=[],Ot={},It=!1,Mt={},Nt=0;U=l(st.isDesktop,(t=>B=t));const zt=tr((function(){if(!lt)return;let t=lt.scrollLeft;"rtl"===C&&(t*=-1);const e=lt.scrollWidth,r=lt.offsetWidth;"ltr"===C?(vt=t>2,gt=t+r<e-2):(gt=t>2,vt=t+r<e-2)}),50);function Rt(){let t=[],e=pt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const n=pt[e].children[r];n&&t.push(n)}return t}function Bt(t,e,r="smooth"){const n="horizontal"===Ct,i=n?"offsetLeft":"offsetTop",o=n?"left":"top",a=t[e];a&<.scroll({[o]:Math.max(0,a[i]+.01-Ft/2),behavior:r})}function Ut(t){const e=Rt(),r=lt.getBoundingClientRect(),n=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!==n)return n;const i=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=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}v((()=>{ht=!1,_t&&!nt.fakeElement&&(st.unregisterInstance(_t),_t=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==nt&&r.componentContext(nt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ot&&r.layoutParams(ot),nt.json&&(Et=1,Ct="horizontal",jt="start",Ft=8,Vt=""),i=Array.isArray(nt.json.items)&&nt.json.items||[],a=nt.getDerivedFromVars(nt.json.column_count),et(),et=l(a,(t=>z=t)),s=nt.getDerivedFromVars(nt.json.orientation),tt(),tt=l(s,(t=>T=t)),c=nt.getDerivedFromVars(nt.json.cross_content_alignment),Q(),Q=l(c,(t=>M=t)),u=nt.getDerivedFromVars(nt.json.item_spacing),X(),X=l(u,(t=>P=t)),d=nt.getDerivedFromVars(nt.json.cross_spacing),Y(),Y=l(d,(t=>S=t)),p=nt.getDerivedFromVars(nt.json.paddings),Z(),Z=l(p,(t=>O=t)),g=nt.getDerivedFromVars(nt.json.scroll_mode),J(),J=l(g,(t=>V=t)),h=nt.getDerivedFromVars(nt.json.restrict_parent_scroll),rt(),rt=l(h,(t=>L=t)),m=nt.getDerivedFromVars(nt.json.scrollbar),q(),q=l(m,(t=>F=t)),y=nt.getDerivedFromVars(nt.json.default_item),H(),H=l(y,(t=>A=t)),b=i.map(((t,e)=>nt.produceChildContext(t,{path:e}))),_=B&&ht,_?"undefined"!=typeof ResizeObserver&&(ft=new ResizeObserver((()=>{zt()})),ft.observe(ct)):ft&&(ft.disconnect(),ft=null),Et=oe(z,Et),w=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(b,Et),Ct=Me(T,Ct),jt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(M,jt),Ft=Pt(P,Ft),wt=dt(Ft),xt=Pt(S,Ft),$t=dt(xt),Vt=St(O,C,Vt),$="horizontal"===Ct?"grid-template-columns":"grid-template-rows";{let t=[];b.forEach((e=>{const r="horizontal"===Ct?"width":"height";t.push(nt.getDerivedFromVars(e.json[r]))})),kt=K(t,(t=>t)),G(),G=l(kt,(t=>D=t))}Dt=[],Et>1?Dt.push("auto"):D.forEach((t=>{!t&&"horizontal"===Ct||"match_parent"===(null==t?void 0:t.type)?Dt.push("100%"):Dt.push("max-content")}));{const t={};let e={};It=!1,"horizontal"===Ct?e.parentVAlign=jt:e.parentHAlign=jt,"paging"===V&&(It=!0,e.scrollSnap="start",t["horizontal"===Ct?"scroll-padding-left":"scroll-padding-top"]=dt(Ft/2)),1===Et&&(e.parentLayoutOrientation=Ct),Ot=Tt(t,Ot),Mt=Tt(e,Mt)}return x={padding:Vt,"grid-gap":$t},k={"grid-gap":wt,[$]:Ke(Dt)},E={orientation:Ct,"scroll-snap":It,scrollbar:"auto"===F?"auto":"none"},Nt=Pt(A,Nt),nt.json&&zt(),nt.json&&(_t&&(st.unregisterInstance(_t),_t=void 0),nt.json.id&&!nt.fakeElement&&(_t=nt.json.id,st.registerInstance(_t,{setCurrentItem(t){const e=Rt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Bt(e,t)},setPreviousItem(t){const e=Ut("prev"),r=Rt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Bt(r,n)},setNextItem(t){const e="horizontal"===Ct?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Rt();if(e&&"ring"===t)return void Bt(r,0);const n=Ut("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Bt(r,i)}}))),j(),H(),q(),J(),G(),Z(),Y(),X(),Q(),tt(),et(),U(),rt(),` ${R(ne,"Outer").$$render(t,{cls:At("gallery",Ge,E),componentContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery",parentOf:i,replaceItems:function(t){nt=Object.assign(Object.assign({},nt),{json:Object.assign(Object.assign({},nt.json),{items:t.filter(mt)})})}},{},{default:()=>`<div class="${I(Ge.gallery__scroller,!0)+" "+I(L?it:"",!0)}"${W("style",ut(Ot),0)}${W("this",lt,0)}><div${W("class",Ge["gallery__items-grid"],0)}${W("style",ut(x),0)}${W("this",ct,0)}>${N(w,((e,r)=>`<div${W("class",Ge.gallery__items,0)}${W("style",ut(k),0)}${W("this",pt[r],0)}>${N(e,(e=>`${R(xn,"Unknown").$$render(t,{componentContext:e,layoutParams:Mt},{},{})}`))} </div>`))}</div></div> ${"horizontal"===Ct?`${vt&&_?` <div${W("class",yt||`${Ge.gallery__arrow} ${Ze} ${Xe}`,0)}>${yt?"":`<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>`:""} ${gt&&_?` <div${W("class",bt||`${Ge.gallery__arrow} ${Ze} ${Qe}`,0)}>${bt?"":`<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>`:""}`:""}`})}`})),rr=er,nr={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=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,O,S,P,M,T,z,B=o,U=o,L=o,H=o,J=o,G=o,Z=o,Y=o,X=o;var K,tt;let{componentContext:et}=e,{layoutParams:rt}=e;const nt=f(at);V=l(nt.direction,(t=>F=t));const ot=nt.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="",jt="",Ft="",Dt="",It="",Mt="",Nt="",zt="",Rt=0,Wt="",Ht="",qt=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(i.length-1,_+1):Math.max(_,null!=_t?_t:_);Xt=Xt.map(((t,n)=>{var o;return t||(n>=e&&n<=r&&(null===(o=i[n])||void 0===o?void 0:o.div)?et.produceChildContext(i[n].div,{path:n}):void 0)})),Qt=Qt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await $();const t=document.getElementById(`${ot}-panel-${_}`);t&&(ht.style.height=dt(t.offsetHeight))}(),Kt&&clearTimeout(Kt),Kt=window.setTimeout((()=>{Qt=i.map(((t,e)=>e===_))}),400),wt=-_*ht.clientWidth,e){await $();const t=ft.querySelector(`.${nr.tabs__item_selected}`);t&&t.focus()}}if(v((()=>{lt&&(nt.unregisterInstance(lt),lt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==et&&r.componentContext(et),void 0===e.layoutParams&&r.layoutParams&&void 0!==rt&&r.layoutParams(rt),et.json&&(xt=12,kt="",jt="",yt=void 0,Ft="",bt=void 0,Dt="",It="",Mt="",Nt="",zt="",Rt=0,Wt="",Ht="",qt=null),i=et.json.items||[],a=i.map((t=>t.div)),s=et.getDerivedFromVars(et.json.width),Y(),Y=l(s,(t=>T=t)),c=et.getDerivedFromVars(et.json.height),Z(),Z=l(c,(t=>M=t)),u=et.getJsonWithVars(et.json.selected_tab),d=et.getDerivedFromVars(et.json.tab_title_style),G(),G=l(d,(t=>P=t)),p=et.getDerivedFromVars(et.json.has_separator),J(),J=l(p,(t=>S=t)),g=et.getDerivedFromVars(et.json.separator_color),H(),H=l(g,(t=>O=t)),h=et.getDerivedFromVars(et.json.separator_paddings),L(),L=l(h,(t=>D=t)),m=et.getDerivedFromVars(et.json.switch_tabs_by_content_swipe_enabled),U(),U=l(m,(t=>A=t)),y=et.getDerivedFromVars(et.json.restrict_parent_scroll),X(),X=l(y,(t=>z=t)),b=et.getDerivedFromVars(et.json.title_paddings),B(),B=l(b,(t=>j=t)),_=u&&Number(u)||0,Array.isArray(i)&&i.length){let t=[];i.forEach(((e,r)=>{const n=et.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});n.title&&"string"==typeof n.title?t.push(n):et.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,et.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"'))));{let t={};"wrap_content"===(null==T?void 0:T.type)&&(t.parentHorizontalWrapContent=!0),M&&"wrap_content"!==M.type||(t.parentVerticalWrapContent=!0),$t=Tt(t,$t)}if(!ct&&(_<0||_>=i.length)&&(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab,length:i.length}})),_=_<0?0:i.length-1),ct||E.some((t=>_===t.index))||(et.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:et.json.selected_tab}})),_=(null===(K=E[0])||void 0===K?void 0:K.index)||0),w=P||{},xt=oe(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("ltr"===F?t.end:t.start)||Number(t.right)||0)/xt*10,bottom:(Number(t.bottom)||0)/xt*10,left:(Number("ltr"===F?t.start:t.end)||Number(t.left)||0)/xt*10};kt=St(e,F,kt)}{const t=w.line_height;void 0!==t&&Zt(t)&&(Et=dt(t/xt*10))}{const t=w.letter_spacing;void 0!==t&&Ot(t)&&(Ct=dt(t/xt*10))}if(w.corner_radius||w.corners_radius||w.font_size){const t=null!==(tt=w.corner_radius)&&void 0!==tt?tt:1e3;w.corners_radius?jt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!Ot(i[t]))return n;return Ut(t,e,r)}(w.corners_radius,t,xt,jt):Ot(t)&&(jt=dt(t/xt*10))}return yt=se(w.active_font_weight||w.font_weight,yt),Ft=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:yt||400}):"",bt=se(w.inactive_font_weight||w.font_weight,bt),Dt=w.font_family&&"string"==typeof w.font_family?nt.typefaceProvider(w.font_family,{fontWeight:bt||400}):"",It=gt(w.active_text_color,1,It),Mt=gt(w.inactive_text_color,1,Mt),Nt=gt(w.active_background_color,1,Nt),zt=gt(w.inactive_background_color,1,zt),Rt=Pt(w.item_spacing,Rt),S&&(O&&(Wt=gt(O,1,Wt)),D&&(Ht=St(D,F,Ht))),x={background:Wt,margin:Ht},k=void 0===A||Boolean(A),qt=Bt(j||void 0,qt),function(t){ct||(Xt=t.map(((t,e)=>{if(e===_&&(null==t?void 0:t.div))return et.produceChildContext(t.div,{path:e})})),Qt=t.map(((t,e)=>e===_)))}(i),et.json&&(lt&&(nt.unregisterInstance(lt),lt=void 0),!et.json.id||ct||et.fakeElement||(lt=et.json.id,nt.registerInstance(lt,{setCurrentItem(t){if(t<0||t>i.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?i.length-1:_),te(e)},setNextItem(t){let e=_+1;e>i.length-1&&(e="ring"===t?0:_),te(e)}}))),C(),B(),U(),V(),L(),H(),J(),G(),Z(),Y(),X(),ct?"":`${R(ne,"Outer").$$render(t,{cls:At("tabs",nr,{}),componentContext:et,layoutParams:rt,customActions:"tabs",parentOf:a,parentOfSimpleMode:!0,replaceItems:function(t){et.json.items&&(et=Object.assign(Object.assign({},et),{json:Object.assign(Object.assign({},et.json),{items:et.json.items.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})))})}))}},{},{default:()=>` <div class="${I(nr.tabs__list,!0)+" "+I(z?it:"",!0)}" role="tablist"${q({"--divkit-tabs-title-padding":qt?Vt(qt,F):"","--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":Ft||"","--divkit-tabs-inactive-font-family":Dt||"","--divkit-tabs-active-text-color":It,"--divkit-tabs-inactive-text-color":Mt,"--divkit-tabs-active-background-color":Nt,"--divkit-tabs-inactive-background-color":zt,"--divkit-tabs-border-radius":jt,"--divkit-tabs-items-spacing":Rt?pt(Rt):""})}${W("this",ft,0)}>${N(E,(e=>{let r=e.index,n=r===_;return` ${R(Jt,"Actionable").$$render(t,{componentContext:et,cls:At("tabs__item",nr,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action&&!et.fakeElement?[e.title_click_action].filter(Lt):[],attrs:{id:`${ot}-tab-${r}`,"aria-controls":`${ot}-panel-${r}`,role:"tab",tabindex:n&&!et.fakeElement?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:et.fakeElement?null:t=>function(t,e){return _===e||(te(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${S?`<div${W("class",nr.tabs__separator,0)}${W("style",ut(x),0)}></div>`:""} <div class="${I(nr.tabs__panels,!0)+" "+I(z?it:"",!0)}"${W("this",ht,0)}><div${W("class",At("tabs__swiper",nr,{inited:Gt,animated:Yt}),0)}${W("this",mt,0)}>${N(E,(e=>{let r=e.index,n=Xt[r];return` <div${W("class",At("tabs__panel",nr,{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)+"%"}">${n?`${R(xn,"Unknown").$$render(t,{componentContext:n,layoutParams:$t},{},{})}`:""} </div>`}))}</div></div>`})}`})),or=ir,ar="divkit-eb860",sr="divkit-e08c6";function lr(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),i=r-n;return t[n]*i+t[n+1]*(1-i)}}function cr(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function ur(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...ur(t))})):e.push(t),e}lr([.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]),lr([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 dr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},pr=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$=o,x=o,k=o,E=o,C=o;var j,A,F,V;let{ownerNode:D}=e,{data:O}=e,{internalId:S}=e,{parentComponentContext:P}=e;b=l(f(at).isDesktop,(t=>y=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!==O&&r.data(O),void 0===e.internalId&&r.internalId&&void 0!==S&&r.internalId(S),void 0===e.parentComponentContext&&r.parentComponentContext&&void 0!==P&&r.parentComponentContext(P),i=P.produceChildContext(O.div),a=P.getDerivedFromVars(O.position),k(),k=l(a,(t=>m=t)),s=P.getDerivedFromVars(null===(A=null===(j=O.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=O.offset)||void 0===F?void 0:F.y)||void 0===V?void 0:V.value),$(),$=l(c,(t=>g=t)),u=P.getDerivedFromVars(O.animation_in),E(),E=l(u,(t=>_=t)),d=P.getDerivedFromVars(O.animation_out),C(),C=l(d,(t=>w=t)),p={visible:!1},$(),x(),k(),b(),E(),C(),` <div class="${I(At("tooltip",dr,p),!0)+" "+I(y?nt:"",!0)}"${q({top:"",left:"",width:"",height:""})}${W("this",undefined,0)}>${R(xn,"Unknown").$$render(t,{componentContext:i},{},{})}</div>`}));function vr(t){return"change_bounds"===t.type?t:"set"===t.type?vr(t.items[0]):null}const gr=L(((t,e,r,n)=>{let i,o,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 O(t,e,r){let{json:n,parentComponentContext:i,transitions:o,node:a}=e;n=u.getJsonWithVars(n),o=u.getJsonWithVars(o);const s=ur(o),l=a.getBoundingClientRect(),c=Object.assign(Object.assign({},n),{margins:void 0,alpha:(d=s,d.some((t=>"fade"===t.type))?void 0:n.alpha)});var d;return{json:c,componentContextCopy:i.produceChildContext(c,{fake:!0}),elementBbox:l,rootBbox:t,transitions:s,alpha:n.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}}async function S(t){if(b===t)return;p.setRunning("stateChange",!0);const e=new Set(k);C.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),C=[];let r=[];if(m){const t=m.getBoundingClientRect();r=A.map((e=>O(t,e,"out")))}F.forEach((t=>{x.set(t.id,t.node.getBoundingClientRect())})),j=[],A=[],F=[];const n=l.find((e=>e.state_id===t))||null;if(n?(b=t,null==s||s.setValue(b),D(n)):u.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!m)return;const i=m.getBoundingClientRect();let o=j.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=>O(i,t,"in")));r=r.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=r.concat(o),c=a.reduce(((t,e)=>Math.max(t,cr(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:i,beforeBbox:x.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:u.getJsonWithVars(vr(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,r,n,i){if(!m)return Promise.resolve();const o=O(m.getBoundingClientRect(),{json:t,parentComponentContext:e,transitions:r,node:n},i),a=cr(o.transitions),s=Object.assign(Object.assign({},o),{maxDuration:a});return C=[...C.filter((t=>t.node!==o.node)),s],new Promise((t=>{s.resolvePromise=t}))},registerChildWithTransitionIn(t,e,r,n){const i={json:t,parentComponentContext:e,transitions:r,node:n};return j.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,parentComponentContext:e,transitions:r,node:n};return A.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,parentComponentContext:e,transitions:r,node:n};return F.push(o),new Promise((t=>{o.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&&r.componentContext&&void 0!==u&&r.componentContext(u),void 0===e.layoutParams&&r.layoutParams&&void 0!==d&&r.layoutParams(d),i=u.json.div_id||u.json.id,o=u.getJsonWithVars(u.json.default_state_id),a=u.json.state_id_variable,s=a?u.getVariable(a,"string"):null,u.json&&(V=!1),i?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),i&&!(null==u?void 0:u.fakeElement)&&(y=i,h.registerInstance(i,{setState:S,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())||o;if(e){b=e;const r=t.find((t=>t.state_id===b))||null;D(r),r||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=>{S(t)})))}}(l),w?"":`${R(ne,"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 r=e.map(((e,r)=>Object.assign(Object.assign({},e),{div:t[r]})));u.json=Object.assign(Object.assign({},u.json),{states:r}),b&&D(r.find((t=>t.state_id===b))||null)}},{},{default:()=>`${_?`${R(xn,"Unknown").$$render(t,{componentContext:_},{},{})}`:""} <div${W("class","divkit-adaae",0)} aria-hidden="true"${W("this",m,0)}>${N(C,(e=>"direction"in e?`<div${W("class",ar,0)}${q({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${W("class",sr,0)}>${R(xn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`:`<div${W("class",ar,0)}><div${W("class",sr,0)}>${R(xn,"Unknown").$$render(t,{componentContext:e.componentContextCopy},{},{})}</div> </div>`))}</div>`})} ${null!=u&&u.tooltips?`${N(u.tooltips,(e=>`${R(pr,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,parentComponentContext:u},{},{})}`))}`:""}`})),fr=gr,hr={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"},mr=L(((t,e,r,n)=>{let i,a,s,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,O,S=o,P=o,M=o,T=o,z=o,B=o;var U,L,H,q,J,G,Z,Y,X,Q;let{componentContext:K}=e,{layoutParams:tt}=e;const et=f(at);E=l(et.direction,(t=>k=t));const rt=et.genId("pager"),nt=et.getCustomization("pagerLeftClass"),ot=et.getCustomization("pagerRightClass");j=l(et.isDesktop,(t=>C=t)),tr((function(){if(!vt)return;const t=function(){const t=Array.from(ct.children),e=ct.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===yt?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:gt}();t!==gt&&(gt=t)}),50);let lt,ct,vt=!1,gt=0,ft=0,ht=!1,yt="horizontal",bt="",_t="",wt="";function $t(t,e="smooth"){const r="horizontal"===yt,n=ct.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";ct.scroll({[o]:n[i],behavior:e}),gt=t}v((()=>{vt=!1,lt&&(et.unregisterInstance(lt),lt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==K&&r.componentContext(K),void 0===e.layoutParams&&r.layoutParams&&void 0!==tt&&r.layoutParams(tt),K.json&&(_t=""),i=K.getDerivedFromVars(K.json.layout_mode),P(),P=l(i,(t=>A=t)),a=K.getDerivedFromVars(K.json.orientation),z(),z=l(a,(t=>D=t)),s=K.getDerivedFromVars(K.json.item_spacing),T(),T=l(s,(t=>V=t)),u=K.getDerivedFromVars(K.json.paddings),M(),M=l(u,(t=>F=t)),d=K.getDerivedFromVars(K.json.restrict_parent_scroll),B(),B=l(d,(t=>O=t)),p=(Array.isArray(K.json.items)&&K.json.items||[]).map(((t,e)=>K.produceChildContext(t,{path:e}))),A?"percentage"!==A.type&&"fixed"!==A.type?(ht=!0,K.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ht=!1:(ht=!0,K.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),yt=Me(D,yt);{const t=null==V?void 0:V.value;t&&Ot(t)&&(bt=dt(t||0))}if(_t=St(F,k,_t),g="horizontal"===yt?"grid-auto-columns":"grid-auto-rows","fixed"===(null==A?void 0:A.type)){const t=pt("horizontal"===yt?(("ltr"===k?null===(U=K.json.paddings)||void 0===U?void 0:U.start:null===(L=K.json.paddings)||void 0===L?void 0:L.end)||(null===(H=K.json.paddings)||void 0===H?void 0:H.left)||0)+(("ltr"===k?null===(q=K.json.paddings)||void 0===q?void 0:q.end:null===(J=K.json.paddings)||void 0===J?void 0:J.start)||(null===(G=K.json.paddings)||void 0===G?void 0:G.right)||0):((null===(Z=K.json.paddings)||void 0===Z?void 0:Z.top)||0)+((null===(Y=K.json.paddings)||void 0===Y?void 0:Y.bottom)||0)),e=null===(X=A.neighbour_page_width)||void 0===X?void 0:X.value;wt=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${bt})`:"100%"}else if("percentage"===(null==A?void 0:A.type)){const t=null===(Q=A.page_width)||void 0===Q?void 0:Q.value;wt=`${Number(t)}%`}return h={"grid-gap":bt,padding:_t,[g]:wt},m={orientation:yt},y=ht,b=C&&vt&&!y,_="ltr"===k?gt>0:gt+1<p.length,w="ltr"===k?gt+1<p.length:gt>0,$=et.getStore("pagers"),S(),S=l($,(t=>x=t)),function(t,e){const r=K.json.id;if(r){const n=new Map(x);c($,x=n.set(r,{instId:rt,size:t,currentItem:e,scrollToPagerItem:$t}),x)}}(p.length,gt),function(t){var e;if(t===ft)return;ft=t;const r=K.getJsonWithVars(null===(e=p[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&K.execAnyActions(r)}(gt),K.json&&(lt&&(et.unregisterInstance(lt),lt=void 0),K.json.id&&!K.fakeElement&&(lt=K.json.id,et.registerInstance(lt,{setCurrentItem(t){if(t<0||t>p.length-1)throw new Error('Item is out of range in "set-current-item" action');$t(t)},setPreviousItem:function(t){let e=gt-1;e<0&&(e="ring"===t?p.length-1:gt),$t(e)},setNextItem:function(t){let e=gt+1;e>p.length-1&&(e="ring"===t?0:gt),$t(e)}}))),S(),E(),j(),P(),M(),T(),z(),B(),y?"":`${R(ne,"Outer").$$render(t,{cls:At("pager",hr,m),componentContext:K,layoutParams:tt,customPaddings:!0,parentOf:p.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:()=>`<div class="${I(hr.pager__items,!0)+" "+I(O?it:"",!0)}"${W("style",ut(h),0)}${W("this",ct,0)}>${N(p,(e=>`<div${W("class",hr.pager__item,0)}>${R(xn,"Unknown").$$render(t,{componentContext:e},{},{})} </div>`))}</div> ${_&&b?` <div${W("class",nt||`${hr.pager__arrow} ${Ze} ${Xe}`,0)}>${nt?"":`<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",hr["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",ot||`${hr.pager__arrow} ${Ze} ${Qe}`,0)}>${ot?"":`<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",hr["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>`:""}`})}`})),yr=mr,br={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_direction_ltr:"divkit-a7473",indicator_direction_rtl:"divkit-a7d63",indicator_placement_stretch:"divkit-b6bd3"},_r=["rounded_rectangle","circle"],wr=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,v,g,h,m,y,b,_,w,x,k,E,C,j,A,F=o,V=o,D=o,O=o,S=o,P=o,M=o,T=o,z=o;var B,U;let{componentContext:L}=e,{layoutParams:H}=e;const J=f(at);y=l(J.direction,(t=>m=t));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,nt=5;if(void 0===e.componentContext&&r.componentContext&&void 0!==L&&r.componentContext(L),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),L.json&&(K="default",et=15,rt=10,nt=5,X={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"}),i=L.getDerivedFromVars(L.json.shape),P(),P=l(i,(t=>E=t)),a=L.getDerivedFromVars(L.json.active_item_color),O(),O=l(a,(t=>x=t)),s=L.getDerivedFromVars(L.json.inactive_item_color),S(),S=l(s,(t=>k=t)),c=L.getDerivedFromVars(L.json.active_item_size),M(),M=l(c,(t=>C=t)),u=L.getDerivedFromVars(L.json.active_shape),z(),z=l(u,(t=>A=t)),d=L.getDerivedFromVars(L.json.inactive_shape),T(),T=l(d,(t=>j=t)),p=L.getDerivedFromVars(L.json.space_between_centers),V(),V=l(p,(t=>_=t)),v=L.getDerivedFromVars(L.json.items_placement),D(),D=l(v,(t=>w=t)),A&&(X=$e({type:"shape_drawable",shape:A},_r,X)),j&&(Q=$e({type:"shape_drawable",shape:j},_r,Q)),!A&&!j&&E){const t=oe(C,1.3);Q=$e({type:"shape_drawable",shape:E,color:Q.background},_r,Q),Q.background=gt(k,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(x,1,X.background)}if(!w||"default"!==w.type&&"stretch"!==w.type)K="default",_&&(et=Pt(_.value,et));else if(K=w.type,"default"===K)et=Pt(null===(B=w.space_between_centers)||void 0===B?void 0:B.value,et);else if("stretch"===K){const t=w;rt=oe(t.max_visible_items,rt),nt=Pt(null===(U=t.item_spacing)||void 0===U?void 0:U.value,nt)}return g=J.getStore("pagers"),F(),F=l(g,(t=>b=t)),async function(t){if(L.json.pager_id&&t.has(L.json.pager_id)&&(Y=t.get(L.json.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"})}}}(b),h={placement:K,direction:m},y(),F(),V(),D(),O(),S(),P(),M(),T(),z(),`${R(ne,"Outer").$$render(t,{cls:At("indicator",br,h),componentContext:L,layoutParams:H},{},{default:()=>`<div${W("class",br.indicator__scroller,0)}${W("this",G,0)}><div${W("class",br.indicator__items,0)} role="tablist"${q({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(nt):"","--divkit-indicator-stretch-max-count":"stretch"===K?rt:"","--divkit-indicator-stretch-max-spacer":"stretch"===K?dt((rt-1)*nt):""})}${W("this",Z,0)}>${Y?`${N(Array(Y.size),((t,e)=>{let r=e===Y.currentItem;return` <div class="${I(At("indicator__item",br,{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)}"${W("aria-selected",r?"true":"false",0)}${W("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),$r=wr,xr={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider_direction_rtl:"divkit-fb7b5",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 kr(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&>(t.text_color)||"#000",i=ae(t.font_weight);if(Zt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:dt(t.font_size),fontWeight:i,textColor:n};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 Er(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Cr="function"==typeof BigInt;function jr(t){return Cr?BigInt(t):Number(t)}const Ar=jr("9223372036854775807"),Fr=jr("-9223372036854775808");function Vr(t){const e=jr(t);if(e>Ar||e<Fr)throw new Error("Integer overflow.");return e}const Dr=Vr(0);function Or(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}}class Ir extends Pr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}}class Mr 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"}}class Tr 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"}}class Nr 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"}}class zr 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"}}class Rr extends Pr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}class Br 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"}}class Ur 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"}}const Lr={string:Ir,number:Tr,integer:Mr,boolean:Nr,color:zr,url:Rr,dict:Br,array:Ur};function Wr(t,e,r){if(!(e in Lr))throw new Error("Unsupported variable type");return new Lr[e](t,r)}function Hr(){}function qr(t){return t(this.value),Hr}function Jr(){throw new Error("Cannot change the value of this type of variable")}const Gr={string:class extends Ir{},number:class extends Tr{},integer:class extends Mr{},boolean:class extends Nr{},color:class extends zr{},url:class extends Rr{},dict:class extends Br{},array:class extends Ur{}};for(const t in Gr){const e=Gr[t];e.prototype.subscribe=qr,e.prototype.set=Jr,e.prototype.setValue=Jr}const Zr={width:10,height:10,borderRadius:5,background:"#000"},Yr=["rounded_rectangle","circle"],Xr=["rounded_rectangle"];function Qr(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const Kr=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,O,S,P,M,T,z,B,U,L,H,J,G,Z,Y,X,Q,K=o,tt=o,et=o,rt=o,nt=o,it=o,ot=o,lt=o,ct=o,ut=o,vt=o,gt=o,ft=o,ht=o;var mt,yt,bt,_t;let{componentContext:wt}=e,{layoutParams:$t}=e;const xt=f(at),kt=f(qt);let Et,Ct;S=l(xt.direction,(t=>O=t));let jt,Ft,Vt,Dt=0,St=100,Pt=Zr,It=Pt,Mt=Zr,Tt=Zr,Nt=null,Rt=null,Bt=Vt,Ut="",Lt="",Wt=!1,Ht=Er(Y||0,Dt,St),Jt=Er(Z||0,Dt,St),Gt=!1;function Zt(){if(!Ct)return;const t=St-Dt,e=(null==Nt?void 0:Nt.width)||0,r=(null==Rt?void 0:Rt.width)||0;Math.max(e,r)*t>=(null==Ct?void 0:Ct.clientWidth)?Gt||(wt.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}tr(Zt,50),v((()=>{Et&&(xt.unregisterFocusable(Et),Et=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==wt&&r.componentContext(wt),void 0===e.layoutParams&&r.layoutParams&&void 0!==$t&&r.layoutParams($t),wt.json&&(Pt=Zr,It=Pt,Mt=Zr,Tt=Zr,Nt=null,Rt=null,Vt=void 0,Bt=void 0,Ut="",Lt=""),i=wt.json.thumb_value_variable,a=wt.json.thumb_secondary_value_variable,s=i&&wt.getVariable(i,"integer")||Wr("temp","integer",0),gt(),gt=l(s,(t=>Y=t)),c=a&&wt.getVariable(a,"integer")||Wr("temp","integer",0),vt(),vt=l(c,(t=>Z=t)),u=wt.getDerivedFromVars(wt.json.min_value),ht(),ht=l(u,(t=>Q=t)),d=wt.getDerivedFromVars(wt.json.max_value),ft(),ft=l(d,(t=>X=t)),p=wt.getDerivedFromVars(wt.json.thumb_style),ut(),ut=l(p,(t=>G=t)),g=wt.getDerivedFromVars(wt.json.thumb_secondary_style),ct(),ct=l(g,(t=>J=t)),h=wt.getDerivedFromVars(wt.json.track_inactive_style),lt(),lt=l(h,(t=>H=t)),m=wt.getDerivedFromVars(wt.json.track_active_style),ot(),ot=l(m,(t=>L=t)),y=wt.getDerivedFromVars(wt.json.tick_mark_active_style),it(),it=l(y,(t=>U=t)),b=wt.getDerivedFromVars(wt.json.tick_mark_inactive_style),nt(),nt=l(b,(t=>B=t)),_=wt.getDerivedFromVars(wt.json.thumb_text_style),rt(),rt=l(_,(t=>z=t)),w=wt.getDerivedFromVars(wt.json.thumb_secondary_text_style),et(),et=l(w,(t=>T=t)),$=wt.getDerivedFromVars(wt.json.accessibility),tt(),tt=l($,(t=>M=t)),x=wt.getDerivedFromVars(wt.json.secondary_value_accessibility),K(),K=l(x,(t=>P=t)),Dt=zt(Q,Dt),St=zt(X,St),Zt();{const t=Er(Y||0,Dt,St);t!==Ht&&(Ht=t)}{const t=Er(Z||0,Dt,St);t!==Jt&&(Jt=t)}Pt=$e(G,Yr,Pt),It=$e(J,Yr,Pt),Mt=$e(H,Xr,Mt),Tt=$e(L,Xr,Tt);{let t=$e(U,Yr,Zr);t!==Zr&&(Nt=t)}Nt?(jt=a?Qr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!0):Qr(Dt,Ht,Dt,St,!0),Zt()):jt=[];{let t=$e(B,Yr,Zr);t!==Zr&&(Rt=t)}Rt?(Ft=a?Qr(Math.min(Ht,Jt),Math.max(Ht,Jt)+1,Dt,St,!1):Qr(Ht+1,St+1,Dt,St,!0),Zt()):Ft=[],Vt=kr(z,Vt),Bt=kr(T,Vt),(null==M?void 0:M.description)?Ut=M.description:wt.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),(null==P?void 0:P.description)?Lt=P.description:a&&wt.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(wt.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Pt===Zr?(wt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===Zr?(wt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===Zr&&(wt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Wt&&(Wt=t)}return k=dt(Math.max(...[Pt.width,It.width,0].filter(Ot))),E=dt(Math.max(...[Pt.height,It.height,0].filter(Ot))),C=(Ht-Dt)/(St-Dt),j=a?(Jt-Dt)/(St-Dt):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(Pt.width),"--divkit-slider-thumb-height":dt(Pt.height),"--divkit-slider-thumb-secondary-width":dt(It.width),"--divkit-slider-thumb-secondary-height":dt(It.height),"--divkit-slider-text-offset-x":(null===(mt=null==Vt?void 0:Vt.offset)||void 0===mt?void 0:mt.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(yt=null==Vt?void 0:Vt.offset)||void 0===yt?void 0:yt.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(bt=null==Bt?void 0:Bt.offset)||void 0===bt?void 0:bt.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(_t=null==Bt?void 0:Bt.offset)||void 0===_t?void 0:_t.y)?pt(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?dt(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?dt(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?dt(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?dt(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?dt(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?dt(Rt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Rt?void 0:Rt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Rt?void 0:Rt.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={direction:O},wt.json,S(),K(),tt(),et(),rt(),nt(),it(),ot(),lt(),ct(),ut(),vt(),gt(),ft(),ht()," "+(Wt?"":`${R(ne,"Outer").$$render(t,{cls:At("slider",xr,D),style:V,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,componentContext:wt,layoutParams:$t},{},{default:({focusHandler:t,blurHandler:e})=>{var r,n,i,o,s,l;return`<div${W("class",xr["slider__tracks-wrapper"],0)}><div${W("class",xr["slider__tracks-inner"],0)}${W("this",Ct,0)}><div${W("class",xr.slider__track,0)}${q({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${W("class",xr["slider__active-track"],0)}${q({left:"ltr"===O?(100*F).toFixed(2)+"%":void 0,right:"ltr"===O?void 0:(100*F).toFixed(2)+"%",width:(100*A).toFixed(2)+"%",height:dt(Tt.height),"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> ${N(jt,(t=>`<div class="${I(xr.slider__tick,!0)+" "+I(xr.slider__tick_active,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} ${N(Ft,(t=>`<div class="${I(xr.slider__tick,!0)+" "+I(xr.slider__tick_inactive,!0)}"${q({"--divkit-slider-tick":t})}></div>`))} <div${W("class",xr.slider__thumb,0)}${q({"border-radius":dt(Pt.borderRadius),background:Pt.background,"box-shadow":Pt.boxShadow||""})}>${Vt?`<div${W("class",xr["slider__thumb-text"],0)}><div${W("class",xr["slider__thumb-text-inner"],0)}${q({"font-size":(null===(r=Vt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(n=Vt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(i=Vt)||void 0===i?void 0:i.textColor)||"#000"})}>${I(Ht)}</div></div>`:""}</div> ${a?`<div class="${I(xr.slider__thumb,!0)+" "+I(xr.slider__thumb_secondary,!0)}"${q({"border-radius":dt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Bt?`<div class="${I(xr["slider__thumb-text"],!0)+" "+I(xr["slider__thumb-text_secondary"],!0)}"><div${W("class",xr["slider__thumb-text-inner"],0)}${q({"font-size":(null===(o=Bt)||void 0===o?void 0:o.fontSize)||"1em","font-weight":(null===(s=Bt)||void 0===s?void 0:s.fontWeight)||"",color:(null===(l=Bt)||void 0===l?void 0:l.textColor)||"#000"})}>${I(Jt)}</div></div>`:""}</div>`:""} <input type="range"${W("class",xr.slider__input,0)}${W("min",Dt,0)}${W("max",St,0)} step="1"${W("value",Ht,0)}${W("aria-label",Ut,0)}${W("this",undefined,0)}> ${a?`<input type="range"${W("class",`${xr.slider__input} ${xr.slider__input_secondary}`,0)}${W("min",Dt,0)}${W("max",St,0)} step="1"${W("value",Jt,0)}${W("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),tn={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_end":"divkit-e9096",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_start":"divkit-cd14f","input_alignment-vertical_end":"divkit-cd38f","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 en(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=en(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const i=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-i>=r&&t[n-i]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-i}}function rn(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 nn{constructor(t){this.char=t}}class on{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class an{constructor(t){rn(this,"filters",new Map),rn(this,"destructedValue",[]),rn(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 nn)t+=r.char;else if(r instanceof on)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 on&&!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 on(null,this.filters.get(e.key),e.placeholder):new nn(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=en(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),i=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=i?this.calculateMaxShift(i,o):void 0;this.replaceChars(n,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(i,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,n=e;for(;n<this.destructedValue.length;)this.destructedValue[n]instanceof on&&++r,++n;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let n=0;for(;n<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+n);)++n;return Math.max(0,n-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 on&&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 on&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let n;n=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=n}calculateInsertableSubstring(t,e){let r="",n=e;const i=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof on);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=i();null!=e&&e.test(t)&&(r+=t,++n)})),r}collectValueRange(t,e){let r="",n=t;for(;n<=e;){const t=this.destructedValue[n];t instanceof on&&null!==t.char&&(r+=t.char),++n}return r}replaceChars(t,e,r){let n=this.calculateInsertableSubstring(t,e);void 0!==r&&(n=n.substring(0,r));let i=e,o=0;for(;i<this.destructedValue.length&&o<n.length;){const t=this.destructedValue[i],e=n[o];t instanceof on&&(t.char=e,++o),++i}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof on);)++e;return e}}class sn extends an{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function ln(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 cn extends an{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),ln(this,"currencyFormatter",new Intl.NumberFormat),ln(this,"decimalSeparator","."),ln(this,"localeDigits",{}),ln(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),n=[{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:n,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=en(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),i=t.lastIndexOf(this.decimalSeparator),o=n!==i||-1===n&&-1===i,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,n=0;for(;n<t.length;){if(t[n]===this.decimalSeparator&&!this.inDiff(e,n)){r=n;break}n++}let i=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(i=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(n=r;n<t.length;)this.isDigit(t[n])&&!this.inDiff(e,n)&&a--,n++;else{let r=!1;for(let n=0;n<t.length;n++){const i=t[n];i===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(i)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==i,l=[];n=t.length-1;let c=!1;for(;n>=0;){const u=t[n],d=l.length<=o;this.isDigit(u)?this.inDiff(e,n)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&n===i?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==n&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=n),n--}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 un(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 dn(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(),n=t.parentNode,i=Array.from(n.childNodes).indexOf(t)+1;r.setStart(n,i),r.setEnd(n,i),e.addRange(r)}}catch(t){}else for(let r=0,n=t.childNodes.length;r<n;++r){const n=t.childNodes[r],i=un(n);if(e<=i)return void dn(n,e);e-=i}else try{const r=window.getSelection();if(r){r.removeAllRanges();const n=document.createRange();n.setStart(t,e),n.setEnd(t,e),r.addRange(n)}}catch(t){}}const pn="undefined"!=typeof document&&"inputMode"in document.createElement("input"),vn={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"},gn=L(((t,e,r,n)=>{let i,a,s,u,d,p,g,h,m,y,b,_,w,x,k,E,C,j,A,F,V,D,O,S,P,M,T,N,z,B,U,L,H,q,J,G,Z,Y,X,Q,K,tt,et,rt,nt,it,ot,lt,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,jt=o,Ft=o,Ot=o,St=o,It=o;var Mt;let{componentContext:Tt}=e,{layoutParams:Nt}=e;const zt=f(at);let Rt,Ut;L=l(zt.direction,(t=>U=t));let Lt,Wt,Ht,qt=null,Jt="",Gt="",Yt=!1,Xt="",Qt=12,Kt="",te="",ee="#000",re="",ie="start",ae="center",le="multi_line_text",ce="text",pe="",ve=null,ge="",fe="",he="";function me(t){Ut instanceof HTMLInputElement?Ut.selectionStart=Ut.selectionEnd=t:dn(Ut,t)}async function ye(){if(!Ut||!qt)return;qt.overrideRawValue(z),u.set(qt.rawValue),c(s,N=Jt=Gt=qt.value,N);const t=qt.cursorPosition;await $(),document.activeElement===Ut&&me(t)}var be;v((()=>{Rt&&(zt.unregisterFocusable(Rt),Rt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==Tt&&r.componentContext(Tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Nt&&r.layoutParams(Nt),Tt.json&&(Xt="",Qt=12,Lt=void 0,Kt="",Wt=void 0,ee="#000",re="",ie="left",ae="center",le="multi_line_text",ce="text",Ht=void 0),i=Tt.json.text_variable,a=null===(Mt=Tt.json.mask)||void 0===Mt?void 0:Mt.raw_text_variable,s=i&&Tt.getVariable(i,"string")||Wr("temp","string",""),ct(),ct=l(s,(t=>N=t)),u=a&&Tt.getVariable(a,"string")||Wr("temp","string",""),vt(),vt=l(u,(t=>z=t)),d=Tt.getDerivedFromVars(Tt.json.hint_text),St(),St=l(d,(t=>ot=t)),p=Tt.getDerivedFromVars(Tt.json.hint_color),Ot(),Ot=l(p,(t=>it=t)),g=Tt.getDerivedFromVars(Tt.json.font_size),Ft(),Ft=l(g,(t=>nt=t)),h=Tt.getDerivedFromVars(Tt.json.font_weight),jt(),jt=l(h,(t=>rt=t)),m=Tt.getDerivedFromVars(Tt.json.font_family),Ct(),Ct=l(m,(t=>et=t)),y=Tt.getDerivedFromVars(Tt.json.line_height),Et(),Et=l(y,(t=>tt=t)),b=Tt.getDerivedFromVars(Tt.json.letter_spacing),kt(),kt=l(b,(t=>K=t)),_=Tt.getDerivedFromVars(Tt.json.text_color),xt(),xt=l(_,(t=>Q=t)),w=Tt.getDerivedFromVars(Tt.json.highlight_color),$t(),$t=l(w,(t=>X=t)),x=Tt.getDerivedFromVars(Tt.json.text_alignment_horizontal),wt(),wt=l(x,(t=>Y=t)),k=Tt.getDerivedFromVars(Tt.json.text_alignment_vertical),_t(),_t=l(k,(t=>Z=t)),E=Tt.getDerivedFromVars(Tt.json.keyboard_type),bt(),bt=l(E,(t=>G=t)),C=Tt.getDerivedFromVars(Tt.json.mask),yt(),yt=l(C,(t=>J=t)),j=Tt.getDerivedFromVars(Tt.json.max_visible_lines),mt(),mt=l(j,(t=>q=t)),A=Tt.getDerivedFromVars(Tt.json.paddings),ht(),ht=l(A,(t=>H=t)),F=Tt.getDerivedFromVars(Tt.json.accessibility),ft(),ft=l(F,(t=>B=t)),V=Tt.getDerivedFromVars(Tt.json.select_all_on_focus),It(),It=l(V,(t=>lt=t)),i?Yt=!1:(Yt=!0,Tt.logError(st(new Error('Missing "text_variable" in "input"')))),"fixed_length"===(null==(be=J)?void 0:be.type)?qt=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 n={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(n),r):new sn(n,e)}return r||null}(be,Tt.logError,qt):"currency"===(null==be?void 0:be.type)&&(qt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new cn(t.locale,e)}(be,Tt.logError,qt)),qt&&ye(),qt||Jt===N||(Jt=Gt=N),qt&&qt.rawValue!==z&&ye(),D=ot,Xt=gt(it,1,Xt),Qt=oe(nt,Qt),Lt=se(rt,Lt),Kt=et&&"string"==typeof et?zt.typefaceProvider(et,{fontWeight:Lt||400}):"";{const t=tt;Zt(t)&&(Wt=t/Qt)}return Dt(K)&&(te=dt(K)),ee=gt(Q,1,ee),re=gt(X,1,re),ie=ue(Y,U,ie),ae=de(Z,ae),G&&G in vn&&(ce=vn[G],le=G),"currency"===(null==J?void 0:J.type)&&(ce=pn?"text":"tel",Ht="decimal"),O="multi_line_text"===le,pe=Zt(q)?`calc(${q*(Wt||1.25)*(Qt/10)+"em"} + ${pt(Pt(null==H?void 0:H.top,0)+Pt(null==H?void 0:H.bottom,0))})`:"",ve=Bt(H||void 0,ve),ge=ve?Vt({top:(Number(ve.top)||0)/Qt*10,right:(Number("ltr"===U?ve.end:ve.start)||Number(ve.right)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10,left:(Number("ltr"===U?ve.start:ve.end)||Number(ve.left)||0)/Qt*10},U):"",fe=ve?Vt({top:(Number(ve.top)||0)/Qt*10,bottom:(Number(ve.bottom)||0)/Qt*10},U):"",(null==B?void 0:B.description)?he=B.description:Tt.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),S={"highlight-color":Boolean(re),multiline:O,"alignment-horizontal":ie,"alignment-vertical":ae},P={"--divkit-input-hint-color":Xt,"--divkit-input-highlight-color":re,"--divkit-input-line-height":Wt,"font-weight":Lt,"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},Ut&&Tt.json&&(Rt&&(zt.unregisterFocusable(Rt),Rt=void 0),Tt.json.id&&!Tt.fakeElement&&(Rt=Tt.json.id,zt.registerFocusable(Rt,{focus(){Ut&&Ut.focus()}}))),ct(),vt(),ft(),L(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Et(),Ct(),jt(),Ft(),Ot(),St(),It(),Yt?"":`${R(ne,"Outer").$$render(t,{cls:At("input",tn,S),style:P,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,componentContext:Tt,layoutParams:Nt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return O?`<span${W("class",tn["input__scroll-wrapper"],0)}>${!Gt&&D?`<div${W("class",tn.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",tn,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${W("aria-label",he,0)}${W("style",ut(M),0)}${W("this",Ut,0)}>${n=Gt,void 0===n?"":n}</span></span>`:`<input${W("type",ce,0)}${W("inputmode",Ht,0)}${W("class",At("input__input",tn,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${W("aria-label",he,0)}${W("style",ut(M),0)}${W("placeholder",D,0)}${W("value",Jt,0)}${W("this",Ut,0)}>`;var n}})}`})),fn={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"},hn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C,j,A,F,V,D,O,S,P,M,T,z,B,U=o,L=o,H=o,q=o,J=o,G=o,Z=o,Y=o,X=o,Q=o,K=o,{componentContext:tt}=e,{layoutParams:et}=e;const rt=f(at);let nt;M=l(rt.direction,(t=>P=t));let it,ot,lt=!1,ct="",pt=null,vt="",ft="rgba(0,0,0,.45)",ht=12,mt="",yt="",bt="#000",_t="";v((()=>{nt&&(rt.unregisterFocusable(nt),nt=void 0)})),void 0===e.componentContext&&r.componentContext&&void 0!==tt&&r.componentContext(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),tt.json&&(pt=null,ft="rgba(0,0,0,.45)",ht=12,it=void 0,mt="",ot=void 0,yt="",bt="#000",_t=""),i=tt.json.value_variable,a=tt.json.options,s=Array.isArray(a)&&a.filter((t=>"string"==typeof t.value))||[],c=i&&tt.getVariable(i,"string")||Wr("temp","string",""),Q(),Q=l(c,(t=>z=t)),u=tt.getDerivedFromVars(tt.json.paddings),X(),X=l(u,(t=>T=t)),d=tt.getDerivedFromVars(tt.json.hint_text),K(),K=l(d,(t=>B=t)),p=tt.getDerivedFromVars(tt.json.hint_color),Y(),Y=l(p,(t=>S=t)),g=tt.getDerivedFromVars(tt.json.font_size),Z(),Z=l(g,(t=>O=t)),h=tt.getDerivedFromVars(tt.json.font_weight),G(),G=l(h,(t=>D=t)),m=tt.getDerivedFromVars(tt.json.font_family),J(),J=l(m,(t=>V=t)),y=tt.getDerivedFromVars(tt.json.line_height),q(),q=l(y,(t=>F=t)),b=tt.getDerivedFromVars(tt.json.letter_spacing),H(),H=l(b,(t=>A=t)),_=tt.getDerivedFromVars(tt.json.text_color),L(),L=l(_,(t=>j=t)),w=tt.getDerivedFromVars(tt.json.accessibility),U(),U=l(w,(t=>C=t)),Array.isArray(s)&&s.length||tt.logError(st(new Error('Empty selection "items" in "select"'))),i?lt=!1:(lt=!0,tt.logError(st(new Error('Missing "value_variable" in "select"'))));{const t=s.find((t=>t.value===z));t?ct=("string"==typeof t.text?t.text:t.value)||"":(ct="",z&&tt.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}ht=oe(O,ht),pt=Bt(T||void 0,pt),vt=pt?Vt({top:(Number(pt.top)||0)/ht*10,right:(Number("ltr"===P?pt.end:pt.start)||Number(pt.right)||0)/ht*10,bottom:(Number(pt.bottom)||0)/ht*10,left:(Number("ltr"===P?pt.start:pt.end)||Number(pt.left)||0)/ht*10},P):"",ft=gt(S,1,ft),it=se(D,it),mt=V&&"string"==typeof V?rt.typefaceProvider(V,{fontWeight:it||400}):"";{const t=F;Zt(t)&&(ot=t/ht)}return Dt(A)&&(yt=dt(A/ht*10)),bt=gt(j,1,bt),(null==C?void 0:C.description)?_t=C.description:tt.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),$={hint:!ct},x={"--divkit-input-hint-color":ft,"font-weight":it,"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},tt.json,U(),L(),H(),q(),J(),G(),Z(),Y(),M(),X(),Q(),K(),lt?"":`${R(ne,"Outer").$$render(t,{cls:At("select",fn,$),style:x,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,componentContext:tt,layoutParams:et},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${W("class",fn["select__select-text"],0)}${W("style",ut(k),0)} aria-hidden="true"> ${I(ct||B||"")}</span> <select${W("class",At("select__select",fn,{"has-custom-focus":t}),0)}${W("aria-label",_t,0)}${W("style",ut(E),0)}${W("this",undefined,0)}>${N(s,(t=>`<option${W("class",fn.select__option,0)}${W("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),mn={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},yn=L(((t,e,r,n)=>{let i,a,s,c,u,d,p,g,h,m,y,b,_,w,$,x,k,E,C=o,j=o,A=o,F=o,V=o,D=o,O=o,{componentContext:S}=e,{layoutParams:P}=e;const I=f(at);let M,T,z,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=>{S.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&&r.componentContext&&void 0!==S&&r.componentContext(S),void 0===e.layoutParams&&r.layoutParams&&void 0!==P&&r.layoutParams(P),S.json&&(J=!1,G=!1,Z=!1,z=void 0,Y="fit"),i=S.json.elapsed_time_variable,a=i&&S.getVariable(i,"integer")||Wr("temp","integer",0),a&&(B&&B(),B=a.subscribe((function(t){L?L=!1:T&&(T.currentTime=Number(t)/1e3)}))),s=S.getDerivedFromVars(S.json.video_sources),O(),O=l(s,(t=>E=t)),c=S.getDerivedFromVars(S.json.repeatable),D(),D=l(c,(t=>k=t)),u=S.getDerivedFromVars(S.json.autostart),C(),C=l(u,(t=>b=t)),d=S.getDerivedFromVars(S.json.muted),V(),V=l(d,(t=>x=t)),p=S.getDerivedFromVars(S.json.preview),F(),F=l(p,(t=>$=t)),g=S.getDerivedFromVars(S.json.scale),A(),A=l(g,(t=>w=t)),h=S.getDerivedFromVars(S.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,S.logError(st(new Error('Missing "video_sources" in "video"')))),J=pe(k,J),G=pe(b,G),Z=pe(x,Z),z="string"==typeof $?ze($):z,Y=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(w)||Y;{const t=null==_?void 0:_.ratio;X=t&&Zt(t)?(100/Number(t)).toFixed(2):"0"}return S.json&&(M&&(I.unregisterInstance(M),M=void 0),!S.json.id||U||S.fakeElement||(M=S.json.id,I.registerInstance(M,{pause:function(){null==T||T.pause()},start:Q}))),S.json&&b&&T&&Q(),m={aspect:"0"!==X},y={"object-fit":Y},C(),j(),A(),F(),V(),D(),O(),U?"":`${R(ne,"Outer").$$render(t,{cls:At("video",mn,m),customActions:"video",componentContext:S,layoutParams:P},{},{default:()=>m.aspect?`<div${W("class",mn["video__aspect-wrapper"],0)}${q({"padding-bottom":`${X}%`})}><video${W("class",mn.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",z,0)}${W("this",T,0)}>${N(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video></div>`:`<video${W("class",mn.video__video,0)}${W("style",ut(y),0)} playsinline ${J?"loop":""} ${G?"autoplay":""} ${Z?"muted":""}${W("poster",z,0)}${W("this",T,0)}>${N(H,(t=>`<source${W("src",t.src,0)}${W("type",t.type,0)}>`))}</video>`})}`})),bn=yn,_n=L(((t,e,r,n)=>{let i,o;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&&r.componentContext&&void 0!==s&&r.componentContext(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.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[r,n]of t.variables)e.set(r,n.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 i=s.json.items,void 0===i||Array.isArray(i)?v=!1:(v=!0,s.logError(st(new Error('Incorrect "items" prop for div "custom"')))),o=(!v&&i||[]).map(((t,e)=>s.produceChildContext(t,{path:e}))),u?`${R(ne,"Outer").$$render(t,{componentContext:s,layoutParams:l},{},{default:()=>{return(e=u.element)?`<${u.element}${O([T(s.json.custom_props||{})],{})}${W("this",undefined,0)}>${V(e)?"":`${d?`<template${O([T(p)],{})}> ${d}</template>`:""} ${!v&&i?`${N(o,(e=>`${R(xn,"Unknown").$$render(t,{componentContext:e},{},{})}`))}`:""}`}${V(e)?"":`</${e}>`}`:"";var e}})}`:""})),wn=_n,$n={};$n.text=fe,$n.container=Pe,$n.separator=Te,$n.image=Be,$n.gif=Be,$n.grid=Je,$n.gallery=rr,$n.tabs=or,$n.state=fr,$n.pager=yr,$n.indicator=$r,$n.slider=Kr,$n.input=gn,$n.select=hn,$n.video=bn,$n.custom=wn;const xn=L(((t,e,r,n)=>{let{componentContext:i}=e,{layoutParams:o}=e;const a=f(at);let s;void 0===e.componentContext&&r.componentContext&&void 0!==i&&r.componentContext(i),void 0===e.layoutParams&&r.layoutParams&&void 0!==o&&r.layoutParams(o);{const t=i.json;if(s=(null==t?void 0:t.type)&&$n[t.type]||void 0,!s){let e;e=(null==t?void 0:t.type)&&a.hasTemplate(t.type)?"Recursive template":"Unknown component",i.logError(st(new Error(e),{additional:{component:(null==t?void 0:t.type)||"<missing>"}}))}}return s?`${R(s||z,"svelte:component").$$render(t,{componentContext:i,layoutParams:o},{},{})}`:""})),kn=L(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${W("class","divkit-dc22b",0)} aria-hidden="true"><defs>${N([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return` <filter${W("id",i[t],0)}><feFlood${W("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${W("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"${W("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function En(t,e,r,n){const i=r[t.type];if(!i)return n(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 n=Object.keys(r).filter((t=>"__proto__"!==t)),i=n.filter((t=>"$"!==t.charAt(0))),o=n.filter((t=>"$"===t.charAt(0)));return i.forEach((n=>{const i=r[n];"object"==typeof i&&null!==i?(e[n]=Array.isArray(i)?[]:{},t(e[n],i)):e[n]=i})),o.forEach((t=>{const n=r[t],i=a[n];if(void 0!==i){const r=t.substring(1);e[r]=i}})),e}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Cn(){}function jn(t){return{subscribe:e=>(e(t),Cn)}}function An(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Fn(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Vn(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 Dn(t){try{return Vr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function On(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Sn(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Sn.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function Pn(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}jn(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Sn,Error),Sn.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+o.line+":"+o.column;if(n){var s=this.location.end,l=Pn("",o.line.toString().length," "),c=n[i.line-1],u=(i.line===s.line?s.column:c.length+1)-i.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+Pn("",i.column-1," ")+Pn("",u,"^")}else e+="\n at "+a}return e},Sn.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(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 n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."};const In=new Map,Mn=new Map;function Tn(t,e,r){const n={args:e,cb:r},i=In.get(t)||[];In.has(t)||In.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Mn.set(o,n)}function Nn(t,e){let r=t.args.length,n=t.args.length;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function zn(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=>{zn(t,e)}));break;case"BinaryExpression":case"LogicalExpression":zn(t.left,e),zn(t.right,e);break;case"UnaryExpression":zn(t.argument,e);break;case"ConditionalExpression":zn(t.test,e),zn(t.consequent,e),zn(t.alternate,e);break;case"TryExpression":zn(t.test,e),zn(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{zn(t,e)}))}}function Rn(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Bn(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Un(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 Bn(t.value);if("color"===t.type)return Yn(Zn(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 Ln(t){let e=Un(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Wn(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Hn(t,e){if(Cr)return Vr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function qn(t,e){if(e<Fr||e>Ar)throw new Error("Integer overflow.");!Cr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Jn(t){const e=[];return zn(t,{Variable(t){e.push(t.id.name)}}),e}function Gn(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Zn(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Yn(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 Xn(t){return Yn(Zn(t))}const Qn=Number.MAX_VALUE,Kn=Number.MIN_VALUE,ti="string",ei="integer",ri="number",ni="boolean",ii="color",oi="url",ai="datetime",si="dict",li="array";function ci(t,e){return{type:ti,value:Un(e)}}function ui(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 di(t,e,r,n){const i=t.variables.get(e.value);let o;return o=i&&i.getType()===n?i.getValue():r.value,"color"===n&&(o=Xn(o)),{type:n,value:o}}function pi(t,e,r){return di(t,e,r,r.type)}function vi(t,e,r){return di(t,e,r,"color")}function gi(t,e,r){return di(t,e,r,"url")}const fi=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:ei,value:Vr(n)}},hi=fi("getUTCFullYear"),mi=fi("getUTCMonth"),yi=fi("getUTCDate"),bi=fi("getUTCDay"),_i=fi("getUTCHours"),wi=fi("getUTCMinutes"),$i=fi("getUTCSeconds"),xi=fi("getUTCMilliseconds");function ki(t,e,r,n){if(!n.value.length)return t.warnings.push(st(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===ti?e.value:Un(e);for(;i.length+o.length<r.value;)i+=n.value;return i.length>0&&i.length+o.length>r.value&&(i=i.substring(0,Number(r.value)-Number(o.length))),i}function Ei(t,e,r,n){const i=ki(t,e,r,n);return{type:ti,value:i+Un(e)}}function Ci(t,e,r,n){const i=ki(t,e,r,n);return{type:ti,value:Un(e)+i}}function ji(t){return(e,r)=>{const n=Zn(r.value);return{type:ri,value:n[t]/255}}}function Ai(t){return(e,r,n)=>{const i=Zn(r.value);return i[t]=255*n.value,{type:ii,value:Yn(i)}}}const Fi=ji("a"),Vi=ji("r"),Di=ji("g"),Oi=ji("b"),Si=Ai("a"),Pi=Ai("r"),Ii=Ai("g"),Mi=Ai("b");function Ti(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Vr(e.value)/Vr(r);return qn(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Vr(i)%Vr(n)),{type:ei,value:i}}const Ni=36e5;function zi(t,e){return(r,n,...i)=>{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 n=r[e[t]];if(void 0===n)throw new Error(`Missing property "${e[t]}" in the dict.`);r=n}return r}(n.value,i.map((t=>t.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.");qn(r,o),o=Vr(o)}return"string"===t&&"color"===e&&(o=Xn(o)),{type:e,value:o}}}function Ri(t,e){return(r,n,i,...o)=>{try{return t(r,i,...o)}catch(t){let r=n.value;return"color"===e&&(r=Xn(r)),{type:e,value:r}}}}const Bi=zi("string","string"),Ui=zi("number","number"),Li=zi("number","integer"),Wi=zi("boolean","boolean"),Hi=zi("string","color"),qi=zi("string","url"),Ji=zi("array","array"),Gi=zi("object","dict"),Zi=Ri(Bi,"string"),Yi=Ri(Ui,"number"),Xi=Ri(Li,"integer"),Qi=Ri(Wi,"boolean"),Ki=Ri(Hi,"color"),to=Ri(qi,"url");function eo(t,e){return(r,n,i)=>{if(i.value<0||i.value>=n.value.length)throw new Error(`Requested index (${i.value}) out of bounds array size (${n.value.length}).`);let o=n.value[Number(i.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.");qn(r,o),o=Vr(o)}return"string"===t&&"color"===e&&(o=Xn(o)),{type:e,value:o}}}function ro(t,e){return(r,n,i,o)=>{try{return t(r,n,i)}catch(t){let r=o.value;return"color"===e&&(r=Xn(r)),{type:e,value:r}}}}const no=eo("string","string"),io=eo("number","number"),oo=eo("number","integer"),ao=eo("boolean","boolean"),so=eo("string","color"),lo=eo("string","url"),co=eo("array","array"),uo=eo("object","dict"),po=ro(no,"string"),vo=ro(io,"number"),go=ro(oo,"integer"),fo=ro(ao,"boolean"),ho=ro(so,"color"),mo=ro(lo,"url");function yo(t){return t.map(Ln).join(", ")}Tn("toString",[ei],ci),Tn("toString",[ri],ci),Tn("toString",[ni],ci),Tn("toString",[ii],ci),Tn("toString",[oi],ci),Tn("toNumber",[ei],ui),Tn("toNumber",[ti],ui),Tn("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:ei,value:Vr(r)}})),Tn("toInteger",[ti],(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:ei,value:r}})),Tn("toInteger",[ni],(function(t,e){return{type:ei,value:Vr(e.value?1:0)}})),Tn("toBoolean",[ei],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:ni,value:r}})),Tn("toBoolean",[ti],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:ni,value:"true"===e.value?1:0}})),Tn("toColor",[ti],(function(t,e){return{type:ii,value:Xn(e.value)}})),Tn("toUrl",[ti],(function(t,e){return{type:oi,value:e.value}})),Tn("encodeUri",[ti],(function(t,e){try{return{type:ti,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Tn("decodeUri",[ti],(function(t,e){try{return{type:ti,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Tn("getIntegerValue",[ti,ei],pi),Tn("getNumberValue",[ti,ri],pi),Tn("getBooleanValue",[ti,ni],pi),Tn("getStringValue",[ti,ti],pi),Tn("getColorValue",[ti,ii],vi),Tn("getColorValue",[ti,ti],vi),Tn("getUrlValue",[ti,oi],gi),Tn("getUrlValue",[ti,ti],gi),Tn("parseUnixTime",[ei],(function(t,e){return{type:ai,value:new Date(1e3*Number(e.value))}})),Tn("nowLocal",[],(function(){return{type:ai,value:new Date}})),Tn("addMillis",[ai,ei],(function(t,e,r){return{type:ai,value:new Date(e.value.getTime()+Number(r.value))}})),Tn("setYear",[ai,ei],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:ai,value:n}})),Tn("setMonth",[ai,ei],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMonth(n-1),{type:ai,value:i}})),Tn("setDay",[ai,ei],(function(t,e,r){const n=new Date(e.value),i=Number(r.value);if(i<=0&&-1!==i||i>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${i} for date ${Un(e)}.`);return n.setUTCDate(-1===i?0:i),{type:ai,value:n}})),Tn("setHours",[ai,ei],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const i=new Date(e.value);return i.setUTCHours(n),{type:ai,value:i}})),Tn("setMinutes",[ai,ei],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMinutes(n),{type:ai,value:i}})),Tn("setSeconds",[ai,ei],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCSeconds(n),{type:ai,value:i}})),Tn("setMillis",[ai,ei],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMilliseconds(n),{type:ai,value:i}})),Tn("getYear",[ai],hi),Tn("getMonth",[ai],mi),Tn("getDay",[ai],yi),Tn("getDayOfWeek",[ai],bi),Tn("getHours",[ai],_i),Tn("getMinutes",[ai],wi),Tn("getSeconds",[ai],$i),Tn("getMillis",[ai],xi),Tn("getIntervalSeconds",[ei],(function(t,e){return Ti(t,e,1e3,60)})),Tn("getIntervalTotalSeconds",[ei],(function(t,e){return Ti(t,e,1e3)})),Tn("getIntervalMinutes",[ei],(function(t,e){return Ti(t,e,6e4,60)})),Tn("getIntervalTotalMinutes",[ei],(function(t,e){return Ti(t,e,6e4)})),Tn("getIntervalHours",[ei],(function(t,e){return Ti(t,e,Ni,24)})),Tn("getIntervalTotalHours",[ei],(function(t,e){return Ti(t,e,Ni)})),Tn("getIntervalTotalDays",[ei],(function(t,e){return Ti(t,e,864e5)})),Tn("getIntervalTotalWeeks",[ei],(function(t,e){return Ti(t,e,6048e5)})),Tn("len",[ti],(function(t,e){return{type:ei,value:Vr(e.value.length)}})),Tn("contains",[ti,ti],(function(t,e,r){return{type:ni,value:e.value.includes(r.value)?1:0}})),Tn("substring",[ti,ei,ei],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:ti,value:e.value.substring(Number(r.value),Number(n.value))}})),Tn("replaceAll",[ti,ti,ti],(function(t,e,r,n){let i;return i=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:ti,value:i}})),Tn("index",[ti,ti],(function(t,e,r){return{type:ei,value:Vr(e.value.indexOf(r.value))}})),Tn("lastIndex",[ti,ti],(function(t,e,r){return{type:ei,value:Vr(e.value.lastIndexOf(r.value))}})),Tn("trim",[ti],(function(t,e){return{type:ti,value:e.value.trim()}})),Tn("trimLeft",[ti],(function(t,e){return{type:ti,value:e.value.replace(/^\s+/,"")}})),Tn("trimRight",[ti],(function(t,e){return{type:ti,value:e.value.replace(/\s+$/,"")}})),Tn("toUpperCase",[ti],(function(t,e){return{type:ti,value:e.value.toUpperCase()}})),Tn("toLowerCase",[ti],(function(t,e){return{type:ti,value:e.value.toLowerCase()}})),Tn("padStart",[ti,ei,ti],Ei),Tn("padStart",[ei,ei,ti],Ei),Tn("padEnd",[ti,ei,ti],Ci),Tn("padEnd",[ei,ei,ti],Ci),Tn("testRegex",[ti,ti],(function(t,e,r){let n;try{n=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:ni,value:n.test(e.value)?1:0}})),Tn("div",[ei,ei],(function(t,e,r){if(r.value===Dr)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=Hn(0,n),qn(t,n),{type:ei,value:n}})),Tn("div",[ri,ri],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:ri,value:n}})),Tn("mod",[ei,ei],(function(t,e,r){if(r.value===Dr)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=Hn(0,n),qn(t,n),{type:ei,value:n}})),Tn("mod",[ri,ri],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:ri,value:n}})),Tn("mul",[{type:ei,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Dr;for(let n=1;n<e.length;++n)r*=e[n].value,r=Hn(0,r),qn(t,r);return{type:ei,value:r}})),Tn("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}})),Tn("sub",[{type:ei,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Dr;for(let n=1;n<e.length;++n)r-=e[n].value,r=Hn(0,r),qn(t,r);return{type:ei,value:r}})),Tn("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}})),Tn("sum",[{type:ei,isVararg:!0}],(function(t,...e){let r=Dr;for(let n=0;n<e.length;++n)r+=e[n].value,r=Hn(0,r),qn(t,r);return{type:ei,value:r}})),Tn("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}})),Tn("abs",[ei],(function(t,e){const r=Or(e.value);return qn(t,r),{type:e.type,value:r}})),Tn("abs",[ri],(function(t,e){const r=Math.abs(e.value);return{type:ri,value:r}})),Tn("max",[{type:ei,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:ei,value:r}})),Tn("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)))}})),Tn("min",[{type:ei,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:ei,value:r}})),Tn("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)))}})),Tn("maxNumber",[],(function(){return{type:ri,value:Qn}})),Tn("minNumber",[],(function(){return{type:ri,value:Kn}})),Tn("maxInteger",[],(function(t){return qn(t,Ar),{type:ei,value:Ar}})),Tn("minInteger",[],(function(t){return qn(t,Fr),{type:ei,value:Fr}})),Tn("round",[ri],(function(t,e){const r=Math.sign(e.value);return{type:ri,value:r*Math.round(Math.abs(e.value))}})),Tn("floor",[ri],(function(t,e){return{type:ri,value:Math.floor(e.value)}})),Tn("ceil",[ri],(function(t,e){return{type:ri,value:Math.ceil(e.value)}})),Tn("signum",[ei],(function(t,e){return{type:ei,value:Sr(e.value)}})),Tn("signum",[ri],(function(t,e){return{type:ri,value:Math.sign(e.value)}})),Tn("copySign",[ei,ei],(function(t,e,r){let n;if(r.value===Dr)n=e.value;else if(e.value===Dr)n=Vr(0);else{const t=Sr(r.value);n=Or(e.value)*t}return qn(t,n),{type:ei,value:n}})),Tn("copySign",[ri,ri],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const i=Math.abs(e.value)*n;return{type:ri,value:i}})),Tn("getColorAlpha",[ti],Fi),Tn("getColorAlpha",[ii],Fi),Tn("getColorRed",[ti],Vi),Tn("getColorRed",[ii],Vi),Tn("getColorGreen",[ti],Di),Tn("getColorGreen",[ii],Di),Tn("getColorBlue",[ti],Oi),Tn("getColorBlue",[ii],Oi),Tn("setColorAlpha",[ti,ri],Si),Tn("setColorAlpha",[ii,ri],Si),Tn("setColorRed",[ti,ri],Pi),Tn("setColorRed",[ii,ri],Pi),Tn("setColorGreen",[ti,ri],Ii),Tn("setColorGreen",[ii,ri],Ii),Tn("setColorBlue",[ti,ri],Mi),Tn("setColorBlue",[ii,ri],Mi),Tn("rgb",[ri,ri,ri],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:ii,value:Yn(i)}})),Tn("argb",[ri,ri,ri,ri],(function(t,e,r,n,i){const o={a:255*e.value,r:255*r.value,g:255*n.value,b:255*i.value};return{type:ii,value:Yn(o)}})),Tn("getDictString",[si,{type:ti,isVararg:!0}],Bi),Tn("getStringFromDict",[si,{type:ti,isVararg:!0}],Bi),Tn("getDictNumber",[si,{type:ti,isVararg:!0}],Ui),Tn("getNumberFromDict",[si,{type:ti,isVararg:!0}],Ui),Tn("getDictInteger",[si,{type:ti,isVararg:!0}],Li),Tn("getIntegerFromDict",[si,{type:ti,isVararg:!0}],Li),Tn("getDictBoolean",[si,{type:ti,isVararg:!0}],Wi),Tn("getBooleanFromDict",[si,{type:ti,isVararg:!0}],Wi),Tn("getDictColor",[si,{type:ti,isVararg:!0}],Hi),Tn("getColorFromDict",[si,{type:ti,isVararg:!0}],Hi),Tn("getDictUrl",[si,{type:ti,isVararg:!0}],qi),Tn("getUrlFromDict",[si,{type:ti,isVararg:!0}],qi),Tn("getDictOptString",[ti,si,{type:ti,isVararg:!0}],Zi),Tn("getOptStringFromDict",[ti,si,{type:ti,isVararg:!0}],Zi),Tn("getDictOptNumber",[ri,si,{type:ti,isVararg:!0}],Yi),Tn("getOptNumberFromDict",[ri,si,{type:ti,isVararg:!0}],Yi),Tn("getDictOptInteger",[ei,si,{type:ti,isVararg:!0}],Xi),Tn("getOptIntegerFromDict",[ei,si,{type:ti,isVararg:!0}],Xi),Tn("getDictOptBoolean",[ni,si,{type:ti,isVararg:!0}],Qi),Tn("getOptBooleanFromDict",[ni,si,{type:ti,isVararg:!0}],Qi),Tn("getDictOptColor",[ii,si,{type:ti,isVararg:!0}],Ki),Tn("getOptColorFromDict",[ii,si,{type:ti,isVararg:!0}],Ki),Tn("getDictOptColor",[ti,si,{type:ti,isVararg:!0}],Ki),Tn("getOptColorFromDict",[ti,si,{type:ti,isVararg:!0}],Ki),Tn("getDictOptUrl",[ti,si,{type:ti,isVararg:!0}],to),Tn("getOptUrlFromDict",[ti,si,{type:ti,isVararg:!0}],to),Tn("getDictOptUrl",[oi,si,{type:ti,isVararg:!0}],to),Tn("getOptUrlFromDict",[oi,si,{type:ti,isVararg:!0}],to),Tn("getDictFromDict",[si,{type:ti,isVararg:!0}],Gi),Tn("getArrayFromDict",[si,{type:ti,isVararg:!0}],Ji),Tn("getOptArrayFromDict",[si,{type:ti,isVararg:!0}],(function(t,e,...r){try{return Ji(t,e,...r)}catch(t){return{type:li,value:[]}}})),Tn("getOptDictFromDict",[si,{type:ti,isVararg:!0}],(function(t,e,...r){try{return Gi(t,e,...r)}catch(t){return{type:si,value:{}}}})),Tn("getArrayString",[li,ei],no),Tn("getStringFromArray",[li,ei],no),Tn("getArrayNumber",[li,ei],io),Tn("getNumberFromArray",[li,ei],io),Tn("getArrayInteger",[li,ei],oo),Tn("getIntegerFromArray",[li,ei],oo),Tn("getArrayBoolean",[li,ei],ao),Tn("getBooleanFromArray",[li,ei],ao),Tn("getArrayColor",[li,ei],so),Tn("getColorFromArray",[li,ei],so),Tn("getArrayUrl",[li,ei],lo),Tn("getUrlFromArray",[li,ei],lo),Tn("getArrayFromArray",[li,ei],co),Tn("getDictFromArray",[li,ei],uo),Tn("getArrayOptString",[li,ei,ti],po),Tn("getOptStringFromArray",[li,ei,ti],po),Tn("getArrayOptNumber",[li,ei,ri],vo),Tn("getOptNumberFromArray",[li,ei,ri],vo),Tn("getArrayOptInteger",[li,ei,ei],go),Tn("getOptIntegerFromArray",[li,ei,ei],go),Tn("getArrayOptBoolean",[li,ei,ni],fo),Tn("getOptBooleanFromArray",[li,ei,ni],fo),Tn("getArrayOptColor",[li,ei,ii],ho),Tn("getOptColorFromArray",[li,ei,ii],ho),Tn("getArrayOptColor",[li,ei,ti],ho),Tn("getOptColorFromArray",[li,ei,ti],ho),Tn("getArrayOptUrl",[li,ei,oi],mo),Tn("getOptUrlFromArray",[li,ei,oi],mo),Tn("getArrayOptUrl",[li,ei,ti],mo),Tn("getOptUrlFromArray",[li,ei,ti],mo),Tn("getOptArrayFromArray",[li,ei],(function(t,e,r){try{return co(t,e,r)}catch(t){return{type:li,value:[]}}})),Tn("getOptDictFromArray",[li,ei],(function(t,e,r){try{return uo(t,e,r)}catch(t){return{type:si,value:{}}}})),Tn("len",[li],(function(t,e){return{type:ei,value:Vr(e.value.length)}}));const bo={StringLiteral:function(t,e){return{type:ti,value:e.value}},NumberLiteral:function(t,e){return{type:ri,value:e.value}},IntegerLiteral:function(t,e){return qn(t,e.value),{type:ei,value:e.value}},BooleanLiteral:function(t,e){return{type:ni,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Rn(_o(t,e.argument));switch(e.operator){case"!":if(r.type===ni)return{type:ni,value:r.value?0:1};Gn(`${e.operator}${Ln(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===ei){const e=r.value*Vr(n);return qn(t,e),{type:ei,value:e}}if(r.type===ri)return{type:ri,value:r.value*n};Gn(`${e.operator}${Ln(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Rn(_o(t,e.test));if(r.type===ni)return r.value?_o(t,e.consequent):_o(t,e.alternate);Gn(`${Ln(r)} ? ${Ln(_o(t,e.consequent))} : ${Ln(_o(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return _o(t,e.test)}catch(r){return _o(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return _o(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=Un(_o(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:ti,value:r}},LogicalExpression:function(t,e){const r=Rn(_o(t,e.left));if(r.type!==ni&&Gn(`${Ln(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:ni,value:0};const n=Rn(_o(t,e.right));return n.type!==ni&&Gn(`${Ln(r)} ${e.operator} ${Ln(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Wn(n.type)}.`),{type:ni,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=_o(t,e.left),i=_o(t,e.right);if(n.type!==i.type&&Gn(`${Ln(n)} ${e.operator} ${Ln(i)}`,`Operator '${r}' cannot be applied to different types: ${Wn(n.type)} and ${Wn(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===ai&&r.type===ai?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:ni,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==ri&&e.type!==ei&&e.type!==ai&&Gn(`${Ln(e)} ${t} ${Ln(r)}`,`Operator '${t}' cannot be applied to ${Wn(e.type)} type.`);const i=e.type===ai?e.value.getTime():e.value,o=r.type===ai?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:ni,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==ti&&r.type!==ri&&r.type!==ei&&Gn(`${Ln(r)} ${e} ${Ln(n)}`,`Operator '${e}' cannot be applied to ${Wn(r.type)} type.`),r.type===ti)return"-"===e&&Gn(`${Ln(r)} - ${Ln(n)}`,`Operator '${e}' cannot be applied to ${Wn(r.type)} type.`),{type:ti,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===ei)try{i=Hn(0,i),qn(t,i)}catch(t){Gn(`${Ln(r)} ${e} ${Ln(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let i;if(r.type!==ei&&r.type!==ri&&Gn(`${Ln(r)} ${e} ${Ln(n)}`,`Operator '${e}' cannot be applied to ${Wn(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Gn(`${Ln(r)} ${e} ${Ln(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===ei)try{i=Hn(0,i),qn(t,i)}catch(t){Gn(`${Ln(r)} ${e} ${Ln(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n;const i=e.arguments.map((e=>_o(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(Mn.has(o))n=Mn.get(o);else{const t=function(t,e){const r=In.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=Nn(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t||"type"in t&&"missing"===t.type){const e=i.map((t=>Wn(t.type))).join(", "),n=`${r}(${yo(i)})`;"few"===t.type&&0===i.length?Gn(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Gn(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Gn(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){Gn(`${r}(${yo(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function _o(t,e){if(e.type in bo)return bo[e.type](t,e);throw new Error("Unsupported expression")}class wo{constructor(t){this.ast=t}apply(t,e,r=!1){try{const n=function(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1},n=_o(r,e);return r.safeIntegerOverflow&&r.warnings.push(st(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}(t,this.ast);n.warnings.forEach(e);const i=n.result;if("error"===i.type)return void e(st(new Error("Expression execution error"),{additional:{message:i.value}}));const o=i.value;if(o instanceof Date)return Bn(o);if("boolean"===i.type)return Boolean(o);if("color"===i.type){const t=ft(String(o));if(t)return Yn(t);e(st(new Error("Expression execution error")))}if("integer"===i.type)return o>2147483647||o<-2147483648?void e(st(new Error("Expression result is out of 32-bit int range"))):Number(o);if(!r&&("array"===i.type||"dict"===i.type))try{return JSON.stringify(o)}catch(t){return e(st(new Error(`Failed to stringify ${i.type}`))),`<${i.type}>`}return o}catch(t){return void e(st(new Error("Expression execution error")))}}}function $o(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=function(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Ve,JsonStringContents:function(){var t,e,r;for(t=me,e=[],r=De();r!==n;)e.push(r),r=De();return ye=t,St(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="'",O=".",S="e",P="E",I="true",M="false",T=/^[^}]/,N=/^[^'}]/,z=/^[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),rt=ke(">=",!1),nt=ke(">",!1),it=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),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),Ot=function(t){return t},St=function(t){return Vn(t)},Pt=function(t){return t},It=function(){return""},Mt=function(){return xe()},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(t){return t},Rt=function(t){return On(t)},Bt=function(){throw new Error("Error tokenizing '"+t+"'.")},Ut=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Lt=function(t,e){return{type:"TryExpression",test:t,alternate:e}},Wt=function(t,e){return Fn(t,e)},Ht=function(t,e){return Fn(t,e)},qt=function(t,e){return An(t,e)},Jt=function(t,e){return An(t,e)},Gt=function(t,e){return An(t,e)},Zt=function(t,e){return An(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 Vn(t)},ne=function(t){return t},ie=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 On(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:Dn(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 je(e){var r,n=be[e];if(n)return n;for(r=e-1;!be[r];)r--;for(n={line:(n=be[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return be[e]=n,n}function Ae(t,e,r){var n=je(t),o=je(e),a={source:i,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:o.line,column:o.column}};return r&&i&&"function"==typeof i.offset&&(a.start=i.offset(a.start),a.end=i.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=Oe())!==n?(He(),ye=t,t=Ot(e)):(me=t,t=n),t}function De(){var e,r,i,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n?(i=He(),(o=Oe())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(W)),a!==n?(ye=e,e=Pt(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=It()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(i=u,me++):(i=n,0===$e&&Fe(q)),i===n&&(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L))),$e--,i===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=Mt()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n){if(i=[],T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(G)),o!==n)for(;o!==n;)i.push(o),T.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(G));else i=n;i!==n?(125===t.charCodeAt(me)?(o=l,me++):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=Tt()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n&&(ye=e,r=Nt()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=zt(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=Rt(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=Bt()),e=r))))}return e}function Oe(){var e,r,i,o,a,s;return e=me,(r=Se())!==n?(He(),63===t.charCodeAt(me)?(i=d,me++):(i=n,0===$e&&Fe(Z)),i!==n?(He(),(o=Oe())!==n?(He(),58===t.charCodeAt(me)?(a=p,me++):(a=n,0===$e&&Fe(Y)),a!==n?(He(),(s=Oe())!==n?(ye=e,e=Ut(r,o,s)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Se()),e}function Se(){var e,r,i,o;return e=me,(r=Pe())!==n?(He(),t.substr(me,2)===v?(i=v,me+=2):(i=n,0===$e&&Fe(X)),i!==n?(He(),(o=Oe())!==n?(ye=e,e=Lt(r,o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=Pe()),e}function Pe(){var e,r,i,o,a,s,l,c;if(e=me,(r=Ie())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===g?(s=g,me+=2):(s=n,0===$e&&Fe(Q)),s!==n?(l=He(),(c=Ie())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Wt(r,i)}else me=e,e=n;return e}function Ie(){var e,r,i,o,a,s,l,c;if(e=me,(r=Me())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Me())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===f?(s=f,me+=2):(s=n,0===$e&&Fe(K)),s!==n?(l=He(),(c=Me())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Ht(r,i)}else me=e,e=n;return e}function Me(){var e,r,i,o,a,s,l,c;if(e=me,(r=Te())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Te())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===h?(s=h,me+=2):(s=n,0===$e&&Fe(tt)),s===n&&(t.substr(me,2)===m?(s=m,me+=2):(s=n,0===$e&&Fe(et))),s!==n?(l=He(),(c=Te())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=qt(r,i)}else me=e,e=n;return e}function Te(){var e,r,i,o,a,s,l,c;if(e=me,(r=Ne())!==n){for(i=[],o=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(it)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(ot))))),s!==n?(l=He(),(c=Ne())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),t.substr(me,2)===y?(s=y,me+=2):(s=n,0===$e&&Fe(rt)),s===n&&(62===t.charCodeAt(me)?(s=b,me++):(s=n,0===$e&&Fe(nt)),s===n&&(t.substr(me,2)===_?(s=_,me+=2):(s=n,0===$e&&Fe(it)),s===n&&(60===t.charCodeAt(me)?(s=w,me++):(s=n,0===$e&&Fe(ot))))),s!==n?(l=He(),(c=Ne())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Jt(r,i)}else me=e,e=n;return e}function Ne(){var e,r,i,o,a,s,l,c;if(e=me,(r=ze())!==n){for(i=[],o=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),43===t.charCodeAt(me)?(s=$,me++):(s=n,0===$e&&Fe(at)),s===n&&(45===t.charCodeAt(me)?(s=x,me++):(s=n,0===$e&&Fe(st))),s!==n?(l=He(),(c=ze())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Gt(r,i)}else me=e,e=n;return e}function ze(){var e,r,i,o,a,s,l,c;if(e=me,(r=Re())!==n){for(i=[],o=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,a=He(),47===t.charCodeAt(me)?(s=k,me++):(s=n,0===$e&&Fe(lt)),s===n&&(42===t.charCodeAt(me)?(s=E,me++):(s=n,0===$e&&Fe(ct)),s===n&&(37===t.charCodeAt(me)?(s=C,me++):(s=n,0===$e&&Fe(ut)))),s!==n?(l=He(),(c=Re())!==n?o=a=[a,s,l,c]:(me=o,o=n)):(me=o,o=n);ye=e,e=Zt(r,i)}else me=e,e=n;return e}function Re(){var e,r,i;return(e=Le())===n&&(e=Ue())===n&&(e=me,33===t.charCodeAt(me)?(r=j,me++):(r=n,0===$e&&Fe(dt)),r===n&&(43===t.charCodeAt(me)?(r=$,me++):(r=n,0===$e&&Fe(at)),r===n&&(45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)))),r!==n?(He(),(i=Re())!==n?(ye=e,e=Yt(r,i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=me,(r=We())!==n?(He(),40===t.charCodeAt(me)?(i=A,me++):(i=n,0===$e&&Fe(pt)),i!==n?(He(),o=function(){var e,r,i,o,a,s;if(e=me,(r=Oe())!==n){for(i=[],o=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Oe())!==n?o=s:(me=o,o=n)):(me=o,o=n);o!==n;)i.push(o),o=me,He(),44===t.charCodeAt(me)?(a=V,me++):(a=n,0===$e&&Fe(gt)),a!==n?(He(),(s=Oe())!==n?o=s:(me=o,o=n)):(me=o,o=n);ye=e,e=Kt(r,i)}else me=e,e=n;return e===n&&(e=He()),e}(),o!==n?(He(),41===t.charCodeAt(me)?(a=F,me++):(a=n,0===$e&&Fe(vt)),a!==n?(ye=e,e=Xt(r,o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,(r=We())!==n&&(ye=e,r=Qt(r)),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return $e++,e=me,39===t.charCodeAt(me)?(r=D,me++):(r=n,0===$e&&Fe(ht)),r!==n?(i=function(){var t,e,r;for(t=me,e=[],r=Be();r!==n;)e.push(r),r=Be();return ye=t,re(e)}(),39===t.charCodeAt(me)?(o=D,me++):(o=n,0===$e&&Fe(ht)),o!==n?(ye=e,e=ee(i)):(me=e,e=n)):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(ft)),e}(),e===n&&(e=Le())===n&&(e=Ue())===n&&(e=function(){var e,r;return $e++,e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r!==n&&(ye=e,r=ge()),(e=r)===n&&(e=me,t.substr(me,5)===M?(r=M,me+=5):(r=n,0===$e&&Fe(Ct)),r!==n&&(ye=e,r=fe()),e=r),$e--,e===n&&(r=n,0===$e&&Fe(kt)),e}(),e===n&&(e=me,40===t.charCodeAt(me)?(r=A,me++):(r=n,0===$e&&Fe(pt)),r!==n?(He(),(i=Oe())!==n?(He(),41===t.charCodeAt(me)?(o=F,me++):(o=n,0===$e&&Fe(vt)),o!==n?(ye=e,e=te(i)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n))),e}())),e}())),e}function Be(){var e,r,i,o,a;if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n?(i=He(),(o=Oe())!==n?(He(),125===t.charCodeAt(me)?(a=l,me++):(a=n,0===$e&&Fe(W)),a!==n?(ye=e,e=ne(o)):(me=e,e=n)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,t.substr(me,3)===c?(r=c,me+=3):(r=n,0===$e&&Fe(H)),r!==n&&(ye=e,r=ie()),(e=r)===n&&(e=me,r=me,$e++,92===t.charCodeAt(me)?(i=u,me++):(i=n,0===$e&&Fe(q)),i===n&&(39===t.charCodeAt(me)?(i=D,me++):(i=n,0===$e&&Fe(ht)),i===n&&(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)))),$e--,i===n?r=void 0:(me=r,r=n),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=oe()):(me=e,e=n)):(me=e,e=n),e===n))){if(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n){if(i=[],N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(mt)),o!==n)for(;o!==n;)i.push(o),N.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(mt));else i=n;i!==n?(125===t.charCodeAt(me)?(o=l,me++):(o=n,0===$e&&Fe(W)),o!==n?(ye=e,e=ae()):(me=e,e=n)):(me=e,e=n)}else me=e,e=n;e===n&&(e=me,t.substr(me,2)===s?(r=s,me+=2):(r=n,0===$e&&Fe(L)),r!==n&&(ye=e,r=se()),(e=r)===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.substr(me,2)===s?(i=s,me+=2):(i=n,0===$e&&Fe(L)),i!==n?(ye=e,e=le(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n?(t.length>me?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(J)),i!==n?(ye=e,e=ce(i)):(me=e,e=n)):(me=e,e=n),e===n&&(e=me,92===t.charCodeAt(me)?(r=u,me++):(r=n,0===$e&&Fe(q)),r!==n&&(ye=e,r=ue()),e=r))))}return e}function Ue(){var e,r,i,o;if($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt)),o!==n)for(;o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));else i=n;return i!==n?(ye=e,e=de()):(me=e,e=n),$e--,e===n&&(r=n,0===$e&&Fe(yt)),e}function Le(){var e,r,i,o,a,s,l,c,u,d;for($e++,e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));if(46===t.charCodeAt(me)?(o=O,me++):(o=n,0===$e&&Fe(wt)),o!==n){if(a=[],z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt)),s!==n)for(;s!==n;)a.push(s),z.test(t.charAt(me))?(s=t.charAt(me),me++):(s=n,0===$e&&Fe(bt));else a=n;if(a!==n){if(s=me,101===t.charCodeAt(me)?(l=S,me++):(l=n,0===$e&&Fe($t)),l===n&&(69===t.charCodeAt(me)?(l=P,me++):(l=n,0===$e&&Fe(xt))),l!==n){if(43===t.charCodeAt(me)?(c=$,me++):(c=n,0===$e&&Fe(at)),c===n&&(45===t.charCodeAt(me)?(c=x,me++):(c=n,0===$e&&Fe(st))),c===n&&(c=null),u=[],z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt)),d!==n)for(;d!==n;)u.push(d),z.test(t.charAt(me))?(d=t.charAt(me),me++):(d=n,0===$e&&Fe(bt));else u=n;u!==n?s=l=[l,c,u]:(me=s,s=n)}else me=s,s=n;s===n&&(s=null),ye=e,e=pe()}else me=e,e=n}else me=e,e=n;if(e===n){if(e=me,45===t.charCodeAt(me)?(r=x,me++):(r=n,0===$e&&Fe(st)),r===n&&(r=null),i=[],z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt)),o!==n)for(;o!==n;)i.push(o),z.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(bt));else i=n;if(i!==n)if(101===t.charCodeAt(me)?(o=S,me++):(o=n,0===$e&&Fe($t)),o===n&&(69===t.charCodeAt(me)?(o=P,me++):(o=n,0===$e&&Fe(xt))),o!==n){if(43===t.charCodeAt(me)?(a=$,me++):(a=n,0===$e&&Fe(at)),a===n&&(45===t.charCodeAt(me)?(a=x,me++):(a=n,0===$e&&Fe(st))),a===n&&(a=null),s=[],z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt)),l!==n)for(;l!==n;)s.push(l),z.test(t.charAt(me))?(l=t.charAt(me),me++):(l=n,0===$e&&Fe(bt));else s=n;s!==n?(ye=e,e=ve()):(me=e,e=n)}else me=e,e=n;else me=e,e=n}return $e--,e===n&&(r=n,0===$e&&Fe(_t)),e}function We(){var e,r,i,o,a;if($e++,e=me,r=me,$e++,i=function(){var e,r,i,o;return e=me,t.substr(me,4)===I?(r=I,me+=4):(r=n,0===$e&&Fe(Et)),r===n&&(t.substr(me,5)===M?(r=M,me+=5):(r=n,0===$e&&Fe(Ct))),r!==n?(i=me,$e++,R.test(t.charAt(me))?(o=t.charAt(me),me++):(o=n,0===$e&&Fe(jt)),$e--,o===n?i=void 0:(me=i,i=n),i!==n?e=r=[r,i]:(me=e,e=n)):(me=e,e=n),e}(),$e--,i===n?r=void 0:(me=r,r=n),r!==n)if(B.test(t.charAt(me))?(i=t.charAt(me),me++):(i=n,0===$e&&Fe(Ft)),i!==n){for(o=[],R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));a!==n;)o.push(a),R.test(t.charAt(me))?(a=t.charAt(me),me++):(a=n,0===$e&&Fe(jt));ye=e,e=he()}else me=e,e=n;else me=e,e=n;return $e--,e===n&&(r=n,0===$e&&Fe(At)),e}function He(){var e,r;for($e++,e=[],U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));r!==n;)e.push(r),U.test(t.charAt(me))?(r=t.charAt(me),me++):(r=n,0===$e&&Fe(Dt));return $e--,r=n,0===$e&&Fe(Vt),e}if((r=a())!==n&&me===t.length)return r;throw r!==n&&me<t.length&&Fe({type:"end"}),function(t,e,r){return new Sn(Sn.buildMessage(t,e),t,e,r)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Ae(_e,_e+1):Ae(_e,_e))}(t,{startRule:"JsonStringContents"}),n=Jn(r);return e.vars.push(...n),new wo(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=>$o(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=$o(t[i],e,r);return n}}var n;return t}function xo(t,e,r,n=!1){if(t){if(t instanceof wo)return t.apply(e,r,n);if(Array.isArray(t))return t.map((t=>xo(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=xo(t[i],e,r);return n}}return t}function ko(t,e){const r={vars:[],hasExpression:!1},n=$o(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:(t,r)=>xo(n,t,e,r)}}const Eo={pagers:function(){return Q(new Map)}},Co=new Map,jo=new Map;function Ao(t){const e=Co.get(t)||Q("");return Co.has(t)||Co.set(t,e),e}function Fo(t){const e=jo.get(t)||new Map;return jo.has(t)||jo.set(t,e),e}class Vo{setVariable(t){const e=t.getName(),r=Fo(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Ao(this).set(e)}getVariable(t){return Fo(this).get(t)}list(){return Fo(this).values()}}function Do(){return new Vo}function Oo(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 n=r.call(t,"string");if("object"!=typeof n)return n;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 So=new Set(["start","stop","pause","resume","cancel","reset"]);class Po{constructor(t){Oo(this,"timers",new Map),Oo(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)&&So.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 n=this.timers.get(t);this[r](n)}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 n=t.tickStarted=performance.now(),i=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-i)%r,e()}),i)};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,{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 Io(t,e,r,n){const{variable_name:i}=r;if(!i)return void e(st(new Error(`Incorrect ${r.type} action`),{additional:{name:i}}));const o=t.get(i);if(!o)return void e(st(new Error("Cannot find variable"),{additional:{name:i}}));const a=o.getType();"array"===a?n(o):e(st(new Error("Trying to insert value into the non-array"),{additional:{name:i,type:a}}))}let Mo=Q(!0),To=0;function No(){Mo.set(!1)}function zo(){Mo.set(!0)}function Ro(t,e){return t&&e?new Map([...t,...e]):t||e||void 0}const Bo=L(((t,e,r,n)=>{let i,o,a,s,c,u;var d,p,f,h;let{id:m}=e,{json:y={}}=e,{platform:b="auto"}=e,{theme:_="system"}=e,{globalVariablesController:w=new Vo}=e,{mix:x=""}=e,{customization:k={}}=e,{builtinProtocols:E=["http","https","tel","mailto","intent"]}=e,{extensions:C=new Map}=e,{onError:j}=e,{onStat:A}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:D=(t=>"")}=e,{fetchInit:O={}}=e,{tooltipRoot:S}=e,{customComponents:P}=e,{direction:M="ltr"}=e,T=Q("desktop"===b);if(s=l(T,(t=>a=t)),"auto"===b&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");T.set(!t.matches),t.addListener((()=>{T.set(!t.matches)}))}let N="light",z=null;const B=Q("rtl"===M?"rtl":"ltr");function U(t){_=t}function L(){return new Map}function H(){return new Map}function q(t){y=t}u=l(B,(t=>c=t));const J=new Set(E);let G=!1,Z=!1;m||(Z=!0,dt(st(new Error('"id" prop is required'))));const Y={stateChange:!1},X=Ao(w),tt=Fo(w),et=new Map,rt=new Map,it=new Map;let ot=null,lt=0,ct=[];function ut(t,e,r=!1){const n=ko(t,dt);if(!n.hasExpression)return t;const i=Ro(rt,e);return n.applyVars(i,r)}function dt(t){j?j({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function pt(t,e){A&&A({type:t,action:e})}function vt(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type&&t.type in i;){if(({json:t,templateContext:e}=En(t,e,i,dt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}}let gt=0;function ft(t){return`${m}-${gt++}`}let ht={},yt={};function bt(t){_t(ut(t))}function _t(t,e){const r=t.url?String(t.url):"",n=t.typed;if(!Lt(t))return;const o=(null==e?void 0:e.logError)||dt;if(r)try{const n=r.replace(/div-action:\/\//,""),a=/([^?]+)\?(.+)/.exec(n);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=Ot,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 n=r[t],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(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 r=Vt(t);r&&r.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 r=Vt(t);r&&r.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 r=Vt(t);r&&r.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=rt.get(a);if(t){const e=t.getType();"dict"===e||"array"===e?o(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:a}})):t.set(l)}else o(st(new Error("Cannot find variable"),{additional:{name:a}}))}else o(st(new Error("Incorrect set_variable_action"),{additional:{url:n}}));break;case"timer":const c=s.get("action"),u=s.get("id");ot?ot.execTimerAction(u,c):o(st(new Error("Incorrect timer action"),{additional:{id:u,action:c}}));break;case"video":!function(t,e,r){const n=(null==r?void 0:r.logError)||dt;if(t){const r=Vt(t);r?"start"===e?r.start():"pause"===e?r.pause():n(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):n(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else n(st(new Error("Missing id in video action"),{additional:{action:e}}))}(s.get("id"),s.get("action"),e);break;case"download":!function(t,e,r){const n=(null==r?void 0:r.logError)||dt;if(t){let r;r="function"==typeof O?O(t):O,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var o,a,s;if(r){if(r.templates)for(const t in r.templates)i.hasOwnProperty(t)||(i[t]=r.templates[t]);if(Array.isArray(null===(o=r.patch)||void 0===o?void 0:o.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>{const e=Ct.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 n(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:i.id}})),void wt(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_fail_actions)}r.patch.changes.forEach((t=>{const e=Ct.get(t.id);e&&e.replaceWith(t.id,t.items)})),wt(null===(s=e.download_callbacks)||void 0===s?void 0:s.on_success_actions)}}else n(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;n(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),wt(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else n(st(new Error("Missing url in download action"),{additional:{url:t}}))}(s.get("url"),t,e);break;case"show_tooltip":!function(t,e,r){var n;const i=(null==r?void 0:r.logError)||dt;if(!t)return void i(st(new Error("Missing id in show_tooltip action")));const o=At.get(t);if(!o)return void i(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&ct.some((e=>e.desc.id===t)))return;const a={internalId:++lt,ownerNode:o.onwerNode,desc:o.tooltip,timeoutId:0};ct=[...ct,a];const s=null!==(n=o.tooltip.duration)&&void 0!==n?n:5e3;s&&(a.timeoutId=window.setTimeout((()=>{a.timeoutId=0,ct=ct.filter((t=>t.internalId!==a.internalId))}),s))}(s.get("id"),s.get("multiple"),e);break;case"hide_tooltip":!function(t,e){const r=(null==e?void 0:e.logError)||dt;t?ct=ct.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):r(st(new Error("Missing id in hide_tooltip action")))}(s.get("id"),e);break;default:o(st(new Error("Unknown type of action"),{additional:{url:r}}))}}catch(t){o(st(t,{additional:{url:r}}))}else if(n)switch(n.type){case"set_variable":{const{variable_name:t,value:e}=n;if(t&&e){const r=rt.get(t);r?r.getType()===e.type?r.setValue(e.value):o(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):o(st(new Error("Cannot find variable"),{additional:{name:t}}))}else o(st(new Error("Incorrect set_variable action"),{additional:{name:t}}));break}case"array_insert_value":!function(t,e,r){const{variable_name:n,index:i,value:o}=r;!o||"number"!=typeof i&&void 0!==i?e(st(new Error("Incorrect array_insert_value action"),{additional:{name:n}})):Io(t,e,r,(t=>{const a=t.getValue();if("number"==typeof i&&(i<0||i>a.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:i,length:a.length}}));else{const e=a.slice();"number"==typeof i?e.splice(i,0,o.value):e.push(o.value),t.setValue(e)}}))}(rt,o,n);break;case"array_remove_value":!function(t,e,r){const{variable_name:n,index:i}=r;"number"==typeof i?Io(t,e,r,(t=>{const o=t.getValue();if("number"==typeof i&&(i<0||i>=o.length))e(st(new Error(`Index out of bound for mutation ${r.type}`),{additional:{name:n,index:i,length:o.length}}));else{const e=o.slice();e.splice(i,1),t.setValue(e)}})):e(st(new Error("Incorrect array_remove_value action"),{additional:{name:n}}))}(rt,o,n);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}}))}(o,n);break;case"focus_element":{const t=n.element_id&&jt.get(n.element_id);t?t.focus():o(st(new Error("Incorrect focus_element action"),{additional:{elementId:n.element_id}}));break}default:o(st(new Error("Unknown type of action"),{additional:{type:n.type}}))}}async function wt(t,e={}){if(!t||!Array.isArray(t))return;const r=t.filter(Lt);for(let t=0;t<r.length;++t){let n=r[t];const i=n.url,o=n.typed;if(i){const t=xt(i);if(t)if(kt(t,J)){if(e.processUrls)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(_t(n,e.componentContext),await $()):n.log_id&&($t(n),await $())}else o&&_t(n,e.componentContext)}r.forEach((t=>{t.log_id&&pt("click",t)}))}function $t(t){null==F||F(t)}const Et=new Map,Ct=new Map,jt=new Map,At=new Map;function Vt(t){if(Et.has(t))return Et.get(t);dt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const Dt=new Map;g(at,{logStat:pt,hasTemplate:function(t){return t in i},processTemplate:vt,genId:ft,genClass:function(t){return`divkit-${ft()}`},execAction:_t,execCustomAction:$t,isRunning:function(t){return Y[t]},setRunning:function(t,e){Y[t]=e},registerInstance:function(t,e){Et.has(t)?dt(st(new Error("Duplicate instance id"),{additional:{id:t}})):Et.set(t,e)},unregisterInstance:function(t){Et.delete(t)},registerParentOf:function(t,e){Ct.set(t,e)},unregisterParentOf:function(t){Ct.delete(t)},registerTooltip:function(t,e){const r=e.id;r&&(At.has(r)&&dt(st(new Error("Duplicate tooltip id"),{additional:{id:r}})),At.set(r,{onwerNode:t,tooltip:e}))},unregisterTooltip:function(t){const e=t.id;e&&(At.delete(e),ct.some((t=>t.desc.id===e))&&(ct=ct.filter((t=>t.desc.id!==e))))},onTooltipClose:function(t){ct=ct.filter((e=>e.internalId!==t))},tooltipRoot:S,registerFocusable:function(t,e){jt.set(t,e)},unregisterFocusable:function(t){jt.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(yt[r]=yt[r]||0,++yt[r],ht[r])return ht[r];const n=`${ft()}-svg-filter`;return ht=Object.assign(Object.assign({},ht),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;yt[r]&&0==--yt[r]&&(ht=Object.keys(ht).reduce(((t,e)=>(yt[e]&&(t[e]=ht[e]),t)),{}))},preparePrototypeVariables:function(t,e){const r=new Map,n=function(t,e,r){if(!(e in Gr))throw new Error("Unsupported variable type");return new Gr[e](t,r)}(t,"dict",e);return r.set(t,n),r},getStore:function(t){return Dt.has(t)||function(t){Dt.has(t)||Dt.set(t,Eo[t]())}(t),Dt.get(t)},getCustomization:function(t){return null==k?void 0:k[t]},getBuiltinProtocols:function(){return J},getExtension:function(t,e){const r=C.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:rt,logError:dt}},typefaceProvider:D,isDesktop:T,isPointerFocus:Mo,customComponents:P,direction:B,componentDevtool:void 0}),g(qt,{hasAction:()=>!1});const Ot={setState(t){throw new Error("Not implemented")},getChild(t){if(St&&St.has(t))return St.get(t);dt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let St=null;function Pt(t){if(t.type in Lr){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&dt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Wr(t.name,t.type,t.value);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}}g(Ft,{registerInstance(t,e){St||(St=new Map),St.has(t)?dt(st(new Error("Duplicate state with id"),{additional:{id:t}})):St.set(t,e)},unregisterInstance(t){null==St||St.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const It=null===(d=null==y?void 0:y.card)||void 0===d?void 0:d.variables;Array.isArray(It)&&It.forEach((t=>{if(t&&t.name){if(et.has(t.name))return void dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Pt(t)}}));const Mt=y.palette;Mt&&Mt[N].forEach((t=>{if(et.has(t.name))dt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Wr(t.name,"color",t.color);et.set(t.name,e),rt.set(t.name,e)}catch(e){dt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of tt)rt.has(t)||rt.set(t,e);X.subscribe((t=>{if(t&&!rt.has(t)){const e=tt.get(t);rt.set(t,e);const r=it.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Tt=null===(f=null==y?void 0:y.card)||void 0===f?void 0:f.timers;if(Tt&&"undefined"!=typeof document){const t=ot=new Po({logError:dt,applyVars:ut,hasVariableWithType:function(t,e){const r=rt.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=rt.get(t);r?r.setValue(e):dt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:wt});Tt.forEach((e=>t.createTimer(e)))}const Nt=function t(e){const r={json:{},path:[],templateContext:{},logError(t){t.additional=t.additional||{},t.additional.path=r.path.join("/"),dt(t)},execAnyActions:(t,e={})=>wt(t,{componentContext:r,processUrls:e.processUrls}),getDerivedFromVars:(t,e,n=!1)=>function(t,e,r=!1){if(!t)return jn(t);const n=Ro(rt,e),i=ko(t,dt);return i.vars.length?K(i.vars.map((t=>n.get(t)||function(t){const e=it.get(t)||Q(void 0);return it.has(t)||it.set(t,e),e}(t))).filter(mt),(()=>i.applyVars(n,r))):i.hasExpression?jn(i.applyVars(n)):jn(t)}(t,Ro(r.variables,e),n),getJsonWithVars:(t,e,n=!1)=>ut(t,Ro(r.variables,e),n),produceChildContext(e,n={}){const i=t(r);let o=e,a=r.templateContext;const{templateContext:s,json:l}=vt(o,a);return i.json=l,i.templateContext=s,i.origJson=e,void 0!==n.path&&i.path.push(String(n.path)),e.type&&!n.isRootState&&i.path.push(e.type),i.variables=Ro(r.variables,n.variables),n.tooltips&&(i.tooltips=n.tooltips),n.fake&&(i.fakeElement=!0),n.isRootState&&(i.isRootState=!0),i},getVariable(t,e){const n=(r.variables||rt).get(t);if(n){const i=n.getType();if(i!==e)return void r.logError(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return n}};return e?(r.path=e.path.slice(),e.fakeElement&&(r.fakeElement=!0)):(r.json={type:"root"},r.isRootState=!0),r}();let zt;v((()=>{To--,To||(window.removeEventListener("keydown",No),window.removeEventListener("pointerdown",zo)),ot&&ot.destroy(),ct.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&r.id&&void 0!==m&&r.id(m),void 0===e.json&&r.json&&void 0!==y&&r.json(y),void 0===e.platform&&r.platform&&void 0!==b&&r.platform(b),void 0===e.theme&&r.theme&&void 0!==_&&r.theme(_),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==w&&r.globalVariablesController(w),void 0===e.mix&&r.mix&&void 0!==x&&r.mix(x),void 0===e.customization&&r.customization&&void 0!==k&&r.customization(k),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==E&&r.builtinProtocols(E),void 0===e.extensions&&r.extensions&&void 0!==C&&r.extensions(C),void 0===e.onError&&r.onError&&void 0!==j&&r.onError(j),void 0===e.onStat&&r.onStat&&void 0!==A&&r.onStat(A),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==F&&r.onCustomAction(F),void 0===e.onComponent&&r.onComponent&&void 0!==V&&r.onComponent(V),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==D&&r.typefaceProvider(D),void 0===e.fetchInit&&r.fetchInit&&void 0!==O&&r.fetchInit(O),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==S&&r.tooltipRoot(S),void 0===e.customComponents&&r.customComponents&&void 0!==P&&r.customComponents(P),void 0===e.direction&&r.direction&&void 0!==M&&r.direction(M),void 0===e.setTheme&&r.setTheme&&void 0!==U&&r.setTheme(U),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==L&&r.getDebugVariables(L),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==H&&r.getDebugAllVariables(H),void 0===e.setData&&r.setData&&void 0!==q&&r.setData(q),void 0===e.execAction&&r.execAction&&void 0!==bt&&r.execAction(bt),"light"===_||"dark"===_?N=_:"system"===_?"undefined"!=typeof matchMedia?(z||(z=matchMedia("(prefers-color-scheme: dark)"),z.addListener((function(){"system"===_&&z&&(N=z.matches?"dark":"light")}))),N=z.matches?"dark":"light"):N="light":dt(st(new Error("Unsupported theme"))),N&&Mt&&Mt[N].forEach((t=>{const e=rt.get(t.name);e&&e.setValue(t.color)}));{G=!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 $n)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}(y);t&&(G=!0,dt(t))}if(i=y.templates||{},(null===(p=null==y?void 0:y.card)||void 0===p?void 0:p.variables)&&Array.isArray(y.card.variables)&&y.card.variables!==It&&y.card.variables.forEach((t=>{t&&t.name&&!et.has(t.name)&&Pt(t)})),o=null===(h=null==y?void 0:y.card)||void 0===h?void 0:h.states,o&&!G&&!Z){const t={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})))};zt=Nt.produceChildContext(t,{tooltips:ct,isRootState:!0})}return s(),u(),G||Z||!zt?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${nt}`:"",!0)+I(x?` ${x}`:"",!0)}"${W("dir",c,0)}>${R(kn,"RootSvgFilters").$$render(t,{svgFiltersMap:ht},{},{})} ${R(xn,"Unknown").$$render(t,{componentContext:zt},{},{})}</div>`})),Uo=Bo;function Lo(t){return Uo.render(t).html}var Wo=e.M,Ho=e.Os,qo=e.sY;export{Wo as createGlobalVariablesController,Ho as createVariable,qo as render};
|
|
2
2
|
//# sourceMappingURL=server.mjs.map
|