@divkitframework/divkit 23.5.0 → 23.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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.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/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={};function r(){}function i(t){return t()}function n(t){t.forEach(i)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}let s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}function d(t){u().$$.on_destroy.push(t)}function c(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>Oi,createVariable:()=>rr,render:()=>Li}),new Set,new Map;const p=[],g=[],h=[],f=[],m=Promise.resolve();let y=!1;function b(){return y||(y=!0,m.then(x)),m}function _(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<p.length;){const t=p[$];$++,l(t),k(t.$$)}for(l(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];w.has(e)||(w.add(e),e())}h.length=0}while(p.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(_)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const C=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),E=/[\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 F(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=N(i):r.style=N(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(E.test(t))return;const e=r[t];!0===e?i+=" "+t:C.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),i=e?A:V;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 D(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function S(t){const e={};for(const r in t)e[r]=D(t[r]);return e}function P(t,e){let r="";for(let i=0;i<t.length;i+=1)r+=e(t[i],i);return r}const T={$$render:()=>""};function z(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`);return t}let M,I;function O(t){function e(e,r,i,n,o){const a=s;l({$$:{on_destroy:M,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const u=t(e,r,i,n);return l(a),u}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,i);return n(M),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function N(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=N(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(I=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(i).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(n(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const B=[];function R(t,e=r){let i;const n=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!B.length;for(const e of n)e[1](),B.push(e,t);if(e){for(let t=0;t<B.length;t+=2)B[t][0](B[t+1]);B.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return n.add(l),1===n.size&&(i=e(o)||r),a(t),()=>{n.delete(l),0===n.size&&(i(),i=null)}}}}function L(t,e,i){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return d=t=>{let i=!1;const d=[];let c=0,v=r;const p=()=>{if(c)return;v();const i=e(s?d[0]:d,t);u?t(i):v=o(i)?i:r},g=l.map(((t,e)=>a(t,(t=>{d[e]=t,c&=~(1<<e),i&&p()}),(()=>{c|=1<<e}))));return i=!0,p(),function(){n(g),v()}},{subscribe:R(i,d).subscribe};var d}const W="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Y="divkit-f0cba",Z=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={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_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={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"};function tt(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 et(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 rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function it(t,e){for(;t.length<e;)t="0"+t;return t}function nt(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const i=ot(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>it(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function ot(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,u=2===r.length?r:r+r;return{a:parseInt(u,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 at(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 st=Boolean;function lt(t){if(1===t.length&&"solid"===t[0].type)return{color:nt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=nt(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(st);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>nt(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:ct(t.bg.scale),pos:vt(t.bg),image:'url("'+at(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(st);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=rt(i.value):"relative"===i.type&&(n=ut[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${dt(t.bg.center_x)} ${dt(t.bg.center_y)},`+r.map((t=>nt(t))).join(",")+")"}}({bg:t}):void 0)).filter(st).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 ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function dt(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function ct(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(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 pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function gt(t,e){return e.has(t)}function ht(t,e){e&&t.push(e)}function ft(t,e,r){const i=[];ht(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&ht(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const mt=Symbol("state");function yt(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function bt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function _t(t){return bt(t)&&t>=0}function wt(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]&&!_t(r[t]))return e;return yt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const xt=Object.prototype.hasOwnProperty;function kt(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(!xt.call(e,n)||!kt(t[n],e[n]))return!1}return!0}function Ct(t,e){return kt(t,e)?e:t}function Et(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}function At(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...At(t))})):e.push(t),e}function Vt(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]]&&!_t(t[r[i]]))return e;return t}function jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function Dt(){}const St=Symbol("action"),Pt=O(((t,e,r,i)=>{let{actions:n}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:d=Dt}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const h=v(Z),f=v(St);c(St,{hasAction:()=>Boolean(f.hasAction()||(null==n?void 0:n.length))});let m,y="";if(Array.isArray(n)&&(null==n?void 0:n.length))for(let t=0;t<n.length;++t){const e=n[t].url;if(e){y=e,m=n[t].target||void 0;break}}Array.isArray(n)&&(null==n?void 0:n.length)&&f.hasAction()&&(y="",h.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:n}})));let b=Boolean(p);return y&&!gt(pt(y),h.getBuiltinProtocols())&&(y="",b=!0),void 0===e.actions&&r.actions&&void 0!==n&&r.actions(n),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),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!==g&&r.isNativeActionAnimation(g),y?`<a${F([{href:D(y)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(g?W:q,!0)+" "+j(null!=a&&a.length?Y:"",!0)},S(u)],{})}>${i.default?i.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(b?` ${g?W:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Y:"",!0)},{style:D(l)},{role:D(b?"button":null)},{tabindex:D(b?0:null)},S(u)],{})}>${i.default?i.default({}):""}</span>`})),Tt=Pt,zt="divkit-b921d";function Mt(t){return bt(t)&&t>0}function It(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Mt(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ot=O(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=v(Z);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=lt([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=It(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${U({"border-radius":a})}>${P(n,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class",zt,0)}${J("style",tt(t.style),0)}>`:`<span${J("class",zt,0)}${J("style",tt(t.style),0)}></span>`))}</span>`})),Jt=Ot,Nt=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,_,w,$,x,k,C,E,F,A,V,j,D,S,P,T,M,I,O,N,U,B,R,L,W,q,H,G,Y,K,it=r,ot=r,at=r,st=r,ut=r,dt=r,ct=r,vt=r,ht=r,bt=r,xt=r,kt=r,Dt=r,St=r,Pt=r,zt=r,Mt=r;var It,Ot,Nt,Ut,Bt,Rt;let{json:Lt={}}=e,{origJson:Wt}=e,{templateContext:qt}=e,{cls:Ht=""}=e,{style:Gt}=e,{layoutParams:Yt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Xt=!1}=e,{customActions:Kt=""}=e,{additionalPaddings:Qt=null}=e;const te={left:"start",center:"center",right:"end"},ee={top:"start",center:"center",bottom:"end",baseline:"baseline"},re=v(Z),ie=v(mt);let ne,oe,ae,se,le,ue,de,ce,ve,pe,ge,he={},fe={},me=!1,ye=1,be="transparent",_e=0,we={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},$e="",xe=null,ke="",Ce={},Ee=0,Fe=0,Ae=0,Ve=!1,je=!1,De={},Se=0,Pe=0,Te=0,ze=!1,Me=!1,Ie=1;const Oe=Yt.fakeElement?[]:Lt.transition_triggers||["state_change","visibility_change"],Je=-1!==Oe.indexOf("state_change")&&Lt.id,Ne=-1!==Oe.indexOf("visibility_change")&&Lt.id;let Ue,Be,Re,Le,We,qe,He,Ge,Ye,Ze=[],Xe=[],Ke=[],Qe=[],tr="",er=!1,rr="visible",ir=0,nr=0;void 0===e.json&&i.json&&void 0!==Lt&&i.json(Lt),void 0===e.origJson&&i.origJson&&void 0!==Wt&&i.origJson(Wt),void 0===e.templateContext&&i.templateContext&&void 0!==qt&&i.templateContext(qt),void 0===e.cls&&i.cls&&void 0!==Ht&&i.cls(Ht),void 0===e.style&&i.style&&void 0!==Gt&&i.style(Gt),void 0===e.layoutParams&&i.layoutParams&&void 0!==Yt&&i.layoutParams(Yt),void 0===e.customDescription&&i.customDescription&&void 0!==Zt&&i.customDescription(Zt),void 0===e.customPaddings&&i.customPaddings&&void 0!==Xt&&i.customPaddings(Xt),void 0===e.customActions&&i.customActions&&void 0!==Kt&&i.customActions(Kt),void 0===e.additionalPaddings&&i.additionalPaddings&&void 0!==Qt&&i.additionalPaddings(Qt),o=re.getDerivedFromVars(Lt.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,i="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+et((null===(Ut=null===(Nt=e.offset)||void 0===Nt?void 0:Nt.y)||void 0===Ut?void 0:Ut.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+nt(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,ye=$t(K.stroke.width,ye),be=nt(K.stroke.color,1,be),e.border=`${et(ye)} solid ${be}`),K.corners_radius?(we=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!_t(r[t]))return e;return t}(K.corners_radius,we),e["border-radius"]=t["border-radius"]=jt(we)):K.corner_radius&&(_e=$t(K.corner_radius,_e),we={"top-left":_e,"top-right":_e,"bottom-right":_e,"bottom-left":_e},e["border-radius"]=t["border-radius"]=et(_e)),r&&ye&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},we);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+ye/2})),i=jt(t)}}he=Ct(t,he),fe=Ct(e,fe),me=r,$e=i}s=re.getDerivedFromVars(Lt.paddings),zt(),zt=a(s,(t=>Y=t)),xe=Vt(Y&&!Xt?Y:void 0,xe),l=yt(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}(xe,Qt)),u=re.getDerivedFromVars(Lt.margins),St(),St=a(u,(t=>H=t)),ke=wt(H,ke),d=re.getDerivedFromVars(Lt.width),kt(),kt=a(d,(t=>W=t)),c=re.getDerivedFromVars(Lt.alignment_horizontal),Pt(),Pt=a(c,(t=>G=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const u=null==W?void 0:W.type;if("fixed"===u)Ee=$t(null==W?void 0:W.value,Ee),e=et(Ee);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,re.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=W&&"weight"in W&&W.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==W?void 0:W.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=W;t.min_size&&_t(t.min_size.value)&&(r=et(t.min_size.value)),t.max_size&&_t(t.max_size.value)&&(i=et(t.max_size.value))}"match_parent"!==u&&u||re.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=G;n["halign-self"]="left"===t||"center"===t||"right"===t?te[t]:Yt.parentHAlign||"start"}t&&(n.width=t),ae=e,se=r,le=i,Fe=o,Ae=a,Ce=Ct(n,Ce),Ve=s,je=l}p=re.getDerivedFromVars(Lt.height),xt(),xt=a(p,(t=>L=t)),g=re.getDerivedFromVars(Lt.alignment_vertical),Dt(),Dt=a(g,(t=>q=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if("fixed"===u)Se=$t(null==L?void 0:L.value,Se),e=et(Se);else if("match_parent"!==u||!Yt.overlapParent&&Yt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||"match_parent"===u&&Yt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&_t(t.min_size.value)&&(r=et(t.min_size.value)),(null==t?void 0:t.max_size)&&_t(t.max_size.value)&&(i=et(t.max_size.value))}"match_parent"===u&&re.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,re.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==L?void 0:L.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?n["valign-self"]=ee[t]:n["valign-self"]=Yt.parentVAlign||"start"}t&&(n.height=t),ue=e,de=r,ce=i,Pe=o,Te=a,De=Ct(n,De),ze=s,Me=l}var or,ar,sr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!W||"match_parent"===W.type)&&"match_parent"===(null==L?void 0:L.type),m=Yt.gridArea?`${Yt.gridArea.y+1}/${Yt.gridArea.x+1}/span ${Yt.gridArea.rowSpan}/span ${Yt.gridArea.colSpan}`:void 0,y=re.getDerivedFromVars(Lt.alpha),bt(),bt=a(y,(t=>R=t)),ar=Ie,Ie=!_t(or=R)||void 0===or||or>1?ar:Number(or),ve=1===Ie?void 0:Ie,_=re.getDerivedFromVars(Lt.accessibility),ht(),ht=a(_,(t=>B=t)),oe=void 0,B&&!Zt&&B.description&&(oe={},oe["aria-label"]=B.description),w=re.getDerivedFromVars(Lt.background),vt(),vt=a(w,(t=>U=t)),pe={},ge=!1,U&&(ge=U.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean($e),!ge)){const t=lt(U);pe["background-color"]=t.color,pe["background-image"]=t.image,pe["background-size"]=t.size,pe["background-position"]=t.position,pe["background-repeat"]="no-repeat"}Ue=void 0,Je&&Lt.transition_in&&re.isRunning("stateChange")&&(Ue=!0),Re=void 0,Je&&Lt.transition_change&&re.isRunning("stateChange")&&ie.hasTransitionChange(Lt.id)&&(Re=!0),$=re.getDerivedFromVars(Lt.action),dt(),dt=a($,(t=>O=t)),x=re.getDerivedFromVars(Lt.actions),ct(),ct=a(x,(t=>N=t)),k=re.getDerivedFromVars(Lt.doubletap_actions),ut(),ut=a(k,(t=>I=t)),C=re.getDerivedFromVars(Lt.longtap_actions),st(),st=a(C,(t=>M=t));{let t=N||O&&[O]||[],e=I||[],r=M||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],re.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],re.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],re.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Kt&&(t=[],e=[],r=[],re.logError(X(new Error(`Cannot use action on component "${Kt}"`)))),Ze=t,Xe=e,Ke=r}E=re.getDerivedFromVars(Lt.action_animation),at(),at=a(E,(t=>T=t)),T&&(Qe=At(T),tr=Qe.map((function(t){const e=Ft(t.start_value,1),r=Ft(t.end_value,1),i=$t(t.start_delay,0),n=$t(t.duration,300),o=Et(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Le=e,We=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return qe=e,He=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return re.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=re.getDerivedFromVars(Lt.visibility),ot(),ot=a(F,(t=>P=t));{const t=rr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,rr);t!==e&&(!er||"visible"!==rr&&"visible"!==e?rr=e:async function(t){rr=t;const e="visible"===t?"in":"out",r="in"===e?Lt.transition_in:Lt.transition_out;Ne&&r&&(await b(),"in"===e&&(Be=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,ne,e).then((()=>{"in"===e&&(Be=!1)})).catch((t=>{throw"in"===e&&(Be=!1),t})))}(e)),er||(er=!0)}if(A=Object.assign(Object.assign(Object.assign({},Ce),De),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Yt.scrollSnap,"hide-on-transition-in":Ue||Be||Re,visibility:rr,"has-action-animation":Boolean(tr),"parent-flex":Yt.parentContainerOrientation||void 0,"parent-grid":Boolean(Yt.gridArea)||void 0}),V=re.getDerivedFromVars(Lt.transform),it(),it=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};ir=Ft(t.value,ir);const e="pivot-fixed"===t.type?et(ir):`${ir}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};nr=Ft(r.value,nr),Ge=`${e} ${"pivot-fixed"===r.type?et(nr):`${nr}%`}`,Ye=`rotate(${S.rotation}deg)`}return j=Ve||ze?"100%":Fe||Pe?0:void 0,D=Object.assign(Object.assign(Object.assign(Object.assign({},Gt),pe),he),{width:ae,"min-width":se,"max-width":le,height:ue,"min-height":de,"max-height":ce||(null==Gt?void 0:Gt["max-height"]),"grid-area":m,padding:l,margin:ke,opacity:ve,transition:tr,"transform-origin":Ge,transform:Ye,"flex-grow":Fe||Pe||void 0,"flex-shrink":Ae||Te?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Le,"--divkit-animation-opacity-end":We,"--divkit-animation-scale-start":qe,"--divkit-animation-scale-end":He}),it(),ot(),at(),st(),ut(),dt(),ct(),vt(),ht(),bt(),xt(),kt(),Dt(),St(),Pt(),zt(),Mt(),je||Me?"":`${z(Tt,"Actionable").$$render(t,{use:function(t){ne=t,Je&&Lt.transition_in&&ie.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{Ue=!1})).catch((t=>{throw Ue=!1,t})),Je&&Lt.transition_out&&ie.registerChildWithTransitionOut(Lt,qt,Lt.transition_out,t),Je&&Lt.transition_change&&ie.registerChildWithTransitionChange(Lt,qt,Lt.transition_change,t).then((()=>{Re=!1})).catch((t=>{throw Re=!1,t}));const e=Yt.fakeElement?[]:Lt.visibility_actions||Lt.visibility_action&&[Lt.visibility_action];Array.isArray(e)&&e.length&&function(t,{visibilityActions:e,rootCtx:r}){const i=e.map(((t,e)=>({index:e,action:t,visible:!1,count:0,finished:!1}))),n=e.map((t=>r.getJsonWithVars({visibility_percentage:t.visibility_percentage,visibility_duration:t.visibility_duration,log_limit:t.log_limit}))),o=[...new Set([...e.map(((t,e)=>(n[e].visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{i.forEach((e=>{const i=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&i?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=n[e.index],i=0===t.log_limit?1/0:t.log_limit||1;++e.count>=i&&(e.finished=!0);const o=r.getJsonWithVars(e.action),a=o.url;if(a){const t=pt(a);t&&!gt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(o):o.log_id&&r.execCustomAction(o))}r.logStat("visible",o)}),n[e.index].visibility_duration||800)):i||e.timer&&clearTimeout(e.timer),e.visible=i}))}))}),{threshold:o}).observe(t)}(t,{visibilityActions:e,rootCtx:re});const r=Lt.id;r&&ie.registerChild(r);let i=null;return{destroy(){r&&ie.unregisterChild(r),i&&i.destroy()}}},cls:Ht+" "+ft("outer",Q,A),style:tt(D),actions:Ze,doubleTapActions:Xe,longTapActions:Ke,attrs:oe,isNativeActionAnimation:!Qe.length||(sr=Qe,sr.some((t=>"native"===t.name)))},{},{default:()=>`${ge?`${z(Jt,"OuterBackground").$$render(t,{background:U,radius:$e},{},{})}`:""}${n.default?n.default({}):""}${me?`<span${J("class",Q.outer__border,0)}${J("style",tt(fe),0)}></span>`:""}`})}`})),Ut=Nt,Bt={"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 Rt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Lt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Wt(t,e){return Lt(t)||e}const qt=O(((t,e,r,i)=>{let n,o,a,s,l;var u,d;let c,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",y=12,b=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Rt(g.font_size,y),Mt(g.line_height)&&(b=Number(g.line_height)/y),_t(g.letter_spacing)&&(_=et(g.letter_spacing)),c=Wt(g.font_weight,c),w=nt(g.text_color,1,w),n=g.top_offset?et(g.top_offset):"",o=g.background?lt([g.background]):null,$=(null===(u=g.border)||void 0===u?void 0:u.stroke)&&"transparent"!==nt(g.border.stroke.color)&&Mt(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Rt(null===(d=g.border)||void 0===d?void 0:d.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":et(10*y/p),"line-height":b,"letter-spacing":_,"font-weight":c,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${n?`<span${J("class",Bt["text-range__top-offset"],0)}${U({"margin-top":n})}></span>`:""}${z(Tt,"Actionable").$$render(t,{cls:ft("text-range",Bt,s),actions:f,style:tt(l)},{},{default:()=>`${j(v)}`})}`})),Ht=qt;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Yt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Zt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Xt=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,j,D,S,T,M,I,O,N,U,B,R,L=r,W=r,q=r,G=r,Y=r,Q=r,rt=r,it=r,ot=r,at=r,st=r,ut=r,dt=r,{json:ct={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ht=v(Z);let mt=!1,yt="",bt=12,_t=1.25,wt=!1,$t="",xt="",kt=!1,Ct="left",Et="top",Ft="",At="",Vt=!1,jt=[],Dt=[];var St,Pt;d((()=>{Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&i.json&&void 0!==ct&&i.json(ct),void 0===e.templateContext&&i.templateContext&&void 0!==vt&&i.templateContext(vt),void 0===e.origJson&&i.origJson&&void 0!==pt&&i.origJson(pt),void 0===e.layoutParams&&i.layoutParams&&void 0!==gt&&i.layoutParams(gt),o=ht.getDerivedFromVars(ct.text),dt(),dt=a(o,(t=>R=t)),St=R,Pt=yt,yt=String(null!=St?St:"")||Pt,yt?mt=!1:(mt=!0,ht.logError(X(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(ct.ranges),W(),W=a(s,(t=>V=t)),l=ht.getDerivedFromVars(ct.images),L(),L=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:ct.font_size,letter_spacing:ct.letter_spacing,font_weight:ct.font_weight,text_color:ct.text_color,underline:ct.underline,strike:ct.strike,line_height:ct.line_height}),q(),q=a(u,(t=>j=t)),c=ht.getDerivedFromVars(ct.font_size),ut(),ut=a(c,(t=>B=t)),bt=Rt(B,bt),p=ht.getDerivedFromVars(ct.line_height),st(),st=a(p,(t=>U=t));{const t=U;Mt(t)?(_t=Number(t)/bt,wt=!0):wt=!1}g=ht.getDerivedFromVars(ct.max_lines),it(),it=a(g,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let i=Number(I);t=i*_t+"em",V||A||(e=i,r=!0)}$t=t,xt=e,kt=r}f=ht.getDerivedFromVars(ct.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),Ct=Gt(N,Ct),m=ht.getDerivedFromVars(ct.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Et=Yt(O,Et),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,b=ht.getDerivedFromVars(ct.text_color),rt(),rt=a(b,(t=>M=t)),_=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&y&&_&&(t=nt(M||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(ct.truncate),Q(),Q=a(w,(t=>T=t)),$="none"===T?"none":"",x=ht.getDerivedFromVars(ct.text_gradient),Y(),Y=a(x,(t=>S=t));{let t="";if(S){const e=lt([S]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(ct.selectable),G(),G=a(k,(t=>D=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,Vt),function(t,e,r){let i=[];if(Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),Dt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],u=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.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)),u.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=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/bt)};let a="";const s=t.image.tint_color,u=Zt(t.image.tint_mode,"source_in");if(s){const e=nt(t.image.tint_color);a=ht.addSvgFilter(e,u),Dt.push([e,u])}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)}),jt=i}(yt,V,A),C={singleline:h,multiline:kt,halign:Ct,valign:Et,truncate:$},E={gradient:Boolean(At)},F={"font-size":et(bt),"line-height":_t,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},L(),W(),q(),G(),Y(),Q(),rt(),it(),ot(),at(),st(),ut(),dt(),mt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("text",K,C)+" "+(Vt?"":H),json:ct,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${J("class",ft("text__inner",K,E),0)}${J("style",tt(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${z(Ht,"TextRangeView").$$render(t,{text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",tt(e.image.wrapperStyle),0)}><img${J("class",K.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",tt({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>`:""))}`:`${z(Ht,"TextRangeView").$$render(t,{text:yt,rootFontSize:bt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Kt=Xt,Qt={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_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function te(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)n=t.shape,i={width:Number((null===(o=n.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=n.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=n.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Number((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,l;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?nt(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=nt(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${et(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}function ee(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function re(t,e,r){let i;return i="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],i.map(et).join(" ")}let ie;function ne(){if(void 0!==ie)return ie;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),ie=1===t.scrollHeight,document.body.removeChild(t),ie}const oe="divkit-a7719",ae="divkit-f6e9a";function se(t,e,r,i,n,o){o?t.push({top:r.bottom,left:n.left,width:n.right-n.left,height:i.top-r.bottom,style:e}):t.push({top:n.top,left:r.right,width:i.left-r.right,height:n.bottom-n.top,style:e})}function le(t,e,r,i){const n={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)&&se(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],n,i),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)se(t,e.style,r[o],r[o+1],n,i);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];se(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},n,i)}}const ue=O(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=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();c=[];let e=[...n.children].filter((t=>t!==u&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],i=e.shift();t.push(i);let n=i.getBoundingClientRect(),a=n.right,s=n.bottom;for(;e.length;){let r=e[0],i=r.getBoundingClientRect();if("vertical"===o){if(i.top<s)break}else if(i.left<a)break;a=Math.max(a,i.right),s=Math.max(s,i.bottom),t.push(r),e.shift()}r.push(t)}const i=[];r.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&&le(c,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};i.push(r)})),s&&le(c,s,i,"horizontal"===o),c.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,c=[],v=!1,p=null,g=null;return d((()=>{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),n=null,(v&&n||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&n&&("undefined"!=typeof MutationObserver&&(p=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(ae))&&!(null==r?void 0:r.contains(oe))}))&&l()})),p.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(l),g.observe(n)))),v&&n&&l(),`\n\n<div${J("class",oe,0)}${J("this",u,0)}>${P(c,(t=>`<div${J("class","divkit-c770e",0)}${U({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class",ae,0)}${U({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>\n </div>`))}</div>`})),de=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,j,D=r,S=r,T=r,M=r,I=r,O=r,J=r,N=r,U=r;var B,R,L,W,q,H;let{json:G={}}=e,{templateContext:Y}=e,{origJson:K}=e,{layoutParams:Q}=e;const tt={left:"start",center:"center",right:"end"},et={top:"start",center:"center",bottom:"end",baseline:"baseline"},rt=["rounded_rectangle","circle"],it=v(Z);let nt,ot=!1,at="vertical",st="top",lt="left",ut=null,dt=null,ct={};if(void 0===e.json&&i.json&&void 0!==G&&i.json(G),void 0===e.templateContext&&i.templateContext&&void 0!==Y&&i.templateContext(Y),void 0===e.origJson&&i.origJson&&void 0!==K&&i.origJson(K),void 0===e.layoutParams&&i.layoutParams&&void 0!==Q&&i.layoutParams(Q),o=G.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,it.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=Y;return({templateContext:r,json:e}=it.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=it.getDerivedFromVars(G.orientation),U(),U=a(l,(t=>j=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(j,at),u=it.getDerivedFromVars(G.content_alignment_vertical),N(),N=a(u,(t=>V=t)),st=Yt(V,st),d=it.getDerivedFromVars(G.content_alignment_horizontal),J(),J=a(d,(t=>A=t)),lt=Gt(A,lt),c=it.getDerivedFromVars(G.layout_mode),O(),O=a(c,(t=>F=t)),p="wrap"===F,g=it.getDerivedFromVars(G.separator),I(),I=a(g,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&ne()){const t=te(E.style,rt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(B=E.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(R=E.show_at_end)&&void 0!==R&&R),show_between:Boolean(null===(L=E.show_between)||void 0===L||L),style:t}:null}else ut=null;if(h=it.getDerivedFromVars(G.line_separator),M(),M=a(h,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&ne()){const t=te(C.style,rt,(null==dt?void 0:dt.style)||null);dt=t?{show_at_start:Boolean(null!==(W=C.show_at_start)&&void 0!==W&&W),show_at_end:Boolean(null!==(q=C.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(H=C.show_between)||void 0===H||H),style:t}:null}else dt=null;f=ut||dt?function(t,e,r){const i={};return ee(i,e,"vertical"===t),ee(i,r,"horizontal"===t),i}(at,ut,dt):null,m=it.getDerivedFromVars(G.aspect),T(),T=a(m,(t=>k=t));{const t=null==k?void 0:k.ratio;nt=t&&Mt(t)?t:void 0}y=it.getDerivedFromVars(G.width),D(),D=a(y,(t=>$=t)),b=it.getDerivedFromVars(G.height),S(),S=a(b,(t=>x=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],(!x||"wrap_content"===x.type||"match_parent"===x.type&&(null==Q?void 0:Q.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=et[st],("wrap_content"===(null==$?void 0:$.type)||"match_parent"===(null==$?void 0:$.type)&&(null==Q?void 0:Q.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),ct=Ct(t,ct)}return _={orientation:at,valign:st,halign:lt,wrap:p},w={gap:ut||dt?re(at,ut,dt):void 0,"aspect-ratio":nt},D(),S(),T(),M(),I(),O(),J(),N(),U(),ot?"":`${z(Ut,"Outer").$$render(t,{cls:ft("container",Qt,_),style:w,json:G,origJson:K,templateContext:Y,layoutParams:Q,additionalPaddings:f},{},{default:()=>`${P(s,(e=>`${z(lr,"Unknown").$$render(t,{layoutParams:ct,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||dt?`${z(ue,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:dt,orientation:at},{},{})}`:""}`})}`})),ce=de,ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function pe(t,e){return"vertical"===t||"horizontal"===t?t:e}const ge=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const b=v(Z);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&i.json&&void 0!==h&&i.json(h),void 0===e.templateContext&&i.templateContext&&void 0!==f&&i.templateContext(f),void 0===e.origJson&&i.origJson&&void 0!==m&&i.origJson(m),void 0===e.layoutParams&&i.layoutParams&&void 0!==y&&i.layoutParams(y),o=b.getDerivedFromVars(h.delimiter_style),g(),g=a(o,(t=>p=t)),_=pe(null==p?void 0:p.orientation,_),s=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=nt(null==p?void 0:p.color,1,w),l="horizontal"===_?"100%":et(1),u="horizontal"===_?et(1):"100%",d={background:w,width:l,height:u},c={orientation:_},g(),`${z(Ut,"Outer").$$render(t,{cls:ft("separator",ve,c),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",ve.separator__inner,0)}${J("style",tt(d),0)}></span>`:""})}`})),he={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"},fe=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,j,D,S,P,T,M,I,O,N,B,R,L,W=r,q=r,H=r,G=r,Y=r,K=r,Q=r,et=r,rt=r,it=r,ot=r,st=r,lt=r,ut=r,{json:dt={}}=e,{templateContext:pt}=e,{origJson:gt}=e,{layoutParams:ht}=e;const mt=v(Z);let yt,bt=0,_t="rgba(0,0,0,0.08)",wt=!1,xt="",kt="none",Ct="50% 50%",Ft="0",At="source_in",Vt="",jt="",Dt=0,St=0,Pt=0,Tt="",zt="";d((()=>{mt.removeSvgFilter(yt,At)})),void 0===e.json&&i.json&&void 0!==dt&&i.json(dt),void 0===e.templateContext&&i.templateContext&&void 0!==pt&&i.templateContext(pt),void 0===e.origJson&&i.origJson&&void 0!==gt&&i.origJson(gt),void 0===e.layoutParams&&i.layoutParams&&void 0!==ht&&i.layoutParams(ht),o=mt.getDerivedFromVars(dt.image_url),ut(),ut=a(o,(t=>L=t)),s=mt.getDerivedFromVars(dt.gif_url),lt(),lt=a(s,(t=>R=t)),l=L||R,bt=0,l?wt=!1:(wt=!0,mt.logError(X(new Error('Missing "image_url" for "image"')))),u=mt.getDerivedFromVars(dt.width),st(),st=a(u,(t=>B=t)),c="wrap_content"===(null==B?void 0:B.type),p=mt.getDerivedFromVars(dt.height),ot(),ot=a(p,(t=>N=t)),g="wrap_content"===(null==N?void 0:N.type),h=mt.getDerivedFromVars(dt.preview),it(),it=a(h,(t=>O=t));{const t=O;xt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}f=mt.getDerivedFromVars(dt.placeholder_color),rt(),rt=a(f,(t=>I=t)),_t=nt(I,1,_t),m=mt.getDerivedFromVars(dt.scale),et(),et=a(m,(t=>M=t)),kt=ct(M)||kt,y=mt.getDerivedFromVars({content_alignment_horizontal:dt.content_alignment_horizontal,content_alignment_vertical:dt.content_alignment_vertical}),Q(),Q=a(y,(t=>T=t)),Ct=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:vt(t)}(T,Ct),b=mt.getDerivedFromVars(dt.accessibility),K(),K=a(b,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=mt.getDerivedFromVars(dt.aspect),Y(),Y=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;Ft=t&&Mt(t)?(100/Number(t)).toFixed(2):"0"}$=mt.getDerivedFromVars(dt.tint_color),G(),G=a($,(t=>D=t)),x=mt.getDerivedFromVars(dt.tint_mode),H(),H=a(x,(t=>j=t));{const t=D,e=t?nt(t):void 0,r=Zt(j,At);e===yt&&r===At||(mt.removeSvgFilter(yt,At),Vt=e?mt.addSvgFilter(e,r):"",yt=e,At=r)}if(k=mt.getDerivedFromVars(dt.appearance_animation),q(),q=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;jt=Et(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=$t(t.duration,300),St=$t(t.start_delay,0),Dt=$t(t.alpha,0)}C=mt.getDerivedFromVars(dt.filters),W(),W=a(C,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=It(A,mt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Tt=t,zt=e}return E={aspect:"0"!==Ft,"is-width-content":c,"is-height-content":g,loaded:!1,"before-appearance":Boolean(jt)&&!0},F={"background-image":xt,"background-color":xt?void 0:_t,"background-size":kt,"clip-path":zt||void 0,"object-fit":kt,"object-position":Ct,filter:["",Tt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":jt||void 0,"--divkit-appearance-fade-start":jt?Dt:void 0,"--divkit-appearance-delay":jt?`${St}ms`:void 0,"--divkit-appearance-duration":jt?`${Pt}ms`:void 0},W(),q(),H(),G(),Y(),K(),Q(),et(),rt(),it(),ot(),st(),lt(),ut(),wt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("image",he,E),json:dt,origJson:gt,templateContext:pt,layoutParams:ht,customDescription:!0},{},{default:()=>E.aspect?`<span${J("class",he["image__aspect-wrapper"],0)}${U({"padding-bottom":`${Ft}%`})}><img${J("class",he.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",he.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(F),0)}${J("alt",_,0)}${J("aria-hidden",_?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 ye(t){return t>0&&t<1}function be(t){return String(Math.ceil(1e3*t)/1e3)}function _e(t,e,r){if(t.some(ye)){const e=Math.max(...t.filter(ye).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(${et(i*t[e]/n)},${be(t[e])}fr)`:t[e]?o[e]=`${be(t[e])}fr`:o[e]="auto";return o.join(" ")}const we=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b=r,_=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:E}=e;const F=v(Z);let A,V,j=!1,D=1,S=[],T=[],M=[],I=[],O=0,J=!1,N="top",U="left";void 0===e.json&&i.json&&void 0!==x&&i.json(x),void 0===e.templateContext&&i.templateContext&&void 0!==k&&i.templateContext(k),void 0===e.origJson&&i.origJson&&void 0!==C&&i.origJson(C),void 0===e.layoutParams&&i.layoutParams&&void 0!==E&&i.layoutParams(E),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Rt(y,D),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],T=[],M=[],I=[],J=!1,V=l.map(((i,n)=>{var o,a,s,l;const u=m[n],d=Number(u.columnSpan)||1,c=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:d,rowSpan:c},p="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/d:0,g="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/c:0,h=1===d&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/d:0,f=1===c&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.type)&&u.height.value?Number(u.height.value)/c:0;for(let i=e;i<e+d;++i)for(let e=r;e<r+c;++e)t[i+"_"+e]?J=!0:(t[i+"_"+e]=!0,(!S[i]||S[i]<p)&&(S[i]=p),(!T[e]||T[e]<g)&&(T[e]=g),(!M[i]||M[i]<h)&&(M[i]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:v,fakeElement:(null==E?void 0:E.fakeElement)||!1}})})),0!==e&&(J=!0),J&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=a(u,(t=>f=t)),N=Yt(f,N),d=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=a(d,(t=>h=t)),U=Gt(h,U),c={valign:N,halign:U},p={"grid-template-columns":_e(S,M,D),"grid-template-rows":_e(T,I,O)},g=j||J,b(),_(),w(),$(),g?"":`${z(Ut,"Outer").$$render(t,{cls:ft("grid",me,c),json:x,origJson:C,templateContext:k,style:p,layoutParams:E},{},{default:()=>`${P(V,(e=>`${z(lr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),$e=we,xe={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","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 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 Ce(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const Ee=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,D,S,T,M,I,O,N,U=r,B=r,R=r,W=r,q=r,H=r,Y=r,K=r,Q=r,rt=r,{json:it={}}=e,{templateContext:nt}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(Z);let lt,ut,dt=[],ct=null,vt=!1;st.getCustomization("galleryLeftClass"),st.getCustomization("galleryRightClass");let pt=!1;O=a(st.isDesktop,(t=>I=t));let gt,ht,mt,yt,bt=1,_t="horizontal",xt="start",kt=8,Et="",Ft=[],At={},Vt=!1,jt={},Dt=0;const St=Ce((function(){}),50);function Pt(){let t=[],e=dt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<bt;++e){const i=dt[e].children[r];i&&t.push(i)}return t}function Tt(t,e,r="smooth"){const i="horizontal"===_t,n=i?"offsetLeft":"offsetTop",o=i?"left":"top";lt.scroll({[o]:Math.max(0,t[e][n]-kt/2),behavior:r})}function zt(t){const e=Pt(),r=lt.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===_t?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"===_t?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}!it.id||pt||(null==at?void 0:at.fakeElement)||st.registerInstance(it.id,{setCurrentItem(t){const e=Pt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Tt(e,t)},setPreviousItem(t){const e=zt("prev"),r=Pt();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Tt(r,i)},setNextItem(t){const e="horizontal"===_t?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Pt();if(e&&"ring"===t)return void Tt(r,0);const i=zt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Tt(r,n)}}),d((()=>{vt=!1,it.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(it.id)})),void 0===e.json&&i.json&&void 0!==it&&i.json(it),void 0===e.templateContext&&i.templateContext&&void 0!==nt&&i.templateContext(nt),void 0===e.origJson&&i.origJson&&void 0!==ot&&i.origJson(ot),void 0===e.layoutParams&&i.layoutParams&&void 0!==at&&i.layoutParams(at),o=it.items,(null==o?void 0:o.length)&&Array.isArray(o)?pt=!1:(pt=!0,st.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!pt&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&vt&&!pt,l?"undefined"!=typeof ResizeObserver&&(ct=new ResizeObserver((()=>{St()})),ct.observe(ut)):ct&&(ct.disconnect(),ct=null),u=st.getDerivedFromVars(it.column_count),Q(),Q=a(u,(t=>M=t)),bt=Rt(M,bt),c=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}(s,bt),p=st.getDerivedFromVars(it.orientation),K(),K=a(p,(t=>T=t)),_t=pe(T,_t),g=st.getDerivedFromVars(it.cross_content_alignment),Y(),Y=a(g,(t=>S=t)),xt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,xt),h=st.getDerivedFromVars(it.item_spacing),H(),H=a(h,(t=>D=t)),kt=$t(D,kt),gt=et(kt),f=st.getDerivedFromVars(it.cross_spacing),q(),q=a(f,(t=>V=t)),mt=$t(V,kt),ht=et(mt),m=st.getDerivedFromVars(it.paddings),W(),W=a(m,(t=>A=t)),Et=wt(A,Et),y="horizontal"===_t?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===_t?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),yt=L(t,(t=>t)),R(),R=a(yt,(t=>F=t))}Ft=[],bt>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===_t||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")})),b=st.getDerivedFromVars(it.scroll_mode),B(),B=a(b,(t=>E=t));{const t={};let e={};Vt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===_t?e.parentVAlign=xt:e.parentHAlign=xt,"paging"===E&&(Vt=!0,e.scrollSnap="start",t["horizontal"===_t?"scroll-padding-left":"scroll-padding-top"]=et(kt/2)),1===bt&&(e.parentLayoutOrientation=_t),At=Ct(t,At),jt=Ct(e,jt)}return _=st.getDerivedFromVars(it.restrict_parent_scroll),rt(),rt=a(_,(t=>N=t)),w={padding:Et,"grid-gap":ht},$={"grid-gap":gt,[y]:ke(Ft)},x={orientation:_t,"scroll-snap":Vt},k=st.getDerivedFromVars(it.default_item),U(),U=a(k,(t=>C=t)),Dt=$t(C,Dt),U(),B(),R(),W(),q(),H(),Y(),K(),Q(),O(),rt(),"\n\n"+(pt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("gallery",xe,x),json:it,origJson:ot,templateContext:nt,layoutParams:at,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(xe.gallery__scroller,!0)+" "+j(N?G:"",!0)}"${J("style",tt(At),0)}${J("this",lt,0)}><div${J("class",xe["gallery__items-grid"],0)}${J("style",tt(w),0)}${J("this",ut,0)}>${P(c,((e,r)=>`<div${J("class",xe.gallery__items,0)}${J("style",tt($),0)}${J("this",dt[r],0)}>${P(e,(e=>`${z(lr,"Unknown").$$render(t,{layoutParams:jt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===_t?"\n ":""}`})}`)})),Fe=Ee,Ae={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"},Ve=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,_,w,$,x,k,C,E,F,A,V,D,S=r,T=r,M=r,I=r,O=r,N=r,B=r,R=r,L=r;var W;let{json:q={}}=e,{templateContext:H}=e,{origJson:Y}=e,{layoutParams:K}=e;const Q=v(Z),it=Q.genId("tabs");let ot,at,st,lt=!1,ut={};const dt=Q.getJsonWithVars(q.selected_tab);let ct,vt,pt=dt&&Number(dt)||0,gt=12,ht="",mt="",bt="",xt="",kt="",Et="",Ft="",At="",Dt=0,St="",Pt="",zt=null,It=!1,Ot=!1,Jt=pt,Nt=[],Bt=[];async function Lt(t,e=!1){if(Jt=pt,pt=t,It||(It=!0,at.style.height=et(at.clientHeight),st.style.transform=`translate3d(${100*-Jt}%,0,0)`),Ot=!0,async function(t){await b(),st.style.transform=`translate3d(${t}%,0,0)`}(100*-pt),function(t=!1){const e=t?Math.max(0,pt-1):Math.min(pt,Jt),r=t?Math.min(o.length-1,pt+1):Math.max(pt,Jt);Nt=Nt.map(((t,i)=>t||i>=e&&i<=r)),Bt=Bt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await b();const t=document.getElementById(`${it}-panel-${pt}`);t&&(at.style.height=et(t.offsetHeight))}(),Ht&&clearTimeout(Ht),Ht=window.setTimeout((()=>{Bt=o.map(((t,e)=>e===pt))}),400),qt=-pt*at.clientWidth,e){await b();const t=ot.querySelector(`.${Ae.tabs__item_selected}`);t&&t.focus()}}let qt,Ht=null;!q.id||lt||(null==K?void 0:K.fakeElement)||Q.registerInstance(q.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Lt(t)},setPreviousItem(t){let e=pt-1;e<0&&(e="ring"===t?o.length-1:pt),Lt(e)},setNextItem(t){let e=pt+1;e>o.length-1&&(e="ring"===t?0:pt),Lt(e)}}),d((()=>{q.id&&!(null==K?void 0:K.fakeElement)&&Q.unregisterInstance(q.id)})),void 0===e.json&&i.json&&void 0!==q&&i.json(q),void 0===e.templateContext&&i.templateContext&&void 0!==H&&i.templateContext(H),void 0===e.origJson&&i.origJson&&void 0!==Y&&i.origJson(Y),void 0===e.layoutParams&&i.layoutParams&&void 0!==K&&i.layoutParams(K),o=q.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?lt=!1:(lt=!0,Q.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=Q.getDerivedFromVars(q.width),R(),R=a(s,(t=>V=t)),l=Q.getDerivedFromVars(q.height),B(),B=a(l,(t=>A=t));{let t={};(null==K?void 0:K.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==V?void 0:V.type)&&(t.parentHorizontalWrapContent=!0),A&&"wrap_content"!==A.type||(t.parentVerticalWrapContent=!0),ut=Ct(t,ut)}if(!lt&&(pt<0||pt>=o.length)&&(Q.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:q.selected_tab,length:o.length}})),pt=pt<0?0:o.length-1),u=Q.getDerivedFromVars(q.tab_title_style),N(),N=a(u,(t=>F=t)),c=F||{},gt=Rt(c.font_size,gt),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/gt*10,right:(Number(t.right)||0)/gt*10,bottom:(Number(t.bottom)||0)/gt*10,left:(Number(t.left)||0)/gt*10};ht=wt(e,ht)}{const t=c.line_height;void 0!==t&&Mt(t)&&(mt=et(t/gt*10))}{const t=c.letter_spacing;void 0!==t&&_t(t)&&(bt=et(t/gt*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(W=c.corner_radius)&&void 0!==W?W:1e3;c.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]&&!_t(n[t]))return i;return jt(t,e,r)}(c.corners_radius,t,gt,xt):_t(t)&&(xt=et(t/gt*10))}return ct=Wt(c.active_font_weight||c.font_weight,ct),vt=Wt(c.inactive_font_weight||c.font_weight,vt),kt=nt(c.active_text_color,1,kt),Et=nt(c.inactive_text_color,1,Et),Ft=nt(c.active_background_color,1,Ft),At=nt(c.inactive_background_color,1,At),Dt=$t(c.item_spacing,Dt),p=Q.getDerivedFromVars(q.has_separator),O(),O=a(p,(t=>E=t)),g=Q.getDerivedFromVars(q.separator_color),I(),I=a(g,(t=>C=t)),h=Q.getDerivedFromVars(q.separator_paddings),M(),M=a(h,(t=>k=t)),E&&(C&&(St=nt(C,1,St)),k&&(Pt=wt(k,Pt))),f={background:St,margin:Pt},m=Q.getDerivedFromVars(q.switch_tabs_by_content_swipe_enabled),T(),T=a(m,(t=>x=t)),y=void 0===x||Boolean(x),_=Q.getDerivedFromVars(q.restrict_parent_scroll),L(),L=a(_,(t=>D=t)),w=Q.getDerivedFromVars(q.title_paddings),S(),S=a(w,(t=>$=t)),zt=Vt($||void 0,zt),lt||(Nt=o.map(((t,e)=>e===pt)),Bt=o.map(((t,e)=>e===pt))),S(),T(),M(),I(),O(),N(),B(),R(),L(),lt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("tabs",Ae,{}),json:q,origJson:Y,templateContext:H,layoutParams:K,customActions:"tabs"},{},{default:()=>`<div class="${j(Ae.tabs__list,!0)+" "+j(D?G:"",!0)}" role="tablist"${U({"--divkit-tabs-title-padding":zt?yt(zt):"","--divkit-tabs-font-size":et(gt),"--divkit-tabs-paddings":ht,"--divkit-tabs-line-height":mt,"--divkit-tabs-letter-spacing":bt,"--divkit-tabs-active-font-weight":ct||"","--divkit-tabs-inactive-font-weight":vt||"","--divkit-tabs-active-text-color":kt,"--divkit-tabs-inactive-text-color":Et,"--divkit-tabs-active-background-color":Ft,"--divkit-tabs-inactive-background-color":At,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":Dt?rt(Dt):""})}${J("this",ot,0)}>${P(o,((e,r)=>{let i=r===pt;return`\n\n ${z(Tt,"Actionable").$$render(t,{cls:ft("tabs__item",Ae,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=K&&K.fakeElement?[]:[e.title_click_action],attrs:{id:`${it}-tab-${r}`,"aria-controls":`${it}-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 pt===e||(Lt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${E?`<div${J("class",Ae.tabs__separator,0)}${J("style",tt(f),0)}></div>`:""}\n <div class="${j(Ae.tabs__panels,!0)+" "+j(D?G:"",!0)}"${J("this",at,0)}><div${J("class",ft("tabs__swiper",Ae,{inited:It,animated:Ot}),0)}${J("this",st,0)}>${P(o,((e,r)=>`<div${J("class",ft("tabs__panel",Ae,{visible:Bt[r]}),0)} role="tabpanel" id="${j(it,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(it,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Nt[r]?`${z(lr,"Unknown").$$render(t,{div:e.div,templateContext:H,layoutParams:ut},{},{})}`:""}\n </div>`))}</div></div>`})}`})),je=Ve,De="divkit-eb860",Se="divkit-e08c6";function Pe(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)}}Pe([.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]),Pe([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 Te=O(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(Z),p=v(mt);let g=new Map,h=new Set,f=!1,m=null,y=[],_=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=n.find((e=>e.state_id===t))||null;e?(k=t,C=e):u.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await b()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),c(mt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),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 $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(X(new Error('Missing "id" prop for div "state"'))));let C=null;const E=u.getJsonWithVars(o.default_state_id);let F=!1;return d((()=>{x&&!(null==l?void 0:l.fakeElement)&&p.unregisterInstance(x)})),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)?f=!1:(f=!0,u.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(E?(k=E,C=t.find((t=>t.state_id===k))||null,C||u.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(C=t[0],k=C.state_id)))}(n),f?"":`${z(Ut,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=C)&&void 0!==e&&e.div?`${z(lr,"Unknown").$$render(t,{div:C.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${P(y,(e=>"direction"in e?`<div${J("class",De,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${J("class",Se,0)}>${z(lr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class",De,0)}><div${J("class",Se,0)}>${z(lr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ze={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Me=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C=r,E=r,F=r,A=r,V=r,D=r;var S,T,M,I,O,N,U;let{json:B={}}=e,{templateContext:R}=e,{origJson:L}=e,{layoutParams:W}=e;const q=v(Z),H=q.genId("pager");let Y,K=!1,Q=!1,it=0,nt=0,ot=!1,at="horizontal",st="",lt="",ut="";function dt(t,e="smooth"){const r="horizontal"===at,i=Y.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Y.scroll({[o]:i[n],behavior:e}),it=t}Ce((function(){if(!K)return;const t=function(){const t=Array.from(Y.children),e=Y.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===at?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:it}();t!==it&&(it=t)}),50),B.id&&!(null==W?void 0:W.fakeElement)&&q.registerInstance(B.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');dt(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),dt(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),dt(e)}}),d((()=>{K=!1,B.id&&!(null==W?void 0:W.fakeElement)&&q.unregisterInstance(B.id)})),void 0===e.json&&i.json&&void 0!==B&&i.json(B),void 0===e.templateContext&&i.templateContext&&void 0!==R&&i.templateContext(R),void 0===e.origJson&&i.origJson&&void 0!==L&&i.origJson(L),void 0===e.layoutParams&&i.layoutParams&&void 0!==W&&i.layoutParams(W),(null===(S=B.items)||void 0===S?void 0:S.length)&&Array.isArray(B.items)?Q=!1:(Q=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!Q&&B.items||[]).map((t=>{let e=t,r=R;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=q.getDerivedFromVars(B.layout_mode),E(),E=a(s,(t=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(ot=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ot=!1:(ot=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),l=q.getDerivedFromVars(B.orientation),V(),V=a(l,(t=>x=t)),at=pe(x,at),u=q.getDerivedFromVars(B.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&_t(t)&&(st=et(t||0))}if(c=q.getDerivedFromVars(B.paddings),F(),F=a(c,(t=>w=t)),lt=wt(w,lt),p=q.getDerivedFromVars(B.restrict_parent_scroll),D(),D=a(p,(t=>k=t)),g="horizontal"===at?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=rt("horizontal"===at?((null===(T=B.paddings)||void 0===T?void 0:T.left)||0)+((null===(M=B.paddings)||void 0===M?void 0:M.right)||0):((null===(I=B.paddings)||void 0===I?void 0:I.top)||0)+((null===(O=B.paddings)||void 0===O?void 0:O.bottom)||0)),e=null===(N=_.neighbour_page_width)||void 0===N?void 0:N.value;ut=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${st})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(U=_.page_width)||void 0===U?void 0:U.value;ut=`${Number(t)}%`}return h={"grid-gap":st,padding:lt,[g]:ut},f={orientation:at},m=Q||ot,y=q.getStore("pagers"),C(),C=a(y,(t=>b=t)),function(t,e){const r=B.id;if(r){const o=new Map(b);i=y,b=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:dt}),n=b,i.set(n)}var i,n}(o.length,it),function(t){var e;if(t===nt)return;nt=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(it),C(),E(),F(),A(),V(),D(),m?"":`${z(Ut,"Outer").$$render(t,{cls:ft("pager",ze,f),json:B,origJson:L,templateContext:R,layoutParams:W,customPaddings:!0},{},{default:()=>`<div class="${j(ze.pager__items,!0)+" "+j(k?G:"",!0)}"${J("style",tt(h),0)}${J("this",Y,0)}>${P(o,(e=>`<div${J("class",ze.pager__item,0)}>${z(lr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=W&&W.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ie=Me,Oe={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"},Je=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,_,w,$,x,k,C,E,F=r,A=r,V=r,D=r,S=r,T=r,M=r,I=r,O=r;var N,B;let{json:R={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=["rounded_rectangle","circle"],Y=v(Z);let X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},tt="default",rt=15,it=10,ot=5;if(void 0===e.json&&i.json&&void 0!==R&&i.json(R),void 0===e.templateContext&&i.templateContext&&void 0!==L&&i.templateContext(L),void 0===e.origJson&&i.origJson&&void 0!==q&&i.origJson(q),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.layoutParams(H),o=Y.getDerivedFromVars(R.shape),T(),T=a(o,(t=>x=t)),s=Y.getDerivedFromVars(R.active_item_color),D(),D=a(s,(t=>w=t)),l=Y.getDerivedFromVars(R.inactive_item_color),S(),S=a(l,(t=>$=t)),u=Y.getDerivedFromVars(R.active_item_size),M(),M=a(u,(t=>k=t)),d=Y.getDerivedFromVars(R.active_shape),O(),O=a(d,(t=>E=t)),c=Y.getDerivedFromVars(R.inactive_shape),I(),I=a(c,(t=>C=t)),E&&(K=te({type:"shape_drawable",shape:E},G,K)),C&&(Q=te({type:"shape_drawable",shape:C},G,Q)),!E&&!C&&x){const t=Rt(k,1.3);Q=te({type:"shape_drawable",shape:x,color:Q.background},G,Q),Q.background=nt($,1,Q.background),K=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:K.background}),K.background=nt(w,1,K.background)}if(p=Y.getDerivedFromVars(R.space_between_centers),A(),A=a(p,(t=>y=t)),g=Y.getDerivedFromVars(R.items_placement),V(),V=a(g,(t=>_=t)),!_||"default"!==_.type&&"stretch"!==_.type)tt="default",y&&(rt=$t(y.value,rt));else if(tt=_.type,"default"===tt)rt=$t(null===(N=_.space_between_centers)||void 0===N?void 0:N.value,rt);else if("stretch"===tt){const t=_;it=Rt(t.max_visible_items,it),ot=$t(null===(B=t.item_spacing)||void 0===B?void 0:B.value,ot)}return h=Y.getStore("pagers"),F(),F=a(h,(t=>m=t)),async function(t){R.pager_id&&t.has(R.pager_id)&&(X=t.get(R.pager_id),await b())}(m),f={placement:tt},F(),A(),V(),D(),S(),T(),M(),I(),O(),`${z(Ut,"Outer").$$render(t,{cls:ft("indicator",Oe,f),json:R,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<div${J("class",Oe.indicator__scroller,0)}${J("this",undefined,0)}><div${J("class",Oe.indicator__items,0)} role="tablist"${U({margin:"default"===tt?`0 ${et(Math.max(0,K.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":et(Q.width),"--divkit-indicator-inactive-height":et(Q.height),"--divkit-indicator-inactive-border-radius":et(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":et(K.width),"--divkit-indicator-active-height":et(K.height),"--divkit-indicator-active-border-radius":et(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/Q.width,"--divkit-indicator-default-margin":"default"===tt?`0 ${et((rt-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===tt?et(ot):"","--divkit-indicator-stretch-max-count":"stretch"===tt?it:"","--divkit-indicator-stretch-max-spacer":"stretch"===tt?et((it-1)*ot):""})}${J("this",undefined,0)}>${X?`${P(Array(X.size),((t,e)=>{let r=e===X.currentItem;return`\n <div class="${j(ft("indicator__item",Oe,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(X.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(X.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ne=Je,Ue={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 Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&nt(t.text_color)||"#000",n=Lt(t.font_weight);if(Mt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:et(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 Re(t,e,r){return Math.max(e,Math.min(r,t))}const Le=2147483647,We=-2147483648,qe=Number.MAX_VALUE,He=Number.MIN_VALUE,Ge="string",Ye="integer",Ze="number",Xe="boolean",Ke="color",Qe="datetime";class tr{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=R(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 er={string:class extends tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends tr{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 tr{convertValue(t){if("number"!=typeof t||isNaN(t)||t>Le||t<We||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends tr{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 tr{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function rr(t,e,r){if(!(e in er))throw new Error("Unsupported variable type");return new er[e](t,r)}function ir(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 nr=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,D,S,T,M,I,O,N,B,R,L,W,q,H,G=r,Y=r,K=r,Q=r,tt=r,it=r,nt=r,ot=r,at=r,st=r,lt=r,ut=r;var dt,ct,vt,pt;let{json:gt={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Z),kt=v(St);let Ct=0,Et=100;const At=xt.getJsonWithVars(gt.thumb_value_variable),Vt=xt.getJsonWithVars(gt.thumb_secondary_value_variable);W=a(At&&xt.getVariable(At,"integer")||rr("temp","integer",0),(t=>L=t)),R=a(Vt&&xt.getVariable(Vt,"integer")||rr("temp","integer",0),(t=>B=t));let jt,Dt,Pt,Tt=Re(L||0,Ct,Et),zt=Re(B||0,Ct,Et),Mt=bt,It=Mt,Ot=bt,Jt=bt,Nt=null,Bt=null,Rt=Pt,Lt="",Wt="",qt=!1;Ce((function(){}),50),void 0===e.json&&i.json&&void 0!==gt&&i.json(gt),void 0===e.templateContext&&i.templateContext&&void 0!==ht&&i.templateContext(ht),void 0===e.origJson&&i.origJson&&void 0!==mt&&i.origJson(mt),void 0===e.layoutParams&&i.layoutParams&&void 0!==yt&&i.layoutParams(yt),o=xt.getDerivedFromVars(gt.min_value),ut(),ut=a(o,(t=>H=t)),s=xt.getDerivedFromVars(gt.max_value),lt(),lt=a(s,(t=>q=t)),Ct=Ft(H,Ct),Et=Ft(q,Et);{const t=Re(L||0,Ct,Et);t!==Tt&&(Tt=t)}{const t=Re(B||0,Ct,Et);t!==zt&&(zt=t)}l=xt.getDerivedFromVars(gt.thumb_style),st(),st=a(l,(t=>N=t)),Mt=te(N,wt,Mt),u=xt.getDerivedFromVars(gt.thumb_secondary_style),at(),at=a(u,(t=>O=t)),It=te(O,wt,Mt),d=xt.getDerivedFromVars(gt.track_inactive_style),ot(),ot=a(d,(t=>I=t)),Ot=te(I,$t,Ot),c=xt.getDerivedFromVars(gt.track_active_style),nt(),nt=a(c,(t=>M=t)),Jt=te(M,$t,Jt),p=xt.getDerivedFromVars(gt.tick_mark_active_style),it(),it=a(p,(t=>T=t));{let t=te(T,wt,bt);t!==bt&&(Nt=t)}jt=Nt?Vt?ir(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Et,!0):ir(Ct,Tt,Ct,Et,!0):[],g=xt.getDerivedFromVars(gt.tick_mark_inactive_style),tt(),tt=a(g,(t=>S=t));{let t=te(S,wt,bt);t!==bt&&(Bt=t)}Dt=Bt?Vt?ir(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Et,!1):ir(Tt+1,Et+1,Ct,Et,!0):[],h=xt.getDerivedFromVars(gt.thumb_text_style),Q(),Q=a(h,(t=>D=t)),Pt=Be(D,Pt),f=xt.getDerivedFromVars(gt.thumb_secondary_text_style),K(),K=a(f,(t=>V=t)),Rt=Be(V,Pt),m=xt.getDerivedFromVars(gt.accessibility),Y(),Y=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=xt.getDerivedFromVars(gt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):Mt===bt?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===bt?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):Ot===bt&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return b=et(Math.max(...[Mt.width,It.width,0].filter(_t))),_=et(Math.max(...[Mt.height,It.height,0].filter(_t))),w=(Tt-Ct)/(Et-Ct),$=Vt?(zt-Ct)/(Et-Ct):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,C={"--divkit-slider-thumb-width":et(Mt.width),"--divkit-slider-thumb-height":et(Mt.height),"--divkit-slider-thumb-secondary-width":et(It.width),"--divkit-slider-thumb-secondary-height":et(It.height),"--divkit-slider-text-offset-x":(null===(dt=null==Pt?void 0:Pt.offset)||void 0===dt?void 0:dt.x)?rt(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.y)?rt(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Rt?void 0:Rt.offset)||void 0===vt?void 0:vt.x)?rt(Rt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Rt?void 0:Rt.offset)||void 0===pt?void 0:pt.y)?rt(Rt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?et(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?et(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?et(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?et(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?et(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?et(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},E={},G(),Y(),K(),Q(),tt(),it(),nt(),ot(),at(),st(),R(),W(),lt(),ut(),"\n\n"+(qt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("slider",Ue,E),style:C,customDescription:!0,customActions:"slider",json:gt,origJson:mt,templateContext:ht,layoutParams:yt},{},{default:()=>{var t,e,r,i,n,o;return`<div${J("class",Ue["slider__tracks-wrapper"],0)}><div${J("class",Ue["slider__tracks-inner"],0)}${J("this",undefined,0)}><div${J("class",Ue.slider__track,0)}${U({height:et(Ot.height),"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}></div>\n <div${J("class",Ue["slider__active-track"],0)}${U({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Jt.height),"border-radius":et(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${P(jt,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(Dt,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ue.slider__thumb,0)}${U({"border-radius":et(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Pt?`<div${J("class",Ue["slider__thumb-text"],0)}><div${J("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Pt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Pt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Pt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Tt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Ue.slider__thumb,!0)+" "+j(Ue.slider__thumb_secondary,!0)}"${U({"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Rt?`<div class="${j(Ue["slider__thumb-text"],!0)+" "+j(Ue["slider__thumb-text_secondary"],!0)}"><div${J("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(i=Rt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(n=Rt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Rt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ue.slider__input,0)}${J("min",Ct,0)}${J("max",Et,0)} step="1"${J("value",Tt,0)}${J("aria-label",Lt,0)}>\n ${Vt?`<input type="range"${J("class",`${Ue.slider__input} ${Ue.slider__input_secondary}`,0)}${J("min",Ct,0)}${J("max",Et,0)} step="1"${J("value",zt,0)}${J("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),or={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},ar={text:Kt,container:ce,separator:ge,image:fe,gif:fe,grid:$e,gallery:Fe,tabs:je,state:Te,pager:Ie,indicator:Ne,slider:nr,input:O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,D,S,P,T,M,I,O,N,U,B=r,R=r,{json:L={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Z);let Y;const K=G.getJsonWithVars(L.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),O=a(K&&G.getVariable(K,"string")||rr("temp","string",""),(t=>I=t));let tt="";M=a(G.getDerivedFromVars(L.hint_text),(t=>T=t)),P=a(G.getDerivedFromVars(L.hint_color),(t=>S=t));let it="";D=a(G.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(G.getDerivedFromVars(L.font_weight),(t=>F=t)),E=a(G.getDerivedFromVars(L.line_height),(t=>C=t)),k=a(G.getDerivedFromVars(L.letter_spacing),(t=>x=t));let lt="";$=a(G.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";_=a(G.getDerivedFromVars(L.highlight_color),(t=>b=t));let dt="";y=a(G.getDerivedFromVars(L.keyboard_type),(t=>m=t));const ct={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",pt="text";f=a(G.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let gt="",ht="";U=a(G.getDerivedFromVars(L.select_all_on_focus),(t=>N=t)),void 0===e.json&&i.json&&void 0!==L&&i.json(L),void 0===e.templateContext&&i.templateContext&&void 0!==W&&i.templateContext(W),void 0===e.origJson&&i.origJson&&void 0!==q&&i.origJson(q),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.layoutParams(H),tt=I,o=T,it=nt(S,1,it),st=Rt(V,st),ot=Wt(F,ot);{const t=C;Mt(t)&&(at=t/st)}return bt(x)&&(lt=et(x/st*10)),ut=nt(w,1,ut),dt=nt(b,1,dt),m&&m in ct&&(pt=ct[m],vt=m),s="multi_line_text"===vt,l=G.getDerivedFromVars(L.paddings),R(),R=a(l,(t=>g=t)),Mt(h)&&(gt=`calc(${h*(at||1.25)+"em"} + ${rt($t(null==g?void 0:g.top,0)+$t(null==g?void 0:g.bottom,0))})`),u=G.getDerivedFromVars(L.accessibility),B(),B=a(u,(t=>p=t)),(null==p?void 0:p.description)?ht=p.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(dt),"vertical-overflow":!1,multiline:s},c={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":dt,"font-size":et(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":gt},B(),R(),f(),y(),_(),$(),k(),E(),A(),D(),P(),M(),O(),U(),Q?"":`${z(Ut,"Outer").$$render(t,{cls:ft("input",or,d),style:c,customDescription:!0,customActions:"input",json:L,origJson:q,templateContext:W,layoutParams:H},{},{default:()=>`<span${J("class",or.input__wrapper,0)}><span${J("class",or.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"":""}</span>\n ${s?`<textarea${J("class",or.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("this",Y,0)}>${j(tt,!0)}</textarea>`:`<input${J("type",pt,0)}${J("class",or.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("value",tt,0)}${J("this",Y,0)}>`}</span>`})}`}))},sr=O(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(Z);let u,d,c;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),u=n,d=o,c=u&&ar[u.type]||void 0,!c&&(({templateContext:d,json:u}=l.processTemplate(u,d)),c=u&&ar[u.type]||void 0,!c)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(X(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return c?`${z(c||T,"svelte:component").$$render(t,{json:u,templateContext:d,layoutParams:s,origJson:a||n},{},{})}`:""})),lr=sr,ur=O(((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${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",n[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("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"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function dr(t,e,r,i){const n=r[t.type];if(!n)return i(X(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 e(r,n){const o=Object.keys(n).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const i=n[t];"object"==typeof i&&null!==i?(r[t]=Array.isArray(i)?[]:{},e(r[t],i)):r[t]=i})),l.forEach((e=>{const o=n[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else i(X(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function cr(){}function vr(t){return{subscribe:e=>(e(t),cr)}}function pr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function gr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function hr(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 fr(t){var e=parseInt(t,10);if(e>Le||e<We)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function mr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function yr(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,yr.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function br(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function _r(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==i;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",d="\\",c="||",v="&&",p="==",g="!=",h=">=",f="<=",m="+",y="-",b="true",_="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,C=/^[a-zA-Z_]/,E=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),D={type:"any"},S=kt(["}"],!0,!1),P=xt("?",!1),T=xt(":",!1),z=xt("||",!1),M=xt("&&",!1),I=xt("==",!1),O=xt("!=",!1),J=xt(">=",!1),N=xt(">",!1),U=xt("<=",!1),B=xt("<",!1),R=xt("+",!1),L=xt("-",!1),W=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Y=xt("(",!1),Z=xt(")",!1),X=xt(",",!1),K=Ct("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Ct("integer"),rt=kt([["0","9"]],!1,!1),it=Ct("number"),nt=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Ct("boolean"),lt=xt("true",!1),ut=xt("false",!1),dt=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),ct=Ct("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Ct("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return hr(t)},ft=0,mt=0,yt=[{line:1,column:1}],bt=0,_t=[],wt=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 $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ct(t){return{type:"other",description:t}}function Et(e){var r,i=yt[e];if(i)return i;for(r=e-1;!yt[r];)r--;for(i={line:(i=yt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return yt[e]=i,i}function Ft(t,e){var r=Et(t),i=Et(e);return{source:n,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:i.line,column:i.column}}}function At(t){ft<bt||(ft>bt&&(bt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Rt(),(e=Dt())!==i?(Rt(),mt=t,t=e):(ft=t,t=i),t}function jt(){var e,r,n,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i?(n=Rt(),(o=Dt())!==i?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=i,0===wt&&At(A)),a!==i?(mt=e,e=o):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=i,0===wt&&At(V)),r!==i&&(mt=e,r=""),(e=r)===i&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(n=d,ft++):(n=i,0===wt&&At(j)),n===i&&(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F))),wt--,n===i?r=void 0:(ft=r,r=i),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=$t()):(ft=e,e=i)):(ft=e,e=i),e===i))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i){if(n=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(S)),o!==i)for(;o!==i;)n.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(S));else n=i;n!==i?(125===t.charCodeAt(ft)?(o=l,ft++):(o=i,0===wt&&At(A)),o!==i?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=i)):(ft=e,e=i)}else ft=e,e=i;e===i&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)),n!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=mr(n)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,n,o,a,s;return e=ft,(r=St())!==i?(Rt(),63===t.charCodeAt(ft)?(n="?",ft++):(n=i,0===wt&&At(P)),n!==i?(Rt(),(o=Dt())!==i?(Rt(),58===t.charCodeAt(ft)?(a=":",ft++):(a=i,0===wt&&At(T)),a!==i?(Rt(),(s=Dt())!==i?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=St()),e}function St(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Pt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===c?(s=c,ft+=2):(s=i,0===wt&&At(z)),s!==i?(l=Rt(),(u=Pt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===c?(s=c,ft+=2):(s=i,0===wt&&At(z)),s!==i?(l=Rt(),(u=Pt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=gr(r,n)}else ft=e,e=i;return e}function Pt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Tt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=i,0===wt&&At(M)),s!==i?(l=Rt(),(u=Tt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=i,0===wt&&At(M)),s!==i?(l=Rt(),(u=Tt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=gr(r,n)}else ft=e,e=i;return e}function Tt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=zt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===p?(s=p,ft+=2):(s=i,0===wt&&At(I)),s===i&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=i,0===wt&&At(O))),s!==i?(l=Rt(),(u=zt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===p?(s=p,ft+=2):(s=i,0===wt&&At(I)),s===i&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=i,0===wt&&At(O))),s!==i?(l=Rt(),(u=zt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=pr(r,n)}else ft=e,e=i;return e}function zt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Mt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=i,0===wt&&At(J)),s===i&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=i,0===wt&&At(N)),s===i&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=i,0===wt&&At(U)),s===i&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=i,0===wt&&At(B))))),s!==i?(l=Rt(),(u=Mt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=i,0===wt&&At(J)),s===i&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=i,0===wt&&At(N)),s===i&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=i,0===wt&&At(U)),s===i&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=i,0===wt&&At(B))))),s!==i?(l=Rt(),(u=Mt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=pr(r,n)}else ft=e,e=i;return e}function Mt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=It())!==i){for(n=[],o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=i,0===wt&&At(R)),s===i&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=i,0===wt&&At(L))),s!==i?(l=Rt(),(u=It())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=i,0===wt&&At(R)),s===i&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=i,0===wt&&At(L))),s!==i?(l=Rt(),(u=It())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=pr(r,n)}else ft=e,e=i;return e}function It(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Ot())!==i){for(n=[],o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=i,0===wt&&At(W)),s===i&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=i,0===wt&&At(q)),s===i&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=i,0===wt&&At(H)))),s!==i?(l=Rt(),(u=Ot())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=i,0===wt&&At(W)),s===i&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=i,0===wt&&At(q)),s===i&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=i,0===wt&&At(H)))),s!==i?(l=Rt(),(u=Ot())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=pr(r,n)}else ft=e,e=i;return e}function Ot(){var e,r,n;return(e=Ut())===i&&(e=Nt())===i&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=i,0===wt&&At(G)),r===i&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=i,0===wt&&At(R)),r===i&&(45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)))),r!==i?(Rt(),(n=Ot())!==i?(mt=e,e={type:"UnaryExpression",operator:r,argument:n}):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=ft,(r=Bt())!==i?(Rt(),40===t.charCodeAt(ft)?(n="(",ft++):(n=i,0===wt&&At(Y)),n!==i?(Rt(),o=function(){var e,r,n,o,a,s,l;if(e=ft,(r=Dt())!==i){for(n=[],o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=i,0===wt&&At(X)),a!==i?(Rt(),(s=Dt())!==i?o=s:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=i,0===wt&&At(X)),a!==i?(Rt(),(s=Dt())!==i?o=s:(ft=o,o=i)):(ft=o,o=i);mt=e,l=n,e=[r,...l]}else ft=e,e=i;return e===i&&(e=Rt()),e}(),o!==i?(Rt(),41===t.charCodeAt(ft)?(a=")",ft++):(a=i,0===wt&&At(Z)),a!==i?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,(r=Bt())!==i&&(mt=e,r={type:"Variable",id:r}),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=i,0===wt&&At(Q)),r!==i?(n=function(){var t,e,r;for(t=ft,e=[],r=Jt();r!==i;)e.push(r),r=Jt();return mt=t,e=hr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=i,0===wt&&At(Q)),o!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),wt--,e===i&&(r=i,0===wt&&At(K)),e}(),e===i&&(e=Ut())===i&&(e=Nt())===i&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=i,0===wt&&At(lt)),r!==i&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===i&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=i,0===wt&&At(ut)),r!==i&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===i&&(r=i,0===wt&&At(st)),e}(),e===i&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=i,0===wt&&At(Y)),r!==i&&(n=Dt())!==i?(41===t.charCodeAt(ft)?(o=")",ft++):(o=i,0===wt&&At(Z)),o!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i))),e}())),e}())),e}function Jt(){var e,r,n,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i?(n=Rt(),(o=Dt())!==i?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=i,0===wt&&At(A)),a!==i?(mt=e,e=o):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=i,0===wt&&At(V)),r!==i&&(mt=e,r=""),(e=r)===i&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(n=d,ft++):(n=i,0===wt&&At(j)),n===i&&(39===t.charCodeAt(ft)?(n="'",ft++):(n=i,0===wt&&At(Q)),n===i&&(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)))),wt--,n===i?r=void 0:(ft=r,r=i),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=$t()):(ft=e,e=i)):(ft=e,e=i),e===i))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i){if(n=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(tt)),o!==i)for(;o!==i;)n.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(tt));else n=i;n!==i?(125===t.charCodeAt(ft)?(o=l,ft++):(o=i,0===wt&&At(A)),o!==i?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=i)):(ft=e,e=i)}else ft=e,e=i;e===i&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)),n!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=mr(n)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Nt(){var e,r,n,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt)),o!==i)for(;o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));else n=i;return n!==i?(mt=e,e={type:"IntegerLiteral",value:fr($t())}):(ft=e,e=i),wt--,e===i&&(r=i,0===wt&&At(et)),e}function Ut(){var e,r,n,o,a,s,l,u,d,c;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=i,0===wt&&At(nt)),o!==i){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=i,0===wt&&At(rt)),s!==i)for(;s!==i;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=i,0===wt&&At(rt));else a=i;if(a!==i){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=i,0===wt&&At(ot)),l===i&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=i,0===wt&&At(at))),l!==i){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=i,0===wt&&At(R)),u===i&&(45===t.charCodeAt(ft)?(u=y,ft++):(u=i,0===wt&&At(L))),u===i&&(u=null),d=[],x.test(t.charAt(ft))?(c=t.charAt(ft),ft++):(c=i,0===wt&&At(rt)),c!==i)for(;c!==i;)d.push(c),x.test(t.charAt(ft))?(c=t.charAt(ft),ft++):(c=i,0===wt&&At(rt));else d=i;d!==i?s=l=[l,u,d]:(ft=s,s=i)}else ft=s,s=i;s===i&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=i}else ft=e,e=i;if(e===i){if(e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt)),o!==i)for(;o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));else n=i;if(n!==i)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=i,0===wt&&At(ot)),o===i&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=i,0===wt&&At(at))),o!==i){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=i,0===wt&&At(R)),a===i&&(45===t.charCodeAt(ft)?(a=y,ft++):(a=i,0===wt&&At(L))),a===i&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=i,0===wt&&At(rt)),l!==i)for(;l!==i;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=i,0===wt&&At(rt));else s=i;s!==i?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=i)}else ft=e,e=i;else ft=e,e=i}return wt--,e===i&&(r=i,0===wt&&At(it)),e}function Bt(){var e,r,n,o,a;if(wt++,e=ft,r=ft,wt++,n=function(){var e,r,n,o;return e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=i,0===wt&&At(lt)),r===i&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=i,0===wt&&At(ut))),r!==i?(n=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(dt)),wt--,o===i?n=void 0:(ft=n,n=i),n!==i?e=r=[r,n]:(ft=e,e=i)):(ft=e,e=i),e}(),wt--,n===i?r=void 0:(ft=r,r=i),r!==i)if(C.test(t.charAt(ft))?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(vt)),n!==i){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=i,0===wt&&At(dt));a!==i;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=i,0===wt&&At(dt));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=i;else ft=e,e=i;return wt--,e===i&&(r=i,0===wt&&At(ct)),e}function Rt(){var e,r;for(wt++,e=[],E.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=i,0===wt&&At(gt));r!==i;)e.push(r),E.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=i,0===wt&&At(gt));return wt--,r=i,0===wt&&At(pt),e}if((r=a())!==i&&ft===t.length)return r;throw r!==i&&ft<t.length&&At({type:"end"}),function(t,e,r){return new yr(yr.buildMessage(t,e),t,e,r)}(_t,bt<t.length?t.charAt(bt):null,bt<t.length?Ft(bt,bt+1):Ft(bt,bt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(yr,Error),yr.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+":"+n.line+":"+n.column;if(i){var a=this.location.end,s=br("",n.line.toString().length," "),l=i[n.line-1],u=(n.line===a.line?a.column:l.length+1)-n.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+n.line+" | "+l+"\n"+s+" | "+br("",n.column-1," ")+br("",u,"^")}else e+="\n at "+o}return e},yr.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 wr=new Map,$r=new Map;function xr(t,e,r){const i={args:e,cb:r},n=wr.get(t)||[];wr.has(t)||wr.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");$r.set(o,i)}function kr(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 Cr(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=>{Cr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Cr(t.left,e),Cr(t.right,e);break;case"UnaryExpression":Cr(t.argument,e);break;case"ConditionalExpression":Cr(t.test,e),Cr(t.consequent,e),Cr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Cr(t,e)}))}}function Er(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Fr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Ar(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 Fr(t.value);if("color"===t.type)return Ir(Mr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Vr(t){let e=Ar(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function jr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const Dr=new Int32Array(1);function Sr(t){return Dr[0]=t,Dr[0]}function Pr(t){if(t<We||t>Le)throw new Error("Integer overflow.")}function Tr(t){const e=[];return Cr(t,{Variable(t){e.push(t.id.name)}}),e}function zr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Mr(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Ir(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 it(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Or(t,e){return{type:Ge,value:Ar(e)}}function Jr(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ze,value:r}}function Nr(t,e,r,i){const n=t.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=Ir(Mr(o))),{type:i,value:o}}function Ur(t,e,r){return Nr(t,e,r,r.type)}function Br(t,e,r){return Nr(t,e,r,"color")}function Rr(t,e,r){return Nr(t,e,r,"url")}const Lr=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:Ye,value:i}},Wr=Lr("getUTCFullYear"),qr=Lr("getUTCMonth"),Hr=Lr("getUTCDate"),Gr=Lr("getUTCDay"),Yr=Lr("getUTCHours"),Zr=Lr("getUTCMinutes"),Xr=Lr("getUTCSeconds"),Kr=Lr("getUTCMilliseconds");function Qr(t,e,r){if(!r.value.length)return"";let i="";const n=t.type===Ge?t.value:Ar(t);for(;i.length+n.length<e.value;)i+=r.value;return i.length>0&&i.length+n.length>e.value&&(i=i.substring(0,e.value-n.length)),i}function ti(t,e,r,i){const n=Qr(e,r,i);return{type:Ge,value:n+Ar(e)}}function ei(t,e,r,i){const n=Qr(e,r,i);return{type:Ge,value:Ar(e)+n}}function ri(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return e.type===Ye&&(i=Sr(i)),{type:e.type,value:i}}function ii(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return e.type===Ye&&(i=Sr(i)),{type:e.type,value:i}}function ni(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value,e[0].type===Ye&&(r=Sr(r));return{type:e[0].type,value:r}}function oi(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value,e[0].type===Ye&&(r=Sr(r));return{type:e.length?e[0].type:Ye,value:r}}function ai(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value,e[0].type===Ye&&(r=Sr(r));return{type:e.length?e[0].type:Ye,value:r}}function si(t,e){const r=Math.abs(e.value);return e.type===Ye&&Pr(r),{type:e.type,value:r}}function li(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:e[0].type,value:Math.max(...e.map((t=>t.value)))}}function ui(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:e[0].type,value:Math.min(...e.map((t=>t.value)))}}function di(t,e){return{type:e.type,value:Math.sign(e.value)}}function ci(t,e,r){let i;if(0===r.value&&e.type===Ye)i=e.value;else if(0===e.value&&e.type===Ye)i=0;else{let t=Math.sign(r.value);e.type===Ze&&0===t&&(t=Object.is(t,0)?1:-1),i=Math.abs(e.value)*t}return e.type===Ye&&Pr(i),{type:e.type,value:i}}function vi(t){return(e,r)=>{const i=Mr(r.value);return{type:Ze,value:i[t]/255}}}function pi(t){return(e,r,i)=>{const n=Mr(r.value);return n[t]=255*i.value,{type:Ke,value:Ir(n)}}}const gi=vi("a"),hi=vi("r"),fi=vi("g"),mi=vi("b"),yi=pi("a"),bi=pi("r"),_i=pi("g"),wi=pi("b");function $i(t,e,r){if(t.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Math.floor(t.value/e);return r&&(i%=r),{type:Ye,value:i}}const xi=36e5;function ki(t){return t.map(Vr).join(", ")}xr("toString",[Ye],Or),xr("toString",[Ze],Or),xr("toString",[Xe],Or),xr("toString",[Ke],Or),xr("toString",["url"],Or),xr("toNumber",[Ye],Jr),xr("toNumber",[Ge],Jr),xr("toInteger",[Ze],(function(t,e){if(e.value>Le||e.value<We)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Ye,value:r}})),xr("toInteger",[Ge],(function(t,e){const r=Number(e.value);if(isNaN(r)||r%1!=0||r>Le||r<We)throw new Error("Unable to convert value to Integer.");return{type:Ye,value:r}})),xr("toInteger",[Xe],(function(t,e){return{type:Ye,value:e.value?1:0}})),xr("toBoolean",[Ye],(function(t,e){if(1!==e.value&&0!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Xe,value:e.value}})),xr("toBoolean",[Ge],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Xe,value:"true"===e.value?1:0}})),xr("encodeUri",[Ge],(function(t,e){try{return{type:Ge,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),xr("decodeUri",[Ge],(function(t,e){try{return{type:Ge,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),xr("getIntegerValue",[Ge,Ye],Ur),xr("getNumberValue",[Ge,Ze],Ur),xr("getBooleanValue",[Ge,Xe],Ur),xr("getStringValue",[Ge,Ge],Ur),xr("getColorValue",[Ge,Ke],Br),xr("getColorValue",[Ge,Ge],Br),xr("getUrlValue",[Ge,"url"],Rr),xr("getUrlValue",[Ge,Ge],Rr),xr("parseUnixTime",[Ye],(function(t,e){return{type:Qe,value:new Date(1e3*e.value)}})),xr("nowLocal",[],(function(){return{type:Qe,value:new Date}})),xr("addMillis",[Qe,Ye],(function(t,e,r){return{type:Qe,value:new Date(e.value.getTime()+r.value)}})),xr("setYear",[Qe,Ye],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(r.value),{type:Qe,value:i}})),xr("setMonth",[Qe,Ye],(function(t,e,r){if(r.value<1||r.value>12)throw new Error(`Expecting month in [1..12], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCMonth(r.value-1),{type:Qe,value:i}})),xr("setDay",[Qe,Ye],(function(t,e,r){const i=new Date(e.value);if(r.value<=0&&-1!==r.value||r.value>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 ${r.value} for date ${Ar(e)}.`);return i.setUTCDate(-1===r.value?0:r.value),{type:Qe,value:i}})),xr("setHours",[Qe,Ye],(function(t,e,r){if(r.value<0||r.value>23)throw new Error(`Expecting hours in [0..23], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCHours(r.value),{type:Qe,value:i}})),xr("setMinutes",[Qe,Ye],(function(t,e,r){if(r.value<0||r.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCMinutes(r.value),{type:Qe,value:i}})),xr("setSeconds",[Qe,Ye],(function(t,e,r){if(r.value<0||r.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCSeconds(r.value),{type:Qe,value:i}})),xr("setMillis",[Qe,Ye],(function(t,e,r){if(r.value<0||r.value>999)throw new Error(`Expecting millis in [0..999], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCMilliseconds(r.value),{type:Qe,value:i}})),xr("getYear",[Qe],Wr),xr("getMonth",[Qe],qr),xr("getDay",[Qe],Hr),xr("getDayOfWeek",[Qe],Gr),xr("getHours",[Qe],Yr),xr("getMinutes",[Qe],Zr),xr("getSeconds",[Qe],Xr),xr("getMillis",[Qe],Kr),xr("getIntervalSeconds",[Ye],(function(t,e){return $i(e,1e3,60)})),xr("getIntervalTotalSeconds",[Ye],(function(t,e){return $i(e,1e3)})),xr("getIntervalMinutes",[Ye],(function(t,e){return $i(e,6e4,60)})),xr("getIntervalTotalMinutes",[Ye],(function(t,e){return $i(e,6e4)})),xr("getIntervalHours",[Ye],(function(t,e){return $i(e,xi,24)})),xr("getIntervalTotalHours",[Ye],(function(t,e){return $i(e,xi)})),xr("getIntervalTotalDays",[Ye],(function(t,e){return $i(e,864e5)})),xr("getIntervalTotalWeeks",[Ye],(function(t,e){return $i(e,6048e5)})),xr("len",[Ge],(function(t,e){return{type:Ye,value:e.value.length}})),xr("contains",[Ge,Ge],(function(t,e,r){return{type:Xe,value:e.value.includes(r.value)?1:0}})),xr("substring",[Ge,Ye,Ye],(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:Ge,value:e.value.substring(r.value,i.value)}})),xr("replaceAll",[Ge,Ge,Ge],(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:Ge,value:n}})),xr("index",[Ge,Ge],(function(t,e,r){return{type:Ye,value:e.value.indexOf(r.value)}})),xr("lastIndex",[Ge,Ge],(function(t,e,r){return{type:Ye,value:e.value.lastIndexOf(r.value)}})),xr("trim",[Ge],(function(t,e){return{type:Ge,value:e.value.trim()}})),xr("trimLeft",[Ge],(function(t,e){return{type:Ge,value:e.value.replace(/^\s+/,"")}})),xr("trimRight",[Ge],(function(t,e){return{type:Ge,value:e.value.replace(/\s+$/,"")}})),xr("toUpperCase",[Ge],(function(t,e){return{type:Ge,value:e.value.toUpperCase()}})),xr("toLowerCase",[Ge],(function(t,e){return{type:Ge,value:e.value.toLowerCase()}})),xr("padStart",[Ge,Ye,Ge],ti),xr("padStart",[Ye,Ye,Ge],ti),xr("padEnd",[Ge,Ye,Ge],ei),xr("padEnd",[Ye,Ye,Ge],ei),xr("div",[Ye,Ye],ri),xr("div",[Ze,Ze],ri),xr("mod",[Ye,Ye],ii),xr("mod",[Ze,Ze],ii),xr("mul",[{type:Ye,isVararg:!0}],ni),xr("mul",[{type:Ze,isVararg:!0}],ni),xr("sub",[{type:Ye,isVararg:!0}],oi),xr("sub",[{type:Ze,isVararg:!0}],oi),xr("sum",[{type:Ye,isVararg:!0}],ai),xr("sum",[{type:Ze,isVararg:!0}],ai),xr("abs",[Ye],si),xr("abs",[Ze],si),xr("max",[{type:Ye,isVararg:!0}],li),xr("max",[{type:Ze,isVararg:!0}],li),xr("min",[{type:Ye,isVararg:!0}],ui),xr("min",[{type:Ze,isVararg:!0}],ui),xr("maxNumber",[],(function(){return{type:Ze,value:qe}})),xr("minNumber",[],(function(){return{type:Ze,value:He}})),xr("maxInteger",[],(function(){return{type:Ye,value:Le}})),xr("minInteger",[],(function(){return{type:Ye,value:We}})),xr("round",[Ze],(function(t,e){const r=Math.sign(e.value);return{type:Ze,value:r*Math.round(Math.abs(e.value))}})),xr("floor",[Ze],(function(t,e){return{type:Ze,value:Math.floor(e.value)}})),xr("ceil",[Ze],(function(t,e){return{type:Ze,value:Math.ceil(e.value)}})),xr("signum",[Ze],di),xr("signum",[Ye],di),xr("copySign",[Ze,Ze],ci),xr("copySign",[Ye,Ye],ci),xr("getColorAlpha",[Ge],gi),xr("getColorAlpha",[Ke],gi),xr("getColorRed",[Ge],hi),xr("getColorRed",[Ke],hi),xr("getColorGreen",[Ge],fi),xr("getColorGreen",[Ke],fi),xr("getColorBlue",[Ge],mi),xr("getColorBlue",[Ke],mi),xr("setColorAlpha",[Ge,Ze],yi),xr("setColorAlpha",[Ke,Ze],yi),xr("setColorRed",[Ge,Ze],bi),xr("setColorRed",[Ke,Ze],bi),xr("setColorGreen",[Ge,Ze],_i),xr("setColorGreen",[Ke,Ze],_i),xr("setColorBlue",[Ge,Ze],wi),xr("setColorBlue",[Ke,Ze],wi),xr("rgb",[Ze,Ze,Ze],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Ke,value:Ir(n)}})),xr("argb",[Ze,Ze,Ze,Ze],(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:Ke,value:Ir(o)}}));const Ci={StringLiteral:function(t,e){return{type:Ge,value:e.value}},NumberLiteral:function(t,e){return{type:Ze,value:e.value}},IntegerLiteral:function(t,e){return{type:Ye,value:e.value}},BooleanLiteral:function(t,e){return{type:Xe,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Er(Ei(t,e.argument));switch(e.operator){case"!":if(r.type===Xe)return{type:Xe,value:r.value?0:1};zr(`${e.operator}${Vr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ye)return{type:Ye,value:r.value*t};if(r.type===Ze)return{type:Ze,value:r.value*t};zr(`${e.operator}${Vr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Er(Ei(t,e.test));if(r.type===Xe)return r.value?Ei(t,e.consequent):Ei(t,e.alternate);zr(`${Vr(r)} ? ${Vr(Ei(t,e.consequent))} : ${Vr(Ei(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 Ei(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=Ar(Ei(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:Ge,value:r}},LogicalExpression:function(t,e){const r=Er(Ei(t,e.left));if(r.type!==Xe&&zr(`${Vr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Xe,value:0};const i=Er(Ei(t,e.right));return i.type!==Xe&&zr(`${Vr(r)} ${e.operator} ${Vr(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${jr(i.type)}.`),{type:Xe,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=Ei(t,e.left),n=Ei(t,e.right);if(i.type!==n.type&&zr(`${Vr(i)} ${e.operator} ${Vr(n)}`,`Operator '${r}' cannot be applied to different types: ${jr(i.type)} and ${jr(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===Qe&&r.type===Qe?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Xe,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ze&&e.type!==Ye&&e.type!==Qe&&zr(`${Vr(e)} ${t} ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`);const n=e.type===Qe?e.value.getTime():e.value,o=r.type===Qe?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Xe,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Ge&&e.type!==Ze&&e.type!==Ye&&zr(`${Vr(e)} ${t} ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`),e.type===Ge)return"-"===t&&zr(`${Vr(e)} - ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`),{type:Ge,value:e.value+r.value};let i="+"===t?e.value+r.value:e.value-r.value;return e.type===Ye&&(i=Sr(i)),{type:e.type,value:i}}(r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let i;if(e.type!==Ye&&e.type!==Ze&&zr(`${Vr(e)} ${t} ${Vr(r)}`,`Operator '${t}' cannot be applied to ${jr(e.type)} type.`),"*"===t)i=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&zr(`${Vr(e)} ${t} ${Vr(r)}`,"Division by zero is not supported."),i="/"===t?e.value/r.value:e.value%r.value}return e.type===Ye&&(i=Sr(i)),{type:e.type,value:i}}(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=>Ei(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if($r.has(o))i=$r.get(o);else{const t=function(t,e){const r=wr.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=kr(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=>jr(t.type))).join(", "),i=`${r}(${ki(n)})`;"few"===t.type&&0===n.length?zr(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?zr(i,`Function '${r}' has no matching override for given argument types: ${e}.`):zr(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){zr(`${r}(${ki(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function Ei(t,e){if(e.type in Ci)return Ci[e.type](t,e);throw new Error("Unsupported expression")}function Fi(t,e){try{return function(t,e){let r="";if(Cr(e,{Variable(e){r||t.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(t,e),Ei(t,e)}catch(t){return{type:"error",value:t.message}}}class Ai{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Cr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Fi(t,this.ast);if("error"===r.type)return void e(X(new Error("Expression execution error"),{additional:{message:r.value}}));const i=r.value;if(i instanceof Date)return Fr(i);if("boolean"===r.type)return Boolean(i);if("color"===r.type){const t=ot(String(i));if(t)return Ir(t);e(X(new Error("Expression execution error")))}return i}catch(t){return void e(X(new Error("Expression execution error")))}}}function Vi(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=_r(t,{startRule:"JsonStringContents"}),i=Tr(r);return e.vars.push(...i),new Ai(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Vi(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Vi(t[n],e,r);return i}}var i;return t}function ji(t,e,r){if(t){if(t instanceof Ai)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>ji(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=ji(t[n],e,r);return i}}return t}function Di(t,e){const r={vars:[],hasExpression:!1},i=Vi(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>ji(i,t,e)}}const Si={pagers:function(){return R(new Map)}},Pi=new Map,Ti=new Map;function zi(t){const e=Pi.get(t)||R("");return Pi.has(t)||Pi.set(t,e),e}function Mi(t){const e=Ti.get(t)||new Map;return Ti.has(t)||Ti.set(t,e),e}class Ii{setVariable(t){const e=t.getName(),r=Mi(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),zi(this).set(e)}getVariable(t){return Mi(this).get(t)}}function Oi(){return new Ii}function Ji(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Ni=new Set(["start","stop","pause","resume","cancel","reset"]);class Ui{constructor(t){Ji(this,"timers",new Map),Ji(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(X(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(X(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Ni.has(e)))return void this.logError(X(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(X(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(X(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(X(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(X(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(X(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(X(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(X(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(X(new Error("The timer is already running"))):this.logError(X(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)}}}const Bi=O(((t,e,r,i)=>{let n,o;var s,l,u,v;let{id:p}=e,{json:g={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new Ii}=e,{mix:y=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:C}=e,E=R("desktop"===h);if(o=a(E,(t=>n=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");E.set(!t.matches),t.addListener((()=>{E.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function D(){}const S=new Set(w);let P=!1;g||(P=!0,Y(X(new Error('"json" prop is required')))),p||(P=!0,Y(X(new Error('"id" prop is required'))));let T=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in ar)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(g);const M=g.templates||{};T&&(P=!0,Y(T));const I={stateChange:!1},O=zi(m),J=Mi(m),N=new Map,U=new Map,B=new Map;let W=null;function q(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=U.get(t);r&&r.setValue(e)}}function H(t){const e=U.get(t);return null==e?void 0:e.getValue()}function G(t){const e=Di(t,Y);return e.vars.length?e.applyVars(U):t}function Y(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function K(t,e){x&&x({type:t,action:e})}let Q=0;function tt(t){return`${p}-${Q++}`}let et={},rt={};function it(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const i=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=ct,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}}(i.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=lt(t);r&&r.setCurrentItem(Number(e))}(i.get("id"),i.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=lt(t);r&&r.setPreviousItem(e)}(i.get("id"),i.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=lt(t);r&&r.setNextItem(e)}(i.get("id"),i.get("overflow"));break;case"set_variable":const r=i.get("name"),n=i.get("value");if(r&&null!==n){const t=U.get(r);t?t.set(n):Y(X(new Error("Cannot find variable"),{additional:{name:r}}))}else Y(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=i.get("action"),a=i.get("id");W?W.execTimerAction(a,o):Y(X(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:Y(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){Y(X(t,{additional:{url:e}}))}}async function nt(t,e){if(t){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url;if(n){const t=pt(n);if(t)if(gt(t,S)){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?(it(i),await b()):i.log_id&&(ot(i),await b())}}t.forEach((t=>{t.log_id&&K("click",t)}))}}function ot(t){null==k||k(t)}const at=new Map;function lt(t){if(at.has(t))return at.get(t);Y(X(new Error("Missing instance with id"),{additional:{id:t}}))}const ut=new Map;function dt(t){for(const e of t)U.has(e)&&t.delete(e);return t}c(Z,{logError:Y,logStat:K,hasTemplate:function(t){return t in M},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in M;){if(({json:t,templateContext:e}=dr(t,e,M,Y)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:tt,genClass:function(t){return`divkit-${tt()}`},execAction:it,execAnyActions:nt,execCustomAction:ot,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){at.has(t)?Y(X(new Error("Duplicate instance id"),{additional:{id:t}})):at.set(t,e)},unregisterInstance:function(t){at.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(rt[r]=rt[r]||0,++rt[r],et[r])return et[r];const i=`${tt()}-svg-filter`;return et=Object.assign(Object.assign({},et),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;rt[r]&&0==--rt[r]&&(et=Object.keys(et).reduce(((t,e)=>(rt[e]&&(t[e]=et[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return vr(t);const e=Di(t,Y);return e.vars.length?L(e.vars.map((t=>U.get(t)||function(t){const e=B.get(t)||R(void 0);return B.has(t)||B.set(t,e),e}(t))).filter(st),(()=>e.applyVars(U))):e.hasExpression?vr(e.applyVars(U)):vr(t)},getJsonWithVars:G,getStore:function(t){return ut.has(t)||function(t){ut.has(t)||ut.set(t,Si[t]())}(t),ut.get(t)},getVariable:function(t,e){const r=U.get(t);if(r){const i=r.getType();if(i!==e)return void Y(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return S},isDesktop:E,registerComponent:void 0,unregisterComponent:void 0}),c(St,{hasAction:()=>!1});const ct={setState(t){throw new Error("Not implemented")},getChild(t){if(vt&&vt.has(t))return vt.get(t);Y(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let vt=null;c(mt,{registerInstance(t,e){vt||(vt=new Map),vt.has(t)?Y(X(new Error("Duplicate state with id"),{additional:{id:t}})):vt.set(t,e)},unregisterInstance(t){null==vt||vt.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 ht=null===(s=null==g?void 0:g.card)||void 0===s?void 0:s.variables;Array.isArray(ht)&&ht.forEach((t=>{if(t&&t.type in er&&t.name){if(N.has(t.name))return void Y(X(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=rr(t.name,t.type,t.value);N.set(t.name,e),U.set(t.name,e)}catch(e){Y(X(e,{additional:{name:t.name}}))}}}));const ft=g.palette;ft&&ft[F].forEach((t=>{if(N.has(t.name))Y(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=rr(t.name,"color",t.color);N.set(t.name,e),U.set(t.name,e)}catch(e){Y(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)U.has(t)||U.set(t,e);O.subscribe((t=>{if(t&&!U.has(t)){const e=J.get(t);U.set(t,e);const r=B.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const yt=null===(l=null==g?void 0:g.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(yt)&&yt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void Y(X(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=_r(t.condition,{startRule:"JsonStringContents"}),n=Tr(i);if(!n.length)return void Y(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return dt(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{dt(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{L(n.map((t=>U.get(t))).filter(st),(()=>Fi(U,i))).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=G(t);e.log_id&&it(e)})),e=Boolean(i.value)):Y(X(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){Y(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else Y(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const bt=null===(u=null==g?void 0:g.card)||void 0===u?void 0:u.timers;if(bt){const t=W=new Ui({logError:Y,applyVars:G,hasVariableWithType:function(t,e){const r=U.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=U.get(t);r?r.setValue(e):Y(X(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:nt});bt.forEach((e=>t.createTimer(e)))}const _t=null===(v=null==g?void 0:g.card)||void 0===v?void 0:v.states,wt=_t&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:_t.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return d((()=>{W&&W.destroy()})),void 0===e.id&&r.id&&void 0!==p&&r.id(p),void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),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!==_&&r.customization(_),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==D&&r.getDebugVariables(D),void 0===e.setVariable&&r.setVariable&&void 0!==q&&r.setVariable(q),void 0===e.getVariable&&r.getVariable&&void 0!==H&&r.getVariable(H),void 0===e.execAction&&r.execAction&&void 0!==it&&r.execAction(it),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":Y(X(new Error("Unsupported theme"))),F&&(ft&&ft[F].forEach((t=>{const e=U.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&wt?`<div class="${j("divkit-b023c",!0)+j(n?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${z(ur,"RootSvgFilters").$$render(t,{svgFiltersMap:et},{},{})}\n ${z(lr,"Unknown").$$render(t,{div:wt,templateContext:{}},{},{})}</div>`:""})),Ri=Bi;function Li(t){return Ri.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var Wi=exports;for(var qi in e)Wi[qi]=e[qi];e.__esModule&&Object.defineProperty(Wi,"__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={};function r(){}function i(t){return t()}function n(t){t.forEach(i)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}let s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}function d(t){u().$$.on_destroy.push(t)}function c(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>Ni,createVariable:()=>ir,render:()=>qi}),new Set,new Map;const p=[],g=[],h=[],f=[],m=Promise.resolve();let y=!1;function b(){return y||(y=!0,m.then(x)),m}function _(t){h.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<p.length;){const t=p[$];$++,l(t),k(t.$$)}for(l(null),p.length=0,$=0;g.length;)g.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];w.has(e)||(w.add(e),e())}h.length=0}while(p.length);for(;f.length;)f.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(_)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const C=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),E=/[\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 F(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=N(i):r.style=N(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(E.test(t))return;const e=r[t];!0===e?i+=" "+t:C.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),i=e?A:V;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 D(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function S(t){const e={};for(const r in t)e[r]=D(t[r]);return e}function P(t,e){let r="";for(let i=0;i<t.length;i+=1)r+=e(t[i],i);return r}const T={$$render:()=>""};function z(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`);return t}let M,I;function O(t){function e(e,r,i,n,o){const a=s;l({$$:{on_destroy:M,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const u=t(e,r,i,n);return l(a),u}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,i);return n(M),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function N(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=N(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(I=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(i).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(n(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const B=[];function R(t,e=r){let i;const n=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!B.length;for(const e of n)e[1](),B.push(e,t);if(e){for(let t=0;t<B.length;t+=2)B[t][0](B[t+1]);B.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return n.add(l),1===n.size&&(i=e(o)||r),a(t),()=>{n.delete(l),0===n.size&&(i(),i=null)}}}}function L(t,e,i){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return d=t=>{let i=!1;const d=[];let c=0,v=r;const p=()=>{if(c)return;v();const i=e(s?d[0]:d,t);u?t(i):v=o(i)?i:r},g=l.map(((t,e)=>a(t,(t=>{d[e]=t,c&=~(1<<e),i&&p()}),(()=>{c|=1<<e}))));return i=!0,p(),function(){n(g),v()}},{subscribe:R(i,d).subscribe};var d}const W="divkit-bd259",q="divkit-d9099",H="divkit-c016b",G="divkit-aa145",Y="divkit-f0cba",Z=Symbol("root");function X(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const K={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_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},Q={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"};function tt(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 et(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 rt(t){let e=et(t);return"0"===e&&(e+="em"),e}function it(t,e){for(;t.length<e;)t="0"+t;return t}function nt(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const i=ot(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>it(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function ot(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,u=2===r.length?r:r+r;return{a:parseInt(u,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 at(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 st=Boolean;function lt(t){if(1===t.length&&"solid"===t[0].type)return{color:nt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=nt(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(st);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>nt(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:ct(t.bg.scale),pos:vt(t.bg),image:'url("'+at(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(st);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=rt(i.value):"relative"===i.type&&(n=ut[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${dt(t.bg.center_x)} ${dt(t.bg.center_y)},`+r.map((t=>nt(t))).join(",")+")"}}({bg:t}):void 0)).filter(st).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 ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function dt(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return rt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function ct(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function vt(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 pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function gt(t,e){return e.has(t)}function ht(t,e){e&&t.push(e)}function ft(t,e,r){const i=[];ht(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&ht(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const mt=Symbol("state");function yt(t){return et(t.top||0)+" "+et(t.right||0)+" "+et(t.bottom||0)+" "+et(t.left||0)}function bt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function _t(t){return bt(t)&&t>=0}function wt(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]&&!_t(r[t]))return e;return yt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const xt=Object.prototype.hasOwnProperty;function kt(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(!xt.call(e,n)||!kt(t[n],e[n]))return!1}return!0}function Ct(t,e){return kt(t,e)?e:t}function Et(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Ft(t,e){const r=Number(t);return isNaN(r)?e:r}function At(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...At(t))})):e.push(t),e}function Vt(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]]&&!_t(t[r[i]]))return e;return t}function jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>et((t||e)/r*10))).join(" ")}function Dt(){}const St=Symbol("action"),Pt=O(((t,e,r,i)=>{let{actions:n}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:d=Dt}=e,{customAction:p=null}=e,{isNativeActionAnimation:g=!0}=e;const h=v(Z),f=v(St);c(St,{hasAction:()=>Boolean(f.hasAction()||(null==n?void 0:n.length))});let m,y="";if(Array.isArray(n)&&(null==n?void 0:n.length))for(let t=0;t<n.length;++t){const e=n[t].url;if(e){y=e,m=n[t].target||void 0;break}}Array.isArray(n)&&(null==n?void 0:n.length)&&f.hasAction()&&(y="",h.logError(X(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:n}})));let b=Boolean(p);return y&&!gt(pt(y),h.getBuiltinProtocols())&&(y="",b=!0),void 0===e.actions&&r.actions&&void 0!==n&&r.actions(n),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),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!==g&&r.isNativeActionAnimation(g),y?`<a${F([{href:D(y)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(g?W:q,!0)+" "+j(null!=a&&a.length?Y:"",!0)},S(u)],{})}>${i.default?i.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(b?` ${g?W:q} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?Y:"",!0)},{style:D(l)},{role:D(b?"button":null)},{tabindex:D(b?0:null)},S(u)],{})}>${i.default?i.default({}):""}</span>`})),Tt=Pt,zt="divkit-b921d";function Mt(t){return bt(t)&&t>0}function It(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Mt(t.radius))return`blur(${rt(t.radius/2)})`}else e(X(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ot=O(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=v(Z);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=lt([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=It(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${U({"border-radius":a})}>${P(n,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class",zt,0)}${J("style",tt(t.style),0)}>`:`<span${J("class",zt,0)}${J("style",tt(t.style),0)}></span>`))}</span>`})),Jt=Ot,Nt=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,_,w,$,x,k,C,E,F,A,V,j,D,S,P,T,M,I,O,N,U,B,R,L,W,q,H,G,Y,K,it=r,ot=r,at=r,st=r,ut=r,dt=r,ct=r,vt=r,ht=r,bt=r,xt=r,kt=r,Dt=r,St=r,Pt=r,zt=r,Mt=r;var It,Ot,Nt,Ut,Bt,Rt;let{json:Lt={}}=e,{origJson:Wt}=e,{templateContext:qt}=e,{cls:Ht=""}=e,{style:Gt}=e,{layoutParams:Yt={}}=e,{customDescription:Zt=!1}=e,{customPaddings:Xt=!1}=e,{customActions:Kt=""}=e,{additionalPaddings:Qt=null}=e;const te={left:"start",center:"center",right:"end"},ee={top:"start",center:"center",bottom:"end",baseline:"baseline"},re=v(Z),ie=v(mt);let ne,oe,ae,se,le,ue,de,ce,ve,pe,ge,he={},fe={},me=!1,ye=1,be="transparent",_e=0,we={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},$e="",xe=null,ke="",Ce={},Ee=0,Fe=0,Ae=0,Ve=!1,je=!1,De={},Se=0,Pe=0,Te=0,ze=!1,Me=!1,Ie=1;const Oe=Yt.fakeElement?[]:Lt.transition_triggers||["state_change","visibility_change"],Je=-1!==Oe.indexOf("state_change")&&Lt.id,Ne=-1!==Oe.indexOf("visibility_change")&&Lt.id;let Ue,Be,Re,Le,We,qe,He,Ge,Ye,Ze=[],Xe=[],Ke=[],Qe=[],tr="",er=!1,rr="visible",ir=0,nr=0;void 0===e.json&&i.json&&void 0!==Lt&&i.json(Lt),void 0===e.origJson&&i.origJson&&void 0!==Wt&&i.origJson(Wt),void 0===e.templateContext&&i.templateContext&&void 0!==qt&&i.templateContext(qt),void 0===e.cls&&i.cls&&void 0!==Ht&&i.cls(Ht),void 0===e.style&&i.style&&void 0!==Gt&&i.style(Gt),void 0===e.layoutParams&&i.layoutParams&&void 0!==Yt&&i.layoutParams(Yt),void 0===e.customDescription&&i.customDescription&&void 0!==Zt&&i.customDescription(Zt),void 0===e.customPaddings&&i.customPaddings&&void 0!==Xt&&i.customPaddings(Xt),void 0===e.customActions&&i.customActions&&void 0!==Kt&&i.customActions(Kt),void 0===e.additionalPaddings&&i.additionalPaddings&&void 0!==Qt&&i.additionalPaddings(Qt),o=re.getDerivedFromVars(Lt.border),Mt(),Mt=a(o,(t=>K=t));{let t={},e={},r=!1,i="";if(K){if(K.has_shadow){const e=K.shadow;t["box-shadow"]=e?et((null===(Ot=null===(It=e.offset)||void 0===It?void 0:It.x)||void 0===Ot?void 0:Ot.value)||0)+" "+et((null===(Ut=null===(Nt=e.offset)||void 0===Nt?void 0:Nt.y)||void 0===Ut?void 0:Ut.value)||0)+" "+et(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+nt(e.color||"#000000",null!==(Rt=e.alpha)&&void 0!==Rt?Rt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(K.stroke&&(r=!0,ye=$t(K.stroke.width,ye),be=nt(K.stroke.color,1,be),e.border=`${et(ye)} solid ${be}`),K.corners_radius?(we=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!_t(r[t]))return e;return t}(K.corners_radius,we),e["border-radius"]=t["border-radius"]=jt(we)):K.corner_radius&&(_e=$t(K.corner_radius,_e),we={"top-left":_e,"top-right":_e,"bottom-right":_e,"bottom-left":_e},e["border-radius"]=t["border-radius"]=et(_e)),r&&ye&&(K.corners_radius||K.corner_radius)){let t=Object.assign({},we);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+ye/2})),i=jt(t)}}he=Ct(t,he),fe=Ct(e,fe),me=r,$e=i}s=re.getDerivedFromVars(Lt.paddings),zt(),zt=a(s,(t=>Y=t)),xe=Vt(Y&&!Xt?Y:void 0,xe),l=yt(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}(xe,Qt)),u=re.getDerivedFromVars(Lt.margins),St(),St=a(u,(t=>H=t)),ke=wt(H,ke),d=re.getDerivedFromVars(Lt.width),kt(),kt=a(d,(t=>W=t)),c=re.getDerivedFromVars(Lt.alignment_horizontal),Pt(),Pt=a(c,(t=>G=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const u=null==W?void 0:W.type;if("fixed"===u)Ee=$t(null==W?void 0:W.value,Ee),e=et(Ee);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,re.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.left)||0)+((null==H?void 0:H.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=W&&"weight"in W&&W.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==W?void 0:W.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=W;t.min_size&&_t(t.min_size.value)&&(r=et(t.min_size.value)),t.max_size&&_t(t.max_size.value)&&(i=et(t.max_size.value))}"match_parent"!==u&&u||re.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=G;n["halign-self"]="left"===t||"center"===t||"right"===t?te[t]:Yt.parentHAlign||"start"}t&&(n.width=t),ae=e,se=r,le=i,Fe=o,Ae=a,Ce=Ct(n,Ce),Ve=s,je=l}p=re.getDerivedFromVars(Lt.height),xt(),xt=a(p,(t=>L=t)),g=re.getDerivedFromVars(Lt.alignment_vertical),Dt(),Dt=a(g,(t=>q=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if("fixed"===u)Se=$t(null==L?void 0:L.value,Se),e=et(Se);else if("match_parent"!==u||!Yt.overlapParent&&Yt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||"match_parent"===u&&Yt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&_t(t.min_size.value)&&(r=et(t.min_size.value)),(null==t?void 0:t.max_size)&&_t(t.max_size.value)&&(i=et(t.max_size.value))}"match_parent"===u&&re.logError(X(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,re.logError(X(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${rt(((null==H?void 0:H.top)||0)+((null==H?void 0:H.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==L?void 0:L.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?n["valign-self"]=ee[t]:n["valign-self"]=Yt.parentVAlign||"start"}t&&(n.height=t),ue=e,de=r,ce=i,Pe=o,Te=a,De=Ct(n,De),ze=s,Me=l}var or,ar,sr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!W||"match_parent"===W.type)&&"match_parent"===(null==L?void 0:L.type),m=Yt.gridArea?`${Yt.gridArea.y+1}/${Yt.gridArea.x+1}/span ${Yt.gridArea.rowSpan}/span ${Yt.gridArea.colSpan}`:void 0,y=re.getDerivedFromVars(Lt.alpha),bt(),bt=a(y,(t=>R=t)),ar=Ie,Ie=!_t(or=R)||void 0===or||or>1?ar:Number(or),ve=1===Ie?void 0:Ie,_=re.getDerivedFromVars(Lt.accessibility),ht(),ht=a(_,(t=>B=t)),oe=void 0,B&&!Zt&&B.description&&(oe={},oe["aria-label"]=B.description),w=re.getDerivedFromVars(Lt.background),vt(),vt=a(w,(t=>U=t)),pe={},ge=!1,U&&(ge=U.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean($e),!ge)){const t=lt(U);pe["background-color"]=t.color,pe["background-image"]=t.image,pe["background-size"]=t.size,pe["background-position"]=t.position,pe["background-repeat"]="no-repeat"}Ue=void 0,Je&&Lt.transition_in&&re.isRunning("stateChange")&&(Ue=!0),Re=void 0,Je&&Lt.transition_change&&re.isRunning("stateChange")&&ie.hasTransitionChange(Lt.id)&&(Re=!0),$=re.getDerivedFromVars(Lt.action),dt(),dt=a($,(t=>O=t)),x=re.getDerivedFromVars(Lt.actions),ct(),ct=a(x,(t=>N=t)),k=re.getDerivedFromVars(Lt.doubletap_actions),ut(),ut=a(k,(t=>I=t)),C=re.getDerivedFromVars(Lt.longtap_actions),st(),st=a(C,(t=>M=t));{let t=N||O&&[O]||[],e=I||[],r=M||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],re.logError(X(new Error("Actions should be array")))),Array.isArray(e)||(e=[],re.logError(X(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],re.logError(X(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Kt&&(t=[],e=[],r=[],re.logError(X(new Error(`Cannot use action on component "${Kt}"`)))),Ze=t,Xe=e,Ke=r}E=re.getDerivedFromVars(Lt.action_animation),at(),at=a(E,(t=>T=t)),T&&(Qe=At(T),tr=Qe.map((function(t){const e=Ft(t.start_value,1),r=Ft(t.end_value,1),i=$t(t.start_delay,0),n=$t(t.duration,300),o=Et(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Le=e,We=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return qe=e,He=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return re.logError(X(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=re.getDerivedFromVars(Lt.visibility),ot(),ot=a(F,(t=>P=t));{const t=rr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,rr);t!==e&&(!er||"visible"!==rr&&"visible"!==e?rr=e:async function(t){rr=t;const e="visible"===t?"in":"out",r="in"===e?Lt.transition_in:Lt.transition_out;Ne&&r&&(await b(),"in"===e&&(Be=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,ne,e).then((()=>{"in"===e&&(Be=!1)})).catch((t=>{throw"in"===e&&(Be=!1),t})))}(e)),er||(er=!0)}if(A=Object.assign(Object.assign(Object.assign({},Ce),De),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Yt.scrollSnap,"hide-on-transition-in":Ue||Be||Re,visibility:rr,"has-action-animation":Boolean(tr),"parent-flex":Yt.parentContainerOrientation||void 0,"parent-grid":Boolean(Yt.gridArea)||void 0}),V=re.getDerivedFromVars(Lt.transform),it(),it=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};ir=Ft(t.value,ir);const e="pivot-fixed"===t.type?et(ir):`${ir}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};nr=Ft(r.value,nr),Ge=`${e} ${"pivot-fixed"===r.type?et(nr):`${nr}%`}`,Ye=`rotate(${S.rotation}deg)`}return j=Ve||ze?"100%":Fe||Pe?0:void 0,D=Object.assign(Object.assign(Object.assign(Object.assign({},Gt),pe),he),{width:ae,"min-width":se,"max-width":le,height:ue,"min-height":de,"max-height":ce||(null==Gt?void 0:Gt["max-height"]),"grid-area":m,padding:l,margin:ke,opacity:ve,transition:tr,"transform-origin":Ge,transform:Ye,"flex-grow":Fe||Pe||void 0,"flex-shrink":Ae||Te?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":Le,"--divkit-animation-opacity-end":We,"--divkit-animation-scale-start":qe,"--divkit-animation-scale-end":He}),it(),ot(),at(),st(),ut(),dt(),ct(),vt(),ht(),bt(),xt(),kt(),Dt(),St(),Pt(),zt(),Mt(),je||Me?"":`${z(Tt,"Actionable").$$render(t,{use:function(t){ne=t,Je&&Lt.transition_in&&ie.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{Ue=!1})).catch((t=>{throw Ue=!1,t})),Je&&Lt.transition_out&&ie.registerChildWithTransitionOut(Lt,qt,Lt.transition_out,t),Je&&Lt.transition_change&&ie.registerChildWithTransitionChange(Lt,qt,Lt.transition_change,t).then((()=>{Re=!1})).catch((t=>{throw Re=!1,t}));const e=Yt.fakeElement?[]:Lt.visibility_actions||Lt.visibility_action&&[Lt.visibility_action];Array.isArray(e)&&e.length&&function(t,{visibilityActions:e,rootCtx:r}){const i=e.map(((t,e)=>({index:e,action:t,visible:!1,count:0,finished:!1}))),n=e.map((t=>r.getJsonWithVars({visibility_percentage:t.visibility_percentage,visibility_duration:t.visibility_duration,log_limit:t.log_limit}))),o=[...new Set([...e.map(((t,e)=>(n[e].visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{i.forEach((e=>{const i=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&i?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=n[e.index],i=0===t.log_limit?1/0:t.log_limit||1;++e.count>=i&&(e.finished=!0);const o=r.getJsonWithVars(e.action),a=o.url;if(a){const t=pt(a);t&&!gt(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(o):o.log_id&&r.execCustomAction(o))}r.logStat("visible",o)}),n[e.index].visibility_duration||800)):i||e.timer&&clearTimeout(e.timer),e.visible=i}))}))}),{threshold:o}).observe(t)}(t,{visibilityActions:e,rootCtx:re});const r=Lt.id;r&&ie.registerChild(r);let i=null;return{destroy(){r&&ie.unregisterChild(r),i&&i.destroy()}}},cls:Ht+" "+ft("outer",Q,A),style:tt(D),actions:Ze,doubleTapActions:Xe,longTapActions:Ke,attrs:oe,isNativeActionAnimation:!Qe.length||(sr=Qe,sr.some((t=>"native"===t.name)))},{},{default:()=>`${ge?`${z(Jt,"OuterBackground").$$render(t,{background:U,radius:$e},{},{})}`:""}${n.default?n.default({}):""}${me?`<span${J("class",Q.outer__border,0)}${J("style",tt(fe),0)}></span>`:""}`})}`})),Ut=Nt,Bt={"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 Rt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Lt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Wt(t,e){return Lt(t)||e}const qt=O(((t,e,r,i)=>{let n,o,a,s,l;var u,d;let c,{text:v}=e,{rootFontSize:p}=e,{textStyles:g={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",y=12,b=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==p&&r.rootFontSize(p),void 0===e.textStyles&&r.textStyles&&void 0!==g&&r.textStyles(g),void 0===e.singleline&&r.singleline&&void 0!==h&&r.singleline(h),void 0===e.actions&&r.actions&&void 0!==f&&r.actions(f);{let t="none";(g.underline||g.strike)&&("single"===g.underline&&"single"===g.strike?t="both":"single"===g.underline?t="underline":"single"===g.strike&&(t="strike")),m=t}return y=Rt(g.font_size,y),Mt(g.line_height)&&(b=Number(g.line_height)/y),_t(g.letter_spacing)&&(_=et(g.letter_spacing)),c=Wt(g.font_weight,c),w=nt(g.text_color,1,w),n=g.top_offset?et(g.top_offset):"",o=g.background?lt([g.background]):null,$=(null===(u=g.border)||void 0===u?void 0:u.stroke)&&"transparent"!==nt(g.border.stroke.color)&&Mt(g.border.stroke.width)?{color:g.border.stroke.color,width:g.border.stroke.width}:null,a=Rt(null===(d=g.border)||void 0===d?void 0:d.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":et(10*y/p),"line-height":b,"letter-spacing":_,"font-weight":c,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${et($.width)} ${$.color}`:void 0,"border-radius":a?et(a):void 0},`${n?`<span${J("class",Bt["text-range__top-offset"],0)}${U({"margin-top":n})}></span>`:""}${z(Tt,"Actionable").$$render(t,{cls:ft("text-range",Bt,s),actions:f,style:tt(l)},{},{default:()=>`${j(v)}`})}`})),Ht=qt;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Yt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Zt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Xt=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,j,D,S,T,M,I,O,N,U,B,R,L=r,W=r,q=r,G=r,Y=r,Q=r,rt=r,it=r,ot=r,at=r,st=r,ut=r,dt=r,{json:ct={}}=e,{templateContext:vt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ht=v(Z);let mt=!1,yt="",bt=12,_t=1.25,wt=!1,$t="",xt="",kt=!1,Ct="left",Et="top",Ft="",At="",Vt=!1,jt=[],Dt=[];var St,Pt;d((()=>{Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&i.json&&void 0!==ct&&i.json(ct),void 0===e.templateContext&&i.templateContext&&void 0!==vt&&i.templateContext(vt),void 0===e.origJson&&i.origJson&&void 0!==pt&&i.origJson(pt),void 0===e.layoutParams&&i.layoutParams&&void 0!==gt&&i.layoutParams(gt),o=ht.getDerivedFromVars(ct.text),dt(),dt=a(o,(t=>R=t)),St=R,Pt=yt,yt=String(null!=St?St:"")||Pt,yt?mt=!1:(mt=!0,ht.logError(X(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(ct.ranges),W(),W=a(s,(t=>V=t)),l=ht.getDerivedFromVars(ct.images),L(),L=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:ct.font_size,letter_spacing:ct.letter_spacing,font_weight:ct.font_weight,text_color:ct.text_color,underline:ct.underline,strike:ct.strike,line_height:ct.line_height}),q(),q=a(u,(t=>j=t)),c=ht.getDerivedFromVars(ct.font_size),ut(),ut=a(c,(t=>B=t)),bt=Rt(B,bt),p=ht.getDerivedFromVars(ct.line_height),st(),st=a(p,(t=>U=t));{const t=U;Mt(t)?(_t=Number(t)/bt,wt=!0):wt=!1}g=ht.getDerivedFromVars(ct.max_lines),it(),it=a(g,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let i=Number(I);t=i*_t+"em",V||A||(e=i,r=!0)}$t=t,xt=e,kt=r}f=ht.getDerivedFromVars(ct.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),Ct=Gt(N,Ct),m=ht.getDerivedFromVars(ct.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Et=Yt(O,Et),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,b=ht.getDerivedFromVars(ct.text_color),rt(),rt=a(b,(t=>M=t)),_=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&y&&_&&(t=nt(M||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(ct.truncate),Q(),Q=a(w,(t=>T=t)),$="none"===T?"none":"",x=ht.getDerivedFromVars(ct.text_gradient),Y(),Y=a(x,(t=>S=t));{let t="";if(S){const e=lt([S]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(ct.selectable),G(),G=a(k,(t=>D=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,Vt),function(t,e,r){let i=[];if(Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),Dt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],u=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.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)),u.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=et(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=et(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":et(10*(Number(e.font_size)||12)/bt)};let a="";const s=t.image.tint_color,u=Zt(t.image.tint_mode,"source_in");if(s){const e=nt(t.image.tint_color);a=ht.addSvgFilter(e,u),Dt.push([e,u])}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)}),jt=i}(yt,V,A),C={singleline:h,multiline:kt,halign:Ct,valign:Et,truncate:$},E={gradient:Boolean(At)},F={"font-size":et(bt),"line-height":_t,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},L(),W(),q(),G(),Y(),Q(),rt(),it(),ot(),at(),st(),ut(),dt(),mt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("text",K,C)+" "+(Vt?"":H),json:ct,origJson:pt,templateContext:vt,layoutParams:gt},{},{default:()=>`<span${J("class",ft("text__inner",K,E),0)}${J("style",tt(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${z(Ht,"TextRangeView").$$render(t,{text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",tt(e.image.wrapperStyle),0)}><img${J("class",K.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",tt({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>`:""))}`:`${z(Ht,"TextRangeView").$$render(t,{text:yt,rootFontSize:bt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Kt=Xt,Qt={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_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function te(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)n=t.shape,i={width:Number((null===(o=n.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=n.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=n.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Number((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,l;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?nt(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=nt(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${et(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}function ee(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function re(t,e,r){let i;return i="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],i.map(et).join(" ")}let ie;function ne(){if(void 0!==ie)return ie;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),ie=1===t.scrollHeight,document.body.removeChild(t),ie}const oe="divkit-a7719",ae="divkit-f6e9a";function se(t,e,r,i,n,o){o?t.push({top:r.bottom,left:n.left,width:n.right-n.left,height:i.top-r.bottom,style:e}):t.push({top:n.top,left:r.right,width:i.left-r.right,height:n.bottom-n.top,style:e})}function le(t,e,r,i){const n={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)&&se(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],n,i),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)se(t,e.style,r[o],r[o+1],n,i);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];se(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},n,i)}}const ue=O(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=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();c=[];let e=[...n.children].filter((t=>t!==u&&!t.classList.contains(Q.outer__border))),r=[];for(;e.length;){const t=[],i=e.shift();t.push(i);let n=i.getBoundingClientRect(),a=n.right,s=n.bottom;for(;e.length;){let r=e[0],i=r.getBoundingClientRect();if("vertical"===o){if(i.top<s)break}else if(i.left<a)break;a=Math.max(a,i.right),s=Math.max(s,i.bottom),t.push(r),e.shift()}r.push(t)}const i=[];r.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&&le(c,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};i.push(r)})),s&&le(c,s,i,"horizontal"===o),c.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,c=[],v=!1,p=null,g=null;return d((()=>{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),n=null,(v&&n||p||g)&&(p&&(p.disconnect(),p=null),g&&(g.disconnect(),g=null),v&&n&&("undefined"!=typeof MutationObserver&&(p=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(ae))&&!(null==r?void 0:r.contains(oe))}))&&l()})),p.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(l),g.observe(n)))),v&&n&&l(),`\n\n<div${J("class",oe,0)}${J("this",u,0)}>${P(c,(t=>`<div${J("class","divkit-c770e",0)}${U({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class",ae,0)}${U({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>\n </div>`))}</div>`})),de=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,j,D=r,S=r,T=r,M=r,I=r,O=r,J=r,N=r,U=r;var B,R,L,W,q,H;let{json:G={}}=e,{templateContext:Y}=e,{origJson:K}=e,{layoutParams:Q}=e;const tt={left:"start",center:"center",right:"end"},et={top:"start",center:"center",bottom:"end",baseline:"baseline"},rt=["rounded_rectangle","circle"],it=v(Z);let nt,ot=!1,at="vertical",st="top",lt="left",ut=null,dt=null,ct={};if(void 0===e.json&&i.json&&void 0!==G&&i.json(G),void 0===e.templateContext&&i.templateContext&&void 0!==Y&&i.templateContext(Y),void 0===e.origJson&&i.origJson&&void 0!==K&&i.origJson(K),void 0===e.layoutParams&&i.layoutParams&&void 0!==Q&&i.layoutParams(Q),o=G.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,it.logError(X(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=Y;return({templateContext:r,json:e}=it.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=it.getDerivedFromVars(G.orientation),U(),U=a(l,(t=>j=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(j,at),u=it.getDerivedFromVars(G.content_alignment_vertical),N(),N=a(u,(t=>V=t)),st=Yt(V,st),d=it.getDerivedFromVars(G.content_alignment_horizontal),J(),J=a(d,(t=>A=t)),lt=Gt(A,lt),c=it.getDerivedFromVars(G.layout_mode),O(),O=a(c,(t=>F=t)),p="wrap"===F,g=it.getDerivedFromVars(G.separator),I(),I=a(g,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&ne()){const t=te(E.style,rt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(B=E.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(R=E.show_at_end)&&void 0!==R&&R),show_between:Boolean(null===(L=E.show_between)||void 0===L||L),style:t}:null}else ut=null;if(h=it.getDerivedFromVars(G.line_separator),M(),M=a(h,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&ne()){const t=te(C.style,rt,(null==dt?void 0:dt.style)||null);dt=t?{show_at_start:Boolean(null!==(W=C.show_at_start)&&void 0!==W&&W),show_at_end:Boolean(null!==(q=C.show_at_end)&&void 0!==q&&q),show_between:Boolean(null===(H=C.show_between)||void 0===H||H),style:t}:null}else dt=null;f=ut||dt?function(t,e,r){const i={};return ee(i,e,"vertical"===t),ee(i,r,"horizontal"===t),i}(at,ut,dt):null,m=it.getDerivedFromVars(G.aspect),T(),T=a(m,(t=>k=t));{const t=null==k?void 0:k.ratio;nt=t&&Mt(t)?t:void 0}y=it.getDerivedFromVars(G.width),D(),D=a(y,(t=>$=t)),b=it.getDerivedFromVars(G.height),S(),S=a(b,(t=>x=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],(!x||"wrap_content"===x.type||"match_parent"===x.type&&(null==Q?void 0:Q.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=et[st],("wrap_content"===(null==$?void 0:$.type)||"match_parent"===(null==$?void 0:$.type)&&(null==Q?void 0:Q.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),p&&(t.parentContainerWrap=!0),ct=Ct(t,ct)}return _={orientation:at,valign:st,halign:lt,wrap:p},w={gap:ut||dt?re(at,ut,dt):void 0,"aspect-ratio":nt},D(),S(),T(),M(),I(),O(),J(),N(),U(),ot?"":`${z(Ut,"Outer").$$render(t,{cls:ft("container",Qt,_),style:w,json:G,origJson:K,templateContext:Y,layoutParams:Q,additionalPaddings:f},{},{default:()=>`${P(s,(e=>`${z(ur,"Unknown").$$render(t,{layoutParams:ct,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||dt?`${z(ue,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:dt,orientation:at},{},{})}`:""}`})}`})),ce=de,ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function pe(t,e){return"vertical"===t||"horizontal"===t?t:e}const ge=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const b=v(Z);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&i.json&&void 0!==h&&i.json(h),void 0===e.templateContext&&i.templateContext&&void 0!==f&&i.templateContext(f),void 0===e.origJson&&i.origJson&&void 0!==m&&i.origJson(m),void 0===e.layoutParams&&i.layoutParams&&void 0!==y&&i.layoutParams(y),o=b.getDerivedFromVars(h.delimiter_style),g(),g=a(o,(t=>p=t)),_=pe(null==p?void 0:p.orientation,_),s=!((null==p?void 0:p.color)&&("transparent"===p.color||9===p.color.length&&0===p.color.indexOf("#00"))),w=nt(null==p?void 0:p.color,1,w),l="horizontal"===_?"100%":et(1),u="horizontal"===_?et(1):"100%",d={background:w,width:l,height:u},c={orientation:_},g(),`${z(Ut,"Outer").$$render(t,{cls:ft("separator",ve,c),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",ve.separator__inner,0)}${J("style",tt(d),0)}></span>`:""})}`})),he={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"},fe=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,j,D,S,P,T,M,I,O,N,B,R,L,W=r,q=r,H=r,G=r,Y=r,K=r,Q=r,et=r,rt=r,it=r,ot=r,st=r,lt=r,ut=r,{json:dt={}}=e,{templateContext:pt}=e,{origJson:gt}=e,{layoutParams:ht}=e;const mt=v(Z);let yt,bt=0,_t="rgba(0,0,0,0.08)",wt=!1,xt="",kt="none",Ct="50% 50%",Ft="0",At="source_in",Vt="",jt="",Dt=0,St=0,Pt=0,Tt="",zt="";d((()=>{mt.removeSvgFilter(yt,At)})),void 0===e.json&&i.json&&void 0!==dt&&i.json(dt),void 0===e.templateContext&&i.templateContext&&void 0!==pt&&i.templateContext(pt),void 0===e.origJson&&i.origJson&&void 0!==gt&&i.origJson(gt),void 0===e.layoutParams&&i.layoutParams&&void 0!==ht&&i.layoutParams(ht),o=mt.getDerivedFromVars(dt.image_url),ut(),ut=a(o,(t=>L=t)),s=mt.getDerivedFromVars(dt.gif_url),lt(),lt=a(s,(t=>R=t)),l=L||R,bt=0,l?wt=!1:(wt=!0,mt.logError(X(new Error('Missing "image_url" for "image"')))),u=mt.getDerivedFromVars(dt.width),st(),st=a(u,(t=>B=t)),c="wrap_content"===(null==B?void 0:B.type),p=mt.getDerivedFromVars(dt.height),ot(),ot=a(p,(t=>N=t)),g="wrap_content"===(null==N?void 0:N.type),h=mt.getDerivedFromVars(dt.preview),it(),it=a(h,(t=>O=t));{const t=O;xt=t?t.startsWith("data:")?`url("${at(t)}")`:`url("data:image/jpg;base64,${at(t)}")`:""}f=mt.getDerivedFromVars(dt.placeholder_color),rt(),rt=a(f,(t=>I=t)),_t=nt(I,1,_t),m=mt.getDerivedFromVars(dt.scale),et(),et=a(m,(t=>M=t)),kt=ct(M)||kt,y=mt.getDerivedFromVars({content_alignment_horizontal:dt.content_alignment_horizontal,content_alignment_vertical:dt.content_alignment_vertical}),Q(),Q=a(y,(t=>T=t)),Ct=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:vt(t)}(T,Ct),b=mt.getDerivedFromVars(dt.accessibility),K(),K=a(b,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=mt.getDerivedFromVars(dt.aspect),Y(),Y=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;Ft=t&&Mt(t)?(100/Number(t)).toFixed(2):"0"}$=mt.getDerivedFromVars(dt.tint_color),G(),G=a($,(t=>D=t)),x=mt.getDerivedFromVars(dt.tint_mode),H(),H=a(x,(t=>j=t));{const t=D,e=t?nt(t):void 0,r=Zt(j,At);e===yt&&r===At||(mt.removeSvgFilter(yt,At),Vt=e?mt.addSvgFilter(e,r):"",yt=e,At=r)}if(k=mt.getDerivedFromVars(dt.appearance_animation),q(),q=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;jt=Et(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=$t(t.duration,300),St=$t(t.start_delay,0),Dt=$t(t.alpha,0)}C=mt.getDerivedFromVars(dt.filters),W(),W=a(C,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=It(A,mt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Tt=t,zt=e}return E={aspect:"0"!==Ft,"is-width-content":c,"is-height-content":g,loaded:!1,"before-appearance":Boolean(jt)&&!0},F={"background-image":xt,"background-color":xt?void 0:_t,"background-size":kt,"clip-path":zt||void 0,"object-fit":kt,"object-position":Ct,filter:["",Tt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":jt||void 0,"--divkit-appearance-fade-start":jt?Dt:void 0,"--divkit-appearance-delay":jt?`${St}ms`:void 0,"--divkit-appearance-duration":jt?`${Pt}ms`:void 0},W(),q(),H(),G(),Y(),K(),Q(),et(),rt(),it(),ot(),st(),lt(),ut(),wt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("image",he,E),json:dt,origJson:gt,templateContext:pt,layoutParams:ht,customDescription:!0},{},{default:()=>E.aspect?`<span${J("class",he["image__aspect-wrapper"],0)}${U({"padding-bottom":`${Ft}%`})}><img${J("class",he.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",he.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",tt(F),0)}${J("alt",_,0)}${J("aria-hidden",_?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 ye(t){return t>0&&t<1}function be(t){return String(Math.ceil(1e3*t)/1e3)}function _e(t,e,r){if(t.some(ye)){const e=Math.max(...t.filter(ye).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(${et(i*t[e]/n)},${be(t[e])}fr)`:t[e]?o[e]=`${be(t[e])}fr`:o[e]="auto";return o.join(" ")}const we=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b=r,_=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:E}=e;const F=v(Z);let A,V,j=!1,D=1,S=[],T=[],M=[],I=[],O=0,J=!1,N="top",U="left";void 0===e.json&&i.json&&void 0!==x&&i.json(x),void 0===e.templateContext&&i.templateContext&&void 0!==k&&i.templateContext(k),void 0===e.origJson&&i.origJson&&void 0!==C&&i.origJson(C),void 0===e.layoutParams&&i.layoutParams&&void 0!==E&&i.layoutParams(E),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(X(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Rt(y,D),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],T=[],M=[],I=[],J=!1,V=l.map(((i,n)=>{var o,a,s,l;const u=m[n],d=Number(u.columnSpan)||1,c=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:d,rowSpan:c},p="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/d:0,g="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/c:0,h=1===d&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/d:0,f=1===c&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.type)&&u.height.value?Number(u.height.value)/c:0;for(let i=e;i<e+d;++i)for(let e=r;e<r+c;++e)t[i+"_"+e]?J=!0:(t[i+"_"+e]=!0,(!S[i]||S[i]<p)&&(S[i]=p),(!T[e]||T[e]<g)&&(T[e]=g),(!M[i]||M[i]<h)&&(M[i]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:v,fakeElement:(null==E?void 0:E.fakeElement)||!1}})})),0!==e&&(J=!0),J&&F.logError(X(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=a(u,(t=>f=t)),N=Yt(f,N),d=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=a(d,(t=>h=t)),U=Gt(h,U),c={valign:N,halign:U},p={"grid-template-columns":_e(S,M,D),"grid-template-rows":_e(T,I,O)},g=j||J,b(),_(),w(),$(),g?"":`${z(Ut,"Outer").$$render(t,{cls:ft("grid",me,c),json:x,origJson:C,templateContext:k,style:p,layoutParams:E},{},{default:()=>`${P(V,(e=>`${z(ur,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),$e=we,xe={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","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 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 Ce(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const Ee=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,D,S,T,M,I,O,N,U=r,B=r,R=r,W=r,q=r,H=r,Y=r,K=r,Q=r,rt=r,{json:it={}}=e,{templateContext:nt}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(Z);let lt,ut,dt=[],ct=null,vt=!1;st.getCustomization("galleryLeftClass"),st.getCustomization("galleryRightClass");let pt=!1;O=a(st.isDesktop,(t=>I=t));let gt,ht,mt,yt,bt=1,_t="horizontal",xt="start",kt=8,Et="",Ft=[],At={},Vt=!1,jt={},Dt=0;const St=Ce((function(){}),50);function Pt(){let t=[],e=dt[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<bt;++e){const i=dt[e].children[r];i&&t.push(i)}return t}function Tt(t,e,r="smooth"){const i="horizontal"===_t,n=i?"offsetLeft":"offsetTop",o=i?"left":"top";lt.scroll({[o]:Math.max(0,t[e][n]-kt/2),behavior:r})}function zt(t){const e=Pt(),r=lt.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===_t?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"===_t?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}!it.id||pt||(null==at?void 0:at.fakeElement)||st.registerInstance(it.id,{setCurrentItem(t){const e=Pt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Tt(e,t)},setPreviousItem(t){const e=zt("prev"),r=Pt();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Tt(r,i)},setNextItem(t){const e="horizontal"===_t?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Pt();if(e&&"ring"===t)return void Tt(r,0);const i=zt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Tt(r,n)}}),d((()=>{vt=!1,it.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(it.id)})),void 0===e.json&&i.json&&void 0!==it&&i.json(it),void 0===e.templateContext&&i.templateContext&&void 0!==nt&&i.templateContext(nt),void 0===e.origJson&&i.origJson&&void 0!==ot&&i.origJson(ot),void 0===e.layoutParams&&i.layoutParams&&void 0!==at&&i.layoutParams(at),o=it.items,(null==o?void 0:o.length)&&Array.isArray(o)?pt=!1:(pt=!0,st.logError(X(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!pt&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&vt&&!pt,l?"undefined"!=typeof ResizeObserver&&(ct=new ResizeObserver((()=>{St()})),ct.observe(ut)):ct&&(ct.disconnect(),ct=null),u=st.getDerivedFromVars(it.column_count),Q(),Q=a(u,(t=>M=t)),bt=Rt(M,bt),c=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}(s,bt),p=st.getDerivedFromVars(it.orientation),K(),K=a(p,(t=>T=t)),_t=pe(T,_t),g=st.getDerivedFromVars(it.cross_content_alignment),Y(),Y=a(g,(t=>S=t)),xt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,xt),h=st.getDerivedFromVars(it.item_spacing),H(),H=a(h,(t=>D=t)),kt=$t(D,kt),gt=et(kt),f=st.getDerivedFromVars(it.cross_spacing),q(),q=a(f,(t=>V=t)),mt=$t(V,kt),ht=et(mt),m=st.getDerivedFromVars(it.paddings),W(),W=a(m,(t=>A=t)),Et=wt(A,Et),y="horizontal"===_t?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===_t?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),yt=L(t,(t=>t)),R(),R=a(yt,(t=>F=t))}Ft=[],bt>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===_t||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")})),b=st.getDerivedFromVars(it.scroll_mode),B(),B=a(b,(t=>E=t));{const t={};let e={};Vt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===_t?e.parentVAlign=xt:e.parentHAlign=xt,"paging"===E&&(Vt=!0,e.scrollSnap="start",t["horizontal"===_t?"scroll-padding-left":"scroll-padding-top"]=et(kt/2)),1===bt&&(e.parentLayoutOrientation=_t),At=Ct(t,At),jt=Ct(e,jt)}return _=st.getDerivedFromVars(it.restrict_parent_scroll),rt(),rt=a(_,(t=>N=t)),w={padding:Et,"grid-gap":ht},$={"grid-gap":gt,[y]:ke(Ft)},x={orientation:_t,"scroll-snap":Vt},k=st.getDerivedFromVars(it.default_item),U(),U=a(k,(t=>C=t)),Dt=$t(C,Dt),U(),B(),R(),W(),q(),H(),Y(),K(),Q(),O(),rt(),"\n\n"+(pt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("gallery",xe,x),json:it,origJson:ot,templateContext:nt,layoutParams:at,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(xe.gallery__scroller,!0)+" "+j(N?G:"",!0)}"${J("style",tt(At),0)}${J("this",lt,0)}><div${J("class",xe["gallery__items-grid"],0)}${J("style",tt(w),0)}${J("this",ut,0)}>${P(c,((e,r)=>`<div${J("class",xe.gallery__items,0)}${J("style",tt($),0)}${J("this",dt[r],0)}>${P(e,(e=>`${z(ur,"Unknown").$$render(t,{layoutParams:jt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===_t?"\n ":""}`})}`)})),Fe=Ee,Ae={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"},Ve=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,_,w,$,x,k,C,E,F,A,V,D,S=r,T=r,M=r,I=r,O=r,N=r,B=r,R=r,L=r;var W;let{json:q={}}=e,{templateContext:H}=e,{origJson:Y}=e,{layoutParams:K}=e;const Q=v(Z),it=Q.genId("tabs");let ot,at,st,lt=!1,ut={};const dt=Q.getJsonWithVars(q.selected_tab);let ct,vt,pt=dt&&Number(dt)||0,gt=12,ht="",mt="",bt="",xt="",kt="",Et="",Ft="",At="",Dt=0,St="",Pt="",zt=null,It=!1,Ot=!1,Jt=pt,Nt=[],Bt=[];async function Lt(t,e=!1){if(Jt=pt,pt=t,It||(It=!0,at.style.height=et(at.clientHeight),st.style.transform=`translate3d(${100*-Jt}%,0,0)`),Ot=!0,async function(t){await b(),st.style.transform=`translate3d(${t}%,0,0)`}(100*-pt),function(t=!1){const e=t?Math.max(0,pt-1):Math.min(pt,Jt),r=t?Math.min(o.length-1,pt+1):Math.max(pt,Jt);Nt=Nt.map(((t,i)=>t||i>=e&&i<=r)),Bt=Bt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await b();const t=document.getElementById(`${it}-panel-${pt}`);t&&(at.style.height=et(t.offsetHeight))}(),Ht&&clearTimeout(Ht),Ht=window.setTimeout((()=>{Bt=o.map(((t,e)=>e===pt))}),400),qt=-pt*at.clientWidth,e){await b();const t=ot.querySelector(`.${Ae.tabs__item_selected}`);t&&t.focus()}}let qt,Ht=null;!q.id||lt||(null==K?void 0:K.fakeElement)||Q.registerInstance(q.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Lt(t)},setPreviousItem(t){let e=pt-1;e<0&&(e="ring"===t?o.length-1:pt),Lt(e)},setNextItem(t){let e=pt+1;e>o.length-1&&(e="ring"===t?0:pt),Lt(e)}}),d((()=>{q.id&&!(null==K?void 0:K.fakeElement)&&Q.unregisterInstance(q.id)})),void 0===e.json&&i.json&&void 0!==q&&i.json(q),void 0===e.templateContext&&i.templateContext&&void 0!==H&&i.templateContext(H),void 0===e.origJson&&i.origJson&&void 0!==Y&&i.origJson(Y),void 0===e.layoutParams&&i.layoutParams&&void 0!==K&&i.layoutParams(K),o=q.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?lt=!1:(lt=!0,Q.logError(X(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=Q.getDerivedFromVars(q.width),R(),R=a(s,(t=>V=t)),l=Q.getDerivedFromVars(q.height),B(),B=a(l,(t=>A=t));{let t={};(null==K?void 0:K.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==V?void 0:V.type)&&(t.parentHorizontalWrapContent=!0),A&&"wrap_content"!==A.type||(t.parentVerticalWrapContent=!0),ut=Ct(t,ut)}if(!lt&&(pt<0||pt>=o.length)&&(Q.logError(X(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:q.selected_tab,length:o.length}})),pt=pt<0?0:o.length-1),u=Q.getDerivedFromVars(q.tab_title_style),N(),N=a(u,(t=>F=t)),c=F||{},gt=Rt(c.font_size,gt),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/gt*10,right:(Number(t.right)||0)/gt*10,bottom:(Number(t.bottom)||0)/gt*10,left:(Number(t.left)||0)/gt*10};ht=wt(e,ht)}{const t=c.line_height;void 0!==t&&Mt(t)&&(mt=et(t/gt*10))}{const t=c.letter_spacing;void 0!==t&&_t(t)&&(bt=et(t/gt*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(W=c.corner_radius)&&void 0!==W?W:1e3;c.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]&&!_t(n[t]))return i;return jt(t,e,r)}(c.corners_radius,t,gt,xt):_t(t)&&(xt=et(t/gt*10))}return ct=Wt(c.active_font_weight||c.font_weight,ct),vt=Wt(c.inactive_font_weight||c.font_weight,vt),kt=nt(c.active_text_color,1,kt),Et=nt(c.inactive_text_color,1,Et),Ft=nt(c.active_background_color,1,Ft),At=nt(c.inactive_background_color,1,At),Dt=$t(c.item_spacing,Dt),p=Q.getDerivedFromVars(q.has_separator),O(),O=a(p,(t=>E=t)),g=Q.getDerivedFromVars(q.separator_color),I(),I=a(g,(t=>C=t)),h=Q.getDerivedFromVars(q.separator_paddings),M(),M=a(h,(t=>k=t)),E&&(C&&(St=nt(C,1,St)),k&&(Pt=wt(k,Pt))),f={background:St,margin:Pt},m=Q.getDerivedFromVars(q.switch_tabs_by_content_swipe_enabled),T(),T=a(m,(t=>x=t)),y=void 0===x||Boolean(x),_=Q.getDerivedFromVars(q.restrict_parent_scroll),L(),L=a(_,(t=>D=t)),w=Q.getDerivedFromVars(q.title_paddings),S(),S=a(w,(t=>$=t)),zt=Vt($||void 0,zt),lt||(Nt=o.map(((t,e)=>e===pt)),Bt=o.map(((t,e)=>e===pt))),S(),T(),M(),I(),O(),N(),B(),R(),L(),lt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("tabs",Ae,{}),json:q,origJson:Y,templateContext:H,layoutParams:K,customActions:"tabs"},{},{default:()=>`<div class="${j(Ae.tabs__list,!0)+" "+j(D?G:"",!0)}" role="tablist"${U({"--divkit-tabs-title-padding":zt?yt(zt):"","--divkit-tabs-font-size":et(gt),"--divkit-tabs-paddings":ht,"--divkit-tabs-line-height":mt,"--divkit-tabs-letter-spacing":bt,"--divkit-tabs-active-font-weight":ct||"","--divkit-tabs-inactive-font-weight":vt||"","--divkit-tabs-active-text-color":kt,"--divkit-tabs-inactive-text-color":Et,"--divkit-tabs-active-background-color":Ft,"--divkit-tabs-inactive-background-color":At,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":Dt?rt(Dt):""})}${J("this",ot,0)}>${P(o,((e,r)=>{let i=r===pt;return`\n\n ${z(Tt,"Actionable").$$render(t,{cls:ft("tabs__item",Ae,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=K&&K.fakeElement?[]:[e.title_click_action],attrs:{id:`${it}-tab-${r}`,"aria-controls":`${it}-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 pt===e||(Lt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${E?`<div${J("class",Ae.tabs__separator,0)}${J("style",tt(f),0)}></div>`:""}\n <div class="${j(Ae.tabs__panels,!0)+" "+j(D?G:"",!0)}"${J("this",at,0)}><div${J("class",ft("tabs__swiper",Ae,{inited:It,animated:Ot}),0)}${J("this",st,0)}>${P(o,((e,r)=>`<div${J("class",ft("tabs__panel",Ae,{visible:Bt[r]}),0)} role="tabpanel" id="${j(it,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(it,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Nt[r]?`${z(ur,"Unknown").$$render(t,{div:e.div,templateContext:H,layoutParams:ut},{},{})}`:""}\n </div>`))}</div></div>`})}`})),je=Ve,De="divkit-eb860",Se="divkit-e08c6";function Pe(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)}}Pe([.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]),Pe([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 Te=O(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(Z),p=v(mt);let g=new Map,h=new Set,f=!1,m=null,y=[],_=[],w=[],$=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(p.registerInstance(x,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{g.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=n.find((e=>e.state_id===t))||null;e?(k=t,C=e):u.logError(X(new Error("Cannot find state with id"),{additional:{stateId:t}})),await b()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(X(new Error("Missing state block with id"),{additional:{id:t}}))}}),c(mt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(X(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),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 $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&g.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(X(new Error('Missing "id" prop for div "state"'))));let C=null;const E=u.getJsonWithVars(o.default_state_id);let F=!1;return d((()=>{x&&!(null==l?void 0:l.fakeElement)&&p.unregisterInstance(x)})),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)?f=!1:(f=!0,u.logError(X(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(E?(k=E,C=t.find((t=>t.state_id===k))||null,C||u.logError(X(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(C=t[0],k=C.state_id)))}(n),f?"":`${z(Ut,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=C)&&void 0!==e&&e.div?`${z(ur,"Unknown").$$render(t,{div:C.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${P(y,(e=>"direction"in e?`<div${J("class",De,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${J("class",Se,0)}>${z(ur,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class",De,0)}><div${J("class",Se,0)}>${z(ur,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),ze={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Me=O(((t,e,i,n)=>{let o,s,l,u,c,p,g,h,f,m,y,b,_,w,$,x,k,C=r,E=r,F=r,A=r,V=r,D=r;var S,T,M,I,O,N,U;let{json:B={}}=e,{templateContext:R}=e,{origJson:L}=e,{layoutParams:W}=e;const q=v(Z),H=q.genId("pager");let Y,K=!1,Q=!1,it=0,nt=0,ot=!1,at="horizontal",st="",lt="",ut="";function dt(t,e="smooth"){const r="horizontal"===at,i=Y.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Y.scroll({[o]:i[n],behavior:e}),it=t}Ce((function(){if(!K)return;const t=function(){const t=Array.from(Y.children),e=Y.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===at?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:it}();t!==it&&(it=t)}),50),B.id&&!(null==W?void 0:W.fakeElement)&&q.registerInstance(B.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');dt(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),dt(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),dt(e)}}),d((()=>{K=!1,B.id&&!(null==W?void 0:W.fakeElement)&&q.unregisterInstance(B.id)})),void 0===e.json&&i.json&&void 0!==B&&i.json(B),void 0===e.templateContext&&i.templateContext&&void 0!==R&&i.templateContext(R),void 0===e.origJson&&i.origJson&&void 0!==L&&i.origJson(L),void 0===e.layoutParams&&i.layoutParams&&void 0!==W&&i.layoutParams(W),(null===(S=B.items)||void 0===S?void 0:S.length)&&Array.isArray(B.items)?Q=!1:(Q=!0,q.logError(X(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!Q&&B.items||[]).map((t=>{let e=t,r=R;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=q.getDerivedFromVars(B.layout_mode),E(),E=a(s,(t=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(ot=!0,q.logError(X(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):ot=!1:(ot=!0,q.logError(X(new Error('Empty "layout_mode" prop for div "pager"')))),l=q.getDerivedFromVars(B.orientation),V(),V=a(l,(t=>x=t)),at=pe(x,at),u=q.getDerivedFromVars(B.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&_t(t)&&(st=et(t||0))}if(c=q.getDerivedFromVars(B.paddings),F(),F=a(c,(t=>w=t)),lt=wt(w,lt),p=q.getDerivedFromVars(B.restrict_parent_scroll),D(),D=a(p,(t=>k=t)),g="horizontal"===at?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=rt("horizontal"===at?((null===(T=B.paddings)||void 0===T?void 0:T.left)||0)+((null===(M=B.paddings)||void 0===M?void 0:M.right)||0):((null===(I=B.paddings)||void 0===I?void 0:I.top)||0)+((null===(O=B.paddings)||void 0===O?void 0:O.bottom)||0)),e=null===(N=_.neighbour_page_width)||void 0===N?void 0:N.value;ut=e?`calc(100% + ${t} - 2 * ${rt(e)} - 2 * ${st})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(U=_.page_width)||void 0===U?void 0:U.value;ut=`${Number(t)}%`}return h={"grid-gap":st,padding:lt,[g]:ut},f={orientation:at},m=Q||ot,y=q.getStore("pagers"),C(),C=a(y,(t=>b=t)),function(t,e){const r=B.id;if(r){const o=new Map(b);i=y,b=o.set(r,{instId:H,size:t,currentItem:e,scrollToPagerItem:dt}),n=b,i.set(n)}var i,n}(o.length,it),function(t){var e;if(t===nt)return;nt=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(it),C(),E(),F(),A(),V(),D(),m?"":`${z(Ut,"Outer").$$render(t,{cls:ft("pager",ze,f),json:B,origJson:L,templateContext:R,layoutParams:W,customPaddings:!0},{},{default:()=>`<div class="${j(ze.pager__items,!0)+" "+j(k?G:"",!0)}"${J("style",tt(h),0)}${J("this",Y,0)}>${P(o,(e=>`<div${J("class",ze.pager__item,0)}>${z(ur,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=W&&W.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ie=Me,Oe={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"},Je=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,_,w,$,x,k,C,E,F=r,A=r,V=r,D=r,S=r,T=r,M=r,I=r,O=r;var N,B;let{json:R={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=["rounded_rectangle","circle"],Y=v(Z);let X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},Q={width:10,height:10,borderRadius:5,background:"#33919cb5"},tt="default",rt=15,it=10,ot=5;if(void 0===e.json&&i.json&&void 0!==R&&i.json(R),void 0===e.templateContext&&i.templateContext&&void 0!==L&&i.templateContext(L),void 0===e.origJson&&i.origJson&&void 0!==q&&i.origJson(q),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.layoutParams(H),o=Y.getDerivedFromVars(R.shape),T(),T=a(o,(t=>x=t)),s=Y.getDerivedFromVars(R.active_item_color),D(),D=a(s,(t=>w=t)),l=Y.getDerivedFromVars(R.inactive_item_color),S(),S=a(l,(t=>$=t)),u=Y.getDerivedFromVars(R.active_item_size),M(),M=a(u,(t=>k=t)),d=Y.getDerivedFromVars(R.active_shape),O(),O=a(d,(t=>E=t)),c=Y.getDerivedFromVars(R.inactive_shape),I(),I=a(c,(t=>C=t)),E&&(K=te({type:"shape_drawable",shape:E},G,K)),C&&(Q=te({type:"shape_drawable",shape:C},G,Q)),!E&&!C&&x){const t=Rt(k,1.3);Q=te({type:"shape_drawable",shape:x,color:Q.background},G,Q),Q.background=nt($,1,Q.background),K=Object.assign(Object.assign({},Q),{width:Q.width*t,height:Q.height*t,borderRadius:Q.borderRadius*t,background:K.background}),K.background=nt(w,1,K.background)}if(p=Y.getDerivedFromVars(R.space_between_centers),A(),A=a(p,(t=>y=t)),g=Y.getDerivedFromVars(R.items_placement),V(),V=a(g,(t=>_=t)),!_||"default"!==_.type&&"stretch"!==_.type)tt="default",y&&(rt=$t(y.value,rt));else if(tt=_.type,"default"===tt)rt=$t(null===(N=_.space_between_centers)||void 0===N?void 0:N.value,rt);else if("stretch"===tt){const t=_;it=Rt(t.max_visible_items,it),ot=$t(null===(B=t.item_spacing)||void 0===B?void 0:B.value,ot)}return h=Y.getStore("pagers"),F(),F=a(h,(t=>m=t)),async function(t){R.pager_id&&t.has(R.pager_id)&&(X=t.get(R.pager_id),await b())}(m),f={placement:tt},F(),A(),V(),D(),S(),T(),M(),I(),O(),`${z(Ut,"Outer").$$render(t,{cls:ft("indicator",Oe,f),json:R,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<div${J("class",Oe.indicator__scroller,0)}${J("this",undefined,0)}><div${J("class",Oe.indicator__items,0)} role="tablist"${U({margin:"default"===tt?`0 ${et(Math.max(0,K.width-Q.width)/2)}`:"","--divkit-indicator-inactive-width":et(Q.width),"--divkit-indicator-inactive-height":et(Q.height),"--divkit-indicator-inactive-border-radius":et(Q.borderRadius),"--divkit-indicator-inactive-background":Q.background||"","--divkit-indicator-inactive-box-shadow":Q.boxShadow||"","--divkit-indicator-active-width":et(K.width),"--divkit-indicator-active-height":et(K.height),"--divkit-indicator-active-border-radius":et(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/Q.width,"--divkit-indicator-default-margin":"default"===tt?`0 ${et((rt-Q.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===tt?et(ot):"","--divkit-indicator-stretch-max-count":"stretch"===tt?it:"","--divkit-indicator-stretch-max-spacer":"stretch"===tt?et((it-1)*ot):""})}${J("this",undefined,0)}>${X?`${P(Array(X.size),((t,e)=>{let r=e===X.currentItem;return`\n <div class="${j(ft("indicator__item",Oe,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(X.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(X.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ne=Je,Ue={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 Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&nt(t.text_color)||"#000",n=Lt(t.font_weight);if(Mt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:et(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 Re(t,e,r){return Math.max(e,Math.min(r,t))}const Le=2147483647,We=-2147483648,qe=Number.MAX_VALUE,He=Number.MIN_VALUE,Ge="string",Ye="integer",Ze="number",Xe="boolean",Ke="color",Qe="url",tr="datetime";class er{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=R(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 rr={string:class extends er{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends er{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 er{convertValue(t){if("number"!=typeof t||isNaN(t)||t>Le||t<We||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends er{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 er{convertValue(t){if("string"!=typeof t||!ot(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends er{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function ir(t,e,r){if(!(e in rr))throw new Error("Unsupported variable type");return new rr[e](t,r)}function nr(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const or=O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,D,S,T,M,I,O,N,B,R,L,W,q,H,G=r,Y=r,K=r,Q=r,tt=r,it=r,nt=r,ot=r,at=r,st=r,lt=r,ut=r;var dt,ct,vt,pt;let{json:gt={}}=e,{templateContext:ht}=e,{origJson:mt}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],$t=["rounded_rectangle"],xt=v(Z),kt=v(St);let Ct=0,Et=100;const At=xt.getJsonWithVars(gt.thumb_value_variable),Vt=xt.getJsonWithVars(gt.thumb_secondary_value_variable);W=a(At&&xt.getVariable(At,"integer")||ir("temp","integer",0),(t=>L=t)),R=a(Vt&&xt.getVariable(Vt,"integer")||ir("temp","integer",0),(t=>B=t));let jt,Dt,Pt,Tt=Re(L||0,Ct,Et),zt=Re(B||0,Ct,Et),Mt=bt,It=Mt,Ot=bt,Jt=bt,Nt=null,Bt=null,Rt=Pt,Lt="",Wt="",qt=!1;Ce((function(){}),50),void 0===e.json&&i.json&&void 0!==gt&&i.json(gt),void 0===e.templateContext&&i.templateContext&&void 0!==ht&&i.templateContext(ht),void 0===e.origJson&&i.origJson&&void 0!==mt&&i.origJson(mt),void 0===e.layoutParams&&i.layoutParams&&void 0!==yt&&i.layoutParams(yt),o=xt.getDerivedFromVars(gt.min_value),ut(),ut=a(o,(t=>H=t)),s=xt.getDerivedFromVars(gt.max_value),lt(),lt=a(s,(t=>q=t)),Ct=Ft(H,Ct),Et=Ft(q,Et);{const t=Re(L||0,Ct,Et);t!==Tt&&(Tt=t)}{const t=Re(B||0,Ct,Et);t!==zt&&(zt=t)}l=xt.getDerivedFromVars(gt.thumb_style),st(),st=a(l,(t=>N=t)),Mt=te(N,wt,Mt),u=xt.getDerivedFromVars(gt.thumb_secondary_style),at(),at=a(u,(t=>O=t)),It=te(O,wt,Mt),d=xt.getDerivedFromVars(gt.track_inactive_style),ot(),ot=a(d,(t=>I=t)),Ot=te(I,$t,Ot),c=xt.getDerivedFromVars(gt.track_active_style),nt(),nt=a(c,(t=>M=t)),Jt=te(M,$t,Jt),p=xt.getDerivedFromVars(gt.tick_mark_active_style),it(),it=a(p,(t=>T=t));{let t=te(T,wt,bt);t!==bt&&(Nt=t)}jt=Nt?Vt?nr(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Et,!0):nr(Ct,Tt,Ct,Et,!0):[],g=xt.getDerivedFromVars(gt.tick_mark_inactive_style),tt(),tt=a(g,(t=>S=t));{let t=te(S,wt,bt);t!==bt&&(Bt=t)}Dt=Bt?Vt?nr(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Et,!1):nr(Tt+1,Et+1,Ct,Et,!0):[],h=xt.getDerivedFromVars(gt.thumb_text_style),Q(),Q=a(h,(t=>D=t)),Pt=Be(D,Pt),f=xt.getDerivedFromVars(gt.thumb_secondary_text_style),K(),K=a(f,(t=>V=t)),Rt=Be(V,Pt),m=xt.getDerivedFromVars(gt.accessibility),Y(),Y=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:xt.logError(X(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=xt.getDerivedFromVars(gt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Vt&&xt.logError(X(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(X(new Error('Cannot show "slider" inside component with action'))),t=!0):Mt===bt?(xt.logError(X(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===bt?(xt.logError(X(new Error('Missing "track_active_style" in slider'))),t=!0):Ot===bt&&(xt.logError(X(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return b=et(Math.max(...[Mt.width,It.width,0].filter(_t))),_=et(Math.max(...[Mt.height,It.height,0].filter(_t))),w=(Tt-Ct)/(Et-Ct),$=Vt?(zt-Ct)/(Et-Ct):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,C={"--divkit-slider-thumb-width":et(Mt.width),"--divkit-slider-thumb-height":et(Mt.height),"--divkit-slider-thumb-secondary-width":et(It.width),"--divkit-slider-thumb-secondary-height":et(It.height),"--divkit-slider-text-offset-x":(null===(dt=null==Pt?void 0:Pt.offset)||void 0===dt?void 0:dt.x)?rt(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.y)?rt(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Rt?void 0:Rt.offset)||void 0===vt?void 0:vt.x)?rt(Rt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Rt?void 0:Rt.offset)||void 0===pt?void 0:pt.y)?rt(Rt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?et(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?et(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?et(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?et(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?et(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?et(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},E={},G(),Y(),K(),Q(),tt(),it(),nt(),ot(),at(),st(),R(),W(),lt(),ut(),"\n\n"+(qt?"":`${z(Ut,"Outer").$$render(t,{cls:ft("slider",Ue,E),style:C,customDescription:!0,customActions:"slider",json:gt,origJson:mt,templateContext:ht,layoutParams:yt},{},{default:()=>{var t,e,r,i,n,o;return`<div${J("class",Ue["slider__tracks-wrapper"],0)}><div${J("class",Ue["slider__tracks-inner"],0)}${J("this",undefined,0)}><div${J("class",Ue.slider__track,0)}${U({height:et(Ot.height),"border-radius":et(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}></div>\n <div${J("class",Ue["slider__active-track"],0)}${U({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:et(Jt.height),"border-radius":et(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${P(jt,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(Dt,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ue.slider__thumb,0)}${U({"border-radius":et(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Pt?`<div${J("class",Ue["slider__thumb-text"],0)}><div${J("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Pt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Pt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Pt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Tt)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Ue.slider__thumb,!0)+" "+j(Ue.slider__thumb_secondary,!0)}"${U({"border-radius":et(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Rt?`<div class="${j(Ue["slider__thumb-text"],!0)+" "+j(Ue["slider__thumb-text_secondary"],!0)}"><div${J("class",Ue["slider__thumb-text-inner"],0)}${U({"font-size":(null===(i=Rt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(n=Rt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Rt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ue.slider__input,0)}${J("min",Ct,0)}${J("max",Et,0)} step="1"${J("value",Tt,0)}${J("aria-label",Lt,0)}>\n ${Vt?`<input type="range"${J("class",`${Ue.slider__input} ${Ue.slider__input_secondary}`,0)}${J("min",Ct,0)}${J("max",Et,0)} step="1"${J("value",zt,0)}${J("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),ar={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"},sr={text:Kt,container:ce,separator:ge,image:fe,gif:fe,grid:$e,gallery:Fe,tabs:je,state:Te,pager:Ie,indicator:Ne,slider:or,input:O(((t,e,i,n)=>{let o,s,l,u,d,c,p,g,h,f,m,y,b,_,w,$,x,k,C,E,F,A,V,D,S,P,T,M,I,O,N,U,B=r,R=r,{json:L={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Z);let Y;const K=G.getJsonWithVars(L.text_variable);let Q=!1;K||(Q=!0,G.logError(X(new Error('Missing "text_variable" in "input"')))),O=a(K&&G.getVariable(K,"string")||ir("temp","string",""),(t=>I=t));let tt="";M=a(G.getDerivedFromVars(L.hint_text),(t=>T=t)),P=a(G.getDerivedFromVars(L.hint_color),(t=>S=t));let it="";D=a(G.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(G.getDerivedFromVars(L.font_weight),(t=>F=t)),E=a(G.getDerivedFromVars(L.line_height),(t=>C=t)),k=a(G.getDerivedFromVars(L.letter_spacing),(t=>x=t));let lt="";$=a(G.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";_=a(G.getDerivedFromVars(L.highlight_color),(t=>b=t));let dt="";y=a(G.getDerivedFromVars(L.keyboard_type),(t=>m=t));const ct={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",pt="text";f=a(G.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let gt="",ht="";U=a(G.getDerivedFromVars(L.select_all_on_focus),(t=>N=t)),void 0===e.json&&i.json&&void 0!==L&&i.json(L),void 0===e.templateContext&&i.templateContext&&void 0!==W&&i.templateContext(W),void 0===e.origJson&&i.origJson&&void 0!==q&&i.origJson(q),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.layoutParams(H),tt=I,o=T,it=nt(S,1,it),st=Rt(V,st),ot=Wt(F,ot);{const t=C;Mt(t)&&(at=t/st)}return bt(x)&&(lt=et(x/st*10)),ut=nt(w,1,ut),dt=nt(b,1,dt),m&&m in ct&&(pt=ct[m],vt=m),s="multi_line_text"===vt,l=G.getDerivedFromVars(L.paddings),R(),R=a(l,(t=>g=t)),Mt(h)&&(gt=`calc(${h*(at||1.25)+"em"} + ${rt($t(null==g?void 0:g.top,0)+$t(null==g?void 0:g.bottom,0))})`),u=G.getDerivedFromVars(L.accessibility),B(),B=a(u,(t=>p=t)),(null==p?void 0:p.description)?ht=p.description:G.logError(X(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(dt),"vertical-overflow":!1,multiline:s},c={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":dt,"font-size":et(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":gt},B(),R(),f(),y(),_(),$(),k(),E(),A(),D(),P(),M(),O(),U(),Q?"":`${z(Ut,"Outer").$$render(t,{cls:ft("input",ar,d),style:c,customDescription:!0,customActions:"input",json:L,origJson:q,templateContext:W,layoutParams:H},{},{default:()=>`<span${J("class",ar.input__wrapper,0)}><span${J("class",ar.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${j(tt)}${tt.endsWith("\n")||!tt?"":""}</span>\n ${s?`<textarea${J("class",ar.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("this",Y,0)}>${j(tt,!0)}</textarea>`:`<input${J("type",pt,0)}${J("class",ar.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",ht,0)}${J("placeholder",o,0)}${J("value",tt,0)}${J("this",Y,0)}>`}</span>`})}`}))},lr=O(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(Z);let u,d,c;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),u=n,d=o,c=u&&sr[u.type]||void 0,!c&&(({templateContext:d,json:u}=l.processTemplate(u,d)),c=u&&sr[u.type]||void 0,!c)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(X(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return c?`${z(c||T,"svelte:component").$$render(t,{json:u,templateContext:d,layoutParams:s,origJson:a||n},{},{})}`:""})),ur=lr,dr=O(((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${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",n[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("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"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function cr(t,e,r,i){const n=r[t.type];if(!n)return i(X(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 e(r,n){const o=Object.keys(n).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const i=n[t];"object"==typeof i&&null!==i?(r[t]=Array.isArray(i)?[]:{},e(r[t],i)):r[t]=i})),l.forEach((e=>{const o=n[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else i(X(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function vr(){}function pr(t){return{subscribe:e=>(e(t),vr)}}function gr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function hr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function fr(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 mr(t){var e=parseInt(t,10);if(e>Le||e<We)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function yr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function br(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,br.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function _r(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function wr(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==i;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",d="\\",c="||",v="&&",p="==",g="!=",h=">=",f="<=",m="+",y="-",b="true",_="false",w=/^[^}]/,$=/^[^'}]/,x=/^[0-9]/,k=/^[a-zA-Z_0-9.]/,C=/^[a-zA-Z_]/,E=/^[ \t\r\n]/,F=xt("@{",!1),A=xt("}",!1),V=xt("@{}",!1),j=xt("\\",!1),D={type:"any"},S=kt(["}"],!0,!1),P=xt("?",!1),T=xt(":",!1),z=xt("||",!1),M=xt("&&",!1),I=xt("==",!1),O=xt("!=",!1),J=xt(">=",!1),N=xt(">",!1),U=xt("<=",!1),B=xt("<",!1),R=xt("+",!1),L=xt("-",!1),W=xt("/",!1),q=xt("*",!1),H=xt("%",!1),G=xt("!",!1),Y=xt("(",!1),Z=xt(")",!1),X=xt(",",!1),K=Ct("string"),Q=xt("'",!1),tt=kt(["'","}"],!0,!1),et=Ct("integer"),rt=kt([["0","9"]],!1,!1),it=Ct("number"),nt=xt(".",!1),ot=xt("e",!1),at=xt("E",!1),st=Ct("boolean"),lt=xt("true",!1),ut=xt("false",!1),dt=kt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),ct=Ct("identifier"),vt=kt([["a","z"],["A","Z"],"_"],!1,!1),pt=Ct("whitespace"),gt=kt([" ","\t","\r","\n"],!1,!1),ht=function(t){return fr(t)},ft=0,mt=0,yt=[{line:1,column:1}],bt=0,_t=[],wt=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 $t(){return t.substring(mt,ft)}function xt(t,e){return{type:"literal",text:t,ignoreCase:e}}function kt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ct(t){return{type:"other",description:t}}function Et(e){var r,i=yt[e];if(i)return i;for(r=e-1;!yt[r];)r--;for(i={line:(i=yt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return yt[e]=i,i}function Ft(t,e){var r=Et(t),i=Et(e);return{source:n,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:i.line,column:i.column}}}function At(t){ft<bt||(ft>bt&&(bt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Rt(),(e=Dt())!==i?(Rt(),mt=t,t=e):(ft=t,t=i),t}function jt(){var e,r,n,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i?(n=Rt(),(o=Dt())!==i?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=i,0===wt&&At(A)),a!==i?(mt=e,e=o):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=i,0===wt&&At(V)),r!==i&&(mt=e,r=""),(e=r)===i&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(n=d,ft++):(n=i,0===wt&&At(j)),n===i&&(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F))),wt--,n===i?r=void 0:(ft=r,r=i),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=$t()):(ft=e,e=i)):(ft=e,e=i),e===i))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i){if(n=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(S)),o!==i)for(;o!==i;)n.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(S));else n=i;n!==i?(125===t.charCodeAt(ft)?(o=l,ft++):(o=i,0===wt&&At(A)),o!==i?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=i)):(ft=e,e=i)}else ft=e,e=i;e===i&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)),n!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=yr(n)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,n,o,a,s;return e=ft,(r=St())!==i?(Rt(),63===t.charCodeAt(ft)?(n="?",ft++):(n=i,0===wt&&At(P)),n!==i?(Rt(),(o=Dt())!==i?(Rt(),58===t.charCodeAt(ft)?(a=":",ft++):(a=i,0===wt&&At(T)),a!==i?(Rt(),(s=Dt())!==i?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=St()),e}function St(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Pt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===c?(s=c,ft+=2):(s=i,0===wt&&At(z)),s!==i?(l=Rt(),(u=Pt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===c?(s=c,ft+=2):(s=i,0===wt&&At(z)),s!==i?(l=Rt(),(u=Pt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=hr(r,n)}else ft=e,e=i;return e}function Pt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Tt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=i,0===wt&&At(M)),s!==i?(l=Rt(),(u=Tt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=i,0===wt&&At(M)),s!==i?(l=Rt(),(u=Tt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=hr(r,n)}else ft=e,e=i;return e}function Tt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=zt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===p?(s=p,ft+=2):(s=i,0===wt&&At(I)),s===i&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=i,0===wt&&At(O))),s!==i?(l=Rt(),(u=zt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===p?(s=p,ft+=2):(s=i,0===wt&&At(I)),s===i&&(t.substr(ft,2)===g?(s=g,ft+=2):(s=i,0===wt&&At(O))),s!==i?(l=Rt(),(u=zt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=gr(r,n)}else ft=e,e=i;return e}function zt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Mt())!==i){for(n=[],o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=i,0===wt&&At(J)),s===i&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=i,0===wt&&At(N)),s===i&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=i,0===wt&&At(U)),s===i&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=i,0===wt&&At(B))))),s!==i?(l=Rt(),(u=Mt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=i,0===wt&&At(J)),s===i&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=i,0===wt&&At(N)),s===i&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=i,0===wt&&At(U)),s===i&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=i,0===wt&&At(B))))),s!==i?(l=Rt(),(u=Mt())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=gr(r,n)}else ft=e,e=i;return e}function Mt(){var e,r,n,o,a,s,l,u;if(e=ft,(r=It())!==i){for(n=[],o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=i,0===wt&&At(R)),s===i&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=i,0===wt&&At(L))),s!==i?(l=Rt(),(u=It())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=i,0===wt&&At(R)),s===i&&(45===t.charCodeAt(ft)?(s=y,ft++):(s=i,0===wt&&At(L))),s!==i?(l=Rt(),(u=It())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=gr(r,n)}else ft=e,e=i;return e}function It(){var e,r,n,o,a,s,l,u;if(e=ft,(r=Ot())!==i){for(n=[],o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=i,0===wt&&At(W)),s===i&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=i,0===wt&&At(q)),s===i&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=i,0===wt&&At(H)))),s!==i?(l=Rt(),(u=Ot())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=i,0===wt&&At(W)),s===i&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=i,0===wt&&At(q)),s===i&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=i,0===wt&&At(H)))),s!==i?(l=Rt(),(u=Ot())!==i?o=a=[a,s,l,u]:(ft=o,o=i)):(ft=o,o=i);mt=e,e=gr(r,n)}else ft=e,e=i;return e}function Ot(){var e,r,n;return(e=Ut())===i&&(e=Nt())===i&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=i,0===wt&&At(G)),r===i&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=i,0===wt&&At(R)),r===i&&(45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)))),r!==i?(Rt(),(n=Ot())!==i?(mt=e,e={type:"UnaryExpression",operator:r,argument:n}):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=ft,(r=Bt())!==i?(Rt(),40===t.charCodeAt(ft)?(n="(",ft++):(n=i,0===wt&&At(Y)),n!==i?(Rt(),o=function(){var e,r,n,o,a,s,l;if(e=ft,(r=Dt())!==i){for(n=[],o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=i,0===wt&&At(X)),a!==i?(Rt(),(s=Dt())!==i?o=s:(ft=o,o=i)):(ft=o,o=i);o!==i;)n.push(o),o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=i,0===wt&&At(X)),a!==i?(Rt(),(s=Dt())!==i?o=s:(ft=o,o=i)):(ft=o,o=i);mt=e,l=n,e=[r,...l]}else ft=e,e=i;return e===i&&(e=Rt()),e}(),o!==i?(Rt(),41===t.charCodeAt(ft)?(a=")",ft++):(a=i,0===wt&&At(Z)),a!==i?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,(r=Bt())!==i&&(mt=e,r={type:"Variable",id:r}),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=i,0===wt&&At(Q)),r!==i?(n=function(){var t,e,r;for(t=ft,e=[],r=Jt();r!==i;)e.push(r),r=Jt();return mt=t,e=fr(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=i,0===wt&&At(Q)),o!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),wt--,e===i&&(r=i,0===wt&&At(K)),e}(),e===i&&(e=Ut())===i&&(e=Nt())===i&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=i,0===wt&&At(lt)),r!==i&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===i&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=i,0===wt&&At(ut)),r!==i&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===i&&(r=i,0===wt&&At(st)),e}(),e===i&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=i,0===wt&&At(Y)),r!==i&&(n=Dt())!==i?(41===t.charCodeAt(ft)?(o=")",ft++):(o=i,0===wt&&At(Z)),o!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i))),e}())),e}())),e}function Jt(){var e,r,n,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i?(n=Rt(),(o=Dt())!==i?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=i,0===wt&&At(A)),a!==i?(mt=e,e=o):(ft=e,e=i)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=i,0===wt&&At(V)),r!==i&&(mt=e,r=""),(e=r)===i&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(n=d,ft++):(n=i,0===wt&&At(j)),n===i&&(39===t.charCodeAt(ft)?(n="'",ft++):(n=i,0===wt&&At(Q)),n===i&&(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)))),wt--,n===i?r=void 0:(ft=r,r=i),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=$t()):(ft=e,e=i)):(ft=e,e=i),e===i))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i){if(n=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(tt)),o!==i)for(;o!==i;)n.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(tt));else n=i;n!==i?(125===t.charCodeAt(ft)?(o=l,ft++):(o=i,0===wt&&At(A)),o!==i?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=i)):(ft=e,e=i)}else ft=e,e=i;e===i&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=i,0===wt&&At(F)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.substr(ft,2)===s?(n=s,ft+=2):(n=i,0===wt&&At(F)),n!==i?(mt=e,e=n):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i?(t.length>ft?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(D)),n!==i?(mt=e,e=yr(n)):(ft=e,e=i)):(ft=e,e=i),e===i&&(e=ft,92===t.charCodeAt(ft)?(r=d,ft++):(r=i,0===wt&&At(j)),r!==i&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Nt(){var e,r,n,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt)),o!==i)for(;o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));else n=i;return n!==i?(mt=e,e={type:"IntegerLiteral",value:mr($t())}):(ft=e,e=i),wt--,e===i&&(r=i,0===wt&&At(et)),e}function Ut(){var e,r,n,o,a,s,l,u,d,c;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=i,0===wt&&At(nt)),o!==i){if(a=[],x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=i,0===wt&&At(rt)),s!==i)for(;s!==i;)a.push(s),x.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=i,0===wt&&At(rt));else a=i;if(a!==i){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=i,0===wt&&At(ot)),l===i&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=i,0===wt&&At(at))),l!==i){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=i,0===wt&&At(R)),u===i&&(45===t.charCodeAt(ft)?(u=y,ft++):(u=i,0===wt&&At(L))),u===i&&(u=null),d=[],x.test(t.charAt(ft))?(c=t.charAt(ft),ft++):(c=i,0===wt&&At(rt)),c!==i)for(;c!==i;)d.push(c),x.test(t.charAt(ft))?(c=t.charAt(ft),ft++):(c=i,0===wt&&At(rt));else d=i;d!==i?s=l=[l,u,d]:(ft=s,s=i)}else ft=s,s=i;s===i&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=i}else ft=e,e=i;if(e===i){if(e=ft,45===t.charCodeAt(ft)?(r=y,ft++):(r=i,0===wt&&At(L)),r===i&&(r=null),n=[],x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt)),o!==i)for(;o!==i;)n.push(o),x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(rt));else n=i;if(n!==i)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=i,0===wt&&At(ot)),o===i&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=i,0===wt&&At(at))),o!==i){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=i,0===wt&&At(R)),a===i&&(45===t.charCodeAt(ft)?(a=y,ft++):(a=i,0===wt&&At(L))),a===i&&(a=null),s=[],x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=i,0===wt&&At(rt)),l!==i)for(;l!==i;)s.push(l),x.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=i,0===wt&&At(rt));else s=i;s!==i?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=i)}else ft=e,e=i;else ft=e,e=i}return wt--,e===i&&(r=i,0===wt&&At(it)),e}function Bt(){var e,r,n,o,a;if(wt++,e=ft,r=ft,wt++,n=function(){var e,r,n,o;return e=ft,t.substr(ft,4)===b?(r=b,ft+=4):(r=i,0===wt&&At(lt)),r===i&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=i,0===wt&&At(ut))),r!==i?(n=ft,wt++,k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=i,0===wt&&At(dt)),wt--,o===i?n=void 0:(ft=n,n=i),n!==i?e=r=[r,n]:(ft=e,e=i)):(ft=e,e=i),e}(),wt--,n===i?r=void 0:(ft=r,r=i),r!==i)if(C.test(t.charAt(ft))?(n=t.charAt(ft),ft++):(n=i,0===wt&&At(vt)),n!==i){for(o=[],k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=i,0===wt&&At(dt));a!==i;)o.push(a),k.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=i,0===wt&&At(dt));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=i;else ft=e,e=i;return wt--,e===i&&(r=i,0===wt&&At(ct)),e}function Rt(){var e,r;for(wt++,e=[],E.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=i,0===wt&&At(gt));r!==i;)e.push(r),E.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=i,0===wt&&At(gt));return wt--,r=i,0===wt&&At(pt),e}if((r=a())!==i&&ft===t.length)return r;throw r!==i&&ft<t.length&&At({type:"end"}),function(t,e,r){return new br(br.buildMessage(t,e),t,e,r)}(_t,bt<t.length?t.charAt(bt):null,bt<t.length?Ft(bt,bt+1):Ft(bt,bt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(br,Error),br.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+":"+n.line+":"+n.column;if(i){var a=this.location.end,s=_r("",n.line.toString().length," "),l=i[n.line-1],u=(n.line===a.line?a.column:l.length+1)-n.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+n.line+" | "+l+"\n"+s+" | "+_r("",n.column-1," ")+_r("",u,"^")}else e+="\n at "+o}return e},br.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 $r=new Map,xr=new Map;function kr(t,e,r){const i={args:e,cb:r},n=$r.get(t)||[];$r.has(t)||$r.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");xr.set(o,i)}function Cr(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 Er(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=>{Er(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Er(t.left,e),Er(t.right,e);break;case"UnaryExpression":Er(t.argument,e);break;case"ConditionalExpression":Er(t.test,e),Er(t.consequent,e),Er(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Er(t,e)}))}}function Fr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Ar(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Vr(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 Ar(t.value);if("color"===t.type)return Or(Ir(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function jr(t){let e=Vr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Dr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const Sr=new Int32Array(1);function Pr(t){return Sr[0]=t,Sr[0]}function Tr(t){if(t<We||t>Le)throw new Error("Integer overflow.")}function zr(t){const e=[];return Er(t,{Variable(t){e.push(t.id.name)}}),e}function Mr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Ir(t){const e=ot(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Or(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 it(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Jr(t){return Or(Ir(t))}function Nr(t,e){return{type:Ge,value:Vr(e)}}function Ur(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ze,value:r}}function Br(t,e,r,i){const n=t.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=Jr(o)),{type:i,value:o}}function Rr(t,e,r){return Br(t,e,r,r.type)}function Lr(t,e,r){return Br(t,e,r,"color")}function Wr(t,e,r){return Br(t,e,r,"url")}const qr=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:Ye,value:i}},Hr=qr("getUTCFullYear"),Gr=qr("getUTCMonth"),Yr=qr("getUTCDate"),Zr=qr("getUTCDay"),Xr=qr("getUTCHours"),Kr=qr("getUTCMinutes"),Qr=qr("getUTCSeconds"),ti=qr("getUTCMilliseconds");function ei(t,e,r){if(!r.value.length)return"";let i="";const n=t.type===Ge?t.value:Vr(t);for(;i.length+n.length<e.value;)i+=r.value;return i.length>0&&i.length+n.length>e.value&&(i=i.substring(0,e.value-n.length)),i}function ri(t,e,r,i){const n=ei(e,r,i);return{type:Ge,value:n+Vr(e)}}function ii(t,e,r,i){const n=ei(e,r,i);return{type:Ge,value:Vr(e)+n}}function ni(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return e.type===Ye&&(i=Pr(i)),{type:e.type,value:i}}function oi(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return e.type===Ye&&(i=Pr(i)),{type:e.type,value:i}}function ai(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value,e[0].type===Ye&&(r=Pr(r));return{type:e[0].type,value:r}}function si(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value,e[0].type===Ye&&(r=Pr(r));return{type:e.length?e[0].type:Ye,value:r}}function li(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value,e[0].type===Ye&&(r=Pr(r));return{type:e.length?e[0].type:Ye,value:r}}function ui(t,e){const r=Math.abs(e.value);return e.type===Ye&&Tr(r),{type:e.type,value:r}}function di(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:e[0].type,value:Math.max(...e.map((t=>t.value)))}}function ci(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:e[0].type,value:Math.min(...e.map((t=>t.value)))}}function vi(t,e){return{type:e.type,value:Math.sign(e.value)}}function pi(t,e,r){let i;if(0===r.value&&e.type===Ye)i=e.value;else if(0===e.value&&e.type===Ye)i=0;else{let t=Math.sign(r.value);e.type===Ze&&0===t&&(t=Object.is(t,0)?1:-1),i=Math.abs(e.value)*t}return e.type===Ye&&Tr(i),{type:e.type,value:i}}function gi(t){return(e,r)=>{const i=Ir(r.value);return{type:Ze,value:i[t]/255}}}function hi(t){return(e,r,i)=>{const n=Ir(r.value);return n[t]=255*i.value,{type:Ke,value:Or(n)}}}const fi=gi("a"),mi=gi("r"),yi=gi("g"),bi=gi("b"),_i=hi("a"),wi=hi("r"),$i=hi("g"),xi=hi("b");function ki(t,e,r){if(t.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Math.floor(t.value/e);return r&&(i%=r),{type:Ye,value:i}}const Ci=36e5;function Ei(t){return t.map(jr).join(", ")}kr("toString",[Ye],Nr),kr("toString",[Ze],Nr),kr("toString",[Xe],Nr),kr("toString",[Ke],Nr),kr("toString",[Qe],Nr),kr("toNumber",[Ye],Ur),kr("toNumber",[Ge],Ur),kr("toInteger",[Ze],(function(t,e){if(e.value>Le||e.value<We)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Ye,value:r}})),kr("toInteger",[Ge],(function(t,e){const r=Number(e.value);if(isNaN(r)||r%1!=0||r>Le||r<We)throw new Error("Unable to convert value to Integer.");return{type:Ye,value:r}})),kr("toInteger",[Xe],(function(t,e){return{type:Ye,value:e.value?1:0}})),kr("toBoolean",[Ye],(function(t,e){if(1!==e.value&&0!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Xe,value:e.value}})),kr("toBoolean",[Ge],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Xe,value:"true"===e.value?1:0}})),kr("toColor",[Ge],(function(t,e){return{type:Ke,value:Jr(e.value)}})),kr("toUrl",[Ge],(function(t,e){return{type:Qe,value:e.value}})),kr("encodeUri",[Ge],(function(t,e){try{return{type:Ge,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),kr("decodeUri",[Ge],(function(t,e){try{return{type:Ge,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),kr("getIntegerValue",[Ge,Ye],Rr),kr("getNumberValue",[Ge,Ze],Rr),kr("getBooleanValue",[Ge,Xe],Rr),kr("getStringValue",[Ge,Ge],Rr),kr("getColorValue",[Ge,Ke],Lr),kr("getColorValue",[Ge,Ge],Lr),kr("getUrlValue",[Ge,Qe],Wr),kr("getUrlValue",[Ge,Ge],Wr),kr("parseUnixTime",[Ye],(function(t,e){return{type:tr,value:new Date(1e3*e.value)}})),kr("nowLocal",[],(function(){return{type:tr,value:new Date}})),kr("addMillis",[tr,Ye],(function(t,e,r){return{type:tr,value:new Date(e.value.getTime()+r.value)}})),kr("setYear",[tr,Ye],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(r.value),{type:tr,value:i}})),kr("setMonth",[tr,Ye],(function(t,e,r){if(r.value<1||r.value>12)throw new Error(`Expecting month in [1..12], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCMonth(r.value-1),{type:tr,value:i}})),kr("setDay",[tr,Ye],(function(t,e,r){const i=new Date(e.value);if(r.value<=0&&-1!==r.value||r.value>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 ${r.value} for date ${Vr(e)}.`);return i.setUTCDate(-1===r.value?0:r.value),{type:tr,value:i}})),kr("setHours",[tr,Ye],(function(t,e,r){if(r.value<0||r.value>23)throw new Error(`Expecting hours in [0..23], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCHours(r.value),{type:tr,value:i}})),kr("setMinutes",[tr,Ye],(function(t,e,r){if(r.value<0||r.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCMinutes(r.value),{type:tr,value:i}})),kr("setSeconds",[tr,Ye],(function(t,e,r){if(r.value<0||r.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCSeconds(r.value),{type:tr,value:i}})),kr("setMillis",[tr,Ye],(function(t,e,r){if(r.value<0||r.value>999)throw new Error(`Expecting millis in [0..999], instead got ${r.value}.`);const i=new Date(e.value);return i.setUTCMilliseconds(r.value),{type:tr,value:i}})),kr("getYear",[tr],Hr),kr("getMonth",[tr],Gr),kr("getDay",[tr],Yr),kr("getDayOfWeek",[tr],Zr),kr("getHours",[tr],Xr),kr("getMinutes",[tr],Kr),kr("getSeconds",[tr],Qr),kr("getMillis",[tr],ti),kr("getIntervalSeconds",[Ye],(function(t,e){return ki(e,1e3,60)})),kr("getIntervalTotalSeconds",[Ye],(function(t,e){return ki(e,1e3)})),kr("getIntervalMinutes",[Ye],(function(t,e){return ki(e,6e4,60)})),kr("getIntervalTotalMinutes",[Ye],(function(t,e){return ki(e,6e4)})),kr("getIntervalHours",[Ye],(function(t,e){return ki(e,Ci,24)})),kr("getIntervalTotalHours",[Ye],(function(t,e){return ki(e,Ci)})),kr("getIntervalTotalDays",[Ye],(function(t,e){return ki(e,864e5)})),kr("getIntervalTotalWeeks",[Ye],(function(t,e){return ki(e,6048e5)})),kr("len",[Ge],(function(t,e){return{type:Ye,value:e.value.length}})),kr("contains",[Ge,Ge],(function(t,e,r){return{type:Xe,value:e.value.includes(r.value)?1:0}})),kr("substring",[Ge,Ye,Ye],(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:Ge,value:e.value.substring(r.value,i.value)}})),kr("replaceAll",[Ge,Ge,Ge],(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:Ge,value:n}})),kr("index",[Ge,Ge],(function(t,e,r){return{type:Ye,value:e.value.indexOf(r.value)}})),kr("lastIndex",[Ge,Ge],(function(t,e,r){return{type:Ye,value:e.value.lastIndexOf(r.value)}})),kr("trim",[Ge],(function(t,e){return{type:Ge,value:e.value.trim()}})),kr("trimLeft",[Ge],(function(t,e){return{type:Ge,value:e.value.replace(/^\s+/,"")}})),kr("trimRight",[Ge],(function(t,e){return{type:Ge,value:e.value.replace(/\s+$/,"")}})),kr("toUpperCase",[Ge],(function(t,e){return{type:Ge,value:e.value.toUpperCase()}})),kr("toLowerCase",[Ge],(function(t,e){return{type:Ge,value:e.value.toLowerCase()}})),kr("padStart",[Ge,Ye,Ge],ri),kr("padStart",[Ye,Ye,Ge],ri),kr("padEnd",[Ge,Ye,Ge],ii),kr("padEnd",[Ye,Ye,Ge],ii),kr("div",[Ye,Ye],ni),kr("div",[Ze,Ze],ni),kr("mod",[Ye,Ye],oi),kr("mod",[Ze,Ze],oi),kr("mul",[{type:Ye,isVararg:!0}],ai),kr("mul",[{type:Ze,isVararg:!0}],ai),kr("sub",[{type:Ye,isVararg:!0}],si),kr("sub",[{type:Ze,isVararg:!0}],si),kr("sum",[{type:Ye,isVararg:!0}],li),kr("sum",[{type:Ze,isVararg:!0}],li),kr("abs",[Ye],ui),kr("abs",[Ze],ui),kr("max",[{type:Ye,isVararg:!0}],di),kr("max",[{type:Ze,isVararg:!0}],di),kr("min",[{type:Ye,isVararg:!0}],ci),kr("min",[{type:Ze,isVararg:!0}],ci),kr("maxNumber",[],(function(){return{type:Ze,value:qe}})),kr("minNumber",[],(function(){return{type:Ze,value:He}})),kr("maxInteger",[],(function(){return{type:Ye,value:Le}})),kr("minInteger",[],(function(){return{type:Ye,value:We}})),kr("round",[Ze],(function(t,e){const r=Math.sign(e.value);return{type:Ze,value:r*Math.round(Math.abs(e.value))}})),kr("floor",[Ze],(function(t,e){return{type:Ze,value:Math.floor(e.value)}})),kr("ceil",[Ze],(function(t,e){return{type:Ze,value:Math.ceil(e.value)}})),kr("signum",[Ze],vi),kr("signum",[Ye],vi),kr("copySign",[Ze,Ze],pi),kr("copySign",[Ye,Ye],pi),kr("getColorAlpha",[Ge],fi),kr("getColorAlpha",[Ke],fi),kr("getColorRed",[Ge],mi),kr("getColorRed",[Ke],mi),kr("getColorGreen",[Ge],yi),kr("getColorGreen",[Ke],yi),kr("getColorBlue",[Ge],bi),kr("getColorBlue",[Ke],bi),kr("setColorAlpha",[Ge,Ze],_i),kr("setColorAlpha",[Ke,Ze],_i),kr("setColorRed",[Ge,Ze],wi),kr("setColorRed",[Ke,Ze],wi),kr("setColorGreen",[Ge,Ze],$i),kr("setColorGreen",[Ke,Ze],$i),kr("setColorBlue",[Ge,Ze],xi),kr("setColorBlue",[Ke,Ze],xi),kr("rgb",[Ze,Ze,Ze],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:Ke,value:Or(n)}})),kr("argb",[Ze,Ze,Ze,Ze],(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:Ke,value:Or(o)}}));const Fi={StringLiteral:function(t,e){return{type:Ge,value:e.value}},NumberLiteral:function(t,e){return{type:Ze,value:e.value}},IntegerLiteral:function(t,e){return{type:Ye,value:e.value}},BooleanLiteral:function(t,e){return{type:Xe,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Fr(Ai(t,e.argument));switch(e.operator){case"!":if(r.type===Xe)return{type:Xe,value:r.value?0:1};Mr(`${e.operator}${jr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ye)return{type:Ye,value:r.value*t};if(r.type===Ze)return{type:Ze,value:r.value*t};Mr(`${e.operator}${jr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Fr(Ai(t,e.test));if(r.type===Xe)return r.value?Ai(t,e.consequent):Ai(t,e.alternate);Mr(`${jr(r)} ? ${jr(Ai(t,e.consequent))} : ${jr(Ai(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 Ai(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=Vr(Ai(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:Ge,value:r}},LogicalExpression:function(t,e){const r=Fr(Ai(t,e.left));if(r.type!==Xe&&Mr(`${jr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Xe,value:0};const i=Fr(Ai(t,e.right));return i.type!==Xe&&Mr(`${jr(r)} ${e.operator} ${jr(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Dr(i.type)}.`),{type:Xe,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=Ai(t,e.left),n=Ai(t,e.right);if(i.type!==n.type&&Mr(`${jr(i)} ${e.operator} ${jr(n)}`,`Operator '${r}' cannot be applied to different types: ${Dr(i.type)} and ${Dr(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===tr&&r.type===tr?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:Xe,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==Ze&&e.type!==Ye&&e.type!==tr&&Mr(`${jr(e)} ${t} ${jr(r)}`,`Operator '${t}' cannot be applied to ${Dr(e.type)} type.`);const n=e.type===tr?e.value.getTime():e.value,o=r.type===tr?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:Xe,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Ge&&e.type!==Ze&&e.type!==Ye&&Mr(`${jr(e)} ${t} ${jr(r)}`,`Operator '${t}' cannot be applied to ${Dr(e.type)} type.`),e.type===Ge)return"-"===t&&Mr(`${jr(e)} - ${jr(r)}`,`Operator '${t}' cannot be applied to ${Dr(e.type)} type.`),{type:Ge,value:e.value+r.value};let i="+"===t?e.value+r.value:e.value-r.value;return e.type===Ye&&(i=Pr(i)),{type:e.type,value:i}}(r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let i;if(e.type!==Ye&&e.type!==Ze&&Mr(`${jr(e)} ${t} ${jr(r)}`,`Operator '${t}' cannot be applied to ${Dr(e.type)} type.`),"*"===t)i=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&Mr(`${jr(e)} ${t} ${jr(r)}`,"Division by zero is not supported."),i="/"===t?e.value/r.value:e.value%r.value}return e.type===Ye&&(i=Pr(i)),{type:e.type,value:i}}(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=>Ai(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(xr.has(o))i=xr.get(o);else{const t=function(t,e){const r=$r.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=Cr(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=>Dr(t.type))).join(", "),i=`${r}(${Ei(n)})`;"few"===t.type&&0===n.length?Mr(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Mr(i,`Function '${r}' has no matching override for given argument types: ${e}.`):Mr(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){Mr(`${r}(${Ei(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function Ai(t,e){if(e.type in Fi)return Fi[e.type](t,e);throw new Error("Unsupported expression")}function Vi(t,e){try{return function(t,e){let r="";if(Er(e,{Variable(e){r||t.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(t,e),Ai(t,e)}catch(t){return{type:"error",value:t.message}}}class ji{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Er(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Vi(t,this.ast);if("error"===r.type)return void e(X(new Error("Expression execution error"),{additional:{message:r.value}}));const i=r.value;if(i instanceof Date)return Ar(i);if("boolean"===r.type)return Boolean(i);if("color"===r.type){const t=ot(String(i));if(t)return Or(t);e(X(new Error("Expression execution error")))}return i}catch(t){return void e(X(new Error("Expression execution error")))}}}function Di(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=wr(t,{startRule:"JsonStringContents"}),i=zr(r);return e.vars.push(...i),new ji(r)}catch(e){return void r(X(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Di(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Di(t[n],e,r);return i}}var i;return t}function Si(t,e,r){if(t){if(t instanceof ji)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Si(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Si(t[n],e,r);return i}}return t}function Pi(t,e){const r={vars:[],hasExpression:!1},i=Di(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Si(i,t,e)}}const Ti={pagers:function(){return R(new Map)}},zi=new Map,Mi=new Map;function Ii(t){const e=zi.get(t)||R("");return zi.has(t)||zi.set(t,e),e}function Oi(t){const e=Mi.get(t)||new Map;return Mi.has(t)||Mi.set(t,e),e}class Ji{setVariable(t){const e=t.getName(),r=Oi(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Ii(this).set(e)}getVariable(t){return Oi(this).get(t)}}function Ni(){return new Ji}function Ui(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Bi=new Set(["start","stop","pause","resume","cancel","reset"]);class Ri{constructor(t){Ui(this,"timers",new Map),Ui(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(X(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(X(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Bi.has(e)))return void this.logError(X(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(X(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(X(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(X(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(X(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(X(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(X(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(X(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(X(new Error("The timer is already running"))):this.logError(X(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)}}}const Li=O(((t,e,r,i)=>{let n,o;var s,l,u,v;let{id:p}=e,{json:g={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new Ji}=e,{mix:y=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:x}=e,{onCustomAction:k}=e,{onComponent:C}=e,E=R("desktop"===h);if(o=a(E,(t=>n=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");E.set(!t.matches),t.addListener((()=>{E.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function D(){}const S=new Set(w);let P=!1;g||(P=!0,Y(X(new Error('"json" prop is required')))),p||(P=!0,Y(X(new Error('"id" prop is required'))));let T=function(t){if(!t)return X(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return X(new Error("Missing card"));if(!e.states||!e.states.length)return X(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in sr)return X(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return X(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return X(new Error("Missing state_id"),{additional:{index:t}})}return null}(g);const M=g.templates||{};T&&(P=!0,Y(T));const I={stateChange:!1},O=Ii(m),J=Oi(m),N=new Map,U=new Map,B=new Map;let W=null;function q(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=U.get(t);r&&r.setValue(e)}}function H(t){const e=U.get(t);return null==e?void 0:e.getValue()}function G(t){const e=Pi(t,Y);return e.vars.length?e.applyVars(U):t}function Y(t){$?$({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function K(t,e){x&&x({type:t,action:e})}let Q=0;function tt(t){return`${p}-${Q++}`}let et={},rt={};function it(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const i=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=ct,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}}(i.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=lt(t);r&&r.setCurrentItem(Number(e))}(i.get("id"),i.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=lt(t);r&&r.setPreviousItem(e)}(i.get("id"),i.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=lt(t);r&&r.setNextItem(e)}(i.get("id"),i.get("overflow"));break;case"set_variable":const r=i.get("name"),n=i.get("value");if(r&&null!==n){const t=U.get(r);t?t.set(n):Y(X(new Error("Cannot find variable"),{additional:{name:r}}))}else Y(X(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=i.get("action"),a=i.get("id");W?W.execTimerAction(a,o):Y(X(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:Y(X(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){Y(X(t,{additional:{url:e}}))}}async function nt(t,e){if(t){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url;if(n){const t=pt(n);if(t)if(gt(t,S)){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?(it(i),await b()):i.log_id&&(ot(i),await b())}}t.forEach((t=>{t.log_id&&K("click",t)}))}}function ot(t){null==k||k(t)}const at=new Map;function lt(t){if(at.has(t))return at.get(t);Y(X(new Error("Missing instance with id"),{additional:{id:t}}))}const ut=new Map;function dt(t){for(const e of t)U.has(e)&&t.delete(e);return t}c(Z,{logError:Y,logStat:K,hasTemplate:function(t){return t in M},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in M;){if(({json:t,templateContext:e}=cr(t,e,M,Y)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:tt,genClass:function(t){return`divkit-${tt()}`},execAction:it,execAnyActions:nt,execCustomAction:ot,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){at.has(t)?Y(X(new Error("Duplicate instance id"),{additional:{id:t}})):at.set(t,e)},unregisterInstance:function(t){at.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(rt[r]=rt[r]||0,++rt[r],et[r])return et[r];const i=`${tt()}-svg-filter`;return et=Object.assign(Object.assign({},et),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;rt[r]&&0==--rt[r]&&(et=Object.keys(et).reduce(((t,e)=>(rt[e]&&(t[e]=et[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return pr(t);const e=Pi(t,Y);return e.vars.length?L(e.vars.map((t=>U.get(t)||function(t){const e=B.get(t)||R(void 0);return B.has(t)||B.set(t,e),e}(t))).filter(st),(()=>e.applyVars(U))):e.hasExpression?pr(e.applyVars(U)):pr(t)},getJsonWithVars:G,getStore:function(t){return ut.has(t)||function(t){ut.has(t)||ut.set(t,Ti[t]())}(t),ut.get(t)},getVariable:function(t,e){const r=U.get(t);if(r){const i=r.getType();if(i!==e)return void Y(X(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return S},isDesktop:E,registerComponent:void 0,unregisterComponent:void 0}),c(St,{hasAction:()=>!1});const ct={setState(t){throw new Error("Not implemented")},getChild(t){if(vt&&vt.has(t))return vt.get(t);Y(X(new Error("Missing state block with id"),{additional:{id:t}}))}};let vt=null;c(mt,{registerInstance(t,e){vt||(vt=new Map),vt.has(t)?Y(X(new Error("Duplicate state with id"),{additional:{id:t}})):vt.set(t,e)},unregisterInstance(t){null==vt||vt.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 ht=null===(s=null==g?void 0:g.card)||void 0===s?void 0:s.variables;Array.isArray(ht)&&ht.forEach((t=>{if(t&&t.type in rr&&t.name){if(N.has(t.name))return void Y(X(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=ir(t.name,t.type,t.value);N.set(t.name,e),U.set(t.name,e)}catch(e){Y(X(e,{additional:{name:t.name}}))}}}));const ft=g.palette;ft&&ft[F].forEach((t=>{if(N.has(t.name))Y(X(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=ir(t.name,"color",t.color);N.set(t.name,e),U.set(t.name,e)}catch(e){Y(X(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)U.has(t)||U.set(t,e);O.subscribe((t=>{if(t&&!U.has(t)){const e=J.get(t);U.set(t,e);const r=B.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const yt=null===(l=null==g?void 0:g.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(yt)&&yt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void Y(X(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=wr(t.condition,{startRule:"JsonStringContents"}),n=zr(i);if(!n.length)return void Y(X(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return dt(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{dt(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{L(n.map((t=>U.get(t))).filter(st),(()=>Vi(U,i))).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=G(t);e.log_id&&it(e)})),e=Boolean(i.value)):Y(X(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){Y(X(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else Y(X(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const bt=null===(u=null==g?void 0:g.card)||void 0===u?void 0:u.timers;if(bt){const t=W=new Ri({logError:Y,applyVars:G,hasVariableWithType:function(t,e){const r=U.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=U.get(t);r?r.setValue(e):Y(X(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:nt});bt.forEach((e=>t.createTimer(e)))}const _t=null===(v=null==g?void 0:g.card)||void 0===v?void 0:v.states,wt=_t&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:_t.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return d((()=>{W&&W.destroy()})),void 0===e.id&&r.id&&void 0!==p&&r.id(p),void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.platform&&r.platform&&void 0!==h&&r.platform(h),void 0===e.theme&&r.theme&&void 0!==f&&r.theme(f),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!==_&&r.customization(_),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.onError&&r.onError&&void 0!==$&&r.onError($),void 0===e.onStat&&r.onStat&&void 0!==x&&r.onStat(x),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==k&&r.onCustomAction(k),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.setTheme&&r.setTheme&&void 0!==V&&r.setTheme(V),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==D&&r.getDebugVariables(D),void 0===e.setVariable&&r.setVariable&&void 0!==q&&r.setVariable(q),void 0===e.getVariable&&r.getVariable&&void 0!==H&&r.getVariable(H),void 0===e.execAction&&r.execAction&&void 0!==it&&r.execAction(it),"light"===f||"dark"===f?F=f:"system"===f?"undefined"!=typeof matchMedia?(A||(A=matchMedia("(prefers-color-scheme: dark)"),A.addListener((function(){"system"===f&&A&&(F=A.matches?"dark":"light")}))),F=A.matches?"dark":"light"):F="light":Y(X(new Error("Unsupported theme"))),F&&(ft&&ft[F].forEach((t=>{const e=U.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&wt?`<div class="${j("divkit-b023c",!0)+j(n?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${z(dr,"RootSvgFilters").$$render(t,{svgFiltersMap:et},{},{})}\n ${z(ur,"Unknown").$$render(t,{div:wt,templateContext:{}},{},{})}</div>`:""})),Wi=Li;function qi(t){return Wi.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,platform:t.platform}).html}var Hi=exports;for(var Gi in e)Hi[Gi]=e[Gi];e.__esModule&&Object.defineProperty(Hi,"__esModule",{value:!0})})();
|
|
2
2
|
//# sourceMappingURL=server.js.map
|