jq79 0.3.19 → 0.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/dom.d.ts +4 -2
- package/dist/jq79.cjs +9 -9
- package/dist/jq79.cjs.map +1 -1
- package/dist/jq79.global.js +9 -9
- package/dist/jq79.global.js.map +1 -1
- package/dist/jq79.js +9 -9
- package/dist/jq79.js.map +1 -1
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
- package/src/dom.ts +35 -35
- package/src/jq79.ts +29 -10
- package/src/vite.ts +0 -1
package/dist/jq79.global.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var jq79=(()=>{var O=Object.defineProperty;var
|
|
2
|
-
`,
|
|
3
|
-
`||s===";"))return r;r++}return
|
|
4
|
-
`||
|
|
5
|
-
`||c===";"||c==="}"?s=!0:/\s/.test(c)||(s=!1),
|
|
6
|
-
${
|
|
7
|
-
;$__exports.done = true })()`)(
|
|
8
|
-
${S}`:S;
|
|
9
|
-
${E}`:E;
|
|
1
|
+
var jq79=(()=>{var O=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var pt=Object.prototype.hasOwnProperty;var ht=(t,e,n)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var mt=(t,e)=>{for(var n in e)O(t,n,{get:e[n],enumerable:!0})},gt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ut(e))!pt.call(t,s)&&s!==n&&O(t,s,{get:()=>e[s],enumerable:!(r=ft(e,s))||r.enumerable});return t};var yt=t=>gt(O({},"__esModule",{value:!0}),t);var b=(t,e,n)=>ht(t,typeof e!="symbol"?e+"":e,n);var zt={};mt(zt,{$:()=>T,$$:()=>A,$create:()=>M,$reactive:()=>_,Component79:()=>C,parseComponent:()=>qt,renderComponent:()=>Mt});function T(t,e){return typeof t=="string"?document.querySelector(t):t.querySelector(e)}function A(t,e){return Array.from(typeof t=="string"?document.querySelectorAll(t):t.querySelectorAll(e))}var M=(t,e={})=>{let n=document.createElement(t);for(let[r,s]of Object.entries(e))if(r==="className")n.className=Array.isArray(s)?s.join(" "):s;else if(r==="textContent")n.textContent=s;else if(r==="children")for(let i of s)n.appendChild(i);else n.setAttribute(r,s);return n},Et=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),G={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},St=new Set(["http:","https:","mailto:"]);function bt(t){try{let e=new URL(t,"https://example.com");return St.has(e.protocol)}catch{return!1}}function K(t,e){for(let n of Array.from(t.childNodes))if(n.nodeType===Node.ELEMENT_NODE){let r=$t(n);r&&e.appendChild(r)}else n.nodeType===Node.TEXT_NODE&&e.appendChild(n.cloneNode())}function $t(t){let e=t.tagName.toLowerCase();if(!Et.has(e))return null;let n=document.createElement(e);for(let r of Array.from(t.attributes)){let s=r.name.toLowerCase(),i=G[e]?.has(s),o=G["*"]?.has(s);!i&&!o||(s==="href"||s==="src")&&!bt(r.value)||n.setAttribute(s,r.value)}return e==="a"&&n.setAttribute("rel","noopener noreferrer"),K(t,n),n}function V(t){let e=new DOMParser().parseFromString(t,"text/html"),n=document.createElement("div");return K(e.body,n),n.innerHTML}var wt=(t,e)=>e.split(".").reduce((n,r)=>n?.[r],t),P=t=>{if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},Z=(t,e,n)=>{Object.entries(t).forEach(([r,s])=>{let i=e?`${e}.${r}`:r;s&&typeof s=="object"&&P(s)?Z(s,i,n):n(i,s)})},xt=(t,e)=>t===e||t.startsWith(`${e}.`)||e.startsWith(`${t}.`),v=[],X=t=>{v.push(new Set);try{return t()}finally{v.pop()}},_=t=>{let e=new Map,n=new Set,r=new Set,s=new WeakSet,i=(a,d,p=!1)=>{e.get(a)?.forEach(m=>m(d,a)),n.forEach(m=>m(a,d)),r.forEach(m=>{(p||Array.from(m.deps).some(g=>xt(g,a)))&&m.run()})},o=(a,d)=>{if(s.has(a))return a;Object.entries(a).forEach(([m,g])=>{g&&typeof g=="object"&&P(g)&&(a[m]=o(g,d?`${d}.${m}`:m))});let p=new Proxy(a,{get(m,g,u){return typeof g=="string"&&v[v.length-1]?.add(d?`${d}.${g}`:g),Reflect.get(m,g,u)},set(m,g,u,y){if(y!==p&&!Object.prototype.hasOwnProperty.call(m,g))return Reflect.set(m,g,u,y);let S=d?`${d}.${g}`:g;u&&typeof u=="object"&&P(u)&&(u=o(u,S));let x=!Object.prototype.hasOwnProperty.call(m,g);return m[g]=u,i(S,u,x),!0}});return s.add(p),p},c=o(t,""),f=(a,d,{immediate:p=!1}={})=>(e.has(a)||e.set(a,new Set),e.get(a).add(d),p&&d(wt(c,a),a),()=>e.get(a)?.delete(d)),h=(a,{immediate:d=!1}={})=>(n.add(a),d&&Z(c,"",(p,m)=>a(p,m)),()=>n.delete(a)),l=a=>{let d={deps:new Set,run:()=>{let p=new Set;v.push(p);try{a()}finally{v.pop(),d.deps=p}}};return r.add(d),d.run(),()=>{r.delete(d)}};return Object.defineProperty(c,"$on",{value:f,enumerable:!1}),Object.defineProperty(c,"$onAny",{value:h,enumerable:!1}),Object.defineProperty(c,"$effect",{value:l,enumerable:!1}),c},N=t=>{let e=[];return{effect:n=>{e.push(t.$effect(n))},onDispose:n=>{e.push(n)},dispose:()=>{e.splice(0).forEach(n=>n())}}};var J=/(?:let|var|const)\s+([A-Za-z_$][\w$]*)/y,Y=/\$:\s*/y,D=/import(?=\s*\()/y,Q=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,k=(t,e)=>{let n=t[e],r=e+1;for(;r<t.length;){if(t[r]==="\\"){r+=2;continue}if(t[r]===n)return r+1;r++}return t.length},F=(t,e)=>{let n=t.indexOf(`
|
|
2
|
+
`,e);return n===-1?t.length:n},B=(t,e)=>{let n=t.indexOf("*/",e+2);return n===-1?t.length:n+2},Rt=(t,e)=>{let n=0,r=e;for(;r<t.length;){let s=t[r];if(s==="'"||s==='"'||s==="`"){r=k(t,r);continue}if(s==="/"&&t[r+1]==="/"){r=F(t,r);continue}if(s==="/"&&t[r+1]==="*"){r=B(t,r);continue}if("([{".includes(s))n++;else if(")]}".includes(s))n--;else if(n<=0&&(s===`
|
|
3
|
+
`||s===";"))return r;r++}return t.length},nt=t=>{let e=[],n="",r=0,s=0,i=!0;for(;r<t.length;){let o=t[r],c=t[r+1];if(o==="'"||o==='"'||o==="`"){let f=k(t,r);n+=t.slice(r,f),r=f,i=!1;continue}if(o==="/"&&(c==="/"||c==="*")){let f=c==="/"?F(t,r):B(t,r);n+=t.slice(r,f),r=f;continue}if(o==="i"&&(r===0||!/[\w$.]/.test(t[r-1]))&&(D.lastIndex=r,D.test(t))){n+="$__import",r+=6,i=!1;continue}if(s===0&&i){J.lastIndex=r;let f=J.exec(t);if(f){e.push(f[1]),n+=f[1],r+=f[0].length,i=!1;continue}Y.lastIndex=r;let h=Y.exec(t);if(h){Q.lastIndex=r;let l=Q.exec(t);l&&e.push(l[1]);let a=r+h[0].length,d=Rt(t,a);n+=`$__effect(() => { ${t.slice(a,d)} });`,r=d;continue}}"([{".includes(o)?s++:")]}".includes(o)&&(s=Math.max(0,s-1)),o===`
|
|
4
|
+
`||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,r++}return{vars:e,code:n}},tt=/export\s+default(?![\w$])/y,et=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,Ct=t=>{let e=[],n=0,r=0;for(let s=0;s<=t.length;s++){let i=t[s];if(i==="{")n++;else if(i==="}")n--;else if(s===t.length||i===","&&n===0){let o=t.slice(r,s).trim();o&&e.push(o),r=s+1}}return e},Tt=(t,e,n)=>{let r=`await $__import(${JSON.stringify(e)})`;if(t===void 0)return r;let s=Ct(t),i=[],o=r;if(s.length>1){let c=`$__mod${n}`;i.push(`${c} = ${r}`),o=c}for(let c of s)c.startsWith("{")?i.push(`${c.replace(/\s+as\s+/g,": ")} = ${o}`):c.startsWith("*")?i.push(`${c.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${c} = $__default(${o})`);return`const ${i.join(", ")}`},rt=t=>{let e="",n=0,r=0,s=!0,i=!1,o=0;for(;n<t.length;){let c=t[n],f=t[n+1],h=n===0||!/[\w$.]/.test(t[n-1]);if(c==="'"||c==='"'||c==="`"){let l=k(t,n);e+=t.slice(n,l),n=l,s=!1;continue}if(c==="/"&&(f==="/"||f==="*")){let l=f==="/"?F(t,n):B(t,n);e+=t.slice(n,l),n=l;continue}if(c==="i"&&h){if(D.lastIndex=n,D.test(t)){e+="$__import",n+=6,s=!1;continue}if(r===0&&s){et.lastIndex=n;let l=et.exec(t);if(l){e+=Tt(l[1],l[3],o++),n+=l[0].length,s=!1;continue}}}if(c==="e"&&h&&r===0&&s){tt.lastIndex=n;let l=tt.exec(t);if(l){i=!0,e+="$__exports.default =",n+=l[0].length,s=!1;continue}}"([{".includes(c)?r++:")]}".includes(c)&&(r=Math.max(0,r-1)),c===`
|
|
5
|
+
`||c===";"||c==="}"?s=!0:/\s/.test(c)||(s=!1),e+=c,n++}return i?e:null};var ct=t=>Object.fromEntries(Array.from(t.attributes).map(e=>[e.name,e.value])),at=t=>({tag:t.tagName.toLowerCase(),attrs:ct(t),children:Array.from(t.childNodes).flatMap(e=>{if(e.nodeType===Node.TEXT_NODE){let n=e.textContent?.trim()??"";return n?[n]:[]}return e.nodeType===Node.ELEMENT_NODE?[at(e)]:[]})}),$=(t,e,n)=>{try{return new Function("$scope",...Object.keys(n??{}),`with ($scope) { return (${t}); }`)(e,...Object.values(n??{}))}catch{return}},vt=(t,e)=>t.replace(/{{\s*(.+?)\s*}}/g,(n,r)=>$(r,e)??""),lt=new Set([":attrs",":if",":elseif",":else",":each",":key",":with",":text",":html"]),Nt=/^\s*(\w+)\s+in\s+(.+)$/,Lt=(t,e,n,r)=>{let[s,...i]=e.slice(1).split("."),o=new Set(i);t.addEventListener(s,c=>{if(o.has("self")&&c.target!==t)return;o.has("prevent")&&c.preventDefault(),o.has("stop")&&c.stopPropagation();let f=$(n,r,{$event:c});typeof f=="function"&&f.call(t,c)},{once:o.has("once"),capture:o.has("capture")})},st=t=>t.replace(/-(\w)/g,(e,n)=>n.toUpperCase()),ot=(t,e)=>{let n=e.replace(/-/g,"").toLowerCase();for(let r=t;r&&r!==Object.prototype;r=Object.getPrototypeOf(r))for(let s of Object.keys(r))if(/^[A-Z]/.test(s)&&s.replace(/-/g,"").toLowerCase()===n)return s;return null},it=(t,e,n,r)=>{let s=document.createComment(t),i=document.createDocumentFragment();i.appendChild(s);let o={};Object.entries(e.attrs).forEach(([l,a])=>{if(!(lt.has(l)||l.startsWith("@")))if(l.startsWith(":")){let d=st(l.slice(1));o[d]=a||d}else o[st(l)]=JSON.stringify(a)});let c=null,f=null,h=null;return r.effect(()=>{let l=$(t,n),a=l instanceof C?l:null;if(a===f||(h?.dispose(),h=null,c?.destroy(),c=null,f=a,!a))return;let d=new C({template:a.template,scripts:a.scripts,styles:a.styles,modules:a.modules}),p=X(()=>Object.fromEntries(Object.entries(o).map(([u,y])=>[u,$(y,n)]))),m=document.createDocumentFragment();d.render(p).mount(m),s.parentNode.insertBefore(m,s.nextSibling);let g=N(n);Object.entries(o).forEach(([u,y])=>{g.effect(()=>{d.data[u]=$(y,n)})}),h=g,c=d}),r.onDispose(()=>{h?.dispose(),c?.destroy()}),i},_t=(t,e)=>{let n=()=>{let r=$(t,e);return r!==null&&typeof r=="object"?r:null};return new Proxy(e,{has(r,s){let i=n();return i!==null&&Reflect.has(i,s)||Reflect.has(r,s)},get(r,s){let i=n();return i!==null&&Reflect.has(i,s)?i[s]:Reflect.get(r,s)},set(r,s,i){let o=n();return o!==null&&Reflect.has(o,s)?(o[s]=i,!0):Reflect.set(r,s,i)}})},W=(t,e,n)=>{let r=t.attrs[":with"],s=r!==void 0?_t(r,e):e,i=ot(s,t.tag);if(i)return it(i,t,s,n);let o=document.createElement(t.tag);if(o instanceof HTMLUnknownElement||t.tag.includes("-")){let l=!1;n.effect(()=>{if(l)return;let a=ot(s,t.tag);a&&(l=!0,o.replaceWith(it(a,t,s,n)))})}Object.entries(t.attrs).forEach(([l,a])=>{l.startsWith("@")?Lt(o,l,a,s):lt.has(l)||o.setAttribute(l,a)});let c=t.attrs[":attrs"];if(c!==void 0){let l=[];n.effect(()=>{l.forEach(d=>o.removeAttribute(d));let a=$(c,s);l=a&&typeof a=="object"?Object.keys(a):[],l.forEach(d=>{let p=a[d];p!=null&&p!==!1&&o.setAttribute(d,String(p))})})}let f=t.attrs[":text"],h=t.attrs[":html"];return f!==void 0?n.effect(()=>{o.textContent=String($(f,s)??"")}):h!==void 0?n.effect(()=>{o.innerHTML=V(String($(h,s)??""))}):o.appendChild(U(t.children,s,n)),o},Ot=(t,e,n)=>{let r=document.createComment("if"),s=document.createDocumentFragment();s.appendChild(r);let i=null,o=null,c=null;return n.effect(()=>{let f=t.find(h=>h.expr===void 0||$(h.expr,e))??null;f!==o&&(c?.dispose(),i&&i.parentNode?.removeChild(i),i=null,o=f,f&&(c=N(e),i=W(f.node,e,c),r.parentNode.insertBefore(i,r.nextSibling)))}),s},I=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})},At=(t,e,n)=>{let r=t.attrs[":each"].match(Nt);if(!r)return document.createComment(`invalid :each expression "${t.attrs[":each"]}"`);let[,s,i]=r,o=t.attrs[":key"],{[":each"]:c,[":key"]:f,...h}=t.attrs,l={...t,attrs:h},a=document.createComment("each"),d=document.createDocumentFragment();d.appendChild(a);let p=[];return n.effect(()=>{let m=$(i,e),g=Array.isArray(m)?m:[],u=new Map(p.map(E=>[E.key,E])),y=g.map((E,L)=>{let w=Object.create(e);I(w,s,E),I(w,"$index",L);let q=o!==void 0?$(o,w):L,R=u.get(q);if(R&&Object.is(R.item,E))return I(R.scope,"$index",L),R;R?.fx.dispose(),R?.node.parentNode?.removeChild(R.node);let z=N(e);return{key:q,item:E,scope:w,fx:z,node:W(l,w,z)}}),S=new Set(y.map(E=>E.key));p.forEach(E=>{S.has(E.key)||(E.fx.dispose(),E.node.parentNode?.removeChild(E.node))});let x=a;y.forEach(E=>{x.nextSibling!==E.node&&a.parentNode.insertBefore(E.node,x.nextSibling),x=E.node}),p=y}),d},U=(t,e,n)=>{let r=document.createDocumentFragment(),s=0;for(;s<t.length;){let i=t[s];if(typeof i=="string"){let o=document.createTextNode("");n.effect(()=>{o.textContent=vt(i,e)}),r.appendChild(o),s++;continue}if(":each"in i.attrs){r.appendChild(At(i,e,n)),s++;continue}if(":if"in i.attrs){let o=[{expr:i.attrs[":if"],node:i}];for(s++;s<t.length&&typeof t[s]!="string"&&":elseif"in t[s].attrs;){let c=t[s];o.push({expr:c.attrs[":elseif"],node:c}),s++}s<t.length&&typeof t[s]!="string"&&":else"in t[s].attrs&&(o.push({node:t[s]}),s++),r.appendChild(Ot(o,e,n));continue}r.appendChild(W(i,e,n)),s++}return r},Mt=(t,e)=>U(t.template,e,N(e)),Dt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),jt=/<([A-Za-z][\w-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,Pt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,kt=t=>t.split(Pt).map((e,n)=>n%2===1?e:e.replace(jt,(r,s,i)=>Dt.has(s.toLowerCase())?r:`<${s}${i}></${s}>`)).join(""),Ft=t=>{let n=new DOMParser().parseFromString(`<template>${kt(t)}</template>`,"text/html").querySelector("template"),r=[],s=[],i=[];return Array.from(n.content.children).forEach(o=>{let c={attrs:ct(o),content:o.textContent??""};o.tagName==="SCRIPT"?r.push(c):o.tagName==="STYLE"?s.push(c):i.push(at(o))}),{template:i,scripts:r,styles:s}},H=t=>/\.html?([?#]|$)/.test(t)?C.fetch(t):import(t),j=new Map,Bt=t=>{let e=j.get(t);if(!e){let n=document.createElement("style");n.textContent=t,document.head.appendChild(n),e={el:n,count:0},j.set(t,e)}e.count++},It=t=>{let e=j.get(t);e&&--e.count<=0&&(e.el.remove(),j.delete(t))},dt={$:T,$$:A,$create:M,$reactive:_},Wt=(t,e,n,r={},s=H)=>{let i={...dt,...r},o=new Proxy(e,{has:(f,h)=>h!=="$__effect"&&h!=="$__import"&&(Reflect.has(f,h)||!(h in globalThis)&&!(h in i))});new Function("$scope","$__effect","$__import",...Object.keys(i),`return (async () => { with ($scope) { ${t} } })()`)(o,n,s,...Object.values(i)).catch(f=>console.error("jq79: error in :setup script",f))},Ut=t=>t&&t.default!==void 0?t.default:t,Ht=(t,e,n,r={},s=H)=>{let i={...dt,...r},o={},c=new Function("$__exports","$__default","$__import",...Object.keys(i),`return (async () => { "use strict";
|
|
6
|
+
${t}
|
|
7
|
+
;$__exports.done = true })()`)(o,Ut,s,...Object.values(i)),f=a=>console.error("jq79: error in factory script",a),h=!1,l=()=>{if(h)return;h=!0;let a=o.default;if(typeof a!="function")return;let d=p=>{p&&typeof p=="object"&&Object.assign(e,p)};try{let p=a({$data:e,$effect:n,...r});p instanceof Promise?p.then(d).catch(f):d(p)}catch(p){f(p)}};c.then(l,f),o.done&&l()},C=class t{constructor(e,n={}){b(this,"template");b(this,"scripts");b(this,"styles");b(this,"modules");b(this,"data",null);b(this,"fx",null);b(this,"content",null);b(this,"startMarker",null);b(this,"endMarker",null);b(this,"styleEls",[]);b(this,"ownsSharedStyles",!1);b(this,"useShadow",!1);b(this,"mountRoot",null);b(this,"resolveMounted",null);b(this,"emitListeners",new Map);let r=typeof e=="string"?Ft(e):e;this.template=r.template,this.scripts=r.scripts,this.styles=r.styles,this.modules=n.modules??(typeof e=="string"?void 0:e.modules)}static async fetch(e){let n=await fetch(e);if(!n.ok)throw new Error(`failed to fetch component from ${e}: ${n.status}`);return new t(await n.text())}on(e,n){return this.emitListeners.has(e)||this.emitListeners.set(e,new Set),this.emitListeners.get(e).add(n),this}off(e,n){return this.emitListeners.get(e)?.delete(n),this}render(e={}){return this.renderWith(e,!1)}renderShadow(e={}){return this.renderWith(e,!0)}renderWith(e,n){this.destroy();let r=_({...e}),s=N(r);this.data=r,this.fx=s,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let i=this.startMarker,o=(u,y)=>{let S=new CustomEvent(u,{detail:y,bubbles:!0,composed:!0}),x=i.dispatchEvent(S);return i===this.startMarker&&this.emitListeners.get(u)?.forEach(E=>E(S,y)),x},c,f=new Promise(u=>{c=u});this.resolveMounted=c;let h=()=>f,l=this.endMarker,a=u=>{let y=[];for(let S=i.nextSibling;S&&S!==l;S=S.nextSibling)S instanceof Element&&(S.matches(u)&&y.push(S),y.push(...Array.from(S.querySelectorAll(u))));return y},d=u=>a(u)[0]??null,p=this.modules,m=u=>p&&u in p?Promise.resolve(p[u]):H(u);this.scripts.forEach(u=>{let y={$emit:o,$mounted:h,$self:d,$$self:a},S=rt(u.content);if(S!==null){let w=":mounted"in u.attrs?`await $mounted();
|
|
8
|
+
${S}`:S;Ht(w,r,s.effect,y,m);return}let{vars:x,code:E}=nt(u.content);x.forEach(w=>{w in r||(r[w]=void 0)});let L=":mounted"in u.attrs?`await $mounted();
|
|
9
|
+
${E}`:E;Wt(L,r,s.effect,y,m)});let g=document.createDocumentFragment();return g.append(this.startMarker,U(this.template,r,s),this.endMarker),this.content=g,n?this.styleEls=this.styles.map(u=>{let y=document.createElement("style");return y.textContent=u.content,y}):(this.styles.forEach(u=>Bt(u.content)),this.ownsSharedStyles=!0),this}mount(e,n){let r=typeof e=="string"?T(e):e;if(!r)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(r)}mountShadow(e,n){let r=typeof e=="string"?T(e):e;if(!r)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(r)}attach(e){this.mountRoot&&this.detach();let n=this.useShadow&&e instanceof Element?e.shadowRoot??e.attachShadow({mode:"open"}):e;return this.useShadow&&this.styleEls.forEach(r=>n.appendChild(r)),n.appendChild(this.content),this.mountRoot=n,this.resolveMounted?.(),this}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;let e=this.startMarker;for(;e;){let n=e.nextSibling;if(this.content.appendChild(e),e===this.endMarker)break;e=n}return this.mountRoot=null,this}destroy(){return this.detach(),this.fx?.dispose(),this.fx=null,this.styleEls.forEach(e=>e.parentNode?.removeChild(e)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(e=>It(e.content)),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}},qt=t=>new C(t);return yt(zt);})();
|
|
10
10
|
//# sourceMappingURL=jq79.global.js.map
|