@divkitframework/divkit 24.0.0 → 24.1.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.
@@ -1,2 +1,2 @@
1
- var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}function c(t){u().$$.on_destroy.push(t)}function d(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.d(e,{M:()=>$n,Os:()=>Re,sY:()=>An}),new Set,new Map;const g=[],p=[],h=[],f=[],m=Promise.resolve();let b=!1;function y(){return b||(b=!0,m.then(k)),m}function _(t){h.push(t)}const w=new Set;let $=0;function k(){const t=s;do{for(;$<g.length;){const t=g[$];$++,l(t),x(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.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(g.length);for(;f.length;)f.pop()();b=!1,w.clear(),l(t)}function x(t){if(null!==t.fragment){t.update(),i(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 E=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"]),C=/[\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,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=J(n):r.style=J(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return i+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 n=0;n<t.length;n+=1)r+=e(t[n],n);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,n,i,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,n,i);return l(a),u}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(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 N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function J(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=J(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(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(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 n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!B.length;for(const e of i)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 i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function L(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return{subscribe:R(n,(t=>{let n=!1;const c=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?c[0]:c,t);u?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),v()}})).subscribe}}const W=Symbol("root");function q(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const H={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"},G={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 Y(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 Z(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 X(t){let e=Z(t);return"0"===e&&(e+="em"),e}function K(t,e){for(;t.length<e;)t="0"+t;return t}function Q(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=tt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>K(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function tt(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,l=2===o.length?o:o+o,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,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function et(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const rt=Boolean;function nt(t){if(1===t.length&&"solid"===t[0].type)return{color:Q(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=Q(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(rt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>Q(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:at(t.bg.scale),pos:st(t.bg),image:'url("'+et(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(rt);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=X(n.value):"relative"===n.type&&(i=it[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ot(t.bg.center_x)} ${ot(t.bg.center_y)},`+r.map((t=>Q(t))).join(",")+")"}}({bg:t}):void 0)).filter(rt).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 it={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ot(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return X(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function at(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function st(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 lt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function ut(t,e){return e.has(t)}function ct(t,e){e&&t.push(e)}function dt(t,e,r){const n=[];ct(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ct(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const vt=Symbol("state");function gt(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}function pt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return pt(t)&&t>=0}function ft(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]&&!ht(r[t]))return e;return gt(t)}function mt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const bt=Object.prototype.hasOwnProperty;function yt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(!bt.call(e,i)||!yt(t[i],e[i]))return!1}return!0}function _t(t,e){return yt(t,e)?e:t}function wt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function $t(t,e){const r=Number(t);return isNaN(r)?e:r}function kt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...kt(t))})):e.push(t),e}function xt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!ht(t[r[n]]))return e;return t}function Et(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>Z((t||e)/r*10))).join(" ")}function Ct(){}const Ft=Symbol("action"),At=O(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:c=Ct}=e,{customAction:g=null}=e,{isNativeActionAnimation:p=!0}=e;const h=v(W),f=v(Ft);d(Ft,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,b="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){b=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(b="",h.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let y=Boolean(g);return b&&!ut(lt(b),h.getBuiltinProtocols())&&(b="",y=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),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!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==g&&r.customAction(g),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),b?`<a${F([{href:D(b)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(p?"divkit-bd259":"divkit-d9099",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},S(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(y?` ${p?"divkit-bd259":"divkit-d9099"} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},{style:D(l)},{role:D(y?"button":null)},{tabindex:D(y?0:null)},S(u)],{})}>${n.default?n.default({}):""}</span>`}));function Vt(t){return pt(t)&&t>0}function jt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Vt(t.radius))return`blur(${X(t.radius/2)})`}else e(q(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Dt=O(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(W);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),i=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 n=nt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=jt(t.filters,s.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${U({"border-radius":a})}>${P(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}>`:`<span${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}></span>`))}</span>`})),St=Dt,Pt=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,k,x,E,C,F,A,V,j,D,S,P,T,M,I,O,J,U,B,R,L,H,K,tt,et,rt,it,ot=r,at=r,st=r,ct=r,pt=r,bt=r,yt=r,Ct=r,Ft=r,Vt=r,jt=r,Dt=r,Pt=r,Tt=r,zt=r,Mt=r,It=r;var Ot,Nt,Jt,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(W),ne=v(vt);let ie,oe,ae,se,le,ue,ce,de,ve,ge,pe,he={},fe={},me=!1,be=1,ye="transparent",_e=0,we={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},$e="",ke=null,xe="",Ee={},Ce=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"],Ne=-1!==Oe.indexOf("state_change")&&Lt.id,Je=-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",nr=0,ir=0;void 0===e.json&&n.json&&void 0!==Lt&&n.json(Lt),void 0===e.origJson&&n.origJson&&void 0!==Wt&&n.origJson(Wt),void 0===e.templateContext&&n.templateContext&&void 0!==qt&&n.templateContext(qt),void 0===e.cls&&n.cls&&void 0!==Ht&&n.cls(Ht),void 0===e.style&&n.style&&void 0!==Gt&&n.style(Gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==Yt&&n.layoutParams(Yt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Xt&&n.customPaddings(Xt),void 0===e.customActions&&n.customActions&&void 0!==Kt&&n.customActions(Kt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==Qt&&n.additionalPaddings(Qt),o=re.getDerivedFromVars(Lt.border),It(),It=a(o,(t=>it=t));{let t={},e={},r=!1,n="";if(it){if(it.has_shadow){const e=it.shadow;t["box-shadow"]=e?Z((null===(Nt=null===(Ot=e.offset)||void 0===Ot?void 0:Ot.x)||void 0===Nt?void 0:Nt.value)||0)+" "+Z((null===(Ut=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Ut?void 0:Ut.value)||0)+" "+Z(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+Q(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(it.stroke&&(r=!0,be=mt(it.stroke.width,be),ye=Q(it.stroke.color,1,ye),e.border=`${Z(be)} solid ${ye}`),it.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]&&!ht(r[t]))return e;return t}(it.corners_radius,we),e["border-radius"]=t["border-radius"]=Et(we)):it.corner_radius&&(_e=mt(it.corner_radius,_e),we={"top-left":_e,"top-right":_e,"bottom-right":_e,"bottom-left":_e},e["border-radius"]=t["border-radius"]=Z(_e)),r&&be&&(it.corners_radius||it.corner_radius)){let t=Object.assign({},we);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+be/2})),n=Et(t)}}he=_t(t,he),fe=_t(e,fe),me=r,$e=n}s=re.getDerivedFromVars(Lt.paddings),Mt(),Mt=a(s,(t=>rt=t)),ke=xt(rt&&!Xt?rt:void 0,ke),l=gt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(ke,Qt)),u=re.getDerivedFromVars(Lt.margins),Tt(),Tt=a(u,(t=>tt=t)),xe=ft(tt,xe),c=re.getDerivedFromVars(Lt.width),Dt(),Dt=a(c,(t=>H=t)),d=re.getDerivedFromVars(Lt.alignment_horizontal),zt(),zt=a(d,(t=>et=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==H?void 0:H.type;if("fixed"===u)Ce=mt(null==H?void 0:H.value,Ce),e=Z(Ce);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,re.logError(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.left)||0)+((null==tt?void 0:tt.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=H&&"weight"in H&&H.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==H?void 0:H.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=H;t.min_size&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),t.max_size&&ht(t.max_size.value)&&(n=Z(t.max_size.value))}"match_parent"!==u&&u||re.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)i["halign-self"]="stretch";else{const t=et;i["halign-self"]="left"===t||"center"===t||"right"===t?te[t]:Yt.parentHAlign||"start"}t&&(i.width=t),ae=e,se=r,le=n,Fe=o,Ae=a,Ee=_t(i,Ee),Ve=s,je=l}g=re.getDerivedFromVars(Lt.height),jt(),jt=a(g,(t=>L=t)),p=re.getDerivedFromVars(Lt.alignment_vertical),Pt(),Pt=a(p,(t=>K=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if("fixed"===u)Se=mt(null==L?void 0:L.value,Se),e=Z(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)&&(i["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),(null==t?void 0:t.max_size)&&ht(t.max_size.value)&&(n=Z(t.max_size.value))}"match_parent"===u&&re.logError(q(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(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.top)||0)+((null==tt?void 0:tt.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==L?void 0:L.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=K;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?i["valign-self"]=ee[t]:i["valign-self"]=Yt.parentVAlign||"start"}t&&(i.height=t),ue=e,ce=r,de=n,Pe=o,Te=a,De=_t(i,De),ze=s,Me=l}var or,ar,sr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!H||"match_parent"===H.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,b=re.getDerivedFromVars(Lt.alpha),Vt(),Vt=a(b,(t=>R=t)),ar=Ie,Ie=!ht(or=R)||void 0===or||or>1?ar:Number(or),ve=1===Ie?void 0:Ie,_=re.getDerivedFromVars(Lt.accessibility),Ft(),Ft=a(_,(t=>B=t)),oe=void 0,B&&!Zt&&B.description&&(oe={},oe["aria-label"]=B.description),w=re.getDerivedFromVars(Lt.background),Ct(),Ct=a(w,(t=>U=t)),ge={},pe=!1,U&&(pe=U.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean($e),!pe)){const t=nt(U);ge["background-color"]=t.color,ge["background-image"]=t.image,ge["background-size"]=t.size,ge["background-position"]=t.position,ge["background-repeat"]="no-repeat"}Ue=void 0,Ne&&Lt.transition_in&&re.isRunning("stateChange")&&(Ue=!0),Re=void 0,Ne&&Lt.transition_change&&re.isRunning("stateChange")&&ne.hasTransitionChange(Lt.id)&&(Re=!0),$=re.getDerivedFromVars(Lt.action),bt(),bt=a($,(t=>O=t)),k=re.getDerivedFromVars(Lt.actions),yt(),yt=a(k,(t=>J=t)),x=re.getDerivedFromVars(Lt.doubletap_actions),pt(),pt=a(x,(t=>I=t)),E=re.getDerivedFromVars(Lt.longtap_actions),ct(),ct=a(E,(t=>M=t));{let t=J||O&&[O]||[],e=I||[],r=M||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],re.logError(q(new Error("Actions should be array")))),Array.isArray(e)||(e=[],re.logError(q(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],re.logError(q(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Kt&&(t=[],e=[],r=[],re.logError(q(new Error(`Cannot use action on component "${Kt}"`)))),Ze=t,Xe=e,Ke=r}C=re.getDerivedFromVars(Lt.action_animation),st(),st=a(C,(t=>T=t)),T&&(Qe=kt(T),tr=Qe.map((function(t){const e=$t(t.start_value,1),r=$t(t.end_value,1),n=mt(t.start_delay,0),i=mt(t.duration,300),o=wt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return Le=e,We=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return qe=e,He=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return re.logError(q(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=re.getDerivedFromVars(Lt.visibility),at(),at=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;Je&&r&&(await y(),"in"===e&&(Be=!0),ne.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,ie,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({},Ee),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),ot(),ot=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};nr=$t(t.value,nr);const e="pivot-fixed"===t.type?Z(nr):`${nr}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};ir=$t(r.value,ir),Ge=`${e} ${"pivot-fixed"===r.type?Z(ir):`${ir}%`}`,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),ge),he),{width:ae,"min-width":se,"max-width":le,height:ue,"min-height":ce,"max-height":de||(null==Gt?void 0:Gt["max-height"]),"grid-area":m,padding:l,margin:xe,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}),ot(),at(),st(),ct(),pt(),bt(),yt(),Ct(),Ft(),Vt(),jt(),Dt(),Pt(),Tt(),zt(),Mt(),It(),je||Me?"":`${z(At,"Actionable").$$render(t,{use:function(t){ie=t,Ne&&Lt.transition_in&&ne.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{Ue=!1})).catch((t=>{throw Ue=!1,t})),Ne&&Lt.transition_out&&ne.registerChildWithTransitionOut(Lt,qt,Lt.transition_out,t),Ne&&Lt.transition_change&&ne.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 n=e.map(((t,e)=>({index:e,action:t,visible:!1,count:0,finished:!1}))),i=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)=>(i[e].visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=i[e.index],n=0===t.log_limit?1/0:t.log_limit||1;++e.count>=n&&(e.finished=!0);const o=r.getJsonWithVars(e.action),a=o.url;if(a){const t=lt(a);t&&!ut(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(o):o.log_id&&r.execCustomAction(o))}r.logStat("visible",o)}),i[e.index].visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:o}).observe(t)}(t,{visibilityActions:e,rootCtx:re});const r=Lt.id;r&&ne.registerChild(r);let n=null;return{destroy(){r&&ne.unregisterChild(r),n&&n.destroy()}}},cls:Ht+" "+dt("outer",G,A),style:Y(D),actions:Ze,doubleTapActions:Xe,longTapActions:Ke,attrs:oe,isNativeActionAnimation:!Qe.length||(sr=Qe,sr.some((t=>"native"===t.name)))},{},{default:()=>`${pe?`${z(St,"OuterBackground").$$render(t,{background:U,radius:$e},{},{})}`:""}${i.default?i.default({}):""}${me?`<span${N("class",G.outer__border,0)}${N("style",Y(fe),0)}></span>`:""}`})}`})),Tt=Pt,zt={"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 Mt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function It(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Ot(t,e){return It(t)||e}const Nt=O(((t,e,r,n)=>{let i,o,a,s,l;var u,c;let d,{text:v}=e,{rootFontSize:g}=e,{textStyles:p={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",b=12,y=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==p&&r.textStyles(p),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";(p.underline||p.strike)&&("single"===p.underline&&"single"===p.strike?t="both":"single"===p.underline?t="underline":"single"===p.strike&&(t="strike")),m=t}return b=Mt(p.font_size,b),Vt(p.line_height)&&(y=Number(p.line_height)/b),ht(p.letter_spacing)&&(_=Z(p.letter_spacing)),d=Ot(p.font_weight,d),w=Q(p.text_color,1,w),i=p.top_offset?Z(p.top_offset):"",o=p.background?nt([p.background]):null,$=(null===(u=p.border)||void 0===u?void 0:u.stroke)&&"transparent"!==Q(p.border.stroke.color)&&Vt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=Mt(null===(c=p.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":Z(10*b/g),"line-height":y,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${Z($.width)} ${$.color}`:void 0,"border-radius":a?Z(a):void 0},`${i?`<span${N("class",zt["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${z(At,"Actionable").$$render(t,{cls:dt("text-range",zt,s),actions:f,style:Y(l)},{},{default:()=>`${j(v)}`})}`})),Jt=Nt;function Ut(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Bt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Rt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Lt=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,j,D,S,T,M,I,O,J,U,B,R,L=r,G=r,X=r,K=r,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r,{json:ct={}}=e,{templateContext:vt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ht=v(W);let ft=!1,mt="",bt=12,yt=1.25,_t=!1,wt="",$t="",kt=!1,xt="left",Et="top",Ct="",Ft="",At=!1,jt=[],Dt=[];var St,Pt;c((()=>{Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==ct&&n.json(ct),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==gt&&n.origJson(gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==pt&&n.layoutParams(pt),o=ht.getDerivedFromVars(ct.text),ut(),ut=a(o,(t=>R=t)),St=R,Pt=mt,mt=String(null!=St?St:"")||Pt,mt?ft=!1:(ft=!0,ht.logError(q(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(ct.ranges),G(),G=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}),X(),X=a(u,(t=>j=t)),d=ht.getDerivedFromVars(ct.font_size),lt(),lt=a(d,(t=>B=t)),bt=Mt(B,bt),g=ht.getDerivedFromVars(ct.line_height),st(),st=a(g,(t=>U=t));{const t=U;Vt(t)?(yt=Number(t)/bt,_t=!0):_t=!1}p=ht.getDerivedFromVars(ct.max_lines),it(),it=a(p,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let n=Number(I);t=n*yt+"em",V||A||(e=n,r=!0)}wt=t,$t=e,kt=r}f=ht.getDerivedFromVars(ct.text_alignment_horizontal),at(),at=a(f,(t=>J=t)),xt=Ut(J,xt),m=ht.getDerivedFromVars(ct.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Et=Bt(O,Et),b=!V||mt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=mt.length,y=ht.getDerivedFromVars(ct.text_color),rt(),rt=a(y,(t=>M=t)),_=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&b&&_&&(t=Q(M||V&&V[0]&&V[0].text_color,1,Ct)),Ct=t}w=ht.getDerivedFromVars(ct.truncate),et(),et=a(w,(t=>T=t)),$="none"===T?"none":"",k=ht.getDerivedFromVars(ct.text_gradient),tt(),tt=a(k,(t=>S=t));{let t="";if(S){const e=nt([S]);e.image&&(t=e.image)}Ft=t}return x=ht.getDerivedFromVars(ct.selectable),K(),K=a(x,(t=>D=t)),At=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,At),function(t,e,r){let n=[];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 i=t;let o=e||[{start:0,end:i.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<=i.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);n.push({text:i.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=Z(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=Z(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":Z(10*(Number(e.font_size)||12)/bt)};let a="";const s=t.image.tint_color,u=Rt(t.image.tint_mode,"source_in");if(s){const e=Q(t.image.tint_color);a=ht.addSvgFilter(e,u),Dt.push([e,u])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},j)}),jt=n}(mt,V,A),E={singleline:h,multiline:kt,halign:xt,valign:Et,truncate:$},C={gradient:Boolean(Ft)},F={"font-size":Z(bt),"line-height":yt,"max-height":wt,"-webkit-line-clamp":$t,color:Ct,"background-image":Ft},L(),G(),X(),K(),tt(),et(),rt(),it(),ot(),at(),st(),lt(),ut(),ft?"":`${z(Tt,"Outer").$$render(t,{cls:dt("text",H,E)+" "+(At?"":"divkit-c016b"),json:ct,origJson:gt,templateContext:vt,layoutParams:pt},{},{default:()=>`<span${N("class",dt("text__inner",H,C),0)}${N("style",Y(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${z(Jt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",Y(e.image.wrapperStyle),0)}><img${N("class",H.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",Y({width:e.image.width,height:e.image.height,"margin-top":_t?`-${e.image.height}`:void 0,"margin-bottom":_t?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${z(Jt,"TextRangeView").$$render(t,{text:mt,rootFontSize:bt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Wt=Lt,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 Ht(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)i=t.shape,n={width:Number((null===(o=i.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=i.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=i.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;n=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 i,o,a,s,l;return function(t,e,r){var n;const i={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?Q(o.color):"",s=null!=o&&o.width?Number(null!==(n=o.width)&&void 0!==n?n:1):"";i.width=t.width,i.height=t.height,i.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return i.background=Q(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${Z(s)} ${a}`),i}(n,t.shape,{color:t.color,stroke:t.stroke})}function Gt(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 Yt(t,e,r){let n;return n="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],n.map(Z).join(" ")}let Zt;function Xt(){if(void 0!==Zt)return Zt;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),Zt=1===t.scrollHeight,document.body.removeChild(t),Zt}function Kt(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function Qt(t,e,r,n){const i={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)&&Kt(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)Kt(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];Kt(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const te=O(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(G.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,s=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<s)break}else if(n.left<a)break;a=Math.max(a,n.right),s=Math.max(s,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];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&&Qt(d,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)))};n.push(r)})),s&&Qt(d,s,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,g=null,p=null;return c((()=>{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),i=null,(v&&i||g||p)&&(g&&(g.disconnect(),g=null),p&&(p.disconnect(),p=null),v&&i&&("undefined"!=typeof MutationObserver&&(g=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("divkit-f6e9a"))&&!(null==r?void 0:r.contains("divkit-a7719"))}))&&l()})),g.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(l),p.observe(i)))),v&&i&&l(),`\n\n<div${N("class","divkit-a7719",0)}${N("this",u,0)}>${P(d,(t=>`<div${N("class","divkit-c770e",0)}${U({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class","divkit-f6e9a",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>`})),ee=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,j,D=r,S=r,T=r,M=r,I=r,O=r,N=r,J=r,U=r;var B,R,L,H,G,Y;let{json:Z={}}=e,{templateContext:X}=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"],nt=v(W);let it,ot=!1,at="vertical",st="top",lt="left",ut=null,ct=null,vt={};if(void 0===e.json&&n.json&&void 0!==Z&&n.json(Z),void 0===e.templateContext&&n.templateContext&&void 0!==X&&n.templateContext(X),void 0===e.origJson&&n.origJson&&void 0!==K&&n.origJson(K),void 0===e.layoutParams&&n.layoutParams&&void 0!==Q&&n.layoutParams(Q),o=Z.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,nt.logError(q(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=X;return({templateContext:r,json:e}=nt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=nt.getDerivedFromVars(Z.orientation),U(),U=a(l,(t=>j=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(j,at),u=nt.getDerivedFromVars(Z.content_alignment_vertical),J(),J=a(u,(t=>V=t)),st=Bt(V,st),c=nt.getDerivedFromVars(Z.content_alignment_horizontal),N(),N=a(c,(t=>A=t)),lt=Ut(A,lt),d=nt.getDerivedFromVars(Z.layout_mode),O(),O=a(d,(t=>F=t)),g="wrap"===F,p=nt.getDerivedFromVars(Z.separator),I(),I=a(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&Xt()){const t=Ht(C.style,rt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(B=C.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(R=C.show_at_end)&&void 0!==R&&R),show_between:Boolean(null===(L=C.show_between)||void 0===L||L),style:t}:null}else ut=null;if(h=nt.getDerivedFromVars(Z.line_separator),M(),M=a(h,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&Xt()){const t=Ht(E.style,rt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(H=E.show_at_start)&&void 0!==H&&H),show_at_end:Boolean(null!==(G=E.show_at_end)&&void 0!==G&&G),show_between:Boolean(null===(Y=E.show_between)||void 0===Y||Y),style:t}:null}else ct=null;f=ut||ct?function(t,e,r){const n={};return Gt(n,e,"vertical"===t),Gt(n,r,"horizontal"===t),n}(at,ut,ct):null,m=nt.getDerivedFromVars(Z.aspect),T(),T=a(m,(t=>x=t));{const t=null==x?void 0:x.ratio;it=t&&Vt(t)?t:void 0}b=nt.getDerivedFromVars(Z.width),D(),D=a(b,(t=>$=t)),y=nt.getDerivedFromVars(Z.height),S(),S=a(y,(t=>k=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],(!k||"wrap_content"===k.type||"match_parent"===k.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"),g&&(t.parentContainerWrap=!0),vt=_t(t,vt)}return _={orientation:at,valign:st,halign:lt,wrap:g},w={gap:ut||ct?Yt(at,ut,ct):void 0,"aspect-ratio":it},D(),S(),T(),M(),I(),O(),N(),J(),U(),ot?"":`${z(Tt,"Outer").$$render(t,{cls:dt("container",qt,_),style:w,json:Z,origJson:K,templateContext:X,layoutParams:Q,additionalPaddings:f},{},{default:()=>`${P(s,(e=>`${z(Ge,"Unknown").$$render(t,{layoutParams:vt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||ct?`${z(te,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:ct,orientation:at},{},{})}`:""}`})}`})),re=ee,ne={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ie(t,e){return"vertical"===t||"horizontal"===t?t:e}const oe=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:b}=e;const y=v(W);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.templateContext&&n.templateContext&&void 0!==f&&n.templateContext(f),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==b&&n.layoutParams(b),o=y.getDerivedFromVars(h.delimiter_style),p(),p=a(o,(t=>g=t)),_=ie(null==g?void 0:g.orientation,_),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=Q(null==g?void 0:g.color,1,w),l="horizontal"===_?"100%":Z(1),u="horizontal"===_?Z(1):"100%",c={background:w,width:l,height:u},d={orientation:_},p(),`${z(Tt,"Outer").$$render(t,{cls:dt("separator",ne,d),json:h,origJson:m,templateContext:f,layoutParams:b},{},{default:()=>s?`<span${N("class",ne.separator__inner,0)}${N("style",Y(c),0)}></span>`:""})}`})),ae={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"},se=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,j,D,S,P,T,M,I,O,J,B,R,L,H=r,G=r,Z=r,X=r,K=r,tt=r,rt=r,nt=r,it=r,ot=r,lt=r,ut=r,ct=r,vt=r,{json:gt={}}=e,{templateContext:pt}=e,{origJson:ht}=e,{layoutParams:ft}=e;const bt=v(W);let yt,_t=0,$t="rgba(0,0,0,0.08)",kt=!1,xt="",Et="none",Ct="50% 50%",Ft="0",At="source_in",Dt="",St="",Pt=0,zt=0,Mt=0,It="",Ot="";c((()=>{bt.removeSvgFilter(yt,At)})),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==pt&&n.templateContext(pt),void 0===e.origJson&&n.origJson&&void 0!==ht&&n.origJson(ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==ft&&n.layoutParams(ft),o=bt.getDerivedFromVars(gt.image_url),vt(),vt=a(o,(t=>L=t)),s=bt.getDerivedFromVars(gt.gif_url),ct(),ct=a(s,(t=>R=t)),l=L||R,_t=0,l?kt=!1:(kt=!0,bt.logError(q(new Error('Missing "image_url" for "image"')))),u=bt.getDerivedFromVars(gt.width),ut(),ut=a(u,(t=>B=t)),d="wrap_content"===(null==B?void 0:B.type),g=bt.getDerivedFromVars(gt.height),lt(),lt=a(g,(t=>J=t)),p="wrap_content"===(null==J?void 0:J.type),h=bt.getDerivedFromVars(gt.preview),ot(),ot=a(h,(t=>O=t));{const t=O;xt=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}f=bt.getDerivedFromVars(gt.placeholder_color),it(),it=a(f,(t=>I=t)),$t=Q(I,1,$t),m=bt.getDerivedFromVars(gt.scale),nt(),nt=a(m,(t=>M=t)),Et=at(M)||Et,b=bt.getDerivedFromVars({content_alignment_horizontal:gt.content_alignment_horizontal,content_alignment_vertical:gt.content_alignment_vertical}),rt(),rt=a(b,(t=>T=t)),Ct=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:st(t)}(T,Ct),y=bt.getDerivedFromVars(gt.accessibility),tt(),tt=a(y,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=bt.getDerivedFromVars(gt.aspect),K(),K=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;Ft=t&&Vt(t)?(100/Number(t)).toFixed(2):"0"}$=bt.getDerivedFromVars(gt.tint_color),X(),X=a($,(t=>D=t)),k=bt.getDerivedFromVars(gt.tint_mode),Z(),Z=a(k,(t=>j=t));{const t=D,e=t?Q(t):void 0,r=Rt(j,At);e===yt&&r===At||(bt.removeSvgFilter(yt,At),Dt=e?bt.addSvgFilter(e,r):"",yt=e,At=r)}if(x=bt.getDerivedFromVars(gt.appearance_animation),G(),G=a(x,(t=>V=t)),V&&"fade"===V.type){const t=V;St=wt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Mt=mt(t.duration,300),zt=mt(t.start_delay,0),Pt=mt(t.alpha,0)}E=bt.getDerivedFromVars(gt.filters),H(),H=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=jt(A,bt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),It=t,Ot=e}return C={aspect:"0"!==Ft,"is-width-content":d,"is-height-content":p,loaded:!1,"before-appearance":Boolean(St)&&!0},F={"background-image":xt,"background-color":xt?void 0:$t,"background-size":Et,"clip-path":Ot||void 0,"object-fit":Et,"object-position":Ct,filter:["",It].filter(Boolean).join(" "),"--divkit-appearance-interpolator":St||void 0,"--divkit-appearance-fade-start":St?Pt:void 0,"--divkit-appearance-delay":St?`${zt}ms`:void 0,"--divkit-appearance-duration":St?`${Mt}ms`:void 0},H(),G(),Z(),X(),K(),tt(),rt(),nt(),it(),ot(),lt(),ut(),ct(),vt(),kt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("image",ae,C),json:gt,origJson:ht,templateContext:pt,layoutParams:ft,customDescription:!0},{},{default:()=>C.aspect?`<span${N("class",ae["image__aspect-wrapper"],0)}${U({"padding-bottom":`${Ft}%`})}><img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}></span>`:`<img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}>`})}`})),le={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function ue(t){return t>0&&t<1}function ce(t){return String(Math.ceil(1e3*t)/1e3)}function de(t,e,r){if(t.some(ue)){const e=Math.max(...t.filter(ue).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${Z(n*t[e]/i)},${ce(t[e])}fr)`:t[e]?o[e]=`${ce(t[e])}fr`:o[e]="auto";return o.join(" ")}const ve=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y=r,_=r,w=r,$=r,{json:k={}}=e,{templateContext:x}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(W);let A,V,j=!1,D=1,S=[],T=[],M=[],I=[],O=0,N=!1,J="top",U="left";void 0===e.json&&n.json&&void 0!==k&&n.json(k),void 0===e.templateContext&&n.templateContext&&void 0!==x&&n.templateContext(x),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=k.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(q(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(k.column_count),$(),$=a(s,(t=>b=t)),D=Mt(b,D),l=(!j&&o||[]).map((t=>{let e=t,r=x;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=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},g="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,p="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,h=1===c&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/c:0,f=1===d&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.type)&&u.height.value?Number(u.height.value)/d:0;for(let n=e;n<e+c;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<g)&&(S[n]=g),(!T[e]||T[e]<p)&&(T[e]=p),(!M[n]||M[n]<h)&&(M[n]=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({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(q(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(k.content_alignment_vertical),_(),_=a(u,(t=>f=t)),J=Bt(f,J),c=F.getDerivedFromVars(k.content_alignment_horizontal),y(),y=a(c,(t=>h=t)),U=Ut(h,U),d={valign:J,halign:U},g={"grid-template-columns":de(S,M,D),"grid-template-rows":de(T,I,O)},p=j||N,y(),_(),w(),$(),p?"":`${z(Tt,"Outer").$$render(t,{cls:dt("grid",le,d),json:k,origJson:E,templateContext:x,style:g,layoutParams:C},{},{default:()=>`${P(V,(e=>`${z(Ge,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),ge=ve,pe={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 he(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function fe(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const me=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,D,S,T,M,I,O,J,U=r,B=r,R=r,H=r,G=r,X=r,K=r,Q=r,tt=r,et=r,{json:rt={}}=e,{templateContext:nt}=e,{origJson:it}=e,{layoutParams:ot}=e;const at=v(W);let st,lt,ut=[],ct=null,vt=!1;at.getCustomization("galleryLeftClass"),at.getCustomization("galleryRightClass");let gt=!1;O=a(at.isDesktop,(t=>I=t));let pt,ht,bt,yt,wt=1,$t="horizontal",kt="start",xt=8,Et="",Ct=[],Ft={},At=!1,Vt={},jt=0;const Dt=fe((function(){}),50);function St(){let t=[],e=ut[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<wt;++e){const n=ut[e].children[r];n&&t.push(n)}return t}function Pt(t,e,r="smooth"){const n="horizontal"===$t,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-xt/2),behavior:r})}function zt(t){const e=St(),r=st.getBoundingClientRect(),n=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!==n)return n;const i=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=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!rt.id||gt||(null==ot?void 0:ot.fakeElement)||at.registerInstance(rt.id,{setCurrentItem(t){const e=St();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Pt(e,t)},setPreviousItem(t){const e=zt("prev"),r=St();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Pt(r,n)},setNextItem(t){const e="horizontal"===$t?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=St();if(e&&"ring"===t)return void Pt(r,0);const n=zt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Pt(r,i)}}),c((()=>{vt=!1,rt.id&&!(null==ot?void 0:ot.fakeElement)&&at.unregisterInstance(rt.id)})),void 0===e.json&&n.json&&void 0!==rt&&n.json(rt),void 0===e.templateContext&&n.templateContext&&void 0!==nt&&n.templateContext(nt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=rt.items,(null==o?void 0:o.length)&&Array.isArray(o)?gt=!1:(gt=!0,at.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!gt&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=at.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&vt&&!gt,l?"undefined"!=typeof ResizeObserver&&(ct=new ResizeObserver((()=>{Dt()})),ct.observe(lt)):ct&&(ct.disconnect(),ct=null),u=at.getDerivedFromVars(rt.column_count),tt(),tt=a(u,(t=>M=t)),wt=Mt(M,wt),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(s,wt),g=at.getDerivedFromVars(rt.orientation),Q(),Q=a(g,(t=>T=t)),$t=ie(T,$t),p=at.getDerivedFromVars(rt.cross_content_alignment),K(),K=a(p,(t=>S=t)),kt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,kt),h=at.getDerivedFromVars(rt.item_spacing),X(),X=a(h,(t=>D=t)),xt=mt(D,xt),pt=Z(xt),f=at.getDerivedFromVars(rt.cross_spacing),G(),G=a(f,(t=>V=t)),bt=mt(V,xt),ht=Z(bt),m=at.getDerivedFromVars(rt.paddings),H(),H=a(m,(t=>A=t)),Et=ft(A,Et),b="horizontal"===$t?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===$t?"width":"height";t.push(at.getDerivedFromVars(e.json[r]))})),yt=L(t,(t=>t)),R(),R=a(yt,(t=>F=t))}Ct=[],wt>1?Ct.push("auto"):F.forEach((t=>{!t&&"horizontal"===$t||"match_parent"===(null==t?void 0:t.type)?Ct.push("100%"):Ct.push("max-content")})),y=at.getDerivedFromVars(rt.scroll_mode),B(),B=a(y,(t=>C=t));{const t={};let e={};At=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===$t?e.parentVAlign=kt:e.parentHAlign=kt,"paging"===C&&(At=!0,e.scrollSnap="start",t["horizontal"===$t?"scroll-padding-left":"scroll-padding-top"]=Z(xt/2)),1===wt&&(e.parentLayoutOrientation=$t),Ft=_t(t,Ft),Vt=_t(e,Vt)}return _=at.getDerivedFromVars(rt.restrict_parent_scroll),et(),et=a(_,(t=>J=t)),w={padding:Et,"grid-gap":ht},$={"grid-gap":pt,[b]:he(Ct)},k={orientation:$t,"scroll-snap":At},x=at.getDerivedFromVars(rt.default_item),U(),U=a(x,(t=>E=t)),jt=mt(E,jt),U(),B(),R(),H(),G(),X(),K(),Q(),tt(),O(),et(),"\n\n"+(gt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("gallery",pe,k),json:rt,origJson:it,templateContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(pe.gallery__scroller,!0)+" "+j(J?"divkit-aa145":"",!0)}"${N("style",Y(Ft),0)}${N("this",st,0)}><div${N("class",pe["gallery__items-grid"],0)}${N("style",Y(w),0)}${N("this",lt,0)}>${P(d,((e,r)=>`<div${N("class",pe.gallery__items,0)}${N("style",Y($),0)}${N("this",ut[r],0)}>${P(e,(e=>`${z(Ge,"Unknown").$$render(t,{layoutParams:Vt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===$t?"\n ":""}`})}`)})),be=me,ye={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"},_e=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,_,w,$,k,x,E,C,F,A,V,D,S=r,T=r,M=r,I=r,O=r,J=r,B=r,R=r,L=r;var H;let{json:G={}}=e,{templateContext:K}=e,{origJson:tt}=e,{layoutParams:et}=e;const rt=v(W),nt=rt.genId("tabs");let it,ot,at,st=!1,lt={};const ut=rt.getJsonWithVars(G.selected_tab);let ct,vt,pt=ut&&Number(ut)||0,bt=12,yt="",wt="",$t="",kt="",Ct="",Ft="",jt="",Dt="",St=0,Pt="",zt="",It=null,Nt=!1,Jt=!1,Ut=pt,Bt=[],Rt=[];async function Lt(t,e=!1){if(Ut=pt,pt=t,Nt||(Nt=!0,ot.style.height=Z(ot.clientHeight),at.style.transform=`translate3d(${100*-Ut}%,0,0)`),Jt=!0,async function(t){await y(),at.style.transform=`translate3d(${t}%,0,0)`}(100*-pt),function(t=!1){const e=t?Math.max(0,pt-1):Math.min(pt,Ut),r=t?Math.min(o.length-1,pt+1):Math.max(pt,Ut);Bt=Bt.map(((t,n)=>t||n>=e&&n<=r)),Rt=Rt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await y();const t=document.getElementById(`${nt}-panel-${pt}`);t&&(ot.style.height=Z(t.offsetHeight))}(),qt&&clearTimeout(qt),qt=window.setTimeout((()=>{Rt=o.map(((t,e)=>e===pt))}),400),Wt=-pt*ot.clientWidth,e){await y();const t=it.querySelector(`.${ye.tabs__item_selected}`);t&&t.focus()}}let Wt,qt=null;!G.id||st||(null==et?void 0:et.fakeElement)||rt.registerInstance(G.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)}}),c((()=>{G.id&&!(null==et?void 0:et.fakeElement)&&rt.unregisterInstance(G.id)})),void 0===e.json&&n.json&&void 0!==G&&n.json(G),void 0===e.templateContext&&n.templateContext&&void 0!==K&&n.templateContext(K),void 0===e.origJson&&n.origJson&&void 0!==tt&&n.origJson(tt),void 0===e.layoutParams&&n.layoutParams&&void 0!==et&&n.layoutParams(et),o=G.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?st=!1:(st=!0,rt.logError(q(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=rt.getDerivedFromVars(G.width),R(),R=a(s,(t=>V=t)),l=rt.getDerivedFromVars(G.height),B(),B=a(l,(t=>A=t));{let t={};(null==et?void 0:et.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==V?void 0:V.type)&&(t.parentHorizontalWrapContent=!0),A&&"wrap_content"!==A.type||(t.parentVerticalWrapContent=!0),lt=_t(t,lt)}if(!st&&(pt<0||pt>=o.length)&&(rt.logError(q(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:G.selected_tab,length:o.length}})),pt=pt<0?0:o.length-1),u=rt.getDerivedFromVars(G.tab_title_style),J(),J=a(u,(t=>F=t)),d=F||{},bt=Mt(d.font_size,bt),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/bt*10,right:(Number(t.right)||0)/bt*10,bottom:(Number(t.bottom)||0)/bt*10,left:(Number(t.left)||0)/bt*10};yt=ft(e,yt)}{const t=d.line_height;void 0!==t&&Vt(t)&&(wt=Z(t/bt*10))}{const t=d.letter_spacing;void 0!==t&&ht(t)&&($t=Z(t/bt*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(H=d.corner_radius)&&void 0!==H?H:1e3;d.corners_radius?kt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!ht(i[t]))return n;return Et(t,e,r)}(d.corners_radius,t,bt,kt):ht(t)&&(kt=Z(t/bt*10))}return ct=Ot(d.active_font_weight||d.font_weight,ct),vt=Ot(d.inactive_font_weight||d.font_weight,vt),Ct=Q(d.active_text_color,1,Ct),Ft=Q(d.inactive_text_color,1,Ft),jt=Q(d.active_background_color,1,jt),Dt=Q(d.inactive_background_color,1,Dt),St=mt(d.item_spacing,St),g=rt.getDerivedFromVars(G.has_separator),O(),O=a(g,(t=>C=t)),p=rt.getDerivedFromVars(G.separator_color),I(),I=a(p,(t=>E=t)),h=rt.getDerivedFromVars(G.separator_paddings),M(),M=a(h,(t=>x=t)),C&&(E&&(Pt=Q(E,1,Pt)),x&&(zt=ft(x,zt))),f={background:Pt,margin:zt},m=rt.getDerivedFromVars(G.switch_tabs_by_content_swipe_enabled),T(),T=a(m,(t=>k=t)),b=void 0===k||Boolean(k),_=rt.getDerivedFromVars(G.restrict_parent_scroll),L(),L=a(_,(t=>D=t)),w=rt.getDerivedFromVars(G.title_paddings),S(),S=a(w,(t=>$=t)),It=xt($||void 0,It),st||(Bt=o.map(((t,e)=>e===pt)),Rt=o.map(((t,e)=>e===pt))),S(),T(),M(),I(),O(),J(),B(),R(),L(),st?"":`${z(Tt,"Outer").$$render(t,{cls:dt("tabs",ye,{}),json:G,origJson:tt,templateContext:K,layoutParams:et,customActions:"tabs"},{},{default:()=>`<div class="${j(ye.tabs__list,!0)+" "+j(D?"divkit-aa145":"",!0)}" role="tablist"${U({"--divkit-tabs-title-padding":It?gt(It):"","--divkit-tabs-font-size":Z(bt),"--divkit-tabs-paddings":yt,"--divkit-tabs-line-height":wt,"--divkit-tabs-letter-spacing":$t,"--divkit-tabs-active-font-weight":ct||"","--divkit-tabs-inactive-font-weight":vt||"","--divkit-tabs-active-text-color":Ct,"--divkit-tabs-inactive-text-color":Ft,"--divkit-tabs-active-background-color":jt,"--divkit-tabs-inactive-background-color":Dt,"--divkit-tabs-border-radius":kt,"--divkit-tabs-items-spacing":St?X(St):""})}${N("this",it,0)}>${P(o,((e,r)=>{let n=r===pt;return`\n\n ${z(At,"Actionable").$$render(t,{cls:dt("tabs__item",ye,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=et&&et.fakeElement?[]:[e.title_click_action],attrs:{id:`${nt}-tab-${r}`,"aria-controls":`${nt}-panel-${r}`,role:"tab",tabindex:!n||null!=et&&et.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=et&&et.fakeElement?null:t=>function(t,e){return pt===e||(Lt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${C?`<div${N("class",ye.tabs__separator,0)}${N("style",Y(f),0)}></div>`:""}\n <div class="${j(ye.tabs__panels,!0)+" "+j(D?"divkit-aa145":"",!0)}"${N("this",ot,0)}><div${N("class",dt("tabs__swiper",ye,{inited:Nt,animated:Jt}),0)}${N("this",at,0)}>${P(o,((e,r)=>`<div${N("class",dt("tabs__panel",ye,{visible:Rt[r]}),0)} role="tabpanel" id="${j(nt,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(nt,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Bt[r]?`${z(Ge,"Unknown").$$render(t,{div:e.div,templateContext:K,layoutParams:lt},{},{})}`:""}\n </div>`))}</div></div>`})}`})),we=_e;function $e(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),i=r-n;return t[n]*i+t[n+1]*(1-i)}}$e([.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]),$e([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 ke=O(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(W),g=v(vt);let p=new Map,h=new Set,f=!1,m=null,b=[],_=[],w=[],$=[];const k=o.div_id||o.id;let x;k?(null==l?void 0:l.fakeElement)||(g.registerInstance(k,{async setState(t){if(x===t)return;u.setRunning("stateChange",!0),new Set(h),b.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),b=[],$.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(x=t,E=e):u.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await y()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(vt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(q(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return _.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(q(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{k&&!(null==l?void 0:l.fakeElement)&&g.unregisterInstance(k)})),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),i=o.states||[],(null==i?void 0:i.length)?f=!1:(f=!0,u.logError(q(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(x=C,E=t.find((t=>t.state_id===x))||null,E||u.logError(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:x}}))):(E=t[0],x=E.state_id)))}(i),f?"":`${z(Tt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${z(Ge,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${P(b,(e=>"direction"in e?`<div${N("class","divkit-eb860",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${N("class","divkit-e08c6",0)}>${z(Ge,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class","divkit-eb860",0)}><div${N("class","divkit-e08c6",0)}>${z(Ge,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),xe={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Ee=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E=r,C=r,F=r,A=r,V=r,D=r;var S,T,M,I,O,J,U;let{json:B={}}=e,{templateContext:R}=e,{origJson:L}=e,{layoutParams:H}=e;const G=v(W),K=G.genId("pager");let Q,tt=!1,et=!1,rt=0,nt=0,it=!1,ot="horizontal",at="",st="",lt="";function ut(t,e="smooth"){const r="horizontal"===ot,n=Q.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Q.scroll({[o]:n[i],behavior:e}),rt=t}fe((function(){if(!tt)return;const t=function(){const t=Array.from(Q.children),e=Q.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===ot?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:rt}();t!==rt&&(rt=t)}),50),B.id&&!(null==H?void 0:H.fakeElement)&&G.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');ut(t)},setPreviousItem(t){let e=rt-1;e<0&&(e="ring"===t?o.length-1:rt),ut(e)},setNextItem(t){let e=rt+1;e>o.length-1&&(e="ring"===t?0:rt),ut(e)}}),c((()=>{tt=!1,B.id&&!(null==H?void 0:H.fakeElement)&&G.unregisterInstance(B.id)})),void 0===e.json&&n.json&&void 0!==B&&n.json(B),void 0===e.templateContext&&n.templateContext&&void 0!==R&&n.templateContext(R),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),(null===(S=B.items)||void 0===S?void 0:S.length)&&Array.isArray(B.items)?et=!1:(et=!0,G.logError(q(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!et&&B.items||[]).map((t=>{let e=t,r=R;return({templateContext:r,json:e}=G.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=G.getDerivedFromVars(B.layout_mode),C(),C=a(s,(t=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(it=!0,G.logError(q(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!0,G.logError(q(new Error('Empty "layout_mode" prop for div "pager"')))),l=G.getDerivedFromVars(B.orientation),V(),V=a(l,(t=>k=t)),ot=ie(k,ot),u=G.getDerivedFromVars(B.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&ht(t)&&(at=Z(t||0))}if(d=G.getDerivedFromVars(B.paddings),F(),F=a(d,(t=>w=t)),st=ft(w,st),g=G.getDerivedFromVars(B.restrict_parent_scroll),D(),D=a(g,(t=>x=t)),p="horizontal"===ot?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=X("horizontal"===ot?((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===(J=_.neighbour_page_width)||void 0===J?void 0:J.value;lt=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${at})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(U=_.page_width)||void 0===U?void 0:U.value;lt=`${Number(t)}%`}return h={"grid-gap":at,padding:st,[p]:lt},f={orientation:ot},m=et||it,b=G.getStore("pagers"),E(),E=a(b,(t=>y=t)),function(t,e){const r=B.id;if(r){const o=new Map(y);n=b,y=o.set(r,{instId:K,size:t,currentItem:e,scrollToPagerItem:ut}),i=y,n.set(i)}var n,i}(o.length,rt),function(t){var e;if(t===nt)return;nt=t;const r=G.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&G.execAnyActions(r)}(rt),E(),C(),F(),A(),V(),D(),m?"":`${z(Tt,"Outer").$$render(t,{cls:dt("pager",xe,f),json:B,origJson:L,templateContext:R,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(xe.pager__items,!0)+" "+j(x?"divkit-aa145":"",!0)}"${N("style",Y(h),0)}${N("this",Q,0)}>${P(o,(e=>`<div${N("class",xe.pager__item,0)}>${z(Ge,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ce=Ee,Fe={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"},Ae=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,k,x,E,C,F=r,A=r,V=r,D=r,S=r,T=r,M=r,I=r,O=r;var J,B;let{json:R={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=["rounded_rectangle","circle"],Y=v(W);let X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},tt={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,nt=10,it=5;if(void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),o=Y.getDerivedFromVars(R.shape),T(),T=a(o,(t=>k=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=>x=t)),c=Y.getDerivedFromVars(R.active_shape),O(),O=a(c,(t=>C=t)),d=Y.getDerivedFromVars(R.inactive_shape),I(),I=a(d,(t=>E=t)),C&&(K=Ht({type:"shape_drawable",shape:C},G,K)),E&&(tt=Ht({type:"shape_drawable",shape:E},G,tt)),!C&&!E&&k){const t=Mt(x,1.3);tt=Ht({type:"shape_drawable",shape:k,color:tt.background},G,tt),tt.background=Q($,1,tt.background),K=Object.assign(Object.assign({},tt),{width:tt.width*t,height:tt.height*t,borderRadius:tt.borderRadius*t,background:K.background}),K.background=Q(w,1,K.background)}if(g=Y.getDerivedFromVars(R.space_between_centers),A(),A=a(g,(t=>b=t)),p=Y.getDerivedFromVars(R.items_placement),V(),V=a(p,(t=>_=t)),!_||"default"!==_.type&&"stretch"!==_.type)et="default",b&&(rt=mt(b.value,rt));else if(et=_.type,"default"===et)rt=mt(null===(J=_.space_between_centers)||void 0===J?void 0:J.value,rt);else if("stretch"===et){const t=_;nt=Mt(t.max_visible_items,nt),it=mt(null===(B=t.item_spacing)||void 0===B?void 0:B.value,it)}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 y())}(m),f={placement:et},F(),A(),V(),D(),S(),T(),M(),I(),O(),`${z(Tt,"Outer").$$render(t,{cls:dt("indicator",Fe,f),json:R,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<div${N("class",Fe.indicator__scroller,0)}${N("this",undefined,0)}><div${N("class",Fe.indicator__items,0)} role="tablist"${U({margin:"default"===et?`0 ${Z(Math.max(0,K.width-tt.width)/2)}`:"","--divkit-indicator-inactive-width":Z(tt.width),"--divkit-indicator-inactive-height":Z(tt.height),"--divkit-indicator-inactive-border-radius":Z(tt.borderRadius),"--divkit-indicator-inactive-background":tt.background||"","--divkit-indicator-inactive-box-shadow":tt.boxShadow||"","--divkit-indicator-active-width":Z(K.width),"--divkit-indicator-active-height":Z(K.height),"--divkit-indicator-active-border-radius":Z(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/tt.width,"--divkit-indicator-default-margin":"default"===et?`0 ${Z((rt-tt.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?Z(it):"","--divkit-indicator-stretch-max-count":"stretch"===et?nt:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?Z((nt-1)*it):""})}${N("this",undefined,0)}>${X?`${P(Array(X.size),((t,e)=>{let r=e===X.currentItem;return`\n <div class="${j(dt("indicator__item",Fe,{active:r}),!0)+" "+j("divkit-bd259",!0)}" role="tab" id="${j(X.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(X.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ve=Ae,je={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 De(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=It(t.font_weight);if(Vt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:Z(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Se(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Pe="function"==typeof BigInt;function Te(t){return Pe?BigInt(t):Number(t)}const ze=Te("9223372036854775807"),Me=Te("-9223372036854775808");function Ie(t){const e=Te(t);if(e>ze||e<Me)throw new Error("Integer overflow.");return e}const Oe=Ie(0);function Ne(t){let e=t;return e<0&&(e=-e),e}function Je(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ie(e)}class Ue{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 Be={string:class extends Ue{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Ue{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 Ue{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>ze||t<Me)throw new Error("Incorrect variable value");return Ie(t)}fromString(t){const e=Ie(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Ue{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 Ue{convertValue(t){if("string"!=typeof t||!tt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Ue{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Re(t,e,r){if(!(e in Be))throw new Error("Unsupported variable type");return new Be[e](t,r)}function Le(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const We=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,D,S,T,M,I,O,J,B,R,L,H,G,Y,K=r,Q=r,tt=r,et=r,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r;var ct,vt,gt,pt;let{json:ft={}}=e,{templateContext:mt}=e,{origJson:bt}=e,{layoutParams:yt}=e;const _t={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],kt=["rounded_rectangle"],xt=v(W),Et=v(Ft);let Ct=0,At=100;const Vt=xt.getJsonWithVars(ft.thumb_value_variable),jt=xt.getJsonWithVars(ft.thumb_secondary_value_variable);H=a(Vt&&xt.getVariable(Vt,"integer")||Re("temp","integer",0),(t=>L=t)),R=a(jt&&xt.getVariable(jt,"integer")||Re("temp","integer",0),(t=>B=t));let Dt,St,Pt,zt=Se(L||0,Ct,At),Mt=Se(B||0,Ct,At),It=_t,Ot=It,Nt=_t,Jt=_t,Ut=null,Bt=null,Rt=Pt,Lt="",Wt="",qt=!1;fe((function(){}),50),void 0===e.json&&n.json&&void 0!==ft&&n.json(ft),void 0===e.templateContext&&n.templateContext&&void 0!==mt&&n.templateContext(mt),void 0===e.origJson&&n.origJson&&void 0!==bt&&n.origJson(bt),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=xt.getDerivedFromVars(ft.min_value),ut(),ut=a(o,(t=>Y=t)),s=xt.getDerivedFromVars(ft.max_value),lt(),lt=a(s,(t=>G=t)),Ct=$t(Y,Ct),At=$t(G,At);{const t=Se(L||0,Ct,At);t!==zt&&(zt=t)}{const t=Se(B||0,Ct,At);t!==Mt&&(Mt=t)}l=xt.getDerivedFromVars(ft.thumb_style),st(),st=a(l,(t=>J=t)),It=Ht(J,wt,It),u=xt.getDerivedFromVars(ft.thumb_secondary_style),at(),at=a(u,(t=>O=t)),Ot=Ht(O,wt,It),c=xt.getDerivedFromVars(ft.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Nt=Ht(I,kt,Nt),d=xt.getDerivedFromVars(ft.track_active_style),it(),it=a(d,(t=>M=t)),Jt=Ht(M,kt,Jt),g=xt.getDerivedFromVars(ft.tick_mark_active_style),nt(),nt=a(g,(t=>T=t));{let t=Ht(T,wt,_t);t!==_t&&(Ut=t)}Dt=Ut?jt?Le(Math.min(zt,Mt),Math.max(zt,Mt)+1,Ct,At,!0):Le(Ct,zt,Ct,At,!0):[],p=xt.getDerivedFromVars(ft.tick_mark_inactive_style),rt(),rt=a(p,(t=>S=t));{let t=Ht(S,wt,_t);t!==_t&&(Bt=t)}St=Bt?jt?Le(Math.min(zt,Mt),Math.max(zt,Mt)+1,Ct,At,!1):Le(zt+1,At+1,Ct,At,!0):[],h=xt.getDerivedFromVars(ft.thumb_text_style),et(),et=a(h,(t=>D=t)),Pt=De(D,Pt),f=xt.getDerivedFromVars(ft.thumb_secondary_text_style),tt(),tt=a(f,(t=>V=t)),Rt=De(V,Pt),m=xt.getDerivedFromVars(ft.accessibility),Q(),Q=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:xt.logError(q(new Error('Missing accessibility "description" for slider'),{level:"warn"})),b=xt.getDerivedFromVars(ft.secondary_value_accessibility),K(),K=a(b,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:jt&&xt.logError(q(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Et.hasAction()?(xt.logError(q(new Error('Cannot show "slider" inside component with action'))),t=!0):It===_t?(xt.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===_t?(xt.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===_t&&(xt.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return y=Z(Math.max(...[It.width,Ot.width,0].filter(ht))),_=Z(Math.max(...[It.height,Ot.height,0].filter(ht))),w=(zt-Ct)/(At-Ct),$=jt?(Mt-Ct)/(At-Ct):void 0,k=void 0!==$?Math.abs($-w):w,x=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":Z(It.width),"--divkit-slider-thumb-height":Z(It.height),"--divkit-slider-thumb-secondary-width":Z(Ot.width),"--divkit-slider-thumb-secondary-height":Z(Ot.height),"--divkit-slider-text-offset-x":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.x)?X(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(vt=null==Pt?void 0:Pt.offset)||void 0===vt?void 0:vt.y)?X(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(gt=null==Rt?void 0:Rt.offset)||void 0===gt?void 0:gt.x)?X(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)?X(Rt.offset.y):void 0,"--divkit-slider-tick-active-width":Ut?Z(Ut.width):void 0,"--divkit-slider-tick-active-height":Ut?Z(Ut.height):void 0,"--divkit-slider-tick-active-border-radius":Ut?Z(Ut.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Ut?void 0:Ut.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Ut?void 0:Ut.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?Z(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?Z(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?Z(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":y,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},K(),Q(),tt(),et(),rt(),nt(),it(),ot(),at(),st(),R(),H(),lt(),ut(),"\n\n"+(qt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("slider",je,C),style:E,customDescription:!0,customActions:"slider",json:ft,origJson:bt,templateContext:mt,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",je["slider__tracks-wrapper"],0)}><div${N("class",je["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",je.slider__track,0)}${U({height:Z(Nt.height),"border-radius":Z(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n <div${N("class",je["slider__active-track"],0)}${U({left:(100*x).toFixed(2)+"%",width:(100*k).toFixed(2)+"%",height:Z(Jt.height),"border-radius":Z(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${P(Dt,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(St,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",je.slider__thumb,0)}${U({"border-radius":Z(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Pt?`<div${N("class",je["slider__thumb-text"],0)}><div${N("class",je["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(zt)}</div></div>`:""}</div>\n ${jt?`<div class="${j(je.slider__thumb,!0)+" "+j(je.slider__thumb_secondary,!0)}"${U({"border-radius":Z(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Rt?`<div class="${j(je["slider__thumb-text"],!0)+" "+j(je["slider__thumb-text_secondary"],!0)}"><div${N("class",je["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Rt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Rt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Rt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",je.slider__input,0)}${N("min",Ct,0)}${N("max",At,0)} step="1"${N("value",zt,0)}${N("aria-label",Lt,0)}>\n ${jt?`<input type="range"${N("class",`${je.slider__input} ${je.slider__input_secondary}`,0)}${N("min",Ct,0)}${N("max",At,0)} step="1"${N("value",Mt,0)}${N("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),qe={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"},He={text:Wt,container:re,separator:oe,image:se,gif:se,grid:ge,gallery:be,tabs:we,state:ke,pager:Ce,indicator:Ve,slider:We,input:O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,D,S,P,T,M,I,O,J,U,B=r,R=r,{json:L={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(W);let tt;const et=K.getJsonWithVars(L.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),O=a(et&&K.getVariable(et,"string")||Re("temp","string",""),(t=>I=t));let nt="";M=a(K.getDerivedFromVars(L.hint_text),(t=>T=t)),P=a(K.getDerivedFromVars(L.hint_color),(t=>S=t));let it="";D=a(K.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(L.font_weight),(t=>F=t)),C=a(K.getDerivedFromVars(L.line_height),(t=>E=t)),x=a(K.getDerivedFromVars(L.letter_spacing),(t=>k=t));let lt="";$=a(K.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";_=a(K.getDerivedFromVars(L.highlight_color),(t=>y=t));let ct="";b=a(K.getDerivedFromVars(L.keyboard_type),(t=>m=t));const vt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let gt="multi_line_text",ht="text";f=a(K.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let ft="",bt="";U=a(K.getDerivedFromVars(L.select_all_on_focus),(t=>J=t)),void 0===e.json&&n.json&&void 0!==L&&n.json(L),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==G&&n.origJson(G),void 0===e.layoutParams&&n.layoutParams&&void 0!==Y&&n.layoutParams(Y),nt=I,o=T,it=Q(S,1,it),st=Mt(V,st),ot=Ot(F,ot);{const t=E;Vt(t)&&(at=t/st)}return pt(k)&&(lt=Z(k/st*10)),ut=Q(w,1,ut),ct=Q(y,1,ct),m&&m in vt&&(ht=vt[m],gt=m),s="multi_line_text"===gt,l=K.getDerivedFromVars(L.paddings),R(),R=a(l,(t=>p=t)),Vt(h)&&(ft=`calc(${h*(at||1.25)+"em"} + ${X(mt(null==p?void 0:p.top,0)+mt(null==p?void 0:p.bottom,0))})`),u=K.getDerivedFromVars(L.accessibility),B(),B=a(u,(t=>g=t)),(null==g?void 0:g.description)?bt=g.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ct,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":ft},B(),R(),f(),b(),_(),$(),x(),C(),A(),D(),P(),M(),O(),U(),rt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("input",qe,c),style:d,customDescription:!0,customActions:"input",json:L,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${N("class",qe.input__wrapper,0)}><span${N("class",qe.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",bt,0)}${N("placeholder",o,0)}${N("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",ht,0)}${N("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",bt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",tt,0)}>`}</span>`})}`}))},Ge=O(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(W);let u,c,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),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=i,c=o,d=u&&He[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&He[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${z(d||T,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),Ye=O(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("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"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Ze(t,e,r,n){const i=r[t.type];if(!i)return n(q(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),i=n.filter((t=>"$"!==t.charAt(0))),o=n.filter((t=>"$"===t.charAt(0)));return i.forEach((n=>{const i=r[n];"object"==typeof i&&null!==i?(e[n]=Array.isArray(i)?[]:{},t(e[n],i)):e[n]=i})),o.forEach((t=>{const n=r[t],i=a[n];if(void 0!==i){const r=t.substring(1);e[r]=i}})),e}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Xe(){}function Ke(t){return{subscribe:e=>(e(t),Xe)}}function Qe(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function tr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function er(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 rr(t){try{return Ie(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function nr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ir(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,ir.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function or(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function ar(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",c="\\",d="||",v="&&",g="==",p="!=",h=">=",f="<=",m="+",b="-",y="true",_="false",w=/^[^}]/,$=/^[^'}]/,k=/^[0-9]/,x=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=kt("@{",!1),A=kt("}",!1),V=kt("@{}",!1),j=kt("\\",!1),D={type:"any"},S=xt(["}"],!0,!1),P=kt("?",!1),T=kt(":",!1),z=kt("||",!1),M=kt("&&",!1),I=kt("==",!1),O=kt("!=",!1),N=kt(">=",!1),J=kt(">",!1),U=kt("<=",!1),B=kt("<",!1),R=kt("+",!1),L=kt("-",!1),W=kt("/",!1),q=kt("*",!1),H=kt("%",!1),G=kt("!",!1),Y=kt("(",!1),Z=kt(")",!1),X=kt(",",!1),K=Et("string"),Q=kt("'",!1),tt=xt(["'","}"],!0,!1),et=Et("integer"),rt=xt([["0","9"]],!1,!1),nt=Et("number"),it=kt(".",!1),ot=kt("e",!1),at=kt("E",!1),st=Et("boolean"),lt=kt("true",!1),ut=kt("false",!1),ct=xt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=xt([["a","z"],["A","Z"],"_"],!1,!1),gt=Et("whitespace"),pt=xt([" ","\t","\r","\n"],!1,!1),ht=function(t){return er(t)},ft=0,mt=0,bt=[{line:1,column:1}],yt=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 kt(t,e){return{type:"literal",text:t,ignoreCase:e}}function xt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=bt[e];if(n)return n;for(r=e-1;!bt[r];)r--;for(n={line:(n=bt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return bt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ft<yt||(ft>yt&&(yt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Rt(),(e=Dt())!==n?(Rt(),mt=t,t=e):(ft=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=Dt())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=nr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,i,o,a,s;return e=ft,(r=St())!==n?(Rt(),63===t.charCodeAt(ft)?(i="?",ft++):(i=n,0===wt&&At(P)),i!==n?(Rt(),(o=Dt())!==n?(Rt(),58===t.charCodeAt(ft)?(a=":",ft++):(a=n,0===wt&&At(T)),a!==n?(Rt(),(s=Dt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=St()),e}function St(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Pt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function Pt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Tt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function Tt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=zt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Mt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=It())!==n){for(i=[],o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function It(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Ot())!==n){for(i=[],o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function Ot(){var e,r,i;return(e=Ut())===n&&(e=Jt())===n&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=n,0===wt&&At(R)),r===n&&(45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)))),r!==n?(Rt(),(i=Ot())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ft,(r=Bt())!==n?(Rt(),40===t.charCodeAt(ft)?(i="(",ft++):(i=n,0===wt&&At(Y)),i!==n?(Rt(),o=function(){var e,r,i,o,a,s,l;if(e=ft,(r=Dt())!==n){for(i=[],o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=Dt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=Dt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);mt=e,l=i,e=[r,...l]}else ft=e,e=n;return e===n&&(e=Rt()),e}(),o!==n?(Rt(),41===t.charCodeAt(ft)?(a=")",ft++):(a=n,0===wt&&At(Z)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,(r=Bt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ft,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=er(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Ut())===n&&(e=Jt())===n&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(st)),e}(),e===n&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=n,0===wt&&At(Y)),r!==n&&(i=Dt())!==n?(41===t.charCodeAt(ft)?(o=")",ft++):(o=n,0===wt&&At(Z)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=Dt())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ft)?(i="'",ft++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=nr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Jt(){var e,r,i,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:rr($t())}):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Ut(){var e,r,i,o,a,s,l,u,c,d;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=n,0===wt&&At(it)),o!==n){if(a=[],k.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),k.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=n,0===wt&&At(R)),u===n&&(45===t.charCodeAt(ft)?(u=b,ft++):(u=n,0===wt&&At(L))),u===n&&(u=null),c=[],k.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),k.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt));else c=n;c!==n?s=l=[l,u,c]:(ft=s,s=n)}else ft=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=n}else ft=e,e=n;if(e===n){if(e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=n,0===wt&&At(R)),a===n&&(45===t.charCodeAt(ft)?(a=b,ft++):(a=n,0===wt&&At(L))),a===n&&(a=null),s=[],k.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),k.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=n)}else ft=e,e=n;else ft=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Bt(){var e,r,i,o,a;if(wt++,e=ft,r=ft,wt++,i=function(){var e,r,i,o;return e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ft,wt++,x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ft=i,i=n),i!==n?e=r=[r,i]:(ft=e,e=n)):(ft=e,e=n),e}(),wt--,i===n?r=void 0:(ft=r,r=n),r!==n)if(E.test(t.charAt(ft))?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],x.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),x.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=n;else ft=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Rt(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));r!==n;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));return wt--,r=n,0===wt&&At(gt),e}if((r=a())!==n&&ft===t.length)return r;throw r!==n&&ft<t.length&&At({type:"end"}),function(t,e,r){return new ir(ir.buildMessage(t,e),t,e,r)}(_t,yt<t.length?t.charAt(yt):null,yt<t.length?Ft(yt,yt+1):Ft(yt,yt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(ir,Error),ir.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,s=or("",i.line.toString().length," "),l=n[i.line-1],u=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+or("",i.column-1," ")+or("",u,"^")}else e+="\n at "+o}return e},ir.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."};const sr=new Map,lr=new Map;function ur(t,e,r){const n={args:e,cb:r},i=sr.get(t)||[];sr.has(t)||sr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");lr.set(o,n)}function cr(t,e){let r=t.args.length,n=t.args.length;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function dr(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=>{dr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":dr(t.left,e),dr(t.right,e);break;case"UnaryExpression":dr(t.argument,e);break;case"ConditionalExpression":dr(t.test,e),dr(t.consequent,e),dr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{dr(t,e)}))}}function vr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function gr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function pr(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 gr(t.value);if("color"===t.type)return $r(wr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function hr(t){let e=pr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function fr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function mr(t,e){if(Pe)return Ie(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function br(t,e){if(e<Me||e>ze)throw new Error("Integer overflow.");!Pe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function yr(t){const e=[];return dr(t,{Variable(t){e.push(t.id.name)}}),e}function _r(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function wr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function $r(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 K(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function kr(t){return $r(wr(t))}const xr=Number.MAX_VALUE,Er=Number.MIN_VALUE,Cr="string",Fr="integer",Ar="number",Vr="boolean",jr="color",Dr="datetime";function Sr(t,e){return{type:Cr,value:pr(e)}}function Pr(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ar,value:r}}function Tr(t,e,r,n){const i=t.variables.get(e.value);let o;return o=i&&i.getType()===n?i.getValue():r.value,"color"===n&&(o=kr(o)),{type:n,value:o}}function zr(t,e,r){return Tr(t,e,r,r.type)}function Mr(t,e,r){return Tr(t,e,r,"color")}function Ir(t,e,r){return Tr(t,e,r,"url")}const Or=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Fr,value:n}},Nr=Or("getUTCFullYear"),Jr=Or("getUTCMonth"),Ur=Or("getUTCDate"),Br=Or("getUTCDay"),Rr=Or("getUTCHours"),Lr=Or("getUTCMinutes"),Wr=Or("getUTCSeconds"),qr=Or("getUTCMilliseconds");function Hr(t,e,r,n){if(!n.value.length)return t.warnings.push(q(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===Cr?e.value:pr(e);for(;i.length+o.length<r.value;)i+=n.value;return i.length>0&&i.length+o.length>r.value&&(i=i.substring(0,Number(r.value)-Number(o.length))),i}function Gr(t,e,r,n){const i=Hr(t,e,r,n);return{type:Cr,value:i+pr(e)}}function Yr(t,e,r,n){const i=Hr(t,e,r,n);return{type:Cr,value:pr(e)+i}}function Zr(t){return(e,r)=>{const n=wr(r.value);return{type:Ar,value:n[t]/255}}}function Xr(t){return(e,r,n)=>{const i=wr(r.value);return i[t]=255*n.value,{type:jr,value:$r(i)}}}const Kr=Zr("a"),Qr=Zr("r"),tn=Zr("g"),en=Zr("b"),rn=Xr("a"),nn=Xr("r"),on=Xr("g"),an=Xr("b");function sn(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Ie(e.value)/Ie(r);return br(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Ie(i)%Ie(n)),{type:Fr,value:i}}function ln(t){return t.map(hr).join(", ")}ur("toString",[Fr],Sr),ur("toString",[Ar],Sr),ur("toString",[Vr],Sr),ur("toString",[jr],Sr),ur("toString",["url"],Sr),ur("toNumber",[Fr],Pr),ur("toNumber",[Cr],Pr),ur("toInteger",[Ar],(function(t,e){if(e.value>ze||e.value<Me)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Fr,value:Ie(r)}})),ur("toInteger",[Cr],(function(t,e){let r;try{r=Ie(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>ze||r<Me)throw new Error("Unable to convert value to Integer.");return{type:Fr,value:r}})),ur("toInteger",[Vr],(function(t,e){return{type:Fr,value:Ie(e.value?1:0)}})),ur("toBoolean",[Fr],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Vr,value:r}})),ur("toBoolean",[Cr],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Vr,value:"true"===e.value?1:0}})),ur("toColor",[Cr],(function(t,e){return{type:jr,value:kr(e.value)}})),ur("toUrl",[Cr],(function(t,e){return{type:"url",value:e.value}})),ur("encodeUri",[Cr],(function(t,e){try{return{type:Cr,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),ur("decodeUri",[Cr],(function(t,e){try{return{type:Cr,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),ur("getIntegerValue",[Cr,Fr],zr),ur("getNumberValue",[Cr,Ar],zr),ur("getBooleanValue",[Cr,Vr],zr),ur("getStringValue",[Cr,Cr],zr),ur("getColorValue",[Cr,jr],Mr),ur("getColorValue",[Cr,Cr],Mr),ur("getUrlValue",[Cr,"url"],Ir),ur("getUrlValue",[Cr,Cr],Ir),ur("parseUnixTime",[Fr],(function(t,e){return{type:Dr,value:new Date(1e3*Number(e.value))}})),ur("nowLocal",[],(function(){return{type:Dr,value:new Date}})),ur("addMillis",[Dr,Fr],(function(t,e,r){return{type:Dr,value:new Date(e.value.getTime()+Number(r.value))}})),ur("setYear",[Dr,Fr],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Dr,value:n}})),ur("setMonth",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMonth(n-1),{type:Dr,value:i}})),ur("setDay",[Dr,Fr],(function(t,e,r){const n=new Date(e.value),i=Number(r.value);if(i<=0&&-1!==i||i>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${i} for date ${pr(e)}.`);return n.setUTCDate(-1===i?0:i),{type:Dr,value:n}})),ur("setHours",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const i=new Date(e.value);return i.setUTCHours(n),{type:Dr,value:i}})),ur("setMinutes",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMinutes(n),{type:Dr,value:i}})),ur("setSeconds",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCSeconds(n),{type:Dr,value:i}})),ur("setMillis",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMilliseconds(n),{type:Dr,value:i}})),ur("getYear",[Dr],Nr),ur("getMonth",[Dr],Jr),ur("getDay",[Dr],Ur),ur("getDayOfWeek",[Dr],Br),ur("getHours",[Dr],Rr),ur("getMinutes",[Dr],Lr),ur("getSeconds",[Dr],Wr),ur("getMillis",[Dr],qr),ur("getIntervalSeconds",[Fr],(function(t,e){return sn(t,e,1e3,60)})),ur("getIntervalTotalSeconds",[Fr],(function(t,e){return sn(t,e,1e3)})),ur("getIntervalMinutes",[Fr],(function(t,e){return sn(t,e,6e4,60)})),ur("getIntervalTotalMinutes",[Fr],(function(t,e){return sn(t,e,6e4)})),ur("getIntervalHours",[Fr],(function(t,e){return sn(t,e,36e5,24)})),ur("getIntervalTotalHours",[Fr],(function(t,e){return sn(t,e,36e5)})),ur("getIntervalTotalDays",[Fr],(function(t,e){return sn(t,e,864e5)})),ur("getIntervalTotalWeeks",[Fr],(function(t,e){return sn(t,e,6048e5)})),ur("len",[Cr],(function(t,e){return{type:Fr,value:e.value.length}})),ur("contains",[Cr,Cr],(function(t,e,r){return{type:Vr,value:e.value.includes(r.value)?1:0}})),ur("substring",[Cr,Fr,Fr],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Cr,value:e.value.substring(Number(r.value),Number(n.value))}})),ur("replaceAll",[Cr,Cr,Cr],(function(t,e,r,n){let i;return i=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:Cr,value:i}})),ur("index",[Cr,Cr],(function(t,e,r){return{type:Fr,value:e.value.indexOf(r.value)}})),ur("lastIndex",[Cr,Cr],(function(t,e,r){return{type:Fr,value:e.value.lastIndexOf(r.value)}})),ur("trim",[Cr],(function(t,e){return{type:Cr,value:e.value.trim()}})),ur("trimLeft",[Cr],(function(t,e){return{type:Cr,value:e.value.replace(/^\s+/,"")}})),ur("trimRight",[Cr],(function(t,e){return{type:Cr,value:e.value.replace(/\s+$/,"")}})),ur("toUpperCase",[Cr],(function(t,e){return{type:Cr,value:e.value.toUpperCase()}})),ur("toLowerCase",[Cr],(function(t,e){return{type:Cr,value:e.value.toLowerCase()}})),ur("padStart",[Cr,Fr,Cr],Gr),ur("padStart",[Fr,Fr,Cr],Gr),ur("padEnd",[Cr,Fr,Cr],Yr),ur("padEnd",[Fr,Fr,Cr],Yr),ur("div",[Fr,Fr],(function(t,e,r){if(r.value===Oe)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=mr(0,n),br(t,n),{type:Fr,value:n}})),ur("div",[Ar,Ar],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:Ar,value:n}})),ur("mod",[Fr,Fr],(function(t,e,r){if(r.value===Oe)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=mr(0,n),br(t,n),{type:Fr,value:n}})),ur("mod",[Ar,Ar],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:Ar,value:n}})),ur("mul",[{type:Fr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Oe;for(let n=1;n<e.length;++n)r*=e[n].value,r=mr(0,r),br(t,r);return{type:Fr,value:r}})),ur("mul",[{type:Ar,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:Ar,value:r}})),ur("sub",[{type:Fr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Oe;for(let n=1;n<e.length;++n)r-=e[n].value,r=mr(0,r),br(t,r);return{type:Fr,value:r}})),ur("sub",[{type:Ar,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:Ar,value:r}})),ur("sum",[{type:Fr,isVararg:!0}],(function(t,...e){let r=Oe;for(let n=0;n<e.length;++n)r+=e[n].value,r=mr(0,r),br(t,r);return{type:Fr,value:r}})),ur("sum",[{type:Ar,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Ar,value:r}})),ur("abs",[Fr],(function(t,e){const r=Ne(e.value);return br(t,r),{type:e.type,value:r}})),ur("abs",[Ar],(function(t,e){const r=Math.abs(e.value);return{type:Ar,value:r}})),ur("max",[{type:Fr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:Fr,value:r}})),ur("max",[{type:Ar,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Ar,value:Math.max(...e.map((t=>t.value)))}})),ur("min",[{type:Fr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:Fr,value:r}})),ur("min",[{type:Ar,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Ar,value:Math.min(...e.map((t=>t.value)))}})),ur("maxNumber",[],(function(){return{type:Ar,value:xr}})),ur("minNumber",[],(function(){return{type:Ar,value:Er}})),ur("maxInteger",[],(function(t){return br(t,ze),{type:Fr,value:ze}})),ur("minInteger",[],(function(t){return br(t,Me),{type:Fr,value:Me}})),ur("round",[Ar],(function(t,e){const r=Math.sign(e.value);return{type:Ar,value:r*Math.round(Math.abs(e.value))}})),ur("floor",[Ar],(function(t,e){return{type:Ar,value:Math.floor(e.value)}})),ur("ceil",[Ar],(function(t,e){return{type:Ar,value:Math.ceil(e.value)}})),ur("signum",[Fr],(function(t,e){return{type:Fr,value:Je(e.value)}})),ur("signum",[Ar],(function(t,e){return{type:Ar,value:Math.sign(e.value)}})),ur("copySign",[Fr,Fr],(function(t,e,r){let n;if(r.value===Oe)n=e.value;else if(e.value===Oe)n=0;else{const t=Je(r.value);n=Ne(e.value)*t}return br(t,n),{type:Fr,value:n}})),ur("copySign",[Ar,Ar],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const i=Math.abs(e.value)*n;return{type:Ar,value:i}})),ur("getColorAlpha",[Cr],Kr),ur("getColorAlpha",[jr],Kr),ur("getColorRed",[Cr],Qr),ur("getColorRed",[jr],Qr),ur("getColorGreen",[Cr],tn),ur("getColorGreen",[jr],tn),ur("getColorBlue",[Cr],en),ur("getColorBlue",[jr],en),ur("setColorAlpha",[Cr,Ar],rn),ur("setColorAlpha",[jr,Ar],rn),ur("setColorRed",[Cr,Ar],nn),ur("setColorRed",[jr,Ar],nn),ur("setColorGreen",[Cr,Ar],on),ur("setColorGreen",[jr,Ar],on),ur("setColorBlue",[Cr,Ar],an),ur("setColorBlue",[jr,Ar],an),ur("rgb",[Ar,Ar,Ar],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:jr,value:$r(i)}})),ur("argb",[Ar,Ar,Ar,Ar],(function(t,e,r,n,i){const o={a:255*e.value,r:255*r.value,g:255*n.value,b:255*i.value};return{type:jr,value:$r(o)}}));const un={StringLiteral:function(t,e){return{type:Cr,value:e.value}},NumberLiteral:function(t,e){return{type:Ar,value:e.value}},IntegerLiteral:function(t,e){return br(t,e.value),{type:Fr,value:e.value}},BooleanLiteral:function(t,e){return{type:Vr,value:e.value?1:0}},UnaryExpression:function(t,e){const r=vr(cn(t,e.argument));switch(e.operator){case"!":if(r.type===Vr)return{type:Vr,value:r.value?0:1};_r(`${e.operator}${hr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Fr){const e=r.value*Ie(n);return br(t,e),{type:Fr,value:e}}if(r.type===Ar)return{type:Ar,value:r.value*n};_r(`${e.operator}${hr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=vr(cn(t,e.test));if(r.type===Vr)return r.value?cn(t,e.consequent):cn(t,e.alternate);_r(`${hr(r)} ? ${hr(cn(t,e.consequent))} : ${hr(cn(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 cn(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=pr(cn(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Cr,value:r}},LogicalExpression:function(t,e){const r=vr(cn(t,e.left));if(r.type!==Vr&&_r(`${hr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Vr,value:0};const n=vr(cn(t,e.right));return n.type!==Vr&&_r(`${hr(r)} ${e.operator} ${hr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${fr(n.type)}.`),{type:Vr,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=cn(t,e.left),i=cn(t,e.right);if(n.type!==i.type&&_r(`${hr(n)} ${e.operator} ${hr(i)}`,`Operator '${r}' cannot be applied to different types: ${fr(n.type)} and ${fr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Dr&&r.type===Dr?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Vr,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ar&&e.type!==Fr&&e.type!==Dr&&_r(`${hr(e)} ${t} ${hr(r)}`,`Operator '${t}' cannot be applied to ${fr(e.type)} type.`);const i=e.type===Dr?e.value.getTime():e.value,o=r.type===Dr?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Vr,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==Cr&&r.type!==Ar&&r.type!==Fr&&_r(`${hr(r)} ${e} ${hr(n)}`,`Operator '${e}' cannot be applied to ${fr(r.type)} type.`),r.type===Cr)return"-"===e&&_r(`${hr(r)} - ${hr(n)}`,`Operator '${e}' cannot be applied to ${fr(r.type)} type.`),{type:Cr,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===Fr)try{i=mr(0,i),br(t,i)}catch(t){_r(`${hr(r)} ${e} ${hr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let i;if(r.type!==Fr&&r.type!==Ar&&_r(`${hr(r)} ${e} ${hr(n)}`,`Operator '${e}' cannot be applied to ${fr(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&_r(`${hr(r)} ${e} ${hr(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===Fr)try{i=mr(0,i),br(t,i)}catch(t){_r(`${hr(r)} ${e} ${hr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n;const i=e.arguments.map((e=>cn(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(lr.has(o))n=lr.get(o);else{const t=function(t,e){const r=sr.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=cr(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t||"type"in t&&"missing"===t.type){const e=i.map((t=>fr(t.type))).join(", "),n=`${r}(${ln(i)})`;"few"===t.type&&0===i.length?_r(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?_r(n,`Function '${r}' has no matching override for given argument types: ${e}.`):_r(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){_r(`${r}(${ln(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function cn(t,e){if(e.type in un)return un[e.type](t,e);throw new Error("Unsupported expression")}function dn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(dr(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const n=cn(r,e);return r.safeIntegerOverflow&&r.warnings.push(q(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class vn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return dr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=dn(t,this.ast);r.warnings.forEach(e);const n=r.result;if("error"===n.type)return void e(q(new Error("Expression execution error"),{additional:{message:n.value}}));const i=n.value;if(i instanceof Date)return gr(i);if("boolean"===n.type)return Boolean(i);if("color"===n.type){const t=tt(String(i));if(t)return $r(t);e(q(new Error("Expression execution error")))}return"integer"===n.type?i>2147483647||i<-2147483648?void e(q(new Error("Expression result is out of 32-bit int range"))):Number(i):i}catch(t){return void e(q(new Error("Expression execution error")))}}}function gn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=ar(t,{startRule:"JsonStringContents"}),n=yr(r);return e.vars.push(...n),new vn(r)}catch(e){return void r(q(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>gn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=gn(t[i],e,r);return n}}var n;return t}function pn(t,e,r){if(t){if(t instanceof vn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>pn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=pn(t[i],e,r);return n}}return t}function hn(t,e){const r={vars:[],hasExpression:!1},n=gn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>pn(n,t,e)}}const fn={pagers:function(){return R(new Map)}},mn=new Map,bn=new Map;function yn(t){const e=mn.get(t)||R("");return mn.has(t)||mn.set(t,e),e}function _n(t){const e=bn.get(t)||new Map;return bn.has(t)||bn.set(t,e),e}class wn{setVariable(t){const e=t.getName(),r=_n(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),yn(this).set(e)}getVariable(t){return _n(this).get(t)}}function $n(){return new wn}function kn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const xn=new Set(["start","stop","pause","resume","cancel","reset"]);class En{constructor(t){kn(this,"timers",new Map),kn(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(q(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(q(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&xn.has(e)))return void this.logError(q(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),i=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-i)%r,e()}),i)};e()}}start(t){if("running"===t.state)return void this.logError(q(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(q(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(q(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(q(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(q(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(q(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(q(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(q(new Error("The timer is already running"))):this.logError(q(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 Cn=O(((t,e,r,n)=>{let i,o;var s,l,u,v;let{id:g}=e,{json:p={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new wn}=e,{mix:b=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:k}=e,{onCustomAction:x}=e,{onComponent:E}=e,C=R("desktop"===h);if(o=a(C,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function D(){}const S=new Set(w);let P=!1;p||(P=!0,Y(q(new Error('"json" prop is required')))),g||(P=!0,Y(q(new Error('"id" prop is required'))));let T=function(t){if(!t)return q(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return q(new Error("Missing card"));if(!e.states||!e.states.length)return q(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in He)return q(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return q(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return q(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const M=p.templates||{};T&&(P=!0,Y(T));const I={stateChange:!1},O=yn(m),N=_n(m),J=new Map,U=new Map,B=new Map;let H=null;function G(t){const e=hn(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 Z(t,e){k&&k({type:t,action:e})}let X=0;function K(t){return`${g}-${X++}`}let Q={},tt={};function et(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=dt,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const n=r[t],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=at(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=at(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=at(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=U.get(r);t?t.set(i):Y(q(new Error("Cannot find variable"),{additional:{name:r}}))}else Y(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=n.get("action"),a=n.get("id");H?H.execTimerAction(a,o):Y(q(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:Y(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){Y(q(t,{additional:{url:e}}))}}async function nt(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=lt(i);if(t)if(ut(t,S)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(et(n),await y()):n.log_id&&(it(n),await y())}}t.forEach((t=>{t.log_id&&Z("click",t)}))}}function it(t){null==x||x(t)}const ot=new Map;function at(t){if(ot.has(t))return ot.get(t);Y(q(new Error("Missing instance with id"),{additional:{id:t}}))}const st=new Map;function ct(t){for(const e of t)U.has(e)&&t.delete(e);return t}d(W,{logError:Y,logStat:Z,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}=Ze(t,e,M,Y)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:K,genClass:function(t){return`divkit-${K()}`},execAction:et,execAnyActions:nt,execCustomAction:it,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){ot.has(t)?Y(q(new Error("Duplicate instance id"),{additional:{id:t}})):ot.set(t,e)},unregisterInstance:function(t){ot.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(tt[r]=tt[r]||0,++tt[r],Q[r])return Q[r];const n=`${K()}-svg-filter`;return Q=Object.assign(Object.assign({},Q),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;tt[r]&&0==--tt[r]&&(Q=Object.keys(Q).reduce(((t,e)=>(tt[e]&&(t[e]=Q[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Ke(t);const e=hn(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(rt),(()=>e.applyVars(U))):e.hasExpression?Ke(e.applyVars(U)):Ke(t)},getJsonWithVars:G,getStore:function(t){return st.has(t)||function(t){st.has(t)||st.set(t,fn[t]())}(t),st.get(t)},getVariable:function(t,e){const r=U.get(t);if(r){const n=r.getType();if(n!==e)return void Y(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return S},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),d(Ft,{hasAction:()=>!1});const dt={setState(t){throw new Error("Not implemented")},getChild(t){if(gt&&gt.has(t))return gt.get(t);Y(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let gt=null;d(vt,{registerInstance(t,e){gt||(gt=new Map),gt.has(t)?Y(q(new Error("Duplicate state with id"),{additional:{id:t}})):gt.set(t,e)},unregisterInstance(t){null==gt||gt.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const pt=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variables;Array.isArray(pt)&&pt.forEach((t=>{if(t&&t.type in Be&&t.name){if(J.has(t.name))return void Y(q(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&Y(q(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Re(t.name,t.type,t.value);J.set(t.name,e),U.set(t.name,e)}catch(e){Y(q(e,{additional:{name:t.name}}))}}}));const ht=p.palette;ht&&ht[F].forEach((t=>{if(J.has(t.name))Y(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Re(t.name,"color",t.color);J.set(t.name,e),U.set(t.name,e)}catch(e){Y(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of N)U.has(t)||U.set(t,e);O.subscribe((t=>{if(t&&!U.has(t)){const e=N.get(t);U.set(t,e);const r=B.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const ft=null===(l=null==p?void 0:p.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(ft)&&ft.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void Y(q(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 n=ar(t.condition,{startRule:"JsonStringContents"}),i=yr(n);if(!i.length)return void Y(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return ct(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{ct(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{L(i.map((t=>U.get(t))).filter(rt),(()=>{const t=dn(U,n);return t.warnings.forEach(Y),t.result})).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=G(t);e.log_id&&et(e)})),e=Boolean(n.value)):Y(q(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){Y(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else Y(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const mt=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.timers;if(mt){const t=H=new En({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(q(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:nt});mt.forEach((e=>t.createTimer(e)))}const bt=null===(v=null==p?void 0:p.card)||void 0===v?void 0:v.states,yt=bt&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:bt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return c((()=>{H&&H.destroy()})),void 0===e.id&&r.id&&void 0!==g&&r.id(g),void 0===e.json&&r.json&&void 0!==p&&r.json(p),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!==b&&r.mix(b),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!==k&&r.onStat(k),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==x&&r.onCustomAction(x),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),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.execAction&&r.execAction&&void 0!==et&&r.execAction(et),"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(q(new Error("Unsupported theme"))),F&&(ht&&ht[F].forEach((t=>{const e=U.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&yt?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(b?` ${b}`:"",!0)}">${z(Ye,"RootSvgFilters").$$render(t,{svgFiltersMap:Q},{},{})}\n ${z(Ge,"Unknown").$$render(t,{div:yt,templateContext:{}},{},{})}</div>`:""})),Fn=Cn;function An(t){return Fn.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 Vn=e.M,jn=e.Os,Dn=e.sY;export{Vn as createGlobalVariablesController,jn as createVariable,Dn as render};
1
+ var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){}function n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}function c(t){u().$$.on_destroy.push(t)}function d(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.d(e,{M:()=>$n,Os:()=>Re,sY:()=>An}),new Set,new Map;const g=[],p=[],h=[],f=[],m=Promise.resolve();let b=!1;function y(){return b||(b=!0,m.then(k)),m}function _(t){h.push(t)}const w=new Set;let $=0;function k(){const t=s;do{for(;$<g.length;){const t=g[$];$++,l(t),x(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.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(g.length);for(;f.length;)f.pop()();b=!1,w.clear(),l(t)}function x(t){if(null!==t.fragment){t.update(),i(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 E=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"]),C=/[\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,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=J(n):r.style=J(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return i+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 n=0;n<t.length;n+=1)r+=e(t[n],n);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,n,i,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,n,i);return l(a),u}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(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 N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function J(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=J(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(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(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 n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!B.length;for(const e of i)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 i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function L(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return{subscribe:R(n,(t=>{let n=!1;const c=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?c[0]:c,t);u?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),v()}})).subscribe}}const W=Symbol("root");function q(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const H={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"},G={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 Y(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 Z(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 X(t){let e=Z(t);return"0"===e&&(e+="em"),e}function K(t,e){for(;t.length<e;)t="0"+t;return t}function Q(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=tt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>K(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function tt(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,n,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,l=2===o.length?o:o+o,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,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function et(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const rt=Boolean;function nt(t){if(1===t.length&&"solid"===t[0].type)return{color:Q(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=Q(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(rt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>Q(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:at(t.bg.scale),pos:st(t.bg),image:'url("'+et(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(rt);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=X(n.value):"relative"===n.type&&(i=it[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ot(t.bg.center_x)} ${ot(t.bg.center_y)},`+r.map((t=>Q(t))).join(",")+")"}}({bg:t}):void 0)).filter(rt).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 it={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ot(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return X(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function at(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function st(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 lt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function ut(t,e){return e.has(t)}function ct(t,e){e&&t.push(e)}function dt(t,e,r){const n=[];ct(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ct(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const vt=Symbol("state");function gt(t){return Z(t.top||0)+" "+Z(t.right||0)+" "+Z(t.bottom||0)+" "+Z(t.left||0)}function pt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function ht(t){return pt(t)&&t>=0}function ft(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]&&!ht(r[t]))return e;return gt(t)}function mt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const bt=Object.prototype.hasOwnProperty;function yt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(!bt.call(e,i)||!yt(t[i],e[i]))return!1}return!0}function _t(t,e){return yt(t,e)?e:t}function wt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function $t(t,e){const r=Number(t);return isNaN(r)?e:r}function kt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...kt(t))})):e.push(t),e}function xt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let n=0;n<r.length;++n)if(t[r[n]]&&!ht(t[r[n]]))return e;return t}function Et(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>Z((t||e)/r*10))).join(" ")}function Ct(){}const Ft=Symbol("action"),At=O(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:c=Ct}=e,{customAction:g=null}=e,{isNativeActionAnimation:p=!0}=e;const h=v(W),f=v(Ft);d(Ft,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,b="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){b=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(b="",h.logError(q(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let y=Boolean(g);return b&&!ut(lt(b),h.getBuiltinProtocols())&&(b="",y=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),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!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==g&&r.customAction(g),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),b?`<a${F([{href:D(b)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(p?"divkit-bd259":"divkit-d9099",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},S(u)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(y?` ${p?"divkit-bd259":"divkit-d9099"} divkit-c016b`:"",!0)+" "+j(null!=a&&a.length?"divkit-f0cba":"",!0)},{style:D(l)},{role:D(y?"button":null)},{tabindex:D(y?0:null)},S(u)],{})}>${n.default?n.default({}):""}</span>`}));function Vt(t){return pt(t)&&t>0}function jt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Vt(t.radius))return`blur(${X(t.radius/2)})`}else e(q(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Dt=O(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=v(W);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),i=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 n=nt([t]);"solid"===t.type&&(e["background-color"]=n.color),"gradient"===t.type&&(e["background-image"]=n.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=n.size,e["object-position"]=n.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=jt(t.filters,s.logError)))}return r})),`<span${N("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${U({"border-radius":a})}>${P(i,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}>`:`<span${N("class","divkit-b921d",0)}${N("style",Y(t.style),0)}></span>`))}</span>`})),St=Dt,Pt=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,k,x,E,C,F,A,V,j,D,S,P,T,M,I,O,J,U,B,R,L,H,K,tt,et,rt,it,ot=r,at=r,st=r,ct=r,pt=r,bt=r,yt=r,Ct=r,Ft=r,Vt=r,jt=r,Dt=r,Pt=r,Tt=r,zt=r,Mt=r,It=r;var Ot,Nt,Jt,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,{heightByAspect:te=!1}=e;const ee={left:"start",center:"center",right:"end"},re={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=v(W),ie=v(vt);let oe,ae,se,le,ue,ce,de,ve,ge,pe,he,fe={},me={},be=!1,ye=1,_e="transparent",we=0,$e={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},ke="",xe=null,Ee="",Ce={},Fe=0,Ae=0,Ve=0,je=!1,De=!1,Se={},Pe=0,Te=0,ze=0,Me=!1,Ie=!1,Oe=1;const Ne=Yt.fakeElement?[]:Lt.transition_triggers||["state_change","visibility_change"],Je=-1!==Ne.indexOf("state_change")&&Lt.id,Ue=-1!==Ne.indexOf("visibility_change")&&Lt.id;let Be,Re,Le,We,qe,He,Ge,Ye,Ze,Xe=[],Ke=[],Qe=[],tr=[],er="",rr=!1,nr="visible",ir=0,or=0;void 0===e.json&&n.json&&void 0!==Lt&&n.json(Lt),void 0===e.origJson&&n.origJson&&void 0!==Wt&&n.origJson(Wt),void 0===e.templateContext&&n.templateContext&&void 0!==qt&&n.templateContext(qt),void 0===e.cls&&n.cls&&void 0!==Ht&&n.cls(Ht),void 0===e.style&&n.style&&void 0!==Gt&&n.style(Gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==Yt&&n.layoutParams(Yt),void 0===e.customDescription&&n.customDescription&&void 0!==Zt&&n.customDescription(Zt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Xt&&n.customPaddings(Xt),void 0===e.customActions&&n.customActions&&void 0!==Kt&&n.customActions(Kt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==Qt&&n.additionalPaddings(Qt),void 0===e.heightByAspect&&n.heightByAspect&&void 0!==te&&n.heightByAspect(te),o=ne.getDerivedFromVars(Lt.border),It(),It=a(o,(t=>it=t));{let t={},e={},r=!1,n="";if(it){if(it.has_shadow){const e=it.shadow;t["box-shadow"]=e?Z((null===(Nt=null===(Ot=e.offset)||void 0===Ot?void 0:Ot.x)||void 0===Nt?void 0:Nt.value)||0)+" "+Z((null===(Ut=null===(Jt=e.offset)||void 0===Jt?void 0:Jt.y)||void 0===Ut?void 0:Ut.value)||0)+" "+Z(null!==(Bt=e.blur)&&void 0!==Bt?Bt:2)+" "+Q(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(it.stroke&&(r=!0,ye=mt(it.stroke.width,ye),_e=Q(it.stroke.color,1,_e),e.border=`${Z(ye)} solid ${_e}`),it.corners_radius?($e=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]&&!ht(r[t]))return e;return t}(it.corners_radius,$e),e["border-radius"]=t["border-radius"]=Et($e)):it.corner_radius&&(we=mt(it.corner_radius,we),$e={"top-left":we,"top-right":we,"bottom-right":we,"bottom-left":we},e["border-radius"]=t["border-radius"]=Z(we)),r&&ye&&(it.corners_radius||it.corner_radius)){let t=Object.assign({},$e);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+ye/2})),n=Et(t)}}fe=_t(t,fe),me=_t(e,me),be=r,ke=n}s=ne.getDerivedFromVars(Lt.paddings),Mt(),Mt=a(s,(t=>rt=t)),xe=xt(rt&&!Xt?rt:void 0,xe),l=gt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((n=>{const i=t[n];i&&(r[n]=i);const o=e[n];o&&(r[n]=(r[n]||0)+o)})),r}(xe,Qt)),u=ne.getDerivedFromVars(Lt.margins),Tt(),Tt=a(u,(t=>tt=t)),Ee=ft(tt,Ee),c=ne.getDerivedFromVars(Lt.width),Dt(),Dt=a(c,(t=>H=t)),d=ne.getDerivedFromVars(Lt.alignment_horizontal),zt(),zt=a(d,(t=>et=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==H?void 0:H.type;if("fixed"===u)Fe=mt(null==H?void 0:H.value,Fe),e=Z(Fe);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,ne.logError(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.left)||0)+((null==tt?void 0:tt.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=H&&"weight"in H&&H.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==H?void 0:H.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=H;t.min_size&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),t.max_size&&ht(t.max_size.value)&&(n=Z(t.max_size.value))}"match_parent"!==u&&u||ne.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)i["halign-self"]="stretch";else{const t=et;i["halign-self"]="left"===t||"center"===t||"right"===t?ee[t]:Yt.parentHAlign||"start"}t&&(i.width=t),se=e,le=r,ue=n,Ae=o,Ve=a,Ce=_t(i,Ce),je=s,De=l}g=ne.getDerivedFromVars(Lt.height),jt(),jt=a(g,(t=>L=t)),p=ne.getDerivedFromVars(Lt.alignment_vertical),Pt(),Pt=a(p,(t=>K=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if(te);else if("fixed"===u)Pe=mt(null==L?void 0:L.value,Pe),e=Z(Pe);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)&&(i["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;(null==t?void 0:t.min_size)&&ht(t.min_size.value)&&(r=Z(t.min_size.value)),(null==t?void 0:t.max_size)&&ht(t.max_size.value)&&(n=Z(t.max_size.value))}"match_parent"===u&&ne.logError(q(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,ne.logError(q(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${X(((null==tt?void 0:tt.top)||0)+((null==tt?void 0:tt.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==L?void 0:L.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=K;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?i["valign-self"]=re[t]:i["valign-self"]=Yt.parentVAlign||"start"}t&&(i.height=t),ce=e,de=r,ve=n,Te=o,ze=a,Se=_t(i,Se),Me=s,Ie=l}var ar,sr,lr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!H||"match_parent"===H.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,b=ne.getDerivedFromVars(Lt.alpha),Vt(),Vt=a(b,(t=>R=t)),sr=Oe,Oe=!ht(ar=R)||void 0===ar||ar>1?sr:Number(ar),ge=1===Oe?void 0:Oe,_=ne.getDerivedFromVars(Lt.accessibility),Ft(),Ft=a(_,(t=>B=t)),ae=void 0,B&&!Zt&&B.description&&(ae={},ae["aria-label"]=B.description),w=ne.getDerivedFromVars(Lt.background),Ct(),Ct=a(w,(t=>U=t)),pe={},he=!1,U&&(he=U.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(ke),!he)){const t=nt(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"}Be=void 0,Je&&Lt.transition_in&&ne.isRunning("stateChange")&&(Be=!0),Le=void 0,Je&&Lt.transition_change&&ne.isRunning("stateChange")&&ie.hasTransitionChange(Lt.id)&&(Le=!0),$=ne.getDerivedFromVars(Lt.action),bt(),bt=a($,(t=>O=t)),k=ne.getDerivedFromVars(Lt.actions),yt(),yt=a(k,(t=>J=t)),x=ne.getDerivedFromVars(Lt.doubletap_actions),pt(),pt=a(x,(t=>I=t)),E=ne.getDerivedFromVars(Lt.longtap_actions),ct(),ct=a(E,(t=>M=t));{let t=J||O&&[O]||[],e=I||[],r=M||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(q(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(q(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(q(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Kt&&(t=[],e=[],r=[],ne.logError(q(new Error(`Cannot use action on component "${Kt}"`)))),Xe=t,Ke=e,Qe=r}C=ne.getDerivedFromVars(Lt.action_animation),st(),st=a(C,(t=>T=t)),T&&(tr=kt(T),er=tr.map((function(t){const e=$t(t.start_value,1),r=$t(t.end_value,1),n=mt(t.start_delay,0),i=mt(t.duration,300),o=wt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return We=e,qe=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return He=e,Ge=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ne.logError(q(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Lt.visibility),at(),at=a(F,(t=>P=t));{const t=nr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,nr);t!==e&&(!rr||"visible"!==nr&&"visible"!==e?nr=e:async function(t){nr=t;const e="visible"===t?"in":"out",r="in"===e?Lt.transition_in:Lt.transition_out;Ue&&r&&(await y(),"in"===e&&(Re=!0),ie.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,oe,e).then((()=>{"in"===e&&(Re=!1)})).catch((t=>{throw"in"===e&&(Re=!1),t})))}(e)),rr||(rr=!0)}if(A=Object.assign(Object.assign(Object.assign({},Ce),Se),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Yt.scrollSnap,"hide-on-transition-in":Be||Re||Le,visibility:nr,"has-action-animation":Boolean(er),"parent-flex":Yt.parentContainerOrientation||void 0,"parent-grid":Boolean(Yt.gridArea)||void 0}),V=ne.getDerivedFromVars(Lt.transform),ot(),ot=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};ir=$t(t.value,ir);const e="pivot-fixed"===t.type?Z(ir):`${ir}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};or=$t(r.value,or),Ye=`${e} ${"pivot-fixed"===r.type?Z(or):`${or}%`}`,Ze=`rotate(${S.rotation}deg)`}return j=je||Me?"100%":Ae||Te?0:void 0,D=Object.assign(Object.assign(Object.assign(Object.assign({},Gt),pe),fe),{width:se,"min-width":le,"max-width":ue,height:ce,"min-height":de,"max-height":ve||(null==Gt?void 0:Gt["max-height"]),"grid-area":m,padding:l,margin:Ee,opacity:ge,transition:er,"transform-origin":Ye,transform:Ze,"flex-grow":Ae||Te||void 0,"flex-shrink":Ve||ze?1:void 0,"flex-basis":j,"--divkit-animation-opacity-start":We,"--divkit-animation-opacity-end":qe,"--divkit-animation-scale-start":He,"--divkit-animation-scale-end":Ge}),ot(),at(),st(),ct(),pt(),bt(),yt(),Ct(),Ft(),Vt(),jt(),Dt(),Pt(),Tt(),zt(),Mt(),It(),De||Ie?"":`${z(At,"Actionable").$$render(t,{use:function(t){oe=t,Je&&Lt.transition_in&&ie.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{Be=!1})).catch((t=>{throw Be=!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((()=>{Le=!1})).catch((t=>{throw Le=!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 n=e.map(((t,e)=>({index:e,action:t,visible:!1,count:0,finished:!1}))),i=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)=>(i[e].visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=i[e.index],n=0===t.log_limit?1/0:t.log_limit||1;++e.count>=n&&(e.finished=!0);const o=r.getJsonWithVars(e.action),a=o.url;if(a){const t=lt(a);t&&!ut(t,r.getBuiltinProtocols())&&("div-action"===t?r.execAction(o):o.log_id&&r.execCustomAction(o))}r.logStat("visible",o)}),i[e.index].visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:o}).observe(t)}(t,{visibilityActions:e,rootCtx:ne});const r=Lt.id;r&&ie.registerChild(r);let n=null;return{destroy(){r&&ie.unregisterChild(r),n&&n.destroy()}}},cls:Ht+" "+dt("outer",G,A),style:Y(D),actions:Xe,doubleTapActions:Ke,longTapActions:Qe,attrs:ae,isNativeActionAnimation:!tr.length||(lr=tr,lr.some((t=>"native"===t.name)))},{},{default:()=>`${he?`${z(St,"OuterBackground").$$render(t,{background:U,radius:ke},{},{})}`:""}${i.default?i.default({}):""}${be?`<span${N("class",G.outer__border,0)}${N("style",Y(me),0)}></span>`:""}`})}`})),Tt=Pt,zt={"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 Mt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function It(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Ot(t,e){return It(t)||e}const Nt=O(((t,e,r,n)=>{let i,o,a,s,l;var u,c;let d,{text:v}=e,{rootFontSize:g}=e,{textStyles:p={}}=e,{singleline:h=!1}=e,{actions:f}=e,m="none",b=12,y=1.25,_="",w="",$=null;void 0===e.text&&r.text&&void 0!==v&&r.text(v),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==p&&r.textStyles(p),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";(p.underline||p.strike)&&("single"===p.underline&&"single"===p.strike?t="both":"single"===p.underline?t="underline":"single"===p.strike&&(t="strike")),m=t}return b=Mt(p.font_size,b),Vt(p.line_height)&&(y=Number(p.line_height)/b),ht(p.letter_spacing)&&(_=Z(p.letter_spacing)),d=Ot(p.font_weight,d),w=Q(p.text_color,1,w),i=p.top_offset?Z(p.top_offset):"",o=p.background?nt([p.background]):null,$=(null===(u=p.border)||void 0===u?void 0:u.stroke)&&"transparent"!==Q(p.border.stroke.color)&&Vt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=Mt(null===(c=p.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":Z(10*b/g),"line-height":y,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":$?`inset 0 0 0 ${Z($.width)} ${$.color}`:void 0,"border-radius":a?Z(a):void 0},`${i?`<span${N("class",zt["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${z(At,"Actionable").$$render(t,{cls:dt("text-range",zt,s),actions:f,style:Y(l)},{},{default:()=>`${j(v)}`})}`})),Jt=Nt;function Ut(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Bt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Rt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Lt=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,j,D,S,T,M,I,O,J,U,B,R,L=r,G=r,X=r,K=r,tt=r,et=r,rt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r,{json:ct={}}=e,{templateContext:vt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ht=v(W);let ft=!1,mt="",bt=12,yt=1.25,_t=!1,wt="",$t="",kt=!1,xt="left",Et="top",Ct="",Ft="",At=!1,jt=[],Dt=[];var St,Pt;c((()=>{Dt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==ct&&n.json(ct),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==gt&&n.origJson(gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==pt&&n.layoutParams(pt),o=ht.getDerivedFromVars(ct.text),ut(),ut=a(o,(t=>R=t)),St=R,Pt=mt,mt=String(null!=St?St:"")||Pt,mt?ft=!1:(ft=!0,ht.logError(q(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(ct.ranges),G(),G=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}),X(),X=a(u,(t=>j=t)),d=ht.getDerivedFromVars(ct.font_size),lt(),lt=a(d,(t=>B=t)),bt=Mt(B,bt),g=ht.getDerivedFromVars(ct.line_height),st(),st=a(g,(t=>U=t));{const t=U;Vt(t)?(yt=Number(t)/bt,_t=!0):_t=!1}p=ht.getDerivedFromVars(ct.max_lines),it(),it=a(p,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let n=Number(I);t=n*yt+"em",V||A||(e=n,r=!0)}wt=t,$t=e,kt=r}f=ht.getDerivedFromVars(ct.text_alignment_horizontal),at(),at=a(f,(t=>J=t)),xt=Ut(J,xt),m=ht.getDerivedFromVars(ct.text_alignment_vertical),ot(),ot=a(m,(t=>O=t)),Et=Bt(O,Et),b=!V||mt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=mt.length,y=ht.getDerivedFromVars(ct.text_color),rt(),rt=a(y,(t=>M=t)),_=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&b&&_&&(t=Q(M||V&&V[0]&&V[0].text_color,1,Ct)),Ct=t}w=ht.getDerivedFromVars(ct.truncate),et(),et=a(w,(t=>T=t)),$="none"===T?"none":"",k=ht.getDerivedFromVars(ct.text_gradient),tt(),tt=a(k,(t=>S=t));{let t="";if(S){const e=nt([S]);e.image&&(t=e.image)}Ft=t}return x=ht.getDerivedFromVars(ct.selectable),K(),K=a(x,(t=>D=t)),At=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,At),function(t,e,r){let n=[];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 i=t;let o=e||[{start:0,end:i.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<=i.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);n.push({text:i.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=Z(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=Z(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":Z(10*(Number(e.font_size)||12)/bt)};let a="";const s=t.image.tint_color,u=Rt(t.image.tint_mode,"source_in");if(s){const e=Q(t.image.tint_color);a=ht.addSvgFilter(e,u),Dt.push([e,u])}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},j)}),jt=n}(mt,V,A),E={singleline:h,multiline:kt,halign:xt,valign:Et,truncate:$},C={gradient:Boolean(Ft)},F={"font-size":Z(bt),"line-height":yt,"max-height":wt,"-webkit-line-clamp":$t,color:Ct,"background-image":Ft},L(),G(),X(),K(),tt(),et(),rt(),it(),ot(),at(),st(),lt(),ut(),ft?"":`${z(Tt,"Outer").$$render(t,{cls:dt("text",H,E)+" "+(At?"":"divkit-c016b"),json:ct,origJson:gt,templateContext:vt,layoutParams:pt},{},{default:()=>`<span${N("class",dt("text__inner",H,C),0)}${N("style",Y(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${z(Jt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",Y(e.image.wrapperStyle),0)}><img${N("class",H.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",Y({width:e.image.width,height:e.image.height,"margin-top":_t?`-${e.image.height}`:void 0,"margin-bottom":_t?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${z(Jt,"TextRangeView").$$render(t,{text:mt,rootFontSize:bt,textStyles:j,singleline:h},{},{})}`}</span>`})}`})),Wt=Lt,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 Ht(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let n;if("rounded_rectangle"===t.shape.type)i=t.shape,n={width:Number((null===(o=i.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=i.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=i.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;n=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 i,o,a,s,l;return function(t,e,r){var n;const i={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?Q(o.color):"",s=null!=o&&o.width?Number(null!==(n=o.width)&&void 0!==n?n:1):"";i.width=t.width,i.height=t.height,i.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return i.background=Q(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${Z(s)} ${a}`),i}(n,t.shape,{color:t.color,stroke:t.stroke})}function Gt(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 Yt(t,e,r){let n;return n="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],n.map(Z).join(" ")}let Zt;function Xt(){if(void 0!==Zt)return Zt;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),Zt=1===t.scrollHeight,document.body.removeChild(t),Zt}function Kt(t,e,r,n,i,o){o?t.push({top:r.bottom,left:i.left,width:i.right-i.left,height:n.top-r.bottom,style:e}):t.push({top:i.top,left:r.right,width:n.left-r.right,height:i.bottom-i.top,style:e})}function Qt(t,e,r,n){const i={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)&&Kt(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],i,n),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)Kt(t,e.style,r[o],r[o+1],i,n);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];Kt(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const te=O(((t,e,r,n)=>{let i,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,n=0,i=!1;return function(){const e=Date.now();return!n||Math.abs(e-n)>10?(n=e,r=t.apply(this,arguments)):(i||(i=!0,setTimeout((()=>{i=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!i)return;const t=i.getBoundingClientRect();d=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(G.outer__border))),r=[];for(;e.length;){const t=[],n=e.shift();t.push(n);let i=n.getBoundingClientRect(),a=i.right,s=i.bottom;for(;e.length;){let r=e[0],n=r.getBoundingClientRect();if("vertical"===o){if(n.top<s)break}else if(n.left<a)break;a=Math.max(a,n.right),s=Math.max(s,n.bottom),t.push(r),e.shift()}r.push(t)}const n=[];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&&Qt(d,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)))};n.push(r)})),s&&Qt(d,s,n,"horizontal"===o),d.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,d=[],v=!1,g=null,p=null;return c((()=>{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),i=null,(v&&i||g||p)&&(g&&(g.disconnect(),g=null),p&&(p.disconnect(),p=null),v&&i&&("undefined"!=typeof MutationObserver&&(g=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("divkit-f6e9a"))&&!(null==r?void 0:r.contains("divkit-a7719"))}))&&l()})),g.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(l),p.observe(i)))),v&&i&&l(),`\n\n<div${N("class","divkit-a7719",0)}${N("this",u,0)}>${P(d,(t=>`<div${N("class","divkit-c770e",0)}${U({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${N("class","divkit-f6e9a",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>`})),ee=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,j,D=r,S=r,T=r,M=r,I=r,O=r,N=r,J=r,U=r;var B,R,L,H,G,Y;let{json:Z={}}=e,{templateContext:X}=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"],nt=v(W);let it,ot=!1,at="vertical",st="top",lt="left",ut=null,ct=null,vt={};if(void 0===e.json&&n.json&&void 0!==Z&&n.json(Z),void 0===e.templateContext&&n.templateContext&&void 0!==X&&n.templateContext(X),void 0===e.origJson&&n.origJson&&void 0!==K&&n.origJson(K),void 0===e.layoutParams&&n.layoutParams&&void 0!==Q&&n.layoutParams(Q),o=Z.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,nt.logError(q(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=X;return({templateContext:r,json:e}=nt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=nt.getDerivedFromVars(Z.orientation),U(),U=a(l,(t=>j=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(j,at),u=nt.getDerivedFromVars(Z.content_alignment_vertical),J(),J=a(u,(t=>V=t)),st=Bt(V,st),c=nt.getDerivedFromVars(Z.content_alignment_horizontal),N(),N=a(c,(t=>A=t)),lt=Ut(A,lt),d=nt.getDerivedFromVars(Z.layout_mode),O(),O=a(d,(t=>F=t)),g="wrap"===F,p=nt.getDerivedFromVars(Z.separator),I(),I=a(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&Xt()){const t=Ht(C.style,rt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(B=C.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(R=C.show_at_end)&&void 0!==R&&R),show_between:Boolean(null===(L=C.show_between)||void 0===L||L),style:t}:null}else ut=null;if(h=nt.getDerivedFromVars(Z.line_separator),M(),M=a(h,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&Xt()){const t=Ht(E.style,rt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(H=E.show_at_start)&&void 0!==H&&H),show_at_end:Boolean(null!==(G=E.show_at_end)&&void 0!==G&&G),show_between:Boolean(null===(Y=E.show_between)||void 0===Y||Y),style:t}:null}else ct=null;f=ut||ct?function(t,e,r){const n={};return Gt(n,e,"vertical"===t),Gt(n,r,"horizontal"===t),n}(at,ut,ct):null,m=nt.getDerivedFromVars(Z.aspect),T(),T=a(m,(t=>x=t));{const t=null==x?void 0:x.ratio;it=t&&Vt(t)?t:void 0}b=nt.getDerivedFromVars(Z.width),D(),D=a(b,(t=>$=t)),y=nt.getDerivedFromVars(Z.height),S(),S=a(y,(t=>k=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],it||k&&"wrap_content"!==k.type&&("match_parent"!==k.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"),g&&(t.parentContainerWrap=!0),vt=_t(t,vt)}return _={orientation:at,valign:st,halign:lt,wrap:g},w={gap:ut||ct?Yt(at,ut,ct):void 0,"aspect-ratio":it},D(),S(),T(),M(),I(),O(),N(),J(),U(),ot?"":`${z(Tt,"Outer").$$render(t,{cls:dt("container",qt,_),style:w,json:Z,origJson:K,templateContext:X,layoutParams:Q,additionalPaddings:f,heightByAspect:Boolean(it)},{},{default:()=>`${P(s,(e=>`${z(Ge,"Unknown").$$render(t,{layoutParams:vt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||ct?`${z(te,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:ct,orientation:at},{},{})}`:""}`})}`})),re=ee,ne={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ie(t,e){return"vertical"===t||"horizontal"===t?t:e}const oe=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:b}=e;const y=v(W);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==h&&n.json(h),void 0===e.templateContext&&n.templateContext&&void 0!==f&&n.templateContext(f),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==b&&n.layoutParams(b),o=y.getDerivedFromVars(h.delimiter_style),p(),p=a(o,(t=>g=t)),_=ie(null==g?void 0:g.orientation,_),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=Q(null==g?void 0:g.color,1,w),l="horizontal"===_?"100%":Z(1),u="horizontal"===_?Z(1):"100%",c={background:w,width:l,height:u},d={orientation:_},p(),`${z(Tt,"Outer").$$render(t,{cls:dt("separator",ne,d),json:h,origJson:m,templateContext:f,layoutParams:b},{},{default:()=>s?`<span${N("class",ne.separator__inner,0)}${N("style",Y(c),0)}></span>`:""})}`})),ae={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"},se=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,j,D,S,P,T,M,I,O,J,B,R,L,H=r,G=r,Z=r,X=r,K=r,tt=r,rt=r,nt=r,it=r,ot=r,lt=r,ut=r,ct=r,vt=r,{json:gt={}}=e,{templateContext:pt}=e,{origJson:ht}=e,{layoutParams:ft}=e;const bt=v(W);let yt,_t=0,$t="rgba(0,0,0,0.08)",kt=!1,xt="",Et="none",Ct="50% 50%",Ft="0",At="source_in",Dt="",St="",Pt=0,zt=0,Mt=0,It="",Ot="";c((()=>{bt.removeSvgFilter(yt,At)})),void 0===e.json&&n.json&&void 0!==gt&&n.json(gt),void 0===e.templateContext&&n.templateContext&&void 0!==pt&&n.templateContext(pt),void 0===e.origJson&&n.origJson&&void 0!==ht&&n.origJson(ht),void 0===e.layoutParams&&n.layoutParams&&void 0!==ft&&n.layoutParams(ft),o=bt.getDerivedFromVars(gt.image_url),vt(),vt=a(o,(t=>L=t)),s=bt.getDerivedFromVars(gt.gif_url),ct(),ct=a(s,(t=>R=t)),l=L||R,_t=0,l?kt=!1:(kt=!0,bt.logError(q(new Error('Missing "image_url" for "image"')))),u=bt.getDerivedFromVars(gt.width),ut(),ut=a(u,(t=>B=t)),d="wrap_content"===(null==B?void 0:B.type),g=bt.getDerivedFromVars(gt.height),lt(),lt=a(g,(t=>J=t)),p="wrap_content"===(null==J?void 0:J.type),h=bt.getDerivedFromVars(gt.preview),ot(),ot=a(h,(t=>O=t));{const t=O;xt=t?t.startsWith("data:")?`url("${et(t)}")`:`url("data:image/jpg;base64,${et(t)}")`:""}f=bt.getDerivedFromVars(gt.placeholder_color),it(),it=a(f,(t=>I=t)),$t=Q(I,1,$t),m=bt.getDerivedFromVars(gt.scale),nt(),nt=a(m,(t=>M=t)),Et=at(M)||Et,b=bt.getDerivedFromVars({content_alignment_horizontal:gt.content_alignment_horizontal,content_alignment_vertical:gt.content_alignment_vertical}),rt(),rt=a(b,(t=>T=t)),Ct=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:st(t)}(T,Ct),y=bt.getDerivedFromVars(gt.accessibility),tt(),tt=a(y,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=bt.getDerivedFromVars(gt.aspect),K(),K=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;Ft=t&&Vt(t)?(100/Number(t)).toFixed(2):"0"}$=bt.getDerivedFromVars(gt.tint_color),X(),X=a($,(t=>D=t)),k=bt.getDerivedFromVars(gt.tint_mode),Z(),Z=a(k,(t=>j=t));{const t=D,e=t?Q(t):void 0,r=Rt(j,At);e===yt&&r===At||(bt.removeSvgFilter(yt,At),Dt=e?bt.addSvgFilter(e,r):"",yt=e,At=r)}if(x=bt.getDerivedFromVars(gt.appearance_animation),G(),G=a(x,(t=>V=t)),V&&"fade"===V.type){const t=V;St=wt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Mt=mt(t.duration,300),zt=mt(t.start_delay,0),Pt=mt(t.alpha,0)}E=bt.getDerivedFromVars(gt.filters),H(),H=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=jt(A,bt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),It=t,Ot=e}return C={aspect:"0"!==Ft,"is-width-content":d,"is-height-content":p,loaded:!1,"before-appearance":Boolean(St)&&!0},F={"background-image":xt,"background-color":xt?void 0:$t,"background-size":Et,"clip-path":Ot||void 0,"object-fit":Et,"object-position":Ct,filter:["",It].filter(Boolean).join(" "),"--divkit-appearance-interpolator":St||void 0,"--divkit-appearance-fade-start":St?Pt:void 0,"--divkit-appearance-delay":St?`${zt}ms`:void 0,"--divkit-appearance-duration":St?`${Mt}ms`:void 0},H(),G(),Z(),X(),K(),tt(),rt(),nt(),it(),ot(),lt(),ut(),ct(),vt(),kt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("image",ae,C),json:gt,origJson:ht,templateContext:pt,layoutParams:ft,customDescription:!0},{},{default:()=>C.aspect?`<span${N("class",ae["image__aspect-wrapper"],0)}${U({"padding-bottom":`${Ft}%`})}><img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}></span>`:`<img${N("class",ae.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Y(F),0)}${N("alt",_,0)}${N("aria-hidden",_?null:"true",0)}>`})}`})),le={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function ue(t){return t>0&&t<1}function ce(t){return String(Math.ceil(1e3*t)/1e3)}function de(t,e,r){if(t.some(ue)){const e=Math.max(...t.filter(ue).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${Z(n*t[e]/i)},${ce(t[e])}fr)`:t[e]?o[e]=`${ce(t[e])}fr`:o[e]="auto";return o.join(" ")}const ve=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y=r,_=r,w=r,$=r,{json:k={}}=e,{templateContext:x}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(W);let A,V,j=!1,D=1,S=[],T=[],M=[],I=[],O=0,N=!1,J="top",U="left";void 0===e.json&&n.json&&void 0!==k&&n.json(k),void 0===e.templateContext&&n.templateContext&&void 0!==x&&n.templateContext(x),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=k.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(q(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(k.column_count),$(),$=a(s,(t=>b=t)),D=Mt(b,D),l=(!j&&o||[]).map((t=>{let e=t,r=x;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=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},g="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,p="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,h=1===c&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/c:0,f=1===d&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.type)&&u.height.value?Number(u.height.value)/d:0;for(let n=e;n<e+c;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<g)&&(S[n]=g),(!T[e]||T[e]<p)&&(T[e]=p),(!M[n]||M[n]<h)&&(M[n]=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({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(q(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars(k.content_alignment_vertical),_(),_=a(u,(t=>f=t)),J=Bt(f,J),c=F.getDerivedFromVars(k.content_alignment_horizontal),y(),y=a(c,(t=>h=t)),U=Ut(h,U),d={valign:J,halign:U},g={"grid-template-columns":de(S,M,D),"grid-template-rows":de(T,I,O)},p=j||N,y(),_(),w(),$(),p?"":`${z(Tt,"Outer").$$render(t,{cls:dt("grid",le,d),json:k,origJson:E,templateContext:x,style:g,layoutParams:C},{},{default:()=>`${P(V,(e=>`${z(Ge,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),ge=ve,pe={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 he(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function fe(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const me=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,D,S,T,M,I,O,J,U=r,B=r,R=r,H=r,G=r,X=r,K=r,Q=r,tt=r,et=r,{json:rt={}}=e,{templateContext:nt}=e,{origJson:it}=e,{layoutParams:ot}=e;const at=v(W);let st,lt,ut=[],ct=null,vt=!1;at.getCustomization("galleryLeftClass"),at.getCustomization("galleryRightClass");let gt=!1;O=a(at.isDesktop,(t=>I=t));let pt,ht,bt,yt,wt=1,$t="horizontal",kt="start",xt=8,Et="",Ct=[],Ft={},At=!1,Vt={},jt=0;const Dt=fe((function(){}),50);function St(){let t=[],e=ut[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<wt;++e){const n=ut[e].children[r];n&&t.push(n)}return t}function Pt(t,e,r="smooth"){const n="horizontal"===$t,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";st.scroll({[o]:Math.max(0,t[e][i]-xt/2),behavior:r})}function zt(t){const e=St(),r=st.getBoundingClientRect(),n=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!==n)return n;const i=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=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!rt.id||gt||(null==ot?void 0:ot.fakeElement)||at.registerInstance(rt.id,{setCurrentItem(t){const e=St();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Pt(e,t)},setPreviousItem(t){const e=zt("prev"),r=St();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Pt(r,n)},setNextItem(t){const e="horizontal"===$t?st.scrollLeft+st.offsetWidth===st.scrollWidth:st.scrollTop+st.offsetHeight===st.scrollHeight,r=St();if(e&&"ring"===t)return void Pt(r,0);const n=zt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Pt(r,i)}}),c((()=>{vt=!1,rt.id&&!(null==ot?void 0:ot.fakeElement)&&at.unregisterInstance(rt.id)})),void 0===e.json&&n.json&&void 0!==rt&&n.json(rt),void 0===e.templateContext&&n.templateContext&&void 0!==nt&&n.templateContext(nt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=rt.items,(null==o?void 0:o.length)&&Array.isArray(o)?gt=!1:(gt=!0,at.logError(q(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!gt&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=at.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&vt&&!gt,l?"undefined"!=typeof ResizeObserver&&(ct=new ResizeObserver((()=>{Dt()})),ct.observe(lt)):ct&&(ct.disconnect(),ct=null),u=at.getDerivedFromVars(rt.column_count),tt(),tt=a(u,(t=>M=t)),wt=Mt(M,wt),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(s,wt),g=at.getDerivedFromVars(rt.orientation),Q(),Q=a(g,(t=>T=t)),$t=ie(T,$t),p=at.getDerivedFromVars(rt.cross_content_alignment),K(),K=a(p,(t=>S=t)),kt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,kt),h=at.getDerivedFromVars(rt.item_spacing),X(),X=a(h,(t=>D=t)),xt=mt(D,xt),pt=Z(xt),f=at.getDerivedFromVars(rt.cross_spacing),G(),G=a(f,(t=>V=t)),bt=mt(V,xt),ht=Z(bt),m=at.getDerivedFromVars(rt.paddings),H(),H=a(m,(t=>A=t)),Et=ft(A,Et),b="horizontal"===$t?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===$t?"width":"height";t.push(at.getDerivedFromVars(e.json[r]))})),yt=L(t,(t=>t)),R(),R=a(yt,(t=>F=t))}Ct=[],wt>1?Ct.push("auto"):F.forEach((t=>{!t&&"horizontal"===$t||"match_parent"===(null==t?void 0:t.type)?Ct.push("100%"):Ct.push("max-content")})),y=at.getDerivedFromVars(rt.scroll_mode),B(),B=a(y,(t=>C=t));{const t={};let e={};At=!1,(null==ot?void 0:ot.fakeElement)&&(e.fakeElement=!0),"horizontal"===$t?e.parentVAlign=kt:e.parentHAlign=kt,"paging"===C&&(At=!0,e.scrollSnap="start",t["horizontal"===$t?"scroll-padding-left":"scroll-padding-top"]=Z(xt/2)),1===wt&&(e.parentLayoutOrientation=$t),Ft=_t(t,Ft),Vt=_t(e,Vt)}return _=at.getDerivedFromVars(rt.restrict_parent_scroll),et(),et=a(_,(t=>J=t)),w={padding:Et,"grid-gap":ht},$={"grid-gap":pt,[b]:he(Ct)},k={orientation:$t,"scroll-snap":At},x=at.getDerivedFromVars(rt.default_item),U(),U=a(x,(t=>E=t)),jt=mt(E,jt),U(),B(),R(),H(),G(),X(),K(),Q(),tt(),O(),et(),"\n\n"+(gt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("gallery",pe,k),json:rt,origJson:it,templateContext:nt,layoutParams:ot,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(pe.gallery__scroller,!0)+" "+j(J?"divkit-aa145":"",!0)}"${N("style",Y(Ft),0)}${N("this",st,0)}><div${N("class",pe["gallery__items-grid"],0)}${N("style",Y(w),0)}${N("this",lt,0)}>${P(d,((e,r)=>`<div${N("class",pe.gallery__items,0)}${N("style",Y($),0)}${N("this",ut[r],0)}>${P(e,(e=>`${z(Ge,"Unknown").$$render(t,{layoutParams:Vt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===$t?"\n ":""}`})}`)})),be=me,ye={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"},_e=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,_,w,$,k,x,E,C,F,A,V,D,S=r,T=r,M=r,I=r,O=r,J=r,B=r,R=r,L=r;var H;let{json:G={}}=e,{templateContext:K}=e,{origJson:tt}=e,{layoutParams:et}=e;const rt=v(W),nt=rt.genId("tabs");let it,ot,at,st=!1,lt={};const ut=rt.getJsonWithVars(G.selected_tab);let ct,vt,pt=ut&&Number(ut)||0,bt=12,yt="",wt="",$t="",kt="",Ct="",Ft="",jt="",Dt="",St=0,Pt="",zt="",It=null,Nt=!1,Jt=!1,Ut=pt,Bt=[],Rt=[];async function Lt(t,e=!1){if(Ut=pt,pt=t,Nt||(Nt=!0,ot.style.height=Z(ot.clientHeight),at.style.transform=`translate3d(${100*-Ut}%,0,0)`),Jt=!0,async function(t){await y(),at.style.transform=`translate3d(${t}%,0,0)`}(100*-pt),function(t=!1){const e=t?Math.max(0,pt-1):Math.min(pt,Ut),r=t?Math.min(o.length-1,pt+1):Math.max(pt,Ut);Bt=Bt.map(((t,n)=>t||n>=e&&n<=r)),Rt=Rt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await y();const t=document.getElementById(`${nt}-panel-${pt}`);t&&(ot.style.height=Z(t.offsetHeight))}(),qt&&clearTimeout(qt),qt=window.setTimeout((()=>{Rt=o.map(((t,e)=>e===pt))}),400),Wt=-pt*ot.clientWidth,e){await y();const t=it.querySelector(`.${ye.tabs__item_selected}`);t&&t.focus()}}let Wt,qt=null;!G.id||st||(null==et?void 0:et.fakeElement)||rt.registerInstance(G.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)}}),c((()=>{G.id&&!(null==et?void 0:et.fakeElement)&&rt.unregisterInstance(G.id)})),void 0===e.json&&n.json&&void 0!==G&&n.json(G),void 0===e.templateContext&&n.templateContext&&void 0!==K&&n.templateContext(K),void 0===e.origJson&&n.origJson&&void 0!==tt&&n.origJson(tt),void 0===e.layoutParams&&n.layoutParams&&void 0!==et&&n.layoutParams(et),o=G.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?st=!1:(st=!0,rt.logError(q(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=rt.getDerivedFromVars(G.width),R(),R=a(s,(t=>V=t)),l=rt.getDerivedFromVars(G.height),B(),B=a(l,(t=>A=t));{let t={};(null==et?void 0:et.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==V?void 0:V.type)&&(t.parentHorizontalWrapContent=!0),A&&"wrap_content"!==A.type||(t.parentVerticalWrapContent=!0),lt=_t(t,lt)}if(!st&&(pt<0||pt>=o.length)&&(rt.logError(q(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:G.selected_tab,length:o.length}})),pt=pt<0?0:o.length-1),u=rt.getDerivedFromVars(G.tab_title_style),J(),J=a(u,(t=>F=t)),d=F||{},bt=Mt(d.font_size,bt),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/bt*10,right:(Number(t.right)||0)/bt*10,bottom:(Number(t.bottom)||0)/bt*10,left:(Number(t.left)||0)/bt*10};yt=ft(e,yt)}{const t=d.line_height;void 0!==t&&Vt(t)&&(wt=Z(t/bt*10))}{const t=d.letter_spacing;void 0!==t&&ht(t)&&($t=Z(t/bt*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(H=d.corner_radius)&&void 0!==H?H:1e3;d.corners_radius?kt=function(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!ht(i[t]))return n;return Et(t,e,r)}(d.corners_radius,t,bt,kt):ht(t)&&(kt=Z(t/bt*10))}return ct=Ot(d.active_font_weight||d.font_weight,ct),vt=Ot(d.inactive_font_weight||d.font_weight,vt),Ct=Q(d.active_text_color,1,Ct),Ft=Q(d.inactive_text_color,1,Ft),jt=Q(d.active_background_color,1,jt),Dt=Q(d.inactive_background_color,1,Dt),St=mt(d.item_spacing,St),g=rt.getDerivedFromVars(G.has_separator),O(),O=a(g,(t=>C=t)),p=rt.getDerivedFromVars(G.separator_color),I(),I=a(p,(t=>E=t)),h=rt.getDerivedFromVars(G.separator_paddings),M(),M=a(h,(t=>x=t)),C&&(E&&(Pt=Q(E,1,Pt)),x&&(zt=ft(x,zt))),f={background:Pt,margin:zt},m=rt.getDerivedFromVars(G.switch_tabs_by_content_swipe_enabled),T(),T=a(m,(t=>k=t)),b=void 0===k||Boolean(k),_=rt.getDerivedFromVars(G.restrict_parent_scroll),L(),L=a(_,(t=>D=t)),w=rt.getDerivedFromVars(G.title_paddings),S(),S=a(w,(t=>$=t)),It=xt($||void 0,It),st||(Bt=o.map(((t,e)=>e===pt)),Rt=o.map(((t,e)=>e===pt))),S(),T(),M(),I(),O(),J(),B(),R(),L(),st?"":`${z(Tt,"Outer").$$render(t,{cls:dt("tabs",ye,{}),json:G,origJson:tt,templateContext:K,layoutParams:et,customActions:"tabs"},{},{default:()=>`<div class="${j(ye.tabs__list,!0)+" "+j(D?"divkit-aa145":"",!0)}" role="tablist"${U({"--divkit-tabs-title-padding":It?gt(It):"","--divkit-tabs-font-size":Z(bt),"--divkit-tabs-paddings":yt,"--divkit-tabs-line-height":wt,"--divkit-tabs-letter-spacing":$t,"--divkit-tabs-active-font-weight":ct||"","--divkit-tabs-inactive-font-weight":vt||"","--divkit-tabs-active-text-color":Ct,"--divkit-tabs-inactive-text-color":Ft,"--divkit-tabs-active-background-color":jt,"--divkit-tabs-inactive-background-color":Dt,"--divkit-tabs-border-radius":kt,"--divkit-tabs-items-spacing":St?X(St):""})}${N("this",it,0)}>${P(o,((e,r)=>{let n=r===pt;return`\n\n ${z(At,"Actionable").$$render(t,{cls:dt("tabs__item",ye,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=et&&et.fakeElement?[]:[e.title_click_action],attrs:{id:`${nt}-tab-${r}`,"aria-controls":`${nt}-panel-${r}`,role:"tab",tabindex:!n||null!=et&&et.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=et&&et.fakeElement?null:t=>function(t,e){return pt===e||(Lt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${C?`<div${N("class",ye.tabs__separator,0)}${N("style",Y(f),0)}></div>`:""}\n <div class="${j(ye.tabs__panels,!0)+" "+j(D?"divkit-aa145":"",!0)}"${N("this",ot,0)}><div${N("class",dt("tabs__swiper",ye,{inited:Nt,animated:Jt}),0)}${N("this",at,0)}>${P(o,((e,r)=>`<div${N("class",dt("tabs__panel",ye,{visible:Rt[r]}),0)} role="tabpanel" id="${j(nt,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(nt,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Bt[r]?`${z(Ge,"Unknown").$$render(t,{div:e.div,templateContext:K,layoutParams:lt},{},{})}`:""}\n </div>`))}</div></div>`})}`})),we=_e;function $e(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),i=r-n;return t[n]*i+t[n+1]*(1-i)}}$e([.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]),$e([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 ke=O(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(W),g=v(vt);let p=new Map,h=new Set,f=!1,m=null,b=[],_=[],w=[],$=[];const k=o.div_id||o.id;let x;k?(null==l?void 0:l.fakeElement)||(g.registerInstance(k,{async setState(t){if(x===t)return;u.setRunning("stateChange",!0),new Set(h),b.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),b=[],$.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),_=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(x=t,E=e):u.logError(q(new Error("Cannot find state with id"),{additional:{stateId:t}})),await y()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(q(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(vt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(q(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return _.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(q(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return c((()=>{k&&!(null==l?void 0:l.fakeElement)&&g.unregisterInstance(k)})),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),i=o.states||[],(null==i?void 0:i.length)?f=!1:(f=!0,u.logError(q(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(x=C,E=t.find((t=>t.state_id===x))||null,E||u.logError(q(new Error("Cannot find state for default_state_id"),{additional:{selectedId:x}}))):(E=t[0],x=E.state_id)))}(i),f?"":`${z(Tt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${z(Ge,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaae",0)} aria-hidden="true"${N("this",undefined,0)}>${P(b,(e=>"direction"in e?`<div${N("class","divkit-eb860",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${N("class","divkit-e08c6",0)}>${z(Ge,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class","divkit-eb860",0)}><div${N("class","divkit-e08c6",0)}>${z(Ge,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),xe={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Ee=O(((t,e,n,i)=>{let o,s,l,u,d,g,p,h,f,m,b,y,_,w,$,k,x,E=r,C=r,F=r,A=r,V=r,D=r;var S,T,M,I,O,J,U;let{json:B={}}=e,{templateContext:R}=e,{origJson:L}=e,{layoutParams:H}=e;const G=v(W),K=G.genId("pager");let Q,tt=!1,et=!1,rt=0,nt=0,it=!1,ot="horizontal",at="",st="",lt="";function ut(t,e="smooth"){const r="horizontal"===ot,n=Q.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Q.scroll({[o]:n[i],behavior:e}),rt=t}fe((function(){if(!tt)return;const t=function(){const t=Array.from(Q.children),e=Q.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===ot?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:rt}();t!==rt&&(rt=t)}),50),B.id&&!(null==H?void 0:H.fakeElement)&&G.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');ut(t)},setPreviousItem(t){let e=rt-1;e<0&&(e="ring"===t?o.length-1:rt),ut(e)},setNextItem(t){let e=rt+1;e>o.length-1&&(e="ring"===t?0:rt),ut(e)}}),c((()=>{tt=!1,B.id&&!(null==H?void 0:H.fakeElement)&&G.unregisterInstance(B.id)})),void 0===e.json&&n.json&&void 0!==B&&n.json(B),void 0===e.templateContext&&n.templateContext&&void 0!==R&&n.templateContext(R),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),(null===(S=B.items)||void 0===S?void 0:S.length)&&Array.isArray(B.items)?et=!1:(et=!0,G.logError(q(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!et&&B.items||[]).map((t=>{let e=t,r=R;return({templateContext:r,json:e}=G.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=G.getDerivedFromVars(B.layout_mode),C(),C=a(s,(t=>_=t)),_?"percentage"!==_.type&&"fixed"!==_.type?(it=!0,G.logError(q(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):it=!1:(it=!0,G.logError(q(new Error('Empty "layout_mode" prop for div "pager"')))),l=G.getDerivedFromVars(B.orientation),V(),V=a(l,(t=>k=t)),ot=ie(k,ot),u=G.getDerivedFromVars(B.item_spacing),A(),A=a(u,(t=>$=t));{const t=null==$?void 0:$.value;t&&ht(t)&&(at=Z(t||0))}if(d=G.getDerivedFromVars(B.paddings),F(),F=a(d,(t=>w=t)),st=ft(w,st),g=G.getDerivedFromVars(B.restrict_parent_scroll),D(),D=a(g,(t=>x=t)),p="horizontal"===ot?"grid-auto-columns":"grid-auto-rows","fixed"===(null==_?void 0:_.type)){const t=X("horizontal"===ot?((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===(J=_.neighbour_page_width)||void 0===J?void 0:J.value;lt=e?`calc(100% + ${t} - 2 * ${X(e)} - 2 * ${at})`:"100%"}else if("percentage"===(null==_?void 0:_.type)){const t=null===(U=_.page_width)||void 0===U?void 0:U.value;lt=`${Number(t)}%`}return h={"grid-gap":at,padding:st,[p]:lt},f={orientation:ot},m=et||it,b=G.getStore("pagers"),E(),E=a(b,(t=>y=t)),function(t,e){const r=B.id;if(r){const o=new Map(y);n=b,y=o.set(r,{instId:K,size:t,currentItem:e,scrollToPagerItem:ut}),i=y,n.set(i)}var n,i}(o.length,rt),function(t){var e;if(t===nt)return;nt=t;const r=G.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&G.execAnyActions(r)}(rt),E(),C(),F(),A(),V(),D(),m?"":`${z(Tt,"Outer").$$render(t,{cls:dt("pager",xe,f),json:B,origJson:L,templateContext:R,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(xe.pager__items,!0)+" "+j(x?"divkit-aa145":"",!0)}"${N("style",Y(h),0)}${N("this",Q,0)}>${P(o,(e=>`<div${N("class",xe.pager__item,0)}>${z(Ge,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ce=Ee,Fe={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"},Ae=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,_,w,$,k,x,E,C,F=r,A=r,V=r,D=r,S=r,T=r,M=r,I=r,O=r;var J,B;let{json:R={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=["rounded_rectangle","circle"],Y=v(W);let X,K={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},tt={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,nt=10,it=5;if(void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),o=Y.getDerivedFromVars(R.shape),T(),T=a(o,(t=>k=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=>x=t)),c=Y.getDerivedFromVars(R.active_shape),O(),O=a(c,(t=>C=t)),d=Y.getDerivedFromVars(R.inactive_shape),I(),I=a(d,(t=>E=t)),C&&(K=Ht({type:"shape_drawable",shape:C},G,K)),E&&(tt=Ht({type:"shape_drawable",shape:E},G,tt)),!C&&!E&&k){const t=Mt(x,1.3);tt=Ht({type:"shape_drawable",shape:k,color:tt.background},G,tt),tt.background=Q($,1,tt.background),K=Object.assign(Object.assign({},tt),{width:tt.width*t,height:tt.height*t,borderRadius:tt.borderRadius*t,background:K.background}),K.background=Q(w,1,K.background)}if(g=Y.getDerivedFromVars(R.space_between_centers),A(),A=a(g,(t=>b=t)),p=Y.getDerivedFromVars(R.items_placement),V(),V=a(p,(t=>_=t)),!_||"default"!==_.type&&"stretch"!==_.type)et="default",b&&(rt=mt(b.value,rt));else if(et=_.type,"default"===et)rt=mt(null===(J=_.space_between_centers)||void 0===J?void 0:J.value,rt);else if("stretch"===et){const t=_;nt=Mt(t.max_visible_items,nt),it=mt(null===(B=t.item_spacing)||void 0===B?void 0:B.value,it)}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 y())}(m),f={placement:et},F(),A(),V(),D(),S(),T(),M(),I(),O(),`${z(Tt,"Outer").$$render(t,{cls:dt("indicator",Fe,f),json:R,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<div${N("class",Fe.indicator__scroller,0)}${N("this",undefined,0)}><div${N("class",Fe.indicator__items,0)} role="tablist"${U({margin:"default"===et?`0 ${Z(Math.max(0,K.width-tt.width)/2)}`:"","--divkit-indicator-inactive-width":Z(tt.width),"--divkit-indicator-inactive-height":Z(tt.height),"--divkit-indicator-inactive-border-radius":Z(tt.borderRadius),"--divkit-indicator-inactive-background":tt.background||"","--divkit-indicator-inactive-box-shadow":tt.boxShadow||"","--divkit-indicator-active-width":Z(K.width),"--divkit-indicator-active-height":Z(K.height),"--divkit-indicator-active-border-radius":Z(K.borderRadius),"--divkit-indicator-active-background":K.background||"","--divkit-indicator-active-box-shadow":K.boxShadow||"","--divkit-indicator-active-scale":K.width/tt.width,"--divkit-indicator-default-margin":"default"===et?`0 ${Z((rt-tt.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?Z(it):"","--divkit-indicator-stretch-max-count":"stretch"===et?nt:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?Z((nt-1)*it):""})}${N("this",undefined,0)}>${X?`${P(Array(X.size),((t,e)=>{let r=e===X.currentItem;return`\n <div class="${j(dt("indicator__item",Fe,{active:r}),!0)+" "+j("divkit-bd259",!0)}" role="tab" id="${j(X.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(X.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ve=Ae,je={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 De(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&Q(t.text_color)||"#000",i=It(t.font_weight);if(Vt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:Z(t.font_size),fontWeight:i,textColor:n};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Se(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Pe="function"==typeof BigInt;function Te(t){return Pe?BigInt(t):Number(t)}const ze=Te("9223372036854775807"),Me=Te("-9223372036854775808");function Ie(t){const e=Te(t);if(e>ze||e<Me)throw new Error("Integer overflow.");return e}const Oe=Ie(0);function Ne(t){let e=t;return e<0&&(e=-e),e}function Je(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ie(e)}class Ue{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 Be={string:class extends Ue{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Ue{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 Ue{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>ze||t<Me)throw new Error("Incorrect variable value");return Ie(t)}fromString(t){const e=Ie(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Ue{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 Ue{convertValue(t){if("string"!=typeof t||!tt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Ue{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Re(t,e,r){if(!(e in Be))throw new Error("Unsupported variable type");return new Be[e](t,r)}function Le(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const We=O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,D,S,T,M,I,O,J,B,R,L,H,G,Y,K=r,Q=r,tt=r,et=r,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r;var ct,vt,gt,pt;let{json:ft={}}=e,{templateContext:mt}=e,{origJson:bt}=e,{layoutParams:yt}=e;const _t={width:10,height:10,borderRadius:5,background:"#000"},wt=["rounded_rectangle","circle"],kt=["rounded_rectangle"],xt=v(W),Et=v(Ft);let Ct=0,At=100;const Vt=xt.getJsonWithVars(ft.thumb_value_variable),jt=xt.getJsonWithVars(ft.thumb_secondary_value_variable);H=a(Vt&&xt.getVariable(Vt,"integer")||Re("temp","integer",0),(t=>L=t)),R=a(jt&&xt.getVariable(jt,"integer")||Re("temp","integer",0),(t=>B=t));let Dt,St,Pt,zt=Se(L||0,Ct,At),Mt=Se(B||0,Ct,At),It=_t,Ot=It,Nt=_t,Jt=_t,Ut=null,Bt=null,Rt=Pt,Lt="",Wt="",qt=!1;fe((function(){}),50),void 0===e.json&&n.json&&void 0!==ft&&n.json(ft),void 0===e.templateContext&&n.templateContext&&void 0!==mt&&n.templateContext(mt),void 0===e.origJson&&n.origJson&&void 0!==bt&&n.origJson(bt),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=xt.getDerivedFromVars(ft.min_value),ut(),ut=a(o,(t=>Y=t)),s=xt.getDerivedFromVars(ft.max_value),lt(),lt=a(s,(t=>G=t)),Ct=$t(Y,Ct),At=$t(G,At);{const t=Se(L||0,Ct,At);t!==zt&&(zt=t)}{const t=Se(B||0,Ct,At);t!==Mt&&(Mt=t)}l=xt.getDerivedFromVars(ft.thumb_style),st(),st=a(l,(t=>J=t)),It=Ht(J,wt,It),u=xt.getDerivedFromVars(ft.thumb_secondary_style),at(),at=a(u,(t=>O=t)),Ot=Ht(O,wt,It),c=xt.getDerivedFromVars(ft.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Nt=Ht(I,kt,Nt),d=xt.getDerivedFromVars(ft.track_active_style),it(),it=a(d,(t=>M=t)),Jt=Ht(M,kt,Jt),g=xt.getDerivedFromVars(ft.tick_mark_active_style),nt(),nt=a(g,(t=>T=t));{let t=Ht(T,wt,_t);t!==_t&&(Ut=t)}Dt=Ut?jt?Le(Math.min(zt,Mt),Math.max(zt,Mt)+1,Ct,At,!0):Le(Ct,zt,Ct,At,!0):[],p=xt.getDerivedFromVars(ft.tick_mark_inactive_style),rt(),rt=a(p,(t=>S=t));{let t=Ht(S,wt,_t);t!==_t&&(Bt=t)}St=Bt?jt?Le(Math.min(zt,Mt),Math.max(zt,Mt)+1,Ct,At,!1):Le(zt+1,At+1,Ct,At,!0):[],h=xt.getDerivedFromVars(ft.thumb_text_style),et(),et=a(h,(t=>D=t)),Pt=De(D,Pt),f=xt.getDerivedFromVars(ft.thumb_secondary_text_style),tt(),tt=a(f,(t=>V=t)),Rt=De(V,Pt),m=xt.getDerivedFromVars(ft.accessibility),Q(),Q=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:xt.logError(q(new Error('Missing accessibility "description" for slider'),{level:"warn"})),b=xt.getDerivedFromVars(ft.secondary_value_accessibility),K(),K=a(b,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:jt&&xt.logError(q(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Et.hasAction()?(xt.logError(q(new Error('Cannot show "slider" inside component with action'))),t=!0):It===_t?(xt.logError(q(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===_t?(xt.logError(q(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===_t&&(xt.logError(q(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return y=Z(Math.max(...[It.width,Ot.width,0].filter(ht))),_=Z(Math.max(...[It.height,Ot.height,0].filter(ht))),w=(zt-Ct)/(At-Ct),$=jt?(Mt-Ct)/(At-Ct):void 0,k=void 0!==$?Math.abs($-w):w,x=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":Z(It.width),"--divkit-slider-thumb-height":Z(It.height),"--divkit-slider-thumb-secondary-width":Z(Ot.width),"--divkit-slider-thumb-secondary-height":Z(Ot.height),"--divkit-slider-text-offset-x":(null===(ct=null==Pt?void 0:Pt.offset)||void 0===ct?void 0:ct.x)?X(Pt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(vt=null==Pt?void 0:Pt.offset)||void 0===vt?void 0:vt.y)?X(Pt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(gt=null==Rt?void 0:Rt.offset)||void 0===gt?void 0:gt.x)?X(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)?X(Rt.offset.y):void 0,"--divkit-slider-tick-active-width":Ut?Z(Ut.width):void 0,"--divkit-slider-tick-active-height":Ut?Z(Ut.height):void 0,"--divkit-slider-tick-active-border-radius":Ut?Z(Ut.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Ut?void 0:Ut.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Ut?void 0:Ut.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?Z(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?Z(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?Z(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":y,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},K(),Q(),tt(),et(),rt(),nt(),it(),ot(),at(),st(),R(),H(),lt(),ut(),"\n\n"+(qt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("slider",je,C),style:E,customDescription:!0,customActions:"slider",json:ft,origJson:bt,templateContext:mt,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",je["slider__tracks-wrapper"],0)}><div${N("class",je["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",je.slider__track,0)}${U({height:Z(Nt.height),"border-radius":Z(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n <div${N("class",je["slider__active-track"],0)}${U({left:(100*x).toFixed(2)+"%",width:(100*k).toFixed(2)+"%",height:Z(Jt.height),"border-radius":Z(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${P(Dt,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(St,(t=>`<div class="${j(je.slider__tick,!0)+" "+j(je.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",je.slider__thumb,0)}${U({"border-radius":Z(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Pt?`<div${N("class",je["slider__thumb-text"],0)}><div${N("class",je["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(zt)}</div></div>`:""}</div>\n ${jt?`<div class="${j(je.slider__thumb,!0)+" "+j(je.slider__thumb_secondary,!0)}"${U({"border-radius":Z(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Rt?`<div class="${j(je["slider__thumb-text"],!0)+" "+j(je["slider__thumb-text_secondary"],!0)}"><div${N("class",je["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Rt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Rt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Rt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",je.slider__input,0)}${N("min",Ct,0)}${N("max",At,0)} step="1"${N("value",zt,0)}${N("aria-label",Lt,0)}>\n ${jt?`<input type="range"${N("class",`${je.slider__input} ${je.slider__input_secondary}`,0)}${N("min",Ct,0)}${N("max",At,0)} step="1"${N("value",Mt,0)}${N("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),qe={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"},He={text:Wt,container:re,separator:oe,image:se,gif:se,grid:ge,gallery:be,tabs:we,state:ke,pager:Ce,indicator:Ve,slider:We,input:O(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,h,f,m,b,y,_,w,$,k,x,E,C,F,A,V,D,S,P,T,M,I,O,J,U,B=r,R=r,{json:L={}}=e,{templateContext:H}=e,{origJson:G}=e,{layoutParams:Y}=e;const K=v(W);let tt;const et=K.getJsonWithVars(L.text_variable);let rt=!1;et||(rt=!0,K.logError(q(new Error('Missing "text_variable" in "input"')))),O=a(et&&K.getVariable(et,"string")||Re("temp","string",""),(t=>I=t));let nt="";M=a(K.getDerivedFromVars(L.hint_text),(t=>T=t)),P=a(K.getDerivedFromVars(L.hint_color),(t=>S=t));let it="";D=a(K.getDerivedFromVars(L.font_size),(t=>V=t));let ot,at,st=12;A=a(K.getDerivedFromVars(L.font_weight),(t=>F=t)),C=a(K.getDerivedFromVars(L.line_height),(t=>E=t)),x=a(K.getDerivedFromVars(L.letter_spacing),(t=>k=t));let lt="";$=a(K.getDerivedFromVars(L.text_color),(t=>w=t));let ut="#000";_=a(K.getDerivedFromVars(L.highlight_color),(t=>y=t));let ct="";b=a(K.getDerivedFromVars(L.keyboard_type),(t=>m=t));const vt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let gt="multi_line_text",ht="text";f=a(K.getDerivedFromVars(L.max_visible_lines),(t=>h=t));let ft="",bt="";U=a(K.getDerivedFromVars(L.select_all_on_focus),(t=>J=t)),void 0===e.json&&n.json&&void 0!==L&&n.json(L),void 0===e.templateContext&&n.templateContext&&void 0!==H&&n.templateContext(H),void 0===e.origJson&&n.origJson&&void 0!==G&&n.origJson(G),void 0===e.layoutParams&&n.layoutParams&&void 0!==Y&&n.layoutParams(Y),nt=I,o=T,it=Q(S,1,it),st=Mt(V,st),ot=Ot(F,ot);{const t=E;Vt(t)&&(at=t/st)}return pt(k)&&(lt=Z(k/st*10)),ut=Q(w,1,ut),ct=Q(y,1,ct),m&&m in vt&&(ht=vt[m],gt=m),s="multi_line_text"===gt,l=K.getDerivedFromVars(L.paddings),R(),R=a(l,(t=>p=t)),Vt(h)&&(ft=`calc(${h*(at||1.25)+"em"} + ${X(mt(null==p?void 0:p.top,0)+mt(null==p?void 0:p.bottom,0))})`),u=K.getDerivedFromVars(L.accessibility),B(),B=a(u,(t=>g=t)),(null==g?void 0:g.description)?bt=g.description:K.logError(q(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ct,"font-size":Z(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":ft},B(),R(),f(),b(),_(),$(),x(),C(),A(),D(),P(),M(),O(),U(),rt?"":`${z(Tt,"Outer").$$render(t,{cls:dt("input",qe,c),style:d,customDescription:!0,customActions:"input",json:L,origJson:G,templateContext:H,layoutParams:Y},{},{default:()=>`<span${N("class",qe.input__wrapper,0)}><span${N("class",qe.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"​":""}</span>\n ${s?`<textarea${N("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",bt,0)}${N("placeholder",o,0)}${N("this",tt,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",ht,0)}${N("class",qe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",bt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",tt,0)}>`}</span>`})}`}))},Ge=O(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(W);let u,c,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),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=i,c=o,d=u&&He[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&He[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(q(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${z(d||T,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),Ye=O(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22b",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${N("id",i[t],0)}><feFlood${N("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${N("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"${N("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Ze(t,e,r,n){const i=r[t.type];if(!i)return n(q(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const n=Object.keys(r).filter((t=>"__proto__"!==t)),i=n.filter((t=>"$"!==t.charAt(0))),o=n.filter((t=>"$"===t.charAt(0)));return i.forEach((n=>{const i=r[n];"object"==typeof i&&null!==i?(e[n]=Array.isArray(i)?[]:{},t(e[n],i)):e[n]=i})),o.forEach((t=>{const n=r[t],i=a[n];if(void 0!==i){const r=t.substring(1);e[r]=i}})),e}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Xe(){}function Ke(t){return{subscribe:e=>(e(t),Xe)}}function Qe(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function tr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function er(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 rr(t){try{return Ie(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function nr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function ir(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,ir.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function or(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function ar(t,e){var r,n={},i=(e=void 0!==e?e:{}).grammarSource,o={start:Vt,JsonStringContents:function(){var t,e,r;for(t=ft,e=[],r=jt();r!==n;)e.push(r),r=jt();return mt=t,e=ht(e)}},a=Vt,s="@{",l="}",u="@{}",c="\\",d="||",v="&&",g="==",p="!=",h=">=",f="<=",m="+",b="-",y="true",_="false",w=/^[^}]/,$=/^[^'}]/,k=/^[0-9]/,x=/^[a-zA-Z_0-9.]/,E=/^[a-zA-Z_]/,C=/^[ \t\r\n]/,F=kt("@{",!1),A=kt("}",!1),V=kt("@{}",!1),j=kt("\\",!1),D={type:"any"},S=xt(["}"],!0,!1),P=kt("?",!1),T=kt(":",!1),z=kt("||",!1),M=kt("&&",!1),I=kt("==",!1),O=kt("!=",!1),N=kt(">=",!1),J=kt(">",!1),U=kt("<=",!1),B=kt("<",!1),R=kt("+",!1),L=kt("-",!1),W=kt("/",!1),q=kt("*",!1),H=kt("%",!1),G=kt("!",!1),Y=kt("(",!1),Z=kt(")",!1),X=kt(",",!1),K=Et("string"),Q=kt("'",!1),tt=xt(["'","}"],!0,!1),et=Et("integer"),rt=xt([["0","9"]],!1,!1),nt=Et("number"),it=kt(".",!1),ot=kt("e",!1),at=kt("E",!1),st=Et("boolean"),lt=kt("true",!1),ut=kt("false",!1),ct=xt([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),dt=Et("identifier"),vt=xt([["a","z"],["A","Z"],"_"],!1,!1),gt=Et("whitespace"),pt=xt([" ","\t","\r","\n"],!1,!1),ht=function(t){return er(t)},ft=0,mt=0,bt=[{line:1,column:1}],yt=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 kt(t,e){return{type:"literal",text:t,ignoreCase:e}}function xt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Et(t){return{type:"other",description:t}}function Ct(e){var r,n=bt[e];if(n)return n;for(r=e-1;!bt[r];)r--;for(n={line:(n=bt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return bt[e]=n,n}function Ft(t,e){var r=Ct(t),n=Ct(e);return{source:i,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function At(t){ft<yt||(ft>yt&&(yt=ft,_t=[]),_t.push(t))}function Vt(){var t,e;return t=ft,Rt(),(e=Dt())!==n?(Rt(),mt=t,t=e):(ft=t,t=n),t}function jt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=Dt())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S)),o!==n)for(;o!==n;)i.push(o),w.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(S));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=nr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Dt(){var e,r,i,o,a,s;return e=ft,(r=St())!==n?(Rt(),63===t.charCodeAt(ft)?(i="?",ft++):(i=n,0===wt&&At(P)),i!==n?(Rt(),(o=Dt())!==n?(Rt(),58===t.charCodeAt(ft)?(a=":",ft++):(a=n,0===wt&&At(T)),a!==n?(Rt(),(s=Dt())!==n?(mt=e,e={type:"ConditionalExpression",test:r,consequent:o,alternate:s}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=St()),e}function St(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Pt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===d?(s=d,ft+=2):(s=n,0===wt&&At(z)),s!==n?(l=Rt(),(u=Pt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function Pt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Tt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===v?(s=v,ft+=2):(s=n,0===wt&&At(M)),s!==n?(l=Rt(),(u=Tt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=tr(r,i)}else ft=e,e=n;return e}function Tt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=zt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===g?(s=g,ft+=2):(s=n,0===wt&&At(I)),s===n&&(t.substr(ft,2)===p?(s=p,ft+=2):(s=n,0===wt&&At(O))),s!==n?(l=Rt(),(u=zt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function zt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Mt())!==n){for(i=[],o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),t.substr(ft,2)===h?(s=h,ft+=2):(s=n,0===wt&&At(N)),s===n&&(62===t.charCodeAt(ft)?(s=">",ft++):(s=n,0===wt&&At(J)),s===n&&(t.substr(ft,2)===f?(s=f,ft+=2):(s=n,0===wt&&At(U)),s===n&&(60===t.charCodeAt(ft)?(s="<",ft++):(s=n,0===wt&&At(B))))),s!==n?(l=Rt(),(u=Mt())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function Mt(){var e,r,i,o,a,s,l,u;if(e=ft,(r=It())!==n){for(i=[],o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),43===t.charCodeAt(ft)?(s=m,ft++):(s=n,0===wt&&At(R)),s===n&&(45===t.charCodeAt(ft)?(s=b,ft++):(s=n,0===wt&&At(L))),s!==n?(l=Rt(),(u=It())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function It(){var e,r,i,o,a,s,l,u;if(e=ft,(r=Ot())!==n){for(i=[],o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,a=Rt(),47===t.charCodeAt(ft)?(s="/",ft++):(s=n,0===wt&&At(W)),s===n&&(42===t.charCodeAt(ft)?(s="*",ft++):(s=n,0===wt&&At(q)),s===n&&(37===t.charCodeAt(ft)?(s="%",ft++):(s=n,0===wt&&At(H)))),s!==n?(l=Rt(),(u=Ot())!==n?o=a=[a,s,l,u]:(ft=o,o=n)):(ft=o,o=n);mt=e,e=Qe(r,i)}else ft=e,e=n;return e}function Ot(){var e,r,i;return(e=Ut())===n&&(e=Jt())===n&&(e=ft,33===t.charCodeAt(ft)?(r="!",ft++):(r=n,0===wt&&At(G)),r===n&&(43===t.charCodeAt(ft)?(r=m,ft++):(r=n,0===wt&&At(R)),r===n&&(45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)))),r!==n?(Rt(),(i=Ot())!==n?(mt=e,e={type:"UnaryExpression",operator:r,argument:i}):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=ft,(r=Bt())!==n?(Rt(),40===t.charCodeAt(ft)?(i="(",ft++):(i=n,0===wt&&At(Y)),i!==n?(Rt(),o=function(){var e,r,i,o,a,s,l;if(e=ft,(r=Dt())!==n){for(i=[],o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=Dt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);o!==n;)i.push(o),o=ft,Rt(),44===t.charCodeAt(ft)?(a=",",ft++):(a=n,0===wt&&At(X)),a!==n?(Rt(),(s=Dt())!==n?o=s:(ft=o,o=n)):(ft=o,o=n);mt=e,l=i,e=[r,...l]}else ft=e,e=n;return e===n&&(e=Rt()),e}(),o!==n?(Rt(),41===t.charCodeAt(ft)?(a=")",ft++):(a=n,0===wt&&At(Z)),a!==n?(mt=e,e={type:"CallExpression",callee:r,arguments:o}):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,(r=Bt())!==n&&(mt=e,r={type:"Variable",id:r}),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return wt++,e=ft,39===t.charCodeAt(ft)?(r="'",ft++):(r=n,0===wt&&At(Q)),r!==n?(i=function(){var t,e,r;for(t=ft,e=[],r=Nt();r!==n;)e.push(r),r=Nt();return mt=t,e=er(e)}(),39===t.charCodeAt(ft)?(o="'",ft++):(o=n,0===wt&&At(Q)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(K)),e}(),e===n&&(e=Ut())===n&&(e=Jt())===n&&(e=function(){var e,r;return wt++,e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===n&&(e=ft,t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut)),r!==n&&(mt=e,r={type:"BooleanLiteral",value:!1}),e=r),wt--,e===n&&(r=n,0===wt&&At(st)),e}(),e===n&&(e=ft,40===t.charCodeAt(ft)?(r="(",ft++):(r=n,0===wt&&At(Y)),r!==n&&(i=Dt())!==n?(41===t.charCodeAt(ft)?(o=")",ft++):(o=n,0===wt&&At(Z)),o!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n))),e}())),e}())),e}function Nt(){var e,r,i,o,a;if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n?(i=Rt(),(o=Dt())!==n?(Rt(),125===t.charCodeAt(ft)?(a=l,ft++):(a=n,0===wt&&At(A)),a!==n?(mt=e,e=o):(ft=e,e=n)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,t.substr(ft,3)===u?(r=u,ft+=3):(r=n,0===wt&&At(V)),r!==n&&(mt=e,r=""),(e=r)===n&&(e=ft,r=ft,wt++,92===t.charCodeAt(ft)?(i=c,ft++):(i=n,0===wt&&At(j)),i===n&&(39===t.charCodeAt(ft)?(i="'",ft++):(i=n,0===wt&&At(Q)),i===n&&(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)))),wt--,i===n?r=void 0:(ft=r,r=n),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=$t()):(ft=e,e=n)):(ft=e,e=n),e===n))){if(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n){if(i=[],$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt)),o!==n)for(;o!==n;)i.push(o),$.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(tt));else i=n;i!==n?(125===t.charCodeAt(ft)?(o=l,ft++):(o=n,0===wt&&At(A)),o!==n?(mt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(ft=e,e=n)):(ft=e,e=n)}else ft=e,e=n;e===n&&(e=ft,t.substr(ft,2)===s?(r=s,ft+=2):(r=n,0===wt&&At(F)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.substr(ft,2)===s?(i=s,ft+=2):(i=n,0===wt&&At(F)),i!==n?(mt=e,e=i):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n?(t.length>ft?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(D)),i!==n?(mt=e,e=nr(i)):(ft=e,e=n)):(ft=e,e=n),e===n&&(e=ft,92===t.charCodeAt(ft)?(r=c,ft++):(r=n,0===wt&&At(j)),r!==n&&(mt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Jt(){var e,r,i,o;if(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;return i!==n?(mt=e,e={type:"IntegerLiteral",value:rr($t())}):(ft=e,e=n),wt--,e===n&&(r=n,0===wt&&At(et)),e}function Ut(){var e,r,i,o,a,s,l,u,c,d;for(wt++,e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));o!==n;)i.push(o),k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));if(46===t.charCodeAt(ft)?(o=".",ft++):(o=n,0===wt&&At(it)),o!==n){if(a=[],k.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt)),s!==n)for(;s!==n;)a.push(s),k.test(t.charAt(ft))?(s=t.charAt(ft),ft++):(s=n,0===wt&&At(rt));else a=n;if(a!==n){if(s=ft,101===t.charCodeAt(ft)?(l="e",ft++):(l=n,0===wt&&At(ot)),l===n&&(69===t.charCodeAt(ft)?(l="E",ft++):(l=n,0===wt&&At(at))),l!==n){if(43===t.charCodeAt(ft)?(u=m,ft++):(u=n,0===wt&&At(R)),u===n&&(45===t.charCodeAt(ft)?(u=b,ft++):(u=n,0===wt&&At(L))),u===n&&(u=null),c=[],k.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt)),d!==n)for(;d!==n;)c.push(d),k.test(t.charAt(ft))?(d=t.charAt(ft),ft++):(d=n,0===wt&&At(rt));else c=n;c!==n?s=l=[l,u,c]:(ft=s,s=n)}else ft=s,s=n;s===n&&(s=null),mt=e,e={type:"NumberLiteral",value:parseFloat($t())}}else ft=e,e=n}else ft=e,e=n;if(e===n){if(e=ft,45===t.charCodeAt(ft)?(r=b,ft++):(r=n,0===wt&&At(L)),r===n&&(r=null),i=[],k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt)),o!==n)for(;o!==n;)i.push(o),k.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(rt));else i=n;if(i!==n)if(101===t.charCodeAt(ft)?(o="e",ft++):(o=n,0===wt&&At(ot)),o===n&&(69===t.charCodeAt(ft)?(o="E",ft++):(o=n,0===wt&&At(at))),o!==n){if(43===t.charCodeAt(ft)?(a=m,ft++):(a=n,0===wt&&At(R)),a===n&&(45===t.charCodeAt(ft)?(a=b,ft++):(a=n,0===wt&&At(L))),a===n&&(a=null),s=[],k.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt)),l!==n)for(;l!==n;)s.push(l),k.test(t.charAt(ft))?(l=t.charAt(ft),ft++):(l=n,0===wt&&At(rt));else s=n;s!==n?(mt=e,e={type:"NumberLiteral",value:parseFloat($t())}):(ft=e,e=n)}else ft=e,e=n;else ft=e,e=n}return wt--,e===n&&(r=n,0===wt&&At(nt)),e}function Bt(){var e,r,i,o,a;if(wt++,e=ft,r=ft,wt++,i=function(){var e,r,i,o;return e=ft,t.substr(ft,4)===y?(r=y,ft+=4):(r=n,0===wt&&At(lt)),r===n&&(t.substr(ft,5)===_?(r=_,ft+=5):(r=n,0===wt&&At(ut))),r!==n?(i=ft,wt++,x.test(t.charAt(ft))?(o=t.charAt(ft),ft++):(o=n,0===wt&&At(ct)),wt--,o===n?i=void 0:(ft=i,i=n),i!==n?e=r=[r,i]:(ft=e,e=n)):(ft=e,e=n),e}(),wt--,i===n?r=void 0:(ft=r,r=n),r!==n)if(E.test(t.charAt(ft))?(i=t.charAt(ft),ft++):(i=n,0===wt&&At(vt)),i!==n){for(o=[],x.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));a!==n;)o.push(a),x.test(t.charAt(ft))?(a=t.charAt(ft),ft++):(a=n,0===wt&&At(ct));mt=e,e={type:"Identifier",name:$t()}}else ft=e,e=n;else ft=e,e=n;return wt--,e===n&&(r=n,0===wt&&At(dt)),e}function Rt(){var e,r;for(wt++,e=[],C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));r!==n;)e.push(r),C.test(t.charAt(ft))?(r=t.charAt(ft),ft++):(r=n,0===wt&&At(pt));return wt--,r=n,0===wt&&At(gt),e}if((r=a())!==n&&ft===t.length)return r;throw r!==n&&ft<t.length&&At({type:"end"}),function(t,e,r){return new ir(ir.buildMessage(t,e),t,e,r)}(_t,yt<t.length?t.charAt(yt):null,yt<t.length?Ft(yt,yt+1):Ft(yt,yt))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(ir,Error),ir.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,s=or("",i.line.toString().length," "),l=n[i.line-1],u=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+or("",i.column-1," ")+or("",u,"^")}else e+="\n at "+o}return e},ir.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."};const sr=new Map,lr=new Map;function ur(t,e,r){const n={args:e,cb:r},i=sr.get(t)||[];sr.has(t)||sr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");lr.set(o,n)}function cr(t,e){let r=t.args.length,n=t.args.length;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function dr(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=>{dr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":dr(t.left,e),dr(t.right,e);break;case"UnaryExpression":dr(t.argument,e);break;case"ConditionalExpression":dr(t.test,e),dr(t.consequent,e),dr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{dr(t,e)}))}}function vr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function gr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function pr(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 gr(t.value);if("color"===t.type)return $r(wr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function hr(t){let e=pr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function fr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function mr(t,e){if(Pe)return Ie(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function br(t,e){if(e<Me||e>ze)throw new Error("Integer overflow.");!Pe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function yr(t){const e=[];return dr(t,{Variable(t){e.push(t.id.name)}}),e}function _r(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function wr(t){const e=tt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function $r(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 K(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function kr(t){return $r(wr(t))}const xr=Number.MAX_VALUE,Er=Number.MIN_VALUE,Cr="string",Fr="integer",Ar="number",Vr="boolean",jr="color",Dr="datetime";function Sr(t,e){return{type:Cr,value:pr(e)}}function Pr(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Ar,value:r}}function Tr(t,e,r,n){const i=t.variables.get(e.value);let o;return o=i&&i.getType()===n?i.getValue():r.value,"color"===n&&(o=kr(o)),{type:n,value:o}}function zr(t,e,r){return Tr(t,e,r,r.type)}function Mr(t,e,r){return Tr(t,e,r,"color")}function Ir(t,e,r){return Tr(t,e,r,"url")}const Or=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Fr,value:n}},Nr=Or("getUTCFullYear"),Jr=Or("getUTCMonth"),Ur=Or("getUTCDate"),Br=Or("getUTCDay"),Rr=Or("getUTCHours"),Lr=Or("getUTCMinutes"),Wr=Or("getUTCSeconds"),qr=Or("getUTCMilliseconds");function Hr(t,e,r,n){if(!n.value.length)return t.warnings.push(q(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===Cr?e.value:pr(e);for(;i.length+o.length<r.value;)i+=n.value;return i.length>0&&i.length+o.length>r.value&&(i=i.substring(0,Number(r.value)-Number(o.length))),i}function Gr(t,e,r,n){const i=Hr(t,e,r,n);return{type:Cr,value:i+pr(e)}}function Yr(t,e,r,n){const i=Hr(t,e,r,n);return{type:Cr,value:pr(e)+i}}function Zr(t){return(e,r)=>{const n=wr(r.value);return{type:Ar,value:n[t]/255}}}function Xr(t){return(e,r,n)=>{const i=wr(r.value);return i[t]=255*n.value,{type:jr,value:$r(i)}}}const Kr=Zr("a"),Qr=Zr("r"),tn=Zr("g"),en=Zr("b"),rn=Xr("a"),nn=Xr("r"),on=Xr("g"),an=Xr("b");function sn(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Ie(e.value)/Ie(r);return br(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Ie(i)%Ie(n)),{type:Fr,value:i}}function ln(t){return t.map(hr).join(", ")}ur("toString",[Fr],Sr),ur("toString",[Ar],Sr),ur("toString",[Vr],Sr),ur("toString",[jr],Sr),ur("toString",["url"],Sr),ur("toNumber",[Fr],Pr),ur("toNumber",[Cr],Pr),ur("toInteger",[Ar],(function(t,e){if(e.value>ze||e.value<Me)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Fr,value:Ie(r)}})),ur("toInteger",[Cr],(function(t,e){let r;try{r=Ie(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>ze||r<Me)throw new Error("Unable to convert value to Integer.");return{type:Fr,value:r}})),ur("toInteger",[Vr],(function(t,e){return{type:Fr,value:Ie(e.value?1:0)}})),ur("toBoolean",[Fr],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Vr,value:r}})),ur("toBoolean",[Cr],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Vr,value:"true"===e.value?1:0}})),ur("toColor",[Cr],(function(t,e){return{type:jr,value:kr(e.value)}})),ur("toUrl",[Cr],(function(t,e){return{type:"url",value:e.value}})),ur("encodeUri",[Cr],(function(t,e){try{return{type:Cr,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),ur("decodeUri",[Cr],(function(t,e){try{return{type:Cr,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),ur("getIntegerValue",[Cr,Fr],zr),ur("getNumberValue",[Cr,Ar],zr),ur("getBooleanValue",[Cr,Vr],zr),ur("getStringValue",[Cr,Cr],zr),ur("getColorValue",[Cr,jr],Mr),ur("getColorValue",[Cr,Cr],Mr),ur("getUrlValue",[Cr,"url"],Ir),ur("getUrlValue",[Cr,Cr],Ir),ur("parseUnixTime",[Fr],(function(t,e){return{type:Dr,value:new Date(1e3*Number(e.value))}})),ur("nowLocal",[],(function(){return{type:Dr,value:new Date}})),ur("addMillis",[Dr,Fr],(function(t,e,r){return{type:Dr,value:new Date(e.value.getTime()+Number(r.value))}})),ur("setYear",[Dr,Fr],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:Dr,value:n}})),ur("setMonth",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<1||n>12)throw new Error(`Expecting month in [1..12], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMonth(n-1),{type:Dr,value:i}})),ur("setDay",[Dr,Fr],(function(t,e,r){const n=new Date(e.value),i=Number(r.value);if(i<=0&&-1!==i||i>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(n))throw new Error(`Unable to set day ${i} for date ${pr(e)}.`);return n.setUTCDate(-1===i?0:i),{type:Dr,value:n}})),ur("setHours",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>23)throw new Error(`Expecting hours in [0..23], instead got ${n}.`);const i=new Date(e.value);return i.setUTCHours(n),{type:Dr,value:i}})),ur("setMinutes",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting minutes in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMinutes(n),{type:Dr,value:i}})),ur("setSeconds",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>59)throw new Error(`Expecting seconds in [0..59], instead got ${n}.`);const i=new Date(e.value);return i.setUTCSeconds(n),{type:Dr,value:i}})),ur("setMillis",[Dr,Fr],(function(t,e,r){const n=Number(r.value);if(n<0||n>999)throw new Error(`Expecting millis in [0..999], instead got ${n}.`);const i=new Date(e.value);return i.setUTCMilliseconds(n),{type:Dr,value:i}})),ur("getYear",[Dr],Nr),ur("getMonth",[Dr],Jr),ur("getDay",[Dr],Ur),ur("getDayOfWeek",[Dr],Br),ur("getHours",[Dr],Rr),ur("getMinutes",[Dr],Lr),ur("getSeconds",[Dr],Wr),ur("getMillis",[Dr],qr),ur("getIntervalSeconds",[Fr],(function(t,e){return sn(t,e,1e3,60)})),ur("getIntervalTotalSeconds",[Fr],(function(t,e){return sn(t,e,1e3)})),ur("getIntervalMinutes",[Fr],(function(t,e){return sn(t,e,6e4,60)})),ur("getIntervalTotalMinutes",[Fr],(function(t,e){return sn(t,e,6e4)})),ur("getIntervalHours",[Fr],(function(t,e){return sn(t,e,36e5,24)})),ur("getIntervalTotalHours",[Fr],(function(t,e){return sn(t,e,36e5)})),ur("getIntervalTotalDays",[Fr],(function(t,e){return sn(t,e,864e5)})),ur("getIntervalTotalWeeks",[Fr],(function(t,e){return sn(t,e,6048e5)})),ur("len",[Cr],(function(t,e){return{type:Fr,value:e.value.length}})),ur("contains",[Cr,Cr],(function(t,e,r){return{type:Vr,value:e.value.includes(r.value)?1:0}})),ur("substring",[Cr,Fr,Fr],(function(t,e,r,n){if(n.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||n.value<0||n.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Cr,value:e.value.substring(Number(r.value),Number(n.value))}})),ur("replaceAll",[Cr,Cr,Cr],(function(t,e,r,n){let i;return i=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),n.value):e.value,{type:Cr,value:i}})),ur("index",[Cr,Cr],(function(t,e,r){return{type:Fr,value:e.value.indexOf(r.value)}})),ur("lastIndex",[Cr,Cr],(function(t,e,r){return{type:Fr,value:e.value.lastIndexOf(r.value)}})),ur("trim",[Cr],(function(t,e){return{type:Cr,value:e.value.trim()}})),ur("trimLeft",[Cr],(function(t,e){return{type:Cr,value:e.value.replace(/^\s+/,"")}})),ur("trimRight",[Cr],(function(t,e){return{type:Cr,value:e.value.replace(/\s+$/,"")}})),ur("toUpperCase",[Cr],(function(t,e){return{type:Cr,value:e.value.toUpperCase()}})),ur("toLowerCase",[Cr],(function(t,e){return{type:Cr,value:e.value.toLowerCase()}})),ur("padStart",[Cr,Fr,Cr],Gr),ur("padStart",[Fr,Fr,Cr],Gr),ur("padEnd",[Cr,Fr,Cr],Yr),ur("padEnd",[Fr,Fr,Cr],Yr),ur("div",[Fr,Fr],(function(t,e,r){if(r.value===Oe)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=mr(0,n),br(t,n),{type:Fr,value:n}})),ur("div",[Ar,Ar],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value/r.value;return{type:Ar,value:n}})),ur("mod",[Fr,Fr],(function(t,e,r){if(r.value===Oe)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=mr(0,n),br(t,n),{type:Fr,value:n}})),ur("mod",[Ar,Ar],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const n=e.value%r.value;return{type:Ar,value:n}})),ur("mul",[{type:Fr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Oe;for(let n=1;n<e.length;++n)r*=e[n].value,r=mr(0,r),br(t,r);return{type:Fr,value:r}})),ur("mul",[{type:Ar,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:Ar,value:r}})),ur("sub",[{type:Fr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Oe;for(let n=1;n<e.length;++n)r-=e[n].value,r=mr(0,r),br(t,r);return{type:Fr,value:r}})),ur("sub",[{type:Ar,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:Ar,value:r}})),ur("sum",[{type:Fr,isVararg:!0}],(function(t,...e){let r=Oe;for(let n=0;n<e.length;++n)r+=e[n].value,r=mr(0,r),br(t,r);return{type:Fr,value:r}})),ur("sum",[{type:Ar,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Ar,value:r}})),ur("abs",[Fr],(function(t,e){const r=Ne(e.value);return br(t,r),{type:e.type,value:r}})),ur("abs",[Ar],(function(t,e){const r=Math.abs(e.value);return{type:Ar,value:r}})),ur("max",[{type:Fr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:Fr,value:r}})),ur("max",[{type:Ar,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Ar,value:Math.max(...e.map((t=>t.value)))}})),ur("min",[{type:Fr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:Fr,value:r}})),ur("min",[{type:Ar,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Ar,value:Math.min(...e.map((t=>t.value)))}})),ur("maxNumber",[],(function(){return{type:Ar,value:xr}})),ur("minNumber",[],(function(){return{type:Ar,value:Er}})),ur("maxInteger",[],(function(t){return br(t,ze),{type:Fr,value:ze}})),ur("minInteger",[],(function(t){return br(t,Me),{type:Fr,value:Me}})),ur("round",[Ar],(function(t,e){const r=Math.sign(e.value);return{type:Ar,value:r*Math.round(Math.abs(e.value))}})),ur("floor",[Ar],(function(t,e){return{type:Ar,value:Math.floor(e.value)}})),ur("ceil",[Ar],(function(t,e){return{type:Ar,value:Math.ceil(e.value)}})),ur("signum",[Fr],(function(t,e){return{type:Fr,value:Je(e.value)}})),ur("signum",[Ar],(function(t,e){return{type:Ar,value:Math.sign(e.value)}})),ur("copySign",[Fr,Fr],(function(t,e,r){let n;if(r.value===Oe)n=e.value;else if(e.value===Oe)n=0;else{const t=Je(r.value);n=Ne(e.value)*t}return br(t,n),{type:Fr,value:n}})),ur("copySign",[Ar,Ar],(function(t,e,r){let n=Math.sign(r.value);0===n&&(n=Object.is(n,0)?1:-1);const i=Math.abs(e.value)*n;return{type:Ar,value:i}})),ur("getColorAlpha",[Cr],Kr),ur("getColorAlpha",[jr],Kr),ur("getColorRed",[Cr],Qr),ur("getColorRed",[jr],Qr),ur("getColorGreen",[Cr],tn),ur("getColorGreen",[jr],tn),ur("getColorBlue",[Cr],en),ur("getColorBlue",[jr],en),ur("setColorAlpha",[Cr,Ar],rn),ur("setColorAlpha",[jr,Ar],rn),ur("setColorRed",[Cr,Ar],nn),ur("setColorRed",[jr,Ar],nn),ur("setColorGreen",[Cr,Ar],on),ur("setColorGreen",[jr,Ar],on),ur("setColorBlue",[Cr,Ar],an),ur("setColorBlue",[jr,Ar],an),ur("rgb",[Ar,Ar,Ar],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:jr,value:$r(i)}})),ur("argb",[Ar,Ar,Ar,Ar],(function(t,e,r,n,i){const o={a:255*e.value,r:255*r.value,g:255*n.value,b:255*i.value};return{type:jr,value:$r(o)}}));const un={StringLiteral:function(t,e){return{type:Cr,value:e.value}},NumberLiteral:function(t,e){return{type:Ar,value:e.value}},IntegerLiteral:function(t,e){return br(t,e.value),{type:Fr,value:e.value}},BooleanLiteral:function(t,e){return{type:Vr,value:e.value?1:0}},UnaryExpression:function(t,e){const r=vr(cn(t,e.argument));switch(e.operator){case"!":if(r.type===Vr)return{type:Vr,value:r.value?0:1};_r(`${e.operator}${hr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Fr){const e=r.value*Ie(n);return br(t,e),{type:Fr,value:e}}if(r.type===Ar)return{type:Ar,value:r.value*n};_r(`${e.operator}${hr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=vr(cn(t,e.test));if(r.type===Vr)return r.value?cn(t,e.consequent):cn(t,e.alternate);_r(`${hr(r)} ? ${hr(cn(t,e.consequent))} : ${hr(cn(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 cn(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=pr(cn(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Cr,value:r}},LogicalExpression:function(t,e){const r=vr(cn(t,e.left));if(r.type!==Vr&&_r(`${hr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Vr,value:0};const n=vr(cn(t,e.right));return n.type!==Vr&&_r(`${hr(r)} ${e.operator} ${hr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${fr(n.type)}.`),{type:Vr,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=cn(t,e.left),i=cn(t,e.right);if(n.type!==i.type&&_r(`${hr(n)} ${e.operator} ${hr(i)}`,`Operator '${r}' cannot be applied to different types: ${fr(n.type)} and ${fr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Dr&&r.type===Dr?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Vr,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ar&&e.type!==Fr&&e.type!==Dr&&_r(`${hr(e)} ${t} ${hr(r)}`,`Operator '${t}' cannot be applied to ${fr(e.type)} type.`);const i=e.type===Dr?e.value.getTime():e.value,o=r.type===Dr?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Vr,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==Cr&&r.type!==Ar&&r.type!==Fr&&_r(`${hr(r)} ${e} ${hr(n)}`,`Operator '${e}' cannot be applied to ${fr(r.type)} type.`),r.type===Cr)return"-"===e&&_r(`${hr(r)} - ${hr(n)}`,`Operator '${e}' cannot be applied to ${fr(r.type)} type.`),{type:Cr,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===Fr)try{i=mr(0,i),br(t,i)}catch(t){_r(`${hr(r)} ${e} ${hr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r,n){let i;if(r.type!==Fr&&r.type!==Ar&&_r(`${hr(r)} ${e} ${hr(n)}`,`Operator '${e}' cannot be applied to ${fr(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&_r(`${hr(r)} ${e} ${hr(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===Fr)try{i=mr(0,i),br(t,i)}catch(t){_r(`${hr(r)} ${e} ${hr(n)}`,t.message)}return{type:r.type,value:i}}(t,r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let n;const i=e.arguments.map((e=>cn(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(lr.has(o))n=lr.get(o);else{const t=function(t,e){const r=sr.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=cr(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t||"type"in t&&"missing"===t.type){const e=i.map((t=>fr(t.type))).join(", "),n=`${r}(${ln(i)})`;"few"===t.type&&0===i.length?_r(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?_r(n,`Function '${r}' has no matching override for given argument types: ${e}.`):_r(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){_r(`${r}(${ln(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.variables.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' is missing.`)}};function cn(t,e){if(e.type in un)return un[e.type](t,e);throw new Error("Unsupported expression")}function dn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(dr(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const n=cn(r,e);return r.safeIntegerOverflow&&r.warnings.push(q(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:n,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class vn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return dr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=dn(t,this.ast);r.warnings.forEach(e);const n=r.result;if("error"===n.type)return void e(q(new Error("Expression execution error"),{additional:{message:n.value}}));const i=n.value;if(i instanceof Date)return gr(i);if("boolean"===n.type)return Boolean(i);if("color"===n.type){const t=tt(String(i));if(t)return $r(t);e(q(new Error("Expression execution error")))}return"integer"===n.type?i>2147483647||i<-2147483648?void e(q(new Error("Expression result is out of 32-bit int range"))):Number(i):i}catch(t){return void e(q(new Error("Expression execution error")))}}}function gn(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=ar(t,{startRule:"JsonStringContents"}),n=yr(r);return e.vars.push(...n),new vn(r)}catch(e){return void r(q(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>gn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=gn(t[i],e,r);return n}}var n;return t}function pn(t,e,r){if(t){if(t instanceof vn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>pn(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=pn(t[i],e,r);return n}}return t}function hn(t,e){const r={vars:[],hasExpression:!1},n=gn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>pn(n,t,e)}}const fn={pagers:function(){return R(new Map)}},mn=new Map,bn=new Map;function yn(t){const e=mn.get(t)||R("");return mn.has(t)||mn.set(t,e),e}function _n(t){const e=bn.get(t)||new Map;return bn.has(t)||bn.set(t,e),e}class wn{setVariable(t){const e=t.getName(),r=_n(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),yn(this).set(e)}getVariable(t){return _n(this).get(t)}}function $n(){return new wn}function kn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const xn=new Set(["start","stop","pause","resume","cancel","reset"]);class En{constructor(t){kn(this,"timers",new Map),kn(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(q(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(q(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&xn.has(e)))return void this.logError(q(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const n=this.timers.get(t);this[r](n)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const n=t.tickStarted=performance.now(),i=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-n-i)%r,e()}),i)};e()}}start(t){if("running"===t.state)return void this.logError(q(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(q(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(q(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(q(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(q(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(q(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(q(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(q(new Error("The timer is already running"))):this.logError(q(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 Cn=O(((t,e,r,n)=>{let i,o;var s,l,u,v;let{id:g}=e,{json:p={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new wn}=e,{mix:b=""}=e,{customization:_={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{onError:$}=e,{onStat:k}=e,{onCustomAction:x}=e,{onComponent:E}=e,C=R("desktop"===h);if(o=a(C,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");C.set(!t.matches),t.addListener((()=>{C.set(!t.matches)}))}let F="light",A=null;function V(t){f=t}function D(){}const S=new Set(w);let P=!1;p||(P=!0,Y(q(new Error('"json" prop is required')))),g||(P=!0,Y(q(new Error('"id" prop is required'))));let T=function(t){if(!t)return q(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return q(new Error("Missing card"));if(!e.states||!e.states.length)return q(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in He)return q(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return q(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return q(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const M=p.templates||{};T&&(P=!0,Y(T));const I={stateChange:!1},O=yn(m),N=_n(m),J=new Map,U=new Map,B=new Map;let H=null;function G(t){const e=hn(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 Z(t,e){k&&k({type:t,action:e})}let X=0;function K(t){return`${g}-${X++}`}let Q={},tt={};function et(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=dt,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const n=r[t],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=at(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=at(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=at(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=U.get(r);t?t.set(i):Y(q(new Error("Cannot find variable"),{additional:{name:r}}))}else Y(q(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=n.get("action"),a=n.get("id");H?H.execTimerAction(a,o):Y(q(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:Y(q(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){Y(q(t,{additional:{url:e}}))}}async function nt(t,e){if(t){for(let r=0;r<t.length;++r){let n=t[r];const i=n.url;if(i){const t=lt(i);if(t)if(ut(t,S)){if(e)if("_blank"===n.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=i)}else location.href=i}else"div-action"===t?(et(n),await y()):n.log_id&&(it(n),await y())}}t.forEach((t=>{t.log_id&&Z("click",t)}))}}function it(t){null==x||x(t)}const ot=new Map;function at(t){if(ot.has(t))return ot.get(t);Y(q(new Error("Missing instance with id"),{additional:{id:t}}))}const st=new Map;function ct(t){for(const e of t)U.has(e)&&t.delete(e);return t}d(W,{logError:Y,logStat:Z,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}=Ze(t,e,M,Y)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:K,genClass:function(t){return`divkit-${K()}`},execAction:et,execAnyActions:nt,execCustomAction:it,isRunning:function(t){return I[t]},setRunning:function(t,e){I[t]=e},registerInstance:function(t,e){ot.has(t)?Y(q(new Error("Duplicate instance id"),{additional:{id:t}})):ot.set(t,e)},unregisterInstance:function(t){ot.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(tt[r]=tt[r]||0,++tt[r],Q[r])return Q[r];const n=`${K()}-svg-filter`;return Q=Object.assign(Object.assign({},Q),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;tt[r]&&0==--tt[r]&&(Q=Object.keys(Q).reduce(((t,e)=>(tt[e]&&(t[e]=Q[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Ke(t);const e=hn(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(rt),(()=>e.applyVars(U))):e.hasExpression?Ke(e.applyVars(U)):Ke(t)},getJsonWithVars:G,getStore:function(t){return st.has(t)||function(t){st.has(t)||st.set(t,fn[t]())}(t),st.get(t)},getVariable:function(t,e){const r=U.get(t);if(r){const n=r.getType();if(n!==e)return void Y(q(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==_?void 0:_[t]},getBuiltinProtocols:function(){return S},isDesktop:C,registerComponent:void 0,unregisterComponent:void 0}),d(Ft,{hasAction:()=>!1});const dt={setState(t){throw new Error("Not implemented")},getChild(t){if(gt&&gt.has(t))return gt.get(t);Y(q(new Error("Missing state block with id"),{additional:{id:t}}))}};let gt=null;d(vt,{registerInstance(t,e){gt||(gt=new Map),gt.has(t)?Y(q(new Error("Duplicate state with id"),{additional:{id:t}})):gt.set(t,e)},unregisterInstance(t){null==gt||gt.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const pt=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variables;Array.isArray(pt)&&pt.forEach((t=>{if(t&&t.type in Be&&t.name){if(J.has(t.name))return void Y(q(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&Y(q(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=Re(t.name,t.type,t.value);J.set(t.name,e),U.set(t.name,e)}catch(e){Y(q(e,{additional:{name:t.name}}))}}}));const ht=p.palette;ht&&ht[F].forEach((t=>{if(J.has(t.name))Y(q(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Re(t.name,"color",t.color);J.set(t.name,e),U.set(t.name,e)}catch(e){Y(q(e,{additional:{name:t.name}}))}}));for(const[t,e]of N)U.has(t)||U.set(t,e);O.subscribe((t=>{if(t&&!U.has(t)){const e=N.get(t);U.set(t,e);const r=B.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const ft=null===(l=null==p?void 0:p.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(ft)&&ft.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void Y(q(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 n=ar(t.condition,{startRule:"JsonStringContents"}),i=yr(n);if(!i.length)return void Y(q(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return ct(e),e.size?new Promise((t=>{const r=O.subscribe((()=>{ct(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{L(i.map((t=>U.get(t))).filter(rt),(()=>{const t=dn(U,n);return t.warnings.forEach(Y),t.result})).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=G(t);e.log_id&&et(e)})),e=Boolean(n.value)):Y(q(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){Y(q(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else Y(q(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const mt=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.timers;if(mt){const t=H=new En({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(q(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:nt});mt.forEach((e=>t.createTimer(e)))}const bt=null===(v=null==p?void 0:p.card)||void 0===v?void 0:v.states,yt=bt&&!P?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:bt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return c((()=>{H&&H.destroy()})),void 0===e.id&&r.id&&void 0!==g&&r.id(g),void 0===e.json&&r.json&&void 0!==p&&r.json(p),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!==b&&r.mix(b),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!==k&&r.onStat(k),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==x&&r.onCustomAction(x),void 0===e.onComponent&&r.onComponent&&void 0!==E&&r.onComponent(E),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.execAction&&r.execAction&&void 0!==et&&r.execAction(et),"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(q(new Error("Unsupported theme"))),F&&(ht&&ht[F].forEach((t=>{const e=U.get(t.name);e&&e.setValue(t.color)}))),o(),!P&&yt?`<div class="${j("divkit-b023c",!0)+j(i?" divkit-ee112":"",!0)+j(b?` ${b}`:"",!0)}">${z(Ye,"RootSvgFilters").$$render(t,{svgFiltersMap:Q},{},{})}\n ${z(Ge,"Unknown").$$render(t,{div:yt,templateContext:{}},{},{})}</div>`:""})),Fn=Cn;function An(t){return Fn.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 Vn=e.M,jn=e.Os,Dn=e.sY;export{Vn as createGlobalVariablesController,jn as createVariable,Dn as render};
2
2
  //# sourceMappingURL=server.mjs.map