jq79 0.6.5 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jq79.cjs +1 -1
- package/dist/jq79.global.js +1 -1
- package/dist/jq79.js +1 -1
- package/package.json +1 -1
package/dist/jq79.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var Ne=Object.defineProperty;var Hn=Object.getOwnPropertyDescriptor;var zn=Objec
|
|
|
4
4
|
`){let i=Oe(e,s+1);if(!(i<e.length&&(fs.test(e.slice(i,i+2))||[",","="].includes(ps(e,s)))))return s;s=i;continue}}s++}return e.length},hs=e=>{let t=[],n=0,s=0,r=0,i=l=>{t.push({raw:e.slice(s,l),codeEnd:Math.max(0,r-s)}),s=l+1,r=s},o=0;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=te(e,o),r=o;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),r=o;continue}if("([{".includes(l))n++;else if(")]}".includes(l))n--;else if(l===","&&n<=0){i(o),o++;continue}/\s/.test(l)||(r=o+1),o++}return i(e.length),t},Qe=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Pe.test(t)?[t]:[];let n=[];for(let s of tt(t.slice(1,Mt(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=nt(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=et(s,":");if(i!==-1){n.push(...Qe(s.slice(i+1)));continue}}n.push(...Qe(s))}return n},gs=e=>{let t=[],n=hs(e).map(({raw:i,codeEnd:o})=>{let l=i.match(/^\s*/)[0];if(o<=l.length)return{text:i,empty:!0};let a=i.slice(l.length,o),u=i.slice(o),c=nt(a),p=(c===-1?a:a.slice(0,c)).trim(),w=a[0]==="{"||a[0]==="[";w?t.push(...Qe(p)):Pe.test(p)&&t.push(p);let v=ke(a).code;return{text:`${l}${w?`(${v})`:v}${u}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(i=>i.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},ke=e=>{let t=[],n="",s=0,r=0,i=!0;for(;s<e.length;){let o=e[s],l=e[s+1];if(o==="'"||o==='"'||o==="`"){let a=te(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="/"&&(l==="/"||l==="*")){let a=l==="/"?Q(e,s):ee(e,s);n+=e.slice(s,a),s=a;continue}if(o==="/"&&ne(e,s)){let a=se(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(ve.lastIndex=s,ve.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){Ot.lastIndex=s;let a=Ot.exec(e);if(a){let c=s+a[0].length,p=Pt(e,c),{vars:w,code:v}=gs(e.slice(c,p));t.push(...w),n+=v,s=p,i=!1;continue}vt.lastIndex=s;let u=vt.exec(e);if(u){jt.lastIndex=s;let c=jt.exec(e);c&&t.push(c[1]);let p=s+u[0].length,w=Pt(e,p);n+=`$__effect(() => { ${ke(e.slice(p,w)).code} });`,s=w;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
|
|
5
5
|
`||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},je=/export\s+default(?![\w$])/y,kt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,ms=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let i=e[r];if(i==="{")n++;else if(i==="}")n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}}return t},ys=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=ms(e),i=[],o=s;if(r.length>1){let l=`$__mod${n}`;i.push(`${l} = ${s}`),o=l}for(let l of r)l.startsWith("{")?i.push(`${l.replace(/\s+as\s+/g,": ")} = ${o}`):l.startsWith("*")?i.push(`${l.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${l} = $__default(${o})`);return`const ${i.join(", ")}`},Pe=/^[A-Za-z_$][\w$]*$/,Mt=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=te(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=Q(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=ee(e,n);continue}if(s==="/"&&ne(e,n)){n=se(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},et=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=te(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=Q(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=ee(e,s);continue}if(r==="/"&&r!==t&&ne(e,s)){s=se(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},tt=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=te(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=Q(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=ee(e,r);continue}if(i==="/"&&ne(e,r)){r=se(e,r);continue}if(i!==void 0&&"([{".includes(i))n++;else if(i!==void 0&&")]}".includes(i))n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},nt=e=>{let t=0;for(;t<e.length;){let n=et(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},Me=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=Mt(t);if(n>=t.length)return null;let s=[];for(let r of tt(t.slice(1,n))){if(r.startsWith("..."))continue;let i=nt(r),o=i===-1?r:r.slice(0,i),l=i===-1?void 0:r.slice(i+1).trim(),a=et(o,":"),u=(a===-1?o:o.slice(0,a)).trim();if(!Pe.test(u))continue;let c={name:u};l!==void 0&&(c.default=l);let p=a===-1?"":o.slice(a+1).trim();Pe.test(p)&&(c.as=p),s.push(c)}return s},Es=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=te(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=Q(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=ee(e,t);continue}if(r==="/"&&ne(e,t)){t=se(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){je.lastIndex=t;let i=je.exec(e);if(i)return t+i[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
|
|
6
6
|
`||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},bs=/^async(?![\w$])/,ws=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Ss=e=>{let t=Es(e);if(t===-1)return null;let n=Oe(e,t),s=e.slice(n);bs.test(s)&&(n=Oe(e,n+5));let r=ws.exec(e.slice(n));if(r&&(n=Oe(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=te(e,o);continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o);continue}if("([{".includes(l))i++;else if(")]}".includes(l)&&--i===0)break;o++}return tt(e.slice(n+1,o))[0]??""},Le=e=>{let t=Ss(e);if(t===null)return null;let n=Me(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},Lt=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let l=e[n],a=e[n+1],u=n===0||!/[\w$.]/.test(e[n-1]);if(l==="'"||l==='"'||l==="`"){let c=te(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="/"&&(a==="/"||a==="*")){let c=a==="/"?Q(e,n):ee(e,n);t+=e.slice(n,c),n=c;continue}if(l==="/"&&ne(e,n)){let c=se(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="i"&&u){if(ve.lastIndex=n,ve.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){kt.lastIndex=n;let c=kt.exec(e);if(c){t+=ys(c[1],c[3],o++),n+=c[0].length,r=!1;continue}}}if(l==="e"&&u&&s===0&&r){je.lastIndex=n;let c=je.exec(e);if(c){i=!0,t+="$__exports.default =",n+=c[0].length,r=!1;continue}}"([{".includes(l)?s++:")]}".includes(l)&&(s=Math.max(0,s-1)),l===`
|
|
7
|
-
`||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},Rs=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),$s=new Set(["function","class","let","const","var","eval","with"]),Ts=new Set(["$scope","$r","$t"]),Ns=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,xs=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Cs=e=>/[A-Za-z_$]/.test(e),_s=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,st=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),i="value";continue}if(l==='"'||l==="'"){o=te(e,o),i="value";continue}if(l==="`"){let c=o+1;for(;c<e.length;){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;break}if(e[c]==="$"&&e[c+1]==="{"){let p=1,w=c+=2;for(;c<e.length&&p>0;)e[c]==="{"?p++:e[c]==="}"&&p--,c++;let v=st(e.slice(w,c-1));if(v===null)return null;v.forEach(I=>t.add(I));continue}c++}o=c,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let c=_s.exec(e.slice(o));o+=c?c[0].length:1,i="value";continue}if(Cs(l)){let c=o;for(;c<e.length&&/[\w$]/.test(e[c]);)c++;let p=e.slice(o,c);if(o=c,$s.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Rs.has(p)){i=p==="this"?"value":"op";continue}if(Ts.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(Ns.test(a))return null;let u=xs.exec(a);if(u){(u[0]==="&&"||u[0]==="||"||u[0]==="??")&&(r=!0),i=u[0]==="?."?"?.":"op",o+=u[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]};var As="0.
|
|
7
|
+
`||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},Rs=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),$s=new Set(["function","class","let","const","var","eval","with"]),Ts=new Set(["$scope","$r","$t"]),Ns=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,xs=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Cs=e=>/[A-Za-z_$]/.test(e),_s=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,st=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),i="value";continue}if(l==='"'||l==="'"){o=te(e,o),i="value";continue}if(l==="`"){let c=o+1;for(;c<e.length;){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;break}if(e[c]==="$"&&e[c+1]==="{"){let p=1,w=c+=2;for(;c<e.length&&p>0;)e[c]==="{"?p++:e[c]==="}"&&p--,c++;let v=st(e.slice(w,c-1));if(v===null)return null;v.forEach(I=>t.add(I));continue}c++}o=c,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let c=_s.exec(e.slice(o));o+=c?c[0].length:1,i="value";continue}if(Cs(l)){let c=o;for(;c<e.length&&/[\w$]/.test(e[c]);)c++;let p=e.slice(o,c);if(o=c,$s.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Rs.has(p)){i=p==="this"?"value":"op";continue}if(Ts.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(Ns.test(a))return null;let u=xs.exec(a);if(u){(u[0]==="&&"||u[0]==="||"||u[0]==="??")&&(r=!0),i=u[0]==="?."?"?.":"op",o+=u[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]};var As="0.7.0",rn=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),on="http://www.w3.org/1999/xhtml",ln=e=>{let t=rn(e),n=e.namespaceURI,s=t[Ue];delete t[Ue];let r=n!==null&&n!==on;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(i=>{if(i.nodeType===Node.TEXT_NODE){let o=i.textContent??"";return o?[o]:[]}return i.nodeType===Node.ELEMENT_NODE?[ln(i)]:[]})}},Ie=new Map,rt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},an=(e,t)=>{try{return new Function("$scope","$r",...t,`with ($scope) { return (${e}
|
|
8
8
|
); }`)}catch{return null}},Os=(e,t)=>{if(!oe.scopedNames)return null;let n=st(e);if(n===null)return null;let s=n.filter(i=>!t.includes(i)),r=s.length===0?"":`let $t; ${s.map(i=>`const ${i} = ($t = $scope.${i}) !== undefined ? $t : $r($scope, ${JSON.stringify(i)});`).join(" ")}`;try{return new Function("$scope","$r",...t,`${r} return (${e}
|
|
9
9
|
);`)}catch{return null}},cn=(e,t,n)=>{let s=Ie.get(e);if(s===void 0){let r=Os(t,n);s=r?{fn:r,scoped:!0}:{fn:an(t,n),scoped:!1},Ie.set(e,s)}return s},un=(e,t)=>`${t.join(",")}|${e}`,vs=(e,t)=>cn(un(e,t),e,t).fn,js=(e,t,n)=>{let s=an(t,n);return Ie.set(e,{fn:s,scoped:!1}),s},Ps=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,ks=100,pe=new Map,ht=new Set,We=0,ct=!1,ut=new Set,Ms=()=>{ct=!1,!(We>0)&&(pe.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(ht.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),pe.clear())},dn=()=>{ct||We>0||!pe.size||(ct=!0,queueMicrotask(Ms))},fn=e=>{We++;let t=()=>{We--,dn()};e.then(t,t)},Ls=(e,t)=>{if(ut.has(e))return;ut.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},pn=(e,t,n)=>{if(!(n instanceof ReferenceError))return Ls(e,n);let s=Ps.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;ht.has(i)||pe.has(i)||pe.size>=ks||(pe.set(i,{name:r,expr:e,scope:t}),dn())},hn=(e,t,n)=>{let s=n?Object.keys(n):[],r=un(e,s),{fn:i,scoped:o}=cn(r,e,s);if(!i)return;let l=n?Object.values(n):[];if(!o)return i(t,rt,...l);try{return i(t,rt,...l)}catch(a){if(!(a instanceof ReferenceError))throw a;let u=js(r,e,s);if(!u)throw a;return u(t,rt,...l)}},j=(e,t,n)=>{try{return hn(e,t,n)}catch(s){pn(e,t,s);return}},gn=(e,t,n)=>{try{return hn(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;pn(e,t,s);return}},ot=/{{\s*([\s\S]+?)\s*}}/g,Dt=new Map,mn=e=>{let t=Dt.get(e);if(t)return t;let n=[],s=0;ot.lastIndex=0;for(let r=ot.exec(e);r;r=ot.exec(e))r.index>s&&n.push(e.slice(s,r.index)),n.push({expr:r[1]}),s=r.index+r[0].length;return s<e.length&&n.push(e.slice(s)),Dt.set(e,n),n},yn=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(j(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(j(s.expr,t)??"");return n},En=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),we=e=>En.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Ds=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,bn=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,l=>{if(o.has("self")&&l.target!==e)return;o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation();let a=gn(n,s,{$event:l});typeof a=="function"&&a.call(e,l)},{once:o.has("once"),capture:o.has("capture")})},Is=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),l=a=>{o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation(),o.has("once")&&e.off(r,l),Re(()=>{let u=gn(n,s,{$event:a});typeof u=="function"&&u(a)})};e.on(r,l)},ie=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Fe=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),gt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},ze=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Ws=e=>{e.forEach(t=>{if(t.first===t.last)return ze(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},Fs=(e,t)=>{let n=[],s=null;return e.forEach(r=>{if(!t(r)){s=null;return}s&&s.last.nextSibling===r.range.first?s.last=r.range.last:n.push(s={first:r.range.first,last:r.range.last})}),n},qs=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let i=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=i}},It=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},fe=null,qe=null,wn=new WeakSet,Us=e=>{let t={memo:fe,base:qe};return fe=new Map,qe=e,t},Bs=e=>{fe=e.memo,qe=e.base},Wt=(e,t)=>e.component!==void 0?Ft(t,e.component):e.tag.includes("-")?Ft(t,e.tag):null,X=e=>e.component??e.tag,Ft=(e,t)=>{if(!fe)return It(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===qe){if(fe.has(t))return fe.get(t);let r=It(s,t);return fe.set(t,r),r}if(!wn.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},Hs=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},zs=(e,t)=>{let n=Hs(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},qt=200,it=0,Sn=Symbol("jq79.slots"),Rn=e=>e==="slot"||e.startsWith("slot."),$n=e=>e?ie(e):"default",Te=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Gs=e=>e==="default"?":slot":`:slot.${e}`,Zs=e=>typeof e!="string"||e.trim()!=="",Ks=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Te(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=$n(i.slice(6));if(o in t){console.warn(`jq79: two <template ${Gs(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(Zs);return s&&"default"in t?console.warn(`jq79: <${X(e)}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(t.default={nodes:n,binder:e.attrs[":slot"]||void 0}),t},Vs=(e,t,n)=>{Me(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let l=n[s]?.();return l===void 0&&i!==void 0?j(i,e):l},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},Xs=e=>{let t=Te(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},Js=(e,t)=>{let n=Object.entries(Ks(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=Ys(i,t)}),s},Ys=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);Vs(o,e.binder,n);let l=o[Ae]??[];Object.defineProperty(o,Ae,{value:[...l,s]});let a=de(o);return r.onDispose(()=>a.dispose()),ge(e.nodes,o,a,i)},Qs=(e,t,n,s)=>{let r=$n(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),l=document.createComment(`/${e.tag}`);i.append(o,l);let a=t[Sn]?.[r];if(!a)return i.insertBefore(ge(e.children,t,n,s),l),i;let u={};return Object.entries(e.attrs).forEach(([c,p])=>{if(!(c===be||we(c)||c.startsWith("@")))if(c.startsWith(":")){let w=p||c.slice(1);u[ie(c.slice(1))]=()=>j(w,t)}else u[ie(c)]=()=>p}),i.insertBefore(a(u,t,n,s),l),i},Tn="data-c79-box",er=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(Ge(e));s.setAttribute(Tn,"");let r=t.attrs[be];return r!==void 0&&s.setAttribute(be,r),n||to(),s},Ut=new WeakSet,tr=(e,t)=>{if(e.ns===void 0||Ut.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;Ut.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${X(e)}> is used inside ${s} and its template starts with <${n.tag.toLowerCase()}>, which is parsed as HTML - it renders and never draws. A component's template decides its own namespace, so root it at ${s}`)},Bt=(e,t,n,s,r)=>{let i=er(e,t,r),o=!(i instanceof DocumentFragment),l=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),l);let a=Js(t,n),u={},c={},p=[],w=[],v=!1;Object.entries(t.attrs).forEach(([R,C])=>{if(R!==be){if(R===":props"||R.startsWith(":props.")){v=!0,w.push({expr:C});return}if(!we(R))if(R.startsWith("@"))p.push([R,C]);else if(R===":model"||R.startsWith(":model.")){let m=R===":model"?"default":ie(R.slice(7));c[m]=C||(R===":model"?"model":m)}else if(R.startsWith(":")){let m=ie(R.slice(1));u[m]=C||m,w.push({name:m,expr:C||m})}else{let m=ie(R),_=JSON.stringify(C);u[m]=_,w.push({name:m,expr:_})}}});let I=R=>R==="default"?":model":`:model.${R}`,U=R=>R==="default"?"model":R,M=R=>`${R}
|
|
10
10
|
= $value`,S=new Set;Object.entries(c).forEach(([R,C])=>{let m=U(R);u[m]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${m}" through both :${m} and ${I(R)} - ${I(R)} wins`),u[m]=C,vs(M(C),["$value"])===null&&(S.add(R),console.warn(`jq79: ${I(R)}="${C}" is not assignable - updates from <${X(t)}> will be dropped`))});let q=()=>{let R={};return w.forEach(({name:C,expr:m})=>{if(C!==void 0)R[C]=j(m,n);else{let _=j(m,n);_!==null&&typeof _=="object"&&Object.assign(R,_)}}),Object.entries(c).forEach(([C,m])=>{R[U(C)]=j(m,n)}),R},L=null,D=null,z=null,J=new Set,Y=R=>{if(R==null){if(!n[Fn]?.has(e)||J.has("unfilled"))return;J.add("unfilled"),console.error(`jq79: <${X(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}J.has("type")||(J.add("type"),console.error(`jq79: <${X(t)}> is ${typeof R}, not a component - nothing renders here`))};return s.effect(()=>{let R=j(e,n),C=R instanceof re?R:null;if(C||Y(R),C===D||(z?.dispose(),z=null,L?.destroy(),L=null,D=C,!C))return;tr(t,C);let m=new re({template:C.template,scripts:C.scripts,styles:C.styles,modules:C.modules,filename:C.filename,siblings:C.siblings,name:C.name});if(a&&(m.slots=a),Object.keys(c).length){let K=new Set;m.modelWriteback=(T,W)=>{let P=T==null?"default":ie(String(T)),Z=c[P];return Z===void 0?(K.has(P)||(K.add(P),console.warn(`jq79: <${X(t)}> has no ${I(P)} - bound: ${Object.keys(c).map(I).join(", ")}`)),!1):S.has(P)?!1:(Re(()=>j(M(Z),n,{$value:W})),!0)}}p.forEach(([K,T])=>Is(m,K,T,n));let _=lo(m.scripts);ao(t,e,Object.keys(u),_);let A=en(Re(q),_),G=document.createDocumentFragment();if(it>=qt){console.error(`jq79: <${X(t)}> is ${qt} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}it++;try{(r?m.renderShadow(A):m.render(A)).mount(G)}finally{it--}l?l.parentNode.insertBefore(G,l):i.appendChild(G);let V=de(n,!0);if(v){let K=[];V.effect(()=>{let T=en(q(),_),W=Object.keys(T);K.forEach(P=>{P in T||(m.data[P]=void 0)}),W.forEach(P=>{m.data[P]=T[P]}),K=W})}else Object.entries(u).forEach(([K,T])=>{_!==null&&!_.has(K)||V.effect(()=>{m.data[K]=j(T,n)})});z=V,L=m}),s.onDispose(()=>{z?.dispose(),L?.destroy()}),i},nr=(e,t)=>{let n=()=>{let s=j(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},ae=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(ae):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?ae(t):[]):[],sr=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Rt(e):()=>!1,rr=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),Nn=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),or={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Ht=new Map,ir=(e,t)=>{let n=`${e} ${t}`,s=Ht.get(n);if(s!==void 0)return s;let r=or[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,l]=r;i=new DOMParser().parseFromString(`<${o}><${l} ${t}="x"/></${o}>`,"text/html").querySelector(l)?.getAttributeNames().find(u=>u.toLowerCase()===t)??t}return Ht.set(n,i),i},xn=(e,t)=>{let n=e.namespaceURI;if(n===null||n===on)return t;let s=t.replace(/-/g,"").toLowerCase(),r=ir(n,s);return r===s?t:r},Cn=(e,t,n)=>{let s=rr.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},oe={cloneSkeletons:!0,scopedNames:!0},lr=new Set([":text",":html",":value",":checked",":selected"]),ar=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||lr.has(e)?!0:e.startsWith(":")?e===":model"?!1:!we(e)&&!e.includes("."):e!==Ue,_n=e=>{if(e.component||e.tag.includes("-")||Rn(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!ar(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||_n(t))},An=(e,t,n)=>{let s=Nn(e),r,i=null;for(let p in e.attrs){let w=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:w});else if(p===":class")r=w;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),w]);else if(!we(p))if(p.startsWith(":")){let v=p.slice(1);n.push({kind:"attr",path:t,name:xn(s,v),expr:w||ie(v)})}else s.setAttribute(p,w)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(ae(e.attrs.class??""))});let o=e.attrs[":text"],l=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):l!==void 0?n.push({kind:"html",path:t,expr:l}):e.children.forEach((p,w)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,w],parts:mn(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(An(p,[...t,w],n))});let a=e.attrs[":value"];a!==void 0&&n.push({kind:"value",path:t,expr:a});let u=e.attrs[":checked"];u!==void 0&&n.push({kind:"checked",path:t,expr:u});let c=e.attrs[":selected"];return c!==void 0&&n.push({kind:"selected",path:t,expr:c}),s},cr=3,On=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:On(n)),0),zt=new WeakMap,Gt=new WeakSet,ur=e=>{let t=zt.get(e);if(t!==void 0)return t;if(!Gt.has(e))return Gt.add(e),null;let n=null;if(_n(e)&&On(e)>=cr){let s=[];n={skeleton:An(e,[],s),ops:s}}return zt.set(e,n),n},dr=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},fr=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:dr(s,r.path);if(r.kind==="text"){let o=i,l=r.parts;n.effect(()=>{let a=yn(l,t);o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="event")bn(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:l,expr:a}=r;n.effect(()=>Cn(o,l,j(a,t)))}else if(r.kind==="class"){let o=i,{classExpr:l,toggles:a,staticClasses:u}=r,c=[];n.effect(()=>{let p=l!==void 0?ae(j(l,t)):[];a?.forEach(([w,v])=>{j(v,t)&&p.push(...ae(w))}),c.forEach(w=>{!p.includes(w)&&!u.has(w)&&o.classList.remove(w)}),o.classList.add(...p),c=p})}else if(r.kind==="textContent"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="html"){let o=i,{expr:l}=r;n.effect(()=>{o.innerHTML=Ke(String(j(l,t)??""))})}else if(r.kind==="value"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.value!==a&&(o.value=a)})}else if(r.kind==="checked"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.checked!==a&&(o.checked=a)})}else if(r.kind==="selected"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.selected!==a&&(o.selected=a)})}else{let o=r}}return s},mt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?nr(r,t):t;if(Rn(e.tag))return Qs(e,i,n,s);if(e.tag==="template"&&Te(e)!==void 0)return Xs(e);let o=Wt(e,i);if(o)return Bt(o,e,i,n,s);if(oe.cloneSkeletons){let S=ur(e);if(S)return fr(S,i,n)}let l=Nn(e);if(e.component!==void 0&&i[ft]?.count===0)throw zs(e.component,i);let a=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(a){let S=!1;n.effect(()=>{if(S)return;let q=Wt(e,i);if(!q)return;S=!0;let L=Bt(q,e,i,n,s),D=gt(L);n.onDispose(()=>ze(D)),l.replaceWith(L)})}for(let S in e.attrs){let q=e.attrs[S];if(S.startsWith("@"))bn(l,S,q,i);else if(S===":model"||S.startsWith(":model."))a||console.warn(`jq79: ${S} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!we(S))if(S.startsWith(":"))if(a)l.setAttribute(S,q);else{let L=S.slice(1),D=q||ie(L),z=xn(l,L);n.effect(()=>Cn(l,z,j(D,i)))}else l.setAttribute(S,q)}let u=e.attrs[":class"],c=null;for(let S in e.attrs)S.startsWith(":class.")&&(c??(c=[])).push([S.slice(7),e.attrs[S]]);if(u!==void 0||c){let S=new Set(ae(e.attrs.class??"")),q=[];n.effect(()=>{let L=u!==void 0?ae(j(u,i)):[];c?.forEach(([D,z])=>{j(z,i)&&L.push(...ae(D))}),q.forEach(D=>{!L.includes(D)&&!S.has(D)&&l.classList.remove(D)}),l.classList.add(...L),q=L})}let p=e.attrs[":text"],w=e.attrs[":html"],v=e.attrs[":html.allowed"];v!==void 0&&w===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let S=String(j(p,i)??"");l.textContent!==S&&(l.textContent=S)}):w!==void 0?n.effect(()=>{let S=v!==void 0?{allowUrl:sr(j(v,i))}:void 0;l.innerHTML=Ke(String(j(w,i)??""),S)}):l instanceof HTMLTemplateElement?ge(e.children,i,n,s,l.content):ge(e.children,i,n,s,l);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let S=String(j(I,i)??"");l.value!==S&&(l.value=S)});let U=e.attrs[":checked"];U!==void 0&&n.effect(()=>{let S=!!j(U,i);l.checked!==S&&(l.checked=S)});let M=e.attrs[":selected"];return M!==void 0&&n.effect(()=>{let S=!!j(M,i);l.selected!==S&&(l.selected=S)}),l},pr=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,l=null,a=null;return n.effect(()=>{let u=e.find(p=>p.expr===void 0||j(p.expr,t))??null;if(u===l||(a?.dispose(),o&&ze(o),o=null,l=u,!u))return;a=de(t);let c=mt(u.node,t,a,s);o=gt(c),r.parentNode.insertBefore(c,r.nextSibling)}),i},Ee=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},hr=e=>{let t=new Uint8Array(e.length),n=[],s=new Int32Array(e.length).fill(-1);for(let r=0;r<e.length;r++){let i=e[r];if(i<0)continue;let o=0,l=n.length;for(;o<l;){let a=o+l>>1;e[n[a]]<i?o=a+1:l=a}o>0&&(s[r]=n[o-1]),n[o]=r}for(let r=n.length?n[n.length-1]:-1;r!==-1;r=s[r])t[r]=1;return t},gr=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},vn=(e,t)=>typeof e=="string"?t.some(n=>Kt(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Kt(n,s)))||e.children.some(n=>vn(n,t)),Zt=/[A-Za-z0-9_$]/,mr=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Kt=(e,t)=>{for(let n=e.indexOf(t);n!==-1;n=e.indexOf(t,n+1)){let s=n===0?"":e[n-1],r=e[n+t.length]??"";if(!Zt.test(s)&&!Zt.test(r))return!0}return!1},lt=new WeakMap,yr=e=>{let t=lt.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Ds);if(!n)return lt.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],l=o===s,a=o!==void 0&&!l&&mr.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:u,[":key"]:c,...p}=e.attrs,w={...e,attrs:p},v=["$index",...r?[r]:[]],I=vn(w,v),U=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),M={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:l,keyProp:a,itemNode:w,readsPosition:I,namesComponent:U};return lt.set(e,M),M},Er=(e,t,n,s)=>{let r=yr(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:l,keyExpr:a,keyIsItem:u,keyProp:c,itemNode:p,readsPosition:w,namesComponent:v}=r,I=document.createComment("each"),U=document.createDocumentFragment();U.appendChild(I),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let M=[],S=!1;return n.effect(()=>{let q=Us(t);try{let L=j(l,t),D=Array.isArray(L),z=D?null:gr(L)?Object.keys(L):[],J=D?L.length:z.length,Y=new Map;M.forEach((T,W)=>{T.pos=W;let P=Y.get(T.key);P?P.push(T):Y.set(T.key,[T])});let R=new Set,C=[],m=[],_=[],A;for(let T=0;T<J;T++){let W=D?T:z[T],P=D?L[T]:L[W],Z=W;u?Z=P:c!==void 0&&P!==null&&typeof P=="object"?Z=P[c]:a!==void 0&&(A===void 0?(A=Object.create(t),Ee(A,i,P),o&&Ee(A,o,W),Ee(A,"$index",T)):(A[i]=P,o&&(A[o]=W),A.$index=T),Z=j(a,A)),R.has(Z)&&!S&&(S=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),R.add(Z);let f=Y.get(Z)?.shift();if(f&&Object.is(f.item,P)){let b=f.scope;b.$index!==T&&(w&&C.push(f),b.$index=T),o&&b[o]!==W&&(b[o]=W),m.push(f),_.push(f.pos);continue}f&&(f.fx.dispose(),ze(f.range));let d=Object.create(t);Ee(d,i,P),o&&Ee(d,o,W),Ee(d,"$index",T),v||wn.add(d);let g=de(t),h=gt(mt(p,d,g,s));m.push({key:Z,item:P,scope:d,fx:g,range:h,pos:T}),_.push(-1)}let G=new Set;Y.forEach(T=>T.forEach(W=>G.add(W))),G.size&&(G.forEach(T=>{T.dead=!0,T.fx.dispose()}),Ws(Fs(M,T=>T.dead===!0)));let V=I,K=hr(_);m.forEach((T,W)=>{!K[W]&&V.nextSibling!==T.range.first&&qs(T.range,V),V=T.range.last}),C.forEach(T=>Re(()=>T.fx.refresh())),M=m}finally{Bs(q)}}),U},jn=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},at=e=>{let t=":if"in e.attrs,n=":elseif"in e.attrs,s=":else"in e.attrs;if((t?1:0)+(n?1:0)+(s?1:0)<2)return;let r=[t?":if":null,n?":elseif":null,s?":else":null].filter(Boolean);console.warn(`jq79: ${r.join(" and ")} on the same <${X(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},br=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${X(e)}> - the chain before it already ended with :else, which closes it. One :if, any number of :elseif, at most one :else`:`jq79: ${n} on <${X(e)}> continues no :if - it renders unconditionally. A chain is :if, then :elseif, then :else, on adjacent siblings: anything but whitespace between them breaks it`)},wr=[":if",":elseif",":else",":each"],Sr=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=wr.find(s=>s in e.attrs);if(n!==void 0){if(Te(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Te(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},Rr=[...En,":model",":slot"].map(e=>e.slice(1)),$r={":attrs":':attrs was removed in 0.7 - it now binds an attribute called "attrs". Bind them one at a time (:disabled="x", :title="y"), or :class for classes'},Tr=e=>{for(let t in e.attrs){let n=$r[t];n!==void 0&&console.warn(`jq79: ${n}`)}},Nr=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||we(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1),s=Rr.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},Pn=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Sr(s,t),Tr(s),Nr(s),Pn(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(at(r),":if"in r.attrs){s++;let i=l=>{let a=jn(e,s),u=e[a];if(typeof u=="object"&&l in u.attrs)return s=a+1,u};for(let l=i(":elseif");l;l=i(":elseif"))at(l);let o=i(":else");o&&at(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&br(r,n),n=!1,s++}},Vt=new WeakMap,xr=(e,t,n)=>{let s=Vt.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=u=>{let c=jn(e,i),p=e[c];if(typeof p=="object"&&u in p.attrs)return i=c+1,p};for(let u=o(":elseif");u;u=o(":elseif"))r.push({expr:u.attrs[":elseif"],node:u});let l=o(":else");l&&r.push({node:l});let a={branches:r,next:i};return Vt.set(t,a),a},ge=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let l=e[o];if(typeof l=="string"){let a=document.createTextNode(l);if(l.includes("{{")){let u=mn(l);n.effect(()=>{let c=yn(u,t);a.textContent!==c&&(a.textContent=c)})}i.appendChild(a),o++;continue}if(":each"in l.attrs){i.appendChild(Er(l,t,n,s)),o++;continue}if(":if"in l.attrs){let a=xr(e,l,o);i.appendChild(pr(a.branches,t,n,s)),o=a.next;continue}i.appendChild(mt(l,t,n,s)),o++}return i},Cr=(e,t,n=!1)=>ge(e.template,t,de(t),n),_r=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ar=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,yt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Or=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(Ar,(s,r,i)=>_r.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),kn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,vr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,jr=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(kn,(s,r,i)=>{let o=0,l=i.replace(vr,(a,u,c)=>c===void 0?a:`${u}:props.${o++}="${c}"`);return`<${r}${l}>`})).join(""),Pr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,kr=/<\/slot\.([\w.$-]+)(\s*)>/gi,Mr=/^slot\./i,Lr=e=>Mr.test(e)?`slot.${Fe(e.slice(5))}`:e,Ue=":jq79-component",Mn=/^[A-Z]/,Dr="c79-",Ge=e=>`${Dr}${Fe(e[0].toLowerCase()+e.slice(1))}`,Ir=e=>Mn.test(e)?Ge(e):Lr(e),Wr=/<\/([A-Z][\w.-]*)(\s*)>/g,Fr=/\/\s*$/,qr=(e,t)=>{if(!Mn.test(e))return t;let n=` ${Ue}="${e}"`,s=Fr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},Ur=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(kn,(s,r,i)=>{let o=i.replace(Pr,(l,a,u)=>u===void 0?l:`${a}${Fe(u)}`);return`<${Ir(r)}${qr(r,o)}>`}).replace(kr,(s,r,i)=>`</slot.${Fe(r)}${i}>`).replace(Wr,(s,r,i)=>`</${Ge(r)}${i}>`)).join(""),be="data-jq79",Br=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},Ln=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[be]=t,Ln(n.children,t))})},Hr=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),i=r===-1?s:s.slice(0,r),o=r===-1?"":s.slice(r);return`${i}[${be}="${t}"]${o}`}).join(", "),Dn=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Hr(n.selectorText,t):n instanceof CSSGroupingRule&&Dn(n.cssRules,t)})},zr=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Gr=/[a-z]/,Zr=e=>e.replace(zr,(t,n,s)=>Gr.test(s)?`${n}${Ge(s)}`:t),Kr=/^\s*@(media|supports|container|layer|scope|document)\b/i,Vr=/^\s*@/,Xr=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Vr.test(s)?Zr(n):n,n=""},l=u=>{o(),t+=u,s+=u},a=(u,c)=>{o(),t+=u,s="",c!==void 0?r.push(c):u==="}"&&r.pop()};for(let u=0;u<e.length;){let c=e[u];if(c==="/"&&e[u+1]==="*"){let p=e.indexOf("*/",u+2),w=p===-1?e.length:p+2;l(e.slice(u,w)),u=w}else if(c==='"'||c==="'"){let p=u+1;for(;p<e.length&&e[p]!==c;)p+=e[p]==="\\"?2:1;l(e.slice(u,Math.min(p+1,e.length))),u=p+1}else c==="{"?(a("{",Kr.test(s)),u++):c==="}"||c===";"?(a(c),u++):(n+=c,s+=c,u++)}return o(),t},Jr=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(e),Dn(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
|
package/dist/jq79.global.js
CHANGED
|
@@ -4,7 +4,7 @@ var jq79=(()=>{var Ne=Object.defineProperty;var Hn=Object.getOwnPropertyDescript
|
|
|
4
4
|
`){let i=Oe(e,s+1);if(!(i<e.length&&(fs.test(e.slice(i,i+2))||[",","="].includes(ps(e,s)))))return s;s=i;continue}}s++}return e.length},hs=e=>{let t=[],n=0,s=0,r=0,i=l=>{t.push({raw:e.slice(s,l),codeEnd:Math.max(0,r-s)}),s=l+1,r=s},o=0;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=te(e,o),r=o;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),r=o;continue}if("([{".includes(l))n++;else if(")]}".includes(l))n--;else if(l===","&&n<=0){i(o),o++;continue}/\s/.test(l)||(r=o+1),o++}return i(e.length),t},Qe=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Pe.test(t)?[t]:[];let n=[];for(let s of tt(t.slice(1,Mt(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=nt(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=et(s,":");if(i!==-1){n.push(...Qe(s.slice(i+1)));continue}}n.push(...Qe(s))}return n},gs=e=>{let t=[],n=hs(e).map(({raw:i,codeEnd:o})=>{let l=i.match(/^\s*/)[0];if(o<=l.length)return{text:i,empty:!0};let a=i.slice(l.length,o),u=i.slice(o),c=nt(a),p=(c===-1?a:a.slice(0,c)).trim(),w=a[0]==="{"||a[0]==="[";w?t.push(...Qe(p)):Pe.test(p)&&t.push(p);let v=ke(a).code;return{text:`${l}${w?`(${v})`:v}${u}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(i=>i.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},ke=e=>{let t=[],n="",s=0,r=0,i=!0;for(;s<e.length;){let o=e[s],l=e[s+1];if(o==="'"||o==='"'||o==="`"){let a=te(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="/"&&(l==="/"||l==="*")){let a=l==="/"?Q(e,s):ee(e,s);n+=e.slice(s,a),s=a;continue}if(o==="/"&&ne(e,s)){let a=se(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(ve.lastIndex=s,ve.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){Ot.lastIndex=s;let a=Ot.exec(e);if(a){let c=s+a[0].length,p=Pt(e,c),{vars:w,code:v}=gs(e.slice(c,p));t.push(...w),n+=v,s=p,i=!1;continue}vt.lastIndex=s;let u=vt.exec(e);if(u){jt.lastIndex=s;let c=jt.exec(e);c&&t.push(c[1]);let p=s+u[0].length,w=Pt(e,p);n+=`$__effect(() => { ${ke(e.slice(p,w)).code} });`,s=w;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
|
|
5
5
|
`||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},je=/export\s+default(?![\w$])/y,kt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,ms=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let i=e[r];if(i==="{")n++;else if(i==="}")n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}}return t},ys=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=ms(e),i=[],o=s;if(r.length>1){let l=`$__mod${n}`;i.push(`${l} = ${s}`),o=l}for(let l of r)l.startsWith("{")?i.push(`${l.replace(/\s+as\s+/g,": ")} = ${o}`):l.startsWith("*")?i.push(`${l.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${l} = $__default(${o})`);return`const ${i.join(", ")}`},Pe=/^[A-Za-z_$][\w$]*$/,Mt=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=te(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=Q(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=ee(e,n);continue}if(s==="/"&&ne(e,n)){n=se(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},et=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=te(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=Q(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=ee(e,s);continue}if(r==="/"&&r!==t&&ne(e,s)){s=se(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},tt=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=te(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=Q(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=ee(e,r);continue}if(i==="/"&&ne(e,r)){r=se(e,r);continue}if(i!==void 0&&"([{".includes(i))n++;else if(i!==void 0&&")]}".includes(i))n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},nt=e=>{let t=0;for(;t<e.length;){let n=et(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},Me=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=Mt(t);if(n>=t.length)return null;let s=[];for(let r of tt(t.slice(1,n))){if(r.startsWith("..."))continue;let i=nt(r),o=i===-1?r:r.slice(0,i),l=i===-1?void 0:r.slice(i+1).trim(),a=et(o,":"),u=(a===-1?o:o.slice(0,a)).trim();if(!Pe.test(u))continue;let c={name:u};l!==void 0&&(c.default=l);let p=a===-1?"":o.slice(a+1).trim();Pe.test(p)&&(c.as=p),s.push(c)}return s},Es=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=te(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=Q(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=ee(e,t);continue}if(r==="/"&&ne(e,t)){t=se(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){je.lastIndex=t;let i=je.exec(e);if(i)return t+i[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
|
|
6
6
|
`||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},bs=/^async(?![\w$])/,ws=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Ss=e=>{let t=Es(e);if(t===-1)return null;let n=Oe(e,t),s=e.slice(n);bs.test(s)&&(n=Oe(e,n+5));let r=ws.exec(e.slice(n));if(r&&(n=Oe(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=te(e,o);continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o);continue}if("([{".includes(l))i++;else if(")]}".includes(l)&&--i===0)break;o++}return tt(e.slice(n+1,o))[0]??""},Le=e=>{let t=Ss(e);if(t===null)return null;let n=Me(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},Lt=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let l=e[n],a=e[n+1],u=n===0||!/[\w$.]/.test(e[n-1]);if(l==="'"||l==='"'||l==="`"){let c=te(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="/"&&(a==="/"||a==="*")){let c=a==="/"?Q(e,n):ee(e,n);t+=e.slice(n,c),n=c;continue}if(l==="/"&&ne(e,n)){let c=se(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="i"&&u){if(ve.lastIndex=n,ve.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){kt.lastIndex=n;let c=kt.exec(e);if(c){t+=ys(c[1],c[3],o++),n+=c[0].length,r=!1;continue}}}if(l==="e"&&u&&s===0&&r){je.lastIndex=n;let c=je.exec(e);if(c){i=!0,t+="$__exports.default =",n+=c[0].length,r=!1;continue}}"([{".includes(l)?s++:")]}".includes(l)&&(s=Math.max(0,s-1)),l===`
|
|
7
|
-
`||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},Rs=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),$s=new Set(["function","class","let","const","var","eval","with"]),Ts=new Set(["$scope","$r","$t"]),Ns=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,xs=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Cs=e=>/[A-Za-z_$]/.test(e),_s=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,st=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),i="value";continue}if(l==='"'||l==="'"){o=te(e,o),i="value";continue}if(l==="`"){let c=o+1;for(;c<e.length;){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;break}if(e[c]==="$"&&e[c+1]==="{"){let p=1,w=c+=2;for(;c<e.length&&p>0;)e[c]==="{"?p++:e[c]==="}"&&p--,c++;let v=st(e.slice(w,c-1));if(v===null)return null;v.forEach(I=>t.add(I));continue}c++}o=c,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let c=_s.exec(e.slice(o));o+=c?c[0].length:1,i="value";continue}if(Cs(l)){let c=o;for(;c<e.length&&/[\w$]/.test(e[c]);)c++;let p=e.slice(o,c);if(o=c,$s.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Rs.has(p)){i=p==="this"?"value":"op";continue}if(Ts.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(Ns.test(a))return null;let u=xs.exec(a);if(u){(u[0]==="&&"||u[0]==="||"||u[0]==="??")&&(r=!0),i=u[0]==="?."?"?.":"op",o+=u[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]};var As="0.
|
|
7
|
+
`||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},Rs=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),$s=new Set(["function","class","let","const","var","eval","with"]),Ts=new Set(["$scope","$r","$t"]),Ns=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,xs=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Cs=e=>/[A-Za-z_$]/.test(e),_s=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,st=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),i="value";continue}if(l==='"'||l==="'"){o=te(e,o),i="value";continue}if(l==="`"){let c=o+1;for(;c<e.length;){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;break}if(e[c]==="$"&&e[c+1]==="{"){let p=1,w=c+=2;for(;c<e.length&&p>0;)e[c]==="{"?p++:e[c]==="}"&&p--,c++;let v=st(e.slice(w,c-1));if(v===null)return null;v.forEach(I=>t.add(I));continue}c++}o=c,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let c=_s.exec(e.slice(o));o+=c?c[0].length:1,i="value";continue}if(Cs(l)){let c=o;for(;c<e.length&&/[\w$]/.test(e[c]);)c++;let p=e.slice(o,c);if(o=c,$s.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Rs.has(p)){i=p==="this"?"value":"op";continue}if(Ts.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(Ns.test(a))return null;let u=xs.exec(a);if(u){(u[0]==="&&"||u[0]==="||"||u[0]==="??")&&(r=!0),i=u[0]==="?."?"?.":"op",o+=u[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]};var As="0.7.0",rn=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),on="http://www.w3.org/1999/xhtml",ln=e=>{let t=rn(e),n=e.namespaceURI,s=t[Ue];delete t[Ue];let r=n!==null&&n!==on;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(i=>{if(i.nodeType===Node.TEXT_NODE){let o=i.textContent??"";return o?[o]:[]}return i.nodeType===Node.ELEMENT_NODE?[ln(i)]:[]})}},Ie=new Map,rt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},an=(e,t)=>{try{return new Function("$scope","$r",...t,`with ($scope) { return (${e}
|
|
8
8
|
); }`)}catch{return null}},Os=(e,t)=>{if(!oe.scopedNames)return null;let n=st(e);if(n===null)return null;let s=n.filter(i=>!t.includes(i)),r=s.length===0?"":`let $t; ${s.map(i=>`const ${i} = ($t = $scope.${i}) !== undefined ? $t : $r($scope, ${JSON.stringify(i)});`).join(" ")}`;try{return new Function("$scope","$r",...t,`${r} return (${e}
|
|
9
9
|
);`)}catch{return null}},cn=(e,t,n)=>{let s=Ie.get(e);if(s===void 0){let r=Os(t,n);s=r?{fn:r,scoped:!0}:{fn:an(t,n),scoped:!1},Ie.set(e,s)}return s},un=(e,t)=>`${t.join(",")}|${e}`,vs=(e,t)=>cn(un(e,t),e,t).fn,js=(e,t,n)=>{let s=an(t,n);return Ie.set(e,{fn:s,scoped:!1}),s},Ps=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,ks=100,pe=new Map,ht=new Set,We=0,ct=!1,ut=new Set,Ms=()=>{ct=!1,!(We>0)&&(pe.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(ht.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),pe.clear())},dn=()=>{ct||We>0||!pe.size||(ct=!0,queueMicrotask(Ms))},fn=e=>{We++;let t=()=>{We--,dn()};e.then(t,t)},Ls=(e,t)=>{if(ut.has(e))return;ut.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},pn=(e,t,n)=>{if(!(n instanceof ReferenceError))return Ls(e,n);let s=Ps.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;ht.has(i)||pe.has(i)||pe.size>=ks||(pe.set(i,{name:r,expr:e,scope:t}),dn())},hn=(e,t,n)=>{let s=n?Object.keys(n):[],r=un(e,s),{fn:i,scoped:o}=cn(r,e,s);if(!i)return;let l=n?Object.values(n):[];if(!o)return i(t,rt,...l);try{return i(t,rt,...l)}catch(a){if(!(a instanceof ReferenceError))throw a;let u=js(r,e,s);if(!u)throw a;return u(t,rt,...l)}},j=(e,t,n)=>{try{return hn(e,t,n)}catch(s){pn(e,t,s);return}},gn=(e,t,n)=>{try{return hn(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;pn(e,t,s);return}},ot=/{{\s*([\s\S]+?)\s*}}/g,Dt=new Map,mn=e=>{let t=Dt.get(e);if(t)return t;let n=[],s=0;ot.lastIndex=0;for(let r=ot.exec(e);r;r=ot.exec(e))r.index>s&&n.push(e.slice(s,r.index)),n.push({expr:r[1]}),s=r.index+r[0].length;return s<e.length&&n.push(e.slice(s)),Dt.set(e,n),n},yn=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(j(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(j(s.expr,t)??"");return n},En=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),we=e=>En.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Ds=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,bn=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,l=>{if(o.has("self")&&l.target!==e)return;o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation();let a=gn(n,s,{$event:l});typeof a=="function"&&a.call(e,l)},{once:o.has("once"),capture:o.has("capture")})},Is=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),l=a=>{o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation(),o.has("once")&&e.off(r,l),Re(()=>{let u=gn(n,s,{$event:a});typeof u=="function"&&u(a)})};e.on(r,l)},ie=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Fe=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),gt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},ze=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Ws=e=>{e.forEach(t=>{if(t.first===t.last)return ze(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},Fs=(e,t)=>{let n=[],s=null;return e.forEach(r=>{if(!t(r)){s=null;return}s&&s.last.nextSibling===r.range.first?s.last=r.range.last:n.push(s={first:r.range.first,last:r.range.last})}),n},qs=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let i=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=i}},It=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},fe=null,qe=null,wn=new WeakSet,Us=e=>{let t={memo:fe,base:qe};return fe=new Map,qe=e,t},Bs=e=>{fe=e.memo,qe=e.base},Wt=(e,t)=>e.component!==void 0?Ft(t,e.component):e.tag.includes("-")?Ft(t,e.tag):null,X=e=>e.component??e.tag,Ft=(e,t)=>{if(!fe)return It(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===qe){if(fe.has(t))return fe.get(t);let r=It(s,t);return fe.set(t,r),r}if(!wn.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},Hs=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},zs=(e,t)=>{let n=Hs(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},qt=200,it=0,Sn=Symbol("jq79.slots"),Rn=e=>e==="slot"||e.startsWith("slot."),$n=e=>e?ie(e):"default",Te=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Gs=e=>e==="default"?":slot":`:slot.${e}`,Zs=e=>typeof e!="string"||e.trim()!=="",Ks=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Te(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=$n(i.slice(6));if(o in t){console.warn(`jq79: two <template ${Gs(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(Zs);return s&&"default"in t?console.warn(`jq79: <${X(e)}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(t.default={nodes:n,binder:e.attrs[":slot"]||void 0}),t},Vs=(e,t,n)=>{Me(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let l=n[s]?.();return l===void 0&&i!==void 0?j(i,e):l},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},Xs=e=>{let t=Te(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},Js=(e,t)=>{let n=Object.entries(Ks(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=Ys(i,t)}),s},Ys=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);Vs(o,e.binder,n);let l=o[Ae]??[];Object.defineProperty(o,Ae,{value:[...l,s]});let a=de(o);return r.onDispose(()=>a.dispose()),ge(e.nodes,o,a,i)},Qs=(e,t,n,s)=>{let r=$n(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),l=document.createComment(`/${e.tag}`);i.append(o,l);let a=t[Sn]?.[r];if(!a)return i.insertBefore(ge(e.children,t,n,s),l),i;let u={};return Object.entries(e.attrs).forEach(([c,p])=>{if(!(c===be||we(c)||c.startsWith("@")))if(c.startsWith(":")){let w=p||c.slice(1);u[ie(c.slice(1))]=()=>j(w,t)}else u[ie(c)]=()=>p}),i.insertBefore(a(u,t,n,s),l),i},Tn="data-c79-box",er=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(Ge(e));s.setAttribute(Tn,"");let r=t.attrs[be];return r!==void 0&&s.setAttribute(be,r),n||to(),s},Ut=new WeakSet,tr=(e,t)=>{if(e.ns===void 0||Ut.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;Ut.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${X(e)}> is used inside ${s} and its template starts with <${n.tag.toLowerCase()}>, which is parsed as HTML - it renders and never draws. A component's template decides its own namespace, so root it at ${s}`)},Bt=(e,t,n,s,r)=>{let i=er(e,t,r),o=!(i instanceof DocumentFragment),l=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),l);let a=Js(t,n),u={},c={},p=[],w=[],v=!1;Object.entries(t.attrs).forEach(([R,C])=>{if(R!==be){if(R===":props"||R.startsWith(":props.")){v=!0,w.push({expr:C});return}if(!we(R))if(R.startsWith("@"))p.push([R,C]);else if(R===":model"||R.startsWith(":model.")){let m=R===":model"?"default":ie(R.slice(7));c[m]=C||(R===":model"?"model":m)}else if(R.startsWith(":")){let m=ie(R.slice(1));u[m]=C||m,w.push({name:m,expr:C||m})}else{let m=ie(R),_=JSON.stringify(C);u[m]=_,w.push({name:m,expr:_})}}});let I=R=>R==="default"?":model":`:model.${R}`,U=R=>R==="default"?"model":R,M=R=>`${R}
|
|
10
10
|
= $value`,S=new Set;Object.entries(c).forEach(([R,C])=>{let m=U(R);u[m]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${m}" through both :${m} and ${I(R)} - ${I(R)} wins`),u[m]=C,vs(M(C),["$value"])===null&&(S.add(R),console.warn(`jq79: ${I(R)}="${C}" is not assignable - updates from <${X(t)}> will be dropped`))});let q=()=>{let R={};return w.forEach(({name:C,expr:m})=>{if(C!==void 0)R[C]=j(m,n);else{let _=j(m,n);_!==null&&typeof _=="object"&&Object.assign(R,_)}}),Object.entries(c).forEach(([C,m])=>{R[U(C)]=j(m,n)}),R},L=null,D=null,z=null,J=new Set,Y=R=>{if(R==null){if(!n[Fn]?.has(e)||J.has("unfilled"))return;J.add("unfilled"),console.error(`jq79: <${X(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}J.has("type")||(J.add("type"),console.error(`jq79: <${X(t)}> is ${typeof R}, not a component - nothing renders here`))};return s.effect(()=>{let R=j(e,n),C=R instanceof re?R:null;if(C||Y(R),C===D||(z?.dispose(),z=null,L?.destroy(),L=null,D=C,!C))return;tr(t,C);let m=new re({template:C.template,scripts:C.scripts,styles:C.styles,modules:C.modules,filename:C.filename,siblings:C.siblings,name:C.name});if(a&&(m.slots=a),Object.keys(c).length){let K=new Set;m.modelWriteback=(T,W)=>{let P=T==null?"default":ie(String(T)),Z=c[P];return Z===void 0?(K.has(P)||(K.add(P),console.warn(`jq79: <${X(t)}> has no ${I(P)} - bound: ${Object.keys(c).map(I).join(", ")}`)),!1):S.has(P)?!1:(Re(()=>j(M(Z),n,{$value:W})),!0)}}p.forEach(([K,T])=>Is(m,K,T,n));let _=lo(m.scripts);ao(t,e,Object.keys(u),_);let A=en(Re(q),_),G=document.createDocumentFragment();if(it>=qt){console.error(`jq79: <${X(t)}> is ${qt} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}it++;try{(r?m.renderShadow(A):m.render(A)).mount(G)}finally{it--}l?l.parentNode.insertBefore(G,l):i.appendChild(G);let V=de(n,!0);if(v){let K=[];V.effect(()=>{let T=en(q(),_),W=Object.keys(T);K.forEach(P=>{P in T||(m.data[P]=void 0)}),W.forEach(P=>{m.data[P]=T[P]}),K=W})}else Object.entries(u).forEach(([K,T])=>{_!==null&&!_.has(K)||V.effect(()=>{m.data[K]=j(T,n)})});z=V,L=m}),s.onDispose(()=>{z?.dispose(),L?.destroy()}),i},nr=(e,t)=>{let n=()=>{let s=j(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},ae=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(ae):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?ae(t):[]):[],sr=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Rt(e):()=>!1,rr=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),Nn=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),or={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Ht=new Map,ir=(e,t)=>{let n=`${e} ${t}`,s=Ht.get(n);if(s!==void 0)return s;let r=or[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,l]=r;i=new DOMParser().parseFromString(`<${o}><${l} ${t}="x"/></${o}>`,"text/html").querySelector(l)?.getAttributeNames().find(u=>u.toLowerCase()===t)??t}return Ht.set(n,i),i},xn=(e,t)=>{let n=e.namespaceURI;if(n===null||n===on)return t;let s=t.replace(/-/g,"").toLowerCase(),r=ir(n,s);return r===s?t:r},Cn=(e,t,n)=>{let s=rr.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},oe={cloneSkeletons:!0,scopedNames:!0},lr=new Set([":text",":html",":value",":checked",":selected"]),ar=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||lr.has(e)?!0:e.startsWith(":")?e===":model"?!1:!we(e)&&!e.includes("."):e!==Ue,_n=e=>{if(e.component||e.tag.includes("-")||Rn(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!ar(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||_n(t))},An=(e,t,n)=>{let s=Nn(e),r,i=null;for(let p in e.attrs){let w=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:w});else if(p===":class")r=w;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),w]);else if(!we(p))if(p.startsWith(":")){let v=p.slice(1);n.push({kind:"attr",path:t,name:xn(s,v),expr:w||ie(v)})}else s.setAttribute(p,w)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(ae(e.attrs.class??""))});let o=e.attrs[":text"],l=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):l!==void 0?n.push({kind:"html",path:t,expr:l}):e.children.forEach((p,w)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,w],parts:mn(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(An(p,[...t,w],n))});let a=e.attrs[":value"];a!==void 0&&n.push({kind:"value",path:t,expr:a});let u=e.attrs[":checked"];u!==void 0&&n.push({kind:"checked",path:t,expr:u});let c=e.attrs[":selected"];return c!==void 0&&n.push({kind:"selected",path:t,expr:c}),s},cr=3,On=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:On(n)),0),zt=new WeakMap,Gt=new WeakSet,ur=e=>{let t=zt.get(e);if(t!==void 0)return t;if(!Gt.has(e))return Gt.add(e),null;let n=null;if(_n(e)&&On(e)>=cr){let s=[];n={skeleton:An(e,[],s),ops:s}}return zt.set(e,n),n},dr=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},fr=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:dr(s,r.path);if(r.kind==="text"){let o=i,l=r.parts;n.effect(()=>{let a=yn(l,t);o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="event")bn(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:l,expr:a}=r;n.effect(()=>Cn(o,l,j(a,t)))}else if(r.kind==="class"){let o=i,{classExpr:l,toggles:a,staticClasses:u}=r,c=[];n.effect(()=>{let p=l!==void 0?ae(j(l,t)):[];a?.forEach(([w,v])=>{j(v,t)&&p.push(...ae(w))}),c.forEach(w=>{!p.includes(w)&&!u.has(w)&&o.classList.remove(w)}),o.classList.add(...p),c=p})}else if(r.kind==="textContent"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="html"){let o=i,{expr:l}=r;n.effect(()=>{o.innerHTML=Ke(String(j(l,t)??""))})}else if(r.kind==="value"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.value!==a&&(o.value=a)})}else if(r.kind==="checked"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.checked!==a&&(o.checked=a)})}else if(r.kind==="selected"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.selected!==a&&(o.selected=a)})}else{let o=r}}return s},mt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?nr(r,t):t;if(Rn(e.tag))return Qs(e,i,n,s);if(e.tag==="template"&&Te(e)!==void 0)return Xs(e);let o=Wt(e,i);if(o)return Bt(o,e,i,n,s);if(oe.cloneSkeletons){let S=ur(e);if(S)return fr(S,i,n)}let l=Nn(e);if(e.component!==void 0&&i[ft]?.count===0)throw zs(e.component,i);let a=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(a){let S=!1;n.effect(()=>{if(S)return;let q=Wt(e,i);if(!q)return;S=!0;let L=Bt(q,e,i,n,s),D=gt(L);n.onDispose(()=>ze(D)),l.replaceWith(L)})}for(let S in e.attrs){let q=e.attrs[S];if(S.startsWith("@"))bn(l,S,q,i);else if(S===":model"||S.startsWith(":model."))a||console.warn(`jq79: ${S} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!we(S))if(S.startsWith(":"))if(a)l.setAttribute(S,q);else{let L=S.slice(1),D=q||ie(L),z=xn(l,L);n.effect(()=>Cn(l,z,j(D,i)))}else l.setAttribute(S,q)}let u=e.attrs[":class"],c=null;for(let S in e.attrs)S.startsWith(":class.")&&(c??(c=[])).push([S.slice(7),e.attrs[S]]);if(u!==void 0||c){let S=new Set(ae(e.attrs.class??"")),q=[];n.effect(()=>{let L=u!==void 0?ae(j(u,i)):[];c?.forEach(([D,z])=>{j(z,i)&&L.push(...ae(D))}),q.forEach(D=>{!L.includes(D)&&!S.has(D)&&l.classList.remove(D)}),l.classList.add(...L),q=L})}let p=e.attrs[":text"],w=e.attrs[":html"],v=e.attrs[":html.allowed"];v!==void 0&&w===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let S=String(j(p,i)??"");l.textContent!==S&&(l.textContent=S)}):w!==void 0?n.effect(()=>{let S=v!==void 0?{allowUrl:sr(j(v,i))}:void 0;l.innerHTML=Ke(String(j(w,i)??""),S)}):l instanceof HTMLTemplateElement?ge(e.children,i,n,s,l.content):ge(e.children,i,n,s,l);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let S=String(j(I,i)??"");l.value!==S&&(l.value=S)});let U=e.attrs[":checked"];U!==void 0&&n.effect(()=>{let S=!!j(U,i);l.checked!==S&&(l.checked=S)});let M=e.attrs[":selected"];return M!==void 0&&n.effect(()=>{let S=!!j(M,i);l.selected!==S&&(l.selected=S)}),l},pr=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,l=null,a=null;return n.effect(()=>{let u=e.find(p=>p.expr===void 0||j(p.expr,t))??null;if(u===l||(a?.dispose(),o&&ze(o),o=null,l=u,!u))return;a=de(t);let c=mt(u.node,t,a,s);o=gt(c),r.parentNode.insertBefore(c,r.nextSibling)}),i},Ee=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},hr=e=>{let t=new Uint8Array(e.length),n=[],s=new Int32Array(e.length).fill(-1);for(let r=0;r<e.length;r++){let i=e[r];if(i<0)continue;let o=0,l=n.length;for(;o<l;){let a=o+l>>1;e[n[a]]<i?o=a+1:l=a}o>0&&(s[r]=n[o-1]),n[o]=r}for(let r=n.length?n[n.length-1]:-1;r!==-1;r=s[r])t[r]=1;return t},gr=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},vn=(e,t)=>typeof e=="string"?t.some(n=>Kt(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Kt(n,s)))||e.children.some(n=>vn(n,t)),Zt=/[A-Za-z0-9_$]/,mr=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Kt=(e,t)=>{for(let n=e.indexOf(t);n!==-1;n=e.indexOf(t,n+1)){let s=n===0?"":e[n-1],r=e[n+t.length]??"";if(!Zt.test(s)&&!Zt.test(r))return!0}return!1},lt=new WeakMap,yr=e=>{let t=lt.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Ds);if(!n)return lt.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],l=o===s,a=o!==void 0&&!l&&mr.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:u,[":key"]:c,...p}=e.attrs,w={...e,attrs:p},v=["$index",...r?[r]:[]],I=vn(w,v),U=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),M={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:l,keyProp:a,itemNode:w,readsPosition:I,namesComponent:U};return lt.set(e,M),M},Er=(e,t,n,s)=>{let r=yr(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:l,keyExpr:a,keyIsItem:u,keyProp:c,itemNode:p,readsPosition:w,namesComponent:v}=r,I=document.createComment("each"),U=document.createDocumentFragment();U.appendChild(I),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let M=[],S=!1;return n.effect(()=>{let q=Us(t);try{let L=j(l,t),D=Array.isArray(L),z=D?null:gr(L)?Object.keys(L):[],J=D?L.length:z.length,Y=new Map;M.forEach((T,W)=>{T.pos=W;let P=Y.get(T.key);P?P.push(T):Y.set(T.key,[T])});let R=new Set,C=[],m=[],_=[],A;for(let T=0;T<J;T++){let W=D?T:z[T],P=D?L[T]:L[W],Z=W;u?Z=P:c!==void 0&&P!==null&&typeof P=="object"?Z=P[c]:a!==void 0&&(A===void 0?(A=Object.create(t),Ee(A,i,P),o&&Ee(A,o,W),Ee(A,"$index",T)):(A[i]=P,o&&(A[o]=W),A.$index=T),Z=j(a,A)),R.has(Z)&&!S&&(S=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),R.add(Z);let f=Y.get(Z)?.shift();if(f&&Object.is(f.item,P)){let b=f.scope;b.$index!==T&&(w&&C.push(f),b.$index=T),o&&b[o]!==W&&(b[o]=W),m.push(f),_.push(f.pos);continue}f&&(f.fx.dispose(),ze(f.range));let d=Object.create(t);Ee(d,i,P),o&&Ee(d,o,W),Ee(d,"$index",T),v||wn.add(d);let g=de(t),h=gt(mt(p,d,g,s));m.push({key:Z,item:P,scope:d,fx:g,range:h,pos:T}),_.push(-1)}let G=new Set;Y.forEach(T=>T.forEach(W=>G.add(W))),G.size&&(G.forEach(T=>{T.dead=!0,T.fx.dispose()}),Ws(Fs(M,T=>T.dead===!0)));let V=I,K=hr(_);m.forEach((T,W)=>{!K[W]&&V.nextSibling!==T.range.first&&qs(T.range,V),V=T.range.last}),C.forEach(T=>Re(()=>T.fx.refresh())),M=m}finally{Bs(q)}}),U},jn=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},at=e=>{let t=":if"in e.attrs,n=":elseif"in e.attrs,s=":else"in e.attrs;if((t?1:0)+(n?1:0)+(s?1:0)<2)return;let r=[t?":if":null,n?":elseif":null,s?":else":null].filter(Boolean);console.warn(`jq79: ${r.join(" and ")} on the same <${X(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},br=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${X(e)}> - the chain before it already ended with :else, which closes it. One :if, any number of :elseif, at most one :else`:`jq79: ${n} on <${X(e)}> continues no :if - it renders unconditionally. A chain is :if, then :elseif, then :else, on adjacent siblings: anything but whitespace between them breaks it`)},wr=[":if",":elseif",":else",":each"],Sr=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=wr.find(s=>s in e.attrs);if(n!==void 0){if(Te(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Te(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},Rr=[...En,":model",":slot"].map(e=>e.slice(1)),$r={":attrs":':attrs was removed in 0.7 - it now binds an attribute called "attrs". Bind them one at a time (:disabled="x", :title="y"), or :class for classes'},Tr=e=>{for(let t in e.attrs){let n=$r[t];n!==void 0&&console.warn(`jq79: ${n}`)}},Nr=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||we(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1),s=Rr.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},Pn=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Sr(s,t),Tr(s),Nr(s),Pn(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(at(r),":if"in r.attrs){s++;let i=l=>{let a=jn(e,s),u=e[a];if(typeof u=="object"&&l in u.attrs)return s=a+1,u};for(let l=i(":elseif");l;l=i(":elseif"))at(l);let o=i(":else");o&&at(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&br(r,n),n=!1,s++}},Vt=new WeakMap,xr=(e,t,n)=>{let s=Vt.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=u=>{let c=jn(e,i),p=e[c];if(typeof p=="object"&&u in p.attrs)return i=c+1,p};for(let u=o(":elseif");u;u=o(":elseif"))r.push({expr:u.attrs[":elseif"],node:u});let l=o(":else");l&&r.push({node:l});let a={branches:r,next:i};return Vt.set(t,a),a},ge=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let l=e[o];if(typeof l=="string"){let a=document.createTextNode(l);if(l.includes("{{")){let u=mn(l);n.effect(()=>{let c=yn(u,t);a.textContent!==c&&(a.textContent=c)})}i.appendChild(a),o++;continue}if(":each"in l.attrs){i.appendChild(Er(l,t,n,s)),o++;continue}if(":if"in l.attrs){let a=xr(e,l,o);i.appendChild(pr(a.branches,t,n,s)),o=a.next;continue}i.appendChild(mt(l,t,n,s)),o++}return i},Cr=(e,t,n=!1)=>ge(e.template,t,de(t),n),_r=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ar=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,yt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Or=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(Ar,(s,r,i)=>_r.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),kn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,vr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,jr=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(kn,(s,r,i)=>{let o=0,l=i.replace(vr,(a,u,c)=>c===void 0?a:`${u}:props.${o++}="${c}"`);return`<${r}${l}>`})).join(""),Pr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,kr=/<\/slot\.([\w.$-]+)(\s*)>/gi,Mr=/^slot\./i,Lr=e=>Mr.test(e)?`slot.${Fe(e.slice(5))}`:e,Ue=":jq79-component",Mn=/^[A-Z]/,Dr="c79-",Ge=e=>`${Dr}${Fe(e[0].toLowerCase()+e.slice(1))}`,Ir=e=>Mn.test(e)?Ge(e):Lr(e),Wr=/<\/([A-Z][\w.-]*)(\s*)>/g,Fr=/\/\s*$/,qr=(e,t)=>{if(!Mn.test(e))return t;let n=` ${Ue}="${e}"`,s=Fr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},Ur=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(kn,(s,r,i)=>{let o=i.replace(Pr,(l,a,u)=>u===void 0?l:`${a}${Fe(u)}`);return`<${Ir(r)}${qr(r,o)}>`}).replace(kr,(s,r,i)=>`</slot.${Fe(r)}${i}>`).replace(Wr,(s,r,i)=>`</${Ge(r)}${i}>`)).join(""),be="data-jq79",Br=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},Ln=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[be]=t,Ln(n.children,t))})},Hr=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),i=r===-1?s:s.slice(0,r),o=r===-1?"":s.slice(r);return`${i}[${be}="${t}"]${o}`}).join(", "),Dn=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Hr(n.selectorText,t):n instanceof CSSGroupingRule&&Dn(n.cssRules,t)})},zr=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Gr=/[a-z]/,Zr=e=>e.replace(zr,(t,n,s)=>Gr.test(s)?`${n}${Ge(s)}`:t),Kr=/^\s*@(media|supports|container|layer|scope|document)\b/i,Vr=/^\s*@/,Xr=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Vr.test(s)?Zr(n):n,n=""},l=u=>{o(),t+=u,s+=u},a=(u,c)=>{o(),t+=u,s="",c!==void 0?r.push(c):u==="}"&&r.pop()};for(let u=0;u<e.length;){let c=e[u];if(c==="/"&&e[u+1]==="*"){let p=e.indexOf("*/",u+2),w=p===-1?e.length:p+2;l(e.slice(u,w)),u=w}else if(c==='"'||c==="'"){let p=u+1;for(;p<e.length&&e[p]!==c;)p+=e[p]==="\\"?2:1;l(e.slice(u,Math.min(p+1,e.length))),u=p+1}else c==="{"?(a("{",Kr.test(s)),u++):c==="}"||c===";"?(a(c),u++):(n+=c,s+=c,u++)}return o(),t},Jr=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(e),Dn(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
|
package/dist/jq79.js
CHANGED
|
@@ -4,7 +4,7 @@ var qn=Object.defineProperty;var Un=(e,t,n)=>t in e?qn(e,t,{enumerable:!0,config
|
|
|
4
4
|
`){let i=Ce(e,s+1);if(!(i<e.length&&(rs.test(e.slice(i,i+2))||[",","="].includes(os(e,s)))))return s;s=i;continue}}s++}return e.length},is=e=>{let t=[],n=0,s=0,r=0,i=l=>{t.push({raw:e.slice(s,l),codeEnd:Math.max(0,r-s)}),s=l+1,r=s},o=0;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=te(e,o),r=o;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),r=o;continue}if("([{".includes(l))n++;else if(")]}".includes(l))n--;else if(l===","&&n<=0){i(o),o++;continue}/\s/.test(l)||(r=o+1),o++}return i(e.length),t},Je=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Oe.test(t)?[t]:[];let n=[];for(let s of Qe(t.slice(1,kt(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=et(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=Ye(s,":");if(i!==-1){n.push(...Je(s.slice(i+1)));continue}}n.push(...Je(s))}return n},ls=e=>{let t=[],n=is(e).map(({raw:i,codeEnd:o})=>{let l=i.match(/^\s*/)[0];if(o<=l.length)return{text:i,empty:!0};let a=i.slice(l.length,o),u=i.slice(o),c=et(a),p=(c===-1?a:a.slice(0,c)).trim(),w=a[0]==="{"||a[0]==="[";w?t.push(...Je(p)):Oe.test(p)&&t.push(p);let v=ve(a).code;return{text:`${l}${w?`(${v})`:v}${u}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(i=>i.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},ve=e=>{let t=[],n="",s=0,r=0,i=!0;for(;s<e.length;){let o=e[s],l=e[s+1];if(o==="'"||o==='"'||o==="`"){let a=te(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="/"&&(l==="/"||l==="*")){let a=l==="/"?Q(e,s):ee(e,s);n+=e.slice(s,a),s=a;continue}if(o==="/"&&ne(e,s)){let a=se(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(_e.lastIndex=s,_e.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){At.lastIndex=s;let a=At.exec(e);if(a){let c=s+a[0].length,p=jt(e,c),{vars:w,code:v}=ls(e.slice(c,p));t.push(...w),n+=v,s=p,i=!1;continue}Ot.lastIndex=s;let u=Ot.exec(e);if(u){vt.lastIndex=s;let c=vt.exec(e);c&&t.push(c[1]);let p=s+u[0].length,w=jt(e,p);n+=`$__effect(() => { ${ve(e.slice(p,w)).code} });`,s=w;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
|
|
5
5
|
`||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},Ae=/export\s+default(?![\w$])/y,Pt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,as=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let i=e[r];if(i==="{")n++;else if(i==="}")n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}}return t},cs=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=as(e),i=[],o=s;if(r.length>1){let l=`$__mod${n}`;i.push(`${l} = ${s}`),o=l}for(let l of r)l.startsWith("{")?i.push(`${l.replace(/\s+as\s+/g,": ")} = ${o}`):l.startsWith("*")?i.push(`${l.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${l} = $__default(${o})`);return`const ${i.join(", ")}`},Oe=/^[A-Za-z_$][\w$]*$/,kt=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=te(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=Q(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=ee(e,n);continue}if(s==="/"&&ne(e,n)){n=se(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},Ye=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=te(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=Q(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=ee(e,s);continue}if(r==="/"&&r!==t&&ne(e,s)){s=se(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},Qe=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=te(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=Q(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=ee(e,r);continue}if(i==="/"&&ne(e,r)){r=se(e,r);continue}if(i!==void 0&&"([{".includes(i))n++;else if(i!==void 0&&")]}".includes(i))n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},et=e=>{let t=0;for(;t<e.length;){let n=Ye(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},je=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=kt(t);if(n>=t.length)return null;let s=[];for(let r of Qe(t.slice(1,n))){if(r.startsWith("..."))continue;let i=et(r),o=i===-1?r:r.slice(0,i),l=i===-1?void 0:r.slice(i+1).trim(),a=Ye(o,":"),u=(a===-1?o:o.slice(0,a)).trim();if(!Oe.test(u))continue;let c={name:u};l!==void 0&&(c.default=l);let p=a===-1?"":o.slice(a+1).trim();Oe.test(p)&&(c.as=p),s.push(c)}return s},us=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=te(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=Q(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=ee(e,t);continue}if(r==="/"&&ne(e,t)){t=se(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){Ae.lastIndex=t;let i=Ae.exec(e);if(i)return t+i[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
|
|
6
6
|
`||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},ds=/^async(?![\w$])/,fs=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,ps=e=>{let t=us(e);if(t===-1)return null;let n=Ce(e,t),s=e.slice(n);ds.test(s)&&(n=Ce(e,n+5));let r=fs.exec(e.slice(n));if(r&&(n=Ce(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=te(e,o);continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o);continue}if("([{".includes(l))i++;else if(")]}".includes(l)&&--i===0)break;o++}return Qe(e.slice(n+1,o))[0]??""},Pe=e=>{let t=ps(e);if(t===null)return null;let n=je(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},Mt=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let l=e[n],a=e[n+1],u=n===0||!/[\w$.]/.test(e[n-1]);if(l==="'"||l==='"'||l==="`"){let c=te(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="/"&&(a==="/"||a==="*")){let c=a==="/"?Q(e,n):ee(e,n);t+=e.slice(n,c),n=c;continue}if(l==="/"&&ne(e,n)){let c=se(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="i"&&u){if(_e.lastIndex=n,_e.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){Pt.lastIndex=n;let c=Pt.exec(e);if(c){t+=cs(c[1],c[3],o++),n+=c[0].length,r=!1;continue}}}if(l==="e"&&u&&s===0&&r){Ae.lastIndex=n;let c=Ae.exec(e);if(c){i=!0,t+="$__exports.default =",n+=c[0].length,r=!1;continue}}"([{".includes(l)?s++:")]}".includes(l)&&(s=Math.max(0,s-1)),l===`
|
|
7
|
-
`||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},hs=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),gs=new Set(["function","class","let","const","var","eval","with"]),ms=new Set(["$scope","$r","$t"]),ys=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,Es=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,bs=e=>/[A-Za-z_$]/.test(e),ws=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,tt=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),i="value";continue}if(l==='"'||l==="'"){o=te(e,o),i="value";continue}if(l==="`"){let c=o+1;for(;c<e.length;){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;break}if(e[c]==="$"&&e[c+1]==="{"){let p=1,w=c+=2;for(;c<e.length&&p>0;)e[c]==="{"?p++:e[c]==="}"&&p--,c++;let v=tt(e.slice(w,c-1));if(v===null)return null;v.forEach(I=>t.add(I));continue}c++}o=c,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let c=ws.exec(e.slice(o));o+=c?c[0].length:1,i="value";continue}if(bs(l)){let c=o;for(;c<e.length&&/[\w$]/.test(e[c]);)c++;let p=e.slice(o,c);if(o=c,gs.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(hs.has(p)){i=p==="this"?"value":"op";continue}if(ms.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(ys.test(a))return null;let u=Es.exec(a);if(u){(u[0]==="&&"||u[0]==="||"||u[0]==="??")&&(r=!0),i=u[0]==="?."?"?.":"op",o+=u[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]};var Ss="0.
|
|
7
|
+
`||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},hs=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),gs=new Set(["function","class","let","const","var","eval","with"]),ms=new Set(["$scope","$r","$t"]),ys=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,Es=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,bs=e=>/[A-Za-z_$]/.test(e),ws=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,tt=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),i="value";continue}if(l==='"'||l==="'"){o=te(e,o),i="value";continue}if(l==="`"){let c=o+1;for(;c<e.length;){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;break}if(e[c]==="$"&&e[c+1]==="{"){let p=1,w=c+=2;for(;c<e.length&&p>0;)e[c]==="{"?p++:e[c]==="}"&&p--,c++;let v=tt(e.slice(w,c-1));if(v===null)return null;v.forEach(I=>t.add(I));continue}c++}o=c,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let c=ws.exec(e.slice(o));o+=c?c[0].length:1,i="value";continue}if(bs(l)){let c=o;for(;c<e.length&&/[\w$]/.test(e[c]);)c++;let p=e.slice(o,c);if(o=c,gs.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(hs.has(p)){i=p==="this"?"value":"op";continue}if(ms.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(ys.test(a))return null;let u=Es.exec(a);if(u){(u[0]==="&&"||u[0]==="||"||u[0]==="??")&&(r=!0),i=u[0]==="?."?"?.":"op",o+=u[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]};var Ss="0.7.0",sn=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),rn="http://www.w3.org/1999/xhtml",on=e=>{let t=sn(e),n=e.namespaceURI,s=t[We];delete t[We];let r=n!==null&&n!==rn;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(i=>{if(i.nodeType===Node.TEXT_NODE){let o=i.textContent??"";return o?[o]:[]}return i.nodeType===Node.ELEMENT_NODE?[on(i)]:[]})}},Me=new Map,nt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},ln=(e,t)=>{try{return new Function("$scope","$r",...t,`with ($scope) { return (${e}
|
|
8
8
|
); }`)}catch{return null}},Rs=(e,t)=>{if(!re.scopedNames)return null;let n=tt(e);if(n===null)return null;let s=n.filter(i=>!t.includes(i)),r=s.length===0?"":`let $t; ${s.map(i=>`const ${i} = ($t = $scope.${i}) !== undefined ? $t : $r($scope, ${JSON.stringify(i)});`).join(" ")}`;try{return new Function("$scope","$r",...t,`${r} return (${e}
|
|
9
9
|
);`)}catch{return null}},an=(e,t,n)=>{let s=Me.get(e);if(s===void 0){let r=Rs(t,n);s=r?{fn:r,scoped:!0}:{fn:ln(t,n),scoped:!1},Me.set(e,s)}return s},cn=(e,t)=>`${t.join(",")}|${e}`,$s=(e,t)=>an(cn(e,t),e,t).fn,Ts=(e,t,n)=>{let s=ln(t,n);return Me.set(e,{fn:s,scoped:!1}),s},Ns=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,xs=100,pe=new Map,pt=new Set,Le=0,lt=!1,at=new Set,Cs=()=>{lt=!1,!(Le>0)&&(pe.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(pt.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),pe.clear())},un=()=>{lt||Le>0||!pe.size||(lt=!0,queueMicrotask(Cs))},dn=e=>{Le++;let t=()=>{Le--,un()};e.then(t,t)},_s=(e,t)=>{if(at.has(e))return;at.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},fn=(e,t,n)=>{if(!(n instanceof ReferenceError))return _s(e,n);let s=Ns.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;pt.has(i)||pe.has(i)||pe.size>=xs||(pe.set(i,{name:r,expr:e,scope:t}),un())},pn=(e,t,n)=>{let s=n?Object.keys(n):[],r=cn(e,s),{fn:i,scoped:o}=an(r,e,s);if(!i)return;let l=n?Object.values(n):[];if(!o)return i(t,nt,...l);try{return i(t,nt,...l)}catch(a){if(!(a instanceof ReferenceError))throw a;let u=Ts(r,e,s);if(!u)throw a;return u(t,nt,...l)}},j=(e,t,n)=>{try{return pn(e,t,n)}catch(s){fn(e,t,s);return}},hn=(e,t,n)=>{try{return pn(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;fn(e,t,s);return}},st=/{{\s*([\s\S]+?)\s*}}/g,Lt=new Map,gn=e=>{let t=Lt.get(e);if(t)return t;let n=[],s=0;st.lastIndex=0;for(let r=st.exec(e);r;r=st.exec(e))r.index>s&&n.push(e.slice(s,r.index)),n.push({expr:r[1]}),s=r.index+r[0].length;return s<e.length&&n.push(e.slice(s)),Lt.set(e,n),n},mn=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(j(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(j(s.expr,t)??"");return n},yn=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),be=e=>yn.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),As=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,En=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,l=>{if(o.has("self")&&l.target!==e)return;o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation();let a=hn(n,s,{$event:l});typeof a=="function"&&a.call(e,l)},{once:o.has("once"),capture:o.has("capture")})},Os=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),l=a=>{o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation(),o.has("once")&&e.off(r,l),Re(()=>{let u=hn(n,s,{$event:a});typeof u=="function"&&u(a)})};e.on(r,l)},oe=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),De=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),ht=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},qe=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},vs=e=>{e.forEach(t=>{if(t.first===t.last)return qe(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},js=(e,t)=>{let n=[],s=null;return e.forEach(r=>{if(!t(r)){s=null;return}s&&s.last.nextSibling===r.range.first?s.last=r.range.last:n.push(s={first:r.range.first,last:r.range.last})}),n},Ps=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let i=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=i}},Dt=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},fe=null,Ie=null,bn=new WeakSet,ks=e=>{let t={memo:fe,base:Ie};return fe=new Map,Ie=e,t},Ms=e=>{fe=e.memo,Ie=e.base},It=(e,t)=>e.component!==void 0?Wt(t,e.component):e.tag.includes("-")?Wt(t,e.tag):null,X=e=>e.component??e.tag,Wt=(e,t)=>{if(!fe)return Dt(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===Ie){if(fe.has(t))return fe.get(t);let r=Dt(s,t);return fe.set(t,r),r}if(!bn.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},Ls=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},Ds=(e,t)=>{let n=Ls(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},Ft=200,rt=0,wn=Symbol("jq79.slots"),Sn=e=>e==="slot"||e.startsWith("slot."),Rn=e=>e?oe(e):"default",$e=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Is=e=>e==="default"?":slot":`:slot.${e}`,Ws=e=>typeof e!="string"||e.trim()!=="",Fs=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?$e(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=Rn(i.slice(6));if(o in t){console.warn(`jq79: two <template ${Is(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(Ws);return s&&"default"in t?console.warn(`jq79: <${X(e)}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(t.default={nodes:n,binder:e.attrs[":slot"]||void 0}),t},qs=(e,t,n)=>{je(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let l=n[s]?.();return l===void 0&&i!==void 0?j(i,e):l},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},Us=e=>{let t=$e(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},Bs=(e,t)=>{let n=Object.entries(Fs(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=Hs(i,t)}),s},Hs=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);qs(o,e.binder,n);let l=o[Ne]??[];Object.defineProperty(o,Ne,{value:[...l,s]});let a=de(o);return r.onDispose(()=>a.dispose()),ge(e.nodes,o,a,i)},zs=(e,t,n,s)=>{let r=Rn(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),l=document.createComment(`/${e.tag}`);i.append(o,l);let a=t[wn]?.[r];if(!a)return i.insertBefore(ge(e.children,t,n,s),l),i;let u={};return Object.entries(e.attrs).forEach(([c,p])=>{if(!(c===Ee||be(c)||c.startsWith("@")))if(c.startsWith(":")){let w=p||c.slice(1);u[oe(c.slice(1))]=()=>j(w,t)}else u[oe(c)]=()=>p}),i.insertBefore(a(u,t,n,s),l),i},$n="data-c79-box",Gs=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(Ue(e));s.setAttribute($n,"");let r=t.attrs[Ee];return r!==void 0&&s.setAttribute(Ee,r),n||Gr(),s},qt=new WeakSet,Zs=(e,t)=>{if(e.ns===void 0||qt.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;qt.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${X(e)}> is used inside ${s} and its template starts with <${n.tag.toLowerCase()}>, which is parsed as HTML - it renders and never draws. A component's template decides its own namespace, so root it at ${s}`)},Ut=(e,t,n,s,r)=>{let i=Gs(e,t,r),o=!(i instanceof DocumentFragment),l=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),l);let a=Bs(t,n),u={},c={},p=[],w=[],v=!1;Object.entries(t.attrs).forEach(([R,C])=>{if(R!==Ee){if(R===":props"||R.startsWith(":props.")){v=!0,w.push({expr:C});return}if(!be(R))if(R.startsWith("@"))p.push([R,C]);else if(R===":model"||R.startsWith(":model.")){let m=R===":model"?"default":oe(R.slice(7));c[m]=C||(R===":model"?"model":m)}else if(R.startsWith(":")){let m=oe(R.slice(1));u[m]=C||m,w.push({name:m,expr:C||m})}else{let m=oe(R),_=JSON.stringify(C);u[m]=_,w.push({name:m,expr:_})}}});let I=R=>R==="default"?":model":`:model.${R}`,U=R=>R==="default"?"model":R,M=R=>`${R}
|
|
10
10
|
= $value`,S=new Set;Object.entries(c).forEach(([R,C])=>{let m=U(R);u[m]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${m}" through both :${m} and ${I(R)} - ${I(R)} wins`),u[m]=C,$s(M(C),["$value"])===null&&(S.add(R),console.warn(`jq79: ${I(R)}="${C}" is not assignable - updates from <${X(t)}> will be dropped`))});let q=()=>{let R={};return w.forEach(({name:C,expr:m})=>{if(C!==void 0)R[C]=j(m,n);else{let _=j(m,n);_!==null&&typeof _=="object"&&Object.assign(R,_)}}),Object.entries(c).forEach(([C,m])=>{R[U(C)]=j(m,n)}),R},L=null,D=null,H=null,J=new Set,Y=R=>{if(R==null){if(!n[Wn]?.has(e)||J.has("unfilled"))return;J.add("unfilled"),console.error(`jq79: <${X(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}J.has("type")||(J.add("type"),console.error(`jq79: <${X(t)}> is ${typeof R}, not a component - nothing renders here`))};return s.effect(()=>{let R=j(e,n),C=R instanceof ie?R:null;if(C||Y(R),C===D||(H?.dispose(),H=null,L?.destroy(),L=null,D=C,!C))return;Zs(t,C);let m=new ie({template:C.template,scripts:C.scripts,styles:C.styles,modules:C.modules,filename:C.filename,siblings:C.siblings,name:C.name});if(a&&(m.slots=a),Object.keys(c).length){let K=new Set;m.modelWriteback=(T,W)=>{let P=T==null?"default":oe(String(T)),G=c[P];return G===void 0?(K.has(P)||(K.add(P),console.warn(`jq79: <${X(t)}> has no ${I(P)} - bound: ${Object.keys(c).map(I).join(", ")}`)),!1):S.has(P)?!1:(Re(()=>j(M(G),n,{$value:W})),!0)}}p.forEach(([K,T])=>Os(m,K,T,n));let _=Yr(m.scripts);Qr(t,e,Object.keys(u),_);let A=Qt(Re(q),_),z=document.createDocumentFragment();if(rt>=Ft){console.error(`jq79: <${X(t)}> is ${Ft} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}rt++;try{(r?m.renderShadow(A):m.render(A)).mount(z)}finally{rt--}l?l.parentNode.insertBefore(z,l):i.appendChild(z);let V=de(n,!0);if(v){let K=[];V.effect(()=>{let T=Qt(q(),_),W=Object.keys(T);K.forEach(P=>{P in T||(m.data[P]=void 0)}),W.forEach(P=>{m.data[P]=T[P]}),K=W})}else Object.entries(u).forEach(([K,T])=>{_!==null&&!_.has(K)||V.effect(()=>{m.data[K]=j(T,n)})});H=V,L=m}),s.onDispose(()=>{H?.dispose(),L?.destroy()}),i},Ks=(e,t)=>{let n=()=>{let s=j(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},ae=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(ae):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?ae(t):[]):[],Vs=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?St(e):()=>!1,Xs=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),Tn=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),Js={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Bt=new Map,Ys=(e,t)=>{let n=`${e} ${t}`,s=Bt.get(n);if(s!==void 0)return s;let r=Js[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,l]=r;i=new DOMParser().parseFromString(`<${o}><${l} ${t}="x"/></${o}>`,"text/html").querySelector(l)?.getAttributeNames().find(u=>u.toLowerCase()===t)??t}return Bt.set(n,i),i},Nn=(e,t)=>{let n=e.namespaceURI;if(n===null||n===rn)return t;let s=t.replace(/-/g,"").toLowerCase(),r=Ys(n,s);return r===s?t:r},xn=(e,t,n)=>{let s=Xs.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},re={cloneSkeletons:!0,scopedNames:!0},Qs=new Set([":text",":html",":value",":checked",":selected"]),er=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||Qs.has(e)?!0:e.startsWith(":")?e===":model"?!1:!be(e)&&!e.includes("."):e!==We,Cn=e=>{if(e.component||e.tag.includes("-")||Sn(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!er(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||Cn(t))},_n=(e,t,n)=>{let s=Tn(e),r,i=null;for(let p in e.attrs){let w=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:w});else if(p===":class")r=w;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),w]);else if(!be(p))if(p.startsWith(":")){let v=p.slice(1);n.push({kind:"attr",path:t,name:Nn(s,v),expr:w||oe(v)})}else s.setAttribute(p,w)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(ae(e.attrs.class??""))});let o=e.attrs[":text"],l=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):l!==void 0?n.push({kind:"html",path:t,expr:l}):e.children.forEach((p,w)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,w],parts:gn(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(_n(p,[...t,w],n))});let a=e.attrs[":value"];a!==void 0&&n.push({kind:"value",path:t,expr:a});let u=e.attrs[":checked"];u!==void 0&&n.push({kind:"checked",path:t,expr:u});let c=e.attrs[":selected"];return c!==void 0&&n.push({kind:"selected",path:t,expr:c}),s},tr=3,An=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:An(n)),0),Ht=new WeakMap,zt=new WeakSet,nr=e=>{let t=Ht.get(e);if(t!==void 0)return t;if(!zt.has(e))return zt.add(e),null;let n=null;if(Cn(e)&&An(e)>=tr){let s=[];n={skeleton:_n(e,[],s),ops:s}}return Ht.set(e,n),n},sr=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},rr=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:sr(s,r.path);if(r.kind==="text"){let o=i,l=r.parts;n.effect(()=>{let a=mn(l,t);o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="event")En(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:l,expr:a}=r;n.effect(()=>xn(o,l,j(a,t)))}else if(r.kind==="class"){let o=i,{classExpr:l,toggles:a,staticClasses:u}=r,c=[];n.effect(()=>{let p=l!==void 0?ae(j(l,t)):[];a?.forEach(([w,v])=>{j(v,t)&&p.push(...ae(w))}),c.forEach(w=>{!p.includes(w)&&!u.has(w)&&o.classList.remove(w)}),o.classList.add(...p),c=p})}else if(r.kind==="textContent"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="html"){let o=i,{expr:l}=r;n.effect(()=>{o.innerHTML=Ge(String(j(l,t)??""))})}else if(r.kind==="value"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.value!==a&&(o.value=a)})}else if(r.kind==="checked"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.checked!==a&&(o.checked=a)})}else if(r.kind==="selected"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.selected!==a&&(o.selected=a)})}else{let o=r}}return s},gt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?Ks(r,t):t;if(Sn(e.tag))return zs(e,i,n,s);if(e.tag==="template"&&$e(e)!==void 0)return Us(e);let o=It(e,i);if(o)return Ut(o,e,i,n,s);if(re.cloneSkeletons){let S=nr(e);if(S)return rr(S,i,n)}let l=Tn(e);if(e.component!==void 0&&i[ut]?.count===0)throw Ds(e.component,i);let a=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(a){let S=!1;n.effect(()=>{if(S)return;let q=It(e,i);if(!q)return;S=!0;let L=Ut(q,e,i,n,s),D=ht(L);n.onDispose(()=>qe(D)),l.replaceWith(L)})}for(let S in e.attrs){let q=e.attrs[S];if(S.startsWith("@"))En(l,S,q,i);else if(S===":model"||S.startsWith(":model."))a||console.warn(`jq79: ${S} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!be(S))if(S.startsWith(":"))if(a)l.setAttribute(S,q);else{let L=S.slice(1),D=q||oe(L),H=Nn(l,L);n.effect(()=>xn(l,H,j(D,i)))}else l.setAttribute(S,q)}let u=e.attrs[":class"],c=null;for(let S in e.attrs)S.startsWith(":class.")&&(c??(c=[])).push([S.slice(7),e.attrs[S]]);if(u!==void 0||c){let S=new Set(ae(e.attrs.class??"")),q=[];n.effect(()=>{let L=u!==void 0?ae(j(u,i)):[];c?.forEach(([D,H])=>{j(H,i)&&L.push(...ae(D))}),q.forEach(D=>{!L.includes(D)&&!S.has(D)&&l.classList.remove(D)}),l.classList.add(...L),q=L})}let p=e.attrs[":text"],w=e.attrs[":html"],v=e.attrs[":html.allowed"];v!==void 0&&w===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let S=String(j(p,i)??"");l.textContent!==S&&(l.textContent=S)}):w!==void 0?n.effect(()=>{let S=v!==void 0?{allowUrl:Vs(j(v,i))}:void 0;l.innerHTML=Ge(String(j(w,i)??""),S)}):l instanceof HTMLTemplateElement?ge(e.children,i,n,s,l.content):ge(e.children,i,n,s,l);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let S=String(j(I,i)??"");l.value!==S&&(l.value=S)});let U=e.attrs[":checked"];U!==void 0&&n.effect(()=>{let S=!!j(U,i);l.checked!==S&&(l.checked=S)});let M=e.attrs[":selected"];return M!==void 0&&n.effect(()=>{let S=!!j(M,i);l.selected!==S&&(l.selected=S)}),l},or=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,l=null,a=null;return n.effect(()=>{let u=e.find(p=>p.expr===void 0||j(p.expr,t))??null;if(u===l||(a?.dispose(),o&&qe(o),o=null,l=u,!u))return;a=de(t);let c=gt(u.node,t,a,s);o=ht(c),r.parentNode.insertBefore(c,r.nextSibling)}),i},ye=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},ir=e=>{let t=new Uint8Array(e.length),n=[],s=new Int32Array(e.length).fill(-1);for(let r=0;r<e.length;r++){let i=e[r];if(i<0)continue;let o=0,l=n.length;for(;o<l;){let a=o+l>>1;e[n[a]]<i?o=a+1:l=a}o>0&&(s[r]=n[o-1]),n[o]=r}for(let r=n.length?n[n.length-1]:-1;r!==-1;r=s[r])t[r]=1;return t},lr=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},On=(e,t)=>typeof e=="string"?t.some(n=>Zt(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Zt(n,s)))||e.children.some(n=>On(n,t)),Gt=/[A-Za-z0-9_$]/,ar=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Zt=(e,t)=>{for(let n=e.indexOf(t);n!==-1;n=e.indexOf(t,n+1)){let s=n===0?"":e[n-1],r=e[n+t.length]??"";if(!Gt.test(s)&&!Gt.test(r))return!0}return!1},ot=new WeakMap,cr=e=>{let t=ot.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(As);if(!n)return ot.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],l=o===s,a=o!==void 0&&!l&&ar.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:u,[":key"]:c,...p}=e.attrs,w={...e,attrs:p},v=["$index",...r?[r]:[]],I=On(w,v),U=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),M={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:l,keyProp:a,itemNode:w,readsPosition:I,namesComponent:U};return ot.set(e,M),M},ur=(e,t,n,s)=>{let r=cr(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:l,keyExpr:a,keyIsItem:u,keyProp:c,itemNode:p,readsPosition:w,namesComponent:v}=r,I=document.createComment("each"),U=document.createDocumentFragment();U.appendChild(I),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let M=[],S=!1;return n.effect(()=>{let q=ks(t);try{let L=j(l,t),D=Array.isArray(L),H=D?null:lr(L)?Object.keys(L):[],J=D?L.length:H.length,Y=new Map;M.forEach((T,W)=>{T.pos=W;let P=Y.get(T.key);P?P.push(T):Y.set(T.key,[T])});let R=new Set,C=[],m=[],_=[],A;for(let T=0;T<J;T++){let W=D?T:H[T],P=D?L[T]:L[W],G=W;u?G=P:c!==void 0&&P!==null&&typeof P=="object"?G=P[c]:a!==void 0&&(A===void 0?(A=Object.create(t),ye(A,i,P),o&&ye(A,o,W),ye(A,"$index",T)):(A[i]=P,o&&(A[o]=W),A.$index=T),G=j(a,A)),R.has(G)&&!S&&(S=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),R.add(G);let f=Y.get(G)?.shift();if(f&&Object.is(f.item,P)){let b=f.scope;b.$index!==T&&(w&&C.push(f),b.$index=T),o&&b[o]!==W&&(b[o]=W),m.push(f),_.push(f.pos);continue}f&&(f.fx.dispose(),qe(f.range));let d=Object.create(t);ye(d,i,P),o&&ye(d,o,W),ye(d,"$index",T),v||bn.add(d);let g=de(t),h=ht(gt(p,d,g,s));m.push({key:G,item:P,scope:d,fx:g,range:h,pos:T}),_.push(-1)}let z=new Set;Y.forEach(T=>T.forEach(W=>z.add(W))),z.size&&(z.forEach(T=>{T.dead=!0,T.fx.dispose()}),vs(js(M,T=>T.dead===!0)));let V=I,K=ir(_);m.forEach((T,W)=>{!K[W]&&V.nextSibling!==T.range.first&&Ps(T.range,V),V=T.range.last}),C.forEach(T=>Re(()=>T.fx.refresh())),M=m}finally{Ms(q)}}),U},vn=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},it=e=>{let t=":if"in e.attrs,n=":elseif"in e.attrs,s=":else"in e.attrs;if((t?1:0)+(n?1:0)+(s?1:0)<2)return;let r=[t?":if":null,n?":elseif":null,s?":else":null].filter(Boolean);console.warn(`jq79: ${r.join(" and ")} on the same <${X(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},dr=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${X(e)}> - the chain before it already ended with :else, which closes it. One :if, any number of :elseif, at most one :else`:`jq79: ${n} on <${X(e)}> continues no :if - it renders unconditionally. A chain is :if, then :elseif, then :else, on adjacent siblings: anything but whitespace between them breaks it`)},fr=[":if",":elseif",":else",":each"],pr=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=fr.find(s=>s in e.attrs);if(n!==void 0){if($e(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${$e(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},hr=[...yn,":model",":slot"].map(e=>e.slice(1)),gr={":attrs":':attrs was removed in 0.7 - it now binds an attribute called "attrs". Bind them one at a time (:disabled="x", :title="y"), or :class for classes'},mr=e=>{for(let t in e.attrs){let n=gr[t];n!==void 0&&console.warn(`jq79: ${n}`)}},yr=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||be(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1),s=hr.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},jn=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(pr(s,t),mr(s),yr(s),jn(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(it(r),":if"in r.attrs){s++;let i=l=>{let a=vn(e,s),u=e[a];if(typeof u=="object"&&l in u.attrs)return s=a+1,u};for(let l=i(":elseif");l;l=i(":elseif"))it(l);let o=i(":else");o&&it(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&dr(r,n),n=!1,s++}},Kt=new WeakMap,Er=(e,t,n)=>{let s=Kt.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=u=>{let c=vn(e,i),p=e[c];if(typeof p=="object"&&u in p.attrs)return i=c+1,p};for(let u=o(":elseif");u;u=o(":elseif"))r.push({expr:u.attrs[":elseif"],node:u});let l=o(":else");l&&r.push({node:l});let a={branches:r,next:i};return Kt.set(t,a),a},ge=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let l=e[o];if(typeof l=="string"){let a=document.createTextNode(l);if(l.includes("{{")){let u=gn(l);n.effect(()=>{let c=mn(u,t);a.textContent!==c&&(a.textContent=c)})}i.appendChild(a),o++;continue}if(":each"in l.attrs){i.appendChild(ur(l,t,n,s)),o++;continue}if(":if"in l.attrs){let a=Er(e,l,o);i.appendChild(or(a.branches,t,n,s)),o=a.next;continue}i.appendChild(gt(l,t,n,s)),o++}return i},Eo=(e,t,n=!1)=>ge(e.template,t,de(t),n),br=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wr=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,mt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Sr=e=>e.split(mt).map((t,n)=>n%2===1?t:t.replace(wr,(s,r,i)=>br.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),Pn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,Rr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,$r=e=>e.split(mt).map((t,n)=>n%2===1?t:t.replace(Pn,(s,r,i)=>{let o=0,l=i.replace(Rr,(a,u,c)=>c===void 0?a:`${u}:props.${o++}="${c}"`);return`<${r}${l}>`})).join(""),Tr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,Nr=/<\/slot\.([\w.$-]+)(\s*)>/gi,xr=/^slot\./i,Cr=e=>xr.test(e)?`slot.${De(e.slice(5))}`:e,We=":jq79-component",kn=/^[A-Z]/,_r="c79-",Ue=e=>`${_r}${De(e[0].toLowerCase()+e.slice(1))}`,Ar=e=>kn.test(e)?Ue(e):Cr(e),Or=/<\/([A-Z][\w.-]*)(\s*)>/g,vr=/\/\s*$/,jr=(e,t)=>{if(!kn.test(e))return t;let n=` ${We}="${e}"`,s=vr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},Pr=e=>e.split(mt).map((t,n)=>n%2===1?t:t.replace(Pn,(s,r,i)=>{let o=i.replace(Tr,(l,a,u)=>u===void 0?l:`${a}${De(u)}`);return`<${Ar(r)}${jr(r,o)}>`}).replace(Nr,(s,r,i)=>`</slot.${De(r)}${i}>`).replace(Or,(s,r,i)=>`</${Ue(r)}${i}>`)).join(""),Ee="data-jq79",kr=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},Mn=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Ee]=t,Mn(n.children,t))})},Mr=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),i=r===-1?s:s.slice(0,r),o=r===-1?"":s.slice(r);return`${i}[${Ee}="${t}"]${o}`}).join(", "),Ln=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Mr(n.selectorText,t):n instanceof CSSGroupingRule&&Ln(n.cssRules,t)})},Lr=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Dr=/[a-z]/,Ir=e=>e.replace(Lr,(t,n,s)=>Dr.test(s)?`${n}${Ue(s)}`:t),Wr=/^\s*@(media|supports|container|layer|scope|document)\b/i,Fr=/^\s*@/,qr=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Fr.test(s)?Ir(n):n,n=""},l=u=>{o(),t+=u,s+=u},a=(u,c)=>{o(),t+=u,s="",c!==void 0?r.push(c):u==="}"&&r.pop()};for(let u=0;u<e.length;){let c=e[u];if(c==="/"&&e[u+1]==="*"){let p=e.indexOf("*/",u+2),w=p===-1?e.length:p+2;l(e.slice(u,w)),u=w}else if(c==='"'||c==="'"){let p=u+1;for(;p<e.length&&e[p]!==c;)p+=e[p]==="\\"?2:1;l(e.slice(u,Math.min(p+1,e.length))),u=p+1}else c==="{"?(a("{",Wr.test(s)),u++):c==="}"||c===";"?(a(c),u++):(n+=c,s+=c,u++)}return o(),t},Ur=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(e),Ln(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
|
package/package.json
CHANGED