@wcstack/state 4.0.2 → 4.0.3
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.ja.md +4 -4
- package/README.md +4 -4
- package/dist/auto.min.js +1 -1
- package/dist/auto.min.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/split/chunks/chunk-TD4XQCEX.js +2 -0
- package/dist/split/chunks/{chunk-SGLI2TU4.js.map → chunk-TD4XQCEX.js.map} +1 -1
- package/dist/split/core.js +1 -1
- package/dist/split/features/devtools.js +1 -1
- package/dist/split/features/ssr.js +1 -1
- package/package.json +1 -1
- package/dist/split/chunks/chunk-SGLI2TU4.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VERSION","r"],"sources":["../../../package.json","../../../src/version.ts"],"sourcesContent":["{\n \"name\": \"@wcstack/state\",\n \"version\": \"4.0.
|
|
1
|
+
{"version":3,"names":["VERSION","r"],"sources":["../../../package.json","../../../src/version.ts"],"sourcesContent":["{\n \"name\": \"@wcstack/state\",\n \"version\": \"4.0.3\",\n \"description\": \"Reactive state management with declarative data binding for Web Components. Zero dependencies, buildless.\",\n \"type\": \"module\",\n \"main\": \"./dist/index.esm.js\",\n \"module\": \"./dist/index.esm.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.esm.js\"\n },\n \"./auto\": \"./dist/auto.min.js\",\n \"./core\": {\n \"types\": \"./dist/split/core.d.ts\",\n \"import\": \"./dist/split/core.js\"\n },\n \"./features/*\": {\n \"types\": \"./dist/split/features/*.d.ts\",\n \"import\": \"./dist/split/features/*.js\"\n },\n \"./define\": {\n \"types\": \"./dist/define.d.ts\",\n \"import\": \"./dist/define.js\"\n },\n \"./manifest\": {\n \"types\": \"./dist/manifest.d.ts\",\n \"import\": \"./dist/manifest.esm.js\"\n },\n \"./parser\": {\n \"types\": \"./dist/parser.d.ts\",\n \"import\": \"./dist/parser.esm.js\"\n },\n \"./wcs-manifest.json\": \"./dist/wcs-manifest.json\"\n },\n \"files\": [\n \"dist\",\n \"!dist/core.min.js\"\n ],\n \"scripts\": {\n \"clean\": \"node -e \\\"require('node:fs').rmSync('dist', { recursive: true, force: true })\\\"\",\n \"build\": \"node build.mjs\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage\",\n \"lint\": \"eslint src\",\n \"typecheck\": \"tsc --noEmit\",\n \"golden\": \"node scripts/golden.mjs\",\n \"version:patch\": \"npm version patch\",\n \"version:minor\": \"npm version minor\",\n \"version:major\": \"npm version major\",\n \"prepublishOnly\": \"npm run build && npm run test:coverage\"\n },\n \"keywords\": [\n \"web-components\",\n \"state-management\",\n \"reactive\",\n \"data-binding\",\n \"proxy\",\n \"custom-elements\",\n \"shadow-dom\",\n \"buildless\",\n \"zero-dependencies\",\n \"declarative\"\n ],\n \"author\": \"mogera551\",\n \"homepage\": \"https://wcstack.github.io\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/wcstack/wcstack.git\",\n \"directory\": \"packages/state\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/wcstack/wcstack/issues\"\n },\n \"license\": \"MIT\",\n \"devDependencies\": {\n \"@eslint/js\": \"^9.39.5\",\n \"@vitest/coverage-v8\": \"^4.1.11\",\n \"esbuild\": \"0.27.2\",\n \"eslint\": \"^9.39.5\",\n \"globals\": \"^16.5.0\",\n \"happy-dom\": \"^20.0.11\",\n \"rollup\": \"^4.63.5\",\n \"rollup-plugin-dts\": \"^6.5.1\",\n \"terser\": \"^5.51.2\",\n \"typescript\": \"^5.9.3\",\n \"typescript-eslint\": \"^8.70.1\",\n \"vitest\": \"^4.0.15\"\n }\n}\n","import pkg from \"../package.json\" with { type: \"json\" };\n\n/** The package version: stamped into `<wcs-ssr>`, compared on hydration (major.minor), shown by DevTools. */\nexport const VERSION: string = pkg.version;\n"],"mappings":"AAAA,ICGaA,EDDA,eCCsBC","ignoreList":[]}
|
package/dist/split/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunks/chunk-
|
|
1
|
+
import{a as s}from"./chunks/chunk-TD4XQCEX.js";import{a as n,d as t,e as u}from"./chunks/chunk-DFXQ7MFW.js";import"./chunks/chunk-V6VVL4F3.js";import"./chunks/chunk-BMGEWHCR.js";import"./chunks/chunk-PHAN6L23.js";import{g as a,h as c,i as h}from"./chunks/chunk-EM3Y3SJS.js";import{c as i}from"./chunks/chunk-6MACFEK7.js";import"./chunks/chunk-ZN52NEIB.js";import"./chunks/chunk-TUQ3OPZQ.js";import"./chunks/chunk-M656SMUU.js";import{g as o}from"./chunks/chunk-4NJBYXIT.js";function r(s){return s}export{a as TRUSTED_TYPES_POLICY_SLOT,s as VERSION,t as bootstrapState,u as buildBindings,r as defineState,n as getBindingsReady,i as getConfig,c as getTrustedTypesPolicy,o as installFeatures,h as setTrustedTypesPolicy};
|
|
2
2
|
//# sourceMappingURL=core.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"../chunks/chunk-
|
|
1
|
+
import{a as e}from"../chunks/chunk-TD4XQCEX.js";import{c as t,d as n,e as l,f as o,g as s,h as r,i as a,n as i}from"../chunks/chunk-BMGEWHCR.js";import"../chunks/chunk-PHAN6L23.js";import"../chunks/chunk-EM3Y3SJS.js";import"../chunks/chunk-6MACFEK7.js";import"../chunks/chunk-ZN52NEIB.js";import"../chunks/chunk-TUQ3OPZQ.js";import"../chunks/chunk-M656SMUU.js";import{a as u,b as d}from"../chunks/chunk-4NJBYXIT.js";var f="__WCSTACK_DEVTOOLS_HOOK__",c=null,m=new Set,p=(e,t,n)=>({absolutePathInfo:{pathInfo:{path:t.t},stateElement:e.element},listIndex:null===n?null:{indexes:e.H(n)}}),h=new WeakMap,k=0;var v=new WeakMap;function g(e){if(null===c)return;let i=v.get(e),u=m.has(e)?function(e,i){let u=new Map,d=new Set,f=(r,a,d,f,c,m)=>{if(r===s)return;let v=function(e,s){return e===t?"textContent":e===n?`class.${s}`:e===l?`attr.${s}`:e===o?`style.${s}`:s}(r,a),g=0===f.n?null:c,w=`${(e=>{let t=h.get(e);return void 0===t&&h.set(e,t=++k),t})(d)}|${v}|${f.t}|${null===g?"":e.H(g).join(",")}`;if(u.has(w))return;let y=i?.get(w);u.set(w,y??{binding:{propName:v,statePathName:f.t,bindingType:m,node:d,replaceNode:d},absoluteAddress:p(e,f,g)})},c=e=>f(e.i,e.name,e.a,e.o,e.r,e.nn()),m=e=>{if(!d.has(e)){if(d.add(e),null!==e.he)for(let t of e.he)c(t);if(e instanceof r&&null!==e.fe){let n=e.F.ze;for(let l=0;l<n.length;l++){let o=e.V?.[l];void 0!==o?c(o):f(n[l].i,n[l].name,e.fe[2*l],n[l].o,e.r,n[l].i===t?"text":"prop")}}if(null!==e.c)for(let t of e.c)v(t)}},v=e=>{if(!d.has(e))if(d.add(e),e instanceof a){f(-1,"for",e.S,e.l.o,e.l.ae,"for");for(let t of e.xe)m(t)}else null!==e.O&&m(e.O)};for(let t of e.ce.values())for(let e of t)c(e),null!==e._&&v(e._);for(let t of e.oe.values())if(null!==t.E&&v(t.E),null!==t.L)for(let e of t.L)v(e);return u}(e,i):new Map;if(void 0!==i)for(let[e,t]of i)u.has(e)||c({type:"state:binding-removed",...t});for(let[e,t]of u)(void 0===i||!i.has(e))&&c({type:"state:binding-added",...t});v.set(e,u)}function w(e){let t=i.get(e);if(void 0===t)throw new Error("[@wcstack/state] devtools: no state tree on this root");return t}function y(e){let t=new Set,n=new Set,l=new Set,o=new Set;for(let s of e.I.all()){for(let e=1;e<=s.n;e++)t.add(s.h[e].t);"*"===s.s&&n.add(s.t),null!==s.getter&&l.add(s.t),null!==s.ie&&o.add(s.t)}let s=e.target;return{rootNode:e.root,element:e.element,paths:{list:t,element:n,getter:l,setter:o},commandTokenNames:new Set(Object.keys(e.commands)),eventTokenNames:new Set(e.Re.keys()),staticDependency:new Map,dynamicDependency:new Map,watchPaths:null!==s.$watch&&"object"==typeof s.$watch?new Set(Object.keys(s.$watch)):null,keyedListPaths:null!==s.$listKeys&&"object"==typeof s.$listKeys?new Set(Object.keys(s.$listKeys)):null}}var S=new WeakSet,b=new WeakMap;function j(e,t){if(("mounting"===t||"reset"===t)&&function(e){let t=(t,n)=>{if(S.has(t))return;S.add(t);let l=t.emit;t.emit=(...o)=>(null!==c&&c({type:"state:token-emit",kind:n,tokenName:t.name,args:o,subscriberCount:t.size,stateElement:e.element}),l.apply(t,o))};for(let n of Object.values(e.commands))t(n,"command");for(let n of e.Re.values())t(n,"event")}(e),"connected"===t){if(m.has(e))return;m.add(e),c?.({type:"state:element-registered",rootNode:e.root,element:e.element}),g(e)}else"disconnected"===t&&(m.delete(e),g(e),c?.({type:"state:element-unregistered",rootNode:e.root,element:e.element}))}function $(e,t,n,l,o,s){if(null===c)return;let r=p(e,t,0===t.n?null:n),a=b.get(e);void 0===a&&b.set(e,a=new Set),a.add(r),s&&c({type:"state:write",absoluteAddress:r,value:o,oldValue:l,hasOldValue:!0})}function M(e){if(null===c)return;let t=b.get(e);b.delete(e),void 0!==t&&c({type:"state:update-batch",addresses:t}),g(e)}function E(e,t,n){c?.({type:"state:binding-apply-error",path:n.o.t,bindingType:n.nn(),error:t})}var O={name:"devtools",install(){u.element=d(u.element,j),u.be=d(u.be,$),u.Fe=d(u.Fe,M),u.Ke=d(u.Ke,E),function(){if(typeof document>"u"||document.documentElement?.hasAttribute("data-wcs-server"))return;let t=globalThis,n=t[f]??(t[f]=function(){let e=new Map,t=new Set,n=e=>{0===t.size?e._setSink(null):e._setSink(n=>{for(let l of t)l.onEvent?.(e.id,n)})};return{version:2,sources:e,register(l){if(!e.has(l.id)){e.set(l.id,l),n(l);for(let e of t)e.onSourceRegistered?.(l)}},unregister(n){let l=e.get(n);if(void 0!==l){l._setSink(null),e.delete(n);for(let e of t)e.onSourceUnregistered?.(n)}},addListener(l){t.add(l);for(let t of e.values())n(t),l.onSourceRegistered?.(t);return()=>{if(t.delete(l))for(let t of e.values())n(t)}}}}());2!==n.version&&console.warn(`[@wcstack/state] devtools hook registry version ${n.version}, expected 2: keeping the existing one.`),n.register({id:`state:${Math.random().toString(36).slice(2,10)}`,kind:"state",packageVersion:e,getStateElements:()=>[...m].map(y),overlays:()=>[],keyedSubscriptions:e=>function(e){let t=[];for(let n of e.I.all()){let l=n.W,o=n.Ce?.length??0;if((null===l||0===l.size)&&0===o)continue;let s,r=0;if(null!==l)for(let e of l.values())r+=e.size;try{s=0===n.n?e.v(n,null):void 0}catch{s=void 0}t.push({path:n.t,tracked:!1,rows:r,keys:null===l?0:l.size,lists:o,lastValue:s})}return t}(w(e)),keys(e){let t=w(e).target;return Object.keys(t).filter(e=>{if(e.includes("*")||"$"===e[0])return!1;let n=Object.getOwnPropertyDescriptor(t,e);return void 0!==n.get||"function"!=typeof n.value})},read(e,t,n){let l;return w(e).element.createState("readonly",e=>{l=e.$resolve(t,n??[])}),l},write(e,t,n,l){w(e).element.createState("writable",e=>{e.$resolve(t,l??[],n)})},_setSink(e){let t=null===c&&null!==e;c=e,null===e&&(v=new WeakMap),u.st=e&&((e,t)=>c?.({...t,stateElement:e.element})),t&&queueMicrotask(()=>{for(let e of m)g(e)})}})}()}},N=O;export{N as default,O as devtools};
|
|
2
2
|
//# sourceMappingURL=devtools.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"../chunks/chunk-SGLI2TU4.js";import{b as t,c as l}from"../chunks/chunk-DFXQ7MFW.js";import"../chunks/chunk-V6VVL4F3.js";import{a as n,i as r,j as o,k as i,l as s,m as a}from"../chunks/chunk-BMGEWHCR.js";import"../chunks/chunk-PHAN6L23.js";import"../chunks/chunk-EM3Y3SJS.js";import{a as c}from"../chunks/chunk-6MACFEK7.js";import"../chunks/chunk-ZN52NEIB.js";import"../chunks/chunk-TUQ3OPZQ.js";import"../chunks/chunk-M656SMUU.js";import{a as u,b as f}from"../chunks/chunk-4NJBYXIT.js";var d=e=>e.split(".").slice(0,2).join("."),p=class extends t{static find(e){return e.querySelector?.(c.tagNames.ssr)??null}get version(){return this.getAttribute("version")??""}get stateData(){let e=this.querySelector('script[type="application/json"]');return null===e?{}:JSON.parse(e.textContent||"{}")}get templates(){let e=new Map;for(let t of Array.from(this.children))"template"===t.localName&&e.set(t.id,t);return e}get hydrateProps(){return{}}getTemplate(e){return this.templates.get(e)??null}verifyVersion(){return d(this.version)===d(e)}};function m(e){let t=c.tagNames.ssr;void 0===e.get(t)&&e.define(t,class extends p{})}var h=()=>c.tagNames.ssr,g=Symbol.for("wcstack.ssr.snapshotBuilder"),b=()=>!0===document.documentElement?.hasAttribute("data-wcs-server"),v=e=>document.createComment(e),y=(e,t)=>null!==e&&8===e.nodeType&&e.data===t,w=(e,t)=>null!==e&&8===e.nodeType&&e.data.startsWith(t),N=new WeakMap,S=new WeakMap,A=new WeakMap,x=new WeakSet,k=new WeakMap;function $(e,t){let l=[];for(let n=e;null!==n&&(l.push(n),n!==t);n=n.nextSibling);return l}function T(e,t,...l){for(let l of Array.from(e.attributes))t.setAttribute(l.name,l.value);return(t.content??t).append(...l),t}var j=e=>null===e.D?e.Ue:e.D[e.D.length-1];function W(e,t,l){let n=[v(null===l?"wcs-[":`wcs-[:${l}`)];for(let e of t)null===l&&n.push(v("wcs-|")),n.push(...$(e.Ue,j(e)));n.push(v("wcs-]")),e.after(...n);for(let e of n)x.add(e)}function q(e){if(e instanceof r){W(e.S,e.xe,null);for(let t of e.xe)C(t);return}let t=e.O;null!==t&&(W(e.G[e.G.length-1].S,[t],e.b),C(t))}function C(e){if(null!==e.c)for(let t of e.c)q(t)}var E=new Set(["script","style","template","textarea","title"]),O="data-wcs-raw",M=e=>E.has(e.localName)||e.localName===h();function I(e){for(let t of Array.from(e.childNodes))3===t.nodeType?""===t.data?t.replaceWith(v("wcs-e")):null!==t.nextSibling&&3===t.nextSibling.nodeType&&t.after(v("wcs-s")):1===t.nodeType&&!M(t)&&I(t)}var U=0;function P(t,l){let n=t.getRootNode(),r=[l];for(let e of S.get(n)??[])e!==l&&!0===e.element?.hasAttribute("bind-component")&&r.push(e);let o=new Map;for(let e of r){let t=N.get(e);if(void 0===t)continue;let l=new Map;for(let t of e.oe.values())if(null!==t.E&&l.set(t.E.S,t.E),null!==t.L)for(let e of t.L)l.set(e.S,e);for(let t of e.ce.values())for(let e of t)if(null!==e._)for(let t of e._.G)l.set(t.S,e._);let n=new Set;for(let[e,r]of t){o.set(e,r);let t=l.get(e);void 0!==t&&!n.has(t)&&e.isConnected&&(n.add(t),q(t))}}for(let e of Array.from(n.querySelectorAll("*"))){let t=A.get(e);if(void 0!==t){let l=document.createTreeWalker(e,133,{acceptNode:e=>x.has(e)||1===e.nodeType&&t.has(e)&&G(e)?2:1}),n=[];for(let e=l.nextNode();null!==e;e=l.nextNode()){let l=e.previousSibling;(3===e.nodeType?e.data.includes("{{")&&!(M(e.parentNode)?k.has(e):t.has(l)&&w(l,"wcs-t:"))&&(k.has(e)||t.get(e)!==e.data):!t.has(e))&&n.push(e)}for(let e of n)e.remove()}let l=Array.from(e.childNodes);M(e)&&l.some(e=>k.has(e))&&e.setAttribute(O,l.map(e=>k.has(e)?`{{ ${k.get(e)} }}`:8===e.nodeType?`\x3c!--${e.data}--\x3e`:e.textContent).join(""))}I(9===n.nodeType?n.body:n);let i=document.createElement(h());i.setAttribute("version",e);let s=document.createElement("script");s.type="application/json",s.textContent=function(e){return JSON.stringify(e).replace(/[<>&\u2028\u2029]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`)}(function(e){let t={};for(let l of Object.keys(e)){if("$"===l[0])continue;let n=Object.getOwnPropertyDescriptor(e,l);void 0!==n.get||void 0!==n.set||"function"==typeof n.value||(t[l]=n.value)}return t}(l.target)),i.append(s);for(let[e,t]of o){if(!e.isConnected)continue;let l=e.parentNode;for(;null!==l&&"svg"!==l.localName&&"foreignObject"!==l.localName;)l=l.parentElement;let n="svg"===l?.localName,r=`wcs-${n?"s":"t"}${U++}`;e.replaceWith(v(`wcs-p:${r}`));let o=document.importNode(a(t),!0);for(let e of Array.from(o.querySelectorAll("template")))"http://www.w3.org/2000/svg"===e.namespaceURI&&e.replaceWith(T(e,document.createElement("template"),...e.childNodes));if(n){let e=document.createElementNS(l.namespaceURI,"svg");e.append(o),o=e}let s=document.createElement("template");s.id=r,i.append(T(t,s,o))}t.before(i)}function R(e){!function(e){if(null!==e.querySelector(c.tagNames.state))for(let t of Array.from(e.querySelectorAll("input,textarea,select")))if("select"===t.localName){let e=Array.from(t.options);if(t.multiple||e.some(e=>e.hasAttribute("selected"))||e[t.selectedIndex]!==e.find(e=>!e.disabled))for(let t of e)t.toggleAttribute("selected",t.selected)}else"textarea"===t.localName?t.value!==t.defaultValue&&!t.value.includes("{{")&&!Array.from(t.childNodes).some(e=>k.has(e))&&(t.textContent=t.value):"checkbox"===t.type||"radio"===t.type?t.toggleAttribute("checked",t.checked):"password"!==t.type&&t.value!==t.defaultValue&&t.setAttribute("value",t.value)}(e);for(let t of Array.from(e.querySelectorAll(`${c.tagNames.state}[enable-ssr]`))){if(t.hasAttribute("mount")||t.hasAttribute("bind-component")||t.previousElementSibling?.localName===h())continue;let e=t.engine;null!=e&&P(t,e)}}var D=Symbol.for("wcstack.state.ssr.impl"),J=new Map,V=new WeakMap,G=e=>!0===u.$o?.(e),L=e=>1===e.nodeType&&!M(e)&&!G(e),B=e=>e.f.flat().concat(e.q??[]),F=e=>{for(let t of B(e))t.remove()};function Q(e,t,l){let n=/^wcs-\[(?::(\d+))?/.exec(e.data),r=e.previousSibling,o=e.parentNode,i=[],a=e.nextSibling;for(e.remove();null!==a&&!y(a,"wcs-]");){let e=a.nextSibling;if(y(a,"wcs-|"))i.push([]),a.remove();else{0===i.length&&i.push([]);let l=i[i.length-1];w(a,"wcs-[")?e=Q(a,t,l):(l.push(a),L(a)&&_(a,t))}a=e}let c={branch:void 0===n[1]?null:Number(n[1]),f:i,q:a??o.appendChild(v("wcs-]"))},u=B(c);a=c.q.nextSibling;for(let e of u)l?.push(e),t&&s.add(e);return t&&null!==r?J.set(r,c):F(c),a}function _(e,t){for(let l=e.firstChild;null!==l;)w(l,"wcs-[")?l=Q(l,t):(L(l)&&_(l,t),l=l.nextSibling)}function z(e,t,l){let n=e=>{for(let r of Array.from(e.childNodes))if(r.parentNode===e)if(8===r.nodeType){let e=r.data;try{if("wcs-s"===e)r.remove();else if("wcs-e"===e)r.replaceWith("");else if(e.startsWith("wcs-t:")){let t=v(`@@:${decodeURIComponent(e.slice(6))}`),l=r.nextSibling;for(;null!==l&&!y(l,"wcs-/t");){let e=l.nextSibling;l.remove(),l=e}l?.remove(),r.replaceWith(t)}else if(e.startsWith("wcs-p:")){let l=t.querySelector(`template[id="${e.slice(6)}"]`);if(null!==l){let t=r.parentNode,n="s"===e[10]?T(l,document.createElementNS(t.namespaceURI,"template"),...document.importNode(l.content.firstChild,!0).childNodes):document.importNode(l,!0);n.removeAttribute("id"),t.replaceChild(n,r)}}}catch{}}else 1===r.nodeType&&!M(r)&&(G(r)?V.set(r,{ssr:t,Oe:l}):n(r))};n(e),function(e){for(let t of Array.from(e.querySelectorAll("table > tbody"))){let e=[];for(let l=t.previousSibling;null!==l&&(8===l.nodeType||te(l)||"template"===l.localName);l=l.previousSibling)e.unshift(l);let l=0,n=0;if(e.forEach((e,t)=>{w(e,"wcs-[")?n++:y(e,"wcs-]")&&--n<0&&(n=0,l=t+1)}),0===n)continue;let r=0;for(let n=t.firstChild;null!==n;n=n.nextSibling)if(w(n,"wcs-["))r++;else if(y(n,"wcs-]")&&0===r--){t.prepend(...e.slice(l));break}}}(e),_(e,l)}function H(e){let t=V.get(e);if(void 0===t||(V.delete(e),z(e,t.ssr,t.Oe),!t.Oe))return null;let l=u.Oe;return u.Oe=re,()=>{u.Oe=l,X()}}function X(){for(let e of J.values())F(e);J.clear()}function Y(e){let t=[];for(let l=document.createTreeWalker(e,128);l.nextNode();)t.push(l.currentNode);return t}function Z(e,t,l,n){let r=null;for(let n of e){let e=n[l];null!==e&&(""===e||t===e||t.startsWith(`${e}.`))&&(null===r||e.length>r[l].length)&&(r=n)}let o=r?.[n];if(null==o)return null;let i=r[l],s=""===i?t:t.slice(i.length+1);return""===o?s:""===s?o:`${o}.${s}`}function K(e,t,l){if(b()){if(l instanceof Array){for(let e=l.length;e-- >0;)o(l[e])&&l.splice(e,1);let e=t;if(l.some(i))x.add(e);else if(e.localName.includes("-")&&!G(e)){let t=new Map;for(let l=document.createTreeWalker(e,133);l.nextNode();)t.set(l.currentNode,l.currentNode.data);A.set(e,t)}return}if("string"==typeof l){if(k.set(t,l),M(t.parentNode))return;let e=v(`wcs-t:${encodeURIComponent(l)}`),n=v("wcs-/t");return t.before(e),void t.after(n)}let n=N.get(e);void 0===n&&N.set(e,n=new Map),n.set(t,l);let r=t.getRootNode(),s=S.get(r);return void 0===s&&S.set(r,s=new Set),void s.add(e)}if("string"!=typeof l&&J.size>0){let e=J.get(l);void 0!==e&&(J.delete(l),J.set(t,e))}}var ee=e=>null!==e&&8===e.nodeType&&[c.commentIfPrefix,c.commentElseIfPrefix,c.commentElsePrefix].includes(e.data),te=e=>3===e.nodeType&&""===e.data.trim(),le=e=>(J.get(e)?.q??e).nextSibling;function ne(e,t){if(t.length!==e.sn.childNodes.length)return!1;let l=e.On;for(let n=0;n<l.length;n++){let r=l[n],o=e.sn,i=t[r[0]];for(let e=0;;){if(o=o.childNodes[r[e]],i?.nodeName!==o.nodeName)return!1;if(++e===r.length)break;i=i.firstChild;for(let t=r[e];t>0&&null!==i;t--)i=le(i)}e.ko[n]=i}return!0}function re(e,t,l){if(0===J.size)return null;let n=t,r=0;if(!l){let e=c.commentIfPrefix;if(!y(t,e))for(let l=t.previousSibling;null!==l&&1!==l.nodeType&&(ee(l)&&r++,!y(l,e));l=l.previousSibling);for(let l=t.nextSibling;!J.has(n)&&null!==l&&!y(l,e)&&1!==l.nodeType;l=l.nextSibling)ee(l)&&(n=l)}let o=J.get(n);if(void 0===o)return null;if(!l&&o.branch!==r)return J.delete(n),F(o),null;let i=o.f.shift();if(0===o.f.length&&J.delete(n),o.q?.replaceWith(...$(t,n)),o.q=null,void 0===i)return null;let s=[];for(let e=0;e<i.length;e++){let t=J.get(i[e]);if(s.push(i[e]),void 0!==t)for(;e<i.length&&i[e]!==t.q;)e++}if(!ne(e,s)){let l=(e.In?e.root:e.sn).cloneNode(!0);s=e.In?[l]:[...l.childNodes],ne(e,s),(i[0]??o.f.find(e=>e.length>0)?.[0]??t).before(l);for(let e of i)e.remove()}return s}var oe={name:"ssr",install(){u.jn=K,u.hr=H;let t=u.element;u.element=(l,r)=>{"mounting"===r&&function(t){let l=t.element;if(!l.hasAttribute("enable-ssr")||b())return;let r=l.previousElementSibling,o=r?.localName===h(),i=o?r.getAttribute("version"):null,s=null===i||d(i)===d(e);if(s){let e=t,l=e.ke;e.ke=(e,n)=>"$connectedCallback"===e?void 0:l.call(t,e,n)}if(!o)return;let a=!s&&parseInt(i)<4,f=/^3\.(\d+)\.(\d+)$/.exec(i),p=null!==f&&(+f[1]-5||+f[2]-3)>=0;s||console.warn(`[@wcstack/state] <${h()} version="${i}"> does not match ${e}: its snapshot is discarded, and the page renders on the client from its own state.${a&&!p?" 3.x output keeps only the path of a text binding outside a template, so such a binding loses its filters: deploy @wcstack/server 4.0 with this client.":""}`);let m=s?r.querySelector('script[type="application/json"]'):null;if(null!==m){let e=JSON.parse(m.textContent||"{}"),l=t.target;for(let t of Object.keys(e)){let n=Object.getOwnPropertyDescriptor(l,t);void 0!==n&&(void 0!==n.get||void 0!==n.set||"function"==typeof n.value)||(l[t]=e[t])}t.hydrated=!0}let g=l.getRootNode();for(let e of Array.from(g.querySelectorAll(`[${O}]`)))e.textContent=e.getAttribute(O),e.removeAttribute(O);let w=9===g.nodeType?g.body:g;a?function(e,t,l){let r=new Map,o=e=>{let t=e.parentElement;for(;null!==t&&!G(t);)t=t.parentElement;if(null===t)return null;let l=r.get(t);if(void 0===l){let e=o(t),i=t.querySelector(`:scope > ${c.tagNames.state}[bind-component]`).getAttribute("bind-component");r.set(t,l=[]);for(let r of n(t.getAttribute(c.bindAttributeName)??"")){let t=r.Je;r.$e[0]===i&&l.push([e?Z(e,t,1,0):t,r.$e.slice(1).join("."),e&&t])}}return l},i=(e,t,l)=>{let n=o(e);if(null===n)return t;let r=/^([^|]*)#m\d+\.([^|]*)$/.exec(t);if(null===r)return l?t:Z(n,t,0,1)??t;let i=r[1].replace(/#m\d+\./g,"").slice(0,-1);return n.some(e=>""===e[1]&&(e[0]===i||e[2]===i))?r[2]:Z(n,r[2],2,1)??r[2]};for(let t of Y(e).reverse()){let e=/^@@wcs-(\w+)-start:([\s\S]*)/.exec(t.data);if(null===e)continue;let n=t.nextSibling;for(;null!==n&&!y(n,`@@wcs-${e[1]}-end:${e[2]}`);)n=n.nextSibling;if(null!==n){for(;t.nextSibling!==n;)t.nextSibling.remove();n.remove(),t.replaceWith(..."text"===e[1]?[v(`@@:${i(t,e[2],l)}`)]:[])}}let s=(e,l)=>{for(let n of Y(e)){let e=/^@@wcs-(?:for|if|elseif|else):(\S+)$/.exec(n.data)?.[1],r=Array.from(t.querySelectorAll("template")).find(t=>t.id===e);if(void 0===r)continue;let o=document.importNode(r,!0),a=c.bindAttributeName;o.removeAttribute("id"),o.setAttribute(a,o.getAttribute(a).replace(/^(\s*\w+\s*:\s*)([^\s|]+)/,(e,t,r)=>t+i(l??n,r))),s(o.content,l??n);let u=o.content.firstChild;n.replaceWith(.../^\s*elseif\s*:/.test(u?.getAttribute?.(a)??"")?o.content.childNodes:[o])}};s(e);for(let t of Array.from(e.querySelectorAll("[data-wcs-ssr-id]")))t.removeAttribute("data-wcs-ssr-id")}(w,r,p):z(w,r,s),r.remove(),s&&(u.Oe=re,queueMicrotask(()=>{X(),u.Oe=null}))}(l),t?.(l,r)},function(){let e=globalThis;e[D]={build:R,reset(){U=0}},void 0===e[g]&&(e[g]={protocol:"wcs-ssr-snapshot",version:1,build:t=>e[D].build(t),reset:()=>e[D].reset()})}(),u.To=f(u.To,m);for(let e of l())m(e)}},ie=oe;export{ie as default,oe as ssr};
|
|
1
|
+
import{a as e}from"../chunks/chunk-TD4XQCEX.js";import{b as t,c as l}from"../chunks/chunk-DFXQ7MFW.js";import"../chunks/chunk-V6VVL4F3.js";import{a as n,i as r,j as o,k as i,l as s,m as a}from"../chunks/chunk-BMGEWHCR.js";import"../chunks/chunk-PHAN6L23.js";import"../chunks/chunk-EM3Y3SJS.js";import{a as c}from"../chunks/chunk-6MACFEK7.js";import"../chunks/chunk-ZN52NEIB.js";import"../chunks/chunk-TUQ3OPZQ.js";import"../chunks/chunk-M656SMUU.js";import{a as u,b as f}from"../chunks/chunk-4NJBYXIT.js";var d=e=>e.split(".").slice(0,2).join("."),p=class extends t{static find(e){return e.querySelector?.(c.tagNames.ssr)??null}get version(){return this.getAttribute("version")??""}get stateData(){let e=this.querySelector('script[type="application/json"]');return null===e?{}:JSON.parse(e.textContent||"{}")}get templates(){let e=new Map;for(let t of Array.from(this.children))"template"===t.localName&&e.set(t.id,t);return e}get hydrateProps(){return{}}getTemplate(e){return this.templates.get(e)??null}verifyVersion(){return d(this.version)===d(e)}};function m(e){let t=c.tagNames.ssr;void 0===e.get(t)&&e.define(t,class extends p{})}var h=()=>c.tagNames.ssr,g=Symbol.for("wcstack.ssr.snapshotBuilder"),b=()=>!0===document.documentElement?.hasAttribute("data-wcs-server"),v=e=>document.createComment(e),y=(e,t)=>null!==e&&8===e.nodeType&&e.data===t,w=(e,t)=>null!==e&&8===e.nodeType&&e.data.startsWith(t),N=new WeakMap,S=new WeakMap,A=new WeakMap,x=new WeakSet,k=new WeakMap;function $(e,t){let l=[];for(let n=e;null!==n&&(l.push(n),n!==t);n=n.nextSibling);return l}function T(e,t,...l){for(let l of Array.from(e.attributes))t.setAttribute(l.name,l.value);return(t.content??t).append(...l),t}var j=e=>null===e.D?e.Ue:e.D[e.D.length-1];function C(e,t,l){let n=[v(null===l?"wcs-[":`wcs-[:${l}`)];for(let e of t)null===l&&n.push(v("wcs-|")),n.push(...$(e.Ue,j(e)));n.push(v("wcs-]")),e.after(...n);for(let e of n)x.add(e)}function E(e){if(e instanceof r){C(e.S,e.xe,null);for(let t of e.xe)W(t);return}let t=e.O;null!==t&&(C(e.G[e.G.length-1].S,[t],e.b),W(t))}function W(e){if(null!==e.c)for(let t of e.c)E(t)}var q=new Set(["script","style","template","textarea","title"]),O="data-wcs-raw",M=e=>q.has(e.localName)||e.localName===h();function I(e){for(let t of Array.from(e.childNodes))3===t.nodeType?""===t.data?t.replaceWith(v("wcs-e")):null!==t.nextSibling&&3===t.nextSibling.nodeType&&t.after(v("wcs-s")):1===t.nodeType&&!M(t)&&I(t)}var U=0;function P(t,l){let n=t.getRootNode(),r=[l];for(let e of S.get(n)??[])e!==l&&!0===e.element?.hasAttribute("bind-component")&&r.push(e);let o=new Map;for(let e of r){let t=N.get(e);if(void 0===t)continue;let l=new Map;for(let t of e.oe.values())if(null!==t.E&&l.set(t.E.S,t.E),null!==t.L)for(let e of t.L)l.set(e.S,e);for(let t of e.ce.values())for(let e of t)if(null!==e._)for(let t of e._.G)l.set(t.S,e._);let n=new Set;for(let[e,r]of t){o.set(e,r);let t=l.get(e);void 0!==t&&!n.has(t)&&e.isConnected&&(n.add(t),E(t))}}for(let e of Array.from(n.querySelectorAll("*"))){let t=A.get(e);if(void 0!==t){let l=document.createTreeWalker(e,133,{acceptNode:e=>x.has(e)||1===e.nodeType&&t.has(e)&&B(e)?2:1}),n=[];for(let e=l.nextNode();null!==e;e=l.nextNode()){let l=e.previousSibling;(3===e.nodeType?e.data.includes("{{")&&!(M(e.parentNode)?k.has(e):t.has(l)&&w(l,"wcs-t:"))&&(k.has(e)||t.get(e)!==e.data):!t.has(e))&&n.push(e)}for(let e of n)e.remove()}let l=Array.from(e.childNodes);M(e)&&l.some(e=>k.has(e))&&e.setAttribute(O,l.map(e=>k.has(e)?`{{ ${k.get(e)} }}`:8===e.nodeType?`\x3c!--${e.data}--\x3e`:e.textContent).join(""))}I(9===n.nodeType?n.body:n);let i=document.createElement(h());i.setAttribute("version",e);let s=document.createElement("script");s.type="application/json",s.textContent=function(e){return JSON.stringify(e).replace(/[<>&\u2028\u2029]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`)}(function(e){let t={};for(let l of Object.keys(e)){if("$"===l[0])continue;let n=Object.getOwnPropertyDescriptor(e,l);void 0!==n.get||void 0!==n.set||"function"==typeof n.value||(t[l]=n.value)}return t}(l.target)),i.append(s);for(let[e,t]of o){if(!e.isConnected)continue;let l=e.parentNode;for(;null!==l&&"svg"!==l.localName&&"foreignObject"!==l.localName;)l=l.parentElement;let n="svg"===l?.localName,r=`wcs-${n?"s":"t"}${U++}`;e.replaceWith(v(`wcs-p:${r}`));let o=document.importNode(a(t),!0);for(let e of Array.from(o.querySelectorAll("template")))"http://www.w3.org/2000/svg"===e.namespaceURI&&e.replaceWith(T(e,document.createElement("template"),...e.childNodes));if(n){let e=document.createElementNS(l.namespaceURI,"svg");e.append(o),o=e}let s=document.createElement("template");s.id=r,i.append(T(t,s,o))}t.before(i)}function R(e){!function(e){if(null!==e.querySelector(c.tagNames.state))for(let t of Array.from(e.querySelectorAll("input,textarea,select")))if("select"===t.localName){let e=Array.from(t.options);if(t.multiple||e.some(e=>e.hasAttribute("selected"))||e[t.selectedIndex]!==e.find(e=>!e.disabled))for(let t of e)t.toggleAttribute("selected",t.selected)}else"textarea"===t.localName?t.value!==t.defaultValue&&!t.value.includes("{{")&&!Array.from(t.childNodes).some(e=>k.has(e))&&(t.textContent=t.value):"checkbox"===t.type||"radio"===t.type?t.toggleAttribute("checked",t.checked):"password"!==t.type&&t.value!==t.defaultValue&&t.setAttribute("value",t.value)}(e);for(let t of Array.from(e.querySelectorAll(`${c.tagNames.state}[enable-ssr]`))){if(t.hasAttribute("mount")||t.hasAttribute("bind-component")||t.previousElementSibling?.localName===h())continue;let e=t.engine;null!=e&&P(t,e)}}var D=Symbol.for("wcstack.state.ssr.impl"),J=new Map,V=new WeakMap,B=e=>!0===u.$o?.(e),F=e=>1===e.nodeType&&!M(e)&&!B(e),G=e=>e.f.flat().concat(e.q??[]),L=e=>{for(let t of G(e))t.remove()};function Q(e,t,l){let n=/^wcs-\[(?::(\d+))?/.exec(e.data),r=e.previousSibling,o=e.parentNode,i=[],a=e.nextSibling;for(e.remove();null!==a&&!y(a,"wcs-]");){let e=a.nextSibling;if(y(a,"wcs-|"))i.push([]),a.remove();else{0===i.length&&i.push([]);let l=i[i.length-1];w(a,"wcs-[")?e=Q(a,t,l):(l.push(a),F(a)&&X(a,t))}a=e}let c={branch:void 0===n[1]?null:Number(n[1]),f:i,q:a??o.appendChild(v("wcs-]"))},u=G(c);a=c.q.nextSibling;for(let e of u)l?.push(e),t&&s.add(e);return t&&null!==r?J.set(r,c):L(c),a}function X(e,t){for(let l=e.firstChild;null!==l;)w(l,"wcs-[")?l=Q(l,t):(F(l)&&X(l,t),l=l.nextSibling)}function _(e,t,l){let n=e=>{for(let r of Array.from(e.childNodes))if(r.parentNode===e)if(8===r.nodeType){let e=r.data;try{if("wcs-s"===e)r.remove();else if("wcs-e"===e)r.replaceWith("");else if(e.startsWith("wcs-t:")){let t=v(`@@:${decodeURIComponent(e.slice(6))}`),l=r.nextSibling;for(;null!==l&&!y(l,"wcs-/t");){let e=l.nextSibling;l.remove(),l=e}l?.remove(),r.replaceWith(t)}else if(e.startsWith("wcs-p:")){let l=t.querySelector(`template[id="${e.slice(6)}"]`);if(null!==l){let t=r.parentNode,n="s"===e[10]?T(l,document.createElementNS(t.namespaceURI,"template"),...document.importNode(l.content.firstChild,!0).childNodes):document.importNode(l,!0);n.removeAttribute("id"),t.replaceChild(n,r)}}}catch{}}else 1===r.nodeType&&!M(r)&&(B(r)?V.set(r,{ssr:t,Oe:l}):n(r))};n(e),function(e){for(let t of Array.from(e.querySelectorAll("table > tbody"))){let e=[];for(let l=t.previousSibling;null!==l&&(8===l.nodeType||te(l)||"template"===l.localName);l=l.previousSibling)e.unshift(l);let l=0,n=0;if(e.forEach((e,t)=>{w(e,"wcs-[")?n++:y(e,"wcs-]")&&--n<0&&(n=0,l=t+1)}),0===n)continue;let r=0;for(let n=t.firstChild;null!==n;n=n.nextSibling)if(w(n,"wcs-["))r++;else if(y(n,"wcs-]")&&0===r--){t.prepend(...e.slice(l));break}}}(e),X(e,l)}function z(e){let t=V.get(e);if(void 0===t||(V.delete(e),_(e,t.ssr,t.Oe),!t.Oe))return null;let l=u.Oe;return u.Oe=re,()=>{u.Oe=l,H()}}function H(){for(let e of J.values())L(e);J.clear()}function Y(e){let t=[];for(let l=document.createTreeWalker(e,128);l.nextNode();)t.push(l.currentNode);return t}function Z(e,t,l,n){let r=null;for(let n of e){let e=n[l];null!==e&&(""===e||t===e||t.startsWith(`${e}.`))&&(null===r||e.length>r[l].length)&&(r=n)}let o=r?.[n];if(null==o)return null;let i=r[l],s=""===i?t:t.slice(i.length+1);return""===o?s:""===s?o:`${o}.${s}`}function K(e,t,l){if(b()){if(l instanceof Array){for(let e=l.length;e-- >0;)o(l[e])&&l.splice(e,1);let e=t;if(l.some(i))x.add(e);else if(e.localName.includes("-")&&!B(e)){let t=new Map;for(let l=document.createTreeWalker(e,133);l.nextNode();)t.set(l.currentNode,l.currentNode.data);A.set(e,t)}return}if("string"==typeof l){if(k.set(t,l),M(t.parentNode))return;let e=v(`wcs-t:${encodeURIComponent(l)}`),n=v("wcs-/t");return t.before(e),void t.after(n)}let n=N.get(e);void 0===n&&N.set(e,n=new Map),n.set(t,l);let r=t.getRootNode(),s=S.get(r);return void 0===s&&S.set(r,s=new Set),void s.add(e)}if("string"!=typeof l&&J.size>0){let e=J.get(l);void 0!==e&&(J.delete(l),J.set(t,e))}}var ee=e=>null!==e&&8===e.nodeType&&[c.commentIfPrefix,c.commentElseIfPrefix,c.commentElsePrefix].includes(e.data),te=e=>3===e.nodeType&&""===e.data.trim(),le=e=>(J.get(e)?.q??e).nextSibling;function ne(e,t){if(t.length!==e.sn.childNodes.length)return!1;let l=e.On;for(let n=0;n<l.length;n++){let r=l[n],o=e.sn,i=t[r[0]];for(let e=0;;){if(o=o.childNodes[r[e]],i?.nodeName!==o.nodeName)return!1;if(++e===r.length)break;i=i.firstChild;for(let t=r[e];t>0&&null!==i;t--)i=le(i)}e.ko[n]=i}return!0}function re(e,t,l){if(0===J.size)return null;let n=t,r=0;if(!l){let e=c.commentIfPrefix;if(!y(t,e))for(let l=t.previousSibling;null!==l&&1!==l.nodeType&&(ee(l)&&r++,!y(l,e));l=l.previousSibling);for(let l=t.nextSibling;!J.has(n)&&null!==l&&!y(l,e)&&1!==l.nodeType;l=l.nextSibling)ee(l)&&(n=l)}let o=J.get(n);if(void 0===o)return null;if(!l&&o.branch!==r)return J.delete(n),L(o),null;let i=o.f.shift();if(0===o.f.length&&J.delete(n),o.q?.replaceWith(...$(t,n)),o.q=null,void 0===i)return null;let s=[];for(let e=0;e<i.length;e++){let t=J.get(i[e]);if(s.push(i[e]),void 0!==t)for(;e<i.length&&i[e]!==t.q;)e++}if(!ne(e,s)){let l=(e.In?e.root:e.sn).cloneNode(!0);s=e.In?[l]:[...l.childNodes],ne(e,s),(i[0]??o.f.find(e=>e.length>0)?.[0]??t).before(l);for(let e of i)e.remove()}return s}var oe={name:"ssr",install(){u.jn=K,u.hr=z;let t=u.element;u.element=(l,r)=>{"mounting"===r&&function(t){let l=t.element;if(!l.hasAttribute("enable-ssr")||b())return;let r=l.previousElementSibling,o=r?.localName===h(),i=o?r.getAttribute("version"):null,s=null===i||d(i)===d(e);if(s){let e=t,l=e.ke;e.ke=(e,n)=>"$connectedCallback"===e?void 0:l.call(t,e,n)}if(!o)return;let a=!s&&parseInt(i)<4,f=/^3\.(\d+)\.(\d+)$/.exec(i),p=null!==f&&(+f[1]-5||+f[2]-3)>=0;s||console.warn(`[@wcstack/state] <${h()} version="${i}"> does not match ${e}: its snapshot is discarded, and the page renders on the client from its own state.${a&&!p?" 3.x output keeps only the path of a text binding outside a template, so such a binding loses its filters: deploy @wcstack/server 4.0 with this client.":""}`);let m=s?r.querySelector('script[type="application/json"]'):null;if(null!==m){let e=JSON.parse(m.textContent||"{}"),l=t.target;for(let t of Object.keys(e)){let n=Object.getOwnPropertyDescriptor(l,t);void 0!==n&&(void 0!==n.get||void 0!==n.set||"function"==typeof n.value)||(l[t]=e[t])}t.hydrated=!0}let g=l.getRootNode();for(let e of Array.from(g.querySelectorAll(`[${O}]`)))e.textContent=e.getAttribute(O),e.removeAttribute(O);let w=9===g.nodeType?g.body:g;a?function(e,t,l){let r=new Map,o=e=>{let t=e.parentElement;for(;null!==t&&!B(t);)t=t.parentElement;if(null===t)return null;let l=r.get(t);if(void 0===l){let e=o(t),i=t.querySelector(`:scope > ${c.tagNames.state}[bind-component]`).getAttribute("bind-component");r.set(t,l=[]);for(let r of n(t.getAttribute(c.bindAttributeName)??"")){let t=r.Je;r.$e[0]===i&&l.push([e?Z(e,t,1,0):t,r.$e.slice(1).join("."),e&&t])}}return l},i=(e,t,l)=>{let n=o(e);if(null===n)return t;let r=/^([^|]*)#m\d+\.([^|]*)$/.exec(t);if(null===r)return l?t:Z(n,t,0,1)??t;let i=r[1].replace(/#m\d+\./g,"").slice(0,-1);return n.some(e=>""===e[1]&&(e[0]===i||e[2]===i))?r[2]:Z(n,r[2],2,1)??r[2]};for(let t of Y(e).reverse()){let e=/^@@wcs-(\w+)-start:([\s\S]*)/.exec(t.data);if(null===e)continue;let n=t.nextSibling;for(;null!==n&&!y(n,`@@wcs-${e[1]}-end:${e[2]}`);)n=n.nextSibling;if(null!==n){for(;t.nextSibling!==n;)t.nextSibling.remove();n.remove(),t.replaceWith(..."text"===e[1]?[v(`@@:${i(t,e[2],l)}`)]:[])}}let s=(e,l)=>{for(let n of Y(e)){let e=/^@@wcs-(?:for|if|elseif|else):(\S+)$/.exec(n.data)?.[1],r=Array.from(t.querySelectorAll("template")).find(t=>t.id===e);if(void 0===r)continue;let o=document.importNode(r,!0),a=c.bindAttributeName;o.removeAttribute("id"),o.setAttribute(a,o.getAttribute(a).replace(/^(\s*\w+\s*:\s*)([^\s|]+)/,(e,t,r)=>t+i(l??n,r))),s(o.content,l??n);let u=o.content.firstChild;n.replaceWith(.../^\s*elseif\s*:/.test(u?.getAttribute?.(a)??"")?o.content.childNodes:[o])}};s(e);for(let t of Array.from(e.querySelectorAll("[data-wcs-ssr-id]")))t.removeAttribute("data-wcs-ssr-id")}(w,r,p):_(w,r,s),r.remove(),s&&(u.Oe=re,queueMicrotask(()=>{H(),u.Oe=null}))}(l),t?.(l,r)},function(){let e=globalThis;e[D]={build:R,reset(){U=0}},void 0===e[g]&&(e[g]={protocol:"wcs-ssr-snapshot",version:1,build:t=>e[D].build(t),reset:()=>e[D].reset()})}(),u.To=f(u.To,m);for(let e of l())m(e)}},ie=oe;export{ie as default,oe as ssr};
|
|
2
2
|
//# sourceMappingURL=ssr.js.map
|
package/package.json
CHANGED