From 913809b18e377c93152bf2578ed369bb5d097a35 Mon Sep 17 00:00:00 2001 From: michielvandergeest Date: Fri, 22 Mar 2024 16:18:56 +0000 Subject: [PATCH] deploy: 8b64bc589f579a129b5eee9a589498020d177e70 --- ...oading-5324ffc8.js => Loading-58c51fa7.js} | 2 +- assets/index-0870f274.js | 757 ++++++++++++++++++ assets/index-d17a140b.js | 704 ---------------- assets/player/pause.png | Bin 0 -> 679 bytes assets/player/play.png | Bin 0 -> 1000 bytes index.html | 2 +- 6 files changed, 759 insertions(+), 706 deletions(-) rename assets/{Loading-5324ffc8.js => Loading-58c51fa7.js} (97%) create mode 100644 assets/index-0870f274.js delete mode 100644 assets/index-d17a140b.js create mode 100644 assets/player/pause.png create mode 100644 assets/player/play.png diff --git a/assets/Loading-5324ffc8.js b/assets/Loading-58c51fa7.js similarity index 97% rename from assets/Loading-5324ffc8.js rename to assets/Loading-58c51fa7.js index d9d45a6..0d5fce1 100644 --- a/assets/Loading-5324ffc8.js +++ b/assets/Loading-58c51fa7.js @@ -1 +1 @@ -import{B as b,S}from"./index-d17a140b.js";const g=b.Component("Loading",{components:{Square:S},code:{render:function(l,e,n){const o=[];o[0]||(o[0]=this.element({parent:l||"root"},e));const h={};o[0].nodeId||o[0].populate(h),l=o[0],o[1]||(o[1]=this.element({parent:l||"root"},e));const m={};m.x=880,m.y=500,o[1].nodeId||o[1].populate(m);const y=n.components&&n.components.Circle||e[Symbol.for("components")].Circle;l=o[1],o[2]||(o[2]=this.element({parent:l||"root"},e));const c={};if(c.size=40,c.color="0x94a3b8ff",typeof y<"u")for(let s in y.config.props)delete c[y.config.props[s]];o[2].nodeId||o[2].populate(c),l=o[2];const f={};if(f.size=40,f.color="0x94a3b8ff",f.alpha={transition:{value:e.alpha,delay:200}},!o[3]){const s=f.is||"Circle";o[3]=(n.components&&n.components[s]||e[Symbol.for("components")][s]||(()=>{console.error("component Circle not found")})).call(null,{props:f},o[2],e),o[3][Symbol.for("slots")][0]?(l=o[3][Symbol.for("slots")][0],e=o[3]):l=o[3][Symbol.for("children")][0]}const u=n.components&&n.components.Circle||e[Symbol.for("components")].Circle;l=o[1],o[4]||(o[4]=this.element({parent:l||"root"},e));const r={};if(r.size=40,r.color="0x94a3b8ff",r.x=60,typeof u<"u")for(let s in u.config.props)delete r[u.config.props[s]];o[4].nodeId||o[4].populate(r),l=o[4];const t={};if(t.size=40,t.color="0x94a3b8ff",t.x=60,t.alpha={transition:{value:e.alpha,delay:300}},!o[5]){const s=t.is||"Circle";o[5]=(n.components&&n.components[s]||e[Symbol.for("components")][s]||(()=>{console.error("component Circle not found")})).call(null,{props:t},o[4],e),o[5][Symbol.for("slots")][0]?(l=o[5][Symbol.for("slots")][0],e=o[5]):l=o[5][Symbol.for("children")][0]}const d=n.components&&n.components.Circle||e[Symbol.for("components")].Circle;l=o[1],o[6]||(o[6]=this.element({parent:l||"root"},e));const p={};if(p.size=40,p.color="0x94a3b8ff",p.x=120,typeof d<"u")for(let s in d.config.props)delete p[d.config.props[s]];o[6].nodeId||o[6].populate(p),l=o[6];const a={};if(a.size=40,a.color="0x94a3b8ff",a.x=120,a.alpha={transition:{value:e.alpha,delay:400}},!o[7]){const s=a.is||"Circle";o[7]=(n.components&&n.components[s]||e[Symbol.for("components")][s]||(()=>{console.error("component Circle not found")})).call(null,{props:a},o[6],e),o[7][Symbol.for("slots")][0]?(l=o[7][Symbol.for("slots")][0],e=o[7]):l=o[7][Symbol.for("children")][0]}return o},effects:[function(l,e,n){e[2].set("alpha",{transition:{value:l.alpha,delay:200}})},function(l,e,n){e[3][Symbol.for("props")].alpha={transition:{value:l.alpha,delay:200}}},function(l,e,n){e[4].set("alpha",{transition:{value:l.alpha,delay:300}})},function(l,e,n){e[5][Symbol.for("props")].alpha={transition:{value:l.alpha,delay:300}}},function(l,e,n){e[6].set("alpha",{transition:{value:l.alpha,delay:400}})},function(l,e,n){e[7][Symbol.for("props")].alpha={transition:{value:l.alpha,delay:400}}}],context:{}},state(){return{alpha:0}},hooks:{ready(){let i=0;this.$setInterval(()=>{this.alpha=i%2?0:1,i++,this.alpha===0&&i>2&&console.log("backstopjs:ready")},800)}}});export{g as default}; +import{B as b,S}from"./index-0870f274.js";const g=b.Component("Loading",{components:{Square:S},code:{render:function(l,e,n){const o=[];o[0]||(o[0]=this.element({parent:l||"root"},e));const h={};o[0].nodeId||o[0].populate(h),l=o[0],o[1]||(o[1]=this.element({parent:l||"root"},e));const m={};m.x=880,m.y=500,o[1].nodeId||o[1].populate(m);const y=n.components&&n.components.Circle||e[Symbol.for("components")].Circle;l=o[1],o[2]||(o[2]=this.element({parent:l||"root"},e));const c={};if(c.size=40,c.color="0x94a3b8ff",typeof y<"u")for(let s in y.config.props)delete c[y.config.props[s]];o[2].nodeId||o[2].populate(c),l=o[2];const f={};if(f.size=40,f.color="0x94a3b8ff",f.alpha={transition:{value:e.alpha,delay:200}},!o[3]){const s=f.is||"Circle";o[3]=(n.components&&n.components[s]||e[Symbol.for("components")][s]||(()=>{console.error("component Circle not found")})).call(null,{props:f},o[2],e),o[3][Symbol.for("slots")][0]?(l=o[3][Symbol.for("slots")][0],e=o[3]):l=o[3][Symbol.for("children")][0]}const u=n.components&&n.components.Circle||e[Symbol.for("components")].Circle;l=o[1],o[4]||(o[4]=this.element({parent:l||"root"},e));const r={};if(r.size=40,r.color="0x94a3b8ff",r.x=60,typeof u<"u")for(let s in u.config.props)delete r[u.config.props[s]];o[4].nodeId||o[4].populate(r),l=o[4];const t={};if(t.size=40,t.color="0x94a3b8ff",t.x=60,t.alpha={transition:{value:e.alpha,delay:300}},!o[5]){const s=t.is||"Circle";o[5]=(n.components&&n.components[s]||e[Symbol.for("components")][s]||(()=>{console.error("component Circle not found")})).call(null,{props:t},o[4],e),o[5][Symbol.for("slots")][0]?(l=o[5][Symbol.for("slots")][0],e=o[5]):l=o[5][Symbol.for("children")][0]}const d=n.components&&n.components.Circle||e[Symbol.for("components")].Circle;l=o[1],o[6]||(o[6]=this.element({parent:l||"root"},e));const p={};if(p.size=40,p.color="0x94a3b8ff",p.x=120,typeof d<"u")for(let s in d.config.props)delete p[d.config.props[s]];o[6].nodeId||o[6].populate(p),l=o[6];const a={};if(a.size=40,a.color="0x94a3b8ff",a.x=120,a.alpha={transition:{value:e.alpha,delay:400}},!o[7]){const s=a.is||"Circle";o[7]=(n.components&&n.components[s]||e[Symbol.for("components")][s]||(()=>{console.error("component Circle not found")})).call(null,{props:a},o[6],e),o[7][Symbol.for("slots")][0]?(l=o[7][Symbol.for("slots")][0],e=o[7]):l=o[7][Symbol.for("children")][0]}return o},effects:[function(l,e,n){e[2].set("alpha",{transition:{value:l.alpha,delay:200}})},function(l,e,n){e[3][Symbol.for("props")].alpha={transition:{value:l.alpha,delay:200}}},function(l,e,n){e[4].set("alpha",{transition:{value:l.alpha,delay:300}})},function(l,e,n){e[5][Symbol.for("props")].alpha={transition:{value:l.alpha,delay:300}}},function(l,e,n){e[6].set("alpha",{transition:{value:l.alpha,delay:400}})},function(l,e,n){e[7][Symbol.for("props")].alpha={transition:{value:l.alpha,delay:400}}}],context:{}},state(){return{alpha:0}},hooks:{ready(){let i=0;this.$setInterval(()=>{this.alpha=i%2?0:1,i++,this.alpha===0&&i>2&&console.log("backstopjs:ready")},800)}}});export{g as default}; diff --git a/assets/index-0870f274.js b/assets/index-0870f274.js new file mode 100644 index 0000000..ef30228 --- /dev/null +++ b/assets/index-0870f274.js @@ -0,0 +1,757 @@ +var fA=Object.defineProperty;var cA=(h,s,i)=>s in h?fA(h,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):h[s]=i;var L=(h,s,i)=>(cA(h,typeof s!="symbol"?s+"":s,i),i);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))u(o);new MutationObserver(o=>{for(const x of o)if(x.type==="childList")for(const y of x.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&u(y)}).observe(document,{childList:!0,subtree:!0});function i(o){const x={};return o.integrity&&(x.integrity=o.integrity),o.referrerPolicy&&(x.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?x.credentials="include":o.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function u(o){if(o.ep)return;o.ep=!0;const x=i(o);fetch(o.href,x)}})();const te={currentView:Symbol("currentView"),cursorTagStart:Symbol("cursorTagStart"),computedKeys:Symbol("computedKeys"),destroy:Symbol("destroy"),id:Symbol("id"),identifier:Symbol("identifier"),index:Symbol("index"),init:Symbol("init"),inputEvents:Symbol("inputEvents"),intervals:Symbol("intervals"),level:Symbol("level"),methodKeys:Symbol("methodKeys"),originalState:Symbol("originalState"),propKeys:Symbol("propKeys"),raw:Symbol("raw"),ready:Symbol("ready"),renderer:Symbol("renderer"),routes:Symbol("routes"),settings:Symbol("settings"),state:Symbol("state"),stateKeys:Symbol("stateKeys"),textnode:Symbol("textnode"),timeouts:Symbol("timeouts"),type:Symbol("type"),watchers:Symbol("watchers"),watchKeys:Symbol("watchKeys"),wrapper:Symbol("wrapper"),children:Symbol.for("children"),components:Symbol.for("components"),isSlot:Symbol.for("isSlot"),props:Symbol.for("props"),slots:Symbol.for("slots"),componentType:Symbol.for("componentType")},tx={aliceblue:"0xf0f8ffff",antiquewhite:"0xfaebd7ff",aqua:"0xffffff00",aquamarine:"0x7fffd4ff",azure:"0xf0ffffff",beige:"0xf5f5dcff",bisque:"0xffe4c4ff",black:"0x000000ff",blanchedalmond:"0xffebcdff",blue:"0x0000ffff",blueviolet:"0x8a2be2ff",brown:"0xa52a2aff",burlywood:"0xdeb887ff",cadetblue:"0x5f9ea0ff",chartreuse:"0x7fff00ff",chocolate:"0xd2691eff",coral:"0xff7f50ff",cornflowerblue:"0x6495edff",cornsilk:"0xfff8dcff",crimson:"0xdc143cff",cyan:"0x00ffffff",darkblue:"0x00008bff",darkcyan:"0x008b8bff",darkgoldenrod:"0xb8860bff",darkgray:"0xa9a9a9ff",darkgreen:"0x006400ff",darkgrey:"0xa9a9a9ff",darkkhaki:"0xbdb76bff",darkmagenta:"0x8b008bff",darkolivegreen:"0x556b2fff",darkorange:"0xff8c00ff",darkorchid:"0x9932ccff",darkred:"0x8b0000ff",darksalmon:"0xe9967aff",darkseagreen:"0x8fbc8fff",darkslateblue:"0x483d8bff",darkslategray:"0x2f4f4fff",darkslategrey:"0x2f4f4fff",darkturquoise:"0x00ced1ff",darkviolet:"0x9400d3ff",deeppink:"0xff1493ff",deepskyblue:"0x00bfffff",dimgray:"0x696969ff",dimgrey:"0x696969ff",dodgerblue:"0x1e90ffff",firebrick:"0xb22222ff",floralwhite:"0xfffaf0ff",forestgreen:"0x228b22ff",fuchsia:"0xff00ffff",gainsboro:"0xdcdcdcff",ghostwhite:"0xf8f8ffff",gold:"0xffd700ff",goldenrod:"0xdaa520ff",gray:"0x808080ff",green:"0x008000ff",greenyellow:"0xadff2fff",grey:"0x808080ff",honeydew:"0xf0fff0ff",hotpink:"0xff69b4ff",indianred:"0xcd5c5cff",indigo:"0x4b0082ff",ivory:"0xfffff0ff",khaki:"0xf0e68cff",lavender:"0xe6e6faff",lavenderblush:"0xfff0f5ff",lawngreen:"0x7cfc00ff",lemonchiffon:"0xfffacdff",lightblue:"0xadd8e6ff",lightcoral:"0xf08080ff",lightcyan:"0xe0ffffff",lightgoldenrodyellow:"0xfafad2ff",lightgray:"0xd3d3d3ff",lightgreen:"0x90ee90ff",lightgrey:"0xd3d3d3ff",lightpink:"0xffb6c1ff",lightsalmon:"0xffa07aff",lightseagreen:"0x20b2aaff",lightskyblue:"0x87cefaff",lightslategray:"0x778899ff",lightslategrey:"0x778899ff",lightsteelblue:"0xb0c4deff",lightyellow:"0xffffe0ff",lime:"0x00ff00ff",limegreen:"0x32cd32ff",linen:"0xfaf0e6ff",magenta:"0xff00ffff",maroon:"0x800000ff",mediumaquamarine:"0x66cdaaff",mediumblue:"0x0000cdff",mediumorchid:"0xba55d3ff",mediumpurple:"0x9370dbff",mediumseagreen:"0x3cb371ff",mediumslateblue:"0x7b68eeff",mediumspringgreen:"0x00fa9aff",mediumturquoise:"0x48d1ccff",mediumvioletred:"0xc71585ff",midnightblue:"0x191970ff",mintcream:"0xf5fffaff",mistyrose:"0xffe4e1ff",moccasin:"0xffe4b5ff",navajowhite:"0xffdeadff",navy:"0x000080ff",oldlace:"0xfdf5e6ff",olive:"0x808000ff",olivedrab:"0x6b8e23ff",orange:"0xffa500ff",orangered:"0xff4500ff",orchid:"0xda70d6ff",palegoldenrod:"0xeee8aaff",palegreen:"0x98fb98ff",paleturquoise:"0xafeeeeff",palevioletred:"0xdb7093ff",papayawhip:"0xffefd5ff",peachpuff:"0xffdab9ff",peru:"0xcd853fff",pink:"0xffc0cbff",plum:"0xdda0ddff",powderblue:"0xb0e0e6ff",purple:"0x800080ff",rebeccapurple:"0x663399ff",red:"0xff0000ff",rosybrown:"0xbc8f8fff",royalblue:"0x4169e1ff",saddlebrown:"0x8b4513ff",salmon:"0xfa8072ff",sandybrown:"0xf4a460ff",seagreen:"0x2e8b57ff",seashell:"0xfff5eeff",sienna:"0xa0522dff",silver:"0xc0c0c0ff",skyblue:"0x87ceebff",slateblue:"0x6a5acdff",slategray:"0x708090ff",slategrey:"0x708090ff",snow:"0xfffafaff",springgreen:"0x00ff7fff",steelblue:"0x4682b4ff",tan:"0xd2b48cff",teal:"0x008080ff",thistle:"0xd8bfd8ff",tomato:"0xff6347ff",transparent:"0x00000000",turquoise:"0x40e0d0ff",violet:"0xee82eeff",wheat:"0xf5deb3ff",white:"0xffffffff",whitesmoke:"0xf5f5f5ff",yellow:"0xffff00ff",yellowgreen:"0x9acd32ff"},Ko={[te.settings]:{},get(h,s=null){return h in this[te.settings]?this[te.settings][h]:s},set(h,s){typeof h=="object"?Object.keys(h).forEach(i=>{this.set(i,h[i])}):this[te.settings][h]=s}},Vu=()=>{},xh=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),_x=h=>{const s=Ko.get("debugLevel"),i={};return Object.defineProperty(i,"info",{get(){return(s>=1||Array.isArray(s)&&s.indexOf("info")>-1)&&console.info.bind(window.console,`%c ⚡️ ${h} %c ${xh()}`,"background-color: #0284c7; color: white; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||Vu}}),Object.defineProperty(i,"warn",{get(){return(s>=1||Array.isArray(s)&&s.indexOf("warn")>-1)&&console.warn.bind(window.console,`%c ⚡️ ${h} %c ${xh()}`,"background-color: #fbbf24; color: white; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||Vu}}),Object.defineProperty(i,"error",{get(){return(s>=1||Array.isArray(s)&&s.indexOf("error")>-1)&&console.error.bind(window.console,`%c ⚡️ ${h} %c ${xh()}`,"background-color: #dc2626; color: white; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||Vu}}),Object.defineProperty(i,"debug",{get(){return(s>=2||Array.isArray(s)&&s.indexOf("debug")>-1)&&console.debug.bind(window.console,`%c ⚡️ ${h} %c (${new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})`,"background-color: #e2e8f0; color: #334155; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||Vu}}),i};let At;const dA=()=>{At=_x("Blits")},ls={normalize(h="",s="0xffffffff"){if(h=h.toString(),h.length>0){const i=/^0x[0-9a-f]{8}$/,u=/^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i,o=/^(rgba?)\((\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\s*),(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\s*),(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\s*)(,(\s*(-?\d+(?:\.\d+)?)\s*))?\)$/,x=/^(hsla?)\((\s*(360|3[0-5][0-9]|[12]?[0-9]{1,2})\s*),(\s*(100|[1-9]?[0-9])\s*)%,(\s*(100|[1-9]?[0-9])\s*)%(,(\s*(1|0(?:\.\d+)?)\s*))?\)$/;if(i.test(h))return h;if(u.test(h))return h=h.replace("#","").toLowerCase(),h.length===3&&(h=h.split("").map(d=>d+d).join("")),"0x"+h.padEnd(8,"f");const y=o.exec(h);if(y)return"0x"+parseInt(y[3]).toString(16).padStart(2,"0")+parseInt(y[5]).toString(16).padStart(2,"0")+parseInt(y[7]).toString(16).padStart(2,"0")+(y[10]&&y[1]==="rgba"?Math.min(Math.max(Math.round(parseFloat(y[10])*255),0),255).toString(16).padStart(2,"0"):"ff");if(x.test(h))return At.warn("HSL(A) color format is not supported yet"),"0xffffffff";if(h in tx)return tx[h]}return s}},hA=(h="",s,i,u=null)=>{let o=0,x=0,y=[],d=null,C=0;const b=/^<\/?([a-zA-Z0-9_\-.]+)\s*/,I=/^\s*(\/?>)\s*/,k=/^([A-Za-z0-9:.\-_@]+)=\s*(["'])/,P=/^<>\s*/,O=/^\s*(<\/>)\s*/,v=()=>{h=V(h);try{return N(ie),re(y)}catch(Y){throw(Y.name=="TemplateParseError"||Y.name=="TemplateStructureError")&&(Y.message=`${Y.message} +${Y.context}`),Y}},N=Y=>{o>=h.length||Y()},V=Y=>Y.replace(//gms,"").replace(/\r?\n\s*\r\n/gm," ").replace(/\r?\n\s*(\S)/gm," $1").replace(/\r?\n/g,"").trim(),G=Y=>{const K=h.slice(o).match(Y);return K&&(x=o,o+=K[0].length),K},ie=()=>{G(P)?(y.push({[Symbol.for("componentType")]:null,[te.type]:"opening",[te.level]:C,[te.cursorTagStart]:x}),C++,N(ie)):N($)},$=()=>{G(O)?(C--,y.push({[Symbol.for("componentType")]:null,[te.type]:"closing",[te.level]:C}),N(ie)):N(ne)},ne=()=>{const Y=G(b);if(Y)d={[Symbol.for("componentType")]:Y[1],[te.level]:C,[te.cursorTagStart]:x},Y[0].startsWith("{const Y=G(I);if(Y){if(Y[1]==="/>"){if(d[te.type]==="closing")throw Q("InvalidClosingTag");d[te.type]="self-closing",C--}if(d[te.type]==="opening"){const K=h.slice(o,h.indexOf("<",o));K&&(d.content=K,o+=K.length)}y.push(d),N(ie)}else N(le)},le=()=>{const Y=G(k);if(Y){if(d[te.type]==="closing")throw Q("AttributesInClosingTag");const K=Y[2],de=new RegExp(`^(.*?)${K}\\s*`),ve=G(de);if(ve){const pe=X(Y[1],ve[1]);d[pe.name]=pe.value,N(ee)}else throw Q("MissingOrInvalidAttributeValue")}else throw Q("InvalidAttribute")},X=(Y,K)=>{if(Y.includes(".")){const[de,ve]=Y.split(".");return{name:de,value:`{${ve}: ${K}}`}}return["color",":color",":effects","effects"].includes(Y)?oe(Y,K):{name:Y,value:K}},oe=(Y,K)=>{let de=K,ve=ls.normalize(de,null);if(ve===null){const pe=/'([^']+)'/g;let fe,ke=0,we="";for(;(fe=pe.exec(K))!==null;){const j=fe[1],ye=fe.index,ze=fe[0].length;we+=K.slice(ke,ye),ve=ls.normalize(j,null),ve===null?we+=K.slice(ye,ye+ze):we+=`'${ve}'`,ke=ye+ze}we+=K.slice(ke),de=we}else de=ve;return{name:Y,value:de}},re=Y=>{let K=[],de=!1,ve={children:[]},pe=ve;for(let fe=0;fe0)throw ge("UnclosedTags",K);return ve},E=10,H=50,Q=Y=>{const K=q();Y=`${Y} in ${K}`;const de=new Error(Y);de.name="TemplateParseError";const ve=Math.max(0,x-E),pe=Math.min(h.length,o+H),fe=h.slice(ve,pe),ke=o-ve;return de.context=ae(ke,fe),de},ge=(Y,K)=>{const de=q();Y=`${Y} in ${de}`;const ve=new Error(Y);ve.name="TemplateStructureError",Array.isArray(K)?ve.context=K.map(fe=>pe(fe)).join(` +`):ve.context=pe(K);function pe(fe){const ke=Math.max(0,fe[te.cursorTagStart]-E),we=h.slice(ke,ke+H);return ae(E,we)}return ve},ae=(Y,K)=>{const de=" ".repeat(Y)+"^";return` +${K} +${de} +`},q=()=>{if(i){let Y=s||"",K=i;for(;K;)Y=`${K[Symbol.for("componentType")]}/${Y}`,K=K.parent;return Y}return u||"Blits.Application"};return v()};let St;function pA(h={children:[]}){const s={renderCode:["const elms = []"],effectsCode:[],context:{props:[],components:this.components}};return St=-1,Nx.call(s,h),s.renderCode.push("return elms"),{render:new Function("parent","component","context",s.renderCode.join(` +`)),effects:s.effectsCode.map(i=>new Function("component","elms","context",i)),context:s.context}}const uf=function(h,s=!1,i={key:!1,component:"component.",forceEffect:!1}){const u=i.forceEffect?this.effectsCode:this.renderCode;s&&u.push(`parent = ${s}`),"key"in h&&(i.key=us(h.key,i.component));const o=i.key?`elms[${St}][${i.key}]`:`elms[${St}]`;i.key&&u.push(` + elms[${St}] = elms[${St}] || {} + `),u.push(` + if(!${o}) { + ${o} = this.element({parent: parent || 'root'}, component) + } + const elementConfig${St} = {} + `);const x=h.children;delete h.children,h[Symbol.for("componentType")]==="Slot"&&u.push(`elementConfig${St}[Symbol.for('isSlot')] = true`),Object.keys(h).forEach(y=>{y==="slot"&&u.push(` + elementConfig${St}['parent'] = component[Symbol.for('slots')].filter(slot => slot.ref === '${h.slot}').shift() || component[Symbol.for('slots')][0] || parent + `),Px(y)?this.effectsCode.push(`${o}.set('${y.substring(1)}', ${us(h[y],i.component)})`):u.push(`elementConfig${St}['${y}'] = ${Vh(h[y],y,i.component)}`)}),i.holder===!0&&u.push(` + if(typeof cmp${St} !== 'undefined') { + for(let key in cmp${St}.config.props) { + delete elementConfig${St}[cmp${St}.config.props[key]] + } + } + `),u.push(` + if(!${o}.nodeId) { + ${o}.populate(elementConfig${St}) + } + `),x&&Nx.call(this,{children:x},`${o}`,i)},Lx=function(h,s=!1,i={key:!1,component:"component.",forceEffect:!1,holder:!1}){const u=i.forceEffect?this.effectsCode:this.renderCode;u.push(` + const cmp${St} = + (context.components && context.components['${h[Symbol.for("componentType")]}']) || + component[Symbol.for('components')]['${h[Symbol.for("componentType")]}'] + `),"key"in h&&(i.key=us(h.key,i.component));const o=h.children;delete h.children,uf.call(this,h,s,{...i,holder:!0}),s=i.key?`elms[${St}][${i.key}]`:`elms[${St}]`,St++;const x=i.key?`elms[${St}][${i.key}]`:`elms[${St}]`;i.key&&u.push(` + elms[${St}] = elms[${St}] || {} + `),s&&u.push(`parent = ${s}`),u.push(`const props${St} = {}`),Object.keys(h).forEach(y=>{Px(y)?(this.effectsCode.push(` + ${x}[Symbol.for('props')]['${y.substring(1)}'] = ${us(h[y],i.component)}`),u.push(`props${St}['${y.substring(1)}'] = ${us(h[y],i.component)}`)):u.push(`props${St}['${y}'] = ${Vh(h[y],y,i.component)}`)}),u.push(` + if(!${x}) { + const componentType = props${St}['is'] || '${h[Symbol.for("componentType")]}' + + ${x} = (context.components && context.components[componentType] || component[Symbol.for('components')][componentType] || (() => { console.error('component ${h[Symbol.for("componentType")]} not found')})).call(null, {props: props${St}}, ${s}, component) + if (${x}[Symbol.for('slots')][0]) { + parent = ${x}[Symbol.for('slots')][0] + component = ${x} + } else { + parent = ${x}[Symbol.for('children')][0] + } + } + `),o&&(St++,uf.call(this,{children:o},!1,{...i}))},mA=function(h,s){const i=h[":for"];delete h[":for"];const o=/(.+)\s+in\s+(.+)/gi.exec(i),[x,y="index"]=o[1].replace("(","").replace(")","").split(/\s*,\s*/),d={renderCode:[],effectsCode:[],context:{props:[],components:this.components}};s&&d.renderCode.push(`parent = ${s}`);const C=St;d.renderCode.push(` + const collection = ${Vh(o[2],":for")} || [] + const keys = [] + for(let __index = 0; __index < collection.length; __index++) { + parent = ${s} + if(!component.key) keys.length = 0 + const scope = Object.assign(component, { + key: Math.random().toString(), + ${y}: __index, + ${x}: collection[__index], + `),"ref"in h&&h.ref.indexOf("$")===-1&&(d.renderCode.push(` + __ref: '${h.ref}' + __index + `),h.ref="$__ref"),d.renderCode.push(` + }) + `),"key"in h?d.renderCode.push(` + keys.push(${us(h.key,"scope.")}.toString()) + `):d.renderCode.push(` + keys.push(scope.key.toString()) + `),h[Symbol.for("componentType")]==="Element"||h[Symbol.for("componentType")]==="Slot"?uf.call(d,h,s,{key:"scope.key",component:"scope.",forceEffect:!1}):Lx.call(d,h,!1,{key:"scope.key",component:"scope.",forceEffect:!1}),d.renderCode=d.renderCode.concat(d.effectsCode),d.renderCode.push("}"),d.renderCode.push(` + if(elms[${C}]) { + Object.keys(elms[${C}]).forEach(key => { + if(keys.indexOf(key) === -1) { + elms[${C}][key].destroy && elms[${C}][key].destroy() + delete elms[1][key] + } + }) + } + `),this.effectsCode.push(d.renderCode.join(` +`))},Nx=function(h,s=!1,i={}){h.children&&h.children.forEach(u=>{St++,Object.keys(u).indexOf(":for")>-1?mA.call(this,u,s):u[Symbol.for("componentType")]==="Element"||u[Symbol.for("componentType")]==="Slot"?uf.call(this,u,s,i):Lx.call(this,u,s,i)})},us=(h,s="component.")=>{const i=/('.*?')+/gi,u=/\$/gi,o=h.matchAll(i),x=[];let y=0;for(const d of o)x.push(d[0]),h=h.replace(d[0],`[@@REPLACEMENT${y}@@]`),y++;return h=h.replace(u,s),x.forEach((d,C)=>{h=h.replace(`[@@REPLACEMENT${C}@@]`,d)}),h},Vh=(h="",s=!1,i="component.")=>{let u;if(s==="content")if(h.startsWith("$"))u=`${i}${h.replace("$","")}`;else{const o=h.replace(/\\\\/g,"__DOUBLE_BACKSLASH__").replace(/(^|[^\\])'/g,"$1\\'").replace(/__DOUBLE_BACKSLASH__/g,"\\\\");u=`'${gA(o,i)}'`}else if(s!=="color"&&!isNaN(parseFloat(h))){if(u=parseFloat(h),h.endsWith("%")){const x={w:"width",width:"width",x:"width",h:"height",height:"height",y:"height"}[s];x&&(u=`parent.node.${x} * (${u} / 100)`)}}else if(h.toLowerCase()==="true")u=!0;else if(h.toLowerCase()==="false")u=!1;else if(s.startsWith("@")&&h){const o=i.slice(0,-1);u=`${o}['${h.replace("$","")}'] && ${o}['${h.replace("$","")}'].bind(${o})`}else h.startsWith("$")?u=`${i}${h.replace("$","")}`:u=`"${h}"`;return u},Px=h=>h.startsWith(":"),gA=(h,s)=>{const i=/\{\{\s*(\$\S+)\s*\}\}/g,u=[...h.matchAll(i)];if(u.length)for(let[o,x]of u)h=h.replace(o,`${x.replace("$",`'+${s}`)}+'`);return h};function yA(h,s){const i={alpha:!0,antialias:!1,depth:!1,stencil:!0,desynchronized:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:!1},u=h.getContext("webgl",i)||h.getContext("experimental-webgl",i);if(!u)throw new Error("Unable to create WebGL context");return s?new Proxy(u,{get(o,x){const y=o[x];return typeof y=="function"?(s.increment(String(x)),y.bind(o)):y}}):u}function nx(h,s,i){const u=Math.trunc(h>>>24),o=Math.trunc(h>>>16&255),x=Math.trunc(h>>>8&255),y=Math.trunc(h&255),d=Math.trunc(s>>>24),C=Math.trunc(s>>>16&255),b=Math.trunc(s>>>8&255),I=Math.trunc(s&255),k=Math.round(d*i+u*(1-i)),P=Math.round(C*i+o*(1-i)),O=Math.round(b*i+x*(1-i)),v=Math.round(I*i+y*(1-i));return(k<<24|P<<16|O<<8|v)>>>0}function vA(h,s){const i=h>>>24,u=h>>>16&255,o=h>>>8&255,x=Math.trunc((h&255)*s);return(i<<24|u<<16|o<<8|x)>>>0}function Ea(h,s,i=!1){const u=(h&255)/255*s,o=Math.trunc((h>>>24)*u),x=Math.trunc((h>>>16&255)*u),y=Math.trunc((h>>>8&255)*u),d=Math.trunc(u*255);return i?(d<<24|y<<16|x<<8|o)>>>0:(o<<24|x<<16|y<<8|d)>>>0}function Mh(h,s){return Object.prototype.hasOwnProperty.call(h,s)}class Dx{constructor(s){L(this,"releaseCallback");this.releaseCallback=s}}class xA extends Dx{constructor(i,u){super(i);L(this,"textureMap",new Map);L(this,"zeroReferenceTextureSet",new Set);L(this,"options");this.options={textureCleanupIntervalMs:u.textureCleanupIntervalMs??1e4,textureCleanupAgeThreadholdMs:u.textureCleanupAgeThreadholdMs??6e4},setInterval(()=>{const o=Date.now(),x=this.options.textureCleanupAgeThreadholdMs;for(const y of this.zeroReferenceTextureSet)o-y.lastUpdate>x&&(this.releaseCallback(y.id),this.textureMap.delete(y.id),this.zeroReferenceTextureSet.delete(y))},this.options.textureCleanupIntervalMs)}registerTexture(i){var o;const u=(o=i.options)==null?void 0:o.id;if(!this.textureMap.has(u)){const x={id:u,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(u,x),this.zeroReferenceTextureSet.add(x)}}incrementTextureRefCount(i){var x;const u=(x=i.options)==null?void 0:x.id;let o=this.textureMap.get(u);o||(this.registerTexture(i),o=this.textureMap.get(u)),i.txType==="SubTexture"&&this.incrementTextureRefCount(i.props.texture),o.nodeRefCount++,o.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(o)&&this.zeroReferenceTextureSet.delete(o)}decrementTextureRefCount(i){var x;const u=(x=i.options)==null?void 0:x.id,o=this.textureMap.get(u);o.nodeRefCount--,o.lastUpdate=Date.now(),o.nodeRefCount===0&&this.zeroReferenceTextureSet.add(o),i.txType==="SubTexture"&&this.decrementTextureRefCount(i.props.texture)}}class SA extends Dx{constructor(i){super(i);L(this,"registry");this.registry=new FinalizationRegistry(i)}registerTexture(i){var u,o;(u=i.options)==null||u.id,this.registry.register(i,(o=i.options)==null?void 0:o.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}class Qi{constructor(){L(this,"eventListeners",{})}on(s,i){let u=this.eventListeners[s];u||(u=[]),u.push(i),this.eventListeners[s]=u}off(s,i){const u=this.eventListeners[s];if(!u)return;if(!i){delete this.eventListeners[s];return}const o=u.indexOf(i);o>=0&&u.splice(o,1)}once(s,i){const u=(o,x)=>{this.off(s,u),i(o,x)};this.on(s,u)}emit(s,i){const u=this.eventListeners[s];u&&[...u].forEach(o=>{o(this,i)})}removeAllListeners(){this.eventListeners={}}}const wA="modulepreload",TA=function(h){return"/"+h},ix={},Ox=function(s,i,u){if(!i||i.length===0)return s();const o=document.getElementsByTagName("link");return Promise.all(i.map(x=>{if(x=TA(x),x in ix)return;ix[x]=!0;const y=x.endsWith(".css"),d=y?'[rel="stylesheet"]':"";if(!!u)for(let I=o.length-1;I>=0;I--){const k=o[I];if(k.href===x&&(!y||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${d}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":wA,y||(b.as="script",b.crossOrigin=""),b.href=x,document.head.appendChild(b),y)return new Promise((I,k)=>{b.addEventListener("load",I),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${x}`)))})})).then(()=>s()).catch(x=>{const y=new Event("vite:preloadError",{cancelable:!0});if(y.payload=x,window.dispatchEvent(y),!y.defaultPrevented)throw x})};class CA{static makeCacheKey(s){return!1}static resolveDefaults(s){return{}}}function ox(h,s,i){const u=h.createShader(s);if(!u)throw new Error;if(h.shaderSource(u,i),h.compileShader(u),h.getShaderParameter(u,h.COMPILE_STATUS))return u;console.log(h.getShaderInfoLog(u)),h.deleteShader(u)}function IA(h,s,i){const u=h.createProgram();if(!u)throw new Error;if(h.attachShader(u,s),h.attachShader(u,i),h.linkProgram(u),h.getProgramParameter(u,h.LINK_STATUS))return u;console.log(h.getProgramInfoLog(u)),h.deleteProgram(u)}function EA(h){return self.WebGL2RenderingContext&&h instanceof self.WebGL2RenderingContext}class cs extends CA{constructor(i){super();L(this,"boundBufferCollection",null);L(this,"buffersBound",!1);L(this,"program");L(this,"vao");L(this,"renderer");L(this,"glw");L(this,"attributeBuffers");L(this,"attributeLocations");L(this,"attributeNames");L(this,"uniformLocations");L(this,"uniformTypes");L(this,"supportsIndexedTextures");const u=this.renderer=i.renderer,o=this.glw=this.renderer.glw;this.supportsIndexedTextures=i.supportsIndexedTextures||!1;const x=o.isWebGl2(),y=x&&i.webgl2Extensions||!x&&i.webgl1Extensions||[],d=x?"2.0":"1.0";y.forEach(N=>{if(!o.getExtension(N))throw new Error(`Shader "${this.constructor.name}" requires extension "${N}" for WebGL ${d} but wasn't found`)});const C=i.shaderSources||this.constructor.shaderSources;if(C)x&&(C!=null&&C.webGl2)&&(C.fragment=C.webGl2.fragment,C.vertex=C.webGl2.vertex,delete C.webGl2);else throw new Error(`Shader "${this.constructor.name}" is missing shaderSources.`);const b=u.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,I=C.vertex instanceof Function?C.vertex(b):C.vertex,k=C.fragment instanceof Function?C.fragment(b):C.fragment,P=ox(o,o.VERTEX_SHADER,I),O=ox(o,o.FRAGMENT_SHADER,k);if(!P||!O)throw new Error;const v=IA(o,P,O);if(!v)throw new Error;if(this.program=v,x){const N=o.createVertexArray();if(!N)throw new Error;this.vao=N,o.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...i.attributes].forEach(N=>{const V=o.getAttribLocation(this.program,N);if(V<0)throw new Error(`${this.constructor.name}: Vertex shader must have an attribute "${N}"!`);const G=o.createBuffer();if(!G)throw new Error(`${this.constructor.name}: Could not create buffer for attribute "${N}"`);this.attributeLocations[N]=V,this.attributeBuffers[N]=G,this.attributeNames.push(N)}),this.uniformLocations={},this.uniformTypes={},i.uniforms.forEach(N=>{const V=o.getUniformLocation(this.program,N.name);if(this.uniformTypes[N.name]=N.uniform,!V){console.warn(`Shader "${this.constructor.name}" could not get uniform location for "${N.name}"`);return}this.uniformLocations[N.name]=V})}bindBufferAttribute(i,u,o){const{glw:x}=this;x.enableVertexAttribArray(i),x.vertexAttribPointer(u,i,o.size,o.type,o.normalized,o.stride,o.offset)}disableAttribute(i){this.glw.disableVertexAttribArray(i)}disableAttributes(){for(const i in this.attributeLocations)this.disableAttribute(this.attributeLocations[i]);this.boundBufferCollection=null}canBatchShaderProps(i,u){return!1}bindRenderOp(i,u){this.bindBufferCollection(i.buffers),i.textures.length>0&&this.bindTextures(i.textures);const{glw:o}=i;if(this.setUniform("u_resolution",[o.canvas.width,o.canvas.height]),this.setUniform("u_pixelRatio",i.options.pixelRatio),u){if(Mh(u,"$dimensions")){let x=u.$dimensions;x||(x=i.dimensions),this.setUniform("u_dimensions",[x.width,x.height])}if(Mh(u,"$alpha")){let x=u.$alpha;x||(x=i.alpha),this.setUniform("u_alpha",x)}this.bindProps(u)}}setUniform(i,...u){this.glw.setUniform(this.uniformTypes[i],this.uniformLocations[i],...u)}bindBufferCollection(i){if(this.boundBufferCollection!==i){for(const u in this.attributeLocations){const o=i.getBuffer(u),x=i.getAttributeInfo(u);this.bindBufferAttribute(this.attributeLocations[u],o,x)}this.boundBufferCollection=i}}bindProps(i){}bindTextures(i){}attach(){this.glw.useProgram(this.program),this.glw.useProgram(this.program),this.glw.isWebGl2()&&this.vao&&this.glw.bindVertexArray(this.vao)}detach(){this.disableAttributes()}}L(cs,"shaderSources");class an{constructor(s){L(this,"priority",1);L(this,"name","");L(this,"ref");L(this,"target");L(this,"passParameters","");L(this,"declaredUniforms","");L(this,"uniformInfo",{});const{ref:i,target:u,props:o={}}=s;this.ref=i,this.target=u;const x={},y=[];let d="";const C=this.constructor.uniforms||{};for(const b in C){const I=C[b],k=I.type,P=`${i}_${b}`;let O="";I.size&&(O=`[${I.size(o)}]`),y.push(P),d+=`uniform ${k} ${P}${O};`,x[b]={name:P,uniform:C[b].method}}this.passParameters=y.join(","),this.declaredUniforms=d,this.uniformInfo=x}static getEffectKey(s){return""}static getMethodParameters(s,i){const u=[];for(const o in s){const x=s[o];let y="";x.size&&(y=`[${x.size(i)}]`),u.push(`${x.type} ${o}${y}`)}return u.join(",")}static resolveDefaults(s){return{}}static makeEffectKey(s){return!1}}L(an,"uniforms",{}),L(an,"methods"),L(an,"onShaderMask"),L(an,"onColorize"),L(an,"onEffectMask");class yf extends Qi{constructor(i){super();L(this,"txManager");L(this,"dimensions",null);L(this,"error",null);L(this,"state","loading");this.txManager=i}setState(i,...u){if(this.state!==i){if(this.state=i,i==="loaded"){const o=u;this.dimensions=o[0]}else if(i==="failed"){const o=u;this.error=o[0]}this.emit(i,...u)}}static makeCacheKey(i){return!1}static resolveDefaults(i){return{}}}const bA={x:(h,s)=>{h.props.x=s},y:(h,s)=>{h.props.y=s},width:(h,s)=>{h.props.width=s},height:(h,s)=>{h.props.height=s},color:(h,s)=>{h.props.color=s},zIndex:(h,s)=>{h.props.zIndex=s},fontFamily:(h,s)=>{h.props.fontFamily=s},fontWeight:(h,s)=>{h.props.fontWeight=s},fontStyle:(h,s)=>{h.props.fontStyle=s},fontStretch:(h,s)=>{h.props.fontStretch=s},fontSize:(h,s)=>{h.props.fontSize=s},text:(h,s)=>{h.props.text=s},textAlign:(h,s)=>{h.props.textAlign=s},contain:(h,s)=>{h.props.contain=s},offsetY:(h,s)=>{h.props.offsetY=s},scrollable:(h,s)=>{h.props.scrollable=s},scrollY:(h,s)=>{h.props.scrollY=s},letterSpacing:(h,s)=>{h.props.letterSpacing=s},lineHeight:(h,s)=>{h.props.lineHeight=s},maxLines:(h,s)=>{h.props.maxLines=s},textBaseline:(h,s)=>{h.props.textBaseline=s},verticalAlign:(h,s)=>{h.props.verticalAlign=s},overflowSuffix:(h,s)=>{h.props.overflowSuffix=s},debug:(h,s)=>{h.props.debug=s}};class Ux{constructor(s){L(this,"stage");L(this,"set");this.stage=s;const i={...bA,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(i).map(([u,o])=>[u,(x,y)=>{x.props[u]!==y&&(o(x,y),this.stage.requestRender())}])))}setStatus(s,i,u){s.status!==i&&(s.status=i,s.emitter.emit(i,u))}scheduleUpdateState(s){s.updateScheduled||(s.updateScheduled=!0,queueMicrotask(()=>{s.updateScheduled=!1,this.updateState(s)}))}}const Ti=h=>{const s=h>>>24,i=h>>>16&255,u=h>>>8&255,o=h&255;return[s/255,i/255,u/255,o/255]};function AA(h){return(h&255)/255}function Sh(h){const s=Math.floor(h[0]*255),i=Math.floor(h[1]*255),u=Math.floor(h[2]*255),o=Math.floor(h[3]*255);return`rgba(${s},${i},${u},${o.toFixed(4)})`}function go(h,s,i,u,o){return o?(o.x1=h,o.y1=s,o.x2=i,o.y2=u,o):{x1:h,y1:s,x2:i,y2:u}}function kA(h,s,i){const u=go(Math.max(h.x1,s.x1),Math.max(h.y1,s.y1),Math.min(h.x2,s.x2),Math.min(h.y2,s.y2),i);return u.x1s.x1&&h.y1s.y1}function MA(h,s){return s?(s.x=h.x1,s.y=h.y1,s.width=h.x2-h.x1,s.height=h.y2-h.y1,s):{x:h.x1,y:h.y1,width:h.x2-h.x1,height:h.y2-h.y1}}function Hh(h,s,i){const u=Math.max(h.x,s.x),o=Math.max(h.y,s.y),x=Math.min(h.x+h.width,s.x+s.width)-u,y=Math.min(h.y+h.height,s.y+s.height)-o;return x>0&&y>0?i?(i.x=u,i.y=o,i.width=x,i.height=y,i):{x:u,y:o,width:x,height:y}:i?(i.x=0,i.y=0,i.width=0,i.height=0,i):{x:0,y:0,width:0,height:0}}function Bx(h,s){return s?(s.x=h.x,s.y=h.y,s.width=h.width,s.height=h.height,s):{x:h.x,y:h.y,width:h.width,height:h.height}}function RA(h,s){return h===s?!0:h===null||s===null?!1:h.x===s.x&&h.y===s.y&&h.width===s.width&&h.height===s.height}function rx(h,s){return h.x1<=s.x2&&h.y1<=s.y2&&h.x2>=s.x1&&h.y2>=s.y1}function _A(h){return h.x1{this.loaded=!0,this.emit("loaded")}).catch(console.error),this.fontFace=C,this.fontUrl=o}}const sx=2048;function ax(h,s,i,u,o){const x=h!=="bottom"?.5*s:0;return i*(u-1)+x+Math.max(i,s)+(o||0)}class LA{constructor(s,i){L(this,"_canvas");L(this,"_context");L(this,"_settings");L(this,"renderInfo");this._canvas=s,this._context=i,this._settings=this.mergeDefaults({})}set settings(s){this._settings=this.mergeDefaults(s)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const s=[this._settings.fontFace],i=[];for(let u=0,o=s.length;u{console.warn("[Lightning] Font load error",i,s)}).then(()=>{document.fonts.check(s,this._settings.text)||console.warn("[Lightning] Font not found",s)})}catch{console.warn("[Lightning] Can't check font loading for "+s)}}}calculateRenderInfo(){const s={},i=this.getPrecision(),u=this._settings.paddingLeft*i,o=this._settings.paddingRight*i,x=this._settings.fontSize*i;let y=this._settings.offsetY===null?null:this._settings.offsetY*i,d=(this._settings.lineHeight||x)*i;const C=this._settings.w*i,b=this._settings.h*i;let I=this._settings.wordWrapWidth*i;const k=this._settings.cutSx*i,P=this._settings.cutEx*i,O=this._settings.cutSy*i,v=this._settings.cutEy*i,N=(this._settings.letterSpacing||0)*i,V=this._settings.textIndent*i;this.setFontProperties();let G=C||2048/this.getPrecision(),ie=G-u;if(ie<10&&(G+=10-ie,ie=10),I||(I=ie),this._settings.textOverflow&&!this._settings.wordWrap){let oe;switch(this._settings.textOverflow){case"clip":oe="";break;case"ellipsis":oe=this._settings.overflowSuffix;break;default:oe=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,I-V,oe)}let $;if(this._settings.wordWrap)$=this.wrapText(this._settings.text,I,N,V);else{$={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const oe=$.l.length;for(let re=0;rethis._settings.maxLines){const oe=ne.slice(0,this._settings.maxLines);let re=null;if(this._settings.overflowSuffix){const ae=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,q=this.wrapText(oe[oe.length-1],I-ae,N,V);oe[oe.length-1]=`${q.l[0]}${this._settings.overflowSuffix}`,re=[q.l.length>1?q.l[1]:""]}else re=[""];let E;const H=ne.length;let Q=0;const ge=$.n.length;for(E=this._settings.maxLines;E=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(s.cutSx||s.cutSy)&&this._context.translate(-s.cutSx,-s.cutSy);let d,C;const b=[];for(let k=0,P=o.length;ki)for(;d>0&&(C=this._context.measureText(s.substring(0,d)).width+o,C>i);)d-=1;else for(;d=o?u:"")}wrapText(s,i,u,o=0){const x=s.split(/\r?\n/g);let y=[];const d=[];for(let C=0;Ck?(O>0&&(b.push(I),I=""),I+=P[O],k=i-v-(O===0?o:0)):(k-=N,I+=` ${P[O]}`)}b.push(I),I="",y=y.concat(b),Cu+this._context.measureText(o).width+i,0):this._context.measureText(s).width}mergeDefaults(s){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...s}}}const lx=typeof self>"u"?globalThis:self;var Rx;const ux=((Rx=lx.document)==null?void 0:Rx.fonts)||lx.fonts;function NA(h){const{fontFamily:s,fontStyle:i,fontWeight:u,fontStretch:o,fontSize:x}=h;return[i,u,o,`${x}px`,s].join(" ")}const PA=go(0,0,0,0);class DA extends Ux{constructor(i){super(i);L(this,"canvas");L(this,"context");L(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let u=this.canvas.getContext("2d");u||(this.canvas=document.createElement("canvas"),u=this.canvas.getContext("2d")),this.context=u,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(i,u)=>{i.props.fontFamily=u,i.fontInfo=void 0,this.invalidateLayoutCache(i)},fontWeight:(i,u)=>{i.props.fontWeight=u,i.fontInfo=void 0,this.invalidateLayoutCache(i)},fontStyle:(i,u)=>{i.props.fontStyle=u,i.fontInfo=void 0,this.invalidateLayoutCache(i)},fontStretch:(i,u)=>{i.props.fontStretch=u,i.fontInfo=void 0,this.invalidateLayoutCache(i)},fontSize:(i,u)=>{i.props.fontSize=u,i.fontInfo=void 0,this.invalidateLayoutCache(i)},text:(i,u)=>{i.props.text=u,this.invalidateLayoutCache(i)},textAlign:(i,u)=>{i.props.textAlign=u,this.invalidateLayoutCache(i)},color:(i,u)=>{i.props.color=u,this.invalidateLayoutCache(i)},x:(i,u)=>{i.props.x=u,this.invalidateVisibleWindowCache(i)},y:(i,u)=>{i.props.y=u,this.invalidateVisibleWindowCache(i)},contain:(i,u)=>{i.props.contain=u,this.invalidateLayoutCache(i)},width:(i,u)=>{i.props.width=u,i.props.contain!=="none"&&this.invalidateLayoutCache(i)},height:(i,u)=>{i.props.height=u,i.props.contain==="both"&&this.invalidateLayoutCache(i)},offsetY:(i,u)=>{i.props.offsetY=u,this.invalidateLayoutCache(i)},scrollY:(i,u)=>{i.props.scrollY=u},letterSpacing:(i,u)=>{i.props.letterSpacing=u,this.invalidateLayoutCache(i)},lineHeight:(i,u)=>{i.props.lineHeight=u,this.invalidateLayoutCache(i)},maxLines:(i,u)=>{i.props.maxLines=u,this.invalidateLayoutCache(i)},textBaseline:(i,u)=>{i.props.textBaseline=u,this.invalidateLayoutCache(i)},verticalAlign:(i,u)=>{i.props.verticalAlign=u,this.invalidateLayoutCache(i)},overflowSuffix:(i,u)=>{i.props.overflowSuffix=u,this.invalidateLayoutCache(i)}}}canRenderFont(i){return!0}isFontFaceSupported(i){return i instanceof Fx}addFontFace(i){ux.add(i.fontFace)}createState(i){return{props:i,status:"initialState",updateScheduled:!1,emitter:new Qi,canvasPages:void 0,lightning2TextRenderer:new LA(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(i){if(i.status==="initialState"&&this.setStatus(i,"loading"),!i.fontInfo){const v=NA(i.props);if(i.fontInfo={cssString:v,loaded:!1},!i.fontInfo.loaded){ux.load(v).then(this.onFontLoaded.bind(this,i,v)).catch(this.onFontLoadError.bind(this,i,v));return}}if(!i.fontInfo.loaded)return;if(!i.renderInfo){const v=i.props.maxLines,N=i.props.contain==="both"?Math.floor((i.props.height-i.props.offsetY)/i.props.lineHeight):0,V=N>0&&v>0?Math.min(N,v):Math.max(N,v);i.lightning2TextRenderer.settings={text:i.props.text,textAlign:i.props.textAlign,fontFace:i.props.fontFamily,fontSize:i.props.fontSize,fontStyle:[i.props.fontStretch,i.props.fontStyle,i.props.fontWeight].join(" "),textColor:Ti(i.props.color),offsetY:i.props.fontSize+i.props.offsetY,wordWrap:i.props.contain!=="none",wordWrapWidth:i.props.contain==="none"?void 0:i.props.width,letterSpacing:i.props.letterSpacing,lineHeight:i.props.lineHeight,maxLines:V,textBaseline:i.props.textBaseline,verticalAlign:i.props.verticalAlign,overflowSuffix:i.props.overflowSuffix},i.renderInfo=i.lightning2TextRenderer.calculateRenderInfo(),i.textH=i.renderInfo.lineHeight*i.renderInfo.lines.length,i.textW=i.renderInfo.width,i.renderWindow=void 0}const{x:u,y:o,width:x,height:y,scrollY:d,contain:C}=i.props,{visibleWindow:b}=i;let{renderWindow:I,canvasPages:k}=i;if(!b.valid){const v=go(u,o,C!=="none"?u+x:1/0,C==="both"?o+y:1/0,PA);kA(this.rendererBounds,v,b),b.valid=!0}const P=b.y2-b.y1,O=Math.ceil(P/i.renderInfo.lineHeight);if(P===0){k=void 0,I=void 0,this.setStatus(i,"loaded");return}else if(I&&k){const v=u+I.x1,N=o-d+I.y1,V=u+I.x2,G=o-d+I.y2;if(v<=b.x1&&V>=b.x2&&N<=b.y1&&G>=b.y2){this.setStatus(i,"loaded");return}Gb.y1&&(I.y1-=O*i.renderInfo.lineHeight,I.y2-=O*i.renderInfo.lineHeight,k.unshift(k.pop()),k[0].lineNumStart=k[1].lineNumStart-O,k[0].lineNumEnd=k[0].lineNumStart+O,k[0].valid=!1)}else{const v=i.renderInfo.lineHeight*O,N=Math.ceil(d/v),V=N*O,G=V-O,ie=V+O;k=[{texture:k==null?void 0:k[0].texture,lineNumStart:G,lineNumEnd:G+O,valid:!1},{texture:k==null?void 0:k[1].texture,lineNumStart:V,lineNumEnd:V+O,valid:!1},{texture:k==null?void 0:k[2].texture,lineNumStart:ie,lineNumEnd:ie+O,valid:!1}],i.canvasPages=k;const $=N*v;I={x1:0,y1:$-v,x2:x,y2:$+v*2}}i.renderWindow=I,performance.now();for(const v of k)if(!v.valid){if(v.lineNumStart<0){v.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),v.valid=!0;continue}i.lightning2TextRenderer.draw(i.renderInfo,{lines:i.renderInfo.lines.slice(v.lineNumStart,v.lineNumEnd),lineWidths:i.renderInfo.lineWidths.slice(v.lineNumStart,v.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||(v.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0})),v.valid=!0}this.setStatus(i,"loaded")}renderQuads(i,u,o,x){var oe,re,E,H,Q,ge,ae,q,Y,K,de,ve;const{stage:y}=this,{canvasPages:d,textW:C=0,textH:b=0,renderWindow:I}=i;if(!d||!I)return;const{x:k,y:P,scrollY:O,contain:v,width:N,height:V}=i.props,G={x:k,y:P,width:v!=="none"?N:C,height:v==="both"?V:b};Hh({x:0,y:0,width:y.options.appWidth,height:y.options.appHeight},G);const $=(I.y2-I.y1)/3,{zIndex:ne,color:ee}=i.props,le=x*AA(ee),X=Ea(4294967295,le);d[0].valid&&this.stage.renderer.addQuad({alpha:le,clippingRect:o,colorBl:X,colorBr:X,colorTl:X,colorTr:X,width:((re=(oe=d[0].texture)==null?void 0:oe.dimensions)==null?void 0:re.width)||0,height:((H=(E=d[0].texture)==null?void 0:E.dimensions)==null?void 0:H.height)||0,texture:d[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:ne,tx:u.tx,ty:u.ty-O+I.y1,ta:u.ta,tb:u.tb,tc:u.tc,td:u.td}),d[1].valid&&this.stage.renderer.addQuad({alpha:le,clippingRect:o,colorBl:X,colorBr:X,colorTl:X,colorTr:X,width:((ge=(Q=d[1].texture)==null?void 0:Q.dimensions)==null?void 0:ge.width)||0,height:((q=(ae=d[1].texture)==null?void 0:ae.dimensions)==null?void 0:q.height)||0,texture:d[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:ne,tx:u.tx,ty:u.ty-O+I.y1+$,ta:u.ta,tb:u.tb,tc:u.tc,td:u.td}),d[2].valid&&this.stage.renderer.addQuad({alpha:le,clippingRect:o,colorBl:X,colorBr:X,colorTl:X,colorTr:X,width:((K=(Y=d[2].texture)==null?void 0:Y.dimensions)==null?void 0:K.width)||0,height:((ve=(de=d[2].texture)==null?void 0:de.dimensions)==null?void 0:ve.height)||0,texture:d[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:ne,tx:u.tx,ty:u.ty-O+I.y1+$+$,ta:u.ta,tb:u.tb,tc:u.tc,td:u.td})}invalidateVisibleWindowCache(i){i.visibleWindow.valid=!1,this.setStatus(i,"loading"),this.scheduleUpdateState(i)}invalidateLayoutCache(i){i.renderInfo=void 0,i.visibleWindow.valid=!1,this.setStatus(i,"loading"),this.scheduleUpdateState(i)}onFontLoaded(i,u){var o;u!==((o=i.fontInfo)==null?void 0:o.cssString)||!i.fontInfo||(i.fontInfo.loaded=!0,this.scheduleUpdateState(i))}onFontLoadError(i,u,o){var x;u!==((x=i.fontInfo)==null?void 0:x.cssString)||!i.fontInfo||(i.fontInfo.loaded=!0,console.error(`CanvasTextRenderer: Error loading font '${i.fontInfo.cssString}'`,o),this.scheduleUpdateState(i))}}class OA{constructor(s){L(this,"textureSource");this.textureSource=s}}class UA{constructor(s){L(this,"stage");this.stage=s}}class BA{}class zx extends BA{constructor(i,u,o,x,y,d,C,b,I,k){super();L(this,"glw");L(this,"options");L(this,"buffers");L(this,"shader");L(this,"shaderProps");L(this,"alpha");L(this,"clippingRect");L(this,"dimensions");L(this,"bufferIdx");L(this,"zIndex");L(this,"length",0);L(this,"numQuads",0);L(this,"textures",[]);L(this,"maxTextures");this.glw=i,this.options=u,this.buffers=o,this.shader=x,this.shaderProps=y,this.alpha=d,this.clippingRect=C,this.dimensions=b,this.bufferIdx=I,this.zIndex=k,this.maxTextures=x.supportsIndexedTextures?i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS):1}addTexture(i){const{textures:u,maxTextures:o}=this,x=u.findIndex(d=>d===i);if(x!==-1)return x;const y=u.length;return y>=o?4294967295:(this.textures.push(i),y)}draw(){const{glw:i,shader:u,shaderProps:o,options:x}=this,{shManager:y}=x;y.useShader(u),u.bindRenderOp(this,o);const d=this.bufferIdx/24*6*2;if(this.clippingRect.valid){const{x:C,y:b,width:I,height:k}=this.clippingRect,P=x.pixelRatio,O=x.canvas.height,v=Math.round(C*P),N=Math.round(I*P),V=Math.round(k*P),G=Math.round(O-V-b*P);i.setScissorTest(!0),i.scissor(v,G,N,V)}else i.setScissorTest(!1);i.drawElements(i.TRIANGLES,6*this.numQuads,i.UNSIGNED_SHORT,d)}}function jA(h){const s={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(s).forEach(u=>{s[u]=h.getParameter(h[u])}),s}function FA(h){const s={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(s).forEach(u=>{s[u]=h.getExtension(u)}),s}function zA(h,s){const i=~~(s/80),u=new Uint16Array(i*6);for(let x=0,y=0;xh&&!(h&h-1),sn=(h,s,i,u)=>{const o=3*h,x=3*(i-h)-o,y=1-o-x,d=3*s,C=3*(u-s)-d,b=1-d-C;return function(I){if(I>=1)return 1;if(I<=0)return 0;let k=.5,P,O,v;for(let G=0;G<20;G++){if(P=k*(k*(k*y+x)+o),v=I-P,v>-1e-8&&v<1e-8)return k*(k*(k*b+C)+d);if(O=k*(k*(3*y)+2*x)+o,O>1e-10&&O<1e-10)break;k+=v/O}let N=0,V=1;for(let G=0;G<20;G++){if(k=.5*(N+V),P=k*(k*(k*y+x)+o),v=I-P,v>-1e-8&&v<1e-8)return k*(k*(k*b+C)+d);v<0?V=k:N=k}}},HA=Gh(h=>{switch(h){case"linear":return function(i){return i};case"ease":return sn(.25,.1,.25,1);case"ease-in":return sn(.42,0,1,1);case"ease-out":return sn(0,0,.58,1);case"ease-in-out":return sn(.42,0,.58,1);case"ease-in-sine":return sn(.12,0,.39,0);case"ease-out-sine":return sn(.12,0,.39,0);case"ease-in-out-sine":return sn(.37,0,.63,1);case"ease-in-cubic":return sn(.32,0,.67,0);case"ease-out-cubic":return sn(.33,1,.68,1);case"ease-in-out-cubic":return sn(.65,0,.35,1);case"ease-in-circ":return sn(.55,0,1,.45);case"ease-out-circ":return sn(0,.55,.45,1);case"ease-in-out-circ":return sn(.85,0,.15,1);case"ease-in-back":return sn(.36,0,.66,-.56);case"ease-out-back":return sn(.34,1.56,.64,1);case"ease-in-out-back":return sn(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(i){return i===1?1:0};default:const s="cubic-bezier(";if(h&&h.indexOf(s)===0){const i=h.substr(s.length,h.length-s.length-1).split(",");if(i.length!==4)return console.warn("Unknown timing function: "+h),function(d){return d};const u=parseFloat(i[0]||"0.42"),o=parseFloat(i[1]||"0"),x=parseFloat(i[2]||"1"),y=parseFloat(i[3]||"1");return isNaN(u)||isNaN(o)||isNaN(x)||isNaN(y)?(console.warn(" Unknown timing function: "+h),function(d){return d}):sn(u,o,x,y)}else return console.warn("Unknown timing function: "+h),function(i){return i}}});Math.hypot||(Math.hypot=(...h)=>{let s=0,i=h.length;for(;i--;)s+=h[i]*h[i];return Math.sqrt(s)});const cx=new Uint8Array([0,0,0,0]);class Vx extends OA{constructor(i,u){super(u);L(this,"glw");L(this,"_nativeCtxTexture",null);L(this,"_state","freed");L(this,"_w",0);L(this,"_h",0);this.glw=i}get ctxTexture(){return this._state==="freed"&&this.load(),this._nativeCtxTexture,this._nativeCtxTexture}get w(){return this._w}get h(){return this._h}load(){this._state==="loading"||this._state==="loaded"||(this._state="loading",this.textureSource.setState("loading"),this.onLoadRequest().then(({width:i,height:u})=>{this._state="loaded",this._w=i,this._h=u,this.textureSource.setState("loaded",{width:i,height:u})}).catch(i=>{this._state="failed",this.textureSource.setState("failed",i),console.error(i)}))}async onLoadRequest(){var y;this._nativeCtxTexture=this.createNativeCtxTexture();const{glw:i}=this;i.activeTexture(0),i.bindTexture(this._nativeCtxTexture),i.texParameteri(i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texImage2D(0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,cx);const u=await((y=this.textureSource)==null?void 0:y.getTextureData());let o=0,x=0;if(this._nativeCtxTexture,i.activeTexture(0),u.data instanceof ImageBitmap||u.data instanceof ImageData||VA(u.data)){const d=u.data;o=d.width,x=d.height,i.bindTexture(this._nativeCtxTexture),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!u.premultiplyAlpha),i.texImage2D(0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,d),(i.isWebGl2()||fx(o)&&fx(x))&&i.generateMipmap()}else if(u.data===null)o=0,x=0,i.bindTexture(this._nativeCtxTexture),i.texImage2D(0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,cx);else if("mipmaps"in u.data&&u.data.mipmaps){const{mipmaps:d,width:C=0,height:b=0,type:I,glInternalFormat:k}=u.data,P=I==="ktx"?new DataView(d[0]??new ArrayBuffer(0)):d[0];i.bindTexture(this._nativeCtxTexture),i.compressedTexImage2D(0,k,C,b,0,P),i.texParameteri(i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_MIN_FILTER,i.LINEAR)}else console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",u);return{width:o,height:x}}free(){if(this._state==="freed"||(this._state="freed",this._w=0,this._h=0,!this._nativeCtxTexture))return;const{glw:i}=this;i.deleteTexture(this._nativeCtxTexture),this._nativeCtxTexture=null}createNativeCtxTexture(){const{glw:i}=this,u=i.createTexture();if(!u)throw new Error("Could not create WebGL Texture");return u}}const _a=class _a extends yf{constructor(i,u){super(i);L(this,"props");this.props=_a.resolveDefaults(u||{})}get color(){return this.props.color}set color(i){this.props.color=i}async getTextureData(){const i=new Uint32Array([this.color]),u=new Uint8ClampedArray(i.buffer);return{data:new ImageData(u,1,1),premultiplyAlpha:!0}}static makeCacheKey(i){return`ColorTexture,${_a.resolveDefaults(i).color}`}static resolveDefaults(i){return{color:i.color||4294967295}}};L(_a,"z$__type__Props");let ff=_a;const mf=class mf extends yf{constructor(i,u){super(i);L(this,"props");L(this,"parentTexture");L(this,"onParentTxLoaded",()=>{this.setState("loaded",{width:this.props.width,height:this.props.height})});L(this,"onParentTxFailed",(i,u)=>{this.setState("failed",u)});this.parentTexture=this.txManager.loadTexture(u.texture.txType,u.texture.props,u.texture.options),this.props=mf.resolveDefaults(u||{}),queueMicrotask(()=>{const o=this.parentTexture;o.state==="loaded"?this.onParentTxLoaded(o,o.dimensions):o.state==="failed"&&this.onParentTxFailed(o,o.error),o.on("loaded",this.onParentTxLoaded),o.on("failed",this.onParentTxFailed)})}async getTextureData(){return{data:this.props}}static makeCacheKey(i){return!1}static resolveDefaults(i){return{texture:i.texture,x:i.x||0,y:i.y||0,width:i.width||0,height:i.height||0}}};L(mf,"z$__type__Props");let Pa=mf;class GA extends Vx{constructor(s,i){super(s,i)}async onLoadRequest(){var i,u;const s=await this.textureSource.getTextureData();return{width:((i=s.data)==null?void 0:i.width)||0,height:((u=s.data)==null?void 0:u.height)||0}}}class Hx extends cs{constructor(s){super({renderer:s,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(s){const{glw:i}=this;i.activeTexture(0),i.bindTexture(s[0].ctxTexture)}}L(Hx,"shaderSources",{vertex:` + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + attribute vec2 a_position; + attribute vec2 a_textureCoordinate; + attribute vec4 a_color; + + uniform vec2 u_resolution; + uniform float u_pixelRatio; + + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + + void main() { + vec2 normalized = a_position * u_pixelRatio / u_resolution; + vec2 zero_two = normalized * 2.0; + vec2 clip_space = zero_two - 1.0; + + // pass to fragment + v_color = a_color; + v_textureCoordinate = a_textureCoordinate; + + // flip y + gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); + } + `,fragment:` + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + uniform vec2 u_resolution; + uniform sampler2D u_texture; + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + + void main() { + vec4 color = texture2D(u_texture, v_textureCoordinate); + gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate); + } + `});class Gx extends cs{constructor(i){super({renderer:i,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});L(this,"supportsIndexedTextures",!0)}bindTextures(i){const{renderer:u,glw:o}=this;if(i.length>u.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error(`DefaultShaderBatched: Cannot bind more than ${u.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);i.forEach((y,d)=>{o.activeTexture(d),o.bindTexture(y.ctxTexture)});const x=Array.from(Array(i.length).keys());this.setUniform("u_textures[0]",x)}}L(Gx,"shaderSources",{vertex:` + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + attribute vec2 a_textureCoordinate; + attribute vec2 a_position; + attribute vec4 a_color; + attribute float a_textureIndex; + attribute float a_depth; + + uniform vec2 u_resolution; + uniform float u_pixelRatio; + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + varying float v_textureIndex; + + void main(){ + vec2 normalized = a_position * u_pixelRatio / u_resolution; + vec2 zero_two = normalized * 2.0; + vec2 clip_space = zero_two - 1.0; + + // pass to fragment + v_color = a_color; + v_textureCoordinate = a_textureCoordinate; + v_textureIndex = a_textureIndex; + + // flip y + gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); + } + `,fragment:i=>` + #define txUnits ${i} + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + uniform vec2 u_resolution; + uniform sampler2D u_image; + uniform sampler2D u_textures[txUnits]; + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + varying float v_textureIndex; + + vec4 sampleFromTexture(sampler2D textures[${i}], int idx, vec2 uv) { + ${Array.from(Array(i).keys()).map(u=>` + ${u!==0?"else ":""}if (idx == ${u}) { + return texture2D(textures[${u}], uv); + } + `).join("")} + return texture2D(textures[0], uv); + } + + void main(){ + gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate); + } + `});const Th=new Map,XA=(h,s)=>{const i=JSON.stringify(h);if(Th.has(i))return Th.get(i);const u=(h??[]).map(o=>({type:o.type,props:s[o.type].resolveDefaults(o.props||{})}));return Th.set(i,u),u},qi=class qi extends cs{constructor(i,u,o){const x=qi.createShader(u,o);super({renderer:i,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...x.uniforms],shaderSources:{vertex:x.vertex,fragment:x.fragment}});L(this,"effects",[]);this.effects=x.effects,this.calculateProps=Gh(this.calculateProps.bind(this))}bindTextures(i){const{glw:u}=this;u.activeTexture(0),u.bindTexture(i[0].ctxTexture)}calculateProps(i){const u=this.renderer.shManager.getRegisteredEffects(),o=[];return i==null||i.forEach((x,y)=>{const d=this.effects[y],C=u[d.name],b=x.props??{},I=d.uniformInfo;Object.keys(b).forEach(k=>{const P=C.uniforms[k],O=I[k];let v=P.validator?P.validator(b[k],b):b[k];Array.isArray(v)&&(v=new Float32Array(v)),o.push({name:O.name,value:v})})}),o}bindProps(i){this.calculateProps(i.effects).forEach(o=>{this.setUniform(o.name,o.value)})}static createShader(i,u){const o={},x={};let y="";const d=[],C=[],b=i.effects.map(v=>{const N=u[v.type],V=N.getEffectKey(v.props||{});o[V]=o[V]?++o[V]:1;const G=o[V];G===1&&C.push({key:V,type:v.type,props:v.props});const ie=new N({ref:`${V}${G===1?"":G}`,target:V,props:v.props});return y+=ie.declaredUniforms,d.push(...Object.values(ie.uniformInfo)),ie});let I="";C==null||C.forEach(v=>{const N=u[v.type],V=N.resolveDefaults(v.props??{}),G=[];for(const X in N.methods){let oe=X;const re=N.methods[X];x[X]&&x[X]!==re&&(oe=qi.resolveMethodDuplicate(X,re,x)),x[oe]=re.replace("function",oe),G.push({m:X,cm:oe})}let ie=N.onShaderMask instanceof Function?N.onShaderMask(V):N.onShaderMask,$=N.onColorize instanceof Function?N.onColorize(V):N.onColorize,ne=N.onEffectMask instanceof Function?N.onEffectMask(V):N.onEffectMask;G.forEach(X=>{const{m:oe,cm:re}=X,E=new RegExp(`\\$${oe}`,"g");ie&&(ie=ie.replace(E,re)),$&&($=$.replace(E,re)),ne&&(ne=ne.replace(E,re))});const ee=N.getMethodParameters(N.uniforms,V),le=ee.length>0?`, ${ee}`:"";ie&&(I+=` + float fx_${v.key}_onShaderMask(float shaderMask ${le}) { + ${ie} + } + `),$&&(I+=` + vec4 fx_${v.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${le}) { + ${$} + } + `),ne&&(I+=` + vec4 fx_${v.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${le}) { + ${ne} + } + `)});let k="";for(const v in x)k+=x[v];let P="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",O=` + + `;for(let v=0;v0?`, ${N.passParameters}`:"",G=u[N.name];G.onShaderMask&&(O+=` + shaderMask = fx_${N.target}_onShaderMask(shaderMask ${V}); + `),G.onColorize&&(O+=` + maskColor = fx_${N.target}_onColorize(shaderMask, maskColor, shaderColor${V}); + `),G.onEffectMask&&(P=`fx_${N.target}_onEffectMask(shaderMask, maskColor, shaderColor${V})`);const ie=b[v+1];(ie===void 0||u[ie.name].onEffectMask)&&(O+=` + shaderColor = ${P}; + `)}return{effects:b,uniforms:d,fragment:qi.fragment(y,k,I,O),vertex:qi.vertex()}}static resolveMethodDuplicate(i,u,o,x=0){const y=i+(x>0?x:"");return o[y]&&o[y]!==u?this.resolveMethodDuplicate(i,u,o,++x):y}static resolveDefaults(i,u){return{effects:XA(i.effects,u),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(i,u){var x;let o="";return(x=i.effects)==null||x.forEach(y=>{const C=u[y.type].getEffectKey(y.props||{});o+=`,${C}`}),`DynamicShader${o}`}};L(qi,"z$__type__Props"),L(qi,"vertex",()=>` + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + attribute vec2 a_textureCoordinate; + attribute vec2 a_position; + attribute vec4 a_color; + attribute float a_textureIndex; + + uniform vec2 u_resolution; + uniform float u_pixelRatio; + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + varying float v_textureIndex; + + void main(){ + vec2 normalized = a_position * u_pixelRatio / u_resolution; + vec2 zero_two = normalized * 2.0; + vec2 clip_space = zero_two - 1.0; + + // pass to fragment + v_color = a_color; + v_textureCoordinate = a_textureCoordinate; + v_textureIndex = a_textureIndex; + + // flip y + gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); + } + `),L(qi,"fragment",(i,u,o,x)=>` + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + #define PI 3.14159265359 + + uniform vec2 u_resolution; + uniform vec2 u_dimensions; + uniform float u_alpha; + uniform float u_radius; + uniform sampler2D u_texture; + uniform float u_pixelRatio; + + ${i} + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + + ${u} + + ${o} + + void main() { + vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5; + vec2 d = abs(p) - (u_dimensions) * 0.5; + float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); + + vec4 shaderColor = vec4(0.0); + float shaderMask = lng_DefaultMask; + + vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color; + + shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0)); + + ${x} + + gl_FragColor = shaderColor * u_alpha; + } + `);let as=qi;class Rh extends cs{constructor(s){super({renderer:s,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(s){return{radius:s.radius||10,$dimensions:{width:0,height:0}}}bindTextures(s){const{glw:i}=this;i.activeTexture(0),i.bindTexture(s[0].ctxTexture)}bindProps(s){this.setUniform("u_radius",s.radius)}canBatchShaderProps(s,i){return s.radius===i.radius&&s.$dimensions.width===i.$dimensions.width&&s.$dimensions.height===i.$dimensions.height}}L(Rh,"z$__type__Props"),L(Rh,"shaderSources",{vertex:` + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + attribute vec2 a_position; + attribute vec2 a_textureCoordinate; + attribute vec4 a_color; + attribute float a_textureIndex; + attribute float a_depth; + + uniform vec2 u_resolution; + uniform float u_pixelRatio; + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + + void main() { + vec2 normalized = a_position * u_pixelRatio / u_resolution; + vec2 zero_two = normalized * 2.0; + vec2 clip_space = zero_two - 1.0; + + // pass to fragment + v_color = a_color; + v_textureCoordinate = a_textureCoordinate; + + // flip y + gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); + } + `,fragment:` + # ifdef GL_FRAGMENT_PRESICISON_HIGH + precision highp float; + # else + precision mediump float; + # endif + + uniform vec2 u_resolution; + uniform vec2 u_dimensions; + uniform float u_radius; + uniform sampler2D u_texture; + + varying vec4 v_color; + varying vec2 v_textureCoordinate; + + float boxDist(vec2 p, vec2 size, float radius){ + size -= vec2(radius); + vec2 d = abs(p) - size; + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius; + } + + float fillMask(float dist) { + return clamp(-dist, 0.0, 1.0); + } + + void main() { + vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color; + vec2 halfDimensions = u_dimensions * 0.5; + + float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius); + gl_FragColor = mix(vec4(0.0), color, fillMask(d)); + } + `});const WA=new Float32Array([1,0,0,0,1,0,0,0,1]),gf=class gf extends cs{constructor(s){super({renderer:s,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(s){const{glw:i}=this;i.activeTexture(0),i.bindTexture(s[0].ctxTexture)}bindProps(s){const i=gf.resolveDefaults(s);for(const u in i)if(u==="transform")this.setUniform("u_transform",!1,i[u]);else if(u==="scrollY")this.setUniform("u_scrollY",i[u]);else if(u==="color"){const o=Ti(i.color);this.setUniform("u_color",o)}else u==="size"?this.setUniform("u_size",i[u]):u==="distanceRange"?this.setUniform("u_distanceRange",i[u]):u==="debug"&&this.setUniform("u_debug",i[u]?1:0)}static resolveDefaults(s={}){return{transform:s.transform??WA,scrollY:s.scrollY??0,color:s.color??4294967295,size:s.size??16,distanceRange:s.distanceRange??1,debug:s.debug??!1}}};L(gf,"shaderSources",{vertex:` + // an attribute is an input (in) to a vertex shader. + // It will receive data from a buffer + attribute vec2 a_position; + attribute vec2 a_textureCoordinate; + + uniform vec2 u_resolution; + uniform mat3 u_transform; + uniform float u_scrollY; + uniform float u_pixelRatio; + uniform float u_size; + + varying vec2 v_texcoord; + + void main() { + vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY); + vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy; + gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1); + v_texcoord = a_textureCoordinate; + } + `,fragment:` + precision highp float; + + uniform vec4 u_color; + uniform sampler2D u_texture; + uniform float u_distanceRange; + uniform float u_pixelRatio; + uniform int u_debug; + + varying vec2 v_texcoord; + + float median(float r, float g, float b) { + return max(min(r, g), min(max(r, g), b)); + } + + void main() { + vec3 sample = texture2D(u_texture, v_texcoord).rgb; + if (u_debug == 1) { + gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0); + return; + } + float scaledDistRange = u_distanceRange * u_pixelRatio; + float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5); + float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a; + + // Build the final color. + // IMPORTANT: We must premultiply the color by the alpha value before returning it. + gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity); + } + `});let _h=gf;class Jr extends an{constructor(){super(...arguments);L(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(i){return{radius:i.radius??10}}}L(Jr,"z$__type__Props"),L(Jr,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:i=>{let u=i;return Array.isArray(u)?u.length===2?u=[u[0],u[1],u[0],u[1]]:u.length===3?u=[u[0],u[1],u[2],u[0]]:u.length!==4&&(u=[u[0],u[0],u[0],u[0]]):typeof u=="number"&&(u=[u,u,u,u]),u}}}),L(Jr,"methods",{fillMask:` + float function(float dist) { + return clamp(-dist, 0.0, 1.0); + } + `,boxDist:` + float function(vec2 p, vec2 size, float radius) { + size -= vec2(radius); + vec2 d = abs(p) - size; + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius; + } + `}),L(Jr,"onShaderMask",` + vec2 halfDimensions = u_dimensions * 0.5; + float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5); + r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5); + r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y); + r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y); + return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r); + `),L(Jr,"onEffectMask",` + return mix(vec4(0.0), maskColor, $fillMask(shaderMask)); + `);class ba extends an{constructor(){super(...arguments);L(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(i){return{width:i.width??10,color:i.color??4294967295}}}L(ba,"z$__type__Props"),L(ba,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:i=>Ti(i),method:"uniform4fv",type:"vec4"}}),L(ba,"onEffectMask",` + float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0); + return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask); + `),L(ba,"onColorize",` + return color; + `);class es extends an{constructor(){super(...arguments);L(this,"name","linearGradient")}static getEffectKey(i){return`linearGradient${i.colors.length}`}static resolveDefaults(i){const u=i.colors??[4278190080,4294967295];let o=i.stops;if(!o){o=[];const x=u.length-1;for(let y=0;yi.map(o=>Ti(o)).reduce((o,x)=>o.concat(x),[]),size:i=>i.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],validator:(i,u)=>{const o=u.colors??[];let x=i;const y=i;if(x.length===0||x&&x.length!==o.length){for(let d=0;di.colors.length,method:"uniform1fv",type:"float"}}),L(es,"methods",{fromLinear:` + vec4 function(vec4 linearRGB) { + vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055); + vec4 lower = linearRGB * vec4(12.92); + return mix(higher, lower, 1.0); + } + `,toLinear:` + vec4 function(vec4 sRGB) { + vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4)); + vec4 lower = sRGB/vec4(12.92); + return mix(higher, lower, 1.0); + } + `,calcPoint:` + vec2 function(float d, float angle) { + return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5); + } + `}),L(es,"ColorLoop",i=>{let u="";for(let o=2;o` + float a = angle - (PI / 180.0 * 90.0); + float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a)); + vec2 f = $calcPoint(lineDist * 0.5, a); + vec2 t = $calcPoint(lineDist * 0.5, a + PI); + vec2 gradVec = t - f; + float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec); + + float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]); + vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc)); + for(int i = 1; i < ${i.colors.length||1}-1; i++) { + stopCalc = (dist - stops[i]) / (stops[i + 1] - stops[i]); + colorOut = mix(colorOut, colors[i + 1], clamp(stopCalc, 0.0, 1.0)); + } + return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0)); + `);class Lh extends an{constructor(){super(...arguments);L(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(i){return{amount:i.amount??1}}}L(Lh,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),L(Lh,"onColorize",` + float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b; + return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a); + `);class ts extends an{constructor(){super(...arguments);L(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(i){return{width:i.width??10,color:i.color??4294967295}}}L(ts,"z$__type__Props"),L(ts,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:i=>Ti(i),method:"uniform4fv",type:"vec4"}}),L(ts,"methods",{fillMask:` + float function(float dist) { + return clamp(-dist, 0.0, 1.0); + } + `,rectDist:` + float function(vec2 p, vec2 size) { + vec2 d = abs(p) - size; + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); + } + `}),L(ts,"onEffectMask",` + vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0); + float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y)); + return mix(shaderColor, maskColor, $fillMask(mask)); + `),L(ts,"onColorize",` + return color; + `);class ns extends an{constructor(){super(...arguments);L(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(i){return{width:i.width??10,color:i.color??4294967295}}}L(ns,"z$__type__Props"),L(ns,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:i=>Ti(i),method:"uniform4fv",type:"vec4"}}),L(ns,"methods",{fillMask:` + float function(float dist) { + return clamp(-dist, 0.0, 1.0); + } + `,rectDist:` + float function(vec2 p, vec2 size) { + vec2 d = abs(p) - size; + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); + } + `}),L(ns,"onEffectMask",` + vec2 pos = vec2(0.0, width * 0.5); + float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5)); + return mix(shaderColor, maskColor, $fillMask(mask)); + `),L(ns,"onColorize",` + return color; + `);class is extends an{constructor(){super(...arguments);L(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(i){return{width:i.width??10,color:i.color??4294967295}}}L(is,"z$__type__Props"),L(is,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:i=>Ti(i),method:"uniform4fv",type:"vec4"}}),L(is,"methods",{fillMask:` + float function(float dist) { + return clamp(-dist, 0.0, 1.0); + } + `,rectDist:` + float function(vec2 p, vec2 size) { + vec2 d = abs(p) - size; + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); + } + `}),L(is,"onEffectMask",` + vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5); + float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5)); + return mix(shaderColor, maskColor, $fillMask(mask)); + `),L(is,"onColorize",` + return color; + `);class os extends an{constructor(){super(...arguments);L(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(i){return{width:i.width??10,color:i.color??4294967295}}}L(os,"z$__type__Props"),L(os,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:i=>Ti(i),method:"uniform4fv",type:"vec4"}}),L(os,"methods",{fillMask:` + float function(float dist) { + return clamp(-dist, 0.0, 1.0); + } + `,rectDist:` + float function(vec2 p, vec2 size) { + vec2 d = abs(p) - size; + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); + } + `}),L(os,"onEffectMask",` + vec2 pos = vec2(width * 0.5, 0.0); + float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y)); + return mix(shaderColor, maskColor, $fillMask(mask)); + `),L(os,"onColorize",` + return color; + `);class Aa extends an{constructor(){super(...arguments);L(this,"name","glitch")}static getEffectKey(i){return"glitch"}static resolveDefaults(i){return{amplitude:i.amplitude??.2,narrowness:i.narrowness??4,blockiness:i.blockiness??2,minimizer:i.minimizer??8,time:i.time??Date.now()}}}L(Aa,"z$__type__Props"),L(Aa,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:i=>(Date.now()-i)%1e3,type:"float"}}),L(Aa,"methods",{rand:` + float function(vec2 p, float time) { + float t = floor(time * 20.) / 10.; + return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453); + } + `,noise:` + float function(vec2 uv, float blockiness, float time) { + vec2 lv = fract(uv); + vec2 id = floor(uv); + + float n1 = rand(id, time); + float n2 = rand(id+vec2(1,0), time); + float n3 = rand(id+vec2(0,1), time); + float n4 = rand(id+vec2(1,1), time); + vec2 u = smoothstep(0.0, 1.0 + blockiness, lv); + return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y); + } + `,fbm:` + float function(vec2 uv, int count, float blockiness, float complexity, float time) { + float val = 0.0; + float amp = 0.5; + const int MAX_ITERATIONS = 10; + + for(int i = 0; i < MAX_ITERATIONS; i++) { + if(i >= count) {break;} + val += amp * noise(uv, blockiness, time); + amp *= 0.5; + uv *= complexity; + } + return val; + } + `}),L(Aa,"onColorize",` + vec2 uv = v_textureCoordinate.xy; + float aspect = u_dimensions.x / u_dimensions.y; + vec2 a = vec2(uv.x * aspect , uv.y); + vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y)); + + float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer); + float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift); + float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift); + float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift); + + vec3 f = vec3(colR, colG, colB); + return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a); + `);class of extends an{constructor(){super(...arguments);L(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(i){return{fade:i.fade??10}}}L(of,"z$__type__Props"),L(of,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:i=>{let u=i;return Array.isArray(u)?u.length===2?u=[u[0],u[1],u[0],u[1]]:u.length===3?u=[u[0],u[1],u[2],u[0]]:u.length!==4&&(u=[u[0],u[0],u[0],u[0]]):typeof u=="number"&&(u=[u,u,u,u]),u}}}),L(of,"onColorize",` + vec2 point = v_textureCoordinate.xy * u_dimensions.xy; + vec2 pos1; + vec2 pos2; + vec2 d; + float c; + vec4 result = maskColor; + + + if(fade[0] > 0.0) { + pos1 = vec2(point.x, point.y); + pos2 = vec2(point.x, point.y + fade[0]); + d = pos2 - pos1; + c = dot(pos1, d) / dot(d, d); + result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); + } + + if(fade[1] > 0.0) { + pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y); + pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y); + d = pos1 - pos2; + c = dot(pos2, d) / dot(d, d); + result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); + } + + if(fade[2] > 0.0) { + pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]); + pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y); + d = pos1 - pos2; + c = dot(pos2, d) / dot(d, d); + result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); + } + + if(fade[3] > 0.0) { + pos1 = vec2(point.x, point.y); + pos2 = vec2(point.x + fade[3], point.y); + d = pos2 - pos1; + c = dot(pos1, d) / dot(d, d); + result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); + } + + return result; + `);class rf extends an{constructor(){super(...arguments);L(this,"name","radialGradient")}static getEffectKey(i){return`radialGradient${i.colors.length}`}static resolveDefaults(i){const u=i.colors??[4278190080,4294967295];let o=i.stops;if(!o){o=[];const x=u.length-1;for(let y=0;yi.map(o=>Ti(o)).reduce((o,x)=>o.concat(x),[]),size:i=>i.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],validator:(i,u)=>{const o=u.colors??[];let x=i;const y=i;if(x.length===0||x&&x.length!==o.length){for(let d=0;di.colors.length,method:"uniform1fv",type:"float"}}),L(rf,"onColorize",i=>` + vec2 point = v_textureCoordinate.xy * u_dimensions; + vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y); + + float dist = length((point - projection) / vec2(width, height)); + + float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]); + vec4 colorOut = mix(colors[0], colors[1], stopCalc); + for(int i = 1; i < ${i.colors.length||1}-1; i++) { + stopCalc = (dist - stops[i]) / (stops[i + 1] - stops[i]); + colorOut = mix(colorOut, colors[i + 1], clamp(stopCalc, 0.0, 1.0)); + } + return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0)); + `);class rs extends an{constructor(){super(...arguments);L(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(i){return{width:i.width??10,progress:i.progress??.5,offset:i.offset??0,range:i.range??Math.PI*2,rounded:i.rounded??!1,radius:i.radius??1,color:i.color??4294967295}}}L(rs,"z$__type__Props"),L(rs,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:i=>i?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:i=>Ti(i),method:"uniform4fv",type:"vec4"}}),L(rs,"methods",{rotateUV:` + vec2 function(vec2 uv, float d) { + float s = sin(d); + float c = cos(d); + mat2 rotMatrix = mat2(c, -s, s, c); + return uv * rotMatrix; + } + `,drawDot:` + float function(vec2 uv, vec2 p, float r) { + uv += p; + float circle = length(uv) - r; + return clamp(-circle, 0.0, 1.0); + } + `}),L(rs,"onEffectMask",` + float outerRadius = radius * u_dimensions.y * 0.5; + + float endAngle = range * progress - 0.0005; + + vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5; + + uv = $rotateUV(uv, -(offset)); + float linewidth = width * u_pixelRatio; + float circle = length(uv) - (outerRadius - linewidth) ; + circle = abs(circle) - linewidth; + circle = clamp(-circle, 0.0, 1.0); + + float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5); + float p = endAngle / (PI * 2.); + + circle *= step(fract(angle), fract(p)); + + circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth)); + circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth)); + + return mix(shaderColor, maskColor, circle); + `),L(rs,"onColorize",` + return color; + `);class $A{constructor(){L(this,"shCache",new Map);L(this,"shConstructors",{});L(this,"attachedShader",null);L(this,"effectConstructors",{});L(this,"renderer");this.registerShaderType("DefaultShader",Hx),this.registerShaderType("DefaultShaderBatched",Gx),this.registerShaderType("RoundedRectangle",Rh),this.registerShaderType("DynamicShader",as),this.registerShaderType("SdfShader",_h),this.registerEffectType("border",ba),this.registerEffectType("borderBottom",is),this.registerEffectType("borderLeft",os),this.registerEffectType("borderRight",ts),this.registerEffectType("borderTop",ns),this.registerEffectType("fadeOut",of),this.registerEffectType("linearGradient",es),this.registerEffectType("radialGradient",rf),this.registerEffectType("grayscale",Lh),this.registerEffectType("glitch",Aa),this.registerEffectType("radius",Jr),this.registerEffectType("radialProgress",rs)}registerShaderType(s,i){this.shConstructors[s]=i}registerEffectType(s,i){this.effectConstructors[s]=i}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(s,i){if(!this.renderer)throw new Error("Renderer is not been defined");const u=this.shConstructors[s];if(!u)throw new Error(`Shader type "${s}" is not registered`);if(s==="DynamicShader")return this.loadDynamicShader(i);const o=u.resolveDefaults(i),x=u.makeCacheKey(o)||u.name;if(x&&this.shCache.has(x))return{shader:this.shCache.get(x),props:o};const y=new u(this.renderer,i);return x&&this.shCache.set(x,y),{shader:y,props:o}}loadDynamicShader(s){if(!this.renderer)throw new Error("Renderer is not been defined");const i=as.resolveDefaults(s,this.effectConstructors),u=as.makeCacheKey(i,this.effectConstructors);if(u&&this.shCache.has(u))return{shader:this.shCache.get(u),props:i};const o=new as(this.renderer,s,this.effectConstructors);return u&&this.shCache.set(u,o),{shader:o,props:i}}useShader(s){this.attachedShader!==s&&(this.attachedShader&&this.attachedShader.detach(),s.attach(),this.attachedShader=s)}}class Xx{constructor(s){L(this,"config");this.config=s}getBuffer(s){var i;return(i=this.config.find(u=>u.attributes[s]))==null?void 0:i.buffer}getAttributeInfo(s){var i;return(i=this.config.find(u=>u.attributes[s]))==null?void 0:i.attributes[s]}}class KA{constructor(){L(this,"data",{})}reset(){this.data={}}increment(s){this.data[s]||(this.data[s]=0),this.data[s]++}getData(){return{...this.data}}}class YA{constructor(s){L(this,"gl");L(this,"activeTextureUnit",0);L(this,"texture2dUnits");L(this,"texture2dParams",new WeakMap);L(this,"scissorEnabled");L(this,"scissorX");L(this,"scissorY");L(this,"scissorWidth");L(this,"scissorHeight");L(this,"blendEnabled");L(this,"blendSrcRgb");L(this,"blendDstRgb");L(this,"blendSrcAlpha");L(this,"blendDstAlpha");L(this,"boundArrayBuffer");L(this,"boundElementArrayBuffer");L(this,"curProgram");L(this,"programUniforms",new WeakMap);L(this,"canvas");L(this,"MAX_RENDERBUFFER_SIZE");L(this,"MAX_TEXTURE_SIZE");L(this,"MAX_VIEWPORT_DIMS");L(this,"MAX_VERTEX_TEXTURE_IMAGE_UNITS");L(this,"MAX_TEXTURE_IMAGE_UNITS");L(this,"MAX_COMBINED_TEXTURE_IMAGE_UNITS");L(this,"MAX_VERTEX_ATTRIBS");L(this,"MAX_VARYING_VECTORS");L(this,"MAX_VERTEX_UNIFORM_VECTORS");L(this,"MAX_FRAGMENT_UNIFORM_VECTORS");L(this,"TEXTURE_MAG_FILTER");L(this,"TEXTURE_MIN_FILTER");L(this,"TEXTURE_WRAP_S");L(this,"TEXTURE_WRAP_T");L(this,"LINEAR");L(this,"CLAMP_TO_EDGE");L(this,"RGBA");L(this,"UNSIGNED_BYTE");L(this,"UNPACK_PREMULTIPLY_ALPHA_WEBGL");L(this,"FLOAT");L(this,"TRIANGLES");L(this,"UNSIGNED_SHORT");L(this,"ONE");L(this,"ONE_MINUS_SRC_ALPHA");L(this,"VERTEX_SHADER");L(this,"FRAGMENT_SHADER");L(this,"STATIC_DRAW");L(this,"COMPILE_STATUS");L(this,"LINK_STATUS");L(this,"DYNAMIC_DRAW");this.gl=s,this.activeTextureUnit=s.getParameter(s.ACTIVE_TEXTURE)-s.TEXTURE0;const i=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS);this.texture2dUnits=new Array(i).fill(void 0).map((o,x)=>(this.activeTexture(x),s.getParameter(s.TEXTURE_BINDING_2D))),this.activeTexture(this.activeTextureUnit),this.scissorEnabled=s.isEnabled(s.SCISSOR_TEST);const u=s.getParameter(s.SCISSOR_BOX);this.scissorX=u[0],this.scissorY=u[1],this.scissorWidth=u[2],this.scissorHeight=u[3],this.blendEnabled=s.isEnabled(s.BLEND),this.blendSrcRgb=s.getParameter(s.BLEND_SRC_RGB),this.blendDstRgb=s.getParameter(s.BLEND_DST_RGB),this.blendSrcAlpha=s.getParameter(s.BLEND_SRC_ALPHA),this.blendDstAlpha=s.getParameter(s.BLEND_DST_ALPHA),this.boundArrayBuffer=s.getParameter(s.ARRAY_BUFFER_BINDING),this.boundElementArrayBuffer=s.getParameter(s.ELEMENT_ARRAY_BUFFER_BINDING),this.curProgram=s.getParameter(s.CURRENT_PROGRAM),this.canvas=s.canvas,this.MAX_RENDERBUFFER_SIZE=s.MAX_RENDERBUFFER_SIZE,this.MAX_TEXTURE_SIZE=s.MAX_TEXTURE_SIZE,this.MAX_VIEWPORT_DIMS=s.MAX_VIEWPORT_DIMS,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=s.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.MAX_TEXTURE_IMAGE_UNITS=s.MAX_TEXTURE_IMAGE_UNITS,this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=s.MAX_COMBINED_TEXTURE_IMAGE_UNITS,this.MAX_VERTEX_ATTRIBS=s.MAX_VERTEX_ATTRIBS,this.MAX_VARYING_VECTORS=s.MAX_VARYING_VECTORS,this.MAX_VERTEX_UNIFORM_VECTORS=s.MAX_VERTEX_UNIFORM_VECTORS,this.MAX_FRAGMENT_UNIFORM_VECTORS=s.MAX_FRAGMENT_UNIFORM_VECTORS,this.TEXTURE_MAG_FILTER=s.TEXTURE_MAG_FILTER,this.TEXTURE_MIN_FILTER=s.TEXTURE_MIN_FILTER,this.TEXTURE_WRAP_S=s.TEXTURE_WRAP_S,this.TEXTURE_WRAP_T=s.TEXTURE_WRAP_T,this.LINEAR=s.LINEAR,this.CLAMP_TO_EDGE=s.CLAMP_TO_EDGE,this.RGBA=s.RGBA,this.UNSIGNED_BYTE=s.UNSIGNED_BYTE,this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.FLOAT=s.FLOAT,this.TRIANGLES=s.TRIANGLES,this.UNSIGNED_SHORT=s.UNSIGNED_SHORT,this.ONE=s.ONE,this.ONE_MINUS_SRC_ALPHA=s.ONE_MINUS_SRC_ALPHA,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=s.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.TRIANGLES=s.TRIANGLES,this.UNSIGNED_SHORT=s.UNSIGNED_SHORT,this.VERTEX_SHADER=s.VERTEX_SHADER,this.FRAGMENT_SHADER=s.FRAGMENT_SHADER,this.STATIC_DRAW=s.STATIC_DRAW,this.COMPILE_STATUS=s.COMPILE_STATUS,this.LINK_STATUS=s.LINK_STATUS,this.DYNAMIC_DRAW=s.DYNAMIC_DRAW}isWebGl2(){return EA(this.gl)}activeTexture(s){const{gl:i}=this;this.activeTextureUnit!==s&&(i.activeTexture(s+i.TEXTURE0),this.activeTextureUnit=s)}bindTexture(s){const{gl:i,activeTextureUnit:u,texture2dUnits:o}=this;o[u]!==s&&(o[u]=s,i.bindTexture(this.gl.TEXTURE_2D,s))}_getActiveTexture(){const{activeTextureUnit:s,texture2dUnits:i}=this;return i[s]}texParameteri(s,i){const{gl:u,texture2dParams:o}=this,x=this._getActiveTexture();if(!x)throw new Error("No active texture");let y=o.get(x);y||(y={},o.set(x,y)),y[s]!==i&&(y[s]=i,u.texParameteri(u.TEXTURE_2D,s,i))}texImage2D(s,i,u,o,x,y,d,C){const{gl:b}=this;y?b.texImage2D(b.TEXTURE_2D,s,i,u,o,x,y,d,C):b.texImage2D(b.TEXTURE_2D,s,i,u,o,x)}compressedTexImage2D(s,i,u,o,x,y){const{gl:d}=this;d.compressedTexImage2D(d.TEXTURE_2D,s,i,u,o,x,y)}pixelStorei(s,i){const{gl:u}=this;u.pixelStorei(s,i)}generateMipmap(){const{gl:s}=this;s.generateMipmap(s.TEXTURE_2D)}createTexture(){const{gl:s}=this;return s.createTexture()}deleteTexture(s){const{gl:i}=this;s&&this.texture2dParams.delete(s),i.deleteTexture(s)}viewport(s,i,u,o){const{gl:x}=this;x.viewport(s,i,u,o)}clearColor(s,i,u,o){const{gl:x}=this;x.clearColor(s,i,u,o)}setScissorTest(s){const{gl:i,scissorEnabled:u}=this;s!==u&&(s?i.enable(i.SCISSOR_TEST):i.disable(i.SCISSOR_TEST),this.scissorEnabled=s)}scissor(s,i,u,o){const{gl:x,scissorX:y,scissorY:d,scissorWidth:C,scissorHeight:b}=this;(s!==y||i!==d||u!==C||o!==b)&&(x.scissor(s,i,u,o),this.scissorX=s,this.scissorY=i,this.scissorWidth=u,this.scissorHeight=o)}setBlend(s){const{gl:i,blendEnabled:u}=this;s!==u&&(s?i.enable(i.BLEND):i.disable(i.BLEND),this.blendEnabled=s)}blendFunc(s,i){const{gl:u,blendSrcRgb:o,blendDstRgb:x,blendSrcAlpha:y,blendDstAlpha:d}=this;(s!==o||i!==x||s!==y||i!==d)&&(u.blendFunc(s,i),this.blendSrcRgb=s,this.blendDstRgb=i,this.blendSrcAlpha=s,this.blendDstAlpha=i)}createBuffer(){const{gl:s}=this;return s.createBuffer()}clear(){const{gl:s}=this;s.clear(s.COLOR_BUFFER_BIT)}arrayBufferData(s,i,u){const{gl:o,boundArrayBuffer:x}=this;x!==s&&(o.bindBuffer(o.ARRAY_BUFFER,s),this.boundArrayBuffer=s),o.bufferData(o.ARRAY_BUFFER,i,u)}elementArrayBufferData(s,i,u){const{gl:o,boundElementArrayBuffer:x}=this;x!==s&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,s),this.boundElementArrayBuffer=s),o.bufferData(o.ELEMENT_ARRAY_BUFFER,i,u)}vertexAttribPointer(s,i,u,o,x,y,d){const{gl:C,boundArrayBuffer:b}=this;b!==s&&(C.bindBuffer(C.ARRAY_BUFFER,s),this.boundArrayBuffer=s),C.vertexAttribPointer(i,u,o,x,y,d)}useProgram(s){const{gl:i,curProgram:u}=this;u!==s&&(i.useProgram(s),this.curProgram=s)}setUniform(s,i,...u){const{gl:o,programUniforms:x}=this;let y=x.get(this.curProgram);y||(y=new Map,x.set(this.curProgram,y));const d=y.get(i);(!d||!qA(d,u))&&(y.set(i,u),o[s](i,...u))}getParameter(s){const{gl:i}=this;return i.getParameter(s)}drawElements(s,i,u,o){const{gl:x}=this;x.drawElements(s,i,u,o)}getExtension(s){const{gl:i}=this;return i.getExtension(s)}createVertexArray(){const{gl:s}=this;return s.createVertexArray()}bindVertexArray(s){const{gl:i}=this;i.bindVertexArray(s)}getAttribLocation(s,i){const{gl:u}=this;return u.getAttribLocation(s,i)}getUniformLocation(s,i){const{gl:u}=this;return u.getUniformLocation(s,i)}enableVertexAttribArray(s){const{gl:i}=this;i.enableVertexAttribArray(s)}disableVertexAttribArray(s){const{gl:i}=this;i.disableVertexAttribArray(s)}createShader(s){const{gl:i}=this;return i.createShader(s)}compileShader(s){const{gl:i}=this;i.compileShader(s)}attachShader(s,i){const{gl:u}=this;u.attachShader(s,i)}linkProgram(s){const{gl:i}=this;i.linkProgram(s)}deleteProgram(s){const{gl:i}=this;i.deleteProgram(s)}getShaderParameter(s,i){const{gl:u}=this;return u.getShaderParameter(s,i)}getShaderInfoLog(s){const{gl:i}=this;return i.getShaderInfoLog(s)}createProgram(){const{gl:s}=this;return s.createProgram()}getProgramParameter(s,i){const{gl:u}=this;return u.getProgramParameter(s,i)}getProgramInfoLog(s){const{gl:i}=this;return i.getProgramInfoLog(s)}shaderSource(s,i){const{gl:u}=this;u.shaderSource(s,i)}deleteShader(s){const{gl:i}=this;i.deleteShader(s)}}function qA(h,s){return h.length!==s.length?!1:h.every((i,u)=>Array.isArray(i)||i instanceof Float32Array?!1:i===s[u])}const QA=24;class ZA extends UA{constructor(i){super(i.stage);L(this,"glw");L(this,"system");L(this,"txManager");L(this,"shManager");L(this,"options");L(this,"quadBuffer",new ArrayBuffer(1024*1024*4));L(this,"fQuadBuffer",new Float32Array(this.quadBuffer));L(this,"uiQuadBuffer",new Uint32Array(this.quadBuffer));L(this,"renderOps",[]);L(this,"curBufferIdx",0);L(this,"curRenderOp",null);L(this,"renderables",[]);L(this,"defaultShader");L(this,"quadBufferCollection");L(this,"defaultTexture");const{canvas:u,clearColor:o,bufferMemory:x}=i;this.options=i,this.txManager=i.txManager,this.shManager=i.shManager,this.defaultTexture=new ff(this.txManager),this.defaultTexture.once("loaded",()=>{this.stage.requestRender()});const y=yA(u,i.contextSpy),d=this.glw=new YA(y),C=Ti(o);d.viewport(0,0,u.width,u.height),d.clearColor(C[0],C[1],C[2],C[3]),d.setBlend(!0),d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA),zA(d,x),this.system={parameters:jA(this.glw),extensions:FA(this.glw)},this.shManager.renderer=this,this.defaultShader=this.shManager.loadShader("DefaultShader").shader;const b=d.createBuffer(),I=6*Float32Array.BYTES_PER_ELEMENT;this.quadBufferCollection=new Xx([{buffer:b,attributes:{a_position:{name:"a_position",size:2,type:d.FLOAT,normalized:!1,stride:I,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:d.FLOAT,normalized:!1,stride:I,offset:2*Float32Array.BYTES_PER_ELEMENT},a_color:{name:"a_color",size:4,type:d.UNSIGNED_BYTE,normalized:!0,stride:I,offset:4*Float32Array.BYTES_PER_ELEMENT},a_textureIndex:{name:"a_textureIndex",size:1,type:d.FLOAT,normalized:!1,stride:I,offset:5*Float32Array.BYTES_PER_ELEMENT}}}])}reset(){const{glw:i}=this;this.curBufferIdx=0,this.curRenderOp=null,this.renderOps.length=0,i.setScissorTest(!1),i.clear()}getShaderManager(){return this.shManager}createCtxTexture(i){return i instanceof Pa?new GA(this.glw,i):new Vx(this.glw,i)}addQuad(i){const{fQuadBuffer:u,uiQuadBuffer:o}=this,{width:x,height:y,colorTl:d,colorTr:C,colorBl:b,colorBr:I,textureOptions:k,shader:P,shaderProps:O,alpha:v,clippingRect:N,tx:V,ty:G,ta:ie,tb:$,tc:ne,td:ee}=i;let{texture:le}=i;if(O&&Mh(O,"$dimensions")){const pe=O.$dimensions;pe.width=x,pe.height=y}le=le??this.defaultTexture;let{curBufferIdx:X,curRenderOp:oe}=this;const re={width:x,height:y},E=P||this.defaultShader;oe&&(oe.shader!==E||!RA(oe.clippingRect,N)||oe.shader!==this.defaultShader&&(!O||!oe.shader.canBatchShaderProps(oe.shaderProps,O)))&&(oe=null),oe||(this.newRenderOp(E,O,v,re,N,X),oe=this.curRenderOp);const H=(k==null?void 0:k.flipX)??!1,Q=(k==null?void 0:k.flipY)??!1;let ge=0,ae=0,q=1,Y=1;if(le instanceof Pa){const{x:pe,y:fe,width:ke,height:we}=le.props,{width:j=0,height:ye=0}=le.parentTexture.dimensions||{width:0,height:0};ge=pe/j,q=ge+ke/j,ae=fe/ye,Y=ae+we/ye,le=le.parentTexture}H&&([ge,q]=[q,ge]),Q&&([ae,Y]=[Y,ae]);const{txManager:K}=this.stage,de=K.getCtxTexture(le),ve=this.addTexture(de,X);if(oe=this.curRenderOp,$!==0||ne!==0)u[X++]=V,u[X++]=G,u[X++]=ge,u[X++]=ae,o[X++]=d,u[X++]=ve,u[X++]=V+x*ie,u[X++]=G+x*ne,u[X++]=q,u[X++]=ae,o[X++]=C,u[X++]=ve,u[X++]=V+y*$,u[X++]=G+y*ee,u[X++]=ge,u[X++]=Y,o[X++]=b,u[X++]=ve,u[X++]=V+x*ie+y*$,u[X++]=G+x*ne+y*ee,u[X++]=q,u[X++]=Y,o[X++]=I,u[X++]=ve;else{const pe=V+x*ie,fe=G+y*ee;u[X++]=V,u[X++]=G,u[X++]=ge,u[X++]=ae,o[X++]=d,u[X++]=ve,u[X++]=pe,u[X++]=G,u[X++]=q,u[X++]=ae,o[X++]=C,u[X++]=ve,u[X++]=V,u[X++]=fe,u[X++]=ge,u[X++]=Y,o[X++]=b,u[X++]=ve,u[X++]=pe,u[X++]=fe,u[X++]=q,u[X++]=Y,o[X++]=I,u[X++]=ve}oe.length+=QA,oe.numQuads++,this.curBufferIdx=X}newRenderOp(i,u,o,x,y,d){const C=new zx(this.glw,this.options,this.quadBufferCollection,i,u,o,y,x,d,0);this.curRenderOp=C,this.renderOps.push(C)}addTexture(i,u,o){const{curRenderOp:x}=this,y=x.addTexture(i);if(y===4294967295){if(o)throw new Error("Unable to add texture to render op");const{shader:d,shaderProps:C,dimensions:b,clippingRect:I,alpha:k}=x;return this.newRenderOp(d,C,k,b,I,u),this.addTexture(i,u,!0)}return y}addRenderOp(i){this.renderOps.push(i),this.curRenderOp=null}render(i="screen"){const{glw:u,quadBuffer:o}=this,x=new Float32Array(o,0,this.curBufferIdx),y=this.quadBufferCollection.getBuffer("a_position")??null;u.arrayBufferData(y,x,u.STATIC_DRAW),this.renderOps.forEach((d,C)=>{d.draw()}),this.renderables=[]}}function JA(h){return/\.(ktx|pvr)$/.test(h)}const e3=async h=>{const i=await(await fetch(h)).arrayBuffer();return h.indexOf(".ktx")!==-1?t3(i):n3(i)},t3=async h=>{const s=new DataView(h),i=s.getUint32(12)===16909060,u=[],o={glInternalFormat:s.getUint32(28,i),pixelWidth:s.getUint32(36,i),pixelHeight:s.getUint32(40,i),numberOfMipmapLevels:s.getUint32(56,i),bytesOfKeyValueData:s.getUint32(60,i)};let x=64;x+=o.bytesOfKeyValueData;for(let y=0;y{const d=h,C=new Int32Array(d,0,13),b=C[12]+52,I=new Uint8Array(d,b),k=[],P={pixelWidth:C[7],pixelHeight:C[6],numberOfMipmapLevels:C[11]||0};let O=0,v=P.pixelWidth||0,N=P.pixelHeight||0;for(let V=0;V>2)*(N+3>>2)*8,ie=new Uint8Array(d,I.byteOffset+O,G);k.push(ie),O+=G,v=v>>1,N=N>>1}return{data:{glInternalFormat:36196,mipmaps:k,width:P.pixelWidth||0,height:P.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},La=class La extends yf{constructor(i,u){super(i);L(this,"props");this.props=La.resolveDefaults(u)}hasAlphaChannel(i){return i.indexOf("image/png")!==-1}async getTextureData(){const{src:i,premultiplyAlpha:u}=this.props;if(!i)return{data:null};if(i instanceof ImageData)return{data:i,premultiplyAlpha:u};if(JA(i))return e3(i);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(i,u);if(this.txManager.hasCreateImageBitmap){const x=await(await fetch(i)).blob(),y=u??this.hasAlphaChannel(x.type);return{data:await createImageBitmap(x,{premultiplyAlpha:y?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:y}}else{const o=new Image;return o.src=i,await new Promise((x,y)=>{o.onload=()=>x(),o.onerror=()=>y(new Error("Failed to load image"))}).catch(x=>{console.error(x)}),{data:o,premultiplyAlpha:u??!0}}}static makeCacheKey(i){const u=La.resolveDefaults(i);return u.src instanceof ImageData?!1:`ImageTexture,${u.src},${u.premultiplyAlpha}`}static resolveDefaults(i){return{src:i.src??"",premultiplyAlpha:i.premultiplyAlpha??!0}}};L(La,"z$__type__Props");let Nh=La;const i3={LINE_FEED:10,CARRIAGE_RETURN:13,SPACE:32,TAB:9,ZERO_WIDTH_SPACE:8203,ZERO_WIDTH_NON_JOINER:8204,ZERO_WIDTH_JOINER:8205,LEFT_TO_RIGHT_MARK:8206,RIGHT_TO_LEFT_MARK:8207,LEFT_TO_RIGHT_EMBEDDING:8234,RIGHT_TO_LEFT_EMBEDDING:8235,POP_DIRECTIONAL_FORMATTING:8236,LEFT_TO_RIGHT_OVERRIDE:8237,RIGHT_TO_LEFT_OVERRIDE:8238,LINE_SEPARATOR:8232,PARAGRAPH_SEPARATOR:8233,OBJECT_REPLACEMENT_CHARACTER:65532,REPLACEMENT_CHARACTER:65533,ZERO_WIDTH_NO_BREAK_SPACE:65279,LEFT_TO_RIGHT_ISOLATE:8294,RIGHT_TO_LEFT_ISOLATE:8295,FIRST_STRONG_ISOLATE:8296,POP_DIRECTIONAL_ISOLATE:8297,INHIBIT_SYMMETRIC_SWAPPING:8298,ACTIVATE_SYMMETRIC_SWAPPING:8299,INHIBIT_ARABIC_FORM_SHAPING:8300,ACTIVATE_ARABIC_FORM_SHAPING:8301,NATIONAL_DIGIT_SHAPES:8302,NOMINAL_DIGIT_SHAPES:8303,LEFT_TO_RIGHT_BOUNDARY:8206,RIGHT_TO_LEFT_BOUNDARY:8207};class o3{}class r3 extends o3{constructor(i,u){super();L(this,"data");L(this,"glyphMap");L(this,"kernings");this.data=i,this.glyphMap=u;const o=this.kernings={};i.kernings.forEach(x=>{const y=x.second,d=o[y]=o[y]||{};d[x.first]=x.amount}),this.kernings=o}*shapeText(i,u){var y;let o,x;for(;(o=u.peek())&&!o.done;){const d=o.value,C=this.glyphMap.get(d);if(u.next(),C!==void 0){const b=x!==void 0?(((y=this.kernings[C.id])==null?void 0:y[x])||0)+i.letterSpacing:0;x=C.id,yield{mapped:!0,glyphId:C.id,codepoint:d,cluster:u.lastIndex,xAdvance:C.xadvance+b,yAdvance:0,xOffset:C.xoffset+b,yOffset:C.yoffset,xBearing:0,yBearing:0,width:C.width,height:C.height}}else d===i3.LINE_FEED&&(x=void 0),yield{mapped:!1,codepoint:d,cluster:u.lastIndex}}}}class Wx extends jx{constructor(i,u,o,x,y,d){super(i,u);L(this,"type");L(this,"texture");L(this,"maxCharHeight",0);L(this,"data");L(this,"shaper");L(this,"glyphMap",new Map);this.type=o,x.renderer,this.texture=x.txManager.loadTexture("ImageTexture",{src:y,premultiplyAlpha:!1},{preload:!0}),this.texture.on("loaded",()=>{this.checkLoaded()}),fetch(d).then(async C=>{this.data=await C.json();let b=0;this.data.chars.forEach(I=>{this.glyphMap.set(I.id,I);const k=I.yoffset+I.height;k>b&&(b=k)}),this.maxCharHeight=b,this.shaper=new r3(this.data,this.glyphMap),this.checkLoaded()}).catch(console.error)}getAtlasEntry(i){const u=this.glyphMap.get(i);if(u===void 0)throw new Error(`Glyph ${i} not found in font ${this.fontFamily}`);return{x:u.x,y:u.y,width:u.width,height:u.height}}checkLoaded(){this.loaded||this.texture.state==="loaded"&&this.data&&(this.loaded=!0,this.emit("loaded"))}}const s3=24;function a3(h,s,i,u,o,x,y,d,C){const b=Math.min(Math.max(y.firstLineIdx,0),d.length),I=0;let k=0;u==="middle"?k=(s-h)/2:u==="bottom"&&(k=s-h);const O=o/x+b*s+k;if(!(C&&O>=C/x))return{sdfX:I,sdfY:O,lineIndex:b}}class ka{constructor(s,i=0){L(this,"iterator");L(this,"peekBuffer",[]);L(this,"_lastIndex");this.iterator=s,this.iterator=s,this._lastIndex=i-1,this.peekBuffer=[]}next(){const s=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return s.done?this._lastIndex=-1:this._lastIndex++,s}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const s=this.iterator.next();return this.peekBuffer.push(s),s}get lastIndex(){return this._lastIndex}}function*Ma(h,s=0){let i=s;for(;i=O.y1,Rt=ae<=O.y2,ct=it&&Rt;for(;(pe=ve.next())&&!pe.done;){const he=pe.value;if(h===P.length)P.push({codepointIndex:he.cluster,maxY:Q,maxX:H});else if(h>P.length)throw new Error("Unexpected lineCache length");if(he.codepoint===32||he.codepoint===10?Y.codepointIndex!==-1&&(Y.codepointIndex=-1,We=ge):Y.codepointIndex===-1&&(Y.codepointIndex=he.cluster,Y.bufferOffset=q,Y.xStart=We),he.mapped){const _t=ge+he.xOffset+he.width;if(k!=="none"&&_t>=et&&Y.codepointIndex!==-1&&Y.codepointIndex0)if(ze){ve=K.shapeText(de,new ka(Ma(u,Y.codepointIndex),Y.codepointIndex)),q=Y.bufferOffset;break}else ve=K.shapeText(de,new ka(Ma(G,0),0)),ge=Y.xStart,q=Y.bufferOffset;else{const kt=ge+he.xOffset,Lt=ae+he.yOffset;if(ct){fe===-1&&(fe=q);const Yt=v.getAtlasEntry(he.glyphId),Te=Yt.x/v.data.common.scaleW,Ge=Yt.y/v.data.common.scaleH,qt=Yt.width/v.data.common.scaleW,Dn=Yt.height/v.data.common.scaleH;I[q++]=kt,I[q++]=Lt,I[q++]=Te,I[q++]=Ge,I[q++]=kt+he.width,I[q++]=Lt,I[q++]=Te+qt,I[q++]=Ge,I[q++]=kt,I[q++]=Lt+he.height,I[q++]=Te,I[q++]=Ge+Dn,I[q++]=kt+he.width,I[q++]=Lt+he.height,I[q++]=Te+qt,I[q++]=Ge+Dn}Q=Math.max(Q,Lt+he.height),ge+=he.xAdvance,H=Math.max(H,ge)}}else if(he.codepoint===10){if(ze)break;ve=K.shapeText(de,new ka(Ma(G,0),0)),k="none"}}fe!==-1&&(ke.push({bufferStart:fe,bufferEnd:q}),fe=-1),ge=0,ae+=ne,h++,Y.codepointIndex=-1,We=0,!N&&k==="both"&&ae>O.y2||pe&&pe.done?ye=!1:ze||(ye=!1)}if(o==="center"){const ze=k==="none"?H:ee;for(let et=0;ettypeof h=="number"?h:h3[h]||400;function p3(h,s,i,u,o){let x=dx(i);for(const y of h){const d=y[s];if(!d)continue;if(d.size===1)return console.warn(`TrFontManager: Only one font face found for family: '${s}' - will be used for all weights and styles`),d.values().next().value;const C=new Map;for(const I of d){const k=dx(I.descriptors.weight);if(k===x&&I.descriptors.style===u&&I.descriptors.stretch===o)return I;C.set(k,I)}const b=`TrFontManager: No exact match: '${s} Weight: ${x} Style: ${u} Stretch: ${o}'`;if(console.error(b),x===400&&C.has(500))return C.get(500);if(x===500&&C.has(400))return C.get(400);if(x<400){for(;x>0;){if(C.has(x))return C.get(x);x-=100}x=600}for(;x<1e3;){if(C.has(x))return C.get(x);x+=100}for(x=500;x>0;){if(C.has(x))return C.get(x);x-=100}}}const m3=Gh(p3);class $x{constructor(s){L(this,"textRenderers");this.textRenderers=s}addFontFace(s){for(const i in this.textRenderers){const u=this.textRenderers[i];u&&u.isFontFaceSupported(s)&&u.addFontFace(s)}}static resolveFontFace(s,i){const{fontFamily:u,fontWeight:o,fontStyle:x,fontStretch:y}=i;return m3(s,u,o,x,y)}}const g3={x:0,y:0,width:0,height:0};class y3 extends Ux{constructor(i){super(i);L(this,"ssdfFontFamilies",{});L(this,"msdfFontFamilies",{});L(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);L(this,"sdfShader");L(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(i,u)=>{i.props.fontFamily=u,i.trFontFace=void 0,this.invalidateLayoutCache(i)},fontWeight:(i,u)=>{i.props.fontWeight=u,i.trFontFace=void 0,this.invalidateLayoutCache(i)},fontStyle:(i,u)=>{i.props.fontStyle=u,i.trFontFace=void 0,this.invalidateLayoutCache(i)},fontStretch:(i,u)=>{i.props.fontStretch=u,i.trFontFace=void 0,this.invalidateLayoutCache(i)},fontSize:(i,u)=>{i.props.fontSize=u,this.invalidateLayoutCache(i)},text:(i,u)=>{i.props.text=u,this.invalidateLayoutCache(i)},textAlign:(i,u)=>{i.props.textAlign=u,this.invalidateLayoutCache(i)},color:(i,u)=>{i.props.color=u},x:(i,u)=>{i.props.x=u,i.elementBounds.valid&&(this.setElementBoundsX(i),!i.renderWindow.valid&&wh(i.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(i))},y:(i,u)=>{i.props.y=u,i.elementBounds.valid&&(this.setElementBoundsY(i),!i.renderWindow.valid&&wh(i.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(i))},contain:(i,u)=>{i.props.contain=u,this.invalidateLayoutCache(i)},width:(i,u)=>{i.props.width=u,i.props.contain!=="none"&&this.invalidateLayoutCache(i)},height:(i,u)=>{i.props.height=u,i.props.contain==="both"&&this.invalidateLayoutCache(i)},offsetY:(i,u)=>{i.props.offsetY=u,this.invalidateLayoutCache(i)},scrollable:(i,u)=>{i.props.scrollable=u,this.invalidateLayoutCache(i)},scrollY:(i,u)=>{i.props.scrollY=u,this.scheduleUpdateState(i)},letterSpacing:(i,u)=>{i.props.letterSpacing=u,this.invalidateLayoutCache(i)},lineHeight:(i,u)=>{i.props.lineHeight=u,this.invalidateLayoutCache(i)},maxLines:(i,u)=>{i.props.maxLines=u,this.invalidateLayoutCache(i)},textBaseline:(i,u)=>{i.props.textBaseline=u,this.invalidateLayoutCache(i)},verticalAlign:(i,u)=>{i.props.verticalAlign=u,this.invalidateLayoutCache(i)},overflowSuffix:(i,u)=>{i.props.overflowSuffix=u,this.invalidateLayoutCache(i)},debug:(i,u)=>{i.props.debug=u}}}canRenderFont(i){const{fontFamily:u}=i;return u in this.ssdfFontFamilies||u in this.msdfFontFamilies||u==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(i){return i instanceof Wx}addFontFace(i){const u=i.fontFamily,o=i.type==="ssdf"?this.ssdfFontFamilies:i.type==="msdf"?this.msdfFontFamilies:void 0;if(!o){console.warn(`Invalid font face type: ${i.type}`);return}let x=o[u];x||(x=new Set,o[u]=x),x.add(i)}createState(i){return{props:i,status:"initialState",updateScheduled:!1,emitter:new Qi,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(i){let{trFontFace:u}=i;const{textH:o,lineCache:x,debugData:y,forceFullLayoutCalc:d}=i;if(y.updateCount++,i.status==="initialState"&&this.setStatus(i,"loading"),!u&&(u=this.resolveFontFace(i.props),i.trFontFace=u,!u)){const K=`SdfTextRenderer: Could not resolve font face for family: '${i.props.fontFamily}'`;console.error(K),this.setStatus(i,"failed",new Error(K));return}if(!u.loaded){u.once("loaded",()=>{this.scheduleUpdateState(i)});return}u.data;const{text:C,fontSize:b,x:I,y:k,contain:P,width:O,height:v,lineHeight:N,verticalAlign:V,scrollable:G,overflowSuffix:ie,maxLines:$}=i.props,ne=P==="both"&&G?i.props.scrollY:0,{renderWindow:ee}=i,le=u.data.info.size,X=b/le,oe=N/X;i.distanceRange=X*u.data.distanceField.distanceRange;const re=C.length*s3;let E=i.vertexBuffer;(!E||E.length=H.x2&&k-ne+K.y1<=H.y1&&k-ne+K.y2>=H.y2){this.setStatus(i,"loaded");return}ee.valid=!1,this.setStatus(i,"loading")}const{offsetY:Q,textAlign:ge}=i.props;if(!ee.valid){if(!wh(H,this.rendererBounds))return;d3(ee,I,k,ne,N,P==="both"?H.y2-H.y1:0,H,X)}const ae=a3(le,oe,N,V,Q,X,ee,x,o);if(!ae){this.setStatus(i,"loaded");return}const{letterSpacing:q}=i.props,Y=u3(ae.lineIndex,ae.sdfX,ae.sdfY,C,ge,O,v,b,N,q,E,P,x,ee.sdf,u,d,G,ie,$);i.bufferUploaded=!1,i.bufferNumFloats=Y.bufferNumFloats,i.bufferNumQuads=Y.bufferNumQuads,i.vertexBuffer=E,i.renderWindow=ee,y.lastLayoutNumCharacters=Y.layoutNumCharacters,y.bufferSize=E.byteLength,Y.fullyProcessed&&(i.textW=Y.maxX*X,i.textH=Y.maxY*X),this.setStatus(i,"loaded")}renderQuads(i,u,o,x){var re,E;if(!i.vertexBuffer)return;const{renderer:y}=this.stage,{fontSize:d,color:C,contain:b,scrollable:I,zIndex:k,debug:P}=i.props,O=b==="both"&&I?i.props.scrollY:0,{textW:v=0,textH:N=0,distanceRange:V,vertexBuffer:G,bufferUploaded:ie,trFontFace:$,elementBounds:ne}=i;let{webGlBuffers:ee}=i;if(!ee){const H=y.glw,Q=4*Float32Array.BYTES_PER_ELEMENT,ge=H.createBuffer();i.webGlBuffers=new Xx([{buffer:ge,attributes:{a_position:{name:"a_position",size:2,type:H.FLOAT,normalized:!1,stride:Q,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:H.FLOAT,normalized:!1,stride:Q,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),i.bufferUploaded=!1,i.webGlBuffers,ee=i.webGlBuffers}if(!ie){const H=y.glw,Q=(ee==null?void 0:ee.getBuffer("a_textureCoordinate"))??null;H.arrayBufferData(Q,G,H.STATIC_DRAW),i.bufferUploaded=!0}if(I&&b==="both"){ne.valid;const H=MA(ne,g3);o.valid?(i.clippingRect.valid=!0,o=Hh(o,H,i.clippingRect)):(i.clippingRect.valid=!0,o=Bx(H,i.clippingRect))}const le=new zx(y.glw,y.options,ee,this.sdfShader,{transform:u.data,color:vA(C,x),size:d/(((re=$.data)==null?void 0:re.info.size)||0),scrollY:O,distanceRange:V,debug:P.sdfShaderDebug},x,o,{height:N,width:v},0,k),X=(E=i.trFontFace)==null?void 0:E.texture,oe=this.stage.txManager.getCtxTexture(X);le.addTexture(oe),le.length=i.bufferNumFloats,le.numQuads=i.bufferNumQuads,y.addRenderOp(le)}resolveFontFace(i){return $x.resolveFontFace(this.fontFamilyArray,i)}invalidateLayoutCache(i){i.renderWindow.valid=!1,i.elementBounds.valid=!1,i.textH=void 0,i.textW=void 0,i.lineCache=[],this.setStatus(i,"loading"),this.scheduleUpdateState(i)}setElementBoundsX(i){const{x:u,contain:o,width:x}=i.props,{elementBounds:y}=i;y.x1=u,y.x2=o!=="none"?u+x:1/0}setElementBoundsY(i){const{y:u,contain:o,height:x}=i.props,{elementBounds:y}=i;y.y1=u,y.y2=o==="both"?u+x:1/0}}class v3{}function x3(h){return h.prototype instanceof v3}async function S3(h,s){let i;try{console.log("Loading core extension",h),i=await Ox(()=>import(h),[])}catch(o){console.error(`The core extension module at '${h}' could not be loaded.`),console.error(o);return}if(!i.default){console.error(`The core extension module at '${h}' does not have a default export.`);return}const u=i.default;if(x3(u)){const o=new u;try{await o.run(s)}catch(x){console.error(`The core extension at '${h}' threw an error.`),console.error(x)}}else console.error(`The core extension at '${h}' does not extend CoreExtension.`)}function Kx(h){const s={boolean:!0,string:!0,number:!0},i=Object.keys(h);for(let u=0;u2048&&(console.warn(`Custom Data value for ${o} is too long, it will be truncated to 2048 characters`),h[o]=x.substring(0,2048)),s[y]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete h[o])}return h}class w3 extends Qi{constructor(i,u,o){super();L(this,"root",null);L(this,"driver");L(this,"canvas");L(this,"settings");L(this,"inspector",null);L(this,"nodes",new Map);L(this,"nextTextureId",1);L(this,"textureTracker");const x={appWidth:i.appWidth||1920,appHeight:i.appHeight||1080,boundsMargin:i.boundsMargin||0,deviceLogicalPixelRatio:i.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:i.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:i.clearColor??0,coreExtensionModule:i.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:i.experimental_FinalizationRegistryTextureUsageTracker??!1,textureCleanupOptions:i.textureCleanupOptions||{},fpsUpdateInterval:i.fpsUpdateInterval||0,numImageWorkers:i.numImageWorkers!==void 0?i.numImageWorkers:2,enableContextSpy:i.enableContextSpy??!1,enableInspector:i.enableInspector??!1};this.settings=x;const{appWidth:y,appHeight:d,deviceLogicalPixelRatio:C,devicePhysicalPixelRatio:b,enableInspector:I}=x,k=G=>{this.driver.releaseTexture(G)},P=x.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=P?new SA(k):new xA(k,this.settings.textureCleanupOptions);const O=y*C,v=d*C;this.driver=o;const N=document.createElement("canvas");this.canvas=N,N.width=O*b,N.height=v*b,N.style.width=`${O}px`,N.style.height=`${v}px`;let V;if(typeof u=="string"?V=document.getElementById(u):V=u,!V)throw new Error("Could not find target element");o.onCreateNode=G=>{this.nodes.set(G.id,G)},o.onBeforeDestroyNode=G=>{this.nodes.delete(G.id)},o.onFpsUpdate=G=>{this.emit("fpsUpdate",G)},o.onFrameTick=G=>{this.emit("frameTick",G)},V.appendChild(N)}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(i){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(i)):this.driver.createNode(this.resolveNodeDefaults(i))}createTextNode(i){const u=i.fontSize??16,o={...this.resolveNodeDefaults(i),text:i.text??"",textRendererOverride:i.textRendererOverride??null,fontSize:u,fontFamily:i.fontFamily??"sans-serif",fontStyle:i.fontStyle??"normal",fontWeight:i.fontWeight??"normal",fontStretch:i.fontStretch??"normal",textAlign:i.textAlign??"left",contain:i.contain??"none",scrollable:i.scrollable??!1,scrollY:i.scrollY??0,offsetY:i.offsetY??0,letterSpacing:i.letterSpacing??0,lineHeight:i.lineHeight??u,maxLines:i.maxLines??0,textBaseline:i.textBaseline??"alphabetic",verticalAlign:i.verticalAlign??"top",overflowSuffix:i.overflowSuffix??"...",debug:i.debug??{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(i){const u=i.color??4294967295,o=i.colorTl??i.colorTop??i.colorLeft??u,x=i.colorTr??i.colorTop??i.colorRight??u,y=i.colorBl??i.colorBottom??i.colorLeft??u,d=i.colorBr??i.colorBottom??i.colorRight??u,C=Kx(i.data??{});return{x:i.x??0,y:i.y??0,width:i.width??0,height:i.height??0,alpha:i.alpha??1,clipping:i.clipping??!1,color:u,colorTop:i.colorTop??u,colorBottom:i.colorBottom??u,colorLeft:i.colorLeft??u,colorRight:i.colorRight??u,colorBl:y,colorBr:d,colorTl:o,colorTr:x,zIndex:i.zIndex??0,zIndexLocked:i.zIndexLocked??0,parent:i.parent??null,texture:i.texture??null,shader:i.shader??null,src:i.src??"",scale:i.scale??null,scaleX:i.scaleX??i.scale??1,scaleY:i.scaleY??i.scale??1,mount:i.mount??0,mountX:i.mountX??i.mount??0,mountY:i.mountY??i.mount??0,pivot:i.pivot??.5,pivotX:i.pivotX??i.pivot??.5,pivotY:i.pivotY??i.pivot??.5,rotation:i.rotation??0,data:C}}destroyNode(i){return this.inspector&&this.inspector.destroyNode(i),this.driver.destroyNode(i)}createTexture(i,u,o){const x=this.nextTextureId++,y={descType:"texture",txType:i,props:u,options:{...o,id:x}};return this.textureTracker.registerTexture(y),y}createShader(i,u){return{descType:"shader",shType:i,props:u}}getNodeById(i){return this.nodes.get(i)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class T3 extends Qi{constructor(i,u,o){super();L(this,"node");L(this,"props");L(this,"settings");L(this,"propStartValues",{});L(this,"restoreValues",{});L(this,"progress",0);L(this,"delayFor",0);L(this,"timingFunction");L(this,"propsList");this.node=i,this.props=u,this.settings=o,this.propStartValues={},this.propsList=Object.keys(u),this.propsList.forEach(x=>{this.propStartValues[x]=i[x]}),this.timingFunction=x=>x,o.easing&&typeof o.easing=="string"&&(this.timingFunction=HA(o.easing)),this.delayFor=o.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(i=>{this.node[i]=this.propStartValues[i]})}reverse(){this.progress=0,Object.keys(this.props).forEach(i=>{const u=this.props[i],o=this.propStartValues[i];this.props[i]=o,this.propStartValues[i]=u}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(i,u,o){return(this.timingFunction(i)||i)*(o-u)+u}update(i){const{duration:u,loop:o,easing:x,stopMethod:y}=this.settings;if(!u){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=i;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=i/u,this.progress>1&&(this.progress=o?0:1,y)){this.emit("finished",{});return}for(let d=0;d{this.startedResolve=s}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(s=>{this.stoppedResolve=s}))}started(){this.startedResolve,this.startedResolve(this),this.startedResolve=null}finished(){this.stoppedResolve;const{loop:s,stopMethod:i}=this.animation.settings;if(i==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!s&&this.manager.unregisterAnimation(this.animation)}}const Ht=0,Gt=3,pn=6,Bt=1,Xt=4,Cn=7,li=2,ui=5,fi=8;class ci{constructor(s){L(this,"data");s?(this.data=new Float32Array(9),this.data[Ht]=s[0],this.data[Gt]=s[3],this.data[pn]=s[6],this.data[Bt]=s[1],this.data[Xt]=s[4],this.data[Cn]=s[7],this.data[li]=s[2],this.data[ui]=s[5],this.data[fi]=s[8]):this.data=new Float32Array(9)}static get temp(){return I3}static multiply(s,i,u){const o=s.data[Ht]*i.data[Ht]+s.data[Gt]*i.data[Bt]+s.data[pn]*i.data[li],x=s.data[Ht]*i.data[Gt]+s.data[Gt]*i.data[Xt]+s.data[pn]*i.data[ui],y=s.data[Ht]*i.data[pn]+s.data[Gt]*i.data[Cn]+s.data[pn]*i.data[fi],d=s.data[Bt]*i.data[Ht]+s.data[Xt]*i.data[Bt]+s.data[Cn]*i.data[li],C=s.data[Bt]*i.data[Gt]+s.data[Xt]*i.data[Xt]+s.data[Cn]*i.data[ui],b=s.data[Bt]*i.data[pn]+s.data[Xt]*i.data[Cn]+s.data[Cn]*i.data[fi],I=s.data[li]*i.data[Ht]+s.data[ui]*i.data[Bt]+s.data[fi]*i.data[li],k=s.data[li]*i.data[Gt]+s.data[ui]*i.data[Xt]+s.data[fi]*i.data[ui],P=s.data[li]*i.data[pn]+s.data[ui]*i.data[Cn]+s.data[fi]*i.data[fi];return u||(u=new ci),u.data[Ht]=o,u.data[Gt]=x,u.data[pn]=y,u.data[Bt]=d,u.data[Xt]=C,u.data[Cn]=b,u.data[li]=I,u.data[ui]=k,u.data[fi]=P,u}static identity(s){return s||(s=new ci),s.data[Ht]=1,s.data[Gt]=0,s.data[pn]=0,s.data[Bt]=0,s.data[Xt]=1,s.data[Cn]=0,s.data[li]=0,s.data[ui]=0,s.data[fi]=1,s}static translate(s,i,u){return u||(u=new ci),u.data[Ht]=1,u.data[Gt]=0,u.data[pn]=s,u.data[Bt]=0,u.data[Xt]=1,u.data[Cn]=i,u.data[li]=0,u.data[ui]=0,u.data[fi]=1,u}static scale(s,i,u){return u||(u=new ci),u.data[Ht]=s,u.data[Gt]=0,u.data[pn]=0,u.data[Bt]=0,u.data[Xt]=i,u.data[Cn]=0,u.data[li]=0,u.data[ui]=0,u.data[fi]=1,u}static rotate(s,i){const u=Math.cos(s),o=Math.sin(s);return i||(i=new ci),i.data[Ht]=u,i.data[Gt]=-o,i.data[pn]=0,i.data[Bt]=o,i.data[Xt]=u,i.data[Cn]=0,i.data[li]=0,i.data[ui]=0,i.data[fi]=1,i}static copy(s,i,u){return i||(i=new ci),i.data[0]=s.data[0],i.data[1]=s.data[1],i.data[2]=s.data[2],i.data[3]=s.data[3],i.data[4]=s.data[4],i.data[5]=s.data[5],i.data[6]=s.data[6],i.data[7]=s.data[7],i.data[8]=s.data[8],i}translate(s,i){return this.data[pn]=this.data[Ht]*s+this.data[Gt]*i+this.data[pn],this.data[Cn]=this.data[Bt]*s+this.data[Xt]*i+this.data[Cn],this}scale(s,i){return this.data[Ht]=this.data[Ht]*s,this.data[Gt]=this.data[Gt]*i,this.data[Bt]=this.data[Bt]*s,this.data[Xt]=this.data[Xt]*i,this}rotate(s){if(s===0||!(s%Math.PI*2))return this;const i=Math.cos(s),u=Math.sin(s),o=this.data[Ht]*i+this.data[Gt]*u,x=this.data[Gt]*i-this.data[Ht]*u,y=this.data[Bt]*i+this.data[Xt]*u,d=this.data[Xt]*i-this.data[Bt]*u;return this.data[Ht]=o,this.data[Gt]=x,this.data[Bt]=y,this.data[Xt]=d,this}multiply(s){return ci.multiply(this,s,this)}get tx(){return this.data[pn]}get ty(){return this.data[Cn]}get ta(){return this.data[Ht]}get tb(){return this.data[Gt]}get tc(){return this.data[Bt]}get td(){return this.data[Xt]}transformPoint(s,i){return[this.data[Ht]*s+this.data[Gt]*i+this.data[pn],this.data[Bt]*s+this.data[Xt]*i+this.data[Bt]]}}const I3=new ci,Hu=0,Gu=2,Xu=4,Wu=6,$u=1,Ku=3,Yu=5,qu=7;class cf{constructor(s){L(this,"data");this.data=new Float32Array(8),s&&(this.data[Hu]=s[Hu],this.data[Gu]=s[Gu],this.data[Xu]=s[Xu],this.data[Wu]=s[Wu],this.data[$u]=s[$u],this.data[Ku]=s[Ku],this.data[Yu]=s[Yu],this.data[qu]=s[qu])}static translate(s,i,u,o,x,y,d,C,b){return b||(b=new cf),b.data[Hu]=s,b.data[Gu]=u,b.data[Xu]=x,b.data[Wu]=d,b.data[$u]=i,b.data[Ku]=o,b.data[Yu]=y,b.data[qu]=C,b}get x1(){return this.data[Hu]}get x2(){return this.data[Gu]}get x3(){return this.data[Xu]}get x4(){return this.data[Wu]}get y1(){return this.data[$u]}get y2(){return this.data[Ku]}get y3(){return this.data[Yu]}get y4(){return this.data[qu]}}var qn;(function(h){h[h.Init=0]="Init",h[h.OutOfBounds=2]="OutOfBounds",h[h.InBounds=4]="InBounds",h[h.InViewport=8]="InViewport"})(qn||(qn={}));const Oa=new Map;Oa.set(qn.Init,"init");Oa.set(qn.OutOfBounds,"outOfBounds");Oa.set(qn.InBounds,"inBounds");Oa.set(qn.InViewport,"inViewport");var Le;(function(h){h[h.Children=1]="Children",h[h.ScaleRotate=2]="ScaleRotate",h[h.Local=4]="Local",h[h.Global=8]="Global",h[h.Clipping=16]="Clipping",h[h.CalculatedZIndex=32]="CalculatedZIndex",h[h.ZIndexSortedChildren=64]="ZIndexSortedChildren",h[h.PremultipliedColors=128]="PremultipliedColors",h[h.WorldAlpha=256]="WorldAlpha",h[h.None=0]="None",h[h.All=511]="All"})(Le||(Le={}));class Xh extends Qi{constructor(i,u){super();L(this,"stage");L(this,"children",[]);L(this,"props");L(this,"updateType",Le.All);L(this,"globalTransform");L(this,"scaleRotateTransform");L(this,"localTransform");L(this,"renderCoords");L(this,"renderBound");L(this,"strictBound");L(this,"preloadBound");L(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});L(this,"isRenderable",!1);L(this,"renderState",qn.Init);L(this,"worldAlpha",1);L(this,"premultipliedColorTl",0);L(this,"premultipliedColorTr",0);L(this,"premultipliedColorBl",0);L(this,"premultipliedColorBr",0);L(this,"calcZIndex",0);L(this,"onTextureLoaded",(i,u)=>{this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:u})});L(this,"onTextureFailed",(i,u)=>{this.emit("failed",{type:"texture",error:u})});this.stage=i,this.props={...u,parent:null},this.parent=u.parent,this.updateScaleRotateTransform()}loadTexture(i,u,o=null){this.props.texture&&this.unloadTexture();const{txManager:x}=this.stage,y=x.loadTexture(i,u,o);this.props.texture=y,this.props.textureOptions=o,this.updateIsRenderable(),queueMicrotask(()=>{y.state==="loaded"?this.onTextureLoaded(y,y.dimensions):y.state==="failed"&&this.onTextureFailed(y,y.error),y.on("loaded",this.onTextureLoaded),y.on("failed",this.onTextureFailed)})}unloadTexture(){this.props.texture&&(this.props.texture.off("loaded",this.onTextureLoaded),this.props.texture.off("failed",this.onTextureFailed)),this.props.texture=null,this.props.textureOptions=null,this.updateIsRenderable()}loadShader(i,u){const o=this.stage.renderer.getShaderManager(),{shader:x,props:y}=o.loadShader(i,u);this.props.shader=x,this.props.shaderProps=y,this.updateIsRenderable()}setUpdateType(i){this.updateType|=i;const u=this.props.parent;u&&!(u.updateType&Le.Children)&&u.setUpdateType(Le.Children)}sortChildren(){this.children.sort((i,u)=>i.calcZIndex-u.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=ci.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){this.scaleRotateTransform;const i=this.props.pivotX*this.props.width,u=this.props.pivotY*this.props.height,o=this.props.mountX*this.props.width,x=this.props.mountY*this.props.height;this.localTransform=ci.translate(i-o+this.props.x,u-x+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-i,-u),this.setUpdateType(Le.Global)}update(i,u){this.updateType&Le.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(Le.Local)),this.updateType&Le.Local&&(this.updateLocalTransform(),this.setUpdateType(Le.Global));const o=this.props.parent;let x=Le.None;this.updateType&Le.Global&&(this.localTransform,this.globalTransform=ci.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),o&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.updateRenderState(),this.setUpdateType(Le.Clipping|Le.Children),x|=Le.Global),this.updateType&Le.Clipping&&(this.calculateClippingRect(u),this.setUpdateType(Le.Children),x|=Le.Clipping),this.updateType&Le.WorldAlpha&&(o?this.worldAlpha=o.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(Le.Children|Le.PremultipliedColors),x|=Le.WorldAlpha),this.updateType&Le.PremultipliedColors&&(this.premultipliedColorTl=Ea(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=Ea(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=Ea(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=Ea(this.props.colorBr,this.worldAlpha,!0)),this.updateIsRenderable(),this.setUpdateType(Le.Children),x|=Le.PremultipliedColors),o&&this.updateType&Le.CalculatedZIndex&&(this.calculateZIndex(),o.setUpdateType(Le.ZIndexSortedChildren)),this.updateType&Le.Children&&this.children.length&&this.children.forEach(y=>{y.setUpdateType(x),y.updateType!==0&&y.update(i,this.clippingRect)}),this.updateType&Le.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(){this.clippingRect,this.renderBound;const i=this.clippingRect.width||this.stage.root.width,u=this.clippingRect.height||this.stage.root.height;this.strictBound=go(this.clippingRect.x,this.clippingRect.y,i,u,this.strictBound);const o=this.stage.boundsMargin;return this.preloadBound=go(this.clippingRect.x-o[3],this.clippingRect.y-o[0],this.clippingRect.x+i+o[1],this.clippingRect.y+u+o[2],this.preloadBound),rx(this.renderBound,this.strictBound)?qn.InViewport:rx(this.renderBound,this.preloadBound)?qn.InBounds:qn.OutOfBounds}updateRenderState(){const i=this.checkRenderBounds();if(i!==this.renderState){const u=this.renderState;this.renderState=i,u===qn.InViewport&&this.emit("outOfViewPort",{previous:u,current:i});const o=Oa.get(i);this.emit(o,{previous:u,current:i})}this.updateIsRenderable()}setRenderState(i){i!==this.renderState&&(this.renderState=i,this.emit(qn[i]))}updateIsRenderable(){if(!this.checkRenderProps())return this.isRenderable=!1;this.isRenderable=this.renderState>qn.OutOfBounds}calculateRenderCoords(){const{width:i,height:u,globalTransform:o}=this,{tx:x,ty:y,ta:d,tb:C,tc:b,td:I}=o;if(C===0&&b===0){const k=x,P=x+i*d,O=y,v=y+u*I;this.renderCoords=cf.translate(k,O,P,O,P,v,k,v,this.renderCoords)}else this.renderCoords=cf.translate(x,y,x+i*d,y+i*b,x+i*d+u*C,y+i*b+u*I,x+u*C,y+u*I,this.renderCoords)}updateBoundingRect(){const{renderCoords:i,globalTransform:u}=this,{tb:o,tc:x}=u,{x1:y,y1:d,x3:C,y3:b}=i;if(o===0||x===0)this.renderBound=go(y,d,C,b,this.renderBound);else{const{x2:I,x4:k,y2:P,y4:O}=i;this.renderBound=go(Math.min(y,I,C,k),Math.min(d,P,b,O),Math.max(y,I,C,k),Math.max(d,P,b,O),this.renderBound)}}calculateClippingRect(i){this.globalTransform;const{clippingRect:u,props:o,globalTransform:x}=this,{clipping:y}=o,d=x.tb!==0||x.tc!==0;y&&!d?(u.x=x.tx,u.y=x.ty,u.width=this.width*x.ta,u.height=this.height*x.td,u.valid=!0):u.valid=!1,i.valid&&u.valid?Hh(i,u,u):i.valid&&(Bx(i,u),u.valid=!0)}calculateZIndex(){var y,d;const i=this.props,u=i.zIndex||0,o=((y=i.parent)==null?void 0:y.zIndex)||0;let x=u;(d=i.parent)!=null&&d.zIndexLocked&&(x=u{u.setUpdateType(Le.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(i){this.props.zIndex=i,this.setUpdateType(Le.CalculatedZIndex|Le.Children),this.children.forEach(u=>{u.setUpdateType(Le.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(i){const u=this.props.parent;if(u!==i){if(this.props.parent=i,u){const o=u.children.indexOf(this);u.children.splice(o,1),u.setUpdateType(Le.Children|Le.ZIndexSortedChildren)}i&&(i.children.push(this),this.setUpdateType(Le.All),i.setUpdateType(Le.Children|Le.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}let E3=1;function Wh(){return E3++}class Ph extends Qi{constructor(i,u,o,x){super();L(this,"rendererMain");L(this,"stage");L(this,"id");L(this,"coreNode");L(this,"_children",[]);L(this,"_src","");L(this,"_parent",null);L(this,"_texture",null);L(this,"_shader",null);L(this,"_data",{});L(this,"onTextureLoaded",(i,u)=>{this.emit("loaded",u)});L(this,"onTextureFailed",(i,u)=>{this.emit("failed",u)});L(this,"onOutOfBounds",(i,u)=>{this.emit("outOfBounds",u)});L(this,"onInBounds",(i,u)=>{this.emit("inBounds",u)});L(this,"onOutOfViewport",(i,u)=>{this.emit("outOfViewport",u)});L(this,"onInViewport",(i,u)=>{this.emit("inViewport",u)});this.rendererMain=u,this.stage=o,this.id=(x==null?void 0:x.id)??Wh(),this.coreNode=x||new Xh(this.stage,{id:this.id,x:i.x,y:i.y,width:i.width,height:i.height,alpha:i.alpha,clipping:i.clipping,color:i.color,colorTop:i.colorTop,colorBottom:i.colorBottom,colorLeft:i.colorLeft,colorRight:i.colorRight,colorTl:i.colorTl,colorTr:i.colorTr,colorBl:i.colorBl,colorBr:i.colorBr,zIndex:i.zIndex,zIndexLocked:i.zIndexLocked,scaleX:i.scaleX,scaleY:i.scaleY,mountX:i.mountX,mountY:i.mountY,mount:i.mount,pivot:i.pivot,pivotX:i.pivotX,pivotY:i.pivotY,rotation:i.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=i.parent,this.shader=i.shader,this.texture=i.texture,this.src=i.src,this._data=i.data}get x(){return this.coreNode.x}set x(i){this.coreNode.x=i}get y(){return this.coreNode.y}set y(i){this.coreNode.y=i}get width(){return this.coreNode.width}set width(i){this.coreNode.width=i}get height(){return this.coreNode.height}set height(i){this.coreNode.height=i}get alpha(){return this.coreNode.alpha}set alpha(i){this.coreNode.alpha=i}get clipping(){return this.coreNode.clipping}set clipping(i){this.coreNode.clipping=i}get color(){return this.coreNode.color}set color(i){this.coreNode.color=i}get colorTop(){return this.coreNode.colorTop}set colorTop(i){this.coreNode.colorTop=i}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(i){this.coreNode.colorBottom=i}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(i){this.coreNode.colorLeft=i}get colorRight(){return this.coreNode.colorRight}set colorRight(i){this.coreNode.colorRight=i}get colorTl(){return this.coreNode.colorTl}set colorTl(i){this.coreNode.colorTl=i}get colorTr(){return this.coreNode.colorTr}set colorTr(i){this.coreNode.colorTr=i}get colorBl(){return this.coreNode.colorBl}set colorBl(i){this.coreNode.colorBl=i}get colorBr(){return this.coreNode.colorBr}set colorBr(i){this.coreNode.colorBr=i}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(i){i!==null&&(this.coreNode.scaleX=i,this.coreNode.scaleY=i)}get scaleX(){return this.coreNode.scaleX}set scaleX(i){this.coreNode.scaleX=i}get scaleY(){return this.coreNode.scaleY}set scaleY(i){this.coreNode.scaleY=i}get mount(){return this.coreNode.mount}set mount(i){this.coreNode.mount=i}get mountX(){return this.coreNode.mountX}set mountX(i){this.coreNode.mountX=i}get mountY(){return this.coreNode.mountY}set mountY(i){this.coreNode.mountY=i}get pivot(){return this.coreNode.pivot}set pivot(i){this.coreNode.pivot=i}get pivotX(){return this.coreNode.pivotX}set pivotX(i){this.coreNode.pivotX=i}get pivotY(){return this.coreNode.pivotY}set pivotY(i){this.coreNode.pivotY=i}get rotation(){return this.coreNode.rotation}set rotation(i){this.coreNode.rotation=i}get parent(){return this._parent}set parent(i){const u=this._parent;if(this._parent=i,this.coreNode.parent=(i==null?void 0:i.coreNode)??null,u){const o=u.children.indexOf(this);u.children.splice(o,1)}i&&i.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(i){this.coreNode.zIndex=i}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(i){this.coreNode.zIndexLocked=i}get src(){return this._src}set src(i){if(this._src!==i){if(this._src=i,!i){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:i})}}get texture(){return this._texture}set texture(i){this._texture!==i&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),i&&this.rendererMain.textureTracker.incrementTextureRefCount(i),this._texture=i,i?this.coreNode.loadTexture(i.txType,i.props,i.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(i){this._shader!==i&&(this._shader=i,i&&this.coreNode.loadShader(i.shType,i.props))}get data(){return this._data}set data(i){this._data=Kx(i)}destroy(){var u;this.emit("beforeDestroy",{}),this.coreNode.destroy();const i=this.children.length;for(let o=0;o{const s=()=>{if(h.updateAnimations(),!h.hasSceneUpdates()){setTimeout(s,16.666666666666668);return}h.drawFrame(),requestAnimationFrame(s)};requestAnimationFrame(s)},A3=()=>performance?performance.now():Date.now();class k3{constructor(){L(this,"activeAnimations",new Set)}registerAnimation(s){this.activeAnimations.add(s)}unregisterAnimation(s){this.activeAnimations.delete(s)}update(s){this.activeAnimations.forEach(i=>{i.update(s)})}}class M3{constructor(s){L(this,"imageWorkersEnabled",!0);L(this,"messageManager",{});L(this,"workers",[]);L(this,"workerIndex",0);this.workers=this.createWorkers(s),this.workers.forEach(i=>{i.onmessage=this.handleMessage.bind(this)})}handleMessage(s){const{src:i,data:u,error:o}=s.data,x=this.messageManager[i];if(x){const[y,d]=x;delete this.messageManager[i],o?d(new Error(o)):y(u)}}createWorkers(s=1){const i=` + function hasAlphaChannel(mimeType) { + return (mimeType.indexOf("image/png") !== -1); + } + + async function getImage(src, premultiplyAlpha) { + return new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', src, true); + xhr.responseType = 'blob'; + + xhr.onload = function() { + if (xhr.status === 200) { + var blob = xhr.response; + var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type); + + createImageBitmap(blob, { + premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none', + colorSpaceConversion: 'none', + imageOrientation: 'none' + }).then(function(data) { + resolve({ data: data, premultiplyAlpha: premultiplyAlpha }); + }).catch(function(error) { + reject(error); + }); + } else { + reject(new Error('Failed to load image: ' + xhr.statusText)); + } + }; + + xhr.onerror = function() { + reject(new Error('Network error occurred while trying to fetch the image.')); + }; + + xhr.send(); + }); + } + + self.onmessage = async (event) => { + var src = event.data.src; + var premultiplyAlpha = event.data.premultiplyAlpha; + + getImage(src, premultiplyAlpha) + .then(function(data) { + self.postMessage({ src: src, data: data }, [data.data]); + }) + .catch(function(error) { + self.postMessage({ src: src, error: error.message }); + }); + }; + `,u=new Blob([i.replace('"use strict";',"")],{type:"application/javascript"}),o=(self.URL?URL:webkitURL).createObjectURL(u),x=[];for(let y=0;y{try{if(this.workers){const x=this.convertUrlToAbsolute(s);this.messageManager[x]=[u,o],this.getNextWorker().postMessage({src:x,premultiplyAlpha:i})}}catch(x){o(x)}})}}const Na=class Na extends yf{constructor(i,u){super(i);L(this,"props");this.props=Na.resolveDefaults(u)}async getTextureData(){const{width:i,height:u}=this.props,o=i*u*4,x=new Uint8ClampedArray(o);for(let y=0;y{this.txManager;const v=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",v.idCacheSize),console.log("Texture Key Cache Size: ",v.keyCacheSize)},1e3),this.renderer=new ZA({stage:this,canvas:u,pixelRatio:i.devicePhysicalPixelRatio*i.deviceLogicalPixelRatio,clearColor:o??4278190080,bufferMemory:_3,txManager:this.txManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new DA(this),sdf:new y3(this)},this.fontManager=new $x(this.textRenderers);const O=new Xh(this,{id:x,x:0,y:0,width:d,height:C,alpha:1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=O,b3(this)}updateAnimations(){const{animationManager:i}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=A3(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),i.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){var x,y;const{renderer:i,renderRequested:u}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),i==null||i.reset(),this.addQuads(this.root),i==null||i.render(),u&&(this.renderRequested=!1);const{fpsUpdateInterval:o}=this.options;if(o&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=o)){const d=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:d,contextSpyData:((x=this.contextSpy)==null?void 0:x.getData())??null}),(y=this.contextSpy)==null||y.reset()}}addQuads(i){this.renderer&&i.globalTransform,i.isRenderable&&i.renderQuads(this.renderer);for(let u=0;u{const{contain:i}=this,u=this.trState.props.width,o=this.trState.props.height,x=this.trState.textW||0,y=this.trState.textH||0;i==="both"?(this.props.width=u,this.props.height=o):i==="width"?(this.props.width=u,this.props.height=y):i==="none"&&(this.props.width=x,this.props.height=y),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});L(this,"onTextFailed",(i,u)=>{this.emit("failed",{type:"text",error:u})});this._textRendererOverride=u.textRendererOverride;const{resolvedTextRenderer:o,textRendererState:x}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:u.width,height:u.height,textAlign:u.textAlign,color:u.color,zIndex:u.zIndex,contain:u.contain,scrollable:u.scrollable,scrollY:u.scrollY,offsetY:u.offsetY,letterSpacing:u.letterSpacing,debug:u.debug,fontFamily:u.fontFamily,fontSize:u.fontSize,fontStretch:u.fontStretch,fontStyle:u.fontStyle,fontWeight:u.fontWeight,text:u.text,lineHeight:u.lineHeight,maxLines:u.maxLines,textBaseline:u.textBaseline,verticalAlign:u.verticalAlign,overflowSuffix:u.overflowSuffix},void 0);this.textRenderer=o,this.trState=x}get width(){return this.props.width}set width(i){this.props.width=i,this.textRenderer.set.width(this.trState,i),this.contain==="none"&&this.setUpdateType(Le.Local)}get height(){return this.props.height}set height(i){this.props.height=i,this.textRenderer.set.height(this.trState,i),this.contain!=="both"&&this.setUpdateType(Le.Local)}get color(){return this.trState.props.color}set color(i){this.textRenderer.set.color(this.trState,i)}get text(){return this.trState.props.text}set text(i){this.textRenderer.set.text(this.trState,i)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(i){this._textRendererOverride=i;const{resolvedTextRenderer:u,textRendererState:o}=this.resolveTextRendererAndState(this.trState.props,this.trState);this.textRenderer=u,this.trState=o}get fontSize(){return this.trState.props.fontSize}set fontSize(i){this.textRenderer.set.fontSize(this.trState,i)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(i){this.textRenderer.set.fontFamily(this.trState,i)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(i){this.textRenderer.set.fontStretch(this.trState,i)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(i){this.textRenderer.set.fontStyle(this.trState,i)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(i){this.textRenderer.set.fontWeight(this.trState,i)}get textAlign(){return this.trState.props.textAlign}set textAlign(i){this.textRenderer.set.textAlign(this.trState,i)}get contain(){return this.trState.props.contain}set contain(i){this.textRenderer.set.contain(this.trState,i)}get scrollable(){return this.trState.props.scrollable}set scrollable(i){this.textRenderer.set.scrollable(this.trState,i)}get scrollY(){return this.trState.props.scrollY}set scrollY(i){this.textRenderer.set.scrollY(this.trState,i)}get offsetY(){return this.trState.props.offsetY}set offsetY(i){this.textRenderer.set.offsetY(this.trState,i)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(i){this.textRenderer.set.letterSpacing(this.trState,i)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(i){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,i)}get maxLines(){return this.trState.props.maxLines}set maxLines(i){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,i)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(i){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,i)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(i){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,i)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(i){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,i)}get debug(){return this.trState.props.debug}set debug(i){this.textRenderer.set.debug(this.trState,i)}update(i,u){super.update(i,u),this.globalTransform,this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}renderQuads(i){this.globalTransform,this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}resolveTextRendererAndState(i,u){const o=this.stage.resolveTextRenderer(i,this._textRendererOverride),x=o.createState(i);return u&&["loading","loaded","failed"].forEach(d=>{u.emitter.off(d)}),x.emitter.on("loaded",this.onTextLoaded),x.emitter.on("failed",this.onTextFailed),o.scheduleUpdateState(x),{resolvedTextRenderer:o,textRendererState:x}}}class P3 extends Ph{constructor(s,i,u){super(s,i,u,new N3(u,{id:Wh(),x:s.x,y:s.y,width:s.width,height:s.height,alpha:s.alpha,clipping:s.clipping,color:s.color,colorTop:s.colorTop,colorBottom:s.colorBottom,colorLeft:s.colorLeft,colorRight:s.colorRight,colorTl:s.colorTl,colorTr:s.colorTr,colorBl:s.colorBl,colorBr:s.colorBr,zIndex:s.zIndex,zIndexLocked:s.zIndexLocked,scaleX:s.scaleX,scaleY:s.scaleY,mountX:s.mountX,mountY:s.mountY,mount:s.mount,pivot:s.pivot,pivotX:s.pivotX,pivotY:s.pivotY,rotation:s.rotation,text:s.text,fontSize:s.fontSize,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStretch:s.fontStretch,fontStyle:s.fontStyle,contain:s.contain,scrollable:s.scrollable,letterSpacing:s.letterSpacing,textAlign:s.textAlign,scrollY:s.scrollY,offsetY:s.offsetY,textRendererOverride:s.textRendererOverride,lineHeight:s.lineHeight,maxLines:s.maxLines,textBaseline:s.textBaseline,verticalAlign:s.verticalAlign,overflowSuffix:s.overflowSuffix,debug:s.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(s){this.coreNode.text=s}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(s){this.coreNode.textRendererOverride=s}get fontSize(){return this.coreNode.fontSize}set fontSize(s){this.coreNode.fontSize=s}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(s){this.coreNode.fontFamily=s}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(s){this.coreNode.fontWeight=s}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(s){this.coreNode.fontStretch=s}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(s){this.coreNode.fontStyle=s}get textAlign(){return this.coreNode.textAlign}set textAlign(s){this.coreNode.textAlign=s}get contain(){return this.coreNode.contain}set contain(s){this.coreNode.contain=s}get scrollable(){return this.coreNode.scrollable}set scrollable(s){this.coreNode.scrollable=s}get scrollY(){return this.coreNode.scrollY}set scrollY(s){this.coreNode.scrollY=s}get offsetY(){return this.coreNode.offsetY}set offsetY(s){this.coreNode.offsetY=s}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(s){this.coreNode.letterSpacing=s}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(s){s&&(this.coreNode.lineHeight=s)}get maxLines(){return this.coreNode.maxLines}set maxLines(s){s&&(this.coreNode.maxLines=s)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(s){s&&(this.coreNode.textBaseline=s)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(s){s&&(this.coreNode.verticalAlign=s)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(s){s&&(this.coreNode.overflowSuffix=s)}get debug(){return this.coreNode.debug}set debug(s){this.coreNode.debug=s}}class D3{constructor(){L(this,"root",null);L(this,"stage",null);L(this,"rendererMain",null)}async init(s,i,u){this.stage=new L3({rootId:Wh(),appWidth:i.appWidth,appHeight:i.appHeight,boundsMargin:i.boundsMargin,deviceLogicalPixelRatio:i.deviceLogicalPixelRatio,devicePhysicalPixelRatio:i.devicePhysicalPixelRatio,clearColor:i.clearColor,canvas:u,fpsUpdateInterval:i.fpsUpdateInterval,enableContextSpy:i.enableContextSpy,numImageWorkers:i.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=s,this.stage.root;const o=new Ph(s.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=o,o.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,o)),this.onCreateNode(o),i.coreExtensionModule&&await S3(i.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(x,y)=>{this.onFpsUpdate(y)}),this.stage.on("frameTick",(x,y)=>{this.onFrameTick(y)})}createNode(s){this.rendererMain,this.stage;const i=new Ph(s,this.rendererMain,this.stage);return i.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,i)),this.onCreateNode(i),i}createTextNode(s){this.rendererMain,this.stage;const i=new P3(s,this.rendererMain,this.stage);return i.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,i)),this.onCreateNode(i),i}destroyNode(s){s.destroy()}releaseTexture(s){const{stage:i}=this;i.txManager.removeTextureIdFromCache(s)}getRootNode(){return this.root,this.root}onCreateNode(s){throw new Error("Method not implemented.")}onBeforeDestroyNode(s){throw new Error("Method not implemented.")}onFpsUpdate(s){throw new Error("Method not implemented.")}onFrameTick(s){throw new Error("Method not implemented.")}}const hx={hd:.66666667,"720p":.66666667,720:.66666667,fhd:1,fullhd:1,"1080p":1,1080:1,"4k":2,"2160p":2,2160:2},O3=()=>{const h=di.driver.stage;Ko.get("fonts",[]).forEach(s=>{s.type==="sdf"||s.type==="msdf"?(!s.png&&s.file&&(s.png=s.file.replace(/\.[^.]+$/,`.${s.type}.png`)),!s.json&&s.file&&(s.json=s.file.replace(/\.[^.]+$/,`.${s.type}.json`)),h.fontManager.addFontFace(new Wx(s.family,{},s.type,h,s.png,s.json))):s.type==="web"&&h.fontManager.addFontFace(new Fx(s.family,{},s.file))})};let di;const U3=(h,s,i)=>{Ko.set(i),dA();const u=new D3;"fontLoader"in i&&At.warn("\n\nStarting version 0.9.0 of Blits, the Launch setting `fontLoader` is not supported / required anymore.\nYou can remove the option from your `src/index.js`-file. And you can safely remove the file `src/fontLoader.js` from your project.\n "),di=new w3({appWidth:i.w||1920,appHeight:i.h||1080,fpsUpdateInterval:i.fpsInterval||1e3,deviceLogicalPixelRatio:i.pixelRatio||hx[i.screenResolution]||hx[window.innerHeight]||1,numImageWorkers:"webWorkersLimit"in i?i.webWorkersLimit:window.navigator.hardwareConcurrency||2,clearColor:i.canvasColor&&ls.normalize(i.canvasColor)||0,enableInspector:i.inspector||!1,boundsMargin:i.viewportMargin||0},s,u);const o=()=>{let x=h();x.quit=()=>{At.info("Closing App"),x.destroy(),x=null,di=null}};di.init().then(O3).then(o)},B3=` +---------------------------------------------------------------------------------------------------- +Deprecation notice: +---------------------------------------------------------------------------------------------------- + +The property for defining a transition easing function has been renamed from "function" to "easing". + +Please update your code like the example below to keep your custom easing function. + +Before: + +After: + +`,j3=h=>typeof h=="object"&&"transition"in h,Qu=h=>typeof h=="string"&&h.startsWith("{")&&h.endsWith("}"),Zu=h=>JSON.parse(h.replace(/'/g,'"').replace(/([\w-_]+)\s*:/g,'"$1":')),Zr=function(h,s){return typeof h=="string"&&h.endsWith("%")?this.element.node._parent[s]*(parseFloat(h)/100):h},Oh=h=>{if(typeof h=="object"&&h.constructor===Object){if("value"in h)return h.value;if("transition"in h)return Oh(h.transition)}return h},Yx={set parent(h){this._props.parent=h==="root"?di.root:h.node,this._set.add("parent")},set rotation(h){this._props.rotation=h*(Math.PI/180),this._set.add("rotation")},set w(h){this._props.width=Zr.call(this,h,"width"),this._set.add("width")},set width(h){this._props.width=Zr.call(this,h,"width"),this._set.add("width")},set h(h){this._props.height=Zr.call(this,h,"height"),this._set.add("height")},set height(h){this._props.height=Zr.call(this,h,"height"),this._set.add("height")},set x(h){this._props.x=Zr.call(this,h,"width"),this._set.add("x")},set y(h){this._props.y=Zr.call(this,h,"height"),this._set.add("y")},set z(h){this._props.zIndex=h,this._set.add("zIndex")},set zIndex(h){this._props.zIndex=h,this._set.add("zIndex")},set color(h){if(typeof h=="object"||Qu(h)&&(h=Zu(h))){const s={top:"colorTop",bottom:"colorBottom",left:"colorLeft",right:"colorRight"};this._props.color=0,Object.entries(h).forEach(i=>{this._props[s[i[0]]]=ls.normalize(i[1]),this._set.add(s[i[0]])})}else this._props.color=ls.normalize(h);this._set.add("color")},set src(h){this._props.src=h,this._set.has("color")||(this._props.color=4294967295),this._set.add("src")},set texture(h){this._props.texture=h,this._set.has("color")||(this._props.color=4294967295),this._set.add("texture")},set mount(h){typeof h=="object"||Qu(h)&&(h=Zu(h))?("x"in h&&(this._props.mountX=h.x,this._set.add("mountX")),"y"in h&&(this._props.mountY=h.y,this._set.add("mountY"))):(this._props.mountX=this._props.mountY=h,this._set.add("mountX"),this._set.add("mountY"))},set pivot(h){typeof h=="object"||Qu(h)&&(h=Zu(h))?("x"in h&&(this._set.add("pivotX"),this._props.pivotX=h.x),"y"in h&&(this._set.add("pivotY"),this._props.pivotY=h.y)):(this._props.pivotX=this._props.pivotY=h,this._set.add("pivotX"),this._set.add("pivotY"))},set scale(h){typeof h=="object"||Qu(h)&&(h=Zu(h))?("x"in h&&(this._set.add("scaleX"),this._props.scaleX=h.x),"y"in h&&(this._set.add("scaleX"),this._props.scaleY=h.y)):(this._props.scale=h,this._set.add("scale"))},set show(h){this._props.alpha=h?1:0},set alpha(h){this._props.alpha=h,this._set.add("alpha")},set text(h){this._props.text=h.toString()},set effects(h){this._props.shader=di.createShader("DynamicShader",{effects:h.map(s=>(s.props&&s.props.color&&(s.props.color=ls.normalize(s.props.color)),s))}),this._set.add("effects")},set clipping(h){this._props.clipping=h},set fontFamily(h){this._props.fontFamily=h},set fontSize(h){this._props.fontSize=h},set wordWrap(h){this._props.width=h},set contain(h){this._props.contain=h},set maxLines(h){this._props.maxLines=h},set overflowSuffix(h){this._props.overflowSuffix=h===!1?" ":h===!0?void 0:h},set letterSpacing(h){this._props.letterSpacing=h||1},set lineHeight(h){this._props.lineHeight=h},set textAlign(h){this._props.textAlign=h}},F3={defaults:{},populate(h){const s={...this.defaults,...this.config,...h};this.initData=h,s[te.isSlot]&&(this[te.isSlot]=!0),this.props.element=this;for(const[i,u]of Object.entries(s)){const o=Object.getOwnPropertyDescriptor(Yx,i);o&&o.set&&u!==void 0&&(this.props[i]=Oh(u))}!s.__textnode&&!this.props._set.has("color")&&(this.props._props.color=this.props._set.has("src")||this.props._set.has("texture")?4294967295:0),this.node=s.__textnode?di.createTextNode(this.props._props):di.createNode(this.props._props),s["@loaded"]&&this.node.on("loaded",(i,{type:u,dimensions:o})=>{s["@loaded"]({w:o.width,h:o.height,type:u},this)}),s["@error"]&&this.node.on("failed",(i,u)=>{s["@error"](u,this)})},set(h,s){if(s===void 0)return;const i=new Set(this.props._set);this.props._props={},this.props[h]=Oh(s);for(const[u,o]of Object.entries(this.props._props)){if(j3(s)&&i.has(u))return this.animate(u,o,s.transition);this.node[u]=o}},animate(h,s,i){if(this.node[h]===s)return Promise.resolve();this.scheduledTransitions[h]&&this.scheduledTransitions[h].f.state==="running"&&(this.scheduledTransitions[h].f.pause(),this.node[h]=this.scheduledTransitions[h].v);const u={};u[h]=s;const o=this.node.animate(u,{duration:typeof i=="object"&&"duration"in i?i.duration:300,easing:typeof i=="object"?"function"in i?At.warn(B3):"easing"in i?i.easing:"ease":"ease",delay:typeof i=="object"&&"delay"in i?i.delay:0});return new Promise(x=>{const y=this.node[h];this.scheduledTransitions[h]={v:u[h],f:()=>{try{o.start().waitUntilStarted().then(d=>{i.start&&typeof i.start=="function"&&i.start.call(this.component,this,h,y),d.waitUntilStopped().then(()=>delete this.scheduledTransitions[h]).then(()=>{i.end&&typeof i.end=="function"&&i.end.call(this.component,this,h,this.node[h])}).then(x)})}catch(d){At.error(d)}}},this.scheduledTransitions[h].f()})},destroy(){At.debug("Deleting Node",this.nodeId),Object.values(this.scheduledTransitions).forEach(h=>{clearTimeout(h.timeout)}),this.node.destroy()},get nodeId(){return this.node&&this.node.id},get ref(){return this.initData.ref||null}},qx=(h,s)=>Object.assign(Object.create(F3),{props:Object.assign(Object.create(Yx),{_props:{},_set:new Set}),node:null,scheduledTransitions:{},initData:{},config:h,component:s}),px={};let z3=0;const V3=h=>`BlitsComponent::${h}_${px[h]=(px[h]||0)+1}`,H3=()=>++z3,xo={},Qx=(h,s,i,u=[])=>{xo[s]&&xo[s][h]&&xo[s][h].apply(i,u)},G3=(h,s,i)=>{const u=te[h];xo[s]&&xo[s][u]&&xo[s][u].apply(i)},X3=(h={},s)=>{xo[s]={},[...Object.keys(h),...Object.getOwnPropertySymbols(h)].forEach(u=>{typeof h[u]=="function"&&(xo[s][u]=h[u])})};let Wo=null,$h=!1;const W3=()=>{$h=!0},$3=()=>{$h=!1;for(let h=0;h{if(Wo){if($h){sf.push({target:h,key:s,currentEffect:Wo});return}let i=Uh.get(h);i||(i=new Map,Uh.set(h,i));let u=i.get(s);u||(u=new Set,i.set(s,u)),u.add(Wo)}},Da=(h,s,i=!1)=>{const u=Uh.get(h);if(!u)return;const o=u.get(s);o&&o.forEach(x=>{x(i)})},mx=h=>{Wo=h,Wo(),Wo=null},af=["push","pop","shift","unshift","splice"],Zx=new WeakMap,K3=h=>Zx.get(h),Bh=h=>{const s=h&&h[te.raw];return s?Bh(s):h},Jx=(h,s=null,i)=>{const u=K3(h);if(u)return u;const o={get(y,d,C){return d===te.raw?h:Array.isArray(y)?af.indexOf(d)>-1?function(...b){W3();const I=y[d].apply(this,b);return $3(),Da(s,i),I}:Reflect.get(y,d,C):typeof y[d]=="object"&&y[d]!==null?(Array.isArray(y[d])&&df(y,d),Jx(y[d],y,d)):(df(y,d),Reflect.get(y,d,C))},set(y,d,C,b){const I=Bh(y[d]),k=Bh(C);let P=!0;return I!==k&&(P=Reflect.set(y,d,C,b)),P&&I!==C&&Da(y,d,!0),P}},x=new Proxy(h,o);return Zx.set(h,x),x},e2=h=>(Object.keys(h).forEach(s=>{let i=h[s];if(h[s]!==null&&typeof h[s]=="object"){if(Object.getPrototypeOf(h[s])===Object.prototype)return e2(h[s]);if(Array.isArray(h[s]))for(let u=0;us==="defineProperty"?e2(h):Jx(h),Y3={before:{prop:"alpha",value:0},in:{prop:"alpha",value:1,duration:200},out:{prop:"alpha",value:0,duration:100}},yo=window.speechSynthesis,q3=()=>(window.navigator||{}).userAgent||"",yx=()=>/android/i.test(q3());let t2=!1,hf=null;const Kh=()=>hf&&clearTimeout(hf),jh=h=>{if(!h||hf)return Kh();yo.pause(),yo.resume(),hf=setTimeout(()=>{jh(h)},5e3)},ss={lang:"en-US",pitch:1,rate:1,voice:null,volume:1},Q3=()=>{ss.voice=yo.getVoices()[0],t2=!0},Z3=(h,s)=>{const i=new SpeechSynthesisUtterance(s.value);i.lang=s.lang||ss.lang,i.pitch=s.pitch||ss.pitch,i.rate=s.rate||ss.rate,i.voice=s.voice||ss.voice,i.volume=s.volume||ss.volume,i.onstart=()=>{yx()||jh(i),h.onstart()},i.onresume=()=>{yx()||jh(i),h.onresume()},i.onpause=()=>{h.onpause()},i.onend=()=>{h.onend()},i.onerror=()=>{Kh(),h.onerror()},yo.speak(i)},lf={speak(h){t2||Q3(),this.cancel(),Z3(this,h)},resume(){yo.resume()},pause(){yo.pause()},cancel(){yo.cancel(),Kh()},getVoices(){return yo.getVoices()},onend(){},onerror(){},onstart(){},onresume(){},onpause(){}};let vx;const Yh=(h,s="off")=>{clearTimeout(vx),lf.cancel(),s==="assertive"?lf.speak({value:h}):vx=setTimeout(()=>{lf.speak({value:h})},400)},J3=h=>Yh(h,"polite"),e4=h=>Yh(h,"assertive"),t4=()=>{lf.cancel()},n2={speak:Yh,polite:J3,assertive:e4,stop:t4};let qh,pf=!1;const i2=new WeakMap,o2=[];let r2={},s2={},Fh=!1,a2;const n4=()=>(document.location.hash||"/").replace(/^#/,""),xx=h=>h.replace(/^\/+|\/+$/g,"").toLowerCase(),i4=(h,s=[])=>{const i=h;h=xx(h);let u=!1,o=0;for(;!u&&o-1){const y=[...x.path.matchAll(/:([^\s/]+)/gi)];let d=x.path;y.reverse().forEach(b=>{d=d.substring(0,b.index)+"([^\\s/]+)"+d.substring(b.index+b[0].length)});const C=i.match(new RegExp(`${d}`,"i"));C&&(x.params=y.reverse().reduce((b,I,k)=>(b[I[1]]=C[k+1],b),{}),u=x)}else if(x.path.endsWith("*")){const y=new RegExp(x.path.replace(/\/?\*/,"/?([^\\s]*)"),"i"),d=h.match(y);d&&(d[1]&&(x.params={path:d[1]}),u=x)}o++}return u&&(u.options={...u.options,...r2},qh=u),u},o4=async function(){if(pf=!0,this.parent[te.routes]){const h=qh,s=n4(),i=i4(s,this.parent[te.routes]);if(i){Fh===!1&&h&&h.options.inHistory===!0&&o2.push(h),"transition"in i||(i.transition=Y3),typeof i.transition=="function"&&(i.transition=i.transition(h,i));let u,{view:o,focus:x}=i2.get(i)||{};if(o)u=o[te.wrapper];else{u=qx({parent:this[te.children][0]}),u.populate({}),u.set("w","100%"),u.set("h","100%");const d={...this[te.props],...i.params,...s2};o=await i.component({props:d},u,this),o[Symbol.toStringTag]==="Module"&&(o.default&&typeof o.default=="function"?o=o.default({props:d},u,this):At.error("Dynamic import doesn't have a default export or default is not a function")),typeof o=="function"&&(o=o({props:d},u,this))}if(this[te.children].push(o),a2=vo.get(),x?vo.set(x):vo.set(o),i.transition.before)if(Array.isArray(i.transition.before))for(let d=0;d{if(i)if(Array.isArray(i))for(let u=0;ui?h.animate(s.prop,s.value,s):h.set(s.prop,s.value),Qh=(h,s={},i={})=>{s2=s,r2=i,window.location.hash=`#${h}`},l2=()=>{const h=o2.pop();if(h){Fh=!0;let s=h.path;return s.indexOf(":")>-1&&Object.keys(h.params).forEach(i=>{s=s.replace(`:${i}`,h.params[i])}),Qh(s),!0}else return!1},Ch={navigate:o4,to:Qh,back:l2};let po=null,Ju=[],Sx;const vo={_hold:!1,set hold(h){this._hold=h},get hold(){return this._hold},get(){return po},set(h,s){clearTimeout(Sx),po&&po!==h.parent&&po.unfocus(),Ju.reverse().forEach(i=>i.unfocus()),h!==po&&(Sx=setTimeout(()=>{po=h,po.lifecycle.state="focus",s instanceof KeyboardEvent?document.dispatchEvent(new KeyboardEvent("keydown",s)):Ju=[]},this.hold?50:0))},input(h,s){if(pf===!0)return;Ju=u2([po],h);const i=Ju.shift();i&&(i[te.inputEvents][h]?i[te.inputEvents][h].call(i,s):i[te.inputEvents].any&&i[te.inputEvents].any.call(i,s))}},u2=(h,s)=>h[0][te.inputEvents]&&(typeof h[0][te.inputEvents][s]=="function"||typeof h[0][te.inputEvents].any=="function")?h:h[0].parent?(h.unshift(h[0].parent),u2(h,s)):[],s4=()=>So("Image",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){i[0].set("imageSource",s.imageSource)}],context:{}},props:["src"],computed:{imageSource(){return/^(?:https?:)?\/\//i.test(this.src)?this.src:`${window.location.protocol}//${window.location.host}/${this.src}`}}}),a4=()=>So("Circle",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){i[0].set("color",s.color)},function(s,i,u){i[0].set("w",s.size)},function(s,i,u){i[0].set("h",s.size)},function(s,i,u){i[0].set("effects",[s.shader("radius",{radius:s.radius})])}],context:{}},props:[{key:"size",default:40},"color"],computed:{radius(){return this.size/2}}});let Ih;const l4=()=>So("RouterView",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return x.w=s.node.width*(100/100),x.height=s.node.height*(100/100),o[0].nodeId||o[0].populate(x),o},effects:[],context:{}},state(){return{activeView:null}},hooks:{ready(){Ih=()=>Ch.navigate.apply(this),Ch.navigate.apply(this),window.addEventListener("hashchange",Ih)},destroy(){window.removeEventListener("hashchange",Ih,!1)},focus(){this.activeView&&this.activeView.focus()}},input:{back(){Ch.back()}}}),u4=()=>So("Sprite",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return x.w=i.w,x.h=i.h,o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){i[0].set("texture",s.texture)},function(s,i,u){i[0].set("color",s.color)}],context:{}},props:["image","map","frame","w","h","color"],state(){return{spriteTexture:!1}},computed:{texture(){const h="frames"in this.map?Object.assign({},this.map.defaults||{},this.map.frames[this.frame]):this.map[this.frame];if(this.spriteTexture&&h)return this[te.renderer].createTexture("SubTexture",{texture:this.spriteTexture,x:h.x,y:h.y,width:h.w,height:h.h})}},hooks:{ready(){this.spriteTexture=this[te.renderer].createTexture("ImageTexture",{src:this.image})}}}),f4=()=>So("Text",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return x.__textnode=!0,x.fontFamily=i.font,x.letterSpacing=i.letterspacing,x.lineHeight=i._lineheight,x.stretch=i.stretch,x.contain=i._contain,x["@loaded"]=i["@loaded"]&&i["@loaded"].bind(i),x["@error"]=i["@error"]&&i["@error"].bind(i),o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){i[0].set("text",s.content)},function(s,i,u){i[0].set("fontSize",s.size)},function(s,i,u){i[0].set("color",s.color)},function(s,i,u){i[0].set("style",s.style)},function(s,i,u){i[0].set("weight",s.weight)},function(s,i,u){i[0].set("wordWrap",s.wordwrap)},function(s,i,u){i[0].set("maxLines",s.maxlines)},function(s,i,u){i[0].set("h",s.maxheight)},function(s,i,u){i[0].set("textAlign",s.align)},function(s,i,u){i[0].set("overflowSuffix",s.textoverflow)}],context:{}},props:["content",{key:"font",default:Ko.get("defaultFont","lato")},{key:"size",cast:Number,default:32},"style","color","weight","letterspacing","stretch","align","wordwrap","maxlines","maxheight","lineheight","contain","@loaded","@error","textoverflow"],computed:{_contain(){return this.contain||(this.maxheight&&this.wordwrap?"both":this.wordwrap?"width":"none")},_lineheight(){return this.lineheight!==void 0?this.lineheight:this.size}}}),c4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaMAAAAbCAYAAADRe+BYAAAAAXNSR0IArs4c6QAAGn9JREFUeF7tXQ1UVdWePxcWFg7ZA0sym5n0Tmk1z4+0YeVU4yo1h1jvPVBo1ETU8QvTdJlhsmKpi0he5jyXX0CKIWkpl3OlME3RGcdJixVEas+nJtq0sMwXN/kIgbxn1m+791n/ezifF0hr7lmrVV3O2Wfv/977//v//h/7uKTQFZJASAIhCYQkEJLADZaAy+j9iqIMkCRpliRJGeSeWkmSClwuV25X9VtRlOGSJI3m7wq6bd5Osqa/6OZSSZJKXC4X+h7UpSgKZABZQCbiKuHt4t+dvri8z5GG3E77rChKtCRJ9TY647ht0aaiKJAx5LCK/4Y5m23jneotiqJgvg84eCaYd6Cf4h/xqgo+ZwUO3h1wK5cx1oIYP/5eJUlSrsvl6tRakGUZbYr9tjQpKanL9lmw4w09F5LAzyUBXTDiih3KAspN76pwuVxjgu2koijYzGibbmg0tzQYoOPt5Zv0xydJ0hiXywWlYfviAAE5UBDSPu9YUep1QFEUvAdKWlyOAYPP26c2BhhM25ivXZo+4lWOxx8EGEHRw6iwdXHjQbu26LMwTlJsNUZusrEeHMuC9kGWZRgSYs/VJiUluZ32MXR/SAK/VAkYgREsdKaAKysr58fFxd0Di23Xrl1ScjKMTUl69913906cODHe6cDNFAVvcyAUHCxNO21rGIVv7969ufHx8djQGatWrZIyMq4bmj6frz4mJuYRSZJsMyQNQJS43e4/19bWThk+fPiA/Px8afhwkDpJKikpKUhJSXHEDujY9MDU7XZLtbWsq1BItvrMWQsAQxozZoxUUQEiYHrZapuzAYCcAOWSnJycv2RmZjZThiRJklMZGDIkyHfWLNgskkRkgXVh+g4N0NUuWLCgYN26dcMHDBiQjPUr5qyoqOjttLS0KVYC0syTui/q6+tX9O7duyU6OnoV2h09+rodEexakGUZG4vNnbiWL18uHT9+HCBsay84Gcv/13s9Hs/osLAwlZW7XK6KxMRES8Pa6/Ue4GuLic7v94+ZMGGC5Qb7OeXcXWMrLS3Nd7lcs+zKKtgxdwAjupnPnDlTNHDgwN9RhlRfXy9FR0dDuUsxMTGYDMuJ1GxooAO0eNWgQYNaX3jhhcfnzp2bhHuWLl0q5eayfWd7AyqKoro2uIJ5jr7vwIEDqqKIi4trqKysfJK7VUxlRl1ebW1tX99yyy3tlCFB+aBtroCklJQUS0Wp90L+Hii5ABYaJBhBtowRjBgxQqqqsiSCdsEISpJZIZcuXVp01113PaPHkKyAQmf8umCE9XXu3Dm2zgCoAFZ+YXGYMiS6HjZt2iSnp6eztYVLZ87gVrPFkCjQX758+d0+ffr8k1gP6Oenn34qDRgwgBkQbrfb8VqQZVnIGCyerYX9+/dLeXl5MERuSoYky7JiU/GoLE+r1A2eh4cEIKG7gD0ez4CwsDCsxwD2qygKmGlFUlKSobtUq7A5sLgnTJhgaPDx91EX+i8CjLpqbHSeXS7XCKN5sbkWDG/TAyNVuSckJHyzZ8+evvxpbNoSRVHgDmMmK1d4toFD0wumOGH9wgruBBip7q2YmBgGkiBCXDGiv6qCnj17tlRQUGBrc5PYgJSZmTk1JyfnAd5/LPTZBESowoTV7igeoSiKUEK1ly5dCo+Njf17vKezYERkAU0etAVHjZPm5uaiqKioxylD4uMNun0DgFbnbNq0aXveeustgB8TixVLpOuTsEPMeYqiKFgXTKkQkLM1ZxTkNPuCrf8rV678qVevXi+QfWGrXdxfXl4e3dbWxmJ933zzzbHz588/OnLkSKmpqUlKT0/Hv9U51CjGDq482hZk1aNHjxEJCQlsU3D2JYxB/MRiXTQG6Pf7TRUzna9uBCPxmg5xM1mW1bVhovxKkpKSdI0MPTAqLi6WvF6voWGt907OWtGFTu2vzipw+nx3jU0wo6+++qpu0aJF/bg+cURC7IxTD4xUK5goRNUipco9JSUFbgks9Bg7L9MBo+EbN24M7wwzIm3S4K+qCKgSIcpphB12xNumSQEqkFElDTYHVgewtmtp42ZqbX/99dfTzp07VzBq1KiIToCRaii4XOrUOhlrh2mk8nv66acr9u/fL+JatpWtk7VBmaLf778QHh5+O2cKtli4jvGB17O+0jkrKCiQYJzYnTMKcnpuQ+pqdWL0cJBQFeybb7557Nq1a4/OmTOHiS0vLw8MKYBpERYlaS1VjbsvNykpiS1MCyWOdc1csMGCUVKSSkDNprvW6/XWCncXUejqM2PHjpXE2PFjdXX10uzsbOYu0Shb39mzZ7MyMjL+BkYt5mTKlCnS4MGDWVunTp0qy8zM/IO2M3oKGyx8yZIlbNvpGTuyLMNFfd0nz69fChh18dgoE+6UXtFbJHpgpDINsulU9DfY7EF3jG7iYNx0ZFA0AQDg6KOK7erVqy2RkZGR/H4nihRgdD14cZ1xCaUGxT/A7/dfue+++27n8R1bCpMDEdoVcRgE1OH2SxaxhyCZEZMBxrpt27ZIEXPhfQdQMjeGQ3BgG7G9vb0pPj4+Cm2KuCFvJ6ikE6M+0PWgcbPZskDpnGNOYDBVVVWNURQFCheGFlMqRL625syAcdF9gTXCKD5Zx7b2hVB2iqL8MHXq1N+gjW3btjERcWWCdQdFyRiO1+udxfsjcateBSuakQcFi+fvvffeD9asWSPiu779+/e/lZeX9wRkAcUPABDX3Llz4Yo1VMx03igz6iowQvsUkI4fPy4tX76csU8Kwh6PZ/uOHTsm0/5ERUVJGzdulPBvXDNmzCjz+XwBgETBCOOMjY1l93JZdfDyeL3e4YqisKSgpqam+qioKGZ43+xg1E1jE8aurT3jRM/gXrtgpFoMBmDEXHhOX86Vst4mDtb1F9AFatVv3br18PTp0/+F32BLsdHGqDIiv1ekpqZuKy4uvq45rrs8bGV9kb75EhMTs3bv3r2OxreCBCM1wG4yFylOUpAVRWHWUEtLy9XIyMhbDdqtgoUezPxrn1EUhY0BivmOO+6Q6uvroZxtuVZFW8gqrKurK+vXrx9cCtqrdv369fnz588XSQG24jt03RNWRfeFyswJGFkaPVTZnT9//sTixYt/iw5v2LDhWN++fR8lilJti7riuLJWvRMiI6+xsVEFtldffbXsgQce+D3a2rdvn1xQUBBAY15//XUGzri6AIwMy0XQPo0ZGSl0Oj64KlNTU/FoCgdaxuBIP1WXPH7Pz88vvfPOO9n4Vq9eLR09ejRgT1Iw8nq9UmJiIhs3/ru4uBhuy4B1TMF93759344bN+4u3K/Xd85KA8oJYPwhlkXjWBp21sHVKsuyuo9RNpGYmGjL9d9dY6P9SUpKYvNL3cUYn6IoyHjNQKID2XCOyhO6CowsN52RoupCZhTwCtruTz/9VBMREYFYDNhIUG5FPTACW5gxY0ZzcXExzCu0i4VsmflG3UU8KwtZXQOqq6svDRs2jJlqQYIR3D0Zp0+fDp88eXKvqqoq9KkkIyNjFjILcTU3N7c9+eSTz1ZWVu62Ag9t7RMSItLT05EEMn7o0KGLNm/eHC+y04LNrqR9oG7L3bt3y4mJiUJpOlpfkK/f738zLCzsXu0YwWRnzpz5fWFhocgMtIxDoQ1togkHHGbUUKMH9zph+FTZbdiwofbgwYPol2/Lli0ro6Oj/8NIUVKWAGXd1NQ0AgpVWPFQnAUFBVCcPlmWsSYZI+T34j9VJU4B4mYAI3ROh3VV8PExNzF3XzKQ0jGEsc9pUhDzlHAlqmbTgVUOGTKEufbAJDB2vofVxAkB7j/88EPF+++/PxquQD0wEnEVkz0VoJg196t/o6wX4zKKfem9h4JRV47NCox4yAPrtkMpEIBq/PjxtrJsf5VgpEnv9Y0cOXLXsWPHhEA6y7ryR48ezZS7UMRz5sw5kZ+fD3eAJRBxxSYsHzAKUF6AiK+xsfHPUVFR/xwsGJEF2oEh0VRpriwt2SwFI7i8kLDiu54hwhYdssfgBsLFs8g6WJZWgKcBI9XVOnDgwK/PnDnzt1yJqC4qq/ZorVVTU9Op+Ph46ciRIw+gr5CBcIOmpqZeKi4uRualbbclBUudfqhxFx4zYrhklZYtlJ3f729IS0vrBSYAJVReXj5bJDUQdqC6/ajS4gxgqSzLeJZZHcJFB9esLMvMWqVsScTRONipacs3AxhRpUpiHj6v17tUuCcJIBkZE2r8lAKWVmE3NzerMSrOdlQmRe997733Prxy5crTemDk9XrB5JmLFvt50aJF2y9cuBDvdruTX3zxRdUVuGrVqvmVlZXrcR/YX0tLy/+Gh4dHYX7nzZt34Z133nm4ra1NgKjv+eefb7p48SL2AC5Lg6w7xob9oQEj1hmPx+MOCwtTMwyPHj0qFRYWFtXX168cMWLE6wsWLEgS7tL09PQV33777XKrvfurAyNt4eeMGTNyCgsLl3FBdEpZ8jbYIqeK+LPPPrv28MMPT7TjqqTunldeeSU9Ozt7I28XGw1WH7P8gmFGZLIZQ+LgiEVcpRO8D4hD6C0UCkaaFGvIkbXb0tJy4tZbb/1HPM8z+CwVsMG71DTv48ePVwwZMkQkSjhqj9aGpaamphYXF2MTMBZEU8YvXLjg79+//7/ZmTPa39OnT//hiy++2JmYmNgDv6N+LTo6+mVaxE3S6k37TpMNvvzyy7+89NJLg/i7mKFA2Y/W5URdWTwFvMrr9SJOOhqxjdTUVJFUBPcWq186ffp0w8svv9yLv0NlC13BjEwUTYAbyspNx2WCPcYMHsKAmK7XnFIhtbe3/xgREbHS7/eXmKVni/5pXVlgW1u2bGmJiIiI1KbSE/biS01NdT333HO/EfE16qaTZRl9ZWtsyZIlQ8+dO4d1xS64AQWA8bGoa4IaFHh3ZGTk3scff/xf8dwnn3wi5+bmCs+ArcSo7hibHTAirBJ6gTEkjFm4QPnatXSH282m040Z8Ww6W6httFi70k2nPTli/fr1GSQ2YNuNZoXg4u/Nzc0Xe/bsyVLfefaaKdtwcFyP2oUDBw6kjh07tthun0zkjEXCLJmSkhIW2Ley3Gl/CRiBAcBCZ24PnSwzR/Ed0V/aTkpKSnVJScnD/G+23GikHRbjunr1al1kZKSIGang2djY+D8a9mnJEHVk2qFAVRSEX7lyBSAXxksMTK1ZCjZW8wvLc/Xq1QEuZvG8SAEXSQ8ffPDBic2bNyP2xO4XLi+iNALm6EaBkdWYz58/v3Px4sXP8vtUQ3LatGn5Dz744CwR5yLtwNNQYBZjoQqbg4/0xhtvnOjfv/9vCQNl7lfBWuvq6vbMnz//GZrsYRDvUuPfnHGneL3eZE2yCbqrrumdO3f+V0REhIhls6EoinJh/PjxIovUtt7qrrFZMSMetxTTwEpfOBtnLJ0YFKoBpDf3pnVGBGwoGKmp38QCtKSQ3Q1G3IpH1guzqD766KOcxx57TDAi/GQrs4koNXFmHn4S7rSAYYhgOwEjU+alc/6c1X5Ehp0tMOLMR6Sf4rimgIJBg7RmS2uFxyCG8yJn9Dcgk4YyEVLbZLrotIOmcvnuu++qY2NjBRBZ9k+nLQZGFy9ebOnXr5/InqTrV5stGhR4kvMUkylLPnLkSOUTTzyBgljTNaepB7JcB7iBx3tU8KTMCjECYYFnZGQ0nD17FgyIyY+mJvM2AuawK8DIRjYdk7PNotdcj8fTtmPHjudJHEKrY5DOnYF4Dyxw4RLie7EiIiIiRdRXUeHqKewJEyaUTZo0iSV4CCtelmXIiDHKDRs27Dl48OAz8+bNa33qqaduwW96YJSVlfV2bGxsXN++ff9Bb0J55iP+pI6FJrCIZwoLCzeXl5f/O/9/256B7hqbAzBS9xItJbCI76miMj2BwSBriJ2fxY/XUV0BTt0dROl3OptOe2bY559/vm7o0KGIB4iAWjDZc1Ds4py3DmfxUQV64sSJ1sGDB7NFqpehqLMwdQ80NcimE4+bjkETz+hwRhplHiTAbkn/deq0VEWmiSn91e1238E765TNqP7911577ciyZctQWIsrmHlTa0K4q5PWhqmB7aampvbbbruN1XTZKaY1QwsKyMOGDfugpqYGadSmblC6WQmT6fAa6u7gykydMw5oLMYAqx4KuaGhoTYtLU0kZwgLX83044ohAIApWHVBzMhIVB3ASK/OyOBhoyxVcTDycIASAFHUGV2+fPnU7NmzH9S2p6eweVwNbUULBsrBCL/5ONBG5+Tk1A4aNIjJloJReXl5VVtbG4ycgFok7bsJGAUADJU/Ya943JGh1B1js+OmI8xI1Q0GYGRKWozOplM3NGdH4vQFlRWtXbv2xMKFC1kaqlPWQSeps2467blptbW1f3S73TNNLCozvRLwN8p8uMWbybOnsOigQNniW7hw4V/Xrl0rFLFpait/geoyoy/sDBihHdpfnt32Co8XqUWVyACMjY2N4m4kS+ZBs8jwzMSJE5s+/PDD2zgQqXU7mZmZp8gpFbaZEW2fH7skArZB1TLQmByy/yZNmoREiL/j71EPevV4PHXJycnCjecIPMWcaU9z52vvJf53U9lSBUSSDTqsTQAqUq9xkWC+Kl+tq+/QoUOH169fD7eP6tKjabgALQDS0aNHWRvaLDAKRvw5duaV3llsBnVGwaR2G+1JgBDWgVWSifBiZGzatCla1A5lZWVVnjx5cpxwKeMlVGETJYokD8iLHWQJGWzatIn1iRfPMta0devW6ttvv52xdgpGpaWlySKlGQkMa9asOYWkGbBnWjOlB0Z6ZxISJuHIGOuOsd0MYIQiR/gyr1ePdbzAFLAAYGk6Qm9tU10ARnaOB1Ff6yJHE1ihEmJQ165dOxQeHi6Cvh0eqaury7/nnntEpl6nEiSohR1MAgP629TUtCcqKup6JV/Hy5eQkPCfe/bsEYFRWy4Aq1O2OyMDCh55eXmVc+fOFS6uzrh+aSZVBym0trYevvvuu4fwGiZHqf4mspjtcrlgSYvEC0OAo66Z77//vm7mzJkCFHXnQwe41Pu0yoy46ALYhCZl2HDpUzAqLS1V60b0UnS7EIwsla5mnIYpz+vWrSvv168fOz6KK/UAo8ZIYXu9XtTKME8IQEowrJUrV1bU1NRgTpHNJxKBAsBIlmVWAI9n09LSahoaGoYKAdsAI5H56vvxxx979ezZM1xk1zU2Nva30lH0790xthsORhggLN+cnJz/XrZsGS0cFN8zAhBdP77bRvqqmUBvZjDicohesWLFl1OmTIlBbIBcBTt27KiZPHnyDELPg1ag/F16p184strBANDfBQsWxCB7jFxLR40aFXP48GFhuVtm09GHy8rKhp09e/bo4sWLaeFrRWVlZVlcXFxaMDKgrKgzRa566ys7O/vtuLi4ySKVm99TVV9fX967d2+kzwvQsGSHtH0NGDGr3e12R+I0d3JmnynIUzZSWlpat337drHHdOOa1OUhMudEcSZ11RHmhC53UPBZWVlTwsLCtglFC5der169cIIGTnRg8jBiRgZFnurxMCRmFAwzsgQjTYzN16NHD7deTIjGpHj8B8NS5WqgsBlg0dgIHmpvbz/57LPPskxRpOhzI4LJSZNNB8Yd3dra2jpx4kThrkebSLfH/SyQr2VGdF5ramq2f/zxx5PFUUh8nh3pk+4Y200BRnwCADqm3zVyemq3CTDRTBRbFrumLUcMyWZsR7zCSg5ssdo9fcEMnPnf6NFGjsCIzBs2iNF3mNj3nRyczye6bPVRvM7IgM5fMPOvJ1ZThiQynqgbx8bcWMnCiQKhcUk7rJqekaYFLno2oxnbo/uMjYWewECKYum6o3KkRw/9bGCEflLlDeA9dOjQsb17947E3wBWra2tq4S7rKGhgdVt8clS58RCYQfokLKysi+LiopEMgKKilfpnKsHEINMmXFOAAdZjAEfYaRg5PF4SkidTu3UqVPDGhsb783Ly/P36dMnDG1xlovCbXHQrehfLXebBtQ1dsfYuhqMPB5PBf+EB3RTQCGw3fiG9rh2xpCsCvocbGzcejODEfonzqjTfvEVckBQ2cqv7UQcnQUj2l8sYEqR2Jdv7Rbo6nRa7wvAGLuQg5NxintpxbwjxmbjZVi7mDP64UIofsigM98JosAs4hqQAVMcNi+q5O0AMFWWWkZH+9PBKOBuLgT5MW7ci7ZGI74i4iN1dXUN8+fPFwqcghFtW2UxP6ebTshz+/btf4qMjGSno5tcvqysrLMnT54ULl81A9FMYWs/FUGAmRkKRjVSvL7LyGhXi6H5kUPo9lKv1ztaABs9oikhIWHz9OnTWSYdZ7oU/E2PCeqOsXU1GPFTNMSHUANq0OyAkc19FbotJIGQBG5GCXAlK8oe6NEzOARUTcQpKir6qqysjH3ChJ/EbwqsNwKM0LGHHnoo9/77739Jm9INpt/Y2Fg+depU1P6JM9ICYtpmChttC8DR1M4wQ8GsYBcyrqqqOvDII48wb0R7ezsKaVf06NGjQJykITLlZs2aJY8bN47FbTWuQFbD5/V6dwmg4myKsWDBDFHUvGTJkphLly7hfhgHjCF119gcpHZbZtNRZrRz5876nTt3IpGGyTcERjej9gj1KSSBLpQAXFjt7e2qgtNruqGh4d20tDRxcoAdlyFthn5awK5OoezfMmak02fqljSSlpk7Wsts6fd5tNmu2uxQo76bufNVhqRx6dO2qIuX9k87H/S4Lz23cHeMjZE14voX80xlpZcBS9k87Sv1hDGDwe7C6cKtEWoqJIGQBG6EBHJzc5+vr69/Iy4ujh1lxK+S6urqquzsbLgzRZ2Mk7gXmrkRYIT3QhGKWiPqirbjhjVT2GhbgISegjUDUvQJCph+dgZuU7jb2AcUSQYyVch6BgB9D3XjqrEjyozInHbX2LoSjCAnjI/FjkLM6EZohNA7QxK4cRKAwlZrrQy64Si78MYNJfTmX5sEQszo1zajofGEJGAtAfHNHVGegSeQ2CD+sW4hdEdIAl0sgRAYdbFAQ82FJBCSQEgCIQk4l0AIjJzLLPRESAIhCYQkEJJAF0vg/wBMng85iZWBHAAAAABJRU5ErkJggg==",d4=()=>So("FPScounter",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.y=15,y.x=20,o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};o[2].nodeId||o[2].populate(d);const C=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[2],o[3]||(o[3]=this.element({parent:s||"root"},i));const b={};if(b.image=i.image,b.w=43,b.h=25,b.map=i.sprite,b.frame="fps",typeof C<"u")for(let Ce in C.config.props)delete b[C.config.props[Ce]];o[3].nodeId||o[3].populate(b),s=o[3];const I={};if(I.image=i.image,I.w=43,I.h=25,I.map=i.sprite,I.frame="fps",!o[4]){const Ce=I.is||"Sprite";o[4]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:I},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}s=o[2],o[5]||(o[5]=this.element({parent:s||"root"},i));const k={};k.x=58,k.y=2,o[5].nodeId||o[5].populate(k);const P=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[5],o[6]||(o[6]=this.element({parent:s||"root"},i));const O={};if(O.image=i.image,O.x=0,O.h=20,O.w=20,O.map=i.sprite,typeof P<"u")for(let Ce in P.config.props)delete O[P.config.props[Ce]];o[6].nodeId||o[6].populate(O),s=o[6];const v={};if(v.image=i.image,v.x=0,v.h=20,v.w=20,v.map=i.sprite,v.frame=i.fps[0],!o[7]){const Ce=v.is||"Sprite";o[7]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:v},o[6],i),o[7][Symbol.for("slots")][0]?(s=o[7][Symbol.for("slots")][0],i=o[7]):s=o[7][Symbol.for("children")][0]}const N=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[5],o[8]||(o[8]=this.element({parent:s||"root"},i));const V={};if(V.image=i.image,V.x=18,V.h=20,V.w=20,V.map=i.sprite,typeof N<"u")for(let Ce in N.config.props)delete V[N.config.props[Ce]];o[8].nodeId||o[8].populate(V),s=o[8];const G={};if(G.image=i.image,G.x=18,G.h=20,G.w=20,G.map=i.sprite,G.frame=i.fps[1],!o[9]){const Ce=G.is||"Sprite";o[9]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:G},o[8],i),o[9][Symbol.for("slots")][0]?(s=o[9][Symbol.for("slots")][0],i=o[9]):s=o[9][Symbol.for("children")][0]}const ie=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[5],o[10]||(o[10]=this.element({parent:s||"root"},i));const $={};if($.image=i.image,$.x=36,$.h=20,$.w=20,$.map=i.sprite,typeof ie<"u")for(let Ce in ie.config.props)delete $[ie.config.props[Ce]];o[10].nodeId||o[10].populate($),s=o[10];const ne={};if(ne.image=i.image,ne.x=36,ne.h=20,ne.w=20,ne.map=i.sprite,ne.frame=i.fps[2],!o[11]){const Ce=ne.is||"Sprite";o[11]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:ne},o[10],i),o[11][Symbol.for("slots")][0]?(s=o[11][Symbol.for("slots")][0],i=o[11]):s=o[11][Symbol.for("children")][0]}s=o[1],o[12]||(o[12]=this.element({parent:s||"root"},i));const ee={};ee.x=150,o[12].nodeId||o[12].populate(ee);const le=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[12],o[13]||(o[13]=this.element({parent:s||"root"},i));const X={};if(X.image=i.image,X.y=2,X.w=48,X.h=25,X.map=i.sprite,X.frame="avg",typeof le<"u")for(let Ce in le.config.props)delete X[le.config.props[Ce]];o[13].nodeId||o[13].populate(X),s=o[13];const oe={};if(oe.image=i.image,oe.y=2,oe.w=48,oe.h=25,oe.map=i.sprite,oe.frame="avg",!o[14]){const Ce=oe.is||"Sprite";o[14]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:oe},o[13],i),o[14][Symbol.for("slots")][0]?(s=o[14][Symbol.for("slots")][0],i=o[14]):s=o[14][Symbol.for("children")][0]}s=o[12],o[15]||(o[15]=this.element({parent:s||"root"},i));const re={};re.x=63,re.y=2,o[15].nodeId||o[15].populate(re);const E=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[15],o[16]||(o[16]=this.element({parent:s||"root"},i));const H={};if(H.image=i.image,H.x=0,H.h=20,H.w=20,H.map=i.sprite,typeof E<"u")for(let Ce in E.config.props)delete H[E.config.props[Ce]];o[16].nodeId||o[16].populate(H),s=o[16];const Q={};if(Q.image=i.image,Q.x=0,Q.h=20,Q.w=20,Q.map=i.sprite,Q.frame=i.avgFps[0],!o[17]){const Ce=Q.is||"Sprite";o[17]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:Q},o[16],i),o[17][Symbol.for("slots")][0]?(s=o[17][Symbol.for("slots")][0],i=o[17]):s=o[17][Symbol.for("children")][0]}const ge=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[15],o[18]||(o[18]=this.element({parent:s||"root"},i));const ae={};if(ae.image=i.image,ae.x=18,ae.h=20,ae.w=20,ae.map=i.sprite,typeof ge<"u")for(let Ce in ge.config.props)delete ae[ge.config.props[Ce]];o[18].nodeId||o[18].populate(ae),s=o[18];const q={};if(q.image=i.image,q.x=18,q.h=20,q.w=20,q.map=i.sprite,q.frame=i.avgFps[1],!o[19]){const Ce=q.is||"Sprite";o[19]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:q},o[18],i),o[19][Symbol.for("slots")][0]?(s=o[19][Symbol.for("slots")][0],i=o[19]):s=o[19][Symbol.for("children")][0]}const Y=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[15],o[20]||(o[20]=this.element({parent:s||"root"},i));const K={};if(K.image=i.image,K.x=36,K.h=20,K.w=20,K.map=i.sprite,typeof Y<"u")for(let Ce in Y.config.props)delete K[Y.config.props[Ce]];o[20].nodeId||o[20].populate(K),s=o[20];const de={};if(de.image=i.image,de.x=36,de.h=20,de.w=20,de.map=i.sprite,de.frame=i.avgFps[2],!o[21]){const Ce=de.is||"Sprite";o[21]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:de},o[20],i),o[21][Symbol.for("slots")][0]?(s=o[21][Symbol.for("slots")][0],i=o[21]):s=o[21][Symbol.for("children")][0]}s=o[1],o[22]||(o[22]=this.element({parent:s||"root"},i));const ve={};ve.x=0,ve.y=40,o[22].nodeId||o[22].populate(ve);const pe=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[22],o[23]||(o[23]=this.element({parent:s||"root"},i));const fe={};if(fe.image=i.image,fe.x=-2,fe.w=47,fe.h=25,fe.map=i.sprite,fe.frame="min",typeof pe<"u")for(let Ce in pe.config.props)delete fe[pe.config.props[Ce]];o[23].nodeId||o[23].populate(fe),s=o[23];const ke={};if(ke.image=i.image,ke.x=-2,ke.w=47,ke.h=25,ke.map=i.sprite,ke.frame="min",!o[24]){const Ce=ke.is||"Sprite";o[24]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:ke},o[23],i),o[24][Symbol.for("slots")][0]?(s=o[24][Symbol.for("slots")][0],i=o[24]):s=o[24][Symbol.for("children")][0]}s=o[22],o[25]||(o[25]=this.element({parent:s||"root"},i));const we={};we.x=58,we.y=2,o[25].nodeId||o[25].populate(we);const j=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[25],o[26]||(o[26]=this.element({parent:s||"root"},i));const ye={};if(ye.image=i.image,ye.x=0,ye.h=20,ye.w=20,ye.map=i.sprite,typeof j<"u")for(let Ce in j.config.props)delete ye[j.config.props[Ce]];o[26].nodeId||o[26].populate(ye),s=o[26];const ze={};if(ze.image=i.image,ze.x=0,ze.h=20,ze.w=20,ze.map=i.sprite,ze.frame=i.minFps[0],!o[27]){const Ce=ze.is||"Sprite";o[27]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:ze},o[26],i),o[27][Symbol.for("slots")][0]?(s=o[27][Symbol.for("slots")][0],i=o[27]):s=o[27][Symbol.for("children")][0]}const et=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[25],o[28]||(o[28]=this.element({parent:s||"root"},i));const We={};if(We.image=i.image,We.x=18,We.h=20,We.w=20,We.map=i.sprite,typeof et<"u")for(let Ce in et.config.props)delete We[et.config.props[Ce]];o[28].nodeId||o[28].populate(We),s=o[28];const it={};if(it.image=i.image,it.x=18,it.h=20,it.w=20,it.map=i.sprite,it.frame=i.minFps[1],!o[29]){const Ce=it.is||"Sprite";o[29]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:it},o[28],i),o[29][Symbol.for("slots")][0]?(s=o[29][Symbol.for("slots")][0],i=o[29]):s=o[29][Symbol.for("children")][0]}const Rt=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[25],o[30]||(o[30]=this.element({parent:s||"root"},i));const ct={};if(ct.image=i.image,ct.x=36,ct.h=20,ct.w=20,ct.map=i.sprite,typeof Rt<"u")for(let Ce in Rt.config.props)delete ct[Rt.config.props[Ce]];o[30].nodeId||o[30].populate(ct),s=o[30];const he={};if(he.image=i.image,he.x=36,he.h=20,he.w=20,he.map=i.sprite,he.frame=i.minFps[2],!o[31]){const Ce=he.is||"Sprite";o[31]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:he},o[30],i),o[31][Symbol.for("slots")][0]?(s=o[31][Symbol.for("slots")][0],i=o[31]):s=o[31][Symbol.for("children")][0]}s=o[1],o[32]||(o[32]=this.element({parent:s||"root"},i));const _t={};_t.x=150,_t.y=40,o[32].nodeId||o[32].populate(_t);const kt=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[32],o[33]||(o[33]=this.element({parent:s||"root"},i));const Lt={};if(Lt.image=i.image,Lt.w=53,Lt.h=25,Lt.map=i.sprite,Lt.frame="max",typeof kt<"u")for(let Ce in kt.config.props)delete Lt[kt.config.props[Ce]];o[33].nodeId||o[33].populate(Lt),s=o[33];const Yt={};if(Yt.image=i.image,Yt.w=53,Yt.h=25,Yt.map=i.sprite,Yt.frame="max",!o[34]){const Ce=Yt.is||"Sprite";o[34]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:Yt},o[33],i),o[34][Symbol.for("slots")][0]?(s=o[34][Symbol.for("slots")][0],i=o[34]):s=o[34][Symbol.for("children")][0]}s=o[32],o[35]||(o[35]=this.element({parent:s||"root"},i));const Te={};Te.x=63,Te.y=2,o[35].nodeId||o[35].populate(Te);const Ge=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[35],o[36]||(o[36]=this.element({parent:s||"root"},i));const qt={};if(qt.image=i.image,qt.x=0,qt.h=20,qt.w=20,qt.map=i.sprite,typeof Ge<"u")for(let Ce in Ge.config.props)delete qt[Ge.config.props[Ce]];o[36].nodeId||o[36].populate(qt),s=o[36];const Dn={};if(Dn.image=i.image,Dn.x=0,Dn.h=20,Dn.w=20,Dn.map=i.sprite,Dn.frame=i.maxFps[0],!o[37]){const Ce=Dn.is||"Sprite";o[37]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:Dn},o[36],i),o[37][Symbol.for("slots")][0]?(s=o[37][Symbol.for("slots")][0],i=o[37]):s=o[37][Symbol.for("children")][0]}const Ua=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[35],o[38]||(o[38]=this.element({parent:s||"root"},i));const Zi={};if(Zi.image=i.image,Zi.x=18,Zi.h=20,Zi.w=20,Zi.map=i.sprite,typeof Ua<"u")for(let Ce in Ua.config.props)delete Zi[Ua.config.props[Ce]];o[38].nodeId||o[38].populate(Zi),s=o[38];const Mi={};if(Mi.image=i.image,Mi.x=18,Mi.h=20,Mi.w=20,Mi.map=i.sprite,Mi.frame=i.maxFps[1],!o[39]){const Ce=Mi.is||"Sprite";o[39]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:Mi},o[38],i),o[39][Symbol.for("slots")][0]?(s=o[39][Symbol.for("slots")][0],i=o[39]):s=o[39][Symbol.for("children")][0]}const Yo=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[35],o[40]||(o[40]=this.element({parent:s||"root"},i));const dt={};if(dt.image=i.image,dt.x=36,dt.h=20,dt.w=20,dt.map=i.sprite,typeof Yo<"u")for(let Ce in Yo.config.props)delete dt[Yo.config.props[Ce]];o[40].nodeId||o[40].populate(dt),s=o[40];const ln={};if(ln.image=i.image,ln.x=36,ln.h=20,ln.w=20,ln.map=i.sprite,ln.frame=i.maxFps[2],!o[41]){const Ce=ln.is||"Sprite";o[41]=(u.components&&u.components[Ce]||i[Symbol.for("components")][Ce]||(()=>{console.error("component Sprite not found")})).call(null,{props:ln},o[40],i),o[41][Symbol.for("slots")][0]?(s=o[41][Symbol.for("slots")][0],i=o[41]):s=o[41][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[6].set("frame",s.fps[0])},function(s,i,u){i[7][Symbol.for("props")].frame=s.fps[0]},function(s,i,u){i[8].set("frame",s.fps[1])},function(s,i,u){i[9][Symbol.for("props")].frame=s.fps[1]},function(s,i,u){i[10].set("frame",s.fps[2])},function(s,i,u){i[11][Symbol.for("props")].frame=s.fps[2]},function(s,i,u){i[16].set("frame",s.avgFps[0])},function(s,i,u){i[17][Symbol.for("props")].frame=s.avgFps[0]},function(s,i,u){i[18].set("frame",s.avgFps[1])},function(s,i,u){i[19][Symbol.for("props")].frame=s.avgFps[1]},function(s,i,u){i[20].set("frame",s.avgFps[2])},function(s,i,u){i[21][Symbol.for("props")].frame=s.avgFps[2]},function(s,i,u){i[26].set("frame",s.minFps[0])},function(s,i,u){i[27][Symbol.for("props")].frame=s.minFps[0]},function(s,i,u){i[28].set("frame",s.minFps[1])},function(s,i,u){i[29][Symbol.for("props")].frame=s.minFps[1]},function(s,i,u){i[30].set("frame",s.minFps[2])},function(s,i,u){i[31][Symbol.for("props")].frame=s.minFps[2]},function(s,i,u){i[36].set("frame",s.maxFps[0])},function(s,i,u){i[37][Symbol.for("props")].frame=s.maxFps[0]},function(s,i,u){i[38].set("frame",s.maxFps[1])},function(s,i,u){i[39][Symbol.for("props")].frame=s.maxFps[1]},function(s,i,u){i[40].set("frame",s.maxFps[2])},function(s,i,u){i[41][Symbol.for("props")].frame=s.maxFps[2]}],context:{}},state(){return{image:c4,sprite:{defaults:{y:1,w:20,h:20},frames:{"-":{x:-1e3},0:{x:1},1:{x:23},2:{x:45},3:{x:67},4:{x:89},5:{x:111},6:{x:133},7:{x:155},8:{x:177},9:{x:199},avg:{x:221,w:48,h:25},fps:{x:271,w:43,h:25},max:{x:316,w:53,h:25},min:{x:371,w:47,h:25}}},fps:"---",avgFps:"---",minFps:"---",maxFps:"---"}},hooks:{ready(){let h=1e4,s=0,i=0,u=0,o=0;di.on("fpsUpdate",(x,{fps:y})=>{h=Math.min(y,h),s=Math.max(y,s),u+=y,o++,i=Math.round(u/o),this.fps=y.toString().padStart(3,"0"),this.avgFps=i.toString().padStart(3,"0"),this.minFps=h.toString().padStart(3,"0"),this.maxFps=s.toString().padStart(3,"0")})}}}),ef=new Map,Eh={registerListener(h,s,i){let u=ef.get(s);u||(u=new Map,ef.set(s,u));let o=u.get(h);o||(o=new Set,u.set(h,o)),o.add(i)},executeListeners(h,s){const i=ef.get(h);i&&i.forEach(u=>{u.forEach(o=>{o(s)})})},removeListeners(h){ef.forEach(s=>{const i=s.get(h);i&&(i.clear(),s.delete(i))})}},h4={rounded:"radius"},p4=(h,s,i)=>{Object.defineProperties(h.prototype,{name:{value:s,writable:!1,enumerable:!0,configurable:!1},[te.identifier]:{value:h[te.identifier],writable:!1,enumerable:!1,configurable:!1},focus:{value:function(u){this[te.state].hasFocus=!0,vo.set(this,u)},writable:!1,enumerable:!0,configurable:!1},unfocus:{value:function(){this[te.state].hasFocus=!1,this.lifecycle.state="unfocus"},writable:!1,enumerable:!0,configurable:!1},destroy:{value:function(){this.lifecycle.state="destroy",this.$clearTimeouts(),this.$clearIntervals(),Eh.removeListeners(this),f2(this[te.children]),At.debug(`Destroyed component ${this.componentId}`)},writable:!1,enumerable:!0,configurable:!1},select:{value:function(u){let o=null;return this[te.children].forEach(x=>{Array.isArray(x)?x.forEach(y=>{y.ref===u&&(o=y)}):Object.getPrototypeOf(x)===Object.prototype?Object.keys(x).forEach(y=>{x[y].ref===u&&(o=x[y])}):x.ref===u&&(o=x)}),o},writable:!1,enumerable:!0,configurable:!1},shader:{value:function(u,o){const x=h4[u]||u,y=di.driver.stage.shManager.getRegisteredEffects();if(x in y)return{type:x,props:o};At.error(`Shader ${u} not found`)},writable:!1,enumerable:!1,configurable:!1},$router:{value:{to:Qh,back:l2,get currentRoute(){return qh},get routes(){return h.prototype[te.routes]},get navigating(){return pf}},writable:!1,enumerable:!0,configurable:!1},[te.components]:{value:{Image:s4(),Circle:a4(),RouterView:l4(),Sprite:u4(),Text:f4(),FPScounter:d4()},writable:!1,enumerable:!1,configurable:!1},$setTimeout:{value:function(u,o,...x){const y=setTimeout(()=>{this[te.timeouts]=this[te.timeouts].filter(d=>d!==y),u.apply(null,x)},o,x);return this[te.timeouts].push(y),y},writable:!1,enumerable:!0,configurable:!1},$clearTimeout:{value:function(u){this[te.timeouts].indexOf(u)>-1&&(this[te.timeouts]=this[te.timeouts].filter(o=>o!==u),clearTimeout(u))},writable:!1,enumerable:!0,configurable:!1},$clearTimeouts:{value:function(){for(let u=0;uu.apply(null,x),o,x);return this[te.intervals].push(y),y},writable:!1,enumerable:!0,configurable:!1},$clearInterval:{value:function(u){this[te.intervals].indexOf(u)>-1&&(this[te.intervals]=this[te.intervals].filter(o=>o!==u),clearInterval(u))},writable:!1,enumerable:!0,configurable:!1},$clearIntervals:{value:function(){for(let u=0;uh,required:!1},g4=(h,s=[])=>{s.indexOf("ref")===-1&&s.push("ref"),h[te.propKeys]=[],s.forEach(i=>{i={...m4,...typeof i=="object"?i:{key:i}},h[te.propKeys].push(i.key),Object.defineProperty(h.prototype,i.key,{get(){const u=i.cast(this[te.props]&&i.key in this[te.props]?this[te.props][i.key]:i.default||void 0);return i.required&&u===void 0&&At.warn(`${i.key} is required`),u},set(u){At.warn(`Warning! Avoid mutating props directly (${i.key})`),this[te.props][i.key]=u}})})},y4=(h,s)=>{h[te.methodKeys]=[];for(let i in s)h[te.propKeys]&&h[te.propKeys].indexOf(i)>-1?At.error(`${i} already exists as a prop`):(typeof s[i]!="function"&&At.warn(`${i} is not a function`),h[te.methodKeys].push(i),h.prototype[i]=s[i])},v4=(h,s)=>{h[te.stateKeys]=[],s={...s.apply(h.prototype),hasFocus:!1},Object.keys(s).forEach(i=>{h[te.propKeys]&&h[te.propKeys].indexOf(i)>-1&&At.error(`State ${i} already exists as a prop`),h[te.methodKeys]&&h[te.methodKeys].indexOf(i)>-1&&At.error(`State ${i} already exists as a method`),h[te.stateKeys].push(i);try{Object.defineProperty(h.prototype,i,{get(){return this[te.state]&&i in this[te.state]&&this[te.state][i]},set(u){this[te.state]&&(this[te.state][i]=u)}})}catch(u){At.error(u)}})},x4=(h,s)=>{h[te.computedKeys]=[];for(let i in s)h[te.stateKeys]&&h[te.stateKeys].indexOf(i)>-1?At.error(`${i} already exists as a prop`):h[te.propKeys]&&h[te.propKeys].indexOf(i)>-1?At.error(`${i} already exists as a prop`):h[te.methodKeys]&&h[te.methodKeys].indexOf(i)>-1?At.error(`${i} already exists as a method`):(typeof s[i]!="function"&&At.warn(`${i} is not a function`),h[te.computedKeys].push(i),Object.defineProperty(h.prototype,i,{get(){return s[i].apply(this)}}))},S4=(h,s)=>{h.prototype[te.inputEvents]=[],Object.keys(s).forEach(i=>{typeof s[i]!="function"&&At.warn(`${s[i]} is not a function`),h.prototype[te.inputEvents][i]=s[i]})},w4=(h,s)=>{h.prototype[te.routes]=[],Object.keys(s).forEach(i=>{h.prototype[te.routes][i]={...s[i],options:{inHistory:!0,...s[i].options}}})},T4=(h,s)=>{h.prototype[te.watchKeys]=[],h.prototype[te.watchers]={};for(let i in s)typeof s[i]!="function"&&console.warn(`${i} is not a function`),h.prototype[te.watchKeys].push(i),h.prototype[te.watchers][i]=function(u,o){s[i].call(this,u,o)}},C4=["init","ready","focus","unfocus","destroy"],I4={previous:null,current:null,get state(){return this.current},set state(h){C4.indexOf(h)>-1&&(h!==this.current||h==="focus")&&(At.debug(`Setting lifecycle state from ${this.current} to ${h} for ${this.component.componentId}`),this.previous=this.current,this.current=h,G3(h,this.component[te.identifier],this.component),Qx(h,this.component[te.identifier],this.component))}};let E4=0;const wx={element:qx},Tx=h=>{throw new Error(`Parameter ${h} is required`)},So=(h=Tx("name"),s=Tx("config"))=>{const i=x=>{s.code||(At.debug(`Generating code for ${h} component`),s.code=pA.call(s,hA(s.template,h,x))),u[te.identifier]=++E4,p4(u,h),X3(s.hooks,u[te.identifier]),g4(u,s.props),s.methods&&y4(u,s.methods),s.state&&v4(u,s.state),s.computed&&x4(u,s.computed),s.watch&&T4(u,s.watch),s.routes&&w4(u,s.routes),s.input&&S4(u,s.input),u.setup=!0},u=function(x,y,d){this.lifecycle=Object.assign(Object.create(I4),{component:this,previous:null,current:null}),u.setup||i(d),s.hooks&&s.hooks.frameTick&&di.on("frameTick",(C,b)=>Qx("frameTick",u[te.identifier],this,[b])),this.parent=d,this[te.wrapper]=y,Object.defineProperties(this,{componentId:{value:V3(h),writable:!1,enumerable:!0,configurable:!1},[te.id]:{value:H3(),writable:!1,enumerable:!1,configurable:!1},[te.props]:{value:gx(x.props||{},Ko.get("reactivityMode")),writable:!1,enumerable:!1,configurable:!1},[te.timeouts]:{value:[],writable:!0,enumerable:!1,configurable:!1},[te.intervals]:{value:[],writable:!0,enumerable:!1,configurable:!1}}),Object.defineProperty(this,te.originalState,{value:{...s.state&&typeof s.state=="function"&&s.state.apply(this)||{},hasFocus:!1},writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(this,te.state,{value:gx(this[te.originalState],Ko.get("reactivityMode")),writable:!1,enumerable:!1,configurable:!1}),this.lifecycle.state="init",Object.defineProperty(this,te.children,{value:s.code.render.apply(wx,[y,this,s]),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(this,te.slots,{value:this[te.children].filter(C=>C[te.isSlot]),writable:!1,enumerable:!1,configurable:!1}),s.code.effects.forEach(C=>{mx(()=>{C.apply(wx,[this,this[te.children],s])})}),this[te.watchers]&&Object.keys(this[te.watchers]).forEach(C=>{let b=this[C];mx((I=!1)=>{(b!==this[C]||I===!0)&&(this[te.watchers][C].apply(this,[this[C],b]),b=this[C])})}),setTimeout(()=>this.lifecycle.state="ready")},o=(x={},y,d)=>new u(x,y,d);return o.config=s,o},b4=h=>{const s={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Enter:"enter"," ":"space",Backspace:"back",Escape:"escape",37:"left",39:"right",38:"up",40:"down",13:"enter",32:"space",8:"back",27:"escape"};h.hooks=h.hooks||{};let i,u,o;return h.hooks[te.destroy]=function(){document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)},h.hooks[te.init]=function(){const x={...s,...Ko.get("keymap",{})};i=y=>{const d=x[y.key]||x[y.keyCode]||y.key||y.keyCode;vo.input(d,y),clearTimeout(o),o=setTimeout(()=>{vo.hold=!0},50)},u=()=>{clearTimeout(o),vo.hold=!1},document.addEventListener("keydown",i),document.addEventListener("keyup",u),setTimeout(()=>vo.set(this))},So("App",h)},He={Component:So,Application:b4,Launch:U3},A4=h=>new URLSearchParams(window.location.search).get(h),wa={sky:{test(){return navigator.userAgent.indexOf("WPE Sky")>-1||A4("keymapping")==="sky"},mapping:{Escape:"back",27:"back"}}},k4=()=>{let h={};return Object.keys(wa).forEach(s=>{if(wa[s].test&&typeof wa[s].test=="function"&&wa[s].test()===!0){h=wa[s].mapping;return}}),h},M4=He.Component("PortalItem",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=370,x.h=320,o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.x=30,d.y=30,d.size=84,typeof y<"u")for(let N in y.config.props)delete d[y.config.props[N]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.x=30,C.y=30,C.content=i.number,C.size=84,C.color=i.fontColor,!o[2]){const N=C.is||"Text";o[2]=(u.components&&u.components[N]||i[Symbol.for("components")][N]||(()=>{console.error("component Text not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.x=30,I.y=140,I.size=42,I.font="raleway",I.letterspacing=2,typeof b<"u")for(let N in b.config.props)delete I[b.config.props[N]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.x=30,k.y=140,k.content=i.title,k.size=42,k.font="raleway",k.color=i.fontColor,k.letterspacing=2,!o[4]){const N=k.is||"Text";o[4]=(u.components&&u.components[N]||i[Symbol.for("components")][N]||(()=>{console.error("component Text not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}const P=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const O={};if(O.x=30,O.y=200,O.wordwrap=300,O.size=28,O.lineheight=32,typeof P<"u")for(let N in P.config.props)delete O[P.config.props[N]];o[5].nodeId||o[5].populate(O),s=o[5];const v={};if(v.x=30,v.y=200,v.content=i.description,v.wordwrap=300,v.size=28,v.color=i.fontColor,v.lineheight=32,!o[6]){const N=v.is||"Text";o[6]=(u.components&&u.components[N]||i[Symbol.for("components")][N]||(()=>{console.error("component Text not found")})).call(null,{props:v},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("scale",{transition:s.hasFocus?1.1:1})},function(s,i,u){i[0].set("color",s.backgroundColor)},function(s,i,u){i[0].set("effects",[s.shader("radius",{radius:6})])},function(s,i,u){i[1].set("content",s.number)},function(s,i,u){i[1].set("color",s.fontColor)},function(s,i,u){i[2][Symbol.for("props")].content=s.number},function(s,i,u){i[2][Symbol.for("props")].color=s.fontColor},function(s,i,u){i[3].set("content",s.title)},function(s,i,u){i[3].set("color",s.fontColor)},function(s,i,u){i[4][Symbol.for("props")].content=s.title},function(s,i,u){i[4][Symbol.for("props")].color=s.fontColor},function(s,i,u){i[5].set("content",s.description)},function(s,i,u){i[5].set("color",s.fontColor)},function(s,i,u){i[6][Symbol.for("props")].content=s.description},function(s,i,u){i[6][Symbol.for("props")].color=s.fontColor}],context:{}},props:["title","description","index","id"],state(){return{backgroundColor:"#44037a",fontColor:"#e8d7f9",number:this.index<9?`0${this.index+1}`:this.index+1}},hooks:{focus(){this.backgroundColor="#fafafa",this.fontColor="#000"},unfocus(){this.$router.navigating||(this.backgroundColor="#44037a",this.fontColor="#e8d7f9")}},input:{enter(){this.$router.to(`/${this.id}`)},back(){}}}),R4=He.Component("PortalRow",{components:{PortalItem:M4},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};o[1].nodeId||o[1].populate(y);const d=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const C={};if(C.content=i.title,C.x=60,typeof d<"u")for(let P in d.config.props)delete C[d.config.props[P]];o[2].nodeId||o[2].populate(C),s=o[2];const b={};if(b.content=i.title,b.x=60,!o[3]){const P=b.is||"Text";o[3]=(u.components&&u.components[P]||i[Symbol.for("components")][P]||(()=>{console.error("component Text not found")})).call(null,{props:b},o[2],i),o[3][Symbol.for("slots")][0]?(s=o[3][Symbol.for("slots")][0],i=o[3]):s=o[3][Symbol.for("children")][0]}s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const I={};I.y=50,I.x=60,I.h=1,I.w=1800,I.color="0xe8d7f9ff",o[4].nodeId||o[4].populate(I),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const k={};return k.y=100,o[5].nodeId||o[5].populate(k),o},effects:[function(s,i,u){i[1].set("alpha",{transition:{value:s.itemOffset<240?1:0,duration:200}})},function(s,i,u){i[5].set("x",{transition:s.rowOffset})},function(s,i,u){parent=i[5];const o=s.items||[],x=[];for(let y=0;y{console.error("component PortalItem not found")})).call(null,{props:I},i[6][d.item.id],s),i[7][d.item.id][Symbol.for("slots")][0]?(parent=i[7][d.item.id][Symbol.for("slots")][0],s=i[7][d.item.id]):parent=i[7][d.item.id][Symbol.for("children")][0]}i[6][d.item.id].set("x",{transition:{value:d.itemOffset+d.index*430,delay:50*(d.index%4),duration:500}}),i[6][d.item.id].set("ref","item"+d.index),i[7][d.item.id][Symbol.for("props")].x={transition:{value:d.itemOffset+d.index*430,delay:50*(d.index%4),duration:500}},i[7][d.item.id][Symbol.for("props")].ref="item"+d.index}i[6]&&Object.keys(i[6]).forEach(y=>{x.indexOf(y)===-1&&(i[6][y].destroy&&i[6][y].destroy(),delete i[1][y])})}],context:{}},props:["title","items"],state(){return{focused:0,rowOffset:60,itemOffset:240}},hooks:{ready(){this.itemOffset=0},focus(){this.$trigger("focused")}},watch:{focused(h){const s=this.select(`item${h}`);s&&s.focus&&(s.focus(),h<1?this.rowOffset=60:h>this.items.length-2?this.rowOffset=60-(this.items.length-2)*430+430:this.rowOffset=60-h*430+430)}},input:{left(){this.focused>0?this.focused--:this.focused=this.items.length-1},right(){this.focused",j4="Apache-2",F4={backstopjs:"^6.3.22",eslint:"^8.8.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0",husky:"^7.0.4","lint-staged":"^12.3.3",playwright:"^1.41.0",prettier:"^2.5.1","shaka-player":"^4.7.1",vite:"^4.0.4"},z4={"@lightningjs/blits":"^0.9.2"},V4={name:_4,version:L4,description:N4,main:P4,type:D4,scripts:O4,"lint-staged":{"*.js":["eslint --fix"]},husky:U4,author:B4,license:j4,devDependencies:F4,dependencies:z4},H4=He.Component("Portal",{components:{PortalRow:R4},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=1920,x.h=1080,x.color="{top: '0x44037aff', bottom: '0x240244ff'}",o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.PortalRow||i[Symbol.for("components")].PortalRow;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.mount="{y: 0.5}",d.h=500,d.title="Demos",d.items=i.demo,d.ref="row0",typeof y<"u")for(let H in y.config.props)delete d[y.config.props[H]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.mount="{y: 0.5}",C.h=500,C.y={transition:-i.rowFocused*420+550},C.title="Demos",C.items=i.demo,C.ref="row0",!o[2]){const H=C.is||"PortalRow";o[2]=(u.components&&u.components[H]||i[Symbol.for("components")][H]||(()=>{console.error("component PortalRow not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.PortalRow||i[Symbol.for("components")].PortalRow;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.mount="{y: 0.5}",I.h=500,I.title="Examples and tests",I.items=i.example,I.ref="row1",typeof b<"u")for(let H in b.config.props)delete I[b.config.props[H]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.mount="{y: 0.5}",k.h=500,k.y={transition:-i.rowFocused*420+1100},k.title="Examples and tests",k.items=i.example,k.ref="row1",!o[4]){const H=k.is||"PortalRow";o[4]=(u.components&&u.components[H]||i[Symbol.for("components")][H]||(()=>{console.error("component PortalRow not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}const P=u.components&&u.components.PortalRow||i[Symbol.for("components")].PortalRow;s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const O={};if(O.mount="{y: 0.5}",O.h=500,O.title="Benchmarks and stress tests",O.items=i.benchmark,O.ref="row2",typeof P<"u")for(let H in P.config.props)delete O[P.config.props[H]];o[5].nodeId||o[5].populate(O),s=o[5];const v={};if(v.mount="{y: 0.5}",v.h=500,v.y={transition:-i.rowFocused*420+1650},v.title="Benchmarks and stress tests",v.items=i.benchmark,v.ref="row2",!o[6]){const H=v.is||"PortalRow";o[6]=(u.components&&u.components[H]||i[Symbol.for("components")][H]||(()=>{console.error("component PortalRow not found")})).call(null,{props:v},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const N={};N.w=1920,N.h=200,N.color="0x44037aff",o[7].nodeId||o[7].populate(N),s=o[7],o[8]||(o[8]=this.element({parent:s||"root"},i));const V={};V.w=1920,V.h=70,V.y=200,V.color="{top: '0x44037aff'}",o[8].nodeId||o[8].populate(V),s=o[7],o[9]||(o[9]=this.element({parent:s||"root"},i));const G={};o[9].nodeId||o[9].populate(G),s=o[9],o[10]||(o[10]=this.element({parent:s||"root"},i));const ie={};ie.src="assets/blits-logo-full.png",ie.w=200,ie.h=112,ie.x=60,o[10].nodeId||o[10].populate(ie),s=o[9],o[11]||(o[11]=this.element({parent:s||"root"},i));const $={};$.w=2,$.h=120,$.y=-10,$.color="0xffffff80",$.x=300,o[11].nodeId||o[11].populate($),s=o[9],o[12]||(o[12]=this.element({parent:s||"root"},i));const ne={};ne.x=320,ne.y=16,o[12].nodeId||o[12].populate(ne);const ee=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[12],o[13]||(o[13]=this.element({parent:s||"root"},i));const le={};if(le.y=0,le.size=36,le.content="Example App",typeof ee<"u")for(let H in ee.config.props)delete le[ee.config.props[H]];o[13].nodeId||o[13].populate(le),s=o[13];const X={};if(X.y=0,X.size=36,X.content="Example App",!o[14]){const H=X.is||"Text";o[14]=(u.components&&u.components[H]||i[Symbol.for("components")][H]||(()=>{console.error("component Text not found")})).call(null,{props:X},o[13],i),o[14][Symbol.for("slots")][0]?(s=o[14][Symbol.for("slots")][0],i=o[14]):s=o[14][Symbol.for("children")][0]}const oe=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[12],o[15]||(o[15]=this.element({parent:s||"root"},i));const re={};if(re.y=50,re.size=24,re.content="v"+i.version,typeof oe<"u")for(let H in oe.config.props)delete re[oe.config.props[H]];o[15].nodeId||o[15].populate(re),s=o[15];const E={};if(E.y=50,E.size=24,E.content="v"+i.version,!o[16]){const H=E.is||"Text";o[16]=(u.components&&u.components[H]||i[Symbol.for("components")][H]||(()=>{console.error("component Text not found")})).call(null,{props:E},o[15],i),o[16][Symbol.for("slots")][0]?(s=o[16][Symbol.for("slots")][0],i=o[16]):s=o[16][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[1].set("y",{transition:-s.rowFocused*420+550})},function(s,i,u){i[2][Symbol.for("props")].y={transition:-s.rowFocused*420+550}},function(s,i,u){i[3].set("y",{transition:-s.rowFocused*420+1100})},function(s,i,u){i[4][Symbol.for("props")].y={transition:-s.rowFocused*420+1100}},function(s,i,u){i[5].set("y",{transition:-s.rowFocused*420+1650})},function(s,i,u){i[6][Symbol.for("props")].y={transition:-s.rowFocused*420+1650}},function(s,i,u){i[9].set("y",{transition:{value:80-s.logoOffset,duration:400}})}],context:{}},state(){return{version:V4.version,offset:60,rowFocused:0,rows:["demo","example","benchmark"],logoOffset:50,demo:[{title:"Loader",id:"demos/loading",description:"A basic loading screen"},{title:"Intro",id:"demos/intro",description:"A splash screen with custom animations"},{title:"Theming",id:"demos/theming",description:"Dynamically changing the styling of a component with themes"},{title:"TMDB",id:"demos/tmdb",description:"The Movie Database (TMDB) example using data from a remote API"},{title:"Sprites",id:"demos/sprites",description:"Display multiple images while keeping low memory footprint"},{title:"Focus",id:"demos/focushandling",description:"Managing focus between components in a simple layout"},{title:"Memory Game",id:"demos/memory-game",description:"Memory game with speech assistence (for accessibility)"},{title:"Video player",id:"demos/player",description:"Example of Video Playback with basic controls"}],example:[{title:"Positioning",id:"examples/positioning",description:"Positioning Elements and Components"},{title:"Colors",id:"examples/colors",description:"Using different formats and notations for defining colors"},{title:"Gradients",id:"examples/gradients",description:"Example of Basic gradients"},{title:"Transitions",id:"examples/transitions",description:"Comparing different transition easing functions"},{title:"Components",id:"examples/components",description:"Reusable Components"},{title:"Alpha",id:"examples/alpha",description:"Applying transparency to Elements, Images and Components"},{title:"Scaling",id:"examples/scaling",description:"Resizing and scaling Elements and Components"},{title:"Rotation",id:"examples/rotation",description:"Rotating Elements"},{title:"Key input",id:"examples/keyinput",description:"Handling user input events"},{title:"For Loop",id:"examples/forloop",description:"Iterating over Elements and Components using for loops"},{title:"Advanced loop",id:"examples/forloop-advanced",description:"Testing various Array operations with a for loop"},{title:"Effects",id:"examples/effects",description:"Applying one or multiple effects (aka shaders)"},{title:"Show",id:"examples/showif",description:"Conditionally show or hide Elements and Components"},{title:"Events",id:"examples/events",description:"Communication between components by emitting and listening for events"},{title:"Images",id:"examples/images",description:"1 image says more than 1000 words ;)"},{title:"Texts",id:"examples/texts",description:"Displaying and formatting text"},{title:"Slots",id:"examples/slots",description:"Insert dynamic content from a parent into a child using slots"}],benchmark:[{title:"Exponential",id:"benchmarks/exponential",description:"Spawn a large number of components at an exponential rate"}]}},hooks:{ready(){this.logoOffset=0,this.$trigger("rowFocused"),console.log("backstopjs:ready")}},watch:{rowFocused(h){const s=this.select(`row${h}`);s&&s.focus&&s.focus()}},input:{up(){this.rowFocused=(this.rowFocused-1+this.rows.length)%this.rows.length},down(){this.rowFocused=(this.rowFocused+1)%this.rows.length}}}),G4=He.Component("Letter",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=i.w,y.color="0xe6e6e6ff",o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=i.w,d.h=280,o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};return C.w=i.w,C.color="0xe6e6e6ff",o[3].nodeId||o[3].populate(C),o},effects:[function(s,i,u){i[1].set("h",{transition:{value:410+s.offset,duration:s.duration,delay:s.wait,easing:s.timingFunction}})},function(s,i,u){i[2].set("src",s.image)},function(s,i,u){i[2].set("y",{transition:{value:400+s.offset,duration:s.duration,delay:s.wait,easing:s.timingFunction}})},function(s,i,u){i[3].set("h",{transition:{value:500-s.offset,duration:s.duration,delay:s.wait,easing:s.timingFunction}})},function(s,i,u){i[3].set("y",{transition:{value:660+s.offset,duration:s.duration,delay:s.wait,easing:s.timingFunction}})}],context:{}},props:["w","letter","direction","delay"],computed:{image(){return`assets/${this.letter}.png`}},state(){return{offset:this.direction==="up"?-680:680,duration:1e3,wait:0,timingFunction:"cubic-bezier(1,-0.64,.39,1.44)"}},hooks:{ready(){this.animate()}},methods:{animate(){this.$setTimeout(()=>{this.offset=0},1e3),this.$setTimeout(()=>{this.wait=this.delay+150,this.duration=1e3,this.offset=1080},2800),this.$setTimeout(()=>{this.wait=this.delay/3,this.timingFunction="ease-in-out",this.duration=1500,this.offset=0},5e3)}}}),X4=He.Component("Intro",{components:{Letter:G4},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=1920,x.h=1080,x.src="assets/background.jpg",o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.letter="l",d.w=294,typeof y<"u")for(let K in y.config.props)delete d[y.config.props[K]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.letter="l",C.w=294,!o[2]){const K=C.is||"Letter";o[2]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.letter="i-1",I.w=128,I.x=294,I.direction="up",I.delay=50,typeof b<"u")for(let K in b.config.props)delete I[b.config.props[K]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.letter="i-1",k.w=128,k.x=294,k.direction="up",k.delay=50,!o[4]){const K=k.is||"Letter";o[4]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}const P=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const O={};if(O.letter="g-1",O.w=205,O.x=422,O.delay=100,typeof P<"u")for(let K in P.config.props)delete O[P.config.props[K]];o[5].nodeId||o[5].populate(O),s=o[5];const v={};if(v.letter="g-1",v.w=205,v.x=422,v.delay=100,!o[6]){const K=v.is||"Letter";o[6]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:v},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}const N=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const V={};if(V.letter="h",V.w=224,V.x=627,V.direction="up",V.delay=150,typeof N<"u")for(let K in N.config.props)delete V[N.config.props[K]];o[7].nodeId||o[7].populate(V),s=o[7];const G={};if(G.letter="h",G.w=224,G.x=627,G.direction="up",G.delay=150,!o[8]){const K=G.is||"Letter";o[8]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:G},o[7],i),o[8][Symbol.for("slots")][0]?(s=o[8][Symbol.for("slots")][0],i=o[8]):s=o[8][Symbol.for("children")][0]}const ie=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[9]||(o[9]=this.element({parent:s||"root"},i));const $={};if($.letter="t",$.w=190,$.x=851,$.delay=200,typeof ie<"u")for(let K in ie.config.props)delete $[ie.config.props[K]];o[9].nodeId||o[9].populate($),s=o[9];const ne={};if(ne.letter="t",ne.w=190,ne.x=851,ne.delay=200,!o[10]){const K=ne.is||"Letter";o[10]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:ne},o[9],i),o[10][Symbol.for("slots")][0]?(s=o[10][Symbol.for("slots")][0],i=o[10]):s=o[10][Symbol.for("children")][0]}const ee=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const le={};if(le.letter="n-1",le.w=221,le.x=1041,le.direction="up",le.delay=250,typeof ee<"u")for(let K in ee.config.props)delete le[ee.config.props[K]];o[11].nodeId||o[11].populate(le),s=o[11];const X={};if(X.letter="n-1",X.w=221,X.x=1041,X.direction="up",X.delay=250,!o[12]){const K=X.is||"Letter";o[12]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:X},o[11],i),o[12][Symbol.for("slots")][0]?(s=o[12][Symbol.for("slots")][0],i=o[12]):s=o[12][Symbol.for("children")][0]}const oe=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[13]||(o[13]=this.element({parent:s||"root"},i));const re={};if(re.letter="i-2",re.w=115,re.x=1262,re.delay=300,typeof oe<"u")for(let K in oe.config.props)delete re[oe.config.props[K]];o[13].nodeId||o[13].populate(re),s=o[13];const E={};if(E.letter="i-2",E.w=115,E.x=1262,E.delay=300,!o[14]){const K=E.is||"Letter";o[14]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:E},o[13],i),o[14][Symbol.for("slots")][0]?(s=o[14][Symbol.for("slots")][0],i=o[14]):s=o[14][Symbol.for("children")][0]}const H=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[15]||(o[15]=this.element({parent:s||"root"},i));const Q={};if(Q.letter="n-2",Q.w=219,Q.x=1377,Q.direction="up",Q.delay=350,typeof H<"u")for(let K in H.config.props)delete Q[H.config.props[K]];o[15].nodeId||o[15].populate(Q),s=o[15];const ge={};if(ge.letter="n-2",ge.w=219,ge.x=1377,ge.direction="up",ge.delay=350,!o[16]){const K=ge.is||"Letter";o[16]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:ge},o[15],i),o[16][Symbol.for("slots")][0]?(s=o[16][Symbol.for("slots")][0],i=o[16]):s=o[16][Symbol.for("children")][0]}const ae=u.components&&u.components.Letter||i[Symbol.for("components")].Letter;s=o[0],o[17]||(o[17]=this.element({parent:s||"root"},i));const q={};if(q.letter="g-2",q.w=324,q.x=1596,q.direction="up",q.delay=400,typeof ae<"u")for(let K in ae.config.props)delete q[ae.config.props[K]];o[17].nodeId||o[17].populate(q),s=o[17];const Y={};if(Y.letter="g-2",Y.w=324,Y.x=1596,Y.direction="up",Y.delay=400,!o[18]){const K=Y.is||"Letter";o[18]=(u.components&&u.components[K]||i[Symbol.for("components")][K]||(()=>{console.error("component Letter not found")})).call(null,{props:Y},o[17],i),o[18][Symbol.for("slots")][0]?(s=o[18][Symbol.for("slots")][0],i=o[18]):s=o[18][Symbol.for("children")][0]}return o},effects:[],context:{}}}),W4=He.Component("Toggle",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=100,x.h=50,x.y=5,o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Circle||i[Symbol.for("components")].Circle;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.size=50,typeof y<"u")for(let b in y.config.props)delete d[y.config.props[b]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.x={transition:i.on?0:50},C.size=50,C.color=i.primaryColor,!o[2]){const b=C.is||"Circle";o[2]=(u.components&&u.components[b]||i[Symbol.for("components")][b]||(()=>{console.error("component Circle not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("color",s.bgColor)},function(s,i,u){i[0].set("effects",[s.shader("radius",{radius:25})])},function(s,i,u){i[1].set("x",{transition:s.on?0:50})},function(s,i,u){i[1].set("color",s.primaryColor)},function(s,i,u){i[2][Symbol.for("props")].x={transition:s.on?0:50}},function(s,i,u){i[2][Symbol.for("props")].color=s.primaryColor}],context:{}},props:["bgColor","primaryColor","on"]}),$4=He.Component("Bar",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};return o[1].nodeId||o[1].populate(y),o},effects:[function(s,i,u){i[0].set("w",{value:s.w,duration:s.duration})},function(s,i,u){i[0].set("h",{value:s.h,duration:s.duration})},function(s,i,u){i[0].set("color",s.bgColor)},function(s,i,u){i[0].set("x",s.index*(s.w+s.w/4))},function(s,i,u){i[0].set("effects",[s.shader("radius",{radius:10})])},function(s,i,u){i[1].set("w",s.w)},function(s,i,u){i[1].set("y",{transition:{value:s.h-s.innerH,duration:s.duration}})},function(s,i,u){i[1].set("h",{transition:{value:s.innerH,duration:s.duration}})},function(s,i,u){i[1].set("color",s.primaryColor)},function(s,i,u){i[1].set("effects",[s.shader("radius",{radius:10})])}],context:{}},props:["bgColor","primaryColor","height","index","size"],state(){return{h:200,innerH:0,duration:400}},hooks:{ready(){this.innerH=this.height}},computed:{w(){return this.size==="large"?110:72}},watch:{bgColor(){this.duration=1e-6,this.innerH=0,this.$setTimeout(()=>{this.duration=400,this.innerH=this.height},200)},size(){this.duration=1e-6,this.innerH=0,this.$setTimeout(()=>{this.duration=400,this.innerH=this.height},100)}}}),K4={color1:"#475569",color2:"#64748b",color3:"#cbd5e1",color4:"#38bdf8",bg:"#1e293b80"},Y4={color1:"#f8fafc",color2:"#e2e8f0",color3:"#1e293b",color4:"#0369a1",bg:"#f1f5f9"},q4=He.Component("Theming",{components:{Bar:$4,Toggle:W4},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=1920,x.h=1080,o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.y=1020,d.x=1160,d.size=28,d.content='Use "up", "down", "left" and "right" to change the appearance',typeof y<"u")for(let we in y.config.props)delete d[y.config.props[we]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.y=1020,C.x=1160,C.size=28,C.color=i.colors.color4,C.content='Use "up", "down", "left" and "right" to change the appearance',!o[2]){const we=C.is||"Text";o[2]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Text not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const b={};o[3].nodeId||o[3].populate(b),s=o[3],o[4]||(o[4]=this.element({parent:s||"root"},i));const I={};I.x=-250,I.y=-100,I.src="assets/shadow.png",I.w=1e3,I.h=900,I.alpha=.5,o[4].nodeId||o[4].populate(I),s=o[3],o[5]||(o[5]=this.element({parent:s||"root"},i));const k={};o[5].nodeId||o[5].populate(k),s=o[5],o[6]||(o[6]=this.element({parent:s||"root"},i));const P={};P.h=100,o[6].nodeId||o[6].populate(P),s=o[5],o[7]||(o[7]=this.element({parent:s||"root"},i));const O={};O.h=80,O.y=20,o[7].nodeId||o[7].populate(O);const v=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[5],o[8]||(o[8]=this.element({parent:s||"root"},i));const N={};if(N.size=28,N.x=20,N.y=14,typeof v<"u")for(let we in v.config.props)delete N[v.config.props[we]];o[8].nodeId||o[8].populate(N),s=o[8];const V={};if(V.content=i.text,V.color=i.colors.color3,V.size=28,V.x=20,V.y=14,!o[9]){const we=V.is||"Text";o[9]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Text not found")})).call(null,{props:V},o[8],i),o[9][Symbol.for("slots")][0]?(s=o[9][Symbol.for("slots")][0],i=o[9]):s=o[9][Symbol.for("children")][0]}const G=u.components&&u.components.Toggle||i[Symbol.for("components")].Toggle;s=o[5],o[10]||(o[10]=this.element({parent:s||"root"},i));const ie={};if(ie.primaryColor="#22c55e",typeof G<"u")for(let we in G.config.props)delete ie[G.config.props[we]];o[10].nodeId||o[10].populate(ie),s=o[10];const $={};if($.x={transition:i.width-120},$.on=i.mode==="dark",$.bgColor=i.colors.color1,$.primaryColor="#22c55e",!o[11]){const we=$.is||"Toggle";o[11]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Toggle not found")})).call(null,{props:$},o[10],i),o[11][Symbol.for("slots")][0]?(s=o[11][Symbol.for("slots")][0],i=o[11]):s=o[11][Symbol.for("children")][0]}s=o[3],o[12]||(o[12]=this.element({parent:s||"root"},i));const ne={};ne.w=200,ne.x=25,ne.y=140,o[12].nodeId||o[12].populate(ne),s=o[3],o[13]||(o[13]=this.element({parent:s||"root"},i));const ee={};ee.x=270,o[13].nodeId||o[13].populate(ee),s=o[3],o[14]||(o[14]=this.element({parent:s||"root"},i));const le={};le.color="0x00000000",o[14].nodeId||o[14].populate(le),s=o[14],o[15]||(o[15]=this.element({parent:s||"root"},i));const X={};o[15].nodeId||o[15].populate(X);const oe=u.components&&u.components.Bar||i[Symbol.for("components")].Bar;s=o[15],o[16]||(o[16]=this.element({parent:s||"root"},i));const re={};if(re.height=100,re.index=0,typeof oe<"u")for(let we in oe.config.props)delete re[oe.config.props[we]];o[16].nodeId||o[16].populate(re),s=o[16];const E={};if(E.bgColor=i.colors.color2,E.primaryColor=i.colors.color4,E.size=i.graph.size,E.height=100,E.index=0,!o[17]){const we=E.is||"Bar";o[17]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Bar not found")})).call(null,{props:E},o[16],i),o[17][Symbol.for("slots")][0]?(s=o[17][Symbol.for("slots")][0],i=o[17]):s=o[17][Symbol.for("children")][0]}const H=u.components&&u.components.Bar||i[Symbol.for("components")].Bar;s=o[15],o[18]||(o[18]=this.element({parent:s||"root"},i));const Q={};if(Q.height=140,Q.index=1,typeof H<"u")for(let we in H.config.props)delete Q[H.config.props[we]];o[18].nodeId||o[18].populate(Q),s=o[18];const ge={};if(ge.bgColor=i.colors.color2,ge.primaryColor=i.colors.color4,ge.size=i.graph.size,ge.height=140,ge.index=1,!o[19]){const we=ge.is||"Bar";o[19]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Bar not found")})).call(null,{props:ge},o[18],i),o[19][Symbol.for("slots")][0]?(s=o[19][Symbol.for("slots")][0],i=o[19]):s=o[19][Symbol.for("children")][0]}const ae=u.components&&u.components.Bar||i[Symbol.for("components")].Bar;s=o[15],o[20]||(o[20]=this.element({parent:s||"root"},i));const q={};if(q.height=170,q.index=2,typeof ae<"u")for(let we in ae.config.props)delete q[ae.config.props[we]];o[20].nodeId||o[20].populate(q),s=o[20];const Y={};if(Y.bgColor=i.colors.color2,Y.primaryColor=i.colors.color4,Y.size=i.graph.size,Y.height=170,Y.index=2,!o[21]){const we=Y.is||"Bar";o[21]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Bar not found")})).call(null,{props:Y},o[20],i),o[21][Symbol.for("slots")][0]?(s=o[21][Symbol.for("slots")][0],i=o[21]):s=o[21][Symbol.for("children")][0]}const K=u.components&&u.components.Bar||i[Symbol.for("components")].Bar;s=o[15],o[22]||(o[22]=this.element({parent:s||"root"},i));const de={};if(de.height=150,de.index=3,typeof K<"u")for(let we in K.config.props)delete de[K.config.props[we]];o[22].nodeId||o[22].populate(de),s=o[22];const ve={};if(ve.bgColor=i.colors.color2,ve.primaryColor=i.colors.color4,ve.size=i.graph.size,ve.height=150,ve.index=3,!o[23]){const we=ve.is||"Bar";o[23]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Bar not found")})).call(null,{props:ve},o[22],i),o[23][Symbol.for("slots")][0]?(s=o[23][Symbol.for("slots")][0],i=o[23]):s=o[23][Symbol.for("children")][0]}const pe=u.components&&u.components.Bar||i[Symbol.for("components")].Bar;s=o[15],o[24]||(o[24]=this.element({parent:s||"root"},i));const fe={};if(fe.height=90,fe.index=4,typeof pe<"u")for(let we in pe.config.props)delete fe[pe.config.props[we]];o[24].nodeId||o[24].populate(fe),s=o[24];const ke={};if(ke.bgColor=i.colors.color2,ke.primaryColor=i.colors.color4,ke.size=i.graph.size,ke.height=90,ke.index=4,!o[25]){const we=ke.is||"Bar";o[25]=(u.components&&u.components[we]||i[Symbol.for("components")][we]||(()=>{console.error("component Bar not found")})).call(null,{props:ke},o[24],i),o[25][Symbol.for("slots")][0]?(s=o[25][Symbol.for("slots")][0],i=o[25]):s=o[25][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("color",{transition:s.colors.bg})},function(s,i,u){i[1].set("color",s.colors.color4)},function(s,i,u){i[2][Symbol.for("props")].color=s.colors.color4},function(s,i,u){i[3].set("x",{transition:(1920-s.width)/2})},function(s,i,u){i[3].set("y",{transition:(1080-s.height)/2})},function(s,i,u){i[5].set("w",{transition:s.width})},function(s,i,u){i[5].set("h",{transition:s.height})},function(s,i,u){i[5].set("color",s.colors.color1)},function(s,i,u){i[5].set("effects",[s.shader("radius",{radius:s.radius})])},function(s,i,u){i[6].set("w",{transition:s.width})},function(s,i,u){i[6].set("color",s.colors.color2)},function(s,i,u){i[6].set("effects",[s.shader("radius",{radius:s.radius})])},function(s,i,u){i[7].set("w",{transition:s.width})},function(s,i,u){i[7].set("color",s.colors.color2)},function(s,i,u){i[8].set("content",s.text)},function(s,i,u){i[8].set("color",s.colors.color3)},function(s,i,u){i[9][Symbol.for("props")].content=s.text},function(s,i,u){i[9][Symbol.for("props")].color=s.colors.color3},function(s,i,u){i[10].set("x",{transition:s.width-120})},function(s,i,u){i[10].set("on",s.mode==="dark")},function(s,i,u){i[10].set("bgColor",s.colors.color1)},function(s,i,u){i[11][Symbol.for("props")].x={transition:s.width-120}},function(s,i,u){i[11][Symbol.for("props")].on=s.mode==="dark"},function(s,i,u){i[11][Symbol.for("props")].bgColor=s.colors.color1},function(s,i,u){i[12].set("h",{transition:s.block1.height})},function(s,i,u){i[12].set("color",s.colors.color2)},function(s,i,u){i[12].set("effects",[s.shader("radius",{radius:s.radius/2})])},function(s,i,u){i[13].set("w",{transition:s.block2.w})},function(s,i,u){i[13].set("h",s.block2.h)},function(s,i,u){i[13].set("y",{transition:s.block2.y})},function(s,i,u){i[13].set("color",s.colors.color2)},function(s,i,u){i[13].set("effects",[s.shader("radius",{radius:s.radius/2})])},function(s,i,u){i[14].set("x",{transition:s.graph.x})},function(s,i,u){i[14].set("y",{transition:s.graph.y})},function(s,i,u){i[14].set("w",s.graph.w)},function(s,i,u){i[14].set("h",s.graph.h)},function(s,i,u){i[15].set("x",{transition:s.graph.offset})},function(s,i,u){i[15].set("y",{transition:s.graph.offset})},function(s,i,u){i[16].set("bgColor",s.colors.color2)},function(s,i,u){i[16].set("primaryColor",s.colors.color4)},function(s,i,u){i[16].set("size",s.graph.size)},function(s,i,u){i[17][Symbol.for("props")].bgColor=s.colors.color2},function(s,i,u){i[17][Symbol.for("props")].primaryColor=s.colors.color4},function(s,i,u){i[17][Symbol.for("props")].size=s.graph.size},function(s,i,u){i[18].set("bgColor",s.colors.color2)},function(s,i,u){i[18].set("primaryColor",s.colors.color4)},function(s,i,u){i[18].set("size",s.graph.size)},function(s,i,u){i[19][Symbol.for("props")].bgColor=s.colors.color2},function(s,i,u){i[19][Symbol.for("props")].primaryColor=s.colors.color4},function(s,i,u){i[19][Symbol.for("props")].size=s.graph.size},function(s,i,u){i[20].set("bgColor",s.colors.color2)},function(s,i,u){i[20].set("primaryColor",s.colors.color4)},function(s,i,u){i[20].set("size",s.graph.size)},function(s,i,u){i[21][Symbol.for("props")].bgColor=s.colors.color2},function(s,i,u){i[21][Symbol.for("props")].primaryColor=s.colors.color4},function(s,i,u){i[21][Symbol.for("props")].size=s.graph.size},function(s,i,u){i[22].set("bgColor",s.colors.color2)},function(s,i,u){i[22].set("primaryColor",s.colors.color4)},function(s,i,u){i[22].set("size",s.graph.size)},function(s,i,u){i[23][Symbol.for("props")].bgColor=s.colors.color2},function(s,i,u){i[23][Symbol.for("props")].primaryColor=s.colors.color4},function(s,i,u){i[23][Symbol.for("props")].size=s.graph.size},function(s,i,u){i[24].set("bgColor",s.colors.color2)},function(s,i,u){i[24].set("primaryColor",s.colors.color4)},function(s,i,u){i[24].set("size",s.graph.size)},function(s,i,u){i[25][Symbol.for("props")].bgColor=s.colors.color2},function(s,i,u){i[25][Symbol.for("props")].primaryColor=s.colors.color4},function(s,i,u){i[25][Symbol.for("props")].size=s.graph.size}],context:{}},state(){return{mode:"dark",radius:20,width:500,height:600}},computed:{colors(){return this.mode==="dark"?K4:Y4},text(){return this.mode==="dark"?"Dark mode":"Light mode"},block1(){return{height:this.height===600?180:720}},block2(){return{y:this.height===600?140:560,h:this.height===600?180:300,w:this.height===600?200:890}},graph(){return{x:this.height===600?32:270,y:this.height===600?370:140,w:this.height===600?0:890,h:this.height===600?0:400,offset:this.height===600?0:110,size:this.height===600?"small":"large"}}},input:{right(){this.toggleX=0,this.$setTimeout(()=>{this.mode="light"},150)},left(){this.toggleX=48,this.$setTimeout(()=>{this.mode="dark"},150)},up(){this.width=1200,this.height=900},down(){this.width=500,this.height=600}}}),Q4="ABC123",Z4="https://8b4fa39d.lightningjs.workers.dev";let c2,d2;const J4="w185",ek={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Q4}};function Cx(h,s=J4){return d2+s+h}function tk(...h){return c2?zh(...h):h2().then(()=>zh(...h))}function zh(h,s={}){return fetch(Z4+h,{...ek,...s}).then(i=>i.json())}function h2(){return zh("/configuration").then(h=>(c2=h,d2=h.images.secure_base_url,h))}const Zh={get:tk,loadConfig:h2},Ix=h=>Zh.get(`/${h}/popular`).then(p2),p2=h=>h.results.filter(i=>!i.adult).map(i=>({poster:Cx(i.poster_path||i.profile_path),background:Cx(i.backdrop_path,"w1280"),identifier:i.id,title:i.title||i.name,overview:i.overview})),Ta=h=>{const s=Array.isArray(h)?h:[h];return nk("movie").then(({genres:i})=>{let u=[];return i.forEach(o=>{s.includes(o.name)&&u.push(o.id)}),Zh.get(`/discover/movie?with_genres=${u.join()}`).then(p2)})},nk=h=>Zh.get(`/genre/${h}/list`),ik=He.Component("Poster",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=1280,x.h=720,x.x=i.x,x.color="{top: '0xffffffff', bottom: '0x000000ff'}",o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=185,d.h=278,d.x=54,d.y=220,o[2].nodeId||o[2].populate(d);const C=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[1],o[3]||(o[3]=this.element({parent:s||"root"},i));const b={};if(b.font="raleway",b.y=520,b.x=54,b.size=64,b.wordwrap=1e3,b.maxlines=1,typeof C<"u")for(let v in C.config.props)delete b[C.config.props[v]];o[3].nodeId||o[3].populate(b),s=o[3];const I={};if(I.content=i.item.title,I.font="raleway",I.y=520,I.x=54,I.size=64,I.wordwrap=1e3,I.maxlines=1,!o[4]){const v=I.is||"Text";o[4]=(u.components&&u.components[v]||i[Symbol.for("components")][v]||(()=>{console.error("component Text not found")})).call(null,{props:I},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}const k=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[1],o[5]||(o[5]=this.element({parent:s||"root"},i));const P={};if(P.size=21,P.y=620,P.x=60,P.color="0xccccccff",P.wordwrap=1e3,P.maxlines=2,P.lineheight=36,typeof k<"u")for(let v in k.config.props)delete P[k.config.props[v]];o[5].nodeId||o[5].populate(P),s=o[5];const O={};if(O.content=i.item.overview,O.size=21,O.y=620,O.x=60,O.color="0xccccccff",O.wordwrap=1e3,O.maxlines=2,O.lineheight=36,!o[6]){const v=O.is||"Text";o[6]=(u.components&&u.components[v]||i[Symbol.for("components")][v]||(()=>{console.error("component Text not found")})).call(null,{props:O},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("src",s.item.background)},function(s,i,u){i[0].set("scale",{transition:{value:s.scale,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(s,i,u){i[0].set("_effects",[s.shader("radius",{radius:8})])},function(s,i,u){i[1].set("alpha",{transition:{value:s.alpha,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(s,i,u){i[2].set("src",s.item.poster)},function(s,i,u){i[3].set("content",s.item.title)},function(s,i,u){i[4][Symbol.for("props")].content=s.item.title},function(s,i,u){i[5].set("content",s.item.overview)},function(s,i,u){i[6][Symbol.for("props")].content=s.item.overview}],context:{}},props:["src","index","item","width"],state(){return{scale:1,zIndex:1,alpha:0}},computed:{x(){return this.index*this.width}},hooks:{focus(){this.scale=1.1,this.alpha=1},unfocus(){this.scale=1,this.alpha=0}}}),ok=He.Component("Poster",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return x.w=185,x.h=278,x.x=i.x,o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){i[0].set("src",s.item.poster)},function(s,i,u){i[0].set("scale",{transition:{value:s.scale,duration:200,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(s,i,u){i[0].set("_effects",[s.shader("radius",{radius:8})])}],context:{}},props:["src","index","item","width"],state(){return{scale:1,color:"#333"}},computed:{x(){return this.index*this.width}},hooks:{focus(){this.color="#fff",this.scale=1.1},unfocus(){this.color="#333",this.scale=1}}}),rk=He.Component("PosterTitle",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=185,x.h=278,x.x=i.x,o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.x=10,o[1].nodeId||o[1].populate(y);const d=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const C={};if(C.font="raleway",C.size=22,C.wordwrap=185,C.maxlines=2,C.lineheight=28,typeof d<"u")for(let I in d.config.props)delete C[d.config.props[I]];o[2].nodeId||o[2].populate(C),s=o[2];const b={};if(b.content=i.item.title,b.font="raleway",b.size=22,b.wordwrap=185,b.maxlines=2,b.lineheight=28,!o[3]){const I=b.is||"Text";o[3]=(u.components&&u.components[I]||i[Symbol.for("components")][I]||(()=>{console.error("component Text not found")})).call(null,{props:b},o[2],i),o[3][Symbol.for("slots")][0]?(s=o[3][Symbol.for("slots")][0],i=o[3]):s=o[3][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("src",s.item.poster)},function(s,i,u){i[0].set("scale",{transition:{value:s.scale,duration:200,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(s,i,u){i[0].set("_effects",[s.shader("radius",{radius:8})])},function(s,i,u){i[1].set("y",{transition:{value:s.y,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(s,i,u){i[1].set("alpha",{transition:{value:s.alpha,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(s,i,u){i[2].set("content",s.item.title)},function(s,i,u){i[3][Symbol.for("props")].content=s.item.title}],context:{}},props:["src","index","item","width"],state(){return{scale:1,alpha:0,y:278}},computed:{x(){return this.index*this.width}},hooks:{focus(){this.scale=1.1,this.alpha=1,this.y=288},unfocus(){this.scale=1,this.alpha=0,this.y=278}}}),sk=He.Component("TmdbRow",{components:{Hero:ik,Poster:ok,PosterTitle:rk},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};return y.y=80,o[1].nodeId||o[1].populate(y),o},effects:[function(s,i,u){i[1].set("x",{transition:{value:s.x,duration:300,easing:"ease-in-out"}})},function(s,i,u){parent=i[1];const o=s.items||[],x=[];for(let y=0;y{console.error("component Component not found")})).call(null,{props:I},i[2][d.item.identifier],s),i[3][d.item.identifier][Symbol.for("slots")][0]?(parent=i[3][d.item.identifier][Symbol.for("slots")][0],s=i[3][d.item.identifier]):parent=i[3][d.item.identifier][Symbol.for("children")][0]}}i[2]&&Object.keys(i[2]).forEach(y=>{x.indexOf(y)===-1&&(i[2][y].destroy&&i[2][y].destroy(),delete i[1][y])})}],context:{}},props:["title","type","items","width"],state(){return{focused:0,offset:0}},hooks:{focus(){this.$trigger("focused")}},computed:{x(){return 150-Math.min(this.focused,this.items.length-1720/this.width)*this.width}},watch:{focused(h){const s=this.select("poster"+h);s&&s.focus&&(s.focus(),this.$emit("posterSelect",this.items[h]))}},input:{left(){this.focused=Math.max(this.focused-1,0)},right(){this.focused=Math.min(this.focused+1,this.items.length-1)}}}),ak=He.Component("Background",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=1920,y.h=1080,y.color="{top: '0xffffffff', bottom: '0x000000ff'}",o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=1920,d.h=1080,d.color="{top: '0xffffffff', bottom: '0x000000ff'}",o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};return C.w=1920,C.h=1080,C.src="assets/gradient.png",C.color="0x8866ddff",C.alpha=.8,o[3].nodeId||o[3].populate(C),o},effects:[function(s,i,u){i[1].set("src",s.bg1)},function(s,i,u){i[1].set("alpha",{transition:{value:s.alpha1,duration:400,easing:"ease-in"}})},function(s,i,u){i[2].set("src",s.bg2)},function(s,i,u){i[2].set("alpha",{transition:{value:s.alpha2,duration:400,easing:"ease-in"}})}],context:{}},props:["src"],state(){return{counter:0,alpha1:0,alpha2:0,bg1:!1,bg2:!1}},watch:{src(h){this.counter=(this.counter+1)%2,this.counter===0?(this.bg1=h,this.alpha1=.8,this.alpha2=0):(this.bg2=h,this.alpha1=0,this.alpha2=.8)}}}),lk=He.Component("TMdb",{components:{Background:ak,TmdbRow:sk},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=1920,x.h=1080,x.color="0x000000ff",o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Background||i[Symbol.for("components")].Background;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(typeof y<"u")for(let $ in y.config.props)delete d[y.config.props[$]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.src=i.src,!o[2]){const $=C.is||"Background";o[2]=(u.components&&u.components[$]||i[Symbol.for("components")][$]||(()=>{console.error("component Background not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const b={};o[3].nodeId||o[3].populate(b),s=o[3],o[4]||(o[4]=this.element({parent:s||"root"},i));const I={};o[4].nodeId||o[4].populate(I),s=o[4],o[5]||(o[5]=this.element({parent:s||"root"},i));const k={};k.src="assets/logo.png",k.x=140,k.y=90,k.w=243,k.h=52,o[5].nodeId||o[5].populate(k);const P=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[4],o[6]||(o[6]=this.element({parent:s||"root"},i));const O={};if(O.font="raleway",O.size=80,O.x=140,O.y=300,O.wordwrap=1e3,O["@loaded"]=i.positionText&&i.positionText.bind(i),O.maxlines=1,typeof P<"u")for(let $ in P.config.props)delete O[P.config.props[$]];o[6].nodeId||o[6].populate(O),s=o[6];const v={};if(v.content=i.title,v.font="raleway",v.size=80,v.x=140,v.y=300,v.wordwrap=1e3,v["@loaded"]=i.positionText&&i.positionText.bind(i),v.maxlines=1,!o[7]){const $=v.is||"Text";o[7]=(u.components&&u.components[$]||i[Symbol.for("components")][$]||(()=>{console.error("component Text not found")})).call(null,{props:v},o[6],i),o[7][Symbol.for("slots")][0]?(s=o[7][Symbol.for("slots")][0],i=o[7]):s=o[7][Symbol.for("children")][0]}const N=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[4],o[8]||(o[8]=this.element({parent:s||"root"},i));const V={};if(V.wordwrap=880,V.x=140,V.y=430,V.lineheight=40,V.maxlines=3,typeof N<"u")for(let $ in N.config.props)delete V[N.config.props[$]];o[8].nodeId||o[8].populate(V),s=o[8];const G={};if(G.content=i.overview,G.wordwrap=880,G.x=140,G.y=430,G.lineheight=40,G.maxlines=3,!o[9]){const $=G.is||"Text";o[9]=(u.components&&u.components[$]||i[Symbol.for("components")][$]||(()=>{console.error("component Text not found")})).call(null,{props:G},o[8],i),o[9][Symbol.for("slots")][0]?(s=o[9][Symbol.for("slots")][0],i=o[9]):s=o[9][Symbol.for("children")][0]}s=o[3],o[10]||(o[10]=this.element({parent:s||"root"},i));const ie={};return o[10].nodeId||o[10].populate(ie),o},effects:[function(s,i,u){i[1].set("src",s.src)},function(s,i,u){i[2][Symbol.for("props")].src=s.src},function(s,i,u){i[4].set("y",{transition:{value:s.contentY,duration:s.duration}})},function(s,i,u){i[4].set("alpha",{transition:{value:s.alpha,duration:s.duration}})},function(s,i,u){i[6].set("content",s.title)},function(s,i,u){i[7][Symbol.for("props")].content=s.title},function(s,i,u){i[8].set("content",s.overview)},function(s,i,u){i[9][Symbol.for("props")].content=s.overview},function(s,i,u){i[10].set("y",{transition:{value:s.y,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(s,i,u){parent=i[10];const o=s.rows||[],x=[];for(let y=0;y{console.error("component TmdbRow not found")})).call(null,{props:I},i[11][d.row.title],s),i[12][d.row.title][Symbol.for("slots")][0]?(parent=i[12][d.row.title][Symbol.for("slots")][0],s=i[12][d.row.title]):parent=i[12][d.row.title][Symbol.for("children")][0]}i[11][d.row.title].set("items",d.row.items),i[11][d.row.title].set("type",d.row.type),i[11][d.row.title].set("width",d.row.width),i[12][d.row.title][Symbol.for("props")].items=d.row.items,i[12][d.row.title][Symbol.for("props")].type=d.row.type,i[12][d.row.title][Symbol.for("props")].width=d.row.width}i[11]&&Object.keys(i[11]).forEach(y=>{x.indexOf(y)===-1&&(i[11][y].destroy&&i[11][y].destroy(),delete i[1][y])})}],context:{}},state(){return{rows:[],items:[],src:"",focused:null,alpha:1,y:550,contentY:0,scale:1,title:"",overview:"",type:"Poster",duration:300}},watch:{focused(h){const s=this.select("row"+h);s&&s.focus&&s.focus()}},hooks:{async ready(){this.$listen("posterSelect",h=>{this.focused===0&&(this.src=h.background,this.title=h.title,this.overview=h.overview)}),this.rows.push({title:"Popular Movies",items:await Ix("movie"),type:"Poster",width:215,y:0}),this.rows.push({title:"Best Western movies",items:await Ta(["Western"]),type:"Hero",width:1370,y:358}),this.rows.push({title:"Best Comedy movies",items:await Ta(["Comedy"]),type:"PosterTitle",width:215,y:1158}),this.rows.push({title:"Popular TV shows",items:await Ix("tv"),type:"PosterTitle",width:215,y:1536}),this.rows.push({title:"Best Adventure and Action movies",items:await Ta(["adventure","action"]),type:"Hero",width:1370,y:1914}),this.rows.push({title:"Best Documentaries",items:await Ta("Documentary"),type:"PosterTitle",width:215,y:2714}),this.rows.push({title:"Best Western movies 2",items:await Ta("Western"),type:"PosterTitle",width:215,y:3092}),this.focused=0},focus(){this.$trigger("focused")}},input:{up(){this.contentY=0,this.duration=300,this.focused=Math.max(this.focused-1,0),this.y=(this.focused===0?550:90)-this.rows[this.focused].y,this.alpha=this.focused===0?1:0},down(){this.contentY=-60,this.duration=200,this.focused=Math.min(this.focused+1,this.rows.length-1),this.y=(this.focused===0?550:90)-this.rows[this.focused].y,this.alpha=this.focused===0?1:0}}}),uk=He.Component("MenuSprite",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.src="assets/menusprite.png",d.x=748,d.y=120,d.w=425,d.h=340,o[2].nodeId||o[2].populate(d),s=o[1],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.y=680,C.x=560,o[3].nodeId||o[3].populate(C);const b=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[3],o[4]||(o[4]=this.element({parent:s||"root"},i));const I={};if(I.image="assets/menusprite.png",I.x=0,I.w=140,I.h=140,I.map=i.map,typeof b<"u")for(let ee in b.config.props)delete I[b.config.props[ee]];o[4].nodeId||o[4].populate(I),s=o[4];const k={};if(k.image="assets/menusprite.png",k.x=0,k.w=140,k.h=140,k.map=i.map,k.frame=i.icon1,!o[5]){const ee=k.is||"Sprite";o[5]=(u.components&&u.components[ee]||i[Symbol.for("components")][ee]||(()=>{console.error("component Sprite not found")})).call(null,{props:k},o[4],i),o[5][Symbol.for("slots")][0]?(s=o[5][Symbol.for("slots")][0],i=o[5]):s=o[5][Symbol.for("children")][0]}const P=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[3],o[6]||(o[6]=this.element({parent:s||"root"},i));const O={};if(O.image="assets/menusprite.png",O.x=220,O.w=140,O.h=140,O.map=i.map,O.frame="icon2",typeof P<"u")for(let ee in P.config.props)delete O[P.config.props[ee]];o[6].nodeId||o[6].populate(O),s=o[6];const v={};if(v.image="assets/menusprite.png",v.x=220,v.w=140,v.h=140,v.map=i.map,v.frame="icon2",!o[7]){const ee=v.is||"Sprite";o[7]=(u.components&&u.components[ee]||i[Symbol.for("components")][ee]||(()=>{console.error("component Sprite not found")})).call(null,{props:v},o[6],i),o[7][Symbol.for("slots")][0]?(s=o[7][Symbol.for("slots")][0],i=o[7]):s=o[7][Symbol.for("children")][0]}const N=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[3],o[8]||(o[8]=this.element({parent:s||"root"},i));const V={};if(V.image="assets/menusprite.png",V.x=440,V.w=140,V.h=140,V.map=i.map,V.frame="icon3",typeof N<"u")for(let ee in N.config.props)delete V[N.config.props[ee]];o[8].nodeId||o[8].populate(V),s=o[8];const G={};if(G.image="assets/menusprite.png",G.x=440,G.w=140,G.h=140,G.map=i.map,G.frame="icon3",!o[9]){const ee=G.is||"Sprite";o[9]=(u.components&&u.components[ee]||i[Symbol.for("components")][ee]||(()=>{console.error("component Sprite not found")})).call(null,{props:G},o[8],i),o[9][Symbol.for("slots")][0]?(s=o[9][Symbol.for("slots")][0],i=o[9]):s=o[9][Symbol.for("children")][0]}const ie=u.components&&u.components.Sprite||i[Symbol.for("components")].Sprite;s=o[3],o[10]||(o[10]=this.element({parent:s||"root"},i));const $={};if($.image="assets/menusprite.png",$.x=660,$.w=140,$.h=140,$.map=i.map,$.frame="icon4_unfocus",typeof ie<"u")for(let ee in ie.config.props)delete $[ie.config.props[ee]];o[10].nodeId||o[10].populate($),s=o[10];const ne={};if(ne.image="assets/menusprite.png",ne.x=660,ne.w=140,ne.h=140,ne.map=i.map,ne.frame="icon4_unfocus",!o[11]){const ee=ne.is||"Sprite";o[11]=(u.components&&u.components[ee]||i[Symbol.for("components")][ee]||(()=>{console.error("component Sprite not found")})).call(null,{props:ne},o[10],i),o[11][Symbol.for("slots")][0]?(s=o[11][Symbol.for("slots")][0],i=o[11]):s=o[11][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[4].set("frame",s.icon1)},function(s,i,u){i[5][Symbol.for("props")].frame=s.icon1}],context:{}},state(){return{icon1:"icon1_unfocus",map:{defaults:{w:160,h:160},frames:{icon1_focus:{x:0,y:0},icon1_unfocus:{x:170,y:340},icon2:{x:170,y:0},icon3:{x:350,y:0},icon4_unfocus:{x:680,y:170}}}}},hooks:{ready(){this.$setInterval(()=>{this.icon1=this.icon1==="icon1_unfocus"?"icon1_focus":"icon1_unfocus"},2e3)}}}),tf=["menu"],fk=He.Component("Sprites",{components:{MenuSprite:uk},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.MenuSprite||i[Symbol.for("components")].MenuSprite;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(typeof y<"u")for(let b in y.config.props)delete d[y.config.props[b]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.show=i.currentSprite==="menu",!o[2]){const b=C.is||"MenuSprite";o[2]=(u.components&&u.components[b]||i[Symbol.for("components")][b]||(()=>{console.error("component MenuSprite not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[1].set("show",s.currentSprite==="menu")},function(s,i,u){i[2][Symbol.for("props")].show=s.currentSprite==="menu"}],context:{}},state(){return{currentSprite:"menu"}},input:{down(){const h=tf.indexOf(this.currentSprite);h{console.error("component Button not found")})).call(null,{props:b},o[2],i),o[3][Symbol.for("slots")][0]?(s=o[3][Symbol.for("slots")][0],i=o[3]):s=o[3][Symbol.for("children")][0]}const I=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const k={};if(k.color="0xe4e4e7ff",k.y=100,k.ref="menu2",typeof I<"u")for(let $ in I.config.props)delete k[I.config.props[$]];o[4].nodeId||o[4].populate(k),s=o[4];const P={};if(P.color="0xe4e4e7ff",P.y=100,P.ref="menu2",!o[5]){const $=P.is||"Button";o[5]=(u.components&&u.components[$]||i[Symbol.for("components")][$]||(()=>{console.error("component Button not found")})).call(null,{props:P},o[4],i),o[5][Symbol.for("slots")][0]?(s=o[5][Symbol.for("slots")][0],i=o[5]):s=o[5][Symbol.for("children")][0]}const O=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[6]||(o[6]=this.element({parent:s||"root"},i));const v={};if(v.color="0xe4e4e7ff",v.y=200,v.ref="menu3",typeof O<"u")for(let $ in O.config.props)delete v[O.config.props[$]];o[6].nodeId||o[6].populate(v),s=o[6];const N={};if(N.color="0xe4e4e7ff",N.y=200,N.ref="menu3",!o[7]){const $=N.is||"Button";o[7]=(u.components&&u.components[$]||i[Symbol.for("components")][$]||(()=>{console.error("component Button not found")})).call(null,{props:N},o[6],i),o[7][Symbol.for("slots")][0]?(s=o[7][Symbol.for("slots")][0],i=o[7]):s=o[7][Symbol.for("children")][0]}const V=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[8]||(o[8]=this.element({parent:s||"root"},i));const G={};if(G.color="0xe4e4e7ff",G.y=300,G.ref="menu4",typeof V<"u")for(let $ in V.config.props)delete G[V.config.props[$]];o[8].nodeId||o[8].populate(G),s=o[8];const ie={};if(ie.color="0xe4e4e7ff",ie.y=300,ie.ref="menu4",!o[9]){const $=ie.is||"Button";o[9]=(u.components&&u.components[$]||i[Symbol.for("components")][$]||(()=>{console.error("component Button not found")})).call(null,{props:ie},o[8],i),o[9][Symbol.for("slots")][0]?(s=o[9][Symbol.for("slots")][0],i=o[9]):s=o[9][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("x",{transition:s.x})}],context:{}},state(){return{x:-360,focused:1}},hooks:{focus(){this.$trigger("focused"),this.x=0}},watch:{focused(){const h=this.select(`menu${this.focused}`);h&&h.focus&&h.focus()}},input:{right(){this.parent.focus(),this.x=-360},down(){this.focused=Math.min(this.focused+1,4)},up(){this.focused=Math.max(this.focused-1,1)},left(){}}}),dk=He.Component("FocusHandling",{components:{Menu:ck,Button:m2},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.x=300,y.y=150,o[1].nodeId||o[1].populate(y);const d=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const C={};if(C.color="0xef4444ff",C.x=0,C.ref="button1",typeof d<"u")for(let fe in d.config.props)delete C[d.config.props[fe]];o[2].nodeId||o[2].populate(C),s=o[2];const b={};if(b.color="0xef4444ff",b.x=0,b.ref="button1",!o[3]){const fe=b.is||"Button";o[3]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:b},o[2],i),o[3][Symbol.for("slots")][0]?(s=o[3][Symbol.for("slots")][0],i=o[3]):s=o[3][Symbol.for("children")][0]}const I=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const k={};if(k.color="0xf97316ff",k.x=320,k.ref="button2",typeof I<"u")for(let fe in I.config.props)delete k[I.config.props[fe]];o[4].nodeId||o[4].populate(k),s=o[4];const P={};if(P.color="0xf97316ff",P.x=320,P.ref="button2",!o[5]){const fe=P.is||"Button";o[5]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:P},o[4],i),o[5][Symbol.for("slots")][0]?(s=o[5][Symbol.for("slots")][0],i=o[5]):s=o[5][Symbol.for("children")][0]}const O=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[6]||(o[6]=this.element({parent:s||"root"},i));const v={};if(v.color="0x84cc16ff",v.x=640,v.ref="button3",typeof O<"u")for(let fe in O.config.props)delete v[O.config.props[fe]];o[6].nodeId||o[6].populate(v),s=o[6];const N={};if(N.color="0x84cc16ff",N.x=640,N.ref="button3",!o[7]){const fe=N.is||"Button";o[7]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:N},o[6],i),o[7][Symbol.for("slots")][0]?(s=o[7][Symbol.for("slots")][0],i=o[7]):s=o[7][Symbol.for("children")][0]}const V=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[8]||(o[8]=this.element({parent:s||"root"},i));const G={};if(G.color="0x10b981ff",G.x=0,G.y=100,G.ref="button4",typeof V<"u")for(let fe in V.config.props)delete G[V.config.props[fe]];o[8].nodeId||o[8].populate(G),s=o[8];const ie={};if(ie.color="0x10b981ff",ie.x=0,ie.y=100,ie.ref="button4",!o[9]){const fe=ie.is||"Button";o[9]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:ie},o[8],i),o[9][Symbol.for("slots")][0]?(s=o[9][Symbol.for("slots")][0],i=o[9]):s=o[9][Symbol.for("children")][0]}const $=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[10]||(o[10]=this.element({parent:s||"root"},i));const ne={};if(ne.color="0x06b6d4ff",ne.y=100,ne.x=320,ne.ref="button5",typeof $<"u")for(let fe in $.config.props)delete ne[$.config.props[fe]];o[10].nodeId||o[10].populate(ne),s=o[10];const ee={};if(ee.color="0x06b6d4ff",ee.y=100,ee.x=320,ee.ref="button5",!o[11]){const fe=ee.is||"Button";o[11]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:ee},o[10],i),o[11][Symbol.for("slots")][0]?(s=o[11][Symbol.for("slots")][0],i=o[11]):s=o[11][Symbol.for("children")][0]}const le=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[12]||(o[12]=this.element({parent:s||"root"},i));const X={};if(X.color="0x3b82f6ff",X.y=100,X.x=640,X.ref="button6",typeof le<"u")for(let fe in le.config.props)delete X[le.config.props[fe]];o[12].nodeId||o[12].populate(X),s=o[12];const oe={};if(oe.color="0x3b82f6ff",oe.y=100,oe.x=640,oe.ref="button6",!o[13]){const fe=oe.is||"Button";o[13]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:oe},o[12],i),o[13][Symbol.for("slots")][0]?(s=o[13][Symbol.for("slots")][0],i=o[13]):s=o[13][Symbol.for("children")][0]}const re=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[14]||(o[14]=this.element({parent:s||"root"},i));const E={};if(E.color="0x8b5cf6ff",E.y=200,E.x=0,E.ref="button7",typeof re<"u")for(let fe in re.config.props)delete E[re.config.props[fe]];o[14].nodeId||o[14].populate(E),s=o[14];const H={};if(H.color="0x8b5cf6ff",H.y=200,H.x=0,H.ref="button7",!o[15]){const fe=H.is||"Button";o[15]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:H},o[14],i),o[15][Symbol.for("slots")][0]?(s=o[15][Symbol.for("slots")][0],i=o[15]):s=o[15][Symbol.for("children")][0]}const Q=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[16]||(o[16]=this.element({parent:s||"root"},i));const ge={};if(ge.color="0xd946efff",ge.y=200,ge.x=320,ge.ref="button8",typeof Q<"u")for(let fe in Q.config.props)delete ge[Q.config.props[fe]];o[16].nodeId||o[16].populate(ge),s=o[16];const ae={};if(ae.color="0xd946efff",ae.y=200,ae.x=320,ae.ref="button8",!o[17]){const fe=ae.is||"Button";o[17]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:ae},o[16],i),o[17][Symbol.for("slots")][0]?(s=o[17][Symbol.for("slots")][0],i=o[17]):s=o[17][Symbol.for("children")][0]}const q=u.components&&u.components.Button||i[Symbol.for("components")].Button;s=o[1],o[18]||(o[18]=this.element({parent:s||"root"},i));const Y={};if(Y.color="0xf43f5eff",Y.y=200,Y.x=640,Y.ref="button9",typeof q<"u")for(let fe in q.config.props)delete Y[q.config.props[fe]];o[18].nodeId||o[18].populate(Y),s=o[18];const K={};if(K.color="0xf43f5eff",K.y=200,K.x=640,K.ref="button9",!o[19]){const fe=K.is||"Button";o[19]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Button not found")})).call(null,{props:K},o[18],i),o[19][Symbol.for("slots")][0]?(s=o[19][Symbol.for("slots")][0],i=o[19]):s=o[19][Symbol.for("children")][0]}const de=u.components&&u.components.Menu||i[Symbol.for("components")].Menu;s=o[0],o[20]||(o[20]=this.element({parent:s||"root"},i));const ve={};if(ve.ref="menu",typeof de<"u")for(let fe in de.config.props)delete ve[de.config.props[fe]];o[20].nodeId||o[20].populate(ve),s=o[20];const pe={};if(pe.ref="menu",!o[21]){const fe=pe.is||"Menu";o[21]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Menu not found")})).call(null,{props:pe},o[20],i),o[21][Symbol.for("slots")][0]?(s=o[21][Symbol.for("slots")][0],i=o[21]):s=o[21][Symbol.for("children")][0]}return o},effects:[],context:{}},state(){return{focused:1}},hooks:{focus(){this.$trigger("focused")}},watch:{focused(h){const s=this.select(`button${h}`);s&&s.focus&&s.focus()}},input:{right(){this.focused=Math.min(this.focused+1,9)},left(){const h=this.focused-1;if(h===0){const s=this.select("menu");s&&s.focus&&s.focus()}else this.focused=Math.max(h,1)},a(){const h=this.select("menu");h&&h.focus&&h.focus()}}}),hk=He.Component("Positioning",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=100,y.h=100,y.x=20,y.y=20,y.color="0xecfeffff",o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=100,d.h=100,d.x=140,d.y=20,d.color="0xa5f3fcff",o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=100,C.h=100,C.x=260,C.y=20,C.color="0x22d3eeff",o[3].nodeId||o[3].populate(C),s=o[0],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.w=100,b.h=100,b.x=380,b.y=20,b.color="0x0891b2ff",o[4].nodeId||o[4].populate(b),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.w=100,I.h=100,I.x=i.x1,I.y=i.y,I.color="0xfdf4ffff",o[5].nodeId||o[5].populate(I),s=o[0],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.w=100,k.h=100,k.x=i.x2,k.y=i.y,k.color="0xf5d0feff",o[6].nodeId||o[6].populate(k),s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};P.w=100,P.h=100,P.x=i.x3,P.y=i.y,P.color="0xe879f9ff",o[7].nodeId||o[7].populate(P),s=o[0],o[8]||(o[8]=this.element({parent:s||"root"},i));const O={};O.w=100,O.h=100,O.x=i.x4,O.y=i.y,O.color="0xc026d3ff",o[8].nodeId||o[8].populate(O),s=o[0],o[9]||(o[9]=this.element({parent:s||"root"},i));const v={};v.w=100,v.h=100,v.y=260,v.color="0xfff7edff",o[9].nodeId||o[9].populate(v),s=o[0],o[10]||(o[10]=this.element({parent:s||"root"},i));const N={};N.w=100,N.h=100,N.y=260,N.color="0xfed7aaff",o[10].nodeId||o[10].populate(N),s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const V={};V.w=100,V.h=100,V.y=260,V.color="0xfb923cff",o[11].nodeId||o[11].populate(V),s=o[0],o[12]||(o[12]=this.element({parent:s||"root"},i));const G={};G.w=100,G.h=100,G.y=260,G.color="0xea580cff",o[12].nodeId||o[12].populate(G),s=o[0],o[13]||(o[13]=this.element({parent:s||"root"},i));const ie={};ie.w=800,ie.h=800,ie.y=20,ie.x=800,ie.color="0xecfdf5ff",o[13].nodeId||o[13].populate(ie),s=o[13],o[14]||(o[14]=this.element({parent:s||"root"},i));const $={};$.w=600,$.h=600,$.y=20,$.x=20,$.color="0xa7f3d0ff",o[14].nodeId||o[14].populate($),s=o[14],o[15]||(o[15]=this.element({parent:s||"root"},i));const ne={};ne.w=400,ne.h=400,ne.y=100,ne.x=20,ne.color="0x34d399ff",o[15].nodeId||o[15].populate(ne),s=o[15],o[16]||(o[16]=this.element({parent:s||"root"},i));const ee={};ee.w=200,ee.h=100,ee.color="0x059669ff",o[16].nodeId||o[16].populate(ee),s=o[16],o[17]||(o[17]=this.element({parent:s||"root"},i));const le={};le.w=50,le.h=50,le.color="0x065f46ff",o[17].nodeId||o[17].populate(le),s=o[0],o[18]||(o[18]=this.element({parent:s||"root"},i));const X={};X.w=100,X.h=100,X.y=500,X.x=20,X.color="0xe11d48ff",o[18].nodeId||o[18].populate(X),s=o[0],o[19]||(o[19]=this.element({parent:s||"root"},i));const oe={};oe.w=200,oe.h=200,oe.x=300,oe.y=600,oe.color="0x94a3b8ff",oe.z=100,o[19].nodeId||o[19].populate(oe);const re=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[19],o[20]||(o[20]=this.element({parent:s||"root"},i));const E={};if(E.content="Lightning!",E.x=100,E.y=140,typeof re<"u")for(let fe in re.config.props)delete E[re.config.props[fe]];o[20].nodeId||o[20].populate(E),s=o[20];const H={};if(H.content="Lightning!",H.x=100,H.y=140,!o[21]){const fe=H.is||"Text";o[21]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Text not found")})).call(null,{props:H},o[20],i),o[21][Symbol.for("slots")][0]?(s=o[21][Symbol.for("slots")][0],i=o[21]):s=o[21][Symbol.for("children")][0]}s=o[19],o[22]||(o[22]=this.element({parent:s||"root"},i));const Q={};Q.w=300,Q.h=100,Q.color="0x475569ff",o[22].nodeId||o[22].populate(Q);const ge=u.components&&u.components.Circle||i[Symbol.for("components")].Circle;s=o[19],o[23]||(o[23]=this.element({parent:s||"root"},i));const ae={};if(ae.x=150,ae.y=150,ae.size=100,ae.color="0xffffffff",typeof ge<"u")for(let fe in ge.config.props)delete ae[ge.config.props[fe]];o[23].nodeId||o[23].populate(ae),s=o[23];const q={};if(q.x=150,q.y=150,q.size=100,q.color="0xffffffff",!o[24]){const fe=q.is||"Circle";o[24]=(u.components&&u.components[fe]||i[Symbol.for("components")][fe]||(()=>{console.error("component Circle not found")})).call(null,{props:q},o[23],i),o[24][Symbol.for("slots")][0]?(s=o[24][Symbol.for("slots")][0],i=o[24]):s=o[24][Symbol.for("children")][0]}s=o[0],o[25]||(o[25]=this.element({parent:s||"root"},i));const Y={};Y.w=300,Y.h=300,Y.x=300,Y.y=600,Y.color="0xef444480",o[25].nodeId||o[25].populate(Y),s=o[0],o[26]||(o[26]=this.element({parent:s||"root"},i));const K={};K.w=400,K.h=100,K.x=800,K.y=900,K.color="0x0284c7ff",o[26].nodeId||o[26].populate(K),s=o[26],o[27]||(o[27]=this.element({parent:s||"root"},i));const de={};de.w=s.node.width*(42/100),de.h=s.node.height*(30/100),de.y=s.node.height*(5/100),de.x=s.node.width*(1/100),de.color="0x075985ff",o[27].nodeId||o[27].populate(de),s=o[26],o[28]||(o[28]=this.element({parent:s||"root"},i));const ve={};ve.h=s.node.height*(30/100),ve.y=s.node.height*(35/100),ve.x=s.node.width*(1/100),ve.color="0x6b21a8ff",o[28].nodeId||o[28].populate(ve),s=o[26],o[29]||(o[29]=this.element({parent:s||"root"},i));const pe={};return pe.h=s.node.height*(30/100),pe.y=s.node.height*(65/100),pe.x=s.node.width*(1/100),pe.color="0x9f1239ff",o[29].nodeId||o[29].populate(pe),o},effects:[function(s,i,u){i[9].set("x",s.xA)},function(s,i,u){i[10].set("x",s.xB)},function(s,i,u){i[11].set("x",s.xC)},function(s,i,u){i[12].set("x",s.xD)},function(s,i,u){i[16].set("y",(400-100)/2)},function(s,i,u){i[16].set("x",(400-200)/2)},function(s,i,u){i[17].set("y",{transition:s.yNested})},function(s,i,u){i[17].set("x",{transition:s.xNested})},function(s,i,u){i[28].set("w",s.bar2.v)},function(s,i,u){i[29].set("w",{transition:s.bar3})}],context:{}},state(){return{x1:20,x2:140,x3:20+140+100,x4:380,y:140,xA:20,xB:140,xC:260,xD:380,yNested:0,xNested:0,bar2:{direction:"up",v:"10%"},bar3:"10%"}},hooks:{ready(){this.$setTimeout(()=>{this.xD=this.xD+200,this.xC=this.xC+100,this.xB=this.xB+50,this.xA=this.xA+25},4e3),this.$setInterval(()=>{this.yNested=this.yNested===0?50:0},2e3),this.$setInterval(()=>{this.xNested=this.xNested===0?150:0},1e3),this.$setInterval(()=>{const h=parseFloat(this.bar2.v),s=this.bar2.direction==="up"?h+10:h-10;this.bar2.v=s+"%",s>=90&&(this.bar2.direction="down"),s<=10&&(this.bar2.direction="up")},400),this.$setInterval(()=>{this.bar3=Math.ceil(Math.random()*96)+"%"},2e3)}}});var pk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mk(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var g2={};/* + @license + Shaka Player + Copyright 2016 Google LLC + SPDX-License-Identifier: Apache-2.0 +*/(function(h){(function(){var s=typeof window<"u"?window:pk,i={};(function(o,x,y){var d;function C(e){var t=0;return function(){return t>>0)+"_",a=0;return t}),P("Symbol.iterator",function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n"u"?!0:(typeof f=="function"?f=new f("unhandledrejection",{cancelable:!0}):typeof c=="function"?f=new c("unhandledrejection",{cancelable:!0}):(f=k.document.createEvent("CustomEvent"),f.initCustomEvent("unhandledrejection",!1,!0,f)),f.promise=this,f.reason=this.i,p(f))},t.prototype.u=function(){if(this.g!=null){for(var f=0;fn&&(n=Math.max(n+a,0));n=l}});function it(e,t){e instanceof String&&(e+="");var n=0,r=!1,a={next:function(){if(!r&&nt||1342177279>>=1)&&(n+=n);return r}}),P("Number.isNaN",function(e){return e||function(t){return typeof t=="number"&&isNaN(t)}}),P("Number.isFinite",function(e){return e||function(t){return typeof t!="number"?!1:!isNaN(t)&&t!==1/0&&t!==-1/0}}),P("Object.values",function(e){return e||function(t){var n=[],r;for(r in t)ze(t,r)&&n.push(t[r]);return n}}),P("Math.log2",function(e){return e||function(t){return Math.log(t)/Math.LN2}}),P("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991}),P("Math.trunc",function(e){return e||function(t){if(t=Number(t),isNaN(t)||t===1/0||t===-1/0||t===0)return t;var n=Math.floor(Math.abs(t));return 0>t?-n:n}}),P("Object.entries",function(e){return e||function(t){var n=[],r;for(r in t)ze(t,r)&&n.push([r,t[r]]);return n}});var ct=this||self;function he(e,t){e=e.split(".");var n=ct;e[0]in n||typeof n.execScript>"u"||n.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)e.length||t===void 0?n[r]&&n[r]!==Object.prototype[r]?n=n[r]:n=n[r]={}:n[r]=t}function _t(e){this.g=Math.exp(Math.log(.5)/e),this.i=this.h=0}_t.prototype.sample=function(e,t){var n=Math.pow(this.g,e);t=t*(1-n)+n*this.h,isNaN(t)||(this.h=t,this.i+=e)};function kt(e){return e.h/(1-Math.pow(e.g,e.i))}function Lt(){this.h=new _t(2),this.j=new _t(5),this.g=0,this.i=128e3,this.l=16e3}Lt.prototype.configure=function(e){this.i=e.minTotalBytes,this.l=e.minBytes,this.h.g=Math.exp(Math.log(.5)/e.fastHalfLife),this.j.g=Math.exp(Math.log(.5)/e.slowHalfLife)},Lt.prototype.sample=function(e,t){if(!(tt)throw Error("Bad port number "+t);e.nc=t}else e.nc=null}function vs(e,t,n){t instanceof ws?e.g=t:(n||(t=Ss(t,C2)),e.g=new ws(t))}function xs(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function Ss(e,t,n){return e!=null?(e=encodeURI(e).replace(t,S2),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function S2(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(e&15).toString(16)}var cp=/[#\/\?@]/g,w2=/[#\?:]/g,T2=/[#\?]/g,C2=/[#\?@]/g,I2=/#/g;function ws(e){this.g=e||null}function Va(e){if(!e.xa&&(e.xa={},e.Nc=0,e.g))for(var t=e.g.split("&"),n=0;n=e.l&&g.startTime=n.h||(e<=n.g&&t>=n.h?n.g=n.h=null:e<=n.g&&tn.g&&t>=n.h&&(n.h=e)),H(r)})};function A2(e,t,n){e.l=t,e.m=n}function pp(e,t,n){if(e.A=t,t=e.o.get(t))for(var r=v(t.keys()),a=r.next();!a.done;a=r.next())(a=t.get(a.value).filter(function(l){return l.endTime<=n}))&&e.j.append(a)}function mp(e,t,n){t.startTime+=n,t.endTime+=n,t=v(t.nestedCues);for(var r=t.next();!r.done;r=t.next())mp(e,r.value,n)}function k2(e,t,n,r,a){var l=n+" "+r,f=new Map;t=v(t);for(var c=t.next();!c.done;c=t.next()){var p=c.value;c=p.stream,p=p.cue,f.has(c)||f.set(c,new Map),f.get(c).has(l)||f.get(c).set(l,[]),mp(e,p,a),p.startTime>=e.l&&p.startTimeA?(A=_,R=[D.Gc]):_==A&&R.push(D.Gc);l.push.apply(l,N(R))}),a=l}n=new Set,t=new Set;var f=v(a);for(a=f.next();!a.done;a=f.next())a=a.value,a.audio&&n.add(a.audio),a.video&&t.add(a.video);n=Array.from(n).sort(function(A,M){return A.bandwidth-M.bandwidth});var c=[];for(a=new Map,n=v(n),f=n.next();!f.done;f=n.next()){f=f.value;var p=f.language+(f.channelsCount||0)+(f.audioSamplingRate||0)+f.roles.join(",")+f.label+f.groupId+f.fastSwitching,m=a.get(p)||[];if(m.length){var g=m[m.length-1],S=Qn(g.codecs),T=Qn(f.codecs);S==T&&f.bandwidth>g.bandwidth&&(m.push(f),c.push(f.id))}else m.push(f),c.push(f.id);a.set(p,m)}n=Array.from(t).sort(function(A,M){return A.bandwidth&&M.bandwidth?A.bandwidth-M.bandwidth:A.width-M.width}),t=ln();var w=[];for(a=new Map,n=v(n),f=n.next();!f.done;f=n.next()){if(f=f.value,p=Math.round(f.frameRate||0)+(f.hdr||"")+f.fastSwitching,m=a.get(p)||[],m.length){if(g=m[m.length-1],!t&&(S=Qn(g.codecs),T=Qn(f.codecs),S!==T))continue;f.width>g.width||f.height>g.height?(m.push(f),w.push(f.id)):f.width==g.width&&f.height==g.height&&(S=Qn(g.codecs),T=Qn(f.codecs),S==T&&f.bandwidth>g.bandwidth&&(m.push(f),w.push(f.id)))}else m.push(f),w.push(f.id);a.set(p,m)}e.variants=e.variants.filter(function(A){var M=A.audio;return A=A.video,!(M&&!c.includes(M.id)||A&&!w.includes(A.id))})}function R2(e,t,n){var r={};t=v(t);for(var a=t.next();!a.done;r={ge:r.ge},a=t.next())if(r.ge=a.value,a=e.filter(function(l){return function(f){return f.video&&f.video.codecs.startsWith(l.ge)}}(r)),a.length){e=a;break}for(r={},n=v(n),t=n.next();!t.done;r={$d:r.$d},t=n.next())if(r.$d=t.value,t=e.filter(function(l){return function(f){return f.audio&&f.audio.codecs.startsWith(l.$d)}}(r)),t.length){e=t;break}return e}function _2(e,t,n){e.variants=e.variants.filter(function(r){return Qa(r,t,n)})}function Qa(e,t,n){function r(l,f,c){return l>=f&&l<=c}var a=e.video;return!(a&&a.width&&a.height&&(!r(a.width,t.minWidth,Math.min(t.maxWidth,n.width))||!r(a.height,t.minHeight,Math.min(t.maxHeight,n.height))||!r(a.width*a.height,t.minPixels,t.maxPixels))||e&&e.video&&e.video.frameRate&&!r(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||!r(e.bandwidth,t.minBandwidth,t.maxBandwidth))}function Tp(e,t,n){var r=!1;e=v(e);for(var a=e.next();!a.done;a=e.next()){a=a.value;var l=a.allowedByApplication;a.allowedByApplication=Qa(a,t,n),l!=a.allowedByApplication&&(r=!0)}return r}function L2(e,t){return j(function(n){return n.g==1?E(n,Cp(e,t,0=t&&a.width>=n){t=a.height,n=a.width;break}e=Vf(this,this.g.restrictions,r,t,n)}for(t=this.getBandwidthEstimate(),r.length&&!e.length&&(e=Vf(this,null,r,1/0,1/0),e=[e[0]]),n=e[0]||null,r=0;r=f&&t<=l&&n.bandwidth!=a.bandwidth&&(n=a)}return this.u=Date.now(),n},d.enable=function(){this.o=!0},d.disable=function(){this.o=!1},d.segmentDownloaded=function(e,t,n){this.i.sample(e,t),n&&this.u!=null&&this.o&&Lp(this)},d.trySuggestStreams=function(){this.u!=null&&this.o&&Lp(this)},d.getBandwidthEstimate=function(){var e=this.g.defaultBandwidthEstimate;return navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(e=1e6*navigator.connection.downlink),e=this.i.getBandwidthEstimate(e),this.j?this.j.getBandwidthEstimate(e):e},d.setVariants=function(e){this.m=e},d.playbackRateChanged=function(e){this.C=e},d.setMediaElement=function(e){var t=this;this.l=e,this.h&&(this.h.disconnect(),this.h=null),this.l&&"ResizeObserver"in o&&(this.h=new ResizeObserver(function(){t.F.U(z2)}),this.h.observe(this.l))},d.setCmsdManager=function(e){this.j=e},d.configure=function(e){this.g=e,this.i&&this.g&&this.i.configure(this.g.advanced)};function Lp(e){if(e.G){if(Date.now()-e.u<1e3*e.g.switchInterval)return}else{var t=e.i;if(!(t.g>=t.i))return;e.G=!0}t=e.chooseVariant(),e.getBandwidthEstimate(),t&&e.s(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch)}function Vf(e,t,n,r,a){if(e.j){var l=e.j.Rf();l&&(n=n.filter(function(f){return f.bandwidth&&l?f.bandwidth<=l:!0}))}return t&&(n=n.filter(function(f){return Qa(f,t,{width:a,height:r})})),n.sort(function(f,c){return f.bandwidth-c.bandwidth})}function F2(e){var t=[];e=v(e);for(var n=e.next();!n.done;n=e.next())(n=n.value.video)&&n.height&&n.width&&t.push({height:n.height,width:n.width});return t.sort(function(r,a){return r.width-a.width})}he("shaka.abr.SimpleAbrManager",ht),ht.prototype.configure=ht.prototype.configure,ht.prototype.setCmsdManager=ht.prototype.setCmsdManager,ht.prototype.setMediaElement=ht.prototype.setMediaElement,ht.prototype.playbackRateChanged=ht.prototype.playbackRateChanged,ht.prototype.setVariants=ht.prototype.setVariants,ht.prototype.getBandwidthEstimate=ht.prototype.getBandwidthEstimate,ht.prototype.trySuggestStreams=ht.prototype.trySuggestStreams,ht.prototype.segmentDownloaded=ht.prototype.segmentDownloaded,ht.prototype.disable=ht.prototype.disable,ht.prototype.enable=ht.prototype.enable,ht.prototype.chooseVariant=ht.prototype.chooseVariant,ht.prototype.init=ht.prototype.init,ht.prototype.release=ht.prototype.release,ht.prototype.stop=ht.prototype.stop;var z2=1;function Hf(e,t){this.g=e,this.h=t}Hf.prototype.toString=function(){return"v"+this.g+"."+this.h};function ei(e,t){var n=new Hf(5,0),r=Np,a=r.g,l=n.h-a.h;(0<(n.g-a.g||l)?r.i:r.h)(r.g,n,e,t)}function V2(e,t,n,r){Ge([n,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",r].join(" "))}function H2(e,t,n,r){Te([n,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",r].join(" "))}var Np=null;he("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3}),he("shaka.config.CodecSwitchingStrategy",{Hi:"reload",yg:"smooth"});function il(e,t,n,r){for(n=n===void 0?!0:n,r=r===void 0?!1:r,this.h=e,this.g=new Set([e]),t=t||[],e=v(t),t=e.next();!t.done;t=e.next())this.add(t.value,n,r)}il.prototype.add=function(e,t,n){return Pp(this.h,e,t===void 0?!0:t,n===void 0?!1:n)?(this.g.add(e),!0):!1};function Pp(e,t,n,r){var a;if(!(a=!!e.audio!=!!t.audio||!!e.video!=!!t.video||e.language!=t.language)&&(a=e.audio&&t.audio)){a=e.audio;var l=t.audio;a=!!((!a.channelsCount||!l.channelsCount||2=e.l)if(e.i)e.g=1,e.h=e.j;else throw new F(2,7,1010);return t=e.g,e.g++,t==0?r.return():(n=e.h*(1+(2*Math.random()-1)*e.o),E(r,new Promise(function(a){new $e(a).U(n/1e3)}),2))}e.h*=e.m,H(r)})}function Ci(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}}function pt(){var e,t,n=new Promise(function(r,a){e=r,t=a});return n.resolve=e,n.reject=t,n}pt.prototype.resolve=function(){},pt.prototype.reject=function(){};function Ct(e,t){this.promise=e,this.i=t,this.g=!1}function Ao(e){return new Ct(Promise.reject(e),function(){return Promise.resolve()})}function Gf(){var e=Promise.reject(new F(2,7,7001));return e.catch(function(){}),new Ct(e,function(){return Promise.resolve()})}function fr(e){return new Ct(Promise.resolve(e),function(){return Promise.resolve()})}function zp(e){return new Ct(e,function(){return e.catch(function(){})})}Ct.prototype.abort=function(){return this.g=!0,this.i()};function Vp(e){return new Ct(Promise.all(e.map(function(t){return t.promise})),function(){return Promise.all(e.map(function(t){return t.abort()}))})}Ct.prototype.finally=function(e){return this.promise.then(function(){return e(!0)},function(){return e(!1)}),this},Ct.prototype.pa=function(e,t){function n(c){return function(p){if(a.g&&c)l.reject(f);else{var m=c?e:t;m?r=J2(m,p,l):(c?l.resolve:l.reject)(p)}}}function r(){return l.reject(f),a.abort()}var a=this,l=new pt,f=new F(2,7,7001);return this.promise.then(n(!0),n(!1)),new Ct(l,function(){return r()})};function J2(e,t,n){try{var r=e(t);return r&&r.promise&&r.abort?(n.resolve(r.promise),function(){return r.abort()}):(n.resolve(r),function(){return Promise.resolve(r).then(function(){},function(){})})}catch(a){return n.reject(a),function(){return Promise.resolve()}}}he("shaka.util.AbortableOperation",Ct),Ct.prototype.chain=Ct.prototype.pa,Ct.prototype.finally=Ct.prototype.finally,Ct.all=Vp,Ct.prototype.abort=Ct.prototype.abort,Ct.notAbortable=zp,Ct.completed=fr,Ct.aborted=Gf,Ct.failed=Ao;function Ne(e,t){if(t)if(t instanceof Map)for(var n=v(t.keys()),r=n.next();!r.done;r=n.next())r=r.value,Object.defineProperty(this,r,{value:t.get(r),writable:!0,enumerable:!0});else for(n in t)Object.defineProperty(this,n,{value:t[n],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=o.performance&&o.performance.now?o.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.g=!1}function Hp(e){var t=new Ne(e.type),n;for(n in e)Object.defineProperty(t,n,{value:e[n],writable:!0,enumerable:!0});return t}Ne.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},Ne.prototype.stopImmediatePropagation=function(){this.g=!0},Ne.prototype.stopPropagation=function(){},he("shaka.util.FakeEvent",Ne);var rl={hi:"abrstatuschanged",ii:"adaptation",ji:"buffering",ki:"complete",li:"downloadfailed",mi:"downloadheadersreceived",ni:"drmsessionupdate",pi:"emsg",Gi:"prft",Error:"error",ri:"expirationupdated",si:"firstquartile",ti:"gapjumped",wi:"keystatuschanged",yi:"loaded",zi:"loading",Bi:"manifestparsed",Ci:"manifestupdated",Di:"mediaqualitychanged",Metadata:"metadata",Ei:"midpoint",Fi:"onstatechange",Ii:"ratechange",Ji:"segmentappended",Ki:"sessiondata",Li:"stalldetected",Mi:"started",Ni:"statechanged",Oi:"streaming",Pi:"textchanged",Qi:"texttrackvisibility",Ri:"thirdquartile",Si:"timelineregionadded",Ti:"timelineregionenter",Ui:"timelineregionexit",Vi:"trackschanged",Xi:"unloading",Zi:"variantchanged"};function Je(){this.ka=new Wa,this.zd=this}Je.prototype.addEventListener=function(e,t){this.ka&&this.ka.push(e,t)},Je.prototype.removeEventListener=function(e,t){this.ka&&this.ka.remove(e,t)},Je.prototype.dispatchEvent=function(e){if(!this.ka)return!0;var t=this.ka.get(e.type)||[],n=this.ka.get("All");for(n&&(t=t.concat(n)),t=v(t),n=t.next();!n.done;n=t.next()){n=n.value,e.target=this.zd,e.currentTarget=this.zd;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch{}if(e.g)break}return e.defaultPrevented},Je.prototype.release=function(){this.ka=null};function cr(){this.g=[]}function ko(e,t){e.g.push(t.finally(function(){hi(e.g,t)}))}cr.prototype.destroy=function(){for(var e=[],t=v(this.g),n=t.next();!n.done;n=t.next())n=n.value,n.promise.catch(function(){}),e.push(n.abort());return this.g=[],Promise.all(e)};function ut(e,t,n,r,a){Je.call(this),this.i=!1,this.m=new cr,this.g=new Set,this.h=new Set,this.l=e||null,this.j=t||null,this.s=n||null,this.u=r||null,this.A=a||null,this.o=!1}le(ut,Je),d=ut.prototype,d.nf=function(e){this.o=e};function Pi(e,t,n,r){n=n||$p;var a=al[e];(!a||n>=a.priority)&&(al[e]={priority:n,Vd:t,Ih:r===void 0?!1:r})}d.Jh=function(e){this.g.add(e)},d.bi=function(e){this.g.delete(e)},d.Hg=function(){this.g.clear()},d.Kh=function(e){this.h.add(e)},d.ci=function(e){this.h.delete(e)},d.Ig=function(){this.h.clear()};function Ft(e,t,n){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:n===void 0?null:n}}d.destroy=function(){return this.i=!0,this.g.clear(),this.h.clear(),Je.prototype.release.call(this),this.m.destroy()},d.request=function(e,t,n){var r=this,a=new Wp;if(this.i){var l=Promise.reject(new F(2,7,7001));return l.catch(function(){}),new sl(l,function(){return Promise.resolve()},a)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?Eo(t.retryParameters):Ci(),t.uris=Eo(t.uris),l=eS(this,e,t,n);var f=l.pa(function(){return Gp(r,e,t,n,new jp(t.retryParameters,!1),0,null,a)}),c=f.pa(function(T){return tS(r,e,T,n)}),p=Date.now(),m=0;l.promise.then(function(){m=Date.now()-p},function(){});var g=0;f.promise.then(function(){g=Date.now()},function(){});var S=c.pa(function(T){var w=Date.now()-g,A=T.response;return A.timeMs+=m,A.timeMs+=w,T.qh||!r.l||A.fromCache||t.method=="HEAD"||e!=Ii||r.l(A.timeMs,A.data.byteLength,Xp(n)),A},function(T){throw T&&(T.severity=2),T});return l=new sl(S.promise,function(){return S.abort()},a),ko(this.m,l),l};function eS(e,t,n,r){function a(c){l=l.pa(function(){return n.body&&(n.body=On(n.body)),c(t,n,r)})}var l=fr(void 0);e.u&&a(e.u),e=v(e.g);for(var f=e.next();!f.done;f=e.next())a(f.value);return l.pa(void 0,function(c){throw c instanceof F&&c.code==7001?c:new F(2,1,1006,c)})}function Gp(e,t,n,r,a,l,f,c){e.o&&(n.uris[l]=n.uris[l].replace("http://","https://")),0=n+2&&(e[n]&224)==192&&(e[n+1]&192)==128?(r=(e[n]&31)<<6|e[n+1]&63,n+=1):e.length>=n+3&&(e[n]&240)==224&&(e[n+1]&192)==128&&(e[n+2]&192)==128?(r=(e[n]&15)<<12|(e[n+1]&63)<<6|e[n+2]&63,n+=2):e.length>=n+4&&(e[n]&241)==240&&(e[n+1]&192)==128&&(e[n+2]&192)==128&&(e[n+3]&192)==128&&(r=(e[n]&7)<<18|(e[n+1]&63)<<12|(e[n+2]&63)<<6|e[n+3]&63,n+=3):r=e[n],65535>=r)t+=String.fromCharCode(r);else{r-=65536;var a=r&1023;t+=String.fromCharCode(55296+(r>>10)),t+=String.fromCharCode(56320+a)}}return t}function Di(e,t,n){if(!e)return"";if(!n&&e.byteLength%2!=0)throw new F(2,2,2004);n=Math.floor(e.byteLength/2);var r=new Uint16Array(n);e=mn(e);for(var a=0;a=n[r]}if(!e)return"";var n=Fe(e);if(n[0]==239&&n[1]==187&&n[2]==191)return mt(n);if(n[0]==254&&n[1]==255)return Di(n.subarray(2),!1);if(n[0]==255&&n[1]==254)return Di(n.subarray(2),!0);if(n[0]==0&&n[2]==0)return Di(e,!1);if(n[1]==0&&n[3]==0)return Di(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return mt(e);throw new F(2,2,2003)}function Oi(e){if(o.TextEncoder&&!rr()){var t=new TextEncoder;return On(t.encode(e))}e=encodeURIComponent(e),e=unescape(e),t=new Uint8Array(e.length);for(var n=0;nthis.h.byteLength)throw Ui();var t=Fe(this.h,this.g,e);return this.g+=e,t},d.skip=function(e){if(this.g+e>this.h.byteLength)throw Ui();this.g+=e},d.Rh=function(e){if(this.ge||e>this.h.byteLength)throw Ui();this.g=e},d.ad=function(){for(var e=this.g;this.ia()&&this.h.getUint8(this.g)!=0;)this.g+=1;return e=Fe(this.h,e,this.g-e),this.g+=1,mt(e)};function Ui(){return new F(2,3,3e3)}he("shaka.util.DataViewReader",rt),rt.prototype.readTerminatedString=rt.prototype.ad,rt.prototype.seek=rt.prototype.seek,rt.prototype.rewind=rt.prototype.Rh,rt.prototype.skip=rt.prototype.skip,rt.prototype.readBytes=rt.prototype.ub,rt.prototype.readUint64=rt.prototype.oc,rt.prototype.readInt32=rt.prototype.fg,rt.prototype.readUint32=rt.prototype.L,rt.prototype.readUint16=rt.prototype.Ea,rt.prototype.readUint8=rt.prototype.ga,rt.prototype.getLength=rt.prototype.getLength,rt.prototype.getPosition=rt.prototype.qa,rt.prototype.hasMoreData=rt.prototype.ia;var qp=1;rt.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:qp};function lt(){this.i=[],this.h=[],this.g=!1}d=lt.prototype,d.box=function(e,t){return e=Qp(e),this.i[e]=rS,this.h[e]=t,this},d.O=function(e,t){return e=Qp(e),this.i[e]=Zp,this.h[e]=t,this},d.stop=function(){this.g=!0},d.parse=function(e,t,n){for(e=new rt(e,0),this.g=!1;e.ia()&&!this.g;)this.Yc(0,e,t,n)},d.Yc=function(e,t,n,r){var a=t.qa();if(r&&a+8>t.getLength())this.g=!0;else{var l=t.L(),f=t.L(),c=ul(f),p=!1;switch(l){case 0:l=t.getLength()-a;break;case 1:if(r&&t.qa()+8>t.getLength()){this.g=!0;return}l=t.oc(),p=!0}var m=this.h[f];if(m){var g=null,S=null;if(this.i[f]==Zp){if(r&&t.qa()+4>t.getLength()){this.g=!0;return}S=t.L(),g=S>>>24,S&=16777215}f=a+l,n&&f>t.getLength()&&(f=t.getLength()),r&&f>t.getLength()?this.g=!0:(r=f-t.qa(),t=0>24&255,e>>16&255,e>>8&255,e&255)}function ks(e){return 8+(e.has64BitSize?8:0)+(e.flags!=null?4:0)}he("shaka.util.Mp4Parser",lt),lt.headerSize=ks,lt.typeToString=ul,lt.allData=mr,lt.visualSampleEntry=ll,lt.sampleDescription=pr,lt.children=tt,lt.prototype.parseNext=lt.prototype.Yc,lt.prototype.parse=lt.prototype.parse,lt.prototype.stop=lt.prototype.stop,lt.prototype.fullBox=lt.prototype.O,lt.prototype.box=lt.prototype.box;var rS=0,Zp=1;function en(){}function Jp(e){return e=Fe(e),e=Kf.value()(e),btoa(e)}function Ro(e,t){return t=t??!0,e=Jp(e).replace(/\+/g,"-").replace(/\//g,"_"),t?e:e.replace(/[=]*$/,"")}function ti(e){e=o.atob(e.replace(/-/g,"+").replace(/_/g,"/"));for(var t=new Uint8Array(e.length),n=0;nr?c.setUint32(p,0):c.setUint32(p,16777216),p+=4,f.set(t,p),p+=t.length,0c&&(c+=Math.pow(2,32)),c="0x"+c.toString(16)}e.o(new F(2,6,6006,l.message,l,c))}})}function Jf(e,t){var n,r,a,l,f,c,p,m,g,S,T,w,A;j(function(M){switch(M.g){case 1:if(n=t.target,e.h.logLicenseExchange&&Ro(t.message),r=e.i.get(n),a=e.g.licenseServerUri,l=e.h.advanced[e.g.keySystem],t.messageType=="individualization-request"&&l&&l.individualizationServer&&(a=l.individualizationServer),f=Ft([a],e.h.retryParameters),f.body=t.message,f.method="POST",f.licenseRequestType=t.messageType,f.sessionId=n.sessionId,f.drmInfo=e.g,r&&(f.initData=r.initData,f.initDataType=r.initDataType),a0(e.g.keySystem)){var R=Di(f.body,!0,!0);if(R.includes("PlayReadyKeyMessage")){R=yr(R,"PlayReadyKeyMessage");for(var D=v(R.getElementsByTagName("HttpHeader")),_=D.next();!_.done;_=D.next())_=_.value,f.headers[_.getElementsByTagName("name")[0].textContent]=_.getElementsByTagName("value")[0].textContent;f.body=ti(R.getElementsByTagName("Challenge")[0].textContent)}else f.headers["Content-Type"]="text/xml; charset=utf-8"}return c=Date.now(),Q(M,2),m=e.C.Tb.request(2,f),E(M,m.promise,4);case 4:p=M.h,ae(M,3);break;case 2:return g=q(M),S=new F(2,6,6007,g),e.o(S),r&&r.hb&&r.hb.reject(S),M.return();case 3:return e.j.g?M.return():(e.I+=(Date.now()-c)/1e3,e.h.logLicenseExchange&&Ro(p.data),Q(M,5),E(M,n.update(p.data),7));case 7:ae(M,6);break;case 5:return T=q(M),w=new F(2,6,6008,T.message),e.o(w),r&&r.hb&&r.hb.reject(w),M.return();case 6:if(e.j.g)return M.return();A=new Ne("drmsessionupdate"),e.C.onEvent(A),r&&(r.hb&&r.hb.resolve(),f0(e,r)),H(M)}})}function d0(e,t){t=t.target;var n=e.i.get(t),r=!1;t.keyStatuses.forEach(function(l,f){if(typeof f=="string"){var c=f;f=l,l=c}if(a0(e.g.keySystem)&&f.byteLength==16&&(Pf()||rr())){c=mn(f);var p=c.getUint32(0,!0),m=c.getUint16(4,!0),g=c.getUint16(6,!0);c.setUint32(0,p,!1),c.setUint16(4,m,!1),c.setUint16(6,g,!1)}l!="status-pending"&&(n.loaded=!0),l=="expired"&&(r=!0),f=gr(f).slice(0,32),e.V.set(f,l)});var a=t.expiration-Date.now();(0>a||r&&1e3>a)&&n&&!n.hb&&(e.i.delete(t),t.close().catch(function(){})),tc(e)&&(e.l.resolve(),e.W.U(kS))}function xS(e){var t=e.V,n=e.ea;n.clear(),t.forEach(function(r,a){return n.set(a,r)}),t=Array.from(n.values()),t.length&&t.every(function(r){return r=="expired"})&&e.o(new F(2,6,6014)),e.C.Ud(Wf(n))}function SS(){var e,t,n,r,a,l,f,c;return j(function(p){return p.g==1?(e="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.recommendation com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" "),t=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],n={initDataTypes:["cenc"],videoCapabilities:t},r={videoCapabilities:t,persistentState:"required",sessionTypes:["persistent-license"]},a=[r,n],l=new Map,f=function(m){var g,S,T;return j(function(w){switch(w.g){case 1:if(Q(w,2),m==="org.w3.clearkey"&&qa())throw Error("Unsupported keySystem");return E(w,navigator.requestMediaKeySystemAccess(m,a),4);case 4:return g=w.h,T=(S=g.getConfiguration().sessionTypes)?S.includes("persistent-license"):!1,$a()&&(T=!1),l.set(m,{persistentState:T}),E(w,g.createMediaKeys(),5);case 5:ae(w,0);break;case 2:q(w),l.set(m,null),H(w)}})},c=e.map(function(m){return f(m)}),E(p,Promise.all(c),2)):p.return(Wf(l))})}function wS(e){var t;return j(function(n){if(n.g==1)return t=new Promise(function(r,a){new $e(a).U(bS)}),Q(n,2),E(n,Promise.race([Promise.all([e.close(),e.closed]),t]),4);if(n.g!=2)return ae(n,0);q(n),H(n)})}function h0(e){var t;return j(function(n){return t=Array.from(e.i.entries()),e.i.clear(),E(n,Promise.all(t.map(function(r){r=v(r);var a=r.next().value,l=r.next().value;return j(function(f){if(f.g==1)return Q(f,2),e.ma||e.u.has(a.sessionId)||l.type!=="persistent-license"||e.h.persistentSessionOnlinePlayback?E(f,wS(a),5):E(f,a.remove(),5);if(f.g!=2)return ae(f,0);q(f),H(f)})})),0)})}function p0(e,t){return e.length&&t.length&&e!==t?0>32),e.setUint32(12,n&4294967295)):e.setUint32(0,n))}var _S=new hr(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});function Bn(e,t,n,r,a,l,f){this.Z=e,this.Qa=t,this.wa=n,this.Ve=r===void 0?null:r,this.timescale=a===void 0?null:a,this.g=l===void 0?null:l,this.aes128Key=f===void 0?null:f,this.mimeType=this.codecs=null}Bn.prototype.ic=function(){return this.Qa},Bn.prototype.fc=function(){return this.wa};function x0(e,t){return e===t?!0:e&&t?e.ic()==t.ic()&&e.fc()==t.fc()&&wf(e.Z().sort(),t.Z().sort())&&Ji(e.g,t.g):e==t}he("shaka.media.InitSegmentReference",Bn),Bn.prototype.getEndByte=Bn.prototype.fc,Bn.prototype.getStartByte=Bn.prototype.ic;function Pe(e,t,n,r,a,l,f,c,p,m,g,S,T,w,A,M){for(m=m===void 0?[]:m,w=w===void 0?oo:w,this.startTime=e,this.h=this.endTime=t,this.A=n,this.Qa=r,this.wa=a,this.aa=l,this.timestampOffset=f,this.appendWindowStart=c,this.appendWindowEnd=p,this.g=m,this.tilesLayout=g===void 0?"":g,this.u=S===void 0?null:S,this.ca=T===void 0?null:T,this.status=w,this.l=!1,this.j=!0,this.m=!1,this.aes128Key=A===void 0?null:A,this.s=null,this.i=0,this.o=M===void 0?!1:M,this.Md=this.Zc=!1,e=v(this.g),t=e.next();!t.done;t=e.next())t.value.ag();this.o&&this.g.length&&this.g[this.g.length-1].$f(),this.mimeType=this.codecs=null}d=Pe.prototype,d.Z=function(){return this.A()},d.getStartTime=function(){return this.startTime},d.Ug=function(){return this.endTime},d.ic=function(){return this.Qa},d.fc=function(){return this.wa},d.lh=function(){return this.tilesLayout},d.kh=function(){return this.u},d.Pb=function(){return this.status},d.Bh=function(){this.status=S0},d.Ue=function(){this.l=!0},d.xh=function(){return this.l},d.Od=function(){this.j=!1},d.uh=function(){return this.j},d.ag=function(){this.Zc=!0},d.wh=function(){return this.Zc},d.$f=function(){this.Md=!0},d.vh=function(){return this.Md},d.Zf=function(){this.m=!0},d.rh=function(){return this.m},d.pg=function(e){this.s=e},d.jh=function(){return this.s},d.offset=function(e){this.startTime+=e,this.endTime+=e,this.h+=e;for(var t=v(this.g),n=t.next();!n.done;n=t.next())n=n.value,n.startTime+=e,n.endTime+=e,n.h+=e},d.tf=function(e){this.ca==null?Te("Sync attempted without sync time!"):(e=this.ca-e-this.startTime,.001<=Math.abs(e)&&this.offset(e))},he("shaka.media.SegmentReference",Pe),Pe.prototype.syncAgainst=Pe.prototype.tf,Pe.prototype.offset=Pe.prototype.offset,Pe.prototype.getThumbnailSprite=Pe.prototype.jh,Pe.prototype.setThumbnailSprite=Pe.prototype.pg,Pe.prototype.hasByterangeOptimization=Pe.prototype.rh,Pe.prototype.markAsByterangeOptimization=Pe.prototype.Zf,Pe.prototype.isLastPartial=Pe.prototype.vh,Pe.prototype.markAsLastPartial=Pe.prototype.$f,Pe.prototype.isPartial=Pe.prototype.wh,Pe.prototype.markAsPartial=Pe.prototype.ag,Pe.prototype.isIndependent=Pe.prototype.uh,Pe.prototype.markAsNonIndependent=Pe.prototype.Od,Pe.prototype.isPreload=Pe.prototype.xh,Pe.prototype.markAsPreload=Pe.prototype.Ue,Pe.prototype.markAsUnavailable=Pe.prototype.Bh,Pe.prototype.getStatus=Pe.prototype.Pb,Pe.prototype.getTileDuration=Pe.prototype.kh,Pe.prototype.getTilesLayout=Pe.prototype.lh,Pe.prototype.getEndByte=Pe.prototype.fc,Pe.prototype.getStartByte=Pe.prototype.ic,Pe.prototype.getEndTime=Pe.prototype.Ug,Pe.prototype.getStartTime=Pe.prototype.getStartTime,Pe.prototype.getUris=Pe.prototype.Z;var oo=0,S0=1;Pe.Status={gi:oo,Wi:S0,Ai:2};function nc(e){return!e||e.length==1&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function ic(e,t){return!e||!e.length||e.length==1&&1e-6>e.end(0)-e.start(0)||t>e.end(e.length-1)?!1:t>=e.start(0)}function w0(e,t){if(!e||!e.length||e.length==1&&1e-6>e.end(0)-e.start(0))return 0;var n=0;e=v(ro(e));for(var r=e.next();!r.done;r=e.next()){var a=r.value;r=a.start,a=a.end,a>t&&(n+=a-Math.max(r,t))}return n}function LS(e,t,n){return!e||!e.length||e.length==1&&1e-6>e.end(0)-e.start(0)?null:(e=ro(e).findIndex(function(r,a,l){return r.start>t&&(a==0||l[a-1].end-t<=n)}),0<=e?e:null)}function ro(e){if(!e)return[];for(var t=[],n=0;ne[t+3]&&255>e[t+4]&&128>e[t+6]&&128>e[t+7]&&128>e[t+8]&&128>e[t+9]}function C0(e,t){return t+10<=e.length&&e[t]===51&&e[t+1]===68&&e[t+2]===73&&255>e[t+3]&&255>e[t+4]&&128>e[t+6]&&128>e[t+7]&&128>e[t+8]&&128>e[t+9]}function rc(e,t){var n=(e[t]&127)<<21;return n|=(e[t+1]&127)<<14,n|=(e[t+2]&127)<<7,n|=e[t+3]&127}function NS(e){var t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.type==="APIC"){if(2>e.size||e.data[0]!==3)return null;var n=e.data.subarray(1).indexOf(0);if(n===-1)return null;var r=mt(Fe(e.data,1,n)),a=e.data[2+n],l=e.data.subarray(3+n).indexOf(0);if(l===-1)return null;var f=mt(Fe(e.data,3+n,l)),c;return r==="-->"?c=mt(Fe(e.data,4+n+l)):c=On(e.data.subarray(4+n+l)),t.mimeType=r,t.pictureType=a,t.description=f,t.data=c,t}return e.type==="TXXX"?2>e.size||e.data[0]!==3||(r=e.data.subarray(1).indexOf(0),r===-1)?null:(n=mt(Fe(e.data,1,r)),e=mt(Fe(e.data,2+r)).replace(/\0*$/,""),t.description=n,t.data=e,t):e.type==="WXXX"?2>e.size||e.data[0]!==3||(r=e.data.subarray(1).indexOf(0),r===-1)?null:(n=mt(Fe(e.data,1,r)),e=mt(Fe(e.data,2+r)).replace(/\0*$/,""),t.description=n,t.data=e,t):e.type==="PRIV"?2>e.size||(n=e.data.indexOf(0),n===-1)?null:(n=mt(Fe(e.data,0,n)),t.description=n,n=="com.apple.streaming.transportStreamTimestamp"?(n=e.data.subarray(n.length+1),e=n[3]&1,n=(n[4]<<23)+(n[5]<<15)+(n[6]<<7)+n[7],n/=45,e&&(n+=4772185884e-2),t.data=n):(e=On(e.data.subarray(n.length+1)),t.data=e),t):e.type[0]==="T"?2>e.size||e.data[0]!==3?null:(e=mt(e.data.subarray(1)).replace(/\0*$/,""),t.data=e,t):e.type[0]==="W"?(e=mt(e.data).replace(/\0*$/,""),t.data=e,t):e.data?(t.data=On(e.data),t):null}function Po(e){for(var t=0,n=[];T0(e,t);){var r=rc(e,t+6);for(e[t+5]>>6&1&&(t+=10),t+=10,r=t+r;t+10>6&1&&(r+=10),r+=10,r+=rc(e,t+6),C0(e,t+10)&&(r+=10),t+=r;return 0>10)+96)+String.fromCharCode(((e&960)>>5)+96)+String.fromCharCode((e&31)+96)}}function E0(e,t,n){var r=e.L(),a=[],l=null;n&1&&(l=e.L()),n&4&&e.skip(4);for(var f=0;f>3,r===31&&e.ia()&&(r=32+((n&7)<<3)+((e.ga()&224)>>5)),t+="."+r)),{ha:t}}function A0(e,t){return e.skip(87),{ha:t+"."+this.g(e.ga())+this.g(e.ga())+this.g(e.ga())}}function k0(e){return e=e.L(),{ha:ul(e)}}function zi(e,t){if(this.j=e,t!==void 0&&t){t=new Uint8Array(e.byteLength);for(var n=0,r=0;r>>32-n;return e.g-=n,0>>t)return e.h<<=t,e.g-=t,t;return ac(e),t+lc(e)}function fn(e){yn(e,1+lc(e))}function Se(e){var t=lc(e);return Ve(e,t+1)-1}function vr(e){return e=Se(e),1&e?1+e>>>1:-1*(e>>>1)}function be(e){return Ve(e,1)===1}function qe(e){return Ve(e,8)}function gl(e,t){for(var n=8,r=8,a=0;ae.length)return this;for(var t=Math.max(0,cc(e)),n=e.length-(e.length+t)%188,r=!1,a=t;a>4){var c=a+5+e[a+4];if(c==a+188)continue}else c=a+4;switch(f){case 0:l&&(c+=e[c]+1),this.A=(e[c+10]&31)<<8|e[c+11];break;case 17:case 8191:break;case this.A:l&&(c+=e[c]+1),l=e,f={audio:-1,video:-1,Jd:-1,audioCodec:"",videoCodec:""};var p=c+3+((l[c+1]&15)<<8|l[c+2])-4;for(c+=12+((l[c+10]&15)<<8|l[c+11]);ce.byteLength-6)return null;var n=e[7];return n&192&&(t.pts=536870912*(e[9]&14)+4194304*(e[10]&255)+16384*(e[11]&254)+128*(e[12]&255)+(e[13]&254)/2,t.dts=t.pts,n&64&&(t.dts=536870912*(e[14]&14)+4194304*(e[15]&255)+16384*(e[16]&254)+128*(e[17]&255)+(e[18]&254)/2)),n=e[8]+9,e.byteLength<=n?null:(t.data=e.subarray(n),t)}d.Hh=function(e){return ei("TsParser.parseAvcNalus","Please use parseNalus function instead."),this.cf(e)},d.cf=function(e,t,n){var r=e.pts?e.pts/9e4:null;e=e.data;var a=e.byteLength,l=1;this.m=="hvc"&&(l=2);for(var f=n||0,c=[],p=-1,m=0,g,S=0;S=a-l)return c;S++,p=S,m=this.m=="hvc"?e[S]>>1&63:e[S]&31}f=0}else f++;S>=a-1&&0<=p&&0<=f&&(g={data:e.subarray(p+l,a),fullData:e.subarray(p,a),type:m,time:r})}return g&&c.push(g),!c.length&&t&&(t.data=wt(t.data,e),t.fullData=wt(t.fullData,e)),c},d.getMetadata=function(){for(var e=[],t=v(this.l),n=t.next();!n.done;n=t.next())n=wt.apply(en,N(n.value)),(n=uc(n))&&e.push({cueTime:n.pts?n.pts/9e4:null,data:n.data,frames:Po(n.data),dts:n.dts,pts:n.pts});return e},d.Mb=function(){if(this.i.length&&!this.h.length){for(var e=!1,t=v(this.i),n=t.next();!n.done;n=t.next()){var r=wt.apply(en,N(n.value)),a=uc(r);n=this.h.length?this.h[this.h.length-1]:null,a&&a.pts!=null&&a.dts!=null&&(!n||n.pts!=a.pts&&n.dts!=a.dts)?(this.h.length&&a.dts<(n.dts||0)&&(e=!0),this.h.push(a)):this.h.length&&(r=a?a.data:r)&&(n=this.h.pop(),n.data=wt(n.data,r),this.h.push(n))}e&&(this.h=this.h.sort(function(l,f){var c=(l.pts||0)-(f.pts||0);return(l.dts||0)-(f.dts||0)||c}))}return this.h},d.kc=function(e){if(e=e===void 0?!0:e,this.j.length&&!this.g.length){for(var t=!1,n=v(this.j),r=n.next();!r.done;r=n.next()){var a=wt.apply(en,N(r.value)),l=uc(a);r=this.g.length?this.g[this.g.length-1]:null,l&&l.pts!=null&&l.dts!=null&&(!r||r.pts!=l.pts&&r.dts!=l.dts)?(this.g.length&&l.dts<(r.dts||0)&&(t=!0),this.g.push(l)):this.g.length&&(a=l?l.data:a)&&(r=this.g.pop(),r.data=wt(r.data,a),this.g.push(r))}if(e){var f;for(n=v(this.g),r=n.next();!r.done;r=n.next())r=r.value,r.nalus=this.cf(r,f,void 0),r.nalus.length&&(f=r.nalus[r.nalus.length-1]);this.g=this.g.filter(function(c){return c.nalus.length})}t&&(this.g=this.g.sort(function(c,p){var m=(c.pts||0)-(p.pts||0);return(c.dts||0)-(p.dts||0)||m}))}return e?this.g:(e=this.g,this.g=[],e)},d.getStartTime=function(e){if(e=="audio"){e=null;var t=this.Mb();return t.length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e}return e=="video"?(e=null,t=this.kc(!1),t.length&&(e=t[0],e=Math.min(e.dts,e.pts)/9e4),e):null},d.Pc=function(){return{audio:this.o,video:this.m}},d.Fd=function(){for(var e=[],t=v(this.kc()),n=t.next();!n.done;n=t.next())e.push.apply(e,N(n.value.nalus));return e},d.oh=function(){ei("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var e=this.Je();return{height:e.height,width:e.width}},d.Je=function(){return this.m=="hvc"?US(this):OS(this)};function OS(e){var t={height:null,width:null,ha:null};if(e=e.Fd(),!e.length||(e=e.find(function(T){return T.type==7}),!e))return t;e=new zi(e.data);var n=qe(e),r=qe(e),a=qe(e);if(fn(e),BS.includes(n)){var l=Se(e);if(l===3&&yn(e,1),fn(e),fn(e),yn(e,1),be(e)){l=l!==3?8:12;for(var f=0;ff?gl(e,16):gl(e,64))}}if(fn(e),l=Se(e),l===0)Se(e);else if(l===1)for(yn(e,1),fn(e),fn(e),l=Se(e),f=0;fR;R++)Ve(n,2);for(R=0;RW;W++)z|=(U>>W&1)<<31-W;return z>>>0}(c),l=l==1?"H":"L",a="hvc1"+("."+["","A","B","C"][a]+f),a+="."+n.toString(16).toUpperCase(),a+="."+l+w,T&&(a+="."+T.toString(16).toUpperCase()),S&&(a+="."+S.toString(16).toUpperCase()),g&&(a+="."+g.toString(16).toUpperCase()),m&&(a+="."+m.toString(16).toUpperCase()),p&&(a+="."+p.toString(16).toUpperCase()),e&&(a+="."+e.toString(16).toUpperCase()),t.ha=a,t}function fc(e){return!(0>cc(e))}function cc(e){for(var t=Math.min(1e3,e.length-564),n=0;n"u"&&Ge("Could not find LCEVC Library dependencies on this page"),typeof LCEVCdec<"u")this.h=LCEVCdec;else if(typeof LcevcDil<"u")this.h=LcevcDil,this.j=!0,ei("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{Ge("Could not find LCEVC Library on this page"),e=!1;break e}typeof this.h.SupportObject>"u"?(Ge("Could not find LCEVC Library on this page"),e=!1):(this.h.SupportObject.SupportStatus||Ge(this.h.SupportObject.SupportError),e=typeof this.h<"u"&&typeof libDPIModule<"u"&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}e&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}function M0(e){e.g&&e.i.classList.add("shaka-hidden")}Ns.prototype.release=function(){this.g&&(this.g.close(),this.g=null)};function R0(e,t,n){var r=jS,a=GS;switch(t.mimeType){case"video/webm":r=FS;break;case"video/mp4":r=zS}switch(n){case"DASH":a=HS;break;case"HLS":a=VS}e.g&&(e.o=t.id,e.g.setLevelSwitching(t.id,!0),e.g.setContainerFormat(r),e.j||e.g.setStreamingFormat(a))}he("shaka.lcevc.Dec",Ns),Ns.prototype.release=Ns.prototype.release;var jS=0,FS=1,zS=2,VS=0,HS=1,GS=-1;function _0(e,t,n,r){var a=this;this.i=e,this.C=null,this.F=t,this.g={},this.G={},this.ma={},this.h=null,this.Y=!1,this.Aa=n||function(){},this.N=r||null,this.j={},this.s=new ft,this.m={},this.H=null,this.J=new pt,this.K="",this.da=!1,this.l=L0(this,this.J),this.A=!1,this.I=new dr(function(){return XS(a)}),this.u=!1,this.W="UNKNOWN",this.ka=this.za=!1,this.Ba=new pt,this.o=!1,this.ea=!0,this.V=null}function L0(e,t){if(o.ManagedMediaSource){e.i.disableRemotePlayback=!0;var n=new ManagedMediaSource;return e.s.D(n,"startstreaming",function(){e.ea=!0}),e.s.D(n,"endstreaming",function(){e.ea=!1}),e.s.ja(n,"sourceopen",function(){URL.revokeObjectURL(e.K),t.resolve()}),e.s.ja(e.i,"playing",function(){e.da=!0}),e.K=Tl(n),e.i.src=e.K,n}return n=new MediaSource,e.s.ja(n,"sourceopen",function(){URL.revokeObjectURL(e.K),t.resolve()}),e.s.ja(e.i,"playing",function(){e.da=!0}),e.K=Tl(n),e.i.src=e.K,n}d=_0.prototype,d.destroy=function(){return this.I.destroy()};function XS(e){var t,n,r,a,l,f,c,p;return j(function(m){if(m.g==1){t=[];for(n in e.j)for(r=e.j[n],a=r[0],e.j[n]=r.slice(0,1),a&&t.push(a.p.catch(gp)),l=v(r.slice(1)),f=l.next();!f.done;f=l.next())c=f.value,c.p.reject(new F(2,7,7003,void 0));e.h&&t.push(e.h.destroy()),e.F&&t.push(e.F.destroy());for(p in e.m)t.push(e.m[p].destroy());return E(m,Promise.all(t),2)}e.s&&(e.s.release(),e.s=null),e.i&&(e.i.removeAttribute("src"),e.i.load(),e.i=null),e.C=null,e.l=null,e.h=null,e.F=null,e.g={},e.m={},e.H=null,e.j={},e.N=null,H(m)})}d.init=function(e,t,n,r){t=t===void 0?!1:t,n=n===void 0?"UNKNOWN":n,r=r===void 0?!1:r;var a=this,l,f,c,p,m;return j(function(g){if(g.g==1)return l=Dt,E(g,a.J,2);for(a.u=t,a.W=n,a.za=r,a.ka=!a.u&&a.W=="HLS"&&!a.za,f=v(e.keys()),c=f.next();!c.done;c=f.next())p=c.value,m=e.get(p),yl(a,p,m,m.codecs),a.o?(a.j[l.P]=[],a.j[l.$]=[]):a.j[p]=[];H(g)})};function yl(e,t,n,r,a){a=a===void 0?!1:a;var l=En(n.mimeType,r);if(t==Ye)vl(e,l,e.u,n.external);else{var f=e.C.forceTransmux||a;if((!dt(l)||!e.u&&nr.includes(l))&&(f=!0),a=er(n.mimeType,r),f){if(f=gn("audio",(r||"").split(",")),r=gn("video",(r||"").split(",")),f&&r){e.o=!0,yl(e,"audio",n,f,!0),yl(e,"video",n,r,!0);return}(r=Co(a))&&(l=r(),e.m[t]=l,l=l.convertCodecs(t,a))}a=l+e.C.sourceBufferExtraFeatures,ot(e.I);try{var c=e.l.addSourceBuffer(a)}catch(p){throw new F(2,3,3015,p,"The mediaSource_ status was "+e.l.readyState+" expected 'open'")}e.u&&(c.mode=iw),e.s.D(c,"error",function(){e.j[t][0].p.reject(new F(2,3,3014,e.i.error?e.i.error.code:0))}),e.s.D(c,"updateend",function(){return Vi(e,t)}),e.g[t]=c,e.G[t]=l,e.ma[t]=!!n.drmInfos.length}}d.configure=function(e){this.C=e};function vl(e,t,n,r){e.h||(e.h=new Ni(e.F));var a=e.h;r=r||e.Y,e=e.W,t=="application/cea-608"||t=="application/cea-708"?a.i=null:(a.i=(0,jt[t])(),a.i.setSequenceMode?a.i.setSequenceMode(n):Ge('Text parsers should have a "setSequenceMode" method!'),a.i.setManifestType?a.i.setManifestType(e):Ge('Text parsers should have a "setManifestType" method!'),a.u=r)}function N0(e){return e.A?!1:e.l?e.l.readyState=="ended":!0}function P0(e,t){return e.A||!Object.keys(e.g).length?e=null:t==Ye?e=e.h.g:(e=xr(e,t),e=!e||e.length==1&&1e-6>e.end(0)-e.start(0)?null:e.length==1&&0>e.start(0)?0:e.length?e.start(0):null),e}function xl(e,t){return e.A?null:t==Ye?e.h.h:nc(xr(e,t))}function WS(e,t,n){return e.A?0:t==Ye?(e=e.h,e.h==null||e.hn&&(n+=.001),e.g[t].timestampOffset=n,Vi(e,t)}function Vi(e,t){if(!e.A){var n=e.j[t][0];n&&(n.p.resolve(),hc(e,t))}}function Pt(e,t,n){return ot(e.I),n={start:n,p:new pt},e.j[t].push(n),e.j[t].length==1&&O0(e,t),n.p}function dc(e,t){var n,r,a,l,f,c,p;return j(function(m){switch(m.g){case 1:ot(e.I),n=[],r={};for(a in e.g)r.yc=new pt,l={start:function(g){return function(){return g.yc.resolve()}}(r),p:r.yc},e.j[a].push(l),n.push(r.yc),e.j[a].length==1&&l.start(),r={yc:r.yc};return Q(m,2),E(m,Promise.all(n),4);case 4:ae(m,3);break;case 2:throw f=q(m),f;case 3:return Q(m,5,6),E(m,t(),6);case 6:Y(m);for(c in e.g)hc(e,c);K(m,0);break;case 5:throw p=q(m),new F(2,3,3015,p,e.i.error||"No error in the media element")}})}function hc(e,t){e.j[t].shift(),O0(e,t)}function O0(e,t){var n=e.j[t][0];if(n)try{n.start()}catch(r){r.name=="QuotaExceededError"?n.p.reject(new F(2,3,3017,t)):n.p.reject(new F(2,3,3015,r,e.i.error||"No error in the media element")),hc(e,t)}}function ZS(e,t,n,r){var a=e.ma[r];return e.C.insertFakeEncryptionInInit&&n==null&&a&&(bo()||Es()||xt("SOPOpenBrowser"))&&e.G[r].split(";")[0].split("/")[1]=="mp4"&&(t=MS(t)),t}function JS(e,t,n,r){return Pt(e,t,function(){t!==Ye&&(ln()&&(e.m[t]&&(e.m[t].destroy(),delete e.m[t]),r&&(e.m[t]=r),e.g[t].changeType(n+e.C.sourceBufferExtraFeatures),e.G[t]=n),Vi(e,t))})}function ew(e,t){var n,r,a,l,f,c,p,m,g,S,T,w,A,M,R,D,_,B,U,z,W,se,Z;return j(function(J){switch(J.g){case 1:n=Dt,e.A=!0,e.o=!1,r=e.i.currentTime,a=e.i.autoplay,l=e.i.paused,e.da&&(e.i.autoplay=!1),ge(J,2),e.s.Za(),f=[];for(c in e.m)f.push(e.m[c].destroy());for(p in e.j)for(m=e.j[p],g=m[0],e.j[p]=m.slice(0,1),g&&f.push(g.p.catch(gp)),S=v(m.slice(1)),T=S.next();!T.done;T=S.next())w=T.value,w.p.reject(new F(2,7,7003,void 0));for(A in e.g){M=e.g[A];try{e.l.removeSourceBuffer(M)}catch{}}return E(J,Promise.all(f),4);case 4:return e.m={},e.g={},R=e.l.duration,e.J=new pt,e.l=L0(e,e.J),E(J,e.J,5);case 5:for(!isNaN(R)&&R?e.l.duration=R:!isNaN(e.V)&&e.V&&(e.l.duration=e.V),D=new pt,_=e.l.sourceBuffers,B=t.size,U=0,e.s.D(_,"addsourcebuffer",function(){U++,U===B&&D.resolve()}),z=v(t.keys()),W=z.next();!W.done;W=z.next())se=W.value,Z=t.get(se),yl(e,se,Z,Z.codecs),e.o?(e.j[n.P]=[],e.j[n.$]=[]):e.j[se]=[];return e.i.currentTime=r,E(J,D,2);case 2:Y(J),e.A=!1,ot(e.I),e.s.ja(e.i,"canplaythrough",function(){ot(e.I),e.i.autoplay=a,l||e.i.play()}),K(J,0)}})}function U0(e,t){return dc(e,function(){return ew(e,t)})}function tw(e,t,n,r,a){var l,f,c,p,m,g,S,T,w,A,M,R,D,_,B;return j(function(U){return U.g==1?(l=Dt,t==l.na||(f=pi(Zn(e.G[t])),c=Li(e.G[t]),m=!1,g=En(n,r),S=e.C.forceTransmux,(!dt(g)||!e.u&&nr.includes(g)||r.includes(","))&&(S=!0),S&&(T=er(n,r),w=Co(T))&&(p=w(),A=gn(l.P,(r||"").split(",")),M=gn(l.$,(r||"").split(",")),A&&M?(m=!0,R=M,t==l.P&&(R=A),g=p.convertCodecs(t,er(n,R))):g=p.convertCodecs(t,T)),D=pi(Zn(g)),_=Li(g),f===D&&c===_)?U.return(!1):(B=!0,(e.o||m&&p&&!e.m[t])&&(B=!1),B&&e.C.codecSwitchingStrategy==="smooth"&&ln()?E(U,JS(e,t,g,p),3):(p&&p.destroy(),E(U,U0(e,a),3)))):U.return(!0)})}function nw(e,t,n){if(t==Ye)var r=!1;else{r=pi(Zn(e.G[t]));var a=Li(e.G[t]),l=En(n.mimeType,n.codecs),f=e.C.forceTransmux;(!dt(l)||!e.u&&nr.includes(l)||n.codecs.includes(","))&&(f=!0),n=er(n.mimeType,n.codecs),f&&(f=Co(n))&&(f=f(),l=f.convertCodecs(t,n),f.destroy()),t=pi(Zn(l)),l=Li(l),r=r!==t||a!==l}return r?e.C.codecSwitchingStrategy!=="smooth"||!ln()||e.o:!1}var Tl=o.URL.createObjectURL,iw="sequence";function je(e,t,n){this.i=e,this.o=t,this.u=this.j=1/0,this.g=1,this.h=this.l=null,this.s=0,this.C=!0,this.F=0,this.A=n===void 0?!0:n,this.G=0,this.m=!1}d=je.prototype,d.getDuration=function(){return this.j},d.$g=function(){return this.g},d.qf=function(e){this.i=e},d.Pa=function(e){this.j=e},d.eh=function(){return this.i},d.mg=function(e){this.s=e},d.pc=function(e){this.C=e},d.Xd=function(e){this.u=e},d.ng=function(e){this.o=e},d.Tg=function(){return this.o},d.dg=function(e,t){if(e.length!=0){var n=e[e.length-1].end+t;this.Sd(e[0].start+t),this.g=e.reduce(function(r,a){return Math.max(r,a.end-a.start)},this.g),this.h=Math.max(this.h,n),this.i!=null&&this.A&&!this.m&&(this.i=(Date.now()+this.s)/1e3-this.h-this.g)}},d.Xc=function(e){if(e.length!=0){var t=e[0].startTime,n=e[0].endTime,r=(Date.now()+this.s)/1e3;e=v(e);for(var a=e.next();!a.done;a=e.next())a=a.value,rn.end-.5)){t=!0;break e}t=!1}return t}function pc(e,t,n,r,a){var l=this;this.u=a,this.g=e,this.A=t,this.s=n,this.l=new ft,this.j=!1,this.F=e.readyState,this.C=this.i=0,this.h=r,this.o=!1,this.l.D(e,"waiting",function(){return mc(l)}),this.m=new $e(function(){mc(l)}).$a(this.s.gapJumpTimerTime)}pc.prototype.release=function(){this.l&&(this.l.release(),this.l=null),this.m!=null&&(this.m.stop(),this.m=null),this.h&&(this.h.release(),this.h=null),this.g=this.A=this.u=null},pc.prototype.af=function(){this.o=!0,mc(this)};function mc(e){if(e.g.readyState!=0){if(e.g.seeking){if(!e.j)return}else e.j=!1;if(!e.g.paused||e.g.currentTime==e.i&&(e.g.autoplay||e.g.currentTime!=e.i)){e.g.readyState!=e.F&&(e.F=e.g.readyState);var t;if(!(t=!e.h)){t=e.h;var n=t.l,r=j0(n),a=n.g.currentTime,l=Date.now()/1e3;(t.g!=a||t.s!=r)&&(t.m=l,t.g=a,t.s=r,t.h=!1),a=l-t.m,(r=a>=t.u&&r&&!t.h)&&(t.i(t.g,a),t.h=!0,t.g=n.g.currentTime,t.o++,t.j(new Ne("stalldetected"))),t=!r}t&&(t=e.g.currentTime,n=e.g.buffered,r=LS(n,t,e.s.gapDetectionThreshold),r==null||r==0&&!e.o||(a=n.start(r),a>=e.A.qb()||.001>a-t||(r!=0&&n.end(r-1),e.g.currentTime=a,t==e.i&&(e.i=a),e.C++,e.u(new Ne("gapjumped")))))}}}function Tr(e,t,n,r){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?r():(t=sw.value().get(t),n.ja(e,t,r))}var sw=new hr(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function F0(e,t,n,r){var a=this;this.g=e,this.m=t,this.s=n,this.l=null,this.j=function(){return a.l==null&&(a.l=r()),a.l},this.o=!1,this.h=new ft,this.i=new G0(e),Tr(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){V0(a,a.j())})}F0.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.i!=null&&(this.i.release(),this.i=null),this.m=function(){},this.g=null};function gc(e){return e.o?e.g.currentTime:e.j()}function z0(e,t){0Math.abs(e.g.currentTime-t)?H0(e):(e.h.ja(e.g,"seeking",function(){H0(e)}),X0(e.i,e.g.currentTime&&e.g.currentTime!=0?e.g.currentTime:t))}function H0(e){e.o=!0,e.h.D(e.g,"seeking",function(){return e.m()}),e.s(e.g.currentTime)}function G0(e){var t=this;this.h=e,this.m=10,this.l=this.j=this.i=0,this.g=new $e(function(){0>=t.i||t.h.currentTime!=t.j?t.g.stop():(t.h.currentTime=t.l,t.i--)})}G0.prototype.release=function(){this.g&&(this.g.stop(),this.g=null),this.h=null};function X0(e,t){e.j=e.h.currentTime,e.l=t,e.i=e.m,e.h.currentTime=t,e.g.$a(.1)}function W0(e){this.g=e,this.j=!1,this.h=null,this.i=new ft}d=W0.prototype,d.ie=function(){function e(){t.h==null||t.h==0?t.j=!0:(t.i.ja(t.g,"seeking",function(){t.j=!0}),t.g.currentTime=Math.max(0,t.g.currentTime+t.h))}var t=this;Tr(this.g,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,function(){e()})},d.release=function(){this.i&&(this.i.release(),this.i=null),this.g=null},d.je=function(e){this.h=this.j?this.h:e},d.qd=function(){return(this.j?this.g.currentTime:this.h)||0},d.Bf=function(){return 0},d.Af=function(){return 0},d.cg=function(){};function $0(e,t,n,r,a,l){var f=this;this.i=e,this.g=t.presentationTimeline,this.A=t.minBufferTime||0,this.l=n,this.u=a,this.s=null,this.o=aw(e,n,l),this.j=new pc(e,t.presentationTimeline,n,this.o,l),this.h=new F0(e,function(){e:{var c=f.j;c.j=!0,c.o=!1;var p=gc(f.h);if(c=Y0(f,p),.001f.g.getDuration()?f.g.hc():f.g.qb():0>c&&(c=f.g.qb()+c),K0(f,q0(f,c))}),this.m=new $e(function(){if(f.i.readyState!=0&&!f.i.paused){var c=gc(f.h),p=f.g.hc(),m=f.g.qb();3>m-p&&(p=m-3),c=n?n-e.l.durationBackoff:t}function Y0(e,t){var n=Math.max(e.A,e.l.rebufferingGoal),r=e.l.safeSeekOffset,a=e.g.hc(),l=e.g.qb(),f=e.g.getDuration();3>l-a&&(a=l-3);var c=e.g.Rc(n),p=e.g.Rc(r);return n=e.g.Rc(n+r),t>=f?K0(e,t):t>l?l:t=c||ic(e.i.buffered,t)?t:n}function q0(e,t){var n=e.g.hc();return te?e:t)}function aw(e,t,n){if(!t.stallEnabled)return null;var r=t.stallSkip;return t=new B0(new rw(e),t.stallThreshold,n),ow(t,function(){r?e.currentTime+=r:(e.pause(),e.play())}),t}function Qe(e){this.g=e,this.m=null,this.j=0,this.o=!1}d=Qe.prototype,d.Ab=function(){return this.g.length},d.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)},d.Ch=function(){this.o=!0};function yc(e,t){e=v(e.g);for(var n=e.next();!n.done;n=e.next())t(n.value)}d.find=function(e){for(var t=this.g.length-1,n=t;0<=n;--n){var r=this.g[n],a=n=r.startTime&&ee||e>=this.g.length?null:this.g[e])},d.offset=function(e){if(!this.o)for(var t=v(this.g),n=t.next();!n.done;n=t.next())n.value.offset(e)},d.Qd=function(e){if(!this.o&&e.length){var t=Math.round(1e3*e[0].startTime)/1e3;this.g=this.g.filter(function(n){return Math.round(1e3*n.startTime)/1e3t&&(n.g.length==0||r.endTime>n.g[0].startTime)}),this.Qd(e),this.bb(t)},d.bb=function(e){if(!this.o){var t=this.g.length;this.g=this.g.filter(function(n){return n.endTime>e}),this.j+=t-this.g.length}},d.bc=function(e,t,n){if(n=n===void 0?!1:n,!this.o){for(;this.g.length&&this.g[this.g.length-1].startTime>=t;)this.g.pop();for(;this.g.length&&this.g[0].endTime<=e;)this.g.shift(),n||this.j++;this.g.length!=0&&(e=this.g[this.g.length-1],this.g[this.g.length-1]=new Pe(e.startTime,t,e.A,e.Qa,e.wa,e.aa,e.timestampOffset,e.appendWindowStart,e.appendWindowEnd,e.g,e.tilesLayout,e.u,e.ca,e.status,e.aes128Key),this.g[this.g.length-1].i=e.i)}},d.Yd=function(e,t){var n=this;this.o||(this.m&&this.m.stop(),this.m=new $e(function(){var r=t();r?n.g.push.apply(n.g,N(r)):(n.m.stop(),n.m=null)}),this.m.$a(e))},Qe.prototype[Symbol.iterator]=function(){return this.Nb(0)},Qe.prototype.Nb=function(e){var t=this.find(e);if(t==null)return null;t--;var n=this.get(t+1),r=-1;if(n&&0=l.startTime&&e=e.g.length&&(this.g++,this.h=0,e=this.i.get(this.g)),e&&0=n}),0<=t?r.splice(t,r[t].position==n?1:0,e):r.push(e)}Cl.prototype.j=function(e){for(var t=v(this.g.values()),n=t.next();!n.done;n=t.next()){n=n.value;e:{for(var r=n.$c,a=r.length-1;0<=a;a--){var l=r[a];if(l.position<=e){r=l.Ve;break e}}r=null}if((a=r)&&(a=n.If,a=!(a===r||a&&r&&a.bandwidth==r.bandwidth&&a.audioSamplingRate==r.audioSamplingRate&&a.codecs==r.codecs&&a.contentType==r.contentType&&a.frameRate==r.frameRate&&a.height==r.height&&a.mimeType==r.mimeType&&a.channelsCount==r.channelsCount&&a.pixelAspectRatio==r.pixelAspectRatio&&a.width==r.width)),a)e:{if(a=e,l=r.contentType,(l=this.h()[l])&&0=l[0].start&&a=r)})}else t.$c=[]}function xc(e){Je.call(this);var t=this;this.g=new Set,this.i=e,this.h=new $e(function(){for(var n=t.i(),r=v(t.g),a=r.next();!a.done;a=r.next())a=a.value,a.endTimer.endTime?Os:Cr;this.g.set(r,l);for(var f=v(this.m),c=f.next();!c.done;c=f.next())c=c.value,c.Yb==a&&c.Xb==l&&c.Qb(r,t)}}};function Do(e,t,n,r){t=new Ne(t,new Map([["region",n],["seeking",r]])),e.dispatchEvent(t)}var Ds=1,Cr=2,Os=3;function cw(e,t,n){this.i=e,this.h=t,this.j=0,this.l=n,this.g=new Map}function Sc(e,t,n){if(n=n===void 0?!1:n,e.h.segmentIndex){var r=e.h.segmentIndex.Nb(Math.max(t.startTime,e.j));if(r){var a=t;for(n&&(a=r.next().value)&&a.startTime==t.startTime&&a.endTime==t.endTime&&(a=null);e.g.sizea;){var f=l.pop();f&&em(r,f)}0c):l=!1,l&&t.Na.abort(),H(a)})}d.dd=function(){if(this.g)for(var e=this.g.Dd(),t=v(this.i.keys()),n=t.next();!n.done;n=t.next()){var r=n.value;n=this.i.get(r);var a=null;n.X&&(a=n.X.current()),(!a||a.startTime>e||a.endTime=a.g&&ee?this.g.T.Pa(e):this.g.T.Pa(Math.pow(2,32))};function xw(e,t){var n,r,a,l,f;return j(function(c){switch(c.g){case 1:if(ot(e.l),t.Da||t.ib==null||t.Lc)return c.return();if(t.ib=null,!t.wb){c.B(2);break}return E(c,Ec(e,t,t.Zd,t.vd),3);case 3:return c.return();case 2:if(t.stream.segmentIndex){c.B(4);break}return n=t.stream,E(c,t.stream.createSegmentIndex(),5);case 5:if(n!=t.stream)return n.closeSegmentIndex&&n.closeSegmentIndex(),t.Da||t.ib||oi(e,t,0),c.return();case 4:Q(c,6),r=Sw(e,t),r!=null&&(oi(e,t,r),t.Tc=!1),ae(c,7);break;case 6:return a=q(c),E(c,lm(e,t,a),8);case 8:return c.return();case 7:if(l=Array.from(e.i.values()),!e.A||!l.every(function(p){return p.endOfStream})){c.B(0);break}return E(c,e.g.T.endOfStream(),10);case 10:ot(e.l),f=e.g.T.getDuration(),f!=0&&ff&&c)return t.endOfStream=!0,t.type=="video"&&(e=e.i.get(Ye))&&Cc(e)&&(e.endOfStream=!0),null;if(t.endOfStream=!1,a>=l)return e.h.updateIntervalSeconds/2;if(a=ww(e,t,n,c),!a)return e.h.updateIntervalSeconds;for(l=1/0,f=Array.from(e.i.values()),f=v(f),c=f.next();!c.done;c=f.next())c=c.value,Cc(c)||c.X&&!c.X.current()||(l=Math.min(l,c.Ca?c.Ca.endTime:n));return r>=l+e.m.presentationTimeline.g?e.h.updateIntervalSeconds:(t.ra&&t.X&&(r=a.aa,!r||t.Ca&&x0(r,t.Db)||dw(t.ra,r),Sc(t.ra,a)),Tw(e,t,n,a).catch(function(){}),null)}function ww(e,t,n,r){if(t.X)return t.X.current();if(t.Ca||r)return n=t.Ca?t.Ca.endTime:r,t.Xe=!0,t.X=t.stream.segmentIndex.Nb(n),t.X&&t.X.next().value;e=e.h.inaccurateManifestTolerance,r=Math.max(n-e,0);var a=null;return e&&(t.X=t.stream.segmentIndex.Nb(r),a=t.X&&t.X.next().value),a||(t.X=t.stream.segmentIndex.Nb(n),a=t.X&&t.X.next().value),a}function Tw(e,t,n,r){var a,l,f,c,p,m,g,S,T,w,A,M,R,D,_,B;return j(function(U){switch(U.g){case 1:if(a=Dt,l=t.stream,f=t.X,t.Da=!0,Q(U,2),r.Pb()==2)throw new F(1,1,1011);return E(U,bw(e,t,r),4);case 4:return ot(e.l),e.s?U.return():(c=l.mimeType=="video/mp4"||l.mimeType=="audio/mp4",p=o.ReadableStream,e.h.lowLatencyMode&&p&&c&&(e.m.type!="HLS"||r.m)?(S=new Uint8Array(0),w=T=!1,M=function(z){var W,se,Z;return j(function(J){switch(J.g){case 1:if(T||(w=!0,ot(e.l),e.s))return J.return();if(Q(J,2),S=Iw(S,z),W=!1,se=0,new lt().box("mdat",function(ce){se=ce.size+ce.start,W=!0}).parse(S,!1,!0),!W){J.B(4);break}return Z=S.subarray(0,se),S=S.subarray(se),E(J,Tc(e,t,n,l,r,Z,!0),5);case 5:t.ra&&t.X&&Sc(t.ra,r,!0);case 4:ae(J,0);break;case 2:A=q(J),H(J)}})},E(U,Ic(e,t,r,M),9)):(m=Ic(e,t,r),E(U,m,7)));case 7:return g=U.h,ot(e.l),e.s?U.return():(ot(e.l),t.wb?(t.Da=!1,oi(e,t,0),U.return()):E(U,Tc(e,t,n,l,r,g),6));case 9:if(R=U.h,A)throw A;if(w){U.B(10);break}return T=!0,ot(e.l),e.s?U.return():t.wb?(t.Da=!1,oi(e,t,0),U.return()):E(U,Tc(e,t,n,l,r,R),10);case 10:t.ra&&t.X&&Sc(t.ra,r,!0);case 6:if(ot(e.l),e.s)return U.return();t.Ca=r,f.next(),t.Da=!1,t.ff=!1,D=e.g.T.pb(),_=D[t.type],JSON.stringify(_),t.wb||e.g.af(r,t.stream),oi(e,t,0),ae(U,0);break;case 2:if(B=q(U),ot(e.l,B),e.s)return U.return();if(t.Da=!1,B.code==7001)t.Da=!1,Bs(t),oi(e,t,0),U.B(0);else if(t.type==a.na&&e.h.ignoreTextStreamFailures)e.i.delete(a.na),U.B(0);else if(B.code==3017)Ew(e,t,B),U.B(0);else return t.Tc=!0,B.severity=2,E(U,lm(e,t,B),0)}})}function Cw(e,t,n){var r,a,l,f;return j(function(c){if(c.g==1)return r=t,r.cryptoKey?c.B(2):E(c,r.fetchKey(),3);if(a=r.iv,!a)for(a=Fe(new ArrayBuffer(16)),l=r.firstMediaSequenceNumber+n,f=a.byteLength-1;0<=f;f--)a[f]=l&255,l>>=8;return c.return(o.crypto.subtle.decrypt({name:"AES-CBC",iv:a},r.cryptoKey,e))})}function Iw(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Ew(e,t,n){if(!Array.from(e.i.values()).some(function(a){return a!=t&&a.ff})){if(0=f?c.return():E(c,e.g.T.remove(t.type,a,a+f),2));ot(e.l),H(c)})}function Cc(e){return e&&e.type==Ye&&(e.stream.mimeType=="application/cea-608"||e.stream.mimeType=="application/cea-708")}function Ic(e,t,n,r){var a,l,f,c,p;return j(function(m){switch(m.g){case 1:if(n instanceof Bn&&(a=n.g))return m.return(a);if(l=null,t.ra){var g=t.ra;if(g.g.has(n)){var S=g.g.get(n);r&&(S.h=r),g.g.delete(n),l=S.g}else l=null}return l||(l=am(e,n,t.stream,r)),f=0,t.X&&(f=t.X.g),t.Na=l,E(m,l.promise,2);case 2:if(c=m.h,t.Na=null,p=c.data,!n.aes128Key){m.B(3);break}return E(m,Cw(p,n.aes128Key,f),4);case 4:p=m.h;case 3:return m.return(p)}})}function am(e,t,n,r){var a=t instanceof Pe?t:void 0,l=a?1:0;return t=El(t.Z(),t.Qa,t.wa,e.h.retryParameters,r),e.g.Tb.request(Ii,t,{type:l,stream:n,segment:a})}function Ec(e,t,n,r){var a,l;return j(function(f){if(f.g==1)return t.wb=!1,t.Zd=!1,t.vd=0,t.Lc=!0,t.Ca=null,t.Db=null,t.X=null,t.ra&&J0(t.ra),r?(a=e.g.Dd(),l=e.g.T.getDuration(),E(f,e.g.T.remove(t.type,a+r,l),3)):E(f,D0(e.g.T,t.type),4);if(f.g!=3)return ot(e.l),n?E(f,e.g.T.flush(t.type),3):f.B(3);ot(e.l),t.Lc=!1,t.endOfStream=!1,t.Da||t.ib||oi(e,t,0),H(f)})}function oi(e,t,n){var r=t.type;(r!=Ye||e.i.has(r))&&(t.ib=new Cs(function(){var a;return j(function(l){if(l.g==1)return Q(l,2),E(l,xw(e,t),4);if(l.g!=2)return ae(l,0);a=q(l),e.g&&e.g.onError(a),H(l)})}).U(n))}function Bs(e){e.ib!=null&&(e.ib.stop(),e.ib=null)}function js(e){return j(function(t){return e.Na?E(t,e.Na.abort(),0):t.B(0)})}function lm(e,t,n){var r;return j(function(a){if(a.g==1)return E(a,Fp(e.G),2);ot(e.l),r=e.h.maxDisabledTime===0&&n.code==1011?1:e.h.maxDisabledTime,n.category===1&&0"+f+""},e.payload)}function fm(e){e=e.toLowerCase();var t=e.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);switch(t?e="#"+(parseInt(t[1],10)|256).toString(16).slice(1)+(parseInt(t[2],10)|256).toString(16).slice(1)+(parseInt(t[3],10)|256).toString(16).slice(1):e.startsWith("#")&&7e}),!0):!1},d.append=function(e){var t=Ac(e),n=[];e=this.g.cues?Array.from(this.g.cues):[];var r={};t=v(t);for(var a=t.next();!a.done;r={Zb:r.Zb},a=t.next())r.Zb=a.value,e.some(function(l){return function(f){return f.startTime==l.Zb.startTime&&f.endTime==l.Zb.endTime&&f.text==l.Zb.payload}}(r))||(a=Rw(r.Zb))&&n.push(a);for(e=n.slice().sort(function(l,f){return l.startTime!=f.startTime?l.startTime-f.startTime:l.endTime!=f.endTime?l.endTime-f.startTime:"line"in VTTCue.prototype?n.indexOf(f)-n.indexOf(l):n.indexOf(l)-n.indexOf(f)}),e=v(e),r=e.next();!r.done;r=e.next())this.g.addCue(r.value)},d.destroy=function(){return this.g&&(cm(this.g,function(){return!0}),this.g.mode="disabled"),this.g=null,Promise.resolve()},d.isTextVisible=function(){return this.g.mode=="showing"},d.setTextVisibility=function(e){this.g.mode=e?"showing":"hidden"};function Rw(e){if(e.startTime>=e.endTime)return null;var t=new VTTCue(e.startTime,e.endTime,e.payload);t.lineAlign=e.lineAlign,t.positionAlign=e.positionAlign,e.size&&(t.size=e.size);try{t.align=e.textAlign}catch{}return e.textAlign=="center"&&t.align!="center"&&(t.align="middle"),e.writingMode=="vertical-lr"?t.vertical="lr":e.writingMode=="vertical-rl"&&(t.vertical="rl"),e.lineInterpretation==1&&(t.snapToLines=!1),e.line!=null&&(t.line=e.line),e.position!=null&&(t.position=e.position),t}function cm(e,t){var n=e.mode;e.mode=n=="showing"?"showing":"hidden";for(var r=v(Array.from(e.cues)),a=r.next();!a.done;a=r.next())(a=a.value)&&t(a)&&e.removeCue(a);e.mode=n}he("shaka.text.SimpleTextDisplayer",jn),jn.prototype.setTextVisibility=jn.prototype.setTextVisibility,jn.prototype.isTextVisible=jn.prototype.isTextVisible,jn.prototype.destroy=jn.prototype.destroy,jn.prototype.append=jn.prototype.append,jn.prototype.remove=jn.prototype.remove;/* + @license + Shaka Player + Copyright 2023 Google LLC + SPDX-License-Identifier: Apache-2.0 +*/function Fn(){}d=Fn.prototype,d.remove=function(){},d.append=function(){},d.destroy=function(){},d.isTextVisible=function(){return!1},d.setTextVisibility=function(){},he("shaka.text.StubTextDisplayer",Fn),Fn.prototype.setTextVisibility=Fn.prototype.setTextVisibility,Fn.prototype.isTextVisible=Fn.prototype.isTextVisible,Fn.prototype.destroy=Fn.prototype.destroy,Fn.prototype.append=Fn.prototype.append,Fn.prototype.remove=Fn.prototype.remove;function dm(){}function Fs(e){for(;e.firstChild;)e.removeChild(e.firstChild)}he("shaka.util.Dom",dm),dm.removeAllChildren=Fs;function zn(e,t){var n=this;this.m=!1,this.i=[],this.A=e,this.s=t,this.j=null,this.g=document.createElement("div"),this.g.classList.add("shaka-text-container"),this.g.style.textAlign="center",this.g.style.display="flex",this.g.style.flexDirection="column",this.g.style.alignItems="center",this.g.style.justifyContent="flex-end",this.s.appendChild(this.g),this.C=new $e(function(){zs(n)}).$a(.25),this.h=new Map,this.l=new ft,this.l.D(document,"fullscreenchange",function(){zs(n,!0)}),this.l.D(this.A,"resize",function(){var r=n.A,a=r.videoWidth;r=r.videoHeight,a&&r?n.j=a/r:n.j=null}),this.o=null,"ResizeObserver"in o&&(this.o=new ResizeObserver(function(){zs(n,!0)}),this.o.observe(this.g)),this.u=new Map}d=zn.prototype,d.append=function(e){var t=[].concat(N(this.i)),n={};e=v(e);for(var r=e.next();!r.done;n={jd:n.jd},r=e.next())n.jd=r.value,t.some(function(a){return function(l){return Tf(l,a.jd)}}(n))||this.i.push(n.jd);zs(this)},d.destroy=function(){return this.g&&(this.s.removeChild(this.g),this.g=null,this.m=!1,this.i=[],this.C&&this.C.stop(),this.h.clear(),this.l&&(this.l.release(),this.l=null),this.o&&(this.o.disconnect(),this.o=null)),Promise.resolve()},d.remove=function(e,t){if(!this.g)return!1;var n=this.i.length;return this.i=this.i.filter(function(r){return r.startTime=t}),zs(this,n>this.i.length),!0},d.isTextVisible=function(){return this.m},d.setTextVisibility=function(e){this.m=e};function _w(e,t){for(;t!=null;){if(t==e.g)return!0;t=t.parentElement}return!1}function hm(e,t,n,r,a){var l=!1,f=[],c=[];t=v(t);for(var p=t.next();!p.done;p=t.next()){p=p.value,a.push(p);var m=e.h.get(p),g=p.startTime<=r&&p.endTime>r,S=m?m.wg:null;m&&(f.push(m.pe),m.bd&&f.push(m.bd),g||(l=!0,e.h.delete(p),m=null)),g&&(c.push(p),m?_w(e,S)||(l=!0):(Lw(e,p,a),m=e.h.get(p),S=m.wg,l=!0)),0e.j&&(c=32),r=0>r?100+r/c*100:r/c*100),f==1&&(l.position="absolute",n.writingMode==ys?(l.width="100%",n.lineAlign==wo?l.top=r+"%":n.lineAlign=="end"&&(l.bottom=100-r+"%")):n.writingMode=="vertical-lr"?(l.height="100%",n.lineAlign==wo?l.left=r+"%":n.lineAlign=="end"&&(l.right=100-r+"%")):(l.height="100%",n.lineAlign==wo?l.right=r+"%":n.lineAlign=="end"&&(l.left=100-r+"%")))),l.lineHeight=n.lineHeight,n.position!=null&&(n.writingMode==ys?l.paddingLeft=n.position:l.paddingTop=n.position),e=Nw(n),e=="line-left"?l.cssFloat="left":e=="line-right"&&(l.cssFloat="right"),l.textAlign=n.textAlign,l.textDecoration=n.textDecoration.join(" "),l.writingMode=n.writingMode,"writingMode"in document.documentElement.style&&l.writingMode==n.writingMode||(l.webkitWritingMode=n.writingMode),n.size&&(n.writingMode==ys?l.width=n.size+"%":l.height=n.size+"%")}function kc(e,t,n){var r=(r=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(e))?{value:Number(r[1]),unit:r[2]}:null;if(!r)return e;var a=r.value;switch(r.unit){case"%":return a/100*n.clientHeight/t.cellResolution.rows+"px";case"c":return n.clientHeight*a/t.cellResolution.rows+"px";default:return e}}function pm(e,t){for(var n=e.length-1;0<=n;n--){var r=t(e[n]);if(r||r===0)return r}return null}he("shaka.text.UITextDisplayer",zn),zn.prototype.setTextVisibility=zn.prototype.setTextVisibility,zn.prototype.isTextVisible=zn.prototype.isTextVisible,zn.prototype.remove=zn.prototype.remove,zn.prototype.destroy=zn.prototype.destroy,zn.prototype.append=zn.prototype.append;function Dw(e,t){function n(l){for(var f=l,c=v(t),p=c.next();!p.done;p=c.next())p=p.value,p.end&&p.startl?"0":"")+l+":"+(10>c?"0":"")+c+":"+(10>p?"0":"")+p+"."+(100>f?10>f?"00":"0":"")+f}var r=Ac(e);e=`WEBVTT + +`,r=v(r);for(var a=r.next();!a.done;a=r.next())a=a.value,e+=n(a.startTime)+" --> "+n(a.endTime)+function(l){var f=[];switch(l.textAlign){case"left":f.push("align:left");break;case"right":f.push("align:right");break;case Ri:f.push("align:middle");break;case"start":f.push("align:start");break;case"end":f.push("align:end")}switch(l.writingMode){case"vertical-lr":f.push("vertical:lr");break;case"vertical-rl":f.push("vertical:rl")}return f.length?" "+f.join(" "):""}(a)+` +`,e+=a.payload+` + +`;return e}he("shaka.text.WebVttGenerator",function(){});function mm(e,t){this.h=e,this.g=t,this.m=void 0,this.i=!1,this.l=!0,this.j=!1}mm.prototype.configure=function(e){this.g=e};function Ow(e,t,n){try{if(!e.g.enabled)return t;var r=Mc(e);e:{switch(n.toLowerCase()){case"audio/mp4":case"audio/webm":case"audio/ogg":case"audio/mpeg":case"audio/aac":case"audio/flac":case"audio/wav":var a=kl;break e;case"video/webm":case"video/mp4":case"video/mpeg":case"video/mp2t":a=Rl;break e;case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"application/dash+xml":case"video/vnd.mpeg.dash.mpd":case"application/vnd.ms-sstr+xml":a=gm;break e}a=void 0}r.ot=a,r.su=!0;var l=Al(r);return Rc(t,l)}catch(f){return qt("CMCD_SRC_ERROR","Could not generate src CMCD data.",f),t}}function Mc(e){return e.g.sessionId||(e.g.sessionId=o.crypto.randomUUID()),{v:1,sf:e.m,sid:e.g.sessionId,cid:e.g.contentId,mtp:e.h.getBandwidthEstimate()/1e3}}function Er(e,t,n){n=n===void 0?{}:n;var r=r===void 0?e.g.useHeaders:r;if(e.g.enabled){Object.assign(n,Mc(e)),n.pr=e.h.Cd();var a=n.ot===Ml||n.ot===Rl;if(e.j&&a&&(n.bs=!0,n.su=!0,e.j=!1),n.su==null&&(n.su=e.l),r)e=Fw(n),Object.keys(e).length&&Object.assign(t.headers,e);else{var l=Al(n);l&&(t.uris=t.uris.map(function(f){return Rc(f,l)}))}}}function Uw(e){if(e.type===0)return zw;if(e=e.stream){var t=e.type;if(t=="video")return e.codecs&&e.codecs.includes(",")?Rl:Ml;if(t=="audio")return kl;if(t=="text")return e.mimeType==="application/mp4"?Lc:_c}}function Bw(e,t){if(t=e.h.pb()[t],!t.length)return NaN;var n=e.h.getCurrentTime();return(e=t.find(function(r){return r.start<=n&&r.end>=n}))?1e3*(e.end-n):NaN}function jw(e,t){var n=e.h.Cb();if(!n.length)return NaN;e=n[0],n=v(n);for(var r=n.next();!r.done;r=n.next())r=r.value,r.type==="variant"&&r.bandwidth>e.bandwidth&&(e=r);switch(t){case Ml:return e.videoBandwidth||NaN;case kl:return e.audioBandwidth||NaN;default:return e.bandwidth}}function Al(e){function t(S){return 100*n(S/100)}function n(S){return Math.round(S)}function r(S){return!Number.isNaN(S)&&S!=null&&S!==""&&S!==!1}var a=[],l={br:n,d:n,bl:t,dl:t,mtp:t,nor:function(S){return encodeURIComponent(S)},rtp:t,tb:n},f=Object.keys(e||{}).sort();f=v(f);for(var c=f.next();!c.done;c=f.next()){c=c.value;var p=e[c];if(r(p)&&(c!=="v"||p!==1)&&(c!="pr"||p!==1)){var m=l[c];m&&(p=m(p)),m=typeof p;var g=void 0;g=m==="string"&&c!=="ot"&&c!=="sf"&&c!=="st"?c+"="+JSON.stringify(p):m==="boolean"?c:m==="symbol"?c+"="+p.description:c+"="+p,a.push(g)}}return a.join(",")}function Fw(e){var t=Object.keys(e),n={},r=["Object","Request","Session","Status"],a=[{},{},{},{}],l={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};t=v(t);for(var f=t.next();!f.done;f=t.next())f=f.value,a[l[f]!=null?l[f]:1][f]=e[f];for(e=0;e=n?e*(1-n)+t*n:e};function ym(e){return e?e.toLowerCase()==="false"?!1:/^[-0-9]/.test(e)?parseInt(e,10):e.replace(/["]+/g,""):!0}he("shaka.util.CmsdManager",Vn),Vn.prototype.getBandwidthEstimate=Vn.prototype.getBandwidthEstimate,Vn.prototype.getRoundTripTime=Vn.prototype.gh,Vn.prototype.getResponseDelay=Vn.prototype.fh,Vn.prototype.getEstimatedThroughput=Vn.prototype.Qf,Vn.prototype.getMaxBitrate=Vn.prototype.Rf;var vm="etp",xm="mb",Sm="rd",wm="rtt";function Nc(){}function Pc(e,t,n,r,a){var l=a in r,f=!0,c;for(c in t){var p=a+"."+c,m=l?r[a]:n[c];l||c in n?t[c]===void 0?m===void 0||l?delete e[c]:e[c]=Eo(m):m.constructor==Object&&t[c]&&t[c].constructor==Object?(e[c]||(e[c]=Eo(m)),p=Pc(e[c],t[c],m,r,p),f=f&&p):typeof t[c]!=typeof m||t[c]==null||typeof t[c]!="function"&&t[c].constructor!=m.constructor?(Te("Invalid config, wrong type for "+p),f=!1):(typeof n[c]=="function"&&n[c].length!=t[c].length&&Ge("Unexpected number of arguments for "+p),e[c]=t[c]):(Te("Invalid config, unrecognized key "+p),f=!1)}return f}function Dc(e,t){for(var n={},r=n,a=0,l=0;a=e.indexOf(".",a),!(0>a);)(a==0||e[a-1]!="\\")&&(l=e.substring(l,a).replace(/\\\./g,"."),r[l]={},r=r[l],l=a+1),a+=1;return r[e.substring(l).replace(/\\\./g,".")]=t,n}function _l(e,t){return e&&t}he("shaka.util.ConfigUtils",Nc),Nc.convertToConfigObject=Dc,Nc.mergeConfigObjects=Pc;function Tm(){this.g=null,this.h=[]}function Oc(e,t){return j(function(n){if(n.g==1)return e.g?E(n,new Promise(function(r){return e.h.push(r)}),2):n.B(2);e.g=t,H(n)})}Tm.prototype.release=function(){0"&&n.substr(-6)===""&&(n=n.slice(5,-6),e=!0);try{var r=JSON.parse(n);r.ckc&&(n=r.ckc,e=!0),r.CkcMessage&&(n=r.CkcMessage,e=!0),r.License&&(n=r.License,e=!0)}catch{}e&&(t.data=On(ti(n)))}},Hn.expressplayFairPlayRequest=function(e,t){Uc(e,t)},Hn.conaxFairPlayRequest=function(e,t){Uc(e,t)},Hn.ezdrmFairPlayRequest=function(e,t){Uc(e,t)},Hn.verimatrixFairPlayRequest=function(e,t){e===2&&(e=Fe(t.body),e=Ro(e),t.headers["Content-Type"]="application/x-www-form-urlencoded",t.body=Oi("spc="+e))},Hn.expressplayInitDataTransform=function(e,t,n){return Im(e,t,n)},Hn.conaxInitDataTransform=function(e,t,n){if(t!=="skd")return e;t=n.serverCertificate,n=io(e).split("skd://").pop().split("?").shift(),n=o.atob(n);var r=new ArrayBuffer(2*n.length);r=ep(r);for(var a=0,l=n.length;a=c.height});for(f.length&&(f.sort(function(c,p){return p.height-c.height}),n=f.filter(function(c){return c.height==f[0].height})),t=[],n.length&&(a=Math.floor(n.length/2),n.sort(function(c,p){return c.bandwidth-p.bandwidth}),t.push(n[a])),e=v(e),n=e.next();!n.done;n=e.next())n=n.value,n.type!=Ye&&n.type!="image"||t.push(n);return t}he("shaka.util.PlayerConfiguration",Bc),Bc.mergeConfigObjects=Ar,Bc.createDefault=br;function Hw(){this.g=null,this.h=[]}function jc(e,t){var n=0;e.g&&e.g.state==t&&(n+=e.g.duration),e=v(e.h);for(var r=e.next();!r.done;r=e.next())r=r.value,n+=r.state==t?r.duration:0;return n}function Gw(e){function t(l){return{timestamp:l.timestamp,state:l.state,duration:l.duration}}for(var n=[],r=v(e.h),a=r.next();!a.done;a=r.next())n.push(t(a.value));return e.g&&n.push(t(e.g)),n}function Xw(){this.i=this.h=null,this.g=[]}function Fc(e,t,n){e.i!=t&&(e.i=t,e.g.push({timestamp:Date.now()/1e3,id:t.id,type:"text",fromAdaptation:n,bandwidth:null}))}function Em(){this.u=this.A=this.G=this.C=this.s=this.j=this.F=this.m=this.i=this.K=this.N=this.H=this.I=this.J=this.l=this.o=NaN,this.g=new Hw,this.h=new Xw}function ue(e,t){Je.call(this);var n=this;this.l=qc,this.xd=this.h=null,this.da=!1,this.Gd=new ft,this.sc=new ft,this.o=new ft,this.Ba=new ft,this.C=this.G=this.m=this.H=null,this.Kd=0,this.W=new Tm,this.ma=this.ea=this.i=this.Ld=this.F=this.j=this.za=this.J=this.eg=this.Y=this.V=this.Aa=this.K=this.I=this.$b=null,this.mb=!1,this.Ne=this.s=null,this.We=1e9,this.Oc=[],this.N=NaN,this.g=Mr(this),this.Id={width:1/0,height:1/0},this.u=null,this.kb=new lr(this.g.preferredAudioLanguage,this.g.preferredVariantRole,this.g.preferredAudioChannelCount,this.g.preferredVideoHdrLevel,this.g.preferSpatialAudio,this.g.preferredVideoLayout,this.g.preferredAudioLabel,this.g.preferredVideoLabel,this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups),this.lb=this.g.preferredTextLanguage,this.Kc=this.g.preferredTextRole,this.Jc=this.g.preferForcedSubs,this.Hc=[],t&&t(this),this.V=lT(this),this.Y=new Vn(this.g.cmsd),this.H=oT(this),this.H.nf(this.g.streaming.forceHTTPS),this.A=null,Ul&&(this.A=Ul(),this.A.configure(this.g.ads)),this.Gd.D(o,"online",function(){$c(n),n.gf()}),this.yd=new $e(function(){return pT(n)}),e&&(ei("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.Ic(e,!0))}le(ue,Je);function Ll(e){e.J!=null&&(M0(e.J),e.J.release(),e.J=null)}function Ww(e,t){if(t.lcevc.enabled){var n=e.Cb();n&&n[0]&&n[0].videoMimeType=="video/mp2t"&&(Pf()||navigator.userAgent.match(/Edge\//))&&(t.mediaSource.forceTransmux||Ge("LCEVC Warning: For MPEG-2 TS decoding the config.mediaSource.forceTransmux must be enabled.")),Ll(e),e.J==null&&(e.J=new Ns(e.h,e.eg,t.lcevc),e.G&&(e.G.N=e.J))}else Ll(e)}function yt(e,t){return new Ne(e,t)}d=ue.prototype,d.destroy=function(){var e=this,t;return j(function(n){switch(n.g){case 1:return e.l==yi?n.return():(Ll(e),t=e.detach(),e.l=yi,E(n,t,2));case 2:if(e.Gd&&(e.Gd.release(),e.Gd=null),e.sc&&(e.sc.release(),e.sc=null),e.o&&(e.o.release(),e.o=null),e.Ba&&(e.Ba.release(),e.Ba=null),e.Ne=null,e.g=null,e.u=null,e.xd=null,e.V=null,e.Y=null,!e.H){n.B(3);break}return E(n,e.H.destroy(),4);case 4:e.H=null;case 3:e.s&&(e.s.release(),e.s=null),Je.prototype.release.call(e),H(n)}})};function Hi(e,t){e.dispatchEvent(yt("onstatechange",new Map().set("state",t)))}d.Ic=function(e,t){t=t===void 0?!0:t;var n=this,r,a;return j(function(l){switch(l.g){case 1:if(n.l==yi)throw new F(2,7,7e3);if(!n.h||n.h==e){l.B(2);break}return E(l,n.detach(),2);case 2:return E(l,zc(n,"attach"),4);case 4:if(l.h)return l.return();if(Q(l,5,6),Hi(n,"attach"),r=function(){var f=Kc(n);f&&Oo(n,f)},n.sc.D(e,"error",r),n.h=e,!t||!mi()||n.G){l.B(6);break}return E(l,Vc(n),6);case 6:Y(l),n.W.release(),K(l,0);break;case 5:return a=q(l),E(l,n.detach(),10);case 10:throw a}})},d.Eg=function(e){this.eg=e},d.detach=function(e){e=e===void 0?!1:e;var t=this;return j(function(n){if(n.g==1){if(t.l==yi)throw new F(2,7,7e3);return E(n,t.rc(!1,e),2)}if(n.g!=3)return E(n,zc(t,"detach"),3);if(n.h)return n.return();try{t.h&&(t.sc.Za(),t.h=null),Hi(t,"detach"),t.A&&!e&&t.A.release()}finally{t.W.release()}H(n)})};function zc(e,t){var n;return j(function(r){return r.g==1?(n=++e.Kd,E(r,Oc(e.W,t),2)):n!=e.Kd?(e.W.release(),r.return(!0)):r.return(!1)})}d.rc=function(e,t){e=e===void 0?!0:e,t=t===void 0?!1:t;var n=this,r,a,l,f,c,p,m,g,S;return j(function(T){switch(T.g){case 1:return n.l!=yi&&(n.l=qc),E(T,zc(n,"unload"),2);case 2:return T.h?T.return():(ge(T,3),n.mb=!1,Hi(n,"unload"),e&&!mi()&&(e=!1),Ll(n),r=n.Hc.map(function(w){return w()}),n.Hc=[],E(T,Promise.all(r),5));case 5:if(n.dispatchEvent(yt("unloading")),n.Aa&&(n.Aa.release(),n.Aa=null),n.h&&(n.o.Za(),n.Ba.Za()),n.yd.stop(),n.$b&&(n.$b.release(),n.$b=null),!n.F){T.B(6);break}return E(T,n.F.stop(),7);case 7:n.F=null,n.Ld=null;case 6:if(!n.s){T.B(8);break}return E(T,n.s.stop(),8);case 8:if(!n.j){T.B(10);break}return E(T,n.j.destroy(),11);case 11:n.j=null;case 10:if(n.I&&(n.I.release(),n.I=null),n.C&&(n.C.release(),n.C=null),!n.G){T.B(12);break}return E(T,n.G.destroy(),13);case 13:n.G=null;case 12:if(n.A&&!t&&n.A.onAssetUnload(),n.Y&&(n.Y.g=null),n.h&&Fs(n.h),!n.h||!n.h.src){T.B(14);break}return E(T,new Promise(function(w){return new $e(w).U(.1)}),15);case 15:n.h.removeAttribute("src"),n.h.load();case 14:if(!n.m){T.B(16);break}return E(T,n.m.destroy(),17);case 17:n.m=null;case 16:if(n.ea=null,n.K=null,n.i){for(a=v(n.i.variants),l=a.next();!l.done;l=a.next())for(f=l.value,c=v([f.audio,f.video]),p=c.next();!p.done;p=c.next())(m=p.value)&&m.segmentIndex&&m.segmentIndex.release();for(g=v(n.i.textStreams),p=g.next();!p.done;p=g.next())S=p.value,S.segmentIndex&&S.segmentIndex.release()}n.i=null,n.u=new Em,n.Te=null,n.Oc=[],n.N=NaN,Wc(n);case 3:Y(T),n.W.release(),K(T,4);break;case 4:if(e&&mi()&&!n.G)return E(T,Vc(n),0);T.B(0)}})},d.ei=function(e){this.ma=e},d.load=function(e,t,n){t=t===void 0?null:t;var r=this,a,l,f,c,p;return j(function(m){switch(m.g){case 1:if(r.l==yi)throw new F(2,7,7e3);return E(m,Oc(r.W,"load"),2);case 2:if(r.W.release(),!r.h)throw new F(2,7,7002);if(!r.ea){m.B(3);break}return E(m,r.rc(!1),3);case 3:if(a=++r.Kd,l=function(){if(r.Kd!=a)throw new F(2,7,7e3)},f=function(g,S){return j(function(T){switch(T.g){case 1:return ge(T,2),E(T,Oc(r.W,S),4);case 4:return l(),E(T,g(),5);case 5:l();case 2:Y(T),r.W.release(),K(T,0)}})},Q(m,5),r.ma=t,r.mb=!1,r.dispatchEvent(yt("loading")),c=Date.now()/1e3,r.u=new Em,r.ea=e,n){m.B(7);break}return E(m,f(function(){return j(function(g){if(g.g==1)return E(g,$w(r),2);n=g.h,H(g)})},"guessMimeType_"),7);case 7:if(Kw(r,n))return E(m,f(function(){return j(function(g){return E(g,Zw(r,n),0)})},"initializeSrcEqualsDrmInner_"),16);if(r.G){m.B(11);break}return E(m,f(function(){return j(function(g){return E(g,Vc(r),0)})},"initializeMediaSourceEngineInner_"),11);case 11:return E(m,f(function(){return j(function(g){return E(g,Yw(r,n),0)})},"parseManifestInner_"),13);case 13:return E(m,f(function(){return j(function(g){return E(g,qw(r),0)})},"initializeDrmInner_"),14);case 14:return E(m,f(function(){return j(function(g){return E(g,Qw(r,c),0)})},"loadInner_"),10);case 16:return E(m,f(function(){return j(function(g){return E(g,Jw(r,c,n),0)})},"srcEqualsInner_"),10);case 10:r.dispatchEvent(yt("loaded")),ae(m,0);break;case 5:if(p=q(m),p.code==7e3){m.B(18);break}return E(m,r.rc(!1),18);case 18:throw p}})};function $w(e){var t,n;return j(function(r){return r.g==1?(t=e.g.manifest.retryParameters,E(r,bc(e.ea,e.H,t),2)):(n=r.h,n=="application/x-mpegurl"&&Ya()&&(n="application/vnd.apple.mpegurl"),r.return(n))})}function Kw(e,t){if(!mi())return!0;if(t){if((e.h||xp()).canPlayType(t)=="")return!1;if(!(mi()&&t in ii))return!0;if(t==="application/x-mpegurl"||t==="application/vnd.apple.mpegurl"){if(e.g.streaming.preferNativeHls)return!0;if(Ya())return e.g.streaming.useNativeHlsOnSafari}}return!1}function Vc(e){var t,n,r,a,l;return j(function(f){if(f.g==1)return Hi(e,"media-source"),t=e.g.textDisplayFactory,n=t(),e.Te=t,r=aT(e.h,n,function(c,p,m){bm(e,c,p,m)},e.J),r.configure(e.g.mediaSource),a=e.g.manifest,l=a.segmentRelativeVttTiming,r.Y=l,E(f,r.J,2);e.G=r,H(f)})}function Yw(e,t){var n,r,a,l,f,c,p,m;return j(function(g){if(g.g==1)return n=e.H,Hi(e,"manifest-parser"),e.Ld=y0(e.ea,t||null),e.F=e.Ld(),r=Eo(e.g.manifest),e.h&&e.h.nodeName==="AUDIO"&&(r.disableVideo=!0),e.F.configure(r),e.Aa=new xc(function(){return e.Eb()}),e.Aa.addEventListener("regionadd",function(S){S=S.region,Gs(e,"timelineregionadded",S),e.A&&e.A.onDashTimedMetadata(S)}),e.za=null,e.g.streaming.observeQualityChanges&&(e.za=new Cl(function(){return e.pb()}),e.za.addEventListener("qualitychange",function(S){var T=S.quality;S=S.position,T=new Map().set("mediaQuality",{bandwidth:T.bandwidth,audioSamplingRate:T.audioSamplingRate,codecs:T.codecs,contentType:T.contentType,frameRate:T.frameRate,height:T.height,mimeType:T.mimeType,channelsCount:T.channelsCount,pixelAspectRatio:T.pixelAspectRatio,width:T.width}).set("position",S),e.dispatchEvent(yt("mediaqualitychanged",T))})),a={networkingEngine:n,filter:function(S){return Om(e,S)},makeTextStreamsForClosedCaptions:function(S){return cT(e,S)},onTimelineRegionAdded:function(S){var T=e.Aa;e:{for(var w=v(T.g),A=w.next();!A.done;A=w.next())if(A=A.value,A.schemeIdUri==S.schemeIdUri&&A.id==S.id&&A.startTime==S.startTime&&A.endTime==S.endTime){w=A;break e}w=null}w==null&&(T.g.add(S),S=new Ne("regionadd",new Map([["region",S]])),T.dispatchEvent(S))},onEvent:function(S){return e.dispatchEvent(S)},onError:function(S){return Oo(e,S)},isLowLatencyMode:function(){return e.g.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return e.g.streaming.autoLowLatencyMode},enableLowLatencyMode:function(){e.configure("streaming.lowLatencyMode",!0)},updateDuration:function(){e.j&&e.j.updateDuration()},newDrmInfo:function(S){var T=e.m?e.m.g:null;T&&e.m.s&&Xc(e,T.keySystem,S)},onManifestUpdated:function(){var S=new Map().set("isLive",e.R());e.dispatchEvent(yt("manifestupdated",S)),e.A&&e.A.onManifestUpdated(e.R())},getBandwidthEstimate:function(){return e.s.getBandwidthEstimate()}},l=Date.now()/1e3,Hi(e,"manifest"),f=e,E(g,e.F.start(e.ea,a),2);if(f.i=g.h,c=yt("manifestparsed"),e.dispatchEvent(c),e.i.variants.length==0)throw new F(2,4,4036);iT(e.i),p=Date.now()/1e3,m=p-l,e.u.F=m,H(g)})}function qw(e){var t,n,r;return j(function(a){return a.g==1?(Hi(e,"drm-engine"),t=Date.now()/1e3,n=!0,e.m=Mm(e,{Tb:e.H,onError:function(l){Oo(e,l)},Ud:function(l){Xm(e,l)},onExpirationUpdated:function(l,f){Wm(e,l,f)},onEvent:function(l){e.dispatchEvent(l),l.type=="drmsessionupdate"&&n&&(n=!1,e.u.j=Date.now()/1e3-t,e.J&&M0(e.J))}}),e.m.configure(e.g.drm),Tp(e.i.variants,e.g.restrictions,e.Id)&&e.j&&bn(e),r=Ff(e.i.variants),E(a,i0(e.m,r,e.i.offlineSessionIds),2)):a.g!=3?E(a,e.m.Ic(e.h),3):E(a,Om(e,e.i),0)})}function Qw(e,t){var n,r,a,l,f,c,p,m,g,S,T,w,A,M,R,D,_,B,U;return j(function(z){switch(z.g){case 1:for(Hi(e,"load"),n=e.h,e.I=new Ps({Ed:function(){return n.playbackRate},ec:function(){return n.defaultPlaybackRate},rf:function(W){n.playbackRate=W},bg:function(W){n.currentTime+=W}}),r=function(){return Nl(e)},a=function(){return Bm(e)},e.o.D(n,"playing",r),e.o.D(n,"pause",r),e.o.D(n,"ended",r),e.o.D(n,"ratechange",a),Ww(e,e.g),l=e.g.abrFactory,e.s&&e.Ne==l||(e.Ne=l,e.s=l(),typeof e.s.setMediaElement!="function"&&(ei("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),e.s.setMediaElement=function(){}),typeof e.s.setCmsdManager!="function"&&(ei("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),e.s.setCmsdManager=function(){}),typeof e.s.trySuggestStreams!="function"&&(ei("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),e.s.trySuggestStreams=function(){}),e.s.configure(e.g.abr)),e.kb=new lr(e.g.preferredAudioLanguage,e.g.preferredVariantRole,e.g.preferredAudioChannelCount,e.g.preferredVideoHdrLevel,e.g.preferSpatialAudio,e.g.preferredVideoLayout,e.g.preferredAudioLabel,e.g.preferredVideoLabel,e.g.mediaSource.codecSwitchingStrategy,e.g.manifest.dash.enableAudioGroups),e.lb=e.g.preferredTextLanguage,e.Kc=e.g.preferredTextRole,e.Jc=e.g.preferForcedSubs,Yc(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.s.init(function(W,se,Z){e.j&&W!=e.j.j&&Dl(e,W,!0,se===void 0?!1:se,Z===void 0?0:Z)}),e.s.setMediaElement(n),e.s.setCmsdManager(e.Y),wp(e.i,e.g.preferredVideoCodecs,e.g.preferredAudioCodecs,e.g.preferredDecodingAttributes),e.j=uT(e),e.j.configure(e.g.streaming),e.l=tn,n.textTracks&&e.o.D(n.textTracks,"addtrack",function(W){if(W.track)switch(W=W.track,W.kind){case"chapters":km(e,W)}}),e.dispatchEvent(yt("streaming")),f=null,(c=e.j.j)||(f=Fm(e,!0)),p=[],m=c||f,g=v([m.video,m.audio]),S=g.next();!S.done;S=g.next())(T=S.value)&&!T.segmentIndex&&p.push(T.createSegmentIndex());if(!(0, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),p.resolve()),e.o.ja(r,"error",function(){p.reject(Kc(e))}),E(w,p,2);(m=e.R())&&e.g.streaming.liveSync?(g=function(){return jm(e)},e.o.D(r,"timeupdate",g)):m||(S=function(){return Pl(e)},e.o.D(r,"timeupdate",S),Pl(e)),e.A&&(e.A.onManifestUpdated(m),m&&(T=e.Eb().end,e.o.D(r,"progress",function(){var A=e.Eb().end;T!=A&&(e.A.onManifestUpdated(e.R()),T=A)}))),e.mb=!0,H(w)})}function eT(e){var t=e.g.preferredAudioLanguage;t!=""&&e.jg(t,e.g.preferredVariantRole)}function tT(e){var t=e.g.preferredTextLanguage;t!=""&&e.kf(t,e.g.preferredTextRole,e.g.preferForcedSubs)}function nT(e,t){if(t.kind=="metadata"){t.mode="hidden",e.o.D(t,"cuechange",function(){if(t.activeCues)for(var r=v(t.activeCues),a=r.next();!a.done;a=r.next())a=a.value,Am(e,a.startTime,a.endTime,a.type,a.value),e.A&&e.A.onCueMetadataChange(a.value)});var n=new $e(function(){var r=fT(e);r=v(r);for(var a=r.next();!a.done;a=r.next())a.value.mode="hidden"}).qc().U(.5);e.Hc.push(function(){n.stop()})}}function bm(e,t,n,r){t=v(t);for(var a=t.next();!a.done;a=t.next())if(a=a.value,a.data&&a.cueTime&&a.frames){var l=a.cueTime+n,f=r;f&&l>f&&(f=l);for(var c=v(a.frames),p=c.next();!p.done;p=c.next())Am(e,l,f,"org.id3",p.value);e.A&&e.A.onHlsTimedMetadata(a,l)}}function Am(e,t,n,r,a){t=new Map().set("startTime",t).set("endTime",n).set("metadataType",r).set("payload",a),e.dispatchEvent(yt("metadata",t))}function km(e,t){if(t&&t.kind=="chapters"){t.mode="hidden";var n=new $e(function(){t.mode="hidden"}).qc().U(.5);e.Hc.push(function(){n.stop()})}}function iT(e){function t(n){return n.video&&n.audio||n.video&&n.video.codecs.includes(",")}e.variants.some(t)&&(e.variants=e.variants.filter(t))}d.Mh=function(){for(var e=this.W;e.g;)e.release()};function Mm(e,t){return new hl(t,e.g.drm.updateExpirationTime)}function oT(e){return new ut(function(t,n,r){e.s&&e.s.segmentDownloaded(t,n,r)},function(t,n,r){if(n=new Map().set("headers",t).set("request",n).set("requestType",r),e.dispatchEvent(yt("downloadheadersreceived",n)),e.Y&&(n=e.Y,n.h.enabled)){if(r=t["cmsd-static"])try{var a=new Map,l=r.split(",");for(r=0;r=e.h.duration-1}break;case tn:e:if(e.h.ended||N0(e.G))t=!0;else{if(e.i.presentationTimeline.R()){n=e.i.presentationTimeline.Bb();var r=nc(e.h.buffered);if(r!=null&&r>=n){t=!0;break e}}t=!1}break;default:t=!1}r=w0(e.h.buffered,e.h.currentTime),n=e.K;var a=t,l=n.h.get(n.g);t=n.g,r=a||r>=l?ol:ur,n.g=r,t!=r&&Wc(e)}function aT(e,t,n,r){return new _0(e,t,n,r)}function lT(e){return new mm({getBandwidthEstimate:function(){return e.s?e.s.getBandwidthEstimate():NaN},pb:function(){return e.pb()},getCurrentTime:function(){return e.h?e.h.currentTime:0},Cd:function(){return e.Cd()},Ob:function(){return e.Ob()},Cb:function(){return e.Cb()},R:function(){return e.R()}},e.g.cmcd)}function uT(e){return new nm(e.i,{Dd:function(){return e.C?e.C.qd():0},getBandwidthEstimate:function(){return e.s.getBandwidthEstimate()},T:e.G,Tb:e.H,onError:function(t){return Oo(e,t)},onEvent:function(t){return e.dispatchEvent(t)},Fh:function(){e.F&&e.F.update&&e.F.update()},af:function(t,n){var r=t.startTime,a=t.endTime,l=n.type;e.C&&e.C.cg(),kr(e),r=new Map().set("start",r).set("end",a).set("contentType",l),e.dispatchEvent(yt("segmentappended",r)),e.s&&n.fastSwitching&&t.Zc&&t.Md&&e.s.trySuggestStreams()},Eh:function(t,n){(n=n.Ve)&&e.za&&uw(e.za,n,t)},Ef:function(t,n){var r=e.m;if(r.h.parseInbandPsshEnabled&&!r.F&&["audio","video"].includes(t)){n=new e0(Fe(n));var a=0,l=v(n.data);for(t=l.next();!t.done;t=l.next())a+=t.value.length;if(a==0)r=Promise.resolve();else{for(a=new Uint8Array(a),l=0,n=v(n.data),t=n.next();!t.done;t=n.next())t=t.value,a.set(t,l),l+=t.length;Rs(r,"cenc",a),r=r.l}}else r=Promise.resolve();return r},Gh:function(t,n,r){bm(e,t,n,r)},wd:function(t,n){return e.wd(t,n)}})}d.configure=function(e,t){arguments.length==2&&typeof e=="string"&&(e=Dc(e,t)),e.streaming&&"forceTransmuxTS"in e.streaming&&(ei("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource.mediaSource=e.streaming.forceTransmuxTS,delete e.streaming.forceTransmuxTS),e.streaming&&"forceTransmux"in e.streaming&&(ei("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),e.mediaSource.mediaSource=e.streaming.forceTransmux,delete e.streaming.forceTransmux),e.streaming&&e.streaming.lowLatencyMode&&(e.streaming.inaccurateManifestTolerance==null&&(e.streaming.inaccurateManifestTolerance=0),e.streaming.rebufferingGoal==null&&(e.streaming.rebufferingGoal=.01),e.streaming.segmentPrefetchLimit==null&&(e.streaming.segmentPrefetchLimit=2),e.streaming.retryParameters==null&&(e.streaming.retryParameters={}),e.streaming.retryParameters.baseDelay==null&&(e.streaming.retryParameters.baseDelay=100),e.manifest==null&&(e.manifest={}),e.manifest.retryParameters==null&&(e.manifest.retryParameters={}),e.manifest.retryParameters.baseDelay==null&&(e.manifest.retryParameters.baseDelay=100),e.drm==null&&(e.drm={}),e.drm.retryParameters==null&&(e.drm.retryParameters={}),e.drm.retryParameters.baseDelay==null&&(e.drm.retryParameters.baseDelay=100));var n=Ar(this.g,e,Mr(this));return _m(this),n};function _m(e){if(e.F){var t=Eo(e.g.manifest);e.h&&e.h.nodeName==="AUDIO"&&(t.disableVideo=!0),e.F.configure(t)}if(e.m&&e.m.configure(e.g.drm),e.j){e.j.configure(e.g.streaming);try{Um(e,e.i)}catch(l){Oo(e,l)}e.s&&Rr(e),t=e.j.j,!t||t.allowedByApplication&&t.allowedByKeySystem||_r(e)}if(e.H&&e.H.nf(e.g.streaming.forceHTTPS),e.G&&(e.G.configure(e.g.mediaSource),e.G.Y=e.g.manifest.segmentRelativeVttTiming,t=e.g.textDisplayFactory,e.Te!=t)){var n=t(),r=e.G,a=r.F;r.F=n,a&&(n.setTextVisibility(a.isTextVisible()),a.destroy()),r.h&&(r.h.j=n),e.Te=t,e.j&&(t=e.j,(n=t.i.get(Ye))&&Ir(t,n.stream,!0,0,!0))}e.s&&(e.s.configure(e.g.abr),e.g.abr.enabled?e.s.enable():e.s.disable(),Gm(e)),e.K&&(t=e.g.streaming.rebufferingGoal,e.i&&(t=Math.max(t,e.i.minBufferTime)),Bp(e.K,t,Math.min(.5,t/2))),e.i&&Yc(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.A&&e.A.configure(e.g.ads),e.V&&e.V.configure(e.g.cmcd),e.Y&&e.Y.configure(e.g.cmsd)}d.getConfiguration=function(){var e=Mr(this);return Ar(e,this.g,Mr(this)),e},d.Qg=function(){if(this.h){var e=this.h.buffered.length;e=e?this.h.buffered.end(e-1):0;var t=this.getConfiguration().streaming.bufferingGoal;if(t=Math.min(this.h.currentTime+t,this.Eb().end),e>=t)return 1;if(!(e<=this.h.currentTime)&&e=r.end&&t.ud():n<=r.start+a&&t.ud()}))},d.ud=function(){var e=this.I.ec();this.l==vn&&this.I.set(e),this.l==tn&&(this.I.set(e),this.s.playbackRateChanged(e),im(this.j,!1)),this.Ba.Za()},d.Cb=function(){if(this.i){for(var e=this.j?this.j.j:null,t=[],n=0,r=v(this.i.variants),a=r.next();!a.done;a=r.next())if(a=a.value,tl(a)){var l=ar(a);l.active=a==e,l.active||n==1||e==null||a.video!=e.video||a.audio!=e.audio||(l.active=!0),l.active&&n++,t.push(l)}return t}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map(function(f){return jf(f)}):[]},d.jc=function(){if(this.i){for(var e=this.j?this.j.o:null,t=[],n=v(this.i.textStreams),r=n.next();!r.done;r=n.next()){r=r.value;var a=el(r);a.active=r==e,t.push(a)}return t}return this.h&&this.h.src&&this.h.textTracks?Hs(this).map(function(l){return kp(l)}):[]},d.Wg=function(){var e=this.Oc;return this.i&&(e=this.i.imageStreams),e.map(function(t){return Uf(t)})},d.Ng=function(e){var t=this,n,r,a,l;return j(function(f){return f.g==1?t.l!=tn&&t.l!=vn?f.return(null):(n=t.Oc,t.i&&(n=t.i.imageStreams),(r=n.find(function(c){return c.id==e}))?r.segmentIndex?f.B(2):E(f,r.createSegmentIndex(),2):f.return(null)):f.g!=4?(a=[],yc(r.segmentIndex,function(c){var p=Lm(c.tilesLayout||r.tilesLayout);if(p){p=p.rows*p.Kb;for(var m=c.h-c.startTime,g=0;ge(l,t))&&(n=l);n?(e=ar(n),this.lf(e,!0,r)):_r(this)}else this.h&&this.h.audioTracks&&(r=bs(this.Cb(),e,t||"",!1)[0])&&this.lf(r)},d.kf=function(e,t,n){n=n===void 0?!1:n,this.i&&this.C?(this.lb=e,this.Kc=t||"",this.Jc=n,(e=bs(this.i.textStreams,this.lb,this.Kc,this.Jc)[0]||null)&&e!=this.j.o&&(Fc(this.u.h,e,!1),this.g.streaming.alwaysStreamText||this.Me())&&(bl(this.j,e),Ol(this))):(e=bs(this.jc(),e,t||"",n)[0])&&this.kg(e)},d.Wh=function(e,t,n){if(t=t===void 0?!0:t,n=n===void 0?0:n,this.i&&this.C){for(var r=null,a=v(this.i.variants),l=a.next();!l.done;l=a.next())if(l=l.value,l.audio.label==e){r=l;break}r!=null&&(this.kb=new lr(r.language,"",0,"",!1,"",e,"",this.g.mediaSource.codecSwitchingStrategy,this.g.manifest.dash.enableAudioGroups),_r(this,t,n))}else if(this.h&&this.h.audioTracks){for(n=Array.from(this.h.audioTracks),t=null,n=v(n),r=n.next();!r.done;r=n.next())r=r.value,r.label==e&&(t=r);t&&zm(this,t)}},d.Me=function(){var e=this.da;return this.G&&this.l==tn?this.G.F.isTextVisible():this.h&&this.h.src&&this.h.textTracks?Hs(this).some(function(t){return t.mode=="showing"}):e},d.Pf=function(){return this.h&&this.h.src&&this.h.textTracks?Nm(this).map(function(e){return kp(e)}):[]},d.Rg=function(e){if(!this.h||!this.h.src||!this.h.textTracks)return[];var t=Ze(e),n=Nm(this).filter(function(c){return Ze(c.language)==t});if(!n||!n.length)return[];e=[];var r=new Set;n=v(n);for(var a=n.next();!a.done;a=n.next())if((a=a.value)&&a.cues){a=v(a.cues);for(var l=a.next();!l.done;l=a.next()){var f=l.value;(l=f.id)&&l!=""||(l=f.startTime+"-"+f.endTime+"-"+f.text),f={id:l,title:f.text,startTime:f.startTime,endTime:f.endTime},r.has(l)||(e.push(f),r.add(l))}}return e};function Hs(e){return Array.from(e.h.textTracks).filter(function(t){return t.kind!="metadata"&&t.kind!="chapters"&&t.label!="Shaka Player TextTrack"})}function fT(e){return Array.from(e.h.textTracks).filter(function(t){return t.kind=="metadata"})}function Nm(e){return Array.from(e.h.textTracks).filter(function(t){return t.kind=="chapters"})}d.og=function(e){if(e=!!e,this.da!=e){if(this.da=e,this.l==tn)this.G.F.setTextVisibility(e),this.g.streaming.alwaysStreamText||(e?this.j.o||(e=bs(this.i.textStreams,this.lb,this.Kc,this.Jc),0n?f!=r&&e.xf(r):a&&l&&c-pn&&(n+=Math.pow(2,32)),n=n.toString(16)),new F(2,3,3016,t,n,e.h.error.message)}function Xm(e,t){if(e.j){var n=yt("keystatuschanged");e.dispatchEvent(n);var r=Object.keys(t);n=r.length==1&&r[0]=="00";var a=!1;if(r.length){r=v(e.i.variants);for(var l=r.next();!l.done;l=r.next()){l=l.value;var f=[];l.audio&&f.push(l.audio),l.video&&f.push(l.video),f=v(f);for(var c=f.next();!c.done;c=f.next()){var p=c.value;if(c=l.allowedByKeySystem,p.keyIds.size){l.allowedByKeySystem=!0,p=v(p.keyIds);for(var m=p.next();!m.done;m=p.next())m=m.value,((m=t[n?"00":m])||e.m.F)&&(l.allowedByKeySystem=l.allowedByKeySystem&&!!m&&!Qm.includes(m))}c!=l.allowedByKeySystem&&(a=!0)}}}if(a&&(bn(e),!Rr(e)))return;(t=e.j.j)&&!t.allowedByKeySystem&&_r(e)}}function Wm(e,t,n){e.F&&e.F.onExpirationUpdated&&e.F.onExpirationUpdated(t,n),t=yt("expirationupdated"),e.dispatchEvent(t)}function Yc(e,t,n){0e||!(o.MediaKeys&&o.navigator&&o.navigator.requestMediaKeySystemAccess&&o.MediaKeySystemAccess&&o.MediaKeySystemAccess.prototype.getConfiguration)?!1:mi()?!0:Is("application/x-mpegurl")},ue.setAdManagerFactory=function(e){Ul=e},ue.registerSupportPlugin=function(e,t){Qc[e]=t},ue.prototype.destroy=ue.prototype.destroy;var yi=0,qc=1,tn=2,vn=3;ue.LoadMode={DESTROYED:yi,NOT_LOADED:qc,MEDIA_SOURCE:tn,SRC_EQUALS:vn},ue.version="v4.7.11";var qm=["4","7"];Np=new function(e){this.g=e,this.i=V2,this.h=H2}(new Hf(Number(qm[0]),Number(qm[1])));var Qm=["output-restricted","internal-error"],Qc={},Ul=null;function Zm(){this.h=[],this.j=this.i=this.g=0}function Oe(e,t,n){var r=this;this.g=e,this.h=t,this.j=n,this.i=!1,this.l=this.h.getVolume(),this.m=new ft,this.m.D(this.h,google.ima.AdEvent.Type.PAUSED,function(){r.i=!0}),this.m.D(this.h,google.ima.AdEvent.Type.RESUMED,function(){r.i=!1})}d=Oe.prototype,d.getDuration=function(){return this.g.getDuration()},d.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()},d.getRemainingTime=function(){return this.h.getRemainingTime()},d.isPaused=function(){return this.i},d.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()},d.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},d.canSkipNow=function(){return this.h.getAdSkippableState()},d.skip=function(){return this.h.skip()},d.pause=function(){return this.h.pause()},d.play=function(){return this.h.resume()},d.getVolume=function(){return this.h.getVolume()},d.setVolume=function(e){return this.j.volume=e,this.h.setVolume(e)},d.isMuted=function(){return this.h.getVolume()==0},d.isLinear=function(){return this.g.isLinear()},d.resize=function(e,t){var n=!1,r=this.j;document.fullscreenEnabled?n=!!document.fullscreenElement:r.webkitSupportsFullscreen&&(n=r.webkitDisplayingFullscreen),this.h.resize(e,t,n?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)},d.setMuted=function(e){(this.j.muted=e)?(this.l=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.l)},d.getSequenceLength=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getTotalAds()},d.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getAdPosition()},d.getTitle=function(){return this.g.getTitle()},d.getDescription=function(){return this.g.getDescription()},d.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()},d.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},d.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},d.getAdId=function(){return this.g.getAdId()},d.getCreativeAdId=function(){return this.g.getCreativeAdId()},d.getAdvertiserName=function(){return this.g.getAdvertiserName()},d.getMediaUrl=function(){return this.g.getMediaUrl()},d.getTimeOffset=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getTimeOffset()},d.getPodIndex=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getPodIndex()},d.release=function(){this.h=this.g=null},he("shaka.ads.ClientSideAd",Oe),Oe.prototype.release=Oe.prototype.release,Oe.prototype.getPodIndex=Oe.prototype.getPodIndex,Oe.prototype.getTimeOffset=Oe.prototype.getTimeOffset,Oe.prototype.getMediaUrl=Oe.prototype.getMediaUrl,Oe.prototype.getAdvertiserName=Oe.prototype.getAdvertiserName,Oe.prototype.getCreativeAdId=Oe.prototype.getCreativeAdId,Oe.prototype.getAdId=Oe.prototype.getAdId,Oe.prototype.getVastMediaWidth=Oe.prototype.getVastMediaWidth,Oe.prototype.getVastMediaHeight=Oe.prototype.getVastMediaHeight,Oe.prototype.getVastMediaBitrate=Oe.prototype.getVastMediaBitrate,Oe.prototype.getDescription=Oe.prototype.getDescription,Oe.prototype.getTitle=Oe.prototype.getTitle,Oe.prototype.getPositionInSequence=Oe.prototype.getPositionInSequence,Oe.prototype.getSequenceLength=Oe.prototype.getSequenceLength,Oe.prototype.setMuted=Oe.prototype.setMuted,Oe.prototype.resize=Oe.prototype.resize,Oe.prototype.isLinear=Oe.prototype.isLinear,Oe.prototype.isMuted=Oe.prototype.isMuted,Oe.prototype.setVolume=Oe.prototype.setVolume,Oe.prototype.getVolume=Oe.prototype.getVolume,Oe.prototype.play=Oe.prototype.play,Oe.prototype.pause=Oe.prototype.pause,Oe.prototype.skip=Oe.prototype.skip,Oe.prototype.canSkipNow=Oe.prototype.canSkipNow,Oe.prototype.getTimeUntilSkippable=Oe.prototype.getTimeUntilSkippable,Oe.prototype.isSkippable=Oe.prototype.isSkippable,Oe.prototype.isPaused=Oe.prototype.isPaused,Oe.prototype.getRemainingTime=Oe.prototype.getRemainingTime,Oe.prototype.getMinSuggestedDuration=Oe.prototype.getMinSuggestedDuration,Oe.prototype.getDuration=Oe.prototype.getDuration;function Bl(e,t,n,r,a){var l=this;this.o=e,this.i=t,this.A=!1,this.s=this.C=null,this.F=NaN,this.m=a,this.j=null,this.h=new ft,google.ima.settings.setLocale(n),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),e=new google.ima.AdDisplayContainer(this.o,this.i),e.initialize(),this.l=new google.ima.AdsLoader(e),this.l.getSettings().setPlayerType("shaka-player"),this.l.getSettings().setPlayerVersion("v4.7.11"),this.g=null,this.u=r||new google.ima.AdsRenderingSettings,this.h.D(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(f){gT(l,f)}),this.h.D(this.l,google.ima.AdErrorEvent.Type.AD_ERROR,function(f){Jm(l,f)}),this.h.D(this.i,"ended",function(){l.l.contentComplete()}),this.h.ja(this.i,"play",function(){l.A=!0})}Bl.prototype.configure=function(e){this.C=e},Bl.prototype.stop=function(){this.g&&this.g.stop(),this.o&&Fs(this.o)},Bl.prototype.release=function(){this.stop(),this.s&&this.s.disconnect(),this.h&&this.h.release(),this.g&&this.g.destroy(),this.l.destroy()};function Jm(e,t){t.getError(),t=new Map().set("originalEvent",t),e.m(new Ne("ad-error",t)),Fl(e,null),e.m(new Ne("ad-cue-points-changed",new Map().set("cuepoints",[])))}function gT(e,t){if(e.m(new Ne("ads-loaded",new Map().set("loadTime",Date.now()/1e3-e.F))),e.C.customPlayheadTracker){var n={currentTime:e.i.currentTime};e.g=t.getAdsManager(n,e.u),e.i.muted?e.g.setVolume(0):e.g.setVolume(e.i.volume),e.h.D(e.i,"timeupdate",function(){e.i.duration&&(n.currentTime=e.i.currentTime)}),e.h.D(e.i,"volumechange",function(){e.j&&(e.j.setVolume(e.i.volume),e.i.muted&&e.j.setMuted(!0))})}else e.g=t.getAdsManager(e.i,e.u);e.m(new Ne("ima-ad-manager-loaded",new Map().set("imaAdManager",e.g)));var r=e.g.getCuePoints();if(r.length){t=[],r=v(r);for(var a=r.next();!a.done;a=r.next())t.push({start:a.value,end:null});e.m(new Ne("ad-cue-points-changed",new Map().set("cuepoints",t)))}yT(e);try{e.g.init(e.i.offsetWidth,e.i.offsetHeight,jl(e)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),e.h.D(e.i,"loadeddata",function(){e.g.resize(e.i.offsetWidth,e.i.offsetHeight,jl(e)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),"ResizeObserver"in o?(e.s=new ResizeObserver(function(){e.g.resize(e.i.offsetWidth,e.i.offsetHeight,jl(e)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),e.s.observe(e.i)):e.h.D(document,"fullscreenchange",function(){e.g.resize(e.i.offsetWidth,e.i.offsetHeight,jl(e)?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),e.A?e.g.start():e.h.ja(e.i,"play",function(){e.A=!0,e.g.start()})}catch{Fl(e,null)}}function jl(e){return document.fullscreenEnabled?!!document.fullscreenElement:(e=e.i,e.webkitSupportsFullscreen?e.webkitDisplayingFullscreen:!1)}function yT(e){function t(n,r){n=new Map().set("originalEvent",n),e.m(new Ne(r,n))}e.h.D(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,function(n){Jm(e,n)}),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(n){eg(e,n)}),e.h.D(e.g,google.ima.AdEvent.Type.STARTED,function(n){eg(e,n)}),e.h.D(e.g,google.ima.AdEvent.Type.FIRST_QUARTILE,function(n){t(n,"ad-first-quartile")}),e.h.D(e.g,google.ima.AdEvent.Type.MIDPOINT,function(n){t(n,"ad-midpoint")}),e.h.D(e.g,google.ima.AdEvent.Type.THIRD_QUARTILE,function(n){t(n,"ad-third-quartile")}),e.h.D(e.g,google.ima.AdEvent.Type.COMPLETE,function(n){t(n,"ad-complete")}),e.h.D(e.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(n){Fl(e,n)}),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(n){Fl(e,n)}),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPED,function(n){t(n,"ad-skipped")}),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_CHANGED,function(n){t(n,"ad-volume-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.VOLUME_MUTED,function(n){t(n,"ad-muted")}),e.h.D(e.g,google.ima.AdEvent.Type.PAUSED,function(n){e.j&&(e.j.i=!0,t(n,"ad-paused"))}),e.h.D(e.g,google.ima.AdEvent.Type.RESUMED,function(n){e.j&&(e.j.i=!1,t(n,"ad-resumed"))}),e.h.D(e.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,function(n){e.j&&t(n,"ad-skip-state-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.CLICK,function(n){t(n,"ad-clicked")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_PROGRESS,function(n){t(n,"ad-progress")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_BUFFERING,function(n){t(n,"ad-buffering")}),e.h.D(e.g,google.ima.AdEvent.Type.IMPRESSION,function(n){t(n,"ad-impression")}),e.h.D(e.g,google.ima.AdEvent.Type.DURATION_CHANGE,function(n){t(n,"ad-duration-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.USER_CLOSE,function(n){t(n,"ad-closed")}),e.h.D(e.g,google.ima.AdEvent.Type.LOADED,function(n){t(n,"ad-loaded")}),e.h.D(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(n){t(n,"all-ads-completed")}),e.h.D(e.g,google.ima.AdEvent.Type.LINEAR_CHANGED,function(n){t(n,"ad-linear-changed")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_METADATA,function(n){t(n,"ad-metadata")}),e.h.D(e.g,google.ima.AdEvent.Type.LOG,function(n){t(n,"ad-recoverable-error")}),e.h.D(e.g,google.ima.AdEvent.Type.AD_BREAK_READY,function(n){t(n,"ad-break-ready")}),e.h.D(e.g,google.ima.AdEvent.Type.INTERACTION,function(n){t(n,"ad-interaction")})}function eg(e,t){var n=t.getAd();n?(e.j=new Oe(n,e.g,e.i),t=new Map().set("ad",e.j).set("sdkAdObject",n).set("originalEvent",t),e.m(new Ne("ad-started",t)),e.j.isLinear()&&(e.o.setAttribute("ad-active","true"),e.i.pause(),e.i.muted?(t=e.j,t.l=e.i.volume,t.h.setVolume(0)):e.j.setVolume(e.i.volume))):Ge("The IMA SDK fired a "+t.type+" event with no associated ad. Unable to play ad!")}function Fl(e,t){e.m(new Ne("ad-stopped",new Map().set("originalEvent",t))),e.j&&e.j.isLinear()&&(e.o.removeAttribute("ad-active"),e.i.ended||e.i.play())}function De(e,t,n,r,a){this.h=e,this.g=a,this.i=t,this.j=n,this.l=r}d=De.prototype,d.getDuration=function(){return this.h.durationInSeconds},d.getMinSuggestedDuration=function(){return this.getDuration()},d.getRemainingTime=function(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime},d.isPaused=function(){return this.g.paused},d.isSkippable=function(){return!!this.h.skipOffset},d.getTimeUntilSkippable=function(){if(!this.h.skipOffset)return this.getRemainingTime();var e=this.getRemainingTime()-this.h.skipOffset;return Math.max(e,0)},d.canSkipNow=function(){return this.getTimeUntilSkippable()==0},d.skip=function(){this.g.currentTime+=this.getRemainingTime()},d.pause=function(){return this.g.pause()},d.play=function(){return this.g.play()},d.getVolume=function(){return this.g.volume},d.setVolume=function(e){this.g.volume=e},d.isMuted=function(){return this.g.muted},d.isLinear=function(){return this.l},d.resize=function(){},d.setMuted=function(e){this.g.muted=e},d.getSequenceLength=function(){return this.j?this.j:1},d.getPositionInSequence=function(){return this.i?this.i:1},d.getTitle=function(){return this.h.adTitle},d.getDescription=function(){return""},d.getVastMediaBitrate=function(){return 0},d.getVastMediaHeight=function(){return 0},d.getVastMediaWidth=function(){return 0},d.getAdId=function(){return this.h.adId},d.getCreativeAdId=function(){return this.h.creativeId},d.getAdvertiserName=function(){return""},d.getMediaUrl=function(){return null},d.getTimeOffset=function(){return 0},d.getPodIndex=function(){return 0},d.release=function(){this.j=this.i=this.g=this.h=null},he("shaka.ads.MediaTailorAd",De),De.prototype.release=De.prototype.release,De.prototype.getPodIndex=De.prototype.getPodIndex,De.prototype.getTimeOffset=De.prototype.getTimeOffset,De.prototype.getMediaUrl=De.prototype.getMediaUrl,De.prototype.getAdvertiserName=De.prototype.getAdvertiserName,De.prototype.getCreativeAdId=De.prototype.getCreativeAdId,De.prototype.getAdId=De.prototype.getAdId,De.prototype.getVastMediaWidth=De.prototype.getVastMediaWidth,De.prototype.getVastMediaHeight=De.prototype.getVastMediaHeight,De.prototype.getVastMediaBitrate=De.prototype.getVastMediaBitrate,De.prototype.getDescription=De.prototype.getDescription,De.prototype.getTitle=De.prototype.getTitle,De.prototype.getPositionInSequence=De.prototype.getPositionInSequence,De.prototype.getSequenceLength=De.prototype.getSequenceLength,De.prototype.setMuted=De.prototype.setMuted,De.prototype.resize=De.prototype.resize,De.prototype.isLinear=De.prototype.isLinear,De.prototype.isMuted=De.prototype.isMuted,De.prototype.setVolume=De.prototype.setVolume,De.prototype.getVolume=De.prototype.getVolume,De.prototype.play=De.prototype.play,De.prototype.pause=De.prototype.pause,De.prototype.skip=De.prototype.skip,De.prototype.canSkipNow=De.prototype.canSkipNow,De.prototype.getTimeUntilSkippable=De.prototype.getTimeUntilSkippable,De.prototype.isSkippable=De.prototype.isSkippable,De.prototype.isPaused=De.prototype.isPaused,De.prototype.getRemainingTime=De.prototype.getRemainingTime,De.prototype.getMinSuggestedDuration=De.prototype.getMinSuggestedDuration,De.prototype.getDuration=De.prototype.getDuration;function Xs(e,t,n,r){this.A=e,this.I=t,this.g=n,this.l=null,this.W=NaN,this.i=r,this.H=!1,this.u=null,this.j=[],this.K=[],this.J=this.C=this.h=null,this.F=new Map,this.m=[],this.s=[],this.N="",this.V=!0,this.G="",this.o=new ft}Xs.prototype.stop=function(){for(var e=v(this.m),t=e.next();!t.done;t=e.next())t=t.value,this.o.Vb(t.target,t.type,t.listener);Nr(this),this.m=[],this.s=[],this.N="",this.V=!0,this.G="",this.u=null,this.j=[],this.K=[],this.F.clear()},Xs.prototype.release=function(){this.stop(),this.o&&this.o.release()},Xs.prototype.onManifestUpdated=function(e){this.H=e,this.N!=""&&(xT(this,this.N,this.V),this.V=!1)},Xs.prototype.getCuePoints=function(){for(var e=[],t=v(this.j),n=t.next();!n.done;n=t.next()){n=v(n.value.ads);for(var r=n.next();!r.done;r=n.next())r=r.value,e.push({start:r.startTimeInSeconds,end:r.startTimeInSeconds+r.durationInSeconds})}return e};function vT(e,t,n){var r,a,l,f,c,p,m,g,S,T,w;j(function(A){if(A.g==1)return r=Ft([t],Ci()),r.method="POST",n&&(a=JSON.stringify(n),r.body=Oi(a)),l=e.I.request(7,r),Q(A,2),E(A,l.promise,4);if(A.g!=2){if(f=A.h,c=mt(f.data),p=JSON.parse(c),p.manifestUrl&&p.trackingUrl)m=new It(t),g=new It(p.trackingUrl),e.N=m.resolve(g).toString(),S=Date.now()/1e3,T=S-e.W,e.i(new Ne("ads-loaded",new Map().set("loadTime",T))),w=new It(p.manifestUrl),e.l.resolve(m.resolve(w).toString()),e.l=null;else throw Error("Insufficient data from MediaTailor.");return ae(A,0)}if(q(A),!e.G.length)return e.l.reject("MediaTailor request returned an error and there was no backup asset uri provided."),e.l=null,A.return();e.l.resolve(e.G),e.l=null,H(A)})}function xT(e,t,n){var r,a,l,f,c,p,m,g,S,T,w,A,M,R,D;j(function(_){if(_.g==1)return r=Ft([t],Ci()),a=e.I.request(7,r),Q(_,2),E(_,a.promise,4);if(_.g!=2){if(l=_.h,f=[],c=mt(l.data),p=JSON.parse(c),0r.startTimeInSeconds+r.durationInSeconds){r=c,n=l;break}}n&&r&&!e.K.includes(r.adId)&&(e.u=t,e.g.currentTime=n.startTimeInSeconds)}}function ig(e){if(e.g.duration&&(e.h||e.j.length)){var t=e.g.currentTime,n=!1;if(e.h){n=!0;var r=e.C,a=r.startTimeInSeconds+.5*r.durationInSeconds,l=r.startTimeInSeconds+.75*r.durationInSeconds;t>=r.startTimeInSeconds+.25*r.durationInSeconds&&!e.s.includes("firstQuartile")?(e.s.push("firstQuartile"),xn(e,"firstQuartile")):t>=a&&!e.s.includes("midpoint")?(e.s.push("midpoint"),xn(e,"midpoint")):t>=l&&!e.s.includes("thirdQuartile")&&(e.s.push("thirdQuartile"),xn(e,"thirdQuartile")),r=e.h.getRemainingTime(),a=e.h.getDuration(),0=r||r>a)&&Nr(e)}if(!e.h||!e.h.isLinear()){e:for(r=v(e.j),a=r.next();!a.done&&(a=a.value,!(e.h&&e.h.isLinear()));a=r.next())for(l=0;lt){if(e.K.includes(f.adId)){if(e.g.ended)continue;e.g.currentTime=c;break e}Nr(e),e.J=a,e.h=new De(f,l+1,a.ads.length,!0,e.g),e.C=f,l===0&&xn(e,"breakStart"),og(e);break}}if(!e.h){for(r=v(e.j),a=r.next();!a.done&&(a=a.value,!e.h);a=r.next())for(l=0;lt&&(e.g.currentTime=e.u),e.u=null)}}}function Nr(e){if(e.h){for(;e.A.lastChild;)e.A.removeChild(e.A.firstChild);e.H||e.K.push(e.C.adId),xn(e,"complete");for(var t=v(e.m),n=t.next();!n.done;n=t.next())n=n.value,e.o.Vb(n.target,n.type,n.listener);e.m=[],e.s=[],t=e.h.getPositionInSequence(),n=e.h.getSequenceLength(),t===n&&xn(e,"breakEnd"),e.h=null,e.C=null,e.J=null}}function og(e){var t=!1;e.g.paused?t=!0:(xn(e,"impression"),xn(e,"start")),e.m.push({target:e.g,type:"volumechange",listener:function(){e.g.muted&&xn(e,"mute")}}),e.m.push({target:e.g,type:"volumechange",listener:function(){e.g.muted||xn(e,"unmute")}}),e.m.push({target:e.g,type:"play",listener:function(){t?(xn(e,"impression"),xn(e,"start"),t=!1):xn(e,"resume")}}),e.m.push({target:e.g,type:"pause",listener:function(){xn(e,"pause")}});for(var n=v(e.m),r=n.next();!r.done;r=n.next())r=r.value,e.o.D(r.target,r.type,r.listener)}function xn(e,t){var n=e.C.trackingEvents.find(function(a){return a.eventType==t});if(n||(n=e.J.adBreakTrackingEvents.find(function(a){return a.eventType==t})),n){n=v(n.beaconUrls);for(var r=n.next();!r.done;r=n.next())(r=r.value)&&r!=""&&(r=Ft([r],Ci()),r.method="POST",e.I.request(7,r))}switch(t){case"impression":e.i(new Ne("ad-impression"));break;case"start":e.i(new Ne("ad-started",new Map().set("ad",e.h)));break;case"mute":e.i(new Ne("ad-muted"));break;case"unmute":e.i(new Ne("ad-volume-changed"));break;case"resume":e.i(new Ne("ad-resumed"));break;case"pause":e.i(new Ne("ad-paused"));break;case"firstQuartile":e.i(new Ne("ad-first-quartile"));break;case"midpoint":e.i(new Ne("ad-midpoint"));break;case"thirdQuartile":e.i(new Ne("ad-third-quartile"));break;case"complete":e.i(new Ne("ad-complete")),e.i(new Ne("ad-stopped"));break;case"breakStart":e.A.setAttribute("ad-active","true");break;case"breakEnd":e.A.removeAttribute("ad-active")}}function Ue(e,t){this.g=e,this.i=null,this.h=t}d=Ue.prototype,d.getDuration=function(){return this.i?this.i.duration:-1},d.getMinSuggestedDuration=function(){return this.getDuration()},d.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1},d.isPaused=function(){return this.h.paused},d.isSkippable=function(){return this.g.isSkippable()},d.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},d.canSkipNow=function(){return this.getTimeUntilSkippable()==0},d.skip=function(){this.h.currentTime+=this.getRemainingTime()},d.pause=function(){return this.h.pause()},d.play=function(){return this.h.play()},d.getVolume=function(){return this.h.volume},d.setVolume=function(e){this.h.volume=e},d.isMuted=function(){return this.h.muted},d.isLinear=function(){return!0},d.resize=function(){},d.setMuted=function(e){this.h.muted=e},d.getSequenceLength=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getTotalAds()},d.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getAdPosition()},d.getTitle=function(){return this.g.getTitle()},d.getDescription=function(){return this.g.getDescription()},d.getVastMediaBitrate=function(){return 0},d.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},d.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},d.getAdId=function(){return this.g.getAdId()},d.getCreativeAdId=function(){return this.g.getCreativeAdId()},d.getAdvertiserName=function(){return this.g.getAdvertiserName()},d.getMediaUrl=function(){return null},d.getTimeOffset=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getTimeOffset()},d.getPodIndex=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getPodIndex()},d.release=function(){this.h=this.i=this.g=null},he("shaka.ads.ServerSideAd",Ue),Ue.prototype.release=Ue.prototype.release,Ue.prototype.getPodIndex=Ue.prototype.getPodIndex,Ue.prototype.getTimeOffset=Ue.prototype.getTimeOffset,Ue.prototype.getMediaUrl=Ue.prototype.getMediaUrl,Ue.prototype.getAdvertiserName=Ue.prototype.getAdvertiserName,Ue.prototype.getCreativeAdId=Ue.prototype.getCreativeAdId,Ue.prototype.getAdId=Ue.prototype.getAdId,Ue.prototype.getVastMediaWidth=Ue.prototype.getVastMediaWidth,Ue.prototype.getVastMediaHeight=Ue.prototype.getVastMediaHeight,Ue.prototype.getVastMediaBitrate=Ue.prototype.getVastMediaBitrate,Ue.prototype.getDescription=Ue.prototype.getDescription,Ue.prototype.getTitle=Ue.prototype.getTitle,Ue.prototype.getPositionInSequence=Ue.prototype.getPositionInSequence,Ue.prototype.getSequenceLength=Ue.prototype.getSequenceLength,Ue.prototype.setMuted=Ue.prototype.setMuted,Ue.prototype.resize=Ue.prototype.resize,Ue.prototype.isLinear=Ue.prototype.isLinear,Ue.prototype.isMuted=Ue.prototype.isMuted,Ue.prototype.setVolume=Ue.prototype.setVolume,Ue.prototype.getVolume=Ue.prototype.getVolume,Ue.prototype.play=Ue.prototype.play,Ue.prototype.pause=Ue.prototype.pause,Ue.prototype.skip=Ue.prototype.skip,Ue.prototype.canSkipNow=Ue.prototype.canSkipNow,Ue.prototype.getTimeUntilSkippable=Ue.prototype.getTimeUntilSkippable,Ue.prototype.isSkippable=Ue.prototype.isSkippable,Ue.prototype.isPaused=Ue.prototype.isPaused,Ue.prototype.getRemainingTime=Ue.prototype.getRemainingTime,Ue.prototype.getMinSuggestedDuration=Ue.prototype.getMinSuggestedDuration,Ue.prototype.getDuration=Ue.prototype.getDuration;function rg(e,t,n,r){var a=this;this.s=e,this.l=t,this.j=null,this.F=NaN,this.i=r,this.G=!1,this.u=this.m=this.o=null,this.A="",this.C=[],this.h=new ft,e=new google.ima.dai.api.UiSettings,e.setLocale(n),this.g=new google.ima.dai.api.StreamManager(this.l,this.s,e),this.i(new Ne("ima-stream-manager-loaded",new Map().set("imaStreamManager",this.g))),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,function(l){TT(a,l)}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,function(){a.A.length?a.j.resolve(a.A):a.j.reject("IMA Stream request returned an error and there was no backup asset uri provided."),a.j=null}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,function(){}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,function(l){l=l.getAd(),a.m=new Ue(l,a.l),a.u&&(a.m.i=a.u),a.i(new Ne("ad-started",new Map().set("ad",a.m))),a.s.setAttribute("ad-active","true")}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,function(){a.s.removeAttribute("ad-active");var l=a.l.currentTime;a.o&&a.o>l&&(a.l.currentTime=a.o,a.o=null)}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(l){a.u=l.getStreamData().adProgressData,a.m&&(a.m.i=a.u)}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){a.i(new Ne("ad-first-quartile"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){a.i(new Ne("ad-midpoint"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){a.i(new Ne("ad-third-quartile"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){a.i(new Ne("ad-complete")),a.i(new Ne("ad-stopped")),a.s.removeAttribute("ad-active"),a.m=null}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){a.i(new Ne("ad-skipped")),a.i(new Ne("ad-stopped"))}),this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(l){var f=l.getStreamData();l=[],f=v(f.cuepoints);for(var c=f.next();!c.done;c=f.next())c=c.value,l.push({start:c.start,end:c.end});a.C=l,a.i(new Ne("ad-cue-points-changed",new Map().set("cuepoints",l)))})}d=rg.prototype,d.configure=function(){},d.stop=function(){this.A="",this.o=null,this.C=[]},d.release=function(){this.stop(),this.h&&this.h.release()},d.onCueMetadataChange=function(e){if(e.key&&e.data){var t={};t[e.key]=e.data,this.g.onTimedMetadata(t)}},d.getCuePoints=function(){return this.C};function TT(e,t){e.i(new Ne("ads-loaded",new Map().set("loadTime",Date.now()/1e3-e.F))),t=t.getStreamData().url,e.j.resolve(t),e.j=null,e.G||e.h.D(e.l,"seeked",function(){var n=e.l.currentTime;if(n!=0){e.g.streamTimeForContentTime(n);var r=e.g.previousCuePointForStreamTime(n);r&&!r.played&&(e.o=n,e.l.currentTime=r.start)}})}function Re(){Je.call(this),this.g=this.i=this.h=null,this.j=new Zm,this.m=navigator.language,this.l=null}le(Re,Je),d=Re.prototype,d.setLocale=function(e){this.m=e},d.configure=function(e){this.l=e,this.h&&this.h.configure(this.l),this.g&&this.g.configure(this.l)},d.initClientSide=function(e,t,n){var r=this;if(!o.google||!google.ima||!google.ima.AdsLoader)throw new F(2,10,1e4);this.h&&this.h.release(),this.h=new Bl(e,t,this.m,n,function(a){return Zc(r,a)}),this.h.configure(this.l)},d.release=function(){this.h&&(this.h.release(),this.h=null),this.i&&(this.i.release(),this.i=null),this.g&&(this.g.release(),this.g=null),Je.prototype.release.call(this)},d.onAssetUnload=function(){this.h&&this.h.stop(),this.i&&this.i.stop(),this.g&&this.g.stop(),this.dispatchEvent(new Ne("ad-stopped")),this.j=new Zm},d.requestClientSideAds=function(e){if(!this.h)throw new F(1,10,10001);var t=this.h;t.g&&t.g.destroy(),t.l&&t.l.contentComplete(),t.F=Date.now()/1e3,t.l.requestAds(e)},d.updateClientSideAdsRenderingSettings=function(e){if(!this.h)throw new F(1,10,10001);var t=this.h;t.u=e,t.g&&t.g.updateAdsRenderingSettings(t.u)},d.initMediaTailor=function(e,t,n){var r=this;this.i&&this.i.release(),this.i=new Xs(e,t,n,function(a){return Zc(r,a)})},d.requestMediaTailorStream=function(e,t,n){if(!this.i)throw new F(1,10,10005);var r=this.i;return n=n===void 0?"":n,r.l?e=Promise.reject(new F(1,10,10004)):(r.l=new pt,vT(r,e,t),r.G=n||"",r.W=Date.now()/1e3,e=r.l),e},d.initServerSide=function(e,t){var n=this;if(!o.google||!google.ima||!google.ima.dai)throw new F(2,10,10002);this.g&&this.g.release(),this.g=new rg(e,t,this.m,function(r){return Zc(n,r)}),this.g.configure(this.l)},d.requestServerSideStream=function(e,t){if(t=t===void 0?"":t,!this.g)throw new F(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;return(n.mpt||n.mpv)&&Ge('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.adTagParameters.mpt="shaka-player",e.adTagParameters.mpv="v4.7.11",n=this.g,n.j?e=Promise.reject(new F(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.G=!0),n.j=new pt,n.g.requestStream(e),n.A=t||"",n.F=Date.now()/1e3,e=n.j),e},d.replaceServerSideAdTagParameters=function(e){if(!this.g)throw new F(1,10,10003);(e.mpt||e.mpv)&&Ge('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.'),e.mpt="Shaka Player",e.mpv="v4.7.11",this.g.g.replaceAdTagParameters(e)},d.getServerSideCuePoints=function(){return ei("AdManager.getServerSideCuePoints","Please use getCuePoints function."),this.getCuePoints()},d.getCuePoints=function(){var e=[];return this.g&&(e=e.concat(this.g.getCuePoints())),this.i&&(e=e.concat(this.i.getCuePoints())),e},d.getStats=function(){var e=this.j;return{loadTimes:e.h,started:e.g,playedCompletely:e.i,skipped:e.j}},d.onManifestUpdated=function(e){this.i&&this.i.onManifestUpdated(e)},d.onDashTimedMetadata=function(e){if(this.g&&e.schemeIdUri=="urn:google:dai:2018"){var t=e.schemeIdUri,n=e.eventElement?e.eventElement.getAttribute("messageData"):null;this.g.g.processMetadata(t,n,e.startTime)}},d.onHlsTimedMetadata=function(e,t){this.g&&this.g.g.processMetadata("ID3",e.data,t)},d.onCueMetadataChange=function(e){this.g&&this.g.onCueMetadataChange(e)};function Zc(e,t){if(t&&t.type)switch(t.type){case"ads-loaded":e.j.h.push(t.loadTime);break;case"ad-started":e.j.g++;break;case"ad-complete":e.j.i++;break;case"ad-skipped":e.j.j++}e.dispatchEvent(t)}he("shaka.ads.AdManager",Re),Re.prototype.onCueMetadataChange=Re.prototype.onCueMetadataChange,Re.prototype.onHlsTimedMetadata=Re.prototype.onHlsTimedMetadata,Re.prototype.onDashTimedMetadata=Re.prototype.onDashTimedMetadata,Re.prototype.onManifestUpdated=Re.prototype.onManifestUpdated,Re.prototype.getStats=Re.prototype.getStats,Re.prototype.getCuePoints=Re.prototype.getCuePoints,Re.prototype.getServerSideCuePoints=Re.prototype.getServerSideCuePoints,Re.prototype.replaceServerSideAdTagParameters=Re.prototype.replaceServerSideAdTagParameters,Re.prototype.requestServerSideStream=Re.prototype.requestServerSideStream,Re.prototype.initServerSide=Re.prototype.initServerSide,Re.prototype.requestMediaTailorStream=Re.prototype.requestMediaTailorStream,Re.prototype.initMediaTailor=Re.prototype.initMediaTailor,Re.prototype.updateClientSideAdsRenderingSettings=Re.prototype.updateClientSideAdsRenderingSettings,Re.prototype.requestClientSideAds=Re.prototype.requestClientSideAds,Re.prototype.onAssetUnload=Re.prototype.onAssetUnload,Re.prototype.release=Re.prototype.release,Re.prototype.initClientSide=Re.prototype.initClientSide,Re.prototype.configure=Re.prototype.configure,Re.prototype.setLocale=Re.prototype.setLocale,Re.ADS_LOADED="ads-loaded",Re.AD_STARTED="ad-started",Re.AD_FIRST_QUARTILE="ad-first-quartile",Re.AD_MIDPOINT="ad-midpoint",Re.AD_THIRD_QUARTILE="ad-third-quartile",Re.AD_COMPLETE="ad-complete",Re.AD_STOPPED="ad-stopped",Re.AD_SKIPPED="ad-skipped",Re.AD_VOLUME_CHANGED="ad-volume-changed",Re.AD_MUTED="ad-muted",Re.AD_PAUSED="ad-paused",Re.AD_RESUMED="ad-resumed",Re.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",Re.CUEPOINTS_CHANGED="ad-cue-points-changed",Re.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",Re.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded",Re.AD_CLICKED="ad-clicked",Re.AD_PROGRESS="ad-progress",Re.AD_BUFFERING="ad-buffering",Re.AD_IMPRESSION="ad-impression",Re.AD_DURATION_CHANGED="ad-duration-changed",Re.AD_CLOSED="ad-closed",Re.AD_LOADED="ad-loaded",Re.ALL_ADS_COMPLETED="all-ads-completed",Re.AD_LINEAR_CHANGED="ad-linear-changed",Re.AD_METADATA="ad-metadata",Re.AD_RECOVERABLE_ERROR="ad-recoverable-error",Re.AD_ERROR="ad-error",Re.AD_BREAK_READY="ad-break-ready",Re.AD_INTERACTION="ad-interaction",Ul=function(){return new Re};function sg(e){return JSON.stringify(e,function(t,n){if(typeof n!="function"){if(n instanceof Event||n instanceof Ne){var r={};for(a in n)(t=n[a])&&typeof t=="object"?a=="detail"&&(r[a]=t):a in Event||(r[a]=t);return r}if(n instanceof Error){var a=new Set(["name","message","stack"]);for(r in n)a.add(r);for(t=v(Object.getOwnPropertyNames(n)),r=t.next();!r.done;r=t.next())a.add(r.value);for(t={},a=v(a),r=a.next();!r.done;r=a.next())r=r.value,t[r]=n[r];n={__type__:"Error",contents:t}}else if(n instanceof TimeRanges){for(a={__type__:"TimeRanges",length:n.length,start:[],end:[]},n=v(ro(n)),r=n.next();!r.done;r=n.next())r=r.value,t=r.end,a.start.push(r.start),a.end.push(t);n=a}else n=n instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(n)}:typeof n=="number"?isNaN(n)?"NaN":isFinite(n)?n:0>n?"-Infinity":"Infinity":n;return n}})}function Jc(e){return JSON.parse(e,function(t,n){if(n=="NaN")var r=NaN;else if(n=="-Infinity")r=-1/0;else if(n=="Infinity")r=1/0;else if(n&&typeof n=="object"&&n.__type__=="TimeRanges")r=CT(n);else if(n&&typeof n=="object"&&n.__type__=="Uint8Array")r=new Uint8Array(n.entries);else if(n&&typeof n=="object"&&n.__type__=="Error"){t=n.contents,n=Error(t.message);for(r in t)n[r]=t[r];r=n}else r=n;return r})}function CT(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}var ag="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),IT="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),ed=["loop","playbackRate"],ET=["pause","play"],zl={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferFullness:1,getBufferedInfo:2,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getImageTracks:2,getThumbnails:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10,getManifestType:10},Vl={getConfiguration:4,getStats:5,getTextTracks:2,getVariantTracks:2},td={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},lg=[["getConfiguration","configure"]],ug=[["isTextTrackVisible","setTextTrackVisibility"]],bT="addChaptersTrack addTextTrackAsync addThumbnailsTrack cancelTrickPlay configure getChapters getChaptersTracks resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay updateStartTime goToLive".split(" "),AT=["attach","attachCanvas","detach","load","unload"];function nd(e,t,n,r,a,l,f){var c=this;this.G=e,this.K=f,this.j=new $e(t),this.N=n,this.u=!1,this.s=r,this.F=a,this.I=l,this.h=this.m=!1,this.J="",this.o=null,this.A=function(){return od(c)},this.C=function(p,m){switch(p=Jc(m),p.type){case"event":var g=p.targetName,S=Hp(p.event);c.s(g,S);break;case"update":g=p.update;for(S in g){p=c.g[S]||{};for(var T in g[S])p[T]=g[S][T]}c.u&&(c.N(),c.u=!1);break;case"asyncComplete":if(S=p.id,T=p.error,p=c.i[S],delete c.i[S],p)if(T){S=new F(T.severity,T.category,T.code);for(g in T)S[g]=T[g];p.reject(S)}else p.resolve()}},this.g={video:{},player:{}},this.H=0,this.i={},this.l=null,$s.add(this)}d=nd.prototype,d.destroy=function(){return $s.delete(this),rd(this),ri&&dg(this),this.j&&(this.j.stop(),this.j=null),this.F=this.s=null,this.h=this.m=!1,this.C=this.A=this.l=this.i=this.g=this.o=null,Promise.resolve()},d.Ka=function(){return this.h},d.ef=function(){return this.J},d.init=function(){if(this.G.length)if(o.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.j.qc();var e=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);e=new chrome.cast.ApiConfig(e,function(t){for(var n=v($s),r=n.next();!r.done;r=n.next())cg(r.value,t)},function(t){for(var n=v($s),r=n.next();!r.done;r=n.next())r=r.value,Hl=t=="available",r.j.qc()},"origin_scoped"),chrome.cast.initialize(e,function(){},function(){}),Hl&&this.j.U(MT),(e=ri)&&e.status!=chrome.cast.SessionStatus.STOPPED?cg(this,e):ri=null}else o.__onGCastApiAvailable!==hg&&(Gl=o.__onGCastApiAvailable||null,o.__onGCastApiAvailable=hg)},d.mf=function(e){this.o=e,this.h&&Ws(this,{type:"appData",appData:this.o})},d.cast=function(e){var t=this;return j(function(n){if(!t.m)throw new F(1,8,8e3);if(!Hl)throw new F(1,8,8001);if(t.h)throw new F(1,8,8002);return t.l=new pt,chrome.cast.requestSession(function(r){return id(t,e,r)},function(r){return fg(t,r)}),E(n,t.l,0)})};function kT(e){if(e.h){var t=e.I();chrome.cast.requestSession(function(n){return id(e,t,n)},function(n){return fg(e,n)})}}d.cc=function(){if(this.h){if(rd(this),ri){dg(this);try{ri.stop(function(){},function(){})}catch{}ri=null}od(this)}},d.get=function(e,t){var n=this;if(e=="video"){if(ET.includes(t))return function(){return n.hg.apply(n,[e,t].concat(N(ye.apply(0,arguments))))}}else if(e=="player"){if(td[t]&&!this.get("player","isLive")())return function(){};if(bT.includes(t))return function(){return n.hg.apply(n,[e,t].concat(N(ye.apply(0,arguments))))};if(AT.includes(t))return function(){return n.Nh.apply(n,[e,t].concat(N(ye.apply(0,arguments))))};if(zl[t]||Vl[t])return function(){return n.g[e][t]}}return this.g[e][t]},d.set=function(e,t,n){this.g[e][t]=n,Ws(this,{type:"set",targetName:e,property:t,value:n})};function id(e,t,n){ri=n,n.addUpdateListener(e.A),n.addMessageListener("urn:x-cast:com.google.shaka.v2",e.C),od(e),Ws(e,{type:"init",initState:t,appData:e.o}),e.l.resolve()}function fg(e,t){var n=8003;switch(t.code){case"cancel":n=8004;break;case"timeout":n=8005;break;case"receiver_unavailable":n=8006}e.l.reject(new F(2,8,n,t))}d.hg=function(e,t){Ws(this,{type:"call",targetName:e,methodName:t,args:ye.apply(2,arguments)})},d.Nh=function(e,t){var n=ye.apply(2,arguments),r=new pt,a=this.H.toString();this.H++,this.i[a]=r;try{Ws(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:a})}catch(l){r.reject(l)}return r};function cg(e,t){var n=e.I();e.l=new pt,e.u=!0,id(e,n,t)}function dg(e){var t=ri;t.removeUpdateListener(e.A),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.C)}function od(e){var t=ri?ri.status=="connected":!1;if(e.h&&!t){e.F();for(var n in e.g)e.g[n]={};rd(e)}e.h=t,e.J=t?ri.receiver.friendlyName:"",e.j.qc()}function rd(e){for(var t in e.i){var n=e.i[t];delete e.i[t],n.reject(new F(1,7,7e3))}}function Ws(e,t){t=sg(t);var n=ri;try{n.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},Dn)}catch(r){throw t=new F(2,8,8005,r),n=new Ne("error",new Map().set("detail",t)),e.s("player",n),e.cc(),t}}var MT=.02,Hl=!1,ri=null,Gl=null,$s=new Set;function hg(e){if(Gl?o.__onGCastApiAvailable=Gl:delete o.__onGCastApiAvailable,Gl=null,e)for(var t=v($s),n=t.next();!n.done;n=t.next())n.value.init();typeof o.__onGCastApiAvailable=="function"&&o.__onGCastApiAvailable(e)}function bt(e,t,n,r){r=r===void 0?!1:r,Je.call(this);var a=this;this.i=e,this.h=t,this.m=this.o=this.j=this.s=this.l=null,this.C=n,this.A=r,this.u=new Map,this.g=new nd(n,function(){return mg(a)},function(){return gg(a)},function(l,f){return vg(a,l,f)},function(){return yg(a)},function(){return sd(a)},r),RT(this)}le(bt,Je),d=bt.prototype,d.destroy=function(e){return e&&this.g.cc(),this.m&&(this.m.release(),this.m=null),e=[],this.h&&(e.push(this.h.destroy()),this.h=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.s=this.l=this.i=null,Je.prototype.release.call(this),Promise.all(e)},d.nh=function(){return this.l},d.bh=function(){return this.s},d.Fg=function(){return this.g.m&&Hl},d.Ka=function(){return this.g.Ka()},d.ef=function(){return this.g.ef()},d.cast=function(){var e=this,t;return j(function(n){return n.g==1?(t=sd(e),E(n,e.g.cast(t),2)):e.h?E(n,e.h.rc(),0):n.return()})},d.mf=function(e){this.g.mf(e)},d.ai=function(){kT(this.g)},d.cc=function(){this.g.cc()},d.Gg=function(e,t){t=t===void 0?!1:t;var n=this;return j(function(r){if(r.g==1)return e==n.C&&t==n.A?r.return():(n.C=e,n.A=t,n.g.cc(),E(r,n.g.destroy(),2));n.g=null,n.g=new nd(e,function(){return mg(n)},function(){return gg(n)},function(a,l){return vg(n,a,l)},function(){return yg(n)},function(){return sd(n)},t),n.g.init(),H(r)})};function RT(e){e.g.init(),e.m=new ft;for(var t=v(ag),n=t.next();!n.done;n=t.next())e.m.D(e.i,n.value,function(l){e.g.Ka()||(l=Hp(l),e.j.dispatchEvent(l))});for(var r in rl)e.m.D(e.h,rl[r],function(l){e.g.Ka()||e.o.dispatchEvent(l)});e.l={},t={};for(var a in e.i)t.wc=a,Object.defineProperty(e.l,t.wc,{configurable:!1,enumerable:!0,get:function(l){return function(){return LT(e,l.wc)}}(t),set:function(l){return function(f){var c=l.wc;e.g.Ka()?e.g.set("video",c,f):e.i[c]=f}}(t)}),t={wc:t.wc};e.s={},pg(e,function(l){Object.defineProperty(e.s,l,{configurable:!1,enumerable:!0,get:function(){return NT(e,l)}})}),_T(e),e.j=new Je,e.j.zd=e.l,e.o=new Je,e.o.zd=e.s}function _T(e){var t=new Map;pg(e,function(n,r){t.has(r)?(r=t.get(r),n.length=a)return null;for(var l=-1,f=-1,c=0;cn||127n||0>t))if(t>=n)for(--r;0<=r;r--)e.i[t+r]=e.i[n+r].map(function(l){return l});else for(var a=0;at;t++)e.i.push(hd())}function hd(){for(var e=[],t=0;42>t;t++)e.push(null);return e}function Uo(e,t){Og(e)&&(e.i[e.h][e.g]=new Eg(t,e.C,e.u,e.s,e.A),e.g++)}function Og(e){var t=e.gthis.h.length)throw new F(2,2,3e3);this.g+=e};function fC(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function cC(e,t,n,r){if(128<=n&&135>=n)r=n&7,e.h[r]&&(e.g=e.h[r]);else{if(n===136){n=Ot(t).value,t=null,n=v(Qs(e,n));for(var a=n.next();!a.done;a=n.next())a=e.h[a.value],a.isVisible()&&(t=Bo(a,r,e.i)),dd(a);return t}if(n===137)for(t=Ot(t).value,t=v(Qs(e,t)),n=t.next();!n.done;n=t.next())n=e.h[n.value],n.isVisible()||(n.j=r),n.l=!0;else{if(n===138){for(n=Ot(t).value,t=null,n=v(Qs(e,n)),a=n.next();!a.done;a=n.next())a=e.h[a.value],a.isVisible()&&(t=Bo(a,r,e.i)),a.l=!1;return t}if(n===139){for(n=Ot(t).value,t=null,n=v(Qs(e,n)),a=n.next();!a.done;a=n.next())a=e.h[a.value],a.isVisible()?t=Bo(a,r,e.i):a.j=r,a.l=!a.l;return t}if(n===140)return t=Ot(t).value,Ug(e,t,r);if(n===143)return r=Ug(e,255,r),Bg(e),r;if(n===144)t.skip(1),r=Ot(t).value,e.g&&(e.g.u=0<(r&128),e.g.C=0<(r&64));else if(n===145)r=Ot(t).value,n=Ot(t).value,t.skip(1),e.g&&(t=jg((n&48)>>4,(n&12)>>2,n&3),e.g.A=jg((r&48)>>4,(r&12)>>2,r&3),e.g.s=t);else if(n===146)r=Ot(t).value,t=Ot(t).value,e.g&&(e=e.g,e.h=r&15,e.g=t&63);else if(n===151)t.skip(1),t.skip(1),r=Ot(t).value,t.skip(1),e.g&&(e.g.F=r&3);else if(152<=n&&159>=n){if(n=(n&15)-8,a=e.h[n]!==null,!a){var l=new Dg(n,e.i);l.j=r,e.h[n]=l}r=Ot(t).value,l=Ot(t).value;var f=Ot(t).value,c=Ot(t).value,p=Ot(t).value;t=Ot(t).value,a&&!(t&7)||(t=e.h[n],t.h=0,t.g=0,t.C=!1,t.u=!1,t.A="white",t.s="black"),t=e.h[n],t.l=0<(r&32),t.K=l&127,t.H=f,t.G=(c&240)>>4,t.J=0<(l&128),t.o=(c&15)+1,t.m=(p&63)+1,e.g=e.h[n]}}}return null}function Qs(e,t){for(var n=[],r=0;8>r;r++)(t&1)===1&&e.h[r]&&n.push(r),t>>=1;return n}function Ug(e,t,n){var r=null;t=v(Qs(e,t));for(var a=t.next();!a.done;a=t.next()){a=a.value;var l=e.h[a];l.isVisible()&&(r=Bo(l,n,e.i)),e.h[a]=null}return r}function Bg(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function jg(e,t,n){var r={0:0,1:0,2:1,3:1};return e=r[e],t=r[t],n=r[n],dC[e<<2|t<<1|n]}var Fg=new Map([[32," "],[33," "],[37,"…"],[42,"Š"],[44,"Œ"],[48,"█"],[49,"‘"],[50,"’"],[51,"“"],[52,"”"],[53,"•"],[57,"™"],[58,"š"],[60,"œ"],[61,"℠"],[63,"Ÿ"],[118,"⅛"],[119,"⅜"],[120,"⅝"],[121,"⅞"],[122,"│"],[123,"┐"],[124,"└"],[125,"─"],[126,"┘"],[127,"┌"]]),dC="black blue green cyan red magenta yellow white".split(" ");function Or(){this.h=[],this.g=[],this.i=new lC,this.l=0,this.m=new Map([["CC1",new Wl(0,0)],["CC2",new Wl(0,1)],["CC3",new Wl(1,0)],["CC4",new Wl(1,1)]]),this.s=this.o=0,this.j=new Map,this.A=!0,this.u=new Set,pd(this)}Or.prototype.clear=function(){this.l=0,this.h=[],this.g=[];var e=this.i;e.i=[],e.h=[],e.g=0,pd(this),e=v(this.j.values());for(var t=e.next();!t.done;t=e.next())Bg(t.value)};function pd(e){e.o=0,e.s=0;for(var t=v(e.m.values()),n=t.next();!n.done;n=t.next())n=n.value,n.h=Ng,n.g=n.j,n.m=null,Ks(n.i),Ks(n.j),Ks(n.o);e.A=!0}Or.prototype.extract=function(e,t){if(this.A){for(var n=v(this.m.values()),r=n.next();!r.done;r=n.next())r.value.l=t;this.A=!1}if(e=new rt(e,0),!(8>e.getLength())&&e.ga()===181&&e.Ea()===49&&e.L()===1195456820&&e.ga()===3&&(n=e.ga(),(n&64)!==0))for(n&=31,e.skip(1),r=0;r>2,f=e.ga(),c=e.ga();l&&(a&=3,a===0||a===1?this.h.push({pts:t,type:a,Sa:f,nb:c,order:this.h.length}):(this.g.push({pts:t,type:a,value:f,order:this.g.length}),this.g.push({pts:t,type:2,value:c,order:this.g.length})))}},Or.prototype.decode=function(){function e(a,l){return a.pts-l.pts||a.order-l.order}var t=[];this.h.sort(e),this.g.sort(e);for(var n=v(this.h),r=n.next();!r.done;r=n.next())(r=hC(this,r.value))&&t.push(r);for(n=v(this.g),r=n.next();!r.done;r=n.next())uC(this.i,r.value);for(n=v(this.i.i),r=n.next();!r.done;r=n.next())r=pC(this,r.value),t.push.apply(t,N(r));return this.i.i=[],this.h=[],this.g=[],t};function hC(e,t){var n=t.type;if((t.Sa&112)===16){var r=t.Sa>>3&1;n===0?e.o=r:e.s=r}if(r="CC"+((n<<1|(n?e.s:e.o))+1),n=e.m.get(r),t.Sa===255&&t.nb===255||!t.Sa&&!t.nb||!zg(t.Sa)||!zg(t.nb))return 45<=++e.l&&pd(e),null;if(e.l=0,t.Sa&=127,t.nb&=127,!t.Sa&&!t.nb)return null;if(e.u.add(r),e=null,(t.Sa&112)===16)e:{if(r=t.Sa,e=t.nb,n.m===(r<<8|e))n.m=null;else if(n.m=r<<8|e,(r&240)===16&&(e&192)===64){t=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(r&7)<<1|e>>5&1];var a=(e&30)>>1;r="white";var l=!1;7>a?r=Pg[a]:a===7&&(l=!0),e=(e&1)===1,n.h!==qs&&(a=n.g,n.h===$l&&t!==a.g&&(n=1+t-a.h,bg(a,n,1+a.g-a.h,a.h),Wi(a,0,n-1),Wi(a,t+1,15-t)),a.g=t,a.m=e,a.j=l,a.l=r,a.o="black")}else if((r&247)===17&&(e&240)===32)n.g.m=!1,n.g.j=!1,n.g.l="white",Dr(n.g,Ys,32),r=!1,t=Pg[(e&14)>>1],t==="white_italics"&&(t="white",r=!0),n.g.m=(e&1)===1,n.g.j=r,n.g.l=t;else if((r&247)===16&&(e&240)===32||(r&247)===23&&(e&255)===45)t="black",!(r&7)&&(t=YT[(e&14)>>1]),n.g.o=t;else if((r&247)===17&&(e&240)===48)Dr(n.g,Ag,e);else if((r&246)===18&&(e&224)===32)Dr(n.g,r&1?Mg:kg,e);else if((r&246)===20&&(e&240)===32){switch(e=t.pts,r=null,t.nb){case 32:_g(n);break;case 33:n=n.g,n.i[n.g].pop();break;case 37:r=cd(n,2,e);break;case 38:r=cd(n,3,e);break;case 39:r=cd(n,4,e);break;case 40:Dr(n.g,Ys,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.l=e;break;case 42:Ks(n.o),Lg(n);break;case 43:Lg(n);break;case 44:t=n.i,r=null,n.h!==qs&&(r=Xl(t,n.l,e)),Wi(t,0,15);break;case 45:t=n.g,n.h!==$l?r=null:(r=Xl(t,n.l,e),l=t.g-t.h+1,bg(t,l-1,l,t.h),Wi(t,0,l-1),Wi(t,t.g,15-t.g),n.l=e);break;case 46:Wi(n.j,0,15);break;case 47:t=null,n.h!==qs&&(t=Xl(n.i,n.l,e)),r=n.j,n.j=n.i,n.i=r,_g(n),n.l=e,r=t}e=r;break e}e=null}else r=t.nb,Dr(n.g,Ys,t.Sa),Dr(n.g,Ys,r);return e}function pC(e,t){var n=[];try{for(;t.ia();){var r=Ot(t).value,a=(r&224)>>5,l=r&31;if(a===7&&l!=0&&(a=Ot(t).value&63),a!=0){e.u.add("svc"+a),e.j.has(a)||e.j.set(a,new fC(a));for(var f=e.j.get(a),c=t.qa();t.qa()-c=m){var T=g;if(f.g){var w=f.g;switch(a=null,m){case 8:!Og(w)||0>=w.g&&0>=w.h||(0>=w.g?(w.g=w.m-1,w.h--):w.g--,w.i[w.h][w.g]=null);break;case 13:if(w.isVisible()&&(a=Bo(w,T,f.i)),w.h+1>=w.o){T=w;for(var A=0,M=1;16>M;M++,A++)T.i[A]=T.i[M];for(M=0;1>M;M++,A++)T.i[A]=hd()}else w.h++;w.g=0;break;case 14:w.isVisible()&&(a=Bo(w,T,f.i)),w.i[w.h]=hd(),w.g=0;break;case 12:w.isVisible()&&(a=Bo(w,T,f.i)),dd(w),T=w,T.h=0,T.g=0}var R=a}else R=null}else if(128<=m&&159>=m)R=cC(f,a,m,g);else{if(4096<=m&&4127>=m)T=m&255,8<=T&&15>=T?a.skip(1):16<=T&&23>=T?a.skip(2):24<=T&&31>=T&&a.skip(3);else if(4224<=m&&4255>=m)T=m&255,128<=T&&135>=T?a.skip(4):136<=T&&143>=T&&a.skip(5);else if(32<=m&&127>=m)a=m,f.g&&(a===127?Uo(f.g,"♪"):Uo(f.g,String.fromCharCode(a)));else if(160<=m&&255>=m)f.g&&Uo(f.g,String.fromCharCode(m));else if(4128<=m&&4223>=m){if(a=m&255,f.g)if(Fg.has(a)){var D=Fg.get(a);Uo(f.g,D)}else Uo(f.g,"_")}else 4256<=m&&4351>=m&&f.g&&((m&255)!=160?Uo(f.g,"_"):Uo(f.g,"[CC]"));R=null}(a=R)&&n.push(a)}}}}catch(_){if(_ instanceof F&&_.code===3e3)qt("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw _}return n}function zg(e){for(var t=0;e;)t^=e&1,e>>=1;return t===1}Or.prototype.getStreams=function(){return Array.from(this.u)},he("shaka.cea.CeaDecoder",Or),Zo=function(){return new Or};function Vg(e){for(var t=[],n=e,r=e=0;r>1&63,w=w==39||w==40;break;default:return}if(w)for(T=0,mn.byteLength){n=[];break e}var l=Fe(n,e,a);t.push({type:r,value:l}),e+=a}n=t}return n}function vC(e){e=v(e.getElementsByTagName("DATA"));for(var t=e.next();!t.done;t=e.next()){t=v(t.value.childNodes);for(var n=t.next();!n.done;n=t.next())if(n=n.value,n instanceof Element&&n.tagName=="LA_URL")return n.textContent}return""}function Zl(e){var t=Bi(e.node,"https://dashif.org/CPS","Laurl");return t&&t.textContent?t.textContent:(e=Bi(e.node,"urn:microsoft:playready","pro"),!e||(e=ti(e.textContent),e=yC(e).filter(function(n){return n.type===CC})[0],!e)?"":(e=Di(e.value,!0),(e=yr(e,"WRMHEADER"))?vC(e):""))}function xC(e,t,n,r){var a=[];t=v(t);for(var l=t.next();!l.done;l=t.next()){l=l.value;var f=n[l.cd];if(f){var c;if(c=Bi(l.node,"urn:microsoft:playready","pro")){c=ti(c.textContent);var p=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);c=[{initData:fl(c,p,new Set,0),initDataType:"cenc",keyId:l.keyId}]}else c=null;if(p=null,l.cd==="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e")if(p=r,p.size==0)p=null;else{var m=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]),g=new Uint8Array([]);p=[{initData:fl(g,m,p,1),initDataType:"cenc",keyId:l.keyId}]}c=no(f,l.init||e||c||p),(f=IC.get(f))&&(c.licenseServerUri=f(l)),a.push(c)}}return a}function SC(e){var t=[];e=v(e);for(var n=e.next();!n.done;n=e.next())(n=wC(n.value))&&t.push(n);return t}function wC(e){var t=e.getAttribute("schemeIdUri"),n=Lo(e,"urn:mpeg:cenc:2013","default_KID"),r=t0(e,"urn:mpeg:cenc:2013","pssh").map(No);if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase(),n.includes(" ")))throw new F(2,4,4009);var a=[];try{a=r.map(function(l){return{initDataType:"cenc",initData:ti(l),keyId:null}})}catch{throw new F(2,4,4007)}return{node:e,cd:t,keyId:n,init:0M)if(T){if(T=Ke(T,"t",un),T==null)break;if(w>=T)break;M=Math.ceil((T-w)/A)-1}else{if(e==1/0)break;if(w/t>=e)break;M=Math.ceil((e*t-w)/A)-1}for(0>>31;T&=2147483647;var A=f.reader.L();if(f.reader.skip(4),w==1)throw new F(2,3,3006);c.push(new Pe(m/p+n,(m+A)/p+n,function(){return l},e,e+T-1,t,n,r,a)),m+=A,e+=T}return f.parser.stop(),c}function so(e){this.h=mn(e),this.g=new rt(this.h,0)}so.prototype.ia=function(){return this.g.ia()};function $i(e){var t=Wg(e);if(7Number.MAX_SAFE_INTEGER&&(_e=BigInt(xe)*BigInt(M)),_e=Jl(R,_,ce,null,D,_e),Qt(B(),[_e])},0,null,r,U,g,p(),[],"",null,null,oo,l),Ie.h=me,Ie}function c(){var ce=[Math.max(m.eb(),g),Math.min(m.Bb(),p())].map(function(me){return me-g});return[Math.ceil(ce[0]/w),Math.ceil(ce[1]/w)-1].map(function(me){return me+A})}function p(){var ce=S!=null&&a[S]||T;return ce?g+ce:1/0}var m=e.presentationTimeline,g=e.ba.start,S=e.ta.id,T=e.ba.duration,w=t.ya,A=t.gd,M=t.timescale,R=t.mc,D=e.bandwidth||null,_=e.M.id,B=e.M.cb,U=g-t.vb,z=c();e=e.zb?Math.max(z[0],z[1]-n+1):z[0],z=z[1],n=[];for(var W=e;W<=z;++W){var se=f(W);n.push(se)}var Z=new Qe(n);if(n=m.Bb()p()&&!xe.length?null:xe})}return Promise.resolve(Z)}function VC(e,t){var n=bi(e,nu,"initialization");if(!n)return null;var r=e.M.id,a=e.bandwidth||null,l=e.M.cb;return new Bn(function(){var f=Jl(n,r,null,null,a,null);return Qt(l(),[f])},0,null,Qg(e),null,null,t)}function iu(e,t,n,r,a,l,f,c,p,m){Qe.call(this,[]),this.h=e,this.F=t,this.A=n,this.C=r,this.i=a,this.l=l,this.s=f,this.u=p,this.G=m,c&&ey(this)}le(iu,Qe),d=iu.prototype,d.Ab=function(){return this.h?this.h.timeline.length:0},d.release=function(){Qe.prototype.release.call(this),this.h=null},d.bb=function(e){if(this.h){for(var t=0,n=this.h.timeline,r=0;r=t&&(this.g=this.g.slice(t)),this.j+=t,this.Ab()===0&&this.release())}};function Jg(e,t,n,r,a,l){if(e.s=l,e.h){n=e.h.timeline,e.h.mc=t.mc;var f=n[n.length-1];t=t.timeline.filter(function(c){return c.start>=f.end}),0=e.l;)t.pop();e.bb(e.i)}}d.find=function(e){if(this.h&&this.h.timeline&&this.h.timeline.length&&e=this.l)return null;for(var n=t.length-1,r=0;r=l&&ee||e>=this.Ab()||!this.h)return null;var n=this.g[e];if(!n){var r=this.h.mc,a=this.h.timeline[e],l=a.Vh,f=this.h.yf+a.zf;n=this.i-this.h.vb;var c=this.i+a.end,p=c;e===this.Ab()-1&&this.l!==1/0&&(p=this.l);for(var m=[],g=(a.end-a.start)/a.fb,S={},T=0;Tc&&e.i.delete(f);if(r=r.filter(function(p){for(var m=v(e.i.keys()),g=m.next();!g.done;g=m.next())if(g.value.includes(new It(p.location).ob))return!1;return!0}),r.length&&(e.A=r[0].df),r=r.map(function(p){return p.location}),!r.length&&e.h)for(a=v(e.h.split(",")),f=a.next();!f.done;f=a.next())(l=t.get(f.value))&&(e.A=e.h,r.push(l));if(!r.length)for(t=v(t.values()),a=t.next();!a.done;a=t.next())r.push(a.value);return n?r:Qt(e.j,r)}function si(){this.j=[],this.h=[],this.g=[],this.l=[],this.i=[],this.m=!1,this.o=new Set}d=si.prototype,d.release=function(){for(var e=v(this.h.concat(this.g,this.l,this.i)),t=e.next();!t.done;t=e.next())t=t.value,t.segmentIndex&&t.segmentIndex.release();this.h=[],this.g=[],this.l=[],this.i=[],this.j=[]},d.mh=function(){return this.j},d.Ie=function(){return this.l.slice()},d.Vg=function(){return this.i};function ny(e,t){var n=[],r=[],a=[],l=[];e=v(e);for(var f=e.next();!f.done;f=e.next()){var c=f.value;f=new Map(c.audioStreams.map(function(S){return[Sd(S),S]}));var p=new Map(c.videoStreams.map(function(S){return[xd(S),S]})),m=new Map(c.textStreams.map(function(S){return[ra(S),S]}));if(c=new Map(c.imageStreams.map(function(S){return[sa(S),S]})),t){var g=ly(Ye);m.set(ra(g),g),g=ly("image"),c.set(sa(g),g)}n.push(f),r.push(p),a.push(m),l.push(c)}return{Df:n,vg:r,sg:a,Vf:l}}d.Gf=function(e,t){var n=this,r,a,l,f,c,p,m,g,S,T,w,A,M,R,D,_,B,U,z,W,se,Z,J,ce,me,xe,Ie,Me,_e;return j(function(Be){if(Be.g==1){if(r=Dt,!t&&e.length==1)return a=ny(e,!1),l=a.Df,f=a.vg,c=a.sg,p=a.Vf,n.h=Array.from(l[0].values()),n.g=Array.from(f[0].values()),n.l=Array.from(c[0].values()),n.i=Array.from(p[0].values()),Be.B(2);for(m=-1,g=0;gr))return!0;if(ar.length?!0:a.lengthr)return!0;if(ar.length)return!0;if(a.lengthe){if(n<=e||n-et-e)return Ki}else{if(n>e)return Ki;if(e-ne-t)return Ki}return cy}function uy(e,t,n){return t=Math.abs(e-t),e=Math.abs(e-n),ee.u)&&(e.u=g),f=iI(e,t,n,{start:g,duration:w,node:p,Le:w==null||!m}),l.push(f),t.ta.id&&w&&(e.K[t.ta.id]=w),w==null){f=null;break}f=g+w}}return e.J=l.map(function(M){return M.id}),a!=null?{periods:l,duration:a,Lf:!1}:{periods:l,duration:f,Lf:!0}}function iI(e,t,n,r){t.ta=Id(e,r.node,null,n),t.ba=r,t.ta.ac=t.ac,t.ta.id||(t.ta.id="__shaka_period_"+r.start);var a=gt(r.node,"EventStream");n=t.presentationTimeline.eb(),a=v(a);for(var l=a.next();!l.done;l=a.next())cI(e,r.start,r.duration,l.value,n);if(n=gt(r.node,"AdaptationSet").map(function(g){return oI(e,t,g)}).filter(ir),t.zb){for(r=[],a=v(n),l=a.next();!l.done;l=a.next()){l=v(l.value.Ph);for(var f=l.next();!f.done;f=l.next())r.push(f.value)}if(r.length!=new Set(r).size)throw new F(2,4,4018)}for(r=n.filter(function(g){return!g.wf}),n=n.filter(function(g){return g.wf}),n=v(n),a=n.next();!a.done;a=n.next()){a=a.value,l=a.wf.split(" "),f=v(r);for(var c=f.next();!c.done;c=f.next()){var p=c.value;if(l.includes(p.id)){c={},p=v(p.streams);for(var m=p.next();!m.done;c={pd:c.pd},m=p.next())c.pd=m.value,c.pd.trickModeVideo=a.streams.find(function(g){return function(S){return Qn(g.pd.codecs)==Qn(S.codecs)}}(c))}}}if(n=au(e.h.disableAudio,r,"audio"),a=au(e.h.disableVideo,r,"video"),l=au(e.h.disableText,r,Ye),r=au(e.h.disableThumbnails,r,"image"),a.length===0&&n.length===0)throw new F(2,4,4004);return{id:t.ta.id,audioStreams:n,videoStreams:a,textStreams:l,imageStreams:r}}function au(e,t,n){return e||!t.length?[]:t.reduce(function(r,a){return a.contentType!=n||r.push.apply(r,N(a.streams)),r},[])}function oI(e,t,n){function r(Z){switch(Z){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}t.oa=Id(e,n,t.ta,null);var a=!1,l=gt(n,"Role"),f=l.map(function(Z){return Z.getAttribute("value")}).filter(ir),c=void 0,p=t.oa.contentType==Ye;p&&(c="subtitle"),l=v(l);for(var m=l.next();!m.done;m=l.next()){m=m.value;var g=m.getAttribute("schemeIdUri");if(g==null||g=="urn:mpeg:dash:role:2011")switch(m=m.getAttribute("value"),m){case"main":a=!0;break;case"caption":case"subtitle":c=m}}var S;g=gt(n,"EssentialProperty"),l=null;var T=!1;m=!1,g=v(g);for(var w=g.next();!w.done;w=g.next()){w=w.value;var A=w.getAttribute("schemeIdUri");A=="http://dashif.org/guidelines/trickmode"?l=w.getAttribute("value"):A=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?S=r(parseInt(w.getAttribute("value"),10)):A!="urn:mpeg:mpegB:cicp:ColourPrimaries"&&A!="urn:mpeg:mpegB:cicp:MatrixCoefficients"&&(A=="urn:mpeg:dash:ssr:2023"?T=!0:m=!0)}for(g=gt(n,"SupplementalProperty"),g=v(g),w=g.next();!w.done;w=g.next())w=w.value,w.getAttribute("schemeIdUri")=="urn:mpeg:mpegB:cicp:TransferCharacteristics"&&(S=r(parseInt(w.getAttribute("value"),10)));g=gt(n,"Accessibility");var M=new Map,R;for(g=v(g),w=g.next();!w.done;w=g.next())if(A=w.value,w=A.getAttribute("schemeIdUri"),A=A.getAttribute("value"),w=="urn:scte:dash:cc:cea-608:2015")if(w=1,A!=null){A=A.split(";");for(var D=v(A),_=D.next();!_.done;_=D.next()){var B=_.value,U=_=void 0;B.includes("=")?(B=B.split("="),_=B[0].startsWith("CC")?B[0]:"CC"+B[0],U=B[1]||"und"):(_="CC"+w,A.length==2?w+=2:w++,U=B),M.set(_,Ze(U))}}else M.set("CC1","und");else if(w=="urn:scte:dash:cc:cea-708:2015")if(w=1,A!=null)for(A=v(A.split(";")),_=A.next();!_.done;_=A.next())_=_.value,B=D=void 0,_.includes("=")?(_=_.split("="),D="svc"+_[0],B=_[1].split(",")[0].split(":").pop()):(D="svc"+w,w++,B=_),M.set(D,Ze(B));else M.set("svc1","und");else w=="urn:mpeg:dash:role:2011"?A!=null&&(f.push(A),A=="captions"&&(c="caption")):w=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(A=="1"?R="visually impaired":A=="2"&&(R="hard of hearing"));if(m)return null;m=gt(n,"ContentProtection");var z=Hg(m,e.h.dash.ignoreDrmInfo,e.h.dash.keySystemsByURI),W=Ze(t.oa.language||"und"),se=n.getAttribute("label");if((m=gt(n,"Label"))&&m.length&&(m=m[0],m.textContent&&(se=m.textContent)),m=gt(n,"Representation"),n=m.map(function(Z){return(Z=rI(e,t,z,c,W,se,a,f,M,Z,R))&&(Z.hdr=Z.hdr||S,Z.fastSwitching=T),Z}).filter(function(Z){return!!Z}),n.length==0){if(l=t.oa.contentType=="image",e.h.dash.ignoreEmptyAdaptationSet||p||l)return null;throw new F(2,4,4003)}if(!t.oa.contentType||t.oa.contentType=="application")for(t.oa.contentType=py(n[0].mimeType,n[0].codecs),p=v(n),w=p.next();!w.done;w=p.next())w.value.type=t.oa.contentType;for(p=t.oa.id||"__fake__"+e.I++,g=v(n),w=g.next();!w.done;w=g.next()){for(w=w.value,A=v(z.drmInfos),D=A.next();!D.done;D=A.next())D=D.value,D.keyIds=D.keyIds&&w.keyIds?new Set([].concat(N(D.keyIds),N(w.keyIds))):D.keyIds||w.keyIds;e.h.dash.enableAudioGroups&&(w.groupId=p)}return m=m.map(function(Z){return Z.getAttribute("id")}).filter(ir),{id:p,contentType:t.oa.contentType,language:W,bj:a,streams:n,drmInfos:z.drmInfos,wf:l,Ph:m}}function rI(e,t,n,r,a,l,f,c,p,m,g){if(t.M=Id(e,m,t.oa,null),e.A=Math.min(e.A,t.M.ac),!uI(t.M))return null;var S=t.ba.start;t.bandwidth=Ke(m,"bandwidth",Fi)||0;var T=t.M.contentType,w=T==Ye||T=="application";T=T=="image";try{var A=void 0;if(n.ke){var M=t.M.cb,R=Qt(M(),[n.ke.zh]),D=Ft(R,e.h.retryParameters);A={method:"AES-128",iv:n.ke.iv,firstMediaSequenceNumber:0,fetchKey:function(){var J,ce,me;return j(function(xe){if(xe.g==1)return E(xe,Ed(e,D,6),2);if(xe.g!=3){if(J=xe.h,!J.data||J.data.byteLength!=16)throw new F(2,4,4049);return ce={name:"AES-CBC"},me=A,E(xe,o.crypto.subtle.importKey("raw",J.data,ce,!0,["decrypt"]),3)}me.cryptoKey=xe.h,A.fetchKey=void 0,H(xe)})}}}if(M=function(J,ce,me,xe){return dI(e,J,ce,me,xe)},t.M.ed)var _=LC(t,M,A);else if(t.M.Fb)_=PC(t,e.m,A);else if(t.M.fd)_=BC(t,M,e.m,!!e.j,e.h.dash.initialSegmentLimit,e.K,A);else{var B=t.ba.duration||0,U=t.M.cb;_={dc:function(){return Promise.resolve(vc(S,B,U()))}}}}catch(J){if((w||T)&&J.code==4002)return null;throw J}M=gt(m,"ContentProtection"),M=gC(M,n,e.h.dash.ignoreDrmInfo,e.h.dash.keySystemsByURI),M=new Set(M?[M]:[]),R=!1,gt(m,"SupplementalProperty").some(function(J){return J.getAttribute("schemeIdUri")=="tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&J.getAttribute("value")=="JOC"})&&(R=!0);var z=!1;w&&(z=c.includes("forced_subtitle")||c.includes("forced-subtitle"));var W;if(T&&((m=gt(m,"EssentialProperty").find(function(J){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(J.getAttribute("schemeIdUri"))}))&&(W=m.getAttribute("value")),!W))return null;var se;m=t.M.codecs,t.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(m.includes("hvc1.2.4.L153.B0")||m.includes("hev1.2.4.L153.B0"))&&(se="PQ"),m=t.M.id?t.ta.id+","+t.M.id:"";var Z=m&&e.m[m]?e.m[m]:{id:e.I++,originalId:t.M.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){Z.segmentIndex&&(Z.segmentIndex.release(),Z.segmentIndex=null)},segmentIndex:null,mimeType:t.M.mimeType,codecs:t.M.codecs,frameRate:t.M.frameRate,pixelAspectRatio:t.M.pixelAspectRatio,bandwidth:t.bandwidth,width:t.M.width,height:t.M.height,kind:r,encrypted:0e.F||e.G.U(Math.max(e.F-t,kt(e.H)))}function Id(e,t,n,r){n=n||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Td:null,audioSamplingRate:null,ac:0,jf:0},r=r||n.cb;var a=t.getAttribute("id"),l=gt(t,"BaseURL"),f,c=!1;if(e.g)for(var p=v(l),m=p.next();!m.done;m=p.next()){var g=m.value;m=g.getAttribute("serviceLocation"),g=No(g),m&&g&&(Br(e.g,a,m,g),c=!0)}c&&e.g||(f=l.map(No)),p=t.getAttribute("contentType")||n.contentType,m=t.getAttribute("mimeType")||n.mimeType,g=t.getAttribute("codecs")||n.codecs;var S=Ke(t,"frameRate",aS)||n.frameRate,T=t.getAttribute("sar")||n.pixelAspectRatio,w=aI(gt(t,"InbandEventStream"),n.emsgSchemeIdUris),A=gt(t,"AudioChannelConfiguration");A=lI(A)||n.Td;var M=Ke(t,"audioSamplingRate",un)||n.audioSamplingRate;p||(p=py(m,g));var R=ni(t,"SegmentBase"),D=ni(t,"SegmentTemplate"),_=R&&Ke(R,"availabilityTimeOffset",Ms)||0,B=D&&Ke(D,"availabilityTimeOffset",Ms)||0,U=l&&l.length&&Ke(l[0],"availabilityTimeOffset",Ms)||0;return _=n.ac+U+_+B,B=null,(U=ni(t,"SegmentSequenceProperties"))&&(U=ni(U,"SAP"))&&(B=Ke(U,"cadence",dl)),{cb:function(){return Qt(r(),l.length?e.g&&c?ta(e.g,a):f||[]:[])},ed:R||n.ed,Fb:ni(t,"SegmentList")||n.Fb,fd:D||n.fd,width:Ke(t,"width",un)||n.width,height:Ke(t,"height",un)||n.height,contentType:p,mimeType:m,codecs:g,frameRate:S,pixelAspectRatio:T,emsgSchemeIdUris:w,id:a,language:t.getAttribute("lang"),Td:A,audioSamplingRate:M,ac:_,jf:B||n.jf}}function aI(e,t){t=t.slice(),e=v(e);for(var n=e.next();!n.done;n=e.next())n=n.value.getAttribute("schemeIdUri"),t.includes(n)||t.push(n);return t}function lI(e){e=v(e);for(var t=e.next();!t.done;t=e.next()){var n=t.value;if((t=n.getAttribute("schemeIdUri"))&&(n=n.getAttribute("value")))switch(t){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(t=parseInt(n,10),!t)continue;return t;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(t=parseInt(n,16),!t)continue;for(e=0;t;)t&1&&++e,t>>=1;return e;case"urn:mpeg:mpegB:cicp:ChannelConfiguration":if(t=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(n=parseInt(n,10))&&0t.length||t[0]!="data")throw new F(2,1,1004,e);if(t=t.slice(1).join(":").split(","),2>t.length)throw new F(2,1,1004,e);var n=t[0];e=o.decodeURIComponent(t.slice(1).join(",")),t=n.split(";"),n=t[0];var r=!1;1e.I))for(t=v(t),a=t.next();!a.done;a=t.next())n=a.value,(r=n.stream.segmentIndex)&&(r.g.splice(0,e.I-n.qe),(r=r.g[0]||null)&&(r=-r.startTime,n.stream.segmentIndex.offset(r),Ay(e,n,r)))}function xI(e,t){if(e.V==1/0){t=v(t);for(var n=t.next();!n.done;n=t.next()){var r=n.value.stream.segmentIndex.g[0]||null;r!=null&&r.ca!=null&&(e.V=Math.min(e.V,r.ca))}}if(t=e.V,t!=1/0)for(r=v(e.h.values()),n=r.next();!n.done;n=r.next()){n=n.value;var a=n.stream.segmentIndex;if(a!=null){var l=a.g[0]||null;if(l.ca==null)Te("Missing EXT-X-PROGRAM-DATE-TIME for stream",n.Z(),"Expect AV sync issues!");else for(Ay(e,n,l.ca-t-l.startTime),n=v(a),a=n.next();!a.done;a=n.next())a.value.tf(t)}}}function Ay(e,t,n){t.Sb+=n,t.rb+=n,e=_d(e,t);for(var r=v(e),a=r.next();!a.done;a=r.next()){var l=v(a.value);a=l.next().value,l=l.next().value,e.set(a,l+n)}t.Z()}function SI(e,t,n){var r,a,l,f,c,p,m,g,S,T,w,A,M,R,D,_,B,U,z,W,se,Z,J,ce,me,xe,Ie,Me,_e,Be;return j(function(Ee){switch(Ee.g){case 1:return r=kd(e.za,t),a=xi(r.g,"EXT-X-DEFINE"),l=[],f=[],c=[],r.type==1?(M=function(){return[n]},E(Ee,ky(e,r,M),6)):(wI(e,a),p=xi(r.g,"EXT-X-MEDIA"),m=xi(r.g,"EXT-X-STREAM-INF"),g=xi(r.g,"EXT-X-IMAGE-STREAM-INF"),S=xi(r.g,"EXT-X-I-FRAME-STREAM-INF"),T=xi(r.g,"EXT-X-SESSION-KEY"),w=xi(r.g,"EXT-X-SESSION-DATA"),A=xi(r.g,"EXT-X-CONTENT-STEERING"),CI(e,w),E(Ee,II(e,A),4));case 4:return TI(e,m),_I(e,p),l=kI(e,m,T,p),f=EI(e,p),E(Ee,bI(e,g,S),5);case 5:c=Ee.h,Ee.B(3);break;case 6:return R=Ee.h,D=R.type,_=R.mimeType,B=R.codecs,U=R.language,z=R.height,W=R.width,se=R.channelCount,Z=R.sampleRate,J=R.closedCaptions,E(Ee,Uy(e,e.u++,r,M,n,B,D,U,!0,"Media Playlist",se,J,null,!1,Z,!1,_),7);case 7:ce=Ee.h,e.h.set(n,ce),D=="video"&&Wy(ce.stream,W,z,null,null,null),l.push({id:0,language:Ze(U||"und"),disabledUntilTime:0,primary:!0,audio:D=="audio"?ce.stream:null,video:D=="video"?ce.stream:null,bandwidth:ce.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!e.i)throw new F(2,7,7001);if(e.l=new je(null,0),e.l.pc(!0),r.type==1&&(An(e)&&(Vy(e,r),me=e.m,e.s.U(me)),xe=Array.from(e.h.values()),Nd(e,xe),Ld(e)),e.C={presentationTimeline:e.l,variants:l,textStreams:f,imageStreams:c,offlineSessionIds:[],minBufferTime:0,sequenceMode:e.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:e.g.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null},e.da||!e.g.hls.disableCodecGuessing){Ee.B(8);break}for(Ie=[],Me=v(e.C.variants),_e=Me.next();!_e.done;_e=Me.next())Be=_e.value,Be.audio&&Be.audio.codecs===""&&Ie.push(Be.audio.createSegmentIndex()),Be.video&&Be.video.codecs===""&&Ie.push(Be.video.createSegmentIndex());return E(Ee,Promise.all(Ie),8);case 8:e.i.makeTextStreamsForClosedCaptions(e.C),H(Ee)}})}function ky(e,t,n){var r,a,l,f,c,p,m,g,S,T,w,A,M,R,D,_,B,U;return j(function(z){switch(z.g){case 1:if(r=by(e.g.hls.mediaPlaylistFullMimeType),!t.segments.length)return z.return(r);if(a=Math.trunc((t.segments.length-1)/2),l=t.segments[a],f=jo(n(),t.segments[0].h),c=f[0],p=new It(c),m=p.Ga.split(".").pop(),g=$y[m])return z.return(by(g));if(S=Ii,T=null,w=Hy(e,t,l.g,n),e.W.clear(),!w){z.B(2);break}return A=El(w.Z(),w.ic(),w.fc(),e.g.retryParameters),E(z,Vr(e,A,S,{type:0}),3);case 3:M=z.h,T=M.data;case 2:return R=Ft(f,e.g.retryParameters),E(z,Vr(e,R,S,{type:1}),4);case 4:if(D=z.h,(_=D.headers["content-type"])&&(_=_.split(";")[0].toLowerCase()),m=="ts"||_=="video/mp2t"){var W=D.data,se=Fe(W);se=new st().parse(se);var Z=se.Pc();se=se.Je();var J=[],ce=!1,me=!1;switch(Z.audio){case"aac":J.push("mp4a.40.2"),ce=!0;break;case"mp3":J.push("mp4a.40.34"),ce=!0;break;case"ac3":J.push("ac-3"),ce=!0;break;case"ec3":J.push("ec-3"),ce=!0}switch(Z.video){case"avc":se.ha?J.push(se.ha):J.push("avc1.42E01E"),me=!0;break;case"hvc":se.ha?J.push(se.ha):J.push("hvc1.1.6.L93.90"),me=!0}if(J.length){if(Z=ce&&!me,ce=new Map,me){me=new In("video/mp2t"),me.i(W),W=v(me.j());for(var xe=W.next();!xe.done;xe=W.next())xe=xe.value,ce.set(xe,xe);me.h()}se={type:Z?"audio":"video",mimeType:"video/mp2t",codecs:J.join(", "),language:null,height:se.height,width:se.width,channelCount:null,sampleRate:null,closedCaptions:ce}}else se=null;if(B=se)return z.return(B)}else if((m=="mp4"||m=="cmfv"||m=="m4s"||_=="video/mp4"||_=="audio/mp4"||_=="video/iso.segment")&&(U=mI(T,D.data)))return z.return(U);return z.return(r)}})}function Ld(e){if(An(e)){if(e.ea==hu){var t=PI(e);e.g.hls.useSafariBehaviorForLive&&(t=e.l.o),isNaN(e.g.availabilityWindowOverride)||(t=e.g.availabilityWindowOverride),e.l.Xd(t)}if(!e.l.m){t=Array.from(e.h.values()).filter(function(r){return r.stream.segmentIndex}),t=v(t);for(var n=t.next();!n.done;n=t.next())n=n.value,(n.type=="audio"||n.type=="video")&&(n=n.stream.segmentIndex.get(0))&&n.ca&&e.l.qf(n.ca)}}else e.l.Pa(Dy(e));e.l.Nd()}function wI(e,t){var n=new It(e.Y).g;t=v(t);for(var r=t.next();!r.done;r=t.next()){var a=r.value;r=Ae(a,"NAME");var l=Ae(a,"VALUE");a=Ae(a,"QUERYPARAM"),r&&l&&(e.o.has(r)||e.o.set(r,l)),a&&(r=n.get(a)[0])&&!e.o.has(r)&&e.o.set(a,r)}}function My(e,t,n){n=new It(n).g;var r=new Map;t=v(t);for(var a=t.next();!a.done;a=t.next()){var l=a.value,f=Ae(l,"NAME"),c=Ae(l,"VALUE");a=Ae(l,"QUERYPARAM"),l=Ae(l,"IMPORT"),f&&c&&(r.has(f)||r.set(f,c)),a&&(f=n.get(a)[0])&&!r.has(f)&&r.set(a,f),l&&(a=e.o.get(l))&&r.set(l,a)}return r}function TI(e,t){t=v(t);for(var n=t.next();!n.done;n=t.next()){var r=n.value,a=Ae(r,"AUDIO");n=Ae(r,"VIDEO");var l=Ae(r,"SUBTITLES");if(r=Ry(e,r),l){var f=gn(Ye,r);e.G.set(l,f),hi(r,f)}a&&(l=gn("audio",r),l||(l=e.g.hls.defaultAudioCodec),e.G.set(a,l)),n&&(a=gn("video",r),a||(a=e.g.hls.defaultVideoCodec),e.G.set(n,a))}}function CI(e,t){t=v(t);for(var n=t.next();!n.done;n=t.next()){var r=n.value,a=Ae(r,"DATA-ID");n=Ae(r,"URI");var l=Ae(r,"LANGUAGE");r=Ae(r,"VALUE"),a=new Map().set("id",a),n&&a.set("uri",jo([e.Y],n,e.o)[0]),l&&a.set("language",l),r&&a.set("value",r),n=new Ne("sessiondata",a),e.i&&e.i.onEvent(n)}}function II(e,t){var n,r,a,l,f,c;return j(function(p){if(!e.i||!e.g)return p.return();for(r=v(t),a=r.next();!a.done;a=r.next())if(l=a.value,f=Ae(l,"PATHWAY-ID"),c=Ae(l,"SERVER-URI"),f&&c){e.j=new Js(e.i),e.j.configure(e.g),e.j.j=[e.Y],e.j.setManifestType("HLS"),e.j.h=f,n=ea(e.j,c);break}return E(p,n,0)})}function EI(e,t){var n=wy(t,"SUBTITLES");t=n.map(function(f){if(e.g.disableText)return null;try{return Py(e,[f],new Map).stream}catch(c){if(e.g.hls.ignoreTextStreamFailures)return null;throw c}}),n=v(n);for(var r=n.next();!r.done;r=n.next()){var a=Tt(r.value,"GROUP-ID");if((r=e.G.get(a))&&(a=e.H.get(a))){a=v(a);for(var l=a.next();!l.done;l=a.next())l=l.value,l.stream.codecs=r,l.stream.mimeType=Dd(Ye,r)||Od(Ye)}}return t.filter(function(f){return f})}function bI(e,t,n){var r,a;return j(function(l){return l.g==1?(r=t.map(function(f){var c,p;return j(function(m){if(m.g==1)return e.g.disableThumbnails?m.return(null):(Q(m,2),E(m,LI(e,f),4));if(m.g!=2)return c=m.h,m.return(c.stream);if(p=q(m),e.g.hls.ignoreImageStreamFailures)return m.return(null);throw p})}).concat(n.map(function(f){if(e.g.disableThumbnails)return null;try{var c=Tt(f,"URI"),p=Ae(f,"CODECS")||"";if(e.h.has(c))var m=e.h.get(c);else{var g=Ae(f,"LANGUAGE"),S=Ae(f,"NAME"),T=Ae(f,"CHARACTERISTICS"),w=fu(e,e.u++,[c],p,"image",g,!1,S,null,null,T,!1,null,!1),A=Ae(f,"RESOLUTION"),M=v(A?A.split("x"):[null,null]),R=M.next().value,D=M.next().value;w.stream.width=Number(R)||void 0,w.stream.height=Number(D)||void 0;var _=Ae(f,"BANDWIDTH");_&&(w.stream.bandwidth=Number(_)),e.h.set(c,w),m=w}return f=m,f.stream.codecs!=="mjpg"?null:f.stream}catch(B){if(e.g.hls.ignoreImageStreamFailures)return null;throw B}})),E(l,Promise.all(r),2)):(a=l.h,l.return(a.filter(function(f){return f})))})}function AI(e,t,n){t=t.filter(function(c){var p=Ae(c,"URI")||"";return Ae(c,"TYPE")!="SUBTITLES"&&p!=""});var r={};t=v(t);for(var a=t.next();!a.done;a=t.next()){a=a.value;var l=vy(a);r[l]?r[l].push(a):r[l]=[a]}for(var f in r)Py(e,r[f],n)}function kI(e,t,n,r){var a=[],l=new Set;if(0t-2&&(n=Math.max(1,t-2)),t=e.Aa*n}e.l.qf(0),e.l.ng(t),e.l.pc(!1)}function Hy(e,t,n,r,a){var l=Zt(n,"EXT-X-MAP");if(!l)return null;var f=Tt(l,"URI"),c=jo(r(),f,a);if(f=[c.toString(),Ae(l,"BYTERANGE","")].join("-"),!e.W.has(f)){var p=void 0,m=null;n=v(n);for(var g=n.next();!g.done;g=n.next())g=g.value,g.name=="EXT-X-KEY"?Tt(g,"METHOD")=="AES-128"&&g.idn.byteLength){n=[];break e}var l=Fe(n,e,a);t.push({type:r,value:l}),e+=a}n=t}return n}function pu(e){if(e=Qy(e))e:{e=v(e.getElementsByTagName("DATA"));for(var t=e.next();!t.done;t=e.next())if(t=ni(t.value,"LA_URL")){e=t.textContent;break e}e=""}else e="";return e}function Qy(e){return e=ti(e.textContent),e=zI(e).filter(function(t){return t.type===VI})[0],e?(e=Di(e.value,!0),(e=yr(e,"WRMHEADER"))?e:null):null}var VI=1,HI=new Map().set("com.microsoft.playready",pu).set("com.microsoft.playready.recommendation",pu).set("com.microsoft.playready.software",pu).set("com.microsoft.playready.hardware",pu);function Hr(e){if(!t1){t1=!0;var t=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);gu=Xe("ftyp",t,r,t,n),t=Xe("dref",eE),Bd=Xe("dinf",t)}this.g=e}function Gr(e){for(var t=[],n=v(e.g),r=n.next();!r.done;r=n.next()){var a=t,l=a.push,f=r.value;r=Xe;var c=f.id+1,p=f.stream.width||0,m=f.stream.height||0;f.type=="audio"&&(m=p=0);var g=f.duration*f.timescale,S=Math.floor(g/(uo+1));switch(g=Math.floor(g%(uo+1)),c=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(N(vt(c,4)),[0,0,0,0],N(vt(S,4)),N(vt(g,4)),[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0],N(vt(p,2)),[0,0],N(vt(m,2)),[0,0])),c=Xe("tkhd",c),p=Xe,S=f.duration*f.timescale,m=Math.floor(S/(uo+1)),S=Math.floor(S%(uo+1)),g=f.stream.language,g=g.charCodeAt(0)-96<<10|g.charCodeAt(1)-96<<5|g.charCodeAt(2)-96,m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(N(vt(f.timescale,4)),N(vt(m,4)),N(vt(S,4)),N(vt(g,2)),[0,0])),m=Xe("mdhd",m),S=f,g=new Uint8Array([]),S.type){case"video":g=XI;break;case"audio":g=WI}S=Xe("hdlr",g);e:{switch(f.type){case"video":f=Xe("minf",Xe("vmhd",QI),Bd,Zy(f));break e;case"audio":f=Xe("minf",Xe("smhd",ZI),Bd,Zy(f));break e}f=new Uint8Array([])}f=p("mdia",m,S,f),r=r("trak",c,f),l.call(a,r)}for(t=wt.apply(en,N(t)),l=e.g[0],n=Xe,r=l.duration*l.timescale,a=Math.floor(r/(uo+1)),r=Math.floor(r%(uo+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(N(vt(l.timescale,4)),N(vt(a,4)),N(vt(r,4)),[0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255])),a=Xe("mvhd",a),r=[],e=v(e.g),p=e.next();!p.done;p=e.next())f=r,c=f.push,p=new Uint8Array([0,0,0,0].concat(N(vt(p.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1])),p=Xe("trex",p),c.call(f,p);if(e=wt.apply(en,N(r)),e=Xe("mvex",e),r=[],l.encrypted){for(l=v(l.stream.drmInfos),f=l.next();!f.done;f=l.next())if(f=f.value,f.initData)for(f=v(f.initData),c=f.next();!c.done;c=f.next())r.push(c.value.initData);l=wt.apply(en,N(r))}else l=new Uint8Array([]);return e=n("moov",a,t,e,l),t=new Uint8Array(gu.byteLength+e.byteLength),t.set(gu),t.set(e,gu.byteLength),t}function Zy(e){var t=Xe,n=new Uint8Array([]);switch(e.type){case"video":if(e.codecs.includes("avc1")){n=e.stream.width||0;var r=e.stream.height||0;if(0>8,l[S++]=f[p].length&255,l.set(f[p],S),S+=f[p].length;for(l[S++]=c.length,f=0;f>8,l[S++]=c[f].length&255,l.set(c[f],S),S+=c[f].length;a=a("avcC",l)}n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].concat(N(vt(n,2)),N(vt(r,2)),[0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17])),r="avc1",c=Jy(e),f=new Uint8Array([]),e.encrypted&&(f=aa(e),r="encv"),n=Xe(r,n,a,c,f)}else e.codecs.includes("hvc1")&&(r=e.stream.width||0,a=e.stream.height||0,n=new Uint8Array([]),0>>1,c<<7|a<<3,6,1,2])),n=n("esds",r)),r="mp4a",a=new Uint8Array([]),e.encrypted&&(a=aa(e),r="enca"),e=Xe(r,mu(e),n,a)),n=e}return e=Xe("stsd",JI,n),t("stbl",e,Xe("stts",$I),Xe("stsc",KI),Xe("stsz",qI),Xe("stco",YI))}function Jy(e){if(!e.sa&&!e.ua)return new Uint8Array([]);var t=e.ua;return e=new Uint8Array([].concat(N(vt(e.sa,4)),N(vt(t,4)))),Xe("pasp",e)}function mu(e){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.stream.channelsCount||2,0,16,0,0,0,0].concat(N(vt(e.stream.audioSamplingRate||44100,2)),[0,0]))}function aa(e){for(var t=Xe,n=e.codecs.substring(0,e.codecs.indexOf(".")),r=0,a=0;a>8*t&255);return n}function e1(e){for(var t=new Uint8Array(e.length/2),n=0;n>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(n,4),n=0,r=8;nse)if(Z){if(Z=Ke(Z,"t",un),Z==null)break;if(J>=Z)break;se=Math.ceil((Z-J)/ce)-1}else{if(_==1/0)break;if(J/R>=_)break;se=Math.ceil((_*R-J)/ce)-1}for(Z=0;Z<=se;++Z)z=J+ce,U.push({start:J/R,end:z/R,zf:J}),J=z}for(R=U,D=v(D),_=D.next();!_.done;_=D.next())(_=nE(e,M,_.value,R,A,m))&&(_.type!="audio"||e.g.disableAudio?_.type!="video"||e.g.disableVideo?_.type!=Ye||e.g.disableText||T.push(_):S.push(_):w.push(_))}for(g=[],w=v(0>1,n[1]=r<<7|t<<3|e>>1,n[2]=e<<7|8,n[3]=0,t=new Uint16Array(2),t[0]=(n[0]<<8)+n[1],t[1]=(n[2]<<8)+n[3],t[0].toString(16)+t[1].toString(16)):(n=new Uint8Array(2),n[0]=16|r>>1,n[1]=r<<7|t<<3,t=new Uint16Array(1),t[0]=(n[0]<<8)+n[1],t[0].toString(16))}function oE(e,t){var n=0;return e==="AACH"&&(n=5),t?n===0&&(n=(parseInt(t.substr(0,2),16)&248)>>3):(n=2,e==="AACH"&&(n=5)),"mp4a.40."+n}function rE(e){var t=/00000001[0-9]7/.exec(e);return t.length&&e?"avc1."+e.substr(e.indexOf(t[0])+10,6):""}function sE(e,t,n,r,a){var l=r.getAttribute("Url").replace("{bitrate}",String(n.bandwidth));r=[];var f={};a=v(a);for(var c=a.next();!c.done;f={Bc:f.Bc},c=a.next())f.Bc=c.value,r.push(new Pe(f.Bc.start,f.Bc.end,function(p){return function(){return Qt(e.l,[l.replace("{start time}",String(p.Bc.zf))])}}(f),0,null,t,0,0,n.mssPrivateData.duration));return r}he("shaka.mss.MssParser",jd);var aE="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),lE={CAPT:"main",SUBT:"alternate",DESC:"main"};ii["application/vnd.ms-sstr+xml"]=function(){return new jd};function i1(e,t,n,r,a,l){if(200<=n&&299>=n&&n!=202)return{uri:a||r,originalUri:r,data:t,status:n,headers:e,fromCache:!!e["x-shaka-from-cache"]};a=null;try{a=io(t)}catch{}throw new F(n==401||n==403?2:1,1,1001,r,n,a,e,l)}function zd(){}function yu(e,t,n,r,a){var l=new hE;As(t.headers).forEach(function(m,g){l.append(g,m)});var f=new cE,c={Ff:!1,tg:!1};if(e=uE(e,n,{body:t.body||void 0,headers:l,method:t.method,signal:f.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},c,r,a,t.streamDataCallback),e=new Ct(e,function(){return c.Ff=!0,f.abort(),Promise.resolve()}),t=t.retryParameters.timeout){var p=new $e(function(){c.tg=!0,f.abort()});p.U(t/1e3),e.finally(function(){p.stop()})}return e}function uE(e,t,n,r,a,l,f){var c,p,m,g,S,T,w,A,M,R,D,_,B;return j(function(U){switch(U.g){case 1:return c=fE,p=dE,T=S=0,w=Date.now(),Q(U,2),E(U,c(e,n),4);case 4:if(m=U.h,l(o1(m.headers)),n.method=="HEAD"){U.B(5);break}return A=m.clone().body.getReader(),R=(M=m.headers.get("Content-Length"))?parseInt(M,10):0,D=function(z){function W(){var se,Z;return j(function(J){switch(J.g){case 1:return Q(J,2),E(J,A.read(),4);case 4:se=J.h,ae(J,3);break;case 2:return q(J),J.return();case 3:if(se.done){J.B(5);break}if(S+=se.value.byteLength,!f){J.B(5);break}return E(J,f(se.value),5);case 5:Z=Date.now(),(100t,!p||!m){g.B(3);break}return E(g,l.updateManifestExpiration(r.key(),t),3);case 3:return Y(g),E(g,a.destroy(),10);case 10:K(g,0);break;case 2:q(g),g.B(3)}})},d.onInitialVariantChosen=function(){},d.banLocation=function(){},ii["application/x-offline-manifest"]=function(){return new w1};function T1(){}function C1(e){var t=$d(e);return t&&t.g=="manifest"?(e={uri:e,originalUri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},e=fr(e)):e=t&&t.g=="segment"?NE(t.key(),t):Ao(new F(2,1,9004,e)),e}function NE(e,t){var n=new cn;return fr(void 0).pa(function(){return n.init()}).pa(function(){return wu(n,t.Wa(),t.va())}).pa(function(r){return r.getSegments([t.key()])}).pa(function(r){return{uri:t,data:r[0].data,headers:{}}}).finally(function(){return n.destroy()})}he("shaka.offline.OfflineScheme",T1),T1.plugin=C1,Pi("offline",C1);function I1(e,t,n){var r,a,l,f,c,p;return j(function(m){switch(m.g){case 1:r=[];for(var g=[],S=v(n),T=S.next();!T.done;T=S.next()){T=T.value;for(var w=!1,A=v(g),M=A.next();!M.done;M=A.next())if(M=M.value,DE(M.info,T)){M.sessionIds.push(T.sessionId),w=!0;break}w||g.push({info:T,sessionIds:[T.sessionId]})}a=v(g),l=a.next();case 2:if(l.done){m.B(4);break}return f=l.value,c=PE(e,t,f),E(m,c,5);case 5:p=m.h,r=r.concat(p),l=a.next(),m.B(2);break;case 4:return m.return(r)}})}function PE(e,t,n){var r,a;return j(function(l){switch(l.g){case 1:return r=new hl({Tb:t,onError:function(){},Ud:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),Q(l,2),r.configure(e),E(l,cS(r,n.info.keySystem,n.info.licenseUri,n.info.serverCertificate,n.info.audioCapabilities,n.info.videoCapabilities),4);case 4:ae(l,3);break;case 2:return q(l),E(l,r.destroy(),5);case 5:return l.return([]);case 3:return a=[],E(l,Promise.all(n.sessionIds.map(function(f){return j(function(c){if(c.g==1)return Q(c,2),E(c,pS(r,f),4);if(c.g!=2)return a.push(f),ae(c,0);q(c),H(c)})})),6);case 6:return E(l,r.destroy(),7);case 7:return l.return(a)}})}function DE(e,t){function n(r,a){return r.robustness==a.robustness&&r.contentType==a.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&np(e.audioCapabilities,t.audioCapabilities,n)&&np(e.videoCapabilities,t.videoCapabilities,n)}function OE(e,t,n){var r=t.presentationTimeline.getDuration();return t=E1(t),{offlineUri:null,originalManifestUri:e,duration:r,size:0,expiration:1/0,tracks:t,appMetadata:n,isIncomplete:!1}}function Kd(e,t){var n=S1(new x1(e.Wa(),e.va()),t),r=t.appMetadata||{};return n=E1(n),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:n,appMetadata:r,isIncomplete:t.isIncomplete||!1}}function E1(e){var t=[],n=Ff(e.variants);n=v(n);for(var r=n.next();!r.done;r=n.next())t.push(ar(r.value));for(e=v(e.textStreams),n=e.next();!n.done;n=e.next())t.push(el(n.value));return t}function UE(){this.g={}}function BE(e,t){var n=t.audio,r=t.video;if(n&&!r&&(e.g[n.id]=n.bandwidth||t.bandwidth),!n&&r&&(e.g[r.id]=r.bandwidth||t.bandwidth),n&&r){var a=n.bandwidth||393216,l=r.bandwidth||t.bandwidth-a;0>=l&&(l=t.bandwidth),e.g[n.id]=a,e.g[r.id]=l}}function jE(e,t){e.g[t.id]=t.bandwidth||2048}function b1(e,t){return e=e.g[t],e==null&&(e=0),e}function Ut(e){var t=this;if(e&&e.constructor!=ue)throw new F(2,9,9008);this.g=this.h=null,e?(this.h=e.g,this.g=e.Ob()):(this.h=br(),this.g=new ut),this.i=[],this.j=[];var n=!e;this.l=new dr(function(){var r,a,l,f,c;return j(function(p){switch(p.g){case 1:return E(p,Promise.all(t.j.map(function(m){return Hd(m)})),2);case 2:for(r=function(){},a=[],l=v(t.i),f=l.next();!f.done;f=l.next())c=f.value,a.push(c.then(r,r));return E(p,Promise.all(a),3);case 3:if(!n){p.B(4);break}return E(p,t.g.destroy(),4);case 4:t.h=null,t.g=null,H(p)}})})}function Yd(){if(mi())e:{for(var e=v(fa.values()),t=e.next();!t.done;t=e.next())if(t=t.value,t=t()){t.destroy(),e=!0;break e}e=!1}else e=!1;return e}d=Ut.prototype,d.destroy=function(){return this.l.destroy()},d.configure=function(e,t){return arguments.length==2&&typeof e=="string"&&(e=Dc(e,t)),Ar(this.h,e)},d.getConfiguration=function(){var e=br();return Ar(e,this.h,br()),e},d.Ob=function(){return this.g},d.store=function(e,t,n){var r=this,a=this.getConfiguration(),l=new c1(this.g);return this.j.push(l),t=FE(this,e,t||{},function(){var f;return j(function(c){return c.g==1?n?c.B(2):E(c,bc(e,r.g,a.manifest.retryParameters),3):(c.g!=2&&(n=c.h),f=y0(e,n||null),c.return(f()))})},a,l),t=new Ct(t,function(){return Hd(l)}),t.finally(function(){hi(r.j,l)}),eb(this,t)};function FE(e,t,n,r,a,l){var f,c,p,m,g,S,T,w,A,M,R,D,_,B;return j(function(U){switch(U.g){case 1:return Iu(),c=f=null,p=new cn,S=g=m=null,Q(U,2,3),E(U,r(),5);case 5:return f=U.h,E(U,YE(e,t,f,a),6);case 6:if(T=U.h,$t(e),w=!T.presentationTimeline.R()&&!T.presentationTimeline.Rb(),!w)throw new F(2,9,9005,t);return E(U,qE(e,T,function(z){S=S||z},a),7);case 7:if(c=U.h,$t(e),S)throw S;return E(U,VE(T,c,a),8);case 8:return E(U,p.init(),9);case 9:return $t(e),E(U,m1(p),10);case 10:return m=U.h,$t(e),A=HE(c,T,t,n,a,l),M=A.Ah,R=A.vf,E(U,m.va.addManifests([M]),11);case 11:if(D=U.h,$t(e),g=D[0],$t(e),S)throw S;return E(U,zE(e,R,g,M,l,a,m.va,T,c),12);case 12:return $t(e),R1(T,M,c,a),E(U,m.va.updateManifest(g,M),13);case 13:return $t(e),_=new Ai("manifest",m.path.Wa,m.path.va,g),U.return(Kd(_,M));case 3:return Y(U),E(U,p.destroy(),14);case 14:if(!f){U.B(15);break}return E(U,f.stop(),15);case 15:if(!c){U.B(17);break}return E(U,c.destroy(),17);case 17:K(U,0);break;case 2:if(B=q(U),g==null){U.B(19);break}return E(U,A1(g),19);case 19:throw S||B}})}function zE(e,t,n,r,a,l,f,c,p){var m,g,S,T,w,A,M,R,D,_;return j(function(B){switch(B.g){case 1:if(m={},g=0,S=function(U,z){var W,se,Z,J,ce,me,xe;return j(function(Ie){if(Ie.g==1){for(W={},se=v(U),Z=se.next();!Z.done;W={Ib:W.Ib},Z=se.next())W.Ib=Z.value,J=mE(W.Ib,l),ce=W.Ib.i,me=W.Ib.h,xe=function(Me){return function(_e){var Be,Ee,Mt;return j(function(Vt){if(Vt.g==1)return E(Vt,f.addSegments([{data:_e}]),2);Be=Vt.h,$t(e),Ee=Me.Ib.g,Mt=Vd(Ee),m[Mt]=Be[0],g+=_e.byteLength,H(Vt)})}}(W),yE(a,W.Ib.groupId,J,ce,me,xe);return E(Ie,vE(a),2)}return z?($t(e),R1(c,r,p,l),E(Ie,f.updateManifest(n,r),0)):Ie.B(0)})},T=!1,Q(B,2),!qd(c)||!T||M1(c)){B.B(4);break}return E(B,S(t.filter(function(U){return U.h}),!0),5);case 5:return $t(e),t=t.filter(function(U){return!U.h}),w=m,A=g,m={},g=0,E(B,k1(f,n,r,w,A,function(){return $t(e)}),6);case 6:$t(e);case 4:if(T){B.B(7);break}return E(B,S(t,!1),8);case 8:return $t(e),M=m,R=g,m={},g=0,E(B,k1(f,n,r,M,R,function(){return $t(e)}),9);case 9:$t(e);case 7:ae(B,0);break;case 2:return D=q(B),_=Object.values(m),E(B,f.removeSegments(_,function(){}),10);case 10:throw D}})}function A1(e){var t,n,r,a;return j(function(l){switch(l.g){case 1:return t=new cn,E(l,t.init(),2);case 2:return E(l,m1(t),3);case 3:return n=l.h,r=new Ai("manifest",n.path.Wa,n.path.va,e),E(l,t.destroy(),4);case 4:return a=new Ut,E(l,a.remove(r.toString()),0)}})}function k1(e,t,n,r,a,l){var f,c,p,m,g,S,T,w,A,M,R;return j(function(D){switch(D.g){case 1:for(f=!1,Q(D,2),c=!0,p=v(n.streams),m=p.next();!m.done;m=p.next())for(g=m.value,S=v(g.segments),T=S.next();!T.done;T=S.next())w=T.value,A=w.pendingSegmentRefId?r[w.pendingSegmentRefId]:null,A!=null&&(w.dataKey=A,w.pendingSegmentRefId=void 0),A=w.pendingInitSegmentRefId?r[w.pendingInitSegmentRefId]:null,A!=null&&(w.initSegmentKey=A,w.pendingInitSegmentRefId=void 0),w.pendingSegmentRefId&&(c=!1),w.pendingInitSegmentRefId&&(c=!1);return n.size+=a,c&&(n.isIncomplete=!1),E(D,e.updateManifest(t,n),4);case 4:f=!0,l(),ae(D,0);break;case 2:return M=q(D),E(D,A1(t),5);case 5:if(f){D.B(6);break}return R=Object.values(r),E(D,e.removeSegments(R,function(){}),6);case 6:throw M}})}function VE(e,t,n){var r,a,l,f,c,p,m,g,S,T,w,A,M,R,D,_,B,U,z,W,se,Z,J,ce,me,xe,Ie,Me;return j(function(_e){switch(_e.g){case 1:return r={width:1/0,height:1/0},_2(e,n.restrictions,r),E(_e,Cp(t,e,n.offline.usePersistentLicense),2);case 2:for(a=[],l=n.preferredDecodingAttributes,f=n.preferredVideoCodecs,c=n.preferredAudioCodecs,wp(e,f,c,l),p=v(e.variants),m=p.next();!m.done;m=p.next())g=m.value,a.push(ar(g));for(S=v(e.textStreams),T=S.next();!T.done;T=S.next())w=T.value,a.push(el(w));for(A=v(e.imageStreams),M=A.next();!M.done;M=A.next())R=M.value,a.push(Uf(R));return E(_e,n.offline.trackSelectionCallback(a),3);case 3:for(D=_e.h,_=e.presentationTimeline.getDuration(),B=0,U=v(D),z=U.next();!z.done;z=U.next())W=z.value,se=W.bandwidth*_/8,B+=se;return Q(_e,4),E(_e,n.offline.downloadSizeCallback(B),6);case 6:if(Z=_e.h,!Z)throw new F(2,9,9014);ae(_e,5);break;case 4:throw J=q(_e),J instanceof F?J:new F(2,9,9015);case 5:for(ce=new Set,me=new Set,xe=new Set,Ie=v(D),z=Ie.next();!z.done;z=Ie.next())Me=z.value,Me.type=="variant"&&ce.add(Me.id),Me.type=="text"&&me.add(Me.id),Me.type=="image"&&xe.add(Me.id);e.variants=e.variants.filter(function(Be){return ce.has(Be.id)}),e.textStreams=e.textStreams.filter(function(Be){return me.has(Be.id)}),e.imageStreams=e.imageStreams.filter(function(Be){return xe.has(Be.id)}),ib(e),H(_e)}})}function HE(e,t,n,r,a,l){var f=OE(n,t,r),c=a.offline.progressCallback;gE(l,function(w,A){f.size=A,c(f,w)},function(w,A){p&&a.offline.usePersistentLicense&&m==A&&Rs(e,"cenc",w)});var p=qd(t)&&!M1(t),m=null;p&&(m=ob.get(e.g.keySystem));for(var g=new UE,S=v(t.textStreams),T=S.next();!T.done;T=S.next())g.g[T.value.id]=52;for(S=v(t.imageStreams),T=S.next();!T.done;T=S.next())jE(g,T.value);for(T=v(t.variants),S=T.next();!S.done;S=T.next())BE(g,S.value);return g=QE(l,g,t,a),l=g.streams,g=g.vf,T=e.g,S=a.offline.usePersistentLicense,T&&S&&(T.initData=[]),{Ah:{creationTime:Date.now(),originalManifestUri:n,duration:t.presentationTimeline.getDuration(),size:0,expiration:e.Qc(),streams:l,sessionIds:S?l0(e):[],drmInfo:T,appMetadata:r,isIncomplete:!0,sequenceMode:t.sequenceMode,type:t.type},vf:g}}function qd(e){return e.variants.some(function(t){var n=t.audio&&t.audio.encrypted;return t.video&&t.video.encrypted||n})}function M1(e){return e.variants.some(function(t){return(t.video?t.video.drmInfos:[]).concat(t.audio?t.audio.drmInfos:[]).some(function(n){return n.initData&&n.initData.length})})}function R1(e,t,n,r){if(t.expiration=n.Qc(),n=l0(n),t.sessionIds=r.offline.usePersistentLicense?n:[],qd(e)&&r.offline.usePersistentLicense&&!n.length)throw new F(2,9,9007)}d.remove=function(e){return Qd(this,GE(this,e))};function GE(e,t){var n,r,a,l,f,c;return j(function(p){switch(p.g){case 1:if(Iu(),n=$d(t),n==null||n.g!="manifest")throw new F(2,9,9004,t);return r=n,a=new cn,ge(p,2),E(p,a.init(),4);case 4:return E(p,wu(a,r.Wa(),r.va()),5);case 5:return l=p.h,E(p,l.getManifests([r.key()]),6);case 6:return f=p.h,c=f[0],E(p,Promise.all([XE(e,c,a),WE(l,r,c)]),2);case 2:return Y(p),E(p,a.destroy(),8);case 8:K(p,0)}})}function _1(e,t){for(var n=[],r=v(e.streams),a=r.next();!a.done;a=r.next())a=a.value,t&&a.type=="video"?n.push({contentType:En(a.mimeType,a.codecs),robustness:e.drmInfo.videoRobustness}):t||a.type!="audio"||n.push({contentType:En(a.mimeType,a.codecs),robustness:e.drmInfo.audioRobustness});return n}function XE(e,t,n){return j(function(r){return E(r,nb(e.g,e.h.drm,n,t),0)})}function WE(e,t,n){function r(){}var a=tb(n);return Kd(t,n),Promise.all([e.removeSegments(a,r),e.removeManifests([t.key()],r)])}d.Oh=function(){return Qd(this,$E(this))};function $E(e){var t,n,r,a,l,f,c,p,m,g;return j(function(S){switch(S.g){case 1:return Iu(),t=e.g,n=e.h.drm,r=new cn,a=!1,ge(S,2),E(S,r.init(),4);case 4:l=[],TE(r,function(T){return l.push(T)}),f=v(l),c=f.next();case 5:if(c.done){S.B(2);break}return p=c.value,E(S,p.getAll(),8);case 8:return m=S.h,E(S,I1(n,t,m),9);case 9:return g=S.h,E(S,p.remove(g),10);case 10:g.length!=m.length&&(a=!0),c=f.next(),S.B(5);break;case 2:return Y(S),E(S,r.destroy(),11);case 11:K(S,3);break;case 3:return S.return(!a)}})}d.list=function(){return Qd(this,KE())};function KE(){var e,t,n;return j(function(r){switch(r.g){case 1:return Iu(),e=[],t=new cn,ge(r,2),E(r,t.init(),4);case 4:return n=Promise.resolve(),wE(t,function(a,l){n=n.then(function(){var f;return j(function(c){if(c.g==1)return E(c,l.getAllManifests(),2);f=c.h,f.forEach(function(p,m){p=Kd(new Ai("manifest",a.Wa,a.va,m),p),e.push(p)}),H(c)})})}),E(r,n,2);case 2:return Y(r),E(r,t.destroy(),6);case 6:K(r,3);break;case 3:return r.return(e)}})}function YE(e,t,n,r){var a,l,f,c,p;return j(function(m){if(m.g==1)return a=null,l=e.g,f={networkingEngine:l,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(g){a=g},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return r.abr.defaultBandwidthEstimate}},n.configure(r.manifest),$t(e),E(m,n.start(t,f),2);if(m.g!=3)return c=m.h,$t(e),p=L1(c),E(m,Promise.all(Xf(p,function(g){return g.createSegmentIndex()})),3);if($t(e),a)throw a;return m.return(c)})}function qE(e,t,n,r){var a;return j(function(l){return l.g==1?(a=new hl({Tb:e.g,onError:n,Ud:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),a.configure(r.drm),E(l,fS(a,t.variants,r.offline.usePersistentLicense),2)):l.g!=3?E(l,s0(a),3):l.return(a)})}function QE(e,t,n,r){var a=new Map,l=L1(n),f=new Map;l=v(l);for(var c=l.next();!c.done;c=l.next()){c=c.value;var p=ZE(e,t,n,c,r,a);f.set(c.id,p)}for(e=v(n.variants),t=e.next();!t.done;t=e.next())t=t.value,t.audio&&f.get(t.audio.id).variantIds.push(t.id),t.video&&f.get(t.video.id).variantIds.push(t.id);return{streams:Array.from(f.values()),vf:Array.from(a.values())}}function ZE(e,t,n,r,a,l){var f={id:r.id,originalId:r.originalId,groupId:r.groupId,primary:r.primary,type:r.type,mimeType:r.mimeType,codecs:r.codecs,frameRate:r.frameRate,pixelAspectRatio:r.pixelAspectRatio,hdr:r.hdr,videoLayout:r.videoLayout,kind:r.kind,language:r.language,originalLanguage:r.originalLanguage,label:r.label,width:r.width||null,height:r.height||null,encrypted:r.encrypted,keyIds:r.keyIds,segments:[],variantIds:[],roles:r.roles,forced:r.forced,channelsCount:r.channelsCount,audioSamplingRate:r.audioSamplingRate,spatialAudio:r.spatialAudio,closedCaptions:r.closedCaptions,tilesLayout:r.tilesLayout,external:r.external,fastSwitching:r.fastSwitching},c=a.offline.numberOfParallelDownloads,p=0;return JE(r,n.presentationTimeline.eb(),function(m){var g=Vd(m),S=void 0;if(!l.has(g)){var T=m.endTime-m.startTime;T=b1(t,r.id)*T,T=f1(e.g,T),l.set(g,new l1(m,T,p,!1))}m.aa&&(S=Vd(m.aa),l.has(S)||(T=.5*b1(t,r.id),T=f1(e.g,T),l.set(S,new l1(m.aa,T,p,!0)))),f.segments.push({pendingInitSegmentRefId:S,initSegmentKey:S?0:null,startTime:m.startTime,endTime:m.endTime,appendWindowStart:m.appendWindowStart,appendWindowEnd:m.appendWindowEnd,timestampOffset:m.timestampOffset,tilesLayout:m.tilesLayout,pendingSegmentRefId:g,dataKey:0}),p=(p+1)%c}),f}function JE(e,t,n){if(t=e.segmentIndex.find(t),t!=null)for(var r=e.segmentIndex.get(t);r;)n(r),r=e.segmentIndex.get(++t)}function $t(e){if(e.l.g)throw new F(2,9,7001)}function Iu(){if(!Yd())throw new F(2,9,9e3)}function Qd(e,t){return j(function(n){return n.g==1?(e.i.push(t),ge(n,2),E(n,t,4)):n.g!=2?n.return(n.h):(Y(n),hi(e.i,t),K(n,0))})}function eb(e,t){var n=t.promise;return e.i.push(n),t.finally(function(){hi(e.i,n)})}function tb(e){var t=new Set;e=v(e.streams);for(var n=e.next();!n.done;n=e.next()){n=v(n.value.segments);for(var r=n.next();!r.done;r=n.next())r=r.value,r.initSegmentKey!=null&&t.add(r.initSegmentKey),t.add(r.dataKey)}return Array.from(t)}function nb(e,t,n,r){var a,l,f;return j(function(c){return c.g==1?r.drmInfo?(a=CE(n),l=r.sessionIds.map(function(p){return{sessionId:p,keySystem:r.drmInfo.keySystem,licenseUri:r.drmInfo.licenseServerUri,serverCertificate:r.drmInfo.serverCertificate,audioCapabilities:_1(r,!1),videoCapabilities:_1(r,!0)}}),E(c,I1(t,e,l),2)):c.return():c.g!=3?(f=c.h,E(c,a.remove(f),3)):E(c,a.add(l.filter(function(p){return!f.includes(p.sessionId)})),0)})}function L1(e){for(var t=new Set,n=v(e.textStreams),r=n.next();!r.done;r=n.next())t.add(r.value);for(n=v(e.imageStreams),r=n.next();!r.done;r=n.next())t.add(r.value);for(e=v(e.variants),n=e.next();!n.done;n=e.next())n=n.value,n.audio&&t.add(n.audio),n.video&&t.add(n.video);return t}function ib(e){e.variants.map(function(l){return l.video});var t=new Set(e.variants.map(function(l){return l.audio}));e=e.textStreams;for(var n=v(t),r=n.next();!r.done;r=n.next()){r=v(t);for(var a=r.next();!a.done;a=r.next());}for(t=v(e),n=t.next();!n.done;n=t.next())for(n=v(e),r=n.next();!r.done;r=n.next());}he("shaka.offline.Storage",Ut),Ut.deleteAll=function(){var e;return j(function(t){return t.g==1?(e=new cn,ge(t,2),E(t,IE(e),2)):t.g!=5?(Y(t),E(t,e.destroy(),5)):K(t,0)})},Ut.prototype.list=Ut.prototype.list,Ut.prototype.removeEmeSessions=Ut.prototype.Oh,Ut.prototype.remove=Ut.prototype.remove,Ut.prototype.store=Ut.prototype.store,Ut.prototype.getNetworkingEngine=Ut.prototype.Ob,Ut.prototype.getConfiguration=Ut.prototype.getConfiguration,Ut.prototype.configure=Ut.prototype.configure,Ut.prototype.destroy=Ut.prototype.destroy,Ut.support=Yd;var ob=new Map().set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.adobe.primetime","f239e769efa348509c16a903c6932efb");Qc.offline=Yd;function zt(){}function nn(e,t){for(e={priority:t||0,callback:e},t=0;t=e?o.MediaSource=null:12>=e?(G1(),ab()):15>=e&&G1():Pf()?X1():(Ka()||$a()||xt("Tizen 4"))&&lb()),o.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&ub()}function G1(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,ye.apply(0,arguments));return t.abort=function(){},t}}function ab(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}function X1(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return t.split(";")[0].split("/")[1]!="mp2t"&&e(t)}}function lb(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return pi(t)!="opus"&&e(t)}}function ub(){var e=MediaSource.isTypeSupported;xt("Web0S")||(MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */),r=n.findIndex(function(f){return f.startsWith("codecs=")});if(0>r)return e(t);var a=n[r].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),l=a.findIndex(function(f){return f.startsWith("vp09")});return 0<=l&&(a[l]="vp9",n[r]='codecs="'+a.join(",")+'"',t=n.join("; ")),e(t)})}zt.MediaSource=V1,V1.install=H1,nn(H1);function W1(){}function $1(){screen.orientation&&screen.orientation.unlock||(screen.orientation!=null?fb():o.orientation!=null&&cb())}function fb(){screen.orientation.lock===void 0&&(screen.orientation.lock=function(){return Promise.resolve()}),screen.orientation.unlock===void 0&&(screen.orientation.unlock=function(){})}function cb(){function e(){switch(o.orientation){case-90:t.type="landscape-secondary",t.angle=270;break;case 0:t.type="portrait-primary",t.angle=0;break;case 90:t.type="landscape-primary",t.angle=90;break;case 180:t.type="portrait-secondary",t.angle=180}}var t=new ku;screen.orientation=t,e(),o.addEventListener("orientationchange",function(){e();var n=new Ne("change");t.dispatchEvent(n)})}zt.Orientation=W1,W1.install=$1;function ku(){Je.call(this),this.type="",this.angle=0}le(ku,Je),ku.prototype.lock=function(e){function t(r){return screen.lockOrientation?screen.lockOrientation(r):screen.mozLockOrientation?screen.mozLockOrientation(r):screen.msLockOrientation?screen.msLockOrientation(r):!1}var n=!1;switch(e){case"natural":n=t("default");break;case"any":n=!0,this.unlock();break;default:n=t(e)}return n?Promise.resolve():(e=Error("screen.orientation.lock() is not available on this device"),e.name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,Promise.reject(e))},ku.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()},nn($1);function Zd(){}var Jd,eh,th,nh,ih,oh;function db(e,t){try{var n=new Mu(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function hb(e){var t=this.mediaKeys;return t&&t!=e&&K1(t,null),delete this.mediaKeys,(this.mediaKeys=e)?K1(e,this):Promise.resolve()}function pb(e){if(e=Fe(e.initData),mn(e).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");e=Di(e.subarray(4),!0),e=Oi(e);var t=new Event("encrypted");t.initDataType="skd",t.initData=On(e),this.dispatchEvent(t)}zt.PatchedMediaKeysApple=Zd,Zd.uninstall=function(){Jd&&(Jd=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",eh),HTMLMediaElement.prototype.setMediaKeys=th,o.MediaKeys=nh,o.MediaKeySystemAccess=ih,navigator.requestMediaKeySystemAccess=oh,eh=oh=th=ih=nh=null,o.shakaMediaKeysPolyfill=!1)},Zd.install=function(e){o.HTMLVideoElement&&o.WebKitMediaKeys&&(e!==void 0&&e&&(Jd=!0,eh=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),th=HTMLMediaElement.prototype.setMediaKeys,nh=o.MediaKeys,ih=o.MediaKeySystemAccess,oh=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=hb,o.MediaKeys=pa,o.MediaKeySystemAccess=Mu,navigator.requestMediaKeySystemAccess=db,o.shakaMediaKeysPolyfill=!0)};function Mu(e,t){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(e=v(t),t=e.next();!t.done;t=e.next()){var n=t.value;if(n.persistentState=="required")t=null;else{t={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:n.initDataTypes,sessionTypes:["temporary"],label:n.label};var r=!1,a=!1;if(n.audioCapabilities)for(var l=v(n.audioCapabilities),f=l.next();!f.done;f=l.next())f=f.value,f.contentType&&(r=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(t.audioCapabilities.push(f),a=!0));if(n.videoCapabilities)for(n=v(n.videoCapabilities),f=n.next();!f.done;f=n.next())l=f.value,l.contentType&&(r=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,l.contentType.split(";")[0])&&(t.videoCapabilities.push(l),a=!0));r||(a=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),t=a?t:null}if(t){this.g=t;return}}throw e=Error("Unsupported keySystem"),e.name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}Mu.prototype.createMediaKeys=function(){var e=new pa(this.keySystem);return Promise.resolve(e)},Mu.prototype.getConfiguration=function(){return this.g};function pa(e){this.h=new WebKitMediaKeys(e),this.g=new ft}pa.prototype.createSession=function(e){if(e=e||"temporary",e!="temporary")throw new TypeError("Session type "+e+" is unsupported on this platform.");return new rh(this.h)},pa.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function K1(e,t){if(e.g.Za(),!t)return Promise.resolve();e.g.D(t,"webkitneedkey",pb);try{return Tr(t,HTMLMediaElement.HAVE_METADATA,e.g,function(){t.webkitSetMediaKeys(e.h)}),Promise.resolve()}catch(n){return Promise.reject(n)}}pa.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function rh(e){Je.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new ft,this.sessionId="",this.expiration=NaN,this.closed=new pt,this.keyStatuses=new Y1}le(rh,Je),d=rh.prototype,d.generateRequest=function(e,t){var n=this;this.h=new pt;try{var r=this.l.createSession("video/mp4",Fe(t));this.i=r,this.sessionId=r.sessionId||"",this.j.D(this.i,"webkitkeymessage",function(a){n.h&&(n.h.resolve(),n.h=null),a=new Map().set("messageType",n.keyStatuses.Pb()==null?"license-request":"license-renewal").set("message",On(a.message)),a=new Ne("message",a),n.dispatchEvent(a)}),this.j.D(r,"webkitkeyadded",function(){n.g&&(Ru(n,"usable"),n.g.resolve(),n.g=null)}),this.j.D(r,"webkitkeyerror",function(){var a=Error("EME PatchedMediaKeysApple key error");if(a.errorCode=n.i.error,n.h!=null)n.h.reject(a),n.h=null;else if(n.g!=null)n.g.reject(a),n.g=null;else switch(n.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:Ru(n,"output-not-allowed");break;default:Ru(n,"internal-error")}}),Ru(this,"status-pending")}catch(a){this.h.reject(a)}return this.h},d.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},d.update=function(e){this.g=new pt;try{this.i.update(Fe(e))}catch(t){this.g.reject(t)}return this.g},d.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Za()}catch(e){this.closed.reject(e)}return this.closed},d.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function Ru(e,t){var n=e.keyStatuses;n.size=t==null?0:1,n.g=t,t=new Ne("keystatuseschange"),e.dispatchEvent(t)}function Y1(){this.size=0,this.g=void 0}d=Y1.prototype,d.Pb=function(){return this.g},d.forEach=function(e){this.g&&e(this.g,pl.value())},d.get=function(e){if(this.has(e))return this.g},d.has=function(e){var t=pl.value();return!!(this.g&&Ji(e,t))},d.entries=function(){},d.keys=function(){},d.values=function(){};function q1(){}function Q1(){!o.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=mb,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=gb,o.MediaKeys=_u,o.MediaKeySystemAccess=sh,o.shakaMediaKeysPolyfill=!0)}function mb(){return Promise.reject(Error("The key system specified is not supported."))}function gb(e){return e==null?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}zt.PatchedMediaKeysNop=q1,q1.install=Q1;function _u(){throw new TypeError("Illegal constructor.")}_u.prototype.createSession=function(){},_u.prototype.setServerCertificate=function(){},_u.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function sh(){throw this.keySystem="",new TypeError("Illegal constructor.")}sh.prototype.getConfiguration=function(){},sh.prototype.createMediaKeys=function(){},nn(Q1,-10);function Z1(){}function J1(){if(!(!o.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)ch="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=yb,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=vb,o.MediaKeys=ma,o.MediaKeySystemAccess=Lu,o.shakaMediaKeysPolyfill=!0}}function ah(e){var t=ch;return t?t+e.charAt(0).toUpperCase()+e.slice(1):e}function yb(e,t){try{var n=new Lu(e,t);return Promise.resolve(n)}catch(r){return Promise.reject(r)}}function vb(e){var t=this.mediaKeys;return t&&t!=e&&ev(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&ev(e,this),Promise.resolve()}zt.PatchedMediaKeysWebkit=Z1,Z1.install=J1;function Lu(e,t){this.g=this.keySystem=e;var n=!1;e=="org.w3.clearkey"&&(this.g="webkit-org.w3.clearkey",n=!1);var r=!1,a=document.getElementsByTagName("video");a=a.length?a[0]:document.createElement("video"),t=v(t);for(var l=t.next();!l.done;l=t.next()){l=l.value;var f={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:l.initDataTypes,sessionTypes:["temporary"],label:l.label},c=!1;if(l.audioCapabilities)for(var p=v(l.audioCapabilities),m=p.next();!m.done;m=p.next())m=m.value,m.contentType&&(c=!0,a.canPlayType(m.contentType.split(";")[0],this.g)&&(f.audioCapabilities.push(m),r=!0));if(l.videoCapabilities)for(p=v(l.videoCapabilities),m=p.next();!m.done;m=p.next())m=m.value,m.contentType&&(c=!0,a.canPlayType(m.contentType,this.g)&&(f.videoCapabilities.push(m),r=!0));if(c||(r=a.canPlayType("video/mp4",this.g)||a.canPlayType("video/webm",this.g)),l.persistentState=="required"&&(n?(f.persistentState="required",f.sessionTypes=["persistent-license"]):r=!1),r){this.h=f;return}}throw n="Unsupported keySystem",(e=="org.w3.clearkey"||e=="com.widevine.alpha")&&(n="None of the requested configurations were supported."),e=Error(n),e.name="NotSupportedError",e.code=DOMException.NOT_SUPPORTED_ERR,e}Lu.prototype.createMediaKeys=function(){var e=new ma(this.g);return Promise.resolve(e)},Lu.prototype.getConfiguration=function(){return this.h};function ma(e){this.l=e,this.h=null,this.g=new ft,this.i=[],this.j=new Map}function ev(e,t){e.h=t,e.g.Za();var n=ch;t&&(e.g.D(t,n+"needkey",function(r){var a=new CustomEvent("encrypted");a.initDataType="cenc",a.initData=On(r.initData),e.h.dispatchEvent(a)}),e.g.D(t,n+"keymessage",function(r){var a=lh(e,r.sessionId);a&&(r=new Map().set("messageType",a.keyStatuses.Pb()==null?"licenserequest":"licenserenewal").set("message",r.message),r=new Ne("message",r),a.h&&(a.h.resolve(),a.h=null),a.dispatchEvent(r))}),e.g.D(t,n+"keyadded",function(r){(r=lh(e,r.sessionId))&&(Nu(r,"usable"),r.g&&r.g.resolve(),r.g=null)}),e.g.D(t,n+"keyerror",function(r){var a=lh(e,r.sessionId);if(a){var l=Error("EME v0.1b key error"),f=r.errorCode;f.systemCode=r.systemCode,l.errorCode=f,!r.sessionId&&a.h?(r.systemCode==45&&(l.message="Unsupported session type."),a.h.reject(l),a.h=null):r.sessionId&&a.g?(a.g.reject(l),a.g=null):(l=r.systemCode,r.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Nu(a,"output-restricted"):l==1?Nu(a,"expired"):Nu(a,"internal-error"))}}))}ma.prototype.createSession=function(e){if(e=e||"temporary",e!="temporary"&&e!="persistent-license")throw new TypeError("Session type "+e+" is unsupported on this platform.");var t=this.h||document.createElement("video");return t.src||(t.src="about:blank"),e=new uh(t,this.l,e),this.i.push(e),e},ma.prototype.setServerCertificate=function(){return Promise.resolve(!1)},ma.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function lh(e,t){var n=e.j.get(t);return n||((n=e.i.shift())?(n.sessionId=t,e.j.set(t,n),n):null)}function uh(e,t,n){Je.call(this),this.j=e,this.m=!1,this.g=this.h=null,this.i=t,this.l=n,this.sessionId="",this.expiration=NaN,this.closed=new pt,this.keyStatuses=new nv}le(uh,Je);function tv(e,t,n){if(e.m)return Promise.reject(Error("The session is already initialized."));e.m=!0;try{if(e.l=="persistent-license")if(n)var r=Fe(Oi("LOAD_SESSION|"+n));else{var a=Oi("PERSISTENT|");r=wt(a,t)}else r=Fe(t)}catch(f){return Promise.reject(f)}e.h=new pt;var l=ah("generateKeyRequest");try{e.j[l](e.i,r)}catch(f){if(f.name!="InvalidStateError")return e.h=null,Promise.reject(f);new $e(function(){try{e.j[l](e.i,r)}catch(c){e.h.reject(c),e.h=null}}).U(.01)}return e.h}function fh(e,t,n){if(e.g)e.g.then(function(){return fh(e,t,n)}).catch(function(){return fh(e,t,n)});else{if(e.g=t,e.i=="webkit-org.w3.clearkey"){var r=mt(n),a=JSON.parse(r);a.keys[0].kty!="oct"&&(e.g.reject(Error("Response is not a valid JSON Web Key Set.")),e.g=null),r=ti(a.keys[0].k),a=ti(a.keys[0].kid)}else r=Fe(n),a=null;var l=ah("addKey");try{e.j[l](e.i,r,a,e.sessionId)}catch(f){e.g.reject(f),e.g=null}}}function Nu(e,t){var n=e.keyStatuses;n.size=t==null?0:1,n.g=t,t=new Ne("keystatuseschange"),e.dispatchEvent(t)}d=uh.prototype,d.generateRequest=function(e,t){return tv(this,t,null)},d.load=function(e){return this.l=="persistent-license"?tv(this,null,e):Promise.reject(Error("Not a persistent session."))},d.update=function(e){var t=new pt;return fh(this,t,e),t},d.close=function(){if(this.l!="persistent-license"){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=ah("cancelKeyRequest");try{this.j[e](this.i,this.sessionId)}catch{}}return this.closed.resolve(),this.closed},d.remove=function(){return this.l!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()};function nv(){this.size=0,this.g=void 0}d=nv.prototype,d.Pb=function(){return this.g},d.forEach=function(e){this.g&&e(this.g,pl.value())},d.get=function(e){if(this.has(e))return this.g},d.has=function(e){var t=pl.value();return!!(this.g&&Ji(e,t))},d.entries=function(){},d.keys=function(){},d.values=function(){};var ch="";nn(J1);function iv(){}function ov(){if(o.HTMLVideoElement){var e=HTMLVideoElement.prototype;e.requestPictureInPicture&&document.exitPictureInPicture||!e.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,e.requestPictureInPicture=Sb,Object.defineProperty(e,"disablePictureInPicture",{get:Tb,set:Cb,enumerable:!0,configurable:!0}),document.exitPictureInPicture=wb,document.addEventListener("webkitpresentationmodechanged",xb,!0))}}function xb(e){if(e=e.target,e.webkitPresentationMode=="picture-in-picture"){document.pictureInPictureElement=e;var t=new Event("enterpictureinpicture");e.dispatchEvent(t)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),t=new Event("leavepictureinpicture"),e.dispatchEvent(t)}function Sb(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function wb(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function Tb(){return this.hasAttribute("disablePictureInPicture")?!0:!this.webkitSupportsPresentationMode("picture-in-picture")}function Cb(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}zt.PiPWebkit=iv,iv.install=ov,nn(ov);function rv(){}function sv(){o.crypto&&("randomUUID"in o.crypto||(o.crypto.randomUUID=Ib))}function Ib(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)}zt.RandomUUID=rv,rv.install=sv,nn(sv);function av(){}function lv(){navigator.storage&&navigator.storage.estimate||!navigator.webkitTemporaryStorage||!navigator.webkitTemporaryStorage.queryUsageAndQuota||("storage"in navigator||(navigator.storage={}),navigator.storage.estimate=Eb)}function Eb(){return new Promise(function(e,t){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(n,r){e({usage:n,quota:r})},t)})}zt.StorageEstimate=av,av.install=lv,nn(lv);function uv(){}function fv(){var e=Symbol.prototype;"description"in e||Object.defineProperty(e,"description",{get:bb})}function bb(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}zt.Symbol=uv,uv.install=fv,nn(fv);function cv(){}function dv(){if(o.HTMLMediaElement){var e=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var t=e.apply(this);return t&&t.catch(function(){}),t}}}zt.VideoPlayPromise=cv,cv.install=dv,nn(dv);function hv(){}function pv(){if(o.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in e||Df())&&(e.getVideoPlaybackQuality=Ab)}}function Ab(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}zt.VideoPlaybackQuality=hv,hv.install=pv,nn(pv);function mv(){}function gv(){if(!o.VTTCue&&o.TextTrackCue){var e=null,t=TextTrackCue.length;if(t==3)e=dh;else if(t==6)e=kb;else{try{var n=!!dh(1,2,"")}catch{n=!1}n&&(e=dh)}e&&(o.VTTCue=function(r,a,l){return e(r,a,l)})}}function dh(e,t,n){return new o.TextTrackCue(e,t,n)}function kb(e,t,n){return new o.TextTrackCue(e+"-"+t+"-"+n,e,t,n)}zt.VTTCue=mv,mv.install=gv,nn(gv);function kn(){}kn.prototype.parseInit=function(){},kn.prototype.setSequenceMode=function(){},kn.prototype.setManifestType=function(){},kn.prototype.parseMedia=function(e,t){var n=null,r=[];e=mt(e).split(/\r?\n/),e=v(e);for(var a=e.next();!a.done;a=e.next())if((a=a.value)&&!/^\s+$/.test(a)&&(a=Mb.exec(a))){var l=Rb.exec(a[1]);l=60*parseInt(l[1],10)+parseFloat(l[2].replace(",",".")),a=new at(l,t.segmentEnd?t.segmentEnd:l+2,a[2]),n&&(n.endTime=l,r.push(n)),n=a}return n&&r.push(n),r},he("shaka.text.LrcTextParser",kn),kn.prototype.parseMedia=kn.prototype.parseMedia,kn.prototype.setManifestType=kn.prototype.setManifestType,kn.prototype.setSequenceMode=kn.prototype.setSequenceMode,kn.prototype.parseInit=kn.prototype.parseInit;var Mb=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,Rb=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;jt["application/x-subtitle-lrc"]=function(){return new kn};function Sn(){}Sn.prototype.parseInit=function(){},Sn.prototype.setSequenceMode=function(){},Sn.prototype.setManifestType=function(){},Sn.prototype.parseMedia=function(e,t,n){var r=mt(e);if(e=[],r=="")return e;var a=yr(r,"tt");if(!a)throw new F(2,2,2005,"Failed to parse TTML.");if(r=a.getElementsByTagName("body")[0],!r)return[];var l=Ei(a,ga,"frameRate"),f=Ei(a,ga,"subFrameRate"),c=Ei(a,ga,"frameRateMultiplier"),p=Ei(a,ga,"tickRate"),m=Ei(a,ga,"cellResolution"),g=a.getAttribute("xml:space")||"default",S=Ei(a,Ou,"extent");if(g!="default"&&g!="preserve")throw new F(2,2,2005,"Invalid xml:space value: "+g);g=g=="default",l=new Nb(l,f,c,p),m=m&&(m=/^(\d+) (\d+)$/.exec(m))?{Kb:parseInt(m[1],10),rows:parseInt(m[2],10)}:null,f=(f=a.getElementsByTagName("metadata")[0])?sS(f):[],c=Array.from(a.getElementsByTagName("style")),a=Array.from(a.getElementsByTagName("region")),p=[];for(var T=v(a),w=T.next();!w.done;w=T.next()){var A=w.value;w=new To;var M=A.getAttribute("xml:id");if(M){w.id=M;var R=null;S&&(R=gh.exec(S)||yh.exec(S)),M=R?Number(R[1]):null,R=R?Number(R[2]):null;var D,_=Pu(A,c,"extent");if(_){var B=(D=gh.exec(_))||yh.exec(_);B!=null&&(w.width=Number(B[1]),w.height=Number(B[2]),D||(M!=null&&(w.width=100*w.width/M),R!=null&&(w.height=100*w.height/R)),w.widthUnits=D||M!=null?Un:0,w.heightUnits=D||R!=null?Un:0)}(A=Pu(A,c,"origin"))&&(B=(D=gh.exec(A))||yh.exec(A),B!=null&&(w.viewportAnchorX=Number(B[1]),w.viewportAnchorY=Number(B[2]),D?_||(w.width=100-w.viewportAnchorX,w.widthUnits=Un,w.height=100-w.viewportAnchorY,w.heightUnits=Un):(R!=null&&(w.viewportAnchorY=100*w.viewportAnchorY/R),M!=null&&(w.viewportAnchorX=100*w.viewportAnchorX/M)),w.viewportAnchorUnits=D||M!=null?Un:0))}else w=null;w&&p.push(w)}if(gt(r,"p").length)throw new F(2,2,2001,"

can only be inside

in TTML");for(S=v(gt(r,"div")),T=S.next();!T.done;T=S.next())if(gt(T.value,"span").length)throw new F(2,2,2001," can only be inside

in TTML");return(t=yv(r,t,l,f,c,a,p,g,m,null,!1,n))&&(t.backgroundColor||(t.backgroundColor="transparent"),e.push(t)),e};function yv(e,t,n,r,a,l,f,c,p,m,g,S){var T=e.parentNode;if(e.nodeType==Node.COMMENT_NODE)return null;if(e.nodeType==Node.TEXT_NODE){if(!g)return null;var w=document.createElement("span");w.textContent=e.textContent}else w=e;for(var A=null,M=v(Av),R=M.next();!R.done&&!(A=Du(w,"backgroundImage",r,"#",R.value)[0]);R=M.next());M=null;var D=Ei(w,Av,"backgroundImage");if(S&&D&&!D.startsWith("#")&&(R=new It(S),D=new It(D),(R=R.resolve(D).toString())&&(M=R)),(e.nodeName=="p"||A||M)&&(g=!0),e=g,R=(w.getAttribute("xml:space")||(c?"default":"preserve"))=="default",D=Array.from(w.childNodes).every(function(z){return z.nodeType==Node.TEXT_NODE}),c=[],!D)for(var _=v(w.childNodes),B=_.next();!B.done;B=_.next())(B=yv(B.value,t,n,r,a,l,f,R,p,w,g,S))&&c.push(B);if(r=m!=null,S=/\S/.test(w.textContent),B=w.hasAttribute("begin")||w.hasAttribute("end")||w.hasAttribute("dur"),!(B||S||w.tagName=="br"||c.length!=0||r&&!R))return null;for(_=Sv(w,n),S=_.start,_=_.end;T&&T.nodeType==Node.ELEMENT_NODE&&T.tagName!="tt";)_=Lb(T,n,S,_),S=_.start,_=_.end,T=T.parentNode;if(S==null&&(S=0),S+=t.periodStart,_=_==null?1/0:_+t.periodStart,S=Math.max(S,t.segmentStart),_=Math.min(_,t.segmentEnd),!B&&0n.length)return l;var f=e;for(e=null;f&&!(e=a?Lo(f,a,t):f.getAttribute(t))&&(f=f.parentNode,f instanceof Element););if(t=e){for(t=v(t.split(" ")),a=t.next();!a.done;a=t.next())for(a=a.value,e=v(n),f=e.next();!f.done;f=e.next())if(f=f.value,r+f.getAttribute("xml:id")==a){l.push(f);break}}return l}function Lb(e,t,n,r){return e=Sv(e,t),n==null?n=e.start:e.start!=null&&(n+=e.start),r==null?r=e.end:e.start!=null&&(r+=e.start),{start:n,end:r}}function Sv(e,t){var n=ph(e.getAttribute("begin"),t),r=ph(e.getAttribute("end"),t);return e=ph(e.getAttribute("dur"),t),r==null&&e!=null&&(r=n+e),{start:n,end:r}}function ph(e,t){var n=null;if(wv.test(e)){e=wv.exec(e),n=Number(e[1]);var r=Number(e[2]),a=Number(e[3]),l=Number(e[4]);l+=(Number(e[5])||0)/t.h,a+=l/t.frameRate,n=a+60*r+3600*n}else if(Tv.test(e))n=mh(Tv,e);else if(Cv.test(e))n=mh(Cv,e);else if(Iv.test(e))e=Iv.exec(e),n=Number(e[1])/t.frameRate;else if(Ev.test(e))e=Ev.exec(e),n=Number(e[1])/t.g;else if(bv.test(e))n=mh(bv,e);else if(e)throw new F(2,2,2001,"Could not parse cue time range in TTML");return n}function mh(e,t){return e=e.exec(t),e==null||e[0]==""?null:(Number(e[4])||0)/1e3+(Number(e[3])||0)+60*(Number(e[2])||0)+3600*(Number(e[1])||0)}he("shaka.text.TtmlTextParser",Sn),Sn.prototype.parseMedia=Sn.prototype.parseMedia,Sn.prototype.setManifestType=Sn.prototype.setManifestType,Sn.prototype.setSequenceMode=Sn.prototype.setSequenceMode,Sn.prototype.parseInit=Sn.prototype.parseInit;function Nb(e,t,n,r){this.frameRate=Number(e)||30,this.h=Number(t)||1,this.g=Number(r),this.g==0&&(this.g=e?this.frameRate*this.h:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=Number(e[1])/Number(e[2]))}var gh=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Pb=/^(\d{1,2}(?:\.\d+)?|100)%$/,Wr=/^(\d+px|\d+em|\d*\.?\d+c)$/,yh=/^(\d+)px (\d+)px$/,wv=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Tv=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Cv=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Iv=/^(\d*(?:\.\d*)?)f$/,Ev=/^(\d*(?:\.\d*)?)t$/,bv=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),Db={left:wo,center:"center",right:"end",start:wo,end:"end"},Ob={left:"line-left",center:"center",right:"line-right"},ga=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],Ou=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],Av=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];jt["application/ttml+xml"]=function(){return new Sn};function on(){this.g=new Sn}on.prototype.parseInit=function(e){var t=!1;if(new lt().box("moov",tt).box("trak",tt).box("mdia",tt).box("minf",tt).box("stbl",tt).O("stsd",pr).box("stpp",function(n){t=!0,n.parser.stop()}).parse(e),!t)throw new F(2,2,2007)},on.prototype.setSequenceMode=function(){},on.prototype.setManifestType=function(){},on.prototype.parseMedia=function(e,t,n){var r=this,a=!1,l=[];if(new lt().box("mdat",mr(function(f){a=!0,l=l.concat(r.g.parseMedia(f,t,n))})).parse(e,!1),!a)throw new F(2,2,2007);return l},he("shaka.text.Mp4TtmlParser",on),on.prototype.parseMedia=on.prototype.parseMedia,on.prototype.setManifestType=on.prototype.setManifestType,on.prototype.setSequenceMode=on.prototype.setSequenceMode,on.prototype.parseInit=on.prototype.parseInit,jt['application/mp4; codecs="stpp"']=function(){return new on},jt['application/mp4; codecs="stpp.ttml"']=function(){return new on},jt['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new on},jt['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new on};function rn(){this.h=!1,this.g="UNKNOWN"}rn.prototype.parseInit=function(){},rn.prototype.setSequenceMode=function(e){this.h=e},rn.prototype.setManifestType=function(e){this.g=e},rn.prototype.parseMedia=function(e,t){e=mt(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,` +`);var n=e.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new F(2,2,2e3);if(e=t.vttOffset,n[0].includes("X-TIMESTAMP-MAP")&&this.h){var r=n[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=n[0].match(/MPEGTS:(\d+)/m);if(r&&a){if(e=Uu(new Fo(r[1])),e==null)throw new F(2,2,2e3);for(a=Number(a[1]),r=t.segmentStart-t.periodStart;95443.7176888889<=r;)r-=95443.7176888889,a+=8589934592;e=t.periodStart+a/9e4-e}}else n[0].includes("X-TIMESTAMP-MAP")&&this.g=="HLS"&&(e=t.segmentStart);for(t=[],a=v(n[0].split(` +`)),r=a.next();!r.done;r=a.next())if(r=r.value,/^Region:/.test(r)){r=new Fo(r);var l=new To;zo(r),zr(r);for(var f=zo(r);f;){var c=l,p=f;(f=/^id=(.*)$/.exec(p))?c.id=f[1]:(f=/^width=(\d{1,2}|100)%$/.exec(p))?c.width=Number(f[1]):(f=/^lines=(\d+)$/.exec(p))?(c.height=Number(f[1]),c.heightUnits=2):(f=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))?(c.regionAnchorX=Number(f[1]),c.regionAnchorY=Number(f[2])):(f=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))?(c.viewportAnchorX=Number(f[1]),c.viewportAnchorY=Number(f[2])):/^scroll=up$/.exec(p)&&(c.scroll="up"),zr(r),f=zo(r)}t.push(l)}for(a=new Map,kv(a),r=[],n=v(n.slice(1)),l=n.next();!l.done;l=n.next()){if(l=l.value.split(` +`),(l.length!=1||l[0])&&!/^NOTE($|[ \t])/.test(l[0])&&l[0]=="STYLE"){for(c=[],f=-1,p=1;p")||(c=l[0],l.splice(0,1)),f=new Fo(l[0]),p=Uu(f),S=lo(f,/[ \t]+--\x3e[ \t]+/g),m=Uu(f),p==null||S==null||m==null)Ge("Failed to parse VTT time code. Cue skipped:",c,l),l=null;else{for(p+=g,m+=g,l=l.slice(1).join(` +`).trim(),a.has("global")?(g=a.get("global").clone(),g.startTime=p,g.endTime=m,g.payload=""):g=new at(p,m,""),zr(f),p=zo(f);p;)_v(g,p,t),zr(f),p=zo(f);Mv(l,g,a),c!=null&&(g.id=c),l=g}l&&r.push(l)}return r};function kv(e){for(var t=v(Object.entries(rp)),n=t.next();!n.done;n=t.next()){var r=v(n.value);n=r.next().value,r=r.next().value;var a=new at(0,0,"");a.color=r,e.set("."+n,a)}for(t=v(Object.entries(sp)),n=t.next();!n.done;n=t.next())r=v(n.value),n=r.next().value,r=r.next().value,a=new at(0,0,""),a.backgroundColor=r,e.set("."+n,a)}function Mv(e,t,n){if(e.includes("<")){n.size===0&&kv(n);e:{for(var r=[],a=-1,l="",f=0;f",f);if(c<=f)break e;if((c=e.substring(f+1,c))&&c==="c"){var p=r.pop();p?p===c?(l+="/"+c+">",f+=c.length+1):p.startsWith("c.")?(f+=c.length+1,l+="/"+p+">"):l+=e[f]:l+=e[f]}else l+=e[f]}else e[f]==="<"?(a=f+1,e[a]!="c"&&(a=-1)):e[f]===">"&&0"&&0",'

'),r+="
";e=r;e:{for(a=e,l=[],f=-1,e="",r=!1,c=0;c",c),p===-1){e=a;break e}if((p=a.substring(c+1,p))&&p=="v"){r=!0;var m=null;if(l.length&&(m=l[l.length-1]),m){if(m===p)e+="/"+p+">";else{if(!m.startsWith("v")){e+=a[c];continue}e+="/"+m+">"}c+=p.length+1}else e+=a[c]}else e+=a[c]}else a[c]==="<"?(f=c+1,a[f]!="v"&&(f=-1)):a[c]===">"&&0","<"+f+">"),e=e.replace("",""),r||(e+="")}if(r=yr(""+e+"","span")){if(r=r.childNodes,r.length==1&&(a=r[0],a.nodeType==Node.TEXT_NODE||a.nodeType==Node.CDATA_SECTION_NODE)){t.payload=Bu(e);return}for(e=v(r),r=e.next();!r.done;r=e.next())Rv(r.value,t,n)}else t.payload=Bu(e)}else t.payload=Bu(e)}function ya(e,t){return e&&0",""":'"',"'":"'"," ":" ","‎":"‎","‏":"‏"},n=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,r=RegExp(n.source);return e&&r.test(e)?e.replace(n,function(a){return t[a]||"'"}):e||""}he("shaka.text.VttTextParser",rn),rn.prototype.parseMedia=rn.prototype.parseMedia,rn.prototype.setManifestType=rn.prototype.setManifestType,rn.prototype.setSequenceMode=rn.prototype.setSequenceMode,rn.prototype.parseInit=rn.prototype.parseInit;var Lv=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;jt["text/vtt"]=function(){return new rn},jt['text/vtt; codecs="vtt"']=function(){return new rn},jt['text/vtt; codecs="wvtt"']=function(){return new rn};function Mn(){this.g=null}Mn.prototype.parseInit=function(e){var t=this,n=!1;if(new lt().box("moov",tt).box("trak",tt).box("mdia",tt).O("mdhd",function(r){r=ml(r.reader,r.version),t.g=r.timescale}).box("minf",tt).box("stbl",tt).O("stsd",pr).box("wvtt",function(){n=!0}).parse(e),!this.g)throw new F(2,2,2008);if(!n)throw new F(2,2,2008)},Mn.prototype.setSequenceMode=function(){},Mn.prototype.setManifestType=function(){},Mn.prototype.parseMedia=function(e,t){if(!e.length)return[];if(!this.g)throw new F(2,2,2008);var n=0,r=[],a,l=[],f=!1,c=!1,p=!1,m=null;if(new lt().box("moof",tt).box("traf",tt).O("tfdt",function(B){f=!0,n=sc(B.reader,B.version).baseMediaDecodeTime}).O("tfhd",function(B){m=I0(B.reader,B.flags).Kf}).O("trun",function(B){c=!0,r=E0(B.reader,B.version,B.flags).ig}).box("mdat",mr(function(B){p=!0,a=B})).parse(e,!1),!p&&!f&&!c)throw new F(2,2,2008);e=n;for(var g=new rt(a,0),S=v(r),T=S.next();!T.done;T=S.next()){T=T.value;var w=T.hf||m,A=T.Wd?n+T.Wd:e;e=A+(w||0);var M=0;do{var R=g.L();M+=R;var D=g.L(),_=null;ul(D)=="vttc"?8").replace(/{\/b}/g,"").replace(/{i}/g,"").replace(/{\/i}/g,"").replace(/{u}/g,"").replace(/{\/u}/g,"")+` + +`;return t}he("shaka.text.SrtTextParser",wn),wn.srt2webvtt=Pv,wn.prototype.parseMedia=wn.prototype.parseMedia,wn.prototype.setManifestType=wn.prototype.setManifestType,wn.prototype.setSequenceMode=wn.prototype.setSequenceMode,wn.prototype.parseInit=wn.prototype.parseInit,jt["text/srt"]=function(){return new wn};function _n(){}_n.prototype.parseInit=function(){},_n.prototype.setSequenceMode=function(){},_n.prototype.setManifestType=function(){},_n.prototype.parseMedia=function(e){var t="",n="";e=mt(e).split(/\r?\n\s*\r?\n/),e=v(e);for(var r=e.next();!r.done;r=e.next()){var a=zb.exec(r.value);a&&(r=a[1],a=a[2],r=="V4 Styles"||r=="V4+ Styles"?t=a:r=="Events"&&(n=a))}e=[],r=null,t=v(t.split(/\r?\n/));for(var l=t.next();!l.done;l=t.next())if(a=l.value,!/^\s*;/.test(a)&&(l=Uv.exec(a))){if(a=l[1].trim(),l=l[2].trim(),a=="Format")r=l.split(ju);else if(a=="Style"){a=l.split(ju),l={};for(var f=0;f>8&255)+","+(e>>16&255)+","+(e>>24&255^255)/255+")":null}function Ov(e){return e=Vb.exec(e),3600*(e[1]?parseInt(e[1].replace(":",""),10):0)+60*parseInt(e[2],10)+parseFloat(e[3])}he("shaka.text.SsaTextParser",_n),_n.prototype.parseMedia=_n.prototype.parseMedia,_n.prototype.setManifestType=_n.prototype.setManifestType,_n.prototype.setSequenceMode=_n.prototype.setSequenceMode,_n.prototype.parseInit=_n.prototype.parseInit;var zb=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,Uv=/^\s*([^:]+):\s*(.*)/,ju=/\s*,\s*/,Vb=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;jt["text/x-ssa"]=function(){return new _n};function Bv(e,t){var n=e[t+1]&1?7:9;return t+n<=e.length&&(e=((e[t+3]&3)<<11|e[t+4]<<3|(e[t+5]&224)>>>5)-n,0>>2;if(r>n.length-1)return null;var a=((e[t+2]&192)>>>6)+1,l=(e[t+2]&1)<<2;return l|=(e[t+3]&192)>>>6,{sampleRate:n[r],channelCount:l,ha:"mp4a.40."+a}}function Hb(e,t){if(t+1=e.length)return!1;var r=(e[t+3]&3)<<11|e[t+4]<<3|(e[t+5]&224)>>>5;return r<=n?!1:(t+=r,t===e.length||t+1e.length||e[t]!==11||e[t+1]!==119)return null;var n=e[t+4]>>6;if(3<=n)return null;var r=e[t+4]&63,a=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*r+n];if(t+a>e.length)return null;var l=e[t+6]>>5,f=0;l===2?f+=2:(l&1&&l!==1&&(f+=2),l&4&&(f+=2)),f=(e[t+6]<<8|e[t+7])>>12-f&1;var c=e[t+5]&7;return e=new Uint8Array([n<<6|e[t+5]>>3<<1|c>>2,(c&3)<<6|l<<3|f<<2|r>>4,r<<4&224]),{sampleRate:[48e3,44100,32e3][n],channelCount:[2,1,2,3,3,4,4,5][l]+f,fa:e,S:a}}function Xb(e,t){if(e[t]===11&&e[t+1]===119){var n=0,r=5;t+=r;for(var a,l;0>>24+c<>c,n=n?n<n)return!0}return!1}function Xn(e){this.i=e,this.h=0,this.g=new Map}d=Xn.prototype,d.destroy=function(){this.g.clear()},d.isSupported=function(e){return e.toLowerCase().split(";")[0]=="audio/ac3"?dt(this.convertCodecs("audio",e)):!1},d.convertCodecs=function(e,t){return t.toLowerCase().split(";")[0]=="audio/ac3"?'audio/mp4; codecs="ac-3"':t},d.getOriginalMimeType=function(){return this.i},d.transmux=function(e,t,n,r){e=Fe(e);for(var a=Ls(e),l=a.length;le.length||(e[t]<<8|e[t+1]<<0)!==2935)return null;var n=new zi(e.subarray(t+2));yn(n,2),yn(n,3);var r=Ve(n,11)+1<<1,a=Ve(n,2);if(a==3){a=Ve(n,2),a=[24e3,22060,16e3][a];var l=3}else a=[48e3,44100,32e3][a],l=Ve(n,2);var f=Ve(n,3),c=Ve(n,1);return n=Ve(n,5),t+r>e.byteLength?null:(e=Math.floor(r*a/(16*[1,2,3,6][l])),e=new Uint8Array([(e&8160)>>5,(e&31)<<3,a<<6|n<<1|0,0|f<<1|c<<0,0]),{sampleRate:a,channelCount:[2,1,2,3,3,4,4,5][f]+c,fa:e,S:r})}function Wn(e){this.i=e,this.h=0,this.g=new Map}d=Wn.prototype,d.destroy=function(){this.g.clear()},d.isSupported=function(e){return e.toLowerCase().split(";")[0]=="audio/ec3"?dt(this.convertCodecs("audio",e)):!1},d.convertCodecs=function(e,t){return t.toLowerCase().split(";")[0]=="audio/ec3"?'audio/mp4; codecs="ec-3"':t},d.getOriginalMimeType=function(){return this.i},d.transmux=function(e,t,n,r){e=Fe(e);for(var a=Ls(e),l=a.length;la?gl(n,16):gl(n,64))}if(fn(n),r=Se(n),r===0)Se(n);else if(r===1)for(yn(n,1),fn(n),fn(n),r=Se(n),a=0;aT?(r=w[T-1],a=A[T-1]):T===255&&(r=Ve(n,16),a=Ve(n,16))}return n=(2-c)*(f+1)*16-2*g-2*S,l=16*(l+1)-2*p-2*m,p=[],t=t.fullData,p.push(t.byteLength>>>8&255),p.push(t.byteLength&255),p=p.concat.apply(p,N(t)),t=[],e=e.fullData,t.push(e.byteLength>>>8&255),t.push(e.byteLength&255),t=t.concat.apply(t,N(e)),e=new Uint8Array([1,p[3],p[4],p[5],255,225].concat(p,[1],t)),{height:n,width:l,la:e,sa:r,ua:a}}function $b(e){var t=!1,n=[],r=e.find(function(p){return p.type==7}),a=!1;e=v(e);for(var l=e.next();!l.done;l=e.next()){l=l.value;var f=!1;switch(l.type){case 1:f=a=!0;var c=l.data;r&&4>24&255,c[1]=f>>16&255,c[2]=f>>8&255,c[3]=f&255,n.push(wt(c,l.fullData)))}return n.length?{data:wt.apply(en,N(n)),Vc:t}:null}var Kb=[100,110,122,244,44,83,86,118,128,138,139,134];function Yb(e){if(!e.length)return null;var t=e.find(function(f){return f.type==32}),n=e.find(function(f){return f.type==33}),r=e.find(function(f){return f.type==34});if(!t||!n||!r)return null;var a=qb(t.fullData);e=Qb(n.fullData);var l=Zb(r.fullData);return t=Jb(t.fullData,n.fullData,r.fullData,{Ze:a.Ze,uf:a.uf,De:e.De,Ee:e.Ee,xe:e.xe,Ce:e.Ce,ye:e.ye,ze:e.ze,Ae:e.Ae,Be:e.Be,re:e.re,se:e.se,te:e.te,ue:e.ue,ve:e.ve,we:e.we,oe:e.oe,Rd:e.Rd,ne:e.ne,me:e.me,le:e.le,bf:l.bf}),{height:e.height,width:e.width,la:t,sa:e.Uh,ua:e.Th}}function qb(e){var t=new zi(e,!0);return qe(t),qe(t),Ve(t,4),Ve(t,2),Ve(t,6),e=Ve(t,3),t=be(t),{Ze:e+1,uf:t}}function Qb(e){e=new zi(e,!0),qe(e),qe(e);var t=0,n=0,r=0,a=0;Ve(e,4);var l=Ve(e,3);be(e);for(var f=Ve(e,2),c=Ve(e,1),p=Ve(e,5),m=qe(e),g=qe(e),S=qe(e),T=qe(e),w=qe(e),A=qe(e),M=qe(e),R=qe(e),D=qe(e),_=qe(e),B=qe(e),U=[],z=[],W=0;WW;W++)Ve(e,2);for(W=0;Wce;ce++)for(var me=0;me<(ce===3?2:6);me++)if(be(e)){var xe=Math.min(64,1<<4+(ce<<1));1xe?(J=Ie[xe-1],ce=Me[xe-1]):xe===255&&(J=Ve(e,16),ce=Ve(e,16))),be(e)&&be(e),be(e)&&(Ve(e,3),be(e),be(e)&&(qe(e),qe(e),qe(e))),be(e)&&(Se(e),Se(e)),be(e),be(e),be(e),(xe=be(e))&&(Se(e),Se(e),Se(e),Se(e)),be(e)&&(Ve(e,32),Ve(e,32),be(e)&&Se(e),be(e)))for(Me=!1,xe=be(e),Ie=be(e),(xe||Ie)&&((Me=be(e))&&(qe(e),Ve(e,5),be(e),Ve(e,5)),Ve(e,4),Ve(e,4),Me&&Ve(e,4),Ve(e,5),Ve(e,5),Ve(e,5)),_e=0;_e<=l;_e++){var Ee=!0;Be=1,be(e)||(Ee=be(e));var Mt=!1;if(Ee?Se(e):Mt=be(e),Mt||(Be=Se(e)+1),xe){for(Ee=0;Ee>8,a[14]=r.Rd&255,a[15]=252|r.bf&3,a[16]=252|r.ne&3,a[17]=248|r.me&7,a[18]=248|r.le&7,a[19]=0,a[20]=0,a[21]=(r.oe&3)<<6|(r.Ze&7)<<3|(r.uf?1:0)<<2|3,a[22]=3,a[23]=160,a[24]=0,a[25]=1,a[26]=(e.byteLength&65280)>>8,a[27]=(e.byteLength&255)>>0,a.set(e,28),a[23+(5+e.byteLength)]=161,a[e.byteLength+29]=0,a[e.byteLength+30]=1,a[e.byteLength+31]=(t.byteLength&65280)>>8,a[e.byteLength+32]=(t.byteLength&255)>>0,a.set(t,e.byteLength+33),a[23+(e.byteLength+10+t.byteLength)]=162,a[e.byteLength+10+t.byteLength+24]=0,a[e.byteLength+10+t.byteLength+25]=1,a[e.byteLength+10+t.byteLength+26]=(n.byteLength&65280)>>8,a[e.byteLength+10+t.byteLength+27]=(n.byteLength&255)>>0,a.set(n,e.byteLength+10+t.byteLength+28),a}function Fu(e,t){var n=e[t+1]>>3&3,r=e[t+1]>>1&3,a=e[t+2]>>4&15,l=e[t+2]>>2&3;if(n!==1&&a!==0&&a!==15&&l!==3){var f=e[t+3]>>6;a=1e3*eA[14*(n===3?3-r:r===3?3:4)+a-1],l=tA[3*(n===3?0:n===2?1:2)+l],n=nA[n][r];var c=iA[r],p=Math.floor(n*a/l+(e[t+2]>>1&1))*c,m=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);return(m=m?parseInt(m[1],10):0)&&87>=m&&r===2&&224e3<=a&&f===0&&(e[t+3]|=128),{sampleRate:l,channelCount:f===3?1:2,S:p,Sh:8*n*c}}return null}function Vv(e,t){return e[t]===255&&(e[t+1]&224)===224&&(e[t+1]&6)!==0}var eA=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],tA=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],nA=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],iA=[0,1,1,4];function $n(e){this.i=e,this.h=0,this.g=new Map}d=$n.prototype,d.destroy=function(){this.g.clear()},d.isSupported=function(e){return e.toLowerCase().split(";")[0]=="audio/mpeg"?dt(this.convertCodecs("audio",e)):!1},d.convertCodecs=function(e,t){return t.toLowerCase().split(";")[0]=="audio/mpeg"?'audio/mp4; codecs="mp3"':t},d.getOriginalMimeType=function(){return this.i},d.transmux=function(e,t,n,r){for(e=Fe(e),n=Ls(e).length;nr;r++)this.usertype[r]!==rA[r]&&(n=!1);n&&(this._parsing&&(this.type="sepiff"),t.call(this))})}d=Ln.prototype,d.destroy=function(){},d.isSupported=function(e,t){var n=e.startsWith("mss/");return!this.g||!n?!1:t?dt(this.convertCodecs(t,e)):(t=this.convertCodecs("audio",e),e=this.convertCodecs("video",e),dt(t)||dt(e))},d.convertCodecs=function(e,t){return t.replace("mss/","")},d.getOriginalMimeType=function(){return this.h},d.transmux=function(e,t,n){if(!n)return Promise.resolve(Fe(e));if(!t.mssPrivateData)return Promise.reject(new F(2,3,3020));try{var r,a=this.g.parseBuffer(e),l=a.fetch("tfhd");l.track_ID=t.id+1;var f=a.fetch("tfdt"),c=a.fetch("traf");f===null&&(f=this.g.createFullBox("tfdt",c,l),f.version=1,f.flags=0,f.baseMediaDecodeTime=Math.floor(n.startTime*t.mssPrivateData.timescale));var p=a.fetch("trun"),m=a.fetch("tfxd");m&&m._parent.boxes.splice(m._parent.boxes.indexOf(m),1);var g=a.fetch("tfrf");g&&g._parent.boxes.splice(g._parent.boxes.indexOf(g),1);var S=a.fetch("sepiff");if(S!==null){S.type="senc",S.usertype=void 0;var T=a.fetch("saio");if(T===null){T=this.g.createFullBox("saio",c),T.version=0,T.flags=0,T.entry_count=1,T.offset=[0];var w=this.g.createFullBox("saiz",c);if(w.version=0,w.flags=0,w.sample_count=S.sample_count,w.default_sample_info_size=0,w.sample_info_size=[],S.flags&2)for(r=0;r>24&255,se[1]=W>>16&255,se[2]=W>>8&255,se[3]=W&255,_.push(wt(se,U.fullData))}}var Z=_.length?{data:wt.apply(en,N(_)),Vc:D}:null;Z&&(w==null&&m.dts!=null&&(w=m.dts),D=void 0,D=M+1{Ex.polyfill.installAll(),Jt=h,Jt||(Jt=document.createElement("video"),Jt.style.cssText="position: absolute; top: 0; left: 0; z-index: -1",Jt.width=1920,Jt.height=1080,$o=new Ex.Player,await $o.attach(Jt),Jt.autoplay=!1,$o.addEventListener("error",s=>{console.error(s)}),document.body.insertBefore(Jt,document.body.firstChild))},yk=async h=>{if(!$o||!Jt)throw"Player not initialized yet";await $o.load(h.streamUrl)},vk=()=>{Jt.play().then(()=>{Jh.playingState=!0})},xk=()=>{Jt.pause(),Jh.playingState=!1},Sk=async()=>{await $o.destroy(),$o=null,Jt.remove(),Jt=null},wk=()=>Jt.currentTime,Tk=()=>Jt.duration,Ck=()=>{let h=s=>new Date(s*1e3).toISOString().substr(14,5);return`${h(Jt.currentTime)} : ${h(Math.floor(Jt.duration))}`},mo={init:gk,load:yk,play:vk,pause:xk,getCurrentTime:wk,getVideoDuration:Tk,getTimeFormat:Ck,state:Jh,destroy:Sk},Ik=He.Component("Player",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.y=1080,y.mount="{y:1}",y.w=1920,y.h=150,o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.x=60,d.y=50,o[2].nodeId||o[2].populate(d),s=o[2],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=60,C.h=60,C.color="0x0087ceeb",o[3].nodeId||o[3].populate(C),s=o[3],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.y=14,b.x=14,b.w=32,b.h=32,o[4].nodeId||o[4].populate(b),s=o[2],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.y=22,I.x=100,I.w=i.progressLength,I.h=16,I.color="0xffffff80",o[5].nodeId||o[5].populate(I),s=o[5],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.h=16,k.color="0x0087ceeb",o[6].nodeId||o[6].populate(k);const P=u.components&&u.components.Circle||i[Symbol.for("components")].Circle;s=o[5],o[7]||(o[7]=this.element({parent:s||"root"},i));const O={};if(O.size=28,O.color="0xffffffff",O.y=-6,typeof P<"u")for(let re in P.config.props)delete O[P.config.props[re]];o[7].nodeId||o[7].populate(O),s=o[7];const v={};if(v.size=28,v.color="0xffffffff",v.y=-6,v.x={transition:{value:i.progress-8,d:100,f:"ease-in-out"}},!o[8]){const re=v.is||"Circle";o[8]=(u.components&&u.components[re]||i[Symbol.for("components")][re]||(()=>{console.error("component Circle not found")})).call(null,{props:v},o[7],i),o[8][Symbol.for("slots")][0]?(s=o[8][Symbol.for("slots")][0],i=o[8]):s=o[8][Symbol.for("children")][0]}s=o[2],o[9]||(o[9]=this.element({parent:s||"root"},i));const N={};N.x=1660,N.y=16,o[9].nodeId||o[9].populate(N);const V=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[9],o[10]||(o[10]=this.element({parent:s||"root"},i));const G={};if(G.size=25,typeof V<"u")for(let re in V.config.props)delete G[V.config.props[re]];o[10].nodeId||o[10].populate(G),s=o[10];const ie={};if(ie.content=i.currentTime,ie.size=25,!o[11]){const re=ie.is||"Text";o[11]=(u.components&&u.components[re]||i[Symbol.for("components")][re]||(()=>{console.error("component Text not found")})).call(null,{props:ie},o[10],i),o[11][Symbol.for("slots")][0]?(s=o[11][Symbol.for("slots")][0],i=o[11]):s=o[11][Symbol.for("children")][0]}const $=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[9],o[12]||(o[12]=this.element({parent:s||"root"},i));const ne={};if(ne.x=70,ne.size=25,ne.content="/",typeof $<"u")for(let re in $.config.props)delete ne[$.config.props[re]];o[12].nodeId||o[12].populate(ne),s=o[12];const ee={};if(ee.x=70,ee.size=25,ee.content="/",!o[13]){const re=ee.is||"Text";o[13]=(u.components&&u.components[re]||i[Symbol.for("components")][re]||(()=>{console.error("component Text not found")})).call(null,{props:ee},o[12],i),o[13][Symbol.for("slots")][0]?(s=o[13][Symbol.for("slots")][0],i=o[13]):s=o[13][Symbol.for("children")][0]}const le=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[9],o[14]||(o[14]=this.element({parent:s||"root"},i));const X={};if(X.x=85,X.size=25,typeof le<"u")for(let re in le.config.props)delete X[le.config.props[re]];o[14].nodeId||o[14].populate(X),s=o[14];const oe={};if(oe.x=85,oe.size=25,oe.content=i.duration,!o[15]){const re=oe.is||"Text";o[15]=(u.components&&u.components[re]||i[Symbol.for("components")][re]||(()=>{console.error("component Text not found")})).call(null,{props:oe},o[14],i),o[15][Symbol.for("slots")][0]?(s=o[15][Symbol.for("slots")][0],i=o[15]):s=o[15][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[1].set("color",{top:"0x00000000",bottom:"0x444444ff"})},function(s,i,u){i[1].set("alpha",{transition:s.controlsVisibility})},function(s,i,u){i[3].set("effects",[s.shader("radius",{radius:16})])},function(s,i,u){i[4].set("src",s.playing?"assets/player/pause.png":"assets/player/play.png")},function(s,i,u){i[5].set("effects",[s.shader("radius",{radius:8})])},function(s,i,u){i[6].set("w",{transition:{value:s.progress,d:100,f:"ease-in-out"}})},function(s,i,u){i[6].set("effects",[s.shader("radius",{radius:8})])},function(s,i,u){i[7].set("x",{transition:{value:s.progress-8,d:100,f:"ease-in-out"}})},function(s,i,u){i[8][Symbol.for("props")].x={transition:{value:s.progress-8,d:100,f:"ease-in-out"}}},function(s,i,u){i[10].set("content",s.currentTime)},function(s,i,u){i[11][Symbol.for("props")].content=s.currentTime},function(s,i,u){i[14].set("content",s.duration)},function(s,i,u){i[15][Symbol.for("props")].content=s.duration}],context:{}},state(){return{controlsVisibility:0,progressLength:1520,progress:0,currentTime:"00:00",duration:"00:00",playing:!1,hideTimeout:null}},hooks:{focus(){this.$emit("clearBackground")},unfocus(){this.$emit("changeBackground")},async init(){await mo.init()},async ready(){await mo.load({streamUrl:"https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8"});const h=i=>new Date(i*1e3).toISOString().substr(14,5),s=mo.getVideoDuration();s&&(this.duration=h(s),this.progressChunkSize=Math.round(this.progressLength/s*100)/100),this.$setInterval(()=>{const i=mo.getCurrentTime();this.currentTime=h(i),this.progress=Math.round(i*this.progressChunkSize)},1e3),this.play()},async destroy(){await mo.destroy()}},input:{space(){this.play()},up(){this.showControls(1)},down(){this.showControls(0)}},methods:{play(){this.showControls(1),this.hideTimeout=this.$setTimeout(()=>this.showControls(0),3e3),mo.state.playingState==!0?(mo.pause(),this.playing=!1):(console.log("play!"),mo.play(),this.playing=!0)},showControls(h){this.$clearTimeout(this.hideTimeout),this.controlsVisibility=h}}}),Ek=He.Component("Colors",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=1920,x.h=1080,o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.x=20,y.y=20,o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=100,d.h=100,d.x=0,d.color="0xecfeffff",o[2].nodeId||o[2].populate(d),s=o[1],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=100,C.h=100,C.x=120,C.color="0xa5f3fcff",o[3].nodeId||o[3].populate(C),s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.w=100,b.h=100,b.x=240,b.color="0x22d3eeff",o[4].nodeId||o[4].populate(b),s=o[1],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.w=100,I.h=100,I.x=360,I.color="0x0891b2ff",o[5].nodeId||o[5].populate(I),s=o[0],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.x=20,k.y=140,o[6].nodeId||o[6].populate(k),s=o[6],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};P.w=100,P.h=100,P.x=0,P.color="0xecfeffff",o[7].nodeId||o[7].populate(P),s=o[6],o[8]||(o[8]=this.element({parent:s||"root"},i));const O={};O.w=100,O.h=100,O.x=120,O.color="0xa5f3fcff",o[8].nodeId||o[8].populate(O),s=o[6],o[9]||(o[9]=this.element({parent:s||"root"},i));const v={};v.w=100,v.h=100,v.x=240,v.color="0x22d3eeff",o[9].nodeId||o[9].populate(v),s=o[6],o[10]||(o[10]=this.element({parent:s||"root"},i));const N={};N.w=100,N.h=100,N.x=360,N.color="0x0891b2ff",o[10].nodeId||o[10].populate(N),s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const V={};V.x=20,V.y=260,o[11].nodeId||o[11].populate(V),s=o[11],o[12]||(o[12]=this.element({parent:s||"root"},i));const G={};G.w=100,G.h=100,G.x=0,G.color="0xecfeffaa",o[12].nodeId||o[12].populate(G),s=o[11],o[13]||(o[13]=this.element({parent:s||"root"},i));const ie={};ie.w=100,ie.h=100,ie.x=120,ie.color="0xa5f3fc33",o[13].nodeId||o[13].populate(ie),s=o[11],o[14]||(o[14]=this.element({parent:s||"root"},i));const $={};$.w=100,$.h=100,$.x=240,$.color="0x22d3ee20",o[14].nodeId||o[14].populate($),s=o[11],o[15]||(o[15]=this.element({parent:s||"root"},i));const ne={};ne.w=100,ne.h=100,ne.x=360,ne.color="0x0891b2ff",o[15].nodeId||o[15].populate(ne),s=o[0],o[16]||(o[16]=this.element({parent:s||"root"},i));const ee={};ee.x=20,ee.y=380,o[16].nodeId||o[16].populate(ee),s=o[16],o[17]||(o[17]=this.element({parent:s||"root"},i));const le={};le.w=100,le.h=100,le.x=0,le.color="0xecfeffff",o[17].nodeId||o[17].populate(le),s=o[16],o[18]||(o[18]=this.element({parent:s||"root"},i));const X={};X.w=100,X.h=100,X.x=120,X.color="0xa5f3fcff",o[18].nodeId||o[18].populate(X),s=o[16],o[19]||(o[19]=this.element({parent:s||"root"},i));const oe={};oe.w=100,oe.h=100,oe.x=240,oe.color="0x22d3eeff",o[19].nodeId||o[19].populate(oe),s=o[16],o[20]||(o[20]=this.element({parent:s||"root"},i));const re={};re.w=100,re.h=100,re.x=360,re.color="0x0891b2ff",o[20].nodeId||o[20].populate(re),s=o[0],o[21]||(o[21]=this.element({parent:s||"root"},i));const E={};E.x=20,E.y=500,o[21].nodeId||o[21].populate(E),s=o[21],o[22]||(o[22]=this.element({parent:s||"root"},i));const H={};H.w=100,H.h=100,H.x=0,H.color="0xecfeffab",o[22].nodeId||o[22].populate(H),s=o[21],o[23]||(o[23]=this.element({parent:s||"root"},i));const Q={};Q.w=100,Q.h=100,Q.x=120,Q.color="0xa5f3fc33",o[23].nodeId||o[23].populate(Q),s=o[21],o[24]||(o[24]=this.element({parent:s||"root"},i));const ge={};ge.w=100,ge.h=100,ge.x=240,ge.color="0x22d3ee21",o[24].nodeId||o[24].populate(ge),s=o[21],o[25]||(o[25]=this.element({parent:s||"root"},i));const ae={};ae.w=100,ae.h=100,ae.x=360,ae.color="0x0891b2ff",o[25].nodeId||o[25].populate(ae),s=o[0],o[26]||(o[26]=this.element({parent:s||"root"},i));const q={};q.x=20,q.y=620,o[26].nodeId||o[26].populate(q),s=o[26],o[27]||(o[27]=this.element({parent:s||"root"},i));const Y={};Y.w=100,Y.h=100,Y.x=0,Y.color="0x000000ff",o[27].nodeId||o[27].populate(Y),s=o[26],o[28]||(o[28]=this.element({parent:s||"root"},i));const K={};K.w=100,K.h=100,K.x=120,K.color="0xccccccff",o[28].nodeId||o[28].populate(K),s=o[26],o[29]||(o[29]=this.element({parent:s||"root"},i));const de={};de.w=100,de.h=100,de.x=240,de.color="0x889900ff",o[29].nodeId||o[29].populate(de),s=o[26],o[30]||(o[30]=this.element({parent:s||"root"},i));const ve={};ve.w=100,ve.h=100,ve.x=360,ve.color="0x00ff00ff",o[30].nodeId||o[30].populate(ve),s=o[0],o[31]||(o[31]=this.element({parent:s||"root"},i));const pe={};pe.x=20,pe.y=740,o[31].nodeId||o[31].populate(pe),s=o[31],o[32]||(o[32]=this.element({parent:s||"root"},i));const fe={};fe.w=100,fe.h=100,fe.x=0,fe.color="0x000000ff",o[32].nodeId||o[32].populate(fe),s=o[31],o[33]||(o[33]=this.element({parent:s||"root"},i));const ke={};ke.w=100,ke.h=100,ke.x=120,ke.color="0xccccccff",o[33].nodeId||o[33].populate(ke),s=o[31],o[34]||(o[34]=this.element({parent:s||"root"},i));const we={};we.w=100,we.h=100,we.x=240,we.color="0x889900ff",o[34].nodeId||o[34].populate(we),s=o[31],o[35]||(o[35]=this.element({parent:s||"root"},i));const j={};j.w=100,j.h=100,j.x=360,j.color="0x00ff00ff",o[35].nodeId||o[35].populate(j),s=o[0],o[36]||(o[36]=this.element({parent:s||"root"},i));const ye={};ye.x=620,ye.y=20,o[36].nodeId||o[36].populate(ye),s=o[36],o[37]||(o[37]=this.element({parent:s||"root"},i));const ze={};ze.w=300,ze.h=200,ze.x=0,o[37].nodeId||o[37].populate(ze),s=o[36],o[38]||(o[38]=this.element({parent:s||"root"},i));const et={};et.w=300,et.h=200,et.x=0,et.y=250,o[38].nodeId||o[38].populate(et),s=o[36],o[39]||(o[39]=this.element({parent:s||"root"},i));const We={};We.w=300,We.h=200,We.x=100,We.y=400,o[39].nodeId||o[39].populate(We),s=o[36],o[40]||(o[40]=this.element({parent:s||"root"},i));const it={};return it.w=300,it.h=200,it.x=0,it.y=650,o[40].nodeId||o[40].populate(it),o},effects:[function(s,i,u){i[0].set("color",{transition:s.bg})},function(s,i,u){i[37].set("color",{transition:s.color1})},function(s,i,u){i[38].set("color",{transition:s.color2})},function(s,i,u){i[39].set("color",{transition:s.color3})},function(s,i,u){i[40].set("color",{transition:{value:s.color4,d:1e3,f:"ease-in-out"}})}],context:{}},state(){return{bg:"#fff",color1:"#22d3ee",color2:"#dc2626",color3:"rgba(251, 191, 36)",color4:"#bfdbfe"}},input:{enter(){this.color1=this.color1==="#0891b2"?"#22d3ee":"#0891b2",this.color2=this.color2==="#dc2626"?"#0f0":"#dc2626",this.color3=this.color3==="rgba(251, 191, 36)"?"rgba(30, 64, 175, 0.5)":"rgba(251, 191, 36)",this.color4=this.color4==="#1e3a8a"?"#bfdbfe":"#1e3a8a"}},hooks:{ready(){let h=0;const s=["#fff","#333","#c0ff33","#546aaa","#000","tomato"];this.$setInterval(()=>{h=h+1,h===s.length-1&&(h=0),this.bg=s[h]},2e3)}}}),bk=He.Component("Gradients",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.h=1080,y.color="{top: '0x0891b2ff', bottom: '0xa5f3fcff'}",o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.h=1080,d.color="{left: '0xdc2626ff', right: '0xf87171ff'}",o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.h=1080,C.color="{top: '0x0891b2ff', right: '0xf87171ff'}",o[3].nodeId||o[3].populate(C),s=o[0],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};return b.h=1080,b.color="{right: '0x008000ff', bottom: '0xffd700ff'}",o[4].nodeId||o[4].populate(b),o},effects:[function(s,i,u){i[1].set("w",1920/4)},function(s,i,u){i[2].set("w",1920/4)},function(s,i,u){i[2].set("x",1920/4)},function(s,i,u){i[3].set("w",1920/4)},function(s,i,u){i[3].set("x",1920/4*2)},function(s,i,u){i[4].set("w",1920/4)},function(s,i,u){i[4].set("x",1920/4*3)}],context:{}}}),Ak=He.Component("Transitions",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=200,y.h=200,y.x=50,y.color="0xc4b5fdff",o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=200,d.h=200,d.x=300,d.color="0xa78bfaff",o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=200,C.h=200,C.x=550,C.color="0x8b5cf6ff",C.ref="bla",o[3].nodeId||o[3].populate(C),s=o[0],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.w=200,b.h=200,b.x=800,b.color="0x7c3aedff",o[4].nodeId||o[4].populate(b),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.w=200,I.h=200,I.x=1050,I.color="0x6d28d9ff",o[5].nodeId||o[5].populate(I),s=o[0],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.w=200,k.h=200,k.x=1300,k.color="0x5b21b6ff",o[6].nodeId||o[6].populate(k),s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};return P.w=200,P.h=200,P.x=1550,P.color="0x4c1d95ff",o[7].nodeId||o[7].populate(P),o},effects:[function(s,i,u){i[1].set("y",{transition:s.y})},function(s,i,u){i[2].set("y",{transition:{value:s.y}})},function(s,i,u){i[3].set("y",{transition:{value:s.y,duration:1e3,start:s.start,end:s.doneTransition3}})},function(s,i,u){i[4].set("y",{transition:{value:s.y,duration:500,delay:1e3,start:s.start,end:s.finished}})},function(s,i,u){i[5].set("y",{transition:{value:s.y,easing:"ease-in-out",end:s.finished}})},function(s,i,u){i[6].set("y",{transition:{value:s.y,duration:3e3,easing:"ease-in-out-back",end:s.finished}})},function(s,i,u){i[7].set("y",{transition:{value:s.y,duration:800,easing:"cubic-bezier(1,-0.64,.39,1.44)"}})}],context:{}},state(){return{y:50}},hooks:{ready(){this.$setTimeout(()=>{this.y=1080-50-200},500)}},methods:{doneTransition3(){this.$log.info("Transition 3 is done!")},start(h,s,i){this.$log.info("Start transition",h.nodeId,s,i)},finished(h,s,i){this.$log.info("Finished transition",h.nodeId,s,i)}}}),kk=He.Component("Alpha",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.y=100,o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=200,d.h=200,d.x=100,d.color="0xffffffff",d.alpha=.2,o[2].nodeId||o[2].populate(d),s=o[1],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=200,C.h=200,C.x=320,C.color="0xffffffff",C.alpha=.4,o[3].nodeId||o[3].populate(C),s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.w=200,b.h=200,b.x=540,b.color="0xffffffff",b.alpha=.6,o[4].nodeId||o[4].populate(b),s=o[1],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.w=200,I.h=200,I.x=760,I.color="0xffffffff",I.alpha=.8,o[5].nodeId||o[5].populate(I),s=o[1],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.w=200,k.h=200,k.x=980,k.color="0xffffffff",k.alpha=1,o[6].nodeId||o[6].populate(k),s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};P.w=200,P.h=200,P.x=100,P.y=320,P.color="0xffffffff",P.alpha=i.alpha,o[7].nodeId||o[7].populate(P),s=o[0],o[8]||(o[8]=this.element({parent:s||"root"},i));const O={};O.w=200,O.h=200,O.x=100,O.y=540,O.color="0xffffffff",o[8].nodeId||o[8].populate(O),s=o[0],o[9]||(o[9]=this.element({parent:s||"root"},i));const v={};v.w=200,v.h=200,v.x=100,v.y=760,v.color="0xffffffff",o[9].nodeId||o[9].populate(v),s=o[0],o[10]||(o[10]=this.element({parent:s||"root"},i));const N={};N.w=428,N.h=234,N.x=1200,N.y=100,N.alpha=1,o[10].nodeId||o[10].populate(N),s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const V={};V.w=428,V.h=234,V.x=1300,V.alpha=.4,o[11].nodeId||o[11].populate(V),s=o[0],o[12]||(o[12]=this.element({parent:s||"root"},i));const G={};G.w=428,G.h=234,G.x=1200,G.alpha=.1,o[12].nodeId||o[12].populate(G);const ie=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[13]||(o[13]=this.element({parent:s||"root"},i));const $={};if($.x=400,$.y=400,$.alpha=.2,$.content="Text with alpha applied directly",typeof ie<"u")for(let re in ie.config.props)delete $[ie.config.props[re]];o[13].nodeId||o[13].populate($),s=o[13];const ne={};if(ne.x=400,ne.y=400,ne.alpha=.2,ne.content="Text with alpha applied directly",!o[14]){const re=ne.is||"Text";o[14]=(u.components&&u.components[re]||i[Symbol.for("components")][re]||(()=>{console.error("component Text not found")})).call(null,{props:ne},o[13],i),o[14][Symbol.for("slots")][0]?(s=o[14][Symbol.for("slots")][0],i=o[14]):s=o[14][Symbol.for("children")][0]}s=o[0],o[15]||(o[15]=this.element({parent:s||"root"},i));const ee={};ee.alpha=.5,ee.x=400,ee.y=500,o[15].nodeId||o[15].populate(ee);const le=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[15],o[16]||(o[16]=this.element({parent:s||"root"},i));const X={};if(X.content="Text with alpha applied on parent element",typeof le<"u")for(let re in le.config.props)delete X[le.config.props[re]];o[16].nodeId||o[16].populate(X),s=o[16];const oe={};if(oe.content="Text with alpha applied on parent element",!o[17]){const re=oe.is||"Text";o[17]=(u.components&&u.components[re]||i[Symbol.for("components")][re]||(()=>{console.error("component Text not found")})).call(null,{props:oe},o[16],i),o[17][Symbol.for("slots")][0]?(s=o[17][Symbol.for("slots")][0],i=o[17]):s=o[17][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[8].set("alpha",s.alpha)},function(s,i,u){i[9].set("alpha",{transition:{value:s.alpha,duration:1e3,easing:"ease-in-out-circ"}})},function(s,i,u){i[10].set("src",s.image)},function(s,i,u){i[11].set("y",100+234-40)},function(s,i,u){i[11].set("src",s.image)},function(s,i,u){i[12].set("y",100+234*2-40*2)},function(s,i,u){i[12].set("src",s.image)}],context:{}},state(){return{alpha:.5,direction:"up",image:"assets/lightningbolt.png"}},hooks:{ready(){this.$setInterval(()=>{const h=this.direction==="up"?this.alpha+.2:this.alpha-.2;this.alpha=Math.max(Math.min(h,1),.1),this.alpha===1&&(this.direction="down"),this.alpha===.1&&(this.direction="up")},1400)}}}),Mk=He.Component("Scaling",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.x=100,y.y=100,y.w=150,y.h=150,y.color="0x64748bff",o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.x=300,d.y=100,d.w=100,d.h=100,d.color="0x64748bff",d.scale=1.5,o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.x=100,C.y=400,C.w=100,C.h=100,C.color="0xb45309ff",C.scale=i.scale,o[3].nodeId||o[3].populate(C),s=o[0],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.x=900,b.y=400,b.w=100,b.h=100,o[4].nodeId||o[4].populate(b),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.x=300,I.y=600,I.w=100,I.h=100,I.color="0x059669ff",o[5].nodeId||o[5].populate(I),s=o[5],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.x=10,k.y=10,k.h=60,k.w=80,k.color="0x0369a1ff",o[6].nodeId||o[6].populate(k),s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};P.x=1500,P.y=600,P.w=100,P.h=100,P.color="0x059669ff",o[7].nodeId||o[7].populate(P),s=o[7],o[8]||(o[8]=this.element({parent:s||"root"},i));const O={};return O.x=10,O.y=10,O.h=60,O.w=80,O.color="0x0369a1ff",o[8].nodeId||o[8].populate(O),o},effects:[function(s,i,u){i[4].set("src",s.balloon)},function(s,i,u){i[4].set("scale",{transition:{value:s.scale,easing:"ease-in-out"}})},function(s,i,u){i[5].set("scale",s.scale2)},function(s,i,u){i[7].set("scale",s.scale2)},function(s,i,u){i[8].set("scale",s.scale2/2)}],context:{}},state(){return{scale:2,direction:"up",balloon:"assets/balloon.png",scale2:1}},hooks:{ready(){this.$setInterval(()=>{const i=this.direction==="up"?this.scale+.5:0;this.scale=Math.max(Math.min(i,8),0),this.scale===8&&(this.direction="down"),this.scale===0&&(this.direction="up")},500),this.$setInterval(()=>{this.scale2=this.scale2===1?3:1},2e3)}}}),Rk=He.Component("Rotation",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.y=70,o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.x=100,d.y=0,d.w=200,d.h=100,d.color="0xfee2e2ff",d.rotation=0,o[2].nodeId||o[2].populate(d),s=o[1],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.x=100,C.y=150,C.w=200,C.h=100,C.color="0xfecacaff",C.rotation=10,o[3].nodeId||o[3].populate(C),s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.x=100,b.y=300,b.w=200,b.h=100,b.color="0xfca5a5ff",b.rotation=20,o[4].nodeId||o[4].populate(b),s=o[1],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.x=100,I.y=450,I.w=200,I.h=100,I.color="0xf87171ff",I.rotation=30,o[5].nodeId||o[5].populate(I),s=o[1],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.x=100,k.y=610,k.w=200,k.h=100,k.color="0xef4444ff",k.rotation=40,o[6].nodeId||o[6].populate(k),s=o[1],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};P.x=100,P.y=800,P.w=200,P.h=100,P.color="0xdc2626ff",P.rotation=50,o[7].nodeId||o[7].populate(P),s=o[0],o[8]||(o[8]=this.element({parent:s||"root"},i));const O={};O.y=70,O.x=300,o[8].nodeId||o[8].populate(O),s=o[8],o[9]||(o[9]=this.element({parent:s||"root"},i));const v={};v.x=100,v.y=0,v.w=200,v.h=100,v.color="0xfee2e2ff",v.rotation=60,o[9].nodeId||o[9].populate(v),s=o[8],o[10]||(o[10]=this.element({parent:s||"root"},i));const N={};N.x=100,N.y=150,N.w=200,N.h=100,N.color="0xfecacaff",N.rotation=70,o[10].nodeId||o[10].populate(N),s=o[8],o[11]||(o[11]=this.element({parent:s||"root"},i));const V={};V.x=100,V.y=300,V.w=200,V.h=100,V.color="0xfca5a5ff",V.rotation=80,o[11].nodeId||o[11].populate(V),s=o[8],o[12]||(o[12]=this.element({parent:s||"root"},i));const G={};G.x=100,G.y=450,G.w=200,G.h=100,G.color="0xf87171ff",G.rotation=90,o[12].nodeId||o[12].populate(G),s=o[8],o[13]||(o[13]=this.element({parent:s||"root"},i));const ie={};ie.x=100,ie.y=610,ie.w=200,ie.h=100,ie.color="0xef4444ff",ie.rotation=100,o[13].nodeId||o[13].populate(ie),s=o[8],o[14]||(o[14]=this.element({parent:s||"root"},i));const $={};$.x=100,$.y=800,$.w=200,$.h=100,$.color="0xdc2626ff",$.rotation=100,o[14].nodeId||o[14].populate($),s=o[0],o[15]||(o[15]=this.element({parent:s||"root"},i));const ne={};ne.y=70,ne.x=600,o[15].nodeId||o[15].populate(ne),s=o[15],o[16]||(o[16]=this.element({parent:s||"root"},i));const ee={};ee.x=100,ee.y=0,ee.w=200,ee.h=100,ee.color="0xfee2e2ff",ee.rotation=110,o[16].nodeId||o[16].populate(ee),s=o[15],o[17]||(o[17]=this.element({parent:s||"root"},i));const le={};le.x=100,le.y=150,le.w=200,le.h=100,le.color="0xfecacaff",le.rotation=120,o[17].nodeId||o[17].populate(le),s=o[15],o[18]||(o[18]=this.element({parent:s||"root"},i));const X={};X.x=100,X.y=300,X.w=200,X.h=100,X.color="0xfca5a5ff",X.rotation=130,o[18].nodeId||o[18].populate(X),s=o[15],o[19]||(o[19]=this.element({parent:s||"root"},i));const oe={};oe.x=100,oe.y=450,oe.w=200,oe.h=100,oe.color="0xf87171ff",oe.rotation=140,o[19].nodeId||o[19].populate(oe),s=o[15],o[20]||(o[20]=this.element({parent:s||"root"},i));const re={};re.x=100,re.y=610,re.w=200,re.h=100,re.color="0xef4444ff",re.rotation=150,o[20].nodeId||o[20].populate(re),s=o[15],o[21]||(o[21]=this.element({parent:s||"root"},i));const E={};E.x=100,E.y=800,E.w=200,E.h=100,E.color="0xdc2626ff",E.rotation=160,o[21].nodeId||o[21].populate(E),s=o[0],o[22]||(o[22]=this.element({parent:s||"root"},i));const H={};H.y=70,H.x=900,o[22].nodeId||o[22].populate(H),s=o[22],o[23]||(o[23]=this.element({parent:s||"root"},i));const Q={};Q.x=100,Q.y=0,Q.w=200,Q.h=100,Q.color="0xfee2e2ff",Q.rotation=170,o[23].nodeId||o[23].populate(Q),s=o[22],o[24]||(o[24]=this.element({parent:s||"root"},i));const ge={};ge.x=100,ge.y=150,ge.w=200,ge.h=100,ge.color="0xfecacaff",ge.rotation=180,o[24].nodeId||o[24].populate(ge),s=o[22],o[25]||(o[25]=this.element({parent:s||"root"},i));const ae={};ae.x=100,ae.y=300,ae.w=200,ae.h=100,ae.color="0xfca5a5ff",ae.rotation=190,o[25].nodeId||o[25].populate(ae),s=o[22],o[26]||(o[26]=this.element({parent:s||"root"},i));const q={};q.x=100,q.y=450,q.w=200,q.h=100,q.color="0xf87171ff",q.rotation=200,o[26].nodeId||o[26].populate(q),s=o[22],o[27]||(o[27]=this.element({parent:s||"root"},i));const Y={};Y.x=100,Y.y=610,Y.w=200,Y.h=100,Y.color="0xef4444ff",Y.rotation=210,o[27].nodeId||o[27].populate(Y),s=o[22],o[28]||(o[28]=this.element({parent:s||"root"},i));const K={};K.x=100,K.y=800,K.w=200,K.h=100,K.color="0xdc2626ff",K.rotation=220,o[28].nodeId||o[28].populate(K),s=o[0],o[29]||(o[29]=this.element({parent:s||"root"},i));const de={};de.y=70,de.x=1200,o[29].nodeId||o[29].populate(de),s=o[29],o[30]||(o[30]=this.element({parent:s||"root"},i));const ve={};ve.x=100,ve.y=0,ve.w=200,ve.h=100,ve.color="0xfee2e2ff",ve.rotation=230,o[30].nodeId||o[30].populate(ve),s=o[29],o[31]||(o[31]=this.element({parent:s||"root"},i));const pe={};pe.x=100,pe.y=150,pe.w=200,pe.h=100,pe.color="0xfecacaff",pe.rotation=240,o[31].nodeId||o[31].populate(pe),s=o[29],o[32]||(o[32]=this.element({parent:s||"root"},i));const fe={};fe.x=100,fe.y=300,fe.w=200,fe.h=100,fe.color="0xfca5a5ff",fe.rotation=250,o[32].nodeId||o[32].populate(fe),s=o[29],o[33]||(o[33]=this.element({parent:s||"root"},i));const ke={};ke.x=100,ke.y=450,ke.w=200,ke.h=100,ke.color="0xf87171ff",ke.rotation=260,o[33].nodeId||o[33].populate(ke),s=o[29],o[34]||(o[34]=this.element({parent:s||"root"},i));const we={};we.x=100,we.y=610,we.w=200,we.h=100,we.color="0xef4444ff",we.rotation=270,o[34].nodeId||o[34].populate(we),s=o[29],o[35]||(o[35]=this.element({parent:s||"root"},i));const j={};j.x=100,j.y=800,j.w=200,j.h=100,j.color="0xdc2626ff",j.rotation=280,o[35].nodeId||o[35].populate(j),s=o[0],o[36]||(o[36]=this.element({parent:s||"root"},i));const ye={};ye.y=70,ye.x=1500,o[36].nodeId||o[36].populate(ye),s=o[36],o[37]||(o[37]=this.element({parent:s||"root"},i));const ze={};ze.x=100,ze.y=0,ze.w=200,ze.h=100,ze.color="0xfee2e2ff",ze.rotation=290,o[37].nodeId||o[37].populate(ze),s=o[36],o[38]||(o[38]=this.element({parent:s||"root"},i));const et={};et.x=100,et.y=150,et.w=200,et.h=100,et.color="0xfecacaff",et.rotation=300,o[38].nodeId||o[38].populate(et),s=o[36],o[39]||(o[39]=this.element({parent:s||"root"},i));const We={};We.x=100,We.y=300,We.w=200,We.h=100,We.color="0xfca5a5ff",We.rotation=310,o[39].nodeId||o[39].populate(We),s=o[36],o[40]||(o[40]=this.element({parent:s||"root"},i));const it={};it.x=100,it.y=450,it.w=200,it.h=100,it.color="0xf87171ff",it.rotation=320,o[40].nodeId||o[40].populate(it),s=o[36],o[41]||(o[41]=this.element({parent:s||"root"},i));const Rt={};Rt.x=100,Rt.y=610,Rt.w=200,Rt.h=100,Rt.color="0xef4444ff",Rt.rotation=330,o[41].nodeId||o[41].populate(Rt),s=o[36],o[42]||(o[42]=this.element({parent:s||"root"},i));const ct={};ct.x=100,ct.y=800,ct.w=200,ct.h=100,ct.color="0xdc2626ff",ct.rotation=340,o[42].nodeId||o[42].populate(ct),s=o[0],o[43]||(o[43]=this.element({parent:s||"root"},i));const he={};he.x=200,he.y=200,he.w=400,he.h=400,he.color="0x0891b2ff",he.rotation=i.rotation1,o[43].nodeId||o[43].populate(he),s=o[0],o[44]||(o[44]=this.element({parent:s||"root"},i));const _t={};_t.x=800,_t.y=200,_t.w=400,_t.h=400,_t.color="0x0891b2ff",o[44].nodeId||o[44].populate(_t),s=o[0],o[45]||(o[45]=this.element({parent:s||"root"},i));const kt={};return kt.x=1400,kt.y=200,kt.w=400,kt.h=400,kt.color="0x0891b2ff",o[45].nodeId||o[45].populate(kt),o},effects:[function(s,i,u){i[44].set("rotation",s.rotation2)},function(s,i,u){i[45].set("rotation",{transition:s.rotation3})}],context:{}},state(){return{rotation1:38,rotation2:0,rotation3:0}},hooks:{ready(){let h=800,s=2e3;this.$setInterval(()=>{const i=this.rotation2+10;this.rotation2=i<=360?i:0},h),this.$setInterval(()=>{this.rotation3=Math.max(10,Math.min(720,this.rotation3*2)),this.rotation3===720&&(this.rotation3=0)},s)}}}),_k=He.Component("KeyInput",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.x=525,x.y=130,o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=200,y.h=200,o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=180,d.h=180,d.x=10,d.y=10,o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=180,C.h=180,C.x=230,C.y=10,o[3].nodeId||o[3].populate(C),s=o[0],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.w=180,b.h=180,b.x=450,b.y=10,o[4].nodeId||o[4].populate(b),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.w=180,I.h=180,I.x=670,I.y=10,o[5].nodeId||o[5].populate(I),s=o[0],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.w=180,k.h=180,k.x=10,k.y=220,o[6].nodeId||o[6].populate(k),s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};P.w=180,P.h=180,P.x=230,P.y=220,o[7].nodeId||o[7].populate(P),s=o[0],o[8]||(o[8]=this.element({parent:s||"root"},i));const O={};O.w=180,O.h=180,O.x=450,O.y=220,o[8].nodeId||o[8].populate(O),s=o[0],o[9]||(o[9]=this.element({parent:s||"root"},i));const v={};v.w=180,v.h=180,v.x=670,v.y=220,o[9].nodeId||o[9].populate(v),s=o[0],o[10]||(o[10]=this.element({parent:s||"root"},i));const N={};N.w=180,N.h=180,N.x=10,N.y=430,o[10].nodeId||o[10].populate(N),s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const V={};V.w=180,V.h=180,V.x=230,V.y=430,o[11].nodeId||o[11].populate(V),s=o[0],o[12]||(o[12]=this.element({parent:s||"root"},i));const G={};G.w=180,G.h=180,G.x=450,G.y=430,o[12].nodeId||o[12].populate(G),s=o[0],o[13]||(o[13]=this.element({parent:s||"root"},i));const ie={};ie.w=180,ie.h=180,ie.x=670,ie.y=430,o[13].nodeId||o[13].populate(ie),s=o[0],o[14]||(o[14]=this.element({parent:s||"root"},i));const $={};$.w=180,$.h=180,$.x=10,$.y=640,o[14].nodeId||o[14].populate($),s=o[0],o[15]||(o[15]=this.element({parent:s||"root"},i));const ne={};ne.w=180,ne.h=180,ne.x=230,ne.y=640,o[15].nodeId||o[15].populate(ne),s=o[0],o[16]||(o[16]=this.element({parent:s||"root"},i));const ee={};ee.w=180,ee.h=180,ee.x=450,ee.y=640,o[16].nodeId||o[16].populate(ee),s=o[0],o[17]||(o[17]=this.element({parent:s||"root"},i));const le={};return le.w=180,le.h=180,le.x=670,le.y=640,o[17].nodeId||o[17].populate(le),o},effects:[function(s,i,u){i[1].set("color",s.focusColor)},function(s,i,u){i[1].set("x",s.focusedX*220)},function(s,i,u){i[1].set("y",s.focusedY*210)},function(s,i,u){i[2].set("color",s.blockColor)},function(s,i,u){i[3].set("color",s.blockColor)},function(s,i,u){i[4].set("color",s.blockColor)},function(s,i,u){i[5].set("color",s.blockColor)},function(s,i,u){i[6].set("color",s.blockColor)},function(s,i,u){i[7].set("color",s.blockColor)},function(s,i,u){i[8].set("color",s.blockColor)},function(s,i,u){i[9].set("color",s.blockColor)},function(s,i,u){i[10].set("color",s.blockColor)},function(s,i,u){i[11].set("color",s.blockColor)},function(s,i,u){i[12].set("color",s.blockColor)},function(s,i,u){i[13].set("color",s.blockColor)},function(s,i,u){i[14].set("color",s.blockColor)},function(s,i,u){i[15].set("color",s.blockColor)},function(s,i,u){i[16].set("color",s.blockColor)},function(s,i,u){i[17].set("color",s.blockColor)}],context:{}},state(){return{focusedX:0,focusedY:0,colorscheme:"yellow"}},computed:{blockColor(){return this.colorscheme==="yellow"?"#fef08a":"#bae6fd"},focusColor(){return this.colorscheme==="yellow"?"#facc15":"#38bdf8"}},input:{left(){const h=this.focusedX-1;this.focusedX=Math.max(h,0)},right(){const h=this.focusedX+1;this.focusedX=Math.min(h,3)},up(){this.focusedY=Math.max(this.focusedY-1,0)},down(){this.focusedY=Math.min(this.focusedY+1,3)},enter(){this.colorscheme=this.colorscheme==="yellow"?"blue":"yellow"},any(h){const s=parseInt(h.key);isNaN(s)?this.parent.focus(h):(this.focusedX=Math.max(0,(s-1)%4),this.focusedY=Math.max(0,Math.ceil(s/4)-1))}}}),bh=["#64748b","#ef4444","#f97316","#84cc16","#14b8a6","#3b82f6"],Ah=["Iron Man","Captain America","Thor","Hulk","Black Widow","Hawkeye","Scarlet Witch","Vision","Black Panther","Doctor Strange","Spider-Man","Ant-Man","Wasp","Captain Marvel","Falcon","Winter Soldier","War Machine","Quicksilver","Star-Lord","Gamora"],Lk=He.Component("Texts",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.x=100,x.y=100,o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.content="Default text",d["@loaded"]=i.textLoaded&&i.textLoaded.bind(i),typeof y<"u")for(let pe in y.config.props)delete d[y.config.props[pe]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.content="Default text",C["@loaded"]=i.textLoaded&&i.textLoaded.bind(i),!o[2]){const pe=C.is||"Text";o[2]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.content="123456",I.x=400,typeof b<"u")for(let pe in b.config.props)delete I[b.config.props[pe]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.content="123456",k.x=400,!o[4]){const pe=k.is||"Text";o[4]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}const P=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const O={};if(O.content="Text with a different fontsize",O.y=120,O.font="raleway",typeof P<"u")for(let pe in P.config.props)delete O[P.config.props[pe]];o[5].nodeId||o[5].populate(O),s=o[5];const v={};if(v.content="Text with a different fontsize",v.size=i.size,v.y=120,v.font="raleway",!o[6]){const pe=v.is||"Text";o[6]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:v},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}const N=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const V={};if(V.content="Text with a different color",V.size=50,V.y=250,typeof N<"u")for(let pe in N.config.props)delete V[N.config.props[pe]];o[7].nodeId||o[7].populate(V),s=o[7];const G={};if(G.content="Text with a different color",G.size=50,G.color=i.color,G.y=250,!o[8]){const pe=G.is||"Text";o[8]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:G},o[7],i),o[8][Symbol.for("slots")][0]?(s=o[8][Symbol.for("slots")][0],i=o[8]):s=o[8][Symbol.for("children")][0]}const ie=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[9]||(o[9]=this.element({parent:s||"root"},i));const $={};if($.content="Letterspacing",$.size=50,$.color="0x38bdf8ff",$.y=450,$.letterspacing=40,typeof ie<"u")for(let pe in ie.config.props)delete $[ie.config.props[pe]];o[9].nodeId||o[9].populate($),s=o[9];const ne={};if(ne.content="Letterspacing",ne.size=50,ne.color="0x38bdf8ff",ne.y=450,ne.letterspacing=40,!o[10]){const pe=ne.is||"Text";o[10]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:ne},o[9],i),o[10][Symbol.for("slots")][0]?(s=o[10][Symbol.for("slots")][0],i=o[10]):s=o[10][Symbol.for("children")][0]}s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const ee={};ee.w=800,ee.h=100,ee.y=550,ee.color="0x94a3b8ff",o[11].nodeId||o[11].populate(ee);const le=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[11],o[12]||(o[12]=this.element({parent:s||"root"},i));const X={};if(X.content="Text align center",X.size=50,X.y=15,X.color="0xbae6fdff",X.align="center",X.wordwrap=800,typeof le<"u")for(let pe in le.config.props)delete X[le.config.props[pe]];o[12].nodeId||o[12].populate(X),s=o[12];const oe={};if(oe.content="Text align center",oe.size=50,oe.y=15,oe.color="0xbae6fdff",oe.align="center",oe.wordwrap=800,!o[13]){const pe=oe.is||"Text";o[13]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:oe},o[12],i),o[13][Symbol.for("slots")][0]?(s=o[13][Symbol.for("slots")][0],i=o[13]):s=o[13][Symbol.for("children")][0]}s=o[0],o[14]||(o[14]=this.element({parent:s||"root"},i));const re={};re.w=800,re.h=200,re.x=900,re.y=550,re.color="0x94a3b8ff",o[14].nodeId||o[14].populate(re);const E=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[14],o[15]||(o[15]=this.element({parent:s||"root"},i));const H={};if(H.content=i.longText,H.size=40,H.color="0xbae6fdff",H.wordwrap=800,H.maxlines=5,H.textoverflow="!!!",typeof E<"u")for(let pe in E.config.props)delete H[E.config.props[pe]];o[15].nodeId||o[15].populate(H),s=o[15];const Q={};if(Q.content=i.longText,Q.size=40,Q.color="0xbae6fdff",Q.wordwrap=800,Q.maxlines=5,Q.textoverflow="!!!",!o[16]){const pe=Q.is||"Text";o[16]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:Q},o[15],i),o[16][Symbol.for("slots")][0]?(s=o[16][Symbol.for("slots")][0],i=o[16]):s=o[16][Symbol.for("children")][0]}s=o[0],o[17]||(o[17]=this.element({parent:s||"root"},i));const ge={};ge.w=800,ge.h=120,ge.x=900,ge.y=800,ge.color="0x94a3b8ff",o[17].nodeId||o[17].populate(ge);const ae=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[17],o[18]||(o[18]=this.element({parent:s||"root"},i));const q={};if(q.content=i.longText,q.size=40,q.color="0xbae6fdff",q.wordwrap=800,q.maxlines=2,q.lineheight=60,q.textoverflow=!1,typeof ae<"u")for(let pe in ae.config.props)delete q[ae.config.props[pe]];o[18].nodeId||o[18].populate(q),s=o[18];const Y={};if(Y.content=i.longText,Y.size=40,Y.color="0xbae6fdff",Y.wordwrap=800,Y.maxlines=2,Y.lineheight=60,Y.textoverflow=!1,!o[19]){const pe=Y.is||"Text";o[19]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:Y},o[18],i),o[19][Symbol.for("slots")][0]?(s=o[19][Symbol.for("slots")][0],i=o[19]):s=o[19][Symbol.for("children")][0]}const K=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[20]||(o[20]=this.element({parent:s||"root"},i));const de={};if(de.size=50,de.y=750,de.font="opensans",typeof K<"u")for(let pe in K.config.props)delete de[K.config.props[pe]];o[20].nodeId||o[20].populate(de),s=o[20];const ve={};if(ve.content=i.character,ve.size=50,ve.color=i.color,ve.y=750,ve.font="opensans",!o[21]){const pe=ve.is||"Text";o[21]=(u.components&&u.components[pe]||i[Symbol.for("components")][pe]||(()=>{console.error("component Text not found")})).call(null,{props:ve},o[20],i),o[21][Symbol.for("slots")][0]?(s=o[21][Symbol.for("slots")][0],i=o[21]):s=o[21][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[5].set("size",s.size)},function(s,i,u){i[6][Symbol.for("props")].size=s.size},function(s,i,u){i[7].set("color",s.color)},function(s,i,u){i[8][Symbol.for("props")].color=s.color},function(s,i,u){i[20].set("content",s.character)},function(s,i,u){i[20].set("color",s.color)},function(s,i,u){i[21][Symbol.for("props")].content=s.character},function(s,i,u){i[21][Symbol.for("props")].color=s.color}],context:{}},state(){return{color:bh[0],size:10,character:Ah[0],myText:"This is my test yeah",longText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent at ante non mauris commodo tristique. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut quis mattis mi. Aliquam ultricies mi vel lobortis luctus. Ut non feugiat urna. Duis sed blandit dui. Donec venenatis, mauris at blandit malesuada, elit nibh scelerisque lacus, non tempus arcu mi at justo."}},hooks:{ready(){let h=0;this.$setInterval(()=>{h++,h>bh.length-1&&(h=0),this.color=bh[h],this.size=10*(h*2+1)},1e3);let s=0;this.$setInterval(()=>{s++,s>Ah.length-1&&(s=0),this.character=Ah[s]},1400)}},methods:{textLoaded(h){this.$log.info(`Image loaded with w: ${h.w} and h: ${h.h}`)}}}),nf=["https://images.unsplash.com/photo-1690360994204-3d10cc73a08d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=428&q=80","https://images.unsplash.com/photo-1582971103098-bfc707d2ad92?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=428&q=80"],Nk=He.Component("Images",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.src="assets/lightningbolt.png",y.w=428,y.h=234,y.x=100,y.y=100,o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.src="https://images.unsplash.com/photo-1611148799269-63df34f63f6c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=428&q=80",d.w=428,d.h=234,d.x=100,d.y=400,o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=428,C.h=234,C.x=100,C.y=700,C["@loaded"]=i.imageLoaded&&i.imageLoaded.bind(i),o[3].nodeId||o[3].populate(C),s=o[0],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.color="{top: '0xff0000ff', bottom: '0xffd700ff'}",b.src="assets/lightningbolt.png",b.w=428,b.h=234,b.x=600,b.y=100,o[4].nodeId||o[4].populate(b),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.x=600,I.y=400,I.w=428,I.h=234,o[5].nodeId||o[5].populate(I),s=o[5],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.src="assets/lightningbolt.png",k.w=856,k.h=468,o[6].nodeId||o[6].populate(k),s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};return P.src="assets/lightningbolt.png",P.w=428,P.h=234,P.x=1100,P.y=100,o[7].nodeId||o[7].populate(P),o},effects:[function(s,i,u){i[3].set("src",s.image)},function(s,i,u){i[5].set("clipping",s.clipping)},function(s,i,u){i[7].set("color",s.color)}],context:{}},state(){return{image:nf[0],clipping:!0,color:"red"}},hooks:{ready(){this.$setInterval(()=>{this.image=this.image===nf[0]?nf[1]:nf[0],this.clipping=!this.clipping,this.color=this.color==="red"?"blue":"red"},2e3)}},methods:{imageLoaded(h){console.log("backstopjs:ready"),this.$log.info(`Image loaded with w: ${h.w} and h: ${h.h}`)}}}),ds=He.Component("Square",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){i[0].set("w",{transition:s.size})},function(s,i,u){i[0].set("h",{transition:s.size})},function(s,i,u){i[0].set("color",{transition:s.color})}],context:{}},props:[{key:"size",default:80}],state(){return{color:"#86198f"}},watch:{size(h,s){this.$log.info(`Size changed from ${s} to ${h}`),this.color=this.color==="#86198f"?"#9d174d":"#86198f"}}}),y2=He.Component("Card",{components:{Square:ds},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=i.w,x.h=i.h,x.color="0x0891b2ff",o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.x=80,d.y=80,typeof y<"u")for(let P in y.config.props)delete d[y.config.props[P]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.x=80,C.y=80,!o[2]){const P=C.is||"Square";o[2]=(u.components&&u.components[P]||i[Symbol.for("components")][P]||(()=>{console.error("component Square not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.x=20,I.y=20,I.size=40,typeof b<"u")for(let P in b.config.props)delete I[b.config.props[P]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.x=20,k.y=20,k.size=40,!o[4]){const P=k.is||"Square";o[4]=(u.components&&u.components[P]||i[Symbol.for("components")][P]||(()=>{console.error("component Square not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}return o},effects:[],context:{}},props:["size"],computed:{w(){return this.size==="large"?400:200},h(){return this.size==="large"?500:300}}}),Pk=He.Component("Components",{components:{Square:ds,Card:y2},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.x=100,d.y=100,d.size=50,typeof y<"u")for(let de in y.config.props)delete d[y.config.props[de]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.x=100,C.y=100,C.size=50,!o[2]){const de=C.is||"Square";o[2]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Square not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.x=100,I.y=200,I.size=100,typeof b<"u")for(let de in b.config.props)delete I[b.config.props[de]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.x=100,k.y=200,k.size=100,!o[4]){const de=k.is||"Square";o[4]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Square not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}const P=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const O={};if(O.x=100,O.y=350,O.size=200,typeof P<"u")for(let de in P.config.props)delete O[P.config.props[de]];o[5].nodeId||o[5].populate(O),s=o[5];const v={};if(v.x=100,v.y=350,v.size=200,!o[6]){const de=v.is||"Square";o[6]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Square not found")})).call(null,{props:v},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}const N=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const V={};if(V.y=600,V.size=50,typeof N<"u")for(let de in N.config.props)delete V[N.config.props[de]];o[7].nodeId||o[7].populate(V),s=o[7];const G={};if(G.x={transition:i.x},G.y=600,G.size=50,!o[8]){const de=G.is||"Square";o[8]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Square not found")})).call(null,{props:G},o[7],i),o[8][Symbol.for("slots")][0]?(s=o[8][Symbol.for("slots")][0],i=o[8]):s=o[8][Symbol.for("children")][0]}const ie=u.components&&u.components.Card||i[Symbol.for("components")].Card;s=o[0],o[9]||(o[9]=this.element({parent:s||"root"},i));const $={};if($.x=500,$.y=100,typeof ie<"u")for(let de in ie.config.props)delete $[ie.config.props[de]];o[9].nodeId||o[9].populate($),s=o[9];const ne={};if(ne.x=500,ne.y=100,!o[10]){const de=ne.is||"Card";o[10]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Card not found")})).call(null,{props:ne},o[9],i),o[10][Symbol.for("slots")][0]?(s=o[10][Symbol.for("slots")][0],i=o[10]):s=o[10][Symbol.for("children")][0]}const ee=u.components&&u.components.Card||i[Symbol.for("components")].Card;s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const le={};if(le.x=500,le.y=500,le.size="large",typeof ee<"u")for(let de in ee.config.props)delete le[ee.config.props[de]];o[11].nodeId||o[11].populate(le),s=o[11];const X={};if(X.x=500,X.y=500,X.size="large",!o[12]){const de=X.is||"Card";o[12]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Card not found")})).call(null,{props:X},o[11],i),o[12][Symbol.for("slots")][0]?(s=o[12][Symbol.for("slots")][0],i=o[12]):s=o[12][Symbol.for("children")][0]}const oe=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[0],o[13]||(o[13]=this.element({parent:s||"root"},i));const re={};if(re.x=100,re.y=750,typeof oe<"u")for(let de in oe.config.props)delete re[oe.config.props[de]];o[13].nodeId||o[13].populate(re),s=o[13];const E={};if(E.x=100,E.y=750,E.size=i.size,!o[14]){const de=E.is||"Square";o[14]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Square not found")})).call(null,{props:E},o[13],i),o[14][Symbol.for("slots")][0]?(s=o[14][Symbol.for("slots")][0],i=o[14]):s=o[14][Symbol.for("children")][0]}s=o[0],o[15]||(o[15]=this.element({parent:s||"root"},i));const H={};H.x=1100,H.y=200,o[15].nodeId||o[15].populate(H);const Q=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[15],o[16]||(o[16]=this.element({parent:s||"root"},i));const ge={};if(ge.content="Dynamic components",typeof Q<"u")for(let de in Q.config.props)delete ge[Q.config.props[de]];o[16].nodeId||o[16].populate(ge),s=o[16];const ae={};if(ae.content="Dynamic components",!o[17]){const de=ae.is||"Text";o[17]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Text not found")})).call(null,{props:ae},o[16],i),o[17][Symbol.for("slots")][0]?(s=o[17][Symbol.for("slots")][0],i=o[17]):s=o[17][Symbol.for("children")][0]}const q=u.components&&u.components.Component||i[Symbol.for("components")].Component;s=o[15],o[18]||(o[18]=this.element({parent:s||"root"},i));const Y={};if(Y.is=i.dynamicComponent,Y.y=100,typeof q<"u")for(let de in q.config.props)delete Y[q.config.props[de]];o[18].nodeId||o[18].populate(Y),s=o[18];const K={};if(K.is=i.dynamicComponent,K.y=100,!o[19]){const de=K.is||"Component";o[19]=(u.components&&u.components[de]||i[Symbol.for("components")][de]||(()=>{console.error("component Component not found")})).call(null,{props:K},o[18],i),o[19][Symbol.for("slots")][0]?(s=o[19][Symbol.for("slots")][0],i=o[19]):s=o[19][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[7].set("x",{transition:s.x})},function(s,i,u){i[8][Symbol.for("props")].x={transition:s.x}},function(s,i,u){i[13].set("size",s.size)},function(s,i,u){i[14][Symbol.for("props")].size=s.size},function(s,i,u){parent=i[15];const o=s.dynamicComponents||[],x=[];for(let y=0;y{console.error("component Component not found")})).call(null,{props:I},i[20][d.key],s),i[21][d.key][Symbol.for("slots")][0]?(parent=i[21][d.key][Symbol.for("slots")][0],s=i[21][d.key]):parent=i[21][d.key][Symbol.for("children")][0]}i[20][d.key].set("x",250*d.index),i[21][d.key][Symbol.for("props")].x=250*d.index}i[20]&&Object.keys(i[20]).forEach(y=>{x.indexOf(y)===-1&&(i[20][y].destroy&&i[20][y].destroy(),delete i[1][y])})}],context:{}},state(){return{x:100,dynamicComponent:"Square",dynamicComponents:["Square","Card","Square"],toggle:!1,size:50}},hooks:{ready(){this.$setInterval(()=>{this.x=this.x===100?250:100,this.size=this.size===50?200:50},2e3)}}}),Pn=["#bbf7d0","#86efac","#4ade80","#22c55e","#16a34a","#15803d"],Dk=He.Component("ForLoop",{components:{Square:ds},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.y=20,o[1].nodeId||o[1].populate(y),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const d={};d.y=120,o[3].nodeId||o[3].populate(d),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const C={};C.y=220,o[5].nodeId||o[5].populate(C),s=o[0],o[7]||(o[7]=this.element({parent:s||"root"},i));const b={};b.y=320,o[7].nodeId||o[7].populate(b),s=o[0],o[10]||(o[10]=this.element({parent:s||"root"},i));const I={};I.y=420,o[10].nodeId||o[10].populate(I),s=o[0],o[13]||(o[13]=this.element({parent:s||"root"},i));const k={};k.y=520,o[13].nodeId||o[13].populate(k),s=o[0],o[15]||(o[15]=this.element({parent:s||"root"},i));const P={};P.y=620,o[15].nodeId||o[15].populate(P),s=o[0],o[17]||(o[17]=this.element({parent:s||"root"},i));const O={};O.y=720,o[17].nodeId||o[17].populate(O),s=o[0],o[19]||(o[19]=this.element({parent:s||"root"},i));const v={};v.y=720,v.x=700,o[19].nodeId||o[19].populate(v),s=o[0],o[21]||(o[21]=this.element({parent:s||"root"},i));const N={};N.y=920,o[21].nodeId||o[21].populate(N),s=o[0],o[24]||(o[24]=this.element({parent:s||"root"},i));const V={};return V.y=920,V.x=700,o[24].nodeId||o[24].populate(V),o},effects:[function(s,i,u){parent=i[1];const o=s.collection1||[],x=[];for(let y=0;y{x.indexOf(y)===-1&&(i[2][y].destroy&&i[2][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[3];const o=s.collection2||[],x=[];for(let y=0;y{x.indexOf(y)===-1&&(i[4][y].destroy&&i[4][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[5];const o=s.collection3||[],x=[];for(let y=0;y{x.indexOf(y)===-1&&(i[6][y].destroy&&i[6][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[7];const o=s.collection2||[],x=[];for(let y=0;y{console.error("component Square not found")})).call(null,{props:I},i[8][d.key],s),i[9][d.key][Symbol.for("slots")][0]?(parent=i[9][d.key][Symbol.for("slots")][0],s=i[9][d.key]):parent=i[9][d.key][Symbol.for("children")][0]}i[8][d.key].set("x",d.item.x*d.index),i[8][d.key].set("ref","square"+d.index),i[8][d.key].set("alpha",d.alpha),i[9][d.key][Symbol.for("props")].x=d.item.x*d.index,i[9][d.key][Symbol.for("props")].ref="square"+d.index,i[9][d.key][Symbol.for("props")].alpha=d.alpha}i[8]&&Object.keys(i[8]).forEach(y=>{x.indexOf(y)===-1&&(i[8][y].destroy&&i[8][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[10];const o=s.collection3||[],x=[];for(let y=0;y{console.error("component Square not found")})).call(null,{props:I},i[11][d.item.color],s),i[12][d.item.color][Symbol.for("slots")][0]?(parent=i[12][d.item.color][Symbol.for("slots")][0],s=i[12][d.item.color]):parent=i[12][d.item.color][Symbol.for("children")][0]}i[11][d.item.color].set("x",d.item.x),i[11][d.item.color].set("alpha",d.alpha),i[12][d.item.color][Symbol.for("props")].x=d.item.x,i[12][d.item.color][Symbol.for("props")].alpha=d.alpha}i[11]&&Object.keys(i[11]).forEach(y=>{x.indexOf(y)===-1&&(i[11][y].destroy&&i[11][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[13];const o=s.collection1||[],x=[];for(let y=0;y{x.indexOf(y)===-1&&(i[14][y].destroy&&i[14][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[15];const o=s.collection2||[],x=[];for(let y=0;y{x.indexOf(y)===-1&&(i[16][y].destroy&&i[16][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[17];const o=s.collection4||[],x=[];for(let y=0;y{x.indexOf(y)===-1&&(i[18][y].destroy&&i[18][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[19];const o=s.collection4||[],x=[];for(let y=0;y{x.indexOf(y)===-1&&(i[20][y].destroy&&i[20][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[21];const o=s.collection4||[],x=[];for(let y=0;y{console.error("component Square not found")})).call(null,{props:I},i[22][d.item.id],s),i[23][d.item.id][Symbol.for("slots")][0]?(parent=i[23][d.item.id][Symbol.for("slots")][0],s=i[23][d.item.id]):parent=i[23][d.item.id][Symbol.for("children")][0]}i[22][d.item.id].set("x",d.item.x),i[23][d.item.id][Symbol.for("props")].x=d.item.x}i[22]&&Object.keys(i[22]).forEach(y=>{x.indexOf(y)===-1&&(i[22][y].destroy&&i[22][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[24];const o=s.collection4||[],x=[];for(let y=0;y{console.error("component Square not found")})).call(null,{props:I},i[25][d.key],s),i[26][d.key][Symbol.for("slots")][0]?(parent=i[26][d.key][Symbol.for("slots")][0],s=i[26][d.key]):parent=i[26][d.key][Symbol.for("children")][0]}i[25][d.key].set("x",d.item.x),i[26][d.key][Symbol.for("props")].x=d.item.x}i[25]&&Object.keys(i[25]).forEach(y=>{x.indexOf(y)===-1&&(i[25][y].destroy&&i[25][y].destroy(),delete i[1][y])})}],context:{}},state(){return{collection1:[0,100,200,300,400,500],collection2:[{id:"block1",x:0,color:Pn[0]},{id:"block2",x:100,color:Pn[1]},{id:"block3",x:200,color:Pn[2]},{id:"block4",x:300,color:Pn[3]},{id:"block5",x:400,color:Pn[4]},{id:"block6",x:500,color:Pn[5]}],collection3:[],collection4:[{x:0,id:"one"},{x:200,id:"two"},{x:400,id:"three"}],alpha:.5}},hooks:{ready(){this.$setTimeout(()=>{this.collection2[0].color=Pn[5],this.collection2[1].color=Pn[4],this.collection2[2].color=Pn[3],this.collection2[3].color=Pn[2],this.collection2[4].color=Pn[1],this.collection2[5].color=Pn[0]},4e3);let h=0;const s=this.$setInterval(()=>{this.collection3.push({x:h*100,color:Pn[h]}),h++,h===Pn.length&&clearInterval(s)},1e3);this.$setTimeout(()=>{this.alpha=this.alpha===.5?1:.5},800),this.$setTimeout(()=>{this.collection4=[{x:100,id:4},{x:500,id:5}]},2e3)}}}),bx=["pretty","large","big","small","tall","short","long","handsome","plain","quaint","clean","elegant","easy","angry","crazy","helpful","mushy","odd","unsightly","adorable","important","inexpensive","cheap","expensive","fancy"],Ax=["red","yellow","blue","green","pink","brown","purple","brown","white","black","orange"],kx=["table","chair","house","bbq","desk","car","pony","cookie","sandwich","burger","pizza","mouse","keyboard"],kh=h=>Math.round(Math.random()*1e3)%h;let Ok=0;const Ra=()=>({id:Ok++,text:`${bx[kh(bx.length)]} ${Ax[kh(Ax.length)]} ${kx[kh(kx.length)]}`}),Uk=(h=1)=>{const s=[];for(let i=0;i{console.error("component Circle not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.color="0xe5e5e5ff",I.size=32,I.y=10,I.wordwrap=57,I.align="center",I.content=""+i.id,typeof b<"u")for(let N in b.config.props)delete I[b.config.props[N]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.color="0xe5e5e5ff",k.size=32,k.y=10,k.wordwrap=57,k.align="center",k.content=""+i.id,!o[4]){const N=k.is||"Text";o[4]=(u.components&&u.components[N]||i[Symbol.for("components")][N]||(()=>{console.error("component Text not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}const P=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const O={};if(O.color="0xe5e5e5ff",O.x=80,O.y=14,O.size=28,O.content=""+i.text,typeof P<"u")for(let N in P.config.props)delete O[P.config.props[N]];o[5].nodeId||o[5].populate(O),s=o[5];const v={};if(v.color="0xe5e5e5ff",v.x=80,v.y=14,v.size=28,v.content=""+i.text,!o[6]){const N=v.is||"Text";o[6]=(u.components&&u.components[N]||i[Symbol.for("components")][N]||(()=>{console.error("component Text not found")})).call(null,{props:v},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}return o},effects:[],context:{}},props:["id","text"]}),v2=He.Component("Row",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=500,x.h=60,x.color="0xfff7edff",o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=10,y.h=60,y.color="0x06b6d4ff",o[1].nodeId||o[1].populate(y);const d=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const C={};if(C.content=i.text,C.x=30,C.y=10,C.font="opensans",C.color="0x1e293bff",typeof d<"u")for(let I in d.config.props)delete C[d.config.props[I]];o[2].nodeId||o[2].populate(C),s=o[2];const b={};if(b.content=i.text,b.x=30,b.y=10,b.font="opensans",b.color="0x1e293bff",!o[3]){const I=b.is||"Text";o[3]=(u.components&&u.components[I]||i[Symbol.for("components")][I]||(()=>{console.error("component Text not found")})).call(null,{props:b},o[2],i),o[3][Symbol.for("slots")][0]?(s=o[3][Symbol.for("slots")][0],i=o[3]):s=o[3][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("y",s.index*80)}],context:{}},props:["index","text"]}),jk=He.Component("Row",{components:{Row:v2},code:{render:function(s,i,u){return[]},effects:[function(s,i,u){const o=s.data||[],x=[];for(let y=0;y{console.error("component Row not found")})).call(null,{props:I},i[0][d.item.id+"key2"],s),i[1][d.item.id+"key2"][Symbol.for("slots")][0]?(parent=i[1][d.item.id+"key2"][Symbol.for("slots")][0],s=i[1][d.item.id+"key2"]):parent=i[1][d.item.id+"key2"][Symbol.for("children")][0]}i[0][d.item.id+"key2"].set("index",d.index),i[1][d.item.id+"key2"][Symbol.for("props")].index=d.index}i[0]&&Object.keys(i[0]).forEach(y=>{x.indexOf(y)===-1&&(i[0][y].destroy&&i[0][y].destroy(),delete i[1][y])})}],context:{}},props:["data"]}),Fk=He.Component("ForLoop",{components:{Square:ds,LegendItem:Bk,Row:v2,Rows:jk},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.x=100,d.y=60,d.size=48,d.content="Array operations test",typeof y<"u")for(let Te in y.config.props)delete d[y.config.props[Te]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.x=100,C.y=60,C.size=48,C.content="Array operations test",!o[2]){const Te=C.is||"Text";o[2]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component Text not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const b={};b.y=170,b.x=140,o[3].nodeId||o[3].populate(b),s=o[3],o[4]||(o[4]=this.element({parent:s||"root"},i));const I={};I.x=-10,I.w=500,I.h=80,I.color="0x64748bff",o[4].nodeId||o[4].populate(I);const k=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[5]||(o[5]=this.element({parent:s||"root"},i));const P={};if(P.y=0,P.id="a",P.text="Fill array by assignment",typeof k<"u")for(let Te in k.config.props)delete P[k.config.props[Te]];o[5].nodeId||o[5].populate(P),s=o[5];const O={};if(O.y=0,O.id="a",O.text="Fill array by assignment",!o[6]){const Te=O.is||"LegendItem";o[6]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:O},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}const v=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[7]||(o[7]=this.element({parent:s||"root"},i));const N={};if(N.y=90,N.id="b",N.text="Push new item to array",typeof v<"u")for(let Te in v.config.props)delete N[v.config.props[Te]];o[7].nodeId||o[7].populate(N),s=o[7];const V={};if(V.y=90,V.id="b",V.text="Push new item to array",!o[8]){const Te=V.is||"LegendItem";o[8]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:V},o[7],i),o[8][Symbol.for("slots")][0]?(s=o[8][Symbol.for("slots")][0],i=o[8]):s=o[8][Symbol.for("children")][0]}const G=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[9]||(o[9]=this.element({parent:s||"root"},i));const ie={};if(ie.y=180,ie.id="c",ie.text="Pop item from array",typeof G<"u")for(let Te in G.config.props)delete ie[G.config.props[Te]];o[9].nodeId||o[9].populate(ie),s=o[9];const $={};if($.y=180,$.id="c",$.text="Pop item from array",!o[10]){const Te=$.is||"LegendItem";o[10]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:$},o[9],i),o[10][Symbol.for("slots")][0]?(s=o[10][Symbol.for("slots")][0],i=o[10]):s=o[10][Symbol.for("children")][0]}const ne=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[11]||(o[11]=this.element({parent:s||"root"},i));const ee={};if(ee.y=270,ee.id="d",ee.text="Shift item from array",typeof ne<"u")for(let Te in ne.config.props)delete ee[ne.config.props[Te]];o[11].nodeId||o[11].populate(ee),s=o[11];const le={};if(le.y=270,le.id="d",le.text="Shift item from array",!o[12]){const Te=le.is||"LegendItem";o[12]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:le},o[11],i),o[12][Symbol.for("slots")][0]?(s=o[12][Symbol.for("slots")][0],i=o[12]):s=o[12][Symbol.for("children")][0]}const X=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[13]||(o[13]=this.element({parent:s||"root"},i));const oe={};if(oe.y=360,oe.id="e",oe.text="Splice 2 items from array",typeof X<"u")for(let Te in X.config.props)delete oe[X.config.props[Te]];o[13].nodeId||o[13].populate(oe),s=o[13];const re={};if(re.y=360,re.id="e",re.text="Splice 2 items from array",!o[14]){const Te=re.is||"LegendItem";o[14]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:re},o[13],i),o[14][Symbol.for("slots")][0]?(s=o[14][Symbol.for("slots")][0],i=o[14]):s=o[14][Symbol.for("children")][0]}const E=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[15]||(o[15]=this.element({parent:s||"root"},i));const H={};if(H.y=450,H.id="f",H.text="Unshift 2 items into array",typeof E<"u")for(let Te in E.config.props)delete H[E.config.props[Te]];o[15].nodeId||o[15].populate(H),s=o[15];const Q={};if(Q.y=450,Q.id="f",Q.text="Unshift 2 items into array",!o[16]){const Te=Q.is||"LegendItem";o[16]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:Q},o[15],i),o[16][Symbol.for("slots")][0]?(s=o[16][Symbol.for("slots")][0],i=o[16]):s=o[16][Symbol.for("children")][0]}const ge=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[17]||(o[17]=this.element({parent:s||"root"},i));const ae={};if(ae.y=540,ae.id="g",ae.text="Empty array by assignment",typeof ge<"u")for(let Te in ge.config.props)delete ae[ge.config.props[Te]];o[17].nodeId||o[17].populate(ae),s=o[17];const q={};if(q.y=540,q.id="g",q.text="Empty array by assignment",!o[18]){const Te=q.is||"LegendItem";o[18]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:q},o[17],i),o[18][Symbol.for("slots")][0]?(s=o[18][Symbol.for("slots")][0],i=o[18]):s=o[18][Symbol.for("children")][0]}const Y=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[19]||(o[19]=this.element({parent:s||"root"},i));const K={};if(K.y=630,K.id="h",K.text="Concat an array with items",typeof Y<"u")for(let Te in Y.config.props)delete K[Y.config.props[Te]];o[19].nodeId||o[19].populate(K),s=o[19];const de={};if(de.y=630,de.id="h",de.text="Concat an array with items",!o[20]){const Te=de.is||"LegendItem";o[20]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:de},o[19],i),o[20][Symbol.for("slots")][0]?(s=o[20][Symbol.for("slots")][0],i=o[20]):s=o[20][Symbol.for("children")][0]}const ve=u.components&&u.components.LegendItem||i[Symbol.for("components")].LegendItem;s=o[3],o[21]||(o[21]=this.element({parent:s||"root"},i));const pe={};if(pe.y=720,pe.id="i",pe.text="Sort array alphabetically",typeof ve<"u")for(let Te in ve.config.props)delete pe[ve.config.props[Te]];o[21].nodeId||o[21].populate(pe),s=o[21];const fe={};if(fe.y=720,fe.id="i",fe.text="Sort array alphabetically",!o[22]){const Te=fe.is||"LegendItem";o[22]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component LegendItem not found")})).call(null,{props:fe},o[21],i),o[22][Symbol.for("slots")][0]?(s=o[22][Symbol.for("slots")][0],i=o[22]):s=o[22][Symbol.for("children")][0]}s=o[3],o[23]||(o[23]=this.element({parent:s||"root"},i));const ke={};ke.y=840,o[23].nodeId||o[23].populate(ke);const we=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[23],o[24]||(o[24]=this.element({parent:s||"root"},i));const j={};if(j.size=26,j.y=10,j.content="Array length:",typeof we<"u")for(let Te in we.config.props)delete j[we.config.props[Te]];o[24].nodeId||o[24].populate(j),s=o[24];const ye={};if(ye.size=26,ye.y=10,ye.content="Array length:",!o[25]){const Te=ye.is||"Text";o[25]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component Text not found")})).call(null,{props:ye},o[24],i),o[25][Symbol.for("slots")][0]?(s=o[25][Symbol.for("slots")][0],i=o[25]):s=o[25][Symbol.for("children")][0]}const ze=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[23],o[26]||(o[26]=this.element({parent:s||"root"},i));const et={};if(et.size=40,et.x=180,et.color="0xfb923cff",typeof ze<"u")for(let Te in ze.config.props)delete et[ze.config.props[Te]];o[26].nodeId||o[26].populate(et),s=o[26];const We={};if(We.content=i.data.length,We.size=40,We.x=180,We.color="0xfb923cff",!o[27]){const Te=We.is||"Text";o[27]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component Text not found")})).call(null,{props:We},o[26],i),o[27][Symbol.for("slots")][0]?(s=o[27][Symbol.for("slots")][0],i=o[27]):s=o[27][Symbol.for("children")][0]}s=o[0],o[28]||(o[28]=this.element({parent:s||"root"},i));const it={};it.x=740,it.y=100,o[28].nodeId||o[28].populate(it);const Rt=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[28],o[29]||(o[29]=this.element({parent:s||"root"},i));const ct={};if(ct.content="For loop on Element",typeof Rt<"u")for(let Te in Rt.config.props)delete ct[Rt.config.props[Te]];o[29].nodeId||o[29].populate(ct),s=o[29];const he={};if(he.content="For loop on Element",!o[30]){const Te=he.is||"Text";o[30]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component Text not found")})).call(null,{props:he},o[29],i),o[30][Symbol.for("slots")][0]?(s=o[30][Symbol.for("slots")][0],i=o[30]):s=o[30][Symbol.for("children")][0]}s=o[0],o[35]||(o[35]=this.element({parent:s||"root"},i));const _t={};_t.x=1280,_t.y=100,o[35].nodeId||o[35].populate(_t);const kt=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[35],o[36]||(o[36]=this.element({parent:s||"root"},i));const Lt={};if(Lt.content="For loop on Component",typeof kt<"u")for(let Te in kt.config.props)delete Lt[kt.config.props[Te]];o[36].nodeId||o[36].populate(Lt),s=o[36];const Yt={};if(Yt.content="For loop on Component",!o[37]){const Te=Yt.is||"Text";o[37]=(u.components&&u.components[Te]||i[Symbol.for("components")][Te]||(()=>{console.error("component Text not found")})).call(null,{props:Yt},o[36],i),o[37][Symbol.for("slots")][0]?(s=o[37][Symbol.for("slots")][0],i=o[37]):s=o[37][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[4].set("y",{transition:s.y})},function(s,i,u){i[4].set("alpha",{transition:!s.hide})},function(s,i,u){i[26].set("content",s.data.length)},function(s,i,u){i[27][Symbol.for("props")].content=s.data.length},function(s,i,u){parent=i[28];const o=s.data||[],x=[];for(let y=0;y{console.error("component Text not found")})).call(null,{props:P},i[33][d.item.id+"key"],s),i[34][d.item.id+"key"][Symbol.for("slots")][0]?(parent=i[34][d.item.id+"key"][Symbol.for("slots")][0],s=i[34][d.item.id+"key"]):parent=i[34][d.item.id+"key"][Symbol.for("children")][0]}i[31][d.item.id+"key"].set("y",d.index*80+50)}i[31]&&Object.keys(i[31]).forEach(y=>{x.indexOf(y)===-1&&(i[31][y].destroy&&i[31][y].destroy(),delete i[1][y])})},function(s,i,u){parent=i[35];const o=s.data||[],x=[];for(let y=0;y{console.error("component Row not found")})).call(null,{props:I},i[38][d.item.id+"key2"],s),i[39][d.item.id+"key2"][Symbol.for("slots")][0]?(parent=i[39][d.item.id+"key2"][Symbol.for("slots")][0],s=i[39][d.item.id+"key2"]):parent=i[39][d.item.id+"key2"][Symbol.for("children")][0]}i[38][d.item.id+"key2"].set("index",d.index),i[39][d.item.id+"key2"][Symbol.for("props")].index=d.index}i[38]&&Object.keys(i[38]).forEach(y=>{x.indexOf(y)===-1&&(i[38][y].destroy&&i[38][y].destroy(),delete i[1][y])})}],context:{}},state(){return{count:0,data:[],x:0,y:0,timeout:null,hide:!0,sortDirection:1}},computed:{show(){return this.hide>0},data2(){return this.data}},watch:{y(){this.hide=!1,this.$clearTimeout(this.timeout),this.timeout=this.$setTimeout(()=>{this.hide=!0},600)}},input:{a(){this.y=-10,this.$trigger("y");const h=[];for(let s=0;s<6;s++)h.push(Ra());this.data=h},b(){this.y=80,this.$trigger("y"),this.data.push(Ra())},c(){this.y=170,this.$trigger("y"),this.data.pop()},d(){this.y=260,this.$trigger("y"),this.data.shift()},e(){this.y=350,this.$trigger("y"),this.data.splice(2,4)},f(){this.y=440,this.$trigger("y"),this.data.unshift(Ra(),Ra())},g(){this.y=530,this.$trigger("y"),this.data=[]},h(){this.y=620,this.$trigger("y"),this.data=this.data.concat(Uk(3))},i(){this.y=710,this.$trigger("y"),this.data=this.data.sort((h,s)=>{const i=h.text.toLowerCase(),u=s.text.toLowerCase();return this.sortDirection=this.sortDirection===1?0:1,this.sortDirection===1?iu?1:0:i>u?-1:i{const s=this.direction==="up"?this.radius+10:this.radius-10;this.radius=Math.max(Math.min(s,80),0),this.radius===80&&(this.direction="down"),this.radius===0&&(this.direction="up")},500);let h=0;this.$setInterval(()=>{h++,h%2?this.effects=[this.shader("borderLeft",{width:20,color:"#be123c"}),this.shader("borderRight",{width:20,color:"#f43f5e"})]:this.effects=[this.shader("borderTop",{width:20,color:"#be123c"}),this.shader("borderBottom",{width:20,color:"#f43f5e"})]},2e3)}}}),Vk=He.Component("ShowIf",{components:{Square:ds},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.y=40,o[1].nodeId||o[1].populate(y),s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.x=50,d.w=200,d.h=300,d.color="0xbef264ff",d.show=!0,o[2].nodeId||o[2].populate(d),s=o[1],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.x=350,C.w=200,C.h=300,C.color="0xff0000ff",C.show=!1,o[3].nodeId||o[3].populate(C),s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.x=650,b.w=200,b.h=300,b.color="0x84cc16ff",b.show=1,o[4].nodeId||o[4].populate(b),s=o[1],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};I.x=950,I.w=200,I.h=300,I.color="0xff0000ff",I.show=0,o[5].nodeId||o[5].populate(I),s=o[0],o[6]||(o[6]=this.element({parent:s||"root"},i));const k={};k.y=380,o[6].nodeId||o[6].populate(k),s=o[6],o[7]||(o[7]=this.element({parent:s||"root"},i));const P={};P.x=50,P.w=200,P.h=300,P.color="0xfde047ff",P.show=i.showNr,o[7].nodeId||o[7].populate(P),s=o[6],o[8]||(o[8]=this.element({parent:s||"root"},i));const O={};O.x=350,O.w=200,O.h=300,O.color="0x0000ffff",O.show=i.hideNr,o[8].nodeId||o[8].populate(O),s=o[6],o[9]||(o[9]=this.element({parent:s||"root"},i));const v={};v.x=650,v.w=200,v.h=300,v.color="0x84cc16ff",v.show=i.showBool,o[9].nodeId||o[9].populate(v),s=o[6],o[10]||(o[10]=this.element({parent:s||"root"},i));const N={};N.x=950,N.w=200,N.h=300,N.color="0xff0000ff",N.show=i.hideBool,o[10].nodeId||o[10].populate(N),s=o[0],o[11]||(o[11]=this.element({parent:s||"root"},i));const V={};V.y=720,o[11].nodeId||o[11].populate(V),s=o[11],o[12]||(o[12]=this.element({parent:s||"root"},i));const G={};G.x=50,G.w=200,G.h=300,G.color="0x5eead4ff",o[12].nodeId||o[12].populate(G),s=o[0],o[13]||(o[13]=this.element({parent:s||"root"},i));const ie={};ie.y=40,ie.x=1e3,o[13].nodeId||o[13].populate(ie);const $=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[13],o[14]||(o[14]=this.element({parent:s||"root"},i));const ne={};if(ne.show=!0,typeof $<"u")for(let Q in $.config.props)delete ne[$.config.props[Q]];o[14].nodeId||o[14].populate(ne),s=o[14];const ee={};if(ee.show=!0,!o[15]){const Q=ee.is||"Square";o[15]=(u.components&&u.components[Q]||i[Symbol.for("components")][Q]||(()=>{console.error("component Square not found")})).call(null,{props:ee},o[14],i),o[15][Symbol.for("slots")][0]?(s=o[15][Symbol.for("slots")][0],i=o[15]):s=o[15][Symbol.for("children")][0]}const le=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[13],o[16]||(o[16]=this.element({parent:s||"root"},i));const X={};if(X.y=100,X.show=!1,typeof le<"u")for(let Q in le.config.props)delete X[le.config.props[Q]];o[16].nodeId||o[16].populate(X),s=o[16];const oe={};if(oe.y=100,oe.show=!1,!o[17]){const Q=oe.is||"Square";o[17]=(u.components&&u.components[Q]||i[Symbol.for("components")][Q]||(()=>{console.error("component Square not found")})).call(null,{props:oe},o[16],i),o[17][Symbol.for("slots")][0]?(s=o[17][Symbol.for("slots")][0],i=o[17]):s=o[17][Symbol.for("children")][0]}const re=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[13],o[18]||(o[18]=this.element({parent:s||"root"},i));const E={};if(E.y=200,typeof re<"u")for(let Q in re.config.props)delete E[re.config.props[Q]];o[18].nodeId||o[18].populate(E),s=o[18];const H={};if(H.y=200,H.show=i.showHideToggle,!o[19]){const Q=H.is||"Square";o[19]=(u.components&&u.components[Q]||i[Symbol.for("components")][Q]||(()=>{console.error("component Square not found")})).call(null,{props:H},o[18],i),o[19][Symbol.for("slots")][0]?(s=o[19][Symbol.for("slots")][0],i=o[19]):s=o[19][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[12].set("show",s.showHideToggle)},function(s,i,u){i[18].set("show",s.showHideToggle)},function(s,i,u){i[19][Symbol.for("props")].show=s.showHideToggle}],context:{}},state(){return{showNr:1,hideNr:0,showBool:!0,hideBool:!1,showHideToggle:!0}},hooks:{ready(){this.$setInterval(()=>{console.log("backstopjs:ready"),this.showHideToggle=!this.showHideToggle},2e3),this.$setTimeout(()=>{this.showNr=0,this.hideNr=1,this.showBool=!1,this.hideBool=!0},4e3)}}}),Hk=He.Component("Events",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.x=400,x.y=360,o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=280,y.h=280,y.color="0xe5e7ebff",y.y=-5,o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};d.w=250,d.h=250,d.x=10,d.y=10,d.color=i.colors[0],o[2].nodeId||o[2].populate(d),s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const C={};C.w=250,C.h=250,C.x=290,C.y=10,C.color=i.colors[1],o[3].nodeId||o[3].populate(C),s=o[0],o[4]||(o[4]=this.element({parent:s||"root"},i));const b={};b.w=250,b.h=250,b.x=570,b.y=10,b.color=i.colors[2],o[4].nodeId||o[4].populate(b),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const I={};return I.w=250,I.h=250,I.x=850,I.y=10,I.color=i.colors[3],o[5].nodeId||o[5].populate(I),o},effects:[function(s,i,u){i[1].set("x",s.x)}],context:{}},state(){return{count:0,colors:["#fbbf24","#a3e635","#22d3ee","#f472b6"]}},computed:{x(){return this.count*280-5}},hooks:{unfocus(){this.$emit("changeBackground")}},input:{left(h){const s=this.count-1;s===-1?this.parent.focus(h):this.count=Math.max(s,0)},right(h){const s=this.count+1;s===4?this.parent.focus(h):this.count=Math.min(s,3)},enter(){this.$emit("changeBackground",this.colors[this.count])}}}),Gk=He.Component("SlotCard",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=300,x.h=500,x.color="{top: '0x94a3b8ff', bottom: '0x475569ff'}",o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y[Symbol.for("isSlot")]=!0,y.x=20,y.y=20,o[1].nodeId||o[1].populate(y);const d=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const C={};if(C.content=i.label,C.wordwrap=260,C.x=20,C.y=400,C.align="center",typeof d<"u")for(let I in d.config.props)delete C[d.config.props[I]];o[2].nodeId||o[2].populate(C),s=o[2];const b={};if(b.content=i.label,b.wordwrap=260,b.x=20,b.y=400,b.align="center",!o[3]){const I=b.is||"Text";o[3]=(u.components&&u.components[I]||i[Symbol.for("components")][I]||(()=>{console.error("component Text not found")})).call(null,{props:b},o[2],i),o[3][Symbol.for("slots")][0]?(s=o[3][Symbol.for("slots")][0],i=o[3]):s=o[3][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("effects",[s.shader("radius",{radius:20}),s.shader("border",{width:6,color:"0xe2e8f0ff"})])}],context:{}},props:[{key:"label"}]}),Xk=He.Component("NamedSlotCard",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=700,x.h=300,x.color="{top: '0x94a3b8ff', bottom: '0x475569ff'}",o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.x=20,y.y=20,o[1].nodeId||o[1].populate(y);const d=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[1],o[2]||(o[2]=this.element({parent:s||"root"},i));const C={};if(C.content="First slot",typeof d<"u")for(let ee in d.config.props)delete C[d.config.props[ee]];o[2].nodeId||o[2].populate(C),s=o[2];const b={};if(b.content="First slot",!o[3]){const ee=b.is||"Text";o[3]=(u.components&&u.components[ee]||i[Symbol.for("components")][ee]||(()=>{console.error("component Text not found")})).call(null,{props:b},o[2],i),o[3][Symbol.for("slots")][0]?(s=o[3][Symbol.for("slots")][0],i=o[3]):s=o[3][Symbol.for("children")][0]}s=o[1],o[4]||(o[4]=this.element({parent:s||"root"},i));const I={};I[Symbol.for("isSlot")]=!0,I.y=40,I.ref="first",o[4].nodeId||o[4].populate(I),s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const k={};k.x=200,k.y=20,o[5].nodeId||o[5].populate(k);const P=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[5],o[6]||(o[6]=this.element({parent:s||"root"},i));const O={};if(O.content="Second slot",typeof P<"u")for(let ee in P.config.props)delete O[P.config.props[ee]];o[6].nodeId||o[6].populate(O),s=o[6];const v={};if(v.content="Second slot",!o[7]){const ee=v.is||"Text";o[7]=(u.components&&u.components[ee]||i[Symbol.for("components")][ee]||(()=>{console.error("component Text not found")})).call(null,{props:v},o[6],i),o[7][Symbol.for("slots")][0]?(s=o[7][Symbol.for("slots")][0],i=o[7]):s=o[7][Symbol.for("children")][0]}s=o[5],o[8]||(o[8]=this.element({parent:s||"root"},i));const N={};N[Symbol.for("isSlot")]=!0,N.y=40,N.ref="second",o[8].nodeId||o[8].populate(N),s=o[0],o[9]||(o[9]=this.element({parent:s||"root"},i));const V={};V.x=480,V.y=20,o[9].nodeId||o[9].populate(V);const G=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[9],o[10]||(o[10]=this.element({parent:s||"root"},i));const ie={};if(ie.content="Third slot",typeof G<"u")for(let ee in G.config.props)delete ie[G.config.props[ee]];o[10].nodeId||o[10].populate(ie),s=o[10];const $={};if($.content="Third slot",!o[11]){const ee=$.is||"Text";o[11]=(u.components&&u.components[ee]||i[Symbol.for("components")][ee]||(()=>{console.error("component Text not found")})).call(null,{props:$},o[10],i),o[11][Symbol.for("slots")][0]?(s=o[11][Symbol.for("slots")][0],i=o[11]):s=o[11][Symbol.for("children")][0]}s=o[9],o[12]||(o[12]=this.element({parent:s||"root"},i));const ne={};return ne[Symbol.for("isSlot")]=!0,ne.y=40,ne.ref="third",o[12].nodeId||o[12].populate(ne),o},effects:[function(s,i,u){i[0].set("effects",[s.shader("radius",{radius:20}),s.shader("border",{width:6,color:"0xe2e8f0ff"})])}],context:{}}}),Ca=["#fff7ed","#fdba74","#f97316","#ea580c","#9a3412","#431407"],Wk=He.Component("Components",{components:{SlotCard:Gk,NamedSlotCard:Xk,Card:y2,Square:ds},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.SlotCard||i[Symbol.for("components")].SlotCard;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.x=400,d.y=100,d.label="Element",typeof y<"u")for(let ye in y.config.props)delete d[y.config.props[ye]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.x=400,C.y=100,C.label="Element",!o[2]){const ye=C.is||"SlotCard";o[2]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component SlotCard not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}o[3]||(o[3]=this.element({parent:s||"root"},i));const b={};o[3].nodeId||o[3].populate(b),s=o[3],o[4]||(o[4]=this.element({parent:s||"root"},i));const I={};I.w=100,I.h=100,o[4].nodeId||o[4].populate(I);const k=u.components&&u.components.SlotCard||i[Symbol.for("components")].SlotCard;s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const P={};if(P.x=800,P.y=100,P.label="Component",typeof k<"u")for(let ye in k.config.props)delete P[k.config.props[ye]];o[5].nodeId||o[5].populate(P),s=o[5];const O={};if(O.x=800,O.y=100,O.label="Component",!o[6]){const ye=O.is||"SlotCard";o[6]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component SlotCard not found")})).call(null,{props:O},o[5],i),o[6][Symbol.for("slots")][0]?(s=o[6][Symbol.for("slots")][0],i=o[6]):s=o[6][Symbol.for("children")][0]}o[7]||(o[7]=this.element({parent:s||"root"},i));const v={};o[7].nodeId||o[7].populate(v);const N=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[7],o[8]||(o[8]=this.element({parent:s||"root"},i));const V={};if(V.size=200,V.y=50,typeof N<"u")for(let ye in N.config.props)delete V[N.config.props[ye]];o[8].nodeId||o[8].populate(V),s=o[8];const G={};if(G.size=200,G.y=50,!o[9]){const ye=G.is||"Square";o[9]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component Square not found")})).call(null,{props:G},o[8],i),o[9][Symbol.for("slots")][0]?(s=o[9][Symbol.for("slots")][0],i=o[9]):s=o[9][Symbol.for("children")][0]}const ie=u.components&&u.components.SlotCard||i[Symbol.for("components")].SlotCard;s=o[0],o[10]||(o[10]=this.element({parent:s||"root"},i));const $={};if($.x=1200,$.y=100,$.label="Element & Component",typeof ie<"u")for(let ye in ie.config.props)delete $[ie.config.props[ye]];o[10].nodeId||o[10].populate($),s=o[10];const ne={};if(ne.x=1200,ne.y=100,ne.label="Element & Component",!o[11]){const ye=ne.is||"SlotCard";o[11]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component SlotCard not found")})).call(null,{props:ne},o[10],i),o[11][Symbol.for("slots")][0]?(s=o[11][Symbol.for("slots")][0],i=o[11]):s=o[11][Symbol.for("children")][0]}o[12]||(o[12]=this.element({parent:s||"root"},i));const ee={};o[12].nodeId||o[12].populate(ee),s=o[12],o[13]||(o[13]=this.element({parent:s||"root"},i));const le={};le.w=100,le.h=100,o[13].nodeId||o[13].populate(le);const X=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[12],o[14]||(o[14]=this.element({parent:s||"root"},i));const oe={};if(oe.size=200,oe.y=150,typeof X<"u")for(let ye in X.config.props)delete oe[X.config.props[ye]];o[14].nodeId||o[14].populate(oe),s=o[14];const re={};if(re.size=200,re.y=150,!o[15]){const ye=re.is||"Square";o[15]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component Square not found")})).call(null,{props:re},o[14],i),o[15][Symbol.for("slots")][0]?(s=o[15][Symbol.for("slots")][0],i=o[15]):s=o[15][Symbol.for("children")][0]}const E=u.components&&u.components.Card||i[Symbol.for("components")].Card;s=o[0],o[16]||(o[16]=this.element({parent:s||"root"},i));const H={};if(H.x=400,H.y=700,H.size="small",typeof E<"u")for(let ye in E.config.props)delete H[E.config.props[ye]];o[16].nodeId||o[16].populate(H),s=o[16];const Q={};if(Q.x=400,Q.y=700,Q.size="small",!o[17]){const ye=Q.is||"Card";o[17]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component Card not found")})).call(null,{props:Q},o[16],i),o[17][Symbol.for("slots")][0]?(s=o[17][Symbol.for("slots")][0],i=o[17]):s=o[17][Symbol.for("children")][0]}o[18]||(o[18]=this.element({parent:s||"root"},i));const ge={};o[18].nodeId||o[18].populate(ge),s=o[18],o[19]||(o[19]=this.element({parent:s||"root"},i));const ae={};ae.w=100,ae.h=100,o[19].nodeId||o[19].populate(ae);const q=u.components&&u.components.NamedSlotCard||i[Symbol.for("components")].NamedSlotCard;s=o[0],o[20]||(o[20]=this.element({parent:s||"root"},i));const Y={};if(Y.x=800,Y.y=700,typeof q<"u")for(let ye in q.config.props)delete Y[q.config.props[ye]];o[20].nodeId||o[20].populate(Y),s=o[20];const K={};if(K.x=800,K.y=700,!o[21]){const ye=K.is||"NamedSlotCard";o[21]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component NamedSlotCard not found")})).call(null,{props:K},o[20],i),o[21][Symbol.for("slots")][0]?(s=o[21][Symbol.for("slots")][0],i=o[21]):s=o[21][Symbol.for("children")][0]}o[22]||(o[22]=this.element({parent:s||"root"},i));const de={};o[22].nodeId||o[22].populate(de),s=o[22],o[23]||(o[23]=this.element({parent:s||"root"},i));const ve={};ve.color="0x0891b2ff",ve.x=10,ve.y=140,ve.w=80,ve.h=60,ve.parent=i[Symbol.for("slots")].filter(ye=>ye.ref==="second").shift()||i[Symbol.for("slots")][0]||s,ve.slot="second",o[23].nodeId||o[23].populate(ve),s=o[22],o[24]||(o[24]=this.element({parent:s||"root"},i));const pe={};pe.w=100,pe.h=100,pe.parent=i[Symbol.for("slots")].filter(ye=>ye.ref==="third").shift()||i[Symbol.for("slots")][0]||s,pe.slot="third",o[24].nodeId||o[24].populate(pe);const fe=u.components&&u.components.Square||i[Symbol.for("components")].Square;s=o[22],o[25]||(o[25]=this.element({parent:s||"root"},i));const ke={};if(ke.size=100,ke.parent=i[Symbol.for("slots")].filter(ye=>ye.ref==="first").shift()||i[Symbol.for("slots")][0]||s,ke.slot="first",typeof fe<"u")for(let ye in fe.config.props)delete ke[fe.config.props[ye]];o[25].nodeId||o[25].populate(ke),s=o[25];const we={};if(we.size=100,we.slot="first",!o[26]){const ye=we.is||"Square";o[26]=(u.components&&u.components[ye]||i[Symbol.for("components")][ye]||(()=>{console.error("component Square not found")})).call(null,{props:we},o[25],i),o[26][Symbol.for("slots")][0]?(s=o[26][Symbol.for("slots")][0],i=o[26]):s=o[26][Symbol.for("children")][0]}s=o[22],o[27]||(o[27]=this.element({parent:s||"root"},i));const j={};return j.color="0x4d7c0fff",j.x=40,j.y=40,j.w=40,j.h=60,j.parent=i[Symbol.for("slots")].filter(ye=>ye.ref==="second").shift()||i[Symbol.for("slots")][0]||s,j.slot="second",o[27].nodeId||o[27].populate(j),o},effects:[function(s,i,u){i[4].set("color",s.color)},function(s,i,u){i[13].set("color",s.color)},function(s,i,u){i[19].set("color",s.color)},function(s,i,u){i[24].set("color",s.color)}],context:{}},state(){return{color:Ca[0]}},hooks:{ready(){this.$setInterval(()=>{const h=Ca.indexOf(this.color)+1;this.color=h<=Ca.length?Ca[h]:Ca[0]},600)}}}),$k=He.Component("MemoryCard",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=320,x.h=200,x.x=i.col*360,x.y=i.row*250,o[0].nodeId||o[0].populate(x),s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const y={};y.w=320,y.y=125,y.mount="{y: 0.5}",o[1].nodeId||o[1].populate(y),s=o[0],o[2]||(o[2]=this.element({parent:s||"root"},i));const d={};return d.w=320,d.y=125,d.mount="{y: 0.5}",o[2].nodeId||o[2].populate(d),o},effects:[function(s,i,u){i[0].set("scale",{transition:s.scale})},function(s,i,u){i[0].set("rotation",{transition:s.disabled?-2:0})},function(s,i,u){i[1].set("h",{transition:s.h})},function(s,i,u){i[1].set("color",{transition:s.disabled?"#ccc":"#fff"})},function(s,i,u){i[1].set("src",s.image+"&w=320&h=200")},function(s,i,u){i[1].set("effects",[s.shader("radius",{radius:6})])},function(s,i,u){i[1].set("show",s.open)},function(s,i,u){i[2].set("h",{transition:s.h})},function(s,i,u){i[2].set("color",s.open?"0x00000000":{top:"0xefefefff",bottom:"0xaaaaaaff"})},function(s,i,u){i[2].set("effects",[s.shader("radius",{radius:6})])}],context:{}},props:["row","col","image","description","index"],state(){return{disabled:!1,open:!1,h:200,scale:1}},hooks:{init(){this.$listen("closeMemoryCard",h=>{h===this.index&&this.$setTimeout(()=>this.flip(),1e3)}),this.$listen("deactivateMemoryCard",h=>{h===this.index&&(this.$setTimeout(()=>{this.scale=1.16},500),this.$setTimeout(()=>{this.disabled=!0,this.scale=1},800))})},focus(h){this.scale=1.08;const s="Card "+(this.index+1)+(this.disabled?" (disabled)":"");this.$announcer.speak(s)},unfocus(){this.scale=1}},input:{enter(){if(!this.disabled){if(this.open){this.$announcer.speak("Card already open. Choose another");return}this.flip(),this.$announcer.speak(`Image of a ${this.description}`),this.$emit("selectMemoryCard",this.index)}}},methods:{flip(){this.h=0,this.$setTimeout(()=>{this.open=!this.open,this.h=200},250)}}}),Mx=[{image:"https://images.pexels.com/photos/106399/pexels-photo-106399.jpeg?auto=compress&cs=tinysrgb",description:"House"},{image:"https://images.pexels.com/photos/2902440/pexels-photo-2902440.jpeg?auto=compress&cs=tinysrgb",description:"Tree"},{image:"https://images.pexels.com/photos/686094/pexels-photo-686094.jpeg?auto=compress&cs=tinysrgb",description:"Dog"},{image:"https://images.pexels.com/photos/1302290/pexels-photo-1302290.jpeg?auto=compress&cs=tinysrgb",description:"Cat"},{image:"https://images.pexels.com/photos/627678/pexels-photo-627678.jpeg?auto=compress&cs=tinysrgb",description:"Car"},{image:"https://images.pexels.com/photos/1616566/pexels-photo-1616566.jpeg?auto=compress&cs=tinysrgb",description:"Bicycle"}],Kk=He.Component("Announcer",{components:{MemoryCard:$k},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(d.font="raleway",d.size=80,d.color="0xffffffff",d.content="Let's play memory!",d.x=580,d.y=60,typeof y<"u")for(let O in y.config.props)delete d[y.config.props[O]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(C.font="raleway",C.size=80,C.color="0xffffffff",C.content="Let's play memory!",C.x=580,C.y=60,!o[2]){const O=C.is||"Text";o[2]=(u.components&&u.components[O]||i[Symbol.for("components")][O]||(()=>{console.error("component Text not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.Text||i[Symbol.for("components")].Text;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.font="kalam",I.size=40,I.color="0xb91c1cff",I.content="the Accessible edition :)",I.x=1200,I.y=170,I.rotation=-6,typeof b<"u")for(let O in b.config.props)delete I[b.config.props[O]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.font="kalam",k.size=40,k.color="0xb91c1cff",k.content="the Accessible edition :)",k.x=1200,k.y=170,k.rotation=-6,!o[4]){const O=k.is||"Text";o[4]=(u.components&&u.components[O]||i[Symbol.for("components")][O]||(()=>{console.error("component Text not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}s=o[0],o[5]||(o[5]=this.element({parent:s||"root"},i));const P={};return P.x=260,P.y=260,o[5].nodeId||o[5].populate(P),o},effects:[function(s,i,u){parent=i[5];const o=s.cards||[],x=[];for(let y=0;y{console.error("component MemoryCard not found")})).call(null,{props:I},i[6][d.key],s),i[7][d.key][Symbol.for("slots")][0]?(parent=i[7][d.key][Symbol.for("slots")][0],s=i[7][d.key]):parent=i[7][d.key][Symbol.for("children")][0]}i[6][d.key].set("col",d.index%4),i[6][d.key].set("row",Math.floor(d.index/4)%3),i[6][d.key].set("key",d.card.image),i[6][d.key].set("ref","card"+d.index),i[6][d.key].set("index",d.index),i[7][d.key][Symbol.for("props")].col=d.index%4,i[7][d.key][Symbol.for("props")].row=Math.floor(d.index/4)%3,i[7][d.key][Symbol.for("props")].key=d.card.image,i[7][d.key][Symbol.for("props")].ref="card"+d.index,i[7][d.key][Symbol.for("props")].index=d.index}i[6]&&Object.keys(i[6]).forEach(y=>{x.indexOf(y)===-1&&(i[6][y].destroy&&i[6][y].destroy(),delete i[1][y])})}],context:{}},state(){return{cards:Mx.concat(Mx),focusedRow:-1,focusedCol:-1,openCards:[],pairs:0}},hooks:{init(){this.shuffle(),this.$listen("selectMemoryCard",h=>{this.openCards.length<2&&this.openCards.push(h),this.openCards.length===2&&(this.cards[this.openCards[0]].description===this.cards[this.openCards[1]].description?(this.$emit("deactivateMemoryCard",this.openCards[0]),this.$emit("deactivateMemoryCard",this.openCards[1]),this.pairs++,this.$setTimeout(()=>{this.$announcer.speak(this.pairs===this.cards.length/2?"Congratulations, you found all pairs!":`You found a pair! ${this.cards.length/2-this.pairs} more to go.`)},1500)):(this.$emit("closeMemoryCard",this.openCards[0]),this.$emit("closeMemoryCard",this.openCards[1]),this.$setTimeout(()=>{this.$announcer.speak("No match. Try again")},1500)),this.openCards.length=0)})},destroy(){this.$announcer.speak("Thanks for playing Memory")}},watch:{focusedCol(h){if(this.focusedRow===-1){this.focusedRow=0;return}h=h+this.focusedRow*4,this.select("card"+h).focus()},focusedRow(h){if(this.focusedCol===-1){this.focusedCol=0;return}h=this.focusedCol+h*4,this.select("card"+h).focus()}},methods:{shuffle(){this.cards.sort(()=>.5-Math.random())}},input:{left(){this.focusedCol===0?this.focusedRow===0?this.$announcer.speak("You are already at the first card"):(this.focusedCol=3,this.focusedRow--):this.focusedCol=Math.max(0,this.focusedCol-1)},right(){this.focusedCol===3?this.focusedRow===2?this.$announcer.speak("You are already at the last card"):(this.focusedCol=0,this.focusedRow++):this.focusedCol=Math.min(3,this.focusedCol+1)},up(){this.focusedCol===0&&this.$announcer.speak("You are already at the first card"),this.focusedRow=Math.max(0,this.focusedRow-1)},down(){this.focusedRow===2&&this.$announcer.speak("You are already at the last card"),this.focusedRow=Math.min(2,this.focusedRow+1)}}}),Ia=(h,s)=>Math.floor(Math.random()*(s-h+1)+h),Yk=He.Component("Item",{code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return x.src="assets/blits-b-small.png",x.w=96,x.h=168,o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){i[0].set("x",{transition:{value:s.x,duration:2900}})},function(s,i,u){i[0].set("y",{transition:{value:s.y,duration:2900}})},function(s,i,u){i[0].set("rotation",{transition:{value:s.rotation,duration:2900}})},function(s,i,u){i[0].set("scale",{transition:{value:s.scale,duration:1e3}})}],context:{}},state(){return{x:Ia(20,1560),y:Ia(20,720),rotation:0,scale:.1}},hooks:{ready(){this.scale=1,this.$setInterval(()=>{this.scale=1,this.x=Ia(20,1740),this.y=Ia(20,900),this.rotation=Ia(10,360)},3e3)}}}),qk=He.Component("Exponential",{components:{Item:Yk},code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};return o[0].nodeId||o[0].populate(x),o},effects:[function(s,i,u){parent=i[0];const o=s.items||[],x=[];for(let y=0;y{console.error("component Item not found")})).call(null,{props:I},i[1][d.item],s),i[2][d.item][Symbol.for("slots")][0]?(parent=i[2][d.item][Symbol.for("slots")][0],s=i[2][d.item]):parent=i[2][d.item][Symbol.for("children")][0]}}i[1]&&Object.keys(i[1]).forEach(y=>{x.indexOf(y)===-1&&(i[1][y].destroy&&i[1][y].destroy(),delete i[1][y])})}],context:{}},state(){return{items:[]}},hooks:{ready(){const h=this.$setInterval(()=>{for(let s=0;s<=Math.floor(this.items.length/10);s++)this.items.push(`item${this.items.length}`);this.$log.info("# items",this.items.length),this.items.length>1&&clearInterval(h)},2e3)}}}),Qk=He.Application({code:{render:function(s,i,u){const o=[];o[0]||(o[0]=this.element({parent:s||"root"},i));const x={};x.w=1920,x.h=1080,o[0].nodeId||o[0].populate(x);const y=u.components&&u.components.RouterView||i[Symbol.for("components")].RouterView;s=o[0],o[1]||(o[1]=this.element({parent:s||"root"},i));const d={};if(typeof y<"u")for(let P in y.config.props)delete d[y.config.props[P]];o[1].nodeId||o[1].populate(d),s=o[1];const C={};if(!o[2]){const P=C.is||"RouterView";o[2]=(u.components&&u.components[P]||i[Symbol.for("components")][P]||(()=>{console.error("component RouterView not found")})).call(null,{props:C},o[1],i),o[2][Symbol.for("slots")][0]?(s=o[2][Symbol.for("slots")][0],i=o[2]):s=o[2][Symbol.for("children")][0]}const b=u.components&&u.components.FPScounter||i[Symbol.for("components")].FPScounter;s=o[0],o[3]||(o[3]=this.element({parent:s||"root"},i));const I={};if(I.x=1610,typeof b<"u")for(let P in b.config.props)delete I[b.config.props[P]];o[3].nodeId||o[3].populate(I),s=o[3];const k={};if(k.x=1610,k.show=i.showFPS,!o[4]){const P=k.is||"FPScounter";o[4]=(u.components&&u.components[P]||i[Symbol.for("components")][P]||(()=>{console.error("component FPScounter not found")})).call(null,{props:k},o[3],i),o[4][Symbol.for("slots")][0]?(s=o[4][Symbol.for("slots")][0],i=o[4]):s=o[4][Symbol.for("children")][0]}return o},effects:[function(s,i,u){i[0].set("color",s.backgroundColor)},function(s,i,u){i[3].set("show",s.showFPS)},function(s,i,u){i[4][Symbol.for("props")].show=s.showFPS}],context:{}},state(){return{backgroundColor:"#1e293b",showFPS:!0}},routes:[{path:"/",component:H4,options:{keepAlive:!0}},{path:"/demos/loading",component:()=>Ox(()=>import("./Loading-58c51fa7.js"),[])},{path:"/demos/intro",component:()=>new Promise(h=>{h(X4)})},{path:"/demos/theming",component:q4},{path:"/demos/tmdb",component:lk},{path:"/demos/sprites",component:fk},{path:"/demos/focushandling",component:dk},{path:"/demos/memory-game",component:Kk,announce:"Let's play Memory"},{path:"/demos/player",component:Ik},{path:"/examples/positioning",component:hk},{path:"/examples/colors",component:Ek},{path:"/examples/gradients",component:bk},{path:"/examples/transitions",component:Ak},{path:"/examples/alpha",component:kk},{path:"/examples/scaling",component:Mk},{path:"/examples/rotation",component:Rk},{path:"/examples/keyinput",component:_k},{path:"/examples/texts",component:Lk},{path:"/examples/images",component:Nk},{path:"/examples/components",component:Pk},{path:"/examples/forloop",component:Dk},{path:"/examples/forloop-advanced",component:Fk},{path:"/examples/effects",component:zk},{path:"/examples/showif",component:Vk},{path:"/examples/events",component:Hk},{path:"/examples/slots",component:Wk},{path:"/benchmarks/exponential",component:qk}],hooks:{ready(){this.$listen("changeBackground",h=>{this.backgroundColor=h?h+80:"#1e293b"}),this.$listen("clearBackground",()=>{this.backgroundColor="transparent"})}},input:{escape(){this.quit()},back(){this.$router.to("/")}}});He.Launch(Qk,"app",{w:1920,h:1080,multithreaded:!1,debugLevel:1,reactivityMode:"Proxy",keymap:k4(),fonts:[{family:"lato",type:"msdf",file:"fonts/Lato-Regular.ttf"},{family:"raleway",type:"msdf",file:"fonts/Raleway-ExtraBold.ttf"},{family:"opensans",type:"web",file:"fonts/OpenSans-Medium.ttf"},{family:"kalam",type:"msdf",file:"fonts/Kalam-Regular.ttf"}],canvasColor:"transparent"});export{He as B,ds as S}; diff --git a/assets/index-d17a140b.js b/assets/index-d17a140b.js deleted file mode 100644 index e5a4e95..0000000 --- a/assets/index-d17a140b.js +++ /dev/null @@ -1,704 +0,0 @@ -var Gs=Object.defineProperty;var Hs=(n,o,e)=>o in n?Gs(n,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[o]=e;var u=(n,o,e)=>(Hs(n,typeof o!="symbol"?o+"":o,e),e);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))s(t);new MutationObserver(t=>{for(const l of t)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function e(t){const l={};return t.integrity&&(l.integrity=t.integrity),t.referrerPolicy&&(l.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?l.credentials="include":t.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(t){if(t.ep)return;t.ep=!0;const l=e(t);fetch(t.href,l)}})();const C={currentView:Symbol("currentView"),cursorTagStart:Symbol("cursorTagStart"),computedKeys:Symbol("computedKeys"),destroy:Symbol("destroy"),id:Symbol("id"),identifier:Symbol("identifier"),index:Symbol("index"),init:Symbol("init"),inputEvents:Symbol("inputEvents"),intervals:Symbol("intervals"),level:Symbol("level"),methodKeys:Symbol("methodKeys"),originalState:Symbol("originalState"),propKeys:Symbol("propKeys"),raw:Symbol("raw"),ready:Symbol("ready"),renderer:Symbol("renderer"),routes:Symbol("routes"),settings:Symbol("settings"),state:Symbol("state"),stateKeys:Symbol("stateKeys"),textnode:Symbol("textnode"),timeouts:Symbol("timeouts"),type:Symbol("type"),watchers:Symbol("watchers"),watchKeys:Symbol("watchKeys"),wrapper:Symbol("wrapper"),children:Symbol.for("children"),components:Symbol.for("components"),isSlot:Symbol.for("isSlot"),props:Symbol.for("props"),slots:Symbol.for("slots"),componentType:Symbol.for("componentType")},Eo={aliceblue:"0xf0f8ffff",antiquewhite:"0xfaebd7ff",aqua:"0xffffff00",aquamarine:"0x7fffd4ff",azure:"0xf0ffffff",beige:"0xf5f5dcff",bisque:"0xffe4c4ff",black:"0x000000ff",blanchedalmond:"0xffebcdff",blue:"0x0000ffff",blueviolet:"0x8a2be2ff",brown:"0xa52a2aff",burlywood:"0xdeb887ff",cadetblue:"0x5f9ea0ff",chartreuse:"0x7fff00ff",chocolate:"0xd2691eff",coral:"0xff7f50ff",cornflowerblue:"0x6495edff",cornsilk:"0xfff8dcff",crimson:"0xdc143cff",cyan:"0x00ffffff",darkblue:"0x00008bff",darkcyan:"0x008b8bff",darkgoldenrod:"0xb8860bff",darkgray:"0xa9a9a9ff",darkgreen:"0x006400ff",darkgrey:"0xa9a9a9ff",darkkhaki:"0xbdb76bff",darkmagenta:"0x8b008bff",darkolivegreen:"0x556b2fff",darkorange:"0xff8c00ff",darkorchid:"0x9932ccff",darkred:"0x8b0000ff",darksalmon:"0xe9967aff",darkseagreen:"0x8fbc8fff",darkslateblue:"0x483d8bff",darkslategray:"0x2f4f4fff",darkslategrey:"0x2f4f4fff",darkturquoise:"0x00ced1ff",darkviolet:"0x9400d3ff",deeppink:"0xff1493ff",deepskyblue:"0x00bfffff",dimgray:"0x696969ff",dimgrey:"0x696969ff",dodgerblue:"0x1e90ffff",firebrick:"0xb22222ff",floralwhite:"0xfffaf0ff",forestgreen:"0x228b22ff",fuchsia:"0xff00ffff",gainsboro:"0xdcdcdcff",ghostwhite:"0xf8f8ffff",gold:"0xffd700ff",goldenrod:"0xdaa520ff",gray:"0x808080ff",green:"0x008000ff",greenyellow:"0xadff2fff",grey:"0x808080ff",honeydew:"0xf0fff0ff",hotpink:"0xff69b4ff",indianred:"0xcd5c5cff",indigo:"0x4b0082ff",ivory:"0xfffff0ff",khaki:"0xf0e68cff",lavender:"0xe6e6faff",lavenderblush:"0xfff0f5ff",lawngreen:"0x7cfc00ff",lemonchiffon:"0xfffacdff",lightblue:"0xadd8e6ff",lightcoral:"0xf08080ff",lightcyan:"0xe0ffffff",lightgoldenrodyellow:"0xfafad2ff",lightgray:"0xd3d3d3ff",lightgreen:"0x90ee90ff",lightgrey:"0xd3d3d3ff",lightpink:"0xffb6c1ff",lightsalmon:"0xffa07aff",lightseagreen:"0x20b2aaff",lightskyblue:"0x87cefaff",lightslategray:"0x778899ff",lightslategrey:"0x778899ff",lightsteelblue:"0xb0c4deff",lightyellow:"0xffffe0ff",lime:"0x00ff00ff",limegreen:"0x32cd32ff",linen:"0xfaf0e6ff",magenta:"0xff00ffff",maroon:"0x800000ff",mediumaquamarine:"0x66cdaaff",mediumblue:"0x0000cdff",mediumorchid:"0xba55d3ff",mediumpurple:"0x9370dbff",mediumseagreen:"0x3cb371ff",mediumslateblue:"0x7b68eeff",mediumspringgreen:"0x00fa9aff",mediumturquoise:"0x48d1ccff",mediumvioletred:"0xc71585ff",midnightblue:"0x191970ff",mintcream:"0xf5fffaff",mistyrose:"0xffe4e1ff",moccasin:"0xffe4b5ff",navajowhite:"0xffdeadff",navy:"0x000080ff",oldlace:"0xfdf5e6ff",olive:"0x808000ff",olivedrab:"0x6b8e23ff",orange:"0xffa500ff",orangered:"0xff4500ff",orchid:"0xda70d6ff",palegoldenrod:"0xeee8aaff",palegreen:"0x98fb98ff",paleturquoise:"0xafeeeeff",palevioletred:"0xdb7093ff",papayawhip:"0xffefd5ff",peachpuff:"0xffdab9ff",peru:"0xcd853fff",pink:"0xffc0cbff",plum:"0xdda0ddff",powderblue:"0xb0e0e6ff",purple:"0x800080ff",rebeccapurple:"0x663399ff",red:"0xff0000ff",rosybrown:"0xbc8f8fff",royalblue:"0x4169e1ff",saddlebrown:"0x8b4513ff",salmon:"0xfa8072ff",sandybrown:"0xf4a460ff",seagreen:"0x2e8b57ff",seashell:"0xfff5eeff",sienna:"0xa0522dff",silver:"0xc0c0c0ff",skyblue:"0x87ceebff",slateblue:"0x6a5acdff",slategray:"0x708090ff",slategrey:"0x708090ff",snow:"0xfffafaff",springgreen:"0x00ff7fff",steelblue:"0x4682b4ff",tan:"0xd2b48cff",teal:"0x008080ff",thistle:"0xd8bfd8ff",tomato:"0xff6347ff",transparent:"0x00000000",turquoise:"0x40e0d0ff",violet:"0xee82eeff",wheat:"0xf5deb3ff",white:"0xffffffff",whitesmoke:"0xf5f5f5ff",yellow:"0xffff00ff",yellowgreen:"0x9acd32ff"},$e={[C.settings]:{},get(n,o=null){return n in this[C.settings]?this[C.settings][n]:o},set(n,o){typeof n=="object"?Object.keys(n).forEach(e=>{this.set(e,n[e])}):this[C.settings][n]=o}},gt=()=>{},qt=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),ns=n=>{const o=$e.get("debugLevel"),e={};return Object.defineProperty(e,"info",{get(){return(o>=1||Array.isArray(o)&&o.indexOf("info")>-1)&&console.info.bind(window.console,`%c ⚡️ ${n} %c ${qt()}`,"background-color: #0284c7; color: white; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||gt}}),Object.defineProperty(e,"warn",{get(){return(o>=1||Array.isArray(o)&&o.indexOf("warn")>-1)&&console.warn.bind(window.console,`%c ⚡️ ${n} %c ${qt()}`,"background-color: #fbbf24; color: white; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||gt}}),Object.defineProperty(e,"error",{get(){return(o>=1||Array.isArray(o)&&o.indexOf("error")>-1)&&console.error.bind(window.console,`%c ⚡️ ${n} %c ${qt()}`,"background-color: #dc2626; color: white; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||gt}}),Object.defineProperty(e,"debug",{get(){return(o>=2||Array.isArray(o)&&o.indexOf("debug")>-1)&&console.debug.bind(window.console,`%c ⚡️ ${n} %c (${new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})`,"background-color: #e2e8f0; color: #334155; padding: 3px 6px 3px 1px; border-radius: 3px","color: ##94a3b8;")||gt}}),e};let te;const Vs=()=>{te=ns("Blits")},Ke={normalize(n="",o="0xffffffff"){if(n=n.toString(),n.length>0){const e=/^0x[0-9a-f]{8}$/,s=/^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i,t=/^(rgba?)\((\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\s*),(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\s*),(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\s*)(,(\s*(-?\d+(?:\.\d+)?)\s*))?\)$/,l=/^(hsla?)\((\s*(360|3[0-5][0-9]|[12]?[0-9]{1,2})\s*),(\s*(100|[1-9]?[0-9])\s*)%,(\s*(100|[1-9]?[0-9])\s*)%(,(\s*(1|0(?:\.\d+)?)\s*))?\)$/;if(e.test(n))return n;if(s.test(n))return n=n.replace("#","").toLowerCase(),n.length===3&&(n=n.split("").map(i=>i+i).join("")),"0x"+n.padEnd(8,"f");const r=t.exec(n);if(r)return"0x"+parseInt(r[3]).toString(16).padStart(2,"0")+parseInt(r[5]).toString(16).padStart(2,"0")+parseInt(r[7]).toString(16).padStart(2,"0")+(r[10]&&r[1]==="rgba"?Math.min(Math.max(Math.round(parseFloat(r[10])*255),0),255).toString(16).padStart(2,"0"):"ff");if(l.test(n))return te.warn("HSL(A) color format is not supported yet"),"0xffffffff";if(n in Eo)return Eo[n]}return o}},qs=(n="",o,e,s=null)=>{let t=0,l=0,r=[],i=null,f=0;const c=/^<\/?([a-zA-Z0-9_\-.]+)\s*/,a=/^\s*(\/?>)\s*/,d=/^([A-Za-z0-9:.\-_@]+)=\s*(["'])/,m=/^<>\s*/,p=/^\s*(<\/>)\s*/,h=()=>{n=g(n);try{return y(_),L(r)}catch(T){throw(T.name=="TemplateParseError"||T.name=="TemplateStructureError")&&(T.message=`${T.message} -${T.context}`),T}},y=T=>{t>=n.length||T()},g=T=>T.replace(//gms,"").replace(/\r?\n\s*\r\n/gm," ").replace(/\r?\n\s*(\S)/gm," $1").replace(/\r?\n/g,"").trim(),x=T=>{const w=n.slice(t).match(T);return w&&(l=t,t+=w[0].length),w},_=()=>{x(m)?(r.push({[Symbol.for("componentType")]:null,[C.type]:"opening",[C.level]:f,[C.cursorTagStart]:l}),f++,y(_)):y(S)},S=()=>{x(p)?(f--,r.push({[Symbol.for("componentType")]:null,[C.type]:"closing",[C.level]:f}),y(_)):y(I)},I=()=>{const T=x(c);if(T)i={[Symbol.for("componentType")]:T[1],[C.level]:f,[C.cursorTagStart]:l},T[0].startsWith("{const T=x(a);if(T){if(T[1]==="/>"){if(i[C.type]==="closing")throw N("InvalidClosingTag");i[C.type]="self-closing",f--}if(i[C.type]==="opening"){const w=n.slice(t,n.indexOf("<",t));w&&(i.content=w,t+=w.length)}r.push(i),y(_)}else y(P)},P=()=>{const T=x(d);if(T){if(i[C.type]==="closing")throw N("AttributesInClosingTag");const w=T[2],A=new RegExp(`^(.*?)${w}\\s*`),z=x(A);if(z){const M=b(T[1],z[1]);i[M.name]=M.value,y(v)}else throw N("MissingOrInvalidAttributeValue")}else throw N("InvalidAttribute")},b=(T,w)=>{if(T.includes(".")){const[A,z]=T.split(".");return{name:A,value:`{${z}: ${w}}`}}return["color",":color",":effects","effects"].includes(T)?k(T,w):{name:T,value:w}},k=(T,w)=>{let A=w,z=Ke.normalize(A,null);if(z===null){const M=/'([^']+)'/g;let E,Y=0,D="";for(;(E=M.exec(w))!==null;){const q=E[1],U=E.index,j=E[0].length;D+=w.slice(Y,U),z=Ke.normalize(q,null),z===null?D+=w.slice(U,U+j):D+=`'${z}'`,Y=U+j}D+=w.slice(Y),A=D}else A=z;return{name:T,value:A}},L=T=>{let w=[],A=!1,z={children:[]},M=z;for(let E=0;E0)throw O("UnclosedTags",w);return z},F=10,R=50,N=T=>{const w=B();T=`${T} in ${w}`;const A=new Error(T);A.name="TemplateParseError";const z=Math.max(0,l-F),M=Math.min(n.length,t+R),E=n.slice(z,M),Y=t-z;return A.context=$(Y,E),A},O=(T,w)=>{const A=B();T=`${T} in ${A}`;const z=new Error(T);z.name="TemplateStructureError",Array.isArray(w)?z.context=w.map(E=>M(E)).join(` -`):z.context=M(w);function M(E){const Y=Math.max(0,E[C.cursorTagStart]-F),D=n.slice(Y,Y+R);return $(F,D)}return z},$=(T,w)=>{const A=" ".repeat(T)+"^";return` -${w} -${A} -`},B=()=>{if(e){let T=o||"",w=e;for(;w;)T=`${w[Symbol.for("componentType")]}/${T}`,w=w.parent;return T}return s||"Blits.Application"};return h()};let J;function js(n={children:[]}){const o={renderCode:["const elms = []"],effectsCode:[],context:{props:[],components:this.components}};return J=-1,rs.call(o,n),o.renderCode.push("return elms"),{render:new Function("parent","component","context",o.renderCode.join(` -`)),effects:o.effectsCode.map(e=>new Function("component","elms","context",e)),context:o.context}}const zt=function(n,o=!1,e={key:!1,component:"component.",forceEffect:!1}){const s=e.forceEffect?this.effectsCode:this.renderCode;o&&s.push(`parent = ${o}`),"key"in n&&(e.key=Ze(n.key,e.component));const t=e.key?`elms[${J}][${e.key}]`:`elms[${J}]`;e.key&&s.push(` - elms[${J}] = elms[${J}] || {} - `),s.push(` - if(!${t}) { - ${t} = this.element({parent: parent || 'root'}, component) - } - const elementConfig${J} = {} - `);const l=n.children;delete n.children,n[Symbol.for("componentType")]==="Slot"&&s.push(`elementConfig${J}[Symbol.for('isSlot')] = true`),Object.keys(n).forEach(r=>{r==="slot"&&s.push(` - elementConfig${J}['parent'] = component[Symbol.for('slots')].filter(slot => slot.ref === '${n.slot}').shift() || component[Symbol.for('slots')][0] || parent - `),ls(r)?this.effectsCode.push(`${t}.set('${r.substring(1)}', ${Ze(n[r],e.component)})`):s.push(`elementConfig${J}['${r}'] = ${xo(n[r],r,e.component)}`)}),e.holder===!0&&s.push(` - if(typeof cmp${J} !== 'undefined') { - for(let key in cmp${J}.config.props) { - delete elementConfig${J}[cmp${J}.config.props[key]] - } - } - `),s.push(` - if(!${t}.nodeId) { - ${t}.populate(elementConfig${J}) - } - `),l&&rs.call(this,{children:l},`${t}`,e)},is=function(n,o=!1,e={key:!1,component:"component.",forceEffect:!1,holder:!1}){const s=e.forceEffect?this.effectsCode:this.renderCode;s.push(` - const cmp${J} = - (context.components && context.components['${n[Symbol.for("componentType")]}']) || - component[Symbol.for('components')]['${n[Symbol.for("componentType")]}'] - `),"key"in n&&(e.key=Ze(n.key,e.component));const t=n.children;delete n.children,zt.call(this,n,o,{...e,holder:!0}),o=e.key?`elms[${J}][${e.key}]`:`elms[${J}]`,J++;const l=e.key?`elms[${J}][${e.key}]`:`elms[${J}]`;e.key&&s.push(` - elms[${J}] = elms[${J}] || {} - `),o&&s.push(`parent = ${o}`),s.push(`const props${J} = {}`),Object.keys(n).forEach(r=>{ls(r)?(this.effectsCode.push(` - ${l}[Symbol.for('props')]['${r.substring(1)}'] = ${Ze(n[r],e.component)}`),s.push(`props${J}['${r.substring(1)}'] = ${Ze(n[r],e.component)}`)):s.push(`props${J}['${r}'] = ${xo(n[r],r,e.component)}`)}),s.push(` - if(!${l}) { - const componentType = props${J}['is'] || '${n[Symbol.for("componentType")]}' - - ${l} = (context.components && context.components[componentType] || component[Symbol.for('components')][componentType] || (() => { console.error('component ${n[Symbol.for("componentType")]} not found')})).call(null, {props: props${J}}, ${o}, component) - if (${l}[Symbol.for('slots')][0]) { - parent = ${l}[Symbol.for('slots')][0] - component = ${l} - } else { - parent = ${l}[Symbol.for('children')][0] - } - } - `),t&&(J++,zt.call(this,{children:t},!1,{...e}))},Ks=function(n,o){const e=n[":for"];delete n[":for"];const t=/(.+)\s+in\s+(.+)/gi.exec(e),[l,r="index"]=t[1].replace("(","").replace(")","").split(/\s*,\s*/),i={renderCode:[],effectsCode:[],context:{props:[],components:this.components}};o&&i.renderCode.push(`parent = ${o}`);const f=J;i.renderCode.push(` - const collection = ${xo(t[2],":for")} || [] - const keys = [] - for(let __index = 0; __index < collection.length; __index++) { - parent = ${o} - if(!component.key) keys.length = 0 - const scope = Object.assign(component, { - key: Math.random().toString(), - ${r}: __index, - ${l}: collection[__index], - `),"ref"in n&&n.ref.indexOf("$")===-1&&(i.renderCode.push(` - __ref: '${n.ref}' + __index - `),n.ref="$__ref"),i.renderCode.push(` - }) - `),"key"in n?i.renderCode.push(` - keys.push(${Ze(n.key,"scope.")}.toString()) - `):i.renderCode.push(` - keys.push(scope.key.toString()) - `),n[Symbol.for("componentType")]==="Element"||n[Symbol.for("componentType")]==="Slot"?zt.call(i,n,o,{key:"scope.key",component:"scope.",forceEffect:!1}):is.call(i,n,!1,{key:"scope.key",component:"scope.",forceEffect:!1}),i.renderCode=i.renderCode.concat(i.effectsCode),i.renderCode.push("}"),i.renderCode.push(` - if(elms[${f}]) { - Object.keys(elms[${f}]).forEach(key => { - if(keys.indexOf(key) === -1) { - elms[${f}][key].destroy && elms[${f}][key].destroy() - delete elms[1][key] - } - }) - } - `),this.effectsCode.push(i.renderCode.join(` -`))},rs=function(n,o=!1,e={}){n.children&&n.children.forEach(s=>{J++,Object.keys(s).indexOf(":for")>-1?Ks.call(this,s,o):s[Symbol.for("componentType")]==="Element"||s[Symbol.for("componentType")]==="Slot"?zt.call(this,s,o,e):is.call(this,s,o,e)})},Ze=(n,o="component.")=>{const e=/('.*?')+/gi,s=/\$/gi,t=n.matchAll(e),l=[];let r=0;for(const i of t)l.push(i[0]),n=n.replace(i[0],`[@@REPLACEMENT${r}@@]`),r++;return n=n.replace(s,o),l.forEach((i,f)=>{n=n.replace(`[@@REPLACEMENT${f}@@]`,i)}),n},xo=(n="",o=!1,e="component.")=>{let s;if(o==="content")if(n.startsWith("$"))s=`${e}${n.replace("$","")}`;else{const t=n.replace(/\\\\/g,"__DOUBLE_BACKSLASH__").replace(/(^|[^\\])'/g,"$1\\'").replace(/__DOUBLE_BACKSLASH__/g,"\\\\");s=`'${Zs(t,e)}'`}else if(o!=="color"&&!isNaN(parseFloat(n))){if(s=parseFloat(n),n.endsWith("%")){const l={w:"width",width:"width",x:"width",h:"height",height:"height",y:"height"}[o];l&&(s=`parent.node.${l} * (${s} / 100)`)}}else if(n.toLowerCase()==="true")s=!0;else if(n.toLowerCase()==="false")s=!1;else if(o.startsWith("@")&&n){const t=e.slice(0,-1);s=`${t}['${n.replace("$","")}'] && ${t}['${n.replace("$","")}'].bind(${t})`}else n.startsWith("$")?s=`${e}${n.replace("$","")}`:s=`"${n}"`;return s},ls=n=>n.startsWith(":"),Zs=(n,o)=>{const e=/\{\{\s*(\$\S+)\s*\}\}/g,s=[...n.matchAll(e)];if(s.length)for(let[t,l]of s)n=n.replace(t,`${l.replace("$",`'+${o}`)}+'`);return n};function Qs(n,o){const e={alpha:!0,antialias:!1,depth:!1,stencil:!0,desynchronized:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:!1},s=n.getContext("webgl",e)||n.getContext("experimental-webgl",e);if(!s)throw new Error("Unable to create WebGL context");return o?new Proxy(s,{get(t,l){const r=t[l];return typeof r=="function"?(o.increment(String(l)),r.bind(t)):r}}):s}function Ao(n,o,e){const s=Math.trunc(n>>>24),t=Math.trunc(n>>>16&255),l=Math.trunc(n>>>8&255),r=Math.trunc(n&255),i=Math.trunc(o>>>24),f=Math.trunc(o>>>16&255),c=Math.trunc(o>>>8&255),a=Math.trunc(o&255),d=Math.round(i*e+s*(1-e)),m=Math.round(f*e+t*(1-e)),p=Math.round(c*e+l*(1-e)),h=Math.round(a*e+r*(1-e));return(d<<24|m<<16|p<<8|h)>>>0}function Js(n,o){const e=n>>>24,s=n>>>16&255,t=n>>>8&255,l=Math.trunc((n&255)*o);return(e<<24|s<<16|t<<8|l)>>>0}function it(n,o,e=!1){const s=(n&255)/255*o,t=Math.trunc((n>>>24)*s),l=Math.trunc((n>>>16&255)*s),r=Math.trunc((n>>>8&255)*s),i=Math.trunc(s*255);return e?(i<<24|r<<16|l<<8|t)>>>0:(t<<24|l<<16|r<<8|i)>>>0}function no(n,o){return Object.prototype.hasOwnProperty.call(n,o)}class fs{constructor(o){u(this,"releaseCallback");this.releaseCallback=o}}class en extends fs{constructor(e,s){super(e);u(this,"textureMap",new Map);u(this,"zeroReferenceTextureSet",new Set);u(this,"options");this.options={textureCleanupIntervalMs:s.textureCleanupIntervalMs??1e4,textureCleanupAgeThreadholdMs:s.textureCleanupAgeThreadholdMs??6e4},setInterval(()=>{const t=Date.now(),l=this.options.textureCleanupAgeThreadholdMs;for(const r of this.zeroReferenceTextureSet)t-r.lastUpdate>l&&(this.releaseCallback(r.id),this.textureMap.delete(r.id),this.zeroReferenceTextureSet.delete(r))},this.options.textureCleanupIntervalMs)}registerTexture(e){var t;const s=(t=e.options)==null?void 0:t.id;if(!this.textureMap.has(s)){const l={id:s,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(s,l),this.zeroReferenceTextureSet.add(l)}}incrementTextureRefCount(e){var l;const s=(l=e.options)==null?void 0:l.id;let t=this.textureMap.get(s);t||(this.registerTexture(e),t=this.textureMap.get(s)),e.txType==="SubTexture"&&this.incrementTextureRefCount(e.props.texture),t.nodeRefCount++,t.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(t)&&this.zeroReferenceTextureSet.delete(t)}decrementTextureRefCount(e){var l;const s=(l=e.options)==null?void 0:l.id,t=this.textureMap.get(s);t.nodeRefCount--,t.lastUpdate=Date.now(),t.nodeRefCount===0&&this.zeroReferenceTextureSet.add(t),e.txType==="SubTexture"&&this.decrementTextureRefCount(e.props.texture)}}class tn extends fs{constructor(e){super(e);u(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var s,t;(s=e.options)==null||s.id,this.registry.register(e,(t=e.options)==null?void 0:t.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}class _e{constructor(){u(this,"eventListeners",{})}on(o,e){let s=this.eventListeners[o];s||(s=[]),s.push(e),this.eventListeners[o]=s}off(o,e){const s=this.eventListeners[o];if(!s)return;if(!e){delete this.eventListeners[o];return}const t=s.indexOf(e);t>=0&&s.splice(t,1)}once(o,e){const s=(t,l)=>{this.off(o,s),e(t,l)};this.on(o,s)}emit(o,e){const s=this.eventListeners[o];s&&[...s].forEach(t=>{t(this,e)})}removeAllListeners(){this.eventListeners={}}}const on="modulepreload",sn=function(n){return"/"+n},Mo={},as=function(o,e,s){if(!e||e.length===0)return o();const t=document.getElementsByTagName("link");return Promise.all(e.map(l=>{if(l=sn(l),l in Mo)return;Mo[l]=!0;const r=l.endsWith(".css"),i=r?'[rel="stylesheet"]':"";if(!!s)for(let a=t.length-1;a>=0;a--){const d=t[a];if(d.href===l&&(!r||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${i}`))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":on,r||(c.as="script",c.crossOrigin=""),c.href=l,document.head.appendChild(c),r)return new Promise((a,d)=>{c.addEventListener("load",a),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>o()).catch(l=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=l,window.dispatchEvent(r),!r.defaultPrevented)throw l})};class nn{static makeCacheKey(o){return!1}static resolveDefaults(o){return{}}}function Lo(n,o,e){const s=n.createShader(o);if(!s)throw new Error;if(n.shaderSource(s,e),n.compileShader(s),n.getShaderParameter(s,n.COMPILE_STATUS))return s;console.log(n.getShaderInfoLog(s)),n.deleteShader(s)}function rn(n,o,e){const s=n.createProgram();if(!s)throw new Error;if(n.attachShader(s,o),n.attachShader(s,e),n.linkProgram(s),n.getProgramParameter(s,n.LINK_STATUS))return s;console.log(n.getProgramInfoLog(s)),n.deleteProgram(s)}function ln(n){return self.WebGL2RenderingContext&&n instanceof self.WebGL2RenderingContext}class Je extends nn{constructor(e){super();u(this,"boundBufferCollection",null);u(this,"buffersBound",!1);u(this,"program");u(this,"vao");u(this,"renderer");u(this,"glw");u(this,"attributeBuffers");u(this,"attributeLocations");u(this,"attributeNames");u(this,"uniformLocations");u(this,"uniformTypes");u(this,"supportsIndexedTextures");const s=this.renderer=e.renderer,t=this.glw=this.renderer.glw;this.supportsIndexedTextures=e.supportsIndexedTextures||!1;const l=t.isWebGl2(),r=l&&e.webgl2Extensions||!l&&e.webgl1Extensions||[],i=l?"2.0":"1.0";r.forEach(y=>{if(!t.getExtension(y))throw new Error(`Shader "${this.constructor.name}" requires extension "${y}" for WebGL ${i} but wasn't found`)});const f=e.shaderSources||this.constructor.shaderSources;if(f)l&&(f!=null&&f.webGl2)&&(f.fragment=f.webGl2.fragment,f.vertex=f.webGl2.vertex,delete f.webGl2);else throw new Error(`Shader "${this.constructor.name}" is missing shaderSources.`);const c=s.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,a=f.vertex instanceof Function?f.vertex(c):f.vertex,d=f.fragment instanceof Function?f.fragment(c):f.fragment,m=Lo(t,t.VERTEX_SHADER,a),p=Lo(t,t.FRAGMENT_SHADER,d);if(!m||!p)throw new Error;const h=rn(t,m,p);if(!h)throw new Error;if(this.program=h,l){const y=t.createVertexArray();if(!y)throw new Error;this.vao=y,t.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...e.attributes].forEach(y=>{const g=t.getAttribLocation(this.program,y);if(g<0)throw new Error(`${this.constructor.name}: Vertex shader must have an attribute "${y}"!`);const x=t.createBuffer();if(!x)throw new Error(`${this.constructor.name}: Could not create buffer for attribute "${y}"`);this.attributeLocations[y]=g,this.attributeBuffers[y]=x,this.attributeNames.push(y)}),this.uniformLocations={},this.uniformTypes={},e.uniforms.forEach(y=>{const g=t.getUniformLocation(this.program,y.name);if(this.uniformTypes[y.name]=y.uniform,!g){console.warn(`Shader "${this.constructor.name}" could not get uniform location for "${y.name}"`);return}this.uniformLocations[y.name]=g})}bindBufferAttribute(e,s,t){const{glw:l}=this;l.enableVertexAttribArray(e),l.vertexAttribPointer(s,e,t.size,t.type,t.normalized,t.stride,t.offset)}disableAttribute(e){this.glw.disableVertexAttribArray(e)}disableAttributes(){for(const e in this.attributeLocations)this.disableAttribute(this.attributeLocations[e]);this.boundBufferCollection=null}canBatchShaderProps(e,s){return!1}bindRenderOp(e,s){this.bindBufferCollection(e.buffers),e.textures.length>0&&this.bindTextures(e.textures);const{glw:t}=e;if(this.setUniform("u_resolution",[t.canvas.width,t.canvas.height]),this.setUniform("u_pixelRatio",e.options.pixelRatio),s){if(no(s,"$dimensions")){let l=s.$dimensions;l||(l=e.dimensions),this.setUniform("u_dimensions",[l.width,l.height])}if(no(s,"$alpha")){let l=s.$alpha;l||(l=e.alpha),this.setUniform("u_alpha",l)}this.bindProps(s)}}setUniform(e,...s){this.glw.setUniform(this.uniformTypes[e],this.uniformLocations[e],...s)}bindBufferCollection(e){if(this.boundBufferCollection!==e){for(const s in this.attributeLocations){const t=e.getBuffer(s),l=e.getAttributeInfo(s);this.bindBufferAttribute(this.attributeLocations[s],t,l)}this.boundBufferCollection=e}}bindProps(e){}bindTextures(e){}attach(){this.glw.useProgram(this.program),this.glw.useProgram(this.program),this.glw.isWebGl2()&&this.vao&&this.glw.bindVertexArray(this.vao)}detach(){this.disableAttributes()}}u(Je,"shaderSources");class ce{constructor(o){u(this,"priority",1);u(this,"name","");u(this,"ref");u(this,"target");u(this,"passParameters","");u(this,"declaredUniforms","");u(this,"uniformInfo",{});const{ref:e,target:s,props:t={}}=o;this.ref=e,this.target=s;const l={},r=[];let i="";const f=this.constructor.uniforms||{};for(const c in f){const a=f[c],d=a.type,m=`${e}_${c}`;let p="";a.size&&(p=`[${a.size(t)}]`),r.push(m),i+=`uniform ${d} ${m}${p};`,l[c]={name:m,uniform:f[c].method}}this.passParameters=r.join(","),this.declaredUniforms=i,this.uniformInfo=l}static getEffectKey(o){return""}static getMethodParameters(o,e){const s=[];for(const t in o){const l=o[t];let r="";l.size&&(r=`[${l.size(e)}]`),s.push(`${l.type} ${t}${r}`)}return s.join(",")}static resolveDefaults(o){return{}}static makeEffectKey(o){return!1}}u(ce,"uniforms",{}),u(ce,"methods"),u(ce,"onShaderMask"),u(ce,"onColorize"),u(ce,"onEffectMask");class Gt extends _e{constructor(e){super();u(this,"txManager");u(this,"dimensions",null);u(this,"error",null);u(this,"state","loading");this.txManager=e}setState(e,...s){if(this.state!==e){if(this.state=e,e==="loaded"){const t=s;this.dimensions=t[0]}else if(e==="failed"){const t=s;this.error=t[0]}this.emit(e,...s)}}static makeCacheKey(e){return!1}static resolveDefaults(e){return{}}}const fn={x:(n,o)=>{n.props.x=o},y:(n,o)=>{n.props.y=o},width:(n,o)=>{n.props.width=o},height:(n,o)=>{n.props.height=o},color:(n,o)=>{n.props.color=o},zIndex:(n,o)=>{n.props.zIndex=o},fontFamily:(n,o)=>{n.props.fontFamily=o},fontWeight:(n,o)=>{n.props.fontWeight=o},fontStyle:(n,o)=>{n.props.fontStyle=o},fontStretch:(n,o)=>{n.props.fontStretch=o},fontSize:(n,o)=>{n.props.fontSize=o},text:(n,o)=>{n.props.text=o},textAlign:(n,o)=>{n.props.textAlign=o},contain:(n,o)=>{n.props.contain=o},offsetY:(n,o)=>{n.props.offsetY=o},scrollable:(n,o)=>{n.props.scrollable=o},scrollY:(n,o)=>{n.props.scrollY=o},letterSpacing:(n,o)=>{n.props.letterSpacing=o},lineHeight:(n,o)=>{n.props.lineHeight=o},maxLines:(n,o)=>{n.props.maxLines=o},textBaseline:(n,o)=>{n.props.textBaseline=o},verticalAlign:(n,o)=>{n.props.verticalAlign=o},overflowSuffix:(n,o)=>{n.props.overflowSuffix=o},debug:(n,o)=>{n.props.debug=o}};class cs{constructor(o){u(this,"stage");u(this,"set");this.stage=o;const e={...fn,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(e).map(([s,t])=>[s,(l,r)=>{l.props[s]!==r&&(t(l,r),this.stage.requestRender())}])))}setStatus(o,e,s){o.status!==e&&(o.status=e,o.emitter.emit(e,s))}scheduleUpdateState(o){o.updateScheduled||(o.updateScheduled=!0,queueMicrotask(()=>{o.updateScheduled=!1,this.updateState(o)}))}}const Ce=n=>{const o=n>>>24,e=n>>>16&255,s=n>>>8&255,t=n&255;return[o/255,e/255,s/255,t/255]};function an(n){return(n&255)/255}function jt(n){const o=Math.floor(n[0]*255),e=Math.floor(n[1]*255),s=Math.floor(n[2]*255),t=Math.floor(n[3]*255);return`rgba(${o},${e},${s},${t.toFixed(4)})`}function Me(n,o,e,s,t){return t?(t.x1=n,t.y1=o,t.x2=e,t.y2=s,t):{x1:n,y1:o,x2:e,y2:s}}function cn(n,o,e){const s=Me(Math.max(n.x1,o.x1),Math.max(n.y1,o.y1),Math.min(n.x2,o.x2),Math.min(n.y2,o.y2),e);return s.x1o.x1&&n.y1o.y1}function dn(n,o){return o?(o.x=n.x1,o.y=n.y1,o.width=n.x2-n.x1,o.height=n.y2-n.y1,o):{x:n.x1,y:n.y1,width:n.x2-n.x1,height:n.y2-n.y1}}function bo(n,o,e){const s=Math.max(n.x,o.x),t=Math.max(n.y,o.y),l=Math.min(n.x+n.width,o.x+o.width)-s,r=Math.min(n.y+n.height,o.y+o.height)-t;return l>0&&r>0?e?(e.x=s,e.y=t,e.width=l,e.height=r,e):{x:s,y:t,width:l,height:r}:e?(e.x=0,e.y=0,e.width=0,e.height=0,e):{x:0,y:0,width:0,height:0}}function ds(n,o){return o?(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height,o):{x:n.x,y:n.y,width:n.width,height:n.height}}function un(n,o){return n===o?!0:n===null||o===null?!1:n.x===o.x&&n.y===o.y&&n.width===o.width&&n.height===o.height}function Bo(n,o){return n.x1<=o.x2&&n.y1<=o.y2&&n.x2>=o.x1&&n.y2>=o.y1}function hn(n){return n.x1{this.loaded=!0,this.emit("loaded")}).catch(console.error),this.fontFace=f,this.fontUrl=t}}const Po=2048;function No(n,o,e,s,t){const l=n!=="bottom"?.5*o:0;return e*(s-1)+l+Math.max(e,o)+(t||0)}class pn{constructor(o,e){u(this,"_canvas");u(this,"_context");u(this,"_settings");u(this,"renderInfo");this._canvas=o,this._context=e,this._settings=this.mergeDefaults({})}set settings(o){this._settings=this.mergeDefaults(o)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const o=[this._settings.fontFace],e=[];for(let s=0,t=o.length;s{console.warn("[Lightning] Font load error",e,o)}).then(()=>{document.fonts.check(o,this._settings.text)||console.warn("[Lightning] Font not found",o)})}catch{console.warn("[Lightning] Can't check font loading for "+o)}}}calculateRenderInfo(){const o={},e=this.getPrecision(),s=this._settings.paddingLeft*e,t=this._settings.paddingRight*e,l=this._settings.fontSize*e;let r=this._settings.offsetY===null?null:this._settings.offsetY*e,i=(this._settings.lineHeight||l)*e;const f=this._settings.w*e,c=this._settings.h*e;let a=this._settings.wordWrapWidth*e;const d=this._settings.cutSx*e,m=this._settings.cutEx*e,p=this._settings.cutSy*e,h=this._settings.cutEy*e,y=(this._settings.letterSpacing||0)*e,g=this._settings.textIndent*e;this.setFontProperties();let x=f||2048/this.getPrecision(),_=x-s;if(_<10&&(x+=10-_,_=10),a||(a=_),this._settings.textOverflow&&!this._settings.wordWrap){let k;switch(this._settings.textOverflow){case"clip":k="";break;case"ellipsis":k=this._settings.overflowSuffix;break;default:k=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,a-g,k)}let S;if(this._settings.wordWrap)S=this.wrapText(this._settings.text,a,y,g);else{S={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const k=S.l.length;for(let L=0;Lthis._settings.maxLines){const k=I.slice(0,this._settings.maxLines);let L=null;if(this._settings.overflowSuffix){const $=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,B=this.wrapText(k[k.length-1],a-$,y,g);k[k.length-1]=`${B.l[0]}${this._settings.overflowSuffix}`,L=[B.l.length>1?B.l[1]:""]}else L=[""];let F;const R=I.length;let N=0;const O=S.n.length;for(F=this._settings.maxLines;F=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(o.cutSx||o.cutSy)&&this._context.translate(-o.cutSx,-o.cutSy);let i,f;const c=[];for(let d=0,m=t.length;de)for(;i>0&&(f=this._context.measureText(o.substring(0,i)).width+t,f>e);)i-=1;else for(;i=t?s:"")}wrapText(o,e,s,t=0){const l=o.split(/\r?\n/g);let r=[];const i=[];for(let f=0;fd?(p>0&&(c.push(a),a=""),a+=m[p],d=e-h-(p===0?t:0)):(d-=y,a+=` ${m[p]}`)}c.push(a),a="",r=r.concat(c),fs+this._context.measureText(t).width+e,0):this._context.measureText(o).width}mergeDefaults(o){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...o}}}const Fo=typeof self>"u"?globalThis:self;var ss;const zo=((ss=Fo.document)==null?void 0:ss.fonts)||Fo.fonts;function mn(n){const{fontFamily:o,fontStyle:e,fontWeight:s,fontStretch:t,fontSize:l}=n;return[e,s,t,`${l}px`,o].join(" ")}const yn=Me(0,0,0,0);class gn extends cs{constructor(e){super(e);u(this,"canvas");u(this,"context");u(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let s=this.canvas.getContext("2d");s||(this.canvas=document.createElement("canvas"),s=this.canvas.getContext("2d")),this.context=s,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,s)=>{e.props.fontFamily=s,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,s)=>{e.props.fontWeight=s,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,s)=>{e.props.fontStyle=s,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,s)=>{e.props.fontStretch=s,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,s)=>{e.props.fontSize=s,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,s)=>{e.props.text=s,this.invalidateLayoutCache(e)},textAlign:(e,s)=>{e.props.textAlign=s,this.invalidateLayoutCache(e)},color:(e,s)=>{e.props.color=s,this.invalidateLayoutCache(e)},x:(e,s)=>{e.props.x=s,this.invalidateVisibleWindowCache(e)},y:(e,s)=>{e.props.y=s,this.invalidateVisibleWindowCache(e)},contain:(e,s)=>{e.props.contain=s,this.invalidateLayoutCache(e)},width:(e,s)=>{e.props.width=s,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,s)=>{e.props.height=s,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,s)=>{e.props.offsetY=s,this.invalidateLayoutCache(e)},scrollY:(e,s)=>{e.props.scrollY=s},letterSpacing:(e,s)=>{e.props.letterSpacing=s,this.invalidateLayoutCache(e)},lineHeight:(e,s)=>{e.props.lineHeight=s,this.invalidateLayoutCache(e)},maxLines:(e,s)=>{e.props.maxLines=s,this.invalidateLayoutCache(e)},textBaseline:(e,s)=>{e.props.textBaseline=s,this.invalidateLayoutCache(e)},verticalAlign:(e,s)=>{e.props.verticalAlign=s,this.invalidateLayoutCache(e)},overflowSuffix:(e,s)=>{e.props.overflowSuffix=s,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof hs}addFontFace(e){zo.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new _e,canvasPages:void 0,lightning2TextRenderer:new pn(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const h=mn(e.props);if(e.fontInfo={cssString:h,loaded:!1},!e.fontInfo.loaded){zo.load(h).then(this.onFontLoaded.bind(this,e,h)).catch(this.onFontLoadError.bind(this,e,h));return}}if(!e.fontInfo.loaded)return;if(!e.renderInfo){const h=e.props.maxLines,y=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,g=y>0&&h>0?Math.min(y,h):Math.max(y,h);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:Ce(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:e.props.contain!=="none",wordWrapWidth:e.props.contain==="none"?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:g,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}const{x:s,y:t,width:l,height:r,scrollY:i,contain:f}=e.props,{visibleWindow:c}=e;let{renderWindow:a,canvasPages:d}=e;if(!c.valid){const h=Me(s,t,f!=="none"?s+l:1/0,f==="both"?t+r:1/0,yn);cn(this.rendererBounds,h,c),c.valid=!0}const m=c.y2-c.y1,p=Math.ceil(m/e.renderInfo.lineHeight);if(m===0){d=void 0,a=void 0,this.setStatus(e,"loaded");return}else if(a&&d){const h=s+a.x1,y=t-i+a.y1,g=s+a.x2,x=t-i+a.y2;if(h<=c.x1&&g>=c.x2&&y<=c.y1&&x>=c.y2){this.setStatus(e,"loaded");return}xc.y1&&(a.y1-=p*e.renderInfo.lineHeight,a.y2-=p*e.renderInfo.lineHeight,d.unshift(d.pop()),d[0].lineNumStart=d[1].lineNumStart-p,d[0].lineNumEnd=d[0].lineNumStart+p,d[0].valid=!1)}else{const h=e.renderInfo.lineHeight*p,y=Math.ceil(i/h),g=y*p,x=g-p,_=g+p;d=[{texture:d==null?void 0:d[0].texture,lineNumStart:x,lineNumEnd:x+p,valid:!1},{texture:d==null?void 0:d[1].texture,lineNumStart:g,lineNumEnd:g+p,valid:!1},{texture:d==null?void 0:d[2].texture,lineNumStart:_,lineNumEnd:_+p,valid:!1}],e.canvasPages=d;const S=y*h;a={x1:0,y1:S-h,x2:l,y2:S+h*2}}e.renderWindow=a,performance.now();for(const h of d)if(!h.valid){if(h.lineNumStart<0){h.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),h.valid=!0;continue}e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(h.lineNumStart,h.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(h.lineNumStart,h.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||(h.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0})),h.valid=!0}this.setStatus(e,"loaded")}renderQuads(e,s,t,l){var k,L,F,R,N,O,$,B,T,w,A,z;const{stage:r}=this,{canvasPages:i,textW:f=0,textH:c=0,renderWindow:a}=e;if(!i||!a)return;const{x:d,y:m,scrollY:p,contain:h,width:y,height:g}=e.props,x={x:d,y:m,width:h!=="none"?y:f,height:h==="both"?g:c};bo({x:0,y:0,width:r.options.appWidth,height:r.options.appHeight},x);const S=(a.y2-a.y1)/3,{zIndex:I,color:v}=e.props,P=l*an(v),b=it(4294967295,P);i[0].valid&&this.stage.renderer.addQuad({alpha:P,clippingRect:t,colorBl:b,colorBr:b,colorTl:b,colorTr:b,width:((L=(k=i[0].texture)==null?void 0:k.dimensions)==null?void 0:L.width)||0,height:((R=(F=i[0].texture)==null?void 0:F.dimensions)==null?void 0:R.height)||0,texture:i[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:s.tx,ty:s.ty-p+a.y1,ta:s.ta,tb:s.tb,tc:s.tc,td:s.td}),i[1].valid&&this.stage.renderer.addQuad({alpha:P,clippingRect:t,colorBl:b,colorBr:b,colorTl:b,colorTr:b,width:((O=(N=i[1].texture)==null?void 0:N.dimensions)==null?void 0:O.width)||0,height:((B=($=i[1].texture)==null?void 0:$.dimensions)==null?void 0:B.height)||0,texture:i[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:s.tx,ty:s.ty-p+a.y1+S,ta:s.ta,tb:s.tb,tc:s.tc,td:s.td}),i[2].valid&&this.stage.renderer.addQuad({alpha:P,clippingRect:t,colorBl:b,colorBr:b,colorTl:b,colorTr:b,width:((w=(T=i[2].texture)==null?void 0:T.dimensions)==null?void 0:w.width)||0,height:((z=(A=i[2].texture)==null?void 0:A.dimensions)==null?void 0:z.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:s.tx,ty:s.ty-p+a.y1+S+S,ta:s.ta,tb:s.tb,tc:s.tc,td:s.td})}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,s){var t;s!==((t=e.fontInfo)==null?void 0:t.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,s,t){var l;s!==((l=e.fontInfo)==null?void 0:l.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,console.error(`CanvasTextRenderer: Error loading font '${e.fontInfo.cssString}'`,t),this.scheduleUpdateState(e))}}class xn{constructor(o){u(this,"textureSource");this.textureSource=o}}class bn{constructor(o){u(this,"stage");this.stage=o}}class Sn{}class ps extends Sn{constructor(e,s,t,l,r,i,f,c,a,d){super();u(this,"glw");u(this,"options");u(this,"buffers");u(this,"shader");u(this,"shaderProps");u(this,"alpha");u(this,"clippingRect");u(this,"dimensions");u(this,"bufferIdx");u(this,"zIndex");u(this,"length",0);u(this,"numQuads",0);u(this,"textures",[]);u(this,"maxTextures");this.glw=e,this.options=s,this.buffers=t,this.shader=l,this.shaderProps=r,this.alpha=i,this.clippingRect=f,this.dimensions=c,this.bufferIdx=a,this.zIndex=d,this.maxTextures=l.supportsIndexedTextures?e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS):1}addTexture(e){const{textures:s,maxTextures:t}=this,l=s.findIndex(i=>i===e);if(l!==-1)return l;const r=s.length;return r>=t?4294967295:(this.textures.push(e),r)}draw(){const{glw:e,shader:s,shaderProps:t,options:l}=this,{shManager:r}=l;r.useShader(s),s.bindRenderOp(this,t);const i=this.bufferIdx/24*6*2;if(this.clippingRect.valid){const{x:f,y:c,width:a,height:d}=this.clippingRect,m=l.pixelRatio,p=l.canvas.height,h=Math.round(f*m),y=Math.round(a*m),g=Math.round(d*m),x=Math.round(p-g-c*m);e.setScissorTest(!0),e.scissor(h,x,y,g)}else e.setScissorTest(!1);e.drawElements(e.TRIANGLES,6*this.numQuads,e.UNSIGNED_SHORT,i)}}function wn(n){const o={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(o).forEach(s=>{o[s]=n.getParameter(n[s])}),o}function Tn(n){const o={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(o).forEach(s=>{o[s]=n.getExtension(s)}),o}function Cn(n,o){const e=~~(o/80),s=new Uint16Array(e*6);for(let l=0,r=0;ln&&!(n&n-1),ae=(n,o,e,s)=>{const t=3*n,l=3*(e-n)-t,r=1-t-l,i=3*o,f=3*(s-o)-i,c=1-i-f;return function(a){if(a>=1)return 1;if(a<=0)return 0;let d=.5,m,p,h;for(let x=0;x<20;x++){if(m=d*(d*(d*r+l)+t),h=a-m,h>-1e-8&&h<1e-8)return d*(d*(d*c+f)+i);if(p=d*(d*(3*r)+2*l)+t,p>1e-10&&p<1e-10)break;d+=h/p}let y=0,g=1;for(let x=0;x<20;x++){if(d=.5*(y+g),m=d*(d*(d*r+l)+t),h=a-m,h>-1e-8&&h<1e-8)return d*(d*(d*c+f)+i);h<0?g=d:y=d}}},In=So(n=>{switch(n){case"linear":return function(e){return e};case"ease":return ae(.25,.1,.25,1);case"ease-in":return ae(.42,0,1,1);case"ease-out":return ae(0,0,.58,1);case"ease-in-out":return ae(.42,0,.58,1);case"ease-in-sine":return ae(.12,0,.39,0);case"ease-out-sine":return ae(.12,0,.39,0);case"ease-in-out-sine":return ae(.37,0,.63,1);case"ease-in-cubic":return ae(.32,0,.67,0);case"ease-out-cubic":return ae(.33,1,.68,1);case"ease-in-out-cubic":return ae(.65,0,.35,1);case"ease-in-circ":return ae(.55,0,1,.45);case"ease-out-circ":return ae(0,.55,.45,1);case"ease-in-out-circ":return ae(.85,0,.15,1);case"ease-in-back":return ae(.36,0,.66,-.56);case"ease-out-back":return ae(.34,1.56,.64,1);case"ease-in-out-back":return ae(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(e){return e===1?1:0};default:const o="cubic-bezier(";if(n&&n.indexOf(o)===0){const e=n.substr(o.length,n.length-o.length-1).split(",");if(e.length!==4)return console.warn("Unknown timing function: "+n),function(i){return i};const s=parseFloat(e[0]||"0.42"),t=parseFloat(e[1]||"0"),l=parseFloat(e[2]||"1"),r=parseFloat(e[3]||"1");return isNaN(s)||isNaN(t)||isNaN(l)||isNaN(r)?(console.warn(" Unknown timing function: "+n),function(i){return i}):ae(s,t,l,r)}else return console.warn("Unknown timing function: "+n),function(e){return e}}});Math.hypot||(Math.hypot=(...n)=>{let o=0,e=n.length;for(;e--;)o+=n[e]*n[e];return Math.sqrt(o)});const $o=new Uint8Array([0,0,0,0]);class ms extends xn{constructor(e,s){super(s);u(this,"glw");u(this,"_nativeCtxTexture",null);u(this,"_state","freed");u(this,"_w",0);u(this,"_h",0);this.glw=e}get ctxTexture(){return this._state==="freed"&&this.load(),this._nativeCtxTexture,this._nativeCtxTexture}get w(){return this._w}get h(){return this._h}load(){this._state==="loading"||this._state==="loaded"||(this._state="loading",this.textureSource.setState("loading"),this.onLoadRequest().then(({width:e,height:s})=>{this._state="loaded",this._w=e,this._h=s,this.textureSource.setState("loaded",{width:e,height:s})}).catch(e=>{this._state="failed",this.textureSource.setState("failed",e),console.error(e)}))}async onLoadRequest(){var r;this._nativeCtxTexture=this.createNativeCtxTexture();const{glw:e}=this;e.activeTexture(0),e.bindTexture(this._nativeCtxTexture),e.texParameteri(e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,$o);const s=await((r=this.textureSource)==null?void 0:r.getTextureData());let t=0,l=0;if(this._nativeCtxTexture,e.activeTexture(0),s.data instanceof ImageBitmap||s.data instanceof ImageData||vn(s.data)){const i=s.data;t=i.width,l=i.height,e.bindTexture(this._nativeCtxTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!s.premultiplyAlpha),e.texImage2D(0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),(e.isWebGl2()||Oo(t)&&Oo(l))&&e.generateMipmap()}else if(s.data===null)t=0,l=0,e.bindTexture(this._nativeCtxTexture),e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,$o);else if("mipmaps"in s.data&&s.data.mipmaps){const{mipmaps:i,width:f=0,height:c=0,type:a,glInternalFormat:d}=s.data,m=a==="ktx"?new DataView(i[0]??new ArrayBuffer(0)):i[0];e.bindTexture(this._nativeCtxTexture),e.compressedTexImage2D(0,d,f,c,0,m),e.texParameteri(e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_MIN_FILTER,e.LINEAR)}else console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",s);return{width:t,height:l}}free(){if(this._state==="freed"||(this._state="freed",this._w=0,this._h=0,!this._nativeCtxTexture))return;const{glw:e}=this;e.deleteTexture(this._nativeCtxTexture),this._nativeCtxTexture=null}createNativeCtxTexture(){const{glw:e}=this,s=e.createTexture();if(!s)throw new Error("Could not create WebGL Texture");return s}}const dt=class dt extends Gt{constructor(e,s){super(e);u(this,"props");this.props=dt.resolveDefaults(s||{})}get color(){return this.props.color}set color(e){this.props.color=e}async getTextureData(){const e=new Uint32Array([this.color]),s=new Uint8ClampedArray(e.buffer);return{data:new ImageData(s,1,1),premultiplyAlpha:!0}}static makeCacheKey(e){return`ColorTexture,${dt.resolveDefaults(e).color}`}static resolveDefaults(e){return{color:e.color||4294967295}}};u(dt,"z$__type__Props");let Ot=dt;const Wt=class Wt extends Gt{constructor(e,s){super(e);u(this,"props");u(this,"parentTexture");u(this,"onParentTxLoaded",()=>{this.setState("loaded",{width:this.props.width,height:this.props.height})});u(this,"onParentTxFailed",(e,s)=>{this.setState("failed",s)});this.parentTexture=this.txManager.loadTexture(s.texture.txType,s.texture.props,s.texture.options),this.props=Wt.resolveDefaults(s||{}),queueMicrotask(()=>{const t=this.parentTexture;t.state==="loaded"?this.onParentTxLoaded(t,t.dimensions):t.state==="failed"&&this.onParentTxFailed(t,t.error),t.on("loaded",this.onParentTxLoaded),t.on("failed",this.onParentTxFailed)})}async getTextureData(){return{data:this.props}}static makeCacheKey(e){return!1}static resolveDefaults(e){return{texture:e.texture,x:e.x||0,y:e.y||0,width:e.width||0,height:e.height||0}}};u(Wt,"z$__type__Props");let pt=Wt;class _n extends ms{constructor(o,e){super(o,e)}async onLoadRequest(){var e,s;const o=await this.textureSource.getTextureData();return{width:((e=o.data)==null?void 0:e.width)||0,height:((s=o.data)==null?void 0:s.height)||0}}}class ys extends Je{constructor(o){super({renderer:o,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(o){const{glw:e}=this;e.activeTexture(0),e.bindTexture(o[0].ctxTexture)}}u(ys,"shaderSources",{vertex:` - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - attribute vec2 a_position; - attribute vec2 a_textureCoordinate; - attribute vec4 a_color; - - uniform vec2 u_resolution; - uniform float u_pixelRatio; - - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - - void main() { - vec2 normalized = a_position * u_pixelRatio / u_resolution; - vec2 zero_two = normalized * 2.0; - vec2 clip_space = zero_two - 1.0; - - // pass to fragment - v_color = a_color; - v_textureCoordinate = a_textureCoordinate; - - // flip y - gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); - } - `,fragment:` - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - uniform vec2 u_resolution; - uniform sampler2D u_texture; - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - - void main() { - vec4 color = texture2D(u_texture, v_textureCoordinate); - gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate); - } - `});class gs extends Je{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});u(this,"supportsIndexedTextures",!0)}bindTextures(e){const{renderer:s,glw:t}=this;if(e.length>s.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error(`DefaultShaderBatched: Cannot bind more than ${s.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);e.forEach((r,i)=>{t.activeTexture(i),t.bindTexture(r.ctxTexture)});const l=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",l)}}u(gs,"shaderSources",{vertex:` - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - attribute vec2 a_textureCoordinate; - attribute vec2 a_position; - attribute vec4 a_color; - attribute float a_textureIndex; - attribute float a_depth; - - uniform vec2 u_resolution; - uniform float u_pixelRatio; - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - varying float v_textureIndex; - - void main(){ - vec2 normalized = a_position * u_pixelRatio / u_resolution; - vec2 zero_two = normalized * 2.0; - vec2 clip_space = zero_two - 1.0; - - // pass to fragment - v_color = a_color; - v_textureCoordinate = a_textureCoordinate; - v_textureIndex = a_textureIndex; - - // flip y - gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); - } - `,fragment:e=>` - #define txUnits ${e} - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - uniform vec2 u_resolution; - uniform sampler2D u_image; - uniform sampler2D u_textures[txUnits]; - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - varying float v_textureIndex; - - vec4 sampleFromTexture(sampler2D textures[${e}], int idx, vec2 uv) { - ${Array.from(Array(e).keys()).map(s=>` - ${s!==0?"else ":""}if (idx == ${s}) { - return texture2D(textures[${s}], uv); - } - `).join("")} - return texture2D(textures[0], uv); - } - - void main(){ - gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate); - } - `});const Zt=new Map,kn=(n,o)=>{const e=JSON.stringify(n);if(Zt.has(e))return Zt.get(e);const s=(n??[]).map(t=>({type:t.type,props:o[t.type].resolveDefaults(t.props||{})}));return Zt.set(e,s),s},Ie=class Ie extends Je{constructor(e,s,t){const l=Ie.createShader(s,t);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...l.uniforms],shaderSources:{vertex:l.vertex,fragment:l.fragment}});u(this,"effects",[]);this.effects=l.effects,this.calculateProps=So(this.calculateProps.bind(this))}bindTextures(e){const{glw:s}=this;s.activeTexture(0),s.bindTexture(e[0].ctxTexture)}calculateProps(e){const s=this.renderer.shManager.getRegisteredEffects(),t=[];return e==null||e.forEach((l,r)=>{const i=this.effects[r],f=s[i.name],c=l.props??{},a=i.uniformInfo;Object.keys(c).forEach(d=>{const m=f.uniforms[d],p=a[d];let h=m.validator?m.validator(c[d],c):c[d];Array.isArray(h)&&(h=new Float32Array(h)),t.push({name:p.name,value:h})})}),t}bindProps(e){this.calculateProps(e.effects).forEach(t=>{this.setUniform(t.name,t.value)})}static createShader(e,s){const t={},l={};let r="";const i=[],f=[],c=e.effects.map(h=>{const y=s[h.type],g=y.getEffectKey(h.props||{});t[g]=t[g]?++t[g]:1;const x=t[g];x===1&&f.push({key:g,type:h.type,props:h.props});const _=new y({ref:`${g}${x===1?"":x}`,target:g,props:h.props});return r+=_.declaredUniforms,i.push(...Object.values(_.uniformInfo)),_});let a="";f==null||f.forEach(h=>{const y=s[h.type],g=y.resolveDefaults(h.props??{}),x=[];for(const b in y.methods){let k=b;const L=y.methods[b];l[b]&&l[b]!==L&&(k=Ie.resolveMethodDuplicate(b,L,l)),l[k]=L.replace("function",k),x.push({m:b,cm:k})}let _=y.onShaderMask instanceof Function?y.onShaderMask(g):y.onShaderMask,S=y.onColorize instanceof Function?y.onColorize(g):y.onColorize,I=y.onEffectMask instanceof Function?y.onEffectMask(g):y.onEffectMask;x.forEach(b=>{const{m:k,cm:L}=b,F=new RegExp(`\\$${k}`,"g");_&&(_=_.replace(F,L)),S&&(S=S.replace(F,L)),I&&(I=I.replace(F,L))});const v=y.getMethodParameters(y.uniforms,g),P=v.length>0?`, ${v}`:"";_&&(a+=` - float fx_${h.key}_onShaderMask(float shaderMask ${P}) { - ${_} - } - `),S&&(a+=` - vec4 fx_${h.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${P}) { - ${S} - } - `),I&&(a+=` - vec4 fx_${h.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${P}) { - ${I} - } - `)});let d="";for(const h in l)d+=l[h];let m="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",p=` - - `;for(let h=0;h0?`, ${y.passParameters}`:"",x=s[y.name];x.onShaderMask&&(p+=` - shaderMask = fx_${y.target}_onShaderMask(shaderMask ${g}); - `),x.onColorize&&(p+=` - maskColor = fx_${y.target}_onColorize(shaderMask, maskColor, shaderColor${g}); - `),x.onEffectMask&&(m=`fx_${y.target}_onEffectMask(shaderMask, maskColor, shaderColor${g})`);const _=c[h+1];(_===void 0||s[_.name].onEffectMask)&&(p+=` - shaderColor = ${m}; - `)}return{effects:c,uniforms:i,fragment:Ie.fragment(r,d,a,p),vertex:Ie.vertex()}}static resolveMethodDuplicate(e,s,t,l=0){const r=e+(l>0?l:"");return t[r]&&t[r]!==s?this.resolveMethodDuplicate(e,s,t,++l):r}static resolveDefaults(e,s){return{effects:kn(e.effects,s),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,s){var l;let t="";return(l=e.effects)==null||l.forEach(r=>{const f=s[r.type].getEffectKey(r.props||{});t+=`,${f}`}),`DynamicShader${t}`}};u(Ie,"z$__type__Props"),u(Ie,"vertex",()=>` - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - attribute vec2 a_textureCoordinate; - attribute vec2 a_position; - attribute vec4 a_color; - attribute float a_textureIndex; - - uniform vec2 u_resolution; - uniform float u_pixelRatio; - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - varying float v_textureIndex; - - void main(){ - vec2 normalized = a_position * u_pixelRatio / u_resolution; - vec2 zero_two = normalized * 2.0; - vec2 clip_space = zero_two - 1.0; - - // pass to fragment - v_color = a_color; - v_textureCoordinate = a_textureCoordinate; - v_textureIndex = a_textureIndex; - - // flip y - gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); - } - `),u(Ie,"fragment",(e,s,t,l)=>` - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - #define PI 3.14159265359 - - uniform vec2 u_resolution; - uniform vec2 u_dimensions; - uniform float u_alpha; - uniform float u_radius; - uniform sampler2D u_texture; - uniform float u_pixelRatio; - - ${e} - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - - ${s} - - ${t} - - void main() { - vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5; - vec2 d = abs(p) - (u_dimensions) * 0.5; - float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); - - vec4 shaderColor = vec4(0.0); - float shaderMask = lng_DefaultMask; - - vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color; - - shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0)); - - ${l} - - gl_FragColor = shaderColor * u_alpha; - } - `);let je=Ie;class io extends Je{constructor(o){super({renderer:o,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(o){return{radius:o.radius||10,$dimensions:{width:0,height:0}}}bindTextures(o){const{glw:e}=this;e.activeTexture(0),e.bindTexture(o[0].ctxTexture)}bindProps(o){this.setUniform("u_radius",o.radius)}canBatchShaderProps(o,e){return o.radius===e.radius&&o.$dimensions.width===e.$dimensions.width&&o.$dimensions.height===e.$dimensions.height}}u(io,"z$__type__Props"),u(io,"shaderSources",{vertex:` - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - attribute vec2 a_position; - attribute vec2 a_textureCoordinate; - attribute vec4 a_color; - attribute float a_textureIndex; - attribute float a_depth; - - uniform vec2 u_resolution; - uniform float u_pixelRatio; - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - - void main() { - vec2 normalized = a_position * u_pixelRatio / u_resolution; - vec2 zero_two = normalized * 2.0; - vec2 clip_space = zero_two - 1.0; - - // pass to fragment - v_color = a_color; - v_textureCoordinate = a_textureCoordinate; - - // flip y - gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); - } - `,fragment:` - # ifdef GL_FRAGMENT_PRESICISON_HIGH - precision highp float; - # else - precision mediump float; - # endif - - uniform vec2 u_resolution; - uniform vec2 u_dimensions; - uniform float u_radius; - uniform sampler2D u_texture; - - varying vec4 v_color; - varying vec2 v_textureCoordinate; - - float boxDist(vec2 p, vec2 size, float radius){ - size -= vec2(radius); - vec2 d = abs(p) - size; - return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius; - } - - float fillMask(float dist) { - return clamp(-dist, 0.0, 1.0); - } - - void main() { - vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color; - vec2 halfDimensions = u_dimensions * 0.5; - - float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius); - gl_FragColor = mix(vec4(0.0), color, fillMask(d)); - } - `});const Rn=new Float32Array([1,0,0,0,1,0,0,0,1]),Yt=class Yt extends Je{constructor(o){super({renderer:o,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(o){const{glw:e}=this;e.activeTexture(0),e.bindTexture(o[0].ctxTexture)}bindProps(o){const e=Yt.resolveDefaults(o);for(const s in e)if(s==="transform")this.setUniform("u_transform",!1,e[s]);else if(s==="scrollY")this.setUniform("u_scrollY",e[s]);else if(s==="color"){const t=Ce(e.color);this.setUniform("u_color",t)}else s==="size"?this.setUniform("u_size",e[s]):s==="distanceRange"?this.setUniform("u_distanceRange",e[s]):s==="debug"&&this.setUniform("u_debug",e[s]?1:0)}static resolveDefaults(o={}){return{transform:o.transform??Rn,scrollY:o.scrollY??0,color:o.color??4294967295,size:o.size??16,distanceRange:o.distanceRange??1,debug:o.debug??!1}}};u(Yt,"shaderSources",{vertex:` - // an attribute is an input (in) to a vertex shader. - // It will receive data from a buffer - attribute vec2 a_position; - attribute vec2 a_textureCoordinate; - - uniform vec2 u_resolution; - uniform mat3 u_transform; - uniform float u_scrollY; - uniform float u_pixelRatio; - uniform float u_size; - - varying vec2 v_texcoord; - - void main() { - vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY); - vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy; - gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1); - v_texcoord = a_textureCoordinate; - } - `,fragment:` - precision highp float; - - uniform vec4 u_color; - uniform sampler2D u_texture; - uniform float u_distanceRange; - uniform float u_pixelRatio; - uniform int u_debug; - - varying vec2 v_texcoord; - - float median(float r, float g, float b) { - return max(min(r, g), min(max(r, g), b)); - } - - void main() { - vec3 sample = texture2D(u_texture, v_texcoord).rgb; - if (u_debug == 1) { - gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0); - return; - } - float scaledDistRange = u_distanceRange * u_pixelRatio; - float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5); - float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a; - - // Build the final color. - // IMPORTANT: We must premultiply the color by the alpha value before returning it. - gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity); - } - `});let ro=Yt;class Ue extends ce{constructor(){super(...arguments);u(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){return{radius:e.radius??10}}}u(Ue,"z$__type__Props"),u(Ue,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let s=e;return Array.isArray(s)?s.length===2?s=[s[0],s[1],s[0],s[1]]:s.length===3?s=[s[0],s[1],s[2],s[0]]:s.length!==4&&(s=[s[0],s[0],s[0],s[0]]):typeof s=="number"&&(s=[s,s,s,s]),s}}}),u(Ue,"methods",{fillMask:` - float function(float dist) { - return clamp(-dist, 0.0, 1.0); - } - `,boxDist:` - float function(vec2 p, vec2 size, float radius) { - size -= vec2(radius); - vec2 d = abs(p) - size; - return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius; - } - `}),u(Ue,"onShaderMask",` - vec2 halfDimensions = u_dimensions * 0.5; - float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5); - r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5); - r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y); - r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y); - return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r); - `),u(Ue,"onEffectMask",` - return mix(vec4(0.0), maskColor, $fillMask(shaderMask)); - `);class rt extends ce{constructor(){super(...arguments);u(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){return{width:e.width??10,color:e.color??4294967295}}}u(rt,"z$__type__Props"),u(rt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Ce(e),method:"uniform4fv",type:"vec4"}}),u(rt,"onEffectMask",` - float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0); - return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask); - `),u(rt,"onColorize",` - return color; - `);class Xe extends ce{constructor(){super(...arguments);u(this,"name","linearGradient")}static getEffectKey(e){return`linearGradient${e.colors.length}`}static resolveDefaults(e){const s=e.colors??[4278190080,4294967295];let t=e.stops;if(!t){t=[];const l=s.length-1;for(let r=0;re.map(t=>Ce(t)).reduce((t,l)=>t.concat(l),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],validator:(e,s)=>{const t=s.colors??[];let l=e;const r=e;if(l.length===0||l&&l.length!==t.length){for(let i=0;ie.colors.length,method:"uniform1fv",type:"float"}}),u(Xe,"methods",{fromLinear:` - vec4 function(vec4 linearRGB) { - vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055); - vec4 lower = linearRGB * vec4(12.92); - return mix(higher, lower, 1.0); - } - `,toLinear:` - vec4 function(vec4 sRGB) { - vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4)); - vec4 lower = sRGB/vec4(12.92); - return mix(higher, lower, 1.0); - } - `,calcPoint:` - vec2 function(float d, float angle) { - return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5); - } - `}),u(Xe,"ColorLoop",e=>{let s="";for(let t=2;t` - float a = angle - (PI / 180.0 * 90.0); - float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a)); - vec2 f = $calcPoint(lineDist * 0.5, a); - vec2 t = $calcPoint(lineDist * 0.5, a + PI); - vec2 gradVec = t - f; - float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec); - - float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]); - vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc)); - for(int i = 1; i < ${e.colors.length||1}-1; i++) { - stopCalc = (dist - stops[i]) / (stops[i + 1] - stops[i]); - colorOut = mix(colorOut, colors[i + 1], clamp(stopCalc, 0.0, 1.0)); - } - return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0)); - `);class lo extends ce{constructor(){super(...arguments);u(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){return{amount:e.amount??1}}}u(lo,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),u(lo,"onColorize",` - float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b; - return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a); - `);class We extends ce{constructor(){super(...arguments);u(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){return{width:e.width??10,color:e.color??4294967295}}}u(We,"z$__type__Props"),u(We,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Ce(e),method:"uniform4fv",type:"vec4"}}),u(We,"methods",{fillMask:` - float function(float dist) { - return clamp(-dist, 0.0, 1.0); - } - `,rectDist:` - float function(vec2 p, vec2 size) { - vec2 d = abs(p) - size; - return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); - } - `}),u(We,"onEffectMask",` - vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0); - float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y)); - return mix(shaderColor, maskColor, $fillMask(mask)); - `),u(We,"onColorize",` - return color; - `);class Ye extends ce{constructor(){super(...arguments);u(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){return{width:e.width??10,color:e.color??4294967295}}}u(Ye,"z$__type__Props"),u(Ye,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Ce(e),method:"uniform4fv",type:"vec4"}}),u(Ye,"methods",{fillMask:` - float function(float dist) { - return clamp(-dist, 0.0, 1.0); - } - `,rectDist:` - float function(vec2 p, vec2 size) { - vec2 d = abs(p) - size; - return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); - } - `}),u(Ye,"onEffectMask",` - vec2 pos = vec2(0.0, width * 0.5); - float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5)); - return mix(shaderColor, maskColor, $fillMask(mask)); - `),u(Ye,"onColorize",` - return color; - `);class Ge extends ce{constructor(){super(...arguments);u(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){return{width:e.width??10,color:e.color??4294967295}}}u(Ge,"z$__type__Props"),u(Ge,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Ce(e),method:"uniform4fv",type:"vec4"}}),u(Ge,"methods",{fillMask:` - float function(float dist) { - return clamp(-dist, 0.0, 1.0); - } - `,rectDist:` - float function(vec2 p, vec2 size) { - vec2 d = abs(p) - size; - return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); - } - `}),u(Ge,"onEffectMask",` - vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5); - float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5)); - return mix(shaderColor, maskColor, $fillMask(mask)); - `),u(Ge,"onColorize",` - return color; - `);class He extends ce{constructor(){super(...arguments);u(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){return{width:e.width??10,color:e.color??4294967295}}}u(He,"z$__type__Props"),u(He,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Ce(e),method:"uniform4fv",type:"vec4"}}),u(He,"methods",{fillMask:` - float function(float dist) { - return clamp(-dist, 0.0, 1.0); - } - `,rectDist:` - float function(vec2 p, vec2 size) { - vec2 d = abs(p) - size; - return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); - } - `}),u(He,"onEffectMask",` - vec2 pos = vec2(width * 0.5, 0.0); - float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y)); - return mix(shaderColor, maskColor, $fillMask(mask)); - `),u(He,"onColorize",` - return color; - `);class lt extends ce{constructor(){super(...arguments);u(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){return{amplitude:e.amplitude??.2,narrowness:e.narrowness??4,blockiness:e.blockiness??2,minimizer:e.minimizer??8,time:e.time??Date.now()}}}u(lt,"z$__type__Props"),u(lt,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),u(lt,"methods",{rand:` - float function(vec2 p, float time) { - float t = floor(time * 20.) / 10.; - return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453); - } - `,noise:` - float function(vec2 uv, float blockiness, float time) { - vec2 lv = fract(uv); - vec2 id = floor(uv); - - float n1 = rand(id, time); - float n2 = rand(id+vec2(1,0), time); - float n3 = rand(id+vec2(0,1), time); - float n4 = rand(id+vec2(1,1), time); - vec2 u = smoothstep(0.0, 1.0 + blockiness, lv); - return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y); - } - `,fbm:` - float function(vec2 uv, int count, float blockiness, float complexity, float time) { - float val = 0.0; - float amp = 0.5; - const int MAX_ITERATIONS = 10; - - for(int i = 0; i < MAX_ITERATIONS; i++) { - if(i >= count) {break;} - val += amp * noise(uv, blockiness, time); - amp *= 0.5; - uv *= complexity; - } - return val; - } - `}),u(lt,"onColorize",` - vec2 uv = v_textureCoordinate.xy; - float aspect = u_dimensions.x / u_dimensions.y; - vec2 a = vec2(uv.x * aspect , uv.y); - vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y)); - - float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer); - float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift); - float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift); - float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift); - - vec3 f = vec3(colR, colG, colB); - return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a); - `);class Lt extends ce{constructor(){super(...arguments);u(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){return{fade:e.fade??10}}}u(Lt,"z$__type__Props"),u(Lt,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let s=e;return Array.isArray(s)?s.length===2?s=[s[0],s[1],s[0],s[1]]:s.length===3?s=[s[0],s[1],s[2],s[0]]:s.length!==4&&(s=[s[0],s[0],s[0],s[0]]):typeof s=="number"&&(s=[s,s,s,s]),s}}}),u(Lt,"onColorize",` - vec2 point = v_textureCoordinate.xy * u_dimensions.xy; - vec2 pos1; - vec2 pos2; - vec2 d; - float c; - vec4 result = maskColor; - - - if(fade[0] > 0.0) { - pos1 = vec2(point.x, point.y); - pos2 = vec2(point.x, point.y + fade[0]); - d = pos2 - pos1; - c = dot(pos1, d) / dot(d, d); - result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); - } - - if(fade[1] > 0.0) { - pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y); - pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y); - d = pos1 - pos2; - c = dot(pos2, d) / dot(d, d); - result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); - } - - if(fade[2] > 0.0) { - pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]); - pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y); - d = pos1 - pos2; - c = dot(pos2, d) / dot(d, d); - result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); - } - - if(fade[3] > 0.0) { - pos1 = vec2(point.x, point.y); - pos2 = vec2(point.x + fade[3], point.y); - d = pos2 - pos1; - c = dot(pos1, d) / dot(d, d); - result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0))); - } - - return result; - `);class Bt extends ce{constructor(){super(...arguments);u(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){const s=e.colors??[4278190080,4294967295];let t=e.stops;if(!t){t=[];const l=s.length-1;for(let r=0;re.map(t=>Ce(t)).reduce((t,l)=>t.concat(l),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],validator:(e,s)=>{const t=s.colors??[];let l=e;const r=e;if(l.length===0||l&&l.length!==t.length){for(let i=0;ie.colors.length,method:"uniform1fv",type:"float"}}),u(Bt,"onColorize",e=>` - vec2 point = v_textureCoordinate.xy * u_dimensions; - vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y); - - float dist = length((point - projection) / vec2(width, height)); - - float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]); - vec4 colorOut = mix(colors[0], colors[1], stopCalc); - for(int i = 1; i < ${e.colors.length||1}-1; i++) { - stopCalc = (dist - stops[i]) / (stops[i + 1] - stops[i]); - colorOut = mix(colorOut, colors[i + 1], clamp(stopCalc, 0.0, 1.0)); - } - return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0)); - `);class Ve extends ce{constructor(){super(...arguments);u(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){return{width:e.width??10,progress:e.progress??.5,offset:e.offset??0,range:e.range??Math.PI*2,rounded:e.rounded??!1,radius:e.radius??1,color:e.color??4294967295}}}u(Ve,"z$__type__Props"),u(Ve,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Ce(e),method:"uniform4fv",type:"vec4"}}),u(Ve,"methods",{rotateUV:` - vec2 function(vec2 uv, float d) { - float s = sin(d); - float c = cos(d); - mat2 rotMatrix = mat2(c, -s, s, c); - return uv * rotMatrix; - } - `,drawDot:` - float function(vec2 uv, vec2 p, float r) { - uv += p; - float circle = length(uv) - r; - return clamp(-circle, 0.0, 1.0); - } - `}),u(Ve,"onEffectMask",` - float outerRadius = radius * u_dimensions.y * 0.5; - - float endAngle = range * progress - 0.0005; - - vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5; - - uv = $rotateUV(uv, -(offset)); - float linewidth = width * u_pixelRatio; - float circle = length(uv) - (outerRadius - linewidth) ; - circle = abs(circle) - linewidth; - circle = clamp(-circle, 0.0, 1.0); - - float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5); - float p = endAngle / (PI * 2.); - - circle *= step(fract(angle), fract(p)); - - circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth)); - circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth)); - - return mix(shaderColor, maskColor, circle); - `),u(Ve,"onColorize",` - return color; - `);class En{constructor(){u(this,"shCache",new Map);u(this,"shConstructors",{});u(this,"attachedShader",null);u(this,"effectConstructors",{});u(this,"renderer");this.registerShaderType("DefaultShader",ys),this.registerShaderType("DefaultShaderBatched",gs),this.registerShaderType("RoundedRectangle",io),this.registerShaderType("DynamicShader",je),this.registerShaderType("SdfShader",ro),this.registerEffectType("border",rt),this.registerEffectType("borderBottom",Ge),this.registerEffectType("borderLeft",He),this.registerEffectType("borderRight",We),this.registerEffectType("borderTop",Ye),this.registerEffectType("fadeOut",Lt),this.registerEffectType("linearGradient",Xe),this.registerEffectType("radialGradient",Bt),this.registerEffectType("grayscale",lo),this.registerEffectType("glitch",lt),this.registerEffectType("radius",Ue),this.registerEffectType("radialProgress",Ve)}registerShaderType(o,e){this.shConstructors[o]=e}registerEffectType(o,e){this.effectConstructors[o]=e}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(o,e){if(!this.renderer)throw new Error("Renderer is not been defined");const s=this.shConstructors[o];if(!s)throw new Error(`Shader type "${o}" is not registered`);if(o==="DynamicShader")return this.loadDynamicShader(e);const t=s.resolveDefaults(e),l=s.makeCacheKey(t)||s.name;if(l&&this.shCache.has(l))return{shader:this.shCache.get(l),props:t};const r=new s(this.renderer,e);return l&&this.shCache.set(l,r),{shader:r,props:t}}loadDynamicShader(o){if(!this.renderer)throw new Error("Renderer is not been defined");const e=je.resolveDefaults(o,this.effectConstructors),s=je.makeCacheKey(e,this.effectConstructors);if(s&&this.shCache.has(s))return{shader:this.shCache.get(s),props:e};const t=new je(this.renderer,o,this.effectConstructors);return s&&this.shCache.set(s,t),{shader:t,props:e}}useShader(o){this.attachedShader!==o&&(this.attachedShader&&this.attachedShader.detach(),o.attach(),this.attachedShader=o)}}class xs{constructor(o){u(this,"config");this.config=o}getBuffer(o){var e;return(e=this.config.find(s=>s.attributes[o]))==null?void 0:e.buffer}getAttributeInfo(o){var e;return(e=this.config.find(s=>s.attributes[o]))==null?void 0:e.attributes[o]}}class An{constructor(){u(this,"data",{})}reset(){this.data={}}increment(o){this.data[o]||(this.data[o]=0),this.data[o]++}getData(){return{...this.data}}}class Mn{constructor(o){u(this,"gl");u(this,"activeTextureUnit",0);u(this,"texture2dUnits");u(this,"texture2dParams",new WeakMap);u(this,"scissorEnabled");u(this,"scissorX");u(this,"scissorY");u(this,"scissorWidth");u(this,"scissorHeight");u(this,"blendEnabled");u(this,"blendSrcRgb");u(this,"blendDstRgb");u(this,"blendSrcAlpha");u(this,"blendDstAlpha");u(this,"boundArrayBuffer");u(this,"boundElementArrayBuffer");u(this,"curProgram");u(this,"programUniforms",new WeakMap);u(this,"canvas");u(this,"MAX_RENDERBUFFER_SIZE");u(this,"MAX_TEXTURE_SIZE");u(this,"MAX_VIEWPORT_DIMS");u(this,"MAX_VERTEX_TEXTURE_IMAGE_UNITS");u(this,"MAX_TEXTURE_IMAGE_UNITS");u(this,"MAX_COMBINED_TEXTURE_IMAGE_UNITS");u(this,"MAX_VERTEX_ATTRIBS");u(this,"MAX_VARYING_VECTORS");u(this,"MAX_VERTEX_UNIFORM_VECTORS");u(this,"MAX_FRAGMENT_UNIFORM_VECTORS");u(this,"TEXTURE_MAG_FILTER");u(this,"TEXTURE_MIN_FILTER");u(this,"TEXTURE_WRAP_S");u(this,"TEXTURE_WRAP_T");u(this,"LINEAR");u(this,"CLAMP_TO_EDGE");u(this,"RGBA");u(this,"UNSIGNED_BYTE");u(this,"UNPACK_PREMULTIPLY_ALPHA_WEBGL");u(this,"FLOAT");u(this,"TRIANGLES");u(this,"UNSIGNED_SHORT");u(this,"ONE");u(this,"ONE_MINUS_SRC_ALPHA");u(this,"VERTEX_SHADER");u(this,"FRAGMENT_SHADER");u(this,"STATIC_DRAW");u(this,"COMPILE_STATUS");u(this,"LINK_STATUS");u(this,"DYNAMIC_DRAW");this.gl=o,this.activeTextureUnit=o.getParameter(o.ACTIVE_TEXTURE)-o.TEXTURE0;const e=o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS);this.texture2dUnits=new Array(e).fill(void 0).map((t,l)=>(this.activeTexture(l),o.getParameter(o.TEXTURE_BINDING_2D))),this.activeTexture(this.activeTextureUnit),this.scissorEnabled=o.isEnabled(o.SCISSOR_TEST);const s=o.getParameter(o.SCISSOR_BOX);this.scissorX=s[0],this.scissorY=s[1],this.scissorWidth=s[2],this.scissorHeight=s[3],this.blendEnabled=o.isEnabled(o.BLEND),this.blendSrcRgb=o.getParameter(o.BLEND_SRC_RGB),this.blendDstRgb=o.getParameter(o.BLEND_DST_RGB),this.blendSrcAlpha=o.getParameter(o.BLEND_SRC_ALPHA),this.blendDstAlpha=o.getParameter(o.BLEND_DST_ALPHA),this.boundArrayBuffer=o.getParameter(o.ARRAY_BUFFER_BINDING),this.boundElementArrayBuffer=o.getParameter(o.ELEMENT_ARRAY_BUFFER_BINDING),this.curProgram=o.getParameter(o.CURRENT_PROGRAM),this.canvas=o.canvas,this.MAX_RENDERBUFFER_SIZE=o.MAX_RENDERBUFFER_SIZE,this.MAX_TEXTURE_SIZE=o.MAX_TEXTURE_SIZE,this.MAX_VIEWPORT_DIMS=o.MAX_VIEWPORT_DIMS,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=o.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.MAX_TEXTURE_IMAGE_UNITS=o.MAX_TEXTURE_IMAGE_UNITS,this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=o.MAX_COMBINED_TEXTURE_IMAGE_UNITS,this.MAX_VERTEX_ATTRIBS=o.MAX_VERTEX_ATTRIBS,this.MAX_VARYING_VECTORS=o.MAX_VARYING_VECTORS,this.MAX_VERTEX_UNIFORM_VECTORS=o.MAX_VERTEX_UNIFORM_VECTORS,this.MAX_FRAGMENT_UNIFORM_VECTORS=o.MAX_FRAGMENT_UNIFORM_VECTORS,this.TEXTURE_MAG_FILTER=o.TEXTURE_MAG_FILTER,this.TEXTURE_MIN_FILTER=o.TEXTURE_MIN_FILTER,this.TEXTURE_WRAP_S=o.TEXTURE_WRAP_S,this.TEXTURE_WRAP_T=o.TEXTURE_WRAP_T,this.LINEAR=o.LINEAR,this.CLAMP_TO_EDGE=o.CLAMP_TO_EDGE,this.RGBA=o.RGBA,this.UNSIGNED_BYTE=o.UNSIGNED_BYTE,this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.FLOAT=o.FLOAT,this.TRIANGLES=o.TRIANGLES,this.UNSIGNED_SHORT=o.UNSIGNED_SHORT,this.ONE=o.ONE,this.ONE_MINUS_SRC_ALPHA=o.ONE_MINUS_SRC_ALPHA,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=o.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.TRIANGLES=o.TRIANGLES,this.UNSIGNED_SHORT=o.UNSIGNED_SHORT,this.VERTEX_SHADER=o.VERTEX_SHADER,this.FRAGMENT_SHADER=o.FRAGMENT_SHADER,this.STATIC_DRAW=o.STATIC_DRAW,this.COMPILE_STATUS=o.COMPILE_STATUS,this.LINK_STATUS=o.LINK_STATUS,this.DYNAMIC_DRAW=o.DYNAMIC_DRAW}isWebGl2(){return ln(this.gl)}activeTexture(o){const{gl:e}=this;this.activeTextureUnit!==o&&(e.activeTexture(o+e.TEXTURE0),this.activeTextureUnit=o)}bindTexture(o){const{gl:e,activeTextureUnit:s,texture2dUnits:t}=this;t[s]!==o&&(t[s]=o,e.bindTexture(this.gl.TEXTURE_2D,o))}_getActiveTexture(){const{activeTextureUnit:o,texture2dUnits:e}=this;return e[o]}texParameteri(o,e){const{gl:s,texture2dParams:t}=this,l=this._getActiveTexture();if(!l)throw new Error("No active texture");let r=t.get(l);r||(r={},t.set(l,r)),r[o]!==e&&(r[o]=e,s.texParameteri(s.TEXTURE_2D,o,e))}texImage2D(o,e,s,t,l,r,i,f){const{gl:c}=this;r?c.texImage2D(c.TEXTURE_2D,o,e,s,t,l,r,i,f):c.texImage2D(c.TEXTURE_2D,o,e,s,t,l)}compressedTexImage2D(o,e,s,t,l,r){const{gl:i}=this;i.compressedTexImage2D(i.TEXTURE_2D,o,e,s,t,l,r)}pixelStorei(o,e){const{gl:s}=this;s.pixelStorei(o,e)}generateMipmap(){const{gl:o}=this;o.generateMipmap(o.TEXTURE_2D)}createTexture(){const{gl:o}=this;return o.createTexture()}deleteTexture(o){const{gl:e}=this;o&&this.texture2dParams.delete(o),e.deleteTexture(o)}viewport(o,e,s,t){const{gl:l}=this;l.viewport(o,e,s,t)}clearColor(o,e,s,t){const{gl:l}=this;l.clearColor(o,e,s,t)}setScissorTest(o){const{gl:e,scissorEnabled:s}=this;o!==s&&(o?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST),this.scissorEnabled=o)}scissor(o,e,s,t){const{gl:l,scissorX:r,scissorY:i,scissorWidth:f,scissorHeight:c}=this;(o!==r||e!==i||s!==f||t!==c)&&(l.scissor(o,e,s,t),this.scissorX=o,this.scissorY=e,this.scissorWidth=s,this.scissorHeight=t)}setBlend(o){const{gl:e,blendEnabled:s}=this;o!==s&&(o?e.enable(e.BLEND):e.disable(e.BLEND),this.blendEnabled=o)}blendFunc(o,e){const{gl:s,blendSrcRgb:t,blendDstRgb:l,blendSrcAlpha:r,blendDstAlpha:i}=this;(o!==t||e!==l||o!==r||e!==i)&&(s.blendFunc(o,e),this.blendSrcRgb=o,this.blendDstRgb=e,this.blendSrcAlpha=o,this.blendDstAlpha=e)}createBuffer(){const{gl:o}=this;return o.createBuffer()}clear(){const{gl:o}=this;o.clear(o.COLOR_BUFFER_BIT)}arrayBufferData(o,e,s){const{gl:t,boundArrayBuffer:l}=this;l!==o&&(t.bindBuffer(t.ARRAY_BUFFER,o),this.boundArrayBuffer=o),t.bufferData(t.ARRAY_BUFFER,e,s)}elementArrayBufferData(o,e,s){const{gl:t,boundElementArrayBuffer:l}=this;l!==o&&(t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),this.boundElementArrayBuffer=o),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e,s)}vertexAttribPointer(o,e,s,t,l,r,i){const{gl:f,boundArrayBuffer:c}=this;c!==o&&(f.bindBuffer(f.ARRAY_BUFFER,o),this.boundArrayBuffer=o),f.vertexAttribPointer(e,s,t,l,r,i)}useProgram(o){const{gl:e,curProgram:s}=this;s!==o&&(e.useProgram(o),this.curProgram=o)}setUniform(o,e,...s){const{gl:t,programUniforms:l}=this;let r=l.get(this.curProgram);r||(r=new Map,l.set(this.curProgram,r));const i=r.get(e);(!i||!Ln(i,s))&&(r.set(e,s),t[o](e,...s))}getParameter(o){const{gl:e}=this;return e.getParameter(o)}drawElements(o,e,s,t){const{gl:l}=this;l.drawElements(o,e,s,t)}getExtension(o){const{gl:e}=this;return e.getExtension(o)}createVertexArray(){const{gl:o}=this;return o.createVertexArray()}bindVertexArray(o){const{gl:e}=this;e.bindVertexArray(o)}getAttribLocation(o,e){const{gl:s}=this;return s.getAttribLocation(o,e)}getUniformLocation(o,e){const{gl:s}=this;return s.getUniformLocation(o,e)}enableVertexAttribArray(o){const{gl:e}=this;e.enableVertexAttribArray(o)}disableVertexAttribArray(o){const{gl:e}=this;e.disableVertexAttribArray(o)}createShader(o){const{gl:e}=this;return e.createShader(o)}compileShader(o){const{gl:e}=this;e.compileShader(o)}attachShader(o,e){const{gl:s}=this;s.attachShader(o,e)}linkProgram(o){const{gl:e}=this;e.linkProgram(o)}deleteProgram(o){const{gl:e}=this;e.deleteProgram(o)}getShaderParameter(o,e){const{gl:s}=this;return s.getShaderParameter(o,e)}getShaderInfoLog(o){const{gl:e}=this;return e.getShaderInfoLog(o)}createProgram(){const{gl:o}=this;return o.createProgram()}getProgramParameter(o,e){const{gl:s}=this;return s.getProgramParameter(o,e)}getProgramInfoLog(o){const{gl:e}=this;return e.getProgramInfoLog(o)}shaderSource(o,e){const{gl:s}=this;s.shaderSource(o,e)}deleteShader(o){const{gl:e}=this;e.deleteShader(o)}}function Ln(n,o){return n.length!==o.length?!1:n.every((e,s)=>Array.isArray(e)||e instanceof Float32Array?!1:e===o[s])}const Bn=24;class Pn extends bn{constructor(e){super(e.stage);u(this,"glw");u(this,"system");u(this,"txManager");u(this,"shManager");u(this,"options");u(this,"quadBuffer",new ArrayBuffer(1024*1024*4));u(this,"fQuadBuffer",new Float32Array(this.quadBuffer));u(this,"uiQuadBuffer",new Uint32Array(this.quadBuffer));u(this,"renderOps",[]);u(this,"curBufferIdx",0);u(this,"curRenderOp",null);u(this,"renderables",[]);u(this,"defaultShader");u(this,"quadBufferCollection");u(this,"defaultTexture");const{canvas:s,clearColor:t,bufferMemory:l}=e;this.options=e,this.txManager=e.txManager,this.shManager=e.shManager,this.defaultTexture=new Ot(this.txManager),this.defaultTexture.once("loaded",()=>{this.stage.requestRender()});const r=Qs(s,e.contextSpy),i=this.glw=new Mn(r),f=Ce(t);i.viewport(0,0,s.width,s.height),i.clearColor(f[0],f[1],f[2],f[3]),i.setBlend(!0),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),Cn(i,l),this.system={parameters:wn(this.glw),extensions:Tn(this.glw)},this.shManager.renderer=this,this.defaultShader=this.shManager.loadShader("DefaultShader").shader;const c=i.createBuffer(),a=6*Float32Array.BYTES_PER_ELEMENT;this.quadBufferCollection=new xs([{buffer:c,attributes:{a_position:{name:"a_position",size:2,type:i.FLOAT,normalized:!1,stride:a,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:i.FLOAT,normalized:!1,stride:a,offset:2*Float32Array.BYTES_PER_ELEMENT},a_color:{name:"a_color",size:4,type:i.UNSIGNED_BYTE,normalized:!0,stride:a,offset:4*Float32Array.BYTES_PER_ELEMENT},a_textureIndex:{name:"a_textureIndex",size:1,type:i.FLOAT,normalized:!1,stride:a,offset:5*Float32Array.BYTES_PER_ELEMENT}}}])}reset(){const{glw:e}=this;this.curBufferIdx=0,this.curRenderOp=null,this.renderOps.length=0,e.setScissorTest(!1),e.clear()}getShaderManager(){return this.shManager}createCtxTexture(e){return e instanceof pt?new _n(this.glw,e):new ms(this.glw,e)}addQuad(e){const{fQuadBuffer:s,uiQuadBuffer:t}=this,{width:l,height:r,colorTl:i,colorTr:f,colorBl:c,colorBr:a,textureOptions:d,shader:m,shaderProps:p,alpha:h,clippingRect:y,tx:g,ty:x,ta:_,tb:S,tc:I,td:v}=e;let{texture:P}=e;if(p&&no(p,"$dimensions")){const M=p.$dimensions;M.width=l,M.height=r}P=P??this.defaultTexture;let{curBufferIdx:b,curRenderOp:k}=this;const L={width:l,height:r},F=m||this.defaultShader;k&&(k.shader!==F||!un(k.clippingRect,y)||k.shader!==this.defaultShader&&(!p||!k.shader.canBatchShaderProps(k.shaderProps,p)))&&(k=null),k||(this.newRenderOp(F,p,h,L,y,b),k=this.curRenderOp);const R=(d==null?void 0:d.flipX)??!1,N=(d==null?void 0:d.flipY)??!1;let O=0,$=0,B=1,T=1;if(P instanceof pt){const{x:M,y:E,width:Y,height:D}=P.props,{width:q=0,height:U=0}=P.parentTexture.dimensions||{width:0,height:0};O=M/q,B=O+Y/q,$=E/U,T=$+D/U,P=P.parentTexture}R&&([O,B]=[B,O]),N&&([$,T]=[T,$]);const{txManager:w}=this.stage,A=w.getCtxTexture(P),z=this.addTexture(A,b);if(k=this.curRenderOp,S!==0||I!==0)s[b++]=g,s[b++]=x,s[b++]=O,s[b++]=$,t[b++]=i,s[b++]=z,s[b++]=g+l*_,s[b++]=x+l*I,s[b++]=B,s[b++]=$,t[b++]=f,s[b++]=z,s[b++]=g+r*S,s[b++]=x+r*v,s[b++]=O,s[b++]=T,t[b++]=c,s[b++]=z,s[b++]=g+l*_+r*S,s[b++]=x+l*I+r*v,s[b++]=B,s[b++]=T,t[b++]=a,s[b++]=z;else{const M=g+l*_,E=x+r*v;s[b++]=g,s[b++]=x,s[b++]=O,s[b++]=$,t[b++]=i,s[b++]=z,s[b++]=M,s[b++]=x,s[b++]=B,s[b++]=$,t[b++]=f,s[b++]=z,s[b++]=g,s[b++]=E,s[b++]=O,s[b++]=T,t[b++]=c,s[b++]=z,s[b++]=M,s[b++]=E,s[b++]=B,s[b++]=T,t[b++]=a,s[b++]=z}k.length+=Bn,k.numQuads++,this.curBufferIdx=b}newRenderOp(e,s,t,l,r,i){const f=new ps(this.glw,this.options,this.quadBufferCollection,e,s,t,r,l,i,0);this.curRenderOp=f,this.renderOps.push(f)}addTexture(e,s,t){const{curRenderOp:l}=this,r=l.addTexture(e);if(r===4294967295){if(t)throw new Error("Unable to add texture to render op");const{shader:i,shaderProps:f,dimensions:c,clippingRect:a,alpha:d}=l;return this.newRenderOp(i,f,d,c,a,s),this.addTexture(e,s,!0)}return r}addRenderOp(e){this.renderOps.push(e),this.curRenderOp=null}render(e="screen"){const{glw:s,quadBuffer:t}=this,l=new Float32Array(t,0,this.curBufferIdx),r=this.quadBufferCollection.getBuffer("a_position")??null;s.arrayBufferData(r,l,s.STATIC_DRAW),this.renderOps.forEach((i,f)=>{i.draw()}),this.renderables=[]}}function Nn(n){return/\.(ktx|pvr)$/.test(n)}const Fn=async n=>{const e=await(await fetch(n)).arrayBuffer();return n.indexOf(".ktx")!==-1?zn(e):On(e)},zn=async n=>{const o=new DataView(n),e=o.getUint32(12)===16909060,s=[],t={glInternalFormat:o.getUint32(28,e),pixelWidth:o.getUint32(36,e),pixelHeight:o.getUint32(40,e),numberOfMipmapLevels:o.getUint32(56,e),bytesOfKeyValueData:o.getUint32(60,e)};let l=64;l+=t.bytesOfKeyValueData;for(let r=0;r{const i=n,f=new Int32Array(i,0,13),c=f[12]+52,a=new Uint8Array(i,c),d=[],m={pixelWidth:f[7],pixelHeight:f[6],numberOfMipmapLevels:f[11]||0};let p=0,h=m.pixelWidth||0,y=m.pixelHeight||0;for(let g=0;g>2)*(y+3>>2)*8,_=new Uint8Array(i,a.byteOffset+p,x);d.push(_),p+=x,h=h>>1,y=y>>1}return{data:{glInternalFormat:36196,mipmaps:d,width:m.pixelWidth||0,height:m.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},ut=class ut extends Gt{constructor(e,s){super(e);u(this,"props");this.props=ut.resolveDefaults(s)}hasAlphaChannel(e){return e.indexOf("image/png")!==-1}async getTextureData(){const{src:e,premultiplyAlpha:s}=this.props;if(!e)return{data:null};if(e instanceof ImageData)return{data:e,premultiplyAlpha:s};if(Nn(e))return Fn(e);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(e,s);if(this.txManager.hasCreateImageBitmap){const l=await(await fetch(e)).blob(),r=s??this.hasAlphaChannel(l.type);return{data:await createImageBitmap(l,{premultiplyAlpha:r?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:r}}else{const t=new Image;return t.src=e,await new Promise((l,r)=>{t.onload=()=>l(),t.onerror=()=>r(new Error("Failed to load image"))}).catch(l=>{console.error(l)}),{data:t,premultiplyAlpha:s??!0}}}static makeCacheKey(e){const s=ut.resolveDefaults(e);return s.src instanceof ImageData?!1:`ImageTexture,${s.src},${s.premultiplyAlpha}`}static resolveDefaults(e){return{src:e.src??"",premultiplyAlpha:e.premultiplyAlpha??!0}}};u(ut,"z$__type__Props");let fo=ut;const $n={LINE_FEED:10,CARRIAGE_RETURN:13,SPACE:32,TAB:9,ZERO_WIDTH_SPACE:8203,ZERO_WIDTH_NON_JOINER:8204,ZERO_WIDTH_JOINER:8205,LEFT_TO_RIGHT_MARK:8206,RIGHT_TO_LEFT_MARK:8207,LEFT_TO_RIGHT_EMBEDDING:8234,RIGHT_TO_LEFT_EMBEDDING:8235,POP_DIRECTIONAL_FORMATTING:8236,LEFT_TO_RIGHT_OVERRIDE:8237,RIGHT_TO_LEFT_OVERRIDE:8238,LINE_SEPARATOR:8232,PARAGRAPH_SEPARATOR:8233,OBJECT_REPLACEMENT_CHARACTER:65532,REPLACEMENT_CHARACTER:65533,ZERO_WIDTH_NO_BREAK_SPACE:65279,LEFT_TO_RIGHT_ISOLATE:8294,RIGHT_TO_LEFT_ISOLATE:8295,FIRST_STRONG_ISOLATE:8296,POP_DIRECTIONAL_ISOLATE:8297,INHIBIT_SYMMETRIC_SWAPPING:8298,ACTIVATE_SYMMETRIC_SWAPPING:8299,INHIBIT_ARABIC_FORM_SHAPING:8300,ACTIVATE_ARABIC_FORM_SHAPING:8301,NATIONAL_DIGIT_SHAPES:8302,NOMINAL_DIGIT_SHAPES:8303,LEFT_TO_RIGHT_BOUNDARY:8206,RIGHT_TO_LEFT_BOUNDARY:8207};class Dn{}class Un extends Dn{constructor(e,s){super();u(this,"data");u(this,"glyphMap");u(this,"kernings");this.data=e,this.glyphMap=s;const t=this.kernings={};e.kernings.forEach(l=>{const r=l.second,i=t[r]=t[r]||{};i[l.first]=l.amount}),this.kernings=t}*shapeText(e,s){var r;let t,l;for(;(t=s.peek())&&!t.done;){const i=t.value,f=this.glyphMap.get(i);if(s.next(),f!==void 0){const c=l!==void 0?(((r=this.kernings[f.id])==null?void 0:r[l])||0)+e.letterSpacing:0;l=f.id,yield{mapped:!0,glyphId:f.id,codepoint:i,cluster:s.lastIndex,xAdvance:f.xadvance+c,yAdvance:0,xOffset:f.xoffset+c,yOffset:f.yoffset,xBearing:0,yBearing:0,width:f.width,height:f.height}}else i===$n.LINE_FEED&&(l=void 0),yield{mapped:!1,codepoint:i,cluster:s.lastIndex}}}}class bs extends us{constructor(e,s,t,l,r,i){super(e,s);u(this,"type");u(this,"texture");u(this,"maxCharHeight",0);u(this,"data");u(this,"shaper");u(this,"glyphMap",new Map);this.type=t,l.renderer,this.texture=l.txManager.loadTexture("ImageTexture",{src:r,premultiplyAlpha:!1},{preload:!0}),this.texture.on("loaded",()=>{this.checkLoaded()}),fetch(i).then(async f=>{this.data=await f.json();let c=0;this.data.chars.forEach(a=>{this.glyphMap.set(a.id,a);const d=a.yoffset+a.height;d>c&&(c=d)}),this.maxCharHeight=c,this.shaper=new Un(this.data,this.glyphMap),this.checkLoaded()}).catch(console.error)}getAtlasEntry(e){const s=this.glyphMap.get(e);if(s===void 0)throw new Error(`Glyph ${e} not found in font ${this.fontFamily}`);return{x:s.x,y:s.y,width:s.width,height:s.height}}checkLoaded(){this.loaded||this.texture.state==="loaded"&&this.data&&(this.loaded=!0,this.emit("loaded"))}}const Xn=24;function Wn(n,o,e,s,t,l,r,i,f){const c=Math.min(Math.max(r.firstLineIdx,0),i.length),a=0;let d=0;s==="middle"?d=(o-n)/2:s==="bottom"&&(d=o-n);const p=t/l+c*o+d;if(!(f&&p>=f/l))return{sdfX:a,sdfY:p,lineIndex:c}}class ft{constructor(o,e=0){u(this,"iterator");u(this,"peekBuffer",[]);u(this,"_lastIndex");this.iterator=o,this.iterator=o,this._lastIndex=e-1,this.peekBuffer=[]}next(){const o=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return o.done?this._lastIndex=-1:this._lastIndex++,o}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const o=this.iterator.next();return this.peekBuffer.push(o),o}get lastIndex(){return this._lastIndex}}function*at(n,o=0){let e=o;for(;e=p.y1,oe=$<=p.y2,ee=Q&&oe;for(;(M=z.next())&&!M.done;){const K=M.value;if(n===m.length)m.push({codepointIndex:K.cluster,maxY:N,maxX:R});else if(n>m.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?T.codepointIndex!==-1&&(T.codepointIndex=-1,V=O):T.codepointIndex===-1&&(T.codepointIndex=K.cluster,T.bufferOffset=B,T.xStart=V),K.mapped){const de=O+K.xOffset+K.width;if(d!=="none"&&de>=Z&&T.codepointIndex!==-1&&T.codepointIndex0)if(j){z=w.shapeText(A,new ft(at(s,T.codepointIndex),T.codepointIndex)),B=T.bufferOffset;break}else z=w.shapeText(A,new ft(at(x,0),0)),O=T.xStart,B=T.bufferOffset;else{const le=O+K.xOffset,fe=$+K.yOffset;if(ee){E===-1&&(E=B);const ue=h.getAtlasEntry(K.glyphId),W=ue.x/h.data.common.scaleW,ke=ue.y/h.data.common.scaleH,ve=ue.width/h.data.common.scaleW,Te=ue.height/h.data.common.scaleH;a[B++]=le,a[B++]=fe,a[B++]=W,a[B++]=ke,a[B++]=le+K.width,a[B++]=fe,a[B++]=W+ve,a[B++]=ke,a[B++]=le,a[B++]=fe+K.height,a[B++]=W,a[B++]=ke+Te,a[B++]=le+K.width,a[B++]=fe+K.height,a[B++]=W+ve,a[B++]=ke+Te}N=Math.max(N,fe+K.height),O+=K.xAdvance,R=Math.max(R,O)}}else if(K.codepoint===10){if(j)break;z=w.shapeText(A,new ft(at(x,0),0)),d="none"}}E!==-1&&(Y.push({bufferStart:E,bufferEnd:B}),E=-1),O=0,$+=I,n++,T.codepointIndex=-1,V=0,!y&&d==="both"&&$>p.y2||M&&M.done?U=!1:j||(U=!1)}if(t==="center"){const j=d==="none"?R:v;for(let Z=0;Ztypeof n=="number"?n:jn[n]||400;function Kn(n,o,e,s,t){let l=Do(e);for(const r of n){const i=r[o];if(!i)continue;if(i.size===1)return console.warn(`TrFontManager: Only one font face found for family: '${o}' - will be used for all weights and styles`),i.values().next().value;const f=new Map;for(const a of i){const d=Do(a.descriptors.weight);if(d===l&&a.descriptors.style===s&&a.descriptors.stretch===t)return a;f.set(d,a)}const c=`TrFontManager: No exact match: '${o} Weight: ${l} Style: ${s} Stretch: ${t}'`;if(console.error(c),l===400&&f.has(500))return f.get(500);if(l===500&&f.has(400))return f.get(400);if(l<400){for(;l>0;){if(f.has(l))return f.get(l);l-=100}l=600}for(;l<1e3;){if(f.has(l))return f.get(l);l+=100}for(l=500;l>0;){if(f.has(l))return f.get(l);l-=100}}}const Zn=So(Kn);class Ss{constructor(o){u(this,"textRenderers");this.textRenderers=o}addFontFace(o){for(const e in this.textRenderers){const s=this.textRenderers[e];s&&s.isFontFaceSupported(o)&&s.addFontFace(o)}}static resolveFontFace(o,e){const{fontFamily:s,fontWeight:t,fontStyle:l,fontStretch:r}=e;return Zn(o,s,t,l,r)}}const Qn={x:0,y:0,width:0,height:0};class Jn extends cs{constructor(e){super(e);u(this,"ssdfFontFamilies",{});u(this,"msdfFontFamilies",{});u(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);u(this,"sdfShader");u(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,s)=>{e.props.fontFamily=s,e.trFontFace=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,s)=>{e.props.fontWeight=s,e.trFontFace=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,s)=>{e.props.fontStyle=s,e.trFontFace=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,s)=>{e.props.fontStretch=s,e.trFontFace=void 0,this.invalidateLayoutCache(e)},fontSize:(e,s)=>{e.props.fontSize=s,this.invalidateLayoutCache(e)},text:(e,s)=>{e.props.text=s,this.invalidateLayoutCache(e)},textAlign:(e,s)=>{e.props.textAlign=s,this.invalidateLayoutCache(e)},color:(e,s)=>{e.props.color=s},x:(e,s)=>{e.props.x=s,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&Kt(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,s)=>{e.props.y=s,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&Kt(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,s)=>{e.props.contain=s,this.invalidateLayoutCache(e)},width:(e,s)=>{e.props.width=s,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,s)=>{e.props.height=s,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,s)=>{e.props.offsetY=s,this.invalidateLayoutCache(e)},scrollable:(e,s)=>{e.props.scrollable=s,this.invalidateLayoutCache(e)},scrollY:(e,s)=>{e.props.scrollY=s,this.scheduleUpdateState(e)},letterSpacing:(e,s)=>{e.props.letterSpacing=s,this.invalidateLayoutCache(e)},lineHeight:(e,s)=>{e.props.lineHeight=s,this.invalidateLayoutCache(e)},maxLines:(e,s)=>{e.props.maxLines=s,this.invalidateLayoutCache(e)},textBaseline:(e,s)=>{e.props.textBaseline=s,this.invalidateLayoutCache(e)},verticalAlign:(e,s)=>{e.props.verticalAlign=s,this.invalidateLayoutCache(e)},overflowSuffix:(e,s)=>{e.props.overflowSuffix=s,this.invalidateLayoutCache(e)},debug:(e,s)=>{e.props.debug=s}}}canRenderFont(e){const{fontFamily:s}=e;return s in this.ssdfFontFamilies||s in this.msdfFontFamilies||s==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(e){return e instanceof bs}addFontFace(e){const s=e.fontFamily,t=e.type==="ssdf"?this.ssdfFontFamilies:e.type==="msdf"?this.msdfFontFamilies:void 0;if(!t){console.warn(`Invalid font face type: ${e.type}`);return}let l=t[s];l||(l=new Set,t[s]=l),l.add(e)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new _e,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){let{trFontFace:s}=e;const{textH:t,lineCache:l,debugData:r,forceFullLayoutCalc:i}=e;if(r.updateCount++,e.status==="initialState"&&this.setStatus(e,"loading"),!s&&(s=this.resolveFontFace(e.props),e.trFontFace=s,!s)){const w=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;console.error(w),this.setStatus(e,"failed",new Error(w));return}if(!s.loaded){s.once("loaded",()=>{this.scheduleUpdateState(e)});return}s.data;const{text:f,fontSize:c,x:a,y:d,contain:m,width:p,height:h,lineHeight:y,verticalAlign:g,scrollable:x,overflowSuffix:_,maxLines:S}=e.props,I=m==="both"&&x?e.props.scrollY:0,{renderWindow:v}=e,P=s.data.info.size,b=c/P,k=y/b;e.distanceRange=b*s.data.distanceField.distanceRange;const L=f.length*Xn;let F=e.vertexBuffer;(!F||F.length=R.x2&&d-I+w.y1<=R.y1&&d-I+w.y2>=R.y2){this.setStatus(e,"loaded");return}v.valid=!1,this.setStatus(e,"loading")}const{offsetY:N,textAlign:O}=e.props;if(!v.valid){if(!Kt(R,this.rendererBounds))return;qn(v,a,d,I,y,m==="both"?R.y2-R.y1:0,R,b)}const $=Wn(P,k,y,g,N,b,v,l,t);if(!$){this.setStatus(e,"loaded");return}const{letterSpacing:B}=e.props,T=Gn($.lineIndex,$.sdfX,$.sdfY,f,O,p,h,c,y,B,F,m,l,v.sdf,s,i,x,_,S);e.bufferUploaded=!1,e.bufferNumFloats=T.bufferNumFloats,e.bufferNumQuads=T.bufferNumQuads,e.vertexBuffer=F,e.renderWindow=v,r.lastLayoutNumCharacters=T.layoutNumCharacters,r.bufferSize=F.byteLength,T.fullyProcessed&&(e.textW=T.maxX*b,e.textH=T.maxY*b),this.setStatus(e,"loaded")}renderQuads(e,s,t,l){var L,F;if(!e.vertexBuffer)return;const{renderer:r}=this.stage,{fontSize:i,color:f,contain:c,scrollable:a,zIndex:d,debug:m}=e.props,p=c==="both"&&a?e.props.scrollY:0,{textW:h=0,textH:y=0,distanceRange:g,vertexBuffer:x,bufferUploaded:_,trFontFace:S,elementBounds:I}=e;let{webGlBuffers:v}=e;if(!v){const R=r.glw,N=4*Float32Array.BYTES_PER_ELEMENT,O=R.createBuffer();e.webGlBuffers=new xs([{buffer:O,attributes:{a_position:{name:"a_position",size:2,type:R.FLOAT,normalized:!1,stride:N,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:R.FLOAT,normalized:!1,stride:N,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,e.webGlBuffers,v=e.webGlBuffers}if(!_){const R=r.glw,N=(v==null?void 0:v.getBuffer("a_textureCoordinate"))??null;R.arrayBufferData(N,x,R.STATIC_DRAW),e.bufferUploaded=!0}if(a&&c==="both"){I.valid;const R=dn(I,Qn);t.valid?(e.clippingRect.valid=!0,t=bo(t,R,e.clippingRect)):(e.clippingRect.valid=!0,t=ds(R,e.clippingRect))}const P=new ps(r.glw,r.options,v,this.sdfShader,{transform:s.data,color:Js(f,l),size:i/(((L=S.data)==null?void 0:L.info.size)||0),scrollY:p,distanceRange:g,debug:m.sdfShaderDebug},l,t,{height:y,width:h},0,d),b=(F=e.trFontFace)==null?void 0:F.texture,k=this.stage.txManager.getCtxTexture(b);P.addTexture(k),P.length=e.bufferNumFloats,P.numQuads=e.bufferNumQuads,r.addRenderOp(P)}resolveFontFace(e){return Ss.resolveFontFace(this.fontFamilyArray,e)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){const{x:s,contain:t,width:l}=e.props,{elementBounds:r}=e;r.x1=s,r.x2=t!=="none"?s+l:1/0}setElementBoundsY(e){const{y:s,contain:t,height:l}=e.props,{elementBounds:r}=e;r.y1=s,r.y2=t==="both"?s+l:1/0}}class ei{}function ti(n){return n.prototype instanceof ei}async function oi(n,o){let e;try{console.log("Loading core extension",n),e=await as(()=>import(n),[])}catch(t){console.error(`The core extension module at '${n}' could not be loaded.`),console.error(t);return}if(!e.default){console.error(`The core extension module at '${n}' does not have a default export.`);return}const s=e.default;if(ti(s)){const t=new s;try{await t.run(o)}catch(l){console.error(`The core extension at '${n}' threw an error.`),console.error(l)}}else console.error(`The core extension at '${n}' does not extend CoreExtension.`)}function ws(n){const o={boolean:!0,string:!0,number:!0},e=Object.keys(n);for(let s=0;s2048&&(console.warn(`Custom Data value for ${t} is too long, it will be truncated to 2048 characters`),n[t]=l.substring(0,2048)),o[r]||(console.warn(`Custom Data value for ${t} is not a boolean, string, or number, it will be ignored`),delete n[t])}return n}class si extends _e{constructor(e,s,t){super();u(this,"root",null);u(this,"driver");u(this,"canvas");u(this,"settings");u(this,"inspector",null);u(this,"nodes",new Map);u(this,"nextTextureId",1);u(this,"textureTracker");const l={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:e.clearColor??0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:e.experimental_FinalizationRegistryTextureUsageTracker??!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:e.enableContextSpy??!1,enableInspector:e.enableInspector??!1};this.settings=l;const{appWidth:r,appHeight:i,deviceLogicalPixelRatio:f,devicePhysicalPixelRatio:c,enableInspector:a}=l,d=x=>{this.driver.releaseTexture(x)},m=l.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=m?new tn(d):new en(d,this.settings.textureCleanupOptions);const p=r*f,h=i*f;this.driver=t;const y=document.createElement("canvas");this.canvas=y,y.width=p*c,y.height=h*c,y.style.width=`${p}px`,y.style.height=`${h}px`;let g;if(typeof s=="string"?g=document.getElementById(s):g=s,!g)throw new Error("Could not find target element");t.onCreateNode=x=>{this.nodes.set(x.id,x)},t.onBeforeDestroyNode=x=>{this.nodes.delete(x.id)},t.onFpsUpdate=x=>{this.emit("fpsUpdate",x)},t.onFrameTick=x=>{this.emit("frameTick",x)},g.appendChild(y)}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){const s=e.fontSize??16,t={...this.resolveNodeDefaults(e),text:e.text??"",textRendererOverride:e.textRendererOverride??null,fontSize:s,fontFamily:e.fontFamily??"sans-serif",fontStyle:e.fontStyle??"normal",fontWeight:e.fontWeight??"normal",fontStretch:e.fontStretch??"normal",textAlign:e.textAlign??"left",contain:e.contain??"none",scrollable:e.scrollable??!1,scrollY:e.scrollY??0,offsetY:e.offsetY??0,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??s,maxLines:e.maxLines??0,textBaseline:e.textBaseline??"alphabetic",verticalAlign:e.verticalAlign??"top",overflowSuffix:e.overflowSuffix??"...",debug:e.debug??{}};return this.inspector?this.inspector.createTextNode(this.driver,t):this.driver.createTextNode(t)}resolveNodeDefaults(e){const s=e.color??4294967295,t=e.colorTl??e.colorTop??e.colorLeft??s,l=e.colorTr??e.colorTop??e.colorRight??s,r=e.colorBl??e.colorBottom??e.colorLeft??s,i=e.colorBr??e.colorBottom??e.colorRight??s,f=ws(e.data??{});return{x:e.x??0,y:e.y??0,width:e.width??0,height:e.height??0,alpha:e.alpha??1,clipping:e.clipping??!1,color:s,colorTop:e.colorTop??s,colorBottom:e.colorBottom??s,colorLeft:e.colorLeft??s,colorRight:e.colorRight??s,colorBl:r,colorBr:i,colorTl:t,colorTr:l,zIndex:e.zIndex??0,zIndexLocked:e.zIndexLocked??0,parent:e.parent??null,texture:e.texture??null,shader:e.shader??null,src:e.src??"",scale:e.scale??null,scaleX:e.scaleX??e.scale??1,scaleY:e.scaleY??e.scale??1,mount:e.mount??0,mountX:e.mountX??e.mount??0,mountY:e.mountY??e.mount??0,pivot:e.pivot??.5,pivotX:e.pivotX??e.pivot??.5,pivotY:e.pivotY??e.pivot??.5,rotation:e.rotation??0,data:f}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,s,t){const l=this.nextTextureId++,r={descType:"texture",txType:e,props:s,options:{...t,id:l}};return this.textureTracker.registerTexture(r),r}createShader(e,s){return{descType:"shader",shType:e,props:s}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class ni extends _e{constructor(e,s,t){super();u(this,"node");u(this,"props");u(this,"settings");u(this,"propStartValues",{});u(this,"restoreValues",{});u(this,"progress",0);u(this,"delayFor",0);u(this,"timingFunction");u(this,"propsList");this.node=e,this.props=s,this.settings=t,this.propStartValues={},this.propsList=Object.keys(s),this.propsList.forEach(l=>{this.propStartValues[l]=e[l]}),this.timingFunction=l=>l,t.easing&&typeof t.easing=="string"&&(this.timingFunction=In(t.easing)),this.delayFor=t.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(e=>{this.node[e]=this.propStartValues[e]})}reverse(){this.progress=0,Object.keys(this.props).forEach(e=>{const s=this.props[e],t=this.propStartValues[e];this.props[e]=t,this.propStartValues[e]=s}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,s,t){return(this.timingFunction(e)||e)*(t-s)+s}update(e){const{duration:s,loop:t,easing:l,stopMethod:r}=this.settings;if(!s){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=e;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=e/s,this.progress>1&&(this.progress=t?0:1,r)){this.emit("finished",{});return}for(let i=0;i{this.startedResolve=o}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(o=>{this.stoppedResolve=o}))}started(){this.startedResolve,this.startedResolve(this),this.startedResolve=null}finished(){this.stoppedResolve;const{loop:o,stopMethod:e}=this.animation.settings;if(e==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!o&&this.manager.unregisterAnimation(this.animation)}}const ne=0,ie=3,he=6,se=1,re=4,pe=7,ge=2,xe=5,be=8;class Se{constructor(o){u(this,"data");o?(this.data=new Float32Array(9),this.data[ne]=o[0],this.data[ie]=o[3],this.data[he]=o[6],this.data[se]=o[1],this.data[re]=o[4],this.data[pe]=o[7],this.data[ge]=o[2],this.data[xe]=o[5],this.data[be]=o[8]):this.data=new Float32Array(9)}static get temp(){return ri}static multiply(o,e,s){const t=o.data[ne]*e.data[ne]+o.data[ie]*e.data[se]+o.data[he]*e.data[ge],l=o.data[ne]*e.data[ie]+o.data[ie]*e.data[re]+o.data[he]*e.data[xe],r=o.data[ne]*e.data[he]+o.data[ie]*e.data[pe]+o.data[he]*e.data[be],i=o.data[se]*e.data[ne]+o.data[re]*e.data[se]+o.data[pe]*e.data[ge],f=o.data[se]*e.data[ie]+o.data[re]*e.data[re]+o.data[pe]*e.data[xe],c=o.data[se]*e.data[he]+o.data[re]*e.data[pe]+o.data[pe]*e.data[be],a=o.data[ge]*e.data[ne]+o.data[xe]*e.data[se]+o.data[be]*e.data[ge],d=o.data[ge]*e.data[ie]+o.data[xe]*e.data[re]+o.data[be]*e.data[xe],m=o.data[ge]*e.data[he]+o.data[xe]*e.data[pe]+o.data[be]*e.data[be];return s||(s=new Se),s.data[ne]=t,s.data[ie]=l,s.data[he]=r,s.data[se]=i,s.data[re]=f,s.data[pe]=c,s.data[ge]=a,s.data[xe]=d,s.data[be]=m,s}static identity(o){return o||(o=new Se),o.data[ne]=1,o.data[ie]=0,o.data[he]=0,o.data[se]=0,o.data[re]=1,o.data[pe]=0,o.data[ge]=0,o.data[xe]=0,o.data[be]=1,o}static translate(o,e,s){return s||(s=new Se),s.data[ne]=1,s.data[ie]=0,s.data[he]=o,s.data[se]=0,s.data[re]=1,s.data[pe]=e,s.data[ge]=0,s.data[xe]=0,s.data[be]=1,s}static scale(o,e,s){return s||(s=new Se),s.data[ne]=o,s.data[ie]=0,s.data[he]=0,s.data[se]=0,s.data[re]=e,s.data[pe]=0,s.data[ge]=0,s.data[xe]=0,s.data[be]=1,s}static rotate(o,e){const s=Math.cos(o),t=Math.sin(o);return e||(e=new Se),e.data[ne]=s,e.data[ie]=-t,e.data[he]=0,e.data[se]=t,e.data[re]=s,e.data[pe]=0,e.data[ge]=0,e.data[xe]=0,e.data[be]=1,e}static copy(o,e,s){return e||(e=new Se),e.data[0]=o.data[0],e.data[1]=o.data[1],e.data[2]=o.data[2],e.data[3]=o.data[3],e.data[4]=o.data[4],e.data[5]=o.data[5],e.data[6]=o.data[6],e.data[7]=o.data[7],e.data[8]=o.data[8],e}translate(o,e){return this.data[he]=this.data[ne]*o+this.data[ie]*e+this.data[he],this.data[pe]=this.data[se]*o+this.data[re]*e+this.data[pe],this}scale(o,e){return this.data[ne]=this.data[ne]*o,this.data[ie]=this.data[ie]*e,this.data[se]=this.data[se]*o,this.data[re]=this.data[re]*e,this}rotate(o){if(o===0||!(o%Math.PI*2))return this;const e=Math.cos(o),s=Math.sin(o),t=this.data[ne]*e+this.data[ie]*s,l=this.data[ie]*e-this.data[ne]*s,r=this.data[se]*e+this.data[re]*s,i=this.data[re]*e-this.data[se]*s;return this.data[ne]=t,this.data[ie]=l,this.data[se]=r,this.data[re]=i,this}multiply(o){return Se.multiply(this,o,this)}get tx(){return this.data[he]}get ty(){return this.data[pe]}get ta(){return this.data[ne]}get tb(){return this.data[ie]}get tc(){return this.data[se]}get td(){return this.data[re]}transformPoint(o,e){return[this.data[ne]*o+this.data[ie]*e+this.data[he],this.data[se]*o+this.data[re]*e+this.data[se]]}}const ri=new Se,xt=0,bt=2,St=4,wt=6,Tt=1,Ct=3,vt=5,It=7;class $t{constructor(o){u(this,"data");this.data=new Float32Array(8),o&&(this.data[xt]=o[xt],this.data[bt]=o[bt],this.data[St]=o[St],this.data[wt]=o[wt],this.data[Tt]=o[Tt],this.data[Ct]=o[Ct],this.data[vt]=o[vt],this.data[It]=o[It])}static translate(o,e,s,t,l,r,i,f,c){return c||(c=new $t),c.data[xt]=o,c.data[bt]=s,c.data[St]=l,c.data[wt]=i,c.data[Tt]=e,c.data[Ct]=t,c.data[vt]=r,c.data[It]=f,c}get x1(){return this.data[xt]}get x2(){return this.data[bt]}get x3(){return this.data[St]}get x4(){return this.data[wt]}get y1(){return this.data[Tt]}get y2(){return this.data[Ct]}get y3(){return this.data[vt]}get y4(){return this.data[It]}}var ye;(function(n){n[n.Init=0]="Init",n[n.OutOfBounds=2]="OutOfBounds",n[n.InBounds=4]="InBounds",n[n.InViewport=8]="InViewport"})(ye||(ye={}));const yt=new Map;yt.set(ye.Init,"init");yt.set(ye.OutOfBounds,"outOfBounds");yt.set(ye.InBounds,"inBounds");yt.set(ye.InViewport,"inViewport");var G;(function(n){n[n.Children=1]="Children",n[n.ScaleRotate=2]="ScaleRotate",n[n.Local=4]="Local",n[n.Global=8]="Global",n[n.Clipping=16]="Clipping",n[n.CalculatedZIndex=32]="CalculatedZIndex",n[n.ZIndexSortedChildren=64]="ZIndexSortedChildren",n[n.PremultipliedColors=128]="PremultipliedColors",n[n.WorldAlpha=256]="WorldAlpha",n[n.None=0]="None",n[n.All=511]="All"})(G||(G={}));class wo extends _e{constructor(e,s){super();u(this,"stage");u(this,"children",[]);u(this,"props");u(this,"updateType",G.All);u(this,"globalTransform");u(this,"scaleRotateTransform");u(this,"localTransform");u(this,"renderCoords");u(this,"renderBound");u(this,"strictBound");u(this,"preloadBound");u(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});u(this,"isRenderable",!1);u(this,"renderState",ye.Init);u(this,"worldAlpha",1);u(this,"premultipliedColorTl",0);u(this,"premultipliedColorTr",0);u(this,"premultipliedColorBl",0);u(this,"premultipliedColorBr",0);u(this,"calcZIndex",0);u(this,"onTextureLoaded",(e,s)=>{this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:s})});u(this,"onTextureFailed",(e,s)=>{this.emit("failed",{type:"texture",error:s})});this.stage=e,this.props={...s,parent:null},this.parent=s.parent,this.updateScaleRotateTransform()}loadTexture(e,s,t=null){this.props.texture&&this.unloadTexture();const{txManager:l}=this.stage,r=l.loadTexture(e,s,t);this.props.texture=r,this.props.textureOptions=t,this.updateIsRenderable(),queueMicrotask(()=>{r.state==="loaded"?this.onTextureLoaded(r,r.dimensions):r.state==="failed"&&this.onTextureFailed(r,r.error),r.on("loaded",this.onTextureLoaded),r.on("failed",this.onTextureFailed)})}unloadTexture(){this.props.texture&&(this.props.texture.off("loaded",this.onTextureLoaded),this.props.texture.off("failed",this.onTextureFailed)),this.props.texture=null,this.props.textureOptions=null,this.updateIsRenderable()}loadShader(e,s){const t=this.stage.renderer.getShaderManager(),{shader:l,props:r}=t.loadShader(e,s);this.props.shader=l,this.props.shaderProps=r,this.updateIsRenderable()}setUpdateType(e){this.updateType|=e;const s=this.props.parent;s&&!(s.updateType&G.Children)&&s.setUpdateType(G.Children)}sortChildren(){this.children.sort((e,s)=>e.calcZIndex-s.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=Se.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){this.scaleRotateTransform;const e=this.props.pivotX*this.props.width,s=this.props.pivotY*this.props.height,t=this.props.mountX*this.props.width,l=this.props.mountY*this.props.height;this.localTransform=Se.translate(e-t+this.props.x,s-l+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-s),this.setUpdateType(G.Global)}update(e,s){this.updateType&G.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(G.Local)),this.updateType&G.Local&&(this.updateLocalTransform(),this.setUpdateType(G.Global));const t=this.props.parent;let l=G.None;this.updateType&G.Global&&(this.localTransform,this.globalTransform=Se.copy((t==null?void 0:t.globalTransform)||this.localTransform,this.globalTransform),t&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.updateRenderState(),this.setUpdateType(G.Clipping|G.Children),l|=G.Global),this.updateType&G.Clipping&&(this.calculateClippingRect(s),this.setUpdateType(G.Children),l|=G.Clipping),this.updateType&G.WorldAlpha&&(t?this.worldAlpha=t.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(G.Children|G.PremultipliedColors),l|=G.WorldAlpha),this.updateType&G.PremultipliedColors&&(this.premultipliedColorTl=it(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=it(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=it(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=it(this.props.colorBr,this.worldAlpha,!0)),this.updateIsRenderable(),this.setUpdateType(G.Children),l|=G.PremultipliedColors),t&&this.updateType&G.CalculatedZIndex&&(this.calculateZIndex(),t.setUpdateType(G.ZIndexSortedChildren)),this.updateType&G.Children&&this.children.length&&this.children.forEach(r=>{r.setUpdateType(l),r.updateType!==0&&r.update(e,this.clippingRect)}),this.updateType&G.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(){this.clippingRect,this.renderBound;const e=this.clippingRect.width||this.stage.root.width,s=this.clippingRect.height||this.stage.root.height;this.strictBound=Me(this.clippingRect.x,this.clippingRect.y,e,s,this.strictBound);const t=this.stage.boundsMargin;return this.preloadBound=Me(this.clippingRect.x-t[3],this.clippingRect.y-t[0],this.clippingRect.x+e+t[1],this.clippingRect.y+s+t[2],this.preloadBound),Bo(this.renderBound,this.strictBound)?ye.InViewport:Bo(this.renderBound,this.preloadBound)?ye.InBounds:ye.OutOfBounds}updateRenderState(){const e=this.checkRenderBounds();if(e!==this.renderState){const s=this.renderState;this.renderState=e,s===ye.InViewport&&this.emit("outOfViewPort",{previous:s,current:e});const t=yt.get(e);this.emit(t,{previous:s,current:e})}this.updateIsRenderable()}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(ye[e]))}updateIsRenderable(){if(!this.checkRenderProps())return this.isRenderable=!1;this.isRenderable=this.renderState>ye.OutOfBounds}calculateRenderCoords(){const{width:e,height:s,globalTransform:t}=this,{tx:l,ty:r,ta:i,tb:f,tc:c,td:a}=t;if(f===0&&c===0){const d=l,m=l+e*i,p=r,h=r+s*a;this.renderCoords=$t.translate(d,p,m,p,m,h,d,h,this.renderCoords)}else this.renderCoords=$t.translate(l,r,l+e*i,r+e*c,l+e*i+s*f,r+e*c+s*a,l+s*f,r+s*a,this.renderCoords)}updateBoundingRect(){const{renderCoords:e,globalTransform:s}=this,{tb:t,tc:l}=s,{x1:r,y1:i,x3:f,y3:c}=e;if(t===0||l===0)this.renderBound=Me(r,i,f,c,this.renderBound);else{const{x2:a,x4:d,y2:m,y4:p}=e;this.renderBound=Me(Math.min(r,a,f,d),Math.min(i,m,c,p),Math.max(r,a,f,d),Math.max(i,m,c,p),this.renderBound)}}calculateClippingRect(e){this.globalTransform;const{clippingRect:s,props:t,globalTransform:l}=this,{clipping:r}=t,i=l.tb!==0||l.tc!==0;r&&!i?(s.x=l.tx,s.y=l.ty,s.width=this.width*l.ta,s.height=this.height*l.td,s.valid=!0):s.valid=!1,e.valid&&s.valid?bo(e,s,s):e.valid&&(ds(e,s),s.valid=!0)}calculateZIndex(){var r,i;const e=this.props,s=e.zIndex||0,t=((r=e.parent)==null?void 0:r.zIndex)||0;let l=s;(i=e.parent)!=null&&i.zIndexLocked&&(l=s{s.setUpdateType(G.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(G.CalculatedZIndex|G.Children),this.children.forEach(s=>{s.setUpdateType(G.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(e){const s=this.props.parent;if(s!==e){if(this.props.parent=e,s){const t=s.children.indexOf(this);s.children.splice(t,1),s.setUpdateType(G.Children|G.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(G.All),e.setUpdateType(G.Children|G.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}let li=1;function To(){return li++}class ao extends _e{constructor(e,s,t,l){super();u(this,"rendererMain");u(this,"stage");u(this,"id");u(this,"coreNode");u(this,"_children",[]);u(this,"_src","");u(this,"_parent",null);u(this,"_texture",null);u(this,"_shader",null);u(this,"_data",{});u(this,"onTextureLoaded",(e,s)=>{this.emit("loaded",s)});u(this,"onTextureFailed",(e,s)=>{this.emit("failed",s)});u(this,"onOutOfBounds",(e,s)=>{this.emit("outOfBounds",s)});u(this,"onInBounds",(e,s)=>{this.emit("inBounds",s)});u(this,"onOutOfViewport",(e,s)=>{this.emit("outOfViewport",s)});u(this,"onInViewport",(e,s)=>{this.emit("inViewport",s)});this.rendererMain=s,this.stage=t,this.id=(l==null?void 0:l.id)??To(),this.coreNode=l||new wo(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){e!==null&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){const s=this._parent;if(this._parent=e,this.coreNode.parent=(e==null?void 0:e.coreNode)??null,s){const t=s.children.indexOf(this);s.children.splice(t,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){if(this._src!==e){if(this._src=e,!e){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:e})}}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=ws(e)}destroy(){var s;this.emit("beforeDestroy",{}),this.coreNode.destroy();const e=this.children.length;for(let t=0;t{const o=()=>{if(n.updateAnimations(),!n.hasSceneUpdates()){setTimeout(o,16.666666666666668);return}n.drawFrame(),requestAnimationFrame(o)};requestAnimationFrame(o)},ai=()=>performance?performance.now():Date.now();class ci{constructor(){u(this,"activeAnimations",new Set)}registerAnimation(o){this.activeAnimations.add(o)}unregisterAnimation(o){this.activeAnimations.delete(o)}update(o){this.activeAnimations.forEach(e=>{e.update(o)})}}class di{constructor(o){u(this,"imageWorkersEnabled",!0);u(this,"messageManager",{});u(this,"workers",[]);u(this,"workerIndex",0);this.workers=this.createWorkers(o),this.workers.forEach(e=>{e.onmessage=this.handleMessage.bind(this)})}handleMessage(o){const{src:e,data:s,error:t}=o.data,l=this.messageManager[e];if(l){const[r,i]=l;delete this.messageManager[e],t?i(new Error(t)):r(s)}}createWorkers(o=1){const e=` - function hasAlphaChannel(mimeType) { - return (mimeType.indexOf("image/png") !== -1); - } - - async function getImage(src, premultiplyAlpha) { - return new Promise(function(resolve, reject) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', src, true); - xhr.responseType = 'blob'; - - xhr.onload = function() { - if (xhr.status === 200) { - var blob = xhr.response; - var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type); - - createImageBitmap(blob, { - premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none', - colorSpaceConversion: 'none', - imageOrientation: 'none' - }).then(function(data) { - resolve({ data: data, premultiplyAlpha: premultiplyAlpha }); - }).catch(function(error) { - reject(error); - }); - } else { - reject(new Error('Failed to load image: ' + xhr.statusText)); - } - }; - - xhr.onerror = function() { - reject(new Error('Network error occurred while trying to fetch the image.')); - }; - - xhr.send(); - }); - } - - self.onmessage = async (event) => { - var src = event.data.src; - var premultiplyAlpha = event.data.premultiplyAlpha; - - getImage(src, premultiplyAlpha) - .then(function(data) { - self.postMessage({ src: src, data: data }, [data.data]); - }) - .catch(function(error) { - self.postMessage({ src: src, error: error.message }); - }); - }; - `,s=new Blob([e.replace('"use strict";',"")],{type:"application/javascript"}),t=(self.URL?URL:webkitURL).createObjectURL(s),l=[];for(let r=0;r{try{if(this.workers){const l=this.convertUrlToAbsolute(o);this.messageManager[l]=[s,t],this.getNextWorker().postMessage({src:l,premultiplyAlpha:e})}}catch(l){t(l)}})}}const ht=class ht extends Gt{constructor(e,s){super(e);u(this,"props");this.props=ht.resolveDefaults(s)}async getTextureData(){const{width:e,height:s}=this.props,t=e*s*4,l=new Uint8ClampedArray(t);for(let r=0;r{this.txManager;const h=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",h.idCacheSize),console.log("Texture Key Cache Size: ",h.keyCacheSize)},1e3),this.renderer=new Pn({stage:this,canvas:s,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:t??4278190080,bufferMemory:hi,txManager:this.txManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new gn(this),sdf:new Jn(this)},this.fontManager=new Ss(this.textRenderers);const p=new wo(this,{id:l,x:0,y:0,width:i,height:f,alpha:1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=p,fi(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=ai(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){var l,r;const{renderer:e,renderRequested:s}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),e==null||e.reset(),this.addQuads(this.root),e==null||e.render(),s&&(this.renderRequested=!1);const{fpsUpdateInterval:t}=this.options;if(t&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=t)){const i=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:i,contextSpyData:((l=this.contextSpy)==null?void 0:l.getData())??null}),(r=this.contextSpy)==null||r.reset()}}addQuads(e){this.renderer&&e.globalTransform,e.isRenderable&&e.renderQuads(this.renderer);for(let s=0;s{const{contain:e}=this,s=this.trState.props.width,t=this.trState.props.height,l=this.trState.textW||0,r=this.trState.textH||0;e==="both"?(this.props.width=s,this.props.height=t):e==="width"?(this.props.width=s,this.props.height=r):e==="none"&&(this.props.width=l,this.props.height=r),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});u(this,"onTextFailed",(e,s)=>{this.emit("failed",{type:"text",error:s})});this._textRendererOverride=s.textRendererOverride;const{resolvedTextRenderer:t,textRendererState:l}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:s.width,height:s.height,textAlign:s.textAlign,color:s.color,zIndex:s.zIndex,contain:s.contain,scrollable:s.scrollable,scrollY:s.scrollY,offsetY:s.offsetY,letterSpacing:s.letterSpacing,debug:s.debug,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStretch:s.fontStretch,fontStyle:s.fontStyle,fontWeight:s.fontWeight,text:s.text,lineHeight:s.lineHeight,maxLines:s.maxLines,textBaseline:s.textBaseline,verticalAlign:s.verticalAlign,overflowSuffix:s.overflowSuffix},void 0);this.textRenderer=t,this.trState=l}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),this.contain==="none"&&this.setUpdateType(G.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),this.contain!=="both"&&this.setUpdateType(G.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e;const{resolvedTextRenderer:s,textRendererState:t}=this.resolveTextRendererAndState(this.trState.props,this.trState);this.textRenderer=s,this.trState=t}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,s){super.update(e,s),this.globalTransform,this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}renderQuads(e){this.globalTransform,this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}resolveTextRendererAndState(e,s){const t=this.stage.resolveTextRenderer(e,this._textRendererOverride),l=t.createState(e);return s&&["loading","loaded","failed"].forEach(i=>{s.emitter.off(i)}),l.emitter.on("loaded",this.onTextLoaded),l.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(l),{resolvedTextRenderer:t,textRendererState:l}}}class yi extends ao{constructor(o,e,s){super(o,e,s,new mi(s,{id:To(),x:o.x,y:o.y,width:o.width,height:o.height,alpha:o.alpha,clipping:o.clipping,color:o.color,colorTop:o.colorTop,colorBottom:o.colorBottom,colorLeft:o.colorLeft,colorRight:o.colorRight,colorTl:o.colorTl,colorTr:o.colorTr,colorBl:o.colorBl,colorBr:o.colorBr,zIndex:o.zIndex,zIndexLocked:o.zIndexLocked,scaleX:o.scaleX,scaleY:o.scaleY,mountX:o.mountX,mountY:o.mountY,mount:o.mount,pivot:o.pivot,pivotX:o.pivotX,pivotY:o.pivotY,rotation:o.rotation,text:o.text,fontSize:o.fontSize,fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontStretch:o.fontStretch,fontStyle:o.fontStyle,contain:o.contain,scrollable:o.scrollable,letterSpacing:o.letterSpacing,textAlign:o.textAlign,scrollY:o.scrollY,offsetY:o.offsetY,textRendererOverride:o.textRendererOverride,lineHeight:o.lineHeight,maxLines:o.maxLines,textBaseline:o.textBaseline,verticalAlign:o.verticalAlign,overflowSuffix:o.overflowSuffix,debug:o.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(o){this.coreNode.text=o}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(o){this.coreNode.textRendererOverride=o}get fontSize(){return this.coreNode.fontSize}set fontSize(o){this.coreNode.fontSize=o}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(o){this.coreNode.fontFamily=o}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(o){this.coreNode.fontWeight=o}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(o){this.coreNode.fontStretch=o}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(o){this.coreNode.fontStyle=o}get textAlign(){return this.coreNode.textAlign}set textAlign(o){this.coreNode.textAlign=o}get contain(){return this.coreNode.contain}set contain(o){this.coreNode.contain=o}get scrollable(){return this.coreNode.scrollable}set scrollable(o){this.coreNode.scrollable=o}get scrollY(){return this.coreNode.scrollY}set scrollY(o){this.coreNode.scrollY=o}get offsetY(){return this.coreNode.offsetY}set offsetY(o){this.coreNode.offsetY=o}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(o){this.coreNode.letterSpacing=o}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(o){o&&(this.coreNode.lineHeight=o)}get maxLines(){return this.coreNode.maxLines}set maxLines(o){o&&(this.coreNode.maxLines=o)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(o){o&&(this.coreNode.textBaseline=o)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(o){o&&(this.coreNode.verticalAlign=o)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(o){o&&(this.coreNode.overflowSuffix=o)}get debug(){return this.coreNode.debug}set debug(o){this.coreNode.debug=o}}class gi{constructor(){u(this,"root",null);u(this,"stage",null);u(this,"rendererMain",null)}async init(o,e,s){this.stage=new pi({rootId:To(),appWidth:e.appWidth,appHeight:e.appHeight,boundsMargin:e.boundsMargin,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio,clearColor:e.clearColor,canvas:s,fpsUpdateInterval:e.fpsUpdateInterval,enableContextSpy:e.enableContextSpy,numImageWorkers:e.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=o,this.stage.root;const t=new ao(o.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=t,t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),e.coreExtensionModule&&await oi(e.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(l,r)=>{this.onFpsUpdate(r)}),this.stage.on("frameTick",(l,r)=>{this.onFrameTick(r)})}createNode(o){this.rendererMain,this.stage;const e=new ao(o,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(o){this.rendererMain,this.stage;const e=new yi(o,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}destroyNode(o){o.destroy()}releaseTexture(o){const{stage:e}=this;e.txManager.removeTextureIdFromCache(o)}getRootNode(){return this.root,this.root}onCreateNode(o){throw new Error("Method not implemented.")}onBeforeDestroyNode(o){throw new Error("Method not implemented.")}onFpsUpdate(o){throw new Error("Method not implemented.")}onFrameTick(o){throw new Error("Method not implemented.")}}const Uo={hd:.66666667,"720p":.66666667,720:.66666667,fhd:1,fullhd:1,"1080p":1,1080:1,"4k":2,"2160p":2,2160:2},xi=()=>{const n=we.driver.stage;$e.get("fonts",[]).forEach(o=>{o.type==="sdf"||o.type==="msdf"?(!o.png&&o.file&&(o.png=o.file.replace(/\.[^.]+$/,`.${o.type}.png`)),!o.json&&o.file&&(o.json=o.file.replace(/\.[^.]+$/,`.${o.type}.json`)),n.fontManager.addFontFace(new bs(o.family,{},o.type,n,o.png,o.json))):o.type==="web"&&n.fontManager.addFontFace(new hs(o.family,{},o.file))})};let we;const bi=(n,o,e)=>{$e.set(e),Vs();const s=new gi;"fontLoader"in e&&te.warn("\n\nStarting version 0.9.0 of Blits, the Launch setting `fontLoader` is not supported / required anymore.\nYou can remove the option from your `src/index.js`-file. And you can safely remove the file `src/fontLoader.js` from your project.\n "),we=new si({appWidth:e.w||1920,appHeight:e.h||1080,fpsUpdateInterval:e.fpsInterval||1e3,deviceLogicalPixelRatio:e.pixelRatio||Uo[e.screenResolution]||Uo[window.innerHeight]||1,numImageWorkers:"webWorkersLimit"in e?e.webWorkersLimit:window.navigator.hardwareConcurrency||2,clearColor:e.canvasColor&&Ke.normalize(e.canvasColor)||0,enableInspector:e.inspector||!1,boundsMargin:e.viewportMargin||0},o,s);const t=()=>{let l=n();l.quit=()=>{te.info("Closing App"),l.destroy(),l=null,we=null}};we.init().then(xi).then(t)},Si=` ----------------------------------------------------------------------------------------------------- -Deprecation notice: ----------------------------------------------------------------------------------------------------- - -The property for defining a transition easing function has been renamed from "function" to "easing". - -Please update your code like the example below to keep your custom easing function. - -Before: - -After: - -`,wi=n=>typeof n=="object"&&"transition"in n,_t=n=>typeof n=="string"&&n.startsWith("{")&&n.endsWith("}"),kt=n=>JSON.parse(n.replace(/'/g,'"').replace(/([\w-_]+)\s*:/g,'"$1":')),De=function(n,o){return typeof n=="string"&&n.endsWith("%")?this.element.node._parent[o]*(parseFloat(n)/100):n},uo=n=>{if(typeof n=="object"&&n.constructor===Object){if("value"in n)return n.value;if("transition"in n)return uo(n.transition)}return n},Ts={set parent(n){this._props.parent=n==="root"?we.root:n.node,this._set.add("parent")},set rotation(n){this._props.rotation=n*(Math.PI/180),this._set.add("rotation")},set w(n){this._props.width=De.call(this,n,"width"),this._set.add("width")},set width(n){this._props.width=De.call(this,n,"width"),this._set.add("width")},set h(n){this._props.height=De.call(this,n,"height"),this._set.add("height")},set height(n){this._props.height=De.call(this,n,"height"),this._set.add("height")},set x(n){this._props.x=De.call(this,n,"width"),this._set.add("x")},set y(n){this._props.y=De.call(this,n,"height"),this._set.add("y")},set z(n){this._props.zIndex=n,this._set.add("zIndex")},set zIndex(n){this._props.zIndex=n,this._set.add("zIndex")},set color(n){if(typeof n=="object"||_t(n)&&(n=kt(n))){const o={top:"colorTop",bottom:"colorBottom",left:"colorLeft",right:"colorRight"};this._props.color=0,Object.entries(n).forEach(e=>{this._props[o[e[0]]]=Ke.normalize(e[1]),this._set.add(o[e[0]])})}else this._props.color=Ke.normalize(n);this._set.add("color")},set src(n){this._props.src=n,this._set.has("color")||(this._props.color=4294967295),this._set.add("src")},set texture(n){this._props.texture=n,this._set.has("color")||(this._props.color=4294967295),this._set.add("texture")},set mount(n){typeof n=="object"||_t(n)&&(n=kt(n))?("x"in n&&(this._props.mountX=n.x,this._set.add("mountX")),"y"in n&&(this._props.mountY=n.y,this._set.add("mountY"))):(this._props.mountX=this._props.mountY=n,this._set.add("mountX"),this._set.add("mountY"))},set pivot(n){typeof n=="object"||_t(n)&&(n=kt(n))?("x"in n&&(this._set.add("pivotX"),this._props.pivotX=n.x),"y"in n&&(this._set.add("pivotY"),this._props.pivotY=n.y)):(this._props.pivotX=this._props.pivotY=n,this._set.add("pivotX"),this._set.add("pivotY"))},set scale(n){typeof n=="object"||_t(n)&&(n=kt(n))?("x"in n&&(this._set.add("scaleX"),this._props.scaleX=n.x),"y"in n&&(this._set.add("scaleX"),this._props.scaleY=n.y)):(this._props.scale=n,this._set.add("scale"))},set show(n){this._props.alpha=n?1:0},set alpha(n){this._props.alpha=n,this._set.add("alpha")},set text(n){this._props.text=n.toString()},set effects(n){this._props.shader=we.createShader("DynamicShader",{effects:n.map(o=>(o.props&&o.props.color&&(o.props.color=Ke.normalize(o.props.color)),o))}),this._set.add("effects")},set clipping(n){this._props.clipping=n},set fontFamily(n){this._props.fontFamily=n},set fontSize(n){this._props.fontSize=n},set wordWrap(n){this._props.width=n},set contain(n){this._props.contain=n},set maxLines(n){this._props.maxLines=n},set overflowSuffix(n){this._props.overflowSuffix=n===!1?" ":n===!0?void 0:n},set letterSpacing(n){this._props.letterSpacing=n||1},set lineHeight(n){this._props.lineHeight=n},set textAlign(n){this._props.textAlign=n}},Ti={defaults:{},populate(n){const o={...this.defaults,...this.config,...n};this.initData=n,o[C.isSlot]&&(this[C.isSlot]=!0),this.props.element=this;for(const[e,s]of Object.entries(o)){const t=Object.getOwnPropertyDescriptor(Ts,e);t&&t.set&&s!==void 0&&(this.props[e]=uo(s))}!o.__textnode&&!this.props._set.has("color")&&(this.props._props.color=this.props._set.has("src")||this.props._set.has("texture")?4294967295:0),this.node=o.__textnode?we.createTextNode(this.props._props):we.createNode(this.props._props),o["@loaded"]&&this.node.on("loaded",(e,{type:s,dimensions:t})=>{o["@loaded"]({w:t.width,h:t.height,type:s},this)}),o["@error"]&&this.node.on("failed",(e,s)=>{o["@error"](s,this)})},set(n,o){if(o===void 0)return;const e=new Set(this.props._set);this.props._props={},this.props[n]=uo(o);for(const[s,t]of Object.entries(this.props._props)){if(wi(o)&&e.has(s))return this.animate(s,t,o.transition);this.node[s]=t}},animate(n,o,e){if(this.node[n]===o)return Promise.resolve();this.scheduledTransitions[n]&&this.scheduledTransitions[n].f.state==="running"&&(this.scheduledTransitions[n].f.pause(),this.node[n]=this.scheduledTransitions[n].v);const s={};s[n]=o;const t=this.node.animate(s,{duration:typeof e=="object"&&"duration"in e?e.duration:300,easing:typeof e=="object"?"function"in e?te.warn(Si):"easing"in e?e.easing:"ease":"ease",delay:typeof e=="object"&&"delay"in e?e.delay:0});return new Promise(l=>{const r=this.node[n];this.scheduledTransitions[n]={v:s[n],f:()=>{try{t.start().waitUntilStarted().then(i=>{e.start&&typeof e.start=="function"&&e.start.call(this.component,this,n,r),i.waitUntilStopped().then(()=>delete this.scheduledTransitions[n]).then(()=>{e.end&&typeof e.end=="function"&&e.end.call(this.component,this,n,this.node[n])}).then(l)})}catch(i){te.error(i)}}},this.scheduledTransitions[n].f()})},destroy(){te.debug("Deleting Node",this.nodeId),Object.values(this.scheduledTransitions).forEach(n=>{clearTimeout(n.timeout)}),this.node.destroy()},get nodeId(){return this.node&&this.node.id},get ref(){return this.initData.ref||null}},Cs=(n,o)=>Object.assign(Object.create(Ti),{props:Object.assign(Object.create(Ts),{_props:{},_set:new Set}),node:null,scheduledTransitions:{},initData:{},config:n,component:o}),Xo={};let Ci=0;const vi=n=>`BlitsComponent::${n}_${Xo[n]=(Xo[n]||0)+1}`,Ii=()=>++Ci,Pe={},vs=(n,o,e,s=[])=>{Pe[o]&&Pe[o][n]&&Pe[o][n].apply(e,s)},_i=(n,o,e)=>{const s=C[n];Pe[o]&&Pe[o][s]&&Pe[o][s].apply(e)},ki=(n={},o)=>{Pe[o]={},[...Object.keys(n),...Object.getOwnPropertySymbols(n)].forEach(s=>{typeof n[s]=="function"&&(Pe[o][s]=n[s])})};let Oe=null,Co=!1;const Ri=()=>{Co=!0},Ei=()=>{Co=!1;for(let n=0;n{if(Oe){if(Co){Pt.push({target:n,key:o,currentEffect:Oe});return}let e=ho.get(n);e||(e=new Map,ho.set(n,e));let s=e.get(o);s||(s=new Set,e.set(o,s)),s.add(Oe)}},mt=(n,o,e=!1)=>{const s=ho.get(n);if(!s)return;const t=s.get(o);t&&t.forEach(l=>{l(e)})},Wo=n=>{Oe=n,Oe(),Oe=null},Nt=["push","pop","shift","unshift","splice"],Is=new WeakMap,Ai=n=>Is.get(n),po=n=>{const o=n&&n[C.raw];return o?po(o):n},_s=(n,o=null,e)=>{const s=Ai(n);if(s)return s;const t={get(r,i,f){return i===C.raw?n:Array.isArray(r)?Nt.indexOf(i)>-1?function(...c){Ri();const a=r[i].apply(this,c);return Ei(),mt(o,e),a}:Reflect.get(r,i,f):typeof r[i]=="object"&&r[i]!==null?(Array.isArray(r[i])&&Dt(r,i),_s(r[i],r,i)):(Dt(r,i),Reflect.get(r,i,f))},set(r,i,f,c){const a=po(r[i]),d=po(f);let m=!0;return a!==d&&(m=Reflect.set(r,i,f,c)),m&&a!==f&&mt(r,i,!0),m}},l=new Proxy(n,t);return Is.set(n,l),l},ks=n=>(Object.keys(n).forEach(o=>{let e=n[o];if(n[o]!==null&&typeof n[o]=="object"){if(Object.getPrototypeOf(n[o])===Object.prototype)return ks(n[o]);if(Array.isArray(n[o]))for(let s=0;so==="defineProperty"?ks(n):_s(n),Mi={before:{prop:"alpha",value:0},in:{prop:"alpha",value:1,duration:200},out:{prop:"alpha",value:0,duration:100}},Le=window.speechSynthesis,Li=()=>(window.navigator||{}).userAgent||"",Go=()=>/android/i.test(Li());let Rs=!1,Ut=null;const vo=()=>Ut&&clearTimeout(Ut),mo=n=>{if(!n||Ut)return vo();Le.pause(),Le.resume(),Ut=setTimeout(()=>{mo(n)},5e3)},qe={lang:"en-US",pitch:1,rate:1,voice:null,volume:1},Bi=()=>{qe.voice=Le.getVoices()[0],Rs=!0},Pi=(n,o)=>{const e=new SpeechSynthesisUtterance(o.value);e.lang=o.lang||qe.lang,e.pitch=o.pitch||qe.pitch,e.rate=o.rate||qe.rate,e.voice=o.voice||qe.voice,e.volume=o.volume||qe.volume,e.onstart=()=>{Go()||mo(e),n.onstart()},e.onresume=()=>{Go()||mo(e),n.onresume()},e.onpause=()=>{n.onpause()},e.onend=()=>{n.onend()},e.onerror=()=>{vo(),n.onerror()},Le.speak(e)},Ft={speak(n){Rs||Bi(),this.cancel(),Pi(this,n)},resume(){Le.resume()},pause(){Le.pause()},cancel(){Le.cancel(),vo()},getVoices(){return Le.getVoices()},onend(){},onerror(){},onstart(){},onresume(){},onpause(){}};let Ho;const Io=(n,o="off")=>{clearTimeout(Ho),Ft.cancel(),o==="assertive"?Ft.speak({value:n}):Ho=setTimeout(()=>{Ft.speak({value:n})},400)},Ni=n=>Io(n,"polite"),Fi=n=>Io(n,"assertive"),zi=()=>{Ft.cancel()},Es={speak:Io,polite:Ni,assertive:Fi,stop:zi};let _o,Xt=!1;const As=new WeakMap,Ms=[];let Ls={},Bs={},yo=!1,Ps;const Oi=()=>(document.location.hash||"/").replace(/^#/,""),Vo=n=>n.replace(/^\/+|\/+$/g,"").toLowerCase(),$i=(n,o=[])=>{const e=n;n=Vo(n);let s=!1,t=0;for(;!s&&t-1){const r=[...l.path.matchAll(/:([^\s/]+)/gi)];let i=l.path;r.reverse().forEach(c=>{i=i.substring(0,c.index)+"([^\\s/]+)"+i.substring(c.index+c[0].length)});const f=e.match(new RegExp(`${i}`,"i"));f&&(l.params=r.reverse().reduce((c,a,d)=>(c[a[1]]=f[d+1],c),{}),s=l)}else if(l.path.endsWith("*")){const r=new RegExp(l.path.replace(/\/?\*/,"/?([^\\s]*)"),"i"),i=n.match(r);i&&(i[1]&&(l.params={path:i[1]}),s=l)}t++}return s&&(s.options={...s.options,...Ls},_o=s),s},Di=async function(){if(Xt=!0,this.parent[C.routes]){const n=_o,o=Oi(),e=$i(o,this.parent[C.routes]);if(e){yo===!1&&n&&n.options.inHistory===!0&&Ms.push(n),"transition"in e||(e.transition=Mi),typeof e.transition=="function"&&(e.transition=e.transition(n,e));let s,{view:t,focus:l}=As.get(e)||{};if(t)s=t[C.wrapper];else{s=Cs({parent:this[C.children][0]}),s.populate({}),s.set("w","100%"),s.set("h","100%");const i={...this[C.props],...e.params,...Bs};t=await e.component({props:i},s,this),t[Symbol.toStringTag]==="Module"&&(t.default&&typeof t.default=="function"?t=t.default({props:i},s,this):te.error("Dynamic import doesn't have a default export or default is not a function")),typeof t=="function"&&(t=t({props:i},s,this))}if(this[C.children].push(t),Ps=Be.get(),l?Be.set(l):Be.set(t),e.transition.before)if(Array.isArray(e.transition.before))for(let i=0;i{if(e)if(Array.isArray(e))for(let s=0;se?n.animate(o.prop,o.value,o):n.set(o.prop,o.value),ko=(n,o={},e={})=>{Bs=o,Ls=e,window.location.hash=`#${n}`},Ns=()=>{const n=Ms.pop();if(n){yo=!0;let o=n.path;return o.indexOf(":")>-1&&Object.keys(n.params).forEach(e=>{o=o.replace(`:${e}`,n.params[e])}),ko(o),!0}else return!1},Qt={navigate:Di,to:ko,back:Ns};let Ae=null,Rt=[],qo;const Be={_hold:!1,set hold(n){this._hold=n},get hold(){return this._hold},get(){return Ae},set(n,o){clearTimeout(qo),Ae&&Ae!==n.parent&&Ae.unfocus(),Rt.reverse().forEach(e=>e.unfocus()),n!==Ae&&(qo=setTimeout(()=>{Ae=n,Ae.lifecycle.state="focus",o instanceof KeyboardEvent?document.dispatchEvent(new KeyboardEvent("keydown",o)):Rt=[]},this.hold?50:0))},input(n,o){if(Xt===!0)return;Rt=Fs([Ae],n);const e=Rt.shift();e&&(e[C.inputEvents][n]?e[C.inputEvents][n].call(e,o):e[C.inputEvents].any&&e[C.inputEvents].any.call(e,o))}},Fs=(n,o)=>n[0][C.inputEvents]&&(typeof n[0][C.inputEvents][o]=="function"||typeof n[0][C.inputEvents].any=="function")?n:n[0].parent?(n.unshift(n[0].parent),Fs(n,o)):[],Xi=()=>Ne("Image",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){e[0].set("imageSource",o.imageSource)}],context:{}},props:["src"],computed:{imageSource(){return/^(?:https?:)?\/\//i.test(this.src)?this.src:`${window.location.protocol}//${window.location.host}/${this.src}`}}}),Wi=()=>Ne("Circle",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){e[0].set("color",o.color)},function(o,e,s){e[0].set("w",o.size)},function(o,e,s){e[0].set("h",o.size)},function(o,e,s){e[0].set("effects",[o.shader("radius",{radius:o.radius})])}],context:{}},props:[{key:"size",default:40},"color"],computed:{radius(){return this.size/2}}});let Jt;const Yi=()=>Ne("RouterView",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return l.w=o.node.width*(100/100),l.height=o.node.height*(100/100),t[0].nodeId||t[0].populate(l),t},effects:[],context:{}},state(){return{activeView:null}},hooks:{ready(){Jt=()=>Qt.navigate.apply(this),Qt.navigate.apply(this),window.addEventListener("hashchange",Jt)},destroy(){window.removeEventListener("hashchange",Jt,!1)},focus(){this.activeView&&this.activeView.focus()}},input:{back(){Qt.back()}}}),Gi=()=>Ne("Sprite",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return l.w=e.w,l.h=e.h,t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){e[0].set("texture",o.texture)},function(o,e,s){e[0].set("color",o.color)}],context:{}},props:["image","map","frame","w","h","color"],state(){return{spriteTexture:!1}},computed:{texture(){const n="frames"in this.map?Object.assign({},this.map.defaults||{},this.map.frames[this.frame]):this.map[this.frame];if(this.spriteTexture&&n)return this[C.renderer].createTexture("SubTexture",{texture:this.spriteTexture,x:n.x,y:n.y,width:n.w,height:n.h})}},hooks:{ready(){this.spriteTexture=this[C.renderer].createTexture("ImageTexture",{src:this.image})}}}),Hi=()=>Ne("Text",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return l.__textnode=!0,l.fontFamily=e.font,l.letterSpacing=e.letterspacing,l.lineHeight=e._lineheight,l.stretch=e.stretch,l.contain=e._contain,l["@loaded"]=e["@loaded"]&&e["@loaded"].bind(e),l["@error"]=e["@error"]&&e["@error"].bind(e),t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){e[0].set("text",o.content)},function(o,e,s){e[0].set("fontSize",o.size)},function(o,e,s){e[0].set("color",o.color)},function(o,e,s){e[0].set("style",o.style)},function(o,e,s){e[0].set("weight",o.weight)},function(o,e,s){e[0].set("wordWrap",o.wordwrap)},function(o,e,s){e[0].set("maxLines",o.maxlines)},function(o,e,s){e[0].set("h",o.maxheight)},function(o,e,s){e[0].set("textAlign",o.align)},function(o,e,s){e[0].set("overflowSuffix",o.textoverflow)}],context:{}},props:["content",{key:"font",default:$e.get("defaultFont","lato")},{key:"size",cast:Number,default:32},"style","color","weight","letterspacing","stretch","align","wordwrap","maxlines","maxheight","lineheight","contain","@loaded","@error","textoverflow"],computed:{_contain(){return this.contain||(this.maxheight&&this.wordwrap?"both":this.wordwrap?"width":"none")},_lineheight(){return this.lineheight!==void 0?this.lineheight:this.size}}}),Vi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaMAAAAbCAYAAADRe+BYAAAAAXNSR0IArs4c6QAAGn9JREFUeF7tXQ1UVdWePxcWFg7ZA0sym5n0Tmk1z4+0YeVU4yo1h1jvPVBo1ETU8QvTdJlhsmKpi0he5jyXX0CKIWkpl3OlME3RGcdJixVEas+nJtq0sMwXN/kIgbxn1m+791n/ezifF0hr7lmrVV3O2Wfv/977//v//h/7uKTQFZJASAIhCYQkEJLADZaAy+j9iqIMkCRpliRJGeSeWkmSClwuV25X9VtRlOGSJI3m7wq6bd5Osqa/6OZSSZJKXC4X+h7UpSgKZABZQCbiKuHt4t+dvri8z5GG3E77rChKtCRJ9TY647ht0aaiKJAx5LCK/4Y5m23jneotiqJgvg84eCaYd6Cf4h/xqgo+ZwUO3h1wK5cx1oIYP/5eJUlSrsvl6tRakGUZbYr9tjQpKanL9lmw4w09F5LAzyUBXTDiih3KAspN76pwuVxjgu2koijYzGibbmg0tzQYoOPt5Zv0xydJ0hiXywWlYfviAAE5UBDSPu9YUep1QFEUvAdKWlyOAYPP26c2BhhM25ivXZo+4lWOxx8EGEHRw6iwdXHjQbu26LMwTlJsNUZusrEeHMuC9kGWZRgSYs/VJiUluZ32MXR/SAK/VAkYgREsdKaAKysr58fFxd0Di23Xrl1ScjKMTUl69913906cODHe6cDNFAVvcyAUHCxNO21rGIVv7969ufHx8djQGatWrZIyMq4bmj6frz4mJuYRSZJsMyQNQJS43e4/19bWThk+fPiA/Px8afhwkDpJKikpKUhJSXHEDujY9MDU7XZLtbWsq1BItvrMWQsAQxozZoxUUQEiYHrZapuzAYCcAOWSnJycv2RmZjZThiRJklMZGDIkyHfWLNgskkRkgXVh+g4N0NUuWLCgYN26dcMHDBiQjPUr5qyoqOjttLS0KVYC0syTui/q6+tX9O7duyU6OnoV2h09+rodEexakGUZG4vNnbiWL18uHT9+HCBsay84Gcv/13s9Hs/osLAwlZW7XK6KxMRES8Pa6/Ue4GuLic7v94+ZMGGC5Qb7OeXcXWMrLS3Nd7lcs+zKKtgxdwAjupnPnDlTNHDgwN9RhlRfXy9FR0dDuUsxMTGYDMuJ1GxooAO0eNWgQYNaX3jhhcfnzp2bhHuWLl0q5eayfWd7AyqKoro2uIJ5jr7vwIEDqqKIi4trqKysfJK7VUxlRl1ebW1tX99yyy3tlCFB+aBtroCklJQUS0Wp90L+Hii5ABYaJBhBtowRjBgxQqqqsiSCdsEISpJZIZcuXVp01113PaPHkKyAQmf8umCE9XXu3Dm2zgCoAFZ+YXGYMiS6HjZt2iSnp6eztYVLZ87gVrPFkCjQX758+d0+ffr8k1gP6Oenn34qDRgwgBkQbrfb8VqQZVnIGCyerYX9+/dLeXl5MERuSoYky7JiU/GoLE+r1A2eh4cEIKG7gD0ez4CwsDCsxwD2qygKmGlFUlKSobtUq7A5sLgnTJhgaPDx91EX+i8CjLpqbHSeXS7XCKN5sbkWDG/TAyNVuSckJHyzZ8+evvxpbNoSRVHgDmMmK1d4toFD0wumOGH9wgruBBip7q2YmBgGkiBCXDGiv6qCnj17tlRQUGBrc5PYgJSZmTk1JyfnAd5/LPTZBESowoTV7igeoSiKUEK1ly5dCo+Njf17vKezYERkAU0etAVHjZPm5uaiqKioxylD4uMNun0DgFbnbNq0aXveeustgB8TixVLpOuTsEPMeYqiKFgXTKkQkLM1ZxTkNPuCrf8rV678qVevXi+QfWGrXdxfXl4e3dbWxmJ933zzzbHz588/OnLkSKmpqUlKT0/Hv9U51CjGDq482hZk1aNHjxEJCQlsU3D2JYxB/MRiXTQG6Pf7TRUzna9uBCPxmg5xM1mW1bVhovxKkpKSdI0MPTAqLi6WvF6voWGt907OWtGFTu2vzipw+nx3jU0wo6+++qpu0aJF/bg+cURC7IxTD4xUK5goRNUipco9JSUFbgks9Bg7L9MBo+EbN24M7wwzIm3S4K+qCKgSIcpphB12xNumSQEqkFElDTYHVgewtmtp42ZqbX/99dfTzp07VzBq1KiIToCRaii4XOrUOhlrh2mk8nv66acr9u/fL+JatpWtk7VBmaLf778QHh5+O2cKtli4jvGB17O+0jkrKCiQYJzYnTMKcnpuQ+pqdWL0cJBQFeybb7557Nq1a4/OmTOHiS0vLw8MKYBpERYlaS1VjbsvNykpiS1MCyWOdc1csMGCUVKSSkDNprvW6/XWCncXUejqM2PHjpXE2PFjdXX10uzsbOYu0Shb39mzZ7MyMjL+BkYt5mTKlCnS4MGDWVunTp0qy8zM/IO2M3oKGyx8yZIlbNvpGTuyLMNFfd0nz69fChh18dgoE+6UXtFbJHpgpDINsulU9DfY7EF3jG7iYNx0ZFA0AQDg6KOK7erVqy2RkZGR/H4nihRgdD14cZ1xCaUGxT/A7/dfue+++27n8R1bCpMDEdoVcRgE1OH2SxaxhyCZEZMBxrpt27ZIEXPhfQdQMjeGQ3BgG7G9vb0pPj4+Cm2KuCFvJ6ikE6M+0PWgcbPZskDpnGNOYDBVVVWNURQFCheGFlMqRL625syAcdF9gTXCKD5Zx7b2hVB2iqL8MHXq1N+gjW3btjERcWWCdQdFyRiO1+udxfsjcateBSuakQcFi+fvvffeD9asWSPiu779+/e/lZeX9wRkAcUPABDX3Llz4Yo1VMx03igz6iowQvsUkI4fPy4tX76csU8Kwh6PZ/uOHTsm0/5ERUVJGzdulPBvXDNmzCjz+XwBgETBCOOMjY1l93JZdfDyeL3e4YqisKSgpqam+qioKGZ43+xg1E1jE8aurT3jRM/gXrtgpFoMBmDEXHhOX86Vst4mDtb1F9AFatVv3br18PTp0/+F32BLsdHGqDIiv1ekpqZuKy4uvq45rrs8bGV9kb75EhMTs3bv3r2OxreCBCM1wG4yFylOUpAVRWHWUEtLy9XIyMhbDdqtgoUezPxrn1EUhY0BivmOO+6Q6uvroZxtuVZFW8gqrKurK+vXrx9cCtqrdv369fnz588XSQG24jt03RNWRfeFyswJGFkaPVTZnT9//sTixYt/iw5v2LDhWN++fR8lilJti7riuLJWvRMiI6+xsVEFtldffbXsgQce+D3a2rdvn1xQUBBAY15//XUGzri6AIwMy0XQPo0ZGSl0Oj64KlNTU/FoCgdaxuBIP1WXPH7Pz88vvfPOO9n4Vq9eLR09ejRgT1Iw8nq9UmJiIhs3/ru4uBhuy4B1TMF93759344bN+4u3K/Xd85KA8oJYPwhlkXjWBp21sHVKsuyuo9RNpGYmGjL9d9dY6P9SUpKYvNL3cUYn6IoyHjNQKID2XCOyhO6CowsN52RoupCZhTwCtruTz/9VBMREYFYDNhIUG5FPTACW5gxY0ZzcXExzCu0i4VsmflG3UU8KwtZXQOqq6svDRs2jJlqQYIR3D0Zp0+fDp88eXKvqqoq9KkkIyNjFjILcTU3N7c9+eSTz1ZWVu62Ag9t7RMSItLT05EEMn7o0KGLNm/eHC+y04LNrqR9oG7L3bt3y4mJiUJpOlpfkK/f738zLCzsXu0YwWRnzpz5fWFhocgMtIxDoQ1togkHHGbUUKMH9zph+FTZbdiwofbgwYPol2/Lli0ro6Oj/8NIUVKWAGXd1NQ0AgpVWPFQnAUFBVCcPlmWsSYZI+T34j9VJU4B4mYAI3ROh3VV8PExNzF3XzKQ0jGEsc9pUhDzlHAlqmbTgVUOGTKEufbAJDB2vofVxAkB7j/88EPF+++/PxquQD0wEnEVkz0VoJg196t/o6wX4zKKfem9h4JRV47NCox4yAPrtkMpEIBq/PjxtrJsf5VgpEnv9Y0cOXLXsWPHhEA6y7ryR48ezZS7UMRz5sw5kZ+fD3eAJRBxxSYsHzAKUF6AiK+xsfHPUVFR/xwsGJEF2oEh0VRpriwt2SwFI7i8kLDiu54hwhYdssfgBsLFs8g6WJZWgKcBI9XVOnDgwK/PnDnzt1yJqC4qq/ZorVVTU9Op+Ph46ciRIw+gr5CBcIOmpqZeKi4uRualbbclBUudfqhxFx4zYrhklZYtlJ3f729IS0vrBSYAJVReXj5bJDUQdqC6/ajS4gxgqSzLeJZZHcJFB9esLMvMWqVsScTRONipacs3AxhRpUpiHj6v17tUuCcJIBkZE2r8lAKWVmE3NzerMSrOdlQmRe997733Prxy5crTemDk9XrB5JmLFvt50aJF2y9cuBDvdruTX3zxRdUVuGrVqvmVlZXrcR/YX0tLy/+Gh4dHYX7nzZt34Z133nm4ra1NgKjv+eefb7p48SL2AC5Lg6w7xob9oQEj1hmPx+MOCwtTMwyPHj0qFRYWFtXX168cMWLE6wsWLEgS7tL09PQV33777XKrvfurAyNt4eeMGTNyCgsLl3FBdEpZ8jbYIqeK+LPPPrv28MMPT7TjqqTunldeeSU9Ozt7I28XGw1WH7P8gmFGZLIZQ+LgiEVcpRO8D4hD6C0UCkaaFGvIkbXb0tJy4tZbb/1HPM8z+CwVsMG71DTv48ePVwwZMkQkSjhqj9aGpaamphYXF2MTMBZEU8YvXLjg79+//7/ZmTPa39OnT//hiy++2JmYmNgDv6N+LTo6+mVaxE3S6k37TpMNvvzyy7+89NJLg/i7mKFA2Y/W5URdWTwFvMrr9SJOOhqxjdTUVJFUBPcWq186ffp0w8svv9yLv0NlC13BjEwUTYAbyspNx2WCPcYMHsKAmK7XnFIhtbe3/xgREbHS7/eXmKVni/5pXVlgW1u2bGmJiIiI1KbSE/biS01NdT333HO/EfE16qaTZRl9ZWtsyZIlQ8+dO4d1xS64AQWA8bGoa4IaFHh3ZGTk3scff/xf8dwnn3wi5+bmCs+ArcSo7hibHTAirBJ6gTEkjFm4QPnatXSH282m040Z8Ww6W6httFi70k2nPTli/fr1GSQ2YNuNZoXg4u/Nzc0Xe/bsyVLfefaaKdtwcFyP2oUDBw6kjh07tthun0zkjEXCLJmSkhIW2Ley3Gl/CRiBAcBCZ24PnSwzR/Ed0V/aTkpKSnVJScnD/G+23GikHRbjunr1al1kZKSIGang2djY+D8a9mnJEHVk2qFAVRSEX7lyBSAXxksMTK1ZCjZW8wvLc/Xq1QEuZvG8SAEXSQ8ffPDBic2bNyP2xO4XLi+iNALm6EaBkdWYz58/v3Px4sXP8vtUQ3LatGn5Dz744CwR5yLtwNNQYBZjoQqbg4/0xhtvnOjfv/9vCQNl7lfBWuvq6vbMnz//GZrsYRDvUuPfnHGneL3eZE2yCbqrrumdO3f+V0REhIhls6EoinJh/PjxIovUtt7qrrFZMSMetxTTwEpfOBtnLJ0YFKoBpDf3pnVGBGwoGKmp38QCtKSQ3Q1G3IpH1guzqD766KOcxx57TDAi/GQrs4koNXFmHn4S7rSAYYhgOwEjU+alc/6c1X5Ehp0tMOLMR6Sf4rimgIJBg7RmS2uFxyCG8yJn9Dcgk4YyEVLbZLrotIOmcvnuu++qY2NjBRBZ9k+nLQZGFy9ebOnXr5/InqTrV5stGhR4kvMUkylLPnLkSOUTTzyBgljTNaepB7JcB7iBx3tU8KTMCjECYYFnZGQ0nD17FgyIyY+mJvM2AuawK8DIRjYdk7PNotdcj8fTtmPHjudJHEKrY5DOnYF4Dyxw4RLie7EiIiIiRdRXUeHqKewJEyaUTZo0iSV4CCtelmXIiDHKDRs27Dl48OAz8+bNa33qqaduwW96YJSVlfV2bGxsXN++ff9Bb0J55iP+pI6FJrCIZwoLCzeXl5f/O/9/256B7hqbAzBS9xItJbCI76miMj2BwSBriJ2fxY/XUV0BTt0dROl3OptOe2bY559/vm7o0KGIB4iAWjDZc1Ds4py3DmfxUQV64sSJ1sGDB7NFqpehqLMwdQ80NcimE4+bjkETz+hwRhplHiTAbkn/deq0VEWmiSn91e1238E765TNqP7911577ciyZctQWIsrmHlTa0K4q5PWhqmB7aampvbbbruN1XTZKaY1QwsKyMOGDfugpqYGadSmblC6WQmT6fAa6u7gykydMw5oLMYAqx4KuaGhoTYtLU0kZwgLX83044ohAIApWHVBzMhIVB3ASK/OyOBhoyxVcTDycIASAFHUGV2+fPnU7NmzH9S2p6eweVwNbUULBsrBCL/5ONBG5+Tk1A4aNIjJloJReXl5VVtbG4ycgFok7bsJGAUADJU/Ya943JGh1B1js+OmI8xI1Q0GYGRKWozOplM3NGdH4vQFlRWtXbv2xMKFC1kaqlPWQSeps2467blptbW1f3S73TNNLCozvRLwN8p8uMWbybOnsOigQNniW7hw4V/Xrl0rFLFpait/geoyoy/sDBihHdpfnt32Co8XqUWVyACMjY2N4m4kS+ZBs8jwzMSJE5s+/PDD2zgQqXU7mZmZp8gpFbaZEW2fH7skArZB1TLQmByy/yZNmoREiL/j71EPevV4PHXJycnCjecIPMWcaU9z52vvJf53U9lSBUSSDTqsTQAqUq9xkWC+Kl+tq+/QoUOH169fD7eP6tKjabgALQDS0aNHWRvaLDAKRvw5duaV3llsBnVGwaR2G+1JgBDWgVWSifBiZGzatCla1A5lZWVVnjx5cpxwKeMlVGETJYokD8iLHWQJGWzatIn1iRfPMta0devW6ttvv52xdgpGpaWlySKlGQkMa9asOYWkGbBnWjOlB0Z6ZxISJuHIGOuOsd0MYIQiR/gyr1ePdbzAFLAAYGk6Qm9tU10ARnaOB1Ff6yJHE1ihEmJQ165dOxQeHi6Cvh0eqaury7/nnntEpl6nEiSohR1MAgP629TUtCcqKup6JV/Hy5eQkPCfe/bsEYFRWy4Aq1O2OyMDCh55eXmVc+fOFS6uzrh+aSZVBym0trYevvvuu4fwGiZHqf4mspjtcrlgSYvEC0OAo66Z77//vm7mzJkCFHXnQwe41Pu0yoy46ALYhCZl2HDpUzAqLS1V60b0UnS7EIwsla5mnIYpz+vWrSvv168fOz6KK/UAo8ZIYXu9XtTKME8IQEowrJUrV1bU1NRgTpHNJxKBAsBIlmVWAI9n09LSahoaGoYKAdsAI5H56vvxxx979ezZM1xk1zU2Nva30lH0790xthsORhggLN+cnJz/XrZsGS0cFN8zAhBdP77bRvqqmUBvZjDicohesWLFl1OmTIlBbIBcBTt27KiZPHnyDELPg1ag/F16p184strBANDfBQsWxCB7jFxLR40aFXP48GFhuVtm09GHy8rKhp09e/bo4sWLaeFrRWVlZVlcXFxaMDKgrKgzRa566ys7O/vtuLi4ySKVm99TVV9fX967d2+kzwvQsGSHtH0NGDGr3e12R+I0d3JmnynIUzZSWlpat337drHHdOOa1OUhMudEcSZ11RHmhC53UPBZWVlTwsLCtglFC5der169cIIGTnRg8jBiRgZFnurxMCRmFAwzsgQjTYzN16NHD7deTIjGpHj8B8NS5WqgsBlg0dgIHmpvbz/57LPPskxRpOhzI4LJSZNNB8Yd3dra2jpx4kThrkebSLfH/SyQr2VGdF5ramq2f/zxx5PFUUh8nh3pk+4Y200BRnwCADqm3zVyemq3CTDRTBRbFrumLUcMyWZsR7zCSg5ssdo9fcEMnPnf6NFGjsCIzBs2iNF3mNj3nRyczye6bPVRvM7IgM5fMPOvJ1ZThiQynqgbx8bcWMnCiQKhcUk7rJqekaYFLno2oxnbo/uMjYWewECKYum6o3KkRw/9bGCEflLlDeA9dOjQsb17947E3wBWra2tq4S7rKGhgdVt8clS58RCYQfokLKysi+LiopEMgKKilfpnKsHEINMmXFOAAdZjAEfYaRg5PF4SkidTu3UqVPDGhsb783Ly/P36dMnDG1xlovCbXHQrehfLXebBtQ1dsfYuhqMPB5PBf+EB3RTQCGw3fiG9rh2xpCsCvocbGzcejODEfonzqjTfvEVckBQ2cqv7UQcnQUj2l8sYEqR2Jdv7Rbo6nRa7wvAGLuQg5NxintpxbwjxmbjZVi7mDP64UIofsigM98JosAs4hqQAVMcNi+q5O0AMFWWWkZH+9PBKOBuLgT5MW7ci7ZGI74i4iN1dXUN8+fPFwqcghFtW2UxP6ebTshz+/btf4qMjGSno5tcvqysrLMnT54ULl81A9FMYWs/FUGAmRkKRjVSvL7LyGhXi6H5kUPo9lKv1ztaABs9oikhIWHz9OnTWSYdZ7oU/E2PCeqOsXU1GPFTNMSHUANq0OyAkc19FbotJIGQBG5GCXAlK8oe6NEzOARUTcQpKir6qqysjH3ChJ/EbwqsNwKM0LGHHnoo9/77739Jm9INpt/Y2Fg+depU1P6JM9ICYtpmChttC8DR1M4wQ8GsYBcyrqqqOvDII48wb0R7ezsKaVf06NGjQJykITLlZs2aJY8bN47FbTWuQFbD5/V6dwmg4myKsWDBDFHUvGTJkphLly7hfhgHjCF119gcpHZbZtNRZrRz5876nTt3IpGGyTcERjej9gj1KSSBLpQAXFjt7e2qgtNruqGh4d20tDRxcoAdlyFthn5awK5OoezfMmak02fqljSSlpk7Wsts6fd5tNmu2uxQo76bufNVhqRx6dO2qIuX9k87H/S4Lz23cHeMjZE14voX80xlpZcBS9k87Sv1hDGDwe7C6cKtEWoqJIGQBG6EBHJzc5+vr69/Iy4ujh1lxK+S6urqquzsbLgzRZ2Mk7gXmrkRYIT3QhGKWiPqirbjhjVT2GhbgISegjUDUvQJCph+dgZuU7jb2AcUSQYyVch6BgB9D3XjqrEjyozInHbX2LoSjCAnjI/FjkLM6EZohNA7QxK4cRKAwlZrrQy64Si78MYNJfTmX5sEQszo1zajofGEJGAtAfHNHVGegSeQ2CD+sW4hdEdIAl0sgRAYdbFAQ82FJBCSQEgCIQk4l0AIjJzLLPRESAIhCYQkEJJAF0vg/wBMng85iZWBHAAAAABJRU5ErkJggg==",qi=()=>Ne("FPScounter",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.y=15,r.x=20,t[1].nodeId||t[1].populate(r),o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};t[2].nodeId||t[2].populate(i);const f=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[2],t[3]||(t[3]=this.element({parent:o||"root"},e));const c={};if(c.image=e.image,c.w=43,c.h=25,c.map=e.sprite,c.frame="fps",typeof f<"u")for(let X in f.config.props)delete c[f.config.props[X]];t[3].nodeId||t[3].populate(c),o=t[3];const a={};if(a.image=e.image,a.w=43,a.h=25,a.map=e.sprite,a.frame="fps",!t[4]){const X=a.is||"Sprite";t[4]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:a},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}o=t[2],t[5]||(t[5]=this.element({parent:o||"root"},e));const d={};d.x=58,d.y=2,t[5].nodeId||t[5].populate(d);const m=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[5],t[6]||(t[6]=this.element({parent:o||"root"},e));const p={};if(p.image=e.image,p.x=0,p.h=20,p.w=20,p.map=e.sprite,typeof m<"u")for(let X in m.config.props)delete p[m.config.props[X]];t[6].nodeId||t[6].populate(p),o=t[6];const h={};if(h.image=e.image,h.x=0,h.h=20,h.w=20,h.map=e.sprite,h.frame=e.fps[0],!t[7]){const X=h.is||"Sprite";t[7]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:h},t[6],e),t[7][Symbol.for("slots")][0]?(o=t[7][Symbol.for("slots")][0],e=t[7]):o=t[7][Symbol.for("children")][0]}const y=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[5],t[8]||(t[8]=this.element({parent:o||"root"},e));const g={};if(g.image=e.image,g.x=18,g.h=20,g.w=20,g.map=e.sprite,typeof y<"u")for(let X in y.config.props)delete g[y.config.props[X]];t[8].nodeId||t[8].populate(g),o=t[8];const x={};if(x.image=e.image,x.x=18,x.h=20,x.w=20,x.map=e.sprite,x.frame=e.fps[1],!t[9]){const X=x.is||"Sprite";t[9]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:x},t[8],e),t[9][Symbol.for("slots")][0]?(o=t[9][Symbol.for("slots")][0],e=t[9]):o=t[9][Symbol.for("children")][0]}const _=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[5],t[10]||(t[10]=this.element({parent:o||"root"},e));const S={};if(S.image=e.image,S.x=36,S.h=20,S.w=20,S.map=e.sprite,typeof _<"u")for(let X in _.config.props)delete S[_.config.props[X]];t[10].nodeId||t[10].populate(S),o=t[10];const I={};if(I.image=e.image,I.x=36,I.h=20,I.w=20,I.map=e.sprite,I.frame=e.fps[2],!t[11]){const X=I.is||"Sprite";t[11]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:I},t[10],e),t[11][Symbol.for("slots")][0]?(o=t[11][Symbol.for("slots")][0],e=t[11]):o=t[11][Symbol.for("children")][0]}o=t[1],t[12]||(t[12]=this.element({parent:o||"root"},e));const v={};v.x=150,t[12].nodeId||t[12].populate(v);const P=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[12],t[13]||(t[13]=this.element({parent:o||"root"},e));const b={};if(b.image=e.image,b.y=2,b.w=48,b.h=25,b.map=e.sprite,b.frame="avg",typeof P<"u")for(let X in P.config.props)delete b[P.config.props[X]];t[13].nodeId||t[13].populate(b),o=t[13];const k={};if(k.image=e.image,k.y=2,k.w=48,k.h=25,k.map=e.sprite,k.frame="avg",!t[14]){const X=k.is||"Sprite";t[14]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:k},t[13],e),t[14][Symbol.for("slots")][0]?(o=t[14][Symbol.for("slots")][0],e=t[14]):o=t[14][Symbol.for("children")][0]}o=t[12],t[15]||(t[15]=this.element({parent:o||"root"},e));const L={};L.x=63,L.y=2,t[15].nodeId||t[15].populate(L);const F=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[15],t[16]||(t[16]=this.element({parent:o||"root"},e));const R={};if(R.image=e.image,R.x=0,R.h=20,R.w=20,R.map=e.sprite,typeof F<"u")for(let X in F.config.props)delete R[F.config.props[X]];t[16].nodeId||t[16].populate(R),o=t[16];const N={};if(N.image=e.image,N.x=0,N.h=20,N.w=20,N.map=e.sprite,N.frame=e.avgFps[0],!t[17]){const X=N.is||"Sprite";t[17]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:N},t[16],e),t[17][Symbol.for("slots")][0]?(o=t[17][Symbol.for("slots")][0],e=t[17]):o=t[17][Symbol.for("children")][0]}const O=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[15],t[18]||(t[18]=this.element({parent:o||"root"},e));const $={};if($.image=e.image,$.x=18,$.h=20,$.w=20,$.map=e.sprite,typeof O<"u")for(let X in O.config.props)delete $[O.config.props[X]];t[18].nodeId||t[18].populate($),o=t[18];const B={};if(B.image=e.image,B.x=18,B.h=20,B.w=20,B.map=e.sprite,B.frame=e.avgFps[1],!t[19]){const X=B.is||"Sprite";t[19]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:B},t[18],e),t[19][Symbol.for("slots")][0]?(o=t[19][Symbol.for("slots")][0],e=t[19]):o=t[19][Symbol.for("children")][0]}const T=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[15],t[20]||(t[20]=this.element({parent:o||"root"},e));const w={};if(w.image=e.image,w.x=36,w.h=20,w.w=20,w.map=e.sprite,typeof T<"u")for(let X in T.config.props)delete w[T.config.props[X]];t[20].nodeId||t[20].populate(w),o=t[20];const A={};if(A.image=e.image,A.x=36,A.h=20,A.w=20,A.map=e.sprite,A.frame=e.avgFps[2],!t[21]){const X=A.is||"Sprite";t[21]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:A},t[20],e),t[21][Symbol.for("slots")][0]?(o=t[21][Symbol.for("slots")][0],e=t[21]):o=t[21][Symbol.for("children")][0]}o=t[1],t[22]||(t[22]=this.element({parent:o||"root"},e));const z={};z.x=0,z.y=40,t[22].nodeId||t[22].populate(z);const M=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[22],t[23]||(t[23]=this.element({parent:o||"root"},e));const E={};if(E.image=e.image,E.x=-2,E.w=47,E.h=25,E.map=e.sprite,E.frame="min",typeof M<"u")for(let X in M.config.props)delete E[M.config.props[X]];t[23].nodeId||t[23].populate(E),o=t[23];const Y={};if(Y.image=e.image,Y.x=-2,Y.w=47,Y.h=25,Y.map=e.sprite,Y.frame="min",!t[24]){const X=Y.is||"Sprite";t[24]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:Y},t[23],e),t[24][Symbol.for("slots")][0]?(o=t[24][Symbol.for("slots")][0],e=t[24]):o=t[24][Symbol.for("children")][0]}o=t[22],t[25]||(t[25]=this.element({parent:o||"root"},e));const D={};D.x=58,D.y=2,t[25].nodeId||t[25].populate(D);const q=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[25],t[26]||(t[26]=this.element({parent:o||"root"},e));const U={};if(U.image=e.image,U.x=0,U.h=20,U.w=20,U.map=e.sprite,typeof q<"u")for(let X in q.config.props)delete U[q.config.props[X]];t[26].nodeId||t[26].populate(U),o=t[26];const j={};if(j.image=e.image,j.x=0,j.h=20,j.w=20,j.map=e.sprite,j.frame=e.minFps[0],!t[27]){const X=j.is||"Sprite";t[27]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:j},t[26],e),t[27][Symbol.for("slots")][0]?(o=t[27][Symbol.for("slots")][0],e=t[27]):o=t[27][Symbol.for("children")][0]}const Z=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[25],t[28]||(t[28]=this.element({parent:o||"root"},e));const V={};if(V.image=e.image,V.x=18,V.h=20,V.w=20,V.map=e.sprite,typeof Z<"u")for(let X in Z.config.props)delete V[Z.config.props[X]];t[28].nodeId||t[28].populate(V),o=t[28];const Q={};if(Q.image=e.image,Q.x=18,Q.h=20,Q.w=20,Q.map=e.sprite,Q.frame=e.minFps[1],!t[29]){const X=Q.is||"Sprite";t[29]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:Q},t[28],e),t[29][Symbol.for("slots")][0]?(o=t[29][Symbol.for("slots")][0],e=t[29]):o=t[29][Symbol.for("children")][0]}const oe=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[25],t[30]||(t[30]=this.element({parent:o||"root"},e));const ee={};if(ee.image=e.image,ee.x=36,ee.h=20,ee.w=20,ee.map=e.sprite,typeof oe<"u")for(let X in oe.config.props)delete ee[oe.config.props[X]];t[30].nodeId||t[30].populate(ee),o=t[30];const K={};if(K.image=e.image,K.x=36,K.h=20,K.w=20,K.map=e.sprite,K.frame=e.minFps[2],!t[31]){const X=K.is||"Sprite";t[31]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:K},t[30],e),t[31][Symbol.for("slots")][0]?(o=t[31][Symbol.for("slots")][0],e=t[31]):o=t[31][Symbol.for("children")][0]}o=t[1],t[32]||(t[32]=this.element({parent:o||"root"},e));const de={};de.x=150,de.y=40,t[32].nodeId||t[32].populate(de);const le=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[32],t[33]||(t[33]=this.element({parent:o||"root"},e));const fe={};if(fe.image=e.image,fe.w=53,fe.h=25,fe.map=e.sprite,fe.frame="max",typeof le<"u")for(let X in le.config.props)delete fe[le.config.props[X]];t[33].nodeId||t[33].populate(fe),o=t[33];const ue={};if(ue.image=e.image,ue.w=53,ue.h=25,ue.map=e.sprite,ue.frame="max",!t[34]){const X=ue.is||"Sprite";t[34]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:ue},t[33],e),t[34][Symbol.for("slots")][0]?(o=t[34][Symbol.for("slots")][0],e=t[34]):o=t[34][Symbol.for("children")][0]}o=t[32],t[35]||(t[35]=this.element({parent:o||"root"},e));const W={};W.x=63,W.y=2,t[35].nodeId||t[35].populate(W);const ke=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[35],t[36]||(t[36]=this.element({parent:o||"root"},e));const ve={};if(ve.image=e.image,ve.x=0,ve.h=20,ve.w=20,ve.map=e.sprite,typeof ke<"u")for(let X in ke.config.props)delete ve[ke.config.props[X]];t[36].nodeId||t[36].populate(ve),o=t[36];const Te={};if(Te.image=e.image,Te.x=0,Te.h=20,Te.w=20,Te.map=e.sprite,Te.frame=e.maxFps[0],!t[37]){const X=Te.is||"Sprite";t[37]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:Te},t[36],e),t[37][Symbol.for("slots")][0]?(o=t[37][Symbol.for("slots")][0],e=t[37]):o=t[37][Symbol.for("children")][0]}const Ht=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[35],t[38]||(t[38]=this.element({parent:o||"root"},e));const Fe={};if(Fe.image=e.image,Fe.x=18,Fe.h=20,Fe.w=20,Fe.map=e.sprite,typeof Ht<"u")for(let X in Ht.config.props)delete Fe[Ht.config.props[X]];t[38].nodeId||t[38].populate(Fe),o=t[38];const Re={};if(Re.image=e.image,Re.x=18,Re.h=20,Re.w=20,Re.map=e.sprite,Re.frame=e.maxFps[1],!t[39]){const X=Re.is||"Sprite";t[39]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:Re},t[38],e),t[39][Symbol.for("slots")][0]?(o=t[39][Symbol.for("slots")][0],e=t[39]):o=t[39][Symbol.for("children")][0]}const Vt=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[35],t[40]||(t[40]=this.element({parent:o||"root"},e));const ze={};if(ze.image=e.image,ze.x=36,ze.h=20,ze.w=20,ze.map=e.sprite,typeof Vt<"u")for(let X in Vt.config.props)delete ze[Vt.config.props[X]];t[40].nodeId||t[40].populate(ze),o=t[40];const Ee={};if(Ee.image=e.image,Ee.x=36,Ee.h=20,Ee.w=20,Ee.map=e.sprite,Ee.frame=e.maxFps[2],!t[41]){const X=Ee.is||"Sprite";t[41]=(s.components&&s.components[X]||e[Symbol.for("components")][X]||(()=>{console.error("component Sprite not found")})).call(null,{props:Ee},t[40],e),t[41][Symbol.for("slots")][0]?(o=t[41][Symbol.for("slots")][0],e=t[41]):o=t[41][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[6].set("frame",o.fps[0])},function(o,e,s){e[7][Symbol.for("props")].frame=o.fps[0]},function(o,e,s){e[8].set("frame",o.fps[1])},function(o,e,s){e[9][Symbol.for("props")].frame=o.fps[1]},function(o,e,s){e[10].set("frame",o.fps[2])},function(o,e,s){e[11][Symbol.for("props")].frame=o.fps[2]},function(o,e,s){e[16].set("frame",o.avgFps[0])},function(o,e,s){e[17][Symbol.for("props")].frame=o.avgFps[0]},function(o,e,s){e[18].set("frame",o.avgFps[1])},function(o,e,s){e[19][Symbol.for("props")].frame=o.avgFps[1]},function(o,e,s){e[20].set("frame",o.avgFps[2])},function(o,e,s){e[21][Symbol.for("props")].frame=o.avgFps[2]},function(o,e,s){e[26].set("frame",o.minFps[0])},function(o,e,s){e[27][Symbol.for("props")].frame=o.minFps[0]},function(o,e,s){e[28].set("frame",o.minFps[1])},function(o,e,s){e[29][Symbol.for("props")].frame=o.minFps[1]},function(o,e,s){e[30].set("frame",o.minFps[2])},function(o,e,s){e[31][Symbol.for("props")].frame=o.minFps[2]},function(o,e,s){e[36].set("frame",o.maxFps[0])},function(o,e,s){e[37][Symbol.for("props")].frame=o.maxFps[0]},function(o,e,s){e[38].set("frame",o.maxFps[1])},function(o,e,s){e[39][Symbol.for("props")].frame=o.maxFps[1]},function(o,e,s){e[40].set("frame",o.maxFps[2])},function(o,e,s){e[41][Symbol.for("props")].frame=o.maxFps[2]}],context:{}},state(){return{image:Vi,sprite:{defaults:{y:1,w:20,h:20},frames:{"-":{x:-1e3},0:{x:1},1:{x:23},2:{x:45},3:{x:67},4:{x:89},5:{x:111},6:{x:133},7:{x:155},8:{x:177},9:{x:199},avg:{x:221,w:48,h:25},fps:{x:271,w:43,h:25},max:{x:316,w:53,h:25},min:{x:371,w:47,h:25}}},fps:"---",avgFps:"---",minFps:"---",maxFps:"---"}},hooks:{ready(){let n=1e4,o=0,e=0,s=0,t=0;we.on("fpsUpdate",(l,{fps:r})=>{n=Math.min(r,n),o=Math.max(r,o),s+=r,t++,e=Math.round(s/t),this.fps=r.toString().padStart(3,"0"),this.avgFps=e.toString().padStart(3,"0"),this.minFps=n.toString().padStart(3,"0"),this.maxFps=o.toString().padStart(3,"0")})}}}),Et=new Map,eo={registerListener(n,o,e){let s=Et.get(o);s||(s=new Map,Et.set(o,s));let t=s.get(n);t||(t=new Set,s.set(n,t)),t.add(e)},executeListeners(n,o){const e=Et.get(n);e&&e.forEach(s=>{s.forEach(t=>{t(o)})})},removeListeners(n){Et.forEach(o=>{const e=o.get(n);e&&(e.clear(),o.delete(e))})}},ji={rounded:"radius"},Ki=(n,o,e)=>{Object.defineProperties(n.prototype,{name:{value:o,writable:!1,enumerable:!0,configurable:!1},[C.identifier]:{value:n[C.identifier],writable:!1,enumerable:!1,configurable:!1},focus:{value:function(s){this[C.state].hasFocus=!0,Be.set(this,s)},writable:!1,enumerable:!0,configurable:!1},unfocus:{value:function(){this[C.state].hasFocus=!1,this.lifecycle.state="unfocus"},writable:!1,enumerable:!0,configurable:!1},destroy:{value:function(){this.lifecycle.state="destroy",this.$clearTimeouts(),this.$clearIntervals(),eo.removeListeners(this),zs(this[C.children]),te.debug(`Destroyed component ${this.componentId}`)},writable:!1,enumerable:!0,configurable:!1},select:{value:function(s){let t=null;return this[C.children].forEach(l=>{Array.isArray(l)?l.forEach(r=>{r.ref===s&&(t=r)}):Object.getPrototypeOf(l)===Object.prototype?Object.keys(l).forEach(r=>{l[r].ref===s&&(t=l[r])}):l.ref===s&&(t=l)}),t},writable:!1,enumerable:!0,configurable:!1},shader:{value:function(s,t){const l=ji[s]||s,r=we.driver.stage.shManager.getRegisteredEffects();if(l in r)return{type:l,props:t};te.error(`Shader ${s} not found`)},writable:!1,enumerable:!1,configurable:!1},$router:{value:{to:ko,back:Ns,get currentRoute(){return _o},get routes(){return n.prototype[C.routes]},get navigating(){return Xt}},writable:!1,enumerable:!0,configurable:!1},[C.components]:{value:{Image:Xi(),Circle:Wi(),RouterView:Yi(),Sprite:Gi(),Text:Hi(),FPScounter:qi()},writable:!1,enumerable:!1,configurable:!1},$setTimeout:{value:function(s,t,...l){const r=setTimeout(()=>{this[C.timeouts]=this[C.timeouts].filter(i=>i!==r),s.apply(null,l)},t,l);return this[C.timeouts].push(r),r},writable:!1,enumerable:!0,configurable:!1},$clearTimeout:{value:function(s){this[C.timeouts].indexOf(s)>-1&&(this[C.timeouts]=this[C.timeouts].filter(t=>t!==s),clearTimeout(s))},writable:!1,enumerable:!0,configurable:!1},$clearTimeouts:{value:function(){for(let s=0;ss.apply(null,l),t,l);return this[C.intervals].push(r),r},writable:!1,enumerable:!0,configurable:!1},$clearInterval:{value:function(s){this[C.intervals].indexOf(s)>-1&&(this[C.intervals]=this[C.intervals].filter(t=>t!==s),clearInterval(s))},writable:!1,enumerable:!0,configurable:!1},$clearIntervals:{value:function(){for(let s=0;sn,required:!1},Qi=(n,o=[])=>{o.indexOf("ref")===-1&&o.push("ref"),n[C.propKeys]=[],o.forEach(e=>{e={...Zi,...typeof e=="object"?e:{key:e}},n[C.propKeys].push(e.key),Object.defineProperty(n.prototype,e.key,{get(){const s=e.cast(this[C.props]&&e.key in this[C.props]?this[C.props][e.key]:e.default||void 0);return e.required&&s===void 0&&te.warn(`${e.key} is required`),s},set(s){te.warn(`Warning! Avoid mutating props directly (${e.key})`),this[C.props][e.key]=s}})})},Ji=(n,o)=>{n[C.methodKeys]=[];for(let e in o)n[C.propKeys]&&n[C.propKeys].indexOf(e)>-1?te.error(`${e} already exists as a prop`):(typeof o[e]!="function"&&te.warn(`${e} is not a function`),n[C.methodKeys].push(e),n.prototype[e]=o[e])},er=(n,o)=>{n[C.stateKeys]=[],o={...o.apply(n.prototype),hasFocus:!1},Object.keys(o).forEach(e=>{n[C.propKeys]&&n[C.propKeys].indexOf(e)>-1&&te.error(`State ${e} already exists as a prop`),n[C.methodKeys]&&n[C.methodKeys].indexOf(e)>-1&&te.error(`State ${e} already exists as a method`),n[C.stateKeys].push(e);try{Object.defineProperty(n.prototype,e,{get(){return this[C.state]&&e in this[C.state]&&this[C.state][e]},set(s){this[C.state]&&(this[C.state][e]=s)}})}catch(s){te.error(s)}})},tr=(n,o)=>{n[C.computedKeys]=[];for(let e in o)n[C.stateKeys]&&n[C.stateKeys].indexOf(e)>-1?te.error(`${e} already exists as a prop`):n[C.propKeys]&&n[C.propKeys].indexOf(e)>-1?te.error(`${e} already exists as a prop`):n[C.methodKeys]&&n[C.methodKeys].indexOf(e)>-1?te.error(`${e} already exists as a method`):(typeof o[e]!="function"&&te.warn(`${e} is not a function`),n[C.computedKeys].push(e),Object.defineProperty(n.prototype,e,{get(){return o[e].apply(this)}}))},or=(n,o)=>{n.prototype[C.inputEvents]=[],Object.keys(o).forEach(e=>{typeof o[e]!="function"&&te.warn(`${o[e]} is not a function`),n.prototype[C.inputEvents][e]=o[e]})},sr=(n,o)=>{n.prototype[C.routes]=[],Object.keys(o).forEach(e=>{n.prototype[C.routes][e]={...o[e],options:{inHistory:!0,...o[e].options}}})},nr=(n,o)=>{n.prototype[C.watchKeys]=[],n.prototype[C.watchers]={};for(let e in o)typeof o[e]!="function"&&console.warn(`${e} is not a function`),n.prototype[C.watchKeys].push(e),n.prototype[C.watchers][e]=function(s,t){o[e].call(this,s,t)}},ir=["init","ready","focus","unfocus","destroy"],rr={previous:null,current:null,get state(){return this.current},set state(n){ir.indexOf(n)>-1&&(n!==this.current||n==="focus")&&(te.debug(`Setting lifecycle state from ${this.current} to ${n} for ${this.component.componentId}`),this.previous=this.current,this.current=n,_i(n,this.component[C.identifier],this.component),vs(n,this.component[C.identifier],this.component))}};let lr=0;const jo={element:Cs},Ko=n=>{throw new Error(`Parameter ${n} is required`)},Ne=(n=Ko("name"),o=Ko("config"))=>{const e=l=>{o.code||(te.debug(`Generating code for ${n} component`),o.code=js.call(o,qs(o.template,n,l))),s[C.identifier]=++lr,Ki(s,n),ki(o.hooks,s[C.identifier]),Qi(s,o.props),o.methods&&Ji(s,o.methods),o.state&&er(s,o.state),o.computed&&tr(s,o.computed),o.watch&&nr(s,o.watch),o.routes&&sr(s,o.routes),o.input&&or(s,o.input),s.setup=!0},s=function(l,r,i){this.lifecycle=Object.assign(Object.create(rr),{component:this,previous:null,current:null}),s.setup||e(i),o.hooks&&o.hooks.frameTick&&we.on("frameTick",(f,c)=>vs("frameTick",s[C.identifier],this,[c])),this.parent=i,this[C.wrapper]=r,Object.defineProperties(this,{componentId:{value:vi(n),writable:!1,enumerable:!0,configurable:!1},[C.id]:{value:Ii(),writable:!1,enumerable:!1,configurable:!1},[C.props]:{value:Yo(l.props||{},$e.get("reactivityMode")),writable:!1,enumerable:!1,configurable:!1},[C.timeouts]:{value:[],writable:!0,enumerable:!1,configurable:!1},[C.intervals]:{value:[],writable:!0,enumerable:!1,configurable:!1}}),Object.defineProperty(this,C.originalState,{value:{...o.state&&typeof o.state=="function"&&o.state.apply(this)||{},hasFocus:!1},writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(this,C.state,{value:Yo(this[C.originalState],$e.get("reactivityMode")),writable:!1,enumerable:!1,configurable:!1}),this.lifecycle.state="init",Object.defineProperty(this,C.children,{value:o.code.render.apply(jo,[r,this,o]),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(this,C.slots,{value:this[C.children].filter(f=>f[C.isSlot]),writable:!1,enumerable:!1,configurable:!1}),o.code.effects.forEach(f=>{Wo(()=>{f.apply(jo,[this,this[C.children],o])})}),this[C.watchers]&&Object.keys(this[C.watchers]).forEach(f=>{let c=this[f];Wo((a=!1)=>{(c!==this[f]||a===!0)&&(this[C.watchers][f].apply(this,[this[f],c]),c=this[f])})}),setTimeout(()=>this.lifecycle.state="ready")},t=(l={},r,i)=>new s(l,r,i);return t.config=o,t},fr=n=>{const o={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Enter:"enter"," ":"space",Backspace:"back",Escape:"escape",37:"left",39:"right",38:"up",40:"down",13:"enter",32:"space",8:"back",27:"escape"};n.hooks=n.hooks||{};let e,s,t;return n.hooks[C.destroy]=function(){document.removeEventListener("keydown",e),document.removeEventListener("keyup",s)},n.hooks[C.init]=function(){const l={...o,...$e.get("keymap",{})};e=r=>{const i=l[r.key]||l[r.keyCode]||r.key||r.keyCode;Be.input(i,r),clearTimeout(t),t=setTimeout(()=>{Be.hold=!0},50)},s=()=>{clearTimeout(t),Be.hold=!1},document.addEventListener("keydown",e),document.addEventListener("keyup",s),setTimeout(()=>Be.set(this))},Ne("App",n)},H={Component:Ne,Application:fr,Launch:bi},ar=n=>new URLSearchParams(window.location.search).get(n),tt={sky:{test(){return navigator.userAgent.indexOf("WPE Sky")>-1||ar("keymapping")==="sky"},mapping:{Escape:"back",27:"back"}}},cr=()=>{let n={};return Object.keys(tt).forEach(o=>{if(tt[o].test&&typeof tt[o].test=="function"&&tt[o].test()===!0){n=tt[o].mapping;return}}),n},dr=H.Component("PortalItem",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=370,l.h=320,t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.x=30,i.y=30,i.size=84,typeof r<"u")for(let y in r.config.props)delete i[r.config.props[y]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.x=30,f.y=30,f.content=e.number,f.size=84,f.color=e.fontColor,!t[2]){const y=f.is||"Text";t[2]=(s.components&&s.components[y]||e[Symbol.for("components")][y]||(()=>{console.error("component Text not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.x=30,a.y=140,a.size=42,a.font="raleway",a.letterspacing=2,typeof c<"u")for(let y in c.config.props)delete a[c.config.props[y]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.x=30,d.y=140,d.content=e.title,d.size=42,d.font="raleway",d.color=e.fontColor,d.letterspacing=2,!t[4]){const y=d.is||"Text";t[4]=(s.components&&s.components[y]||e[Symbol.for("components")][y]||(()=>{console.error("component Text not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}const m=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const p={};if(p.x=30,p.y=200,p.wordwrap=300,p.size=28,p.lineheight=32,typeof m<"u")for(let y in m.config.props)delete p[m.config.props[y]];t[5].nodeId||t[5].populate(p),o=t[5];const h={};if(h.x=30,h.y=200,h.content=e.description,h.wordwrap=300,h.size=28,h.color=e.fontColor,h.lineheight=32,!t[6]){const y=h.is||"Text";t[6]=(s.components&&s.components[y]||e[Symbol.for("components")][y]||(()=>{console.error("component Text not found")})).call(null,{props:h},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("scale",{transition:o.hasFocus?1.1:1})},function(o,e,s){e[0].set("color",o.backgroundColor)},function(o,e,s){e[0].set("effects",[o.shader("radius",{radius:6})])},function(o,e,s){e[1].set("content",o.number)},function(o,e,s){e[1].set("color",o.fontColor)},function(o,e,s){e[2][Symbol.for("props")].content=o.number},function(o,e,s){e[2][Symbol.for("props")].color=o.fontColor},function(o,e,s){e[3].set("content",o.title)},function(o,e,s){e[3].set("color",o.fontColor)},function(o,e,s){e[4][Symbol.for("props")].content=o.title},function(o,e,s){e[4][Symbol.for("props")].color=o.fontColor},function(o,e,s){e[5].set("content",o.description)},function(o,e,s){e[5].set("color",o.fontColor)},function(o,e,s){e[6][Symbol.for("props")].content=o.description},function(o,e,s){e[6][Symbol.for("props")].color=o.fontColor}],context:{}},props:["title","description","index","id"],state(){return{backgroundColor:"#44037a",fontColor:"#e8d7f9",number:this.index<9?`0${this.index+1}`:this.index+1}},hooks:{focus(){this.backgroundColor="#fafafa",this.fontColor="#000"},unfocus(){this.$router.navigating||(this.backgroundColor="#44037a",this.fontColor="#e8d7f9")}},input:{enter(){this.$router.to(`/${this.id}`)},back(){}}}),ur=H.Component("PortalRow",{components:{PortalItem:dr},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};t[1].nodeId||t[1].populate(r);const i=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const f={};if(f.content=e.title,f.x=60,typeof i<"u")for(let m in i.config.props)delete f[i.config.props[m]];t[2].nodeId||t[2].populate(f),o=t[2];const c={};if(c.content=e.title,c.x=60,!t[3]){const m=c.is||"Text";t[3]=(s.components&&s.components[m]||e[Symbol.for("components")][m]||(()=>{console.error("component Text not found")})).call(null,{props:c},t[2],e),t[3][Symbol.for("slots")][0]?(o=t[3][Symbol.for("slots")][0],e=t[3]):o=t[3][Symbol.for("children")][0]}o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const a={};a.y=50,a.x=60,a.h=1,a.w=1800,a.color="0xe8d7f9ff",t[4].nodeId||t[4].populate(a),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const d={};return d.y=100,t[5].nodeId||t[5].populate(d),t},effects:[function(o,e,s){e[1].set("alpha",{transition:{value:o.itemOffset<240?1:0,duration:200}})},function(o,e,s){e[5].set("x",{transition:o.rowOffset})},function(o,e,s){parent=e[5];const t=o.items||[],l=[];for(let r=0;r{console.error("component PortalItem not found")})).call(null,{props:a},e[6][i.item.id],o),e[7][i.item.id][Symbol.for("slots")][0]?(parent=e[7][i.item.id][Symbol.for("slots")][0],o=e[7][i.item.id]):parent=e[7][i.item.id][Symbol.for("children")][0]}e[6][i.item.id].set("x",{transition:{value:i.itemOffset+i.index*430,delay:50*(i.index%4),duration:500}}),e[6][i.item.id].set("ref","item"+i.index),e[7][i.item.id][Symbol.for("props")].x={transition:{value:i.itemOffset+i.index*430,delay:50*(i.index%4),duration:500}},e[7][i.item.id][Symbol.for("props")].ref="item"+i.index}e[6]&&Object.keys(e[6]).forEach(r=>{l.indexOf(r)===-1&&(e[6][r].destroy&&e[6][r].destroy(),delete e[1][r])})}],context:{}},props:["title","items"],state(){return{focused:0,rowOffset:60,itemOffset:240}},hooks:{ready(){this.itemOffset=0},focus(){this.$trigger("focused")}},watch:{focused(n){const o=this.select(`item${n}`);o&&o.focus&&(o.focus(),n<1?this.rowOffset=60:n>this.items.length-2?this.rowOffset=60-(this.items.length-2)*430+430:this.rowOffset=60-n*430+430)}},input:{left(){this.focused>0?this.focused--:this.focused=this.items.length-1},right(){this.focused",wr="Apache-2",Tr={backstopjs:"^6.3.22",eslint:"^8.8.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0",husky:"^7.0.4","lint-staged":"^12.3.3",playwright:"^1.41.0",prettier:"^2.5.1",vite:"^4.0.4"},Cr={"@lightningjs/blits":"^0.9.2"},vr={name:hr,version:pr,description:mr,main:yr,type:gr,scripts:xr,"lint-staged":{"*.js":["eslint --fix"]},husky:br,author:Sr,license:wr,devDependencies:Tr,dependencies:Cr},Ir=H.Component("Portal",{components:{PortalRow:ur},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=1920,l.h=1080,l.color="{top: '0x44037aff', bottom: '0x240244ff'}",t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.PortalRow||e[Symbol.for("components")].PortalRow;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.mount="{y: 0.5}",i.h=500,i.title="Demos",i.items=e.demo,i.ref="row0",typeof r<"u")for(let R in r.config.props)delete i[r.config.props[R]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.mount="{y: 0.5}",f.h=500,f.y={transition:-e.rowFocused*420+550},f.title="Demos",f.items=e.demo,f.ref="row0",!t[2]){const R=f.is||"PortalRow";t[2]=(s.components&&s.components[R]||e[Symbol.for("components")][R]||(()=>{console.error("component PortalRow not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.PortalRow||e[Symbol.for("components")].PortalRow;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.mount="{y: 0.5}",a.h=500,a.title="Examples and tests",a.items=e.example,a.ref="row1",typeof c<"u")for(let R in c.config.props)delete a[c.config.props[R]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.mount="{y: 0.5}",d.h=500,d.y={transition:-e.rowFocused*420+1100},d.title="Examples and tests",d.items=e.example,d.ref="row1",!t[4]){const R=d.is||"PortalRow";t[4]=(s.components&&s.components[R]||e[Symbol.for("components")][R]||(()=>{console.error("component PortalRow not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}const m=s.components&&s.components.PortalRow||e[Symbol.for("components")].PortalRow;o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const p={};if(p.mount="{y: 0.5}",p.h=500,p.title="Benchmarks and stress tests",p.items=e.benchmark,p.ref="row2",typeof m<"u")for(let R in m.config.props)delete p[m.config.props[R]];t[5].nodeId||t[5].populate(p),o=t[5];const h={};if(h.mount="{y: 0.5}",h.h=500,h.y={transition:-e.rowFocused*420+1650},h.title="Benchmarks and stress tests",h.items=e.benchmark,h.ref="row2",!t[6]){const R=h.is||"PortalRow";t[6]=(s.components&&s.components[R]||e[Symbol.for("components")][R]||(()=>{console.error("component PortalRow not found")})).call(null,{props:h},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const y={};y.w=1920,y.h=200,y.color="0x44037aff",t[7].nodeId||t[7].populate(y),o=t[7],t[8]||(t[8]=this.element({parent:o||"root"},e));const g={};g.w=1920,g.h=70,g.y=200,g.color="{top: '0x44037aff'}",t[8].nodeId||t[8].populate(g),o=t[7],t[9]||(t[9]=this.element({parent:o||"root"},e));const x={};t[9].nodeId||t[9].populate(x),o=t[9],t[10]||(t[10]=this.element({parent:o||"root"},e));const _={};_.src="assets/blits-logo-full.png",_.w=200,_.h=112,_.x=60,t[10].nodeId||t[10].populate(_),o=t[9],t[11]||(t[11]=this.element({parent:o||"root"},e));const S={};S.w=2,S.h=120,S.y=-10,S.color="0xffffff80",S.x=300,t[11].nodeId||t[11].populate(S),o=t[9],t[12]||(t[12]=this.element({parent:o||"root"},e));const I={};I.x=320,I.y=16,t[12].nodeId||t[12].populate(I);const v=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[12],t[13]||(t[13]=this.element({parent:o||"root"},e));const P={};if(P.y=0,P.size=36,P.content="Example App",typeof v<"u")for(let R in v.config.props)delete P[v.config.props[R]];t[13].nodeId||t[13].populate(P),o=t[13];const b={};if(b.y=0,b.size=36,b.content="Example App",!t[14]){const R=b.is||"Text";t[14]=(s.components&&s.components[R]||e[Symbol.for("components")][R]||(()=>{console.error("component Text not found")})).call(null,{props:b},t[13],e),t[14][Symbol.for("slots")][0]?(o=t[14][Symbol.for("slots")][0],e=t[14]):o=t[14][Symbol.for("children")][0]}const k=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[12],t[15]||(t[15]=this.element({parent:o||"root"},e));const L={};if(L.y=50,L.size=24,L.content="v"+e.version,typeof k<"u")for(let R in k.config.props)delete L[k.config.props[R]];t[15].nodeId||t[15].populate(L),o=t[15];const F={};if(F.y=50,F.size=24,F.content="v"+e.version,!t[16]){const R=F.is||"Text";t[16]=(s.components&&s.components[R]||e[Symbol.for("components")][R]||(()=>{console.error("component Text not found")})).call(null,{props:F},t[15],e),t[16][Symbol.for("slots")][0]?(o=t[16][Symbol.for("slots")][0],e=t[16]):o=t[16][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[1].set("y",{transition:-o.rowFocused*420+550})},function(o,e,s){e[2][Symbol.for("props")].y={transition:-o.rowFocused*420+550}},function(o,e,s){e[3].set("y",{transition:-o.rowFocused*420+1100})},function(o,e,s){e[4][Symbol.for("props")].y={transition:-o.rowFocused*420+1100}},function(o,e,s){e[5].set("y",{transition:-o.rowFocused*420+1650})},function(o,e,s){e[6][Symbol.for("props")].y={transition:-o.rowFocused*420+1650}},function(o,e,s){e[9].set("y",{transition:{value:80-o.logoOffset,duration:400}})}],context:{}},state(){return{version:vr.version,offset:60,rowFocused:0,rows:["demo","example","benchmark"],logoOffset:50,demo:[{title:"Loader",id:"demos/loading",description:"A basic loading screen"},{title:"Intro",id:"demos/intro",description:"A splash screen with custom animations"},{title:"Theming",id:"demos/theming",description:"Dynamically changing the styling of a component with themes"},{title:"TMDB",id:"demos/tmdb",description:"The Movie Database (TMDB) example using data from a remote API"},{title:"Sprites",id:"demos/sprites",description:"Display multiple images while keeping low memory footprint"},{title:"Focus",id:"demos/focushandling",description:"Managing focus between components in a simple layout"},{title:"Memory Game",id:"demos/memory-game",description:"Memory game with speech assistence (for accessibility)"}],example:[{title:"Positioning",id:"examples/positioning",description:"Positioning Elements and Components"},{title:"Colors",id:"examples/colors",description:"Using different formats and notations for defining colors"},{title:"Gradients",id:"examples/gradients",description:"Example of Basic gradients"},{title:"Transitions",id:"examples/transitions",description:"Comparing different transition easing functions"},{title:"Components",id:"examples/components",description:"Reusable Components"},{title:"Alpha",id:"examples/alpha",description:"Applying transparency to Elements, Images and Components"},{title:"Scaling",id:"examples/scaling",description:"Resizing and scaling Elements and Components"},{title:"Rotation",id:"examples/rotation",description:"Rotating Elements"},{title:"Key input",id:"examples/keyinput",description:"Handling user input events"},{title:"For Loop",id:"examples/forloop",description:"Iterating over Elements and Components using for loops"},{title:"Advanced loop",id:"examples/forloop-advanced",description:"Testing various Array operations with a for loop"},{title:"Effects",id:"examples/effects",description:"Applying one or multiple effects (aka shaders)"},{title:"Show",id:"examples/showif",description:"Conditionally show or hide Elements and Components"},{title:"Events",id:"examples/events",description:"Communication between components by emitting and listening for events"},{title:"Images",id:"examples/images",description:"1 image says more than 1000 words ;)"},{title:"Texts",id:"examples/texts",description:"Displaying and formatting text"},{title:"Slots",id:"examples/slots",description:"Insert dynamic content from a parent into a child using slots"}],benchmark:[{title:"Exponential",id:"benchmarks/exponential",description:"Spawn a large number of components at an exponential rate"}]}},hooks:{ready(){this.logoOffset=0,this.$trigger("rowFocused"),console.log("backstopjs:ready")}},watch:{rowFocused(n){const o=this.select(`row${n}`);o&&o.focus&&o.focus()}},input:{up(){this.rowFocused=(this.rowFocused-1+this.rows.length)%this.rows.length},down(){this.rowFocused=(this.rowFocused+1)%this.rows.length}}}),_r=H.Component("Letter",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=e.w,r.color="0xe6e6e6ff",t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=e.w,i.h=280,t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};return f.w=e.w,f.color="0xe6e6e6ff",t[3].nodeId||t[3].populate(f),t},effects:[function(o,e,s){e[1].set("h",{transition:{value:410+o.offset,duration:o.duration,delay:o.wait,easing:o.timingFunction}})},function(o,e,s){e[2].set("src",o.image)},function(o,e,s){e[2].set("y",{transition:{value:400+o.offset,duration:o.duration,delay:o.wait,easing:o.timingFunction}})},function(o,e,s){e[3].set("h",{transition:{value:500-o.offset,duration:o.duration,delay:o.wait,easing:o.timingFunction}})},function(o,e,s){e[3].set("y",{transition:{value:660+o.offset,duration:o.duration,delay:o.wait,easing:o.timingFunction}})}],context:{}},props:["w","letter","direction","delay"],computed:{image(){return`assets/${this.letter}.png`}},state(){return{offset:this.direction==="up"?-680:680,duration:1e3,wait:0,timingFunction:"cubic-bezier(1,-0.64,.39,1.44)"}},hooks:{ready(){this.animate()}},methods:{animate(){this.$setTimeout(()=>{this.offset=0},1e3),this.$setTimeout(()=>{this.wait=this.delay+150,this.duration=1e3,this.offset=1080},2800),this.$setTimeout(()=>{this.wait=this.delay/3,this.timingFunction="ease-in-out",this.duration=1500,this.offset=0},5e3)}}}),kr=H.Component("Intro",{components:{Letter:_r},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=1920,l.h=1080,l.src="assets/background.jpg",t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.letter="l",i.w=294,typeof r<"u")for(let w in r.config.props)delete i[r.config.props[w]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.letter="l",f.w=294,!t[2]){const w=f.is||"Letter";t[2]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.letter="i-1",a.w=128,a.x=294,a.direction="up",a.delay=50,typeof c<"u")for(let w in c.config.props)delete a[c.config.props[w]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.letter="i-1",d.w=128,d.x=294,d.direction="up",d.delay=50,!t[4]){const w=d.is||"Letter";t[4]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}const m=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const p={};if(p.letter="g-1",p.w=205,p.x=422,p.delay=100,typeof m<"u")for(let w in m.config.props)delete p[m.config.props[w]];t[5].nodeId||t[5].populate(p),o=t[5];const h={};if(h.letter="g-1",h.w=205,h.x=422,h.delay=100,!t[6]){const w=h.is||"Letter";t[6]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:h},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}const y=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const g={};if(g.letter="h",g.w=224,g.x=627,g.direction="up",g.delay=150,typeof y<"u")for(let w in y.config.props)delete g[y.config.props[w]];t[7].nodeId||t[7].populate(g),o=t[7];const x={};if(x.letter="h",x.w=224,x.x=627,x.direction="up",x.delay=150,!t[8]){const w=x.is||"Letter";t[8]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:x},t[7],e),t[8][Symbol.for("slots")][0]?(o=t[8][Symbol.for("slots")][0],e=t[8]):o=t[8][Symbol.for("children")][0]}const _=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[9]||(t[9]=this.element({parent:o||"root"},e));const S={};if(S.letter="t",S.w=190,S.x=851,S.delay=200,typeof _<"u")for(let w in _.config.props)delete S[_.config.props[w]];t[9].nodeId||t[9].populate(S),o=t[9];const I={};if(I.letter="t",I.w=190,I.x=851,I.delay=200,!t[10]){const w=I.is||"Letter";t[10]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:I},t[9],e),t[10][Symbol.for("slots")][0]?(o=t[10][Symbol.for("slots")][0],e=t[10]):o=t[10][Symbol.for("children")][0]}const v=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const P={};if(P.letter="n-1",P.w=221,P.x=1041,P.direction="up",P.delay=250,typeof v<"u")for(let w in v.config.props)delete P[v.config.props[w]];t[11].nodeId||t[11].populate(P),o=t[11];const b={};if(b.letter="n-1",b.w=221,b.x=1041,b.direction="up",b.delay=250,!t[12]){const w=b.is||"Letter";t[12]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:b},t[11],e),t[12][Symbol.for("slots")][0]?(o=t[12][Symbol.for("slots")][0],e=t[12]):o=t[12][Symbol.for("children")][0]}const k=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[13]||(t[13]=this.element({parent:o||"root"},e));const L={};if(L.letter="i-2",L.w=115,L.x=1262,L.delay=300,typeof k<"u")for(let w in k.config.props)delete L[k.config.props[w]];t[13].nodeId||t[13].populate(L),o=t[13];const F={};if(F.letter="i-2",F.w=115,F.x=1262,F.delay=300,!t[14]){const w=F.is||"Letter";t[14]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:F},t[13],e),t[14][Symbol.for("slots")][0]?(o=t[14][Symbol.for("slots")][0],e=t[14]):o=t[14][Symbol.for("children")][0]}const R=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[15]||(t[15]=this.element({parent:o||"root"},e));const N={};if(N.letter="n-2",N.w=219,N.x=1377,N.direction="up",N.delay=350,typeof R<"u")for(let w in R.config.props)delete N[R.config.props[w]];t[15].nodeId||t[15].populate(N),o=t[15];const O={};if(O.letter="n-2",O.w=219,O.x=1377,O.direction="up",O.delay=350,!t[16]){const w=O.is||"Letter";t[16]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:O},t[15],e),t[16][Symbol.for("slots")][0]?(o=t[16][Symbol.for("slots")][0],e=t[16]):o=t[16][Symbol.for("children")][0]}const $=s.components&&s.components.Letter||e[Symbol.for("components")].Letter;o=t[0],t[17]||(t[17]=this.element({parent:o||"root"},e));const B={};if(B.letter="g-2",B.w=324,B.x=1596,B.direction="up",B.delay=400,typeof $<"u")for(let w in $.config.props)delete B[$.config.props[w]];t[17].nodeId||t[17].populate(B),o=t[17];const T={};if(T.letter="g-2",T.w=324,T.x=1596,T.direction="up",T.delay=400,!t[18]){const w=T.is||"Letter";t[18]=(s.components&&s.components[w]||e[Symbol.for("components")][w]||(()=>{console.error("component Letter not found")})).call(null,{props:T},t[17],e),t[18][Symbol.for("slots")][0]?(o=t[18][Symbol.for("slots")][0],e=t[18]):o=t[18][Symbol.for("children")][0]}return t},effects:[],context:{}}}),Rr=H.Component("Toggle",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=100,l.h=50,l.y=5,t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Circle||e[Symbol.for("components")].Circle;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.size=50,typeof r<"u")for(let c in r.config.props)delete i[r.config.props[c]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.x={transition:e.on?0:50},f.size=50,f.color=e.primaryColor,!t[2]){const c=f.is||"Circle";t[2]=(s.components&&s.components[c]||e[Symbol.for("components")][c]||(()=>{console.error("component Circle not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("color",o.bgColor)},function(o,e,s){e[0].set("effects",[o.shader("radius",{radius:25})])},function(o,e,s){e[1].set("x",{transition:o.on?0:50})},function(o,e,s){e[1].set("color",o.primaryColor)},function(o,e,s){e[2][Symbol.for("props")].x={transition:o.on?0:50}},function(o,e,s){e[2][Symbol.for("props")].color=o.primaryColor}],context:{}},props:["bgColor","primaryColor","on"]}),Er=H.Component("Bar",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};return t[1].nodeId||t[1].populate(r),t},effects:[function(o,e,s){e[0].set("w",{value:o.w,duration:o.duration})},function(o,e,s){e[0].set("h",{value:o.h,duration:o.duration})},function(o,e,s){e[0].set("color",o.bgColor)},function(o,e,s){e[0].set("x",o.index*(o.w+o.w/4))},function(o,e,s){e[0].set("effects",[o.shader("radius",{radius:10})])},function(o,e,s){e[1].set("w",o.w)},function(o,e,s){e[1].set("y",{transition:{value:o.h-o.innerH,duration:o.duration}})},function(o,e,s){e[1].set("h",{transition:{value:o.innerH,duration:o.duration}})},function(o,e,s){e[1].set("color",o.primaryColor)},function(o,e,s){e[1].set("effects",[o.shader("radius",{radius:10})])}],context:{}},props:["bgColor","primaryColor","height","index","size"],state(){return{h:200,innerH:0,duration:400}},hooks:{ready(){this.innerH=this.height}},computed:{w(){return this.size==="large"?110:72}},watch:{bgColor(){this.duration=1e-6,this.innerH=0,this.$setTimeout(()=>{this.duration=400,this.innerH=this.height},200)},size(){this.duration=1e-6,this.innerH=0,this.$setTimeout(()=>{this.duration=400,this.innerH=this.height},100)}}}),Ar={color1:"#475569",color2:"#64748b",color3:"#cbd5e1",color4:"#38bdf8",bg:"#1e293b80"},Mr={color1:"#f8fafc",color2:"#e2e8f0",color3:"#1e293b",color4:"#0369a1",bg:"#f1f5f9"},Lr=H.Component("Theming",{components:{Bar:Er,Toggle:Rr},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=1920,l.h=1080,t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.y=1020,i.x=1160,i.size=28,i.content='Use "up", "down", "left" and "right" to change the appearance',typeof r<"u")for(let D in r.config.props)delete i[r.config.props[D]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.y=1020,f.x=1160,f.size=28,f.color=e.colors.color4,f.content='Use "up", "down", "left" and "right" to change the appearance',!t[2]){const D=f.is||"Text";t[2]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Text not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const c={};t[3].nodeId||t[3].populate(c),o=t[3],t[4]||(t[4]=this.element({parent:o||"root"},e));const a={};a.x=-250,a.y=-100,a.src="assets/shadow.png",a.w=1e3,a.h=900,a.alpha=.5,t[4].nodeId||t[4].populate(a),o=t[3],t[5]||(t[5]=this.element({parent:o||"root"},e));const d={};t[5].nodeId||t[5].populate(d),o=t[5],t[6]||(t[6]=this.element({parent:o||"root"},e));const m={};m.h=100,t[6].nodeId||t[6].populate(m),o=t[5],t[7]||(t[7]=this.element({parent:o||"root"},e));const p={};p.h=80,p.y=20,t[7].nodeId||t[7].populate(p);const h=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[5],t[8]||(t[8]=this.element({parent:o||"root"},e));const y={};if(y.size=28,y.x=20,y.y=14,typeof h<"u")for(let D in h.config.props)delete y[h.config.props[D]];t[8].nodeId||t[8].populate(y),o=t[8];const g={};if(g.content=e.text,g.color=e.colors.color3,g.size=28,g.x=20,g.y=14,!t[9]){const D=g.is||"Text";t[9]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Text not found")})).call(null,{props:g},t[8],e),t[9][Symbol.for("slots")][0]?(o=t[9][Symbol.for("slots")][0],e=t[9]):o=t[9][Symbol.for("children")][0]}const x=s.components&&s.components.Toggle||e[Symbol.for("components")].Toggle;o=t[5],t[10]||(t[10]=this.element({parent:o||"root"},e));const _={};if(_.primaryColor="#22c55e",typeof x<"u")for(let D in x.config.props)delete _[x.config.props[D]];t[10].nodeId||t[10].populate(_),o=t[10];const S={};if(S.x={transition:e.width-120},S.on=e.mode==="dark",S.bgColor=e.colors.color1,S.primaryColor="#22c55e",!t[11]){const D=S.is||"Toggle";t[11]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Toggle not found")})).call(null,{props:S},t[10],e),t[11][Symbol.for("slots")][0]?(o=t[11][Symbol.for("slots")][0],e=t[11]):o=t[11][Symbol.for("children")][0]}o=t[3],t[12]||(t[12]=this.element({parent:o||"root"},e));const I={};I.w=200,I.x=25,I.y=140,t[12].nodeId||t[12].populate(I),o=t[3],t[13]||(t[13]=this.element({parent:o||"root"},e));const v={};v.x=270,t[13].nodeId||t[13].populate(v),o=t[3],t[14]||(t[14]=this.element({parent:o||"root"},e));const P={};P.color="0x00000000",t[14].nodeId||t[14].populate(P),o=t[14],t[15]||(t[15]=this.element({parent:o||"root"},e));const b={};t[15].nodeId||t[15].populate(b);const k=s.components&&s.components.Bar||e[Symbol.for("components")].Bar;o=t[15],t[16]||(t[16]=this.element({parent:o||"root"},e));const L={};if(L.height=100,L.index=0,typeof k<"u")for(let D in k.config.props)delete L[k.config.props[D]];t[16].nodeId||t[16].populate(L),o=t[16];const F={};if(F.bgColor=e.colors.color2,F.primaryColor=e.colors.color4,F.size=e.graph.size,F.height=100,F.index=0,!t[17]){const D=F.is||"Bar";t[17]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Bar not found")})).call(null,{props:F},t[16],e),t[17][Symbol.for("slots")][0]?(o=t[17][Symbol.for("slots")][0],e=t[17]):o=t[17][Symbol.for("children")][0]}const R=s.components&&s.components.Bar||e[Symbol.for("components")].Bar;o=t[15],t[18]||(t[18]=this.element({parent:o||"root"},e));const N={};if(N.height=140,N.index=1,typeof R<"u")for(let D in R.config.props)delete N[R.config.props[D]];t[18].nodeId||t[18].populate(N),o=t[18];const O={};if(O.bgColor=e.colors.color2,O.primaryColor=e.colors.color4,O.size=e.graph.size,O.height=140,O.index=1,!t[19]){const D=O.is||"Bar";t[19]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Bar not found")})).call(null,{props:O},t[18],e),t[19][Symbol.for("slots")][0]?(o=t[19][Symbol.for("slots")][0],e=t[19]):o=t[19][Symbol.for("children")][0]}const $=s.components&&s.components.Bar||e[Symbol.for("components")].Bar;o=t[15],t[20]||(t[20]=this.element({parent:o||"root"},e));const B={};if(B.height=170,B.index=2,typeof $<"u")for(let D in $.config.props)delete B[$.config.props[D]];t[20].nodeId||t[20].populate(B),o=t[20];const T={};if(T.bgColor=e.colors.color2,T.primaryColor=e.colors.color4,T.size=e.graph.size,T.height=170,T.index=2,!t[21]){const D=T.is||"Bar";t[21]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Bar not found")})).call(null,{props:T},t[20],e),t[21][Symbol.for("slots")][0]?(o=t[21][Symbol.for("slots")][0],e=t[21]):o=t[21][Symbol.for("children")][0]}const w=s.components&&s.components.Bar||e[Symbol.for("components")].Bar;o=t[15],t[22]||(t[22]=this.element({parent:o||"root"},e));const A={};if(A.height=150,A.index=3,typeof w<"u")for(let D in w.config.props)delete A[w.config.props[D]];t[22].nodeId||t[22].populate(A),o=t[22];const z={};if(z.bgColor=e.colors.color2,z.primaryColor=e.colors.color4,z.size=e.graph.size,z.height=150,z.index=3,!t[23]){const D=z.is||"Bar";t[23]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Bar not found")})).call(null,{props:z},t[22],e),t[23][Symbol.for("slots")][0]?(o=t[23][Symbol.for("slots")][0],e=t[23]):o=t[23][Symbol.for("children")][0]}const M=s.components&&s.components.Bar||e[Symbol.for("components")].Bar;o=t[15],t[24]||(t[24]=this.element({parent:o||"root"},e));const E={};if(E.height=90,E.index=4,typeof M<"u")for(let D in M.config.props)delete E[M.config.props[D]];t[24].nodeId||t[24].populate(E),o=t[24];const Y={};if(Y.bgColor=e.colors.color2,Y.primaryColor=e.colors.color4,Y.size=e.graph.size,Y.height=90,Y.index=4,!t[25]){const D=Y.is||"Bar";t[25]=(s.components&&s.components[D]||e[Symbol.for("components")][D]||(()=>{console.error("component Bar not found")})).call(null,{props:Y},t[24],e),t[25][Symbol.for("slots")][0]?(o=t[25][Symbol.for("slots")][0],e=t[25]):o=t[25][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("color",{transition:o.colors.bg})},function(o,e,s){e[1].set("color",o.colors.color4)},function(o,e,s){e[2][Symbol.for("props")].color=o.colors.color4},function(o,e,s){e[3].set("x",{transition:(1920-o.width)/2})},function(o,e,s){e[3].set("y",{transition:(1080-o.height)/2})},function(o,e,s){e[5].set("w",{transition:o.width})},function(o,e,s){e[5].set("h",{transition:o.height})},function(o,e,s){e[5].set("color",o.colors.color1)},function(o,e,s){e[5].set("effects",[o.shader("radius",{radius:o.radius})])},function(o,e,s){e[6].set("w",{transition:o.width})},function(o,e,s){e[6].set("color",o.colors.color2)},function(o,e,s){e[6].set("effects",[o.shader("radius",{radius:o.radius})])},function(o,e,s){e[7].set("w",{transition:o.width})},function(o,e,s){e[7].set("color",o.colors.color2)},function(o,e,s){e[8].set("content",o.text)},function(o,e,s){e[8].set("color",o.colors.color3)},function(o,e,s){e[9][Symbol.for("props")].content=o.text},function(o,e,s){e[9][Symbol.for("props")].color=o.colors.color3},function(o,e,s){e[10].set("x",{transition:o.width-120})},function(o,e,s){e[10].set("on",o.mode==="dark")},function(o,e,s){e[10].set("bgColor",o.colors.color1)},function(o,e,s){e[11][Symbol.for("props")].x={transition:o.width-120}},function(o,e,s){e[11][Symbol.for("props")].on=o.mode==="dark"},function(o,e,s){e[11][Symbol.for("props")].bgColor=o.colors.color1},function(o,e,s){e[12].set("h",{transition:o.block1.height})},function(o,e,s){e[12].set("color",o.colors.color2)},function(o,e,s){e[12].set("effects",[o.shader("radius",{radius:o.radius/2})])},function(o,e,s){e[13].set("w",{transition:o.block2.w})},function(o,e,s){e[13].set("h",o.block2.h)},function(o,e,s){e[13].set("y",{transition:o.block2.y})},function(o,e,s){e[13].set("color",o.colors.color2)},function(o,e,s){e[13].set("effects",[o.shader("radius",{radius:o.radius/2})])},function(o,e,s){e[14].set("x",{transition:o.graph.x})},function(o,e,s){e[14].set("y",{transition:o.graph.y})},function(o,e,s){e[14].set("w",o.graph.w)},function(o,e,s){e[14].set("h",o.graph.h)},function(o,e,s){e[15].set("x",{transition:o.graph.offset})},function(o,e,s){e[15].set("y",{transition:o.graph.offset})},function(o,e,s){e[16].set("bgColor",o.colors.color2)},function(o,e,s){e[16].set("primaryColor",o.colors.color4)},function(o,e,s){e[16].set("size",o.graph.size)},function(o,e,s){e[17][Symbol.for("props")].bgColor=o.colors.color2},function(o,e,s){e[17][Symbol.for("props")].primaryColor=o.colors.color4},function(o,e,s){e[17][Symbol.for("props")].size=o.graph.size},function(o,e,s){e[18].set("bgColor",o.colors.color2)},function(o,e,s){e[18].set("primaryColor",o.colors.color4)},function(o,e,s){e[18].set("size",o.graph.size)},function(o,e,s){e[19][Symbol.for("props")].bgColor=o.colors.color2},function(o,e,s){e[19][Symbol.for("props")].primaryColor=o.colors.color4},function(o,e,s){e[19][Symbol.for("props")].size=o.graph.size},function(o,e,s){e[20].set("bgColor",o.colors.color2)},function(o,e,s){e[20].set("primaryColor",o.colors.color4)},function(o,e,s){e[20].set("size",o.graph.size)},function(o,e,s){e[21][Symbol.for("props")].bgColor=o.colors.color2},function(o,e,s){e[21][Symbol.for("props")].primaryColor=o.colors.color4},function(o,e,s){e[21][Symbol.for("props")].size=o.graph.size},function(o,e,s){e[22].set("bgColor",o.colors.color2)},function(o,e,s){e[22].set("primaryColor",o.colors.color4)},function(o,e,s){e[22].set("size",o.graph.size)},function(o,e,s){e[23][Symbol.for("props")].bgColor=o.colors.color2},function(o,e,s){e[23][Symbol.for("props")].primaryColor=o.colors.color4},function(o,e,s){e[23][Symbol.for("props")].size=o.graph.size},function(o,e,s){e[24].set("bgColor",o.colors.color2)},function(o,e,s){e[24].set("primaryColor",o.colors.color4)},function(o,e,s){e[24].set("size",o.graph.size)},function(o,e,s){e[25][Symbol.for("props")].bgColor=o.colors.color2},function(o,e,s){e[25][Symbol.for("props")].primaryColor=o.colors.color4},function(o,e,s){e[25][Symbol.for("props")].size=o.graph.size}],context:{}},state(){return{mode:"dark",radius:20,width:500,height:600}},computed:{colors(){return this.mode==="dark"?Ar:Mr},text(){return this.mode==="dark"?"Dark mode":"Light mode"},block1(){return{height:this.height===600?180:720}},block2(){return{y:this.height===600?140:560,h:this.height===600?180:300,w:this.height===600?200:890}},graph(){return{x:this.height===600?32:270,y:this.height===600?370:140,w:this.height===600?0:890,h:this.height===600?0:400,offset:this.height===600?0:110,size:this.height===600?"small":"large"}}},input:{right(){this.toggleX=0,this.$setTimeout(()=>{this.mode="light"},150)},left(){this.toggleX=48,this.$setTimeout(()=>{this.mode="dark"},150)},up(){this.width=1200,this.height=900},down(){this.width=500,this.height=600}}}),Br="ABC123",Pr="https://8b4fa39d.lightningjs.workers.dev";let Os,$s;const Nr="w185",Fr={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Br}};function Zo(n,o=Nr){return $s+o+n}function zr(...n){return Os?go(...n):Ds().then(()=>go(...n))}function go(n,o={}){return fetch(Pr+n,{...Fr,...o}).then(e=>e.json())}function Ds(){return go("/configuration").then(n=>(Os=n,$s=n.images.secure_base_url,n))}const Ro={get:zr,loadConfig:Ds},Qo=n=>Ro.get(`/${n}/popular`).then(Us),Us=n=>n.results.filter(e=>!e.adult).map(e=>({poster:Zo(e.poster_path||e.profile_path),background:Zo(e.backdrop_path,"w1280"),identifier:e.id,title:e.title||e.name,overview:e.overview})),ot=n=>{const o=Array.isArray(n)?n:[n];return Or("movie").then(({genres:e})=>{let s=[];return e.forEach(t=>{o.includes(t.name)&&s.push(t.id)}),Ro.get(`/discover/movie?with_genres=${s.join()}`).then(Us)})},Or=n=>Ro.get(`/genre/${n}/list`),$r=H.Component("Poster",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=1280,l.h=720,l.x=e.x,l.color="{top: '0xffffffff', bottom: '0x000000ff'}",t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};t[1].nodeId||t[1].populate(r),o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=185,i.h=278,i.x=54,i.y=220,t[2].nodeId||t[2].populate(i);const f=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[1],t[3]||(t[3]=this.element({parent:o||"root"},e));const c={};if(c.font="raleway",c.y=520,c.x=54,c.size=64,c.wordwrap=1e3,c.maxlines=1,typeof f<"u")for(let h in f.config.props)delete c[f.config.props[h]];t[3].nodeId||t[3].populate(c),o=t[3];const a={};if(a.content=e.item.title,a.font="raleway",a.y=520,a.x=54,a.size=64,a.wordwrap=1e3,a.maxlines=1,!t[4]){const h=a.is||"Text";t[4]=(s.components&&s.components[h]||e[Symbol.for("components")][h]||(()=>{console.error("component Text not found")})).call(null,{props:a},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}const d=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[1],t[5]||(t[5]=this.element({parent:o||"root"},e));const m={};if(m.size=21,m.y=620,m.x=60,m.color="0xccccccff",m.wordwrap=1e3,m.maxlines=2,m.lineheight=36,typeof d<"u")for(let h in d.config.props)delete m[d.config.props[h]];t[5].nodeId||t[5].populate(m),o=t[5];const p={};if(p.content=e.item.overview,p.size=21,p.y=620,p.x=60,p.color="0xccccccff",p.wordwrap=1e3,p.maxlines=2,p.lineheight=36,!t[6]){const h=p.is||"Text";t[6]=(s.components&&s.components[h]||e[Symbol.for("components")][h]||(()=>{console.error("component Text not found")})).call(null,{props:p},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("src",o.item.background)},function(o,e,s){e[0].set("scale",{transition:{value:o.scale,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(o,e,s){e[0].set("_effects",[o.shader("radius",{radius:8})])},function(o,e,s){e[1].set("alpha",{transition:{value:o.alpha,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(o,e,s){e[2].set("src",o.item.poster)},function(o,e,s){e[3].set("content",o.item.title)},function(o,e,s){e[4][Symbol.for("props")].content=o.item.title},function(o,e,s){e[5].set("content",o.item.overview)},function(o,e,s){e[6][Symbol.for("props")].content=o.item.overview}],context:{}},props:["src","index","item","width"],state(){return{scale:1,zIndex:1,alpha:0}},computed:{x(){return this.index*this.width}},hooks:{focus(){this.scale=1.1,this.alpha=1},unfocus(){this.scale=1,this.alpha=0}}}),Dr=H.Component("Poster",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return l.w=185,l.h=278,l.x=e.x,t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){e[0].set("src",o.item.poster)},function(o,e,s){e[0].set("scale",{transition:{value:o.scale,duration:200,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(o,e,s){e[0].set("_effects",[o.shader("radius",{radius:8})])}],context:{}},props:["src","index","item","width"],state(){return{scale:1,color:"#333"}},computed:{x(){return this.index*this.width}},hooks:{focus(){this.color="#fff",this.scale=1.1},unfocus(){this.color="#333",this.scale=1}}}),Ur=H.Component("PosterTitle",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=185,l.h=278,l.x=e.x,t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.x=10,t[1].nodeId||t[1].populate(r);const i=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const f={};if(f.font="raleway",f.size=22,f.wordwrap=185,f.maxlines=2,f.lineheight=28,typeof i<"u")for(let a in i.config.props)delete f[i.config.props[a]];t[2].nodeId||t[2].populate(f),o=t[2];const c={};if(c.content=e.item.title,c.font="raleway",c.size=22,c.wordwrap=185,c.maxlines=2,c.lineheight=28,!t[3]){const a=c.is||"Text";t[3]=(s.components&&s.components[a]||e[Symbol.for("components")][a]||(()=>{console.error("component Text not found")})).call(null,{props:c},t[2],e),t[3][Symbol.for("slots")][0]?(o=t[3][Symbol.for("slots")][0],e=t[3]):o=t[3][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("src",o.item.poster)},function(o,e,s){e[0].set("scale",{transition:{value:o.scale,duration:200,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(o,e,s){e[0].set("_effects",[o.shader("radius",{radius:8})])},function(o,e,s){e[1].set("y",{transition:{value:o.y,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(o,e,s){e[1].set("alpha",{transition:{value:o.alpha,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(o,e,s){e[2].set("content",o.item.title)},function(o,e,s){e[3][Symbol.for("props")].content=o.item.title}],context:{}},props:["src","index","item","width"],state(){return{scale:1,alpha:0,y:278}},computed:{x(){return this.index*this.width}},hooks:{focus(){this.scale=1.1,this.alpha=1,this.y=288},unfocus(){this.scale=1,this.alpha=0,this.y=278}}}),Xr=H.Component("TmdbRow",{components:{Hero:$r,Poster:Dr,PosterTitle:Ur},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};return r.y=80,t[1].nodeId||t[1].populate(r),t},effects:[function(o,e,s){e[1].set("x",{transition:{value:o.x,duration:300,easing:"ease-in-out"}})},function(o,e,s){parent=e[1];const t=o.items||[],l=[];for(let r=0;r{console.error("component Component not found")})).call(null,{props:a},e[2][i.item.identifier],o),e[3][i.item.identifier][Symbol.for("slots")][0]?(parent=e[3][i.item.identifier][Symbol.for("slots")][0],o=e[3][i.item.identifier]):parent=e[3][i.item.identifier][Symbol.for("children")][0]}}e[2]&&Object.keys(e[2]).forEach(r=>{l.indexOf(r)===-1&&(e[2][r].destroy&&e[2][r].destroy(),delete e[1][r])})}],context:{}},props:["title","type","items","width"],state(){return{focused:0,offset:0}},hooks:{focus(){this.$trigger("focused")}},computed:{x(){return 150-Math.min(this.focused,this.items.length-1720/this.width)*this.width}},watch:{focused(n){const o=this.select("poster"+n);o&&o.focus&&(o.focus(),this.$emit("posterSelect",this.items[n]))}},input:{left(){this.focused=Math.max(this.focused-1,0)},right(){this.focused=Math.min(this.focused+1,this.items.length-1)}}}),Wr=H.Component("Background",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=1920,r.h=1080,r.color="{top: '0xffffffff', bottom: '0x000000ff'}",t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=1920,i.h=1080,i.color="{top: '0xffffffff', bottom: '0x000000ff'}",t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};return f.w=1920,f.h=1080,f.src="assets/gradient.png",f.color="0x8866ddff",f.alpha=.8,t[3].nodeId||t[3].populate(f),t},effects:[function(o,e,s){e[1].set("src",o.bg1)},function(o,e,s){e[1].set("alpha",{transition:{value:o.alpha1,duration:400,easing:"ease-in"}})},function(o,e,s){e[2].set("src",o.bg2)},function(o,e,s){e[2].set("alpha",{transition:{value:o.alpha2,duration:400,easing:"ease-in"}})}],context:{}},props:["src"],state(){return{counter:0,alpha1:0,alpha2:0,bg1:!1,bg2:!1}},watch:{src(n){this.counter=(this.counter+1)%2,this.counter===0?(this.bg1=n,this.alpha1=.8,this.alpha2=0):(this.bg2=n,this.alpha1=0,this.alpha2=.8)}}}),Yr=H.Component("TMdb",{components:{Background:Wr,TmdbRow:Xr},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=1920,l.h=1080,l.color="0x000000ff",t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Background||e[Symbol.for("components")].Background;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(typeof r<"u")for(let S in r.config.props)delete i[r.config.props[S]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.src=e.src,!t[2]){const S=f.is||"Background";t[2]=(s.components&&s.components[S]||e[Symbol.for("components")][S]||(()=>{console.error("component Background not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const c={};t[3].nodeId||t[3].populate(c),o=t[3],t[4]||(t[4]=this.element({parent:o||"root"},e));const a={};t[4].nodeId||t[4].populate(a),o=t[4],t[5]||(t[5]=this.element({parent:o||"root"},e));const d={};d.src="assets/logo.png",d.x=140,d.y=90,d.w=243,d.h=52,t[5].nodeId||t[5].populate(d);const m=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[4],t[6]||(t[6]=this.element({parent:o||"root"},e));const p={};if(p.font="raleway",p.size=80,p.x=140,p.y=300,p.wordwrap=1e3,p["@loaded"]=e.positionText&&e.positionText.bind(e),p.maxlines=1,typeof m<"u")for(let S in m.config.props)delete p[m.config.props[S]];t[6].nodeId||t[6].populate(p),o=t[6];const h={};if(h.content=e.title,h.font="raleway",h.size=80,h.x=140,h.y=300,h.wordwrap=1e3,h["@loaded"]=e.positionText&&e.positionText.bind(e),h.maxlines=1,!t[7]){const S=h.is||"Text";t[7]=(s.components&&s.components[S]||e[Symbol.for("components")][S]||(()=>{console.error("component Text not found")})).call(null,{props:h},t[6],e),t[7][Symbol.for("slots")][0]?(o=t[7][Symbol.for("slots")][0],e=t[7]):o=t[7][Symbol.for("children")][0]}const y=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[4],t[8]||(t[8]=this.element({parent:o||"root"},e));const g={};if(g.wordwrap=880,g.x=140,g.y=430,g.lineheight=40,g.maxlines=3,typeof y<"u")for(let S in y.config.props)delete g[y.config.props[S]];t[8].nodeId||t[8].populate(g),o=t[8];const x={};if(x.content=e.overview,x.wordwrap=880,x.x=140,x.y=430,x.lineheight=40,x.maxlines=3,!t[9]){const S=x.is||"Text";t[9]=(s.components&&s.components[S]||e[Symbol.for("components")][S]||(()=>{console.error("component Text not found")})).call(null,{props:x},t[8],e),t[9][Symbol.for("slots")][0]?(o=t[9][Symbol.for("slots")][0],e=t[9]):o=t[9][Symbol.for("children")][0]}o=t[3],t[10]||(t[10]=this.element({parent:o||"root"},e));const _={};return t[10].nodeId||t[10].populate(_),t},effects:[function(o,e,s){e[1].set("src",o.src)},function(o,e,s){e[2][Symbol.for("props")].src=o.src},function(o,e,s){e[4].set("y",{transition:{value:o.contentY,duration:o.duration}})},function(o,e,s){e[4].set("alpha",{transition:{value:o.alpha,duration:o.duration}})},function(o,e,s){e[6].set("content",o.title)},function(o,e,s){e[7][Symbol.for("props")].content=o.title},function(o,e,s){e[8].set("content",o.overview)},function(o,e,s){e[9][Symbol.for("props")].content=o.overview},function(o,e,s){e[10].set("y",{transition:{value:o.y,duration:300,easing:"cubic-bezier(0.20, 1.00, 0.80, 1.00)"}})},function(o,e,s){parent=e[10];const t=o.rows||[],l=[];for(let r=0;r{console.error("component TmdbRow not found")})).call(null,{props:a},e[11][i.row.title],o),e[12][i.row.title][Symbol.for("slots")][0]?(parent=e[12][i.row.title][Symbol.for("slots")][0],o=e[12][i.row.title]):parent=e[12][i.row.title][Symbol.for("children")][0]}e[11][i.row.title].set("items",i.row.items),e[11][i.row.title].set("type",i.row.type),e[11][i.row.title].set("width",i.row.width),e[12][i.row.title][Symbol.for("props")].items=i.row.items,e[12][i.row.title][Symbol.for("props")].type=i.row.type,e[12][i.row.title][Symbol.for("props")].width=i.row.width}e[11]&&Object.keys(e[11]).forEach(r=>{l.indexOf(r)===-1&&(e[11][r].destroy&&e[11][r].destroy(),delete e[1][r])})}],context:{}},state(){return{rows:[],items:[],src:"",focused:null,alpha:1,y:550,contentY:0,scale:1,title:"",overview:"",type:"Poster",duration:300}},watch:{focused(n){const o=this.select("row"+n);o&&o.focus&&o.focus()}},hooks:{async ready(){this.$listen("posterSelect",n=>{this.focused===0&&(this.src=n.background,this.title=n.title,this.overview=n.overview)}),this.rows.push({title:"Popular Movies",items:await Qo("movie"),type:"Poster",width:215,y:0}),this.rows.push({title:"Best Western movies",items:await ot(["Western"]),type:"Hero",width:1370,y:358}),this.rows.push({title:"Best Comedy movies",items:await ot(["Comedy"]),type:"PosterTitle",width:215,y:1158}),this.rows.push({title:"Popular TV shows",items:await Qo("tv"),type:"PosterTitle",width:215,y:1536}),this.rows.push({title:"Best Adventure and Action movies",items:await ot(["adventure","action"]),type:"Hero",width:1370,y:1914}),this.rows.push({title:"Best Documentaries",items:await ot("Documentary"),type:"PosterTitle",width:215,y:2714}),this.rows.push({title:"Best Western movies 2",items:await ot("Western"),type:"PosterTitle",width:215,y:3092}),this.focused=0},focus(){this.$trigger("focused")}},input:{up(){this.contentY=0,this.duration=300,this.focused=Math.max(this.focused-1,0),this.y=(this.focused===0?550:90)-this.rows[this.focused].y,this.alpha=this.focused===0?1:0},down(){this.contentY=-60,this.duration=200,this.focused=Math.min(this.focused+1,this.rows.length-1),this.y=(this.focused===0?550:90)-this.rows[this.focused].y,this.alpha=this.focused===0?1:0}}}),Gr=H.Component("MenuSprite",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};t[1].nodeId||t[1].populate(r),o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.src="assets/menusprite.png",i.x=748,i.y=120,i.w=425,i.h=340,t[2].nodeId||t[2].populate(i),o=t[1],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.y=680,f.x=560,t[3].nodeId||t[3].populate(f);const c=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[3],t[4]||(t[4]=this.element({parent:o||"root"},e));const a={};if(a.image="assets/menusprite.png",a.x=0,a.w=140,a.h=140,a.map=e.map,typeof c<"u")for(let v in c.config.props)delete a[c.config.props[v]];t[4].nodeId||t[4].populate(a),o=t[4];const d={};if(d.image="assets/menusprite.png",d.x=0,d.w=140,d.h=140,d.map=e.map,d.frame=e.icon1,!t[5]){const v=d.is||"Sprite";t[5]=(s.components&&s.components[v]||e[Symbol.for("components")][v]||(()=>{console.error("component Sprite not found")})).call(null,{props:d},t[4],e),t[5][Symbol.for("slots")][0]?(o=t[5][Symbol.for("slots")][0],e=t[5]):o=t[5][Symbol.for("children")][0]}const m=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[3],t[6]||(t[6]=this.element({parent:o||"root"},e));const p={};if(p.image="assets/menusprite.png",p.x=220,p.w=140,p.h=140,p.map=e.map,p.frame="icon2",typeof m<"u")for(let v in m.config.props)delete p[m.config.props[v]];t[6].nodeId||t[6].populate(p),o=t[6];const h={};if(h.image="assets/menusprite.png",h.x=220,h.w=140,h.h=140,h.map=e.map,h.frame="icon2",!t[7]){const v=h.is||"Sprite";t[7]=(s.components&&s.components[v]||e[Symbol.for("components")][v]||(()=>{console.error("component Sprite not found")})).call(null,{props:h},t[6],e),t[7][Symbol.for("slots")][0]?(o=t[7][Symbol.for("slots")][0],e=t[7]):o=t[7][Symbol.for("children")][0]}const y=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[3],t[8]||(t[8]=this.element({parent:o||"root"},e));const g={};if(g.image="assets/menusprite.png",g.x=440,g.w=140,g.h=140,g.map=e.map,g.frame="icon3",typeof y<"u")for(let v in y.config.props)delete g[y.config.props[v]];t[8].nodeId||t[8].populate(g),o=t[8];const x={};if(x.image="assets/menusprite.png",x.x=440,x.w=140,x.h=140,x.map=e.map,x.frame="icon3",!t[9]){const v=x.is||"Sprite";t[9]=(s.components&&s.components[v]||e[Symbol.for("components")][v]||(()=>{console.error("component Sprite not found")})).call(null,{props:x},t[8],e),t[9][Symbol.for("slots")][0]?(o=t[9][Symbol.for("slots")][0],e=t[9]):o=t[9][Symbol.for("children")][0]}const _=s.components&&s.components.Sprite||e[Symbol.for("components")].Sprite;o=t[3],t[10]||(t[10]=this.element({parent:o||"root"},e));const S={};if(S.image="assets/menusprite.png",S.x=660,S.w=140,S.h=140,S.map=e.map,S.frame="icon4_unfocus",typeof _<"u")for(let v in _.config.props)delete S[_.config.props[v]];t[10].nodeId||t[10].populate(S),o=t[10];const I={};if(I.image="assets/menusprite.png",I.x=660,I.w=140,I.h=140,I.map=e.map,I.frame="icon4_unfocus",!t[11]){const v=I.is||"Sprite";t[11]=(s.components&&s.components[v]||e[Symbol.for("components")][v]||(()=>{console.error("component Sprite not found")})).call(null,{props:I},t[10],e),t[11][Symbol.for("slots")][0]?(o=t[11][Symbol.for("slots")][0],e=t[11]):o=t[11][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[4].set("frame",o.icon1)},function(o,e,s){e[5][Symbol.for("props")].frame=o.icon1}],context:{}},state(){return{icon1:"icon1_unfocus",map:{defaults:{w:160,h:160},frames:{icon1_focus:{x:0,y:0},icon1_unfocus:{x:170,y:340},icon2:{x:170,y:0},icon3:{x:350,y:0},icon4_unfocus:{x:680,y:170}}}}},hooks:{ready(){this.$setInterval(()=>{this.icon1=this.icon1==="icon1_unfocus"?"icon1_focus":"icon1_unfocus"},2e3)}}}),At=["menu"],Hr=H.Component("Sprites",{components:{MenuSprite:Gr},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.MenuSprite||e[Symbol.for("components")].MenuSprite;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(typeof r<"u")for(let c in r.config.props)delete i[r.config.props[c]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.show=e.currentSprite==="menu",!t[2]){const c=f.is||"MenuSprite";t[2]=(s.components&&s.components[c]||e[Symbol.for("components")][c]||(()=>{console.error("component MenuSprite not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[1].set("show",o.currentSprite==="menu")},function(o,e,s){e[2][Symbol.for("props")].show=o.currentSprite==="menu"}],context:{}},state(){return{currentSprite:"menu"}},input:{down(){const n=At.indexOf(this.currentSprite);n{console.error("component Button not found")})).call(null,{props:c},t[2],e),t[3][Symbol.for("slots")][0]?(o=t[3][Symbol.for("slots")][0],e=t[3]):o=t[3][Symbol.for("children")][0]}const a=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const d={};if(d.color="0xe4e4e7ff",d.y=100,d.ref="menu2",typeof a<"u")for(let S in a.config.props)delete d[a.config.props[S]];t[4].nodeId||t[4].populate(d),o=t[4];const m={};if(m.color="0xe4e4e7ff",m.y=100,m.ref="menu2",!t[5]){const S=m.is||"Button";t[5]=(s.components&&s.components[S]||e[Symbol.for("components")][S]||(()=>{console.error("component Button not found")})).call(null,{props:m},t[4],e),t[5][Symbol.for("slots")][0]?(o=t[5][Symbol.for("slots")][0],e=t[5]):o=t[5][Symbol.for("children")][0]}const p=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[6]||(t[6]=this.element({parent:o||"root"},e));const h={};if(h.color="0xe4e4e7ff",h.y=200,h.ref="menu3",typeof p<"u")for(let S in p.config.props)delete h[p.config.props[S]];t[6].nodeId||t[6].populate(h),o=t[6];const y={};if(y.color="0xe4e4e7ff",y.y=200,y.ref="menu3",!t[7]){const S=y.is||"Button";t[7]=(s.components&&s.components[S]||e[Symbol.for("components")][S]||(()=>{console.error("component Button not found")})).call(null,{props:y},t[6],e),t[7][Symbol.for("slots")][0]?(o=t[7][Symbol.for("slots")][0],e=t[7]):o=t[7][Symbol.for("children")][0]}const g=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[8]||(t[8]=this.element({parent:o||"root"},e));const x={};if(x.color="0xe4e4e7ff",x.y=300,x.ref="menu4",typeof g<"u")for(let S in g.config.props)delete x[g.config.props[S]];t[8].nodeId||t[8].populate(x),o=t[8];const _={};if(_.color="0xe4e4e7ff",_.y=300,_.ref="menu4",!t[9]){const S=_.is||"Button";t[9]=(s.components&&s.components[S]||e[Symbol.for("components")][S]||(()=>{console.error("component Button not found")})).call(null,{props:_},t[8],e),t[9][Symbol.for("slots")][0]?(o=t[9][Symbol.for("slots")][0],e=t[9]):o=t[9][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("x",{transition:o.x})}],context:{}},state(){return{x:-360,focused:1}},hooks:{focus(){this.$trigger("focused"),this.x=0}},watch:{focused(){const n=this.select(`menu${this.focused}`);n&&n.focus&&n.focus()}},input:{right(){this.parent.focus(),this.x=-360},down(){this.focused=Math.min(this.focused+1,4)},up(){this.focused=Math.max(this.focused-1,1)},left(){}}}),qr=H.Component("FocusHandling",{components:{Menu:Vr,Button:Xs},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.x=300,r.y=150,t[1].nodeId||t[1].populate(r);const i=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const f={};if(f.color="0xef4444ff",f.x=0,f.ref="button1",typeof i<"u")for(let E in i.config.props)delete f[i.config.props[E]];t[2].nodeId||t[2].populate(f),o=t[2];const c={};if(c.color="0xef4444ff",c.x=0,c.ref="button1",!t[3]){const E=c.is||"Button";t[3]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:c},t[2],e),t[3][Symbol.for("slots")][0]?(o=t[3][Symbol.for("slots")][0],e=t[3]):o=t[3][Symbol.for("children")][0]}const a=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const d={};if(d.color="0xf97316ff",d.x=320,d.ref="button2",typeof a<"u")for(let E in a.config.props)delete d[a.config.props[E]];t[4].nodeId||t[4].populate(d),o=t[4];const m={};if(m.color="0xf97316ff",m.x=320,m.ref="button2",!t[5]){const E=m.is||"Button";t[5]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:m},t[4],e),t[5][Symbol.for("slots")][0]?(o=t[5][Symbol.for("slots")][0],e=t[5]):o=t[5][Symbol.for("children")][0]}const p=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[6]||(t[6]=this.element({parent:o||"root"},e));const h={};if(h.color="0x84cc16ff",h.x=640,h.ref="button3",typeof p<"u")for(let E in p.config.props)delete h[p.config.props[E]];t[6].nodeId||t[6].populate(h),o=t[6];const y={};if(y.color="0x84cc16ff",y.x=640,y.ref="button3",!t[7]){const E=y.is||"Button";t[7]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:y},t[6],e),t[7][Symbol.for("slots")][0]?(o=t[7][Symbol.for("slots")][0],e=t[7]):o=t[7][Symbol.for("children")][0]}const g=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[8]||(t[8]=this.element({parent:o||"root"},e));const x={};if(x.color="0x10b981ff",x.x=0,x.y=100,x.ref="button4",typeof g<"u")for(let E in g.config.props)delete x[g.config.props[E]];t[8].nodeId||t[8].populate(x),o=t[8];const _={};if(_.color="0x10b981ff",_.x=0,_.y=100,_.ref="button4",!t[9]){const E=_.is||"Button";t[9]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:_},t[8],e),t[9][Symbol.for("slots")][0]?(o=t[9][Symbol.for("slots")][0],e=t[9]):o=t[9][Symbol.for("children")][0]}const S=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[10]||(t[10]=this.element({parent:o||"root"},e));const I={};if(I.color="0x06b6d4ff",I.y=100,I.x=320,I.ref="button5",typeof S<"u")for(let E in S.config.props)delete I[S.config.props[E]];t[10].nodeId||t[10].populate(I),o=t[10];const v={};if(v.color="0x06b6d4ff",v.y=100,v.x=320,v.ref="button5",!t[11]){const E=v.is||"Button";t[11]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:v},t[10],e),t[11][Symbol.for("slots")][0]?(o=t[11][Symbol.for("slots")][0],e=t[11]):o=t[11][Symbol.for("children")][0]}const P=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[12]||(t[12]=this.element({parent:o||"root"},e));const b={};if(b.color="0x3b82f6ff",b.y=100,b.x=640,b.ref="button6",typeof P<"u")for(let E in P.config.props)delete b[P.config.props[E]];t[12].nodeId||t[12].populate(b),o=t[12];const k={};if(k.color="0x3b82f6ff",k.y=100,k.x=640,k.ref="button6",!t[13]){const E=k.is||"Button";t[13]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:k},t[12],e),t[13][Symbol.for("slots")][0]?(o=t[13][Symbol.for("slots")][0],e=t[13]):o=t[13][Symbol.for("children")][0]}const L=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[14]||(t[14]=this.element({parent:o||"root"},e));const F={};if(F.color="0x8b5cf6ff",F.y=200,F.x=0,F.ref="button7",typeof L<"u")for(let E in L.config.props)delete F[L.config.props[E]];t[14].nodeId||t[14].populate(F),o=t[14];const R={};if(R.color="0x8b5cf6ff",R.y=200,R.x=0,R.ref="button7",!t[15]){const E=R.is||"Button";t[15]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:R},t[14],e),t[15][Symbol.for("slots")][0]?(o=t[15][Symbol.for("slots")][0],e=t[15]):o=t[15][Symbol.for("children")][0]}const N=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[16]||(t[16]=this.element({parent:o||"root"},e));const O={};if(O.color="0xd946efff",O.y=200,O.x=320,O.ref="button8",typeof N<"u")for(let E in N.config.props)delete O[N.config.props[E]];t[16].nodeId||t[16].populate(O),o=t[16];const $={};if($.color="0xd946efff",$.y=200,$.x=320,$.ref="button8",!t[17]){const E=$.is||"Button";t[17]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:$},t[16],e),t[17][Symbol.for("slots")][0]?(o=t[17][Symbol.for("slots")][0],e=t[17]):o=t[17][Symbol.for("children")][0]}const B=s.components&&s.components.Button||e[Symbol.for("components")].Button;o=t[1],t[18]||(t[18]=this.element({parent:o||"root"},e));const T={};if(T.color="0xf43f5eff",T.y=200,T.x=640,T.ref="button9",typeof B<"u")for(let E in B.config.props)delete T[B.config.props[E]];t[18].nodeId||t[18].populate(T),o=t[18];const w={};if(w.color="0xf43f5eff",w.y=200,w.x=640,w.ref="button9",!t[19]){const E=w.is||"Button";t[19]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Button not found")})).call(null,{props:w},t[18],e),t[19][Symbol.for("slots")][0]?(o=t[19][Symbol.for("slots")][0],e=t[19]):o=t[19][Symbol.for("children")][0]}const A=s.components&&s.components.Menu||e[Symbol.for("components")].Menu;o=t[0],t[20]||(t[20]=this.element({parent:o||"root"},e));const z={};if(z.ref="menu",typeof A<"u")for(let E in A.config.props)delete z[A.config.props[E]];t[20].nodeId||t[20].populate(z),o=t[20];const M={};if(M.ref="menu",!t[21]){const E=M.is||"Menu";t[21]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Menu not found")})).call(null,{props:M},t[20],e),t[21][Symbol.for("slots")][0]?(o=t[21][Symbol.for("slots")][0],e=t[21]):o=t[21][Symbol.for("children")][0]}return t},effects:[],context:{}},state(){return{focused:1}},hooks:{focus(){this.$trigger("focused")}},watch:{focused(n){const o=this.select(`button${n}`);o&&o.focus&&o.focus()}},input:{right(){this.focused=Math.min(this.focused+1,9)},left(){const n=this.focused-1;if(n===0){const o=this.select("menu");o&&o.focus&&o.focus()}else this.focused=Math.max(n,1)},a(){const n=this.select("menu");n&&n.focus&&n.focus()}}}),jr=H.Component("Positioning",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=100,r.h=100,r.x=20,r.y=20,r.color="0xecfeffff",t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=100,i.h=100,i.x=140,i.y=20,i.color="0xa5f3fcff",t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.w=100,f.h=100,f.x=260,f.y=20,f.color="0x22d3eeff",t[3].nodeId||t[3].populate(f),o=t[0],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.w=100,c.h=100,c.x=380,c.y=20,c.color="0x0891b2ff",t[4].nodeId||t[4].populate(c),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.w=100,a.h=100,a.x=e.x1,a.y=e.y,a.color="0xfdf4ffff",t[5].nodeId||t[5].populate(a),o=t[0],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.w=100,d.h=100,d.x=e.x2,d.y=e.y,d.color="0xf5d0feff",t[6].nodeId||t[6].populate(d),o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};m.w=100,m.h=100,m.x=e.x3,m.y=e.y,m.color="0xe879f9ff",t[7].nodeId||t[7].populate(m),o=t[0],t[8]||(t[8]=this.element({parent:o||"root"},e));const p={};p.w=100,p.h=100,p.x=e.x4,p.y=e.y,p.color="0xc026d3ff",t[8].nodeId||t[8].populate(p),o=t[0],t[9]||(t[9]=this.element({parent:o||"root"},e));const h={};h.w=100,h.h=100,h.y=260,h.color="0xfff7edff",t[9].nodeId||t[9].populate(h),o=t[0],t[10]||(t[10]=this.element({parent:o||"root"},e));const y={};y.w=100,y.h=100,y.y=260,y.color="0xfed7aaff",t[10].nodeId||t[10].populate(y),o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const g={};g.w=100,g.h=100,g.y=260,g.color="0xfb923cff",t[11].nodeId||t[11].populate(g),o=t[0],t[12]||(t[12]=this.element({parent:o||"root"},e));const x={};x.w=100,x.h=100,x.y=260,x.color="0xea580cff",t[12].nodeId||t[12].populate(x),o=t[0],t[13]||(t[13]=this.element({parent:o||"root"},e));const _={};_.w=800,_.h=800,_.y=20,_.x=800,_.color="0xecfdf5ff",t[13].nodeId||t[13].populate(_),o=t[13],t[14]||(t[14]=this.element({parent:o||"root"},e));const S={};S.w=600,S.h=600,S.y=20,S.x=20,S.color="0xa7f3d0ff",t[14].nodeId||t[14].populate(S),o=t[14],t[15]||(t[15]=this.element({parent:o||"root"},e));const I={};I.w=400,I.h=400,I.y=100,I.x=20,I.color="0x34d399ff",t[15].nodeId||t[15].populate(I),o=t[15],t[16]||(t[16]=this.element({parent:o||"root"},e));const v={};v.w=200,v.h=100,v.color="0x059669ff",t[16].nodeId||t[16].populate(v),o=t[16],t[17]||(t[17]=this.element({parent:o||"root"},e));const P={};P.w=50,P.h=50,P.color="0x065f46ff",t[17].nodeId||t[17].populate(P),o=t[0],t[18]||(t[18]=this.element({parent:o||"root"},e));const b={};b.w=100,b.h=100,b.y=500,b.x=20,b.color="0xe11d48ff",t[18].nodeId||t[18].populate(b),o=t[0],t[19]||(t[19]=this.element({parent:o||"root"},e));const k={};k.w=200,k.h=200,k.x=300,k.y=600,k.color="0x94a3b8ff",k.z=100,t[19].nodeId||t[19].populate(k);const L=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[19],t[20]||(t[20]=this.element({parent:o||"root"},e));const F={};if(F.content="Lightning!",F.x=100,F.y=140,typeof L<"u")for(let E in L.config.props)delete F[L.config.props[E]];t[20].nodeId||t[20].populate(F),o=t[20];const R={};if(R.content="Lightning!",R.x=100,R.y=140,!t[21]){const E=R.is||"Text";t[21]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Text not found")})).call(null,{props:R},t[20],e),t[21][Symbol.for("slots")][0]?(o=t[21][Symbol.for("slots")][0],e=t[21]):o=t[21][Symbol.for("children")][0]}o=t[19],t[22]||(t[22]=this.element({parent:o||"root"},e));const N={};N.w=300,N.h=100,N.color="0x475569ff",t[22].nodeId||t[22].populate(N);const O=s.components&&s.components.Circle||e[Symbol.for("components")].Circle;o=t[19],t[23]||(t[23]=this.element({parent:o||"root"},e));const $={};if($.x=150,$.y=150,$.size=100,$.color="0xffffffff",typeof O<"u")for(let E in O.config.props)delete $[O.config.props[E]];t[23].nodeId||t[23].populate($),o=t[23];const B={};if(B.x=150,B.y=150,B.size=100,B.color="0xffffffff",!t[24]){const E=B.is||"Circle";t[24]=(s.components&&s.components[E]||e[Symbol.for("components")][E]||(()=>{console.error("component Circle not found")})).call(null,{props:B},t[23],e),t[24][Symbol.for("slots")][0]?(o=t[24][Symbol.for("slots")][0],e=t[24]):o=t[24][Symbol.for("children")][0]}o=t[0],t[25]||(t[25]=this.element({parent:o||"root"},e));const T={};T.w=300,T.h=300,T.x=300,T.y=600,T.color="0xef444480",t[25].nodeId||t[25].populate(T),o=t[0],t[26]||(t[26]=this.element({parent:o||"root"},e));const w={};w.w=400,w.h=100,w.x=800,w.y=900,w.color="0x0284c7ff",t[26].nodeId||t[26].populate(w),o=t[26],t[27]||(t[27]=this.element({parent:o||"root"},e));const A={};A.w=o.node.width*(42/100),A.h=o.node.height*(30/100),A.y=o.node.height*(5/100),A.x=o.node.width*(1/100),A.color="0x075985ff",t[27].nodeId||t[27].populate(A),o=t[26],t[28]||(t[28]=this.element({parent:o||"root"},e));const z={};z.h=o.node.height*(30/100),z.y=o.node.height*(35/100),z.x=o.node.width*(1/100),z.color="0x6b21a8ff",t[28].nodeId||t[28].populate(z),o=t[26],t[29]||(t[29]=this.element({parent:o||"root"},e));const M={};return M.h=o.node.height*(30/100),M.y=o.node.height*(65/100),M.x=o.node.width*(1/100),M.color="0x9f1239ff",t[29].nodeId||t[29].populate(M),t},effects:[function(o,e,s){e[9].set("x",o.xA)},function(o,e,s){e[10].set("x",o.xB)},function(o,e,s){e[11].set("x",o.xC)},function(o,e,s){e[12].set("x",o.xD)},function(o,e,s){e[16].set("y",(400-100)/2)},function(o,e,s){e[16].set("x",(400-200)/2)},function(o,e,s){e[17].set("y",{transition:o.yNested})},function(o,e,s){e[17].set("x",{transition:o.xNested})},function(o,e,s){e[28].set("w",o.bar2.v)},function(o,e,s){e[29].set("w",{transition:o.bar3})}],context:{}},state(){return{x1:20,x2:140,x3:20+140+100,x4:380,y:140,xA:20,xB:140,xC:260,xD:380,yNested:0,xNested:0,bar2:{direction:"up",v:"10%"},bar3:"10%"}},hooks:{ready(){this.$setTimeout(()=>{this.xD=this.xD+200,this.xC=this.xC+100,this.xB=this.xB+50,this.xA=this.xA+25},4e3),this.$setInterval(()=>{this.yNested=this.yNested===0?50:0},2e3),this.$setInterval(()=>{this.xNested=this.xNested===0?150:0},1e3),this.$setInterval(()=>{const n=parseFloat(this.bar2.v),o=this.bar2.direction==="up"?n+10:n-10;this.bar2.v=o+"%",o>=90&&(this.bar2.direction="down"),o<=10&&(this.bar2.direction="up")},400),this.$setInterval(()=>{this.bar3=Math.ceil(Math.random()*96)+"%"},2e3)}}}),Kr=H.Component("Colors",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=1920,l.h=1080,t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.x=20,r.y=20,t[1].nodeId||t[1].populate(r),o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=100,i.h=100,i.x=0,i.color="0xecfeffff",t[2].nodeId||t[2].populate(i),o=t[1],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.w=100,f.h=100,f.x=120,f.color="0xa5f3fcff",t[3].nodeId||t[3].populate(f),o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.w=100,c.h=100,c.x=240,c.color="0x22d3eeff",t[4].nodeId||t[4].populate(c),o=t[1],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.w=100,a.h=100,a.x=360,a.color="0x0891b2ff",t[5].nodeId||t[5].populate(a),o=t[0],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.x=20,d.y=140,t[6].nodeId||t[6].populate(d),o=t[6],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};m.w=100,m.h=100,m.x=0,m.color="0xecfeffff",t[7].nodeId||t[7].populate(m),o=t[6],t[8]||(t[8]=this.element({parent:o||"root"},e));const p={};p.w=100,p.h=100,p.x=120,p.color="0xa5f3fcff",t[8].nodeId||t[8].populate(p),o=t[6],t[9]||(t[9]=this.element({parent:o||"root"},e));const h={};h.w=100,h.h=100,h.x=240,h.color="0x22d3eeff",t[9].nodeId||t[9].populate(h),o=t[6],t[10]||(t[10]=this.element({parent:o||"root"},e));const y={};y.w=100,y.h=100,y.x=360,y.color="0x0891b2ff",t[10].nodeId||t[10].populate(y),o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const g={};g.x=20,g.y=260,t[11].nodeId||t[11].populate(g),o=t[11],t[12]||(t[12]=this.element({parent:o||"root"},e));const x={};x.w=100,x.h=100,x.x=0,x.color="0xecfeffaa",t[12].nodeId||t[12].populate(x),o=t[11],t[13]||(t[13]=this.element({parent:o||"root"},e));const _={};_.w=100,_.h=100,_.x=120,_.color="0xa5f3fc33",t[13].nodeId||t[13].populate(_),o=t[11],t[14]||(t[14]=this.element({parent:o||"root"},e));const S={};S.w=100,S.h=100,S.x=240,S.color="0x22d3ee20",t[14].nodeId||t[14].populate(S),o=t[11],t[15]||(t[15]=this.element({parent:o||"root"},e));const I={};I.w=100,I.h=100,I.x=360,I.color="0x0891b2ff",t[15].nodeId||t[15].populate(I),o=t[0],t[16]||(t[16]=this.element({parent:o||"root"},e));const v={};v.x=20,v.y=380,t[16].nodeId||t[16].populate(v),o=t[16],t[17]||(t[17]=this.element({parent:o||"root"},e));const P={};P.w=100,P.h=100,P.x=0,P.color="0xecfeffff",t[17].nodeId||t[17].populate(P),o=t[16],t[18]||(t[18]=this.element({parent:o||"root"},e));const b={};b.w=100,b.h=100,b.x=120,b.color="0xa5f3fcff",t[18].nodeId||t[18].populate(b),o=t[16],t[19]||(t[19]=this.element({parent:o||"root"},e));const k={};k.w=100,k.h=100,k.x=240,k.color="0x22d3eeff",t[19].nodeId||t[19].populate(k),o=t[16],t[20]||(t[20]=this.element({parent:o||"root"},e));const L={};L.w=100,L.h=100,L.x=360,L.color="0x0891b2ff",t[20].nodeId||t[20].populate(L),o=t[0],t[21]||(t[21]=this.element({parent:o||"root"},e));const F={};F.x=20,F.y=500,t[21].nodeId||t[21].populate(F),o=t[21],t[22]||(t[22]=this.element({parent:o||"root"},e));const R={};R.w=100,R.h=100,R.x=0,R.color="0xecfeffab",t[22].nodeId||t[22].populate(R),o=t[21],t[23]||(t[23]=this.element({parent:o||"root"},e));const N={};N.w=100,N.h=100,N.x=120,N.color="0xa5f3fc33",t[23].nodeId||t[23].populate(N),o=t[21],t[24]||(t[24]=this.element({parent:o||"root"},e));const O={};O.w=100,O.h=100,O.x=240,O.color="0x22d3ee21",t[24].nodeId||t[24].populate(O),o=t[21],t[25]||(t[25]=this.element({parent:o||"root"},e));const $={};$.w=100,$.h=100,$.x=360,$.color="0x0891b2ff",t[25].nodeId||t[25].populate($),o=t[0],t[26]||(t[26]=this.element({parent:o||"root"},e));const B={};B.x=20,B.y=620,t[26].nodeId||t[26].populate(B),o=t[26],t[27]||(t[27]=this.element({parent:o||"root"},e));const T={};T.w=100,T.h=100,T.x=0,T.color="0x000000ff",t[27].nodeId||t[27].populate(T),o=t[26],t[28]||(t[28]=this.element({parent:o||"root"},e));const w={};w.w=100,w.h=100,w.x=120,w.color="0xccccccff",t[28].nodeId||t[28].populate(w),o=t[26],t[29]||(t[29]=this.element({parent:o||"root"},e));const A={};A.w=100,A.h=100,A.x=240,A.color="0x889900ff",t[29].nodeId||t[29].populate(A),o=t[26],t[30]||(t[30]=this.element({parent:o||"root"},e));const z={};z.w=100,z.h=100,z.x=360,z.color="0x00ff00ff",t[30].nodeId||t[30].populate(z),o=t[0],t[31]||(t[31]=this.element({parent:o||"root"},e));const M={};M.x=20,M.y=740,t[31].nodeId||t[31].populate(M),o=t[31],t[32]||(t[32]=this.element({parent:o||"root"},e));const E={};E.w=100,E.h=100,E.x=0,E.color="0x000000ff",t[32].nodeId||t[32].populate(E),o=t[31],t[33]||(t[33]=this.element({parent:o||"root"},e));const Y={};Y.w=100,Y.h=100,Y.x=120,Y.color="0xccccccff",t[33].nodeId||t[33].populate(Y),o=t[31],t[34]||(t[34]=this.element({parent:o||"root"},e));const D={};D.w=100,D.h=100,D.x=240,D.color="0x889900ff",t[34].nodeId||t[34].populate(D),o=t[31],t[35]||(t[35]=this.element({parent:o||"root"},e));const q={};q.w=100,q.h=100,q.x=360,q.color="0x00ff00ff",t[35].nodeId||t[35].populate(q),o=t[0],t[36]||(t[36]=this.element({parent:o||"root"},e));const U={};U.x=620,U.y=20,t[36].nodeId||t[36].populate(U),o=t[36],t[37]||(t[37]=this.element({parent:o||"root"},e));const j={};j.w=300,j.h=200,j.x=0,t[37].nodeId||t[37].populate(j),o=t[36],t[38]||(t[38]=this.element({parent:o||"root"},e));const Z={};Z.w=300,Z.h=200,Z.x=0,Z.y=250,t[38].nodeId||t[38].populate(Z),o=t[36],t[39]||(t[39]=this.element({parent:o||"root"},e));const V={};V.w=300,V.h=200,V.x=100,V.y=400,t[39].nodeId||t[39].populate(V),o=t[36],t[40]||(t[40]=this.element({parent:o||"root"},e));const Q={};return Q.w=300,Q.h=200,Q.x=0,Q.y=650,t[40].nodeId||t[40].populate(Q),t},effects:[function(o,e,s){e[0].set("color",{transition:o.bg})},function(o,e,s){e[37].set("color",{transition:o.color1})},function(o,e,s){e[38].set("color",{transition:o.color2})},function(o,e,s){e[39].set("color",{transition:o.color3})},function(o,e,s){e[40].set("color",{transition:{value:o.color4,d:1e3,f:"ease-in-out"}})}],context:{}},state(){return{bg:"#fff",color1:"#22d3ee",color2:"#dc2626",color3:"rgba(251, 191, 36)",color4:"#bfdbfe"}},input:{enter(){this.color1=this.color1==="#0891b2"?"#22d3ee":"#0891b2",this.color2=this.color2==="#dc2626"?"#0f0":"#dc2626",this.color3=this.color3==="rgba(251, 191, 36)"?"rgba(30, 64, 175, 0.5)":"rgba(251, 191, 36)",this.color4=this.color4==="#1e3a8a"?"#bfdbfe":"#1e3a8a"}},hooks:{ready(){let n=0;const o=["#fff","#333","#c0ff33","#546aaa","#000","tomato"];this.$setInterval(()=>{n=n+1,n===o.length-1&&(n=0),this.bg=o[n]},2e3)}}}),Zr=H.Component("Gradients",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.h=1080,r.color="{top: '0x0891b2ff', bottom: '0xa5f3fcff'}",t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.h=1080,i.color="{left: '0xdc2626ff', right: '0xf87171ff'}",t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.h=1080,f.color="{top: '0x0891b2ff', right: '0xf87171ff'}",t[3].nodeId||t[3].populate(f),o=t[0],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};return c.h=1080,c.color="{right: '0x008000ff', bottom: '0xffd700ff'}",t[4].nodeId||t[4].populate(c),t},effects:[function(o,e,s){e[1].set("w",1920/4)},function(o,e,s){e[2].set("w",1920/4)},function(o,e,s){e[2].set("x",1920/4)},function(o,e,s){e[3].set("w",1920/4)},function(o,e,s){e[3].set("x",1920/4*2)},function(o,e,s){e[4].set("w",1920/4)},function(o,e,s){e[4].set("x",1920/4*3)}],context:{}}}),Qr=H.Component("Transitions",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=200,r.h=200,r.x=50,r.color="0xc4b5fdff",t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=200,i.h=200,i.x=300,i.color="0xa78bfaff",t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.w=200,f.h=200,f.x=550,f.color="0x8b5cf6ff",f.ref="bla",t[3].nodeId||t[3].populate(f),o=t[0],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.w=200,c.h=200,c.x=800,c.color="0x7c3aedff",t[4].nodeId||t[4].populate(c),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.w=200,a.h=200,a.x=1050,a.color="0x6d28d9ff",t[5].nodeId||t[5].populate(a),o=t[0],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.w=200,d.h=200,d.x=1300,d.color="0x5b21b6ff",t[6].nodeId||t[6].populate(d),o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};return m.w=200,m.h=200,m.x=1550,m.color="0x4c1d95ff",t[7].nodeId||t[7].populate(m),t},effects:[function(o,e,s){e[1].set("y",{transition:o.y})},function(o,e,s){e[2].set("y",{transition:{value:o.y}})},function(o,e,s){e[3].set("y",{transition:{value:o.y,duration:1e3,start:o.start,end:o.doneTransition3}})},function(o,e,s){e[4].set("y",{transition:{value:o.y,duration:500,delay:1e3,start:o.start,end:o.finished}})},function(o,e,s){e[5].set("y",{transition:{value:o.y,easing:"ease-in-out",end:o.finished}})},function(o,e,s){e[6].set("y",{transition:{value:o.y,duration:3e3,easing:"ease-in-out-back",end:o.finished}})},function(o,e,s){e[7].set("y",{transition:{value:o.y,duration:800,easing:"cubic-bezier(1,-0.64,.39,1.44)"}})}],context:{}},state(){return{y:50}},hooks:{ready(){this.$setTimeout(()=>{this.y=1080-50-200},500)}},methods:{doneTransition3(){this.$log.info("Transition 3 is done!")},start(n,o,e){this.$log.info("Start transition",n.nodeId,o,e)},finished(n,o,e){this.$log.info("Finished transition",n.nodeId,o,e)}}}),Jr=H.Component("Alpha",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.y=100,t[1].nodeId||t[1].populate(r),o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=200,i.h=200,i.x=100,i.color="0xffffffff",i.alpha=.2,t[2].nodeId||t[2].populate(i),o=t[1],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.w=200,f.h=200,f.x=320,f.color="0xffffffff",f.alpha=.4,t[3].nodeId||t[3].populate(f),o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.w=200,c.h=200,c.x=540,c.color="0xffffffff",c.alpha=.6,t[4].nodeId||t[4].populate(c),o=t[1],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.w=200,a.h=200,a.x=760,a.color="0xffffffff",a.alpha=.8,t[5].nodeId||t[5].populate(a),o=t[1],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.w=200,d.h=200,d.x=980,d.color="0xffffffff",d.alpha=1,t[6].nodeId||t[6].populate(d),o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};m.w=200,m.h=200,m.x=100,m.y=320,m.color="0xffffffff",m.alpha=e.alpha,t[7].nodeId||t[7].populate(m),o=t[0],t[8]||(t[8]=this.element({parent:o||"root"},e));const p={};p.w=200,p.h=200,p.x=100,p.y=540,p.color="0xffffffff",t[8].nodeId||t[8].populate(p),o=t[0],t[9]||(t[9]=this.element({parent:o||"root"},e));const h={};h.w=200,h.h=200,h.x=100,h.y=760,h.color="0xffffffff",t[9].nodeId||t[9].populate(h),o=t[0],t[10]||(t[10]=this.element({parent:o||"root"},e));const y={};y.w=428,y.h=234,y.x=1200,y.y=100,y.alpha=1,t[10].nodeId||t[10].populate(y),o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const g={};g.w=428,g.h=234,g.x=1300,g.alpha=.4,t[11].nodeId||t[11].populate(g),o=t[0],t[12]||(t[12]=this.element({parent:o||"root"},e));const x={};x.w=428,x.h=234,x.x=1200,x.alpha=.1,t[12].nodeId||t[12].populate(x);const _=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[13]||(t[13]=this.element({parent:o||"root"},e));const S={};if(S.x=400,S.y=400,S.alpha=.2,S.content="Text with alpha applied directly",typeof _<"u")for(let L in _.config.props)delete S[_.config.props[L]];t[13].nodeId||t[13].populate(S),o=t[13];const I={};if(I.x=400,I.y=400,I.alpha=.2,I.content="Text with alpha applied directly",!t[14]){const L=I.is||"Text";t[14]=(s.components&&s.components[L]||e[Symbol.for("components")][L]||(()=>{console.error("component Text not found")})).call(null,{props:I},t[13],e),t[14][Symbol.for("slots")][0]?(o=t[14][Symbol.for("slots")][0],e=t[14]):o=t[14][Symbol.for("children")][0]}o=t[0],t[15]||(t[15]=this.element({parent:o||"root"},e));const v={};v.alpha=.5,v.x=400,v.y=500,t[15].nodeId||t[15].populate(v);const P=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[15],t[16]||(t[16]=this.element({parent:o||"root"},e));const b={};if(b.content="Text with alpha applied on parent element",typeof P<"u")for(let L in P.config.props)delete b[P.config.props[L]];t[16].nodeId||t[16].populate(b),o=t[16];const k={};if(k.content="Text with alpha applied on parent element",!t[17]){const L=k.is||"Text";t[17]=(s.components&&s.components[L]||e[Symbol.for("components")][L]||(()=>{console.error("component Text not found")})).call(null,{props:k},t[16],e),t[17][Symbol.for("slots")][0]?(o=t[17][Symbol.for("slots")][0],e=t[17]):o=t[17][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[8].set("alpha",o.alpha)},function(o,e,s){e[9].set("alpha",{transition:{value:o.alpha,duration:1e3,easing:"ease-in-out-circ"}})},function(o,e,s){e[10].set("src",o.image)},function(o,e,s){e[11].set("y",100+234-40)},function(o,e,s){e[11].set("src",o.image)},function(o,e,s){e[12].set("y",100+234*2-40*2)},function(o,e,s){e[12].set("src",o.image)}],context:{}},state(){return{alpha:.5,direction:"up",image:"assets/lightningbolt.png"}},hooks:{ready(){this.$setInterval(()=>{const n=this.direction==="up"?this.alpha+.2:this.alpha-.2;this.alpha=Math.max(Math.min(n,1),.1),this.alpha===1&&(this.direction="down"),this.alpha===.1&&(this.direction="up")},1400)}}}),el=H.Component("Scaling",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.x=100,r.y=100,r.w=150,r.h=150,r.color="0x64748bff",t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.x=300,i.y=100,i.w=100,i.h=100,i.color="0x64748bff",i.scale=1.5,t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.x=100,f.y=400,f.w=100,f.h=100,f.color="0xb45309ff",f.scale=e.scale,t[3].nodeId||t[3].populate(f),o=t[0],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.x=900,c.y=400,c.w=100,c.h=100,t[4].nodeId||t[4].populate(c),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.x=300,a.y=600,a.w=100,a.h=100,a.color="0x059669ff",t[5].nodeId||t[5].populate(a),o=t[5],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.x=10,d.y=10,d.h=60,d.w=80,d.color="0x0369a1ff",t[6].nodeId||t[6].populate(d),o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};m.x=1500,m.y=600,m.w=100,m.h=100,m.color="0x059669ff",t[7].nodeId||t[7].populate(m),o=t[7],t[8]||(t[8]=this.element({parent:o||"root"},e));const p={};return p.x=10,p.y=10,p.h=60,p.w=80,p.color="0x0369a1ff",t[8].nodeId||t[8].populate(p),t},effects:[function(o,e,s){e[4].set("src",o.balloon)},function(o,e,s){e[4].set("scale",{transition:{value:o.scale,easing:"ease-in-out"}})},function(o,e,s){e[5].set("scale",o.scale2)},function(o,e,s){e[7].set("scale",o.scale2)},function(o,e,s){e[8].set("scale",o.scale2/2)}],context:{}},state(){return{scale:2,direction:"up",balloon:"assets/balloon.png",scale2:1}},hooks:{ready(){this.$setInterval(()=>{const e=this.direction==="up"?this.scale+.5:0;this.scale=Math.max(Math.min(e,8),0),this.scale===8&&(this.direction="down"),this.scale===0&&(this.direction="up")},500),this.$setInterval(()=>{this.scale2=this.scale2===1?3:1},2e3)}}}),tl=H.Component("Rotation",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.y=70,t[1].nodeId||t[1].populate(r),o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.x=100,i.y=0,i.w=200,i.h=100,i.color="0xfee2e2ff",i.rotation=0,t[2].nodeId||t[2].populate(i),o=t[1],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.x=100,f.y=150,f.w=200,f.h=100,f.color="0xfecacaff",f.rotation=10,t[3].nodeId||t[3].populate(f),o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.x=100,c.y=300,c.w=200,c.h=100,c.color="0xfca5a5ff",c.rotation=20,t[4].nodeId||t[4].populate(c),o=t[1],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.x=100,a.y=450,a.w=200,a.h=100,a.color="0xf87171ff",a.rotation=30,t[5].nodeId||t[5].populate(a),o=t[1],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.x=100,d.y=610,d.w=200,d.h=100,d.color="0xef4444ff",d.rotation=40,t[6].nodeId||t[6].populate(d),o=t[1],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};m.x=100,m.y=800,m.w=200,m.h=100,m.color="0xdc2626ff",m.rotation=50,t[7].nodeId||t[7].populate(m),o=t[0],t[8]||(t[8]=this.element({parent:o||"root"},e));const p={};p.y=70,p.x=300,t[8].nodeId||t[8].populate(p),o=t[8],t[9]||(t[9]=this.element({parent:o||"root"},e));const h={};h.x=100,h.y=0,h.w=200,h.h=100,h.color="0xfee2e2ff",h.rotation=60,t[9].nodeId||t[9].populate(h),o=t[8],t[10]||(t[10]=this.element({parent:o||"root"},e));const y={};y.x=100,y.y=150,y.w=200,y.h=100,y.color="0xfecacaff",y.rotation=70,t[10].nodeId||t[10].populate(y),o=t[8],t[11]||(t[11]=this.element({parent:o||"root"},e));const g={};g.x=100,g.y=300,g.w=200,g.h=100,g.color="0xfca5a5ff",g.rotation=80,t[11].nodeId||t[11].populate(g),o=t[8],t[12]||(t[12]=this.element({parent:o||"root"},e));const x={};x.x=100,x.y=450,x.w=200,x.h=100,x.color="0xf87171ff",x.rotation=90,t[12].nodeId||t[12].populate(x),o=t[8],t[13]||(t[13]=this.element({parent:o||"root"},e));const _={};_.x=100,_.y=610,_.w=200,_.h=100,_.color="0xef4444ff",_.rotation=100,t[13].nodeId||t[13].populate(_),o=t[8],t[14]||(t[14]=this.element({parent:o||"root"},e));const S={};S.x=100,S.y=800,S.w=200,S.h=100,S.color="0xdc2626ff",S.rotation=100,t[14].nodeId||t[14].populate(S),o=t[0],t[15]||(t[15]=this.element({parent:o||"root"},e));const I={};I.y=70,I.x=600,t[15].nodeId||t[15].populate(I),o=t[15],t[16]||(t[16]=this.element({parent:o||"root"},e));const v={};v.x=100,v.y=0,v.w=200,v.h=100,v.color="0xfee2e2ff",v.rotation=110,t[16].nodeId||t[16].populate(v),o=t[15],t[17]||(t[17]=this.element({parent:o||"root"},e));const P={};P.x=100,P.y=150,P.w=200,P.h=100,P.color="0xfecacaff",P.rotation=120,t[17].nodeId||t[17].populate(P),o=t[15],t[18]||(t[18]=this.element({parent:o||"root"},e));const b={};b.x=100,b.y=300,b.w=200,b.h=100,b.color="0xfca5a5ff",b.rotation=130,t[18].nodeId||t[18].populate(b),o=t[15],t[19]||(t[19]=this.element({parent:o||"root"},e));const k={};k.x=100,k.y=450,k.w=200,k.h=100,k.color="0xf87171ff",k.rotation=140,t[19].nodeId||t[19].populate(k),o=t[15],t[20]||(t[20]=this.element({parent:o||"root"},e));const L={};L.x=100,L.y=610,L.w=200,L.h=100,L.color="0xef4444ff",L.rotation=150,t[20].nodeId||t[20].populate(L),o=t[15],t[21]||(t[21]=this.element({parent:o||"root"},e));const F={};F.x=100,F.y=800,F.w=200,F.h=100,F.color="0xdc2626ff",F.rotation=160,t[21].nodeId||t[21].populate(F),o=t[0],t[22]||(t[22]=this.element({parent:o||"root"},e));const R={};R.y=70,R.x=900,t[22].nodeId||t[22].populate(R),o=t[22],t[23]||(t[23]=this.element({parent:o||"root"},e));const N={};N.x=100,N.y=0,N.w=200,N.h=100,N.color="0xfee2e2ff",N.rotation=170,t[23].nodeId||t[23].populate(N),o=t[22],t[24]||(t[24]=this.element({parent:o||"root"},e));const O={};O.x=100,O.y=150,O.w=200,O.h=100,O.color="0xfecacaff",O.rotation=180,t[24].nodeId||t[24].populate(O),o=t[22],t[25]||(t[25]=this.element({parent:o||"root"},e));const $={};$.x=100,$.y=300,$.w=200,$.h=100,$.color="0xfca5a5ff",$.rotation=190,t[25].nodeId||t[25].populate($),o=t[22],t[26]||(t[26]=this.element({parent:o||"root"},e));const B={};B.x=100,B.y=450,B.w=200,B.h=100,B.color="0xf87171ff",B.rotation=200,t[26].nodeId||t[26].populate(B),o=t[22],t[27]||(t[27]=this.element({parent:o||"root"},e));const T={};T.x=100,T.y=610,T.w=200,T.h=100,T.color="0xef4444ff",T.rotation=210,t[27].nodeId||t[27].populate(T),o=t[22],t[28]||(t[28]=this.element({parent:o||"root"},e));const w={};w.x=100,w.y=800,w.w=200,w.h=100,w.color="0xdc2626ff",w.rotation=220,t[28].nodeId||t[28].populate(w),o=t[0],t[29]||(t[29]=this.element({parent:o||"root"},e));const A={};A.y=70,A.x=1200,t[29].nodeId||t[29].populate(A),o=t[29],t[30]||(t[30]=this.element({parent:o||"root"},e));const z={};z.x=100,z.y=0,z.w=200,z.h=100,z.color="0xfee2e2ff",z.rotation=230,t[30].nodeId||t[30].populate(z),o=t[29],t[31]||(t[31]=this.element({parent:o||"root"},e));const M={};M.x=100,M.y=150,M.w=200,M.h=100,M.color="0xfecacaff",M.rotation=240,t[31].nodeId||t[31].populate(M),o=t[29],t[32]||(t[32]=this.element({parent:o||"root"},e));const E={};E.x=100,E.y=300,E.w=200,E.h=100,E.color="0xfca5a5ff",E.rotation=250,t[32].nodeId||t[32].populate(E),o=t[29],t[33]||(t[33]=this.element({parent:o||"root"},e));const Y={};Y.x=100,Y.y=450,Y.w=200,Y.h=100,Y.color="0xf87171ff",Y.rotation=260,t[33].nodeId||t[33].populate(Y),o=t[29],t[34]||(t[34]=this.element({parent:o||"root"},e));const D={};D.x=100,D.y=610,D.w=200,D.h=100,D.color="0xef4444ff",D.rotation=270,t[34].nodeId||t[34].populate(D),o=t[29],t[35]||(t[35]=this.element({parent:o||"root"},e));const q={};q.x=100,q.y=800,q.w=200,q.h=100,q.color="0xdc2626ff",q.rotation=280,t[35].nodeId||t[35].populate(q),o=t[0],t[36]||(t[36]=this.element({parent:o||"root"},e));const U={};U.y=70,U.x=1500,t[36].nodeId||t[36].populate(U),o=t[36],t[37]||(t[37]=this.element({parent:o||"root"},e));const j={};j.x=100,j.y=0,j.w=200,j.h=100,j.color="0xfee2e2ff",j.rotation=290,t[37].nodeId||t[37].populate(j),o=t[36],t[38]||(t[38]=this.element({parent:o||"root"},e));const Z={};Z.x=100,Z.y=150,Z.w=200,Z.h=100,Z.color="0xfecacaff",Z.rotation=300,t[38].nodeId||t[38].populate(Z),o=t[36],t[39]||(t[39]=this.element({parent:o||"root"},e));const V={};V.x=100,V.y=300,V.w=200,V.h=100,V.color="0xfca5a5ff",V.rotation=310,t[39].nodeId||t[39].populate(V),o=t[36],t[40]||(t[40]=this.element({parent:o||"root"},e));const Q={};Q.x=100,Q.y=450,Q.w=200,Q.h=100,Q.color="0xf87171ff",Q.rotation=320,t[40].nodeId||t[40].populate(Q),o=t[36],t[41]||(t[41]=this.element({parent:o||"root"},e));const oe={};oe.x=100,oe.y=610,oe.w=200,oe.h=100,oe.color="0xef4444ff",oe.rotation=330,t[41].nodeId||t[41].populate(oe),o=t[36],t[42]||(t[42]=this.element({parent:o||"root"},e));const ee={};ee.x=100,ee.y=800,ee.w=200,ee.h=100,ee.color="0xdc2626ff",ee.rotation=340,t[42].nodeId||t[42].populate(ee),o=t[0],t[43]||(t[43]=this.element({parent:o||"root"},e));const K={};K.x=200,K.y=200,K.w=400,K.h=400,K.color="0x0891b2ff",K.rotation=e.rotation1,t[43].nodeId||t[43].populate(K),o=t[0],t[44]||(t[44]=this.element({parent:o||"root"},e));const de={};de.x=800,de.y=200,de.w=400,de.h=400,de.color="0x0891b2ff",t[44].nodeId||t[44].populate(de),o=t[0],t[45]||(t[45]=this.element({parent:o||"root"},e));const le={};return le.x=1400,le.y=200,le.w=400,le.h=400,le.color="0x0891b2ff",t[45].nodeId||t[45].populate(le),t},effects:[function(o,e,s){e[44].set("rotation",o.rotation2)},function(o,e,s){e[45].set("rotation",{transition:o.rotation3})}],context:{}},state(){return{rotation1:38,rotation2:0,rotation3:0}},hooks:{ready(){let n=800,o=2e3;this.$setInterval(()=>{const e=this.rotation2+10;this.rotation2=e<=360?e:0},n),this.$setInterval(()=>{this.rotation3=Math.max(10,Math.min(720,this.rotation3*2)),this.rotation3===720&&(this.rotation3=0)},o)}}}),ol=H.Component("KeyInput",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.x=525,l.y=130,t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=200,r.h=200,t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=180,i.h=180,i.x=10,i.y=10,t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.w=180,f.h=180,f.x=230,f.y=10,t[3].nodeId||t[3].populate(f),o=t[0],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.w=180,c.h=180,c.x=450,c.y=10,t[4].nodeId||t[4].populate(c),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.w=180,a.h=180,a.x=670,a.y=10,t[5].nodeId||t[5].populate(a),o=t[0],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.w=180,d.h=180,d.x=10,d.y=220,t[6].nodeId||t[6].populate(d),o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};m.w=180,m.h=180,m.x=230,m.y=220,t[7].nodeId||t[7].populate(m),o=t[0],t[8]||(t[8]=this.element({parent:o||"root"},e));const p={};p.w=180,p.h=180,p.x=450,p.y=220,t[8].nodeId||t[8].populate(p),o=t[0],t[9]||(t[9]=this.element({parent:o||"root"},e));const h={};h.w=180,h.h=180,h.x=670,h.y=220,t[9].nodeId||t[9].populate(h),o=t[0],t[10]||(t[10]=this.element({parent:o||"root"},e));const y={};y.w=180,y.h=180,y.x=10,y.y=430,t[10].nodeId||t[10].populate(y),o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const g={};g.w=180,g.h=180,g.x=230,g.y=430,t[11].nodeId||t[11].populate(g),o=t[0],t[12]||(t[12]=this.element({parent:o||"root"},e));const x={};x.w=180,x.h=180,x.x=450,x.y=430,t[12].nodeId||t[12].populate(x),o=t[0],t[13]||(t[13]=this.element({parent:o||"root"},e));const _={};_.w=180,_.h=180,_.x=670,_.y=430,t[13].nodeId||t[13].populate(_),o=t[0],t[14]||(t[14]=this.element({parent:o||"root"},e));const S={};S.w=180,S.h=180,S.x=10,S.y=640,t[14].nodeId||t[14].populate(S),o=t[0],t[15]||(t[15]=this.element({parent:o||"root"},e));const I={};I.w=180,I.h=180,I.x=230,I.y=640,t[15].nodeId||t[15].populate(I),o=t[0],t[16]||(t[16]=this.element({parent:o||"root"},e));const v={};v.w=180,v.h=180,v.x=450,v.y=640,t[16].nodeId||t[16].populate(v),o=t[0],t[17]||(t[17]=this.element({parent:o||"root"},e));const P={};return P.w=180,P.h=180,P.x=670,P.y=640,t[17].nodeId||t[17].populate(P),t},effects:[function(o,e,s){e[1].set("color",o.focusColor)},function(o,e,s){e[1].set("x",o.focusedX*220)},function(o,e,s){e[1].set("y",o.focusedY*210)},function(o,e,s){e[2].set("color",o.blockColor)},function(o,e,s){e[3].set("color",o.blockColor)},function(o,e,s){e[4].set("color",o.blockColor)},function(o,e,s){e[5].set("color",o.blockColor)},function(o,e,s){e[6].set("color",o.blockColor)},function(o,e,s){e[7].set("color",o.blockColor)},function(o,e,s){e[8].set("color",o.blockColor)},function(o,e,s){e[9].set("color",o.blockColor)},function(o,e,s){e[10].set("color",o.blockColor)},function(o,e,s){e[11].set("color",o.blockColor)},function(o,e,s){e[12].set("color",o.blockColor)},function(o,e,s){e[13].set("color",o.blockColor)},function(o,e,s){e[14].set("color",o.blockColor)},function(o,e,s){e[15].set("color",o.blockColor)},function(o,e,s){e[16].set("color",o.blockColor)},function(o,e,s){e[17].set("color",o.blockColor)}],context:{}},state(){return{focusedX:0,focusedY:0,colorscheme:"yellow"}},computed:{blockColor(){return this.colorscheme==="yellow"?"#fef08a":"#bae6fd"},focusColor(){return this.colorscheme==="yellow"?"#facc15":"#38bdf8"}},input:{left(){const n=this.focusedX-1;this.focusedX=Math.max(n,0)},right(){const n=this.focusedX+1;this.focusedX=Math.min(n,3)},up(){this.focusedY=Math.max(this.focusedY-1,0)},down(){this.focusedY=Math.min(this.focusedY+1,3)},enter(){this.colorscheme=this.colorscheme==="yellow"?"blue":"yellow"},any(n){const o=parseInt(n.key);isNaN(o)?this.parent.focus(n):(this.focusedX=Math.max(0,(o-1)%4),this.focusedY=Math.max(0,Math.ceil(o/4)-1))}}}),to=["#64748b","#ef4444","#f97316","#84cc16","#14b8a6","#3b82f6"],oo=["Iron Man","Captain America","Thor","Hulk","Black Widow","Hawkeye","Scarlet Witch","Vision","Black Panther","Doctor Strange","Spider-Man","Ant-Man","Wasp","Captain Marvel","Falcon","Winter Soldier","War Machine","Quicksilver","Star-Lord","Gamora"],sl=H.Component("Texts",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.x=100,l.y=100,t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.content="Default text",i["@loaded"]=e.textLoaded&&e.textLoaded.bind(e),typeof r<"u")for(let M in r.config.props)delete i[r.config.props[M]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.content="Default text",f["@loaded"]=e.textLoaded&&e.textLoaded.bind(e),!t[2]){const M=f.is||"Text";t[2]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.content="123456",a.x=400,typeof c<"u")for(let M in c.config.props)delete a[c.config.props[M]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.content="123456",d.x=400,!t[4]){const M=d.is||"Text";t[4]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}const m=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const p={};if(p.content="Text with a different fontsize",p.y=120,p.font="raleway",typeof m<"u")for(let M in m.config.props)delete p[m.config.props[M]];t[5].nodeId||t[5].populate(p),o=t[5];const h={};if(h.content="Text with a different fontsize",h.size=e.size,h.y=120,h.font="raleway",!t[6]){const M=h.is||"Text";t[6]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:h},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}const y=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const g={};if(g.content="Text with a different color",g.size=50,g.y=250,typeof y<"u")for(let M in y.config.props)delete g[y.config.props[M]];t[7].nodeId||t[7].populate(g),o=t[7];const x={};if(x.content="Text with a different color",x.size=50,x.color=e.color,x.y=250,!t[8]){const M=x.is||"Text";t[8]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:x},t[7],e),t[8][Symbol.for("slots")][0]?(o=t[8][Symbol.for("slots")][0],e=t[8]):o=t[8][Symbol.for("children")][0]}const _=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[9]||(t[9]=this.element({parent:o||"root"},e));const S={};if(S.content="Letterspacing",S.size=50,S.color="0x38bdf8ff",S.y=450,S.letterspacing=40,typeof _<"u")for(let M in _.config.props)delete S[_.config.props[M]];t[9].nodeId||t[9].populate(S),o=t[9];const I={};if(I.content="Letterspacing",I.size=50,I.color="0x38bdf8ff",I.y=450,I.letterspacing=40,!t[10]){const M=I.is||"Text";t[10]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:I},t[9],e),t[10][Symbol.for("slots")][0]?(o=t[10][Symbol.for("slots")][0],e=t[10]):o=t[10][Symbol.for("children")][0]}o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const v={};v.w=800,v.h=100,v.y=550,v.color="0x94a3b8ff",t[11].nodeId||t[11].populate(v);const P=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[11],t[12]||(t[12]=this.element({parent:o||"root"},e));const b={};if(b.content="Text align center",b.size=50,b.y=15,b.color="0xbae6fdff",b.align="center",b.wordwrap=800,typeof P<"u")for(let M in P.config.props)delete b[P.config.props[M]];t[12].nodeId||t[12].populate(b),o=t[12];const k={};if(k.content="Text align center",k.size=50,k.y=15,k.color="0xbae6fdff",k.align="center",k.wordwrap=800,!t[13]){const M=k.is||"Text";t[13]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:k},t[12],e),t[13][Symbol.for("slots")][0]?(o=t[13][Symbol.for("slots")][0],e=t[13]):o=t[13][Symbol.for("children")][0]}o=t[0],t[14]||(t[14]=this.element({parent:o||"root"},e));const L={};L.w=800,L.h=200,L.x=900,L.y=550,L.color="0x94a3b8ff",t[14].nodeId||t[14].populate(L);const F=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[14],t[15]||(t[15]=this.element({parent:o||"root"},e));const R={};if(R.content=e.longText,R.size=40,R.color="0xbae6fdff",R.wordwrap=800,R.maxlines=5,R.textoverflow="!!!",typeof F<"u")for(let M in F.config.props)delete R[F.config.props[M]];t[15].nodeId||t[15].populate(R),o=t[15];const N={};if(N.content=e.longText,N.size=40,N.color="0xbae6fdff",N.wordwrap=800,N.maxlines=5,N.textoverflow="!!!",!t[16]){const M=N.is||"Text";t[16]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:N},t[15],e),t[16][Symbol.for("slots")][0]?(o=t[16][Symbol.for("slots")][0],e=t[16]):o=t[16][Symbol.for("children")][0]}o=t[0],t[17]||(t[17]=this.element({parent:o||"root"},e));const O={};O.w=800,O.h=120,O.x=900,O.y=800,O.color="0x94a3b8ff",t[17].nodeId||t[17].populate(O);const $=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[17],t[18]||(t[18]=this.element({parent:o||"root"},e));const B={};if(B.content=e.longText,B.size=40,B.color="0xbae6fdff",B.wordwrap=800,B.maxlines=2,B.lineheight=60,B.textoverflow=!1,typeof $<"u")for(let M in $.config.props)delete B[$.config.props[M]];t[18].nodeId||t[18].populate(B),o=t[18];const T={};if(T.content=e.longText,T.size=40,T.color="0xbae6fdff",T.wordwrap=800,T.maxlines=2,T.lineheight=60,T.textoverflow=!1,!t[19]){const M=T.is||"Text";t[19]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:T},t[18],e),t[19][Symbol.for("slots")][0]?(o=t[19][Symbol.for("slots")][0],e=t[19]):o=t[19][Symbol.for("children")][0]}const w=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[20]||(t[20]=this.element({parent:o||"root"},e));const A={};if(A.size=50,A.y=750,A.font="opensans",typeof w<"u")for(let M in w.config.props)delete A[w.config.props[M]];t[20].nodeId||t[20].populate(A),o=t[20];const z={};if(z.content=e.character,z.size=50,z.color=e.color,z.y=750,z.font="opensans",!t[21]){const M=z.is||"Text";t[21]=(s.components&&s.components[M]||e[Symbol.for("components")][M]||(()=>{console.error("component Text not found")})).call(null,{props:z},t[20],e),t[21][Symbol.for("slots")][0]?(o=t[21][Symbol.for("slots")][0],e=t[21]):o=t[21][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[5].set("size",o.size)},function(o,e,s){e[6][Symbol.for("props")].size=o.size},function(o,e,s){e[7].set("color",o.color)},function(o,e,s){e[8][Symbol.for("props")].color=o.color},function(o,e,s){e[20].set("content",o.character)},function(o,e,s){e[20].set("color",o.color)},function(o,e,s){e[21][Symbol.for("props")].content=o.character},function(o,e,s){e[21][Symbol.for("props")].color=o.color}],context:{}},state(){return{color:to[0],size:10,character:oo[0],myText:"This is my test yeah",longText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent at ante non mauris commodo tristique. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut quis mattis mi. Aliquam ultricies mi vel lobortis luctus. Ut non feugiat urna. Duis sed blandit dui. Donec venenatis, mauris at blandit malesuada, elit nibh scelerisque lacus, non tempus arcu mi at justo."}},hooks:{ready(){let n=0;this.$setInterval(()=>{n++,n>to.length-1&&(n=0),this.color=to[n],this.size=10*(n*2+1)},1e3);let o=0;this.$setInterval(()=>{o++,o>oo.length-1&&(o=0),this.character=oo[o]},1400)}},methods:{textLoaded(n){this.$log.info(`Image loaded with w: ${n.w} and h: ${n.h}`)}}}),Mt=["https://images.unsplash.com/photo-1690360994204-3d10cc73a08d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=428&q=80","https://images.unsplash.com/photo-1582971103098-bfc707d2ad92?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=428&q=80"],nl=H.Component("Images",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.src="assets/lightningbolt.png",r.w=428,r.h=234,r.x=100,r.y=100,t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.src="https://images.unsplash.com/photo-1611148799269-63df34f63f6c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=428&q=80",i.w=428,i.h=234,i.x=100,i.y=400,t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.w=428,f.h=234,f.x=100,f.y=700,f["@loaded"]=e.imageLoaded&&e.imageLoaded.bind(e),t[3].nodeId||t[3].populate(f),o=t[0],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.color="{top: '0xff0000ff', bottom: '0xffd700ff'}",c.src="assets/lightningbolt.png",c.w=428,c.h=234,c.x=600,c.y=100,t[4].nodeId||t[4].populate(c),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.x=600,a.y=400,a.w=428,a.h=234,t[5].nodeId||t[5].populate(a),o=t[5],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.src="assets/lightningbolt.png",d.w=856,d.h=468,t[6].nodeId||t[6].populate(d),o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};return m.src="assets/lightningbolt.png",m.w=428,m.h=234,m.x=1100,m.y=100,t[7].nodeId||t[7].populate(m),t},effects:[function(o,e,s){e[3].set("src",o.image)},function(o,e,s){e[5].set("clipping",o.clipping)},function(o,e,s){e[7].set("color",o.color)}],context:{}},state(){return{image:Mt[0],clipping:!0,color:"red"}},hooks:{ready(){this.$setInterval(()=>{this.image=this.image===Mt[0]?Mt[1]:Mt[0],this.clipping=!this.clipping,this.color=this.color==="red"?"blue":"red"},2e3)}},methods:{imageLoaded(n){console.log("backstopjs:ready"),this.$log.info(`Image loaded with w: ${n.w} and h: ${n.h}`)}}}),et=H.Component("Square",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){e[0].set("w",{transition:o.size})},function(o,e,s){e[0].set("h",{transition:o.size})},function(o,e,s){e[0].set("color",{transition:o.color})}],context:{}},props:[{key:"size",default:80}],state(){return{color:"#86198f"}},watch:{size(n,o){this.$log.info(`Size changed from ${o} to ${n}`),this.color=this.color==="#86198f"?"#9d174d":"#86198f"}}}),Ws=H.Component("Card",{components:{Square:et},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=e.w,l.h=e.h,l.color="0x0891b2ff",t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.x=80,i.y=80,typeof r<"u")for(let m in r.config.props)delete i[r.config.props[m]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.x=80,f.y=80,!t[2]){const m=f.is||"Square";t[2]=(s.components&&s.components[m]||e[Symbol.for("components")][m]||(()=>{console.error("component Square not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.x=20,a.y=20,a.size=40,typeof c<"u")for(let m in c.config.props)delete a[c.config.props[m]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.x=20,d.y=20,d.size=40,!t[4]){const m=d.is||"Square";t[4]=(s.components&&s.components[m]||e[Symbol.for("components")][m]||(()=>{console.error("component Square not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}return t},effects:[],context:{}},props:["size"],computed:{w(){return this.size==="large"?400:200},h(){return this.size==="large"?500:300}}}),il=H.Component("Components",{components:{Square:et,Card:Ws},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.x=100,i.y=100,i.size=50,typeof r<"u")for(let A in r.config.props)delete i[r.config.props[A]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.x=100,f.y=100,f.size=50,!t[2]){const A=f.is||"Square";t[2]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Square not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.x=100,a.y=200,a.size=100,typeof c<"u")for(let A in c.config.props)delete a[c.config.props[A]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.x=100,d.y=200,d.size=100,!t[4]){const A=d.is||"Square";t[4]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Square not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}const m=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const p={};if(p.x=100,p.y=350,p.size=200,typeof m<"u")for(let A in m.config.props)delete p[m.config.props[A]];t[5].nodeId||t[5].populate(p),o=t[5];const h={};if(h.x=100,h.y=350,h.size=200,!t[6]){const A=h.is||"Square";t[6]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Square not found")})).call(null,{props:h},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}const y=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const g={};if(g.y=600,g.size=50,typeof y<"u")for(let A in y.config.props)delete g[y.config.props[A]];t[7].nodeId||t[7].populate(g),o=t[7];const x={};if(x.x={transition:e.x},x.y=600,x.size=50,!t[8]){const A=x.is||"Square";t[8]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Square not found")})).call(null,{props:x},t[7],e),t[8][Symbol.for("slots")][0]?(o=t[8][Symbol.for("slots")][0],e=t[8]):o=t[8][Symbol.for("children")][0]}const _=s.components&&s.components.Card||e[Symbol.for("components")].Card;o=t[0],t[9]||(t[9]=this.element({parent:o||"root"},e));const S={};if(S.x=500,S.y=100,typeof _<"u")for(let A in _.config.props)delete S[_.config.props[A]];t[9].nodeId||t[9].populate(S),o=t[9];const I={};if(I.x=500,I.y=100,!t[10]){const A=I.is||"Card";t[10]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Card not found")})).call(null,{props:I},t[9],e),t[10][Symbol.for("slots")][0]?(o=t[10][Symbol.for("slots")][0],e=t[10]):o=t[10][Symbol.for("children")][0]}const v=s.components&&s.components.Card||e[Symbol.for("components")].Card;o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const P={};if(P.x=500,P.y=500,P.size="large",typeof v<"u")for(let A in v.config.props)delete P[v.config.props[A]];t[11].nodeId||t[11].populate(P),o=t[11];const b={};if(b.x=500,b.y=500,b.size="large",!t[12]){const A=b.is||"Card";t[12]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Card not found")})).call(null,{props:b},t[11],e),t[12][Symbol.for("slots")][0]?(o=t[12][Symbol.for("slots")][0],e=t[12]):o=t[12][Symbol.for("children")][0]}const k=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[0],t[13]||(t[13]=this.element({parent:o||"root"},e));const L={};if(L.x=100,L.y=750,typeof k<"u")for(let A in k.config.props)delete L[k.config.props[A]];t[13].nodeId||t[13].populate(L),o=t[13];const F={};if(F.x=100,F.y=750,F.size=e.size,!t[14]){const A=F.is||"Square";t[14]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Square not found")})).call(null,{props:F},t[13],e),t[14][Symbol.for("slots")][0]?(o=t[14][Symbol.for("slots")][0],e=t[14]):o=t[14][Symbol.for("children")][0]}o=t[0],t[15]||(t[15]=this.element({parent:o||"root"},e));const R={};R.x=1100,R.y=200,t[15].nodeId||t[15].populate(R);const N=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[15],t[16]||(t[16]=this.element({parent:o||"root"},e));const O={};if(O.content="Dynamic components",typeof N<"u")for(let A in N.config.props)delete O[N.config.props[A]];t[16].nodeId||t[16].populate(O),o=t[16];const $={};if($.content="Dynamic components",!t[17]){const A=$.is||"Text";t[17]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Text not found")})).call(null,{props:$},t[16],e),t[17][Symbol.for("slots")][0]?(o=t[17][Symbol.for("slots")][0],e=t[17]):o=t[17][Symbol.for("children")][0]}const B=s.components&&s.components.Component||e[Symbol.for("components")].Component;o=t[15],t[18]||(t[18]=this.element({parent:o||"root"},e));const T={};if(T.is=e.dynamicComponent,T.y=100,typeof B<"u")for(let A in B.config.props)delete T[B.config.props[A]];t[18].nodeId||t[18].populate(T),o=t[18];const w={};if(w.is=e.dynamicComponent,w.y=100,!t[19]){const A=w.is||"Component";t[19]=(s.components&&s.components[A]||e[Symbol.for("components")][A]||(()=>{console.error("component Component not found")})).call(null,{props:w},t[18],e),t[19][Symbol.for("slots")][0]?(o=t[19][Symbol.for("slots")][0],e=t[19]):o=t[19][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[7].set("x",{transition:o.x})},function(o,e,s){e[8][Symbol.for("props")].x={transition:o.x}},function(o,e,s){e[13].set("size",o.size)},function(o,e,s){e[14][Symbol.for("props")].size=o.size},function(o,e,s){parent=e[15];const t=o.dynamicComponents||[],l=[];for(let r=0;r{console.error("component Component not found")})).call(null,{props:a},e[20][i.key],o),e[21][i.key][Symbol.for("slots")][0]?(parent=e[21][i.key][Symbol.for("slots")][0],o=e[21][i.key]):parent=e[21][i.key][Symbol.for("children")][0]}e[20][i.key].set("x",250*i.index),e[21][i.key][Symbol.for("props")].x=250*i.index}e[20]&&Object.keys(e[20]).forEach(r=>{l.indexOf(r)===-1&&(e[20][r].destroy&&e[20][r].destroy(),delete e[1][r])})}],context:{}},state(){return{x:100,dynamicComponent:"Square",dynamicComponents:["Square","Card","Square"],toggle:!1,size:50}},hooks:{ready(){this.$setInterval(()=>{this.x=this.x===100?250:100,this.size=this.size===50?200:50},2e3)}}}),me=["#bbf7d0","#86efac","#4ade80","#22c55e","#16a34a","#15803d"],rl=H.Component("ForLoop",{components:{Square:et},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.y=20,t[1].nodeId||t[1].populate(r),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const i={};i.y=120,t[3].nodeId||t[3].populate(i),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const f={};f.y=220,t[5].nodeId||t[5].populate(f),o=t[0],t[7]||(t[7]=this.element({parent:o||"root"},e));const c={};c.y=320,t[7].nodeId||t[7].populate(c),o=t[0],t[10]||(t[10]=this.element({parent:o||"root"},e));const a={};a.y=420,t[10].nodeId||t[10].populate(a),o=t[0],t[13]||(t[13]=this.element({parent:o||"root"},e));const d={};d.y=520,t[13].nodeId||t[13].populate(d),o=t[0],t[15]||(t[15]=this.element({parent:o||"root"},e));const m={};m.y=620,t[15].nodeId||t[15].populate(m),o=t[0],t[17]||(t[17]=this.element({parent:o||"root"},e));const p={};p.y=720,t[17].nodeId||t[17].populate(p),o=t[0],t[19]||(t[19]=this.element({parent:o||"root"},e));const h={};h.y=720,h.x=700,t[19].nodeId||t[19].populate(h),o=t[0],t[21]||(t[21]=this.element({parent:o||"root"},e));const y={};y.y=920,t[21].nodeId||t[21].populate(y),o=t[0],t[24]||(t[24]=this.element({parent:o||"root"},e));const g={};return g.y=920,g.x=700,t[24].nodeId||t[24].populate(g),t},effects:[function(o,e,s){parent=e[1];const t=o.collection1||[],l=[];for(let r=0;r{l.indexOf(r)===-1&&(e[2][r].destroy&&e[2][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[3];const t=o.collection2||[],l=[];for(let r=0;r{l.indexOf(r)===-1&&(e[4][r].destroy&&e[4][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[5];const t=o.collection3||[],l=[];for(let r=0;r{l.indexOf(r)===-1&&(e[6][r].destroy&&e[6][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[7];const t=o.collection2||[],l=[];for(let r=0;r{console.error("component Square not found")})).call(null,{props:a},e[8][i.key],o),e[9][i.key][Symbol.for("slots")][0]?(parent=e[9][i.key][Symbol.for("slots")][0],o=e[9][i.key]):parent=e[9][i.key][Symbol.for("children")][0]}e[8][i.key].set("x",i.item.x*i.index),e[8][i.key].set("ref","square"+i.index),e[8][i.key].set("alpha",i.alpha),e[9][i.key][Symbol.for("props")].x=i.item.x*i.index,e[9][i.key][Symbol.for("props")].ref="square"+i.index,e[9][i.key][Symbol.for("props")].alpha=i.alpha}e[8]&&Object.keys(e[8]).forEach(r=>{l.indexOf(r)===-1&&(e[8][r].destroy&&e[8][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[10];const t=o.collection3||[],l=[];for(let r=0;r{console.error("component Square not found")})).call(null,{props:a},e[11][i.item.color],o),e[12][i.item.color][Symbol.for("slots")][0]?(parent=e[12][i.item.color][Symbol.for("slots")][0],o=e[12][i.item.color]):parent=e[12][i.item.color][Symbol.for("children")][0]}e[11][i.item.color].set("x",i.item.x),e[11][i.item.color].set("alpha",i.alpha),e[12][i.item.color][Symbol.for("props")].x=i.item.x,e[12][i.item.color][Symbol.for("props")].alpha=i.alpha}e[11]&&Object.keys(e[11]).forEach(r=>{l.indexOf(r)===-1&&(e[11][r].destroy&&e[11][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[13];const t=o.collection1||[],l=[];for(let r=0;r{l.indexOf(r)===-1&&(e[14][r].destroy&&e[14][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[15];const t=o.collection2||[],l=[];for(let r=0;r{l.indexOf(r)===-1&&(e[16][r].destroy&&e[16][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[17];const t=o.collection4||[],l=[];for(let r=0;r{l.indexOf(r)===-1&&(e[18][r].destroy&&e[18][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[19];const t=o.collection4||[],l=[];for(let r=0;r{l.indexOf(r)===-1&&(e[20][r].destroy&&e[20][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[21];const t=o.collection4||[],l=[];for(let r=0;r{console.error("component Square not found")})).call(null,{props:a},e[22][i.item.id],o),e[23][i.item.id][Symbol.for("slots")][0]?(parent=e[23][i.item.id][Symbol.for("slots")][0],o=e[23][i.item.id]):parent=e[23][i.item.id][Symbol.for("children")][0]}e[22][i.item.id].set("x",i.item.x),e[23][i.item.id][Symbol.for("props")].x=i.item.x}e[22]&&Object.keys(e[22]).forEach(r=>{l.indexOf(r)===-1&&(e[22][r].destroy&&e[22][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[24];const t=o.collection4||[],l=[];for(let r=0;r{console.error("component Square not found")})).call(null,{props:a},e[25][i.key],o),e[26][i.key][Symbol.for("slots")][0]?(parent=e[26][i.key][Symbol.for("slots")][0],o=e[26][i.key]):parent=e[26][i.key][Symbol.for("children")][0]}e[25][i.key].set("x",i.item.x),e[26][i.key][Symbol.for("props")].x=i.item.x}e[25]&&Object.keys(e[25]).forEach(r=>{l.indexOf(r)===-1&&(e[25][r].destroy&&e[25][r].destroy(),delete e[1][r])})}],context:{}},state(){return{collection1:[0,100,200,300,400,500],collection2:[{id:"block1",x:0,color:me[0]},{id:"block2",x:100,color:me[1]},{id:"block3",x:200,color:me[2]},{id:"block4",x:300,color:me[3]},{id:"block5",x:400,color:me[4]},{id:"block6",x:500,color:me[5]}],collection3:[],collection4:[{x:0,id:"one"},{x:200,id:"two"},{x:400,id:"three"}],alpha:.5}},hooks:{ready(){this.$setTimeout(()=>{this.collection2[0].color=me[5],this.collection2[1].color=me[4],this.collection2[2].color=me[3],this.collection2[3].color=me[2],this.collection2[4].color=me[1],this.collection2[5].color=me[0]},4e3);let n=0;const o=this.$setInterval(()=>{this.collection3.push({x:n*100,color:me[n]}),n++,n===me.length&&clearInterval(o)},1e3);this.$setTimeout(()=>{this.alpha=this.alpha===.5?1:.5},800),this.$setTimeout(()=>{this.collection4=[{x:100,id:4},{x:500,id:5}]},2e3)}}}),Jo=["pretty","large","big","small","tall","short","long","handsome","plain","quaint","clean","elegant","easy","angry","crazy","helpful","mushy","odd","unsightly","adorable","important","inexpensive","cheap","expensive","fancy"],es=["red","yellow","blue","green","pink","brown","purple","brown","white","black","orange"],ts=["table","chair","house","bbq","desk","car","pony","cookie","sandwich","burger","pizza","mouse","keyboard"],so=n=>Math.round(Math.random()*1e3)%n;let ll=0;const ct=()=>({id:ll++,text:`${Jo[so(Jo.length)]} ${es[so(es.length)]} ${ts[so(ts.length)]}`}),fl=(n=1)=>{const o=[];for(let e=0;e{console.error("component Circle not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.color="0xe5e5e5ff",a.size=32,a.y=10,a.wordwrap=57,a.align="center",a.content=""+e.id,typeof c<"u")for(let y in c.config.props)delete a[c.config.props[y]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.color="0xe5e5e5ff",d.size=32,d.y=10,d.wordwrap=57,d.align="center",d.content=""+e.id,!t[4]){const y=d.is||"Text";t[4]=(s.components&&s.components[y]||e[Symbol.for("components")][y]||(()=>{console.error("component Text not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}const m=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const p={};if(p.color="0xe5e5e5ff",p.x=80,p.y=14,p.size=28,p.content=""+e.text,typeof m<"u")for(let y in m.config.props)delete p[m.config.props[y]];t[5].nodeId||t[5].populate(p),o=t[5];const h={};if(h.color="0xe5e5e5ff",h.x=80,h.y=14,h.size=28,h.content=""+e.text,!t[6]){const y=h.is||"Text";t[6]=(s.components&&s.components[y]||e[Symbol.for("components")][y]||(()=>{console.error("component Text not found")})).call(null,{props:h},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}return t},effects:[],context:{}},props:["id","text"]}),Ys=H.Component("Row",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=500,l.h=60,l.color="0xfff7edff",t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=10,r.h=60,r.color="0x06b6d4ff",t[1].nodeId||t[1].populate(r);const i=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const f={};if(f.content=e.text,f.x=30,f.y=10,f.font="opensans",f.color="0x1e293bff",typeof i<"u")for(let a in i.config.props)delete f[i.config.props[a]];t[2].nodeId||t[2].populate(f),o=t[2];const c={};if(c.content=e.text,c.x=30,c.y=10,c.font="opensans",c.color="0x1e293bff",!t[3]){const a=c.is||"Text";t[3]=(s.components&&s.components[a]||e[Symbol.for("components")][a]||(()=>{console.error("component Text not found")})).call(null,{props:c},t[2],e),t[3][Symbol.for("slots")][0]?(o=t[3][Symbol.for("slots")][0],e=t[3]):o=t[3][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("y",o.index*80)}],context:{}},props:["index","text"]}),cl=H.Component("Row",{components:{Row:Ys},code:{render:function(o,e,s){return[]},effects:[function(o,e,s){const t=o.data||[],l=[];for(let r=0;r{console.error("component Row not found")})).call(null,{props:a},e[0][i.item.id+"key2"],o),e[1][i.item.id+"key2"][Symbol.for("slots")][0]?(parent=e[1][i.item.id+"key2"][Symbol.for("slots")][0],o=e[1][i.item.id+"key2"]):parent=e[1][i.item.id+"key2"][Symbol.for("children")][0]}e[0][i.item.id+"key2"].set("index",i.index),e[1][i.item.id+"key2"][Symbol.for("props")].index=i.index}e[0]&&Object.keys(e[0]).forEach(r=>{l.indexOf(r)===-1&&(e[0][r].destroy&&e[0][r].destroy(),delete e[1][r])})}],context:{}},props:["data"]}),dl=H.Component("ForLoop",{components:{Square:et,LegendItem:al,Row:Ys,Rows:cl},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.x=100,i.y=60,i.size=48,i.content="Array operations test",typeof r<"u")for(let W in r.config.props)delete i[r.config.props[W]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.x=100,f.y=60,f.size=48,f.content="Array operations test",!t[2]){const W=f.is||"Text";t[2]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component Text not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const c={};c.y=170,c.x=140,t[3].nodeId||t[3].populate(c),o=t[3],t[4]||(t[4]=this.element({parent:o||"root"},e));const a={};a.x=-10,a.w=500,a.h=80,a.color="0x64748bff",t[4].nodeId||t[4].populate(a);const d=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[5]||(t[5]=this.element({parent:o||"root"},e));const m={};if(m.y=0,m.id="a",m.text="Fill array by assignment",typeof d<"u")for(let W in d.config.props)delete m[d.config.props[W]];t[5].nodeId||t[5].populate(m),o=t[5];const p={};if(p.y=0,p.id="a",p.text="Fill array by assignment",!t[6]){const W=p.is||"LegendItem";t[6]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:p},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}const h=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[7]||(t[7]=this.element({parent:o||"root"},e));const y={};if(y.y=90,y.id="b",y.text="Push new item to array",typeof h<"u")for(let W in h.config.props)delete y[h.config.props[W]];t[7].nodeId||t[7].populate(y),o=t[7];const g={};if(g.y=90,g.id="b",g.text="Push new item to array",!t[8]){const W=g.is||"LegendItem";t[8]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:g},t[7],e),t[8][Symbol.for("slots")][0]?(o=t[8][Symbol.for("slots")][0],e=t[8]):o=t[8][Symbol.for("children")][0]}const x=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[9]||(t[9]=this.element({parent:o||"root"},e));const _={};if(_.y=180,_.id="c",_.text="Pop item from array",typeof x<"u")for(let W in x.config.props)delete _[x.config.props[W]];t[9].nodeId||t[9].populate(_),o=t[9];const S={};if(S.y=180,S.id="c",S.text="Pop item from array",!t[10]){const W=S.is||"LegendItem";t[10]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:S},t[9],e),t[10][Symbol.for("slots")][0]?(o=t[10][Symbol.for("slots")][0],e=t[10]):o=t[10][Symbol.for("children")][0]}const I=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[11]||(t[11]=this.element({parent:o||"root"},e));const v={};if(v.y=270,v.id="d",v.text="Shift item from array",typeof I<"u")for(let W in I.config.props)delete v[I.config.props[W]];t[11].nodeId||t[11].populate(v),o=t[11];const P={};if(P.y=270,P.id="d",P.text="Shift item from array",!t[12]){const W=P.is||"LegendItem";t[12]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:P},t[11],e),t[12][Symbol.for("slots")][0]?(o=t[12][Symbol.for("slots")][0],e=t[12]):o=t[12][Symbol.for("children")][0]}const b=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[13]||(t[13]=this.element({parent:o||"root"},e));const k={};if(k.y=360,k.id="e",k.text="Splice 2 items from array",typeof b<"u")for(let W in b.config.props)delete k[b.config.props[W]];t[13].nodeId||t[13].populate(k),o=t[13];const L={};if(L.y=360,L.id="e",L.text="Splice 2 items from array",!t[14]){const W=L.is||"LegendItem";t[14]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:L},t[13],e),t[14][Symbol.for("slots")][0]?(o=t[14][Symbol.for("slots")][0],e=t[14]):o=t[14][Symbol.for("children")][0]}const F=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[15]||(t[15]=this.element({parent:o||"root"},e));const R={};if(R.y=450,R.id="f",R.text="Unshift 2 items into array",typeof F<"u")for(let W in F.config.props)delete R[F.config.props[W]];t[15].nodeId||t[15].populate(R),o=t[15];const N={};if(N.y=450,N.id="f",N.text="Unshift 2 items into array",!t[16]){const W=N.is||"LegendItem";t[16]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:N},t[15],e),t[16][Symbol.for("slots")][0]?(o=t[16][Symbol.for("slots")][0],e=t[16]):o=t[16][Symbol.for("children")][0]}const O=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[17]||(t[17]=this.element({parent:o||"root"},e));const $={};if($.y=540,$.id="g",$.text="Empty array by assignment",typeof O<"u")for(let W in O.config.props)delete $[O.config.props[W]];t[17].nodeId||t[17].populate($),o=t[17];const B={};if(B.y=540,B.id="g",B.text="Empty array by assignment",!t[18]){const W=B.is||"LegendItem";t[18]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:B},t[17],e),t[18][Symbol.for("slots")][0]?(o=t[18][Symbol.for("slots")][0],e=t[18]):o=t[18][Symbol.for("children")][0]}const T=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[19]||(t[19]=this.element({parent:o||"root"},e));const w={};if(w.y=630,w.id="h",w.text="Concat an array with items",typeof T<"u")for(let W in T.config.props)delete w[T.config.props[W]];t[19].nodeId||t[19].populate(w),o=t[19];const A={};if(A.y=630,A.id="h",A.text="Concat an array with items",!t[20]){const W=A.is||"LegendItem";t[20]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:A},t[19],e),t[20][Symbol.for("slots")][0]?(o=t[20][Symbol.for("slots")][0],e=t[20]):o=t[20][Symbol.for("children")][0]}const z=s.components&&s.components.LegendItem||e[Symbol.for("components")].LegendItem;o=t[3],t[21]||(t[21]=this.element({parent:o||"root"},e));const M={};if(M.y=720,M.id="i",M.text="Sort array alphabetically",typeof z<"u")for(let W in z.config.props)delete M[z.config.props[W]];t[21].nodeId||t[21].populate(M),o=t[21];const E={};if(E.y=720,E.id="i",E.text="Sort array alphabetically",!t[22]){const W=E.is||"LegendItem";t[22]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component LegendItem not found")})).call(null,{props:E},t[21],e),t[22][Symbol.for("slots")][0]?(o=t[22][Symbol.for("slots")][0],e=t[22]):o=t[22][Symbol.for("children")][0]}o=t[3],t[23]||(t[23]=this.element({parent:o||"root"},e));const Y={};Y.y=840,t[23].nodeId||t[23].populate(Y);const D=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[23],t[24]||(t[24]=this.element({parent:o||"root"},e));const q={};if(q.size=26,q.y=10,q.content="Array length:",typeof D<"u")for(let W in D.config.props)delete q[D.config.props[W]];t[24].nodeId||t[24].populate(q),o=t[24];const U={};if(U.size=26,U.y=10,U.content="Array length:",!t[25]){const W=U.is||"Text";t[25]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component Text not found")})).call(null,{props:U},t[24],e),t[25][Symbol.for("slots")][0]?(o=t[25][Symbol.for("slots")][0],e=t[25]):o=t[25][Symbol.for("children")][0]}const j=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[23],t[26]||(t[26]=this.element({parent:o||"root"},e));const Z={};if(Z.size=40,Z.x=180,Z.color="0xfb923cff",typeof j<"u")for(let W in j.config.props)delete Z[j.config.props[W]];t[26].nodeId||t[26].populate(Z),o=t[26];const V={};if(V.content=e.data.length,V.size=40,V.x=180,V.color="0xfb923cff",!t[27]){const W=V.is||"Text";t[27]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component Text not found")})).call(null,{props:V},t[26],e),t[27][Symbol.for("slots")][0]?(o=t[27][Symbol.for("slots")][0],e=t[27]):o=t[27][Symbol.for("children")][0]}o=t[0],t[28]||(t[28]=this.element({parent:o||"root"},e));const Q={};Q.x=740,Q.y=100,t[28].nodeId||t[28].populate(Q);const oe=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[28],t[29]||(t[29]=this.element({parent:o||"root"},e));const ee={};if(ee.content="For loop on Element",typeof oe<"u")for(let W in oe.config.props)delete ee[oe.config.props[W]];t[29].nodeId||t[29].populate(ee),o=t[29];const K={};if(K.content="For loop on Element",!t[30]){const W=K.is||"Text";t[30]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component Text not found")})).call(null,{props:K},t[29],e),t[30][Symbol.for("slots")][0]?(o=t[30][Symbol.for("slots")][0],e=t[30]):o=t[30][Symbol.for("children")][0]}o=t[0],t[35]||(t[35]=this.element({parent:o||"root"},e));const de={};de.x=1280,de.y=100,t[35].nodeId||t[35].populate(de);const le=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[35],t[36]||(t[36]=this.element({parent:o||"root"},e));const fe={};if(fe.content="For loop on Component",typeof le<"u")for(let W in le.config.props)delete fe[le.config.props[W]];t[36].nodeId||t[36].populate(fe),o=t[36];const ue={};if(ue.content="For loop on Component",!t[37]){const W=ue.is||"Text";t[37]=(s.components&&s.components[W]||e[Symbol.for("components")][W]||(()=>{console.error("component Text not found")})).call(null,{props:ue},t[36],e),t[37][Symbol.for("slots")][0]?(o=t[37][Symbol.for("slots")][0],e=t[37]):o=t[37][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[4].set("y",{transition:o.y})},function(o,e,s){e[4].set("alpha",{transition:!o.hide})},function(o,e,s){e[26].set("content",o.data.length)},function(o,e,s){e[27][Symbol.for("props")].content=o.data.length},function(o,e,s){parent=e[28];const t=o.data||[],l=[];for(let r=0;r{console.error("component Text not found")})).call(null,{props:m},e[33][i.item.id+"key"],o),e[34][i.item.id+"key"][Symbol.for("slots")][0]?(parent=e[34][i.item.id+"key"][Symbol.for("slots")][0],o=e[34][i.item.id+"key"]):parent=e[34][i.item.id+"key"][Symbol.for("children")][0]}e[31][i.item.id+"key"].set("y",i.index*80+50)}e[31]&&Object.keys(e[31]).forEach(r=>{l.indexOf(r)===-1&&(e[31][r].destroy&&e[31][r].destroy(),delete e[1][r])})},function(o,e,s){parent=e[35];const t=o.data||[],l=[];for(let r=0;r{console.error("component Row not found")})).call(null,{props:a},e[38][i.item.id+"key2"],o),e[39][i.item.id+"key2"][Symbol.for("slots")][0]?(parent=e[39][i.item.id+"key2"][Symbol.for("slots")][0],o=e[39][i.item.id+"key2"]):parent=e[39][i.item.id+"key2"][Symbol.for("children")][0]}e[38][i.item.id+"key2"].set("index",i.index),e[39][i.item.id+"key2"][Symbol.for("props")].index=i.index}e[38]&&Object.keys(e[38]).forEach(r=>{l.indexOf(r)===-1&&(e[38][r].destroy&&e[38][r].destroy(),delete e[1][r])})}],context:{}},state(){return{count:0,data:[],x:0,y:0,timeout:null,hide:!0,sortDirection:1}},computed:{show(){return this.hide>0},data2(){return this.data}},watch:{y(){this.hide=!1,this.$clearTimeout(this.timeout),this.timeout=this.$setTimeout(()=>{this.hide=!0},600)}},input:{a(){this.y=-10,this.$trigger("y");const n=[];for(let o=0;o<6;o++)n.push(ct());this.data=n},b(){this.y=80,this.$trigger("y"),this.data.push(ct())},c(){this.y=170,this.$trigger("y"),this.data.pop()},d(){this.y=260,this.$trigger("y"),this.data.shift()},e(){this.y=350,this.$trigger("y"),this.data.splice(2,4)},f(){this.y=440,this.$trigger("y"),this.data.unshift(ct(),ct())},g(){this.y=530,this.$trigger("y"),this.data=[]},h(){this.y=620,this.$trigger("y"),this.data=this.data.concat(fl(3))},i(){this.y=710,this.$trigger("y"),this.data=this.data.sort((n,o)=>{const e=n.text.toLowerCase(),s=o.text.toLowerCase();return this.sortDirection=this.sortDirection===1?0:1,this.sortDirection===1?es?1:0:e>s?-1:e{const o=this.direction==="up"?this.radius+10:this.radius-10;this.radius=Math.max(Math.min(o,80),0),this.radius===80&&(this.direction="down"),this.radius===0&&(this.direction="up")},500);let n=0;this.$setInterval(()=>{n++,n%2?this.effects=[this.shader("borderLeft",{width:20,color:"#be123c"}),this.shader("borderRight",{width:20,color:"#f43f5e"})]:this.effects=[this.shader("borderTop",{width:20,color:"#be123c"}),this.shader("borderBottom",{width:20,color:"#f43f5e"})]},2e3)}}}),hl=H.Component("ShowIf",{components:{Square:et},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.y=40,t[1].nodeId||t[1].populate(r),o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.x=50,i.w=200,i.h=300,i.color="0xbef264ff",i.show=!0,t[2].nodeId||t[2].populate(i),o=t[1],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.x=350,f.w=200,f.h=300,f.color="0xff0000ff",f.show=!1,t[3].nodeId||t[3].populate(f),o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.x=650,c.w=200,c.h=300,c.color="0x84cc16ff",c.show=1,t[4].nodeId||t[4].populate(c),o=t[1],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};a.x=950,a.w=200,a.h=300,a.color="0xff0000ff",a.show=0,t[5].nodeId||t[5].populate(a),o=t[0],t[6]||(t[6]=this.element({parent:o||"root"},e));const d={};d.y=380,t[6].nodeId||t[6].populate(d),o=t[6],t[7]||(t[7]=this.element({parent:o||"root"},e));const m={};m.x=50,m.w=200,m.h=300,m.color="0xfde047ff",m.show=e.showNr,t[7].nodeId||t[7].populate(m),o=t[6],t[8]||(t[8]=this.element({parent:o||"root"},e));const p={};p.x=350,p.w=200,p.h=300,p.color="0x0000ffff",p.show=e.hideNr,t[8].nodeId||t[8].populate(p),o=t[6],t[9]||(t[9]=this.element({parent:o||"root"},e));const h={};h.x=650,h.w=200,h.h=300,h.color="0x84cc16ff",h.show=e.showBool,t[9].nodeId||t[9].populate(h),o=t[6],t[10]||(t[10]=this.element({parent:o||"root"},e));const y={};y.x=950,y.w=200,y.h=300,y.color="0xff0000ff",y.show=e.hideBool,t[10].nodeId||t[10].populate(y),o=t[0],t[11]||(t[11]=this.element({parent:o||"root"},e));const g={};g.y=720,t[11].nodeId||t[11].populate(g),o=t[11],t[12]||(t[12]=this.element({parent:o||"root"},e));const x={};x.x=50,x.w=200,x.h=300,x.color="0x5eead4ff",t[12].nodeId||t[12].populate(x),o=t[0],t[13]||(t[13]=this.element({parent:o||"root"},e));const _={};_.y=40,_.x=1e3,t[13].nodeId||t[13].populate(_);const S=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[13],t[14]||(t[14]=this.element({parent:o||"root"},e));const I={};if(I.show=!0,typeof S<"u")for(let N in S.config.props)delete I[S.config.props[N]];t[14].nodeId||t[14].populate(I),o=t[14];const v={};if(v.show=!0,!t[15]){const N=v.is||"Square";t[15]=(s.components&&s.components[N]||e[Symbol.for("components")][N]||(()=>{console.error("component Square not found")})).call(null,{props:v},t[14],e),t[15][Symbol.for("slots")][0]?(o=t[15][Symbol.for("slots")][0],e=t[15]):o=t[15][Symbol.for("children")][0]}const P=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[13],t[16]||(t[16]=this.element({parent:o||"root"},e));const b={};if(b.y=100,b.show=!1,typeof P<"u")for(let N in P.config.props)delete b[P.config.props[N]];t[16].nodeId||t[16].populate(b),o=t[16];const k={};if(k.y=100,k.show=!1,!t[17]){const N=k.is||"Square";t[17]=(s.components&&s.components[N]||e[Symbol.for("components")][N]||(()=>{console.error("component Square not found")})).call(null,{props:k},t[16],e),t[17][Symbol.for("slots")][0]?(o=t[17][Symbol.for("slots")][0],e=t[17]):o=t[17][Symbol.for("children")][0]}const L=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[13],t[18]||(t[18]=this.element({parent:o||"root"},e));const F={};if(F.y=200,typeof L<"u")for(let N in L.config.props)delete F[L.config.props[N]];t[18].nodeId||t[18].populate(F),o=t[18];const R={};if(R.y=200,R.show=e.showHideToggle,!t[19]){const N=R.is||"Square";t[19]=(s.components&&s.components[N]||e[Symbol.for("components")][N]||(()=>{console.error("component Square not found")})).call(null,{props:R},t[18],e),t[19][Symbol.for("slots")][0]?(o=t[19][Symbol.for("slots")][0],e=t[19]):o=t[19][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[12].set("show",o.showHideToggle)},function(o,e,s){e[18].set("show",o.showHideToggle)},function(o,e,s){e[19][Symbol.for("props")].show=o.showHideToggle}],context:{}},state(){return{showNr:1,hideNr:0,showBool:!0,hideBool:!1,showHideToggle:!0}},hooks:{ready(){this.$setInterval(()=>{console.log("backstopjs:ready"),this.showHideToggle=!this.showHideToggle},2e3),this.$setTimeout(()=>{this.showNr=0,this.hideNr=1,this.showBool=!1,this.hideBool=!0},4e3)}}}),pl=H.Component("Events",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.x=400,l.y=360,t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=280,r.h=280,r.color="0xe5e7ebff",r.y=-5,t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};i.w=250,i.h=250,i.x=10,i.y=10,i.color=e.colors[0],t[2].nodeId||t[2].populate(i),o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const f={};f.w=250,f.h=250,f.x=290,f.y=10,f.color=e.colors[1],t[3].nodeId||t[3].populate(f),o=t[0],t[4]||(t[4]=this.element({parent:o||"root"},e));const c={};c.w=250,c.h=250,c.x=570,c.y=10,c.color=e.colors[2],t[4].nodeId||t[4].populate(c),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const a={};return a.w=250,a.h=250,a.x=850,a.y=10,a.color=e.colors[3],t[5].nodeId||t[5].populate(a),t},effects:[function(o,e,s){e[1].set("x",o.x)}],context:{}},state(){return{count:0,colors:["#fbbf24","#a3e635","#22d3ee","#f472b6"]}},computed:{x(){return this.count*280-5}},hooks:{unfocus(){this.$emit("changeBackground")}},input:{left(n){const o=this.count-1;o===-1?this.parent.focus(n):this.count=Math.max(o,0)},right(n){const o=this.count+1;o===4?this.parent.focus(n):this.count=Math.min(o,3)},enter(){this.$emit("changeBackground",this.colors[this.count])}}}),ml=H.Component("SlotCard",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=300,l.h=500,l.color="{top: '0x94a3b8ff', bottom: '0x475569ff'}",t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r[Symbol.for("isSlot")]=!0,r.x=20,r.y=20,t[1].nodeId||t[1].populate(r);const i=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const f={};if(f.content=e.label,f.wordwrap=260,f.x=20,f.y=400,f.align="center",typeof i<"u")for(let a in i.config.props)delete f[i.config.props[a]];t[2].nodeId||t[2].populate(f),o=t[2];const c={};if(c.content=e.label,c.wordwrap=260,c.x=20,c.y=400,c.align="center",!t[3]){const a=c.is||"Text";t[3]=(s.components&&s.components[a]||e[Symbol.for("components")][a]||(()=>{console.error("component Text not found")})).call(null,{props:c},t[2],e),t[3][Symbol.for("slots")][0]?(o=t[3][Symbol.for("slots")][0],e=t[3]):o=t[3][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("effects",[o.shader("radius",{radius:20}),o.shader("border",{width:6,color:"0xe2e8f0ff"})])}],context:{}},props:[{key:"label"}]}),yl=H.Component("NamedSlotCard",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=700,l.h=300,l.color="{top: '0x94a3b8ff', bottom: '0x475569ff'}",t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.x=20,r.y=20,t[1].nodeId||t[1].populate(r);const i=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[1],t[2]||(t[2]=this.element({parent:o||"root"},e));const f={};if(f.content="First slot",typeof i<"u")for(let v in i.config.props)delete f[i.config.props[v]];t[2].nodeId||t[2].populate(f),o=t[2];const c={};if(c.content="First slot",!t[3]){const v=c.is||"Text";t[3]=(s.components&&s.components[v]||e[Symbol.for("components")][v]||(()=>{console.error("component Text not found")})).call(null,{props:c},t[2],e),t[3][Symbol.for("slots")][0]?(o=t[3][Symbol.for("slots")][0],e=t[3]):o=t[3][Symbol.for("children")][0]}o=t[1],t[4]||(t[4]=this.element({parent:o||"root"},e));const a={};a[Symbol.for("isSlot")]=!0,a.y=40,a.ref="first",t[4].nodeId||t[4].populate(a),o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const d={};d.x=200,d.y=20,t[5].nodeId||t[5].populate(d);const m=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[5],t[6]||(t[6]=this.element({parent:o||"root"},e));const p={};if(p.content="Second slot",typeof m<"u")for(let v in m.config.props)delete p[m.config.props[v]];t[6].nodeId||t[6].populate(p),o=t[6];const h={};if(h.content="Second slot",!t[7]){const v=h.is||"Text";t[7]=(s.components&&s.components[v]||e[Symbol.for("components")][v]||(()=>{console.error("component Text not found")})).call(null,{props:h},t[6],e),t[7][Symbol.for("slots")][0]?(o=t[7][Symbol.for("slots")][0],e=t[7]):o=t[7][Symbol.for("children")][0]}o=t[5],t[8]||(t[8]=this.element({parent:o||"root"},e));const y={};y[Symbol.for("isSlot")]=!0,y.y=40,y.ref="second",t[8].nodeId||t[8].populate(y),o=t[0],t[9]||(t[9]=this.element({parent:o||"root"},e));const g={};g.x=480,g.y=20,t[9].nodeId||t[9].populate(g);const x=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[9],t[10]||(t[10]=this.element({parent:o||"root"},e));const _={};if(_.content="Third slot",typeof x<"u")for(let v in x.config.props)delete _[x.config.props[v]];t[10].nodeId||t[10].populate(_),o=t[10];const S={};if(S.content="Third slot",!t[11]){const v=S.is||"Text";t[11]=(s.components&&s.components[v]||e[Symbol.for("components")][v]||(()=>{console.error("component Text not found")})).call(null,{props:S},t[10],e),t[11][Symbol.for("slots")][0]?(o=t[11][Symbol.for("slots")][0],e=t[11]):o=t[11][Symbol.for("children")][0]}o=t[9],t[12]||(t[12]=this.element({parent:o||"root"},e));const I={};return I[Symbol.for("isSlot")]=!0,I.y=40,I.ref="third",t[12].nodeId||t[12].populate(I),t},effects:[function(o,e,s){e[0].set("effects",[o.shader("radius",{radius:20}),o.shader("border",{width:6,color:"0xe2e8f0ff"})])}],context:{}}}),st=["#fff7ed","#fdba74","#f97316","#ea580c","#9a3412","#431407"],gl=H.Component("Components",{components:{SlotCard:ml,NamedSlotCard:yl,Card:Ws,Square:et},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.SlotCard||e[Symbol.for("components")].SlotCard;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.x=400,i.y=100,i.label="Element",typeof r<"u")for(let U in r.config.props)delete i[r.config.props[U]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.x=400,f.y=100,f.label="Element",!t[2]){const U=f.is||"SlotCard";t[2]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component SlotCard not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}t[3]||(t[3]=this.element({parent:o||"root"},e));const c={};t[3].nodeId||t[3].populate(c),o=t[3],t[4]||(t[4]=this.element({parent:o||"root"},e));const a={};a.w=100,a.h=100,t[4].nodeId||t[4].populate(a);const d=s.components&&s.components.SlotCard||e[Symbol.for("components")].SlotCard;o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const m={};if(m.x=800,m.y=100,m.label="Component",typeof d<"u")for(let U in d.config.props)delete m[d.config.props[U]];t[5].nodeId||t[5].populate(m),o=t[5];const p={};if(p.x=800,p.y=100,p.label="Component",!t[6]){const U=p.is||"SlotCard";t[6]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component SlotCard not found")})).call(null,{props:p},t[5],e),t[6][Symbol.for("slots")][0]?(o=t[6][Symbol.for("slots")][0],e=t[6]):o=t[6][Symbol.for("children")][0]}t[7]||(t[7]=this.element({parent:o||"root"},e));const h={};t[7].nodeId||t[7].populate(h);const y=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[7],t[8]||(t[8]=this.element({parent:o||"root"},e));const g={};if(g.size=200,g.y=50,typeof y<"u")for(let U in y.config.props)delete g[y.config.props[U]];t[8].nodeId||t[8].populate(g),o=t[8];const x={};if(x.size=200,x.y=50,!t[9]){const U=x.is||"Square";t[9]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component Square not found")})).call(null,{props:x},t[8],e),t[9][Symbol.for("slots")][0]?(o=t[9][Symbol.for("slots")][0],e=t[9]):o=t[9][Symbol.for("children")][0]}const _=s.components&&s.components.SlotCard||e[Symbol.for("components")].SlotCard;o=t[0],t[10]||(t[10]=this.element({parent:o||"root"},e));const S={};if(S.x=1200,S.y=100,S.label="Element & Component",typeof _<"u")for(let U in _.config.props)delete S[_.config.props[U]];t[10].nodeId||t[10].populate(S),o=t[10];const I={};if(I.x=1200,I.y=100,I.label="Element & Component",!t[11]){const U=I.is||"SlotCard";t[11]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component SlotCard not found")})).call(null,{props:I},t[10],e),t[11][Symbol.for("slots")][0]?(o=t[11][Symbol.for("slots")][0],e=t[11]):o=t[11][Symbol.for("children")][0]}t[12]||(t[12]=this.element({parent:o||"root"},e));const v={};t[12].nodeId||t[12].populate(v),o=t[12],t[13]||(t[13]=this.element({parent:o||"root"},e));const P={};P.w=100,P.h=100,t[13].nodeId||t[13].populate(P);const b=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[12],t[14]||(t[14]=this.element({parent:o||"root"},e));const k={};if(k.size=200,k.y=150,typeof b<"u")for(let U in b.config.props)delete k[b.config.props[U]];t[14].nodeId||t[14].populate(k),o=t[14];const L={};if(L.size=200,L.y=150,!t[15]){const U=L.is||"Square";t[15]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component Square not found")})).call(null,{props:L},t[14],e),t[15][Symbol.for("slots")][0]?(o=t[15][Symbol.for("slots")][0],e=t[15]):o=t[15][Symbol.for("children")][0]}const F=s.components&&s.components.Card||e[Symbol.for("components")].Card;o=t[0],t[16]||(t[16]=this.element({parent:o||"root"},e));const R={};if(R.x=400,R.y=700,R.size="small",typeof F<"u")for(let U in F.config.props)delete R[F.config.props[U]];t[16].nodeId||t[16].populate(R),o=t[16];const N={};if(N.x=400,N.y=700,N.size="small",!t[17]){const U=N.is||"Card";t[17]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component Card not found")})).call(null,{props:N},t[16],e),t[17][Symbol.for("slots")][0]?(o=t[17][Symbol.for("slots")][0],e=t[17]):o=t[17][Symbol.for("children")][0]}t[18]||(t[18]=this.element({parent:o||"root"},e));const O={};t[18].nodeId||t[18].populate(O),o=t[18],t[19]||(t[19]=this.element({parent:o||"root"},e));const $={};$.w=100,$.h=100,t[19].nodeId||t[19].populate($);const B=s.components&&s.components.NamedSlotCard||e[Symbol.for("components")].NamedSlotCard;o=t[0],t[20]||(t[20]=this.element({parent:o||"root"},e));const T={};if(T.x=800,T.y=700,typeof B<"u")for(let U in B.config.props)delete T[B.config.props[U]];t[20].nodeId||t[20].populate(T),o=t[20];const w={};if(w.x=800,w.y=700,!t[21]){const U=w.is||"NamedSlotCard";t[21]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component NamedSlotCard not found")})).call(null,{props:w},t[20],e),t[21][Symbol.for("slots")][0]?(o=t[21][Symbol.for("slots")][0],e=t[21]):o=t[21][Symbol.for("children")][0]}t[22]||(t[22]=this.element({parent:o||"root"},e));const A={};t[22].nodeId||t[22].populate(A),o=t[22],t[23]||(t[23]=this.element({parent:o||"root"},e));const z={};z.color="0x0891b2ff",z.x=10,z.y=140,z.w=80,z.h=60,z.parent=e[Symbol.for("slots")].filter(U=>U.ref==="second").shift()||e[Symbol.for("slots")][0]||o,z.slot="second",t[23].nodeId||t[23].populate(z),o=t[22],t[24]||(t[24]=this.element({parent:o||"root"},e));const M={};M.w=100,M.h=100,M.parent=e[Symbol.for("slots")].filter(U=>U.ref==="third").shift()||e[Symbol.for("slots")][0]||o,M.slot="third",t[24].nodeId||t[24].populate(M);const E=s.components&&s.components.Square||e[Symbol.for("components")].Square;o=t[22],t[25]||(t[25]=this.element({parent:o||"root"},e));const Y={};if(Y.size=100,Y.parent=e[Symbol.for("slots")].filter(U=>U.ref==="first").shift()||e[Symbol.for("slots")][0]||o,Y.slot="first",typeof E<"u")for(let U in E.config.props)delete Y[E.config.props[U]];t[25].nodeId||t[25].populate(Y),o=t[25];const D={};if(D.size=100,D.slot="first",!t[26]){const U=D.is||"Square";t[26]=(s.components&&s.components[U]||e[Symbol.for("components")][U]||(()=>{console.error("component Square not found")})).call(null,{props:D},t[25],e),t[26][Symbol.for("slots")][0]?(o=t[26][Symbol.for("slots")][0],e=t[26]):o=t[26][Symbol.for("children")][0]}o=t[22],t[27]||(t[27]=this.element({parent:o||"root"},e));const q={};return q.color="0x4d7c0fff",q.x=40,q.y=40,q.w=40,q.h=60,q.parent=e[Symbol.for("slots")].filter(U=>U.ref==="second").shift()||e[Symbol.for("slots")][0]||o,q.slot="second",t[27].nodeId||t[27].populate(q),t},effects:[function(o,e,s){e[4].set("color",o.color)},function(o,e,s){e[13].set("color",o.color)},function(o,e,s){e[19].set("color",o.color)},function(o,e,s){e[24].set("color",o.color)}],context:{}},state(){return{color:st[0]}},hooks:{ready(){this.$setInterval(()=>{const n=st.indexOf(this.color)+1;this.color=n<=st.length?st[n]:st[0]},600)}}}),xl=H.Component("MemoryCard",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=320,l.h=200,l.x=e.col*360,l.y=e.row*250,t[0].nodeId||t[0].populate(l),o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const r={};r.w=320,r.y=125,r.mount="{y: 0.5}",t[1].nodeId||t[1].populate(r),o=t[0],t[2]||(t[2]=this.element({parent:o||"root"},e));const i={};return i.w=320,i.y=125,i.mount="{y: 0.5}",t[2].nodeId||t[2].populate(i),t},effects:[function(o,e,s){e[0].set("scale",{transition:o.scale})},function(o,e,s){e[0].set("rotation",{transition:o.disabled?-2:0})},function(o,e,s){e[1].set("h",{transition:o.h})},function(o,e,s){e[1].set("color",{transition:o.disabled?"#ccc":"#fff"})},function(o,e,s){e[1].set("src",o.image+"&w=320&h=200")},function(o,e,s){e[1].set("effects",[o.shader("radius",{radius:6})])},function(o,e,s){e[1].set("show",o.open)},function(o,e,s){e[2].set("h",{transition:o.h})},function(o,e,s){e[2].set("color",o.open?"0x00000000":{top:"0xefefefff",bottom:"0xaaaaaaff"})},function(o,e,s){e[2].set("effects",[o.shader("radius",{radius:6})])}],context:{}},props:["row","col","image","description","index"],state(){return{disabled:!1,open:!1,h:200,scale:1}},hooks:{init(){this.$listen("closeMemoryCard",n=>{n===this.index&&this.$setTimeout(()=>this.flip(),1e3)}),this.$listen("deactivateMemoryCard",n=>{n===this.index&&(this.$setTimeout(()=>{this.scale=1.16},500),this.$setTimeout(()=>{this.disabled=!0,this.scale=1},800))})},focus(n){this.scale=1.08;const o="Card "+(this.index+1)+(this.disabled?" (disabled)":"");this.$announcer.speak(o)},unfocus(){this.scale=1}},input:{enter(){if(!this.disabled){if(this.open){this.$announcer.speak("Card already open. Choose another");return}this.flip(),this.$announcer.speak(`Image of a ${this.description}`),this.$emit("selectMemoryCard",this.index)}}},methods:{flip(){this.h=0,this.$setTimeout(()=>{this.open=!this.open,this.h=200},250)}}}),os=[{image:"https://images.pexels.com/photos/106399/pexels-photo-106399.jpeg?auto=compress&cs=tinysrgb",description:"House"},{image:"https://images.pexels.com/photos/2902440/pexels-photo-2902440.jpeg?auto=compress&cs=tinysrgb",description:"Tree"},{image:"https://images.pexels.com/photos/686094/pexels-photo-686094.jpeg?auto=compress&cs=tinysrgb",description:"Dog"},{image:"https://images.pexels.com/photos/1302290/pexels-photo-1302290.jpeg?auto=compress&cs=tinysrgb",description:"Cat"},{image:"https://images.pexels.com/photos/627678/pexels-photo-627678.jpeg?auto=compress&cs=tinysrgb",description:"Car"},{image:"https://images.pexels.com/photos/1616566/pexels-photo-1616566.jpeg?auto=compress&cs=tinysrgb",description:"Bicycle"}],bl=H.Component("Announcer",{components:{MemoryCard:xl},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(i.font="raleway",i.size=80,i.color="0xffffffff",i.content="Let's play memory!",i.x=580,i.y=60,typeof r<"u")for(let p in r.config.props)delete i[r.config.props[p]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(f.font="raleway",f.size=80,f.color="0xffffffff",f.content="Let's play memory!",f.x=580,f.y=60,!t[2]){const p=f.is||"Text";t[2]=(s.components&&s.components[p]||e[Symbol.for("components")][p]||(()=>{console.error("component Text not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.Text||e[Symbol.for("components")].Text;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.font="kalam",a.size=40,a.color="0xb91c1cff",a.content="the Accessible edition :)",a.x=1200,a.y=170,a.rotation=-6,typeof c<"u")for(let p in c.config.props)delete a[c.config.props[p]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.font="kalam",d.size=40,d.color="0xb91c1cff",d.content="the Accessible edition :)",d.x=1200,d.y=170,d.rotation=-6,!t[4]){const p=d.is||"Text";t[4]=(s.components&&s.components[p]||e[Symbol.for("components")][p]||(()=>{console.error("component Text not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}o=t[0],t[5]||(t[5]=this.element({parent:o||"root"},e));const m={};return m.x=260,m.y=260,t[5].nodeId||t[5].populate(m),t},effects:[function(o,e,s){parent=e[5];const t=o.cards||[],l=[];for(let r=0;r{console.error("component MemoryCard not found")})).call(null,{props:a},e[6][i.key],o),e[7][i.key][Symbol.for("slots")][0]?(parent=e[7][i.key][Symbol.for("slots")][0],o=e[7][i.key]):parent=e[7][i.key][Symbol.for("children")][0]}e[6][i.key].set("col",i.index%4),e[6][i.key].set("row",Math.floor(i.index/4)%3),e[6][i.key].set("key",i.card.image),e[6][i.key].set("ref","card"+i.index),e[6][i.key].set("index",i.index),e[7][i.key][Symbol.for("props")].col=i.index%4,e[7][i.key][Symbol.for("props")].row=Math.floor(i.index/4)%3,e[7][i.key][Symbol.for("props")].key=i.card.image,e[7][i.key][Symbol.for("props")].ref="card"+i.index,e[7][i.key][Symbol.for("props")].index=i.index}e[6]&&Object.keys(e[6]).forEach(r=>{l.indexOf(r)===-1&&(e[6][r].destroy&&e[6][r].destroy(),delete e[1][r])})}],context:{}},state(){return{cards:os.concat(os),focusedRow:-1,focusedCol:-1,openCards:[],pairs:0}},hooks:{init(){this.shuffle(),this.$listen("selectMemoryCard",n=>{this.openCards.length<2&&this.openCards.push(n),this.openCards.length===2&&(this.cards[this.openCards[0]].description===this.cards[this.openCards[1]].description?(this.$emit("deactivateMemoryCard",this.openCards[0]),this.$emit("deactivateMemoryCard",this.openCards[1]),this.pairs++,this.$setTimeout(()=>{this.$announcer.speak(this.pairs===this.cards.length/2?"Congratulations, you found all pairs!":`You found a pair! ${this.cards.length/2-this.pairs} more to go.`)},1500)):(this.$emit("closeMemoryCard",this.openCards[0]),this.$emit("closeMemoryCard",this.openCards[1]),this.$setTimeout(()=>{this.$announcer.speak("No match. Try again")},1500)),this.openCards.length=0)})},destroy(){this.$announcer.speak("Thanks for playing Memory")}},watch:{focusedCol(n){if(this.focusedRow===-1){this.focusedRow=0;return}n=n+this.focusedRow*4,this.select("card"+n).focus()},focusedRow(n){if(this.focusedCol===-1){this.focusedCol=0;return}n=this.focusedCol+n*4,this.select("card"+n).focus()}},methods:{shuffle(){this.cards.sort(()=>.5-Math.random())}},input:{left(){this.focusedCol===0?this.focusedRow===0?this.$announcer.speak("You are already at the first card"):(this.focusedCol=3,this.focusedRow--):this.focusedCol=Math.max(0,this.focusedCol-1)},right(){this.focusedCol===3?this.focusedRow===2?this.$announcer.speak("You are already at the last card"):(this.focusedCol=0,this.focusedRow++):this.focusedCol=Math.min(3,this.focusedCol+1)},up(){this.focusedCol===0&&this.$announcer.speak("You are already at the first card"),this.focusedRow=Math.max(0,this.focusedRow-1)},down(){this.focusedRow===2&&this.$announcer.speak("You are already at the last card"),this.focusedRow=Math.min(2,this.focusedRow+1)}}}),nt=(n,o)=>Math.floor(Math.random()*(o-n+1)+n),Sl=H.Component("Item",{code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return l.src="assets/blits-b-small.png",l.w=96,l.h=168,t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){e[0].set("x",{transition:{value:o.x,duration:2900}})},function(o,e,s){e[0].set("y",{transition:{value:o.y,duration:2900}})},function(o,e,s){e[0].set("rotation",{transition:{value:o.rotation,duration:2900}})},function(o,e,s){e[0].set("scale",{transition:{value:o.scale,duration:1e3}})}],context:{}},state(){return{x:nt(20,1560),y:nt(20,720),rotation:0,scale:.1}},hooks:{ready(){this.scale=1,this.$setInterval(()=>{this.scale=1,this.x=nt(20,1740),this.y=nt(20,900),this.rotation=nt(10,360)},3e3)}}}),wl=H.Component("Exponential",{components:{Item:Sl},code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};return t[0].nodeId||t[0].populate(l),t},effects:[function(o,e,s){parent=e[0];const t=o.items||[],l=[];for(let r=0;r{console.error("component Item not found")})).call(null,{props:a},e[1][i.item],o),e[2][i.item][Symbol.for("slots")][0]?(parent=e[2][i.item][Symbol.for("slots")][0],o=e[2][i.item]):parent=e[2][i.item][Symbol.for("children")][0]}}e[1]&&Object.keys(e[1]).forEach(r=>{l.indexOf(r)===-1&&(e[1][r].destroy&&e[1][r].destroy(),delete e[1][r])})}],context:{}},state(){return{items:[]}},hooks:{ready(){const n=this.$setInterval(()=>{for(let o=0;o<=Math.floor(this.items.length/10);o++)this.items.push(`item${this.items.length}`);this.$log.info("# items",this.items.length),this.items.length>1&&clearInterval(n)},2e3)}}}),Tl=H.Application({code:{render:function(o,e,s){const t=[];t[0]||(t[0]=this.element({parent:o||"root"},e));const l={};l.w=1920,l.h=1080,t[0].nodeId||t[0].populate(l);const r=s.components&&s.components.RouterView||e[Symbol.for("components")].RouterView;o=t[0],t[1]||(t[1]=this.element({parent:o||"root"},e));const i={};if(typeof r<"u")for(let m in r.config.props)delete i[r.config.props[m]];t[1].nodeId||t[1].populate(i),o=t[1];const f={};if(!t[2]){const m=f.is||"RouterView";t[2]=(s.components&&s.components[m]||e[Symbol.for("components")][m]||(()=>{console.error("component RouterView not found")})).call(null,{props:f},t[1],e),t[2][Symbol.for("slots")][0]?(o=t[2][Symbol.for("slots")][0],e=t[2]):o=t[2][Symbol.for("children")][0]}const c=s.components&&s.components.FPScounter||e[Symbol.for("components")].FPScounter;o=t[0],t[3]||(t[3]=this.element({parent:o||"root"},e));const a={};if(a.x=1610,typeof c<"u")for(let m in c.config.props)delete a[c.config.props[m]];t[3].nodeId||t[3].populate(a),o=t[3];const d={};if(d.x=1610,d.show=e.showFPS,!t[4]){const m=d.is||"FPScounter";t[4]=(s.components&&s.components[m]||e[Symbol.for("components")][m]||(()=>{console.error("component FPScounter not found")})).call(null,{props:d},t[3],e),t[4][Symbol.for("slots")][0]?(o=t[4][Symbol.for("slots")][0],e=t[4]):o=t[4][Symbol.for("children")][0]}return t},effects:[function(o,e,s){e[0].set("color",o.backgroundColor)},function(o,e,s){e[3].set("show",o.showFPS)},function(o,e,s){e[4][Symbol.for("props")].show=o.showFPS}],context:{}},state(){return{backgroundColor:"#1e293b",showFPS:!0}},routes:[{path:"/",component:Ir,options:{keepAlive:!0}},{path:"/demos/loading",component:()=>as(()=>import("./Loading-5324ffc8.js"),[])},{path:"/demos/intro",component:()=>new Promise(n=>{n(kr)})},{path:"/demos/theming",component:Lr},{path:"/demos/tmdb",component:Yr},{path:"/demos/sprites",component:Hr},{path:"/demos/focushandling",component:qr},{path:"/demos/memory-game",component:bl,announce:"Let's play Memory"},{path:"/examples/positioning",component:jr},{path:"/examples/colors",component:Kr},{path:"/examples/gradients",component:Zr},{path:"/examples/transitions",component:Qr},{path:"/examples/alpha",component:Jr},{path:"/examples/scaling",component:el},{path:"/examples/rotation",component:tl},{path:"/examples/keyinput",component:ol},{path:"/examples/texts",component:sl},{path:"/examples/images",component:nl},{path:"/examples/components",component:il},{path:"/examples/forloop",component:rl},{path:"/examples/forloop-advanced",component:dl},{path:"/examples/effects",component:ul},{path:"/examples/showif",component:hl},{path:"/examples/events",component:pl},{path:"/examples/slots",component:gl},{path:"/benchmarks/exponential",component:wl}],hooks:{ready(){this.$listen("changeBackground",n=>{this.backgroundColor=n?n+80:"#1e293b"})}},input:{escape(){this.quit()},back(){this.$router.to("/")}}});H.Launch(Tl,"app",{w:1920,h:1080,multithreaded:!1,debugLevel:1,reactivityMode:"Proxy",keymap:cr(),fonts:[{family:"lato",type:"msdf",file:"fonts/Lato-Regular.ttf"},{family:"raleway",type:"msdf",file:"fonts/Raleway-ExtraBold.ttf"},{family:"opensans",type:"web",file:"fonts/OpenSans-Medium.ttf"},{family:"kalam",type:"msdf",file:"fonts/Kalam-Regular.ttf"}]});export{H as B,et as S}; diff --git a/assets/player/pause.png b/assets/player/pause.png new file mode 100644 index 0000000000000000000000000000000000000000..2a148f71025535b91dd041d78cc905df6718286f GIT binary patch literal 679 zcmV;Y0$BZtP)eFOdeeQr;;0ibej-7K?zW9BSGzZ=SFM-FEp4l2bclY#M1Al;Dz~@eS zB+Vp!RXCTDjtmyRko3bq&$*;WT@t=CNLKU3z<>{idOkJd`%36}sOWpV8c2+q7tH~m z0SAT&4-jdORcTSpk{>E4-PJz)Gu*+oW0b5s;R(GYzD_~MpF{#Be z!X_A9%hW2MMG6B#|HY^phu#FEUzHANu_>6m0WFFFo-ymACxqyKP^p020&+8k>wu_~ z3dk)WH^qS50&-If$Soi@#em!ba#IXQkYkx3$JP`Batp}Ky65bMLiFk>6_8s%Zi)e( zu|aq3KwAARMFoU3)%ro~Xp}AB8MAggBwlnaL+=5THy}Dg-vSo%H^v(D&5(00%NDS{ z7bq2wdHzPG)&n|S3GVVKkfjHN#W~g-2gu;J-?e@{sUruJWzIWK#~9e N002ovPDHLkV1oR(DuVz3 literal 0 HcmV?d00001 diff --git a/assets/player/play.png b/assets/player/play.png new file mode 100644 index 0000000000000000000000000000000000000000..6b0cf43c0eb8f192f3ca4d9f0fb9beac219af998 GIT binary patch literal 1000 zcmV>P)ygaIi(tJ~GF*m^RfuF1iGlzH{4*qSn-PUUETCI$6n^}N{H z`a)fsvjHi;s}HCXu{HLjKm$^asW->g*-Cq%D!Op32llIPsTUUwW8FsQd8jx}k@TU5jx?#{s>TE#DjldV`6Y83*gPULgzyxp~N!z?F zOWUk^8_dcKum|`+y`rB1O*0^66L3g*GoJ!M{vqX;BnxY z5W-?V1DayMGVl`cUTs@EvdqNp&AcJk)aqoC0Qnr$Pv) zhMlZV1}p=w0{4dye#mRmx)|^Y$#wo=-V;~72K)rv4qRD;c&P3QSOlI1W?O%{7C{va z*azGjLinbPVC@Dhml3oJp8@xT5Z);>XnPHaVZd?V4&d^##Y5an;BVkr;IR_>%gHx;}P(g=6yi?3_tEJ8Dwk3fZSy1^xj; WEbZXo*9-Rm0000 html, body, * { padding: 0; margin: 0} - +