@divkitframework/divkit 25.1.0 → 25.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.css +1 -1
- package/dist/client.css.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/typings/common.d.ts +12 -1
package/dist/esm/server.mjs
CHANGED
|
@@ -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}function s(t,e,r){return t.set(r),e}let l;function u(t){l=t}function c(){if(!l)throw new Error("Function called outside component initialization");return l}function d(t){c().$$.on_destroy.push(t)}function v(t,e){return c().$$.context.set(t,e),e}function g(t){return c().$$.context.get(t)}t.d(e,{M:()=>Hn,Os:()=>tr,sY:()=>Kn}),new Set,new Map;const p=[],h=[];let f=[];const m=[],y=Promise.resolve();let b=!1;function _(){return b||(b=!0,y.then(k)),y}function w(t){f.push(t)}const x=new Set;let $=0;function k(){if(0!==$)return;const t=l;do{try{for(;$<p.length;){const t=p[$];$++,u(t),E(t.$$)}}catch(t){throw p.length=0,$=0,t}for(u(null),p.length=0,$=0;h.length;)h.pop()();for(let t=0;t<f.length;t+=1){const e=f[t];x.has(e)||(x.add(e),e())}f.length=0}while(p.length);for(;m.length;)m.pop()();b=!1,x.clear(),u(t)}function E(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(w)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const C=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),F=/[\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 A(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=R(n):r.style=R(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(F.test(t))return;const e=r[t];!0===e?n+=" "+t:C.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const V=/[&"]/g,D=/[&<]/g;function S(t,e=!1){const r=String(t),n=e?V:D;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+r.substring(o)}function j(t){return"string"==typeof t||t&&"object"==typeof t?S(t,!0):t}function P(t){const e={};for(const r in t)e[r]=j(t[r]);return e}function M(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. Otherwise you may need to fix a <${e}>.`);return t}let I,O;function N(t){function e(e,r,n,i,o){const a=l;u({$$:{on_destroy:I,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,n,i);return u(a),s}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${S(e,!0)}"`}`}function R(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${j(t[e])};`)).join(" ")}function B(t){const e=R(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=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&&(function(t){const e=[],r=[];f.forEach((n=>-1===t.indexOf(n)?e.push(n):r.push(n))),r.forEach((t=>t())),f=e}(r.after_update),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){if(!o(e))return r;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.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 U=[];function W(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=!U.length;for(const e of i)e[1](),U.push(e,t);if(e){for(let t=0;t<U.length;t+=2)U[t][0](U[t+1]);U.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(),n=null)}}}}function L(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return{subscribe:W(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(),n=!1}})).subscribe}}const H="divkit-bd259",q="divkit-d9099",G="divkit-c016b",Z="divkit-aa145",Y="divkit-f0cba",X=Symbol("root");function K(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const Q={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"},tt={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 et(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 rt(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 nt(t){let e=rt(t);return"0"===e&&(e+="em"),e}function it(t,e){for(;t.length<e;)t="0"+t;return t}function ot(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const n=at(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>it(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function at(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 st(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const lt=Boolean;function ut(t){if(1===t.length&&"solid"===t[0].type)return{color:ot(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=ot(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(lt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>ot(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:vt(t.bg.scale),pos:gt(t.bg),image:'url("'+st(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(lt);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=nt(n.value):"relative"===n.type&&(i=ct[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${dt(t.bg.center_x)} ${dt(t.bg.center_y)},`+r.map((t=>ot(t))).join(",")+")"}}({bg:t}):void 0)).filter(lt).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 ct={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function dt(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return nt(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function vt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function gt(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function ht(t,e){return e.has(t)}function ft(t,e){e&&t.push(e)}function mt(t,e,r){const n=[];ft(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ft(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const yt=Symbol("state");function bt(t){return rt(t.top||0)+" "+rt(t.right||0)+" "+rt(t.bottom||0)+" "+rt(t.left||0)}function _t(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function wt(t){return _t(t)&&t>=0}function xt(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]&&!wt(r[t]))return e;return bt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const kt=Object.prototype.hasOwnProperty;function Et(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(!kt.call(e,i)||!Et(t[i],e[i]))return!1}return!0}function Ct(t,e){return Et(t,e)?e:t}function Ft(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function At(t,e){const r=Number(t);return isNaN(r)?e:r}function Vt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Vt(t))})):e.push(t),e}function Dt(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]]&&!wt(t[r[n]]))return e;return t}function St(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>rt((t||e)/r*10))).join(" ")}function jt(){}const Pt=Symbol("action"),Mt=N(((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=jt}=e,{customAction:d=null}=e,{isNativeActionAnimation:p=!0}=e;const h=g(X),f=g(Pt);v(Pt,{hasAction:()=>Boolean(f.hasAction()||(null==i?void 0:i.length))});let m,y="",b=!1;if(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!==d&&r.customAction(d),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}return Array.isArray(i)&&(null==i?void 0:i.length)&&f.hasAction()&&(y="",h.logError(K(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}}))),b=Boolean(d),y&&!ht(pt(y),h.getBuiltinProtocols())?(y="",b=!0):!y&&Array.isArray(i)&&(null==i?void 0:i.length)&&(b=!0,h.logError(K(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:i}}))),y?`<a${A([{href:j(y)},{target:j(m)},{style:j(l)},{class:S(s,!0)+" "+S(p?H:q,!0)+" "+S(null!=a&&a.length?Y:"",!0)},P(u)],{})}>${n.default?n.default({}):""}</a>`:`\n <span${A([{class:S(s,!0)+S(b?` ${p?H:q} ${G}`:"",!0)+" "+S(null!=a&&a.length?Y:"",!0)},{style:j(l)},{role:j(b?"button":null)},{tabindex:j(b?0:null)},P(u)],{})}>${n.default?n.default({}):""}</span>`})),Tt="divkit-b921d";function zt(t){return _t(t)&&t>0}function It(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(zt(t.radius))return`blur(${nt(t.radius/2)})`}else e(K(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ot=N(((t,e,r,n)=>{let i,{background:o=[]}=e,{radius:a=""}=e;const s=g(X);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=ut([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=It(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${M(i,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class",Tt,0)}${J("style",et(t.style),0)}>`:`<span${J("class",Tt,0)}${J("style",et(t.style),0)}></span>`))}</span>`})),Nt=Ot,Jt=N(((t,e,n,i)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,w,x,$,k,E,C,F,A,V,D,S,j,P,M,T,I,O,N,R,B,U,W,L,H,q,G,Z,Y,Q=r,it=r,at=r,st=r,ct=r,dt=r,vt=r,gt=r,ft=r,_t=r,kt=r,Et=r,jt=r,Pt=r,Tt=r,zt=r,It=r;var Ot,Jt,Rt,Bt,Ut,Wt;let{json:Lt={}}=e,{origJson:Ht}=e,{templateContext:qt}=e,{cls:Gt=""}=e,{style:Zt}=e,{layoutParams:Yt={}}=e,{customDescription:Xt=!1}=e,{customPaddings:Kt=!1}=e,{customActions:Qt=""}=e,{additionalPaddings:te=null}=e,{heightByAspect:ee=!1}=e;const re={left:"start",center:"center",right:"end"},ne={top:"start",center:"center",bottom:"end",baseline:"baseline"},ie=g(X),oe=g(yt);let ae,se,le,ue,ce,de,ve,ge,pe,he,fe,me=null,ye={},be={},_e=!1,we=1,xe="transparent",$e=0,ke={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ee="",Ce=null,Fe="",Ae={},Ve=0,De=0,Se=0,je=!1,Pe=!1,Me={},Te=0,ze=0,Ie=0,Oe=!1,Ne=!1,Je=1;const Re=Yt.fakeElement?[]:Lt.transition_triggers||["state_change","visibility_change"],Be=-1!==Re.indexOf("state_change")&&Lt.id,Ue=-1!==Re.indexOf("visibility_change")&&Lt.id;let We,Le,He,qe,Ge,Ze,Ye,Xe,Ke,Qe=[],tr=[],er=[],rr=[],nr="",ir=!1,or="visible",ar=0,sr=0;void 0===e.json&&n.json&&void 0!==Lt&&n.json(Lt),void 0===e.origJson&&n.origJson&&void 0!==Ht&&n.origJson(Ht),void 0===e.templateContext&&n.templateContext&&void 0!==qt&&n.templateContext(qt),void 0===e.cls&&n.cls&&void 0!==Gt&&n.cls(Gt),void 0===e.style&&n.style&&void 0!==Zt&&n.style(Zt),void 0===e.layoutParams&&n.layoutParams&&void 0!==Yt&&n.layoutParams(Yt),void 0===e.customDescription&&n.customDescription&&void 0!==Xt&&n.customDescription(Xt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Kt&&n.customPaddings(Kt),void 0===e.customActions&&n.customActions&&void 0!==Qt&&n.customActions(Qt),void 0===e.additionalPaddings&&n.additionalPaddings&&void 0!==te&&n.additionalPaddings(te),void 0===e.heightByAspect&&n.heightByAspect&&void 0!==ee&&n.heightByAspect(ee),o=ie.getDerivedFromVars(Lt.border),It(),It=a(o,(t=>Y=t));{let t={},e={},r=!1,n="";if(Y){if(Y.has_shadow){const e=Y.shadow;t["box-shadow"]=e?rt((null===(Jt=null===(Ot=e.offset)||void 0===Ot?void 0:Ot.x)||void 0===Jt?void 0:Jt.value)||0)+" "+rt((null===(Bt=null===(Rt=e.offset)||void 0===Rt?void 0:Rt.y)||void 0===Bt?void 0:Bt.value)||0)+" "+rt(null!==(Ut=e.blur)&&void 0!==Ut?Ut:2)+" "+ot(e.color||"#000000",null!==(Wt=e.alpha)&&void 0!==Wt?Wt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(Y.stroke&&(r=!0,we=$t(Y.stroke.width,we),xe=ot(Y.stroke.color,1,xe),e.border=`${rt(we)} solid ${xe}`),Y.corners_radius?(ke=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]&&!wt(r[t]))return e;return t}(Y.corners_radius,ke),e["border-radius"]=t["border-radius"]=St(ke)):Y.corner_radius&&($e=$t(Y.corner_radius,$e),ke={"top-left":$e,"top-right":$e,"bottom-right":$e,"bottom-left":$e},e["border-radius"]=t["border-radius"]=rt($e)),r&&we&&(Y.corners_radius||Y.corner_radius)){let t=Object.assign({},ke);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+we/2})),n=St(t)}}ye=Ct(t,ye),be=Ct(e,be),_e=r,Ee=n}s=ie.getDerivedFromVars(Lt.paddings),zt(),zt=a(s,(t=>Z=t)),Ce=Dt(Z&&!Kt?Z:void 0,Ce),l=bt(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}(Ce,te)),u=ie.getDerivedFromVars(Lt.margins),Pt(),Pt=a(u,(t=>q=t)),Fe=xt(q,Fe),c=ie.getDerivedFromVars(Lt.width),Et(),Et=a(c,(t=>L=t)),d=ie.getDerivedFromVars(Lt.alignment_horizontal),Tt(),Tt=a(d,(t=>G=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)Ve=$t(null==L?void 0:L.value,Ve),e=rt(Ve);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,ie.logError(K(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${nt(((null==q?void 0:q.left)||0)+((null==q?void 0:q.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=L&&"weight"in L&&L.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(i["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;t.min_size&&wt(t.min_size.value)&&(r=rt(t.min_size.value)),t.max_size&&wt(t.max_size.value)&&(n=rt(t.max_size.value))}"match_parent"!==u&&u||ie.logError(K(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)i["halign-self"]="stretch";else{const t=G;i["halign-self"]="left"===t||"center"===t||"right"===t?re[t]:Yt.parentHAlign||"start"}t&&(i.width=t),le=e,ue=r,ce=n,De=o,Se=a,Ae=Ct(i,Ae),je=s,Pe=l}v=ie.getDerivedFromVars(Lt.height),kt(),kt=a(v,(t=>W=t)),p=ie.getDerivedFromVars(Lt.alignment_vertical),jt(),jt=a(p,(t=>H=t));{let t,e,r,n,i={},o=0,a=0,s=!1,l=!1;const u=null==W?void 0:W.type;if(ee);else if("fixed"===u)Te=$t(null==W?void 0:W.value,Te),e=rt(Te);else if("match_parent"!==u||!Yt.overlapParent&&Yt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==W?void 0:W.constrained)||"match_parent"===u&&Yt.parentVerticalWrapContent)&&(i["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=W;(null==t?void 0:t.min_size)&&wt(t.min_size.value)&&(r=rt(t.min_size.value)),(null==t?void 0:t.max_size)&&wt(t.max_size.value)&&(n=rt(t.max_size.value))}"match_parent"===u&&ie.logError(K(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,ie.logError(K(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${nt(((null==q?void 0:q.top)||0)+((null==q?void 0:q.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==W?void 0:W.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)i["valign-self"]="stretch";else{const t=H;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?i["valign-self"]=ne[t]:i["valign-self"]=Yt.parentVAlign||"start"}t&&(i.height=t),de=e,ve=r,ge=n,ze=o,Ie=a,Me=Ct(i,Me),Oe=s,Ne=l}var lr,ur,cr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!L||"match_parent"===L.type)&&"match_parent"===(null==W?void 0:W.type),m=Yt.gridArea?`${Yt.gridArea.y+1}/${Yt.gridArea.x+1}/span ${Yt.gridArea.rowSpan}/span ${Yt.gridArea.colSpan}`:void 0,y=ie.getDerivedFromVars(Lt.alpha),_t(),_t=a(y,(t=>U=t)),ur=Je,Je=!wt(lr=U)||void 0===lr||lr>1?ur:Number(lr),pe=1===Je?void 0:Je,b=ie.getDerivedFromVars(Lt.accessibility),ft(),ft=a(b,(t=>B=t)),se=void 0,B&&!Xt&&B.description&&(se={},se["aria-label"]=B.description),w=ie.getDerivedFromVars(Lt.background),gt(),gt=a(w,(t=>R=t)),he={},fe=!1,R&&(fe=R.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ee),!fe)){const t=ut(R);he["background-color"]=t.color,he["background-image"]=t.image,he["background-size"]=t.size,he["background-position"]=t.position,he["background-repeat"]="no-repeat"}We=void 0,Be&&Lt.transition_in&&ie.isRunning("stateChange")&&(We=!0),He=void 0,Be&&Lt.transition_change&&ie.isRunning("stateChange")&&oe.hasTransitionChange(Lt.id)&&(He=!0),x=ie.getDerivedFromVars(Lt.action),dt(),dt=a(x,(t=>O=t)),$=ie.getDerivedFromVars(Lt.actions),vt(),vt=a($,(t=>N=t)),k=ie.getDerivedFromVars(Lt.doubletap_actions),ct(),ct=a(k,(t=>I=t)),E=ie.getDerivedFromVars(Lt.longtap_actions),st(),st=a(E,(t=>T=t));{let t=N||O&&[O]||[],e=I||[],r=T||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ie.logError(K(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ie.logError(K(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ie.logError(K(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Qt&&(t=[],e=[],r=[],ie.logError(K(new Error(`Cannot use action on component "${Qt}"`)))),Qe=t,tr=e,er=r}C=ie.getDerivedFromVars(Lt.action_animation),at(),at=a(C,(t=>M=t)),M&&(rr=Vt(M),nr=rr.map((function(t){const e=At(t.start_value,1),r=At(t.end_value,1),n=$t(t.start_delay,0),i=$t(t.duration,300),o=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return qe=e,Ge=r,`opacity ${i}ms ${o} ${n}ms`;case"scale":return Ze=e,Ye=r,`transform ${i}ms ${o} ${n}ms`;case"native":case"no_animation":return"";default:return ie.logError(K(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ie.getDerivedFromVars(Lt.visibility),it(),it=a(F,(t=>P=t));{const t=or,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,or);t!==e&&(!ir||"visible"!==or&&"visible"!==e?or=e:async function(t){or=t;const e="visible"===t?"in":"out",r="in"===e?Lt.transition_in:Lt.transition_out;Ue&&r&&(await _(),"in"===e&&(Le=!0),oe.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,ae,e).then((()=>{"in"===e&&(Le=!1)})).catch((t=>{throw"in"===e&&(Le=!1),t})))}(e)),ir||(ir=!0)}if(A=Object.assign(Object.assign(Object.assign({},Ae),Me),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Yt.scrollSnap,"hide-on-transition-in":We||Le||He,visibility:or,"has-action-animation":Boolean(nr),"parent-flex":Yt.parentContainerOrientation||void 0,"parent-grid":Boolean(Yt.gridArea)||void 0}),V=ie.getDerivedFromVars(Lt.transform),Q(),Q=a(V,(t=>j=t)),j&&void 0!==j.rotation){const t=j.pivot_x||{type:"pivot-percentage",value:50};ar=At(t.value,ar);const e="pivot-fixed"===t.type?rt(ar):`${ar}%`,r=j.pivot_y||{type:"pivot-percentage",value:50};sr=At(r.value,sr),Xe=`${e} ${"pivot-fixed"===r.type?rt(sr):`${sr}%`}`,Ke=`rotate(${j.rotation}deg)`}return D=je||Oe?"100%":De||ze?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},Zt),he),ye),{width:le,"min-width":ue,"max-width":ce,height:de,"min-height":ve,"max-height":ge||(null==Zt?void 0:Zt["max-height"]),"grid-area":m,padding:l,margin:Fe,opacity:pe,transition:nr,"transform-origin":Xe,transform:Ke,"flex-grow":De||ze||void 0,"flex-shrink":Se||Ie?1:void 0,"flex-basis":D,"--divkit-animation-opacity-start":qe,"--divkit-animation-opacity-end":Ge,"--divkit-animation-scale-start":Ze,"--divkit-animation-scale-end":Ye}),Q(),it(),at(),st(),ct(),dt(),vt(),gt(),ft(),_t(),kt(),Et(),jt(),Pt(),Tt(),zt(),It(),Pe||Ne?"":`${z(Mt,"Actionable").$$render(t,{use:function(t){ae=t,Be&&Lt.transition_in&&oe.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{We=!1})).catch((t=>{throw We=!1,t})),Be&&Lt.transition_out&&oe.registerChildWithTransitionOut(Lt,qt,Lt.transition_out,t),Be&&Lt.transition_change&&oe.registerChildWithTransitionChange(Lt,qt,Lt.transition_change,t).then((()=>{He=!1})).catch((t=>{throw He=!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=pt(a);t&&!ht(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:ie});const r=Lt.id;r&&oe.registerChild(r);let n=null;if(Array.isArray(Lt.extensions)){const e=ie.getExtensionContext();me=Lt.extensions.map((r=>{var n;const i=ie.getExtension(r.id,r.params);return i&&(null===(n=i.mountView)||void 0===n||n.call(i,t,e)),i})).filter(lt)}return{destroy(){if(r&&oe.unregisterChild(r),me){const e=ie.getExtensionContext();me.forEach((r=>{var n;null===(n=r.unmountView)||void 0===n||n.call(r,t,e)})),me=null}n&&n.destroy()}}},cls:Gt+" "+mt("outer",tt,A),style:et(S),actions:Qe,doubleTapActions:tr,longTapActions:er,attrs:se,isNativeActionAnimation:!rr.length||(cr=rr,cr.some((t=>"native"===t.name)))},{},{default:()=>`${fe?`${z(Nt,"OuterBackground").$$render(t,{background:R,radius:Ee},{},{})}`:""}${i.default?i.default({}):""}${_e?`<span${J("class",tt.outer__border,0)}${J("style",et(be),0)}></span>`:""}`})}`})),Rt=Jt,Bt={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function Ut(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Wt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Lt(t,e){return Wt(t)||e}const Ht=N(((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",y=12,b=1.25,_="",w="",x=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 y=Ut(p.font_size,y),zt(p.line_height)&&(b=Number(p.line_height)/y),wt(p.letter_spacing)&&(_=rt(p.letter_spacing)),d=Lt(p.font_weight,d),w=ot(p.text_color,1,w),i=p.top_offset?rt(p.top_offset):"",o=p.background?ut([p.background]):null,x=(null===(u=p.border)||void 0===u?void 0:u.stroke)&&"transparent"!==ot(p.border.stroke.color)&&zt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=Ut(null===(c=p.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":rt(10*y/g),"line-height":b,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":x?`inset 0 0 0 ${rt(x.width)} ${x.color}`:void 0,"border-radius":a?rt(a):void 0},`${i?`<span${J("class",Bt["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${z(Mt,"Actionable").$$render(t,{cls:mt("text-range",Bt,s),actions:f,style:et(l)},{},{default:()=>`${S(v)}`})}`})),qt=Ht;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Zt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Yt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Xt=N(((t,e,n,i)=>{let o,s,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,S,j,P,T,I,O,N,R,B,U,W=r,L=r,H=r,q=r,Z=r,Y=r,tt=r,nt=r,it=r,at=r,st=r,lt=r,ct=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ht=g(X);let ft=!1,yt="",bt=12,_t=1.25,wt=!1,xt="",$t="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,Dt=[],St=[];var jt,Pt;d((()=>{St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),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(dt.text),ct(),ct=a(o,(t=>U=t)),jt=U,Pt=yt,yt=String(null!=jt?jt:"")||Pt,yt?ft=!1:(ft=!0,ht.logError(K(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(dt.ranges),L(),L=a(s,(t=>V=t)),l=ht.getDerivedFromVars(dt.images),W(),W=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),H(),H=a(u,(t=>D=t)),c=ht.getDerivedFromVars(dt.font_size),lt(),lt=a(c,(t=>B=t)),bt=Ut(B,bt),v=ht.getDerivedFromVars(dt.line_height),st(),st=a(v,(t=>R=t));{const t=R;zt(t)?(_t=Number(t)/bt,wt=!0):wt=!1}p=ht.getDerivedFromVars(dt.max_lines),nt(),nt=a(p,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let n=Number(I);t=n*_t+"em",V||A||(e=n,r=!0)}xt=t,$t=e,kt=r}f=ht.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),Et=Gt(N,Et),m=ht.getDerivedFromVars(dt.text_alignment_vertical),it(),it=a(m,(t=>O=t)),Ct=Zt(O,Ct),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,b=ht.getDerivedFromVars(dt.text_color),tt(),tt=a(b,(t=>T=t)),_=Boolean(T)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&y&&_&&(t=ot(T||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(dt.truncate),Y(),Y=a(w,(t=>P=t)),x="none"===P?"none":"",$=ht.getDerivedFromVars(dt.text_gradient),Z(),Z=a($,(t=>j=t));{let t="";if(j){const e=ut([j]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(dt.selectable),q(),q=a(k,(t=>S=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(S,Vt),function(t,e,r){let n=[];if(St.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),St=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Dt=[]);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({},D),...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({},D),...l),r=rt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=rt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":rt(10*(Number(e.font_size)||12)/bt)};let a="";const s=t.image.tint_color,u=Yt(t.image.tint_mode,"source_in");if(s){const e=ot(t.image.tint_color);a=ht.addSvgFilter(e,u),St.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({},D)}),Dt=n}(yt,V,A),E={singleline:h,multiline:kt,halign:Et,valign:Ct,truncate:x},C={gradient:Boolean(At)},F={"font-size":rt(bt),"line-height":_t,"max-height":xt,"-webkit-line-clamp":$t,color:Ft,"background-image":At},W(),L(),H(),q(),Z(),Y(),tt(),nt(),it(),at(),st(),lt(),ct(),ft?"":`${z(Rt,"Outer").$$render(t,{cls:mt("text",Q,E)+" "+(Vt?"":G),json:dt,origJson:gt,templateContext:vt,layoutParams:pt},{},{default:()=>`<span${J("class",mt("text__inner",Q,C),0)}${J("style",et(F),0)}>${Dt.length?`${M(Dt,((e,r)=>"text"in e?e.text?`${z(qt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",et(e.image.wrapperStyle),0)}><img${J("class",Q.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",et({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${z(qt,"TextRangeView").$$render(t,{text:yt,rootFontSize:bt,textStyles:D,singleline:h},{},{})}`}</span>`})}`})),Kt=Xt,Qt={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226",container_orientation_horizontal:"divkit-fe458",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230",container_orientation_overlap:"divkit-a644d"};function te(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let 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?ot(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=ot(l),a&&s&&(i.boxShadow=`inset 0 0 0 ${rt(s)} ${a}`),i}(n,t.shape,{color:t.color,stroke:t.stroke})}function ee(t,e,r){null!=e&&e.show_at_start&&(r?t.top=e.style.height:t.left=e.style.width),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height:t.right=e.style.width)}function re(t,e,r){let 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(rt).join(" ")}let ne;function ie(){if(void 0!==ne)return ne;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),ne=1===t.scrollHeight,document.body.removeChild(t),ne}const oe="divkit-a7719",ae="divkit-f6e9a";function se(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 le(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)&&se(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)se(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];se(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},i,n)}}const ue=N(((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();c=[];let e=[...i.children].filter((t=>t!==u&&!t.classList.contains(tt.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&&le(c,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};n.push(r)})),s&&le(c,s,n,"horizontal"===o),c.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,c=[],v=!1,g=null,p=null;return d((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),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(ae))&&!(null==r?void 0:r.contains(oe))}))&&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${J("class",oe,0)}${J("this",u,0)}>${M(c,(t=>`<div${J("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class",ae,0)}${B({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>`})),ce=N(((t,e,n,i)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,S=r,j=r,P=r,T=r,I=r,O=r,N=r,J=r,R=r;var B,U,W,L,H,q;let{json:G={}}=e,{templateContext:Z}=e,{origJson:Y}=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=g(X);let it,ot=!1,at="vertical",st="top",lt="left",ut=null,ct=null,dt={};if(void 0===e.json&&n.json&&void 0!==G&&n.json(G),void 0===e.templateContext&&n.templateContext&&void 0!==Z&&n.templateContext(Z),void 0===e.origJson&&n.origJson&&void 0!==Y&&n.origJson(Y),void 0===e.layoutParams&&n.layoutParams&&void 0!==Q&&n.layoutParams(Q),o=G.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,nt.logError(K(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=Z;return({templateContext:r,json:e}=nt.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=nt.getDerivedFromVars(G.orientation),R(),R=a(l,(t=>D=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(D,at),u=nt.getDerivedFromVars(G.content_alignment_vertical),J(),J=a(u,(t=>V=t)),st=Zt(V,st),c=nt.getDerivedFromVars(G.content_alignment_horizontal),N(),N=a(c,(t=>A=t)),lt=Gt(A,lt),d=nt.getDerivedFromVars(G.layout_mode),O(),O=a(d,(t=>F=t)),v="wrap"===F,p=nt.getDerivedFromVars(G.separator),I(),I=a(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&ie()){const t=te(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!==(U=C.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(W=C.show_between)||void 0===W||W),style:t}:null}else ut=null;if(h=nt.getDerivedFromVars(G.line_separator),T(),T=a(h,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&ie()){const t=te(E.style,rt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(L=E.show_at_start)&&void 0!==L&&L),show_at_end:Boolean(null!==(H=E.show_at_end)&&void 0!==H&&H),show_between:Boolean(null===(q=E.show_between)||void 0===q||q),style:t}:null}else ct=null;f=ut||ct?function(t,e,r){const n={};return ee(n,e,"vertical"===t),ee(n,r,"horizontal"===t),n}(at,ut,ct):null,m=nt.getDerivedFromVars(G.aspect),P(),P=a(m,(t=>k=t));{const t=null==k?void 0:k.ratio;it=t&&zt(t)?t:void 0}y=nt.getDerivedFromVars(G.width),S(),S=a(y,(t=>x=t)),b=nt.getDerivedFromVars(G.height),j(),j=a(b,(t=>$=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],it||$&&"wrap_content"!==$.type&&("match_parent"!==$.type||!(null==Q?void 0:Q.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=et[st],("wrap_content"===(null==x?void 0:x.type)||"match_parent"===(null==x?void 0:x.type)&&(null==Q?void 0:Q.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),v&&(t.parentContainerWrap=!0),dt=Ct(t,dt)}return _={orientation:at,valign:st,halign:lt,wrap:v},w={gap:ut||ct?re(at,ut,ct):void 0,"aspect-ratio":it},S(),j(),P(),T(),I(),O(),N(),J(),R(),ot?"":`${z(Rt,"Outer").$$render(t,{cls:mt("container",Qt,_),style:w,json:G,origJson:Y,templateContext:Z,layoutParams:Q,additionalPaddings:f,heightByAspect:Boolean(it)},{},{default:()=>`${M(s,(e=>`${z(fr,"Unknown").$$render(t,{layoutParams:dt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||ct?`${z(ue,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:ct,orientation:at},{},{})}`:""}`})}`})),de=ce,ve={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function ge(t,e){return"vertical"===t||"horizontal"===t?t:e}const pe=N(((t,e,n,i)=>{let o,s,l,u,c,d,v,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const b=g(X);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!==y&&n.layoutParams(y),o=b.getDerivedFromVars(h.delimiter_style),p(),p=a(o,(t=>v=t)),_=ge(null==v?void 0:v.orientation,_),s=!((null==v?void 0:v.color)&&("transparent"===v.color||9===v.color.length&&0===v.color.indexOf("#00"))),w=ot(null==v?void 0:v.color,1,w),l="horizontal"===_?"100%":rt(1),u="horizontal"===_?rt(1):"100%",c={background:w,width:l,height:u},d={orientation:_},p(),`${z(Rt,"Outer").$$render(t,{cls:mt("separator",ve,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",ve.separator__inner,0)}${J("style",et(c),0)}></span>`:""})}`})),he={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"},fe=N(((t,e,n,i)=>{let o,s,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,S,j,P,M,T,I,O,N,R,U,W,L=r,H=r,q=r,G=r,Z=r,Y=r,Q=r,tt=r,rt=r,nt=r,it=r,at=r,lt=r,ut=r,{json:ct={}}=e,{templateContext:dt}=e,{origJson:pt}=e,{layoutParams:ht}=e;const ft=g(X);let yt,bt=0,_t="rgba(0,0,0,0.08)",wt=!1,xt="",kt="none",Et="50% 50%",Ct="0",At="source_in",Vt="",Dt="",St=0,jt=0,Pt=0,Mt="",Tt="";d((()=>{ft.removeSvgFilter(yt,At)})),void 0===e.json&&n.json&&void 0!==ct&&n.json(ct),void 0===e.templateContext&&n.templateContext&&void 0!==dt&&n.templateContext(dt),void 0===e.origJson&&n.origJson&&void 0!==pt&&n.origJson(pt),void 0===e.layoutParams&&n.layoutParams&&void 0!==ht&&n.layoutParams(ht),o=ft.getDerivedFromVars(ct.image_url),ut(),ut=a(o,(t=>W=t)),s=ft.getDerivedFromVars(ct.gif_url),lt(),lt=a(s,(t=>U=t)),l=W||U,bt=0,l?wt=!1:(wt=!0,ft.logError(K(new Error('Missing "image_url" for "image"')))),u=ft.getDerivedFromVars(ct.width),at(),at=a(u,(t=>R=t)),c="wrap_content"===(null==R?void 0:R.type),v=ft.getDerivedFromVars(ct.height),it(),it=a(v,(t=>N=t)),p="wrap_content"===(null==N?void 0:N.type),h=ft.getDerivedFromVars(ct.preview),nt(),nt=a(h,(t=>O=t));{const t=O;xt=t?t.startsWith("data:")?`url("${st(t)}")`:`url("data:image/jpg;base64,${st(t)}")`:""}f=ft.getDerivedFromVars(ct.placeholder_color),rt(),rt=a(f,(t=>I=t)),_t=ot(I,1,_t),m=ft.getDerivedFromVars(ct.scale),tt(),tt=a(m,(t=>T=t)),kt=vt(T)||kt,y=ft.getDerivedFromVars({content_alignment_horizontal:ct.content_alignment_horizontal,content_alignment_vertical:ct.content_alignment_vertical}),Q(),Q=a(y,(t=>M=t)),Et=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:gt(t)}(M,Et),b=ft.getDerivedFromVars(ct.accessibility),Y(),Y=a(b,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=ft.getDerivedFromVars(ct.aspect),Z(),Z=a(w,(t=>j=t));{const t=null==j?void 0:j.ratio;Ct=t&&zt(t)?(100/Number(t)).toFixed(2):"0"}x=ft.getDerivedFromVars(ct.tint_color),G(),G=a(x,(t=>S=t)),$=ft.getDerivedFromVars(ct.tint_mode),q(),q=a($,(t=>D=t));{const t=S?ot(S):void 0,e=Yt(D,At);t===yt&&e===At||(ft.removeSvgFilter(yt,At),Vt=t?ft.addSvgFilter(t,e):"",yt=t,At=e)}if(k=ft.getDerivedFromVars(ct.appearance_animation),H(),H=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;Dt=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=$t(t.duration,300),jt=$t(t.start_delay,0),St=$t(t.alpha,0)}E=ft.getDerivedFromVars(ct.filters),L(),L=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=It(A,ft.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Mt=t,Tt=e}return C={aspect:"0"!==Ct,"is-width-content":c,"is-height-content":p,loaded:!1,"before-appearance":Boolean(Dt)&&!0},F={"background-image":xt,"background-color":xt?void 0:_t,"background-size":kt,"clip-path":Tt||void 0,"object-fit":kt,"object-position":Et,filter:["",Mt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Dt||void 0,"--divkit-appearance-fade-start":Dt?St:void 0,"--divkit-appearance-delay":Dt?`${jt}ms`:void 0,"--divkit-appearance-duration":Dt?`${Pt}ms`:void 0},L(),H(),q(),G(),Z(),Y(),Q(),tt(),rt(),nt(),it(),at(),lt(),ut(),wt?"":`${z(Rt,"Outer").$$render(t,{cls:mt("image",he,C),json:ct,origJson:pt,templateContext:dt,layoutParams:ht,customDescription:!0},{},{default:()=>C.aspect?`<span${J("class",he["image__aspect-wrapper"],0)}${B({"padding-bottom":`${Ct}%`})}><img${J("class",he.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",et(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",he.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",et(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}>`})}`})),me={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function ye(t){return t>0&&t<1}function be(t){return String(Math.ceil(1e3*t)/1e3)}function _e(t,e,r){if(t.some(ye)){const e=Math.max(...t.filter(ye).map((t=>1/t)));t=t.map((t=>t*e))}let 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(${rt(n*t[e]/i)},${be(t[e])}fr)`:t[e]?o[e]=`${be(t[e])}fr`:o[e]="auto";return o.join(" ")}const we=N(((t,e,n,i)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b=r,_=r,w=r,x=r,{json:$={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=g(X);let A,V,D=!1,S=1,j=[],P=[],T=[],I=[],O=0,N=!1,J="top",R="left";void 0===e.json&&n.json&&void 0!==$&&n.json($),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),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=$.items,(null==o?void 0:o.length)&&Array.isArray(o)?D=!1:(D=!0,F.logError(K(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars($.column_count),x(),x=a(s,(t=>y=t)),S=Ut(y,S),l=(!D&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;j=[],P=[],T=[],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,(!j[n]||j[n]<g)&&(j[n]=g),(!P[e]||P[e]<p)&&(P[e]=p),(!T[n]||T[n]<h)&&(T[n]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=S&&(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(K(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars($.content_alignment_vertical),_(),_=a(u,(t=>f=t)),J=Zt(f,J),c=F.getDerivedFromVars($.content_alignment_horizontal),b(),b=a(c,(t=>h=t)),R=Gt(h,R),d={valign:J,halign:R},v={"grid-template-columns":_e(j,T,S),"grid-template-rows":_e(P,I,O)},p=D||N,b(),_(),w(),x(),p?"":`${z(Rt,"Outer").$$render(t,{cls:mt("grid",me,d),json:$,origJson:E,templateContext:k,style:v,layoutParams:C},{},{default:()=>`${M(V,(e=>`${z(fr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),xe=we,$e={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function ke(t){const e=[];let r=t[0],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 Ee(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const Ce=N(((t,e,n,i)=>{let o,s,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,j,P,T,I,O,N,R=r,B=r,U=r,W=r,H=r,q=r,G=r,Y=r,Q=r,tt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=g(X);let lt,ut,ct=[],dt=!1,vt=!1,gt=null,pt=!1;const ht=st.getCustomization("galleryLeftClass"),ft=st.getCustomization("galleryRightClass");let yt=!1;O=a(st.isDesktop,(t=>I=t));let bt,_t,wt,kt,Et=1,Ft="horizontal",At="start",Vt=8,Dt="",St=[],jt={},Pt=!1,Mt={},Tt=0;const zt=Ee((function(){if(!lt)return;const t=lt.scrollLeft,e=lt.scrollWidth,r=lt.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function It(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const n=ct[e].children[r];n&&t.push(n)}return t}function Ot(t,e,r="smooth"){const n="horizontal"===Ft,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";lt.scroll({[o]:Math.max(0,t[e][i]-Vt/2),behavior:r})}function Nt(t){const e=It(),r=lt.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===Ft?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"===Ft?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}!nt.id||yt||(null==at?void 0:at.fakeElement)||st.registerInstance(nt.id,{setCurrentItem(t){const e=It();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Ot(e,t)},setPreviousItem(t){const e=Nt("prev"),r=It();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Ot(r,n)},setNextItem(t){const e="horizontal"===Ft?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=It();if(e&&"ring"===t)return void Ot(r,0);const n=Nt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Ot(r,i)}}),d((()=>{pt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?yt=!1:(yt=!0,st.logError(K(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!yt&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&pt&&!yt,l?"undefined"!=typeof ResizeObserver&&(gt=new ResizeObserver((()=>{zt()})),gt.observe(ut)):gt&&(gt.disconnect(),gt=null),u=st.getDerivedFromVars(nt.column_count),Q(),Q=a(u,(t=>T=t)),Et=Ut(T,Et),c=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,Et),v=st.getDerivedFromVars(nt.orientation),Y(),Y=a(v,(t=>P=t)),Ft=ge(P,Ft),p=st.getDerivedFromVars(nt.cross_content_alignment),G(),G=a(p,(t=>j=t)),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(j,At),h=st.getDerivedFromVars(nt.item_spacing),q(),q=a(h,(t=>D=t)),Vt=$t(D,Vt),bt=rt(Vt),f=st.getDerivedFromVars(nt.cross_spacing),H(),H=a(f,(t=>V=t)),wt=$t(V,Vt),_t=rt(wt),m=st.getDerivedFromVars(nt.paddings),W(),W=a(m,(t=>A=t)),Dt=xt(A,Dt),y="horizontal"===Ft?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===Ft?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),kt=L(t,(t=>t)),U(),U=a(kt,(t=>F=t))}St=[],Et>1?St.push("auto"):F.forEach((t=>{!t&&"horizontal"===Ft||"match_parent"===(null==t?void 0:t.type)?St.push("100%"):St.push("max-content")})),b=st.getDerivedFromVars(nt.scroll_mode),B(),B=a(b,(t=>C=t));{const t={};let e={};Pt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ft?e.parentVAlign=At:e.parentHAlign=At,"paging"===C&&(Pt=!0,e.scrollSnap="start",t["horizontal"===Ft?"scroll-padding-left":"scroll-padding-top"]=rt(Vt/2)),1===Et&&(e.parentLayoutOrientation=Ft),jt=Ct(t,jt),Mt=Ct(e,Mt)}return _=st.getDerivedFromVars(nt.restrict_parent_scroll),tt(),tt=a(_,(t=>N=t)),w={padding:Dt,"grid-gap":_t},x={"grid-gap":bt,[y]:ke(St)},$={orientation:Ft,"scroll-snap":Pt},k=st.getDerivedFromVars(nt.default_item),R(),R=a(k,(t=>E=t)),Tt=$t(E,Tt),R(),B(),U(),W(),H(),q(),G(),Y(),Q(),O(),tt(),"\n\n"+(yt?"":`${z(Rt,"Outer").$$render(t,{cls:mt("gallery",$e,$),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${S($e.gallery__scroller,!0)+" "+S(N?Z:"",!0)}"${J("style",et(jt),0)}${J("this",lt,0)}><div${J("class",$e["gallery__items-grid"],0)}${J("style",et(w),0)}${J("this",ut,0)}>${M(c,((e,r)=>`<div${J("class",$e.gallery__items,0)}${J("style",et(x),0)}${J("this",ct[r],0)}>${M(e,(e=>`${z(fr,"Unknown").$$render(t,{layoutParams:Mt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Ft?`${dt&&l?`\n <div${J("class",ht||`${$e.gallery__arrow} ${$e.gallery__arrow_left}`,0)}>${ht?"":`<svg${J("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",$e["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""}\n ${vt&&l?`\n <div${J("class",ft||`${$e.gallery__arrow} ${$e.gallery__arrow_right}`,0)}>${ft?"":`<svg${J("class",$e["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",$e["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`)})),Fe=Ce,Ae={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},Ve=N(((t,e,n,i)=>{let o,s,l,u,c,v,p,h,f,m,y,b,w,x,$,k,E,C,F,A,V,D,j,P,T=r,I=r,O=r,N=r,R=r,U=r,L=r,H=r,q=r;var G,Y;let{json:Q={}}=e,{templateContext:tt}=e,{origJson:it}=e,{layoutParams:at}=e;const st=g(X),lt=st.genId("tabs");let ut=!1,ct=W([]);$=a(ct,(t=>x=t));let dt,vt,gt,pt={};const ht=st.getJsonWithVars(Q.selected_tab);let ft,yt,_t=ht&&Number(ht)||0,kt=12,Et="",Ft="",At="",Vt="",jt="",Pt="",Tt="",It="",Ot=0,Nt="",Jt="",Bt=null,Wt=!1,Ht=!1,qt=_t,Gt=[],Zt=[];async function Yt(t,e=!1){if(qt=_t,_t=t,Wt||(Wt=!0,vt.style.height=rt(vt.clientHeight),gt.style.transform=`translate3d(${100*-qt}%,0,0)`),Ht=!0,async function(t){await _(),gt.style.transform=`translate3d(${t}%,0,0)`}(100*-_t),function(t=!1){const e=t?Math.max(0,_t-1):Math.min(_t,qt),r=t?Math.min(o.length-1,_t+1):Math.max(_t,qt);Gt=Gt.map(((t,n)=>t||n>=e&&n<=r)),Zt=Zt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${lt}-panel-${_t}`);t&&(vt.style.height=rt(t.offsetHeight))}(),Kt&&clearTimeout(Kt),Kt=window.setTimeout((()=>{Zt=o.map(((t,e)=>e===_t))}),400),Xt=-_t*vt.clientWidth,e){await _();const t=dt.querySelector(`.${Ae.tabs__item_selected}`);t&&t.focus()}}let Xt,Kt=null;if(!Q.id||ut||(null==at?void 0:at.fakeElement)||st.registerInstance(Q.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Yt(t)},setPreviousItem(t){let e=_t-1;e<0&&(e="ring"===t?o.length-1:_t),Yt(e)},setNextItem(t){let e=_t+1;e>o.length-1&&(e="ring"===t?0:_t),Yt(e)}}),d((()=>{Q.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(Q.id)})),void 0===e.json&&n.json&&void 0!==Q&&n.json(Q),void 0===e.templateContext&&n.templateContext&&void 0!==tt&&n.templateContext(tt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=Q.items||[],Array.isArray(o)&&o.length){let t=[];o.forEach(((e,r)=>{const n=st.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});n.title&&"string"==typeof n.title?t.push(n):st.logError(K(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),ct.set(t)}else ct.set([]);(null==x?void 0:x.length)?ut=!1:(ut=!0,st.logError(K(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=st.getDerivedFromVars(Q.width),H(),H=a(s,(t=>j=t)),l=st.getDerivedFromVars(Q.height),L(),L=a(l,(t=>D=t));{let t={};(null==at?void 0:at.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==j?void 0:j.type)&&(t.parentHorizontalWrapContent=!0),D&&"wrap_content"!==D.type||(t.parentVerticalWrapContent=!0),pt=Ct(t,pt)}if(!ut&&(_t<0||_t>=o.length)&&(st.logError(K(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Q.selected_tab,length:o.length}})),_t=_t<0?0:o.length-1),ut||x.some((t=>_t===t.index))||(st.logError(K(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Q.selected_tab}})),_t=(null===(G=x[0])||void 0===G?void 0:G.index)||0),u=st.getDerivedFromVars(Q.tab_title_style),U(),U=a(u,(t=>V=t)),c=V||{},kt=Ut(c.font_size,kt),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/kt*10,right:(Number(t.right)||0)/kt*10,bottom:(Number(t.bottom)||0)/kt*10,left:(Number(t.left)||0)/kt*10};Et=xt(e,Et)}{const t=c.line_height;void 0!==t&&zt(t)&&(Ft=rt(t/kt*10))}{const t=c.letter_spacing;void 0!==t&&wt(t)&&(At=rt(t/kt*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(Y=c.corner_radius)&&void 0!==Y?Y:1e3;c.corners_radius?Vt=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]&&!wt(i[t]))return n;return St(t,e,r)}(c.corners_radius,t,kt,Vt):wt(t)&&(Vt=rt(t/kt*10))}return ft=Lt(c.active_font_weight||c.font_weight,ft),yt=Lt(c.inactive_font_weight||c.font_weight,yt),jt=ot(c.active_text_color,1,jt),Pt=ot(c.inactive_text_color,1,Pt),Tt=ot(c.active_background_color,1,Tt),It=ot(c.inactive_background_color,1,It),Ot=$t(c.item_spacing,Ot),v=st.getDerivedFromVars(Q.has_separator),R(),R=a(v,(t=>A=t)),p=st.getDerivedFromVars(Q.separator_color),N(),N=a(p,(t=>F=t)),h=st.getDerivedFromVars(Q.separator_paddings),O(),O=a(h,(t=>C=t)),A&&(F&&(Nt=ot(F,1,Nt)),C&&(Jt=xt(C,Jt))),f={background:Nt,margin:Jt},m=st.getDerivedFromVars(Q.switch_tabs_by_content_swipe_enabled),I(),I=a(m,(t=>E=t)),y=void 0===E||Boolean(E),b=st.getDerivedFromVars(Q.restrict_parent_scroll),q(),q=a(b,(t=>P=t)),w=st.getDerivedFromVars(Q.title_paddings),T(),T=a(w,(t=>k=t)),Bt=Dt(k||void 0,Bt),ut||(Gt=o.map(((t,e)=>e===_t)),Zt=o.map(((t,e)=>e===_t))),$(),T(),I(),O(),N(),R(),U(),L(),H(),q(),ut?"":`${z(Rt,"Outer").$$render(t,{cls:mt("tabs",Ae,{}),json:Q,origJson:it,templateContext:tt,layoutParams:at,customActions:"tabs"},{},{default:()=>`\n <div class="${S(Ae.tabs__list,!0)+" "+S(P?Z:"",!0)}" role="tablist"${B({"--divkit-tabs-title-padding":Bt?bt(Bt):"","--divkit-tabs-font-size":rt(kt),"--divkit-tabs-paddings":Et,"--divkit-tabs-line-height":Ft,"--divkit-tabs-letter-spacing":At,"--divkit-tabs-active-font-weight":ft||"","--divkit-tabs-inactive-font-weight":yt||"","--divkit-tabs-active-text-color":jt,"--divkit-tabs-inactive-text-color":Pt,"--divkit-tabs-active-background-color":Tt,"--divkit-tabs-inactive-background-color":It,"--divkit-tabs-border-radius":Vt,"--divkit-tabs-items-spacing":Ot?nt(Ot):""})}${J("this",dt,0)}>${M(x,(e=>{let r=e.index,n=r===_t;return`\n \n\n ${z(Mt,"Actionable").$$render(t,{cls:mt("tabs__item",Ae,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=at&&at.fakeElement?[]:[e.title_click_action],attrs:{id:`${lt}-tab-${r}`,"aria-controls":`${lt}-panel-${r}`,role:"tab",tabindex:!n||null!=at&&at.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=at&&at.fakeElement?null:t=>function(t,e){return _t===e||(Yt(e),!1)}(0,r)},{},{default:()=>`${S(e.title)}\n `})}`}))}</div>\n ${A?`<div${J("class",Ae.tabs__separator,0)}${J("style",et(f),0)}></div>`:""}\n <div class="${S(Ae.tabs__panels,!0)+" "+S(P?Z:"",!0)}"${J("this",vt,0)}><div${J("class",mt("tabs__swiper",Ae,{inited:Wt,animated:Ht}),0)}${J("this",gt,0)}>${M(x,(e=>{let r=e.index;return`\n\n <div${J("class",mt("tabs__panel",Ae,{visible:Zt[r]}),0)} role="tabpanel" id="${S(lt,!0)+"-panel-"+S(r,!0)}" aria-labelledby="${S(lt,!0)+"-tab-"+S(r,!0)}" style="${"left: "+S(100*r,!0)+"%"}">${Gt[r]?`${z(fr,"Unknown").$$render(t,{div:o[r].div,templateContext:tt,layoutParams:pt},{},{})}`:""}\n </div>`}))}</div></div>`})}`})),De=Ve,Se="divkit-eb860",je="divkit-e08c6";function Pe(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)}}Pe([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),Pe([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const Me=N(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=g(X),c=g(yt);let p=new Map,h=new Set,f=!1,m=null,y=[],b=[],w=[],x=[];const $=o.div_id||o.id;let k;$?(null==l?void 0:l.fakeElement)||(c.registerInstance($,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],x.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],x=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):u.logError(K(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(K(new Error("Missing state block with id"),{additional:{id:t}}))}}),v(yt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(K(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 b.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 x.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(K(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return d((()=>{$&&!(null==l?void 0:l.fakeElement)&&c.unregisterInstance($)})),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(K(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||u.logError(K(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),f?"":`${z(Rt,"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(fr,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${M(y,(e=>"direction"in e?`<div${J("class",Se,0)} style="${"left:"+S(e.offsetLeft,!0)+"px;top:"+S(e.offsetTop,!0)+"px;width:"+S(e.width,!0)+"px;height:"+S(e.height,!0)+"px"}"><div${J("class",je,0)}>${z(fr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class",Se,0)}><div${J("class",je,0)}>${z(fr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),Te={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},ze=N(((t,e,n,i)=>{let o,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C=r,F=r,A=r,V=r,D=r,j=r;var P,T,I,O,N,R,B;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:H}=e;const q=g(X),G=q.genId("pager");let Y,Q=!1,tt=!1,it=0,ot=0,at=!1,st="horizontal",lt="",ut="",ct="";function dt(t,e="smooth"){const r="horizontal"===st,n=Y.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";Y.scroll({[o]:n[i],behavior:e}),it=t}Ee((function(){if(!Q)return;const t=function(){const t=Array.from(Y.children),e=Y.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===st?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:it}();t!==it&&(it=t)}),50),U.id&&!(null==H?void 0:H.fakeElement)&&q.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');dt(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),dt(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),dt(e)}}),d((()=>{Q=!1,U.id&&!(null==H?void 0:H.fakeElement)&&q.unregisterInstance(U.id)})),void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),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===(P=U.items)||void 0===P?void 0:P.length)&&Array.isArray(U.items)?tt=!1:(tt=!0,q.logError(K(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!tt&&U.items||[]).map((t=>{let e=t,r=W;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=q.getDerivedFromVars(U.layout_mode),F(),F=a(l,(t=>w=t)),w?"percentage"!==w.type&&"fixed"!==w.type?(at=!0,q.logError(K(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):at=!1:(at=!0,q.logError(K(new Error('Empty "layout_mode" prop for div "pager"')))),u=q.getDerivedFromVars(U.orientation),D(),D=a(u,(t=>k=t)),st=ge(k,st),c=q.getDerivedFromVars(U.item_spacing),V(),V=a(c,(t=>$=t));{const t=null==$?void 0:$.value;t&&wt(t)&&(lt=rt(t||0))}if(v=q.getDerivedFromVars(U.paddings),A(),A=a(v,(t=>x=t)),ut=xt(x,ut),p=q.getDerivedFromVars(U.restrict_parent_scroll),j(),j=a(p,(t=>E=t)),h="horizontal"===st?"grid-auto-columns":"grid-auto-rows","fixed"===(null==w?void 0:w.type)){const t=nt("horizontal"===st?((null===(T=U.paddings)||void 0===T?void 0:T.left)||0)+((null===(I=U.paddings)||void 0===I?void 0:I.right)||0):((null===(O=U.paddings)||void 0===O?void 0:O.top)||0)+((null===(N=U.paddings)||void 0===N?void 0:N.bottom)||0)),e=null===(R=w.neighbour_page_width)||void 0===R?void 0:R.value;ct=e?`calc(100% + ${t} - 2 * ${nt(e)} - 2 * ${lt})`:"100%"}else if("percentage"===(null==w?void 0:w.type)){const t=null===(B=w.page_width)||void 0===B?void 0:B.value;ct=`${Number(t)}%`}return f={"grid-gap":lt,padding:ut,[h]:ct},m={orientation:st},y=tt||at,b=q.getStore("pagers"),C(),C=a(b,(t=>_=t)),function(t,e){const r=U.id;if(r){const n=new Map(_);s(b,_=n.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:dt}),_)}}(o.length,it),function(t){var e;if(t===ot)return;ot=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(it),C(),F(),A(),V(),D(),j(),y?"":`${z(Rt,"Outer").$$render(t,{cls:mt("pager",Te,m),json:U,origJson:L,templateContext:W,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${S(Te.pager__items,!0)+" "+S(E?Z:"",!0)}"${J("style",et(f),0)}${J("this",Y,0)}>${M(o,(e=>`<div${J("class",Te.pager__item,0)}>${z(fr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ie=ze,Oe={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},Ne=N(((t,e,n,i)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,w,x,$,k,E,C,F=r,A=r,V=r,D=r,j=r,P=r,T=r,I=r,O=r;var N,R;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:q}=e;const G=["rounded_rectangle","circle"],Z=g(X);let Y,K,Q,tt={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},et={width:10,height:10,borderRadius:5,background:"#33919cb5"},nt="default",it=15,at=10,st=5;if(void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==q&&n.layoutParams(q),o=Z.getDerivedFromVars(U.shape),P(),P=a(o,(t=>$=t)),s=Z.getDerivedFromVars(U.active_item_color),D(),D=a(s,(t=>w=t)),l=Z.getDerivedFromVars(U.inactive_item_color),j(),j=a(l,(t=>x=t)),u=Z.getDerivedFromVars(U.active_item_size),T(),T=a(u,(t=>k=t)),c=Z.getDerivedFromVars(U.active_shape),O(),O=a(c,(t=>C=t)),d=Z.getDerivedFromVars(U.inactive_shape),I(),I=a(d,(t=>E=t)),C&&(tt=te({type:"shape_drawable",shape:C},G,tt)),E&&(et=te({type:"shape_drawable",shape:E},G,et)),!C&&!E&&$){const t=Ut(k,1.3);et=te({type:"shape_drawable",shape:$,color:et.background},G,et),et.background=ot(x,1,et.background),tt=Object.assign(Object.assign({},et),{width:et.width*t,height:et.height*t,borderRadius:et.borderRadius*t,background:tt.background}),tt.background=ot(w,1,tt.background)}if(v=Z.getDerivedFromVars(U.space_between_centers),A(),A=a(v,(t=>y=t)),p=Z.getDerivedFromVars(U.items_placement),V(),V=a(p,(t=>b=t)),!b||"default"!==b.type&&"stretch"!==b.type)nt="default",y&&(it=$t(y.value,it));else if(nt=b.type,"default"===nt)it=$t(null===(N=b.space_between_centers)||void 0===N?void 0:N.value,it);else if("stretch"===nt){const t=b;at=Ut(t.max_visible_items,at),st=$t(null===(R=t.item_spacing)||void 0===R?void 0:R.value,st)}return h=Z.getStore("pagers"),F(),F=a(h,(t=>m=t)),async function(t){if(U.pager_id&&t.has(U.pager_id)&&(Q=t.get(U.pager_id),await _(),K)){const t=K.children[Q.currentItem].offsetLeft;Y.scroll({left:t-Y.clientWidth/2,behavior:"smooth"})}}(m),f={placement:nt},F(),A(),V(),D(),j(),P(),T(),I(),O(),`${z(Rt,"Outer").$$render(t,{cls:mt("indicator",Oe,f),json:U,origJson:L,templateContext:W,layoutParams:q},{},{default:()=>`<div${J("class",Oe.indicator__scroller,0)}${J("this",Y,0)}><div${J("class",Oe.indicator__items,0)} role="tablist"${B({margin:"default"===nt?`0 ${rt(Math.max(0,tt.width-et.width)/2)}`:"","--divkit-indicator-inactive-width":rt(et.width),"--divkit-indicator-inactive-height":rt(et.height),"--divkit-indicator-inactive-border-radius":rt(et.borderRadius),"--divkit-indicator-inactive-background":et.background||"","--divkit-indicator-inactive-box-shadow":et.boxShadow||"","--divkit-indicator-active-width":rt(tt.width),"--divkit-indicator-active-height":rt(tt.height),"--divkit-indicator-active-border-radius":rt(tt.borderRadius),"--divkit-indicator-active-background":tt.background||"","--divkit-indicator-active-box-shadow":tt.boxShadow||"","--divkit-indicator-active-scale":tt.width/et.width,"--divkit-indicator-default-margin":"default"===nt?`0 ${rt((it-et.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===nt?rt(st):"","--divkit-indicator-stretch-max-count":"stretch"===nt?at:"","--divkit-indicator-stretch-max-spacer":"stretch"===nt?rt((at-1)*st):""})}${J("this",K,0)}>${Q?`${M(Array(Q.size),((t,e)=>{let r=e===Q.currentItem;return`\n <div class="${S(mt("indicator__item",Oe,{active:r}),!0)+" "+S(H,!0)}" role="tab" id="${S(Q.instId,!0)+"-tab-"+S(e,!0)}" aria-controls="${S(Q.instId,!0)+"-panel-"+S(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Je=Ne,Re={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function Be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&ot(t.text_color)||"#000",i=Wt(t.font_weight);if(zt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:rt(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 Ue(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const We="function"==typeof BigInt;function Le(t){return We?BigInt(t):Number(t)}const He=Le("9223372036854775807"),qe=Le("-9223372036854775808");function Ge(t){const e=Le(t);if(e>He||e<qe)throw new Error("Integer overflow.");return e}const Ze=Ge(0);function Ye(t){let e=t;return e<0&&(e=-e),e}function Xe(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ge(e)}class Ke{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=W(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 Qe={string:class extends Ke{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Ke{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 Ke{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>He||t<qe)throw new Error("Incorrect variable value");return Ge(t)}fromString(t){const e=Ge(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Ke{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 Ke{convertValue(t){if("string"!=typeof t||!at(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Ke{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function tr(t,e,r){if(!(e in Qe))throw new Error("Unsupported variable type");return new Qe[e](t,r)}function er(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 rr=N(((t,e,n,i)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,j,P,T,I,O,N,R,U,W,L,H,q,G=r,Z=r,Y=r,Q=r,tt=r,et=r,it=r,ot=r,at=r,st=r,lt=r,ut=r;var ct,dt,vt,gt;let{json:pt={}}=e,{templateContext:ht}=e,{origJson:ft}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},_t=["rounded_rectangle","circle"],xt=["rounded_rectangle"],$t=g(X),kt=g(Pt);let Et,Ct=0,Ft=100;const Vt=$t.getJsonWithVars(pt.thumb_value_variable),Dt=$t.getJsonWithVars(pt.thumb_secondary_value_variable);L=a(Vt&&$t.getVariable(Vt,"integer")||tr("temp","integer",0),(t=>W=t)),U=a(Dt&&$t.getVariable(Dt,"integer")||tr("temp","integer",0),(t=>R=t));let St,jt,Mt,Tt=Ue(W||0,Ct,Ft),zt=Ue(R||0,Ct,Ft),It=bt,Ot=It,Nt=bt,Jt=bt,Bt=null,Ut=null,Wt=Mt,Lt="",Ht="",qt=!1,Gt=!1;function Zt(){if(!Et)return;const t=Ft-Ct,e=(null==Bt?void 0:Bt.width)||0,r=(null==Ut?void 0:Ut.width)||0;Math.max(e,r)*t>=(null==Et?void 0:Et.clientWidth)?Gt||($t.logError(K(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}Ee(Zt,50),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==ht&&n.templateContext(ht),void 0===e.origJson&&n.origJson&&void 0!==ft&&n.origJson(ft),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=$t.getDerivedFromVars(pt.min_value),ut(),ut=a(o,(t=>q=t)),s=$t.getDerivedFromVars(pt.max_value),lt(),lt=a(s,(t=>H=t)),Ct=At(q,Ct),Ft=At(H,Ft),Zt();{const t=Ue(W||0,Ct,Ft);t!==Tt&&(Tt=t)}{const t=Ue(R||0,Ct,Ft);t!==zt&&(zt=t)}l=$t.getDerivedFromVars(pt.thumb_style),st(),st=a(l,(t=>N=t)),It=te(N,_t,It),u=$t.getDerivedFromVars(pt.thumb_secondary_style),at(),at=a(u,(t=>O=t)),Ot=te(O,_t,It),c=$t.getDerivedFromVars(pt.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Nt=te(I,xt,Nt),d=$t.getDerivedFromVars(pt.track_active_style),it(),it=a(d,(t=>T=t)),Jt=te(T,xt,Jt),v=$t.getDerivedFromVars(pt.tick_mark_active_style),et(),et=a(v,(t=>P=t));{let t=te(P,_t,bt);t!==bt&&(Bt=t)}Bt?(St=Dt?er(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Ft,!0):er(Ct,Tt,Ct,Ft,!0),Zt()):St=[],p=$t.getDerivedFromVars(pt.tick_mark_inactive_style),tt(),tt=a(p,(t=>j=t));{let t=te(j,_t,bt);t!==bt&&(Ut=t)}Ut?(jt=Dt?er(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Ft,!1):er(Tt+1,Ft+1,Ct,Ft,!0),Zt()):jt=[],h=$t.getDerivedFromVars(pt.thumb_text_style),Q(),Q=a(h,(t=>D=t)),Mt=Be(D,Mt),f=$t.getDerivedFromVars(pt.thumb_secondary_text_style),Y(),Y=a(f,(t=>V=t)),Wt=Be(V,Mt),m=$t.getDerivedFromVars(pt.accessibility),Z(),Z=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:$t.logError(K(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=$t.getDerivedFromVars(pt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Ht=F.description:Dt&&$t.logError(K(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?($t.logError(K(new Error('Cannot show "slider" inside component with action'))),t=!0):It===bt?($t.logError(K(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===bt?($t.logError(K(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===bt&&($t.logError(K(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return b=rt(Math.max(...[It.width,Ot.width,0].filter(wt))),_=rt(Math.max(...[It.height,Ot.height,0].filter(wt))),w=(Tt-Ct)/(Ft-Ct),x=Dt?(zt-Ct)/(Ft-Ct):void 0,$=void 0!==x?Math.abs(x-w):w,k=void 0!==x?Math.min(x,w):0,E={"--divkit-slider-thumb-width":rt(It.width),"--divkit-slider-thumb-height":rt(It.height),"--divkit-slider-thumb-secondary-width":rt(Ot.width),"--divkit-slider-thumb-secondary-height":rt(Ot.height),"--divkit-slider-text-offset-x":(null===(ct=null==Mt?void 0:Mt.offset)||void 0===ct?void 0:ct.x)?nt(Mt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==Mt?void 0:Mt.offset)||void 0===dt?void 0:dt.y)?nt(Mt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Wt?void 0:Wt.offset)||void 0===vt?void 0:vt.x)?nt(Wt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Wt?void 0:Wt.offset)||void 0===gt?void 0:gt.y)?nt(Wt.offset.y):void 0,"--divkit-slider-tick-active-width":Bt?rt(Bt.width):void 0,"--divkit-slider-tick-active-height":Bt?rt(Bt.height):void 0,"--divkit-slider-tick-active-border-radius":Bt?rt(Bt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Ut?rt(Ut.width):void 0,"--divkit-slider-tick-inactive-height":Ut?rt(Ut.height):void 0,"--divkit-slider-tick-inactive-border-radius":Ut?rt(Ut.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Ut?void 0:Ut.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Ut?void 0:Ut.boxShadow)||void 0,"--divkit-slider-max-thumb-width":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":x},C={},G(),Z(),Y(),Q(),tt(),et(),it(),ot(),at(),st(),U(),L(),lt(),ut(),"\n\n"+(qt?"":`${z(Rt,"Outer").$$render(t,{cls:mt("slider",Re,C),style:E,customDescription:!0,customActions:"slider",json:pt,origJson:ft,templateContext:ht,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${J("class",Re["slider__tracks-wrapper"],0)}><div${J("class",Re["slider__tracks-inner"],0)}${J("this",Et,0)}><div${J("class",Re.slider__track,0)}${B({height:rt(Nt.height),"border-radius":rt(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n <div${J("class",Re["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*$).toFixed(2)+"%",height:rt(Jt.height),"border-radius":rt(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${M(St,(t=>`<div class="${S(Re.slider__tick,!0)+" "+S(Re.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${M(jt,(t=>`<div class="${S(Re.slider__tick,!0)+" "+S(Re.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Re.slider__thumb,0)}${B({"border-radius":rt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Mt?`<div${J("class",Re["slider__thumb-text"],0)}><div${J("class",Re["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=Mt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Mt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Mt)||void 0===r?void 0:r.textColor)||"#000"})}>${S(Tt)}</div></div>`:""}</div>\n ${Dt?`<div class="${S(Re.slider__thumb,!0)+" "+S(Re.slider__thumb_secondary,!0)}"${B({"border-radius":rt(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Wt?`<div class="${S(Re["slider__thumb-text"],!0)+" "+S(Re["slider__thumb-text_secondary"],!0)}"><div${J("class",Re["slider__thumb-text-inner"],0)}${B({"font-size":(null===(n=Wt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Wt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Wt)||void 0===o?void 0:o.textColor)||"#000"})}>${S(zt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Re.slider__input,0)}${J("min",Ct,0)}${J("max",Ft,0)} step="1"${J("value",Tt,0)}${J("aria-label",Lt,0)}>\n ${Dt?`<input type="range"${J("class",`${Re.slider__input} ${Re.slider__input_secondary}`,0)}${J("min",Ct,0)}${J("max",Ft,0)} step="1"${J("value",zt,0)}${J("aria-label",Ht,0)}>`:""}</div></div>`}})}`)})),nr={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"};function ir(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=ir(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,n=e.length-1;const i=e.length-t.length;for(;r<n&&r<t.length&&t[r]===e[r];)++r;for(;n-i>=r&&t[n-i]===e[n];)--n;return++n,{start:r,added:n-r,removed:n-r-i}}function or(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class ar{constructor(t){this.char=t}}class sr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class lr{constructor(t){or(this,"filters",new Map),or(this,"destructedValue",[]),or(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof ar)t+=r.char;else if(r instanceof sr)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof sr&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(K(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new sr(null,this.filters.get(e.key),e.placeholder):new ar(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=ir(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const n=this.buildBodySubstring(r,t),i=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=this.calculateMaxShift(i,o);this.replaceChars(n,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(i,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,n=e;for(;n<this.destructedValue.length;)this.destructedValue[n]instanceof sr&&++r,++n;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let n=0;for(;n<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+n);)++n;return Math.max(0,n-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof sr&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof sr&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let n;n=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=n}calculateInsertableSubstring(t,e){let r="",n=e;const i=()=>{for(var t;n<this.destructedValue.length&&!(this.destructedValue[n]instanceof sr);)++n;return null===(t=this.destructedValue[n])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=i();null!=e&&e.test(t)&&(r+=t,++n)})),r}collectValueRange(t,e){let r="",n=t;for(;n<=e;){const t=this.destructedValue[n];t instanceof sr&&null!==t.char&&(r+=t.char),++n}return r}replaceChars(t,e,r){let n=this.calculateInsertableSubstring(t,e);void 0!==r&&(n=n.substring(0,r));let i=e,o=0;for(;i<this.destructedValue.length&&o<n.length;){const t=this.destructedValue[i],e=n[o];t instanceof sr&&(t.char=e,++o),++i}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof sr);)++e;return e}}class ur extends lr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function cr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class dr extends lr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),cr(this,"currencyFormatter",new Intl.NumberFormat),cr(this,"decimalSeparator","."),cr(this,"localeDigits",{}),cr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(K(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),n=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:n,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=ir(this.value,t),n=this.value.lastIndexOf(this.decimalSeparator),i=t.lastIndexOf(this.decimalSeparator),o=n!==i||-1===n&&-1===i,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,n=0;for(;n<t.length;){if(t[n]===this.decimalSeparator&&!this.inDiff(e,n)){r=n;break}n++}let i=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(i=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(n=r;n<t.length;)this.isDigit(t[n])&&!this.inDiff(e,n)&&a--,n++;else{let r=!1;for(let n=0;n<t.length;n++){const i=t[n];i===this.decimalSeparator?r=!0:!this.inDiff(e,n)&&r&&this.isDigit(i)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==i,l=[];n=t.length-1;let u=!1;for(;n>=0;){const c=t[n],d=l.length<=o;this.isDigit(c)?this.inDiff(e,n)&&!u&&s?a>0&&(l.push(c),a--):l.push(c):d&&-1===r&&n===i?(l.push(this.decimalSeparator),u=!0):!d||c!==this.decimalSeparator||r!==n&&-1!==r||(l.push(this.decimalSeparator),u=!0,r=n),n--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}const vr=N(((t,e,n,i)=>{let o,l,u,c,d,v,p,h,f,m,y,b,w,x,$,k,E,C,F,A,V,D,j,P,M,T,I,O,N,R,B,U,W,L,H,q,G,Z=r,Y=r;var Q;let{json:tt={}}=e,{templateContext:it}=e,{origJson:at}=e,{layoutParams:st}=e;const lt=g(X);let ut,ct=null;const dt=tt.text_variable,vt=null===(Q=tt.mask)||void 0===Q?void 0:Q.raw_text_variable;let gt=!1;dt||(gt=!0,lt.logError(K(new Error('Missing "text_variable" in "input"'))));let pt=dt&<.getVariable(dt,"string")||tr("temp","string","");f=a(pt,(t=>h=t));let ht=vt&<.getVariable(vt,"string")||tr("temp","string","");y=a(ht,(t=>m=t));let ft="";E=a(lt.getDerivedFromVars(tt.mask),(t=>k=t)),H=a(lt.getDerivedFromVars(tt.hint_text),(t=>L=t)),W=a(lt.getDerivedFromVars(tt.hint_color),(t=>U=t));let yt="";B=a(lt.getDerivedFromVars(tt.font_size),(t=>R=t));let wt,xt,kt=12;N=a(lt.getDerivedFromVars(tt.font_weight),(t=>O=t)),I=a(lt.getDerivedFromVars(tt.line_height),(t=>T=t)),M=a(lt.getDerivedFromVars(tt.letter_spacing),(t=>P=t));let Et="";j=a(lt.getDerivedFromVars(tt.text_color),(t=>D=t));let Ct="#000";V=a(lt.getDerivedFromVars(tt.highlight_color),(t=>A=t));let Ft="";F=a(lt.getDerivedFromVars(tt.keyboard_type),(t=>C=t));const At={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let Vt="multi_line_text",St="text";const jt=document&&"inputMode"in document.createElement("input");let Pt;$=a(lt.getDerivedFromVars(tt.max_visible_lines),(t=>x=t));let Mt="",Tt=null,It="",Ot="";async function Nt(){if(!ut||!ct)return;ct.overrideRawValue(m),ht.set(ct.rawValue),s(pt,h=ft=ct.value,h);const t=ct.cursorPosition;await _(),document.activeElement===ut&&(ut.selectionStart=ut.selectionEnd=t)}var Jt;G=a(lt.getDerivedFromVars(tt.select_all_on_focus),(t=>q=t)),void 0===e.json&&n.json&&void 0!==tt&&n.json(tt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==at&&n.origJson(at),void 0===e.layoutParams&&n.layoutParams&&void 0!==st&&n.layoutParams(st),"fixed_length"===(null==(Jt=k)?void 0:Jt.type)?ct=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const n={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(n),r):new ur(n,e)}return r||null}(Jt,lt.logError,ct):"currency"===(null==Jt?void 0:Jt.type)&&(ct=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new dr(t.locale,e)}(Jt,lt.logError,ct)),ct&&Nt(),ct||ft===h||(ft=h),ct&&ct.rawValue!==m&&Nt(),o=L,yt=ot(U,1,yt),kt=Ut(R,kt),wt=Lt(O,wt);{const t=T;zt(t)&&(xt=t/kt)}return _t(P)&&(Et=rt(P)),Ct=ot(D,1,Ct),Ft=ot(A,1,Ft),C&&C in At&&(St=At[C],Vt=C),"currency"===(null==k?void 0:k.type)&&(St=jt?"text":"tel",Pt="decimal"),l="multi_line_text"===Vt,u=lt.getDerivedFromVars(tt.paddings),Y(),Y=a(u,(t=>w=t)),zt(x)&&(Mt=`calc(${x*(xt||1.25)*(kt/10)+"em"} + ${nt($t(null==w?void 0:w.top,0)+$t(null==w?void 0:w.bottom,0))})`),Tt=Dt(w||void 0,Tt),It=Tt?bt({top:(Number(Tt.top)||0)/kt*10,right:(Number(Tt.right)||0)/kt*10,bottom:(Number(Tt.bottom)||0)/kt*10,left:(Number(Tt.left)||0)/kt*10}):"",c=lt.getDerivedFromVars(tt.accessibility),Z(),Z=a(c,(t=>b=t)),(null==b?void 0:b.description)?Ot=b.description:lt.logError(K(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(Ft),"vertical-overflow":!1,multiline:l},v={"--divkit-input-hint-color":yt,"--divkit-input-highlight-color":Ft,"font-weight":wt,"line-height":xt,"letter-spacing":Et,color:Ct,"max-height":Mt},p={"font-size":rt(kt),padding:It},f(),y(),Z(),Y(),$(),E(),F(),V(),j(),M(),I(),N(),B(),W(),H(),G(),gt?"":`${z(Rt,"Outer").$$render(t,{cls:mt("input",nr,d),style:v,customDescription:!0,customActions:"input",customPaddings:!0,json:tt,origJson:at,templateContext:it,layoutParams:st},{},{default:()=>`<span${J("class",nr.input__wrapper,0)}${J("style",et(p),0)}><span${J("class",nr.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${S(ft)}${ft.endsWith("\n")||!ft?"":""}</span>\n ${l?`<textarea${J("class",nr.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",Ot,0)}${J("style",et({padding:It}),0)}${J("placeholder",o,0)}${J("this",ut,0)}>${S(ft,!1)}</textarea>`:`<input${J("type",St,0)}${J("inputmode",Pt,0)}${J("class",nr.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",Ot,0)}${J("style",et({padding:It}),0)}${J("placeholder",o,0)}${J("value",ft,0)}${J("this",ut,0)}>`}</span>`})}`})),gr={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72",select__option:"divkit-e774b"},pr=N(((t,e,n,i)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,j,P=r,T=r,{json:I={}}=e,{templateContext:O}=e,{origJson:N}=e,{layoutParams:R}=e;const B=g(X),U=B.getJsonWithVars(I.value_variable);let W=!1;U||(W=!0,B.logError(K(new Error('Missing "value_variable" in "select"')))),j=a(U&&B.getVariable(U,"string")||tr("temp","string",""),(t=>D=t));let L="";const H=I.options,q=Array.isArray(H)&&H.filter((t=>"string"==typeof t.value))||[];Array.isArray(q)&&q.length||B.logError(K(new Error('Empty selection "items" in "select"')));let G="",Z=null,Y="";A=a(B.getDerivedFromVars(I.hint_text),(t=>F=t)),C=a(B.getDerivedFromVars(I.hint_color),(t=>E=t));let Q="rgba(0,0,0,.45)";k=a(B.getDerivedFromVars(I.font_size),(t=>$=t));let tt,nt,it=12;x=a(B.getDerivedFromVars(I.font_weight),(t=>w=t)),_=a(B.getDerivedFromVars(I.line_height),(t=>b=t)),y=a(B.getDerivedFromVars(I.letter_spacing),(t=>m=t));let at="";f=a(B.getDerivedFromVars(I.text_color),(t=>h=t));let st="#000",lt="";void 0===e.json&&n.json&&void 0!==I&&n.json(I),void 0===e.templateContext&&n.templateContext&&void 0!==O&&n.templateContext(O),void 0===e.origJson&&n.origJson&&void 0!==N&&n.origJson(N),void 0===e.layoutParams&&n.layoutParams&&void 0!==R&&n.layoutParams(R),L=D;{const t=q.find((t=>t.value===D));t?G="string"==typeof t.text?t.text:t.value:(G="",D&&B.logError(K(new Error('Value from the variable was not found in the selection items for "select"'))))}o=B.getDerivedFromVars(I.paddings),T(),T=a(o,(t=>V=t)),it=Ut($,it),Z=Dt(V||void 0,Z),Y=Z?bt({top:(Number(Z.top)||0)/it*10,right:(Number(Z.right)||0)/it*10,bottom:(Number(Z.bottom)||0)/it*10,left:(Number(Z.left)||0)/it*10}):"",s=F,Q=ot(E,1,Q),tt=Lt(w,tt);{const t=b;zt(t)&&(nt=t/it)}return _t(m)&&(at=rt(m/it*10)),st=ot(h,1,st),l=B.getDerivedFromVars(I.accessibility),P(),P=a(l,(t=>p=t)),(null==p?void 0:p.description)?lt=p.description:B.logError(K(new Error('Missing accessibility "description" for select'),{level:"warn"})),u={hint:!G},c={"--divkit-input-hint-color":Q,"font-weight":tt,color:st},d={padding:Y,"font-size":rt(it),"line-height":nt,"letter-spacing":at},v={"font-size":rt(it),"line-height":nt,"letter-spacing":at},P(),f(),y(),_(),x(),k(),C(),A(),T(),j(),W?"":`${z(Rt,"Outer").$$render(t,{cls:mt("select",gr,u),style:c,customDescription:!0,customActions:"select",customPaddings:!0,json:I,origJson:N,templateContext:O,layoutParams:R},{},{default:()=>`<span${J("class",gr["select__select-text"],0)}${J("style",et(d),0)} aria-hidden="true">\n ${S(G||s||"")}</span>\n\n <select${J("class",gr.select__select,0)}${J("aria-label",lt,0)}${J("style",et(v),0)}>${M(q,(t=>`<option${J("class",gr.select__option,0)}${J("value",t.value,0)}>${S(t.text||t.value)}</option>`))}</select>`})}`})),hr={};hr.text=Kt,hr.container=de,hr.separator=pe,hr.image=fe,hr.gif=fe,hr.grid=xe,hr.gallery=Fe,hr.tabs=De,hr.state=Me,hr.pager=Ie,hr.indicator=Je,hr.slider=rr,hr.input=vr,hr.select=pr;const fr=N(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=g(X);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&&hr[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&hr[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(K(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},{},{})}`:""})),mr=N(((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${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${M([...Object.keys(i)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",i[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function yr(t,e,r,n){const i=r[t.type];if(!i)return n(K(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 br(){}function _r(t){return{subscribe:e=>(e(t),br)}}function wr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function xr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function $r(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 kr(t){try{return Ge(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function Er(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Cr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Cr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function Fr(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:Fe,JsonStringContents:function(){var t,e,r;for(t=pe,e=[],r=Ae();r!==n;)e.push(r),r=Ae();return he=t,e=St(e)}},a=Fe,s="@{",l="}",u="@{}",c="\\",d="?",v=":",g="||",p="&&",h="==",f="!=",m=">=",y=">",b="<=",_="<",w="+",x="-",$="/",k="*",E="%",C="!",F="(",A=")",V=",",D="'",S=".",j="e",P="E",M="true",T="false",z=/^[^}]/,I=/^[^'}]/,O=/^[0-9]/,N=/^[a-zA-Z_0-9.]/,J=/^[a-zA-Z_]/,R=/^[ \t\r\n]/,B=we("@{",!1),U=we("}",!1),W=we("@{}",!1),L=we("\\",!1),H={type:"any"},q=xe(["}"],!0,!1),G=we("?",!1),Z=we(":",!1),Y=we("||",!1),X=we("&&",!1),K=we("==",!1),Q=we("!=",!1),tt=we(">=",!1),et=we(">",!1),rt=we("<=",!1),nt=we("<",!1),it=we("+",!1),ot=we("-",!1),at=we("/",!1),st=we("*",!1),lt=we("%",!1),ut=we("!",!1),ct=we("(",!1),dt=we(")",!1),vt=we(",",!1),gt=$e("string"),pt=we("'",!1),ht=xe(["'","}"],!0,!1),ft=$e("integer"),mt=xe([["0","9"]],!1,!1),yt=$e("number"),bt=we(".",!1),_t=we("e",!1),wt=we("E",!1),xt=$e("boolean"),$t=we("true",!1),kt=we("false",!1),Et=xe([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ct=$e("identifier"),Ft=xe([["a","z"],["A","Z"],"_"],!1,!1),At=$e("whitespace"),Vt=xe([" ","\t","\r","\n"],!1,!1),Dt=function(t){return t},St=function(t){return $r(t)},jt=function(t){return t},Pt=function(){return""},Mt=function(){return _e()},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(){throw new Error("Error tokenizing '"+t+"'.")},It=function(t){return t},Ot=function(t){return Er(t)},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},Jt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Rt=function(t,e){return xr(t,e)},Bt=function(t,e){return xr(t,e)},Ut=function(t,e){return wr(t,e)},Wt=function(t,e){return wr(t,e)},Lt=function(t,e){return wr(t,e)},Ht=function(t,e){return wr(t,e)},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t){return{type:"Variable",id:t}},Yt=function(t,e){return[t,...e]},Xt=function(t){return t},Kt=function(t){return t},Qt=function(t){return $r(t)},te=function(t){return t},ee=function(){return""},re=function(){return _e()},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},ie=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ae=function(t){return Er(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:kr(_e())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},de=function(){return{type:"BooleanLiteral",value:!0}},ve=function(){return{type:"BooleanLiteral",value:!1}},ge=function(){return{type:"Identifier",name:_e()}},pe=0,he=0,fe=[{line:1,column:1}],me=0,ye=[],be=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function _e(){return t.substring(he,pe)}function we(t,e){return{type:"literal",text:t,ignoreCase:e}}function xe(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function $e(t){return{type:"other",description:t}}function ke(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return fe[e]=n,n}function Ee(t,e,r){var n=ke(t),o=ke(e),a={source:i,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:o.line,column:o.column}};return r&&i&&"function"==typeof i.offset&&(a.start=i.offset(a.start),a.end=i.offset(a.end)),a}function Ce(t){pe<me||(pe>me&&(me=pe,ye=[]),ye.push(t))}function Fe(){var t,e;return t=pe,Re(),(e=Ve())!==n?(Re(),he=t,t=Dt(e)):(pe=t,t=n),t}function Ae(){var e,r,i,o,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===be&&Ce(B)),r!==n?(i=Re(),(o=Ve())!==n?(Re(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===be&&Ce(U)),a!==n?(he=e,e=jt(o)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===u?(r=u,pe+=3):(r=n,0===be&&Ce(W)),r!==n&&(he=e,r=Pt()),(e=r)===n&&(e=pe,r=pe,be++,92===t.charCodeAt(pe)?(i=c,pe++):(i=n,0===be&&Ce(L)),i===n&&(t.substr(pe,2)===s?(i=s,pe+=2):(i=n,0===be&&Ce(B))),be--,i===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(i=t.charAt(pe),pe++):(i=n,0===be&&Ce(H)),i!==n?(he=e,e=Mt()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===be&&Ce(B)),r!==n){if(i=[],z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(q)),o!==n)for(;o!==n;)i.push(o),z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(q));else i=n;i!==n?(125===t.charCodeAt(pe)?(o=l,pe++):(o=n,0===be&&Ce(U)),o!==n?(he=e,e=Tt()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===be&&Ce(B)),r!==n&&(he=e,r=zt()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=n,0===be&&Ce(L)),r!==n?(t.substr(pe,2)===s?(i=s,pe+=2):(i=n,0===be&&Ce(B)),i!==n?(he=e,e=It(i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=n,0===be&&Ce(L)),r!==n?(t.length>pe?(i=t.charAt(pe),pe++):(i=n,0===be&&Ce(H)),i!==n?(he=e,e=Ot(i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=n,0===be&&Ce(L)),r!==n&&(he=e,r=Nt()),e=r))))}return e}function Ve(){var e,r,i,o,a,s;return e=pe,(r=De())!==n?(Re(),63===t.charCodeAt(pe)?(i=d,pe++):(i=n,0===be&&Ce(G)),i!==n?(Re(),(o=Ve())!==n?(Re(),58===t.charCodeAt(pe)?(a=v,pe++):(a=n,0===be&&Ce(Z)),a!==n?(Re(),(s=Ve())!==n?(he=e,e=Jt(r,o,s)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=De()),e}function De(){var e,r,i,o,a,s,l,u;if(e=pe,(r=Se())!==n){for(i=[],o=pe,a=Re(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===be&&Ce(Y)),s!==n?(l=Re(),(u=Se())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);o!==n;)i.push(o),o=pe,a=Re(),t.substr(pe,2)===g?(s=g,pe+=2):(s=n,0===be&&Ce(Y)),s!==n?(l=Re(),(u=Se())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);he=e,e=Rt(r,i)}else pe=e,e=n;return e}function Se(){var e,r,i,o,a,s,l,u;if(e=pe,(r=je())!==n){for(i=[],o=pe,a=Re(),t.substr(pe,2)===p?(s=p,pe+=2):(s=n,0===be&&Ce(X)),s!==n?(l=Re(),(u=je())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);o!==n;)i.push(o),o=pe,a=Re(),t.substr(pe,2)===p?(s=p,pe+=2):(s=n,0===be&&Ce(X)),s!==n?(l=Re(),(u=je())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);he=e,e=Bt(r,i)}else pe=e,e=n;return e}function je(){var e,r,i,o,a,s,l,u;if(e=pe,(r=Pe())!==n){for(i=[],o=pe,a=Re(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===be&&Ce(K)),s===n&&(t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===be&&Ce(Q))),s!==n?(l=Re(),(u=Pe())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);o!==n;)i.push(o),o=pe,a=Re(),t.substr(pe,2)===h?(s=h,pe+=2):(s=n,0===be&&Ce(K)),s===n&&(t.substr(pe,2)===f?(s=f,pe+=2):(s=n,0===be&&Ce(Q))),s!==n?(l=Re(),(u=Pe())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);he=e,e=Ut(r,i)}else pe=e,e=n;return e}function Pe(){var e,r,i,o,a,s,l,u;if(e=pe,(r=Me())!==n){for(i=[],o=pe,a=Re(),t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===be&&Ce(tt)),s===n&&(62===t.charCodeAt(pe)?(s=y,pe++):(s=n,0===be&&Ce(et)),s===n&&(t.substr(pe,2)===b?(s=b,pe+=2):(s=n,0===be&&Ce(rt)),s===n&&(60===t.charCodeAt(pe)?(s=_,pe++):(s=n,0===be&&Ce(nt))))),s!==n?(l=Re(),(u=Me())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);o!==n;)i.push(o),o=pe,a=Re(),t.substr(pe,2)===m?(s=m,pe+=2):(s=n,0===be&&Ce(tt)),s===n&&(62===t.charCodeAt(pe)?(s=y,pe++):(s=n,0===be&&Ce(et)),s===n&&(t.substr(pe,2)===b?(s=b,pe+=2):(s=n,0===be&&Ce(rt)),s===n&&(60===t.charCodeAt(pe)?(s=_,pe++):(s=n,0===be&&Ce(nt))))),s!==n?(l=Re(),(u=Me())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);he=e,e=Wt(r,i)}else pe=e,e=n;return e}function Me(){var e,r,i,o,a,s,l,u;if(e=pe,(r=Te())!==n){for(i=[],o=pe,a=Re(),43===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===be&&Ce(it)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===be&&Ce(ot))),s!==n?(l=Re(),(u=Te())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);o!==n;)i.push(o),o=pe,a=Re(),43===t.charCodeAt(pe)?(s=w,pe++):(s=n,0===be&&Ce(it)),s===n&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=n,0===be&&Ce(ot))),s!==n?(l=Re(),(u=Te())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);he=e,e=Lt(r,i)}else pe=e,e=n;return e}function Te(){var e,r,i,o,a,s,l,u;if(e=pe,(r=ze())!==n){for(i=[],o=pe,a=Re(),47===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===be&&Ce(at)),s===n&&(42===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===be&&Ce(st)),s===n&&(37===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===be&&Ce(lt)))),s!==n?(l=Re(),(u=ze())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);o!==n;)i.push(o),o=pe,a=Re(),47===t.charCodeAt(pe)?(s=$,pe++):(s=n,0===be&&Ce(at)),s===n&&(42===t.charCodeAt(pe)?(s=k,pe++):(s=n,0===be&&Ce(st)),s===n&&(37===t.charCodeAt(pe)?(s=E,pe++):(s=n,0===be&&Ce(lt)))),s!==n?(l=Re(),(u=ze())!==n?o=a=[a,s,l,u]:(pe=o,o=n)):(pe=o,o=n);he=e,e=Ht(r,i)}else pe=e,e=n;return e}function ze(){var e,r,i;return(e=Ne())===n&&(e=Oe())===n&&(e=pe,33===t.charCodeAt(pe)?(r=C,pe++):(r=n,0===be&&Ce(ut)),r===n&&(43===t.charCodeAt(pe)?(r=w,pe++):(r=n,0===be&&Ce(it)),r===n&&(45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===be&&Ce(ot)))),r!==n?(Re(),(i=ze())!==n?(he=e,e=qt(r,i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=function(){var e,r,i,o,a;return e=pe,(r=Je())!==n?(Re(),40===t.charCodeAt(pe)?(i=F,pe++):(i=n,0===be&&Ce(ct)),i!==n?(Re(),o=function(){var e,r,i,o,a,s;if(e=pe,(r=Ve())!==n){for(i=[],o=pe,Re(),44===t.charCodeAt(pe)?(a=V,pe++):(a=n,0===be&&Ce(vt)),a!==n?(Re(),(s=Ve())!==n?o=s:(pe=o,o=n)):(pe=o,o=n);o!==n;)i.push(o),o=pe,Re(),44===t.charCodeAt(pe)?(a=V,pe++):(a=n,0===be&&Ce(vt)),a!==n?(Re(),(s=Ve())!==n?o=s:(pe=o,o=n)):(pe=o,o=n);he=e,e=Yt(r,i)}else pe=e,e=n;return e===n&&(e=Re()),e}(),o!==n?(Re(),41===t.charCodeAt(pe)?(a=A,pe++):(a=n,0===be&&Ce(dt)),a!==n?(he=e,e=Gt(r,o)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,(r=Je())!==n&&(he=e,r=Zt(r)),(e=r)===n&&(e=function(){var e,r,i,o;return e=function(){var e,r,i,o;return be++,e=pe,39===t.charCodeAt(pe)?(r=D,pe++):(r=n,0===be&&Ce(pt)),r!==n?(i=function(){var t,e,r;for(t=pe,e=[],r=Ie();r!==n;)e.push(r),r=Ie();return he=t,t=e=Qt(e)}(),39===t.charCodeAt(pe)?(o=D,pe++):(o=n,0===be&&Ce(pt)),o!==n?(he=e,e=Kt(i)):(pe=e,e=n)):(pe=e,e=n),be--,e===n&&(r=n,0===be&&Ce(gt)),e}(),e===n&&(e=Ne())===n&&(e=Oe())===n&&(e=function(){var e,r;return be++,e=pe,t.substr(pe,4)===M?(r=M,pe+=4):(r=n,0===be&&Ce($t)),r!==n&&(he=e,r=de()),(e=r)===n&&(e=pe,t.substr(pe,5)===T?(r=T,pe+=5):(r=n,0===be&&Ce(kt)),r!==n&&(he=e,r=ve()),e=r),be--,e===n&&(r=n,0===be&&Ce(xt)),e}(),e===n&&(e=pe,40===t.charCodeAt(pe)?(r=F,pe++):(r=n,0===be&&Ce(ct)),r!==n&&(i=Ve())!==n?(41===t.charCodeAt(pe)?(o=A,pe++):(o=n,0===be&&Ce(dt)),o!==n?(he=e,e=Xt(i)):(pe=e,e=n)):(pe=e,e=n))),e}())),e}())),e}function Ie(){var e,r,i,o,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===be&&Ce(B)),r!==n?(i=Re(),(o=Ve())!==n?(Re(),125===t.charCodeAt(pe)?(a=l,pe++):(a=n,0===be&&Ce(U)),a!==n?(he=e,e=te(o)):(pe=e,e=n)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,t.substr(pe,3)===u?(r=u,pe+=3):(r=n,0===be&&Ce(W)),r!==n&&(he=e,r=ee()),(e=r)===n&&(e=pe,r=pe,be++,92===t.charCodeAt(pe)?(i=c,pe++):(i=n,0===be&&Ce(L)),i===n&&(39===t.charCodeAt(pe)?(i=D,pe++):(i=n,0===be&&Ce(pt)),i===n&&(t.substr(pe,2)===s?(i=s,pe+=2):(i=n,0===be&&Ce(B)))),be--,i===n?r=void 0:(pe=r,r=n),r!==n?(t.length>pe?(i=t.charAt(pe),pe++):(i=n,0===be&&Ce(H)),i!==n?(he=e,e=re()):(pe=e,e=n)):(pe=e,e=n),e===n))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===be&&Ce(B)),r!==n){if(i=[],I.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(ht)),o!==n)for(;o!==n;)i.push(o),I.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(ht));else i=n;i!==n?(125===t.charCodeAt(pe)?(o=l,pe++):(o=n,0===be&&Ce(U)),o!==n?(he=e,e=ne()):(pe=e,e=n)):(pe=e,e=n)}else pe=e,e=n;e===n&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=n,0===be&&Ce(B)),r!==n&&(he=e,r=ie()),(e=r)===n&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=n,0===be&&Ce(L)),r!==n?(t.substr(pe,2)===s?(i=s,pe+=2):(i=n,0===be&&Ce(B)),i!==n?(he=e,e=oe(i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=n,0===be&&Ce(L)),r!==n?(t.length>pe?(i=t.charAt(pe),pe++):(i=n,0===be&&Ce(H)),i!==n?(he=e,e=ae(i)):(pe=e,e=n)):(pe=e,e=n),e===n&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=n,0===be&&Ce(L)),r!==n&&(he=e,r=se()),e=r))))}return e}function Oe(){var e,r,i,o;if(be++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===be&&Ce(ot)),r===n&&(r=null),i=[],O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(mt)),o!==n)for(;o!==n;)i.push(o),O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(mt));else i=n;return i!==n?(he=e,e=le()):(pe=e,e=n),be--,e===n&&(r=n,0===be&&Ce(ft)),e}function Ne(){var e,r,i,o,a,s,l,u,c,d;for(be++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===be&&Ce(ot)),r===n&&(r=null),i=[],O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(mt));o!==n;)i.push(o),O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(mt));if(46===t.charCodeAt(pe)?(o=S,pe++):(o=n,0===be&&Ce(bt)),o!==n){if(a=[],O.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===be&&Ce(mt)),s!==n)for(;s!==n;)a.push(s),O.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=n,0===be&&Ce(mt));else a=n;if(a!==n){if(s=pe,101===t.charCodeAt(pe)?(l=j,pe++):(l=n,0===be&&Ce(_t)),l===n&&(69===t.charCodeAt(pe)?(l=P,pe++):(l=n,0===be&&Ce(wt))),l!==n){if(43===t.charCodeAt(pe)?(u=w,pe++):(u=n,0===be&&Ce(it)),u===n&&(45===t.charCodeAt(pe)?(u=x,pe++):(u=n,0===be&&Ce(ot))),u===n&&(u=null),c=[],O.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===be&&Ce(mt)),d!==n)for(;d!==n;)c.push(d),O.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=n,0===be&&Ce(mt));else c=n;c!==n?s=l=[l,u,c]:(pe=s,s=n)}else pe=s,s=n;s===n&&(s=null),he=e,e=ue()}else pe=e,e=n}else pe=e,e=n;if(e===n){if(e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=n,0===be&&Ce(ot)),r===n&&(r=null),i=[],O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(mt)),o!==n)for(;o!==n;)i.push(o),O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(mt));else i=n;if(i!==n)if(101===t.charCodeAt(pe)?(o=j,pe++):(o=n,0===be&&Ce(_t)),o===n&&(69===t.charCodeAt(pe)?(o=P,pe++):(o=n,0===be&&Ce(wt))),o!==n){if(43===t.charCodeAt(pe)?(a=w,pe++):(a=n,0===be&&Ce(it)),a===n&&(45===t.charCodeAt(pe)?(a=x,pe++):(a=n,0===be&&Ce(ot))),a===n&&(a=null),s=[],O.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===be&&Ce(mt)),l!==n)for(;l!==n;)s.push(l),O.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=n,0===be&&Ce(mt));else s=n;s!==n?(he=e,e=ce()):(pe=e,e=n)}else pe=e,e=n;else pe=e,e=n}return be--,e===n&&(r=n,0===be&&Ce(yt)),e}function Je(){var e,r,i,o,a;if(be++,e=pe,r=pe,be++,i=function(){var e,r,i,o;return e=pe,t.substr(pe,4)===M?(r=M,pe+=4):(r=n,0===be&&Ce($t)),r===n&&(t.substr(pe,5)===T?(r=T,pe+=5):(r=n,0===be&&Ce(kt))),r!==n?(i=pe,be++,N.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=n,0===be&&Ce(Et)),be--,o===n?i=void 0:(pe=i,i=n),i!==n?e=r=[r,i]:(pe=e,e=n)):(pe=e,e=n),e}(),be--,i===n?r=void 0:(pe=r,r=n),r!==n)if(J.test(t.charAt(pe))?(i=t.charAt(pe),pe++):(i=n,0===be&&Ce(Ft)),i!==n){for(o=[],N.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===be&&Ce(Et));a!==n;)o.push(a),N.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=n,0===be&&Ce(Et));he=e,e=ge()}else pe=e,e=n;else pe=e,e=n;return be--,e===n&&(r=n,0===be&&Ce(Ct)),e}function Re(){var e,r;for(be++,e=[],R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===be&&Ce(Vt));r!==n;)e.push(r),R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=n,0===be&&Ce(Vt));return be--,r=n,0===be&&Ce(At),e}if((r=a())!==n&&pe===t.length)return r;throw r!==n&&pe<t.length&&Ce({type:"end"}),function(t,e,r){return new Cr(Cr.buildMessage(t,e),t,e,r)}(ye,me<t.length?t.charAt(me):null,me<t.length?Ee(me,me+1):Ee(me,me))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Cr,Error),Cr.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+o.line+":"+o.column;if(n){var s=this.location.end,l=Fr("",o.line.toString().length," "),u=n[i.line-1],c=(i.line===s.line?s.column:u.length+1)-i.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+u+"\n"+l+" | "+Fr("",i.column-1," ")+Fr("",c,"^")}else e+="\n at "+a}return e},Cr.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 Vr=new Map,Dr=new Map;function Sr(t,e,r){const n={args:e,cb:r},i=Vr.get(t)||[];Vr.has(t)||Vr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Dr.set(o,n)}function jr(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 Pr(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=>{Pr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Pr(t.left,e),Pr(t.right,e);break;case"UnaryExpression":Pr(t.argument,e);break;case"ConditionalExpression":Pr(t.test,e),Pr(t.consequent,e),Pr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Pr(t,e)}))}}function Mr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Tr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function zr(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 Tr(t.value);if("color"===t.type)return Wr(Ur(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Ir(t){let e=zr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Or(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Nr(t,e){if(We)return Ge(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Jr(t,e){if(e<qe||e>He)throw new Error("Integer overflow.");!We&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Rr(t){const e=[];return Pr(t,{Variable(t){e.push(t.id.name)}}),e}function Br(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Ur(t){const e=at(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Wr(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return it(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Lr(t){return Wr(Ur(t))}const Hr=Number.MAX_VALUE,qr=Number.MIN_VALUE,Gr="string",Zr="integer",Yr="number",Xr="boolean",Kr="color",Qr="url",tn="datetime";function en(t,e){return{type:Gr,value:zr(e)}}function rn(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:Yr,value:r}}function nn(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=Lr(o)),{type:n,value:o}}function on(t,e,r){return nn(t,e,r,r.type)}function an(t,e,r){return nn(t,e,r,"color")}function sn(t,e,r){return nn(t,e,r,"url")}const ln=t=>(e,r)=>{let n=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++n:"getUTCDay"===t&&0===n&&(n=7),{type:Zr,value:n}},un=ln("getUTCFullYear"),cn=ln("getUTCMonth"),dn=ln("getUTCDate"),vn=ln("getUTCDay"),gn=ln("getUTCHours"),pn=ln("getUTCMinutes"),hn=ln("getUTCSeconds"),fn=ln("getUTCMilliseconds");function mn(t,e,r,n){if(!n.value.length)return t.warnings.push(K(new Error("String for padding is empty."),{level:"warn"})),"";let i="";const o=e.type===Gr?e.value:zr(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 yn(t,e,r,n){const i=mn(t,e,r,n);return{type:Gr,value:i+zr(e)}}function bn(t,e,r,n){const i=mn(t,e,r,n);return{type:Gr,value:zr(e)+i}}function _n(t){return(e,r)=>{const n=Ur(r.value);return{type:Yr,value:n[t]/255}}}function wn(t){return(e,r,n)=>{const i=Ur(r.value);return i[t]=255*n.value,{type:Kr,value:Wr(i)}}}const xn=_n("a"),$n=_n("r"),kn=_n("g"),En=_n("b"),Cn=wn("a"),Fn=wn("r"),An=wn("g"),Vn=wn("b");function Dn(t,e,r,n){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let i=Ge(e.value)/Ge(r);return Jr(t,i),"number"==typeof i&&(i=Math.floor(i)),n&&(i=Ge(i)%Ge(n)),{type:Zr,value:i}}const Sn=36e5;function jn(t){return t.map(Ir).join(", ")}Sr("toString",[Zr],en),Sr("toString",[Yr],en),Sr("toString",[Xr],en),Sr("toString",[Kr],en),Sr("toString",[Qr],en),Sr("toNumber",[Zr],rn),Sr("toNumber",[Gr],rn),Sr("toInteger",[Yr],(function(t,e){if(e.value>He||e.value<qe)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:Zr,value:Ge(r)}})),Sr("toInteger",[Gr],(function(t,e){let r;try{r=Ge(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>He||r<qe)throw new Error("Unable to convert value to Integer.");return{type:Zr,value:r}})),Sr("toInteger",[Xr],(function(t,e){return{type:Zr,value:Ge(e.value?1:0)}})),Sr("toBoolean",[Zr],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:Xr,value:r}})),Sr("toBoolean",[Gr],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:Xr,value:"true"===e.value?1:0}})),Sr("toColor",[Gr],(function(t,e){return{type:Kr,value:Lr(e.value)}})),Sr("toUrl",[Gr],(function(t,e){return{type:Qr,value:e.value}})),Sr("encodeUri",[Gr],(function(t,e){try{return{type:Gr,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Sr("decodeUri",[Gr],(function(t,e){try{return{type:Gr,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Sr("getIntegerValue",[Gr,Zr],on),Sr("getNumberValue",[Gr,Yr],on),Sr("getBooleanValue",[Gr,Xr],on),Sr("getStringValue",[Gr,Gr],on),Sr("getColorValue",[Gr,Kr],an),Sr("getColorValue",[Gr,Gr],an),Sr("getUrlValue",[Gr,Qr],sn),Sr("getUrlValue",[Gr,Gr],sn),Sr("parseUnixTime",[Zr],(function(t,e){return{type:tn,value:new Date(1e3*Number(e.value))}})),Sr("nowLocal",[],(function(){return{type:tn,value:new Date}})),Sr("addMillis",[tn,Zr],(function(t,e,r){return{type:tn,value:new Date(e.value.getTime()+Number(r.value))}})),Sr("setYear",[tn,Zr],(function(t,e,r){const n=new Date(e.value);return n.setUTCFullYear(Number(r.value)),{type:tn,value:n}})),Sr("setMonth",[tn,Zr],(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:tn,value:i}})),Sr("setDay",[tn,Zr],(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 ${zr(e)}.`);return n.setUTCDate(-1===i?0:i),{type:tn,value:n}})),Sr("setHours",[tn,Zr],(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:tn,value:i}})),Sr("setMinutes",[tn,Zr],(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:tn,value:i}})),Sr("setSeconds",[tn,Zr],(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:tn,value:i}})),Sr("setMillis",[tn,Zr],(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:tn,value:i}})),Sr("getYear",[tn],un),Sr("getMonth",[tn],cn),Sr("getDay",[tn],dn),Sr("getDayOfWeek",[tn],vn),Sr("getHours",[tn],gn),Sr("getMinutes",[tn],pn),Sr("getSeconds",[tn],hn),Sr("getMillis",[tn],fn),Sr("getIntervalSeconds",[Zr],(function(t,e){return Dn(t,e,1e3,60)})),Sr("getIntervalTotalSeconds",[Zr],(function(t,e){return Dn(t,e,1e3)})),Sr("getIntervalMinutes",[Zr],(function(t,e){return Dn(t,e,6e4,60)})),Sr("getIntervalTotalMinutes",[Zr],(function(t,e){return Dn(t,e,6e4)})),Sr("getIntervalHours",[Zr],(function(t,e){return Dn(t,e,Sn,24)})),Sr("getIntervalTotalHours",[Zr],(function(t,e){return Dn(t,e,Sn)})),Sr("getIntervalTotalDays",[Zr],(function(t,e){return Dn(t,e,864e5)})),Sr("getIntervalTotalWeeks",[Zr],(function(t,e){return Dn(t,e,6048e5)})),Sr("len",[Gr],(function(t,e){return{type:Zr,value:e.value.length}})),Sr("contains",[Gr,Gr],(function(t,e,r){return{type:Xr,value:e.value.includes(r.value)?1:0}})),Sr("substring",[Gr,Zr,Zr],(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:Gr,value:e.value.substring(Number(r.value),Number(n.value))}})),Sr("replaceAll",[Gr,Gr,Gr],(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:Gr,value:i}})),Sr("index",[Gr,Gr],(function(t,e,r){return{type:Zr,value:e.value.indexOf(r.value)}})),Sr("lastIndex",[Gr,Gr],(function(t,e,r){return{type:Zr,value:e.value.lastIndexOf(r.value)}})),Sr("trim",[Gr],(function(t,e){return{type:Gr,value:e.value.trim()}})),Sr("trimLeft",[Gr],(function(t,e){return{type:Gr,value:e.value.replace(/^\s+/,"")}})),Sr("trimRight",[Gr],(function(t,e){return{type:Gr,value:e.value.replace(/\s+$/,"")}})),Sr("toUpperCase",[Gr],(function(t,e){return{type:Gr,value:e.value.toUpperCase()}})),Sr("toLowerCase",[Gr],(function(t,e){return{type:Gr,value:e.value.toLowerCase()}})),Sr("padStart",[Gr,Zr,Gr],yn),Sr("padStart",[Zr,Zr,Gr],yn),Sr("padEnd",[Gr,Zr,Gr],bn),Sr("padEnd",[Zr,Zr,Gr],bn),Sr("div",[Zr,Zr],(function(t,e,r){if(r.value===Ze)throw new Error("Division by zero is not supported.");let n=e.value/r.value;return n=Nr(0,n),Jr(t,n),{type:Zr,value:n}})),Sr("div",[Yr,Yr],(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:Yr,value:n}})),Sr("mod",[Zr,Zr],(function(t,e,r){if(r.value===Ze)throw new Error("Division by zero is not supported.");let n=e.value%r.value;return n=Nr(0,n),Jr(t,n),{type:Zr,value:n}})),Sr("mod",[Yr,Yr],(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:Yr,value:n}})),Sr("mul",[{type:Zr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ze;for(let n=1;n<e.length;++n)r*=e[n].value,r=Nr(0,r),Jr(t,r);return{type:Zr,value:r}})),Sr("mul",[{type:Yr,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:Yr,value:r}})),Sr("sub",[{type:Zr,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Ze;for(let n=1;n<e.length;++n)r-=e[n].value,r=Nr(0,r),Jr(t,r);return{type:Zr,value:r}})),Sr("sub",[{type:Yr,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:Yr,value:r}})),Sr("sum",[{type:Zr,isVararg:!0}],(function(t,...e){let r=Ze;for(let n=0;n<e.length;++n)r+=e[n].value,r=Nr(0,r),Jr(t,r);return{type:Zr,value:r}})),Sr("sum",[{type:Yr,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:Yr,value:r}})),Sr("abs",[Zr],(function(t,e){const r=Ye(e.value);return Jr(t,r),{type:e.type,value:r}})),Sr("abs",[Yr],(function(t,e){const r=Math.abs(e.value);return{type:Yr,value:r}})),Sr("max",[{type:Zr,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:Zr,value:r}})),Sr("max",[{type:Yr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:Yr,value:Math.max(...e.map((t=>t.value)))}})),Sr("min",[{type:Zr,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:Zr,value:r}})),Sr("min",[{type:Yr,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:Yr,value:Math.min(...e.map((t=>t.value)))}})),Sr("maxNumber",[],(function(){return{type:Yr,value:Hr}})),Sr("minNumber",[],(function(){return{type:Yr,value:qr}})),Sr("maxInteger",[],(function(t){return Jr(t,He),{type:Zr,value:He}})),Sr("minInteger",[],(function(t){return Jr(t,qe),{type:Zr,value:qe}})),Sr("round",[Yr],(function(t,e){const r=Math.sign(e.value);return{type:Yr,value:r*Math.round(Math.abs(e.value))}})),Sr("floor",[Yr],(function(t,e){return{type:Yr,value:Math.floor(e.value)}})),Sr("ceil",[Yr],(function(t,e){return{type:Yr,value:Math.ceil(e.value)}})),Sr("signum",[Zr],(function(t,e){return{type:Zr,value:Xe(e.value)}})),Sr("signum",[Yr],(function(t,e){return{type:Yr,value:Math.sign(e.value)}})),Sr("copySign",[Zr,Zr],(function(t,e,r){let n;if(r.value===Ze)n=e.value;else if(e.value===Ze)n=0;else{const t=Xe(r.value);n=Ye(e.value)*t}return Jr(t,n),{type:Zr,value:n}})),Sr("copySign",[Yr,Yr],(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:Yr,value:i}})),Sr("getColorAlpha",[Gr],xn),Sr("getColorAlpha",[Kr],xn),Sr("getColorRed",[Gr],$n),Sr("getColorRed",[Kr],$n),Sr("getColorGreen",[Gr],kn),Sr("getColorGreen",[Kr],kn),Sr("getColorBlue",[Gr],En),Sr("getColorBlue",[Kr],En),Sr("setColorAlpha",[Gr,Yr],Cn),Sr("setColorAlpha",[Kr,Yr],Cn),Sr("setColorRed",[Gr,Yr],Fn),Sr("setColorRed",[Kr,Yr],Fn),Sr("setColorGreen",[Gr,Yr],An),Sr("setColorGreen",[Kr,Yr],An),Sr("setColorBlue",[Gr,Yr],Vn),Sr("setColorBlue",[Kr,Yr],Vn),Sr("rgb",[Yr,Yr,Yr],(function(t,e,r,n){const i={a:255,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Kr,value:Wr(i)}})),Sr("argb",[Yr,Yr,Yr,Yr],(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:Kr,value:Wr(o)}}));const Pn={StringLiteral:function(t,e){return{type:Gr,value:e.value}},NumberLiteral:function(t,e){return{type:Yr,value:e.value}},IntegerLiteral:function(t,e){return Jr(t,e.value),{type:Zr,value:e.value}},BooleanLiteral:function(t,e){return{type:Xr,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Mr(Mn(t,e.argument));switch(e.operator){case"!":if(r.type===Xr)return{type:Xr,value:r.value?0:1};Br(`${e.operator}${Ir(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const n="+"===e.operator?1:-1;if(r.type===Zr){const e=r.value*Ge(n);return Jr(t,e),{type:Zr,value:e}}if(r.type===Yr)return{type:Yr,value:r.value*n};Br(`${e.operator}${Ir(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Mr(Mn(t,e.test));if(r.type===Xr)return r.value?Mn(t,e.consequent):Mn(t,e.alternate);Br(`${Ir(r)} ? ${Ir(Mn(t,e.consequent))} : ${Ir(Mn(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 Mn(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=zr(Mn(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Gr,value:r}},LogicalExpression:function(t,e){const r=Mr(Mn(t,e.left));if(r.type!==Xr&&Br(`${Ir(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Xr,value:0};const n=Mr(Mn(t,e.right));return n.type!==Xr&&Br(`${Ir(r)} ${e.operator} ${Ir(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Or(n.type)}.`),{type:Xr,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Mn(t,e.left),i=Mn(t,e.right);if(n.type!==i.type&&Br(`${Ir(n)} ${e.operator} ${Ir(i)}`,`Operator '${r}' cannot be applied to different types: ${Or(n.type)} and ${Or(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===tn&&r.type===tn?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Xr,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Yr&&e.type!==Zr&&e.type!==tn&&Br(`${Ir(e)} ${t} ${Ir(r)}`,`Operator '${t}' cannot be applied to ${Or(e.type)} type.`);const i=e.type===tn?e.value.getTime():e.value,o=r.type===tn?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Xr,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r,n){if(r.type!==Gr&&r.type!==Yr&&r.type!==Zr&&Br(`${Ir(r)} ${e} ${Ir(n)}`,`Operator '${e}' cannot be applied to ${Or(r.type)} type.`),r.type===Gr)return"-"===e&&Br(`${Ir(r)} - ${Ir(n)}`,`Operator '${e}' cannot be applied to ${Or(r.type)} type.`),{type:Gr,value:r.value+n.value};let i="+"===e?r.value+n.value:r.value-n.value;if(r.type===Zr)try{i=Nr(0,i),Jr(t,i)}catch(t){Br(`${Ir(r)} ${e} ${Ir(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!==Zr&&r.type!==Yr&&Br(`${Ir(r)} ${e} ${Ir(n)}`,`Operator '${e}' cannot be applied to ${Or(r.type)} type.`),"*"===e)i=r.value*n.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(n.value)&&Br(`${Ir(r)} ${e} ${Ir(n)}`,"Division by zero is not supported."),i="/"===e?r.value/n.value:r.value%n.value}if(r.type===Zr)try{i=Nr(0,i),Jr(t,i)}catch(t){Br(`${Ir(r)} ${e} ${Ir(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=>Mn(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(Dr.has(o))n=Dr.get(o);else{const t=function(t,e){const r=Vr.get(t);if(!r)return{type:"missing"};let n=null;for(let t=0;t<r.length;++t){const i=jr(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=>Or(t.type))).join(", "),n=`${r}(${jn(i)})`;"few"===t.type&&0===i.length?Br(n,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?Br(n,`Function '${r}' has no matching override for given argument types: ${e}.`):Br(n,`Unknown function name: ${r}.`)}n=t}if(!n)throw new Error("Function not found");try{return n.cb(t,...i)}catch(t){Br(`${r}(${jn(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 Mn(t,e){if(e.type in Pn)return Pn[e.type](t,e);throw new Error("Unsupported expression")}function Tn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(Pr(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=Mn(r,e);return r.safeIntegerOverflow&&r.warnings.push(K(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 zn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Pr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Tn(t,this.ast);r.warnings.forEach(e);const n=r.result;if("error"===n.type)return void e(K(new Error("Expression execution error"),{additional:{message:n.value}}));const i=n.value;if(i instanceof Date)return Tr(i);if("boolean"===n.type)return Boolean(i);if("color"===n.type){const t=at(String(i));if(t)return Wr(t);e(K(new Error("Expression execution error")))}return"integer"===n.type?i>2147483647||i<-2147483648?void e(K(new Error("Expression result is out of 32-bit int range"))):Number(i):i}catch(t){return void e(K(new Error("Expression execution error")))}}}function In(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=Rr(r);return e.vars.push(...n),new zn(r)}catch(e){return void r(K(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>In(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=In(t[i],e,r);return n}}var n;return t}function On(t,e,r){if(t){if(t instanceof zn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>On(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=On(t[i],e,r);return n}}return t}function Nn(t,e){const r={vars:[],hasExpression:!1},n=In(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>On(n,t,e)}}const Jn={pagers:function(){return W(new Map)}},Rn=new Map,Bn=new Map;function Un(t){const e=Rn.get(t)||W("");return Rn.has(t)||Rn.set(t,e),e}function Wn(t){const e=Bn.get(t)||new Map;return Bn.has(t)||Bn.set(t,e),e}class Ln{setVariable(t){const e=t.getName(),r=Wn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Un(this).set(e)}getVariable(t){return Wn(this).get(t)}}function Hn(){return new Ln}function qn(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Gn=new Set(["start","stop","pause","resume","cancel","reset"]);class Zn{constructor(t){qn(this,"timers",new Map),qn(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(K(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(K(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Gn.has(e)))return void this.logError(K(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(K(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(K(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(K(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(K(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(K(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(K(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(K(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(K(new Error("The timer is already running"))):this.logError(K(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 Yn=N(((t,e,r,n)=>{let i,o;var s,l,u,c;let{id:g}=e,{json:p={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new Ln}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{extensions:x=new Map}=e,{onError:$}=e,{onStat:k}=e,{onCustomAction:E}=e,{onComponent:C}=e,F=W("desktop"===h);if(o=a(F,(t=>i=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");F.set(!t.matches),t.addListener((()=>{F.set(!t.matches)}))}let A="light",V=null;function D(t){f=t}function j(){}const P=new Set(w);let M=!1;p||(M=!0,G(K(new Error('"json" prop is required')))),g||(M=!0,G(K(new Error('"id" prop is required'))));let T=function(t){if(!t)return K(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return K(new Error("Missing card"));if(!e.states||!e.states.length)return K(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in hr)return K(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return K(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return K(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const I=p.templates||{};T&&(M=!0,G(T));const O={stateChange:!1},N=Un(m),J=Wn(m),R=new Map,B=new Map,U=new Map;let H=null;function q(t){const e=Nn(t,G);return e.vars.length?e.applyVars(B):t}function G(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 Y=0;function Q(t){return`${g}-${Y++}`}let tt={},et={};function rt(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=ct,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const 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=B.get(r);t?t.set(i):G(K(new Error("Cannot find variable"),{additional:{name:r}}))}else G(K(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):G(K(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;default:G(K(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){G(K(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=pt(i);if(t)if(ht(t,P)){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?(rt(n),await _()):n.log_id&&(it(n),await _())}}t.forEach((t=>{t.log_id&&Z("click",t)}))}}function it(t){null==E||E(t)}const ot=new Map;function at(t){if(ot.has(t))return ot.get(t);G(K(new Error("Missing instance with id"),{additional:{id:t}}))}const st=new Map;function ut(t){for(const e of t)B.has(e)&&t.delete(e);return t}v(X,{logError:G,logStat:Z,hasTemplate:function(t){return t in I},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in I;){if(({json:t,templateContext:e}=yr(t,e,I,G)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:Q,genClass:function(t){return`divkit-${Q()}`},execAction:rt,execAnyActions:nt,execCustomAction:it,isRunning:function(t){return O[t]},setRunning:function(t,e){O[t]=e},registerInstance:function(t,e){ot.has(t)?G(K(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(et[r]=et[r]||0,++et[r],tt[r])return tt[r];const n=`${Q()}-svg-filter`;return tt=Object.assign(Object.assign({},tt),{[r]:n}),n},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;et[r]&&0==--et[r]&&(tt=Object.keys(tt).reduce(((t,e)=>(et[e]&&(t[e]=tt[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return _r(t);const e=Nn(t,G);return e.vars.length?L(e.vars.map((t=>B.get(t)||function(t){const e=U.get(t)||W(void 0);return U.has(t)||U.set(t,e),e}(t))).filter(lt),(()=>e.applyVars(B))):e.hasExpression?_r(e.applyVars(B)):_r(t)},getJsonWithVars:q,getStore:function(t){return st.has(t)||function(t){st.has(t)||st.set(t,Jn[t]())}(t),st.get(t)},getVariable:function(t,e){const r=B.get(t);if(r){const n=r.getType();if(n!==e)return void G(K(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return P},getExtension:function(t,e){const r=x.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:B,logError:G}},isDesktop:F,registerComponent:void 0,unregisterComponent:void 0}),v(Pt,{hasAction:()=>!1});const ct={setState(t){throw new Error("Not implemented")},getChild(t){if(dt&&dt.has(t))return dt.get(t);G(K(new Error("Missing state block with id"),{additional:{id:t}}))}};let dt=null;v(yt,{registerInstance(t,e){dt||(dt=new Map),dt.has(t)?G(K(new Error("Duplicate state with id"),{additional:{id:t}})):dt.set(t,e)},unregisterInstance(t){null==dt||dt.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 vt=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variables;Array.isArray(vt)&&vt.forEach((t=>{if(t&&t.type in Qe&&t.name){if(R.has(t.name))return void G(K(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)&&G(K(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=tr(t.name,t.type,t.value);R.set(t.name,e),B.set(t.name,e)}catch(e){G(K(e,{additional:{name:t.name}}))}}}));const gt=p.palette;gt&>[A].forEach((t=>{if(R.has(t.name))G(K(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=tr(t.name,"color",t.color);R.set(t.name,e),B.set(t.name,e)}catch(e){G(K(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)B.has(t)||B.set(t,e);N.subscribe((t=>{if(t&&!B.has(t)){const e=J.get(t);B.set(t,e);const r=U.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 G(K(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=Rr(n);if(!i.length)return void G(K(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return ut(e),e.size?new Promise((t=>{const r=N.subscribe((()=>{ut(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{L(i.map((t=>B.get(t))).filter(lt),(()=>{const t=Tn(B,n);return t.warnings.forEach(G),t.result})).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=q(t);e.log_id&&rt(e)})),e=Boolean(n.value)):G(K(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){G(K(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else G(K(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 Zn({logError:G,applyVars:q,hasVariableWithType:function(t,e){const r=B.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=B.get(t);r?r.setValue(e):G(K(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:nt});mt.forEach((e=>t.createTimer(e)))}const bt=null===(c=null==p?void 0:p.card)||void 0===c?void 0:c.states;let _t;return bt&&!M&&(_t={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})))}),d((()=>{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!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.extensions&&r.extensions&&void 0!==x&&r.extensions(x),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!==E&&r.onCustomAction(E),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.setTheme&&r.setTheme&&void 0!==D&&r.setTheme(D),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==j&&r.getDebugVariables(j),void 0===e.execAction&&r.execAction&&void 0!==rt&&r.execAction(rt),"light"===f||"dark"===f?A=f:"system"===f?"undefined"!=typeof matchMedia?(V||(V=matchMedia("(prefers-color-scheme: dark)"),V.addListener((function(){"system"===f&&V&&(A=V.matches?"dark":"light")}))),A=V.matches?"dark":"light"):A="light":G(K(new Error("Unsupported theme"))),A&&(gt&>[A].forEach((t=>{const e=B.get(t.name);e&&e.setValue(t.color)}))),o(),!M&&_t?`<div class="${S("divkit-b023c",!0)+S(i?" divkit-ee112":"",!0)+S(y?` ${y}`:"",!0)}">${z(mr,"RootSvgFilters").$$render(t,{svgFiltersMap:tt},{},{})}\n ${z(fr,"Unknown").$$render(t,{div:_t,templateContext:{}},{},{})}</div>`:""})),Xn=Yn;function Kn(t){return Xn.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 Qn=e.M,ti=e.Os,ei=e.sY;export{Qn as createGlobalVariablesController,ti as createVariable,ei as render};
|
|
1
|
+
var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){}function i(t){return t()}function n(t){t.forEach(i)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function s(t,e,r){return t.set(r),e}let l;function u(t){l=t}function c(){if(!l)throw new Error("Function called outside component initialization");return l}function d(t){c().$$.on_destroy.push(t)}function v(t,e){return c().$$.context.set(t,e),e}function g(t){return c().$$.context.get(t)}t.d(e,{M:()=>Yi,Os:()=>rr,sY:()=>rn}),new Set,new Map;const p=[],h=[];let f=[];const m=[],y=Promise.resolve();let b=!1;function _(){return b||(b=!0,y.then(k)),y}function w(t){f.push(t)}const x=new Set;let $=0;function k(){if(0!==$)return;const t=l;do{try{for(;$<p.length;){const t=p[$];$++,u(t),E(t.$$)}}catch(t){throw p.length=0,$=0,t}for(u(null),p.length=0,$=0;h.length;)h.pop()();for(let t=0;t<f.length;t+=1){const e=f[t];x.has(e)||(x.add(e),e())}f.length=0}while(p.length);for(;m.length;)m.pop()();b=!1,x.clear(),u(t)}function E(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(w)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const C=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),F=/[\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 A(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,i=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),i&&(null==r.style?r.style=R(i):r.style=R(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),i=e.slice(0,t).trim(),n=e.slice(t+1).trim();i&&(r[i]=n)}for(const t in e){const i=e[t];i?r[t]=i:delete r[t]}return r}(r.style,i)))}let i="";return Object.keys(r).forEach((t=>{if(F.test(t))return;const e=r[t];!0===e?i+=" "+t:C.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const V=/[&"]/g,D=/[&<]/g;function j(t,e=!1){const r=String(t),i=e?V:D;i.lastIndex=0;let n="",o=0;for(;i.test(r);){const t=i.lastIndex-1,e=r[t];n+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return n+r.substring(o)}function S(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function P(t){const e={};for(const r in t)e[r]=S(t[r]);return e}function M(t,e){let r="";for(let i=0;i<t.length;i+=1)r+=e(t[i],i);return r}const T={$$render:()=>""};function z(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${e}>.`);return t}let I,O;function N(t){function e(e,r,i,n,o){const a=l;u({$$:{on_destroy:I,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,i,n);return u(a),s}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,i);return n(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function R(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${S(t[e])};`)).join(" ")}function B(t){const e=R(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(i).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(function(t){const e=[],r=[];f.forEach((i=>-1===t.indexOf(i)?e.push(i):r.push(i))),r.forEach((t=>t())),f=e}(r.after_update),n(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){if(!o(e))return r;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const t=i.indexOf(e);-1!==t&&i.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 U=[];function W(t,e=r){let i;const n=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!U.length;for(const e of n)e[1](),U.push(e,t);if(e){for(let t=0;t<U.length;t+=2)U[t][0](U[t+1]);U.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return n.add(l),1===n.size&&(i=e(o)||r),a(t),()=>{n.delete(l),0===n.size&&i&&(i(),i=null)}}}}function L(t,e,i){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return{subscribe:W(i,(t=>{let i=!1;const c=[];let d=0,v=r;const g=()=>{if(d)return;v();const i=e(s?c[0]:c,t);u?t(i):v=o(i)?i:r},p=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),i&&g()}),(()=>{d|=1<<e}))));return i=!0,g(),function(){n(p),v(),i=!1}})).subscribe}}const H="divkit-bd259",q="divkit-d9099",G="divkit-c016b",Z="divkit-aa145",Y="divkit-f0cba",X=Symbol("root");function K(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const Q={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"},tt={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 et(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 rt(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 it(t){let e=rt(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function ot(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const i=at(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function at(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,i,n,o]=e,a=2===i.length?i:i+i,s=2===n.length?n:n+n,l=2===o.length?o:o+o,u=2===r.length?r:r+r;return{a:parseInt(u,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,i,n]=e,o=2===r.length?r:r+r,a=2===i.length?i:i+i,s=2===n.length?n:n+n;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function st(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const lt=Boolean;function ut(t){if(1===t.length&&"solid"===t[0].type)return{color:ot(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=ot(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(lt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>ot(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:vt(t.bg.scale),pos:gt(t.bg),image:'url("'+st(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(lt);if(!r.length)return;const i=t.bg.radius;let n;i&&"object"==typeof i&&"type"in i&&void 0!==i.value&&("fixed"===i.type?n=it(i.value):"relative"===i.type&&(n=ct[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${dt(t.bg.center_x)} ${dt(t.bg.center_y)},`+r.map((t=>ot(t))).join(",")+")"}}({bg:t}):void 0)).filter(lt).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 ct={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function dt(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return it(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function vt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function gt(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function ht(t,e){return e.has(t)}function ft(t,e){e&&t.push(e)}function mt(t,e,r){const i=[];ft(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&ft(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const yt=Symbol("state");function bt(t){return rt(t.top||0)+" "+rt(t.right||0)+" "+rt(t.bottom||0)+" "+rt(t.left||0)}function _t(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function wt(t){return _t(t)&&t>=0}function xt(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]&&!wt(r[t]))return e;return bt(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const kt=Object.prototype.hasOwnProperty;function Et(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++){const n=r[i];if(!kt.call(e,n)||!Et(t[n],e[n]))return!1}return!0}function Ct(t,e){return Et(t,e)?e:t}function Ft(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function At(t,e){const r=Number(t);return isNaN(r)?e:r}function Vt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Vt(t))})):e.push(t),e}function Dt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!wt(t[r[i]]))return e;return t}function jt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>rt((t||e)/r*10))).join(" ")}function St(){}const Pt=Symbol("action"),Mt=N(((t,e,r,i)=>{let{actions:n}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:u}=e,{use:c=St}=e,{customAction:d=null}=e,{isNativeActionAnimation:p=!0}=e;const h=g(X),f=g(Pt);v(Pt,{hasAction:()=>Boolean(f.hasAction()||(null==n?void 0:n.length))});let m,y="",b=!1;if(void 0===e.actions&&r.actions&&void 0!==n&&r.actions(n),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==u&&r.attrs(u),void 0===e.use&&r.use&&void 0!==c&&r.use(c),void 0===e.customAction&&r.customAction&&void 0!==d&&r.customAction(d),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),Array.isArray(n)&&(null==n?void 0:n.length))for(let t=0;t<n.length;++t){const e=n[t].url;if(e){y=e,m=n[t].target||void 0;break}}return Array.isArray(n)&&(null==n?void 0:n.length)&&f.hasAction()&&(y="",h.logError(K(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:n}}))),b=Boolean(d),y&&!ht(pt(y),h.getBuiltinProtocols())?(y="",b=!0):!y&&Array.isArray(n)&&(null==n?void 0:n.length)&&(b=!0,h.logError(K(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:n}}))),y?`<a${A([{href:S(y)},{target:S(m)},{style:S(l)},{class:j(s,!0)+" "+j(p?H:q,!0)+" "+j(null!=a&&a.length?Y:"",!0)},P(u)],{})}>${i.default?i.default({}):""}</a>`:`\n <span${A([{class:j(s,!0)+j(b?` ${p?H:q} ${G}`:"",!0)+" "+j(null!=a&&a.length?Y:"",!0)},{style:S(l)},{role:S(b?"button":null)},{tabindex:S(b?0:null)},P(u)],{})}>${i.default?i.default({}):""}</span>`})),Tt="divkit-b921d";function zt(t){return _t(t)&&t>0}function It(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(zt(t.radius))return`blur(${it(t.radius/2)})`}else e(K(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ot=N(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=g(X);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),n=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const i=ut([t]);"solid"===t.type&&(e["background-color"]=i.color),"gradient"===t.type&&(e["background-image"]=i.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=i.size,e["object-position"]=i.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=It(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${M(n,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class",Tt,0)}${J("style",et(t.style),0)}>`:`<span${J("class",Tt,0)}${J("style",et(t.style),0)}></span>`))}</span>`})),Nt=Ot,Jt=N(((t,e,i,n)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,w,x,$,k,E,C,F,A,V,D,j,S,P,M,T,I,O,N,R,B,U,W,L,H,q,G,Z,Y,Q=r,nt=r,at=r,st=r,ct=r,dt=r,vt=r,gt=r,ft=r,_t=r,kt=r,Et=r,St=r,Pt=r,Tt=r,zt=r,It=r;var Ot,Jt,Rt,Bt,Ut,Wt;let{json:Lt={}}=e,{origJson:Ht}=e,{templateContext:qt}=e,{cls:Gt=""}=e,{style:Zt}=e,{layoutParams:Yt={}}=e,{customDescription:Xt=!1}=e,{customPaddings:Kt=!1}=e,{customActions:Qt=""}=e,{additionalPaddings:te=null}=e,{heightByAspect:ee=!1}=e;const re={left:"start",center:"center",right:"end"},ie={top:"start",center:"center",bottom:"end",baseline:"baseline"},ne=g(X),oe=g(yt);let ae,se,le,ue,ce,de,ve,ge,pe,he,fe,me=null,ye={},be={},_e=!1,we=1,xe="transparent",$e=0,ke={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ee="",Ce=null,Fe="",Ae={},Ve=0,De=0,je=0,Se=!1,Pe=!1,Me={},Te=0,ze=0,Ie=0,Oe=!1,Ne=!1,Je=1;const Re=Yt.fakeElement?[]:Lt.transition_triggers||["state_change","visibility_change"],Be=-1!==Re.indexOf("state_change")&&Lt.id,Ue=-1!==Re.indexOf("visibility_change")&&Lt.id;let We,Le,He,qe,Ge,Ze,Ye,Xe,Ke,Qe=[],tr=[],er=[],rr=[],ir="",nr=!1,or="visible",ar=0,sr=0;void 0===e.json&&i.json&&void 0!==Lt&&i.json(Lt),void 0===e.origJson&&i.origJson&&void 0!==Ht&&i.origJson(Ht),void 0===e.templateContext&&i.templateContext&&void 0!==qt&&i.templateContext(qt),void 0===e.cls&&i.cls&&void 0!==Gt&&i.cls(Gt),void 0===e.style&&i.style&&void 0!==Zt&&i.style(Zt),void 0===e.layoutParams&&i.layoutParams&&void 0!==Yt&&i.layoutParams(Yt),void 0===e.customDescription&&i.customDescription&&void 0!==Xt&&i.customDescription(Xt),void 0===e.customPaddings&&i.customPaddings&&void 0!==Kt&&i.customPaddings(Kt),void 0===e.customActions&&i.customActions&&void 0!==Qt&&i.customActions(Qt),void 0===e.additionalPaddings&&i.additionalPaddings&&void 0!==te&&i.additionalPaddings(te),void 0===e.heightByAspect&&i.heightByAspect&&void 0!==ee&&i.heightByAspect(ee),o=ne.getDerivedFromVars(Lt.border),It(),It=a(o,(t=>Y=t));{let t={},e={},r=!1,i="";if(Y){if(Y.has_shadow){const e=Y.shadow;t["box-shadow"]=e?rt((null===(Jt=null===(Ot=e.offset)||void 0===Ot?void 0:Ot.x)||void 0===Jt?void 0:Jt.value)||0)+" "+rt((null===(Bt=null===(Rt=e.offset)||void 0===Rt?void 0:Rt.y)||void 0===Bt?void 0:Bt.value)||0)+" "+rt(null!==(Ut=e.blur)&&void 0!==Ut?Ut:2)+" "+ot(e.color||"#000000",null!==(Wt=e.alpha)&&void 0!==Wt?Wt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(Y.stroke&&(r=!0,we=$t(Y.stroke.width,we),xe=ot(Y.stroke.color,1,xe),e.border=`${rt(we)} solid ${xe}`),Y.corners_radius?(ke=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]&&!wt(r[t]))return e;return t}(Y.corners_radius,ke),e["border-radius"]=t["border-radius"]=jt(ke)):Y.corner_radius&&($e=$t(Y.corner_radius,$e),ke={"top-left":$e,"top-right":$e,"bottom-right":$e,"bottom-left":$e},e["border-radius"]=t["border-radius"]=rt($e)),r&&we&&(Y.corners_radius||Y.corner_radius)){let t=Object.assign({},ke);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+we/2})),i=jt(t)}}ye=Ct(t,ye),be=Ct(e,be),_e=r,Ee=i}s=ne.getDerivedFromVars(Lt.paddings),zt(),zt=a(s,(t=>Z=t)),Ce=Dt(Z&&!Kt?Z:void 0,Ce),l=bt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((i=>{const n=t[i];n&&(r[i]=n);const o=e[i];o&&(r[i]=(r[i]||0)+o)})),r}(Ce,te)),u=ne.getDerivedFromVars(Lt.margins),Pt(),Pt=a(u,(t=>q=t)),Fe=xt(q,Fe),c=ne.getDerivedFromVars(Lt.width),Et(),Et=a(c,(t=>L=t)),d=ne.getDerivedFromVars(Lt.alignment_horizontal),Tt(),Tt=a(d,(t=>G=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const u=null==L?void 0:L.type;if("fixed"===u)Ve=$t(null==L?void 0:L.value,Ve),e=rt(Ve);else if("wrap_content"!==u&&(Yt.overlapParent||"match_parent"!==u&&u||!Yt.parentHorizontalWrapContent))t="parent","vertical"===Yt.parentContainerOrientation&&Yt.parentContainerWrap&&(l=!0,ne.logError(K(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Yt.parentLayoutOrientation?e=`calc(100% - ${it(((null==q?void 0:q.left)||0)+((null==q?void 0:q.right)||0))})`:"horizontal"===Yt.parentContainerOrientation&&(o=L&&"weight"in L&&L.weight||1,Yt.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===u&&(null==L?void 0:L.constrained)||("match_parent"===u||!u)&&Yt.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=L;t.min_size&&wt(t.min_size.value)&&(r=rt(t.min_size.value)),t.max_size&&wt(t.max_size.value)&&(i=rt(t.max_size.value))}"match_parent"!==u&&u||ne.logError(K(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=G;n["halign-self"]="left"===t||"center"===t||"right"===t?re[t]:Yt.parentHAlign||"start"}t&&(n.width=t),le=e,ue=r,ce=i,De=o,je=a,Ae=Ct(n,Ae),Se=s,Pe=l}v=ne.getDerivedFromVars(Lt.height),kt(),kt=a(v,(t=>W=t)),p=ne.getDerivedFromVars(Lt.alignment_vertical),St(),St=a(p,(t=>H=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const u=null==W?void 0:W.type;if(ee);else if("fixed"===u)Te=$t(null==W?void 0:W.value,Te),e=rt(Te);else if("match_parent"!==u||!Yt.overlapParent&&Yt.parentVerticalWrapContent){if(t="content",("wrap_content"===u&&(null==W?void 0:W.constrained)||"match_parent"===u&&Yt.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===Yt.parentContainerOrientation&&(a=1)),"wrap_content"===u){const t=W;(null==t?void 0:t.min_size)&&wt(t.min_size.value)&&(r=rt(t.min_size.value)),(null==t?void 0:t.max_size)&&wt(t.max_size.value)&&(i=rt(t.max_size.value))}"match_parent"===u&&ne.logError(K(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(K(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Yt.parentLayoutOrientation?e=`calc(100% - ${it(((null==q?void 0:q.top)||0)+((null==q?void 0:q.bottom)||0))})`:"vertical"===Yt.parentContainerOrientation&&(o=(null==W?void 0:W.weight)||1,Yt.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=H;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===Yt.parentContainerOrientation?n["valign-self"]=ie[t]:n["valign-self"]=Yt.parentVAlign||"start"}t&&(n.height=t),de=e,ve=r,ge=i,ze=o,Ie=a,Me=Ct(n,Me),Oe=s,Ne=l}var lr,ur,cr;if(h=!!Yt.overlapParent||void 0,f=Yt.overlapParent&&(!L||"match_parent"===L.type)&&"match_parent"===(null==W?void 0:W.type),m=Yt.gridArea?`${Yt.gridArea.y+1}/${Yt.gridArea.x+1}/span ${Yt.gridArea.rowSpan}/span ${Yt.gridArea.colSpan}`:void 0,y=ne.getDerivedFromVars(Lt.alpha),_t(),_t=a(y,(t=>U=t)),ur=Je,Je=!wt(lr=U)||void 0===lr||lr>1?ur:Number(lr),pe=1===Je?void 0:Je,b=ne.getDerivedFromVars(Lt.accessibility),ft(),ft=a(b,(t=>B=t)),se=void 0,B&&!Xt&&B.description&&(se={},se["aria-label"]=B.description),w=ne.getDerivedFromVars(Lt.background),gt(),gt=a(w,(t=>R=t)),he={},fe=!1,R&&(fe=R.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ee),!fe)){const t=ut(R);he["background-color"]=t.color,he["background-image"]=t.image,he["background-size"]=t.size,he["background-position"]=t.position,he["background-repeat"]="no-repeat"}We=void 0,Be&&Lt.transition_in&&ne.isRunning("stateChange")&&(We=!0),He=void 0,Be&&Lt.transition_change&&ne.isRunning("stateChange")&&oe.hasTransitionChange(Lt.id)&&(He=!0),x=ne.getDerivedFromVars(Lt.action),dt(),dt=a(x,(t=>O=t)),$=ne.getDerivedFromVars(Lt.actions),vt(),vt=a($,(t=>N=t)),k=ne.getDerivedFromVars(Lt.doubletap_actions),ct(),ct=a(k,(t=>I=t)),E=ne.getDerivedFromVars(Lt.longtap_actions),st(),st=a(E,(t=>T=t));{let t=N||O&&[O]||[],e=I||[],r=T||[];Yt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],ne.logError(K(new Error("Actions should be array")))),Array.isArray(e)||(e=[],ne.logError(K(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],ne.logError(K(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Qt&&(t=[],e=[],r=[],ne.logError(K(new Error(`Cannot use action on component "${Qt}"`)))),Qe=t,tr=e,er=r}C=ne.getDerivedFromVars(Lt.action_animation),at(),at=a(C,(t=>M=t)),M&&(rr=Vt(M),ir=rr.map((function(t){const e=At(t.start_value,1),r=At(t.end_value,1),i=$t(t.start_delay,0),n=$t(t.duration,300),o=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return qe=e,Ge=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return Ze=e,Ye=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return ne.logError(K(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),F=ne.getDerivedFromVars(Lt.visibility),nt(),nt=a(F,(t=>P=t));{const t=or,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(P,or);t!==e&&(!nr||"visible"!==or&&"visible"!==e?or=e:async function(t){or=t;const e="visible"===t?"in":"out",r="in"===e?Lt.transition_in:Lt.transition_out;Ue&&r&&(await _(),"in"===e&&(Le=!0),oe.runVisibilityTransition(Object.assign(Object.assign({},Lt),{visibility:"visible"}),qt,r,ae,e).then((()=>{"in"===e&&(Le=!1)})).catch((t=>{throw"in"===e&&(Le=!1),t})))}(e)),nr||(nr=!0)}if(A=Object.assign(Object.assign(Object.assign({},Ae),Me),{"parent-overlap":h,"parent-overlap-absolute":f,"scroll-snap":Yt.scrollSnap,"hide-on-transition-in":We||Le||He,visibility:or,"has-action-animation":Boolean(ir),"parent-flex":Yt.parentContainerOrientation||void 0,"parent-grid":Boolean(Yt.gridArea)||void 0}),V=ne.getDerivedFromVars(Lt.transform),Q(),Q=a(V,(t=>S=t)),S&&void 0!==S.rotation){const t=S.pivot_x||{type:"pivot-percentage",value:50};ar=At(t.value,ar);const e="pivot-fixed"===t.type?rt(ar):`${ar}%`,r=S.pivot_y||{type:"pivot-percentage",value:50};sr=At(r.value,sr),Xe=`${e} ${"pivot-fixed"===r.type?rt(sr):`${sr}%`}`,Ke=`rotate(${S.rotation}deg)`}return D=Se||Oe?"100%":De||ze?0:void 0,j=Object.assign(Object.assign(Object.assign(Object.assign({},Zt),he),ye),{width:le,"min-width":ue,"max-width":ce,height:de,"min-height":ve,"max-height":ge||(null==Zt?void 0:Zt["max-height"]),"grid-area":m,padding:l,margin:Fe,opacity:pe,transition:ir,"transform-origin":Xe,transform:Ke,"flex-grow":De||ze||void 0,"flex-shrink":je||Ie?1:void 0,"flex-basis":D,"--divkit-animation-opacity-start":qe,"--divkit-animation-opacity-end":Ge,"--divkit-animation-scale-start":Ze,"--divkit-animation-scale-end":Ye}),Q(),nt(),at(),st(),ct(),dt(),vt(),gt(),ft(),_t(),kt(),Et(),St(),Pt(),Tt(),zt(),It(),Pe||Ne?"":`${z(Mt,"Actionable").$$render(t,{use:function(t){ae=t,Be&&Lt.transition_in&&oe.registerChildWithTransitionIn(Lt,qt,Lt.transition_in,t).then((()=>{We=!1})).catch((t=>{throw We=!1,t})),Be&&Lt.transition_out&&oe.registerChildWithTransitionOut(Lt,qt,Lt.transition_out,t),Be&&Lt.transition_change&&oe.registerChildWithTransitionChange(Lt,qt,Lt.transition_change,t).then((()=>{He=!1})).catch((t=>{throw He=!1,t}));const e=Yt.fakeElement?[]:Lt.visibility_actions||Lt.visibility_action&&[Lt.visibility_action],r=Yt.fakeElement?[]:Lt.disappear_actions;(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length)&&function(t,{visibilityActions:e,disappearActions:r,rootCtx:i}){const n=[];e&&e.forEach((t=>{n.push({type:"visibility",index:n.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{n.push({type:"disappear",index:n.length,action:t,visible:!1,count:0,finished:!1})}));const o=n.map((t=>i.getJsonWithVars({visibility_percentage:t.action.visibility_percentage,visibility_duration:"visibility"===t.type?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit}))),a=[...new Set([...n.map(((t,e)=>(o[e].visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const r=t.intersectionRatio>=(e.action.visibility_percentage||50)/100,n="visibility"===e.type?!e.visible&&r:e.visible&&!r,a="visibility"===e.type?!r:r;n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=o[e.index],r=0===t.log_limit?1/0:t.log_limit||1;++e.count>=r&&(e.finished=!0);const n=i.getJsonWithVars(e.action),a=n.url;if(a){const t=pt(a);t&&!ht(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(n):n.log_id&&i.execCustomAction(n))}i.logStat("visibility"===e.type?"visible":"disappear",n)}),o[e.index].visibility_duration||800)):a&&e.timer&&clearTimeout(e.timer),e.visible=r}))}))}),{threshold:a}).observe(t)}(t,{visibilityActions:e,disappearActions:r,rootCtx:ne});const i=Lt.id;i&&oe.registerChild(i);let n=null;if(Array.isArray(Lt.extensions)){const e=ne.getExtensionContext();me=Lt.extensions.map((r=>{var i;const n=ne.getExtension(r.id,r.params);return n&&(null===(i=n.mountView)||void 0===i||i.call(n,t,e)),n})).filter(lt)}return{destroy(){if(i&&oe.unregisterChild(i),me){const e=ne.getExtensionContext();me.forEach((r=>{var i;null===(i=r.unmountView)||void 0===i||i.call(r,t,e)})),me=null}n&&n.destroy()}}},cls:Gt+" "+mt("outer",tt,A),style:et(j),actions:Qe,doubleTapActions:tr,longTapActions:er,attrs:se,isNativeActionAnimation:!rr.length||(cr=rr,cr.some((t=>"native"===t.name)))},{},{default:()=>`${fe?`${z(Nt,"OuterBackground").$$render(t,{background:R,radius:Ee},{},{})}`:""}${n.default?n.default({}):""}${_e?`<span${J("class",tt.outer__border,0)}${J("style",et(be),0)}></span>`:""}`})}`})),Rt=Jt,Bt={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function Ut(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Wt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Lt(t,e){return Wt(t)||e}const Ht=N(((t,e,r,i)=>{let n,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",y=12,b=1.25,_="",w="",x=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 y=Ut(p.font_size,y),zt(p.line_height)&&(b=Number(p.line_height)/y),wt(p.letter_spacing)&&(_=rt(p.letter_spacing)),d=Lt(p.font_weight,d),w=ot(p.text_color,1,w),n=p.top_offset?rt(p.top_offset):"",o=p.background?ut([p.background]):null,x=(null===(u=p.border)||void 0===u?void 0:u.stroke)&&"transparent"!==ot(p.border.stroke.color)&&zt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=Ut(null===(c=p.border)||void 0===c?void 0:c.corner_radius,0),s={singleline:h,decoration:m},l={"font-size":rt(10*y/g),"line-height":b,"letter-spacing":_,"font-weight":d,color:w,background:(null==o?void 0:o.color)||void 0,"box-shadow":x?`inset 0 0 0 ${rt(x.width)} ${x.color}`:void 0,"border-radius":a?rt(a):void 0},`${n?`<span${J("class",Bt["text-range__top-offset"],0)}${B({"margin-top":n})}></span>`:""}${z(Mt,"Actionable").$$render(t,{cls:mt("text-range",Bt,s),actions:f,style:et(l)},{},{default:()=>`${j(v)}`})}`})),qt=Ht;function Gt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Zt(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function Yt(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function Xt(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const Kt=N(((t,e,i,n)=>{let o,s,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,j,S,P,T,I,O,N,R,B,U,W=r,L=r,H=r,q=r,Z=r,Y=r,tt=r,it=r,nt=r,at=r,st=r,lt=r,ct=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ht=g(X);let ft=!1,yt="",bt=12,_t=1.25,wt=!1,xt="",$t="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,Dt=[],jt=[];var St,Pt;d((()=>{jt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)}))})),void 0===e.json&&i.json&&void 0!==dt&&i.json(dt),void 0===e.templateContext&&i.templateContext&&void 0!==vt&&i.templateContext(vt),void 0===e.origJson&&i.origJson&&void 0!==gt&&i.origJson(gt),void 0===e.layoutParams&&i.layoutParams&&void 0!==pt&&i.layoutParams(pt),o=ht.getDerivedFromVars(dt.text),ct(),ct=a(o,(t=>U=t)),St=U,Pt=yt,yt=String(null!=St?St:"")||Pt,yt?ft=!1:(ft=!0,ht.logError(K(new Error('Missing "text" prop for div "text"')))),s=ht.getDerivedFromVars(dt.ranges),L(),L=a(s,(t=>V=t)),l=ht.getDerivedFromVars(dt.images),W(),W=a(l,(t=>A=t)),u=ht.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),H(),H=a(u,(t=>D=t)),c=ht.getDerivedFromVars(dt.font_size),lt(),lt=a(c,(t=>B=t)),bt=Ut(B,bt),v=ht.getDerivedFromVars(dt.line_height),st(),st=a(v,(t=>R=t));{const t=R;zt(t)?(_t=Number(t)/bt,wt=!0):wt=!1}p=ht.getDerivedFromVars(dt.max_lines),it(),it=a(p,(t=>I=t)),h=1===I;{let t="",e="",r=!1;if(I&&I>1){let i=Number(I);t=i*_t+"em",V||A||(e=i,r=!0)}xt=t,$t=e,kt=r}f=ht.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(f,(t=>N=t)),Et=Gt(N,Et),m=ht.getDerivedFromVars(dt.text_alignment_vertical),nt(),nt=a(m,(t=>O=t)),Ct=Zt(O,Ct),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,b=ht.getDerivedFromVars(dt.text_color),tt(),tt=a(b,(t=>T=t)),_=Boolean(T)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";I&&y&&_&&(t=ot(T||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ht.getDerivedFromVars(dt.truncate),Y(),Y=a(w,(t=>P=t)),x="none"===P?"none":"",$=ht.getDerivedFromVars(dt.text_gradient),Z(),Z=a($,(t=>S=t));{let t="";if(S){const e=ut([S]);e.image&&(t=e.image)}At=t}return k=ht.getDerivedFromVars(dt.selectable),q(),q=a(k,(t=>j=t)),Vt=Yt(j,Vt),function(t,e,r){let i=[];if(jt.forEach((([t,e])=>{ht.removeSvgFilter(t,e)})),jt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Dt=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],u=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),u.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},D),...l);i.push({text:n.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},D),...l),r=rt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=rt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":rt(10*(Number(e.font_size)||12)/bt)};let a="";const s=t.image.tint_color,u=Xt(t.image.tint_mode,"source_in");if(s){const e=ot(t.image.tint_color);a=ht.addSvgFilter(e,u),jt.push([e,u])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},D)}),Dt=i}(yt,V,A),E={singleline:h,multiline:kt,halign:Et,valign:Ct,truncate:x},C={gradient:Boolean(At)},F={"font-size":rt(bt),"line-height":_t,"max-height":xt,"-webkit-line-clamp":$t,color:Ft,"background-image":At},W(),L(),H(),q(),Z(),Y(),tt(),it(),nt(),at(),st(),lt(),ct(),ft?"":`${z(Rt,"Outer").$$render(t,{cls:mt("text",Q,E)+" "+(Vt?"":G),json:dt,origJson:gt,templateContext:vt,layoutParams:pt},{},{default:()=>`<span${J("class",mt("text__inner",Q,C),0)}${J("style",et(F),0)}>${Dt.length?`${M(Dt,((e,r)=>"text"in e?e.text?`${z(qt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:bt,textStyles:e.textStyles,singleline:h,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",et(e.image.wrapperStyle),0)}><img${J("class",Q.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",et({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${z(qt,"TextRangeView").$$render(t,{text:yt,rootFontSize:bt,textStyles:D,singleline:h},{},{})}`}</span>`})}`})),Qt=Kt,te={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 ee(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let i;if("rounded_rectangle"===t.shape.type)n=t.shape,i={width:Number((null===(o=n.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=n.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=n.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Number((null===(e=t.radius)||void 0===e?void 0:e.value)||10);return{width:r,height:r,radius:r}}(t.shape)}var n,o,a,s,l;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?ot(o.color):"",s=null!=o&&o.width?Number(null!==(i=o.width)&&void 0!==i?i:1):"";n.width=t.width,n.height=t.height,n.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return n.background=ot(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${rt(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}function re(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 ie(t,e,r){let i;return i="horizontal"===t?[null!=r&&r.show_between?r.style.height:0,null!=e&&e.show_between?e.style.width:0]:[null!=e&&e.show_between?e.style.height:0,null!=r&&r.show_between?r.style.width:0],i.map(rt).join(" ")}let ne;function oe(){if(void 0!==ne)return ne;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),ne=1===t.scrollHeight,document.body.removeChild(t),ne}const ae="divkit-a7719",se="divkit-f6e9a";function le(t,e,r,i,n,o){o?t.push({top:r.bottom,left:n.left,width:n.right-n.left,height:i.top-r.bottom,style:e}):t.push({top:n.top,left:r.right,width:i.left-r.right,height:n.bottom-n.top,style:e})}function ue(t,e,r,i){const n={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if((null==e?void 0:e.show_at_start)&&le(t,e.style,{top:0,right:r[0].left-e.style.width,bottom:r[0].top-e.style.height,left:0},r[0],n,i),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)le(t,e.style,r[o],r[o+1],n,i);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];le(t,e.style,o,{top:o.bottom+e.style.height,right:0,bottom:0,left:o.right+e.style.width},n,i)}}const ce=N(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,i=0,n=!1;return function(){const e=Date.now();return!i||Math.abs(e-i)>10?(i=e,r=t.apply(this,arguments)):(n||(n=!0,setTimeout((()=>{n=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!n)return;const t=n.getBoundingClientRect();c=[];let e=[...n.children].filter((t=>t!==u&&!t.classList.contains(tt.outer__border))),r=[];for(;e.length;){const t=[],i=e.shift();t.push(i);let n=i.getBoundingClientRect(),a=n.right,s=n.bottom;for(;e.length;){let r=e[0],i=r.getBoundingClientRect();if("vertical"===o){if(i.top<s)break}else if(i.left<a)break;a=Math.max(a,i.right),s=Math.max(s,i.bottom),t.push(r),e.shift()}r.push(t)}const i=[];r.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&ue(c,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};i.push(r)})),s&&ue(c,s,i,"horizontal"===o),c.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let u,c=[],v=!1,g=null,p=null;return d((()=>{v=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),n=null,(v&&n||g||p)&&(g&&(g.disconnect(),g=null),p&&(p.disconnect(),p=null),v&&n&&("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(se))&&!(null==r?void 0:r.contains(ae))}))&&l()})),g.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(l),p.observe(n)))),v&&n&&l(),`\n\n<div${J("class",ae,0)}${J("this",u,0)}>${M(c,(t=>`<div${J("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class",se,0)}${B({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div>\n </div>`))}</div>`})),de=N(((t,e,i,n)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,j=r,S=r,P=r,T=r,I=r,O=r,N=r,J=r,R=r;var B,U,W,L,H,q;let{json:G={}}=e,{templateContext:Z}=e,{origJson:Y}=e,{layoutParams:Q}=e;const tt={left:"start",center:"center",right:"end"},et={top:"start",center:"center",bottom:"end",baseline:"baseline"},rt=["rounded_rectangle","circle"],it=g(X);let nt,ot=!1,at="vertical",st="top",lt="left",ut=null,ct=null,dt={};if(void 0===e.json&&i.json&&void 0!==G&&i.json(G),void 0===e.templateContext&&i.templateContext&&void 0!==Z&&i.templateContext(Z),void 0===e.origJson&&i.origJson&&void 0!==Y&&i.origJson(Y),void 0===e.layoutParams&&i.layoutParams&&void 0!==Q&&i.layoutParams(Q),o=G.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,it.logError(K(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=Z;return({templateContext:r,json:e}=it.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=it.getDerivedFromVars(G.orientation),R(),R=a(l,(t=>D=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(D,at),u=it.getDerivedFromVars(G.content_alignment_vertical),J(),J=a(u,(t=>V=t)),st=Zt(V,st),c=it.getDerivedFromVars(G.content_alignment_horizontal),N(),N=a(c,(t=>A=t)),lt=Gt(A,lt),d=it.getDerivedFromVars(G.layout_mode),O(),O=a(d,(t=>F=t)),v="wrap"===F,p=it.getDerivedFromVars(G.separator),I(),I=a(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&oe()){const t=ee(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!==(U=C.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(W=C.show_between)||void 0===W||W),style:t}:null}else ut=null;if(h=it.getDerivedFromVars(G.line_separator),T(),T=a(h,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&oe()){const t=ee(E.style,rt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(L=E.show_at_start)&&void 0!==L&&L),show_at_end:Boolean(null!==(H=E.show_at_end)&&void 0!==H&&H),show_between:Boolean(null===(q=E.show_between)||void 0===q||q),style:t}:null}else ct=null;f=ut||ct?function(t,e,r){const i={};return re(i,e,"vertical"===t),re(i,r,"horizontal"===t),i}(at,ut,ct):null,m=it.getDerivedFromVars(G.aspect),P(),P=a(m,(t=>k=t));{const t=null==k?void 0:k.ratio;nt=t&&zt(t)?t:void 0}y=it.getDerivedFromVars(G.width),j(),j=a(y,(t=>x=t)),b=it.getDerivedFromVars(G.height),S(),S=a(b,(t=>$=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=tt[lt],nt||$&&"wrap_content"!==$.type&&("match_parent"!==$.type||!(null==Q?void 0:Q.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=et[st],("wrap_content"===(null==x?void 0:x.type)||"match_parent"===(null==x?void 0:x.type)&&(null==Q?void 0:Q.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),v&&(t.parentContainerWrap=!0),dt=Ct(t,dt)}return _={orientation:at,valign:st,halign:lt,wrap:v},w={gap:ut||ct?ie(at,ut,ct):void 0,"aspect-ratio":nt},j(),S(),P(),T(),I(),O(),N(),J(),R(),ot?"":`${z(Rt,"Outer").$$render(t,{cls:mt("container",te,_),style:w,json:G,origJson:Y,templateContext:Z,layoutParams:Q,additionalPaddings:f,heightByAspect:Boolean(nt)},{},{default:()=>`${M(s,(e=>`${z(wr,"Unknown").$$render(t,{layoutParams:dt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ut||ct?`${z(ce,"ContainerSeparators").$$render(t,{separator:ut,lineSeparator:ct,orientation:at},{},{})}`:""}`})}`})),ve=de,ge={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function pe(t,e){return"vertical"===t||"horizontal"===t?t:e}const he=N(((t,e,i,n)=>{let o,s,l,u,c,d,v,p=r,{json:h={}}=e,{templateContext:f}=e,{origJson:m}=e,{layoutParams:y}=e;const b=g(X);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&i.json&&void 0!==h&&i.json(h),void 0===e.templateContext&&i.templateContext&&void 0!==f&&i.templateContext(f),void 0===e.origJson&&i.origJson&&void 0!==m&&i.origJson(m),void 0===e.layoutParams&&i.layoutParams&&void 0!==y&&i.layoutParams(y),o=b.getDerivedFromVars(h.delimiter_style),p(),p=a(o,(t=>v=t)),_=pe(null==v?void 0:v.orientation,_),s=!((null==v?void 0:v.color)&&("transparent"===v.color||9===v.color.length&&0===v.color.indexOf("#00"))),w=ot(null==v?void 0:v.color,1,w),l="horizontal"===_?"100%":rt(1),u="horizontal"===_?rt(1):"100%",c={background:w,width:l,height:u},d={orientation:_},p(),`${z(Rt,"Outer").$$render(t,{cls:mt("separator",ge,d),json:h,origJson:m,templateContext:f,layoutParams:y},{},{default:()=>s?`<span${J("class",ge.separator__inner,0)}${J("style",et(c),0)}></span>`:""})}`})),fe={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function me(t){return t.startsWith("data:")?st(t):`data:image/jpg;base64,${st(t)}`}const ye=N(((t,e,i,n)=>{let o,s,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,j,S,P,M,T,I,O,N,R,U,W,L=r,H=r,q=r,G=r,Z=r,Y=r,Q=r,tt=r,rt=r,it=r,nt=r,at=r,st=r,lt=r,{json:ut={}}=e,{templateContext:ct}=e,{origJson:dt}=e,{layoutParams:pt}=e;const ht=g(X);let ft,yt=0,bt="rgba(0,0,0,0.08)",_t=!1,wt="",xt="none",kt="50% 50%",Et="0",Ct="source_in",At="",Vt="",Dt=0,jt=0,St=0,Pt="",Mt="";d((()=>{ht.removeSvgFilter(ft,Ct)})),void 0===e.json&&i.json&&void 0!==ut&&i.json(ut),void 0===e.templateContext&&i.templateContext&&void 0!==ct&&i.templateContext(ct),void 0===e.origJson&&i.origJson&&void 0!==dt&&i.origJson(dt),void 0===e.layoutParams&&i.layoutParams&&void 0!==pt&&i.layoutParams(pt),o=ht.getDerivedFromVars(ut.image_url),lt(),lt=a(o,(t=>W=t)),s=ht.getDerivedFromVars(ut.gif_url),st(),st=a(s,(t=>U=t)),l=W||U,yt=0,l?_t=!1:(_t=!0,ht.logError(K(new Error('Missing "image_url" for "image"')))),u=ht.getDerivedFromVars(ut.width),at(),at=a(u,(t=>R=t)),c="wrap_content"===(null==R?void 0:R.type),v=ht.getDerivedFromVars(ut.height),nt(),nt=a(v,(t=>N=t)),p="wrap_content"===(null==N?void 0:N.type),h=ht.getDerivedFromVars(ut.preview),it(),it=a(h,(t=>O=t)),wt=O?`url("${me(O)}")`:"",f=ht.getDerivedFromVars(ut.placeholder_color),rt(),rt=a(f,(t=>I=t)),bt=ot(I,1,bt),m=ht.getDerivedFromVars(ut.scale),tt(),tt=a(m,(t=>T=t)),xt=vt(T)||xt,y=ht.getDerivedFromVars({content_alignment_horizontal:ut.content_alignment_horizontal,content_alignment_vertical:ut.content_alignment_vertical}),Q(),Q=a(y,(t=>M=t)),kt=function(t,e){const r=t.content_alignment_horizontal,i=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||i&&"top"!==i&&"center"!==i&&"bottom"!==i?e:gt(t)}(M,kt),b=ht.getDerivedFromVars(ut.accessibility),Y(),Y=a(b,(t=>P=t)),_=(null==P?void 0:P.description)||"",w=ht.getDerivedFromVars(ut.aspect),Z(),Z=a(w,(t=>S=t));{const t=null==S?void 0:S.ratio;Et=t&&zt(t)?(100/Number(t)).toFixed(2):"0"}x=ht.getDerivedFromVars(ut.tint_color),G(),G=a(x,(t=>j=t)),$=ht.getDerivedFromVars(ut.tint_mode),q(),q=a($,(t=>D=t));{const t=j?ot(j):void 0,e=Xt(D,Ct);t===ft&&e===Ct||(ht.removeSvgFilter(ft,Ct),At=t?ht.addSvgFilter(t,e):"",ft=t,Ct=e)}if(k=ht.getDerivedFromVars(ut.appearance_animation),H(),H=a(k,(t=>V=t)),V&&"fade"===V.type){const t=V;Vt=Ft(t.interpolator,"ease_in_out").replace(/_/g,"-"),St=$t(t.duration,300),jt=$t(t.start_delay,0),Dt=$t(t.alpha,0)}E=ht.getDerivedFromVars(ut.filters),L(),L=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=It(A,ht.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),Pt=t,Mt=e}return C={aspect:"0"!==Et,"is-width-content":c,"is-height-content":p,loaded:!1,"before-appearance":Boolean(Vt)&&!0},F={"background-image":wt,"background-color":wt?void 0:bt,"background-size":xt,"clip-path":Mt||void 0,"object-fit":xt,"object-position":kt,filter:["",Pt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Vt||void 0,"--divkit-appearance-fade-start":Vt?Dt:void 0,"--divkit-appearance-delay":Vt?`${jt}ms`:void 0,"--divkit-appearance-duration":Vt?`${St}ms`:void 0},L(),H(),q(),G(),Z(),Y(),Q(),tt(),rt(),it(),nt(),at(),st(),lt(),_t?"":`${z(Rt,"Outer").$$render(t,{cls:mt("image",fe,C),json:ut,origJson:dt,templateContext:ct,layoutParams:pt,customDescription:!0},{},{default:()=>C.aspect?`<span${J("class",fe["image__aspect-wrapper"],0)}${B({"padding-bottom":`${Et}%`})}><img${J("class",fe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",et(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",fe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",et(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}>`})}`})),be={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 _e(t){return t>0&&t<1}function we(t){return String(Math.ceil(1e3*t)/1e3)}function xe(t,e,r){if(t.some(_e)){const e=Math.max(...t.filter(_e).map((t=>1/t)));t=t.map((t=>t*e))}let i=0,n=0;const o=[];if(t.every(Boolean)){n=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*n;r>i&&(i=r)}}for(let e=0;e<r;++e)i?o[e]=`minmax(${rt(i*t[e]/n)},${we(t[e])}fr)`:t[e]?o[e]=`${we(t[e])}fr`:o[e]="auto";return o.join(" ")}const $e=N(((t,e,i,n)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b=r,_=r,w=r,x=r,{json:$={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=g(X);let A,V,D=!1,j=1,S=[],P=[],T=[],I=[],O=0,N=!1,J="top",R="left";void 0===e.json&&i.json&&void 0!==$&&i.json($),void 0===e.templateContext&&i.templateContext&&void 0!==k&&i.templateContext(k),void 0===e.origJson&&i.origJson&&void 0!==E&&i.origJson(E),void 0===e.layoutParams&&i.layoutParams&&void 0!==C&&i.layoutParams(C),o=$.items,(null==o?void 0:o.length)&&Array.isArray(o)?D=!1:(D=!0,F.logError(K(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars($.column_count),x(),x=a(s,(t=>y=t)),j=Ut(y,j),l=(!D&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],P=[],T=[],I=[],N=!1,V=l.map(((i,n)=>{var o,a,s,l;const u=m[n],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 i=e;i<e+c;++i)for(let e=r;e<r+d;++e)t[i+"_"+e]?N=!0:(t[i+"_"+e]=!0,(!S[i]||S[i]<g)&&(S[i]=g),(!P[e]||P[e]<p)&&(P[e]=p),(!T[i]||T[i]<h)&&(T[i]=h),(!I[e]||I[e]<f)&&(I[e]=f));do{++e,e>=j&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(K(new Error('Mismatching "grid" rows/columns'))),O=r}return u=F.getDerivedFromVars($.content_alignment_vertical),_(),_=a(u,(t=>f=t)),J=Zt(f,J),c=F.getDerivedFromVars($.content_alignment_horizontal),b(),b=a(c,(t=>h=t)),R=Gt(h,R),d={valign:J,halign:R},v={"grid-template-columns":xe(S,T,j),"grid-template-rows":xe(P,I,O)},p=D||N,b(),_(),w(),x(),p?"":`${z(Rt,"Outer").$$render(t,{cls:mt("grid",be,d),json:$,origJson:E,templateContext:k,style:v,layoutParams:C},{},{default:()=>`${M(V,(e=>`${z(wr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),ke=$e,Ee={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 Ce(t){const e=[];let r=t[0],i=1;for(let n=1;n<=t.length;n++)t[n]!==r?(e.push(i>1?`repeat(${i}, ${r})`:r),r=t[n],i=1):i++;return e.join(" ")}function Fe(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const Ae=N(((t,e,i,n)=>{let o,s,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,S,P,T,I,O,N,R=r,B=r,U=r,W=r,H=r,q=r,G=r,Y=r,Q=r,tt=r,{json:it={}}=e,{templateContext:nt}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=g(X);let lt,ut,ct=[],dt=!1,vt=!1,gt=null,pt=!1;const ht=st.getCustomization("galleryLeftClass"),ft=st.getCustomization("galleryRightClass");let yt=!1;O=a(st.isDesktop,(t=>I=t));let bt,_t,wt,kt,Et=1,Ft="horizontal",At="start",Vt=8,Dt="",jt=[],St={},Pt=!1,Mt={},Tt=0;const zt=Fe((function(){if(!lt)return;const t=lt.scrollLeft,e=lt.scrollWidth,r=lt.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function It(){let t=[],e=ct[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<Et;++e){const i=ct[e].children[r];i&&t.push(i)}return t}function Ot(t,e,r="smooth"){const i="horizontal"===Ft,n=i?"offsetLeft":"offsetTop",o=i?"left":"top";lt.scroll({[o]:Math.max(0,t[e][n]-Vt/2),behavior:r})}function Nt(t){const e=It(),r=lt.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===Ft?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==i)return i;const n=e.map((t=>function(t,e){return"horizontal"===Ft?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=n.findIndex(Boolean);return-1!==o?"prev"===t&&2===n.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!it.id||yt||(null==at?void 0:at.fakeElement)||st.registerInstance(it.id,{setCurrentItem(t){const e=It();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Ot(e,t)},setPreviousItem(t){const e=Nt("prev"),r=It();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),Ot(r,i)},setNextItem(t){const e="horizontal"===Ft?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=It();if(e&&"ring"===t)return void Ot(r,0);const i=Nt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),Ot(r,n)}}),d((()=>{pt=!1,it.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(it.id)})),void 0===e.json&&i.json&&void 0!==it&&i.json(it),void 0===e.templateContext&&i.templateContext&&void 0!==nt&&i.templateContext(nt),void 0===e.origJson&&i.origJson&&void 0!==ot&&i.origJson(ot),void 0===e.layoutParams&&i.layoutParams&&void 0!==at&&i.layoutParams(at),o=it.items,(null==o?void 0:o.length)&&Array.isArray(o)?yt=!1:(yt=!0,st.logError(K(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!yt&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=I&&pt&&!yt,l?"undefined"!=typeof ResizeObserver&&(gt=new ResizeObserver((()=>{zt()})),gt.observe(ut)):gt&&(gt.disconnect(),gt=null),u=st.getDerivedFromVars(it.column_count),Q(),Q=a(u,(t=>T=t)),Et=Ut(T,Et),c=function(t,e){let r=0,i=[];for(let n=0;n<t.length;++n)i[r]||(i[r]=[]),i[r].push(t[n]),++r>=e&&(r=0);return i}(s,Et),v=st.getDerivedFromVars(it.orientation),Y(),Y=a(v,(t=>P=t)),Ft=pe(P,Ft),p=st.getDerivedFromVars(it.cross_content_alignment),G(),G=a(p,(t=>S=t)),At=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,At),h=st.getDerivedFromVars(it.item_spacing),q(),q=a(h,(t=>D=t)),Vt=$t(D,Vt),bt=rt(Vt),f=st.getDerivedFromVars(it.cross_spacing),H(),H=a(f,(t=>V=t)),wt=$t(V,Vt),_t=rt(wt),m=st.getDerivedFromVars(it.paddings),W(),W=a(m,(t=>A=t)),Dt=xt(A,Dt),y="horizontal"===Ft?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===Ft?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),kt=L(t,(t=>t)),U(),U=a(kt,(t=>F=t))}jt=[],Et>1?jt.push("auto"):F.forEach((t=>{!t&&"horizontal"===Ft||"match_parent"===(null==t?void 0:t.type)?jt.push("100%"):jt.push("max-content")})),b=st.getDerivedFromVars(it.scroll_mode),B(),B=a(b,(t=>C=t));{const t={};let e={};Pt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===Ft?e.parentVAlign=At:e.parentHAlign=At,"paging"===C&&(Pt=!0,e.scrollSnap="start",t["horizontal"===Ft?"scroll-padding-left":"scroll-padding-top"]=rt(Vt/2)),1===Et&&(e.parentLayoutOrientation=Ft),St=Ct(t,St),Mt=Ct(e,Mt)}return _=st.getDerivedFromVars(it.restrict_parent_scroll),tt(),tt=a(_,(t=>N=t)),w={padding:Dt,"grid-gap":_t},x={"grid-gap":bt,[y]:Ce(jt)},$={orientation:Ft,"scroll-snap":Pt},k=st.getDerivedFromVars(it.default_item),R(),R=a(k,(t=>E=t)),Tt=$t(E,Tt),R(),B(),U(),W(),H(),q(),G(),Y(),Q(),O(),tt(),"\n\n"+(yt?"":`${z(Rt,"Outer").$$render(t,{cls:mt("gallery",Ee,$),json:it,origJson:ot,templateContext:nt,layoutParams:at,customPaddings:!0,customActions:"gallery"},{},{default:()=>`<div class="${j(Ee.gallery__scroller,!0)+" "+j(N?Z:"",!0)}"${J("style",et(St),0)}${J("this",lt,0)}><div${J("class",Ee["gallery__items-grid"],0)}${J("style",et(w),0)}${J("this",ut,0)}>${M(c,((e,r)=>`<div${J("class",Ee.gallery__items,0)}${J("style",et(x),0)}${J("this",ct[r],0)}>${M(e,(e=>`${z(wr,"Unknown").$$render(t,{layoutParams:Mt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===Ft?`${dt&&l?`\n <div${J("class",ht||`${Ee.gallery__arrow} ${Ee.gallery__arrow_left}`,0)}>${ht?"":`<svg${J("class",Ee["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",Ee["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""}\n ${vt&&l?`\n <div${J("class",ft||`${Ee.gallery__arrow} ${Ee.gallery__arrow_right}`,0)}>${ft?"":`<svg${J("class",Ee["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",Ee["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`)})),Ve=Ae,De={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"},je=N(((t,e,i,n)=>{let o,s,l,u,c,v,p,h,f,m,y,b,w,x,$,k,E,C,F,A,V,D,S,P,T=r,I=r,O=r,N=r,R=r,U=r,L=r,H=r,q=r;var G,Y;let{json:Q={}}=e,{templateContext:tt}=e,{origJson:nt}=e,{layoutParams:at}=e;const st=g(X),lt=st.genId("tabs");let ut=!1,ct=W([]);$=a(ct,(t=>x=t));let dt,vt,gt,pt={};const ht=st.getJsonWithVars(Q.selected_tab);let ft,yt,_t=ht&&Number(ht)||0,kt=12,Et="",Ft="",At="",Vt="",St="",Pt="",Tt="",It="",Ot=0,Nt="",Jt="",Bt=null,Wt=!1,Ht=!1,qt=_t,Gt=[],Zt=[];async function Yt(t,e=!1){if(qt=_t,_t=t,Wt||(Wt=!0,vt.style.height=rt(vt.clientHeight),gt.style.transform=`translate3d(${100*-qt}%,0,0)`),Ht=!0,async function(t){await _(),gt.style.transform=`translate3d(${t}%,0,0)`}(100*-_t),function(t=!1){const e=t?Math.max(0,_t-1):Math.min(_t,qt),r=t?Math.min(o.length-1,_t+1):Math.max(_t,qt);Gt=Gt.map(((t,i)=>t||i>=e&&i<=r)),Zt=Zt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await _();const t=document.getElementById(`${lt}-panel-${_t}`);t&&(vt.style.height=rt(t.offsetHeight))}(),Kt&&clearTimeout(Kt),Kt=window.setTimeout((()=>{Zt=o.map(((t,e)=>e===_t))}),400),Xt=-_t*vt.clientWidth,e){await _();const t=dt.querySelector(`.${De.tabs__item_selected}`);t&&t.focus()}}let Xt,Kt=null;if(!Q.id||ut||(null==at?void 0:at.fakeElement)||st.registerInstance(Q.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Yt(t)},setPreviousItem(t){let e=_t-1;e<0&&(e="ring"===t?o.length-1:_t),Yt(e)},setNextItem(t){let e=_t+1;e>o.length-1&&(e="ring"===t?0:_t),Yt(e)}}),d((()=>{Q.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(Q.id)})),void 0===e.json&&i.json&&void 0!==Q&&i.json(Q),void 0===e.templateContext&&i.templateContext&&void 0!==tt&&i.templateContext(tt),void 0===e.origJson&&i.origJson&&void 0!==nt&&i.origJson(nt),void 0===e.layoutParams&&i.layoutParams&&void 0!==at&&i.layoutParams(at),o=Q.items||[],Array.isArray(o)&&o.length){let t=[];o.forEach(((e,r)=>{const i=st.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});i.title&&"string"==typeof i.title?t.push(i):st.logError(K(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),ct.set(t)}else ct.set([]);(null==x?void 0:x.length)?ut=!1:(ut=!0,st.logError(K(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=st.getDerivedFromVars(Q.width),H(),H=a(s,(t=>S=t)),l=st.getDerivedFromVars(Q.height),L(),L=a(l,(t=>D=t));{let t={};(null==at?void 0:at.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==S?void 0:S.type)&&(t.parentHorizontalWrapContent=!0),D&&"wrap_content"!==D.type||(t.parentVerticalWrapContent=!0),pt=Ct(t,pt)}if(!ut&&(_t<0||_t>=o.length)&&(st.logError(K(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Q.selected_tab,length:o.length}})),_t=_t<0?0:o.length-1),ut||x.some((t=>_t===t.index))||(st.logError(K(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Q.selected_tab}})),_t=(null===(G=x[0])||void 0===G?void 0:G.index)||0),u=st.getDerivedFromVars(Q.tab_title_style),U(),U=a(u,(t=>V=t)),c=V||{},kt=Ut(c.font_size,kt),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/kt*10,right:(Number(t.right)||0)/kt*10,bottom:(Number(t.bottom)||0)/kt*10,left:(Number(t.left)||0)/kt*10};Et=xt(e,Et)}{const t=c.line_height;void 0!==t&&zt(t)&&(Ft=rt(t/kt*10))}{const t=c.letter_spacing;void 0!==t&&wt(t)&&(At=rt(t/kt*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(Y=c.corner_radius)&&void 0!==Y?Y:1e3;c.corners_radius?Vt=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!wt(n[t]))return i;return jt(t,e,r)}(c.corners_radius,t,kt,Vt):wt(t)&&(Vt=rt(t/kt*10))}return ft=Lt(c.active_font_weight||c.font_weight,ft),yt=Lt(c.inactive_font_weight||c.font_weight,yt),St=ot(c.active_text_color,1,St),Pt=ot(c.inactive_text_color,1,Pt),Tt=ot(c.active_background_color,1,Tt),It=ot(c.inactive_background_color,1,It),Ot=$t(c.item_spacing,Ot),v=st.getDerivedFromVars(Q.has_separator),R(),R=a(v,(t=>A=t)),p=st.getDerivedFromVars(Q.separator_color),N(),N=a(p,(t=>F=t)),h=st.getDerivedFromVars(Q.separator_paddings),O(),O=a(h,(t=>C=t)),A&&(F&&(Nt=ot(F,1,Nt)),C&&(Jt=xt(C,Jt))),f={background:Nt,margin:Jt},m=st.getDerivedFromVars(Q.switch_tabs_by_content_swipe_enabled),I(),I=a(m,(t=>E=t)),y=void 0===E||Boolean(E),b=st.getDerivedFromVars(Q.restrict_parent_scroll),q(),q=a(b,(t=>P=t)),w=st.getDerivedFromVars(Q.title_paddings),T(),T=a(w,(t=>k=t)),Bt=Dt(k||void 0,Bt),ut||(Gt=o.map(((t,e)=>e===_t)),Zt=o.map(((t,e)=>e===_t))),$(),T(),I(),O(),N(),R(),U(),L(),H(),q(),ut?"":`${z(Rt,"Outer").$$render(t,{cls:mt("tabs",De,{}),json:Q,origJson:nt,templateContext:tt,layoutParams:at,customActions:"tabs"},{},{default:()=>`\n <div class="${j(De.tabs__list,!0)+" "+j(P?Z:"",!0)}" role="tablist"${B({"--divkit-tabs-title-padding":Bt?bt(Bt):"","--divkit-tabs-font-size":rt(kt),"--divkit-tabs-paddings":Et,"--divkit-tabs-line-height":Ft,"--divkit-tabs-letter-spacing":At,"--divkit-tabs-active-font-weight":ft||"","--divkit-tabs-inactive-font-weight":yt||"","--divkit-tabs-active-text-color":St,"--divkit-tabs-inactive-text-color":Pt,"--divkit-tabs-active-background-color":Tt,"--divkit-tabs-inactive-background-color":It,"--divkit-tabs-border-radius":Vt,"--divkit-tabs-items-spacing":Ot?it(Ot):""})}${J("this",dt,0)}>${M(x,(e=>{let r=e.index,i=r===_t;return`\n \n\n ${z(Mt,"Actionable").$$render(t,{cls:mt("tabs__item",De,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=at&&at.fakeElement?[]:[e.title_click_action],attrs:{id:`${lt}-tab-${r}`,"aria-controls":`${lt}-panel-${r}`,role:"tab",tabindex:!i||null!=at&&at.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"true":"false"},customAction:null!=at&&at.fakeElement?null:t=>function(t,e){return _t===e||(Yt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${A?`<div${J("class",De.tabs__separator,0)}${J("style",et(f),0)}></div>`:""}\n <div class="${j(De.tabs__panels,!0)+" "+j(P?Z:"",!0)}"${J("this",vt,0)}><div${J("class",mt("tabs__swiper",De,{inited:Wt,animated:Ht}),0)}${J("this",gt,0)}>${M(x,(e=>{let r=e.index;return`\n\n <div${J("class",mt("tabs__panel",De,{visible:Zt[r]}),0)} role="tabpanel" id="${j(lt,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(lt,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Gt[r]?`${z(wr,"Unknown").$$render(t,{div:o[r].div,templateContext:tt,layoutParams:pt},{},{})}`:""}\n </div>`}))}</div></div>`})}`})),Se=je,Pe="divkit-eb860",Me="divkit-e08c6";function Te(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}Te([.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]),Te([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 ze=N(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=g(X),c=g(yt);let p=new Map,h=new Set,f=!1,m=null,y=[],b=[],w=[],x=[];const $=o.div_id||o.id;let k;$?(null==l?void 0:l.fakeElement)||(c.registerInstance($,{async setState(t){if(k===t)return;u.setRunning("stateChange",!0),new Set(h),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],x.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],x=[];const e=n.find((e=>e.state_id===t))||null;e?(k=t,E=e):u.logError(K(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);u.logError(K(new Error("Missing state block with id"),{additional:{id:t}}))}}),v(yt,{registerInstance(t,e){m||(m=new Map),m.has(t)?u.logError(K(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return b.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return w.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,i){const n=t.id;if(!n)return Promise.resolve();const o={id:n,json:t,templateContext:e,transitions:r,node:i};return x.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){h.add(t)},unregisterChild(t){h.delete(t)}})):(f=!0,u.logError(K(new Error('Missing "id" prop for div "state"'))));let E=null;const C=u.getJsonWithVars(o.default_state_id);let F=!1;return d((()=>{$&&!(null==l?void 0:l.fakeElement)&&c.unregisterInstance($)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(h=new Set),n=o.states||[],(null==n?void 0:n.length)?f=!1:(f=!0,u.logError(K(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||u.logError(K(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(n),f?"":`${z(Rt,"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(wr,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${M(y,(e=>"direction"in e?`<div${J("class",Pe,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${J("class",Me,0)}>${z(wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class",Pe,0)}><div${J("class",Me,0)}>${z(wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),Ie={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Oe=N(((t,e,i,n)=>{let o,l,u,c,v,p,h,f,m,y,b,_,w,x,$,k,E,C=r,F=r,A=r,V=r,D=r,S=r;var P,T,I,O,N,R,B;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:H}=e;const q=g(X),G=q.genId("pager");let Y,Q=!1,tt=!1,nt=0,ot=0,at=!1,st="horizontal",lt="",ut="",ct="";function dt(t,e="smooth"){const r="horizontal"===st,i=Y.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Y.scroll({[o]:i[n],behavior:e}),nt=t}Fe((function(){if(!Q)return;const t=function(){const t=Array.from(Y.children),e=Y.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===st?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:nt}();t!==nt&&(nt=t)}),50),U.id&&!(null==H?void 0:H.fakeElement)&&q.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');dt(t)},setPreviousItem(t){let e=nt-1;e<0&&(e="ring"===t?o.length-1:nt),dt(e)},setNextItem(t){let e=nt+1;e>o.length-1&&(e="ring"===t?0:nt),dt(e)}}),d((()=>{Q=!1,U.id&&!(null==H?void 0:H.fakeElement)&&q.unregisterInstance(U.id)})),void 0===e.json&&i.json&&void 0!==U&&i.json(U),void 0===e.templateContext&&i.templateContext&&void 0!==W&&i.templateContext(W),void 0===e.origJson&&i.origJson&&void 0!==L&&i.origJson(L),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.layoutParams(H),(null===(P=U.items)||void 0===P?void 0:P.length)&&Array.isArray(U.items)?tt=!1:(tt=!0,q.logError(K(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!tt&&U.items||[]).map((t=>{let e=t,r=W;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=q.getDerivedFromVars(U.layout_mode),F(),F=a(l,(t=>w=t)),w?"percentage"!==w.type&&"fixed"!==w.type?(at=!0,q.logError(K(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):at=!1:(at=!0,q.logError(K(new Error('Empty "layout_mode" prop for div "pager"')))),u=q.getDerivedFromVars(U.orientation),D(),D=a(u,(t=>k=t)),st=pe(k,st),c=q.getDerivedFromVars(U.item_spacing),V(),V=a(c,(t=>$=t));{const t=null==$?void 0:$.value;t&&wt(t)&&(lt=rt(t||0))}if(v=q.getDerivedFromVars(U.paddings),A(),A=a(v,(t=>x=t)),ut=xt(x,ut),p=q.getDerivedFromVars(U.restrict_parent_scroll),S(),S=a(p,(t=>E=t)),h="horizontal"===st?"grid-auto-columns":"grid-auto-rows","fixed"===(null==w?void 0:w.type)){const t=it("horizontal"===st?((null===(T=U.paddings)||void 0===T?void 0:T.left)||0)+((null===(I=U.paddings)||void 0===I?void 0:I.right)||0):((null===(O=U.paddings)||void 0===O?void 0:O.top)||0)+((null===(N=U.paddings)||void 0===N?void 0:N.bottom)||0)),e=null===(R=w.neighbour_page_width)||void 0===R?void 0:R.value;ct=e?`calc(100% + ${t} - 2 * ${it(e)} - 2 * ${lt})`:"100%"}else if("percentage"===(null==w?void 0:w.type)){const t=null===(B=w.page_width)||void 0===B?void 0:B.value;ct=`${Number(t)}%`}return f={"grid-gap":lt,padding:ut,[h]:ct},m={orientation:st},y=tt||at,b=q.getStore("pagers"),C(),C=a(b,(t=>_=t)),function(t,e){const r=U.id;if(r){const i=new Map(_);s(b,_=i.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:dt}),_)}}(o.length,nt),function(t){var e;if(t===ot)return;ot=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(nt),C(),F(),A(),V(),D(),S(),y?"":`${z(Rt,"Outer").$$render(t,{cls:mt("pager",Ie,m),json:U,origJson:L,templateContext:W,layoutParams:H,customPaddings:!0},{},{default:()=>`<div class="${j(Ie.pager__items,!0)+" "+j(E?Z:"",!0)}"${J("style",et(f),0)}${J("this",Y,0)}>${M(o,(e=>`<div${J("class",Ie.pager__item,0)}>${z(wr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Ne=Oe,Je={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"},Re=N(((t,e,i,n)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,w,x,$,k,E,C,F=r,A=r,V=r,D=r,S=r,P=r,T=r,I=r,O=r;var N,R;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:q}=e;const G=["rounded_rectangle","circle"],Z=g(X);let Y,K,Q,tt={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},et={width:10,height:10,borderRadius:5,background:"#33919cb5"},it="default",nt=15,at=10,st=5;if(void 0===e.json&&i.json&&void 0!==U&&i.json(U),void 0===e.templateContext&&i.templateContext&&void 0!==W&&i.templateContext(W),void 0===e.origJson&&i.origJson&&void 0!==L&&i.origJson(L),void 0===e.layoutParams&&i.layoutParams&&void 0!==q&&i.layoutParams(q),o=Z.getDerivedFromVars(U.shape),P(),P=a(o,(t=>$=t)),s=Z.getDerivedFromVars(U.active_item_color),D(),D=a(s,(t=>w=t)),l=Z.getDerivedFromVars(U.inactive_item_color),S(),S=a(l,(t=>x=t)),u=Z.getDerivedFromVars(U.active_item_size),T(),T=a(u,(t=>k=t)),c=Z.getDerivedFromVars(U.active_shape),O(),O=a(c,(t=>C=t)),d=Z.getDerivedFromVars(U.inactive_shape),I(),I=a(d,(t=>E=t)),C&&(tt=ee({type:"shape_drawable",shape:C},G,tt)),E&&(et=ee({type:"shape_drawable",shape:E},G,et)),!C&&!E&&$){const t=Ut(k,1.3);et=ee({type:"shape_drawable",shape:$,color:et.background},G,et),et.background=ot(x,1,et.background),tt=Object.assign(Object.assign({},et),{width:et.width*t,height:et.height*t,borderRadius:et.borderRadius*t,background:tt.background}),tt.background=ot(w,1,tt.background)}if(v=Z.getDerivedFromVars(U.space_between_centers),A(),A=a(v,(t=>y=t)),p=Z.getDerivedFromVars(U.items_placement),V(),V=a(p,(t=>b=t)),!b||"default"!==b.type&&"stretch"!==b.type)it="default",y&&(nt=$t(y.value,nt));else if(it=b.type,"default"===it)nt=$t(null===(N=b.space_between_centers)||void 0===N?void 0:N.value,nt);else if("stretch"===it){const t=b;at=Ut(t.max_visible_items,at),st=$t(null===(R=t.item_spacing)||void 0===R?void 0:R.value,st)}return h=Z.getStore("pagers"),F(),F=a(h,(t=>m=t)),async function(t){if(U.pager_id&&t.has(U.pager_id)&&(Q=t.get(U.pager_id),await _(),K)){const t=K.children[Q.currentItem].offsetLeft;Y.scroll({left:t-Y.clientWidth/2,behavior:"smooth"})}}(m),f={placement:it},F(),A(),V(),D(),S(),P(),T(),I(),O(),`${z(Rt,"Outer").$$render(t,{cls:mt("indicator",Je,f),json:U,origJson:L,templateContext:W,layoutParams:q},{},{default:()=>`<div${J("class",Je.indicator__scroller,0)}${J("this",Y,0)}><div${J("class",Je.indicator__items,0)} role="tablist"${B({margin:"default"===it?`0 ${rt(Math.max(0,tt.width-et.width)/2)}`:"","--divkit-indicator-inactive-width":rt(et.width),"--divkit-indicator-inactive-height":rt(et.height),"--divkit-indicator-inactive-border-radius":rt(et.borderRadius),"--divkit-indicator-inactive-background":et.background||"","--divkit-indicator-inactive-box-shadow":et.boxShadow||"","--divkit-indicator-active-width":rt(tt.width),"--divkit-indicator-active-height":rt(tt.height),"--divkit-indicator-active-border-radius":rt(tt.borderRadius),"--divkit-indicator-active-background":tt.background||"","--divkit-indicator-active-box-shadow":tt.boxShadow||"","--divkit-indicator-active-scale":tt.width/et.width,"--divkit-indicator-default-margin":"default"===it?`0 ${rt((nt-et.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===it?rt(st):"","--divkit-indicator-stretch-max-count":"stretch"===it?at:"","--divkit-indicator-stretch-max-spacer":"stretch"===it?rt((at-1)*st):""})}${J("this",K,0)}>${Q?`${M(Array(Q.size),((t,e)=>{let r=e===Q.currentItem;return`\n <div class="${j(mt("indicator__item",Je,{active:r}),!0)+" "+j(H,!0)}" role="tab" id="${j(Q.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(Q.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Be=Re,Ue={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function We(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&ot(t.text_color)||"#000",n=Wt(t.font_weight);if(zt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:rt(t.font_size),fontWeight:n,textColor:i};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Le(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const He="function"==typeof BigInt;function qe(t){return He?BigInt(t):Number(t)}const Ge=qe("9223372036854775807"),Ze=qe("-9223372036854775808");function Ye(t){const e=qe(t);if(e>Ge||e<Ze)throw new Error("Integer overflow.");return e}const Xe=Ye(0);function Ke(t){let e=t;return e<0&&(e=-e),e}function Qe(t){let e=0;return t>0?e=1:t<0&&(e=-1),Ye(e)}class tr{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=W(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const er={string:class extends tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends tr{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends tr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>Ge||t<Ze)throw new Error("Incorrect variable value");return Ye(t)}fromString(t){const e=Ye(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends tr{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}},color:class extends tr{convertValue(t){if("string"!=typeof t||!at(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends tr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function rr(t,e,r){if(!(e in er))throw new Error("Unsupported variable type");return new er[e](t,r)}function ir(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const nr=N(((t,e,i,n)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,S,P,T,I,O,N,R,U,W,L,H,q,G=r,Z=r,Y=r,Q=r,tt=r,et=r,nt=r,ot=r,at=r,st=r,lt=r,ut=r;var ct,dt,vt,gt;let{json:pt={}}=e,{templateContext:ht}=e,{origJson:ft}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},_t=["rounded_rectangle","circle"],xt=["rounded_rectangle"],$t=g(X),kt=g(Pt);let Et,Ct=0,Ft=100;const Vt=$t.getJsonWithVars(pt.thumb_value_variable),Dt=$t.getJsonWithVars(pt.thumb_secondary_value_variable);L=a(Vt&&$t.getVariable(Vt,"integer")||rr("temp","integer",0),(t=>W=t)),U=a(Dt&&$t.getVariable(Dt,"integer")||rr("temp","integer",0),(t=>R=t));let jt,St,Mt,Tt=Le(W||0,Ct,Ft),zt=Le(R||0,Ct,Ft),It=bt,Ot=It,Nt=bt,Jt=bt,Bt=null,Ut=null,Wt=Mt,Lt="",Ht="",qt=!1,Gt=!1;function Zt(){if(!Et)return;const t=Ft-Ct,e=(null==Bt?void 0:Bt.width)||0,r=(null==Ut?void 0:Ut.width)||0;Math.max(e,r)*t>=(null==Et?void 0:Et.clientWidth)?Gt||($t.logError(K(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}Fe(Zt,50),void 0===e.json&&i.json&&void 0!==pt&&i.json(pt),void 0===e.templateContext&&i.templateContext&&void 0!==ht&&i.templateContext(ht),void 0===e.origJson&&i.origJson&&void 0!==ft&&i.origJson(ft),void 0===e.layoutParams&&i.layoutParams&&void 0!==yt&&i.layoutParams(yt),o=$t.getDerivedFromVars(pt.min_value),ut(),ut=a(o,(t=>q=t)),s=$t.getDerivedFromVars(pt.max_value),lt(),lt=a(s,(t=>H=t)),Ct=At(q,Ct),Ft=At(H,Ft),Zt();{const t=Le(W||0,Ct,Ft);t!==Tt&&(Tt=t)}{const t=Le(R||0,Ct,Ft);t!==zt&&(zt=t)}l=$t.getDerivedFromVars(pt.thumb_style),st(),st=a(l,(t=>N=t)),It=ee(N,_t,It),u=$t.getDerivedFromVars(pt.thumb_secondary_style),at(),at=a(u,(t=>O=t)),Ot=ee(O,_t,It),c=$t.getDerivedFromVars(pt.track_inactive_style),ot(),ot=a(c,(t=>I=t)),Nt=ee(I,xt,Nt),d=$t.getDerivedFromVars(pt.track_active_style),nt(),nt=a(d,(t=>T=t)),Jt=ee(T,xt,Jt),v=$t.getDerivedFromVars(pt.tick_mark_active_style),et(),et=a(v,(t=>P=t));{let t=ee(P,_t,bt);t!==bt&&(Bt=t)}Bt?(jt=Dt?ir(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Ft,!0):ir(Ct,Tt,Ct,Ft,!0),Zt()):jt=[],p=$t.getDerivedFromVars(pt.tick_mark_inactive_style),tt(),tt=a(p,(t=>S=t));{let t=ee(S,_t,bt);t!==bt&&(Ut=t)}Ut?(St=Dt?ir(Math.min(Tt,zt),Math.max(Tt,zt)+1,Ct,Ft,!1):ir(Tt+1,Ft+1,Ct,Ft,!0),Zt()):St=[],h=$t.getDerivedFromVars(pt.thumb_text_style),Q(),Q=a(h,(t=>D=t)),Mt=We(D,Mt),f=$t.getDerivedFromVars(pt.thumb_secondary_text_style),Y(),Y=a(f,(t=>V=t)),Wt=We(V,Mt),m=$t.getDerivedFromVars(pt.accessibility),Z(),Z=a(m,(t=>A=t)),(null==A?void 0:A.description)?Lt=A.description:$t.logError(K(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=$t.getDerivedFromVars(pt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Ht=F.description:Dt&&$t.logError(K(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?($t.logError(K(new Error('Cannot show "slider" inside component with action'))),t=!0):It===bt?($t.logError(K(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===bt?($t.logError(K(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===bt&&($t.logError(K(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return b=rt(Math.max(...[It.width,Ot.width,0].filter(wt))),_=rt(Math.max(...[It.height,Ot.height,0].filter(wt))),w=(Tt-Ct)/(Ft-Ct),x=Dt?(zt-Ct)/(Ft-Ct):void 0,$=void 0!==x?Math.abs(x-w):w,k=void 0!==x?Math.min(x,w):0,E={"--divkit-slider-thumb-width":rt(It.width),"--divkit-slider-thumb-height":rt(It.height),"--divkit-slider-thumb-secondary-width":rt(Ot.width),"--divkit-slider-thumb-secondary-height":rt(Ot.height),"--divkit-slider-text-offset-x":(null===(ct=null==Mt?void 0:Mt.offset)||void 0===ct?void 0:ct.x)?it(Mt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==Mt?void 0:Mt.offset)||void 0===dt?void 0:dt.y)?it(Mt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Wt?void 0:Wt.offset)||void 0===vt?void 0:vt.x)?it(Wt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Wt?void 0:Wt.offset)||void 0===gt?void 0:gt.y)?it(Wt.offset.y):void 0,"--divkit-slider-tick-active-width":Bt?rt(Bt.width):void 0,"--divkit-slider-tick-active-height":Bt?rt(Bt.height):void 0,"--divkit-slider-tick-active-border-radius":Bt?rt(Bt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Ut?rt(Ut.width):void 0,"--divkit-slider-tick-inactive-height":Ut?rt(Ut.height):void 0,"--divkit-slider-tick-inactive-border-radius":Ut?rt(Ut.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Ut?void 0:Ut.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Ut?void 0:Ut.boxShadow)||void 0,"--divkit-slider-max-thumb-width":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":x},C={},G(),Z(),Y(),Q(),tt(),et(),nt(),ot(),at(),st(),U(),L(),lt(),ut(),"\n\n"+(qt?"":`${z(Rt,"Outer").$$render(t,{cls:mt("slider",Ue,C),style:E,customDescription:!0,customActions:"slider",json:pt,origJson:ft,templateContext:ht,layoutParams:yt},{},{default:()=>{var t,e,r,i,n,o;return`<div${J("class",Ue["slider__tracks-wrapper"],0)}><div${J("class",Ue["slider__tracks-inner"],0)}${J("this",Et,0)}><div${J("class",Ue.slider__track,0)}${B({height:rt(Nt.height),"border-radius":rt(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n <div${J("class",Ue["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*$).toFixed(2)+"%",height:rt(Jt.height),"border-radius":rt(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${M(jt,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${M(St,(t=>`<div class="${j(Ue.slider__tick,!0)+" "+j(Ue.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ue.slider__thumb,0)}${B({"border-radius":rt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${Mt?`<div${J("class",Ue["slider__thumb-text"],0)}><div${J("class",Ue["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=Mt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Mt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Mt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Tt)}</div></div>`:""}</div>\n ${Dt?`<div class="${j(Ue.slider__thumb,!0)+" "+j(Ue.slider__thumb_secondary,!0)}"${B({"border-radius":rt(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}>${Wt?`<div class="${j(Ue["slider__thumb-text"],!0)+" "+j(Ue["slider__thumb-text_secondary"],!0)}"><div${J("class",Ue["slider__thumb-text-inner"],0)}${B({"font-size":(null===(i=Wt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(n=Wt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Wt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(zt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ue.slider__input,0)}${J("min",Ct,0)}${J("max",Ft,0)} step="1"${J("value",Tt,0)}${J("aria-label",Lt,0)}>\n ${Dt?`<input type="range"${J("class",`${Ue.slider__input} ${Ue.slider__input_secondary}`,0)}${J("min",Ct,0)}${J("max",Ft,0)} step="1"${J("value",zt,0)}${J("aria-label",Ht,0)}>`:""}</div></div>`}})}`)})),or={input:"divkit-c3a4c",input__wrapper:"divkit-ef7eb",input__holder:"divkit-bb3da",input_multiline:"divkit-e48a3",input__input:"divkit-f11e0","input_highlight-color":"divkit-cc00f","input_vertical-overflow":"divkit-b7075"};function ar(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=ar(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,i=e.length-1;const n=e.length-t.length;for(;r<i&&r<t.length&&t[r]===e[r];)++r;for(;i-n>=r&&t[i-n]===e[i];)--i;return++i,{start:r,added:i-r,removed:i-r-n}}function sr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class lr{constructor(t){this.char=t}}class ur{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class cr{constructor(t){sr(this,"filters",new Map),sr(this,"destructedValue",[]),sr(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof lr)t+=r.char;else if(r instanceof ur)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof ur&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(K(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new ur(null,this.filters.get(e.key),e.placeholder):new lr(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=ar(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const i=this.buildBodySubstring(r,t),n=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=this.calculateMaxShift(n,o);this.replaceChars(i,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(n,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,i=e;for(;i<this.destructedValue.length;)this.destructedValue[i]instanceof ur&&++r,++i;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let i=0;for(;i<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+i);)++i;return Math.max(0,i-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof ur&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof ur&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let i;i=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=i}calculateInsertableSubstring(t,e){let r="",i=e;const n=()=>{for(var t;i<this.destructedValue.length&&!(this.destructedValue[i]instanceof ur);)++i;return null===(t=this.destructedValue[i])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=n();null!=e&&e.test(t)&&(r+=t,++i)})),r}collectValueRange(t,e){let r="",i=t;for(;i<=e;){const t=this.destructedValue[i];t instanceof ur&&null!==t.char&&(r+=t.char),++i}return r}replaceChars(t,e,r){let i=this.calculateInsertableSubstring(t,e);void 0!==r&&(i=i.substring(0,r));let n=e,o=0;for(;n<this.destructedValue.length&&o<i.length;){const t=this.destructedValue[n],e=i[o];t instanceof ur&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof ur);)++e;return e}}class dr extends cr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function vr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class gr extends cr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),vr(this,"currencyFormatter",new Intl.NumberFormat),vr(this,"decimalSeparator","."),vr(this,"localeDigits",{}),vr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(K(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),i=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:i,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=ar(this.value,t),i=this.value.lastIndexOf(this.decimalSeparator),n=t.lastIndexOf(this.decimalSeparator),o=i!==n||-1===i&&-1===n,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,i=0;for(;i<t.length;){if(t[i]===this.decimalSeparator&&!this.inDiff(e,i)){r=i;break}i++}let n=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(n=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(i=r;i<t.length;)this.isDigit(t[i])&&!this.inDiff(e,i)&&a--,i++;else{let r=!1;for(let i=0;i<t.length;i++){const n=t[i];n===this.decimalSeparator?r=!0:!this.inDiff(e,i)&&r&&this.isDigit(n)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==n,l=[];i=t.length-1;let u=!1;for(;i>=0;){const c=t[i],d=l.length<=o;this.isDigit(c)?this.inDiff(e,i)&&!u&&s?a>0&&(l.push(c),a--):l.push(c):d&&-1===r&&i===n?(l.push(this.decimalSeparator),u=!0):!d||c!==this.decimalSeparator||r!==i&&-1!==r||(l.push(this.decimalSeparator),u=!0,r=i),i--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}const pr=N(((t,e,i,n)=>{let o,l,u,c,d,v,p,h,f,m,y,b,w,x,$,k,E,C,F,A,V,D,S,P,M,T,I,O,N,R,B,U,W,L,H,q,G,Z=r,Y=r;var Q;let{json:tt={}}=e,{templateContext:nt}=e,{origJson:at}=e,{layoutParams:st}=e;const lt=g(X);let ut,ct=null;const dt=tt.text_variable,vt=null===(Q=tt.mask)||void 0===Q?void 0:Q.raw_text_variable;let gt=!1;dt||(gt=!0,lt.logError(K(new Error('Missing "text_variable" in "input"'))));let pt=dt&<.getVariable(dt,"string")||rr("temp","string","");f=a(pt,(t=>h=t));let ht=vt&<.getVariable(vt,"string")||rr("temp","string","");y=a(ht,(t=>m=t));let ft="";E=a(lt.getDerivedFromVars(tt.mask),(t=>k=t)),H=a(lt.getDerivedFromVars(tt.hint_text),(t=>L=t)),W=a(lt.getDerivedFromVars(tt.hint_color),(t=>U=t));let yt="";B=a(lt.getDerivedFromVars(tt.font_size),(t=>R=t));let wt,xt,kt=12;N=a(lt.getDerivedFromVars(tt.font_weight),(t=>O=t)),I=a(lt.getDerivedFromVars(tt.line_height),(t=>T=t)),M=a(lt.getDerivedFromVars(tt.letter_spacing),(t=>P=t));let Et="";S=a(lt.getDerivedFromVars(tt.text_color),(t=>D=t));let Ct="#000";V=a(lt.getDerivedFromVars(tt.highlight_color),(t=>A=t));let Ft="";F=a(lt.getDerivedFromVars(tt.keyboard_type),(t=>C=t));const At={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let Vt="multi_line_text",jt="text";const St=document&&"inputMode"in document.createElement("input");let Pt;$=a(lt.getDerivedFromVars(tt.max_visible_lines),(t=>x=t));let Mt="",Tt=null,It="",Ot="";async function Nt(){if(!ut||!ct)return;ct.overrideRawValue(m),ht.set(ct.rawValue),s(pt,h=ft=ct.value,h);const t=ct.cursorPosition;await _(),document.activeElement===ut&&(ut.selectionStart=ut.selectionEnd=t)}var Jt;G=a(lt.getDerivedFromVars(tt.select_all_on_focus),(t=>q=t)),void 0===e.json&&i.json&&void 0!==tt&&i.json(tt),void 0===e.templateContext&&i.templateContext&&void 0!==nt&&i.templateContext(nt),void 0===e.origJson&&i.origJson&&void 0!==at&&i.origJson(at),void 0===e.layoutParams&&i.layoutParams&&void 0!==st&&i.layoutParams(st),"fixed_length"===(null==(Jt=k)?void 0:Jt.type)?ct=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const i={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(i),r):new dr(i,e)}return r||null}(Jt,lt.logError,ct):"currency"===(null==Jt?void 0:Jt.type)&&(ct=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new gr(t.locale,e)}(Jt,lt.logError,ct)),ct&&Nt(),ct||ft===h||(ft=h),ct&&ct.rawValue!==m&&Nt(),o=L,yt=ot(U,1,yt),kt=Ut(R,kt),wt=Lt(O,wt);{const t=T;zt(t)&&(xt=t/kt)}return _t(P)&&(Et=rt(P)),Ct=ot(D,1,Ct),Ft=ot(A,1,Ft),C&&C in At&&(jt=At[C],Vt=C),"currency"===(null==k?void 0:k.type)&&(jt=St?"text":"tel",Pt="decimal"),l="multi_line_text"===Vt,u=lt.getDerivedFromVars(tt.paddings),Y(),Y=a(u,(t=>w=t)),zt(x)&&(Mt=`calc(${x*(xt||1.25)*(kt/10)+"em"} + ${it($t(null==w?void 0:w.top,0)+$t(null==w?void 0:w.bottom,0))})`),Tt=Dt(w||void 0,Tt),It=Tt?bt({top:(Number(Tt.top)||0)/kt*10,right:(Number(Tt.right)||0)/kt*10,bottom:(Number(Tt.bottom)||0)/kt*10,left:(Number(Tt.left)||0)/kt*10}):"",c=lt.getDerivedFromVars(tt.accessibility),Z(),Z=a(c,(t=>b=t)),(null==b?void 0:b.description)?Ot=b.description:lt.logError(K(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(Ft),"vertical-overflow":!1,multiline:l},v={"--divkit-input-hint-color":yt,"--divkit-input-highlight-color":Ft,"font-weight":wt,"line-height":xt,"letter-spacing":Et,color:Ct,"max-height":Mt},p={"font-size":rt(kt),padding:It},f(),y(),Z(),Y(),$(),E(),F(),V(),S(),M(),I(),N(),B(),W(),H(),G(),gt?"":`${z(Rt,"Outer").$$render(t,{cls:mt("input",or,d),style:v,customDescription:!0,customActions:"input",customPaddings:!0,json:tt,origJson:at,templateContext:nt,layoutParams:st},{},{default:()=>`<span${J("class",or.input__wrapper,0)}${J("style",et(p),0)}><span${J("class",or.input__holder,0)} aria-hidden="true"${J("this",undefined,0)}>\n ${j(ft)}${ft.endsWith("\n")||!ft?"":""}</span>\n ${l?`<textarea${J("class",or.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",Ot,0)}${J("style",et({padding:It}),0)}${J("placeholder",o,0)}${J("this",ut,0)}>${j(ft,!1)}</textarea>`:`<input${J("type",jt,0)}${J("inputmode",Pt,0)}${J("class",or.input__input,0)} autocomplete="off" autocapitalize="off"${J("aria-label",Ot,0)}${J("style",et({padding:It}),0)}${J("placeholder",o,0)}${J("value",ft,0)}${J("this",ut,0)}>`}</span>`})}`})),hr={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72",select__option:"divkit-e774b"},fr=N(((t,e,i,n)=>{let o,s,l,u,c,d,v,p,h,f,m,y,b,_,w,x,$,k,E,C,F,A,V,D,S,P=r,T=r,{json:I={}}=e,{templateContext:O}=e,{origJson:N}=e,{layoutParams:R}=e;const B=g(X),U=B.getJsonWithVars(I.value_variable);let W=!1;U||(W=!0,B.logError(K(new Error('Missing "value_variable" in "select"')))),S=a(U&&B.getVariable(U,"string")||rr("temp","string",""),(t=>D=t));let L="";const H=I.options,q=Array.isArray(H)&&H.filter((t=>"string"==typeof t.value))||[];Array.isArray(q)&&q.length||B.logError(K(new Error('Empty selection "items" in "select"')));let G="",Z=null,Y="";A=a(B.getDerivedFromVars(I.hint_text),(t=>F=t)),C=a(B.getDerivedFromVars(I.hint_color),(t=>E=t));let Q="rgba(0,0,0,.45)";k=a(B.getDerivedFromVars(I.font_size),(t=>$=t));let tt,it,nt=12;x=a(B.getDerivedFromVars(I.font_weight),(t=>w=t)),_=a(B.getDerivedFromVars(I.line_height),(t=>b=t)),y=a(B.getDerivedFromVars(I.letter_spacing),(t=>m=t));let at="";f=a(B.getDerivedFromVars(I.text_color),(t=>h=t));let st="#000",lt="";void 0===e.json&&i.json&&void 0!==I&&i.json(I),void 0===e.templateContext&&i.templateContext&&void 0!==O&&i.templateContext(O),void 0===e.origJson&&i.origJson&&void 0!==N&&i.origJson(N),void 0===e.layoutParams&&i.layoutParams&&void 0!==R&&i.layoutParams(R),L=D;{const t=q.find((t=>t.value===D));t?G="string"==typeof t.text?t.text:t.value:(G="",D&&B.logError(K(new Error('Value from the variable was not found in the selection items for "select"'))))}o=B.getDerivedFromVars(I.paddings),T(),T=a(o,(t=>V=t)),nt=Ut($,nt),Z=Dt(V||void 0,Z),Y=Z?bt({top:(Number(Z.top)||0)/nt*10,right:(Number(Z.right)||0)/nt*10,bottom:(Number(Z.bottom)||0)/nt*10,left:(Number(Z.left)||0)/nt*10}):"",s=F,Q=ot(E,1,Q),tt=Lt(w,tt);{const t=b;zt(t)&&(it=t/nt)}return _t(m)&&(at=rt(m/nt*10)),st=ot(h,1,st),l=B.getDerivedFromVars(I.accessibility),P(),P=a(l,(t=>p=t)),(null==p?void 0:p.description)?lt=p.description:B.logError(K(new Error('Missing accessibility "description" for select'),{level:"warn"})),u={hint:!G},c={"--divkit-input-hint-color":Q,"font-weight":tt,color:st},d={padding:Y,"font-size":rt(nt),"line-height":it,"letter-spacing":at},v={"font-size":rt(nt),"line-height":it,"letter-spacing":at},P(),f(),y(),_(),x(),k(),C(),A(),T(),S(),W?"":`${z(Rt,"Outer").$$render(t,{cls:mt("select",hr,u),style:c,customDescription:!0,customActions:"select",customPaddings:!0,json:I,origJson:N,templateContext:O,layoutParams:R},{},{default:()=>`<span${J("class",hr["select__select-text"],0)}${J("style",et(d),0)} aria-hidden="true">\n ${j(G||s||"")}</span>\n\n <select${J("class",hr.select__select,0)}${J("aria-label",lt,0)}${J("style",et(v),0)}>${M(q,(t=>`<option${J("class",hr.select__option,0)}${J("value",t.value,0)}>${j(t.text||t.value)}</option>`))}</select>`})}`})),mr={video__video:"divkit-c11f9"},yr=N(((t,e,r,i)=>{let n,o,s,l,u,c,d,v,p,h,{json:f={}}=e,{templateContext:m}=e,{origJson:y}=e,{layoutParams:b}=e;const _=g(X);let w=!1,x=!1;h=a(_.getDerivedFromVars(f.video_sources),(t=>p=t));let $=[];v=a(_.getDerivedFromVars(f.repeatable),(t=>d=t));let k=!1;c=a(_.getDerivedFromVars(f.autostart),(t=>u=t));let E=!1;l=a(_.getDerivedFromVars(f.muted),(t=>s=t));let C,F=!1;o=a(_.getDerivedFromVars(f.preview),(t=>n=t));const A=_.getJsonWithVars(f.elapsed_time_variable);var V,D;return(A&&_.getVariable(A,"integer")||rr("temp","integer",0)).subscribe((t=>{x&&(x=!1)})),f.id&&!w&&_.registerInstance(f.id,{pause(){},start(){}}),void 0===e.json&&r.json&&void 0!==f&&r.json(f),void 0===e.templateContext&&r.templateContext&&void 0!==m&&r.templateContext(m),void 0===e.origJson&&r.origJson&&void 0!==y&&r.origJson(y),void 0===e.layoutParams&&r.layoutParams&&void 0!==b&&r.layoutParams(b),V=p,D=$,$=Array.isArray(V)&&V.length?V.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):D,$.length?w=!1:(w=!0,_.logError(K(new Error('Missing "video_sources" in "video"')))),k=Yt(d,k),E=Yt(u,E),F=Yt(s,F),C="string"==typeof n?me(n):C,o(),l(),c(),v(),h(),w?"":`${z(Rt,"Outer").$$render(t,{cls:mr.video,customActions:"video",json:f,origJson:y,templateContext:m,layoutParams:b},{},{default:()=>`\n <video${J("class",mr.video__video,0)} playsinline ${k?"loop":""} ${E?"autoplay":""} ${F?"muted":""}${J("poster",C,0)}${J("this",undefined,0)}>${M($,(t=>`<source${J("src",t.src,0)}${J("type",t.type,0)}>`))}</video>`})}`})),br=yr,_r={};_r.text=Qt,_r.container=ve,_r.separator=he,_r.image=ye,_r.gif=ye,_r.grid=ke,_r.gallery=Ve,_r.tabs=Se,_r.state=ze,_r.pager=Ne,_r.indicator=Be,_r.slider=nr,_r.input=pr,_r.select=fr,_r.video=br;const wr=N(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=g(X);let u,c,d;if(void 0===e.div&&r.div&&void 0!==n&&r.div(n),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),u=n,c=o,d=u&&_r[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&_r[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(K(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||n},{},{})}`:""})),xr=N(((t,e,r,i)=>{let{svgFiltersMap:n}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==n&&r.svgFiltersMap(n),Object.keys(n).length?`<svg${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${M([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",n[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function $r(t,e,r,i){const n=r[t.type];if(!n)return i(K(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const i=Object.keys(r).filter((t=>"__proto__"!==t)),n=i.filter((t=>"$"!==t.charAt(0))),o=i.filter((t=>"$"===t.charAt(0)));return n.forEach((i=>{const n=r[i];"object"==typeof n&&null!==n?(e[i]=Array.isArray(n)?[]:{},t(e[i],n)):e[i]=n})),o.forEach((t=>{const i=r[t],n=a[i];if(void 0!==n){const r=t.substring(1);e[r]=n}})),e}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function kr(){}function Er(t){return{subscribe:e=>(e(t),kr)}}function Cr(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Fr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Ar(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 Vr(t){try{return Ye(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function Dr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function jr(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,jr.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function Sr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function Pr(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Fe,JsonStringContents:function(){var t,e,r;for(t=pe,e=[],r=Ae();r!==i;)e.push(r),r=Ae();return he=t,e=jt(e)}},a=Fe,s="@{",l="}",u="@{}",c="\\",d="?",v=":",g="||",p="&&",h="==",f="!=",m=">=",y=">",b="<=",_="<",w="+",x="-",$="/",k="*",E="%",C="!",F="(",A=")",V=",",D="'",j=".",S="e",P="E",M="true",T="false",z=/^[^}]/,I=/^[^'}]/,O=/^[0-9]/,N=/^[a-zA-Z_0-9.]/,J=/^[a-zA-Z_]/,R=/^[ \t\r\n]/,B=we("@{",!1),U=we("}",!1),W=we("@{}",!1),L=we("\\",!1),H={type:"any"},q=xe(["}"],!0,!1),G=we("?",!1),Z=we(":",!1),Y=we("||",!1),X=we("&&",!1),K=we("==",!1),Q=we("!=",!1),tt=we(">=",!1),et=we(">",!1),rt=we("<=",!1),it=we("<",!1),nt=we("+",!1),ot=we("-",!1),at=we("/",!1),st=we("*",!1),lt=we("%",!1),ut=we("!",!1),ct=we("(",!1),dt=we(")",!1),vt=we(",",!1),gt=$e("string"),pt=we("'",!1),ht=xe(["'","}"],!0,!1),ft=$e("integer"),mt=xe([["0","9"]],!1,!1),yt=$e("number"),bt=we(".",!1),_t=we("e",!1),wt=we("E",!1),xt=$e("boolean"),$t=we("true",!1),kt=we("false",!1),Et=xe([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ct=$e("identifier"),Ft=xe([["a","z"],["A","Z"],"_"],!1,!1),At=$e("whitespace"),Vt=xe([" ","\t","\r","\n"],!1,!1),Dt=function(t){return t},jt=function(t){return Ar(t)},St=function(t){return t},Pt=function(){return""},Mt=function(){return _e()},Tt=function(){throw new Error("Error tokenizing '"+t+"'.")},zt=function(){throw new Error("Error tokenizing '"+t+"'.")},It=function(t){return t},Ot=function(t){return Dr(t)},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},Jt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Rt=function(t,e){return Fr(t,e)},Bt=function(t,e){return Fr(t,e)},Ut=function(t,e){return Cr(t,e)},Wt=function(t,e){return Cr(t,e)},Lt=function(t,e){return Cr(t,e)},Ht=function(t,e){return Cr(t,e)},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t){return{type:"Variable",id:t}},Yt=function(t,e){return[t,...e]},Xt=function(t){return t},Kt=function(t){return t},Qt=function(t){return Ar(t)},te=function(t){return t},ee=function(){return""},re=function(){return _e()},ie=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ae=function(t){return Dr(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:Vr(_e())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},de=function(){return{type:"BooleanLiteral",value:!0}},ve=function(){return{type:"BooleanLiteral",value:!1}},ge=function(){return{type:"Identifier",name:_e()}},pe=0,he=0,fe=[{line:1,column:1}],me=0,ye=[],be=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function _e(){return t.substring(he,pe)}function we(t,e){return{type:"literal",text:t,ignoreCase:e}}function xe(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function $e(t){return{type:"other",description:t}}function ke(e){var r,i=fe[e];if(i)return i;for(r=e-1;!fe[r];)r--;for(i={line:(i=fe[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return fe[e]=i,i}function Ee(t,e,r){var i=ke(t),o=ke(e),a={source:n,start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:o.line,column:o.column}};return r&&n&&"function"==typeof n.offset&&(a.start=n.offset(a.start),a.end=n.offset(a.end)),a}function Ce(t){pe<me||(pe>me&&(me=pe,ye=[]),ye.push(t))}function Fe(){var t,e;return t=pe,Re(),(e=Ve())!==i?(Re(),he=t,t=Dt(e)):(pe=t,t=i),t}function Ae(){var e,r,n,o,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(pe)?(a=l,pe++):(a=i,0===be&&Ce(U)),a!==i?(he=e,e=St(o)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,t.substr(pe,3)===u?(r=u,pe+=3):(r=i,0===be&&Ce(W)),r!==i&&(he=e,r=Pt()),(e=r)===i&&(e=pe,r=pe,be++,92===t.charCodeAt(pe)?(n=c,pe++):(n=i,0===be&&Ce(L)),n===i&&(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B))),be--,n===i?r=void 0:(pe=r,r=i),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(he=e,e=Mt()):(pe=e,e=i)):(pe=e,e=i),e===i))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(q)),o!==i)for(;o!==i;)n.push(o),z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(q));else n=i;n!==i?(125===t.charCodeAt(pe)?(o=l,pe++):(o=i,0===be&&Ce(U)),o!==i?(he=e,e=Tt()):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;e===i&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i&&(he=e,r=zt()),(e=r)===i&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B)),n!==i?(he=e,e=It(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(he=e,e=Ot(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=i,0===be&&Ce(L)),r!==i&&(he=e,r=Nt()),e=r))))}return e}function Ve(){var e,r,n,o,a,s;return e=pe,(r=De())!==i?(Re(),63===t.charCodeAt(pe)?(n=d,pe++):(n=i,0===be&&Ce(G)),n!==i?(Re(),(o=Ve())!==i?(Re(),58===t.charCodeAt(pe)?(a=v,pe++):(a=i,0===be&&Ce(Z)),a!==i?(Re(),(s=Ve())!==i?(he=e,e=Jt(r,o,s)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=De()),e}function De(){var e,r,n,o,a,s,l,u;if(e=pe,(r=je())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===g?(s=g,pe+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(u=je())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===g?(s=g,pe+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(u=je())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);he=e,e=Rt(r,n)}else pe=e,e=i;return e}function je(){var e,r,n,o,a,s,l,u;if(e=pe,(r=Se())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===p?(s=p,pe+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(u=Se())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===p?(s=p,pe+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(u=Se())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);he=e,e=Bt(r,n)}else pe=e,e=i;return e}function Se(){var e,r,n,o,a,s,l,u;if(e=pe,(r=Pe())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===h?(s=h,pe+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(pe,2)===f?(s=f,pe+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(u=Pe())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===h?(s=h,pe+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(pe,2)===f?(s=f,pe+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(u=Pe())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);he=e,e=Ut(r,n)}else pe=e,e=i;return e}function Pe(){var e,r,n,o,a,s,l,u;if(e=pe,(r=Me())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===m?(s=m,pe+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(pe)?(s=y,pe++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(pe,2)===b?(s=b,pe+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(pe)?(s=_,pe++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(u=Me())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===m?(s=m,pe+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(pe)?(s=y,pe++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(pe,2)===b?(s=b,pe+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(pe)?(s=_,pe++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(u=Me())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);he=e,e=Wt(r,n)}else pe=e,e=i;return e}function Me(){var e,r,n,o,a,s,l,u;if(e=pe,(r=Te())!==i){for(n=[],o=pe,a=Re(),43===t.charCodeAt(pe)?(s=w,pe++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(u=Te())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),43===t.charCodeAt(pe)?(s=w,pe++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(u=Te())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);he=e,e=Lt(r,n)}else pe=e,e=i;return e}function Te(){var e,r,n,o,a,s,l,u;if(e=pe,(r=ze())!==i){for(n=[],o=pe,a=Re(),47===t.charCodeAt(pe)?(s=$,pe++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(pe)?(s=k,pe++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(pe)?(s=E,pe++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(u=ze())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),47===t.charCodeAt(pe)?(s=$,pe++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(pe)?(s=k,pe++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(pe)?(s=E,pe++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(u=ze())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);he=e,e=Ht(r,n)}else pe=e,e=i;return e}function ze(){var e,r,n;return(e=Ne())===i&&(e=Oe())===i&&(e=pe,33===t.charCodeAt(pe)?(r=C,pe++):(r=i,0===be&&Ce(ut)),r===i&&(43===t.charCodeAt(pe)?(r=w,pe++):(r=i,0===be&&Ce(nt)),r===i&&(45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)))),r!==i?(Re(),(n=ze())!==i?(he=e,e=qt(r,n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=pe,(r=Je())!==i?(Re(),40===t.charCodeAt(pe)?(n=F,pe++):(n=i,0===be&&Ce(ct)),n!==i?(Re(),o=function(){var e,r,n,o,a,s;if(e=pe,(r=Ve())!==i){for(n=[],o=pe,Re(),44===t.charCodeAt(pe)?(a=V,pe++):(a=i,0===be&&Ce(vt)),a!==i?(Re(),(s=Ve())!==i?o=s:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,Re(),44===t.charCodeAt(pe)?(a=V,pe++):(a=i,0===be&&Ce(vt)),a!==i?(Re(),(s=Ve())!==i?o=s:(pe=o,o=i)):(pe=o,o=i);he=e,e=Yt(r,n)}else pe=e,e=i;return e===i&&(e=Re()),e}(),o!==i?(Re(),41===t.charCodeAt(pe)?(a=A,pe++):(a=i,0===be&&Ce(dt)),a!==i?(he=e,e=Gt(r,o)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=Je())!==i&&(he=e,r=Zt(r)),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return be++,e=pe,39===t.charCodeAt(pe)?(r=D,pe++):(r=i,0===be&&Ce(pt)),r!==i?(n=function(){var t,e,r;for(t=pe,e=[],r=Ie();r!==i;)e.push(r),r=Ie();return he=t,t=e=Qt(e)}(),39===t.charCodeAt(pe)?(o=D,pe++):(o=i,0===be&&Ce(pt)),o!==i?(he=e,e=Kt(n)):(pe=e,e=i)):(pe=e,e=i),be--,e===i&&(r=i,0===be&&Ce(gt)),e}(),e===i&&(e=Ne())===i&&(e=Oe())===i&&(e=function(){var e,r;return be++,e=pe,t.substr(pe,4)===M?(r=M,pe+=4):(r=i,0===be&&Ce($t)),r!==i&&(he=e,r=de()),(e=r)===i&&(e=pe,t.substr(pe,5)===T?(r=T,pe+=5):(r=i,0===be&&Ce(kt)),r!==i&&(he=e,r=ve()),e=r),be--,e===i&&(r=i,0===be&&Ce(xt)),e}(),e===i&&(e=pe,40===t.charCodeAt(pe)?(r=F,pe++):(r=i,0===be&&Ce(ct)),r!==i&&(n=Ve())!==i?(41===t.charCodeAt(pe)?(o=A,pe++):(o=i,0===be&&Ce(dt)),o!==i?(he=e,e=Xt(n)):(pe=e,e=i)):(pe=e,e=i))),e}())),e}())),e}function Ie(){var e,r,n,o,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(pe)?(a=l,pe++):(a=i,0===be&&Ce(U)),a!==i?(he=e,e=te(o)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,t.substr(pe,3)===u?(r=u,pe+=3):(r=i,0===be&&Ce(W)),r!==i&&(he=e,r=ee()),(e=r)===i&&(e=pe,r=pe,be++,92===t.charCodeAt(pe)?(n=c,pe++):(n=i,0===be&&Ce(L)),n===i&&(39===t.charCodeAt(pe)?(n=D,pe++):(n=i,0===be&&Ce(pt)),n===i&&(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B)))),be--,n===i?r=void 0:(pe=r,r=i),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(he=e,e=re()):(pe=e,e=i)):(pe=e,e=i),e===i))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],I.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(ht)),o!==i)for(;o!==i;)n.push(o),I.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(ht));else n=i;n!==i?(125===t.charCodeAt(pe)?(o=l,pe++):(o=i,0===be&&Ce(U)),o!==i?(he=e,e=ie()):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;e===i&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i&&(he=e,r=ne()),(e=r)===i&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B)),n!==i?(he=e,e=oe(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(he=e,e=ae(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=c,pe++):(r=i,0===be&&Ce(L)),r!==i&&(he=e,r=se()),e=r))))}return e}function Oe(){var e,r,n,o;if(be++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));else n=i;return n!==i?(he=e,e=le()):(pe=e,e=i),be--,e===i&&(r=i,0===be&&Ce(ft)),e}function Ne(){var e,r,n,o,a,s,l,u,c,d;for(be++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));o!==i;)n.push(o),O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));if(46===t.charCodeAt(pe)?(o=j,pe++):(o=i,0===be&&Ce(bt)),o!==i){if(a=[],O.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,0===be&&Ce(mt)),s!==i)for(;s!==i;)a.push(s),O.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,0===be&&Ce(mt));else a=i;if(a!==i){if(s=pe,101===t.charCodeAt(pe)?(l=S,pe++):(l=i,0===be&&Ce(_t)),l===i&&(69===t.charCodeAt(pe)?(l=P,pe++):(l=i,0===be&&Ce(wt))),l!==i){if(43===t.charCodeAt(pe)?(u=w,pe++):(u=i,0===be&&Ce(nt)),u===i&&(45===t.charCodeAt(pe)?(u=x,pe++):(u=i,0===be&&Ce(ot))),u===i&&(u=null),c=[],O.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=i,0===be&&Ce(mt)),d!==i)for(;d!==i;)c.push(d),O.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=i,0===be&&Ce(mt));else c=i;c!==i?s=l=[l,u,c]:(pe=s,s=i)}else pe=s,s=i;s===i&&(s=null),he=e,e=ue()}else pe=e,e=i}else pe=e,e=i;if(e===i){if(e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),O.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));else n=i;if(n!==i)if(101===t.charCodeAt(pe)?(o=S,pe++):(o=i,0===be&&Ce(_t)),o===i&&(69===t.charCodeAt(pe)?(o=P,pe++):(o=i,0===be&&Ce(wt))),o!==i){if(43===t.charCodeAt(pe)?(a=w,pe++):(a=i,0===be&&Ce(nt)),a===i&&(45===t.charCodeAt(pe)?(a=x,pe++):(a=i,0===be&&Ce(ot))),a===i&&(a=null),s=[],O.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=i,0===be&&Ce(mt)),l!==i)for(;l!==i;)s.push(l),O.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=i,0===be&&Ce(mt));else s=i;s!==i?(he=e,e=ce()):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i}return be--,e===i&&(r=i,0===be&&Ce(yt)),e}function Je(){var e,r,n,o,a;if(be++,e=pe,r=pe,be++,n=function(){var e,r,n,o;return e=pe,t.substr(pe,4)===M?(r=M,pe+=4):(r=i,0===be&&Ce($t)),r===i&&(t.substr(pe,5)===T?(r=T,pe+=5):(r=i,0===be&&Ce(kt))),r!==i?(n=pe,be++,N.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(Et)),be--,o===i?n=void 0:(pe=n,n=i),n!==i?e=r=[r,n]:(pe=e,e=i)):(pe=e,e=i),e}(),be--,n===i?r=void 0:(pe=r,r=i),r!==i)if(J.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(Ft)),n!==i){for(o=[],N.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=i,0===be&&Ce(Et));a!==i;)o.push(a),N.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=i,0===be&&Ce(Et));he=e,e=ge()}else pe=e,e=i;else pe=e,e=i;return be--,e===i&&(r=i,0===be&&Ce(Ct)),e}function Re(){var e,r;for(be++,e=[],R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,0===be&&Ce(Vt));r!==i;)e.push(r),R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,0===be&&Ce(Vt));return be--,r=i,0===be&&Ce(At),e}if((r=a())!==i&&pe===t.length)return r;throw r!==i&&pe<t.length&&Ce({type:"end"}),function(t,e,r){return new jr(jr.buildMessage(t,e),t,e,r)}(ye,me<t.length?t.charAt(me):null,me<t.length?Ee(me,me+1):Ee(me,me))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(jr,Error),jr.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(i){var s=this.location.end,l=Sr("",o.line.toString().length," "),u=i[n.line-1],c=(n.line===s.line?s.column:u.length+1)-n.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+u+"\n"+l+" | "+Sr("",n.column-1," ")+Sr("",c,"^")}else e+="\n at "+a}return e},jr.buildMessage=function(t,e){var r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,i=t.map(a);if(i.sort(),i.length>0){for(e=1,r=1;e<i.length;e++)i[e-1]!==i[e]&&(i[r]=i[e],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."};const Mr=new Map,Tr=new Map;function zr(t,e,r){const i={args:e,cb:r},n=Mr.get(t)||[];Mr.has(t)||Mr.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Tr.set(o,i)}function Ir(t,e){let r=t.args.length,i=t.args.length;const n=t.args[t.args.length-1];if("object"==typeof n&&n.isVararg&&(--r,i=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>i)return{type:"many",expected:i,found:e.length};for(let r=0;r<e.length;++r){let i=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof i&&(i={type:i}),i.type!==e[r].type)return{type:"mismatch",expected:i.type,found:e[r].type}}return{type:"match"}}function Or(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=>{Or(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Or(t.left,e),Or(t.right,e);break;case"UnaryExpression":Or(t.argument,e);break;case"ConditionalExpression":Or(t.test,e),Or(t.consequent,e),Or(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Or(t,e)}))}}function Nr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Jr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Rr(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 Jr(t.value);if("color"===t.type)return Zr(Gr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function Br(t){let e=Rr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function Ur(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Wr(t,e){if(He)return Ye(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Lr(t,e){if(e<Ze||e>Ge)throw new Error("Integer overflow.");!He&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function Hr(t){const e=[];return Or(t,{Variable(t){e.push(t.id.name)}}),e}function qr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function Gr(t){const e=at(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function Zr(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 nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function Yr(t){return Zr(Gr(t))}const Xr=Number.MAX_VALUE,Kr=Number.MIN_VALUE,Qr="string",ti="integer",ei="number",ri="boolean",ii="color",ni="url",oi="datetime";function ai(t,e){return{type:Qr,value:Rr(e)}}function si(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:ei,value:r}}function li(t,e,r,i){const n=t.variables.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=Yr(o)),{type:i,value:o}}function ui(t,e,r){return li(t,e,r,r.type)}function ci(t,e,r){return li(t,e,r,"color")}function di(t,e,r){return li(t,e,r,"url")}const vi=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:ti,value:i}},gi=vi("getUTCFullYear"),pi=vi("getUTCMonth"),hi=vi("getUTCDate"),fi=vi("getUTCDay"),mi=vi("getUTCHours"),yi=vi("getUTCMinutes"),bi=vi("getUTCSeconds"),_i=vi("getUTCMilliseconds");function wi(t,e,r,i){if(!i.value.length)return t.warnings.push(K(new Error("String for padding is empty."),{level:"warn"})),"";let n="";const o=e.type===Qr?e.value:Rr(e);for(;n.length+o.length<r.value;)n+=i.value;return n.length>0&&n.length+o.length>r.value&&(n=n.substring(0,Number(r.value)-Number(o.length))),n}function xi(t,e,r,i){const n=wi(t,e,r,i);return{type:Qr,value:n+Rr(e)}}function $i(t,e,r,i){const n=wi(t,e,r,i);return{type:Qr,value:Rr(e)+n}}function ki(t){return(e,r)=>{const i=Gr(r.value);return{type:ei,value:i[t]/255}}}function Ei(t){return(e,r,i)=>{const n=Gr(r.value);return n[t]=255*i.value,{type:ii,value:Zr(n)}}}const Ci=ki("a"),Fi=ki("r"),Ai=ki("g"),Vi=ki("b"),Di=Ei("a"),ji=Ei("r"),Si=Ei("g"),Pi=Ei("b");function Mi(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=Ye(e.value)/Ye(r);return Lr(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=Ye(n)%Ye(i)),{type:ti,value:n}}const Ti=36e5;function zi(t){return t.map(Br).join(", ")}zr("toString",[ti],ai),zr("toString",[ei],ai),zr("toString",[ri],ai),zr("toString",[ii],ai),zr("toString",[ni],ai),zr("toNumber",[ti],si),zr("toNumber",[Qr],si),zr("toInteger",[ei],(function(t,e){if(e.value>Ge||e.value<Ze)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:ti,value:Ye(r)}})),zr("toInteger",[Qr],(function(t,e){let r;try{r=Ye(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>Ge||r<Ze)throw new Error("Unable to convert value to Integer.");return{type:ti,value:r}})),zr("toInteger",[ri],(function(t,e){return{type:ti,value:Ye(e.value?1:0)}})),zr("toBoolean",[ti],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:ri,value:r}})),zr("toBoolean",[Qr],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:ri,value:"true"===e.value?1:0}})),zr("toColor",[Qr],(function(t,e){return{type:ii,value:Yr(e.value)}})),zr("toUrl",[Qr],(function(t,e){return{type:ni,value:e.value}})),zr("encodeUri",[Qr],(function(t,e){try{return{type:Qr,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),zr("decodeUri",[Qr],(function(t,e){try{return{type:Qr,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),zr("getIntegerValue",[Qr,ti],ui),zr("getNumberValue",[Qr,ei],ui),zr("getBooleanValue",[Qr,ri],ui),zr("getStringValue",[Qr,Qr],ui),zr("getColorValue",[Qr,ii],ci),zr("getColorValue",[Qr,Qr],ci),zr("getUrlValue",[Qr,ni],di),zr("getUrlValue",[Qr,Qr],di),zr("parseUnixTime",[ti],(function(t,e){return{type:oi,value:new Date(1e3*Number(e.value))}})),zr("nowLocal",[],(function(){return{type:oi,value:new Date}})),zr("addMillis",[oi,ti],(function(t,e,r){return{type:oi,value:new Date(e.value.getTime()+Number(r.value))}})),zr("setYear",[oi,ti],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:oi,value:i}})),zr("setMonth",[oi,ti],(function(t,e,r){const i=Number(r.value);if(i<1||i>12)throw new Error(`Expecting month in [1..12], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMonth(i-1),{type:oi,value:n}})),zr("setDay",[oi,ti],(function(t,e,r){const i=new Date(e.value),n=Number(r.value);if(n<=0&&-1!==n||n>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(i))throw new Error(`Unable to set day ${n} for date ${Rr(e)}.`);return i.setUTCDate(-1===n?0:n),{type:oi,value:i}})),zr("setHours",[oi,ti],(function(t,e,r){const i=Number(r.value);if(i<0||i>23)throw new Error(`Expecting hours in [0..23], instead got ${i}.`);const n=new Date(e.value);return n.setUTCHours(i),{type:oi,value:n}})),zr("setMinutes",[oi,ti],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting minutes in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMinutes(i),{type:oi,value:n}})),zr("setSeconds",[oi,ti],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting seconds in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCSeconds(i),{type:oi,value:n}})),zr("setMillis",[oi,ti],(function(t,e,r){const i=Number(r.value);if(i<0||i>999)throw new Error(`Expecting millis in [0..999], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMilliseconds(i),{type:oi,value:n}})),zr("getYear",[oi],gi),zr("getMonth",[oi],pi),zr("getDay",[oi],hi),zr("getDayOfWeek",[oi],fi),zr("getHours",[oi],mi),zr("getMinutes",[oi],yi),zr("getSeconds",[oi],bi),zr("getMillis",[oi],_i),zr("getIntervalSeconds",[ti],(function(t,e){return Mi(t,e,1e3,60)})),zr("getIntervalTotalSeconds",[ti],(function(t,e){return Mi(t,e,1e3)})),zr("getIntervalMinutes",[ti],(function(t,e){return Mi(t,e,6e4,60)})),zr("getIntervalTotalMinutes",[ti],(function(t,e){return Mi(t,e,6e4)})),zr("getIntervalHours",[ti],(function(t,e){return Mi(t,e,Ti,24)})),zr("getIntervalTotalHours",[ti],(function(t,e){return Mi(t,e,Ti)})),zr("getIntervalTotalDays",[ti],(function(t,e){return Mi(t,e,864e5)})),zr("getIntervalTotalWeeks",[ti],(function(t,e){return Mi(t,e,6048e5)})),zr("len",[Qr],(function(t,e){return{type:ti,value:e.value.length}})),zr("contains",[Qr,Qr],(function(t,e,r){return{type:ri,value:e.value.includes(r.value)?1:0}})),zr("substring",[Qr,ti,ti],(function(t,e,r,i){if(i.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||i.value<0||i.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:Qr,value:e.value.substring(Number(r.value),Number(i.value))}})),zr("replaceAll",[Qr,Qr,Qr],(function(t,e,r,i){let n;return n=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),i.value):e.value,{type:Qr,value:n}})),zr("index",[Qr,Qr],(function(t,e,r){return{type:ti,value:e.value.indexOf(r.value)}})),zr("lastIndex",[Qr,Qr],(function(t,e,r){return{type:ti,value:e.value.lastIndexOf(r.value)}})),zr("trim",[Qr],(function(t,e){return{type:Qr,value:e.value.trim()}})),zr("trimLeft",[Qr],(function(t,e){return{type:Qr,value:e.value.replace(/^\s+/,"")}})),zr("trimRight",[Qr],(function(t,e){return{type:Qr,value:e.value.replace(/\s+$/,"")}})),zr("toUpperCase",[Qr],(function(t,e){return{type:Qr,value:e.value.toUpperCase()}})),zr("toLowerCase",[Qr],(function(t,e){return{type:Qr,value:e.value.toLowerCase()}})),zr("padStart",[Qr,ti,Qr],xi),zr("padStart",[ti,ti,Qr],xi),zr("padEnd",[Qr,ti,Qr],$i),zr("padEnd",[ti,ti,Qr],$i),zr("div",[ti,ti],(function(t,e,r){if(r.value===Xe)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return i=Wr(0,i),Lr(t,i),{type:ti,value:i}})),zr("div",[ei,ei],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value/r.value;return{type:ei,value:i}})),zr("mod",[ti,ti],(function(t,e,r){if(r.value===Xe)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return i=Wr(0,i),Lr(t,i),{type:ti,value:i}})),zr("mod",[ei,ei],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value%r.value;return{type:ei,value:i}})),zr("mul",[{type:ti,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Xe;for(let i=1;i<e.length;++i)r*=e[i].value,r=Wr(0,r),Lr(t,r);return{type:ti,value:r}})),zr("mul",[{type:ei,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:ei,value:r}})),zr("sub",[{type:ti,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:Xe;for(let i=1;i<e.length;++i)r-=e[i].value,r=Wr(0,r),Lr(t,r);return{type:ti,value:r}})),zr("sub",[{type:ei,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:ei,value:r}})),zr("sum",[{type:ti,isVararg:!0}],(function(t,...e){let r=Xe;for(let i=0;i<e.length;++i)r+=e[i].value,r=Wr(0,r),Lr(t,r);return{type:ti,value:r}})),zr("sum",[{type:ei,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:ei,value:r}})),zr("abs",[ti],(function(t,e){const r=Ke(e.value);return Lr(t,r),{type:e.type,value:r}})),zr("abs",[ei],(function(t,e){const r=Math.abs(e.value);return{type:ei,value:r}})),zr("max",[{type:ti,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:ti,value:r}})),zr("max",[{type:ei,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:ei,value:Math.max(...e.map((t=>t.value)))}})),zr("min",[{type:ti,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:ti,value:r}})),zr("min",[{type:ei,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:ei,value:Math.min(...e.map((t=>t.value)))}})),zr("maxNumber",[],(function(){return{type:ei,value:Xr}})),zr("minNumber",[],(function(){return{type:ei,value:Kr}})),zr("maxInteger",[],(function(t){return Lr(t,Ge),{type:ti,value:Ge}})),zr("minInteger",[],(function(t){return Lr(t,Ze),{type:ti,value:Ze}})),zr("round",[ei],(function(t,e){const r=Math.sign(e.value);return{type:ei,value:r*Math.round(Math.abs(e.value))}})),zr("floor",[ei],(function(t,e){return{type:ei,value:Math.floor(e.value)}})),zr("ceil",[ei],(function(t,e){return{type:ei,value:Math.ceil(e.value)}})),zr("signum",[ti],(function(t,e){return{type:ti,value:Qe(e.value)}})),zr("signum",[ei],(function(t,e){return{type:ei,value:Math.sign(e.value)}})),zr("copySign",[ti,ti],(function(t,e,r){let i;if(r.value===Xe)i=e.value;else if(e.value===Xe)i=0;else{const t=Qe(r.value);i=Ke(e.value)*t}return Lr(t,i),{type:ti,value:i}})),zr("copySign",[ei,ei],(function(t,e,r){let i=Math.sign(r.value);0===i&&(i=Object.is(i,0)?1:-1);const n=Math.abs(e.value)*i;return{type:ei,value:n}})),zr("getColorAlpha",[Qr],Ci),zr("getColorAlpha",[ii],Ci),zr("getColorRed",[Qr],Fi),zr("getColorRed",[ii],Fi),zr("getColorGreen",[Qr],Ai),zr("getColorGreen",[ii],Ai),zr("getColorBlue",[Qr],Vi),zr("getColorBlue",[ii],Vi),zr("setColorAlpha",[Qr,ei],Di),zr("setColorAlpha",[ii,ei],Di),zr("setColorRed",[Qr,ei],ji),zr("setColorRed",[ii,ei],ji),zr("setColorGreen",[Qr,ei],Si),zr("setColorGreen",[ii,ei],Si),zr("setColorBlue",[Qr,ei],Pi),zr("setColorBlue",[ii,ei],Pi),zr("rgb",[ei,ei,ei],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:ii,value:Zr(n)}})),zr("argb",[ei,ei,ei,ei],(function(t,e,r,i,n){const o={a:255*e.value,r:255*r.value,g:255*i.value,b:255*n.value};return{type:ii,value:Zr(o)}}));const Ii={StringLiteral:function(t,e){return{type:Qr,value:e.value}},NumberLiteral:function(t,e){return{type:ei,value:e.value}},IntegerLiteral:function(t,e){return Lr(t,e.value),{type:ti,value:e.value}},BooleanLiteral:function(t,e){return{type:ri,value:e.value?1:0}},UnaryExpression:function(t,e){const r=Nr(Oi(t,e.argument));switch(e.operator){case"!":if(r.type===ri)return{type:ri,value:r.value?0:1};qr(`${e.operator}${Br(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===ti){const e=r.value*Ye(i);return Lr(t,e),{type:ti,value:e}}if(r.type===ei)return{type:ei,value:r.value*i};qr(`${e.operator}${Br(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=Nr(Oi(t,e.test));if(r.type===ri)return r.value?Oi(t,e.consequent):Oi(t,e.alternate);qr(`${Br(r)} ? ${Br(Oi(t,e.consequent))} : ${Br(Oi(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 Oi(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=Rr(Oi(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:Qr,value:r}},LogicalExpression:function(t,e){const r=Nr(Oi(t,e.left));if(r.type!==ri&&qr(`${Br(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:ri,value:0};const i=Nr(Oi(t,e.right));return i.type!==ri&&qr(`${Br(r)} ${e.operator} ${Br(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Ur(i.type)}.`),{type:ri,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=Oi(t,e.left),n=Oi(t,e.right);if(i.type!==n.type&&qr(`${Br(i)} ${e.operator} ${Br(n)}`,`Operator '${r}' cannot be applied to different types: ${Ur(i.type)} and ${Ur(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===oi&&r.type===oi?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:ri,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==ei&&e.type!==ti&&e.type!==oi&&qr(`${Br(e)} ${t} ${Br(r)}`,`Operator '${t}' cannot be applied to ${Ur(e.type)} type.`);const n=e.type===oi?e.value.getTime():e.value,o=r.type===oi?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:ri,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==Qr&&r.type!==ei&&r.type!==ti&&qr(`${Br(r)} ${e} ${Br(i)}`,`Operator '${e}' cannot be applied to ${Ur(r.type)} type.`),r.type===Qr)return"-"===e&&qr(`${Br(r)} - ${Br(i)}`,`Operator '${e}' cannot be applied to ${Ur(r.type)} type.`),{type:Qr,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===ti)try{n=Wr(0,n),Lr(t,n)}catch(t){qr(`${Br(r)} ${e} ${Br(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r,i){let n;if(r.type!==ti&&r.type!==ei&&qr(`${Br(r)} ${e} ${Br(i)}`,`Operator '${e}' cannot be applied to ${Ur(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&qr(`${Br(r)} ${e} ${Br(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===ti)try{n=Wr(0,n),Lr(t,n)}catch(t){qr(`${Br(r)} ${e} ${Br(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let i;const n=e.arguments.map((e=>Oi(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(Tr.has(o))i=Tr.get(o);else{const t=function(t,e){const r=Mr.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=Ir(r[t],e);if("match"===n.type)return r[t];i||(i=n)}if(!i)throw new Error("Missing function");return i}(r,n);if("expected"in t||"type"in t&&"missing"===t.type){const e=n.map((t=>Ur(t.type))).join(", "),i=`${r}(${zi(n)})`;"few"===t.type&&0===n.length?qr(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?qr(i,`Function '${r}' has no matching override for given argument types: ${e}.`):qr(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){qr(`${r}(${zi(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.variables.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function Oi(t,e){if(e.type in Ii)return Ii[e.type](t,e);throw new Error("Unsupported expression")}function Ni(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(Or(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const i=Oi(r,e);return r.safeIntegerOverflow&&r.warnings.push(K(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:i,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class Ji{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Or(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Ni(t,this.ast);r.warnings.forEach(e);const i=r.result;if("error"===i.type)return void e(K(new Error("Expression execution error"),{additional:{message:i.value}}));const n=i.value;if(n instanceof Date)return Jr(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=at(String(n));if(t)return Zr(t);e(K(new Error("Expression execution error")))}return"integer"===i.type?n>2147483647||n<-2147483648?void e(K(new Error("Expression result is out of 32-bit int range"))):Number(n):n}catch(t){return void e(K(new Error("Expression execution error")))}}}function Ri(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=Pr(t,{startRule:"JsonStringContents"}),i=Hr(r);return e.vars.push(...i),new Ji(r)}catch(e){return void r(K(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Ri(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Ri(t[n],e,r);return i}}var i;return t}function Bi(t,e,r){if(t){if(t instanceof Ji)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Bi(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=Bi(t[n],e,r);return i}}return t}function Ui(t,e){const r={vars:[],hasExpression:!1},i=Ri(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Bi(i,t,e)}}const Wi={pagers:function(){return W(new Map)}},Li=new Map,Hi=new Map;function qi(t){const e=Li.get(t)||W("");return Li.has(t)||Li.set(t,e),e}function Gi(t){const e=Hi.get(t)||new Map;return Hi.has(t)||Hi.set(t,e),e}class Zi{setVariable(t){const e=t.getName(),r=Gi(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),qi(this).set(e)}getVariable(t){return Gi(this).get(t)}}function Yi(){return new Zi}function Xi(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Ki=new Set(["start","stop","pause","resume","cancel","reset"]);class Qi{constructor(t){Xi(this,"timers",new Map),Xi(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(K(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(K(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&Ki.has(e)))return void this.logError(K(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const i=this.timers.get(t);this[r](i)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const i=t.tickStarted=performance.now(),n=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-i-n)%r,e()}),n)};e()}}start(t){if("running"===t.state)return void this.logError(K(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(K(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(K(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(K(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(K(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(K(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(K(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(K(new Error("The timer is already running"))):this.logError(K(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 tn=N(((t,e,r,i)=>{let n,o;var s,l,u,c;let{id:g}=e,{json:p={}}=e,{platform:h="auto"}=e,{theme:f="system"}=e,{globalVariablesController:m=new Zi}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{extensions:x=new Map}=e,{onError:$}=e,{onStat:k}=e,{onCustomAction:E}=e,{onComponent:C}=e,F=W("desktop"===h);if(o=a(F,(t=>n=t)),"auto"===h&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");F.set(!t.matches),t.addListener((()=>{F.set(!t.matches)}))}let A="light",V=null;function D(t){f=t}function S(){}const P=new Set(w);let M=!1;p||(M=!0,G(K(new Error('"json" prop is required')))),g||(M=!0,G(K(new Error('"id" prop is required'))));let T=function(t){if(!t)return K(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return K(new Error("Missing card"));if(!e.states||!e.states.length)return K(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in _r)return K(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return K(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return K(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const I=p.templates||{};T&&(M=!0,G(T));const O={stateChange:!1},N=qi(m),J=Gi(m),R=new Map,B=new Map,U=new Map;let H=null;function q(t){const e=Ui(t,G);return e.vars.length?e.applyVars(B):t}function G(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 Y=0;function Q(t){return`${g}-${Y++}`}let tt={},et={};function rt(t){const e=t.url?String(t.url):"";if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const i=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=ct,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const i=r[t],n=r[t+1];let o=e.getChild(i);if(!o)return;o.setState(n),e=o}}(i.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=at(t);r&&r.setCurrentItem(Number(e))}(i.get("id"),i.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=at(t);r&&r.setPreviousItem(e)}(i.get("id"),i.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=at(t);r&&r.setNextItem(e)}(i.get("id"),i.get("overflow"));break;case"set_variable":const r=i.get("name"),n=i.get("value");if(r&&null!==n){const t=B.get(r);t?t.set(n):G(K(new Error("Cannot find variable"),{additional:{name:r}}))}else G(K(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;case"timer":const o=i.get("action"),a=i.get("id");H?H.execTimerAction(a,o):G(K(new Error("Incorrect timer action"),{additional:{id:a,action:o}}));break;case"video":!function(t,e){if(t){const r=at(t);r?"start"===e?r.start():"pause"===e?r.pause():G(K(new Error("Unknown video action"),{additional:{id:t,action:e}})):G(K(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else G(K(new Error("Missing id in video action"),{additional:{action:e}}))}(i.get("id"),i.get("action"));break;default:G(K(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){G(K(t,{additional:{url:e}}))}}async function it(t,e){if(t&&Array.isArray(t)){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url;if(n){const t=pt(n);if(t)if(ht(t,P)){if(e)if("_blank"===i.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=n)}else location.href=n}else"div-action"===t?(rt(i),await _()):i.log_id&&(nt(i),await _())}}t.forEach((t=>{t.log_id&&Z("click",t)}))}}function nt(t){null==E||E(t)}const ot=new Map;function at(t){if(ot.has(t))return ot.get(t);G(K(new Error("Missing instance with id"),{additional:{id:t}}))}const st=new Map;function ut(t){for(const e of t)B.has(e)&&t.delete(e);return t}v(X,{logError:G,logStat:Z,hasTemplate:function(t){return t in I},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in I;){if(({json:t,templateContext:e}=$r(t,e,I,G)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:Q,genClass:function(t){return`divkit-${Q()}`},execAction:rt,execAnyActions:it,execCustomAction:nt,isRunning:function(t){return O[t]},setRunning:function(t,e){O[t]=e},registerInstance:function(t,e){ot.has(t)?G(K(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(et[r]=et[r]||0,++et[r],tt[r])return tt[r];const i=`${Q()}-svg-filter`;return tt=Object.assign(Object.assign({},tt),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;et[r]&&0==--et[r]&&(tt=Object.keys(tt).reduce(((t,e)=>(et[e]&&(t[e]=tt[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Er(t);const e=Ui(t,G);return e.vars.length?L(e.vars.map((t=>B.get(t)||function(t){const e=U.get(t)||W(void 0);return U.has(t)||U.set(t,e),e}(t))).filter(lt),(()=>e.applyVars(B))):e.hasExpression?Er(e.applyVars(B)):Er(t)},getJsonWithVars:q,getStore:function(t){return st.has(t)||function(t){st.has(t)||st.set(t,Wi[t]())}(t),st.get(t)},getVariable:function(t,e){const r=B.get(t);if(r){const i=r.getType();if(i!==e)return void G(K(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return P},getExtension:function(t,e){const r=x.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:B,logError:G}},isDesktop:F,registerComponent:void 0,unregisterComponent:void 0}),v(Pt,{hasAction:()=>!1});const ct={setState(t){throw new Error("Not implemented")},getChild(t){if(dt&&dt.has(t))return dt.get(t);G(K(new Error("Missing state block with id"),{additional:{id:t}}))}};let dt=null;v(yt,{registerInstance(t,e){dt||(dt=new Map),dt.has(t)?G(K(new Error("Duplicate state with id"),{additional:{id:t}})):dt.set(t,e)},unregisterInstance(t){null==dt||dt.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,i)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const vt=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variables;Array.isArray(vt)&&vt.forEach((t=>{if(t&&t.type in er&&t.name){if(R.has(t.name))return void G(K(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)&&G(K(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=rr(t.name,t.type,t.value);R.set(t.name,e),B.set(t.name,e)}catch(e){G(K(e,{additional:{name:t.name}}))}}}));const gt=p.palette;gt&>[A].forEach((t=>{if(R.has(t.name))G(K(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=rr(t.name,"color",t.color);R.set(t.name,e),B.set(t.name,e)}catch(e){G(K(e,{additional:{name:t.name}}))}}));for(const[t,e]of J)B.has(t)||B.set(t,e);N.subscribe((t=>{if(t&&!B.has(t)){const e=J.get(t);B.set(t,e);const r=U.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 G(K(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const i=Pr(t.condition,{startRule:"JsonStringContents"}),n=Hr(i);if(!n.length)return void G(K(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return ut(e),e.size?new Promise((t=>{const r=N.subscribe((()=>{ut(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{L(n.map((t=>B.get(t))).filter(lt),(()=>{const t=Ni(B,i);return t.warnings.forEach(G),t.result})).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=q(t);e.log_id&&rt(e)})),e=Boolean(i.value)):G(K(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){G(K(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else G(K(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 Qi({logError:G,applyVars:q,hasVariableWithType:function(t,e){const r=B.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=B.get(t);r?r.setValue(e):G(K(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:it});mt.forEach((e=>t.createTimer(e)))}const bt=null===(c=null==p?void 0:p.card)||void 0===c?void 0:c.states;let _t;return bt&&!M&&(_t={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})))}),d((()=>{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!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.extensions&&r.extensions&&void 0!==x&&r.extensions(x),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!==E&&r.onCustomAction(E),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.setTheme&&r.setTheme&&void 0!==D&&r.setTheme(D),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==S&&r.getDebugVariables(S),void 0===e.execAction&&r.execAction&&void 0!==rt&&r.execAction(rt),"light"===f||"dark"===f?A=f:"system"===f?"undefined"!=typeof matchMedia?(V||(V=matchMedia("(prefers-color-scheme: dark)"),V.addListener((function(){"system"===f&&V&&(A=V.matches?"dark":"light")}))),A=V.matches?"dark":"light"):A="light":G(K(new Error("Unsupported theme"))),A&&(gt&>[A].forEach((t=>{const e=B.get(t.name);e&&e.setValue(t.color)}))),o(),!M&&_t?`<div class="${j("divkit-b023c",!0)+j(n?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${z(xr,"RootSvgFilters").$$render(t,{svgFiltersMap:tt},{},{})}\n ${z(wr,"Unknown").$$render(t,{div:_t,templateContext:{}},{},{})}</div>`:""})),en=tn;function rn(t){return en.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 nn=e.M,on=e.Os,an=e.sY;export{nn as createGlobalVariablesController,on as createVariable,an as render};
|
|
2
2
|
//# sourceMappingURL=server.mjs.map
|