@divkitframework/divkit 28.13.0 → 29.0.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 +21 -3
- 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/client-devtool.d.ts +1 -0
- package/typings/common.d.ts +6 -4
- package/typings/variables.d.ts +33 -17
package/dist/server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>eo,createVariable:()=>Er,render:()=>go}),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 g(t){p().$$.on_destroy.push(t)}function v(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 T(t){return"string"==typeof t||t&&"object"==typeof t?I(t,!0):t}function M(t){const e={};for(const r in t)e[r]=T(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 i="";for(let r=0;r<t.length;r+=1)i+=e(t[r],r);return i}const z={$$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 J,R;function U(t){function e(e,r,i,n,o){const a=u;d({$$:{on_destroy:J,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}={})=>{J=[];const n={title:"",head:"",css:new Set},o=e(n,t,{},r,i);return s(J),{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}: ${T(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&&(R=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 g=()=>{if(d)return;p();const n=e(i?u[0]:u,t,r);a?t(n):p="function"==typeof n?n:o},v=n.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&g()}),(()=>{d|=1<<e}))));return c=!0,g(),function(){s(v),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 gt(t,e){for(;t.length<e;)t="0"+t;return t}function vt(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=>gt(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:vt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=vt(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=>vt(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=>vt(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){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 Ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(r),!0).forEach((function(e){At(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function At(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 Ft(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function Vt(t,e){e&&t.push(e)}function Dt(t,e,r){const i=[];Vt(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&Vt(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const jt=Symbol("state");function Pt(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 St(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function Ot(t){return St(t)&&t>=0}function It(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]&&!Ot(r[t]))return e;return Pt(t)}function Tt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const Mt=Object.prototype.hasOwnProperty;function Nt(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(!Mt.call(e,n)||!Nt(t[n],e[n]))return!1}return!0}function zt(t,e){return Nt(t,e)?e:t}function Bt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Jt(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 Ut(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]]&&!Ot(t[r[i]]))return e;return t}function Lt(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 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 _;v(Ht,{hasAction:()=>Boolean(b.hasAction()||(null==o?void 0:o.length))});let w,$="",x=!1;if(g((()=>{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:T($)},{target:T(w)},{style:T(c)},{class:I(l,!0)+" "+I(h?tt:et,!0)+" "+I(null!=s&&s.length?ot:"",!0)},M(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:T(c)},{role:T(x?"button":null)},{tabindex:T(x?0:null)},M(u)],{})}${L("this",_,0)}>${i.default?i.default({}):""}</span>`})),Gt=qt,Zt="divkit-b921d";function Yt(t){return St(t)&&t>0}function Xt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Yt(t.radius))return`blur(${pt(t.radius/2)})`}else e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Qt=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=Xt(t.filters,s.logError)))}return r})),`<span${L("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${H({"border-radius":a})}>${N(n,(t=>t.image_url?`<img${L("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${L("class",Zt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Zt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Qt,te=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,x,k,E,C,A,F,V,D,j,P,S,O,I,T,M,N,z,J,R,U,W,H,q,G,Z,Y,X,Q,K,tt,et,rt=o,it=o,nt=o,ot=o,lt=o,gt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,Et=o,At=o,Vt=o,St=o,Mt=o,Nt=o,Wt=o,{json:Ht={}}=e,{origJson:qt}=e,{templateContext:Zt}=e,{cls:Yt=""}=e,{style:Xt}=e,{layoutParams:Qt={}}=e,{customDescription:te=!1}=e,{customPaddings:ee=!1}=e,{customActions:re=""}=e,{additionalPaddings:ie=null}=e,{heightByAspect:ne=!1}=e,{parentOf:oe}=e,{replaceItems:ae}=e,{hasInnerFocusable:se=!1}=e;const le={left:"start",center:"center",right:"end"},ce={top:"start",center:"center",bottom:"end",baseline:"baseline"},ue=f(at),de=f(jt);let pe,ge,ve=null,fe=[];function he(t,e){if(!Array.isArray(oe)||!ae)return;const r=oe.findIndex((e=>(null==e?void 0:e.id)===t)),i=oe.slice();i.splice(r,1,...e||[]),oe=i,ae(i)}let me,ye,be,_e,we,$e,xe,ke,Ee,Ce,Ae={},Fe={},Ve=!1,De=1,je="transparent",Pe=0,Se={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Oe="",Ie=null,Te="",Me={},Ne=0,ze=0,Be=0,Je=!1,Re=!1,Ue={},Le=0,We=0,He=0,qe=!1,Ge=!1,Ze=1;const Ye=Qt.fakeElement?[]:Ht.transition_triggers||["state_change","visibility_change"],Xe=-1!==Ye.indexOf("state_change")&&Ht.id,Qe=-1!==Ye.indexOf("visibility_change")&&Ht.id;let Ke,tr,er,rr,ir,nr,or,ar,sr,lr,cr=[],ur=[],dr=[],pr=[],gr=[],vr=[],fr="",hr=!1,mr="visible",yr=0,br=0;function _r(){Ht.focus&&(I||(lr=!0),ue.execAnyActions(pr))}function wr(){Ht.focus&&(lr=!1,ue.execAnyActions(gr))}g((()=>{var t;fe.forEach((t=>{ue.unregisterParentOf(t)})),fe=[],null===(t=Ht.tooltips)||void 0===t||t.forEach((t=>{ue.unregisterTooltip(t)}))})),void 0===e.json&&r.json&&void 0!==Ht&&r.json(Ht),void 0===e.origJson&&r.origJson&&void 0!==qt&&r.origJson(qt),void 0===e.templateContext&&r.templateContext&&void 0!==Zt&&r.templateContext(Zt),void 0===e.cls&&r.cls&&void 0!==Yt&&r.cls(Yt),void 0===e.style&&r.style&&void 0!==Xt&&r.style(Xt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Qt&&r.layoutParams(Qt),void 0===e.customDescription&&r.customDescription&&void 0!==te&&r.customDescription(te),void 0===e.customPaddings&&r.customPaddings&&void 0!==ee&&r.customPaddings(ee),void 0===e.customActions&&r.customActions&&void 0!==re&&r.customActions(re),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ie&&r.additionalPaddings(ie),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ne&&r.heightByAspect(ne),void 0===e.parentOf&&r.parentOf&&void 0!==oe&&r.parentOf(oe),void 0===e.replaceItems&&r.replaceItems&&void 0!==ae&&r.replaceItems(ae),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==se&&r.hasInnerFocusable(se),fe.forEach((t=>{ue.unregisterParentOf(t)})),fe=[],oe&&oe.forEach((t=>{t.id&&(fe.push(t.id),ue.registerParentOf(t.id,{replaceWith:he}))})),n=ue.getDerivedFromVars(Ht.focus),lt(),lt=l(n,(t=>z=t)),a=ue.getDerivedFromVars(Ht.border),Wt(),Wt=l(a,(t=>et=t));{const t=lr&&(null==z?void 0:z.border)?z.border:et;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)+" "+vt(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,De=Tt(t.stroke.width,De),je=vt(t.stroke.color,1,je),r.border=`${dt(De)} solid ${je}`),t.corners_radius?(Se=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,Se),r["border-radius"]=e["border-radius"]=Lt(Se)):t.corner_radius&&(Pe=Tt(t.corner_radius,Pe),Se={"top-left":Pe,"top-right":Pe,"bottom-right":Pe,"bottom-left":Pe},r["border-radius"]=e["border-radius"]=dt(Pe)),i&&De&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Se);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+De/2})),n=Lt(t)}}Ae=zt(e,Ae),Fe=zt(r,Fe),Ve=i,Oe=n}s=ue.getDerivedFromVars(Ht.paddings),Nt(),Nt=l(s,(t=>tt=t)),Ie=Ut(tt&&!ee?tt:void 0,Ie),c=Pt(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}(Ie,ie)),u=ue.getDerivedFromVars(Ht.margins),St(),St=l(u,(t=>Q=t)),Te=It(Q,Te),d=ue.getDerivedFromVars(Ht.width),At(),At=l(d,(t=>Y=t)),p=ue.getDerivedFromVars(Ht.alignment_horizontal),Mt(),Mt=l(p,(t=>K=t));{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)Ne=Tt(null==Y?void 0:Y.value,Ne),e=dt(Ne);else if("wrap_content"!==c&&(Qt.overlapParent||"match_parent"!==c&&c||!Qt.parentHorizontalWrapContent))t="parent","vertical"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,ue.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===Qt.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,Qt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&Qt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Qt.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)&&(i=dt(t.max_size.value))}"match_parent"!==c&&c||ue.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=K;n["halign-self"]="left"===t||"center"===t||"right"===t?le[t]:Qt.parentHAlign||"start"}t&&(n.width=t),me=e,ye=r,be=i,ze=o,Be=a,Me=zt(n,Me),Je=s,Re=l}v=ue.getDerivedFromVars(Ht.height),Et(),Et=l(v,(t=>Z=t)),h=ue.getDerivedFromVars(Ht.alignment_vertical),Vt(),Vt=l(h,(t=>X=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ne);else if("fixed"===c)Le=Tt(null==Z?void 0:Z.value,Le),e=dt(Le);else if("match_parent"!==c||!Qt.overlapParent&&Qt.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&Qt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Qt.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)&&(i=dt(t.max_size.value))}"match_parent"===c&&ue.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,ue.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===Qt.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,Qt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Qt.parentContainerOrientation?n["valign-self"]=ce[t]:n["valign-self"]=Qt.parentVAlign||"start"}t&&(n.height=t),_e=e,we=r,$e=i,We=o,He=a,Ue=zt(n,Ue),qe=s,Ge=l}var $r,xr,kr;if(m=!!Qt.overlapParent||void 0,y=Qt.overlapParent&&(!Y||"match_parent"===Y.type)&&"match_parent"===(null==Z?void 0:Z.type),b=Qt.gridArea?`${Qt.gridArea.y+1}/${Qt.gridArea.x+1}/span ${Qt.gridArea.rowSpan}/span ${Qt.gridArea.colSpan}`:void 0,_=ue.getDerivedFromVars(Ht.alpha),$t(),$t=l(_,(t=>G=t)),xr=Ze,Ze=!Ot($r=G)||void 0===$r||$r>1?xr:Number($r),xe=1===Ze?void 0:Ze,w=ue.getDerivedFromVars(Ht.accessibility),wt(),wt=l(w,(t=>q=t)),ge=void 0,q&&!te&&q.description&&(ge={},ge["aria-label"]=q.description),x=ue.getDerivedFromVars(Ht.background),_t(),_t=l(x,(t=>H=t)),ke=lr&&(null==z?void 0:z.background)?z.background:H,Ee={},Ce=!1,Array.isArray(ke)&&(Ce=ke.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Oe),!Ce)){const t=yt(ke);Ee["background-color"]=t.color,Ee["background-image"]=t.image,Ee["background-size"]=t.size,Ee["background-position"]=t.position,Ee["background-repeat"]="no-repeat"}Ke=void 0,Xe&&Ht.transition_in&&ue.isRunning("stateChange")&&(Ke=!0),er=void 0,Xe&&Ht.transition_change&&ue.isRunning("stateChange")&&de.hasTransitionChange(Ht.id)&&(er=!0),k=ue.getDerivedFromVars(Ht.action),ht(),ht=l(k,(t=>U=t)),E=ue.getDerivedFromVars(Ht.actions),bt(),bt=l(E,(t=>W=t)),C=ue.getDerivedFromVars(Ht.doubletap_actions),ft(),ft=l(C,(t=>R=t)),A=ue.getDerivedFromVars(Ht.longtap_actions),gt(),gt=l(A,(t=>J=t));{let t=W||U&&[U]||[],e=R||[],r=J||[],i=(null==z?void 0:z.on_focus)||[],n=(null==z?void 0:z.on_blur)||[];Qt.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],ue.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ue.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ue.logError(st(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],ue.logError(st(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],ue.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&re&&(t=[],e=[],r=[],ue.logError(st(new Error(`Cannot use action on component "${re}"`)))),cr=t,ur=e,dr=r,pr=i,gr=n}F=ue.getDerivedFromVars(Ht.action_animation),ot(),ot=l(F,(t=>N=t)),N&&(vr=Rt(N),fr=vr.map((function(t){const e=Jt(t.start_value,1),r=Jt(t.end_value,1),i=Tt(t.start_delay,0),n=Tt(t.duration,300),o=Bt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return rr=e,ir=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return nr=e,or=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return ue.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),V=ue.getDerivedFromVars(Ht.visibility),nt(),nt=l(V,(t=>M=t));{const t=mr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(M,mr);t!==e&&(!hr||"visible"!==mr&&"visible"!==e?mr=e:async function(t){mr=t;const e="visible"===t?"in":"out",r="in"===e?Ht.transition_in:Ht.transition_out;Qe&&r&&(await $(),"in"===e&&(tr=!0),de.runVisibilityTransition(Object.assign(Object.assign({},Ht),{visibility:"visible"}),Zt,r,pe,e).then((()=>{"in"===e&&(tr=!1)})).catch((t=>{throw"in"===e&&(tr=!1),t})))}(e)),hr||(hr=!0)}if(D=Object.assign(Object.assign(Object.assign({},Me),Ue),{"parent-overlap":m,"parent-overlap-absolute":y,"scroll-snap":Qt.scrollSnap,"hide-on-transition-in":Ke||tr||er,visibility:mr,"has-action-animation":Boolean(fr),"parent-flex":Qt.parentContainerOrientation||void 0,"parent-grid":Boolean(Qt.gridArea)||void 0,"has-custom-focus":Boolean(lr&&Ht.focus)}),j=ue.getDerivedFromVars(Ht.transform),it(),it=l(j,(t=>T=t)),T&&void 0!==T.rotation){const t=T.pivot_x||{type:"pivot-percentage",value:50};yr=Jt(t.value,yr);const e="pivot-fixed"===t.type?dt(yr):`${yr}%`,r=T.pivot_y||{type:"pivot-percentage",value:50};br=Jt(r.value,br),ar=`${e} ${"pivot-fixed"===r.type?dt(br):`${br}%`}`,sr=`rotate(${T.rotation}deg)`}return P=Je||qe?"100%":ze||We?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},Xt),Ee),Ae),{width:me,"min-width":ye,"max-width":be,height:_e,"min-height":we,"max-height":$e||(null==Xt?void 0:Xt["max-height"]),"grid-area":b,padding:c,margin:Te,opacity:xe,transition:fr,"transform-origin":ar,transform:sr,"flex-grow":ze||We||void 0,"flex-shrink":Be||He?1:void 0,"flex-basis":P,"--divkit-animation-opacity-start":rr,"--divkit-animation-opacity-end":ir,"--divkit-animation-scale-start":nr,"--divkit-animation-scale-end":or}),O=ue.isPointerFocus,rt(),rt=l(O,(t=>I=t)),rt(),it(),nt(),ot(),lt(),gt(),ft(),ht(),bt(),_t(),wt(),$t(),Et(),At(),Vt(),St(),Mt(),Nt(),Wt(),Re||Ge?"":`${B(Gt,"Actionable").$$render(t,{id:Ht.id,use:function(t){var e;pe=t,Xe&&Ht.transition_in&&de.registerChildWithTransitionIn(Ht,Zt,Ht.transition_in,t).then((()=>{Ke=!1})).catch((t=>{throw Ke=!1,t})),Xe&&Ht.transition_out&&de.registerChildWithTransitionOut(Ht,Zt,Ht.transition_out,t),Xe&&Ht.transition_change&&de.registerChildWithTransitionChange(Ht,Zt,Ht.transition_change,t).then((()=>{er=!1})).catch((t=>{throw er=!1,t}));const r=Qt.fakeElement?[]:Ht.visibility_actions||Ht.visibility_action&&[Ht.visibility_action],i=Qt.fakeElement?[]:Ht.disappear_actions;(Array.isArray(r)&&r.length||Array.isArray(i)&&i.length)&&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=>{const e="visibility"===t.type,r=i.getJsonWithVars({visibility_percentage:t.action.visibility_percentage,visibility_duration:e?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit});return Ct(Ct({},r),{},{visibility_percentage:Ft(e,r.visibility_percentage,e?50:0)})})),a=[...new Set(o.map((t=>t.visibility_percentage/100)))];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const r=o[e.index],n="visibility"===e.type;let a;a=0===r.visibility_percentage?t.intersectionRatio>=1e-12:t.intersectionRatio>=r.visibility_percentage/100;const s=n?!e.visible&&a:e.visible&&!a,l=n?!a:a;s?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===r.log_limit?1/0:r.log_limit||1;++e.count>=t&&(e.finished=!0);const o=i.getJsonWithVars(e.action),a=o.url,s=o.typed;if(a){const t=xt(a);t&&!kt(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(o):o.log_id&&i.execCustomAction(o))}else s&&i.execAction(o);i.logStat(n?"visible":"disappear",o)}),o[e.index].visibility_duration||800)):l&&e.timer&&clearTimeout(e.timer),e.visible=a}))}))}),{threshold:a}).observe(t)}(t,{visibilityActions:r,disappearActions:i,rootCtx:ue});const n=Ht.id;n&&de.registerChild(n),null===(e=Ht.tooltips)||void 0===e||e.forEach((e=>{ue.registerTooltip(t,e)}));let o=null;if(Array.isArray(Ht.extensions)){const e=ue.getExtensionContext();ve=Ht.extensions.map((r=>{var i;const n=ue.getExtension(r.id,r.params);return n&&(null===(i=n.mountView)||void 0===i||i.call(n,t,e)),n})).filter(mt)}return{destroy(){if(n&&de.unregisterChild(n),ve){const e=ue.getExtensionContext();ve.forEach((r=>{var i;null===(i=r.unmountView)||void 0===i||i.call(r,t,e)})),ve=null}o&&o.destroy()}}},cls:Yt+" "+Dt("outer",ct,D),style:ut(S),actions:cr,doubleTapActions:ur,longTapActions:dr,attrs:ge,hasInnerFocusable:se,isNativeActionAnimation:!vr.length||(kr=vr,kr.some((t=>"native"===t.name)))},{},{default:()=>` ${Ce?`${B(Kt,"OuterBackground").$$render(t,{background:ke,radius:Oe},{},{})}`:""}${i.default?i.default({focusHandler:_r,blurHandler:wr,hasCustomFocus:lr}):""}${Ve?`<span${L("class",ct.outer__border,0)}${L("style",ut(Fe),0)}></span>`:""}`})}`})),ee=te,re={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function ie(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function ne(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function oe(t,e){return ne(t)||e}const ae=U(((t,e,r,i)=>{let n,o,a,s,l,c;var u,d;let{text:p}=e,{rootFontSize:g}=e,{textStyles:v={}}=e,{singleline:h=!1}=e,{actions:m}=e;const y=f(at);let b,_="none",w=12,$=1.25,x="",k="",E="",C=null;void 0===e.text&&r.text&&void 0!==p&&r.text(p),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==v&&r.textStyles(v),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==m&&r.actions(m);{let t="none";(v.underline||v.strike)&&("single"===v.underline&&"single"===v.strike?t="both":"single"===v.underline?t="underline":"single"===v.strike&&(t="strike")),_=t}return w=ie(v.font_size,w),Yt(v.line_height)&&($=Number(v.line_height)/w),Ot(v.letter_spacing)&&(x=dt(v.letter_spacing)),b=oe(v.font_weight,b),k="string"==typeof v.font_family&&v.font_family?y.typefaceProvider(v.font_family,{fontWeight:b||400}):"",E=vt(v.text_color,1,E),n=v.top_offset?dt(v.top_offset):"",o=v.background?yt([v.background]):null,C=(null===(u=v.border)||void 0===u?void 0:u.stroke)&&v.border.stroke.color&&"transparent"!==vt(v.border.stroke.color)&&Yt(v.border.stroke.width)?{color:v.border.stroke.color,width:v.border.stroke.width}:null,a=ie(null===(d=v.border)||void 0===d?void 0:d.corner_radius,0),s=v.text_shadow?function(t,e){var r,i,n,o,a,s;return"drop-shadow("+vt(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)+")"}(v.text_shadow,w):void 0,l={singleline:h,decoration:_},c={"font-size":dt(10*w/g),"line-height":$,"letter-spacing":x,"font-weight":b,"font-family":k,filter:s,color:E,background:(null==o?void 0:o.color)||void 0,"box-shadow":C?`inset 0 0 0 ${dt(C.width)} ${C.color}`:void 0,"border-radius":a?dt(a):void 0},`${n?`<span${L("class",re["text-range__top-offset"],0)}${H({"margin-top":n})}></span>`:""}${B(Gt,"Actionable").$$render(t,{cls:Dt("text-range",re,l),actions:m,style:ut(c)},{},{default:()=>`${I(p)}`})}`})),se=ae;function le(t,e){return"left"===t||"center"===t||"right"===t?t:e}function ce(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function ue(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function de(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const pe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,P,S,O,I,T,M,z,J,R,U,W,H=o,q=o,G=o,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,it=o,nt=o,ot=o,ct=o,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ft}=e,{layoutParams:ht}=e;const mt=f(at);let bt=!1,_t="",wt=12,$t=1.25,xt=!1,kt="",Et="",Ct=!1,At="left",Ft="top",Vt="",jt="",Pt="",St=!1,Ot=[],It=[];var Tt,Mt;g((()=>{It.forEach((([t,e])=>{mt.removeSvgFilter(t,e)}))})),void 0===e.json&&r.json&&void 0!==pt&&r.json(pt),void 0===e.templateContext&&r.templateContext&&void 0!==gt&&r.templateContext(gt),void 0===e.origJson&&r.origJson&&void 0!==ft&&r.origJson(ft),void 0===e.layoutParams&&r.layoutParams&&void 0!==ht&&r.layoutParams(ht),n=mt.getDerivedFromVars(pt.text),ct(),ct=l(n,(t=>W=t)),Tt=W,Mt=_t,_t=String(null!=Tt?Tt:"")||Mt,_t?bt=!1:(bt=!0,mt.logError(st(new Error('Missing "text" prop for div "text"')))),a=mt.getDerivedFromVars(pt.ranges),q(),q=l(a,(t=>D=t)),s=mt.getDerivedFromVars(pt.images),H(),H=l(s,(t=>V=t)),c=mt.getDerivedFromVars({font_size:pt.font_size,letter_spacing:pt.letter_spacing,font_weight:pt.font_weight,font_family:pt.font_family,text_color:pt.text_color,underline:pt.underline,strike:pt.strike,line_height:pt.line_height,text_shadow:pt.text_shadow}),G(),G=l(c,(t=>j=t)),u=mt.getDerivedFromVars(pt.font_size),ot(),ot=l(u,(t=>U=t)),wt=ie(U,wt),d=mt.getDerivedFromVars(pt.line_height),nt(),nt=l(d,(t=>R=t));{const t=R;Yt(t)?($t=Number(t)/wt,xt=!0):xt=!1}p=mt.getDerivedFromVars(pt.max_lines),tt(),tt=l(p,(t=>M=t)),v=1===M;{let t="",e="",r=!1;if(M&&M>1){let i=Number(M);t=i*$t+"em",e=i,r=!0}kt=t,Et=e,Ct=r}h=mt.getDerivedFromVars(pt.text_alignment_horizontal),it(),it=l(h,(t=>J=t)),At=le(J,At),m=mt.getDerivedFromVars(pt.text_alignment_vertical),et(),et=l(m,(t=>z=t)),Ft=ce(z,Ft),y=!D||_t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=_t.length,b=mt.getDerivedFromVars(pt.text_color),K(),K=l(b,(t=>T=t)),_=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";M&&y&&_&&(t=vt(T||D&&D[0]&&D[0].text_color,1,Vt)),Vt=t}w=mt.getDerivedFromVars(pt.focused_text_color),Q(),Q=l(w,(t=>I=t)),jt=vt(I,1,jt),$=mt.getDerivedFromVars(pt.truncate),X(),X=l($,(t=>O=t)),x="none"===O?"none":"",k=mt.getDerivedFromVars(pt.text_gradient),Y(),Y=l(k,(t=>S=t));{let t="";if(S){const e=yt([S]);e.image&&(t=e.image)}Pt=t}return E=mt.getDerivedFromVars(pt.selectable),Z(),Z=l(E,(t=>P=t)),St=ue(P,St),function(t,e,r){let i=[];if(It.forEach((([t,e])=>{mt.removeSvgFilter(t,e)})),It=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Ot=[]);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;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);i.push({text:n.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...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)/wt)};let a="";const s=t.image.tint_color,c=de(t.image.tint_mode,"source_in");if(s){const e=vt(t.image.tint_color);a=mt.addSvgFilter(e,c),It.push([e,c])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},j)}),Ot=i}(_t,D,V),C={singleline:v,multiline:Ct,halign:At,valign:Ft,truncate:x,"has-focus-color":Boolean(jt)},A={gradient:Boolean(Pt)},F={"font-size":dt(wt),"line-height":$t,"max-height":kt,"-webkit-line-clamp":Et,color:Vt,"background-image":Pt,"--divkit-text-focus-color":jt},H(),q(),G(),Z(),Y(),X(),Q(),K(),tt(),et(),it(),nt(),ot(),ct(),bt?"":`${B(ee,"Outer").$$render(t,{cls:Dt("text",lt,C)+" "+(St?"":rt),json:pt,origJson:ft,templateContext:gt,layoutParams:ht},{},{default:()=>`<span${L("class",Dt("text__inner",lt,A),0)}${L("style",ut(F),0)}>${Ot.length?`${N(Ot,((e,r)=>"text"in e?e.text?`${B(se,"TextRangeView").$$render(t,{text:e.text,rootFontSize:wt,textStyles:e.textStyles,singleline:v,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":xt?`-${e.image.height}`:void 0,"margin-bottom":xt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${B(se,"TextRangeView").$$render(t,{text:_t,rootFontSize:wt,textStyles:j,singleline:v},{},{})}`}</span>`})}`})),ge=pe,ve={container:"divkit-d37d6",container_wrap:"divkit-c8551",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 fe(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 he(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 me(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 ye(t){var e;const r=null===(e=t.width)||void 0===e?void 0:e.type;return"wrap_content"===r||"fixed"===r}function be(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 i;if("rounded_rectangle"===t.shape.type)i={width:Tt(null===(o=(n=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Tt(null===(a=n.item_height)||void 0===a?void 0:a.value,10),radius:Tt(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*Tt(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?vt(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=vt(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${dt(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}let we;function $e(){if(void 0!==we)return we;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),we=1===t.scrollHeight,document.body.removeChild(t),we}const xe="divkit-a7719",ke="divkit-f6e9a";function Ee(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 Ce(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),Ee(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)Ee(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),Ee(t,e,s,{top:l,right:0,bottom:0,left:c},a,i)}}const Ae=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 g=[];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&&Ce(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)))};g.push(i)})),s&&Ce(p,s,g,"horizontal"===o,"vertical"===o?l:c,r),p.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let d,p=[],v=!1,f=null,h=null;return g((()=>{v=!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,(v&&n||f||h)&&(f&&(f.disconnect(),f=null),h&&(h.disconnect(),h=null),v&&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(ke))&&!(null==r?void 0:r.contains(xe))}))&&u()})),f.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(u),h.observe(n)))),v&&n&&u(),` <div${L("class",xe,0)}${L("this",d,0)}>${N(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",ke,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>`})),Fe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,P,S,O=o,I=o,T=o,M=o,z=o,J=o,R=o,U=o,L=o,W=o;var H,q,G,Z,Y,X;let{json:Q={}}=e,{templateContext:tt}=e,{origJson:et}=e,{layoutParams:rt}=e;const it={left:"start",center:"center",right:"end","space-between":"start","space-around":"start","space-evenly":"start"},nt={top:"start",center:"center",bottom:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},ot=["rounded_rectangle","circle"],lt=f(at);let ct,ut,dt=!1,pt="vertical",gt="top",vt="left",ft=null,ht=null,mt={};void 0===e.json&&r.json&&void 0!==Q&&r.json(Q),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),n=Q.items,(null==n?void 0:n.length)&&Array.isArray(n)?dt=!1:(dt=!0,lt.logError(st(new Error('Incorrect or empty "items" prop for div "container"')))),a=(!dt&&n||[]).map((t=>{let e=t,r=tt;return({templateContext:r,json:e}=lt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];a.forEach((e=>{t.push(lt.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),ct=K(t,(t=>[...t])),U(),U=l(ct,(t=>j=t))}if(s=lt.getDerivedFromVars(Q.orientation),W(),W=l(s,(t=>S=t)),pt=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(S,pt),c=lt.getDerivedFromVars(Q.layout_mode),L(),L=l(c,(t=>P=t)),u="wrap"===P,d="horizontal"!==pt&&!u&&j.some(ye),p="vertical"!==pt&&!u&&j.some(be),g=lt.getDerivedFromVars(Q.content_alignment_vertical),R(),R=l(g,(t=>D=t)),gt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(D,gt),v=lt.getDerivedFromVars(Q.content_alignment_horizontal),J(),J=l(v,(t=>V=t)),vt=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(V,vt),h=lt.getDerivedFromVars(Q.separator),z(),z=l(h,(t=>F=t)),(null==F?void 0:F.style)&&"overlap"!==pt&&$e()){const t=_e(F.style,ot,(null==ft?void 0:ft.style)||null);ft=t?{show_at_start:Boolean(null!==(H=F.show_at_start)&&void 0!==H&&H),show_at_end:Boolean(null!==(q=F.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(G=F.show_between)||void 0===G||G),style:t,margins:fe(F.margins)}:null}else ft=null;if(m=lt.getDerivedFromVars(Q.line_separator),M(),M=l(m,(t=>A=t)),(null==A?void 0:A.style)&&"overlap"!==pt&&$e()){const t=_e(A.style,ot,(null==ht?void 0:ht.style)||null);ht=t?{show_at_start:Boolean(null!==(Z=A.show_at_start)&&void 0!==Z&&Z),show_at_end:Boolean(null!==(Y=A.show_at_end)&&void 0!==Y&&Y),show_between:Boolean(null===(X=A.show_between)||void 0===X||X),style:t,margins:fe(A.margins)}:null}else ht=null;y=ft||ht?function(t,e,r){const i={};return he(i,e,"vertical"===t),he(i,r,"horizontal"===t),i}(pt,ft,ht):null,b=lt.getDerivedFromVars(Q.aspect),T(),T=l(b,(t=>C=t));{const t=null==C?void 0:C.ratio;ut=t&&Yt(t)?t:void 0}_=lt.getDerivedFromVars(Q.width),O(),O=l(_,(t=>k=t)),w=lt.getDerivedFromVars(Q.height),I(),I=l(w,(t=>E=t));{let t={};(null==rt?void 0:rt.fakeElement)&&(t.fakeElement=!0),"overlap"===pt&&(t.overlapParent=!0),"horizontal"!==pt&&(t.parentHAlign=u?"start":it[vt]),"vertical"!==pt&&(t.parentVAlign=u?"start":nt[gt]),ut||p||E&&"wrap_content"!==E.type&&("match_parent"!==E.type||!(null==rt?void 0:rt.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!d&&("wrap_content"===(null==k?void 0:k.type)||"match_parent"===(null==k?void 0:k.type)&&(null==rt?void 0:rt.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===pt&&(t.parentContainerOrientation="horizontal"),"vertical"===pt&&(t.parentContainerOrientation="vertical"),u&&(t.parentContainerWrap=!0),mt=zt(t,mt)}return $={orientation:pt,valign:gt,halign:vt,wrap:u},x={gap:ft||ht?me(pt,ft,ht):void 0,"aspect-ratio":ut},O(),I(),T(),M(),z(),J(),R(),U(),L(),W(),dt?"":`${B(ee,"Outer").$$render(t,{cls:Dt("container",ve,$),style:x,json:Q,origJson:et,templateContext:tt,layoutParams:rt,additionalPaddings:y,heightByAspect:Boolean(ut),parentOf:n,replaceItems:function(t){Q=Object.assign(Object.assign({},Q),{items:t})}},{},{default:()=>`${N(a,(e=>`${B(qr,"Unknown").$$render(t,{layoutParams:mt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} ${ft||ht?`${B(Ae,"ContainerSeparators").$$render(t,{separator:ft,lineSeparator:ht,orientation:pt,contentHAlign:vt,contentVAlign:gt},{},{})}`:""}`})}`})),Ve=Fe,De={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function je(t,e){return"vertical"===t||"horizontal"===t?t:e}const Pe=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g=o,{json:v={}}=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!==v&&r.json(v),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),n=b.getDerivedFromVars(v.delimiter_style),g(),g=l(n,(t=>p=t)),_=je(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=vt(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:_},g(),`${B(ee,"Outer").$$render(t,{cls:Dt("separator",De,d),json:v,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>a?`<span${L("class",De.separator__inner,0)}${L("style",ut(u),0)}></span>`:""})}`})),Se={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 Oe(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Ie="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Te=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,P,S,O,I,T,M,N,z,J,R=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,gt,ft=0,ht=!1,mt="rgba(0,0,0,0.08)",yt=!1,bt="",_t="none",xt="50% 50%",kt="0",Et="source_in",Ct="",At="",Ft=0,Vt=0,jt=0,Pt="",St="";g((()=>{dt.removeSvgFilter(gt,Et)})),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),n=dt.getDerivedFromVars(nt.image_url),rt(),rt=l(n,(t=>z=t)),a=dt.getDerivedFromVars(nt.gif_url),it(),it=l(a,(t=>J=t));{let t="gif"===nt.type?J:z;ht="empty://"===t,ht&&(t=Ie),pt=t}ft=0,pt?yt=!1:(yt=!0,dt.logError(st(new Error(`Missing "${"gif"===nt.type?"gif_url":"image_url"}" for "${nt.type}"`)))),s=dt.getDerivedFromVars(nt.width),et(),et=l(s,(t=>N=t)),c="wrap_content"===(null==N?void 0:N.type),u=dt.getDerivedFromVars(nt.height),tt(),tt=l(u,(t=>M=t)),d="wrap_content"===(null==M?void 0:M.type),p=dt.getDerivedFromVars(nt.preview),K(),K=l(p,(t=>T=t)),bt=T?`url("${Oe(T)}")`:"",v=dt.getDerivedFromVars(nt.placeholder_color),Q(),Q=l(v,(t=>I=t)),mt=vt(I,1,mt),h=dt.getDerivedFromVars(nt.scale),X(),X=l(h,(t=>O=t)),_t=wt(O)||_t,m=dt.getDerivedFromVars({content_alignment_horizontal:nt.content_alignment_horizontal,content_alignment_vertical:nt.content_alignment_vertical}),Y(),Y=l(m,(t=>S=t)),xt=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,xt),y=dt.getDerivedFromVars(nt.accessibility),Z(),Z=l(y,(t=>P=t)),b=(null==P?void 0:P.description)||"",_=dt.getDerivedFromVars(nt.aspect),G(),G=l(_,(t=>j=t));{const t=null==j?void 0:j.ratio;kt=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}w=dt.getDerivedFromVars(nt.tint_color),q(),q=l(w,(t=>D=t)),$=dt.getDerivedFromVars(nt.tint_mode),W(),W=l($,(t=>V=t));{const t=D?vt(D):void 0,e=de(V,Et);t===gt&&e===Et||(dt.removeSvgFilter(gt,Et),Ct=t?dt.addSvgFilter(t,e):"",gt=t,Et=e)}if(x=dt.getDerivedFromVars(nt.appearance_animation),U(),U=l(x,(t=>F=t)),F&&"fade"===F.type){const t=F;At=Bt(t.interpolator,"ease_in_out").replace(/_/g,"-"),jt=Tt(t.duration,300),Vt=Tt(t.start_delay,0),Ft=Tt(t.alpha,0)}k=dt.getDerivedFromVars(nt.filters),R(),R=l(k,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=Xt(A,dt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Pt=t,St=e}return E={aspect:"0"!==kt,"is-width-content":c,"is-height-content":d,loaded:!1,"before-appearance":Boolean(At)&&!0},C={"background-image":bt,"background-color":bt?void 0:mt,"background-size":_t,"clip-path":St||void 0,"object-fit":_t,"object-position":xt,filter:["",Pt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":At||void 0,"--divkit-appearance-fade-start":At?Ft:void 0,"--divkit-appearance-delay":At?`${Vt}ms`:void 0,"--divkit-appearance-duration":At?`${jt}ms`:void 0},R(),U(),W(),q(),G(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),it(),yt?"":`${B(ee,"Outer").$$render(t,{cls:Dt("image",Se,E),json:nt,origJson:lt,templateContext:ot,layoutParams:ct,customDescription:!0},{},{default:()=>E.aspect?`<span${L("class",Se["image__aspect-wrapper"],0)}${H({"padding-bottom":`${kt}%`})}><img${L("class",Se.image__image,0)}${L("src",pt,0)} loading="lazy" decoding="async"${L("style",ut(C),0)}${L("alt",b,0)}${L("aria-hidden",b?null:"true",0)}></span>`:`<img${L("class",Se.image__image,0)}${L("src",pt,0)} loading="lazy" decoding="async"${L("style",ut(C),0)}${L("alt",b,0)}${L("aria-hidden",b?null:"true",0)}>`})}`})),Me={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 Ne(t){return t>0&&t<1}function ze(t){return String(Math.ceil(1e3*t)/1e3)}function Be(t,e,r){if(t.some(Ne)){const e=Math.max(...t.filter(Ne).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)},${ze(t[e])}fr)`:t[e]?o[e]=`${ze(t[e])}fr`:o[e]="auto";return o.join(" ")}const Je=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,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=1,P=[],S=[],O=[],I=[],T=0,M=!1,z="top",J="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),n=x.items,(null==n?void 0:n.length)&&Array.isArray(n)?D=!1:(D=!0,A.logError(st(new Error('Incorrect or empty "items" prop for div "grid"')))),a=A.getDerivedFromVars(x.column_count),$(),$=l(a,(t=>y=t)),j=ie(y,j),s=(!D&&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=[];s.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;P=[],S=[],O=[],I=[],M=!1,V=s.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},g="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,v="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,(!P[i]||P[i]<g)&&(P[i]=g),(!S[e]||S[e]<v)&&(S[e]=v),(!O[i]||O[i]<f)&&(O[i]=f),(!I[e]||I[e]<h)&&(I[e]=h));do{++e,e>=j&&(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'))),T=r}return c=A.getDerivedFromVars(x.content_alignment_vertical),_(),_=l(c,(t=>h=t)),z=ce(h,z),u=A.getDerivedFromVars(x.content_alignment_horizontal),b(),b=l(u,(t=>v=t)),J=le(v,J),d={valign:z,halign:J},p={"grid-template-columns":Be(P,O,j),"grid-template-rows":Be(S,I,T)},g=D||M,b(),_(),w(),$(),g?"":`${B(ee,"Outer").$$render(t,{cls:Dt("grid",Me,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})}},{},{default:()=>`${N(V,(e=>`${B(qr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Re=Je,Ue={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":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function Le(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 We(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const He=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,P,S,O,T,M,z,J,R=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 lt=f(at);let ct,pt,gt=[],vt=!1,ft=!1,ht=null,mt=!1;const yt=lt.getCustomization("galleryLeftClass"),bt=lt.getCustomization("galleryRightClass");let _t=!1;z=l(lt.isDesktop,(t=>M=t));let wt,$t,xt,kt,Et=1,Ct="horizontal",At="start",Ft=8,Vt="",jt=[],Pt={},St=!1,Ot={},Mt=0;const Nt=We((function(){if(!ct)return;const t=ct.scrollLeft,e=ct.scrollWidth,r=ct.offsetWidth;vt=t>2,ft=t+r<e-2}),50);function Bt(){let t=[],e=gt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const i=gt[e].children[r];i&&t.push(i)}return t}function Jt(t,e,r="smooth"){const i="horizontal"===Ct,n=i?"offsetLeft":"offsetTop",o=i?"left":"top",a=t[e];a&&ct.scroll({[o]:Math.max(0,a[n]+.01-Ft/2),behavior:r})}function Rt(t){const e=Bt(),r=ct.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}!et.id||_t||(null==ot?void 0:ot.fakeElement)||lt.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');Jt(e,t)},setPreviousItem(t){const e=Rt("prev"),r=Bt();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Jt(r,i)},setNextItem(t){const e="horizontal"===Ct?ct.scrollLeft+ct.offsetWidth===ct.scrollWidth:ct.scrollTop+ct.offsetHeight===ct.scrollHeight,r=Bt();if(e&&"ring"===t)return void Jt(r,0);const i=Rt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Jt(r,n)}}),g((()=>{mt=!1,et.id&&!(null==ot?void 0:ot.fakeElement)&<.unregisterInstance(et.id)})),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),n=et.items,(null==n?void 0:n.length)&&Array.isArray(n)?_t=!1:(_t=!0,lt.logError(st(new Error('Incorrect or empty "items" prop for div "gallery"')))),a=(!_t&&n||[]).map((t=>{let e=t,r=rt;return({templateContext:r,json:e}=lt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=M&&mt&&!_t,s?"undefined"!=typeof ResizeObserver&&(ht=new ResizeObserver((()=>{Nt()})),ht.observe(pt)):ht&&(ht.disconnect(),ht=null),c=lt.getDerivedFromVars(et.column_count),Q(),Q=l(c,(t=>T=t)),Et=ie(T,Et),u=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}(a,Et),d=lt.getDerivedFromVars(et.orientation),X(),X=l(d,(t=>O=t)),Ct=je(O,Ct),p=lt.getDerivedFromVars(et.cross_content_alignment),Y(),Y=l(p,(t=>S=t)),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,At),v=lt.getDerivedFromVars(et.item_spacing),Z(),Z=l(v,(t=>P=t)),Ft=Tt(P,Ft),wt=dt(Ft),h=lt.getDerivedFromVars(et.cross_spacing),G(),G=l(h,(t=>j=t)),xt=Tt(j,Ft),$t=dt(xt),m=lt.getDerivedFromVars(et.paddings),q(),q=l(m,(t=>D=t)),Vt=It(D,Vt),y="horizontal"===Ct?"grid-template-columns":"grid-template-rows";{let t=[];a.forEach((e=>{const r="horizontal"===Ct?"width":"height";t.push(lt.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")})),b=lt.getDerivedFromVars(et.scroll_mode),W(),W=l(b,(t=>F=t));{const t={};let e={};St=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ct?e.parentVAlign=At:e.parentHAlign=At,"paging"===F&&(St=!0,e.scrollSnap="start",t["horizontal"===Ct?"scroll-padding-left":"scroll-padding-top"]=dt(Ft/2)),1===Et&&(e.parentLayoutOrientation=Ct),Pt=zt(t,Pt),Ot=zt(e,Ot)}return _=lt.getDerivedFromVars(et.restrict_parent_scroll),tt(),tt=l(_,(t=>J=t)),w=lt.getDerivedFromVars(et.scrollbar),U(),U=l(w,(t=>A=t)),$={padding:Vt,"grid-gap":$t},x={"grid-gap":wt,[y]:Le(jt)},k={orientation:Ct,"scroll-snap":St,scrollbar:"auto"===A?"auto":"none"},E=lt.getDerivedFromVars(et.default_item),R(),R=l(E,(t=>C=t)),Mt=Tt(C,Mt),R(),U(),W(),H(),q(),G(),Z(),Y(),X(),Q(),z(),tt()," "+(_t?"":`${B(ee,"Outer").$$render(t,{cls:Dt("gallery",Ue,k),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})}},{},{default:()=>`<div class="${I(Ue.gallery__scroller,!0)+" "+I(J?nt:"",!0)}"${L("style",ut(Pt),0)}${L("this",ct,0)}><div${L("class",Ue["gallery__items-grid"],0)}${L("style",ut($),0)}${L("this",pt,0)}>${N(u,((e,r)=>`<div${L("class",Ue.gallery__items,0)}${L("style",ut(x),0)}${L("this",gt[r],0)}>${N(e,(e=>`${B(qr,"Unknown").$$render(t,{layoutParams:Ot,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} </div>`))}</div></div> ${"horizontal"===Ct?`${vt&&s?` <div${L("class",yt||`${Ue.gallery__arrow} ${Ue.gallery__arrow_left}`,0)}>${yt?"":`<svg${L("class",Ue["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ue["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>`:""} ${ft&&s?` <div${L("class",bt||`${Ue.gallery__arrow} ${Ue.gallery__arrow_right}`,0)}>${bt?"":`<svg${L("class",Ue["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("class",Ue["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>`:""}`:""}`})}`)})),qe=He,Ge={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"},Ze=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,x,k,E,C,A,F,V,D,j,P,S=o,O=o,T=o,M=o,z=o,J=o,R=o,U=o,W=o;var q,G;let{json:Z={}}=e,{templateContext:Y}=e,{origJson:X}=e,{layoutParams:K}=e;const tt=f(at),et=tt.genId("tabs");let rt=!1,it=Q([]);x=l(it,(t=>w=t));let ot,lt,ct,gt={};const ft=tt.getJsonWithVars(Z.selected_tab);let ht,mt,yt=ft&&Number(ft)||0,bt=12,_t="",wt="",$t="",xt="",kt="",Et="",Ct="",At="",Ft="",Vt="",jt=0,St="",Mt="",Nt=null,Bt=!1,Jt=!1,Rt=yt,Wt=[],Ht=[];async function qt(t,e=!1){if(Rt=yt,yt=t,Bt||(Bt=!0,lt.style.height=dt(lt.clientHeight),ct.style.transform=`translate3d(${100*-Rt}%,0,0)`),Jt=!0,async function(t){await $(),ct.style.transform=`translate3d(${t}%,0,0)`}(100*-yt),function(t=!1){const e=t?Math.max(0,yt-1):Math.min(yt,Rt),r=t?Math.min(n.length-1,yt+1):Math.max(yt,Rt);Wt=Wt.map(((t,i)=>t||i>=e&&i<=r)),Ht=Ht.map(((t,i)=>i>=e&&i<=r))}(),async function(){await $();const t=document.getElementById(`${et}-panel-${yt}`);t&&(lt.style.height=dt(t.offsetHeight))}(),Xt&&clearTimeout(Xt),Xt=window.setTimeout((()=>{Ht=n.map(((t,e)=>e===yt))}),400),Zt=-yt*lt.clientWidth,e){await $();const t=ot.querySelector(`.${Ge.tabs__item_selected}`);t&&t.focus()}}let Zt,Xt=null;if(!Z.id||rt||(null==K?void 0:K.fakeElement)||tt.registerInstance(Z.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');qt(t)},setPreviousItem(t){let e=yt-1;e<0&&(e="ring"===t?n.length-1:yt),qt(e)},setNextItem(t){let e=yt+1;e>n.length-1&&(e="ring"===t?0:yt),qt(e)}}),g((()=>{Z.id&&!(null==K?void 0:K.fakeElement)&&tt.unregisterInstance(Z.id)})),void 0===e.json&&r.json&&void 0!==Z&&r.json(Z),void 0===e.templateContext&&r.templateContext&&void 0!==Y&&r.templateContext(Y),void 0===e.origJson&&r.origJson&&void 0!==X&&r.origJson(X),void 0===e.layoutParams&&r.layoutParams&&void 0!==K&&r.layoutParams(K),n=Z.items||[],Array.isArray(n)&&n.length){let t=[];n.forEach(((e,r)=>{const i=tt.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});i.title&&"string"==typeof i.title?t.push(i):tt.logError(st(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),it.set(t)}else it.set([]);(null==w?void 0:w.length)?rt=!1:(rt=!0,tt.logError(st(new Error('Incorrect or empty "items" prop for div "tabs"')))),a=tt.getDerivedFromVars(Z.width),U(),U=l(a,(t=>j=t)),s=tt.getDerivedFromVars(Z.height),R(),R=l(s,(t=>D=t));{let t={};(null==K?void 0:K.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==j?void 0:j.type)&&(t.parentHorizontalWrapContent=!0),D&&"wrap_content"!==D.type||(t.parentVerticalWrapContent=!0),gt=zt(t,gt)}if(!rt&&(yt<0||yt>=n.length)&&(tt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab,length:n.length}})),yt=yt<0?0:n.length-1),rt||w.some((t=>yt===t.index))||(tt.logError(st(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab}})),yt=(null===(q=w[0])||void 0===q?void 0:q.index)||0),c=tt.getDerivedFromVars(Z.tab_title_style),J(),J=l(c,(t=>V=t)),u=V||{},bt=ie(u.font_size,bt),u.font_size||u.paddings){const t=u.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/bt*10,right:(Number(t.right)||0)/bt*10,bottom:(Number(t.bottom)||0)/bt*10,left:(Number(t.left)||0)/bt*10};_t=It(e,_t)}{const t=u.line_height;void 0!==t&&Yt(t)&&(wt=dt(t/bt*10))}{const t=u.letter_spacing;void 0!==t&&Ot(t)&&($t=dt(t/bt*10))}if(u.corner_radius||u.corners_radius||u.font_size){const t=null!==(G=u.corner_radius)&&void 0!==G?G:1e3;u.corners_radius?xt=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]&&!Ot(n[t]))return i;return Lt(t,e,r)}(u.corners_radius,t,bt,xt):Ot(t)&&(xt=dt(t/bt*10))}return ht=oe(u.active_font_weight||u.font_weight,ht),kt=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:ht||400}):"",mt=oe(u.inactive_font_weight||u.font_weight,mt),Et=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:mt||400}):"",Ct=vt(u.active_text_color,1,Ct),At=vt(u.inactive_text_color,1,At),Ft=vt(u.active_background_color,1,Ft),Vt=vt(u.inactive_background_color,1,Vt),jt=Tt(u.item_spacing,jt),d=tt.getDerivedFromVars(Z.has_separator),z(),z=l(d,(t=>F=t)),p=tt.getDerivedFromVars(Z.separator_color),M(),M=l(p,(t=>A=t)),v=tt.getDerivedFromVars(Z.separator_paddings),T(),T=l(v,(t=>C=t)),F&&(A&&(St=vt(A,1,St)),C&&(Mt=It(C,Mt))),h={background:St,margin:Mt},m=tt.getDerivedFromVars(Z.switch_tabs_by_content_swipe_enabled),O(),O=l(m,(t=>E=t)),y=void 0===E||Boolean(E),b=tt.getDerivedFromVars(Z.restrict_parent_scroll),W(),W=l(b,(t=>P=t)),_=tt.getDerivedFromVars(Z.title_paddings),S(),S=l(_,(t=>k=t)),Nt=Ut(k||void 0,Nt),rt||(Wt=n.map(((t,e)=>e===yt)),Ht=n.map(((t,e)=>e===yt))),x(),S(),O(),T(),M(),z(),J(),R(),U(),W(),rt?"":`${B(ee,"Outer").$$render(t,{cls:Dt("tabs",Ge,{}),json:Z,origJson:X,templateContext:Y,layoutParams:K,customActions:"tabs"},{},{default:()=>` <div class="${I(Ge.tabs__list,!0)+" "+I(P?nt:"",!0)}" role="tablist"${H({"--divkit-tabs-title-padding":Nt?Pt(Nt):"","--divkit-tabs-font-size":dt(bt),"--divkit-tabs-paddings":_t,"--divkit-tabs-line-height":wt,"--divkit-tabs-letter-spacing":$t,"--divkit-tabs-active-font-weight":ht||"","--divkit-tabs-inactive-font-weight":mt||"","--divkit-tabs-active-font-family":kt||"","--divkit-tabs-inactive-font-family":Et||"","--divkit-tabs-active-text-color":Ct,"--divkit-tabs-inactive-text-color":At,"--divkit-tabs-active-background-color":Ft,"--divkit-tabs-inactive-background-color":Vt,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":jt?pt(jt):""})}${L("this",ot,0)}>${N(w,(e=>{let r=e.index,i=r===yt;return` ${B(Gt,"Actionable").$$render(t,{cls:Dt("tabs__item",Ge,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=K&&K.fakeElement?[]:[e.title_click_action],attrs:{id:`${et}-tab-${r}`,"aria-controls":`${et}-panel-${r}`,role:"tab",tabindex:!i||null!=K&&K.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"true":"false"},customAction:null!=K&&K.fakeElement?null:t=>function(t,e){return yt===e||(qt(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${F?`<div${L("class",Ge.tabs__separator,0)}${L("style",ut(h),0)}></div>`:""} <div class="${I(Ge.tabs__panels,!0)+" "+I(P?nt:"",!0)}"${L("this",lt,0)}><div${L("class",Dt("tabs__swiper",Ge,{inited:Bt,animated:Jt}),0)}${L("this",ct,0)}>${N(w,(e=>{let r=e.index;return` <div${L("class",Dt("tabs__panel",Ge,{visible:Ht[r]}),0)} role="tabpanel" id="${I(et,!0)+"-panel-"+I(r,!0)}" aria-labelledby="${I(et,!0)+"-tab-"+I(r,!0)}" style="${"left: "+I(100*r,!0)+"%"}">${Wt[r]?`${B(qr,"Unknown").$$render(t,{div:n[r].div,templateContext:Y,layoutParams:gt},{},{})}`:""} </div>`}))}</div></div>`})}`})),Ye=Ze,Xe="divkit-eb860",Qe="divkit-e08c6";function Ke(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 tr(t){return Math.max(...t.map((t=>(Number(t.duration)||200)+(Number(t.start_delay)||0))))}function er(t){const e=[];return"set"===t.type?(t.items||[]).forEach((t=>{e.push(...er(t))})):e.push(t),e}Ke([.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]),Ke([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 rr={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},ir=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w=o,$=o,x=o,k=o,E=o,C=o;var A,F,V,D;let{ownerNode:j}=e,{data:P}=e,{internalId:S}=e,{templateContext:O}=e;const T=f(at);Date.now();return g((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==j&&r.ownerNode(j),void 0===e.data&&r.data&&void 0!==P&&r.data(P),void 0===e.internalId&&r.internalId&&void 0!==S&&r.internalId(S),void 0===e.templateContext&&r.templateContext&&void 0!==O&&r.templateContext(O),n=T.isDesktop,k(),k=l(n,(t=>y=t)),a=T.getDerivedFromVars(P.position),x(),x=l(a,(t=>m=t)),s=T.getDerivedFromVars(null===(F=null===(A=P.offset)||void 0===A?void 0:A.x)||void 0===F?void 0:F.value),$(),$=l(s,(t=>h=t)),c=T.getDerivedFromVars(null===(D=null===(V=P.offset)||void 0===V?void 0:V.y)||void 0===D?void 0:D.value),w(),w=l(c,(t=>v=t)),u=T.getDerivedFromVars(P.animation_in),E(),E=l(u,(t=>b=t)),d=T.getDerivedFromVars(P.animation_out),C(),C=l(d,(t=>_=t)),p={visible:!1},w(),$(),x(),k(),E(),C(),` <div class="${I(Dt("tooltip",rr,p),!0)+" "+I(y?it:"",!0)}"${H({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${B(qr,"Unknown").$$render(t,{div:P.div,templateContext:O},{},{})}</div>`}));function nr(t){return"change_bounds"===t.type?t:"set"===t.type?nr(t.items[0]):null}const or=U(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=f(at),u=f(jt);let d,p=new Map,h=new Set,m=!1,y=null,b=[],_=[],w=[],x=[];function k(t,e,r){let{json:i,templateContext:n,transitions:o,node:a}=e;i=c.getJsonWithVars(i),o=c.getJsonWithVars(o);const s=er(o),l=a.getBoundingClientRect();return{json:Object.assign(Object.assign({},i),{margins:void 0,alpha:(u=s,u.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 u}const E=o.div_id||o.id;async function C(t){if(A===t)return;c.setRunning("stateChange",!0);const e=new Set(h);b.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),b=[];let r=[];if(d){const t=d.getBoundingClientRect();r=w.map((e=>k(t,e,"out")))}x.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],x=[];const i=n.find((e=>e.state_id===t))||null;if(i?(A=t,null==j||j.setValue(A),F=i):c.logError(st(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $(),!d)return;const o=d.getBoundingClientRect();let a=_.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=>k(o,t,"in")));r=r.filter((t=>{var e;return!(!t.json.id||h.has(t.json.id))||(null===(e=t.resolvePromise)||void 0===e||e.call(t),!1)}));const s=r.concat(a),l=s.reduce(((t,e)=>Math.max(t,tr(e.transitions))),0),u=x.filter((t=>p.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:o,beforeBbox:p.get(t.id),afterBbox:t.node.getBoundingClientRect(),node:t.node,transition:nr(t.transitions),resolvePromise:t.resolvePromise})));b=[...s.map((t=>Object.assign(Object.assign({},t),{maxDuration:l}))),...u],p.clear(),c.setRunning("stateChange",!1)}let A;E?(null==l?void 0:l.fakeElement)||(u.registerInstance(E,{setState:C,getChild(t){if(y&&y.has(t))return y.get(t);c.logError(st(new Error("Missing state block with id"),{additional:{id:t}}))}}),v(jt,{registerInstance(t,e){y||(y=new Map),y.has(t)?c.logError(st(new Error("Duplicate state with id"),{additional:{id:t}})):y.set(t,e)},unregisterInstance(t){null==y||y.delete(t)},runVisibilityTransition(t,e,r,i,n){if(!d)return Promise.resolve();const o=k(d.getBoundingClientRect(),{json:t,templateContext:e,transitions:r,node:i},n),a=tr(o.transitions),s=Object.assign(Object.assign({},o),{maxDuration:a});return b=[...b.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 _.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return w.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 x.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(m=!0,c.logError(st(new Error('Missing "id" prop for div "state"'))));let F=null;const V=c.getJsonWithVars(o.default_state_id),D=o.state_id_variable,j=D?c.getVariable(D,"string"):null;let P=!1;return g((()=>{E&&!(null==l?void 0:l.fakeElement)&&u.unregisterInstance(E)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),n=o.states||[],(null==n?void 0:n.length)?m=!1:(m=!0,c.logError(st(new Error('Empty "states" prop for div "state"')))),function(t){if(!P&&(P=!0,t.length)){const e=(null==j?void 0:j.getValue())||V;e?(A=e,F=t.find((t=>t.state_id===A))||null,F||c.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:A}}))):(F=t[0],A=F.state_id),j&&(j.setValue(A),j.subscribe((t=>{C(t)})))}}(n),m?"":`${B(ee,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=F)&&void 0!==e&&e.div?`${B(qr,"Unknown").$$render(t,{div:F.div,templateContext:a},{},{})}`:""} <div${L("class","divkit-adaae",0)} aria-hidden="true"${L("this",d,0)}>${N(b,(e=>"direction"in e?`<div${L("class",Xe,0)}${H({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",Qe,0)}>${B(qr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`:`<div${L("class",Xe,0)}><div${L("class",Qe,0)}>${B(qr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`))}</div>`}})} ${null!=l&&l.tooltips?`${N(null==l?void 0:l.tooltips,(e=>`${B(ir,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,templateContext:a},{},{})}`))}`:""}`})),ar={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},sr=U(((t,e,r,i)=>{let n,a,s,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C=o,A=o,F=o,V=o,D=o,j=o;var P,S,O,T,M,z,J;let{json:R={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:H}=e;const q=f(at),G=q.genId("pager");let Z,Y=!1,X=!1,Q=0,K=0,tt=!1,et="horizontal",rt="",it="",ot="";function lt(t,e="smooth"){const r="horizontal"===et,i=Z.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:i[n],behavior:e}),Q=t}We((function(){if(!Y)return;const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===et?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:Q}();t!==Q&&(Q=t)}),50),R.id&&!(null==H?void 0:H.fakeElement)&&q.registerInstance(R.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');lt(t)},setPreviousItem(t){let e=Q-1;e<0&&(e="ring"===t?n.length-1:Q),lt(e)},setNextItem(t){let e=Q+1;e>n.length-1&&(e="ring"===t?0:Q),lt(e)}}),g((()=>{Y=!1,R.id&&!(null==H?void 0:H.fakeElement)&&q.unregisterInstance(R.id)})),void 0===e.json&&r.json&&void 0!==R&&r.json(R),void 0===e.templateContext&&r.templateContext&&void 0!==U&&r.templateContext(U),void 0===e.origJson&&r.origJson&&void 0!==W&&r.origJson(W),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),(null===(P=R.items)||void 0===P?void 0:P.length)&&Array.isArray(R.items)?X=!1:(X=!0,q.logError(st(new Error('Incorrect or empty "items" prop for div "pager"')))),n=(!X&&R.items||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),a=q.getDerivedFromVars(R.layout_mode),A(),A=l(a,(t=>w=t)),w?"percentage"!==w.type&&"fixed"!==w.type?(tt=!0,q.logError(st(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):tt=!1:(tt=!0,q.logError(st(new Error('Empty "layout_mode" prop for div "pager"')))),s=q.getDerivedFromVars(R.orientation),D(),D=l(s,(t=>k=t)),et=je(k,et),u=q.getDerivedFromVars(R.item_spacing),V(),V=l(u,(t=>x=t));{const t=null==x?void 0:x.value;t&&Ot(t)&&(rt=dt(t||0))}if(d=q.getDerivedFromVars(R.paddings),F(),F=l(d,(t=>$=t)),it=It($,it),p=q.getDerivedFromVars(R.restrict_parent_scroll),j(),j=l(p,(t=>E=t)),v="horizontal"===et?"grid-auto-columns":"grid-auto-rows","fixed"===(null==w?void 0:w.type)){const t=pt("horizontal"===et?((null===(S=R.paddings)||void 0===S?void 0:S.left)||0)+((null===(O=R.paddings)||void 0===O?void 0:O.right)||0):((null===(T=R.paddings)||void 0===T?void 0:T.top)||0)+((null===(M=R.paddings)||void 0===M?void 0:M.bottom)||0)),e=null===(z=w.neighbour_page_width)||void 0===z?void 0:z.value;ot=e?`calc(100% + ${t} - 2 * ${pt(e)} - 2 * ${rt})`:"100%"}else if("percentage"===(null==w?void 0:w.type)){const t=null===(J=w.page_width)||void 0===J?void 0:J.value;ot=`${Number(t)}%`}return h={"grid-gap":rt,padding:it,[v]:ot},m={orientation:et},y=X||tt,b=q.getStore("pagers"),C(),C=l(b,(t=>_=t)),function(t,e){const r=R.id;if(r){const i=new Map(_);c(b,_=i.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:lt}),_)}}(n.length,Q),function(t){var e;if(t===K)return;K=t;const r=q.getJsonWithVars(null===(e=n[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(Q),C(),A(),F(),V(),D(),j(),y?"":`${B(ee,"Outer").$$render(t,{cls:Dt("pager",ar,m),json:R,origJson:W,templateContext:U,layoutParams:H,customPaddings:!0,parentOf:R.items,replaceItems:function(t){R=Object.assign(Object.assign({},R),{items:t})}},{},{default:()=>`<div class="${I(ar.pager__items,!0)+" "+I(E?nt:"",!0)}"${L("style",ut(h),0)}${L("this",Z,0)}>${N(n,(e=>`<div${L("class",ar.pager__item,0)}>${B(qr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})} </div>`))}</div>`})}`})),lr=sr,cr={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"},ur=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,g,v,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,T=o;var M,z;let{json:J={}}=e,{templateContext:R}=e,{origJson:U}=e,{layoutParams:W}=e;const q=["rounded_rectangle","circle"],G=f(at);let Z,Y,X,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},K={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,it=10,nt=5;if(void 0===e.json&&r.json&&void 0!==J&&r.json(J),void 0===e.templateContext&&r.templateContext&&void 0!==R&&r.templateContext(R),void 0===e.origJson&&r.origJson&&void 0!==U&&r.origJson(U),void 0===e.layoutParams&&r.layoutParams&&void 0!==W&&r.layoutParams(W),n=G.getDerivedFromVars(J.shape),P(),P=l(n,(t=>x=t)),a=G.getDerivedFromVars(J.active_item_color),D(),D=l(a,(t=>_=t)),s=G.getDerivedFromVars(J.inactive_item_color),j(),j=l(s,(t=>w=t)),c=G.getDerivedFromVars(J.active_item_size),S(),S=l(c,(t=>k=t)),u=G.getDerivedFromVars(J.active_shape),T(),T=l(u,(t=>C=t)),d=G.getDerivedFromVars(J.inactive_shape),O(),O=l(d,(t=>E=t)),C&&(Q=_e({type:"shape_drawable",shape:C},q,Q)),E&&(K=_e({type:"shape_drawable",shape:E},q,K)),!C&&!E&&x){const t=ie(k,1.3);K=_e({type:"shape_drawable",shape:x,color:K.background},q,K),K.background=vt(w,1,K.background),Q=Object.assign(Object.assign({},K),{width:K.width*t,height:K.height*t,borderRadius:K.borderRadius*t,background:Q.background}),Q.background=vt(_,1,Q.background)}if(p=G.getDerivedFromVars(J.space_between_centers),F(),F=l(p,(t=>y=t)),g=G.getDerivedFromVars(J.items_placement),V(),V=l(g,(t=>b=t)),!b||"default"!==b.type&&"stretch"!==b.type)et="default",y&&(rt=Tt(y.value,rt));else if(et=b.type,"default"===et)rt=Tt(null===(M=b.space_between_centers)||void 0===M?void 0:M.value,rt);else if("stretch"===et){const t=b;it=ie(t.max_visible_items,it),nt=Tt(null===(z=t.item_spacing)||void 0===z?void 0:z.value,nt)}return v=G.getStore("pagers"),A(),A=l(v,(t=>m=t)),async function(t){if(J.pager_id&&t.has(J.pager_id)&&(X=t.get(J.pager_id),await $(),Y)){const t=Y.children[X.currentItem].offsetLeft;Z.scroll({left:t-Z.clientWidth/2,behavior:"smooth"})}}(m),h={placement:et},A(),F(),V(),D(),j(),P(),S(),O(),T(),`${B(ee,"Outer").$$render(t,{cls:Dt("indicator",cr,h),json:J,origJson:U,templateContext:R,layoutParams:W},{},{default:()=>`<div${L("class",cr.indicator__scroller,0)}${L("this",Z,0)}><div${L("class",cr.indicator__items,0)} role="tablist"${H({margin:"default"===et?`0 ${dt(Math.max(0,Q.width-K.width)/2)}`:"","--divkit-indicator-inactive-width":dt(K.width),"--divkit-indicator-inactive-height":dt(K.height),"--divkit-indicator-inactive-border-radius":dt(K.borderRadius),"--divkit-indicator-inactive-background":K.background||"","--divkit-indicator-inactive-box-shadow":K.boxShadow||"","--divkit-indicator-active-width":dt(Q.width),"--divkit-indicator-active-height":dt(Q.height),"--divkit-indicator-active-border-radius":dt(Q.borderRadius),"--divkit-indicator-active-background":Q.background||"","--divkit-indicator-active-box-shadow":Q.boxShadow||"","--divkit-indicator-active-scale":Q.width/K.width,"--divkit-indicator-default-margin":"default"===et?`0 ${dt((rt-K.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?dt(nt):"","--divkit-indicator-stretch-max-count":"stretch"===et?it:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?dt((it-1)*nt):""})}${L("this",Y,0)}>${X?`${N(Array(X.size),((t,e)=>{let r=e===X.currentItem;return` <div class="${I(Dt("indicator__item",cr,{active:r}),!0)+" "+I(tt,!0)}" role="tab" id="${I(X.instId,!0)+"-tab-"+I(e,!0)}" aria-controls="${I(X.instId,!0)+"-panel-"+I(e,!0)}"${L("aria-selected",r?"true":"false",0)}${L("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),dr=ur,pr={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 gr(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&vt(t.text_color)||"#000",n=ne(t.font_weight);if(Yt(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 vr(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const fr="function"==typeof BigInt;function hr(t){return fr?BigInt(t):Number(t)}const mr=hr("9223372036854775807"),yr=hr("-9223372036854775808");function br(t){const e=hr(t);if(e>mr||e<yr)throw new Error("Integer overflow.");return e}const _r=br(0);function wr(t){let e=t;return e<0&&(e=-e),e}function $r(t){let e=0;return t>0?e=1:t<0&&(e=-1),br(e)}class xr{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 kr={string:class extends xr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends xr{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 xr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>mr||t<yr)throw new Error("Incorrect variable value");return br(t)}fromString(t){const e=br(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends xr{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 xr{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 xr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}},dict:class extends xr{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 xr{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 Er(t,e,r){if(!(e in kr))throw new Error("Unsupported variable type");return new kr[e](t,r)}function Cr(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 Ar=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,P,S,O,T,M,z,J,R,U,W,q,G,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,rt=o,it=o,nt=o,ot=o,lt=o;var ct,ut,gt,vt;let{json:ft={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},_t=["rounded_rectangle","circle"],wt=["rounded_rectangle"],$t=f(at),xt=f(Ht);let kt,Et=0,Ct=100;const At=ft.thumb_value_variable,Ft=ft.thumb_secondary_value_variable;W=l(At&&$t.getVariable(At,"integer")||Er("temp","integer",0),(t=>U=t)),R=l(Ft&&$t.getVariable(Ft,"integer")||Er("temp","integer",0),(t=>J=t));let Vt,jt,Pt,St=vr(U||0,Et,Ct),It=vr(J||0,Et,Ct),Tt=bt,Mt=Tt,Nt=bt,zt=bt,Bt=null,Rt=null,Ut=Pt,Lt="",Wt="",qt=!1,Gt=!1;function Zt(){if(!kt)return;const t=Ct-Et,e=(null==Bt?void 0:Bt.width)||0,r=(null==Rt?void 0:Rt.width)||0;Math.max(e,r)*t>=(null==kt?void 0:kt.clientWidth)?Gt||($t.logError(st(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}We(Zt,50),g((()=>{ft.id&&$t.unregisterFocusable(ft.id)})),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!==yt&&r.layoutParams(yt),n=$t.getDerivedFromVars(ft.min_value),lt(),lt=l(n,(t=>G=t)),a=$t.getDerivedFromVars(ft.max_value),ot(),ot=l(a,(t=>q=t)),Et=Jt(G,Et),Ct=Jt(q,Ct),Zt();{const t=vr(U||0,Et,Ct);t!==St&&(St=t)}{const t=vr(J||0,Et,Ct);t!==It&&(It=t)}s=$t.getDerivedFromVars(ft.thumb_style),nt(),nt=l(s,(t=>z=t)),Tt=_e(z,_t,Tt),c=$t.getDerivedFromVars(ft.thumb_secondary_style),it(),it=l(c,(t=>M=t)),Mt=_e(M,_t,Tt),u=$t.getDerivedFromVars(ft.track_inactive_style),rt(),rt=l(u,(t=>T=t)),Nt=_e(T,wt,Nt),d=$t.getDerivedFromVars(ft.track_active_style),et(),et=l(d,(t=>O=t)),zt=_e(O,wt,zt),p=$t.getDerivedFromVars(ft.tick_mark_active_style),tt(),tt=l(p,(t=>S=t));{let t=_e(S,_t,bt);t!==bt&&(Bt=t)}Bt?(Vt=Ft?Cr(Math.min(St,It),Math.max(St,It)+1,Et,Ct,!0):Cr(Et,St,Et,Ct,!0),Zt()):Vt=[],v=$t.getDerivedFromVars(ft.tick_mark_inactive_style),K(),K=l(v,(t=>P=t));{let t=_e(P,_t,bt);t!==bt&&(Rt=t)}Rt?(jt=Ft?Cr(Math.min(St,It),Math.max(St,It)+1,Et,Ct,!1):Cr(St+1,Ct+1,Et,Ct,!0),Zt()):jt=[],h=$t.getDerivedFromVars(ft.thumb_text_style),Q(),Q=l(h,(t=>j=t)),Pt=gr(j,Pt),m=$t.getDerivedFromVars(ft.thumb_secondary_text_style),X(),X=l(m,(t=>D=t)),Ut=gr(D,Pt),y=$t.getDerivedFromVars(ft.accessibility),Y(),Y=l(y,(t=>V=t)),(null==V?void 0:V.description)?Lt=V.description:$t.logError(st(new Error('Missing accessibility "description" for slider'),{level:"warn"})),b=$t.getDerivedFromVars(ft.secondary_value_accessibility),Z(),Z=l(b,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Ft&&$t.logError(st(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;xt.hasAction()?($t.logError(st(new Error('Cannot show "slider" inside component with action'))),t=!0):Tt===bt?($t.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):zt===bt?($t.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===bt&&($t.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return _=dt(Math.max(...[Tt.width,Mt.width,0].filter(Ot))),w=dt(Math.max(...[Tt.height,Mt.height,0].filter(Ot))),$=(St-Et)/(Ct-Et),x=Ft?(It-Et)/(Ct-Et):void 0,k=void 0!==x?Math.abs(x-$):$,E=void 0!==x?Math.min(x,$):0,C={"--divkit-slider-thumb-width":dt(Tt.width),"--divkit-slider-thumb-height":dt(Tt.height),"--divkit-slider-thumb-secondary-width":dt(Mt.width),"--divkit-slider-thumb-secondary-height":dt(Mt.height),"--divkit-slider-text-offset-x":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.x)?pt(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ut=null==Pt?void 0:Pt.offset)||void 0===ut?void 0:ut.y)?pt(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(gt=null==Ut?void 0:Ut.offset)||void 0===gt?void 0:gt.x)?pt(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(vt=null==Ut?void 0:Ut.offset)||void 0===vt?void 0:vt.y)?pt(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Bt?dt(Bt.width):void 0,"--divkit-slider-tick-active-height":Bt?dt(Bt.height):void 0,"--divkit-slider-tick-active-border-radius":Bt?dt(Bt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Bt?void 0:Bt.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":_,"--divkit-slider-max-thumb-height":w,"--divkit-slider-track-part":$,"--divkit-slider-track-secondary-part":x},A={},Z(),Y(),X(),Q(),K(),tt(),et(),rt(),it(),nt(),R(),W(),ot(),lt()," "+(qt?"":`${B(ee,"Outer").$$render(t,{cls:Dt("slider",pr,A),style:C,customDescription:!0,customActions:"slider",hasInnerFocusable:!0,json:ft,origJson:mt,templateContext:ht,layoutParams:yt},{},{default:({focusHandler:t,blurHandler:e})=>{var r,i,n,o,a,s;return`<div${L("class",pr["slider__tracks-wrapper"],0)}><div${L("class",pr["slider__tracks-inner"],0)}${L("this",kt,0)}><div${L("class",pr.slider__track,0)}${H({height:dt(Nt.height),"border-radius":dt(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div> <div${L("class",pr["slider__active-track"],0)}${H({left:(100*E).toFixed(2)+"%",width:(100*k).toFixed(2)+"%",height:dt(zt.height),"border-radius":dt(zt.borderRadius),background:zt.background,"box-shadow":zt.boxShadow||""})}></div> ${N(Vt,(t=>`<div class="${I(pr.slider__tick,!0)+" "+I(pr.slider__tick_active,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} ${N(jt,(t=>`<div class="${I(pr.slider__tick,!0)+" "+I(pr.slider__tick_inactive,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} <div${L("class",pr.slider__thumb,0)}${H({"border-radius":dt(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}>${Pt?`<div${L("class",pr["slider__thumb-text"],0)}><div${L("class",pr["slider__thumb-text-inner"],0)}${H({"font-size":(null===(r=Pt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(i=Pt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(n=Pt)||void 0===n?void 0:n.textColor)||"#000"})}>${I(St)}</div></div>`:""}</div> ${Ft?`<div class="${I(pr.slider__thumb,!0)+" "+I(pr.slider__thumb_secondary,!0)}"${H({"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Ut?`<div class="${I(pr["slider__thumb-text"],!0)+" "+I(pr["slider__thumb-text_secondary"],!0)}"><div${L("class",pr["slider__thumb-text-inner"],0)}${H({"font-size":(null===(o=Ut)||void 0===o?void 0:o.fontSize)||"1em","font-weight":(null===(a=Ut)||void 0===a?void 0:a.fontWeight)||"",color:(null===(s=Ut)||void 0===s?void 0:s.textColor)||"#000"})}>${I(It)}</div></div>`:""}</div>`:""} <input type="range"${L("class",pr.slider__input,0)}${L("min",Et,0)}${L("max",Ct,0)} step="1"${L("value",St,0)}${L("aria-label",Lt,0)}${L("this",undefined,0)}> ${Ft?`<input type="range"${L("class",`${pr.slider__input} ${pr.slider__input_secondary}`,0)}${L("min",Et,0)}${L("max",Ct,0)} step="1"${L("value",It,0)}${L("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),Fr={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 Vr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Vr(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 Dr(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 jr{constructor(t){this.char=t}}class Pr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class Sr{constructor(t){Dr(this,"filters",new Map),Dr(this,"destructedValue",[]),Dr(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 jr)t+=r.char;else if(r instanceof Pr)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 Pr&&!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 Pr(null,this.filters.get(e.key),e.placeholder):new jr(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=Vr(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 Pr&&++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 Pr&&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 Pr&&(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 Pr);)++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 Pr&&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 Pr&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof Pr);)++e;return e}}class Or extends Sr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function Ir(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 Tr extends Sr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),Ir(this,"currencyFormatter",new Intl.NumberFormat),Ir(this,"decimalSeparator","."),Ir(this,"localeDigits",{}),Ir(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=Vr(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 Mr(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 Nr(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=Mr(i);if(e<=n)return void Nr(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 zr=U(((t,e,r,i)=>{let n,a,s,u,d,p,v,h,m,y,b,_,w,x,k,E,C,A,F,V,D,j,P,S,O,T,M,N,z,J,R,U,W,H,q,G,Z,Y,X,Q,K,tt,et,rt,it=o,nt=o;var ot;let{json:lt={}}=e,{templateContext:ct}=e,{origJson:gt}=e,{layoutParams:ft}=e;const ht=f(at);let mt,yt=null;const bt=lt.text_variable,_t=null===(ot=lt.mask)||void 0===ot?void 0:ot.raw_text_variable;let wt=!1;bt||(wt=!0,ht.logError(st(new Error('Missing "text_variable" in "input"'))));let $t=bt&&ht.getVariable(bt,"string")||Er("temp","string","");y=l($t,(t=>m=t));let xt=_t&&ht.getVariable(_t,"string")||Er("temp","string","");_=l(xt,(t=>b=t));let kt="",Et="";A=l(ht.getDerivedFromVars(lt.mask),(t=>C=t)),tt=l(ht.getDerivedFromVars(lt.hint_text),(t=>K=t)),Q=l(ht.getDerivedFromVars(lt.hint_color),(t=>X=t));let Ct="";Y=l(ht.getDerivedFromVars(lt.font_size),(t=>Z=t));let At,Ft=12;G=l(ht.getDerivedFromVars(lt.font_weight),(t=>q=t)),H=l(ht.getDerivedFromVars(lt.font_family),(t=>W=t));let Vt,jt="";U=l(ht.getDerivedFromVars(lt.line_height),(t=>R=t)),J=l(ht.getDerivedFromVars(lt.letter_spacing),(t=>z=t));let Ot="";N=l(ht.getDerivedFromVars(lt.text_color),(t=>M=t));let It="#000";T=l(ht.getDerivedFromVars(lt.highlight_color),(t=>O=t));let Mt="";S=l(ht.getDerivedFromVars(lt.text_alignment_horizontal),(t=>P=t));let Nt="left";j=l(ht.getDerivedFromVars(lt.text_alignment_vertical),(t=>D=t));let zt="center";V=l(ht.getDerivedFromVars(lt.keyboard_type),(t=>F=t));const Bt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let Jt="multi_line_text",Rt="text";const Lt="undefined"!=typeof document&&"inputMode"in document.createElement("input");let Wt;E=l(ht.getDerivedFromVars(lt.max_visible_lines),(t=>k=t));let Ht="",qt=null,Gt="",Zt="",Xt="";function Qt(t){mt instanceof HTMLInputElement?mt.selectionStart=mt.selectionEnd=t:Nr(mt,t)}async function Kt(){if(!mt||!yt)return;yt.overrideRawValue(b),xt.set(yt.rawValue),c($t,m=kt=Et=yt.value,m);const t=yt.cursorPosition;await $(),document.activeElement===mt&&Qt(t)}var te;rt=l(ht.getDerivedFromVars(lt.select_all_on_focus),(t=>et=t)),g((()=>{lt.id&&ht.unregisterFocusable(lt.id)})),void 0===e.json&&r.json&&void 0!==lt&&r.json(lt),void 0===e.templateContext&&r.templateContext&&void 0!==ct&&r.templateContext(ct),void 0===e.origJson&&r.origJson&&void 0!==gt&&r.origJson(gt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ft&&r.layoutParams(ft),"fixed_length"===(null==(te=C)?void 0:te.type)?yt=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 Or(i,e)}return r||null}(te,ht.logError,yt):"currency"===(null==te?void 0:te.type)&&(yt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new Tr(t.locale,e)}(te,ht.logError,yt)),yt&&Kt(),yt||kt===m||(kt=Et=m),yt&&yt.rawValue!==b&&Kt(),n=K,Ct=vt(X,1,Ct),Ft=ie(Z,Ft),At=oe(q,At),jt=W&&"string"==typeof W?ht.typefaceProvider(W,{fontWeight:At||400}):"";{const t=R;Yt(t)&&(Vt=t/Ft)}return St(z)&&(Ot=dt(z)),It=vt(M,1,It),Mt=vt(O,1,Mt),Nt=le(P,Nt),zt=ce(D,zt),F&&F in Bt&&(Rt=Bt[F],Jt=F),"currency"===(null==C?void 0:C.type)&&(Rt=Lt?"text":"tel",Wt="decimal"),a="multi_line_text"===Jt,s=ht.getDerivedFromVars(lt.paddings),nt(),nt=l(s,(t=>x=t)),Yt(k)&&(Ht=`calc(${k*(Vt||1.25)*(Ft/10)+"em"} + ${pt(Tt(null==x?void 0:x.top,0)+Tt(null==x?void 0:x.bottom,0))})`),qt=Ut(x||void 0,qt),Gt=qt?Pt({top:(Number(qt.top)||0)/Ft*10,right:(Number(qt.right)||0)/Ft*10,bottom:(Number(qt.bottom)||0)/Ft*10,left:(Number(qt.left)||0)/Ft*10}):"",Zt=qt?Pt({top:(Number(qt.top)||0)/Ft*10,bottom:(Number(qt.bottom)||0)/Ft*10}):"",u=ht.getDerivedFromVars(lt.accessibility),it(),it=l(u,(t=>w=t)),(null==w?void 0:w.description)?Xt=w.description:ht.logError(st(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(Mt),multiline:a,"alignment-horizontal":Nt,"alignment-vertical":zt},p={"--divkit-input-hint-color":Ct,"--divkit-input-highlight-color":Mt,"--divkit-input-line-height":Vt,"font-weight":At,"font-family":jt,"letter-spacing":Ot,color:It,"max-height":Ht},v={"font-size":dt(Ft),padding:Gt},h={"font-size":dt(Ft),padding:Zt},y(),_(),it(),nt(),E(),A(),V(),j(),S(),T(),N(),J(),U(),H(),G(),Y(),Q(),tt(),rt(),wt?"":`${B(ee,"Outer").$$render(t,{cls:Dt("input",Fr,d),style:p,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,json:lt,origJson:gt,templateContext:ct,layoutParams:ft},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return a?`<span${L("class",Fr["input__scroll-wrapper"],0)}>${!Et&&n?`<div${L("class",Fr.input__placeholder,0)} aria-hidden="true"${L("style",ut(v),0)}>${I(n)}</div>`:""} <span aria-hidden="true"${L("style",ut(h),0)}></span> <span${L("class",Dt("input__input",Fr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${L("aria-label",Xt,0)}${L("style",ut(v),0)}${L("this",mt,0)}>${i=Et,void 0===i?"":i}</span></span>`:`<input${L("type",Rt,0)}${L("inputmode",Wt,0)}${L("class",Dt("input__input",Fr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",Xt,0)}${L("style",ut(v),0)}${L("placeholder",n,0)}${L("value",kt,0)}${L("this",mt,0)}>`;var i}})}`})),Br={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"},Jr=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k,E,C,A,F,V,D,j,P,S,O,T=o,M=o,{json:z={}}=e,{templateContext:J}=e,{origJson:R}=e,{layoutParams:U}=e;const W=f(at),H=z.value_variable;let q=!1;H||(q=!0,W.logError(st(new Error('Missing "value_variable" in "select"')))),O=l(H&&W.getVariable(H,"string")||Er("temp","string",""),(t=>S=t));let G="";const Z=z.options,Y=Array.isArray(Z)&&Z.filter((t=>"string"==typeof t.value))||[];Array.isArray(Y)&&Y.length||W.logError(st(new Error('Empty selection "items" in "select"')));let X="",Q=null,K="";j=l(W.getDerivedFromVars(z.hint_text),(t=>D=t)),V=l(W.getDerivedFromVars(z.hint_color),(t=>F=t));let tt="rgba(0,0,0,.45)";A=l(W.getDerivedFromVars(z.font_size),(t=>C=t));let et,rt=12;E=l(W.getDerivedFromVars(z.font_weight),(t=>k=t)),x=l(W.getDerivedFromVars(z.font_family),(t=>$=t));let it,nt="";w=l(W.getDerivedFromVars(z.line_height),(t=>_=t)),b=l(W.getDerivedFromVars(z.letter_spacing),(t=>y=t));let ot="";m=l(W.getDerivedFromVars(z.text_color),(t=>h=t));let lt="#000",ct="";g((()=>{z.id&&W.unregisterFocusable(z.id)})),void 0===e.json&&r.json&&void 0!==z&&r.json(z),void 0===e.templateContext&&r.templateContext&&void 0!==J&&r.templateContext(J),void 0===e.origJson&&r.origJson&&void 0!==R&&r.origJson(R),void 0===e.layoutParams&&r.layoutParams&&void 0!==U&&r.layoutParams(U),G=S;{const t=Y.find((t=>t.value===S));t?X="string"==typeof t.text?t.text:t.value:(X="",S&&W.logError(st(new Error('Value from the variable was not found in the selection items for "select"'))))}n=W.getDerivedFromVars(z.paddings),M(),M=l(n,(t=>P=t)),rt=ie(C,rt),Q=Ut(P||void 0,Q),K=Q?Pt({top:(Number(Q.top)||0)/rt*10,right:(Number(Q.right)||0)/rt*10,bottom:(Number(Q.bottom)||0)/rt*10,left:(Number(Q.left)||0)/rt*10}):"",a=D,tt=vt(F,1,tt),et=oe(k,et),nt=$&&"string"==typeof $?W.typefaceProvider($,{fontWeight:et||400}):"";{const t=_;Yt(t)&&(it=t/rt)}return St(y)&&(ot=dt(y/rt*10)),lt=vt(h,1,lt),s=W.getDerivedFromVars(z.accessibility),T(),T=l(s,(t=>v=t)),(null==v?void 0:v.description)?ct=v.description:W.logError(st(new Error('Missing accessibility "description" for select'),{level:"warn"})),c={hint:!X},u={"--divkit-input-hint-color":tt,"font-weight":et,"font-family":nt,color:lt},d={padding:K,"font-size":dt(rt),"line-height":it,"letter-spacing":ot},p={"font-size":dt(rt),"line-height":it,"letter-spacing":ot},T(),m(),b(),w(),x(),E(),A(),V(),j(),M(),O(),q?"":`${B(ee,"Outer").$$render(t,{cls:Dt("select",Br,c),style:u,customDescription:!0,customActions:"select",customPaddings:!0,hasInnerFocusable:!0,json:z,origJson:R,templateContext:J,layoutParams:U},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${L("class",Br["select__select-text"],0)}${L("style",ut(d),0)} aria-hidden="true"> ${I(X||a||"")}</span> <select${L("class",Dt("select__select",Br,{"has-custom-focus":t}),0)}${L("aria-label",ct,0)}${L("style",ut(p),0)}${L("this",undefined,0)}>${N(Y,(t=>`<option${L("class",Br.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),Rr={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},Ur=U(((t,e,r,i)=>{let n,a,s,c,u,d,p,v,h,m,y,b,_,w,$,x,k=o,E=o,{json:C={}}=e,{templateContext:A}=e,{origJson:F}=e,{layoutParams:V}=e;const D=f(at);let j,P=!1,S=!1;x=l(D.getDerivedFromVars(C.video_sources),(t=>$=t));let O=[];w=l(D.getDerivedFromVars(C.repeatable),(t=>_=t));let I=!1;b=l(D.getDerivedFromVars(C.autostart),(t=>y=t));let T=!1;m=l(D.getDerivedFromVars(C.muted),(t=>h=t));let M,z=!1;v=l(D.getDerivedFromVars(C.preview),(t=>p=t));let J="fit",R="0";const U=C.elapsed_time_variable;var W,q;(U&&D.getVariable(U,"integer")||Er("temp","integer",0)).subscribe((t=>{S&&(S=!1)})),!C.id||P||(null==V?void 0:V.fakeElement)||D.registerInstance(C.id,{pause(){},start(){}}),g((()=>{!C.id||P||(null==V?void 0:V.fakeElement)||D.unregisterInstance(C.id)})),void 0===e.json&&r.json&&void 0!==C&&r.json(C),void 0===e.templateContext&&r.templateContext&&void 0!==A&&r.templateContext(A),void 0===e.origJson&&r.origJson&&void 0!==F&&r.origJson(F),void 0===e.layoutParams&&r.layoutParams&&void 0!==V&&r.layoutParams(V),W=$,q=O,O=Array.isArray(W)&&W.length?W.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})):q,O.length?P=!1:(P=!0,D.logError(st(new Error('Missing "video_sources" in "video"')))),I=ue(_,I),T=ue(y,T),z=ue(h,z),M="string"==typeof p?Oe(p):M,n=D.getDerivedFromVars(C.scale),E(),E=l(n,(t=>d=t)),J=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(d)||J,a=D.getDerivedFromVars(C.aspect),k(),k=l(a,(t=>u=t));{const t=null==u?void 0:u.ratio;R=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return s={aspect:"0"!==R},c={"object-fit":J},k(),E(),v(),m(),b(),w(),x(),P?"":`${B(ee,"Outer").$$render(t,{cls:Dt("video",Rr,s),customActions:"video",json:C,origJson:F,templateContext:A,layoutParams:V},{},{default:()=>s.aspect?`<div${L("class",Rr["video__aspect-wrapper"],0)}${H({"padding-bottom":`${R}%`})}><video${L("class",Rr.video__video,0)}${L("style",ut(c),0)} playsinline ${I?"loop":""} ${T?"autoplay":""} ${z?"muted":""}${L("poster",M,0)}${L("this",j,0)}>${N(O,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video></div>`:`<video${L("class",Rr.video__video,0)}${L("style",ut(c),0)} playsinline ${I?"loop":""} ${T?"autoplay":""} ${z?"muted":""}${L("poster",M,0)}${L("this",j,0)}>${N(O,(t=>`<source${L("src",t.src,0)}${L("type",t.type,0)}>`))}</video>`})}`})),Lr=Ur,Wr=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 g=null,v="",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(g=p.customComponents.get(l.custom_type),"function"==typeof g.template){const t=p.getExtensionContext(),e=new Map;for(const[r,i]of t.variables)e.set(r,i.getValue());v=g.template({props:l.custom_props,variables:e})}else v=g.template&&"string"==typeof g.template?g.template:"";h={shadowrootmode:g.shadowRootMode||"open"}}else g=null,v=";",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},g?`${B(ee,"Outer").$$render(t,{json:l,origJson:u,templateContext:c,layoutParams:d},{},{default:()=>{return(e=g.element)?`<${g.element}${P([M(l.custom_props||{})],{})}${L("this",undefined,0)}>${D(e)?"":`${v?`<template${P([M(h)],{})}> ${v}</template>`:""} ${!m&&n?`${N(o,(e=>`${B(qr,"Unknown").$$render(t,{layoutParams:a,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`:""}`}${D(e)?"":`</${e}>`}`:"";var e}})}`:""})),Hr={};Hr.text=ge,Hr.container=Ve,Hr.separator=Pe,Hr.image=Te,Hr.gif=Te,Hr.grid=Re,Hr.gallery=qe,Hr.tabs=Ye,Hr.state=or,Hr.pager=lr,Hr.indicator=dr,Hr.slider=Ar,Hr.input=zr,Hr.select=Jr,Hr.video=Lr,Hr.custom=Wr;const qr=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&&Hr[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Hr[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||z,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||n},{},{})}`:""})),Gr=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>${N([...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 Zr(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 Yr(){}function Xr(t){return{subscribe:e=>(e(t),Yr)}}function Qr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Kr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function ti(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 ei(t){try{return br(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function ri(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ii(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,ii.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function ni(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function oi(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Ae,JsonStringContents:function(){var t,e,r;for(t=ve,e=[],r=Fe();r!==i;)e.push(r),r=Fe();return fe=t,e=jt(e)}},a=Ae,s="@{",l="}",c="@{}",u="\\",d="?",p=":",g="||",v="&&",f="==",h="!=",m=">=",y=">",b="<=",_="<",w="+",$="-",x="/",k="*",E="%",C="!",A="(",F=")",V=",",D="'",j=".",P="e",S="E",O="true",I="false",T=/^[^}]/,M=/^[^'}]/,N=/^[0-9]/,z=/^[a-zA-Z_0-9.]/,B=/^[a-zA-Z_]/,J=/^[ \t\r\n]/,R=we("@{",!1),U=we("}",!1),L=we("@{}",!1),W=we("\\",!1),H={type:"any"},q=$e(["}"],!0,!1),G=we("?",!1),Z=we(":",!1),Y=we("||",!1),X=we("&&",!1),Q=we("==",!1),K=we("!=",!1),tt=we(">=",!1),et=we(">",!1),rt=we("<=",!1),it=we("<",!1),nt=we("+",!1),ot=we("-",!1),at=we("/",!1),st=we("*",!1),lt=we("%",!1),ct=we("!",!1),ut=we("(",!1),dt=we(")",!1),pt=we(",",!1),gt=xe("string"),vt=we("'",!1),ft=$e(["'","}"],!0,!1),ht=xe("integer"),mt=$e([["0","9"]],!1,!1),yt=xe("number"),bt=we(".",!1),_t=we("e",!1),wt=we("E",!1),$t=xe("boolean"),xt=we("true",!1),kt=we("false",!1),Et=$e([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ct=xe("identifier"),At=$e([["a","z"],["A","Z"],"_"],!1,!1),Ft=xe("whitespace"),Vt=$e([" ","\t","\r","\n"],!1,!1),Dt=function(t){return t},jt=function(t){return ti(t)},Pt=function(t){return t},St=function(){return""},Ot=function(){return _e()},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},Mt=function(t){return t},Nt=function(t){return ri(t)},zt=function(){throw new Error("Error tokenizing '"+t+"'.")},Bt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Jt=function(t,e){return Kr(t,e)},Rt=function(t,e){return Kr(t,e)},Ut=function(t,e){return Qr(t,e)},Lt=function(t,e){return Qr(t,e)},Wt=function(t,e){return Qr(t,e)},Ht=function(t,e){return Qr(t,e)},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t){return{type:"Variable",id:t}},Yt=function(t,e){return[t,...e]},Xt=function(t){return t},Qt=function(t){return t},Kt=function(t){return ti(t)},te=function(t){return t},ee=function(){return""},re=function(){return _e()},ie=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ae=function(t){return ri(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:ei(_e())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},de=function(){return{type:"BooleanLiteral",value:!0}},pe=function(){return{type:"BooleanLiteral",value:!1}},ge=function(){return{type:"Identifier",name:_e()}},ve=0,fe=0,he=[{line:1,column:1}],me=0,ye=[],be=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 _e(){return t.substring(fe,ve)}function we(t,e){return{type:"literal",text:t,ignoreCase:e}}function $e(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function xe(t){return{type:"other",description:t}}function ke(e){var r,i=he[e];if(i)return i;for(r=e-1;!he[r];)r--;for(i={line:(i=he[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return he[e]=i,i}function Ee(t,e,r){var i=ke(t),o=ke(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 Ce(t){ve<me||(ve>me&&(me=ve,ye=[]),ye.push(t))}function Ae(){var t,e;return t=ve,Je(),(e=Ve())!==i?(Je(),fe=t,t=Dt(e)):(ve=t,t=i),t}function Fe(){var e,r,n,o,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(R)),r!==i?(n=Je(),(o=Ve())!==i?(Je(),125===t.charCodeAt(ve)?(a=l,ve++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=Pt(o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=St()),(e=r)===i&&(e=ve,r=ve,be++,92===t.charCodeAt(ve)?(n=u,ve++):(n=i,0===be&&Ce(W)),n===i&&(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(R))),be--,n===i?r=void 0:(ve=r,r=i),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Ot()):(ve=e,e=i)):(ve=e,e=i),e===i))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(R)),r!==i){if(n=[],T.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(q)),o!==i)for(;o!==i;)n.push(o),T.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(q));else n=i;n!==i?(125===t.charCodeAt(ve)?(o=l,ve++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=It()):(ve=e,e=i)):(ve=e,e=i)}else ve=e,e=i;e===i&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(R)),r!==i&&(fe=e,r=Tt()),(e=r)===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(R)),n!==i?(fe=e,e=Mt(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Nt(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=zt()),e=r))))}return e}function Ve(){var e,r,n,o,a,s;return e=ve,(r=De())!==i?(Je(),63===t.charCodeAt(ve)?(n=d,ve++):(n=i,0===be&&Ce(G)),n!==i?(Je(),(o=Ve())!==i?(Je(),58===t.charCodeAt(ve)?(a=p,ve++):(a=i,0===be&&Ce(Z)),a!==i?(Je(),(s=Ve())!==i?(fe=e,e=Bt(r,o,s)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=De()),e}function De(){var e,r,n,o,a,s,l,c;if(e=ve,(r=je())!==i){for(n=[],o=ve,a=Je(),t.substr(ve,2)===g?(s=g,ve+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Je(),(c=je())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Je(),t.substr(ve,2)===g?(s=g,ve+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Je(),(c=je())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Jt(r,n)}else ve=e,e=i;return e}function je(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Pe())!==i){for(n=[],o=ve,a=Je(),t.substr(ve,2)===v?(s=v,ve+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Je(),(c=Pe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Je(),t.substr(ve,2)===v?(s=v,ve+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Je(),(c=Pe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Rt(r,n)}else ve=e,e=i;return e}function Pe(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Se())!==i){for(n=[],o=ve,a=Je(),t.substr(ve,2)===f?(s=f,ve+=2):(s=i,0===be&&Ce(Q)),s===i&&(t.substr(ve,2)===h?(s=h,ve+=2):(s=i,0===be&&Ce(K))),s!==i?(l=Je(),(c=Se())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Je(),t.substr(ve,2)===f?(s=f,ve+=2):(s=i,0===be&&Ce(Q)),s===i&&(t.substr(ve,2)===h?(s=h,ve+=2):(s=i,0===be&&Ce(K))),s!==i?(l=Je(),(c=Se())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Ut(r,n)}else ve=e,e=i;return e}function Se(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Oe())!==i){for(n=[],o=ve,a=Je(),t.substr(ve,2)===m?(s=m,ve+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ve)?(s=y,ve++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ve,2)===b?(s=b,ve+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ve)?(s=_,ve++):(s=i,0===be&&Ce(it))))),s!==i?(l=Je(),(c=Oe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Je(),t.substr(ve,2)===m?(s=m,ve+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ve)?(s=y,ve++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ve,2)===b?(s=b,ve+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ve)?(s=_,ve++):(s=i,0===be&&Ce(it))))),s!==i?(l=Je(),(c=Oe())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Lt(r,n)}else ve=e,e=i;return e}function Oe(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Ie())!==i){for(n=[],o=ve,a=Je(),43===t.charCodeAt(ve)?(s=w,ve++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ve)?(s=$,ve++):(s=i,0===be&&Ce(ot))),s!==i?(l=Je(),(c=Ie())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Je(),43===t.charCodeAt(ve)?(s=w,ve++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ve)?(s=$,ve++):(s=i,0===be&&Ce(ot))),s!==i?(l=Je(),(c=Ie())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Wt(r,n)}else ve=e,e=i;return e}function Ie(){var e,r,n,o,a,s,l,c;if(e=ve,(r=Te())!==i){for(n=[],o=ve,a=Je(),47===t.charCodeAt(ve)?(s=x,ve++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ve)?(s=k,ve++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Je(),(c=Te())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,a=Je(),47===t.charCodeAt(ve)?(s=x,ve++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ve)?(s=k,ve++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ve)?(s=E,ve++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Je(),(c=Te())!==i?o=a=[a,s,l,c]:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Ht(r,n)}else ve=e,e=i;return e}function Te(){var e,r,n;return(e=ze())===i&&(e=Ne())===i&&(e=ve,33===t.charCodeAt(ve)?(r=C,ve++):(r=i,0===be&&Ce(ct)),r===i&&(43===t.charCodeAt(ve)?(r=w,ve++):(r=i,0===be&&Ce(nt)),r===i&&(45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)))),r!==i?(Je(),(n=Te())!==i?(fe=e,e=qt(r,n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=ve,(r=Be())!==i?(Je(),40===t.charCodeAt(ve)?(n=A,ve++):(n=i,0===be&&Ce(ut)),n!==i?(Je(),o=function(){var e,r,n,o,a,s;if(e=ve,(r=Ve())!==i){for(n=[],o=ve,Je(),44===t.charCodeAt(ve)?(a=V,ve++):(a=i,0===be&&Ce(pt)),a!==i?(Je(),(s=Ve())!==i?o=s:(ve=o,o=i)):(ve=o,o=i);o!==i;)n.push(o),o=ve,Je(),44===t.charCodeAt(ve)?(a=V,ve++):(a=i,0===be&&Ce(pt)),a!==i?(Je(),(s=Ve())!==i?o=s:(ve=o,o=i)):(ve=o,o=i);fe=e,e=Yt(r,n)}else ve=e,e=i;return e===i&&(e=Je()),e}(),o!==i?(Je(),41===t.charCodeAt(ve)?(a=F,ve++):(a=i,0===be&&Ce(dt)),a!==i?(fe=e,e=Gt(r,o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,(r=Be())!==i&&(fe=e,r=Zt(r)),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return be++,e=ve,39===t.charCodeAt(ve)?(r=D,ve++):(r=i,0===be&&Ce(vt)),r!==i?(n=function(){var t,e,r;for(t=ve,e=[],r=Me();r!==i;)e.push(r),r=Me();return fe=t,t=e=Kt(e)}(),39===t.charCodeAt(ve)?(o=D,ve++):(o=i,0===be&&Ce(vt)),o!==i?(fe=e,e=Qt(n)):(ve=e,e=i)):(ve=e,e=i),be--,e===i&&(r=i,0===be&&Ce(gt)),e}(),e===i&&(e=ze())===i&&(e=Ne())===i&&(e=function(){var e,r;return be++,e=ve,t.substr(ve,4)===O?(r=O,ve+=4):(r=i,0===be&&Ce(xt)),r!==i&&(fe=e,r=de()),(e=r)===i&&(e=ve,t.substr(ve,5)===I?(r=I,ve+=5):(r=i,0===be&&Ce(kt)),r!==i&&(fe=e,r=pe()),e=r),be--,e===i&&(r=i,0===be&&Ce($t)),e}(),e===i&&(e=ve,40===t.charCodeAt(ve)?(r=A,ve++):(r=i,0===be&&Ce(ut)),r!==i&&(n=Ve())!==i?(41===t.charCodeAt(ve)?(o=F,ve++):(o=i,0===be&&Ce(dt)),o!==i?(fe=e,e=Xt(n)):(ve=e,e=i)):(ve=e,e=i))),e}())),e}())),e}function Me(){var e,r,n,o,a;if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(R)),r!==i?(n=Je(),(o=Ve())!==i?(Je(),125===t.charCodeAt(ve)?(a=l,ve++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=te(o)):(ve=e,e=i)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,t.substr(ve,3)===c?(r=c,ve+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=ee()),(e=r)===i&&(e=ve,r=ve,be++,92===t.charCodeAt(ve)?(n=u,ve++):(n=i,0===be&&Ce(W)),n===i&&(39===t.charCodeAt(ve)?(n=D,ve++):(n=i,0===be&&Ce(vt)),n===i&&(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(R)))),be--,n===i?r=void 0:(ve=r,r=i),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=re()):(ve=e,e=i)):(ve=e,e=i),e===i))){if(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(R)),r!==i){if(n=[],M.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(ft)),o!==i)for(;o!==i;)n.push(o),M.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(ft));else n=i;n!==i?(125===t.charCodeAt(ve)?(o=l,ve++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=ie()):(ve=e,e=i)):(ve=e,e=i)}else ve=e,e=i;e===i&&(e=ve,t.substr(ve,2)===s?(r=s,ve+=2):(r=i,0===be&&Ce(R)),r!==i&&(fe=e,r=ne()),(e=r)===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ve,2)===s?(n=s,ve+=2):(n=i,0===be&&Ce(R)),n!==i?(fe=e,e=oe(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ve?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=ae(n)):(ve=e,e=i)):(ve=e,e=i),e===i&&(e=ve,92===t.charCodeAt(ve)?(r=u,ve++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=se()),e=r))))}return e}function Ne(){var e,r,n,o;if(be++,e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));else n=i;return n!==i?(fe=e,e=le()):(ve=e,e=i),be--,e===i&&(r=i,0===be&&Ce(ht)),e}function ze(){var e,r,n,o,a,s,l,c,u,d;for(be++,e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));if(46===t.charCodeAt(ve)?(o=j,ve++):(o=i,0===be&&Ce(bt)),o!==i){if(a=[],N.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=i,0===be&&Ce(mt)),s!==i)for(;s!==i;)a.push(s),N.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=i,0===be&&Ce(mt));else a=i;if(a!==i){if(s=ve,101===t.charCodeAt(ve)?(l=P,ve++):(l=i,0===be&&Ce(_t)),l===i&&(69===t.charCodeAt(ve)?(l=S,ve++):(l=i,0===be&&Ce(wt))),l!==i){if(43===t.charCodeAt(ve)?(c=w,ve++):(c=i,0===be&&Ce(nt)),c===i&&(45===t.charCodeAt(ve)?(c=$,ve++):(c=i,0===be&&Ce(ot))),c===i&&(c=null),u=[],N.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=i,0===be&&Ce(mt)),d!==i)for(;d!==i;)u.push(d),N.test(t.charAt(ve))?(d=t.charAt(ve),ve++):(d=i,0===be&&Ce(mt));else u=i;u!==i?s=l=[l,c,u]:(ve=s,s=i)}else ve=s,s=i;s===i&&(s=null),fe=e,e=ce()}else ve=e,e=i}else ve=e,e=i;if(e===i){if(e=ve,45===t.charCodeAt(ve)?(r=$,ve++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),N.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(mt));else n=i;if(n!==i)if(101===t.charCodeAt(ve)?(o=P,ve++):(o=i,0===be&&Ce(_t)),o===i&&(69===t.charCodeAt(ve)?(o=S,ve++):(o=i,0===be&&Ce(wt))),o!==i){if(43===t.charCodeAt(ve)?(a=w,ve++):(a=i,0===be&&Ce(nt)),a===i&&(45===t.charCodeAt(ve)?(a=$,ve++):(a=i,0===be&&Ce(ot))),a===i&&(a=null),s=[],N.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=i,0===be&&Ce(mt)),l!==i)for(;l!==i;)s.push(l),N.test(t.charAt(ve))?(l=t.charAt(ve),ve++):(l=i,0===be&&Ce(mt));else s=i;s!==i?(fe=e,e=ue()):(ve=e,e=i)}else ve=e,e=i;else ve=e,e=i}return be--,e===i&&(r=i,0===be&&Ce(yt)),e}function Be(){var e,r,n,o,a;if(be++,e=ve,r=ve,be++,n=function(){var e,r,n,o;return e=ve,t.substr(ve,4)===O?(r=O,ve+=4):(r=i,0===be&&Ce(xt)),r===i&&(t.substr(ve,5)===I?(r=I,ve+=5):(r=i,0===be&&Ce(kt))),r!==i?(n=ve,be++,z.test(t.charAt(ve))?(o=t.charAt(ve),ve++):(o=i,0===be&&Ce(Et)),be--,o===i?n=void 0:(ve=n,n=i),n!==i?e=r=[r,n]:(ve=e,e=i)):(ve=e,e=i),e}(),be--,n===i?r=void 0:(ve=r,r=i),r!==i)if(B.test(t.charAt(ve))?(n=t.charAt(ve),ve++):(n=i,0===be&&Ce(At)),n!==i){for(o=[],z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=i,0===be&&Ce(Et));a!==i;)o.push(a),z.test(t.charAt(ve))?(a=t.charAt(ve),ve++):(a=i,0===be&&Ce(Et));fe=e,e=ge()}else ve=e,e=i;else ve=e,e=i;return be--,e===i&&(r=i,0===be&&Ce(Ct)),e}function Je(){var e,r;for(be++,e=[],J.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=i,0===be&&Ce(Vt));r!==i;)e.push(r),J.test(t.charAt(ve))?(r=t.charAt(ve),ve++):(r=i,0===be&&Ce(Vt));return be--,r=i,0===be&&Ce(Ft),e}if((r=a())!==i&&ve===t.length)return r;throw r!==i&&ve<t.length&&Ce({type:"end"}),function(t,e,r){return new ii(ii.buildMessage(t,e),t,e,r)}(ye,me<t.length?t.charAt(me):null,me<t.length?Ee(me,me+1):Ee(me,me))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(ii,Error),ii.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=ni("",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+" | "+ni("",n.column-1," ")+ni("",u,"^")}else e+="\n at "+a}return e},ii.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 ai=new Map,si=new Map;function li(t,e,r){const i={args:e,cb:r},n=ai.get(t)||[];ai.has(t)||ai.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");si.set(o,i)}function ci(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 ui(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=>{ui(t,e)}));break;case"BinaryExpression":case"LogicalExpression":ui(t.left,e),ui(t.right,e);break;case"UnaryExpression":ui(t.argument,e);break;case"ConditionalExpression":ui(t.test,e),ui(t.consequent,e),ui(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{ui(t,e)}))}}function di(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function pi(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function gi(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 pi(t.value);if("color"===t.type)return wi(_i(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 vi(t){let e=gi(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function fi(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function hi(t,e){if(fr)return br(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function mi(t,e){if(e<yr||e>mr)throw new Error("Integer overflow.");!fr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function yi(t){const e=[];return ui(t,{Variable(t){e.push(t.id.name)}}),e}function bi(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function _i(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function wi(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 gt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function $i(t){return wi(_i(t))}const xi=Number.MAX_VALUE,ki=Number.MIN_VALUE,Ei="string",Ci="integer",Ai="number",Fi="boolean",Vi="color",Di="url",ji="datetime",Pi="dict",Si="array";function Oi(t,e){return{type:Ei,value:gi(e)}}function Ii(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ai,value:r}}function Ti(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=$i(o)),{type:i,value:o}}function Mi(t,e,r){return Ti(t,e,r,r.type)}function Ni(t,e,r){return Ti(t,e,r,"color")}function zi(t,e,r){return Ti(t,e,r,"url")}const Bi=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:Ci,value:br(i)}},Ji=Bi("getUTCFullYear"),Ri=Bi("getUTCMonth"),Ui=Bi("getUTCDate"),Li=Bi("getUTCDay"),Wi=Bi("getUTCHours"),Hi=Bi("getUTCMinutes"),qi=Bi("getUTCSeconds"),Gi=Bi("getUTCMilliseconds");function Zi(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===Ei?e.value:gi(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 Yi(t,e,r,i){const n=Zi(t,e,r,i);return{type:Ei,value:n+gi(e)}}function Xi(t,e,r,i){const n=Zi(t,e,r,i);return{type:Ei,value:gi(e)+n}}function Qi(t){return(e,r)=>{const i=_i(r.value);return{type:Ai,value:i[t]/255}}}function Ki(t){return(e,r,i)=>{const n=_i(r.value);return n[t]=255*i.value,{type:Vi,value:wi(n)}}}const tn=Qi("a"),en=Qi("r"),rn=Qi("g"),nn=Qi("b"),on=Ki("a"),an=Ki("r"),sn=Ki("g"),ln=Ki("b");function cn(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=br(e.value)/br(r);return mi(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=br(n)%br(i)),{type:Ci,value:n}}const un=36e5;function dn(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.");mi(r,o)}return"string"===t&&"color"===e&&(o=$i(o)),{type:e,value:o}}}function pn(t,e){return(r,i,n,...o)=>{try{return t(r,n,...o)}catch(t){let r=i.value;return"color"===e&&(r=$i(r)),{type:e,value:r}}}}const gn=dn("string","string"),vn=dn("number","number"),fn=dn("number","integer"),hn=dn("boolean","boolean"),mn=dn("string","color"),yn=dn("string","url"),bn=pn(gn,"string"),_n=pn(vn,"number"),wn=pn(fn,"integer"),$n=pn(hn,"boolean"),xn=pn(mn,"color"),kn=pn(yn,"url");function En(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||"obejct"===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.");mi(r,o)}return"string"===t&&"color"===e&&(o=$i(o)),{type:e,value:o}}}function Cn(t,e){return(r,i,n,o)=>{try{return t(r,i,n)}catch(t){let r=o.value;return"color"===e&&(r=$i(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=En("array","array"),On=En("object","dict"),In=Cn(An,"string"),Tn=Cn(Fn,"number"),Mn=Cn(Vn,"integer"),Nn=Cn(Dn,"boolean"),zn=Cn(jn,"color"),Bn=Cn(Pn,"url");function Jn(t){return t.map(vi).join(", ")}li("toString",[Ci],Oi),li("toString",[Ai],Oi),li("toString",[Fi],Oi),li("toString",[Vi],Oi),li("toString",[Di],Oi),li("toNumber",[Ci],Ii),li("toNumber",[Ei],Ii),li("toInteger",[Ai],(function(t,e){if(e.value>mr||e.value<yr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Ci,value:br(r)}})),li("toInteger",[Ei],(function(t,e){let r;try{r=br(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>mr||r<yr)throw new Error("Unable to convert value to Integer.");return{type:Ci,value:r}})),li("toInteger",[Fi],(function(t,e){return{type:Ci,value:br(e.value?1:0)}})),li("toBoolean",[Ci],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Fi,value:r}})),li("toBoolean",[Ei],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Fi,value:"true"===e.value?1:0}})),li("toColor",[Ei],(function(t,e){return{type:Vi,value:$i(e.value)}})),li("toUrl",[Ei],(function(t,e){return{type:Di,value:e.value}})),li("encodeUri",[Ei],(function(t,e){try{return{type:Ei,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),li("decodeUri",[Ei],(function(t,e){try{return{type:Ei,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),li("getIntegerValue",[Ei,Ci],Mi),li("getNumberValue",[Ei,Ai],Mi),li("getBooleanValue",[Ei,Fi],Mi),li("getStringValue",[Ei,Ei],Mi),li("getColorValue",[Ei,Vi],Ni),li("getColorValue",[Ei,Ei],Ni),li("getUrlValue",[Ei,Di],zi),li("getUrlValue",[Ei,Ei],zi),li("parseUnixTime",[Ci],(function(t,e){return{type:ji,value:new Date(1e3*Number(e.value))}})),li("nowLocal",[],(function(){return{type:ji,value:new Date}})),li("addMillis",[ji,Ci],(function(t,e,r){return{type:ji,value:new Date(e.value.getTime()+Number(r.value))}})),li("setYear",[ji,Ci],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:ji,value:i}})),li("setMonth",[ji,Ci],(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:ji,value:n}})),li("setDay",[ji,Ci],(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 ${gi(e)}.`);return i.setUTCDate(-1===n?0:n),{type:ji,value:i}})),li("setHours",[ji,Ci],(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:ji,value:n}})),li("setMinutes",[ji,Ci],(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:ji,value:n}})),li("setSeconds",[ji,Ci],(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:ji,value:n}})),li("setMillis",[ji,Ci],(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:ji,value:n}})),li("getYear",[ji],Ji),li("getMonth",[ji],Ri),li("getDay",[ji],Ui),li("getDayOfWeek",[ji],Li),li("getHours",[ji],Wi),li("getMinutes",[ji],Hi),li("getSeconds",[ji],qi),li("getMillis",[ji],Gi),li("getIntervalSeconds",[Ci],(function(t,e){return cn(t,e,1e3,60)})),li("getIntervalTotalSeconds",[Ci],(function(t,e){return cn(t,e,1e3)})),li("getIntervalMinutes",[Ci],(function(t,e){return cn(t,e,6e4,60)})),li("getIntervalTotalMinutes",[Ci],(function(t,e){return cn(t,e,6e4)})),li("getIntervalHours",[Ci],(function(t,e){return cn(t,e,un,24)})),li("getIntervalTotalHours",[Ci],(function(t,e){return cn(t,e,un)})),li("getIntervalTotalDays",[Ci],(function(t,e){return cn(t,e,864e5)})),li("getIntervalTotalWeeks",[Ci],(function(t,e){return cn(t,e,6048e5)})),li("len",[Ei],(function(t,e){return{type:Ci,value:br(e.value.length)}})),li("contains",[Ei,Ei],(function(t,e,r){return{type:Fi,value:e.value.includes(r.value)?1:0}})),li("substring",[Ei,Ci,Ci],(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:Ei,value:e.value.substring(Number(r.value),Number(i.value))}})),li("replaceAll",[Ei,Ei,Ei],(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:Ei,value:n}})),li("index",[Ei,Ei],(function(t,e,r){return{type:Ci,value:br(e.value.indexOf(r.value))}})),li("lastIndex",[Ei,Ei],(function(t,e,r){return{type:Ci,value:br(e.value.lastIndexOf(r.value))}})),li("trim",[Ei],(function(t,e){return{type:Ei,value:e.value.trim()}})),li("trimLeft",[Ei],(function(t,e){return{type:Ei,value:e.value.replace(/^\s+/,"")}})),li("trimRight",[Ei],(function(t,e){return{type:Ei,value:e.value.replace(/\s+$/,"")}})),li("toUpperCase",[Ei],(function(t,e){return{type:Ei,value:e.value.toUpperCase()}})),li("toLowerCase",[Ei],(function(t,e){return{type:Ei,value:e.value.toLowerCase()}})),li("padStart",[Ei,Ci,Ei],Yi),li("padStart",[Ci,Ci,Ei],Yi),li("padEnd",[Ei,Ci,Ei],Xi),li("padEnd",[Ci,Ci,Ei],Xi),li("testRegex",[Ei,Ei],(function(t,e,r){let i;try{i=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Fi,value:i.test(e.value)?1:0}})),li("div",[Ci,Ci],(function(t,e,r){if(r.value===_r)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return i=hi(0,i),mi(t,i),{type:Ci,value:i}})),li("div",[Ai,Ai],(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:Ai,value:i}})),li("mod",[Ci,Ci],(function(t,e,r){if(r.value===_r)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return i=hi(0,i),mi(t,i),{type:Ci,value:i}})),li("mod",[Ai,Ai],(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:Ai,value:i}})),li("mul",[{type:Ci,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:_r;for(let i=1;i<e.length;++i)r*=e[i].value,r=hi(0,r),mi(t,r);return{type:Ci,value:r}})),li("mul",[{type:Ai,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:Ai,value:r}})),li("sub",[{type:Ci,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:_r;for(let i=1;i<e.length;++i)r-=e[i].value,r=hi(0,r),mi(t,r);return{type:Ci,value:r}})),li("sub",[{type:Ai,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:Ai,value:r}})),li("sum",[{type:Ci,isVararg:!0}],(function(t,...e){let r=_r;for(let i=0;i<e.length;++i)r+=e[i].value,r=hi(0,r),mi(t,r);return{type:Ci,value:r}})),li("sum",[{type:Ai,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Ai,value:r}})),li("abs",[Ci],(function(t,e){const r=wr(e.value);return mi(t,r),{type:e.type,value:r}})),li("abs",[Ai],(function(t,e){const r=Math.abs(e.value);return{type:Ai,value:r}})),li("max",[{type:Ci,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:Ci,value:r}})),li("max",[{type:Ai,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Ai,value:Math.max(...e.map((t=>t.value)))}})),li("min",[{type:Ci,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:Ci,value:r}})),li("min",[{type:Ai,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Ai,value:Math.min(...e.map((t=>t.value)))}})),li("maxNumber",[],(function(){return{type:Ai,value:xi}})),li("minNumber",[],(function(){return{type:Ai,value:ki}})),li("maxInteger",[],(function(t){return mi(t,mr),{type:Ci,value:mr}})),li("minInteger",[],(function(t){return mi(t,yr),{type:Ci,value:yr}})),li("round",[Ai],(function(t,e){const r=Math.sign(e.value);return{type:Ai,value:r*Math.round(Math.abs(e.value))}})),li("floor",[Ai],(function(t,e){return{type:Ai,value:Math.floor(e.value)}})),li("ceil",[Ai],(function(t,e){return{type:Ai,value:Math.ceil(e.value)}})),li("signum",[Ci],(function(t,e){return{type:Ci,value:$r(e.value)}})),li("signum",[Ai],(function(t,e){return{type:Ai,value:Math.sign(e.value)}})),li("copySign",[Ci,Ci],(function(t,e,r){let i;if(r.value===_r)i=e.value;else if(e.value===_r)i=0;else{const t=$r(r.value);i=wr(e.value)*t}return mi(t,i),{type:Ci,value:i}})),li("copySign",[Ai,Ai],(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:Ai,value:n}})),li("getColorAlpha",[Ei],tn),li("getColorAlpha",[Vi],tn),li("getColorRed",[Ei],en),li("getColorRed",[Vi],en),li("getColorGreen",[Ei],rn),li("getColorGreen",[Vi],rn),li("getColorBlue",[Ei],nn),li("getColorBlue",[Vi],nn),li("setColorAlpha",[Ei,Ai],on),li("setColorAlpha",[Vi,Ai],on),li("setColorRed",[Ei,Ai],an),li("setColorRed",[Vi,Ai],an),li("setColorGreen",[Ei,Ai],sn),li("setColorGreen",[Vi,Ai],sn),li("setColorBlue",[Ei,Ai],ln),li("setColorBlue",[Vi,Ai],ln),li("rgb",[Ai,Ai,Ai],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Vi,value:wi(n)}})),li("argb",[Ai,Ai,Ai,Ai],(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:Vi,value:wi(o)}})),li("getDictString",[Pi,{type:Ei,isVararg:!0}],gn),li("getStringFromDict",[Pi,{type:Ei,isVararg:!0}],gn),li("getDictNumber",[Pi,{type:Ei,isVararg:!0}],vn),li("getNumberFromDict",[Pi,{type:Ei,isVararg:!0}],vn),li("getDictInteger",[Pi,{type:Ei,isVararg:!0}],fn),li("getIntegerFromDict",[Pi,{type:Ei,isVararg:!0}],fn),li("getDictBoolean",[Pi,{type:Ei,isVararg:!0}],hn),li("getBooleanFromDict",[Pi,{type:Ei,isVararg:!0}],hn),li("getDictColor",[Pi,{type:Ei,isVararg:!0}],mn),li("getColorFromDict",[Pi,{type:Ei,isVararg:!0}],mn),li("getDictUrl",[Pi,{type:Ei,isVararg:!0}],yn),li("getUrlFromDict",[Pi,{type:Ei,isVararg:!0}],yn),li("getDictOptString",[Ei,Pi,{type:Ei,isVararg:!0}],bn),li("getOptStringFromDict",[Ei,Pi,{type:Ei,isVararg:!0}],bn),li("getDictOptNumber",[Ai,Pi,{type:Ei,isVararg:!0}],_n),li("getOptNumberFromDict",[Ai,Pi,{type:Ei,isVararg:!0}],_n),li("getDictOptInteger",[Ci,Pi,{type:Ei,isVararg:!0}],wn),li("getOptIntegerFromDict",[Ci,Pi,{type:Ei,isVararg:!0}],wn),li("getDictOptBoolean",[Fi,Pi,{type:Ei,isVararg:!0}],$n),li("getOptBooleanFromDict",[Fi,Pi,{type:Ei,isVararg:!0}],$n),li("getDictOptColor",[Vi,Pi,{type:Ei,isVararg:!0}],xn),li("getOptColorFromDict",[Vi,Pi,{type:Ei,isVararg:!0}],xn),li("getDictOptColor",[Ei,Pi,{type:Ei,isVararg:!0}],xn),li("getOptColorFromDict",[Ei,Pi,{type:Ei,isVararg:!0}],xn),li("getDictOptUrl",[Ei,Pi,{type:Ei,isVararg:!0}],kn),li("getOptUrlFromDict",[Ei,Pi,{type:Ei,isVararg:!0}],kn),li("getDictOptUrl",[Di,Pi,{type:Ei,isVararg:!0}],kn),li("getOptUrlFromDict",[Di,Pi,{type:Ei,isVararg:!0}],kn),li("getArrayString",[Si,Ci],An),li("getStringFromArray",[Si,Ci],An),li("getArrayNumber",[Si,Ci],Fn),li("getNumberFromArray",[Si,Ci],Fn),li("getArrayInteger",[Si,Ci],Vn),li("getIntegerFromArray",[Si,Ci],Vn),li("getArrayBoolean",[Si,Ci],Dn),li("getBooleanFromArray",[Si,Ci],Dn),li("getArrayColor",[Si,Ci],jn),li("getColorFromArray",[Si,Ci],jn),li("getArrayUrl",[Si,Ci],Pn),li("getUrlFromArray",[Si,Ci],Pn),li("getArrayFromArray",[Si,Ci],Sn),li("getDictFromArray",[Si,Ci],On),li("getArrayOptString",[Si,Ci,Ei],In),li("getOptStringFromArray",[Si,Ci,Ei],In),li("getArrayOptNumber",[Si,Ci,Ai],Tn),li("getOptNumberFromArray",[Si,Ci,Ai],Tn),li("getArrayOptInteger",[Si,Ci,Ci],Mn),li("getOptIntegerFromArray",[Si,Ci,Ci],Mn),li("getArrayOptBoolean",[Si,Ci,Fi],Nn),li("getOptBooleanFromArray",[Si,Ci,Fi],Nn),li("getArrayOptColor",[Si,Ci,Vi],zn),li("getOptColorFromArray",[Si,Ci,Vi],zn),li("getArrayOptColor",[Si,Ci,Ei],zn),li("getOptColorFromArray",[Si,Ci,Ei],zn),li("getArrayOptUrl",[Si,Ci,Di],Bn),li("getOptUrlFromArray",[Si,Ci,Di],Bn),li("getArrayOptUrl",[Si,Ci,Ei],Bn),li("getOptUrlFromArray",[Si,Ci,Ei],Bn),li("getOptArrayFromArray",[Si,Ci],(function(t,e,r){try{return Sn(t,e,r)}catch(t){return{type:"array",value:[]}}})),li("getOptDictFromArray",[Si,Ci],(function(t,e,r){try{return On(t,e,r)}catch(t){return{type:"dict",value:{}}}}));const Rn={StringLiteral:function(t,e){return{type:Ei,value:e.value}},NumberLiteral:function(t,e){return{type:Ai,value:e.value}},IntegerLiteral:function(t,e){return mi(t,e.value),{type:Ci,value:e.value}},BooleanLiteral:function(t,e){return{type:Fi,value:e.value?1:0}},UnaryExpression:function(t,e){const r=di(Un(t,e.argument));switch(e.operator){case"!":if(r.type===Fi)return{type:Fi,value:r.value?0:1};bi(`${e.operator}${vi(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===Ci){const e=r.value*br(i);return mi(t,e),{type:Ci,value:e}}if(r.type===Ai)return{type:Ai,value:r.value*i};bi(`${e.operator}${vi(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=di(Un(t,e.test));if(r.type===Fi)return r.value?Un(t,e.consequent):Un(t,e.alternate);bi(`${vi(r)} ? ${vi(Un(t,e.consequent))} : ${vi(Un(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return Un(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=gi(Un(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:Ei,value:r}},LogicalExpression:function(t,e){const r=di(Un(t,e.left));if(r.type!==Fi&&bi(`${vi(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Fi,value:0};const i=di(Un(t,e.right));return i.type!==Fi&&bi(`${vi(r)} ${e.operator} ${vi(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${fi(i.type)}.`),{type:Fi,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=Un(t,e.left),n=Un(t,e.right);if(i.type!==n.type&&bi(`${vi(i)} ${e.operator} ${vi(n)}`,`Operator '${r}' cannot be applied to different types: ${fi(i.type)} and ${fi(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===ji&&r.type===ji?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Fi,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ai&&e.type!==Ci&&e.type!==ji&&bi(`${vi(e)} ${t} ${vi(r)}`,`Operator '${t}' cannot be applied to ${fi(e.type)} type.`);const n=e.type===ji?e.value.getTime():e.value,o=r.type===ji?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Fi,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==Ei&&r.type!==Ai&&r.type!==Ci&&bi(`${vi(r)} ${e} ${vi(i)}`,`Operator '${e}' cannot be applied to ${fi(r.type)} type.`),r.type===Ei)return"-"===e&&bi(`${vi(r)} - ${vi(i)}`,`Operator '${e}' cannot be applied to ${fi(r.type)} type.`),{type:Ei,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===Ci)try{n=hi(0,n),mi(t,n)}catch(t){bi(`${vi(r)} ${e} ${vi(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!==Ci&&r.type!==Ai&&bi(`${vi(r)} ${e} ${vi(i)}`,`Operator '${e}' cannot be applied to ${fi(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&bi(`${vi(r)} ${e} ${vi(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===Ci)try{n=hi(0,n),mi(t,n)}catch(t){bi(`${vi(r)} ${e} ${vi(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=>Un(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(si.has(o))i=si.get(o);else{const t=function(t,e){const r=ai.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=ci(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=>fi(t.type))).join(", "),i=`${r}(${Jn(n)})`;"few"===t.type&&0===n.length?bi(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?bi(i,`Function '${r}' has no matching override for given argument types: ${e}.`):bi(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){bi(`${r}(${Jn(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 Un(t,e){if(e.type in Rn)return Rn[e.type](t,e);throw new Error("Unsupported expression")}function Ln(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(ui(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const i=Un(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:[]}}}class Wn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return ui(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Ln(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 pi(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=ft(String(n));if(t)return wi(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 Hn(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=oi(t,{startRule:"JsonStringContents"}),i=yi(r);return e.vars.push(...i),new Wn(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=>Hn(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Hn(t[n],e,r);return i}}var i;return t}function qn(t,e,r){if(t){if(t instanceof Wn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>qn(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=qn(t[n],e,r);return i}}return t}function Gn(t,e){const r={vars:[],hasExpression:!1},i=Hn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>qn(i,t,e)}}const Zn={pagers:function(){return Q(new Map)}},Yn=new Map,Xn=new Map;function Qn(t){const e=Yn.get(t)||Q("");return Yn.has(t)||Yn.set(t,e),e}function Kn(t){const e=Xn.get(t)||new Map;return Xn.has(t)||Xn.set(t,e),e}class to{setVariable(t){const e=t.getName(),r=Kn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Qn(this).set(e)}getVariable(t){return Kn(this).get(t)}}function eo(){return new to}function ro(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 io=new Set(["start","stop","pause","resume","cancel","reset"]);class no{constructor(t){ro(this,"timers",new Map),ro(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)&&io.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 oo(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 ao=Q(!0),so=0;function lo(){ao.set(!1)}function co(){ao.set(!0)}const uo=U(((t,e,r,i)=>{let n,o;var a,s,c,u;let{id:d}=e,{json:p={}}=e,{platform:f="auto"}=e,{theme:h="system"}=e,{globalVariablesController:m=new to}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:_=["http","https","tel","mailto","intent"]}=e,{extensions:w=new Map}=e,{onError:x}=e,{onStat:k}=e,{onCustomAction:E}=e,{onComponent:C}=e,{typefaceProvider:A=(t=>"")}=e,{fetchInit:F={}}=e,{tooltipRoot:V}=e,{customComponents:D}=e,j=Q("desktop"===f);if(o=l(j,(t=>n=t)),"auto"===f&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");j.set(!t.matches),t.addListener((()=>{j.set(!t.matches)}))}let P="light",S=null;function O(t){h=t}function T(){}const M=new Set(_);let N=!1;p||(N=!0,tt(st(new Error('"json" prop is required')))),d||(N=!0,tt(st(new Error('"id" prop is required'))));let z=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 Hr)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}(p);const J=p.templates||{};z&&(N=!0,tt(z));const R={stateChange:!1},U=Qn(m),L=Kn(m),W=new Map,H=new Map,q=new Map;let G=null,Z=0,Y=[];function X(t){const e=Gn(t,tt);return e.hasExpression?e.applyVars(H):t}function tt(t){x?x({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function et(t,e){k&&k({type:t,action:e})}let rt=0;function nt(t){return`${d}-${rt++}`}let ot={},lt={};function ct(t){ut(X(t))}function ut(t){const e=t.url?String(t.url):"",r=t.typed;if(e)try{const r=e.replace(/div-action:\/\//,""),i=/([^?]+)\?(.+)/.exec(r);if(!i)return;const n=new URLSearchParams(i[2]);switch(i[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=wt,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}}(n.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=yt(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.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=yt(t);r&&r.setPreviousItem(e)}(n.get("id"),n.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=yt(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const i=n.get("name"),o=n.get("value");if(i&&null!==o){const t=H.get(i);if(t){const e=t.getType();"dict"===e||"array"===e?tt(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:i}})):t.set(o)}else tt(st(new Error("Cannot find variable"),{additional:{name:i}}))}else tt(st(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const a=n.get("action"),s=n.get("id");G?G.execTimerAction(s,a):tt(st(new Error("Incorrect timer action"),{additional:{id:s,action:a}}));break;case"video":!function(t,e){if(t){const r=yt(t);r?"start"===e?r.start():"pause"===e?r.pause():tt(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):tt(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else tt(st(new Error("Missing id in video action"),{additional:{action:e}}))}(n.get("id"),n.get("action"));break;case"download":!function(t,e){if(t){let r;r="function"==typeof F?F(t):F,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,n,o;if(r){if(r.templates)for(const t in r.templates)J.hasOwnProperty(t)||(J[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=>!vt.has(t.id)));if(i)return tt(st(new Error("Skipping transactional, child is not found"),{additional:{url:t,id:i.id}})),void dt(null===(n=e.download_callbacks)||void 0===n?void 0:n.on_fail_actions)}r.patch.changes.forEach((t=>{const e=vt.get(t.id);e&&e.replaceWith(t.id,t.items)})),dt(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_success_actions)}}else tt(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;tt(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),dt(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else tt(st(new Error("Missing url in download action"),{additional:{url:t}}))}(n.get("url"),t);break;case"show_tooltip":!function(t,e){var r;if(!t)return void tt(st(new Error("Missing id in show_tooltip action")));const i=ht.get(t);if(!i)return void tt(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&Y.some((e=>e.desc.id===t)))return;const n={internalId:++Z,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};Y=[...Y,n];const o=null!==(r=i.tooltip.duration)&&void 0!==r?r:5e3;o&&(n.timeoutId=window.setTimeout((()=>{n.timeoutId=0,Y=Y.filter((t=>t.internalId!==n.internalId))}),o))}(n.get("id"),n.get("multiple"));break;case"hide_tooltip":!function(t){t?Y=Y.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):tt(st(new Error("Missing id in hide_tooltip action")))}(n.get("id"));break;default:tt(st(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){tt(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=H.get(t);r?r.getType()===e.type?r.setValue(e.value):tt(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):tt(st(new Error("Cannot find variable"),{additional:{name:t}}))}else tt(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}})):oo(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)}}))}(H,tt,r);break;case"array_remove_value":!function(t,e,r){const{variable_name:i,index:n}=r;"number"==typeof n?oo(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}}))}(H,tt,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}}))}(tt,r);break;case"focus_element":{const t=r.element_id&&ft.get(r.element_id);t?t.focus():tt(st(new Error("Incorrect focus_element action"),{additional:{elementId:r.element_id}}));break}default:tt(st(new Error("Unknown type of action"),{additional:{type:r.type}}))}}async function dt(t,e){if(t&&Array.isArray(t)){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url,o=i.typed;if(n){const t=xt(n);if(t)if(kt(t,M)){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?(ut(i),await $()):i.log_id&&(pt(i),await $())}else o&&ut(i)}t.forEach((t=>{t.log_id&&et("click",t)}))}}function pt(t){null==E||E(t)}const gt=new Map,vt=new Map,ft=new Map,ht=new Map;function yt(t){if(gt.has(t))return gt.get(t);tt(st(new Error("Missing instance with id"),{additional:{id:t}}))}const bt=new Map;function _t(t){for(const e of t)H.has(e)&&t.delete(e);return t}v(at,{logError:tt,logStat:et,hasTemplate:function(t){return t in J},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in J;){if(({json:t,templateContext:e}=Zr(t,e,J,tt)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:nt,genClass:function(t){return`divkit-${nt()}`},execAction:ut,execAnyActions:dt,execCustomAction:pt,isRunning:function(t){return R[t]},setRunning:function(t,e){R[t]=e},registerInstance:function(t,e){gt.has(t)?tt(st(new Error("Duplicate instance id"),{additional:{id:t}})):gt.set(t,e)},unregisterInstance:function(t){gt.delete(t)},registerParentOf:function(t,e){vt.set(t,e)},unregisterParentOf:function(t){vt.delete(t)},registerTooltip:function(t,e){ht.has(e.id)&&tt(st(new Error("Duplicate tooltip id"),{additional:{id:e.id}})),ht.set(e.id,{onwerNode:t,tooltip:e})},unregisterTooltip:function(t){ht.delete(t.id),Y.some((e=>e.desc.id===t.id))&&(Y=Y.filter((e=>e.desc.id!==t.id)))},onTooltipClose:function(t){Y=Y.filter((e=>e.internalId!==t))},tooltipRoot:V,registerFocusable:function(t,e){ft.set(t,e)},unregisterFocusable:function(t){ft.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(lt[r]=lt[r]||0,++lt[r],ot[r])return ot[r];const i=`${nt()}-svg-filter`;return ot=Object.assign(Object.assign({},ot),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;lt[r]&&0==--lt[r]&&(ot=Object.keys(ot).reduce(((t,e)=>(lt[e]&&(t[e]=ot[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Xr(t);const e=Gn(t,tt);return e.vars.length?K(e.vars.map((t=>H.get(t)||function(t){const e=q.get(t)||Q(void 0);return q.has(t)||q.set(t,e),e}(t))).filter(mt),(()=>e.applyVars(H))):e.hasExpression?Xr(e.applyVars(H)):Xr(t)},getJsonWithVars:X,getStore:function(t){return bt.has(t)||function(t){bt.has(t)||bt.set(t,Zn[t]())}(t),bt.get(t)},getVariable:function(t,e){const r=H.get(t);if(r){const i=r.getType();if(i!==e)return void tt(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return M},getExtension:function(t,e){const r=w.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:H,logError:tt}},typefaceProvider:A,isDesktop:j,isPointerFocus:ao,customComponents:D,registerComponent:void 0,unregisterComponent:void 0}),v(Ht,{hasAction:()=>!1});const wt={setState(t){throw new Error("Not implemented")},getChild(t){if($t&&$t.has(t))return $t.get(t);tt(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let $t=null;v(jt,{registerInstance(t,e){$t||($t=new Map),$t.has(t)?tt(st(new Error("Duplicate state with id"),{additional:{id:t}})):$t.set(t,e)},unregisterInstance(t){null==$t||$t.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 Et=null===(a=null==p?void 0:p.card)||void 0===a?void 0:a.variables;Array.isArray(Et)&&Et.forEach((t=>{if(t&&t.type in kr&&t.name){if(W.has(t.name))return void tt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&tt(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Er(t.name,t.type,t.value);W.set(t.name,e),H.set(t.name,e)}catch(e){tt(st(e,{additional:{name:t.name}}))}}}));const Ct=p.palette;Ct&&Ct[P].forEach((t=>{if(W.has(t.name))tt(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Er(t.name,"color",t.color);W.set(t.name,e),H.set(t.name,e)}catch(e){tt(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of L)H.has(t)||H.set(t,e);U.subscribe((t=>{if(t&&!H.has(t)){const e=L.get(t);H.set(t,e);const r=q.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const At=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variable_triggers;Array.isArray(At)&&At.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void tt(st(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const i=oi(t.condition,{startRule:"JsonStringContents"}),n=yi(i);if(!n.length)return void tt(st(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return _t(e),e.size?new Promise((t=>{const r=U.subscribe((()=>{_t(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{K(n.map((t=>H.get(t))).filter(mt),(()=>{const t=Ln(H,i);return t.warnings.forEach(tt),t.result})).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=X(t);e.log_id&&ut(e)})),e=Boolean(i.value)):tt(st(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){tt(st(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else tt(st(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const Ft=null===(c=null==p?void 0:p.card)||void 0===c?void 0:c.timers;if(Ft){const t=G=new no({logError:tt,applyVars:X,hasVariableWithType:function(t,e){const r=H.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=H.get(t);r?r.setValue(e):tt(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:dt});Ft.forEach((e=>t.createTimer(e)))}const Vt=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.states;let Dt;return Vt&&!N&&(Dt={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:Vt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}),g((()=>{so--,so||(window.removeEventListener("keydown",lo),window.removeEventListener("pointerdown",co)),G&&G.destroy(),Y.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&r.id&&void 0!==d&&r.id(d),void 0===e.json&&r.json&&void 0!==p&&r.json(p),void 0===e.platform&&r.platform&&void 0!==f&&r.platform(f),void 0===e.theme&&r.theme&&void 0!==h&&r.theme(h),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==_&&r.builtinProtocols(_),void 0===e.extensions&&r.extensions&&void 0!==w&&r.extensions(w),void 0===e.onError&&r.onError&&void 0!==x&&r.onError(x),void 0===e.onStat&&r.onStat&&void 0!==k&&r.onStat(k),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==E&&r.onCustomAction(E),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==A&&r.typefaceProvider(A),void 0===e.fetchInit&&r.fetchInit&&void 0!==F&&r.fetchInit(F),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==V&&r.tooltipRoot(V),void 0===e.customComponents&&r.customComponents&&void 0!==D&&r.customComponents(D),void 0===e.setTheme&&r.setTheme&&void 0!==O&&r.setTheme(O),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==T&&r.getDebugVariables(T),void 0===e.execAction&&r.execAction&&void 0!==ct&&r.execAction(ct),"light"===h||"dark"===h?P=h:"system"===h?"undefined"!=typeof matchMedia?(S||(S=matchMedia("(prefers-color-scheme: dark)"),S.addListener((function(){"system"===h&&S&&(P=S.matches?"dark":"light")}))),P=S.matches?"dark":"light"):P="light":tt(st(new Error("Unsupported theme"))),P&&(Ct&&Ct[P].forEach((t=>{const e=H.get(t.name);e&&e.setValue(t.color)}))),o(),!N&&Dt?`<div class="${I("divkit-b023c",!0)+I(n?` ${it}`:"",!0)+I(y?` ${y}`:"",!0)}">${B(Gr,"RootSvgFilters").$$render(t,{svgFiltersMap:ot},{},{})} ${B(qr,"Unknown").$$render(t,{div:Dt,templateContext:{},layoutParams:{tooltips:Y}},{},{})}</div>`:""})),po=uo;function go(t){return po.render(t).html}var vo=exports;for(var fo in e)vo[fo]=e[fo];e.__esModule&&Object.defineProperty(vo,"__esModule",{value:!0})})();
|
|
1
|
+
(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>yo,createVariable:()=>Mr,render:()=>Vo}),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 j(t){return V.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 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(D.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 O=/[&"]/g,S=/[&<]/g;function I(t,e=!1){const r=String(t),i=e?O:S;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){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 Ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(r),!0).forEach((function(e){At(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function At(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 Ft(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function Vt(t,e){e&&t.push(e)}function jt(t,e,r){const i=[];Vt(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&Vt(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const Dt=Symbol("state");function Pt(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 Ot(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function St(t){return Ot(t)&&t>=0}function It(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!St(r[t]))return e;return Pt(t)}function Mt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const Tt=Object.prototype.hasOwnProperty;function zt(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(!Tt.call(e,n)||!zt(t[n],e[n]))return!1}return!0}function Nt(t,e){return zt(t,e)?e:t}function Bt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Rt(t,e){const r=Number(t);return isNaN(r)?e:r}function Jt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Jt(t))})):e.push(t),e}function Ut(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!St(t[r[i]]))return e;return t}function Lt(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 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=qt,Zt="divkit-b921d";function Yt(t){return Ot(t)&&t>0}function Xt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Yt(t.radius))return`blur(${pt(t.radius/2)})`}else e(st(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Qt=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=Xt(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",Zt,0)}${L("style",ut(t.style),0)}>`:`<span${L("class",Zt,0)}${L("style",ut(t.style),0)}></span>`))}</span>`})),Kt=Qt,te={left:"start",center:"center",right:"end"},ee={top:"start",center:"center",bottom:"end",baseline:"baseline"},re=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,j,D,P,O,S,I,M,T,z,N,R,J,U,W,H,q,G,Z,Y,X,Q,K,tt,et,rt=o,it=o,nt=o,ot=o,lt=o,vt=o,ft=o,ht=o,bt=o,_t=o,wt=o,$t=o,Et=o,At=o,Vt=o,Ot=o,Tt=o,Wt=o,{json:Ht={}}=e,{origJson:qt}=e,{templateContext:Zt}=e,{cls:Yt=""}=e,{style:Xt}=e,{layoutParams:Qt={}}=e,{customDescription:re=!1}=e,{customPaddings:ie=!1}=e,{customActions:ne=""}=e,{additionalPaddings:oe=null}=e,{heightByAspect:ae=!1}=e,{parentOf:se}=e,{parentOfSimpleMode:le}=e,{replaceItems:ce}=e,{hasInnerFocusable:ue=!1}=e;const de=f(at),pe=f(Dt);let ve,ge;I=l(de.isPointerFocus,(t=>S=t));let fe,he,me,ye,be,_e,we,$e,xe,ke,Ee,Ce,Ae,Fe,Ve,je,De,Pe,Oe,Se,Ie=null,Me=[],Te={},ze={},Ne=!1,Be=1,Re="transparent",Je=0,Ue={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Le="",We=null,He="",qe={},Ge=0,Ze=0,Ye=0,Xe=!1,Qe=!1,Ke={},tr=0,er=0,rr=0,ir=!1,nr=!1,or=1,ar=[],sr=!1,lr=!1,cr=[],ur=[],dr=[],pr=[],vr=[],gr=[],fr="",hr=!1,mr="visible",yr=0,br=0,_r=!1,wr=null;function $r(t,e){if(!Array.isArray(se)||!ce)return;if(le&&1!==(Array.isArray(e)&&e.length||0))return;const r=se.findIndex((e=>(null==e?void 0:e.id)===t)),i=se.slice();i.splice(r,1,...e||[]),se=i,ce(i)}function xr(){if(Ie&&ve){const t=de.getExtensionContext();Ie.forEach((e=>{var r;null===(r=e.unmountView)||void 0===r||r.call(e,ve,t)})),Ie=null}}function kr(){Ht.focus&&(S||(_r=!0),de.execAnyActions(pr))}function Er(){Ht.focus&&(_r=!1,de.execAnyActions(vr))}v((()=>{var t;Me.forEach((t=>{de.unregisterParentOf(t)})),Me=[],null===(t=Ht.tooltips)||void 0===t||t.forEach((t=>{de.unregisterTooltip(t)})),xr()})),void 0===e.json&&r.json&&void 0!==Ht&&r.json(Ht),void 0===e.origJson&&r.origJson&&void 0!==qt&&r.origJson(qt),void 0===e.templateContext&&r.templateContext&&void 0!==Zt&&r.templateContext(Zt),void 0===e.cls&&r.cls&&void 0!==Yt&&r.cls(Yt),void 0===e.style&&r.style&&void 0!==Xt&&r.style(Xt),void 0===e.layoutParams&&r.layoutParams&&void 0!==Qt&&r.layoutParams(Qt),void 0===e.customDescription&&r.customDescription&&void 0!==re&&r.customDescription(re),void 0===e.customPaddings&&r.customPaddings&&void 0!==ie&&r.customPaddings(ie),void 0===e.customActions&&r.customActions&&void 0!==ne&&r.customActions(ne),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==oe&&r.additionalPaddings(oe),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ae&&r.heightByAspect(ae),void 0===e.parentOf&&r.parentOf&&void 0!==se&&r.parentOf(se),void 0===e.parentOfSimpleMode&&r.parentOfSimpleMode&&void 0!==le&&r.parentOfSimpleMode(le),void 0===e.replaceItems&&r.replaceItems&&void 0!==ce&&r.replaceItems(ce),void 0===e.hasInnerFocusable&&r.hasInnerFocusable&&void 0!==ue&&r.hasInnerFocusable(ue),Ht&&Qt&&(We=null,He="",or=1,hr=!1,mr="visible",yr=0,br=0,Pe=void 0,Oe=void 0,ar=Qt.fakeElement?[]:Ht.transition_triggers||["state_change","visibility_change"],sr=Boolean(-1!==ar.indexOf("state_change")&&Ht.id),lr=Boolean(-1!==ar.indexOf("visibility_change")&&Ht.id)),n=de.getDerivedFromVars(Ht.focus),ot(),ot=l(n,(t=>N=t)),a=de.getDerivedFromVars(Ht.border),Wt(),Wt=l(a,(t=>et=t)),s=de.getDerivedFromVars(Ht.paddings),Tt(),Tt=l(s,(t=>tt=t)),c=de.getDerivedFromVars(Ht.margins),Vt(),Vt=l(c,(t=>Q=t)),u=de.getDerivedFromVars(Ht.width),Et(),Et=l(u,(t=>Y=t)),d=de.getDerivedFromVars(Ht.alignment_horizontal),Ot(),Ot=l(d,(t=>K=t)),p=de.getDerivedFromVars(Ht.height),$t(),$t=l(p,(t=>Z=t)),g=de.getDerivedFromVars(Ht.alignment_vertical),At(),At=l(g,(t=>X=t)),h=de.getDerivedFromVars(Ht.alpha),wt(),wt=l(h,(t=>G=t)),m=de.getDerivedFromVars(Ht.accessibility),_t(),_t=l(m,(t=>q=t)),y=de.getDerivedFromVars(Ht.background),bt(),bt=l(y,(t=>H=t)),b=de.getDerivedFromVars(Ht.action),ft(),ft=l(b,(t=>U=t)),_=de.getDerivedFromVars(Ht.actions),ht(),ht=l(_,(t=>W=t)),w=de.getDerivedFromVars(Ht.doubletap_actions),vt(),vt=l(w,(t=>J=t)),x=de.getDerivedFromVars(Ht.longtap_actions),lt(),lt=l(x,(t=>R=t)),k=de.getDerivedFromVars(Ht.action_animation),nt(),nt=l(k,(t=>z=t)),E=de.getDerivedFromVars(Ht.visibility),it(),it=l(E,(t=>T=t)),C=de.getDerivedFromVars(Ht.transform),rt(),rt=l(C,(t=>M=t)),Me.forEach((t=>{de.unregisterParentOf(t)})),Me=[],se&&se.forEach((t=>{(null==t?void 0:t.id)&&(Me.push(t.id),de.registerParentOf(t.id,{replaceWith:$r,isSingleMode:Boolean(le)}))}));{const t=_r&&(null==N?void 0:N.border)?N.border:et;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,Be=Mt(t.stroke.width,Be),Re=gt(t.stroke.color,1,Re),r.border=`${dt(Be)} solid ${Re}`),t.corners_radius?(Ue=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!St(r[t]))return e;return t}(t.corners_radius,Ue),r["border-radius"]=e["border-radius"]=Lt(Ue)):t.corner_radius&&(Je=Mt(t.corner_radius,Je),Ue={"top-left":Je,"top-right":Je,"bottom-right":Je,"bottom-left":Je},r["border-radius"]=e["border-radius"]=dt(Je)),i&&Be&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},Ue);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Be/2})),n=Lt(t)}}Te=Nt(e,Te),ze=Nt(r,ze),Ne=i,Le=n}We=Ut(tt&&!ie?tt:void 0,We),A=Pt(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}(We,oe)),He=It(Q,He);{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)Ge=Mt(null==Y?void 0:Y.value,Ge),e=dt(Ge);else if("wrap_content"===c||("match_parent"===c||!c)&&Qt.parentHorizontalWrapContent){if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&Qt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Qt.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&St(t.min_size.value)&&(r=dt(t.min_size.value)),t.max_size&&St(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"!==c&&c||de.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","vertical"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,de.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.left)||0)+((null==Q?void 0:Q.right)||0))})`:"horizontal"===Qt.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,Qt.parentContainerWrap&&(s=!0));if("parent"===t)n["halign-self"]="stretch";else{const t=K;n["halign-self"]="left"===t||"center"===t||"right"===t?te[t]:Qt.parentHAlign||"start"}t&&(n.width=t),fe=e,he=r,me=i,Ze=o,Ye=a,qe=Nt(n,qe),Xe=s,Qe=l}{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ae);else if("fixed"===c)tr=Mt(null==Z?void 0:Z.value,tr),e=dt(tr);else if("match_parent"!==c||Qt.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&Qt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Qt.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&St(t.min_size.value)&&(r=dt(t.min_size.value)),(null==t?void 0:t.max_size)&&St(t.max_size.value)&&(i=dt(t.max_size.value))}"match_parent"===c&&de.logError(st(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Qt.parentContainerOrientation&&Qt.parentContainerWrap&&(l=!0,de.logError(st(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Qt.parentLayoutOrientation?e=`calc(100% - ${pt(((null==Q?void 0:Q.top)||0)+((null==Q?void 0:Q.bottom)||0))})`:"vertical"===Qt.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,Qt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Qt.parentContainerOrientation?n["valign-self"]=ee[t]:n["valign-self"]=Qt.parentVAlign||"start"}t&&(n.height=t),ye=e,be=r,_e=i,er=o,rr=a,Ke=Nt(n,Ke),ir=s,nr=l}var Cr,Ar,Fr;if(F=!!Qt.overlapParent||void 0,V=Qt.overlapParent&&(!Y||"match_parent"===Y.type)&&!Qt.parentHorizontalWrapContent&&"match_parent"===(null==Z?void 0:Z.type)&&!Qt.parentVerticalWrapContent,j=Qt.gridArea?`${Qt.gridArea.y+1}/${Qt.gridArea.x+1}/span ${Qt.gridArea.rowSpan}/span ${Qt.gridArea.colSpan}`:void 0,Ar=or,or=!St(Cr=G)||void 0===Cr||Cr>1?Ar:Number(Cr),we=1===or?void 0:or,ge=void 0,q&&!re&&q.description&&(ge={},ge["aria-label"]=q.description),$e=_r&&(null==N?void 0:N.background)?N.background:H,xe={},ke=!1,Array.isArray($e)&&(ke=$e.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Le),!ke)){const t=yt($e);xe["background-color"]=t.color,xe["background-image"]=t.image,xe["background-size"]=t.size,xe["background-position"]=t.position,xe["background-repeat"]="no-repeat"}Ee=void 0,sr&&Ht.transition_in&&de.isRunning("stateChange")&&(Ee=!0),Ae=void 0,sr&&Ht.transition_change&&de.isRunning("stateChange")&&pe.hasTransitionChange(Ht.id)&&(Ae=!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)||[];Qt.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],de.logError(st(new Error("Actions should be array")))),Array.isArray(e)||(e=[],de.logError(st(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],de.logError(st(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],de.logError(st(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],de.logError(st(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&ne&&(t=[],e=[],r=[],de.logError(st(new Error(`Cannot use action on component "${ne}"`)))),cr=t,ur=e,dr=r,pr=i,vr=n}z&&(gr=Jt(z),fr=gr.map((function(t){const e=Rt(t.start_value,1),r=Rt(t.end_value,1),i=Mt(t.start_delay,0),n=Mt(t.duration,300),o=Bt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Fe=e,Ve=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return je=e,De=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return de.logError(st(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", "));{const t=mr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(T,mr);t!==e&&(!hr||"visible"!==mr&&"visible"!==e?mr=e:async function(t){mr=t;const e="visible"===t?"in":"out",r="in"===e?Ht.transition_in:Ht.transition_out;lr&&r&&(await $(),"in"===e&&(Ce=!0),pe.runVisibilityTransition(Object.assign(Object.assign({},Ht),{visibility:"visible"}),Zt,r,ve,e).then((()=>{"in"===e&&(Ce=!1)})).catch((t=>{throw"in"===e&&(Ce=!1),t})))}(e)),hr||(hr=!0)}if(Ht&&ve&&!zt(Ht.extensions,Se)){let t=Se=Ht.extensions;$().then((()=>{if(t===Se&&ve&&(xr(),Array.isArray(Ht.extensions))){const t=de.getExtensionContext();Ie=Ht.extensions.map((e=>{var r;const i=de.getExtension(e.id,e.params);return i&&(null===(r=i.mountView)||void 0===r||r.call(i,ve,t)),i})).filter(mt)}}))}if(Ht&&qt&&Zt&&wr&&wr.update({json:Ht,origJson:qt,templateContext:Zt}),D=Object.assign(Object.assign(Object.assign({},qe),Ke),{"parent-overlap":F,"parent-overlap-absolute":V,"scroll-snap":Qt.scrollSnap,"hide-on-transition-in":Ee||Ce||Ae,visibility:mr,"has-action-animation":Boolean(fr),"parent-flex":Qt.parentContainerOrientation||void 0,"parent-grid":Boolean(Qt.gridArea)||void 0,"has-custom-focus":Boolean(_r&&Ht.focus)}),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};yr=Rt(t.value,yr);const e="pivot-fixed"===t.type?dt(yr):`${yr}%`,r=M.pivot_y||{type:"pivot-percentage",value:50};br=Rt(r.value,br),Pe=`${e} ${"pivot-fixed"===r.type?dt(br):`${br}%`}`,Oe=`rotate(${M.rotation}deg)`}return P=Xe||ir?"100%":Ze||er?0:void 0,O=Object.assign(Object.assign(Object.assign(Object.assign({},Xt),xe),Te),{width:fe,"min-width":he,"max-width":me,height:ye,"min-height":be,"max-height":_e||(null==Xt?void 0:Xt["max-height"]),"grid-area":j,padding:A,margin:He,opacity:we,transition:fr,"transform-origin":Pe,transform:Oe,"flex-grow":Ze||er||void 0,"flex-shrink":Ye||rr?1:void 0,"flex-basis":P,"--divkit-animation-opacity-start":Fe,"--divkit-animation-opacity-end":Ve,"--divkit-animation-scale-start":je,"--divkit-animation-scale-end":De}),I(),rt(),it(),nt(),ot(),lt(),vt(),ft(),ht(),bt(),_t(),wt(),$t(),Et(),At(),Vt(),Ot(),Tt(),Wt(),Qe||nr?"":`${B(Gt,"Actionable").$$render(t,{id:Ht.id,use:function(t){var e;ve=t,sr&&Ht.transition_in&&pe.registerChildWithTransitionIn(Ht,Zt,Ht.transition_in,t).then((()=>{Ee=!1})).catch((t=>{throw Ee=!1,t})),sr&&Ht.transition_out&&pe.registerChildWithTransitionOut(Ht,Zt,Ht.transition_out,t),sr&&Ht.transition_change&&pe.registerChildWithTransitionChange(Ht,Zt,Ht.transition_change,t).then((()=>{Ae=!1})).catch((t=>{throw Ae=!1,t}));const r=Qt.fakeElement?[]:Ht.visibility_actions||Ht.visibility_action&&[Ht.visibility_action],i=Qt.fakeElement?[]:Ht.disappear_actions;(Array.isArray(r)&&r.length||Array.isArray(i)&&i.length)&&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=>{const e="visibility"===t.type,r=i.getJsonWithVars({visibility_percentage:t.action.visibility_percentage,visibility_duration:e?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit});return Ct(Ct({},r),{},{visibility_percentage:Ft(e,r.visibility_percentage,e?50:0)})})),a=[...new Set(o.map((t=>t.visibility_percentage/100)))];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const r=o[e.index],n="visibility"===e.type;let a;a=0===r.visibility_percentage?t.intersectionRatio>=1e-12:t.intersectionRatio>=r.visibility_percentage/100;const s=n?!e.visible&&a:e.visible&&!a,l=n?!a:a;s?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===r.log_limit?1/0:r.log_limit||1;++e.count>=t&&(e.finished=!0);const o=i.getJsonWithVars(e.action),a=o.url,s=o.typed;if(a){const t=xt(a);t&&!kt(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(o):o.log_id&&i.execCustomAction(o))}else s&&i.execAction(o);i.logStat(n?"visible":"disappear",o)}),o[e.index].visibility_duration||800)):l&&e.timer&&clearTimeout(e.timer),e.visible=a}))}))}),{threshold:a}).observe(t)}(t,{visibilityActions:r,disappearActions:i,rootCtx:de});const n=Ht.id;return n&&pe.registerChild(n),null===(e=Ht.tooltips)||void 0===e||e.forEach((e=>{de.registerTooltip(t,e)})),{destroy(){n&&pe.unregisterChild(n),wr&&wr.destroy()}}},cls:Yt+" "+jt("outer",ct,D),style:ut(O),actions:cr,doubleTapActions:ur,longTapActions:dr,attrs:ge,hasInnerFocusable:ue,isNativeActionAnimation:!gr.length||(Fr=gr,Fr.some((t=>"native"===t.name)))},{},{default:()=>` ${ke?`${B(Kt,"OuterBackground").$$render(t,{background:$e,radius:Le},{},{})}`:""}${i.default?i.default({focusHandler:kr,blurHandler:Er,hasCustomFocus:_r}):""}${Ne?`<span${L("class",ct.outer__border,0)}${L("style",ut(ze),0)}></span>`:""}`})}`})),ie=re,ne={"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=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 $=oe(h.font_size,$),Yt(h.line_height)&&(x=Number(h.line_height)/$),St(h.letter_spacing)&&(k=dt(h.letter_spacing)),_=se(h.font_weight,_),E="string"==typeof h.font_family&&h.font_family?b.typefaceProvider(h.font_family,{fontWeight:_||400}):"",C=gt(h.text_color,1,C),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)&&Yt(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,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",ne["text-range__top-offset"],0)}${H({"margin-top":n})}></span>`:""}${B(Gt,"Actionable").$$render(t,{cls:jt("text-range",ne,l),actions:y,style:ut(c)},{},{default:()=>`${I(v)}`})}`})),ce=le;function ue(t,e){return"left"===t||"center"===t||"right"===t?t:e}function de(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function pe(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ve(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const ge=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,j,D,P,O,S,I,M,T,N,R,J,U,W,H=o,q=o,G=o,Z=o,Y=o,X=o,Q=o,K=o,tt=o,et=o,it=o,nt=o,ot=o,st=o,{json:ct={}}=e,{templateContext:pt}=e,{origJson:vt}=e,{layoutParams:ft}=e;const ht=f(at);let mt="",bt=12,_t=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",At="",Ft="",Vt="",Dt=!1,Pt=[],Ot=[];var St;v((()=>{Ot.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&r.json&&void 0!==ct&&r.json(ct),void 0===e.templateContext&&r.templateContext&&void 0!==pt&&r.templateContext(pt),void 0===e.origJson&&r.origJson&&void 0!==vt&&r.origJson(vt),void 0===e.layoutParams&&r.layoutParams&&void 0!==ft&&r.layoutParams(ft),ct&&(bt=12,_t=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",At="",Vt="",Dt=!1),n=ht.getDerivedFromVars(ct.text),st(),st=l(n,(t=>W=t)),a=ht.getDerivedFromVars(ct.ranges),q(),q=l(a,(t=>j=t)),s=ht.getDerivedFromVars(ct.images),H(),H=l(s,(t=>V=t)),c=ht.getDerivedFromVars({font_size:ct.font_size,letter_spacing:ct.letter_spacing,font_weight:ct.font_weight,font_family:ct.font_family,text_color:ct.text_color,underline:ct.underline,strike:ct.strike,line_height:ct.line_height,text_shadow:ct.text_shadow}),G(),G=l(c,(t=>D=t)),u=ht.getDerivedFromVars(ct.font_size),ot(),ot=l(u,(t=>U=t)),d=ht.getDerivedFromVars(ct.line_height),nt(),nt=l(d,(t=>J=t)),p=ht.getDerivedFromVars(ct.max_lines),tt(),tt=l(p,(t=>T=t)),g=ht.getDerivedFromVars(ct.text_alignment_horizontal),it(),it=l(g,(t=>R=t)),h=ht.getDerivedFromVars(ct.text_alignment_vertical),et(),et=l(h,(t=>N=t)),m=ht.getDerivedFromVars(ct.text_color),K(),K=l(m,(t=>M=t)),y=ht.getDerivedFromVars(ct.focused_text_color),Q(),Q=l(y,(t=>I=t)),b=ht.getDerivedFromVars(ct.truncate),X(),X=l(b,(t=>S=t)),_=ht.getDerivedFromVars(ct.text_gradient),Y(),Y=l(_,(t=>O=t)),w=ht.getDerivedFromVars(ct.selectable),Z(),Z=l(w,(t=>P=t)),St=W,mt=String(null!=St?St:""),bt=oe(U,bt);{const t=J;Yt(t)?(_t=Number(t)/bt,wt=!0):wt=!1}$=1===T;{let t="",e="",r=!1;if(T&&T>1){let i=Number(T);t=i*_t+"em",e=i,r=!0}$t=t,xt=e,kt=r}Et=ue(R,Et),Ct=de(N,Ct),x=!j||mt&&1===j.length&&j[0]&&0===j[0].start&&"number"==typeof j[0].end&&j[0].end>=mt.length,k=Boolean(M)!==Boolean(j&&j[0]&&j[0].text_color);{let t="";T&&x&&k&&(t=gt(M||j&&j[0]&&j[0].text_color,1,At)),At=t}Ft=gt(I,1,Ft),E="none"===S?"none":"";{let t="";if(O){const e=yt([O]);e.image&&(t=e.image)}Vt=t}return Dt=pe(P,Dt),function(t,e,r){let i=[];if(Ot.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),Ot=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Pt=[]);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;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},D),...l);i.push({text:n.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},D),...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)/bt)};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=ht.addSvgFilter(e,c),Ot.push([e,c])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},D)}),Pt=i}(mt,j,V),C={singleline:$,multiline:kt,halign:Et,valign:Ct,truncate:E,"has-focus-color":Boolean(Ft)},A={gradient:Boolean(Vt)},F={"font-size":dt(bt),"line-height":_t,"max-height":$t,"-webkit-line-clamp":xt,color:At,"background-image":Vt,"--divkit-text-focus-color":Ft},H(),q(),G(),Z(),Y(),X(),Q(),K(),tt(),et(),it(),nt(),ot(),st(),`${B(ie,"Outer").$$render(t,{cls:jt("text",lt,C)+" "+(Dt?"":rt),json:ct,origJson:vt,templateContext:pt,layoutParams:ft},{},{default:()=>`<span${L("class",jt("text__inner",lt,A),0)}${L("style",ut(F),0)}>${Pt.length?`${z(Pt,((e,r)=>"text"in e?e.text?`${B(ce,"TextRangeView").$$render(t,{json:ct,text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:$,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":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${B(ce,"TextRangeView").$$render(t,{json:ct,text:mt,rootFontSize:bt,textStyles:D,singleline:$},{},{})}`}</span>`})}`})),fe=ge,he={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function me(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function ye(t,e,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 be(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 _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 i;if("rounded_rectangle"===t.shape.type)i={width:Mt(null===(o=(n=t.shape).item_width)||void 0===o?void 0:o.value,10),height:Mt(null===(a=n.item_height)||void 0===a?void 0:a.value,10),radius:Mt(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*Mt(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 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 Ae(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 Fe(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),Ae(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)Ae(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),Ae(t,e,s,{top:l,right:0,bottom:0,left:c},a,i)}}const Ve=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&&Fe(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&&Fe(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(Ce))&&!(null==r?void 0:r.contains(Ee))}))&&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",Ee,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",Ce,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>`})),je={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"},Pe=["rounded_rectangle","circle"],Oe=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,j,D,P,O,S=o,I=o,M=o,T=o,N=o,R=o,J=o,U=o,L=o,W=o;var H,q,G,Z,Y,X;let{json:Q={}}=e,{templateContext:tt}=e,{origJson:et}=e,{layoutParams:rt}=e;const it=f(at);let nt,ot,st="vertical",lt="top",ct="left",ut=null,dt=null,pt={};void 0===e.json&&r.json&&void 0!==Q&&r.json(Q),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),Q&&(st="vertical",lt="top",ct="left",ot=void 0),n=Q.items,a=it.getDerivedFromVars(Q.orientation),W(),W=l(a,(t=>O=t)),s=it.getDerivedFromVars(Q.layout_mode),L(),L=l(s,(t=>P=t)),c=it.getDerivedFromVars(Q.content_alignment_vertical),J(),J=l(c,(t=>j=t)),u=it.getDerivedFromVars(Q.content_alignment_horizontal),R(),R=l(u,(t=>V=t)),d=it.getDerivedFromVars(Q.separator),N(),N=l(d,(t=>F=t)),p=it.getDerivedFromVars(Q.line_separator),T(),T=l(p,(t=>A=t)),v=it.getDerivedFromVars(Q.aspect),M(),M=l(v,(t=>C=t)),g=it.getDerivedFromVars(Q.width),S(),S=l(g,(t=>k=t)),h=it.getDerivedFromVars(Q.height),I(),I=l(h,(t=>E=t)),m=(n||[]).map((t=>{let e=t,r=tt;return({templateContext:r,json:e}=it.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];m.forEach((e=>{t.push(it.getDerivedFromVars({width:e.json.width,height:e.json.height}))})),nt=K(t,(t=>[...t])),U(),U=l(nt,(t=>D=t))}if(st=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(O,st),y="wrap"===P,b="horizontal"!==st&&!y&&D.some(_e),_="vertical"!==st&&!y&&D.some(we),lt=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(j,lt),ct=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(V,ct),(null==F?void 0:F.style)&&"overlap"!==st&&ke()){const t=$e(F.style,Pe,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(H=F.show_at_start)&&void 0!==H&&H),show_at_end:Boolean(null!==(q=F.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(G=F.show_between)||void 0===G||G),style:t,margins:me(F.margins)}:null}else ut=null;if((null==A?void 0:A.style)&&"overlap"!==st&&ke()){const t=$e(A.style,Pe,(null==dt?void 0:dt.style)||null);dt=t?{show_at_start:Boolean(null!==(Z=A.show_at_start)&&void 0!==Z&&Z),show_at_end:Boolean(null!==(Y=A.show_at_end)&&void 0!==Y&&Y),show_between:Boolean(null===(X=A.show_between)||void 0===X||X),style:t,margins:me(A.margins)}:null}else dt=null;w=ut||dt?function(t,e,r){const i={};return ye(i,e,"vertical"===t),ye(i,r,"horizontal"===t),i}(st,ut,dt):null;{const t=null==C?void 0:C.ratio;ot=t&&Yt(t)?t:void 0}{let t={};(null==rt?void 0:rt.fakeElement)&&(t.fakeElement=!0),"overlap"===st&&(t.overlapParent=!0),"horizontal"!==st&&(t.parentHAlign=y?"start":je[ct]),"vertical"!==st&&(t.parentVAlign=y?"start":De[lt]),ot||_||E&&"wrap_content"!==E.type&&("match_parent"!==E.type||!(null==rt?void 0:rt.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0),!b&&("wrap_content"===(null==k?void 0:k.type)||"match_parent"===(null==k?void 0:k.type)&&(null==rt?void 0:rt.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0),"horizontal"===st&&(t.parentContainerOrientation="horizontal"),"vertical"===st&&(t.parentContainerOrientation="vertical"),y&&(t.parentContainerWrap=!0),pt=Nt(t,pt)}return $={orientation:st,valign:lt,halign:ct,wrap:y},x={gap:ut||dt?be(st,ut,dt):void 0,"aspect-ratio":ot},S(),I(),M(),T(),N(),R(),J(),U(),L(),W(),`${B(ie,"Outer").$$render(t,{cls:jt("container",he,$),style:x,json:Q,origJson:et,templateContext:tt,layoutParams:rt,additionalPaddings:w,heightByAspect:Boolean(ot),parentOf:n,replaceItems:function(t){Q=Object.assign(Object.assign({},Q),{items:t.filter(mt)})}},{},{default:()=>`${z(m,(e=>`${B(ci,"Unknown").$$render(t,{layoutParams:pt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} ${ut||dt?`${B(Ve,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:dt,orientation:st,contentHAlign:ct,contentVAlign:lt},{},{})}`:""}`})}`})),Se=Oe,Ie={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Me(t,e){return"vertical"===t||"horizontal"===t?t:e}const Te=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)),_=Me(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(ie,"Outer").$$render(t,{cls:jt("separator",Ie,d),json:g,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>a?`<span${L("class",Ie.separator__inner,0)}${L("style",ut(u),0)}></span>`:""})}`})),ze={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function Ne(t){return t.startsWith("data:")?ht(t):`data:image/jpg;base64,${ht(t)}`}const Be="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Re=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,j,D,P,O,S,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="",Ft="",Vt=0,Dt=0,Pt=0,Ot="",St="";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=>S=t)),g=dt.getDerivedFromVars({content_alignment_horizontal:nt.content_alignment_horizontal,content_alignment_vertical:nt.content_alignment_vertical}),Y(),Y=l(g,(t=>O=t)),h=dt.getDerivedFromVars(nt.accessibility),Z(),Z=l(h,(t=>P=t)),m=dt.getDerivedFromVars(nt.aspect),G(),G=l(m,(t=>D=t)),y=dt.getDerivedFromVars(nt.tint_color),q(),q=l(y,(t=>j=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=Be),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("${Ne(M)}")`:"",yt=gt(I,1,yt),xt=wt(S)||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)}(O,kt),k=(null==P?void 0:P.description)||"";{const t=null==D?void 0:D.ratio;Et=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}{const t=j?gt(j):void 0,e=ve(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;Ft=Bt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=Mt(t.duration,300),Dt=Mt(t.start_delay,0),Vt=Mt(t.alpha,0)}{let t="",e="";Array.isArray(A)&&A.length&&(t=Xt(A,dt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Ot=t,St=e}return E={aspect:"0"!==Et,"is-width-content":$,"is-height-content":x,loaded:!1,"before-appearance":Boolean(Ft)&&!0},C={"background-image":_t,"background-color":_t?void 0:yt,"background-size":xt,"clip-path":St||void 0,"object-fit":xt,"object-position":kt,filter:["",Ot].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?`${Pt}ms`:void 0},J(),U(),W(),q(),G(),Z(),Y(),X(),Q(),K(),tt(),et(),rt(),it(),bt?"":`${B(ie,"Outer").$$render(t,{cls:jt("image",ze,E),json:nt,origJson:lt,templateContext:ot,layoutParams:ct,customDescription:!0},{},{default:()=>E.aspect?`<span${L("class",ze["image__aspect-wrapper"],0)}${H({"padding-bottom":`${Et}%`})}><img${L("class",ze.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",ze.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)}>`})}`})),Je={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 Ue(t){return t>0&&t<1}function Le(t){return String(Math.ceil(1e3*t)/1e3)}function We(t,e,r){if(t.some(Ue)){const e=Math.max(...t.filter(Ue).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)},${Le(t[e])}fr)`:t[e]?o[e]=`${Le(t[e])}fr`:o[e]="auto";return o.join(" ")}const He=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,j=1,D=[],P=[],O=[],S=[],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&&(j=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)),j=oe(y,j),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;D=[],P=[],O=[],S=[],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,(!D[i]||D[i]<v)&&(D[i]=v),(!P[e]||P[e]<g)&&(P[e]=g),(!O[i]||O[i]<f)&&(O[i]=f),(!S[e]||S[e]<h)&&(S[e]=h));do{++e,e>=j&&(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=de(h,T),N=ue(g,N),d={valign:T,halign:N},p={"grid-template-columns":We(D,O,j),"grid-template-rows":We(P,S,I)},v=M,b(),_(),w(),$(),v?"":`${B(ie,"Outer").$$render(t,{cls:jt("grid",Je,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(ci,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),qe=He,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],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 tr(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const er=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,j,D,P,O,S,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",Ft=8,Vt="",Dt=[],Pt={},Ot=!1,St={},Tt=0;N=l(st.isDesktop,(t=>T=t));const zt=tr((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-Ft/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",Ft=8,Vt=""),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=>S=t)),c=st.getDerivedFromVars(et.cross_content_alignment),Y(),Y=l(c,(t=>O=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=>D=t)),p=st.getDerivedFromVars(et.paddings),q(),q=l(p,(t=>j=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((()=>{zt()})),ft.observe(ct)):ft&&(ft.disconnect(),ft=null),Et=oe(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=Me(S,Ct),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(O,At),Ft=Mt(P,Ft),wt=dt(Ft),xt=Mt(D,Ft),$t=dt(xt),Vt=It(j,Vt),$="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))}Dt=[],Et>1?Dt.push("auto"):V.forEach((t=>{!t&&"horizontal"===Ct||"match_parent"===(null==t?void 0:t.type)?Dt.push("100%"):Dt.push("max-content")}));{const t={};let e={};Ot=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ct?e.parentVAlign=At:e.parentHAlign=At,"paging"===F&&(Ot=!0,e.scrollSnap="start",t["horizontal"===Ct?"scroll-padding-left":"scroll-padding-top"]=dt(Ft/2)),1===Et&&(e.parentLayoutOrientation=Ct),Pt=Nt(t,Pt),St=Nt(e,St)}return x={padding:Vt,"grid-gap":$t},k={"grid-gap":wt,[$]:Ke(Dt)},E={orientation:Ct,"scroll-snap":Ot,scrollbar:"auto"===A?"auto":"none"},Tt=Mt(C,Tt),et&&zt(),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(ie,"Outer").$$render(t,{cls:jt("gallery",Ge,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(Ge.gallery__scroller,!0)+" "+I(R?nt:"",!0)}"${L("style",ut(Pt),0)}${L("this",lt,0)}><div${L("class",Ge["gallery__items-grid"],0)}${L("style",ut(x),0)}${L("this",ct,0)}>${z(w,((e,r)=>`<div${L("class",Ge.gallery__items,0)}${L("style",ut(k),0)}${L("this",pt[r],0)}>${z(e,(e=>`${B(ci,"Unknown").$$render(t,{layoutParams:St,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} </div>`))}</div></div> ${"horizontal"===Ct?`${vt&&_?` <div${L("class",yt||`${Ge.gallery__arrow} ${Ze} ${Xe}`,0)}>${yt?"":`<svg${L("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("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${L("class",bt||`${Ge.gallery__arrow} ${Ze} ${Qe}`,0)}>${bt?"":`<svg${L("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("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,ir={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"},nr=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,j,D,P,O,S,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="",Ft="",Vt="",Dt="",Ot="",Tt="",zt="",Bt=0,Rt="",Jt="",Wt=null,Ht=!1,qt=!1,Zt=[],Xt=[],Qt=null;async function Kt(t,e=!1){if(_t=_,_=t,Ht||(Ht=!0,ht.style.height=dt(ht.clientHeight),mt.style.transform=`translate3d(${100*-(null!=_t?_t:_)}%,0,0)`),qt=!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:_);Zt=Zt.map(((t,i)=>t||i>=e&&i<=r)),Xt=Xt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await $();const t=document.getElementById(`${ot}-panel-${_}`);t&&(ht.style.height=dt(t.offsetHeight))}(),Qt&&clearTimeout(Qt),Qt=window.setTimeout((()=>{Xt=n.map(((t,e)=>e===_))}),400),wt=-_*ht.clientWidth,e){await $();const t=ft.querySelector(`.${ir.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,Ft="",bt=void 0,Vt="",Dt="",Ot="",Tt="",zt="",Bt=0,Rt="",Jt="",Wt=null),n=K.items||[],a=n.map((t=>t.div)),s=it.getDerivedFromVars(K.width),G(),G=l(s,(t=>S=t)),c=it.getDerivedFromVars(K.height),q(),q=l(c,(t=>O=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=>D=t)),g=it.getDerivedFromVars(K.separator_color),J(),J=l(g,(t=>j=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==S?void 0:S.type)&&(t.parentHorizontalWrapContent=!0),O&&"wrap_content"!==O.type||(t.parentVerticalWrapContent=!0),$t=Nt(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=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(t.right)||0)/xt*10,bottom:(Number(t.bottom)||0)/xt*10,left:(Number(t.left)||0)/xt*10};kt=It(e,kt)}{const t=w.line_height;void 0!==t&&Yt(t)&&(Et=dt(t/xt*10))}{const t=w.letter_spacing;void 0!==t&&St(t)&&(Ct=dt(t/xt*10))}if(w.corner_radius||w.corners_radius||w.font_size){const t=null!==(X=w.corner_radius)&&void 0!==X?X:1e3;w.corners_radius?At=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!St(n[t]))return i;return Lt(t,e,r)}(w.corners_radius,t,xt,At):St(t)&&(At=dt(t/xt*10))}return yt=se(w.active_font_weight||w.font_weight,yt),Ft=w.font_family&&"string"==typeof w.font_family?it.typefaceProvider(w.font_family,{fontWeight:yt||400}):"",bt=se(w.inactive_font_weight||w.font_weight,bt),Vt=w.font_family&&"string"==typeof w.font_family?it.typefaceProvider(w.font_family,{fontWeight:bt||400}):"",Dt=gt(w.active_text_color,1,Dt),Ot=gt(w.inactive_text_color,1,Ot),Tt=gt(w.active_background_color,1,Tt),zt=gt(w.inactive_background_color,1,zt),Bt=Mt(w.item_spacing,Bt),D&&(j&&(Rt=gt(j,1,Rt)),V&&(Jt=It(V,Jt))),x={background:Rt,margin:Jt},k=void 0===F||Boolean(F),Wt=Ut(A||void 0,Wt),ct||(Zt=n.map(((t,e)=>e===_)),Xt=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');Kt(t)},setPreviousItem(t){let e=_-1;e<0&&(e="ring"===t?n.length-1:_),Kt(e)},setNextItem(t){let e=_+1;e>n.length-1&&(e="ring"===t?0:_),Kt(e)}}))),C(),T(),N(),R(),J(),U(),W(),q(),G(),Z(),ct?"":`${B(ie,"Outer").$$render(t,{cls:jt("tabs",ir,{}),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(ir.tabs__list,!0)+" "+I(M?nt:"",!0)}" role="tablist"${H({"--divkit-tabs-title-padding":Wt?Pt(Wt):"","--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":Vt||"","--divkit-tabs-active-text-color":Dt,"--divkit-tabs-inactive-text-color":Ot,"--divkit-tabs-active-background-color":Tt,"--divkit-tabs-inactive-background-color":zt,"--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(Gt,"Actionable").$$render(t,{cls:jt("tabs__item",ir,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=rt&&rt.fakeElement?[]:[e.title_click_action],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||(Kt(e),!1)}(0,r)},{},{default:()=>`${I(e.title)} `})}`}))}</div> ${D?`<div${L("class",ir.tabs__separator,0)}${L("style",ut(x),0)}></div>`:""} <div class="${I(ir.tabs__panels,!0)+" "+I(M?nt:"",!0)}"${L("this",ht,0)}><div${L("class",jt("tabs__swiper",ir,{inited:Ht,animated:qt}),0)}${L("this",mt,0)}>${z(E,(e=>{let r=e.index;return` <div${L("class",jt("tabs__panel",ir,{visible:Xt[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)+"%"}">${Zt[r]?`${B(ci,"Unknown").$$render(t,{div:n[r].div,templateContext:tt,layoutParams:$t},{},{})}`:""} </div>`}))}</div></div>`})}`})),or=nr,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,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}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=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:j}=e,{data:D}=e,{internalId:P}=e,{templateContext:O}=e;const S=f(at);y=l(S.isDesktop,(t=>m=t)),Date.now();return v((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==j&&r.ownerNode(j),void 0===e.data&&r.data&&void 0!==D&&r.data(D),void 0===e.internalId&&r.internalId&&void 0!==P&&r.internalId(P),void 0===e.templateContext&&r.templateContext&&void 0!==O&&r.templateContext(O),n=S.getDerivedFromVars(D.position),x(),x=l(n,(t=>h=t)),a=S.getDerivedFromVars(null===(A=null===(C=D.offset)||void 0===C?void 0:C.x)||void 0===A?void 0:A.value),$(),$=l(a,(t=>g=t)),s=S.getDerivedFromVars(null===(V=null===(F=D.offset)||void 0===F?void 0:F.y)||void 0===V?void 0:V.value),w(),w=l(s,(t=>p=t)),c=S.getDerivedFromVars(D.animation_in),k(),k=l(c,(t=>b=t)),u=S.getDerivedFromVars(D.animation_out),E(),E=l(u,(t=>_=t)),d={visible:!1},w(),$(),x(),y(),k(),E(),` <div class="${I(jt("tooltip",dr,d),!0)+" "+I(m?it:"",!0)}"${H({top:"",left:"",width:"",height:""})}${L("this",undefined,0)}>${B(ci,"Unknown").$$render(t,{div:D.div,templateContext:O},{},{})}</div>`}));function vr(t){return"change_bounds"===t.type?t:"set"===t.type?vr(t.items[0]):null}const gr=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(Dt);let b,_,w,x=!1,k=new Map,E=new Set,C=null,A=[],F=[],V=[],j=[],D=null,P=!1;function O(t,e,r){let{json:i,templateContext:n,transitions:o,node:a}=e;i=m.getJsonWithVars(i),o=m.getJsonWithVars(o);const s=ur(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 S(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=>O(t,e,"out")))}j.forEach((t=>{k.set(t.id,t.node.getBoundingClientRect())})),F=[],V=[],j=[];const i=l.find((e=>e.state_id===t))||null;if(i?(w=t,null==s||s.setValue(w),D=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=>O(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,cr(e.transitions))),0),u=j.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(vr(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(Dt,{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=O(b.getBoundingClientRect(),{json:t,templateContext:e,transitions:r,node:i},n),a=cr(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 j.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:S,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,D=t.find((t=>t.state_id===w))||null,D||m.logError(st(new Error("Cannot find state for default_state_id"),{additional:{selectedId:w}}))):(D=t[0],w=D.state_id),s&&(s.setValue(w),s.subscribe((t=>{S(t)})))}}(l),x?"":`${B(ie,"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&&(D=r.find((t=>t.state_id===w))||null)}},{},{default:()=>{var e;return`${null!==(e=D)&&void 0!==e&&e.div?`${B(ci,"Unknown").$$render(t,{div:D.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",ar,0)}${H({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${L("class",sr,0)}>${B(ci,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`:`<div${L("class",ar,0)}><div${L("class",sr,0)}>${B(ci,"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(pr,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,templateContext:d},{},{})}`))}`:""}`})),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=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,j,D=o,P=o,O=o,S=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)),tr((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),S(),S=l(s,(t=>F=t)),u=X.getDerivedFromVars(q.paddings),O(),O=l(u,(t=>A=t)),d=X.getDerivedFromVars(q.restrict_parent_scroll),T(),T=l(d,(t=>j=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=Me(V,vt);{const t=null==F?void 0:F.value;t&&St(t)&&(gt=dt(t||0))}if(ft=It(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"),D(),D=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)}}))),D(),E(),P(),O(),S(),M(),T(),y?"":`${B(ie,"Outer").$$render(t,{cls:jt("pager",hr,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(hr.pager__items,!0)+" "+I(j?nt:"",!0)}"${L("style",ut(h),0)}${L("this",rt,0)}>${z(p,(e=>`<div${L("class",hr.pager__item,0)}>${B(ci,"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||`${hr.pager__arrow} ${Ze} ${Xe}`,0)}>${K?"":`<svg${L("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("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${L("class",tt||`${hr.pager__arrow} ${Ze} ${Qe}`,0)}>${tt?"":`<svg${L("class",Ye,0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${L("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_placement_stretch:"divkit-b6bd3"},_r=["rounded_rectangle","circle"],wr=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,j=o,D=o,P=o,O=o,S=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),j(),j=l(a,(t=>_=t)),s=q.getDerivedFromVars(R.inactive_item_color),D(),D=l(s,(t=>w=t)),c=q.getDerivedFromVars(R.active_item_size),O(),O=l(c,(t=>k=t)),u=q.getDerivedFromVars(R.active_shape),M(),M=l(u,(t=>C=t)),d=q.getDerivedFromVars(R.inactive_shape),S(),S=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=$e({type:"shape_drawable",shape:C},_r,X)),E&&(Q=$e({type:"shape_drawable",shape:E},_r,Q)),!C&&!E&&x){const t=oe(k,1.3);Q=$e({type:"shape_drawable",shape:x,color:Q.background},_r,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=Mt(y.value,et));else if(K=b.type,"default"===K)et=Mt(null===(T=b.space_between_centers)||void 0===T?void 0:T.value,et);else if("stretch"===K){const t=b;rt=oe(t.max_visible_items,rt),it=Mt(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(),j(),D(),P(),O(),S(),M(),`${B(ie,"Outer").$$render(t,{cls:jt("indicator",br,h),json:R,origJson:U,templateContext:J,layoutParams:W},{},{default:()=>`<div${L("class",br.indicator__scroller,0)}${L("this",G,0)}><div${L("class",br.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(jt("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)}"${L("aria-selected",r?"true":"false",0)}${L("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__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,i=t.text_color&>(t.text_color)||"#000",n=ae(t.font_weight);if(Yt(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 Er(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Cr="function"==typeof BigInt;function Ar(t){return Cr?BigInt(t):Number(t)}const Fr=Ar("9223372036854775807"),Vr=Ar("-9223372036854775808");function jr(t){const e=Ar(t);if(e>Fr||e<Vr)throw new Error("Integer overflow.");return e}const Dr=jr(0);function Pr(t){let e=t;return e<0&&(e=-e),e}function Or(t){let e=0;return t>0?e=1:t<0&&(e=-1),jr(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 Ir={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>Fr||t<Vr)throw new Error("Incorrect variable value");return jr(t)}fromString(t){const e=jr(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 Mr(t,e,r){if(!(e in Ir))throw new Error("Unsupported variable type");return new Ir[e](t,r)}const Tr={width:10,height:10,borderRadius:5,background:"#000"},zr=["rounded_rectangle","circle"],Nr=["rounded_rectangle"];function Br(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 Rr=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,j,D,P,O,S,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,Ft,Vt,Dt=0,Pt=100,Ot=Tr,It=Ot,Mt=Tr,Tt=Tr,zt=null,Nt=null,Bt=Vt,Jt="",Ut="",Lt=!1,Wt=Er(G||0,Dt,Pt),qt=Er(q||0,Dt,Pt),Gt=!1;function Zt(){if(!Ct)return;const t=Pt-Dt,e=(null==zt?void 0:zt.width)||0,r=(null==Nt?void 0:Nt.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}tr(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=Tr,It=Ot,Mt=Tr,Tt=Tr,zt=null,Nt=null,Vt=void 0,Bt=void 0,Jt="",Ut=""),n=bt.thumb_value_variable,a=bt.thumb_secondary_value_variable,s=n&&xt.getVariable(n,"integer")||Mr("temp","integer",0),ut(),ut=l(s,(t=>G=t)),c=a&&xt.getVariable(a,"integer")||Mr("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=>S=t)),$=xt.getDerivedFromVars(bt.accessibility),Q(),Q=l($,(t=>O=t)),x=xt.getDerivedFromVars(bt.secondary_value_accessibility),X(),X=l(x,(t=>P=t)),Dt=Rt(Y,Dt),Pt=Rt(Z,Pt),Zt();{const t=Er(G||0,Dt,Pt);t!==Wt&&(Wt=t)}{const t=Er(q||0,Dt,Pt);t!==qt&&(qt=t)}Ot=$e(W,zr,Ot),It=$e(U,zr,Ot),Mt=$e(J,Nr,Mt),Tt=$e(R,Nr,Tt);{let t=$e(N,zr,Tr);t!==Tr&&(zt=t)}zt?(At=a?Br(Math.min(Wt,qt),Math.max(Wt,qt)+1,Dt,Pt,!0):Br(Dt,Wt,Dt,Pt,!0),Zt()):At=[];{let t=$e(T,zr,Tr);t!==Tr&&(Nt=t)}Nt?(Ft=a?Br(Math.min(Wt,qt),Math.max(Wt,qt)+1,Dt,Pt,!1):Br(Wt+1,Pt+1,Dt,Pt,!0),Zt()):Ft=[],Vt=kr(M,Vt),Bt=kr(S,Vt),(null==O?void 0:O.description)?Jt=O.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===Tr?(xt.logError(st(new Error('Missing "thumb_style" in slider'))),t=!0):Tt===Tr?(xt.logError(st(new Error('Missing "track_active_style" in slider'))),t=!0):Mt===Tr&&(xt.logError(st(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Lt&&(Lt=t)}return k=dt(Math.max(...[Ot.width,It.width,0].filter(St))),E=dt(Math.max(...[Ot.height,It.height,0].filter(St))),C=(Wt-Dt)/(Pt-Dt),A=a?(qt-Dt)/(Pt-Dt):void 0,F=void 0!==A?Math.abs(A-C):C,V=void 0!==A?Math.min(A,C):0,j={"--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==Vt?void 0:Vt.offset)||void 0===ft?void 0:ft.x)?pt(Vt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ht=null==Vt?void 0:Vt.offset)||void 0===ht?void 0:ht.y)?pt(Vt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(mt=null==Bt?void 0:Bt.offset)||void 0===mt?void 0:mt.x)?pt(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(yt=null==Bt?void 0:Bt.offset)||void 0===yt?void 0:yt.y)?pt(Bt.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":Nt?dt(Nt.width):void 0,"--divkit-slider-tick-inactive-height":Nt?dt(Nt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Nt?dt(Nt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Nt?void 0:Nt.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},D={},X(),Q(),K(),tt(),et(),rt(),it(),nt(),ot(),lt(),ct(),ut(),vt(),gt()," "+(Lt?"":`${B(ie,"Outer").$$render(t,{cls:jt("slider",xr,D),style:j,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",xr["slider__tracks-wrapper"],0)}><div${L("class",xr["slider__tracks-inner"],0)}${L("this",Ct,0)}><div${L("class",xr.slider__track,0)}${H({height:dt(Mt.height),"border-radius":dt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}></div> <div${L("class",xr["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(xr.slider__tick,!0)+" "+I(xr.slider__tick_active,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} ${z(Ft,(t=>`<div class="${I(xr.slider__tick,!0)+" "+I(xr.slider__tick_inactive,!0)}"${H({"--divkit-slider-tick":t})}></div>`))} <div${L("class",xr.slider__thumb,0)}${H({"border-radius":dt(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Vt?`<div${L("class",xr["slider__thumb-text"],0)}><div${L("class",xr["slider__thumb-text-inner"],0)}${H({"font-size":(null===(r=Vt)||void 0===r?void 0:r.fontSize)||"1em","font-weight":(null===(i=Vt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(n=Vt)||void 0===n?void 0:n.textColor)||"#000"})}>${I(Wt)}</div></div>`:""}</div> ${a?`<div class="${I(xr.slider__thumb,!0)+" "+I(xr.slider__thumb_secondary,!0)}"${H({"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${L("class",xr["slider__thumb-text-inner"],0)}${H({"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(qt)}</div></div>`:""}</div>`:""} <input type="range"${L("class",xr.slider__input,0)}${L("min",Dt,0)}${L("max",Pt,0)} step="1"${L("value",Wt,0)}${L("aria-label",Jt,0)}${L("this",undefined,0)}> ${a?`<input type="range"${L("class",`${xr.slider__input} ${xr.slider__input_secondary}`,0)}${L("min",Dt,0)}${L("max",Pt,0)} step="1"${L("value",qt,0)}${L("aria-label",Ut,0)}>`:""}</div></div>`}})}`)})),Jr={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 Ur(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=Ur(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 Lr(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 Wr{constructor(t){this.char=t}}class Hr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class qr{constructor(t){Lr(this,"filters",new Map),Lr(this,"destructedValue",[]),Lr(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 Wr)t+=r.char;else if(r instanceof Hr)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 Hr&&!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 Hr(null,this.filters.get(e.key),e.placeholder):new Wr(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=Ur(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 Hr&&++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 Hr&&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 Hr&&(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 Hr);)++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 Hr&&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 Hr&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof Hr);)++e;return e}}class Gr extends qr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function Zr(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 Yr extends qr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),Zr(this,"currencyFormatter",new Intl.NumberFormat),Zr(this,"decimalSeparator","."),Zr(this,"localeDigits",{}),Zr(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=Ur(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 Xr(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 Qr(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=Xr(i);if(e<=n)return void Qr(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 Kr="undefined"!=typeof document&&"inputMode"in document.createElement("input"),ti={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"},ei=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,j,D,P,O,S,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,Ft=o,Vt=o;var Dt;let{json:St={}}=e,{templateContext:It}=e,{origJson:Tt}=e,{layoutParams:zt}=e;const Nt=f(at);let Bt,Rt,Jt,Lt,Wt,Ht=null,qt="",Gt="",Zt=!1,Xt="",Qt=12,Kt="",te="",ee="#000",re="",ne="left",ae="center",le="multi_line_text",ce="text",pe="",ve=null,ge="",fe="",he="";function me(t){Rt instanceof HTMLInputElement?Rt.selectionStart=Rt.selectionEnd=t:Qr(Rt,t)}async function ye(){if(!Rt||!Ht)return;Ht.overrideRawValue(N),u.set(Ht.rawValue),c(s,z=qt=Gt=Ht.value,z);const t=Ht.cursorPosition;await $(),document.activeElement===Rt&&me(t)}var be;v((()=>{Bt&&(Nt.unregisterFocusable(Bt),Bt=void 0)})),void 0===e.json&&r.json&&void 0!==St&&r.json(St),void 0===e.templateContext&&r.templateContext&&void 0!==It&&r.templateContext(It),void 0===e.origJson&&r.origJson&&void 0!==Tt&&r.origJson(Tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==zt&&r.layoutParams(zt),St&&(Xt="",Qt=12,Jt=void 0,Kt="",Lt=void 0,ee="#000",re="",ne="left",ae="center",le="multi_line_text",ce="text",Wt=void 0),n=St.text_variable,a=null===(Dt=St.mask)||void 0===Dt?void 0:Dt.raw_text_variable,s=n&&Nt.getVariable(n,"string")||Mr("temp","string",""),ot(),ot=l(s,(t=>z=t)),u=a&&Nt.getVariable(a,"string")||Mr("temp","string",""),lt(),lt=l(u,(t=>N=t)),d=Nt.getDerivedFromVars(St.hint_text),Ft(),Ft=l(d,(t=>it=t)),p=Nt.getDerivedFromVars(St.hint_color),At(),At=l(p,(t=>rt=t)),g=Nt.getDerivedFromVars(St.font_size),Ct(),Ct=l(g,(t=>et=t)),h=Nt.getDerivedFromVars(St.font_weight),Et(),Et=l(h,(t=>tt=t)),m=Nt.getDerivedFromVars(St.font_family),kt(),kt=l(m,(t=>K=t)),y=Nt.getDerivedFromVars(St.line_height),xt(),xt=l(y,(t=>Q=t)),b=Nt.getDerivedFromVars(St.letter_spacing),$t(),$t=l(b,(t=>X=t)),_=Nt.getDerivedFromVars(St.text_color),wt(),wt=l(_,(t=>Y=t)),w=Nt.getDerivedFromVars(St.highlight_color),_t(),_t=l(w,(t=>Z=t)),x=Nt.getDerivedFromVars(St.text_alignment_horizontal),bt(),bt=l(x,(t=>G=t)),k=Nt.getDerivedFromVars(St.text_alignment_vertical),yt(),yt=l(k,(t=>q=t)),E=Nt.getDerivedFromVars(St.keyboard_type),mt(),mt=l(E,(t=>H=t)),C=Nt.getDerivedFromVars(St.mask),ht(),ht=l(C,(t=>W=t)),A=Nt.getDerivedFromVars(St.max_visible_lines),ft(),ft=l(A,(t=>U=t)),F=Nt.getDerivedFromVars(St.paddings),vt(),vt=l(F,(t=>J=t)),V=Nt.getDerivedFromVars(St.accessibility),ct(),ct=l(V,(t=>R=t)),j=Nt.getDerivedFromVars(St.select_all_on_focus),Vt(),Vt=l(j,(t=>nt=t)),n?Zt=!1:(Zt=!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 Gr(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 Yr(t.locale,e)}(be,Nt.logError,Ht)),Ht&&ye(),Ht||qt===z||(qt=Gt=z),Ht&&Ht.rawValue!==N&&ye(),D=it,Xt=gt(rt,1,Xt),Qt=oe(et,Qt),Jt=se(tt,Jt),Kt=K&&"string"==typeof K?Nt.typefaceProvider(K,{fontWeight:Jt||400}):"";{const t=Q;Yt(t)&&(Lt=t/Qt)}return Ot(X)&&(te=dt(X)),ee=gt(Y,1,ee),re=gt(Z,1,re),ne=ue(G,ne),ae=de(q,ae),H&&H in ti&&(ce=ti[H],le=H),"currency"===(null==W?void 0:W.type)&&(ce=Kr?"text":"tel",Wt="decimal"),P="multi_line_text"===le,pe=Yt(U)?`calc(${U*(Lt||1.25)*(Qt/10)+"em"} + ${pt(Mt(null==J?void 0:J.top,0)+Mt(null==J?void 0:J.bottom,0))})`:"",ve=Ut(J||void 0,ve),ge=ve?Pt({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?Pt({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"})),O={"highlight-color":Boolean(re),multiline:P,"alignment-horizontal":ne,"alignment-vertical":ae},S={"--divkit-input-hint-color":Xt,"--divkit-input-highlight-color":re,"--divkit-input-line-height":Lt,"font-weight":Jt,"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},Rt&&St&&(Bt&&(Nt.unregisterFocusable(Bt),Bt=void 0),St.id&&!(null==zt?void 0:zt.fakeElement)&&(Bt=St.id,Nt.registerFocusable(St.id,{focus(){Rt&&Rt.focus()}}))),ot(),lt(),ct(),vt(),ft(),ht(),mt(),yt(),bt(),_t(),wt(),$t(),xt(),kt(),Et(),Ct(),At(),Ft(),Vt(),Zt?"":`${B(ie,"Outer").$$render(t,{cls:jt("input",Jr,O),style:S,customDescription:!0,customActions:"input",customPaddings:!0,hasInnerFocusable:!0,json:St,origJson:Tt,templateContext:It,layoutParams:zt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return P?`<span${L("class",Jr["input__scroll-wrapper"],0)}>${!Gt&&D?`<div${L("class",Jr.input__placeholder,0)} aria-hidden="true"${L("style",ut(M),0)}>${I(D)}</div>`:""} <span aria-hidden="true"${L("style",ut(T),0)}></span> <span${L("class",jt("input__input",Jr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${L("aria-label",he,0)}${L("style",ut(M),0)}${L("this",Rt,0)}>${i=Gt,void 0===i?"":i}</span></span>`:`<input${L("type",ce,0)}${L("inputmode",Wt,0)}${L("class",jt("input__input",Jr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${L("aria-label",he,0)}${L("style",ut(M),0)}${L("placeholder",D,0)}${L("value",qt,0)}${L("this",Rt,0)}>`;var i}})}`})),ri={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"},ii=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,j,D,P,O,S,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")||Mr("temp","string",""),Y(),Y=l(c,(t=>M=t)),u=rt.getDerivedFromVars(Q.paddings),Z(),Z=l(u,(t=>S=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=>O=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=>D=t)),m=rt.getDerivedFromVars(Q.font_family),W(),W=l(m,(t=>j=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=oe(P,ht),pt=Ut(S||void 0,pt),vt=pt?Pt({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(O,1,ft),nt=se(D,nt),mt=j&&"string"==typeof j?rt.typefaceProvider(j,{fontWeight:nt||400}):"";{const t=V;Yt(t)&&(ot=t/ht)}return Ot(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(ie,"Outer").$$render(t,{cls:jt("select",ri,$),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",ri["select__select-text"],0)}${L("style",ut(k),0)} aria-hidden="true"> ${I(ct||T||"")}</span> <select${L("class",jt("select__select",ri,{"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",ri.select__option,0)}${L("value",t.value,0)}>${I(t.text||t.value)}</option>`))}</select>`})}`})),ni={video__video:"divkit-c11f9","video__aspect-wrapper":"divkit-cfe32",video_aspect:"divkit-a4f5c"},oi=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,j=o,D=o,P=o,{json:O={}}=e,{templateContext:S}=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";var tt,et;v((()=>{N&&(T.unregisterInstance(N),N=void 0),U&&(U(),U=void 0)})),void 0===e.json&&r.json&&void 0!==O&&r.json(O),void 0===e.templateContext&&r.templateContext&&void 0!==S&&r.templateContext(S),void 0===e.origJson&&r.origJson&&void 0!==I&&r.origJson(I),void 0===e.layoutParams&&r.layoutParams&&void 0!==M&&r.layoutParams(M),O&&(Z=!1,Y=!1,X=!1,J=void 0,Q="fit"),n=O.elapsed_time_variable,a=n&&T.getVariable(n,"integer")||Mr("temp","integer",0),a&&(U&&U(),U=a.subscribe((function(t){q&&(q=!1)}))),s=T.getDerivedFromVars(O.video_sources),P(),P=l(s,(t=>E=t)),c=T.getDerivedFromVars(O.repeatable),D(),D=l(c,(t=>k=t)),u=T.getDerivedFromVars(O.autostart),j(),j=l(u,(t=>x=t)),d=T.getDerivedFromVars(O.muted),V(),V=l(d,(t=>$=t)),p=T.getDerivedFromVars(O.preview),F(),F=l(p,(t=>w=t)),g=T.getDerivedFromVars(O.scale),A(),A=l(g,(t=>_=t)),h=T.getDerivedFromVars(O.aspect),C(),C=l(h,(t=>b=t)),tt=E,et=G,G=Array.isArray(tt)&&tt.length?tt.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})):et,G.length?W=!1:(W=!0,T.logError(st(new Error('Missing "video_sources" in "video"')))),Z=pe(k,Z),Y=pe(x,Y),X=pe($,X),J="string"==typeof w?Ne(w):J,Q=function(t){return"fill"===t?"cover":"no_scale"===t?"none":"contain"}(_)||Q;{const t=null==b?void 0:b.ratio;K=t&&Yt(t)?(100/Number(t)).toFixed(2):"0"}return O&&(N&&(T.unregisterInstance(N),N=void 0),!O.id||W||(null==M?void 0:M.fakeElement)||(N=O.id,T.registerInstance(O.id,{pause(){},start(){const t=void 0;t&&t.catch((t=>{T.logError(st(new Error("Video playing error"),{level:"error",additional:{originalText:String(t)}}))}))}}))),m={aspect:"0"!==K},y={"object-fit":Q},C(),A(),F(),V(),j(),D(),P(),W?"":`${B(ie,"Outer").$$render(t,{cls:jt("video",ni,m),customActions:"video",json:O,origJson:I,templateContext:S,layoutParams:M},{},{default:()=>m.aspect?`<div${L("class",ni["video__aspect-wrapper"],0)}${H({"padding-bottom":`${K}%`})}><video${L("class",ni.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",ni.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>`})}`})),ai=oi,si=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(ie,"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)}>${j(e)?"":`${g?`<template${P([T(h)],{})}> ${g}</template>`:""} ${!m&&n?`${z(o,(e=>`${B(ci,"Unknown").$$render(t,{layoutParams:a,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`:""}`}${j(e)?"":`</${e}>`}`:"";var e}})}`:""})),li={};li.text=fe,li.container=Se,li.separator=Te,li.image=Re,li.gif=Re,li.grid=qe,li.gallery=rr,li.tabs=or,li.state=fr,li.pager=yr,li.indicator=$r,li.slider=Rr,li.input=ei,li.select=ii,li.video=ai,li.custom=si;const ci=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&&li[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&li[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},{},{})}`:""})),ui=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 di(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 pi(){}function vi(t){return{subscribe:e=>(e(t),pi)}}function gi(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function fi(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function hi(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 mi(t){try{return jr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function yi(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function bi(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,bi.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function _i(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function wi(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:je,JsonStringContents:function(){var t,e,r;for(t=me,e=[],r=De();r!==i;)e.push(r),r=De();return ye=t,e=Ot(e)}},a=je,s="@{",l="}",c="@{}",u="\\",d="?",p=":",v="!:",g="||",f="&&",h="==",m="!=",y=">=",b=">",_="<=",w="<",$="+",x="-",k="/",E="*",C="%",A="!",F="(",V=")",j=",",D="'",P=".",O="e",S="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),jt=Ce("whitespace"),Dt=Ee([" ","\t","\r","\n"],!1,!1),Pt=function(t){return t},Ot=function(t){return hi(t)},St=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 yi(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 fi(t,e)},Wt=function(t,e){return fi(t,e)},Ht=function(t,e){return gi(t,e)},qt=function(t,e){return gi(t,e)},Gt=function(t,e){return gi(t,e)},Zt=function(t,e){return gi(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 hi(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 yi(t)},ue=function(){throw new Error("Error tokenizing '"+t+"'.")},de=function(){return{type:"IntegerLiteral",value:mi(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 je(){var t,e;return t=me,We(),(e=Pe())!==i?(We(),ye=t,t=Pt(e)):(me=t,t=i),t}function De(){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=St(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=Oe())!==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=Oe()),e}function Oe(){var e,r,n,o;return e=me,(r=Se())!==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=Se()),e}function Se(){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=j,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=j,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=D,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,t=e=re(e)}(),39===t.charCodeAt(me)?(o=D,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=D,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=O,me++):(l=i,0===$e&&Ve($t)),l===i&&(69===t.charCodeAt(me)?(l=S,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=O,me++):(o=i,0===$e&&Ve($t)),o===i&&(69===t.charCodeAt(me)?(o=S,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(Dt));r!==i;)e.push(r),J.test(t.charAt(me))?(r=t.charAt(me),me++):(r=i,0===$e&&Ve(Dt));return $e--,r=i,0===$e&&Ve(jt),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 bi(bi.buildMessage(t,e),t,e,r)}(we,_e<t.length?t.charAt(_e):null,_e<t.length?Fe(_e,_e+1):Fe(_e,_e))}vi(void 0),function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(bi,Error),bi.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=_i("",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+" | "+_i("",n.column-1," ")+_i("",u,"^")}else e+="\n at "+a}return e},bi.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,xi=new Map;function ki(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("#");xi.set(o,i)}function Ei(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 Ci(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=>{Ci(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Ci(t.left,e),Ci(t.right,e);break;case"UnaryExpression":Ci(t.argument,e);break;case"ConditionalExpression":Ci(t.test,e),Ci(t.consequent,e),Ci(t.alternate,e);break;case"TryExpression":Ci(t.test,e),Ci(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Ci(t,e)}))}}function Ai(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Fi(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Vi(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 Fi(t.value);if("color"===t.type)return Ti(Mi(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 ji(t){let e=Vi(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Di(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Pi(t,e){if(Cr)return jr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Oi(t,e){if(e<Vr||e>Fr)throw new Error("Integer overflow.");!Cr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Si(t){const e=[];return Ci(t,{Variable(t){e.push(t.id.name)}}),e}function Ii(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Mi(t){const e=ft(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Ti(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 zi(t){return Ti(Mi(t))}const Ni=Number.MAX_VALUE,Bi=Number.MIN_VALUE,Ri="string",Ji="integer",Ui="number",Li="boolean",Wi="color",Hi="url",qi="datetime",Gi="dict",Zi="array";function Yi(t,e){return{type:Ri,value:Vi(e)}}function Xi(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ui,value:r}}function Qi(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=zi(o)),{type:i,value:o}}function Ki(t,e,r){return Qi(t,e,r,r.type)}function tn(t,e,r){return Qi(t,e,r,"color")}function en(t,e,r){return Qi(t,e,r,"url")}const rn=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:Ji,value:jr(i)}},nn=rn("getUTCFullYear"),on=rn("getUTCMonth"),an=rn("getUTCDate"),sn=rn("getUTCDay"),ln=rn("getUTCHours"),cn=rn("getUTCMinutes"),un=rn("getUTCSeconds"),dn=rn("getUTCMilliseconds");function pn(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===Ri?e.value:Vi(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 vn(t,e,r,i){const n=pn(t,e,r,i);return{type:Ri,value:n+Vi(e)}}function gn(t,e,r,i){const n=pn(t,e,r,i);return{type:Ri,value:Vi(e)+n}}function fn(t){return(e,r)=>{const i=Mi(r.value);return{type:Ui,value:i[t]/255}}}function hn(t){return(e,r,i)=>{const n=Mi(r.value);return n[t]=255*i.value,{type:Wi,value:Ti(n)}}}const mn=fn("a"),yn=fn("r"),bn=fn("g"),_n=fn("b"),wn=hn("a"),$n=hn("r"),xn=hn("g"),kn=hn("b");function En(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=jr(e.value)/jr(r);return Oi(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=jr(n)%jr(i)),{type:Ji,value:n}}const Cn=36e5;function An(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.");Oi(r,o),o=jr(o)}return"string"===t&&"color"===e&&(o=zi(o)),{type:e,value:o}}}function Fn(t,e){return(r,i,n,...o)=>{try{return t(r,n,...o)}catch(t){let r=i.value;return"color"===e&&(r=zi(r)),{type:e,value:r}}}}const Vn=An("string","string"),jn=An("number","number"),Dn=An("number","integer"),Pn=An("boolean","boolean"),On=An("string","color"),Sn=An("string","url"),In=Fn(Vn,"string"),Mn=Fn(jn,"number"),Tn=Fn(Dn,"integer"),zn=Fn(Pn,"boolean"),Nn=Fn(On,"color"),Bn=Fn(Sn,"url");function Rn(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||"obejct"===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.");Oi(r,o),o=jr(o)}return"string"===t&&"color"===e&&(o=zi(o)),{type:e,value:o}}}function Jn(t,e){return(r,i,n,o)=>{try{return t(r,i,n)}catch(t){let r=o.value;return"color"===e&&(r=zi(r)),{type:e,value:r}}}}const Un=Rn("string","string"),Ln=Rn("number","number"),Wn=Rn("number","integer"),Hn=Rn("boolean","boolean"),qn=Rn("string","color"),Gn=Rn("string","url"),Zn=Rn("array","array"),Yn=Rn("object","dict"),Xn=Jn(Un,"string"),Qn=Jn(Ln,"number"),Kn=Jn(Wn,"integer"),to=Jn(Hn,"boolean"),eo=Jn(qn,"color"),ro=Jn(Gn,"url");function io(t){return t.map(ji).join(", ")}ki("toString",[Ji],Yi),ki("toString",[Ui],Yi),ki("toString",[Li],Yi),ki("toString",[Wi],Yi),ki("toString",[Hi],Yi),ki("toNumber",[Ji],Xi),ki("toNumber",[Ri],Xi),ki("toInteger",[Ui],(function(t,e){if(e.value>Fr||e.value<Vr)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Ji,value:jr(r)}})),ki("toInteger",[Ri],(function(t,e){let r;try{r=jr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>Fr||r<Vr)throw new Error("Unable to convert value to Integer.");return{type:Ji,value:r}})),ki("toInteger",[Li],(function(t,e){return{type:Ji,value:jr(e.value?1:0)}})),ki("toBoolean",[Ji],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Li,value:r}})),ki("toBoolean",[Ri],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Li,value:"true"===e.value?1:0}})),ki("toColor",[Ri],(function(t,e){return{type:Wi,value:zi(e.value)}})),ki("toUrl",[Ri],(function(t,e){return{type:Hi,value:e.value}})),ki("encodeUri",[Ri],(function(t,e){try{return{type:Ri,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),ki("decodeUri",[Ri],(function(t,e){try{return{type:Ri,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),ki("getIntegerValue",[Ri,Ji],Ki),ki("getNumberValue",[Ri,Ui],Ki),ki("getBooleanValue",[Ri,Li],Ki),ki("getStringValue",[Ri,Ri],Ki),ki("getColorValue",[Ri,Wi],tn),ki("getColorValue",[Ri,Ri],tn),ki("getUrlValue",[Ri,Hi],en),ki("getUrlValue",[Ri,Ri],en),ki("parseUnixTime",[Ji],(function(t,e){return{type:qi,value:new Date(1e3*Number(e.value))}})),ki("nowLocal",[],(function(){return{type:qi,value:new Date}})),ki("addMillis",[qi,Ji],(function(t,e,r){return{type:qi,value:new Date(e.value.getTime()+Number(r.value))}})),ki("setYear",[qi,Ji],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:qi,value:i}})),ki("setMonth",[qi,Ji],(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:qi,value:n}})),ki("setDay",[qi,Ji],(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 ${Vi(e)}.`);return i.setUTCDate(-1===n?0:n),{type:qi,value:i}})),ki("setHours",[qi,Ji],(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:qi,value:n}})),ki("setMinutes",[qi,Ji],(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:qi,value:n}})),ki("setSeconds",[qi,Ji],(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:qi,value:n}})),ki("setMillis",[qi,Ji],(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:qi,value:n}})),ki("getYear",[qi],nn),ki("getMonth",[qi],on),ki("getDay",[qi],an),ki("getDayOfWeek",[qi],sn),ki("getHours",[qi],ln),ki("getMinutes",[qi],cn),ki("getSeconds",[qi],un),ki("getMillis",[qi],dn),ki("getIntervalSeconds",[Ji],(function(t,e){return En(t,e,1e3,60)})),ki("getIntervalTotalSeconds",[Ji],(function(t,e){return En(t,e,1e3)})),ki("getIntervalMinutes",[Ji],(function(t,e){return En(t,e,6e4,60)})),ki("getIntervalTotalMinutes",[Ji],(function(t,e){return En(t,e,6e4)})),ki("getIntervalHours",[Ji],(function(t,e){return En(t,e,Cn,24)})),ki("getIntervalTotalHours",[Ji],(function(t,e){return En(t,e,Cn)})),ki("getIntervalTotalDays",[Ji],(function(t,e){return En(t,e,864e5)})),ki("getIntervalTotalWeeks",[Ji],(function(t,e){return En(t,e,6048e5)})),ki("len",[Ri],(function(t,e){return{type:Ji,value:jr(e.value.length)}})),ki("contains",[Ri,Ri],(function(t,e,r){return{type:Li,value:e.value.includes(r.value)?1:0}})),ki("substring",[Ri,Ji,Ji],(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:Ri,value:e.value.substring(Number(r.value),Number(i.value))}})),ki("replaceAll",[Ri,Ri,Ri],(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:Ri,value:n}})),ki("index",[Ri,Ri],(function(t,e,r){return{type:Ji,value:jr(e.value.indexOf(r.value))}})),ki("lastIndex",[Ri,Ri],(function(t,e,r){return{type:Ji,value:jr(e.value.lastIndexOf(r.value))}})),ki("trim",[Ri],(function(t,e){return{type:Ri,value:e.value.trim()}})),ki("trimLeft",[Ri],(function(t,e){return{type:Ri,value:e.value.replace(/^\s+/,"")}})),ki("trimRight",[Ri],(function(t,e){return{type:Ri,value:e.value.replace(/\s+$/,"")}})),ki("toUpperCase",[Ri],(function(t,e){return{type:Ri,value:e.value.toUpperCase()}})),ki("toLowerCase",[Ri],(function(t,e){return{type:Ri,value:e.value.toLowerCase()}})),ki("padStart",[Ri,Ji,Ri],vn),ki("padStart",[Ji,Ji,Ri],vn),ki("padEnd",[Ri,Ji,Ri],gn),ki("padEnd",[Ji,Ji,Ri],gn),ki("testRegex",[Ri,Ri],(function(t,e,r){let i;try{i=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:Li,value:i.test(e.value)?1:0}})),ki("div",[Ji,Ji],(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=Pi(0,i),Oi(t,i),{type:Ji,value:i}})),ki("div",[Ui,Ui],(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:Ui,value:i}})),ki("mod",[Ji,Ji],(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=Pi(0,i),Oi(t,i),{type:Ji,value:i}})),ki("mod",[Ui,Ui],(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:Ui,value:i}})),ki("mul",[{type:Ji,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=Pi(0,r),Oi(t,r);return{type:Ji,value:r}})),ki("mul",[{type:Ui,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:Ui,value:r}})),ki("sub",[{type:Ji,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=Pi(0,r),Oi(t,r);return{type:Ji,value:r}})),ki("sub",[{type:Ui,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:Ui,value:r}})),ki("sum",[{type:Ji,isVararg:!0}],(function(t,...e){let r=Dr;for(let i=0;i<e.length;++i)r+=e[i].value,r=Pi(0,r),Oi(t,r);return{type:Ji,value:r}})),ki("sum",[{type:Ui,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Ui,value:r}})),ki("abs",[Ji],(function(t,e){const r=Pr(e.value);return Oi(t,r),{type:e.type,value:r}})),ki("abs",[Ui],(function(t,e){const r=Math.abs(e.value);return{type:Ui,value:r}})),ki("max",[{type:Ji,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:Ji,value:r}})),ki("max",[{type:Ui,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Ui,value:Math.max(...e.map((t=>t.value)))}})),ki("min",[{type:Ji,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:Ji,value:r}})),ki("min",[{type:Ui,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Ui,value:Math.min(...e.map((t=>t.value)))}})),ki("maxNumber",[],(function(){return{type:Ui,value:Ni}})),ki("minNumber",[],(function(){return{type:Ui,value:Bi}})),ki("maxInteger",[],(function(t){return Oi(t,Fr),{type:Ji,value:Fr}})),ki("minInteger",[],(function(t){return Oi(t,Vr),{type:Ji,value:Vr}})),ki("round",[Ui],(function(t,e){const r=Math.sign(e.value);return{type:Ui,value:r*Math.round(Math.abs(e.value))}})),ki("floor",[Ui],(function(t,e){return{type:Ui,value:Math.floor(e.value)}})),ki("ceil",[Ui],(function(t,e){return{type:Ui,value:Math.ceil(e.value)}})),ki("signum",[Ji],(function(t,e){return{type:Ji,value:Or(e.value)}})),ki("signum",[Ui],(function(t,e){return{type:Ui,value:Math.sign(e.value)}})),ki("copySign",[Ji,Ji],(function(t,e,r){let i;if(r.value===Dr)i=e.value;else if(e.value===Dr)i=jr(0);else{const t=Or(r.value);i=Pr(e.value)*t}return Oi(t,i),{type:Ji,value:i}})),ki("copySign",[Ui,Ui],(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:Ui,value:n}})),ki("getColorAlpha",[Ri],mn),ki("getColorAlpha",[Wi],mn),ki("getColorRed",[Ri],yn),ki("getColorRed",[Wi],yn),ki("getColorGreen",[Ri],bn),ki("getColorGreen",[Wi],bn),ki("getColorBlue",[Ri],_n),ki("getColorBlue",[Wi],_n),ki("setColorAlpha",[Ri,Ui],wn),ki("setColorAlpha",[Wi,Ui],wn),ki("setColorRed",[Ri,Ui],$n),ki("setColorRed",[Wi,Ui],$n),ki("setColorGreen",[Ri,Ui],xn),ki("setColorGreen",[Wi,Ui],xn),ki("setColorBlue",[Ri,Ui],kn),ki("setColorBlue",[Wi,Ui],kn),ki("rgb",[Ui,Ui,Ui],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Wi,value:Ti(n)}})),ki("argb",[Ui,Ui,Ui,Ui],(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:Wi,value:Ti(o)}})),ki("getDictString",[Gi,{type:Ri,isVararg:!0}],Vn),ki("getStringFromDict",[Gi,{type:Ri,isVararg:!0}],Vn),ki("getDictNumber",[Gi,{type:Ri,isVararg:!0}],jn),ki("getNumberFromDict",[Gi,{type:Ri,isVararg:!0}],jn),ki("getDictInteger",[Gi,{type:Ri,isVararg:!0}],Dn),ki("getIntegerFromDict",[Gi,{type:Ri,isVararg:!0}],Dn),ki("getDictBoolean",[Gi,{type:Ri,isVararg:!0}],Pn),ki("getBooleanFromDict",[Gi,{type:Ri,isVararg:!0}],Pn),ki("getDictColor",[Gi,{type:Ri,isVararg:!0}],On),ki("getColorFromDict",[Gi,{type:Ri,isVararg:!0}],On),ki("getDictUrl",[Gi,{type:Ri,isVararg:!0}],Sn),ki("getUrlFromDict",[Gi,{type:Ri,isVararg:!0}],Sn),ki("getDictOptString",[Ri,Gi,{type:Ri,isVararg:!0}],In),ki("getOptStringFromDict",[Ri,Gi,{type:Ri,isVararg:!0}],In),ki("getDictOptNumber",[Ui,Gi,{type:Ri,isVararg:!0}],Mn),ki("getOptNumberFromDict",[Ui,Gi,{type:Ri,isVararg:!0}],Mn),ki("getDictOptInteger",[Ji,Gi,{type:Ri,isVararg:!0}],Tn),ki("getOptIntegerFromDict",[Ji,Gi,{type:Ri,isVararg:!0}],Tn),ki("getDictOptBoolean",[Li,Gi,{type:Ri,isVararg:!0}],zn),ki("getOptBooleanFromDict",[Li,Gi,{type:Ri,isVararg:!0}],zn),ki("getDictOptColor",[Wi,Gi,{type:Ri,isVararg:!0}],Nn),ki("getOptColorFromDict",[Wi,Gi,{type:Ri,isVararg:!0}],Nn),ki("getDictOptColor",[Ri,Gi,{type:Ri,isVararg:!0}],Nn),ki("getOptColorFromDict",[Ri,Gi,{type:Ri,isVararg:!0}],Nn),ki("getDictOptUrl",[Ri,Gi,{type:Ri,isVararg:!0}],Bn),ki("getOptUrlFromDict",[Ri,Gi,{type:Ri,isVararg:!0}],Bn),ki("getDictOptUrl",[Hi,Gi,{type:Ri,isVararg:!0}],Bn),ki("getOptUrlFromDict",[Hi,Gi,{type:Ri,isVararg:!0}],Bn),ki("getArrayString",[Zi,Ji],Un),ki("getStringFromArray",[Zi,Ji],Un),ki("getArrayNumber",[Zi,Ji],Ln),ki("getNumberFromArray",[Zi,Ji],Ln),ki("getArrayInteger",[Zi,Ji],Wn),ki("getIntegerFromArray",[Zi,Ji],Wn),ki("getArrayBoolean",[Zi,Ji],Hn),ki("getBooleanFromArray",[Zi,Ji],Hn),ki("getArrayColor",[Zi,Ji],qn),ki("getColorFromArray",[Zi,Ji],qn),ki("getArrayUrl",[Zi,Ji],Gn),ki("getUrlFromArray",[Zi,Ji],Gn),ki("getArrayFromArray",[Zi,Ji],Zn),ki("getDictFromArray",[Zi,Ji],Yn),ki("getArrayOptString",[Zi,Ji,Ri],Xn),ki("getOptStringFromArray",[Zi,Ji,Ri],Xn),ki("getArrayOptNumber",[Zi,Ji,Ui],Qn),ki("getOptNumberFromArray",[Zi,Ji,Ui],Qn),ki("getArrayOptInteger",[Zi,Ji,Ji],Kn),ki("getOptIntegerFromArray",[Zi,Ji,Ji],Kn),ki("getArrayOptBoolean",[Zi,Ji,Li],to),ki("getOptBooleanFromArray",[Zi,Ji,Li],to),ki("getArrayOptColor",[Zi,Ji,Wi],eo),ki("getOptColorFromArray",[Zi,Ji,Wi],eo),ki("getArrayOptColor",[Zi,Ji,Ri],eo),ki("getOptColorFromArray",[Zi,Ji,Ri],eo),ki("getArrayOptUrl",[Zi,Ji,Hi],ro),ki("getOptUrlFromArray",[Zi,Ji,Hi],ro),ki("getArrayOptUrl",[Zi,Ji,Ri],ro),ki("getOptUrlFromArray",[Zi,Ji,Ri],ro),ki("getOptArrayFromArray",[Zi,Ji],(function(t,e,r){try{return Zn(t,e,r)}catch(t){return{type:Zi,value:[]}}})),ki("getOptDictFromArray",[Zi,Ji],(function(t,e,r){try{return Yn(t,e,r)}catch(t){return{type:Gi,value:{}}}})),ki("len",[Zi],(function(t,e){return{type:Ji,value:jr(e.value.length)}}));const no={StringLiteral:function(t,e){return{type:Ri,value:e.value}},NumberLiteral:function(t,e){return{type:Ui,value:e.value}},IntegerLiteral:function(t,e){return Oi(t,e.value),{type:Ji,value:e.value}},BooleanLiteral:function(t,e){return{type:Li,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Ai(oo(t,e.argument));switch(e.operator){case"!":if(r.type===Li)return{type:Li,value:r.value?0:1};Ii(`${e.operator}${ji(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===Ji){const e=r.value*jr(i);return Oi(t,e),{type:Ji,value:e}}if(r.type===Ui)return{type:Ui,value:r.value*i};Ii(`${e.operator}${ji(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Ai(oo(t,e.test));if(r.type===Li)return r.value?oo(t,e.consequent):oo(t,e.alternate);Ii(`${ji(r)} ? ${ji(oo(t,e.consequent))} : ${ji(oo(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TryExpression:function(t,e){try{return oo(t,e.test)}catch(r){return oo(t,e.alternate)}},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return oo(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=Vi(oo(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:Ri,value:r}},LogicalExpression:function(t,e){const r=Ai(oo(t,e.left));if(r.type!==Li&&Ii(`${ji(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Li,value:0};const i=Ai(oo(t,e.right));return i.type!==Li&&Ii(`${ji(r)} ${e.operator} ${ji(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Di(i.type)}.`),{type:Li,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=oo(t,e.left),n=oo(t,e.right);if(i.type!==n.type&&Ii(`${ji(i)} ${e.operator} ${ji(n)}`,`Operator '${r}' cannot be applied to different types: ${Di(i.type)} and ${Di(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===qi&&r.type===qi?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Li,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ui&&e.type!==Ji&&e.type!==qi&&Ii(`${ji(e)} ${t} ${ji(r)}`,`Operator '${t}' cannot be applied to ${Di(e.type)} type.`);const n=e.type===qi?e.value.getTime():e.value,o=r.type===qi?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Li,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==Ri&&r.type!==Ui&&r.type!==Ji&&Ii(`${ji(r)} ${e} ${ji(i)}`,`Operator '${e}' cannot be applied to ${Di(r.type)} type.`),r.type===Ri)return"-"===e&&Ii(`${ji(r)} - ${ji(i)}`,`Operator '${e}' cannot be applied to ${Di(r.type)} type.`),{type:Ri,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===Ji)try{n=Pi(0,n),Oi(t,n)}catch(t){Ii(`${ji(r)} ${e} ${ji(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!==Ji&&r.type!==Ui&&Ii(`${ji(r)} ${e} ${ji(i)}`,`Operator '${e}' cannot be applied to ${Di(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&Ii(`${ji(r)} ${e} ${ji(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===Ji)try{n=Pi(0,n),Oi(t,n)}catch(t){Ii(`${ji(r)} ${e} ${ji(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=>oo(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(xi.has(o))i=xi.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=Ei(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=>Di(t.type))).join(", "),i=`${r}(${io(n)})`;"few"===t.type&&0===n.length?Ii(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Ii(i,`Function '${r}' has no matching override for given argument types: ${e}.`):Ii(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){Ii(`${r}(${io(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 oo(t,e){if(e.type in no)return no[e.type](t,e);throw new Error("Unsupported expression")}function ao(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1},i=oo(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:[]}}}class so{constructor(t){this.ast=t}apply(t,e){try{const r=ao(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 Fi(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=ft(String(n));if(t)return Ti(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 lo(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=wi(t,{startRule:"JsonStringContents"}),i=Si(r);return e.vars.push(...i),new so(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=>lo(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=lo(t[n],e,r);return i}}var i;return t}function co(t,e,r){if(t){if(t instanceof so)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>co(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=co(t[n],e,r);return i}}return t}function uo(t,e){const r={vars:[],hasExpression:!1},i=lo(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>co(i,t,e)}}const po={pagers:function(){return Q(new Map)}},vo=new Map,go=new Map;function fo(t){const e=vo.get(t)||Q("");return vo.has(t)||vo.set(t,e),e}function ho(t){const e=go.get(t)||new Map;return go.has(t)||go.set(t,e),e}class mo{setVariable(t){const e=t.getName(),r=ho(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),fo(this).set(e)}getVariable(t){return ho(this).get(t)}list(){return ho(this).values()}}function yo(){return new mo}function bo(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 _o=new Set(["start","stop","pause","resume","cancel","reset"]);class wo{constructor(t){bo(this,"timers",new Map),bo(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)&&_o.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 $o(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 xo=Q(!0),ko=0;function Eo(){xo.set(!1)}function Co(){xo.set(!0)}const Ao=U(((t,e,r,i)=>{let n,o,a,s;var c,u,d,p,f;let{id:h}=e,{json:m={}}=e,{platform:y="auto"}=e,{theme:b="system"}=e,{globalVariablesController:_=new mo}=e,{mix:w=""}=e,{customization:x={}}=e,{builtinProtocols:k=["http","https","tel","mailto","intent"]}=e,{extensions:E=new Map}=e,{onError:C}=e,{onStat:A}=e,{onCustomAction:F}=e,{onComponent:V}=e,{typefaceProvider:j=(t=>"")}=e,{fetchInit:D={}}=e,{tooltipRoot:P}=e,{customComponents:O}=e,S=Q("desktop"===y);if(s=l(S,(t=>a=t)),"auto"===y&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");S.set(!t.matches),t.addListener((()=>{S.set(!t.matches)}))}let M="light",T=null;function z(t){b=t}function N(){return new Map}function R(){return new Map}function J(t){m=t}const U=new Set(k);let L=!1,W=!1;h||(W=!0,ot(st(new Error('"id" prop is required'))));const H={stateChange:!1},q=fo(_),G=ho(_),Z=new Map,Y=new Map,X=new Map;let tt=null,et=0,rt=[];function nt(t){const e=uo(t,ot);return e.hasExpression?e.applyVars(Y):t}function ot(t){C?C({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function lt(t,e){A&&A({type:t,action:e})}let ct=0;function ut(t){return`${h}-${ct++}`}let dt={},pt={};function vt(t){gt(nt(t))}function gt(t){const e=t.url?String(t.url):"",r=t.typed;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=At,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=$t(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=$t(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=$t(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=Y.get(i);if(t){const e=t.getType();"dict"===e||"array"===e?ot(st(new Error(`Setting ${e} variables is not supported`),{additional:{name:i}})):t.set(a)}else ot(st(new Error("Cannot find variable"),{additional:{name:i}}))}else ot(st(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const s=o.get("action"),l=o.get("id");tt?tt.execTimerAction(l,s):ot(st(new Error("Incorrect timer action"),{additional:{id:l,action:s}}));break;case"video":!function(t,e){if(t){const r=$t(t);r?"start"===e?r.start():"pause"===e?r.pause():ot(st(new Error("Unknown video action"),{additional:{id:t,action:e}})):ot(st(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else ot(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=bt.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 ot(st(new Error("Skipping transactional, child is not found or broken"),{additional:{url:t,id:i.id}})),void ft(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_fail_actions)}r.patch.changes.forEach((t=>{const e=bt.get(t.id);e&&e.replaceWith(t.id,t.items)})),ft(null===(a=e.download_callbacks)||void 0===a?void 0:a.on_success_actions)}}else ot(st(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;ot(st(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),ft(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else ot(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 ot(st(new Error("Missing id in show_tooltip action")));const i=wt.get(t);if(!i)return void ot(st(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&rt.some((e=>e.desc.id===t)))return;const n={internalId:++et,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};rt=[...rt,n];const o=null!==(r=i.tooltip.duration)&&void 0!==r?r:5e3;o&&(n.timeoutId=window.setTimeout((()=>{n.timeoutId=0,rt=rt.filter((t=>t.internalId!==n.internalId))}),o))}(o.get("id"),o.get("multiple"));break;case"hide_tooltip":!function(t){t?rt=rt.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):ot(st(new Error("Missing id in hide_tooltip action")))}(o.get("id"));break;default:ot(st(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){ot(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=Y.get(t);r?r.getType()===e.type?r.setValue(e.value):ot(st(new Error("Trying to set value with invalid type"),{additional:{name:t,type:e.type}})):ot(st(new Error("Cannot find variable"),{additional:{name:t}}))}else ot(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}})):$o(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)}}))}(Y,ot,r);break;case"array_remove_value":!function(t,e,r){const{variable_name:i,index:n}=r;"number"==typeof n?$o(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}}))}(Y,ot,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}}))}(ot,r);break;case"focus_element":{const t=r.element_id&&_t.get(r.element_id);t?t.focus():ot(st(new Error("Incorrect focus_element action"),{additional:{elementId:r.element_id}}));break}default:ot(st(new Error("Unknown type of action"),{additional:{type:r.type}}))}}async function ft(t,e){if(t&&Array.isArray(t)){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url,o=i.typed;if(n){const t=xt(n);if(t)if(kt(t,U)){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?(gt(i),await $()):i.log_id&&(ht(i),await $())}else o&>(i)}t.forEach((t=>{t.log_id&<("click",t)}))}}function ht(t){null==F||F(t)}const yt=new Map,bt=new Map,_t=new Map,wt=new Map;function $t(t){if(yt.has(t))return yt.get(t);ot(st(new Error("Missing instance with id"),{additional:{id:t}}))}const Et=new Map;function Ct(t){for(const e of t)Y.has(e)&&t.delete(e);return t}g(at,{logError:ot,logStat:lt,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}=di(t,e,n,ot)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:ut,genClass:function(t){return`divkit-${ut()}`},execAction:gt,execAnyActions:ft,execCustomAction:ht,isRunning:function(t){return H[t]},setRunning:function(t,e){H[t]=e},registerInstance:function(t,e){yt.has(t)?ot(st(new Error("Duplicate instance id"),{additional:{id:t}})):yt.set(t,e)},unregisterInstance:function(t){yt.delete(t)},registerParentOf:function(t,e){bt.set(t,e)},unregisterParentOf:function(t){bt.delete(t)},registerTooltip:function(t,e){wt.has(e.id)&&ot(st(new Error("Duplicate tooltip id"),{additional:{id:e.id}})),wt.set(e.id,{onwerNode:t,tooltip:e})},unregisterTooltip:function(t){wt.delete(t.id),rt.some((e=>e.desc.id===t.id))&&(rt=rt.filter((e=>e.desc.id!==t.id)))},onTooltipClose:function(t){rt=rt.filter((e=>e.internalId!==t))},tooltipRoot:P,registerFocusable:function(t,e){_t.set(t,e)},unregisterFocusable:function(t){_t.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(pt[r]=pt[r]||0,++pt[r],dt[r])return dt[r];const i=`${ut()}-svg-filter`;return dt=Object.assign(Object.assign({},dt),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;pt[r]&&0==--pt[r]&&(dt=Object.keys(dt).reduce(((t,e)=>(pt[e]&&(t[e]=dt[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return vi(t);const e=uo(t,ot);return e.vars.length?K(e.vars.map((t=>Y.get(t)||function(t){const e=X.get(t)||Q(void 0);return X.has(t)||X.set(t,e),e}(t))).filter(mt),(()=>e.applyVars(Y))):e.hasExpression?vi(e.applyVars(Y)):vi(t)},getJsonWithVars:nt,getStore:function(t){return Et.has(t)||function(t){Et.has(t)||Et.set(t,po[t]())}(t),Et.get(t)},getVariable:function(t,e){const r=Y.get(t);if(r){const i=r.getType();if(i!==e)return void ot(st(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==x?void 0:x[t]},getBuiltinProtocols:function(){return U},getExtension:function(t,e){const r=E.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:Y,logError:ot}},typefaceProvider:j,isDesktop:S,isPointerFocus:xo,customComponents:O,componentDevtool:void 0}),g(Ht,{hasAction:()=>!1});const At={setState(t){throw new Error("Not implemented")},getChild(t){if(Ft&&Ft.has(t))return Ft.get(t);ot(st(new Error("Missing state block with id"),{additional:{id:t}}))}};let Ft=null;function Vt(t){if(t.type in Ir){"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&ot(st(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Mr(t.name,t.type,t.value);Z.set(t.name,e),Y.set(t.name,e)}catch(e){ot(st(e,{additional:{name:t.name}}))}}}g(Dt,{registerInstance(t,e){Ft||(Ft=new Map),Ft.has(t)?ot(st(new Error("Duplicate state with id"),{additional:{id:t}})):Ft.set(t,e)},unregisterInstance(t){null==Ft||Ft.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 jt=null===(c=null==m?void 0:m.card)||void 0===c?void 0:c.variables;Array.isArray(jt)&&jt.forEach((t=>{if(t&&t.name){if(Z.has(t.name))return void ot(st(new Error("Duplicate variable"),{additional:{name:t.name}}));Vt(t)}}));const Pt=m.palette;Pt&&Pt[M].forEach((t=>{if(Z.has(t.name))ot(st(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Mr(t.name,"color",t.color);Z.set(t.name,e),Y.set(t.name,e)}catch(e){ot(st(e,{additional:{name:t.name}}))}}));for(const[t,e]of G)Y.has(t)||Y.set(t,e);q.subscribe((t=>{if(t&&!Y.has(t)){const e=G.get(t);Y.set(t,e);const r=X.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Ot=null===(d=null==m?void 0:m.card)||void 0===d?void 0:d.variable_triggers;Array.isArray(Ot)&&Ot.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void ot(st(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const i=wi(t.condition,{startRule:"JsonStringContents"}),n=Si(i);if(!n.length)return void ot(st(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return Ct(e),e.size?new Promise((t=>{const r=q.subscribe((()=>{Ct(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{K(n.map((t=>Y.get(t))).filter(mt),(()=>{const t=ao(Y,i);return t.warnings.forEach(ot),t.result})).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=nt(t);e.log_id&>(e)})),e=Boolean(i.value)):ot(st(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){ot(st(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else ot(st(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const St=null===(p=null==m?void 0:m.card)||void 0===p?void 0:p.timers;if(St&&"undefined"!=typeof document){const t=tt=new wo({logError:ot,applyVars:nt,hasVariableWithType:function(t,e){const r=Y.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=Y.get(t);r?r.setValue(e):ot(st(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:ft});St.forEach((e=>t.createTimer(e)))}let It;v((()=>{ko--,ko||(window.removeEventListener("keydown",Eo),window.removeEventListener("pointerdown",Co)),tt&&tt.destroy(),rt.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&r.id&&void 0!==h&&r.id(h),void 0===e.json&&r.json&&void 0!==m&&r.json(m),void 0===e.platform&&r.platform&&void 0!==y&&r.platform(y),void 0===e.theme&&r.theme&&void 0!==b&&r.theme(b),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==_&&r.globalVariablesController(_),void 0===e.mix&&r.mix&&void 0!==w&&r.mix(w),void 0===e.customization&&r.customization&&void 0!==x&&r.customization(x),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==k&&r.builtinProtocols(k),void 0===e.extensions&&r.extensions&&void 0!==E&&r.extensions(E),void 0===e.onError&&r.onError&&void 0!==C&&r.onError(C),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!==j&&r.typefaceProvider(j),void 0===e.fetchInit&&r.fetchInit&&void 0!==D&&r.fetchInit(D),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==P&&r.tooltipRoot(P),void 0===e.customComponents&&r.customComponents&&void 0!==O&&r.customComponents(O),void 0===e.setTheme&&r.setTheme&&void 0!==z&&r.setTheme(z),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==N&&r.getDebugVariables(N),void 0===e.getDebugAllVariables&&r.getDebugAllVariables&&void 0!==R&&r.getDebugAllVariables(R),void 0===e.setData&&r.setData&&void 0!==J&&r.setData(J),void 0===e.execAction&&r.execAction&&void 0!==vt&&r.execAction(vt),"light"===b||"dark"===b?M=b:"system"===b?"undefined"!=typeof matchMedia?(T||(T=matchMedia("(prefers-color-scheme: dark)"),T.addListener((function(){"system"===b&&T&&(M=T.matches?"dark":"light")}))),M=T.matches?"dark":"light"):M="light":ot(st(new Error("Unsupported theme"))),M&&Pt&&Pt[M].forEach((t=>{const e=Y.get(t.name);e&&e.setValue(t.color)}));{L=!1;const t=function(t){if(!t)return st(new Error("Missing object"));const e=t.card,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 li)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}(m);t&&(L=!0,ot(t))}return n=m.templates||{},(null===(u=null==m?void 0:m.card)||void 0===u?void 0:u.variables)&&Array.isArray(m.card.variables)&&m.card.variables!==jt&&m.card.variables.forEach((t=>{t&&t.name&&!Z.has(t.name)&&Vt(t)})),o=null===(f=null==m?void 0:m.card)||void 0===f?void 0:f.states,!o||L||W||(It={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(),L||W||!It?"":`<div class="${I("divkit-b023c",!0)+I(a?` ${it}`:"",!0)+I(w?` ${w}`:"",!0)}">${B(ui,"RootSvgFilters").$$render(t,{svgFiltersMap:dt},{},{})} ${B(ci,"Unknown").$$render(t,{div:It,templateContext:{},layoutParams:{tooltips:rt}},{},{})}</div>`})),Fo=Ao;function Vo(t){return Fo.render(t).html}var jo=exports;for(var Do in e)jo[Do]=e[Do];e.__esModule&&Object.defineProperty(jo,"__esModule",{value:!0})})();
|
|
2
2
|
//# sourceMappingURL=server.js.map
|