@stacksjs/stx 0.2.81 → 0.2.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-mode-detector.js +2 -2
- package/dist/build-views.js +2 -2
- package/dist/cli.js +1 -1
- package/dist/components.js +2 -2
- package/dist/conditionals.js +1 -1
- package/dist/custom-directives.js +1 -1
- package/dist/dev-server/index.js +2 -2
- package/dist/dev-server/serve-markdown.js +2 -2
- package/dist/docs.js +2 -2
- package/dist/error-handling.js +1 -1
- package/dist/errors/formatter.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/interactive.js +2 -2
- package/dist/lazy-loader.js +2 -2
- package/dist/misc-directives.js +1 -1
- package/dist/pwa/index.js +2 -2
- package/dist/pwa/offline.js +2 -2
- package/dist/render.js +2 -2
- package/dist/seo.js +1 -1
- package/dist/serve.js +2 -2
- package/dist/site-builder/build.js +2 -2
- package/dist/site-builder/index.js +2 -2
- package/dist/ssr.js +2 -2
- package/dist/story/cli.js +1 -1
- package/dist/story/commands/dev.js +2 -2
- package/dist/story/commands/index.js +2 -2
- package/dist/story/index.js +2 -2
- package/dist/story/renderer.js +2 -2
- package/dist/story/server.js +2 -2
- package/dist/story/visual-testing.js +2 -2
- package/dist/template-compiler.js +2 -2
- package/dist/template-hydrator.js +2 -2
- package/dist/template-tag-balance.js +1 -1
- package/dist/testing.js +2 -2
- package/dist/web-components.js +2 -2
- package/package.json +5 -5
package/dist/interactive.js
CHANGED
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)z.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),z.join("")}function nK($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),z=K===Z-1?">":" ";G.push(`${z}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function oK($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;z.push(`${B}${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1787
1787
|
`)}function zZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function UZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function a($,Z,Y){return X3({type:$,message:Z,code:Y,format:"html"}).formatted}function sK($,Z,Y,X,J){return X3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function rK($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=UZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var m2={};p(m2,{warnUnbalancedTags:()=>r3,findUnbalancedTags:()=>d2});function F1($){return $.replace(/[^\n]/g," ")}function d2($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,F1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,F1).replace(/<!--[\s\S]*?-->/g,F1).replace(/\{\{\{[\s\S]*?\}\}\}/g,F1).replace(/\{\{[\s\S]*?\}\}/g,F1).replace(/\{!![\s\S]*?!!\}/g,F1).replace(/"[^"]*"/g,F1).replace(/'[^']*'/g,F1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],z=Q[3]==="/";if(mU.has(q.toLowerCase()))continue;if(z)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let U=Y.get(q);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(uU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function r3($,Z){let Y;try{Y=d2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(h2.has(X))return;h2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(uU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function r3($,Z){let Y;try{Y=d2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(h2.has(X))return;h2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var mU,uU,h2;var a3=C(()=>{mU=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),uU=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);h2=new Set});import m0 from"path";import t3 from"fs";function u2($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function l2($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class p2{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),u2(J),l2(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${u2(J)}.stx`,`${l2(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=m0.resolve(m0.dirname(Z),`${J}.stx`);if(await n(B))return B;return null}let K=[],q=Y.componentsDir||"",z=X?.__originalFilePath;if(z)K.push(m0.join(m0.dirname(z),"components"));if(q)K.push(q);let U=m0.join(m0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[m0.resolve(W,"src/components"),m0.resolve(W,"components"),m0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=m0.join(B,j);if(await n(H))return H}try{if(!t3.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=t3.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=m0.join(B,L.name);for(let O of G){let V=m0.join(F,O);if(await n(V))return V}}}catch{}}return null}}var b0;var e3=C(()=>{A0();b0=new p2});function V1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function lU($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var $6;var Z6=C(()=>{$6={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=lU($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${V1(X.value)}"`);else q.push(`href="${V1(X.value)}"`);if(J)q.push(`class="${V1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${V1(Q)}"`),q.push(`data-stx-exact-active-class="${V1(G)}"`),K)q.push("data-stx-prefetch");let z=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(z.has(U))continue;if(typeof W==="boolean"){if(W)q.push(V1(U))}else q.push(`${V1(U)}="${V1(W)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function j0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function D0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function X6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function c2($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=pU[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function J6($,Z,Y,X){return Z.map((J)=>`${o5($,J,void 0,Y,X)} ${J}w`).join(", ")}function cU($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${o5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function o5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function iU($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var pU,Y6,Q6;var G6=C(()=>{pU={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Y6=[320,640,768,1024,1280,1536,1920];Q6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=D0($,"src")||"",J=D0($,"alt")||"",Q=D0($,"width"),G=D0($,"height"),K=D0($,"sizes"),q=D0($,"srcset"),z=D0($,"densities"),U=D0($,"format"),W=D0($,"placeholder"),_=D0($,"placeholderColor")||"#e5e7eb",B=D0($,"provider"),j=D0($,"class")||D0($,"className")||"",H=D0($,"style")||"",L=D0($,"quality"),F=X6($,"lazy",!0),O=X6($,"preload",!1),V=X6($,"picture",!1)||!!U,A=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,R=q||"",N="";if(!R&&K)R=J6(X,Y6,B,U),N=c2(K);else if(!R&&z){let S=z.split(/\s+/).map((y)=>Number.parseFloat(y.replace("x","")));R=cU(X,S,A,B,U)}else if(K)N=c2(K);let M=[];if(H)M.push(H);if(A&&w)M.push(`aspect-ratio:${A}/${w}`);if(W==="blur"||W==="color"||W==="thumbhash"){let S=iU(A||16,w||9,_);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${j0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=o5(X,A,w,B,U),I=[];if(I.push(`src="${j0(T)}"`),I.push(`alt="${j0(J)}"`),Q)I.push(`width="${j0(Q)}"`);if(G)I.push(`height="${j0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${j0(j)}"`);if(M.length>0)I.push(`style="${j0(M.join(";"))}"`);if(R)I.push(`srcset="${j0(R)}"`);if(N)I.push(`sizes="${j0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,y]of Object.entries($.static)){if(D.has(S))continue;if(typeof y==="boolean"){if(y)I.push(j0(S))}else I.push(`${j0(S)}="${j0(y)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let y=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${j0(T)}"${y?` type="${y}"`:""}${R?` imagesrcset="${j0(R)}"`:""}${N?` imagesizes="${j0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(U==="avif"||U==="auto"){let y=o5(X,A,w,B,"avif"),P=R?J6(X,Y6,B,"avif"):`${y}`;S.push(`<source type="image/avif" srcset="${j0(P)}"${N?` sizes="${j0(N)}"`:""} />`)}if(U==="webp"||U==="auto"){let y=o5(X,A,w,B,"webp"),P=R?J6(X,Y6,B,"webp"):`${y}`;S.push(`<source type="image/webp" srcset="${j0(P)}"${N?` sizes="${j0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
package/dist/lazy-loader.js
CHANGED
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)z.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),z.join("")}function cK($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),z=K===Z-1?">":" ";G.push(`${z}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function iK($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;z.push(`${B}${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1787
1787
|
`)}function zZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function UZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return t7({type:$,message:Z,code:Y,format:"html"}).formatted}function nK($,Z,Y,X,J){return t7({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function oK($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=UZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var mY={};p(mY,{warnUnbalancedTags:()=>n3,findUnbalancedTags:()=>dY});function L1($){return $.replace(/[^\n]/g," ")}function dY($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,L1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,L1).replace(/<!--[\s\S]*?-->/g,L1).replace(/\{\{\{[\s\S]*?\}\}\}/g,L1).replace(/\{\{[\s\S]*?\}\}/g,L1).replace(/\{!![\s\S]*?!!\}/g,L1).replace(/"[^"]*"/g,L1).replace(/'[^']*'/g,L1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],z=Q[3]==="/";if(gU.has(q.toLowerCase()))continue;if(z)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let U=Y.get(q);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(hU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function n3($,Z){let Y;try{Y=dY($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(hY.has(X))return;hY.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(hU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function n3($,Z){let Y;try{Y=dY($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(hY.has(X))return;hY.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var gU,hU,hY;var o3=C(()=>{gU=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),hU=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);hY=new Set});import h0 from"path";import s3 from"fs";function uY($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function pY($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class lY{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),uY(J),pY(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${uY(J)}.stx`,`${pY(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=h0.resolve(h0.dirname(Z),`${J}.stx`);if(await i(B))return B;return null}let K=[],q=Y.componentsDir||"",z=X?.__originalFilePath;if(z)K.push(h0.join(h0.dirname(z),"components"));if(q)K.push(q);let U=h0.join(h0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[h0.resolve(W,"src/components"),h0.resolve(W,"components"),h0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=h0.join(B,j);if(await i(H))return H}try{if(!s3.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=s3.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=h0.join(B,L.name);for(let O of G){let V=h0.join(F,O);if(await i(V))return V}}}catch{}}return null}}var S0;var r3=C(()=>{V0();S0=new lY});function F1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function dU($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var a3;var t3=C(()=>{a3={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=dU($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${F1(X.value)}"`);else q.push(`href="${F1(X.value)}"`);if(J)q.push(`class="${F1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${F1(Q)}"`),q.push(`data-stx-exact-active-class="${F1(G)}"`),K)q.push("data-stx-prefetch");let z=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(z.has(U))continue;if(typeof W==="boolean"){if(W)q.push(F1(U))}else q.push(`${F1(U)}="${F1(W)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function _0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function $6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function cY($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=mU[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function Z6($,Z,Y,X){return Z.map((J)=>`${c5($,J,void 0,Y,X)} ${J}w`).join(", ")}function uU($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${c5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function c5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function pU($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var mU,e3,Y6;var X6=C(()=>{mU={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},e3=[320,640,768,1024,1280,1536,1920];Y6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),z=I0($,"densities"),U=I0($,"format"),W=I0($,"placeholder"),_=I0($,"placeholderColor")||"#e5e7eb",B=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=$6($,"lazy",!0),O=$6($,"preload",!1),V=$6($,"picture",!1)||!!U,A=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,R=q||"",N="";if(!R&&K)R=Z6(X,e3,B,U),N=cY(K);else if(!R&&z){let S=z.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));R=uU(X,S,A,B,U)}else if(K)N=cY(K);let M=[];if(H)M.push(H);if(A&&w)M.push(`aspect-ratio:${A}/${w}`);if(W==="blur"||W==="color"||W==="thumbhash"){let S=pU(A||16,w||9,_);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${_0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=c5(X,A,w,B,U),I=[];if(I.push(`src="${_0(T)}"`),I.push(`alt="${_0(J)}"`),Q)I.push(`width="${_0(Q)}"`);if(G)I.push(`height="${_0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${_0(j)}"`);if(M.length>0)I.push(`style="${_0(M.join(";"))}"`);if(R)I.push(`srcset="${_0(R)}"`);if(N)I.push(`sizes="${_0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(_0(S))}else I.push(`${_0(S)}="${_0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${_0(T)}"${b?` type="${b}"`:""}${R?` imagesrcset="${_0(R)}"`:""}${N?` imagesizes="${_0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(U==="avif"||U==="auto"){let b=c5(X,A,w,B,"avif"),y=R?Z6(X,e3,B,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${_0(y)}"${N?` sizes="${_0(N)}"`:""} />`)}if(U==="webp"||U==="auto"){let b=c5(X,A,w,B,"webp"),y=R?Z6(X,e3,B,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${_0(y)}"${N?` sizes="${_0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
package/dist/misc-directives.js
CHANGED
|
@@ -58,7 +58,7 @@ ${H}`)}if(q.suggestion)B.push(`
|
|
|
58
58
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),B.join("")}function nq(q,J,Z){let $=q.split(`
|
|
59
59
|
`),X=Math.max(0,J-Z-1),W=Math.min($.length-1,J+Z-1),V=[];for(let Y=X;Y<=W;Y++){let U=(Y+1).toString().padStart(4),B=Y===J-1?">":" ";V.push(`${B}${U} | ${$[Y]}`)}return V.join(`
|
|
60
60
|
`)}function aq(q,J,Z){let $=q.split(`
|
|
61
|
-
`),X=Math.max(0,J-Z-1),W=Math.min($.length-1,J+Z-1),V="\x1B[90m",Y="\x1B[31m",U="\x1B[0m",B=[];for(let G=X;G<=W;G++){let H=(G+1).toString().padStart(4),Q=G===J-1,F=Q?"\x1B[31m>\x1B[0m":" ",M=Q?`\x1B[31m${$[G]}\x1B[0m`:`\x1B[90m${$[G]}
|
|
61
|
+
`),X=Math.max(0,J-Z-1),W=Math.min($.length-1,J+Z-1),V="\x1B[90m",Y="\x1B[31m",U="\x1B[0m",B=[];for(let G=X;G<=W;G++){let H=(G+1).toString().padStart(4),Q=G===J-1,F=Q?"\x1B[31m>\x1B[0m":" ",M=Q?`\x1B[31m${$[G]}\x1B[0m`:`\x1B[90m${$[G]}`;B.push(`${F}${H}\x1B[0m | ${M}`)}return B.join(`
|
|
62
62
|
`)}function Fq(q){return q.replace(/--/g,"- -").replace(/>/g,">")}function Qq(q,J){let $=q.substring(0,J).split(`
|
|
63
63
|
`);return{line:$.length,column:$[$.length-1].length}}function tq(q,J,Z){return p({type:q,message:J,code:Z,format:"html"}).formatted}function eq(q,J,Z,$,X){return p({type:q,message:J,code:X,filePath:Z,line:$,format:"console"}).formatted}function qJ(q,J,Z){let $=Z.template.split(`
|
|
64
64
|
`),X=Qq(Z.template,Z.offset),W=`[${q} Error at line ${X.line} in ${Z.filePath}]: ${J}
|
package/dist/pwa/index.js
CHANGED
|
@@ -1783,7 +1783,7 @@ ${z}`)}if($.suggestion)U.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),U.join("")}function Gq($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),U=K===Z-1?">":" ";G.push(`${U}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function Kq($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",U=[];for(let W=J;W<=Q;W++){let z=(W+1).toString().padStart(4),B=W===Z-1,_=B?"\x1B[31m>\x1B[0m":" ",j=B?`\x1B[31m${X[W]}\x1B[0m`:`\x1B[90m${X[W]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",U=[];for(let W=J;W<=Q;W++){let z=(W+1).toString().padStart(4),B=W===Z-1,_=B?"\x1B[31m>\x1B[0m":" ",j=B?`\x1B[31m${X[W]}\x1B[0m`:`\x1B[90m${X[W]}`;U.push(`${_}${z}\x1B[0m | ${j}`)}return U.join(`
|
|
1787
1787
|
`)}function VZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function wZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return K3({type:$,message:Z,code:Y,format:"html"}).formatted}function qq($,Z,Y,X,J){return K3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function Uq($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=wZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var a2={};l(a2,{warnUnbalancedTags:()=>$6,findUnbalancedTags:()=>r2});function F1($){return $.replace(/[^\n]/g," ")}function r2($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,F1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,F1).replace(/<!--[\s\S]*?-->/g,F1).replace(/\{\{\{[\s\S]*?\}\}\}/g,F1).replace(/\{\{[\s\S]*?\}\}/g,F1).replace(/\{!![\s\S]*?!!\}/g,F1).replace(/"[^"]*"/g,F1).replace(/'[^']*'/g,F1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],U=Q[3]==="/";if($z.has(q.toLowerCase()))continue;if(U)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let W=Y.get(q);if(W)W.count++;else{let z=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:z})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(Zz.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,U=X.get(K)??0;if(q!==U)G.push({tag:K,opened:q,closed:U,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $6($,Z){let Y;try{Y=r2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(s2.has(X))return;s2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let U=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${U}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:z})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(Zz.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,U=X.get(K)??0;if(q!==U)G.push({tag:K,opened:q,closed:U,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $6($,Z){let Y;try{Y=r2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(s2.has(X))return;s2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let U=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${U} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var $z,Zz,s2;var Z6=P(()=>{$z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zz=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);s2=new Set});import h0 from"path";import Y6 from"fs";function t2($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function e2($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class $Y{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let _=[J,J.toLowerCase(),t2(J),e2(J)];for(let j of _)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${t2(J)}.stx`,`${e2(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let _=h0.resolve(h0.dirname(Z),`${J}.stx`);if(await i(_))return _;return null}let K=[],q=Y.componentsDir||"",U=X?.__originalFilePath;if(U)K.push(h0.join(h0.dirname(U),"components"));if(q)K.push(q);let W=h0.join(h0.dirname(Z),"components");if(!K.includes(W))K.push(W);let z=process.cwd(),B=[h0.resolve(z,"src/components"),h0.resolve(z,"components"),h0.resolve(import.meta.dir,"components")];for(let _ of B)if(!K.includes(_))K.push(_);for(let _ of K){if(!_)continue;for(let j of G){let H=h0.join(_,j);if(await i(H))return H}try{if(!Y6.statSync(_,{throwIfNoEntry:!1})?.isDirectory())continue;let H=Y6.readdirSync(_,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=h0.join(_,L.name);for(let O of G){let V=h0.join(F,O);if(await i(V))return V}}}catch{}}return null}}var S0;var X6=P(()=>{V0();S0=new $Y});function V1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Yz($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var J6;var Q6=P(()=>{J6={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=Yz($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${V1(X.value)}"`);else q.push(`href="${V1(X.value)}"`);if(J)q.push(`class="${V1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${V1(Q)}"`),q.push(`data-stx-exact-active-class="${V1(G)}"`),K)q.push("data-stx-prefetch");let U=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[W,z]of Object.entries($.static)){if(U.has(W))continue;if(typeof z==="boolean"){if(z)q.push(V1(W))}else q.push(`${V1(W)}="${V1(z)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function B0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function K6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function ZY($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=Xz[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function q6($,Z,Y,X){return Z.map((J)=>`${o5($,J,void 0,Y,X)} ${J}w`).join(", ")}function Jz($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${o5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function o5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function Qz($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var Xz,G6,U6;var W6=P(()=>{Xz={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},G6=[320,640,768,1024,1280,1536,1920];U6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),U=I0($,"densities"),W=I0($,"format"),z=I0($,"placeholder"),B=I0($,"placeholderColor")||"#e5e7eb",_=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=K6($,"lazy",!0),O=K6($,"preload",!1),V=K6($,"picture",!1)||!!W,R=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,A=q||"",N="";if(!A&&K)A=q6(X,G6,_,W),N=ZY(K);else if(!A&&U){let S=U.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));A=Jz(X,S,R,_,W)}else if(K)N=ZY(K);let M=[];if(H)M.push(H);if(R&&w)M.push(`aspect-ratio:${R}/${w}`);if(z==="blur"||z==="color"||z==="thumbhash"){let S=Qz(R||16,w||9,B);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(z&&z!=="empty"&&z!=="none")M.push(`background-image:url(${B0(z)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=o5(X,R,w,_,W),I=[];if(I.push(`src="${B0(T)}"`),I.push(`alt="${B0(J)}"`),Q)I.push(`width="${B0(Q)}"`);if(G)I.push(`height="${B0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${B0(j)}"`);if(M.length>0)I.push(`style="${B0(M.join(";"))}"`);if(A)I.push(`srcset="${B0(A)}"`);if(N)I.push(`sizes="${B0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(B0(S))}else I.push(`${B0(S)}="${B0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=W==="webp"?"image/webp":W==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${B0(T)}"${b?` type="${b}"`:""}${A?` imagesrcset="${B0(A)}"`:""}${N?` imagesizes="${B0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(W==="avif"||W==="auto"){let b=o5(X,R,w,_,"avif"),y=A?q6(X,G6,_,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${B0(y)}"${N?` sizes="${B0(N)}"`:""} />`)}if(W==="webp"||W==="auto"){let b=o5(X,R,w,_,"webp"),y=A?q6(X,G6,_,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${B0(y)}"${N?` sizes="${B0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
package/dist/pwa/offline.js
CHANGED
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)z.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),z.join("")}function cK($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),z=K===Z-1?">":" ";G.push(`${z}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function iK($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;z.push(`${B}${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1787
1787
|
`)}function GZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function KZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return $3({type:$,message:Z,code:Y,format:"html"}).formatted}function nK($,Z,Y,X,J){return $3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function oK($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=KZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var g2={};l(g2,{warnUnbalancedTags:()=>n3,findUnbalancedTags:()=>f2});function L1($){return $.replace(/[^\n]/g," ")}function f2($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,L1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,L1).replace(/<!--[\s\S]*?-->/g,L1).replace(/\{\{\{[\s\S]*?\}\}\}/g,L1).replace(/\{\{[\s\S]*?\}\}/g,L1).replace(/\{!![\s\S]*?!!\}/g,L1).replace(/"[^"]*"/g,L1).replace(/'[^']*'/g,L1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],z=Q[3]==="/";if(hU.has(q.toLowerCase()))continue;if(z)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let U=Y.get(q);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(dU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function n3($,Z){let Y;try{Y=f2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(x2.has(X))return;x2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(dU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function n3($,Z){let Y;try{Y=f2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(x2.has(X))return;x2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var hU,dU,x2;var o3=C(()=>{hU=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),dU=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);x2=new Set});import h0 from"path";import s3 from"fs";function h2($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function d2($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class m2{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),h2(J),d2(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${h2(J)}.stx`,`${d2(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=h0.resolve(h0.dirname(Z),`${J}.stx`);if(await i(B))return B;return null}let K=[],q=Y.componentsDir||"",z=X?.__originalFilePath;if(z)K.push(h0.join(h0.dirname(z),"components"));if(q)K.push(q);let U=h0.join(h0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[h0.resolve(W,"src/components"),h0.resolve(W,"components"),h0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=h0.join(B,j);if(await i(H))return H}try{if(!s3.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=s3.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=h0.join(B,L.name);for(let O of G){let V=h0.join(F,O);if(await i(V))return V}}}catch{}}return null}}var S0;var r3=C(()=>{V0();S0=new m2});function F1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function mU($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var a3;var t3=C(()=>{a3={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=mU($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${F1(X.value)}"`);else q.push(`href="${F1(X.value)}"`);if(J)q.push(`class="${F1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${F1(Q)}"`),q.push(`data-stx-exact-active-class="${F1(G)}"`),K)q.push("data-stx-prefetch");let z=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(z.has(U))continue;if(typeof W==="boolean"){if(W)q.push(F1(U))}else q.push(`${F1(U)}="${F1(W)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function _0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function $6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function u2($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=uU[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function Z6($,Z,Y,X){return Z.map((J)=>`${c5($,J,void 0,Y,X)} ${J}w`).join(", ")}function lU($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${c5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function c5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function pU($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var uU,e3,Y6;var X6=C(()=>{uU={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},e3=[320,640,768,1024,1280,1536,1920];Y6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),z=I0($,"densities"),U=I0($,"format"),W=I0($,"placeholder"),_=I0($,"placeholderColor")||"#e5e7eb",B=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=$6($,"lazy",!0),O=$6($,"preload",!1),V=$6($,"picture",!1)||!!U,A=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,R=q||"",N="";if(!R&&K)R=Z6(X,e3,B,U),N=u2(K);else if(!R&&z){let S=z.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));R=lU(X,S,A,B,U)}else if(K)N=u2(K);let M=[];if(H)M.push(H);if(A&&w)M.push(`aspect-ratio:${A}/${w}`);if(W==="blur"||W==="color"||W==="thumbhash"){let S=pU(A||16,w||9,_);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${_0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=c5(X,A,w,B,U),I=[];if(I.push(`src="${_0(T)}"`),I.push(`alt="${_0(J)}"`),Q)I.push(`width="${_0(Q)}"`);if(G)I.push(`height="${_0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${_0(j)}"`);if(M.length>0)I.push(`style="${_0(M.join(";"))}"`);if(R)I.push(`srcset="${_0(R)}"`);if(N)I.push(`sizes="${_0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(_0(S))}else I.push(`${_0(S)}="${_0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${_0(T)}"${b?` type="${b}"`:""}${R?` imagesrcset="${_0(R)}"`:""}${N?` imagesizes="${_0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(U==="avif"||U==="auto"){let b=c5(X,A,w,B,"avif"),y=R?Z6(X,e3,B,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${_0(y)}"${N?` sizes="${_0(N)}"`:""} />`)}if(U==="webp"||U==="auto"){let b=c5(X,A,w,B,"webp"),y=R?Z6(X,e3,B,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${_0(y)}"${N?` sizes="${_0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
package/dist/render.js
CHANGED
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)z.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),z.join("")}function pK($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),z=K===Z-1?">":" ";G.push(`${z}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function iK($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;z.push(`${B}${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1787
1787
|
`)}function qZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function zZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return Z3({type:$,message:Z,code:Y,format:"html"}).formatted}function nK($,Z,Y,X,J){return Z3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function oK($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=zZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var d2={};l(d2,{warnUnbalancedTags:()=>s3,findUnbalancedTags:()=>h2});function V1($){return $.replace(/[^\n]/g," ")}function h2($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,V1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,V1).replace(/<!--[\s\S]*?-->/g,V1).replace(/\{\{\{[\s\S]*?\}\}\}/g,V1).replace(/\{\{[\s\S]*?\}\}/g,V1).replace(/\{!![\s\S]*?!!\}/g,V1).replace(/"[^"]*"/g,V1).replace(/'[^']*'/g,V1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],z=Q[3]==="/";if(gU.has(q.toLowerCase()))continue;if(z)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let U=Y.get(q);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(hU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function s3($,Z){let Y;try{Y=h2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(g2.has(X))return;g2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(hU.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function s3($,Z){let Y;try{Y=h2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(g2.has(X))return;g2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var gU,hU,g2;var r3=y(()=>{gU=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),hU=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);g2=new Set});import h0 from"path";import a3 from"fs";function m2($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function u2($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class l2{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),m2(J),u2(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${m2(J)}.stx`,`${u2(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=h0.resolve(h0.dirname(Z),`${J}.stx`);if(await i(B))return B;return null}let K=[],q=Y.componentsDir||"",z=X?.__originalFilePath;if(z)K.push(h0.join(h0.dirname(z),"components"));if(q)K.push(q);let U=h0.join(h0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[h0.resolve(W,"src/components"),h0.resolve(W,"components"),h0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=h0.join(B,j);if(await i(H))return H}try{if(!a3.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=a3.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=h0.join(B,L.name);for(let O of G){let V=h0.join(F,O);if(await i(V))return V}}}catch{}}return null}}var b0;var t3=y(()=>{w0();b0=new l2});function w1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function dU($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var e3;var $6=y(()=>{e3={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=dU($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${w1(X.value)}"`);else q.push(`href="${w1(X.value)}"`);if(J)q.push(`class="${w1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${w1(Q)}"`),q.push(`data-stx-exact-active-class="${w1(G)}"`),K)q.push("data-stx-prefetch");let z=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(z.has(U))continue;if(typeof W==="boolean"){if(W)q.push(w1(U))}else q.push(`${w1(U)}="${w1(W)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function B0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function Y6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function c2($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=mU[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function X6($,Z,Y,X){return Z.map((J)=>`${s5($,J,void 0,Y,X)} ${J}w`).join(", ")}function uU($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${s5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function s5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function lU($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var mU,Z6,J6;var Q6=y(()=>{mU={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Z6=[320,640,768,1024,1280,1536,1920];J6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),z=I0($,"densities"),U=I0($,"format"),W=I0($,"placeholder"),_=I0($,"placeholderColor")||"#e5e7eb",B=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=Y6($,"lazy",!0),O=Y6($,"preload",!1),V=Y6($,"picture",!1)||!!U,A=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,R=q||"",N="";if(!R&&K)R=X6(X,Z6,B,U),N=c2(K);else if(!R&&z){let b=z.split(/\s+/).map((S)=>Number.parseFloat(S.replace("x","")));R=uU(X,b,A,B,U)}else if(K)N=c2(K);let M=[];if(H)M.push(H);if(A&&w)M.push(`aspect-ratio:${A}/${w}`);if(W==="blur"||W==="color"||W==="thumbhash"){let b=lU(A||16,w||9,_);M.push(`background-image:url(${b})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${B0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=s5(X,A,w,B,U),I=[];if(I.push(`src="${B0(T)}"`),I.push(`alt="${B0(J)}"`),Q)I.push(`width="${B0(Q)}"`);if(G)I.push(`height="${B0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${B0(j)}"`);if(M.length>0)I.push(`style="${B0(M.join(";"))}"`);if(R)I.push(`srcset="${B0(R)}"`);if(N)I.push(`sizes="${B0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[b,S]of Object.entries($.static)){if(D.has(b))continue;if(typeof S==="boolean"){if(S)I.push(B0(b))}else I.push(`${B0(b)}="${B0(S)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let S=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${B0(T)}"${S?` type="${S}"`:""}${R?` imagesrcset="${B0(R)}"`:""}${N?` imagesizes="${B0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let b=[];if(U==="avif"||U==="auto"){let S=s5(X,A,w,B,"avif"),P=R?X6(X,Z6,B,"avif"):`${S}`;b.push(`<source type="image/avif" srcset="${B0(P)}"${N?` sizes="${B0(N)}"`:""} />`)}if(U==="webp"||U==="auto"){let S=s5(X,A,w,B,"webp"),P=R?X6(X,Z6,B,"webp"):`${S}`;b.push(`<source type="image/webp" srcset="${B0(P)}"${N?` sizes="${B0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${b.join(`
|
|
4026
4026
|
`)}
|
package/dist/seo.js
CHANGED
|
@@ -58,7 +58,7 @@ ${F}`)}if(J.suggestion)V.push(`
|
|
|
58
58
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),V.join("")}function sJ(J,Q,Z){let $=J.split(`
|
|
59
59
|
`),q=Math.max(0,Q-Z-1),W=Math.min($.length-1,Q+Z-1),G=[];for(let Y=q;Y<=W;Y++){let X=(Y+1).toString().padStart(4),V=Y===Q-1?">":" ";G.push(`${V}${X} | ${$[Y]}`)}return G.join(`
|
|
60
60
|
`)}function rJ(J,Q,Z){let $=J.split(`
|
|
61
|
-
`),q=Math.max(0,Q-Z-1),W=Math.min($.length-1,Q+Z-1),G="\x1B[90m",Y="\x1B[31m",X="\x1B[0m",V=[];for(let B=q;B<=W;B++){let F=(B+1).toString().padStart(4),O=B===Q-1,M=O?"\x1B[31m>\x1B[0m":" ",K=O?`\x1B[31m${$[B]}\x1B[0m`:`\x1B[90m${$[B]}
|
|
61
|
+
`),q=Math.max(0,Q-Z-1),W=Math.min($.length-1,Q+Z-1),G="\x1B[90m",Y="\x1B[31m",X="\x1B[0m",V=[];for(let B=q;B<=W;B++){let F=(B+1).toString().padStart(4),O=B===Q-1,M=O?"\x1B[31m>\x1B[0m":" ",K=O?`\x1B[31m${$[B]}\x1B[0m`:`\x1B[90m${$[B]}`;V.push(`${M}${F}\x1B[0m | ${K}`)}return V.join(`
|
|
62
62
|
`)}function BJ(J){return J.replace(/--/g,"- -").replace(/>/g,">")}function FJ(J,Q){let $=J.substring(0,Q).split(`
|
|
63
63
|
`);return{line:$.length,column:$[$.length-1].length}}function w(J,Q,Z){return p({type:J,message:Q,code:Z,format:"html"}).formatted}function iJ(J,Q,Z,$,q){return p({type:J,message:Q,code:q,filePath:Z,line:$,format:"console"}).formatted}function nJ(J,Q,Z){let $=Z.template.split(`
|
|
64
64
|
`),q=FJ(Z.template,Z.offset),W=`[${J} Error at line ${q.line} in ${Z.filePath}]: ${Q}
|
package/dist/serve.js
CHANGED
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)q.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),q.join("")}function cK($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let z=(K+1).toString().padStart(4),q=K===Z-1?">":" ";G.push(`${q}${z} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function iK($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",z="\x1B[0m",q=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",z="\x1B[0m",q=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;q.push(`${B}${W}\x1B[0m | ${j}`)}return q.join(`
|
|
1787
1787
|
`)}function qZ($){return $.replace(/--/g,"- -").replace(/>/g,">")}function UZ($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return X3({type:$,message:Z,code:Y,format:"html"}).formatted}function nK($,Z,Y,X,J){return X3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function oK($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=UZ(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${z?`{${z}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var d2={};p(d2,{warnUnbalancedTags:()=>a3,findUnbalancedTags:()=>h2});function F1($){return $.replace(/[^\n]/g," ")}function h2($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,F1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,F1).replace(/<!--[\s\S]*?-->/g,F1).replace(/\{\{\{[\s\S]*?\}\}\}/g,F1).replace(/\{\{[\s\S]*?\}\}/g,F1).replace(/\{!![\s\S]*?!!\}/g,F1).replace(/"[^"]*"/g,F1).replace(/'[^']*'/g,F1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",z=Q[2],q=Q[3]==="/";if(gU.has(z.toLowerCase()))continue;if(q)continue;if(K)X.set(z,(X.get(z)??0)+1);else{let U=Y.get(z);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(z,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(hU.has(K.toLowerCase()))continue;let z=Y.get(K)?.count??0,q=X.get(K)??0;if(z!==q)G.push({tag:K,opened:z,closed:q,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function a3($,Z){let Y;try{Y=h2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(g2.has(X))return;g2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:z}of Y)if(G>K){let q=z?` (first opened at line ${z})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${q}
|
|
4023
|
+
`).length;Y.set(z,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(hU.has(K.toLowerCase()))continue;let z=Y.get(K)?.count??0,q=X.get(K)??0;if(z!==q)G.push({tag:K,opened:z,closed:q,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function a3($,Z){let Y;try{Y=h2($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(g2.has(X))return;g2.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:z}of Y)if(G>K){let q=z?` (first opened at line ${z})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${q} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var gU,hU,g2;var t3=C(()=>{gU=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),hU=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);g2=new Set});import d0 from"path";import e3 from"fs";function m2($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function u2($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class l2{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),m2(J),u2(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${m2(J)}.stx`,`${u2(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=d0.resolve(d0.dirname(Z),`${J}.stx`);if(await n(B))return B;return null}let K=[],z=Y.componentsDir||"",q=X?.__originalFilePath;if(q)K.push(d0.join(d0.dirname(q),"components"));if(z)K.push(z);let U=d0.join(d0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[d0.resolve(W,"src/components"),d0.resolve(W,"components"),d0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=d0.join(B,j);if(await n(H))return H}try{if(!e3.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=e3.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=d0.join(B,L.name);for(let O of G){let V=d0.join(F,O);if(await n(V))return V}}}catch{}}return null}}var y0;var $6=C(()=>{F0();y0=new l2});function V1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function dU($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var Z6;var Y6=C(()=>{Z6={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=dU($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,z=[];if(X.reactive)z.push(`:href="${V1(X.value)}"`);else z.push(`href="${V1(X.value)}"`);if(J)z.push(`class="${V1(J)}"`);if(z.push("data-stx-link"),z.push(`data-stx-active-class="${V1(Q)}"`),z.push(`data-stx-exact-active-class="${V1(G)}"`),K)z.push("data-stx-prefetch");let q=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(q.has(U))continue;if(typeof W==="boolean"){if(W)z.push(V1(U))}else z.push(`${V1(U)}="${V1(W)}"`)}return`<a ${z.join(" ")}>${Z}</a>`}}});function j0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function D0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function J6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function p2($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=mU[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function Q6($,Z,Y,X){return Z.map((J)=>`${i5($,J,void 0,Y,X)} ${J}w`).join(", ")}function uU($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${i5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function i5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function lU($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var mU,X6,G6;var K6=C(()=>{mU={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},X6=[320,640,768,1024,1280,1536,1920];G6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=D0($,"src")||"",J=D0($,"alt")||"",Q=D0($,"width"),G=D0($,"height"),K=D0($,"sizes"),z=D0($,"srcset"),q=D0($,"densities"),U=D0($,"format"),W=D0($,"placeholder"),_=D0($,"placeholderColor")||"#e5e7eb",B=D0($,"provider"),j=D0($,"class")||D0($,"className")||"",H=D0($,"style")||"",L=D0($,"quality"),F=J6($,"lazy",!0),O=J6($,"preload",!1),V=J6($,"picture",!1)||!!U,A=Q?Number.parseInt(Q):void 0,w=G?Number.parseInt(G):void 0,R=z||"",N="";if(!R&&K)R=Q6(X,X6,B,U),N=p2(K);else if(!R&&q){let S=q.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));R=uU(X,S,A,B,U)}else if(K)N=p2(K);let M=[];if(H)M.push(H);if(A&&w)M.push(`aspect-ratio:${A}/${w}`);if(W==="blur"||W==="color"||W==="thumbhash"){let S=lU(A||16,w||9,_);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${j0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=i5(X,A,w,B,U),I=[];if(I.push(`src="${j0(T)}"`),I.push(`alt="${j0(J)}"`),Q)I.push(`width="${j0(Q)}"`);if(G)I.push(`height="${j0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${j0(j)}"`);if(M.length>0)I.push(`style="${j0(M.join(";"))}"`);if(R)I.push(`srcset="${j0(R)}"`);if(N)I.push(`sizes="${j0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(j0(S))}else I.push(`${j0(S)}="${j0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${j0(T)}"${b?` type="${b}"`:""}${R?` imagesrcset="${j0(R)}"`:""}${N?` imagesizes="${j0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(U==="avif"||U==="auto"){let b=i5(X,A,w,B,"avif"),y=R?Q6(X,X6,B,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${j0(y)}"${N?` sizes="${j0(N)}"`:""} />`)}if(U==="webp"||U==="auto"){let b=i5(X,A,w,B,"webp"),y=R?Q6(X,X6,B,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${j0(y)}"${N?` sizes="${j0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)z.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),z.join("")}function _q($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),z=K===Z-1?">":" ";G.push(`${z}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function Bq($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;z.push(`${B}${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1787
1787
|
`)}function OY($){return $.replace(/--/g,"- -").replace(/>/g,">")}function LY($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return G3({type:$,message:Z,code:Y,format:"html"}).formatted}function jq($,Z,Y,X,J){return G3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function Hq($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=LY(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var nX={};c(nX,{warnUnbalancedTags:()=>$6,findUnbalancedTags:()=>iX});function V1($){return $.replace(/[^\n]/g," ")}function iX($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,V1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,V1).replace(/<!--[\s\S]*?-->/g,V1).replace(/\{\{\{[\s\S]*?\}\}\}/g,V1).replace(/\{\{[\s\S]*?\}\}/g,V1).replace(/\{!![\s\S]*?!!\}/g,V1).replace(/"[^"]*"/g,V1).replace(/'[^']*'/g,V1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],z=Q[3]==="/";if(GW.has(q.toLowerCase()))continue;if(z)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let U=Y.get(q);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(KW.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $6($,Z){let Y;try{Y=iX($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(lX.has(X))return;lX.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(KW.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $6($,Z){let Y;try{Y=iX($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(lX.has(X))return;lX.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var GW,KW,lX;var Z6=y(()=>{GW=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),KW=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);lX=new Set});import d0 from"path";import Y6 from"fs";function oX($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function sX($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class rX{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),oX(J),sX(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${oX(J)}.stx`,`${sX(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=d0.resolve(d0.dirname(Z),`${J}.stx`);if(await n(B))return B;return null}let K=[],q=Y.componentsDir||"",z=X?.__originalFilePath;if(z)K.push(d0.join(d0.dirname(z),"components"));if(q)K.push(q);let U=d0.join(d0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[d0.resolve(W,"src/components"),d0.resolve(W,"components"),d0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=d0.join(B,j);if(await n(H))return H}try{if(!Y6.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=Y6.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=d0.join(B,L.name);for(let O of G){let V=d0.join(F,O);if(await n(V))return V}}}catch{}}return null}}var b0;var X6=y(()=>{V0();b0=new rX});function w1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function qW($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var J6;var Q6=y(()=>{J6={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=qW($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${w1(X.value)}"`);else q.push(`href="${w1(X.value)}"`);if(J)q.push(`class="${w1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${w1(Q)}"`),q.push(`data-stx-exact-active-class="${w1(G)}"`),K)q.push("data-stx-prefetch");let z=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(z.has(U))continue;if(typeof W==="boolean"){if(W)q.push(w1(U))}else q.push(`${w1(U)}="${w1(W)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function _0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function K6($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function aX($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=zW[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function q6($,Z,Y,X){return Z.map((J)=>`${r5($,J,void 0,Y,X)} ${J}w`).join(", ")}function UW($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${r5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function r5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function WW($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var zW,G6,z6;var U6=y(()=>{zW={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},G6=[320,640,768,1024,1280,1536,1920];z6={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),z=I0($,"densities"),U=I0($,"format"),W=I0($,"placeholder"),_=I0($,"placeholderColor")||"#e5e7eb",B=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=K6($,"lazy",!0),O=K6($,"preload",!1),V=K6($,"picture",!1)||!!U,w=Q?Number.parseInt(Q):void 0,A=G?Number.parseInt(G):void 0,N=q||"",R="";if(!N&&K)N=q6(X,G6,B,U),R=aX(K);else if(!N&&z){let S=z.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));N=UW(X,S,w,B,U)}else if(K)R=aX(K);let M=[];if(H)M.push(H);if(w&&A)M.push(`aspect-ratio:${w}/${A}`);if(W==="blur"||W==="color"||W==="thumbhash"){let S=WW(w||16,A||9,_);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${_0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=r5(X,w,A,B,U),I=[];if(I.push(`src="${_0(T)}"`),I.push(`alt="${_0(J)}"`),Q)I.push(`width="${_0(Q)}"`);if(G)I.push(`height="${_0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${_0(j)}"`);if(M.length>0)I.push(`style="${_0(M.join(";"))}"`);if(N)I.push(`srcset="${_0(N)}"`);if(R)I.push(`sizes="${_0(R)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(_0(S))}else I.push(`${_0(S)}="${_0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${_0(T)}"${b?` type="${b}"`:""}${N?` imagesrcset="${_0(N)}"`:""}${R?` imagesizes="${_0(R)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(U==="avif"||U==="auto"){let b=r5(X,w,A,B,"avif"),C=N?q6(X,G6,B,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${_0(C)}"${R?` sizes="${_0(R)}"`:""} />`)}if(U==="webp"||U==="auto"){let b=r5(X,w,A,B,"webp"),C=N?q6(X,G6,B,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${_0(C)}"${R?` sizes="${_0(R)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|
|
@@ -1783,7 +1783,7 @@ ${W}`)}if($.suggestion)z.push(`
|
|
|
1783
1783
|
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),z.join("")}function jq($,Z,Y){let X=$.split(`
|
|
1784
1784
|
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G=[];for(let K=J;K<=Q;K++){let q=(K+1).toString().padStart(4),z=K===Z-1?">":" ";G.push(`${z}${q} | ${X[K]}`)}return G.join(`
|
|
1785
1785
|
`)}function Hq($,Z,Y){let X=$.split(`
|
|
1786
|
-
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}
|
|
1786
|
+
`),J=Math.max(0,Z-Y-1),Q=Math.min(X.length-1,Z+Y-1),G="\x1B[90m",K="\x1B[31m",q="\x1B[0m",z=[];for(let U=J;U<=Q;U++){let W=(U+1).toString().padStart(4),_=U===Z-1,B=_?"\x1B[31m>\x1B[0m":" ",j=_?`\x1B[31m${X[U]}\x1B[0m`:`\x1B[90m${X[U]}`;z.push(`${B}${W}\x1B[0m | ${j}`)}return z.join(`
|
|
1787
1787
|
`)}function IY($){return $.replace(/--/g,"- -").replace(/>/g,">")}function DY($,Z){let X=$.substring(0,Z).split(`
|
|
1788
1788
|
`);return{line:X.length,column:X[X.length-1].length}}function r($,Z,Y){return G3({type:$,message:Z,code:Y,format:"html"}).formatted}function Oq($,Z,Y,X,J){return G3({type:$,message:Z,code:J,filePath:Y,line:X,format:"console"}).formatted}function Lq($,Z,Y){let X=Y.template.split(`
|
|
1789
1789
|
`),J=DY(Y.template,Y.offset),Q=`[${$} Error at line ${J.line} in ${Y.filePath}]: ${Z}
|
|
@@ -4020,7 +4020,7 @@ else {
|
|
|
4020
4020
|
${q?`{${q}}`:"{}"}
|
|
4021
4021
|
</script>
|
|
4022
4022
|
</div>`}}});var XJ={};c(XJ,{warnUnbalancedTags:()=>$8,findUnbalancedTags:()=>YJ});function V1($){return $.replace(/[^\n]/g," ")}function YJ($){let Z=$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,V1).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,V1).replace(/<!--[\s\S]*?-->/g,V1).replace(/\{\{\{[\s\S]*?\}\}\}/g,V1).replace(/\{\{[\s\S]*?\}\}/g,V1).replace(/\{!![\s\S]*?!!\}/g,V1).replace(/"[^"]*"/g,V1).replace(/'[^']*'/g,V1),Y=new Map,X=new Map,J=/<(\/?)([A-Za-z][\w-]*)\b[^>]*?(\/?)>/g,Q;while((Q=J.exec(Z))!==null){let K=Q[1]==="/",q=Q[2],z=Q[3]==="/";if(qW.has(q.toLowerCase()))continue;if(z)continue;if(K)X.set(q,(X.get(q)??0)+1);else{let U=Y.get(q);if(U)U.count++;else{let W=Z.slice(0,Q.index).split(`
|
|
4023
|
-
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(zW.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $8($,Z){let Y;try{Y=YJ($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(ZJ.has(X))return;ZJ.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z}
|
|
4023
|
+
`).length;Y.set(q,{count:1,firstLine:W})}}}let G=[];for(let K of new Set([...Y.keys(),...X.keys()])){if(zW.has(K.toLowerCase()))continue;let q=Y.get(K)?.count??0,z=X.get(K)??0;if(q!==z)G.push({tag:K,opened:q,closed:z,firstOpenLine:Y.get(K)?.firstLine??0})}return G}function $8($,Z){let Y;try{Y=YJ($)}catch{return}if(Y.length===0)return;let X=`${Z}:${$.length}`;if(ZJ.has(X))return;ZJ.add(X);let J=Z?Z.split(/[/\\]/).pop()||Z:"template";for(let{tag:Q,opened:G,closed:K,firstOpenLine:q}of Y)if(G>K){let z=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 an unclosed <${Q}>${z} may swallow the content that follows it.`)}else console.warn(`[stx] ${J}: <${Q}> ${G} opened, ${K} closed \u2014 ${K-G} stray </${Q}>.`)}var qW,zW,ZJ;var Z8=y(()=>{qW=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),zW=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);ZJ=new Set});import d0 from"path";import Y8 from"fs";function JJ($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function QJ($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class GJ{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,Y,X){let J=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let B=[J,J.toLowerCase(),JJ(J),QJ(J)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${J}.stx`,`${JJ(J)}.stx`,`${QJ(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let B=d0.resolve(d0.dirname(Z),`${J}.stx`);if(await n(B))return B;return null}let K=[],q=Y.componentsDir||"",z=X?.__originalFilePath;if(z)K.push(d0.join(d0.dirname(z),"components"));if(q)K.push(q);let U=d0.join(d0.dirname(Z),"components");if(!K.includes(U))K.push(U);let W=process.cwd(),_=[d0.resolve(W,"src/components"),d0.resolve(W,"components"),d0.resolve(import.meta.dir,"components")];for(let B of _)if(!K.includes(B))K.push(B);for(let B of K){if(!B)continue;for(let j of G){let H=d0.join(B,j);if(await n(H))return H}try{if(!Y8.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let H=Y8.readdirSync(B,{withFileTypes:!0});for(let L of H)if(L.isDirectory()){let F=d0.join(B,L.name);for(let O of G){let V=d0.join(F,O);if(await n(V))return V}}}catch{}}return null}}var b0;var X8=y(()=>{V0();b0=new GJ});function w1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function UW($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var J8;var Q8=y(()=>{J8={name:"StxLink",aliases:["stx-link"],render($,Z,Y){let X=UW($),J=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",K=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${w1(X.value)}"`);else q.push(`href="${w1(X.value)}"`);if(J)q.push(`class="${w1(J)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${w1(Q)}"`),q.push(`data-stx-exact-active-class="${w1(G)}"`),K)q.push("data-stx-prefetch");let z=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);for(let[U,W]of Object.entries($.static)){if(z.has(U))continue;if(typeof W==="boolean"){if(W)q.push(w1(U))}else q.push(`${w1(U)}="${w1(W)}"`)}return`<a ${q.join(" ")}>${Z}</a>`}}});function _0($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function I0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let Y=$.static[Z];if(typeof Y==="string")return Y;return}function K8($,Z,Y=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let J=$.static[Z];if(J!==void 0)return J!=="false"&&J!==!1;return Y}function KJ($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),Y=[];for(let X of Z)if(X.includes(":")){let[J,Q]=X.split(":"),G=WW[J];if(G)Y.push(`(max-width: ${G}px) ${Q}`);else{let K=Number.parseInt(J);if(!Number.isNaN(K))Y.push(`(max-width: ${K}px) ${Q}`)}}else Y.push(X);return Y.join(", ")}function q8($,Z,Y,X){return Z.map((J)=>`${r5($,J,void 0,Y,X)} ${J}w`).join(", ")}function _W($,Z,Y,X,J){return Z.map((Q)=>{let G=Y?Y*Q:void 0;return`${r5($,G,void 0,X,J)} ${Q}x`}).join(", ")}function r5($,Z,Y,X,J){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(Y)Q.push(`h_${Y}`);if(J)Q.push(`f_${J}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(Y)Q.set("h",String(Y));if(J)Q.set("fm",J);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(Y)Q.set("height",String(Y));if(J)Q.set("format",J);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function BW($,Z,Y="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${Y}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var WW,G8,z8;var U8=y(()=>{WW={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},G8=[320,640,768,1024,1280,1536,1920];z8={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,Y){let X=I0($,"src")||"",J=I0($,"alt")||"",Q=I0($,"width"),G=I0($,"height"),K=I0($,"sizes"),q=I0($,"srcset"),z=I0($,"densities"),U=I0($,"format"),W=I0($,"placeholder"),_=I0($,"placeholderColor")||"#e5e7eb",B=I0($,"provider"),j=I0($,"class")||I0($,"className")||"",H=I0($,"style")||"",L=I0($,"quality"),F=K8($,"lazy",!0),O=K8($,"preload",!1),V=K8($,"picture",!1)||!!U,w=Q?Number.parseInt(Q):void 0,R=G?Number.parseInt(G):void 0,A=q||"",N="";if(!A&&K)A=q8(X,G8,B,U),N=KJ(K);else if(!A&&z){let S=z.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));A=_W(X,S,w,B,U)}else if(K)N=KJ(K);let M=[];if(H)M.push(H);if(w&&R)M.push(`aspect-ratio:${w}/${R}`);if(W==="blur"||W==="color"||W==="thumbhash"){let S=BW(w||16,R||9,_);M.push(`background-image:url(${S})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat")}else if(W&&W!=="empty"&&W!=="none")M.push(`background-image:url(${_0(W)})`),M.push("background-size:cover"),M.push("background-repeat:no-repeat");let T=r5(X,w,R,B,U),I=[];if(I.push(`src="${_0(T)}"`),I.push(`alt="${_0(J)}"`),Q)I.push(`width="${_0(Q)}"`);if(G)I.push(`height="${_0(G)}"`);if(F)I.push('loading="lazy"');if(I.push('decoding="async"'),j)I.push(`class="${_0(j)}"`);if(M.length>0)I.push(`style="${_0(M.join(";"))}"`);if(A)I.push(`srcset="${_0(A)}"`);if(N)I.push(`sizes="${_0(N)}"`);let D=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);for(let[S,b]of Object.entries($.static)){if(D.has(S))continue;if(typeof b==="boolean"){if(b)I.push(_0(S))}else I.push(`${_0(S)}="${_0(b)}"`)}let E=`<img ${I.join(" ")} />`,k="";if(O){let b=U==="webp"?"image/webp":U==="avif"?"image/avif":"";k=`<link rel="preload" as="image" href="${_0(T)}"${b?` type="${b}"`:""}${A?` imagesrcset="${_0(A)}"`:""}${N?` imagesizes="${_0(N)}"`:""} />
|
|
4024
4024
|
`}if(V){let S=[];if(U==="avif"||U==="auto"){let b=r5(X,w,R,B,"avif"),C=A?q8(X,G8,B,"avif"):`${b}`;S.push(`<source type="image/avif" srcset="${_0(C)}"${N?` sizes="${_0(N)}"`:""} />`)}if(U==="webp"||U==="auto"){let b=r5(X,w,R,B,"webp"),C=A?q8(X,G8,B,"webp"):`${b}`;S.push(`<source type="image/webp" srcset="${_0(C)}"${N?` sizes="${_0(N)}"`:""} />`)}return`${k}<picture>
|
|
4025
4025
|
${S.join(`
|
|
4026
4026
|
`)}
|