From 02cbd3a225412f20981fb054130c8290003db7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Sun, 24 Nov 2024 14:28:40 +0100 Subject: [PATCH 1/4] Allow global components in tests. --- core/tests/tests/GlobalComponent.mint | 11 +++++ runtime/src/testing.js | 59 +++++++++++++++++------ spec/compilers/test | 21 ++++++++ spec/compilers/test_with_global_component | 36 ++++++++++++++ spec/compilers_spec.cr | 9 +++- src/assets/runtime_test.js | 10 ++-- src/compiler.cr | 9 ++++ src/compilers/suite.cr | 2 +- src/compilers/test.cr | 2 +- 9 files changed, 136 insertions(+), 23 deletions(-) create mode 100644 core/tests/tests/GlobalComponent.mint create mode 100644 spec/compilers/test create mode 100644 spec/compilers/test_with_global_component diff --git a/core/tests/tests/GlobalComponent.mint b/core/tests/tests/GlobalComponent.mint new file mode 100644 index 000000000..4c7b46d88 --- /dev/null +++ b/core/tests/tests/GlobalComponent.mint @@ -0,0 +1,11 @@ +global component GlobalTest { + fun render : Html { +
+ } +} + +suite "Global Component" { + test "It renders on the page" { + Dom.getElementBySelector(".global-component") != Maybe.Nothing + } +} diff --git a/runtime/src/testing.js b/runtime/src/testing.js index ba0aace64..a611fad89 100644 --- a/runtime/src/testing.js +++ b/runtime/src/testing.js @@ -1,4 +1,5 @@ import { compare } from "./equality"; +import { render, h } from "preact"; // This is a class for tests. It allows to have multiple steps which are // evaluated asynchronously. @@ -50,8 +51,12 @@ class TestContext { // This is the test runner which runs the tests and sends reports to // the CLI using websockets. class TestRunner { - constructor(suites, url, id) { + constructor(suites, globals, url, id) { + this.root = document.createElement("div") + document.body.appendChild(this.root); + this.socket = new WebSocket(url); + this.globals = globals; this.suites = suites; this.url = url; this.id = id; @@ -92,6 +97,16 @@ class TestRunner { this.start(); } + renderGlobals() { + const components = []; + + for (let key in this.globals) { + components.push(h(this.globals[key], { key: key })); + } + + render(components, this.root); + } + start() { if (this.socket.readyState === 1) { this.run(); @@ -137,7 +152,31 @@ class TestRunner { this.report("LOG", null, null, message); } - next(resolve, reject) { + cleanSlate() { + return new Promise((resolve) => { + // Cleanup globals. + render(null, this.root); + + // Set the URL to the root one. + if (window.location.pathname !== "/") { + window.history.replaceState({}, "", "/"); + } + + // Clear storages. + sessionStorage.clear(); + localStorage.clear(); + + // TODO: Reset Stores + + // Wait for rendering. + requestAnimationFrame(() => { + this.renderGlobals(); + requestAnimationFrame(resolve); + }) + }) + } + + next(resolve) { requestAnimationFrame(async () => { if (!this.suite || this.suite.tests.length === 0) { this.suite = this.suites.shift(); @@ -152,18 +191,9 @@ class TestRunner { const test = this.suite.tests.shift(); try { - const result = await test.proc.call(this.suite.context); + await this.cleanSlate(); - // Set the URL to the root one. - if (window.location.pathname !== "/") { - window.history.replaceState({}, "", "/"); - } - - // Clear storages. - sessionStorage.clear(); - localStorage.clear(); - - // TODO: Reset Stores + const result = await test.proc(); if (result instanceof TestContext) { try { @@ -180,11 +210,12 @@ class TestRunner { } } } catch (error) { + console.log(error) // An error occurred while trying to run a test; this is different from the test itself failing. this.reportTested(test, "ERRORED", error); } - this.next(resolve, reject); + this.next(resolve); }); } } diff --git a/spec/compilers/test b/spec/compilers/test new file mode 100644 index 000000000..2e0140fde --- /dev/null +++ b/spec/compilers/test @@ -0,0 +1,21 @@ +suite "Test" { + test "X" { + true + } +} +-------------------------------------------------------------------------------- +import { testRunner as A } from "./runtime.js"; + +export default () => { + new A([{ + tests: [{ + proc: () => { + return true + }, + location: {"start":[2,2],"end":[4,3],"filename":"compilers/test"}, + name: `X` + }], + location: {"start":[1,0],"end":[5,1],"filename":"compilers/test"}, + name: `Test` + }], {}, ``, ``) +}; diff --git a/spec/compilers/test_with_global_component b/spec/compilers/test_with_global_component new file mode 100644 index 000000000..a639258ae --- /dev/null +++ b/spec/compilers/test_with_global_component @@ -0,0 +1,36 @@ +global component Modal { + fun render : Html { +
"Hello"
+ } +} + +suite "Test" { + test "X" { + true + } +} +-------------------------------------------------------------------------------- +import { + createElement as A, + testRunner as B +} from "./runtime.js"; + +export const C = () => { + return A(`div`, {}, [`Hello`]) +}; + +export default () => { + new B([{ + tests: [{ + proc: () => { + return true + }, + location: {"start":[8,2],"end":[10,3],"filename":"compilers/test_with_global_component"}, + name: `X` + }], + location: {"start":[7,0],"end":[11,1],"filename":"compilers/test_with_global_component"}, + name: `Test` + }], { + C: C + }, ``, ``) +}; diff --git a/spec/compilers_spec.cr b/spec/compilers_spec.cr index 2ce71e0b1..4b8d12c7f 100644 --- a/spec/compilers_spec.cr +++ b/spec/compilers_spec.cr @@ -17,18 +17,23 @@ Dir artifacts = Mint::TypeChecker.check(ast) + test_information = + if File.basename(file).starts_with?("test") + {url: "", id: "", glob: "**"} + end + config = Mint::Bundler::Config.new( json: Mint::MintJson.parse("{}", "mint.json"), generate_source_maps: false, generate_manifest: false, include_program: false, + test: test_information, live_reload: false, runtime_path: nil, skip_icons: false, hash_assets: true, - optimize: false, - test: nil) + optimize: false) files = Mint::Bundler.new( diff --git a/src/assets/runtime_test.js b/src/assets/runtime_test.js index 02723f8f7..cbaf4fe12 100644 --- a/src/assets/runtime_test.js +++ b/src/assets/runtime_test.js @@ -1,9 +1,9 @@ -var Or=Object.create;var _t=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Rr=Object.prototype.hasOwnProperty;var we=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Cr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pr(t))!Rr.call(e,i)&&i!==r&&_t(e,i,{get:()=>t[i],enumerable:!(n=Tr(t,i))||n.enumerable});return e};var pt=(e,t,r)=>(r=e!=null?Or(Nr(e)):{},Cr(t||!e||!e.__esModule?_t(r,"default",{value:e,enumerable:!0}):r,e));var Kt=C(()=>{});var Jt=C((Wi,ut)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=a,c.clearBuffer=function(){e=null,t=0},c.test=function(l){return typeof l=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(l):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof ut<"u"&&typeof we=="function"?(i=i||Kt(),ut.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(l){var f=new Uint8Array(l);return i.getRandomValues(f),Array.from(f)}:function(l){var f=new Uint8Array(l);return i.getRandomValues(f),f}}return function(l){var f,u=[];for(f=0;fc.BUFFER_SIZE)&&(t=0,e=c.randomBytes(c.BUFFER_SIZE)),e.slice(t,t+=l)}function a(){var l=o(16);return l[6]=l[6]&15|64,l[8]=l[8]&63|128,l}function c(){var l=a();return r[l[0]]+r[l[1]]+r[l[2]]+r[l[3]]+"-"+r[l[4]]+r[l[5]]+"-"+r[l[6]]+r[l[7]]+"-"+r[l[8]]+r[l[9]]+"-"+r[l[10]]+r[l[11]]+r[l[12]]+r[l[13]]+r[l[14]]+r[l[15]]}})()});var lr=C(pe=>{var Le=function(){var e=function(f,u,s,_){for(s=s||{},_=f.length;_--;s[f[_]]=u);return s},t=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,_,h,p,d,m){var v=d.length-1;switch(p){case 1:return new h.Root({},[d[v-1]]);case 2:return new h.Root({},[new h.Literal({value:""})]);case 3:this.$=new h.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new h.Literal({value:d[v]});break;case 7:this.$=new h.Splat({name:d[v]});break;case 8:this.$=new h.Param({name:d[v]});break;case 9:this.$=new h.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[2,2]},e(o,[2,4]),e(o,[2,5]),e(o,[2,6]),e(o,[2,7]),e(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),{1:[2,1]},e(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:t,12:[1,16],13:r,14:n,15:i},e(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let h=function(p,d){this.message=p,this.hash=d};var _=h;throw h.prototype=Error,new h(u,s)}},parse:function(u){var s=this,_=[0],h=[],p=[null],d=[],m=this.table,v="",w=0,T=0,W=0,G=2,ie=1,X=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var U in this.yy)Object.prototype.hasOwnProperty.call(this.yy,U)&&(E.yy[U]=this.yy[U]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Ve=x.yylloc;d.push(Ve);var Ar=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zn(R){_.length=_.length-2*R,p.length=p.length-R,d.length=d.length-R}for(var qr=function(){var R;return R=x.lex()||ie,typeof R!="number"&&(R=s.symbols_[R]||R),R},A,Fe,Y,O,Kn,je,Z={},me,L,ht,ge;;){if(Y=_[_.length-1],this.defaultActions[Y]?O=this.defaultActions[Y]:((A===null||typeof A>"u")&&(A=qr()),O=m[Y]&&m[Y][A]),typeof O>"u"||!O.length||!O[0]){var Be="";ge=[];for(me in m[Y])this.terminals_[me]&&me>G&&ge.push("'"+this.terminals_[me]+"'");x.showPosition?Be="Parse error on line "+(w+1)+`: +var Or=Object.create;var _t=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Rr=Object.prototype.hasOwnProperty;var we=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Cr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pr(t))!Rr.call(e,i)&&i!==r&&_t(e,i,{get:()=>t[i],enumerable:!(n=Tr(t,i))||n.enumerable});return e};var pt=(e,t,r)=>(r=e!=null?Or(Nr(e)):{},Cr(t||!e||!e.__esModule?_t(r,"default",{value:e,enumerable:!0}):r,e));var Kt=I(()=>{});var Jt=I((Gi,ut)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);l.BUFFER_SIZE=4096,l.bin=a,l.clearBuffer=function(){e=null,t=0},l.test=function(c){return typeof c=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(c):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof ut<"u"&&typeof we=="function"?(i=i||Kt(),ut.exports=l):typeof window<"u"&&(window.uuid=l),l.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(c){var f=new Uint8Array(c);return i.getRandomValues(f),Array.from(f)}:function(c){var f=new Uint8Array(c);return i.getRandomValues(f),f}}return function(c){var f,u=[];for(f=0;fl.BUFFER_SIZE)&&(t=0,e=l.randomBytes(l.BUFFER_SIZE)),e.slice(t,t+=c)}function a(){var c=o(16);return c[6]=c[6]&15|64,c[8]=c[8]&63|128,c}function l(){var c=a();return r[c[0]]+r[c[1]]+r[c[2]]+r[c[3]]+"-"+r[c[4]]+r[c[5]]+"-"+r[c[6]]+r[c[7]]+"-"+r[c[8]]+r[c[9]]+"-"+r[c[10]]+r[c[11]]+r[c[12]]+r[c[13]]+r[c[14]]+r[c[15]]}})()});var lr=I(pe=>{var Le=function(){var e=function(f,u,s,_){for(s=s||{},_=f.length;_--;s[f[_]]=u);return s},t=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,_,h,p,d,m){var v=d.length-1;switch(p){case 1:return new h.Root({},[d[v-1]]);case 2:return new h.Root({},[new h.Literal({value:""})]);case 3:this.$=new h.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new h.Literal({value:d[v]});break;case 7:this.$=new h.Splat({name:d[v]});break;case 8:this.$=new h.Param({name:d[v]});break;case 9:this.$=new h.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[2,2]},e(o,[2,4]),e(o,[2,5]),e(o,[2,6]),e(o,[2,7]),e(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),{1:[2,1]},e(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:t,12:[1,16],13:r,14:n,15:i},e(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let h=function(p,d){this.message=p,this.hash=d};var _=h;throw h.prototype=Error,new h(u,s)}},parse:function(u){var s=this,_=[0],h=[],p=[null],d=[],m=this.table,v="",w=0,P=0,G=0,Y=2,ie=1,Z=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(E.yy[V]=this.yy[V]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Ve=x.yylloc;d.push(Ve);var Ar=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zn(C){_.length=_.length-2*C,p.length=p.length-C,d.length=d.length-C}for(var qr=function(){var C;return C=x.lex()||ie,typeof C!="number"&&(C=s.symbols_[C]||C),C},A,Fe,z,O,Kn,je,Q={},me,L,ht,ge;;){if(z=_[_.length-1],this.defaultActions[z]?O=this.defaultActions[z]:((A===null||typeof A>"u")&&(A=qr()),O=m[z]&&m[z][A]),typeof O>"u"||!O.length||!O[0]){var Be="";ge=[];for(me in m[z])this.terminals_[me]&&me>Y&&ge.push("'"+this.terminals_[me]+"'");x.showPosition?Be="Parse error on line "+(w+1)+`: `+x.showPosition()+` -Expecting `+ge.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Be="Parse error on line "+(w+1)+": Unexpected "+(A==ie?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Be,{text:x.match,token:this.terminals_[A]||A,line:x.yylineno,loc:Ve,expected:ge})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+A);switch(O[0]){case 1:_.push(A),p.push(x.yytext),d.push(x.yylloc),_.push(O[1]),A=null,Fe?(A=Fe,Fe=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,Ve=x.yylloc,W>0&&W--);break;case 2:if(L=this.productions_[O[1]][1],Z.$=p[p.length-L],Z._$={first_line:d[d.length-(L||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(L||1)].first_column,last_column:d[d.length-1].last_column},Ar&&(Z._$.range=[d[d.length-(L||1)].range[0],d[d.length-1].range[1]]),je=this.performAction.apply(Z,[v,T,w,E.yy,O[1],p,d].concat(X)),typeof je<"u")return je;L&&(_=_.slice(0,-1*L*2),p=p.slice(0,-1*L),d=d.slice(0,-1*L)),_.push(this.productions_[O[1]][0]),p.push(Z.$),d.push(Z._$),ht=m[_[_.length-2]][_[_.length-1]],_.push(ht);break;case 3:return!0}}return!0}},c=function(){var f={EOF:1,parseError:function(s,_){if(this.yy.parser)this.yy.parser.parseError(s,_);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,_=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_.length-1&&(this.yylineno-=_.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===h.length?this.yylloc.first_column:0)+h[h.length-_.length].length-_[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+ge.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Be="Parse error on line "+(w+1)+": Unexpected "+(A==ie?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Be,{text:x.match,token:this.terminals_[A]||A,line:x.yylineno,loc:Ve,expected:ge})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+A);switch(O[0]){case 1:_.push(A),p.push(x.yytext),d.push(x.yylloc),_.push(O[1]),A=null,Fe?(A=Fe,Fe=null):(P=x.yyleng,v=x.yytext,w=x.yylineno,Ve=x.yylloc,G>0&&G--);break;case 2:if(L=this.productions_[O[1]][1],Q.$=p[p.length-L],Q._$={first_line:d[d.length-(L||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(L||1)].first_column,last_column:d[d.length-1].last_column},Ar&&(Q._$.range=[d[d.length-(L||1)].range[0],d[d.length-1].range[1]]),je=this.performAction.apply(Q,[v,P,w,E.yy,O[1],p,d].concat(Z)),typeof je<"u")return je;L&&(_=_.slice(0,-1*L*2),p=p.slice(0,-1*L),d=d.slice(0,-1*L)),_.push(this.productions_[O[1]][0]),p.push(Q.$),d.push(Q._$),ht=m[_[_.length-2]][_[_.length-1]],_.push(ht);break;case 3:return!0}}return!0}},l=function(){var f={EOF:1,parseError:function(s,_){if(this.yy.parser)this.yy.parser.parseError(s,_);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,_=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_.length-1&&(this.yylineno-=_.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===h.length?this.yylloc.first_column:0)+h[h.length-_.length].length-_[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),s=new Array(u.length+1).join("-");return u+this.upcomingInput()+` `+s+"^"},test_match:function(u,s){var _,h,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),h=u[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],_=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var d in p)this[d]=p[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,_,h;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;ds[0].length)){if(s=_,h=d,this.options.backtrack_lexer){if(u=this.test_match(_,p[d]),u!==!1)return u;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(u=this.test_match(s,p[h]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,_,h,p){var d=p;switch(h){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return f}();a.lexer=c;function l(){this.yy={}}return l.prototype=a,a.Parser=l,new l}();typeof we<"u"&&typeof pe<"u"&&(pe.parser=Le,pe.Parser=Le.Parser,pe.parse=function(){return Le.parse.apply(Le,arguments)})});var lt=C((Co,cr)=>{"use strict";function ne(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}cr.exports={Root:ne("Root"),Concat:ne("Concat"),Literal:ne("Literal"),Splat:ne("Splat"),Param:ne("Param"),Optional:ne("Optional")}});var _r=C((Io,hr)=>{"use strict";var fr=lr().parser;fr.yy=lt();hr.exports=fr});var ct=C(($o,pr)=>{"use strict";var Rn=Object.keys(lt());function Cn(e){return Rn.forEach(function(t){if(typeof e[t]>"u")throw new Error("No handler defined for "+t.displayName)}),{visit:function(t,r){return this.handlers[t.displayName].call(this,t,r)},handlers:e}}pr.exports=Cn});var vr=C((Do,yr)=>{"use strict";var In=ct(),$n=/[\-{}\[\]+?.,\\\^$|#\s]/g;function dr(e){this.captures=e.captures,this.re=e.re}dr.prototype.match=function(e){var t=this.re.exec(e),r={};return t?(this.captures.forEach(function(n,i){typeof t[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(t[i+1])}),r):!1};var Dn=In({Concat:function(e){return e.children.reduce(function(t,r){var n=this.visit(r);return{re:t.re+n.re,captures:t.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(e){return{re:e.props.value.replace($n,"\\$&"),captures:[]}},Splat:function(e){return{re:"([^?#]*?)",captures:[e.props.name]}},Param:function(e){return{re:"([^\\/\\?#]+)",captures:[e.props.name]}},Optional:function(e){var t=this.visit(e.children[0]);return{re:"(?:"+t.re+")?",captures:t.captures}},Root:function(e){var t=this.visit(e.children[0]);return new dr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});yr.exports=Dn});var gr=C((Lo,mr)=>{"use strict";var Ln=ct(),Mn=Ln({Concat:function(e,t){var r=e.children.map(function(n){return this.visit(n,t)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(e){return decodeURI(e.props.value)},Splat:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Param:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Optional:function(e,t){var r=this.visit(e.children[0],t);return r||""},Root:function(e,t){t=t||{};var r=this.visit(e.children[0],t);return r===!1||typeof r>"u"?!1:encodeURI(r)}});mr.exports=Mn});var xr=C((Mo,wr)=>{"use strict";var Un=_r(),Vn=vr(),Fn=gr();function de(e){var t;if(this?t=this:t=Object.create(de.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=Un.parse(e),t}de.prototype=Object.create(null);de.prototype.match=function(e){var t=Vn.visit(this.ast),r=t.match(e);return r!==null?r:!1};de.prototype.reverse=function(e){return Fn.visit(this.ast,e)};wr.exports=de});var kr=C((Uo,Er)=>{"use strict";var jn=xr();Er.exports=jn});var Se,y,wt,Ge,z,dt,xt,He,Ir,oe={},Et=[],$r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ye=Array.isArray;function V(e,t){for(var r in t)e[r]=t[r];return e}function kt(e){var t=e.parentNode;t&&t.removeChild(e)}function I(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Se.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Ee(e,a,n,i,null)}function Ee(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++wt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function St(){return{current:null}}function se(e){return e.children}function F(e,t){this.props=e,this.context=t}function Q(e,t){if(t==null)return e.__?Q(e.__,e.__i+1):null;for(var r;tt&&z.sort(He));ke.__r=0}function At(e,t,r,n,i,o,a,c,l,f,u){var s,_,h,p,d,m=n&&n.__k||Et,v=t.length;for(r.__d=l,Dr(r,t,m),l=r.__d,s=0;s0?Ee(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=Lr(i,r,a=n+s,u),i.__i=c,o=null,c!==-1&&(u--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?s++:c>a?u>l-a?s+=c-a:s--:s=c(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c=0){if((l=t[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(c"u"&&(self.Node=class{});Boolean.prototype[k]=Symbol.prototype[k]=Number.prototype[k]=String.prototype[k]=function(e){return this.valueOf()===e};Date.prototype[k]=function(e){return+this==+e};Function.prototype[k]=Node.prototype[k]=function(e){return this===e};URLSearchParams.prototype[k]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[k]=function(e){return e==null?!1:b(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[k]=function(e){if(e==null||this.length!==e.length)return!1;if(this.length==0)return!0;for(let t in this)if(!b(this[t],e[t]))return!1;return!0};FormData.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(e.keys()).sort(),r=Array.from(this.keys()).sort();if(b(r,t)){if(r.length==0)return!0;for(let n of r){let i=Array.from(e.getAll(n).sort()),o=Array.from(this.getAll(n).sort());if(!b(o,i))return!1}return!0}else return!1};Map.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(this.keys()).sort(),r=Array.from(e.keys()).sort();if(b(t,r)){if(t.length==0)return!0;for(let n of t)if(!b(this.get(n),e.get(n)))return!1;return!0}else return!1};var be=e=>e!=null&&typeof e=="object"&&"constructor"in e&&"props"in e&&"type"in e&&"ref"in e&&"key"in e&&"__"in e,b=(e,t)=>e===void 0&&t===void 0||e===null&&t===null?!0:e!=null&&e!=null&&e[k]?e[k](t):t!=null&&t!=null&&t[k]?t[k](e):be(e)||be(t)?e===t:Je(e,t),Je=(e,t)=>{if(e instanceof Object&&t instanceof Object){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!b(e[o],t[o]))return!1;return!0}else return e===t};var ae=class{constructor(t,r){this.teardown=r,this.subject=t,this.steps=[]}async run(){let t;try{t=await new Promise(this.next.bind(this))}finally{this.teardown&&this.teardown()}return t}async next(t,r){requestAnimationFrame(async()=>{let n=this.steps.shift();if(n)try{this.subject=await n(this.subject)}catch(i){return r(i)}this.steps.length?this.next(t,r):t(this.subject)})}step(t){return this.steps.push(t),this}},Xe=class{constructor(t,r,n){this.socket=new WebSocket(r),this.suites=t,this.url=r,this.id=n,window.DEBUG={log:o=>{let a="";o===void 0?a="undefined":o===null?a="null":a=o.toString(),this.log(a)}};let i=null;window.onerror=o=>{this.socket.readyState===1?this.crash(o):i=i||o},this.socket.onopen=()=>{i!=null&&this.crash(i)},this.start()}start(){this.socket.readyState===1?this.run():this.socket.addEventListener("open",()=>this.run())}run(){return new Promise((t,r)=>{this.next(t,r)}).catch(t=>this.log(t.reason)).finally(()=>this.socket.send("DONE"))}report(t,r,n,i,o){i&&i.toString&&(i=i.toString()),this.socket.send(JSON.stringify({location:o,result:i,suite:r,id:this.id,type:t,name:n}))}reportTested(t,r,n){this.report(r,this.suite.name,t.name,n,t.location)}crash(t){this.report("CRASHED",null,null,t)}log(t){this.report("LOG",null,null,t)}next(t,r){requestAnimationFrame(async()=>{if(!this.suite||this.suite.tests.length===0)if(this.suite=this.suites.shift(),this.suite)this.report("SUITE",this.suite.name);else return t();let n=this.suite.tests.shift();try{let i=await n.proc.call(this.suite.context);if(window.location.pathname!=="/"&&window.history.replaceState({},"","/"),sessionStorage.clear(),localStorage.clear(),i instanceof ae)try{await i.run(),this.reportTested(n,"SUCCEEDED",i.subject)}catch(o){this.reportTested(n,"FAILED",o)}else i?this.reportTested(n,"SUCCEEDED"):this.reportTested(n,"FAILED")}catch(i){this.reportTested(n,"ERRORED",i)}this.next(t,r)})}},ni=(e,t,r)=>new ae(e).step(n=>{let i=b(n,t);if(r==="=="&&(i=!i),i)throw`Assertion failed: ${t} ${r} ${n}`;return!0}),ii=ae,oi=Xe;var Oe,q,Ze,Tt,Qe=0,Dt=[],Ae=[],Pt=y.__b,Nt=y.__r,Rt=y.diffed,Ct=y.__c,It=y.unmount;function Lt(e,t){y.__h&&y.__h(q,e,Qe||t),Qe=0;var r=q.__H||(q.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Ae}),r.__[e]}function K(e,t){var r=Lt(Oe++,3);!y.__s&&Mt(r.__H,t)&&(r.__=e,r.i=t,q.__H.__h.push(r))}function Te(e){return Qe=5,M(function(){return{current:e}},[])}function M(e,t){var r=Lt(Oe++,7);return Mt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Vr(){for(var e;e=Dt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(qe),e.__H.__h.forEach(et),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){q=null,Pt&&Pt(e)},y.__r=function(e){Nt&&Nt(e),Oe=0;var t=(q=e.__c).__H;t&&(Ze===q?(t.__h=[],q.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ae,r.__N=r.i=void 0})):(t.__h.forEach(qe),t.__h.forEach(et),t.__h=[],Oe=0)),Ze=q},y.diffed=function(e){Rt&&Rt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Dt.push(t)!==1&&Tt===y.requestAnimationFrame||((Tt=y.requestAnimationFrame)||Fr)(Vr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ae&&(r.__=r.__V),r.i=void 0,r.__V=Ae})),Ze=q=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(qe),r.__h=r.__h.filter(function(n){return!n.__||et(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),Ct&&Ct(e,t)},y.unmount=function(e){It&&It(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{qe(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var $t=typeof requestAnimationFrame=="function";function Fr(e){var t,r=function(){clearTimeout(n),$t&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);$t&&(t=requestAnimationFrame(r))}function qe(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function et(e){var t=q;e.__c=e.__(),q=t}function Mt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ne(){throw new Error("Cycle detected")}var jr=Symbol.for("preact-signals");function Re(){if(j>1)j--;else{for(var e,t=!1;ue!==void 0;){var r=ue;for(ue=void 0,rt++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ft(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(rt=0,j--,t)throw e}}function Ut(e){if(j>0)return e();j++;try{return e()}finally{Re()}}var g=void 0,tt=0;function Ce(e){if(tt>0)return e();var t=g;g=void 0,tt++;try{return e()}finally{tt--,g=t}}var ue=void 0,j=0,rt=0,Pe=0;function Vt(e){if(g!==void 0){var t=e.n;if(t===void 0||t.t!==g)return t={i:0,S:e,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:t},g.s!==void 0&&(g.s.n=t),g.s=t,e.n=t,32&g.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=g.s,t.n=void 0,g.s.n=t,g.s=t),t}}function S(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}S.prototype.brand=jr;S.prototype.h=function(){return!0};S.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};S.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};S.prototype.subscribe=function(e){var t=this;return ce(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})};S.prototype.valueOf=function(){return this.value};S.prototype.toString=function(){return this.value+""};S.prototype.toJSON=function(){return this.value};S.prototype.peek=function(){return this.v};Object.defineProperty(S.prototype,"value",{get:function(){var e=Vt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof B&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){rt>100&&Ne(),this.v=e,this.i++,Pe++,j++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Re()}}}});function $(e){return new S(e)}function Ft(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function jt(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Bt(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function B(e){S.call(this,void 0),this.x=e,this.s=void 0,this.g=Pe-1,this.f=4}(B.prototype=new S).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Pe))return!0;if(this.g=Pe,this.f|=1,this.i>0&&!Ft(this))return this.f&=-2,!0;var e=g;try{jt(this),g=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=e,Bt(this),this.f&=-2,!0};B.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}S.prototype.S.call(this,e)};B.prototype.U=function(e){if(this.t!==void 0&&(S.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};B.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};B.prototype.peek=function(){if(this.h()||Ne(),16&this.f)throw this.v;return this.v};Object.defineProperty(B.prototype,"value",{get:function(){1&this.f&&Ne();var e=Vt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function nt(e){return new B(e)}function Ht(e){var t=e.u;if(e.u=void 0,typeof t=="function"){j++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,it(e),n}finally{g=r,Re()}}}function it(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ht(e)}function Br(e){if(g!==this)throw new Error("Out-of-order effect");Bt(this),g=e,this.f&=-2,8&this.f&&it(this),Re()}function le(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}le.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};le.prototype.S=function(){1&this.f&&Ne(),this.f|=1,this.f&=-9,Ht(this),jt(this),j++;var e=g;return g=this,Br.bind(this,e)};le.prototype.N=function(){2&this.f||(this.f|=2,this.o=ue,ue=this)};le.prototype.d=function(){this.f|=8,1&this.f||it(this)};function ce(e){var t=new le(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var st,ot;function te(e,t){y[e]=t.bind(null,y[e]||function(){})}function Ie(e){ot&&ot(),ot=e&&e.S()}function Wt(e){var t=this,r=e.data,n=Wr(r);n.value=r;var i=M(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ge(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},nt(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Wt.displayName="_st";Object.defineProperties(S.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Wt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});te("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof S&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});te("__r",function(e,t){Ie();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return ce(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),st=n,Ie(r),e(t)});te("__e",function(e,t,r,n){Ie(),st=void 0,e(t,r,n)});te("diffed",function(e,t){Ie(),st=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var c=o[a];c!==void 0&&!(a in n)&&(c.d(),o[a]=void 0)}else r.U=o={};for(var l in n){var f=o[l],u=n[l];f===void 0?(f=Hr(r,l,u,i),o[l]=f):f.o(u,i)}}}e(t)});function Hr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=$(r);return{o:function(a,c){o.value=a,n=c},d:ce(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}te("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}e(t)});te("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});F.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function Wr(e){return M(function(){return $(e)},[])}var $e=class{constructor(t,r){this.pattern=r,this.variant=t}},yi=(e,t)=>new $e(e,t),Gr=Symbol("Variable"),at=Symbol("Spread"),fe=(e,t,r=[])=>{if(t!==null){if(t===Gr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===at)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==at&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=fe(e,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(e){return this.cache[e]||""}setData(e,t){return this.cache[e]=t,null}clearData(){return this.cache={},null}});var Yr=e=>new Proxy(e,{get:function(t,r){if(r==="event")return e;if(r in t){let n=t[r];return n instanceof Function?()=>t[r]():n}else switch(r){case"clipboardData":return t.clipboardData=new DataTransfer;case"dataTransfer":return t.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return 0;case"ctrlKey":return!1;case"key":return"";case"keyCode":return 0;case"locale":return"";case"location":return 0;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return 0;case"button":return-1;case"buttons":return 0;case"clientX":return 0;case"clientY":return 0;case"pageX":return 0;case"pageY":return 0;case"screenX":return 0;case"screenY":return 0;case"layerX":return 0;case"layerY":return 0;case"offsetX":return 0;case"offsetY":return 0;case"detail":return 0;case"deltaMode":return-1;case"deltaX":return 0;case"deltaY":return 0;case"deltaZ":return 0;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return 0;case"propertyName":return"";default:return}}});y.event=Yr;var qi=(e,t,r,n)=>{for(let i of e)if(b(i[0],t))return new r(i[1]);return new n},Oi=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,Ti=(e,t)=>r=>{e.current._0!==r&&(e.current=new t(r))},Pi=e=>{let t=M(()=>$(e),[]);return t.value,t},Ni=e=>{let t=St();return t.current=e,t},Ri=e=>{let t=Te(!1);K(()=>{t.current?e():t.current=!0})},Ci=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,Ii=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},$i=e=>t=>t[e],Yt=e=>e,Di=e=>t=>({[P]:e,...t}),Gt=class extends F{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?I(this.state.x,this.props.p,this.props.c):null}},Li=e=>async()=>zr(e),zr=async e=>(await import(e)).default;var Kr=$({}),zt=$({}),Vi=e=>zt.value=e,Fi=e=>(Kr.value[zt.value]||{})[e]||"";var Xt=pt(Jt()),Ji=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Ce(t))};K(()=>i,[]),K(()=>{let o=n();if(o===null)i();else{let a=e.get(r);b(a,o)||(e.set(r,o),Ce(t))}})},Xi=e=>Array.from(e.values()),Zi=()=>M(Xt.default,[]);function he(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(t===0)return e;let o=i?/^/gm:/^(?!\s*$)/gm;return e.replace(o,n.repeat(t))}var D=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),he(t)},N=class{constructor(t,r=[]){this.message=t,this.object=null,this.path=r}push(t){this.path.unshift(t)}toString(){let t=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?t+` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,_,h,p){var d=p;switch(h){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return f}();a.lexer=l;function c(){this.yy={}}return c.prototype=a,a.Parser=c,new c}();typeof we<"u"&&typeof pe<"u"&&(pe.parser=Le,pe.Parser=Le.Parser,pe.parse=function(){return Le.parse.apply(Le,arguments)})});var lt=I((Io,cr)=>{"use strict";function ne(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}cr.exports={Root:ne("Root"),Concat:ne("Concat"),Literal:ne("Literal"),Splat:ne("Splat"),Param:ne("Param"),Optional:ne("Optional")}});var _r=I(($o,hr)=>{"use strict";var fr=lr().parser;fr.yy=lt();hr.exports=fr});var ct=I((Do,pr)=>{"use strict";var Rn=Object.keys(lt());function Cn(e){return Rn.forEach(function(t){if(typeof e[t]>"u")throw new Error("No handler defined for "+t.displayName)}),{visit:function(t,r){return this.handlers[t.displayName].call(this,t,r)},handlers:e}}pr.exports=Cn});var vr=I((Lo,yr)=>{"use strict";var In=ct(),$n=/[\-{}\[\]+?.,\\\^$|#\s]/g;function dr(e){this.captures=e.captures,this.re=e.re}dr.prototype.match=function(e){var t=this.re.exec(e),r={};return t?(this.captures.forEach(function(n,i){typeof t[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(t[i+1])}),r):!1};var Dn=In({Concat:function(e){return e.children.reduce(function(t,r){var n=this.visit(r);return{re:t.re+n.re,captures:t.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(e){return{re:e.props.value.replace($n,"\\$&"),captures:[]}},Splat:function(e){return{re:"([^?#]*?)",captures:[e.props.name]}},Param:function(e){return{re:"([^\\/\\?#]+)",captures:[e.props.name]}},Optional:function(e){var t=this.visit(e.children[0]);return{re:"(?:"+t.re+")?",captures:t.captures}},Root:function(e){var t=this.visit(e.children[0]);return new dr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});yr.exports=Dn});var gr=I((Mo,mr)=>{"use strict";var Ln=ct(),Mn=Ln({Concat:function(e,t){var r=e.children.map(function(n){return this.visit(n,t)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(e){return decodeURI(e.props.value)},Splat:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Param:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Optional:function(e,t){var r=this.visit(e.children[0],t);return r||""},Root:function(e,t){t=t||{};var r=this.visit(e.children[0],t);return r===!1||typeof r>"u"?!1:encodeURI(r)}});mr.exports=Mn});var xr=I((Uo,wr)=>{"use strict";var Un=_r(),Vn=vr(),Fn=gr();function de(e){var t;if(this?t=this:t=Object.create(de.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=Un.parse(e),t}de.prototype=Object.create(null);de.prototype.match=function(e){var t=Vn.visit(this.ast),r=t.match(e);return r!==null?r:!1};de.prototype.reverse=function(e){return Fn.visit(this.ast,e)};wr.exports=de});var kr=I((Vo,Er)=>{"use strict";var jn=xr();Er.exports=jn});var Se,y,wt,Ge,K,dt,xt,He,Ir,oe={},Et=[],$r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ye=Array.isArray;function F(e,t){for(var r in t)e[r]=t[r];return e}function kt(e){var t=e.parentNode;t&&t.removeChild(e)}function T(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Se.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Ee(e,a,n,i,null)}function Ee(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++wt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function St(){return{current:null}}function se(e){return e.children}function j(e,t){this.props=e,this.context=t}function ee(e,t){if(t==null)return e.__?ee(e.__,e.__i+1):null;for(var r;tt&&K.sort(He));ke.__r=0}function At(e,t,r,n,i,o,a,l,c,f,u){var s,_,h,p,d,m=n&&n.__k||Et,v=t.length;for(r.__d=c,Dr(r,t,m),c=r.__d,s=0;s0?Ee(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,l=Lr(i,r,a=n+s,u),i.__i=l,o=null,l!==-1&&(u--,(o=r[l])&&(o.__u|=131072)),o==null||o.__v===null?(l==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):l!==a&&(l===a+1?s++:l>a?u>c-a?s+=l-a:s--:s=l(c!=null&&!(131072&c.__u)?1:0))for(;a>=0||l=0){if((c=t[a])&&!(131072&c.__u)&&i==c.key&&o===c.type)return a;a--}if(l"u"&&(self.Node=class{});Boolean.prototype[k]=Symbol.prototype[k]=Number.prototype[k]=String.prototype[k]=function(e){return this.valueOf()===e};Date.prototype[k]=function(e){return+this==+e};Function.prototype[k]=Node.prototype[k]=function(e){return this===e};URLSearchParams.prototype[k]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[k]=function(e){return e==null?!1:b(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[k]=function(e){if(e==null||this.length!==e.length)return!1;if(this.length==0)return!0;for(let t in this)if(!b(this[t],e[t]))return!1;return!0};FormData.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(e.keys()).sort(),r=Array.from(this.keys()).sort();if(b(r,t)){if(r.length==0)return!0;for(let n of r){let i=Array.from(e.getAll(n).sort()),o=Array.from(this.getAll(n).sort());if(!b(o,i))return!1}return!0}else return!1};Map.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(this.keys()).sort(),r=Array.from(e.keys()).sort();if(b(t,r)){if(t.length==0)return!0;for(let n of t)if(!b(this.get(n),e.get(n)))return!1;return!0}else return!1};var be=e=>e!=null&&typeof e=="object"&&"constructor"in e&&"props"in e&&"type"in e&&"ref"in e&&"key"in e&&"__"in e,b=(e,t)=>e===void 0&&t===void 0||e===null&&t===null?!0:e!=null&&e!=null&&e[k]?e[k](t):t!=null&&t!=null&&t[k]?t[k](e):be(e)||be(t)?e===t:Je(e,t),Je=(e,t)=>{if(e instanceof Object&&t instanceof Object){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!b(e[o],t[o]))return!1;return!0}else return e===t};var ae=class{constructor(t,r){this.teardown=r,this.subject=t,this.steps=[]}async run(){let t;try{t=await new Promise(this.next.bind(this))}finally{this.teardown&&this.teardown()}return t}async next(t,r){requestAnimationFrame(async()=>{let n=this.steps.shift();if(n)try{this.subject=await n(this.subject)}catch(i){return r(i)}this.steps.length?this.next(t,r):t(this.subject)})}step(t){return this.steps.push(t),this}},Xe=class{constructor(t,r,n,i){this.root=document.createElement("div"),document.body.appendChild(this.root),this.socket=new WebSocket(n),this.globals=r,this.suites=t,this.url=n,this.id=i,window.DEBUG={log:a=>{let l="";a===void 0?l="undefined":a===null?l="null":l=a.toString(),this.log(l)}};let o=null;window.onerror=a=>{this.socket.readyState===1?this.crash(a):o=o||a},this.socket.onopen=()=>{o!=null&&this.crash(o)},this.start()}renderGlobals(){let t=[];for(let r in this.globals)t.push(T(this.globals[r],{key:r}));M(t,this.root)}start(){this.socket.readyState===1?this.run():this.socket.addEventListener("open",()=>this.run())}run(){return new Promise((t,r)=>{this.next(t,r)}).catch(t=>this.log(t.reason)).finally(()=>this.socket.send("DONE"))}report(t,r,n,i,o){i&&i.toString&&(i=i.toString()),this.socket.send(JSON.stringify({location:o,result:i,suite:r,id:this.id,type:t,name:n}))}reportTested(t,r,n){this.report(r,this.suite.name,t.name,n,t.location)}crash(t){this.report("CRASHED",null,null,t)}log(t){this.report("LOG",null,null,t)}cleanSlate(){return new Promise(t=>{M(null,this.root),window.location.pathname!=="/"&&window.history.replaceState({},"","/"),sessionStorage.clear(),localStorage.clear(),requestAnimationFrame(()=>{this.renderGlobals(),requestAnimationFrame(t)})})}next(t){requestAnimationFrame(async()=>{if(!this.suite||this.suite.tests.length===0)if(this.suite=this.suites.shift(),this.suite)this.report("SUITE",this.suite.name);else return t();let r=this.suite.tests.shift();try{await this.cleanSlate();let n=await r.proc();if(n instanceof ae)try{await n.run(),this.reportTested(r,"SUCCEEDED",n.subject)}catch(i){this.reportTested(r,"FAILED",i)}else n?this.reportTested(r,"SUCCEEDED"):this.reportTested(r,"FAILED")}catch(n){console.log(n),this.reportTested(r,"ERRORED",n)}this.next(t)})}},ii=(e,t,r)=>new ae(e).step(n=>{let i=b(n,t);if(r==="=="&&(i=!i),i)throw`Assertion failed: ${t} ${r} ${n}`;return!0}),oi=ae,si=Xe;var Oe,q,Ze,Tt,Qe=0,Dt=[],Ae=[],Pt=y.__b,Nt=y.__r,Rt=y.diffed,Ct=y.__c,It=y.unmount;function Lt(e,t){y.__h&&y.__h(q,e,Qe||t),Qe=0;var r=q.__H||(q.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Ae}),r.__[e]}function J(e,t){var r=Lt(Oe++,3);!y.__s&&Mt(r.__H,t)&&(r.__=e,r.i=t,q.__H.__h.push(r))}function Te(e){return Qe=5,U(function(){return{current:e}},[])}function U(e,t){var r=Lt(Oe++,7);return Mt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Vr(){for(var e;e=Dt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(qe),e.__H.__h.forEach(et),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){q=null,Pt&&Pt(e)},y.__r=function(e){Nt&&Nt(e),Oe=0;var t=(q=e.__c).__H;t&&(Ze===q?(t.__h=[],q.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ae,r.__N=r.i=void 0})):(t.__h.forEach(qe),t.__h.forEach(et),t.__h=[],Oe=0)),Ze=q},y.diffed=function(e){Rt&&Rt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Dt.push(t)!==1&&Tt===y.requestAnimationFrame||((Tt=y.requestAnimationFrame)||Fr)(Vr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ae&&(r.__=r.__V),r.i=void 0,r.__V=Ae})),Ze=q=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(qe),r.__h=r.__h.filter(function(n){return!n.__||et(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),Ct&&Ct(e,t)},y.unmount=function(e){It&&It(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{qe(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var $t=typeof requestAnimationFrame=="function";function Fr(e){var t,r=function(){clearTimeout(n),$t&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);$t&&(t=requestAnimationFrame(r))}function qe(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function et(e){var t=q;e.__c=e.__(),q=t}function Mt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ne(){throw new Error("Cycle detected")}var jr=Symbol.for("preact-signals");function Re(){if(B>1)B--;else{for(var e,t=!1;ue!==void 0;){var r=ue;for(ue=void 0,rt++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ft(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(rt=0,B--,t)throw e}}function Ut(e){if(B>0)return e();B++;try{return e()}finally{Re()}}var g=void 0,tt=0;function Ce(e){if(tt>0)return e();var t=g;g=void 0,tt++;try{return e()}finally{tt--,g=t}}var ue=void 0,B=0,rt=0,Pe=0;function Vt(e){if(g!==void 0){var t=e.n;if(t===void 0||t.t!==g)return t={i:0,S:e,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:t},g.s!==void 0&&(g.s.n=t),g.s=t,e.n=t,32&g.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=g.s,t.n=void 0,g.s.n=t,g.s=t),t}}function S(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}S.prototype.brand=jr;S.prototype.h=function(){return!0};S.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};S.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};S.prototype.subscribe=function(e){var t=this;return ce(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})};S.prototype.valueOf=function(){return this.value};S.prototype.toString=function(){return this.value+""};S.prototype.toJSON=function(){return this.value};S.prototype.peek=function(){return this.v};Object.defineProperty(S.prototype,"value",{get:function(){var e=Vt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof H&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){rt>100&&Ne(),this.v=e,this.i++,Pe++,B++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Re()}}}});function $(e){return new S(e)}function Ft(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function jt(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Bt(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function H(e){S.call(this,void 0),this.x=e,this.s=void 0,this.g=Pe-1,this.f=4}(H.prototype=new S).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Pe))return!0;if(this.g=Pe,this.f|=1,this.i>0&&!Ft(this))return this.f&=-2,!0;var e=g;try{jt(this),g=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=e,Bt(this),this.f&=-2,!0};H.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}S.prototype.S.call(this,e)};H.prototype.U=function(e){if(this.t!==void 0&&(S.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};H.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};H.prototype.peek=function(){if(this.h()||Ne(),16&this.f)throw this.v;return this.v};Object.defineProperty(H.prototype,"value",{get:function(){1&this.f&&Ne();var e=Vt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function nt(e){return new H(e)}function Ht(e){var t=e.u;if(e.u=void 0,typeof t=="function"){B++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,it(e),n}finally{g=r,Re()}}}function it(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ht(e)}function Br(e){if(g!==this)throw new Error("Out-of-order effect");Bt(this),g=e,this.f&=-2,8&this.f&&it(this),Re()}function le(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}le.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};le.prototype.S=function(){1&this.f&&Ne(),this.f|=1,this.f&=-9,Ht(this),jt(this),B++;var e=g;return g=this,Br.bind(this,e)};le.prototype.N=function(){2&this.f||(this.f|=2,this.o=ue,ue=this)};le.prototype.d=function(){this.f|=8,1&this.f||it(this)};function ce(e){var t=new le(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var st,ot;function te(e,t){y[e]=t.bind(null,y[e]||function(){})}function Ie(e){ot&&ot(),ot=e&&e.S()}function Wt(e){var t=this,r=e.data,n=Wr(r);n.value=r;var i=U(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ge(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},nt(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Wt.displayName="_st";Object.defineProperties(S.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Wt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});te("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof S&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});te("__r",function(e,t){Ie();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return ce(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),st=n,Ie(r),e(t)});te("__e",function(e,t,r,n){Ie(),st=void 0,e(t,r,n)});te("diffed",function(e,t){Ie(),st=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var l=o[a];l!==void 0&&!(a in n)&&(l.d(),o[a]=void 0)}else r.U=o={};for(var c in n){var f=o[c],u=n[c];f===void 0?(f=Hr(r,c,u,i),o[c]=f):f.o(u,i)}}}e(t)});function Hr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=$(r);return{o:function(a,l){o.value=a,n=l},d:ce(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}te("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});te("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});j.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function Wr(e){return U(function(){return $(e)},[])}var $e=class{constructor(t,r){this.pattern=r,this.variant=t}},vi=(e,t)=>new $e(e,t),Gr=Symbol("Variable"),at=Symbol("Spread"),fe=(e,t,r=[])=>{if(t!==null){if(t===Gr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===at)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==at&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=fe(e,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(e){return this.cache[e]||""}setData(e,t){return this.cache[e]=t,null}clearData(){return this.cache={},null}});var Yr=e=>new Proxy(e,{get:function(t,r){if(r==="event")return e;if(r in t){let n=t[r];return n instanceof Function?()=>t[r]():n}else switch(r){case"clipboardData":return t.clipboardData=new DataTransfer;case"dataTransfer":return t.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return 0;case"ctrlKey":return!1;case"key":return"";case"keyCode":return 0;case"locale":return"";case"location":return 0;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return 0;case"button":return-1;case"buttons":return 0;case"clientX":return 0;case"clientY":return 0;case"pageX":return 0;case"pageY":return 0;case"screenX":return 0;case"screenY":return 0;case"layerX":return 0;case"layerY":return 0;case"offsetX":return 0;case"offsetY":return 0;case"detail":return 0;case"deltaMode":return-1;case"deltaX":return 0;case"deltaY":return 0;case"deltaZ":return 0;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return 0;case"propertyName":return"";default:return}}});y.event=Yr;var Oi=(e,t,r,n)=>{for(let i of e)if(b(i[0],t))return new r(i[1]);return new n},Ti=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,Pi=(e,t)=>r=>{e.current._0!==r&&(e.current=new t(r))},Ni=e=>{let t=U(()=>$(e),[]);return t.value,t},Ri=e=>{let t=St();return t.current=e,t},Ci=e=>{let t=Te(!1);J(()=>{t.current?e():t.current=!0})},Ii=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,$i=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},Di=e=>t=>t[e],Yt=e=>e,Li=e=>t=>({[N]:e,...t}),Gt=class extends j{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?T(this.state.x,this.props.p,this.props.c):null}},Mi=e=>async()=>zr(e),zr=async e=>(await import(e)).default;var Kr=$({}),zt=$({}),Fi=e=>zt.value=e,ji=e=>(Kr.value[zt.value]||{})[e]||"";var Xt=pt(Jt()),Xi=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Ce(t))};J(()=>i,[]),J(()=>{let o=n();if(o===null)i();else{let a=e.get(r);b(a,o)||(e.set(r,o),Ce(t))}})},Zi=e=>Array.from(e.values()),Qi=()=>U(Xt.default,[]);function he(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(t===0)return e;let o=i?/^/gm:/^(?!\s*$)/gm;return e.replace(o,n.repeat(t))}var D=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),he(t)},R=class{constructor(t,r=[]){this.message=t,this.object=null,this.path=r}push(t){this.path.unshift(t)}toString(){let t=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?t+` `+Jr.trim().replace("{value}",D(this.object)).replace("{path}",r):t}},Jr=` The input is in this object: @@ -65,8 +65,8 @@ I was trying to decode the value: {value} as a Map, but could not. -`,no=(e,t)=>r=>typeof r!="string"?new t(new N(Xr.replace("{value}",D(r)))):new e(r),io=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new N(Zr.replace("{value}",D(r)))):new e(new Date(n))},oo=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new N(Qr.replace("{value}",D(r)))):new e(n)},so=(e,t)=>r=>typeof r!="boolean"?new t(new N(en.replace("{value}",D(r)))):new e(r),an=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=tn.replace("{field}",e).replace("{value}",D(n));return new r(new N(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},ao=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new N(rn.replace("{value}",D(n))));let i=[],o=0;for(let a of n){let c=e(a);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0),o++}return new t(i)},uo=(e,t,r,n,i)=>o=>{if(o==null)return new t(new i);{let a=e(o);return a instanceof r?a:new t(new n(a._0))}},lo=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new N(nn.replace("{value}",D(n))));let i=[],o=0;for(let a of e){if(n[o]===void 0||n[o]===null)return new r(new N(on.replace("{value}",D(n[o]))));{let c=a(n[o]);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0)}o++}return new t(i)},co=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=sn.replace("{value}",D(n));return new r(new N(i))}else{let i=[];for(let o in n){let a=e(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new t(i)}},fo=(e,t,r,n)=>i=>{let o={[P]:e};for(let a in t){let c=t[a],l=a;Array.isArray(c)&&(c=t[a][0],l=t[a][1]);let f=an(l,c,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},ho=e=>t=>new e(t);var yo=e=>e.toISOString(),vo=e=>t=>t.map(r=>e?e(r):r),mo=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},go=(e,t)=>r=>r instanceof t?e(r._0):null,wo=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),xo=e=>t=>{let r={};for(let n in e){let i=e[n],o=n;Array.isArray(i)&&(i=e[n][0],o=e[n][1]),r[o]=(i||Yt)(t[n])}return r};var un=Object.getOwnPropertyNames,ln=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty;function Zt(e,t){return function(n,i,o){return e(n,i,o)&&t(n,i,o)}}function De(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var o=i.cache,a=o.get(r),c=o.get(n);if(a&&c)return a===n&&c===r;o.set(r,n),o.set(n,r);var l=e(r,n,i);return o.delete(r),o.delete(n),l}}function Qt(e){return un(e).concat(ln(e))}var sr=Object.hasOwn||function(e,t){return cn.call(e,t)};function re(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var ar="_owner",er=Object.getOwnPropertyDescriptor,tr=Object.keys;function fn(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function hn(e,t){return re(e.getTime(),t.getTime())}function rr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,c;(a=i.next())&&!a.done;){for(var l=t.entries(),f=!1,u=0;(c=l.next())&&!c.done;){var s=a.value,_=s[0],h=s[1],p=c.value,d=p[0],m=p[1];!f&&!n[u]&&(f=r.equals(_,d,o,u,e,t,r)&&r.equals(h,m,_,d,e,t,r))&&(n[u]=!0),u++}if(!f)return!1;o++}return!0}function _n(e,t,r){var n=tr(e),i=n.length;if(tr(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===ar&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!sr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=Qt(e),i=n.length;if(Qt(t).length!==i)return!1;for(var o,a,c;i-- >0;)if(o=n[i],o===ar&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!sr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=er(e,o),c=er(t,o),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function pn(e,t){return re(e.valueOf(),t.valueOf())}function dn(e,t){return e.source===t.source&&e.flags===t.flags}function nr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var c=t.values(),l=!1,f=0;(a=c.next())&&!a.done;)!l&&!n[f]&&(l=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!l)return!1}return!0}function yn(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var vn="[object Arguments]",mn="[object Boolean]",gn="[object Date]",wn="[object Map]",xn="[object Number]",En="[object Object]",kn="[object RegExp]",Sn="[object Set]",bn="[object String]",An=Array.isArray,ir=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,or=Object.assign,qn=Object.prototype.toString.call.bind(Object.prototype.toString);function On(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,c=e.areSetsEqual,l=e.areTypedArraysEqual;return function(u,s,_){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var h=u.constructor;if(h!==s.constructor)return!1;if(h===Object)return i(u,s,_);if(An(u))return t(u,s,_);if(ir!=null&&ir(u))return l(u,s,_);if(h===Date)return r(u,s,_);if(h===RegExp)return a(u,s,_);if(h===Map)return n(u,s,_);if(h===Set)return c(u,s,_);var p=qn(u);return p===gn?r(u,s,_):p===kn?a(u,s,_):p===wn?n(u,s,_):p===Sn?c(u,s,_):p===En?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,_):p===vn?i(u,s,_):p===mn||p===xn||p===bn?o(u,s,_):!1}}function Tn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:fn,areDatesEqual:hn,areMapsEqual:n?Zt(rr,_e):rr,areObjectsEqual:n?_e:_n,arePrimitiveWrappersEqual:pn,areRegExpsEqual:dn,areSetsEqual:n?Zt(nr,_e):nr,areTypedArraysEqual:n?_e:yn};if(r&&(i=or({},i,r(i))),t){var o=De(i.areArraysEqual),a=De(i.areMapsEqual),c=De(i.areObjectsEqual),l=De(i.areSetsEqual);i=or({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:c,areSetsEqual:l})}return i}function Pn(e){return function(t,r,n,i,o,a,c){return e(t,r,c)}}function Nn(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(l,f){var u=n(),s=u.cache,_=s===void 0?t?new WeakMap:void 0:s,h=u.meta;return r(l,f,{cache:_,equals:i,meta:h,strict:o})};if(t)return function(l,f){return r(l,f,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,f){return r(l,f,a)}}var ur=H(),ko=H({strict:!0}),So=H({circular:!0}),bo=H({circular:!0,strict:!0}),Ao=H({createInternalComparator:function(){return re}}),qo=H({strict:!0,createInternalComparator:function(){return re}}),Oo=H({circular:!0,createInternalComparator:function(){return re}}),To=H({circular:!0,createInternalComparator:function(){return re},strict:!0});function H(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,c=Tn(e),l=On(c),f=n?n(l):Pn(l);return Nn({circular:r,comparator:l,createState:i,equals:f,strict:a})}var br=pt(kr());var Me=class extends Error{},Bn=(e,t)=>e instanceof Object?t instanceof Object&&ur(e,t):!(t instanceof Object)&&e===t,Hn=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},Sr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new br.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},ft=class{constructor(t,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=t,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(t){if(!t.defaultPrevented&&!t.ctrlKey){for(let r of t.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=Sr(n,this.routes);if(i){t.preventDefault(),Wn(n,!0,!0,i);return}}}}}resolvePagePosition(t){Hn(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?t&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r=window.location.pathname+window.location.search+window.location.hash,n=t?.routeInfo||Sr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Bn(n.vars,this.routeInfo.vars)){let i=this.runRouteHandler(n);n.route.await&&await i}this.resolvePagePosition(!!t?.triggerJump)}this.routeInfo=n}async runRouteHandler(t){let{route:r}=t;if(r.path==="*")return r.handler();{let{vars:n}=t;try{let i=r.mapping.map((o,a)=>{let c=n[o],l=r.decoders[a](c);if(l instanceof this.ok)return l._0;throw new Me});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Me)throw i}}}render(t,r){let n=[];for(let o in r)n.push(I(r[o],{key:o}));let i;typeof t<"u"&&(i=I(t,{key:"MINT_MAIN"})),ee([...n,i],this.root),this.handlePopState()}},Wn=(e,t=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==e&&(t?window.history.pushState({},"",e):window.history.replaceState({},"",e)),t){let l=new PopStateEvent("popstate");l.triggerJump=r,l.routeInfo=n,dispatchEvent(l)}},jo=(e,t,r,n=[])=>{new ft(r,n).render(e,t)};function Gn(e){return this.getChildContext=()=>e.context,e.children}function Yn(e){let t=this,r=e._container;t.componentWillUnmount=function(){ee(null,t._temp),t._temp=null,t._container=null},t._container&&t._container!==r&&t.componentWillUnmount(),t._temp||(t._container=r,t._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),t._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),t._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t._container.removeChild(n)}}),ee(I(Gn,{context:t.context},e._vnode),t._temp)}function Wo(e,t){let r=I(Yn,{_vnode:e,_container:t});return r.containerInfo=t,r}var ye=class{[k](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return Je(this,t);for(let r=0;rclass extends ye{constructor(...r){if(super(),this[P]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var Qo=e=>{let t={},r=(n,i)=>{t[n.toString().trim()]=i.toString().trim()};for(let n of e)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return t};var Ue=(e,t,r,n)=>{e=e.map(n);let i=e.size>3||e.filter(a=>a.indexOf(` +`,io=(e,t)=>r=>typeof r!="string"?new t(new R(Xr.replace("{value}",D(r)))):new e(r),oo=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new R(Zr.replace("{value}",D(r)))):new e(new Date(n))},so=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new R(Qr.replace("{value}",D(r)))):new e(n)},ao=(e,t)=>r=>typeof r!="boolean"?new t(new R(en.replace("{value}",D(r)))):new e(r),an=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=tn.replace("{field}",e).replace("{value}",D(n));return new r(new R(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},uo=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new R(rn.replace("{value}",D(n))));let i=[],o=0;for(let a of n){let l=e(a);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},lo=(e,t,r,n,i)=>o=>{if(o==null)return new t(new i);{let a=e(o);return a instanceof r?a:new t(new n(a._0))}},co=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new R(nn.replace("{value}",D(n))));let i=[],o=0;for(let a of e){if(n[o]===void 0||n[o]===null)return new r(new R(on.replace("{value}",D(n[o]))));{let l=a(n[o]);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0)}o++}return new t(i)},fo=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=sn.replace("{value}",D(n));return new r(new R(i))}else{let i=[];for(let o in n){let a=e(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new t(i)}},ho=(e,t,r,n)=>i=>{let o={[N]:e};for(let a in t){let l=t[a],c=a;Array.isArray(l)&&(l=t[a][0],c=t[a][1]);let f=an(c,l,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},_o=e=>t=>new e(t);var vo=e=>e.toISOString(),mo=e=>t=>t.map(r=>e?e(r):r),go=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},wo=(e,t)=>r=>r instanceof t?e(r._0):null,xo=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),Eo=e=>t=>{let r={};for(let n in e){let i=e[n],o=n;Array.isArray(i)&&(i=e[n][0],o=e[n][1]),r[o]=(i||Yt)(t[n])}return r};var un=Object.getOwnPropertyNames,ln=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty;function Zt(e,t){return function(n,i,o){return e(n,i,o)&&t(n,i,o)}}function De(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var o=i.cache,a=o.get(r),l=o.get(n);if(a&&l)return a===n&&l===r;o.set(r,n),o.set(n,r);var c=e(r,n,i);return o.delete(r),o.delete(n),c}}function Qt(e){return un(e).concat(ln(e))}var sr=Object.hasOwn||function(e,t){return cn.call(e,t)};function re(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var ar="_owner",er=Object.getOwnPropertyDescriptor,tr=Object.keys;function fn(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function hn(e,t){return re(e.getTime(),t.getTime())}function rr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,l;(a=i.next())&&!a.done;){for(var c=t.entries(),f=!1,u=0;(l=c.next())&&!l.done;){var s=a.value,_=s[0],h=s[1],p=l.value,d=p[0],m=p[1];!f&&!n[u]&&(f=r.equals(_,d,o,u,e,t,r)&&r.equals(h,m,_,d,e,t,r))&&(n[u]=!0),u++}if(!f)return!1;o++}return!0}function _n(e,t,r){var n=tr(e),i=n.length;if(tr(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===ar&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!sr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=Qt(e),i=n.length;if(Qt(t).length!==i)return!1;for(var o,a,l;i-- >0;)if(o=n[i],o===ar&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!sr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=er(e,o),l=er(t,o),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function pn(e,t){return re(e.valueOf(),t.valueOf())}function dn(e,t){return e.source===t.source&&e.flags===t.flags}function nr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var l=t.values(),c=!1,f=0;(a=l.next())&&!a.done;)!c&&!n[f]&&(c=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!c)return!1}return!0}function yn(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var vn="[object Arguments]",mn="[object Boolean]",gn="[object Date]",wn="[object Map]",xn="[object Number]",En="[object Object]",kn="[object RegExp]",Sn="[object Set]",bn="[object String]",An=Array.isArray,ir=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,or=Object.assign,qn=Object.prototype.toString.call.bind(Object.prototype.toString);function On(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,l=e.areSetsEqual,c=e.areTypedArraysEqual;return function(u,s,_){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var h=u.constructor;if(h!==s.constructor)return!1;if(h===Object)return i(u,s,_);if(An(u))return t(u,s,_);if(ir!=null&&ir(u))return c(u,s,_);if(h===Date)return r(u,s,_);if(h===RegExp)return a(u,s,_);if(h===Map)return n(u,s,_);if(h===Set)return l(u,s,_);var p=qn(u);return p===gn?r(u,s,_):p===kn?a(u,s,_):p===wn?n(u,s,_):p===Sn?l(u,s,_):p===En?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,_):p===vn?i(u,s,_):p===mn||p===xn||p===bn?o(u,s,_):!1}}function Tn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:fn,areDatesEqual:hn,areMapsEqual:n?Zt(rr,_e):rr,areObjectsEqual:n?_e:_n,arePrimitiveWrappersEqual:pn,areRegExpsEqual:dn,areSetsEqual:n?Zt(nr,_e):nr,areTypedArraysEqual:n?_e:yn};if(r&&(i=or({},i,r(i))),t){var o=De(i.areArraysEqual),a=De(i.areMapsEqual),l=De(i.areObjectsEqual),c=De(i.areSetsEqual);i=or({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:c})}return i}function Pn(e){return function(t,r,n,i,o,a,l){return e(t,r,l)}}function Nn(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(c,f){var u=n(),s=u.cache,_=s===void 0?t?new WeakMap:void 0:s,h=u.meta;return r(c,f,{cache:_,equals:i,meta:h,strict:o})};if(t)return function(c,f){return r(c,f,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(c,f){return r(c,f,a)}}var ur=W(),So=W({strict:!0}),bo=W({circular:!0}),Ao=W({circular:!0,strict:!0}),qo=W({createInternalComparator:function(){return re}}),Oo=W({strict:!0,createInternalComparator:function(){return re}}),To=W({circular:!0,createInternalComparator:function(){return re}}),Po=W({circular:!0,createInternalComparator:function(){return re},strict:!0});function W(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,l=Tn(e),c=On(l),f=n?n(c):Pn(c);return Nn({circular:r,comparator:c,createState:i,equals:f,strict:a})}var br=pt(kr());var Me=class extends Error{},Bn=(e,t)=>e instanceof Object?t instanceof Object&&ur(e,t):!(t instanceof Object)&&e===t,Hn=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},Sr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new br.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},ft=class{constructor(t,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=t,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(t){if(!t.defaultPrevented&&!t.ctrlKey){for(let r of t.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=Sr(n,this.routes);if(i){t.preventDefault(),Wn(n,!0,!0,i);return}}}}}resolvePagePosition(t){Hn(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?t&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r=window.location.pathname+window.location.search+window.location.hash,n=t?.routeInfo||Sr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Bn(n.vars,this.routeInfo.vars)){let i=this.runRouteHandler(n);n.route.await&&await i}this.resolvePagePosition(!!t?.triggerJump)}this.routeInfo=n}async runRouteHandler(t){let{route:r}=t;if(r.path==="*")return r.handler();{let{vars:n}=t;try{let i=r.mapping.map((o,a)=>{let l=n[o],c=r.decoders[a](l);if(c instanceof this.ok)return c._0;throw new Me});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Me)throw i}}}render(t,r){let n=[];for(let o in r)n.push(T(r[o],{key:o}));let i;typeof t<"u"&&(i=T(t,{key:"MINT_MAIN"})),M([...n,i],this.root),this.handlePopState()}},Wn=(e,t=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==e&&(t?window.history.pushState({},"",e):window.history.replaceState({},"",e)),t){let c=new PopStateEvent("popstate");c.triggerJump=r,c.routeInfo=n,dispatchEvent(c)}},Bo=(e,t,r,n=[])=>{new ft(r,n).render(e,t)};function Gn(e){return this.getChildContext=()=>e.context,e.children}function Yn(e){let t=this,r=e._container;t.componentWillUnmount=function(){M(null,t._temp),t._temp=null,t._container=null},t._container&&t._container!==r&&t.componentWillUnmount(),t._temp||(t._container=r,t._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),t._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),t._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t._container.removeChild(n)}}),M(T(Gn,{context:t.context},e._vnode),t._temp)}function Go(e,t){let r=T(Yn,{_vnode:e,_container:t});return r.containerInfo=t,r}var ye=class{[k](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return Je(this,t);for(let r=0;rclass extends ye{constructor(...r){if(super(),this[N]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var es=e=>{let t={},r=(n,i)=>{t[n.toString().trim()]=i.toString().trim()};for(let n of e)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return t};var Ue=(e,t,r,n)=>{e=e.map(n);let i=e.size>3||e.filter(a=>a.indexOf(` `)>0).length,o=e.join(i?`, `:", ");return i?`${t.trim()} ${he(o,2)} -${r.trim()}`:`${t}${o}${r}`},J=e=>{if(e.type==="null")return"null";if(e.type==="undefined")return"undefined";if(e.type==="string")return`"${e.value}"`;if(e.type==="number")return`${e.value}`;if(e.type==="boolean")return`${e.value}`;if(e.type==="element")return`<${e.value.toLowerCase()}>`;if(e.type==="variant")return e.items?Ue(e.items,`${e.value}(`,")",J):e.value;if(e.type==="array")return Ue(e.items,"[","]",J);if(e.type==="object")return Ue(e.items,"{ "," }",J);if(e.type==="record")return Ue(e.items,`${e.value} { `," }",J);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${J(e.value)}`;if(e.value)return J(e.value)},ve=e=>{if(e===null)return{type:"null"};if(e===void 0)return{type:"undefined"};if(typeof e=="string")return{type:"string",value:e};if(typeof e=="number")return{type:"number",value:e.toString()};if(typeof e=="boolean")return{type:"boolean",value:e.toString()};if(e instanceof HTMLElement)return{type:"element",value:e.tagName};if(e instanceof ye){let t=[];if(e.record)for(let r in e)r==="length"||r==="record"||r.startsWith("_")||t.push({value:ve(e[r]),key:r});else for(let r=0;r({value:ve(t)})),type:"array"};if(be(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:ve(e[r]),key:r});return P in e?{type:"record",value:e[P],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},os=e=>J(ve(e));var export_uuid=Xt.default;export{N as Error,ye as Variant,$i as access,Ut as batch,Oi as bracketAccess,b as compare,Je as compareObjects,I as createElement,Wo as createPortal,Ji as createProvider,Ni as createRef,ao as decodeArray,so as decodeBoolean,an as decodeField,co as decodeMap,uo as decodeMaybe,oo as decodeNumber,ho as decodeObject,no as decodeString,io as decodeTime,lo as decodeTuple,fo as decoder,fe as destructure,vo as encodeArray,mo as encodeMap,go as encodeMaybe,yo as encodeTime,wo as encodeTuple,xo as encoder,se as fragment,Yt as identity,os as inspect,be as isVnode,Li as lazy,Gt as lazyComponent,zr as load,zt as locale,qi as mapAccess,vi as match,Wn as navigate,Jo as newVariant,Yr as normalizeEvent,Ci as or,yi as pattern,at as patternSpread,Gr as patternVariable,jo as program,Di as record,Vi as setLocale,Ti as setRef,$ as signal,Qo as style,Xi as subscriptions,ii as testContext,ni as testOperation,ee as testRender,oi as testRunner,Ii as toArray,Fi as translate,Kr as translations,Ri as useDidUpdate,K as useEffect,Zi as useId,M as useMemo,Te as useRef,Pi as useSignal,export_uuid as uuid,Ko as variant}; +${r.trim()}`:`${t}${o}${r}`},X=e=>{if(e.type==="null")return"null";if(e.type==="undefined")return"undefined";if(e.type==="string")return`"${e.value}"`;if(e.type==="number")return`${e.value}`;if(e.type==="boolean")return`${e.value}`;if(e.type==="element")return`<${e.value.toLowerCase()}>`;if(e.type==="variant")return e.items?Ue(e.items,`${e.value}(`,")",X):e.value;if(e.type==="array")return Ue(e.items,"[","]",X);if(e.type==="object")return Ue(e.items,"{ "," }",X);if(e.type==="record")return Ue(e.items,`${e.value} { `," }",X);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${X(e.value)}`;if(e.value)return X(e.value)},ve=e=>{if(e===null)return{type:"null"};if(e===void 0)return{type:"undefined"};if(typeof e=="string")return{type:"string",value:e};if(typeof e=="number")return{type:"number",value:e.toString()};if(typeof e=="boolean")return{type:"boolean",value:e.toString()};if(e instanceof HTMLElement)return{type:"element",value:e.tagName};if(e instanceof ye){let t=[];if(e.record)for(let r in e)r==="length"||r==="record"||r.startsWith("_")||t.push({value:ve(e[r]),key:r});else for(let r=0;r({value:ve(t)})),type:"array"};if(be(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:ve(e[r]),key:r});return N in e?{type:"record",value:e[N],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},ss=e=>X(ve(e));var export_uuid=Xt.default;export{R as Error,ye as Variant,Di as access,Ut as batch,Ti as bracketAccess,b as compare,Je as compareObjects,T as createElement,Go as createPortal,Xi as createProvider,Ri as createRef,uo as decodeArray,ao as decodeBoolean,an as decodeField,fo as decodeMap,lo as decodeMaybe,so as decodeNumber,_o as decodeObject,io as decodeString,oo as decodeTime,co as decodeTuple,ho as decoder,fe as destructure,mo as encodeArray,go as encodeMap,wo as encodeMaybe,vo as encodeTime,xo as encodeTuple,Eo as encoder,se as fragment,Yt as identity,ss as inspect,be as isVnode,Mi as lazy,Gt as lazyComponent,zr as load,zt as locale,Oi as mapAccess,mi as match,Wn as navigate,Xo as newVariant,Yr as normalizeEvent,Ii as or,vi as pattern,at as patternSpread,Gr as patternVariable,Bo as program,Li as record,Fi as setLocale,Pi as setRef,$ as signal,es as style,Zi as subscriptions,oi as testContext,ii as testOperation,M as testRender,si as testRunner,$i as toArray,ji as translate,Kr as translations,Ci as useDidUpdate,J as useEffect,Qi as useId,U as useMemo,Te as useRef,Ni as useSignal,export_uuid as uuid,Jo as variant}; diff --git a/src/compiler.cr b/src/compiler.cr index 1aa9606f2..6e339914a 100644 --- a/src/compiler.cr +++ b/src/compiler.cr @@ -319,9 +319,18 @@ module Mint suites = compile(subjects) + globals = + ast + .components + .select(&.global?) + .each_with_object({} of Item => Compiled) do |item, memo| + memo[item.as(Item)] = [item] of Item + end + ["export default "] + js.arrow_function do js.new(Builtin::TestRunner, [ js.array(suites), + js.object(globals), js.string(url), js.string(id), ]) diff --git a/src/compilers/suite.cr b/src/compilers/suite.cr index 682d46803..7cb0c7ede 100644 --- a/src/compilers/suite.cr +++ b/src/compilers/suite.cr @@ -7,7 +7,7 @@ module Mint Raw.new({ start: {node.from.line, node.from.column}, end: {node.to.line, node.to.column}, - filename: node.file.path, + filename: node.file.relative_path, }.to_json), ] diff --git a/src/compilers/test.cr b/src/compilers/test.cr index 3984bde3e..42da6f544 100644 --- a/src/compilers/test.cr +++ b/src/compilers/test.cr @@ -7,7 +7,7 @@ module Mint Raw.new({ start: {node.from.line, node.from.column}, end: {node.to.line, node.to.column}, - filename: node.file.path, + filename: node.file.relative_path, }.to_json), ] From f8aeeede3fa25e5fffac431a69cff98a5b394ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Sun, 24 Nov 2024 20:27:04 +0100 Subject: [PATCH 2/4] Allow referencing HTML elements and components in tests. --- core/tests/tests/Test.mint | 22 +++++++ spec/compilers/test_with_reference | 45 ++++++++++++++ spec/compilers/test_with_reference_component | 61 +++++++++++++++++++ ...tml_element_reference_outside_of_component | 2 +- src/ast/test.cr | 5 +- src/compiler/js.cr | 5 +- src/compilers/component.cr | 30 +++++---- src/compilers/test.cr | 7 ++- src/compilers/variable.cr | 6 +- src/parsers/test.cr | 17 +++++- src/scope.cr | 8 ++- src/type_checkers/html_element.cr | 4 +- src/type_checkers/variable.cr | 6 +- 13 files changed, 188 insertions(+), 30 deletions(-) create mode 100644 spec/compilers/test_with_reference create mode 100644 spec/compilers/test_with_reference_component diff --git a/core/tests/tests/Test.mint b/core/tests/tests/Test.mint index 5addaf7a4..172bb6548 100644 --- a/core/tests/tests/Test.mint +++ b/core/tests/tests/Test.mint @@ -17,3 +17,25 @@ suite "Test (Function)" { test() == "" } } + +suite "Test with HTML reference" { + test "it works" { +