@ecopages/radiant 0.3.0-alpha.9 → 0.3.0-beta.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/README.md +315 -0
- package/dist/client/app-bootstrap.d.ts +19 -0
- package/dist/client/app-bootstrap.js +3 -0
- package/dist/client/app-bootstrap.js.map +10 -0
- package/dist/context/decorators/consume-context.js +2 -2
- package/dist/context/decorators/consume-context.js.map +4 -4
- package/dist/context/decorators/context-selector.js +2 -2
- package/dist/context/decorators/context-selector.js.map +8 -7
- package/dist/context/decorators/legacy/consume-context.js +2 -2
- package/dist/context/decorators/legacy/consume-context.js.map +4 -4
- package/dist/context/decorators/legacy/context-selector-field.js +2 -2
- package/dist/context/decorators/legacy/context-selector-field.js.map +4 -4
- package/dist/context/decorators/legacy/context-selector.js +2 -2
- package/dist/context/decorators/legacy/context-selector.js.map +4 -4
- package/dist/context/decorators/legacy/provide-context.js +2 -2
- package/dist/context/decorators/legacy/provide-context.js.map +4 -4
- package/dist/context/decorators/on-context-update.js +2 -2
- package/dist/context/decorators/on-context-update.js.map +4 -4
- package/dist/context/decorators/provide-context.js +2 -2
- package/dist/context/decorators/provide-context.js.map +4 -4
- package/dist/context/decorators/standard-legacy-dispatch.d.ts +6 -0
- package/dist/context/decorators/standard-legacy-dispatch.js +3 -0
- package/dist/context/decorators/standard-legacy-dispatch.js.map +10 -0
- package/dist/context/index.js +2 -2
- package/dist/context/index.js.map +11 -10
- package/dist/controller-registry.js +2 -2
- package/dist/controller-registry.js.map +3 -3
- package/dist/core/event-subscription-registry.d.ts +16 -0
- package/dist/core/event-subscription-registry.js +3 -0
- package/dist/core/event-subscription-registry.js.map +10 -0
- package/dist/core/host-ssr-registry.d.ts +13 -0
- package/dist/core/host-ssr-registry.js +3 -0
- package/dist/core/host-ssr-registry.js.map +10 -0
- package/dist/core/hydration-capable-host.d.ts +8 -0
- package/dist/core/hydration-capable-host.js +3 -0
- package/dist/core/hydration-capable-host.js.map +10 -0
- package/dist/core/radiant-controller.d.ts +35 -15
- package/dist/core/radiant-controller.js +2 -2
- package/dist/core/radiant-controller.js.map +13 -6
- package/dist/core/{radiant-component-ssr.d.ts → radiant-element-ssr-host.d.ts} +16 -16
- package/dist/core/radiant-element-ssr-host.js +3 -0
- package/dist/core/radiant-element-ssr-host.js.map +10 -0
- package/dist/core/radiant-element-ssr-registry.d.ts +18 -0
- package/dist/core/radiant-element-ssr-registry.js +3 -0
- package/dist/core/radiant-element-ssr-registry.js.map +10 -0
- package/dist/core/radiant-element.d.ts +27 -141
- package/dist/core/radiant-element.js +2 -2
- package/dist/core/radiant-element.js.map +21 -10
- package/dist/core/reactive-host.d.ts +3 -16
- package/dist/core/reactive-host.js +2 -2
- package/dist/core/reactive-host.js.map +7 -4
- package/dist/core/reactive-jsx-value.d.ts +2 -1
- package/dist/core/reactive-jsx-value.js.map +2 -2
- package/dist/core/reactive-prop-core.d.ts +44 -0
- package/dist/core/reactive-prop-core.js +3 -0
- package/dist/core/reactive-prop-core.js.map +11 -0
- package/dist/core/reactive-prop-metadata.d.ts +1 -1
- package/dist/core/reactive-prop-metadata.js +2 -2
- package/dist/core/reactive-prop-metadata.js.map +2 -2
- package/dist/core/reactive-property-state.d.ts +17 -0
- package/dist/core/reactive-property-state.js +3 -0
- package/dist/core/reactive-property-state.js.map +12 -0
- package/dist/core/reactivity-adapter.d.ts +8 -0
- package/dist/core/reactivity-adapter.js +3 -0
- package/dist/core/reactivity-adapter.js.map +12 -0
- package/dist/core/reactivity-contract.d.ts +39 -0
- package/dist/core/reactivity-contract.js +2 -0
- package/dist/core/reactivity-contract.js.map +9 -0
- package/dist/core/reactivity-runtime.d.ts +18 -0
- package/dist/core/reactivity-runtime.js +3 -0
- package/dist/core/reactivity-runtime.js.map +11 -0
- package/dist/core/reactivity-signals.d.ts +10 -0
- package/dist/core/reactivity-signals.js +3 -0
- package/dist/core/reactivity-signals.js.map +10 -0
- package/dist/core/render-runtime.d.ts +28 -0
- package/dist/core/render-runtime.js +3 -0
- package/dist/core/render-runtime.js.map +16 -0
- package/dist/core/render-scheduler.d.ts +22 -0
- package/dist/core/render-scheduler.js +3 -0
- package/dist/core/render-scheduler.js.map +10 -0
- package/dist/core/slot-projection-runtime.js +2 -2
- package/dist/core/slot-projection-runtime.js.map +3 -3
- package/dist/decorators/attr.js +2 -2
- package/dist/decorators/attr.js.map +6 -5
- package/dist/decorators/controller.js +2 -2
- package/dist/decorators/controller.js.map +3 -3
- package/dist/decorators/event.js +2 -2
- package/dist/decorators/event.js.map +3 -3
- package/dist/decorators/legacy/attr.js +2 -2
- package/dist/decorators/legacy/attr.js.map +6 -5
- package/dist/decorators/legacy/event.js +2 -2
- package/dist/decorators/legacy/event.js.map +3 -3
- package/dist/decorators/legacy/host-readiness.d.ts +8 -0
- package/dist/decorators/legacy/host-readiness.js +3 -0
- package/dist/decorators/legacy/host-readiness.js.map +11 -0
- package/dist/decorators/legacy/instance-initializers.d.ts +16 -0
- package/dist/decorators/legacy/instance-initializers.js +2 -2
- package/dist/decorators/legacy/instance-initializers.js.map +3 -3
- package/dist/decorators/legacy/on-event.js +2 -2
- package/dist/decorators/legacy/on-event.js.map +4 -4
- package/dist/decorators/legacy/on-updated.d.ts +1 -1
- package/dist/decorators/legacy/on-updated.js +2 -2
- package/dist/decorators/legacy/on-updated.js.map +4 -4
- package/dist/decorators/legacy/query-slot.js +2 -2
- package/dist/decorators/legacy/query-slot.js.map +5 -5
- package/dist/decorators/legacy/query.js +2 -2
- package/dist/decorators/legacy/query.js.map +3 -3
- package/dist/decorators/legacy/reactive-field.js +2 -2
- package/dist/decorators/legacy/reactive-field.js.map +3 -3
- package/dist/decorators/legacy/reactive-prop.d.ts +1 -1
- package/dist/decorators/legacy/reactive-prop.js +2 -2
- package/dist/decorators/legacy/reactive-prop.js.map +7 -6
- package/dist/decorators/legacy/signal.d.ts +1 -1
- package/dist/decorators/legacy/signal.js +2 -2
- package/dist/decorators/legacy/signal.js.map +6 -5
- package/dist/decorators/on-event.js +2 -2
- package/dist/decorators/on-event.js.map +4 -4
- package/dist/decorators/on-updated.js +2 -2
- package/dist/decorators/on-updated.js.map +4 -4
- package/dist/decorators/prop.d.ts +1 -1
- package/dist/decorators/prop.js +2 -2
- package/dist/decorators/prop.js.map +9 -8
- package/dist/decorators/query-slot.js +2 -2
- package/dist/decorators/query-slot.js.map +6 -6
- package/dist/decorators/query.js +2 -2
- package/dist/decorators/query.js.map +3 -3
- package/dist/decorators/shared/reactive-attr.d.ts +1 -1
- package/dist/decorators/shared/reactive-attr.js +2 -2
- package/dist/decorators/shared/reactive-attr.js.map +5 -4
- package/dist/decorators/signal.js +2 -2
- package/dist/decorators/signal.js.map +7 -6
- package/dist/decorators/standard/attr.js +2 -2
- package/dist/decorators/standard/attr.js.map +5 -4
- package/dist/decorators/standard/on-event.js.map +2 -2
- package/dist/decorators/standard/query-slot.d.ts +0 -1
- package/dist/decorators/standard/query-slot.js +2 -2
- package/dist/decorators/standard/query-slot.js.map +4 -4
- package/dist/decorators/standard/reactive-field.js +2 -2
- package/dist/decorators/standard/reactive-field.js.map +3 -3
- package/dist/decorators/standard/reactive-prop.d.ts +1 -1
- package/dist/decorators/standard/reactive-prop.js +2 -2
- package/dist/decorators/standard/reactive-prop.js.map +6 -5
- package/dist/decorators/standard/signal.d.ts +1 -1
- package/dist/decorators/standard/signal.js +2 -2
- package/dist/decorators/standard/signal.js.map +5 -4
- package/dist/decorators/state.js +2 -2
- package/dist/decorators/state.js.map +4 -4
- package/dist/helpers/create-event-listener.js.map +2 -2
- package/dist/helpers/create-query-slot.d.ts +0 -1
- package/dist/helpers/create-query-slot.js +2 -2
- package/dist/helpers/create-query-slot.js.map +3 -3
- package/dist/helpers/index.js +2 -2
- package/dist/helpers/index.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/index.js.map +36 -25
- package/dist/package.json +209 -0
- package/dist/server/host-attribute-serialization.d.ts +46 -0
- package/dist/server/host-attribute-serialization.js +3 -0
- package/dist/server/host-attribute-serialization.js.map +12 -0
- package/dist/server/host-script-composition.d.ts +42 -0
- package/dist/server/host-script-composition.js +3 -0
- package/dist/server/host-script-composition.js.map +10 -0
- package/dist/server/install-light-dom-shim.js +2 -2
- package/dist/server/install-light-dom-shim.js.map +3 -3
- package/dist/server/internal-radiant-host.d.ts +2 -0
- package/dist/server/internal-radiant-host.js +3 -0
- package/dist/server/internal-radiant-host.js.map +9 -0
- package/dist/server/light-dom-shim.js +2 -2
- package/dist/server/light-dom-shim.js.map +3 -3
- package/dist/server/radiant-element-ssr-bridge.d.ts +21 -0
- package/dist/server/radiant-element-ssr-bridge.js +3 -0
- package/dist/server/radiant-element-ssr-bridge.js.map +24 -0
- package/dist/server/radiant-element-ssr-extractor.d.ts +2 -0
- package/dist/server/radiant-element-ssr-extractor.js +3 -0
- package/dist/server/radiant-element-ssr-extractor.js.map +12 -0
- package/dist/server/radiant-element-ssr-service.d.ts +13 -0
- package/dist/server/radiant-element-ssr-service.js +3 -0
- package/dist/server/radiant-element-ssr-service.js.map +22 -0
- package/dist/server/radiant-element-ssr.d.ts +1 -0
- package/dist/server/radiant-element-ssr.js +3 -0
- package/dist/server/radiant-element-ssr.js.map +24 -0
- package/dist/server/render-component.d.ts +3 -9
- package/dist/server/render-component.js +2 -2
- package/dist/server/render-component.js.map +17 -9
- package/dist/server/render-controller.js +2 -2
- package/dist/server/render-controller.js.map +19 -11
- package/dist/server/render-fragment.d.ts +7 -0
- package/dist/server/render-fragment.js +3 -0
- package/dist/server/render-fragment.js.map +10 -0
- package/dist/server/slot-projection-html.js +2 -2
- package/dist/server/slot-projection-html.js.map +3 -3
- package/dist/tools/escape-css-identifier.js.map +2 -2
- package/dist/tools/index.js.map +2 -2
- package/dist/utils/escape-html-attribute.d.ts +2 -0
- package/dist/utils/escape-html-attribute.js +3 -0
- package/dist/utils/escape-html-attribute.js.map +10 -0
- package/package.json +12 -5
- package/dist/core/radiant-component-ssr-registry.d.ts +0 -54
- package/dist/core/radiant-component-ssr-registry.js +0 -3
- package/dist/core/radiant-component-ssr-registry.js.map +0 -10
- package/dist/core/radiant-component-ssr.js +0 -3
- package/dist/core/radiant-component-ssr.js.map +0 -14
- package/dist/server/radiant-component-ssr-runtime.d.ts +0 -9
- package/dist/server/radiant-component-ssr-runtime.js +0 -3
- package/dist/server/radiant-component-ssr-runtime.js.map +0 -17
- package/size-budget.json +0 -25
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var C1=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(P,j)=>(typeof require<"u"?require:P)[j]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var t=Symbol.for("@ecopages/radiant.component-ssr-runtime");function w(){return globalThis[t]}function o($){globalThis[t]=$}function P1($){switch($){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function E1($){switch(typeof $){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray($))return"array";if(Object.prototype.toString.call($)==="[object Object]")return"object"}function O1($){switch($){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function S1($){try{return JSON.parse($)}catch{throw TypeError("Invalid JSON string")}}var N1={array($){let P=S1($);if(!Array.isArray(P))throw TypeError(`Expected an array but got a value of type "${typeof P}"`);return P},boolean($){return!($==="0"||String($).toLowerCase()==="false")},number($){return Number($.replace(/_/g,""))},object($){let P=JSON.parse($);if(P===null||typeof P!=="object"||Array.isArray(P))throw TypeError(`expected value of type "object" but instead got value "${$}" of type "${E1(P)}"`);return P},string($){return $}},n={default:j1,array:e,object:e};function e($){return JSON.stringify($)}function j1($){return`${$}`}function $1($,P){let j=P1(P);if(!j)throw TypeError(`[radiant-element] Unknown type "${P}"`);return N1[j]($)}function q1($,P){let j=P1(P);if(!j)throw TypeError(`[radiant-element] Unknown type "${P}"`);return(n[j]??n.default??j1)($)}function M1($){return typeof $==="boolean"}function v1($){return typeof $==="number"}function c1($){return typeof $==="string"}function s1($){return Array.isArray($)}function u1($){return typeof $==="object"&&!Array.isArray($)&&$!==null}function S$($,P){switch($){case Boolean:return M1(P);case Number:return v1(P);case String:return c1(P);case Array:return s1(P);case Object:return u1(P);default:return!1}}var N$=($,P,j,q)=>{if(P===Boolean){let Z=$.getAttribute(j);if(Z===null)return q;return Z===""?!0:$1(Z,P)}let Q=$.getAttribute(j);return Q!==null?$1(Q,P):q??O1(P)};var Q1=Symbol.for("@ecopages/radiant.controllerIdentifier");function S($,P){$[Q1]=P}function Z1($){return $[Q1]}var G="data-controller",F1=Symbol.for("@ecopages/radiant.controller-registry-state");function p1(){let $=globalThis,P=$[F1];if(P)return P;let j={activeRuntimes:new Set,controllerRegistrationStrategy:"keep-current",controllerRegistry:new Map};return $[F1]=j,j}var L=p1(),H=L.controllerRegistry,X=L.activeRuntimes;function J1($){let P=$.getAttribute(G);if(!P)return[];return P.split(/\s+/).map((j)=>j.trim()).filter((j)=>j.length>0)}function b($,P){if($ instanceof Element&&$.hasAttribute(G))P($);for(let j of Array.from($.querySelectorAll(`[${G}]`)))P(j)}class R1{root;controllersByElement=new Map;observer;stopped=!1;constructor($=document){this.root=$;this.start()}stop(){if(this.stopped)return;this.stopped=!0,this.observer?.disconnect(),this.observer=void 0;for(let[$,P]of this.controllersByElement)for(let[j]of P)this.disconnectController($,j);X.delete(this)}reconcileRegisteredController($){b(this.root,(P)=>{if(!J1(P).includes($))return;this.connectController(P,$)})}replaceRegisteredController($){for(let[P,j]of Array.from(this.controllersByElement.entries())){if(!j.has($))continue;this.disconnectController(P,$)}this.reconcileRegisteredController($)}start(){if(b(this.root,(P)=>{this.reconcileElement(P)}),typeof MutationObserver>"u"){X.add(this);return}this.observer=new MutationObserver((P)=>{for(let j of P){if(j.type==="attributes"&&j.target instanceof Element){this.reconcileElement(j.target);continue}for(let q of Array.from(j.removedNodes)){if(!(q instanceof Element))continue;b(q,(Q)=>{this.disconnectElementControllers(Q)})}for(let q of Array.from(j.addedNodes)){if(!(q instanceof Element))continue;b(q,(Q)=>{this.reconcileElement(Q)})}}});let $=this.root instanceof Document?this.root.documentElement:this.root;this.observer.observe($,{attributeFilter:[G],attributes:!0,childList:!0,subtree:!0}),X.add(this)}reconcileElement($){let P=new Set(J1($)),j=this.controllersByElement.get($);if(j){for(let q of j.keys())if(!P.has(q))this.disconnectController($,q)}for(let q of P)this.connectController($,q)}connectController($,P){let j=H.get(P);if(!j)return;let q=this.controllersByElement.get($);if(!q)q=new Map,this.controllersByElement.set($,q);if(q.has(P))return;let Q=new j($);q.set(P,Q),Q.connect()}disconnectController($,P){let j=this.controllersByElement.get($);if(!j)return;let q=j.get(P);if(!q)return;if(q.disconnect(),j.delete(P),j.size===0)this.controllersByElement.delete($)}disconnectElementControllers($){let P=this.controllersByElement.get($);if(!P)return;for(let j of Array.from(P.keys()))this.disconnectController($,j)}}function d1($,P){let j=H.get($);if(j)return j;S(P,$),H.set($,P);for(let q of Array.from(X))q.reconcileRegisteredController($);return P}function s$($){return H.has($)}function u$($){return H.get($)}function m1($,P){if(H.get($)===P)return P;S(P,$),H.set($,P);for(let q of Array.from(X))q.replaceRegisteredController($);return P}function W1($){L.controllerRegistrationStrategy=$}function p$(){W1("replace")}function d$(){W1("keep-current")}function m$($,P){if(L.controllerRegistrationStrategy==="replace")return m1($,P);return d1($,P)}function i$($=document){return new R1($)}function r$(){for(let $ of Array.from(X))$.stop()}var G1=Symbol.for("@ecopages/radiant.customElementTagName");function l$($,P){$[G1]=P}function z($){return $[G1]}var N=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function o$($,P,j){let q=$.constructor,Q=q[N]??[];if(Q.some((Z)=>Z.name===P))return;Q.push({name:P,options:j}),q[N]=Q}function H1($){return($.constructor[N]??[]).slice()}var U1=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function X1(){return globalThis}function Y1($){X1()[U1]=$}function e$($){return X1()[U1]?.($)}var B;function f1(){if(B!==void 0)return B;try{let{AsyncLocalStorage:$}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return B=new $,B}catch{return B=null,null}}var K1=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function I1(){let $=globalThis;return $[K1]??=[],$[K1]}function T($){if($.length===0)return()=>{return};let P=new Map;for(let Q of $)P.set(Q.getContextKey(),Q);let j=f1();if(j){let Q=j.getStore()??[],Z=[...Q,P];return j.enterWith(Z),()=>{j.enterWith(Q)}}let q=I1();return q.push(P),()=>{let Q=q.lastIndexOf(P);if(Q>=0)q.splice(Q,1)}}function h1($){let P=f1()?.getStore()??I1();for(let j=P.length-1;j>=0;j-=1){let q=P[j]?.get($);if(q)return q}return}function jP($){let P=h1($);if(!P)return;return P.getContext()}Y1(($)=>h1($));class M{host;constructor($){this.host=$}renderHost(){return{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString($={},P=this.getHostAttributes()){let j=this.getTagName(),q=T(this.host.getContextProviders());try{return`<${j}${i1(P)}>${this.renderHostContent($)}</${j}>`}finally{q()}}renderHostContent($){let P=this.host.renderToString($),j=this.host.getAuthoredHydrationScriptMarkup?.()??"",q=this.host.getSlotProjectionScriptTag?.()??"";if(!($.mode==="hydrate"||$.mode===void 0&&$.hydrate===!0))return`${P}${j}${q}`;let Z=this.host.getHydrationBindings().map((F)=>F.renderHydrationScriptTag()).filter((F)=>typeof F==="string").join("");return`${P}${q}${Z}`}getHostAttributes(){let $={},P=new Set;for(let j of this.host.getReactiveProperties()){let q=this.host.getPropertyValue(j.name);if(q===void 0||q===null||q===!1)continue;$[j.attribute]=String(j.converter.toAttribute(q)),P.add(j.attribute)}for(let j of this.host.getReactivePropDefinitions()){let q=j.options.attribute??j.name;if(P.has(q))continue;let Q=this.host.getPropertyValue(j.name);if(Q===void 0||Q===null||Q===!1)continue;$[q]=String(q1(Q,j.options.type)),P.add(q)}for(let j of this.host.listAttributeNames()){let q=this.host.getAttributeValue(j);if(q!==null)$[j]=q}return $}getTagName(){let $=z(this.host.constructor);if(!$)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return $}}function i1($){return Object.entries($).map(([P,j])=>` ${P}="${r1(j)}"`).join("")}function r1($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}import{renderToString as a1}from"@ecopages/jsx/server";import{withServerCustomElementRenderHook as l1}from"@ecopages/jsx/server";var t1=Symbol.for("@ecopages/jsx.active-ssr-hydrate"),v=new WeakSet;function o1($){return{nodeType:1,outerHTML:B1($,{mode:"hydrate"})}}function B1($,P={}){return _1($).renderHostToString(P,A1($))}function A1($){let P=$;if(v.has($))return _1($).getHostAttributes();v.add($);try{return P.getHostSsrAttributes()}finally{v.delete($)}}function _1($){let P=$;return new M({constructor:P.constructor,getAuthoredHydrationScriptMarkup:()=>P.getAuthoredHydrationScriptMarkup(),getHydrationBindings:()=>P.getHydrationBindings(),getSlotProjectionScriptTag:()=>P.getSlotProjectionScriptTag(),renderToString:(j)=>P.renderToString(j),getContextProviders:()=>P.getContextProviders(),getReactiveProperties:()=>P.getReactiveProperties(),getReactivePropDefinitions:()=>H1($),getPropertyValue:(j)=>P[j],listAttributeNames:()=>typeof P.getAttributeNames==="function"?P.getAttributeNames():[],getAttributeValue:(j)=>P.getAttribute(j)})}function n1($){return l1(({instance:P})=>{let j=x1(P);if(!j?.renderHostToString)return;let q=j.renderHostToString;return{nodeType:1,get outerHTML(){let Q=e1();return q({hydrate:Q,mode:Q?"hydrate":"plain"})}}},$)}function x1($){return $.resolveSsrRenderBridge?.()}function e1(){return globalThis[t1]===!0}function Y(){let $=w();if($)return $;let P={getHostAttributes:A1,renderHost:o1,renderHostToString:B1,resolveRenderBridge:x1,renderView:(j,q={})=>{let Q=j;return n1(()=>a1(Q.resolveTrackedRenderOutput().value,q))}};return o(P),P}Y();var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function V1($){let P=[],j=0;while(j<$.length){let q=j;if($.startsWith("<!--",j)){let F=$.indexOf("-->",j+4);j=F===-1?$.length:F+3,P.push($.slice(q,j));continue}if($[j]!=="<"){let F=$.indexOf("<",j);j=F===-1?$.length:F,P.push($.slice(q,j));continue}let Q=A($,j);if(!Q){P.push($.slice(q));break}if(Q.type!=="open"||Q.selfClosing||g.has(Q.tagName)){j=Q.end,P.push($.slice(q,j));continue}j=Q.end;let Z=1;while(j<$.length&&Z>0){let F=$.indexOf("<",j);if(F===-1){j=$.length;break}let J=A($,F);if(!J){j=$.length;break}if(j=J.end,J.type==="comment"||J.type==="declaration")continue;if(J.type==="open"&&!J.selfClosing&&!g.has(J.tagName)){Z+=1;continue}if(J.type==="close")Z-=1}P.push($.slice(q,j))}return P.filter((q)=>q!=="")}function $$($,P){let j;for(let q=P+1;q<$.length;q+=1){let Q=$[q];if(j){if(Q===j)j=void 0;continue}if(Q==='"'||Q==="'"){j=Q;continue}if(Q===">")return q+1}return $.length}function P$($){let P={},j=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let q of $.matchAll(j)){let[,Q,Z,F,J]=q;if(!Q)continue;P[Q]=Z??F??J??""}return P}function A($,P){if($.startsWith("<!--",P)){let U=$.indexOf("-->",P+4);return{end:U===-1?$.length:U+3,type:"comment"}}let j=$$($,P),q=$.slice(P+1,j-1).trim();if(q==="")return;if(q.startsWith("!")||q.startsWith("?"))return{end:j,type:"declaration"};if(q.startsWith("/"))return{end:j,type:"close"};let Q=/\/\s*$/.test(q),Z=Q?q.replace(/\/\s*$/,"").trim():q,F=Z.split(/[\s/>]/,1)[0]?.toLowerCase()??"",J=F.length,W=Z.slice(J).trim(),I=Q||g.has(F)?"":j$($,P,j,F);return{attributes:P$(W),end:j,innerHtml:I,selfClosing:Q,tagName:F,type:"open"}}function j$($,P,j,q){let Q=j,Z=1;while(Q<$.length&&Z>0){let F=$.indexOf("<",Q);if(F===-1)return $.slice(j);let J=A($,F);if(!J)return $.slice(j);if(J.type==="open"&&J.tagName===q&&!J.selfClosing&&!g.has(q))Z+=1;if(J.type==="close"){if($.slice(F+2,J.end-1).trim().toLowerCase()===q){if(Z-=1,Z===0)return $.slice(j,F)}}Q=J.end}return $.slice(j)}class R extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor($,P=null){super();this.nodeType=$;this.ownerDocument=P}append(...$){for(let P of $)this.appendChild(typeof P==="string"?q$(P):P)}appendChild($){if("parentNode"in $&&$.parentNode&&"removeChild"in $.parentNode)$.parentNode.removeChild($);return this.childNodes.push($),$.ownerDocument=this.nodeType===R.DOCUMENT_NODE?this:this.ownerDocument,$.parentNode=this,$}removeChild($){let P=this.childNodes.indexOf($);if(P===-1)return $;return this.childNodes.splice(P,1),$.parentNode=null,$}replaceChildren(...$){for(let P of this.childNodes)P.parentNode=null;this.childNodes=[],this.append(...$)}get textContent(){return this.childNodes.map(($)=>$.textContent??"").join("")}set textContent($){this.replaceChildren($??"")}getRootNode(){let $=this;while("parentNode"in $&&$.parentNode)$=$.parentNode;return $}}class V extends R{value;constructor($,P=f()){super(R.TEXT_NODE,P);this.value=$}get textContent(){return this.value}set textContent($){this.value=$??""}}class y1{element;constructor($){this.element=$}add(...$){let P=new Set(this.readTokens());for(let j of $)if(j!=="")P.add(j);this.writeTokens([...P])}remove(...$){let P=new Set(this.readTokens());for(let j of $)P.delete(j);this.writeTokens([...P])}toggle($,P){let j=this.contains($);if(P??!j)return this.add($),!0;return this.remove($),!1}contains($){return this.readTokens().includes($)}toString(){return this.value}get value(){return this.element.getAttribute("class")??""}readTokens(){return this.value.split(/\s+/).map(($)=>$.trim()).filter(($)=>$.length>0)}writeTokens($){if($.length===0){this.element.removeAttribute("class");return}this.element.setAttribute("class",$.join(" "))}}class D extends R{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor($="div",P=f()){super(R.ELEMENT_NODE,P);this.localName=$.toLowerCase(),this.tagName=this.localName.toUpperCase()}get classList(){return this.classListValue??=new y1(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:($,P)=>{if(typeof P!=="string")return!1;return this.removeAttribute(x(P)),!0},get:($,P)=>{if(typeof P!=="string")return;return this.getAttribute(x(P))??void 0},getOwnPropertyDescriptor:($,P)=>{if(typeof P!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(x(P))??void 0,writable:!0}},has:($,P)=>{return typeof P==="string"&&this.hasAttribute(x(P))},ownKeys:()=>{return this.getAttributeNames().filter(($)=>$.startsWith("data-")).map(($)=>R$($.slice(5)))},set:($,P,j)=>{if(typeof P!=="string")return!1;return this.setAttribute(x(P),String(j)),!0}}),this.datasetValue}hasAttribute($){return this.attributes.has($)}getAttribute($){return this.attributes.get($)??null}getAttributeNames(){return Array.from(this.attributes.keys())}setAttribute($,P){this.fragmentHtml=void 0,this.attributes.set($,String(P))}toggleAttribute($,P){if(P??!this.hasAttribute($))return this.setAttribute($,""),!0;return this.removeAttribute($),!1}removeAttribute($){this.fragmentHtml=void 0,this.attributes.delete($)}querySelector(){return null}querySelectorAll(){return[]}matches(){return!1}get outerHTML(){if(this.fragmentHtml!==void 0)return this.fragmentHtml;let $=Array.from(this.attributes.entries()).map(([P,j])=>` ${P}="${F$(j)}"`).join("");return`<${this.localName}${$}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map(($)=>G$($)).join("")}set innerHTML($){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...z1($,this.ownerDocument))}get textContent(){return this.fragmentText??super.textContent??""}set textContent($){this.fragmentHtml=void 0,this.fragmentText=$??"",super.textContent=$}setSerializedFragment($,P,j){this.fragmentHtml=$,this.fragmentText=P,this.attributes=new Map(Object.entries(j)),this.replaceChildren()}}class k{bubbles;cancelable;composed;type;constructor($,P={}){this.type=$,this.bubbles=P.bubbles??!1,this.cancelable=P.cancelable??!1,this.composed=P.composed??!1}}class u extends k{detail;constructor($,P={}){super($,P);this.detail=P.detail}}class K extends D{isConnected=!1;constructor($="div",P=f()){super($,P)}insertAdjacentHTML($,P){this.append(...z1(P,this.ownerDocument))}}class y extends K{constructor($=f()){super("script",$)}}class c extends R{constructor(){super(R.DOCUMENT_NODE)}createElement($){return $.toLowerCase()==="script"?new y(this):new K($,this)}createTextNode($){return new V($,this)}querySelector(){return null}querySelectorAll(){return[]}}class w1{definitions=new Map;define($,P){if(this.definitions.has($))return;this.definitions.set($,P)}get($){return this.definitions.get($)}}var _,s={escape($){return W$(String($))}};function q$($){return new V($,f())}function f(){return globalThis.document??null}function b1(){let $=globalThis,P=$.customElements;if(typeof $.Node>"u"||typeof $.Document>"u"||typeof $.Element>"u"||typeof $.HTMLElement>"u"||typeof $.document>"u"||!P||typeof P.define!=="function"||typeof P.get!=="function")return;return $.window??{CSS:$.CSS??s,CustomEvent:$.CustomEvent??u,Document:$.Document,Element:$.Element,Event:$.Event??k,EventTarget:$.EventTarget??EventTarget,HTMLScriptElement:$.HTMLScriptElement??$.HTMLElement,HTMLElement:$.HTMLElement,Node:$.Node,document:$.document,customElements:P}}function p(){let $=b1();if($)return $;return Q$()}function L1(){return p(),{prepareHost($,P={}){if(P.authoredContent!==void 0)$.innerHTML=P.authoredContent}}}function Q$(){let $=b1();if($)return $;if(_)return _;let P=new w1,j=new c,q=globalThis.Event??k,Q=globalThis.CustomEvent??u,Z=c,F=globalThis.EventTarget??EventTarget;return _={CSS:globalThis.CSS??s,CustomEvent:Q,Document:Z,Element:D,Event:q,EventTarget:F,HTMLScriptElement:y,HTMLElement:K,Node:R,document:j,customElements:P},Object.assign(globalThis,{CSS:globalThis.CSS??s,CustomEvent:Q,Document:Z,Element:D,Event:q,EventTarget:F,HTMLScriptElement:y,HTMLElement:K,Node:R,document:j,customElements:P,window:_}),_}function Z$($,P,j){let q=P.tagName==="script"?new y(j):new K(P.tagName,j);return q.setSerializedFragment($,J$(P.innerHtml),P.attributes),q}function F$($){return $.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function J$($){return $.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function z1($,P=f()){return V1($).map((j)=>{if(!j.startsWith("<"))return new V(j,P);let q=A(j,0);if(!q||q.type!=="open")return new V(j,P);return Z$(j,q,P)})}function x($){return`data-${$.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function R$($){return $.replace(/-([a-z])/g,(P,j)=>j.toUpperCase())}function W$($){let P="";for(let j=0;j<$.length;j+=1){let q=$[j]??"",Q=q.codePointAt(0)??0;if(Q===0){P+="�";continue}let Z=Q>=1&&Q<=31||Q===127,F=j===0&&Q>=48&&Q<=57,J=j===1&&(Q>=48&&Q<=57)&&($[0]??"")==="-",W=j===0&&q==="-"&&$.length===1;if(Z||F||J){P+=`\\${Q.toString(16)} `;continue}if(Q>=128||q==="-"||q==="_"||Q>=48&&Q<=57||Q>=65&&Q<=90||Q>=97&&Q<=122){P+=W?`\\${q}`:q;continue}P+=`\\${q}`}return P}function G$($){if($.nodeType===R.TEXT_NODE)return $.textContent??"";return"outerHTML"in $&&typeof $.outerHTML==="string"?$.outerHTML:$.textContent??""}Y();function H$($,P="hydrate"){return{kind:"script-module",src:$,stage:P}}function xP($){return{kind:"modulepreload",href:$}}function VP($,P){return P?{kind:"style",href:$,media:P}:{kind:"style",href:$}}async function yP($,P){return(await C(E($,P))).markup}async function wP($,P){return C(E($,P))}async function bP($,P){return d(await C(E($,P)))}async function LP($,P){return f$(await C(E($,P)))}async function C($){Y();let P=$.environment??L1(),j=T(K$($.ssrContext));try{let q="component"in $?$.component:await $.load(),Q=new q;Y$(P,Q,$.authoredContent,$.prepareHost),$.initialize?.(Q);let Z=$.clientModuleSrc??await $.resolveClientModuleSrc?.(q),F=$.assets??await $.resolveAssets?.(q)??[],J=m(F,Z),W=i(J)??Z,I=$.tagName??A$(q),U=($.now??I$)().toISOString(),h=r($.renderOptions),a=U$(Q),l=a?.renderHostToString?.(h)??Q.renderHostToString(h),k1=X$(Q,a,l);return{markup:l,metadata:{assets:J,clientModuleUrl:W,generatedAt:U,tagName:I},preview:k1}}finally{j()}}function U$($){return w()?.resolveRenderBridge($)}function X$($,P,j){if(!P)return $.renderHost?.()??{nodeType:1,outerHTML:j};if(!P.renderHostToString&&P.renderHost)return{nodeType:1,outerHTML:j};return P.renderHost?.()??$.renderHost?.()??{nodeType:1,outerHTML:j}}function Y$($,P,j,q){if(!B$(P)){if(j===void 0&&q===void 0)return;throw Error(`${P.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}$.prepareHost(P,{authoredContent:j}),q?.(P,$)}function K$($){if(!$||$.length===0)return[];return $.map((P)=>({getContext:()=>P.value,getContextKey:()=>P.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function d($){if("metadata"in $)return{assets:$.metadata.assets,clientModuleSrc:$.metadata.clientModuleUrl,generatedAt:$.metadata.generatedAt,markup:$.markup,tagName:$.metadata.tagName};let{preview:P,...j}=$;return j}function f$($){return{assets:$.metadata.assets,clientModuleSrc:$.metadata.clientModuleUrl,generatedAt:$.metadata.generatedAt,markup:$.markup,preview:$.preview,tagName:$.metadata.tagName}}function I$(){return new Date}function h$($){if(!$)return[];return[H$($)]}function m($,P){if(!P)return $;if($.some((j)=>j.kind==="script-module"&&j.src===P))return $;return[...h$(P),...$]}function i($){return $.find((P)=>P.kind==="script-module")?.src}function E($,P){if(typeof $==="function")return{...P,component:$};return $}function r($){if($?.mode!==void 0||$?.hydrate!==void 0)return $;return{...$,mode:"hydrate"}}function B$($){return"innerHTML"in $}function A$($){let P=z($);if(!P)throw Error(`${$.name} is missing @customElement metadata.`);return P}import{renderToString as _$}from"@ecopages/jsx/server";async function OP($,P){return(await O($,P)).markup}async function SP($,P){return O($,P)}async function NP($,P){return d(await O($,P))}async function MP($,P){return x$(await O($,P))}async function O($,P){Y();let j=y$(P.tagName),q=w$(j,b$($,P)),Q=new $(q);try{P.initialize?.(Q),Q.connectForSsrRender();let Z=P.clientModuleSrc??await P.resolveClientModuleSrc?.($),F=P.assets??await P.resolveAssets?.($)??[],J=m(F,Z),W=i(J)??Z,I=(P.now??V$)().toISOString(),U=r(P.renderOptions),h=g$(Q,j,U);return{markup:h,metadata:{assets:J,clientModuleUrl:W,generatedAt:I,tagName:j},preview:{nodeType:1,outerHTML:h}}}finally{Q.disconnectForSsrRender()}}function x$($){return{assets:$.metadata.assets,clientModuleSrc:$.metadata.clientModuleUrl,generatedAt:$.metadata.generatedAt,markup:$.markup,preview:$.preview,tagName:$.metadata.tagName}}function V$(){return new Date}function y$($){let P=$.trim().toLowerCase();if(!P)throw Error("Controller SSR host tagName is required.");return P}function w$($,P){p();let j=globalThis.document,q=j?j.createElement($):new globalThis.HTMLElement($);for(let[Q,Z]of Object.entries(P)){if(Z===void 0||Z===null||Z===!1)continue;q.setAttribute(Q,Z===!0?"":String(Z))}return q}function b$($,P){let j={},q=P.host,Q=z$(P.attributes?.class,q?.class,q?.classes);if(Q!==void 0)j.class=Q;T1(j,"data",q?.data),T1(j,"aria",q?.aria),L$(j,P.attributes);let Z=Z1($);if(Z&&j[G]==null)j[G]=Z;return j}function T1($,P,j){if(!D1(j))return;for(let[q,Q]of Object.entries(j))$[`${P}-${T$(q)}`]=Q}function L$($,P){if(!P)return;for(let[j,q]of Object.entries(P))$[j]=q}function z$(...$){let P=[];for(let j of $)g1(P,j);return P.length===0?void 0:P.join(" ")}function g1($,P){if(P===void 0||P===null||P===!1||P===!0)return;if(typeof P==="string"){if(P!=="")$.push(P);return}if(typeof P==="number"||typeof P==="bigint"){$.push(String(P));return}if(Array.isArray(P)){for(let j of P)g1($,j);return}if(!D1(P))return;for(let[j,q]of Object.entries(P))if(q)$.push(j)}function D1($){return Object.prototype.toString.call($)==="[object Object]"}function T$($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function g$($,P,j){return`<${P}${D$($.host)}>${_$($.render(),j)}</${P}>`}function D$($){return $.getAttributeNames().map((P)=>k$(P,$.getAttribute(P))).join("")}function k$($,P){if(P==="")return` ${$}`;return` ${$}="${C$(P??"")}"`}function C$($){return $.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<").replaceAll(">",">")}export{MP as renderControllerWithPreview,OP as renderControllerToString,NP as renderControllerToPayload,SP as renderController};
|
|
1
|
+
var Z0=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(Q,$)=>(typeof require<"u"?require:Q)[$]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});var r=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function Jq(q,Q,$){let R=q.constructor,F=R[r]??[];if(F.some((Z)=>Z.name===Q))return;F.push({name:Q,options:$}),R[r]=F}function G1(q){return(q.constructor[r]??[]).slice()}var U1=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),K1=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),J0=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function Wq(q,Q){_1(q,U1,Q)}function Xq(q,Q){_1(q,K1,Q)}function Y1(q){i(q,U1)}function H1(q){let Q=q;i(q,K1,Q[J0]??=new Set)}function _1(q,Q,$){let R=q,F=Object.prototype.hasOwnProperty.call(R,Q)?R[Q]:void 0;if(Array.isArray(F)){F.push($);return}Object.defineProperty(R,Q,{value:[$]})}function i(q,Q,$,R=Object.getPrototypeOf(q)){if(!R||R===Object.prototype)return;i(q,Q,$,Object.getPrototypeOf(R));let F=R[Q];if(!Array.isArray(F))return;for(let Z of F){if($?.has(Z))continue;Z(q),$?.add(Z)}}function K(q,Q){switch(Q){case"construct":Y1(q);break;case"connect":case"ssr":H1(q);break}}function V1(q){switch(q){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function j0(q){switch(typeof q){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(q))return"array";if(Object.prototype.toString.call(q)==="[object Object]")return"object"}function W0(q){switch(q){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function X0(q){try{return JSON.parse(q)}catch{throw TypeError("Invalid JSON string")}}var P0={array(q){let Q=X0(q);if(!Array.isArray(Q))throw TypeError(`Expected an array but got a value of type "${typeof Q}"`);return Q},boolean(q){return!(q==="0"||String(q).toLowerCase()==="false")},number(q){return Number(q.replace(/_/g,""))},object(q){let Q=JSON.parse(q);if(Q===null||typeof Q!=="object"||Array.isArray(Q))throw TypeError(`expected value of type "object" but instead got value "${q}" of type "${j0(Q)}"`);return Q},string(q){return q}},w1={default:I1,array:x1,object:x1};function x1(q){return JSON.stringify(q)}function I1(q){return`${q}`}function L1(q,Q){let $=V1(Q);if(!$)throw TypeError(`[radiant-element] Unknown type "${Q}"`);return P0[$](q)}function D1(q,Q){let $=V1(Q);if(!$)throw TypeError(`[radiant-element] Unknown type "${Q}"`);return(w1[$]??w1.default??I1)(q)}function B0(q){return typeof q==="boolean"}function G0(q){return typeof q==="number"}function U0(q){return typeof q==="string"}function K0(q){return Array.isArray(q)}function Y0(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}function Uq(q,Q){switch(q){case Boolean:return B0(Q);case Number:return G0(Q);case String:return U0(Q);case Array:return K0(Q);case Object:return Y0(Q);default:return!1}}var Kq=(q,Q,$,R)=>{if(Q===Boolean){let Z=q.getAttribute($);if(Z===null)return R;return Z===""?!0:L1(Z,Q)}let F=q.getAttribute($);return F!==null?L1(F,Q):R??W0(Q)};import{getActiveSsrScopeValue as H0,withActiveSsrScopeValue as _0}from"@ecopages/jsx/server";var A1=Symbol.for("@ecopages/radiant.element-ssr-runtime");function _q(){return H0(A1)}function Y(q,Q){return _0(A1,q,Q)}var T1=Symbol.for("@ecopages/radiant.controllerIdentifier");function n(q,Q){q[T1]=Q}function E1(q){return q[T1]}var P="data-controller",f1=Symbol.for("@ecopages/radiant.controller-registry-state");function w0(){let q=globalThis,Q=q[f1];if(Q)return Q;let $={activeRuntimes:new Set,controllerRegistrationStrategy:"keep-current",controllerRegistry:new Map};return q[f1]=$,$}var y=w0(),B=y.controllerRegistry,H=y.activeRuntimes;function k1(q){let Q=q.getAttribute(P);if(!Q)return[];return Q.split(/\s+/).map(($)=>$.trim()).filter(($)=>$.length>0)}function N(q,Q){if(q instanceof Element&&q.hasAttribute(P))Q(q);for(let $ of Array.from(q.querySelectorAll(`[${P}]`)))Q($)}class C1{root;controllersByElement=new Map;observer;stopped=!1;constructor(q=document){this.root=q;this.start()}stop(){if(this.stopped)return;this.stopped=!0,this.observer?.disconnect(),this.observer=void 0;for(let[q,Q]of this.controllersByElement)for(let[$]of Q)this.disconnectController(q,$);H.delete(this)}reconcileRegisteredController(q){N(this.root,(Q)=>{if(!k1(Q).includes(q))return;this.connectController(Q,q)})}replaceRegisteredController(q){for(let[Q,$]of Array.from(this.controllersByElement.entries())){if(!$.has(q))continue;this.disconnectController(Q,q)}this.reconcileRegisteredController(q)}start(){if(N(this.root,(Q)=>{this.reconcileElement(Q)}),typeof MutationObserver>"u"){H.add(this);return}this.observer=new MutationObserver((Q)=>{for(let $ of Q){if($.type==="attributes"&&$.target instanceof Element){this.reconcileElement($.target);continue}for(let R of Array.from($.removedNodes)){if(!(R instanceof Element))continue;N(R,(F)=>{this.disconnectElementControllers(F)})}for(let R of Array.from($.addedNodes)){if(!(R instanceof Element))continue;N(R,(F)=>{this.reconcileElement(F)})}}});let q=this.root instanceof Document?this.root.documentElement:this.root;this.observer.observe(q,{attributeFilter:[P],attributes:!0,childList:!0,subtree:!0}),H.add(this)}reconcileElement(q){let Q=new Set(k1(q)),$=this.controllersByElement.get(q);if($){for(let R of $.keys())if(!Q.has(R))this.disconnectController(q,R)}for(let R of Q)this.connectController(q,R)}connectController(q,Q){let $=B.get(Q);if(!$)return;let R=this.controllersByElement.get(q);if(!R)R=new Map,this.controllersByElement.set(q,R);if(R.has(Q))return;let F=new $(q);R.set(Q,F),F.connect()}disconnectController(q,Q){let $=this.controllersByElement.get(q);if(!$)return;let R=$.get(Q);if(!R)return;if(R.disconnect(),$.delete(Q),$.size===0)this.controllersByElement.delete(q)}disconnectElementControllers(q){let Q=this.controllersByElement.get(q);if(!Q)return;for(let $ of Array.from(Q.keys()))this.disconnectController(q,$)}}function x0(q,Q){let $=B.get(q);if($)return console.warn(`[radiant] Controller "${q}" is already registered. Keeping the existing constructor.`),$;n(Q,q),B.set(q,Q);for(let R of Array.from(H))R.reconcileRegisteredController(q);return Q}function Vq(q){return B.has(q)}function Iq(q){return B.get(q)}function L0(q,Q){if(B.get(q)===Q)return Q;n(Q,q),B.set(q,Q);for(let R of Array.from(H))R.replaceRegisteredController(q);return Q}function z1(q){y.controllerRegistrationStrategy=q}function Dq(){z1("replace")}function Aq(){z1("keep-current")}function Tq(q,Q){if(y.controllerRegistrationStrategy==="replace")return L0(q,Q);return x0(q,Q)}function Eq(q=document){return new C1(q)}function fq(){for(let q of Array.from(H))q.stop()}var O1=Symbol.for("@ecopages/radiant.customElementTagName");function Cq(q,Q){q[O1]=Q}function M(q){return q[O1]}function h(q){return q.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function b1(q){let Q={},$=new Set;return V0(q,Q,$),I0(q,Q,$),D0(q,Q),Q}function S1(q){return Object.entries(q).map(([Q,$])=>` ${Q}="${h($)}"`).join("")}function V0(q,Q,$){for(let R of q.getReactiveProperties()){let F=q.getPropertyValue(R.name);if(F===void 0||F===null||F===!1)continue;Q[R.attribute]=String(R.converter.toAttribute(F)),$.add(R.attribute)}}function I0(q,Q,$){for(let R of q.getReactivePropDefinitions()){let F=R.options.attribute??R.name;if($.has(F))continue;let Z=q.getPropertyValue(R.name);if(Z===void 0||Z===null||Z===!1)continue;Q[F]=String(D1(Z,R.options.type)),$.add(F)}}function D0(q,Q){for(let $ of q.getAttributeNames()){let R=q.getAttribute($);if(R!==null)Q[$]=R}}var g1=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function N1(){return globalThis}function y1(q){N1()[g1]=q}function Nq(q){return N1()[g1]?.(q)}var A;function h1(){if(A!==void 0)return A;try{let{AsyncLocalStorage:q}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return A=new q,A}catch{return A=null,null}}var M1=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function v1(){let q=globalThis;return q[M1]??=[],q[M1]}function _(q){if(q.length===0)return()=>{return};let Q=new Map;for(let F of q)Q.set(F.getContextKey(),F);let $=h1();if($){let F=$.getStore()??[],Z=[...F,Q];return $.enterWith(Z),()=>{$.enterWith(F)}}let R=v1();return R.push(Q),()=>{let F=R.lastIndexOf(Q);if(F>=0)R.splice(F,1)}}function u1(q){let Q=h1()?.getStore()??v1();for(let $=Q.length-1;$>=0;$-=1){let R=Q[$]?.get(q);if(R)return R}return}function hq(q){let Q=u1(q);if(!Q)return;return Q.getContext()}y1((q)=>u1(q));function d1(q,Q){if(!Q)return`${q.hostContent}${q.authoredHydrationMarkup}${q.slotProjectionScript}`;return`${q.hostContent}${q.slotProjectionScript}${q.hydrationScripts}`}function w(q){if(A0(q))return q;return}function A0(q){return typeof q.constructor==="function"&&typeof q.getAttribute==="function"&&typeof q.getAttributeNames==="function"&&typeof q.getAuthoredHydrationScriptMarkup==="function"&&typeof q.getContextProviders==="function"&&typeof q.getHydrationBindings==="function"&&typeof q.getReactiveProperties==="function"&&typeof q.getSlotProjectionScriptTag==="function"&&typeof q.resolveTrackedRenderOutput==="function"&&typeof q.renderViewToString==="function"}function c1(q){let Q=w(q);if(!Q)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:Q.constructor,getAttribute:($)=>Q.getAttribute($),getAttributeNames:()=>Q.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>Q.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>Q.getContextProviders(),getHydrationBindings:()=>Q.getHydrationBindings(),getReactiveProperties:()=>Q.getReactiveProperties(),getReactivePropDefinitions:()=>G1(q),getPropertyValue:($)=>Reflect.get(q,$),getSlotProjectionScriptTag:()=>Q.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>Q.resolveTrackedRenderOutput(),renderViewToString:($)=>Q.renderViewToString($)}}class o{component;host;constructor(q){this.component=q,this.host=c1(q)}ensureReady(){K(this.component,"ssr")}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(q={},Q=this.getHostAttributes()){this.ensureReady();let $=this.getTagName(),R=_(this.host.getContextProviders());try{return`<${$}${S1(Q)}>${this.renderHostContent(q)}</${$}>`}finally{R()}}getHostAttributes(){return this.ensureReady(),b1(this.host)}renderHostContent(q){let Q=q.mode==="hydrate"||q.mode===void 0&&q.hydrate===!0,$=Q?this.host.getHydrationBindings().map((R)=>R.renderHydrationScriptTag()).filter((R)=>typeof R==="string").join(""):"";return d1({hostContent:this.host.renderViewToString(q),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:$},Q)}getTagName(){let q=M(this.host.constructor);if(!q)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return q}}import{renderToString as T0}from"@ecopages/jsx/server";import{createServerHydrationBindingState as p1,isServerRenderHydrationActive as s1,withForcedServerCustomElementRendering as E0,withServerCustomElementRenderHook as f0,withServerHydrationBindingState as m1}from"@ecopages/jsx/server";var v;function t(q){return new o(q)}function T(q){return{nodeType:1,outerHTML:G(q,{mode:"hydrate"})}}function e(q){if(E(q))return T(q);if(!d(q))return;return q.renderHost?.()??{nodeType:1,outerHTML:q.renderHostToString({mode:"hydrate"})}}function G(q,Q={}){return R1(()=>t(q).renderHostToString(Q,$1(q)))}function q1(q,Q={}){if(E(q))return G(q,Q);if(!d(q))return;return q.renderHostToString(Q)}function Q1(q,Q){if(E(q))return T(q);if(!d(q))return;return q.renderHost?.()??{nodeType:1,outerHTML:Q}}function l1(q,Q={}){return R1(()=>u(()=>T0(r1(q).value,Q)))}function $1(q){return t(q).getHostAttributes()}function a1(q){if(!E(q))return;return{renderHost:()=>T(q),renderHostToString:(Q)=>G(q,Q)}}function k0(q){return w(q)}function u(q){return E0(()=>f0(({instance:Q})=>{if(E(Q))return{nodeType:1,get outerHTML(){let R=s1(),F={hydrate:R,mode:R?"hydrate":"plain"};if(!R)return G(Q,F);return m1(p1(),()=>G(Q,F))}};if(!d(Q))return;let $=Q;return{nodeType:1,get outerHTML(){let R=s1();if(!R)return $.renderHostToString({hydrate:R,mode:R?"hydrate":"plain"});return m1(p1(),()=>$.renderHostToString({hydrate:R,mode:R?"hydrate":"plain"}))}}},q))}function r1(q){if(C0(q))return q.resolveTrackedRenderOutput();let Q=w(q);if(!Q)throw Error("Radiant SSR runtime requires tracked render output support on the component.");return Q.resolveTrackedRenderOutput()}function E(q){if(typeof q!=="object"||q===null)return!1;return w(q)!==void 0}function d(q){if(typeof q!=="object"||q===null)return!1;return typeof q.renderHostToString==="function"}function C0(q){if(typeof q!=="object"||q===null)return!1;return typeof q.resolveTrackedRenderOutput==="function"}function x(){if(v)return v;return v={getHostAttributes:$1,renderHost:T,renderHostToString:G,resolveRenderBridge:a1,renderView:l1},v}function R1(q){return Y(x(),q)}var c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function i1(q){let Q=[],$=0;while($<q.length){let R=$;if(q.startsWith("<!--",$)){let j=q.indexOf("-->",$+4);$=j===-1?q.length:j+3,Q.push(q.slice(R,$));continue}if(q[$]!=="<"){let j=q.indexOf("<",$);$=j===-1?q.length:j,Q.push(q.slice(R,$));continue}let F=f(q,$);if(!F){Q.push(q.slice(R));break}if(F.type!=="open"||F.selfClosing||c.has(F.tagName)){$=F.end,Q.push(q.slice(R,$));continue}$=F.end;let Z=1;while($<q.length&&Z>0){let j=q.indexOf("<",$);if(j===-1){$=q.length;break}let J=f(q,j);if(!J){$=q.length;break}if($=J.end,J.type==="comment"||J.type==="declaration")continue;if(J.type==="open"&&!J.selfClosing&&!c.has(J.tagName)){Z+=1;continue}if(J.type==="close")Z-=1}Q.push(q.slice(R,$))}return Q.filter((R)=>R!=="")}function z0(q,Q){let $;for(let R=Q+1;R<q.length;R+=1){let F=q[R];if($){if(F===$)$=void 0;continue}if(F==='"'||F==="'"){$=F;continue}if(F===">")return R+1}return q.length}function O0(q){let Q={},$=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let R of q.matchAll($)){let[,F,Z,j,J]=R;if(!F)continue;Q[F]=Z??j??J??""}return Q}function f(q,Q){if(q.startsWith("<!--",Q)){let U=q.indexOf("-->",Q+4);return{end:U===-1?q.length:U+3,type:"comment"}}let $=z0(q,Q),R=q.slice(Q+1,$-1).trim();if(R==="")return;if(R.startsWith("!")||R.startsWith("?"))return{end:$,type:"declaration"};if(R.startsWith("/"))return{end:$,type:"close"};let F=/\/\s*$/.test(R),Z=F?R.replace(/\/\s*$/,"").trim():R,j=Z.split(/[\s/>]/,1)[0]?.toLowerCase()??"",J=j.length,X=Z.slice(J).trim(),I=F||c.has(j)?"":b0(q,Q,$,j);return{attributes:O0(X),end:$,innerHtml:I,selfClosing:F,tagName:j,type:"open"}}function b0(q,Q,$,R){let F=$,Z=1;while(F<q.length&&Z>0){let j=q.indexOf("<",F);if(j===-1)return q.slice($);let J=f(q,j);if(!J)return q.slice($);if(J.type==="open"&&J.tagName===R&&!J.selfClosing&&!c.has(R))Z+=1;if(J.type==="close"){if(q.slice(j+2,J.end-1).trim().toLowerCase()===R){if(Z-=1,Z===0)return q.slice($,j)}}F=J.end}return q.slice($)}class W extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor(q,Q=null){super();this.nodeType=q;this.ownerDocument=Q}append(...q){for(let Q of q)this.appendChild(typeof Q==="string"?S0(Q):Q)}appendChild(q){if("parentNode"in q&&q.parentNode&&"removeChild"in q.parentNode)q.parentNode.removeChild(q);return this.childNodes.push(q),q.ownerDocument=this.nodeType===W.DOCUMENT_NODE?this:this.ownerDocument,q.parentNode=this,q}removeChild(q){let Q=this.childNodes.indexOf(q);if(Q===-1)return q;return this.childNodes.splice(Q,1),q.parentNode=null,q}replaceChildren(...q){for(let Q of this.childNodes)Q.parentNode=null;this.childNodes=[],this.append(...q)}get textContent(){return this.childNodes.map((q)=>q.textContent??"").join("")}set textContent(q){this.replaceChildren(q??"")}getRootNode(){let q=this;while("parentNode"in q&&q.parentNode)q=q.parentNode;return q}}class z extends W{value;constructor(q,Q=V()){super(W.TEXT_NODE,Q);this.value=q}get textContent(){return this.value}set textContent(q){this.value=q??""}}class n1{element;constructor(q){this.element=q}add(...q){let Q=new Set(this.readTokens());for(let $ of q)if($!=="")Q.add($);this.writeTokens([...Q])}remove(...q){let Q=new Set(this.readTokens());for(let $ of q)Q.delete($);this.writeTokens([...Q])}toggle(q,Q){let $=this.contains(q);if(Q??!$)return this.add(q),!0;return this.remove(q),!1}contains(q){return this.readTokens().includes(q)}toString(){return this.value}get value(){return this.element.getAttribute("class")??""}readTokens(){return this.value.split(/\s+/).map((q)=>q.trim()).filter((q)=>q.length>0)}writeTokens(q){if(q.length===0){this.element.removeAttribute("class");return}this.element.setAttribute("class",q.join(" "))}}class p extends W{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor(q="div",Q=V()){super(W.ELEMENT_NODE,Q);this.localName=q.toLowerCase(),this.tagName=this.localName.toUpperCase()}get id(){return this.getAttribute("id")??""}set id(q){if(q===""){this.removeAttribute("id");return}this.setAttribute("id",q)}get classList(){return this.classListValue??=new n1(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:(q,Q)=>{if(typeof Q!=="string")return!1;return this.removeAttribute(C(Q)),!0},get:(q,Q)=>{if(typeof Q!=="string")return;return this.getAttribute(C(Q))??void 0},getOwnPropertyDescriptor:(q,Q)=>{if(typeof Q!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(C(Q))??void 0,writable:!0}},has:(q,Q)=>{return typeof Q==="string"&&this.hasAttribute(C(Q))},ownKeys:()=>{return this.getAttributeNames().filter((q)=>q.startsWith("data-")).map((q)=>h0(q.slice(5)))},set:(q,Q,$)=>{if(typeof Q!=="string")return!1;return this.setAttribute(C(Q),String($)),!0}}),this.datasetValue}hasAttribute(q){return this.attributes.has(q)}getAttribute(q){return this.attributes.get(q)??null}getAttributeNames(){return Array.from(this.attributes.keys())}setAttribute(q,Q){this.fragmentHtml=void 0,this.attributes.set(q,String(Q))}toggleAttribute(q,Q){if(Q??!this.hasAttribute(q))return this.setAttribute(q,""),!0;return this.removeAttribute(q),!1}removeAttribute(q){this.fragmentHtml=void 0,this.attributes.delete(q)}querySelector(){return null}querySelectorAll(){return[]}matches(){return!1}get outerHTML(){if(this.fragmentHtml!==void 0)return this.fragmentHtml;let q=Array.from(this.attributes.entries()).map(([Q,$])=>` ${Q}="${y0($)}"`).join("");return`<${this.localName}${q}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((q)=>u0(q)).join("")}set innerHTML(q){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...q0(q,this.ownerDocument))}get textContent(){return this.fragmentText??super.textContent??""}set textContent(q){this.fragmentHtml=void 0,this.fragmentText=q??"",super.textContent=q}setSerializedFragment(q,Q,$){this.fragmentHtml=q,this.fragmentText=Q,this.attributes=new Map(Object.entries($)),this.replaceChildren()}}class s{bubbles;cancelable;composed;type;constructor(q,Q={}){this.type=q,this.bubbles=Q.bubbles??!1,this.cancelable=Q.cancelable??!1,this.composed=Q.composed??!1}}class J1 extends s{detail;constructor(q,Q={}){super(q,Q);this.detail=Q.detail}}class L extends p{isConnected=!1;constructor(q="div",Q=V()){super(q,Q)}insertAdjacentHTML(q,Q){this.append(...q0(Q,this.ownerDocument))}}class O extends L{constructor(q=V()){super("script",q)}}class F1 extends W{constructor(){super(W.DOCUMENT_NODE)}createElement(q){return q.toLowerCase()==="script"?new O(this):new L(q,this)}createTextNode(q){return new z(q,this)}querySelector(){return null}querySelectorAll(){return[]}}class o1{definitions=new Map;define(q,Q){if(this.definitions.has(q))return;this.definitions.set(q,Q)}get(q){return this.definitions.get(q)}}var k,Z1={escape(q){return v0(String(q))}};function S0(q){return new z(q,V())}function V(){return globalThis.document??null}function t1(){let q=globalThis,Q=q.customElements;if(typeof q.Node>"u"||typeof q.Document>"u"||typeof q.Element>"u"||typeof q.HTMLElement>"u"||typeof q.document>"u"||!Q||typeof Q.define!=="function"||typeof Q.get!=="function")return;return q.window??{CSS:q.CSS??Z1,CustomEvent:q.CustomEvent??J1,Document:q.Document,Element:q.Element,Event:q.Event??s,EventTarget:q.EventTarget??EventTarget,HTMLScriptElement:q.HTMLScriptElement??q.HTMLElement,HTMLElement:q.HTMLElement,Node:q.Node,document:q.document,customElements:Q}}function j1(){let q=t1();if(q)return q;return g0()}function e1(){return j1(),{prepareHost(q,Q={}){if(Q.authoredContent!==void 0)q.innerHTML=Q.authoredContent}}}function g0(){let q=t1();if(q)return q;if(k)return k;let Q=new o1,$=new F1,R=globalThis.Event??s,F=globalThis.CustomEvent??J1,Z=F1,j=globalThis.EventTarget??EventTarget;return k={CSS:globalThis.CSS??Z1,CustomEvent:F,Document:Z,Element:p,Event:R,EventTarget:j,HTMLScriptElement:O,HTMLElement:L,Node:W,document:$,customElements:Q},Object.assign(globalThis,{CSS:globalThis.CSS??Z1,CustomEvent:F,Document:Z,Element:p,Event:R,EventTarget:j,HTMLScriptElement:O,HTMLElement:L,Node:W,document:$,customElements:Q,window:k}),k}function N0(q,Q,$){let R=Q.tagName==="script"?new O($):new L(Q.tagName,$);return R.setSerializedFragment(q,M0(Q.innerHtml),Q.attributes),R}function y0(q){return q.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function M0(q){return q.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function q0(q,Q=V()){return i1(q).map(($)=>{if(!$.startsWith("<"))return new z($,Q);let R=f($,0);if(!R||R.type!=="open")return new z($,Q);return N0($,R,Q)})}function C(q){return`data-${q.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function h0(q){return q.replace(/-([a-z])/g,(Q,$)=>$.toUpperCase())}function v0(q){let Q="";for(let $=0;$<q.length;$+=1){let R=q[$]??"",F=R.codePointAt(0)??0;if(F===0){Q+="�";continue}let Z=F>=1&&F<=31||F===127,j=$===0&&F>=48&&F<=57,J=$===1&&F>=48&&F<=57&&(q[0]??"")==="-",X=$===0&&R==="-"&&q.length===1;if(Z||j||J){Q+=`\\${F.toString(16)} `;continue}if(F>=128||R==="-"||R==="_"||F>=48&&F<=57||F>=65&&F<=90||F>=97&&F<=122){Q+=X?`\\${R}`:R;continue}Q+=`\\${R}`}return Q}function u0(q){if(q.nodeType===W.TEXT_NODE)return q.textContent??"";return"outerHTML"in q&&typeof q.outerHTML==="string"?q.outerHTML:q.textContent??""}function b(){return new Date}function S(q){if("metadata"in q)return{assets:q.metadata.assets,clientModuleSrc:q.metadata.clientModuleUrl,generatedAt:q.metadata.generatedAt,markup:q.markup,tagName:q.metadata.tagName};let{preview:Q,...$}=q;return $}function g(q){return{assets:q.metadata.assets,clientModuleSrc:q.metadata.clientModuleUrl,generatedAt:q.metadata.generatedAt,markup:q.markup,preview:q.preview,tagName:q.metadata.tagName}}function d0(q,Q="hydrate"){return{kind:"script-module",src:q,stage:Q}}function wQ(q){return{kind:"modulepreload",href:q}}function xQ(q,Q){return Q?{kind:"style",href:q,media:Q}:{kind:"style",href:q}}async function LQ(q,Q){return(await m(l(q,Q))).markup}async function VQ(q,Q){return m(l(q,Q))}async function IQ(q,Q){return S(await m(l(q,Q)))}async function DQ(q,Q){return g(await m(l(q,Q)))}async function m(q){return Y(x(),async()=>{let Q=q.environment??e1(),$=_(s0(q.ssrContext));try{let R="component"in q?q.component:await q.load(),F=new R;K(F,"ssr"),p0(Q,F,q.authoredContent,q.prepareHost),q.initialize?.(F);let Z=q.clientModuleSrc??await q.resolveClientModuleSrc?.(R),j=q.assets??await q.resolveAssets?.(R)??[],J=W1(j,Z),X=X1(J)??Z,I=q.tagName??r0(R),U=(q.now??b)().toISOString(),D=P1(q.renderOptions),B1=q1(F,D)??a0(F,D),F0=c0(F,B1);return{markup:B1,metadata:{assets:J,clientModuleUrl:X,generatedAt:U,tagName:I},preview:F0}}finally{$()}})}function c0(q,Q){return Q1(q,Q)??e(q)??q.renderHost?.()??{nodeType:1,outerHTML:Q}}function p0(q,Q,$,R){if(!l0(Q)){if($===void 0&&R===void 0)return;throw Error(`${Q.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}q.prepareHost(Q,{authoredContent:$}),R?.(Q,q)}function s0(q){if(!q||q.length===0)return[];return q.map((Q)=>({getContext:()=>Q.value,getContextKey:()=>Q.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function m0(q){if(!q)return[];return[d0(q)]}function W1(q,Q){if(!Q)return q;if(q.some(($)=>$.kind==="script-module"&&$.src===Q))return q;return[...m0(Q),...q]}function X1(q){return q.find((Q)=>Q.kind==="script-module")?.src}function l(q,Q){if(typeof q==="function")return{...Q,component:q};return q}function P1(q){if(q?.mode!==void 0||q?.hydrate!==void 0)return q;return{...q,mode:"hydrate"}}function l0(q){return"innerHTML"in q}function a0(q,Q){if(typeof q.renderHostToString==="function")return q.renderHostToString(Q);throw Error(`${q.constructor.name} cannot be server-rendered without a registered Radiant SSR host or renderHostToString().`)}function r0(q){let Q=M(q);if(!Q)throw Error(`${q.name} is missing @customElement metadata.`);return Q}import{renderToString as i0}from"@ecopages/jsx/server";async function MQ(q,Q){return(await a(q,Q)).markup}async function hQ(q,Q){return a(q,Q)}async function vQ(q,Q){return S(await a(q,Q))}async function uQ(q,Q){return g(await a(q,Q))}async function a(q,Q){return Y(x(),async()=>{let $=n0(Q.tagName),R=o0($,t0(q,Q)),F=new q(R);K(F,"ssr");try{Q.initialize?.(F),F.runWithSsrLifecycle(()=>F.connect());let Z=Q.clientModuleSrc??await Q.resolveClientModuleSrc?.(q),j=Q.assets??await Q.resolveAssets?.(q)??[],J=W1(j,Z),X=X1(J)??Z,I=(Q.now??b)().toISOString(),U=P1(Q.renderOptions),D=$q(F,$,U);return{markup:D,metadata:{assets:J,clientModuleUrl:X,generatedAt:I,tagName:$},preview:{nodeType:1,outerHTML:D}}}finally{F.disconnect()}})}function n0(q){let Q=q.trim().toLowerCase();if(!Q)throw Error("Controller SSR host tagName is required.");return Q}function o0(q,Q){let R=j1().document.createElement(q);for(let[F,Z]of Object.entries(Q)){if(Z===void 0||Z===null||Z===!1)continue;R.setAttribute(F,Z===!0?"":String(Z))}return R}function t0(q,Q){let $={},R=Q.host,F=qq(Q.attributes?.class,R?.class,R?.classes);if(F!==void 0)$.class=F;Q0($,"data",R?.data),Q0($,"aria",R?.aria),e0($,Q.attributes);let Z=E1(q);if(Z&&$[P]==null)$[P]=Z;return $}function Q0(q,Q,$){if(!R0($))return;for(let[R,F]of Object.entries($))q[`${Q}-${Qq(R)}`]=F}function e0(q,Q){if(!Q)return;for(let[$,R]of Object.entries(Q))q[$]=R}function qq(...q){let Q=[];for(let $ of q)$0(Q,$);return Q.length===0?void 0:Q.join(" ")}function $0(q,Q){if(Q===void 0||Q===null||Q===!1||Q===!0)return;if(typeof Q==="string"){if(Q!=="")q.push(Q);return}if(typeof Q==="number"||typeof Q==="bigint"){q.push(String(Q));return}if(Array.isArray(Q)){for(let $ of Q)$0(q,$);return}if(!R0(Q))return;for(let[$,R]of Object.entries(Q))if(R)q.push($)}function R0(q){return Object.prototype.toString.call(q)==="[object Object]"}function Qq(q){return q.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function $q(q,Q,$){let R=_(q.getSsrContextProviders());try{let F=u(()=>i0(q.render(),$)),j=$.mode==="hydrate"||$.mode===void 0&&$.hydrate===!0?q.getSsrHydrationBindings().map((J)=>J.renderHydrationScriptTag()).filter((J)=>typeof J==="string").join(""):"";return`<${Q}${Rq(q.host)}>${F}${j}</${Q}>`}finally{R()}}function Rq(q){return q.getAttributeNames().map((Q)=>Fq(Q,q.getAttribute(Q))).join("")}function Fq(q,Q){if(Q==="")return` ${q}`;return` ${q}="${h(Q??"")}"`}export{uQ as renderControllerWithPreview,MQ as renderControllerToString,vQ as renderControllerToPayload,hQ as renderController};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=9CA97A2CC1F9288464756E2164756E21
|